diff options
Diffstat (limited to 'src/librepgp/stream-armor.cpp')
-rw-r--r-- | src/librepgp/stream-armor.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librepgp/stream-armor.cpp b/src/librepgp/stream-armor.cpp index 669c305..b6669dc 100644 --- a/src/librepgp/stream-armor.cpp +++ b/src/librepgp/stream-armor.cpp @@ -235,7 +235,8 @@ armor_read_trailer(pgp_source_t *src) size_t stlen; pgp_source_armored_param_t *param = (pgp_source_armored_param_t *) src->param; - if (!armor_skip_chars(param->readsrc, "\r\n")) { + /* Space or tab could get between armor and trailer, see issue #2199 */ + if (!armor_skip_chars(param->readsrc, "\r\n \t")) { return false; } @@ -1159,6 +1160,9 @@ is_armored_source(pgp_source_t *src) return false; } buf[read - 1] = 0; + if (!!strstr((char *) buf, ST_CLEAR_BEGIN)) { + return false; + } return !!strstr((char *) buf, ST_ARMOR_BEGIN); } |