Skip to content

Compressed certificate encoding fails when (issue_date->tm_year > 131) or (expire_years > 31) #416

@davidk408

Description

@davidk408

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:

  1. 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).
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions