Diff
Not logged in

Differences From:

File src/http_ssl.c part of check-in [16f6fd904a] - Add SSL support. by dmitry on 2009-11-09 15:32:32. [view]

To:

File src/http_ssl.c part of check-in [d92945e5da] - Reformat some code in http_ssl.c by dmitry on 2009-11-09 21:22:32. [view]

@@ -136,9 +136,9 @@
   /* 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;
   }
@@ -171,9 +171,9 @@
   }
   /* 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;
   }
@@ -200,9 +200,9 @@
 
     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();
@@ -218,10 +218,9 @@
 
 /*
 ** 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());
@@ -237,10 +236,9 @@
 /*
 ** 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;