summaryrefslogtreecommitdiff
path: root/src/sbearssl/sbearssl_ec_pkey_from.c
blob: faf1194bba989f9da18e834cc84ac7eac23be54f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* ISC license. */

#include <skalibs/stralloc.h>
#include <s6-networking/sbearssl.h>

int sbearssl_ec_pkey_from (sbearssl_ec_pkey *l, br_ec_public_key const *k, stralloc *sa)
{
  if (!stralloc_catb(sa, (char const *)k->q, k->qlen)) return 0 ;
  l->curve = k->curve ;
  l->q = sa->len - k->qlen ;
  l->qlen = k->qlen ;
  return 1 ;
}