]> git.ipfire.org Git - thirdparty/openssl.git/commit
apps: ca,req,x509: Add explicit start and end dates options
authorStephan Wurm <atomisirsi@gsklan.de>
Wed, 9 Aug 2023 07:07:46 +0000 (09:07 +0200)
committerTomas Mraz <tomas@openssl.org>
Tue, 9 Apr 2024 18:13:31 +0000 (20:13 +0200)
commit8120223773d4c707dd43d9cc42a7fcab19609813
treed6ba640c8b11135d9c6f214a507bbcbad744804f
parent4514e02cdfc96589d5e8ab0a08942fafa8e418ae
apps: ca,req,x509: Add explicit start and end dates options

- Added options `-not_before` (start date) and `-not-after` (end date)
  for explicit setting of the validity period of a certificate in the
  apps `ca`, `req` and `x509`
- The new options accept time strings or "today"
- In app `ca`, use the new options as aliases of the already existing
  options `-startdate` and `-enddate`
- When used in apps `req` and `x509`, the end date must be >= the start
  date, in app `ca` end date < start date is also accepted
- In any case, `-not-after` overrides the `-days` option
- Added helper function `check_cert_time_string` to validate given
  certificate time strings
- Use the new helper function in apps `ca`, `req` and `x509`
- Moved redundant code for time string checking into `set_cert_times`
  helper function.
- Added tests for explicit start and end dates in apps `req` and `x509`
- test: Added auxiliary functions for parsing fields from `-text`
  formatted output to `tconversion.pl`
- CHANGES: Added to new section 3.4

Signed-off-by: Stephan Wurm <atomisirsi@gsklan.de>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21716)
12 files changed:
CHANGES.md
apps/ca.c
apps/include/apps.h
apps/lib/apps.c
apps/req.c
apps/x509.c
doc/man1/openssl-ca.pod.in
doc/man1/openssl-req.pod.in
doc/man1/openssl-x509.pod.in
test/recipes/25-test_req.t
test/recipes/25-test_x509.t
test/recipes/tconversion.pl