* commit 'dcc645ebb1a87982d2a067b8584ff167ae2c5287': Revert the revert. (its time to sign MR1)
This commit is contained in:
@@ -957,3 +957,18 @@ def GetTypeAndDevice(mount_point, info):
|
||||
return PARTITION_TYPES[fstab[mount_point].fs_type], fstab[mount_point].device
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def ParseCertificate(data):
|
||||
"""Parse a PEM-format certificate."""
|
||||
cert = []
|
||||
save = False
|
||||
for line in data.split("\n"):
|
||||
if "--END CERTIFICATE--" in line:
|
||||
break
|
||||
if save:
|
||||
cert.append(line)
|
||||
if "--BEGIN CERTIFICATE--" in line:
|
||||
save = True
|
||||
cert = "".join(cert).decode('base64')
|
||||
return cert
|
||||
|
Reference in New Issue
Block a user