namespace {
-// Clear OpenSSL error stack.
-void ClearOpenSslErrors() {
+// In debug builds only, log OpenSSL error stack. Then clear OpenSSL error
+// stack.
+void DLogOpenSslErrors() {
#ifdef NDEBUG
while (ERR_get_error()) {}
#else
if (!EVP_AEAD_CTX_init(ctx_.get(), aead_alg_, key_, key_size_,
auth_tag_size_, NULL)) {
- ClearOpenSslErrors();
+ DLogOpenSslErrors();
return false;
}
associated_data.size());
if (len < 0) {
- ClearOpenSslErrors();
+ DLogOpenSslErrors();
return false;
}