Fossil SCM

Fix indentation and formatting in http_ssl.c. Limit line length to 80 characters per the coding style spec.

drh 2011-10-10 12:55 trunk
Commit 5eb8f0157a1bbee630f713d1b8894d26435ee9a5
1 file changed +14 -6
+14 -6
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -97,10 +97,11 @@
9797
** Call this routine once before any other use of the SSL interface.
9898
** This routine does initial configuration of the SSL module.
9999
*/
100100
void ssl_global_init(void){
101101
const char *zCaSetting = 0, *zCaFile = 0, *zCaDirectory = 0;
102
+ const char *identityFile;
102103
103104
if( sslIsInit==0 ){
104105
SSL_library_init();
105106
SSL_load_error_strings();
106107
ERR_load_BIO_strings();
@@ -135,19 +136,26 @@
135136
fossil_fatal("Failed to use CA root certificates from "
136137
"ssl-ca-location '%s'", zCaSetting);
137138
}
138139
}
139140
140
- /* Load client SSL identity, preferring the filename specified on the command line */
141
- const char *identityFile = ( g.zSSLIdentity!= 0) ? g.zSSLIdentity : db_get("ssl-identity", 0);
141
+ /* Load client SSL identity, preferring the filename specified on the
142
+ ** command line */
143
+ if( g.zSSLIdentity!=0 ){
144
+ identityFile = g.zSSLIdentity;
145
+ }else{
146
+ identityFile = db_get("ssl-identity", 0);
147
+ }
142148
if( identityFile!=0 && identityFile[0]!='\0' ){
143
- if( SSL_CTX_use_certificate_file(sslCtx, identityFile, SSL_FILETYPE_PEM)!= 1
144
- || SSL_CTX_use_PrivateKey_file(sslCtx, identityFile, SSL_FILETYPE_PEM)!=1 ){
149
+ if( SSL_CTX_use_certificate_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1
150
+ || SSL_CTX_use_PrivateKey_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1
151
+ ){
145152
fossil_fatal("Could not load SSL identity from %s", identityFile);
146153
}
147154
}
148
- /* Register a callback to tell the user what to do when the server asks for a cert */
155
+ /* Register a callback to tell the user what to do when the server asks
156
+ ** for a cert */
149157
SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback);
150158
151159
sslIsInit = 1;
152160
}
153161
}
@@ -185,11 +193,11 @@
185193
*/
186194
int ssl_open(void){
187195
X509 *cert;
188196
int hasSavedCertificate = 0;
189197
int trusted = 0;
190
-char *connStr ;
198
+ char *connStr ;
191199
ssl_global_init();
192200
193201
/* Get certificate for current server from global config and
194202
* (if we have it in config) add it to certificate store.
195203
*/
196204
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -97,10 +97,11 @@
97 ** Call this routine once before any other use of the SSL interface.
98 ** This routine does initial configuration of the SSL module.
99 */
100 void ssl_global_init(void){
101 const char *zCaSetting = 0, *zCaFile = 0, *zCaDirectory = 0;
 
102
103 if( sslIsInit==0 ){
104 SSL_library_init();
105 SSL_load_error_strings();
106 ERR_load_BIO_strings();
@@ -135,19 +136,26 @@
135 fossil_fatal("Failed to use CA root certificates from "
136 "ssl-ca-location '%s'", zCaSetting);
137 }
138 }
139
140 /* Load client SSL identity, preferring the filename specified on the command line */
141 const char *identityFile = ( g.zSSLIdentity!= 0) ? g.zSSLIdentity : db_get("ssl-identity", 0);
 
 
 
 
 
142 if( identityFile!=0 && identityFile[0]!='\0' ){
143 if( SSL_CTX_use_certificate_file(sslCtx, identityFile, SSL_FILETYPE_PEM)!= 1
144 || SSL_CTX_use_PrivateKey_file(sslCtx, identityFile, SSL_FILETYPE_PEM)!=1 ){
 
145 fossil_fatal("Could not load SSL identity from %s", identityFile);
146 }
147 }
148 /* Register a callback to tell the user what to do when the server asks for a cert */
 
149 SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback);
150
151 sslIsInit = 1;
152 }
153 }
@@ -185,11 +193,11 @@
185 */
186 int ssl_open(void){
187 X509 *cert;
188 int hasSavedCertificate = 0;
189 int trusted = 0;
190 char *connStr ;
191 ssl_global_init();
192
193 /* Get certificate for current server from global config and
194 * (if we have it in config) add it to certificate store.
195 */
196
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -97,10 +97,11 @@
97 ** Call this routine once before any other use of the SSL interface.
98 ** This routine does initial configuration of the SSL module.
99 */
100 void ssl_global_init(void){
101 const char *zCaSetting = 0, *zCaFile = 0, *zCaDirectory = 0;
102 const char *identityFile;
103
104 if( sslIsInit==0 ){
105 SSL_library_init();
106 SSL_load_error_strings();
107 ERR_load_BIO_strings();
@@ -135,19 +136,26 @@
136 fossil_fatal("Failed to use CA root certificates from "
137 "ssl-ca-location '%s'", zCaSetting);
138 }
139 }
140
141 /* Load client SSL identity, preferring the filename specified on the
142 ** command line */
143 if( g.zSSLIdentity!=0 ){
144 identityFile = g.zSSLIdentity;
145 }else{
146 identityFile = db_get("ssl-identity", 0);
147 }
148 if( identityFile!=0 && identityFile[0]!='\0' ){
149 if( SSL_CTX_use_certificate_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1
150 || SSL_CTX_use_PrivateKey_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1
151 ){
152 fossil_fatal("Could not load SSL identity from %s", identityFile);
153 }
154 }
155 /* Register a callback to tell the user what to do when the server asks
156 ** for a cert */
157 SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback);
158
159 sslIsInit = 1;
160 }
161 }
@@ -185,11 +193,11 @@
193 */
194 int ssl_open(void){
195 X509 *cert;
196 int hasSavedCertificate = 0;
197 int trusted = 0;
198 char *connStr ;
199 ssl_global_init();
200
201 /* Get certificate for current server from global config and
202 * (if we have it in config) add it to certificate store.
203 */
204

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button