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:
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
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] Umesh Shastry
Bug #93794 marked as duplicate of this one
[3 Jan 2019 7:48] Umesh Shastry
Hello Manuel,

Thank you for the report and feedback.

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