engine: test_tls hangs and test_engine fails with OpenSSL-3.0 master

MacOS 10.15.4, Xcode-10.15.4, current master of OpenSSL, current master of this engine.

Build succeeds. All tests for OpenSSL-1.1.1 pass, test_tls takes less than 4 seconds.

Tests for OpenSSL-3.0 hang on the test_tls:

Running tests...
/opt/local/bin/ctest --force-new-ctest-process 
Test project /Users/ur20980/src/grasshopper-engine/build
      Start  1: digest
 1/10 Test  #1: digest ...........................   Passed    0.53 sec
      Start  2: curves
 2/10 Test  #2: curves ...........................   Passed    0.18 sec
      Start  3: parameters
 3/10 Test  #3: parameters .......................   Passed    0.20 sec
      Start  4: sign/verify
 4/10 Test  #4: sign/verify ......................   Passed    0.22 sec
      Start  5: TLS

And you probably want to see this:

test 5
      Start  5: TLS

5: Test command: /Users/ur20980/src/grasshopper-engine/build/bin/test_tls
5: Test timeout computed to be: 10000000
5: C0:1D:85:0C:01:00:00:00:error:SSL routines:ssl_set_cert:unknown certificate type:ssl/ssl_rsa.c:343:
5: /Users/ur20980/src/grasshopper-engine/test_tls.c:76: OpenSSL internal error: SSL_CTX_use_certificate(ctx, cert)
5: Test rsa

Also, please feel free to guide me how to try other tests (6-10).

Update

First, it seems that the majority of the other tests are OK.

It appears that the reason for the test_tls to fail is this strange line, and commenting it out is a workaround:

diff --git a/test_tls.c b/test_tls.c
index d137602..2d369c3 100644
--- a/test_tls.c
+++ b/test_tls.c
@@ -303,7 +303,7 @@ int main(int argc, char **argv)
     T(ENGINE_init(eng));
     T(ENGINE_set_default(eng, ENGINE_METHOD_ALL));
 
-    ret |= test("rsa", NULL);
+    //ret |= test("rsa", NULL);
     ret |= test("gost2012_256", "A");
     ret |= test("gost2012_256", "B");
     ret |= test("gost2012_256", "C");

It appears that the (unnecessary in my humble opinion) name conversion from “Grasshopper” to “Kuznyechik” (amazing spelling, BTW) was incomplete, causing the engine test to fail:

10: # Failed test 'load engine without any config'
10: # at 00-engine.t line 51.
10: # +---------------------------------+----+---------------------------------+
10: # | GOT                             | OP | CHECK                           |
10: # +---------------------------------+----+---------------------------------+
10: # | (gost) Reference implementation | eq | (gost) Reference implementation |
10: # |  of GOST engine\n               |    |  of GOST engine\n               |
10: # |  [gost89, gost89-cnt, gost89-cn |    |  [gost89, gost89-cnt, gost89-cn |
10: # | t-12, gost89-cbc, kuznyechik-ec |    | t-12, gost89-cbc, grasshopper-e |
10: # | b, kuznyechik-cbc, kuznyechik-c |    | cb, grasshopper-cbc, grasshoppe |
10: # | fb, kuznyechik-ofb, kuznyechik- |    | r-cfb, grasshopper-ofb, grassho |
10: # | ctr, magma-cbc, magma-ctr, kuzn |    | pper-ctr, magma-cbc, magma-ctr, |
10: # | yechik-ctr-acpkm, md_gost94, go |    |  id-tc26-cipher-gostr3412-2015- |
10: # | st-mac, md_gost12_256, md_gost1 |    | kuznyechik-ctracpkm, md_gost94, |
10: # | 2_512, gost-mac-12, magma-mac,  |    |  gost-mac, md_gost12_256, md_go |
10: # | kuznyechik-mac, kuznyechik-ctr- |    | st12_512, gost-mac-12, magma-ma |
10: # | acpkm-omac, gost2001, gost-mac, |    | c, grasshopper-mac, id-tc26-cip |
10: # |  gost2012_256, gost2012_512, go |    | her-gostr3412-2015-kuznyechik-c |
10: # | st-mac-12, magma-mac, kuznyechi |    | tracpkm-omac, gost2001, gost-ma |
10: # | k-mac, magma-ctr-acpkm-omac, ku |    | c, gost2012_256, gost2012_512,  |
10: # | znyechik-ctr-acpkm-omac]\n      |    | gost-mac-12, magma-mac, grassho |
10: # |                                 |    | pper-mac, id-tc26-cipher-gostr3 |
10: # |                                 |    | 412-2015-magma-ctracpkm-omac, i |
10: # |                                 |    | d-tc26-cipher-gostr3412-2015-ku |
10: # |                                 |    | znyechik-ctracpkm-omac]\n       |
10: # +---------------------------------+----+---------------------------------+
10: 
10: # Failed test 'load engine with config'
10: # at 00-engine.t line 74.
10: # +---------------------------------+----+---------------------------------+
10: # | GOT                             | OP | CHECK                           |
10: # +---------------------------------+----+---------------------------------+
10: # | (gost) Reference implementation | eq | (gost) Reference implementation |
10: # |  of GOST engine\n               |    |  of GOST engine\n               |
10: # |  [gost89, gost89-cnt, gost89-cn |    |  [gost89, gost89-cnt, gost89-cn |
10: # | t-12, gost89-cbc, kuznyechik-ec |    | t-12, gost89-cbc, grasshopper-e |
10: # | b, kuznyechik-cbc, kuznyechik-c |    | cb, grasshopper-cbc, grasshoppe |
10: # | fb, kuznyechik-ofb, kuznyechik- |    | r-cfb, grasshopper-ofb, grassho |
10: # | ctr, magma-cbc, magma-ctr, kuzn |    | pper-ctr, magma-cbc, magma-ctr, |
10: # | yechik-ctr-acpkm, md_gost94, go |    |  id-tc26-cipher-gostr3412-2015- |
10: # | st-mac, md_gost12_256, md_gost1 |    | kuznyechik-ctracpkm, md_gost94, |
10: # | 2_512, gost-mac-12, magma-mac,  |    |  gost-mac, md_gost12_256, md_go |
10: # | kuznyechik-mac, kuznyechik-ctr- |    | st12_512, gost-mac-12, magma-ma |
10: # | acpkm-omac, gost2001, gost-mac, |    | c, grasshopper-mac, id-tc26-cip |
10: # |  gost2012_256, gost2012_512, go |    | her-gostr3412-2015-kuznyechik-c |
10: # | st-mac-12, magma-mac, kuznyechi |    | tracpkm-omac, gost2001, gost-ma |
10: # | k-mac, magma-ctr-acpkm-omac, ku |    | c, gost2012_256, gost2012_512,  |
10: # | znyechik-ctr-acpkm-omac]\n      |    | gost-mac-12, magma-mac, grassho |
10: # |                                 |    | pper-mac, id-tc26-cipher-gostr3 |
10: # |                                 |    | 412-2015-magma-ctracpkm-omac, i |
10: # |                                 |    | d-tc26-cipher-gostr3412-2015-ku |
10: # |                                 |    | znyechik-ctracpkm-omac]\n       |
10: # +---------------------------------+----+---------------------------------+
. . . . .
10: # DYLD_LIBRARY_PATH=/Users/ur20980/openssl-3/lib
10: # /Users/ur20980/openssl-3/bin/openssl
10: # OpenSSL 3.0.0-alpha2-dev  (Library: OpenSSL 3.0.0-alpha2-dev )
10: not ok 1 - load engine without any config
10: ok 2 - compute digest without config
10: not ok 3 - load engine with config
10: ok 4 - compute digest with config without explicit engine param
10: ok 5 - compute digest with both config and explicit engine param
10: ok 6 - display GOST2001-GOST89-GOST89 cipher
10: ok 7 - display GOST2012-GOST8912-GOST8912 cipher
10: Dubious, test returned 2 (wstat 512, 0x200)
10: Failed 2/7 subtests 
. . . . .

Here are the output of make test and make test ARGV='-V' correspondingly: test-3-out.txt test-3-long-out.txt

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 33 (33 by maintainers)

Commits related to this issue

Most upvoted comments

I will try to rework test_tls to(night|day). Thanks,