diff options
author | Richard Levitte <levitte@openssl.org> | 2019-11-09 02:18:05 +0300 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-11-29 22:42:12 +0300 |
commit | 3d83c7353630450a4ce4fffc9c75693565e094c2 (patch) | |
tree | d41f784818c5f092e91abf46a01f76ebd6c7894e /include | |
parent | cc38e643cbfb6da84fb2bb6a188698d0bc082a20 (diff) |
CORE: ossl_namemap_add_names(): new function to add multiple names
This was originally the private add_names_to_namemap() in
crypto/evp/evp_fetch.c, but made more generally useful.
To make for more consistent function naming, ossl_namemap_add() and
ossl_namemap_add_n() are renamed to ossl_namemap_add_name() and
ossl_namemap_add_name_n().
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10394)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/namemap.h | 13 | ||||
-rw-r--r-- | include/openssl/cryptoerr.h | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/include/internal/namemap.h b/include/internal/namemap.h index f977606ca6..d33f4b0d4e 100644 --- a/include/internal/namemap.h +++ b/include/internal/namemap.h @@ -17,9 +17,9 @@ OSSL_NAMEMAP *ossl_namemap_new(void); void ossl_namemap_free(OSSL_NAMEMAP *namemap); int ossl_namemap_empty(OSSL_NAMEMAP *namemap); -int ossl_namemap_add(OSSL_NAMEMAP *namemap, int number, const char *name); -int ossl_namemap_add_n(OSSL_NAMEMAP *namemap, int number, - const char *name, size_t name_len); +int ossl_namemap_add_name(OSSL_NAMEMAP *namemap, int number, const char *name); +int ossl_namemap_add_name_n(OSSL_NAMEMAP *namemap, int number, + const char *name, size_t name_len); /* * The number<->name relationship is 1<->many @@ -34,3 +34,10 @@ const char *ossl_namemap_num2name(const OSSL_NAMEMAP *namemap, int number, void ossl_namemap_doall_names(const OSSL_NAMEMAP *namemap, int number, void (*fn)(const char *name, void *data), void *data); + +/* + * A utility that handles several names in a string, divided by a given + * separator. + */ +int ossl_namemap_add_names(OSSL_NAMEMAP *namemap, int number, + const char *names, const char separator); diff --git a/include/openssl/cryptoerr.h b/include/openssl/cryptoerr.h index 43b7aa5a22..ae146c4079 100644 --- a/include/openssl/cryptoerr.h +++ b/include/openssl/cryptoerr.h @@ -83,6 +83,8 @@ int ERR_load_CRYPTO_strings(void); /* * CRYPTO reason codes. */ +# define CRYPTO_R_BAD_ALGORITHM_NAME 117 +# define CRYPTO_R_CONFLICTING_NAMES 118 # define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101 # define CRYPTO_R_ILLEGAL_HEX_DIGIT 102 # define CRYPTO_R_INSUFFICIENT_DATA_SPACE 106 |