summaryrefslogtreecommitdiff
path: root/lib/libcrypto/rsa/rsa_asn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/rsa/rsa_asn1.c')
-rw-r--r--lib/libcrypto/rsa/rsa_asn1.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/lib/libcrypto/rsa/rsa_asn1.c b/lib/libcrypto/rsa/rsa_asn1.c
index a75b80fa10b..525c9455bdb 100644
--- a/lib/libcrypto/rsa/rsa_asn1.c
+++ b/lib/libcrypto/rsa/rsa_asn1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_asn1.c,v 1.10 2015/02/09 16:04:46 jsing Exp $ */
+/* $OpenBSD: rsa_asn1.c,v 1.11 2015/02/10 05:12:23 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@@ -131,9 +131,33 @@ RSA_PSS_PARAMS_free(RSA_PSS_PARAMS *a)
ASN1_item_free((ASN1_VALUE *)a, &RSA_PSS_PARAMS_it);
}
-IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPrivateKey, RSAPrivateKey)
-IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPublicKey, RSAPublicKey)
+RSA *
+d2i_RSAPrivateKey(RSA **a, const unsigned char **in, long len)
+{
+ return (RSA *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
+ &RSAPrivateKey_it);
+}
+
+int
+i2d_RSAPrivateKey(const RSA *a, unsigned char **out)
+{
+ return ASN1_item_i2d((ASN1_VALUE *)a, out, &RSAPrivateKey_it);
+}
+
+
+RSA *
+d2i_RSAPublicKey(RSA **a, const unsigned char **in, long len)
+{
+ return (RSA *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
+ &RSAPublicKey_it);
+}
+
+int
+i2d_RSAPublicKey(const RSA *a, unsigned char **out)
+{
+ return ASN1_item_i2d((ASN1_VALUE *)a, out, &RSAPublicKey_it);
+}
RSA *
RSAPublicKey_dup(RSA *rsa)