Always check return from tls_export_cert()
[exim.git] / src / src / tlscert-openssl.c
index 0aa65c8861cf3dbee82a676d50c7443f7febffb7..845c3014f0e856a6a7cec4a8b4d48b983857ec96 100644 (file)
@@ -34,11 +34,11 @@ library. It is #included into the tls.c file when that library is used.
 /*****************************************************
 *  Export/import a certificate, binary/printable
 *****************************************************/
-int
+BOOL
 tls_export_cert(uschar * buf, size_t buflen, void * cert)
 {
 BIO * bp = BIO_new(BIO_s_mem());
-int fail;
+BOOL fail;
 
 if ((fail = PEM_write_bio_X509(bp, (X509 *)cert) ? 0 : 1))
   log_write(0, LOG_MAIN, "TLS error in certificate export: %s",
@@ -59,7 +59,7 @@ else
   }
 
 BIO_free(bp);
-return fail;
+return !fail;
 }
 
 int