]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Don't assume OpenSSL failures are memory errors 1035/head
authorRobbie Harwood <rharwood@redhat.com>
Wed, 5 Feb 2020 17:56:00 +0000 (12:56 -0500)
committerGreg Hudson <ghudson@mit.edu>
Thu, 6 Feb 2020 21:20:47 +0000 (16:20 -0500)
More recent versions of OpenSSL can fail for other reasons.  Indicate
a crypto-related error occurred rather than a memory error to aid
debugging.

ticket: 8873 (new)
tags: pullup
target_version: 1.18
target_version: 1.17-next

src/lib/crypto/openssl/hash_provider/hash_evp.c
src/lib/crypto/openssl/sha256.c

index 957ed8d9caaf5886fc66e0b8b6f9223fea5db412..1e0fb8fc3c8b5df71699a5c96873ca8525412972 100644 (file)
@@ -58,7 +58,7 @@ hash_evp(const EVP_MD *type, const krb5_crypto_iov *data, size_t num_data,
     }
     ok = ok && EVP_DigestFinal_ex(ctx, (uint8_t *)output->data, NULL);
     EVP_MD_CTX_free(ctx);
-    return ok ? 0 : ENOMEM;
+    return ok ? 0 : KRB5_CRYPTO_INTERNAL;
 }
 
 static krb5_error_code
index 0edd8b7ba71a72ffe7286ed2f01df4dca3e5dd82..f9dfc85393ba698439b559969d31f80b417fce40 100644 (file)
@@ -48,5 +48,5 @@ k5_sha256(const krb5_data *in, size_t n, uint8_t out[K5_SHA256_HASHLEN])
         ok = ok && EVP_DigestUpdate(ctx, in[i].data, in[i].length);
     ok = ok && EVP_DigestFinal_ex(ctx, out, NULL);
     EVP_MD_CTX_free(ctx);
-    return ok ? 0 : ENOMEM;
+    return ok ? 0 : KRB5_CRYPTO_INTERNAL;
 }