diff options
author | Matt Braithwaite <mab@google.com> | 2015-06-17 23:15:10 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-06-19 02:04:46 +0300 |
commit | 979c87add8379def784d675f1e8ba929225b9e06 (patch) | |
tree | 7f90e4b6cd31e9dbbe685bd29fe8c3320078b227 /crypto/pem | |
parent | 7244fa46f72985b3abc0354e075e883c15ac57a3 (diff) |
pem_lib: make |cipher_by_name| recognize some more ciphers.
Change-Id: I3130eec5d902ad22d1af185556955ff806b05097
Reviewed-on: https://boringssl-review.googlesource.com/5150
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/pem')
-rw-r--r-- | crypto/pem/pem_lib.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 52014671..5ce5fc43 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -437,11 +437,18 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, } static const EVP_CIPHER* cipher_by_name(const char *name) { - if (strcmp(name, "DES-CBC") == 0) { + /* This is similar to the (deprecated) function |EVP_get_cipherbyname|. */ + if (0 == strcmp(name, SN_rc4)) { + return EVP_rc4(); + } else if (0 == strcmp(name, SN_des_cbc)) { return EVP_des_cbc(); - } else if (strcmp(name, "AES-128-CBC") == 0) { + } else if (0 == strcmp(name, SN_des_ede3_cbc)) { + return EVP_des_ede3_cbc(); + } else if (0 == strcmp(name, SN_aes_128_cbc)) { return EVP_aes_128_cbc(); - } else if (strcmp(name, "AES-256-CBC") == 0) { + } else if (0 == strcmp(name, SN_aes_192_cbc)) { + return EVP_aes_192_cbc(); + } else if (0 == strcmp(name, SN_aes_256_cbc)) { return EVP_aes_256_cbc(); } else { return NULL; |