summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-07-04 10:23:34 +0000
committertb <>2023-07-04 10:23:34 +0000
commit81cfa4c64a350213133e48dce9902e8cfa9dc6ea (patch)
tree837ea9b5d38a56ce56612c6b05c1d1bc65db603b /src/lib
parentad81d98d5d3a5d63a41af45b5757fb2df4df009f (diff)
downloadopenbsd-81cfa4c64a350213133e48dce9902e8cfa9dc6ea.tar.gz
openbsd-81cfa4c64a350213133e48dce9902e8cfa9dc6ea.tar.bz2
openbsd-81cfa4c64a350213133e48dce9902e8cfa9dc6ea.zip
Normalize ECDSA_SIG to be sig everywhere
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_ossl.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/libcrypto/ecdsa/ecs_ossl.c b/src/lib/libcrypto/ecdsa/ecs_ossl.c
index 2d10e160a5..f7e994157e 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.64 2023/07/04 10:14:37 tb Exp $ */ 1/* $OpenBSD: ecs_ossl.c,v 1.65 2023/07/04 10:23:34 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -98,17 +98,17 @@ ecdsa_prepare_digest(const unsigned char *digest, int digest_len,
98 98
99int 99int
100ossl_ecdsa_sign(int type, const unsigned char *digest, int digest_len, 100ossl_ecdsa_sign(int type, const unsigned char *digest, int digest_len,
101 unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, 101 unsigned char *signature, unsigned int *signature_len, const BIGNUM *kinv,
102 const BIGNUM *r, EC_KEY *eckey) 102 const BIGNUM *r, EC_KEY *eckey)
103{ 103{
104 ECDSA_SIG *s; 104 ECDSA_SIG *sig;
105 int outlen = 0; 105 int outlen = 0;
106 int ret = 0; 106 int ret = 0;
107 107
108 if ((s = 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(s, &sig)) < 0) { 111 if ((outlen = i2d_ECDSA_SIG(sig, &signature)) < 0) {
112 outlen = 0; 112 outlen = 0;
113 goto err; 113 goto err;
114 } 114 }
@@ -116,8 +116,8 @@ ossl_ecdsa_sign(int type, const unsigned char *digest, int digest_len,
116 ret = 1; 116 ret = 1;
117 117
118 err: 118 err:
119 *siglen = outlen; 119 *signature_len = outlen;
120 ECDSA_SIG_free(s); 120 ECDSA_SIG_free(sig);
121 121
122 return ret; 122 return ret;
123} 123}
@@ -665,7 +665,7 @@ ECDSA_size(const EC_KEY *r)
665{ 665{
666 const EC_GROUP *group; 666 const EC_GROUP *group;
667 const BIGNUM *order = NULL; 667 const BIGNUM *order = NULL;
668 ECDSA_SIG signature; 668 ECDSA_SIG sig;
669 int ret = 0; 669 int ret = 0;
670 670
671 if (r == NULL) 671 if (r == NULL)
@@ -677,10 +677,10 @@ ECDSA_size(const EC_KEY *r)
677 if ((order = EC_GROUP_get0_order(group)) == NULL) 677 if ((order = EC_GROUP_get0_order(group)) == NULL)
678 goto err; 678 goto err;
679 679
680 signature.r = (BIGNUM *)order; 680 sig.r = (BIGNUM *)order;
681 signature.s = (BIGNUM *)order; 681 sig.s = (BIGNUM *)order;
682 682
683 if ((ret = i2d_ECDSA_SIG(&signature, NULL)) < 0) 683 if ((ret = i2d_ECDSA_SIG(&sig, NULL)) < 0)
684 ret = 0; 684 ret = 0;
685 685
686 err: 686 err: