Fixing a few errors.

* Fixing organizational_unit and common name

* FIxing organization name and allow creaters to view CA.
This commit is contained in:
kevgliss 2016-06-29 16:16:37 -07:00 committed by GitHub
parent afb66df1a4
commit 9aec899bfd
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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
)]
),