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:
Jacek Sieka 2022-11-21 18:01:21 +01:00 committed by GitHub
parent 5159f7e385
commit cc4e5c54aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 3518 deletions

View File

@ -7,26 +7,15 @@
## This file may not be copied, modified, or distributed except according to
## those terms.
when defined(bearsslSplitAbi):
# This will become default in the future - we cannot use it now because there
# 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
import
./bearssl/[
aead, blockx, brssl, ec, errors, hash, hmac, kdf, pem, prf, rand, rsa,
ssl, x509,
cacert, config
else:
import
./bearssl/[cacert, errors, decls] # Deprecated, will be removed in the future
export cacert, errors, decls
ssl, x509],
./bearssl/abi/config
export
aead, blockx, brssl, ec, errors, hash, hmac, kdf, pem, prf, rand, rsa,
ssl, x509,
config
when defined(nimHasUsed): {.used.}

View File

@ -1,7 +1,7 @@
mode = ScriptMode.Verbose
packageName = "bearssl"
version = "0.1.5"
version = "0.2.0"
author = "Status Research & Development GmbH"
description = "BearSSL wrapper"
license = "MIT or Apache License 2.0"
@ -36,6 +36,4 @@ task test, "Run tests":
for args in [
"-d:debug",
"-d:release",
"-d:bearsslSplitAbi -d:debug",
"-d:bearsslSplitAbi -d:release",
]: run args, path

View File

@ -1,28 +1,4 @@
## 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.
{.deprecated: "moved to certs/".}
## 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 ./csources
from ./bearssl_x509 import X509TrustAnchor
{.compile: bearPath & "/../certs/cacert20221116.c".}
const MozillaTrustAnchorsCount* = 142 # TAs_NUM
var MozillaTrustAnchors* {.importc: "TAs".}: array[
MozillaTrustAnchorsCount, X509TrustAnchor]
import ../certs/cacert
export cacert

View File

@ -1,6 +1,4 @@
# TODO it should really be easier to use a pem file instead
{.deprecated: "use bearssl/abi/cacert".}
import
./abi/cacert
{.deprecated: "moved to certs/".}
export cacert.MozillaTrustAnchorsCount, cacert.MozillaTrustAnchors
import ./certs/cacert
export cacert

28
bearssl/certs/cacert.nim Normal file
View 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]

File diff suppressed because it is too large Load Diff