Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2010-03-08 20:54:05 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2010-03-08 20:54:05 (GMT)
commitb64930b2ebc86407e8d53e155dd6939ebfb4fd67 (patch)
tree31bd73f230ca367f0bd13e605ea9fa2cfbc2a378
parent0a4ea3ec9a4211c6a0455308317cc1e52662f963 (diff)
check private key syntax
-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 3ea1e67..3f93bba 100644
--- a/src/sugar/profile.py
+++ b/src/sugar/profile.py
@@ -105,14 +105,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