summaryrefslogtreecommitdiff
path: root/host/lib21/host_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib21/host_key.c')
-rw-r--r--host/lib21/host_key.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/host/lib21/host_key.c b/host/lib21/host_key.c
index c0235b3b..2066a223 100644
--- a/host/lib21/host_key.c
+++ b/host/lib21/host_key.c
@@ -49,6 +49,34 @@ const struct vb2_text_vs_enum vb2_text_vs_crypto[] = {
{"RSA8192 SHA1", VB2_ALG_RSA8192_SHA1},
{"RSA8192 SHA256", VB2_ALG_RSA8192_SHA256},
{"RSA8192 SHA512", VB2_ALG_RSA8192_SHA512},
+ {"RSA2048 EXP3 SHA1", VB2_ALG_RSA2048_EXP3_SHA1},
+ {"RSA2048 EXP3 SHA256", VB2_ALG_RSA2048_EXP3_SHA256},
+ {"RSA2048 EXP3 SHA512", VB2_ALG_RSA2048_EXP3_SHA512},
+ {"RSA3072 EXP3 SHA1", VB2_ALG_RSA3072_EXP3_SHA1},
+ {"RSA3072 EXP3 SHA256", VB2_ALG_RSA3072_EXP3_SHA256},
+ {"RSA3072 EXP3 SHA512", VB2_ALG_RSA3072_EXP3_SHA512},
+ {0, 0}
+};
+
+const struct vb2_text_vs_enum vb2_file_vs_crypto[] = {
+ {"rsa1024", VB2_ALG_RSA1024_SHA1},
+ {"rsa1024", VB2_ALG_RSA1024_SHA256},
+ {"rsa1024", VB2_ALG_RSA1024_SHA512},
+ {"rsa2048", VB2_ALG_RSA2048_SHA1},
+ {"rsa2048", VB2_ALG_RSA2048_SHA256},
+ {"rsa2048", VB2_ALG_RSA2048_SHA512},
+ {"rsa4096", VB2_ALG_RSA4096_SHA1},
+ {"rsa4096", VB2_ALG_RSA4096_SHA256},
+ {"rsa4096", VB2_ALG_RSA4096_SHA512},
+ {"rsa8192", VB2_ALG_RSA8192_SHA1},
+ {"rsa8192", VB2_ALG_RSA8192_SHA256},
+ {"rsa8192", VB2_ALG_RSA8192_SHA512},
+ {"rsa2048_exp3", VB2_ALG_RSA2048_EXP3_SHA1},
+ {"rsa2048_exp3", VB2_ALG_RSA2048_EXP3_SHA256},
+ {"rsa2048_exp3", VB2_ALG_RSA2048_EXP3_SHA512},
+ {"rsa3072_exp3", VB2_ALG_RSA3072_EXP3_SHA1},
+ {"rsa3072_exp3", VB2_ALG_RSA3072_EXP3_SHA256},
+ {"rsa3072_exp3", VB2_ALG_RSA3072_EXP3_SHA512},
{0, 0}
};
@@ -88,6 +116,14 @@ const char *vb2_get_crypto_algorithm_name(enum vb2_crypto_algorithm alg)
return entry ? entry->name : VB2_INVALID_ALG_NAME;
}
+const char *vb2_get_crypto_algorithm_file(enum vb2_crypto_algorithm alg)
+{
+ const struct vb2_text_vs_enum *entry =
+ vb2_lookup_by_num(vb2_file_vs_crypto, alg);
+
+ return entry ? entry->name : VB2_INVALID_ALG_NAME;
+}
+
void vb2_private_key_free(struct vb2_private_key *key)
{
if (!key)