create algorithmIdentifier dynamically from OID database

This commit is contained in:
Martin Willi
2009-08-27 13:59:30 +02:00
parent c03b095ebe
commit eb73685dac
12 changed files with 28 additions and 167 deletions
@@ -232,7 +232,7 @@ static bool build_emsa_pkcs1_signature(private_gmp_rsa_private_key_t *this,
hasher->destroy(hasher);
/* build DER-encoded digestInfo */
digestInfo = asn1_wrap(ASN1_SEQUENCE, "cm",
digestInfo = asn1_wrap(ASN1_SEQUENCE, "mm",
asn1_algorithmIdentifier(hash_oid),
asn1_simple_object(ASN1_OCTET_STRING, hash)
);
+2 -2
View File
@@ -616,7 +616,7 @@ static chunk_t build_extensions(private_x509_ac_t *this)
*/
static chunk_t build_attr_cert_info(private_x509_ac_t *this)
{
return asn1_wrap(ASN1_SEQUENCE, "cmmcmmmm",
return asn1_wrap(ASN1_SEQUENCE, "cmmmmmmm",
ASN1_INTEGER_1,
build_holder(this),
build_v2_form(this),
@@ -641,7 +641,7 @@ static chunk_t build_ac(private_x509_ac_t *this)
this->signerKey->sign(this->signerKey, SIGN_RSA_EMSA_PKCS1_SHA1,
attributeCertificateInfo, &signatureValue);
return asn1_wrap(ASN1_SEQUENCE, "mcm",
return asn1_wrap(ASN1_SEQUENCE, "mmm",
attributeCertificateInfo,
asn1_algorithmIdentifier(OID_SHA1_WITH_RSA),
asn1_bitstring("m", signatureValue));
+3 -3
View File
@@ -1259,7 +1259,7 @@ static bool generate(private_builder_t *this)
{
return FALSE;
}
key_info = asn1_wrap(ASN1_SEQUENCE, "cm",
key_info = asn1_wrap(ASN1_SEQUENCE, "mm",
asn1_algorithmIdentifier(OID_RSA_ENCRYPTION),
asn1_bitstring("m", key));
break;
@@ -1272,7 +1272,7 @@ static bool generate(private_builder_t *this)
/* TODO: encode subjectAltNames */
}
this->cert->tbsCertificate = asn1_wrap(ASN1_SEQUENCE, "mmccmcmm",
this->cert->tbsCertificate = asn1_wrap(ASN1_SEQUENCE, "mmmcmcmm",
asn1_simple_object(ASN1_CONTEXT_C_0, ASN1_INTEGER_2),
asn1_integer("c", this->cert->serialNumber),
asn1_algorithmIdentifier(this->cert->algorithm),
@@ -1288,7 +1288,7 @@ static bool generate(private_builder_t *this)
{
return FALSE;
}
this->cert->encoding = asn1_wrap(ASN1_SEQUENCE, "ccm",
this->cert->encoding = asn1_wrap(ASN1_SEQUENCE, "cmm",
this->cert->tbsCertificate,
asn1_algorithmIdentifier(this->cert->algorithm),
asn1_bitstring("c", this->cert->signature));
@@ -133,7 +133,7 @@ static chunk_t build_Request(private_x509_ocsp_request_t *this,
chunk_t serialNumber)
{
return asn1_wrap(ASN1_SEQUENCE, "m",
asn1_wrap(ASN1_SEQUENCE, "cmmm",
asn1_wrap(ASN1_SEQUENCE, "mmmm",
asn1_algorithmIdentifier(OID_SHA1),
asn1_simple_object(ASN1_OCTET_STRING, issuerNameHash),
asn1_simple_object(ASN1_OCTET_STRING, issuerKeyHash),