Skip to content

Commit fe6f0a6

Browse files
BertalanDemersion
authored andcommitted
protonmail: make SRP modulus signature failures fatal
In 93c8007, SRP signature errors were made non-fatal because many users got the following error: openpgp: unsupported feature: public key algorithm 22 This is because Protonmail started signing these messages with an EDDSA key, an algorithm which the Go OpenPGP library does not support. The switch to github.com/protonmail/crypto introduces this algorithm, so messages that haven't been tampered with should pass the verification.
1 parent 06f6d5b commit fe6f0a6

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

protonmail/srp.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ import (
88
"errors"
99
"fmt"
1010
"io"
11-
"log"
1211
"math/big"
1312

1413
"golang.org/x/crypto/openpgp"
1514
"golang.org/x/crypto/openpgp/clearsign"
16-
openpgperrors "golang.org/x/crypto/openpgp/errors"
1715
)
1816

1917
var randReader io.Reader = rand.Reader
@@ -45,9 +43,8 @@ func decodeModulus(msg string) ([]byte, error) {
4543
}
4644

4745
_, err = openpgp.CheckDetachedSignature(modulusKeyring, bytes.NewReader(block.Bytes), block.ArmoredSignature.Body, nil)
48-
if err != nil && err != openpgperrors.ErrUnknownIssuer {
49-
//return nil, fmt.Errorf("failed to decode modulus: %v", err)
50-
log.Println("warning: failed to check SRP modulus signature:", err)
46+
if err != nil {
47+
return nil, fmt.Errorf("failed to check modulus signature: %v", err)
5148
}
5249

5350
b, err := base64.StdEncoding.DecodeString(string(block.Plaintext))

0 commit comments

Comments
 (0)