summaryrefslogtreecommitdiff
path: root/rsa/pem.py
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2011-07-30 20:16:08 +0200
committerSybren A. Stüvel <sybren@stuvel.eu>2011-07-30 20:16:08 +0200
commitd1447d7be4e9eccf790f7c8b50ac6cffb0e6a8bf (patch)
tree42f8d43528e0ae456c9c997b1686b50605774741 /rsa/pem.py
parent70bc1a5611a45388591f7c7f1eefdae080a29be6 (diff)
downloadrsa-git-d1447d7be4e9eccf790f7c8b50ac6cffb0e6a8bf.tar.gz
Sligthly better ignoring of fields in PEM
Diffstat (limited to 'rsa/pem.py')
-rw-r--r--rsa/pem.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/rsa/pem.py b/rsa/pem.py
index d252772..537aa22 100644
--- a/rsa/pem.py
+++ b/rsa/pem.py
@@ -52,6 +52,10 @@ def load_pem(contents, pem_marker):
for line in contents.split('\n'):
line = line.strip()
+ # Skip empty lines
+ if not line:
+ continue
+
# Handle start marker
if line == pem_start:
if in_pem_part:
@@ -69,8 +73,8 @@ def load_pem(contents, pem_marker):
in_pem_part = False
break
- # Skip empty lines or 'key: value' pairs.
- if ':' in line or not line.strip():
+ # Load fields
+ if ':' in line:
continue
pem_lines.append(line)