Merge pull request #609 from yoe/master
Allow ASN.1 decoding if the file seems incomplete
This commit is contained in:
commit
9cc7da4c80
|
@ -1720,12 +1720,17 @@ static int do_asn1(int argc, char **argv)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if ((size_t)r != len) {
|
if ((size_t)r != len) {
|
||||||
printf("expecting %lu, got only %d bytes.\n", (unsigned long) len, r);
|
printf("WARNING: expecting %lu, got %d bytes.\n", (unsigned long) len, r);
|
||||||
|
/* some cards return a bogus value for file length. As
|
||||||
|
* long as the actual length is not higher than the expected
|
||||||
|
* length, continue */
|
||||||
|
if(r > len) {
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* asn1 dump */
|
/* asn1 dump */
|
||||||
sc_asn1_print_tags(buf, len);
|
sc_asn1_print_tags(buf, r);
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
err:
|
err:
|
||||||
|
|
Loading…
Reference in New Issue