Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package xmpp-dns for openSUSE:Factory checked in at 2023-12-28 23:00:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xmpp-dns (Old) and /work/SRC/openSUSE:Factory/.xmpp-dns.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xmpp-dns" Thu Dec 28 23:00:39 2023 rev:10 rq:1135149 version:0.3.10 Changes: -------- --- /work/SRC/openSUSE:Factory/xmpp-dns/xmpp-dns.changes 2023-11-13 22:21:30.948927515 +0100 +++ /work/SRC/openSUSE:Factory/.xmpp-dns.new.28375/xmpp-dns.changes 2023-12-28 23:02:20.100353749 +0100 @@ -1,0 +2,8 @@ +Tue Dec 26 08:10:24 UTC 2023 - Michael Vetter <mvet...@suse.com> + +- Update to 0.3.10: + * Fix stream initialization bug with StartTLS + * Further improve StartTLS stream initialization. + * Improve error messages when server closes connection. + +------------------------------------------------------------------- Old: ---- xmpp-dns-0.3.9.tar.gz New: ---- xmpp-dns-0.3.10.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xmpp-dns.spec ++++++ --- /var/tmp/diff_new_pack.09XCCl/_old 2023-12-28 23:02:20.668374509 +0100 +++ /var/tmp/diff_new_pack.09XCCl/_new 2023-12-28 23:02:20.672374655 +0100 @@ -17,7 +17,7 @@ Name: xmpp-dns -Version: 0.3.9 +Version: 0.3.10 Release: 0 Summary: A CLI tool to check XMPP SRV records License: BSD-2-Clause ++++++ _service ++++++ --- /var/tmp/diff_new_pack.09XCCl/_old 2023-12-28 23:02:20.704375825 +0100 +++ /var/tmp/diff_new_pack.09XCCl/_new 2023-12-28 23:02:20.708375971 +0100 @@ -3,7 +3,7 @@ <param name="url">https://salsa.debian.org/mdosch/xmpp-dns.git</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v0.3.9</param> + <param name="revision">v0.3.10</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">disable</param> <param name="versionrewrite-pattern">v(.*)</param> ++++++ vendor.tar.gz ++++++ ++++++ xmpp-dns-0.3.9.tar.gz -> xmpp-dns-0.3.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xmpp-dns-0.3.9/CHANGELOG.md new/xmpp-dns-0.3.10/CHANGELOG.md --- old/xmpp-dns-0.3.9/CHANGELOG.md 2023-11-09 19:15:41.000000000 +0100 +++ new/xmpp-dns-0.3.10/CHANGELOG.md 2023-12-25 19:36:26.000000000 +0100 @@ -1,5 +1,11 @@ # Changelog +## [0.3.10] 2023-12-25 +### Changed +- Fix stream initialization bug with StartTLS (thanks moparisthebest). +- Further improve StartTLS stream initialization. +- Improve error messages when server closes connection. + ## [0.3.9] 2023-11-09 ### Changed - Also apply timeout when server doesn't reply to StartTLS initialisation. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xmpp-dns-0.3.9/main.go new/xmpp-dns-0.3.10/main.go --- old/xmpp-dns-0.3.9/main.go 2023-11-09 19:15:41.000000000 +0100 +++ new/xmpp-dns-0.3.10/main.go 2023-12-25 19:36:26.000000000 +0100 @@ -21,7 +21,7 @@ ) const ( - version = "0.3.9" + version = "0.3.10" ) // Created with https://github.com/miku/zek @@ -329,7 +329,7 @@ } startStream := "<stream:stream xmlns:stream='http://etherx.jabber.org/streams' " + "xmlns='jabber:" + recordType + "'" + from + " to='" + - tlsConfig.ServerName + "' version='1.0'>\n" + tlsConfig.ServerName + "' version='1.0'>" _, err := c.Write([]byte(startStream)) if err != nil { fmt.Println("StartTLS:", statusNOK) @@ -357,7 +357,7 @@ fmt.Println("Server sent policy-violation:", serverStreamError.Error.Text.Text) } else { - fmt.Println("Server sent EOF.") + fmt.Println("Server closed connection.") } } else { fmt.Println(err) @@ -383,7 +383,7 @@ fmt.Println("Server sent failure.") return } - _, err = c.Write([]byte("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>\n")) + _, err = c.Write([]byte("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>")) if err != nil { fmt.Println("StartTLS:", statusNOK) fmt.Println(err) @@ -400,7 +400,7 @@ fmt.Println("Server sent policy-violation:", serverStreamError.Error.Text.Text) } else { - fmt.Println("Server sent EOF.") + fmt.Println("Server closed connection.") } } else { fmt.Println(err) @@ -423,7 +423,7 @@ switch err.Error() { case "EOF": fmt.Println("StartTLS:", statusNOK) - fmt.Println("Received EOF during handshake.") + fmt.Println("Server closed connection during handshake.") case "context deadline exceeded": fmt.Println("StartTLS:", statusNOK) fmt.Println("Timeout during handshake.") @@ -449,7 +449,7 @@ switch err.Error() { case "EOF": fmt.Println("TLS:", statusNOK) - fmt.Println("Received EOF during handshake.") + fmt.Println("Server closed connection during handshake.") case "context deadline exceeded": fmt.Println("TLS:", statusNOK) fmt.Println("Timeout during handshake.") @@ -466,7 +466,7 @@ } startStream := "<stream:stream xmlns:stream='http://etherx.jabber.org/streams' " + "xmlns='jabber:" + recordType + "'" + from + " to='" + - tlsConfig.ServerName + "' version='1.0'>\n" + tlsConfig.ServerName + "' version='1.0'>" _, err := c.Write([]byte(startStream)) if err != nil { fmt.Println("TLS:", statusNOK) @@ -474,32 +474,46 @@ return } buf := make([]byte, 4096) - _, err = c.Read(buf) - if err != nil { - fmt.Println("TLS:", statusNOK) - if err.Error() == "EOF" { - err = xml.Unmarshal(buf, &serverStreamError) - if err == nil { - fmt.Println("Server sent policy-violation:", - serverStreamError.Error.Text.Text) + ctx3, cancel3 := context.WithCancel(context.Background()) + defer cancel3() + go func() { + for { + _, err = c.Read(buf) + if err != nil { + fmt.Println("TLS:", statusNOK) + if err.Error() == "EOF" { + err = xml.Unmarshal(buf, &serverStreamError) + if err == nil { + fmt.Println("Server sent policy-violation:", + serverStreamError.Error.Text.Text) + } else { + fmt.Println("Server closed connection.") + } + } else { + fmt.Println(err) + } + cancel3() + break + } + if strings.Contains(strings.ToLower(string(buf[:])), "<stream:stream") && + (strings.Contains(strings.ToLower(string(buf[:])), + "xmlns:stream='http://etherx.jabber.org/streams'") || + strings.Contains(strings.ToLower(string(buf[:])), + `xmlns:stream="http://etherx.jabber.org/streams"`)) { + fmt.Println("TLS:", statusOK) + checkCertExpiry(c) + cancel3() + break } else { - fmt.Println("Server sent EOF.") + continue } - } else { - fmt.Println(err) } - return - } - if strings.Contains(strings.ToLower(string(buf[:])), "<stream:stream") && - (strings.Contains(strings.ToLower(string(buf[:])), - "xmlns:stream='http://etherx.jabber.org/streams'") || - strings.Contains(strings.ToLower(string(buf[:])), - `xmlns:stream="http://etherx.jabber.org/streams"`)) { - fmt.Println("TLS:", statusOK) - checkCertExpiry(c) - } else { + }() + select { + case <-ctx3.Done(): + case <-time.After(timeout): fmt.Println("TLS:", statusNOK) - fmt.Println("XMPP stream negotiation failed.") + fmt.Println("Timeout during XMPP stream negotiation.") } } }