]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
openssl: Use proper EVP macro to determine size of a hash
authorTobias Brunner <tobias@strongswan.org>
Fri, 8 Apr 2016 13:54:08 +0000 (15:54 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 15 Apr 2016 08:32:52 +0000 (10:32 +0200)
src/libstrongswan/plugins/openssl/openssl_hasher.c
src/libstrongswan/plugins/openssl/openssl_util.c

index 8f7df0f8a1be821ccf268526afc4cb1661ab1d29..96ee230c9b25ce40c6195110f4ee0860d7319c28 100644 (file)
@@ -43,7 +43,7 @@ struct private_openssl_hasher_t {
 METHOD(hasher_t, get_hash_size, size_t,
        private_openssl_hasher_t *this)
 {
-       return this->hasher->md_size;
+       return EVP_MD_size(this->hasher);
 }
 
 METHOD(hasher_t, reset, bool,
index 2f981370174b8523a50b73630b9c96e3abea003b..914060358292ceb9e476f5cc60a9b388c5316db6 100644 (file)
@@ -51,7 +51,7 @@ bool openssl_hash_chunk(int hash_type, chunk_t data, chunk_t *hash)
                goto error;
        }
 
-       *hash = chunk_alloc(hasher->md_size);
+       *hash = chunk_alloc(EVP_MD_size(hasher));
        if (!EVP_DigestFinal_ex(ctx, hash->ptr, NULL))
        {
                chunk_free(hash);