openssl: Fix return value if returning EdDSA public key fails

This commit is contained in:
Tobias Brunner
2026-04-01 19:33:09 +02:00
parent 440b7e7940
commit 3c637c7521
@@ -140,12 +140,12 @@ METHOD(private_key_t, get_public_key, public_key_t*,
if (!EVP_PKEY_get_raw_public_key(this->key, NULL, &key.len)) if (!EVP_PKEY_get_raw_public_key(this->key, NULL, &key.len))
{ {
return FALSE; return NULL;
} }
key = chunk_alloca(key.len); key = chunk_alloca(key.len);
if (!EVP_PKEY_get_raw_public_key(this->key, key.ptr, &key.len)) if (!EVP_PKEY_get_raw_public_key(this->key, key.ptr, &key.len))
{ {
return FALSE; return NULL;
} }
public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, this->type, public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, this->type,
BUILD_EDDSA_PUB, key, BUILD_END); BUILD_EDDSA_PUB, key, BUILD_END);