Source code of Windows XP (NT5)
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.

178 lines
5.6 KiB

  1. /* Copyright (C) Boris Nikolaus, Germany, 1996-1997. All rights reserved. */
  2. /* Copyright (C) Microsoft Corporation, 1997-1998. All rights reserved. */
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <stdlib.h>
  6. #include <stdarg.h>
  7. #include <stddef.h>
  8. #include <ctype.h>
  9. #include <memory.h>
  10. #define ASN1C
  11. #include <windows.h>
  12. // resolve conflicts
  13. #ifdef GetObject
  14. #undef GetObject
  15. #endif
  16. #include "libasn1.h"
  17. #ifdef ASSERT
  18. #undef ASSERT
  19. #endif
  20. #ifdef _DEBUG
  21. __inline void MyDebugBreak(void) { DebugBreak(); }
  22. #define ASSERT(x) if (!(x)) MyDebugBreak();
  23. #else
  24. #define ASSERT(x)
  25. #endif // _DEBUG
  26. typedef ASN1uint8_t uint8_t;
  27. typedef ASN1uint16_t uint16_t;
  28. typedef ASN1uint32_t uint32_t;
  29. typedef ASN1int8_t int8_t;
  30. typedef ASN1int16_t int16_t;
  31. typedef ASN1int32_t int32_t;
  32. typedef ASN1octet_t octet_t;
  33. typedef ASN1intx_t intx_t;
  34. typedef ASN1real_e real_e;
  35. typedef ASN1real_t real_t;
  36. typedef ASN1octetstring_t octetstring_t;
  37. typedef ASN1bitstring_t bitstring_t;
  38. typedef ASN1char_t char_t;
  39. typedef ASN1charstring_t charstring_t;
  40. typedef ASN1ztcharstring_t ztcharstring_t;
  41. typedef ASN1char16_t char16_t;
  42. typedef ASN1char16string_t char16string_t;
  43. typedef ASN1ztchar16string_t ztchar16string_t;
  44. typedef ASN1char32_t char32_t;
  45. typedef ASN1char32string_t char32string_t;
  46. typedef ASN1ztchar32string_t ztchar32string_t;
  47. typedef ASN1uint32_t objectnumber_t;
  48. typedef ASN1objectidentifier_t objectidentifier_t;
  49. typedef ASN1stringtableentry_t stringtableentry_t;
  50. typedef ASN1stringtable_t stringtable_t;
  51. typedef ASN1objectdescriptor_t objectdescriptor_t;
  52. typedef ASN1generalizedtime_t generalizedtime_t;
  53. typedef ASN1utctime_t utctime_t;
  54. typedef ASN1external_t external_t;
  55. #define intx_0 ASN1intx_0
  56. #define intx_1 ASN1intx_1
  57. #define intx_2 ASN1intx_2
  58. #define intx_16 ASN1intx_16
  59. #define intx_256 ASN1intx_256
  60. #define intx_64K ASN1intx_64K
  61. #define intx_1G ASN1intx_1G
  62. #define NumericStringTable ASN1NumericStringTable;
  63. #define intx_add ASN1intx_add
  64. #define intx_addoctet ASN1intx_addoctet
  65. #define intx_sub ASN1intx_sub
  66. #define intx_suboctet ASN1intx_suboctet
  67. #define intx_muloctet ASN1intx_muloctet
  68. #define intx_inc ASN1intx_inc
  69. #define intx_dec ASN1intx_dec
  70. #define intx_neg ASN1intx_neg
  71. #define intx_log2 ASN1intx_log2
  72. #define intx_log256 ASN1intx_log256
  73. #define intx_cmp ASN1intx_cmp
  74. #define intx_dup ASN1intx_dup
  75. #define intx_free ASN1intx_free
  76. #define intx_setuint32 ASN1intx_setuint32
  77. #define intx_setint32 ASN1intx_setint32
  78. #define intx2uint64 ASN1intx2uint64
  79. #define intx2int64 ASN1intx2int64
  80. #define intx2uint32 ASN1intx2uint32
  81. #define intx2int32 ASN1intx2int32
  82. #define intx2uint16 ASN1intx2uint16
  83. #define intx2int16 ASN1intx2int16
  84. #define intx2uint8 ASN1intx2uint8
  85. #define intx2int8 ASN1intx2int8
  86. #define intxisuint64 ASN1intxisuint64
  87. #define intxisint64 ASN1intxisint64
  88. #define intxisuint32 ASN1intxisuint32
  89. #define intxisint32 ASN1intxisint32
  90. #define intxisuint16 ASN1intxisuint16
  91. #define intxisint16 ASN1intxisint16
  92. #define intxisuint8 ASN1intxisuint8
  93. #define intxisint8 ASN1intxisint8
  94. #define intx_octets ASN1intx_octets
  95. #define intx_uoctets ASN1intx_uoctets
  96. #define uint32_log2 ASN1uint32_log2
  97. #define uint32_log256 ASN1uint32_log256
  98. #define uint32_octets ASN1uint32_octets
  99. #define uint32_uoctets ASN1uint32_uoctets
  100. #define int32_octets ASN1int32_octets
  101. #define intx2double ASN1intx2double
  102. #define real2double ASN1real2double
  103. #define intx2double ASN1intx2double
  104. #define real2double ASN1real2double
  105. #define double_minf ASN1double_minf
  106. #define double_pinf ASN1double_pinf
  107. #define double_isminf ASN1double_isminf
  108. #define double_ispinf ASN1double_ispinf
  109. #define generalizedtime2string ASN1generalizedtime2string
  110. #define utctime2string ASN1utctime2string
  111. #define string2generalizedtime ASN1string2generalizedtime
  112. #define string2utctime ASN1string2utctime
  113. #define real_free ASN1real_free
  114. #define bitstring_free ASN1bitstring_free
  115. #define octetstring_free ASN1octetstring_free
  116. #define objectidentifier_free ASN1objectidentifier_free
  117. #define charstring_free ASN1charstring_free
  118. #define char16string_free ASN1char16string_free
  119. #define char32string_free ASN1char32string_free
  120. #define ztcharstring_free ASN1ztcharstring_free
  121. #define ztchar16string_free ASN1ztchar16string_free
  122. #define ztchar32string_free ASN1ztchar32string_free
  123. #define external_free ASN1external_free
  124. #define embeddedpdv_free ASN1embeddedpdv_free
  125. #define characterstring_free ASN1characterstring_free
  126. #define open_free ASN1open_free
  127. #define bitstring_cmp ASN1bitstring_cmp
  128. #define octetstring_cmp ASN1octetstring_cmp
  129. #define objectidentifier_cmp ASN1objectidentifier_cmp
  130. #define charstring_cmp ASN1charstring_cmp
  131. #define char16string_cmp ASN1char16string_cmp
  132. #define char32string_cmp ASN1char32string_cmp
  133. #define ztcharstring_cmp ASN1ztcharstring_cmp
  134. #define ztchar16string_cmp ASN1ztchar16string_cmp
  135. #define ztchar32string_cmp ASN1ztchar32string_cmp
  136. #define double_cmp double
  137. #define real_cmp ASN1real_cmp
  138. #define external_cmp ASN1external_cmp
  139. #define embeddedpdv_cmp ASN1embeddedpdv_cmp
  140. #define characterstring_cmp ASN1characterstring_cmp
  141. #define open_cmp ASN1open_cmp
  142. #define generalizedtime_cmp ASN1generalizedtime_cmp
  143. #define utctime_cmp ASN1utctime_cmp
  144. #define sequenceoflengthpointer_cmp
  145. #define sequenceofsinglylinkedlist_cmp
  146. #define sequenceofdoublylinkedlist_cmp
  147. #define setoflengthpointer_cmp
  148. #define setofsinglylinkedlist_cmp
  149. #define setofdoublylinkedlist_cmp
  150. #define is32space ASN1is32space
  151. #define str32len ASN1str32len
  152. #define is16space ASN1is16space
  153. #define str16len ASN1str16len
  154. #define bitcpy ASN1bitcpy
  155. #define bitclr ASN1bitclr
  156. #define bitset ASN1bitset
  157. #define bitput ASN1bitput
  158. #define octetput ASN1octetput
  159. #include "defs.h"
  160. #include "scanner.h"
  161. #include "parser.h"
  162. #include "builtin.h"
  163. #include "write.h"
  164. #include "error.h"
  165. #include "util.h"