pem: Make sure we actually parsed some data
This could happen if there is no separating empty line between header and body. References #3627.
This commit is contained in:
@@ -330,7 +330,7 @@ static status_t pem_to_bin(chunk_t *blob, bool *pgp)
|
|||||||
/* set length to size of binary blob */
|
/* set length to size of binary blob */
|
||||||
blob->len = dst.len;
|
blob->len = dst.len;
|
||||||
|
|
||||||
if (state != PEM_POST)
|
if (state != PEM_POST || !blob->len)
|
||||||
{
|
{
|
||||||
DBG1(DBG_LIB, " file coded in unknown format, discarded");
|
DBG1(DBG_LIB, " file coded in unknown format, discarded");
|
||||||
return PARSE_ERROR;
|
return PARSE_ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user