diff --git a/lemur/authorities/service.py b/lemur/authorities/service.py index 9de7b1f8..3182b13f 100644 --- a/lemur/authorities/service.py +++ b/lemur/authorities/service.py @@ -98,6 +98,8 @@ def create(**kwargs): kwargs['creator'] = g.user.email body, private_key, chain, roles = mint(**kwargs) + g.user.roles = list(set(list(g.user.roles) + roles)) + kwargs['body'] = body kwargs['private_key'] = private_key kwargs['chain'] = chain diff --git a/lemur/plugins/lemur_cryptography/plugin.py b/lemur/plugins/lemur_cryptography/plugin.py index 38d35fa1..1c8681c3 100644 --- a/lemur/plugins/lemur_cryptography/plugin.py +++ b/lemur/plugins/lemur_cryptography/plugin.py @@ -32,7 +32,8 @@ def build_root_certificate(options): x509.NameAttribute(x509.OID_STATE_OR_PROVINCE_NAME, options['state']), x509.NameAttribute(x509.OID_LOCALITY_NAME, options['location']), x509.NameAttribute(x509.OID_ORGANIZATION_NAME, options['organization']), - x509.NameAttribute(x509.OID_COMMON_NAME, options['organizational_unit']) + x509.NameAttribute(x509.OID_ORGANIZATIONAL_UNIT_NAME, options['organizational_unit']), + x509.NameAttribute(x509.OID_COMMON_NAME, options['common_name']) ]) builder = x509.CertificateBuilder( @@ -67,7 +68,7 @@ def issue_certificate(csr, options): builder = x509.CertificateBuilder( issuer_name=x509.Name([ x509.NameAttribute( - x509.OID_ISSUER_ALTERNATIVE_NAME, + x509.OID_ORGANIZATION_NAME, options['authority'].authority_certificate.issuer )] ),