X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Frsa%2Frsa_asn1.c;h=b95e47beb96801c1cdb70fd800dea027127d4836;hb=70b2ae3edf8243463a5aafbc969f20e6b3394192;hp=0585b241e65eb7791800ce1bf6b29f883a5635e5;hpb=9d6b1ce6441c7cc6aed344f02d9f676ab5e04217;p=oweals%2Fopenssl.git diff --git a/crypto/rsa/rsa_asn1.c b/crypto/rsa/rsa_asn1.c index 0585b241e6..b95e47beb9 100644 --- a/crypto/rsa/rsa_asn1.c +++ b/crypto/rsa/rsa_asn1.c @@ -3,7 +3,7 @@ * project 2000. */ /* ==================================================================== - * Copyright (c) 2000 The OpenSSL Project. All rights reserved. + * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -62,19 +62,9 @@ #include #include -static ASN1_METHOD method={ - (int (*)()) i2d_RSAPrivateKey, - (char *(*)())d2i_RSAPrivateKey, - (char *(*)())RSA_new, - (void (*)()) RSA_free}; - -ASN1_METHOD *RSAPrivateKey_asn1_meth(void) - { - return(&method); - } - /* Override the default free and new methods */ -static int rsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it) +static int rsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) { if(operation == ASN1_OP_NEW_PRE) { *pval = (ASN1_VALUE *)RSA_new(); @@ -98,14 +88,24 @@ ASN1_SEQUENCE_cb(RSAPrivateKey, rsa_cb) = { ASN1_SIMPLE(RSA, dmp1, BIGNUM), ASN1_SIMPLE(RSA, dmq1, BIGNUM), ASN1_SIMPLE(RSA, iqmp, BIGNUM) -} ASN1_SEQUENCE_END_cb(RSA, RSAPrivateKey); +} ASN1_SEQUENCE_END_cb(RSA, RSAPrivateKey) ASN1_SEQUENCE_cb(RSAPublicKey, rsa_cb) = { ASN1_SIMPLE(RSA, n, BIGNUM), ASN1_SIMPLE(RSA, e, BIGNUM), -} ASN1_SEQUENCE_END_cb(RSA, RSAPublicKey); +} ASN1_SEQUENCE_END_cb(RSA, RSAPublicKey) IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPrivateKey, RSAPrivateKey) IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPublicKey, RSAPublicKey) + +RSA *RSAPublicKey_dup(RSA *rsa) + { + return ASN1_item_dup(ASN1_ITEM_rptr(RSAPublicKey), rsa); + } + +RSA *RSAPrivateKey_dup(RSA *rsa) + { + return ASN1_item_dup(ASN1_ITEM_rptr(RSAPrivateKey), rsa); + }