Removed chunk_from_buf() in favor of a simpler chunk_from_chars() macro
This commit is contained in:
@@ -84,66 +84,42 @@ struct private_pkcs7_t {
|
||||
/**
|
||||
* PKCS7 contentInfo OIDs
|
||||
*/
|
||||
static u_char ASN1_pkcs7_data_oid_str[] = {
|
||||
static chunk_t ASN1_pkcs7_data_oid = chunk_from_chars(
|
||||
0x06, 0x09,
|
||||
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01
|
||||
};
|
||||
|
||||
static u_char ASN1_pkcs7_signed_data_oid_str[] = {
|
||||
);
|
||||
static chunk_t ASN1_pkcs7_signed_data_oid = chunk_from_chars(
|
||||
0x06, 0x09,
|
||||
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x02
|
||||
};
|
||||
|
||||
static u_char ASN1_pkcs7_enveloped_data_oid_str[] = {
|
||||
);
|
||||
static chunk_t ASN1_pkcs7_enveloped_data_oid = chunk_from_chars(
|
||||
0x06, 0x09,
|
||||
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x03
|
||||
};
|
||||
|
||||
static u_char ASN1_pkcs7_signed_enveloped_data_oid_str[] = {
|
||||
);
|
||||
static chunk_t ASN1_pkcs7_signed_enveloped_data_oid = chunk_from_chars(
|
||||
0x06, 0x09,
|
||||
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x04
|
||||
};
|
||||
|
||||
static u_char ASN1_pkcs7_digested_data_oid_str[] = {
|
||||
);
|
||||
static chunk_t ASN1_pkcs7_digested_data_oid = chunk_from_chars(
|
||||
0x06, 0x09,
|
||||
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x05
|
||||
};
|
||||
|
||||
static char ASN1_pkcs7_encrypted_data_oid_str[] = {
|
||||
);
|
||||
static chunk_t ASN1_pkcs7_encrypted_data_oid = chunk_from_chars(
|
||||
0x06, 0x09,
|
||||
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x06
|
||||
};
|
||||
|
||||
static const chunk_t ASN1_pkcs7_data_oid =
|
||||
chunk_from_buf(ASN1_pkcs7_data_oid_str);
|
||||
static const chunk_t ASN1_pkcs7_signed_data_oid =
|
||||
chunk_from_buf(ASN1_pkcs7_signed_data_oid_str);
|
||||
static const chunk_t ASN1_pkcs7_enveloped_data_oid =
|
||||
chunk_from_buf(ASN1_pkcs7_enveloped_data_oid_str);
|
||||
static const chunk_t ASN1_pkcs7_signed_enveloped_data_oid =
|
||||
chunk_from_buf(ASN1_pkcs7_signed_enveloped_data_oid_str);
|
||||
static const chunk_t ASN1_pkcs7_digested_data_oid =
|
||||
chunk_from_buf(ASN1_pkcs7_digested_data_oid_str);
|
||||
static const chunk_t ASN1_pkcs7_encrypted_data_oid =
|
||||
chunk_from_buf(ASN1_pkcs7_encrypted_data_oid_str);
|
||||
);
|
||||
|
||||
/**
|
||||
* 3DES and DES encryption OIDs
|
||||
*/
|
||||
static u_char ASN1_3des_ede_cbc_oid_str[] = {
|
||||
static const chunk_t ASN1_3des_ede_cbc_oid = chunk_from_chars(
|
||||
0x06, 0x08,
|
||||
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x03, 0x07
|
||||
};
|
||||
|
||||
static u_char ASN1_des_cbc_oid_str[] = {
|
||||
);
|
||||
static const chunk_t ASN1_des_cbc_oid = chunk_from_chars(
|
||||
0x06, 0x05,
|
||||
0x2B, 0x0E, 0x03, 0x02, 0x07
|
||||
};
|
||||
|
||||
static const chunk_t ASN1_3des_ede_cbc_oid =
|
||||
chunk_from_buf(ASN1_3des_ede_cbc_oid_str);
|
||||
static const chunk_t ASN1_des_cbc_oid =
|
||||
chunk_from_buf(ASN1_des_cbc_oid_str);
|
||||
);
|
||||
|
||||
/**
|
||||
* Implements pkcs7_t.is_data.
|
||||
|
||||
@@ -78,48 +78,30 @@ struct attribute_t {
|
||||
/**
|
||||
* PKCS#9 attribute type OIDs
|
||||
*/
|
||||
static u_char ASN1_contentType_oid_str[] = {
|
||||
static chunk_t ASN1_contentType_oid = chunk_from_chars(
|
||||
0x06, 0x09,
|
||||
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x03
|
||||
};
|
||||
|
||||
static u_char ASN1_messageDigest_oid_str[] = {
|
||||
);
|
||||
static chunk_t ASN1_messageDigest_oid = chunk_from_chars(
|
||||
0x06, 0x09,
|
||||
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x04
|
||||
};
|
||||
|
||||
static u_char ASN1_signingTime_oid_str[] = {
|
||||
);
|
||||
static chunk_t ASN1_signingTime_oid = chunk_from_chars(
|
||||
0x06, 0x09,
|
||||
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x05
|
||||
};
|
||||
|
||||
static char ASN1_messageType_oid_str[] = {
|
||||
);
|
||||
static chunk_t ASN1_messageType_oid = chunk_from_chars(
|
||||
0x06, 0x0A,
|
||||
0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01, 0x09, 0x02
|
||||
};
|
||||
|
||||
static char ASN1_senderNonce_oid_str[] = {
|
||||
);
|
||||
static chunk_t ASN1_senderNonce_oid = chunk_from_chars(
|
||||
0x06, 0x0A,
|
||||
0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01, 0x09, 0x05
|
||||
};
|
||||
|
||||
static char ASN1_transId_oid_str[] = {
|
||||
);
|
||||
static chunk_t ASN1_transId_oid = chunk_from_chars(
|
||||
0x06, 0x0A,
|
||||
0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01, 0x09, 0x07
|
||||
};
|
||||
|
||||
static const chunk_t ASN1_contentType_oid =
|
||||
chunk_from_buf(ASN1_contentType_oid_str);
|
||||
static const chunk_t ASN1_messageDigest_oid =
|
||||
chunk_from_buf(ASN1_messageDigest_oid_str);
|
||||
static const chunk_t ASN1_signingTime_oid =
|
||||
chunk_from_buf(ASN1_signingTime_oid_str);
|
||||
static const chunk_t ASN1_messageType_oid =
|
||||
chunk_from_buf(ASN1_messageType_oid_str);
|
||||
static const chunk_t ASN1_senderNonce_oid =
|
||||
chunk_from_buf(ASN1_senderNonce_oid_str);
|
||||
static const chunk_t ASN1_transId_oid =
|
||||
chunk_from_buf(ASN1_transId_oid_str);
|
||||
);
|
||||
|
||||
/**
|
||||
* return the ASN.1 encoded OID of a PKCS#9 attribute
|
||||
|
||||
Reference in New Issue
Block a user