diff options
author | lloyd <[email protected]> | 2012-01-20 21:57:01 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-20 21:57:01 +0000 |
commit | 64b89f78ef04d2a36d01c7f6b61fc9871396fb0b (patch) | |
tree | ed248653c2138acd9fe6fbf60c157e5b26ec2dc2 /src/mac/hmac | |
parent | b7c09658fec70fe053b5dc5d4ebb31f91f5f41ff (diff) |
Increase the max key length of HMAC to 512 bytes. Previously we would
run into trouble in the TLS PRF with large pre-master secrets. This
especially crops up in TLS 1.2 as there the entire pre master secret
is fed to a single PRF (in earlier verions it is split in half). A
limit of 512 bytes allows a DH group up to 4096 bits which seems good
enough for now.
Also catch Invalid_Key_Length in the TLS PRF and throw an exception
that makes more sense - initially I was completely thrown off by the
HMAC key length exception, and it took me a while to figure it
out. Someone else looking at this the first time a server sends a 8192
bit DH group would be even more confused.
Diffstat (limited to 'src/mac/hmac')
-rw-r--r-- | src/mac/hmac/hmac.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mac/hmac/hmac.h b/src/mac/hmac/hmac.h index b76a058f4..9de1bc7b5 100644 --- a/src/mac/hmac/hmac.h +++ b/src/mac/hmac/hmac.h @@ -27,7 +27,7 @@ class BOTAN_DLL HMAC : public MessageAuthenticationCode Key_Length_Specification key_spec() const { - return Key_Length_Specification(0, 2*hash->hash_block_size()); + return Key_Length_Specification(0, 512); } /** |