ossl_cmp_mock_srv_new.pod 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. =pod
  2. =head1 NAME
  3. ossl_cmp_mock_srv_new,
  4. ossl_cmp_mock_srv_free,
  5. ossl_cmp_mock_srv_set1_certOut,
  6. ossl_cmp_mock_srv_set1_chainOut,
  7. ossl_cmp_mock_srv_set1_caPubsOut,
  8. ossl_cmp_mock_srv_set_statusInfo,
  9. ossl_cmp_mock_srv_set_send_error,
  10. ossl_cmp_mock_srv_set_pollCount,
  11. ossl_cmp_mock_srv_set_checkAfterTime
  12. - functions used for testing with CMP mock server
  13. =head1 SYNOPSIS
  14. #include "apps/cmp_mock_srv.h"
  15. OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OSSL_LIB_CTX *libctx, const char *propq);
  16. void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx);
  17. int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert);
  18. int ossl_cmp_mock_srv_set1_chainOut(OSSL_CMP_SRV_CTX *srv_ctx,
  19. STACK_OF(X509) *chain);
  20. int ossl_cmp_mock_srv_set1_caPubsOut(OSSL_CMP_SRV_CTX *srv_ctx,
  21. STACK_OF(X509) *caPubs);
  22. int ossl_cmp_mock_srv_set_statusInfo(OSSL_CMP_SRV_CTX *srv_ctx, int status,
  23. int fail_info, const char *text);
  24. int ossl_cmp_mock_srv_set_send_error(OSSL_CMP_SRV_CTX *srv_ctx, int val);
  25. int ossl_cmp_mock_srv_set_pollCount(OSSL_CMP_SRV_CTX *srv_ctx, int count);
  26. int ossl_cmp_mock_srv_set_checkAfterTime(OSSL_CMP_SRV_CTX *srv_ctx, int sec);
  27. =head1 DESCRIPTION
  28. ossl_cmp_mock_srv_new() allocates the contexts for the CMP mock server
  29. associated with the library context I<libctx> and property query string
  30. I<propq>, both of which may be NULL to select the defaults.
  31. ossl_cmp_mock_srv_free() deallocates the contexts for the CMP mock server.
  32. OSSL_CMP_SRV_CTX_set1_certOut() sets the certificate to be returned in
  33. cp/ip/kup.
  34. OSSL_CMP_SRV_CTX_set1_chainOut() sets the certificate chain to be added to
  35. the extraCerts in a cp/ip/kup.
  36. It should to useful to validate B<certOut>.
  37. OSSL_CMP_SRV_CTX_set1_caPubsOut() sets the caPubs to be returned in an ip.
  38. OSSL_CMP_SRV_CTX_set_statusInfo() sets the status info to be returned.
  39. OSSL_CMP_SRV_CTX_set_send_error() enables enforcement of error responses.
  40. OSSL_CMP_SRV_CTX_set_pollCount() sets the number of polls before cert response.
  41. OSSL_CMP_SRV_CTX_set_checkAfterTime() sets the number of seconds
  42. the client should wait for the next poll.
  43. =head1 NOTES
  44. CMP is defined in RFC 4210 (and CRMF in RFC 4211).
  45. =head1 RETURN VALUES
  46. ossl_cmp_mock_srv() returns a B<OSSL_CMP_SRV_CTX> structure on success,
  47. NULL on error.
  48. ossl_cmp_mock_srv_free() does not return a value.
  49. All other functions return 1 on success, 0 on error.
  50. =head1 HISTORY
  51. The OpenSSL CMP support was added in OpenSSL 3.0.
  52. =head1 COPYRIGHT
  53. Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
  54. Licensed under the Apache License 2.0 (the "License"). You may not use
  55. this file except in compliance with the License. You can obtain a copy
  56. in the file LICENSE in the source distribution or at
  57. L<https://www.openssl.org/source/license.html>.
  58. =cut