mirror of
https://github.com/logos-storage/nim-bearssl.git
synced 2026-01-04 22:43:09 +00:00
* split `decls.nim` into smaller modules - allows using parts of the ABI without compiling all of `bearssl` * deprecate functions with `Br` prefix - there are duplicate exports both with and without `Br` for the same function and we use both in consumers like `chronos` and `libp2p` * fix several cases of incorrectly mapped types * use `var` for certain arguments that can't be `nil` * add script to regenerate ABI with `c2nim` * consistently use `uint` for length (`int` was sometimes used) The Split likely needs more cleanup work - this is a first cut to get the idea in place. In the new layout, `bearssl/abi/` contains "raw" nim mappings while hand-written helpers are in `bearssl/`.
26 lines
955 B
Nim
26 lines
955 B
Nim
## 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 ./bearssl_x509 import X509TrustAnchor
|
|
from os import parentDir, `/`
|
|
|
|
const
|
|
currentSourceDir* = currentSourcePath.parentDir
|
|
|
|
{.passc: "-I" & currentSourceDir.parentDir / "certs".}
|
|
|
|
var MozillaTrustAnchors* {.
|
|
importc: "TAs", header: "cacert20210119.h".}: array[129, X509TrustAnchor]
|
|
var MozillaTrustAnchorsCount* {.
|
|
importc: "TAs_NUM", header: "cacert20210119.h".}: cint
|