c_allc.c revision 194206
1229997Sken/* crypto/evp/c_allc.c */ 2229997Sken/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3229997Sken * All rights reserved. 4229997Sken * 5229997Sken * This package is an SSL implementation written 6229997Sken * by Eric Young (eay@cryptsoft.com). 7229997Sken * The implementation was written so as to conform with Netscapes SSL. 8229997Sken * 9229997Sken * This library is free for commercial and non-commercial use as long as 10229997Sken * the following conditions are aheared to. The following conditions 11229997Sken * apply to all code found in this distribution, be it the RC4, RSA, 12229997Sken * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13229997Sken * included with this distribution is covered by the same copyright terms 14229997Sken * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15229997Sken * 16229997Sken * Copyright remains Eric Young's, and as such any Copyright notices in 17229997Sken * the code are not to be removed. 18229997Sken * If this package is used in a product, Eric Young should be given attribution 19229997Sken * as the author of the parts of the library used. 20229997Sken * This can be in the form of a textual message at program startup or 21229997Sken * in documentation (online or textual) provided with the package. 22229997Sken * 23229997Sken * Redistribution and use in source and binary forms, with or without 24229997Sken * modification, are permitted provided that the following conditions 25229997Sken * are met: 26229997Sken * 1. Redistributions of source code must retain the copyright 27229997Sken * notice, this list of conditions and the following disclaimer. 28229997Sken * 2. Redistributions in binary form must reproduce the above copyright 29229997Sken * notice, this list of conditions and the following disclaimer in the 30229997Sken * documentation and/or other materials provided with the distribution. 31229997Sken * 3. All advertising materials mentioning features or use of this software 32229997Sken * must display the following acknowledgement: 33229997Sken * "This product includes cryptographic software written by 34229997Sken * Eric Young (eay@cryptsoft.com)" 35229997Sken * The word 'cryptographic' can be left out if the rouines from the library 36229997Sken * being used are not cryptographic related :-). 37229997Sken * 4. If you include any Windows specific code (or a derivative thereof) from 38229997Sken * the apps directory (application code) you must include an acknowledgement: 39229997Sken * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40229997Sken * 41229997Sken * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42229997Sken * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43229997Sken * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44229997Sken * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45229997Sken * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46229997Sken * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47229997Sken * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48229997Sken * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49229997Sken * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50229997Sken * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51229997Sken * SUCH DAMAGE. 52229997Sken * 53229997Sken * The licence and distribution terms for any publically available version or 54229997Sken * derivative of this code cannot be changed. i.e. this code cannot simply be 55229997Sken * copied and put under another distribution licence 56229997Sken * [including the GNU Public Licence.] 57229997Sken */ 58229997Sken 59229997Sken#include <stdio.h> 60229997Sken#include "cryptlib.h" 61229997Sken#include <openssl/evp.h> 62229997Sken#include <openssl/pkcs12.h> 63229997Sken#include <openssl/objects.h> 64229997Sken 65229997Skenvoid OpenSSL_add_all_ciphers(void) 66229997Sken { 67229997Sken 68229997Sken#ifndef OPENSSL_NO_DES 69229997Sken EVP_add_cipher(EVP_des_cfb()); 70229997Sken EVP_add_cipher(EVP_des_cfb1()); 71229997Sken EVP_add_cipher(EVP_des_cfb8()); 72229997Sken EVP_add_cipher(EVP_des_ede_cfb()); 73229997Sken EVP_add_cipher(EVP_des_ede3_cfb()); 74229997Sken 75229997Sken EVP_add_cipher(EVP_des_ofb()); 76229997Sken EVP_add_cipher(EVP_des_ede_ofb()); 77229997Sken EVP_add_cipher(EVP_des_ede3_ofb()); 78229997Sken 79229997Sken EVP_add_cipher(EVP_desx_cbc()); 80229997Sken EVP_add_cipher_alias(SN_desx_cbc,"DESX"); 81229997Sken EVP_add_cipher_alias(SN_desx_cbc,"desx"); 82229997Sken 83229997Sken EVP_add_cipher(EVP_des_cbc()); 84229997Sken EVP_add_cipher_alias(SN_des_cbc,"DES"); 85229997Sken EVP_add_cipher_alias(SN_des_cbc,"des"); 86229997Sken EVP_add_cipher(EVP_des_ede_cbc()); 87229997Sken EVP_add_cipher(EVP_des_ede3_cbc()); 88229997Sken EVP_add_cipher_alias(SN_des_ede3_cbc,"DES3"); 89229997Sken EVP_add_cipher_alias(SN_des_ede3_cbc,"des3"); 90229997Sken 91229997Sken EVP_add_cipher(EVP_des_ecb()); 92229997Sken EVP_add_cipher(EVP_des_ede()); 93229997Sken EVP_add_cipher(EVP_des_ede3()); 94229997Sken#endif 95229997Sken 96229997Sken#ifndef OPENSSL_NO_RC4 97229997Sken EVP_add_cipher(EVP_rc4()); 98229997Sken EVP_add_cipher(EVP_rc4_40()); 99229997Sken#endif 100229997Sken 101229997Sken#ifndef OPENSSL_NO_IDEA 102229997Sken EVP_add_cipher(EVP_idea_ecb()); 103229997Sken EVP_add_cipher(EVP_idea_cfb()); 104229997Sken EVP_add_cipher(EVP_idea_ofb()); 105229997Sken EVP_add_cipher(EVP_idea_cbc()); 106229997Sken EVP_add_cipher_alias(SN_idea_cbc,"IDEA"); 107229997Sken EVP_add_cipher_alias(SN_idea_cbc,"idea"); 108229997Sken#endif 109229997Sken 110229997Sken#ifndef OPENSSL_NO_SEED 111229997Sken EVP_add_cipher(EVP_seed_ecb()); 112229997Sken EVP_add_cipher(EVP_seed_cfb()); 113229997Sken EVP_add_cipher(EVP_seed_ofb()); 114229997Sken EVP_add_cipher(EVP_seed_cbc()); 115229997Sken EVP_add_cipher_alias(SN_seed_cbc,"SEED"); 116229997Sken EVP_add_cipher_alias(SN_seed_cbc,"seed"); 117229997Sken#endif 118229997Sken 119229997Sken#ifndef OPENSSL_NO_RC2 120229997Sken EVP_add_cipher(EVP_rc2_ecb()); 121229997Sken EVP_add_cipher(EVP_rc2_cfb()); 122229997Sken EVP_add_cipher(EVP_rc2_ofb()); 123229997Sken EVP_add_cipher(EVP_rc2_cbc()); 124229997Sken EVP_add_cipher(EVP_rc2_40_cbc()); 125229997Sken EVP_add_cipher(EVP_rc2_64_cbc()); 126229997Sken EVP_add_cipher_alias(SN_rc2_cbc,"RC2"); 127229997Sken EVP_add_cipher_alias(SN_rc2_cbc,"rc2"); 128229997Sken#endif 129229997Sken 130229997Sken#ifndef OPENSSL_NO_BF 131229997Sken EVP_add_cipher(EVP_bf_ecb()); 132229997Sken EVP_add_cipher(EVP_bf_cfb()); 133229997Sken EVP_add_cipher(EVP_bf_ofb()); 134229997Sken EVP_add_cipher(EVP_bf_cbc()); 135229997Sken EVP_add_cipher_alias(SN_bf_cbc,"BF"); 136229997Sken EVP_add_cipher_alias(SN_bf_cbc,"bf"); 137229997Sken EVP_add_cipher_alias(SN_bf_cbc,"blowfish"); 138229997Sken#endif 139229997Sken 140229997Sken#ifndef OPENSSL_NO_CAST 141229997Sken EVP_add_cipher(EVP_cast5_ecb()); 142229997Sken EVP_add_cipher(EVP_cast5_cfb()); 143229997Sken EVP_add_cipher(EVP_cast5_ofb()); 144229997Sken EVP_add_cipher(EVP_cast5_cbc()); 145229997Sken EVP_add_cipher_alias(SN_cast5_cbc,"CAST"); 146229997Sken EVP_add_cipher_alias(SN_cast5_cbc,"cast"); 147229997Sken EVP_add_cipher_alias(SN_cast5_cbc,"CAST-cbc"); 148229997Sken EVP_add_cipher_alias(SN_cast5_cbc,"cast-cbc"); 149231772Sken#endif 150229997Sken 151229997Sken#ifndef OPENSSL_NO_RC5 152229997Sken EVP_add_cipher(EVP_rc5_32_12_16_ecb()); 153229997Sken EVP_add_cipher(EVP_rc5_32_12_16_cfb()); 154229997Sken EVP_add_cipher(EVP_rc5_32_12_16_ofb()); 155229997Sken EVP_add_cipher(EVP_rc5_32_12_16_cbc()); 156229997Sken EVP_add_cipher_alias(SN_rc5_cbc,"rc5"); 157229997Sken EVP_add_cipher_alias(SN_rc5_cbc,"RC5"); 158229997Sken#endif 159229997Sken 160229997Sken#ifndef OPENSSL_NO_AES 161229997Sken EVP_add_cipher(EVP_aes_128_ecb()); 162229997Sken EVP_add_cipher(EVP_aes_128_cbc()); 163229997Sken EVP_add_cipher(EVP_aes_128_cfb()); 164229997Sken EVP_add_cipher(EVP_aes_128_cfb1()); 165229997Sken EVP_add_cipher(EVP_aes_128_cfb8()); 166229997Sken EVP_add_cipher(EVP_aes_128_ofb()); 167229997Sken#if 0 168229997Sken EVP_add_cipher(EVP_aes_128_ctr()); 169229997Sken#endif 170229997Sken EVP_add_cipher_alias(SN_aes_128_cbc,"AES128"); 171229997Sken EVP_add_cipher_alias(SN_aes_128_cbc,"aes128"); 172229997Sken EVP_add_cipher(EVP_aes_192_ecb()); 173229997Sken EVP_add_cipher(EVP_aes_192_cbc()); 174229997Sken EVP_add_cipher(EVP_aes_192_cfb()); 175229997Sken EVP_add_cipher(EVP_aes_192_cfb1()); 176229997Sken EVP_add_cipher(EVP_aes_192_cfb8()); 177229997Sken EVP_add_cipher(EVP_aes_192_ofb()); 178229997Sken#if 0 179229997Sken EVP_add_cipher(EVP_aes_192_ctr()); 180229997Sken#endif 181229997Sken EVP_add_cipher_alias(SN_aes_192_cbc,"AES192"); 182229997Sken EVP_add_cipher_alias(SN_aes_192_cbc,"aes192"); 183229997Sken EVP_add_cipher(EVP_aes_256_ecb()); 184229997Sken EVP_add_cipher(EVP_aes_256_cbc()); 185229997Sken EVP_add_cipher(EVP_aes_256_cfb()); 186229997Sken EVP_add_cipher(EVP_aes_256_cfb1()); 187229997Sken EVP_add_cipher(EVP_aes_256_cfb8()); 188229997Sken EVP_add_cipher(EVP_aes_256_ofb()); 189229997Sken#if 0 190229997Sken EVP_add_cipher(EVP_aes_256_ctr()); 191229997Sken#endif 192229997Sken EVP_add_cipher_alias(SN_aes_256_cbc,"AES256"); 193229997Sken EVP_add_cipher_alias(SN_aes_256_cbc,"aes256"); 194229997Sken#endif 195229997Sken 196229997Sken#ifndef OPENSSL_NO_CAMELLIA 197229997Sken EVP_add_cipher(EVP_camellia_128_ecb()); 198229997Sken EVP_add_cipher(EVP_camellia_128_cbc()); 199229997Sken EVP_add_cipher(EVP_camellia_128_cfb()); 200229997Sken EVP_add_cipher(EVP_camellia_128_cfb1()); 201229997Sken EVP_add_cipher(EVP_camellia_128_cfb8()); 202229997Sken EVP_add_cipher(EVP_camellia_128_ofb()); 203229997Sken EVP_add_cipher_alias(SN_camellia_128_cbc,"CAMELLIA128"); 204229997Sken EVP_add_cipher_alias(SN_camellia_128_cbc,"camellia128"); 205229997Sken EVP_add_cipher(EVP_camellia_192_ecb()); 206229997Sken EVP_add_cipher(EVP_camellia_192_cbc()); 207229997Sken EVP_add_cipher(EVP_camellia_192_cfb()); 208229997Sken EVP_add_cipher(EVP_camellia_192_cfb1()); 209229997Sken EVP_add_cipher(EVP_camellia_192_cfb8()); 210229997Sken EVP_add_cipher(EVP_camellia_192_ofb()); 211229997Sken EVP_add_cipher_alias(SN_camellia_192_cbc,"CAMELLIA192"); 212229997Sken EVP_add_cipher_alias(SN_camellia_192_cbc,"camellia192"); 213229997Sken EVP_add_cipher(EVP_camellia_256_ecb()); 214229997Sken EVP_add_cipher(EVP_camellia_256_cbc()); 215229997Sken EVP_add_cipher(EVP_camellia_256_cfb()); 216229997Sken EVP_add_cipher(EVP_camellia_256_cfb1()); 217229997Sken EVP_add_cipher(EVP_camellia_256_cfb8()); 218229997Sken EVP_add_cipher(EVP_camellia_256_ofb()); 219229997Sken EVP_add_cipher_alias(SN_camellia_256_cbc,"CAMELLIA256"); 220229997Sken EVP_add_cipher_alias(SN_camellia_256_cbc,"camellia256"); 221229997Sken#endif 222229997Sken 223229997Sken PKCS12_PBE_add(); 224229997Sken PKCS5_PBE_add(); 225229997Sken } 226229997Sken