diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2022-08-12 01:52:05 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2022-08-12 01:52:05 +0000 |
commit | 003b096d346b6c20d43d1127413d2db4b66e5b6e (patch) | |
tree | b9fd85235c56014fab7b00998d07b11d90673aea /src | |
parent | e04c90b246fe5fc32b237729c0be51459286860f (diff) | |
download | s6-networking-003b096d346b6c20d43d1127413d2db4b66e5b6e.tar.gz s6-networking-003b096d346b6c20d43d1127413d2db4b66e5b6e.tar.xz s6-networking-003b096d346b6c20d43d1127413d2db4b66e5b6e.zip |
sbearssl_sni_policy_vtable: use the COPY macro for ec as well
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/sbearssl/sbearssl_sni_policy_vtable.c | 6 |
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 ; |