Leaked source code of windows server 2003
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.

281 lines
5.0 KiB

  1. //
  2. // List of weak and semi-weak DES keys from
  3. // Applied Cryptography: Protocols, Algorithms, and Source Code in C,
  4. // second edition by Bruce Schneier.
  5. //
  6. #define NUM_WEAK_KEYS 16
  7. BOOLEAN
  8. IPSecInitRandom(
  9. VOID
  10. );
  11. VOID
  12. IPSecRngRekey(
  13. IN PVOID Context
  14. );
  15. BOOLEAN
  16. IPSecGenerateRandom(
  17. IN PUCHAR pBuf,
  18. IN ULONG BytesNeeded
  19. );
  20. VOID
  21. IPSecCleanupOutboundSA(
  22. IN PSA_TABLE_ENTRY pInboundSA,
  23. IN PSA_TABLE_ENTRY pOutboundSA,
  24. IN BOOLEAN fNoDelete
  25. );
  26. VOID
  27. IPSecCleanupLarvalSA(
  28. IN PSA_TABLE_ENTRY pSA
  29. );
  30. VOID
  31. IPSecDeleteLarvalSA(
  32. IN PSA_TABLE_ENTRY pSA
  33. );
  34. VOID
  35. IPSecDeleteInboundSA(
  36. IN PSA_TABLE_ENTRY pInboundSA
  37. );
  38. VOID
  39. IPSecExpireInboundSA(
  40. IN PSA_TABLE_ENTRY pInboundSA
  41. );
  42. NTSTATUS
  43. IPSecCheckInboundSA(
  44. IN PSA_STRUCT pSAStruct,
  45. IN PSA_TABLE_ENTRY pSA
  46. );
  47. BOOLEAN
  48. IPSecIsWeakDESKey(
  49. IN PUCHAR Key
  50. );
  51. BOOLEAN
  52. IPSecIsWeak3DESKey(
  53. IN PUCHAR Key
  54. );
  55. NTSTATUS
  56. IPSecPopulateSA(
  57. IN PSA_STRUCT pSAStruct,
  58. IN ULONG KeyLen,
  59. IN PSA_TABLE_ENTRY pSA
  60. );
  61. NTSTATUS
  62. IPSecCreateSA(
  63. OUT PSA_TABLE_ENTRY *ppSA
  64. );
  65. PSA_TABLE_ENTRY
  66. IPSecLookupSABySPI(
  67. IN tSPI SPI,
  68. IN IPAddr DestAddr
  69. );
  70. PSA_TABLE_ENTRY
  71. IPSecLookupSABySPIWithLock(
  72. IN tSPI SPI,
  73. IN IPAddr DestAddr
  74. );
  75. NTSTATUS
  76. IPSecLookupSAByAddr(
  77. IN ULARGE_INTEGER uliSrcDstAddr,
  78. IN ULARGE_INTEGER uliProtoSrcDstPort,
  79. OUT PFILTER *ppFilter,
  80. OUT PSA_TABLE_ENTRY *ppSA,
  81. OUT PSA_TABLE_ENTRY *ppNextSA,
  82. OUT PSA_TABLE_ENTRY *ppTunnelSA,
  83. IN BOOLEAN fOutbound,
  84. IN BOOLEAN fFWPacket,
  85. IN BOOLEAN fBypass,
  86. IN BOOLEAN fVerify,
  87. IN PIPSEC_UDP_ENCAP_CONTEXT pNatContext
  88. );
  89. NTSTATUS
  90. IPSecLookupTunnelSA(
  91. IN ULARGE_INTEGER uliSrcDstAddr,
  92. IN ULARGE_INTEGER uliProtoSrcDstPort,
  93. OUT PFILTER *ppFilter,
  94. OUT PSA_TABLE_ENTRY *ppSA,
  95. IN BOOLEAN fOutbound,
  96. IN PIPSEC_UDP_ENCAP_CONTEXT pNatContext
  97. );
  98. NTSTATUS
  99. IPSecLookupMaskedSA(
  100. IN ULARGE_INTEGER uliSrcDstAddr,
  101. IN ULARGE_INTEGER uliProtoSrcDstPort,
  102. OUT PFILTER *ppFilter,
  103. OUT PSA_TABLE_ENTRY *ppSA,
  104. IN BOOLEAN fOutbound,
  105. IN PIPSEC_UDP_ENCAP_CONTEXT pNatContext
  106. );
  107. NTSTATUS
  108. IPSecAllocateSPI(
  109. OUT tSPI * pSpi,
  110. IN PSA_TABLE_ENTRY pSA
  111. );
  112. NTSTATUS
  113. IPSecNegotiateSA(
  114. IN PFILTER pFilter,
  115. IN ULARGE_INTEGER uliSrcDstAddr,
  116. IN ULARGE_INTEGER uliProtoSrcDstPort,
  117. IN ULONG NewMTU,
  118. OUT PSA_TABLE_ENTRY *ppSA,
  119. IN UCHAR DestType,
  120. IN PIPSEC_UDP_ENCAP_CONTEXT pEncapContext
  121. );
  122. VOID
  123. IPSecFlushQueuedPackets(
  124. IN PSA_TABLE_ENTRY pSA,
  125. IN NTSTATUS status
  126. );
  127. NTSTATUS
  128. IPSecInsertOutboundSA(
  129. IN PSA_TABLE_ENTRY pSA,
  130. IN PIPSEC_ACQUIRE_CONTEXT pAcquireCtx,
  131. IN BOOLEAN fTunnelFilter
  132. );
  133. NTSTATUS
  134. IPSecAddSA(
  135. IN PIPSEC_ADD_SA pAddSA,
  136. IN ULONG TotalSize
  137. );
  138. NTSTATUS
  139. IPSecUpdateSA(
  140. IN PIPSEC_UPDATE_SA pUpdateSA,
  141. IN ULONG TotalSize
  142. );
  143. VOID
  144. IPSecRefSA(
  145. IN PSA_TABLE_ENTRY pSA
  146. );
  147. VOID
  148. IPSecDerefSA(
  149. IN PSA_TABLE_ENTRY pSA
  150. );
  151. VOID
  152. IPSecStopSATimers(
  153. );
  154. VOID
  155. IPSecFlushLarvalSAList(
  156. );
  157. NTSTATUS
  158. IPSecDeleteSA(
  159. IN PIPSEC_DELETE_SA pDeleteSA
  160. );
  161. NTSTATUS
  162. IPSecExpireSA(
  163. IN PIPSEC_EXPIRE_SA pExpireSA
  164. );
  165. VOID
  166. IPSecSAExpired(
  167. IN PIPSEC_TIMER pTimer,
  168. IN PVOID Context
  169. );
  170. VOID
  171. IPSecFillSAInfo(
  172. IN PSA_TABLE_ENTRY pSA,
  173. OUT PIPSEC_SA_INFO pBuf
  174. );
  175. NTSTATUS
  176. IPSecEnumSAs(
  177. IN PIRP pIrp,
  178. OUT PULONG pBytesCopied
  179. );
  180. VOID
  181. IPSecReaper(
  182. IN PIPSEC_TIMER pTimer,
  183. IN PVOID Context
  184. );
  185. VOID
  186. IPSecReapIdleSAs(
  187. );
  188. VOID
  189. IPSecFlushEventLog(
  190. IN PIPSEC_TIMER pTimer,
  191. IN PVOID Context
  192. );
  193. NTSTATUS
  194. IPSecQuerySpi(
  195. IN OUT PIPSEC_QUERY_SPI pQuerySpi
  196. );
  197. NTSTATUS
  198. IPSecSetOperationMode(
  199. IN PIPSEC_SET_OPERATION_MODE pSetOperationMode
  200. );
  201. NTSTATUS
  202. IPSecInitializeTcpip(
  203. IN PIPSEC_SET_TCPIP_STATUS pSetTcpipStatus
  204. );
  205. NTSTATUS
  206. IPSecDeinitializeTcpip(
  207. VOID
  208. );
  209. NTSTATUS
  210. IPSecSetTcpipStatus(
  211. IN PIPSEC_SET_TCPIP_STATUS pSetTcpipStatus
  212. );
  213. NTSTATUS
  214. IPSecResetCacheTable(
  215. VOID
  216. );
  217. NTSTATUS
  218. IPSecPurgeFilterSAs(
  219. IN PFILTER pFilter
  220. );
  221. NTSTATUS
  222. IPSecSetupSALifetime(
  223. IN PSA_TABLE_ENTRY pSA
  224. );
  225. BOOLEAN
  226. IPSecMatchSATemplate(
  227. IN PSA_TABLE_ENTRY pSA,
  228. IN PIPSEC_QM_SA pSATemplate
  229. );
  230. VOID ConvertEncapInfo(PSA_TABLE_ENTRY pInSA,
  231. PUDP_ENCAP_INFO pEncapInfo);