diff options
author | Ingela Anderton Andin <[email protected]> | 2011-11-30 18:05:21 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2011-12-09 10:36:21 +0100 |
commit | ca0ee66eb4ea52e8c36aaf683cdef32e4d2cb9bc (patch) | |
tree | a659ba8406cc794ce0dc55260319d2f7a7189933 /lib/public_key/src/public_key.erl | |
parent | ac3cbe8bee6b826004c02a1d21f8093899716b33 (diff) | |
download | otp-ca0ee66eb4ea52e8c36aaf683cdef32e4d2cb9bc.tar.gz otp-ca0ee66eb4ea52e8c36aaf683cdef32e4d2cb9bc.tar.bz2 otp-ca0ee66eb4ea52e8c36aaf683cdef32e4d2cb9bc.zip |
Converted pk12 test suite files to pem and adjusted our framework
to deal with changes to the pkits suite.
Diffstat (limited to 'lib/public_key/src/public_key.erl')
-rw-r--r-- | lib/public_key/src/public_key.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index 753322b46d..2e2a6cd296 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -48,7 +48,7 @@ -type rsa_padding() :: 'rsa_pkcs1_padding' | 'rsa_pkcs1_oaep_padding' | 'rsa_no_padding'. -type public_crypt_options() :: [{rsa_pad, rsa_padding()}]. --type rsa_digest_type() :: 'md5' | 'sha'. +-type rsa_digest_type() :: 'md5' | 'sha'| 'sha256' | 'sha512'. -type dss_digest_type() :: 'none' | 'sha'. -define(UINT32(X), X:32/unsigned-big-integer). @@ -354,7 +354,10 @@ sign(PlainText, sha, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X}) %%-------------------------------------------------------------------- verify(PlainText, DigestType, Signature, #'RSAPublicKey'{modulus = Mod, publicExponent = Exp}) - when is_binary (PlainText), DigestType == sha; DigestType == md5 -> + when is_binary (PlainText) and (DigestType == sha orelse + DigestType == sha256 orelse + DigestType == sha512 orelse + DigestType == md5) -> crypto:rsa_verify(DigestType, sized_binary(PlainText), sized_binary(Signature), |