diff --git a/bearssl/cacert.nim b/bearssl/cacert.nim index 01d1e5c..432aa33 100644 --- a/bearssl/cacert.nim +++ b/bearssl/cacert.nim @@ -1,5 +1,5 @@ ## Nim-BearSSL -## Copyright (c) 2018 Status Research & Development GmbH +## 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)) @@ -13,11 +13,11 @@ ## And converted to C header using ``brssl ta cacert-2020-06-24.pem > cacert``. from decls import X509TrustAnchor from strutils import rsplit -from os import DirSep +from os import DirSep, AltSep -const CurrentPath = currentSourcePath.rsplit(DirSep, 1)[0] +const CurrentPath = currentSourcePath.rsplit({DirSep, AltSep}, 1)[0] -{.passC: "-I" & CurrentPath & DirSep & "certs".} +{.passC: "-I" & CurrentPath & "/certs".} var MozillaTrustAnchors* {. importc: "TAs", header: "cacert20200624.h".}: array[138, X509TrustAnchor] diff --git a/bearssl/decls.nim b/bearssl/decls.nim index 0faf543..31d805b 100644 --- a/bearssl/decls.nim +++ b/bearssl/decls.nim @@ -8,28 +8,28 @@ ## those terms. ## This module implements interface with BearSSL library sources. import strutils -from os import DirSep, quoteShell +from os import quoteShell, DirSep, AltSep const - bearPath = currentSourcePath.rsplit(DirSep, 1)[0] & DirSep & - "csources" & DirSep + bearPath = currentSourcePath.rsplit({DirSep, AltSep}, 1)[0] & "/" & + "csources" & "/" bearSrcPath = bearPath & "src" bearIncPath = bearPath & "inc" - bearIntPath = bearSrcPath & DirSep & "int" & DirSep - bearCodecPath = bearSrcPath & DirSep & "codec" & DirSep - bearRandPath = bearSrcPath & DirSep & "rand" & DirSep - bearRsaPath = bearSrcPath & DirSep & "rsa" & DirSep - bearEcPath = bearSrcPath & DirSep & "ec" & DirSep - bearX509Path = bearSrcPath & DirSep & "x509" & DirSep - bearSslPath = bearSrcPath & DirSep & "ssl" & DirSep - bearMacPath = bearSrcPath & DirSep & "mac" & DirSep - bearKdfPath = bearSrcPath & DirSep & "kdf" & DirSep - bearHashPath = bearSrcPath & DirSep & "hash" & DirSep - bearSymcPath = bearSrcPath & DirSep & "symcipher" & DirSep - bearAeadPath = bearSrcPath & DirSep & "aead" & DirSep - bearToolsPath = bearPath & "tools" & DirSep - bearRootPath = bearSrcPath & DirSep + bearIntPath = bearSrcPath & "/" & "int" & "/" + bearCodecPath = bearSrcPath & "/" & "codec" & "/" + bearRandPath = bearSrcPath & "/" & "rand" & "/" + bearRsaPath = bearSrcPath & "/" & "rsa" & "/" + bearEcPath = bearSrcPath & "/" & "ec" & "/" + bearX509Path = bearSrcPath & "/" & "x509" & "/" + bearSslPath = bearSrcPath & "/" & "ssl" & "/" + bearMacPath = bearSrcPath & "/" & "mac" & "/" + bearKdfPath = bearSrcPath & "/" & "kdf" & "/" + bearHashPath = bearSrcPath & "/" & "hash" & "/" + bearSymcPath = bearSrcPath & "/" & "symcipher" & "/" + bearAeadPath = bearSrcPath & "/" & "aead" & "/" + bearToolsPath = bearPath & "tools" & "/" + bearRootPath = bearSrcPath & "/" {.passC: "-I" & quoteShell(bearSrcPath)} {.passC: "-I" & quoteShell(bearIncPath)}