diff options
author | lloyd <[email protected]> | 2012-05-18 18:34:40 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-05-18 18:34:40 +0000 |
commit | d76700f01c7ecac5633edf75f8d7408b46c5dbac (patch) | |
tree | a1264f4238d58ca774812acbac8d4beffd49e449 /src/pk_pad/emsa4 | |
parent | ab5c922f0e2635dc0e45fc757b27be9f28986acb (diff) | |
parent | e0070253386bfd39b2a782c66ccf0caf9ce87ca2 (diff) |
propagate from branch 'net.randombit.botan' (head 6332543aa5a8a4cc13662008ff9ac0f0016d9a4d)
to branch 'net.randombit.botan.cxx11' (head 5517c9f8f6d1990f269afb94f569a97a80c5a5f4)
Diffstat (limited to 'src/pk_pad/emsa4')
-rw-r--r-- | src/pk_pad/emsa4/emsa4.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pk_pad/emsa4/emsa4.cpp b/src/pk_pad/emsa4/emsa4.cpp index 65078de5e..d05e4a5b5 100644 --- a/src/pk_pad/emsa4/emsa4.cpp +++ b/src/pk_pad/emsa4/emsa4.cpp @@ -74,10 +74,13 @@ bool EMSA4::verify(const MemoryRegion<byte>& const_coded, if(key_bits < 8*HASH_SIZE + 9) return false; + if(raw.size() != HASH_SIZE) return false; - if(const_coded.size() > KEY_BYTES) + + if(const_coded.size() > KEY_BYTES || const_coded.size() <= 1) return false; + if(const_coded[const_coded.size()-1] != 0xBC) return false; |