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

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

int sbearssl_cert_from (sbearssl_cert *sc, br_x509_certificate const *bc, stralloc *sa)
{
  if (!stralloc_catb(sa, (char const *)bc->data, bc->data_len)) return 0 ;
  sc->data = sa->len - bc->data_len ;
  sc->datalen = bc->data_len ;
  return 1 ;
}