diff --git a/AGENTS.md b/AGENTS.md index 16228d8..1f77c6e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,8 +18,9 @@ specific to hash. ## Cautions -- Every C library is unchanged upstream code. A moved pin is a change of its own - (CODING-GUIDELINES.md chapter 5, rule 12). +- Every C library is upstream code, unchanged except where CODING-GUIDELINES.md chapter 5 rule 1 + allows a security fix on the mirror's `webcpp` branch (BearSSL: 32381d6, ECDSA's nonce + decoding); a moved pin carries that commit. A moved pin is a change of its own (rule 12). - A test is declared through `hash-run` in `test/Jamfile`, which runs it with exceptions and without. - `include/webcpp/hash/detail/canary.h` is a C header: it is in neither the headers-alone list nor diff --git a/doc/backends.adoc b/doc/backends.adoc index 1adfd12..b2d2d40 100644 --- a/doc/backends.adoc +++ b/doc/backends.adoc @@ -45,7 +45,7 @@ states about its constant time. The backends: | every function of its cells | bearssl -| BearSSL at 7bea48e (v0.6-39) +| BearSSL at 32381d6 (webcpporg/bearssl's webcpp branch: upstream 7bea48e (v0.6-39) plus one ECDSA fix that does not touch hashing) | MIT | `/third_party//bearssl` | native, wasip2, wasip3, emscripten @@ -2061,10 +2061,10 @@ What each backend's upstream states, and where: * blake3: not stated. BLAKE3 1.8.7: README.md and c/README.md state no constant-time property. * sodium: not stated. libsodium 1.0.22: its headers state constant time for comparisons (sodium/utils.h) alone, not for its hashing, MAC, key derivation and password hashing functions (crypto_hash_*, crypto_xof_*, crypto_generichash_*, crypto_shorthash_*, crypto_auth_*, crypto_kdf_*, crypto_pwhash_*). * bearssl: not stated. -** BearSSL at 7bea48e (v0.6-39): bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*. -** BearSSL at 7bea48e (v0.6-39): bearssl_kdf.h states no constant-time property for br_shake_*. -** BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out. -** BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) calls br_hmac_out. +** BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*. +** BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_kdf.h states no constant-time property for br_shake_*. +** BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out. +** BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) calls br_hmac_out. * openssl: not stated. ** OpenSSL 3.5.9: doc/man7/EVP_MD-*.pod, doc/man3/EVP_DigestInit.pod and providers/implementations/digests/ state no constant-time property. ** OpenSSL 3.5.9: doc/man3/EVP_MAC.pod, doc/man7/EVP_MAC-HMAC.pod, EVP_MAC-KMAC.pod, EVP_MAC-BLAKE2.pod, EVP_MAC-Siphash.pod and providers/implementations/macs/ state no constant-time property. diff --git a/doc/capabilities.json b/doc/capabilities.json index d75be4d..e9705b6 100644 --- a/doc/capabilities.json +++ b/doc/capabilities.json @@ -77,7 +77,7 @@ "name": "bearssl", "tag": "backends::bearssl", "macro": "BEARSSL", - "library": "BearSSL at 7bea48e (v0.6-39)", + "library": "BearSSL at 32381d6 (webcpporg/bearssl's webcpp branch: upstream 7bea48e (v0.6-39) plus one ECDSA fix that does not touch hashing)", "licence": "MIT", "jamfile": "/third_party//bearssl", "targets": [ @@ -390,7 +390,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." } }, "openssl": { @@ -430,7 +430,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." } }, "openssl": { @@ -478,7 +478,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." } }, "openssl": { @@ -526,7 +526,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." } }, "openssl": { @@ -574,7 +574,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." } }, "openssl": { @@ -630,7 +630,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." } }, "openssl": { @@ -726,7 +726,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*." } }, "openssl": { @@ -1055,7 +1055,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_kdf.h states no constant-time property for br_shake_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_kdf.h states no constant-time property for br_shake_*." } }, "openssl": { @@ -1111,7 +1111,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_kdf.h states no constant-time property for br_shake_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_kdf.h states no constant-time property for br_shake_*." } }, "openssl": { @@ -2392,7 +2392,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." } }, "openssl": { @@ -2433,7 +2433,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." } }, "openssl": { @@ -2482,7 +2482,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." } }, "openssl": { @@ -2531,7 +2531,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." } }, "openssl": { @@ -2580,7 +2580,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." } }, "openssl": { @@ -2637,7 +2637,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." } }, "openssl": { @@ -3533,7 +3533,7 @@ ], "constant_time": { "value": "not stated", - "source": "BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) calls br_hmac_out." } }, "openssl": { diff --git a/doc/generated/backends-hkdf.adoc b/doc/generated/backends-hkdf.adoc index 3c1ceff..71649b3 100644 --- a/doc/generated/backends-hkdf.adoc +++ b/doc/generated/backends-hkdf.adoc @@ -114,7 +114,7 @@ What each backend states on constant time, as the capability table read it: -* `bearssl`: BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) calls br_hmac_out. +* `bearssl`: BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) calls br_hmac_out. * `botan`: Botan 3.14.1: doc/api_ref/kdf.rst states no constant-time property of its KDFs, and their source (src/lib/kdf/) none. * `hash2`: Boost.Hash2 1.92: its headers (boost/hash2/) state no constant-time property. * `openssl`: OpenSSL 3.5.9: doc/man7/EVP_KDF-HKDF.pod and EVP_KDF-PBKDF2.pod state no constant-time property. diff --git a/doc/generated/backends-hmac.adoc b/doc/generated/backends-hmac.adoc index b622a7f..016ff85 100644 --- a/doc/generated/backends-hmac.adoc +++ b/doc/generated/backends-hmac.adoc @@ -625,7 +625,7 @@ What each backend states on constant time, as the capability table read it: -* `bearssl`: BearSSL at 7bea48e (v0.6-39): bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out. +* `bearssl`: BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out. * `botan`: ** Botan 3.14.1: doc/api_ref/hash.rst warns that Streebog's baseline implementation uses table lookups indexed by the data and is likely vulnerable to cache-based side channels; its constant-time code needs AVX-512 and GFNI, an instruction-set module that /third_party//botan's minimized build does not load. ** Botan 3.14.1: doc/api_ref/hash.rst warns that Whirlpool's baseline implementation uses table lookups indexed by the data and is likely vulnerable to cache-based side channels; its constant-time code needs AVX2 or AVX-512, instruction-set modules that /third_party//botan's minimized build does not load. diff --git a/doc/generated/backends-md5-sha1-sha2.adoc b/doc/generated/backends-md5-sha1-sha2.adoc index 8d8b4af..3e764b4 100644 --- a/doc/generated/backends-md5-sha1-sha2.adoc +++ b/doc/generated/backends-md5-sha1-sha2.adoc @@ -331,7 +331,7 @@ What each backend states on constant time, as the capability table read it: -* `bearssl`: BearSSL at 7bea48e (v0.6-39): bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*. +* `bearssl`: BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*. * `botan`: Botan 3.14.1: doc/api_ref/hash.rst states no constant-time property of this hash, and its source (src/lib/hash/) none. * `hash2`: Boost.Hash2 1.92: its headers (boost/hash2/) state no constant-time property. * `openssl`: OpenSSL 3.5.9: doc/man7/EVP_MD-*.pod, doc/man3/EVP_DigestInit.pod and providers/implementations/digests/ state no constant-time property. diff --git a/doc/generated/backends-sha3-shake.adoc b/doc/generated/backends-sha3-shake.adoc index a0c8c11..d2b3704 100644 --- a/doc/generated/backends-sha3-shake.adoc +++ b/doc/generated/backends-sha3-shake.adoc @@ -268,7 +268,7 @@ What each backend states on constant time, as the capability table read it: -* `bearssl`: BearSSL at 7bea48e (v0.6-39): bearssl_kdf.h states no constant-time property for br_shake_*. +* `bearssl`: BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_kdf.h states no constant-time property for br_shake_*. * `botan`: ** Botan 3.14.1: doc/api_ref/hash.rst states no constant-time property of SHAKE or of its XOF interface, and its source (src/lib/xof/shake_xof/) none. ** Botan 3.14.1: doc/api_ref/hash.rst states no constant-time property of this hash, and its source (src/lib/hash/) none. diff --git a/include/webcpp/hash/detail/canary.h b/include/webcpp/hash/detail/canary.h index 0eb2d5b..67dbf85 100644 --- a/include/webcpp/hash/detail/canary.h +++ b/include/webcpp/hash/detail/canary.h @@ -41,7 +41,7 @@ #ifdef WEBCPP_HASH_BEARSSL_CANARY_COMMIT #define WEBCPP_HASH_BEARSSL_COMMIT WEBCPP_HASH_BEARSSL_CANARY_COMMIT #else -#define WEBCPP_HASH_BEARSSL_COMMIT 7bea48e +#define WEBCPP_HASH_BEARSSL_COMMIT 32381d6 #endif #ifdef WEBCPP_HASH_BOTAN_CANARY_COMMIT diff --git a/test/link/bearssl.cpp b/test/link/bearssl.cpp index eea7d63..e96c9b8 100644 --- a/test/link/bearssl.cpp +++ b/test/link/bearssl.cpp @@ -8,7 +8,7 @@ // its link, or with another commit's canary (WEBCPP_HASH_BEARSSL_CANARY_COMMIT), it does not link: // the canary its header reads, // -// webcpp_hash_bearssl_7bea48e___add_third_party_bearssl_to_your_link, +// webcpp_hash_bearssl_32381d6___add_third_party_bearssl_to_your_link, // // whose configuration is noseeder on Windows and getentropy elsewhere, is undefined (spec // section 5.4). It names nothing of the test support, which a link-fail program is built without.