mbedtls
mbedtls copied to clipboard
Document the requirements on mbedtls_time_t
The documentation of mbedtls_time_t
just says “The time_t datatype” and doesn't say what assumptions Mbed TLS makes on this type. It should state the assumptions. At least:
-
mbedtls_time_t
is a signed arithmetic type (supporting addition, subtraction and comparison). -
mbedtls_time_t
is the number of seconds since an unspecified epoch.
These assumptions are based on current usage in ssl_tickets.c
. There may be more assumptions based on usage elsewhere.
There's an added subtlety about requirements that modules can have different requirements, e.g. an application that only uses TLS with PSK wouldn't care about how X509 uses mbedtls_time_t in relation with certificate validity, and conversely an application that uses X509 but not TLS wouldn't care about the ssl_tickets module. Something to keep in mind about making explicit requirements: they might exclude applications that work now because those applications don't use the parts of the library that have those requirements.