diff --git a/AGENTS.md b/AGENTS.md index 87f2d44..4c9b8f5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,9 +21,9 @@ specific to hash. - Every C library is upstream code (CODING-GUIDELINES.md chapter 5 rule 1): never modify third-party code; a defect found in a dependency is reported to the owner, who submits the fix upstream, and until upstream applies it the pin may point at our fork's branch carrying exactly - that patch. BearSSL is ae63032 of webcpporg/bearssl's branch - upstream/ecdsa-bits2int-constant-time: upstream 7bea48e and the ECDSA nonce fix submitted - upstream, which does not touch hashing; the pin returns to upstream once the patch is applied. + that patch. BearSSL is f8a2f3d of webcpporg/bearssl's branch webcpp-pin: upstream 7bea48e + and the two fixes submitted upstream, the ECDSA nonce's (ae63032) and P-256's scalar check's + (ec57f88), which do not touch hashing; the pin returns to upstream once they are applied. 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. diff --git a/doc/backends.adoc b/doc/backends.adoc index b0d815e..335b2bc 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 ae63032 (webcpporg/bearssl's branch upstream/ecdsa-bits2int-constant-time: upstream 7bea48e (v0.6-39) and the ECDSA nonce fix submitted upstream, which does not touch hashing) +| BearSSL at f8a2f3d (webcpporg/bearssl's branch webcpp-pin: upstream 7bea48e (v0.6-39) and the two fixes submitted upstream, the ECDSA nonce's and P-256's scalar check's, which do not touch hashing) | MIT | `/third_party//bearssl` | native, wasip2, wasip3, emscripten @@ -2212,10 +2212,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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: 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 at webcpp's pin ae63032: bearssl_kdf.h states no constant-time property for br_shake_*. -** BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out. -** BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out. +** BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: 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 at webcpp's pin f8a2f3d: bearssl_kdf.h states no constant-time property for br_shake_*. +** BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out. +** BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call 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 737e8c4..6be8168 100644 --- a/doc/capabilities.json +++ b/doc/capabilities.json @@ -77,7 +77,7 @@ "name": "bearssl", "tag": "backends::bearssl", "macro": "BEARSSL", - "library": "BearSSL at ae63032 (webcpporg/bearssl's branch upstream/ecdsa-bits2int-constant-time: upstream 7bea48e (v0.6-39) and the ECDSA nonce fix submitted upstream, which does not touch hashing)", + "library": "BearSSL at f8a2f3d (webcpporg/bearssl's branch webcpp-pin: upstream 7bea48e (v0.6-39) and the two fixes submitted upstream, the ECDSA nonce's and P-256's scalar check's, which do not touch hashing)", "licence": "MIT", "jamfile": "/third_party//bearssl", "targets": [ @@ -390,7 +390,7 @@ "hmacs": null, "constant_time": { "value": "not stated", - "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: 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 at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: 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 at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: 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 at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: 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 at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: 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 at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: 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 at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: 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 at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_kdf.h states no constant-time property for br_shake_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_kdf.h states no constant-time property for br_shake_*." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out." } }, "openssl": { @@ -3559,7 +3559,7 @@ ], "constant_time": { "value": "not stated", - "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out." } }, "openssl": { @@ -3682,7 +3682,7 @@ ], "constant_time": { "value": "not stated", - "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out." } }, "openssl": { @@ -3804,7 +3804,7 @@ ], "constant_time": { "value": "not stated", - "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out." } }, "openssl": { @@ -3926,7 +3926,7 @@ ], "constant_time": { "value": "not stated", - "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out." + "source": "BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out." } }, "openssl": { diff --git a/doc/generated/backends-hkdf.adoc b/doc/generated/backends-hkdf.adoc index d52580f..ec8c9bf 100644 --- a/doc/generated/backends-hkdf.adoc +++ b/doc/generated/backends-hkdf.adoc @@ -254,7 +254,7 @@ What each backend states on constant time, as the capability table read it: -* `bearssl`: BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out. +* `bearssl`: BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call 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. ** Botan 3.14.1: doc/api_ref/message_auth_codes.rst states no constant-time property of HMAC, and its source (src/lib/mac/hmac/) none; HKDF over pieces calls its HMAC. diff --git a/doc/generated/backends-hmac.adoc b/doc/generated/backends-hmac.adoc index 4388e53..47cd42b 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out. +* `bearssl`: BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: 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 7060eeb..bcc941c 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: 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 at webcpp's pin f8a2f3d: 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 1f19c0d..2783126 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 upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_kdf.h states no constant-time property for br_shake_*. +* `bearssl`: BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin f8a2f3d: 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 ec67a09..4a3ebb4 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 ae63032 +#define WEBCPP_HASH_BEARSSL_COMMIT f8a2f3d #endif #ifdef WEBCPP_HASH_BOTAN_CANARY_COMMIT diff --git a/test/link/bearssl.cpp b/test/link/bearssl.cpp index 7c2abfb..61ff1d1 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_ae63032___add_third_party_bearssl_to_your_link, +// webcpp_hash_bearssl_f8a2f3d___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.