Compare commits
No commits in common. "master" and "1.6.3-final" have entirely different histories.
master
...
1.6.3-fina
|
@ -1,9 +0,0 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
|
@ -1,80 +0,0 @@
|
|||
name: Bug Report
|
||||
description: File a bug report (for questions, ideas & support, use the Discussions tab, or IRC for quick answers, but make sure to stay on the channel!)
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report!
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: What happened?
|
||||
description: Also tell us, what did you expect to happen?
|
||||
placeholder: Tell us what you see! Screenshots are also helpful - please attach to the issue (when created), rather than linking to image hosting sites.
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: What version of Barrier are you running?
|
||||
options:
|
||||
- v2.0.0-RC1
|
||||
- v2.0.0-RC2
|
||||
- v2.0.0
|
||||
- v2.1.1
|
||||
- v2.1.2
|
||||
- v2.3.0
|
||||
- v2.3.1
|
||||
- v2.3.2-alpha
|
||||
- v2.3.2
|
||||
- v2.3.3
|
||||
- v2.3.4
|
||||
- v2.4.0
|
||||
- From Git HEAD or commit (specify below)
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: git-commit-if
|
||||
attributes:
|
||||
label: Git commit hash (if applicable)
|
||||
description: "When building Barrier from Git, what commit hash did you checkout from?"
|
||||
placeholder: b0c0b42b
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: pkg-mgr-origin
|
||||
attributes:
|
||||
label: If applicable, where did you install Barrier from?
|
||||
description: This includes Snaps, Flatpaks, and self-built executables.
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
id: os
|
||||
attributes:
|
||||
label: What OSes are you seeing the problem on? (Check all that apply)
|
||||
multiple: true
|
||||
options:
|
||||
- Linux
|
||||
- Windows
|
||||
- macOS
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: os-version
|
||||
attributes:
|
||||
label: What OS versions are you using?
|
||||
description: This applies to both client(s) and the server.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Relevant log output
|
||||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
||||
render: shell
|
||||
- type: textarea
|
||||
id: misc-info
|
||||
attributes:
|
||||
label: Any other information
|
||||
description: Please enter any other information we should know, if applicable.
|
|
@ -1 +0,0 @@
|
|||
blank_issues_enabled: false
|
|
@ -1,4 +0,0 @@
|
|||
## Contributor Checklist:
|
||||
|
||||
* [ ] I have created a file in the `doc/newsfragments` directory *IF* it is a
|
||||
user-visible change (and make sure to read the `README.md` in that directory)
|
|
@ -1,34 +1,15 @@
|
|||
build_env.*
|
||||
config.h
|
||||
.DS_Store
|
||||
*.pyc
|
||||
*.o
|
||||
*~
|
||||
\.*.swp
|
||||
*build-gui-Desktop_Qt*
|
||||
/bin
|
||||
/lib
|
||||
/build
|
||||
/CMakeFiles
|
||||
/ext/cryptopp562
|
||||
/ext/openssl
|
||||
/ext/gmock-1.6.0
|
||||
/ext/gtest-1.6.0
|
||||
/src/gui/Makefile*
|
||||
/src/gui/object_script*
|
||||
/src/gui/tmp
|
||||
/src/gui/ui_*
|
||||
src/gui/gui.pro.user*
|
||||
src/gui/gui.pro.user
|
||||
src/gui/.qmake.stash
|
||||
src/gui/.rnd
|
||||
src/setup/win32/barrier.suo
|
||||
Makefile
|
||||
*.cmake
|
||||
**/CMakeFiles/
|
||||
CMakeCache.txt
|
||||
/rpm
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# VS Code Directory
|
||||
.vscode/
|
||||
# Transient in-project-directory dependencies
|
||||
/deps/
|
||||
/out/build/x64-Debug
|
||||
src/setup/win32/synergy.suo
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
[submodule "ext/gtest"]
|
||||
path = ext/gtest
|
||||
url = https://github.com/google/googletest.git
|
||||
[submodule "ext/gmock"]
|
||||
path = ext/gmock
|
||||
url = https://github.com/google/googlemock.git
|
||||
[submodule "ext/gulrak-filesystem"]
|
||||
path = ext/gulrak-filesystem
|
||||
url = https://github.com/gulrak/filesystem
|
|
@ -0,0 +1,13 @@
|
|||
"Instructions
|
||||
"Download vim script 411
|
||||
"http://www.vim.org/scripts/script.php?script_id=441
|
||||
"Install localvimrc.vim to .vim/plugin
|
||||
"
|
||||
" Hint: You can disable it asking before sourcing a file by adding this to
|
||||
" your .vimrc: let g:localvimrc_ask=0
|
||||
|
||||
set nosmarttab
|
||||
set noexpandtab
|
||||
set shiftwidth=8
|
||||
set softtabstop=0
|
||||
set tabstop=4
|
|
@ -1,7 +0,0 @@
|
|||
#
|
||||
# Barrier build parameters
|
||||
#
|
||||
BARRIER_VERSION_MAJOR = 2
|
||||
BARRIER_VERSION_MINOR = 4
|
||||
BARRIER_VERSION_PATCH = 0
|
||||
BARRIER_VERSION_STAGE = release
|
665
CMakeLists.txt
665
CMakeLists.txt
|
@ -1,12 +1,11 @@
|
|||
# Barrier -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2018 Debauchee Open Source Group
|
||||
# Copyright (C) 2012-2016 Symless Ltd.
|
||||
# synergy -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2012 Synergy Si Ltd.
|
||||
# Copyright (C) 2009 Nick Bolton
|
||||
#
|
||||
#
|
||||
# This package is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# found in the file LICENSE that should have accompanied this file.
|
||||
#
|
||||
# found in the file COPYING that should have accompanied this file.
|
||||
#
|
||||
# This package is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
|
@ -15,447 +14,345 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
cmake_minimum_required (VERSION 3.4)
|
||||
project (barrier C CXX)
|
||||
# Version number for Synergy
|
||||
set(VERSION_MAJOR 1)
|
||||
set(VERSION_MINOR 6)
|
||||
set(VERSION_REV 3)
|
||||
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}")
|
||||
|
||||
option (BARRIER_BUILD_GUI "Build the GUI" ON)
|
||||
option (BARRIER_BUILD_INSTALLER "Build the installer" ON)
|
||||
option (BARRIER_BUILD_TESTS "Build the tests" ON)
|
||||
option (BARRIER_USE_EXTERNAL_GTEST "Use external installation of Google Test framework" OFF)
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set (CMAKE_CXX_STANDARD 14)
|
||||
set (CMAKE_CXX_EXTENSIONS OFF)
|
||||
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_definitions (-DNDEBUG)
|
||||
endif()
|
||||
|
||||
include (cmake/Version.cmake)
|
||||
include (cmake/Package.cmake)
|
||||
|
||||
# TODO: Find out why we need these, and remove them
|
||||
# CMake complains if we don't have this.
|
||||
if (COMMAND cmake_policy)
|
||||
cmake_policy (SET CMP0003 NEW)
|
||||
cmake_policy (SET CMP0005 NEW)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
endif()
|
||||
|
||||
# Add headers to source list
|
||||
# We're escaping quotes in the Windows version number, because
|
||||
# for some reason CMake won't do it at config version 2.4.7
|
||||
# It seems that this restores the newer behaviour where define
|
||||
# args are not auto-escaped.
|
||||
if (COMMAND cmake_policy)
|
||||
cmake_policy(SET CMP0005 NEW)
|
||||
endif()
|
||||
|
||||
# First, declare project (important for prerequisite checks).
|
||||
project(synergy C CXX)
|
||||
|
||||
# put binaries in a different dir to make them easier to find.
|
||||
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
|
||||
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
|
||||
|
||||
# for unix, put debug files in a separate bin "debug" dir.
|
||||
# release bin files should stay in the root of the bin dir.
|
||||
if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
||||
if (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/debug)
|
||||
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/debug)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Set some easy to type variables.
|
||||
set(root_dir ${CMAKE_SOURCE_DIR})
|
||||
set(cmake_dir ${root_dir}/res)
|
||||
set(bin_dir ${root_dir}/bin)
|
||||
set(doc_dir ${root_dir}/doc)
|
||||
set(doc_dir ${root_dir}/doc)
|
||||
|
||||
# Declare libs, so we can use list in linker later. There's probably
|
||||
# a more elegant way of doing this; with SCons, when you check for the
|
||||
# lib, it is automatically passed to the linker.
|
||||
set(libs)
|
||||
|
||||
# only include headers as "source" if not unix makefiles,
|
||||
# which is useful when using an IDE.
|
||||
if (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
||||
set (BARRIER_ADD_HEADERS FALSE)
|
||||
set(SYNERGY_ADD_HEADERS FALSE)
|
||||
else()
|
||||
set (BARRIER_ADD_HEADERS TRUE)
|
||||
set(SYNERGY_ADD_HEADERS TRUE)
|
||||
endif()
|
||||
|
||||
set (libs)
|
||||
|
||||
# Depending on the platform, pass in the required defines.
|
||||
if (UNIX)
|
||||
if (NOT APPLE)
|
||||
set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
||||
endif()
|
||||
|
||||
# For config.h, detect the libraries, functions, etc.
|
||||
include (CheckIncludeFiles)
|
||||
include (CheckLibraryExists)
|
||||
include (CheckFunctionExists)
|
||||
include (CheckTypeSize)
|
||||
include (CheckIncludeFileCXX)
|
||||
include (CheckSymbolExists)
|
||||
include (CheckCSourceCompiles)
|
||||
include (FindPkgConfig)
|
||||
# warnings as errors:
|
||||
# we have a problem with people checking in code with warnings.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
|
||||
check_include_file_cxx (istream HAVE_ISTREAM)
|
||||
check_include_file_cxx (ostream HAVE_OSTREAM)
|
||||
check_include_file_cxx (sstream HAVE_SSTREAM)
|
||||
# For config.h, detect the libraries, functions, etc.
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckTypeSize)
|
||||
include(CheckIncludeFileCXX)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
check_include_files (inttypes.h HAVE_INTTYPES_H)
|
||||
check_include_files (locale.h HAVE_LOCALE_H)
|
||||
check_include_files (memory.h HAVE_MEMORY_H)
|
||||
check_include_files (stdlib.h HAVE_STDLIB_H)
|
||||
check_include_files (strings.h HAVE_STRINGS_H)
|
||||
check_include_files (string.h HAVE_STRING_H)
|
||||
check_include_files (sys/select.h HAVE_SYS_SELECT_H)
|
||||
check_include_files (sys/socket.h HAVE_SYS_SOCKET_H)
|
||||
check_include_files (sys/stat.h HAVE_SYS_STAT_H)
|
||||
check_include_files (sys/time.h HAVE_SYS_TIME_H)
|
||||
check_include_files (sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||
check_include_files (unistd.h HAVE_UNISTD_H)
|
||||
check_include_files (wchar.h HAVE_WCHAR_H)
|
||||
check_include_file_cxx(istream HAVE_ISTREAM)
|
||||
check_include_file_cxx(ostream HAVE_OSTREAM)
|
||||
check_include_file_cxx(sstream HAVE_SSTREAM)
|
||||
|
||||
check_function_exists (getpwuid_r HAVE_GETPWUID_R)
|
||||
check_function_exists (gmtime_r HAVE_GMTIME_R)
|
||||
check_function_exists (nanosleep HAVE_NANOSLEEP)
|
||||
check_function_exists (poll HAVE_POLL)
|
||||
check_function_exists (sigwait HAVE_POSIX_SIGWAIT)
|
||||
check_function_exists (strftime HAVE_STRFTIME)
|
||||
check_function_exists (inet_aton HAVE_INET_ATON)
|
||||
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
||||
check_include_files(locale.h HAVE_LOCALE_H)
|
||||
check_include_files(memory.h HAVE_MEMORY_H)
|
||||
check_include_files(stdlib.h HAVE_STDLIB_H)
|
||||
check_include_files(strings.h HAVE_STRINGS_H)
|
||||
check_include_files(string.h HAVE_STRING_H)
|
||||
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
|
||||
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
|
||||
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
|
||||
check_include_files(sys/time.h HAVE_SYS_TIME_H)
|
||||
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
check_include_files(wchar.h HAVE_WCHAR_H)
|
||||
|
||||
# For some reason, the check_function_exists macro doesn't detect
|
||||
# the inet_aton on some pure Unix platforms (e.g. sunos5). So we
|
||||
# need to do a more detailed check and also include some extra libs.
|
||||
if (NOT HAVE_INET_ATON)
|
||||
set (CMAKE_REQUIRED_LIBRARIES nsl)
|
||||
check_function_exists(getpwuid_r HAVE_GETPWUID_R)
|
||||
check_function_exists(gmtime_r HAVE_GMTIME_R)
|
||||
check_function_exists(nanosleep HAVE_NANOSLEEP)
|
||||
check_function_exists(poll HAVE_POLL)
|
||||
check_function_exists(sigwait HAVE_POSIX_SIGWAIT)
|
||||
check_function_exists(strftime HAVE_STRFTIME)
|
||||
check_function_exists(vsnprintf HAVE_VSNPRINTF)
|
||||
check_function_exists(inet_aton HAVE_INET_ATON)
|
||||
|
||||
# For some reason, the check_function_exists macro doesn't detect
|
||||
# the inet_aton on some pure Unix platforms (e.g. sunos5). So we
|
||||
# need to do a more detailed check and also include some extra libs.
|
||||
if (NOT HAVE_INET_ATON)
|
||||
|
||||
check_c_source_compiles (
|
||||
"#include <arpa/inet.h>\n int main() { inet_aton (0, 0); }"
|
||||
HAVE_INET_ATON_ADV)
|
||||
set(CMAKE_REQUIRED_LIBRARIES nsl)
|
||||
check_c_source_compiles(
|
||||
"#include <arpa/inet.h>\n int main() { inet_aton(0, 0); }"
|
||||
HAVE_INET_ATON_ADV)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
set (CMAKE_REQUIRED_LIBRARIES)
|
||||
if (HAVE_INET_ATON_ADV)
|
||||
|
||||
# Override the previous fail.
|
||||
set(HAVE_INET_ATON 1)
|
||||
|
||||
if (HAVE_INET_ATON_ADV)
|
||||
# Override the previous fail.
|
||||
set (HAVE_INET_ATON 1)
|
||||
# Assume that both nsl and socket will be needed,
|
||||
# it seems safe to add socket on the back of nsl,
|
||||
# since socket only ever needed when nsl is needed.
|
||||
list(APPEND libs nsl socket)
|
||||
|
||||
# Assume that both nsl and socket will be needed,
|
||||
# it seems safe to add socket on the back of nsl,
|
||||
# since socket only ever needed when nsl is needed.
|
||||
list (APPEND libs nsl socket)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
check_type_size (char SIZEOF_CHAR)
|
||||
check_type_size (int SIZEOF_INT)
|
||||
check_type_size (long SIZEOF_LONG)
|
||||
check_type_size (short SIZEOF_SHORT)
|
||||
check_type_size(char SIZEOF_CHAR)
|
||||
check_type_size(int SIZEOF_INT)
|
||||
check_type_size(long SIZEOF_LONG)
|
||||
check_type_size(short SIZEOF_SHORT)
|
||||
|
||||
# pthread is used on both Linux and Mac
|
||||
set (CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
set (THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
find_package (Threads REQUIRED)
|
||||
list (APPEND libs Threads::Threads)
|
||||
# pthread is used on both Linux and Mac
|
||||
check_library_exists("pthread" pthread_create "" HAVE_PTHREAD)
|
||||
if (HAVE_PTHREAD)
|
||||
list(APPEND libs pthread)
|
||||
else()
|
||||
message(FATAL_ERROR "Missing library: pthread")
|
||||
endif()
|
||||
|
||||
# curl is used on both Linux and Mac
|
||||
find_package (CURL)
|
||||
if (CURL_FOUND)
|
||||
include_directories(${CURL_INCLUDE_DIRS})
|
||||
list (APPEND libs ${CURL_LIBRARIES})
|
||||
# curl is used on both Linux and Mac
|
||||
find_package(CURL)
|
||||
if (CURL_FOUND)
|
||||
list(APPEND libs curl)
|
||||
else()
|
||||
message(FATAL_ERROR "Missing library: curl")
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
message(STATUS "OSX_TARGET_MAJOR=${OSX_TARGET_MAJOR}")
|
||||
message(STATUS "OSX_TARGET_MINOR=${OSX_TARGET_MINOR}")
|
||||
|
||||
else()
|
||||
message (FATAL_ERROR "Missing library: curl")
|
||||
endif()
|
||||
if (NOT (OSX_TARGET_MAJOR EQUAL 10))
|
||||
message(FATAL_ERROR "Mac OS X target must be 10.x")
|
||||
endif ()
|
||||
|
||||
if (APPLE)
|
||||
set (CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1")
|
||||
if (OSX_TARGET_MINOR LESS 6)
|
||||
# <= 10.5: 32-bit Intel and PowerPC
|
||||
set(CMAKE_OSX_ARCHITECTURES "ppc;i386"
|
||||
CACHE STRING "" FORCE)
|
||||
else()
|
||||
# >= 10.6: Intel only
|
||||
set(CMAKE_OSX_ARCHITECTURES "i386;x86_64"
|
||||
CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1")
|
||||
|
||||
find_library (lib_ScreenSaver ScreenSaver)
|
||||
find_library (lib_IOKit IOKit)
|
||||
find_library (lib_ApplicationServices ApplicationServices)
|
||||
find_library (lib_Foundation Foundation)
|
||||
find_library (lib_Carbon Carbon)
|
||||
find_library(lib_ScreenSaver ScreenSaver)
|
||||
find_library(lib_IOKit IOKit)
|
||||
find_library(lib_ApplicationServices ApplicationServices)
|
||||
find_library(lib_Foundation Foundation)
|
||||
find_library(lib_Carbon Carbon)
|
||||
|
||||
list (APPEND libs
|
||||
${lib_ScreenSaver}
|
||||
${lib_IOKit}
|
||||
${lib_ApplicationServices}
|
||||
${lib_Foundation}
|
||||
${lib_Carbon}
|
||||
)
|
||||
list(APPEND libs
|
||||
${lib_ScreenSaver}
|
||||
${lib_IOKit}
|
||||
${lib_ApplicationServices}
|
||||
${lib_Foundation}
|
||||
${lib_Carbon}
|
||||
)
|
||||
|
||||
else() # not-apple
|
||||
# FreeBSD uses /usr/local for anything not part of base
|
||||
# Also package avahi-libdns puts dns_sd.h a bit deeper
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};/usr/local/include;/usr/local/include/avahi-compat-libdns_sd")
|
||||
set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L/usr/local/lib")
|
||||
include_directories("/usr/local/include" "/usr/local/include/avahi-compat-libdns_sd")
|
||||
link_directories("/usr/local/lib")
|
||||
endif()
|
||||
else() # not-apple
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
||||
set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};/usr/X11R6/include;/usr/local/include;/usr/local/include/avahi-compat-libdns_sd")
|
||||
set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L/usr/local/lib -L/usr/X11R6/lib")
|
||||
include_directories("/usr/local/include" "/usr/X11R6/include" "/usr/local/include/avahi-compat-libdns_sd")
|
||||
link_directories("/usr/local/lib")
|
||||
link_directories("/usr/X11R6/lib")
|
||||
endif()
|
||||
# add include dir for bsd (posix uses /usr/include/)
|
||||
set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include")
|
||||
|
||||
if (BARRIER_BUILD_GUI AND ${PKG_CONFIG_FOUND})
|
||||
pkg_check_modules (AVAHI_COMPAT REQUIRED avahi-compat-libdns_sd)
|
||||
include_directories (BEFORE SYSTEM ${AVAHI_COMPAT_INCLUDE_DIRS})
|
||||
set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${AVAHI_COMPAT_INCLUDE_DIRS}")
|
||||
endif ()
|
||||
set(XKBlib "X11/Xlib.h;X11/XKBlib.h")
|
||||
check_symbol_exists("XRRNotifyEvent" "${XKBlib};X11/extensions/Xrandr.h" HAVE_X11_EXTENSIONS_XRANDR_H)
|
||||
|
||||
set (XKBlib "X11/Xlib.h;X11/XKBlib.h")
|
||||
set (CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h")
|
||||
check_type_size ("XRRNotifyEvent" X11_EXTENSIONS_XRANDR_H)
|
||||
set (HAVE_X11_EXTENSIONS_XRANDR_H "${X11_EXTENSIONS_XRANDR_H}")
|
||||
set (CMAKE_EXTRA_INCLUDE_FILES)
|
||||
check_include_files("${XKBlib};X11/extensions/dpms.h" HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
check_include_files("X11/extensions/Xinerama.h" HAVE_X11_EXTENSIONS_XINERAMA_H)
|
||||
check_include_files("${XKBlib};X11/extensions/XKBstr.h" HAVE_X11_EXTENSIONS_XKBSTR_H)
|
||||
check_include_files("X11/extensions/XKB.h" HAVE_XKB_EXTENSION)
|
||||
check_include_files("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H)
|
||||
check_include_files("${XKBlib}" HAVE_X11_XKBLIB_H)
|
||||
check_include_files("X11/extensions/XInput2.h" HAVE_XI2)
|
||||
|
||||
check_include_files ("${XKBlib};X11/extensions/dpms.h" HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
check_include_files ("X11/extensions/Xinerama.h" HAVE_X11_EXTENSIONS_XINERAMA_H)
|
||||
check_include_files ("${XKBlib};X11/extensions/XKBstr.h" HAVE_X11_EXTENSIONS_XKBSTR_H)
|
||||
check_include_files ("X11/extensions/XKB.h" HAVE_XKB_EXTENSION)
|
||||
check_include_files ("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H)
|
||||
check_include_files ("${XKBlib}" HAVE_X11_XKBLIB_H)
|
||||
check_include_files ("X11/extensions/XInput2.h" HAVE_XI2)
|
||||
check_include_files ("dns_sd.h" HAVE_DNSSD)
|
||||
if (HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
# Assume that function prototypes declared, when include exists.
|
||||
set(HAVE_DPMS_PROTOTYPES 1)
|
||||
endif()
|
||||
|
||||
if (NOT HAVE_X11_EXTENSIONS_XTEST_H)
|
||||
message (FATAL_ERROR "Missing header: X11/extensions/XTest.h")
|
||||
endif()
|
||||
if (NOT HAVE_X11_XKBLIB_H)
|
||||
message(FATAL_ERROR "Missing header: " ${XKBlib})
|
||||
endif()
|
||||
|
||||
if (NOT HAVE_X11_XKBLIB_H)
|
||||
message (FATAL_ERROR "Missing header: " ${XKBlib})
|
||||
endif()
|
||||
check_library_exists("SM;ICE" IceConnectionNumber "" HAVE_ICE)
|
||||
check_library_exists("Xext;X11" DPMSQueryExtension "" HAVE_Xext)
|
||||
check_library_exists("Xtst;Xext;X11" XTestQueryExtension "" HAVE_Xtst)
|
||||
check_library_exists("Xinerama" XineramaQueryExtension "" HAVE_Xinerama)
|
||||
check_library_exists("Xi" XISelectEvents "" HAVE_Xi)
|
||||
check_library_exists("Xrandr" XRRQueryExtension "" HAVE_Xrandr)
|
||||
|
||||
if (BARRIER_BUILD_GUI AND NOT HAVE_DNSSD)
|
||||
message (FATAL_ERROR "Missing header: dns_sd.h")
|
||||
endif()
|
||||
if (HAVE_ICE)
|
||||
|
||||
check_library_exists ("SM;ICE" IceConnectionNumber "" HAVE_ICE)
|
||||
check_library_exists ("Xext;X11" DPMSQueryExtension "" HAVE_Xext)
|
||||
check_library_exists ("Xtst;Xext;X11" XTestQueryExtension "" HAVE_Xtst)
|
||||
check_library_exists ("Xinerama" XineramaQueryExtension "" HAVE_Xinerama)
|
||||
check_library_exists ("Xi" XISelectEvents "" HAVE_Xi)
|
||||
check_library_exists ("Xrandr" XRRQueryExtension "" HAVE_Xrandr)
|
||||
# Assume we have SM if we have ICE.
|
||||
set(HAVE_SM 1)
|
||||
list(APPEND libs SM ICE)
|
||||
|
||||
if (HAVE_ICE)
|
||||
endif()
|
||||
|
||||
# Assume we have SM if we have ICE.
|
||||
set (HAVE_SM 1)
|
||||
list (APPEND libs SM ICE)
|
||||
if (HAVE_Xtst)
|
||||
|
||||
endif()
|
||||
# Xtxt depends on X11.
|
||||
set(HAVE_X11)
|
||||
list(APPEND libs Xtst X11)
|
||||
|
||||
if (HAVE_Xtst)
|
||||
else()
|
||||
|
||||
# Xtxt depends on X11.
|
||||
set (HAVE_X11 1)
|
||||
list (APPEND libs Xtst X11)
|
||||
message(FATAL_ERROR "Missing library: Xtst")
|
||||
|
||||
else()
|
||||
endif()
|
||||
|
||||
message (FATAL_ERROR "Missing library: Xtst")
|
||||
if (HAVE_Xext)
|
||||
list(APPEND libs Xext)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
if (HAVE_Xinerama)
|
||||
list(APPEND libs Xinerama)
|
||||
else (HAVE_Xinerama)
|
||||
if (HAVE_X11_EXTENSIONS_XINERAMA_H)
|
||||
set(HAVE_X11_EXTENSIONS_XINERAMA_H 0)
|
||||
message(WARNING "Old Xinerama implementation detected, disabled")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (HAVE_Xext)
|
||||
list (APPEND libs Xext)
|
||||
endif()
|
||||
if (HAVE_Xrandr)
|
||||
list(APPEND libs Xrandr)
|
||||
endif()
|
||||
|
||||
# this was outside of the linux scope,
|
||||
# not sure why, moving it back inside.
|
||||
if(HAVE_Xi)
|
||||
list(APPEND libs Xi)
|
||||
endif()
|
||||
|
||||
if (HAVE_Xinerama)
|
||||
list (APPEND libs Xinerama)
|
||||
else (HAVE_Xinerama)
|
||||
if (HAVE_X11_EXTENSIONS_XINERAMA_H)
|
||||
set (HAVE_X11_EXTENSIONS_XINERAMA_H 0)
|
||||
message (WARNING "Old Xinerama implementation detected, disabled")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (HAVE_Xrandr)
|
||||
list (APPEND libs Xrandr)
|
||||
endif()
|
||||
# For config.h, set some static values; it may be a good idea to make
|
||||
# these values dynamic for non-standard UNIX compilers.
|
||||
set(ACCEPT_TYPE_ARG3 socklen_t)
|
||||
set(HAVE_CXX_BOOL 1)
|
||||
set(HAVE_CXX_CASTS 1)
|
||||
set(HAVE_CXX_EXCEPTIONS 1)
|
||||
set(HAVE_CXX_MUTABLE 1)
|
||||
set(HAVE_CXX_STDLIB 1)
|
||||
set(HAVE_PTHREAD_SIGNAL 1)
|
||||
set(SELECT_TYPE_ARG1 int)
|
||||
set(SELECT_TYPE_ARG234 "(fd_set *)")
|
||||
set(SELECT_TYPE_ARG5 "(struct timeval *)")
|
||||
set(STDC_HEADERS 1)
|
||||
set(TIME_WITH_SYS_TIME 1)
|
||||
set(HAVE_SOCKLEN_T 1)
|
||||
|
||||
# this was outside of the linux scope,
|
||||
# not sure why, moving it back inside.
|
||||
if (HAVE_Xi)
|
||||
list (APPEND libs Xi)
|
||||
endif()
|
||||
# For config.h, save the results based on a template (config.h.in).
|
||||
configure_file(res/config.h.in ${root_dir}/config.h)
|
||||
|
||||
endif()
|
||||
add_definitions(-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H)
|
||||
|
||||
# For config.h, set some static values; it may be a good idea to make
|
||||
# these values dynamic for non-standard UNIX compilers.
|
||||
set (ACCEPT_TYPE_ARG3 socklen_t)
|
||||
set (HAVE_CXX_BOOL 1)
|
||||
set (HAVE_CXX_CASTS 1)
|
||||
set (HAVE_CXX_EXCEPTIONS 1)
|
||||
set (HAVE_CXX_MUTABLE 1)
|
||||
set (HAVE_CXX_STDLIB 1)
|
||||
set (SELECT_TYPE_ARG1 int)
|
||||
set (SELECT_TYPE_ARG234 " (fd_set *)")
|
||||
set (SELECT_TYPE_ARG5 " (struct timeval *)")
|
||||
set (STDC_HEADERS 1)
|
||||
set (TIME_WITH_SYS_TIME 1)
|
||||
set (HAVE_SOCKLEN_T 1)
|
||||
if (APPLE)
|
||||
add_definitions(-DWINAPI_CARBON=1 -D_THREAD_SAFE)
|
||||
else (APPLE)
|
||||
add_definitions(-DWINAPI_XWINDOWS=1)
|
||||
endif()
|
||||
|
||||
# For config.h, save the results based on a template (config.h.in).
|
||||
configure_file (res/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/lib/config.h)
|
||||
else() # not-unix
|
||||
|
||||
add_definitions (-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H)
|
||||
list(APPEND libs Wtsapi32 Userenv Wininet comsuppw Shlwapi)
|
||||
|
||||
if (APPLE)
|
||||
add_definitions (-DWINAPI_CARBON=1 -D_THREAD_SAFE)
|
||||
else()
|
||||
add_definitions (-DWINAPI_XWINDOWS=1)
|
||||
endif()
|
||||
add_definitions(
|
||||
/DWIN32
|
||||
/D_WINDOWS
|
||||
/D_CRT_SECURE_NO_WARNINGS
|
||||
/DVERSION=\"${VERSION}\"
|
||||
)
|
||||
|
||||
if (MSVC_VERSION EQUAL 1600)
|
||||
set(SLN_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/synergy.sln")
|
||||
if (EXISTS "${SLN_FILENAME}" )
|
||||
file(APPEND "${SLN_FILENAME}" "\n# This should be regenerated!\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /D _BIND_TO_CURRENT_VCLIBS_VERSION=1")
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2 /Ob2")
|
||||
|
||||
list (APPEND libs Wtsapi32 Userenv Wininet comsuppw Shlwapi)
|
||||
|
||||
add_definitions (
|
||||
/DSYSAPI_WIN32=1
|
||||
/DWINAPI_MSWINDOWS=1
|
||||
/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1 # tr1 is used from gtest and gmock
|
||||
/DWIN32
|
||||
/D_WINDOWS
|
||||
/D_CRT_SECURE_NO_WARNINGS
|
||||
/DBARRIER_VERSION=\"${BARRIER_VERSION}\"
|
||||
/D_XKEYCHECK_H
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories("${CMAKE_SOURCE_DIR}/ext/gulrak-filesystem/include")
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(ext)
|
||||
|
||||
#
|
||||
# OpenSSL
|
||||
#
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
set (OPENSSL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/ext/openssl/windows)
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set (OPENSSL_ROOT "${OPENSSL_ROOT}/x64")
|
||||
else()
|
||||
set (OPENSSL_ROOT "${OPENSSL_ROOT}/x86")
|
||||
endif()
|
||||
if (WIN32)
|
||||
# TODO: consider using /analyze to uncover potential bugs in the source code.
|
||||
|
||||
include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
|
||||
set (OPENSSL_LIBS
|
||||
${OPENSSL_ROOT}/lib/libeay32.lib
|
||||
${OPENSSL_ROOT}/lib/ssleay32.lib
|
||||
)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
find_program(APT_PROGRAM "apt")
|
||||
find_program(BREW_PROGRAM "brew")
|
||||
find_program(PORT_PROGRAM "port")
|
||||
# /WX - warnings as errors (we have a problem with people checking in code with warnings).
|
||||
# /FR - generate browse information (ncb files) useful for using IDE.
|
||||
# /MP - use multi cores to compile.
|
||||
# /D _BIND_TO_CURRENT_VCLIBS_VERSION - TODO: explain why.
|
||||
# /D _SECURE_SCL=1 - find bugs with iterators.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX /FR /MP /D _BIND_TO_CURRENT_VCLIBS_VERSION=1 /D _SECURE_SCL=1")
|
||||
|
||||
# /MD - use multi-core libraries.
|
||||
# /O2 - get the fastest code.
|
||||
# /Ob2 - expand inline functions (auto-inlining).
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2 /Ob2")
|
||||
|
||||
if (IS_DIRECTORY /opt/procursus AND APT_PROGRAM)
|
||||
# procursus/apt
|
||||
set (OPENSSL_ROOT /opt/procursus)
|
||||
|
||||
include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
|
||||
|
||||
set (OPENSSL_LIBS
|
||||
${OPENSSL_ROOT}/lib/libssl.a
|
||||
${OPENSSL_ROOT}/lib/libcrypto.a
|
||||
)
|
||||
elseif (IS_DIRECTORY /opt/local AND PORT_PROGRAM)
|
||||
# macports
|
||||
set (OPENSSL_ROOT /opt/local)
|
||||
|
||||
set (OPENSSL_LIBS
|
||||
${OPENSSL_ROOT}/lib/libssl.a
|
||||
${OPENSSL_ROOT}/lib/libcrypto.a
|
||||
z
|
||||
)
|
||||
elseif (IS_DIRECTORY /usr/local/opt/openssl AND BREW_PROGRAM)
|
||||
# brew
|
||||
set (OPENSSL_ROOT /usr/local/opt/openssl)
|
||||
|
||||
include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
|
||||
|
||||
set (OPENSSL_LIBS
|
||||
${OPENSSL_ROOT}/lib/libssl.a
|
||||
${OPENSSL_ROOT}/lib/libcrypto.a
|
||||
)
|
||||
elseif (IS_DIRECTORY /opt/homebrew/opt/openssl AND BREW_PROGRAM)
|
||||
# brew
|
||||
set (OPENSSL_ROOT /opt/homebrew/opt/openssl)
|
||||
|
||||
include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
|
||||
|
||||
set (OPENSSL_LIBS
|
||||
${OPENSSL_ROOT}/lib/libssl.a
|
||||
${OPENSSL_ROOT}/lib/libcrypto.a
|
||||
)
|
||||
endif()
|
||||
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set (OPENSSL_LIBS ssl crypto)
|
||||
else()
|
||||
find_library (lib_ssl ssl)
|
||||
find_library (lib_crypto crypto)
|
||||
if (NOT lib_ssl)
|
||||
message(FATAL_ERROR "openssl library not found")
|
||||
elseif (NOT lib_crypto)
|
||||
message(FATAL_ERROR "crypto library not found")
|
||||
endif()
|
||||
set (OPENSSL_LIBS ${lib_ssl} ${lib_crypto})
|
||||
endif()
|
||||
|
||||
#
|
||||
# Configure_file... but for directories, recursively.
|
||||
#
|
||||
macro (configure_files srcDir destDir)
|
||||
message (STATUS "Configuring directory ${destDir}")
|
||||
make_directory (${destDir})
|
||||
|
||||
file (GLOB_RECURSE sourceFiles RELATIVE ${srcDir} ${srcDir}/*)
|
||||
file (GLOB_RECURSE templateFiles LIST_DIRECTORIES false RELATIVE ${srcDir} ${srcDir}/*.in)
|
||||
list (REMOVE_ITEM sourceFiles ${templateFiles})
|
||||
|
||||
foreach (sourceFile ${sourceFiles})
|
||||
set (sourceFilePath ${srcDir}/${sourceFile})
|
||||
if (IS_DIRECTORY ${sourceFilePath})
|
||||
message (STATUS "Copying directory ${sourceFile}")
|
||||
make_directory (${destDir}/${sourceFile})
|
||||
else()
|
||||
message (STATUS "Copying file ${sourceFile}")
|
||||
configure_file (${sourceFilePath} ${destDir}/${sourceFile} COPYONLY)
|
||||
endif()
|
||||
endforeach (sourceFile)
|
||||
|
||||
foreach (templateFile ${templateFiles})
|
||||
set (sourceTemplateFilePath ${srcDir}/${templateFile})
|
||||
string (REGEX REPLACE "\.in$" "" templateFile ${templateFile})
|
||||
message (STATUS "Configuring file ${templateFile}")
|
||||
configure_file (${sourceTemplateFilePath} ${destDir}/${templateFile} @ONLY)
|
||||
endforeach (templateFile)
|
||||
endmacro (configure_files)
|
||||
|
||||
if (${BARRIER_BUILD_INSTALLER})
|
||||
#
|
||||
# macOS app Bundle
|
||||
#
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set (CMAKE_INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks")
|
||||
set (BARRIER_BUNDLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dist/macos/bundle)
|
||||
set (BARRIER_BUNDLE_DIR ${CMAKE_BINARY_DIR}/bundle)
|
||||
set (BARRIER_BUNDLE_APP_DIR ${BARRIER_BUNDLE_DIR}/Barrier.app)
|
||||
set (BARRIER_BUNDLE_BINARY_DIR ${BARRIER_BUNDLE_APP_DIR}/Contents/MacOS)
|
||||
|
||||
configure_files (${BARRIER_BUNDLE_SOURCE_DIR} ${BARRIER_BUNDLE_DIR})
|
||||
|
||||
add_custom_target(Barrier_MacOS ALL
|
||||
bash build_dist.sh
|
||||
DEPENDS barrier barriers barrierc
|
||||
WORKING_DIRECTORY ${BARRIER_BUNDLE_DIR})
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "IRIX")
|
||||
set_target_properties(synergys PROPERTIES LINK_FLAGS "-all -woff 33 -woff 84 -woff 15")
|
||||
set_target_properties(synergyc PROPERTIES LINK_FLAGS "-all -woff 33 -woff 84 -woff 15")
|
||||
set_target_properties(synergyd PROPERTIES LINK_FLAGS "-all -woff 33 -woff 84 -woff 15")
|
||||
endif()
|
||||
|
||||
#
|
||||
# Windows installer
|
||||
#
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
set (BARRIER_WIX_VERSION "${BARRIER_VERSION_MAJOR}.${BARRIER_VERSION_MINOR}.${BARRIER_VERSION_PATCH}")
|
||||
message (STATUS "Configuring the wix installer")
|
||||
configure_files (${CMAKE_CURRENT_SOURCE_DIR}/dist/wix ${CMAKE_BINARY_DIR}/installer-wix)
|
||||
message (STATUS "Configuring the inno installer")
|
||||
configure_files (${CMAKE_CURRENT_SOURCE_DIR}/dist/inno ${CMAKE_BINARY_DIR}/installer-inno)
|
||||
if (CONF_CPACK)
|
||||
message(FATAL_ERROR "CPack support has been removed.")
|
||||
endif()
|
||||
|
||||
#
|
||||
# Linux installation
|
||||
#
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
configure_files (${CMAKE_CURRENT_SOURCE_DIR}/dist/rpm ${CMAKE_BINARY_DIR}/rpm)
|
||||
install(FILES res/barrier.svg DESTINATION share/icons/hicolor/scalable/apps)
|
||||
if("${VERSION_MAJOR}" STREQUAL "2")
|
||||
install(FILES res/barrier2.desktop DESTINATION share/applications)
|
||||
else()
|
||||
install(FILES res/barrier.desktop DESTINATION share/applications)
|
||||
endif()
|
||||
if (CONF_DOXYGEN)
|
||||
|
||||
set(VERSION, "${VERSION}")
|
||||
|
||||
# For doxygen.cfg, save the results based on a template (doxygen.cfg.in).
|
||||
configure_file(${cmake_dir}/doxygen.cfg.in ${doc_dir}/doxygen.cfg)
|
||||
|
||||
endif()
|
||||
|
||||
else()
|
||||
message (STATUS "NOT configuring the installer")
|
||||
endif()
|
||||
|
||||
enable_testing()
|
||||
|
||||
add_subdirectory (src)
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
Copyright (C) 2018 Debauchee Open Source Group
|
||||
Copyright (C) 2012-2016 Symless Ltd.
|
||||
synergy -- mouse and keyboard sharing utility
|
||||
Copyright (C) 2012-2014 Synergy Si Ltd.
|
||||
Copyright (C) 2008-2014 Nick Bolton
|
||||
Copyright (C) 2002-2014 Chris Schoeneman
|
||||
|
||||
This program is released under the GPL with the additional exemption
|
||||
that compiling, linking, and/or using OpenSSL is allowed.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
|
@ -286,62 +283,3 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
217
ChangeLog
217
ChangeLog
|
@ -1,219 +1,3 @@
|
|||
v1.9.0-rc3
|
||||
============
|
||||
Bug #4132 - Laggy mouse cursor on macOS clients
|
||||
|
||||
v1.9.0-rc2
|
||||
===========
|
||||
Bug #5901 - Stored serial key corrupted on macOS
|
||||
Bug #5757 - Failure to build against OpenSSL v1.1.0
|
||||
|
||||
v1.9.0-rc1
|
||||
==========
|
||||
Bug #5467 - Failing to automatically download and install Bonjour
|
||||
Enhancement #5389 - Ported GUI to Qt 5
|
||||
Enhancement #4978 - Windows: Added support for Visual Studio 2015
|
||||
Enhancement #5398 - Windows: Updated OpenSSL dependency to 1.0.2k
|
||||
|
||||
v1.8.8-stable
|
||||
==========
|
||||
Bug #5196 - Some keys on Korean and Japanese keyboards have the same keycode
|
||||
Bug #5578 - Pressing Hangul key results in alt+'a'
|
||||
Bug #5785 - Can't switch screens when cursor is in a corner
|
||||
Bug #3992 - macOS: Dragging is broken in Unity 3D
|
||||
Bug #5075 - macOS: Build fails on macOS 10.9 due to unknown compiler flag
|
||||
Bug #5809 - macOS: No version number is shown in the App Info dialog
|
||||
Bug #3197 - Linux: switchDoubleTap option is not working
|
||||
Bug #4477 - Linux: Mouse buttons higher than id 10 result in crash
|
||||
Bug #5832 - Linux: Screen size misdetected on multi-monitor display
|
||||
Enhancement #4504 - Improved Korean language description
|
||||
Enhancement #5525 - Added support for precise screen positioning in config file
|
||||
Enhancement #4290 - Windows: Removed annoying alt+print screen functionality
|
||||
|
||||
v1.8.7-stable
|
||||
=============
|
||||
Bug #5784 - Edition changes when reopening GUI
|
||||
|
||||
v1.8.6-stable
|
||||
=============
|
||||
Bug #5592 - Some keys don't work for macOS Sierra clients
|
||||
Bug #5186 - Cursor stuck on client when using multi-DPI server
|
||||
Bug #5722 - Malformed serial key in registry will crash GUI on startup
|
||||
Bug #5752 - Tab order is incorrect on Settings dialog
|
||||
Enhancement #5699 - Unified installers on macOS
|
||||
Feature #4836 - macOS Sierra build
|
||||
|
||||
v1.8.5-stable
|
||||
=============
|
||||
Bug #5680 - Server crashes when disconnecting SSL clients
|
||||
Bug #5626 - Build fails using Xcode 8 and macOS SDK 10.12
|
||||
Feature #5657 - Trial version support
|
||||
Feature #5707 - User upgrade statistics
|
||||
|
||||
v1.8.4-stable
|
||||
=============
|
||||
Bug #5183 - Slowly moving the cursor has no effect on high DPI clients
|
||||
Bug #4041 - UHD/4K DPI scaling broken on Windows servers
|
||||
Bug #4420 - When XRandR adds a screen, it is inaccessible
|
||||
Bug #5603 - Activation notification depends on existence of /etc/os-release
|
||||
Bug #5624 - Update notification sometimes requests a downgrade
|
||||
Bug #5329 - Current date is shown for build date in the about dialog
|
||||
Enhancement #5617 - Remove redundant plugin infrastructure
|
||||
Enhancement #5627 - Move SSL certificate generation to main window
|
||||
Enhancement #5628 - Move SSL implementation into core binary
|
||||
Enhancement #5629 - Move activation from wizard into new dialog window
|
||||
|
||||
v1.8.3-stable
|
||||
=============
|
||||
Bug #2765 - A letter appears on macOS clients when the spacebar is pressed
|
||||
Bug #3241 - Windows UAC disconnects clients when elevated
|
||||
Bug #4740 - Linux client crashes with "Assertion '!m_open' failed"
|
||||
Bug #4879 - Memory leak caused by IpcReader
|
||||
Bug #5373 - Tab behaves like shift tab on client
|
||||
Bug #5502 - Copy and paste from server to client doesn't work
|
||||
Enhancement #123 - Option to disable clipboard sharing
|
||||
Enhancement #3305 - Media key support on macOS
|
||||
Enhancement #4323 - Make automatic elevation on Windows optional
|
||||
|
||||
v1.8.2-stable
|
||||
=============
|
||||
Bug #3044 - Unable to drag-select in MS Office
|
||||
Bug #4768 - Copy paste causes 'server is dead' error on switching
|
||||
Bug #4792 - Server logging crashes when switching with clipboard data
|
||||
Bug #2975 - Middle click does not close Chrome tab on Mac client
|
||||
Bug #5087 - Linux client fails to start due to invalid cursor size
|
||||
Bug #5471 - Serial key textbox on activation screen overflows on Mac
|
||||
Bug #4836 - Stop button resets to Start when settings dialog canceled
|
||||
Enhancement #5277 - Auto restart service when synwinhk.dll fails on Windows
|
||||
Enhancement #4913 - Future-proof GUI login by using newer auth URL
|
||||
Enhancement #4922 - Add --enable-crypto argument to help text
|
||||
Enhancement #5299 - High resolution App icon on Mac
|
||||
Enhancement #4894 - Improve grammar in connection notification dialog
|
||||
|
||||
v1.8.1-stable
|
||||
=============
|
||||
Bug #5461 - GUI crash during activation on Mac
|
||||
|
||||
v1.8.0-beta
|
||||
=============
|
||||
Enhancement #4696 - Include 'ns' plugin in installers (instead of wizard download)
|
||||
Enhancement #4715 - Activation dialog which also accepts a serial key
|
||||
Enhancement #5020 - Recommend using serial key when online activation fails
|
||||
Enhancement #4893 - Show detailed version info on GUI about screen
|
||||
Enhancement #4327 - GUI setting to disable drag and drop feature
|
||||
Enhancement #4793 - Additional logging to output OpenSSL version
|
||||
Enhancement #4932 - Notify activation system when wizard finishes
|
||||
Enhancement #4716 - Allow software to be time limited with serial key
|
||||
|
||||
v1.7.6-stable
|
||||
=============
|
||||
Bug #451 - Fast cursor on any client with Mac server
|
||||
Bug #5041 - Copying from the Chrome web browser doesn't work
|
||||
Bug #4735 - Clipboard doesn't work from client to server
|
||||
Bug #2909 - Clipboard copies only plaintext between Mac and Windows
|
||||
Bug #4353 - Large clipboard causes crash
|
||||
Bug #3774 - Missing MinGW dependencies after install on Windows
|
||||
Bug #4723 - Waiting for active desktop result freezes Windows service
|
||||
|
||||
v1.7.5-stable
|
||||
=============
|
||||
Bug #5030 - Display scaling breaks edge detection on Windows
|
||||
Bug #5064 - Compile fails on Mac OS X 10.11 (unused typedef)
|
||||
|
||||
v1.7.4-stable
|
||||
=============
|
||||
Bug #4721 - High CPU usage for Windows service
|
||||
Bug #4750 - SSL connect error 'passive ssl error limit'
|
||||
Bug #4584 - Drag and drop with SSL causes crash
|
||||
Bug #4749 - Clipboard thread race condition causes assertion failure
|
||||
Bug #4720 - Plugin download shows 'Could not get Linux package type' error
|
||||
Bug #4712 - Unable to send clipboard with size above 1KB when using SSL
|
||||
Bug #4642 - Connecting causes SSL23_GET_SERVER_HELLO error
|
||||
Bug #4690 - Log line 'activeDesktop' does not use logging system
|
||||
Bug #4866 - Wrong ns plugin version can be loaded
|
||||
Enhancement #4901 - Auto restart when running from GUI in desktop mode
|
||||
Enhancement #4845 - Add timestamp to log output
|
||||
Enhancement #4898 - Move version stage name to build config
|
||||
|
||||
v1.7.3-stable
|
||||
=============
|
||||
Bug #4565 - Incorrect plugin downloads on Debian and Mint
|
||||
Bug #4677 - Windows service log file grows to very large size
|
||||
Bug #4651 - High logging rate causes Windows service to crash
|
||||
Bug #4650 - SSL error log message repeats excessively and freezes cursor
|
||||
Bug #4624 - Runaway logging causes GUI to freeze
|
||||
Bug #4617 - Windows service randomly stops after 'ssl handshake failure' error
|
||||
Bug #4601 - Large clipboard data with SSL causes 'protocol is shutdown' error
|
||||
Bug #4593 - Locking Windows server causes SSL_ERROR_SSL to repeat
|
||||
Bug #4577 - Memory leak in GUI on Windows caused by logging
|
||||
Bug #4538 - Windows service crashes intermittently with no error
|
||||
Bug #4341 - GUI freezes on first load when reading log
|
||||
Bug #4566 - Client or server crashes with 'ssl handshake failure' error
|
||||
Bug #4706 - Installer is not output to build config dir on Windows
|
||||
Bug #4704 - Plugin 'ns' release build is overwritten with debug version on Linux
|
||||
Bug #4703 - Plugins are not built to config directory on Mac
|
||||
Bug #4697 - Timing can allow an SSL socket to be used after cleanup call
|
||||
Enhancement #4661 - Log error but do not crash when failing to load plugins
|
||||
Enhancement #4708 - Download ns plugin for specific Mac versions
|
||||
Enhancement #4587 - Include OpenSSL binaries in source for easier building
|
||||
Enhancement #4695 - Automatically upload plugins as Buildbot step
|
||||
|
||||
v1.7.2-stable
|
||||
=============
|
||||
Bug #4564 - Modifier keys often stuck down on Mac client
|
||||
Bug #4581 - Starting GUI on Mac crashes instantly on syntool segfault
|
||||
Bug #4520 - Laggy or sluggish cursor (ping spikes) on Mac when using WiFi
|
||||
Bug #4607 - GUI doesn't start after install on Windows
|
||||
Enhancement #4412 - Automate extract and compile for OpenSSL
|
||||
Enhancement #4567 - SSL plugin should use TLSv1_method() minimum
|
||||
Enhancement #4591 - Revert to legacy Mac deployment and signing
|
||||
Enhancement #4569 - Reintroduce GUI auto-hide setting (disabled by default)
|
||||
Enhancement #4570 - Make `--crypto-pass` show deprecated message
|
||||
Enhancement #4596 - Typo 'occurred' in WebClient.cpp
|
||||
|
||||
v1.7.1-stable
|
||||
=============
|
||||
Bug #3784 - Double click & drag doesn't select words on client
|
||||
Bug #3052 - Triple-click (select line) does not work
|
||||
Bug #4367 - Duplicate Alt-S Keyboard Shortcuts on Gui
|
||||
Bug #4554 - Server unable to accept new SSL connection
|
||||
Bug #4553 - SSL handshake failure error causes GUI to crash
|
||||
Bug #4551 - Plugin wizard doesn't create SSL directory
|
||||
Bug #4548 - Severe code duplication in fingerprint logic
|
||||
Bug #4547 - Windows server crashes when client fingerprint dialog open
|
||||
Bug #4539 - Mac client dies when server has SSL_ERROR_SSL
|
||||
Bug #4537 - Plugin wizard doesn't complete but finish button enabled
|
||||
Bug #4535 - Server crashes on shut down after multiple connections failed
|
||||
Bug #4528 - Error SSL_ERROR_SSL is logged on unknown error
|
||||
Bug #4527 - Server fingerprint dialog on client GUI keeps showing
|
||||
Bug #4469 - GUI crashes on Windows when generating certificate
|
||||
Bug #4410 - SSL_ERROR_SSL (unknown protocol) on Mac client
|
||||
Bug #4409 - SSL_ERROR_SSL (unknown alert type) on Windows 8.1 client
|
||||
Bug #4557 - GUI doesn't show local fingerprint on fresh install
|
||||
Enhancement #4522 - SSL server fingerprint verification from client
|
||||
Enhancement #4526 - Display local fingerprint on server GUI
|
||||
Enhancement #4549 - Extract SSL certificate and fingerprint generate function
|
||||
Enhancement #4546 - Redistribute OpenSSL on Windows with installer
|
||||
Enhancement #4540 - Enable Network Security checkbox only when ns plugin exists
|
||||
Enhancement #4525 - Reorganize app data directory
|
||||
Enhancement #4390 - Disable GUI auto-hide by default
|
||||
|
||||
v1.7.0-beta
|
||||
===========
|
||||
Enhancement #4313 - SSL encrypted secure connection
|
||||
Enhancement #4168 - Plugin manager for GUI
|
||||
Enhancement #4307 - Always show client auto-detect dialog
|
||||
Enhancement #4397 - Modernize Mac build script (deployment and signing)
|
||||
Enhancement #4398 - Remove obsolete Mac database cleaner
|
||||
Enhancement #4337 - Remove IStreamFilterFactory dead code
|
||||
|
||||
1.6.3
|
||||
=====
|
||||
Bug #4349 - Mouse click does not always bring window to front
|
||||
Bug #4463 - Unidentified developer error on Mac OS X
|
||||
Bug #4464 - Code signing verify failure not reported on Mac build
|
||||
Bug #4465 - Binary (syntool) is not code signed on Windows
|
||||
Enhancement #4455 - Replace version with branch name in package filename
|
||||
|
||||
1.6.2
|
||||
=====
|
||||
Bug #4227 - Helper tool crashes when service checks elevation state
|
||||
|
@ -423,4 +207,3 @@ Feature #3119: Mac OS X secondary screen
|
|||
Task #2905: Unit tests: Clipboard classes
|
||||
Task #3072: Downgrade Linux build machines
|
||||
Task #3090: CXWindowsKeyState integ test args wrong
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Help: http://synergy-project.org/help/
|
||||
Wiki: http://synergy-project.org/wiki/
|
|
@ -0,0 +1,16 @@
|
|||
Synergy
|
||||
=======
|
||||
|
||||
Share one mouse and keyboard between multiple computers.
|
||||
|
||||
Synergy is free and open source (free as in free speech),
|
||||
meaning you are free to run it and redistribute it with
|
||||
or without changes.
|
||||
|
||||
Just use "hm conf" and "hm build" to compile (./hm.sh on
|
||||
Linux and Mac).
|
||||
|
||||
For detailed compile instructions:
|
||||
http://synergy-project.org/wiki/Compiling
|
||||
|
||||
Happy hacking!
|
148
README.md
148
README.md
|
@ -1,148 +0,0 @@
|
|||
# Barrier
|
||||
|
||||
Eliminate the barrier between your machines.
|
||||
Find [releases for windows and macOS here](https://github.com/debauchee/barrier/releases).
|
||||
Your distro probably already has barrier packaged for it, see [distro specific packages](#distro-specific-packages)
|
||||
below for a list. Alternatively, we also provide a [flatpak](https://github.com/flathub/com.github.debauchee.barrier)
|
||||
and a [snap](https://snapcraft.io/barrier).
|
||||
|
||||
### Contact info:
|
||||
|
||||
- `#barrier` on LiberaChat IRC network
|
||||
|
||||
#### CI Build Status
|
||||
|
||||
Master branch overall build status: [](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)
|
||||
|
||||
|Platform |Build Status|
|
||||
| --:|:-- |
|
||||
|Linux |[](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)|
|
||||
|Mac |[](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)|
|
||||
|Windows Debug |[](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)|
|
||||
|Windows Release|[](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)|
|
||||
|Snap |[](https://build.snapcraft.io/user/debauchee/barrier)|
|
||||
|
||||
Our CI Builds are provided by Microsoft Azure Pipelines, Flathub, and Canonical.
|
||||
|
||||
### What is it?
|
||||
|
||||
Barrier is software that mimics the functionality of a KVM switch, which historically would allow you to use a single keyboard and mouse to control multiple computers by physically turning a dial on the box to switch the machine you're controlling at any given moment. Barrier does this in software, allowing you to tell it which machine to control by moving your mouse to the edge of the screen, or by using a keypress to switch focus to a different system.
|
||||
|
||||
Barrier was forked from Symless's Synergy 1.9 codebase. Synergy was a commercialized reimplementation of the original CosmoSynergy written by Chris Schoeneman.
|
||||
|
||||
At the moment, barrier is not compatible with synergy. Barrier needs to be installed on all machines that will share keyboard and mouse.
|
||||
|
||||
### What's different?
|
||||
|
||||
Whereas Synergy has moved beyond its goals from the 1.x era, Barrier aims to maintain that simplicity.
|
||||
Barrier will let you use your keyboard and mouse from one computer to control one or more other computers.
|
||||
Clipboard sharing is supported.
|
||||
That's it.
|
||||
|
||||
### Project goals
|
||||
|
||||
Hassle-free reliability. We are users, too. Barrier was created so that we could solve the issues we had with synergy and then share these fixes with other users.
|
||||
|
||||
Compatibility. We use more than one operating system and you probably do, too. Windows, OSX, Linux, FreeBSD... Barrier should "just work". We will also have our eye on Wayland when the time comes.
|
||||
|
||||
Communication. Everything we do is in the open. Our issue tracker will let you see if others are having the same problem you're having and will allow you to add additional information. You will also be able to see when progress is made and how the issue gets resolved.
|
||||
|
||||
### Usage
|
||||
|
||||
Install and run barrier on each machine that will be sharing.
|
||||
On the machine with the keyboard and mouse, make it the server.
|
||||
|
||||
Click the "Configure server" button and drag a new screen onto the grid for each client machine.
|
||||
Ensure the "screen name" matches exactly (case-sensitive) for each configured screen -- the clients' barrier windows will tell you their screen names (just above the server IP).
|
||||
|
||||
On the client(s), put in the server machine's IP address (or use Bonjour/auto configuration when prompted) and "start" them.
|
||||
You should see `Barrier is running` on both server and clients.
|
||||
You should now be able to move the mouse between all the screens as if they were the same machine.
|
||||
|
||||
Note that if the keyboard's Scroll Lock is active then this will prevent the mouse from switching screens.
|
||||
|
||||
### Contact & support
|
||||
|
||||
Please be aware that the *only* way to draw our attention to a bug is to create a new issue in [the issue tracker](https://github.com/debauchee/barrier/issues). Write a clear, concise, detailed report and you will get a clear, concise, detailed response. Priority is always given to issues that affect a wider range of users.
|
||||
|
||||
For short and simple questions or to just say hello find us on the LiberaChat IRC network in the #barrier channel.
|
||||
|
||||
### Contributions
|
||||
|
||||
At this time we are looking for developers to help fix the issues found in the issue tracker.
|
||||
Submit pull requests once you've polished up your patch and we'll review and possibly merge it.
|
||||
|
||||
Most pull requests will need to include a release note.
|
||||
See docs/newsfragments/README.md for documentation of how to do that.
|
||||
|
||||
## Distro specific packages
|
||||
|
||||
While not a comprehensive list, repology provides a decent list of distro
|
||||
specific packages.
|
||||
|
||||
[](https://repology.org/project/barrier/versions)
|
||||
|
||||
## FAQ - Frequently Asked Questions
|
||||
|
||||
**Q: Does drag and drop work on linux?**
|
||||
|
||||
> A: No *(see [#855](https://github.com/debauchee/barrier/issues/855) if you'd like to change that)*
|
||||
|
||||
|
||||
**Q: What OSes are supported?**
|
||||
|
||||
> A: The [most recent release](https://github.com/debauchee/barrier/releases/latest) of Barrier is known to work on:
|
||||
> - Windows 7, 8, 8.1, 10, and 11
|
||||
> - macOS *(previously known as OS X or Mac OS X)*
|
||||
> - _The current GUI does **not** work on OS versions prior to macOS 10.12 Sierra (but see the related answer below)_
|
||||
> - Linux
|
||||
> - FreeBSD
|
||||
> - OpenBSD
|
||||
|
||||
|
||||
**Q: Are 32-bit versions of Windows supported?**
|
||||
|
||||
> A: No
|
||||
|
||||
|
||||
__Q: Is it possible to use Barrier on Mac OS X / OS X versions prior to 10.12?__
|
||||
|
||||
> A: Not officially.
|
||||
> - For OS X 10.10 Yosemite and later:
|
||||
> - [Barrier v2.1.0](https://github.com/debauchee/barrier/releases/tag/v2.1.0) or earlier _may_ work.
|
||||
> - For Mac OS X 10.9 Mavericks _(and perhaps earlier)_:
|
||||
> 1. the command-line portions of the [current release](https://github.com/debauchee/barrier/releases/latest) _should_ run fine.
|
||||
> 2. The GUI will _not_ run, as that OS version does not include Apple's *Metal* framework.
|
||||
> - _(For a GUI workaround for Mac OS X 10.9, see the [discussion at issue #544](https://github.com/debauchee/barrier/issues/544))_
|
||||
|
||||
> Note: Only versions [v2.3.4](https://github.com/debauchee/barrier/releases/tag/v2.3.4) and [later](https://github.com/debauchee/barrier/releases/latest) of Barrier can be supported by this project.
|
||||
> - Anyone using an earlier version is advised to upgrade due to recently-addressed security vulnerabilities *(and other bug fixes)*.
|
||||
> - This is especially important for computers accessible from the public Internet *(or from other shared/untrusted networks, such as when using shared WiFi)*.
|
||||
|
||||
|
||||
**Q: How do I load my configuration on startup?**
|
||||
|
||||
> A: Start the binary with the argument `--config <path_to_saved_configuration>`
|
||||
|
||||
|
||||
**Q: After loading my configuration on the client the field 'Server IP' is still empty!**
|
||||
|
||||
> A: Edit your configuration to include the server's ip address manually with
|
||||
>
|
||||
>```
|
||||
>(...)
|
||||
>
|
||||
>section: options
|
||||
> serverhostname=<AAA.BBB.CCC.DDD>
|
||||
>```
|
||||
|
||||
**Q: Are there any other significant limitations with the current version of Barrier?**
|
||||
|
||||
> A: Currently:
|
||||
> - Barrier currently has limited UTF-8 support; issues have been reported with processing various languages.
|
||||
> - *(see [#860](https://github.com/debauchee/barrier/issues/860))*
|
||||
> - There is interest in future support for the Wayland compositor/display server protocol *([official site](https://wayland.freedesktop.org/) | [Wikipedia article](https://en.wikipedia.org/wiki/Wayland_(display_server_protocol)))* on Linux.
|
||||
> - As of late 2021, there is no expected completion date for *Wayland* support.
|
||||
> - *(see [#109](https://github.com/debauchee/barrier/issues/109) and [#1251](https://github.com/debauchee/barrier/issues/1251) for status or to volunteer your talents)*
|
||||
>
|
||||
> The complete list of open issues can be found in the ['Issues' tab on GitHub](https://github.com/debauchee/barrier/issues?q=is%3Aissue+is%3Aopen). Help is always appreciated.
|
76
RELEASING.md
76
RELEASING.md
|
@ -1,76 +0,0 @@
|
|||
Creating a release
|
||||
==================
|
||||
|
||||
This document is documentation intednded for maintainers of Barrier.
|
||||
It documents the release process of Barrier.
|
||||
|
||||
Step 1: Setup environment variables
|
||||
-----------------------------------
|
||||
|
||||
Setup the following environment variable that will be used throughout the rest of the steps.
|
||||
|
||||
export VERSION=X.Y.Z
|
||||
|
||||
Step 2: Release notes PR
|
||||
------------------------
|
||||
|
||||
Open a new branch (e.g. `release`) and run the following:
|
||||
|
||||
towncrier --version ${VERSION} --date `date -u +%F`
|
||||
|
||||
This collects the release notes using the `towncrier` tool. Please commit the collected release
|
||||
notes afterwards.
|
||||
|
||||
Certain file names are not properly supported by the `towncrier` tool and it ignores them.
|
||||
Check `newsfragments` directory for any forgotten release notes
|
||||
|
||||
Step 3: Merge the release notes PR
|
||||
----------------------------------
|
||||
|
||||
Step 4: Bump the version number
|
||||
-------------------------------
|
||||
|
||||
Pull the merge commit created on the `master` branch during the step 2.
|
||||
|
||||
Edit the following files and update the version numbers:
|
||||
|
||||
- `Build.properties`
|
||||
- `cmake/Version.cmake`
|
||||
- `doc/barrierc.1`
|
||||
- `doc/barriers.1`
|
||||
- `.github/ISSUE_TEMPLATE/bug_report.yml`
|
||||
|
||||
Commit to the release branch with the following message `Barrier x.y.z`.
|
||||
|
||||
Push the commit:
|
||||
|
||||
git push origin master
|
||||
|
||||
Step 5: Push git tag
|
||||
--------------------
|
||||
|
||||
Create a tag:
|
||||
|
||||
git tag -s v${VERSION} -m v${VERSION}
|
||||
|
||||
Push the tag:
|
||||
|
||||
git push origin master --tags
|
||||
|
||||
|
||||
Step 6: Draft a new release on Github
|
||||
-------------------------------------
|
||||
|
||||
Go to https://github.com/buildbot/buildbot/releases and draft a new release.
|
||||
|
||||
Use git tag as the title of the release: `vX.Y.Z`.
|
||||
|
||||
Use the release notes generated by the `towncrier` tool as the description of the releases.
|
||||
|
||||
Upload the artifacts created by Azure pipelines as the binaries of the release. The following
|
||||
artifacts should be uploaded to Github:
|
||||
|
||||
- the Barrier-X.Y.Z-release.dmg created by the newest Mac OS task (artifact name is
|
||||
"Mac Release Disk Image and App XYZ").
|
||||
|
||||
- the BarrierSetup-X.Y.Z-release.exe (artifact name is Windows Release Installer).
|
|
@ -1 +0,0 @@
|
|||
theme: jekyll-theme-slate
|
|
@ -1,117 +0,0 @@
|
|||
trigger:
|
||||
tags:
|
||||
include:
|
||||
- '*'
|
||||
branches:
|
||||
include:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
- job: WinBuild
|
||||
displayName: Windows Build
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
strategy:
|
||||
matrix:
|
||||
Debug:
|
||||
CI_ENV_BUILD_TYPE: Debug
|
||||
Release with Release Installer:
|
||||
CI_ENV_BUILD_TYPE: Release
|
||||
steps:
|
||||
# Gather Dependencies
|
||||
- task: PowerShell@2
|
||||
displayName: Download Bonjour SDK-like
|
||||
inputs:
|
||||
filePath: azure-pipelines/download_install_bonjour_sdk_like.ps1
|
||||
- task: UsePythonVersion@0
|
||||
displayName: Selecting Python Installer for QLI Installer
|
||||
inputs:
|
||||
versionSpec: '3.7'
|
||||
- task: PowerShell@2
|
||||
displayName: Installing QT
|
||||
condition: ne(variables['CacheRestored'], 'true')
|
||||
inputs:
|
||||
filePath: azure-pipelines/download_install_qt.ps1
|
||||
# Build time!
|
||||
- powershell: Copy-Item azure-pipelines\build_env_tmpl.bat build_env.bat
|
||||
displayName: Layering Azure Pipeline's build_env.bat
|
||||
- script: |
|
||||
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\vsdevcmd" -arch=x64 && clean_build.bat
|
||||
displayName: Clean Build
|
||||
- task: ArchiveFiles@2
|
||||
displayName: Archive Completed Build Directory
|
||||
inputs:
|
||||
rootFolderOrFile: build\bin\$(CI_ENV_BUILD_TYPE)\
|
||||
includeRootFolder: true
|
||||
archiveFile: $(Build.ArtifactStagingDirectory)\$(CI_ENV_BUILD_TYPE).zip
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Completed Build Directory Archive Build Artifact
|
||||
inputs:
|
||||
pathtoPublish: $(Build.ArtifactStagingDirectory)\$(CI_ENV_BUILD_TYPE).zip
|
||||
artifactName: Windows $(CI_ENV_BUILD_TYPE)
|
||||
- script: choco install innosetup --version 5.6.1.20190126 --allow-downgrade
|
||||
displayName: Ensure desired version of Inno Setup is installed.
|
||||
condition: eq(variables['CI_ENV_BUILD_TYPE'], 'Release')
|
||||
- script: build_installer.bat
|
||||
displayName: Build Installer
|
||||
condition: eq(variables['CI_ENV_BUILD_TYPE'], 'Release')
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Release Installer
|
||||
condition: eq(variables['CI_ENV_BUILD_TYPE'], 'Release')
|
||||
inputs:
|
||||
pathtoPublish: build\installer-inno\bin
|
||||
artifactName: Windows Release Installer
|
||||
|
||||
- job: LinuxBuild
|
||||
strategy:
|
||||
matrix:
|
||||
ubuntu-18.04:
|
||||
imageName: 'ubuntu-18.04'
|
||||
ubuntu-20.04:
|
||||
imageName: 'ubuntu-20.04'
|
||||
displayName: Linux Build
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
steps:
|
||||
- script: sudo apt-get update -y
|
||||
- script: sudo apt-get install -y libxtst-dev qtdeclarative5-dev libavahi-compat-libdnssd-dev libcurl4-openssl-dev
|
||||
displayName: Install Dependencies
|
||||
- script: sh -x ./clean_build.sh
|
||||
displayName: Clean Build
|
||||
|
||||
- job: MacBuild
|
||||
displayName: Mac Build
|
||||
strategy:
|
||||
matrix:
|
||||
big-sur-Release:
|
||||
imageName: "macOS-11"
|
||||
B_BUILD_TYPE: Release
|
||||
BARRIER_VERSION_STAGE: Release
|
||||
catalina-Release:
|
||||
imageName: "macOS-10.15"
|
||||
B_BUILD_TYPE: Release
|
||||
BARRIER_VERSION_STAGE: Release
|
||||
mojave-Release:
|
||||
imageName: "macOS-10.14"
|
||||
B_BUILD_TYPE: Release
|
||||
BARRIER_VERSION_STAGE: Release
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
variables:
|
||||
VERBOSE: 1
|
||||
TERM: xterm-256color
|
||||
steps:
|
||||
- script: rm -rf /usr/local/opt/openssl
|
||||
displayName: Remove incompatible OpenSSL 1.0.2t from macOS-10.14 vmImage
|
||||
- script: brew reinstall openssl
|
||||
displayName: Installed newer OpenSSL 1.1.x
|
||||
- script: brew install pkg-config qt5
|
||||
displayName: Install Qt5 and pkg-config prereqs
|
||||
- script: sh -x ./clean_build.sh
|
||||
displayName: Clean Build
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Release DMG
|
||||
condition: eq(variables['B_BUILD_TYPE'], 'Release')
|
||||
inputs:
|
||||
pathtoPublish: build/bundle
|
||||
artifactName: Mac Release Disk Image and App $(imageName)
|
|
@ -1,6 +0,0 @@
|
|||
set B_BUILD_TYPE=%CI_ENV_BUILD_TYPE%
|
||||
set B_QT_ROOT=%cd%\deps\Qt
|
||||
set B_QT_VER=Qt5.13.0\5.13.0
|
||||
set B_QT_MSVC=msvc2017_64
|
||||
set B_BONJOUR=%cd%\deps\BonjourSDKLike
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
$ErrorActionPreference = "Stop"
|
||||
|
||||
New-Item -Force -ItemType Directory -Path ".\deps\"
|
||||
Invoke-WebRequest 'https://github.com/nelsonjchen/mDNSResponder/releases/download/v2019.05.08.1/x64_RelWithDebInfo.zip' -OutFile 'deps\BonjourSDKLike.zip' ;
|
||||
Write-Output 'Downloaded BonjourSDKLike Zip'
|
||||
Write-Output 'Unzipping BonjourSDKLike Zip'
|
||||
Remove-Item -Recurse -Force -ErrorAction Ignore .\deps\BonjourSDKLike
|
||||
Expand-Archive .\deps\BonjourSDKLike.zip -DestinationPath .\deps\BonjourSDKLike
|
||||
Write-Output 'Installed BonjourSDKLike Zip'
|
||||
Remove-Item deps\BonjourSDKLike.zip
|
||||
Write-Output 'Deleted BonjourSDKLike Zip'
|
|
@ -1,25 +0,0 @@
|
|||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$qli_install_version = '2019.05.26.1'
|
||||
$qt_version = '5.13.0'
|
||||
|
||||
New-Item -Force -ItemType Directory -Path ".\deps\"
|
||||
|
||||
Write-Output 'Downloading QLI Installer'
|
||||
Invoke-WebRequest "https://github.com/nelsonjchen/qli-installer/archive/v$qli_install_version.zip" -OutFile '.\deps\qli-installer.zip' ;
|
||||
Write-Output 'Downloaded QLI Installer'
|
||||
|
||||
Write-Output 'Extracting QLI Installer'
|
||||
Expand-Archive deps\qli-installer.zip deps\
|
||||
Move-Item .\deps\qli-installer-$qli_install_version\ .\deps\qli-installer
|
||||
Write-Output 'Extracted QLI Installer'
|
||||
|
||||
Write-Output 'Installing QLI Installer Dependencies'
|
||||
pip install -r .\deps\qli-installer\requirements.txt
|
||||
Write-Output 'Installed QLI Installer Dependencies'
|
||||
|
||||
Write-Output 'Starting QT Installer'
|
||||
$Env:QLI_OUT_DIR = ".\deps\Qt\Qt$qt_version"
|
||||
$Env:QLI_BASE_URL = "https://download.qt.io/online/qtsdkrepository/"
|
||||
python .\deps\qli-installer\qli-installer.py $qt_version windows desktop win64_msvc2017_64
|
||||
Write-Output 'Installed QT Installer'
|
|
@ -1,34 +0,0 @@
|
|||
@echo off
|
||||
set INNO_ROOT=C:\Program Files (x86)\Inno Setup 5
|
||||
|
||||
set savedir=%cd%
|
||||
cd /d %~dp0
|
||||
|
||||
if not exist build\bin\Release goto buildproject
|
||||
|
||||
echo Building 64-bit Windows installer...
|
||||
|
||||
cd build\installer-inno
|
||||
if ERRORLEVEL 1 goto buildproject
|
||||
"%INNO_ROOT%\ISCC.exe" /Qp barrier.iss
|
||||
if ERRORLEVEL 1 goto failed
|
||||
|
||||
echo Build completed successfully
|
||||
goto done
|
||||
|
||||
:buildproject
|
||||
echo To build a 64-bit Windows installer:
|
||||
echo - set B_BUILD_TYPE=Release in build_env.bat
|
||||
echo - also set other environmental overrides necessary for your build environment
|
||||
echo - run clean_build.bat to build Barrier and verify that it succeeds
|
||||
echo - re-run this script to create the installation package
|
||||
goto done
|
||||
|
||||
:failed
|
||||
echo Build failed
|
||||
|
||||
:done
|
||||
set INNO_ROOT=
|
||||
|
||||
cd /d %savedir%
|
||||
set savedir=
|
|
@ -1,91 +0,0 @@
|
|||
@echo off
|
||||
|
||||
REM defaults - override them by creating a build_env.bat file
|
||||
set B_BUILD_TYPE=Debug
|
||||
set B_QT_ROOT=C:\Qt
|
||||
set B_QT_VER=5.11.1
|
||||
set B_QT_MSVC=msvc2017_64
|
||||
set B_BONJOUR=C:\Program Files\Bonjour SDK
|
||||
|
||||
set savedir=%cd%
|
||||
cd /d %~dp0
|
||||
|
||||
REM cmake generator name for the target build system
|
||||
if "%VisualStudioVersion%"=="15.0" (
|
||||
set cmake_gen=Visual Studio 15 2017
|
||||
) else if "%VisualStudioVersion%"=="16.0" (
|
||||
set cmake_gen=Visual Studio 16 2019
|
||||
) else (
|
||||
echo Visual Studio version was not detected.
|
||||
echo Did you forget to run inside a VS developer prompt?
|
||||
echo Using the default cmake generator.
|
||||
set cmake_gen=Visual Studio 16 2019
|
||||
)
|
||||
|
||||
if exist build_env.bat call build_env.bat
|
||||
|
||||
REM needed by cmake to set bonjour include dir
|
||||
set BONJOUR_SDK_HOME=%B_BONJOUR%
|
||||
|
||||
REM full path to Qt stuff we need
|
||||
set B_QT_FULLPATH=%B_QT_ROOT%\%B_QT_VER%\%B_QT_MSVC%
|
||||
|
||||
echo Bonjour: %BONJOUR_SDK_HOME%
|
||||
echo Qt: %B_QT_FULLPATH%
|
||||
|
||||
git submodule update --init --recursive
|
||||
|
||||
rmdir /q /s build
|
||||
mkdir build
|
||||
if ERRORLEVEL 1 goto failed
|
||||
cd build
|
||||
cmake -G "%cmake_gen%" -A x64 -D CMAKE_BUILD_TYPE=%B_BUILD_TYPE% -D CMAKE_PREFIX_PATH="%B_QT_FULLPATH%" -D DNSSD_LIB="%B_BONJOUR%\Lib\x64\dnssd.lib" -D QT_VERSION=%B_QT_VER% ..
|
||||
if ERRORLEVEL 1 goto failed
|
||||
cmake --build . --config %B_BUILD_TYPE%
|
||||
if ERRORLEVEL 1 goto failed
|
||||
if exist bin\Debug (
|
||||
copy %B_QT_FULLPATH%\bin\Qt5Cored.dll bin\Debug\ > NUL
|
||||
copy %B_QT_FULLPATH%\bin\Qt5Guid.dll bin\Debug\ > NUL
|
||||
copy %B_QT_FULLPATH%\bin\Qt5Networkd.dll bin\Debug\ > NUL
|
||||
copy %B_QT_FULLPATH%\bin\Qt5Widgetsd.dll bin\Debug\ > NUL
|
||||
copy %B_QT_FULLPATH%\bin\Qt5Cored.dll bin\Debug\ > NUL
|
||||
copy ..\ext\openssl\windows\x64\bin\* bin\Debug\ > NUL
|
||||
copy ..\res\openssl\barrier.conf bin\Debug\ > NUL
|
||||
mkdir bin\Debug\platforms
|
||||
copy %B_QT_FULLPATH%\plugins\platforms\qwindowsd.dll bin\Debug\platforms\ > NUL
|
||||
) else if exist bin\Release (
|
||||
copy %B_QT_FULLPATH%\bin\Qt5Core.dll bin\Release\ > NUL
|
||||
copy %B_QT_FULLPATH%\bin\Qt5Gui.dll bin\Release\ > NUL
|
||||
copy %B_QT_FULLPATH%\bin\Qt5Network.dll bin\Release\ > NUL
|
||||
copy %B_QT_FULLPATH%\bin\Qt5Widgets.dll bin\Release\ > NUL
|
||||
copy %B_QT_FULLPATH%\bin\Qt5Core.dll bin\Release\ > NUL
|
||||
copy ..\ext\openssl\windows\x64\bin\* bin\Release\ > NUL
|
||||
copy ..\res\openssl\barrier.conf bin\Release\ > NUL
|
||||
mkdir bin\Release\platforms
|
||||
copy %B_QT_FULLPATH%\plugins\platforms\qwindows.dll bin\Release\platforms\ > NUL
|
||||
) else (
|
||||
echo Remember to copy supporting binaries and configuration files!
|
||||
)
|
||||
|
||||
echo Build completed successfully
|
||||
set BUILD_FAILED=0
|
||||
goto done
|
||||
|
||||
:failed
|
||||
set BUILD_FAILED=%ERRORLEVEL%
|
||||
echo Build failed
|
||||
|
||||
:done
|
||||
cd /d %savedir%
|
||||
|
||||
set B_BUILD_TYPE=
|
||||
set B_QT_ROOT=
|
||||
set B_QT_VER=
|
||||
set B_QT_MSVC=
|
||||
set B_BONJOUR=
|
||||
set BONJOUR_SDK_HOME=
|
||||
set B_QT_FULLPATH=
|
||||
set savedir=
|
||||
set cmake_gen=
|
||||
|
||||
EXIT /B %BUILD_FAILED%
|
|
@ -1,32 +0,0 @@
|
|||
#!/bin/sh
|
||||
cd "$(dirname "$0")" || exit 1
|
||||
# some environments have cmake v2 as 'cmake' and v3 as 'cmake3'
|
||||
# check for cmake3 first then fallback to just cmake
|
||||
B_CMAKE=`type cmake3 2>/dev/null`
|
||||
if [ $? -eq 0 ]; then
|
||||
B_CMAKE=`echo "$B_CMAKE" | cut -d' ' -f3`
|
||||
else
|
||||
B_CMAKE=cmake
|
||||
fi
|
||||
# default build configuration
|
||||
B_BUILD_TYPE=${B_BUILD_TYPE:-Debug}
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
# OSX needs a lot of extra help, poor thing
|
||||
# run the osx_environment.sh script to fix paths
|
||||
. ./osx_environment.sh
|
||||
B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS"
|
||||
fi
|
||||
# allow local customizations to build environment
|
||||
[ -r ./build_env.sh ] && . ./build_env.sh
|
||||
|
||||
# Initialise Git submodules
|
||||
git submodule update --init --recursive
|
||||
|
||||
B_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$B_BUILD_TYPE $B_CMAKE_FLAGS"
|
||||
rm -rf build
|
||||
mkdir build || exit 1
|
||||
cd build || exit 1
|
||||
echo "Starting Barrier $B_BUILD_TYPE build..."
|
||||
$B_CMAKE $B_CMAKE_FLAGS .. || exit 1
|
||||
make || exit 1
|
||||
echo "Build completed successfully"
|
|
@ -1,9 +0,0 @@
|
|||
if (UNIX)
|
||||
set (CPACK_PACKAGE_VERSION_MAJOR ${BARRIER_VERSION_MAJOR})
|
||||
set (CPACK_PACKAGE_VERSION_MINOR ${BARRIER_VERSION_MINOR})
|
||||
set (CPACK_PACKAGE_VERSION_PATCH ${BARRIER_VERSION_PATCH})
|
||||
set (CPACK_GENERATOR "TBZ2")
|
||||
set (CPACK_SOURCE_GENERATOR "TXZ")
|
||||
set (CPACK_SOURCE_IGNORE_FILES "/build/;\.gitignore$;/\.git/;/.github/;\.swp$;build_env\.*")
|
||||
include (CPack)
|
||||
endif()
|
|
@ -1,98 +0,0 @@
|
|||
cmake_minimum_required (VERSION 3.4)
|
||||
|
||||
set (BARRIER_VERSION_MAJOR 2)
|
||||
set (BARRIER_VERSION_MINOR 4)
|
||||
set (BARRIER_VERSION_PATCH 0)
|
||||
set (BARRIER_VERSION_STAGE "release")
|
||||
|
||||
#
|
||||
# Barrier Version
|
||||
#
|
||||
if (NOT DEFINED BARRIER_VERSION_MAJOR)
|
||||
if (DEFINED ENV{BARRIER_VERSION_MAJOR})
|
||||
set (BARRIER_VERSION_MAJOR $ENV{BARRIER_VERSION_MAJOR})
|
||||
else()
|
||||
set (BARRIER_VERSION_MAJOR 2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED BARRIER_VERSION_MINOR)
|
||||
if (DEFINED ENV{BARRIER_VERSION_MINOR})
|
||||
set (BARRIER_VERSION_MINOR $ENV{BARRIER_VERSION_MINOR})
|
||||
else()
|
||||
set (BARRIER_VERSION_MINOR 3)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED BARRIER_VERSION_PATCH)
|
||||
if (DEFINED ENV{BARRIER_VERSION_PATCH})
|
||||
set (BARRIER_VERSION_PATCH $ENV{BARRIER_VERSION_PATCH})
|
||||
else()
|
||||
set (BARRIER_VERSION_PATCH 2)
|
||||
message (WARNING "Barrier version wasn't set. Set to ${BARRIER_VERSION_MAJOR}.${BARRIER_VERSION_MINOR}.${BARRIER_VERSION_PATCH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED BARRIER_VERSION_STAGE)
|
||||
if (DEFINED ENV{BARRIER_VERSION_STAGE})
|
||||
set (BARRIER_VERSION_STAGE $ENV{BARRIER_VERSION_STAGE})
|
||||
else()
|
||||
set (BARRIER_VERSION_STAGE "snapshot")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED BARRIER_REVISION)
|
||||
if (DEFINED ENV{GIT_COMMIT})
|
||||
string (SUBSTRING $ENV{GIT_COMMIT} 0 8 BARRIER_REVISION)
|
||||
else()
|
||||
find_program (GIT_BINARY git)
|
||||
if (NOT GIT_BINARY STREQUAL "GIT_BINARY-NOTFOUND")
|
||||
execute_process (
|
||||
COMMAND git rev-parse --short=8 HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE BARRIER_REVISION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(LENGTH "${BARRIER_REVISION}" BARRIER_REVISION_LENGTH)
|
||||
if (NOT BARRIER_REVISION_LENGTH EQUAL 8 OR NOT BARRIER_REVISION MATCHES "^[a-f0-9]+")
|
||||
set (BARRIER_REVISION "00000000")
|
||||
message (WARNING "revision not found. setting to ${BARRIER_REVISION}")
|
||||
endif()
|
||||
unset (BARRIER_REVISION_LENGTH)
|
||||
|
||||
if (DEFINED ENV{BUILD_NUMBER})
|
||||
set (BARRIER_BUILD_NUMBER $ENV{BUILD_NUMBER})
|
||||
else()
|
||||
set (BARRIER_BUILD_NUMBER 1)
|
||||
endif()
|
||||
|
||||
string (TIMESTAMP BARRIER_BUILD_DATE "%Y%m%d" UTC)
|
||||
set (BARRIER_SNAPSHOT_INFO ".${BARRIER_VERSION_STAGE}.${BARRIER_REVISION}")
|
||||
|
||||
if (BARRIER_VERSION_STAGE STREQUAL "snapshot")
|
||||
set (BARRIER_VERSION_TAG "${BARRIER_VERSION_STAGE}.b${BARRIER_BUILD_NUMBER}-${BARRIER_REVISION}")
|
||||
else()
|
||||
set (BARRIER_VERSION_TAG "${BARRIER_VERSION_STAGE}")
|
||||
endif()
|
||||
|
||||
set (BARRIER_VERSION "${BARRIER_VERSION_MAJOR}.${BARRIER_VERSION_MINOR}.${BARRIER_VERSION_PATCH}-${BARRIER_VERSION_STAGE}")
|
||||
set (BARRIER_VERSION_STRING "${BARRIER_VERSION}-${BARRIER_VERSION_TAG}")
|
||||
message (STATUS "Full Barrier version string is '" ${BARRIER_VERSION_STRING} "'")
|
||||
|
||||
add_definitions (-DBARRIER_VERSION="${BARRIER_VERSION}")
|
||||
add_definitions (-DBARRIER_VERSION_STRING="${BARRIER_VERSION_STRING}")
|
||||
add_definitions (-DBARRIER_VERSION_MAJOR=${BARRIER_VERSION_MAJOR})
|
||||
add_definitions (-DBARRIER_VERSION_MINOR=${BARRIER_VERSION_MINOR})
|
||||
add_definitions (-DBARRIER_VERSION_PATCH=${BARRIER_VERSION_PATCH})
|
||||
add_definitions (-DBARRIER_REVISION="${BARRIER_REVISION}")
|
||||
add_definitions (-DBARRIER_BUILD_DATE="${BARRIER_BUILD_DATE}")
|
||||
add_definitions (-DBARRIER_BUILD_NUMBER=${BARRIER_BUILD_NUMBER})
|
||||
|
||||
if (BARRIER_DEVELOPER_MODE)
|
||||
add_definitions (-DBARRIER_DEVELOPER_MODE=1)
|
||||
endif()
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
# barrier -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2012-2016 Symless Ltd.
|
||||
# Copyright (C) 2011 Nick Bolton
|
||||
#
|
||||
# This package is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# found in the file LICENSE that should have accompanied this file.
|
||||
#
|
||||
# This package is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
if (BARRIER_USE_EXTERNAL_GTEST)
|
||||
include (FindPkgConfig)
|
||||
find_package(GTest REQUIRED)
|
||||
pkg_check_modules(GMOCK REQUIRED gmock)
|
||||
include_directories(
|
||||
${GTEST_INCLUDE_DIRS}
|
||||
${GMOCK_INCLUDE_DIRS}
|
||||
)
|
||||
else()
|
||||
include_directories(
|
||||
../ext/gtest
|
||||
../ext/gtest/include
|
||||
../ext/gmock
|
||||
../ext/gmock/include
|
||||
)
|
||||
|
||||
add_library(gtest STATIC ../ext/gtest/src/gtest-all.cc)
|
||||
add_library(gmock STATIC ../ext/gmock/src/gmock-all.cc)
|
||||
|
||||
set(GTEST_LIBRARIES gtest)
|
||||
set(GMOCK_LIBRARIES gmock)
|
||||
|
||||
if (UNIX)
|
||||
# ignore warnings in gtest and gmock
|
||||
set_target_properties(gtest PROPERTIES COMPILE_FLAGS "-w")
|
||||
set_target_properties(gmock PROPERTIES COMPILE_FLAGS "-w")
|
||||
endif()
|
||||
endif()
|
|
@ -0,0 +1,2 @@
|
|||
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
|
||||
|
|
@ -1,412 +0,0 @@
|
|||
barrier (2.3.3) UNRELEASED; urgency=medium
|
||||
|
||||
[ Aaron Bieber ]
|
||||
* tell build system about openbsd
|
||||
|
||||
[ Tetja Rediske ]
|
||||
* make non-gui variants build without avahi
|
||||
|
||||
[ Erik Nordstrøm ]
|
||||
* Replace hard-coded names of build directory in build_installer.sh script for macOS with looking at the location of the script by the script itself when it is run. This makes it possible to have differently named build dirs for debug and release builds, and without restricting what each of those directories must be named.
|
||||
* Remove shell script that changes directory and then executes barrier on macOS, and execute barrier directly instead.
|
||||
* Add settings in the Info.plist file that enable high-DPI support on macOS.
|
||||
|
||||
[ Daniel Seither ]
|
||||
* Remove unused variables
|
||||
* IpcLogOutputter: Put member initializers in execution order
|
||||
* OSXDragView: Get rid of uninitialized variable warning
|
||||
* Add override specifiers
|
||||
* Let tray image blend into macOS menu bar
|
||||
|
||||
[ Vasily Galkin ]
|
||||
* Man page: fix incorrect name of user conf file in barriers.1
|
||||
|
||||
[ Keegan Quinn ]
|
||||
* Cast values to fix build errors on OS X 10.11.
|
||||
|
||||
[ Maximiliano Bertacchini ]
|
||||
* Update readme with mention of the snap package.
|
||||
|
||||
[ Javier Candeira ]
|
||||
* Fix #503 - Clarify on README how to report issues
|
||||
|
||||
[ Micael Jarniac ]
|
||||
* Build status badges added to a table
|
||||
|
||||
[ Maximiliano Bertacchini ]
|
||||
* Add build-essential to the snap's build deps.
|
||||
* Explicitly disable wayland support in the snap.
|
||||
* Add comment on snap env var
|
||||
|
||||
[ Vasily Galkin ]
|
||||
* Fix infinite loop on fast TCP disconnection
|
||||
|
||||
[ Dom Rodriguez ]
|
||||
* README: Add OpenBSD to list of supported OSes
|
||||
|
||||
[ Åke Engelbrektson ]
|
||||
* Update gui_sv.ts
|
||||
|
||||
[ the-wes ]
|
||||
* Add more detailed description of what Barrier does
|
||||
|
||||
[ James Le Cuirot ]
|
||||
* Use -pthread flag and simplify pthread build logic
|
||||
* Only require Qt5 when building the GUI
|
||||
|
||||
[ Tomáš Chvátal ]
|
||||
* Fix desktop file Categories to match standard
|
||||
|
||||
[ Chris Simons ]
|
||||
* Add script that uses macdeployqt instead of `reref_dylibs.sh` shell script to create the `.app` bundle
|
||||
* Use `build_dist.sh` in CMake instead of `build_installer.sh` Have CMake always build a bundle, the `build_dist.sh` script will only build a dmg if the build type is "Release"
|
||||
* Add warnings for users manually running `build_installer.sh` and `reref_dylibs.sh` manually
|
||||
* Homebrew (Ruby) throws an error when it gets `SIGPIPE` from the `--max-count` on `grep`.
|
||||
* added barrierc and barriers to macdeployqt targets
|
||||
* Change MacOS Build Steps
|
||||
* Fix TIS/TSM in logs
|
||||
* Elevate XSocketAddressInUse to ERROR
|
||||
* Allow selecting Fingerprint Qlabel
|
||||
* replace tabs with spaces
|
||||
* Change log level on several status messages (Fixes #652, Fixes #516)
|
||||
|
||||
[ Ben Plessinger ]
|
||||
* A few more log cleanups
|
||||
|
||||
[ Vasily Galkin ]
|
||||
* Remove unused IEventQueue::isEmpty() method to simplify code understanding
|
||||
|
||||
[ Povilas Kanapickas ]
|
||||
* XWindowsEventQueueBuffer: Fix delays when waiting for new events
|
||||
|
||||
[ Jonathan Martens ]
|
||||
* Fix Auto config missing hostname prompt #704
|
||||
|
||||
[ Vasily Galkin ]
|
||||
* Windows 8+: make waiting for messages correspond to emptiness check
|
||||
|
||||
[ Povilas Kanapickas ]
|
||||
* gui: Use enum class to scope enum values
|
||||
* lib/client: Use std::string directly instead of String typedef
|
||||
* lib/arch: Use std::string directly instead of String typedef
|
||||
* lib/net: Use std::string directly instead of String typedef
|
||||
* lib/server: Use std::string directly instead of String typedef
|
||||
* lib/base: Use std::string directly instead of String typedef
|
||||
* lib/ipc: Use std::string directly instead of String typedef
|
||||
* lib/net: Add missing include
|
||||
* lib/platform: Use std::string directly instead of String typedef
|
||||
* test: Enable building of tests
|
||||
* test: Reduce the number of implicit include directories
|
||||
* test: Remove unresolved merge conflict markers
|
||||
* test: Fix referenced library name
|
||||
* test: Update to new APIs
|
||||
* tests: Fix crash in XWindowsKeyStateTests
|
||||
* test: Fix undefined behavior of deleting incomplete type
|
||||
* tests: Disable test that depends on external state
|
||||
* Use noexcept instead of exception specifications
|
||||
* lib/common: Remove no longer used stdexcept.h
|
||||
|
||||
[ Jonathan Martens ]
|
||||
* Make connection message a NOTE for consistency
|
||||
|
||||
[ zhexiwang ]
|
||||
* Added toggleScreen function, using hot key to loop through all screens. Comparing to switchToScreen, it is more handy since the user only need to hit one hotkey.
|
||||
|
||||
[ GeorgH93 ]
|
||||
* Fix build on Windows
|
||||
* Keep errorlevel
|
||||
|
||||
[ Povilas Kanapickas ]
|
||||
* Revert "Make connection message a NOTE for consistency"
|
||||
|
||||
[ Chris Simons ]
|
||||
* add comments explaining the use of CLOG_PRINT
|
||||
|
||||
[ Dom Rodriguez ]
|
||||
* Remove ext/gtest, ext/gmock to replace with Git submodule
|
||||
* Add gtest/gmock framework, locked at 1.6.0
|
||||
* Fix CI infrastructure (.bat/.sh) to initialise Git submodules before build
|
||||
|
||||
[ Maximiliano Bertacchini ]
|
||||
* Fix snap build failing to initialize submodules.
|
||||
|
||||
[ Niklas Hambüchen ]
|
||||
* ui: Settings: Explain what "double tap" means
|
||||
|
||||
[ Dom Rodriguez ]
|
||||
* Prepare for v2.3.3 release
|
||||
|
||||
[ Maximiliano Bertacchini ]
|
||||
* Shorten snap version on tagged revisions
|
||||
|
||||
[ Tomoya Tanjo ]
|
||||
* Add Eisu_toggle and Muhenkan keys
|
||||
|
||||
[ Michael Zimmermann ]
|
||||
* add support for keyboard backlight media keys
|
||||
|
||||
[ Dom Rodriguez ]
|
||||
* [Build]: Bump Build.properties
|
||||
|
||||
-- root <root@873b8d543aab> Fri, 07 Aug 2020 16:25:54 +0000
|
||||
|
||||
barrier (2.3.2) disco; urgency=medium
|
||||
|
||||
[ walker0643 ]
|
||||
* remove (wrong) version line from .desktop file
|
||||
|
||||
[ Povilas Kanapickas ]
|
||||
* Improve precision of grabbed scroll events on OSX server
|
||||
* Accumulate scrolls less than supported scroll on XWindows
|
||||
* Add fake changelog so that debian package may be built
|
||||
|
||||
[ walker0643 ]
|
||||
* non-GUI build should not require bonjour headers
|
||||
* add patch from Gentoo packager to fix cmake issue (reported on Arch, too). ref #49
|
||||
* fix email in debian changelog
|
||||
* screen settings dialog handles internationalized default name better (ref #71)
|
||||
* rephrase language in README.md
|
||||
|
||||
[ sidneys ]
|
||||
* fix(macos-build): use standard methods for detecting default XCode installation and default macOS platform SDK
|
||||
|
||||
[ Povilas Kanapickas ]
|
||||
* OSX: Add support for building on macports
|
||||
* OSX: Prefer Macports over Homebrew if available
|
||||
* travis: Rewrite the CI config to use platform matrix
|
||||
* travis: Add macports-based OSX script
|
||||
* travis: Add homebrew-based OSX script
|
||||
|
||||
[ Adrian Lucrèce Céleste ]
|
||||
* [Travis] use container builds for linux (#85)
|
||||
* Merge pkgconfig branch into master (#86)
|
||||
|
||||
[ walker0643 ]
|
||||
* fix formatting in last merge
|
||||
|
||||
[ coypu ]
|
||||
* Also add curl include directories.
|
||||
* have all other OSes handled in the else case.
|
||||
* Use ${CMAKE_DL_LIBS} rather than listing OSes.
|
||||
|
||||
[ walker0643 ]
|
||||
* bump version to 2.2
|
||||
* bump qt/vs versions on windows
|
||||
|
||||
[ Pawel Bogut ]
|
||||
* Fix config file name in server help message
|
||||
|
||||
[ Josh Stone ]
|
||||
* Fix data indexes in Unicode::fromUTF8
|
||||
|
||||
[ walker0643 ]
|
||||
* bump ssl cert key size up to 2048 from 1024. fixes #126
|
||||
* enable high-dps awareness for barriers/barrierc. fixes screen geometry calculations for screens with >100% scaling
|
||||
* rename field Interface to Address in GUI settings dialog
|
||||
* add firewall rule for default port on installation (windows)
|
||||
* Update README.md
|
||||
|
||||
[ Epakai ]
|
||||
* Update openssl key size in barrier.conf (#150)
|
||||
|
||||
[ Adrian Lucrèce Céleste ]
|
||||
* add pre-build script for building barrier on windows from SSH (#152)
|
||||
|
||||
[ Christopher N. Hesse ]
|
||||
* gui: Fix auto hide behavior (#140)
|
||||
|
||||
[ Povilas Kanapickas ]
|
||||
* Build full installer via clean_build.sh (#157)
|
||||
* OSX: Explain why the app needs to go into /Applications (#158)
|
||||
|
||||
[ Monika Kairaityte ]
|
||||
* x11: Wrap platform functions in an interface that can be mocked later
|
||||
* x11: Wrap platform functions in XWindowsScreenSaver class
|
||||
* x11: Wrap platform functions in XWindowsClipboard class
|
||||
* x11: Wrap platform functions in XWindowsKeyState class
|
||||
* x11: Wrap platform functions in XWindowsEventQueueBuffer class
|
||||
* Fix tests wrapper
|
||||
|
||||
[ Chris Simons ]
|
||||
* Added preserveFocus fix (#178)
|
||||
|
||||
[ Dayne Broderson ]
|
||||
* add debug notes to help identify where trusted fingerprints file is
|
||||
* fix spelling of matches
|
||||
* fixing style to be consistent per @p12tic
|
||||
|
||||
[ Robert Sandell ]
|
||||
* Spelling correction (#209)
|
||||
|
||||
[ Moron ]
|
||||
* Fix #204 modifier keys not working in remote desktop on MacOS
|
||||
|
||||
[ jwestfall ]
|
||||
* Properly deal with a socket that is readable and writable at the same time
|
||||
|
||||
[ Miroslav Lences ]
|
||||
* Fix macos build issues
|
||||
|
||||
[ Jim Westfall ]
|
||||
* Fix OSX builds for macports
|
||||
|
||||
[ Girts Folkmanis ]
|
||||
* add checks to osx_environment.sh
|
||||
|
||||
[ Thomas A. F. Thorne ]
|
||||
* Reduce Sysmtem Tray Retry Attempts
|
||||
* Do Not Warn About Missing System Tray
|
||||
|
||||
[ jwestfall ]
|
||||
* OSX: let build_installer.sh create a working Barrier.app on debug builds
|
||||
|
||||
[ Szymon Szeląg ]
|
||||
* Screen change script argument
|
||||
* Use std::system
|
||||
* Start script via execl
|
||||
* Fire screen switch event on client disconnect
|
||||
|
||||
[ Povilas Kanapickas ]
|
||||
* Fix memory leak during socket shutdown
|
||||
|
||||
[ PayouZon MagIT ]
|
||||
* Update snapcraft.yaml
|
||||
* Update snapcraft.yaml
|
||||
* Barrier Snappy
|
||||
|
||||
[ Wendall Cada ]
|
||||
* Working spec file for Fedora
|
||||
|
||||
[ noisyshape ]
|
||||
* Update Windows build script for VS2019
|
||||
* Add support for multiple VS versions
|
||||
* Normalize cmake generator strings
|
||||
* Correct path and instructions
|
||||
* Create version number for wix
|
||||
* Remove hardcoded paths
|
||||
* Fix XML
|
||||
|
||||
[ Mike Salvatore ]
|
||||
* Fix #278 "Enable Clipboard Sharing" always reset after restart
|
||||
* Rename the "Apply" button to "Reload"
|
||||
|
||||
[ noisyshape ]
|
||||
* Replace Wix with Inno Setup
|
||||
|
||||
[ Matthijs Wensveen ]
|
||||
* Add dpiAwareness: PerMonitor to manifest to better handle multiple monitors with different DPI settings.
|
||||
|
||||
[ Nelson Chen ]
|
||||
* Initial Azure Pipelines
|
||||
|
||||
[ Adrian Lucrèce Céleste ]
|
||||
* :pencil: add release link and contact info
|
||||
|
||||
[ pack ]
|
||||
* typo fix (#311)
|
||||
|
||||
[ Nelson Chen ]
|
||||
* Update Apt on Linux before installing dependencies on Azure Pipelines (#321)
|
||||
* Prefix Windows artifact names with 'Windows' on Azure Pipelines (#319)
|
||||
* Install Pinned Qt and OpenSSL on Mac
|
||||
* Build Release version of Barrier on Mac
|
||||
* Publish Mac Artifacts
|
||||
* Upgrade QLI Installer and use Cal's Qt Mirror
|
||||
|
||||
[ Adrian Lucrèce Céleste ]
|
||||
* fix #163
|
||||
* Add a quick Q/A about what OSes are supported
|
||||
* Add Q/A about 32-bit windows
|
||||
|
||||
[ Chun Wang ]
|
||||
* Fix #232 MACOS serious config file errors - hotkeys totally broken
|
||||
|
||||
[ Adrian Lucrèce Céleste ]
|
||||
* [README] Add FaQ to the bottom
|
||||
* [Release] Bump up to a new release version
|
||||
* [Cmake] bump version to 2.3.0
|
||||
|
||||
[ Nelson Chen ]
|
||||
* Ensure Inno Setup 5 is installed in Azure Pipelines
|
||||
|
||||
[ Patrizio Tufarolo ]
|
||||
* Fixed quote key on US International keyboard
|
||||
|
||||
[ Maximiliano Bertacchini ]
|
||||
* Use version from git tag.
|
||||
* Fix interface plugs.
|
||||
* Add commands: `barrier`, `barrierc`, `barriers`.
|
||||
* Drop custom qt5, use distro provided one.
|
||||
* Update build-packages and stage-packages.
|
||||
* Add desktop entry with an app icon.
|
||||
* Set snap icon and license.
|
||||
* Use appstream metadata from flathub.
|
||||
* Fix snap version-control script for local lxd builds.
|
||||
|
||||
[ Dom Rodriguez ]
|
||||
* Feature: CMake now generates compile_commands.json
|
||||
|
||||
[ Thomas Thorne ]
|
||||
* Reference Only Microsoft Azue Pipelines In Readme.md
|
||||
* Delete .travis.yml As We Switch To Azure Pipelines
|
||||
|
||||
[ Evan Maddock ]
|
||||
* Reimplement patch for horizontal scrolling and extra mouse buttons
|
||||
* Used the wrong key button by accident
|
||||
* Use Windows helper function to check for Windows version
|
||||
|
||||
[ walker0643 ]
|
||||
* Drop Travis CI
|
||||
|
||||
[ Adrian Lucrèce Céleste ]
|
||||
* [Version] bump to 2.3.1 for new release
|
||||
|
||||
[ Povilas Kanapickas ]
|
||||
* Make ownership of SocketMultiplexer explicit
|
||||
* Make ownership of SocketMultiplexerJob explicit
|
||||
* Use std::mutex instead of ArchMutex in ArchMultithreadPosix
|
||||
* Use std::mutex instead of ArchMutex in EventQueue
|
||||
* Use std::mutex instead of ArchMutex in Log
|
||||
* Use std::mutex instead of ArchMutex in IpcServer
|
||||
* Use std::mutex instead of ArchMutex in IpcClientProxy
|
||||
* Use std::mutex instead of ArchMutex in IpcLogOutputter
|
||||
* Fix race condition in IArchString
|
||||
|
||||
[ Adrian Lucrèce Céleste ]
|
||||
* [Build[ update pre-build script to call VS2019
|
||||
|
||||
[ Dom Rodriguez ]
|
||||
* Snap: Change CMake builds to be of Release type
|
||||
* Fix: CMake now checks for required Qt5 libraries
|
||||
* Tidy up and fix lint errors in build scripts
|
||||
* Interim fix for failed macOS builds
|
||||
|
||||
[ Povilas Kanapickas ]
|
||||
* Fix retry timer not being unregistered properly
|
||||
|
||||
[ Maximiliano Bertacchini ]
|
||||
* Rename the snap as `barrier`.
|
||||
|
||||
[ Adrian Lucrèce Céleste ]
|
||||
* Revert "Tidy up and fix lint errors in build scripts"
|
||||
* [CMake] properly declare FPIC
|
||||
* [Azure Pipelines] use QT 5.13.0 (#418)
|
||||
* Add snap build status
|
||||
* [README] update README with info about packages
|
||||
|
||||
[ Casey Barton ]
|
||||
* Merged mouse drift fix from synergy-core
|
||||
|
||||
[ mirh ]
|
||||
* Fix debug build launch
|
||||
|
||||
[ Adrian Lucrèce Céleste ]
|
||||
* [Version] bump to 2.3.2, stable
|
||||
|
||||
-- Pablo Catalina <pablo.catalina@gmail.com> Wed, 09 Oct 2019 12:52:10 +0200
|
||||
|
||||
barrier (2.1-1) unstable; urgency=low
|
||||
|
||||
* Initial release (Closes: #123456)
|
||||
|
||||
-- Debauchee Open Source Group <debauchee.oss@gmail.com> Sat, 01 Apr 2018 00:00:00 +0000
|
|
@ -1 +0,0 @@
|
|||
9
|
|
@ -1,17 +0,0 @@
|
|||
Source: barrier
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Standards-Version: 3.9.7
|
||||
Homepage: https://github.com/debauchee/barrier/
|
||||
Maintainer: Debauchee Open Source Group <todo@mail.com>
|
||||
|
||||
Package: barrier
|
||||
Architecture: amd64
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Description: Keyboard and mouse sharing solution
|
||||
Barrier allows you to share one mouse and keyboard between multiple computers.
|
||||
Work seamlessly across Windows, macOS and Linux.
|
||||
Homepage: https://github.com/debauchee/barrier/
|
|
@ -1,5 +0,0 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: Barrier
|
||||
Source: https://github.com/debauchee/barrier/
|
||||
Disclaimer: This package is not part of the Debian project as it contains closed source proprietary components
|
||||
Copyright: Copyright (C) 2018 Debauchee Open Source Group
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
%:
|
||||
dh $@ --buildsystem=cmake --builddirectory=build -Pbuild/debian --parallel
|
||||
|
|
@ -1 +0,0 @@
|
|||
3.0 (native)
|
|
@ -1,90 +0,0 @@
|
|||
#define MyAppName "Barrier"
|
||||
#define MyAppVersion "@BARRIER_VERSION_MAJOR@.@BARRIER_VERSION_MINOR@.@BARRIER_VERSION_PATCH@.@BARRIER_BUILD_NUMBER@"
|
||||
#define MyAppTextVersion "@BARRIER_VERSION@"
|
||||
#define MyAppPublisher "Debauchee Open Source Group"
|
||||
#define MyAppURL "https://github.com/debauchee/barrier/wiki"
|
||||
#define MyAppCopyright "Copyright (C) 2018 Debauchee Open Source Group"
|
||||
#define MyAppExeName "barrier.exe"
|
||||
#define MyAppServiceName "Barrier"
|
||||
#define MyAppServiceExe "barrierd.exe"
|
||||
#define MyAppServiceDesc "Manages the Barrier background processes."
|
||||
#define MyAppListenerDesc "Barrier Listener"
|
||||
|
||||
[Setup]
|
||||
AppId={{41036EA6-3F7A-4803-8AE0-469E5E91EFCC}
|
||||
AppName={#MyAppName}
|
||||
AppVersion={#MyAppTextVersion}
|
||||
AppVerName={#MyAppName} {#MyAppTextVersion}
|
||||
AppPublisher={#MyAppPublisher}
|
||||
AppPublisherURL={#MyAppURL}
|
||||
AppSupportURL={#MyAppURL}
|
||||
AppUpdatesURL={#MyAppURL}
|
||||
DefaultDirName={pf}\{#MyAppName}
|
||||
DisableProgramGroupPage=yes
|
||||
LicenseFile=@CMAKE_CURRENT_SOURCE_DIR@/res/License.rtf
|
||||
OutputDir=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/../installer-inno/bin
|
||||
OutputBaseFilename=BarrierSetup-{#MyAppTextVersion}
|
||||
SetupIconFile=@CMAKE_CURRENT_SOURCE_DIR@/res/barrier.ico
|
||||
VersionInfoProductTextVersion={#MyAppTextVersion}
|
||||
VersionInfoProductVersion={#MyAppVersion}
|
||||
VersionInfoTextVersion={#MyAppTextVersion}
|
||||
VersionInfoVersion={#MyAppVersion}
|
||||
VersionInfoCopyright={#MyAppCopyright}
|
||||
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
ArchitecturesInstallIn64BitMode=x64 ia64
|
||||
UninstallDisplayIcon={app}\{#MyAppExeName}
|
||||
|
||||
#include "scripts\lang\english.iss"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
|
||||
[Files]
|
||||
Source: "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/Release/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||
|
||||
[Icons]
|
||||
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||
|
||||
[Run]
|
||||
; there's no "check if exists" or "insert if not exists" for netsh's firewall commands
|
||||
; to avoid duplicate entries remove the existing rule (fails if it doesn't exist) before adding
|
||||
Filename: {sys}\netsh.exe; Parameters: "advfirewall firewall delete rule name=""{#MyAppListenerDesc}"""; Flags: runhidden
|
||||
Filename: {sys}\netsh.exe; Parameters: "advfirewall firewall add rule name=""{#MyAppListenerDesc}"" protocol=TCP dir=in localport=24800 action=allow"; Flags: runhidden
|
||||
Filename: {sys}\sc.exe; Parameters: "create {#MyAppServiceName} start= auto binPath= ""\""{app}\{#MyAppServiceExe}\"""""; Flags: runhidden
|
||||
Filename: {sys}\sc.exe; Parameters: "description {#MyAppServiceName} ""{#MyAppServiceDesc}"""; Flags: runhidden
|
||||
Filename: {sys}\sc.exe; Parameters: "start {#MyAppServiceName}"; Flags: runhidden
|
||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||
|
||||
[UninstallDelete]
|
||||
Type: filesandordirs; Name: "{commonappdata}\Barrier"
|
||||
|
||||
[UninstallRun]
|
||||
Filename: {sys}\taskkill; Parameters: "/im {#MyAppExeName} /f /t"; Flags: runhidden
|
||||
Filename: {sys}\net.exe; Parameters: "stop {#MyAppServiceName}"; Flags: runhidden
|
||||
Filename: {sys}\sc.exe; Parameters: "delete {#MyAppServiceName}"; Flags: runhidden
|
||||
Filename: {sys}\netsh.exe; Parameters: "advfirewall firewall delete rule name=""{#MyAppListenerDesc}"""; Flags: runhidden
|
||||
|
||||
[CustomMessages]
|
||||
DependenciesDir="redist"
|
||||
|
||||
; shared code for installing the products
|
||||
#include "scripts\products.iss"
|
||||
#include "scripts\products\stringversion.iss"
|
||||
#include "scripts\products\winversion.iss"
|
||||
#include "scripts\products\msiproduct.iss"
|
||||
#include "scripts\products\vcredist2017.iss"
|
||||
|
||||
[Code]
|
||||
function InitializeSetup(): boolean;
|
||||
begin
|
||||
// initialize windows version
|
||||
initwinversion();
|
||||
|
||||
vcredist2017('14'); // min allowed version is 14.0
|
||||
|
||||
Result := true;
|
||||
end;
|
|
@ -1,49 +0,0 @@
|
|||
[strings]
|
||||
; General
|
||||
100=File download
|
||||
101=Do you want to cancel the download?
|
||||
102=%1 (%2 of %3)
|
||||
103=%1 KB
|
||||
104=%1 KB of %2 KB (%3%)
|
||||
|
||||
; Status information
|
||||
110=Getting file information...
|
||||
111=Redirecting to %1
|
||||
112=Sending request...
|
||||
113=Resolving %1
|
||||
114=Connected to %1
|
||||
115=Receiving...
|
||||
116=Connecting to %1
|
||||
|
||||
; Error messages
|
||||
120=Error connecting to the internet.\n\n%1
|
||||
121=Error opening %1.\n\nThe server returned status code %2.
|
||||
122=Error reading URL.\n\n%1
|
||||
123=Error writing file %1.\n\n%2
|
||||
124=Error opening file %1.\n\n%2
|
||||
125='%1' is an invalid URL.
|
||||
126=Error opening %1.\n\n%2
|
||||
127=Error sending request.\n\n%1
|
||||
128=Unsupported protocol. Only HTTP and FTP protocols are supported.
|
||||
129=Failed to connect to %1.\n\n%2
|
||||
130=Failed to query status code.\n\n%1
|
||||
131=Error requesting file.\n\n%1
|
||||
|
||||
; Other
|
||||
144=About...
|
||||
146=Download
|
||||
147=Setup is now downloading additional files to your computer.
|
||||
|
||||
; labels
|
||||
160=File:
|
||||
161=Speed:
|
||||
162=Status:
|
||||
163=Elapsed Time:
|
||||
164=Remaining Time:
|
||||
165=Current File:
|
||||
166=Overall Progress:
|
||||
167=Cancel
|
||||
168=OK
|
||||
169=User Name and Password
|
||||
170=User Name:
|
||||
171=Password:
|
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
[Files]
|
||||
Source: "scripts\isxdl\isxdl.dll"; Flags: dontcopy
|
||||
|
||||
[Code]
|
||||
procedure isxdl_AddFile(URL, Filename: PAnsiChar);
|
||||
external 'isxdl_AddFile@files:isxdl.dll stdcall';
|
||||
|
||||
function isxdl_DownloadFiles(hWnd: Integer): Integer;
|
||||
external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
|
||||
|
||||
function isxdl_SetOption(Option, Value: PAnsiChar): Integer;
|
||||
external 'isxdl_SetOption@files:isxdl.dll stdcall';
|
||||
|
||||
[Setup]
|
|
@ -1,18 +0,0 @@
|
|||
[Languages]
|
||||
Name: "en"; MessagesFile: "compiler:Default.isl"
|
||||
|
||||
[CustomMessages]
|
||||
;http://www.microsoft.com/globaldev/reference/lcid-all.mspx
|
||||
en.lcid=1033
|
||||
en.depdownload_msg=The following applications are required before setup can continue:%n%n%1%nDownload and install now?
|
||||
en.depdownload_memo_title=Download dependencies
|
||||
en.depinstall_memo_title=Install dependencies
|
||||
en.depinstall_title=Installing dependencies
|
||||
en.depinstall_description=Please wait while Setup installs dependencies on your computer.
|
||||
en.depinstall_status=Installing %1...
|
||||
en.depinstall_missing=%1 must be installed before setup can continue. Please install %1 and run Setup again.
|
||||
en.depinstall_error=An error occured while installing the dependencies. Please restart the computer and run the setup again or install the following dependencies manually:%n
|
||||
|
||||
en.isxdl_langfile=
|
||||
|
||||
[Files]
|
|
@ -1,18 +0,0 @@
|
|||
[Languages]
|
||||
Name: "it"; MessagesFile: "compiler:Default.isl"
|
||||
|
||||
[CustomMessages]
|
||||
;http://www.microsoft.com/globaldev/reference/lcid-all.mspx
|
||||
en.lcid=1033
|
||||
en.depdownload_msg=Le seguenti applicazioni sono necessarie per poter continuare l'installazione:%n%n%1%nScaricare ed installa ora?
|
||||
en.depdownload_memo_title=Scarica dipendenze
|
||||
en.depinstall_memo_title=Installa dipendenze
|
||||
en.depinstall_title=Installazione dipendenze
|
||||
en.depinstall_description=Attendere che l'installazione installi le dipendenze sul computer.
|
||||
en.depinstall_status=Installazione %1...
|
||||
en.depinstall_missing=%1 deve essere installato prima che l'installazione possa continuare. Installa %1 ed esegui nuovamente il programma di installazione.
|
||||
en.depinstall_error=Si è verificato un errore durante l'installazione delle dipendenze. Riavviare il computer ed eseguire nuovamente l'installazione o installare manualmente le seguenti dipendenze: %n
|
||||
|
||||
it.isxdl_langfile=
|
||||
|
||||
[Files]
|
|
@ -1,6 +0,0 @@
|
|||
#include "isxdl\isxdl.iss"
|
||||
|
||||
[Code]
|
||||
#include "products.pas"
|
||||
|
||||
[Setup]
|
|
@ -1,329 +0,0 @@
|
|||
{
|
||||
--- TYPES AND VARIABLES ---
|
||||
}
|
||||
type
|
||||
TProduct = record
|
||||
File: String;
|
||||
Title: String;
|
||||
Parameters: String;
|
||||
ForceSuccess : boolean;
|
||||
InstallClean : boolean;
|
||||
MustRebootAfter : boolean;
|
||||
end;
|
||||
|
||||
InstallResult = (InstallSuccessful, InstallRebootRequired, InstallError);
|
||||
|
||||
var
|
||||
installMemo, downloadMessage: string;
|
||||
products: array of TProduct;
|
||||
delayedReboot, isForcedX86: boolean;
|
||||
DependencyPage: TOutputProgressWizardPage;
|
||||
|
||||
procedure AddProduct(filename, parameters, title, size, url: string; forceSuccess, installClean, mustRebootAfter : boolean);
|
||||
{
|
||||
Adds a product to the list of products to download.
|
||||
Parameters:
|
||||
filename: the file name under which to save the file
|
||||
parameters: the parameters with which to run the file
|
||||
title: the product title
|
||||
size: the file size
|
||||
url: the URL to download from
|
||||
forceSuccess: whether to continue in case of setup failure
|
||||
installClean: whether the product needs a reboot before installing
|
||||
mustRebootAfter: whether the product needs a reboot after installing
|
||||
}
|
||||
var
|
||||
path: string;
|
||||
i: Integer;
|
||||
begin
|
||||
installMemo := installMemo + '%1' + title + #13;
|
||||
|
||||
path := ExpandConstant('{src}{\}') + CustomMessage('DependenciesDir') + '\' + filename;
|
||||
if not FileExists(path) then begin
|
||||
path := ExpandConstant('{tmp}{\}') + filename;
|
||||
|
||||
if not FileExists(path) then begin
|
||||
isxdl_AddFile(url, path);
|
||||
|
||||
downloadMessage := downloadMessage + '%1' + title + ' (' + size + ')' + #13;
|
||||
end;
|
||||
end;
|
||||
|
||||
i := GetArrayLength(products);
|
||||
SetArrayLength(products, i + 1);
|
||||
products[i].File := path;
|
||||
products[i].Title := title;
|
||||
products[i].Parameters := parameters;
|
||||
products[i].ForceSuccess := forceSuccess;
|
||||
products[i].InstallClean := installClean;
|
||||
products[i].MustRebootAfter := mustRebootAfter;
|
||||
end;
|
||||
|
||||
function SmartExec(product : TProduct; var resultcode : Integer): boolean;
|
||||
{
|
||||
Executes a product and returns the exit code.
|
||||
Parameters:
|
||||
product: the product to install
|
||||
resultcode: the exit code
|
||||
}
|
||||
begin
|
||||
if (LowerCase(Copy(product.File, Length(product.File) - 2, 3)) = 'exe') then begin
|
||||
Result := Exec(product.File, product.Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, resultcode);
|
||||
end else begin
|
||||
Result := ShellExec('', product.File, product.Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, resultcode);
|
||||
end;
|
||||
end;
|
||||
|
||||
function PendingReboot: boolean;
|
||||
{
|
||||
Checks whether the machine has a pending reboot.
|
||||
}
|
||||
var names: String;
|
||||
begin
|
||||
if (RegQueryMultiStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager', 'PendingFileRenameOperations', names)) then begin
|
||||
Result := true;
|
||||
end else if ((RegQueryMultiStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager', 'SetupExecute', names)) and (names <> '')) then begin
|
||||
Result := true;
|
||||
end else begin
|
||||
Result := false;
|
||||
end;
|
||||
end;
|
||||
|
||||
function InstallProducts: InstallResult;
|
||||
{
|
||||
Installs the downloaded products
|
||||
}
|
||||
var
|
||||
resultCode, i, productCount, finishCount: Integer;
|
||||
begin
|
||||
Result := InstallSuccessful;
|
||||
productCount := GetArrayLength(products);
|
||||
|
||||
if productCount > 0 then begin
|
||||
DependencyPage := CreateOutputProgressPage(CustomMessage('depinstall_title'), CustomMessage('depinstall_description'));
|
||||
DependencyPage.Show;
|
||||
|
||||
for i := 0 to productCount - 1 do begin
|
||||
if (products[i].InstallClean and (delayedReboot or PendingReboot())) then begin
|
||||
Result := InstallRebootRequired;
|
||||
break;
|
||||
end;
|
||||
|
||||
DependencyPage.SetText(FmtMessage(CustomMessage('depinstall_status'), [products[i].Title]), '');
|
||||
DependencyPage.SetProgress(i, productCount);
|
||||
|
||||
while true do begin
|
||||
// set 0 as used code for shown error if SmartExec fails
|
||||
resultCode := 0;
|
||||
if SmartExec(products[i], resultCode) then begin
|
||||
// setup executed; resultCode contains the exit code
|
||||
if (products[i].MustRebootAfter) then begin
|
||||
// delay reboot after install if we installed the last dependency anyways
|
||||
if (i = productCount - 1) then begin
|
||||
delayedReboot := true;
|
||||
end else begin
|
||||
Result := InstallRebootRequired;
|
||||
end;
|
||||
break;
|
||||
end else if (resultCode = 0) or (products[i].ForceSuccess) then begin
|
||||
finishCount := finishCount + 1;
|
||||
break;
|
||||
end else if (resultCode = 3010) then begin
|
||||
// Windows Installer resultCode 3010: ERROR_SUCCESS_REBOOT_REQUIRED
|
||||
delayedReboot := true;
|
||||
finishCount := finishCount + 1;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
||||
case MsgBox(FmtMessage(SetupMessage(msgErrorFunctionFailed), [products[i].Title, IntToStr(resultCode)]), mbError, MB_ABORTRETRYIGNORE) of
|
||||
IDABORT: begin
|
||||
Result := InstallError;
|
||||
break;
|
||||
end;
|
||||
IDIGNORE: begin
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if Result <> InstallSuccessful then begin
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
||||
// only leave not installed products for error message
|
||||
for i := 0 to productCount - finishCount - 1 do begin
|
||||
products[i] := products[i+finishCount];
|
||||
end;
|
||||
SetArrayLength(products, productCount - finishCount);
|
||||
|
||||
DependencyPage.Hide;
|
||||
end;
|
||||
end;
|
||||
|
||||
{
|
||||
--------------------
|
||||
INNO EVENT FUNCTIONS
|
||||
--------------------
|
||||
}
|
||||
|
||||
function PrepareToInstall(var NeedsRestart: boolean): String;
|
||||
{
|
||||
Before the "preparing to install" page.
|
||||
See: http://www.jrsoftware.org/ishelp/index.php?topic=scriptevents
|
||||
}
|
||||
var
|
||||
i: Integer;
|
||||
s: string;
|
||||
begin
|
||||
delayedReboot := false;
|
||||
|
||||
case InstallProducts() of
|
||||
InstallError: begin
|
||||
s := CustomMessage('depinstall_error');
|
||||
|
||||
for i := 0 to GetArrayLength(products) - 1 do begin
|
||||
s := s + #13 + ' ' + products[i].Title;
|
||||
end;
|
||||
|
||||
Result := s;
|
||||
end;
|
||||
InstallRebootRequired: begin
|
||||
Result := products[0].Title;
|
||||
NeedsRestart := true;
|
||||
|
||||
// write into the registry that the installer needs to be executed again after restart
|
||||
RegWriteStringValue(HKEY_CURRENT_USER, 'SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce', 'InstallBootstrap', ExpandConstant('{srcexe}'));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function NeedRestart : boolean;
|
||||
{
|
||||
Checks whether a restart is needed at the end of install
|
||||
See: http://www.jrsoftware.org/ishelp/index.php?topic=scriptevents
|
||||
}
|
||||
begin
|
||||
Result := delayedReboot;
|
||||
end;
|
||||
|
||||
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
|
||||
{
|
||||
Just before the "ready" page.
|
||||
See: http://www.jrsoftware.org/ishelp/index.php?topic=scriptevents
|
||||
}
|
||||
var
|
||||
s: string;
|
||||
begin
|
||||
if downloadMessage <> '' then
|
||||
s := s + CustomMessage('depdownload_memo_title') + ':' + NewLine + FmtMessage(downloadMessage, [Space]) + NewLine;
|
||||
if installMemo <> '' then
|
||||
s := s + CustomMessage('depinstall_memo_title') + ':' + NewLine + FmtMessage(installMemo, [Space]) + NewLine;
|
||||
|
||||
if MemoDirInfo <> '' then
|
||||
s := s + MemoDirInfo + NewLine + NewLine;
|
||||
if MemoGroupInfo <> '' then
|
||||
s := s + MemoGroupInfo + NewLine + NewLine;
|
||||
if MemoTasksInfo <> '' then
|
||||
s := s + MemoTasksInfo;
|
||||
|
||||
Result := s
|
||||
end;
|
||||
|
||||
function NextButtonClick(CurPageID: Integer): boolean;
|
||||
{
|
||||
At each "next" button click
|
||||
See: http://www.jrsoftware.org/ishelp/index.php?topic=scriptevents
|
||||
}
|
||||
begin
|
||||
Result := true;
|
||||
|
||||
if CurPageID = wpReady then begin
|
||||
if downloadMessage <> '' then begin
|
||||
// change isxdl language only if it is not english because isxdl default language is already english
|
||||
if (ActiveLanguage() <> 'en') then begin
|
||||
ExtractTemporaryFile(CustomMessage('isxdl_langfile'));
|
||||
isxdl_SetOption('language', ExpandConstant('{tmp}{\}') + CustomMessage('isxdl_langfile'));
|
||||
end;
|
||||
//isxdl_SetOption('title', FmtMessage(SetupMessage(msgSetupWindowTitle), [CustomMessage('appname')]));
|
||||
|
||||
//if SuppressibleMsgBox(FmtMessage(CustomMessage('depdownload_msg'), [FmtMessage(downloadMessage, [''])]), mbConfirmation, MB_YESNO, IDYES) = IDNO then
|
||||
// Result := false
|
||||
//else if
|
||||
if isxdl_DownloadFiles(StrToInt(ExpandConstant('{wizardhwnd}'))) = 0 then
|
||||
Result := false;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{
|
||||
-----------------------------
|
||||
ARCHITECTURE HELPER FUNCTIONS
|
||||
-----------------------------
|
||||
}
|
||||
|
||||
function IsX86: boolean;
|
||||
{
|
||||
Gets whether the computer is x86 (32 bits).
|
||||
}
|
||||
begin
|
||||
Result := isForcedX86 or (ProcessorArchitecture = paX86) or (ProcessorArchitecture = paUnknown);
|
||||
end;
|
||||
|
||||
function IsX64: boolean;
|
||||
{
|
||||
Gets whether the computer is x64 (64 bits).
|
||||
}
|
||||
begin
|
||||
Result := (not isForcedX86) and Is64BitInstallMode and (ProcessorArchitecture = paX64);
|
||||
end;
|
||||
|
||||
function IsIA64: boolean;
|
||||
{
|
||||
Gets whether the computer is IA64 (Itanium 64 bits).
|
||||
}
|
||||
begin
|
||||
Result := (not isForcedX86) and Is64BitInstallMode and (ProcessorArchitecture = paIA64);
|
||||
end;
|
||||
|
||||
function GetString(x86, x64, ia64: String): String;
|
||||
{
|
||||
Gets a string depending on the computer architecture.
|
||||
Parameters:
|
||||
x86: the string if the computer is x86
|
||||
x64: the string if the computer is x64
|
||||
ia64: the string if the computer is IA64
|
||||
}
|
||||
begin
|
||||
if IsX64() and (x64 <> '') then begin
|
||||
Result := x64;
|
||||
end else if IsIA64() and (ia64 <> '') then begin
|
||||
Result := ia64;
|
||||
end else begin
|
||||
Result := x86;
|
||||
end;
|
||||
end;
|
||||
|
||||
function GetArchitectureString(): String;
|
||||
{
|
||||
Gets the "standard" architecture suffix string.
|
||||
Returns either _x64, _ia64 or nothing.
|
||||
}
|
||||
begin
|
||||
if IsX64() then begin
|
||||
Result := '_x64';
|
||||
end else if IsIA64() then begin
|
||||
Result := '_ia64';
|
||||
end else begin
|
||||
Result := '';
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure SetForceX86(value: boolean);
|
||||
{
|
||||
Forces the setup to use X86 products
|
||||
}
|
||||
begin
|
||||
isForcedX86 := value;
|
||||
end;
|
|
@ -1,49 +0,0 @@
|
|||
[Code]
|
||||
#ifdef UNICODE
|
||||
#define AW "W"
|
||||
#else
|
||||
#define AW "A"
|
||||
#endif
|
||||
|
||||
type
|
||||
INSTALLSTATE = Longint;
|
||||
const
|
||||
INSTALLSTATE_INVALIDARG = -2; // An invalid parameter was passed to the function.
|
||||
INSTALLSTATE_UNKNOWN = -1; // The product is neither advertised or installed.
|
||||
INSTALLSTATE_ADVERTISED = 1; // The product is advertised but not installed.
|
||||
INSTALLSTATE_ABSENT = 2; // The product is installed for a different user.
|
||||
INSTALLSTATE_DEFAULT = 5; // The product is installed for the current user.
|
||||
|
||||
function MsiQueryProductState(szProduct: string): INSTALLSTATE;
|
||||
external 'MsiQueryProductState{#AW}@msi.dll stdcall';
|
||||
|
||||
function MsiEnumRelatedProducts(szUpgradeCode: string; nReserved: dword; nIndex: dword; szProductCode: string): integer;
|
||||
external 'MsiEnumRelatedProducts{#AW}@msi.dll stdcall';
|
||||
|
||||
function MsiGetProductInfo(szProductCode: string; szProperty: string; szValue: string; var nvalueSize: dword): integer;
|
||||
external 'MsiGetProductInfo{#AW}@msi.dll stdcall';
|
||||
|
||||
function msiproduct(productID: string): boolean;
|
||||
begin
|
||||
Result := MsiQueryProductState(productID) = INSTALLSTATE_DEFAULT;
|
||||
end;
|
||||
|
||||
function msiproductupgrade(upgradeCode: string; minVersion: string): boolean;
|
||||
var
|
||||
productCode, version: string;
|
||||
valueSize: dword;
|
||||
begin
|
||||
SetLength(productCode, 39);
|
||||
Result := false;
|
||||
|
||||
if (MsiEnumRelatedProducts(upgradeCode, 0, 0, productCode) = 0) then begin
|
||||
SetLength(version, 39);
|
||||
valueSize := Length(version);
|
||||
|
||||
if (MsiGetProductInfo(productCode, 'VersionString', version, valueSize) = 0) then begin
|
||||
Result := compareversion(version, minVersion) >= 0;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
[Setup]
|
|
@ -1,62 +0,0 @@
|
|||
[Code]
|
||||
function stringtoversion(var temp: String): Integer;
|
||||
var
|
||||
part: String;
|
||||
pos1: Integer;
|
||||
|
||||
begin
|
||||
if (Length(temp) = 0) then begin
|
||||
Result := -1;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
pos1 := Pos('.', temp);
|
||||
if (pos1 = 0) then begin
|
||||
Result := StrToInt(temp);
|
||||
temp := '';
|
||||
end else begin
|
||||
part := Copy(temp, 1, pos1 - 1);
|
||||
temp := Copy(temp, pos1 + 1, Length(temp));
|
||||
Result := StrToInt(part);
|
||||
end;
|
||||
end;
|
||||
|
||||
function compareinnerversion(var x, y: String): Integer;
|
||||
var
|
||||
num1, num2: Integer;
|
||||
|
||||
begin
|
||||
num1 := stringtoversion(x);
|
||||
num2 := stringtoversion(y);
|
||||
if (num1 = -1) and (num2 = -1) then begin
|
||||
Result := 0;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if (num1 < 0) then begin
|
||||
num1 := 0;
|
||||
end;
|
||||
if (num2 < 0) then begin
|
||||
num2 := 0;
|
||||
end;
|
||||
|
||||
if (num1 < num2) then begin
|
||||
Result := -1;
|
||||
end else if (num1 > num2) then begin
|
||||
Result := 1;
|
||||
end else begin
|
||||
Result := compareinnerversion(x, y);
|
||||
end;
|
||||
end;
|
||||
|
||||
function compareversion(versionA, versionB: String): Integer;
|
||||
var
|
||||
temp1, temp2: String;
|
||||
|
||||
begin
|
||||
temp1 := versionA;
|
||||
temp2 := versionB;
|
||||
Result := compareinnerversion(temp1, temp2);
|
||||
end;
|
||||
|
||||
[Setup]
|
|
@ -1,32 +0,0 @@
|
|||
; requires Windows 10, Windows 7 Service Pack 1, Windows 8, Windows 8.1, Windows Server 2003 Service Pack 2, Windows Server 2008 R2 SP1, Windows Server 2008 Service Pack 2, Windows Server 2012, Windows Vista Service Pack 2, Windows XP Service Pack 3
|
||||
; http://www.visualstudio.com/en-us/downloads/
|
||||
|
||||
[CustomMessages]
|
||||
vcredist2017_title=Visual C++ 2017 Redistributable
|
||||
vcredist2017_title_x64=Visual C++ 2017 64-Bit Redistributable
|
||||
|
||||
vcredist2017_size=13.7 MB
|
||||
vcredist2017_size_x64=14.5 MB
|
||||
|
||||
[Code]
|
||||
const
|
||||
vcredist2017_url = 'http://download.microsoft.com/download/1/f/e/1febbdb2-aded-4e14-9063-39fb17e88444/vc_redist.x86.exe';
|
||||
vcredist2017_url_x64 = 'http://download.microsoft.com/download/3/b/f/3bf6e759-c555-4595-8973-86b7b4312927/vc_redist.x64.exe';
|
||||
|
||||
vcredist2017_upgradecode = '{65E5BD06-6392-3027-8C26-853107D3CF1A}';
|
||||
vcredist2017_upgradecode_x64 = '{36F68A90-239C-34DF-B58C-64B30153CE35}';
|
||||
|
||||
procedure vcredist2017(minVersion: string);
|
||||
begin
|
||||
if (not IsIA64()) then begin
|
||||
if (not msiproductupgrade(GetString(vcredist2017_upgradecode, vcredist2017_upgradecode_x64, ''), minVersion)) then
|
||||
AddProduct('vcredist2017' + GetArchitectureString() + '.exe',
|
||||
'/passive /norestart',
|
||||
CustomMessage('vcredist2017_title' + GetArchitectureString()),
|
||||
CustomMessage('vcredist2017_size' + GetArchitectureString()),
|
||||
GetString(vcredist2017_url, vcredist2017_url_x64, ''),
|
||||
false, false, false);
|
||||
end;
|
||||
end;
|
||||
|
||||
[Setup]
|
|
@ -1,49 +0,0 @@
|
|||
[Code]
|
||||
var
|
||||
WindowsVersion: TWindowsVersion;
|
||||
|
||||
procedure initwinversion();
|
||||
begin
|
||||
GetWindowsVersionEx(WindowsVersion);
|
||||
end;
|
||||
|
||||
function exactwinversion(MajorVersion, MinorVersion: integer): boolean;
|
||||
begin
|
||||
Result := (WindowsVersion.Major = MajorVersion) and (WindowsVersion.Minor = MinorVersion);
|
||||
end;
|
||||
|
||||
function minwinversion(MajorVersion, MinorVersion: integer): boolean;
|
||||
begin
|
||||
Result := (WindowsVersion.Major > MajorVersion) or ((WindowsVersion.Major = MajorVersion) and (WindowsVersion.Minor >= MinorVersion));
|
||||
end;
|
||||
|
||||
function maxwinversion(MajorVersion, MinorVersion: integer): boolean;
|
||||
begin
|
||||
Result := (WindowsVersion.Major < MajorVersion) or ((WindowsVersion.Major = MajorVersion) and (WindowsVersion.Minor <= MinorVersion));
|
||||
end;
|
||||
|
||||
function exactwinspversion(MajorVersion, MinorVersion, SpVersion: integer): boolean;
|
||||
begin
|
||||
if exactwinversion(MajorVersion, MinorVersion) then
|
||||
Result := WindowsVersion.ServicePackMajor = SpVersion
|
||||
else
|
||||
Result := true;
|
||||
end;
|
||||
|
||||
function minwinspversion(MajorVersion, MinorVersion, SpVersion: integer): boolean;
|
||||
begin
|
||||
if exactwinversion(MajorVersion, MinorVersion) then
|
||||
Result := WindowsVersion.ServicePackMajor >= SpVersion
|
||||
else
|
||||
Result := true;
|
||||
end;
|
||||
|
||||
function maxwinspversion(MajorVersion, MinorVersion, SpVersion: integer): boolean;
|
||||
begin
|
||||
if exactwinversion(MajorVersion, MinorVersion) then
|
||||
Result := WindowsVersion.ServicePackMajor <= SpVersion
|
||||
else
|
||||
Result := true;
|
||||
end;
|
||||
|
||||
[Setup]
|
|
@ -1,36 +0,0 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Barrier</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>barrier</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>Barrier.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>barrier</string>
|
||||
<!-- TODO: Fix this in v2.0 //-->
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Barrier</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>SYN1</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>@BARRIER_VERSION@</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@BARRIER_VERSION@</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<string>True</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>© 2018 Debauchee Open Source Group</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.12.0</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1 +0,0 @@
|
|||
APPLSYN1
|
Binary file not shown.
|
@ -1,73 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Use the same verbose variable as CMake
|
||||
[ "$VERBOSE" = "1" ] && set -x
|
||||
|
||||
# Exit on unset variables or pipe errors
|
||||
set -uo pipefail
|
||||
|
||||
B_MACOS="Barrier.app/Contents/MacOS"
|
||||
B_VERSION="@BARRIER_VERSION@"
|
||||
B_BINDIR="@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
|
||||
B_BUILDTYPE="@CMAKE_BUILD_TYPE@"
|
||||
B_BARRIERC="Barrier.app/Contents/MacOS/barrierc"
|
||||
B_BARRIERS="Barrier.app/Contents/MacOS/barriers"
|
||||
|
||||
# Colorized output
|
||||
info() { tput bold; echo "$@"; tput sgr0 ; }
|
||||
error() { tput bold; tput setaf 1; echo "$@"; tput sgr0 ; }
|
||||
success() { tput bold; tput setaf 2; echo "$@"; tput sgr0 ; }
|
||||
warn() { tput bold; tput setaf 3; echo "$@"; tput sgr0 ; }
|
||||
|
||||
info "Checking for bundle contents"
|
||||
if [ ! -d "Barrier.app/Contents" ]; then
|
||||
error "Please make sure that the build completed successfully"
|
||||
error "before trying to create the installer."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "$B_MACOS" ]; then
|
||||
info "Removing old binaries from bundle"
|
||||
rm -r "$B_MACOS"
|
||||
fi
|
||||
|
||||
info "Copying binaries into bundle"
|
||||
# Copy the folder instead of globbing unquoted path
|
||||
cp -r "$B_BINDIR" "$B_MACOS" || exit 1
|
||||
|
||||
# Check for macdeployqt on MacPorts
|
||||
if which -s port ; then
|
||||
info "MacPorts found, searching for macdeployqt"
|
||||
DEPLOYQT="$(port contents qt5-qttools | grep --only --max-count 1 '/.*macdeployqt')"
|
||||
if [ ! -x "$DEPLOYQT" ]; then
|
||||
error "Please install package qt5-qttools"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check for macdeployqt on Homebrew
|
||||
if which -s brew ; then
|
||||
info "Homebrew found, searching for macdeployqt"
|
||||
DEPLOYQT="$(brew list qt@5 | grep --only '/.*macdeployqt' | head -1)"
|
||||
if [ ! -x "$DEPLOYQT" ]; then
|
||||
error "Please install package qt"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Use macdeployqt to include libraries and create dmg
|
||||
if [ "$B_BUILDTYPE" = "Release" ]; then
|
||||
info "Building Release disk image (dmg)"
|
||||
"$DEPLOYQT" Barrier.app -dmg \
|
||||
-executable="$B_BARRIERC" \
|
||||
-executable="$B_BARRIERS" || exit 1
|
||||
mv "Barrier.dmg" "Barrier-$B_VERSION.dmg" || exit 1
|
||||
success "Created Barrier-$B_VERSION.dmg"
|
||||
else
|
||||
warn "Disk image (dmg) only created for Release builds"
|
||||
info "Building debug bundle"
|
||||
"$DEPLOYQT" Barrier.app -no-strip \
|
||||
-executable="$B_BARRIERC" \
|
||||
-executable="$B_BARRIERS" || exit 1
|
||||
success "Bundle created successfully"
|
||||
fi
|
|
@ -1,83 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# add warning for users running manually
|
||||
warn() { tput bold; tput setaf 3; echo "$@"; tput sgr0 ; }
|
||||
warn "The scripts build_installer.sh and reref_dylibs.sh have been deprecated."
|
||||
warn "Please use build_dist.sh instead to deploy using macdeployqt"
|
||||
|
||||
# change this to rename the installer package
|
||||
B_DMG="Barrier-@BARRIER_VERSION@.dmg"
|
||||
|
||||
cd "$( dirname "$0" )"
|
||||
OWNDIR="$( pwd )"
|
||||
|
||||
B_REREF_SCRIPT="$OWNDIR/reref_dylibs.sh"
|
||||
if [ ! -x "$B_REREF_SCRIPT" ]; then
|
||||
echo "Missing script: $B_REREF_SCRIPT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# remove any old copies so there's no confusion about whether this
|
||||
# process completes successfully or not
|
||||
rm -rf temp.dmg "$B_DMG"
|
||||
|
||||
cd Barrier.app/Contents 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Please make sure that the build completed successfully"
|
||||
echo "before trying to create the installer."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# MacOS folder holds the executables, non-system libraries,
|
||||
# and the startup script
|
||||
rm -rf MacOS
|
||||
mkdir MacOS || exit 1
|
||||
cd MacOS || exit 1
|
||||
|
||||
# copy all executables
|
||||
cp @CMAKE_RUNTIME_OUTPUT_DIRECTORY@/* . || exit 1
|
||||
|
||||
# copy the qt platform plugin
|
||||
# TODO: this is hacky and will probably break if there is more than one qt
|
||||
# version installed. need a better way to find this library
|
||||
B_COCOA=$(find /usr/local/Cellar/qt -type f -name libqcocoa.dylib | head -1)
|
||||
if [ "x$B_COCOA" = "x" ]; then
|
||||
B_COCOA=$(find /opt/local/libexec/qt5/plugins -type f -name libqcocoa.dylib | head -1)
|
||||
fi
|
||||
if [ "x$B_COCOA" = "x" ]; then
|
||||
echo "Could not find cocoa platform plugin"
|
||||
exit 1
|
||||
fi
|
||||
mkdir platforms
|
||||
cp $B_COCOA platforms/ || exit 1
|
||||
|
||||
# make sure we can r/w all these binaries
|
||||
chmod -R u+rw * || exit 1
|
||||
|
||||
# only one executable (barrier) needs non-system libraries although it's
|
||||
# libraries can call each other. use a recursive script to handle the
|
||||
# re-referencing
|
||||
$B_REREF_SCRIPT barrier || exit 1
|
||||
# the cocoa platform plugin also needs to know where to find the qt libraries.
|
||||
# because it exists in a subdirectory we append ../ to the relative path of the
|
||||
# libraries in its metadata
|
||||
$B_REREF_SCRIPT platforms/libqcocoa.dylib ../ || exit 1
|
||||
|
||||
echo "Barrier.app created successfully"
|
||||
|
||||
# sanity check so we don't distribute a dmg with debug symbols
|
||||
if [ "@CMAKE_BUILD_TYPE@" != "Release" ]; then
|
||||
echo "dmg only created for Release builds"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# create the DMG to be distributed in build/bundle
|
||||
cd ../../..
|
||||
hdiutil create -size 64m -fs HFS+ -volname "Barrier" temp.dmg || exit 1
|
||||
hdiutil attach temp.dmg -mountpoint mnt || exit 1
|
||||
cp -r Barrier.app mnt/ || exit 1
|
||||
hdiutil detach mnt || exit 1
|
||||
hdiutil convert temp.dmg -format UDZO -o "$B_DMG" || exit 1
|
||||
rm temp.dmg
|
||||
|
||||
echo "dmg $B_DMG created successfully"
|
|
@ -1,49 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $1 = binary (program or dylib)
|
||||
B_TARGET=$1
|
||||
if [ "x$B_TARGET" = "x" ]; then
|
||||
|
||||
# add warning for users running manually
|
||||
warn() { tput bold; tput setaf 3; echo "$@"; tput sgr0 ; }
|
||||
warn "The scripts build_installer.sh and reref_dylibs.sh have been deprecated."
|
||||
warn "Please use build_dist.sh instead to deploy using macdeployqt"
|
||||
|
||||
echo "Which binary needs to be re-referenced?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$(dirname "$B_TARGET")" || exit 1
|
||||
|
||||
# where to find non-system libraries relative to target's directory.
|
||||
# the vast majority of the time this should be empty
|
||||
B_REL_PATH=$2
|
||||
|
||||
# we're in target's directory now. trim off the path
|
||||
B_TARGET=$(basename "$B_TARGET")
|
||||
|
||||
# get a list of non-system libraries and make local copies
|
||||
B_LIBS=$(otool -XL "$B_TARGET" | awk '{ print $1 }' | grep -Ev '^(/usr/lib|/System)')
|
||||
[ $? -ne 0 ] && exit 1
|
||||
for B_LIB in $B_LIBS; do
|
||||
B_LIB_NAME=$(basename "$B_LIB")
|
||||
# otool reports barrier as "barrier:" which fails self-reference test below
|
||||
B_LIB_NAME=${B_LIB_NAME//:}
|
||||
|
||||
# ignore self-references
|
||||
[ "$B_TARGET" = "$B_LIB_NAME" ] && continue
|
||||
|
||||
B_DST=${B_REL_PATH}${B_LIB_NAME}
|
||||
if [ ! -e "$B_DST" ]; then
|
||||
cp "$B_LIB" "$B_DST" || exit 1
|
||||
chmod u+rw "$B_DST" || exit 1
|
||||
# recursively call this script on libraries purposefully not passing
|
||||
# $B_REL_PATH so that it is only used explicitly
|
||||
$0 "$B_DST"
|
||||
fi
|
||||
|
||||
# adjust the target's metadata to point to the local copy
|
||||
# rather than the system-wide copy which would only exist on
|
||||
# a development machine
|
||||
install_name_tool -change "$B_LIB" "@loader_path/$B_DST" "$B_TARGET" || exit 1
|
||||
done
|
|
@ -1,105 +0,0 @@
|
|||
%global barrier_revision @BARRIER_REVISION@
|
||||
Summary: Keyboard and mouse sharing solution
|
||||
Name: barrier
|
||||
Version: @BARRIER_VERSION@
|
||||
Release: @BARRIER_BUILD_NUMBER@%{?dist}
|
||||
License: GPLv2
|
||||
Group: System Environment/Daemons
|
||||
URL: https://github.com/debauchee/barrier
|
||||
Source0: https://github.com/debauchee/barrier/archive/v%{version}.tar.gz
|
||||
|
||||
BuildRequires: cmake3
|
||||
BuildRequires: avahi-compat-libdns_sd-devel
|
||||
BuildRequires: libX11-devel
|
||||
BuildRequires: libXtst-devel
|
||||
BuildRequires: qt5-qtbase-devel
|
||||
BuildRequires: libcurl-devel
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: openssl-devel
|
||||
|
||||
%description
|
||||
Barrier allows you to share one mouse and keyboard between multiple computers.
|
||||
Work seamlessly across Windows, macOS and Linux.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
|
||||
|
||||
%build
|
||||
%{cmake3} -DSYNERGY_VERSION_STAGE:STRING=@BARRIER_VERSION_STAGE@ -DSYNERGY_REVISION:STRING=%{barrier_revision} .
|
||||
make %{?_smp_mflags}
|
||||
|
||||
|
||||
%install
|
||||
install -D -p -m 0755 bin/barrier %{buildroot}%{_bindir}/barrier
|
||||
install -D -p -m 0755 bin/barrierc %{buildroot}%{_bindir}/barrierc
|
||||
install -D -p -m 0755 bin/barriers %{buildroot}%{_bindir}/barriers
|
||||
install -D -p -m 0644 doc/barrierc.1 %{buildroot}%{_mandir}/man1/barrierc.1
|
||||
install -D -p -m 0644 doc/barriers.1 %{buildroot}%{_mandir}/man1/barriers.1
|
||||
install -D -p -m 0644 res/barrier.desktop %{buildroot}%{_datadir}/applications/barrier.desktop
|
||||
install -D -p -m 0644 res/barrier.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/barrier.svg
|
||||
|
||||
cd %{buildroot}%{_bindir}
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/metainfo
|
||||
## Write AppStream
|
||||
cat <<END> %{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright 2018 Ding-Yi Chen <dchen@redhat.com> -->
|
||||
<component type="desktop-application">
|
||||
<id>%{name}</id>
|
||||
<metadata_license>FSFAP</metadata_license>
|
||||
<project_license>GPLv2</project_license>
|
||||
<name>barrier</name>
|
||||
<summary>Share mouse and keyboard between multiple computers over the network</summary>
|
||||
|
||||
<description>
|
||||
<p>
|
||||
Barrier allows you to share one mouse and keyboard between multiple computers.
|
||||
Work seamlessly across Windows, macOS and Linux.
|
||||
</p>
|
||||
</description>
|
||||
|
||||
<launchable type="desktop-id">%{name}.desktop</launchable>
|
||||
|
||||
<url type="homepage">https://github.com/debauchee/barrier</url>
|
||||
|
||||
<provides>
|
||||
<binary>barrier</binary>
|
||||
<binary>barrierc</binary>
|
||||
<binary>barriers</binary>
|
||||
</provides>
|
||||
|
||||
<releases>
|
||||
<release version="%{version}" date="2019-03-21" />
|
||||
</releases>
|
||||
</component>
|
||||
END
|
||||
|
||||
desktop-file-install --delete-original \
|
||||
--dir %{buildroot}%{_datadir}/applications \
|
||||
--set-icon=%{_datadir}/icons/hicolor/scalable/apps/barrier.svg \
|
||||
%{buildroot}%{_datadir}/applications/barrier.desktop
|
||||
|
||||
desktop-file-validate %{buildroot}/%{_datadir}/applications/barrier.desktop
|
||||
|
||||
%files
|
||||
# None of the documentation files are actually useful here, they all point to
|
||||
# the online website, so include just one, the README
|
||||
%doc LICENSE ChangeLog res/Readme.txt doc/barrier.conf.example*
|
||||
%{_bindir}/barrier
|
||||
%{_bindir}/barrierc
|
||||
%{_bindir}/barriers
|
||||
%{_datadir}/icons/hicolor/scalable/apps/barrier.svg
|
||||
%{_datadir}/applications/barrier.desktop
|
||||
%{_datadir}/metainfo/%{name}.appdata.xml
|
||||
%{_mandir}/man1/barrierc.1*
|
||||
%{_mandir}/man1/barriers.1*
|
||||
|
||||
%changelog
|
||||
* Thu Mar 21 2019 wendall911 <wendallc@83864.com>
|
||||
- Actual working spec file for Fedora
|
||||
|
||||
* Sat Jan 27 2018 Debauchee <todo@mail.com>
|
||||
- Initial version of the package
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProductVersion>3.10</ProductVersion>
|
||||
<ProjectGuid>{d4ba9f39-6a35-4c8f-9cb2-67fcbe5cab17}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>Barrier</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>wix\obj\$(Configuration)\</IntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<WixExtension Include="WixFirewallExtension">
|
||||
<HintPath>$(WixExtDir)\WixFirewallExtension.dll</HintPath>
|
||||
<Name>WixFirewallExtension</Name>
|
||||
</WixExtension>
|
||||
<WixExtension Include="WixUtilExtension">
|
||||
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
|
||||
<Name>WixUtilExtension</Name>
|
||||
</WixExtension>
|
||||
<WixExtension Include="WixUIExtension">
|
||||
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
|
||||
<Name>WixUIExtension</Name>
|
||||
</WixExtension>
|
||||
<Compile Include="Product.wxs"/>
|
||||
<Content Include="Include.wxi"/>
|
||||
</ItemGroup>
|
||||
<Import Project="$(WixTargetsPath)"/>
|
||||
</Project>
|
|
@ -1,25 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Include>
|
||||
<?define Name="Barrier" ?>
|
||||
<?define Version="@BARRIER_WIX_VERSION@" ?>
|
||||
<?define QtVersion="@QT_VERSION@" ?>
|
||||
<?define Author="Debauchee Open Source Group" ?>
|
||||
<?define BinPath="@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/$(var.Configuration)" ?>
|
||||
<?define ResPath="@CMAKE_CURRENT_SOURCE_DIR@/res" ?>
|
||||
<?define ExtPath="@CMAKE_CURRENT_SOURCE_DIR@/ext" ?>
|
||||
<?if $(var.Platform) = "x64" ?>
|
||||
<?define ProgramFilesFolder="ProgramFiles64Folder" ?>
|
||||
<?define PlatformSimpleName="64-bit" ?>
|
||||
<?define UpgradeGuid="E8A4FA54-14B9-4FD1-8E00-7BC46555FDA0" ?>
|
||||
<?define QtPath="@CMAKE_PREFIX_PATH@" ?>
|
||||
<?else ?>
|
||||
<?define ProgramFilesFolder="ProgramFilesFolder" ?>
|
||||
<?define PlatformSimpleName="32-bit" ?>
|
||||
<?define UpgradeGuid="BE0B9FD8-45E2-4A8E-A0D8-1F774D074A78" ?>
|
||||
<?define QtPath="@CMAKE_PREFIX_PATH@" ?>
|
||||
<?endif ?>
|
||||
<?define QtBinPath="$(var.QtPath)\bin" ?>
|
||||
<?define QtPlatformPath="$(var.QtPath)\plugins\platforms" ?>
|
||||
<?define OpenSSLPath="$(var.ExtPath)\openssl\windows\$(var.Platform)" ?>
|
||||
<?define OpenSSLBinPath="$(var.OpenSSLPath)\bin" ?>
|
||||
</Include>
|
|
@ -1,103 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
||||
<?include Include.wxi?>
|
||||
<Product Id="*" Language="1033" Manufacturer="$(var.Author)" Name="$(var.Name) ($(var.PlatformSimpleName))" UpgradeCode="$(var.UpgradeGuid)" Version="$(var.Version)">
|
||||
<Package Compressed="yes" InstallScope="perMachine" InstallerVersion="301"/>
|
||||
<MajorUpgrade DowngradeErrorMessage="A newer version of $(var.Name) is already installed."/>
|
||||
<MediaTemplate EmbedCab="yes"/>
|
||||
<UIRef Id="WixUI_InstallDir"/>
|
||||
<!-- causes ICE61 warning, but stops user from installing many instances from nightly builds. -->
|
||||
<Upgrade Id="$(var.UpgradeGuid)">
|
||||
<UpgradeVersion Minimum="0.0.0.0" Property="UPGRADE"/>
|
||||
</Upgrade>
|
||||
<Feature Id="ProductFeature" Title="$(var.Name)">
|
||||
<ComponentGroupRef Id="ProductComponents"/>
|
||||
<ComponentGroupRef Id="ProductQtPluginComponents"/>
|
||||
<ComponentRef Id="RegistryEntries"/>
|
||||
</Feature>
|
||||
<DirectoryRef Id="TARGETDIR">
|
||||
<Component Guid="7CF3564D-1F8E-4D3D-9781-E1EE22D5BD67" Id="RegistryEntries">
|
||||
<RegistryKey ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes" Key="Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" Root="HKLM">
|
||||
<RegistryValue Name="[INSTALLFOLDER]barriers.exe" Type="string" Value="~ HIGHDPIAWARE WIN7RTM"/>
|
||||
</RegistryKey>
|
||||
<!-- Windows 8 and later only -->
|
||||
<Condition><![CDATA[Installed OR (VersionNT >= 602)]]></Condition>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
<Icon Id="barrier.ico" SourceFile="$(var.ResPath)/barrier.ico"/>
|
||||
<WixVariable Id="WixUILicenseRtf" Value="$(var.ResPath)\License.rtf"/>
|
||||
<WixVariable Id="WixUIBannerBmp" Value="$(var.ResPath)\banner.bmp"/>
|
||||
<WixVariable Id="WixUIDialogBmp" Value="$(var.ResPath)\dialog.bmp"/>
|
||||
<Property Id="ARPPRODUCTICON" Value="barrier.ico"/>
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
|
||||
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable"/>
|
||||
<CustomAction ExeCommand="" FileKey="GuiProgram" Id="StartGui" Return="asyncNoWait"/>
|
||||
<UI>
|
||||
<Publish Control="Finish" Dialog="ExitDialog" Event="DoAction" Value="StartGui">NOT Installed</Publish>
|
||||
</UI>
|
||||
</Product>
|
||||
<Fragment>
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="$(var.ProgramFilesFolder)">
|
||||
<Directory Id="INSTALLFOLDER" Name="$(var.Name)">
|
||||
<Directory Id="OpenSSLDir" Name="OpenSSL"/>
|
||||
<Directory Id="PlatformsDir" Name="Platforms"/>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="ProgramMenuFolder"/>
|
||||
</Directory>
|
||||
</Fragment>
|
||||
<Fragment>
|
||||
<ComponentGroup Directory="INSTALLFOLDER" Id="ProductComponents">
|
||||
<Component Guid="EC9AD3B0-277C-4157-B5C8-5FD5B6A5F4AD" Id="Core">
|
||||
<File KeyPath="yes" Source="$(var.BinPath)/barrierd.exe"/>
|
||||
<ServiceInstall Description="Controls the $(var.Name) foreground processes." DisplayName="$(var.Name)" ErrorControl="normal" Id="ServiceInstall" Name="Barrier" Start="auto" Type="ownProcess">
|
||||
<util:ServiceConfig FirstFailureActionType="restart" ResetPeriodInDays="1" RestartServiceDelayInSeconds="1" SecondFailureActionType="restart" ThirdFailureActionType="restart"/>
|
||||
</ServiceInstall>
|
||||
<ServiceControl Id="ServiceControl" Name="Barrier" Remove="uninstall" Start="install" Stop="both"/>
|
||||
<File Source="$(var.BinPath)/barriers.exe">
|
||||
<fire:FirewallException Id="ServerFirewallException" IgnoreFailure="yes" Name="$(var.Name)" Scope="any"/>
|
||||
</File>
|
||||
<File Source="$(var.BinPath)/barrierc.exe"/>
|
||||
<File Source="$(var.OpenSSLBinPath)/libeay32.dll"/>
|
||||
<File Source="$(var.OpenSSLBinPath)/ssleay32.dll"/>
|
||||
<File Source="$(var.OpenSSLBinPath)/openssl.exe"/>
|
||||
<File Source="$(var.ResPath)/openssl/barrier.conf"/>
|
||||
</Component>
|
||||
<Component Guid="BAC8149B-6287-45BF-9C27-43D71ED40214" Id="Gui">
|
||||
<File Id="GuiProgram" KeyPath="yes" Source="$(var.BinPath)/barrier.exe">
|
||||
<Shortcut Advertise="yes" Directory="ProgramMenuFolder" Icon="barrier.ico" Id="GuiShortcut" Name="$(var.Name)"/>
|
||||
<fire:FirewallException Id="GuiFirewallException" IgnoreFailure="yes" Name="$(var.Name)" Scope="any"/>
|
||||
</File>
|
||||
<?if $(var.Configuration) = "Debug" ?>
|
||||
<File Source="$(var.QtBinPath)\Qt5Cored.dll"/>
|
||||
<File Source="$(var.QtBinPath)\Qt5Guid.dll"/>
|
||||
<File Source="$(var.QtBinPath)\Qt5Networkd.dll"/>
|
||||
<File Source="$(var.QtBinPath)\Qt5Svgd.dll"/>
|
||||
<File Source="$(var.QtBinPath)\Qt5Widgetsd.dll"/>
|
||||
<File Source="$(var.QtBinPath)\libGLESv2d.dll"/>
|
||||
<File Source="$(var.QtBinPath)\libEGLd.dll"/>
|
||||
<!-- Hacky -->
|
||||
<File Source="C:\Program Files (x86)\Windows Kits\10\bin\$(var.Platform)\ucrt\ucrtbased.dll"/>
|
||||
<?else ?>
|
||||
<File Source="$(var.QtBinPath)\Qt5Core.dll"/>
|
||||
<File Source="$(var.QtBinPath)\Qt5Gui.dll"/>
|
||||
<File Source="$(var.QtBinPath)\Qt5Network.dll"/>
|
||||
<File Source="$(var.QtBinPath)\Qt5Svg.dll"/>
|
||||
<File Source="$(var.QtBinPath)\Qt5Widgets.dll"/>
|
||||
<File Source="$(var.QtBinPath)\libGLESv2.dll"/>
|
||||
<File Source="$(var.QtBinPath)\libEGL.dll"/>
|
||||
<?endif ?>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
<ComponentGroup Directory="PlatformsDir" Id="ProductQtPluginComponents">
|
||||
<Component Guid="684EFA14-856B-440E-A5E6-E90E04E36B41" Id="QtPlatformPlugin">
|
||||
<?if $(var.Configuration) = "Debug" ?>
|
||||
<File Source="$(var.QtPlatformPath)\qwindowsd.dll"/>
|
||||
<?else ?>
|
||||
<File Source="$(var.QtPlatformPath)\qwindows.dll"/>
|
||||
<?endif ?>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -5,11 +5,14 @@ To install on Mac OS X with the .zip distribution (first seen in 1.3.6) you must
|
|||
|
||||
1. Extract the zip file to any location (usually double click will do this)
|
||||
2. Open Terminal, and cd to the extracted directory (e.g. /Users/my-name/Downloads/extracted-dir/)
|
||||
3. Copy the binaries to /usr/bin using: sudo cp barrier* /usr/bin
|
||||
4. Correct the permissions and ownership: sudo chown root:wheel /usr/bin/barrier*; sudo chmod 555 /usr/bin/barrier*
|
||||
3. Change to super user (use the su command)
|
||||
4. Copy the binaries to /usr/bin using: cp synergy* /usr/bin
|
||||
|
||||
Alternatively, you can copy the binaries as root. How to enable the root user in Mac OS X:
|
||||
How to enable the root user in Mac OS X:
|
||||
http://support.apple.com/en-us/ht1528
|
||||
|
||||
Once the binaries have been copied to /usr/bin, you should follow the configuration guide:
|
||||
http://synergy2.sourceforge.net/configuration.html
|
||||
|
||||
If you have any problems, see the [[Support]] page:
|
||||
http://synergy-project.org/help/
|
||||
|
|
|
@ -0,0 +1,234 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorCodeStyle>
|
||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>CodeStyleData</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="AlignAssignments">false</value>
|
||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToTypeName">false</value>
|
||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
||||
<value type="bool" key="IndentBlockBody">true</value>
|
||||
<value type="bool" key="IndentBlockBraces">false</value>
|
||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
||||
<value type="bool" key="IndentClassBraces">false</value>
|
||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
||||
<value type="bool" key="IndentEnumBraces">false</value>
|
||||
<value type="bool" key="IndentFunctionBody">true</value>
|
||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
||||
<value type="int" key="IndentSize">4</value>
|
||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
||||
<value type="int" key="PaddingMode">2</value>
|
||||
<value type="bool" key="SpacesForTabs">false</value>
|
||||
<value type="int" key="TabSize">4</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>DisplayName</variable>
|
||||
<value type="QString">Synergy</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorCodeStyle>
|
||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>CodeStyleData</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="AlignAssignments">false</value>
|
||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToTypeName">false</value>
|
||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
||||
<value type="bool" key="IndentBlockBody">true</value>
|
||||
<value type="bool" key="IndentBlockBraces">false</value>
|
||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
||||
<value type="bool" key="IndentClassBraces">false</value>
|
||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
||||
<value type="bool" key="IndentEnumBraces">false</value>
|
||||
<value type="bool" key="IndentFunctionBody">true</value>
|
||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
||||
<value type="int" key="IndentSize">4</value>
|
||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
||||
<value type="int" key="PaddingMode">2</value>
|
||||
<value type="bool" key="SpacesForTabs">false</value>
|
||||
<value type="int" key="TabSize">4</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>DisplayName</variable>
|
||||
<value type="QString">Synergy</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorCodeStyle>
|
||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>CodeStyleData</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="AlignAssignments">false</value>
|
||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToTypeName">false</value>
|
||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
||||
<value type="bool" key="IndentBlockBody">true</value>
|
||||
<value type="bool" key="IndentBlockBraces">false</value>
|
||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
||||
<value type="bool" key="IndentClassBraces">false</value>
|
||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
||||
<value type="bool" key="IndentEnumBraces">false</value>
|
||||
<value type="bool" key="IndentFunctionBody">true</value>
|
||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
||||
<value type="int" key="IndentSize">4</value>
|
||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
||||
<value type="int" key="PaddingMode">2</value>
|
||||
<value type="bool" key="SpacesForTabs">false</value>
|
||||
<value type="int" key="TabSize">4</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>DisplayName</variable>
|
||||
<value type="QString">Synergy</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorCodeStyle>
|
||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>CodeStyleData</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="AlignAssignments">false</value>
|
||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToTypeName">false</value>
|
||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
||||
<value type="bool" key="IndentBlockBody">true</value>
|
||||
<value type="bool" key="IndentBlockBraces">false</value>
|
||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
||||
<value type="bool" key="IndentClassBraces">false</value>
|
||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
||||
<value type="bool" key="IndentEnumBraces">false</value>
|
||||
<value type="bool" key="IndentFunctionBody">true</value>
|
||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
||||
<value type="int" key="IndentSize">4</value>
|
||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
||||
<value type="int" key="PaddingMode">2</value>
|
||||
<value type="bool" key="SpacesForTabs">false</value>
|
||||
<value type="int" key="TabSize">4</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>DisplayName</variable>
|
||||
<value type="QString">Synergy</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorCodeStyle>
|
||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>CodeStyleData</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="AlignAssignments">false</value>
|
||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToTypeName">false</value>
|
||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
||||
<value type="bool" key="IndentBlockBody">true</value>
|
||||
<value type="bool" key="IndentBlockBraces">false</value>
|
||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
||||
<value type="bool" key="IndentClassBraces">false</value>
|
||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
||||
<value type="bool" key="IndentEnumBraces">false</value>
|
||||
<value type="bool" key="IndentFunctionBody">true</value>
|
||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
||||
<value type="int" key="IndentSize">4</value>
|
||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
||||
<value type="int" key="PaddingMode">2</value>
|
||||
<value type="bool" key="SpacesForTabs">false</value>
|
||||
<value type="int" key="TabSize">4</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>DisplayName</variable>
|
||||
<value type="QString">Synergy</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorCodeStyle>
|
||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>CodeStyleData</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="AlignAssignments">false</value>
|
||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToTypeName">false</value>
|
||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
||||
<value type="bool" key="IndentBlockBody">true</value>
|
||||
<value type="bool" key="IndentBlockBraces">false</value>
|
||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
||||
<value type="bool" key="IndentClassBraces">false</value>
|
||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
||||
<value type="bool" key="IndentEnumBraces">false</value>
|
||||
<value type="bool" key="IndentFunctionBody">true</value>
|
||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
||||
<value type="int" key="IndentSize">4</value>
|
||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
||||
<value type="int" key="PaddingMode">2</value>
|
||||
<value type="bool" key="SpacesForTabs">false</value>
|
||||
<value type="int" key="TabSize">4</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>DisplayName</variable>
|
||||
<value type="QString">Synergy</value>
|
||||
</data>
|
||||
</qtcreator>
|
|
@ -1,10 +0,0 @@
|
|||
To recreate the generated part of barrierc manpage use a command like:
|
||||
help2man -N --output=barrierc.1 --name='Barrier Keyboard/Mouse Client' /path/to/barrierc
|
||||
|
||||
And for barriers:
|
||||
help2man -N --output=barriers.1 --name='Barrier Keyboard/Mouse Server' /path/to/barriers
|
||||
|
||||
After that manually fixup:
|
||||
* replace your home directory with $HOME in barriers.1
|
||||
* revert formatting of FILES and COPYRIGHT sections to match formatting of existing version.
|
||||
* add note referencing this file for instructions to the first line.
|
|
@ -1,17 +0,0 @@
|
|||
# barebones barrier.conf example
|
||||
# for two computers side by side
|
||||
# replace screen.name.server and screen.name.client with your screen names from gui
|
||||
# there's a 50/50 chance you'll want to swap left and right
|
||||
# save this as barrier.conf in your home folder and "Use existing configuration" on server
|
||||
|
||||
section: screens
|
||||
screen.name.server:
|
||||
screen.name.client:
|
||||
end
|
||||
|
||||
section: links
|
||||
screen.name.server:
|
||||
left = screen.name.client
|
||||
screen.name.client:
|
||||
right = screen.name.server
|
||||
end
|
|
@ -1,73 +0,0 @@
|
|||
.\" See UpdateManpages.txt about modification of this file. Most of it was generated by help2man 1.47.8.
|
||||
.TH BARRIERC "1" "November 2019" "barrierc 2.4.0-release" "User Commands"
|
||||
.SH NAME
|
||||
barrierc \- Barrier Keyboard/Mouse Client
|
||||
.SH SYNOPSIS
|
||||
.B barrierc
|
||||
[\fI\,--yscroll <delta>\/\fR] [\fI\,--display <display>\/\fR] [\fI\,--no-xinitthreads\/\fR] [\fI\,--daemon|--no-daemon\/\fR] [\fI\,--name <screen-name>\/\fR] [\fI\,--restart|--no-restart\/\fR] [\fI\,--debug <level>\/\fR] \fI\,<server-address>\/\fR
|
||||
.SH DESCRIPTION
|
||||
Start the barrier client and connect to a remote server component.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB\-d\fR, \fB\-\-debug\fR <level>
|
||||
filter out log messages with priority below level.
|
||||
level may be: FATAL, ERROR, WARNING, NOTE, INFO,
|
||||
DEBUG, DEBUG1, DEBUG2.
|
||||
.TP
|
||||
\fB\-n\fR, \fB\-\-name\fR <screen\-name> use screen\-name instead the hostname to identify
|
||||
this screen in the configuration.
|
||||
.TP
|
||||
\fB\-1\fR, \fB\-\-no\-restart\fR
|
||||
do not try to restart on failure.
|
||||
.TP
|
||||
\fB\-\-restart\fR
|
||||
restart the server automatically if it fails. (*)
|
||||
.TP
|
||||
\fB\-l\fR \fB\-\-log\fR <file>
|
||||
write log messages to file.
|
||||
.TP
|
||||
\fB\-\-no\-tray\fR
|
||||
disable the system tray icon.
|
||||
.TP
|
||||
\fB\-\-enable\-drag\-drop\fR
|
||||
enable file drag & drop.
|
||||
.TP
|
||||
\fB\-\-enable\-crypto\fR
|
||||
enable the crypto (ssl) plugin.
|
||||
.TP
|
||||
\fB\-\-display\fR <display>
|
||||
connect to the X server at <display>
|
||||
.TP
|
||||
\fB\-\-no\-xinitthreads\fR
|
||||
do not call XInitThreads()
|
||||
.TP
|
||||
\fB\-f\fR, \fB\-\-no\-daemon\fR
|
||||
run in the foreground.
|
||||
.TP
|
||||
\fB\-\-daemon\fR
|
||||
run as a daemon. (*)
|
||||
.TP
|
||||
\fB\-\-yscroll\fR <delta>
|
||||
defines the vertical scrolling delta, which is
|
||||
120 by default.
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
display this help and exit.
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
display version information and exit.
|
||||
.PP
|
||||
Default options are marked with a *
|
||||
.PP
|
||||
The server address is of the form: [<hostname>][:<port>]. The hostname
|
||||
must be the address or hostname of the server. Placing brackets around
|
||||
an IPv6 address is required when also specifying a port number and
|
||||
optional otherwise. The default port number is 24800.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2018 Debauchee Open Source Group
|
||||
.br
|
||||
Copyright \(co 2012\-2016 Symless Ltd.
|
||||
.br
|
||||
Copyright \(co 2008\-2014 Nick Bolton
|
||||
.br
|
||||
Copyright \(co 2002\-2014 Chris Schoeneman
|
|
@ -1,87 +0,0 @@
|
|||
.\" See UpdateManpages.txt about modification of this file. Most of it was generated by help2man 1.47.8.
|
||||
.TH BARRIERS "1" "November 2019" "barriers 2.4.0-release" "User Commands"
|
||||
.SH NAME
|
||||
barriers \- Barrier Keyboard/Mouse Server
|
||||
.SH SYNOPSIS
|
||||
.B barriers
|
||||
[\fI\,--address <address>\/\fR] [\fI\,--config <pathname>\/\fR] [\fI\,--display <display>\/\fR] [\fI\,--no-xinitthreads\/\fR] [\fI\,--daemon|--no-daemon\/\fR] [\fI\,--name <screen-name>\/\fR] [\fI\,--restart|--no-restart\/\fR] [\fI\,--debug <level>\/\fR]
|
||||
.SH DESCRIPTION
|
||||
Start the barrier server component.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB\-a\fR, \fB\-\-address\fR <address>
|
||||
listen for clients on the given address.
|
||||
.TP
|
||||
\fB\-c\fR, \fB\-\-config\fR <pathname>
|
||||
use the named configuration file instead.
|
||||
.TP
|
||||
\fB\-d\fR, \fB\-\-debug\fR <level>
|
||||
filter out log messages with priority below level.
|
||||
level may be: FATAL, ERROR, WARNING, NOTE, INFO,
|
||||
DEBUG, DEBUG1, DEBUG2.
|
||||
.TP
|
||||
\fB\-n\fR, \fB\-\-name\fR <screen\-name> use screen\-name instead the hostname to identify
|
||||
this screen in the configuration.
|
||||
.TP
|
||||
\fB\-1\fR, \fB\-\-no\-restart\fR
|
||||
do not try to restart on failure.
|
||||
.TP
|
||||
\fB\-\-restart\fR
|
||||
restart the server automatically if it fails. (*)
|
||||
.TP
|
||||
\fB\-l\fR \fB\-\-log\fR <file>
|
||||
write log messages to file.
|
||||
.TP
|
||||
\fB\-\-no\-tray\fR
|
||||
disable the system tray icon.
|
||||
.TP
|
||||
\fB\-\-enable\-drag\-drop\fR
|
||||
enable file drag & drop.
|
||||
.TP
|
||||
\fB\-\-enable\-crypto\fR
|
||||
enable the crypto (ssl) plugin.
|
||||
.TP
|
||||
\fB\-\-display\fR <display>
|
||||
connect to the X server at <display>
|
||||
.TP
|
||||
\fB\-\-no\-xinitthreads\fR
|
||||
do not call XInitThreads()
|
||||
.TP
|
||||
\fB\-\-screen\-change\-script\fR <path>
|
||||
full path to script to run on screen change
|
||||
first argument is the new screen name
|
||||
.TP
|
||||
\fB\-f\fR, \fB\-\-no\-daemon\fR
|
||||
run in the foreground.
|
||||
.TP
|
||||
\fB\-\-daemon\fR
|
||||
run as a daemon. (*)
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
display this help and exit.
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
display version information and exit.
|
||||
.PP
|
||||
Default options are marked with a *
|
||||
.PP
|
||||
The argument for \fB\-\-address\fR is of the form: [<hostname>][:<port>]. The
|
||||
hostname must be the address or hostname of an interface on the system.
|
||||
Placing brackets around an IPv6 address is required when also specifying
|
||||
a port number and optional otherwise. The default is to listen on all
|
||||
interfaces using port number 24800.
|
||||
.SH FILES
|
||||
If no configuration file pathname is provided then the first of the
|
||||
following to load successfully sets the configuration:
|
||||
.IP
|
||||
.I $HOME/.local/share/barrier/.barrier.conf
|
||||
.br
|
||||
.I /etc/barrier.conf
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2018 Debauchee Open Source Group
|
||||
.br
|
||||
Copyright \(co 2012\-2016 Symless Ltd.
|
||||
.br
|
||||
Copyright \(co 2008\-2014 Nick Bolton
|
||||
.br
|
||||
Copyright \(co 2002\-2014 Chris Schoeneman
|
|
@ -1 +0,0 @@
|
|||
Corrected macOS packaging to provide a better error message when a user attempts to launch Barrier on an incompatible macOS version. (https://github.com/debauchee/barrier/issues/1260).
|
|
@ -1 +0,0 @@
|
|||
Updated FAQs in project README.md with more detail on OS support and links to issues for infrequent users. (https://github.com/debauchee/barrier/issues/1260).
|
|
@ -1,13 +0,0 @@
|
|||
This is the directory for release note fragments processed by
|
||||
[towncrier](https://github.com/hawkowl/towncrier).
|
||||
|
||||
When making a user-visible change create a file in this directory and it will be automatically be
|
||||
included into the release note document when the next release is published.
|
||||
|
||||
The file extension specifies the type of a change. The following are currently supported:
|
||||
|
||||
- .feature: a new feature.
|
||||
- .bugfix: a bug fix.
|
||||
- .security: a fix for security issue.
|
||||
- .doc: a documentation improvement.
|
||||
- .removal: a deprecation or removal of functionality.
|
|
@ -1,2 +0,0 @@
|
|||
Fix wrong encoding for text copied between Linux and Windows
|
||||
(https://github.com/debauchee/barrier/issues/1037, https://github.com/debauchee/barrier/issues/1137).
|
|
@ -1 +0,0 @@
|
|||
Fixed build on GCC 11.2 (https://github.com/debauchee/barrier/issues/1366).
|
|
@ -1,2 +0,0 @@
|
|||
Updated Japanese translation.
|
||||
Add and translate strings that are not in gui.ts. Minor string adjustment, Fix wrong or duplicate shortcut keys.
|
|
@ -1 +0,0 @@
|
|||
Fixed FAQ link to Linux drag and drop issue.
|
|
@ -1 +0,0 @@
|
|||
Fixed a regression in 2.4.0 that caused Barrier to not support scaling other than 100% (https://github.com/debauchee/barrier/issues/1462).
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<!-- Mac OSX only: Copy this plist file into [~]/Library/LaunchAgents to start barrier client automatically. Make sure you change the IP below. -->
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>org.debauchee.com.barrierc.plist</string>
|
||||
<key>OnDemand</key>
|
||||
<false/>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/usr/bin/barrierc</string>
|
||||
<!-- Replace this IP with the IP of your barriers server -->
|
||||
<string>192.168.0.2</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<!-- Mac OSX only: Copy this plist file into [~]/Library/LaunchAgents to start synergy client automatically. Make sure you change the IP below. -->
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>org.synergy-project.org.synergyc.plist</string>
|
||||
<key>OnDemand</key>
|
||||
<false/>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/usr/bin/synergyc</string>
|
||||
<!-- Replace this IP with the IP of your synergys server -->
|
||||
<string>192.168.0.2</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -2,19 +2,19 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<!-- Mac OSX only: Copy this plist file into [~]/Library/LaunchAgents to start barrier server automatically. Make sure you change configuration file below -->
|
||||
<!-- Mac OSX only: Copy this plist file into [~]/Library/LaunchAgents to start synergy server automatically. Make sure you change configuration file below -->
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>org.debauchee.com.barriers.plist</string>
|
||||
<key>OnDemand</key>
|
||||
<false/>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/usr/bin/barriers</string>
|
||||
<key>Label</key>
|
||||
<string>org.synergy-project.org.synergys.plist</string>
|
||||
<key>OnDemand</key>
|
||||
<false/>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/usr/bin/synergys</string>
|
||||
<string>--no-daemon</string>
|
||||
<string>--config</string>
|
||||
<!-- Replace this path with the path to your barrier configuration -->
|
||||
<string>/Users/snorp/.barrier.conf</string>
|
||||
<!-- Replace this path with the path to your synergy configuration -->
|
||||
<string>/Users/snorp/.synergy.conf</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
|
@ -1,98 +0,0 @@
|
|||
Release notes
|
||||
=============
|
||||
|
||||
[comment]: <> (towncrier release notes start)
|
||||
|
||||
Barrier `2.4.0` ( `2021-11-01` )
|
||||
================================
|
||||
|
||||
Security fixes
|
||||
--------------
|
||||
|
||||
- Barrier now supports client identity verification (fixes CVE-2021-42072, CVE-2021-42073).
|
||||
|
||||
Previously a malicious client could connect to Barrier server without any authentication and
|
||||
send application-level messages. This made the attack surface of Barrier significantly larger.
|
||||
Additionally, in case the malicious client got possession of a valid screen name by brute forcing
|
||||
or other means it could modify the clipboard contents of the server.
|
||||
|
||||
To support seamless upgrades from older versions of Barrier this is currently disabled by default.
|
||||
The feature can be enabled in the settings dialog. If enabled, older clients of Barrier will be
|
||||
rejected.
|
||||
|
||||
- Barrier now uses SHA256 fingerprints for establishing security of encrypted SSL connections.
|
||||
After upgrading client to new version the existing server fingerprint will need to be approved
|
||||
again. Client and server will show both SHA1 and SHA256 server fingerprints to allow
|
||||
interoperability with older versions of Barrier.
|
||||
|
||||
All of the above security issues have been reported by Matthias Gerstner who was really helpful
|
||||
resolving them.
|
||||
|
||||
Bug fixes
|
||||
---------
|
||||
|
||||
- Fixed build failure on mips*el and riscv64 architecture.
|
||||
- Fixed reading of configuration on Windows when the paths contain non-ASCII characters
|
||||
(https://github.com/debauchee/barrier/issues/976, https://github.com/debauchee/barrier/issues/974,
|
||||
https://github.com/debauchee/barrier/issues/444).
|
||||
- Barrier no longer uses openssl CLI tool for any operations and hooks into the openssl library directly.
|
||||
- More X11 clipboard MIME types have been mapped to corresponding converters (https://github.com/debauchee/barrier/issues/344).
|
||||
- Fixed setup of multiple actions associated with a hotkey.
|
||||
- Fixed setup of hotkeys with special characters such as comma and semicolon
|
||||
(https://github.com/debauchee/barrier/issues/778).
|
||||
- Fixed transfer of non-ASCII characters coming from a Windows server in certain cases
|
||||
(https://github.com/debauchee/barrier/issues/527).
|
||||
- Barrier will now regenerate server certificate if it's invalid instead of failing to launch
|
||||
(https://github.com/debauchee/barrier/issues/802)
|
||||
- Added support for additional keys on Sun Microsystems USB keyboards
|
||||
(https://github.com/debauchee/barrier/issues/784).
|
||||
- Updated Chinese translation.
|
||||
- Updated Slovak translation.
|
||||
- Theme icons are now preferred to icons distributed together with Barrier
|
||||
(https://github.com/debauchee/barrier/issues/471).
|
||||
- Fixed incorrect setup of Barrier service path on Windows.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
- Added `--drop-target` option that improves drag and drop support on Windows when Barrier is
|
||||
being run as a portable app.
|
||||
- The `--enable-crypto` command line option has been made the default to reduce chances of
|
||||
accidental security mishaps when configuring Barrier from command line.
|
||||
A new `--disable-crypto` command line option has been added to explicitly disable encryption.
|
||||
- Added support for randomart images for easier comparison of SSL certificate fingerprints.
|
||||
The algorithm is identical to what OpenSSH uses.
|
||||
- Implemented a configuration option for Server GUI auto-start.
|
||||
- Made it possible to use keyboard instead of mouse to modify screen layout.
|
||||
- Added support for keyboard backlight media keys
|
||||
- Added support for Eisu_toggle and Muhenkan keys
|
||||
- Added `--profile-dir` option that allows to select custom profile directory.
|
||||
|
||||
Barrier `2.3.4` ( `2021-11-01` )
|
||||
================================
|
||||
|
||||
Security fixes
|
||||
--------------
|
||||
|
||||
- Barrier will now correctly close connections when the app-level handshake fails (fixes CVE-2021-42075).
|
||||
|
||||
Previously repeated failing connections would leak file descriptors leading to Barrier being unable
|
||||
to receive new connections from clients.
|
||||
|
||||
- Barrier will now enforce a maximum length of input messages (fixes CVE-2021-42076).
|
||||
|
||||
Previously it was possible for a malicious client or server to send excessive length messages
|
||||
leading to denial of service by resource exhaustion.
|
||||
|
||||
- Fixed a bug which caused Barrier to crash when disconnecting a TCP session just after sending
|
||||
Hello message (fixes CVE-2021-42074).
|
||||
This bug allowed an unauthenticated attacker to crash Barrier with only network access.
|
||||
|
||||
All of the above security issues have been reported by Matthias Gerstner who was really helpful
|
||||
resolving them.
|
||||
|
||||
Bug fixes
|
||||
---------
|
||||
|
||||
- Fixed a bug in SSL implementation that caused invalid data occasionally being sent to clients
|
||||
under heavy load.
|
|
@ -1,37 +0,0 @@
|
|||
{% for section, _ in sections|dictsort(by='key') %}
|
||||
{% set underline = "-" %}
|
||||
{% if section %}
|
||||
{{section}}
|
||||
{{ underline * section|length }}{% set underline = "-" %}
|
||||
|
||||
{% endif %}
|
||||
{% if sections[section] %}
|
||||
{% for category, val in definitions|dictsort if category in sections[section]%}
|
||||
|
||||
{{ definitions[category]['name'] }}
|
||||
{{ underline * definitions[category]['name']|length }}
|
||||
|
||||
{% if definitions[category]['showcontent'] %}
|
||||
{% for text, values in sections[section][category]|dictsort(by='value') %}
|
||||
- {{ text }}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
- {{ sections[section][category]['']|sort|join(', ') }}
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% if sections[section][category]|length == 0 %}
|
||||
|
||||
No significant changes.
|
||||
|
||||
|
||||
{% else %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
|
||||
No significant changes.
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
|
@ -1,4 +1,4 @@
|
|||
# sample barrier configuration file
|
||||
# sample synergy configuration file
|
||||
#
|
||||
# comments begin with the # character and continue to the end of
|
||||
# line. comments may appear anywhere the syntax permits.
|
|
@ -1,4 +1,4 @@
|
|||
# sample barrier configuration file
|
||||
# sample synergy configuration file
|
||||
#
|
||||
# comments begin with the # character and continue to the end of
|
||||
# line. comments may appear anywhere the syntax permits.
|
||||
|
@ -47,9 +47,9 @@ section: links
|
|||
end
|
||||
|
||||
# The aliases section is to map the full names of the computers to their logical names used in the screens section
|
||||
# One way to find the actual name of a computer is to run hostname from a command window
|
||||
# One way to find the actual name of a comptuer is to run hostname from a command window
|
||||
section: aliases
|
||||
# Laptop is actually known as John-Smiths-MacBook-3.local
|
||||
John-Smiths-MacBook-3.local:
|
||||
desktop2
|
||||
desktop2:
|
||||
John-Smiths-MacBook-3.local
|
||||
end
|
|
@ -1,4 +1,4 @@
|
|||
# sample barrier configuration file
|
||||
# sample synergy configuration file
|
||||
#
|
||||
# comments begin with the # character and continue to the end of
|
||||
# line. comments may appear anywhere the syntax permits.
|
||||
|
@ -34,6 +34,6 @@ end
|
|||
|
||||
section: aliases
|
||||
# The "real" name of iMac is John-Smiths-iMac-3.local. If we wanted we could remove this alias and instead use John-Smiths-iMac-3.local everywhere iMac is above. Hopefully it should be easy to see why using an alias is nicer
|
||||
John-Smiths-iMac-3.local:
|
||||
iMac
|
||||
iMac:
|
||||
John-Smiths-iMac-3.local
|
||||
end
|
|
@ -0,0 +1,47 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.2.
|
||||
.TH SYNERGYC "1" "June 2010" "synergyc 1.5.0, protocol version 1.3" "User Commands"
|
||||
.SH NAME
|
||||
synergyc \- manual page for synergyc 1.5.0, protocol version 1.3
|
||||
.SH SYNOPSIS
|
||||
.B synergyc
|
||||
[\fI--yscroll <delta>\fR] [\fI--daemon|--no-daemon\fR] [\fI--name <screen-name>\fR] [\fI--restart|--no-restart\fR] [\fI--debug <level>\fR] \fI<server-address>\fR
|
||||
.SH DESCRIPTION
|
||||
Connect to a synergy mouse/keyboard sharing server.
|
||||
.TP
|
||||
\fB\-d\fR, \fB\-\-debug\fR <level>
|
||||
filter out log messages with priority below level.
|
||||
level may be: FATAL, ERROR, WARNING, NOTE, INFO,
|
||||
DEBUG, DEBUGn (1\-5).
|
||||
.TP
|
||||
\fB\-n\fR, \fB\-\-name\fR <screen\-name> use screen\-name instead the hostname to identify
|
||||
this screen in the configuration.
|
||||
.TP
|
||||
\fB\-1\fR, \fB\-\-no\-restart\fR
|
||||
do not try to restart on failure.
|
||||
.PP
|
||||
* \fB\-\-restart\fR restart the server automatically if it fails.
|
||||
.TP
|
||||
\fB\-l\fR \fB\-\-log\fR <file>
|
||||
write log messages to file.
|
||||
.TP
|
||||
\fB\-f\fR, \fB\-\-no\-daemon\fR
|
||||
run in the foreground.
|
||||
.PP
|
||||
* \fB\-\-daemon\fR run as a daemon.
|
||||
.TP
|
||||
\fB\-\-yscroll\fR <delta>
|
||||
defines the vertical scrolling delta, which is
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
display this help and exit.
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
display version information and exit.
|
||||
.PP
|
||||
* marks defaults.
|
||||
.PP
|
||||
The server address is of the form: [<hostname>][:<port>]. The hostname
|
||||
must be the address or hostname of the server. The port overrides the
|
||||
default port, 24800.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2010 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
|
|
@ -0,0 +1,57 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.2.
|
||||
.TH SYNERGYS "1" "June 2010" "synergys 1.5.0, protocol version 1.3" "User Commands"
|
||||
.SH NAME
|
||||
synergys \- manual page for synergys 1.5.0, protocol version 1.3
|
||||
.SH SYNOPSIS
|
||||
.B synergys
|
||||
[\fI--address <address>\fR] [\fI--config <pathname>\fR] [\fI--daemon|--no-daemon\fR] [\fI--name <screen-name>\fR] [\fI--restart|--no-restart\fR] [\fI--debug <level>\fR]
|
||||
.SH DESCRIPTION
|
||||
Start the synergy mouse/keyboard sharing server.
|
||||
.TP
|
||||
\fB\-a\fR, \fB\-\-address\fR <address>
|
||||
listen for clients on the given address.
|
||||
.TP
|
||||
\fB\-c\fR, \fB\-\-config\fR <pathname>
|
||||
use the named configuration file instead.
|
||||
.TP
|
||||
\fB\-d\fR, \fB\-\-debug\fR <level>
|
||||
filter out log messages with priority below level.
|
||||
level may be: FATAL, ERROR, WARNING, NOTE, INFO,
|
||||
DEBUG, DEBUGn (1\-5).
|
||||
.TP
|
||||
\fB\-n\fR, \fB\-\-name\fR <screen\-name> use screen\-name instead the hostname to identify
|
||||
this screen in the configuration.
|
||||
.TP
|
||||
\fB\-1\fR, \fB\-\-no\-restart\fR
|
||||
do not try to restart on failure.
|
||||
.PP
|
||||
* \fB\-\-restart\fR restart the server automatically if it fails.
|
||||
.TP
|
||||
\fB\-l\fR \fB\-\-log\fR <file>
|
||||
write log messages to file.
|
||||
.TP
|
||||
\fB\-f\fR, \fB\-\-no\-daemon\fR
|
||||
run in the foreground.
|
||||
.PP
|
||||
* \fB\-\-daemon\fR run as a daemon.
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
display this help and exit.
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
display version information and exit.
|
||||
.PP
|
||||
* marks defaults.
|
||||
.PP
|
||||
The argument for \fB\-\-address\fR is of the form: [<hostname>][:<port>]. The
|
||||
hostname must be the address or hostname of an interface on the system.
|
||||
The default is to listen on all interfaces. The port overrides the
|
||||
default port, 24800.
|
||||
.PP
|
||||
If no configuration file pathname is provided then the first of the
|
||||
following to load successfully sets the configuration:
|
||||
.IP
|
||||
$HOME/.synergy.conf
|
||||
/etc/synergy.conf
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2010 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
|
|
@ -0,0 +1,96 @@
|
|||
# synergy -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2013 Synergy Si Ltd.
|
||||
#
|
||||
# This package is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# found in the file COPYING that should have accompanied this file.
|
||||
#
|
||||
# This package is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(cryptopp_dir cryptopp562)
|
||||
|
||||
# only compile the crypto++ files we need.
|
||||
set(cryptopp_src
|
||||
${cryptopp_dir}/3way.cpp
|
||||
${cryptopp_dir}/algparam.cpp
|
||||
${cryptopp_dir}/asn.cpp
|
||||
${cryptopp_dir}/authenc.cpp
|
||||
${cryptopp_dir}/basecode.cpp
|
||||
${cryptopp_dir}/cpu.cpp
|
||||
${cryptopp_dir}/cryptlib.cpp
|
||||
${cryptopp_dir}/des.cpp
|
||||
${cryptopp_dir}/dessp.cpp
|
||||
${cryptopp_dir}/dll.cpp
|
||||
${cryptopp_dir}/ec2n.cpp
|
||||
${cryptopp_dir}/ecp.cpp
|
||||
${cryptopp_dir}/filters.cpp
|
||||
${cryptopp_dir}/fips140.cpp
|
||||
${cryptopp_dir}/gcm.cpp
|
||||
${cryptopp_dir}/gf2n.cpp
|
||||
${cryptopp_dir}/gfpcrypt.cpp
|
||||
${cryptopp_dir}/hex.cpp
|
||||
${cryptopp_dir}/hmac.cpp
|
||||
${cryptopp_dir}/hrtimer.cpp
|
||||
${cryptopp_dir}/integer.cpp
|
||||
${cryptopp_dir}/iterhash.cpp
|
||||
${cryptopp_dir}/misc.cpp
|
||||
${cryptopp_dir}/modes.cpp
|
||||
${cryptopp_dir}/mqueue.cpp
|
||||
${cryptopp_dir}/nbtheory.cpp
|
||||
${cryptopp_dir}/oaep.cpp
|
||||
${cryptopp_dir}/osrng.cpp
|
||||
${cryptopp_dir}/pubkey.cpp
|
||||
${cryptopp_dir}/queue.cpp
|
||||
${cryptopp_dir}/randpool.cpp
|
||||
${cryptopp_dir}/rdtables.cpp
|
||||
${cryptopp_dir}/rijndael.cpp
|
||||
${cryptopp_dir}/rng.cpp
|
||||
${cryptopp_dir}/sha.cpp
|
||||
)
|
||||
|
||||
# if 64-bit windows, compile asm file.
|
||||
if (CMAKE_CL_64)
|
||||
list(APPEND cryptopp_src ${cryptopp_dir}/x64dll.asm ${cryptopp_dir}/x64masm.asm)
|
||||
|
||||
add_custom_command(OUTPUT $(IntDir)x64dll.obj
|
||||
COMMAND ml64.exe /c /nologo /Fo$(IntDir)x64dll.obj /Zi
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${cryptopp_dir}/x64dll.asm"
|
||||
MAIN_DEPENDENCY ${cryptopp_dir}/x64dll.asm
|
||||
VERBATIM)
|
||||
|
||||
add_custom_command(OUTPUT $(IntDir)x64masm.obj
|
||||
COMMAND ml64.exe /c /nologo /Fo$(IntDir)x64masm.obj /Zi
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${cryptopp_dir}/x64masm.asm"
|
||||
MAIN_DEPENDENCY ${cryptopp_dir}/x64masm.asm
|
||||
VERBATIM)
|
||||
endif()
|
||||
|
||||
if (UNIX)
|
||||
add_definitions(-DCRYPTOPP_DISABLE_ASM)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O2 -pipe")
|
||||
|
||||
if (APPLE)
|
||||
if (DARWIN_VERSION GREATER 10)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-tautological-compare")
|
||||
endif()
|
||||
else()
|
||||
set(CRYPTOPP_ARCH "native")
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^arm.*")
|
||||
set(CRYPTOPP_ARCH "armv6zk")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${CRYPTOPP_ARCH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(cryptopp STATIC ${cryptopp_src})
|
||||
|
||||
if (UNIX)
|
||||
# ignore warnings in crypto++
|
||||
set_target_properties(cryptopp PROPERTIES COMPILE_FLAGS "-w")
|
||||
endif()
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
Subproject commit 7d33fee11ec480beae4c28ad09ca56d974140a72
|
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
Subproject commit 800f5422ac9d9e0ad59cd860a2ef3a679588acb4
|
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
Subproject commit 614bbe87b80435d87ab8791564370e0c1d13627d
|
|
@ -1,125 +0,0 @@
|
|||
|
||||
LICENSE ISSUES
|
||||
==============
|
||||
|
||||
The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
|
||||
the OpenSSL License and the original SSLeay license apply to the toolkit.
|
||||
See below for the actual license texts.
|
||||
|
||||
OpenSSL License
|
||||
---------------
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2016 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
Original SSLeay License
|
||||
-----------------------
|
||||
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,149 +0,0 @@
|
|||
/* crypto/aes/aes.h */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_AES_H
|
||||
# define HEADER_AES_H
|
||||
|
||||
# include <openssl/opensslconf.h>
|
||||
|
||||
# ifdef OPENSSL_NO_AES
|
||||
# error AES is disabled.
|
||||
# endif
|
||||
|
||||
# include <stddef.h>
|
||||
|
||||
# define AES_ENCRYPT 1
|
||||
# define AES_DECRYPT 0
|
||||
|
||||
/*
|
||||
* Because array size can't be a const in C, the following two are macros.
|
||||
* Both sizes are in bytes.
|
||||
*/
|
||||
# define AES_MAXNR 14
|
||||
# define AES_BLOCK_SIZE 16
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This should be a hidden type, but EVP requires that the size be known */
|
||||
struct aes_key_st {
|
||||
# ifdef AES_LONG
|
||||
unsigned long rd_key[4 * (AES_MAXNR + 1)];
|
||||
# else
|
||||
unsigned int rd_key[4 * (AES_MAXNR + 1)];
|
||||
# endif
|
||||
int rounds;
|
||||
};
|
||||
typedef struct aes_key_st AES_KEY;
|
||||
|
||||
const char *AES_options(void);
|
||||
|
||||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
|
||||
int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
|
||||
void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
|
||||
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key, const int enc);
|
||||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc);
|
||||
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num);
|
||||
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char ivec[AES_BLOCK_SIZE],
|
||||
unsigned char ecount_buf[AES_BLOCK_SIZE],
|
||||
unsigned int *num);
|
||||
/* NB: the IV is _two_ blocks long */
|
||||
void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc);
|
||||
/* NB: the IV is _four_ blocks long */
|
||||
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const AES_KEY *key2, const unsigned char *ivec,
|
||||
const int enc);
|
||||
|
||||
int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
unsigned char *out,
|
||||
const unsigned char *in, unsigned int inlen);
|
||||
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
unsigned char *out,
|
||||
const unsigned char *in, unsigned int inlen);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !HEADER_AES_H */
|
|
@ -1,129 +0,0 @@
|
|||
#define APPLINK_STDIN 1
|
||||
#define APPLINK_STDOUT 2
|
||||
#define APPLINK_STDERR 3
|
||||
#define APPLINK_FPRINTF 4
|
||||
#define APPLINK_FGETS 5
|
||||
#define APPLINK_FREAD 6
|
||||
#define APPLINK_FWRITE 7
|
||||
#define APPLINK_FSETMOD 8
|
||||
#define APPLINK_FEOF 9
|
||||
#define APPLINK_FCLOSE 10 /* should not be used */
|
||||
|
||||
#define APPLINK_FOPEN 11 /* solely for completeness */
|
||||
#define APPLINK_FSEEK 12
|
||||
#define APPLINK_FTELL 13
|
||||
#define APPLINK_FFLUSH 14
|
||||
#define APPLINK_FERROR 15
|
||||
#define APPLINK_CLEARERR 16
|
||||
#define APPLINK_FILENO 17 /* to be used with below */
|
||||
|
||||
#define APPLINK_OPEN 18 /* formally can't be used, as flags can vary */
|
||||
#define APPLINK_READ 19
|
||||
#define APPLINK_WRITE 20
|
||||
#define APPLINK_LSEEK 21
|
||||
#define APPLINK_CLOSE 22
|
||||
#define APPLINK_MAX 22 /* always same as last macro */
|
||||
|
||||
#ifndef APPMACROS_ONLY
|
||||
# include <stdio.h>
|
||||
# include <io.h>
|
||||
# include <fcntl.h>
|
||||
|
||||
static void *app_stdin(void)
|
||||
{
|
||||
return stdin;
|
||||
}
|
||||
|
||||
static void *app_stdout(void)
|
||||
{
|
||||
return stdout;
|
||||
}
|
||||
|
||||
static void *app_stderr(void)
|
||||
{
|
||||
return stderr;
|
||||
}
|
||||
|
||||
static int app_feof(FILE *fp)
|
||||
{
|
||||
return feof(fp);
|
||||
}
|
||||
|
||||
static int app_ferror(FILE *fp)
|
||||
{
|
||||
return ferror(fp);
|
||||
}
|
||||
|
||||
static void app_clearerr(FILE *fp)
|
||||
{
|
||||
clearerr(fp);
|
||||
}
|
||||
|
||||
static int app_fileno(FILE *fp)
|
||||
{
|
||||
return _fileno(fp);
|
||||
}
|
||||
|
||||
static int app_fsetmod(FILE *fp, char mod)
|
||||
{
|
||||
return _setmode(_fileno(fp), mod == 'b' ? _O_BINARY : _O_TEXT);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__declspec(dllexport)
|
||||
void **
|
||||
# if defined(__BORLANDC__)
|
||||
/*
|
||||
* __stdcall appears to be the only way to get the name
|
||||
* decoration right with Borland C. Otherwise it works
|
||||
* purely incidentally, as we pass no parameters.
|
||||
*/
|
||||
__stdcall
|
||||
# else
|
||||
__cdecl
|
||||
# endif
|
||||
OPENSSL_Applink(void)
|
||||
{
|
||||
static int once = 1;
|
||||
static void *OPENSSL_ApplinkTable[APPLINK_MAX + 1] =
|
||||
{ (void *)APPLINK_MAX };
|
||||
|
||||
if (once) {
|
||||
OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin;
|
||||
OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout;
|
||||
OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr;
|
||||
OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf;
|
||||
OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets;
|
||||
OPENSSL_ApplinkTable[APPLINK_FREAD] = fread;
|
||||
OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite;
|
||||
OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod;
|
||||
OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof;
|
||||
OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose;
|
||||
|
||||
OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen;
|
||||
OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek;
|
||||
OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell;
|
||||
OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush;
|
||||
OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror;
|
||||
OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr;
|
||||
OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno;
|
||||
|
||||
OPENSSL_ApplinkTable[APPLINK_OPEN] = _open;
|
||||
OPENSSL_ApplinkTable[APPLINK_READ] = _read;
|
||||
OPENSSL_ApplinkTable[APPLINK_WRITE] = _write;
|
||||
OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek;
|
||||
OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close;
|
||||
|
||||
once = 0;
|
||||
}
|
||||
|
||||
return OPENSSL_ApplinkTable;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -1,579 +0,0 @@
|
|||
/* crypto/asn1/asn1_mac.h */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef HEADER_ASN1_MAC_H
|
||||
# define HEADER_ASN1_MAC_H
|
||||
|
||||
# include <openssl/asn1.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifndef ASN1_MAC_ERR_LIB
|
||||
# define ASN1_MAC_ERR_LIB ERR_LIB_ASN1
|
||||
# endif
|
||||
|
||||
# define ASN1_MAC_H_err(f,r,line) \
|
||||
ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line))
|
||||
|
||||
# define M_ASN1_D2I_vars(a,type,func) \
|
||||
ASN1_const_CTX c; \
|
||||
type ret=NULL; \
|
||||
\
|
||||
c.pp=(const unsigned char **)pp; \
|
||||
c.q= *(const unsigned char **)pp; \
|
||||
c.error=ERR_R_NESTED_ASN1_ERROR; \
|
||||
if ((a == NULL) || ((*a) == NULL)) \
|
||||
{ if ((ret=(type)func()) == NULL) \
|
||||
{ c.line=__LINE__; goto err; } } \
|
||||
else ret=(*a);
|
||||
|
||||
# define M_ASN1_D2I_Init() \
|
||||
c.p= *(const unsigned char **)pp; \
|
||||
c.max=(length == 0)?0:(c.p+length);
|
||||
|
||||
# define M_ASN1_D2I_Finish_2(a) \
|
||||
if (!asn1_const_Finish(&c)) \
|
||||
{ c.line=__LINE__; goto err; } \
|
||||
*(const unsigned char **)pp=c.p; \
|
||||
if (a != NULL) (*a)=ret; \
|
||||
return(ret);
|
||||
|
||||
# define M_ASN1_D2I_Finish(a,func,e) \
|
||||
M_ASN1_D2I_Finish_2(a); \
|
||||
err:\
|
||||
ASN1_MAC_H_err((e),c.error,c.line); \
|
||||
asn1_add_error(*(const unsigned char **)pp,(int)(c.q- *pp)); \
|
||||
if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
|
||||
return(NULL)
|
||||
|
||||
# define M_ASN1_D2I_start_sequence() \
|
||||
if (!asn1_GetSequence(&c,&length)) \
|
||||
{ c.line=__LINE__; goto err; }
|
||||
/* Begin reading ASN1 without a surrounding sequence */
|
||||
# define M_ASN1_D2I_begin() \
|
||||
c.slen = length;
|
||||
|
||||
/* End reading ASN1 with no check on length */
|
||||
# define M_ASN1_D2I_Finish_nolen(a, func, e) \
|
||||
*pp=c.p; \
|
||||
if (a != NULL) (*a)=ret; \
|
||||
return(ret); \
|
||||
err:\
|
||||
ASN1_MAC_H_err((e),c.error,c.line); \
|
||||
asn1_add_error(*pp,(int)(c.q- *pp)); \
|
||||
if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
|
||||
return(NULL)
|
||||
|
||||
# define M_ASN1_D2I_end_sequence() \
|
||||
(((c.inf&1) == 0)?(c.slen <= 0): \
|
||||
(c.eos=ASN1_const_check_infinite_end(&c.p,c.slen)))
|
||||
|
||||
/* Don't use this with d2i_ASN1_BOOLEAN() */
|
||||
# define M_ASN1_D2I_get(b, func) \
|
||||
c.q=c.p; \
|
||||
if (func(&(b),&c.p,c.slen) == NULL) \
|
||||
{c.line=__LINE__; goto err; } \
|
||||
c.slen-=(c.p-c.q);
|
||||
|
||||
/* Don't use this with d2i_ASN1_BOOLEAN() */
|
||||
# define M_ASN1_D2I_get_x(type,b,func) \
|
||||
c.q=c.p; \
|
||||
if (((D2I_OF(type))func)(&(b),&c.p,c.slen) == NULL) \
|
||||
{c.line=__LINE__; goto err; } \
|
||||
c.slen-=(c.p-c.q);
|
||||
|
||||
/* use this instead () */
|
||||
# define M_ASN1_D2I_get_int(b,func) \
|
||||
c.q=c.p; \
|
||||
if (func(&(b),&c.p,c.slen) < 0) \
|
||||
{c.line=__LINE__; goto err; } \
|
||||
c.slen-=(c.p-c.q);
|
||||
|
||||
# define M_ASN1_D2I_get_opt(b,func,type) \
|
||||
if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \
|
||||
== (V_ASN1_UNIVERSAL|(type)))) \
|
||||
{ \
|
||||
M_ASN1_D2I_get(b,func); \
|
||||
}
|
||||
|
||||
# define M_ASN1_D2I_get_int_opt(b,func,type) \
|
||||
if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \
|
||||
== (V_ASN1_UNIVERSAL|(type)))) \
|
||||
{ \
|
||||
M_ASN1_D2I_get_int(b,func); \
|
||||
}
|
||||
|
||||
# define M_ASN1_D2I_get_imp(b,func, type) \
|
||||
M_ASN1_next=(_tmp& V_ASN1_CONSTRUCTED)|type; \
|
||||
c.q=c.p; \
|
||||
if (func(&(b),&c.p,c.slen) == NULL) \
|
||||
{c.line=__LINE__; M_ASN1_next_prev = _tmp; goto err; } \
|
||||
c.slen-=(c.p-c.q);\
|
||||
M_ASN1_next_prev=_tmp;
|
||||
|
||||
# define M_ASN1_D2I_get_IMP_opt(b,func,tag,type) \
|
||||
if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) == \
|
||||
(V_ASN1_CONTEXT_SPECIFIC|(tag)))) \
|
||||
{ \
|
||||
unsigned char _tmp = M_ASN1_next; \
|
||||
M_ASN1_D2I_get_imp(b,func, type);\
|
||||
}
|
||||
|
||||
# define M_ASN1_D2I_get_set(r,func,free_func) \
|
||||
M_ASN1_D2I_get_imp_set(r,func,free_func, \
|
||||
V_ASN1_SET,V_ASN1_UNIVERSAL);
|
||||
|
||||
# define M_ASN1_D2I_get_set_type(type,r,func,free_func) \
|
||||
M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \
|
||||
V_ASN1_SET,V_ASN1_UNIVERSAL);
|
||||
|
||||
# define M_ASN1_D2I_get_set_opt(r,func,free_func) \
|
||||
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
|
||||
V_ASN1_CONSTRUCTED|V_ASN1_SET)))\
|
||||
{ M_ASN1_D2I_get_set(r,func,free_func); }
|
||||
|
||||
# define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \
|
||||
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
|
||||
V_ASN1_CONSTRUCTED|V_ASN1_SET)))\
|
||||
{ M_ASN1_D2I_get_set_type(type,r,func,free_func); }
|
||||
|
||||
# define M_ASN1_I2D_len_SET_opt(a,f) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
M_ASN1_I2D_len_SET(a,f);
|
||||
|
||||
# define M_ASN1_I2D_put_SET_opt(a,f) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
M_ASN1_I2D_put_SET(a,f);
|
||||
|
||||
# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
M_ASN1_I2D_put_SEQUENCE(a,f);
|
||||
|
||||
# define M_ASN1_I2D_put_SEQUENCE_opt_type(type,a,f) \
|
||||
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
|
||||
M_ASN1_I2D_put_SEQUENCE_type(type,a,f);
|
||||
|
||||
# define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \
|
||||
if ((c.slen != 0) && \
|
||||
(M_ASN1_next == \
|
||||
(V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\
|
||||
{ \
|
||||
M_ASN1_D2I_get_imp_set(b,func,free_func,\
|
||||
tag,V_ASN1_CONTEXT_SPECIFIC); \
|
||||
}
|
||||
|
||||
# define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \
|
||||
if ((c.slen != 0) && \
|
||||
(M_ASN1_next == \
|
||||
(V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\
|
||||
{ \
|
||||
M_ASN1_D2I_get_imp_set_type(type,b,func,free_func,\
|
||||
tag,V_ASN1_CONTEXT_SPECIFIC); \
|
||||
}
|
||||
|
||||
# define M_ASN1_D2I_get_seq(r,func,free_func) \
|
||||
M_ASN1_D2I_get_imp_set(r,func,free_func,\
|
||||
V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
|
||||
|
||||
# define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \
|
||||
M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
|
||||
V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
|
||||
|
||||
# define M_ASN1_D2I_get_seq_opt(r,func,free_func) \
|
||||
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
|
||||
V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
|
||||
{ M_ASN1_D2I_get_seq(r,func,free_func); }
|
||||
|
||||
# define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \
|
||||
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
|
||||
V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
|
||||
{ M_ASN1_D2I_get_seq_type(type,r,func,free_func); }
|
||||
|
||||
# define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \
|
||||
M_ASN1_D2I_get_imp_set(r,func,free_func,\
|
||||
x,V_ASN1_CONTEXT_SPECIFIC);
|
||||
|
||||
# define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \
|
||||
M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
|
||||
x,V_ASN1_CONTEXT_SPECIFIC);
|
||||
|
||||
# define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \
|
||||
c.q=c.p; \
|
||||
if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\
|
||||
(void (*)())free_func,a,b) == NULL) \
|
||||
{ c.line=__LINE__; goto err; } \
|
||||
c.slen-=(c.p-c.q);
|
||||
|
||||
# define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \
|
||||
c.q=c.p; \
|
||||
if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\
|
||||
free_func,a,b) == NULL) \
|
||||
{ c.line=__LINE__; goto err; } \
|
||||
c.slen-=(c.p-c.q);
|
||||
|
||||
# define M_ASN1_D2I_get_set_strings(r,func,a,b) \
|
||||
c.q=c.p; \
|
||||
if (d2i_ASN1_STRING_SET(&(r),&c.p,c.slen,a,b) == NULL) \
|
||||
{ c.line=__LINE__; goto err; } \
|
||||
c.slen-=(c.p-c.q);
|
||||
|
||||
# define M_ASN1_D2I_get_EXP_opt(r,func,tag) \
|
||||
if ((c.slen != 0L) && (M_ASN1_next == \
|
||||
(V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
|
||||
{ \
|
||||
int Tinf,Ttag,Tclass; \
|
||||
long Tlen; \
|
||||
\
|
||||
c.q=c.p; \
|
||||
Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
|
||||
if (Tinf & 0x80) \
|
||||
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
|
||||
c.line=__LINE__; goto err; } \
|
||||
if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
|
||||
Tlen = c.slen - (c.p - c.q) - 2; \
|
||||
if (func(&(r),&c.p,Tlen) == NULL) \
|
||||
{ c.line=__LINE__; goto err; } \
|
||||
if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
|
||||
Tlen = c.slen - (c.p - c.q); \
|
||||
if(!ASN1_const_check_infinite_end(&c.p, Tlen)) \
|
||||
{ c.error=ERR_R_MISSING_ASN1_EOS; \
|
||||
c.line=__LINE__; goto err; } \
|
||||
}\
|
||||
c.slen-=(c.p-c.q); \
|
||||
}
|
||||
|
||||
# define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \
|
||||
if ((c.slen != 0) && (M_ASN1_next == \
|
||||
(V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
|
||||
{ \
|
||||
int Tinf,Ttag,Tclass; \
|
||||
long Tlen; \
|
||||
\
|
||||
c.q=c.p; \
|
||||
Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
|
||||
if (Tinf & 0x80) \
|
||||
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
|
||||
c.line=__LINE__; goto err; } \
|
||||
if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
|
||||
Tlen = c.slen - (c.p - c.q) - 2; \
|
||||
if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \
|
||||
(void (*)())free_func, \
|
||||
b,V_ASN1_UNIVERSAL) == NULL) \
|
||||
{ c.line=__LINE__; goto err; } \
|
||||
if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
|
||||
Tlen = c.slen - (c.p - c.q); \
|
||||
if(!ASN1_check_infinite_end(&c.p, Tlen)) \
|
||||
{ c.error=ERR_R_MISSING_ASN1_EOS; \
|
||||
c.line=__LINE__; goto err; } \
|
||||
}\
|
||||
c.slen-=(c.p-c.q); \
|
||||
}
|
||||
|
||||
# define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \
|
||||
if ((c.slen != 0) && (M_ASN1_next == \
|
||||
(V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
|
||||
{ \
|
||||
int Tinf,Ttag,Tclass; \
|
||||
long Tlen; \
|
||||
\
|
||||
c.q=c.p; \
|
||||
Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
|
||||
if (Tinf & 0x80) \
|
||||
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
|
||||
c.line=__LINE__; goto err; } \
|
||||
if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
|
||||
Tlen = c.slen - (c.p - c.q) - 2; \
|
||||
if (d2i_ASN1_SET_OF_##type(&(r),&c.p,Tlen,func, \
|
||||
free_func,b,V_ASN1_UNIVERSAL) == NULL) \
|
||||
{ c.line=__LINE__; goto err; } \
|
||||
if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
|
||||
Tlen = c.slen - (c.p - c.q); \
|
||||
if(!ASN1_check_infinite_end(&c.p, Tlen)) \
|
||||
{ c.error=ERR_R_MISSING_ASN1_EOS; \
|
||||
c.line=__LINE__; goto err; } \
|
||||
}\
|
||||
c.slen-=(c.p-c.q); \
|
||||
}
|
||||
|
||||
/* New macros */
|
||||
# define M_ASN1_New_Malloc(ret,type) \
|
||||
if ((ret=(type *)OPENSSL_malloc(sizeof(type))) == NULL) \
|
||||
{ c.line=__LINE__; goto err2; }
|
||||
|
||||
# define M_ASN1_New(arg,func) \
|
||||
if (((arg)=func()) == NULL) return(NULL)
|
||||
|
||||
# define M_ASN1_New_Error(a) \
|
||||
/*- err: ASN1_MAC_H_err((a),ERR_R_NESTED_ASN1_ERROR,c.line); \
|
||||
return(NULL);*/ \
|
||||
err2: ASN1_MAC_H_err((a),ERR_R_MALLOC_FAILURE,c.line); \
|
||||
return(NULL)
|
||||
|
||||
/*
|
||||
* BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately, some
|
||||
* macros that use ASN1_const_CTX still insist on writing in the input
|
||||
* stream. ARGH! ARGH! ARGH! Let's get rid of this macro package. Please? --
|
||||
* Richard Levitte
|
||||
*/
|
||||
# define M_ASN1_next (*((unsigned char *)(c.p)))
|
||||
# define M_ASN1_next_prev (*((unsigned char *)(c.q)))
|
||||
|
||||
/*************************************************/
|
||||
|
||||
# define M_ASN1_I2D_vars(a) int r=0,ret=0; \
|
||||
unsigned char *p; \
|
||||
if (a == NULL) return(0)
|
||||
|
||||
/* Length Macros */
|
||||
# define M_ASN1_I2D_len(a,f) ret+=f(a,NULL)
|
||||
# define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f)
|
||||
|
||||
# define M_ASN1_I2D_len_SET(a,f) \
|
||||
ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET);
|
||||
|
||||
# define M_ASN1_I2D_len_SET_type(type,a,f) \
|
||||
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \
|
||||
V_ASN1_UNIVERSAL,IS_SET);
|
||||
|
||||
# define M_ASN1_I2D_len_SEQUENCE(a,f) \
|
||||
ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
|
||||
IS_SEQUENCE);
|
||||
|
||||
# define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \
|
||||
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \
|
||||
V_ASN1_UNIVERSAL,IS_SEQUENCE)
|
||||
|
||||
# define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
M_ASN1_I2D_len_SEQUENCE(a,f);
|
||||
|
||||
# define M_ASN1_I2D_len_SEQUENCE_opt_type(type,a,f) \
|
||||
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
|
||||
M_ASN1_I2D_len_SEQUENCE_type(type,a,f);
|
||||
|
||||
# define M_ASN1_I2D_len_IMP_SET(a,f,x) \
|
||||
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET);
|
||||
|
||||
# define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \
|
||||
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
|
||||
V_ASN1_CONTEXT_SPECIFIC,IS_SET);
|
||||
|
||||
# define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
|
||||
IS_SET);
|
||||
|
||||
# define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \
|
||||
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
|
||||
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
|
||||
V_ASN1_CONTEXT_SPECIFIC,IS_SET);
|
||||
|
||||
# define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \
|
||||
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
|
||||
IS_SEQUENCE);
|
||||
|
||||
# define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
|
||||
IS_SEQUENCE);
|
||||
|
||||
# define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \
|
||||
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
|
||||
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
|
||||
V_ASN1_CONTEXT_SPECIFIC, \
|
||||
IS_SEQUENCE);
|
||||
|
||||
# define M_ASN1_I2D_len_EXP_opt(a,f,mtag,v) \
|
||||
if (a != NULL)\
|
||||
{ \
|
||||
v=f(a,NULL); \
|
||||
ret+=ASN1_object_size(1,v,mtag); \
|
||||
}
|
||||
|
||||
# define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \
|
||||
if ((a != NULL) && (sk_num(a) != 0))\
|
||||
{ \
|
||||
v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \
|
||||
ret+=ASN1_object_size(1,v,mtag); \
|
||||
}
|
||||
|
||||
# define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \
|
||||
if ((a != NULL) && (sk_num(a) != 0))\
|
||||
{ \
|
||||
v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \
|
||||
IS_SEQUENCE); \
|
||||
ret+=ASN1_object_size(1,v,mtag); \
|
||||
}
|
||||
|
||||
# define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \
|
||||
if ((a != NULL) && (sk_##type##_num(a) != 0))\
|
||||
{ \
|
||||
v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \
|
||||
V_ASN1_UNIVERSAL, \
|
||||
IS_SEQUENCE); \
|
||||
ret+=ASN1_object_size(1,v,mtag); \
|
||||
}
|
||||
|
||||
/* Put Macros */
|
||||
# define M_ASN1_I2D_put(a,f) f(a,&p)
|
||||
|
||||
# define M_ASN1_I2D_put_IMP_opt(a,f,t) \
|
||||
if (a != NULL) \
|
||||
{ \
|
||||
unsigned char *q=p; \
|
||||
f(a,&p); \
|
||||
*q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\
|
||||
}
|
||||
|
||||
# define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\
|
||||
V_ASN1_UNIVERSAL,IS_SET)
|
||||
# define M_ASN1_I2D_put_SET_type(type,a,f) \
|
||||
i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET)
|
||||
# define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
|
||||
V_ASN1_CONTEXT_SPECIFIC,IS_SET)
|
||||
# define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \
|
||||
i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET)
|
||||
# define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
|
||||
V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE)
|
||||
|
||||
# define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\
|
||||
V_ASN1_UNIVERSAL,IS_SEQUENCE)
|
||||
|
||||
# define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \
|
||||
i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
|
||||
IS_SEQUENCE)
|
||||
|
||||
# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
M_ASN1_I2D_put_SEQUENCE(a,f);
|
||||
|
||||
# define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
{ i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
|
||||
IS_SET); }
|
||||
|
||||
# define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \
|
||||
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
|
||||
{ i2d_ASN1_SET_OF_##type(a,&p,f,x, \
|
||||
V_ASN1_CONTEXT_SPECIFIC, \
|
||||
IS_SET); }
|
||||
|
||||
# define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
{ i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
|
||||
IS_SEQUENCE); }
|
||||
|
||||
# define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \
|
||||
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
|
||||
{ i2d_ASN1_SET_OF_##type(a,&p,f,x, \
|
||||
V_ASN1_CONTEXT_SPECIFIC, \
|
||||
IS_SEQUENCE); }
|
||||
|
||||
# define M_ASN1_I2D_put_EXP_opt(a,f,tag,v) \
|
||||
if (a != NULL) \
|
||||
{ \
|
||||
ASN1_put_object(&p,1,v,tag,V_ASN1_CONTEXT_SPECIFIC); \
|
||||
f(a,&p); \
|
||||
}
|
||||
|
||||
# define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
{ \
|
||||
ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
|
||||
i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \
|
||||
}
|
||||
|
||||
# define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \
|
||||
if ((a != NULL) && (sk_num(a) != 0)) \
|
||||
{ \
|
||||
ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
|
||||
i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \
|
||||
}
|
||||
|
||||
# define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \
|
||||
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
|
||||
{ \
|
||||
ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
|
||||
i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \
|
||||
IS_SEQUENCE); \
|
||||
}
|
||||
|
||||
# define M_ASN1_I2D_seq_total() \
|
||||
r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \
|
||||
if (pp == NULL) return(r); \
|
||||
p= *pp; \
|
||||
ASN1_put_object(&p,1,ret,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
|
||||
|
||||
# define M_ASN1_I2D_INF_seq_start(tag,ctx) \
|
||||
*(p++)=(V_ASN1_CONSTRUCTED|(tag)|(ctx)); \
|
||||
*(p++)=0x80
|
||||
|
||||
# define M_ASN1_I2D_INF_seq_end() *(p++)=0x00; *(p++)=0x00
|
||||
|
||||
# define M_ASN1_I2D_finish() *pp=p; \
|
||||
return(r);
|
||||
|
||||
int asn1_GetSequence(ASN1_const_CTX *c, long *length);
|
||||
void asn1_add_error(const unsigned char *address, int offset);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,973 +0,0 @@
|
|||
/* asn1t.h */
|
||||
/*
|
||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
||||
* 2000.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
#ifndef HEADER_ASN1T_H
|
||||
# define HEADER_ASN1T_H
|
||||
|
||||
# include <stddef.h>
|
||||
# include <openssl/e_os2.h>
|
||||
# include <openssl/asn1.h>
|
||||
|
||||
# ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
||||
# undef OPENSSL_EXTERN
|
||||
# define OPENSSL_EXTERN OPENSSL_EXPORT
|
||||
# endif
|
||||
|
||||
/* ASN1 template defines, structures and functions */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
|
||||
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
|
||||
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
|
||||
|
||||
/* Macros for start and end of ASN1_ITEM definition */
|
||||
|
||||
# define ASN1_ITEM_start(itname) \
|
||||
OPENSSL_GLOBAL const ASN1_ITEM itname##_it = {
|
||||
|
||||
# define ASN1_ITEM_end(itname) \
|
||||
};
|
||||
|
||||
# else
|
||||
|
||||
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
|
||||
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr()))
|
||||
|
||||
/* Macros for start and end of ASN1_ITEM definition */
|
||||
|
||||
# define ASN1_ITEM_start(itname) \
|
||||
const ASN1_ITEM * itname##_it(void) \
|
||||
{ \
|
||||
static const ASN1_ITEM local_it = {
|
||||
|
||||
# define ASN1_ITEM_end(itname) \
|
||||
}; \
|
||||
return &local_it; \
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
/* Macros to aid ASN1 template writing */
|
||||
|
||||
# define ASN1_ITEM_TEMPLATE(tname) \
|
||||
static const ASN1_TEMPLATE tname##_item_tt
|
||||
|
||||
# define ASN1_ITEM_TEMPLATE_END(tname) \
|
||||
;\
|
||||
ASN1_ITEM_start(tname) \
|
||||
ASN1_ITYPE_PRIMITIVE,\
|
||||
-1,\
|
||||
&tname##_item_tt,\
|
||||
0,\
|
||||
NULL,\
|
||||
0,\
|
||||
#tname \
|
||||
ASN1_ITEM_end(tname)
|
||||
|
||||
/* This is a ASN1 type which just embeds a template */
|
||||
|
||||
/*-
|
||||
* This pair helps declare a SEQUENCE. We can do:
|
||||
*
|
||||
* ASN1_SEQUENCE(stname) = {
|
||||
* ... SEQUENCE components ...
|
||||
* } ASN1_SEQUENCE_END(stname)
|
||||
*
|
||||
* This will produce an ASN1_ITEM called stname_it
|
||||
* for a structure called stname.
|
||||
*
|
||||
* If you want the same structure but a different
|
||||
* name then use:
|
||||
*
|
||||
* ASN1_SEQUENCE(itname) = {
|
||||
* ... SEQUENCE components ...
|
||||
* } ASN1_SEQUENCE_END_name(stname, itname)
|
||||
*
|
||||
* This will create an item called itname_it using
|
||||
* a structure called stname.
|
||||
*/
|
||||
|
||||
# define ASN1_SEQUENCE(tname) \
|
||||
static const ASN1_TEMPLATE tname##_seq_tt[]
|
||||
|
||||
# define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
|
||||
|
||||
# define ASN1_SEQUENCE_END_name(stname, tname) \
|
||||
;\
|
||||
ASN1_ITEM_start(tname) \
|
||||
ASN1_ITYPE_SEQUENCE,\
|
||||
V_ASN1_SEQUENCE,\
|
||||
tname##_seq_tt,\
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
||||
NULL,\
|
||||
sizeof(stname),\
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
|
||||
# define ASN1_NDEF_SEQUENCE(tname) \
|
||||
ASN1_SEQUENCE(tname)
|
||||
|
||||
# define ASN1_NDEF_SEQUENCE_cb(tname, cb) \
|
||||
ASN1_SEQUENCE_cb(tname, cb)
|
||||
|
||||
# define ASN1_SEQUENCE_cb(tname, cb) \
|
||||
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
|
||||
ASN1_SEQUENCE(tname)
|
||||
|
||||
# define ASN1_BROKEN_SEQUENCE(tname) \
|
||||
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \
|
||||
ASN1_SEQUENCE(tname)
|
||||
|
||||
# define ASN1_SEQUENCE_ref(tname, cb, lck) \
|
||||
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \
|
||||
ASN1_SEQUENCE(tname)
|
||||
|
||||
# define ASN1_SEQUENCE_enc(tname, enc, cb) \
|
||||
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \
|
||||
ASN1_SEQUENCE(tname)
|
||||
|
||||
# define ASN1_NDEF_SEQUENCE_END(tname) \
|
||||
;\
|
||||
ASN1_ITEM_start(tname) \
|
||||
ASN1_ITYPE_NDEF_SEQUENCE,\
|
||||
V_ASN1_SEQUENCE,\
|
||||
tname##_seq_tt,\
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
||||
NULL,\
|
||||
sizeof(tname),\
|
||||
#tname \
|
||||
ASN1_ITEM_end(tname)
|
||||
|
||||
# define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname)
|
||||
|
||||
# define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
|
||||
|
||||
# define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
|
||||
|
||||
# define ASN1_SEQUENCE_END_ref(stname, tname) \
|
||||
;\
|
||||
ASN1_ITEM_start(tname) \
|
||||
ASN1_ITYPE_SEQUENCE,\
|
||||
V_ASN1_SEQUENCE,\
|
||||
tname##_seq_tt,\
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
||||
&tname##_aux,\
|
||||
sizeof(stname),\
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
|
||||
# define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \
|
||||
;\
|
||||
ASN1_ITEM_start(tname) \
|
||||
ASN1_ITYPE_NDEF_SEQUENCE,\
|
||||
V_ASN1_SEQUENCE,\
|
||||
tname##_seq_tt,\
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
||||
&tname##_aux,\
|
||||
sizeof(stname),\
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
|
||||
/*-
|
||||
* This pair helps declare a CHOICE type. We can do:
|
||||
*
|
||||
* ASN1_CHOICE(chname) = {
|
||||
* ... CHOICE options ...
|
||||
* ASN1_CHOICE_END(chname)
|
||||
*
|
||||
* This will produce an ASN1_ITEM called chname_it
|
||||
* for a structure called chname. The structure
|
||||
* definition must look like this:
|
||||
* typedef struct {
|
||||
* int type;
|
||||
* union {
|
||||
* ASN1_SOMETHING *opt1;
|
||||
* ASN1_SOMEOTHER *opt2;
|
||||
* } value;
|
||||
* } chname;
|
||||
*
|
||||
* the name of the selector must be 'type'.
|
||||
* to use an alternative selector name use the
|
||||
* ASN1_CHOICE_END_selector() version.
|
||||
*/
|
||||
|
||||
# define ASN1_CHOICE(tname) \
|
||||
static const ASN1_TEMPLATE tname##_ch_tt[]
|
||||
|
||||
# define ASN1_CHOICE_cb(tname, cb) \
|
||||
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
|
||||
ASN1_CHOICE(tname)
|
||||
|
||||
# define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
|
||||
|
||||
# define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
|
||||
|
||||
# define ASN1_CHOICE_END_selector(stname, tname, selname) \
|
||||
;\
|
||||
ASN1_ITEM_start(tname) \
|
||||
ASN1_ITYPE_CHOICE,\
|
||||
offsetof(stname,selname) ,\
|
||||
tname##_ch_tt,\
|
||||
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
|
||||
NULL,\
|
||||
sizeof(stname),\
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
|
||||
# define ASN1_CHOICE_END_cb(stname, tname, selname) \
|
||||
;\
|
||||
ASN1_ITEM_start(tname) \
|
||||
ASN1_ITYPE_CHOICE,\
|
||||
offsetof(stname,selname) ,\
|
||||
tname##_ch_tt,\
|
||||
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
|
||||
&tname##_aux,\
|
||||
sizeof(stname),\
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
|
||||
/* This helps with the template wrapper form of ASN1_ITEM */
|
||||
|
||||
# define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
|
||||
(flags), (tag), 0,\
|
||||
#name, ASN1_ITEM_ref(type) }
|
||||
|
||||
/* These help with SEQUENCE or CHOICE components */
|
||||
|
||||
/* used to declare other types */
|
||||
|
||||
# define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
|
||||
(flags), (tag), offsetof(stname, field),\
|
||||
#field, ASN1_ITEM_ref(type) }
|
||||
|
||||
/* used when the structure is combined with the parent */
|
||||
|
||||
# define ASN1_EX_COMBINE(flags, tag, type) { \
|
||||
(flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) }
|
||||
|
||||
/* implicit and explicit helper macros */
|
||||
|
||||
# define ASN1_IMP_EX(stname, field, type, tag, ex) \
|
||||
ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type)
|
||||
|
||||
# define ASN1_EXP_EX(stname, field, type, tag, ex) \
|
||||
ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)
|
||||
|
||||
/* Any defined by macros: the field used is in the table itself */
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
|
||||
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
|
||||
# else
|
||||
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
|
||||
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
|
||||
# endif
|
||||
/* Plain simple type */
|
||||
# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
|
||||
|
||||
/* OPTIONAL simple type */
|
||||
# define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
|
||||
|
||||
/* IMPLICIT tagged simple type */
|
||||
# define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
|
||||
|
||||
/* IMPLICIT tagged OPTIONAL simple type */
|
||||
# define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
|
||||
|
||||
/* Same as above but EXPLICIT */
|
||||
|
||||
# define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
|
||||
# define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
|
||||
|
||||
/* SEQUENCE OF type */
|
||||
# define ASN1_SEQUENCE_OF(stname, field, type) \
|
||||
ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
|
||||
|
||||
/* OPTIONAL SEQUENCE OF */
|
||||
# define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
|
||||
ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
|
||||
|
||||
/* Same as above but for SET OF */
|
||||
|
||||
# define ASN1_SET_OF(stname, field, type) \
|
||||
ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
|
||||
|
||||
# define ASN1_SET_OF_OPT(stname, field, type) \
|
||||
ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
|
||||
|
||||
/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
|
||||
|
||||
# define ASN1_IMP_SET_OF(stname, field, type, tag) \
|
||||
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
|
||||
|
||||
# define ASN1_EXP_SET_OF(stname, field, type, tag) \
|
||||
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
|
||||
|
||||
# define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
|
||||
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
|
||||
|
||||
# define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
|
||||
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
|
||||
|
||||
# define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
|
||||
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
|
||||
|
||||
# define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
|
||||
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
|
||||
|
||||
# define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
|
||||
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
|
||||
|
||||
# define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
|
||||
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
|
||||
|
||||
/* EXPLICIT using indefinite length constructed form */
|
||||
# define ASN1_NDEF_EXP(stname, field, type, tag) \
|
||||
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)
|
||||
|
||||
/* EXPLICIT OPTIONAL using indefinite length constructed form */
|
||||
# define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
|
||||
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
|
||||
|
||||
/* Macros for the ASN1_ADB structure */
|
||||
|
||||
# define ASN1_ADB(name) \
|
||||
static const ASN1_ADB_TABLE name##_adbtbl[]
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
|
||||
# define ASN1_ADB_END(name, flags, field, app_table, def, none) \
|
||||
;\
|
||||
static const ASN1_ADB name##_adb = {\
|
||||
flags,\
|
||||
offsetof(name, field),\
|
||||
app_table,\
|
||||
name##_adbtbl,\
|
||||
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
|
||||
def,\
|
||||
none\
|
||||
}
|
||||
|
||||
# else
|
||||
|
||||
# define ASN1_ADB_END(name, flags, field, app_table, def, none) \
|
||||
;\
|
||||
static const ASN1_ITEM *name##_adb(void) \
|
||||
{ \
|
||||
static const ASN1_ADB internal_adb = \
|
||||
{\
|
||||
flags,\
|
||||
offsetof(name, field),\
|
||||
app_table,\
|
||||
name##_adbtbl,\
|
||||
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
|
||||
def,\
|
||||
none\
|
||||
}; \
|
||||
return (const ASN1_ITEM *) &internal_adb; \
|
||||
} \
|
||||
void dummy_function(void)
|
||||
|
||||
# endif
|
||||
|
||||
# define ADB_ENTRY(val, template) {val, template}
|
||||
|
||||
# define ASN1_ADB_TEMPLATE(name) \
|
||||
static const ASN1_TEMPLATE name##_tt
|
||||
|
||||
/*
|
||||
* This is the ASN1 template structure that defines a wrapper round the
|
||||
* actual type. It determines the actual position of the field in the value
|
||||
* structure, various flags such as OPTIONAL and the field name.
|
||||
*/
|
||||
|
||||
struct ASN1_TEMPLATE_st {
|
||||
unsigned long flags; /* Various flags */
|
||||
long tag; /* tag, not used if no tagging */
|
||||
unsigned long offset; /* Offset of this field in structure */
|
||||
# ifndef NO_ASN1_FIELD_NAMES
|
||||
const char *field_name; /* Field name */
|
||||
# endif
|
||||
ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */
|
||||
};
|
||||
|
||||
/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */
|
||||
|
||||
# define ASN1_TEMPLATE_item(t) (t->item_ptr)
|
||||
# define ASN1_TEMPLATE_adb(t) (t->item_ptr)
|
||||
|
||||
typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
|
||||
typedef struct ASN1_ADB_st ASN1_ADB;
|
||||
|
||||
struct ASN1_ADB_st {
|
||||
unsigned long flags; /* Various flags */
|
||||
unsigned long offset; /* Offset of selector field */
|
||||
STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */
|
||||
const ASN1_ADB_TABLE *tbl; /* Table of possible types */
|
||||
long tblcount; /* Number of entries in tbl */
|
||||
const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
|
||||
const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */
|
||||
};
|
||||
|
||||
struct ASN1_ADB_TABLE_st {
|
||||
long value; /* NID for an object or value for an int */
|
||||
const ASN1_TEMPLATE tt; /* item for this value */
|
||||
};
|
||||
|
||||
/* template flags */
|
||||
|
||||
/* Field is optional */
|
||||
# define ASN1_TFLG_OPTIONAL (0x1)
|
||||
|
||||
/* Field is a SET OF */
|
||||
# define ASN1_TFLG_SET_OF (0x1 << 1)
|
||||
|
||||
/* Field is a SEQUENCE OF */
|
||||
# define ASN1_TFLG_SEQUENCE_OF (0x2 << 1)
|
||||
|
||||
/*
|
||||
* Special case: this refers to a SET OF that will be sorted into DER order
|
||||
* when encoded *and* the corresponding STACK will be modified to match the
|
||||
* new order.
|
||||
*/
|
||||
# define ASN1_TFLG_SET_ORDER (0x3 << 1)
|
||||
|
||||
/* Mask for SET OF or SEQUENCE OF */
|
||||
# define ASN1_TFLG_SK_MASK (0x3 << 1)
|
||||
|
||||
/*
|
||||
* These flags mean the tag should be taken from the tag field. If EXPLICIT
|
||||
* then the underlying type is used for the inner tag.
|
||||
*/
|
||||
|
||||
/* IMPLICIT tagging */
|
||||
# define ASN1_TFLG_IMPTAG (0x1 << 3)
|
||||
|
||||
/* EXPLICIT tagging, inner tag from underlying type */
|
||||
# define ASN1_TFLG_EXPTAG (0x2 << 3)
|
||||
|
||||
# define ASN1_TFLG_TAG_MASK (0x3 << 3)
|
||||
|
||||
/* context specific IMPLICIT */
|
||||
# define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT
|
||||
|
||||
/* context specific EXPLICIT */
|
||||
# define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT
|
||||
|
||||
/*
|
||||
* If tagging is in force these determine the type of tag to use. Otherwise
|
||||
* the tag is determined by the underlying type. These values reflect the
|
||||
* actual octet format.
|
||||
*/
|
||||
|
||||
/* Universal tag */
|
||||
# define ASN1_TFLG_UNIVERSAL (0x0<<6)
|
||||
/* Application tag */
|
||||
# define ASN1_TFLG_APPLICATION (0x1<<6)
|
||||
/* Context specific tag */
|
||||
# define ASN1_TFLG_CONTEXT (0x2<<6)
|
||||
/* Private tag */
|
||||
# define ASN1_TFLG_PRIVATE (0x3<<6)
|
||||
|
||||
# define ASN1_TFLG_TAG_CLASS (0x3<<6)
|
||||
|
||||
/*
|
||||
* These are for ANY DEFINED BY type. In this case the 'item' field points to
|
||||
* an ASN1_ADB structure which contains a table of values to decode the
|
||||
* relevant type
|
||||
*/
|
||||
|
||||
# define ASN1_TFLG_ADB_MASK (0x3<<8)
|
||||
|
||||
# define ASN1_TFLG_ADB_OID (0x1<<8)
|
||||
|
||||
# define ASN1_TFLG_ADB_INT (0x1<<9)
|
||||
|
||||
/*
|
||||
* This flag means a parent structure is passed instead of the field: this is
|
||||
* useful is a SEQUENCE is being combined with a CHOICE for example. Since
|
||||
* this means the structure and item name will differ we need to use the
|
||||
* ASN1_CHOICE_END_name() macro for example.
|
||||
*/
|
||||
|
||||
# define ASN1_TFLG_COMBINE (0x1<<10)
|
||||
|
||||
/*
|
||||
* This flag when present in a SEQUENCE OF, SET OF or EXPLICIT causes
|
||||
* indefinite length constructed encoding to be used if required.
|
||||
*/
|
||||
|
||||
# define ASN1_TFLG_NDEF (0x1<<11)
|
||||
|
||||
/* This is the actual ASN1 item itself */
|
||||
|
||||
struct ASN1_ITEM_st {
|
||||
char itype; /* The item type, primitive, SEQUENCE, CHOICE
|
||||
* or extern */
|
||||
long utype; /* underlying type */
|
||||
const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains
|
||||
* the contents */
|
||||
long tcount; /* Number of templates if SEQUENCE or CHOICE */
|
||||
const void *funcs; /* functions that handle this type */
|
||||
long size; /* Structure size (usually) */
|
||||
# ifndef NO_ASN1_FIELD_NAMES
|
||||
const char *sname; /* Structure name */
|
||||
# endif
|
||||
};
|
||||
|
||||
/*-
|
||||
* These are values for the itype field and
|
||||
* determine how the type is interpreted.
|
||||
*
|
||||
* For PRIMITIVE types the underlying type
|
||||
* determines the behaviour if items is NULL.
|
||||
*
|
||||
* Otherwise templates must contain a single
|
||||
* template and the type is treated in the
|
||||
* same way as the type specified in the template.
|
||||
*
|
||||
* For SEQUENCE types the templates field points
|
||||
* to the members, the size field is the
|
||||
* structure size.
|
||||
*
|
||||
* For CHOICE types the templates field points
|
||||
* to each possible member (typically a union)
|
||||
* and the 'size' field is the offset of the
|
||||
* selector.
|
||||
*
|
||||
* The 'funcs' field is used for application
|
||||
* specific functions.
|
||||
*
|
||||
* For COMPAT types the funcs field gives a
|
||||
* set of functions that handle this type, this
|
||||
* supports the old d2i, i2d convention.
|
||||
*
|
||||
* The EXTERN type uses a new style d2i/i2d.
|
||||
* The new style should be used where possible
|
||||
* because it avoids things like the d2i IMPLICIT
|
||||
* hack.
|
||||
*
|
||||
* MSTRING is a multiple string type, it is used
|
||||
* for a CHOICE of character strings where the
|
||||
* actual strings all occupy an ASN1_STRING
|
||||
* structure. In this case the 'utype' field
|
||||
* has a special meaning, it is used as a mask
|
||||
* of acceptable types using the B_ASN1 constants.
|
||||
*
|
||||
* NDEF_SEQUENCE is the same as SEQUENCE except
|
||||
* that it will use indefinite length constructed
|
||||
* encoding if requested.
|
||||
*
|
||||
*/
|
||||
|
||||
# define ASN1_ITYPE_PRIMITIVE 0x0
|
||||
|
||||
# define ASN1_ITYPE_SEQUENCE 0x1
|
||||
|
||||
# define ASN1_ITYPE_CHOICE 0x2
|
||||
|
||||
# define ASN1_ITYPE_COMPAT 0x3
|
||||
|
||||
# define ASN1_ITYPE_EXTERN 0x4
|
||||
|
||||
# define ASN1_ITYPE_MSTRING 0x5
|
||||
|
||||
# define ASN1_ITYPE_NDEF_SEQUENCE 0x6
|
||||
|
||||
/*
|
||||
* Cache for ASN1 tag and length, so we don't keep re-reading it for things
|
||||
* like CHOICE
|
||||
*/
|
||||
|
||||
struct ASN1_TLC_st {
|
||||
char valid; /* Values below are valid */
|
||||
int ret; /* return value */
|
||||
long plen; /* length */
|
||||
int ptag; /* class value */
|
||||
int pclass; /* class value */
|
||||
int hdrlen; /* header length */
|
||||
};
|
||||
|
||||
/* Typedefs for ASN1 function pointers */
|
||||
|
||||
typedef ASN1_VALUE *ASN1_new_func(void);
|
||||
typedef void ASN1_free_func(ASN1_VALUE *a);
|
||||
typedef ASN1_VALUE *ASN1_d2i_func(ASN1_VALUE **a, const unsigned char **in,
|
||||
long length);
|
||||
typedef int ASN1_i2d_func(ASN1_VALUE *a, unsigned char **in);
|
||||
|
||||
typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
const ASN1_ITEM *it, int tag, int aclass, char opt,
|
||||
ASN1_TLC *ctx);
|
||||
|
||||
typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
||||
const ASN1_ITEM *it, int tag, int aclass);
|
||||
typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
|
||||
typedef int ASN1_ex_print_func(BIO *out, ASN1_VALUE **pval,
|
||||
int indent, const char *fname,
|
||||
const ASN1_PCTX *pctx);
|
||||
|
||||
typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont,
|
||||
int *putype, const ASN1_ITEM *it);
|
||||
typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont,
|
||||
int len, int utype, char *free_cont,
|
||||
const ASN1_ITEM *it);
|
||||
typedef int ASN1_primitive_print(BIO *out, ASN1_VALUE **pval,
|
||||
const ASN1_ITEM *it, int indent,
|
||||
const ASN1_PCTX *pctx);
|
||||
|
||||
typedef struct ASN1_COMPAT_FUNCS_st {
|
||||
ASN1_new_func *asn1_new;
|
||||
ASN1_free_func *asn1_free;
|
||||
ASN1_d2i_func *asn1_d2i;
|
||||
ASN1_i2d_func *asn1_i2d;
|
||||
} ASN1_COMPAT_FUNCS;
|
||||
|
||||
typedef struct ASN1_EXTERN_FUNCS_st {
|
||||
void *app_data;
|
||||
ASN1_ex_new_func *asn1_ex_new;
|
||||
ASN1_ex_free_func *asn1_ex_free;
|
||||
ASN1_ex_free_func *asn1_ex_clear;
|
||||
ASN1_ex_d2i *asn1_ex_d2i;
|
||||
ASN1_ex_i2d *asn1_ex_i2d;
|
||||
ASN1_ex_print_func *asn1_ex_print;
|
||||
} ASN1_EXTERN_FUNCS;
|
||||
|
||||
typedef struct ASN1_PRIMITIVE_FUNCS_st {
|
||||
void *app_data;
|
||||
unsigned long flags;
|
||||
ASN1_ex_new_func *prim_new;
|
||||
ASN1_ex_free_func *prim_free;
|
||||
ASN1_ex_free_func *prim_clear;
|
||||
ASN1_primitive_c2i *prim_c2i;
|
||||
ASN1_primitive_i2c *prim_i2c;
|
||||
ASN1_primitive_print *prim_print;
|
||||
} ASN1_PRIMITIVE_FUNCS;
|
||||
|
||||
/*
|
||||
* This is the ASN1_AUX structure: it handles various miscellaneous
|
||||
* requirements. For example the use of reference counts and an informational
|
||||
* callback. The "informational callback" is called at various points during
|
||||
* the ASN1 encoding and decoding. It can be used to provide minor
|
||||
* customisation of the structures used. This is most useful where the
|
||||
* supplied routines *almost* do the right thing but need some extra help at
|
||||
* a few points. If the callback returns zero then it is assumed a fatal
|
||||
* error has occurred and the main operation should be abandoned. If major
|
||||
* changes in the default behaviour are required then an external type is
|
||||
* more appropriate.
|
||||
*/
|
||||
|
||||
typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it,
|
||||
void *exarg);
|
||||
|
||||
typedef struct ASN1_AUX_st {
|
||||
void *app_data;
|
||||
int flags;
|
||||
int ref_offset; /* Offset of reference value */
|
||||
int ref_lock; /* Lock type to use */
|
||||
ASN1_aux_cb *asn1_cb;
|
||||
int enc_offset; /* Offset of ASN1_ENCODING structure */
|
||||
} ASN1_AUX;
|
||||
|
||||
/* For print related callbacks exarg points to this structure */
|
||||
typedef struct ASN1_PRINT_ARG_st {
|
||||
BIO *out;
|
||||
int indent;
|
||||
const ASN1_PCTX *pctx;
|
||||
} ASN1_PRINT_ARG;
|
||||
|
||||
/* For streaming related callbacks exarg points to this structure */
|
||||
typedef struct ASN1_STREAM_ARG_st {
|
||||
/* BIO to stream through */
|
||||
BIO *out;
|
||||
/* BIO with filters appended */
|
||||
BIO *ndef_bio;
|
||||
/* Streaming I/O boundary */
|
||||
unsigned char **boundary;
|
||||
} ASN1_STREAM_ARG;
|
||||
|
||||
/* Flags in ASN1_AUX */
|
||||
|
||||
/* Use a reference count */
|
||||
# define ASN1_AFLG_REFCOUNT 1
|
||||
/* Save the encoding of structure (useful for signatures) */
|
||||
# define ASN1_AFLG_ENCODING 2
|
||||
/* The Sequence length is invalid */
|
||||
# define ASN1_AFLG_BROKEN 4
|
||||
|
||||
/* operation values for asn1_cb */
|
||||
|
||||
# define ASN1_OP_NEW_PRE 0
|
||||
# define ASN1_OP_NEW_POST 1
|
||||
# define ASN1_OP_FREE_PRE 2
|
||||
# define ASN1_OP_FREE_POST 3
|
||||
# define ASN1_OP_D2I_PRE 4
|
||||
# define ASN1_OP_D2I_POST 5
|
||||
# define ASN1_OP_I2D_PRE 6
|
||||
# define ASN1_OP_I2D_POST 7
|
||||
# define ASN1_OP_PRINT_PRE 8
|
||||
# define ASN1_OP_PRINT_POST 9
|
||||
# define ASN1_OP_STREAM_PRE 10
|
||||
# define ASN1_OP_STREAM_POST 11
|
||||
# define ASN1_OP_DETACHED_PRE 12
|
||||
# define ASN1_OP_DETACHED_POST 13
|
||||
|
||||
/* Macro to implement a primitive type */
|
||||
# define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
|
||||
# define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
|
||||
ASN1_ITEM_start(itname) \
|
||||
ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
|
||||
ASN1_ITEM_end(itname)
|
||||
|
||||
/* Macro to implement a multi string type */
|
||||
# define IMPLEMENT_ASN1_MSTRING(itname, mask) \
|
||||
ASN1_ITEM_start(itname) \
|
||||
ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
|
||||
ASN1_ITEM_end(itname)
|
||||
|
||||
/* Macro to implement an ASN1_ITEM in terms of old style funcs */
|
||||
|
||||
# define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE)
|
||||
|
||||
# define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \
|
||||
static const ASN1_COMPAT_FUNCS sname##_ff = { \
|
||||
(ASN1_new_func *)sname##_new, \
|
||||
(ASN1_free_func *)sname##_free, \
|
||||
(ASN1_d2i_func *)d2i_##sname, \
|
||||
(ASN1_i2d_func *)i2d_##sname, \
|
||||
}; \
|
||||
ASN1_ITEM_start(sname) \
|
||||
ASN1_ITYPE_COMPAT, \
|
||||
tag, \
|
||||
NULL, \
|
||||
0, \
|
||||
&sname##_ff, \
|
||||
0, \
|
||||
#sname \
|
||||
ASN1_ITEM_end(sname)
|
||||
|
||||
# define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
|
||||
ASN1_ITEM_start(sname) \
|
||||
ASN1_ITYPE_EXTERN, \
|
||||
tag, \
|
||||
NULL, \
|
||||
0, \
|
||||
&fptrs, \
|
||||
0, \
|
||||
#sname \
|
||||
ASN1_ITEM_end(sname)
|
||||
|
||||
/* Macro to implement standard functions in terms of ASN1_ITEM structures */
|
||||
|
||||
# define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname)
|
||||
|
||||
# define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)
|
||||
|
||||
# define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
|
||||
IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
|
||||
|
||||
# define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \
|
||||
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname)
|
||||
|
||||
# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
|
||||
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
|
||||
|
||||
# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \
|
||||
pre stname *fname##_new(void) \
|
||||
{ \
|
||||
return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
|
||||
} \
|
||||
pre void fname##_free(stname *a) \
|
||||
{ \
|
||||
ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
|
||||
}
|
||||
|
||||
# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
|
||||
stname *fname##_new(void) \
|
||||
{ \
|
||||
return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
|
||||
} \
|
||||
void fname##_free(stname *a) \
|
||||
{ \
|
||||
ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
|
||||
}
|
||||
|
||||
# define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \
|
||||
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
|
||||
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
|
||||
|
||||
# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
|
||||
stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
|
||||
{ \
|
||||
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
|
||||
} \
|
||||
int i2d_##fname(stname *a, unsigned char **out) \
|
||||
{ \
|
||||
return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
|
||||
}
|
||||
|
||||
# define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \
|
||||
int i2d_##stname##_NDEF(stname *a, unsigned char **out) \
|
||||
{ \
|
||||
return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
|
||||
}
|
||||
|
||||
/*
|
||||
* This includes evil casts to remove const: they will go away when full ASN1
|
||||
* constification is done.
|
||||
*/
|
||||
# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
|
||||
stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
|
||||
{ \
|
||||
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
|
||||
} \
|
||||
int i2d_##fname(const stname *a, unsigned char **out) \
|
||||
{ \
|
||||
return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
|
||||
}
|
||||
|
||||
# define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
|
||||
stname * stname##_dup(stname *x) \
|
||||
{ \
|
||||
return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
|
||||
}
|
||||
|
||||
# define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \
|
||||
IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname)
|
||||
|
||||
# define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \
|
||||
int fname##_print_ctx(BIO *out, stname *x, int indent, \
|
||||
const ASN1_PCTX *pctx) \
|
||||
{ \
|
||||
return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \
|
||||
ASN1_ITEM_rptr(itname), pctx); \
|
||||
}
|
||||
|
||||
# define IMPLEMENT_ASN1_FUNCTIONS_const(name) \
|
||||
IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name)
|
||||
|
||||
# define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \
|
||||
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
|
||||
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
|
||||
|
||||
/* external definitions for primitive types */
|
||||
|
||||
DECLARE_ASN1_ITEM(ASN1_BOOLEAN)
|
||||
DECLARE_ASN1_ITEM(ASN1_TBOOLEAN)
|
||||
DECLARE_ASN1_ITEM(ASN1_FBOOLEAN)
|
||||
DECLARE_ASN1_ITEM(ASN1_SEQUENCE)
|
||||
DECLARE_ASN1_ITEM(CBIGNUM)
|
||||
DECLARE_ASN1_ITEM(BIGNUM)
|
||||
DECLARE_ASN1_ITEM(LONG)
|
||||
DECLARE_ASN1_ITEM(ZLONG)
|
||||
|
||||
DECLARE_STACK_OF(ASN1_VALUE)
|
||||
|
||||
/* Functions used internally by the ASN1 code */
|
||||
|
||||
int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
|
||||
int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
|
||||
void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
|
||||
int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
const ASN1_TEMPLATE *tt);
|
||||
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
const ASN1_ITEM *it, int tag, int aclass, char opt,
|
||||
ASN1_TLC *ctx);
|
||||
|
||||
int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
||||
const ASN1_ITEM *it, int tag, int aclass);
|
||||
int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out,
|
||||
const ASN1_TEMPLATE *tt);
|
||||
void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
|
||||
int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
|
||||
const ASN1_ITEM *it);
|
||||
int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
|
||||
int utype, char *free_cont, const ASN1_ITEM *it);
|
||||
|
||||
int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
int asn1_set_choice_selector(ASN1_VALUE **pval, int value,
|
||||
const ASN1_ITEM *it);
|
||||
|
||||
ASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
|
||||
|
||||
const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,
|
||||
int nullerr);
|
||||
|
||||
int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it);
|
||||
|
||||
void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval,
|
||||
const ASN1_ITEM *it);
|
||||
int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen,
|
||||
const ASN1_ITEM *it);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -1,883 +0,0 @@
|
|||
/* crypto/bio/bio.h */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef HEADER_BIO_H
|
||||
# define HEADER_BIO_H
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
|
||||
# ifndef OPENSSL_NO_FP_API
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
# include <stdarg.h>
|
||||
|
||||
# include <openssl/crypto.h>
|
||||
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
# ifndef OPENSSL_SYS_VMS
|
||||
# include <stdint.h>
|
||||
# else
|
||||
# include <inttypes.h>
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* These are the 'types' of BIOs */
|
||||
# define BIO_TYPE_NONE 0
|
||||
# define BIO_TYPE_MEM (1|0x0400)
|
||||
# define BIO_TYPE_FILE (2|0x0400)
|
||||
|
||||
# define BIO_TYPE_FD (4|0x0400|0x0100)
|
||||
# define BIO_TYPE_SOCKET (5|0x0400|0x0100)
|
||||
# define BIO_TYPE_NULL (6|0x0400)
|
||||
# define BIO_TYPE_SSL (7|0x0200)
|
||||
# define BIO_TYPE_MD (8|0x0200)/* passive filter */
|
||||
# define BIO_TYPE_BUFFER (9|0x0200)/* filter */
|
||||
# define BIO_TYPE_CIPHER (10|0x0200)/* filter */
|
||||
# define BIO_TYPE_BASE64 (11|0x0200)/* filter */
|
||||
# define BIO_TYPE_CONNECT (12|0x0400|0x0100)/* socket - connect */
|
||||
# define BIO_TYPE_ACCEPT (13|0x0400|0x0100)/* socket for accept */
|
||||
# define BIO_TYPE_PROXY_CLIENT (14|0x0200)/* client proxy BIO */
|
||||
# define BIO_TYPE_PROXY_SERVER (15|0x0200)/* server proxy BIO */
|
||||
# define BIO_TYPE_NBIO_TEST (16|0x0200)/* server proxy BIO */
|
||||
# define BIO_TYPE_NULL_FILTER (17|0x0200)
|
||||
# define BIO_TYPE_BER (18|0x0200)/* BER -> bin filter */
|
||||
# define BIO_TYPE_BIO (19|0x0400)/* (half a) BIO pair */
|
||||
# define BIO_TYPE_LINEBUFFER (20|0x0200)/* filter */
|
||||
# define BIO_TYPE_DGRAM (21|0x0400|0x0100)
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
# define BIO_TYPE_DGRAM_SCTP (24|0x0400|0x0100)
|
||||
# endif
|
||||
# define BIO_TYPE_ASN1 (22|0x0200)/* filter */
|
||||
# define BIO_TYPE_COMP (23|0x0200)/* filter */
|
||||
|
||||
# define BIO_TYPE_DESCRIPTOR 0x0100/* socket, fd, connect or accept */
|
||||
# define BIO_TYPE_FILTER 0x0200
|
||||
# define BIO_TYPE_SOURCE_SINK 0x0400
|
||||
|
||||
/*
|
||||
* BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
|
||||
* BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||
*/
|
||||
# define BIO_NOCLOSE 0x00
|
||||
# define BIO_CLOSE 0x01
|
||||
|
||||
/*
|
||||
* These are used in the following macros and are passed to BIO_ctrl()
|
||||
*/
|
||||
# define BIO_CTRL_RESET 1/* opt - rewind/zero etc */
|
||||
# define BIO_CTRL_EOF 2/* opt - are we at the eof */
|
||||
# define BIO_CTRL_INFO 3/* opt - extra tit-bits */
|
||||
# define BIO_CTRL_SET 4/* man - set the 'IO' type */
|
||||
# define BIO_CTRL_GET 5/* man - get the 'IO' type */
|
||||
# define BIO_CTRL_PUSH 6/* opt - internal, used to signify change */
|
||||
# define BIO_CTRL_POP 7/* opt - internal, used to signify change */
|
||||
# define BIO_CTRL_GET_CLOSE 8/* man - set the 'close' on free */
|
||||
# define BIO_CTRL_SET_CLOSE 9/* man - set the 'close' on free */
|
||||
# define BIO_CTRL_PENDING 10/* opt - is their more data buffered */
|
||||
# define BIO_CTRL_FLUSH 11/* opt - 'flush' buffered output */
|
||||
# define BIO_CTRL_DUP 12/* man - extra stuff for 'duped' BIO */
|
||||
# define BIO_CTRL_WPENDING 13/* opt - number of bytes still to write */
|
||||
/* callback is int cb(BIO *bio,state,ret); */
|
||||
# define BIO_CTRL_SET_CALLBACK 14/* opt - set callback function */
|
||||
# define BIO_CTRL_GET_CALLBACK 15/* opt - set callback function */
|
||||
|
||||
# define BIO_CTRL_SET_FILENAME 30/* BIO_s_file special */
|
||||
|
||||
/* dgram BIO stuff */
|
||||
# define BIO_CTRL_DGRAM_CONNECT 31/* BIO dgram special */
|
||||
# define BIO_CTRL_DGRAM_SET_CONNECTED 32/* allow for an externally connected
|
||||
* socket to be passed in */
|
||||
# define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33/* setsockopt, essentially */
|
||||
# define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34/* getsockopt, essentially */
|
||||
# define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35/* setsockopt, essentially */
|
||||
# define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36/* getsockopt, essentially */
|
||||
|
||||
# define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37/* flag whether the last */
|
||||
# define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38/* I/O operation tiemd out */
|
||||
|
||||
/* #ifdef IP_MTU_DISCOVER */
|
||||
# define BIO_CTRL_DGRAM_MTU_DISCOVER 39/* set DF bit on egress packets */
|
||||
/* #endif */
|
||||
|
||||
# define BIO_CTRL_DGRAM_QUERY_MTU 40/* as kernel for current MTU */
|
||||
# define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47
|
||||
# define BIO_CTRL_DGRAM_GET_MTU 41/* get cached value for MTU */
|
||||
# define BIO_CTRL_DGRAM_SET_MTU 42/* set cached value for MTU.
|
||||
* want to use this if asking
|
||||
* the kernel fails */
|
||||
|
||||
# define BIO_CTRL_DGRAM_MTU_EXCEEDED 43/* check whether the MTU was
|
||||
* exceed in the previous write
|
||||
* operation */
|
||||
|
||||
# define BIO_CTRL_DGRAM_GET_PEER 46
|
||||
# define BIO_CTRL_DGRAM_SET_PEER 44/* Destination for the data */
|
||||
|
||||
# define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45/* Next DTLS handshake timeout
|
||||
* to adjust socket timeouts */
|
||||
# define BIO_CTRL_DGRAM_SET_DONT_FRAG 48
|
||||
|
||||
# define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49
|
||||
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
/* SCTP stuff */
|
||||
# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50
|
||||
# define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51
|
||||
# define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52
|
||||
# define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53
|
||||
# define BIO_CTRL_DGRAM_SCTP_GET_SNDINFO 60
|
||||
# define BIO_CTRL_DGRAM_SCTP_SET_SNDINFO 61
|
||||
# define BIO_CTRL_DGRAM_SCTP_GET_RCVINFO 62
|
||||
# define BIO_CTRL_DGRAM_SCTP_SET_RCVINFO 63
|
||||
# define BIO_CTRL_DGRAM_SCTP_GET_PRINFO 64
|
||||
# define BIO_CTRL_DGRAM_SCTP_SET_PRINFO 65
|
||||
# define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70
|
||||
# endif
|
||||
|
||||
/* modifiers */
|
||||
# define BIO_FP_READ 0x02
|
||||
# define BIO_FP_WRITE 0x04
|
||||
# define BIO_FP_APPEND 0x08
|
||||
# define BIO_FP_TEXT 0x10
|
||||
|
||||
# define BIO_FLAGS_READ 0x01
|
||||
# define BIO_FLAGS_WRITE 0x02
|
||||
# define BIO_FLAGS_IO_SPECIAL 0x04
|
||||
# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
|
||||
# define BIO_FLAGS_SHOULD_RETRY 0x08
|
||||
# ifndef BIO_FLAGS_UPLINK
|
||||
/*
|
||||
* "UPLINK" flag denotes file descriptors provided by application. It
|
||||
* defaults to 0, as most platforms don't require UPLINK interface.
|
||||
*/
|
||||
# define BIO_FLAGS_UPLINK 0
|
||||
# endif
|
||||
|
||||
/* Used in BIO_gethostbyname() */
|
||||
# define BIO_GHBN_CTRL_HITS 1
|
||||
# define BIO_GHBN_CTRL_MISSES 2
|
||||
# define BIO_GHBN_CTRL_CACHE_SIZE 3
|
||||
# define BIO_GHBN_CTRL_GET_ENTRY 4
|
||||
# define BIO_GHBN_CTRL_FLUSH 5
|
||||
|
||||
/* Mostly used in the SSL BIO */
|
||||
/*-
|
||||
* Not used anymore
|
||||
* #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10
|
||||
* #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20
|
||||
* #define BIO_FLAGS_PROTOCOL_STARTUP 0x40
|
||||
*/
|
||||
|
||||
# define BIO_FLAGS_BASE64_NO_NL 0x100
|
||||
|
||||
/*
|
||||
* This is used with memory BIOs: it means we shouldn't free up or change the
|
||||
* data in any way.
|
||||
*/
|
||||
# define BIO_FLAGS_MEM_RDONLY 0x200
|
||||
|
||||
typedef struct bio_st BIO;
|
||||
|
||||
void BIO_set_flags(BIO *b, int flags);
|
||||
int BIO_test_flags(const BIO *b, int flags);
|
||||
void BIO_clear_flags(BIO *b, int flags);
|
||||
|
||||
# define BIO_get_flags(b) BIO_test_flags(b, ~(0x0))
|
||||
# define BIO_set_retry_special(b) \
|
||||
BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
|
||||
# define BIO_set_retry_read(b) \
|
||||
BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
|
||||
# define BIO_set_retry_write(b) \
|
||||
BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
|
||||
|
||||
/* These are normally used internally in BIOs */
|
||||
# define BIO_clear_retry_flags(b) \
|
||||
BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
|
||||
# define BIO_get_retry_flags(b) \
|
||||
BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
|
||||
|
||||
/* These should be used by the application to tell why we should retry */
|
||||
# define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ)
|
||||
# define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE)
|
||||
# define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
|
||||
# define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS)
|
||||
# define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
|
||||
|
||||
/*
|
||||
* The next three are used in conjunction with the BIO_should_io_special()
|
||||
* condition. After this returns true, BIO *BIO_get_retry_BIO(BIO *bio, int
|
||||
* *reason); will walk the BIO stack and return the 'reason' for the special
|
||||
* and the offending BIO. Given a BIO, BIO_get_retry_reason(bio) will return
|
||||
* the code.
|
||||
*/
|
||||
/*
|
||||
* Returned from the SSL bio when the certificate retrieval code had an error
|
||||
*/
|
||||
# define BIO_RR_SSL_X509_LOOKUP 0x01
|
||||
/* Returned from the connect BIO when a connect would have blocked */
|
||||
# define BIO_RR_CONNECT 0x02
|
||||
/* Returned from the accept BIO when an accept would have blocked */
|
||||
# define BIO_RR_ACCEPT 0x03
|
||||
|
||||
/* These are passed by the BIO callback */
|
||||
# define BIO_CB_FREE 0x01
|
||||
# define BIO_CB_READ 0x02
|
||||
# define BIO_CB_WRITE 0x03
|
||||
# define BIO_CB_PUTS 0x04
|
||||
# define BIO_CB_GETS 0x05
|
||||
# define BIO_CB_CTRL 0x06
|
||||
|
||||
/*
|
||||
* The callback is called before and after the underling operation, The
|
||||
* BIO_CB_RETURN flag indicates if it is after the call
|
||||
*/
|
||||
# define BIO_CB_RETURN 0x80
|
||||
# define BIO_CB_return(a) ((a)|BIO_CB_RETURN)
|
||||
# define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
|
||||
# define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
|
||||
|
||||
long (*BIO_get_callback(const BIO *b)) (struct bio_st *, int, const char *,
|
||||
int, long, long);
|
||||
void BIO_set_callback(BIO *b,
|
||||
long (*callback) (struct bio_st *, int, const char *,
|
||||
int, long, long));
|
||||
char *BIO_get_callback_arg(const BIO *b);
|
||||
void BIO_set_callback_arg(BIO *b, char *arg);
|
||||
|
||||
const char *BIO_method_name(const BIO *b);
|
||||
int BIO_method_type(const BIO *b);
|
||||
|
||||
typedef void bio_info_cb (struct bio_st *, int, const char *, int, long,
|
||||
long);
|
||||
|
||||
typedef struct bio_method_st {
|
||||
int type;
|
||||
const char *name;
|
||||
int (*bwrite) (BIO *, const char *, int);
|
||||
int (*bread) (BIO *, char *, int);
|
||||
int (*bputs) (BIO *, const char *);
|
||||
int (*bgets) (BIO *, char *, int);
|
||||
long (*ctrl) (BIO *, int, long, void *);
|
||||
int (*create) (BIO *);
|
||||
int (*destroy) (BIO *);
|
||||
long (*callback_ctrl) (BIO *, int, bio_info_cb *);
|
||||
} BIO_METHOD;
|
||||
|
||||
struct bio_st {
|
||||
BIO_METHOD *method;
|
||||
/* bio, mode, argp, argi, argl, ret */
|
||||
long (*callback) (struct bio_st *, int, const char *, int, long, long);
|
||||
char *cb_arg; /* first argument for the callback */
|
||||
int init;
|
||||
int shutdown;
|
||||
int flags; /* extra storage */
|
||||
int retry_reason;
|
||||
int num;
|
||||
void *ptr;
|
||||
struct bio_st *next_bio; /* used by filter BIOs */
|
||||
struct bio_st *prev_bio; /* used by filter BIOs */
|
||||
int references;
|
||||
unsigned long num_read;
|
||||
unsigned long num_write;
|
||||
CRYPTO_EX_DATA ex_data;
|
||||
};
|
||||
|
||||
DECLARE_STACK_OF(BIO)
|
||||
|
||||
typedef struct bio_f_buffer_ctx_struct {
|
||||
/*-
|
||||
* Buffers are setup like this:
|
||||
*
|
||||
* <---------------------- size ----------------------->
|
||||
* +---------------------------------------------------+
|
||||
* | consumed | remaining | free space |
|
||||
* +---------------------------------------------------+
|
||||
* <-- off --><------- len ------->
|
||||
*/
|
||||
/*- BIO *bio; *//*
|
||||
* this is now in the BIO struct
|
||||
*/
|
||||
int ibuf_size; /* how big is the input buffer */
|
||||
int obuf_size; /* how big is the output buffer */
|
||||
char *ibuf; /* the char array */
|
||||
int ibuf_len; /* how many bytes are in it */
|
||||
int ibuf_off; /* write/read offset */
|
||||
char *obuf; /* the char array */
|
||||
int obuf_len; /* how many bytes are in it */
|
||||
int obuf_off; /* write/read offset */
|
||||
} BIO_F_BUFFER_CTX;
|
||||
|
||||
/* Prefix and suffix callback in ASN1 BIO */
|
||||
typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,
|
||||
void *parg);
|
||||
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
/* SCTP parameter structs */
|
||||
struct bio_dgram_sctp_sndinfo {
|
||||
uint16_t snd_sid;
|
||||
uint16_t snd_flags;
|
||||
uint32_t snd_ppid;
|
||||
uint32_t snd_context;
|
||||
};
|
||||
|
||||
struct bio_dgram_sctp_rcvinfo {
|
||||
uint16_t rcv_sid;
|
||||
uint16_t rcv_ssn;
|
||||
uint16_t rcv_flags;
|
||||
uint32_t rcv_ppid;
|
||||
uint32_t rcv_tsn;
|
||||
uint32_t rcv_cumtsn;
|
||||
uint32_t rcv_context;
|
||||
};
|
||||
|
||||
struct bio_dgram_sctp_prinfo {
|
||||
uint16_t pr_policy;
|
||||
uint32_t pr_value;
|
||||
};
|
||||
# endif
|
||||
|
||||
/* connect BIO stuff */
|
||||
# define BIO_CONN_S_BEFORE 1
|
||||
# define BIO_CONN_S_GET_IP 2
|
||||
# define BIO_CONN_S_GET_PORT 3
|
||||
# define BIO_CONN_S_CREATE_SOCKET 4
|
||||
# define BIO_CONN_S_CONNECT 5
|
||||
# define BIO_CONN_S_OK 6
|
||||
# define BIO_CONN_S_BLOCKED_CONNECT 7
|
||||
# define BIO_CONN_S_NBIO 8
|
||||
/*
|
||||
* #define BIO_CONN_get_param_hostname BIO_ctrl
|
||||
*/
|
||||
|
||||
# define BIO_C_SET_CONNECT 100
|
||||
# define BIO_C_DO_STATE_MACHINE 101
|
||||
# define BIO_C_SET_NBIO 102
|
||||
# define BIO_C_SET_PROXY_PARAM 103
|
||||
# define BIO_C_SET_FD 104
|
||||
# define BIO_C_GET_FD 105
|
||||
# define BIO_C_SET_FILE_PTR 106
|
||||
# define BIO_C_GET_FILE_PTR 107
|
||||
# define BIO_C_SET_FILENAME 108
|
||||
# define BIO_C_SET_SSL 109
|
||||
# define BIO_C_GET_SSL 110
|
||||
# define BIO_C_SET_MD 111
|
||||
# define BIO_C_GET_MD 112
|
||||
# define BIO_C_GET_CIPHER_STATUS 113
|
||||
# define BIO_C_SET_BUF_MEM 114
|
||||
# define BIO_C_GET_BUF_MEM_PTR 115
|
||||
# define BIO_C_GET_BUFF_NUM_LINES 116
|
||||
# define BIO_C_SET_BUFF_SIZE 117
|
||||
# define BIO_C_SET_ACCEPT 118
|
||||
# define BIO_C_SSL_MODE 119
|
||||
# define BIO_C_GET_MD_CTX 120
|
||||
# define BIO_C_GET_PROXY_PARAM 121
|
||||
# define BIO_C_SET_BUFF_READ_DATA 122/* data to read first */
|
||||
# define BIO_C_GET_CONNECT 123
|
||||
# define BIO_C_GET_ACCEPT 124
|
||||
# define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125
|
||||
# define BIO_C_GET_SSL_NUM_RENEGOTIATES 126
|
||||
# define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127
|
||||
# define BIO_C_FILE_SEEK 128
|
||||
# define BIO_C_GET_CIPHER_CTX 129
|
||||
# define BIO_C_SET_BUF_MEM_EOF_RETURN 130/* return end of input
|
||||
* value */
|
||||
# define BIO_C_SET_BIND_MODE 131
|
||||
# define BIO_C_GET_BIND_MODE 132
|
||||
# define BIO_C_FILE_TELL 133
|
||||
# define BIO_C_GET_SOCKS 134
|
||||
# define BIO_C_SET_SOCKS 135
|
||||
|
||||
# define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */
|
||||
# define BIO_C_GET_WRITE_BUF_SIZE 137
|
||||
# define BIO_C_MAKE_BIO_PAIR 138
|
||||
# define BIO_C_DESTROY_BIO_PAIR 139
|
||||
# define BIO_C_GET_WRITE_GUARANTEE 140
|
||||
# define BIO_C_GET_READ_REQUEST 141
|
||||
# define BIO_C_SHUTDOWN_WR 142
|
||||
# define BIO_C_NREAD0 143
|
||||
# define BIO_C_NREAD 144
|
||||
# define BIO_C_NWRITE0 145
|
||||
# define BIO_C_NWRITE 146
|
||||
# define BIO_C_RESET_READ_REQUEST 147
|
||||
# define BIO_C_SET_MD_CTX 148
|
||||
|
||||
# define BIO_C_SET_PREFIX 149
|
||||
# define BIO_C_GET_PREFIX 150
|
||||
# define BIO_C_SET_SUFFIX 151
|
||||
# define BIO_C_GET_SUFFIX 152
|
||||
|
||||
# define BIO_C_SET_EX_ARG 153
|
||||
# define BIO_C_GET_EX_ARG 154
|
||||
|
||||
# define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
|
||||
# define BIO_get_app_data(s) BIO_get_ex_data(s,0)
|
||||
|
||||
/* BIO_s_connect() and BIO_s_socks4a_connect() */
|
||||
# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name)
|
||||
# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port)
|
||||
# define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip)
|
||||
# define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port)
|
||||
# define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
|
||||
# define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
|
||||
# define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
|
||||
# define BIO_get_conn_int_port(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)
|
||||
|
||||
# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
|
||||
|
||||
/* BIO_s_accept() */
|
||||
# define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)
|
||||
# define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)
|
||||
/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
|
||||
# define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?(void *)"a":NULL)
|
||||
# define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio)
|
||||
|
||||
# define BIO_BIND_NORMAL 0
|
||||
# define BIO_BIND_REUSEADDR_IF_UNUSED 1
|
||||
# define BIO_BIND_REUSEADDR 2
|
||||
# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
|
||||
# define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
|
||||
|
||||
/* BIO_s_accept() and BIO_s_connect() */
|
||||
# define BIO_do_connect(b) BIO_do_handshake(b)
|
||||
# define BIO_do_accept(b) BIO_do_handshake(b)
|
||||
# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
|
||||
|
||||
/* BIO_s_proxy_client() */
|
||||
# define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url))
|
||||
# define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p))
|
||||
/* BIO_set_nbio(b,n) */
|
||||
# define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s))
|
||||
/* BIO *BIO_get_filter_bio(BIO *bio); */
|
||||
# define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)()))
|
||||
# define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk)
|
||||
# define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool)
|
||||
|
||||
# define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char *)skp)
|
||||
# define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p))
|
||||
# define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url))
|
||||
# define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL)
|
||||
|
||||
/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */
|
||||
# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
|
||||
# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
|
||||
|
||||
/* BIO_s_file() */
|
||||
# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp)
|
||||
# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp)
|
||||
|
||||
/* BIO_s_fd() and BIO_s_file() */
|
||||
# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
|
||||
# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
|
||||
|
||||
/*
|
||||
* name is cast to lose const, but might be better to route through a
|
||||
* function so we can do it safely
|
||||
*/
|
||||
# ifdef CONST_STRICT
|
||||
/*
|
||||
* If you are wondering why this isn't defined, its because CONST_STRICT is
|
||||
* purely a compile-time kludge to allow const to be checked.
|
||||
*/
|
||||
int BIO_read_filename(BIO *b, const char *name);
|
||||
# else
|
||||
# define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
||||
BIO_CLOSE|BIO_FP_READ,(char *)name)
|
||||
# endif
|
||||
# define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
||||
BIO_CLOSE|BIO_FP_WRITE,name)
|
||||
# define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
||||
BIO_CLOSE|BIO_FP_APPEND,name)
|
||||
# define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
|
||||
BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)
|
||||
|
||||
/*
|
||||
* WARNING WARNING, this ups the reference count on the read bio of the SSL
|
||||
* structure. This is because the ssl read BIO is now pointed to by the
|
||||
* next_bio field in the bio. So when you free the BIO, make sure you are
|
||||
* doing a BIO_free_all() to catch the underlying BIO.
|
||||
*/
|
||||
# define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl)
|
||||
# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)
|
||||
# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
|
||||
# define BIO_set_ssl_renegotiate_bytes(b,num) \
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL)
|
||||
# define BIO_get_num_renegotiates(b) \
|
||||
BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL)
|
||||
# define BIO_set_ssl_renegotiate_timeout(b,seconds) \
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL)
|
||||
|
||||
/* defined in evp.h */
|
||||
/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */
|
||||
|
||||
# define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
|
||||
# define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm)
|
||||
# define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp)
|
||||
# define BIO_set_mem_eof_return(b,v) \
|
||||
BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
|
||||
|
||||
/* For the BIO_f_buffer() type */
|
||||
# define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
|
||||
# define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
|
||||
# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)
|
||||
# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)
|
||||
# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
|
||||
|
||||
/* Don't use the next one unless you know what you are doing :-) */
|
||||
# define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret))
|
||||
|
||||
# define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)
|
||||
# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)
|
||||
# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)
|
||||
# define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)
|
||||
# define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
|
||||
# define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)
|
||||
/* ...pending macros have inappropriate return type */
|
||||
size_t BIO_ctrl_pending(BIO *b);
|
||||
size_t BIO_ctrl_wpending(BIO *b);
|
||||
# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
|
||||
# define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \
|
||||
cbp)
|
||||
# define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)
|
||||
|
||||
/* For the BIO_f_buffer() type */
|
||||
# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)
|
||||
|
||||
/* For BIO_s_bio() */
|
||||
# define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)
|
||||
# define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)
|
||||
# define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)
|
||||
# define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)
|
||||
# define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)
|
||||
/* macros with inappropriate type -- but ...pending macros use int too: */
|
||||
# define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)
|
||||
# define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)
|
||||
size_t BIO_ctrl_get_write_guarantee(BIO *b);
|
||||
size_t BIO_ctrl_get_read_request(BIO *b);
|
||||
int BIO_ctrl_reset_read_request(BIO *b);
|
||||
|
||||
/* ctrl macros for dgram */
|
||||
# define BIO_ctrl_dgram_connect(b,peer) \
|
||||
(int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)peer)
|
||||
# define BIO_ctrl_set_connected(b, state, peer) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, (char *)peer)
|
||||
# define BIO_dgram_recv_timedout(b) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL)
|
||||
# define BIO_dgram_send_timedout(b) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL)
|
||||
# define BIO_dgram_get_peer(b,peer) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer)
|
||||
# define BIO_dgram_set_peer(b,peer) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer)
|
||||
# define BIO_dgram_get_mtu_overhead(b) \
|
||||
(unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)
|
||||
|
||||
/* These two aren't currently implemented */
|
||||
/* int BIO_get_ex_num(BIO *bio); */
|
||||
/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */
|
||||
int BIO_set_ex_data(BIO *bio, int idx, void *data);
|
||||
void *BIO_get_ex_data(BIO *bio, int idx);
|
||||
int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
|
||||
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
|
||||
unsigned long BIO_number_read(BIO *bio);
|
||||
unsigned long BIO_number_written(BIO *bio);
|
||||
|
||||
/* For BIO_f_asn1() */
|
||||
int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix,
|
||||
asn1_ps_func *prefix_free);
|
||||
int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix,
|
||||
asn1_ps_func **pprefix_free);
|
||||
int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
|
||||
asn1_ps_func *suffix_free);
|
||||
int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
|
||||
asn1_ps_func **psuffix_free);
|
||||
|
||||
# ifndef OPENSSL_NO_FP_API
|
||||
BIO_METHOD *BIO_s_file(void);
|
||||
BIO *BIO_new_file(const char *filename, const char *mode);
|
||||
BIO *BIO_new_fp(FILE *stream, int close_flag);
|
||||
# define BIO_s_file_internal BIO_s_file
|
||||
# endif
|
||||
BIO *BIO_new(BIO_METHOD *type);
|
||||
int BIO_set(BIO *a, BIO_METHOD *type);
|
||||
int BIO_free(BIO *a);
|
||||
void BIO_vfree(BIO *a);
|
||||
int BIO_read(BIO *b, void *data, int len);
|
||||
int BIO_gets(BIO *bp, char *buf, int size);
|
||||
int BIO_write(BIO *b, const void *data, int len);
|
||||
int BIO_puts(BIO *bp, const char *buf);
|
||||
int BIO_indent(BIO *b, int indent, int max);
|
||||
long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
|
||||
long BIO_callback_ctrl(BIO *b, int cmd,
|
||||
void (*fp) (struct bio_st *, int, const char *, int,
|
||||
long, long));
|
||||
char *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
|
||||
long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
|
||||
BIO *BIO_push(BIO *b, BIO *append);
|
||||
BIO *BIO_pop(BIO *b);
|
||||
void BIO_free_all(BIO *a);
|
||||
BIO *BIO_find_type(BIO *b, int bio_type);
|
||||
BIO *BIO_next(BIO *b);
|
||||
BIO *BIO_get_retry_BIO(BIO *bio, int *reason);
|
||||
int BIO_get_retry_reason(BIO *bio);
|
||||
BIO *BIO_dup_chain(BIO *in);
|
||||
|
||||
int BIO_nread0(BIO *bio, char **buf);
|
||||
int BIO_nread(BIO *bio, char **buf, int num);
|
||||
int BIO_nwrite0(BIO *bio, char **buf);
|
||||
int BIO_nwrite(BIO *bio, char **buf, int num);
|
||||
|
||||
long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,
|
||||
long argl, long ret);
|
||||
|
||||
BIO_METHOD *BIO_s_mem(void);
|
||||
BIO *BIO_new_mem_buf(const void *buf, int len);
|
||||
BIO_METHOD *BIO_s_socket(void);
|
||||
BIO_METHOD *BIO_s_connect(void);
|
||||
BIO_METHOD *BIO_s_accept(void);
|
||||
BIO_METHOD *BIO_s_fd(void);
|
||||
# ifndef OPENSSL_SYS_OS2
|
||||
BIO_METHOD *BIO_s_log(void);
|
||||
# endif
|
||||
BIO_METHOD *BIO_s_bio(void);
|
||||
BIO_METHOD *BIO_s_null(void);
|
||||
BIO_METHOD *BIO_f_null(void);
|
||||
BIO_METHOD *BIO_f_buffer(void);
|
||||
# ifdef OPENSSL_SYS_VMS
|
||||
BIO_METHOD *BIO_f_linebuffer(void);
|
||||
# endif
|
||||
BIO_METHOD *BIO_f_nbio_test(void);
|
||||
# ifndef OPENSSL_NO_DGRAM
|
||||
BIO_METHOD *BIO_s_datagram(void);
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
BIO_METHOD *BIO_s_datagram_sctp(void);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* BIO_METHOD *BIO_f_ber(void); */
|
||||
|
||||
int BIO_sock_should_retry(int i);
|
||||
int BIO_sock_non_fatal_error(int error);
|
||||
int BIO_dgram_non_fatal_error(int error);
|
||||
|
||||
int BIO_fd_should_retry(int i);
|
||||
int BIO_fd_non_fatal_error(int error);
|
||||
int BIO_dump_cb(int (*cb) (const void *data, size_t len, void *u),
|
||||
void *u, const char *s, int len);
|
||||
int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
|
||||
void *u, const char *s, int len, int indent);
|
||||
int BIO_dump(BIO *b, const char *bytes, int len);
|
||||
int BIO_dump_indent(BIO *b, const char *bytes, int len, int indent);
|
||||
# ifndef OPENSSL_NO_FP_API
|
||||
int BIO_dump_fp(FILE *fp, const char *s, int len);
|
||||
int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent);
|
||||
# endif
|
||||
int BIO_hex_string(BIO *out, int indent, int width, unsigned char *data,
|
||||
int datalen);
|
||||
|
||||
struct hostent *BIO_gethostbyname(const char *name);
|
||||
/*-
|
||||
* We might want a thread-safe interface too:
|
||||
* struct hostent *BIO_gethostbyname_r(const char *name,
|
||||
* struct hostent *result, void *buffer, size_t buflen);
|
||||
* or something similar (caller allocates a struct hostent,
|
||||
* pointed to by "result", and additional buffer space for the various
|
||||
* substructures; if the buffer does not suffice, NULL is returned
|
||||
* and an appropriate error code is set).
|
||||
*/
|
||||
int BIO_sock_error(int sock);
|
||||
int BIO_socket_ioctl(int fd, long type, void *arg);
|
||||
int BIO_socket_nbio(int fd, int mode);
|
||||
int BIO_get_port(const char *str, unsigned short *port_ptr);
|
||||
int BIO_get_host_ip(const char *str, unsigned char *ip);
|
||||
int BIO_get_accept_socket(char *host_port, int mode);
|
||||
int BIO_accept(int sock, char **ip_port);
|
||||
int BIO_sock_init(void);
|
||||
void BIO_sock_cleanup(void);
|
||||
int BIO_set_tcp_ndelay(int sock, int turn_on);
|
||||
|
||||
BIO *BIO_new_socket(int sock, int close_flag);
|
||||
BIO *BIO_new_dgram(int fd, int close_flag);
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
BIO *BIO_new_dgram_sctp(int fd, int close_flag);
|
||||
int BIO_dgram_is_sctp(BIO *bio);
|
||||
int BIO_dgram_sctp_notification_cb(BIO *b,
|
||||
void (*handle_notifications) (BIO *bio,
|
||||
void
|
||||
*context,
|
||||
void *buf),
|
||||
void *context);
|
||||
int BIO_dgram_sctp_wait_for_dry(BIO *b);
|
||||
int BIO_dgram_sctp_msg_waiting(BIO *b);
|
||||
# endif
|
||||
BIO *BIO_new_fd(int fd, int close_flag);
|
||||
BIO *BIO_new_connect(const char *host_port);
|
||||
BIO *BIO_new_accept(const char *host_port);
|
||||
|
||||
int BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
|
||||
BIO **bio2, size_t writebuf2);
|
||||
/*
|
||||
* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.
|
||||
* Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default
|
||||
* value.
|
||||
*/
|
||||
|
||||
void BIO_copy_next_retry(BIO *b);
|
||||
|
||||
/*
|
||||
* long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);
|
||||
*/
|
||||
|
||||
# ifdef __GNUC__
|
||||
# define __bio_h__attr__ __attribute__
|
||||
# else
|
||||
# define __bio_h__attr__(x)
|
||||
# endif
|
||||
int BIO_printf(BIO *bio, const char *format, ...)
|
||||
__bio_h__attr__((__format__(__printf__, 2, 3)));
|
||||
int BIO_vprintf(BIO *bio, const char *format, va_list args)
|
||||
__bio_h__attr__((__format__(__printf__, 2, 0)));
|
||||
int BIO_snprintf(char *buf, size_t n, const char *format, ...)
|
||||
__bio_h__attr__((__format__(__printf__, 3, 4)));
|
||||
int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
|
||||
__bio_h__attr__((__format__(__printf__, 3, 0)));
|
||||
# undef __bio_h__attr__
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/*
|
||||
* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_BIO_strings(void);
|
||||
|
||||
/* Error codes for the BIO functions. */
|
||||
|
||||
/* Function codes. */
|
||||
# define BIO_F_ACPT_STATE 100
|
||||
# define BIO_F_BIO_ACCEPT 101
|
||||
# define BIO_F_BIO_BER_GET_HEADER 102
|
||||
# define BIO_F_BIO_CALLBACK_CTRL 131
|
||||
# define BIO_F_BIO_CTRL 103
|
||||
# define BIO_F_BIO_GETHOSTBYNAME 120
|
||||
# define BIO_F_BIO_GETS 104
|
||||
# define BIO_F_BIO_GET_ACCEPT_SOCKET 105
|
||||
# define BIO_F_BIO_GET_HOST_IP 106
|
||||
# define BIO_F_BIO_GET_PORT 107
|
||||
# define BIO_F_BIO_MAKE_PAIR 121
|
||||
# define BIO_F_BIO_NEW 108
|
||||
# define BIO_F_BIO_NEW_FILE 109
|
||||
# define BIO_F_BIO_NEW_MEM_BUF 126
|
||||
# define BIO_F_BIO_NREAD 123
|
||||
# define BIO_F_BIO_NREAD0 124
|
||||
# define BIO_F_BIO_NWRITE 125
|
||||
# define BIO_F_BIO_NWRITE0 122
|
||||
# define BIO_F_BIO_PUTS 110
|
||||
# define BIO_F_BIO_READ 111
|
||||
# define BIO_F_BIO_SOCK_INIT 112
|
||||
# define BIO_F_BIO_WRITE 113
|
||||
# define BIO_F_BUFFER_CTRL 114
|
||||
# define BIO_F_CONN_CTRL 127
|
||||
# define BIO_F_CONN_STATE 115
|
||||
# define BIO_F_DGRAM_SCTP_READ 132
|
||||
# define BIO_F_DGRAM_SCTP_WRITE 133
|
||||
# define BIO_F_FILE_CTRL 116
|
||||
# define BIO_F_FILE_READ 130
|
||||
# define BIO_F_LINEBUFFER_CTRL 129
|
||||
# define BIO_F_MEM_READ 128
|
||||
# define BIO_F_MEM_WRITE 117
|
||||
# define BIO_F_SSL_NEW 118
|
||||
# define BIO_F_WSASTARTUP 119
|
||||
|
||||
/* Reason codes. */
|
||||
# define BIO_R_ACCEPT_ERROR 100
|
||||
# define BIO_R_BAD_FOPEN_MODE 101
|
||||
# define BIO_R_BAD_HOSTNAME_LOOKUP 102
|
||||
# define BIO_R_BROKEN_PIPE 124
|
||||
# define BIO_R_CONNECT_ERROR 103
|
||||
# define BIO_R_EOF_ON_MEMORY_BIO 127
|
||||
# define BIO_R_ERROR_SETTING_NBIO 104
|
||||
# define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105
|
||||
# define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106
|
||||
# define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
|
||||
# define BIO_R_INVALID_ARGUMENT 125
|
||||
# define BIO_R_INVALID_IP_ADDRESS 108
|
||||
# define BIO_R_IN_USE 123
|
||||
# define BIO_R_KEEPALIVE 109
|
||||
# define BIO_R_NBIO_CONNECT_ERROR 110
|
||||
# define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111
|
||||
# define BIO_R_NO_HOSTNAME_SPECIFIED 112
|
||||
# define BIO_R_NO_PORT_DEFINED 113
|
||||
# define BIO_R_NO_PORT_SPECIFIED 114
|
||||
# define BIO_R_NO_SUCH_FILE 128
|
||||
# define BIO_R_NULL_PARAMETER 115
|
||||
# define BIO_R_TAG_MISMATCH 116
|
||||
# define BIO_R_UNABLE_TO_BIND_SOCKET 117
|
||||
# define BIO_R_UNABLE_TO_CREATE_SOCKET 118
|
||||
# define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
|
||||
# define BIO_R_UNINITIALIZED 120
|
||||
# define BIO_R_UNSUPPORTED_METHOD 121
|
||||
# define BIO_R_WRITE_TO_READ_ONLY_BIO 126
|
||||
# define BIO_R_WSASTARTUP 122
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -1,130 +0,0 @@
|
|||
/* crypto/bf/blowfish.h */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef HEADER_BLOWFISH_H
|
||||
# define HEADER_BLOWFISH_H
|
||||
|
||||
# include <openssl/e_os2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifdef OPENSSL_NO_BF
|
||||
# error BF is disabled.
|
||||
# endif
|
||||
|
||||
# define BF_ENCRYPT 1
|
||||
# define BF_DECRYPT 0
|
||||
|
||||
/*-
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
* ! BF_LONG has to be at least 32 bits wide. If it's wider, then !
|
||||
* ! BF_LONG_LOG2 has to be defined along. !
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*/
|
||||
|
||||
# if defined(__LP32__)
|
||||
# define BF_LONG unsigned long
|
||||
# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
|
||||
# define BF_LONG unsigned long
|
||||
# define BF_LONG_LOG2 3
|
||||
/*
|
||||
* _CRAY note. I could declare short, but I have no idea what impact
|
||||
* does it have on performance on none-T3E machines. I could declare
|
||||
* int, but at least on C90 sizeof(int) can be chosen at compile time.
|
||||
* So I've chosen long...
|
||||
* <appro@fy.chalmers.se>
|
||||
*/
|
||||
# else
|
||||
# define BF_LONG unsigned int
|
||||
# endif
|
||||
|
||||
# define BF_ROUNDS 16
|
||||
# define BF_BLOCK 8
|
||||
|
||||
typedef struct bf_key_st {
|
||||
BF_LONG P[BF_ROUNDS + 2];
|
||||
BF_LONG S[4 * 256];
|
||||
} BF_KEY;
|
||||
|
||||
# ifdef OPENSSL_FIPS
|
||||
void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data);
|
||||
# endif
|
||||
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
|
||||
|
||||
void BF_encrypt(BF_LONG *data, const BF_KEY *key);
|
||||
void BF_decrypt(BF_LONG *data, const BF_KEY *key);
|
||||
|
||||
void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const BF_KEY *key, int enc);
|
||||
void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
|
||||
const BF_KEY *schedule, unsigned char *ivec, int enc);
|
||||
void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, const BF_KEY *schedule,
|
||||
unsigned char *ivec, int *num, int enc);
|
||||
void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, const BF_KEY *schedule,
|
||||
unsigned char *ivec, int *num);
|
||||
const char *BF_options(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue