aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public_key/src/public_key.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-09-28 11:49:47 +0200
committerSverker Eriksson <[email protected]>2011-09-28 11:49:47 +0200
commit2fa5d1e5146513f933c584c9bd444b7f03793820 (patch)
tree42bbdbdef3dd595609d7a75a1c85a757c7a2368e /lib/public_key/src/public_key.erl
parentb83073436a39553da458b19ef572ded9cd051611 (diff)
parenta474b24b6121ef411a3a3bda3e50cd69b5fbec17 (diff)
downloadotp-2fa5d1e5146513f933c584c9bd444b7f03793820.tar.gz
otp-2fa5d1e5146513f933c584c9bd444b7f03793820.tar.bz2
otp-2fa5d1e5146513f933c584c9bd444b7f03793820.zip
Merge branch 'sverker/revert-md2-With-RSA-Encryption' into dev
* sverker/revert-md2-With-RSA-Encryption: Revert "Prepare for release" Revert "Support md2WithRSAEncryption certificates in public_key" Revert "Support 'md2' hash in crypto:rsa_sign/3 and crypto:rsa_verify/4"
Diffstat (limited to 'lib/public_key/src/public_key.erl')
-rw-r--r--lib/public_key/src/public_key.erl10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl
index 940efffcd0..33fcce2c44 100644
--- a/lib/public_key/src/public_key.erl
+++ b/lib/public_key/src/public_key.erl
@@ -55,7 +55,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() :: 'md2' | 'md5' | 'sha'.
+-type rsa_digest_type() :: 'md5' | 'sha'.
-type dss_digest_type() :: 'none' | 'sha'.
-define(UINT32(X), X:32/unsigned-big-integer).
@@ -307,8 +307,7 @@ encrypt_private(PlainText, #'RSAPrivateKey'{modulus = N,
sign(PlainText, DigestType, #'RSAPrivateKey'{modulus = N, publicExponent = E,
privateExponent = D})
when is_binary(PlainText),
- (DigestType == md2 orelse
- DigestType == md5 orelse
+ (DigestType == md5 orelse
DigestType == sha) ->
crypto:rsa_sign(DigestType, sized_binary(PlainText), [crypto:mpint(E),
@@ -336,10 +335,7 @@ 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 == md2 orelse
- DigestType == md5 orelse
- DigestType == sha) ->
+ when is_binary (PlainText), DigestType == sha; DigestType == md5 ->
crypto:rsa_verify(DigestType,
sized_binary(PlainText),
sized_binary(Signature),