* 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. */
| 367 | * by device name/class or through search constraints. |
| 368 | */ |
| 369 | static int |
| 370 | checkforsoftware(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 | |
| 391 | static int |
| 392 | cse_create(struct fcrypt *fcr, struct session2_op *sop) |
no test coverage detected