int _init(void) { int ret; /* * Register with KCF. If the registration fails, log an error * and uninstall the module. */ if ((ret = crypto_register_provider(&rc4_prov_info, &rc4_prov_handle)) != CRYPTO_SUCCESS) { cmn_err(CE_WARN, "_init: crypto_register_provider(%s)" "failed (0x%x)", "arcfour", ret); return (EACCES); } if ((ret = mod_install(&modlinkage)) != 0) { int rv; ASSERT(rc4_prov_handle != NULL); /* We should not return if the unregister returns busy. */ while ((rv = crypto_unregister_provider(rc4_prov_handle)) == CRYPTO_BUSY) { cmn_err(CE_WARN, "_init: crypto_unregister_provider(%s)" " failed (0x%x). Retrying.", "arcfour", rv); /* wait 10 seconds and try again. */ delay(10 * drv_usectohz(1000000)); } } return (0); }
int _init(void) { int ret; /* * Register with KCF. If the registration fails, return error. */ if ((ret = crypto_register_provider(&aes_prov_info, &aes_prov_handle)) != CRYPTO_SUCCESS) { cmn_err(CE_WARN, "%s _init: crypto_register_provider()" "failed (0x%x)", CRYPTO_PROVIDER_NAME, ret); return (EACCES); } if ((ret = mod_install(&modlinkage)) != 0) { int rv; ASSERT(aes_prov_handle != NULL); /* We should not return if the unregister returns busy. */ while ((rv = crypto_unregister_provider(aes_prov_handle)) == CRYPTO_BUSY) { cmn_err(CE_WARN, "%s _init: crypto_unregister_provider() " "failed (0x%x). Retrying.", CRYPTO_PROVIDER_NAME, rv); /* wait 10 seconds and try again. */ delay(10 * drv_usectohz(1000000)); } } return (ret); }
int _init(void) { int error; if ((error = mod_install(&modlinkage)) != 0) return (error); /* * Try to register with KCF - failure shouldn't unload us, since we * still may want to continue providing misc/skein functionality. */ (void) crypto_register_provider(&skein_prov_info, &skein_prov_handle); return (0); }
int _init(void) { int ret; if ((ret = mod_install(&modlinkage)) != 0) return (ret); /* Register with KCF. If the registration fails, remove the module. */ if (crypto_register_provider(&aes_prov_info, &aes_prov_handle)) { (void) mod_remove(&modlinkage); return (EACCES); } return (0); }
int _init(void) { int ret; if ((ret = mod_install(&modlinkage)) != 0) return (ret); /* * Register with KCF. If the registration fails, kcf will log an * error but do not uninstall the module, since the functionality * provided by misc/des should still be available. * */ (void) crypto_register_provider(&des_prov_info, &des_prov_handle); return (0); }
int _init(void) { int ret; if ((ret = mod_install(&modlinkage)) != 0) return (ret); /* * Register with KCF. If the registration fails, log an * error but do not uninstall the module, since the functionality * provided by misc/md5 should still be available. */ if ((ret = crypto_register_provider(&md5_prov_info, &md5_prov_handle)) != CRYPTO_SUCCESS) cmn_err(CE_WARN, "md5 _init: " "crypto_register_provider() failed (0x%x)", ret); return (0); }