X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fopenssl%2Fcipher.c;h=77747f11b7dd356c1ea8000444cf6ef2495affce;hb=dcf9e6c3e444fd39318f8d5b261bdc22e5031f67;hp=6b2affc0cfa2553f77e0e3058720d36f0e6b1499;hpb=e1d5459339d7417cda45a7fa0d3c47db555ae6a9;p=tinc diff --git a/src/openssl/cipher.c b/src/openssl/cipher.c index 6b2affc0..77747f11 100644 --- a/src/openssl/cipher.c +++ b/src/openssl/cipher.c @@ -19,10 +19,10 @@ #include "../system.h" -#include #include #include +#include "log.h" #include "cipher.h" #include "../cipher.h" #include "../logger.h" @@ -120,7 +120,7 @@ bool cipher_set_key(cipher_t *cipher, void *key, bool encrypt) { return true; } - logger(DEBUG_ALWAYS, LOG_ERR, "Error while setting key: %s", ERR_error_string(ERR_get_error(), NULL)); + openssl_err("set key"); return false; } @@ -137,7 +137,7 @@ bool cipher_set_key_from_rsa(cipher_t *cipher, void *key, size_t len, bool encry return true; } - logger(DEBUG_ALWAYS, LOG_ERR, "Error while setting key: %s", ERR_error_string(ERR_get_error(), NULL)); + openssl_err("set key"); return false; } @@ -166,7 +166,7 @@ bool cipher_encrypt(cipher_t *cipher, const void *indata, size_t inlen, void *ou } } - logger(DEBUG_ALWAYS, LOG_ERR, "Error while encrypting: %s", ERR_error_string(ERR_get_error(), NULL)); + openssl_err("encrypt data"); return false; } @@ -195,7 +195,7 @@ bool cipher_decrypt(cipher_t *cipher, const void *indata, size_t inlen, void *ou } } - logger(DEBUG_ALWAYS, LOG_ERR, "Error while decrypting: %s", ERR_error_string(ERR_get_error(), NULL)); + openssl_err("decrypt data"); return false; }