Overview
SHA1 Hash: | d92945e5dad0360a1b234a4e11cfb761524f8da6 |
---|---|
Date: | 2009-11-09 21:22:32 |
User: | dmitry |
Comment: | Reformat some code in http_ssl.c |
Timelines: | ancestors | descendants | both | ssl |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- bgcolor=#c0ffc0 inherited from [bd2fa6aa2b]
- branch=ssl inherited from [bd2fa6aa2b]
- sym-ssl inherited from [bd2fa6aa2b]
Changes
[hide diffs]Modified src/http_ssl.c from [77d02aa7e4] to [9abcae4fb5].
@@ -135,11 +135,11 @@ /* Get certificate for current server from global config and * (if we have it in config) add it to certificate store. */ cert = ssl_get_certificate(); - if ( cert != NULL ){ + if ( cert!=NULL ){ X509_STORE_add_cert(SSL_CTX_get_cert_store(sslCtx), cert); X509_free(cert); hasSavedCertificate = 1; } @@ -170,11 +170,11 @@ return 1; } /* Check if certificate is valid */ cert = SSL_get_peer_certificate(ssl); - if ( cert == NULL ){ + if ( cert==NULL ){ ssl_set_errmsg("No SSL certificate was presented by the peer"); ssl_close(); return 1; } @@ -199,11 +199,11 @@ BIO_free(mem); Blob ans; blob_zero(&ans); prompt_user(prompt, &ans); - free( prompt ); + free(prompt); if( blob_str(&ans)[0]!='y' && blob_str(&ans)[0]!='a' ) { X509_free(cert); ssl_set_errmsg("SSL certificate declined"); ssl_close(); return 1; @@ -217,12 +217,11 @@ } /* ** Save certificate to global config. */ -void ssl_save_certificate(X509 *cert) -{ +void ssl_save_certificate(X509 *cert){ BIO *mem; char *zCert, *zHost; mem = BIO_new(BIO_s_mem()); PEM_write_bio_X509(mem, cert); @@ -236,12 +235,11 @@ /* ** Get certificate for g.urlName from global config. ** Return NULL if no certificate found. */ -X509 *ssl_get_certificate() -{ +X509 *ssl_get_certificate(void){ char *zHost, *zCert; BIO *mem; X509 *cert; zHost = mprintf("cert:%s", g.urlName);