提交 8a43a42a 编写于 作者: D Dr. Stephen Henson

Support TLS 1.3 signature scheme names.

Reviewed-by: NRichard Levitte <levitte@openssl.org>
Reviewed-by: NMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2301)
上级 edbfba1a
...@@ -1750,7 +1750,7 @@ static int sig_cb(const char *elem, int len, void *arg) ...@@ -1750,7 +1750,7 @@ static int sig_cb(const char *elem, int len, void *arg)
{ {
sig_cb_st *sarg = arg; sig_cb_st *sarg = arg;
size_t i; size_t i;
char etmp[20], *p; char etmp[40], *p;
int sig_alg = NID_undef, hash_alg = NID_undef; int sig_alg = NID_undef, hash_alg = NID_undef;
if (elem == NULL) if (elem == NULL)
return 0; return 0;
...@@ -1761,15 +1761,26 @@ static int sig_cb(const char *elem, int len, void *arg) ...@@ -1761,15 +1761,26 @@ static int sig_cb(const char *elem, int len, void *arg)
memcpy(etmp, elem, len); memcpy(etmp, elem, len);
etmp[len] = 0; etmp[len] = 0;
p = strchr(etmp, '+'); p = strchr(etmp, '+');
if (!p) /* See if we have a match for TLS 1.3 names */
return 0; if (p == NULL) {
*p = 0; const SIGALG_LOOKUP *s;
p++;
if (!*p) for (i = 0, s = sigalg_lookup_tbl; i < OSSL_NELEM(sigalg_lookup_tbl);
return 0; i++, s++) {
if (s->name != NULL && strcmp(etmp, s->name) == 0) {
get_sigorhash(&sig_alg, &hash_alg, etmp); sig_alg = s->sig;
get_sigorhash(&sig_alg, &hash_alg, p); hash_alg = s->hash;
break;
}
}
} else {
*p = 0;
p++;
if (*p == 0)
return 0;
get_sigorhash(&sig_alg, &hash_alg, etmp);
get_sigorhash(&sig_alg, &hash_alg, p);
}
if (sig_alg == NID_undef || hash_alg == NID_undef) if (sig_alg == NID_undef || hash_alg == NID_undef)
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册