X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fssli_openssl.c;h=bcd4d9e7897ea24005d76c6034de801772b9bc38;hb=8beca0ff3a7fad94d2e3a6134919dbb10bcb3b03;hp=65a21deab05b09296e4f6cc1b03e701a234c4259;hpb=ae418f7371164782194a73d2daa6873cd62f8440;p=umurmur.git diff --git a/src/ssli_openssl.c b/src/ssli_openssl.c index 65a21de..bcd4d9e 100644 --- a/src/ssli_openssl.c +++ b/src/ssli_openssl.c @@ -33,6 +33,7 @@ #include "conf.h" #include "log.h" +#include "memory.h" #include "ssl.h" /* @@ -158,7 +159,7 @@ static void SSL_initializeCert() { char *key = (char *)getStrConf(KEY); if (context) { - bool did_load_cert = SSL_CTX_use_certificate_chain_file(context, crt); + bool_t did_load_cert = SSL_CTX_use_certificate_chain_file(context, crt); rsa = SSL_readprivatekey(key); if (!rsa || !did_load_cert) { @@ -250,9 +251,7 @@ void SSLi_init(void) Log_debug("%s", SSL_CIPHER_get_name(cipher)); cipherstringlen += strlen(SSL_CIPHER_get_name(cipher)) + 1; } - cipherstring = malloc(cipherstringlen + 1); - if (cipherstring == NULL) - Log_fatal("Out of memory"); + cipherstring = Memory_safeMalloc(1, cipherstringlen + 1); for (i = 0; (cipher = sk_SSL_CIPHER_value(cipherlist_new, i)) != NULL; i++) { offset += sprintf(cipherstring + offset, "%s:", SSL_CIPHER_get_name(cipher)); } @@ -328,10 +327,7 @@ bool_t SSLi_getSHA1Hash(SSL_handle_t *ssl, uint8_t *hash) } len = i2d_X509(x509, NULL); - buf = malloc(len); - if (buf == NULL) { - Log_fatal("malloc"); - } + buf = Memory_safeMalloc(1, len); p = buf; i2d_X509(x509, &p);