SCT_validate.pod 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. =pod
  2. =head1 NAME
  3. SCT_validate, SCT_LIST_validate, SCT_get_validation_status -
  4. checks Signed Certificate Timestamps (SCTs) are valid
  5. =head1 SYNOPSIS
  6. #include <openssl/ct.h>
  7. typedef enum {
  8. SCT_VALIDATION_STATUS_NOT_SET,
  9. SCT_VALIDATION_STATUS_UNKNOWN_LOG,
  10. SCT_VALIDATION_STATUS_VALID,
  11. SCT_VALIDATION_STATUS_INVALID,
  12. SCT_VALIDATION_STATUS_UNVERIFIED,
  13. SCT_VALIDATION_STATUS_UNKNOWN_VERSION
  14. } sct_validation_status_t;
  15. int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx);
  16. int SCT_LIST_validate(const STACK_OF(SCT) *scts, CT_POLICY_EVAL_CTX *ctx);
  17. sct_validation_status_t SCT_get_validation_status(const SCT *sct);
  18. =head1 DESCRIPTION
  19. SCT_validate() will check that an SCT is valid and verify its signature.
  20. SCT_LIST_validate() performs the same checks on an entire stack of SCTs.
  21. The result of the validation checks can be obtained by passing the SCT to
  22. SCT_get_validation_status().
  23. A CT_POLICY_EVAL_CTX must be provided that specifies:
  24. =over 2
  25. =item *
  26. The certificate the SCT was issued for.
  27. Failure to provide the certificate will result in the validation status being
  28. SCT_VALIDATION_STATUS_UNVERIFIED.
  29. =item *
  30. The issuer of that certificate.
  31. This is only required if the SCT was issued for a pre-certificate
  32. (see RFC 6962). If it is required but not provided, the validation status will
  33. be SCT_VALIDATION_STATUS_UNVERIFIED.
  34. =item *
  35. A CTLOG_STORE that contains the CT log that issued this SCT.
  36. If the SCT was issued by a log that is not in this CTLOG_STORE, the validation
  37. status will be SCT_VALIDATION_STATUS_UNKNOWN_LOG.
  38. =back
  39. If the SCT is of an unsupported version (only v1 is currently supported), the
  40. validation status will be SCT_VALIDATION_STATUS_UNKNOWN_VERSION.
  41. If the SCT's signature is incorrect, its timestamp is in the future (relative to
  42. the time in CT_POLICY_EVAL_CTX), or if it is otherwise invalid, the validation
  43. status will be SCT_VALIDATION_STATUS_INVALID.
  44. If all checks pass, the validation status will be SCT_VALIDATION_STATUS_VALID.
  45. =head1 NOTES
  46. A return value of 0 from SCT_LIST_validate() should not be interpreted as a
  47. failure. At a minimum, only one valid SCT may provide sufficient confidence
  48. that a certificate has been publicly logged.
  49. =head1 RETURN VALUES
  50. SCT_validate() returns a negative integer if an internal error occurs, 0 if the
  51. SCT fails validation, or 1 if the SCT passes validation.
  52. SCT_LIST_validate() returns a negative integer if an internal error occurs, 0
  53. if any of SCTs fails validation, or 1 if they all pass validation.
  54. SCT_get_validation_status() returns the validation status of the SCT.
  55. If SCT_validate() or SCT_LIST_validate() have not been passed that SCT, the
  56. returned value will be SCT_VALIDATION_STATUS_NOT_SET.
  57. =head1 SEE ALSO
  58. L<ct(7)>
  59. =head1 HISTORY
  60. These functions were added in OpenSSL 1.1.0.
  61. =head1 COPYRIGHT
  62. Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
  63. Licensed under the Apache License 2.0 (the "License"). You may not use
  64. this file except in compliance with the License. You can obtain a copy
  65. in the file LICENSE in the source distribution or at
  66. L<https://www.openssl.org/source/license.html>.
  67. =cut