2
0

ossl_cmp_statusinfo_new.pod 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. =pod
  2. =head1 NAME
  3. ossl_cmp_statusinfo_new,
  4. ossl_cmp_pkisi_pkistatus_get,
  5. ossl_cmp_pkisi_pkifailureinfo_get,
  6. ossl_cmp_pkisi_pkifailureinfo_check,
  7. ossl_cmp_pkisi_failinfo_get0,
  8. ossl_cmp_pkisi_statusstring_get0,
  9. ossl_pkisi_snprint
  10. - functions for managing PKI status information
  11. =head1 SYNOPSIS
  12. #include "cmp.h"
  13. # define OSSL_CMP_PKIFAILUREINFO_badAlg 0
  14. # define OSSL_CMP_PKIFAILUREINFO_badMessageCheck 1
  15. # define OSSL_CMP_PKIFAILUREINFO_badRequest 2
  16. # define OSSL_CMP_PKIFAILUREINFO_badTime 3
  17. # define OSSL_CMP_PKIFAILUREINFO_badCertId 4
  18. # define OSSL_CMP_PKIFAILUREINFO_badDataFormat 5
  19. # define OSSL_CMP_PKIFAILUREINFO_wrongAuthority 6
  20. # define OSSL_CMP_PKIFAILUREINFO_incorrectData 7
  21. # define OSSL_CMP_PKIFAILUREINFO_missingTimeStamp 8
  22. # define OSSL_CMP_PKIFAILUREINFO_badPOP 9
  23. # define OSSL_CMP_PKIFAILUREINFO_certRevoked 10
  24. # define OSSL_CMP_PKIFAILUREINFO_certConfirmed 11
  25. # define OSSL_CMP_PKIFAILUREINFO_wrongIntegrity 12
  26. # define OSSL_CMP_PKIFAILUREINFO_badRecipientNonce 13
  27. # define OSSL_CMP_PKIFAILUREINFO_timeNotAvailable 14
  28. # define OSSL_CMP_PKIFAILUREINFO_unacceptedPolicy 15
  29. # define OSSL_CMP_PKIFAILUREINFO_unacceptedExtension 16
  30. # define OSSL_CMP_PKIFAILUREINFO_addInfoNotAvailable 17
  31. # define OSSL_CMP_PKIFAILUREINFO_badSenderNonce 18
  32. # define OSSL_CMP_PKIFAILUREINFO_badCertTemplate 19
  33. # define OSSL_CMP_PKIFAILUREINFO_signerNotTrusted 20
  34. # define OSSL_CMP_PKIFAILUREINFO_transactionIdInUse 21
  35. # define OSSL_CMP_PKIFAILUREINFO_unsupportedVersion 22
  36. # define OSSL_CMP_PKIFAILUREINFO_notAuthorized 23
  37. # define OSSL_CMP_PKIFAILUREINFO_systemUnavail 24
  38. # define OSSL_CMP_PKIFAILUREINFO_systemFailure 25
  39. # define OSSL_CMP_PKIFAILUREINFO_duplicateCertReq 26
  40. # define OSSL_CMP_PKIFAILUREINFO_MAX 26
  41. OSSL_CMP_PKISI *ossl_cmp_statusinfo_new(int status, int fail_info,
  42. const char *text);
  43. int ossl_cmp_pkisi_pkistatus_get(OSSL_CMP_PKISI *si);
  44. int ossl_cmp_pkisi_pkifailureinfo_get(OSSL_CMP_PKISI *si);
  45. int ossl_cmp_pkisi_pkifailureinfo_check(OSSL_CMP_PKISI *si, int bit_index);
  46. OSSL_CMP_PKIFAILUREINFO *ossl_cmp_pkisi_failinfo_get0(const OSSL_CMP_PKISI *si);
  47. OSSL_CMP_PKIFREETEXT *ossl_cmp_pkisi_statusstring_get0(const OSSL_CMP_PKISI *si);
  48. char *ossl_pkisi_snprint(OSSL_CMP_PKISI *si, char *buf, int bufsize);
  49. =head1 DESCRIPTION
  50. ossl_cmp_statusinfo_new() creates a new PKIStatusInfo structure and fills it
  51. with the given values. It sets the status field to B<status>.
  52. If B<text> is not NULL, it is copied to statusString.
  53. B<fail_info> is is interpreted as bit pattern for the failInfo field.
  54. Returns a pointer to the structure on success, or NULL on error.
  55. ossl_cmp_pkisi_pkistatus_get() returns the PKIStatus of B<si>, or -1 on error.
  56. ossl_cmp_pkisi_pkifailureinfo_get() returns the PKIFailureInfo bits
  57. of B<si>, encoded as integer, or -1 on error.
  58. ossl_cmp_pkisi_pkifailureinfo_check() returns the state of the bit (0 or 1)
  59. with index B<bit_index> in the PKIFailureInfo of the B<si>, or -1 on error.
  60. ossl_cmp_pkisi_failinfo_get0() returns a direct pointer to the failInfo
  61. field contained in B<si>, or NULL on error.
  62. ossl_cmp_pkisi_statusstring_get0() returns a direct pointer to the statusString
  63. field contained in B<si>.
  64. ossl_pkisi_snprint() places at max B<bufsize> characters of human-readable
  65. error string of B<si> in pre-allocated B<buf>. Returns pointer to the same
  66. B<buf> containing the string, or NULL on error.
  67. =head1 NOTES
  68. CMP is defined in RFC 4210 (and CRMF in RFC 4211).
  69. =head1 RETURN VALUES
  70. See the individual functions above.
  71. =head1 SEE ALSO
  72. L<OSSL_CMP_CTX_new(3)>, L<ossl_cmp_certReq_new(3)>
  73. =head1 HISTORY
  74. The OpenSSL CMP support was added in OpenSSL 3.0.
  75. =head1 COPYRIGHT
  76. Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
  77. Licensed under the Apache License 2.0 (the "License"). You may not use
  78. this file except in compliance with the License. You can obtain a copy
  79. in the file LICENSE in the source distribution or at
  80. L<https://www.openssl.org/source/license.html>.
  81. =cut