Note as of https://github.com/golang/go/issues/44226 x/crypto/openpgp is frozen and deprecated
On Saturday, October 16, 2021 at 9:01:42 PM UTC+2 arud...@stripe.com wrote: > Hello, > > I think I may have found a bug in the x/crypto/openpgp implementation. > However, I wanted to ask here to make sure, before filing a bug report. > > The gist of it is, the RFC for OpenPGP states that "Implementations MUST > implement uncompressed data" (source: > https://datatracker.ietf.org/doc/html/rfc4880#section-9.3). However, the > implementation in Go does not: > https://github.com/golang/crypto/blob/master/openpgp/packet/compressed.go#L50 > > I encountered this issue while trying to use the OpenPGP implementation in > Go to read uncompressed data in a compressed data packet. For reference, > GnuPG seems to handle this case. > > I created a proof of concept to verify the bug: > https://gist.github.com/ajrudzitis/a6b240763f2211da9990480bbd73cfbf > > I was able to parse the message with GnuPG, but not Go: > > # off=0 ctb=c8 tag=8 hlen=2 plen=24 new-ctb > :compressed packet: algo=0 > # off=3 ctb=cb tag=11 hlen=2 plen=21 new-ctb > :literal data packet: > mode t (74), created 0, name="hello.txt", > raw data: 6 byte > > If other folks agree, I am happy to open an issue. > > Cheers, > > Aleks > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/ef10f5cc-6dd9-4f7a-b425-7ff8a8f8e277n%40googlegroups.com.