From 420e4433e0663a16ac8ce2d0d644bc67b2ced591 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Tue, 10 Feb 2015 05:12:23 +0000 Subject: 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@ --- src/lib/libcrypto/rsa/rsa_asn1.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/rsa') diff --git a/src/lib/libcrypto/rsa/rsa_asn1.c b/src/lib/libcrypto/rsa/rsa_asn1.c index a75b80fa10..525c9455bd 100644 --- a/src/lib/libcrypto/rsa/rsa_asn1.c +++ b/src/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) -- cgit v1.2.3-55-g6feb