Description of the Problem:
The atcacert_date_enc_compcert() function returns ATCACERT_E_INVALID_DATE when the certificate issue year is 2032 or greater, or when certificate Expire Years is 32 or greater. This was tested with CAL library version 3.7.9, which supposedly supports compressed certs having Issue Date years up to 2127 and Expire years up to 127.
The problem occurs because the atcacert_date_enc_compcert_ext() function expects the comp_cert[70] byte to have the appropriate value already set for its 4-bit format_version bits, but those bits are always 0 due to atcacert_date_enc_compcert() passing it a fully-cleared comp_cert[] -- this implies FORMAT_VERSION_0 for the compressed certificate. With this bug, the CAL library does not yet support cert issue dates beyond 2031 or expire years beyond 31.
Steps to reproduce the behavior:
- Invoke the
atcacert_date_enc_compcert() function passing a valid issue_date with its tm_year struct member set to 132 (for the year 2032).
- Observe that the return value from
atcacert_date_enc_compcert() is ATCACERT_E_INVALID_DATE.
Expected behavior:
The return value from atcacert_date_enc_compcert() is ATCACERT_E_SUCCESS.
Description of the Problem:
The
atcacert_date_enc_compcert()function returnsATCACERT_E_INVALID_DATEwhen the certificate issue year is 2032 or greater, or when certificate Expire Years is 32 or greater. This was tested with CAL library version 3.7.9, which supposedly supports compressed certs having Issue Date years up to 2127 and Expire years up to 127.The problem occurs because the
atcacert_date_enc_compcert_ext()function expects thecomp_cert[70]byte to have the appropriate value already set for its 4-bitformat_versionbits, but those bits are always 0 due to atcacert_date_enc_compcert() passing it a fully-cleared comp_cert[] -- this impliesFORMAT_VERSION_0for the compressed certificate. With this bug, the CAL library does not yet support cert issue dates beyond 2031 or expire years beyond 31.Steps to reproduce the behavior:
atcacert_date_enc_compcert()function passing a valid issue_date with itstm_yearstruct member set to 132 (for the year 2032).atcacert_date_enc_compcert()isATCACERT_E_INVALID_DATE.Expected behavior:
The return value from
atcacert_date_enc_compcert()isATCACERT_E_SUCCESS.