Home GnuPG

Do not abort on decoder stack overflow.
07116a314f4dUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Do not abort on decoder stack overflow.

* src/ber-decoder.c (push_decoder_state, pop_decoder_state): Return an
error code.
(set_error): Prefix error message with "ksba:". Act on new return code.
(decoder_next): Act on new return code.

This changes the behaviour from

gpgsm: unknown hash algorithm '1.8.48.48.48.48.48.48.48.48'
gpgsm: detached signature w/o data - assuming certs-only
ERROR: decoder stack overflow!
Aborted

to

gpgsm: detached signature w/o data - assuming certs-only
ksba: ber-decoder: stack overflow!
gpgsm: ksba_cms_parse failed: Limit reached

Use "gpgsm --verify FILE" to exhibit the problem. FILE is
-----BEGIN PGP ARMORED FILE-----

MDAGCSqGSIb3DQEHAqCAMDACAQExDzANBgkwMDAwMDAwMDAwADCABgkwMDAwMDAw
MDAAMDEwoIGTMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw
MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw
MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw
MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw
MDAwMDAwMDAwMDAwMDAjMDA=

PQdP

-----END PGP ARMORED FILE-----

  • Reported-by: Hanno Böck
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Apr 9 2015, 11:50 AM
Parents
rKaea7b6032865: Fix integer overflow in the BER decoder.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rK07116a314f4d: Do not abort on decoder stack overflow. (authored by Werner Koch <wk@gnupg.org>).Apr 9 2015, 11:50 AM