diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-16 09:59:52 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-16 09:59:52 +0000 |
commit | 6bc5286496c43a0ee9f1a616507c7aa03e28450c (patch) | |
tree | 9a6ed4374aaf129777560ba58f608368fb8754df /src/libcryptobox | |
parent | 153e64677902c1acc7a1e8ee21d5b634d8a65885 (diff) | |
download | rspamd-6bc5286496c43a0ee9f1a616507c7aa03e28450c.tar.gz rspamd-6bc5286496c43a0ee9f1a616507c7aa03e28450c.zip |
Refactor UCL API
Diffstat (limited to 'src/libcryptobox')
-rw-r--r-- | src/libcryptobox/keypair.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcryptobox/keypair.c b/src/libcryptobox/keypair.c index 51b372b51..a2b842320 100644 --- a/src/libcryptobox/keypair.c +++ b/src/libcryptobox/keypair.c @@ -644,25 +644,25 @@ rspamd_keypair_from_ucl (const ucl_object_t *obj) return NULL; } - elt = ucl_object_find_key (obj, "keypair"); + elt = ucl_object_lookup (obj, "keypair"); if (elt != NULL) { obj = elt; } - pubkey = ucl_object_find_any_key (obj, "pubkey", "public", "public_key", + pubkey = ucl_object_lookup_any (obj, "pubkey", "public", "public_key", NULL); if (pubkey == NULL || ucl_object_type (pubkey) != UCL_STRING) { return NULL; } - privkey = ucl_object_find_any_key (obj, "privkey", "private", "private_key", + privkey = ucl_object_lookup_any (obj, "privkey", "private", "private_key", "secret", "secret_key", NULL); if (privkey == NULL || ucl_object_type (privkey) != UCL_STRING) { return NULL; } /* Optional fields */ - elt = ucl_object_find_key (obj, "type"); + elt = ucl_object_lookup (obj, "type"); if (elt && ucl_object_type (elt) == UCL_STRING) { str = ucl_object_tostring (elt); @@ -675,7 +675,7 @@ rspamd_keypair_from_ucl (const ucl_object_t *obj) /* TODO: handle errors */ } - elt = ucl_object_find_key (obj, "algorithm"); + elt = ucl_object_lookup (obj, "algorithm"); if (elt && ucl_object_type (elt) == UCL_STRING) { str = ucl_object_tostring (elt); @@ -688,7 +688,7 @@ rspamd_keypair_from_ucl (const ucl_object_t *obj) /* TODO: handle errors */ } - elt = ucl_object_find_key (obj, "encoding"); + elt = ucl_object_lookup (obj, "encoding"); if (elt && ucl_object_type (elt) == UCL_STRING) { str = ucl_object_tostring (elt); |