Re: [golang-dev] Improving x/crypto/openpgp handle on armored messages

60 views
Skip to first unread message

Bryan C. Mills

unread,
Mar 11, 2019, 1:55:21 PM3/11/19
to Diego Medina, golang-...@googlegroups.com
[BCC: golang-dev; CC: golang-openpgp]

On Mon, Mar 11, 2019 at 1:10 AM Diego Medina <fmpw...@gmail.com> wrote:
Hi,

On Dec 3rd 2018 I entered:


"x/crypto/openpgp: tag byte does not have MSB set but gpg decrypts it"

Summary: when you try to decrypt a message, using `openpgp.ReadMessage` and the message isn't in binary format, but instead it is armored, you get the error message:

"tag byte does not have MSB set"

Took me a while but eventually I realized the problem was that I had to first call "openpgp/armor.Decode" and then ReadeMessage.

When you deal with a keyring openpgp provides two flavors of functions, ReadKeyRing and ReadArmoredKeyRing. Would you accept a CL that adds a function ReadArmoredMessage ?

Thanks

Diego

--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Ser

unread,
Apr 17, 2019, 4:44:31 PM4/17/19
to Bryan C. Mills, Diego Medina, golang-...@googlegroups.com
On Monday, March 11, 2019 2:36 PM, 'Bryan C. Mills' via golang-openpgp <golang-...@googlegroups.com> wrote:
> [BCC: golang-dev; CC: golang-openpgp]
>
> On Mon, Mar 11, 2019 at 1:10 AM Diego Medina <fmpw...@gmail.com> wrote:
>
> > Hi,
> >
> > On Dec 3rd 2018 I entered:
> >
> > https://github.com/golang/go/issues/29082
> >
> > "x/crypto/openpgp: tag byte does not have MSB set but gpg decrypts it"
> >
> > Summary: when you try to decrypt a message, using `openpgp.ReadMessage` and the message isn't in binary format, but instead it is armored, you get the error message:
> >
> > "tag byte does not have MSB set"
> >
> > Took me a while but eventually I realized the problem was that I had to first call "openpgp/armor.Decode" and then ReadeMessage.
> >
> > When you deal with a keyring openpgp provides two flavors of functions, ReadKeyRing and ReadArmoredKeyRing. Would you accept a CL that adds a function ReadArmoredMessage ?

Yeah, I'd personally think this makes sense. This function could check
the block type (just like ReadArmoredKeyRing).

Diego Medina

unread,
Apr 17, 2019, 6:36:18 PM4/17/19
to Simon Ser, Bryan C. Mills, Diego Medina, golang-...@googlegroups.com
Great! I'll get this ready in the next few days and reread what the latest way to submit a CL is these days.

Thanks

Diego



--
Reply all
Reply to author
Forward
0 new messages