Commit 82e72d9
committed
gh-127298: When in FIPS mode ensure builtin hashes check for usedforsecurity=False
When _hashlib/OpenSSL is available, and OpenSSL is in FIPS mode,
ensure that builtin (fallback) hash implementations are wrapped with a
check for usedforsecurity=False. It is likely that buitin
implementations are FIPS unapproved (either algorithm disallowed; or
the implementation not certified by NIST).
This enables strict approved-only compliance when usedforsecurity=True
on FIPS systems only.
And yet it also enables fallback access with usedforsecurity=False for
any missing (historical, disallowed or missing certified
implementation) algorithms (i.e. blake2, md5, shake/sha3) depending on
the runtime configuration of OpenSSL.1 parent 2b0e2b2 commit 82e72d9
File tree
4 files changed
+109
-15
lines changed- Lib
- test
- hashlibdata
- Misc/NEWS.d/next/Library
4 files changed
+109
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
82 | 99 | | |
83 | 100 | | |
84 | 101 | | |
| |||
87 | 104 | | |
88 | 105 | | |
89 | 106 | | |
90 | | - | |
| 107 | + | |
91 | 108 | | |
92 | 109 | | |
93 | | - | |
| 110 | + | |
94 | 111 | | |
95 | 112 | | |
96 | | - | |
97 | | - | |
| 113 | + | |
| 114 | + | |
98 | 115 | | |
99 | 116 | | |
100 | | - | |
101 | | - | |
| 117 | + | |
| 118 | + | |
102 | 119 | | |
103 | 120 | | |
104 | | - | |
105 | | - | |
| 121 | + | |
| 122 | + | |
106 | 123 | | |
107 | 124 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
112 | 129 | | |
113 | 130 | | |
114 | | - | |
115 | | - | |
| 131 | + | |
| 132 | + | |
116 | 133 | | |
117 | 134 | | |
118 | 135 | | |
| |||
163 | 180 | | |
164 | 181 | | |
165 | 182 | | |
166 | | - | |
| 183 | + | |
167 | 184 | | |
168 | 185 | | |
169 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments