Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/profile.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sugar/profile.py')
-rw-r--r--src/sugar/profile.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sugar/profile.py b/src/sugar/profile.py
index d5012bd..df9237e 100644
--- a/src/sugar/profile.py
+++ b/src/sugar/profile.py
@@ -97,14 +97,18 @@ class Profile(object):
return None
key = ""
+ begin_found = False
+ end_found = False
for l in lines:
l = l.strip()
if l.startswith("-----BEGIN DSA PRIVATE KEY-----"):
+ begin_found = True
continue
if l.startswith("-----END DSA PRIVATE KEY-----"):
+ end_found = True
continue
key += l
- if not len(key):
+ if not (len(key) and begin_found and end_found):
logging.error("Error parsing public key.")
return None