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

Function crypto_ioctl

freebsd/opencrypto/cryptodev.c:1378–1580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1376}
1377
1378static int
1379crypto_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag,
1380 struct thread *td)
1381{
1382 static struct timeval keywarn, featwarn;
1383 struct fcrypt *fcr;
1384 struct csession *cse;
1385 struct session2_op *sop;
1386 struct crypt_op *cop;
1387 struct crypt_aead *caead;
1388 struct crypt_kop *kop;
1389 uint32_t ses;
1390 int error = 0;
1391 union {
1392 struct session2_op sopc;
1393#ifdef COMPAT_FREEBSD32
1394 struct crypt_op copc;
1395 struct crypt_aead aeadc;
1396 struct crypt_kop kopc;
1397#endif
1398 } thunk;
1399#ifdef COMPAT_FREEBSD32
1400 u_long cmd32;
1401 void *data32;
1402
1403 cmd32 = 0;
1404 data32 = NULL;
1405 switch (cmd) {
1406 case CIOCGSESSION32:
1407 cmd32 = cmd;
1408 data32 = data;
1409 cmd = CIOCGSESSION;
1410 data = (void *)&thunk.sopc;
1411 session_op_from_32((struct session_op32 *)data32, &thunk.sopc);
1412 break;
1413 case CIOCGSESSION232:
1414 cmd32 = cmd;
1415 data32 = data;
1416 cmd = CIOCGSESSION2;
1417 data = (void *)&thunk.sopc;
1418 session2_op_from_32((struct session2_op32 *)data32,
1419 &thunk.sopc);
1420 break;
1421 case CIOCCRYPT32:
1422 cmd32 = cmd;
1423 data32 = data;
1424 cmd = CIOCCRYPT;
1425 data = (void *)&thunk.copc;
1426 crypt_op_from_32((struct crypt_op32 *)data32, &thunk.copc);
1427 break;
1428 case CIOCCRYPTAEAD32:
1429 cmd32 = cmd;
1430 data32 = data;
1431 cmd = CIOCCRYPTAEAD;
1432 data = (void *)&thunk.aeadc;
1433 crypt_aead_from_32((struct crypt_aead32 *)data32, &thunk.aeadc);
1434 break;
1435 case CIOCKEY32:

Callers

nothing calls this directly

Calls 15

session_op_from_32Function · 0.85
session2_op_from_32Function · 0.85
crypt_op_from_32Function · 0.85
crypt_aead_from_32Function · 0.85
crypt_kop_from_32Function · 0.85
session2_op_from_opFunction · 0.85
cse_createFunction · 0.85
session2_op_to_opFunction · 0.85
cse_deleteFunction · 0.85
cse_findFunction · 0.85
cryptodev_opFunction · 0.85
cse_freeFunction · 0.85

Tested by

no test coverage detected