1# $FreeBSD$ 2 3LIB= asn1 4INCS= asn1_err.h heim_asn1.h 5 6SRCS= asn1_err.c \ 7 asn1_err.h \ 8 der_copy.c \ 9 der_cmp.c \ 10 der_free.c \ 11 der_format.c \ 12 der_get.c \ 13 der_length.c \ 14 der_put.c \ 15 extra.c \ 16 timegm.c \ 17 ${GEN:S/.x$/.c/} 18 19CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken -I. 20 21GEN_RFC2459 = \ 22 asn1_Version.x \ 23 asn1_id_pkcs_1.x \ 24 asn1_id_pkcs1_rsaEncryption.x \ 25 asn1_id_pkcs1_md2WithRSAEncryption.x \ 26 asn1_id_pkcs1_md5WithRSAEncryption.x \ 27 asn1_id_pkcs1_sha1WithRSAEncryption.x \ 28 asn1_id_pkcs1_sha256WithRSAEncryption.x \ 29 asn1_id_pkcs1_sha384WithRSAEncryption.x \ 30 asn1_id_pkcs1_sha512WithRSAEncryption.x \ 31 asn1_id_heim_rsa_pkcs1_x509.x \ 32 asn1_id_pkcs_2.x \ 33 asn1_id_pkcs2_md2.x \ 34 asn1_id_pkcs2_md4.x \ 35 asn1_id_pkcs2_md5.x \ 36 asn1_id_rsa_digestAlgorithm.x \ 37 asn1_id_rsa_digest_md2.x \ 38 asn1_id_rsa_digest_md4.x \ 39 asn1_id_rsa_digest_md5.x \ 40 asn1_id_pkcs_3.x \ 41 asn1_id_pkcs3_rc2_cbc.x \ 42 asn1_id_pkcs3_rc4.x \ 43 asn1_id_pkcs3_des_ede3_cbc.x \ 44 asn1_id_rsadsi_encalg.x \ 45 asn1_id_rsadsi_rc2_cbc.x \ 46 asn1_id_rsadsi_des_ede3_cbc.x \ 47 asn1_id_secsig_sha_1.x \ 48 asn1_id_nistAlgorithm.x \ 49 asn1_id_nist_aes_algs.x \ 50 asn1_id_aes_128_cbc.x \ 51 asn1_id_aes_192_cbc.x \ 52 asn1_id_aes_256_cbc.x \ 53 asn1_id_nist_sha_algs.x \ 54 asn1_id_sha256.x \ 55 asn1_id_sha224.x \ 56 asn1_id_sha384.x \ 57 asn1_id_sha512.x \ 58 asn1_id_dhpublicnumber.x \ 59 asn1_id_x9_57.x \ 60 asn1_id_dsa.x \ 61 asn1_id_dsa_with_sha1.x \ 62 asn1_id_x520_at.x \ 63 asn1_id_at_commonName.x \ 64 asn1_id_at_surname.x \ 65 asn1_id_at_serialNumber.x \ 66 asn1_id_at_countryName.x \ 67 asn1_id_at_localityName.x \ 68 asn1_id_at_streetAddress.x \ 69 asn1_id_at_stateOrProvinceName.x \ 70 asn1_id_at_organizationName.x \ 71 asn1_id_at_organizationalUnitName.x \ 72 asn1_id_at_name.x \ 73 asn1_id_at_givenName.x \ 74 asn1_id_at_initials.x \ 75 asn1_id_at_generationQualifier.x \ 76 asn1_id_at_pseudonym.x \ 77 asn1_id_Userid.x \ 78 asn1_id_domainComponent.x \ 79 asn1_id_x509_ce.x \ 80 asn1_id_uspkicommon_card_id.x \ 81 asn1_id_uspkicommon_piv_interim.x \ 82 asn1_id_netscape.x \ 83 asn1_id_netscape_cert_comment.x \ 84 asn1_id_ms_cert_enroll_domaincontroller.x \ 85 asn1_id_ms_client_authentication.x \ 86 asn1_AlgorithmIdentifier.x \ 87 asn1_AttributeType.x \ 88 asn1_AttributeValue.x \ 89 asn1_TeletexStringx.x \ 90 asn1_DirectoryString.x \ 91 asn1_Attribute.x \ 92 asn1_AttributeTypeAndValue.x \ 93 asn1_AuthorityInfoAccessSyntax.x \ 94 asn1_AccessDescription.x \ 95 asn1_RelativeDistinguishedName.x \ 96 asn1_RDNSequence.x \ 97 asn1_Name.x \ 98 asn1_CertificateSerialNumber.x \ 99 asn1_Time.x \ 100 asn1_Validity.x \ 101 asn1_UniqueIdentifier.x \ 102 asn1_SubjectPublicKeyInfo.x \ 103 asn1_Extension.x \ 104 asn1_Extensions.x \ 105 asn1_TBSCertificate.x \ 106 asn1_Certificate.x \ 107 asn1_Certificates.x \ 108 asn1_ValidationParms.x \ 109 asn1_DomainParameters.x \ 110 asn1_DHPublicKey.x \ 111 asn1_OtherName.x \ 112 asn1_GeneralName.x \ 113 asn1_GeneralNames.x \ 114 asn1_id_x509_ce_keyUsage.x \ 115 asn1_KeyUsage.x \ 116 asn1_id_x509_ce_authorityKeyIdentifier.x \ 117 asn1_KeyIdentifier.x \ 118 asn1_AuthorityKeyIdentifier.x \ 119 asn1_id_x509_ce_subjectKeyIdentifier.x \ 120 asn1_SubjectKeyIdentifier.x \ 121 asn1_id_x509_ce_basicConstraints.x \ 122 asn1_BasicConstraints.x \ 123 asn1_id_x509_ce_nameConstraints.x \ 124 asn1_BaseDistance.x \ 125 asn1_GeneralSubtree.x \ 126 asn1_GeneralSubtrees.x \ 127 asn1_NameConstraints.x \ 128 asn1_id_x509_ce_privateKeyUsagePeriod.x \ 129 asn1_id_x509_ce_certificatePolicies.x \ 130 asn1_id_x509_ce_policyMappings.x \ 131 asn1_id_x509_ce_subjectAltName.x \ 132 asn1_id_x509_ce_issuerAltName.x \ 133 asn1_id_x509_ce_subjectDirectoryAttributes.x \ 134 asn1_id_x509_ce_policyConstraints.x \ 135 asn1_id_x509_ce_extKeyUsage.x \ 136 asn1_ExtKeyUsage.x \ 137 asn1_id_x509_ce_cRLDistributionPoints.x \ 138 asn1_id_x509_ce_deltaCRLIndicator.x \ 139 asn1_id_x509_ce_issuingDistributionPoint.x \ 140 asn1_id_x509_ce_holdInstructionCode.x \ 141 asn1_id_x509_ce_invalidityDate.x \ 142 asn1_id_x509_ce_certificateIssuer.x \ 143 asn1_id_x509_ce_inhibitAnyPolicy.x \ 144 asn1_DistributionPointReasonFlags.x \ 145 asn1_DistributionPointName.x \ 146 asn1_DistributionPoint.x \ 147 asn1_CRLDistributionPoints.x \ 148 asn1_DSASigValue.x \ 149 asn1_DSAPublicKey.x \ 150 asn1_DSAParams.x \ 151 asn1_RSAPublicKey.x \ 152 asn1_RSAPrivateKey.x \ 153 asn1_DigestInfo.x \ 154 asn1_TBSCRLCertList.x \ 155 asn1_CRLCertificateList.x \ 156 asn1_id_x509_ce_cRLNumber.x \ 157 asn1_id_x509_ce_freshestCRL.x \ 158 asn1_id_x509_ce_cRLReason.x \ 159 asn1_CRLReason.x \ 160 asn1_PKIXXmppAddr.x \ 161 asn1_id_pkix.x \ 162 asn1_id_pkix_on.x \ 163 asn1_id_pkix_on_dnsSRV.x \ 164 asn1_id_pkix_on_xmppAddr.x \ 165 asn1_id_pkix_kp.x \ 166 asn1_id_pkix_kp_serverAuth.x \ 167 asn1_id_pkix_kp_clientAuth.x \ 168 asn1_id_pkix_kp_emailProtection.x \ 169 asn1_id_pkix_kp_timeStamping.x \ 170 asn1_id_pkix_kp_OCSPSigning.x \ 171 asn1_id_pkix_pe.x \ 172 asn1_id_pkix_pe_authorityInfoAccess.x \ 173 asn1_id_pkix_pe_proxyCertInfo.x \ 174 asn1_id_pkix_ppl.x \ 175 asn1_id_pkix_ppl_anyLanguage.x \ 176 asn1_id_pkix_ppl_inheritAll.x \ 177 asn1_id_pkix_ppl_independent.x \ 178 asn1_ProxyPolicy.x \ 179 asn1_ProxyCertInfo.x 180 181GEN_CMS = \ 182 asn1_CMSAttributes.x \ 183 asn1_CMSCBCParameter.x \ 184 asn1_CMSEncryptedData.x \ 185 asn1_CMSIdentifier.x \ 186 asn1_CMSRC2CBCParameter.x \ 187 asn1_CMSVersion.x \ 188 asn1_CertificateList.x \ 189 asn1_CertificateRevocationLists.x \ 190 asn1_CertificateSet.x \ 191 asn1_ContentEncryptionAlgorithmIdentifier.x \ 192 asn1_ContentInfo.x \ 193 asn1_ContentType.x \ 194 asn1_DigestAlgorithmIdentifier.x \ 195 asn1_DigestAlgorithmIdentifiers.x \ 196 asn1_EncapsulatedContentInfo.x \ 197 asn1_EncryptedContent.x \ 198 asn1_EncryptedContentInfo.x \ 199 asn1_EncryptedKey.x \ 200 asn1_EnvelopedData.x \ 201 asn1_IssuerAndSerialNumber.x \ 202 asn1_KeyEncryptionAlgorithmIdentifier.x \ 203 asn1_KeyTransRecipientInfo.x \ 204 asn1_MessageDigest.x \ 205 asn1_OriginatorInfo.x \ 206 asn1_RecipientIdentifier.x \ 207 asn1_RecipientInfo.x \ 208 asn1_RecipientInfos.x \ 209 asn1_SignatureAlgorithmIdentifier.x \ 210 asn1_SignatureValue.x \ 211 asn1_SignedData.x \ 212 asn1_SignerIdentifier.x \ 213 asn1_SignerInfo.x \ 214 asn1_SignerInfos.x \ 215 asn1_id_pkcs7.x \ 216 asn1_id_pkcs7_data.x \ 217 asn1_id_pkcs7_digestedData.x \ 218 asn1_id_pkcs7_encryptedData.x \ 219 asn1_id_pkcs7_envelopedData.x \ 220 asn1_id_pkcs7_signedAndEnvelopedData.x \ 221 asn1_id_pkcs7_signedData.x \ 222 asn1_UnprotectedAttributes.x 223 224GEN_K5= asn1_AD_AND_OR.x \ 225 asn1_AD_IF_RELEVANT.x \ 226 asn1_AD_KDCIssued.x \ 227 asn1_AD_MANDATORY_FOR_KDC.x \ 228 asn1_AD_LoginAlias.x \ 229 asn1_APOptions.x \ 230 asn1_AP_REP.x \ 231 asn1_AP_REQ.x \ 232 asn1_AS_REP.x \ 233 asn1_AS_REQ.x \ 234 asn1_AUTHDATA_TYPE.x \ 235 asn1_Authenticator.x \ 236 asn1_AuthorizationData.x \ 237 asn1_AuthorizationDataElement.x \ 238 asn1_CKSUMTYPE.x \ 239 asn1_ChangePasswdDataMS.x \ 240 asn1_Checksum.x \ 241 asn1_ENCTYPE.x \ 242 asn1_ETYPE_INFO.x \ 243 asn1_ETYPE_INFO2.x \ 244 asn1_ETYPE_INFO2_ENTRY.x \ 245 asn1_ETYPE_INFO_ENTRY.x \ 246 asn1_EncAPRepPart.x \ 247 asn1_EncASRepPart.x \ 248 asn1_EncKDCRepPart.x \ 249 asn1_EncKrbCredPart.x \ 250 asn1_EncKrbPrivPart.x \ 251 asn1_EncTGSRepPart.x \ 252 asn1_EncTicketPart.x \ 253 asn1_EncryptedData.x \ 254 asn1_EncryptionKey.x \ 255 asn1_EtypeList.x \ 256 asn1_HostAddress.x \ 257 asn1_HostAddresses.x \ 258 asn1_KDCOptions.x \ 259 asn1_KDC_REP.x \ 260 asn1_KDC_REQ.x \ 261 asn1_KDC_REQ_BODY.x \ 262 asn1_KRB_CRED.x \ 263 asn1_KRB_ERROR.x \ 264 asn1_KRB_PRIV.x \ 265 asn1_KRB_SAFE.x \ 266 asn1_KRB_SAFE_BODY.x \ 267 asn1_KerberosString.x \ 268 asn1_KerberosTime.x \ 269 asn1_KrbCredInfo.x \ 270 asn1_LR_TYPE.x \ 271 asn1_LastReq.x \ 272 asn1_MESSAGE_TYPE.x \ 273 asn1_METHOD_DATA.x \ 274 asn1_NAME_TYPE.x \ 275 asn1_PADATA_TYPE.x \ 276 asn1_PA_DATA.x \ 277 asn1_PA_ENC_SAM_RESPONSE_ENC.x \ 278 asn1_PA_ENC_TS_ENC.x \ 279 asn1_PA_PAC_REQUEST.x \ 280 asn1_PA_S4U2Self.x \ 281 asn1_PA_SAM_CHALLENGE_2.x \ 282 asn1_PA_SAM_CHALLENGE_2_BODY.x \ 283 asn1_PA_SAM_REDIRECT.x \ 284 asn1_PA_SAM_RESPONSE_2.x \ 285 asn1_PA_SAM_TYPE.x \ 286 asn1_PA_ClientCanonicalized.x \ 287 asn1_PA_ClientCanonicalizedNames.x \ 288 asn1_PA_SvrReferralData.x \ 289 asn1_PROV_SRV_LOCATION.x \ 290 asn1_Principal.x \ 291 asn1_PrincipalName.x \ 292 asn1_Realm.x \ 293 asn1_SAMFlags.x \ 294 asn1_TGS_REP.x \ 295 asn1_TGS_REQ.x \ 296 asn1_TYPED_DATA.x \ 297 asn1_Ticket.x \ 298 asn1_TicketFlags.x \ 299 asn1_TransitedEncoding.x \ 300 asn1_TypedData.x \ 301 asn1_krb5int32.x \ 302 asn1_krb5uint32.x \ 303 asn1_KRB5SignedPathData.x \ 304 asn1_KRB5SignedPathPrincipals.x \ 305 asn1_KRB5SignedPath.x 306 307GEN_PKINIT = \ 308 asn1_id_pkinit.x \ 309 asn1_id_pkauthdata.x \ 310 asn1_id_pkdhkeydata.x \ 311 asn1_id_pkrkeydata.x \ 312 asn1_id_pkekuoid.x \ 313 asn1_id_pkkdcekuoid.x \ 314 asn1_id_pkinit_san.x \ 315 asn1_id_pkinit_ms_eku.x \ 316 asn1_id_pkinit_ms_san.x \ 317 asn1_MS_UPN_SAN.x \ 318 asn1_DHNonce.x \ 319 asn1_KDFAlgorithmId.x \ 320 asn1_TrustedCA.x \ 321 asn1_ExternalPrincipalIdentifier.x \ 322 asn1_ExternalPrincipalIdentifiers.x \ 323 asn1_PA_PK_AS_REQ.x \ 324 asn1_PKAuthenticator.x \ 325 asn1_AuthPack.x \ 326 asn1_TD_TRUSTED_CERTIFIERS.x \ 327 asn1_TD_INVALID_CERTIFICATES.x \ 328 asn1_KRB5PrincipalName.x \ 329 asn1_AD_INITIAL_VERIFIED_CAS.x \ 330 asn1_DHRepInfo.x \ 331 asn1_PA_PK_AS_REP.x \ 332 asn1_KDCDHKeyInfo.x \ 333 asn1_ReplyKeyPack.x \ 334 asn1_TD_DH_PARAMETERS.x \ 335 asn1_PKAuthenticator_Win2k.x \ 336 asn1_AuthPack_Win2k.x \ 337 asn1_TrustedCA_Win2k.x \ 338 asn1_PA_PK_AS_REQ_Win2k.x \ 339 asn1_PA_PK_AS_REP_Win2k.x \ 340 asn1_KDCDHKeyInfo_Win2k.x \ 341 asn1_ReplyKeyPack_Win2k.x \ 342 asn1_PkinitSuppPubInfo.x 343 344GEN_PKCS8 = \ 345 asn1_PKCS8PrivateKeyAlgorithmIdentifier.x \ 346 asn1_PKCS8PrivateKey.x \ 347 asn1_PKCS8PrivateKeyInfo.x \ 348 asn1_PKCS8Attributes.x \ 349 asn1_PKCS8EncryptedPrivateKeyInfo.x \ 350 asn1_PKCS8EncryptedData.x 351 352GEN_PKCS9 = \ 353 asn1_id_pkcs_9.x \ 354 asn1_id_pkcs9_contentType.x \ 355 asn1_id_pkcs9_emailAddress.x \ 356 asn1_id_pkcs9_messageDigest.x \ 357 asn1_id_pkcs9_signingTime.x \ 358 asn1_id_pkcs9_countersignature.x \ 359 asn1_id_pkcs_9_at_friendlyName.x \ 360 asn1_id_pkcs_9_at_localKeyId.x \ 361 asn1_id_pkcs_9_at_certTypes.x \ 362 asn1_id_pkcs_9_at_certTypes_x509.x \ 363 asn1_PKCS9_BMPString.x \ 364 asn1_PKCS9_friendlyName.x 365 366GEN_PKCS12 = \ 367 asn1_id_pkcs_12.x \ 368 asn1_id_pkcs_12PbeIds.x \ 369 asn1_id_pbeWithSHAAnd128BitRC4.x \ 370 asn1_id_pbeWithSHAAnd40BitRC4.x \ 371 asn1_id_pbeWithSHAAnd3_KeyTripleDES_CBC.x \ 372 asn1_id_pbeWithSHAAnd2_KeyTripleDES_CBC.x \ 373 asn1_id_pbeWithSHAAnd128BitRC2_CBC.x \ 374 asn1_id_pbewithSHAAnd40BitRC2_CBC.x \ 375 asn1_id_pkcs12_bagtypes.x \ 376 asn1_id_pkcs12_keyBag.x \ 377 asn1_id_pkcs12_pkcs8ShroudedKeyBag.x \ 378 asn1_id_pkcs12_certBag.x \ 379 asn1_id_pkcs12_crlBag.x \ 380 asn1_id_pkcs12_secretBag.x \ 381 asn1_id_pkcs12_safeContentsBag.x \ 382 asn1_PKCS12_MacData.x \ 383 asn1_PKCS12_PFX.x \ 384 asn1_PKCS12_AuthenticatedSafe.x \ 385 asn1_PKCS12_CertBag.x \ 386 asn1_PKCS12_Attribute.x \ 387 asn1_PKCS12_Attributes.x \ 388 asn1_PKCS12_SafeBag.x \ 389 asn1_PKCS12_SafeContents.x \ 390 asn1_PKCS12_OctetString.x \ 391 asn1_PKCS12_PBEParams.x 392 393GEN_DIGEST= asn1_DigestError.x \ 394 asn1_DigestInit.x \ 395 asn1_DigestInitReply.x \ 396 asn1_DigestREP.x \ 397 asn1_DigestREQ.x \ 398 asn1_DigestRepInner.x \ 399 asn1_DigestReqInner.x \ 400 asn1_DigestRequest.x \ 401 asn1_DigestResponse.x \ 402 asn1_DigestTypes.x \ 403 asn1_NTLMInit.x \ 404 asn1_NTLMInitReply.x \ 405 asn1_NTLMRequest.x \ 406 asn1_NTLMResponse.x 407 408GEN_KX509 = \ 409 asn1_Kx509Response.x \ 410 asn1_Kx509Request.x 411 412GEN+= ${GEN_RFC2459} 413GEN+= ${GEN_CMS} 414GEN+= ${GEN_K5} 415GEN+= ${GEN_PKINIT} 416GEN+= ${GEN_PKCS8} 417GEN+= ${GEN_PKCS9} 418GEN+= ${GEN_PKCS12} 419GEN+= ${GEN_DIGEST} 420GEN+= ${GEN_KX509} 421 422CLEANFILES= ${GEN} ${GEN:S/.x$/.c/} *_asn1_files 423 424GEN_ASN1=cms_asn1.h rfc2459_asn1.h krb5_asn1.h pkinit_asn1.h 425GEN_ASN1+=pkcs8_asn1.h pkcs9_asn1.h pkcs12_asn1.h digest_asn1.h kx509_asn1.h 426SRCS+= ${GEN_ASN1} 427INCS+= ${GEN_ASN1} 428CLEANFILES+=${GEN_ASN1} 429 430.ORDER: ${GEN} ${GEN_ASN1} 431 432${GEN_CMS} cms_asn1.h: CMS.asn1 ../../tools/asn1_compile/asn1_compile 433 ../../tools/asn1_compile/asn1_compile ${.ALLSRC:M*.asn1} cms_asn1 434 435${GEN_RFC2459} rfc2459_asn1.h: rfc2459.asn1 ../../tools/asn1_compile/asn1_compile 436 ../../tools/asn1_compile/asn1_compile \ 437 --preserve-binary=TBSCertificate \ 438 --preserve-binary=TBSCRLCertList \ 439 --preserve-binary=Name \ 440 --sequence=GeneralNames \ 441 --sequence=Extensions \ 442 --sequence=CRLDistributionPoints ${.ALLSRC:M*.asn1} rfc2459_asn1 443 444${GEN_K5} krb5_asn1.h: k5.asn1 ../../tools/asn1_compile/asn1_compile 445 ../../tools/asn1_compile/asn1_compile \ 446 --encode-rfc1510-bit-string \ 447 --sequence=KRB5SignedPathPrincipals \ 448 --sequence=AuthorizationData \ 449 --sequence=METHOD-DATA \ 450 --sequence=ETYPE-INFO \ 451 --sequence=ETYPE-INFO2 ${.ALLSRC:M*.asn1} krb5_asn1 452 453${GEN_PKINIT} pkinit_asn1.h: pkinit.asn1 ../../tools/asn1_compile/asn1_compile 454 ../../tools/asn1_compile/asn1_compile ${.ALLSRC:M*.asn1} pkinit_asn1 455 456${GEN_PKCS8} pkcs8_asn1.h: pkcs8.asn1 ../../tools/asn1_compile/asn1_compile 457 ../../tools/asn1_compile/asn1_compile ${.ALLSRC:M*.asn1} pkcs8_asn1 458 459${GEN_PKCS9} pkcs9_asn1.h: pkcs9.asn1 ../../tools/asn1_compile/asn1_compile 460 ../../tools/asn1_compile/asn1_compile ${.ALLSRC:M*.asn1} pkcs9_asn1 461 462${GEN_PKCS12} pkcs12_asn1.h: pkcs12.asn1 ../../tools/asn1_compile/asn1_compile 463 ../../tools/asn1_compile/asn1_compile ${.ALLSRC:M*.asn1} pkcs12_asn1 464 465${GEN_DIGEST} digest_asn1.h: digest.asn1 ../../tools/asn1_compile/asn1_compile 466 ../../tools/asn1_compile/asn1_compile ${.ALLSRC:M*.asn1} digest_asn1 467 468${GEN_KX509} kx509_asn1.h: kx509.asn1 ../../tools/asn1_compile/asn1_compile 469 ../../tools/asn1_compile/asn1_compile ${.ALLSRC:M*.asn1} kx509_asn1 470 471../../tools/asn1_compile/asn1_compile: 472 cd ${.CURDIR}/../../tools/asn1_compile && ${MAKE} 473 474.for I in ${GEN} 475${I:R}.c: ${I} 476 cat ${.ALLSRC} > ${.TARGET} 477.endfor 478 479.include <bsd.lib.mk> 480 481.PATH: ${KRB5DIR}/lib/asn1 482