summaryrefslogtreecommitdiff
path: root/lib/libcrypto/rsa
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2015-02-10 05:12:24 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2015-02-10 05:12:24 +0000
commita6def5ad5c441fe1ca527e706d82948daa82d961 (patch)
tree73613d35c7d63e684fb1cd72edf4496f09b0d6c0 /lib/libcrypto/rsa
parent06df4486bb20ea65e0aabaed20a74631c4d4f6ad (diff)
Expand the -IMPLEMENT_ASN1_ENCODE_FUNCTIONS_(const_)?fname macros so that
the code is visible and functions can be readily located. Change has been scripted and there is no change to the generated assembly. Discussed with beck@ miod@ tedu@
Diffstat (limited to 'lib/libcrypto/rsa')
-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)