From 9aec899bfd59fddb2b1b1cf86500b74fc7356408 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Wed, 29 Jun 2016 16:16:37 -0700 Subject: [PATCH] Fixing a few errors. * Fixing organizational_unit and common name * FIxing organization name and allow creaters to view CA. --- lemur/authorities/service.py | 2 ++ lemur/plugins/lemur_cryptography/plugin.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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 )] ),