Updated code to work around a Cryptography library change

This commit is contained in:
Ross Scroggs
2024-07-22 08:37:33 -07:00
parent 19304f95e8
commit f777ec177c
5 changed files with 18 additions and 10 deletions

View File

@@ -1,3 +1,7 @@
6.79.00
Updated code to work around a Cryptography library change that caused service account private key creation to fail.
7.00.00
Merged GAM-Team version

View File

@@ -12348,8 +12348,8 @@ def _generatePrivateKeyAndPublicCert(projectId, clientEmail, name, key_size, b64
writeStdout(Msg.EXTRACTING_PUBLIC_CERTIFICATE+'\n')
public_key = private_key.public_key()
builder = x509.CertificateBuilder()
builder = builder.subject_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, name)]))
builder = builder.issuer_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, name)]))
builder = builder.subject_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, name, _validate=False)]))
builder = builder.issuer_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, name, _validate=False)]))
# Gooogle seems to enforce the not before date strictly. Set the not before
# date to be UTC two minutes ago which should cover any clock skew.
now = datetime.datetime.utcnow()