Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package go-sendxmpp for openSUSE:Factory checked in at 2022-09-29 18:14:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/go-sendxmpp (Old) and /work/SRC/openSUSE:Factory/.go-sendxmpp.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "go-sendxmpp" Thu Sep 29 18:14:41 2022 rev:2 rq:1006976 version:0.5.3 Changes: -------- --- /work/SRC/openSUSE:Factory/go-sendxmpp/go-sendxmpp.changes 2022-08-05 19:51:50.545586028 +0200 +++ /work/SRC/openSUSE:Factory/.go-sendxmpp.new.2275/go-sendxmpp.changes 2022-09-29 18:15:24.791496686 +0200 @@ -1,0 +2,89 @@ +Thu Sep 29 14:27:43 UTC 2022 - mvet...@suse.com + +- Update to version 0.5.3: + * Prepare release v0.5.3 + * Don't check for empty message in listen mode. + * Start new development cycle. + * Release v0.5.2 + * Update go modules. + * Don't connect to the XMPP server if the message is empty + * Update go modules. + * Remove another "little". + * Remove the "little". + * Fix typo. + * Improve error handling in XML parsing. + * Update go modules. + * Update go modules. + * Update go modules. + * Update go modules. + * Update go modules. + * Update go modules. + * Update go modules. + * Use resource as alias if specified and no alias is specified. + * Update go modules. + * Deprecate resource setting and introduce alias setting. + * Update go modules. + * Detect CNAME loops. + * Update go modules. + * Perform CNAME look ups. + * Update go modules. + * Fix typo. + * Reply to IQs. + * CI: Strip binaries. + * Update go modules. + * Update go modules. + * Remove local replace in go.mod. + * Update manpage. + * Add new lines to stanzas created by go-sendxmpp itself. + * Update go modules. + * CI: Only build binaries for releases. + * CI: Disable PIE for 32bit builds. + * CI: Try 'static-pie' for 32bit builds. + * CI: Enable all builds except linux/386. + * CI: Disable all builds except amd64 for testing. + * Hopefully fix CI. + * Revert "Add hardening flags to CI builds." + * Revert "Remove `-race` from CI build." + * Remove `-race` from CI build. + * Add hardening flags to CI builds. + * Update go modules. + * Words??? + * Update go modules. + * Update go modules. + * Fix tense. + * Added more checks for empty messages. + * Update go modules. + * Ox: Don't encrypt empty messages. + * Ox: Improve error messages for failed key requests. + * Update modules. + * Update modules. + * Update go modules. + * Update go modules. + * Start new development cycle. + +------------------------------------------------------------------- +Thu Sep 29 14:26:25 UTC 2022 - Michael Vetter <mvet...@suse.com> + +- Update to 0.5.3: + * Don't check for empty message when --listen is used. + +------------------------------------------------------------------- +Thu Sep 29 14:25:49 UTC 2022 - Michael Vetter <mvet...@suse.com> + +- Update to 0.5.2: + Added: + * Reply to disco#info queries. + * Send service-unavailable errors for all other IQs of type get and set. + * New config option and command line flag alias to uncouple MUC + nickname/alias from resource. + Changed: + * Ox: Improve error messages for failed key requests. + * Ox: Do not encrypt empty messages. + * Check for empty messages. + * Always look up CNAME before doing SRV lookups (via xmppsrv v0.2.3). + * Detect CNAME loops (max. 5 CNAMEs) (via xmppsrv >= v0.2.4). + * Deprecate resource config option and command line flag. + * Improve error handling in XML parsing. + * Don't connect to the XMPP server if the message is empty. + +------------------------------------------------------------------- Old: ---- go-sendxmpp-0.5.1.tar.gz New: ---- go-sendxmpp-0.5.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ go-sendxmpp.spec ++++++ --- /var/tmp/diff_new_pack.KoXySr/_old 2022-09-29 18:15:25.451497980 +0200 +++ /var/tmp/diff_new_pack.KoXySr/_new 2022-09-29 18:15:25.455497987 +0200 @@ -17,7 +17,7 @@ Name: go-sendxmpp -Version: 0.5.1 +Version: 0.5.3 Release: 0 Summary: A little tool to send messages to an XMPP contact or MUC License: BSD-2-Clause ++++++ _service ++++++ --- /var/tmp/diff_new_pack.KoXySr/_old 2022-09-29 18:15:25.483498042 +0200 +++ /var/tmp/diff_new_pack.KoXySr/_new 2022-09-29 18:15:25.487498050 +0200 @@ -3,7 +3,7 @@ <param name="url">https://salsa.debian.org/mdosch/go-sendxmpp.git</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v0.5.1</param> + <param name="revision">v0.5.3</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> ++++++ go-sendxmpp-0.5.1.tar.gz -> go-sendxmpp-0.5.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/.gitignore new/go-sendxmpp-0.5.3/.gitignore --- old/go-sendxmpp-0.5.1/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/go-sendxmpp-0.5.3/.gitignore 2022-09-29 15:37:40.000000000 +0200 @@ -0,0 +1,17 @@ +config.json +.vscode + +# Binaries for programs and plugins +*.exe +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 +.glide/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/.gitlab-ci.yml new/go-sendxmpp-0.5.3/.gitlab-ci.yml --- old/go-sendxmpp-0.5.1/.gitlab-ci.yml 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/.gitlab-ci.yml 2022-09-29 15:37:40.000000000 +0200 @@ -38,12 +38,12 @@ - tags script: - echo "${CI_JOB_ID}" > CI_JOB_ID.txt - - env GOOS=linux GOARCH=amd64 go build -race -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/linux-amd64/go-sendxmpp - - env GOOS=linux GOARCH=arm64 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/linux-arm64/go-sendxmpp - - env GOOS=linux GOARCH=386 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/linux-386/go-sendxmpp - - env GOOS=linux GOARCH=arm go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/linux-arm/go-sendxmpp - - env GOOS=windows GOARCH=386 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/win386/go-sendxmpp.exe - - env GOOS=windows GOARCH=amd64 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/win64/go-sendxmpp.exe + - env GOOS=linux GOARCH=amd64 go build -buildmode=pie -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/linux-amd64/go-sendxmpp + - env GOOS=linux GOARCH=arm64 go build -buildmode=pie -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/linux-arm64/go-sendxmpp + - env GOOS=linux GOARCH=386 go build -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/linux-386/go-sendxmpp + - env GOOS=linux GOARCH=arm go build -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/linux-arm/go-sendxmpp + - env GOOS=windows GOARCH=386 go build -buildmode=pie -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/win386/go-sendxmpp.exe + - env GOOS=windows GOARCH=amd64 go build -buildmode=pie -ldflags "-s -w -extldflags '-static'" -o $CI_PROJECT_DIR/win64/go-sendxmpp.exe artifacts: paths: - linux-amd64/go-sendxmpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/CHANGELOG.md new/go-sendxmpp-0.5.3/CHANGELOG.md --- old/go-sendxmpp-0.5.1/CHANGELOG.md 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/CHANGELOG.md 2022-09-29 15:37:40.000000000 +0200 @@ -1,18 +1,38 @@ # Changelog +## [v0.5.3] 2022-09-29 +### Changed +- Don't check for empty message when `--listen` is used. + +## [v0.5.2] 2022-09-29 +### Added +- Reply to `disco#info` queries. +- Send `service-unavailable` errors for all other IQs of type `get` and `set`. +- New config option and command line flag `alias` to uncouple MUC nickname/alias from resource. + +### Changed +- Ox: Improve error messages for failed key requests. +- Ox: Do not encrypt empty messages. +- Check for empty messages. +- Always look up CNAME before doing SRV lookups (via xmppsrv v0.2.3). +- Detect CNAME loops (max. 5 CNAMEs) (via xmppsrv >= v0.2.4). +- Deprecate resource config option and command line flag. +- Improve error handling in XML parsing. +- Don't connect to the XMPP server if the message is empty. + ## [v0.5.1] 2022-05-22 ### Changed -- Improved listening mode for groupchats. -- Fixed nickname in MUCs if not manually set. +- Improve listening mode for groupchats. +- Fix nickname in MUCs if not manually set. ## [v0.5.0] 2022-05-05 ### Added -- Added possibility to delete existing OpenPGP for XMPP nodes. +- Add possibility to delete existing OpenPGP for XMPP nodes. ### Changed -- Ox: Improved rpad generation. -- Reworked receiving of stanzas. -- Ox: Improved private key import. +- Ox: Improve rpad generation. +- Rework receiving of stanzas. +- Ox: Improve private key import. ## [v0.4.0] 2022-04-30 ### Added diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/README.md new/go-sendxmpp-0.5.3/README.md --- old/go-sendxmpp-0.5.1/README.md 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/README.md 2022-09-29 15:37:40.000000000 +0200 @@ -2,7 +2,7 @@ ## about -A little tool to send messages to an XMPP contact or MUC inspired by [sendxmpp](https://sendxmpp.hostname.sk/). +A tool to send messages to an XMPP contact or MUC inspired by [sendxmpp](https://sendxmpp.hostname.sk/). You can find other sendxmpp alternatives in the [XSF wiki](https://wiki.xmpp.org/web/User:MDosch/Sendxmpp_incarnations). ## support @@ -73,17 +73,18 @@ eval_password: <command_to_unlock_your_password> ``` -You can also configure the resource (and nickname for MUCs) via the `resource` setting: +You can also configure the alias/nickname for MUCs via the `alias` setting: ``` -resource: <my_resource> +alias: <my_alias> ``` If no configuration file is present or if the values should be overridden it is possible to define the account details via command line options: ```plain -Usage: go-sendxmpp [-cdilnt] [-f value] [--help] [--http-upload value] [-j value] [-m value] [--muc-password value] [--ox] [--ox-delete-nodes] [--ox-genprivkey-rsa] [--ox-genprivkey-x25519] [--ox-import-privkey value] [--ox-passphrase value] [-p value] [--raw] [-r value] [--timeout value] [--tls-version value] [-u value] [--version] [parameters ...] +Usage: go-sendxmpp [-cdilnt] [-a value] [-f value] [--help] [--http-upload value] [-j value] [-m value] [--muc-password value] [--ox] [--ox-delete-nodes] [--ox-genprivkey-rsa] [--ox-genprivkey-x25519] [--ox-import-privkey value] [--ox-passphrase value] [-p value] [--raw] [-r value] [--timeout value] [--tls-version value] [-u value] [--version] [parameters ...] + -a, --alias=value Set alias/nicknamefor chatrooms. -c, --chatroom Send message to a chatroom. -d, --debug Show debugging info. -f, --file=value Set configuration file. (Default: @@ -120,7 +121,7 @@ --raw Send raw XML. -r, --resource=value Set resource. When sending to a chatroom this is used as - 'alias'. + 'alias'. DEPRECATED: Use --alias instead. --timeout=value Connection timeout in seconds. [10] -t, --tls Use direct TLS. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/const.go new/go-sendxmpp-0.5.3/const.go --- old/go-sendxmpp-0.5.1/const.go 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/const.go 2022-09-29 15:37:40.000000000 +0200 @@ -5,7 +5,7 @@ package main const ( - version = "0.5.1" + version = "0.5.3" nsDiscoInfo = "http://jabber.org/protocol/disco#info" nsDiscoItems = "http://jabber.org/protocol/disco#items" nsEme = "urn:xmpp:eme:0" @@ -17,6 +17,7 @@ nsOxPubKeys = "urn:xmpp:openpgp:0:public-keys" nsPubsub = "http://jabber.org/protocol/pubsub" nsPubsubOwner = "http://jabber.org/protocol/pubsub#owner" + nsXMPPStanzas = "urn:ietf:params:xml:ns:xmpp-stanzas" oxAltBody = "This message is encrypted (XEP-0373: OpenPGP for XMPP)." pubsubPubOptions = "http://jabber.org/protocol/pubsub#publish-options" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/go.mod new/go-sendxmpp-0.5.3/go.mod --- old/go-sendxmpp-0.5.1/go.mod 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/go.mod 2022-09-29 15:37:40.000000000 +0200 @@ -3,19 +3,21 @@ go 1.17 require ( - github.com/ProtonMail/gopenpgp/v2 v2.4.7 + github.com/ProtonMail/gopenpgp/v2 v2.4.10 github.com/beevik/etree v1.1.0 - github.com/gabriel-vasile/mimetype v1.4.0 - github.com/mattn/go-xmpp v0.0.0-20220513082406-1411b9cc8b9a + github.com/gabriel-vasile/mimetype v1.4.1 + github.com/mattn/go-xmpp v0.0.0-20220712221724-2eb234970ce7 github.com/pborman/getopt/v2 v2.1.0 - salsa.debian.org/mdosch/xmppsrv v0.1.1 + salsa.debian.org/mdosch/xmppsrv v0.2.4 ) require ( - github.com/ProtonMail/go-crypto v0.0.0-20220517143526-88bb52951d5b // indirect + github.com/ProtonMail/go-crypto v0.0.0-20220824120805-4b6e5c587895 // indirect github.com/ProtonMail/go-mime v0.0.0-20220429130430-2192574d760f // indirect + github.com/cloudflare/circl v1.2.0 // indirect github.com/pkg/errors v0.9.1 // indirect - golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 // indirect - golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect + golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect + golang.org/x/net v0.0.0-20220927171203-f486391704dc // indirect + golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect golang.org/x/text v0.3.7 // indirect ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/go.sum new/go-sendxmpp-0.5.3/go.sum --- old/go-sendxmpp-0.5.1/go.sum 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/go.sum 2022-09-29 15:37:40.000000000 +0200 @@ -1,22 +1,27 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ProtonMail/go-crypto v0.0.0-20220113124808-70ae35bab23f/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= -github.com/ProtonMail/go-crypto v0.0.0-20220517143526-88bb52951d5b h1:lcbBNuQhppsc7A5gjdHmdlqUqJfgGMylBdGyDs0j7G8= -github.com/ProtonMail/go-crypto v0.0.0-20220517143526-88bb52951d5b/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= +github.com/ProtonMail/go-crypto v0.0.0-20220822140716-1678d6eb0cbe/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= +github.com/ProtonMail/go-crypto v0.0.0-20220824120805-4b6e5c587895 h1:NsReiLpErIPzRrnogAXYwSoU7txA977LjDGrbkewJbg= +github.com/ProtonMail/go-crypto v0.0.0-20220824120805-4b6e5c587895/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= github.com/ProtonMail/go-mime v0.0.0-20220302105931-303f85f7fe0f/go.mod h1:NYt+V3/4rEeDuaev/zw1zCq8uqVEuPHzDPo3OZrlGJ4= github.com/ProtonMail/go-mime v0.0.0-20220429130430-2192574d760f h1:4IWzKjHzZxdrW9k4zl/qCwenOVHDbVDADPPHFLjs0Oc= github.com/ProtonMail/go-mime v0.0.0-20220429130430-2192574d760f/go.mod h1:qRZgbeASl2a9OwmsV85aWwRqic0NHPh+9ewGAzb4cgM= -github.com/ProtonMail/gopenpgp/v2 v2.4.7 h1:V3xeelvXgJiZXZuPtSSE+uYbtPw4RmbmyPqXDAESPhg= -github.com/ProtonMail/gopenpgp/v2 v2.4.7/go.mod h1:ZW1KxHNG6q5LMgFKf9Ap/d2eVYeyGf5+fAUEAjJWtmo= +github.com/ProtonMail/gopenpgp/v2 v2.4.10 h1:EYgkxzwmQvsa6kxxkgP1AwzkFqKHscF2UINxaSn6rdI= +github.com/ProtonMail/gopenpgp/v2 v2.4.10/go.mod h1:CTRA7/toc/4DxDy5Du4hPDnIZnJvXSeQ8LsRTOUJoyc= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bwesterb/go-ristretto v1.2.1/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.2.0 h1:NheeISPSUcYftKlfrLuOo4T62FkmD4t4jviLfFFYaec= +github.com/cloudflare/circl v1.2.0/go.mod h1:Ch2UgYr6ti2KTtlejELlROl0YIYj7SLjAC8M+INXlMk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gabriel-vasile/mimetype v1.4.0 h1:Cn9dkdYsMIu56tGho+fqzh7XmvY2YyGU0FnbhiOsEro= -github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= +github.com/gabriel-vasile/mimetype v1.4.1 h1:TRWk7se+TOjCYgRth7+1/OYLNiRNIotknkFtf/dnN7Q= +github.com/gabriel-vasile/mimetype v1.4.1/go.mod h1:05Vi0w3Y9c/lNvJOdmIwvrrAhX3rYhfQQCaf9VJcv7M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/mattn/go-xmpp v0.0.0-20220513082406-1411b9cc8b9a h1:sKMsZuaXOyrN9kzdM3kGS4L5f0JTpno7PMIUVw5smzo= -github.com/mattn/go-xmpp v0.0.0-20220513082406-1411b9cc8b9a/go.mod h1:Cs5mF0OsrRRmhkyOod//ldNPOwJsrBvJ+1WRspv0xoc= +github.com/mattn/go-xmpp v0.0.0-20220712221724-2eb234970ce7 h1:0U0Eg1+Rl7tJvK4VSVQEfdZnZw846o73XJkq+DUpsEA= +github.com/mattn/go-xmpp v0.0.0-20220712221724-2eb234970ce7/go.mod h1:Cs5mF0OsrRRmhkyOod//ldNPOwJsrBvJ+1WRspv0xoc= github.com/pborman/getopt/v2 v2.1.0 h1:eNfR+r+dWLdWmV8g5OlpyrTYHkhVNxHBdN2cCrJmOEA= github.com/pborman/getopt/v2 v2.1.0/go.mod h1:4NtW75ny4eBw9fO1bhtNdYTlZKYX5/tBLtsOpwKIKd0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -32,9 +37,10 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 h1:SLP7Q4Di66FONjDJbCYrCRrh97focO6sLogHO7/g8F0= -golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be h1:fmw3UbQh+nxngCAHrDCCztao/kbYFnWjoqop8dHx05A= +golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -47,10 +53,10 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220927171203-f486391704dc h1:FxpXZdoBqT8RjqTy6i1E8nXHhW21wK7ptQ/EPIGxzPQ= +golang.org/x/net v0.0.0-20220927171203-f486391704dc/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -58,7 +64,12 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= +golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -76,5 +87,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -salsa.debian.org/mdosch/xmppsrv v0.1.1 h1:I/5HS+cOg27LRADQ2R4KqQY6DTVMsaPMu9ywSAMTOG8= -salsa.debian.org/mdosch/xmppsrv v0.1.1/go.mod h1:udWXnWFa9zkcyN9YSB/u44BCnnRDpeQ0eDy3MVLjHZQ= +salsa.debian.org/mdosch/xmppsrv v0.2.4 h1:ZroUkfml+kxgO+BFocVoVvYqJgk03D9oT1alXoFIyE4= +salsa.debian.org/mdosch/xmppsrv v0.2.4/go.mod h1:udWXnWFa9zkcyN9YSB/u44BCnnRDpeQ0eDy3MVLjHZQ= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/httpupload.go new/go-sendxmpp-0.5.3/httpupload.go --- old/go-sendxmpp-0.5.1/httpupload.go 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/httpupload.go 2022-09-29 15:37:40.000000000 +0200 @@ -65,6 +65,9 @@ log.Fatal(err) } iqDiscoItemsXMLQuery := iqDiscoItemsXML.SelectElement("query") + if iqDiscoItemsXMLQuery == nil { + log.Fatal("no query element in disco items reply") + } iqDiscoItemsXMLItems := iqDiscoItemsXMLQuery.SelectElements("item") // Check the services reported by disco#items for the http upload service @@ -90,10 +93,21 @@ log.Fatal(err) } iqDiscoInfoXMLQuery := iqDiscoInfoXML.SelectElement("query") + if iqDiscoInfoXMLQuery == nil { + continue + } iqDiscoInfoXMLIdentity := iqDiscoInfoXMLQuery.SelectElement("identity") + if iqDiscoInfoXMLIdentity == nil { + continue + } iqDiscoInfoXMLType := iqDiscoInfoXMLIdentity.SelectAttr("type") + if iqDiscoInfoXMLType == nil { + continue + } iqDiscoInfoXMLCategory := iqDiscoInfoXMLIdentity.SelectAttr("category") - + if iqDiscoInfoXMLCategory == nil { + continue + } if iqDiscoInfoXMLType.Value == "file" && iqDiscoInfoXMLCategory.Value == "store" { uploadComponent = jid.Value @@ -108,8 +122,17 @@ field := r.SelectElements("field") for i, t := range field { varAttr := t.SelectAttr("var") + if varAttr == nil { + continue + } prevFieldVal := field[i-1].SelectElement("value") + if prevFieldVal == nil { + continue + } curFieldVal := t.SelectElement("value") + if curFieldVal == nil { + continue + } if varAttr.Value == "max-file-size" && prevFieldVal.Text() == nsHTTPUpload { maxFileSize, err = strconv.ParseInt(curFieldVal.Text(), 10, 64) if err != nil { @@ -154,8 +177,17 @@ log.Fatal(err) } iqHTTPUploadSlotXMLSlot := iqHTTPUploadSlotXML.SelectElement("slot") + if iqHTTPUploadSlotXMLSlot == nil { + log.Fatal("http-upload: no slot element") + } iqHTTPUploadSlotXMLPut := iqHTTPUploadSlotXMLSlot.SelectElement("put") + if iqHTTPUploadSlotXMLPut == nil { + log.Fatal("http-upload: no put element") + } iqHTTPUploadSlotXMLPutURL := iqHTTPUploadSlotXMLPut.SelectAttr("url") + if iqHTTPUploadSlotXMLPutURL == nil { + log.Fatal("http-upload: no url attribute") + } // Upload file httpClient := &http.Client{} @@ -168,6 +200,9 @@ iqHTTPUploadSlotXMLPutHeaders := iqHTTPUploadSlotXMLPut.SelectElements("header") for _, h := range iqHTTPUploadSlotXMLPutHeaders { name := h.SelectAttr("name") + if name == nil { + continue + } switch name.Value { case "Authorization", "Cookie", "Expires": req.Header.Set(name.Value, h.Text()) @@ -184,6 +219,12 @@ // Return http link iqHTTPUploadSlotXMLGet := iqHTTPUploadSlotXMLSlot.SelectElement("get") + if iqHTTPUploadSlotXMLGet == nil { + log.Fatal("http-upload: no get element") + } iqHTTPUploadSlotXMLGetURL := iqHTTPUploadSlotXMLGet.SelectAttr("url") + if iqHTTPUploadSlotXMLGetURL == nil { + log.Fatal("http-upload: no url attribute") + } return iqHTTPUploadSlotXMLGetURL.Value } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/iqhandling.go new/go-sendxmpp-0.5.3/iqhandling.go --- old/go-sendxmpp-0.5.1/iqhandling.go 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/iqhandling.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,35 +0,0 @@ -// Copyright 2020 - 2021 Martin Dosch. -// Use of this source code is governed by the BSD-2-clause -// license that can be found in the LICENSE file. - -package main - -import ( - "github.com/mattn/go-xmpp" // BSD-3-Clause -) - -func sendIQ(client *xmpp.Client, iqc chan xmpp.IQ, target string, - iQtype string, content string) (xmpp.IQ, error) { - var iq xmpp.IQ - id := getID() - c := make(chan xmpp.IQ) - go getIQ(client, id, c, iqc) - _, err := client.RawInformation(client.JID(), target, id, - iQtype, content) - if err != nil { - return iq, err - } - iq = <-c - return iq, nil -} - -func getIQ(client *xmpp.Client, id string, c chan xmpp.IQ, - iqc chan xmpp.IQ) { - for { - iq := <-iqc - if iq.ID == id { - c <- iq - return - } - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/main.go new/go-sendxmpp-0.5.3/main.go --- old/go-sendxmpp-0.5.1/main.go 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/main.go 2022-09-29 15:37:40.000000000 +0200 @@ -27,23 +27,7 @@ port string password string resource string -} - -func rcvStanzas(client *xmpp.Client, iqc chan xmpp.IQ, msgc chan xmpp.Chat) { - for { - received, err := client.Recv() - if err != nil { - log.Println(err) - } - switch v := received.(type) { - case xmpp.Chat: - msgc <- v - case xmpp.IQ: - iqc <- v - case xmpp.Presence: - default: - } - } + alias string } func readMessage(messageFilePath string) (string, error) { @@ -93,10 +77,10 @@ } var ( - err error - message, user, server, password, resource string - oxPrivKey *crypto.Key - recipients []recipientsType + err error + message, user, server, password, resource, alias string + oxPrivKey *crypto.Key + recipients []recipientsType ) // Define command line flags. @@ -109,7 +93,9 @@ flagChatroom := getopt.BoolLong("chatroom", 'c', "Send message to a chatroom.") flagDirectTLS := getopt.BoolLong("tls", 't', "Use direct TLS.") flagResource := getopt.StringLong("resource", 'r', "", "Set resource. "+ - "When sending to a chatroom this is used as 'alias'.") + "When sending to a chatroom this is used as 'alias'. DEPRECATED: Use --alias instead.") + flagAlias := getopt.StringLong("alias", 'a', "", "Set alias/nickname"+ + "for chatrooms.") flagFile := getopt.StringLong("file", 'f', "", "Set configuration file. (Default: "+ "~/.config/go-sendxmpp/sendxmpprc)") flagMessageFile := getopt.StringLong("message", 'm', "", "Set file including the message.") @@ -185,6 +171,7 @@ server = config.jserver password = config.password resource = config.resource + alias = config.alias if config.port != "" { server = net.JoinHostPort(server, fmt.Sprint(config.port)) } @@ -205,11 +192,29 @@ password = *flagPassword } - // Overwrite resource if specified via command line flag + switch { + // Use the resource as alias if no alias is specified otherwise but a resource is specified. + // Backward compat, will be removed when resource is removed. + case alias == "" && *flagAlias == "" && *flagResource != "": + alias = *flagResource + // Use the resource as alias if no alias is specified otherwise but a resource is specified. + // Backward compat, will be removed when resource is removed. + case alias == "" && *flagAlias == "" && resource != "": + alias = resource + // Use "go-sendxmpp" if no nick is specified via config or command line flag. + case alias == "" && *flagAlias == "": + alias = "go-sendxmpp" + // Overwrite configured alias if a nick is specified via command line flag. + case *flagAlias != "": + alias = *flagAlias + } + + // Overwrite resource if specified via command line flag. if *flagResource != "" { + fmt.Println("Deprecated flag: --resource.") resource = *flagResource } else if resource == "" { - // Use "go-sendxmpp" plus a random string if no other resource is specified + // Use "go-sendxmpp" plus a random string if no other resource is specified. resource = "go-sendxmpp." + getShortID() } @@ -262,6 +267,39 @@ } } + // Skip reading message if '-i' or '--interactive' is set to work with e.g. 'tail -f'. + // Also for listening mode. + if !*flagInteractive && !*flagListen { + if message == "" { + + scanner := bufio.NewScanner(os.Stdin) + for scanner.Scan() { + + if message == "" { + message = scanner.Text() + } else { + message = message + "\n" + scanner.Text() + } + } + + if err := scanner.Err(); err != nil { + if err != io.EOF { + log.Fatal(err) + } + } + } + } + + // Remove invalid code points. + message = strings.ToValidUTF8(message, "") + reg := regexp.MustCompile(`[\x{0000}-\x{0008}\x{000B}\x{000C}\x{000E}-\x{001F}]`) + message = reg.ReplaceAllString(message, "") + + // Exit if message is empty. + if message == "" && !*flagInteractive && !*flagListen { + os.Exit(0) + } + // Connect to server. client, err := connect(options, *flagDirectTLS) if err != nil { @@ -279,7 +317,7 @@ re.OxKeyRing, err = oxGetPublicKeyRing(client, iqc, r) if err != nil { re.OxKeyRing = nil - fmt.Println("Couldn't receive key for:", r) + fmt.Println("ox: error fetching key for", r+":", err) } } recipients = append(recipients, re) @@ -352,34 +390,6 @@ *flagHTTPUpload) } - // Skip reading message if '-i' or '--interactive' is set to work with e.g. 'tail -f'. - // Also for listening mode. - if !*flagInteractive && !*flagListen { - if message == "" { - - scanner := bufio.NewScanner(os.Stdin) - for scanner.Scan() { - - if message == "" { - message = scanner.Text() - } else { - message = message + "\n" + scanner.Text() - } - } - - if err := scanner.Err(); err != nil { - if err != io.EOF { - log.Fatal(err) - } - } - } - } - - // Remove invalid code points. - message = strings.ToValidUTF8(message, "") - reg := regexp.MustCompile(`[\x{0000}-\x{0008}\x{000B}\x{000C}\x{000E}-\x{001F}]`) - message = reg.ReplaceAllString(message, "") - var msgType string msgType = "chat" if *flagChatroom { @@ -388,10 +398,10 @@ for _, recipient := range recipients { if *flagMUCPassword != "" { dummyTime := time.Now() - _, err = client.JoinProtectedMUC(recipient.Jid, resource, + _, err = client.JoinProtectedMUC(recipient.Jid, alias, *flagMUCPassword, xmpp.NoHistory, 0, &dummyTime) } else { - _, err = client.JoinMUCNoHistory(recipient.Jid, resource) + _, err = client.JoinMUCNoHistory(recipient.Jid, alias) } if err != nil { log.Fatal(err) @@ -400,8 +410,11 @@ } switch { case *flagRaw: + if message == "" { + break + } // Send raw XML - _, err = client.SendOrg(message) + _, err = client.SendOrg(message + "\n") if err != nil { log.Fatal(err) } @@ -411,6 +424,9 @@ scanner := bufio.NewScanner(os.Stdin) scanner.Scan() message = scanner.Text() + if message == "" { + continue + } for _, recipient := range recipients { switch { case *flagOx: @@ -424,7 +440,7 @@ recipient.Jid) continue } - _, err = client.SendOrg(oxMessage) + _, err = client.SendOrg(oxMessage + "\n") if err != nil { log.Fatal(err) } @@ -508,6 +524,9 @@ } default: for _, recipient := range recipients { + if message == "" { + break + } switch { case *flagHTTPUpload != "": _, err = client.Send(xmpp.Chat{Remote: recipient.Jid, @@ -526,7 +545,7 @@ fmt.Println("Ox: couldn't encrypt to", recipient.Jid) continue } - _, err = client.SendOrg(oxMessage) + _, err = client.SendOrg(oxMessage + "\n") if err != nil { log.Fatal(err) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/man/go-sendxmpp.1 new/go-sendxmpp-0.5.3/man/go-sendxmpp.1 --- old/go-sendxmpp-0.5.1/man/go-sendxmpp.1 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/man/go-sendxmpp.1 2022-09-29 15:37:40.000000000 +0200 @@ -1,15 +1,17 @@ .\" generated with Ronn-NG/v0.9.1 .\" http://github.com/apjanke/ronn-ng/tree/0.9.1 -.TH "GO\-SENDXMPP" "1" "May 2022" "" +.TH "GO\-SENDXMPP" "1" "September 2022" "" .SH "NAME" -\fBgo\-sendxmpp\fR \- A little tool to send messages to an XMPP contact or MUC\. +\fBgo\-sendxmpp\fR \- A tool to send messages to an XMPP contact or MUC\. .SH "SYNOPSIS" \fBgo\-sendxmpp\fR [\-cdintx] [\-f value] [\-\-help] [\-j value] [\-m value] [\-p value] [\-r value] [\-u value] [parameters \|\.\|\.\|\.] .SH "DESCRIPTION" -A little tool to send messages to an XMPP contact or MUC inspired by (but not as powerful as) \fBsendxmpp\fR\. +A tool to send messages to an XMPP contact or MUC inspired by (but not as powerful as) \fBsendxmpp\fR\. .br You can either pipe a programs output to \fBgo\-sendxmpp\fR, write in your terminal (put \fB^D\fR in a new line to finish) or send the input from a file (\fB\-m\fR or \fB\-\-message\fR)\. The account data is expected at \fB~/\.config/go\-sendxmpp/config\fR (preferred), \fB~/\.config/go\-sendxmpp/sendxmpprc\fR (deprecated) \fB~/\.sendxmpprc\fR (for compatibility with the original perl sendxmpp) if no other configuration file location is specified with \fB\-f\fR or \fB\-\-file\fR\. .SH "OPTIONS" +\fB\-a\fR, \fB\-\-alias\fR=[\fIvalue\fR]: Set alias/nicknamefor chatrooms\. +.P \fB\-c\fR, \fB\-\-chatroom\fR=[\fIvalue\fR]: Send message to a chatroom\. .P \fB\-d\fR, \fB\-\-debug\fR: Show debugging info\. @@ -34,7 +36,7 @@ .P \fB\-\-ox\fR: Use "OpenPGP for XMPP" encryption (experimental)\. .br -\fBOx\fR in go\-sendxmpp only supports sending encrypted 1\-1 messages\. Sending to groupchats and sending encrypted files is not supported\. There is no check whether the recipients key is trusted as there is no local keyring used\. Go\-sendxmpp just uses the most recent key that is provided via pubsub and checks that it is not expired\. +Ox in go\-sendxmpp only supports sending encrypted 1\-1 messages\. Sending to groupchats and sending encrypted files is not supported\. There is no check whether the recipients key is trusted as there is no local keyring used\. Go\-sendxmpp just uses the most recent key that is provided via pubsub and checks that it is not expired\. As a user facing client a notification would be shown that a new key is available and ask the user whether to use the new key or stick to the old one\. As go\-sendxmpp is usually used in scripts it just accepts the new key to prevent the user from missing a new notification due to changed keys\. .P \fB\-\-ox\-delete\-nodes\fR: Delete existing OpenPGP nodes on the server\. .P @@ -54,9 +56,9 @@ .P \fB\-p\fR, \fB\-\-password\fR=[\fIvalue\fR]: Password for XMPP account\. .P -\fB\-\-raw\fR: Send raw XML\. To send raw XML to a contact as normal chat message no contact must be specified\. To send raw XML to a MUC you have to specify the MUC via \fB\-c\fR and \fBgo\-sendxmpp\fR will join the MUC\. +\fB\-\-raw\fR: Send raw XML\. To send raw XML to a contact as normal chat message no contact must be specified\. To send raw XML to a MUC you have to specify the MUC via \fB\-c\fR and go\-sendxmpp will join the MUC\. .P -\fB\-r\fR, \fB\-\-resource\fR=[\fIvalue\fR]: Set resource\. When sending to a chatroom this is used as 'alias'\. +\fB\-r\fR, \fB\-\-resource\fR=[\fIvalue\fR]: DEPRECATED: Set resource\. When sending to a chatroom this is used as 'alias'\. .P \fB\-\-timeout=\fR[\fIvalue\fR]: Connection timeout in seconds\. (Default: 10) .P diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/man/go-sendxmpp.1.html new/go-sendxmpp-0.5.3/man/go-sendxmpp.1.html --- old/go-sendxmpp-0.5.1/man/go-sendxmpp.1.html 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/man/go-sendxmpp.1.html 2022-09-29 15:37:40.000000000 +0200 @@ -3,7 +3,7 @@ <head> <meta http-equiv='content-type' content='text/html;charset=utf8'> <meta name='generator' content='Ronn-NG/v0.9.1 (http://github.com/apjanke/ronn-ng/tree/0.9.1)'> - <title>go-sendxmpp(1) - A little tool to send messages to an XMPP contact or MUC.</title> + <title>go-sendxmpp(1) - A tool to send messages to an XMPP contact or MUC.</title> <style type='text/css' media='all'> /* style: man */ body#manpage {margin:0} @@ -74,7 +74,7 @@ <h2 id="NAME">NAME</h2> <p class="man-name"> - <code>go-sendxmpp</code> - <span class="man-whatis">A little tool to send messages to an XMPP contact or MUC.</span> + <code>go-sendxmpp</code> - <span class="man-whatis">A tool to send messages to an XMPP contact or MUC.</span> </p> <h2 id="SYNOPSIS">SYNOPSIS</h2> @@ -82,7 +82,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2> -<p>A little tool to send messages to an XMPP contact or MUC inspired by (but not as powerful as) <code>sendxmpp</code>. <br> +<p>A tool to send messages to an XMPP contact or MUC inspired by (but not as powerful as) <code>sendxmpp</code>. <br> You can either pipe a programs output to <code>go-sendxmpp</code>, write in your terminal (put <code>^D</code> in a new line to finish) or send the input from a file (<code>-m</code> or <code>--message</code>). The account data is expected at <code>~/.config/go-sendxmpp/config</code> (preferred), <code>~/.config/go-sendxmpp/sendxmpprc</code> @@ -91,6 +91,9 @@ <h2 id="OPTIONS">OPTIONS</h2> +<p><code>-a</code>, <code>--alias</code>=[<var>value</var>]: + Set alias/nicknamefor chatrooms.</p> + <p><code>-c</code>, <code>--chatroom</code>=[<var>value</var>]: Send message to a chatroom.</p> @@ -127,11 +130,14 @@ <p><code>--ox</code>: Use "OpenPGP for XMPP" encryption (experimental). <br> - <code>Ox</code> in go-sendxmpp only supports sending encrypted 1-1 messages. Sending to groupchats and + Ox in go-sendxmpp only supports sending encrypted 1-1 messages. Sending to groupchats and sending encrypted files is not supported. There is no check whether the recipients key is trusted as there is no local keyring used. Go-sendxmpp just uses the most recent key that is provided via pubsub and checks that it is not - expired.</p> + expired. As a user facing client a notification would be shown that a new key is available and + ask the user whether to use the new key or stick to the old one. As go-sendxmpp is usually + used in scripts it just accepts the new key to prevent the user from missing a new notification + due to changed keys.</p> <p><code>--ox-delete-nodes</code>: Delete existing OpenPGP nodes on the server.</p> @@ -168,10 +174,10 @@ <p><code>--raw</code>: Send raw XML. To send raw XML to a contact as normal chat message no contact must be specified. - To send raw XML to a MUC you have to specify the MUC via <code>-c</code> and <code>go-sendxmpp</code> will join the MUC.</p> + To send raw XML to a MUC you have to specify the MUC via <code>-c</code> and go-sendxmpp will join the MUC.</p> <p><code>-r</code>, <code>--resource</code>=[<var>value</var>]: - Set resource. When sending to a chatroom this is used as 'alias'.</p> + DEPRECATED: Set resource. When sending to a chatroom this is used as 'alias'.</p> <p><code>--timeout=</code>[<var>value</var>]: Connection timeout in seconds. (Default: 10)</p> @@ -207,7 +213,7 @@ <ol class='man-decor man-foot man foot'> <li class='tl'></li> - <li class='tc'>May 2022</li> + <li class='tc'>September 2022</li> <li class='tr'>go-sendxmpp(1)</li> </ol> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/man/go-sendxmpp.1.ronn new/go-sendxmpp-0.5.3/man/go-sendxmpp.1.ronn --- old/go-sendxmpp-0.5.1/man/go-sendxmpp.1.ronn 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/man/go-sendxmpp.1.ronn 2022-09-29 15:37:40.000000000 +0200 @@ -1,4 +1,4 @@ -go-sendxmpp(1) -- A little tool to send messages to an XMPP contact or MUC. +go-sendxmpp(1) -- A tool to send messages to an XMPP contact or MUC. ==== ## SYNOPSIS @@ -7,7 +7,7 @@ ## DESCRIPTION -A little tool to send messages to an XMPP contact or MUC inspired by (but not as powerful as) `sendxmpp`. +A tool to send messages to an XMPP contact or MUC inspired by (but not as powerful as) `sendxmpp`. You can either pipe a programs output to `go-sendxmpp`, write in your terminal (put `^D` in a new line to finish) or send the input from a file (`-m` or `--message`). The account data is expected at `~/.config/go-sendxmpp/config` (preferred), `~/.config/go-sendxmpp/sendxmpprc` @@ -16,6 +16,9 @@ ## OPTIONS + `-a`, `--alias`=[<value>]: + Set alias/nicknamefor chatrooms. + `-c`, `--chatroom`=[<value>]: Send message to a chatroom. @@ -52,11 +55,14 @@ `--ox`: Use "OpenPGP for XMPP" encryption (experimental). - `Ox` in go-sendxmpp only supports sending encrypted 1-1 messages. Sending to groupchats and + Ox in go-sendxmpp only supports sending encrypted 1-1 messages. Sending to groupchats and sending encrypted files is not supported. There is no check whether the recipients key is trusted as there is no local keyring used. Go-sendxmpp just uses the most recent key that is provided via pubsub and checks that it is not - expired. + expired. As a user facing client a notification would be shown that a new key is available and + ask the user whether to use the new key or stick to the old one. As go-sendxmpp is usually + used in scripts it just accepts the new key to prevent the user from missing a new notification + due to changed keys. `--ox-delete-nodes`: Delete existing OpenPGP nodes on the server. @@ -93,10 +99,10 @@ `--raw`: Send raw XML. To send raw XML to a contact as normal chat message no contact must be specified. - To send raw XML to a MUC you have to specify the MUC via `-c` and `go-sendxmpp` will join the MUC. + To send raw XML to a MUC you have to specify the MUC via `-c` and go-sendxmpp will join the MUC. `-r`, `--resource`=[<value>]: - Set resource. When sending to a chatroom this is used as 'alias'. + DEPRECATED: Set resource. When sending to a chatroom this is used as 'alias'. `--timeout=`[<value>]: Connection timeout in seconds. (Default: 10) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/man/go-sendxmpp.5 new/go-sendxmpp-0.5.3/man/go-sendxmpp.5 --- old/go-sendxmpp-0.5.1/man/go-sendxmpp.5 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/man/go-sendxmpp.5 2022-09-29 15:37:40.000000000 +0200 @@ -1,8 +1,8 @@ .\" generated with Ronn-NG/v0.9.1 .\" http://github.com/apjanke/ronn-ng/tree/0.9.1 -.TH "GO\-SENDXMPP" "5" "February 2022" "" +.TH "GO\-SENDXMPP" "5" "September 2022" "" .SH "NAME" -\fBgo\-sendxmpp\fR \- A little tool to send messages to an XMPP contact or MUC\. +\fBgo\-sendxmpp\fR \- A tool to send messages to an XMPP contact or MUC\. .SH "LOCATION" The account data is expected at \fB~/\.config/go\-sendxmpp/config\fR (preferred), \fB~/\.config/go\-sendxmpp/sendxmpprc\fR deprecated) or \fB~/\.sendxmpprc\fR (for compatibility with the original perl sendxmpp) if no other configuration file location is specified with \-f or \-\-file\. The configuration file is expected to be in the following format: .SH "FORMAT" @@ -16,7 +16,7 @@ .br eval_password: [\fIcommand_to_unlock_your_password\fR] .br -resource: [\fIyour_resource\fR] +alias: [\fIyour_alias\fR] .SH "REQUIRED SETTINGS" If all necessary settings are supplied as command line arguments no config file is needed at all\. Setting \fBjserver\fR and \fBport\fR might not be necessary depending on the used server\. .br diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/man/go-sendxmpp.5.html new/go-sendxmpp-0.5.3/man/go-sendxmpp.5.html --- old/go-sendxmpp-0.5.1/man/go-sendxmpp.5.html 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/man/go-sendxmpp.5.html 2022-09-29 15:37:40.000000000 +0200 @@ -3,7 +3,7 @@ <head> <meta http-equiv='content-type' content='text/html;charset=utf8'> <meta name='generator' content='Ronn-NG/v0.9.1 (http://github.com/apjanke/ronn-ng/tree/0.9.1)'> - <title>go-sendxmpp(5) - A little tool to send messages to an XMPP contact or MUC.</title> + <title>go-sendxmpp(5) - A tool to send messages to an XMPP contact or MUC.</title> <style type='text/css' media='all'> /* style: man */ body#manpage {margin:0} @@ -73,7 +73,7 @@ <h2 id="NAME">NAME</h2> <p class="man-name"> - <code>go-sendxmpp</code> - <span class="man-whatis">A little tool to send messages to an XMPP contact or MUC.</span> + <code>go-sendxmpp</code> - <span class="man-whatis">A tool to send messages to an XMPP contact or MUC.</span> </p> <h2 id="LOCATION">LOCATION</h2> @@ -88,7 +88,7 @@ port: [<var>jabber_port</var>] <br> password: [<var>your_jabber_password</var>] <br> eval_password: [<var>command_to_unlock_your_password</var>] <br> -resource: [<var>your_resource</var>]</p> +alias: [<var>your_alias</var>]</p> <h2 id="REQUIRED-SETTINGS">REQUIRED SETTINGS</h2> @@ -116,7 +116,7 @@ <ol class='man-decor man-foot man foot'> <li class='tl'></li> - <li class='tc'>February 2022</li> + <li class='tc'>September 2022</li> <li class='tr'>go-sendxmpp(5)</li> </ol> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/man/go-sendxmpp.5.ronn new/go-sendxmpp-0.5.3/man/go-sendxmpp.5.ronn --- old/go-sendxmpp-0.5.1/man/go-sendxmpp.5.ronn 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/man/go-sendxmpp.5.ronn 2022-09-29 15:37:40.000000000 +0200 @@ -1,4 +1,4 @@ -go-sendxmpp(5) -- A little tool to send messages to an XMPP contact or MUC. +go-sendxmpp(5) -- A tool to send messages to an XMPP contact or MUC. ==== ## LOCATION @@ -14,7 +14,7 @@ port: [<jabber_port>] password: [<your_jabber_password>] eval_password: [<command_to_unlock_your_password>] -resource: [<your_resource>] +alias: [<your_alias>] ## REQUIRED SETTINGS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/ox.go new/go-sendxmpp-0.5.3/ox.go --- old/go-sendxmpp-0.5.1/ox.go 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/ox.go 2022-09-29 15:37:40.000000000 +0200 @@ -511,11 +511,26 @@ return nil, err } oxPublicKeyXMLPubsub := oxPublicKeyXML.SelectElement("pubsub") + if oxPublicKeyXMLPubsub == nil { + return nil, errors.New("ox: no pubsub element in reply to public " + + "key request") + } oxPublicKeyXMLItems := oxPublicKeyXMLPubsub.SelectElement("items") + if oxPublicKeyXMLItems == nil { + return nil, errors.New("ox: no items element in reply to public " + + "key request") + } oxPublicKeyXMLItem := oxPublicKeyXMLItems.SelectElement("item") + if oxPublicKeyXMLItem == nil { + return nil, errors.New("ox: no item element in reply to public " + + "key request") + } oxPublicKeyXMLPubkeys := oxPublicKeyXMLItem.SelectElements("pubkey") for _, r := range oxPublicKeyXMLPubkeys { data := r.SelectElement("data") + if data == nil { + continue + } decodedPubKey, err := base64.StdEncoding.DecodeString(data.Text()) if err != nil { return nil, err @@ -573,14 +588,32 @@ } oxPubKeyListXMLPubsub := oxPubKeyListXML.SelectElement("pubsub") + if oxPubKeyListXMLPubsub == nil { + return nil, errors.New("ox: no pubsub element in public key list") + } oxPubKeyListXMLPubsubItems := oxPubKeyListXMLPubsub.SelectElement("items") + if oxPubKeyListXMLPubsubItems == nil { + return nil, errors.New("ox: no items element in public key list") + } oxPubKeyListXMLPubsubItemsItem := oxPubKeyListXMLPubsubItems.SelectElement("item") + if oxPubKeyListXMLPubsubItemsItem == nil { + return nil, errors.New("ox: no item element in public key list") + } oxPubKeyListXMLPubsubItemsItemPkl := oxPubKeyListXMLPubsubItemsItem.SelectElement("public-keys-list") + if oxPubKeyListXMLPubsubItemsItemPkl == nil { + return nil, errors.New("ox: no keblic-keys-list element") + } oxPubKeyListXMLPubsubItemsItemPklPm := oxPubKeyListXMLPubsubItemsItemPkl.SelectElements("pubkey-metadata") for _, r := range oxPubKeyListXMLPubsubItemsItemPklPm { date := r.SelectAttr("date") + if date == nil { + continue + } fingerprint := r.SelectAttr("v4-fingerprint") + if fingerprint == nil { + continue + } keyDate, err := time.Parse(time.RFC3339, date.Value) if err != nil { return nil, err @@ -662,6 +695,9 @@ func oxEncrypt(client *xmpp.Client, iqc chan xmpp.IQ, oxPrivKey *crypto.Key, recipient string, keyRing *crypto.KeyRing, message string) (string, error) { + if message == "" { + return "", nil + } privKeyRing, err := crypto.NewKeyRing(oxPrivKey) if err != nil { return "error", err diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/parseconfig.go new/go-sendxmpp-0.5.3/parseconfig.go --- old/go-sendxmpp-0.5.1/parseconfig.go 2022-05-22 12:34:25.000000000 +0200 +++ new/go-sendxmpp-0.5.3/parseconfig.go 2022-09-29 15:37:40.000000000 +0200 @@ -7,6 +7,7 @@ import ( "bufio" "errors" + "fmt" "log" "os" "os/exec" @@ -120,6 +121,9 @@ output.port = row[1] case "resource:": output.resource = row[1] + fmt.Println(configPath+":", "Deprecated option: resource.") + case "alias:": + output.alias = row[1] default: if len(row) >= 2 { if strings.Contains(scanner.Text(), ";") { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/go-sendxmpp-0.5.1/stanzahandling.go new/go-sendxmpp-0.5.3/stanzahandling.go --- old/go-sendxmpp-0.5.1/stanzahandling.go 1970-01-01 01:00:00.000000000 +0100 +++ new/go-sendxmpp-0.5.3/stanzahandling.go 2022-09-29 15:37:40.000000000 +0200 @@ -0,0 +1,130 @@ +// Copyright 2020 - 2021 Martin Dosch. +// Use of this source code is governed by the BSD-2-clause +// license that can be found in the LICENSE file. + +package main + +import ( + "log" + + "github.com/beevik/etree" // BSD-2-clause + "github.com/mattn/go-xmpp" // BSD-3-Clause +) + +func sendIQ(client *xmpp.Client, iqc chan xmpp.IQ, target string, + iQtype string, content string) (xmpp.IQ, error) { + var iq xmpp.IQ + id := getID() + c := make(chan xmpp.IQ) + go getIQ(client, id, c, iqc) + _, err := client.RawInformation(client.JID(), target, id, + iQtype, content+"\n") + if err != nil { + return iq, err + } + iq = <-c + return iq, nil +} + +func getIQ(client *xmpp.Client, id string, c chan xmpp.IQ, + iqc chan xmpp.IQ) { + for { + iq := <-iqc + if iq.ID == id { + c <- iq + return + } + } +} + +func rcvStanzas(client *xmpp.Client, iqc chan xmpp.IQ, msgc chan xmpp.Chat) { + for { + received, err := client.Recv() + if err != nil { + log.Println(err) + } + switch v := received.(type) { + case xmpp.Chat: + msgc <- v + case xmpp.IQ: + switch v.Type { + case "get": + var xmlns *etree.Attr + iq := etree.NewDocument() + err = iq.ReadFromBytes(v.Query) + if err != nil { + log.Println("Couldn't parse IQ:", + string(v.Query), err) + } + query := iq.SelectElement("query") + if query != nil { + xmlns = query.SelectAttr("xmlns") + } + switch xmlns.Value { + case nsDiscoInfo: + root := etree.NewDocument() + reply := root.CreateElement("iq") + reply.CreateAttr("type", "result") + reply.CreateAttr("from", client.JID()) + reply.CreateAttr("to", v.From) + reply.CreateAttr("id", v.ID) + replyQuery := reply.CreateElement("query") + replyQuery.CreateAttr("xmlns", nsDiscoInfo) + identity := replyQuery.CreateElement("identity") + identity.CreateAttr("category", "client") + identity.CreateAttr("type", "bot") + identity.CreateAttr("name", "go-sendxmpp") + feat := replyQuery.CreateElement("feature") + feat.CreateAttr("var", nsDiscoInfo) + xmlString, err := root.WriteToString() + if err == nil { + _, err = client.SendOrg(xmlString) + if err != nil { + log.Println(err) + } + } + default: + root := etree.NewDocument() + reply := root.CreateElement("iq") + reply.CreateAttr("type", "error") + reply.CreateAttr("from", client.JID()) + reply.CreateAttr("to", v.From) + reply.CreateAttr("id", v.ID) + errorReply := reply.CreateElement("error") + errorReply.CreateAttr("type", "cancel") + su := errorReply.CreateElement("service-unavailable") + su.CreateAttr("xmlns", nsXMPPStanzas) + xmlString, err := root.WriteToString() + if err == nil { + _, err = client.SendOrg(xmlString) + if err != nil { + log.Println(err) + } + } + } + case "set": + root := etree.NewDocument() + reply := root.CreateElement("iq") + reply.CreateAttr("type", "error") + reply.CreateAttr("from", client.JID()) + reply.CreateAttr("to", v.From) + reply.CreateAttr("id", v.ID) + errorReply := reply.CreateElement("error") + errorReply.CreateAttr("type", "cancel") + su := errorReply.CreateElement("service-unavailable") + su.CreateAttr("xmlns", nsXMPPStanzas) + xmlString, err := root.WriteToString() + if err == nil { + _, err = client.SendOrg(xmlString) + if err != nil { + log.Println(err) + } + } + case "reply", "error": + iqc <- v + default: + iqc <- v + } + } + } +} ++++++ vendor.tar.gz ++++++ ++++ 18676 lines of diff (skipped)