Skip to content

Commit

Permalink
reconcile DES errors with crypto/des
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Sep 21, 2023
1 parent 9272641 commit 916bdf3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions des.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,17 @@ func (c *desCipher) BlockSize() int {
}

func (c *desCipher) Encrypt(dst, src []byte) {
c.encrypt(dst, src)
if err := c.encrypt(dst, src); err != nil {
// Upstream expects that the panic message starts with "crypto/des: ".
panic("crypto/des: " + err.Error())
}
}

func (c *desCipher) Decrypt(dst, src []byte) {
c.decrypt(dst, src)
if err := c.decrypt(dst, src); err != nil {
// Upstream expects that the panic message starts with "crypto/des: ".
panic("crypto/des: " + err.Error())
}
}

func (c *desCipher) NewCBCEncrypter(iv []byte) cipher.BlockMode {
Expand Down

0 comments on commit 916bdf3

Please sign in to comment.