@intlayer/backend 7.1.4 → 7.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (925) hide show
  1. package/dist/cjs/controllers/ai.controller.cjs +2 -2
  2. package/dist/cjs/controllers/ai.controller.cjs.map +1 -1
  3. package/dist/cjs/schemas/dictionary.schema.cjs +2 -2
  4. package/dist/cjs/schemas/dictionary.schema.cjs.map +1 -1
  5. package/dist/cjs/schemas/discussion.schema.cjs +2 -2
  6. package/dist/cjs/schemas/discussion.schema.cjs.map +1 -1
  7. package/dist/cjs/schemas/oAuth2.schema.cjs +2 -2
  8. package/dist/cjs/schemas/oAuth2.schema.cjs.map +1 -1
  9. package/dist/cjs/schemas/organization.schema.cjs +2 -2
  10. package/dist/cjs/schemas/organization.schema.cjs.map +1 -1
  11. package/dist/cjs/schemas/plans.schema.cjs +2 -2
  12. package/dist/cjs/schemas/plans.schema.cjs.map +1 -1
  13. package/dist/cjs/schemas/project.schema.cjs +2 -2
  14. package/dist/cjs/schemas/project.schema.cjs.map +1 -1
  15. package/dist/cjs/schemas/session.schema.cjs +2 -2
  16. package/dist/cjs/schemas/session.schema.cjs.map +1 -1
  17. package/dist/cjs/schemas/tag.schema.cjs +2 -2
  18. package/dist/cjs/schemas/tag.schema.cjs.map +1 -1
  19. package/dist/cjs/schemas/user.schema.cjs +2 -2
  20. package/dist/cjs/schemas/user.schema.cjs.map +1 -1
  21. package/dist/cjs/services/email.service.cjs +1 -1
  22. package/dist/cjs/services/email.service.cjs.map +1 -1
  23. package/dist/cjs/services/oAuth2.service.cjs +1 -1
  24. package/dist/cjs/services/oAuth2.service.cjs.map +1 -1
  25. package/dist/cjs/utils/filtersAndPagination/getDictionaryFiltersAndPagination.cjs +1 -1
  26. package/dist/cjs/utils/filtersAndPagination/getDictionaryFiltersAndPagination.cjs.map +1 -1
  27. package/dist/cjs/utils/filtersAndPagination/getDiscussionFiltersAndPagination.cjs +1 -1
  28. package/dist/cjs/utils/filtersAndPagination/getDiscussionFiltersAndPagination.cjs.map +1 -1
  29. package/dist/cjs/utils/filtersAndPagination/getFiltersAndPaginationFromBody.cjs +1 -1
  30. package/dist/cjs/utils/filtersAndPagination/getFiltersAndPaginationFromBody.cjs.map +1 -1
  31. package/dist/cjs/utils/filtersAndPagination/getOrganizationFiltersAndPagination.cjs +1 -1
  32. package/dist/cjs/utils/filtersAndPagination/getOrganizationFiltersAndPagination.cjs.map +1 -1
  33. package/dist/cjs/utils/filtersAndPagination/getProjectFiltersAndPagination.cjs +1 -1
  34. package/dist/cjs/utils/filtersAndPagination/getProjectFiltersAndPagination.cjs.map +1 -1
  35. package/dist/cjs/utils/filtersAndPagination/getTagFiltersAndPagination.cjs +1 -1
  36. package/dist/cjs/utils/filtersAndPagination/getTagFiltersAndPagination.cjs.map +1 -1
  37. package/dist/cjs/utils/filtersAndPagination/getUserFiltersAndPagination.cjs +1 -1
  38. package/dist/cjs/utils/filtersAndPagination/getUserFiltersAndPagination.cjs.map +1 -1
  39. package/dist/cjs/utils/mapper/user.cjs +1 -1
  40. package/dist/cjs/utils/mapper/user.cjs.map +1 -1
  41. package/dist/esm/controllers/ai.controller.mjs +2 -2
  42. package/dist/esm/controllers/ai.controller.mjs.map +1 -1
  43. package/dist/esm/schemas/dictionary.schema.mjs +2 -2
  44. package/dist/esm/schemas/dictionary.schema.mjs.map +1 -1
  45. package/dist/esm/schemas/discussion.schema.mjs +2 -2
  46. package/dist/esm/schemas/discussion.schema.mjs.map +1 -1
  47. package/dist/esm/schemas/oAuth2.schema.mjs +2 -2
  48. package/dist/esm/schemas/oAuth2.schema.mjs.map +1 -1
  49. package/dist/esm/schemas/organization.schema.mjs +2 -2
  50. package/dist/esm/schemas/organization.schema.mjs.map +1 -1
  51. package/dist/esm/schemas/plans.schema.mjs +2 -2
  52. package/dist/esm/schemas/plans.schema.mjs.map +1 -1
  53. package/dist/esm/schemas/project.schema.mjs +2 -2
  54. package/dist/esm/schemas/project.schema.mjs.map +1 -1
  55. package/dist/esm/schemas/session.schema.mjs +2 -2
  56. package/dist/esm/schemas/session.schema.mjs.map +1 -1
  57. package/dist/esm/schemas/tag.schema.mjs +2 -2
  58. package/dist/esm/schemas/tag.schema.mjs.map +1 -1
  59. package/dist/esm/schemas/user.schema.mjs +2 -2
  60. package/dist/esm/schemas/user.schema.mjs.map +1 -1
  61. package/dist/esm/services/email.service.mjs +1 -1
  62. package/dist/esm/services/email.service.mjs.map +1 -1
  63. package/dist/esm/services/oAuth2.service.mjs +1 -1
  64. package/dist/esm/services/oAuth2.service.mjs.map +1 -1
  65. package/dist/esm/utils/filtersAndPagination/getDictionaryFiltersAndPagination.mjs +1 -1
  66. package/dist/esm/utils/filtersAndPagination/getDictionaryFiltersAndPagination.mjs.map +1 -1
  67. package/dist/esm/utils/filtersAndPagination/getDiscussionFiltersAndPagination.mjs +1 -1
  68. package/dist/esm/utils/filtersAndPagination/getDiscussionFiltersAndPagination.mjs.map +1 -1
  69. package/dist/esm/utils/filtersAndPagination/getFiltersAndPaginationFromBody.mjs +1 -1
  70. package/dist/esm/utils/filtersAndPagination/getFiltersAndPaginationFromBody.mjs.map +1 -1
  71. package/dist/esm/utils/filtersAndPagination/getOrganizationFiltersAndPagination.mjs +1 -1
  72. package/dist/esm/utils/filtersAndPagination/getOrganizationFiltersAndPagination.mjs.map +1 -1
  73. package/dist/esm/utils/filtersAndPagination/getProjectFiltersAndPagination.mjs +1 -1
  74. package/dist/esm/utils/filtersAndPagination/getProjectFiltersAndPagination.mjs.map +1 -1
  75. package/dist/esm/utils/filtersAndPagination/getTagFiltersAndPagination.mjs +1 -1
  76. package/dist/esm/utils/filtersAndPagination/getTagFiltersAndPagination.mjs.map +1 -1
  77. package/dist/esm/utils/filtersAndPagination/getUserFiltersAndPagination.mjs +1 -1
  78. package/dist/esm/utils/filtersAndPagination/getUserFiltersAndPagination.mjs.map +1 -1
  79. package/dist/esm/utils/mapper/user.mjs +1 -1
  80. package/dist/esm/utils/mapper/user.mjs.map +1 -1
  81. package/dist/types/controllers/ai.controller.d.ts.map +1 -1
  82. package/dist/types/controllers/project.controller.d.ts.map +1 -1
  83. package/dist/types/controllers/projectAccessKey.controller.d.ts.map +1 -1
  84. package/dist/types/emails/InviteUserEmail.d.ts +4 -4
  85. package/dist/types/emails/MagicLinkEmail.d.ts +4 -4
  86. package/dist/types/emails/MagicLinkEmail.d.ts.map +1 -1
  87. package/dist/types/emails/OAuthTokenCreatedEmail.d.ts +4 -4
  88. package/dist/types/emails/PasswordChangeConfirmation.d.ts +4 -4
  89. package/dist/types/emails/ResetUserPassword.d.ts +4 -4
  90. package/dist/types/emails/SubscriptionPaymentCancellation.d.ts +4 -4
  91. package/dist/types/emails/SubscriptionPaymentError.d.ts +4 -4
  92. package/dist/types/emails/SubscriptionPaymentSuccess.d.ts +4 -4
  93. package/dist/types/emails/ValidateUserEmail.d.ts +4 -4
  94. package/dist/types/emails/ValidateUserEmail.d.ts.map +1 -1
  95. package/dist/types/models/dictionary.model.d.ts +4 -4
  96. package/dist/types/models/dictionary.model.d.ts.map +1 -1
  97. package/dist/types/models/discussion.model.d.ts +2 -2
  98. package/dist/types/models/discussion.model.d.ts.map +1 -1
  99. package/dist/types/models/oAuth2.model.d.ts +3 -3
  100. package/dist/types/models/oAuth2.model.d.ts.map +1 -1
  101. package/dist/types/schemas/dictionary.schema.d.ts +6 -6
  102. package/dist/types/schemas/discussion.schema.d.ts +6 -6
  103. package/dist/types/schemas/discussion.schema.d.ts.map +1 -1
  104. package/dist/types/schemas/oAuth2.schema.d.ts +5 -5
  105. package/dist/types/schemas/oAuth2.schema.d.ts.map +1 -1
  106. package/dist/types/schemas/organization.schema.d.ts +6 -6
  107. package/dist/types/schemas/plans.schema.d.ts +6 -6
  108. package/dist/types/schemas/project.schema.d.ts +6 -6
  109. package/dist/types/schemas/session.schema.d.ts +6 -6
  110. package/dist/types/schemas/tag.schema.d.ts +6 -6
  111. package/dist/types/schemas/user.schema.d.ts +6 -6
  112. package/dist/types/schemas/user.schema.d.ts.map +1 -1
  113. package/dist/types/utils/filtersAndPagination/getDictionaryFiltersAndPagination.d.ts +2 -2
  114. package/dist/types/utils/filtersAndPagination/getDiscussionFiltersAndPagination.d.ts +2 -2
  115. package/dist/types/utils/filtersAndPagination/getOrganizationFiltersAndPagination.d.ts +2 -2
  116. package/dist/types/utils/filtersAndPagination/getProjectFiltersAndPagination.d.ts +2 -2
  117. package/dist/types/utils/filtersAndPagination/getTagFiltersAndPagination.d.ts +2 -2
  118. package/package.json +7 -7
  119. package/dist/cjs/controllers/audit.controller.cjs +0 -186
  120. package/dist/cjs/controllers/audit.controller.cjs.map +0 -1
  121. package/dist/cjs/models/audit.model.cjs +0 -10
  122. package/dist/cjs/models/audit.model.cjs.map +0 -1
  123. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/index.cjs +0 -16
  124. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/index.cjs.map +0 -1
  125. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/templates/encrypted-key.tpl.xml.cjs +0 -25
  126. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/templates/encrypted-key.tpl.xml.cjs.map +0 -1
  127. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/templates/keyinfo.tpl.xml.cjs +0 -31
  128. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/templates/keyinfo.tpl.xml.cjs.map +0 -1
  129. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/utils.cjs +0 -38
  130. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/utils.cjs.map +0 -1
  131. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/xmlenc.cjs +0 -231
  132. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/xmlenc.cjs.map +0 -1
  133. package/dist/cjs/node_modules/@better-auth/sso/dist/index.cjs +0 -1210
  134. package/dist/cjs/node_modules/@better-auth/sso/dist/index.cjs.map +0 -1
  135. package/dist/cjs/node_modules/@better-fetch/fetch/dist/index.cjs +0 -362
  136. package/dist/cjs/node_modules/@better-fetch/fetch/dist/index.cjs.map +0 -1
  137. package/dist/cjs/node_modules/@xmldom/is-dom-node/dist/index.cjs +0 -89
  138. package/dist/cjs/node_modules/@xmldom/is-dom-node/dist/index.cjs.map +0 -1
  139. package/dist/cjs/node_modules/@xmldom/xmldom/lib/conventions.cjs +0 -110
  140. package/dist/cjs/node_modules/@xmldom/xmldom/lib/conventions.cjs.map +0 -1
  141. package/dist/cjs/node_modules/@xmldom/xmldom/lib/dom-parser.cjs +0 -248
  142. package/dist/cjs/node_modules/@xmldom/xmldom/lib/dom-parser.cjs.map +0 -1
  143. package/dist/cjs/node_modules/@xmldom/xmldom/lib/dom.cjs +0 -1309
  144. package/dist/cjs/node_modules/@xmldom/xmldom/lib/dom.cjs.map +0 -1
  145. package/dist/cjs/node_modules/@xmldom/xmldom/lib/entities.cjs +0 -2176
  146. package/dist/cjs/node_modules/@xmldom/xmldom/lib/entities.cjs.map +0 -1
  147. package/dist/cjs/node_modules/@xmldom/xmldom/lib/index.cjs +0 -20
  148. package/dist/cjs/node_modules/@xmldom/xmldom/lib/index.cjs.map +0 -1
  149. package/dist/cjs/node_modules/@xmldom/xmldom/lib/sax.cjs +0 -499
  150. package/dist/cjs/node_modules/@xmldom/xmldom/lib/sax.cjs.map +0 -1
  151. package/dist/cjs/node_modules/asn1/lib/ber/errors.cjs +0 -20
  152. package/dist/cjs/node_modules/asn1/lib/ber/errors.cjs.map +0 -1
  153. package/dist/cjs/node_modules/asn1/lib/ber/index.cjs +0 -28
  154. package/dist/cjs/node_modules/asn1/lib/ber/index.cjs.map +0 -1
  155. package/dist/cjs/node_modules/asn1/lib/ber/reader.cjs +0 -167
  156. package/dist/cjs/node_modules/asn1/lib/ber/reader.cjs.map +0 -1
  157. package/dist/cjs/node_modules/asn1/lib/ber/types.cjs +0 -47
  158. package/dist/cjs/node_modules/asn1/lib/ber/types.cjs.map +0 -1
  159. package/dist/cjs/node_modules/asn1/lib/ber/writer.cjs +0 -223
  160. package/dist/cjs/node_modules/asn1/lib/ber/writer.cjs.map +0 -1
  161. package/dist/cjs/node_modules/asn1/lib/index.cjs +0 -21
  162. package/dist/cjs/node_modules/asn1/lib/index.cjs.map +0 -1
  163. package/dist/cjs/node_modules/camelcase/index.cjs +0 -78
  164. package/dist/cjs/node_modules/camelcase/index.cjs.map +0 -1
  165. package/dist/cjs/node_modules/escape-html/index.cjs +0 -71
  166. package/dist/cjs/node_modules/escape-html/index.cjs.map +0 -1
  167. package/dist/cjs/node_modules/fast-xml-parser/src/fxp.cjs +0 -9
  168. package/dist/cjs/node_modules/fast-xml-parser/src/fxp.cjs.map +0 -1
  169. package/dist/cjs/node_modules/fast-xml-parser/src/util.cjs +0 -29
  170. package/dist/cjs/node_modules/fast-xml-parser/src/util.cjs.map +0 -1
  171. package/dist/cjs/node_modules/fast-xml-parser/src/validator.cjs +0 -244
  172. package/dist/cjs/node_modules/fast-xml-parser/src/validator.cjs.map +0 -1
  173. package/dist/cjs/node_modules/jose/dist/webapi/lib/base64.cjs +0 -14
  174. package/dist/cjs/node_modules/jose/dist/webapi/lib/base64.cjs.map +0 -1
  175. package/dist/cjs/node_modules/jose/dist/webapi/lib/buffer_utils.cjs +0 -10
  176. package/dist/cjs/node_modules/jose/dist/webapi/lib/buffer_utils.cjs.map +0 -1
  177. package/dist/cjs/node_modules/jose/dist/webapi/lib/is_object.cjs +0 -17
  178. package/dist/cjs/node_modules/jose/dist/webapi/lib/is_object.cjs.map +0 -1
  179. package/dist/cjs/node_modules/jose/dist/webapi/util/base64url.cjs +0 -20
  180. package/dist/cjs/node_modules/jose/dist/webapi/util/base64url.cjs.map +0 -1
  181. package/dist/cjs/node_modules/jose/dist/webapi/util/decode_jwt.cjs +0 -32
  182. package/dist/cjs/node_modules/jose/dist/webapi/util/decode_jwt.cjs.map +0 -1
  183. package/dist/cjs/node_modules/jose/dist/webapi/util/errors.cjs +0 -28
  184. package/dist/cjs/node_modules/jose/dist/webapi/util/errors.cjs.map +0 -1
  185. package/dist/cjs/node_modules/node-forge/lib/aes.cjs +0 -604
  186. package/dist/cjs/node_modules/node-forge/lib/aes.cjs.map +0 -1
  187. package/dist/cjs/node_modules/node-forge/lib/aesCipherSuites.cjs +0 -202
  188. package/dist/cjs/node_modules/node-forge/lib/aesCipherSuites.cjs.map +0 -1
  189. package/dist/cjs/node_modules/node-forge/lib/asn1-validator.cjs +0 -83
  190. package/dist/cjs/node_modules/node-forge/lib/asn1-validator.cjs.map +0 -1
  191. package/dist/cjs/node_modules/node-forge/lib/asn1.cjs +0 -945
  192. package/dist/cjs/node_modules/node-forge/lib/asn1.cjs.map +0 -1
  193. package/dist/cjs/node_modules/node-forge/lib/baseN.cjs +0 -144
  194. package/dist/cjs/node_modules/node-forge/lib/baseN.cjs.map +0 -1
  195. package/dist/cjs/node_modules/node-forge/lib/cipher.cjs +0 -193
  196. package/dist/cjs/node_modules/node-forge/lib/cipher.cjs.map +0 -1
  197. package/dist/cjs/node_modules/node-forge/lib/cipherModes.cjs +0 -604
  198. package/dist/cjs/node_modules/node-forge/lib/cipherModes.cjs.map +0 -1
  199. package/dist/cjs/node_modules/node-forge/lib/des.cjs +0 -1194
  200. package/dist/cjs/node_modules/node-forge/lib/des.cjs.map +0 -1
  201. package/dist/cjs/node_modules/node-forge/lib/ed25519.cjs +0 -1027
  202. package/dist/cjs/node_modules/node-forge/lib/ed25519.cjs.map +0 -1
  203. package/dist/cjs/node_modules/node-forge/lib/forge.cjs +0 -22
  204. package/dist/cjs/node_modules/node-forge/lib/forge.cjs.map +0 -1
  205. package/dist/cjs/node_modules/node-forge/lib/hmac.cjs +0 -114
  206. package/dist/cjs/node_modules/node-forge/lib/hmac.cjs.map +0 -1
  207. package/dist/cjs/node_modules/node-forge/lib/index.cjs +0 -73
  208. package/dist/cjs/node_modules/node-forge/lib/index.cjs.map +0 -1
  209. package/dist/cjs/node_modules/node-forge/lib/jsbn.cjs +0 -1263
  210. package/dist/cjs/node_modules/node-forge/lib/jsbn.cjs.map +0 -1
  211. package/dist/cjs/node_modules/node-forge/lib/kem.cjs +0 -153
  212. package/dist/cjs/node_modules/node-forge/lib/kem.cjs.map +0 -1
  213. package/dist/cjs/node_modules/node-forge/lib/log.cjs +0 -248
  214. package/dist/cjs/node_modules/node-forge/lib/log.cjs.map +0 -1
  215. package/dist/cjs/node_modules/node-forge/lib/md.all.cjs +0 -31
  216. package/dist/cjs/node_modules/node-forge/lib/md.all.cjs.map +0 -1
  217. package/dist/cjs/node_modules/node-forge/lib/md.cjs +0 -25
  218. package/dist/cjs/node_modules/node-forge/lib/md.cjs.map +0 -1
  219. package/dist/cjs/node_modules/node-forge/lib/md5.cjs +0 -331
  220. package/dist/cjs/node_modules/node-forge/lib/md5.cjs.map +0 -1
  221. package/dist/cjs/node_modules/node-forge/lib/mgf.cjs +0 -27
  222. package/dist/cjs/node_modules/node-forge/lib/mgf.cjs.map +0 -1
  223. package/dist/cjs/node_modules/node-forge/lib/mgf1.cjs +0 -51
  224. package/dist/cjs/node_modules/node-forge/lib/mgf1.cjs.map +0 -1
  225. package/dist/cjs/node_modules/node-forge/lib/oids.cjs +0 -160
  226. package/dist/cjs/node_modules/node-forge/lib/oids.cjs.map +0 -1
  227. package/dist/cjs/node_modules/node-forge/lib/pbe.cjs +0 -822
  228. package/dist/cjs/node_modules/node-forge/lib/pbe.cjs.map +0 -1
  229. package/dist/cjs/node_modules/node-forge/lib/pbkdf2.cjs +0 -132
  230. package/dist/cjs/node_modules/node-forge/lib/pbkdf2.cjs.map +0 -1
  231. package/dist/cjs/node_modules/node-forge/lib/pem.cjs +0 -182
  232. package/dist/cjs/node_modules/node-forge/lib/pem.cjs.map +0 -1
  233. package/dist/cjs/node_modules/node-forge/lib/pkcs1.cjs +0 -207
  234. package/dist/cjs/node_modules/node-forge/lib/pkcs1.cjs.map +0 -1
  235. package/dist/cjs/node_modules/node-forge/lib/pkcs12.cjs +0 -730
  236. package/dist/cjs/node_modules/node-forge/lib/pkcs12.cjs.map +0 -1
  237. package/dist/cjs/node_modules/node-forge/lib/pkcs7.cjs +0 -648
  238. package/dist/cjs/node_modules/node-forge/lib/pkcs7.cjs.map +0 -1
  239. package/dist/cjs/node_modules/node-forge/lib/pkcs7asn1.cjs +0 -412
  240. package/dist/cjs/node_modules/node-forge/lib/pkcs7asn1.cjs.map +0 -1
  241. package/dist/cjs/node_modules/node-forge/lib/pki.cjs +0 -108
  242. package/dist/cjs/node_modules/node-forge/lib/pki.cjs.map +0 -1
  243. package/dist/cjs/node_modules/node-forge/lib/prime.cjs +0 -200
  244. package/dist/cjs/node_modules/node-forge/lib/prime.cjs.map +0 -1
  245. package/dist/cjs/node_modules/node-forge/lib/prng.cjs +0 -297
  246. package/dist/cjs/node_modules/node-forge/lib/prng.cjs.map +0 -1
  247. package/dist/cjs/node_modules/node-forge/lib/pss.cjs +0 -148
  248. package/dist/cjs/node_modules/node-forge/lib/pss.cjs.map +0 -1
  249. package/dist/cjs/node_modules/node-forge/lib/random.cjs +0 -148
  250. package/dist/cjs/node_modules/node-forge/lib/random.cjs.map +0 -1
  251. package/dist/cjs/node_modules/node-forge/lib/rc2.cjs +0 -545
  252. package/dist/cjs/node_modules/node-forge/lib/rc2.cjs.map +0 -1
  253. package/dist/cjs/node_modules/node-forge/lib/rsa.cjs +0 -1306
  254. package/dist/cjs/node_modules/node-forge/lib/rsa.cjs.map +0 -1
  255. package/dist/cjs/node_modules/node-forge/lib/sha1.cjs +0 -237
  256. package/dist/cjs/node_modules/node-forge/lib/sha1.cjs.map +0 -1
  257. package/dist/cjs/node_modules/node-forge/lib/sha256.cjs +0 -274
  258. package/dist/cjs/node_modules/node-forge/lib/sha256.cjs.map +0 -1
  259. package/dist/cjs/node_modules/node-forge/lib/sha512.cjs +0 -420
  260. package/dist/cjs/node_modules/node-forge/lib/sha512.cjs.map +0 -1
  261. package/dist/cjs/node_modules/node-forge/lib/ssh.cjs +0 -201
  262. package/dist/cjs/node_modules/node-forge/lib/ssh.cjs.map +0 -1
  263. package/dist/cjs/node_modules/node-forge/lib/tls.cjs +0 -3662
  264. package/dist/cjs/node_modules/node-forge/lib/tls.cjs.map +0 -1
  265. package/dist/cjs/node_modules/node-forge/lib/util.cjs +0 -2124
  266. package/dist/cjs/node_modules/node-forge/lib/util.cjs.map +0 -1
  267. package/dist/cjs/node_modules/node-forge/lib/x509.cjs +0 -2171
  268. package/dist/cjs/node_modules/node-forge/lib/x509.cjs.map +0 -1
  269. package/dist/cjs/node_modules/node-rsa/src/NodeRSA.cjs +0 -341
  270. package/dist/cjs/node_modules/node-rsa/src/NodeRSA.cjs.map +0 -1
  271. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/encryptEngines.cjs +0 -26
  272. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/encryptEngines.cjs.map +0 -1
  273. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/io.cjs +0 -65
  274. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/io.cjs.map +0 -1
  275. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/js.cjs +0 -44
  276. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/js.cjs.map +0 -1
  277. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/node12.cjs +0 -49
  278. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/node12.cjs.map +0 -1
  279. package/dist/cjs/node_modules/node-rsa/src/formats/components.cjs +0 -55
  280. package/dist/cjs/node_modules/node-rsa/src/formats/components.cjs.map +0 -1
  281. package/dist/cjs/node_modules/node-rsa/src/formats/formats.cjs +0 -86
  282. package/dist/cjs/node_modules/node-rsa/src/formats/formats.cjs.map +0 -1
  283. package/dist/cjs/node_modules/node-rsa/src/formats/openssh.cjs +0 -177
  284. package/dist/cjs/node_modules/node-rsa/src/formats/openssh.cjs.map +0 -1
  285. package/dist/cjs/node_modules/node-rsa/src/formats/pkcs1.cjs +0 -104
  286. package/dist/cjs/node_modules/node-rsa/src/formats/pkcs1.cjs.map +0 -1
  287. package/dist/cjs/node_modules/node-rsa/src/formats/pkcs8.cjs +0 -131
  288. package/dist/cjs/node_modules/node-rsa/src/formats/pkcs8.cjs.map +0 -1
  289. package/dist/cjs/node_modules/node-rsa/src/libs/jsbn.cjs +0 -1347
  290. package/dist/cjs/node_modules/node-rsa/src/libs/jsbn.cjs.map +0 -1
  291. package/dist/cjs/node_modules/node-rsa/src/libs/rsa.cjs +0 -231
  292. package/dist/cjs/node_modules/node-rsa/src/libs/rsa.cjs.map +0 -1
  293. package/dist/cjs/node_modules/node-rsa/src/schemes/oaep.cjs +0 -123
  294. package/dist/cjs/node_modules/node-rsa/src/schemes/oaep.cjs.map +0 -1
  295. package/dist/cjs/node_modules/node-rsa/src/schemes/pkcs1.cjs +0 -175
  296. package/dist/cjs/node_modules/node-rsa/src/schemes/pkcs1.cjs.map +0 -1
  297. package/dist/cjs/node_modules/node-rsa/src/schemes/pss.cjs +0 -123
  298. package/dist/cjs/node_modules/node-rsa/src/schemes/pss.cjs.map +0 -1
  299. package/dist/cjs/node_modules/node-rsa/src/schemes/schemes.cjs +0 -28
  300. package/dist/cjs/node_modules/node-rsa/src/schemes/schemes.cjs.map +0 -1
  301. package/dist/cjs/node_modules/node-rsa/src/utils.cjs +0 -84
  302. package/dist/cjs/node_modules/node-rsa/src/utils.cjs.map +0 -1
  303. package/dist/cjs/node_modules/pako/index.cjs +0 -25
  304. package/dist/cjs/node_modules/pako/index.cjs.map +0 -1
  305. package/dist/cjs/node_modules/pako/lib/deflate.cjs +0 -311
  306. package/dist/cjs/node_modules/pako/lib/deflate.cjs.map +0 -1
  307. package/dist/cjs/node_modules/pako/lib/inflate.cjs +0 -317
  308. package/dist/cjs/node_modules/pako/lib/inflate.cjs.map +0 -1
  309. package/dist/cjs/node_modules/pako/lib/utils/common.cjs +0 -77
  310. package/dist/cjs/node_modules/pako/lib/utils/common.cjs.map +0 -1
  311. package/dist/cjs/node_modules/pako/lib/utils/strings.cjs +0 -131
  312. package/dist/cjs/node_modules/pako/lib/utils/strings.cjs.map +0 -1
  313. package/dist/cjs/node_modules/pako/lib/zlib/adler32.cjs +0 -29
  314. package/dist/cjs/node_modules/pako/lib/zlib/adler32.cjs.map +0 -1
  315. package/dist/cjs/node_modules/pako/lib/zlib/constants.cjs +0 -43
  316. package/dist/cjs/node_modules/pako/lib/zlib/constants.cjs.map +0 -1
  317. package/dist/cjs/node_modules/pako/lib/zlib/crc32.cjs +0 -31
  318. package/dist/cjs/node_modules/pako/lib/zlib/crc32.cjs.map +0 -1
  319. package/dist/cjs/node_modules/pako/lib/zlib/deflate.cjs +0 -889
  320. package/dist/cjs/node_modules/pako/lib/zlib/deflate.cjs.map +0 -1
  321. package/dist/cjs/node_modules/pako/lib/zlib/gzheader.cjs +0 -27
  322. package/dist/cjs/node_modules/pako/lib/zlib/gzheader.cjs.map +0 -1
  323. package/dist/cjs/node_modules/pako/lib/zlib/inffast.cjs +0 -227
  324. package/dist/cjs/node_modules/pako/lib/zlib/inffast.cjs.map +0 -1
  325. package/dist/cjs/node_modules/pako/lib/zlib/inflate.cjs +0 -1038
  326. package/dist/cjs/node_modules/pako/lib/zlib/inflate.cjs.map +0 -1
  327. package/dist/cjs/node_modules/pako/lib/zlib/inftrees.cjs +0 -278
  328. package/dist/cjs/node_modules/pako/lib/zlib/inftrees.cjs.map +0 -1
  329. package/dist/cjs/node_modules/pako/lib/zlib/messages.cjs +0 -25
  330. package/dist/cjs/node_modules/pako/lib/zlib/messages.cjs.map +0 -1
  331. package/dist/cjs/node_modules/pako/lib/zlib/trees.cjs +0 -626
  332. package/dist/cjs/node_modules/pako/lib/zlib/trees.cjs.map +0 -1
  333. package/dist/cjs/node_modules/pako/lib/zlib/zstream.cjs +0 -29
  334. package/dist/cjs/node_modules/pako/lib/zlib/zstream.cjs.map +0 -1
  335. package/dist/cjs/node_modules/safer-buffer/safer.cjs +0 -52
  336. package/dist/cjs/node_modules/safer-buffer/safer.cjs.map +0 -1
  337. package/dist/cjs/node_modules/samlify/build/index.cjs +0 -120
  338. package/dist/cjs/node_modules/samlify/build/index.cjs.map +0 -1
  339. package/dist/cjs/node_modules/samlify/build/src/api.cjs +0 -36
  340. package/dist/cjs/node_modules/samlify/build/src/api.cjs.map +0 -1
  341. package/dist/cjs/node_modules/samlify/build/src/binding-post.cjs +0 -507
  342. package/dist/cjs/node_modules/samlify/build/src/binding-post.cjs.map +0 -1
  343. package/dist/cjs/node_modules/samlify/build/src/binding-redirect.cjs +0 -342
  344. package/dist/cjs/node_modules/samlify/build/src/binding-redirect.cjs.map +0 -1
  345. package/dist/cjs/node_modules/samlify/build/src/binding-simplesign.cjs +0 -361
  346. package/dist/cjs/node_modules/samlify/build/src/binding-simplesign.cjs.map +0 -1
  347. package/dist/cjs/node_modules/samlify/build/src/entity-idp.cjs +0 -282
  348. package/dist/cjs/node_modules/samlify/build/src/entity-idp.cjs.map +0 -1
  349. package/dist/cjs/node_modules/samlify/build/src/entity-sp.cjs +0 -145
  350. package/dist/cjs/node_modules/samlify/build/src/entity-sp.cjs.map +0 -1
  351. package/dist/cjs/node_modules/samlify/build/src/entity.cjs +0 -256
  352. package/dist/cjs/node_modules/samlify/build/src/entity.cjs.map +0 -1
  353. package/dist/cjs/node_modules/samlify/build/src/extractor.cjs +0 -355
  354. package/dist/cjs/node_modules/samlify/build/src/extractor.cjs.map +0 -1
  355. package/dist/cjs/node_modules/samlify/build/src/flow.cjs +0 -392
  356. package/dist/cjs/node_modules/samlify/build/src/flow.cjs.map +0 -1
  357. package/dist/cjs/node_modules/samlify/build/src/libsaml.cjs +0 -547
  358. package/dist/cjs/node_modules/samlify/build/src/libsaml.cjs.map +0 -1
  359. package/dist/cjs/node_modules/samlify/build/src/metadata-idp.cjs +0 -174
  360. package/dist/cjs/node_modules/samlify/build/src/metadata-idp.cjs.map +0 -1
  361. package/dist/cjs/node_modules/samlify/build/src/metadata-sp.cjs +0 -217
  362. package/dist/cjs/node_modules/samlify/build/src/metadata-sp.cjs.map +0 -1
  363. package/dist/cjs/node_modules/samlify/build/src/metadata.cjs +0 -203
  364. package/dist/cjs/node_modules/samlify/build/src/metadata.cjs.map +0 -1
  365. package/dist/cjs/node_modules/samlify/build/src/urn.cjs +0 -228
  366. package/dist/cjs/node_modules/samlify/build/src/urn.cjs.map +0 -1
  367. package/dist/cjs/node_modules/samlify/build/src/utility.cjs +0 -280
  368. package/dist/cjs/node_modules/samlify/build/src/utility.cjs.map +0 -1
  369. package/dist/cjs/node_modules/samlify/build/src/validator.cjs +0 -56
  370. package/dist/cjs/node_modules/samlify/build/src/validator.cjs.map +0 -1
  371. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/index.cjs +0 -50
  372. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/index.cjs.map +0 -1
  373. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/md5.cjs +0 -25
  374. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/md5.cjs.map +0 -1
  375. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/nil.cjs +0 -18
  376. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/nil.cjs.map +0 -1
  377. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/parse.cjs +0 -42
  378. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/parse.cjs.map +0 -1
  379. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/regex.cjs +0 -18
  380. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/regex.cjs.map +0 -1
  381. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/rng.cjs +0 -28
  382. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/rng.cjs.map +0 -1
  383. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/sha1.cjs +0 -25
  384. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/sha1.cjs.map +0 -1
  385. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/stringify.cjs +0 -27
  386. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/stringify.cjs.map +0 -1
  387. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v1.cjs +0 -69
  388. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v1.cjs.map +0 -1
  389. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v3.cjs +0 -23
  390. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v3.cjs.map +0 -1
  391. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v35.cjs +0 -54
  392. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v35.cjs.map +0 -1
  393. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v4.cjs +0 -34
  394. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v4.cjs.map +0 -1
  395. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v5.cjs +0 -23
  396. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v5.cjs.map +0 -1
  397. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/validate.cjs +0 -23
  398. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/validate.cjs.map +0 -1
  399. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/version.cjs +0 -24
  400. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/version.cjs.map +0 -1
  401. package/dist/cjs/node_modules/xml/lib/escapeForXML.cjs +0 -27
  402. package/dist/cjs/node_modules/xml/lib/escapeForXML.cjs.map +0 -1
  403. package/dist/cjs/node_modules/xml/lib/xml.cjs +0 -186
  404. package/dist/cjs/node_modules/xml/lib/xml.cjs.map +0 -1
  405. package/dist/cjs/node_modules/xml-crypto/lib/c14n-canonicalization.cjs +0 -202
  406. package/dist/cjs/node_modules/xml-crypto/lib/c14n-canonicalization.cjs.map +0 -1
  407. package/dist/cjs/node_modules/xml-crypto/lib/enveloped-signature.cjs +0 -52
  408. package/dist/cjs/node_modules/xml-crypto/lib/enveloped-signature.cjs.map +0 -1
  409. package/dist/cjs/node_modules/xml-crypto/lib/exclusive-canonicalization.cjs +0 -223
  410. package/dist/cjs/node_modules/xml-crypto/lib/exclusive-canonicalization.cjs.map +0 -1
  411. package/dist/cjs/node_modules/xml-crypto/lib/hash-algorithms.cjs +0 -56
  412. package/dist/cjs/node_modules/xml-crypto/lib/hash-algorithms.cjs.map +0 -1
  413. package/dist/cjs/node_modules/xml-crypto/lib/index.cjs +0 -73
  414. package/dist/cjs/node_modules/xml-crypto/lib/index.cjs.map +0 -1
  415. package/dist/cjs/node_modules/xml-crypto/lib/signature-algorithms.cjs +0 -91
  416. package/dist/cjs/node_modules/xml-crypto/lib/signature-algorithms.cjs.map +0 -1
  417. package/dist/cjs/node_modules/xml-crypto/lib/signed-xml.cjs +0 -695
  418. package/dist/cjs/node_modules/xml-crypto/lib/signed-xml.cjs.map +0 -1
  419. package/dist/cjs/node_modules/xml-crypto/lib/types.cjs +0 -58
  420. package/dist/cjs/node_modules/xml-crypto/lib/types.cjs.map +0 -1
  421. package/dist/cjs/node_modules/xml-crypto/lib/utils.cjs +0 -213
  422. package/dist/cjs/node_modules/xml-crypto/lib/utils.cjs.map +0 -1
  423. package/dist/cjs/node_modules/xml-crypto/node_modules/xpath/xpath.cjs +0 -3445
  424. package/dist/cjs/node_modules/xml-crypto/node_modules/xpath/xpath.cjs.map +0 -1
  425. package/dist/cjs/node_modules/xml-escape/index.cjs +0 -30
  426. package/dist/cjs/node_modules/xml-escape/index.cjs.map +0 -1
  427. package/dist/cjs/node_modules/xpath/xpath.cjs +0 -3410
  428. package/dist/cjs/node_modules/xpath/xpath.cjs.map +0 -1
  429. package/dist/cjs/node_modules/zod/v4/classic/errors.cjs +0 -31
  430. package/dist/cjs/node_modules/zod/v4/classic/errors.cjs.map +0 -1
  431. package/dist/cjs/node_modules/zod/v4/classic/iso.cjs +0 -42
  432. package/dist/cjs/node_modules/zod/v4/classic/iso.cjs.map +0 -1
  433. package/dist/cjs/node_modules/zod/v4/classic/parse.cjs +0 -32
  434. package/dist/cjs/node_modules/zod/v4/classic/parse.cjs.map +0 -1
  435. package/dist/cjs/node_modules/zod/v4/classic/schemas.cjs +0 -527
  436. package/dist/cjs/node_modules/zod/v4/classic/schemas.cjs.map +0 -1
  437. package/dist/cjs/node_modules/zod/v4/core/api.cjs +0 -443
  438. package/dist/cjs/node_modules/zod/v4/core/api.cjs.map +0 -1
  439. package/dist/cjs/node_modules/zod/v4/core/checks.cjs +0 -238
  440. package/dist/cjs/node_modules/zod/v4/core/checks.cjs.map +0 -1
  441. package/dist/cjs/node_modules/zod/v4/core/core.cjs +0 -63
  442. package/dist/cjs/node_modules/zod/v4/core/core.cjs.map +0 -1
  443. package/dist/cjs/node_modules/zod/v4/core/doc.cjs +0 -36
  444. package/dist/cjs/node_modules/zod/v4/core/doc.cjs.map +0 -1
  445. package/dist/cjs/node_modules/zod/v4/core/errors.cjs +0 -67
  446. package/dist/cjs/node_modules/zod/v4/core/errors.cjs.map +0 -1
  447. package/dist/cjs/node_modules/zod/v4/core/parse.cjs +0 -124
  448. package/dist/cjs/node_modules/zod/v4/core/parse.cjs.map +0 -1
  449. package/dist/cjs/node_modules/zod/v4/core/regexes.cjs +0 -87
  450. package/dist/cjs/node_modules/zod/v4/core/regexes.cjs.map +0 -1
  451. package/dist/cjs/node_modules/zod/v4/core/registries.cjs +0 -55
  452. package/dist/cjs/node_modules/zod/v4/core/registries.cjs.map +0 -1
  453. package/dist/cjs/node_modules/zod/v4/core/schemas.cjs +0 -1115
  454. package/dist/cjs/node_modules/zod/v4/core/schemas.cjs.map +0 -1
  455. package/dist/cjs/node_modules/zod/v4/core/util.cjs +0 -333
  456. package/dist/cjs/node_modules/zod/v4/core/util.cjs.map +0 -1
  457. package/dist/cjs/node_modules/zod/v4/core/versions.cjs +0 -12
  458. package/dist/cjs/node_modules/zod/v4/core/versions.cjs.map +0 -1
  459. package/dist/esm/_virtual/rolldown_runtime.mjs +0 -43
  460. package/dist/esm/controllers/audit.controller.mjs +0 -182
  461. package/dist/esm/controllers/audit.controller.mjs.map +0 -1
  462. package/dist/esm/models/audit.model.mjs +0 -9
  463. package/dist/esm/models/audit.model.mjs.map +0 -1
  464. package/dist/esm/node_modules/@authenio/xml-encryption/lib/index.mjs +0 -13
  465. package/dist/esm/node_modules/@authenio/xml-encryption/lib/index.mjs.map +0 -1
  466. package/dist/esm/node_modules/@authenio/xml-encryption/lib/templates/encrypted-key.tpl.xml.mjs +0 -22
  467. package/dist/esm/node_modules/@authenio/xml-encryption/lib/templates/encrypted-key.tpl.xml.mjs.map +0 -1
  468. package/dist/esm/node_modules/@authenio/xml-encryption/lib/templates/keyinfo.tpl.xml.mjs +0 -28
  469. package/dist/esm/node_modules/@authenio/xml-encryption/lib/templates/keyinfo.tpl.xml.mjs.map +0 -1
  470. package/dist/esm/node_modules/@authenio/xml-encryption/lib/utils.mjs +0 -35
  471. package/dist/esm/node_modules/@authenio/xml-encryption/lib/utils.mjs.map +0 -1
  472. package/dist/esm/node_modules/@authenio/xml-encryption/lib/xmlenc.mjs +0 -228
  473. package/dist/esm/node_modules/@authenio/xml-encryption/lib/xmlenc.mjs.map +0 -1
  474. package/dist/esm/node_modules/@better-auth/sso/dist/index.mjs +0 -1210
  475. package/dist/esm/node_modules/@better-auth/sso/dist/index.mjs.map +0 -1
  476. package/dist/esm/node_modules/@better-fetch/fetch/dist/index.mjs +0 -359
  477. package/dist/esm/node_modules/@better-fetch/fetch/dist/index.mjs.map +0 -1
  478. package/dist/esm/node_modules/@xmldom/is-dom-node/dist/index.mjs +0 -86
  479. package/dist/esm/node_modules/@xmldom/is-dom-node/dist/index.mjs.map +0 -1
  480. package/dist/esm/node_modules/@xmldom/xmldom/lib/conventions.mjs +0 -107
  481. package/dist/esm/node_modules/@xmldom/xmldom/lib/conventions.mjs.map +0 -1
  482. package/dist/esm/node_modules/@xmldom/xmldom/lib/dom-parser.mjs +0 -245
  483. package/dist/esm/node_modules/@xmldom/xmldom/lib/dom-parser.mjs.map +0 -1
  484. package/dist/esm/node_modules/@xmldom/xmldom/lib/dom.mjs +0 -1306
  485. package/dist/esm/node_modules/@xmldom/xmldom/lib/dom.mjs.map +0 -1
  486. package/dist/esm/node_modules/@xmldom/xmldom/lib/entities.mjs +0 -2173
  487. package/dist/esm/node_modules/@xmldom/xmldom/lib/entities.mjs.map +0 -1
  488. package/dist/esm/node_modules/@xmldom/xmldom/lib/index.mjs +0 -17
  489. package/dist/esm/node_modules/@xmldom/xmldom/lib/index.mjs.map +0 -1
  490. package/dist/esm/node_modules/@xmldom/xmldom/lib/sax.mjs +0 -496
  491. package/dist/esm/node_modules/@xmldom/xmldom/lib/sax.mjs.map +0 -1
  492. package/dist/esm/node_modules/asn1/lib/ber/errors.mjs +0 -17
  493. package/dist/esm/node_modules/asn1/lib/ber/errors.mjs.map +0 -1
  494. package/dist/esm/node_modules/asn1/lib/ber/index.mjs +0 -25
  495. package/dist/esm/node_modules/asn1/lib/ber/index.mjs.map +0 -1
  496. package/dist/esm/node_modules/asn1/lib/ber/reader.mjs +0 -164
  497. package/dist/esm/node_modules/asn1/lib/ber/reader.mjs.map +0 -1
  498. package/dist/esm/node_modules/asn1/lib/ber/types.mjs +0 -44
  499. package/dist/esm/node_modules/asn1/lib/ber/types.mjs.map +0 -1
  500. package/dist/esm/node_modules/asn1/lib/ber/writer.mjs +0 -220
  501. package/dist/esm/node_modules/asn1/lib/ber/writer.mjs.map +0 -1
  502. package/dist/esm/node_modules/asn1/lib/index.mjs +0 -18
  503. package/dist/esm/node_modules/asn1/lib/index.mjs.map +0 -1
  504. package/dist/esm/node_modules/available-typed-arrays/index.mjs +0 -20
  505. package/dist/esm/node_modules/available-typed-arrays/index.mjs.map +0 -1
  506. package/dist/esm/node_modules/base64-js/index.mjs +0 -95
  507. package/dist/esm/node_modules/base64-js/index.mjs.map +0 -1
  508. package/dist/esm/node_modules/buffer/index.mjs +0 -1114
  509. package/dist/esm/node_modules/buffer/index.mjs.map +0 -1
  510. package/dist/esm/node_modules/call-bind/index.mjs +0 -26
  511. package/dist/esm/node_modules/call-bind/index.mjs.map +0 -1
  512. package/dist/esm/node_modules/call-bind-apply-helpers/actualApply.mjs +0 -21
  513. package/dist/esm/node_modules/call-bind-apply-helpers/actualApply.mjs.map +0 -1
  514. package/dist/esm/node_modules/call-bind-apply-helpers/applyBind.mjs +0 -21
  515. package/dist/esm/node_modules/call-bind-apply-helpers/applyBind.mjs.map +0 -1
  516. package/dist/esm/node_modules/call-bind-apply-helpers/functionApply.mjs +0 -13
  517. package/dist/esm/node_modules/call-bind-apply-helpers/functionApply.mjs.map +0 -1
  518. package/dist/esm/node_modules/call-bind-apply-helpers/functionCall.mjs +0 -13
  519. package/dist/esm/node_modules/call-bind-apply-helpers/functionCall.mjs.map +0 -1
  520. package/dist/esm/node_modules/call-bind-apply-helpers/index.mjs +0 -24
  521. package/dist/esm/node_modules/call-bind-apply-helpers/index.mjs.map +0 -1
  522. package/dist/esm/node_modules/call-bind-apply-helpers/reflectApply.mjs +0 -13
  523. package/dist/esm/node_modules/call-bind-apply-helpers/reflectApply.mjs.map +0 -1
  524. package/dist/esm/node_modules/call-bound/index.mjs +0 -23
  525. package/dist/esm/node_modules/call-bound/index.mjs.map +0 -1
  526. package/dist/esm/node_modules/camelcase/index.mjs +0 -75
  527. package/dist/esm/node_modules/camelcase/index.mjs.map +0 -1
  528. package/dist/esm/node_modules/define-data-property/index.mjs +0 -41
  529. package/dist/esm/node_modules/define-data-property/index.mjs.map +0 -1
  530. package/dist/esm/node_modules/dunder-proto/get.mjs +0 -28
  531. package/dist/esm/node_modules/dunder-proto/get.mjs.map +0 -1
  532. package/dist/esm/node_modules/es-define-property/index.mjs +0 -19
  533. package/dist/esm/node_modules/es-define-property/index.mjs.map +0 -1
  534. package/dist/esm/node_modules/es-errors/eval.mjs +0 -13
  535. package/dist/esm/node_modules/es-errors/eval.mjs.map +0 -1
  536. package/dist/esm/node_modules/es-errors/index.mjs +0 -13
  537. package/dist/esm/node_modules/es-errors/index.mjs.map +0 -1
  538. package/dist/esm/node_modules/es-errors/range.mjs +0 -13
  539. package/dist/esm/node_modules/es-errors/range.mjs.map +0 -1
  540. package/dist/esm/node_modules/es-errors/ref.mjs +0 -13
  541. package/dist/esm/node_modules/es-errors/ref.mjs.map +0 -1
  542. package/dist/esm/node_modules/es-errors/syntax.mjs +0 -13
  543. package/dist/esm/node_modules/es-errors/syntax.mjs.map +0 -1
  544. package/dist/esm/node_modules/es-errors/type.mjs +0 -13
  545. package/dist/esm/node_modules/es-errors/type.mjs.map +0 -1
  546. package/dist/esm/node_modules/es-errors/uri.mjs +0 -13
  547. package/dist/esm/node_modules/es-errors/uri.mjs.map +0 -1
  548. package/dist/esm/node_modules/es-object-atoms/index.mjs +0 -13
  549. package/dist/esm/node_modules/es-object-atoms/index.mjs.map +0 -1
  550. package/dist/esm/node_modules/escape-html/index.mjs +0 -68
  551. package/dist/esm/node_modules/escape-html/index.mjs.map +0 -1
  552. package/dist/esm/node_modules/fast-xml-parser/src/fxp.mjs +0 -8
  553. package/dist/esm/node_modules/fast-xml-parser/src/fxp.mjs.map +0 -1
  554. package/dist/esm/node_modules/fast-xml-parser/src/util.mjs +0 -26
  555. package/dist/esm/node_modules/fast-xml-parser/src/util.mjs.map +0 -1
  556. package/dist/esm/node_modules/fast-xml-parser/src/validator.mjs +0 -243
  557. package/dist/esm/node_modules/fast-xml-parser/src/validator.mjs.map +0 -1
  558. package/dist/esm/node_modules/for-each/index.mjs +0 -43
  559. package/dist/esm/node_modules/for-each/index.mjs.map +0 -1
  560. package/dist/esm/node_modules/function-bind/implementation.mjs +0 -59
  561. package/dist/esm/node_modules/function-bind/implementation.mjs.map +0 -1
  562. package/dist/esm/node_modules/function-bind/index.mjs +0 -14
  563. package/dist/esm/node_modules/function-bind/index.mjs.map +0 -1
  564. package/dist/esm/node_modules/generator-function/index.mjs +0 -14
  565. package/dist/esm/node_modules/generator-function/index.mjs.map +0 -1
  566. package/dist/esm/node_modules/get-intrinsic/index.mjs +0 -358
  567. package/dist/esm/node_modules/get-intrinsic/index.mjs.map +0 -1
  568. package/dist/esm/node_modules/get-proto/Object.getPrototypeOf.mjs +0 -15
  569. package/dist/esm/node_modules/get-proto/Object.getPrototypeOf.mjs.map +0 -1
  570. package/dist/esm/node_modules/get-proto/Reflect.getPrototypeOf.mjs +0 -13
  571. package/dist/esm/node_modules/get-proto/Reflect.getPrototypeOf.mjs.map +0 -1
  572. package/dist/esm/node_modules/get-proto/index.mjs +0 -26
  573. package/dist/esm/node_modules/get-proto/index.mjs.map +0 -1
  574. package/dist/esm/node_modules/gopd/gOPD.mjs +0 -13
  575. package/dist/esm/node_modules/gopd/gOPD.mjs.map +0 -1
  576. package/dist/esm/node_modules/gopd/index.mjs +0 -20
  577. package/dist/esm/node_modules/gopd/index.mjs.map +0 -1
  578. package/dist/esm/node_modules/has-property-descriptors/index.mjs +0 -25
  579. package/dist/esm/node_modules/has-property-descriptors/index.mjs.map +0 -1
  580. package/dist/esm/node_modules/has-symbols/index.mjs +0 -22
  581. package/dist/esm/node_modules/has-symbols/index.mjs.map +0 -1
  582. package/dist/esm/node_modules/has-symbols/shams.mjs +0 -36
  583. package/dist/esm/node_modules/has-symbols/shams.mjs.map +0 -1
  584. package/dist/esm/node_modules/has-tostringtag/shams.mjs +0 -17
  585. package/dist/esm/node_modules/has-tostringtag/shams.mjs.map +0 -1
  586. package/dist/esm/node_modules/hasown/index.mjs +0 -17
  587. package/dist/esm/node_modules/hasown/index.mjs.map +0 -1
  588. package/dist/esm/node_modules/ieee754/index.mjs +0 -80
  589. package/dist/esm/node_modules/ieee754/index.mjs.map +0 -1
  590. package/dist/esm/node_modules/inherits/inherits_browser.mjs +0 -31
  591. package/dist/esm/node_modules/inherits/inherits_browser.mjs.map +0 -1
  592. package/dist/esm/node_modules/is-arguments/index.mjs +0 -31
  593. package/dist/esm/node_modules/is-arguments/index.mjs.map +0 -1
  594. package/dist/esm/node_modules/is-callable/index.mjs +0 -87
  595. package/dist/esm/node_modules/is-callable/index.mjs.map +0 -1
  596. package/dist/esm/node_modules/is-generator-function/index.mjs +0 -32
  597. package/dist/esm/node_modules/is-generator-function/index.mjs.map +0 -1
  598. package/dist/esm/node_modules/is-regex/index.mjs +0 -58
  599. package/dist/esm/node_modules/is-regex/index.mjs.map +0 -1
  600. package/dist/esm/node_modules/is-typed-array/index.mjs +0 -17
  601. package/dist/esm/node_modules/is-typed-array/index.mjs.map +0 -1
  602. package/dist/esm/node_modules/jose/dist/webapi/lib/base64.mjs +0 -12
  603. package/dist/esm/node_modules/jose/dist/webapi/lib/base64.mjs.map +0 -1
  604. package/dist/esm/node_modules/jose/dist/webapi/lib/buffer_utils.mjs +0 -8
  605. package/dist/esm/node_modules/jose/dist/webapi/lib/buffer_utils.mjs.map +0 -1
  606. package/dist/esm/node_modules/jose/dist/webapi/lib/is_object.mjs +0 -15
  607. package/dist/esm/node_modules/jose/dist/webapi/lib/is_object.mjs.map +0 -1
  608. package/dist/esm/node_modules/jose/dist/webapi/util/base64url.mjs +0 -19
  609. package/dist/esm/node_modules/jose/dist/webapi/util/base64url.mjs.map +0 -1
  610. package/dist/esm/node_modules/jose/dist/webapi/util/decode_jwt.mjs +0 -31
  611. package/dist/esm/node_modules/jose/dist/webapi/util/decode_jwt.mjs.map +0 -1
  612. package/dist/esm/node_modules/jose/dist/webapi/util/errors.mjs +0 -26
  613. package/dist/esm/node_modules/jose/dist/webapi/util/errors.mjs.map +0 -1
  614. package/dist/esm/node_modules/math-intrinsics/abs.mjs +0 -13
  615. package/dist/esm/node_modules/math-intrinsics/abs.mjs.map +0 -1
  616. package/dist/esm/node_modules/math-intrinsics/floor.mjs +0 -13
  617. package/dist/esm/node_modules/math-intrinsics/floor.mjs.map +0 -1
  618. package/dist/esm/node_modules/math-intrinsics/isNaN.mjs +0 -15
  619. package/dist/esm/node_modules/math-intrinsics/isNaN.mjs.map +0 -1
  620. package/dist/esm/node_modules/math-intrinsics/max.mjs +0 -13
  621. package/dist/esm/node_modules/math-intrinsics/max.mjs.map +0 -1
  622. package/dist/esm/node_modules/math-intrinsics/min.mjs +0 -13
  623. package/dist/esm/node_modules/math-intrinsics/min.mjs.map +0 -1
  624. package/dist/esm/node_modules/math-intrinsics/pow.mjs +0 -13
  625. package/dist/esm/node_modules/math-intrinsics/pow.mjs.map +0 -1
  626. package/dist/esm/node_modules/math-intrinsics/round.mjs +0 -13
  627. package/dist/esm/node_modules/math-intrinsics/round.mjs.map +0 -1
  628. package/dist/esm/node_modules/math-intrinsics/sign.mjs +0 -18
  629. package/dist/esm/node_modules/math-intrinsics/sign.mjs.map +0 -1
  630. package/dist/esm/node_modules/node-forge/lib/aes.mjs +0 -601
  631. package/dist/esm/node_modules/node-forge/lib/aes.mjs.map +0 -1
  632. package/dist/esm/node_modules/node-forge/lib/aesCipherSuites.mjs +0 -199
  633. package/dist/esm/node_modules/node-forge/lib/aesCipherSuites.mjs.map +0 -1
  634. package/dist/esm/node_modules/node-forge/lib/asn1-validator.mjs +0 -80
  635. package/dist/esm/node_modules/node-forge/lib/asn1-validator.mjs.map +0 -1
  636. package/dist/esm/node_modules/node-forge/lib/asn1.mjs +0 -942
  637. package/dist/esm/node_modules/node-forge/lib/asn1.mjs.map +0 -1
  638. package/dist/esm/node_modules/node-forge/lib/baseN.mjs +0 -141
  639. package/dist/esm/node_modules/node-forge/lib/baseN.mjs.map +0 -1
  640. package/dist/esm/node_modules/node-forge/lib/cipher.mjs +0 -190
  641. package/dist/esm/node_modules/node-forge/lib/cipher.mjs.map +0 -1
  642. package/dist/esm/node_modules/node-forge/lib/cipherModes.mjs +0 -601
  643. package/dist/esm/node_modules/node-forge/lib/cipherModes.mjs.map +0 -1
  644. package/dist/esm/node_modules/node-forge/lib/des.mjs +0 -1191
  645. package/dist/esm/node_modules/node-forge/lib/des.mjs.map +0 -1
  646. package/dist/esm/node_modules/node-forge/lib/ed25519.mjs +0 -1024
  647. package/dist/esm/node_modules/node-forge/lib/ed25519.mjs.map +0 -1
  648. package/dist/esm/node_modules/node-forge/lib/forge.mjs +0 -19
  649. package/dist/esm/node_modules/node-forge/lib/forge.mjs.map +0 -1
  650. package/dist/esm/node_modules/node-forge/lib/hmac.mjs +0 -111
  651. package/dist/esm/node_modules/node-forge/lib/hmac.mjs.map +0 -1
  652. package/dist/esm/node_modules/node-forge/lib/index.mjs +0 -70
  653. package/dist/esm/node_modules/node-forge/lib/index.mjs.map +0 -1
  654. package/dist/esm/node_modules/node-forge/lib/jsbn.mjs +0 -1260
  655. package/dist/esm/node_modules/node-forge/lib/jsbn.mjs.map +0 -1
  656. package/dist/esm/node_modules/node-forge/lib/kem.mjs +0 -150
  657. package/dist/esm/node_modules/node-forge/lib/kem.mjs.map +0 -1
  658. package/dist/esm/node_modules/node-forge/lib/log.mjs +0 -245
  659. package/dist/esm/node_modules/node-forge/lib/log.mjs.map +0 -1
  660. package/dist/esm/node_modules/node-forge/lib/md.all.mjs +0 -28
  661. package/dist/esm/node_modules/node-forge/lib/md.all.mjs.map +0 -1
  662. package/dist/esm/node_modules/node-forge/lib/md.mjs +0 -22
  663. package/dist/esm/node_modules/node-forge/lib/md.mjs.map +0 -1
  664. package/dist/esm/node_modules/node-forge/lib/md5.mjs +0 -328
  665. package/dist/esm/node_modules/node-forge/lib/md5.mjs.map +0 -1
  666. package/dist/esm/node_modules/node-forge/lib/mgf.mjs +0 -24
  667. package/dist/esm/node_modules/node-forge/lib/mgf.mjs.map +0 -1
  668. package/dist/esm/node_modules/node-forge/lib/mgf1.mjs +0 -48
  669. package/dist/esm/node_modules/node-forge/lib/mgf1.mjs.map +0 -1
  670. package/dist/esm/node_modules/node-forge/lib/oids.mjs +0 -157
  671. package/dist/esm/node_modules/node-forge/lib/oids.mjs.map +0 -1
  672. package/dist/esm/node_modules/node-forge/lib/pbe.mjs +0 -819
  673. package/dist/esm/node_modules/node-forge/lib/pbe.mjs.map +0 -1
  674. package/dist/esm/node_modules/node-forge/lib/pbkdf2.mjs +0 -130
  675. package/dist/esm/node_modules/node-forge/lib/pbkdf2.mjs.map +0 -1
  676. package/dist/esm/node_modules/node-forge/lib/pem.mjs +0 -179
  677. package/dist/esm/node_modules/node-forge/lib/pem.mjs.map +0 -1
  678. package/dist/esm/node_modules/node-forge/lib/pkcs1.mjs +0 -204
  679. package/dist/esm/node_modules/node-forge/lib/pkcs1.mjs.map +0 -1
  680. package/dist/esm/node_modules/node-forge/lib/pkcs12.mjs +0 -727
  681. package/dist/esm/node_modules/node-forge/lib/pkcs12.mjs.map +0 -1
  682. package/dist/esm/node_modules/node-forge/lib/pkcs7.mjs +0 -645
  683. package/dist/esm/node_modules/node-forge/lib/pkcs7.mjs.map +0 -1
  684. package/dist/esm/node_modules/node-forge/lib/pkcs7asn1.mjs +0 -409
  685. package/dist/esm/node_modules/node-forge/lib/pkcs7asn1.mjs.map +0 -1
  686. package/dist/esm/node_modules/node-forge/lib/pki.mjs +0 -105
  687. package/dist/esm/node_modules/node-forge/lib/pki.mjs.map +0 -1
  688. package/dist/esm/node_modules/node-forge/lib/prime.mjs +0 -197
  689. package/dist/esm/node_modules/node-forge/lib/prime.mjs.map +0 -1
  690. package/dist/esm/node_modules/node-forge/lib/prng.mjs +0 -295
  691. package/dist/esm/node_modules/node-forge/lib/prng.mjs.map +0 -1
  692. package/dist/esm/node_modules/node-forge/lib/pss.mjs +0 -145
  693. package/dist/esm/node_modules/node-forge/lib/pss.mjs.map +0 -1
  694. package/dist/esm/node_modules/node-forge/lib/random.mjs +0 -145
  695. package/dist/esm/node_modules/node-forge/lib/random.mjs.map +0 -1
  696. package/dist/esm/node_modules/node-forge/lib/rc2.mjs +0 -542
  697. package/dist/esm/node_modules/node-forge/lib/rc2.mjs.map +0 -1
  698. package/dist/esm/node_modules/node-forge/lib/rsa.mjs +0 -1304
  699. package/dist/esm/node_modules/node-forge/lib/rsa.mjs.map +0 -1
  700. package/dist/esm/node_modules/node-forge/lib/sha1.mjs +0 -234
  701. package/dist/esm/node_modules/node-forge/lib/sha1.mjs.map +0 -1
  702. package/dist/esm/node_modules/node-forge/lib/sha256.mjs +0 -271
  703. package/dist/esm/node_modules/node-forge/lib/sha256.mjs.map +0 -1
  704. package/dist/esm/node_modules/node-forge/lib/sha512.mjs +0 -417
  705. package/dist/esm/node_modules/node-forge/lib/sha512.mjs.map +0 -1
  706. package/dist/esm/node_modules/node-forge/lib/ssh.mjs +0 -198
  707. package/dist/esm/node_modules/node-forge/lib/ssh.mjs.map +0 -1
  708. package/dist/esm/node_modules/node-forge/lib/tls.mjs +0 -3659
  709. package/dist/esm/node_modules/node-forge/lib/tls.mjs.map +0 -1
  710. package/dist/esm/node_modules/node-forge/lib/util.mjs +0 -2121
  711. package/dist/esm/node_modules/node-forge/lib/util.mjs.map +0 -1
  712. package/dist/esm/node_modules/node-forge/lib/x509.mjs +0 -2168
  713. package/dist/esm/node_modules/node-forge/lib/x509.mjs.map +0 -1
  714. package/dist/esm/node_modules/node-forge/lib.mjs +0 -10
  715. package/dist/esm/node_modules/node-forge/lib.mjs.map +0 -1
  716. package/dist/esm/node_modules/node-rsa/src/NodeRSA.mjs +0 -338
  717. package/dist/esm/node_modules/node-rsa/src/NodeRSA.mjs.map +0 -1
  718. package/dist/esm/node_modules/node-rsa/src/encryptEngines/encryptEngines.mjs +0 -23
  719. package/dist/esm/node_modules/node-rsa/src/encryptEngines/encryptEngines.mjs.map +0 -1
  720. package/dist/esm/node_modules/node-rsa/src/encryptEngines/io.mjs +0 -62
  721. package/dist/esm/node_modules/node-rsa/src/encryptEngines/io.mjs.map +0 -1
  722. package/dist/esm/node_modules/node-rsa/src/encryptEngines/js.mjs +0 -41
  723. package/dist/esm/node_modules/node-rsa/src/encryptEngines/js.mjs.map +0 -1
  724. package/dist/esm/node_modules/node-rsa/src/encryptEngines/node12.mjs +0 -46
  725. package/dist/esm/node_modules/node-rsa/src/encryptEngines/node12.mjs.map +0 -1
  726. package/dist/esm/node_modules/node-rsa/src/formats/components.mjs +0 -52
  727. package/dist/esm/node_modules/node-rsa/src/formats/components.mjs.map +0 -1
  728. package/dist/esm/node_modules/node-rsa/src/formats/formats.mjs +0 -83
  729. package/dist/esm/node_modules/node-rsa/src/formats/formats.mjs.map +0 -1
  730. package/dist/esm/node_modules/node-rsa/src/formats/openssh.mjs +0 -174
  731. package/dist/esm/node_modules/node-rsa/src/formats/openssh.mjs.map +0 -1
  732. package/dist/esm/node_modules/node-rsa/src/formats/pkcs1.mjs +0 -101
  733. package/dist/esm/node_modules/node-rsa/src/formats/pkcs1.mjs.map +0 -1
  734. package/dist/esm/node_modules/node-rsa/src/formats/pkcs8.mjs +0 -128
  735. package/dist/esm/node_modules/node-rsa/src/formats/pkcs8.mjs.map +0 -1
  736. package/dist/esm/node_modules/node-rsa/src/libs/jsbn.mjs +0 -1344
  737. package/dist/esm/node_modules/node-rsa/src/libs/jsbn.mjs.map +0 -1
  738. package/dist/esm/node_modules/node-rsa/src/libs/rsa.mjs +0 -228
  739. package/dist/esm/node_modules/node-rsa/src/libs/rsa.mjs.map +0 -1
  740. package/dist/esm/node_modules/node-rsa/src/schemes/oaep.mjs +0 -120
  741. package/dist/esm/node_modules/node-rsa/src/schemes/oaep.mjs.map +0 -1
  742. package/dist/esm/node_modules/node-rsa/src/schemes/pkcs1.mjs +0 -172
  743. package/dist/esm/node_modules/node-rsa/src/schemes/pkcs1.mjs.map +0 -1
  744. package/dist/esm/node_modules/node-rsa/src/schemes/pss.mjs +0 -120
  745. package/dist/esm/node_modules/node-rsa/src/schemes/pss.mjs.map +0 -1
  746. package/dist/esm/node_modules/node-rsa/src/schemes/schemes.mjs +0 -25
  747. package/dist/esm/node_modules/node-rsa/src/schemes/schemes.mjs.map +0 -1
  748. package/dist/esm/node_modules/node-rsa/src/utils.mjs +0 -81
  749. package/dist/esm/node_modules/node-rsa/src/utils.mjs.map +0 -1
  750. package/dist/esm/node_modules/pako/index.mjs +0 -22
  751. package/dist/esm/node_modules/pako/index.mjs.map +0 -1
  752. package/dist/esm/node_modules/pako/lib/deflate.mjs +0 -308
  753. package/dist/esm/node_modules/pako/lib/deflate.mjs.map +0 -1
  754. package/dist/esm/node_modules/pako/lib/inflate.mjs +0 -314
  755. package/dist/esm/node_modules/pako/lib/inflate.mjs.map +0 -1
  756. package/dist/esm/node_modules/pako/lib/utils/common.mjs +0 -74
  757. package/dist/esm/node_modules/pako/lib/utils/common.mjs.map +0 -1
  758. package/dist/esm/node_modules/pako/lib/utils/strings.mjs +0 -128
  759. package/dist/esm/node_modules/pako/lib/utils/strings.mjs.map +0 -1
  760. package/dist/esm/node_modules/pako/lib/zlib/adler32.mjs +0 -26
  761. package/dist/esm/node_modules/pako/lib/zlib/adler32.mjs.map +0 -1
  762. package/dist/esm/node_modules/pako/lib/zlib/constants.mjs +0 -40
  763. package/dist/esm/node_modules/pako/lib/zlib/constants.mjs.map +0 -1
  764. package/dist/esm/node_modules/pako/lib/zlib/crc32.mjs +0 -28
  765. package/dist/esm/node_modules/pako/lib/zlib/crc32.mjs.map +0 -1
  766. package/dist/esm/node_modules/pako/lib/zlib/deflate.mjs +0 -886
  767. package/dist/esm/node_modules/pako/lib/zlib/deflate.mjs.map +0 -1
  768. package/dist/esm/node_modules/pako/lib/zlib/gzheader.mjs +0 -24
  769. package/dist/esm/node_modules/pako/lib/zlib/gzheader.mjs.map +0 -1
  770. package/dist/esm/node_modules/pako/lib/zlib/inffast.mjs +0 -224
  771. package/dist/esm/node_modules/pako/lib/zlib/inffast.mjs.map +0 -1
  772. package/dist/esm/node_modules/pako/lib/zlib/inflate.mjs +0 -1035
  773. package/dist/esm/node_modules/pako/lib/zlib/inflate.mjs.map +0 -1
  774. package/dist/esm/node_modules/pako/lib/zlib/inftrees.mjs +0 -275
  775. package/dist/esm/node_modules/pako/lib/zlib/inftrees.mjs.map +0 -1
  776. package/dist/esm/node_modules/pako/lib/zlib/messages.mjs +0 -22
  777. package/dist/esm/node_modules/pako/lib/zlib/messages.mjs.map +0 -1
  778. package/dist/esm/node_modules/pako/lib/zlib/trees.mjs +0 -623
  779. package/dist/esm/node_modules/pako/lib/zlib/trees.mjs.map +0 -1
  780. package/dist/esm/node_modules/pako/lib/zlib/zstream.mjs +0 -26
  781. package/dist/esm/node_modules/pako/lib/zlib/zstream.mjs.map +0 -1
  782. package/dist/esm/node_modules/possible-typed-array-names/index.mjs +0 -26
  783. package/dist/esm/node_modules/possible-typed-array-names/index.mjs.map +0 -1
  784. package/dist/esm/node_modules/safe-regex-test/index.mjs +0 -25
  785. package/dist/esm/node_modules/safe-regex-test/index.mjs.map +0 -1
  786. package/dist/esm/node_modules/safer-buffer/safer.mjs +0 -50
  787. package/dist/esm/node_modules/safer-buffer/safer.mjs.map +0 -1
  788. package/dist/esm/node_modules/samlify/build/index.mjs +0 -117
  789. package/dist/esm/node_modules/samlify/build/index.mjs.map +0 -1
  790. package/dist/esm/node_modules/samlify/build/src/api.mjs +0 -33
  791. package/dist/esm/node_modules/samlify/build/src/api.mjs.map +0 -1
  792. package/dist/esm/node_modules/samlify/build/src/binding-post.mjs +0 -504
  793. package/dist/esm/node_modules/samlify/build/src/binding-post.mjs.map +0 -1
  794. package/dist/esm/node_modules/samlify/build/src/binding-redirect.mjs +0 -339
  795. package/dist/esm/node_modules/samlify/build/src/binding-redirect.mjs.map +0 -1
  796. package/dist/esm/node_modules/samlify/build/src/binding-simplesign.mjs +0 -358
  797. package/dist/esm/node_modules/samlify/build/src/binding-simplesign.mjs.map +0 -1
  798. package/dist/esm/node_modules/samlify/build/src/entity-idp.mjs +0 -279
  799. package/dist/esm/node_modules/samlify/build/src/entity-idp.mjs.map +0 -1
  800. package/dist/esm/node_modules/samlify/build/src/entity-sp.mjs +0 -142
  801. package/dist/esm/node_modules/samlify/build/src/entity-sp.mjs.map +0 -1
  802. package/dist/esm/node_modules/samlify/build/src/entity.mjs +0 -253
  803. package/dist/esm/node_modules/samlify/build/src/entity.mjs.map +0 -1
  804. package/dist/esm/node_modules/samlify/build/src/extractor.mjs +0 -352
  805. package/dist/esm/node_modules/samlify/build/src/extractor.mjs.map +0 -1
  806. package/dist/esm/node_modules/samlify/build/src/flow.mjs +0 -389
  807. package/dist/esm/node_modules/samlify/build/src/flow.mjs.map +0 -1
  808. package/dist/esm/node_modules/samlify/build/src/libsaml.mjs +0 -544
  809. package/dist/esm/node_modules/samlify/build/src/libsaml.mjs.map +0 -1
  810. package/dist/esm/node_modules/samlify/build/src/metadata-idp.mjs +0 -171
  811. package/dist/esm/node_modules/samlify/build/src/metadata-idp.mjs.map +0 -1
  812. package/dist/esm/node_modules/samlify/build/src/metadata-sp.mjs +0 -214
  813. package/dist/esm/node_modules/samlify/build/src/metadata-sp.mjs.map +0 -1
  814. package/dist/esm/node_modules/samlify/build/src/metadata.mjs +0 -200
  815. package/dist/esm/node_modules/samlify/build/src/metadata.mjs.map +0 -1
  816. package/dist/esm/node_modules/samlify/build/src/urn.mjs +0 -225
  817. package/dist/esm/node_modules/samlify/build/src/urn.mjs.map +0 -1
  818. package/dist/esm/node_modules/samlify/build/src/utility.mjs +0 -277
  819. package/dist/esm/node_modules/samlify/build/src/utility.mjs.map +0 -1
  820. package/dist/esm/node_modules/samlify/build/src/validator.mjs +0 -53
  821. package/dist/esm/node_modules/samlify/build/src/validator.mjs.map +0 -1
  822. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/index.mjs +0 -39
  823. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/index.mjs.map +0 -1
  824. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/md5.mjs +0 -154
  825. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/md5.mjs.map +0 -1
  826. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/nil.mjs +0 -12
  827. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/nil.mjs.map +0 -1
  828. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/parse.mjs +0 -36
  829. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/parse.mjs.map +0 -1
  830. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/regex.mjs +0 -12
  831. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/regex.mjs.map +0 -1
  832. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/rng.mjs +0 -20
  833. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/rng.mjs.map +0 -1
  834. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/sha1.mjs +0 -101
  835. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/sha1.mjs.map +0 -1
  836. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -22
  837. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/stringify.mjs.map +0 -1
  838. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v1.mjs +0 -63
  839. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v1.mjs.map +0 -1
  840. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v3.mjs +0 -17
  841. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v3.mjs.map +0 -1
  842. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v35.mjs +0 -48
  843. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v35.mjs.map +0 -1
  844. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v4.mjs +0 -28
  845. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v4.mjs.map +0 -1
  846. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v5.mjs +0 -17
  847. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v5.mjs.map +0 -1
  848. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/validate.mjs +0 -17
  849. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/validate.mjs.map +0 -1
  850. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/version.mjs +0 -18
  851. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/version.mjs.map +0 -1
  852. package/dist/esm/node_modules/set-function-length/index.mjs +0 -38
  853. package/dist/esm/node_modules/set-function-length/index.mjs.map +0 -1
  854. package/dist/esm/node_modules/util/support/isBufferBrowser.mjs +0 -14
  855. package/dist/esm/node_modules/util/support/isBufferBrowser.mjs.map +0 -1
  856. package/dist/esm/node_modules/util/support/types.mjs +0 -218
  857. package/dist/esm/node_modules/util/support/types.mjs.map +0 -1
  858. package/dist/esm/node_modules/util/util.mjs +0 -443
  859. package/dist/esm/node_modules/util/util.mjs.map +0 -1
  860. package/dist/esm/node_modules/which-typed-array/index.mjs +0 -93
  861. package/dist/esm/node_modules/which-typed-array/index.mjs.map +0 -1
  862. package/dist/esm/node_modules/xml/lib/escapeForXML.mjs +0 -24
  863. package/dist/esm/node_modules/xml/lib/escapeForXML.mjs.map +0 -1
  864. package/dist/esm/node_modules/xml/lib/xml.mjs +0 -183
  865. package/dist/esm/node_modules/xml/lib/xml.mjs.map +0 -1
  866. package/dist/esm/node_modules/xml-crypto/lib/c14n-canonicalization.mjs +0 -199
  867. package/dist/esm/node_modules/xml-crypto/lib/c14n-canonicalization.mjs.map +0 -1
  868. package/dist/esm/node_modules/xml-crypto/lib/enveloped-signature.mjs +0 -49
  869. package/dist/esm/node_modules/xml-crypto/lib/enveloped-signature.mjs.map +0 -1
  870. package/dist/esm/node_modules/xml-crypto/lib/exclusive-canonicalization.mjs +0 -220
  871. package/dist/esm/node_modules/xml-crypto/lib/exclusive-canonicalization.mjs.map +0 -1
  872. package/dist/esm/node_modules/xml-crypto/lib/hash-algorithms.mjs +0 -53
  873. package/dist/esm/node_modules/xml-crypto/lib/hash-algorithms.mjs.map +0 -1
  874. package/dist/esm/node_modules/xml-crypto/lib/index.mjs +0 -70
  875. package/dist/esm/node_modules/xml-crypto/lib/index.mjs.map +0 -1
  876. package/dist/esm/node_modules/xml-crypto/lib/signature-algorithms.mjs +0 -88
  877. package/dist/esm/node_modules/xml-crypto/lib/signature-algorithms.mjs.map +0 -1
  878. package/dist/esm/node_modules/xml-crypto/lib/signed-xml.mjs +0 -693
  879. package/dist/esm/node_modules/xml-crypto/lib/signed-xml.mjs.map +0 -1
  880. package/dist/esm/node_modules/xml-crypto/lib/types.mjs +0 -55
  881. package/dist/esm/node_modules/xml-crypto/lib/types.mjs.map +0 -1
  882. package/dist/esm/node_modules/xml-crypto/lib/utils.mjs +0 -210
  883. package/dist/esm/node_modules/xml-crypto/lib/utils.mjs.map +0 -1
  884. package/dist/esm/node_modules/xml-crypto/node_modules/xpath/xpath.mjs +0 -3442
  885. package/dist/esm/node_modules/xml-crypto/node_modules/xpath/xpath.mjs.map +0 -1
  886. package/dist/esm/node_modules/xml-escape/index.mjs +0 -27
  887. package/dist/esm/node_modules/xml-escape/index.mjs.map +0 -1
  888. package/dist/esm/node_modules/xpath/xpath.mjs +0 -3407
  889. package/dist/esm/node_modules/xpath/xpath.mjs.map +0 -1
  890. package/dist/esm/node_modules/zod/v4/classic/errors.mjs +0 -30
  891. package/dist/esm/node_modules/zod/v4/classic/errors.mjs.map +0 -1
  892. package/dist/esm/node_modules/zod/v4/classic/iso.mjs +0 -38
  893. package/dist/esm/node_modules/zod/v4/classic/iso.mjs.map +0 -1
  894. package/dist/esm/node_modules/zod/v4/classic/parse.mjs +0 -20
  895. package/dist/esm/node_modules/zod/v4/classic/parse.mjs.map +0 -1
  896. package/dist/esm/node_modules/zod/v4/classic/schemas.mjs +0 -519
  897. package/dist/esm/node_modules/zod/v4/classic/schemas.mjs.map +0 -1
  898. package/dist/esm/node_modules/zod/v4/core/api.mjs +0 -395
  899. package/dist/esm/node_modules/zod/v4/core/api.mjs.map +0 -1
  900. package/dist/esm/node_modules/zod/v4/core/checks.mjs +0 -226
  901. package/dist/esm/node_modules/zod/v4/core/checks.mjs.map +0 -1
  902. package/dist/esm/node_modules/zod/v4/core/core.mjs +0 -57
  903. package/dist/esm/node_modules/zod/v4/core/core.mjs.map +0 -1
  904. package/dist/esm/node_modules/zod/v4/core/doc.mjs +0 -34
  905. package/dist/esm/node_modules/zod/v4/core/doc.mjs.map +0 -1
  906. package/dist/esm/node_modules/zod/v4/core/errors.mjs +0 -63
  907. package/dist/esm/node_modules/zod/v4/core/errors.mjs.map +0 -1
  908. package/dist/esm/node_modules/zod/v4/core/parse.mjs +0 -110
  909. package/dist/esm/node_modules/zod/v4/core/parse.mjs.map +0 -1
  910. package/dist/esm/node_modules/zod/v4/core/regexes.mjs +0 -60
  911. package/dist/esm/node_modules/zod/v4/core/regexes.mjs.map +0 -1
  912. package/dist/esm/node_modules/zod/v4/core/registries.mjs +0 -53
  913. package/dist/esm/node_modules/zod/v4/core/registries.mjs.map +0 -1
  914. package/dist/esm/node_modules/zod/v4/core/schemas.mjs +0 -1069
  915. package/dist/esm/node_modules/zod/v4/core/schemas.mjs.map +0 -1
  916. package/dist/esm/node_modules/zod/v4/core/util.mjs +0 -302
  917. package/dist/esm/node_modules/zod/v4/core/util.mjs.map +0 -1
  918. package/dist/esm/node_modules/zod/v4/core/versions.mjs +0 -10
  919. package/dist/esm/node_modules/zod/v4/core/versions.mjs.map +0 -1
  920. package/dist/types/MagicLinkEmail.d.ts +0 -8
  921. package/dist/types/MagicLinkEmail.d.ts.map +0 -1
  922. package/dist/types/controllers/audit.controller.d.ts +0 -32
  923. package/dist/types/controllers/audit.controller.d.ts.map +0 -1
  924. package/dist/types/models/audit.model.d.ts +0 -5
  925. package/dist/types/models/audit.model.d.ts.map +0 -1
@@ -1,3659 +0,0 @@
1
- import { __commonJS } from "../../../_virtual/rolldown_runtime.mjs";
2
- import { require_forge } from "./forge.mjs";
3
- import { require_util } from "./util.mjs";
4
- import { require_asn1 } from "./asn1.mjs";
5
- import { require_hmac } from "./hmac.mjs";
6
- import { require_md5 } from "./md5.mjs";
7
- import { require_pem } from "./pem.mjs";
8
- import { require_random } from "./random.mjs";
9
- import { require_sha1 } from "./sha1.mjs";
10
- import { require_pki } from "./pki.mjs";
11
-
12
- //#region ../../node_modules/node-forge/lib/tls.js
13
- var require_tls = /* @__PURE__ */ __commonJS({ "../../node_modules/node-forge/lib/tls.js": ((exports, module) => {
14
- /**
15
- * A Javascript implementation of Transport Layer Security (TLS).
16
- *
17
- * @author Dave Longley
18
- *
19
- * Copyright (c) 2009-2014 Digital Bazaar, Inc.
20
- *
21
- * The TLS Handshake Protocol involves the following steps:
22
- *
23
- * - Exchange hello messages to agree on algorithms, exchange random values,
24
- * and check for session resumption.
25
- *
26
- * - Exchange the necessary cryptographic parameters to allow the client and
27
- * server to agree on a premaster secret.
28
- *
29
- * - Exchange certificates and cryptographic information to allow the client
30
- * and server to authenticate themselves.
31
- *
32
- * - Generate a master secret from the premaster secret and exchanged random
33
- * values.
34
- *
35
- * - Provide security parameters to the record layer.
36
- *
37
- * - Allow the client and server to verify that their peer has calculated the
38
- * same security parameters and that the handshake occurred without tampering
39
- * by an attacker.
40
- *
41
- * Up to 4 different messages may be sent during a key exchange. The server
42
- * certificate, the server key exchange, the client certificate, and the
43
- * client key exchange.
44
- *
45
- * A typical handshake (from the client's perspective).
46
- *
47
- * 1. Client sends ClientHello.
48
- * 2. Client receives ServerHello.
49
- * 3. Client receives optional Certificate.
50
- * 4. Client receives optional ServerKeyExchange.
51
- * 5. Client receives ServerHelloDone.
52
- * 6. Client sends optional Certificate.
53
- * 7. Client sends ClientKeyExchange.
54
- * 8. Client sends optional CertificateVerify.
55
- * 9. Client sends ChangeCipherSpec.
56
- * 10. Client sends Finished.
57
- * 11. Client receives ChangeCipherSpec.
58
- * 12. Client receives Finished.
59
- * 13. Client sends/receives application data.
60
- *
61
- * To reuse an existing session:
62
- *
63
- * 1. Client sends ClientHello with session ID for reuse.
64
- * 2. Client receives ServerHello with same session ID if reusing.
65
- * 3. Client receives ChangeCipherSpec message if reusing.
66
- * 4. Client receives Finished.
67
- * 5. Client sends ChangeCipherSpec.
68
- * 6. Client sends Finished.
69
- *
70
- * Note: Client ignores HelloRequest if in the middle of a handshake.
71
- *
72
- * Record Layer:
73
- *
74
- * The record layer fragments information blocks into TLSPlaintext records
75
- * carrying data in chunks of 2^14 bytes or less. Client message boundaries are
76
- * not preserved in the record layer (i.e., multiple client messages of the
77
- * same ContentType MAY be coalesced into a single TLSPlaintext record, or a
78
- * single message MAY be fragmented across several records).
79
- *
80
- * struct {
81
- * uint8 major;
82
- * uint8 minor;
83
- * } ProtocolVersion;
84
- *
85
- * struct {
86
- * ContentType type;
87
- * ProtocolVersion version;
88
- * uint16 length;
89
- * opaque fragment[TLSPlaintext.length];
90
- * } TLSPlaintext;
91
- *
92
- * type:
93
- * The higher-level protocol used to process the enclosed fragment.
94
- *
95
- * version:
96
- * The version of the protocol being employed. TLS Version 1.2 uses version
97
- * {3, 3}. TLS Version 1.0 uses version {3, 1}. Note that a client that
98
- * supports multiple versions of TLS may not know what version will be
99
- * employed before it receives the ServerHello.
100
- *
101
- * length:
102
- * The length (in bytes) of the following TLSPlaintext.fragment. The length
103
- * MUST NOT exceed 2^14 = 16384 bytes.
104
- *
105
- * fragment:
106
- * The application data. This data is transparent and treated as an
107
- * independent block to be dealt with by the higher-level protocol specified
108
- * by the type field.
109
- *
110
- * Implementations MUST NOT send zero-length fragments of Handshake, Alert, or
111
- * ChangeCipherSpec content types. Zero-length fragments of Application data
112
- * MAY be sent as they are potentially useful as a traffic analysis
113
- * countermeasure.
114
- *
115
- * Note: Data of different TLS record layer content types MAY be interleaved.
116
- * Application data is generally of lower precedence for transmission than
117
- * other content types. However, records MUST be delivered to the network in
118
- * the same order as they are protected by the record layer. Recipients MUST
119
- * receive and process interleaved application layer traffic during handshakes
120
- * subsequent to the first one on a connection.
121
- *
122
- * struct {
123
- * ContentType type; // same as TLSPlaintext.type
124
- * ProtocolVersion version;// same as TLSPlaintext.version
125
- * uint16 length;
126
- * opaque fragment[TLSCompressed.length];
127
- * } TLSCompressed;
128
- *
129
- * length:
130
- * The length (in bytes) of the following TLSCompressed.fragment.
131
- * The length MUST NOT exceed 2^14 + 1024.
132
- *
133
- * fragment:
134
- * The compressed form of TLSPlaintext.fragment.
135
- *
136
- * Note: A CompressionMethod.null operation is an identity operation; no fields
137
- * are altered. In this implementation, since no compression is supported,
138
- * uncompressed records are always the same as compressed records.
139
- *
140
- * Encryption Information:
141
- *
142
- * The encryption and MAC functions translate a TLSCompressed structure into a
143
- * TLSCiphertext. The decryption functions reverse the process. The MAC of the
144
- * record also includes a sequence number so that missing, extra, or repeated
145
- * messages are detectable.
146
- *
147
- * struct {
148
- * ContentType type;
149
- * ProtocolVersion version;
150
- * uint16 length;
151
- * select (SecurityParameters.cipher_type) {
152
- * case stream: GenericStreamCipher;
153
- * case block: GenericBlockCipher;
154
- * case aead: GenericAEADCipher;
155
- * } fragment;
156
- * } TLSCiphertext;
157
- *
158
- * type:
159
- * The type field is identical to TLSCompressed.type.
160
- *
161
- * version:
162
- * The version field is identical to TLSCompressed.version.
163
- *
164
- * length:
165
- * The length (in bytes) of the following TLSCiphertext.fragment.
166
- * The length MUST NOT exceed 2^14 + 2048.
167
- *
168
- * fragment:
169
- * The encrypted form of TLSCompressed.fragment, with the MAC.
170
- *
171
- * Note: Only CBC Block Ciphers are supported by this implementation.
172
- *
173
- * The TLSCompressed.fragment structures are converted to/from block
174
- * TLSCiphertext.fragment structures.
175
- *
176
- * struct {
177
- * opaque IV[SecurityParameters.record_iv_length];
178
- * block-ciphered struct {
179
- * opaque content[TLSCompressed.length];
180
- * opaque MAC[SecurityParameters.mac_length];
181
- * uint8 padding[GenericBlockCipher.padding_length];
182
- * uint8 padding_length;
183
- * };
184
- * } GenericBlockCipher;
185
- *
186
- * The MAC is generated as described in Section 6.2.3.1.
187
- *
188
- * IV:
189
- * The Initialization Vector (IV) SHOULD be chosen at random, and MUST be
190
- * unpredictable. Note that in versions of TLS prior to 1.1, there was no
191
- * IV field, and the last ciphertext block of the previous record (the "CBC
192
- * residue") was used as the IV. This was changed to prevent the attacks
193
- * described in [CBCATT]. For block ciphers, the IV length is of length
194
- * SecurityParameters.record_iv_length, which is equal to the
195
- * SecurityParameters.block_size.
196
- *
197
- * padding:
198
- * Padding that is added to force the length of the plaintext to be an
199
- * integral multiple of the block cipher's block length. The padding MAY be
200
- * any length up to 255 bytes, as long as it results in the
201
- * TLSCiphertext.length being an integral multiple of the block length.
202
- * Lengths longer than necessary might be desirable to frustrate attacks on
203
- * a protocol that are based on analysis of the lengths of exchanged
204
- * messages. Each uint8 in the padding data vector MUST be filled with the
205
- * padding length value. The receiver MUST check this padding and MUST use
206
- * the bad_record_mac alert to indicate padding errors.
207
- *
208
- * padding_length:
209
- * The padding length MUST be such that the total size of the
210
- * GenericBlockCipher structure is a multiple of the cipher's block length.
211
- * Legal values range from zero to 255, inclusive. This length specifies the
212
- * length of the padding field exclusive of the padding_length field itself.
213
- *
214
- * The encrypted data length (TLSCiphertext.length) is one more than the sum of
215
- * SecurityParameters.block_length, TLSCompressed.length,
216
- * SecurityParameters.mac_length, and padding_length.
217
- *
218
- * Example: If the block length is 8 bytes, the content length
219
- * (TLSCompressed.length) is 61 bytes, and the MAC length is 20 bytes, then the
220
- * length before padding is 82 bytes (this does not include the IV. Thus, the
221
- * padding length modulo 8 must be equal to 6 in order to make the total length
222
- * an even multiple of 8 bytes (the block length). The padding length can be
223
- * 6, 14, 22, and so on, through 254. If the padding length were the minimum
224
- * necessary, 6, the padding would be 6 bytes, each containing the value 6.
225
- * Thus, the last 8 octets of the GenericBlockCipher before block encryption
226
- * would be xx 06 06 06 06 06 06 06, where xx is the last octet of the MAC.
227
- *
228
- * Note: With block ciphers in CBC mode (Cipher Block Chaining), it is critical
229
- * that the entire plaintext of the record be known before any ciphertext is
230
- * transmitted. Otherwise, it is possible for the attacker to mount the attack
231
- * described in [CBCATT].
232
- *
233
- * Implementation note: Canvel et al. [CBCTIME] have demonstrated a timing
234
- * attack on CBC padding based on the time required to compute the MAC. In
235
- * order to defend against this attack, implementations MUST ensure that
236
- * record processing time is essentially the same whether or not the padding
237
- * is correct. In general, the best way to do this is to compute the MAC even
238
- * if the padding is incorrect, and only then reject the packet. For instance,
239
- * if the pad appears to be incorrect, the implementation might assume a
240
- * zero-length pad and then compute the MAC. This leaves a small timing
241
- * channel, since MAC performance depends, to some extent, on the size of the
242
- * data fragment, but it is not believed to be large enough to be exploitable,
243
- * due to the large block size of existing MACs and the small size of the
244
- * timing signal.
245
- */
246
- var forge = require_forge();
247
- require_asn1();
248
- require_hmac();
249
- require_md5();
250
- require_pem();
251
- require_pki();
252
- require_random();
253
- require_sha1();
254
- require_util();
255
- /**
256
- * Generates pseudo random bytes by mixing the result of two hash functions,
257
- * MD5 and SHA-1.
258
- *
259
- * prf_TLS1(secret, label, seed) =
260
- * P_MD5(S1, label + seed) XOR P_SHA-1(S2, label + seed);
261
- *
262
- * Each P_hash function functions as follows:
263
- *
264
- * P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) +
265
- * HMAC_hash(secret, A(2) + seed) +
266
- * HMAC_hash(secret, A(3) + seed) + ...
267
- * A() is defined as:
268
- * A(0) = seed
269
- * A(i) = HMAC_hash(secret, A(i-1))
270
- *
271
- * The '+' operator denotes concatenation.
272
- *
273
- * As many iterations A(N) as are needed are performed to generate enough
274
- * pseudo random byte output. If an iteration creates more data than is
275
- * necessary, then it is truncated.
276
- *
277
- * Therefore:
278
- * A(1) = HMAC_hash(secret, A(0))
279
- * = HMAC_hash(secret, seed)
280
- * A(2) = HMAC_hash(secret, A(1))
281
- * = HMAC_hash(secret, HMAC_hash(secret, seed))
282
- *
283
- * Therefore:
284
- * P_hash(secret, seed) =
285
- * HMAC_hash(secret, HMAC_hash(secret, A(0)) + seed) +
286
- * HMAC_hash(secret, HMAC_hash(secret, A(1)) + seed) +
287
- * ...
288
- *
289
- * Therefore:
290
- * P_hash(secret, seed) =
291
- * HMAC_hash(secret, HMAC_hash(secret, seed) + seed) +
292
- * HMAC_hash(secret, HMAC_hash(secret, HMAC_hash(secret, seed)) + seed) +
293
- * ...
294
- *
295
- * @param secret the secret to use.
296
- * @param label the label to use.
297
- * @param seed the seed value to use.
298
- * @param length the number of bytes to generate.
299
- *
300
- * @return the pseudo random bytes in a byte buffer.
301
- */
302
- var prf_TLS1 = function(secret, label, seed, length) {
303
- var rval = forge.util.createBuffer();
304
- var idx = secret.length >> 1;
305
- var slen = idx + (secret.length & 1);
306
- var s1 = secret.substr(0, slen);
307
- var s2 = secret.substr(idx, slen);
308
- var ai = forge.util.createBuffer();
309
- var hmac = forge.hmac.create();
310
- seed = label + seed;
311
- var md5itr = Math.ceil(length / 16);
312
- var sha1itr = Math.ceil(length / 20);
313
- hmac.start("MD5", s1);
314
- var md5bytes = forge.util.createBuffer();
315
- ai.putBytes(seed);
316
- for (var i = 0; i < md5itr; ++i) {
317
- hmac.start(null, null);
318
- hmac.update(ai.getBytes());
319
- ai.putBuffer(hmac.digest());
320
- hmac.start(null, null);
321
- hmac.update(ai.bytes() + seed);
322
- md5bytes.putBuffer(hmac.digest());
323
- }
324
- hmac.start("SHA1", s2);
325
- var sha1bytes = forge.util.createBuffer();
326
- ai.clear();
327
- ai.putBytes(seed);
328
- for (var i = 0; i < sha1itr; ++i) {
329
- hmac.start(null, null);
330
- hmac.update(ai.getBytes());
331
- ai.putBuffer(hmac.digest());
332
- hmac.start(null, null);
333
- hmac.update(ai.bytes() + seed);
334
- sha1bytes.putBuffer(hmac.digest());
335
- }
336
- rval.putBytes(forge.util.xorBytes(md5bytes.getBytes(), sha1bytes.getBytes(), length));
337
- return rval;
338
- };
339
- /**
340
- * Gets a MAC for a record using the SHA-1 hash algorithm.
341
- *
342
- * @param key the mac key.
343
- * @param state the sequence number (array of two 32-bit integers).
344
- * @param record the record.
345
- *
346
- * @return the sha-1 hash (20 bytes) for the given record.
347
- */
348
- var hmac_sha1 = function(key$1, seqNum, record) {
349
- var hmac = forge.hmac.create();
350
- hmac.start("SHA1", key$1);
351
- var b = forge.util.createBuffer();
352
- b.putInt32(seqNum[0]);
353
- b.putInt32(seqNum[1]);
354
- b.putByte(record.type);
355
- b.putByte(record.version.major);
356
- b.putByte(record.version.minor);
357
- b.putInt16(record.length);
358
- b.putBytes(record.fragment.bytes());
359
- hmac.update(b.getBytes());
360
- return hmac.digest().getBytes();
361
- };
362
- /**
363
- * Compresses the TLSPlaintext record into a TLSCompressed record using the
364
- * deflate algorithm.
365
- *
366
- * @param c the TLS connection.
367
- * @param record the TLSPlaintext record to compress.
368
- * @param s the ConnectionState to use.
369
- *
370
- * @return true on success, false on failure.
371
- */
372
- var deflate = function(c, record, s) {
373
- var rval = false;
374
- try {
375
- var bytes = c.deflate(record.fragment.getBytes());
376
- record.fragment = forge.util.createBuffer(bytes);
377
- record.length = bytes.length;
378
- rval = true;
379
- } catch (ex) {}
380
- return rval;
381
- };
382
- /**
383
- * Decompresses the TLSCompressed record into a TLSPlaintext record using the
384
- * deflate algorithm.
385
- *
386
- * @param c the TLS connection.
387
- * @param record the TLSCompressed record to decompress.
388
- * @param s the ConnectionState to use.
389
- *
390
- * @return true on success, false on failure.
391
- */
392
- var inflate = function(c, record, s) {
393
- var rval = false;
394
- try {
395
- var bytes = c.inflate(record.fragment.getBytes());
396
- record.fragment = forge.util.createBuffer(bytes);
397
- record.length = bytes.length;
398
- rval = true;
399
- } catch (ex) {}
400
- return rval;
401
- };
402
- /**
403
- * Reads a TLS variable-length vector from a byte buffer.
404
- *
405
- * Variable-length vectors are defined by specifying a subrange of legal
406
- * lengths, inclusively, using the notation <floor..ceiling>. When these are
407
- * encoded, the actual length precedes the vector's contents in the byte
408
- * stream. The length will be in the form of a number consuming as many bytes
409
- * as required to hold the vector's specified maximum (ceiling) length. A
410
- * variable-length vector with an actual length field of zero is referred to
411
- * as an empty vector.
412
- *
413
- * @param b the byte buffer.
414
- * @param lenBytes the number of bytes required to store the length.
415
- *
416
- * @return the resulting byte buffer.
417
- */
418
- var readVector = function(b, lenBytes) {
419
- var len = 0;
420
- switch (lenBytes) {
421
- case 1:
422
- len = b.getByte();
423
- break;
424
- case 2:
425
- len = b.getInt16();
426
- break;
427
- case 3:
428
- len = b.getInt24();
429
- break;
430
- case 4:
431
- len = b.getInt32();
432
- break;
433
- }
434
- return forge.util.createBuffer(b.getBytes(len));
435
- };
436
- /**
437
- * Writes a TLS variable-length vector to a byte buffer.
438
- *
439
- * @param b the byte buffer.
440
- * @param lenBytes the number of bytes required to store the length.
441
- * @param v the byte buffer vector.
442
- */
443
- var writeVector = function(b, lenBytes, v) {
444
- b.putInt(v.length(), lenBytes << 3);
445
- b.putBuffer(v);
446
- };
447
- /**
448
- * The tls implementation.
449
- */
450
- var tls = {};
451
- /**
452
- * Version: TLS 1.2 = 3.3, TLS 1.1 = 3.2, TLS 1.0 = 3.1. Both TLS 1.1 and
453
- * TLS 1.2 were still too new (ie: openSSL didn't implement them) at the time
454
- * of this implementation so TLS 1.0 was implemented instead.
455
- */
456
- tls.Versions = {
457
- TLS_1_0: {
458
- major: 3,
459
- minor: 1
460
- },
461
- TLS_1_1: {
462
- major: 3,
463
- minor: 2
464
- },
465
- TLS_1_2: {
466
- major: 3,
467
- minor: 3
468
- }
469
- };
470
- tls.SupportedVersions = [tls.Versions.TLS_1_1, tls.Versions.TLS_1_0];
471
- tls.Version = tls.SupportedVersions[0];
472
- /**
473
- * Maximum fragment size. True maximum is 16384, but we fragment before that
474
- * to allow for unusual small increases during compression.
475
- */
476
- tls.MaxFragment = 15360;
477
- /**
478
- * Whether this entity is considered the "client" or "server".
479
- * enum { server, client } ConnectionEnd;
480
- */
481
- tls.ConnectionEnd = {
482
- server: 0,
483
- client: 1
484
- };
485
- /**
486
- * Pseudo-random function algorithm used to generate keys from the master
487
- * secret.
488
- * enum { tls_prf_sha256 } PRFAlgorithm;
489
- */
490
- tls.PRFAlgorithm = { tls_prf_sha256: 0 };
491
- /**
492
- * Bulk encryption algorithms.
493
- * enum { null, rc4, des3, aes } BulkCipherAlgorithm;
494
- */
495
- tls.BulkCipherAlgorithm = {
496
- none: null,
497
- rc4: 0,
498
- des3: 1,
499
- aes: 2
500
- };
501
- /**
502
- * Cipher types.
503
- * enum { stream, block, aead } CipherType;
504
- */
505
- tls.CipherType = {
506
- stream: 0,
507
- block: 1,
508
- aead: 2
509
- };
510
- /**
511
- * MAC (Message Authentication Code) algorithms.
512
- * enum { null, hmac_md5, hmac_sha1, hmac_sha256,
513
- * hmac_sha384, hmac_sha512} MACAlgorithm;
514
- */
515
- tls.MACAlgorithm = {
516
- none: null,
517
- hmac_md5: 0,
518
- hmac_sha1: 1,
519
- hmac_sha256: 2,
520
- hmac_sha384: 3,
521
- hmac_sha512: 4
522
- };
523
- /**
524
- * Compression algorithms.
525
- * enum { null(0), deflate(1), (255) } CompressionMethod;
526
- */
527
- tls.CompressionMethod = {
528
- none: 0,
529
- deflate: 1
530
- };
531
- /**
532
- * TLS record content types.
533
- * enum {
534
- * change_cipher_spec(20), alert(21), handshake(22),
535
- * application_data(23), (255)
536
- * } ContentType;
537
- */
538
- tls.ContentType = {
539
- change_cipher_spec: 20,
540
- alert: 21,
541
- handshake: 22,
542
- application_data: 23,
543
- heartbeat: 24
544
- };
545
- /**
546
- * TLS handshake types.
547
- * enum {
548
- * hello_request(0), client_hello(1), server_hello(2),
549
- * certificate(11), server_key_exchange (12),
550
- * certificate_request(13), server_hello_done(14),
551
- * certificate_verify(15), client_key_exchange(16),
552
- * finished(20), (255)
553
- * } HandshakeType;
554
- */
555
- tls.HandshakeType = {
556
- hello_request: 0,
557
- client_hello: 1,
558
- server_hello: 2,
559
- certificate: 11,
560
- server_key_exchange: 12,
561
- certificate_request: 13,
562
- server_hello_done: 14,
563
- certificate_verify: 15,
564
- client_key_exchange: 16,
565
- finished: 20
566
- };
567
- /**
568
- * TLS Alert Protocol.
569
- *
570
- * enum { warning(1), fatal(2), (255) } AlertLevel;
571
- *
572
- * enum {
573
- * close_notify(0),
574
- * unexpected_message(10),
575
- * bad_record_mac(20),
576
- * decryption_failed(21),
577
- * record_overflow(22),
578
- * decompression_failure(30),
579
- * handshake_failure(40),
580
- * bad_certificate(42),
581
- * unsupported_certificate(43),
582
- * certificate_revoked(44),
583
- * certificate_expired(45),
584
- * certificate_unknown(46),
585
- * illegal_parameter(47),
586
- * unknown_ca(48),
587
- * access_denied(49),
588
- * decode_error(50),
589
- * decrypt_error(51),
590
- * export_restriction(60),
591
- * protocol_version(70),
592
- * insufficient_security(71),
593
- * internal_error(80),
594
- * user_canceled(90),
595
- * no_renegotiation(100),
596
- * (255)
597
- * } AlertDescription;
598
- *
599
- * struct {
600
- * AlertLevel level;
601
- * AlertDescription description;
602
- * } Alert;
603
- */
604
- tls.Alert = {};
605
- tls.Alert.Level = {
606
- warning: 1,
607
- fatal: 2
608
- };
609
- tls.Alert.Description = {
610
- close_notify: 0,
611
- unexpected_message: 10,
612
- bad_record_mac: 20,
613
- decryption_failed: 21,
614
- record_overflow: 22,
615
- decompression_failure: 30,
616
- handshake_failure: 40,
617
- bad_certificate: 42,
618
- unsupported_certificate: 43,
619
- certificate_revoked: 44,
620
- certificate_expired: 45,
621
- certificate_unknown: 46,
622
- illegal_parameter: 47,
623
- unknown_ca: 48,
624
- access_denied: 49,
625
- decode_error: 50,
626
- decrypt_error: 51,
627
- export_restriction: 60,
628
- protocol_version: 70,
629
- insufficient_security: 71,
630
- internal_error: 80,
631
- user_canceled: 90,
632
- no_renegotiation: 100
633
- };
634
- /**
635
- * TLS Heartbeat Message types.
636
- * enum {
637
- * heartbeat_request(1),
638
- * heartbeat_response(2),
639
- * (255)
640
- * } HeartbeatMessageType;
641
- */
642
- tls.HeartbeatMessageType = {
643
- heartbeat_request: 1,
644
- heartbeat_response: 2
645
- };
646
- /**
647
- * Supported cipher suites.
648
- */
649
- tls.CipherSuites = {};
650
- /**
651
- * Gets a supported cipher suite from its 2 byte ID.
652
- *
653
- * @param twoBytes two bytes in a string.
654
- *
655
- * @return the matching supported cipher suite or null.
656
- */
657
- tls.getCipherSuite = function(twoBytes) {
658
- var rval = null;
659
- for (var key$1 in tls.CipherSuites) {
660
- var cs = tls.CipherSuites[key$1];
661
- if (cs.id[0] === twoBytes.charCodeAt(0) && cs.id[1] === twoBytes.charCodeAt(1)) {
662
- rval = cs;
663
- break;
664
- }
665
- }
666
- return rval;
667
- };
668
- /**
669
- * Called when an unexpected record is encountered.
670
- *
671
- * @param c the connection.
672
- * @param record the record.
673
- */
674
- tls.handleUnexpected = function(c, record) {
675
- if (!(!c.open && c.entity === tls.ConnectionEnd.client)) c.error(c, {
676
- message: "Unexpected message. Received TLS record out of order.",
677
- send: true,
678
- alert: {
679
- level: tls.Alert.Level.fatal,
680
- description: tls.Alert.Description.unexpected_message
681
- }
682
- });
683
- };
684
- /**
685
- * Called when a client receives a HelloRequest record.
686
- *
687
- * @param c the connection.
688
- * @param record the record.
689
- * @param length the length of the handshake message.
690
- */
691
- tls.handleHelloRequest = function(c, record, length) {
692
- if (!c.handshaking && c.handshakes > 0) {
693
- tls.queue(c, tls.createAlert(c, {
694
- level: tls.Alert.Level.warning,
695
- description: tls.Alert.Description.no_renegotiation
696
- }));
697
- tls.flush(c);
698
- }
699
- c.process();
700
- };
701
- /**
702
- * Parses a hello message from a ClientHello or ServerHello record.
703
- *
704
- * @param record the record to parse.
705
- *
706
- * @return the parsed message.
707
- */
708
- tls.parseHelloMessage = function(c, record, length) {
709
- var msg = null;
710
- var client = c.entity === tls.ConnectionEnd.client;
711
- if (length < 38) c.error(c, {
712
- message: client ? "Invalid ServerHello message. Message too short." : "Invalid ClientHello message. Message too short.",
713
- send: true,
714
- alert: {
715
- level: tls.Alert.Level.fatal,
716
- description: tls.Alert.Description.illegal_parameter
717
- }
718
- });
719
- else {
720
- var b = record.fragment;
721
- var remaining = b.length();
722
- msg = {
723
- version: {
724
- major: b.getByte(),
725
- minor: b.getByte()
726
- },
727
- random: forge.util.createBuffer(b.getBytes(32)),
728
- session_id: readVector(b, 1),
729
- extensions: []
730
- };
731
- if (client) {
732
- msg.cipher_suite = b.getBytes(2);
733
- msg.compression_method = b.getByte();
734
- } else {
735
- msg.cipher_suites = readVector(b, 2);
736
- msg.compression_methods = readVector(b, 1);
737
- }
738
- remaining = length - (remaining - b.length());
739
- if (remaining > 0) {
740
- var exts = readVector(b, 2);
741
- while (exts.length() > 0) msg.extensions.push({
742
- type: [exts.getByte(), exts.getByte()],
743
- data: readVector(exts, 2)
744
- });
745
- if (!client) for (var i = 0; i < msg.extensions.length; ++i) {
746
- var ext = msg.extensions[i];
747
- if (ext.type[0] === 0 && ext.type[1] === 0) {
748
- var snl = readVector(ext.data, 2);
749
- while (snl.length() > 0) {
750
- if (snl.getByte() !== 0) break;
751
- c.session.extensions.server_name.serverNameList.push(readVector(snl, 2).getBytes());
752
- }
753
- }
754
- }
755
- }
756
- if (c.session.version) {
757
- if (msg.version.major !== c.session.version.major || msg.version.minor !== c.session.version.minor) return c.error(c, {
758
- message: "TLS version change is disallowed during renegotiation.",
759
- send: true,
760
- alert: {
761
- level: tls.Alert.Level.fatal,
762
- description: tls.Alert.Description.protocol_version
763
- }
764
- });
765
- }
766
- if (client) c.session.cipherSuite = tls.getCipherSuite(msg.cipher_suite);
767
- else {
768
- var tmp = forge.util.createBuffer(msg.cipher_suites.bytes());
769
- while (tmp.length() > 0) {
770
- c.session.cipherSuite = tls.getCipherSuite(tmp.getBytes(2));
771
- if (c.session.cipherSuite !== null) break;
772
- }
773
- }
774
- if (c.session.cipherSuite === null) return c.error(c, {
775
- message: "No cipher suites in common.",
776
- send: true,
777
- alert: {
778
- level: tls.Alert.Level.fatal,
779
- description: tls.Alert.Description.handshake_failure
780
- },
781
- cipherSuite: forge.util.bytesToHex(msg.cipher_suite)
782
- });
783
- if (client) c.session.compressionMethod = msg.compression_method;
784
- else c.session.compressionMethod = tls.CompressionMethod.none;
785
- }
786
- return msg;
787
- };
788
- /**
789
- * Creates security parameters for the given connection based on the given
790
- * hello message.
791
- *
792
- * @param c the TLS connection.
793
- * @param msg the hello message.
794
- */
795
- tls.createSecurityParameters = function(c, msg) {
796
- var client = c.entity === tls.ConnectionEnd.client;
797
- var msgRandom = msg.random.bytes();
798
- var cRandom = client ? c.session.sp.client_random : msgRandom;
799
- var sRandom = client ? msgRandom : tls.createRandom().getBytes();
800
- c.session.sp = {
801
- entity: c.entity,
802
- prf_algorithm: tls.PRFAlgorithm.tls_prf_sha256,
803
- bulk_cipher_algorithm: null,
804
- cipher_type: null,
805
- enc_key_length: null,
806
- block_length: null,
807
- fixed_iv_length: null,
808
- record_iv_length: null,
809
- mac_algorithm: null,
810
- mac_length: null,
811
- mac_key_length: null,
812
- compression_algorithm: c.session.compressionMethod,
813
- pre_master_secret: null,
814
- master_secret: null,
815
- client_random: cRandom,
816
- server_random: sRandom
817
- };
818
- };
819
- /**
820
- * Called when a client receives a ServerHello record.
821
- *
822
- * When a ServerHello message will be sent:
823
- * The server will send this message in response to a client hello message
824
- * when it was able to find an acceptable set of algorithms. If it cannot
825
- * find such a match, it will respond with a handshake failure alert.
826
- *
827
- * uint24 length;
828
- * struct {
829
- * ProtocolVersion server_version;
830
- * Random random;
831
- * SessionID session_id;
832
- * CipherSuite cipher_suite;
833
- * CompressionMethod compression_method;
834
- * select(extensions_present) {
835
- * case false:
836
- * struct {};
837
- * case true:
838
- * Extension extensions<0..2^16-1>;
839
- * };
840
- * } ServerHello;
841
- *
842
- * @param c the connection.
843
- * @param record the record.
844
- * @param length the length of the handshake message.
845
- */
846
- tls.handleServerHello = function(c, record, length) {
847
- var msg = tls.parseHelloMessage(c, record, length);
848
- if (c.fail) return;
849
- if (msg.version.minor <= c.version.minor) c.version.minor = msg.version.minor;
850
- else return c.error(c, {
851
- message: "Incompatible TLS version.",
852
- send: true,
853
- alert: {
854
- level: tls.Alert.Level.fatal,
855
- description: tls.Alert.Description.protocol_version
856
- }
857
- });
858
- c.session.version = c.version;
859
- var sessionId = msg.session_id.bytes();
860
- if (sessionId.length > 0 && sessionId === c.session.id) {
861
- c.expect = SCC;
862
- c.session.resuming = true;
863
- c.session.sp.server_random = msg.random.bytes();
864
- } else {
865
- c.expect = SCE;
866
- c.session.resuming = false;
867
- tls.createSecurityParameters(c, msg);
868
- }
869
- c.session.id = sessionId;
870
- c.process();
871
- };
872
- /**
873
- * Called when a server receives a ClientHello record.
874
- *
875
- * When a ClientHello message will be sent:
876
- * When a client first connects to a server it is required to send the
877
- * client hello as its first message. The client can also send a client
878
- * hello in response to a hello request or on its own initiative in order
879
- * to renegotiate the security parameters in an existing connection.
880
- *
881
- * @param c the connection.
882
- * @param record the record.
883
- * @param length the length of the handshake message.
884
- */
885
- tls.handleClientHello = function(c, record, length) {
886
- var msg = tls.parseHelloMessage(c, record, length);
887
- if (c.fail) return;
888
- var sessionId = msg.session_id.bytes();
889
- var session = null;
890
- if (c.sessionCache) {
891
- session = c.sessionCache.getSession(sessionId);
892
- if (session === null) sessionId = "";
893
- else if (session.version.major !== msg.version.major || session.version.minor > msg.version.minor) {
894
- session = null;
895
- sessionId = "";
896
- }
897
- }
898
- if (sessionId.length === 0) sessionId = forge.random.getBytes(32);
899
- c.session.id = sessionId;
900
- c.session.clientHelloVersion = msg.version;
901
- c.session.sp = {};
902
- if (session) {
903
- c.version = c.session.version = session.version;
904
- c.session.sp = session.sp;
905
- } else {
906
- var version;
907
- for (var i = 1; i < tls.SupportedVersions.length; ++i) {
908
- version = tls.SupportedVersions[i];
909
- if (version.minor <= msg.version.minor) break;
910
- }
911
- c.version = {
912
- major: version.major,
913
- minor: version.minor
914
- };
915
- c.session.version = c.version;
916
- }
917
- if (session !== null) {
918
- c.expect = CCC;
919
- c.session.resuming = true;
920
- c.session.sp.client_random = msg.random.bytes();
921
- } else {
922
- c.expect = c.verifyClient !== false ? CCE : CKE;
923
- c.session.resuming = false;
924
- tls.createSecurityParameters(c, msg);
925
- }
926
- c.open = true;
927
- tls.queue(c, tls.createRecord(c, {
928
- type: tls.ContentType.handshake,
929
- data: tls.createServerHello(c)
930
- }));
931
- if (c.session.resuming) {
932
- tls.queue(c, tls.createRecord(c, {
933
- type: tls.ContentType.change_cipher_spec,
934
- data: tls.createChangeCipherSpec()
935
- }));
936
- c.state.pending = tls.createConnectionState(c);
937
- c.state.current.write = c.state.pending.write;
938
- tls.queue(c, tls.createRecord(c, {
939
- type: tls.ContentType.handshake,
940
- data: tls.createFinished(c)
941
- }));
942
- } else {
943
- tls.queue(c, tls.createRecord(c, {
944
- type: tls.ContentType.handshake,
945
- data: tls.createCertificate(c)
946
- }));
947
- if (!c.fail) {
948
- tls.queue(c, tls.createRecord(c, {
949
- type: tls.ContentType.handshake,
950
- data: tls.createServerKeyExchange(c)
951
- }));
952
- if (c.verifyClient !== false) tls.queue(c, tls.createRecord(c, {
953
- type: tls.ContentType.handshake,
954
- data: tls.createCertificateRequest(c)
955
- }));
956
- tls.queue(c, tls.createRecord(c, {
957
- type: tls.ContentType.handshake,
958
- data: tls.createServerHelloDone(c)
959
- }));
960
- }
961
- }
962
- tls.flush(c);
963
- c.process();
964
- };
965
- /**
966
- * Called when a client receives a Certificate record.
967
- *
968
- * When this message will be sent:
969
- * The server must send a certificate whenever the agreed-upon key exchange
970
- * method is not an anonymous one. This message will always immediately
971
- * follow the server hello message.
972
- *
973
- * Meaning of this message:
974
- * The certificate type must be appropriate for the selected cipher suite's
975
- * key exchange algorithm, and is generally an X.509v3 certificate. It must
976
- * contain a key which matches the key exchange method, as follows. Unless
977
- * otherwise specified, the signing algorithm for the certificate must be
978
- * the same as the algorithm for the certificate key. Unless otherwise
979
- * specified, the public key may be of any length.
980
- *
981
- * opaque ASN.1Cert<1..2^24-1>;
982
- * struct {
983
- * ASN.1Cert certificate_list<1..2^24-1>;
984
- * } Certificate;
985
- *
986
- * @param c the connection.
987
- * @param record the record.
988
- * @param length the length of the handshake message.
989
- */
990
- tls.handleCertificate = function(c, record, length) {
991
- if (length < 3) return c.error(c, {
992
- message: "Invalid Certificate message. Message too short.",
993
- send: true,
994
- alert: {
995
- level: tls.Alert.Level.fatal,
996
- description: tls.Alert.Description.illegal_parameter
997
- }
998
- });
999
- var b = record.fragment;
1000
- var msg = { certificate_list: readVector(b, 3) };
1001
- var cert, asn1;
1002
- var certs = [];
1003
- try {
1004
- while (msg.certificate_list.length() > 0) {
1005
- cert = readVector(msg.certificate_list, 3);
1006
- asn1 = forge.asn1.fromDer(cert);
1007
- cert = forge.pki.certificateFromAsn1(asn1, true);
1008
- certs.push(cert);
1009
- }
1010
- } catch (ex) {
1011
- return c.error(c, {
1012
- message: "Could not parse certificate list.",
1013
- cause: ex,
1014
- send: true,
1015
- alert: {
1016
- level: tls.Alert.Level.fatal,
1017
- description: tls.Alert.Description.bad_certificate
1018
- }
1019
- });
1020
- }
1021
- var client = c.entity === tls.ConnectionEnd.client;
1022
- if ((client || c.verifyClient === true) && certs.length === 0) c.error(c, {
1023
- message: client ? "No server certificate provided." : "No client certificate provided.",
1024
- send: true,
1025
- alert: {
1026
- level: tls.Alert.Level.fatal,
1027
- description: tls.Alert.Description.illegal_parameter
1028
- }
1029
- });
1030
- else if (certs.length === 0) c.expect = client ? SKE : CKE;
1031
- else {
1032
- if (client) c.session.serverCertificate = certs[0];
1033
- else c.session.clientCertificate = certs[0];
1034
- if (tls.verifyCertificateChain(c, certs)) c.expect = client ? SKE : CKE;
1035
- }
1036
- c.process();
1037
- };
1038
- /**
1039
- * Called when a client receives a ServerKeyExchange record.
1040
- *
1041
- * When this message will be sent:
1042
- * This message will be sent immediately after the server certificate
1043
- * message (or the server hello message, if this is an anonymous
1044
- * negotiation).
1045
- *
1046
- * The server key exchange message is sent by the server only when the
1047
- * server certificate message (if sent) does not contain enough data to
1048
- * allow the client to exchange a premaster secret.
1049
- *
1050
- * Meaning of this message:
1051
- * This message conveys cryptographic information to allow the client to
1052
- * communicate the premaster secret: either an RSA public key to encrypt
1053
- * the premaster secret with, or a Diffie-Hellman public key with which the
1054
- * client can complete a key exchange (with the result being the premaster
1055
- * secret.)
1056
- *
1057
- * enum {
1058
- * dhe_dss, dhe_rsa, dh_anon, rsa, dh_dss, dh_rsa
1059
- * } KeyExchangeAlgorithm;
1060
- *
1061
- * struct {
1062
- * opaque dh_p<1..2^16-1>;
1063
- * opaque dh_g<1..2^16-1>;
1064
- * opaque dh_Ys<1..2^16-1>;
1065
- * } ServerDHParams;
1066
- *
1067
- * struct {
1068
- * select(KeyExchangeAlgorithm) {
1069
- * case dh_anon:
1070
- * ServerDHParams params;
1071
- * case dhe_dss:
1072
- * case dhe_rsa:
1073
- * ServerDHParams params;
1074
- * digitally-signed struct {
1075
- * opaque client_random[32];
1076
- * opaque server_random[32];
1077
- * ServerDHParams params;
1078
- * } signed_params;
1079
- * case rsa:
1080
- * case dh_dss:
1081
- * case dh_rsa:
1082
- * struct {};
1083
- * };
1084
- * } ServerKeyExchange;
1085
- *
1086
- * @param c the connection.
1087
- * @param record the record.
1088
- * @param length the length of the handshake message.
1089
- */
1090
- tls.handleServerKeyExchange = function(c, record, length) {
1091
- if (length > 0) return c.error(c, {
1092
- message: "Invalid key parameters. Only RSA is supported.",
1093
- send: true,
1094
- alert: {
1095
- level: tls.Alert.Level.fatal,
1096
- description: tls.Alert.Description.unsupported_certificate
1097
- }
1098
- });
1099
- c.expect = SCR;
1100
- c.process();
1101
- };
1102
- /**
1103
- * Called when a client receives a ClientKeyExchange record.
1104
- *
1105
- * @param c the connection.
1106
- * @param record the record.
1107
- * @param length the length of the handshake message.
1108
- */
1109
- tls.handleClientKeyExchange = function(c, record, length) {
1110
- if (length < 48) return c.error(c, {
1111
- message: "Invalid key parameters. Only RSA is supported.",
1112
- send: true,
1113
- alert: {
1114
- level: tls.Alert.Level.fatal,
1115
- description: tls.Alert.Description.unsupported_certificate
1116
- }
1117
- });
1118
- var b = record.fragment;
1119
- var msg = { enc_pre_master_secret: readVector(b, 2).getBytes() };
1120
- var privateKey = null;
1121
- if (c.getPrivateKey) try {
1122
- privateKey = c.getPrivateKey(c, c.session.serverCertificate);
1123
- privateKey = forge.pki.privateKeyFromPem(privateKey);
1124
- } catch (ex) {
1125
- c.error(c, {
1126
- message: "Could not get private key.",
1127
- cause: ex,
1128
- send: true,
1129
- alert: {
1130
- level: tls.Alert.Level.fatal,
1131
- description: tls.Alert.Description.internal_error
1132
- }
1133
- });
1134
- }
1135
- if (privateKey === null) return c.error(c, {
1136
- message: "No private key set.",
1137
- send: true,
1138
- alert: {
1139
- level: tls.Alert.Level.fatal,
1140
- description: tls.Alert.Description.internal_error
1141
- }
1142
- });
1143
- try {
1144
- var sp = c.session.sp;
1145
- sp.pre_master_secret = privateKey.decrypt(msg.enc_pre_master_secret);
1146
- var version = c.session.clientHelloVersion;
1147
- if (version.major !== sp.pre_master_secret.charCodeAt(0) || version.minor !== sp.pre_master_secret.charCodeAt(1)) throw new Error("TLS version rollback attack detected.");
1148
- } catch (ex) {
1149
- sp.pre_master_secret = forge.random.getBytes(48);
1150
- }
1151
- c.expect = CCC;
1152
- if (c.session.clientCertificate !== null) c.expect = CCV;
1153
- c.process();
1154
- };
1155
- /**
1156
- * Called when a client receives a CertificateRequest record.
1157
- *
1158
- * When this message will be sent:
1159
- * A non-anonymous server can optionally request a certificate from the
1160
- * client, if appropriate for the selected cipher suite. This message, if
1161
- * sent, will immediately follow the Server Key Exchange message (if it is
1162
- * sent; otherwise, the Server Certificate message).
1163
- *
1164
- * enum {
1165
- * rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4),
1166
- * rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6),
1167
- * fortezza_dms_RESERVED(20), (255)
1168
- * } ClientCertificateType;
1169
- *
1170
- * opaque DistinguishedName<1..2^16-1>;
1171
- *
1172
- * struct {
1173
- * ClientCertificateType certificate_types<1..2^8-1>;
1174
- * SignatureAndHashAlgorithm supported_signature_algorithms<2^16-1>;
1175
- * DistinguishedName certificate_authorities<0..2^16-1>;
1176
- * } CertificateRequest;
1177
- *
1178
- * @param c the connection.
1179
- * @param record the record.
1180
- * @param length the length of the handshake message.
1181
- */
1182
- tls.handleCertificateRequest = function(c, record, length) {
1183
- if (length < 3) return c.error(c, {
1184
- message: "Invalid CertificateRequest. Message too short.",
1185
- send: true,
1186
- alert: {
1187
- level: tls.Alert.Level.fatal,
1188
- description: tls.Alert.Description.illegal_parameter
1189
- }
1190
- });
1191
- var b = record.fragment;
1192
- var msg = {
1193
- certificate_types: readVector(b, 1),
1194
- certificate_authorities: readVector(b, 2)
1195
- };
1196
- c.session.certificateRequest = msg;
1197
- c.expect = SHD;
1198
- c.process();
1199
- };
1200
- /**
1201
- * Called when a server receives a CertificateVerify record.
1202
- *
1203
- * @param c the connection.
1204
- * @param record the record.
1205
- * @param length the length of the handshake message.
1206
- */
1207
- tls.handleCertificateVerify = function(c, record, length) {
1208
- if (length < 2) return c.error(c, {
1209
- message: "Invalid CertificateVerify. Message too short.",
1210
- send: true,
1211
- alert: {
1212
- level: tls.Alert.Level.fatal,
1213
- description: tls.Alert.Description.illegal_parameter
1214
- }
1215
- });
1216
- var b = record.fragment;
1217
- b.read -= 4;
1218
- var msgBytes = b.bytes();
1219
- b.read += 4;
1220
- var msg = { signature: readVector(b, 2).getBytes() };
1221
- var verify = forge.util.createBuffer();
1222
- verify.putBuffer(c.session.md5.digest());
1223
- verify.putBuffer(c.session.sha1.digest());
1224
- verify = verify.getBytes();
1225
- try {
1226
- if (!c.session.clientCertificate.publicKey.verify(verify, msg.signature, "NONE")) throw new Error("CertificateVerify signature does not match.");
1227
- c.session.md5.update(msgBytes);
1228
- c.session.sha1.update(msgBytes);
1229
- } catch (ex) {
1230
- return c.error(c, {
1231
- message: "Bad signature in CertificateVerify.",
1232
- send: true,
1233
- alert: {
1234
- level: tls.Alert.Level.fatal,
1235
- description: tls.Alert.Description.handshake_failure
1236
- }
1237
- });
1238
- }
1239
- c.expect = CCC;
1240
- c.process();
1241
- };
1242
- /**
1243
- * Called when a client receives a ServerHelloDone record.
1244
- *
1245
- * When this message will be sent:
1246
- * The server hello done message is sent by the server to indicate the end
1247
- * of the server hello and associated messages. After sending this message
1248
- * the server will wait for a client response.
1249
- *
1250
- * Meaning of this message:
1251
- * This message means that the server is done sending messages to support
1252
- * the key exchange, and the client can proceed with its phase of the key
1253
- * exchange.
1254
- *
1255
- * Upon receipt of the server hello done message the client should verify
1256
- * that the server provided a valid certificate if required and check that
1257
- * the server hello parameters are acceptable.
1258
- *
1259
- * struct {} ServerHelloDone;
1260
- *
1261
- * @param c the connection.
1262
- * @param record the record.
1263
- * @param length the length of the handshake message.
1264
- */
1265
- tls.handleServerHelloDone = function(c, record, length) {
1266
- if (length > 0) return c.error(c, {
1267
- message: "Invalid ServerHelloDone message. Invalid length.",
1268
- send: true,
1269
- alert: {
1270
- level: tls.Alert.Level.fatal,
1271
- description: tls.Alert.Description.record_overflow
1272
- }
1273
- });
1274
- if (c.serverCertificate === null) {
1275
- var error = {
1276
- message: "No server certificate provided. Not enough security.",
1277
- send: true,
1278
- alert: {
1279
- level: tls.Alert.Level.fatal,
1280
- description: tls.Alert.Description.insufficient_security
1281
- }
1282
- };
1283
- var ret = c.verify(c, error.alert.description, 0, []);
1284
- if (ret !== true) {
1285
- if (ret || ret === 0) {
1286
- if (typeof ret === "object" && !forge.util.isArray(ret)) {
1287
- if (ret.message) error.message = ret.message;
1288
- if (ret.alert) error.alert.description = ret.alert;
1289
- } else if (typeof ret === "number") error.alert.description = ret;
1290
- }
1291
- return c.error(c, error);
1292
- }
1293
- }
1294
- if (c.session.certificateRequest !== null) {
1295
- record = tls.createRecord(c, {
1296
- type: tls.ContentType.handshake,
1297
- data: tls.createCertificate(c)
1298
- });
1299
- tls.queue(c, record);
1300
- }
1301
- record = tls.createRecord(c, {
1302
- type: tls.ContentType.handshake,
1303
- data: tls.createClientKeyExchange(c)
1304
- });
1305
- tls.queue(c, record);
1306
- c.expect = SER;
1307
- var callback = function(c$1, signature) {
1308
- if (c$1.session.certificateRequest !== null && c$1.session.clientCertificate !== null) tls.queue(c$1, tls.createRecord(c$1, {
1309
- type: tls.ContentType.handshake,
1310
- data: tls.createCertificateVerify(c$1, signature)
1311
- }));
1312
- tls.queue(c$1, tls.createRecord(c$1, {
1313
- type: tls.ContentType.change_cipher_spec,
1314
- data: tls.createChangeCipherSpec()
1315
- }));
1316
- c$1.state.pending = tls.createConnectionState(c$1);
1317
- c$1.state.current.write = c$1.state.pending.write;
1318
- tls.queue(c$1, tls.createRecord(c$1, {
1319
- type: tls.ContentType.handshake,
1320
- data: tls.createFinished(c$1)
1321
- }));
1322
- c$1.expect = SCC;
1323
- tls.flush(c$1);
1324
- c$1.process();
1325
- };
1326
- if (c.session.certificateRequest === null || c.session.clientCertificate === null) return callback(c, null);
1327
- tls.getClientSignature(c, callback);
1328
- };
1329
- /**
1330
- * Called when a ChangeCipherSpec record is received.
1331
- *
1332
- * @param c the connection.
1333
- * @param record the record.
1334
- */
1335
- tls.handleChangeCipherSpec = function(c, record) {
1336
- if (record.fragment.getByte() !== 1) return c.error(c, {
1337
- message: "Invalid ChangeCipherSpec message received.",
1338
- send: true,
1339
- alert: {
1340
- level: tls.Alert.Level.fatal,
1341
- description: tls.Alert.Description.illegal_parameter
1342
- }
1343
- });
1344
- var client = c.entity === tls.ConnectionEnd.client;
1345
- if (c.session.resuming && client || !c.session.resuming && !client) c.state.pending = tls.createConnectionState(c);
1346
- c.state.current.read = c.state.pending.read;
1347
- if (!c.session.resuming && client || c.session.resuming && !client) c.state.pending = null;
1348
- c.expect = client ? SFI : CFI;
1349
- c.process();
1350
- };
1351
- /**
1352
- * Called when a Finished record is received.
1353
- *
1354
- * When this message will be sent:
1355
- * A finished message is always sent immediately after a change
1356
- * cipher spec message to verify that the key exchange and
1357
- * authentication processes were successful. It is essential that a
1358
- * change cipher spec message be received between the other
1359
- * handshake messages and the Finished message.
1360
- *
1361
- * Meaning of this message:
1362
- * The finished message is the first protected with the just-
1363
- * negotiated algorithms, keys, and secrets. Recipients of finished
1364
- * messages must verify that the contents are correct. Once a side
1365
- * has sent its Finished message and received and validated the
1366
- * Finished message from its peer, it may begin to send and receive
1367
- * application data over the connection.
1368
- *
1369
- * struct {
1370
- * opaque verify_data[verify_data_length];
1371
- * } Finished;
1372
- *
1373
- * verify_data
1374
- * PRF(master_secret, finished_label, Hash(handshake_messages))
1375
- * [0..verify_data_length-1];
1376
- *
1377
- * finished_label
1378
- * For Finished messages sent by the client, the string
1379
- * "client finished". For Finished messages sent by the server, the
1380
- * string "server finished".
1381
- *
1382
- * verify_data_length depends on the cipher suite. If it is not specified
1383
- * by the cipher suite, then it is 12. Versions of TLS < 1.2 always used
1384
- * 12 bytes.
1385
- *
1386
- * @param c the connection.
1387
- * @param record the record.
1388
- * @param length the length of the handshake message.
1389
- */
1390
- tls.handleFinished = function(c, record, length) {
1391
- var b = record.fragment;
1392
- b.read -= 4;
1393
- var msgBytes = b.bytes();
1394
- b.read += 4;
1395
- var vd = record.fragment.getBytes();
1396
- b = forge.util.createBuffer();
1397
- b.putBuffer(c.session.md5.digest());
1398
- b.putBuffer(c.session.sha1.digest());
1399
- var client = c.entity === tls.ConnectionEnd.client;
1400
- var label = client ? "server finished" : "client finished";
1401
- var sp = c.session.sp;
1402
- b = prf_TLS1(sp.master_secret, label, b.getBytes(), 12);
1403
- if (b.getBytes() !== vd) return c.error(c, {
1404
- message: "Invalid verify_data in Finished message.",
1405
- send: true,
1406
- alert: {
1407
- level: tls.Alert.Level.fatal,
1408
- description: tls.Alert.Description.decrypt_error
1409
- }
1410
- });
1411
- c.session.md5.update(msgBytes);
1412
- c.session.sha1.update(msgBytes);
1413
- if (c.session.resuming && client || !c.session.resuming && !client) {
1414
- tls.queue(c, tls.createRecord(c, {
1415
- type: tls.ContentType.change_cipher_spec,
1416
- data: tls.createChangeCipherSpec()
1417
- }));
1418
- c.state.current.write = c.state.pending.write;
1419
- c.state.pending = null;
1420
- tls.queue(c, tls.createRecord(c, {
1421
- type: tls.ContentType.handshake,
1422
- data: tls.createFinished(c)
1423
- }));
1424
- }
1425
- c.expect = client ? SAD : CAD;
1426
- c.handshaking = false;
1427
- ++c.handshakes;
1428
- c.peerCertificate = client ? c.session.serverCertificate : c.session.clientCertificate;
1429
- tls.flush(c);
1430
- c.isConnected = true;
1431
- c.connected(c);
1432
- c.process();
1433
- };
1434
- /**
1435
- * Called when an Alert record is received.
1436
- *
1437
- * @param c the connection.
1438
- * @param record the record.
1439
- */
1440
- tls.handleAlert = function(c, record) {
1441
- var b = record.fragment;
1442
- var alert = {
1443
- level: b.getByte(),
1444
- description: b.getByte()
1445
- };
1446
- var msg;
1447
- switch (alert.description) {
1448
- case tls.Alert.Description.close_notify:
1449
- msg = "Connection closed.";
1450
- break;
1451
- case tls.Alert.Description.unexpected_message:
1452
- msg = "Unexpected message.";
1453
- break;
1454
- case tls.Alert.Description.bad_record_mac:
1455
- msg = "Bad record MAC.";
1456
- break;
1457
- case tls.Alert.Description.decryption_failed:
1458
- msg = "Decryption failed.";
1459
- break;
1460
- case tls.Alert.Description.record_overflow:
1461
- msg = "Record overflow.";
1462
- break;
1463
- case tls.Alert.Description.decompression_failure:
1464
- msg = "Decompression failed.";
1465
- break;
1466
- case tls.Alert.Description.handshake_failure:
1467
- msg = "Handshake failure.";
1468
- break;
1469
- case tls.Alert.Description.bad_certificate:
1470
- msg = "Bad certificate.";
1471
- break;
1472
- case tls.Alert.Description.unsupported_certificate:
1473
- msg = "Unsupported certificate.";
1474
- break;
1475
- case tls.Alert.Description.certificate_revoked:
1476
- msg = "Certificate revoked.";
1477
- break;
1478
- case tls.Alert.Description.certificate_expired:
1479
- msg = "Certificate expired.";
1480
- break;
1481
- case tls.Alert.Description.certificate_unknown:
1482
- msg = "Certificate unknown.";
1483
- break;
1484
- case tls.Alert.Description.illegal_parameter:
1485
- msg = "Illegal parameter.";
1486
- break;
1487
- case tls.Alert.Description.unknown_ca:
1488
- msg = "Unknown certificate authority.";
1489
- break;
1490
- case tls.Alert.Description.access_denied:
1491
- msg = "Access denied.";
1492
- break;
1493
- case tls.Alert.Description.decode_error:
1494
- msg = "Decode error.";
1495
- break;
1496
- case tls.Alert.Description.decrypt_error:
1497
- msg = "Decrypt error.";
1498
- break;
1499
- case tls.Alert.Description.export_restriction:
1500
- msg = "Export restriction.";
1501
- break;
1502
- case tls.Alert.Description.protocol_version:
1503
- msg = "Unsupported protocol version.";
1504
- break;
1505
- case tls.Alert.Description.insufficient_security:
1506
- msg = "Insufficient security.";
1507
- break;
1508
- case tls.Alert.Description.internal_error:
1509
- msg = "Internal error.";
1510
- break;
1511
- case tls.Alert.Description.user_canceled:
1512
- msg = "User canceled.";
1513
- break;
1514
- case tls.Alert.Description.no_renegotiation:
1515
- msg = "Renegotiation not supported.";
1516
- break;
1517
- default:
1518
- msg = "Unknown error.";
1519
- break;
1520
- }
1521
- if (alert.description === tls.Alert.Description.close_notify) return c.close();
1522
- c.error(c, {
1523
- message: msg,
1524
- send: false,
1525
- origin: c.entity === tls.ConnectionEnd.client ? "server" : "client",
1526
- alert
1527
- });
1528
- c.process();
1529
- };
1530
- /**
1531
- * Called when a Handshake record is received.
1532
- *
1533
- * @param c the connection.
1534
- * @param record the record.
1535
- */
1536
- tls.handleHandshake = function(c, record) {
1537
- var b = record.fragment;
1538
- var type = b.getByte();
1539
- var length = b.getInt24();
1540
- if (length > b.length()) {
1541
- c.fragmented = record;
1542
- record.fragment = forge.util.createBuffer();
1543
- b.read -= 4;
1544
- return c.process();
1545
- }
1546
- c.fragmented = null;
1547
- b.read -= 4;
1548
- var bytes = b.bytes(length + 4);
1549
- b.read += 4;
1550
- if (type in hsTable[c.entity][c.expect]) {
1551
- if (c.entity === tls.ConnectionEnd.server && !c.open && !c.fail) {
1552
- c.handshaking = true;
1553
- c.session = {
1554
- version: null,
1555
- extensions: { server_name: { serverNameList: [] } },
1556
- cipherSuite: null,
1557
- compressionMethod: null,
1558
- serverCertificate: null,
1559
- clientCertificate: null,
1560
- md5: forge.md.md5.create(),
1561
- sha1: forge.md.sha1.create()
1562
- };
1563
- }
1564
- if (type !== tls.HandshakeType.hello_request && type !== tls.HandshakeType.certificate_verify && type !== tls.HandshakeType.finished) {
1565
- c.session.md5.update(bytes);
1566
- c.session.sha1.update(bytes);
1567
- }
1568
- hsTable[c.entity][c.expect][type](c, record, length);
1569
- } else tls.handleUnexpected(c, record);
1570
- };
1571
- /**
1572
- * Called when an ApplicationData record is received.
1573
- *
1574
- * @param c the connection.
1575
- * @param record the record.
1576
- */
1577
- tls.handleApplicationData = function(c, record) {
1578
- c.data.putBuffer(record.fragment);
1579
- c.dataReady(c);
1580
- c.process();
1581
- };
1582
- /**
1583
- * Called when a Heartbeat record is received.
1584
- *
1585
- * @param c the connection.
1586
- * @param record the record.
1587
- */
1588
- tls.handleHeartbeat = function(c, record) {
1589
- var b = record.fragment;
1590
- var type = b.getByte();
1591
- var length = b.getInt16();
1592
- var payload = b.getBytes(length);
1593
- if (type === tls.HeartbeatMessageType.heartbeat_request) {
1594
- if (c.handshaking || length > payload.length) return c.process();
1595
- tls.queue(c, tls.createRecord(c, {
1596
- type: tls.ContentType.heartbeat,
1597
- data: tls.createHeartbeat(tls.HeartbeatMessageType.heartbeat_response, payload)
1598
- }));
1599
- tls.flush(c);
1600
- } else if (type === tls.HeartbeatMessageType.heartbeat_response) {
1601
- if (payload !== c.expectedHeartbeatPayload) return c.process();
1602
- if (c.heartbeatReceived) c.heartbeatReceived(c, forge.util.createBuffer(payload));
1603
- }
1604
- c.process();
1605
- };
1606
- /**
1607
- * The transistional state tables for receiving TLS records. It maps the
1608
- * current TLS engine state and a received record to a function to handle the
1609
- * record and update the state.
1610
- *
1611
- * For instance, if the current state is SHE, then the TLS engine is expecting
1612
- * a ServerHello record. Once a record is received, the handler function is
1613
- * looked up using the state SHE and the record's content type.
1614
- *
1615
- * The resulting function will either be an error handler or a record handler.
1616
- * The function will take whatever action is appropriate and update the state
1617
- * for the next record.
1618
- *
1619
- * The states are all based on possible server record types. Note that the
1620
- * client will never specifically expect to receive a HelloRequest or an alert
1621
- * from the server so there is no state that reflects this. These messages may
1622
- * occur at any time.
1623
- *
1624
- * There are two tables for mapping states because there is a second tier of
1625
- * types for handshake messages. Once a record with a content type of handshake
1626
- * is received, the handshake record handler will look up the handshake type in
1627
- * the secondary map to get its appropriate handler.
1628
- *
1629
- * Valid message orders are as follows:
1630
- *
1631
- * =======================FULL HANDSHAKE======================
1632
- * Client Server
1633
- *
1634
- * ClientHello -------->
1635
- * ServerHello
1636
- * Certificate*
1637
- * ServerKeyExchange*
1638
- * CertificateRequest*
1639
- * <-------- ServerHelloDone
1640
- * Certificate*
1641
- * ClientKeyExchange
1642
- * CertificateVerify*
1643
- * [ChangeCipherSpec]
1644
- * Finished -------->
1645
- * [ChangeCipherSpec]
1646
- * <-------- Finished
1647
- * Application Data <-------> Application Data
1648
- *
1649
- * =====================SESSION RESUMPTION=====================
1650
- * Client Server
1651
- *
1652
- * ClientHello -------->
1653
- * ServerHello
1654
- * [ChangeCipherSpec]
1655
- * <-------- Finished
1656
- * [ChangeCipherSpec]
1657
- * Finished -------->
1658
- * Application Data <-------> Application Data
1659
- */
1660
- var SHE = 0;
1661
- var SCE = 1;
1662
- var SKE = 2;
1663
- var SCR = 3;
1664
- var SHD = 4;
1665
- var SCC = 5;
1666
- var SFI = 6;
1667
- var SAD = 7;
1668
- var SER = 8;
1669
- var CHE = 0;
1670
- var CCE = 1;
1671
- var CKE = 2;
1672
- var CCV = 3;
1673
- var CCC = 4;
1674
- var CFI = 5;
1675
- var CAD = 6;
1676
- var __ = tls.handleUnexpected;
1677
- var R0 = tls.handleChangeCipherSpec;
1678
- var R1 = tls.handleAlert;
1679
- var R2 = tls.handleHandshake;
1680
- var R3 = tls.handleApplicationData;
1681
- var R4 = tls.handleHeartbeat;
1682
- var ctTable = [];
1683
- ctTable[tls.ConnectionEnd.client] = [
1684
- [
1685
- __,
1686
- R1,
1687
- R2,
1688
- __,
1689
- R4
1690
- ],
1691
- [
1692
- __,
1693
- R1,
1694
- R2,
1695
- __,
1696
- R4
1697
- ],
1698
- [
1699
- __,
1700
- R1,
1701
- R2,
1702
- __,
1703
- R4
1704
- ],
1705
- [
1706
- __,
1707
- R1,
1708
- R2,
1709
- __,
1710
- R4
1711
- ],
1712
- [
1713
- __,
1714
- R1,
1715
- R2,
1716
- __,
1717
- R4
1718
- ],
1719
- [
1720
- R0,
1721
- R1,
1722
- __,
1723
- __,
1724
- R4
1725
- ],
1726
- [
1727
- __,
1728
- R1,
1729
- R2,
1730
- __,
1731
- R4
1732
- ],
1733
- [
1734
- __,
1735
- R1,
1736
- R2,
1737
- R3,
1738
- R4
1739
- ],
1740
- [
1741
- __,
1742
- R1,
1743
- R2,
1744
- __,
1745
- R4
1746
- ]
1747
- ];
1748
- ctTable[tls.ConnectionEnd.server] = [
1749
- [
1750
- __,
1751
- R1,
1752
- R2,
1753
- __,
1754
- R4
1755
- ],
1756
- [
1757
- __,
1758
- R1,
1759
- R2,
1760
- __,
1761
- R4
1762
- ],
1763
- [
1764
- __,
1765
- R1,
1766
- R2,
1767
- __,
1768
- R4
1769
- ],
1770
- [
1771
- __,
1772
- R1,
1773
- R2,
1774
- __,
1775
- R4
1776
- ],
1777
- [
1778
- R0,
1779
- R1,
1780
- __,
1781
- __,
1782
- R4
1783
- ],
1784
- [
1785
- __,
1786
- R1,
1787
- R2,
1788
- __,
1789
- R4
1790
- ],
1791
- [
1792
- __,
1793
- R1,
1794
- R2,
1795
- R3,
1796
- R4
1797
- ],
1798
- [
1799
- __,
1800
- R1,
1801
- R2,
1802
- __,
1803
- R4
1804
- ]
1805
- ];
1806
- var H0 = tls.handleHelloRequest;
1807
- var H1 = tls.handleServerHello;
1808
- var H2 = tls.handleCertificate;
1809
- var H3 = tls.handleServerKeyExchange;
1810
- var H4 = tls.handleCertificateRequest;
1811
- var H5 = tls.handleServerHelloDone;
1812
- var H6 = tls.handleFinished;
1813
- var hsTable = [];
1814
- hsTable[tls.ConnectionEnd.client] = [
1815
- [
1816
- __,
1817
- __,
1818
- H1,
1819
- __,
1820
- __,
1821
- __,
1822
- __,
1823
- __,
1824
- __,
1825
- __,
1826
- __,
1827
- __,
1828
- __,
1829
- __,
1830
- __,
1831
- __,
1832
- __,
1833
- __,
1834
- __,
1835
- __,
1836
- __
1837
- ],
1838
- [
1839
- H0,
1840
- __,
1841
- __,
1842
- __,
1843
- __,
1844
- __,
1845
- __,
1846
- __,
1847
- __,
1848
- __,
1849
- __,
1850
- H2,
1851
- H3,
1852
- H4,
1853
- H5,
1854
- __,
1855
- __,
1856
- __,
1857
- __,
1858
- __,
1859
- __
1860
- ],
1861
- [
1862
- H0,
1863
- __,
1864
- __,
1865
- __,
1866
- __,
1867
- __,
1868
- __,
1869
- __,
1870
- __,
1871
- __,
1872
- __,
1873
- __,
1874
- H3,
1875
- H4,
1876
- H5,
1877
- __,
1878
- __,
1879
- __,
1880
- __,
1881
- __,
1882
- __
1883
- ],
1884
- [
1885
- H0,
1886
- __,
1887
- __,
1888
- __,
1889
- __,
1890
- __,
1891
- __,
1892
- __,
1893
- __,
1894
- __,
1895
- __,
1896
- __,
1897
- __,
1898
- H4,
1899
- H5,
1900
- __,
1901
- __,
1902
- __,
1903
- __,
1904
- __,
1905
- __
1906
- ],
1907
- [
1908
- H0,
1909
- __,
1910
- __,
1911
- __,
1912
- __,
1913
- __,
1914
- __,
1915
- __,
1916
- __,
1917
- __,
1918
- __,
1919
- __,
1920
- __,
1921
- __,
1922
- H5,
1923
- __,
1924
- __,
1925
- __,
1926
- __,
1927
- __,
1928
- __
1929
- ],
1930
- [
1931
- H0,
1932
- __,
1933
- __,
1934
- __,
1935
- __,
1936
- __,
1937
- __,
1938
- __,
1939
- __,
1940
- __,
1941
- __,
1942
- __,
1943
- __,
1944
- __,
1945
- __,
1946
- __,
1947
- __,
1948
- __,
1949
- __,
1950
- __,
1951
- __
1952
- ],
1953
- [
1954
- H0,
1955
- __,
1956
- __,
1957
- __,
1958
- __,
1959
- __,
1960
- __,
1961
- __,
1962
- __,
1963
- __,
1964
- __,
1965
- __,
1966
- __,
1967
- __,
1968
- __,
1969
- __,
1970
- __,
1971
- __,
1972
- __,
1973
- __,
1974
- H6
1975
- ],
1976
- [
1977
- H0,
1978
- __,
1979
- __,
1980
- __,
1981
- __,
1982
- __,
1983
- __,
1984
- __,
1985
- __,
1986
- __,
1987
- __,
1988
- __,
1989
- __,
1990
- __,
1991
- __,
1992
- __,
1993
- __,
1994
- __,
1995
- __,
1996
- __,
1997
- __
1998
- ],
1999
- [
2000
- H0,
2001
- __,
2002
- __,
2003
- __,
2004
- __,
2005
- __,
2006
- __,
2007
- __,
2008
- __,
2009
- __,
2010
- __,
2011
- __,
2012
- __,
2013
- __,
2014
- __,
2015
- __,
2016
- __,
2017
- __,
2018
- __,
2019
- __,
2020
- __
2021
- ]
2022
- ];
2023
- var H7 = tls.handleClientHello;
2024
- var H8 = tls.handleClientKeyExchange;
2025
- var H9 = tls.handleCertificateVerify;
2026
- hsTable[tls.ConnectionEnd.server] = [
2027
- [
2028
- __,
2029
- H7,
2030
- __,
2031
- __,
2032
- __,
2033
- __,
2034
- __,
2035
- __,
2036
- __,
2037
- __,
2038
- __,
2039
- __,
2040
- __,
2041
- __,
2042
- __,
2043
- __,
2044
- __,
2045
- __,
2046
- __,
2047
- __,
2048
- __
2049
- ],
2050
- [
2051
- __,
2052
- __,
2053
- __,
2054
- __,
2055
- __,
2056
- __,
2057
- __,
2058
- __,
2059
- __,
2060
- __,
2061
- __,
2062
- H2,
2063
- __,
2064
- __,
2065
- __,
2066
- __,
2067
- __,
2068
- __,
2069
- __,
2070
- __,
2071
- __
2072
- ],
2073
- [
2074
- __,
2075
- __,
2076
- __,
2077
- __,
2078
- __,
2079
- __,
2080
- __,
2081
- __,
2082
- __,
2083
- __,
2084
- __,
2085
- __,
2086
- __,
2087
- __,
2088
- __,
2089
- __,
2090
- H8,
2091
- __,
2092
- __,
2093
- __,
2094
- __
2095
- ],
2096
- [
2097
- __,
2098
- __,
2099
- __,
2100
- __,
2101
- __,
2102
- __,
2103
- __,
2104
- __,
2105
- __,
2106
- __,
2107
- __,
2108
- __,
2109
- __,
2110
- __,
2111
- __,
2112
- H9,
2113
- __,
2114
- __,
2115
- __,
2116
- __,
2117
- __
2118
- ],
2119
- [
2120
- __,
2121
- __,
2122
- __,
2123
- __,
2124
- __,
2125
- __,
2126
- __,
2127
- __,
2128
- __,
2129
- __,
2130
- __,
2131
- __,
2132
- __,
2133
- __,
2134
- __,
2135
- __,
2136
- __,
2137
- __,
2138
- __,
2139
- __,
2140
- __
2141
- ],
2142
- [
2143
- __,
2144
- __,
2145
- __,
2146
- __,
2147
- __,
2148
- __,
2149
- __,
2150
- __,
2151
- __,
2152
- __,
2153
- __,
2154
- __,
2155
- __,
2156
- __,
2157
- __,
2158
- __,
2159
- __,
2160
- __,
2161
- __,
2162
- __,
2163
- H6
2164
- ],
2165
- [
2166
- __,
2167
- __,
2168
- __,
2169
- __,
2170
- __,
2171
- __,
2172
- __,
2173
- __,
2174
- __,
2175
- __,
2176
- __,
2177
- __,
2178
- __,
2179
- __,
2180
- __,
2181
- __,
2182
- __,
2183
- __,
2184
- __,
2185
- __,
2186
- __
2187
- ],
2188
- [
2189
- __,
2190
- __,
2191
- __,
2192
- __,
2193
- __,
2194
- __,
2195
- __,
2196
- __,
2197
- __,
2198
- __,
2199
- __,
2200
- __,
2201
- __,
2202
- __,
2203
- __,
2204
- __,
2205
- __,
2206
- __,
2207
- __,
2208
- __,
2209
- __
2210
- ]
2211
- ];
2212
- /**
2213
- * Generates the master_secret and keys using the given security parameters.
2214
- *
2215
- * The security parameters for a TLS connection state are defined as such:
2216
- *
2217
- * struct {
2218
- * ConnectionEnd entity;
2219
- * PRFAlgorithm prf_algorithm;
2220
- * BulkCipherAlgorithm bulk_cipher_algorithm;
2221
- * CipherType cipher_type;
2222
- * uint8 enc_key_length;
2223
- * uint8 block_length;
2224
- * uint8 fixed_iv_length;
2225
- * uint8 record_iv_length;
2226
- * MACAlgorithm mac_algorithm;
2227
- * uint8 mac_length;
2228
- * uint8 mac_key_length;
2229
- * CompressionMethod compression_algorithm;
2230
- * opaque master_secret[48];
2231
- * opaque client_random[32];
2232
- * opaque server_random[32];
2233
- * } SecurityParameters;
2234
- *
2235
- * Note that this definition is from TLS 1.2. In TLS 1.0 some of these
2236
- * parameters are ignored because, for instance, the PRFAlgorithm is a
2237
- * builtin-fixed algorithm combining iterations of MD5 and SHA-1 in TLS 1.0.
2238
- *
2239
- * The Record Protocol requires an algorithm to generate keys required by the
2240
- * current connection state.
2241
- *
2242
- * The master secret is expanded into a sequence of secure bytes, which is then
2243
- * split to a client write MAC key, a server write MAC key, a client write
2244
- * encryption key, and a server write encryption key. In TLS 1.0 a client write
2245
- * IV and server write IV are also generated. Each of these is generated from
2246
- * the byte sequence in that order. Unused values are empty. In TLS 1.2, some
2247
- * AEAD ciphers may additionally require a client write IV and a server write
2248
- * IV (see Section 6.2.3.3).
2249
- *
2250
- * When keys, MAC keys, and IVs are generated, the master secret is used as an
2251
- * entropy source.
2252
- *
2253
- * To generate the key material, compute:
2254
- *
2255
- * master_secret = PRF(pre_master_secret, "master secret",
2256
- * ClientHello.random + ServerHello.random)
2257
- *
2258
- * key_block = PRF(SecurityParameters.master_secret,
2259
- * "key expansion",
2260
- * SecurityParameters.server_random +
2261
- * SecurityParameters.client_random);
2262
- *
2263
- * until enough output has been generated. Then, the key_block is
2264
- * partitioned as follows:
2265
- *
2266
- * client_write_MAC_key[SecurityParameters.mac_key_length]
2267
- * server_write_MAC_key[SecurityParameters.mac_key_length]
2268
- * client_write_key[SecurityParameters.enc_key_length]
2269
- * server_write_key[SecurityParameters.enc_key_length]
2270
- * client_write_IV[SecurityParameters.fixed_iv_length]
2271
- * server_write_IV[SecurityParameters.fixed_iv_length]
2272
- *
2273
- * In TLS 1.2, the client_write_IV and server_write_IV are only generated for
2274
- * implicit nonce techniques as described in Section 3.2.1 of [AEAD]. This
2275
- * implementation uses TLS 1.0 so IVs are generated.
2276
- *
2277
- * Implementation note: The currently defined cipher suite which requires the
2278
- * most material is AES_256_CBC_SHA256. It requires 2 x 32 byte keys and 2 x 32
2279
- * byte MAC keys, for a total 128 bytes of key material. In TLS 1.0 it also
2280
- * requires 2 x 16 byte IVs, so it actually takes 160 bytes of key material.
2281
- *
2282
- * @param c the connection.
2283
- * @param sp the security parameters to use.
2284
- *
2285
- * @return the security keys.
2286
- */
2287
- tls.generateKeys = function(c, sp) {
2288
- var prf = prf_TLS1;
2289
- var random = sp.client_random + sp.server_random;
2290
- if (!c.session.resuming) {
2291
- sp.master_secret = prf(sp.pre_master_secret, "master secret", random, 48).bytes();
2292
- sp.pre_master_secret = null;
2293
- }
2294
- random = sp.server_random + sp.client_random;
2295
- var length = 2 * sp.mac_key_length + 2 * sp.enc_key_length;
2296
- var tls10 = c.version.major === tls.Versions.TLS_1_0.major && c.version.minor === tls.Versions.TLS_1_0.minor;
2297
- if (tls10) length += 2 * sp.fixed_iv_length;
2298
- var km = prf(sp.master_secret, "key expansion", random, length);
2299
- var rval = {
2300
- client_write_MAC_key: km.getBytes(sp.mac_key_length),
2301
- server_write_MAC_key: km.getBytes(sp.mac_key_length),
2302
- client_write_key: km.getBytes(sp.enc_key_length),
2303
- server_write_key: km.getBytes(sp.enc_key_length)
2304
- };
2305
- if (tls10) {
2306
- rval.client_write_IV = km.getBytes(sp.fixed_iv_length);
2307
- rval.server_write_IV = km.getBytes(sp.fixed_iv_length);
2308
- }
2309
- return rval;
2310
- };
2311
- /**
2312
- * Creates a new initialized TLS connection state. A connection state has
2313
- * a read mode and a write mode.
2314
- *
2315
- * compression state:
2316
- * The current state of the compression algorithm.
2317
- *
2318
- * cipher state:
2319
- * The current state of the encryption algorithm. This will consist of the
2320
- * scheduled key for that connection. For stream ciphers, this will also
2321
- * contain whatever state information is necessary to allow the stream to
2322
- * continue to encrypt or decrypt data.
2323
- *
2324
- * MAC key:
2325
- * The MAC key for the connection.
2326
- *
2327
- * sequence number:
2328
- * Each connection state contains a sequence number, which is maintained
2329
- * separately for read and write states. The sequence number MUST be set to
2330
- * zero whenever a connection state is made the active state. Sequence
2331
- * numbers are of type uint64 and may not exceed 2^64-1. Sequence numbers do
2332
- * not wrap. If a TLS implementation would need to wrap a sequence number,
2333
- * it must renegotiate instead. A sequence number is incremented after each
2334
- * record: specifically, the first record transmitted under a particular
2335
- * connection state MUST use sequence number 0.
2336
- *
2337
- * @param c the connection.
2338
- *
2339
- * @return the new initialized TLS connection state.
2340
- */
2341
- tls.createConnectionState = function(c) {
2342
- var client = c.entity === tls.ConnectionEnd.client;
2343
- var createMode = function() {
2344
- var mode = {
2345
- sequenceNumber: [0, 0],
2346
- macKey: null,
2347
- macLength: 0,
2348
- macFunction: null,
2349
- cipherState: null,
2350
- cipherFunction: function(record) {
2351
- return true;
2352
- },
2353
- compressionState: null,
2354
- compressFunction: function(record) {
2355
- return true;
2356
- },
2357
- updateSequenceNumber: function() {
2358
- if (mode.sequenceNumber[1] === 4294967295) {
2359
- mode.sequenceNumber[1] = 0;
2360
- ++mode.sequenceNumber[0];
2361
- } else ++mode.sequenceNumber[1];
2362
- }
2363
- };
2364
- return mode;
2365
- };
2366
- var state = {
2367
- read: createMode(),
2368
- write: createMode()
2369
- };
2370
- state.read.update = function(c$1, record) {
2371
- if (!state.read.cipherFunction(record, state.read)) c$1.error(c$1, {
2372
- message: "Could not decrypt record or bad MAC.",
2373
- send: true,
2374
- alert: {
2375
- level: tls.Alert.Level.fatal,
2376
- description: tls.Alert.Description.bad_record_mac
2377
- }
2378
- });
2379
- else if (!state.read.compressFunction(c$1, record, state.read)) c$1.error(c$1, {
2380
- message: "Could not decompress record.",
2381
- send: true,
2382
- alert: {
2383
- level: tls.Alert.Level.fatal,
2384
- description: tls.Alert.Description.decompression_failure
2385
- }
2386
- });
2387
- return !c$1.fail;
2388
- };
2389
- state.write.update = function(c$1, record) {
2390
- if (!state.write.compressFunction(c$1, record, state.write)) c$1.error(c$1, {
2391
- message: "Could not compress record.",
2392
- send: false,
2393
- alert: {
2394
- level: tls.Alert.Level.fatal,
2395
- description: tls.Alert.Description.internal_error
2396
- }
2397
- });
2398
- else if (!state.write.cipherFunction(record, state.write)) c$1.error(c$1, {
2399
- message: "Could not encrypt record.",
2400
- send: false,
2401
- alert: {
2402
- level: tls.Alert.Level.fatal,
2403
- description: tls.Alert.Description.internal_error
2404
- }
2405
- });
2406
- return !c$1.fail;
2407
- };
2408
- if (c.session) {
2409
- var sp = c.session.sp;
2410
- c.session.cipherSuite.initSecurityParameters(sp);
2411
- sp.keys = tls.generateKeys(c, sp);
2412
- state.read.macKey = client ? sp.keys.server_write_MAC_key : sp.keys.client_write_MAC_key;
2413
- state.write.macKey = client ? sp.keys.client_write_MAC_key : sp.keys.server_write_MAC_key;
2414
- c.session.cipherSuite.initConnectionState(state, c, sp);
2415
- switch (sp.compression_algorithm) {
2416
- case tls.CompressionMethod.none: break;
2417
- case tls.CompressionMethod.deflate:
2418
- state.read.compressFunction = inflate;
2419
- state.write.compressFunction = deflate;
2420
- break;
2421
- default: throw new Error("Unsupported compression algorithm.");
2422
- }
2423
- }
2424
- return state;
2425
- };
2426
- /**
2427
- * Creates a Random structure.
2428
- *
2429
- * struct {
2430
- * uint32 gmt_unix_time;
2431
- * opaque random_bytes[28];
2432
- * } Random;
2433
- *
2434
- * gmt_unix_time:
2435
- * The current time and date in standard UNIX 32-bit format (seconds since
2436
- * the midnight starting Jan 1, 1970, UTC, ignoring leap seconds) according
2437
- * to the sender's internal clock. Clocks are not required to be set
2438
- * correctly by the basic TLS protocol; higher-level or application
2439
- * protocols may define additional requirements. Note that, for historical
2440
- * reasons, the data element is named using GMT, the predecessor of the
2441
- * current worldwide time base, UTC.
2442
- * random_bytes:
2443
- * 28 bytes generated by a secure random number generator.
2444
- *
2445
- * @return the Random structure as a byte array.
2446
- */
2447
- tls.createRandom = function() {
2448
- var d = /* @__PURE__ */ new Date();
2449
- var utc = +d + d.getTimezoneOffset() * 6e4;
2450
- var rval = forge.util.createBuffer();
2451
- rval.putInt32(utc);
2452
- rval.putBytes(forge.random.getBytes(28));
2453
- return rval;
2454
- };
2455
- /**
2456
- * Creates a TLS record with the given type and data.
2457
- *
2458
- * @param c the connection.
2459
- * @param options:
2460
- * type: the record type.
2461
- * data: the plain text data in a byte buffer.
2462
- *
2463
- * @return the created record.
2464
- */
2465
- tls.createRecord = function(c, options) {
2466
- if (!options.data) return null;
2467
- return {
2468
- type: options.type,
2469
- version: {
2470
- major: c.version.major,
2471
- minor: c.version.minor
2472
- },
2473
- length: options.data.length(),
2474
- fragment: options.data
2475
- };
2476
- };
2477
- /**
2478
- * Creates a TLS alert record.
2479
- *
2480
- * @param c the connection.
2481
- * @param alert:
2482
- * level: the TLS alert level.
2483
- * description: the TLS alert description.
2484
- *
2485
- * @return the created alert record.
2486
- */
2487
- tls.createAlert = function(c, alert) {
2488
- var b = forge.util.createBuffer();
2489
- b.putByte(alert.level);
2490
- b.putByte(alert.description);
2491
- return tls.createRecord(c, {
2492
- type: tls.ContentType.alert,
2493
- data: b
2494
- });
2495
- };
2496
- /**
2497
- * Creates a ClientHello message.
2498
- *
2499
- * opaque SessionID<0..32>;
2500
- * enum { null(0), deflate(1), (255) } CompressionMethod;
2501
- * uint8 CipherSuite[2];
2502
- *
2503
- * struct {
2504
- * ProtocolVersion client_version;
2505
- * Random random;
2506
- * SessionID session_id;
2507
- * CipherSuite cipher_suites<2..2^16-2>;
2508
- * CompressionMethod compression_methods<1..2^8-1>;
2509
- * select(extensions_present) {
2510
- * case false:
2511
- * struct {};
2512
- * case true:
2513
- * Extension extensions<0..2^16-1>;
2514
- * };
2515
- * } ClientHello;
2516
- *
2517
- * The extension format for extended client hellos and server hellos is:
2518
- *
2519
- * struct {
2520
- * ExtensionType extension_type;
2521
- * opaque extension_data<0..2^16-1>;
2522
- * } Extension;
2523
- *
2524
- * Here:
2525
- *
2526
- * - "extension_type" identifies the particular extension type.
2527
- * - "extension_data" contains information specific to the particular
2528
- * extension type.
2529
- *
2530
- * The extension types defined in this document are:
2531
- *
2532
- * enum {
2533
- * server_name(0), max_fragment_length(1),
2534
- * client_certificate_url(2), trusted_ca_keys(3),
2535
- * truncated_hmac(4), status_request(5), (65535)
2536
- * } ExtensionType;
2537
- *
2538
- * @param c the connection.
2539
- *
2540
- * @return the ClientHello byte buffer.
2541
- */
2542
- tls.createClientHello = function(c) {
2543
- c.session.clientHelloVersion = {
2544
- major: c.version.major,
2545
- minor: c.version.minor
2546
- };
2547
- var cipherSuites = forge.util.createBuffer();
2548
- for (var i = 0; i < c.cipherSuites.length; ++i) {
2549
- var cs = c.cipherSuites[i];
2550
- cipherSuites.putByte(cs.id[0]);
2551
- cipherSuites.putByte(cs.id[1]);
2552
- }
2553
- var cSuites = cipherSuites.length();
2554
- var compressionMethods = forge.util.createBuffer();
2555
- compressionMethods.putByte(tls.CompressionMethod.none);
2556
- var cMethods = compressionMethods.length();
2557
- var extensions = forge.util.createBuffer();
2558
- if (c.virtualHost) {
2559
- var ext = forge.util.createBuffer();
2560
- ext.putByte(0);
2561
- ext.putByte(0);
2562
- var serverName = forge.util.createBuffer();
2563
- serverName.putByte(0);
2564
- writeVector(serverName, 2, forge.util.createBuffer(c.virtualHost));
2565
- var snList = forge.util.createBuffer();
2566
- writeVector(snList, 2, serverName);
2567
- writeVector(ext, 2, snList);
2568
- extensions.putBuffer(ext);
2569
- }
2570
- var extLength = extensions.length();
2571
- if (extLength > 0) extLength += 2;
2572
- var sessionId = c.session.id;
2573
- var length = sessionId.length + 1 + 2 + 4 + 28 + 2 + cSuites + 1 + cMethods + extLength;
2574
- var rval = forge.util.createBuffer();
2575
- rval.putByte(tls.HandshakeType.client_hello);
2576
- rval.putInt24(length);
2577
- rval.putByte(c.version.major);
2578
- rval.putByte(c.version.minor);
2579
- rval.putBytes(c.session.sp.client_random);
2580
- writeVector(rval, 1, forge.util.createBuffer(sessionId));
2581
- writeVector(rval, 2, cipherSuites);
2582
- writeVector(rval, 1, compressionMethods);
2583
- if (extLength > 0) writeVector(rval, 2, extensions);
2584
- return rval;
2585
- };
2586
- /**
2587
- * Creates a ServerHello message.
2588
- *
2589
- * @param c the connection.
2590
- *
2591
- * @return the ServerHello byte buffer.
2592
- */
2593
- tls.createServerHello = function(c) {
2594
- var sessionId = c.session.id;
2595
- var length = sessionId.length + 1 + 2 + 4 + 28 + 2 + 1;
2596
- var rval = forge.util.createBuffer();
2597
- rval.putByte(tls.HandshakeType.server_hello);
2598
- rval.putInt24(length);
2599
- rval.putByte(c.version.major);
2600
- rval.putByte(c.version.minor);
2601
- rval.putBytes(c.session.sp.server_random);
2602
- writeVector(rval, 1, forge.util.createBuffer(sessionId));
2603
- rval.putByte(c.session.cipherSuite.id[0]);
2604
- rval.putByte(c.session.cipherSuite.id[1]);
2605
- rval.putByte(c.session.compressionMethod);
2606
- return rval;
2607
- };
2608
- /**
2609
- * Creates a Certificate message.
2610
- *
2611
- * When this message will be sent:
2612
- * This is the first message the client can send after receiving a server
2613
- * hello done message and the first message the server can send after
2614
- * sending a ServerHello. This client message is only sent if the server
2615
- * requests a certificate. If no suitable certificate is available, the
2616
- * client should send a certificate message containing no certificates. If
2617
- * client authentication is required by the server for the handshake to
2618
- * continue, it may respond with a fatal handshake failure alert.
2619
- *
2620
- * opaque ASN.1Cert<1..2^24-1>;
2621
- *
2622
- * struct {
2623
- * ASN.1Cert certificate_list<0..2^24-1>;
2624
- * } Certificate;
2625
- *
2626
- * @param c the connection.
2627
- *
2628
- * @return the Certificate byte buffer.
2629
- */
2630
- tls.createCertificate = function(c) {
2631
- var client = c.entity === tls.ConnectionEnd.client;
2632
- var cert = null;
2633
- if (c.getCertificate) {
2634
- var hint;
2635
- if (client) hint = c.session.certificateRequest;
2636
- else hint = c.session.extensions.server_name.serverNameList;
2637
- cert = c.getCertificate(c, hint);
2638
- }
2639
- var certList = forge.util.createBuffer();
2640
- if (cert !== null) try {
2641
- if (!forge.util.isArray(cert)) cert = [cert];
2642
- var asn1 = null;
2643
- for (var i = 0; i < cert.length; ++i) {
2644
- var msg = forge.pem.decode(cert[i])[0];
2645
- if (msg.type !== "CERTIFICATE" && msg.type !== "X509 CERTIFICATE" && msg.type !== "TRUSTED CERTIFICATE") {
2646
- var error = /* @__PURE__ */ new Error("Could not convert certificate from PEM; PEM header type is not \"CERTIFICATE\", \"X509 CERTIFICATE\", or \"TRUSTED CERTIFICATE\".");
2647
- error.headerType = msg.type;
2648
- throw error;
2649
- }
2650
- if (msg.procType && msg.procType.type === "ENCRYPTED") throw new Error("Could not convert certificate from PEM; PEM is encrypted.");
2651
- var der = forge.util.createBuffer(msg.body);
2652
- if (asn1 === null) asn1 = forge.asn1.fromDer(der.bytes(), false);
2653
- var certBuffer = forge.util.createBuffer();
2654
- writeVector(certBuffer, 3, der);
2655
- certList.putBuffer(certBuffer);
2656
- }
2657
- cert = forge.pki.certificateFromAsn1(asn1);
2658
- if (client) c.session.clientCertificate = cert;
2659
- else c.session.serverCertificate = cert;
2660
- } catch (ex) {
2661
- return c.error(c, {
2662
- message: "Could not send certificate list.",
2663
- cause: ex,
2664
- send: true,
2665
- alert: {
2666
- level: tls.Alert.Level.fatal,
2667
- description: tls.Alert.Description.bad_certificate
2668
- }
2669
- });
2670
- }
2671
- var length = 3 + certList.length();
2672
- var rval = forge.util.createBuffer();
2673
- rval.putByte(tls.HandshakeType.certificate);
2674
- rval.putInt24(length);
2675
- writeVector(rval, 3, certList);
2676
- return rval;
2677
- };
2678
- /**
2679
- * Creates a ClientKeyExchange message.
2680
- *
2681
- * When this message will be sent:
2682
- * This message is always sent by the client. It will immediately follow the
2683
- * client certificate message, if it is sent. Otherwise it will be the first
2684
- * message sent by the client after it receives the server hello done
2685
- * message.
2686
- *
2687
- * Meaning of this message:
2688
- * With this message, the premaster secret is set, either though direct
2689
- * transmission of the RSA-encrypted secret, or by the transmission of
2690
- * Diffie-Hellman parameters which will allow each side to agree upon the
2691
- * same premaster secret. When the key exchange method is DH_RSA or DH_DSS,
2692
- * client certification has been requested, and the client was able to
2693
- * respond with a certificate which contained a Diffie-Hellman public key
2694
- * whose parameters (group and generator) matched those specified by the
2695
- * server in its certificate, this message will not contain any data.
2696
- *
2697
- * Meaning of this message:
2698
- * If RSA is being used for key agreement and authentication, the client
2699
- * generates a 48-byte premaster secret, encrypts it using the public key
2700
- * from the server's certificate or the temporary RSA key provided in a
2701
- * server key exchange message, and sends the result in an encrypted
2702
- * premaster secret message. This structure is a variant of the client
2703
- * key exchange message, not a message in itself.
2704
- *
2705
- * struct {
2706
- * select(KeyExchangeAlgorithm) {
2707
- * case rsa: EncryptedPreMasterSecret;
2708
- * case diffie_hellman: ClientDiffieHellmanPublic;
2709
- * } exchange_keys;
2710
- * } ClientKeyExchange;
2711
- *
2712
- * struct {
2713
- * ProtocolVersion client_version;
2714
- * opaque random[46];
2715
- * } PreMasterSecret;
2716
- *
2717
- * struct {
2718
- * public-key-encrypted PreMasterSecret pre_master_secret;
2719
- * } EncryptedPreMasterSecret;
2720
- *
2721
- * A public-key-encrypted element is encoded as a vector <0..2^16-1>.
2722
- *
2723
- * @param c the connection.
2724
- *
2725
- * @return the ClientKeyExchange byte buffer.
2726
- */
2727
- tls.createClientKeyExchange = function(c) {
2728
- var b = forge.util.createBuffer();
2729
- b.putByte(c.session.clientHelloVersion.major);
2730
- b.putByte(c.session.clientHelloVersion.minor);
2731
- b.putBytes(forge.random.getBytes(46));
2732
- var sp = c.session.sp;
2733
- sp.pre_master_secret = b.getBytes();
2734
- b = c.session.serverCertificate.publicKey.encrypt(sp.pre_master_secret);
2735
- var length = b.length + 2;
2736
- var rval = forge.util.createBuffer();
2737
- rval.putByte(tls.HandshakeType.client_key_exchange);
2738
- rval.putInt24(length);
2739
- rval.putInt16(b.length);
2740
- rval.putBytes(b);
2741
- return rval;
2742
- };
2743
- /**
2744
- * Creates a ServerKeyExchange message.
2745
- *
2746
- * @param c the connection.
2747
- *
2748
- * @return the ServerKeyExchange byte buffer.
2749
- */
2750
- tls.createServerKeyExchange = function(c) {
2751
- var length = 0;
2752
- var rval = forge.util.createBuffer();
2753
- if (length > 0) {
2754
- rval.putByte(tls.HandshakeType.server_key_exchange);
2755
- rval.putInt24(length);
2756
- }
2757
- return rval;
2758
- };
2759
- /**
2760
- * Gets the signed data used to verify a client-side certificate. See
2761
- * tls.createCertificateVerify() for details.
2762
- *
2763
- * @param c the connection.
2764
- * @param callback the callback to call once the signed data is ready.
2765
- */
2766
- tls.getClientSignature = function(c, callback) {
2767
- var b = forge.util.createBuffer();
2768
- b.putBuffer(c.session.md5.digest());
2769
- b.putBuffer(c.session.sha1.digest());
2770
- b = b.getBytes();
2771
- c.getSignature = c.getSignature || function(c$1, b$1, callback$1) {
2772
- var privateKey = null;
2773
- if (c$1.getPrivateKey) try {
2774
- privateKey = c$1.getPrivateKey(c$1, c$1.session.clientCertificate);
2775
- privateKey = forge.pki.privateKeyFromPem(privateKey);
2776
- } catch (ex) {
2777
- c$1.error(c$1, {
2778
- message: "Could not get private key.",
2779
- cause: ex,
2780
- send: true,
2781
- alert: {
2782
- level: tls.Alert.Level.fatal,
2783
- description: tls.Alert.Description.internal_error
2784
- }
2785
- });
2786
- }
2787
- if (privateKey === null) c$1.error(c$1, {
2788
- message: "No private key set.",
2789
- send: true,
2790
- alert: {
2791
- level: tls.Alert.Level.fatal,
2792
- description: tls.Alert.Description.internal_error
2793
- }
2794
- });
2795
- else b$1 = privateKey.sign(b$1, null);
2796
- callback$1(c$1, b$1);
2797
- };
2798
- c.getSignature(c, b, callback);
2799
- };
2800
- /**
2801
- * Creates a CertificateVerify message.
2802
- *
2803
- * Meaning of this message:
2804
- * This structure conveys the client's Diffie-Hellman public value
2805
- * (Yc) if it was not already included in the client's certificate.
2806
- * The encoding used for Yc is determined by the enumerated
2807
- * PublicValueEncoding. This structure is a variant of the client
2808
- * key exchange message, not a message in itself.
2809
- *
2810
- * When this message will be sent:
2811
- * This message is used to provide explicit verification of a client
2812
- * certificate. This message is only sent following a client
2813
- * certificate that has signing capability (i.e. all certificates
2814
- * except those containing fixed Diffie-Hellman parameters). When
2815
- * sent, it will immediately follow the client key exchange message.
2816
- *
2817
- * struct {
2818
- * Signature signature;
2819
- * } CertificateVerify;
2820
- *
2821
- * CertificateVerify.signature.md5_hash
2822
- * MD5(handshake_messages);
2823
- *
2824
- * Certificate.signature.sha_hash
2825
- * SHA(handshake_messages);
2826
- *
2827
- * Here handshake_messages refers to all handshake messages sent or
2828
- * received starting at client hello up to but not including this
2829
- * message, including the type and length fields of the handshake
2830
- * messages.
2831
- *
2832
- * select(SignatureAlgorithm) {
2833
- * case anonymous: struct { };
2834
- * case rsa:
2835
- * digitally-signed struct {
2836
- * opaque md5_hash[16];
2837
- * opaque sha_hash[20];
2838
- * };
2839
- * case dsa:
2840
- * digitally-signed struct {
2841
- * opaque sha_hash[20];
2842
- * };
2843
- * } Signature;
2844
- *
2845
- * In digital signing, one-way hash functions are used as input for a
2846
- * signing algorithm. A digitally-signed element is encoded as an opaque
2847
- * vector <0..2^16-1>, where the length is specified by the signing
2848
- * algorithm and key.
2849
- *
2850
- * In RSA signing, a 36-byte structure of two hashes (one SHA and one
2851
- * MD5) is signed (encrypted with the private key). It is encoded with
2852
- * PKCS #1 block type 0 or type 1 as described in [PKCS1].
2853
- *
2854
- * In DSS, the 20 bytes of the SHA hash are run directly through the
2855
- * Digital Signing Algorithm with no additional hashing.
2856
- *
2857
- * @param c the connection.
2858
- * @param signature the signature to include in the message.
2859
- *
2860
- * @return the CertificateVerify byte buffer.
2861
- */
2862
- tls.createCertificateVerify = function(c, signature) {
2863
- var length = signature.length + 2;
2864
- var rval = forge.util.createBuffer();
2865
- rval.putByte(tls.HandshakeType.certificate_verify);
2866
- rval.putInt24(length);
2867
- rval.putInt16(signature.length);
2868
- rval.putBytes(signature);
2869
- return rval;
2870
- };
2871
- /**
2872
- * Creates a CertificateRequest message.
2873
- *
2874
- * @param c the connection.
2875
- *
2876
- * @return the CertificateRequest byte buffer.
2877
- */
2878
- tls.createCertificateRequest = function(c) {
2879
- var certTypes = forge.util.createBuffer();
2880
- certTypes.putByte(1);
2881
- var cAs = forge.util.createBuffer();
2882
- for (var key$1 in c.caStore.certs) {
2883
- var cert = c.caStore.certs[key$1];
2884
- var dn = forge.pki.distinguishedNameToAsn1(cert.subject);
2885
- var byteBuffer = forge.asn1.toDer(dn);
2886
- cAs.putInt16(byteBuffer.length());
2887
- cAs.putBuffer(byteBuffer);
2888
- }
2889
- var length = 1 + certTypes.length() + 2 + cAs.length();
2890
- var rval = forge.util.createBuffer();
2891
- rval.putByte(tls.HandshakeType.certificate_request);
2892
- rval.putInt24(length);
2893
- writeVector(rval, 1, certTypes);
2894
- writeVector(rval, 2, cAs);
2895
- return rval;
2896
- };
2897
- /**
2898
- * Creates a ServerHelloDone message.
2899
- *
2900
- * @param c the connection.
2901
- *
2902
- * @return the ServerHelloDone byte buffer.
2903
- */
2904
- tls.createServerHelloDone = function(c) {
2905
- var rval = forge.util.createBuffer();
2906
- rval.putByte(tls.HandshakeType.server_hello_done);
2907
- rval.putInt24(0);
2908
- return rval;
2909
- };
2910
- /**
2911
- * Creates a ChangeCipherSpec message.
2912
- *
2913
- * The change cipher spec protocol exists to signal transitions in
2914
- * ciphering strategies. The protocol consists of a single message,
2915
- * which is encrypted and compressed under the current (not the pending)
2916
- * connection state. The message consists of a single byte of value 1.
2917
- *
2918
- * struct {
2919
- * enum { change_cipher_spec(1), (255) } type;
2920
- * } ChangeCipherSpec;
2921
- *
2922
- * @return the ChangeCipherSpec byte buffer.
2923
- */
2924
- tls.createChangeCipherSpec = function() {
2925
- var rval = forge.util.createBuffer();
2926
- rval.putByte(1);
2927
- return rval;
2928
- };
2929
- /**
2930
- * Creates a Finished message.
2931
- *
2932
- * struct {
2933
- * opaque verify_data[12];
2934
- * } Finished;
2935
- *
2936
- * verify_data
2937
- * PRF(master_secret, finished_label, MD5(handshake_messages) +
2938
- * SHA-1(handshake_messages)) [0..11];
2939
- *
2940
- * finished_label
2941
- * For Finished messages sent by the client, the string "client
2942
- * finished". For Finished messages sent by the server, the
2943
- * string "server finished".
2944
- *
2945
- * handshake_messages
2946
- * All of the data from all handshake messages up to but not
2947
- * including this message. This is only data visible at the
2948
- * handshake layer and does not include record layer headers.
2949
- * This is the concatenation of all the Handshake structures as
2950
- * defined in 7.4 exchanged thus far.
2951
- *
2952
- * @param c the connection.
2953
- *
2954
- * @return the Finished byte buffer.
2955
- */
2956
- tls.createFinished = function(c) {
2957
- var b = forge.util.createBuffer();
2958
- b.putBuffer(c.session.md5.digest());
2959
- b.putBuffer(c.session.sha1.digest());
2960
- var client = c.entity === tls.ConnectionEnd.client;
2961
- var sp = c.session.sp;
2962
- var vdl = 12;
2963
- var prf = prf_TLS1;
2964
- var label = client ? "client finished" : "server finished";
2965
- b = prf(sp.master_secret, label, b.getBytes(), vdl);
2966
- var rval = forge.util.createBuffer();
2967
- rval.putByte(tls.HandshakeType.finished);
2968
- rval.putInt24(b.length());
2969
- rval.putBuffer(b);
2970
- return rval;
2971
- };
2972
- /**
2973
- * Creates a HeartbeatMessage (See RFC 6520).
2974
- *
2975
- * struct {
2976
- * HeartbeatMessageType type;
2977
- * uint16 payload_length;
2978
- * opaque payload[HeartbeatMessage.payload_length];
2979
- * opaque padding[padding_length];
2980
- * } HeartbeatMessage;
2981
- *
2982
- * The total length of a HeartbeatMessage MUST NOT exceed 2^14 or
2983
- * max_fragment_length when negotiated as defined in [RFC6066].
2984
- *
2985
- * type: The message type, either heartbeat_request or heartbeat_response.
2986
- *
2987
- * payload_length: The length of the payload.
2988
- *
2989
- * payload: The payload consists of arbitrary content.
2990
- *
2991
- * padding: The padding is random content that MUST be ignored by the
2992
- * receiver. The length of a HeartbeatMessage is TLSPlaintext.length
2993
- * for TLS and DTLSPlaintext.length for DTLS. Furthermore, the
2994
- * length of the type field is 1 byte, and the length of the
2995
- * payload_length is 2. Therefore, the padding_length is
2996
- * TLSPlaintext.length - payload_length - 3 for TLS and
2997
- * DTLSPlaintext.length - payload_length - 3 for DTLS. The
2998
- * padding_length MUST be at least 16.
2999
- *
3000
- * The sender of a HeartbeatMessage MUST use a random padding of at
3001
- * least 16 bytes. The padding of a received HeartbeatMessage message
3002
- * MUST be ignored.
3003
- *
3004
- * If the payload_length of a received HeartbeatMessage is too large,
3005
- * the received HeartbeatMessage MUST be discarded silently.
3006
- *
3007
- * @param c the connection.
3008
- * @param type the tls.HeartbeatMessageType.
3009
- * @param payload the heartbeat data to send as the payload.
3010
- * @param [payloadLength] the payload length to use, defaults to the
3011
- * actual payload length.
3012
- *
3013
- * @return the HeartbeatRequest byte buffer.
3014
- */
3015
- tls.createHeartbeat = function(type, payload, payloadLength) {
3016
- if (typeof payloadLength === "undefined") payloadLength = payload.length;
3017
- var rval = forge.util.createBuffer();
3018
- rval.putByte(type);
3019
- rval.putInt16(payloadLength);
3020
- rval.putBytes(payload);
3021
- var plaintextLength = rval.length();
3022
- var paddingLength = Math.max(16, plaintextLength - payloadLength - 3);
3023
- rval.putBytes(forge.random.getBytes(paddingLength));
3024
- return rval;
3025
- };
3026
- /**
3027
- * Fragments, compresses, encrypts, and queues a record for delivery.
3028
- *
3029
- * @param c the connection.
3030
- * @param record the record to queue.
3031
- */
3032
- tls.queue = function(c, record) {
3033
- if (!record) return;
3034
- if (record.fragment.length() === 0) {
3035
- if (record.type === tls.ContentType.handshake || record.type === tls.ContentType.alert || record.type === tls.ContentType.change_cipher_spec) return;
3036
- }
3037
- if (record.type === tls.ContentType.handshake) {
3038
- var bytes = record.fragment.bytes();
3039
- c.session.md5.update(bytes);
3040
- c.session.sha1.update(bytes);
3041
- bytes = null;
3042
- }
3043
- var records;
3044
- if (record.fragment.length() <= tls.MaxFragment) records = [record];
3045
- else {
3046
- records = [];
3047
- var data = record.fragment.bytes();
3048
- while (data.length > tls.MaxFragment) {
3049
- records.push(tls.createRecord(c, {
3050
- type: record.type,
3051
- data: forge.util.createBuffer(data.slice(0, tls.MaxFragment))
3052
- }));
3053
- data = data.slice(tls.MaxFragment);
3054
- }
3055
- if (data.length > 0) records.push(tls.createRecord(c, {
3056
- type: record.type,
3057
- data: forge.util.createBuffer(data)
3058
- }));
3059
- }
3060
- for (var i = 0; i < records.length && !c.fail; ++i) {
3061
- var rec = records[i];
3062
- if (c.state.current.write.update(c, rec)) c.records.push(rec);
3063
- }
3064
- };
3065
- /**
3066
- * Flushes all queued records to the output buffer and calls the
3067
- * tlsDataReady() handler on the given connection.
3068
- *
3069
- * @param c the connection.
3070
- *
3071
- * @return true on success, false on failure.
3072
- */
3073
- tls.flush = function(c) {
3074
- for (var i = 0; i < c.records.length; ++i) {
3075
- var record = c.records[i];
3076
- c.tlsData.putByte(record.type);
3077
- c.tlsData.putByte(record.version.major);
3078
- c.tlsData.putByte(record.version.minor);
3079
- c.tlsData.putInt16(record.fragment.length());
3080
- c.tlsData.putBuffer(c.records[i].fragment);
3081
- }
3082
- c.records = [];
3083
- return c.tlsDataReady(c);
3084
- };
3085
- /**
3086
- * Maps a pki.certificateError to a tls.Alert.Description.
3087
- *
3088
- * @param error the error to map.
3089
- *
3090
- * @return the alert description.
3091
- */
3092
- var _certErrorToAlertDesc = function(error) {
3093
- switch (error) {
3094
- case true: return true;
3095
- case forge.pki.certificateError.bad_certificate: return tls.Alert.Description.bad_certificate;
3096
- case forge.pki.certificateError.unsupported_certificate: return tls.Alert.Description.unsupported_certificate;
3097
- case forge.pki.certificateError.certificate_revoked: return tls.Alert.Description.certificate_revoked;
3098
- case forge.pki.certificateError.certificate_expired: return tls.Alert.Description.certificate_expired;
3099
- case forge.pki.certificateError.certificate_unknown: return tls.Alert.Description.certificate_unknown;
3100
- case forge.pki.certificateError.unknown_ca: return tls.Alert.Description.unknown_ca;
3101
- default: return tls.Alert.Description.bad_certificate;
3102
- }
3103
- };
3104
- /**
3105
- * Maps a tls.Alert.Description to a pki.certificateError.
3106
- *
3107
- * @param desc the alert description.
3108
- *
3109
- * @return the certificate error.
3110
- */
3111
- var _alertDescToCertError = function(desc) {
3112
- switch (desc) {
3113
- case true: return true;
3114
- case tls.Alert.Description.bad_certificate: return forge.pki.certificateError.bad_certificate;
3115
- case tls.Alert.Description.unsupported_certificate: return forge.pki.certificateError.unsupported_certificate;
3116
- case tls.Alert.Description.certificate_revoked: return forge.pki.certificateError.certificate_revoked;
3117
- case tls.Alert.Description.certificate_expired: return forge.pki.certificateError.certificate_expired;
3118
- case tls.Alert.Description.certificate_unknown: return forge.pki.certificateError.certificate_unknown;
3119
- case tls.Alert.Description.unknown_ca: return forge.pki.certificateError.unknown_ca;
3120
- default: return forge.pki.certificateError.bad_certificate;
3121
- }
3122
- };
3123
- /**
3124
- * Verifies a certificate chain against the given connection's
3125
- * Certificate Authority store.
3126
- *
3127
- * @param c the TLS connection.
3128
- * @param chain the certificate chain to verify, with the root or highest
3129
- * authority at the end.
3130
- *
3131
- * @return true if successful, false if not.
3132
- */
3133
- tls.verifyCertificateChain = function(c, chain) {
3134
- try {
3135
- var options = {};
3136
- for (var key$1 in c.verifyOptions) options[key$1] = c.verifyOptions[key$1];
3137
- options.verify = function(vfd, depth, chain$1) {
3138
- _certErrorToAlertDesc(vfd);
3139
- var ret = c.verify(c, vfd, depth, chain$1);
3140
- if (ret !== true) {
3141
- if (typeof ret === "object" && !forge.util.isArray(ret)) {
3142
- var error = /* @__PURE__ */ new Error("The application rejected the certificate.");
3143
- error.send = true;
3144
- error.alert = {
3145
- level: tls.Alert.Level.fatal,
3146
- description: tls.Alert.Description.bad_certificate
3147
- };
3148
- if (ret.message) error.message = ret.message;
3149
- if (ret.alert) error.alert.description = ret.alert;
3150
- throw error;
3151
- }
3152
- if (ret !== vfd) ret = _alertDescToCertError(ret);
3153
- }
3154
- return ret;
3155
- };
3156
- forge.pki.verifyCertificateChain(c.caStore, chain, options);
3157
- } catch (ex) {
3158
- var err = ex;
3159
- if (typeof err !== "object" || forge.util.isArray(err)) err = {
3160
- send: true,
3161
- alert: {
3162
- level: tls.Alert.Level.fatal,
3163
- description: _certErrorToAlertDesc(ex)
3164
- }
3165
- };
3166
- if (!("send" in err)) err.send = true;
3167
- if (!("alert" in err)) err.alert = {
3168
- level: tls.Alert.Level.fatal,
3169
- description: _certErrorToAlertDesc(err.error)
3170
- };
3171
- c.error(c, err);
3172
- }
3173
- return !c.fail;
3174
- };
3175
- /**
3176
- * Creates a new TLS session cache.
3177
- *
3178
- * @param cache optional map of session ID to cached session.
3179
- * @param capacity the maximum size for the cache (default: 100).
3180
- *
3181
- * @return the new TLS session cache.
3182
- */
3183
- tls.createSessionCache = function(cache, capacity) {
3184
- var rval = null;
3185
- if (cache && cache.getSession && cache.setSession && cache.order) rval = cache;
3186
- else {
3187
- rval = {};
3188
- rval.cache = cache || {};
3189
- rval.capacity = Math.max(capacity || 100, 1);
3190
- rval.order = [];
3191
- for (var key$1 in cache) if (rval.order.length <= capacity) rval.order.push(key$1);
3192
- else delete cache[key$1];
3193
- rval.getSession = function(sessionId) {
3194
- var session = null;
3195
- var key$2 = null;
3196
- if (sessionId) key$2 = forge.util.bytesToHex(sessionId);
3197
- else if (rval.order.length > 0) key$2 = rval.order[0];
3198
- if (key$2 !== null && key$2 in rval.cache) {
3199
- session = rval.cache[key$2];
3200
- delete rval.cache[key$2];
3201
- for (var i in rval.order) if (rval.order[i] === key$2) {
3202
- rval.order.splice(i, 1);
3203
- break;
3204
- }
3205
- }
3206
- return session;
3207
- };
3208
- rval.setSession = function(sessionId, session) {
3209
- if (rval.order.length === rval.capacity) {
3210
- var key$2 = rval.order.shift();
3211
- delete rval.cache[key$2];
3212
- }
3213
- var key$2 = forge.util.bytesToHex(sessionId);
3214
- rval.order.push(key$2);
3215
- rval.cache[key$2] = session;
3216
- };
3217
- }
3218
- return rval;
3219
- };
3220
- /**
3221
- * Creates a new TLS connection.
3222
- *
3223
- * See public createConnection() docs for more details.
3224
- *
3225
- * @param options the options for this connection.
3226
- *
3227
- * @return the new TLS connection.
3228
- */
3229
- tls.createConnection = function(options) {
3230
- var caStore = null;
3231
- if (options.caStore) if (forge.util.isArray(options.caStore)) caStore = forge.pki.createCaStore(options.caStore);
3232
- else caStore = options.caStore;
3233
- else caStore = forge.pki.createCaStore();
3234
- var cipherSuites = options.cipherSuites || null;
3235
- if (cipherSuites === null) {
3236
- cipherSuites = [];
3237
- for (var key$1 in tls.CipherSuites) cipherSuites.push(tls.CipherSuites[key$1]);
3238
- }
3239
- var entity = options.server || false ? tls.ConnectionEnd.server : tls.ConnectionEnd.client;
3240
- var sessionCache = options.sessionCache ? tls.createSessionCache(options.sessionCache) : null;
3241
- var c = {
3242
- version: {
3243
- major: tls.Version.major,
3244
- minor: tls.Version.minor
3245
- },
3246
- entity,
3247
- sessionId: options.sessionId,
3248
- caStore,
3249
- sessionCache,
3250
- cipherSuites,
3251
- connected: options.connected,
3252
- virtualHost: options.virtualHost || null,
3253
- verifyClient: options.verifyClient || false,
3254
- verify: options.verify || function(cn, vfd, dpth, cts) {
3255
- return vfd;
3256
- },
3257
- verifyOptions: options.verifyOptions || {},
3258
- getCertificate: options.getCertificate || null,
3259
- getPrivateKey: options.getPrivateKey || null,
3260
- getSignature: options.getSignature || null,
3261
- input: forge.util.createBuffer(),
3262
- tlsData: forge.util.createBuffer(),
3263
- data: forge.util.createBuffer(),
3264
- tlsDataReady: options.tlsDataReady,
3265
- dataReady: options.dataReady,
3266
- heartbeatReceived: options.heartbeatReceived,
3267
- closed: options.closed,
3268
- error: function(c$1, ex) {
3269
- ex.origin = ex.origin || (c$1.entity === tls.ConnectionEnd.client ? "client" : "server");
3270
- if (ex.send) {
3271
- tls.queue(c$1, tls.createAlert(c$1, ex.alert));
3272
- tls.flush(c$1);
3273
- }
3274
- var fatal = ex.fatal !== false;
3275
- if (fatal) c$1.fail = true;
3276
- options.error(c$1, ex);
3277
- if (fatal) c$1.close(false);
3278
- },
3279
- deflate: options.deflate || null,
3280
- inflate: options.inflate || null
3281
- };
3282
- /**
3283
- * Resets a closed TLS connection for reuse. Called in c.close().
3284
- *
3285
- * @param clearFail true to clear the fail flag (default: true).
3286
- */
3287
- c.reset = function(clearFail) {
3288
- c.version = {
3289
- major: tls.Version.major,
3290
- minor: tls.Version.minor
3291
- };
3292
- c.record = null;
3293
- c.session = null;
3294
- c.peerCertificate = null;
3295
- c.state = {
3296
- pending: null,
3297
- current: null
3298
- };
3299
- c.expect = c.entity === tls.ConnectionEnd.client ? SHE : CHE;
3300
- c.fragmented = null;
3301
- c.records = [];
3302
- c.open = false;
3303
- c.handshakes = 0;
3304
- c.handshaking = false;
3305
- c.isConnected = false;
3306
- c.fail = !(clearFail || typeof clearFail === "undefined");
3307
- c.input.clear();
3308
- c.tlsData.clear();
3309
- c.data.clear();
3310
- c.state.current = tls.createConnectionState(c);
3311
- };
3312
- c.reset();
3313
- /**
3314
- * Updates the current TLS engine state based on the given record.
3315
- *
3316
- * @param c the TLS connection.
3317
- * @param record the TLS record to act on.
3318
- */
3319
- var _update = function(c$1, record) {
3320
- var aligned = record.type - tls.ContentType.change_cipher_spec;
3321
- var handlers = ctTable[c$1.entity][c$1.expect];
3322
- if (aligned in handlers) handlers[aligned](c$1, record);
3323
- else tls.handleUnexpected(c$1, record);
3324
- };
3325
- /**
3326
- * Reads the record header and initializes the next record on the given
3327
- * connection.
3328
- *
3329
- * @param c the TLS connection with the next record.
3330
- *
3331
- * @return 0 if the input data could be processed, otherwise the
3332
- * number of bytes required for data to be processed.
3333
- */
3334
- var _readRecordHeader = function(c$1) {
3335
- var rval = 0;
3336
- var b = c$1.input;
3337
- var len = b.length();
3338
- if (len < 5) rval = 5 - len;
3339
- else {
3340
- c$1.record = {
3341
- type: b.getByte(),
3342
- version: {
3343
- major: b.getByte(),
3344
- minor: b.getByte()
3345
- },
3346
- length: b.getInt16(),
3347
- fragment: forge.util.createBuffer(),
3348
- ready: false
3349
- };
3350
- var compatibleVersion = c$1.record.version.major === c$1.version.major;
3351
- if (compatibleVersion && c$1.session && c$1.session.version) compatibleVersion = c$1.record.version.minor === c$1.version.minor;
3352
- if (!compatibleVersion) c$1.error(c$1, {
3353
- message: "Incompatible TLS version.",
3354
- send: true,
3355
- alert: {
3356
- level: tls.Alert.Level.fatal,
3357
- description: tls.Alert.Description.protocol_version
3358
- }
3359
- });
3360
- }
3361
- return rval;
3362
- };
3363
- /**
3364
- * Reads the next record's contents and appends its message to any
3365
- * previously fragmented message.
3366
- *
3367
- * @param c the TLS connection with the next record.
3368
- *
3369
- * @return 0 if the input data could be processed, otherwise the
3370
- * number of bytes required for data to be processed.
3371
- */
3372
- var _readRecord = function(c$1) {
3373
- var rval = 0;
3374
- var b = c$1.input;
3375
- var len = b.length();
3376
- if (len < c$1.record.length) rval = c$1.record.length - len;
3377
- else {
3378
- c$1.record.fragment.putBytes(b.getBytes(c$1.record.length));
3379
- b.compact();
3380
- if (c$1.state.current.read.update(c$1, c$1.record)) {
3381
- if (c$1.fragmented !== null) if (c$1.fragmented.type === c$1.record.type) {
3382
- c$1.fragmented.fragment.putBuffer(c$1.record.fragment);
3383
- c$1.record = c$1.fragmented;
3384
- } else c$1.error(c$1, {
3385
- message: "Invalid fragmented record.",
3386
- send: true,
3387
- alert: {
3388
- level: tls.Alert.Level.fatal,
3389
- description: tls.Alert.Description.unexpected_message
3390
- }
3391
- });
3392
- c$1.record.ready = true;
3393
- }
3394
- }
3395
- return rval;
3396
- };
3397
- /**
3398
- * Performs a handshake using the TLS Handshake Protocol, as a client.
3399
- *
3400
- * This method should only be called if the connection is in client mode.
3401
- *
3402
- * @param sessionId the session ID to use, null to start a new one.
3403
- */
3404
- c.handshake = function(sessionId) {
3405
- if (c.entity !== tls.ConnectionEnd.client) c.error(c, {
3406
- message: "Cannot initiate handshake as a server.",
3407
- fatal: false
3408
- });
3409
- else if (c.handshaking) c.error(c, {
3410
- message: "Handshake already in progress.",
3411
- fatal: false
3412
- });
3413
- else {
3414
- if (c.fail && !c.open && c.handshakes === 0) c.fail = false;
3415
- c.handshaking = true;
3416
- sessionId = sessionId || "";
3417
- var session = null;
3418
- if (sessionId.length > 0) {
3419
- if (c.sessionCache) session = c.sessionCache.getSession(sessionId);
3420
- if (session === null) sessionId = "";
3421
- }
3422
- if (sessionId.length === 0 && c.sessionCache) {
3423
- session = c.sessionCache.getSession();
3424
- if (session !== null) sessionId = session.id;
3425
- }
3426
- c.session = {
3427
- id: sessionId,
3428
- version: null,
3429
- cipherSuite: null,
3430
- compressionMethod: null,
3431
- serverCertificate: null,
3432
- certificateRequest: null,
3433
- clientCertificate: null,
3434
- sp: {},
3435
- md5: forge.md.md5.create(),
3436
- sha1: forge.md.sha1.create()
3437
- };
3438
- if (session) {
3439
- c.version = session.version;
3440
- c.session.sp = session.sp;
3441
- }
3442
- c.session.sp.client_random = tls.createRandom().getBytes();
3443
- c.open = true;
3444
- tls.queue(c, tls.createRecord(c, {
3445
- type: tls.ContentType.handshake,
3446
- data: tls.createClientHello(c)
3447
- }));
3448
- tls.flush(c);
3449
- }
3450
- };
3451
- /**
3452
- * Called when TLS protocol data has been received from somewhere and should
3453
- * be processed by the TLS engine.
3454
- *
3455
- * @param data the TLS protocol data, as a string, to process.
3456
- *
3457
- * @return 0 if the data could be processed, otherwise the number of bytes
3458
- * required for data to be processed.
3459
- */
3460
- c.process = function(data) {
3461
- var rval = 0;
3462
- if (data) c.input.putBytes(data);
3463
- if (!c.fail) {
3464
- if (c.record !== null && c.record.ready && c.record.fragment.isEmpty()) c.record = null;
3465
- if (c.record === null) rval = _readRecordHeader(c);
3466
- if (!c.fail && c.record !== null && !c.record.ready) rval = _readRecord(c);
3467
- if (!c.fail && c.record !== null && c.record.ready) _update(c, c.record);
3468
- }
3469
- return rval;
3470
- };
3471
- /**
3472
- * Requests that application data be packaged into a TLS record. The
3473
- * tlsDataReady handler will be called when the TLS record(s) have been
3474
- * prepared.
3475
- *
3476
- * @param data the application data, as a raw 'binary' encoded string, to
3477
- * be sent; to send utf-16/utf-8 string data, use the return value
3478
- * of util.encodeUtf8(str).
3479
- *
3480
- * @return true on success, false on failure.
3481
- */
3482
- c.prepare = function(data) {
3483
- tls.queue(c, tls.createRecord(c, {
3484
- type: tls.ContentType.application_data,
3485
- data: forge.util.createBuffer(data)
3486
- }));
3487
- return tls.flush(c);
3488
- };
3489
- /**
3490
- * Requests that a heartbeat request be packaged into a TLS record for
3491
- * transmission. The tlsDataReady handler will be called when TLS record(s)
3492
- * have been prepared.
3493
- *
3494
- * When a heartbeat response has been received, the heartbeatReceived
3495
- * handler will be called with the matching payload. This handler can
3496
- * be used to clear a retransmission timer, etc.
3497
- *
3498
- * @param payload the heartbeat data to send as the payload in the message.
3499
- * @param [payloadLength] the payload length to use, defaults to the
3500
- * actual payload length.
3501
- *
3502
- * @return true on success, false on failure.
3503
- */
3504
- c.prepareHeartbeatRequest = function(payload, payloadLength) {
3505
- if (payload instanceof forge.util.ByteBuffer) payload = payload.bytes();
3506
- if (typeof payloadLength === "undefined") payloadLength = payload.length;
3507
- c.expectedHeartbeatPayload = payload;
3508
- tls.queue(c, tls.createRecord(c, {
3509
- type: tls.ContentType.heartbeat,
3510
- data: tls.createHeartbeat(tls.HeartbeatMessageType.heartbeat_request, payload, payloadLength)
3511
- }));
3512
- return tls.flush(c);
3513
- };
3514
- /**
3515
- * Closes the connection (sends a close_notify alert).
3516
- *
3517
- * @param clearFail true to clear the fail flag (default: true).
3518
- */
3519
- c.close = function(clearFail) {
3520
- if (!c.fail && c.sessionCache && c.session) {
3521
- var session = {
3522
- id: c.session.id,
3523
- version: c.session.version,
3524
- sp: c.session.sp
3525
- };
3526
- session.sp.keys = null;
3527
- c.sessionCache.setSession(session.id, session);
3528
- }
3529
- if (c.open) {
3530
- c.open = false;
3531
- c.input.clear();
3532
- if (c.isConnected || c.handshaking) {
3533
- c.isConnected = c.handshaking = false;
3534
- tls.queue(c, tls.createAlert(c, {
3535
- level: tls.Alert.Level.warning,
3536
- description: tls.Alert.Description.close_notify
3537
- }));
3538
- tls.flush(c);
3539
- }
3540
- c.closed(c);
3541
- }
3542
- c.reset(clearFail);
3543
- };
3544
- return c;
3545
- };
3546
- module.exports = forge.tls = forge.tls || {};
3547
- for (var key in tls) if (typeof tls[key] !== "function") forge.tls[key] = tls[key];
3548
- forge.tls.prf_tls1 = prf_TLS1;
3549
- forge.tls.hmac_sha1 = hmac_sha1;
3550
- forge.tls.createSessionCache = tls.createSessionCache;
3551
- /**
3552
- * Creates a new TLS connection. This does not make any assumptions about the
3553
- * transport layer that TLS is working on top of, ie: it does not assume there
3554
- * is a TCP/IP connection or establish one. A TLS connection is totally
3555
- * abstracted away from the layer is runs on top of, it merely establishes a
3556
- * secure channel between a client" and a "server".
3557
- *
3558
- * A TLS connection contains 4 connection states: pending read and write, and
3559
- * current read and write.
3560
- *
3561
- * At initialization, the current read and write states will be null. Only once
3562
- * the security parameters have been set and the keys have been generated can
3563
- * the pending states be converted into current states. Current states will be
3564
- * updated for each record processed.
3565
- *
3566
- * A custom certificate verify callback may be provided to check information
3567
- * like the common name on the server's certificate. It will be called for
3568
- * every certificate in the chain. It has the following signature:
3569
- *
3570
- * variable func(c, certs, index, preVerify)
3571
- * Where:
3572
- * c The TLS connection
3573
- * verified Set to true if certificate was verified, otherwise the alert
3574
- * tls.Alert.Description for why the certificate failed.
3575
- * depth The current index in the chain, where 0 is the server's cert.
3576
- * certs The certificate chain, *NOTE* if the server was anonymous then
3577
- * the chain will be empty.
3578
- *
3579
- * The function returns true on success and on failure either the appropriate
3580
- * tls.Alert.Description or an object with 'alert' set to the appropriate
3581
- * tls.Alert.Description and 'message' set to a custom error message. If true
3582
- * is not returned then the connection will abort using, in order of
3583
- * availability, first the returned alert description, second the preVerify
3584
- * alert description, and lastly the default 'bad_certificate'.
3585
- *
3586
- * There are three callbacks that can be used to make use of client-side
3587
- * certificates where each takes the TLS connection as the first parameter:
3588
- *
3589
- * getCertificate(conn, hint)
3590
- * The second parameter is a hint as to which certificate should be
3591
- * returned. If the connection entity is a client, then the hint will be
3592
- * the CertificateRequest message from the server that is part of the
3593
- * TLS protocol. If the connection entity is a server, then it will be
3594
- * the servername list provided via an SNI extension the ClientHello, if
3595
- * one was provided (empty array if not). The hint can be examined to
3596
- * determine which certificate to use (advanced). Most implementations
3597
- * will just return a certificate. The return value must be a
3598
- * PEM-formatted certificate or an array of PEM-formatted certificates
3599
- * that constitute a certificate chain, with the first in the array/chain
3600
- * being the client's certificate.
3601
- * getPrivateKey(conn, certificate)
3602
- * The second parameter is an forge.pki X.509 certificate object that
3603
- * is associated with the requested private key. The return value must
3604
- * be a PEM-formatted private key.
3605
- * getSignature(conn, bytes, callback)
3606
- * This callback can be used instead of getPrivateKey if the private key
3607
- * is not directly accessible in javascript or should not be. For
3608
- * instance, a secure external web service could provide the signature
3609
- * in exchange for appropriate credentials. The second parameter is a
3610
- * string of bytes to be signed that are part of the TLS protocol. These
3611
- * bytes are used to verify that the private key for the previously
3612
- * provided client-side certificate is accessible to the client. The
3613
- * callback is a function that takes 2 parameters, the TLS connection
3614
- * and the RSA encrypted (signed) bytes as a string. This callback must
3615
- * be called once the signature is ready.
3616
- *
3617
- * @param options the options for this connection:
3618
- * server: true if the connection is server-side, false for client.
3619
- * sessionId: a session ID to reuse, null for a new connection.
3620
- * caStore: an array of certificates to trust.
3621
- * sessionCache: a session cache to use.
3622
- * cipherSuites: an optional array of cipher suites to use,
3623
- * see tls.CipherSuites.
3624
- * connected: function(conn) called when the first handshake completes.
3625
- * virtualHost: the virtual server name to use in a TLS SNI extension.
3626
- * verifyClient: true to require a client certificate in server mode,
3627
- * 'optional' to request one, false not to (default: false).
3628
- * verify: a handler used to custom verify certificates in the chain.
3629
- * verifyOptions: an object with options for the certificate chain validation.
3630
- * See documentation of pki.verifyCertificateChain for possible options.
3631
- * verifyOptions.verify is ignored. If you wish to specify a verify handler
3632
- * use the verify key.
3633
- * getCertificate: an optional callback used to get a certificate or
3634
- * a chain of certificates (as an array).
3635
- * getPrivateKey: an optional callback used to get a private key.
3636
- * getSignature: an optional callback used to get a signature.
3637
- * tlsDataReady: function(conn) called when TLS protocol data has been
3638
- * prepared and is ready to be used (typically sent over a socket
3639
- * connection to its destination), read from conn.tlsData buffer.
3640
- * dataReady: function(conn) called when application data has
3641
- * been parsed from a TLS record and should be consumed by the
3642
- * application, read from conn.data buffer.
3643
- * closed: function(conn) called when the connection has been closed.
3644
- * error: function(conn, error) called when there was an error.
3645
- * deflate: function(inBytes) if provided, will deflate TLS records using
3646
- * the deflate algorithm if the server supports it.
3647
- * inflate: function(inBytes) if provided, will inflate TLS records using
3648
- * the deflate algorithm if the server supports it.
3649
- *
3650
- * @return the new TLS connection.
3651
- */
3652
- forge.tls.createConnection = tls.createConnection;
3653
- }) });
3654
-
3655
- //#endregion
3656
- export default require_tls();
3657
-
3658
- export { require_tls };
3659
- //# sourceMappingURL=tls.mjs.map