Skip to content

[WIP] Remove OPENSSL_ia32cap overrides in various test scripts - #11933

Closed
bernd-edlinger wants to merge 2 commits into
openssl:masterfrom
bernd-edlinger:remove_ia32cap_overrides
Closed

bernd-edlinger wants to merge 2 commits into
openssl:masterfrom
bernd-edlinger:remove_ia32cap_overrides

Conversation

@bernd-edlinger

Copy link
Copy Markdown
Member

The removed override was: OPENSSL_ia32cap=~0x200000200000000
which disables AESNI codepaths and PCLMULQDQ (useful for ghash).
It is unclear why this was done, but it probably just hides bugs.

[extended tests]

It is unclear to me why some test cases are failing due to the AESNI bit.
@mattcaswell any ideas?

@bernd-edlinger bernd-edlinger added the branch: master Applies to master branch label May 24, 2020
@kroeckx

kroeckx commented May 24, 2020 via email

Copy link
Copy Markdown
Member

@bernd-edlinger

Copy link
Copy Markdown
Member Author

Tests are fixed by clearing the AESNI enable bit:

$ OPENSSL_ia32cap=~0x200000000000000 make test TESTS=70
make depend && make _tests
( SRCTOP=. \
	  BLDTOP=. \
	  PERL="/usr/bin/perl" \
	  EXE_EXT= \
	  /usr/bin/perl ./test/run_tests.pl 70 )
70-test_asyncio.t ......... ok   
70-test_bad_dtls.t ........ ok   
70-test_clienthello.t ..... ok   
70-test_comp.t ............ ok   
70-test_key_share.t ....... ok    
70-test_packet.t .......... ok   
70-test_recordlen.t ....... ok   
70-test_renegotiation.t ... ok   
70-test_servername.t ...... ok   
70-test_sslcbcpadding.t ... ok   
70-test_sslcertstatus.t ... ok   
70-test_sslextension.t .... ok   
70-test_sslmessages.t ..... ok    
70-test_sslrecords.t ...... ok    
70-test_sslsessiontick.t .. ok    
70-test_sslsigalgs.t ...... ok    
70-test_sslsignature.t .... ok   
70-test_sslskewith0p.t .... ok   
70-test_sslversions.t ..... ok   
70-test_sslvertol.t ....... ok   
70-test_tls13alerts.t ..... ok   
70-test_tls13cookie.t ..... ok   
70-test_tls13downgrade.t .. ok   
70-test_tls13hrr.t ........ ok   
70-test_tls13kexmodes.t ... ok    
70-test_tls13messages.t ... ok    
70-test_tls13psk.t ........ ok   
70-test_tlsextms.t ........ ok    
70-test_verify_extra.t .... ok   
70-test_wpacket.t ......... ok   
All tests successful.
Files=30, Tests=198, 35 wallclock secs ( 2.98 usr  0.09 sys + 25.28 cusr  8.14 csys = 36.49 CPU)
Result: PASS

But tests are not fixed by clearing the PCLMULQDQ so aes-128-gcm is probably not the reason:

$ OPENSSL_ia32cap=~0x200000000 make test TESTS=70
make depend && make _tests
( SRCTOP=. \
	  BLDTOP=. \
	  PERL="/usr/bin/perl" \
	  EXE_EXT= \
	  /usr/bin/perl ./test/run_tests.pl 70 )
70-test_asyncio.t ......... ok   
70-test_bad_dtls.t ........ ok   
70-test_clienthello.t ..... ok   
70-test_comp.t ............ ok   
70-test_key_share.t ....... ok    
70-test_packet.t .......... ok   
70-test_recordlen.t ....... ok   
70-test_renegotiation.t ... ok   
70-test_servername.t ...... ok   
70-test_sslcbcpadding.t ... Dubious, test returned 5 (wstat 1280, 0x500)
Failed 5/5 subtests 
70-test_sslcertstatus.t ... ok   
70-test_sslextension.t .... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/8 subtests 
70-test_sslmessages.t ..... ok    
70-test_sslrecords.t ...... Dubious, test returned 1 (wstat 256, 0x100)
Failed 16/20 subtests 
70-test_sslsessiontick.t .. ok    
70-test_sslsigalgs.t ...... ok    
70-test_sslsignature.t .... ok   
70-test_sslskewith0p.t .... ok   
70-test_sslversions.t ..... ok   
70-test_sslvertol.t ....... ok   
70-test_tls13alerts.t ..... ok   
70-test_tls13cookie.t ..... ok   
70-test_tls13downgrade.t .. ok   
70-test_tls13hrr.t ........ ok   
70-test_tls13kexmodes.t ... ok    
70-test_tls13messages.t ... ok    
70-test_tls13psk.t ........ ok   
70-test_tlsextms.t ........ ok    
70-test_verify_extra.t .... ok   
70-test_wpacket.t ......... ok   

Test Summary Report
-------------------
70-test_sslcbcpadding.t (Wstat: 1280 Tests: 5 Failed: 5)
  Failed tests:  1-5
  Non-zero exit status: 5
70-test_sslextension.t  (Wstat: 256 Tests: 8 Failed: 1)
  Failed test:  3
  Non-zero exit status: 1
70-test_sslrecords.t    (Wstat: 256 Tests: 4 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 20 tests but ran 4.
Files=30, Tests=182, 35 wallclock secs ( 2.71 usr  0.14 sys + 24.64 cusr  8.04 csys = 35.53 CPU)
Result: FAIL
make[1]: *** [_tests] Error 1

@kroeckx

kroeckx commented May 24, 2020 via email

Copy link
Copy Markdown
Member

@bernd-edlinger

Copy link
Copy Markdown
Member Author

Now doesn't that put the engine design into question, I mean isn't the
engine supposed to override the available assembler modules?

@bernd-edlinger

Copy link
Copy Markdown
Member Author

see for instance e_padlock which implements its own aes ciphers

@kroeckx

kroeckx commented May 24, 2020 via email

Copy link
Copy Markdown
Member

@bernd-edlinger

Copy link
Copy Markdown
Member Author

This uninitialzed value is also unexepected. Looks like a script error?

Record 2 (server -> client)
  Content type: ALERT
  Version: TLS1.2
  Length: 48
Use of uninitialized value $alertlev in concatenation (.) or string at C:\projects\openssl\util\perl/TLSProxy/Message.pm line 280, <> line 3.
Use of uninitialized value $alertdesc in concatenation (.) or string at C:\projects\openssl\util\perl/TLSProxy/Message.pm line 280, <> line 3.
  [, ]
Use of uninitialized value $alertlev in numeric eq (==) at C:\projects\openssl\util\perl/TLSProxy/Message.pm line 288, <> line 3.
Use of uninitialized value $alertdesc in numeric eq (==) at C:\projects\openssl\util\perl/TLSProxy/Message.pm line 288, <> line 3.

@kroeckx

kroeckx commented May 24, 2020 via email

Copy link
Copy Markdown
Member

@bernd-edlinger

Copy link
Copy Markdown
Member Author

@levitte any idea why c7e599172082fbe7f0412472b12ffe9e26a9451a
works in the 1.1.1 branch but NOT in master?

The removed override was: OPENSSL_ia32cap=~0x200000200000000
which disables AESNI codepaths and PCLMULQDQ (useful for ghash).
It is unclear why this was done, but it probably just hides bugs.

[extended tests]
This cipher is not helpful at all here and made the test cases fail
when AESNI is enabled.

[extended tests]
@bernd-edlinger
bernd-edlinger force-pushed the remove_ia32cap_overrides branch from c7e5991 to fc1f6a9 Compare September 27, 2021 19:20
@t8m t8m added the triaged: refactor The issue/pr requests/implements refactoring label Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch: master Applies to master branch triaged: refactor The issue/pr requests/implements refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants