Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
248af93e3a | ||
![]() |
97478266ca | ||
![]() |
0e7a252d0d | ||
![]() |
0c125d1ee3 | ||
![]() |
e953fdbb96 | ||
![]() |
14fbc41003 | ||
![]() |
f927fc2a90 | ||
![]() |
5c164446dd | ||
![]() |
b8853fd092 | ||
![]() |
aad86fe1f9 | ||
![]() |
72039968e2 | ||
![]() |
9c2f0ef51c | ||
![]() |
e13a39a5a7 | ||
![]() |
9c9a9858e8 | ||
![]() |
90f851568a | ||
![]() |
6f7ad9c6d6 | ||
![]() |
52582562d8 |
18
.gitignore
vendored
18
.gitignore
vendored
@@ -45,6 +45,7 @@ Makefile.in
|
|||||||
test-driver
|
test-driver
|
||||||
*.log
|
*.log
|
||||||
*.trs
|
*.trs
|
||||||
|
!tests/optionstest.c
|
||||||
tests/aes_wrap*
|
tests/aes_wrap*
|
||||||
tests/arc4random_fork*
|
tests/arc4random_fork*
|
||||||
tests/cipher*
|
tests/cipher*
|
||||||
@@ -60,7 +61,6 @@ tests/pbkdf2*
|
|||||||
tests/*.pem
|
tests/*.pem
|
||||||
tests/testssl
|
tests/testssl
|
||||||
tests/*.txt
|
tests/*.txt
|
||||||
!tests/optionstest.c
|
|
||||||
|
|
||||||
# ctags stuff
|
# ctags stuff
|
||||||
TAGS
|
TAGS
|
||||||
@@ -70,8 +70,8 @@ autom4te.cache
|
|||||||
# Libtool adds these, at least sometimes
|
# Libtool adds these, at least sometimes
|
||||||
INSTALL
|
INSTALL
|
||||||
/COPYING
|
/COPYING
|
||||||
m4/l*
|
|
||||||
!m4/check*.m4
|
!m4/check*.m4
|
||||||
|
m4/l*
|
||||||
|
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
compile
|
compile
|
||||||
@@ -106,17 +106,16 @@ tls/*.h
|
|||||||
include/pqueue.h
|
include/pqueue.h
|
||||||
include/tls.h
|
include/tls.h
|
||||||
include/openssl/*.h
|
include/openssl/*.h
|
||||||
include/openssl/*.he
|
|
||||||
|
|
||||||
/apps/*.h
|
|
||||||
/apps/*.c
|
|
||||||
/apps/openssl
|
|
||||||
/apps/openssl.cnf
|
|
||||||
!/apps/apps_win.c
|
!/apps/apps_win.c
|
||||||
!/apps/poll_win.c
|
!/apps/poll_win.c
|
||||||
!/apps/certhash_disabled.c
|
!/apps/certhash_disabled.c
|
||||||
|
/apps/*.h
|
||||||
|
/apps/*.c
|
||||||
|
/apps/*.cnf
|
||||||
|
/apps/*.pem
|
||||||
|
/apps/openssl
|
||||||
|
|
||||||
/crypto
|
|
||||||
!/crypto/Makefile.am.*
|
!/crypto/Makefile.am.*
|
||||||
!/crypto/compat/arc4random.h
|
!/crypto/compat/arc4random.h
|
||||||
!/crypto/compat/b_win.c
|
!/crypto/compat/b_win.c
|
||||||
@@ -126,14 +125,15 @@ include/openssl/*.he
|
|||||||
!/crypto/compat/inet_pton.c
|
!/crypto/compat/inet_pton.c
|
||||||
!/crypto/compat/ui_openssl_win.c
|
!/crypto/compat/ui_openssl_win.c
|
||||||
!/crypto/CMakeLists.txt
|
!/crypto/CMakeLists.txt
|
||||||
|
/crypto
|
||||||
|
|
||||||
|
!/libtls-standalone/compat/Makefile.am
|
||||||
/libtls-standalone/include/*.h
|
/libtls-standalone/include/*.h
|
||||||
/libtls-standalone/src/*.c
|
/libtls-standalone/src/*.c
|
||||||
/libtls-standalone/src/*.h
|
/libtls-standalone/src/*.h
|
||||||
/libtls-standalone/src
|
/libtls-standalone/src
|
||||||
/libtls-standalone/tests/test
|
/libtls-standalone/tests/test
|
||||||
/libtls-standalone/compat
|
/libtls-standalone/compat
|
||||||
!/libtls-standalone/compat/Makefile.am
|
|
||||||
/libtls-standalone/VERSION
|
/libtls-standalone/VERSION
|
||||||
/libtls-standalone/m4
|
/libtls-standalone/m4
|
||||||
/libtls-standalone/man
|
/libtls-standalone/man
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
cmake_minimum_required (VERSION 2.8)
|
cmake_minimum_required (VERSION 2.8)
|
||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
|
include(CheckLibraryExists)
|
||||||
include(CheckIncludeFiles)
|
include(CheckIncludeFiles)
|
||||||
|
|
||||||
project (LibreSSL)
|
project (LibreSSL)
|
||||||
@@ -36,6 +37,8 @@ add_definitions(-DLIBRESSL_INTERNAL)
|
|||||||
add_definitions(-DOPENSSL_NO_HW_PADLOCK)
|
add_definitions(-DOPENSSL_NO_HW_PADLOCK)
|
||||||
add_definitions(-DOPENSSL_NO_ASM)
|
add_definitions(-DOPENSSL_NO_ASM)
|
||||||
|
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE true)
|
||||||
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
add_definitions(-Wno-pointer-sign)
|
add_definitions(-Wno-pointer-sign)
|
||||||
endif()
|
endif()
|
||||||
@@ -157,6 +160,16 @@ set(OPENSSL_LIBS ssl crypto)
|
|||||||
if(CMAKE_HOST_WIN32)
|
if(CMAKE_HOST_WIN32)
|
||||||
set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32)
|
set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32)
|
||||||
endif()
|
endif()
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
|
||||||
|
if (HAVE_CLOCK_GETTIME)
|
||||||
|
set(OPENSSL_LIBS ${OPENSSL_LIBS} rt)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR MSVC))
|
||||||
|
set(BUILD_SHARED true)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(crypto)
|
add_subdirectory(crypto)
|
||||||
add_subdirectory(ssl)
|
add_subdirectory(ssl)
|
||||||
|
@@ -28,6 +28,13 @@ history is also available from Git.
|
|||||||
|
|
||||||
LibreSSL Portable Release Notes:
|
LibreSSL Portable Release Notes:
|
||||||
|
|
||||||
|
2.2.4 - Build and bug fixes
|
||||||
|
|
||||||
|
* Backported build fixes for CMake on Windows, OSX and Linux
|
||||||
|
|
||||||
|
* Fixes for a memory leak and out-of-bounds access in OBJ_obj2txt
|
||||||
|
reported by Qualys Security.
|
||||||
|
|
||||||
2.2.3 - Bug fixes, build enhancements
|
2.2.3 - Bug fixes, build enhancements
|
||||||
|
|
||||||
* LibreSSL 2.2.2 incorrectly handles ClientHello messages that do not
|
* LibreSSL 2.2.2 incorrectly handles ClientHello messages that do not
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/compat
|
AM_CFLAGS =
|
||||||
AM_CPPFLAGS = -DLIBRESSL_INTERNAL
|
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/compat -DLIBRESSL_INTERNAL
|
||||||
|
@@ -13,7 +13,7 @@ LibreSSL is API compatible with OpenSSL 1.0.1, but does not yet include all
|
|||||||
new APIs from OpenSSL 1.0.2 and later. LibreSSL also includes APIs not yet
|
new APIs from OpenSSL 1.0.2 and later. LibreSSL also includes APIs not yet
|
||||||
present in OpenSSL. The current common API subset is OpenSSL 1.0.1.
|
present in OpenSSL. The current common API subset is OpenSSL 1.0.1.
|
||||||
|
|
||||||
LibreSSL it is not ABI compatible with any release of OpenSSL, or necessarily
|
LibreSSL is not ABI compatible with any release of OpenSSL, or necessarily
|
||||||
earlier releases of LibreSSL. You will need to relink your programs to
|
earlier releases of LibreSSL. You will need to relink your programs to
|
||||||
LibreSSL in order to use it, just as in moving between major versions of OpenSSL.
|
LibreSSL in order to use it, just as in moving between major versions of OpenSSL.
|
||||||
LibreSSL's installed library version numbers are incremented to account for
|
LibreSSL's installed library version numbers are incremented to account for
|
||||||
|
@@ -6,9 +6,8 @@ GCC or Clang as the compiler. Contrary to its name, mingw-w64 supports both
|
|||||||
then LibreSSL should integrate very nicely. Old versions of the mingw-w64
|
then LibreSSL should integrate very nicely. Old versions of the mingw-w64
|
||||||
toolchain, such as the one packaged with Ubuntu 12.04, may have trouble
|
toolchain, such as the one packaged with Ubuntu 12.04, may have trouble
|
||||||
building LibreSSL. Please try it with a recent toolchain if you encounter
|
building LibreSSL. Please try it with a recent toolchain if you encounter
|
||||||
troubles. If you are building under Cygwin, only builds with the mingw-w64
|
troubles. Cygwin provides an easy method of installing the latest mingw-w64
|
||||||
compiler are supported, though you can easily use Cygwin to drive the build
|
cross compilers on Windows.
|
||||||
process.
|
|
||||||
|
|
||||||
To configure and build LibreSSL for a 32-bit system, use the following
|
To configure and build LibreSSL for a 32-bit system, use the following
|
||||||
build steps:
|
build steps:
|
||||||
|
@@ -638,12 +638,16 @@ if(NOT HAVE_TIMINGSAFE_MEMCMP)
|
|||||||
set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_memcmp.c)
|
set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_memcmp.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (BUILD_SHARED)
|
||||||
add_library(crypto-objects OBJECT ${CRYPTO_SRC})
|
add_library(crypto-objects OBJECT ${CRYPTO_SRC})
|
||||||
set_property(TARGET crypto-objects PROPERTY POSITION_INDEPENDENT_CODE 1)
|
|
||||||
add_library(crypto STATIC $<TARGET_OBJECTS:crypto-objects>)
|
add_library(crypto STATIC $<TARGET_OBJECTS:crypto-objects>)
|
||||||
add_library(crypto-shared SHARED $<TARGET_OBJECTS:crypto-objects>)
|
add_library(crypto-shared SHARED $<TARGET_OBJECTS:crypto-objects>)
|
||||||
set_target_properties(crypto-shared PROPERTIES OUTPUT_NAME crypto)
|
set_target_properties(crypto-shared PROPERTIES OUTPUT_NAME crypto)
|
||||||
set_target_properties(crypto-shared PROPERTIES VERSION ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION})
|
set_target_properties(crypto-shared PROPERTIES VERSION
|
||||||
|
${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION})
|
||||||
install(TARGETS crypto crypto-shared DESTINATION lib)
|
install(TARGETS crypto crypto-shared DESTINATION lib)
|
||||||
|
else()
|
||||||
|
add_library(crypto STATIC ${CRYPTO_SRC})
|
||||||
|
install(TARGETS crypto DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
@@ -1,17 +1,21 @@
|
|||||||
include $(top_srcdir)/Makefile.am.common
|
include $(top_srcdir)/Makefile.am.common
|
||||||
|
|
||||||
AM_CFLAGS += -I$(top_srcdir)/crypto/asn1
|
AM_CPPFLAGS += -I$(top_srcdir)/crypto/asn1
|
||||||
AM_CFLAGS += -I$(top_srcdir)/crypto/evp
|
AM_CPPFLAGS += -I$(top_srcdir)/crypto/evp
|
||||||
AM_CFLAGS += -I$(top_srcdir)/crypto/modes
|
AM_CPPFLAGS += -I$(top_srcdir)/crypto/modes
|
||||||
|
|
||||||
lib_LTLIBRARIES = libcrypto.la
|
lib_LTLIBRARIES = libcrypto.la
|
||||||
|
|
||||||
EXTRA_DIST = VERSION
|
EXTRA_DIST = VERSION
|
||||||
EXTRA_DIST += CMakeLists.txt
|
EXTRA_DIST += CMakeLists.txt
|
||||||
|
|
||||||
|
# needed for a CMake target
|
||||||
|
EXTRA_DIST += compat/strcasecmp.c
|
||||||
|
|
||||||
libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined
|
libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined
|
||||||
libcrypto_la_LIBADD = libcompat.la libcompatnoopt.la
|
libcrypto_la_LIBADD = libcompat.la libcompatnoopt.la
|
||||||
libcrypto_la_CPPFLAGS = -DLIBRESSL_INTERNAL
|
libcrypto_la_CPPFLAGS = $(AM_CPPFLAGS)
|
||||||
|
libcrypto_la_CPPFLAGS += -DLIBRESSL_INTERNAL
|
||||||
libcrypto_la_CPPFLAGS += -DOPENSSL_NO_HW_PADLOCK
|
libcrypto_la_CPPFLAGS += -DOPENSSL_NO_HW_PADLOCK
|
||||||
if OPENSSL_NO_ASM
|
if OPENSSL_NO_ASM
|
||||||
libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM
|
libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM
|
||||||
|
2
dist.sh
2
dist.sh
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
rm -f man/*.1 man/*.3
|
rm -f man/*.1 man/*.3 include/openssl/*.h
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
./configure
|
./configure
|
||||||
make distcheck
|
make distcheck
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
include $(top_srcdir)/Makefile.am.common
|
include $(top_srcdir)/Makefile.am.common
|
||||||
|
|
||||||
|
EXTRA_DIST = CMakeLists.txt
|
||||||
|
|
||||||
SUBDIRS = openssl
|
SUBDIRS = openssl
|
||||||
|
|
||||||
noinst_HEADERS = pqueue.h
|
noinst_HEADERS = pqueue.h
|
||||||
|
@@ -29,15 +29,24 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1900
|
||||||
|
#include <../ucrt/stdio.h>
|
||||||
|
#include <../ucrt/wchar.h>
|
||||||
|
#include <../ucrt/string.h>
|
||||||
|
#include <../ucrt/stdlib.h>
|
||||||
|
#include <../ucrt/sys/types.h>
|
||||||
|
#include <../ucrt/errno.h>
|
||||||
|
#else
|
||||||
#include <../include/stdio.h>
|
#include <../include/stdio.h>
|
||||||
#include <../include/stdarg.h>
|
|
||||||
#include <../include/wchar.h>
|
#include <../include/wchar.h>
|
||||||
#include <../include/string.h>
|
#include <../include/string.h>
|
||||||
#include <../include/stdlib.h>
|
#include <../include/stdlib.h>
|
||||||
#include <../include/malloc.h>
|
|
||||||
#include <../include/sys/types.h>
|
#include <../include/sys/types.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <../include/errno.h>
|
#include <../include/errno.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
/* Indicates that d_type field is available in dirent structure */
|
/* Indicates that d_type field is available in dirent structure */
|
||||||
#define _DIRENT_HAVE_D_TYPE
|
#define _DIRENT_HAVE_D_TYPE
|
||||||
@@ -45,11 +54,6 @@
|
|||||||
/* Indicates that d_namlen field is available in dirent structure */
|
/* Indicates that d_namlen field is available in dirent structure */
|
||||||
#define _DIRENT_HAVE_D_NAMLEN
|
#define _DIRENT_HAVE_D_NAMLEN
|
||||||
|
|
||||||
/* Entries missing from MSVC 6.0 */
|
|
||||||
#if !defined(FILE_ATTRIBUTE_DEVICE)
|
|
||||||
# define FILE_ATTRIBUTE_DEVICE 0x40
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Maximum length of file name */
|
/* Maximum length of file name */
|
||||||
#if !defined(PATH_MAX)
|
#if !defined(PATH_MAX)
|
||||||
# define PATH_MAX MAX_PATH
|
# define PATH_MAX MAX_PATH
|
||||||
@@ -67,12 +71,6 @@
|
|||||||
/* Return number of bytes needed to store d_namlen */
|
/* Return number of bytes needed to store d_namlen */
|
||||||
#define _D_ALLOC_NAMLEN(p)(PATH_MAX)
|
#define _D_ALLOC_NAMLEN(p)(PATH_MAX)
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Wide-character version */
|
/* Wide-character version */
|
||||||
struct _wdirent {
|
struct _wdirent {
|
||||||
long d_ino; /* Always zero */
|
long d_ino; /* Always zero */
|
||||||
@@ -97,16 +95,6 @@ static struct _wdirent *_wreaddir (_WDIR *dirp);
|
|||||||
static int _wclosedir(_WDIR *dirp);
|
static int _wclosedir(_WDIR *dirp);
|
||||||
static void _wrewinddir(_WDIR* dirp);
|
static void _wrewinddir(_WDIR* dirp);
|
||||||
|
|
||||||
|
|
||||||
/* For compatibility with Symbian */
|
|
||||||
#define wdirent _wdirent
|
|
||||||
#define WDIR _WDIR
|
|
||||||
#define wopendir _wopendir
|
|
||||||
#define wreaddir _wreaddir
|
|
||||||
#define wclosedir _wclosedir
|
|
||||||
#define wrewinddir _wrewinddir
|
|
||||||
|
|
||||||
|
|
||||||
/* Multi-byte character versions */
|
/* Multi-byte character versions */
|
||||||
struct dirent {
|
struct dirent {
|
||||||
long d_ino; /* Always zero */
|
long d_ino; /* Always zero */
|
||||||
@@ -128,7 +116,6 @@ static struct dirent *readdir (DIR *dirp);
|
|||||||
static int closedir(DIR *dirp);
|
static int closedir(DIR *dirp);
|
||||||
static void rewinddir(DIR* dirp);
|
static void rewinddir(DIR* dirp);
|
||||||
|
|
||||||
|
|
||||||
/* Internal utility functions */
|
/* Internal utility functions */
|
||||||
static WIN32_FIND_DATAW *dirent_first(_WDIR *dirp);
|
static WIN32_FIND_DATAW *dirent_first(_WDIR *dirp);
|
||||||
static WIN32_FIND_DATAW *dirent_next(_WDIR *dirp);
|
static WIN32_FIND_DATAW *dirent_next(_WDIR *dirp);
|
||||||
@@ -147,23 +134,20 @@ static int dirent_wcstombs_s(
|
|||||||
const wchar_t *wcstr,
|
const wchar_t *wcstr,
|
||||||
size_t count);
|
size_t count);
|
||||||
|
|
||||||
static void dirent_set_errno (int error);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open directory stream DIRNAME for read and return a pointer to the
|
* Open directory stream DIRNAME for read and return a pointer to the
|
||||||
* internal working area that is used to retrieve individual directory
|
* internal working area that is used to retrieve individual directory
|
||||||
* entries.
|
* entries.
|
||||||
*/
|
*/
|
||||||
static _WDIR*
|
static _WDIR*
|
||||||
_wopendir(
|
_wopendir(const wchar_t *dirname)
|
||||||
const wchar_t *dirname)
|
|
||||||
{
|
{
|
||||||
_WDIR *dirp = NULL;
|
_WDIR *dirp = NULL;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
/* Must have directory name */
|
/* Must have directory name */
|
||||||
if (dirname == NULL || dirname[0] == '\0') {
|
if (dirname == NULL || dirname[0] == '\0') {
|
||||||
dirent_set_errno (ENOENT);
|
_set_errno(ENOENT);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,12 +203,12 @@ _wopendir(
|
|||||||
} else {
|
} else {
|
||||||
/* Cannot retrieve first entry */
|
/* Cannot retrieve first entry */
|
||||||
error = 1;
|
error = 1;
|
||||||
dirent_set_errno (ENOENT);
|
_set_errno(ENOENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* Cannot retrieve full path name */
|
/* Cannot retrieve full path name */
|
||||||
dirent_set_errno (ENOENT);
|
_set_errno(ENOENT);
|
||||||
error = 1;
|
error = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,8 +238,7 @@ _wopendir(
|
|||||||
* "." and ".." as well as volume labels, hidden files and system files.
|
* "." and ".." as well as volume labels, hidden files and system files.
|
||||||
*/
|
*/
|
||||||
static struct _wdirent*
|
static struct _wdirent*
|
||||||
_wreaddir(
|
_wreaddir(_WDIR *dirp)
|
||||||
_WDIR *dirp)
|
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATAW *datap;
|
WIN32_FIND_DATAW *datap;
|
||||||
struct _wdirent *entp;
|
struct _wdirent *entp;
|
||||||
@@ -314,8 +297,7 @@ _wreaddir(
|
|||||||
* _wreaddir().
|
* _wreaddir().
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
_wclosedir(
|
_wclosedir(_WDIR *dirp)
|
||||||
_WDIR *dirp)
|
|
||||||
{
|
{
|
||||||
int ok;
|
int ok;
|
||||||
if (dirp) {
|
if (dirp) {
|
||||||
@@ -338,7 +320,7 @@ _wclosedir(
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* Invalid directory stream */
|
/* Invalid directory stream */
|
||||||
dirent_set_errno (EBADF);
|
_set_errno(EBADF);
|
||||||
ok = /*failure*/-1;
|
ok = /*failure*/-1;
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
@@ -349,8 +331,7 @@ _wclosedir(
|
|||||||
* file name again.
|
* file name again.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_wrewinddir(
|
_wrewinddir(_WDIR* dirp)
|
||||||
_WDIR* dirp)
|
|
||||||
{
|
{
|
||||||
if (dirp) {
|
if (dirp) {
|
||||||
/* Release existing search handle */
|
/* Release existing search handle */
|
||||||
@@ -365,8 +346,7 @@ _wrewinddir(
|
|||||||
|
|
||||||
/* Get first directory entry(internal) */
|
/* Get first directory entry(internal) */
|
||||||
static WIN32_FIND_DATAW*
|
static WIN32_FIND_DATAW*
|
||||||
dirent_first(
|
dirent_first(_WDIR *dirp)
|
||||||
_WDIR *dirp)
|
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATAW *datap;
|
WIN32_FIND_DATAW *datap;
|
||||||
|
|
||||||
@@ -390,8 +370,7 @@ dirent_first(
|
|||||||
|
|
||||||
/* Get next directory entry(internal) */
|
/* Get next directory entry(internal) */
|
||||||
static WIN32_FIND_DATAW*
|
static WIN32_FIND_DATAW*
|
||||||
dirent_next(
|
dirent_next(_WDIR *dirp)
|
||||||
_WDIR *dirp)
|
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATAW *p;
|
WIN32_FIND_DATAW *p;
|
||||||
|
|
||||||
@@ -429,15 +408,14 @@ dirent_next(
|
|||||||
* Open directory stream using plain old C-string.
|
* Open directory stream using plain old C-string.
|
||||||
*/
|
*/
|
||||||
static DIR*
|
static DIR*
|
||||||
opendir(
|
opendir(const char *dirname)
|
||||||
const char *dirname)
|
|
||||||
{
|
{
|
||||||
struct DIR *dirp;
|
struct DIR *dirp;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
/* Must have directory name */
|
/* Must have directory name */
|
||||||
if (dirname == NULL || dirname[0] == '\0') {
|
if (dirname == NULL || dirname[0] == '\0') {
|
||||||
dirent_set_errno (ENOENT);
|
_set_errno(ENOENT);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -499,8 +477,7 @@ opendir(
|
|||||||
* display correcly.
|
* display correcly.
|
||||||
*/
|
*/
|
||||||
static struct dirent*
|
static struct dirent*
|
||||||
readdir(
|
readdir(DIR *dirp)
|
||||||
DIR *dirp)
|
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATAW *datap;
|
WIN32_FIND_DATAW *datap;
|
||||||
struct dirent *entp;
|
struct dirent *entp;
|
||||||
@@ -582,8 +559,7 @@ readdir(
|
|||||||
* Close directory stream.
|
* Close directory stream.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
closedir(
|
closedir(DIR *dirp)
|
||||||
DIR *dirp)
|
|
||||||
{
|
{
|
||||||
int ok;
|
int ok;
|
||||||
if (dirp) {
|
if (dirp) {
|
||||||
@@ -598,7 +574,7 @@ closedir(
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
/* Invalid directory stream */
|
/* Invalid directory stream */
|
||||||
dirent_set_errno (EBADF);
|
_set_errno(EBADF);
|
||||||
ok = /*failure*/-1;
|
ok = /*failure*/-1;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -609,8 +585,7 @@ closedir(
|
|||||||
* Rewind directory stream to beginning.
|
* Rewind directory stream to beginning.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
rewinddir(
|
rewinddir(DIR* dirp)
|
||||||
DIR* dirp)
|
|
||||||
{
|
{
|
||||||
/* Rewind wide-character string directory stream */
|
/* Rewind wide-character string directory stream */
|
||||||
_wrewinddir(dirp->wdirp);
|
_wrewinddir(dirp->wdirp);
|
||||||
@@ -618,131 +593,19 @@ rewinddir(
|
|||||||
|
|
||||||
/* Convert multi-byte string to wide character string */
|
/* Convert multi-byte string to wide character string */
|
||||||
static int
|
static int
|
||||||
dirent_mbstowcs_s(
|
dirent_mbstowcs_s(size_t *pReturnValue, wchar_t *wcstr,
|
||||||
size_t *pReturnValue,
|
size_t sizeInWords, const char *mbstr, size_t count)
|
||||||
wchar_t *wcstr,
|
|
||||||
size_t sizeInWords,
|
|
||||||
const char *mbstr,
|
|
||||||
size_t count)
|
|
||||||
{
|
{
|
||||||
int error;
|
return mbstowcs_s(pReturnValue, wcstr, sizeInWords, mbstr, count);
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
|
||||||
|
|
||||||
/* Microsoft Visual Studio 2005 or later */
|
|
||||||
error = mbstowcs_s (pReturnValue, wcstr, sizeInWords, mbstr, count);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* Older Visual Studio or non-Microsoft compiler */
|
|
||||||
size_t n;
|
|
||||||
|
|
||||||
/* Convert to wide-character string (or count characters) */
|
|
||||||
n = mbstowcs (wcstr, mbstr, sizeInWords);
|
|
||||||
if (!wcstr || n < count) {
|
|
||||||
|
|
||||||
/* Zero-terminate output buffer */
|
|
||||||
if (wcstr && sizeInWords) {
|
|
||||||
if (n >= sizeInWords) {
|
|
||||||
n = sizeInWords - 1;
|
|
||||||
}
|
|
||||||
wcstr[n] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Length of resuting multi-byte string WITH zero terminator */
|
|
||||||
if (pReturnValue) {
|
|
||||||
*pReturnValue = n + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Success */
|
|
||||||
error = 0;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
/* Could not convert string */
|
|
||||||
error = 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert wide-character string to multi-byte string */
|
/* Convert wide-character string to multi-byte string */
|
||||||
static int
|
static int
|
||||||
dirent_wcstombs_s(
|
dirent_wcstombs_s(size_t *pReturnValue, char *mbstr,
|
||||||
size_t *pReturnValue,
|
|
||||||
char *mbstr,
|
|
||||||
size_t sizeInBytes, /* max size of mbstr */
|
size_t sizeInBytes, /* max size of mbstr */
|
||||||
const wchar_t *wcstr,
|
const wchar_t *wcstr, size_t count)
|
||||||
size_t count)
|
|
||||||
{
|
{
|
||||||
int error;
|
return wcstombs_s(pReturnValue, mbstr, sizeInBytes, wcstr, count);
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
|
||||||
|
|
||||||
/* Microsoft Visual Studio 2005 or later */
|
|
||||||
error = wcstombs_s (pReturnValue, mbstr, sizeInBytes, wcstr, count);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* Older Visual Studio or non-Microsoft compiler */
|
|
||||||
size_t n;
|
|
||||||
|
|
||||||
/* Convert to multi-byte string (or count the number of bytes needed) */
|
|
||||||
n = wcstombs (mbstr, wcstr, sizeInBytes);
|
|
||||||
if (!mbstr || n < count) {
|
|
||||||
|
|
||||||
/* Zero-terminate output buffer */
|
|
||||||
if (mbstr && sizeInBytes) {
|
|
||||||
if (n >= sizeInBytes) {
|
|
||||||
n = sizeInBytes - 1;
|
|
||||||
}
|
|
||||||
mbstr[n] = '\0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lenght of resulting multi-bytes string WITH zero-terminator */
|
|
||||||
if (pReturnValue) {
|
|
||||||
*pReturnValue = n + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Success */
|
|
||||||
error = 0;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
/* Cannot convert string */
|
|
||||||
error = 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set errno variable */
|
|
||||||
static void
|
|
||||||
dirent_set_errno(
|
|
||||||
int error)
|
|
||||||
{
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
|
||||||
|
|
||||||
/* Microsoft Visual Studio 2005 and later */
|
|
||||||
_set_errno (error);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* Non-Microsoft compiler or older Microsoft compiler */
|
|
||||||
errno = error;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif /*DIRENT_H*/
|
#endif /*DIRENT_H*/
|
||||||
|
|
||||||
|
@@ -7,7 +7,13 @@
|
|||||||
#define LIBCRYPTOCOMPAT_STDIO_H
|
#define LIBCRYPTOCOMPAT_STDIO_H
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#if _MSC_VER >= 1900
|
||||||
|
#include <../ucrt/stdlib.h>
|
||||||
|
#include <../ucrt/corecrt_io.h>
|
||||||
|
#include <../ucrt/stdio.h>
|
||||||
|
#else
|
||||||
#include <../include/stdio.h>
|
#include <../include/stdio.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include_next <stdio.h>
|
#include_next <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
@@ -4,7 +4,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#if _MSC_VER >= 1900
|
||||||
|
#include <../ucrt/stdlib.h>
|
||||||
|
#else
|
||||||
#include <../include/stdlib.h>
|
#include <../include/stdlib.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include_next <stdlib.h>
|
#include_next <stdlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
@@ -7,7 +7,11 @@
|
|||||||
#define LIBCRYPTOCOMPAT_STRING_H
|
#define LIBCRYPTOCOMPAT_STRING_H
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#if _MSC_VER >= 1900
|
||||||
|
#include <../ucrt/string.h>
|
||||||
|
#else
|
||||||
#include <../include/string.h>
|
#include <../include/string.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include_next <string.h>
|
#include_next <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
@@ -11,7 +11,11 @@
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#if _MSC_VER >= 1900
|
||||||
|
#include <../ucrt/sys/stat.h>
|
||||||
|
#else
|
||||||
#include <../include/sys/stat.h>
|
#include <../include/sys/stat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* File type and permission flags for stat() */
|
/* File type and permission flags for stat() */
|
||||||
#if !defined(S_IFMT)
|
#if !defined(S_IFMT)
|
||||||
|
@@ -4,7 +4,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#if _MSC_VER >= 1900
|
||||||
|
#include <../ucrt/sys/types.h>
|
||||||
|
#else
|
||||||
#include <../include/sys/types.h>
|
#include <../include/sys/types.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include_next <sys/types.h>
|
#include_next <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
|
@@ -4,7 +4,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#if _MSC_VER >= 1900
|
||||||
|
#include <../ucrt/time.h>
|
||||||
|
#else
|
||||||
#include <../include/time.h>
|
#include <../include/time.h>
|
||||||
|
#endif
|
||||||
#define gmtime_r(tp, tm) ((gmtime_s((tm), (tp)) == 0) ? (tm) : NULL)
|
#define gmtime_r(tp, tm) ((gmtime_s((tm), (tp)) == 0) ? (tm) : NULL)
|
||||||
#else
|
#else
|
||||||
#include_next <time.h>
|
#include_next <time.h>
|
||||||
|
@@ -7,7 +7,11 @@
|
|||||||
#define LIBCRYPTOCOMPAT_STRING_H
|
#define LIBCRYPTOCOMPAT_STRING_H
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#if _MSC_VER >= 1900
|
||||||
|
#include <../ucrt/string.h>
|
||||||
|
#else
|
||||||
#include <../include/string.h>
|
#include <../include/string.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include_next <string.h>
|
#include_next <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
@@ -4,12 +4,29 @@ set -e
|
|||||||
./autogen.sh
|
./autogen.sh
|
||||||
|
|
||||||
if [ "x$ARCH" = "xnative" ]; then
|
if [ "x$ARCH" = "xnative" ]; then
|
||||||
|
# test autotools
|
||||||
./configure
|
./configure
|
||||||
|
make -j 4 check
|
||||||
|
|
||||||
|
# make distribution
|
||||||
|
make dist
|
||||||
|
tar zxvf libressl-*.tar.gz
|
||||||
|
cd libressl-*
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
|
||||||
|
# test cmake and ninja
|
||||||
if [ `uname` = "Darwin" ]; then
|
if [ `uname` = "Darwin" ]; then
|
||||||
# OS X runs out of resources if we run 'make -j check'
|
cmake ..
|
||||||
make check
|
make
|
||||||
else
|
else
|
||||||
make -j distcheck
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y python-software-properties
|
||||||
|
sudo apt-add-repository -y ppa:kalakris/cmake
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y cmake ninja-build
|
||||||
|
cmake -GNinja ..
|
||||||
|
ninja
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
CPU=i686
|
CPU=i686
|
||||||
|
@@ -51,11 +51,15 @@ set(
|
|||||||
t1_srvr.c
|
t1_srvr.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (BUILD_SHARED)
|
||||||
add_library(ssl-objects OBJECT ${SSL_SRC})
|
add_library(ssl-objects OBJECT ${SSL_SRC})
|
||||||
set_property(TARGET ssl-objects PROPERTY POSITION_INDEPENDENT_CODE 1)
|
|
||||||
add_library(ssl STATIC $<TARGET_OBJECTS:ssl-objects>)
|
add_library(ssl STATIC $<TARGET_OBJECTS:ssl-objects>)
|
||||||
add_library(ssl-shared SHARED $<TARGET_OBJECTS:ssl-objects>)
|
add_library(ssl-shared SHARED $<TARGET_OBJECTS:ssl-objects>)
|
||||||
set_target_properties(ssl-shared PROPERTIES OUTPUT_NAME ssl)
|
set_target_properties(ssl-shared PROPERTIES OUTPUT_NAME ssl)
|
||||||
set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION} SOVERSION ${SSL_MAJOR_VERSION})
|
set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION}
|
||||||
|
SOVERSION ${SSL_MAJOR_VERSION})
|
||||||
install(TARGETS ssl ssl-shared DESTINATION lib)
|
install(TARGETS ssl ssl-shared DESTINATION lib)
|
||||||
|
else()
|
||||||
|
add_library(ssl STATIC ${SSL_SRC})
|
||||||
|
install(TARGETS ssl DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
@@ -19,11 +19,16 @@ if(NOT HAVE_STRCASECMP)
|
|||||||
set(TLS_SRC ${TLS_SRC} strsep.c)
|
set(TLS_SRC ${TLS_SRC} strsep.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (BUILD_SHARED)
|
||||||
add_library(tls-objects OBJECT ${TLS_SRC})
|
add_library(tls-objects OBJECT ${TLS_SRC})
|
||||||
set_property(TARGET tls-objects PROPERTY POSITION_INDEPENDENT_CODE 1)
|
|
||||||
add_library(tls STATIC $<TARGET_OBJECTS:tls-objects>)
|
add_library(tls STATIC $<TARGET_OBJECTS:tls-objects>)
|
||||||
add_library(tls-shared SHARED $<TARGET_OBJECTS:tls-objects>)
|
add_library(tls-shared SHARED $<TARGET_OBJECTS:tls-objects>)
|
||||||
set_target_properties(tls-shared PROPERTIES OUTPUT_NAME tls)
|
set_target_properties(tls-shared PROPERTIES OUTPUT_NAME tls)
|
||||||
set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION} SOVERSION ${TLS_MAJOR_VERSION})
|
set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION}
|
||||||
|
SOVERSION ${TLS_MAJOR_VERSION})
|
||||||
install(TARGETS tls tls-shared DESTINATION lib)
|
install(TARGETS tls tls-shared DESTINATION lib)
|
||||||
|
else()
|
||||||
|
add_library(tls STATIC ${TLS_SRC})
|
||||||
|
install(TARGETS tls DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
@@ -280,7 +280,8 @@ done
|
|||||||
|
|
||||||
# copy manpages
|
# copy manpages
|
||||||
echo "copying manpages"
|
echo "copying manpages"
|
||||||
echo dist_man_MANS= > man/Makefile.am
|
echo EXTRA_DIST = CMakeLists.txt > man/Makefile.am
|
||||||
|
echo dist_man_MANS = >> man/Makefile.am
|
||||||
|
|
||||||
$CP $openssl_app_src/openssl.1 man
|
$CP $openssl_app_src/openssl.1 man
|
||||||
echo "dist_man_MANS += openssl.1" >> man/Makefile.am
|
echo "dist_man_MANS += openssl.1" >> man/Makefile.am
|
||||||
|
Reference in New Issue
Block a user