aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2022-07-07 14:39:55 -0500
committerDenis Kenzior <denkenz@gmail.com>2022-07-26 20:44:00 -0500
commitdb27694d05db7e3f216759b3e7950526576d2d94 (patch)
tree7d1f4555c31c8451cbb68419e9bc2f8e43738f3b
parentabb7a9eabc6dba2056d8a856a57c9e19cd75a278 (diff)
key: ECDSA data is given in x962 format
When using the verify operation with ECDSA based public keys, the new format type must be used.
-rw-r--r--ell/key.c12
-rw-r--r--ell/key.h1
2 files changed, 6 insertions, 7 deletions
diff --git a/ell/key.c b/ell/key.c
index 73f38581..24374a5d 100644
--- a/ell/key.c
+++ b/ell/key.c
@@ -383,18 +383,16 @@ LIB_EXPORT ssize_t l_key_get_payload_size(struct l_key *key)
static const char *lookup_cipher(enum l_key_cipher_type cipher)
{
- const char* ret = NULL;
-
switch (cipher) {
case L_KEY_RSA_PKCS1_V1_5:
- ret = "pkcs1";
- break;
+ return "pkcs1";
case L_KEY_RSA_RAW:
- ret = "raw";
- break;
+ return "raw";
+ case L_KEY_ECDSA_X962:
+ return "x962";
}
- return ret;
+ return NULL;
}
static const char *lookup_checksum(enum l_checksum_type checksum)
diff --git a/ell/key.h b/ell/key.h
index f26f7ecb..68971052 100644
--- a/ell/key.h
+++ b/ell/key.h
@@ -56,6 +56,7 @@ enum l_keyring_restriction {
enum l_key_cipher_type {
L_KEY_RSA_PKCS1_V1_5,
L_KEY_RSA_RAW,
+ L_KEY_ECDSA_X962,
};
struct l_key *l_key_new(enum l_key_type type, const void *payload,