forked from github/server
move crypto implementations to util/crypto for easier inclusion
This commit is contained in:
parent
53afc86e00
commit
21e54e0933
19 changed files with 35 additions and 30 deletions
|
@ -62,7 +62,6 @@ endif(TOLUA_FOUND)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
add_subdirectory (crypt_blowfish)
|
|
||||||
add_subdirectory (cJSON)
|
add_subdirectory (cJSON)
|
||||||
add_subdirectory (storage)
|
add_subdirectory (storage)
|
||||||
add_subdirectory (iniparser)
|
add_subdirectory (iniparser)
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
cmake_minimum_required(VERSION 2.6)
|
|
||||||
project (bcrypt C)
|
|
||||||
|
|
||||||
IF (MSVC)
|
|
||||||
include (MSVC)
|
|
||||||
MSVC_SET_WARNING_LEVEL(3)
|
|
||||||
ENDIF (MSVC)
|
|
||||||
|
|
||||||
SET (LIB_SRC bcrypt.c wrapper.c crypt_blowfish.c crypt_gensalt.c)
|
|
||||||
ADD_LIBRARY (bcrypt ${LIB_SRC})
|
|
||||||
|
|
||||||
set (BCRYPT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "cJSON headers")
|
|
||||||
set (BCRYPT_LIBRARIES bcrypt CACHE INTERNAL "bcrypt libraries")
|
|
||||||
|
|
||||||
IF(UNIX AND NOT APPLE)
|
|
||||||
FIND_LIBRARY(UNIX_MATH_LIBRARY m)
|
|
||||||
SET(BCRYPT_LIBRARIES ${BCRYPT_LIBRARIES} ${UNIX_MATH_LIBRARY} CACHE
|
|
||||||
INTERNAL "bcrypt libraries")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (MSVC)
|
|
||||||
MSVC_CRT_SECURE_NO_WARNINGS (bcrypt)
|
|
||||||
ENDIF (MSVC)
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ project (server C)
|
||||||
|
|
||||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
include_directories (${CJSON_INCLUDE_DIR})
|
include_directories (${CJSON_INCLUDE_DIR})
|
||||||
include_directories (${BCRYPT_INCLUDE_DIR})
|
include_directories (${CRYPTO_INCLUDE_DIR})
|
||||||
include_directories (${CLIBS_INCLUDE_DIR})
|
include_directories (${CLIBS_INCLUDE_DIR})
|
||||||
include_directories (${STORAGE_INCLUDE_DIR})
|
include_directories (${STORAGE_INCLUDE_DIR})
|
||||||
include_directories (${TOLUA_INCLUDE_DIR})
|
include_directories (${TOLUA_INCLUDE_DIR})
|
||||||
|
@ -180,7 +180,7 @@ target_link_libraries(eressea
|
||||||
${LUA_LIBRARIES}
|
${LUA_LIBRARIES}
|
||||||
${STORAGE_LIBRARIES}
|
${STORAGE_LIBRARIES}
|
||||||
${CLIBS_LIBRARIES}
|
${CLIBS_LIBRARIES}
|
||||||
${BCRYPT_LIBRARIES}
|
${CRYPTO_LIBRARIES}
|
||||||
${CJSON_LIBRARIES}
|
${CJSON_LIBRARIES}
|
||||||
${INIPARSER_LIBRARIES}
|
${INIPARSER_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
@ -241,7 +241,7 @@ target_link_libraries(test_eressea
|
||||||
${LUA_LIBRARIES}
|
${LUA_LIBRARIES}
|
||||||
${CLIBS_LIBRARIES}
|
${CLIBS_LIBRARIES}
|
||||||
${STORAGE_LIBRARIES}
|
${STORAGE_LIBRARIES}
|
||||||
${BCRYPT_LIBRARIES}
|
${CRYPTO_LIBRARIES}
|
||||||
${CJSON_LIBRARIES}
|
${CJSON_LIBRARIES}
|
||||||
${INIPARSER_LIBRARIES}
|
${INIPARSER_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
project(util C)
|
project(util C)
|
||||||
|
|
||||||
|
add_subdirectory (crypto)
|
||||||
|
|
||||||
SET(_TEST_FILES
|
SET(_TEST_FILES
|
||||||
attrib.test.c
|
attrib.test.c
|
||||||
base36.test.c
|
base36.test.c
|
||||||
|
|
28
src/util/crypto/CMakeLists.txt
Normal file
28
src/util/crypto/CMakeLists.txt
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
cmake_minimum_required(VERSION 2.6)
|
||||||
|
project (crypto C)
|
||||||
|
|
||||||
|
IF (MSVC)
|
||||||
|
include (MSVC)
|
||||||
|
MSVC_SET_WARNING_LEVEL(3)
|
||||||
|
ENDIF (MSVC)
|
||||||
|
|
||||||
|
SET (LIB_SRC
|
||||||
|
bcrypt.c
|
||||||
|
crypt_blowfish/wrapper.c
|
||||||
|
crypt_blowfish/crypt_blowfish.c
|
||||||
|
crypt_blowfish/crypt_gensalt.c
|
||||||
|
)
|
||||||
|
ADD_LIBRARY (crypto ${LIB_SRC})
|
||||||
|
|
||||||
|
set (CRYPTO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "cJSON headers")
|
||||||
|
set (CRYPTO_LIBRARIES crypto CACHE INTERNAL "crypto libraries")
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
FIND_LIBRARY(WIN32_CNG_LIBRARY bcrypt)
|
||||||
|
SET(CRYPTO_LIBRARIES ${CRYPTO_LIBRARIES} ${WIN32_CNG_LIBRARY} CACHE
|
||||||
|
INTERNAL "crypto libraries")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF (MSVC)
|
||||||
|
MSVC_CRT_SECURE_NO_WARNINGS (crypto)
|
||||||
|
ENDIF (MSVC)
|
|
@ -19,7 +19,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "bcrypt.h"
|
#include "bcrypt.h"
|
||||||
#include "ow-crypt.h"
|
#include "crypt_blowfish/ow-crypt.h"
|
||||||
|
|
||||||
#define RANDBYTES (16)
|
#define RANDBYTES (16)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include "password.h"
|
#include "password.h"
|
||||||
|
|
||||||
#include <bcrypt.h>
|
#include "crypto/bcrypt.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
Loading…
Reference in a new issue