richardkiss/pycoin — pull request #60 by greenaddress (2014-10-23 14:25:32+00:00)
Title: Check lengths of DER signaures

Currently pycoin allows passing truncated signatures to `sigdecode_der` which causes some invalid signatures to be decoded.

This patch adds a check for missing integer bytes which raises UnexpectedDER in case a signature is truncated.

Tested manually with some valid DER `signature` and `signature[:-1]` - the missing byte causes the exception to be raised correctly.