Add specific algorithm version

This commit is contained in:
Marvin Martinson 2021-08-19 10:46:48 +00:00
parent ab6fe3492e
commit f7017b9eed
2 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,7 @@ class BootstrapResource(object):
key_size=const.KEY_SIZE, key_size=const.KEY_SIZE,
curve=const.CURVE_NAME, curve=const.CURVE_NAME,
hash_algorithm=const.CERTIFICATE_HASH_ALGORITHM, hash_algorithm=const.CERTIFICATE_HASH_ALGORITHM,
key_type_specific = const.KEY_TYPE_SPECIFIC,
algorithm=authority.public_key.algorithm, algorithm=authority.public_key.algorithm,
common_name=authority.certificate.subject.native["common_name"], common_name=authority.certificate.subject.native["common_name"],
distinguished_name=cert_to_dn(authority.certificate), distinguished_name=cert_to_dn(authority.certificate),

View File

@ -38,6 +38,7 @@ if not MONGO_URI:
# Are set later, based on key type # Are set later, based on key type
KEY_SIZE = None KEY_SIZE = None
CURVE_NAME = None CURVE_NAME = None
KEY_TYPE_CLIENTS = None
# python CSRbuilder supports right now sha1, sha256 sha512 # python CSRbuilder supports right now sha1, sha256 sha512
CERTIFICATE_HASH_ALGORITHM = "sha512" CERTIFICATE_HASH_ALGORITHM = "sha512"
@ -106,9 +107,12 @@ AUTHORITY_KEYTYPE = getenv_in("AUTHORITY_KEYTYPE", "rsa", "ec")
if AUTHORITY_KEYTYPE == "rsa": if AUTHORITY_KEYTYPE == "rsa":
KEY_SIZE = 4096 KEY_SIZE = 4096
# Keytype for web JS pki.js wants specific key type
KEY_TYPE_SPECIFIC = "RSASSA-PKCS1-v1_5"
if AUTHORITY_KEYTYPE == "ec": if AUTHORITY_KEYTYPE == "ec":
CURVE_NAME = "secp384r1" CURVE_NAME = "secp384r1"
KEY_TYPE_SPECIFIC = "ECDSA"
# Tokens # Tokens
TOKEN_URL = "https://%(authority_name)s/#action=enroll&title=dev.lan&token=%(token)s&subject=%(subject_username)s&protocols=%(protocols)s" TOKEN_URL = "https://%(authority_name)s/#action=enroll&title=dev.lan&token=%(token)s&subject=%(subject_username)s&protocols=%(protocols)s"