summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-11-02 12:41:23 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-12-07 17:14:58 +1000
commitabdd3fa04f3401c4a542257fdd803ff4c4daf8ef (patch)
treec0f3c1467f25a05293e66baf8a93cb9ee8d2b8c9 /crypto
parentac093b3fe6ba3f21e874a25ddecc7c1b4dff2765 (diff)
Change OPENSSL_hexstr2buf_ex() & OPENSSL_buf2hexstr_ex() to pass the separator
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13294)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/o_str.c9
-rw-r--r--crypto/params_from_text.c2
2 files changed, 6 insertions, 5 deletions
diff --git a/crypto/o_str.c b/crypto/o_str.c
index 933133a05c..142ac4ba44 100644
--- a/crypto/o_str.c
+++ b/crypto/o_str.c
@@ -176,9 +176,9 @@ static int hexstr2buf_sep(unsigned char *buf, size_t buf_n, size_t *buflen,
* Given a string of hex digits convert to a buffer
*/
int OPENSSL_hexstr2buf_ex(unsigned char *buf, size_t buf_n, size_t *buflen,
- const char *str)
+ const char *str, const char sep)
{
- return hexstr2buf_sep(buf, buf_n, buflen, str, DEFAULT_SEPARATOR);
+ return hexstr2buf_sep(buf, buf_n, buflen, str, sep);
}
unsigned char *openssl_hexstr2buf_sep(const char *str, long *buflen,
@@ -249,9 +249,10 @@ static int buf2hexstr_sep(char *str, size_t str_n, size_t *strlen,
}
int OPENSSL_buf2hexstr_ex(char *str, size_t str_n, size_t *strlen,
- const unsigned char *buf, size_t buflen)
+ const unsigned char *buf, size_t buflen,
+ const char sep)
{
- return buf2hexstr_sep(str, str_n, strlen, buf, buflen, DEFAULT_SEPARATOR);
+ return buf2hexstr_sep(str, str_n, strlen, buf, buflen, sep);
}
char *openssl_buf2hexstr_sep(const unsigned char *buf, long buflen, char sep)
diff --git a/crypto/params_from_text.c b/crypto/params_from_text.c
index 9f74dc1075..d458d31b2e 100644
--- a/crypto/params_from_text.c
+++ b/crypto/params_from_text.c
@@ -145,7 +145,7 @@ static int construct_from_text(OSSL_PARAM *to, const OSSL_PARAM *paramdef,
if (ishex) {
size_t l = 0;
- if (!OPENSSL_hexstr2buf_ex(buf, buf_n, &l, value))
+ if (!OPENSSL_hexstr2buf_ex(buf, buf_n, &l, value, ':'))
return 0;
} else {
memcpy(buf, value, buf_n);