Message ID | 20230319193847.106872-2-ebiggers@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | xfstests: make fscrypt-crypt-util self-tests work with OpenSSL 3.0 | expand |
diff --git a/src/fscrypt-crypt-util.c b/src/fscrypt-crypt-util.c index 087ae09a..4bb4f4e5 100644 --- a/src/fscrypt-crypt-util.c +++ b/src/fscrypt-crypt-util.c @@ -975,7 +975,9 @@ static void test_hkdf_sha512(void) size_t ikmlen = 1 + (rand() % sizeof(ikm)); size_t saltlen = rand() % (1 + sizeof(salt)); size_t infolen = rand() % (1 + sizeof(info)); - size_t outlen = rand() % (1 + sizeof(actual_output)); + // Don't test zero-length outputs, since OpenSSL 3.0 and later + // returns an error for those. + size_t outlen = 1 + (rand() % sizeof(actual_output)); rand_bytes(ikm, ikmlen); rand_bytes(salt, saltlen);