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

Function crypto_unregister_all

freebsd/opencrypto/crypto.c:1159–1184  ·  view source on GitHub ↗

* Unregister all algorithms associated with a crypto driver. * If there are pending sessions using it, leave enough information * around so that subsequent calls using those sessions will * correctly detect the driver has been unregistered and reroute * requests. */

Source from the content-addressed store, hash-verified

1157 * requests.
1158 */
1159int
1160crypto_unregister_all(uint32_t driverid)
1161{
1162 struct cryptocap *cap;
1163
1164 CRYPTO_DRIVER_LOCK();
1165 cap = crypto_checkdriver(driverid);
1166 if (cap == NULL) {
1167 CRYPTO_DRIVER_UNLOCK();
1168 return (EINVAL);
1169 }
1170
1171 cap->cc_flags |= CRYPTOCAP_F_CLEANUP;
1172 crypto_drivers[driverid] = NULL;
1173
1174 /*
1175 * XXX: This doesn't do anything to kick sessions that
1176 * have no pending operations.
1177 */
1178 while (cap->cc_sessions != 0 || cap->cc_koperations != 0)
1179 mtx_sleep(cap, &crypto_drivers_mtx, 0, "cryunreg", 0);
1180 CRYPTO_DRIVER_UNLOCK();
1181 cap_rele(cap);
1182
1183 return (0);
1184}
1185
1186/*
1187 * Clear blockage on a driver. The what parameter indicates whether

Callers 7

ossl_detachFunction · 0.85
blake2_detachFunction · 0.85
aesni_detachFunction · 0.85
armv8_crypto_detachFunction · 0.85
ccp_detachFunction · 0.85
padlock_detachFunction · 0.85
swcr_detachFunction · 0.85

Calls 2

crypto_checkdriverFunction · 0.85
cap_releFunction · 0.85

Tested by

no test coverage detected