summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ecx_meth.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ec/ecx_meth.c')
-rw-r--r--crypto/ec/ecx_meth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/ec/ecx_meth.c b/crypto/ec/ecx_meth.c
index d141fe7b81..4e3c630bd2 100644
--- a/crypto/ec/ecx_meth.c
+++ b/crypto/ec/ecx_meth.c
@@ -1156,6 +1156,7 @@ static int s390x_pkey_ecd_keygen25519(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
unsigned char x_dst[32], buff[SHA512_DIGEST_LENGTH];
ECX_KEY *key;
unsigned char *privkey = NULL, *pubkey;
+ unsigned int sz;
key = OPENSSL_zalloc(sizeof(*key));
if (key == NULL) {
@@ -1174,7 +1175,9 @@ static int s390x_pkey_ecd_keygen25519(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
if (RAND_priv_bytes(privkey, ED25519_KEYLEN) <= 0)
goto err;
- SHA512(privkey, 32, buff);
+ if (!EVP_Digest(privkey, 32, buff, &sz, EVP_sha512(), NULL))
+ goto err;
+
buff[0] &= 248;
buff[31] &= 63;
buff[31] |= 64;