summaryrefslogtreecommitdiff
path: root/src/sbearssl
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2022-08-12 01:52:05 +0000
committerLaurent Bercot <ska@appnovation.com>2022-08-12 01:52:05 +0000
commit003b096d346b6c20d43d1127413d2db4b66e5b6e (patch)
treeb9fd85235c56014fab7b00998d07b11d90673aea /src/sbearssl
parente04c90b246fe5fc32b237729c0be51459286860f (diff)
downloads6-networking-003b096d346b6c20d43d1127413d2db4b66e5b6e.tar.xz
sbearssl_sni_policy_vtable: use the COPY macro for ec as well
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/sbearssl')
-rw-r--r--src/sbearssl/sbearssl_sni_policy_vtable.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sbearssl/sbearssl_sni_policy_vtable.c b/src/sbearssl/sbearssl_sni_policy_vtable.c
index a1d878a..9e68550 100644
--- a/src/sbearssl/sbearssl_sni_policy_vtable.c
+++ b/src/sbearssl/sbearssl_sni_policy_vtable.c
@@ -15,7 +15,7 @@
#define INSTANCE(c) ((sbearssl_sni_policy_context *)(c))
-#define COPY(x) do { k->data.rsa.x##len = l->data.rsa.x##len ; k->data.rsa.x = (unsigned char *)s + m ; memcpy(s + m, t + l->data.rsa.x, l->data.rsa.x##len) ; m += l->data.rsa.x##len ; } while (0)
+#define COPY(kt, x) do { k->data.kt.x##len = l->data.kt.x##len ; k->data.kt.x = (unsigned char *)s + m ; memcpy(s + m, t + l->data.kt.x, l->data.kt.x##len) ; m += l->data.kt.x##len ; } while (0)
static inline size_t skey_copy (br_skey *k, sbearssl_skey const *l, char *s, char const *t)
{
@@ -25,11 +25,11 @@ static inline size_t skey_copy (br_skey *k, sbearssl_skey const *l, char *s, cha
{
case BR_KEYTYPE_RSA :
k->data.rsa.n_bitlen = l->data.rsa.n_bitlen ;
- COPY(p) ; COPY(q) ; COPY(dp) ; COPY(dq) ; COPY(iq) ;
+ COPY(rsa, p) ; COPY(rsa, q) ; COPY(rsa, dp) ; COPY(rsa, dq) ; COPY(rsa, iq) ;
break ;
case BR_KEYTYPE_EC :
k->data.ec.curve = l->data.ec.curve ;
- k->data.ec.xlen = l->data.ec.xlen ; k->data.ec.x = (unsigned char *)s + m ; memcpy(s + m, t + l->data.ec.x, l->data.ec.xlen) ; m += l->data.ec.xlen ;
+ COPY(ec, x) ;
break ;
}
return m ;