summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rsa/rsa_asn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_asn1.c')
-rw-r--r--src/lib/libcrypto/rsa/rsa_asn1.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_asn1.c b/src/lib/libcrypto/rsa/rsa_asn1.c
index b535c85141..e876dbdf49 100644
--- a/src/lib/libcrypto/rsa/rsa_asn1.c
+++ b/src/lib/libcrypto/rsa/rsa_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_asn1.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: rsa_asn1.c,v 1.7 2014/07/09 08:20:08 miod Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -64,14 +64,15 @@
64#include <openssl/asn1t.h> 64#include <openssl/asn1t.h>
65 65
66/* Override the default free and new methods */ 66/* Override the default free and new methods */
67static int rsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, 67static int
68 void *exarg) 68rsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
69{ 69{
70 if(operation == ASN1_OP_NEW_PRE) { 70 if (operation == ASN1_OP_NEW_PRE) {
71 *pval = (ASN1_VALUE *)RSA_new(); 71 *pval = (ASN1_VALUE *)RSA_new();
72 if(*pval) return 2; 72 if (*pval)
73 return 2;
73 return 0; 74 return 0;
74 } else if(operation == ASN1_OP_FREE_PRE) { 75 } else if (operation == ASN1_OP_FREE_PRE) {
75 RSA_free((RSA *)*pval); 76 RSA_free((RSA *)*pval);
76 *pval = NULL; 77 *pval = NULL;
77 return 2; 78 return 2;
@@ -110,12 +111,14 @@ IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPrivateKey, RSAPrivateKey)
110 111
111IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPublicKey, RSAPublicKey) 112IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPublicKey, RSAPublicKey)
112 113
113RSA *RSAPublicKey_dup(RSA *rsa) 114RSA *
114 { 115RSAPublicKey_dup(RSA *rsa)
116{
115 return ASN1_item_dup(ASN1_ITEM_rptr(RSAPublicKey), rsa); 117 return ASN1_item_dup(ASN1_ITEM_rptr(RSAPublicKey), rsa);
116 } 118}
117 119
118RSA *RSAPrivateKey_dup(RSA *rsa) 120RSA *
119 { 121RSAPrivateKey_dup(RSA *rsa)
122{
120 return ASN1_item_dup(ASN1_ITEM_rptr(RSAPrivateKey), rsa); 123 return ASN1_item_dup(ASN1_ITEM_rptr(RSAPrivateKey), rsa);
121 } 124}