Refine #1133 second time (#1136)

This commit is contained in:
Roger Shimizu
2017-01-25 18:20:21 +08:00
committed by Max Lv
parent c5807058ba
commit d714d1f182
3 changed files with 16 additions and 0 deletions
+8
View File
@@ -197,7 +197,9 @@ static const CCAlgorithm supported_ciphers_applecc[CIPHER_NUM] = {
kCCAlgorithmInvalid,
kCCAlgorithmInvalid,
kCCAlgorithmInvalid,
#if SODIUM_LIBRARY_VERSION_MAJOR >= 8
kCCAlgorithmInvalid
#endif
};
static const CCMode supported_modes_applecc[CIPHER_NUM] = {
@@ -221,7 +223,9 @@ static const CCMode supported_modes_applecc[CIPHER_NUM] = {
kCCAlgorithmInvalid,
kCCAlgorithmInvalid,
kCCAlgorithmInvalid,
#if SODIUM_LIBRARY_VERSION_MAJOR >= 8
kCCAlgorithmInvalid
#endif
};
#endif
@@ -1303,7 +1307,11 @@ enc_key_init(int method, const char *pass)
FATAL("Failed to initialize sodium");
}
#if SODIUM_LIBRARY_VERSION_MAJOR >= 8
if (method == SALSA20 || method == CHACHA20 || method == CHACHA20IETF) {
#else
if (method == SALSA20 || method == CHACHA20) {
#endif
#if defined(USE_CRYPTO_OPENSSL)
cipher.info = NULL;
cipher.key_len = supported_ciphers_key_size[method];
+2
View File
@@ -134,7 +134,9 @@ typedef struct {
#define SEED_CFB 17
#define SALSA20 18
#define CHACHA20 19
#if SODIUM_LIBRARY_VERSION_MAJOR >= 8
#define CHACHA20IETF 20
#endif
#define ONETIMEAUTH_FLAG 0x10
#define ADDRTYPE_MASK 0xEF
+6
View File
@@ -278,9 +278,15 @@ usage()
printf(
" camellia-256-cfb, cast5-cfb, des-cfb,\n");
printf(
#if SODIUM_LIBRARY_VERSION_MAJOR >= 8
" idea-cfb, rc2-cfb, seed-cfb, salsa20,\n");
printf(
" chacha20 and chacha20-ietf.\n");
#else
" idea-cfb, rc2-cfb, seed-cfb, salsa20 and\n");
printf(
" chacha20.\n");
#endif
printf(
" The default cipher is rc4-md5.\n");
printf("\n");