module: icp: rip out the Solaris loadable module architecture

After progressively folding away null cases, it turns out there's
/literally/ nothing there, even if some things are part of the
Solaris SPARC DDI/DKI or the seventeen module types (some doubled for
32-bit userland), or the entire modctl syscall definition.
Nothing.

Initialisation is handled in illumos-crypto.c,
which calls all the initialisers directly

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Attila Fülöp <attila@fueloep.org>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12895
Closes #12902
This commit is contained in:
наб
2021-12-22 15:27:43 +01:00
committed by Brian Behlendorf
parent c1d3be19d7
commit 5c8389a8cb
13 changed files with 20 additions and 839 deletions
+2 -26
View File
@@ -32,27 +32,10 @@
#include <sys/crypto/spi.h>
#include <sys/crypto/icp.h>
#include <modes/modes.h>
#include <sys/modctl.h>
#define _AES_IMPL
#include <aes/aes_impl.h>
#include <modes/gcm_impl.h>
#define CRYPTO_PROVIDER_NAME "aes"
extern struct mod_ops mod_cryptoops;
/*
* Module linkage information for the kernel.
*/
static struct modlcrypto modlcrypto = {
&mod_cryptoops,
"AES Kernel SW Provider"
};
static struct modlinkage modlinkage = {
MODREV_1, { (void *)&modlcrypto, NULL }
};
/*
* Mechanism info structure passed to KCF during registration.
*/
@@ -199,20 +182,13 @@ static crypto_data_t null_crypto_data = { CRYPTO_DATA_RAW };
int
aes_mod_init(void)
{
int ret;
/* Determine the fastest available implementation. */
aes_impl_init();
gcm_impl_init();
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);
if (crypto_register_provider(&aes_prov_info, &aes_prov_handle))
return (EACCES);
}
return (0);
}
@@ -228,7 +204,7 @@ aes_mod_fini(void)
aes_prov_handle = 0;
}
return (mod_remove(&modlinkage));
return (0);
}
static int