You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've been using the github.com/ProtonMail/gopenpgp/v2/helper library for PGP encryption in our project. Recently, we've encountered an issue where bytes are being dropped during the encryption/decryption process.
Hi. This helper internally callsNewPlainMessageFromString(text string) *PlainMessage, which does the following:
// NewPlainMessageFromString generates a new text PlainMessage,
// ready for encryption, signature, or verification from an unencrypted string.
// This will encrypt the message with the text flag, canonicalize the line endings
// (i.e. set all of them to \r\n) and strip the trailing spaces for each line.
// This allows seamless conversion to clear text signed messages (see RFC 4880 5.2.1 and 7.1).
Hence, it treats the data as text data, strips trailing spaces on each line, and canonicalizes the line endings.
We've been using the
github.com/ProtonMail/gopenpgp/v2/helper
library for PGP encryption in our project. Recently, we've encountered an issue where bytes are being dropped during the encryption/decryption process.Steps to reproduce:
ciphertext, err := helper.EncryptMessageArmored(publicKey, plaintext)
Expected behaviour:
The encrypted files should be able to be decrypted without any loss of data.
Actual behaviour:
Bytes are being dropped during the encryption/decryption process, resulting in incomplete data when the files are decrypted.
Environment:
Go version: 1.21.1
Library version: v2.7.5
We would appreciate any guidance on why this might be happening and how we can resolve it. Thank you in advance for your help.
The text was updated successfully, but these errors were encountered: