~emersion/soju-dev

soju: service: show SHA-512 fingerprint v1 APPLIED

Alexey Yerin: 1
 service: show SHA-512 fingerprint

 1 files changed, 5 insertions(+), 0 deletions(-)
#539402 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/soju-dev/patches/23632/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH soju] service: show SHA-512 fingerprint Export this patch

Fixes #130
---
 service.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/service.go b/service.go
index b9ec679..e11285f 100644
--- a/service.go
+++ b/service.go
@@ -9,6 +9,7 @@ import (
	"crypto/rsa"
	"crypto/sha1"
	"crypto/sha256"
	"crypto/sha512"
	"crypto/x509"
	"crypto/x509/pkix"
	"encoding/hex"
@@ -662,6 +663,8 @@ func handleServiceCertfpGenerate(dc *downstreamConn, params []string) error {
	sendServicePRIVMSG(dc, "SHA-1 fingerprint: "+hex.EncodeToString(sha1Sum[:]))
	sha256Sum := sha256.Sum256(derBytes)
	sendServicePRIVMSG(dc, "SHA-256 fingerprint: "+hex.EncodeToString(sha256Sum[:]))
	sha512Sum := sha512.Sum512(derBytes)
	sendServicePRIVMSG(dc, "SHA-512 fingerprint: "+hex.EncodeToString(sha512Sum[:]))

	return nil
}
@@ -680,6 +683,8 @@ func handleServiceCertfpFingerprints(dc *downstreamConn, params []string) error
	sendServicePRIVMSG(dc, "SHA-1 fingerprint: "+hex.EncodeToString(sha1Sum[:]))
	sha256Sum := sha256.Sum256(net.SASL.External.CertBlob)
	sendServicePRIVMSG(dc, "SHA-256 fingerprint: "+hex.EncodeToString(sha256Sum[:]))
	sha512Sum := sha512.Sum512(net.SASL.External.CertBlob)
	sendServicePRIVMSG(dc, "SHA-512 fingerprint: "+hex.EncodeToString(sha512Sum[:]))
	return nil
}

--
2.32.0
builds.sr.ht
soju/patches/.build.yml: SUCCESS in 1m49s

[service: show SHA-512 fingerprint][0] from [Alexey Yerin][1]

[0]: https://lists.sr.ht/~emersion/soju-dev/patches/23632
[1]: mailto:yyp@disroot.org

✓ #539402 SUCCESS soju/patches/.build.yml https://builds.sr.ht/~emersion/job/539402
Pushed, thanks!