wget-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wget2 | Several OCSP improvements (!513)


From: @rockdaboot
Subject: Re: wget2 | Several OCSP improvements (!513)
Date: Sun, 25 Sep 2022 18:00:14 +0000



Tim Rühsen started a new discussion on libwget/ssl_openssl.c: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/513#note_1113464057

> +     } else {
> +             if (certid)
> +                     OCSP_CERTID_free(certid);
> +             xfree(resp);
> +     }
> +}
> +
> +static const struct ocsp_stapled_response *ocsp_stapled_response_get(const 
> X509 *cert, const X509 *issuer,
> +                                                                  const 
> wget_vector *vec)
> +{
> +     OCSP_CERTID *certid = OCSP_cert_to_id(NULL, cert, issuer);
> +     int pos = wget_vector_find(vec, (const void *) certid);
> +
> +     OCSP_CERTID_free(certid);
> +
> +     if (pos >= 0)

You can simplify the code by just
```
return wget_vector_get(vec, pos);
```
(If pos < 0 the get function returns NULL.)

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/513#note_1113464057
You're receiving this email because of your account on gitlab.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]