diff options
Diffstat (limited to 'src/engine/core_engine')
-rw-r--r-- | src/engine/core_engine/core_engine.h | 4 | ||||
-rw-r--r-- | src/engine/core_engine/core_modes.cpp | 14 | ||||
-rw-r--r-- | src/engine/core_engine/def_pk_ops.cpp | 10 | ||||
-rw-r--r-- | src/engine/core_engine/lookup_block.cpp | 12 | ||||
-rw-r--r-- | src/engine/core_engine/lookup_hash.cpp | 4 | ||||
-rw-r--r-- | src/engine/core_engine/lookup_mac.cpp | 2 | ||||
-rw-r--r-- | src/engine/core_engine/lookup_pbkdf.cpp | 2 | ||||
-rw-r--r-- | src/engine/core_engine/lookup_stream.cpp | 2 |
8 files changed, 27 insertions, 23 deletions
diff --git a/src/engine/core_engine/core_engine.h b/src/engine/core_engine/core_engine.h index 5386991c3..983b75290 100644 --- a/src/engine/core_engine/core_engine.h +++ b/src/engine/core_engine/core_engine.h @@ -44,10 +44,10 @@ class Core_Engine : public Engine StreamCipher* find_stream_cipher(const SCAN_Name&, Algorithm_Factory&) const; - HashFunction* find_hash(const SCAN_Name& reqeust, + HashFunction* find_hash(const SCAN_Name& request, Algorithm_Factory&) const; - MessageAuthenticationCode* find_mac(const SCAN_Name& reqeust, + MessageAuthenticationCode* find_mac(const SCAN_Name& request, Algorithm_Factory&) const; PBKDF* find_pbkdf(const SCAN_Name& algo_spec, diff --git a/src/engine/core_engine/core_modes.cpp b/src/engine/core_engine/core_modes.cpp index 8a929e880..ffd8aa04f 100644 --- a/src/engine/core_engine/core_modes.cpp +++ b/src/engine/core_engine/core_modes.cpp @@ -111,7 +111,7 @@ Keyed_Filter* get_cipher_mode(const BlockCipher* block_cipher, else return new CTS_Decryption(block_cipher->clone()); #else - return 0; + return nullptr; #endif } @@ -123,7 +123,7 @@ Keyed_Filter* get_cipher_mode(const BlockCipher* block_cipher, return new CBC_Decryption(block_cipher->clone(), get_bc_pad(padding, "PKCS7")); #else - return 0; + return nullptr; #endif } @@ -149,7 +149,7 @@ Keyed_Filter* get_cipher_mode(const BlockCipher* block_cipher, else if(algo_info.size() == 2) bits = to_u32bit(algo_info[1]); else - return 0; + return nullptr; #if defined(BOTAN_HAS_CFB) if(mode_name == "CFB") @@ -172,7 +172,7 @@ Keyed_Filter* get_cipher_mode(const BlockCipher* block_cipher, #endif } - return 0; + return nullptr; } /* @@ -195,10 +195,10 @@ Keyed_Filter* Core_Engine::get_cipher(const std::string& algo_spec, const BlockCipher* block_cipher = af.prototype_block_cipher(cipher_name); if(!block_cipher) - return 0; + return nullptr; if(algo_parts.size() >= 4) - return 0; // 4 part mode, not something we know about + return nullptr; // 4 part mode, not something we know about if(algo_parts.size() < 2) throw Lookup_Error("Cipher specification '" + algo_spec + @@ -213,7 +213,7 @@ Keyed_Filter* Core_Engine::get_cipher(const std::string& algo_spec, padding = (mode == "CBC") ? "PKCS7" : "NoPadding"; if(mode == "ECB" && padding == "CTS") - return 0; + return nullptr; else if((mode != "CBC" && mode != "ECB") && padding != "NoPadding") throw Invalid_Algorithm_Name(algo_spec); diff --git a/src/engine/core_engine/def_pk_ops.cpp b/src/engine/core_engine/def_pk_ops.cpp index db418d5bc..23ba7722c 100644 --- a/src/engine/core_engine/def_pk_ops.cpp +++ b/src/engine/core_engine/def_pk_ops.cpp @@ -58,7 +58,7 @@ Core_Engine::get_encryption_op(const Public_Key& key) const return new ElGamal_Encryption_Operation(*s); #endif - return 0; + return nullptr; } PK_Ops::Decryption* @@ -74,7 +74,7 @@ Core_Engine::get_decryption_op(const Private_Key& key) const return new ElGamal_Decryption_Operation(*s); #endif - return 0; + return nullptr; } PK_Ops::Key_Agreement* @@ -90,7 +90,7 @@ Core_Engine::get_key_agreement_op(const Private_Key& key) const return new ECDH_KA_Operation(*ecdh); #endif - return 0; + return nullptr; } PK_Ops::Signature* @@ -127,7 +127,7 @@ Core_Engine::get_signature_op(const Private_Key& key) const return new NR_Signature_Operation(*s); #endif - return 0; + return nullptr; } PK_Ops::Verification* @@ -164,7 +164,7 @@ Core_Engine::get_verify_op(const Public_Key& key) const return new NR_Verification_Operation(*s); #endif - return 0; + return nullptr; } } diff --git a/src/engine/core_engine/lookup_block.cpp b/src/engine/core_engine/lookup_block.cpp index c27a13237..a02c75daa 100644 --- a/src/engine/core_engine/lookup_block.cpp +++ b/src/engine/core_engine/lookup_block.cpp @@ -135,8 +135,12 @@ BlockCipher* Core_Engine::find_block_cipher(const SCAN_Name& request, #endif #if defined(BOTAN_HAS_CAMELLIA) - if(request.algo_name() == "Camellia") - return new Camellia; + if(request.algo_name() == "Camellia-128") + return new Camellia_128; + if(request.algo_name() == "Camellia-192") + return new Camellia_192; + if(request.algo_name() == "Camellia-256") + return new Camellia_256; #endif #if defined(BOTAN_HAS_CAST) @@ -273,13 +277,13 @@ BlockCipher* Core_Engine::find_block_cipher(const SCAN_Name& request, af.prototype_stream_cipher(request.arg(1)); if(!hash || !stream_cipher) - return 0; + return nullptr; return new Lion(hash->clone(), stream_cipher->clone(), block_size); } #endif - return 0; + return nullptr; } } diff --git a/src/engine/core_engine/lookup_hash.cpp b/src/engine/core_engine/lookup_hash.cpp index f94a97864..9958d18b9 100644 --- a/src/engine/core_engine/lookup_hash.cpp +++ b/src/engine/core_engine/lookup_hash.cpp @@ -218,7 +218,7 @@ HashFunction* Core_Engine::find_hash(const SCAN_Name& request, { const HashFunction* hash = af.prototype_hash_function(request.arg(i)); if(!hash) - return 0; + return nullptr; hash_prototypes.push_back(hash); } @@ -232,7 +232,7 @@ HashFunction* Core_Engine::find_hash(const SCAN_Name& request, #endif - return 0; + return nullptr; } } diff --git a/src/engine/core_engine/lookup_mac.cpp b/src/engine/core_engine/lookup_mac.cpp index 9f322b399..32275b559 100644 --- a/src/engine/core_engine/lookup_mac.cpp +++ b/src/engine/core_engine/lookup_mac.cpp @@ -64,7 +64,7 @@ Core_Engine::find_mac(const SCAN_Name& request, return new ANSI_X919_MAC(af.make_block_cipher("DES")); #endif - return 0; + return nullptr; } } diff --git a/src/engine/core_engine/lookup_pbkdf.cpp b/src/engine/core_engine/lookup_pbkdf.cpp index 9e9255f0a..2419f4373 100644 --- a/src/engine/core_engine/lookup_pbkdf.cpp +++ b/src/engine/core_engine/lookup_pbkdf.cpp @@ -46,7 +46,7 @@ PBKDF* Core_Engine::find_pbkdf(const SCAN_Name& algo_spec, return new OpenPGP_S2K(af.make_hash_function(algo_spec.arg(0))); #endif - return 0; + return nullptr; } } diff --git a/src/engine/core_engine/lookup_stream.cpp b/src/engine/core_engine/lookup_stream.cpp index 5b4859c1a..50e246756 100644 --- a/src/engine/core_engine/lookup_stream.cpp +++ b/src/engine/core_engine/lookup_stream.cpp @@ -55,7 +55,7 @@ Core_Engine::find_stream_cipher(const SCAN_Name& request, return new WiderWake_41_BE; #endif - return 0; + return nullptr; } } |