From: <iro...@us...> - 2004-02-19 02:29:45
|
Update of /cvsroot/perl-openssl/Crypt/OpenSSL/RSA In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7531 Modified Files: RSA.xs Log Message: fully flush error queue on failure Index: RSA.xs =================================================================== RCS file: /cvsroot/perl-openssl/Crypt/OpenSSL/RSA/RSA.xs,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** RSA.xs 19 Feb 2004 00:36:49 -0000 1.50 --- RSA.xs 19 Feb 2004 02:19:40 -0000 1.51 *************** *** 5,8 **** --- 5,9 ---- #include <openssl/ssl.h> #include <openssl/bn.h> + #include <openssl/err.h> typedef struct *************** *** 21,28 **** #define PACKAGE_NAME "Crypt::OpenSSL::RSA" ! //FIXME - there may be more than one error on the queue. ! #define CHECK_OPEN_SSL(p_result) if (!(p_result)) \ ! croak("%s:%d: OpenSSL error: %s", \ ! __FILE__, __LINE__, ERR_reason_error_string(ERR_get_error())); #define PACKAGE_CROAK(p_message) croak("%s:%d: %s", (p_message)) --- 22,35 ---- #define PACKAGE_NAME "Crypt::OpenSSL::RSA" ! void croakSsl(char* p_file, int p_line) ! { ! const char* errorReason; ! /* Just return the top error on the stack */ ! errorReason = ERR_reason_error_string(ERR_get_error()); ! ERR_clear_error(); ! croak("%s:%d: OpenSSL error: %s", p_file, p_line, errorReason); ! } ! ! #define CHECK_OPEN_SSL(p_result) if (!(p_result)) croakSsl(__FILE__, __LINE__); #define PACKAGE_CROAK(p_message) croak("%s:%d: %s", (p_message)) *************** *** 347,351 **** { RSA_free(rsa); ! CHECK_OPEN_SSL(0) } } --- 354,358 ---- { RSA_free(rsa); ! CHECK_OPEN_SSL(0); } } |