mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Add AES encrypted keys support for PKCS5 PBES2
Signed-off-by: Maciej Zwoliński <mac.zwolinski@gmail.com>
This commit is contained in:
committed by
Ryan Everett
parent
9b0c8164eb
commit
720c638717
@ -306,6 +306,9 @@
|
|||||||
MBEDTLS_OID_OIW_SECSIG_ALG "\x07" /**< desCBC OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 7 } */
|
MBEDTLS_OID_OIW_SECSIG_ALG "\x07" /**< desCBC OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 7 } */
|
||||||
#define MBEDTLS_OID_DES_EDE3_CBC MBEDTLS_OID_RSA_COMPANY "\x03\x07" /**< des-ede3-cbc OBJECT IDENTIFIER ::= { iso(1) member-body(2) -- us(840) rsadsi(113549) encryptionAlgorithm(3) 7 } */
|
#define MBEDTLS_OID_DES_EDE3_CBC MBEDTLS_OID_RSA_COMPANY "\x03\x07" /**< des-ede3-cbc OBJECT IDENTIFIER ::= { iso(1) member-body(2) -- us(840) rsadsi(113549) encryptionAlgorithm(3) 7 } */
|
||||||
#define MBEDTLS_OID_AES MBEDTLS_OID_NIST_ALG "\x01" /** aes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 1 } */
|
#define MBEDTLS_OID_AES MBEDTLS_OID_NIST_ALG "\x01" /** aes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 1 } */
|
||||||
|
#define MBEDTLS_OID_AES_128_CBC MBEDTLS_OID_AES "\x02" /** aes128-cbc-pad OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithms(4) aes(1) aes128-CBC-PAD(2) } */
|
||||||
|
#define MBEDTLS_OID_AES_192_CBC MBEDTLS_OID_AES "\x16" /** aes192-cbc-pad OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithms(4) aes(1) aes192-CBC-PAD(22) } */
|
||||||
|
#define MBEDTLS_OID_AES_256_CBC MBEDTLS_OID_AES "\x2a" /** aes256-cbc-pad OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithms(4) aes(1) aes256-CBC-PAD(42) } */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Key Wrapping algorithms
|
* Key Wrapping algorithms
|
||||||
|
@ -695,10 +695,22 @@ static const oid_cipher_alg_t oid_cipher_alg[] =
|
|||||||
OID_DESCRIPTOR(MBEDTLS_OID_DES_EDE3_CBC, "des-ede3-cbc", "DES-EDE3-CBC"),
|
OID_DESCRIPTOR(MBEDTLS_OID_DES_EDE3_CBC, "des-ede3-cbc", "DES-EDE3-CBC"),
|
||||||
MBEDTLS_CIPHER_DES_EDE3_CBC,
|
MBEDTLS_CIPHER_DES_EDE3_CBC,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
OID_DESCRIPTOR(MBEDTLS_OID_AES_128_CBC, "aes128-cbc", "AES128-CBC"),
|
||||||
|
MBEDTLS_CIPHER_AES_128_CBC,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
OID_DESCRIPTOR(MBEDTLS_OID_AES_192_CBC, "aes192-cbc", "AES192-CBC"),
|
||||||
|
MBEDTLS_CIPHER_AES_192_CBC,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
OID_DESCRIPTOR(MBEDTLS_OID_AES_256_CBC, "aes256-cbc", "AES256-CBC"),
|
||||||
|
MBEDTLS_CIPHER_AES_256_CBC,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
NULL_OID_DESCRIPTOR,
|
NULL_OID_DESCRIPTOR,
|
||||||
MBEDTLS_CIPHER_NONE,
|
MBEDTLS_CIPHER_NONE,
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
FN_OID_TYPED_FROM_ASN1(oid_cipher_alg_t, cipher_alg, oid_cipher_alg)
|
FN_OID_TYPED_FROM_ASN1(oid_cipher_alg_t, cipher_alg, oid_cipher_alg)
|
||||||
|
@ -459,7 +459,7 @@ int execute_tests(int argc, const char **argv)
|
|||||||
int ret;
|
int ret;
|
||||||
unsigned total_errors = 0, total_tests = 0, total_skipped = 0;
|
unsigned total_errors = 0, total_tests = 0, total_skipped = 0;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
char buf[5000];
|
char buf[10000];
|
||||||
char *params[50];
|
char *params[50];
|
||||||
/* Store for processed integer params. */
|
/* Store for processed integer params. */
|
||||||
mbedtls_test_argument_t int_params[50];
|
mbedtls_test_argument_t int_params[50];
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user