--- crypto.c | 6 +++--- crypto_backend.h | 2 ++ crypto_openssl.c | 6 ++++++ 3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/crypto.c b/crypto.c index 409c298..bdb3b1d 100644 --- a/crypto.c +++ b/crypto.c @@ -191,8 +191,8 @@ openvpn_encrypt (struct buffer *buf, struct buffer work, gc_free (&gc); return; - err: - ERR_clear_error (); +err: + crypto_clear_error(); buf->len = 0; gc_free (&gc); return; @@ -363,7 +363,7 @@ openvpn_decrypt (struct buffer *buf, struct buffer work, return true; error_exit: - ERR_clear_error (); + crypto_clear_error(); buf->len = 0; gc_free (&gc); return false; diff --git a/crypto_backend.h b/crypto_backend.h index b099f47..50eef7b 100644 --- a/crypto_backend.h +++ b/crypto_backend.h @@ -38,6 +38,8 @@ #include "basic.h" +void crypto_clear_error (void); + void show_available_ciphers (void); void show_available_digests (void); diff --git a/crypto_openssl.c b/crypto_openssl.c index 9edcf40..8e228ee 100644 --- a/crypto_openssl.c +++ b/crypto_openssl.c @@ -87,6 +87,12 @@ cipher_ok (const char* name) #endif void +crypto_clear_error (void) +{ + ERR_clear_error (); +} + +void show_available_ciphers () { int nid; -- 1.7.4.1