From: <iro...@us...> - 2004-02-13 23:16:52
|
Update of /cvsroot/perl-openssl/Crypt/OpenSSL/RSA In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32318 Modified Files: RSA.xs Log Message: capitalize macro, stop pretending that it's a statement (take away trailing semis from calls to it) Index: RSA.xs =================================================================== RCS file: /cvsroot/perl-openssl/Crypt/OpenSSL/RSA/RSA.xs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** RSA.xs 13 Feb 2004 23:02:13 -0000 1.28 --- RSA.xs 13 Feb 2004 23:10:49 -0000 1.29 *************** *** 14,18 **** #define PACKAGE_NAME "Crypt::OpenSSL::RSA" ! #define checkOpenSslCall( result ) if( ! ( result ) ) \ croak( "OpenSSL error: %s", ERR_reason_error_string( ERR_get_error() ) ); --- 14,18 ---- #define PACKAGE_NAME "Crypt::OpenSSL::RSA" ! #define CHECK_OPEN_SSL_CALL( result ) if( ! ( result ) ) \ croak( "OpenSSL error: %s", ERR_reason_error_string( ERR_get_error() ) ); *************** *** 220,224 **** keyString = SvPV(p_keyStringSv, keyStringLength); ! checkOpenSslCall(stringBIO = BIO_new_mem_buf(keyString, keyStringLength)); rsa = p_loader(stringBIO, NULL, NULL, NULL); --- 220,225 ---- keyString = SvPV(p_keyStringSv, keyStringLength); ! CHECK_OPEN_SSL_CALL( ! stringBIO = BIO_new_mem_buf(keyString, keyStringLength)) rsa = p_loader(stringBIO, NULL, NULL, NULL); *************** *** 274,278 **** RSA* rsa; CODE: ! checkOpenSslCall(stringBIO = BIO_new(BIO_s_mem())); rsa = get_RSA_key(rsa_HV); PEM_write_bio_RSAPrivateKey(stringBIO, rsa, NULL, NULL, 0, NULL, NULL); --- 275,279 ---- RSA* rsa; CODE: ! CHECK_OPEN_SSL_CALL(stringBIO = BIO_new(BIO_s_mem())) rsa = get_RSA_key(rsa_HV); PEM_write_bio_RSAPrivateKey(stringBIO, rsa, NULL, NULL, 0, NULL, NULL); *************** *** 288,292 **** BIO* stringBIO; CODE: ! checkOpenSslCall(stringBIO = BIO_new(BIO_s_mem())); PEM_write_bio_RSAPublicKey(stringBIO, get_RSA_key(rsa_HV)); RETVAL = extractBioString(stringBIO); --- 289,293 ---- BIO* stringBIO; CODE: ! CHECK_OPEN_SSL_CALL(stringBIO = BIO_new(BIO_s_mem())) PEM_write_bio_RSAPublicKey(stringBIO, get_RSA_key(rsa_HV)); RETVAL = extractBioString(stringBIO); *************** *** 301,305 **** BIO* stringBIO; CODE: ! checkOpenSslCall(stringBIO = BIO_new(BIO_s_mem())); PEM_write_bio_RSA_PUBKEY(stringBIO, get_RSA_key(rsa_HV)); RETVAL = extractBioString(stringBIO); --- 302,306 ---- BIO* stringBIO; CODE: ! CHECK_OPEN_SSL_CALL(stringBIO = BIO_new(BIO_s_mem())) PEM_write_bio_RSA_PUBKEY(stringBIO, get_RSA_key(rsa_HV)); RETVAL = extractBioString(stringBIO); *************** *** 367,371 **** { p = BN_new(); ! checkOpenSslCall( BN_div( p, bn, n, q, ctx ) ); if( ! BN_is_zero( bn ) ) { --- 368,372 ---- { p = BN_new(); ! CHECK_OPEN_SSL_CALL( BN_div( p, bn, n, q, ctx ) ) if( ! BN_is_zero( bn ) ) { *************** *** 376,380 **** { q = BN_new(); ! checkOpenSslCall( BN_div( q, bn, n, p, ctx ) ); if( ! BN_is_zero( bn ) ) { --- 377,381 ---- { q = BN_new(); ! CHECK_OPEN_SSL_CALL( BN_div( q, bn, n, p, ctx ) ) if( ! BN_is_zero( bn ) ) { *************** *** 385,404 **** rsa->q = q; p_minus_1 = BN_new(); ! checkOpenSslCall( BN_sub( p_minus_1, p, BN_value_one() ) ); q_minus_1 = BN_new(); ! checkOpenSslCall( BN_sub( q_minus_1, q, BN_value_one() ) ); if( ! d ) { d = BN_new(); ! checkOpenSslCall( BN_mul( bn, p_minus_1, q_minus_1, ctx ) ); ! checkOpenSslCall( BN_mod_inverse( d, e, bn, ctx ) ); } rsa->d = d; rsa->dmp1 = BN_new(); ! checkOpenSslCall( BN_mod( rsa->dmp1, d, p_minus_1, ctx ) ); rsa->dmq1 = BN_new(); ! checkOpenSslCall( BN_mod( rsa->dmq1, d, q_minus_1, ctx ) ); rsa->iqmp = BN_new(); ! checkOpenSslCall( BN_mod_inverse( rsa->iqmp, q, p, ctx ) ); BN_clear_free(bn); BN_clear_free(p_minus_1); --- 386,405 ---- rsa->q = q; p_minus_1 = BN_new(); ! CHECK_OPEN_SSL_CALL( BN_sub( p_minus_1, p, BN_value_one() ) ) q_minus_1 = BN_new(); ! CHECK_OPEN_SSL_CALL( BN_sub( q_minus_1, q, BN_value_one() ) ) if( ! d ) { d = BN_new(); ! CHECK_OPEN_SSL_CALL( BN_mul( bn, p_minus_1, q_minus_1, ctx ) ) ! CHECK_OPEN_SSL_CALL( BN_mod_inverse( d, e, bn, ctx ) ) } rsa->d = d; rsa->dmp1 = BN_new(); ! CHECK_OPEN_SSL_CALL( BN_mod( rsa->dmp1, d, p_minus_1, ctx ) ) rsa->dmq1 = BN_new(); ! CHECK_OPEN_SSL_CALL( BN_mod( rsa->dmq1, d, q_minus_1, ctx ) ) rsa->iqmp = BN_new(); ! CHECK_OPEN_SSL_CALL( BN_mod_inverse( rsa->iqmp, q, p, ctx ) ) BN_clear_free(bn); BN_clear_free(p_minus_1); |