diff options
author | lloyd <[email protected]> | 2014-03-27 14:12:25 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-03-27 14:12:25 +0000 |
commit | e5bf2f0b5c177c4bea8983b552106e90efb79083 (patch) | |
tree | a2711e933058ea6680b8e0679cfd95c0f51669cb /src/lib | |
parent | eb0e85280e1feb4eaa66847fe60f9f6c713a8d4e (diff) |
Support 0 length salts in PSSR. Bugzilla 268
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/pk_pad/emsa_pssr/pssr.cpp | 7 | ||||
-rw-r--r-- | src/lib/pk_pad/emsa_pssr/pssr.h | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/pk_pad/emsa_pssr/pssr.cpp b/src/lib/pk_pad/emsa_pssr/pssr.cpp index 663d8089c..fa3748732 100644 --- a/src/lib/pk_pad/emsa_pssr/pssr.cpp +++ b/src/lib/pk_pad/emsa_pssr/pssr.cpp @@ -126,8 +126,13 @@ bool PSSR::verify(const secure_vector<byte>& const_coded, return same_mem(&H[0], &H2[0], HASH_SIZE); } +PSSR::PSSR(HashFunction* h) : + SALT_SIZE(h->output_length()), hash(h) + { + } + PSSR::PSSR(HashFunction* h, size_t salt_size) : - SALT_SIZE(salt_size ? salt_size : h->output_length()), hash(h) + SALT_SIZE(salt_size), hash(h) { } diff --git a/src/lib/pk_pad/emsa_pssr/pssr.h b/src/lib/pk_pad/emsa_pssr/pssr.h index 7693518f9..688fd2114 100644 --- a/src/lib/pk_pad/emsa_pssr/pssr.h +++ b/src/lib/pk_pad/emsa_pssr/pssr.h @@ -22,10 +22,14 @@ class BOTAN_DLL PSSR : public EMSA /** * @param hash the hash object to use + */ + PSSR(HashFunction* hash); + + /** + * @param hash the hash object to use * @param salt_size the size of the salt to use in bytes - * or zero to use the default */ - PSSR(HashFunction* hash, size_t salt_size = 0); + PSSR(HashFunction* hash, size_t salt_size); private: void update(const byte input[], size_t length); |