From: <iro...@us...> - 2004-02-15 15:10:07
|
Update of /cvsroot/perl-openssl/Crypt/OpenSSL/RSA In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14975 Modified Files: RSA.xs Log Message: get rid of some unpleasant code duplication Index: RSA.xs =================================================================== RCS file: /cvsroot/perl-openssl/Crypt/OpenSSL/RSA/RSA.xs,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** RSA.xs 15 Feb 2004 14:52:00 -0000 1.33 --- RSA.xs 15 Feb 2004 15:02:46 -0000 1.34 *************** *** 179,185 **** } ! BIGNUM* maybe_BN_dup(BIGNUM* bn) { ! return bn != NULL ? BN_dup(bn) : NULL; } --- 179,187 ---- } ! SV* bn2sv(BIGNUM* p_bn) { ! return p_bn != NULL ! ? sv_2mortal(newSViv((IV) BN_dup(p_bn))) ! : &PL_sv_undef; } *************** *** 405,416 **** RSA* rsa; rsa = get_RSA_key(rsa_HV); ! XPUSHs(sv_2mortal(newSViv((IV) maybe_BN_dup(rsa->n)))); ! XPUSHs(sv_2mortal(newSViv((IV) maybe_BN_dup(rsa->e)))); ! XPUSHs(sv_2mortal(newSViv((IV) maybe_BN_dup(rsa->d)))); ! XPUSHs(sv_2mortal(newSViv((IV) maybe_BN_dup(rsa->p)))); ! XPUSHs(sv_2mortal(newSViv((IV) maybe_BN_dup(rsa->q)))); ! XPUSHs(sv_2mortal(newSViv((IV) maybe_BN_dup(rsa->dmp1)))); ! XPUSHs(sv_2mortal(newSViv((IV) maybe_BN_dup(rsa->dmq1)))); ! XPUSHs(sv_2mortal(newSViv((IV) maybe_BN_dup(rsa->iqmp)))); } --- 407,418 ---- RSA* rsa; rsa = get_RSA_key(rsa_HV); ! XPUSHs(bn2sv(rsa->n)); ! XPUSHs(bn2sv(rsa->e)); ! XPUSHs(bn2sv(rsa->d)); ! XPUSHs(bn2sv(rsa->p)); ! XPUSHs(bn2sv(rsa->q)); ! XPUSHs(bn2sv(rsa->dmp1)); ! XPUSHs(bn2sv(rsa->dmq1)); ! XPUSHs(bn2sv(rsa->iqmp)); } |