This commit is contained in:
Valient Gough 2017-08-07 23:01:44 -04:00
parent 217f646ea1
commit d820f708ad
No known key found for this signature in database
GPG Key ID: 33C65E29813C14DF
2 changed files with 27 additions and 27 deletions

View File

@ -277,7 +277,7 @@ int RawFileIO::truncate(off_t size) {
#if defined(HAVE_FDATASYNC) #if defined(HAVE_FDATASYNC)
::fdatasync(fd); ::fdatasync(fd);
#else #else
::fsync(fd); ::fsync(fd);
#endif #endif
} }

View File

@ -161,48 +161,48 @@ int TimedPBKDF2(const char *pass, int passlen, const unsigned char *salt,
// - Version 3:0 adds a new IV mechanism // - Version 3:0 adds a new IV mechanism
static Interface BlowfishInterface("ssl/blowfish", 3, 0, 2); static Interface BlowfishInterface("ssl/blowfish", 3, 0, 2);
static Interface AESInterface("ssl/aes", 3, 0, 2); static Interface AESInterface("ssl/aes", 3, 0, 2);
static Interface CAMELLIAInterface("ssl/camellia",3, 0, 2); static Interface CAMELLIAInterface("ssl/camellia", 3, 0, 2);
#ifndef OPENSSL_NO_CAMELLIA #ifndef OPENSSL_NO_CAMELLIA
static Range CAMELLIAKeyRange(128, 256, 64); static Range CAMELLIAKeyRange(128, 256, 64);
static Range CAMELLIABlockRange(64, 4096, 16); static Range CAMELLIABlockRange(64, 4096, 16);
static std::shared_ptr<Cipher> NewCAMELLIACipher(const Interface &iface, int keyLen) { static std::shared_ptr<Cipher> NewCAMELLIACipher(const Interface &iface,
if (keyLen <= 0) keyLen = 192; int keyLen) {
if (keyLen <= 0) keyLen = 192;
keyLen = CAMELLIAKeyRange.closest(keyLen); keyLen = CAMELLIAKeyRange.closest(keyLen);
const EVP_CIPHER *blockCipher = 0; const EVP_CIPHER *blockCipher = 0;
const EVP_CIPHER *streamCipher = 0; const EVP_CIPHER *streamCipher = 0;
switch (keyLen) { switch (keyLen) {
case 128: case 128:
blockCipher = EVP_camellia_128_cbc(); blockCipher = EVP_camellia_128_cbc();
streamCipher = EVP_camellia_128_cfb(); streamCipher = EVP_camellia_128_cfb();
break; break;
case 192: case 192:
blockCipher = EVP_camellia_192_cbc(); blockCipher = EVP_camellia_192_cbc();
streamCipher = EVP_camellia_192_cfb(); streamCipher = EVP_camellia_192_cfb();
break; break;
case 256: case 256:
default: default:
blockCipher = EVP_camellia_256_cbc(); blockCipher = EVP_camellia_256_cbc();
streamCipher = EVP_camellia_256_cfb(); streamCipher = EVP_camellia_256_cfb();
break; break;
} }
return std::shared_ptr<Cipher>(new SSL_Cipher( return std::shared_ptr<Cipher>(new SSL_Cipher(
iface, CAMELLIAInterface, blockCipher, streamCipher, keyLen / 8 )); iface, CAMELLIAInterface, blockCipher, streamCipher, keyLen / 8));
} }
static bool CAMELLIA_Cipher_registered = static bool CAMELLIA_Cipher_registered =
Cipher::Register("CAMELLIA","16 byte block cipher", CAMELLIAInterface, CAMELLIAKeyRange, Cipher::Register("CAMELLIA", "16 byte block cipher", CAMELLIAInterface,
CAMELLIABlockRange, NewCAMELLIACipher ); CAMELLIAKeyRange, CAMELLIABlockRange, NewCAMELLIACipher);
#endif #endif
#ifndef OPENSSL_NO_BF #ifndef OPENSSL_NO_BF
static Range BFKeyRange(128, 256, 32); static Range BFKeyRange(128, 256, 32);