Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

69 rindas
1.9 KiB

  1. /*
  2. * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include <openssl/x509v3.h>
  10. #include <openssl/asn1.h>
  11. #include <openssl/bio.h>
  12. #include <openssl/nid.h>
  13. /*
  14. * OCSP extensions and a couple of CRL entry extensions
  15. */
  16. static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *nonce,
  17. BIO *out, int indent);
  18. static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method,
  19. void *nocheck, BIO *out, int indent);
  20. static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method,
  21. X509V3_CTX *ctx, const char *str);
  22. const X509V3_EXT_METHOD v3_crl_invdate = {
  23. NID_invalidity_date, 0, ASN1_ITEM_ref(ASN1_GENERALIZEDTIME),
  24. 0, 0, 0, 0,
  25. 0, 0,
  26. 0, 0,
  27. i2r_ocsp_acutoff, 0,
  28. NULL
  29. };
  30. const X509V3_EXT_METHOD v3_ocsp_nocheck = {
  31. NID_id_pkix_OCSP_noCheck, 0, ASN1_ITEM_ref(ASN1_NULL),
  32. 0, 0, 0, 0,
  33. 0, s2i_ocsp_nocheck,
  34. 0, 0,
  35. i2r_ocsp_nocheck, 0,
  36. NULL
  37. };
  38. static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *cutoff,
  39. BIO *bp, int ind)
  40. {
  41. if (BIO_printf(bp, "%*s", ind, "") <= 0)
  42. return 0;
  43. if (!ASN1_GENERALIZEDTIME_print(bp, cutoff))
  44. return 0;
  45. return 1;
  46. }
  47. /* Nocheck is just a single NULL. Don't print anything and always set it */
  48. static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, void *nocheck,
  49. BIO *out, int indent)
  50. {
  51. return 1;
  52. }
  53. static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method,
  54. X509V3_CTX *ctx, const char *str)
  55. {
  56. return ASN1_NULL_new();
  57. }