mirror of
https://github.com/curl/curl.git
synced 2026-08-25 08:43:31 +03:00
x509asn1: fix DH public key parameter extraction
The dh(g) parameter was read from param->beg instead of from the cursor p returned by parsing dh(p). This caused dh(g) to always report the same value as dh(p) when inspecting DH certificates via CURLOPT_CERTINFO on non-OpenSSL backends. The DSA branch correctly advances the cursor; the DH branch lost this during what appears to be a copy-paste. Add unit1676 to verify that dh(p) and dh(g) report distinct values using a hand-crafted minimal DER certificate. Assisted by: Claude Opus 4.6 Signed-off-by: Sergio Correia <scorreia@redhat.com> Closes #21595
This commit is contained in:
parent
d6571f7a70
commit
61d59c9e39
5 changed files with 144 additions and 3 deletions
|
|
@ -1062,7 +1062,7 @@ static int do_pubkey(struct Curl_easy *data, int certnum, const char *algo,
|
|||
if(p) {
|
||||
if(do_pubkey_field(data, certnum, "dh(p)", &elem))
|
||||
return 1;
|
||||
if(getASN1Element(&elem, param->beg, param->end)) {
|
||||
if(getASN1Element(&elem, p, param->end)) {
|
||||
if(do_pubkey_field(data, certnum, "dh(g)", &elem))
|
||||
return 1;
|
||||
if(do_pubkey_field(data, certnum, "dh(pub_key)", &pk))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue