update cacert, turn it into C file (#37)

Makes the certificates compile a single time instead of being included
all over - also bump to a more recent version
This commit is contained in:
Jacek Sieka 2022-11-18 08:32:41 +01:00 committed by GitHub
parent f4c4233de4
commit 0e5fa149b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1928 additions and 17201 deletions

View File

@ -10,14 +10,19 @@
## This module provides access to Mozilla's CA certificate store in PEM format.
## This certificate store was downloaded from
## https://curl.haxx.se/ca/cacert.pem
## And converted to C header using ``brssl ta cacert.pem > cacert.h``.
## And converted to C header using:
##
## echo '#include <brssl.h> > cacert.c'
## brssl ta cacert.pem | sed "s/static //" >> cacert.c.
## MozillaTrustAnchorsCount below needs to be updated manually to the same
## value as TAs_NUM
import ./csources
from ./bearssl_x509 import X509TrustAnchor
{.passc: "-I" & bearPath & "../certs/".}
{.compile: bearPath & "/../certs/cacert20221116.c".}
var MozillaTrustAnchors* {.
importc: "TAs", header: "cacert20210119.h".}: array[129, X509TrustAnchor]
var MozillaTrustAnchorsCount* {.
importc: "TAs_NUM", header: "cacert20210119.h".}: cint
const MozillaTrustAnchorsCount* = 142 # TAs_NUM
var MozillaTrustAnchors* {.importc: "TAs".}: array[
MozillaTrustAnchorsCount, X509TrustAnchor]

View File

@ -1,25 +0,0 @@
## Nim-BearSSL
## Copyright (c) 2018-2021 Status Research & Development GmbH
## Licensed under either of
## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
## * MIT license ([LICENSE-MIT](LICENSE-MIT))
## at your option.
## This file may not be copied, modified, or distributed except according to
## those terms.
## This module provides access to Mozilla's CA certificate store in PEM format.
## This certificate store was downloaded from
## https://curl.haxx.se/ca/cacert.pem
## And converted to C header using ``brssl ta cacert.pem > cacert.h``.
from decls import X509TrustAnchor
from strutils import rsplit
from os import DirSep, AltSep
const CurrentPath = currentSourcePath.rsplit({DirSep, AltSep}, 1)[0]
{.passc: "-I" & CurrentPath & "/certs".}
var MozillaTrustAnchors* {.
importc: "TAs", header: "cacert20210119.h".}: array[129, X509TrustAnchor]
var MozillaTrustAnchorsCount* {.
importc: "TAs_NUM", header: "cacert20210119.h".}: cint

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff