diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2021-11-30 18:17:04 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2021-11-30 18:17:04 +0000 |
commit | 6159559b21526a4d0513e1ec25d172e3cd0ac35e (patch) | |
tree | 20031cc68c71e87ca5ce36e8dcb2fc4f16b403fb /lib/libssl/ssl_kex.c | |
parent | bd34e0c7c0e56c9aaebe6315e2e306baf65f86d4 (diff) |
Align ssl_kex_derive_ecdhe_ecp() with ssl_kex_derive_dhe()
sk is commonly used for a STACK_OF(), so call the shared key simply key.
ok jsing
Diffstat (limited to 'lib/libssl/ssl_kex.c')
-rw-r--r-- | lib/libssl/ssl_kex.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/libssl/ssl_kex.c b/lib/libssl/ssl_kex.c index 61767c4006f..9af440d827d 100644 --- a/lib/libssl/ssl_kex.c +++ b/lib/libssl/ssl_kex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_kex.c,v 1.4 2021/11/29 18:48:22 tb Exp $ */ +/* $OpenBSD: ssl_kex.c,v 1.5 2021/11/30 18:17:03 tb Exp $ */ /* * Copyright (c) 2020 Joel Sing <jsing@openbsd.org> * @@ -320,8 +320,8 @@ ssl_kex_derive_ecdhe_ecp(EC_KEY *ecdh, EC_KEY *ecdh_peer, uint8_t **shared_key, size_t *shared_key_len) { const EC_POINT *point; - uint8_t *sk = NULL; - int sk_len = 0; + uint8_t *key = NULL; + int key_len = 0; int ret = 0; if (!EC_GROUP_check(EC_KEY_get0_group(ecdh), NULL)) @@ -332,22 +332,22 @@ ssl_kex_derive_ecdhe_ecp(EC_KEY *ecdh, EC_KEY *ecdh_peer, if ((point = EC_KEY_get0_public_key(ecdh_peer)) == NULL) goto err; - if ((sk_len = ECDH_size(ecdh)) <= 0) + if ((key_len = ECDH_size(ecdh)) <= 0) goto err; - if ((sk = calloc(1, sk_len)) == NULL) + if ((key = calloc(1, key_len)) == NULL) goto err; - if (ECDH_compute_key(sk, sk_len, point, ecdh, NULL) <= 0) + if (ECDH_compute_key(key, key_len, point, ecdh, NULL) <= 0) goto err; - *shared_key = sk; - *shared_key_len = sk_len; - sk = NULL; + *shared_key = key; + *shared_key_len = key_len; + key = NULL; ret = 1; err: - freezero(sk, sk_len); + freezero(key, key_len); return ret; } |