1
0
mirror of https://github.com/laurivosandi/certidude synced 2024-12-23 00:25:18 +00:00

Tagging fixes

This commit is contained in:
Lauri Võsandi 2017-04-13 15:42:38 +00:00
parent 7a7f22c1a1
commit d91e12942d
2 changed files with 6 additions and 2 deletions

View File

@ -56,7 +56,10 @@ class TagDetailResource(object):
tags = set(getxattr(path, "user.xdg.tags").decode("utf-8").split(",")) tags = set(getxattr(path, "user.xdg.tags").decode("utf-8").split(","))
except IOError: except IOError:
tags = set() tags = set()
try:
tags.remove(tag) tags.remove(tag)
except KeyError:
pass
if "=" in tag: if "=" in tag:
tags.add("%s=%s" % (tag.split("=")[0], value)) tags.add("%s=%s" % (tag.split("=")[0], value))
else: else:

View File

@ -123,6 +123,7 @@ def revoke(common_name):
attachments=(attach_cert,), attachments=(attach_cert,),
serial_number="%x" % cert.serial, serial_number="%x" % cert.serial,
common_name=common_name) common_name=common_name)
return revoked_path
def server_flags(cn): def server_flags(cn):
if config.USER_ENROLLMENT_ALLOWED and not config.USER_MULTIPLE_CERTIFICATES: if config.USER_ENROLLMENT_ALLOWED and not config.USER_MULTIPLE_CERTIFICATES:
@ -317,7 +318,7 @@ def _sign(csr, buf, overwrite=False):
revoked_path = os.path.join(config.REVOKED_DIR, "%x.pem" % prev.serial) revoked_path = os.path.join(config.REVOKED_DIR, "%x.pem" % prev.serial)
os.rename(signed_path, revoked_path) os.rename(signed_path, revoked_path)
else: else:
revoke(common_name.value) revoked_path = revoke(common_name.value)
else: else:
raise EnvironmentError("Will not overwrite existing certificate") raise EnvironmentError("Will not overwrite existing certificate")