Commit b8eaad3
Detect libcrypto BLAKE2, Shake, SHA3, and Truncated-SHA512 support at hashlib build time
## BLAKE2
While OpenSSL supports both "b" and "s" variants of the BLAKE2 hash
function, other cryptographic libraries may lack support for one or both
of the variants. This commit modifies `hashlib`'s C code to detect
whether or not the linked libcrypto supports each BLAKE2 variant, and
elides references to each variant's NID accordingly. In cases where the
underlying libcrypto doesn't fully support BLAKE2, CPython's
`./configure` script can be given the following flag to use CPython's
interned BLAKE2 implementation: `--with-builtin-hashlib-hashes=blake2`.
## SHA3, Shake, & truncated SHA512.
Detect BLAKE2, SHA3, Shake, & truncated SHA512 support in the
OpenSSL-ish libcrypto library at build time. This helps allow hashlib's
`_hashopenssl` to be used with libraries that do not to support every
algorithm that upstream OpenSSL does. Such as AWS-LC & BoringSSL.
Co-authored-by: Gregory P. Smith [Google LLC] <[email protected]>
1 parent 01a51f9 commit b8eaad3
File tree
2 files changed
+62
-10
lines changed- Misc/NEWS.d/next/Security
- Modules
2 files changed
+62
-10
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| |||
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
| 97 | + | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
95 | 102 | | |
96 | 103 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
107 | 136 | | |
108 | 137 | | |
109 | 138 | | |
| |||
119 | 148 | | |
120 | 149 | | |
121 | 150 | | |
| 151 | + | |
122 | 152 | | |
| 153 | + | |
| 154 | + | |
123 | 155 | | |
| 156 | + | |
124 | 157 | | |
| 158 | + | |
125 | 159 | | |
| 160 | + | |
| 161 | + | |
126 | 162 | | |
| 163 | + | |
| 164 | + | |
127 | 165 | | |
| 166 | + | |
| 167 | + | |
128 | 168 | | |
| 169 | + | |
129 | 170 | | |
| 171 | + | |
130 | 172 | | |
| 173 | + | |
| 174 | + | |
131 | 175 | | |
| 176 | + | |
132 | 177 | | |
| 178 | + | |
133 | 179 | | |
| 180 | + | |
| 181 | + | |
134 | 182 | | |
| 183 | + | |
135 | 184 | | |
136 | 185 | | |
137 | 186 | | |
| |||
0 commit comments