Closed mouse07410 closed 4 years ago
The rsa test failure seems to be an openssl regression. @levitte, could you please take a look?
I agree that test needs to be reworked to not hang, But the primary cause is a bug in openssl. AFAIK, this one https://github.com/openssl/openssl/issues/11549
The https://github.com/openssl/openssl/issues/11549 issue is closed. The problem persists, here at least.
Also, see the failures of test_engine
with OpenSSL-3.0.
Maybe it's because the fix is not committed into OpenSSL_1_1_1-stable
which we run Travis tests against. Or you tried on the master
?
Ah you said OpenSSL-3.0 master excuse my unattentiveness.
I will try to rework test_tls
to(night|day). Thanks,
Reworked test_tls
in PR #231 so it does not hang. What is remaining is to fix that error:
00:57:50:60:01:7F:00:00:error:SSL routines:ssl_set_cert:unknown certificate type:ssl/ssl_rsa.c:343:
/home/abz/src/gost-engine/test_tls.c:76: OpenSSL internal error: SSL_CTX_use_certificate(ctx, cert)
What is remaining is to fix that error...
Regarding test_tls.c
- probably.
But there are problems in test_engine.c
(or 00-engine.t
) related to the half-done name conversion.
I must add that I don't know how @beldmit is planning to have both the old name (which appears required for OpenSSL-1.1.1) and the new one (which he seems to want for OpenSSL-3.0), and on top of that - take care of it in one test.
Well, my plans are rather simple - I hope to commit the support of new GOST CMS soon and bump the minimal openssl for master.
@beldmit do you mean you'll break compatibility with OpenSSL-1.1.1?
I do. There is no way to continue support compatibility with 1.1.1 in master and add new features. New CTRL values, new NIDs, new flags — all this stuff is required.
Ah... So you'll create a '1.1.1' branch? Do you plan any 1.1.1-related changes?
There is 1.1.0 branch. It implements all the practically required functionality compatible with 1.1.0/1.1.1 - both in algorithm and protocol parts.
The new GOST standards that appeared after the 1.1.1 branch has bin stabilized are not worth supporting in the engine without any support in OpenSSL itself. I've provided support of some of these standards in the OpenSSL and in process of providing for others.
Why not keep as much compatibility with some #if
/#ifdef
s? (Like some other projects do.) Or there is so much incompatibility that this is not feasible?
Why not keep as much compatibility with some
#if
/#ifdef
s? (Like some other projects do.) Or there is so much incompatibility that this is not feasible?
There is so much incompatibility and will be even more after fixing up nits.
OK. On the current master:
There is 1.1.0 branch. It implements all the practically required functionality compatible with 1.1.0/1.1.1 - both in algorithm and protocol parts.
@beldmit there are three 1.1.0 branches:
remotes/origin/openssl_1_1_0
remotes/origin/openssl_1_1_0_release2
Which of those should be used?
openssl_1_1_0
OK, tests fail on OpenSSL-1.1.1 with the branch openssl_1_1_0
, and on OpenSSL-3.0 with the branch master
:
openssl_1_1_0
branchossl111-build.txt test-out.txt test-long-out.txt
master
branchOpenSSL-3.0 with master should be fixed now.
@mouse07410 Could you please make a separate issue for 1.1.1?
OpenSSL-3.0 with master should be fixed now.
Not quite:
cmake-3-out.txt
make-3-out.txt
test-3-out.txt test-3-long-out.txt
Could you please make a separate issue for 1.1.1?
Sure.
Please make sure that gost_grasshopper_cipher.c is updated.
Please make sure that
gost_grasshopper_cipher.c
is updated.
$ git fetch --all
Fetching origin
Fetching upstream
$ git pull
Already up to date.
$ git merge upstream/master
Already up to date.
$
and
90% tests passed, 1 tests failed out of 10
Total Test time (real) = 2.29 sec
The following tests FAILED:
7 - grasshopper (Child aborted)
Errors while running CTest
make: *** [test] Error 8
in the long output:
7: Decryption test from GOST R 34.13-2015 [ctr-no-acpkm] in-place
7: d[64] = 1122334455667700ffeeddccbbaa9988 00112233445566778899aabbcceeff0a 112233445566778899aabbcceeff0a00 2233445566778899aabbcceeff0a0011
7: Test passed
7: Stream encryption test from GOST R 34.13-2015 [ctr-no-acpkm]
7/10 Test #7: grasshopper ......................Child aborted***Exception: 0.01 sec
Well. Please update it again, rebuild and run bin/test_grasshopper separately. Sorry, the bug is not reproduced both on my machine and on the Travis one.
Updated. On one machine it consistently fails:
. . . . .
Decryption test from GOST R 34.13-2015 [ctr-no-acpkm] in-place
d[64] = 1122334455667700ffeeddccbbaa9988 00112233445566778899aabbcceeff0a 112233445566778899aabbcceeff0a00 2233445566778899aabbcceeff0a0011
Test passed
Stream encryption test from GOST R 34.13-2015 [ctr-no-acpkm]
/Users/ur20980/src/grasshopper-engine/test_grasshopper.c:312: OpenSSL internal error: EVP_CipherUpdate(ctx, c + i, &outlen, pt + i, sz)
Abort trap: 6
And the system-provided crash report for this run/abort:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
abort() called
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff67eda33a __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff67f96e60 pthread_kill + 430
2 libsystem_c.dylib 0x00007fff67e61808 abort + 120
3 libcrypto.3.dylib 0x000000010b122e3a OPENSSL_die + 26
4 test_grasshopper 0x000000010aa0cdf9 test_stream + 697 (test_grasshopper.c:313)
5 test_grasshopper 0x000000010aa0c0b4 main + 308 (test_grasshopper.c:392)
6 libdyld.dylib 0x00007fff67d92cc9 start + 1
Since this is just abort
in OPENSSL_die
and not real crash what is important is just reference to test_grasshopper.c:312
, which means that EVP_CipherUpdate
return 0
. It's unfortunate there is no further error message.
I'm afraid that the only option I can suggest is trying to debug. Before that try to rebuild the engine from scratch and be sure that the test uses the freshly-built engine.
This diagnostic means that the EVP_CipherUpdate
call has failed, the test causes abort() in this case. When this bug appeared on my Linux machine, I fixed the gost_grasshopper_cipher_do_ctracpkm
function. If the problem still occurs, it's possible that there is a bug I did not find.
@mouse07410 Cannot reproduce it either. What is os/cpu of the target box?
MacOS 10.15.4, Xcode-11.4.1.
$ sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz
$ botan cpuid
CPUID flags: sse2 ssse3 sse41 sse42 avx2 rdtsc bmi1 bmi2 adx aes_ni clmul rdrand rdseed
Also, check these: https://github.com/mouse07410/engine/runs/643962113
F***ing nice. Rebuilt the current master with added -g
, and voila - it passes the tests. :-(
Since the current master passes all the tests with the current OpenSSL-3.0 (master dev), I guess this issue can (reluctantly ;) be closed.
Though it would be nice to figure why without -g
it troubles some systems.
@beldmit my Travis CI keeps failing the master branch - perhaps you can take a look?
https://travis-ci.com/github/mouse07410/engine/builds/163806097 shows all the failing jobs of the last build, and this https://travis-ci.com/github/mouse07410/engine/jobs/327787180 is probably the most relevant as it builds against the OpenSSL master.
TCL regression tests show some regression because of reworking to providers. I hope to fix some SSL-related regression though
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
:And you probably want to see this:
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: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:
Here are the output of
make test
andmake test ARGV='-V'
correspondingly: test-3-out.txt test-3-long-out.txt