From 3326cab005954dc6ba6c6596f77b5882b77f6be2 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 29 Nov 2010 15:40:48 +0100 Subject: Fixed guard and test case Data to sign and verify should be inputed as binaries. Also cleaned up and moved some dialyzer specs. --- lib/public_key/src/public_key.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/public_key/src') diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index 64496d6f15..30398df9cc 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -287,8 +287,8 @@ encrypt_private(PlainText, #'RSAPrivateKey'{modulus = N, sign(PlainText, DigestType, #'RSAPrivateKey'{modulus = N, publicExponent = E, privateExponent = D}) when is_binary(PlainText), - DigestType == md5; - DigestType == sha -> + (DigestType == md5 orelse + DigestType == sha) -> crypto:rsa_sign(DigestType, sized_binary(PlainText), [crypto:mpint(E), crypto:mpint(N), -- cgit v1.2.3