1111 *
1212 *
1313 * IDENTIFICATION
14- * $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.89 2009/01/01 17:23:42 momjian Exp $
14+ * $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.90 2009/01/28 15:06:47 mha Exp $
1515 *
1616 * Since the server static private key ($DataDir/server.key)
1717 * will normally be stored unencrypted so that the database
@@ -729,9 +729,9 @@ initialize_SSL(void)
729729/*
730730 * Load and verify certificate and private key
731731 */
732- if (! SSL_CTX_use_certificate_file (SSL_context ,
732+ if (SSL_CTX_use_certificate_file (SSL_context ,
733733SERVER_CERT_FILE ,
734- SSL_FILETYPE_PEM ))
734+ SSL_FILETYPE_PEM )!= 1 )
735735ereport (FATAL ,
736736(errcode (ERRCODE_CONFIG_FILE_ERROR ),
737737errmsg ("could not load server certificate file \"%s\": %s" ,
@@ -760,14 +760,14 @@ initialize_SSL(void)
760760errdetail ("Permissions should be u=rw (0600) or less." )));
761761#endif
762762
763- if (! SSL_CTX_use_PrivateKey_file (SSL_context ,
763+ if (SSL_CTX_use_PrivateKey_file (SSL_context ,
764764SERVER_PRIVATE_KEY_FILE ,
765- SSL_FILETYPE_PEM ))
765+ SSL_FILETYPE_PEM )!= 1 )
766766ereport (FATAL ,
767767(errmsg ("could not load private key file \"%s\": %s" ,
768768SERVER_PRIVATE_KEY_FILE ,SSLerrmessage ())));
769769
770- if (! SSL_CTX_check_private_key (SSL_context ))
770+ if (SSL_CTX_check_private_key (SSL_context )!= 1 )
771771ereport (FATAL ,
772772(errmsg ("check of private key failed: %s" ,
773773SSLerrmessage ())));
@@ -800,7 +800,7 @@ initialize_SSL(void)
800800ROOT_CERT_FILE )));
801801}
802802}
803- else if (! SSL_CTX_load_verify_locations (SSL_context ,ROOT_CERT_FILE ,NULL ))
803+ else if (SSL_CTX_load_verify_locations (SSL_context ,ROOT_CERT_FILE ,NULL )!= 1 )
804804{
805805/*
806806 * File was there, but we could not load it. This means the file is somehow
@@ -823,7 +823,7 @@ initialize_SSL(void)
823823if (cvstore )
824824{
825825/* Set the flags to check against the complete CRL chain */
826- if (X509_STORE_load_locations (cvstore ,ROOT_CRL_FILE ,NULL )!= 0 )
826+ if (X509_STORE_load_locations (cvstore ,ROOT_CRL_FILE ,NULL )== 1 )
827827/* OpenSSL 0.96 does not support X509_V_FLAG_CRL_CHECK */
828828#ifdef X509_V_FLAG_CRL_CHECK
829829X509_STORE_set_flags (cvstore ,