mirror of
https://github.com/logos-storage/nim-bearssl.git
synced 2026-01-08 16:33:07 +00:00
remove non-split api, bump version (#39)
* remove non-split api, bump version * 0.1.5 is the last version to support the old ABI * move cacert to certs/ * add compat shim for abi/cacert
This commit is contained in:
parent
5159f7e385
commit
cc4e5c54aa
27
bearssl.nim
27
bearssl.nim
@ -7,26 +7,15 @@
|
|||||||
## This file may not be copied, modified, or distributed except according to
|
## This file may not be copied, modified, or distributed except according to
|
||||||
## those terms.
|
## those terms.
|
||||||
|
|
||||||
when defined(bearsslSplitAbi):
|
import
|
||||||
# This will become default in the future - we cannot use it now because there
|
./bearssl/[
|
||||||
# are duplicate symbols in `decls.nim` - the new ABI can already be accessed
|
|
||||||
# using the more specific imports (`import bearssl/ssl`)
|
|
||||||
import
|
|
||||||
./bearssl/[
|
|
||||||
aead, blockx, brssl, ec, errors, hash, hmac, kdf, pem, prf, rand, rsa,
|
|
||||||
ssl, x509],
|
|
||||||
./bearssl/abi/[cacert, config]
|
|
||||||
|
|
||||||
export
|
|
||||||
aead, blockx, brssl, ec, errors, hash, hmac, kdf, pem, prf, rand, rsa,
|
aead, blockx, brssl, ec, errors, hash, hmac, kdf, pem, prf, rand, rsa,
|
||||||
ssl, x509,
|
ssl, x509],
|
||||||
cacert, config
|
./bearssl/abi/config
|
||||||
|
|
||||||
else:
|
|
||||||
import
|
|
||||||
./bearssl/[cacert, errors, decls] # Deprecated, will be removed in the future
|
|
||||||
|
|
||||||
export cacert, errors, decls
|
|
||||||
|
|
||||||
|
export
|
||||||
|
aead, blockx, brssl, ec, errors, hash, hmac, kdf, pem, prf, rand, rsa,
|
||||||
|
ssl, x509,
|
||||||
|
config
|
||||||
|
|
||||||
when defined(nimHasUsed): {.used.}
|
when defined(nimHasUsed): {.used.}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
mode = ScriptMode.Verbose
|
mode = ScriptMode.Verbose
|
||||||
|
|
||||||
packageName = "bearssl"
|
packageName = "bearssl"
|
||||||
version = "0.1.5"
|
version = "0.2.0"
|
||||||
author = "Status Research & Development GmbH"
|
author = "Status Research & Development GmbH"
|
||||||
description = "BearSSL wrapper"
|
description = "BearSSL wrapper"
|
||||||
license = "MIT or Apache License 2.0"
|
license = "MIT or Apache License 2.0"
|
||||||
@ -36,6 +36,4 @@ task test, "Run tests":
|
|||||||
for args in [
|
for args in [
|
||||||
"-d:debug",
|
"-d:debug",
|
||||||
"-d:release",
|
"-d:release",
|
||||||
"-d:bearsslSplitAbi -d:debug",
|
|
||||||
"-d:bearsslSplitAbi -d:release",
|
|
||||||
]: run args, path
|
]: run args, path
|
||||||
|
|||||||
@ -1,28 +1,4 @@
|
|||||||
## Nim-BearSSL
|
{.deprecated: "moved to certs/".}
|
||||||
## 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.
|
import ../certs/cacert
|
||||||
## This certificate store was downloaded from
|
export cacert
|
||||||
## https://curl.haxx.se/ca/cacert.pem
|
|
||||||
## 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
|
|
||||||
|
|
||||||
{.compile: bearPath & "/../certs/cacert20221116.c".}
|
|
||||||
|
|
||||||
const MozillaTrustAnchorsCount* = 142 # TAs_NUM
|
|
||||||
|
|
||||||
var MozillaTrustAnchors* {.importc: "TAs".}: array[
|
|
||||||
MozillaTrustAnchorsCount, X509TrustAnchor]
|
|
||||||
@ -1,6 +1,4 @@
|
|||||||
# TODO it should really be easier to use a pem file instead
|
{.deprecated: "moved to certs/".}
|
||||||
{.deprecated: "use bearssl/abi/cacert".}
|
|
||||||
import
|
|
||||||
./abi/cacert
|
|
||||||
|
|
||||||
export cacert.MozillaTrustAnchorsCount, cacert.MozillaTrustAnchors
|
import ./certs/cacert
|
||||||
|
export cacert
|
||||||
|
|||||||
28
bearssl/certs/cacert.nim
Normal file
28
bearssl/certs/cacert.nim
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
## 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:
|
||||||
|
##
|
||||||
|
## 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 ../abi/csources
|
||||||
|
from ../abi/bearssl_x509 import X509TrustAnchor
|
||||||
|
|
||||||
|
{.compile: bearPath & "/../certs/cacert20221116.c".}
|
||||||
|
|
||||||
|
const MozillaTrustAnchorsCount* = 142 # TAs_NUM
|
||||||
|
|
||||||
|
var MozillaTrustAnchors* {.importc: "TAs".}: array[
|
||||||
|
MozillaTrustAnchorsCount, X509TrustAnchor]
|
||||||
3464
bearssl/decls.nim
3464
bearssl/decls.nim
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user