MCPcopy Create free account
hub / github.com/F-Stack/f-stack / checkforsoftware

Function checkforsoftware

freebsd/opencrypto/cryptodev.c:369–389  ·  view source on GitHub ↗

* Check a crypto identifier to see if it requested * a software device/driver. This can be done either * by device name/class or through search constraints. */

Source from the content-addressed store, hash-verified

367 * by device name/class or through search constraints.
368 */
369static int
370checkforsoftware(int *cridp)
371{
372 int crid;
373
374 crid = *cridp;
375
376 if (!crypto_devallowsoft) {
377 if (crid & CRYPTOCAP_F_SOFTWARE) {
378 if (crid & CRYPTOCAP_F_HARDWARE) {
379 *cridp = CRYPTOCAP_F_HARDWARE;
380 return 0;
381 }
382 return EINVAL;
383 }
384 if ((crid & CRYPTOCAP_F_HARDWARE) == 0 &&
385 (crypto_getcaps(crid) & CRYPTOCAP_F_HARDWARE) == 0)
386 return EINVAL;
387 }
388 return 0;
389}
390
391static int
392cse_create(struct fcrypt *fcr, struct session2_op *sop)

Callers 1

cse_createFunction · 0.85

Calls 1

crypto_getcapsFunction · 0.85

Tested by

no test coverage detected