mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-28 14:43:37 +02:00
Remove experimental module signing functionality
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
This commit is contained in:
parent
86a605eb10
commit
5f30ed1da6
20
src/evmctl.c
20
src/evmctl.c
@ -72,7 +72,6 @@ static int digsig;
|
|||||||
static char *keypass;
|
static char *keypass;
|
||||||
static int sigfile;
|
static int sigfile;
|
||||||
static int x509 = 1;
|
static int x509 = 1;
|
||||||
static int modsig;
|
|
||||||
static char *uuid_str = "+";
|
static char *uuid_str = "+";
|
||||||
static char *search_type;
|
static char *search_type;
|
||||||
static int recursive;
|
static int recursive;
|
||||||
@ -630,7 +629,6 @@ static int sign_ima(const char *file, const char *key)
|
|||||||
{
|
{
|
||||||
unsigned char hash[64];
|
unsigned char hash[64];
|
||||||
unsigned char sig[1024] = "\x03";
|
unsigned char sig[1024] = "\x03";
|
||||||
char magic[] = "This Is A Crypto Signed Module";
|
|
||||||
int len, err;
|
int len, err;
|
||||||
|
|
||||||
len = ima_calc_hash(file, hash);
|
len = ima_calc_hash(file, hash);
|
||||||
@ -644,16 +642,6 @@ static int sign_ima(const char *file, const char *key)
|
|||||||
/* add header */
|
/* add header */
|
||||||
len++;
|
len++;
|
||||||
|
|
||||||
if (modsig) {
|
|
||||||
/* add signature length */
|
|
||||||
*(uint16_t *)(sig + len) = __cpu_to_be16(len - 1);
|
|
||||||
len += sizeof(uint16_t);
|
|
||||||
memcpy(sig + len, magic, sizeof(magic) - 1);
|
|
||||||
len += sizeof(magic) - 1;
|
|
||||||
bin2file(file, "sig", sig + 1, len - 1);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sigfile)
|
if (sigfile)
|
||||||
bin2file(file, "sig", sig, len);
|
bin2file(file, "sig", sig, len);
|
||||||
|
|
||||||
@ -1510,7 +1498,6 @@ static void usage(void)
|
|||||||
" -s, --imasig also make IMA signature\n"
|
" -s, --imasig also make IMA signature\n"
|
||||||
" -d, --imahash also make IMA hash\n"
|
" -d, --imahash also make IMA hash\n"
|
||||||
" -f, --sigfile store IMA signature in .sig file instead of xattr\n"
|
" -f, --sigfile store IMA signature in .sig file instead of xattr\n"
|
||||||
" -m, --modsig store module signature in .sig file instead of xattr\n"
|
|
||||||
" -1, --rsa signing key is in RSA DER format (signing v1)\n"
|
" -1, --rsa signing key is in RSA DER format (signing v1)\n"
|
||||||
" -k, --key path to signing key (default keys are /etc/keys/{privkey,pubkey}_evm.pem)\n"
|
" -k, --key path to signing key (default keys are /etc/keys/{privkey,pubkey}_evm.pem)\n"
|
||||||
" -p, --pass password for encrypted signing key\n"
|
" -p, --pass password for encrypted signing key\n"
|
||||||
@ -1530,7 +1517,7 @@ struct command cmds[] = {
|
|||||||
{"import", cmd_import, 0, "[--rsa] pubkey keyring", "Import public key into the keyring.\n"},
|
{"import", cmd_import, 0, "[--rsa] pubkey keyring", "Import public key into the keyring.\n"},
|
||||||
{"sign", cmd_sign_evm, 0, "[-r] [--imahash | --imasig ] [--key key] [--pass password] file", "Sign file metadata.\n"},
|
{"sign", cmd_sign_evm, 0, "[-r] [--imahash | --imasig ] [--key key] [--pass password] file", "Sign file metadata.\n"},
|
||||||
{"verify", cmd_verify_evm, 0, "file", "Verify EVM signature (for debugging).\n"},
|
{"verify", cmd_verify_evm, 0, "file", "Verify EVM signature (for debugging).\n"},
|
||||||
{"ima_sign", cmd_sign_ima, 0, "[--sigfile | --modsig] [--key key] [--pass password] file", "Make file content signature.\n"},
|
{"ima_sign", cmd_sign_ima, 0, "[--sigfile] [--key key] [--pass password] file", "Make file content signature.\n"},
|
||||||
{"ima_verify", cmd_verify_ima, 0, "file", "Verify IMA signature (for debugging).\n"},
|
{"ima_verify", cmd_verify_ima, 0, "file", "Verify IMA signature (for debugging).\n"},
|
||||||
{"ima_hash", cmd_hash_ima, 0, "file", "Make file content hash.\n"},
|
{"ima_hash", cmd_hash_ima, 0, "file", "Make file content hash.\n"},
|
||||||
{"ima_measurement", cmd_ima_measurement, 0, "file", "Verify measurement list (experimental).\n"},
|
{"ima_measurement", cmd_ima_measurement, 0, "file", "Verify measurement list (experimental).\n"},
|
||||||
@ -1548,7 +1535,6 @@ static struct option opts[] = {
|
|||||||
{"hashalgo", 1, 0, 'a'},
|
{"hashalgo", 1, 0, 'a'},
|
||||||
{"pass", 1, 0, 'p'},
|
{"pass", 1, 0, 'p'},
|
||||||
{"sigfile", 0, 0, 'f'},
|
{"sigfile", 0, 0, 'f'},
|
||||||
{"modsig", 0, 0, 'm'},
|
|
||||||
{"uuid", 2, 0, 'u'},
|
{"uuid", 2, 0, 'u'},
|
||||||
{"rsa", 0, 0, '1'},
|
{"rsa", 0, 0, '1'},
|
||||||
{"key", 1, 0, 'k'},
|
{"key", 1, 0, 'k'},
|
||||||
@ -1599,10 +1585,6 @@ int main(int argc, char *argv[])
|
|||||||
sigfile = 1;
|
sigfile = 1;
|
||||||
xattr = 0;
|
xattr = 0;
|
||||||
break;
|
break;
|
||||||
case 'm':
|
|
||||||
modsig = 1;
|
|
||||||
xattr = 0;
|
|
||||||
break;
|
|
||||||
case 'u':
|
case 'u':
|
||||||
uuid_str = optarg ?: "+";
|
uuid_str = optarg ?: "+";
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user