A local copy of OpenSSL from GitHub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.9 KiB

  1. /*
  2. * Copyright 2005-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. /* Internal ASN1 structures and functions: not for application use */
  10. int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d);
  11. int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d);
  12. /* ASN1 scan context structure */
  13. struct asn1_sctx_st {
  14. /* The ASN1_ITEM associated with this field */
  15. const ASN1_ITEM *it;
  16. /* If ASN1_TEMPLATE associated with this field */
  17. const ASN1_TEMPLATE *tt;
  18. /* Various flags associated with field and context */
  19. unsigned long flags;
  20. /* If SEQUENCE OF or SET OF, field index */
  21. int skidx;
  22. /* ASN1 depth of field */
  23. int depth;
  24. /* Structure and field name */
  25. const char *sname, *fname;
  26. /* If a primitive type the type of underlying field */
  27. int prim_type;
  28. /* The field value itself */
  29. ASN1_VALUE **field;
  30. /* Callback to pass information to */
  31. int (*scan_cb) (ASN1_SCTX *ctx);
  32. /* Context specific application data */
  33. void *app_data;
  34. } /* ASN1_SCTX */ ;
  35. typedef struct mime_param_st MIME_PARAM;
  36. DEFINE_STACK_OF(MIME_PARAM)
  37. typedef struct mime_header_st MIME_HEADER;
  38. DEFINE_STACK_OF(MIME_HEADER)
  39. /* Month values for printing out times */
  40. extern const char *_asn1_mon[12];
  41. int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it);
  42. int asn1_set_choice_selector(ASN1_VALUE **pval, int value,
  43. const ASN1_ITEM *it);
  44. ASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
  45. const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,
  46. int nullerr);
  47. int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it);
  48. void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it);
  49. void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
  50. int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval,
  51. const ASN1_ITEM *it);
  52. int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen,
  53. const ASN1_ITEM *it);
  54. void asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
  55. void asn1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
  56. ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
  57. long length);
  58. int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp);
  59. ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
  60. const unsigned char **pp, long length);
  61. int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp);
  62. ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,
  63. long length);