diff options
author | Richard Levitte <levitte@openssl.org> | 2019-05-23 03:18:04 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-06-24 10:58:13 +0200 |
commit | 651d44183e86355b1eb9629a6a61d3da09369bbf (patch) | |
tree | d42e66ae9f3e0ddb836cfb683c32250fbd6655a1 /include/internal/namemap.h | |
parent | Allow AES XTS decryption using duplicate keys. (diff) | |
download | openssl-651d44183e86355b1eb9629a6a61d3da09369bbf.tar.xz openssl-651d44183e86355b1eb9629a6a61d3da09369bbf.zip |
Replumbing: add support for multiple names per algorithm
Algorithms may have multiple names, as seen in the legacy names
database. We need to support that as well.
This implementations modifies ossl_namemap to support multiple names
for the same identifier.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8967)
Diffstat (limited to '')
-rw-r--r-- | include/internal/namemap.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/internal/namemap.h b/include/internal/namemap.h index 30028182fd..57423801d6 100644 --- a/include/internal/namemap.h +++ b/include/internal/namemap.h @@ -16,6 +16,14 @@ OSSL_NAMEMAP *ossl_namemap_stored(OPENSSL_CTX *libctx); OSSL_NAMEMAP *ossl_namemap_new(void); void ossl_namemap_free(OSSL_NAMEMAP *namemap); -int ossl_namemap_add(OSSL_NAMEMAP *namemap, const char *name); -const char *ossl_namemap_name(const OSSL_NAMEMAP *namemap, int number); -int ossl_namemap_number(const OSSL_NAMEMAP *namemap, const char *name); +int ossl_namemap_add(OSSL_NAMEMAP *namemap, int number, const char *name); + +/* + * The number<->name relationship is 1<->many + * Therefore, the name->number mapping is a simple function, while the + * number->name mapping is an iterator. + */ +int ossl_namemap_name2num(const OSSL_NAMEMAP *namemap, const char *name); +void ossl_namemap_doall_names(const OSSL_NAMEMAP *namemap, int number, + void (*fn)(const char *name, void *data), + void *data); |