Skip to content

Commit

Permalink
Fix compilation in debug mode
Browse files Browse the repository at this point in the history
Without this fix, we get error in debug mode (when assert is enabled):

```
hkdf.cpp:61:58: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
         assert(out_len == EVP_MD_size(digest) && out_len == outputLen);
```
  • Loading branch information
Fabrice Benhamouda committed Aug 27, 2024
1 parent 10e8edd commit 47e9d89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion csrc/hkdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extern "C" JNIEXPORT void JNICALL Java_com_amazon_corretto_crypto_provider_HkdfS
if (HKDF_extract(output.get(), &out_len, digest, secret.get(), secretLen, salt.get(), saltLen) != 1) {
throw_openssl(EX_RUNTIME_CRYPTO, "HKDF_extract failed.");
}
assert(out_len == EVP_MD_size(digest) && out_len == outputLen);
assert(out_len == EVP_MD_size(digest) && outputLen >= 0 && out_len == (size_t)outputLen);

} catch (java_ex& ex) {
ex.throw_to_java(env);
Expand Down

0 comments on commit 47e9d89

Please sign in to comment.