summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/crypto/otr/otr.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/crypto/otr/otr.go')
-rw-r--r--vendor/golang.org/x/crypto/otr/otr.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/golang.org/x/crypto/otr/otr.go b/vendor/golang.org/x/crypto/otr/otr.go
index 549be116d..173b753db 100644
--- a/vendor/golang.org/x/crypto/otr/otr.go
+++ b/vendor/golang.org/x/crypto/otr/otr.go
@@ -943,6 +943,7 @@ func (c *Conversation) processData(in []byte) (out []byte, tlvs []tlv, err error
t.data, tlvData, ok3 = getNBytes(tlvData, int(t.length))
if !ok1 || !ok2 || !ok3 {
err = errors.New("otr: corrupt tlv data")
+ return
}
tlvs = append(tlvs, t)
}
@@ -1313,6 +1314,12 @@ func (priv *PrivateKey) Import(in []byte) bool {
mpis[i] = new(big.Int).SetBytes(mpiBytes)
}
+ for _, mpi := range mpis {
+ if mpi.Sign() <= 0 {
+ return false
+ }
+ }
+
priv.PrivateKey.P = mpis[0]
priv.PrivateKey.Q = mpis[1]
priv.PrivateKey.G = mpis[2]