summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/n_pkey.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-02-02 00:45:54 +0000
committerDr. Stephen Henson <steve@openssl.org>2001-02-02 00:45:54 +0000
commit88ce56f8c19afca84548ce85bbc9b5dda3c724f9 (patch)
tree3246395c2be795f28d84443d3a193efe6d3a96fb /crypto/asn1/n_pkey.c
parent664d83bb23e7e6d30b63f6127b454f7c6dc33da9 (diff)
Various function for commmon operations.
Diffstat (limited to 'crypto/asn1/n_pkey.c')
-rw-r--r--crypto/asn1/n_pkey.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/crypto/asn1/n_pkey.c b/crypto/asn1/n_pkey.c
index 82a621224b..c7b92e3a5d 100644
--- a/crypto/asn1/n_pkey.c
+++ b/crypto/asn1/n_pkey.c
@@ -196,14 +196,11 @@ int i2d_RSA_NET(const RSA *a, unsigned char **pp, int (*cb)(), int sgckey)
i = strlen((char *)buf);
/* If the key is used for SGC the algorithm is modified a little. */
if(sgckey) {
- EVP_MD_CTX mctx;
- EVP_DigestInit(&mctx, EVP_md5());
- EVP_DigestUpdate(&mctx, buf, i);
- EVP_DigestFinal(&mctx, buf, NULL);
+ EVP_Digest(buf, i, buf, NULL, EVP_md5());
memcpy(buf + 16, "SGCKEYSALT", 10);
i = 26;
}
-
+
EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL);
memset(buf,0,256);
@@ -287,10 +284,7 @@ static RSA *d2i_RSA_NET_2(RSA **a, ASN1_OCTET_STRING *os,
i = strlen((char *)buf);
if(sgckey){
- EVP_MD_CTX mctx;
- EVP_DigestInit(&mctx, EVP_md5());
- EVP_DigestUpdate(&mctx, buf, i);
- EVP_DigestFinal(&mctx, buf, NULL);
+ EVP_Digest(buf, i, buf, NULL, EVP_md5());
memcpy(buf + 16, "SGCKEYSALT", 10);
i = 26;
}