libtasn1.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. /*
  2. * Copyright (C) 2002-2022 Free Software Foundation, Inc.
  3. *
  4. * This file is part of LIBTASN1.
  5. *
  6. * LIBTASN1 is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU Lesser General Public License as
  8. * published by the Free Software Foundation; either version 2.1 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * LIBTASN1 is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with LIBTASN1; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301, USA
  20. *
  21. */
  22. /**
  23. * SECTION:libtasn1
  24. * @short_description: GNU ASN.1 library
  25. *
  26. * The Libtasn1 library provides Abstract Syntax Notation One (ASN.1, as
  27. * specified by the X.680 ITU-T recommendation) parsing and structures
  28. * management, and Distinguished Encoding Rules (DER, as per X.690)
  29. * encoding and decoding functions.
  30. */
  31. #ifndef LIBTASN1_H
  32. # define LIBTASN1_H
  33. # ifndef ASN1_API
  34. # if defined ASN1_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY
  35. # define ASN1_API __attribute__((__visibility__("default")))
  36. # elif defined ASN1_BUILDING && defined _MSC_VER && ! defined ASN1_STATIC
  37. # define ASN1_API __declspec(dllexport)
  38. # elif defined _MSC_VER && ! defined ASN1_STATIC
  39. # define ASN1_API __declspec(dllimport)
  40. # else
  41. # define ASN1_API
  42. # endif
  43. # endif
  44. # ifdef __GNUC__
  45. # define __LIBTASN1_CONST__ __attribute__((const))
  46. # define __LIBTASN1_PURE__ __attribute__((pure))
  47. # else
  48. # define __LIBTASN1_CONST__
  49. # define __LIBTASN1_PURE__
  50. # endif
  51. # include <sys/types.h>
  52. # include <time.h>
  53. # include <stdio.h> /* for FILE* */
  54. # ifdef __cplusplus
  55. extern "C"
  56. {
  57. # endif
  58. /**
  59. * ASN1_VERSION:
  60. *
  61. * Version of the library as a string.
  62. */
  63. # define ASN1_VERSION "4.19.0"
  64. /**
  65. * ASN1_VERSION_MAJOR:
  66. *
  67. * Major version number of the library.
  68. */
  69. # define ASN1_VERSION_MAJOR 4
  70. /**
  71. * ASN1_VERSION_MINOR:
  72. *
  73. * Minor version number of the library.
  74. */
  75. # define ASN1_VERSION_MINOR 19
  76. /**
  77. * ASN1_VERSION_PATCH:
  78. *
  79. * Patch version number of the library.
  80. */
  81. # define ASN1_VERSION_PATCH 0
  82. /**
  83. * ASN1_VERSION_NUMBER:
  84. *
  85. * Version number of the library as a number.
  86. */
  87. # define ASN1_VERSION_NUMBER 0x041300
  88. # if defined __GNUC__ && !defined ASN1_INTERNAL_BUILD
  89. # define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
  90. # if _ASN1_GCC_VERSION >= 30100
  91. # define _ASN1_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__))
  92. # endif
  93. # endif
  94. # ifndef _ASN1_GCC_ATTR_DEPRECATED
  95. # define _ASN1_GCC_ATTR_DEPRECATED
  96. # endif
  97. /*****************************************/
  98. /* Errors returned by libtasn1 functions */
  99. /*****************************************/
  100. # define ASN1_SUCCESS 0
  101. # define ASN1_FILE_NOT_FOUND 1
  102. # define ASN1_ELEMENT_NOT_FOUND 2
  103. # define ASN1_IDENTIFIER_NOT_FOUND 3
  104. # define ASN1_DER_ERROR 4
  105. # define ASN1_VALUE_NOT_FOUND 5
  106. # define ASN1_GENERIC_ERROR 6
  107. # define ASN1_VALUE_NOT_VALID 7
  108. # define ASN1_TAG_ERROR 8
  109. # define ASN1_TAG_IMPLICIT 9
  110. # define ASN1_ERROR_TYPE_ANY 10
  111. # define ASN1_SYNTAX_ERROR 11
  112. # define ASN1_MEM_ERROR 12
  113. # define ASN1_MEM_ALLOC_ERROR 13
  114. # define ASN1_DER_OVERFLOW 14
  115. # define ASN1_NAME_TOO_LONG 15
  116. # define ASN1_ARRAY_ERROR 16
  117. # define ASN1_ELEMENT_NOT_EMPTY 17
  118. # define ASN1_TIME_ENCODING_ERROR 18
  119. # define ASN1_RECURSION 19
  120. /*************************************/
  121. /* Constants used in asn1_visit_tree */
  122. /*************************************/
  123. # define ASN1_PRINT_NAME 1
  124. # define ASN1_PRINT_NAME_TYPE 2
  125. # define ASN1_PRINT_NAME_TYPE_VALUE 3
  126. # define ASN1_PRINT_ALL 4
  127. /*****************************************/
  128. /* Constants returned by asn1_read_tag */
  129. /*****************************************/
  130. # define ASN1_CLASS_UNIVERSAL 0x00 /* old: 1 */
  131. # define ASN1_CLASS_APPLICATION 0x40 /* old: 2 */
  132. # define ASN1_CLASS_CONTEXT_SPECIFIC 0x80 /* old: 3 */
  133. # define ASN1_CLASS_PRIVATE 0xC0 /* old: 4 */
  134. # define ASN1_CLASS_STRUCTURED 0x20
  135. /*****************************************/
  136. /* Constants returned by asn1_read_tag */
  137. /*****************************************/
  138. # define ASN1_TAG_BOOLEAN 0x01
  139. # define ASN1_TAG_INTEGER 0x02
  140. # define ASN1_TAG_SEQUENCE 0x10
  141. # define ASN1_TAG_SET 0x11
  142. # define ASN1_TAG_OCTET_STRING 0x04
  143. # define ASN1_TAG_BIT_STRING 0x03
  144. # define ASN1_TAG_UTCTime 0x17
  145. # define ASN1_TAG_GENERALIZEDTime 0x18
  146. # define ASN1_TAG_OBJECT_ID 0x06
  147. # define ASN1_TAG_ENUMERATED 0x0A
  148. # define ASN1_TAG_NULL 0x05
  149. # define ASN1_TAG_GENERALSTRING 0x1B
  150. # define ASN1_TAG_NUMERIC_STRING 0x12
  151. # define ASN1_TAG_IA5_STRING 0x16
  152. # define ASN1_TAG_TELETEX_STRING 0x14
  153. # define ASN1_TAG_PRINTABLE_STRING 0x13
  154. # define ASN1_TAG_UNIVERSAL_STRING 0x1C
  155. # define ASN1_TAG_BMP_STRING 0x1E
  156. # define ASN1_TAG_UTF8_STRING 0x0C
  157. # define ASN1_TAG_VISIBLE_STRING 0x1A
  158. /**
  159. * asn1_node:
  160. *
  161. * Structure definition used for the node of the tree
  162. * that represents an ASN.1 DEFINITION.
  163. */
  164. typedef struct asn1_node_st asn1_node_st;
  165. typedef asn1_node_st *asn1_node;
  166. typedef const asn1_node_st *asn1_node_const;
  167. /**
  168. * ASN1_MAX_NAME_SIZE:
  169. *
  170. * Maximum number of characters of a name
  171. * inside a file with ASN1 definitions.
  172. */
  173. # define ASN1_MAX_NAME_SIZE 64
  174. /**
  175. * asn1_static_node:
  176. * @name: Node name
  177. * @type: Node typ
  178. * @value: Node value
  179. *
  180. * For the on-disk format of ASN.1 trees, created by asn1_parser2array().
  181. */
  182. typedef struct asn1_static_node_st
  183. {
  184. const char *name; /* Node name */
  185. unsigned int type; /* Node type */
  186. const void *value; /* Node value */
  187. } asn1_static_node;
  188. /* List of constants for field type of asn1_static_node */
  189. # define ASN1_ETYPE_INVALID 0
  190. # define ASN1_ETYPE_CONSTANT 1
  191. # define ASN1_ETYPE_IDENTIFIER 2
  192. # define ASN1_ETYPE_INTEGER 3
  193. # define ASN1_ETYPE_BOOLEAN 4
  194. # define ASN1_ETYPE_SEQUENCE 5
  195. # define ASN1_ETYPE_BIT_STRING 6
  196. # define ASN1_ETYPE_OCTET_STRING 7
  197. # define ASN1_ETYPE_TAG 8
  198. # define ASN1_ETYPE_DEFAULT 9
  199. # define ASN1_ETYPE_SIZE 10
  200. # define ASN1_ETYPE_SEQUENCE_OF 11
  201. # define ASN1_ETYPE_OBJECT_ID 12
  202. # define ASN1_ETYPE_ANY 13
  203. # define ASN1_ETYPE_SET 14
  204. # define ASN1_ETYPE_SET_OF 15
  205. # define ASN1_ETYPE_DEFINITIONS 16
  206. # define ASN1_ETYPE_CHOICE 18
  207. # define ASN1_ETYPE_IMPORTS 19
  208. # define ASN1_ETYPE_NULL 20
  209. # define ASN1_ETYPE_ENUMERATED 21
  210. # define ASN1_ETYPE_GENERALSTRING 27
  211. # define ASN1_ETYPE_NUMERIC_STRING 28
  212. # define ASN1_ETYPE_IA5_STRING 29
  213. # define ASN1_ETYPE_TELETEX_STRING 30
  214. # define ASN1_ETYPE_PRINTABLE_STRING 31
  215. # define ASN1_ETYPE_UNIVERSAL_STRING 32
  216. # define ASN1_ETYPE_BMP_STRING 33
  217. # define ASN1_ETYPE_UTF8_STRING 34
  218. # define ASN1_ETYPE_VISIBLE_STRING 35
  219. # define ASN1_ETYPE_UTC_TIME 36
  220. # define ASN1_ETYPE_GENERALIZED_TIME 37
  221. /**
  222. * ASN1_DELETE_FLAG_ZEROIZE:
  223. *
  224. * Used by: asn1_delete_structure2()
  225. *
  226. * Zeroize values prior to deinitialization.
  227. */
  228. # define ASN1_DELETE_FLAG_ZEROIZE 1
  229. /**
  230. * ASN1_DECODE_FLAG_ALLOW_PADDING:
  231. *
  232. * Used by: asn1_der_decoding2()
  233. *
  234. * This flag would allow arbitrary data past the DER data.
  235. */
  236. # define ASN1_DECODE_FLAG_ALLOW_PADDING 1
  237. /**
  238. * ASN1_DECODE_FLAG_STRICT_DER:
  239. *
  240. * Used by: asn1_der_decoding2()
  241. *
  242. * This flag would ensure that no BER decoding takes place.
  243. */
  244. # define ASN1_DECODE_FLAG_STRICT_DER (1<<1)
  245. /**
  246. * ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME:
  247. *
  248. * Used by: asn1_der_decoding2()
  249. *
  250. * This flag will tolerate Time encoding errors when in strict DER.
  251. */
  252. # define ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME (1<<2)
  253. /* *INDENT-OFF* */
  254. /**
  255. * asn1_data_node_st:
  256. * @name: Node name
  257. * @value: Node value
  258. * @value_len: Node value size
  259. * @type: Node value type (ASN1_ETYPE_*)
  260. *
  261. * Data node inside a #asn1_node structure.
  262. */
  263. struct asn1_data_node_st
  264. {
  265. const char *name; /* Node name */
  266. const void *value; /* Node value */
  267. unsigned int value_len; /* Node value size */
  268. unsigned int type; /* Node value type (ASN1_ETYPE_*) */
  269. };
  270. /* *INDENT-ON* */
  271. typedef struct asn1_data_node_st asn1_data_node_st;
  272. /***********************************/
  273. /* Fixed constants */
  274. /***********************************/
  275. /**
  276. * ASN1_MAX_ERROR_DESCRIPTION_SIZE:
  277. *
  278. * Maximum number of characters
  279. * of a description message
  280. * (null character included).
  281. */
  282. # define ASN1_MAX_ERROR_DESCRIPTION_SIZE 128
  283. /***********************************/
  284. /* Functions definitions */
  285. /***********************************/
  286. extern ASN1_API int
  287. asn1_parser2tree (const char *file,
  288. asn1_node * definitions, char *error_desc);
  289. extern ASN1_API int
  290. asn1_parser2array (const char *inputFileName,
  291. const char *outputFileName,
  292. const char *vectorName, char *error_desc);
  293. extern ASN1_API int
  294. asn1_array2tree (const asn1_static_node * array,
  295. asn1_node * definitions, char *errorDescription);
  296. extern ASN1_API void
  297. asn1_print_structure (FILE * out, asn1_node_const structure,
  298. const char *name, int mode);
  299. extern ASN1_API int
  300. asn1_create_element (asn1_node_const definitions,
  301. const char *source_name, asn1_node * element);
  302. extern ASN1_API int asn1_delete_structure (asn1_node * structure);
  303. extern ASN1_API int asn1_delete_structure2 (asn1_node * structure,
  304. unsigned int flags);
  305. extern ASN1_API int
  306. asn1_delete_element (asn1_node structure, const char *element_name);
  307. extern ASN1_API int
  308. asn1_write_value (asn1_node node_root, const char *name,
  309. const void *ivalue, int len);
  310. extern ASN1_API int
  311. asn1_read_value (asn1_node_const root, const char *name,
  312. void *ivalue, int *len);
  313. extern ASN1_API int
  314. asn1_read_value_type (asn1_node_const root, const char *name,
  315. void *ivalue, int *len, unsigned int *etype);
  316. extern ASN1_API int
  317. asn1_read_node_value (asn1_node_const node, asn1_data_node_st * data);
  318. extern ASN1_API int
  319. asn1_number_of_elements (asn1_node_const element, const char *name,
  320. int *num);
  321. extern ASN1_API int
  322. asn1_der_coding (asn1_node_const element, const char *name,
  323. void *ider, int *len, char *ErrorDescription);
  324. extern ASN1_API int
  325. asn1_der_decoding2 (asn1_node * element, const void *ider,
  326. int *max_ider_len, unsigned int flags,
  327. char *errorDescription);
  328. extern ASN1_API int
  329. asn1_der_decoding (asn1_node * element, const void *ider,
  330. int ider_len, char *errorDescription);
  331. /* Do not use. Use asn1_der_decoding() instead. */
  332. extern ASN1_API int
  333. asn1_der_decoding_element (asn1_node * structure,
  334. const char *elementName,
  335. const void *ider, int len,
  336. char *errorDescription)
  337. _ASN1_GCC_ATTR_DEPRECATED;
  338. extern ASN1_API int
  339. asn1_der_decoding_startEnd (asn1_node element,
  340. const void *ider, int ider_len,
  341. const char *name_element,
  342. int *start, int *end);
  343. extern ASN1_API int
  344. asn1_expand_any_defined_by (asn1_node_const definitions,
  345. asn1_node * element);
  346. extern ASN1_API int
  347. asn1_expand_octet_string (asn1_node_const definitions,
  348. asn1_node * element,
  349. const char *octetName, const char *objectName);
  350. extern ASN1_API int
  351. asn1_read_tag (asn1_node_const root, const char *name,
  352. int *tagValue, int *classValue);
  353. extern ASN1_API const char *asn1_find_structure_from_oid (asn1_node_const
  354. definitions,
  355. const char
  356. *oidValue);
  357. __LIBTASN1_PURE__
  358. extern ASN1_API const char *asn1_check_version (const char *req_version);
  359. __LIBTASN1_PURE__ extern ASN1_API const char *asn1_strerror (int error);
  360. extern ASN1_API void asn1_perror (int error);
  361. # define ASN1_MAX_TAG_SIZE 4
  362. # define ASN1_MAX_LENGTH_SIZE 9
  363. # define ASN1_MAX_TL_SIZE (ASN1_MAX_TAG_SIZE+ASN1_MAX_LENGTH_SIZE)
  364. extern ASN1_API long
  365. asn1_get_length_der (const unsigned char *der, int der_len, int *len);
  366. extern ASN1_API long
  367. asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len);
  368. extern ASN1_API void
  369. asn1_length_der (unsigned long int len, unsigned char *der, int *der_len);
  370. /* Other utility functions. */
  371. extern ASN1_API
  372. int asn1_decode_simple_der (unsigned int etype, const unsigned char *der,
  373. unsigned int _der_len,
  374. const unsigned char **str,
  375. unsigned int *str_len);
  376. extern ASN1_API
  377. int asn1_decode_simple_ber (unsigned int etype, const unsigned char *der,
  378. unsigned int _der_len,
  379. unsigned char **str,
  380. unsigned int *str_len, unsigned int *ber_len);
  381. extern ASN1_API int
  382. asn1_encode_simple_der (unsigned int etype, const unsigned char *str,
  383. unsigned int str_len, unsigned char *tl,
  384. unsigned int *tl_len);
  385. extern ASN1_API asn1_node
  386. asn1_find_node (asn1_node_const pointer, const char *name);
  387. extern ASN1_API int
  388. asn1_copy_node (asn1_node dst, const char *dst_name,
  389. asn1_node_const src, const char *src_name);
  390. extern ASN1_API asn1_node
  391. asn1_dup_node (asn1_node_const src, const char *src_name);
  392. /* Internal and low-level DER utility functions. */
  393. extern ASN1_API int
  394. asn1_get_tag_der (const unsigned char *der, int der_len,
  395. unsigned char *cls, int *len, unsigned long *tag);
  396. extern ASN1_API void
  397. asn1_octet_der (const unsigned char *str, int str_len,
  398. unsigned char *der, int *der_len);
  399. extern ASN1_API int
  400. asn1_get_octet_der (const unsigned char *der, int der_len,
  401. int *ret_len, unsigned char *str,
  402. int str_size, int *str_len);
  403. extern ASN1_API void asn1_bit_der (const unsigned char *str, int bit_len,
  404. unsigned char *der, int *der_len);
  405. extern ASN1_API int
  406. asn1_get_bit_der (const unsigned char *der, int der_len,
  407. int *ret_len, unsigned char *str,
  408. int str_size, int *bit_len);
  409. extern ASN1_API int
  410. asn1_get_object_id_der (const unsigned char *der,
  411. int der_len, int *ret_len,
  412. char *str, int str_size);
  413. extern ASN1_API int
  414. asn1_object_id_der (const char *str, unsigned char *der, int *der_len,
  415. unsigned flags);
  416. /* Compatibility types */
  417. /**
  418. * asn1_retCode:
  419. *
  420. * Type formerly returned by libtasn1 functions.
  421. *
  422. * Deprecated: 3.0: Use int instead.
  423. */
  424. typedef int asn1_retCode _ASN1_GCC_ATTR_DEPRECATED;
  425. /**
  426. * node_asn_struct:
  427. *
  428. * Compat #define.
  429. *
  430. * Deprecated: 3.0: Use #asn1_node instead.
  431. */
  432. # ifndef ASN1_DISABLE_DEPRECATED
  433. # if _ASN1_GCC_VERSION >= 30100
  434. # define node_asn_struct _Pragma ("GCC warning \"'node_asn_struct' macro is deprecated, use 'asn1_node' instead.\"") asn1_node_st
  435. # else
  436. # define node_asn_struct asn1_node_st
  437. # endif
  438. # endif /* !ASN1_DISABLE_DEPRECATED */
  439. /**
  440. * node_asn:
  441. *
  442. * Compat #define.
  443. *
  444. * Deprecated: 3.0: Use #asn1_node instead.
  445. */
  446. # ifndef ASN1_DISABLE_DEPRECATED
  447. # if _ASN1_GCC_VERSION >= 30100
  448. # define node_asn _Pragma ("GCC warning \"'node_asn' macro is deprecated, use 'asn1_node' instead.\"") asn1_node_st
  449. # else
  450. # define node_asn asn1_node_st
  451. # endif
  452. # endif /* !ASN1_DISABLE_DEPRECATED */
  453. /**
  454. * ASN1_TYPE:
  455. *
  456. * Compat #define.
  457. *
  458. * Deprecated: 3.0: Use #asn1_node instead.
  459. */
  460. # ifndef ASN1_DISABLE_DEPRECATED
  461. # if _ASN1_GCC_VERSION >= 30100
  462. # define ASN1_TYPE _Pragma ("GCC warning \"'ASN1_TYPE' macro is deprecated, use 'asn1_node' instead.\"") asn1_node
  463. # else
  464. # define ASN1_TYPE asn1_node
  465. # endif
  466. # endif /* !ASN1_DISABLE_DEPRECATED */
  467. /**
  468. * ASN1_TYPE_EMPTY:
  469. *
  470. * Compat #define.
  471. *
  472. * Deprecated: 3.0: Use NULL instead.
  473. */
  474. # ifndef ASN1_DISABLE_DEPRECATED
  475. # if _ASN1_GCC_VERSION >= 30100
  476. # define ASN1_TYPE_EMPTY _Pragma ("GCC warning \"'ASN1_TYPE_EMPTY' macro is deprecated, use 'NULL' instead.\"") NULL
  477. # else
  478. # define ASN1_TYPE_EMPTY NULL
  479. # endif
  480. # endif /* !ASN1_DISABLE_DEPRECATED */
  481. /**
  482. * static_struct_asn:
  483. *
  484. * Compat #define.
  485. *
  486. * Deprecated: 3.0: Use #asn1_static_node instead.
  487. */
  488. # ifndef ASN1_DISABLE_DEPRECATED
  489. # if _ASN1_GCC_VERSION >= 30100
  490. # define static_struct_asn _Pragma ("GCC warning \"'static_struct_asn' macro is deprecated, use 'asn1_static_node_st' instead.\"") asn1_static_node_st
  491. # else
  492. # define static_struct_asn asn1_static_node_st
  493. # endif
  494. # endif /* !ASN1_DISABLE_DEPRECATED */
  495. /**
  496. * ASN1_ARRAY_TYPE:
  497. *
  498. * Compat #define.
  499. *
  500. * Deprecated: 3.0: Use #asn1_static_node instead.
  501. */
  502. # ifndef ASN1_DISABLE_DEPRECATED
  503. # if _ASN1_GCC_VERSION >= 30100
  504. # define ASN1_ARRAY_TYPE _Pragma ("GCC warning \"'ASN1_ARRAY_TYPE' macro is deprecated, use 'asn1_static_node' instead.\"") asn1_static_node
  505. # else
  506. # define ASN1_ARRAY_TYPE asn1_static_node
  507. # endif
  508. # endif /* !ASN1_DISABLE_DEPRECATED */
  509. /**
  510. * asn1_static_node_t:
  511. *
  512. * Compat #define.
  513. *
  514. * Deprecated: 3.0: Use #asn1_static_node instead.
  515. */
  516. # ifndef ASN1_DISABLE_DEPRECATED
  517. # if _ASN1_GCC_VERSION >= 30100
  518. # define asn1_static_node_t _Pragma ("GCC warning \"'asn1_static_node_t' macro is deprecated, use 'asn1_static_node' instead.\"") asn1_static_node
  519. # else
  520. # define asn1_static_node_t asn1_static_node
  521. # endif
  522. # endif /* !ASN1_DISABLE_DEPRECATED */
  523. /**
  524. * node_data_struct:
  525. *
  526. * Compat #define.
  527. *
  528. * Deprecated: 3.0: Use #asn1_data_node_st instead.
  529. */
  530. # ifndef ASN1_DISABLE_DEPRECATED
  531. # if _ASN1_GCC_VERSION >= 30100
  532. # define node_data_struct _Pragma ("GCC warning \"'node_data_struct' macro is deprecated, use 'asn1_data_node_st' instead.\"") asn1_data_node_st
  533. # else
  534. # define node_data_struct asn1_data_node_st
  535. # endif
  536. # endif /* !ASN1_DISABLE_DEPRECATED */
  537. /**
  538. * ASN1_DATA_NODE:
  539. *
  540. * Compat #define.
  541. *
  542. * Deprecated: 3.0: Use #asn1_data_node_st instead.
  543. */
  544. # ifndef ASN1_DISABLE_DEPRECATED
  545. # if _ASN1_GCC_VERSION >= 30100
  546. # define ASN1_DATA_NODE _Pragma ("GCC warning \"'asn1_static_node_t' macro is deprecated, use 'asn1_static_node' instead.\"") asn1_data_node_st
  547. # else
  548. # define ASN1_DATA_NODE asn1_data_node_st
  549. # endif
  550. # endif /* !ASN1_DISABLE_DEPRECATED */
  551. # ifdef __cplusplus
  552. }
  553. # endif
  554. #endif /* LIBTASN1_H */