From: tb Date: Fri, 11 Aug 2023 13:53:45 +0000 (+0000) Subject: Use params{,_len} in {dh,dsa}_params_{en,de}code() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e6a172b04af20b189cd370fe40328ab4d3927e4f;p=openbsd Use params{,_len} in {dh,dsa}_params_{en,de}code() --- diff --git a/lib/libcrypto/dh/dh_ameth.c b/lib/libcrypto/dh/dh_ameth.c index cd4c130f108..c43ada8ed83 100644 --- a/lib/libcrypto/dh/dh_ameth.c +++ b/lib/libcrypto/dh/dh_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_ameth.c,v 1.34 2023/08/11 11:32:19 tb Exp $ */ +/* $OpenBSD: dh_ameth.c,v 1.35 2023/08/11 13:53:45 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -298,12 +298,12 @@ dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) } static int -dh_param_decode(EVP_PKEY *pkey, const unsigned char **pder, int derlen) +dh_param_decode(EVP_PKEY *pkey, const unsigned char **params, int params_len) { DH *dh = NULL; int ret = 0; - if ((dh = d2i_DHparams(NULL, pder, derlen)) == NULL) { + if ((dh = d2i_DHparams(NULL, params, params_len)) == NULL) { DHerror(ERR_R_DH_LIB); goto err; } @@ -320,9 +320,9 @@ dh_param_decode(EVP_PKEY *pkey, const unsigned char **pder, int derlen) } static int -dh_param_encode(const EVP_PKEY *pkey, unsigned char **pder) +dh_param_encode(const EVP_PKEY *pkey, unsigned char **params) { - return i2d_DHparams(pkey->pkey.dh, pder); + return i2d_DHparams(pkey->pkey.dh, params); } static int diff --git a/lib/libcrypto/dsa/dsa_ameth.c b/lib/libcrypto/dsa/dsa_ameth.c index b94c3c40be3..529bab4d478 100644 --- a/lib/libcrypto/dsa/dsa_ameth.c +++ b/lib/libcrypto/dsa/dsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_ameth.c,v 1.49 2023/08/11 13:51:33 tb Exp $ */ +/* $OpenBSD: dsa_ameth.c,v 1.50 2023/08/11 13:53:45 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -459,12 +459,12 @@ do_dsa_print(BIO *bp, const DSA *x, int off, int ptype) } static int -dsa_param_decode(EVP_PKEY *pkey, const unsigned char **pder, int derlen) +dsa_param_decode(EVP_PKEY *pkey, const unsigned char **params, int params_len) { DSA *dsa = NULL; int ret = 0; - if ((dsa = d2i_DSAparams(NULL, pder, derlen)) == NULL) { + if ((dsa = d2i_DSAparams(NULL, params, params_len)) == NULL) { DSAerror(ERR_R_DSA_LIB); goto err; } @@ -483,9 +483,9 @@ dsa_param_decode(EVP_PKEY *pkey, const unsigned char **pder, int derlen) } static int -dsa_param_encode(const EVP_PKEY *pkey, unsigned char **pder) +dsa_param_encode(const EVP_PKEY *pkey, unsigned char **params) { - return i2d_DSAparams(pkey->pkey.dsa, pder); + return i2d_DSAparams(pkey->pkey.dsa, params); } static int