aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public_key
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-09-28 11:59:22 +0200
committerSverker Eriksson <[email protected]>2011-09-28 11:59:22 +0200
commit0843769ab9c3263b368b49b95a8b97478a82dbea (patch)
tree817ec4dd451b4ce9c8aeb50a1280ba2ef3d187b9 /lib/public_key
parentdf20d15f2229fa5da1c9b7ab8b41b2d706d586f8 (diff)
parent2fa5d1e5146513f933c584c9bd444b7f03793820 (diff)
downloadotp-0843769ab9c3263b368b49b95a8b97478a82dbea.tar.gz
otp-0843769ab9c3263b368b49b95a8b97478a82dbea.tar.bz2
otp-0843769ab9c3263b368b49b95a8b97478a82dbea.zip
Merge branch 'dev' into major
Diffstat (limited to 'lib/public_key')
-rw-r--r--lib/public_key/doc/src/public_key.xml2
-rw-r--r--lib/public_key/src/pubkey_cert.erl4
-rw-r--r--lib/public_key/src/public_key.appup.src12
-rw-r--r--lib/public_key/src/public_key.erl10
-rw-r--r--lib/public_key/test/public_key_SUITE.erl5
-rw-r--r--lib/public_key/vsn.mk2
6 files changed, 7 insertions, 28 deletions
diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml
index b3ce49e2ca..9a3832c68b 100644
--- a/lib/public_key/doc/src/public_key.xml
+++ b/lib/public_key/doc/src/public_key.xml
@@ -79,7 +79,7 @@
<p><code> rsa_padding() = 'rsa_pkcs1_padding' | 'rsa_pkcs1_oaep_padding'
| 'rsa_no_padding'</code></p>
- <p><code> rsa_digest_type() = 'md2' | 'md5' | 'sha' </code></p>
+ <p><code> rsa_digest_type() = 'md5' | 'sha' </code></p>
<p><code> dss_digest_type() = 'none' | 'sha' </code></p>
diff --git a/lib/public_key/src/pubkey_cert.erl b/lib/public_key/src/pubkey_cert.erl
index 61082a1ec5..5ab9642279 100644
--- a/lib/public_key/src/pubkey_cert.erl
+++ b/lib/public_key/src/pubkey_cert.erl
@@ -38,7 +38,7 @@
%%====================================================================
%%--------------------------------------------------------------------
--spec verify_data(DER::binary()) -> {md2 | md5 | sha, binary(), binary()}.
+-spec verify_data(DER::binary()) -> {md5 | sha, binary(), binary()}.
%%
%% Description: Extracts data from DerCert needed to call public_key:verify/4.
%%--------------------------------------------------------------------
@@ -378,8 +378,6 @@ digest_type(?sha1WithRSAEncryption) ->
sha;
digest_type(?md5WithRSAEncryption) ->
md5;
-digest_type(?md2WithRSAEncryption) ->
- md2;
digest_type(?'id-dsa-with-sha1') ->
sha.
diff --git a/lib/public_key/src/public_key.appup.src b/lib/public_key/src/public_key.appup.src
index 18fae54d18..4986801dad 100644
--- a/lib/public_key/src/public_key.appup.src
+++ b/lib/public_key/src/public_key.appup.src
@@ -1,12 +1,6 @@
%% -*- erlang -*-
{"%VSN%",
[
- {"0.12",
- [
- {update, public_key, soft, soft_purge, soft_purge, []},
- {update, pubkey_cert, soft, soft_purge, soft_purge, []},
- ]
- },
{"0.11",
[
{update, public_key, soft, soft_purge, soft_purge, []},
@@ -41,12 +35,6 @@
}
],
[
- {"0.12",
- [
- {update, public_key, soft, soft_purge, soft_purge, []},
- {update, pubkey_cert, soft, soft_purge, soft_purge, []},
- ]
- },
{"0.11",
[
{update, public_key, soft, soft_purge, soft_purge, []},
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),
diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl
index a9c198c581..b11e4d092a 100644
--- a/lib/public_key/test/public_key_SUITE.erl
+++ b/lib/public_key/test/public_key_SUITE.erl
@@ -537,10 +537,7 @@ rsa_sign_verify(Config) when is_list(Config) ->
false = public_key:verify(Msg, sha, <<1:8, RSASign/binary>>, PublicRSA),
RSASign1 = public_key:sign(Msg, md5, PrivateRSA),
- true = public_key:verify(Msg, md5, RSASign1, PublicRSA),
-
- RSASign2 = public_key:sign(Msg, md2, PrivateRSA),
- true = public_key:verify(Msg, md2, RSASign2, PublicRSA).
+ true = public_key:verify(Msg, md5, RSASign1, PublicRSA).
%%--------------------------------------------------------------------
diff --git a/lib/public_key/vsn.mk b/lib/public_key/vsn.mk
index 66ac78a65d..3c6b012152 100644
--- a/lib/public_key/vsn.mk
+++ b/lib/public_key/vsn.mk
@@ -1 +1 @@
-PUBLIC_KEY_VSN = 0.13
+PUBLIC_KEY_VSN = 0.12