Revert "Merge commit 'refs/top-bases/t/bug-1568' into t/bug-1568"
This reverts commit12016d5408
, reversing changes made tod006092d37
.
This commit is contained in:
parent
12016d5408
commit
d38d865c7c
7
.topmsg
7
.topmsg
@ -1,7 +0,0 @@
|
|||||||
From: Sascha Silbe <sascha-pgp@silbe.org>
|
|
||||||
Subject: [PATCH] check syntax of private key (#1568)
|
|
||||||
|
|
||||||
Check that header and footer of the private key are present in order to detect
|
|
||||||
corrupted key files.
|
|
||||||
|
|
||||||
Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
|
|
@ -105,18 +105,14 @@ class Profile(object):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
key = ""
|
key = ""
|
||||||
begin_found = False
|
|
||||||
end_found = False
|
|
||||||
for l in lines:
|
for l in lines:
|
||||||
l = l.strip()
|
l = l.strip()
|
||||||
if l.startswith("-----BEGIN DSA PRIVATE KEY-----"):
|
if l.startswith("-----BEGIN DSA PRIVATE KEY-----"):
|
||||||
begin_found = True
|
|
||||||
continue
|
continue
|
||||||
if l.startswith("-----END DSA PRIVATE KEY-----"):
|
if l.startswith("-----END DSA PRIVATE KEY-----"):
|
||||||
end_found = True
|
|
||||||
continue
|
continue
|
||||||
key += l
|
key += l
|
||||||
if not (len(key) and begin_found and end_found):
|
if not len(key):
|
||||||
logging.error("Error parsing public key.")
|
logging.error("Error parsing public key.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user