diff options
Diffstat (limited to 'src/pk_pad/emsa4/emsa4.cpp')
-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 ef88e1953..194d934c1 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; |