Commit 3c28f57
committed
crapi: add OpenSSL EVP digest backend
Extend the crapi layer with a third cryptographic backend, selectable at
build time with -DWITH_CRYPTO=openssl. This gives users and distribution
maintainers an additional choice of crypto provider alongside the existing
gcrypt and NSS backends.
One concrete motivation is deployments that restrict cryptographic
operations to a FIPS 140-3 validated library: on those systems OpenSSL
may be the only permitted provider, making this backend necessary to run
the filehash probes.
The implementation uses the OpenSSL EVP high-level digest API, which
provides a stable, uniform interface across OpenSSL 1.0.x, 1.1.x, and
3.x. A compile-time compatibility shim aliases EVP_MD_CTX_new() and
EVP_MD_CTX_free() to their pre-1.1.0 equivalents (EVP_MD_CTX_create()
and EVP_MD_CTX_destroy()) for builds against older OpenSSL releases.
Because OpenSSL is already an unconditional build dependency of OpenSCAP
(required by xmlsec), selecting this backend introduces no new external
dependency.
The supported digest algorithms are SHA-224, SHA-256, SHA-384, SHA-512,
and optionally MD5 and SHA-1 (governed by the existing OPENSCAP_ENABLE_MD5
and OPENSCAP_ENABLE_SHA1 flags). RIPEMD-160, which is gcrypt-specific
and not part of the OVAL specification, is intentionally not included:
its status in OpenSSL 3.x is deprecated and requires loading the legacy
provider explicitly.1 parent 657a4ff commit 3c28f57
File tree
5 files changed
+170
-4
lines changed- src
- OVAL/probes/crapi
5 files changed
+170
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
| 180 | + | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
183 | 189 | | |
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
187 | | - | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
50 | 61 | | |
51 | 62 | | |
52 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
48 | 61 | | |
49 | 62 | | |
50 | 63 | | |
| |||
95 | 108 | | |
96 | 109 | | |
97 | 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 | + | |
98 | 135 | | |
99 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
100 | 177 | | |
101 | 178 | | |
102 | 179 | | |
| |||
107 | 184 | | |
108 | 185 | | |
109 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
110 | 203 | | |
111 | 204 | | |
112 | 205 | | |
| |||
116 | 209 | | |
117 | 210 | | |
118 | 211 | | |
| 212 | + | |
119 | 213 | | |
120 | 214 | | |
121 | 215 | | |
| |||
129 | 223 | | |
130 | 224 | | |
131 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
132 | 230 | | |
133 | 231 | | |
134 | 232 | | |
| |||
181 | 279 | | |
182 | 280 | | |
183 | 281 | | |
| 282 | + | |
184 | 283 | | |
185 | 284 | | |
186 | 285 | | |
187 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
188 | 294 | | |
189 | 295 | | |
190 | 296 | | |
| |||
201 | 307 | | |
202 | 308 | | |
203 | 309 | | |
| 310 | + | |
| 311 | + | |
204 | 312 | | |
205 | 313 | | |
206 | 314 | | |
| |||
215 | 323 | | |
216 | 324 | | |
217 | 325 | | |
| 326 | + | |
218 | 327 | | |
| 328 | + | |
219 | 329 | | |
220 | 330 | | |
221 | 331 | | |
222 | 332 | | |
223 | 333 | | |
224 | 334 | | |
225 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
226 | 355 | | |
227 | 356 | | |
228 | 357 | | |
| |||
245 | 374 | | |
246 | 375 | | |
247 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
248 | 380 | | |
249 | 381 | | |
250 | 382 | | |
| |||
264 | 396 | | |
265 | 397 | | |
266 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
267 | 408 | | |
268 | 409 | | |
269 | 410 | | |
| |||
275 | 416 | | |
276 | 417 | | |
277 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
278 | 422 | | |
279 | 423 | | |
280 | 424 | | |
| |||
0 commit comments