Fix compile failure
[openssl.git] / test / dhtest.c
index 621fcba506cee5f3bbebae6e719dcb4c7e54f26e..896af851ce234cfae6bbd118573c1bc3b22af12a 100644 (file)
@@ -107,7 +107,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);
 
     _cb = BN_GENCB_new();
     if (!_cb)
@@ -485,7 +485,7 @@ static const rfc5114_td rfctd[] = {
 static int run_rfc5114_tests(void)
 {
     int i;
-    for (i = 0; i < (int)(sizeof(rfctd) / sizeof(rfc5114_td)); i++) {
+    for (i = 0; i < (int)OSSL_NELEM(rfctd); i++) {
         DH *dhA, *dhB;
         unsigned char *Z1 = NULL, *Z2 = NULL;
         const rfc5114_td *td = rfctd + i;
@@ -515,9 +515,9 @@ static int run_rfc5114_tests(void)
          * Work out shared secrets using both sides and compare with expected
          * values.
          */
-        if (!DH_compute_key(Z1, dhB->pub_key, dhA))
+        if (DH_compute_key(Z1, dhB->pub_key, dhA) == -1)
             goto bad_err;
-        if (!DH_compute_key(Z2, dhA->pub_key, dhB))
+        if (DH_compute_key(Z2, dhA->pub_key, dhB) == -1)
             goto bad_err;
 
         if (memcmp(Z1, td->Z, td->Z_len))