Bug #93789 auth_sec.openssl_cert_validity fails on certain days due to leap years

Submitted: 3 Jan 2019 1:43 Modified: 4 Jan 2019 9:39
Reporter: Manuel Ung Email Updates:
Status: Duplicate Impact on me:
None 
Category:Tests: Server Severity:S7 (Test Cases)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any

[3 Jan 2019 1:43] Manuel Ung
Description:
Run auth_sec.openssl_cert_validity on Jan 1 of any year (eg. Jan 1, 2019)

Because of the calculation here: https://github.com/mysql/mysql-server/blob/e4924f36486f971f8a04252e01c803457a2c72f7/sql/au...

It will naively assume that every year contains 365 days, when in fact some years will contain 366. This means that the end validity date will actually be 9 years away sometimes, failing the test. If you run the test on Jan 1, 2019, the end validity date will be Dec 30, 2028, and 2028 - 2019 = 9, not 10.

How to repeat:
Run auth_sec.openssl_cert_validity on Jan 1 of any year.

Suggested fix:
Either fix the create_x509_certificate function to calculate "10 years" correctly, or modify the test to accept dates that are 3650 days away.
[3 Jan 2019 7:47] MySQL Verification Team
Bug #93794 marked as duplicate of this one
[3 Jan 2019 7:48] MySQL Verification Team
Hello Manuel,

Thank you for the report and feedback.

regards,
Umesh
[4 Jan 2019 9:39] Steinar Gunderson
Fixed as #93799.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.058 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.