bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] [PATCH 2/2] openssl: Read cert from private key file if o


From: Tim Rühsen
Subject: Re: [Bug-wget] [PATCH 2/2] openssl: Read cert from private key file if only private key file is given
Date: Mon, 27 Apr 2015 20:00:18 +0200
User-agent: KMail/4.14.2 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; )

Thanks Rohit !

I pushed your patches with a slighty amended commit message.


Regards, Tim

Am Freitag, 24. April 2015, 15:48:30 schrieb Rohit Mathulla:
> * src/openssl.c (ssl_init): Assign opt.cert_{file, type} from
> opt.private_key(_type) ---
> 
> While making the previous double free patch, I saw that openssl doesn't have
> a check for the case where --private-key is given but not --certificate. I
> don't know if there is a specific reason for openssl not having it while
> gnutls does but I'm sending this as a seperate patch just in case.
> 
> Thanks,
> Rohit
> 
>  src/openssl.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/openssl.c b/src/openssl.c
> index b6cdb8d..3ac0f44 100644
> --- a/src/openssl.c
> +++ b/src/openssl.c
> @@ -296,6 +296,13 @@ ssl_init (void)
>        opt.private_key_type = opt.cert_type;
>      }
> 
> +  /* Use cert from private key file unless otherwise specified. */
> +  if (opt.private_key && !opt.cert_file)
> +    {
> +      opt.cert_file = xstrdup (opt.private_key);
> +      opt.cert_type = opt.private_key_type;
> +    }
> +
>    if (opt.cert_file)
>      if (SSL_CTX_use_certificate_file (ssl_ctx, opt.cert_file,
>                                        key_type_to_ssl_type (opt.cert_type))

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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