slidge-whatsapp 0.2.5__cp313-cp313-manylinux_2_36_aarch64.whl → 0.2.6__cp313-cp313-manylinux_2_36_aarch64.whl

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.

Potentially problematic release.


This version of slidge-whatsapp might be problematic. Click here for more details.

Files changed (320) hide show
  1. slidge_whatsapp/config.py +3 -0
  2. slidge_whatsapp/event.go +23 -24
  3. slidge_whatsapp/gateway.go +13 -9
  4. slidge_whatsapp/gateway.py +2 -2
  5. slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.h +181 -181
  6. slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.so +0 -0
  7. slidge_whatsapp/generated/build.py +155 -155
  8. slidge_whatsapp/generated/whatsapp.c +1507 -1507
  9. slidge_whatsapp/generated/whatsapp.go +907 -907
  10. slidge_whatsapp/generated/whatsapp.py +1318 -1318
  11. slidge_whatsapp/generated/whatsapp_go.h +181 -181
  12. slidge_whatsapp/go.mod +15 -12
  13. slidge_whatsapp/go.sum +41 -29
  14. slidge_whatsapp/media/media.go +16 -10
  15. slidge_whatsapp/session.go +73 -66
  16. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn.go +4 -4
  17. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_darwin.go +0 -5
  18. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_libinit.go +3 -0
  19. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/symbols.go +40 -20
  20. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +14 -1
  21. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +2 -2
  22. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/fun.go +10 -2
  23. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib.go +1 -1
  24. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_unix.go +1 -1
  25. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_windows.go +1 -1
  26. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +2 -7
  27. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/callback.go +2 -1
  28. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +8510 -5090
  29. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +344 -150
  30. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3.go +57 -23
  31. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.c +4 -0
  32. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.go +4 -0
  33. slidge_whatsapp/vendor/github.com/petermattis/goid/.gitignore +4 -0
  34. slidge_whatsapp/vendor/github.com/petermattis/goid/LICENSE +202 -0
  35. slidge_whatsapp/vendor/github.com/petermattis/goid/README.md +4 -0
  36. slidge_whatsapp/vendor/github.com/petermattis/goid/goid.go +35 -0
  37. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_gccgo.go +26 -0
  38. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.c +23 -0
  39. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.go +22 -0
  40. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.go +35 -0
  41. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.s +18 -0
  42. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.go +28 -0
  43. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.s +44 -0
  44. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_slow.go +24 -0
  45. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_gccgo_go1.8.go +17 -0
  46. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +38 -0
  47. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.5.go +57 -0
  48. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.6.go +43 -0
  49. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.9.go +37 -0
  50. slidge_whatsapp/vendor/github.com/rs/zerolog/CONTRIBUTING.md +43 -0
  51. slidge_whatsapp/vendor/github.com/rs/zerolog/README.md +31 -0
  52. slidge_whatsapp/vendor/github.com/rs/zerolog/console.go +20 -5
  53. slidge_whatsapp/vendor/github.com/rs/zerolog/log/log.go +131 -0
  54. slidge_whatsapp/vendor/github.com/rs/zerolog/log.go +1 -1
  55. slidge_whatsapp/vendor/github.com/rs/zerolog/sampler.go +4 -1
  56. slidge_whatsapp/vendor/github.com/rs/zerolog/writer.go +9 -0
  57. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupCipher.go +17 -6
  58. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupSessionBuilder.go +17 -7
  59. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/state/store/SenderKeyStore.go +4 -2
  60. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/chain/ChainKey.go +1 -0
  61. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/identity/IdentityKey.go +1 -0
  62. slidge_whatsapp/vendor/go.mau.fi/libsignal/logger/DefaultLogger.go +2 -2
  63. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/FingerprintProtocol.pb.go +3 -2
  64. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/LocalStorageProtocol.pb.go +3 -2
  65. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/WhisperTextProtocol.pb.go +3 -2
  66. slidge_whatsapp/vendor/go.mau.fi/libsignal/session/Session.go +41 -17
  67. slidge_whatsapp/vendor/go.mau.fi/libsignal/session/SessionCipher.go +64 -30
  68. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/IdentityKeyStore.go +5 -3
  69. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/MessageKeyStore.go +6 -4
  70. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/PreKeyStore.go +6 -4
  71. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SessionStore.go +8 -6
  72. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SignedPreKeyStore.go +7 -5
  73. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/connlog.go +257 -0
  74. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/database.go +309 -0
  75. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/iter.go +233 -0
  76. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/json.go +47 -0
  77. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/log.go +129 -0
  78. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/massinsert.go +164 -0
  79. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/queryhelper.go +137 -0
  80. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/reflectscan.go +30 -0
  81. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/transaction.go +180 -0
  82. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgrades.go +250 -0
  83. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgradetable.go +331 -0
  84. slidge_whatsapp/vendor/go.mau.fi/util/exerrors/dualerror.go +33 -0
  85. slidge_whatsapp/vendor/go.mau.fi/util/exerrors/must.go +23 -0
  86. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/cors.go +32 -0
  87. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +64 -0
  88. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/json.go +41 -0
  89. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/middleware.go +30 -0
  90. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +37 -0
  91. slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +88 -0
  92. slidge_whatsapp/vendor/go.mau.fi/util/exsync/returnonce.go +25 -0
  93. slidge_whatsapp/vendor/go.mau.fi/util/exsync/ringbuffer.go +139 -0
  94. slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncmap.go +94 -0
  95. slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncset.go +136 -0
  96. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/callermarshal.go +28 -0
  97. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/defaults.go +32 -0
  98. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/generics.go +45 -0
  99. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/writer.go +81 -0
  100. slidge_whatsapp/vendor/go.mau.fi/util/ptr/ptr.go +43 -0
  101. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +27 -26
  102. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/encode.go +4 -3
  103. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/keys.go +5 -4
  104. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +27 -25
  105. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +3 -2
  106. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/broadcast.go +5 -4
  107. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +60 -15
  108. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +25 -9
  109. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download-to-file.go +45 -19
  110. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +52 -28
  111. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +1 -0
  112. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +59 -29
  113. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +166 -146
  114. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/keepalive.go +2 -2
  115. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaconn.go +5 -3
  116. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaretry.go +2 -1
  117. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +270 -111
  118. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +118 -31
  119. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +67 -36
  120. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +7 -4
  121. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair.go +42 -18
  122. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/prekeys.go +9 -5
  123. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +2 -1
  124. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/privacysettings.go +10 -11
  125. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.pb.go +39 -9
  126. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.go +354 -175
  127. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.proto +5 -5
  128. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.go +158 -15
  129. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.proto +1 -0
  130. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.go +29 -9
  131. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.go +13 -9
  132. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.go +344 -31
  133. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.proto +26 -0
  134. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/{WAWebProtobufsCompanionReg.pb.go → WACompanionReg.pb.go} +170 -84
  135. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/{WAWebProtobufsCompanionReg.proto → WACompanionReg.proto} +1 -1
  136. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.go +173 -9
  137. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.go +78 -16
  138. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.proto +5 -0
  139. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +6747 -2230
  140. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +294 -43
  141. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +456 -135
  142. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +14 -0
  143. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.pb.go +162 -9
  144. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.proto +1 -0
  145. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.go +32 -9
  146. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.proto +1 -0
  147. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.go +192 -52
  148. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.proto +8 -0
  149. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.go +60 -9
  150. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.go +39 -9
  151. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.go +61 -9
  152. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +1051 -382
  153. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +32 -0
  154. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.go +27 -9
  155. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.go +59 -9
  156. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +382 -78
  157. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +8 -0
  158. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +555 -9
  159. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +2 -0
  160. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +13 -3
  161. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/retry.go +29 -19
  162. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +244 -73
  163. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +27 -16
  164. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +3 -1
  165. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +85 -43
  166. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/signal.go +75 -88
  167. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +79 -61
  168. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/lidmap.go +186 -0
  169. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +291 -167
  170. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/00-latest-schema.sql +153 -0
  171. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/03-message-secrets.sql +11 -0
  172. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/04-privacy-tokens.sql +8 -0
  173. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/05-account-jid-format.sql +2 -0
  174. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/06-facebook-uuid.sql +2 -0
  175. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/07-account-lid.sql +2 -0
  176. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/08-lid-mapping.sql +5 -0
  177. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/09-decryption-buffer.sql +10 -0
  178. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/upgrades.go +22 -0
  179. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +105 -56
  180. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/botmap.go +210 -0
  181. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +8 -0
  182. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/group.go +15 -6
  183. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +7 -8
  184. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/message.go +17 -0
  185. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/update.go +3 -2
  186. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/upload.go +1 -1
  187. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +45 -29
  188. slidge_whatsapp/vendor/golang.org/x/exp/LICENSE +27 -0
  189. slidge_whatsapp/vendor/golang.org/x/exp/PATENTS +22 -0
  190. slidge_whatsapp/vendor/golang.org/x/exp/constraints/constraints.go +54 -0
  191. slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/guts.go +50 -0
  192. slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/httplex.go +347 -0
  193. slidge_whatsapp/vendor/golang.org/x/net/http2/.gitignore +2 -0
  194. slidge_whatsapp/vendor/golang.org/x/net/http2/ascii.go +53 -0
  195. slidge_whatsapp/vendor/golang.org/x/net/http2/ciphers.go +641 -0
  196. slidge_whatsapp/vendor/golang.org/x/net/http2/client_conn_pool.go +311 -0
  197. slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +122 -0
  198. slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +61 -0
  199. slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +16 -0
  200. slidge_whatsapp/vendor/golang.org/x/net/http2/databuffer.go +149 -0
  201. slidge_whatsapp/vendor/golang.org/x/net/http2/errors.go +145 -0
  202. slidge_whatsapp/vendor/golang.org/x/net/http2/flow.go +120 -0
  203. slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +1702 -0
  204. slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +170 -0
  205. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/encode.go +245 -0
  206. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/hpack.go +523 -0
  207. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/huffman.go +226 -0
  208. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/static_table.go +188 -0
  209. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/tables.go +403 -0
  210. slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +432 -0
  211. slidge_whatsapp/vendor/golang.org/x/net/http2/pipe.go +184 -0
  212. slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +3350 -0
  213. slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +20 -0
  214. slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +3287 -0
  215. slidge_whatsapp/vendor/golang.org/x/net/http2/unencrypted.go +32 -0
  216. slidge_whatsapp/vendor/golang.org/x/net/http2/write.go +381 -0
  217. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched.go +251 -0
  218. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_priority.go +451 -0
  219. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_random.go +77 -0
  220. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_roundrobin.go +119 -0
  221. slidge_whatsapp/vendor/golang.org/x/net/idna/go118.go +13 -0
  222. slidge_whatsapp/vendor/golang.org/x/net/idna/idna10.0.0.go +769 -0
  223. slidge_whatsapp/vendor/golang.org/x/net/idna/idna9.0.0.go +717 -0
  224. slidge_whatsapp/vendor/golang.org/x/net/idna/pre_go118.go +11 -0
  225. slidge_whatsapp/vendor/golang.org/x/net/idna/punycode.go +217 -0
  226. slidge_whatsapp/vendor/golang.org/x/net/idna/tables10.0.0.go +4559 -0
  227. slidge_whatsapp/vendor/golang.org/x/net/idna/tables11.0.0.go +4653 -0
  228. slidge_whatsapp/vendor/golang.org/x/net/idna/tables12.0.0.go +4733 -0
  229. slidge_whatsapp/vendor/golang.org/x/net/idna/tables13.0.0.go +4959 -0
  230. slidge_whatsapp/vendor/golang.org/x/net/idna/tables15.0.0.go +5144 -0
  231. slidge_whatsapp/vendor/golang.org/x/net/idna/tables9.0.0.go +4486 -0
  232. slidge_whatsapp/vendor/golang.org/x/net/idna/trie.go +51 -0
  233. slidge_whatsapp/vendor/golang.org/x/net/idna/trie12.0.0.go +30 -0
  234. slidge_whatsapp/vendor/golang.org/x/net/idna/trie13.0.0.go +30 -0
  235. slidge_whatsapp/vendor/golang.org/x/net/idna/trieval.go +119 -0
  236. slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/ascii.go +53 -0
  237. slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/headermap.go +115 -0
  238. slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/request.go +467 -0
  239. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +148 -1
  240. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux.go +16 -26
  241. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +84 -0
  242. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +20 -0
  243. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +84 -0
  244. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +20 -0
  245. slidge_whatsapp/vendor/golang.org/x/sys/windows/security_windows.go +44 -5
  246. slidge_whatsapp/vendor/golang.org/x/sys/windows/syscall_windows.go +4 -2
  247. slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +239 -0
  248. slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +9 -0
  249. slidge_whatsapp/vendor/golang.org/x/text/LICENSE +27 -0
  250. slidge_whatsapp/vendor/golang.org/x/text/PATENTS +22 -0
  251. slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule.go +336 -0
  252. slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go +11 -0
  253. slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go +14 -0
  254. slidge_whatsapp/vendor/golang.org/x/text/transform/transform.go +709 -0
  255. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bidi.go +359 -0
  256. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
  257. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/core.go +1071 -0
  258. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
  259. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go +1815 -0
  260. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go +1887 -0
  261. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go +1923 -0
  262. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go +1955 -0
  263. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go +2042 -0
  264. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go +1781 -0
  265. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/trieval.go +48 -0
  266. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/composition.go +512 -0
  267. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/forminfo.go +279 -0
  268. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/input.go +109 -0
  269. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/iter.go +458 -0
  270. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/normalize.go +610 -0
  271. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
  272. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +7657 -0
  273. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +7693 -0
  274. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +7710 -0
  275. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go +7760 -0
  276. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go +7907 -0
  277. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +7637 -0
  278. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/transform.go +88 -0
  279. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/trie.go +54 -0
  280. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb +0 -0
  281. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +3 -0
  282. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +16 -0
  283. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/{strings_unsafe_go121.go → strings_unsafe.go} +0 -2
  284. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +1 -1
  285. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/merge.go +6 -0
  286. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +2 -0
  287. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/{value_unsafe_go121.go → value_unsafe.go} +0 -2
  288. slidge_whatsapp/vendor/modules.txt +38 -13
  289. {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/METADATA +1 -1
  290. {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/RECORD +293 -180
  291. {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/WHEEL +1 -1
  292. slidge_whatsapp/vendor/github.com/rs/zerolog/CNAME +0 -1
  293. slidge_whatsapp/vendor/github.com/rs/zerolog/_config.yml +0 -1
  294. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.pb.raw +0 -0
  295. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.raw +0 -0
  296. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.raw +0 -0
  297. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.raw +0 -23
  298. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.raw +0 -7
  299. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.raw +0 -0
  300. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WAWebProtobufsCompanionReg.pb.raw +0 -0
  301. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.raw +0 -0
  302. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.raw +0 -0
  303. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.raw +0 -0
  304. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.raw +0 -0
  305. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.pb.raw +0 -0
  306. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.raw +0 -0
  307. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.raw +0 -0
  308. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.raw +0 -0
  309. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.raw +0 -0
  310. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.raw +0 -0
  311. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.raw +0 -0
  312. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.raw +0 -0
  313. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.raw +0 -0
  314. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.raw +0 -0
  315. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.raw +0 -0
  316. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go +0 -296
  317. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go120.go +0 -94
  318. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go +0 -98
  319. {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/LICENSE +0 -0
  320. {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,717 @@
1
+ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
2
+
3
+ // Copyright 2016 The Go Authors. All rights reserved.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file.
6
+
7
+ //go:build !go1.10
8
+
9
+ // Package idna implements IDNA2008 using the compatibility processing
10
+ // defined by UTS (Unicode Technical Standard) #46, which defines a standard to
11
+ // deal with the transition from IDNA2003.
12
+ //
13
+ // IDNA2008 (Internationalized Domain Names for Applications), is defined in RFC
14
+ // 5890, RFC 5891, RFC 5892, RFC 5893 and RFC 5894.
15
+ // UTS #46 is defined in https://www.unicode.org/reports/tr46.
16
+ // See https://unicode.org/cldr/utility/idna.jsp for a visualization of the
17
+ // differences between these two standards.
18
+ package idna // import "golang.org/x/net/idna"
19
+
20
+ import (
21
+ "fmt"
22
+ "strings"
23
+ "unicode/utf8"
24
+
25
+ "golang.org/x/text/secure/bidirule"
26
+ "golang.org/x/text/unicode/norm"
27
+ )
28
+
29
+ // NOTE: Unlike common practice in Go APIs, the functions will return a
30
+ // sanitized domain name in case of errors. Browsers sometimes use a partially
31
+ // evaluated string as lookup.
32
+ // TODO: the current error handling is, in my opinion, the least opinionated.
33
+ // Other strategies are also viable, though:
34
+ // Option 1) Return an empty string in case of error, but allow the user to
35
+ // specify explicitly which errors to ignore.
36
+ // Option 2) Return the partially evaluated string if it is itself a valid
37
+ // string, otherwise return the empty string in case of error.
38
+ // Option 3) Option 1 and 2.
39
+ // Option 4) Always return an empty string for now and implement Option 1 as
40
+ // needed, and document that the return string may not be empty in case of
41
+ // error in the future.
42
+ // I think Option 1 is best, but it is quite opinionated.
43
+
44
+ // ToASCII is a wrapper for Punycode.ToASCII.
45
+ func ToASCII(s string) (string, error) {
46
+ return Punycode.process(s, true)
47
+ }
48
+
49
+ // ToUnicode is a wrapper for Punycode.ToUnicode.
50
+ func ToUnicode(s string) (string, error) {
51
+ return Punycode.process(s, false)
52
+ }
53
+
54
+ // An Option configures a Profile at creation time.
55
+ type Option func(*options)
56
+
57
+ // Transitional sets a Profile to use the Transitional mapping as defined in UTS
58
+ // #46. This will cause, for example, "ß" to be mapped to "ss". Using the
59
+ // transitional mapping provides a compromise between IDNA2003 and IDNA2008
60
+ // compatibility. It is used by some browsers when resolving domain names. This
61
+ // option is only meaningful if combined with MapForLookup.
62
+ func Transitional(transitional bool) Option {
63
+ return func(o *options) { o.transitional = transitional }
64
+ }
65
+
66
+ // VerifyDNSLength sets whether a Profile should fail if any of the IDN parts
67
+ // are longer than allowed by the RFC.
68
+ //
69
+ // This option corresponds to the VerifyDnsLength flag in UTS #46.
70
+ func VerifyDNSLength(verify bool) Option {
71
+ return func(o *options) { o.verifyDNSLength = verify }
72
+ }
73
+
74
+ // RemoveLeadingDots removes leading label separators. Leading runes that map to
75
+ // dots, such as U+3002 IDEOGRAPHIC FULL STOP, are removed as well.
76
+ func RemoveLeadingDots(remove bool) Option {
77
+ return func(o *options) { o.removeLeadingDots = remove }
78
+ }
79
+
80
+ // ValidateLabels sets whether to check the mandatory label validation criteria
81
+ // as defined in Section 5.4 of RFC 5891. This includes testing for correct use
82
+ // of hyphens ('-'), normalization, validity of runes, and the context rules.
83
+ // In particular, ValidateLabels also sets the CheckHyphens and CheckJoiners flags
84
+ // in UTS #46.
85
+ func ValidateLabels(enable bool) Option {
86
+ return func(o *options) {
87
+ // Don't override existing mappings, but set one that at least checks
88
+ // normalization if it is not set.
89
+ if o.mapping == nil && enable {
90
+ o.mapping = normalize
91
+ }
92
+ o.trie = trie
93
+ o.checkJoiners = enable
94
+ o.checkHyphens = enable
95
+ if enable {
96
+ o.fromPuny = validateFromPunycode
97
+ } else {
98
+ o.fromPuny = nil
99
+ }
100
+ }
101
+ }
102
+
103
+ // CheckHyphens sets whether to check for correct use of hyphens ('-') in
104
+ // labels. Most web browsers do not have this option set, since labels such as
105
+ // "r3---sn-apo3qvuoxuxbt-j5pe" are in common use.
106
+ //
107
+ // This option corresponds to the CheckHyphens flag in UTS #46.
108
+ func CheckHyphens(enable bool) Option {
109
+ return func(o *options) { o.checkHyphens = enable }
110
+ }
111
+
112
+ // CheckJoiners sets whether to check the ContextJ rules as defined in Appendix
113
+ // A of RFC 5892, concerning the use of joiner runes.
114
+ //
115
+ // This option corresponds to the CheckJoiners flag in UTS #46.
116
+ func CheckJoiners(enable bool) Option {
117
+ return func(o *options) {
118
+ o.trie = trie
119
+ o.checkJoiners = enable
120
+ }
121
+ }
122
+
123
+ // StrictDomainName limits the set of permissible ASCII characters to those
124
+ // allowed in domain names as defined in RFC 1034 (A-Z, a-z, 0-9 and the
125
+ // hyphen). This is set by default for MapForLookup and ValidateForRegistration,
126
+ // but is only useful if ValidateLabels is set.
127
+ //
128
+ // This option is useful, for instance, for browsers that allow characters
129
+ // outside this range, for example a '_' (U+005F LOW LINE). See
130
+ // http://www.rfc-editor.org/std/std3.txt for more details.
131
+ //
132
+ // This option corresponds to the UseSTD3ASCIIRules flag in UTS #46.
133
+ func StrictDomainName(use bool) Option {
134
+ return func(o *options) { o.useSTD3Rules = use }
135
+ }
136
+
137
+ // NOTE: the following options pull in tables. The tables should not be linked
138
+ // in as long as the options are not used.
139
+
140
+ // BidiRule enables the Bidi rule as defined in RFC 5893. Any application
141
+ // that relies on proper validation of labels should include this rule.
142
+ //
143
+ // This option corresponds to the CheckBidi flag in UTS #46.
144
+ func BidiRule() Option {
145
+ return func(o *options) { o.bidirule = bidirule.ValidString }
146
+ }
147
+
148
+ // ValidateForRegistration sets validation options to verify that a given IDN is
149
+ // properly formatted for registration as defined by Section 4 of RFC 5891.
150
+ func ValidateForRegistration() Option {
151
+ return func(o *options) {
152
+ o.mapping = validateRegistration
153
+ StrictDomainName(true)(o)
154
+ ValidateLabels(true)(o)
155
+ VerifyDNSLength(true)(o)
156
+ BidiRule()(o)
157
+ }
158
+ }
159
+
160
+ // MapForLookup sets validation and mapping options such that a given IDN is
161
+ // transformed for domain name lookup according to the requirements set out in
162
+ // Section 5 of RFC 5891. The mappings follow the recommendations of RFC 5894,
163
+ // RFC 5895 and UTS 46. It does not add the Bidi Rule. Use the BidiRule option
164
+ // to add this check.
165
+ //
166
+ // The mappings include normalization and mapping case, width and other
167
+ // compatibility mappings.
168
+ func MapForLookup() Option {
169
+ return func(o *options) {
170
+ o.mapping = validateAndMap
171
+ StrictDomainName(true)(o)
172
+ ValidateLabels(true)(o)
173
+ RemoveLeadingDots(true)(o)
174
+ }
175
+ }
176
+
177
+ type options struct {
178
+ transitional bool
179
+ useSTD3Rules bool
180
+ checkHyphens bool
181
+ checkJoiners bool
182
+ verifyDNSLength bool
183
+ removeLeadingDots bool
184
+
185
+ trie *idnaTrie
186
+
187
+ // fromPuny calls validation rules when converting A-labels to U-labels.
188
+ fromPuny func(p *Profile, s string) error
189
+
190
+ // mapping implements a validation and mapping step as defined in RFC 5895
191
+ // or UTS 46, tailored to, for example, domain registration or lookup.
192
+ mapping func(p *Profile, s string) (string, error)
193
+
194
+ // bidirule, if specified, checks whether s conforms to the Bidi Rule
195
+ // defined in RFC 5893.
196
+ bidirule func(s string) bool
197
+ }
198
+
199
+ // A Profile defines the configuration of a IDNA mapper.
200
+ type Profile struct {
201
+ options
202
+ }
203
+
204
+ func apply(o *options, opts []Option) {
205
+ for _, f := range opts {
206
+ f(o)
207
+ }
208
+ }
209
+
210
+ // New creates a new Profile.
211
+ //
212
+ // With no options, the returned Profile is the most permissive and equals the
213
+ // Punycode Profile. Options can be passed to further restrict the Profile. The
214
+ // MapForLookup and ValidateForRegistration options set a collection of options,
215
+ // for lookup and registration purposes respectively, which can be tailored by
216
+ // adding more fine-grained options, where later options override earlier
217
+ // options.
218
+ func New(o ...Option) *Profile {
219
+ p := &Profile{}
220
+ apply(&p.options, o)
221
+ return p
222
+ }
223
+
224
+ // ToASCII converts a domain or domain label to its ASCII form. For example,
225
+ // ToASCII("bücher.example.com") is "xn--bcher-kva.example.com", and
226
+ // ToASCII("golang") is "golang". If an error is encountered it will return
227
+ // an error and a (partially) processed result.
228
+ func (p *Profile) ToASCII(s string) (string, error) {
229
+ return p.process(s, true)
230
+ }
231
+
232
+ // ToUnicode converts a domain or domain label to its Unicode form. For example,
233
+ // ToUnicode("xn--bcher-kva.example.com") is "bücher.example.com", and
234
+ // ToUnicode("golang") is "golang". If an error is encountered it will return
235
+ // an error and a (partially) processed result.
236
+ func (p *Profile) ToUnicode(s string) (string, error) {
237
+ pp := *p
238
+ pp.transitional = false
239
+ return pp.process(s, false)
240
+ }
241
+
242
+ // String reports a string with a description of the profile for debugging
243
+ // purposes. The string format may change with different versions.
244
+ func (p *Profile) String() string {
245
+ s := ""
246
+ if p.transitional {
247
+ s = "Transitional"
248
+ } else {
249
+ s = "NonTransitional"
250
+ }
251
+ if p.useSTD3Rules {
252
+ s += ":UseSTD3Rules"
253
+ }
254
+ if p.checkHyphens {
255
+ s += ":CheckHyphens"
256
+ }
257
+ if p.checkJoiners {
258
+ s += ":CheckJoiners"
259
+ }
260
+ if p.verifyDNSLength {
261
+ s += ":VerifyDNSLength"
262
+ }
263
+ return s
264
+ }
265
+
266
+ var (
267
+ // Punycode is a Profile that does raw punycode processing with a minimum
268
+ // of validation.
269
+ Punycode *Profile = punycode
270
+
271
+ // Lookup is the recommended profile for looking up domain names, according
272
+ // to Section 5 of RFC 5891. The exact configuration of this profile may
273
+ // change over time.
274
+ Lookup *Profile = lookup
275
+
276
+ // Display is the recommended profile for displaying domain names.
277
+ // The configuration of this profile may change over time.
278
+ Display *Profile = display
279
+
280
+ // Registration is the recommended profile for checking whether a given
281
+ // IDN is valid for registration, according to Section 4 of RFC 5891.
282
+ Registration *Profile = registration
283
+
284
+ punycode = &Profile{}
285
+ lookup = &Profile{options{
286
+ transitional: true,
287
+ removeLeadingDots: true,
288
+ useSTD3Rules: true,
289
+ checkHyphens: true,
290
+ checkJoiners: true,
291
+ trie: trie,
292
+ fromPuny: validateFromPunycode,
293
+ mapping: validateAndMap,
294
+ bidirule: bidirule.ValidString,
295
+ }}
296
+ display = &Profile{options{
297
+ useSTD3Rules: true,
298
+ removeLeadingDots: true,
299
+ checkHyphens: true,
300
+ checkJoiners: true,
301
+ trie: trie,
302
+ fromPuny: validateFromPunycode,
303
+ mapping: validateAndMap,
304
+ bidirule: bidirule.ValidString,
305
+ }}
306
+ registration = &Profile{options{
307
+ useSTD3Rules: true,
308
+ verifyDNSLength: true,
309
+ checkHyphens: true,
310
+ checkJoiners: true,
311
+ trie: trie,
312
+ fromPuny: validateFromPunycode,
313
+ mapping: validateRegistration,
314
+ bidirule: bidirule.ValidString,
315
+ }}
316
+
317
+ // TODO: profiles
318
+ // Register: recommended for approving domain names: don't do any mappings
319
+ // but rather reject on invalid input. Bundle or block deviation characters.
320
+ )
321
+
322
+ type labelError struct{ label, code_ string }
323
+
324
+ func (e labelError) code() string { return e.code_ }
325
+ func (e labelError) Error() string {
326
+ return fmt.Sprintf("idna: invalid label %q", e.label)
327
+ }
328
+
329
+ type runeError rune
330
+
331
+ func (e runeError) code() string { return "P1" }
332
+ func (e runeError) Error() string {
333
+ return fmt.Sprintf("idna: disallowed rune %U", e)
334
+ }
335
+
336
+ // process implements the algorithm described in section 4 of UTS #46,
337
+ // see https://www.unicode.org/reports/tr46.
338
+ func (p *Profile) process(s string, toASCII bool) (string, error) {
339
+ var err error
340
+ if p.mapping != nil {
341
+ s, err = p.mapping(p, s)
342
+ }
343
+ // Remove leading empty labels.
344
+ if p.removeLeadingDots {
345
+ for ; len(s) > 0 && s[0] == '.'; s = s[1:] {
346
+ }
347
+ }
348
+ // It seems like we should only create this error on ToASCII, but the
349
+ // UTS 46 conformance tests suggests we should always check this.
350
+ if err == nil && p.verifyDNSLength && s == "" {
351
+ err = &labelError{s, "A4"}
352
+ }
353
+ labels := labelIter{orig: s}
354
+ for ; !labels.done(); labels.next() {
355
+ label := labels.label()
356
+ if label == "" {
357
+ // Empty labels are not okay. The label iterator skips the last
358
+ // label if it is empty.
359
+ if err == nil && p.verifyDNSLength {
360
+ err = &labelError{s, "A4"}
361
+ }
362
+ continue
363
+ }
364
+ if strings.HasPrefix(label, acePrefix) {
365
+ u, err2 := decode(label[len(acePrefix):])
366
+ if err2 != nil {
367
+ if err == nil {
368
+ err = err2
369
+ }
370
+ // Spec says keep the old label.
371
+ continue
372
+ }
373
+ labels.set(u)
374
+ if err == nil && p.fromPuny != nil {
375
+ err = p.fromPuny(p, u)
376
+ }
377
+ if err == nil {
378
+ // This should be called on NonTransitional, according to the
379
+ // spec, but that currently does not have any effect. Use the
380
+ // original profile to preserve options.
381
+ err = p.validateLabel(u)
382
+ }
383
+ } else if err == nil {
384
+ err = p.validateLabel(label)
385
+ }
386
+ }
387
+ if toASCII {
388
+ for labels.reset(); !labels.done(); labels.next() {
389
+ label := labels.label()
390
+ if !ascii(label) {
391
+ a, err2 := encode(acePrefix, label)
392
+ if err == nil {
393
+ err = err2
394
+ }
395
+ label = a
396
+ labels.set(a)
397
+ }
398
+ n := len(label)
399
+ if p.verifyDNSLength && err == nil && (n == 0 || n > 63) {
400
+ err = &labelError{label, "A4"}
401
+ }
402
+ }
403
+ }
404
+ s = labels.result()
405
+ if toASCII && p.verifyDNSLength && err == nil {
406
+ // Compute the length of the domain name minus the root label and its dot.
407
+ n := len(s)
408
+ if n > 0 && s[n-1] == '.' {
409
+ n--
410
+ }
411
+ if len(s) < 1 || n > 253 {
412
+ err = &labelError{s, "A4"}
413
+ }
414
+ }
415
+ return s, err
416
+ }
417
+
418
+ func normalize(p *Profile, s string) (string, error) {
419
+ return norm.NFC.String(s), nil
420
+ }
421
+
422
+ func validateRegistration(p *Profile, s string) (string, error) {
423
+ if !norm.NFC.IsNormalString(s) {
424
+ return s, &labelError{s, "V1"}
425
+ }
426
+ for i := 0; i < len(s); {
427
+ v, sz := trie.lookupString(s[i:])
428
+ // Copy bytes not copied so far.
429
+ switch p.simplify(info(v).category()) {
430
+ // TODO: handle the NV8 defined in the Unicode idna data set to allow
431
+ // for strict conformance to IDNA2008.
432
+ case valid, deviation:
433
+ case disallowed, mapped, unknown, ignored:
434
+ r, _ := utf8.DecodeRuneInString(s[i:])
435
+ return s, runeError(r)
436
+ }
437
+ i += sz
438
+ }
439
+ return s, nil
440
+ }
441
+
442
+ func validateAndMap(p *Profile, s string) (string, error) {
443
+ var (
444
+ err error
445
+ b []byte
446
+ k int
447
+ )
448
+ for i := 0; i < len(s); {
449
+ v, sz := trie.lookupString(s[i:])
450
+ start := i
451
+ i += sz
452
+ // Copy bytes not copied so far.
453
+ switch p.simplify(info(v).category()) {
454
+ case valid:
455
+ continue
456
+ case disallowed:
457
+ if err == nil {
458
+ r, _ := utf8.DecodeRuneInString(s[start:])
459
+ err = runeError(r)
460
+ }
461
+ continue
462
+ case mapped, deviation:
463
+ b = append(b, s[k:start]...)
464
+ b = info(v).appendMapping(b, s[start:i])
465
+ case ignored:
466
+ b = append(b, s[k:start]...)
467
+ // drop the rune
468
+ case unknown:
469
+ b = append(b, s[k:start]...)
470
+ b = append(b, "\ufffd"...)
471
+ }
472
+ k = i
473
+ }
474
+ if k == 0 {
475
+ // No changes so far.
476
+ s = norm.NFC.String(s)
477
+ } else {
478
+ b = append(b, s[k:]...)
479
+ if norm.NFC.QuickSpan(b) != len(b) {
480
+ b = norm.NFC.Bytes(b)
481
+ }
482
+ // TODO: the punycode converters require strings as input.
483
+ s = string(b)
484
+ }
485
+ return s, err
486
+ }
487
+
488
+ // A labelIter allows iterating over domain name labels.
489
+ type labelIter struct {
490
+ orig string
491
+ slice []string
492
+ curStart int
493
+ curEnd int
494
+ i int
495
+ }
496
+
497
+ func (l *labelIter) reset() {
498
+ l.curStart = 0
499
+ l.curEnd = 0
500
+ l.i = 0
501
+ }
502
+
503
+ func (l *labelIter) done() bool {
504
+ return l.curStart >= len(l.orig)
505
+ }
506
+
507
+ func (l *labelIter) result() string {
508
+ if l.slice != nil {
509
+ return strings.Join(l.slice, ".")
510
+ }
511
+ return l.orig
512
+ }
513
+
514
+ func (l *labelIter) label() string {
515
+ if l.slice != nil {
516
+ return l.slice[l.i]
517
+ }
518
+ p := strings.IndexByte(l.orig[l.curStart:], '.')
519
+ l.curEnd = l.curStart + p
520
+ if p == -1 {
521
+ l.curEnd = len(l.orig)
522
+ }
523
+ return l.orig[l.curStart:l.curEnd]
524
+ }
525
+
526
+ // next sets the value to the next label. It skips the last label if it is empty.
527
+ func (l *labelIter) next() {
528
+ l.i++
529
+ if l.slice != nil {
530
+ if l.i >= len(l.slice) || l.i == len(l.slice)-1 && l.slice[l.i] == "" {
531
+ l.curStart = len(l.orig)
532
+ }
533
+ } else {
534
+ l.curStart = l.curEnd + 1
535
+ if l.curStart == len(l.orig)-1 && l.orig[l.curStart] == '.' {
536
+ l.curStart = len(l.orig)
537
+ }
538
+ }
539
+ }
540
+
541
+ func (l *labelIter) set(s string) {
542
+ if l.slice == nil {
543
+ l.slice = strings.Split(l.orig, ".")
544
+ }
545
+ l.slice[l.i] = s
546
+ }
547
+
548
+ // acePrefix is the ASCII Compatible Encoding prefix.
549
+ const acePrefix = "xn--"
550
+
551
+ func (p *Profile) simplify(cat category) category {
552
+ switch cat {
553
+ case disallowedSTD3Mapped:
554
+ if p.useSTD3Rules {
555
+ cat = disallowed
556
+ } else {
557
+ cat = mapped
558
+ }
559
+ case disallowedSTD3Valid:
560
+ if p.useSTD3Rules {
561
+ cat = disallowed
562
+ } else {
563
+ cat = valid
564
+ }
565
+ case deviation:
566
+ if !p.transitional {
567
+ cat = valid
568
+ }
569
+ case validNV8, validXV8:
570
+ // TODO: handle V2008
571
+ cat = valid
572
+ }
573
+ return cat
574
+ }
575
+
576
+ func validateFromPunycode(p *Profile, s string) error {
577
+ if !norm.NFC.IsNormalString(s) {
578
+ return &labelError{s, "V1"}
579
+ }
580
+ for i := 0; i < len(s); {
581
+ v, sz := trie.lookupString(s[i:])
582
+ if c := p.simplify(info(v).category()); c != valid && c != deviation {
583
+ return &labelError{s, "V6"}
584
+ }
585
+ i += sz
586
+ }
587
+ return nil
588
+ }
589
+
590
+ const (
591
+ zwnj = "\u200c"
592
+ zwj = "\u200d"
593
+ )
594
+
595
+ type joinState int8
596
+
597
+ const (
598
+ stateStart joinState = iota
599
+ stateVirama
600
+ stateBefore
601
+ stateBeforeVirama
602
+ stateAfter
603
+ stateFAIL
604
+ )
605
+
606
+ var joinStates = [][numJoinTypes]joinState{
607
+ stateStart: {
608
+ joiningL: stateBefore,
609
+ joiningD: stateBefore,
610
+ joinZWNJ: stateFAIL,
611
+ joinZWJ: stateFAIL,
612
+ joinVirama: stateVirama,
613
+ },
614
+ stateVirama: {
615
+ joiningL: stateBefore,
616
+ joiningD: stateBefore,
617
+ },
618
+ stateBefore: {
619
+ joiningL: stateBefore,
620
+ joiningD: stateBefore,
621
+ joiningT: stateBefore,
622
+ joinZWNJ: stateAfter,
623
+ joinZWJ: stateFAIL,
624
+ joinVirama: stateBeforeVirama,
625
+ },
626
+ stateBeforeVirama: {
627
+ joiningL: stateBefore,
628
+ joiningD: stateBefore,
629
+ joiningT: stateBefore,
630
+ },
631
+ stateAfter: {
632
+ joiningL: stateFAIL,
633
+ joiningD: stateBefore,
634
+ joiningT: stateAfter,
635
+ joiningR: stateStart,
636
+ joinZWNJ: stateFAIL,
637
+ joinZWJ: stateFAIL,
638
+ joinVirama: stateAfter, // no-op as we can't accept joiners here
639
+ },
640
+ stateFAIL: {
641
+ 0: stateFAIL,
642
+ joiningL: stateFAIL,
643
+ joiningD: stateFAIL,
644
+ joiningT: stateFAIL,
645
+ joiningR: stateFAIL,
646
+ joinZWNJ: stateFAIL,
647
+ joinZWJ: stateFAIL,
648
+ joinVirama: stateFAIL,
649
+ },
650
+ }
651
+
652
+ // validateLabel validates the criteria from Section 4.1. Item 1, 4, and 6 are
653
+ // already implicitly satisfied by the overall implementation.
654
+ func (p *Profile) validateLabel(s string) error {
655
+ if s == "" {
656
+ if p.verifyDNSLength {
657
+ return &labelError{s, "A4"}
658
+ }
659
+ return nil
660
+ }
661
+ if p.bidirule != nil && !p.bidirule(s) {
662
+ return &labelError{s, "B"}
663
+ }
664
+ if p.checkHyphens {
665
+ if len(s) > 4 && s[2] == '-' && s[3] == '-' {
666
+ return &labelError{s, "V2"}
667
+ }
668
+ if s[0] == '-' || s[len(s)-1] == '-' {
669
+ return &labelError{s, "V3"}
670
+ }
671
+ }
672
+ if !p.checkJoiners {
673
+ return nil
674
+ }
675
+ trie := p.trie // p.checkJoiners is only set if trie is set.
676
+ // TODO: merge the use of this in the trie.
677
+ v, sz := trie.lookupString(s)
678
+ x := info(v)
679
+ if x.isModifier() {
680
+ return &labelError{s, "V5"}
681
+ }
682
+ // Quickly return in the absence of zero-width (non) joiners.
683
+ if strings.Index(s, zwj) == -1 && strings.Index(s, zwnj) == -1 {
684
+ return nil
685
+ }
686
+ st := stateStart
687
+ for i := 0; ; {
688
+ jt := x.joinType()
689
+ if s[i:i+sz] == zwj {
690
+ jt = joinZWJ
691
+ } else if s[i:i+sz] == zwnj {
692
+ jt = joinZWNJ
693
+ }
694
+ st = joinStates[st][jt]
695
+ if x.isViramaModifier() {
696
+ st = joinStates[st][joinVirama]
697
+ }
698
+ if i += sz; i == len(s) {
699
+ break
700
+ }
701
+ v, sz = trie.lookupString(s[i:])
702
+ x = info(v)
703
+ }
704
+ if st == stateFAIL || st == stateAfter {
705
+ return &labelError{s, "C"}
706
+ }
707
+ return nil
708
+ }
709
+
710
+ func ascii(s string) bool {
711
+ for i := 0; i < len(s); i++ {
712
+ if s[i] >= utf8.RuneSelf {
713
+ return false
714
+ }
715
+ }
716
+ return true
717
+ }