Welcome to the hell we created or something

master
eater 5 years ago
parent ced1df310f
commit c4d7759b00
Signed by: eater
GPG Key ID: 656785D50BE51C0A

@ -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
}

Loading…
Cancel
Save