#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
+#include <string.h> /* for memcpy() and strcmp() */
#define USE_SOCKETS
#include "apps.h"
#undef USE_SOCKETS
static int ssl_excert_prepend(SSL_EXCERT **pexc)
{
- SSL_EXCERT *exc = app_malloc(sizeof *exc, "prepend cert");
+ SSL_EXCERT *exc = app_malloc(sizeof(*exc), "prepend cert");
exc->certfile = NULL;
exc->keyfile = NULL;
void ssl_excert_free(SSL_EXCERT *exc)
{
SSL_EXCERT *curr;
+
+ if (!exc)
+ return;
while (exc) {
X509_free(exc->cert);
EVP_PKEY_free(exc->key);
err:
ERR_print_errors(bio_err);
- if (exc)
- ssl_excert_free(exc);
+ ssl_excert_free(exc);
*pexc = NULL;
return 0;
}
const char *flag = sk_OPENSSL_STRING_value(str, i);
const char *arg = sk_OPENSSL_STRING_value(str, i + 1);
/* If no_ecdhe or named curve already specified don't need a default. */
- if (!no_ecdhe && !strcmp(flag, "-named_curve"))
+ if (!no_ecdhe && strcmp(flag, "-named_curve") == 0)
no_ecdhe = 1;
#ifndef OPENSSL_NO_JPAKE
- if (!no_jpake && !strcmp(flag, "-cipher")) {
+ if (!no_jpake && (strcmp(flag, "-cipher") == 0)) {
BIO_puts(bio_err, "JPAKE sets cipher to PSK\n");
return 0;
}