Fix a possible crash in BN_from_montgomery_word
[openssl.git] / test / tls13secretstest.c
index daccd7c360b10f460760c562d04df7d885d3762e..8b775b8047b6a46d1055b9a1e4b9c7be3e50228c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the OpenSSL license (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -207,6 +207,21 @@ const EVP_MD *ssl_md(int idx)
     return EVP_sha256();
 }
 
+void ossl_statem_fatal(SSL *s, int al, int func, int reason, const char *file,
+                           int line)
+{
+}
+
+int ossl_statem_export_allowed(SSL *s)
+{
+    return 1;
+}
+
+int ossl_statem_export_early_allowed(SSL *s)
+{
+    return 1;
+}
+
 /* End of mocked out code */
 
 static int test_secret(SSL *s, unsigned char *prk,
@@ -226,8 +241,8 @@ static int test_secret(SSL *s, unsigned char *prk,
         return 0;
     }
 
-    if (!tls13_hkdf_expand(s, md, prk, label, labellen, hash, gensecret,
-                           hashsize)) {
+    if (!tls13_hkdf_expand(s, md, prk, label, labellen, hash, hashsize,
+                           gensecret, hashsize)) {
         TEST_error("Secret generation failed");
         return 0;
     }
@@ -289,7 +304,7 @@ static int test_handshake_secrets(void)
 
     if (!TEST_true(tls13_generate_handshake_secret(s, ecdhe_secret,
                                                    sizeof(ecdhe_secret)))) {
-        TEST_info("Hanshake secret generation failed");
+        TEST_info("Handshake secret generation failed");
         goto err;
     }
 
@@ -384,7 +399,8 @@ static int test_handshake_secrets(void)
     return ret;
 }
 
-void register_tests()
+int setup_tests()
 {
     ADD_TEST(test_handshake_secrets);
+    return 1;
 }