Added support for msSmartcardLogon EKU
This commit is contained in:
@@ -200,7 +200,7 @@
|
|||||||
0x04 "msEncryptingFileSystem"
|
0x04 "msEncryptingFileSystem"
|
||||||
0x14 "msEnrollmentInfrastructure"
|
0x14 "msEnrollmentInfrastructure"
|
||||||
0x02 "msCertificateTypeExtension"
|
0x02 "msCertificateTypeExtension"
|
||||||
0x02 "msSmartcardLogon"
|
0x02 "msSmartcardLogon" OID_MS_SMARTCARD_LOGON
|
||||||
0x03 "msUPN" OID_USER_PRINCIPAL_NAME
|
0x03 "msUPN" OID_USER_PRINCIPAL_NAME
|
||||||
0x15 "msCertSrvInfrastructure"
|
0x15 "msCertSrvInfrastructure"
|
||||||
0x07 "msCertTemplate"
|
0x07 "msCertTemplate"
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ enum x509_flag_t {
|
|||||||
X509_CRL_SIGN = (1<<7),
|
X509_CRL_SIGN = (1<<7),
|
||||||
/** cert has iKEIntermediate key usage */
|
/** cert has iKEIntermediate key usage */
|
||||||
X509_IKE_INTERMEDIATE = (1<<8),
|
X509_IKE_INTERMEDIATE = (1<<8),
|
||||||
|
/** cert has Microsoft Smartcard Logon usage */
|
||||||
|
X509_MS_SMARTCARD_LOGON = (1<<9),
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -758,6 +758,9 @@ static void parse_extendedKeyUsage(chunk_t blob, int level0,
|
|||||||
case OID_OCSP_SIGNING:
|
case OID_OCSP_SIGNING:
|
||||||
this->flags |= X509_OCSP_SIGNER;
|
this->flags |= X509_OCSP_SIGNER;
|
||||||
break;
|
break;
|
||||||
|
case OID_MS_SMARTCARD_LOGON:
|
||||||
|
this->flags |= X509_MS_SMARTCARD_LOGON;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2008,7 +2011,7 @@ static bool generate(private_x509_cert_t *cert, certificate_t *sign_cert,
|
|||||||
chunk_t subjectKeyIdentifier = chunk_empty, authKeyIdentifier = chunk_empty;
|
chunk_t subjectKeyIdentifier = chunk_empty, authKeyIdentifier = chunk_empty;
|
||||||
chunk_t crlDistributionPoints = chunk_empty, authorityInfoAccess = chunk_empty;
|
chunk_t crlDistributionPoints = chunk_empty, authorityInfoAccess = chunk_empty;
|
||||||
chunk_t policyConstraints = chunk_empty, inhibitAnyPolicy = chunk_empty;
|
chunk_t policyConstraints = chunk_empty, inhibitAnyPolicy = chunk_empty;
|
||||||
chunk_t ikeIntermediate = chunk_empty;
|
chunk_t ikeIntermediate = chunk_empty, msSmartcardLogon = chunk_empty;
|
||||||
identification_t *issuer, *subject;
|
identification_t *issuer, *subject;
|
||||||
chunk_t key_info;
|
chunk_t key_info;
|
||||||
signature_scheme_t scheme;
|
signature_scheme_t scheme;
|
||||||
@@ -2139,6 +2142,10 @@ static bool generate(private_x509_cert_t *cert, certificate_t *sign_cert,
|
|||||||
{
|
{
|
||||||
ocspSigning = asn1_build_known_oid(OID_OCSP_SIGNING);
|
ocspSigning = asn1_build_known_oid(OID_OCSP_SIGNING);
|
||||||
}
|
}
|
||||||
|
if (cert->flags & X509_MS_SMARTCARD_LOGON)
|
||||||
|
{
|
||||||
|
msSmartcardLogon = asn1_build_known_oid(OID_MS_SMARTCARD_LOGON);
|
||||||
|
}
|
||||||
|
|
||||||
if (serverAuth.ptr || clientAuth.ptr || ikeIntermediate.ptr ||
|
if (serverAuth.ptr || clientAuth.ptr || ikeIntermediate.ptr ||
|
||||||
ocspSigning.ptr)
|
ocspSigning.ptr)
|
||||||
@@ -2146,9 +2153,9 @@ static bool generate(private_x509_cert_t *cert, certificate_t *sign_cert,
|
|||||||
extendedKeyUsage = asn1_wrap(ASN1_SEQUENCE, "mm",
|
extendedKeyUsage = asn1_wrap(ASN1_SEQUENCE, "mm",
|
||||||
asn1_build_known_oid(OID_EXTENDED_KEY_USAGE),
|
asn1_build_known_oid(OID_EXTENDED_KEY_USAGE),
|
||||||
asn1_wrap(ASN1_OCTET_STRING, "m",
|
asn1_wrap(ASN1_OCTET_STRING, "m",
|
||||||
asn1_wrap(ASN1_SEQUENCE, "mmmm",
|
asn1_wrap(ASN1_SEQUENCE, "mmmmm",
|
||||||
serverAuth, clientAuth, ikeIntermediate,
|
serverAuth, clientAuth, ikeIntermediate,
|
||||||
ocspSigning)));
|
ocspSigning, msSmartcardLogon)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add subjectKeyIdentifier to CA and OCSP signer certificates */
|
/* add subjectKeyIdentifier to CA and OCSP signer certificates */
|
||||||
|
|||||||
@@ -251,6 +251,10 @@ static int issue()
|
|||||||
{
|
{
|
||||||
flags |= X509_OCSP_SIGNER;
|
flags |= X509_OCSP_SIGNER;
|
||||||
}
|
}
|
||||||
|
else if (streq(arg, "msSmartcardLogon"))
|
||||||
|
{
|
||||||
|
flags |= X509_MS_SMARTCARD_LOGON;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
case 'f':
|
case 'f':
|
||||||
if (!get_form(arg, &form, CRED_CERTIFICATE))
|
if (!get_form(arg, &form, CRED_CERTIFICATE))
|
||||||
@@ -549,7 +553,7 @@ static void __attribute__ ((constructor))reg()
|
|||||||
{"[--in file] [--type pub|pkcs10] --cakey file|--cakeyid hex",
|
{"[--in file] [--type pub|pkcs10] --cakey file|--cakeyid hex",
|
||||||
" --cacert file [--dn subject-dn] [--san subjectAltName]+",
|
" --cacert file [--dn subject-dn] [--san subjectAltName]+",
|
||||||
"[--lifetime days] [--serial hex] [--ca] [--pathlen len]",
|
"[--lifetime days] [--serial hex] [--ca] [--pathlen len]",
|
||||||
"[--flag serverAuth|clientAuth|crlSign|ocspSigning]+",
|
"[--flag serverAuth|clientAuth|crlSign|ocspSigning|msSmartcardLogon]+",
|
||||||
"[--crl uri [--crlissuer i]]+ [--ocsp uri]+ [--nc-permitted name]",
|
"[--crl uri [--crlissuer i]]+ [--ocsp uri]+ [--nc-permitted name]",
|
||||||
"[--nc-excluded name] [--policy-mapping issuer-oid:subject-oid]",
|
"[--nc-excluded name] [--policy-mapping issuer-oid:subject-oid]",
|
||||||
"[--policy-explicit len] [--policy-inhibit len] [--policy-any len]",
|
"[--policy-explicit len] [--policy-inhibit len] [--policy-any len]",
|
||||||
|
|||||||
@@ -140,6 +140,10 @@ static void print_x509(x509_t *x509)
|
|||||||
{
|
{
|
||||||
printf("iKEIntermediate ");
|
printf("iKEIntermediate ");
|
||||||
}
|
}
|
||||||
|
if (flags & X509_MS_SMARTCARD_LOGON)
|
||||||
|
{
|
||||||
|
printf("msSmartcardLogon ");
|
||||||
|
}
|
||||||
if (flags & X509_SELF_SIGNED)
|
if (flags & X509_SELF_SIGNED)
|
||||||
{
|
{
|
||||||
printf("self-signed ");
|
printf("self-signed ");
|
||||||
|
|||||||
@@ -235,6 +235,10 @@ static int self()
|
|||||||
{
|
{
|
||||||
flags |= X509_OCSP_SIGNER;
|
flags |= X509_OCSP_SIGNER;
|
||||||
}
|
}
|
||||||
|
else if (streq(arg, "msSmartcardLogon"))
|
||||||
|
{
|
||||||
|
flags |= X509_MS_SMARTCARD_LOGON;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
case 'f':
|
case 'f':
|
||||||
if (!get_form(arg, &form, CRED_CERTIFICATE))
|
if (!get_form(arg, &form, CRED_CERTIFICATE))
|
||||||
@@ -406,7 +410,7 @@ static void __attribute__ ((constructor))reg()
|
|||||||
{" [--in file|--keyid hex] [--type rsa|ecdsa]",
|
{" [--in file|--keyid hex] [--type rsa|ecdsa]",
|
||||||
" --dn distinguished-name [--san subjectAltName]+",
|
" --dn distinguished-name [--san subjectAltName]+",
|
||||||
"[--lifetime days] [--serial hex] [--ca] [--ocsp uri]+",
|
"[--lifetime days] [--serial hex] [--ca] [--ocsp uri]+",
|
||||||
"[--flag serverAuth|clientAuth|crlSign|ocspSigning]+",
|
"[--flag serverAuth|clientAuth|crlSign|ocspSigning|msSmartcardLogon]+",
|
||||||
"[--nc-permitted name] [--nc-excluded name]",
|
"[--nc-permitted name] [--nc-excluded name]",
|
||||||
"[--policy-map issuer-oid:subject-oid]",
|
"[--policy-map issuer-oid:subject-oid]",
|
||||||
"[--policy-explicit len] [--policy-inhibit len] [--policy-any len]",
|
"[--policy-explicit len] [--policy-inhibit len] [--policy-any len]",
|
||||||
|
|||||||
Reference in New Issue
Block a user