summaryrefslogtreecommitdiff
path: root/src/sbearssl/sbearssl_x500_from_ta.c
blob: b396f275b9ae44d1cec5b83b3b6a16d030fc7460 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* ISC license. */

#include <string.h>
#include <s6-networking/sbearssl.h>

void sbearssl_x500_from_ta (br_x500_name *names, sbearssl_ta const *sta, size_t n, char *storage, char const *tastorage)
{
  while (n--)
  {
    size_t len = sta->dnlen ;
    memcpy(storage, tastorage + sta->dn, len) ;
    sta++ ;
    names->data = (unsigned char *)storage ;
    names->len = len ;
    names++ ;
    storage += len ;
  }
}