aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/rpki/x509.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/rpki/x509.py b/scripts/rpki/x509.py
index 9c0aa2e8..58c1ab06 100644
--- a/scripts/rpki/x509.py
+++ b/scripts/rpki/x509.py
@@ -23,7 +23,8 @@ class PEM_converter(object):
self.e = "-----END %s-----" % kind
def looks_like_PEM(self, text):
- return text.find(self.b) >= 0 and text.find(self.e) > 0
+ b = text.find(self.b)
+ return b >= 0 and text.find(self.e) > b + len(self.b)
def to_DER(self, pem):
"""Convert from PEM to DER."""