summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-07-04 10:26:47 +0000
committertb <>2023-07-04 10:26:47 +0000
commitd6db096baa49277592e317dbb9edb152454bcda4 (patch)
treeb3f705f414f998716e26990ba6da27aec0251598
parent81cfa4c64a350213133e48dce9902e8cfa9dc6ea (diff)
downloadopenbsd-d6db096baa49277592e317dbb9edb152454bcda4.tar.gz
openbsd-d6db096baa49277592e317dbb9edb152454bcda4.tar.bz2
openbsd-d6db096baa49277592e317dbb9edb152454bcda4.zip
Some more consistency in variable names
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_ossl.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/libcrypto/ecdsa/ecs_ossl.c b/src/lib/libcrypto/ecdsa/ecs_ossl.c
index f7e994157e..9c388cc745 100644
--- a/src/lib/libcrypto/ecdsa/ecs_ossl.c
+++ b/src/lib/libcrypto/ecdsa/ecs_ossl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecs_ossl.c,v 1.65 2023/07/04 10:23:34 tb Exp $ */ 1/* $OpenBSD: ecs_ossl.c,v 1.66 2023/07/04 10:26:47 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -102,21 +102,21 @@ ossl_ecdsa_sign(int type, const unsigned char *digest, int digest_len,
102 const BIGNUM *r, EC_KEY *eckey) 102 const BIGNUM *r, EC_KEY *eckey)
103{ 103{
104 ECDSA_SIG *sig; 104 ECDSA_SIG *sig;
105 int outlen = 0; 105 int out_len = 0;
106 int ret = 0; 106 int ret = 0;
107 107
108 if ((sig = ECDSA_do_sign_ex(digest, digest_len, kinv, r, eckey)) == NULL) 108 if ((sig = ECDSA_do_sign_ex(digest, digest_len, kinv, r, eckey)) == NULL)
109 goto err; 109 goto err;
110 110
111 if ((outlen = i2d_ECDSA_SIG(sig, &signature)) < 0) { 111 if ((out_len = i2d_ECDSA_SIG(sig, &signature)) < 0) {
112 outlen = 0; 112 out_len = 0;
113 goto err; 113 goto err;
114 } 114 }
115 115
116 ret = 1; 116 ret = 1;
117 117
118 err: 118 err:
119 *signature_len = outlen; 119 *signature_len = out_len;
120 ECDSA_SIG_free(sig); 120 ECDSA_SIG_free(sig);
121 121
122 return ret; 122 return ret;
@@ -460,7 +460,7 @@ ossl_ecdsa_verify(int type, const unsigned char *digest, int digest_len,
460 ECDSA_SIG *s; 460 ECDSA_SIG *s;
461 unsigned char *der = NULL; 461 unsigned char *der = NULL;
462 const unsigned char *p; 462 const unsigned char *p;
463 int derlen = 0; 463 int der_len = 0;
464 int ret = -1; 464 int ret = -1;
465 465
466 if ((s = ECDSA_SIG_new()) == NULL) 466 if ((s = ECDSA_SIG_new()) == NULL)
@@ -471,15 +471,15 @@ ossl_ecdsa_verify(int type, const unsigned char *digest, int digest_len,
471 goto err; 471 goto err;
472 472
473 /* Ensure signature uses DER and doesn't have trailing garbage */ 473 /* Ensure signature uses DER and doesn't have trailing garbage */
474 if ((derlen = i2d_ECDSA_SIG(s, &der)) != sig_len) 474 if ((der_len = i2d_ECDSA_SIG(s, &der)) != sig_len)
475 goto err; 475 goto err;
476 if (timingsafe_memcmp(sigbuf, der, derlen)) 476 if (timingsafe_memcmp(sigbuf, der, der_len))
477 goto err; 477 goto err;
478 478
479 ret = ECDSA_do_verify(digest, digest_len, s, eckey); 479 ret = ECDSA_do_verify(digest, digest_len, s, eckey);
480 480
481 err: 481 err:
482 freezero(der, derlen); 482 freezero(der, der_len);
483 ECDSA_SIG_free(s); 483 ECDSA_SIG_free(s);
484 484
485 return ret; 485 return ret;
@@ -607,23 +607,23 @@ ECDSA_do_sign_ex(const unsigned char *digest, int digest_len,
607 607
608int 608int
609ECDSA_sign(int type, const unsigned char *digest, int digest_len, 609ECDSA_sign(int type, const unsigned char *digest, int digest_len,
610 unsigned char *sig, unsigned int *siglen, EC_KEY *eckey) 610 unsigned char *signature, unsigned int *signature_len, EC_KEY *eckey)
611{ 611{
612 return ECDSA_sign_ex(type, digest, digest_len, sig, siglen, NULL, NULL, 612 return ECDSA_sign_ex(type, digest, digest_len, signature, signature_len,
613 eckey); 613 NULL, NULL, eckey);
614} 614}
615 615
616int 616int
617ECDSA_sign_ex(int type, const unsigned char *digest, int digest_len, 617ECDSA_sign_ex(int type, const unsigned char *digest, int digest_len,
618 unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, 618 unsigned char *signature, unsigned int *signature_len, const BIGNUM *kinv,
619 const BIGNUM *r, EC_KEY *eckey) 619 const BIGNUM *r, EC_KEY *eckey)
620{ 620{
621 if (eckey->meth->sign == NULL) { 621 if (eckey->meth->sign == NULL) {
622 ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED); 622 ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED);
623 return 0; 623 return 0;
624 } 624 }
625 return eckey->meth->sign(type, digest, digest_len, sig, siglen, kinv, r, 625 return eckey->meth->sign(type, digest, digest_len, signature,
626 eckey); 626 signature_len, kinv, r, eckey);
627} 627}
628 628
629int 629int