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

Function cryptodev_find

freebsd/opencrypto/cryptodev.c:1325–1344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1323}
1324
1325static int
1326cryptodev_find(struct crypt_find_op *find)
1327{
1328 device_t dev;
1329 size_t fnlen = sizeof find->name;
1330
1331 if (find->crid != -1) {
1332 dev = crypto_find_device_byhid(find->crid);
1333 if (dev == NULL)
1334 return (ENOENT);
1335 strncpy(find->name, device_get_nameunit(dev), fnlen);
1336 find->name[fnlen - 1] = '\x0';
1337 } else {
1338 find->name[fnlen - 1] = '\x0';
1339 find->crid = crypto_find_driver(find->name);
1340 if (find->crid == -1)
1341 return (ENOENT);
1342 }
1343 return (0);
1344}
1345
1346static void
1347fcrypt_dtor(void *data)

Callers 1

crypto_ioctlFunction · 0.70

Calls 4

crypto_find_device_byhidFunction · 0.85
strncpyFunction · 0.85
device_get_nameunitFunction · 0.85
crypto_find_driverFunction · 0.85

Tested by

no test coverage detected