From b2c596595016b097f06670168ffc80bd9f149eb4 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 23 Feb 2019 17:46:39 +0100 Subject: [PATCH] Fix clang warning for ../../../trunk/libretroshare/src/ft/ftserver.cc:1230:23: warning: unused variable 'ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE' [-Wunused-const- variable] static const uint32_t ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE = 12 ; ^ ../../../trunk/libretroshare/src/ft/ftserver.cc:1231:23: warning: unused variable 'ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE' [-Wunused-const- variable] static const uint32_t ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE = 16 ; ^ ../../../trunk/libretroshare/src/ft/ftserver.cc:1232:23: warning: unused variable 'ENCRYPTED_FT_HEADER_SIZE' [-Wunused-const-variable] static const uint32_t ENCRYPTED_FT_HEADER_SIZE = 4 ; ^ ../../../trunk/libretroshare/src/ft/ftserver.cc:1233:23: warning: unused variable 'ENCRYPTED_FT_EDATA_SIZE' [-Wunused-const-variable] static const uint32_t ENCRYPTED_FT_EDATA_SIZE = 4 ; ^ ../../../trunk/libretroshare/src/ft/ftserver.cc:1235:23: warning: unused variable 'ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305' [-Wunused-const- variable] static const uint8_t ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305 = 0x01 ; ^ ../../../trunk/libretroshare/src/ft/ftserver.cc:1236:23: warning: unused variable 'ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256' [-Wunused-const- variable] static const uint8_t ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256 = 0x02 ; ^ --- libretroshare/src/ft/ftserver.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index 906bae6f1..8d429eda4 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -1227,6 +1227,7 @@ void ftServer::deriveEncryptionKey(const RsFileHash& hash, uint8_t *key) SHA256_Final (key, &sha_ctx); } +#ifdef USE_NEW_METHOD static const uint32_t ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE = 12 ; static const uint32_t ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE = 16 ; static const uint32_t ENCRYPTED_FT_HEADER_SIZE = 4 ; @@ -1234,7 +1235,7 @@ static const uint32_t ENCRYPTED_FT_EDATA_SIZE = 4 ; static const uint8_t ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305 = 0x01 ; static const uint8_t ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256 = 0x02 ; - +#endif //USE_NEW_METHOD bool ftServer::encryptItem(RsTurtleGenericTunnelItem *clear_item,const RsFileHash& hash,RsTurtleGenericDataItem *& encrypted_item) {