From c4d7759b008790d5af8715eeed546d83f9b196e7 Mon Sep 17 00:00:00 2001 From: eater <=@eater.me> Date: Sun, 11 Aug 2019 15:42:36 +0200 Subject: [PATCH] Welcome to the hell we created or something --- crypto.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto.go b/crypto.go index cc2f92e..8fc355d 100644 --- a/crypto.go +++ b/crypto.go @@ -1,6 +1,7 @@ package service import ( + "crypto" cipher2 "crypto/cipher" "crypto/rand" "crypto/rsa" @@ -68,7 +69,7 @@ func DecryptAndVerify(input []byte, key *rsa.PrivateKey, pub *rsa.PublicKey, sig fingerprint := signature fingerprintHashed := sha256.Sum256(fingerprint) - err = rsa.VerifyPKCS1v15(pub, 0, fingerprintHashed[:], recvSignature) + err = rsa.VerifyPKCS1v15(pub, crypto.SHA256, fingerprintHashed[:], recvSignature) return err } @@ -98,7 +99,7 @@ func EncryptAndSign(v Message, key *rsa.PrivateKey, pub *rsa.PublicKey, signatur } hashedFingerpint := sha256.Sum256(signature) - plainSignature, err := rsa.SignPKCS1v15(rand.Reader, key, 0, hashedFingerpint[:]) + plainSignature, err := rsa.SignPKCS1v15(rand.Reader, key, crypto.SHA256, hashedFingerpint[:]) if err != nil { return err }