Use uint32_t and int32_t for SSL_CIPHER structure.
[openssl.git] / test / ecdhtest.c
index 5c451e52be34cf99c9228df4e109f5caee0545f8..0145b36c7db97ac32eacb264dce28123551c2bf5 100644 (file)
@@ -278,18 +278,12 @@ static int test_ecdh_curve(int nid, const char *text, BN_CTX *ctx, BIO *out)
  err:
     ERR_print_errors_fp(stderr);
 
-    if (abuf != NULL)
-        OPENSSL_free(abuf);
-    if (bbuf != NULL)
-        OPENSSL_free(bbuf);
-    if (x_a)
-        BN_free(x_a);
-    if (y_a)
-        BN_free(y_a);
-    if (x_b)
-        BN_free(x_b);
-    if (y_b)
-        BN_free(y_b);
+    OPENSSL_free(abuf);
+    OPENSSL_free(bbuf);
+    BN_free(x_a);
+    BN_free(y_a);
+    BN_free(x_b);
+    BN_free(y_b);
     EC_KEY_free(b);
     EC_KEY_free(a);
     return (ret);
@@ -390,8 +384,7 @@ static EC_KEY *mk_eckey(int nid, const unsigned char *p, size_t plen)
         goto err;
     ok = 1;
  err:
-    if (priv)
-        BN_clear_free(priv);
+    BN_clear_free(priv);
     EC_POINT_free(pub);
     if (ok)
         return k;
@@ -438,8 +431,7 @@ static int ecdh_kat(BIO *out, const char *cname, int nid,
  err:
     EC_KEY_free(key1);
     EC_KEY_free(key2);
-    if (Ztmp)
-        OPENSSL_free(Ztmp);
+    OPENSSL_free(Ztmp);
     if (rv)
         BIO_puts(out, " ok\n");
     else {
@@ -474,7 +466,7 @@ int main(int argc, char *argv[])
     out = BIO_new(BIO_s_file());
     if (out == NULL)
         EXIT(1);
-    BIO_set_fp(out, stdout, BIO_NOCLOSE);
+    BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
 
     if ((ctx = BN_CTX_new()) == NULL)
         goto err;
@@ -526,8 +518,7 @@ int main(int argc, char *argv[])
 
  err:
     ERR_print_errors_fp(stderr);
-    if (ctx)
-        BN_CTX_free(ctx);
+    BN_CTX_free(ctx);
     BIO_free(out);
     CRYPTO_cleanup_all_ex_data();
     ERR_remove_thread_state(NULL);