pgbackrest.git / summary / log / commit / refs

commit    f4e6e6bd80c68dca6a33a8e23e0fa32026f52d23
Author:   David Steele <david@pgmasters.net>
Date:     Fri May 15 11:49:23 2020 +0000

    Add missing cryptoInit() in cryptoHmacOne().
    
    If cryptoInit() had not already been called then EVP_get_digestbyname() would fail.
    
    This does not appear to be a problem currently because of call order. Also, newer versions of OpenSSL auto-initialize.


src/common/crypto/hash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/crypto/hash.c b/src/common/crypto/hash.c index fe03153e1..5df76a65d 100644 --- a/src/common/crypto/hash.c +++ b/src/common/crypto/hash.c @@ -237,6 +237,9 @@ cryptoHmacOne(const String *type, const Buffer *key, const Buffer *message) ASSERT(key != NULL); ASSERT(message != NULL); + // Init crypto subsystem + cryptoInit(); + const EVP_MD *hashType = EVP_get_digestbyname(strPtr(type)); ASSERT(hashType != NULL); [parent: ea485e916bb2]