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:
parent
f4c4233de4
commit
0e5fa149b6
|
@ -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]
|
||||
|
|
|
@ -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
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue