diff options
author | Denis Pynkin <denis.pynkin@collabora.com> | 2019-08-09 22:07:57 +0300 |
---|---|---|
committer | Denis Pynkin <denis.pynkin@collabora.com> | 2020-03-25 15:23:54 +0300 |
commit | 2303202c86c96768abb42728b2e5b2090b9d0198 (patch) | |
tree | b9196cbce2b60230729f7ed30ec9217fc1d64db0 /src/ostree/ot-builtin-commit.c | |
parent | 9e8f0f4ca0350cd43c202fe25b99900450e53406 (diff) | |
download | ostree-2303202c86c96768abb42728b2e5b2090b9d0198.tar.gz |
sign: API changes for public keys and CLI keys format
API changes:
- added function `ostree_sign_add_pk()` for multiple public keys using.
- `ostree_sign_set_pk()` now substitutes all previously added keys.
- added function `ostree_sign_load_pk()` allowed to load keys from file.
- `ostree_sign_ed25519_load_pk()` able to load the raw keys list from file.
- use base64 encoded public and private ed25519 keys for CLI and keys file.
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Diffstat (limited to 'src/ostree/ot-builtin-commit.c')
-rw-r--r-- | src/ostree/ot-builtin-commit.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c index 4bbde92e..89ada19e 100644 --- a/src/ostree/ot-builtin-commit.c +++ b/src/ostree/ot-builtin-commit.c @@ -868,11 +868,10 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio else if (!g_strcmp0 (ostree_sign_get_name (sign), "ed25519")) { gsize key_len = 0; - key = g_malloc0 (crypto_sign_SECRETKEYBYTES); - if (sodium_hex2bin (key, crypto_sign_SECRETKEYBYTES, - keyid, strlen (keyid), - NULL, &key_len, NULL) != 0) - { + g_autofree guchar *key = g_base64_decode (keyid, &key_len); + + if ( key_len != crypto_sign_SECRETKEYBYTES) + { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Invalid KEY '%s'", keyid); |