Browse Source

Refine #1133 second time (#1136)

pull/1142/head
Roger Shimizu 7 years ago
committed by Max Lv
parent
commit
d714d1f182
3 changed files with 16 additions and 0 deletions
  1. 8
      src/encrypt.c
  2. 2
      src/encrypt.h
  3. 6
      src/utils.c

8
src/encrypt.c

@ -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
src/encrypt.h

@ -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
src/utils.c

@ -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");

Loading…
Cancel
Save