diff --git a/CMakeLists.txt b/CMakeLists.txt index ef85176c..a6a7554b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ -cmake_minimum_required (VERSION 2.8.8) +cmake_minimum_required (VERSION 3.0) include(CheckFunctionExists) +include(CheckSymbolExists) include(CheckLibraryExists) include(CheckIncludeFiles) include(CheckTypeSize) @@ -8,7 +9,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH}) include(cmake_export_symbol) include(GNUInstallDirs) -project (LibreSSL C) +project (LibreSSL C ASM) enable_testing() @@ -28,10 +29,11 @@ string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) option(LIBRESSL_SKIP_INSTALL "Skip installation" ${LIBRESSL_SKIP_INSTALL}) +option(LIBRESSL_APPS "Build apps" ON) +option(LIBRESSL_TESTS "Build tests" ON) option(ENABLE_ASM "Enable assembly" ON) option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF) option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF) -option(ENABLE_VSTEST "Enable test on Visual Studio" OFF) set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE) if(NOT LIBRESSL_SKIP_INSTALL) @@ -47,6 +49,7 @@ endif() if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") add_definitions(-DHAVE_ATTRIBUTE__BOUNDED__) + add_definitions(-DHAVE_ATTRIBUTE__DEAD__) endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") @@ -54,32 +57,37 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") add_definitions(-D_BSD_SOURCE) add_definitions(-D_POSIX_SOURCE) add_definitions(-D_GNU_SOURCE) + set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) endif() -if(CMAKE_SYSTEM_NAME MATCHES "MINGW") +if(WIN32 OR (CMAKE_SYSTEM_NAME MATCHES "MINGW")) set(BUILD_NC false) + add_definitions(-D_GNU_SOURCE) + add_definitions(-D_POSIX) + add_definitions(-D_POSIX_SOURCE) + add_definitions(-D__USE_MINGW_ANSI_STDIO) endif() -if(WIN32) - set(BUILD_NC false) -endif() +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wall") if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") if(CMAKE_C_COMPILER MATCHES "gcc") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -fno-strict-aliasing") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fno-strict-aliasing") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlp64") else() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 +DD64 +Otype_safety=off") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} +DD64 +Otype_safety=off") endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT") + set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) endif() if(CMAKE_SYSTEM_NAME MATCHES "SunOS") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -fno-strict-aliasing") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fno-strict-aliasing") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBSD_COMP") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic -m64") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic") + set(PLATFORM_LIBS ${PLATFORM_LIBS} nsl socket) endif() add_definitions(-DLIBRESSL_INTERNAL) @@ -98,8 +106,9 @@ if(WIN32) add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS) add_definitions(-D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS) - add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0501) + add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600) add_definitions(-DCPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG -DNO_CRYPT) + set(PLATFORM_LIBS ${PLATFORM_LIBS} ws2_32) endif() if(MSVC) @@ -154,11 +163,6 @@ if(HAVE_ASPRINTF) add_definitions(-DHAVE_ASPRINTF) endif() -check_function_exists(inet_pton HAVE_INET_PTON) -if(HAVE_INET_PTON) - add_definitions(-DHAVE_INET_PTON) -endif() - check_function_exists(reallocarray HAVE_REALLOCARRAY) if(HAVE_REALLOCARRAY) add_definitions(-DHAVE_REALLOCARRAY) @@ -229,11 +233,31 @@ if(HAVE_GETENTROPY) add_definitions(-DHAVE_GETENTROPY) endif() -check_function_exists(getpagesize HAVE_GETPAGESIZE) +check_symbol_exists(getpagesize unistd.h HAVE_GETPAGESIZE) if(HAVE_GETPAGESIZE) add_definitions(-DHAVE_GETPAGESIZE) endif() +check_function_exists(getprogname HAVE_GETPROGNAME) +if(HAVE_GETPROGNAME) + add_definitions(-DHAVE_GETPROGNAME) +endif() + +check_function_exists(syslog_r HAVE_SYSLOG_R) +if(HAVE_SYSLOG_R) + add_definitions(-DHAVE_SYSLOG_R) +endif() + +check_function_exists(syslog HAVE_SYSLOG) +if(HAVE_SYSLOG) + add_definitions(-DHAVE_SYSLOG) +endif() + +check_symbol_exists(timespecsub sys/time.h HAVE_TIMESPECSUB) +if(HAVE_TIMESPECSUB) + add_definitions(-DHAVE_TIMESPECSUB) +endif() + check_function_exists(timingsafe_bcmp HAVE_TIMINGSAFE_BCMP) if(HAVE_TIMINGSAFE_BCMP) add_definitions(-DHAVE_TIMINGSAFE_BCMP) @@ -258,46 +282,36 @@ if(ENABLE_ASM) if("${CMAKE_C_COMPILER_ABI}" STREQUAL "ELF") if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86_64|amd64)") set(HOST_ASM_ELF_X86_64 true) + elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm") + set(HOST_ASM_ELF_ARMV4 true) elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386") set(HOST_ASM_ELF_X86_64 true) endif() elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") set(HOST_ASM_MACOSX_X86_64 true) + elseif(MSVC AND "${CMAKE_GENERATOR}" MATCHES "Win64" AND FALSE) + # XXX Disabled for now, CMake's MASM support seems to either never + # build supply ASM or build it with the C compiler in a mode where it + # does not parse correctly. It might be easier to get NASM support working. + set(HOST_ASM_MASM_X86_64 true) + ENABLE_LANGUAGE(ASM_MASM) + elseif(CMAKE_SYSTEM_NAME MATCHES "MINGW" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + set(HOST_ASM_MINGW64_X86_64 true) endif() endif() -if(NOT (CMAKE_SYSTEM_NAME MATCHES "(Darwin|CYGWIN)")) - set(BUILD_SHARED true) -endif() - -# USE_SHARED builds applications (e.g. openssl) using shared LibreSSL. -# By default, applications use LibreSSL static library to avoid dependencies. -# USE_SHARED isn't set by default; use -DUSE_SHARED=ON with CMake to enable. -# Can be helpful for debugging; don't use for public releases. -if(NOT BUILD_SHARED) - set(USE_SHARED off) -endif() - -if(USE_SHARED) - set(OPENSSL_LIBS tls-shared ssl-shared crypto-shared) -else() - set(OPENSSL_LIBS tls ssl crypto) -endif() - -if(CMAKE_HOST_WIN32) - set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32) -endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") + # Check if we need -lrt to get clock_gettime on Linux check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) if (HAVE_CLOCK_GETTIME) - set(OPENSSL_LIBS ${OPENSSL_LIBS} rt) + set(PLATFORM_LIBS ${PLATFORM_LIBS} rt) endif() +else() + # Otherwise, simply check if it exists + check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) endif() -if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") - set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread) -endif() -if(CMAKE_SYSTEM_NAME MATCHES "SunOS") - set(OPENSSL_LIBS ${OPENSSL_LIBS} nsl socket) +if(HAVE_CLOCK_GETTIME) + add_definitions(-DHAVE_CLOCK_GETTIME) endif() check_type_size(time_t SIZEOF_TIME_T) @@ -309,15 +323,20 @@ if(SIZEOF_TIME_T STREQUAL "4") endif() add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) +set(OPENSSL_LIBS tls ssl crypto ${PLATFORM_LIBS}) + add_subdirectory(crypto) add_subdirectory(ssl) -add_subdirectory(apps) +if(LIBRESSL_APPS) + add_subdirectory(apps) +endif() add_subdirectory(tls) add_subdirectory(include) if(NOT MSVC) add_subdirectory(man) endif() -if(NOT MSVC OR ENABLE_VSTEST) +# Tests require the openssl executable and are unavailable when building shared libraries +if(LIBRESSL_APPS AND LIBRESSL_TESTS) add_subdirectory(tests) endif() @@ -327,6 +346,7 @@ if(NOT MSVC) set(exec_prefix \${prefix}) set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR}) set(includedir \${prefix}/include) + string(REGEX REPLACE ";" " -l" PLATFORM_LDADD ";${PLATFORM_LIBS}") file(STRINGS "VERSION" VERSION LIMIT_COUNT 1) file(GLOB OPENSSL_PKGCONFIGS "*.pc.in") foreach(file ${OPENSSL_PKGCONFIGS}) diff --git a/ChangeLog b/ChangeLog index af40a787..93fbb544 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,7 +28,213 @@ history is also available from Git. LibreSSL Portable Release Notes: -2.6.5 - Security fixes +2.9.2 - Bug fixes + + * Fixed portable builds with older versions of MacOS, + Android targets < API 21, and Solaris 10 + + * Fixed SRTP profile advertisement for DTLS servers. + +2.9.1 - Stable release + + * Added support for XChaCha20 and XChaCha20-Poly1305. + + * Added support for AES key wrap constructions via the EVP interface. + + * Partial port of the OpenSSL EC_KEY_METHOD API for use by OpenSSH. + + * Added pbkdf2 key derivation support to openssl(1) + + * Removed SHA224 based handshake signatures from consideration for use in a TLS 1.2 handshake. + + * Changed the default digest type of openssl(1) enc to to sha256. + + * Changed the default digest type of openssl(1) dgst to sha256. + + * Changed the default digest type of openssl(1) x509 -fingerprint to sha256. + + * Changed the default digest type of openssl(1) crl -fingerprint to sha256. + + * Improved Windows, Android, and ARM compatibility, including assembly + optimizations on Mingw-w64 targets. + +2.9.0 - Development release + + * Added the SM4 block cipher from the Chinese standard GB/T 32907-2016. + + * Fixed warnings about clock_gettime on Windows Visual Studio builds. + + * Fixed CMake builds on systems where getpagesize is defined as an + inline function. + + * CRYPTO_LOCK is now automatically initialized, with the legacy + callbacks stubbed for compatibility. + + * Added the SM3 hash function from the Chinese standard GB/T 32905-2016. + + * Added more OPENSSL_NO_* macros for compatibility with OpenSSL. + + * Added extensive interoperability tests between LibreSSL and OpenSSL + 1.0 and 1.1. + + * Added additional Wycheproof tests and related bug fixes. + + * Simplified sigalgs option processing and handshake signing algorithm + + * Added the ability to use the RSA PSS algorithm for handshake + signatures. + + * Added bn_rand_interval() and use it in code needing ranges of random + bn values. + + * Added functionality to derive early, handshake, and application + secrets as per RFC8446. + + * Added handshake state machine from RFC8446. + + * Removed some ASN.1 related code from libcrypto that had not been used + since around 2000. + + * Unexported internal symbols and internalized more record layer structs. + + * Added support for assembly optimizations on 32-bit ARM ELF targets. + + * Improved protection against timing side channels in ECDSA signature + generation. + + * Coordinate blinding was added to some elliptic curves. This is the + last bit of the work by Brumley et al. to protect against the + Portsmash vulnerability. + + * Ensure transcript handshake is always freed with TLS 1.2. + +2.8.2 - Stable release + + * Added Wycheproof support for ECDH and ECDSA Web Crypto test vectors, + along with test harness fixes. + + * Fixed memory leak in nc(1) + +2.8.1 - Test and compatibility improvements + + * Added Wycheproof support for ECDH, RSASSA-PSS, AES-GCM, + AES-CMAC, AES-CCM, AES-CBC-PKCS5, DSA, ChaCha20-Poly1305, ECDSA, and + X25519 test vectors. Applied appropriate fixes for errors uncovered + by tests. + + * Simplified key exchange signature generation and verification. + + * Fixed a one-byte buffer overrun in callers of EVP_read_pw_string + + * Converted more code paths to use CBB/CBS. All handshake messages are + now created by CBB. + + * Fixed various memory leaks found by Coverity. + + * Simplified session ticket parsing and handling, inspired by + BoringSSL. + + * Modified signature of CRYPTO_mem_leaks_* to return -1. This function + is a no-op in LibreSSL, so this function returns an error to not + indicate the (non-)existence of memory leaks. + + * SSL_copy_session_id, PEM_Sign, EVP_EncodeUpdate, BIO_set_cipher, + X509_OBJECT_up_ref_count now return an int for error handling, + matching OpenSSL. + + * Converted a number of #defines into proper functions, matching + OpenSSL's ABI. + + * Added X509_get0_serialNumber from OpenSSL. + + * Removed EVP_PKEY2PKCS8_broken and PKCS8_set_broken, while adding + PKCS8_pkey_add1_attr_by_NID and PKCS8_pkey_get0_attrs, matching + OpenSSL. + + * Removed broken pkcs8 formats from openssl(1). + + * Converted more functions in public API to use const arguments. + + * Stopped handing AES-GCM in ssl_cipher_get_evp, since they use the + EVP_AEAD interface. + + * Stopped using composite EVP_CIPHER AEADs. + + * Added timing-safe compares for checking results of signature + verification. There are no known attacks, this is just inexpensive + prudence. + + * Correctly clear the current cipher state, when changing cipher state. + This fixed an issue where renegotiation of cipher suites would fail + when switched from AEAD to non-AEAD or vice-versa. + Issue reported by Bernard Spil. + + * Added more cipher tests to appstest.sh, including all TLSv1.2 + ciphers. + + * Added RSA_meth_get_finish() RSA_meth_set1_name() from OpenSSL. + + * Added new EVP_CIPHER_CTX_(get|set)_iv() API that allows the IV to be + retrieved and set with appropriate validation. + +2.8.0 - Bug fixes, security, and compatibility improvements + + * Extensive documentation updates and additional API history. + + * Fixed a pair of 20+ year-old bugs in X509_NAME_add_entry + + * Tighten up checks for various X509_VERIFY_PARAM functions, + 'poisoning' parameters so that an unverified certificate cannot be + used if it fails verification. + + * Fixed a potential memory leak on failure in ASN1_item_digest + + * Fixed a potential memory alignment crash in asn1_item_combine_free + + * Removed unused SSL3_FLAGS_DELAY_CLIENT_FINISHED and + SSL3_FLAGS_POP_BUFFER flags in write path, simplifying IO paths. + + * Removed SSL_OP_TLS_ROLLBACK_BUG buggy client workarounds. + + * Made ENGINE_finish and ENGINE_free succeed on NULL and simplify callers + and matching OpenSSL behavior, rewrote ENGINE_* documentation. + + * Added const annotations to many existing APIs from OpenSSL, making + interoperability easier for downstream applications. + + * Fixed small timing side-channels in ecdsa_sign_setup and + dsa_sign_setup. + + * Documented security pitfalls with BN_FLG_CONSTTIME and constant-time + operation of BN_* functions. + + * Updated BN_clear to use explicit_bzero. + + * Added a missing bounds check in c2i_ASN1_BIT_STRING. + + * More CBS conversions, including simplifications to RSA key exchange, + and converted code to use dedicated buffers for secrets. + + * Removed three remaining single DES cipher suites. + + * Fixed a potential leak/incorrect return value in DSA signature + generation. + + * Added a blinding value when generating DSA and ECDSA signatures, in + order to reduce the possibility of a side-channel attack leaking the + private key. + + * Added ECC constant time scalar multiplication support. + From Billy Brumley and his team at Tampere University of Technology. + + * Revised the implementation of RSASSA-PKCS1-v1_5 to match the + specification in RFC 8017. Based on an OpenSSL commit by David + Benjamin. + + * Cleaned up BN_* implementations following changes made in OpenSSL by + Davide Galassi and others. + +2.7.4 - Security fixes * Avoid a timing side-channel leak when generating DSA and ECDSA signatures. This is caused by an attempt to do fast modular @@ -41,6 +247,80 @@ LibreSSL Portable Release Notes: (https://github.com/openssl/openssl/pull/6457) and based on his diff. +2.7.3 - Bug fixes + + * Removed incorrect NULL checks in DH_set0_key(). Reported by Ondrej + Sury + + * Fixed an issue normalizing CPU architecture in the configure script, + which disabled assembly optimizations on platforms that get detected + as 'amd64', opposed to 'x86_64' + + * Limited tls_config_clear_keys() to only clear private keys. + This was inadvertently clearing the keypair, which includes the OCSP + staple and pubkey hash - if an application called tls_configure() + followed by tls_config_clear_keys(), this would prevent OCSP staples + from working. + +2.7.2 - Stable release + + * Updated and added extensive new HISTORY sections to API manuals. + + * Added support for shared library builds with CMake on all supported + platforms. Note that some of the CMake options have changed, consult + the README for details. + +2.7.1 - Bug fixes + + * Fixed a bug in int_x509_param_set_hosts, calling strlen() if name + length provided is 0 to match the OpenSSL behaviour. Issue noticed + by Christian Heimes . + + * Fixed builds macOS 10.11 and older. + +2.7.0 - Bug fixes and improvements + + * Added support for many OpenSSL 1.0.2 and 1.1 APIs, based on + observations of real-world usage in applications. These are + implemented in parallel with existing OpenSSL 1.0.1 APIs - visibility + changes have not been made to existing structs, allowing code written + for older OpenSSL APIs to continue working. + + * Extensive corrections, improvements, and additions to the + API documentation, including new public APIs from OpenSSL that had + no pre-existing documentation. + + * Added support for automatic library initialization in libcrypto, + libssl, and libtls. Support for pthread_once or a compatible + equivalent is now required of the target operating system. As a + side-effect, minimum Windows support is Vista or higher. + + * Converted more packet handling methods to CBB, which improves + resiliency when generating TLS messages. + + * Completed TLS extension handling rewrite, improving consistency of + checks for malformed and duplicate extensions. + + * Rewrote ASN1_TYPE_{get,set}_octetstring() using templated ASN.1. + This removes the last remaining use of the old M_ASN1_* macros + (asn1_mac.h) from API that needs to continue to exist. + + * Added support for client-side session resumption in libtls. + A libtls client can specify a session file descriptor (a regular + file with appropriate ownership and permissions) and libtls will + manage reading and writing of session data across TLS handshakes. + + * Improved support for strict alignment on ARMv7 architectures, + conditionally enabling assembly in those cases. + + * Fixed a memory leak in libtls when reusing a tls_config. + + * Merged more DTLS support into the regular TLS code path, removing + duplicated code. + + * Many improvements to Windows Cmake-based builds and tests, + especially when targeting Visual Studio. + 2.6.4 - Bug fixes * Make tls_config_parse_protocols() work correctly when passed a NULL @@ -858,7 +1138,7 @@ LibreSSL Portable Release Notes: * Removed nonfunctional Netscape browser-hang workaround code. - * Simplfied and refactored SSL/DTLS handshake code. + * Simplified and refactored SSL/DTLS handshake code. * Added SHA256 Camellia cipher suites for TLS 1.2 from RFC 5932. diff --git a/FindLibreSSL.cmake b/FindLibreSSL.cmake new file mode 100644 index 00000000..d87b96eb --- /dev/null +++ b/FindLibreSSL.cmake @@ -0,0 +1,225 @@ +#[=======================================================================[ + +Copyright (c) 2019 John Norrbin + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +FindLibreSSL +------------ + +Find the LibreSSL encryption library. + +Optional Components +^^^^^^^^^^^^^^^^^^^ + +This module supports two optional components: SSL and TLS. Both +components have associated imported targets, as described below. + +Imported Targets +^^^^^^^^^^^^^^^^ + +This module defines the following imported targets: + +LibreSSL::Crypto + The LibreSSL crypto library, if found. + +LibreSSL::SSL + The LibreSSL ssl library, if found. Requires and includes LibreSSL::Crypto automatically. + +LibreSSL::TLS + The LibreSSL tls library, if found. Requires and includes LibreSSL::SSL and LibreSSL::Crypto automatically. + +Result Variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables in your project: + +LIBRESSL_FOUND + System has the LibreSSL library. If no components are requested it only requires the crypto library. +LIBRESSL_INCLUDE_DIR + The LibreSSL include directory. +LIBRESSL_CRYPTO_LIBRARY + The LibreSSL crypto library. +LIBRESSL_SSL_LIBRARY + The LibreSSL SSL library. +LIBRESSL_TLS_LIBRARY + The LibreSSL TLS library. +LIBRESSL_LIBRARIES + All LibreSSL libraries. +LIBRESSL_VERSION + This is set to $major.$minor.$revision (e.g. 2.6.8). + +Hints +^^^^^ + +Set LIBRESSL_ROOT_DIR to the root directory of an LibreSSL installation. + +]=======================================================================] + +# Set Hints +set(_LIBRESSL_ROOT_HINTS + ${LIBRESSL_ROOT_DIR} + ENV LIBRESSL_ROOT_DIR +) + +# Set Paths +if (WIN32) + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) + set(_LIBRESSL_ROOT_PATHS + "${_programfiles}/LibreSSL" + ) + unset(_programfiles) +else() + set(_LIBRESSL_ROOT_PATHS + "/usr/local/" + ) +endif() + +# Combine +set(_LIBRESSL_ROOT_HINTS_AND_PATHS + HINTS ${_LIBRESSL_ROOT_HINTS} + PATHS ${_LIBRESSL_ROOT_PATHS} +) + +# Find Include Path +find_path(LIBRESSL_INCLUDE_DIR + NAMES + tls.h + ${_LIBRESSL_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES + include +) + +# Find Crypto Library +find_library(LIBRESSL_CRYPTO_LIBRARY + NAMES + libcrypto + crypto + NAMES_PER_DIR + ${_LIBRESSL_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES + lib +) + +# Find SSL Library +find_library(LIBRESSL_SSL_LIBRARY + NAMES + libssl + ssl + NAMES_PER_DIR + ${_LIBRESSL_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES + lib +) + +# Find TLS Library +find_library(LIBRESSL_TLS_LIBRARY + NAMES + libtls + tls + NAMES_PER_DIR + ${_LIBRESSL_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES + lib +) + +# Set Libraries +set(LIBRESSL_LIBRARIES ${LIBRESSL_CRYPTO_LIBRARY} ${LIBRESSL_SSL_LIBRARY} ${LIBRESSL_TLS_LIBRARY}) + +# Mark Variables As Advanced +mark_as_advanced(LIBRESSL_INCLUDE_DIR LIBRESSL_LIBRARIES LIBRESSL_CRYPTO_LIBRARY LIBRESSL_SSL_LIBRARY LIBRESSL_TLS_LIBRARY) + +# Find Version File +if(LIBRESSL_INCLUDE_DIR AND EXISTS "${LIBRESSL_INCLUDE_DIR}/openssl/opensslv.h") + + # Get Version From File + file(STRINGS "${LIBRESSL_INCLUDE_DIR}/openssl/opensslv.h" OPENSSLV.H REGEX "#define LIBRESSL_VERSION_TEXT[ ]+\".*\"") + + # Match Version String + string(REGEX REPLACE ".*\".*([0-9]+)\\.([0-9]+)\\.([0-9]+)\"" "\\1;\\2;\\3" LIBRESSL_VERSION_LIST "${OPENSSLV.H}") + + # Split Parts + list(GET LIBRESSL_VERSION_LIST 0 LIBRESSL_VERSION_MAJOR) + list(GET LIBRESSL_VERSION_LIST 1 LIBRESSL_VERSION_MINOR) + list(GET LIBRESSL_VERSION_LIST 2 LIBRESSL_VERSION_REVISION) + + # Set Version String + set(LIBRESSL_VERSION "${LIBRESSL_VERSION_MAJOR}.${LIBRESSL_VERSION_MINOR}.${LIBRESSL_VERSION_REVISION}") + +endif() + +# Set Find Package Arguments +find_package_handle_standard_args(LibreSSL + REQUIRED_VARS + LIBRESSL_CRYPTO_LIBRARY + LIBRESSL_INCLUDE_DIR + VERSION_VAR + LIBRESSL_VERSION + HANDLE_COMPONENTS + FAIL_MESSAGE + "Could NOT find LibreSSL, try setting the path to LibreSSL using the LIBRESSL_ROOT_DIR environment variable" +) + +# LibreSSL Found +if(LIBRESSL_FOUND) + + # Set LibreSSL::Crypto + if(NOT TARGET LibreSSL::Crypto AND EXISTS "${LIBRESSL_CRYPTO_LIBRARY}") + + # Add Library + add_library(LibreSSL::Crypto UNKNOWN IMPORTED) + + # Set Properties + set_target_properties( + LibreSSL::Crypto + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIBRESSL_INCLUDE_DIR}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${LIBRESSL_CRYPTO_LIBRARY}" + ) + + endif() # LibreSSL::Crypto + + # Set LibreSSL::SSL + if(NOT TARGET LibreSSL::SSL AND EXISTS "${LIBRESSL_SSL_LIBRARY}") + + # Add Library + add_library(LibreSSL::SSL UNKNOWN IMPORTED) + + # Set Properties + set_target_properties( + LibreSSL::SSL + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIBRESSL_INCLUDE_DIR}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${LIBRESSL_SSL_LIBRARY}" + INTERFACE_LINK_LIBRARIES LibreSSL::Crypto + ) + + endif() # LibreSSL::SSL + + # Set LibreSSL::TLS + if(NOT TARGET LibreSSL::TLS AND EXISTS "${LIBRESSL_TLS_LIBRARY}") + add_library(LibreSSL::TLS UNKNOWN IMPORTED) + set_target_properties( + LibreSSL::TLS + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIBRESSL_INCLUDE_DIR}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${LIBRESSL_TLS_LIBRARY}" + INTERFACE_LINK_LIBRARIES LibreSSL::SSL + ) + + endif() # LibreSSL::TLS + +endif(LIBRESSL_FOUND) diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..20998407 --- /dev/null +++ b/INSTALL @@ -0,0 +1,370 @@ +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf limitation. Until the limitation is lifted, you can use +this workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. diff --git a/Makefile.am b/Makefile.am index b4b9dfce..1cf0fc66 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcrypto.pc libssl.pc libtls.pc openssl.pc EXTRA_DIST = README.md README.windows VERSION config scripts -EXTRA_DIST += CMakeLists.txt cmake_export_symbol.cmake cmake_uninstall.cmake.in +EXTRA_DIST += CMakeLists.txt cmake_export_symbol.cmake cmake_uninstall.cmake.in FindLibreSSL.cmake .PHONY: install_sw install_sw: install diff --git a/Makefile.in b/Makefile.in index 0a0ae5be..79b36991 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -169,7 +169,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck + cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -193,8 +193,9 @@ CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libcrypto.pc.in \ $(srcdir)/libssl.pc.in $(srcdir)/libtls.pc.in \ - $(srcdir)/openssl.pc.in COPYING ChangeLog compile config.guess \ - config.sub depcomp install-sh ltmain.sh missing tap-driver.sh + $(srcdir)/openssl.pc.in COPYING ChangeLog INSTALL compile \ + config.guess config.sub depcomp install-sh ltmain.sh missing \ + tap-driver.sh DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -366,7 +367,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcrypto.pc libssl.pc libtls.pc openssl.pc EXTRA_DIST = README.md README.windows VERSION config scripts \ CMakeLists.txt cmake_export_symbol.cmake \ - cmake_uninstall.cmake.in + cmake_uninstall.cmake.in FindLibreSSL.cmake all: all-recursive .SUFFIXES: @@ -391,8 +392,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -548,7 +549,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ diff --git a/README.md b/README.md index b0e528de..2b45fc0d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,204 @@ -This repo is forked from libressl windows code published at https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/. -For any bug fixes, please follow up with core libressl team. +![LibreSSL image](https://www.libressl.org/images/libressl.jpg) +## Official portable version of [LibreSSL](https://www.libressl.org) ## + +[![Build Status](https://travis-ci.org/libressl-portable/portable.svg?branch=master)](https://travis-ci.org/libressl-portable/portable) + +LibreSSL is a fork of [OpenSSL](https://www.openssl.org) 1.0.1g developed by the +[OpenBSD](https://www.openbsd.org) project. Our goal is to modernize the codebase, +improve security, and apply best practice development processes from OpenBSD. + +## Compatibility with OpenSSL: ## + +LibreSSL is API compatible with OpenSSL 1.0.1, but does not yet include all +new APIs from OpenSSL 1.0.2 and later. LibreSSL also includes APIs not yet +present in OpenSSL. The current common API subset is OpenSSL 1.0.1. + +LibreSSL is not ABI compatible with any release of OpenSSL, or necessarily +earlier releases of LibreSSL. You will need to relink your programs to +LibreSSL in order to use it, just as in moving between major versions of OpenSSL. +LibreSSL's installed library version numbers are incremented to account for +ABI and API changes. + +## Compatibility with other operating systems: ## + +While primarily developed on and taking advantage of APIs available on OpenBSD, +the LibreSSL portable project attempts to provide working alternatives for +other operating systems, and assists with improving OS-native implementations +where possible. + +At the time of this writing, LibreSSL is know to build and work on: + +* Linux (kernel 3.17 or later recommended) +* FreeBSD (tested with 9.2 and later) +* NetBSD (7.0 or later recommended) +* HP-UX (11i) +* Solaris (11 and later preferred) +* Mac OS X (tested with 10.8 and later) +* AIX (5.3 and later) + +LibreSSL also supports the following Windows environments: +* Microsoft Windows (Vista or higher, x86 and x64) +* Wine (32-bit and 64-bit) +* Builds with Mingw-w64, Cygwin, and Visual Studio + +Official release tarballs are available at your friendly neighborhood +OpenBSD mirror in directory +[LibreSSL](https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/), +although we suggest that you use a [mirror](https://www.openbsd.org/ftp.html). + +The LibreSSL portable build framework is also +[mirrored](https://github.com/libressl-portable/portable) in Github. + +Please report bugs either to the public libressl@openbsd.org mailing list, +or to the github +[issue tracker](https://github.com/libressl-portable/portable/issues) + +Severe vulnerabilities or bugs requiring coordination with OpenSSL can be +sent to the core team at libressl-security@openbsd.org. + +# Building LibreSSL # + +## Prerequisites when building from a Git checkout ## + +If you have checked this source using Git, or have downloaded a source tarball +from Github, follow these initial steps to prepare the source tree for +building. _Note: Your build will fail if you do not follow these instructions! If you cannot follow these instructions (e.g. Windows system using CMake) or cannot meet these prerequistes, please download an official release distribution from https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ instead. Using official releases is strongly advised if you are not a developer._ + +1. Ensure you have the following packages installed: + automake, autoconf, git, libtool, perl +2. Run `./autogen.sh` to prepare the source tree for building or + run `./dist.sh` to prepare a tarball. + +## Steps that apply to all builds ## + +Once you have a source tree, either by downloaded using git and having +run the `autogen.sh` script above, or by downloading a release distribution from +an OpenBSD mirror, run these commands to build and install the package on most +systems: + +```sh +./configure # see ./configure --help for configuration options +make check # runs builtin unit tests +make install # set DESTDIR= to install to an alternate location +``` + +If you wish to use the CMake build system, use these commands: + +```sh +mkdir build +cd build +cmake .. +make +make test +``` + +For faster builds, you can use Ninja as well: + +```sh +mkdir build-ninja +cd build-ninja +cmake -G"Ninja" .. +ninja +ninja test +``` + +### OS specific build information: ### + +#### HP-UX (11i) #### + +Set the UNIX_STD environment variable to `2003` before running `configure` +in order to build with the HP C/aC++ compiler. See the "standards(5)" man +page for more details. + +```sh +export UNIX_STD=2003 +./configure +make +``` + +#### Windows - Mingw-w64 #### + +LibreSSL builds against relatively recent versions of Mingw-w64, not to be +confused with the original mingw.org project. Mingw-w64 3.2 or later +should work. See README.windows for more information + +#### Windows - Visual Studio #### + +LibreSSL builds using the CMake target "Visual Studio 12 2013" and newer. To +generate a Visual Studio project, install CMake, enter the LibreSSL source +directory and run: + +```sh + mkdir build-vs2013 + cd build-vs2013 + cmake -G"Visual Studio 12 2013" .. +``` + +Replace "Visual Studion 12 2013" with whatever version of Visual Studio you +have installed. This will generate a LibreSSL.sln file that you can incorporate +into other projects or build by itself. + +#### Cmake - Additional Options #### + +| Option Name | Default | Description +| ------------ | -----: | ------ +| LIBRESSL_SKIP_INSTALL | OFF | allows skipping install() rules. Can be specified from command line using
```-DLIBRESSL_SKIP_INSTALL=ON``` | +| LIBRESSL_APPS | ON | allows skipping application builds. Apps are required to run tests | +| LIBRESSL_TESTS | ON | allows skipping of tests. Tests are only available in static builds | +| BUILD_SHARED_LIBS | OFF | CMake option for building shared libraries. | +| ENABLE_ASM | ON | builds assembly optimized rules. | +| ENABLE_EXTRATESTS | OFF | Enable extra tests that may be unreliable on some platforms | +| ENABLE_NC | OFF | Enable installing TLS-enabled nc(1) | +| OPENSSLDIR | Blank | Set the default openssl directory. Can be specified from command line using
```-DOPENSSLDIR=``` | + +# Using LibreSSL # + +## CMake ## + +Make a new folder in your project root (where your main CMakeLists.txt file is located) called CMake. Copy the FindLibreSSL.cmake file to that folder, and add the following line to your main CMakeLists.txt: + +```cmake +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}") +``` + +After your **add_executable** or **add_library** line in your CMakeLists.txt file add the following: + +```cmake +find_package(LibreSSL REQUIRED) +``` + +It will tell CMake to find LibreSSL and if found will let you use the following 3 interfaces in your CMakeLists.txt file: + +* LibreSSL::Crypto +* LibreSSL::SSL +* LibreSSL::TLS + +If you for example want to use the LibreSSL TLS library in your test program, include it like so (SSL and Cryto are required by TLS and included automatically too): + +```cmake +target_link_libraries(test LibreSSL::TLS) +``` + +Full example: + +```cmake +cmake_minimum_required(VERSION 3.10.0) + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}") + +project(test) + +add_executable(test Main.cpp) + +find_package(LibreSSL REQUIRED) + +target_link_libraries(test LibreSSL::TLS) +``` + +#### Linux #### + +Following the guide in the sections above to compile LibreSSL using make and running "sudo make install" will install LibreSSL to the /usr/local/ folder, and will found automatically by find_package. If your system installs it to another location or you have placed them yourself in a different location, you can set the CMake variable LIBRESSL_ROOT_DIR to the correct path, to help CMake find the library. + +#### Windows #### + +Placing the library files in C:/Program Files/LibreSSL/lib and the include files in C:/Program Files/LibreSSL/include should let CMake find them automatically, but it is recommended that you use CMake-GUI to set the paths. It is more convenient as you can have the files in any folder you choose. diff --git a/VERSION b/VERSION index 85731695..29a38b0c 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -2.6.5.1 +2.9.2.1 diff --git a/aclocal.m4 b/aclocal.m4 index 6fd81db4..c5cfb8ae 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15.1], [], +m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15.1])dnl +[AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -78,7 +78,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -130,7 +130,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -161,7 +161,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -352,13 +352,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -366,49 +365,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -417,18 +408,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -515,8 +505,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -583,7 +573,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -625,7 +615,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -646,7 +636,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2017 Free Software Foundation, Inc. +# Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -667,7 +657,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -675,49 +665,42 @@ AC_SUBST([am__leading_dot])]) # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -756,7 +739,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -785,7 +768,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -832,7 +815,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -851,7 +834,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -932,7 +915,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -992,7 +975,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1020,7 +1003,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2017 Free Software Foundation, Inc. +# Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1039,7 +1022,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2017 Free Software Foundation, Inc. +# Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/apps/Makefile.in b/apps/Makefile.in index ef598689..8f0bb5cf 100644 --- a/apps/Makefile.in +++ b/apps/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -136,7 +136,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -334,8 +334,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/Makefile.am.common $(am__empty): @@ -453,7 +453,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/apps/nc/CMakeLists.txt b/apps/nc/CMakeLists.txt index 64d14fac..cc34ef3b 100644 --- a/apps/nc/CMakeLists.txt +++ b/apps/nc/CMakeLists.txt @@ -1,12 +1,5 @@ if(BUILD_NC) -include_directories( - . - ./compat - ../../include - ../../include/compat -) - set( NC_SRC atomicio.c @@ -50,6 +43,7 @@ else() endif() add_executable(nc ${NC_SRC}) +target_include_directories(nc PRIVATE . ./compat ../../include/compat) target_link_libraries(nc tls ${OPENSSL_LIBS}) if(ENABLE_NC) diff --git a/apps/nc/Makefile.in b/apps/nc/Makefile.in index cde79275..e71e7fe4 100644 --- a/apps/nc/Makefile.in +++ b/apps/nc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -154,7 +154,11 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/atomicio.Po ./$(DEPDIR)/netcat.Po \ + ./$(DEPDIR)/socks.Po compat/$(DEPDIR)/accept4.Po \ + compat/$(DEPDIR)/base64.Po compat/$(DEPDIR)/readpassphrase.Po \ + compat/$(DEPDIR)/socket.Po compat/$(DEPDIR)/strtonum.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -393,8 +397,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/Makefile.am.common $(am__empty): @@ -492,14 +496,20 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netcat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socks.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/accept4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/base64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/readpassphrase.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/socket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strtonum.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netcat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socks.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/accept4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/readpassphrase.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/socket.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -626,7 +636,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -701,7 +714,14 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) compat/$(DEPDIR) + -rm -f ./$(DEPDIR)/atomicio.Po + -rm -f ./$(DEPDIR)/netcat.Po + -rm -f ./$(DEPDIR)/socks.Po + -rm -f compat/$(DEPDIR)/accept4.Po + -rm -f compat/$(DEPDIR)/base64.Po + -rm -f compat/$(DEPDIR)/readpassphrase.Po + -rm -f compat/$(DEPDIR)/socket.Po + -rm -f compat/$(DEPDIR)/strtonum.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -747,7 +767,14 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) compat/$(DEPDIR) + -rm -f ./$(DEPDIR)/atomicio.Po + -rm -f ./$(DEPDIR)/netcat.Po + -rm -f ./$(DEPDIR)/socks.Po + -rm -f compat/$(DEPDIR)/accept4.Po + -rm -f compat/$(DEPDIR)/base64.Po + -rm -f compat/$(DEPDIR)/readpassphrase.Po + -rm -f compat/$(DEPDIR)/socket.Po + -rm -f compat/$(DEPDIR)/strtonum.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -770,7 +797,7 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ diff --git a/apps/nc/nc.1 b/apps/nc/nc.1 index bb3a8f7c..6bdfe4f9 100644 --- a/apps/nc/nc.1 +++ b/apps/nc/nc.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.87 2017/07/15 18:11:47 jmc Exp $ +.\" $OpenBSD: nc.1,v 1.93 2018/12/27 17:45:36 jmc Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 15 2017 $ +.Dd $Mdocdate: December 27 2018 $ .Dt NC 1 .Os .Sh NAME @@ -96,27 +96,31 @@ and much, much more The options are as follows: .Bl -tag -width Ds .It Fl 4 -Forces -.Nm -to use IPv4 addresses only. +Use IPv4 addresses only. .It Fl 6 -Forces -.Nm -to use IPv6 addresses only. +Use IPv6 addresses only. .It Fl C Ar certfile -Specifies the filename from which the public key part of the TLS -certificate is loaded, in PEM format. -May only be used with TLS. +Load the public key part of the TLS peer certificate from +.Ar certfile , +in PEM format. +Requires +.Fl c . .It Fl c -If using a TCP socket to connect or listen, use TLS. -Illegal if not using TCP sockets. +Use TLS to connect or listen. +Cannot be used together with any of the options +.Fl FuU . .It Fl D Enable debugging on the socket. .It Fl d Do not attempt to read from stdin. .It Fl e Ar name -Specify the name that must be present in the peer certificate when using TLS. -Illegal if not using TLS. +Only accept the TLS peer certificate if it contains the +.Ar name . +Requires +.Fl c . +If not specified, +.Ar destination +is used. .It Fl F Pass the first connected socket using .Xr sendmsg 2 @@ -132,47 +136,49 @@ using the .Xr ssh_config 5 .Cm ProxyUseFdpass option). +Cannot be used with +.Fl c +or +.Fl U . .It Fl H Ar hash -Specifies the required hash string of the peer certificate when using TLS. -The string format required is that used by -.Xr tls_peer_cert_hash 3 . -Illegal if not using TLS, and may not be used with -T noverify. +Only accept the TLS peer certificate if its hash returned from +.Xr tls_peer_cert_hash 3 +matches +.Ar hash . +Requires +.Fl c +and cannot be used with +.Fl T Cm noverify . .It Fl h -Prints out +Print out the .Nm -help. +help text and exit. .It Fl I Ar length -Specifies the size of the TCP receive buffer. +Specify the size of the TCP receive buffer. .It Fl i Ar interval -Specifies a delay time interval between lines of text sent and received. +Sleep for +.Ar interval +seconds between lines of text sent and received. Also causes a delay time between connections to multiple ports. .It Fl K Ar keyfile -Specifies the filename from which the private key -is loaded in PEM format. -May only be used with TLS. +Load the TLS private key from +.Ar keyfile , +in PEM format. +Requires +.Fl c . .It Fl k -Forces -.Nm -to stay listening for another connection after its current connection -is completed. -It is an error to use this option without the -.Fl l -option. +When a connection is completed, listen for another one. +Requires +.Fl l . When used together with the .Fl u option, the server socket is not connected and it can receive UDP datagrams from multiple hosts. .It Fl l -Used to specify that -.Nm -should listen for an incoming connection rather than initiate a +Listen for an incoming connection rather than initiating a connection to a remote host. -It is an error to use this option in conjunction with the -.Fl p , -.Fl s , -or -.Fl z -options. +Cannot be used together with any of the options +.Fl psxz . Additionally, any timeouts specified with the .Fl w option are ignored. @@ -189,92 +195,111 @@ Some servers require this to finish their work. Do not do any DNS or service lookups on any specified addresses, hostnames or ports. .It Fl O Ar length -Specifies the size of the TCP send buffer. +Specify the size of the TCP send buffer. .It Fl o Ar staplefile -Specifies the filename from which to load data to be stapled -during the TLS handshake. -The file is expected to contain an OCSP response from an OCSP server in +During the TLS handshake, load data to be stapled from +.Ar staplefile , +which is expected to contain an OCSP response from an OCSP server in DER format. -May only be used with TLS and when a certificate is being used. +Requires +.Fl c +and +.Fl C . .It Fl P Ar proxy_username Specifies a username to present to a proxy server that requires authentication. If no username is specified then authentication will not be attempted. Proxy authentication is only supported for HTTP CONNECT proxies at present. .It Fl p Ar source_port -Specifies the source port +Specify the source port .Nm should use, subject to privilege restrictions and availability. -It is an error to use this option in conjunction with the -.Fl l -option. +Cannot be used together with +.Fl l . .It Fl R Ar CAfile -Specifies the filename from which the root CA bundle for certificate -verification is loaded, in PEM format. -Illegal if not using TLS. -The default is +Load the root CA bundle for TLS certificate verification from +.Ar CAfile , +in PEM format, instead of .Pa /etc/ssl/cert.pem . +Requires +.Fl c . .It Fl r -Specifies that source and/or destination ports should be chosen randomly +Choose source and/or destination ports randomly instead of sequentially within a range or in the order that the system assigns them. .It Fl S -Enables the RFC 2385 TCP MD5 signature option. +Enable the RFC 2385 TCP MD5 signature option. .It Fl s Ar source -Specifies the IP of the interface which is used to send the packets. +Send packets from the interface with the +.Ar source +IP address. For .Ux Ns -domain datagram sockets, specifies the local temporary socket file to create and use so that datagrams can be received. -It is an error to use this option in conjunction with the +Cannot be used together with .Fl l -option. +or +.Fl x . .It Fl T Ar keyword -Change IPv4 TOS value or TLS options. -For TLS options +Change the IPv4 TOS/IPv6 traffic class value or the TLS options. +.Pp +For TLS options, .Ar keyword may be one of: -.Ar tlsall , -which allows the use of all supported TLS protocols and ciphers; -.Ar tlscompat , -which allows the use of all supported TLS protocols and "compat" ciphers; -.Ar noverify , +.Cm noverify , which disables certificate verification; -.Ar noname , +.Cm noname , which disables certificate name checking; -.Ar clientcert , +.Cm clientcert , which requires a client certificate on incoming connections; or -.Ar muststaple , +.Cm muststaple , which requires the peer to provide a valid stapled OCSP response with the handshake. -It is illegal to specify TLS options if not using TLS. -.Pp -For IPv4 TOS value +The following TLS options specify a value in the form of a +.Ar key Ns = Ns Ar value +pair: +.Cm ciphers , +which allows the supported TLS ciphers to be specified (see +.Xr tls_config_set_ciphers 3 +for further details); +.Cm protocols , +which allows the supported TLS protocols to be specified (see +.Xr tls_config_parse_protocols 3 +for further details). +Specifying TLS options requires +.Fl c . +.Pp +For the IPv4 TOS/IPv6 traffic class value, .Ar keyword may be one of -.Ar critical , -.Ar inetcontrol , -.Ar lowdelay , -.Ar netcontrol , -.Ar throughput , -.Ar reliability , +.Cm critical , +.Cm inetcontrol , +.Cm lowdelay , +.Cm netcontrol , +.Cm throughput , +.Cm reliability , or one of the DiffServ Code Points: -.Ar ef , -.Ar af11 ... af43 , -.Ar cs0 ... cs7 ; +.Cm ef , +.Cm af11 No ... Cm af43 , +.Cm cs0 No ... Cm cs7 ; or a number in either hex or decimal. .It Fl t -Causes -.Nm -to send RFC 854 DON'T and WON'T responses to RFC 854 DO and WILL requests. +Send RFC 854 DON'T and WON'T responses to RFC 854 DO and WILL requests. This makes it possible to use .Nm to script telnet sessions. .It Fl U -Specifies to use +Use .Ux Ns -domain sockets. +Cannot be used together with any of the options +.Fl cFx . .It Fl u -Use UDP instead of the default option of TCP. +Use UDP instead of TCP. +Cannot be used together with +.Fl c +or +.Fl x . For .Ux Ns -domain sockets, use a datagram socket instead of a stream socket. @@ -288,9 +313,7 @@ flag is given. .It Fl V Ar rtable Set the routing table to be used. .It Fl v -Have -.Nm -give more verbose output. +Produce more verbose output. .It Fl W Ar recvlimit Terminate after receiving .Ar recvlimit @@ -310,22 +333,20 @@ will listen forever for a connection, with or without the flag. The default is no timeout. .It Fl X Ar proxy_protocol -Requests that -.Nm -should use the specified protocol when talking to the proxy server. +Use +.Ar proxy_protocol +when talking to the proxy server. Supported protocols are -.Dq 4 +.Cm 4 (SOCKS v.4), -.Dq 5 +.Cm 5 (SOCKS v.5) and -.Dq connect +.Cm connect (HTTPS proxy). If the protocol is not specified, SOCKS version 5 is used. .It Fl x Ar proxy_address Ns Op : Ns Ar port -Requests that -.Nm -should connect to +Connect to .Ar destination using a proxy at .Ar proxy_address @@ -338,17 +359,18 @@ for SOCKS, 3128 for HTTPS). An IPv6 address can be specified unambiguously by enclosing .Ar proxy_address in square brackets. +A proxy cannot be used with any of the options +.Fl lsuU . .It Fl Z Ar peercertfile -Specifies the filename in which the peer supplied certificates will be saved +Save the peer certificates to +.Ar peercertfile , in PEM format. -May only be used with TLS. +Requires +.Fl c . .It Fl z -Specifies that -.Nm -should just scan for listening daemons, without sending any data to them. -It is an error to use this option in conjunction with the -.Fl l -option. +Only scan for listening daemons, without sending any data to them. +Cannot be used together with +.Fl l . .El .Pp .Ar destination @@ -369,8 +391,9 @@ sockets, a destination is required and is the socket path to connect to option is given). .Pp .Ar port -can be a specified as a numeric port number, or as a service name. -Ports may be specified in a range of the form nn-mm. +can be specified as a numeric port number or as a service name. +Port ranges may be specified as numeric port numbers of the form +.Ar nn Ns - Ns Ar mm . In general, a destination port must be specified, unless the @@ -497,10 +520,15 @@ the source port, with a timeout of 5 seconds: .Pp .Dl $ nc -p 31337 -w 5 host.example.com 42 .Pp +Open a TCP connection to port 443 of www.example.com, and negotiate TLS with +any supported TLS protocol version and "compat" ciphers: +.Pp +.Dl $ nc -cv -T protocols=all -T ciphers=compat www.example.com 443 +.Pp Open a TCP connection to port 443 of www.google.ca, and negotiate TLS. -Check for a different name in the certificate for validation. +Check for a different name in the certificate for validation: .Pp -.Dl $ nc -v -c -e adsf.au.doubleclick.net www.google.ca 443 +.Dl $ nc -cv -e adsf.au.doubleclick.net www.google.ca 443 .Pp Open a UDP connection to port 53 of host.example.com: .Pp @@ -538,8 +566,8 @@ if the proxy requires it: .Xr cat 1 , .Xr ssh 1 .Sh AUTHORS -Original implementation by *Hobbit* -.Aq Mt hobbit@avian.org . +Original implementation by +.An *Hobbit* Aq Mt hobbit@avian.org . .br Rewritten with IPv6 support by .An Eric Jackson Aq Mt ericj@monkey.org . diff --git a/apps/nc/netcat.c b/apps/nc/netcat.c index ee74d46a..25b767c7 100644 --- a/apps/nc/netcat.c +++ b/apps/nc/netcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.187 2017/07/15 17:27:39 jsing Exp $ */ +/* $OpenBSD: netcat.c,v 1.203 2019/02/26 17:32:47 jsing Exp $ */ /* * Copyright (c) 2001 Eric Jackson * Copyright (c) 2015 Bob Beck. All rights reserved. @@ -42,6 +42,7 @@ #include #include +#include #include #include #include @@ -66,16 +67,11 @@ #define POLL_NETIN 2 #define POLL_STDOUT 3 #define BUFSIZE 16384 -#ifndef DEFAULT_CA_FILE -#define DEFAULT_CA_FILE "/etc/ssl/cert.pem" -#endif -#define TLS_ALL (1 << 1) -#define TLS_NOVERIFY (1 << 2) -#define TLS_NONAME (1 << 3) -#define TLS_CCERT (1 << 4) -#define TLS_MUSTSTAPLE (1 << 5) -#define TLS_COMPAT (1 << 6) +#define TLS_NOVERIFY (1 << 1) +#define TLS_NONAME (1 << 2) +#define TLS_CCERT (1 << 3) +#define TLS_MUSTSTAPLE (1 << 4) /* Command Line Options */ int dflag; /* detached, no stdin */ @@ -106,14 +102,16 @@ int rtableid = -1; #endif int usetls; /* use TLS */ -char *Cflag; /* Public cert file */ -char *Kflag; /* Private key file */ -char *oflag; /* OCSP stapling file */ -char *Rflag = DEFAULT_CA_FILE; /* Root CA file */ +const char *Cflag; /* Public cert file */ +const char *Kflag; /* Private key file */ +const char *oflag; /* OCSP stapling file */ +const char *Rflag; /* Root CA file */ int tls_cachanged; /* Using non-default CA file */ int TLSopt; /* TLS options */ char *tls_expectname; /* required name in peer cert */ char *tls_expecthash; /* required hash of peer cert */ +char *tls_ciphers; /* TLS ciphers */ +char *tls_protocols; /* TLS protocols */ FILE *Zflag; /* file to save peer cert */ int recvcount, recvlimit; @@ -128,7 +126,7 @@ void atelnet(int, unsigned char *, unsigned int); int strtoport(char *portstr, int udp); void build_ports(char *); void help(void) __attribute__((noreturn)); -int local_listen(char *, char *, struct addrinfo); +int local_listen(const char *, const char *, struct addrinfo); void readwrite(int, struct tls *); void fdpass(int nfd) __attribute__((noreturn)); int remote_connect(const char *, const char *, struct addrinfo); @@ -141,10 +139,10 @@ int unix_bind(char *, int); int unix_connect(char *); int unix_listen(char *); void set_common_sockopts(int, int); -int map_tos(char *, int *); -int map_tls(char *, int *); +int process_tos_opt(char *, int *); +int process_tls_opt(char *, int *); void save_peer_cert(struct tls *_tls_ctx, FILE *_fp); -void report_connect(const struct sockaddr *, socklen_t, char *); +void report_sock(const char *, const struct sockaddr *, socklen_t, char *); void report_tls(struct tls *tls_ctx, char * host); void usage(int); ssize_t drainbuf(int, unsigned char *, size_t *, struct tls *); @@ -167,12 +165,14 @@ main(int argc, char *argv[]) char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; struct tls_config *tls_cfg = NULL; struct tls *tls_ctx = NULL; + uint32_t protocols; ret = 1; socksv = 5; host = NULL; uport = NULL; sv = NULL; + Rflag = tls_default_ca_cert_file(); signal(SIGPIPE, SIG_IGN); @@ -334,9 +334,9 @@ main(int argc, char *argv[]) case 'T': errstr = NULL; errno = 0; - if (map_tos(optarg, &Tflag)) + if (process_tls_opt(optarg, &TLSopt)) break; - if (map_tls(optarg, &TLSopt)) + if (process_tos_opt(optarg, &Tflag)) break; if (strlen(optarg) > 1 && optarg[0] == '0' && optarg[1] == 'x') @@ -360,13 +360,51 @@ main(int argc, char *argv[]) err(1, "setrtable"); #endif + /* Cruft to make sure options are clean, and used properly. */ + if (argv[0] && !argv[1] && family == AF_UNIX) { + host = argv[0]; + uport = NULL; + } else if (argv[0] && !argv[1]) { + if (!lflag) + usage(1); + uport = argv[0]; + host = NULL; + } else if (argv[0] && argv[1]) { + host = argv[0]; + uport = argv[1]; + } else + usage(1); + + if (usetls) { + if (Cflag && unveil(Cflag, "r") == -1) + err(1, "unveil"); + if (unveil(Rflag, "r") == -1) + err(1, "unveil"); + if (Kflag && unveil(Kflag, "r") == -1) + err(1, "unveil"); + if (oflag && unveil(oflag, "r") == -1) + err(1, "unveil"); + } else { + if (family == AF_UNIX) { + if (unveil(host, "rwc") == -1) + err(1, "unveil"); + if (uflag && !lflag) { + if (unveil(sflag ? sflag : "/tmp", "rwc") == -1) + err(1, "unveil"); + } + } else { + if (unveil("/", "") == -1) + err(1, "unveil"); + } + } + if (family == AF_UNIX) { if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) err(1, "pledge"); } else if (Fflag && Pflag) { if (pledge("stdio inet dns sendfd tty", NULL) == -1) err(1, "pledge"); - } else if (Fflag) { + } else if (Fflag) { if (pledge("stdio inet dns sendfd", NULL) == -1) err(1, "pledge"); } else if (Pflag && usetls) { @@ -381,21 +419,6 @@ main(int argc, char *argv[]) } else if (pledge("stdio inet dns", NULL) == -1) err(1, "pledge"); - /* Cruft to make sure options are clean, and used properly. */ - if (argv[0] && !argv[1] && family == AF_UNIX) { - host = argv[0]; - uport = NULL; - } else if (argv[0] && !argv[1]) { - if (!lflag) - usage(1); - uport = argv[0]; - host = NULL; - } else if (argv[0] && argv[1]) { - host = argv[0]; - uport = argv[1]; - } else - usage(1); - if (lflag && sflag) errx(1, "cannot use -s and -l"); if (lflag && pflag) @@ -414,8 +437,6 @@ main(int argc, char *argv[]) errx(1, "cannot use -c and -F"); if (TLSopt && !usetls) errx(1, "you must specify -c to use TLS options"); - if ((TLSopt & (TLS_ALL|TLS_COMPAT)) == (TLS_ALL|TLS_COMPAT)) - errx(1, "cannot use -T tlsall and -T tlscompat"); if (Cflag && !usetls) errx(1, "you must specify -c to use -C"); if (Kflag && !usetls) @@ -497,8 +518,6 @@ main(int argc, char *argv[]) } if (usetls) { - if (tls_init() == -1) - errx(1, "unable to initialize TLS"); if ((tls_cfg = tls_config_new()) == NULL) errx(1, "unable to allocate TLS config"); if (Rflag && tls_config_set_ca_file(tls_cfg, Rflag) == -1) @@ -509,14 +528,12 @@ main(int argc, char *argv[]) errx(1, "%s", tls_config_error(tls_cfg)); if (oflag && tls_config_set_ocsp_staple_file(tls_cfg, oflag) == -1) errx(1, "%s", tls_config_error(tls_cfg)); - if (TLSopt & (TLS_ALL|TLS_COMPAT)) { - if (tls_config_set_protocols(tls_cfg, - TLS_PROTOCOLS_ALL) != 0) - errx(1, "%s", tls_config_error(tls_cfg)); - if (tls_config_set_ciphers(tls_cfg, - (TLSopt & TLS_ALL) ? "all" : "compat") != 0) - errx(1, "%s", tls_config_error(tls_cfg)); - } + if (tls_config_parse_protocols(&protocols, tls_protocols) == -1) + errx(1, "invalid TLS protocols `%s'", tls_protocols); + if (tls_config_set_protocols(tls_cfg, protocols) == -1) + errx(1, "%s", tls_config_error(tls_cfg)); + if (tls_config_set_ciphers(tls_cfg, tls_ciphers) == -1) + errx(1, "%s", tls_config_error(tls_cfg)); if (!lflag && (TLSopt & TLS_CCERT)) errx(1, "clientcert is only valid with -l"); if (TLSopt & TLS_NONAME) @@ -537,8 +554,6 @@ main(int argc, char *argv[]) err(1, "pledge"); } if (lflag) { - struct tls *tls_cctx = NULL; - int connfd; ret = 0; if (family == AF_UNIX) { @@ -558,8 +573,11 @@ main(int argc, char *argv[]) } /* Allow only one connection at a time, but stay alive. */ for (;;) { - if (family != AF_UNIX) + if (family != AF_UNIX) { + if (s != -1) + close(s); s = local_listen(host, uport, hints); + } if (s < 0) err(1, NULL); if (uflag && kflag) { @@ -575,13 +593,12 @@ main(int argc, char *argv[]) * initially to wait for a caller, then use * the regular functions to talk to the caller. */ - int rv, plen; - char buf[16384]; + int rv; + char buf[2048]; struct sockaddr_storage z; len = sizeof(z); - plen = 2048; - rv = recvfrom(s, buf, plen, MSG_PEEK, + rv = recvfrom(s, buf, sizeof(buf), MSG_PEEK, (struct sockaddr *)&z, &len); if (rv < 0) err(1, "recvfrom"); @@ -591,10 +608,14 @@ main(int argc, char *argv[]) err(1, "connect"); if (vflag) - report_connect((struct sockaddr *)&z, len, NULL); + report_sock("Connection received", + (struct sockaddr *)&z, len, NULL); readwrite(s, NULL); } else { + struct tls *tls_cctx = NULL; + int connfd; + len = sizeof(cliaddr); connfd = accept4(s, (struct sockaddr *)&cliaddr, &len, SOCK_NONBLOCK); @@ -603,23 +624,20 @@ main(int argc, char *argv[]) err(1, "accept"); } if (vflag) - report_connect((struct sockaddr *)&cliaddr, len, + report_sock("Connection received", + (struct sockaddr *)&cliaddr, len, family == AF_UNIX ? host : NULL); if ((usetls) && (tls_cctx = tls_setup_server(tls_ctx, connfd, host))) readwrite(connfd, tls_cctx); if (!usetls) readwrite(connfd, NULL); - if (tls_cctx) { + if (tls_cctx) timeout_tls(s, tls_cctx, tls_close); - tls_free(tls_cctx); - tls_cctx = NULL; - } close(connfd); + tls_free(tls_cctx); } - if (family != AF_UNIX) - close(s); - else if (uflag) { + if (family == AF_UNIX && uflag) { if (connect(s, NULL, 0) < 0) err(1, "connect"); } @@ -634,8 +652,10 @@ main(int argc, char *argv[]) if (!zflag) readwrite(s, NULL); close(s); - } else + } else { + warn("%s", host); ret = 1; + } if (uflag) unlink(unix_dg_tmp_socket); @@ -651,6 +671,8 @@ main(int argc, char *argv[]) for (s = -1, i = 0; portlist[i] != NULL; i++) { if (s != -1) close(s); + tls_free(tls_ctx); + tls_ctx = NULL; if (usetls) { if ((tls_ctx = tls_client()) == NULL) @@ -701,18 +723,15 @@ main(int argc, char *argv[]) tls_setup_client(tls_ctx, s, host); if (!zflag) readwrite(s, tls_ctx); - if (tls_ctx) { + if (tls_ctx) timeout_tls(s, tls_ctx, tls_close); - tls_free(tls_ctx); - tls_ctx = NULL; - } } } } if (s != -1) close(s); - + tls_free(tls_ctx); tls_config_free(tls_cfg); return ret; @@ -749,6 +768,8 @@ unix_bind(char *path, int flags) errno = save_errno; return -1; } + if (vflag) + report_sock("Bound", NULL, 0, path); return s; } @@ -885,13 +906,16 @@ int unix_listen(char *path) { int s; + if ((s = unix_bind(path, 0)) < 0) return -1; - if (listen(s, 5) < 0) { close(s); return -1; } + if (vflag) + report_sock("Listening", NULL, 0, path); + return s; } @@ -993,7 +1017,7 @@ timeout_connect(int s, const struct sockaddr *name, socklen_t namelen) * address. Returns -1 on failure. */ int -local_listen(char *host, char *port, struct addrinfo hints) +local_listen(const char *host, const char *port, struct addrinfo hints) { struct addrinfo *res, *res0; int s = -1, save_errno; @@ -1042,6 +1066,16 @@ local_listen(char *host, char *port, struct addrinfo hints) if (listen(s, 1) < 0) err(1, "listen"); } + if (vflag && s != -1) { + struct sockaddr_storage ss; + socklen_t len; + + len = sizeof(ss); + if (getsockname(s, (struct sockaddr *)&ss, &len) == -1) + err(1, "getsockname"); + report_sock(uflag ? "Bound" : "Listening", + (struct sockaddr *)&ss, len, NULL); + } freeaddrinfo(res0); @@ -1253,9 +1287,11 @@ drainbuf(int fd, unsigned char *buf, size_t *bufpos, struct tls *tls) ssize_t n; ssize_t adjust; - if (tls) + if (tls) { n = tls_write(tls, buf, *bufpos); - else { + if (n == -1) + errx(1, "tls write failed (%s)", tls_error(tls)); + } else { n = write(fd, buf, *bufpos); /* don't treat EAGAIN, EINTR as error */ if (n == -1 && (errno == EAGAIN || errno == EINTR)) @@ -1277,9 +1313,11 @@ fillbuf(int fd, unsigned char *buf, size_t *bufpos, struct tls *tls) size_t num = BUFSIZE - *bufpos; ssize_t n; - if (tls) + if (tls) { n = tls_read(tls, buf + *bufpos, num); - else { + if (n == -1) + errx(1, "tls read failed (%s)", tls_error(tls)); + } else { n = read(fd, buf + *bufpos, num); /* don't treat EAGAIN, EINTR as error */ if (n == -1 && (errno == EAGAIN || errno == EINTR)) @@ -1313,9 +1351,9 @@ fdpass(int nfd) if (isatty(STDOUT_FILENO)) errx(1, "Cannot pass file descriptor to tty"); - bzero(&mh, sizeof(mh)); - bzero(&cmsgbuf, sizeof(cmsgbuf)); - bzero(&iov, sizeof(iov)); + memset(&mh, 0, sizeof(mh)); + memset(&cmsgbuf, 0, sizeof(cmsgbuf)); + memset(&iov, 0, sizeof(iov)); mh.msg_control = (caddr_t)&cmsgbuf.buf; mh.msg_controllen = sizeof(cmsgbuf.buf); @@ -1330,7 +1368,7 @@ fdpass(int nfd) mh.msg_iov = &iov; mh.msg_iovlen = 1; - bzero(&pfd, sizeof(pfd)); + memset(&pfd, 0, sizeof(pfd)); pfd.fd = STDOUT_FILENO; pfd.events = POLLOUT; for (;;) { @@ -1414,7 +1452,7 @@ build_ports(char *p) int hi, lo, cp; int x = 0; - if ((n = strchr(p, '-')) != NULL) { + if (isdigit((unsigned char)*p) && (n = strchr(p, '-')) != NULL) { *n = '\0'; n++; @@ -1545,7 +1583,7 @@ set_common_sockopts(int s, int af) } int -map_tos(char *s, int *val) +process_tos_opt(char *s, int *val) { /* DiffServ Codepoints and other TOS mappings */ const struct toskeywords { @@ -1593,24 +1631,41 @@ map_tos(char *s, int *val) } int -map_tls(char *s, int *val) +process_tls_opt(char *s, int *flags) { + size_t len; + char *v; + const struct tlskeywords { const char *keyword; - int val; + int flag; + char **value; } *t, tlskeywords[] = { - { "tlsall", TLS_ALL }, - { "noverify", TLS_NOVERIFY }, - { "noname", TLS_NONAME }, - { "clientcert", TLS_CCERT}, - { "muststaple", TLS_MUSTSTAPLE}, - { "tlscompat", TLS_COMPAT }, - { NULL, -1 }, + { "ciphers", -1, &tls_ciphers }, + { "clientcert", TLS_CCERT, NULL }, + { "muststaple", TLS_MUSTSTAPLE, NULL }, + { "noverify", TLS_NOVERIFY, NULL }, + { "noname", TLS_NONAME, NULL }, + { "protocols", -1, &tls_protocols }, + { NULL, -1, NULL }, }; + len = strlen(s); + if ((v = strchr(s, '=')) != NULL) { + len = v - s; + v++; + } + for (t = tlskeywords; t->keyword != NULL; t++) { - if (strcmp(s, t->keyword) == 0) { - *val |= t->val; + if (strlen(t->keyword) == len && + strncmp(s, t->keyword, len) == 0) { + if (t->value != NULL) { + if (v == NULL) + errx(1, "invalid tls value `%s'", s); + *t->value = v; + } else { + *flags |= t->flag; + } return 1; } } @@ -1690,34 +1745,30 @@ report_tls(struct tls * tls_ctx, char * host) } void -report_connect(const struct sockaddr *sa, socklen_t salen, char *path) +report_sock(const char *msg, const struct sockaddr *sa, socklen_t salen, + char *path) { - char remote_host[NI_MAXHOST]; - char remote_port[NI_MAXSERV]; + char host[NI_MAXHOST], port[NI_MAXSERV]; int herr; int flags = NI_NUMERICSERV; if (path != NULL) { - fprintf(stderr, "Connection on %s received!\n", path); + fprintf(stderr, "%s on %s\n", msg, path); return; } if (nflag) flags |= NI_NUMERICHOST; - if ((herr = getnameinfo(sa, salen, - remote_host, sizeof(remote_host), - remote_port, sizeof(remote_port), - flags)) != 0) { + if ((herr = getnameinfo(sa, salen, host, sizeof(host), + port, sizeof(port), flags)) != 0) { if (herr == EAI_SYSTEM) err(1, "getnameinfo"); else errx(1, "getnameinfo: %s", gai_strerror(herr)); } - fprintf(stderr, - "Connection from %s %s " - "received!\n", remote_host, remote_port); + fprintf(stderr, "%s on %s %s\n", msg, host, port); } void diff --git a/apps/nc/socks.c b/apps/nc/socks.c index c9aa5178..856c3e74 100644 --- a/apps/nc/socks.c +++ b/apps/nc/socks.c @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.24 2016/06/27 14:43:04 deraadt Exp $ */ +/* $OpenBSD: socks.c,v 1.27 2019/01/10 12:44:54 mestre Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -65,7 +65,7 @@ decode_addrport(const char *h, const char *p, struct sockaddr *addr, int r; struct addrinfo hints, *res; - bzero(&hints, sizeof(hints)); + memset(&hints, 0, sizeof(hints)); hints.ai_family = v4only ? PF_INET : PF_UNSPEC; hints.ai_flags = numeric ? AI_NUMERICHOST : 0; hints.ai_socktype = SOCK_STREAM; @@ -109,17 +109,16 @@ proxy_read_line(int fd, char *buf, size_t bufsz) return (off); } -static const char * -getproxypass(const char *proxyuser, const char *proxyhost) +static void +getproxypass(const char *proxyuser, const char *proxyhost, + char *pw, size_t pwlen) { char prompt[512]; - static char pw[256]; snprintf(prompt, sizeof(prompt), "Proxy password for %s@%s: ", proxyuser, proxyhost); - if (readpassphrase(prompt, pw, sizeof(pw), RPP_REQUIRE_TTY) == NULL) + if (readpassphrase(prompt, pw, pwlen, RPP_REQUIRE_TTY) == NULL) errx(1, "Unable to read proxy passphrase"); - return (pw); } /* @@ -188,7 +187,6 @@ socks_connect(const char *host, const char *port, struct sockaddr_in *in4 = (struct sockaddr_in *)&addr; struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)&addr; in_port_t serverport; - const char *proxypass = NULL; if (proxyport == NULL) proxyport = (socksv == -1) ? HTTP_PROXY_PORT : SOCKS_PORT; @@ -345,11 +343,14 @@ socks_connect(const char *host, const char *port, err(1, "write failed (%zu/%d)", cnt, r); if (authretry > 1) { + char proxypass[256]; char resp[1024]; - proxypass = getproxypass(proxyuser, proxyhost); + getproxypass(proxyuser, proxyhost, + proxypass, sizeof proxypass); r = snprintf(buf, sizeof(buf), "%s:%s", proxyuser, proxypass); + explicit_bzero(proxypass, sizeof proxypass); if (r == -1 || (size_t)r >= sizeof(buf) || b64_ntop(buf, strlen(buf), resp, sizeof(resp)) == -1) @@ -361,6 +362,8 @@ socks_connect(const char *host, const char *port, r = strlen(buf); if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r) err(1, "write failed (%zu/%d)", cnt, r); + explicit_bzero(proxypass, sizeof proxypass); + explicit_bzero(buf, sizeof buf); } /* Terminate headers */ diff --git a/apps/ocspcheck/CMakeLists.txt b/apps/ocspcheck/CMakeLists.txt index 4f89f4ea..3c804585 100644 --- a/apps/ocspcheck/CMakeLists.txt +++ b/apps/ocspcheck/CMakeLists.txt @@ -1,25 +1,11 @@ if(NOT MSVC) -include_directories( - . - ./compat - ../../include - ../../include/compat -) - set( OCSPCHECK_SRC http.c ocspcheck.c ) -check_function_exists(inet_ntop HAVE_INET_NTOP) -if(HAVE_INET_NTOP) - add_definitions(-DHAVE_INET_NTOP) -else() - set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/inet_ntop.c) -endif() - check_function_exists(memmem HAVE_MEMMEM) if(HAVE_MEMMEM) add_definitions(-DHAVE_MEMMEM) @@ -34,6 +20,7 @@ else() endif() add_executable(ocspcheck ${OCSPCHECK_SRC}) +target_include_directories(ocspcheck PRIVATE . ./compat ../../include/compat) target_link_libraries(ocspcheck tls ${OPENSSL_LIBS}) if(ENABLE_LIBRESSL_INSTALL) diff --git a/apps/ocspcheck/Makefile.am b/apps/ocspcheck/Makefile.am index f7eb1313..7482101a 100644 --- a/apps/ocspcheck/Makefile.am +++ b/apps/ocspcheck/Makefile.am @@ -14,10 +14,6 @@ ocspcheck_SOURCES = http.c ocspcheck_SOURCES += ocspcheck.c noinst_HEADERS = http.h -if !HAVE_INET_NTOP -ocspcheck_SOURCES += compat/inet_ntop.c -endif - if !HAVE_MEMMEM ocspcheck_SOURCES += compat/memmem.c endif diff --git a/apps/ocspcheck/Makefile.in b/apps/ocspcheck/Makefile.in index 66d37f3d..e6a7b4a3 100644 --- a/apps/ocspcheck/Makefile.in +++ b/apps/ocspcheck/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -90,8 +90,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = ocspcheck$(EXEEXT) -@HAVE_INET_NTOP_FALSE@am__append_1 = compat/inet_ntop.c -@HAVE_MEMMEM_FALSE@am__append_2 = compat/memmem.c +@HAVE_MEMMEM_FALSE@am__append_1 = compat/memmem.c subdir = apps/ocspcheck ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/check-hardening-options.m4 \ @@ -110,13 +109,11 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) -am__ocspcheck_SOURCES_DIST = http.c ocspcheck.c compat/inet_ntop.c \ - compat/memmem.c +am__ocspcheck_SOURCES_DIST = http.c ocspcheck.c compat/memmem.c am__dirstamp = $(am__leading_dot)dirstamp -@HAVE_INET_NTOP_FALSE@am__objects_1 = compat/inet_ntop.$(OBJEXT) -@HAVE_MEMMEM_FALSE@am__objects_2 = compat/memmem.$(OBJEXT) +@HAVE_MEMMEM_FALSE@am__objects_1 = compat/memmem.$(OBJEXT) am_ocspcheck_OBJECTS = http.$(OBJEXT) ocspcheck.$(OBJEXT) \ - $(am__objects_1) $(am__objects_2) + $(am__objects_1) ocspcheck_OBJECTS = $(am_ocspcheck_OBJECTS) am__DEPENDENCIES_1 = ocspcheck_DEPENDENCIES = $(abs_top_builddir)/crypto/libcrypto.la \ @@ -141,7 +138,9 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/http.Po ./$(DEPDIR)/ocspcheck.Po \ + compat/$(DEPDIR)/memmem.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -323,7 +322,7 @@ ocspcheck_LDADD = $(abs_top_builddir)/crypto/libcrypto.la \ $(abs_top_builddir)/ssl/libssl.la \ $(abs_top_builddir)/tls/libtls.la $(PLATFORM_LDADD) \ $(PROG_LDADD) -ocspcheck_SOURCES = http.c ocspcheck.c $(am__append_1) $(am__append_2) +ocspcheck_SOURCES = http.c ocspcheck.c $(am__append_1) noinst_HEADERS = http.h all: all-am @@ -346,8 +345,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/Makefile.am.common $(am__empty): @@ -414,8 +413,6 @@ compat/$(am__dirstamp): compat/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) compat/$(DEPDIR) @: > compat/$(DEPDIR)/$(am__dirstamp) -compat/inet_ntop.$(OBJEXT): compat/$(am__dirstamp) \ - compat/$(DEPDIR)/$(am__dirstamp) compat/memmem.$(OBJEXT): compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) @@ -430,10 +427,15 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocspcheck.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/inet_ntop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/memmem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocspcheck.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/memmem.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -517,7 +519,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -591,7 +596,9 @@ clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) compat/$(DEPDIR) + -rm -f ./$(DEPDIR)/http.Po + -rm -f ./$(DEPDIR)/ocspcheck.Po + -rm -f compat/$(DEPDIR)/memmem.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -637,7 +644,9 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) compat/$(DEPDIR) + -rm -f ./$(DEPDIR)/http.Po + -rm -f ./$(DEPDIR)/ocspcheck.Po + -rm -f compat/$(DEPDIR)/memmem.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -658,7 +667,7 @@ uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ diff --git a/apps/ocspcheck/compat/inet_ntop.c b/apps/ocspcheck/compat/inet_ntop.c deleted file mode 100644 index 018e9056..00000000 --- a/apps/ocspcheck/compat/inet_ntop.c +++ /dev/null @@ -1,204 +0,0 @@ -/* $OpenBSD: inet_ntop.c,v 1.13 2016/09/21 04:38:56 guenther Exp $ */ - -/* Copyright (c) 1996 by Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS - * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE - * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * WARNING: Don't even consider trying to compile this on a system where - * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. - */ - -static const char *inet_ntop4(const u_char *src, char *dst, size_t size); -static const char *inet_ntop6(const u_char *src, char *dst, size_t size); - -/* const char * - * inet_ntop(af, src, dst, size) - * convert a network format address to presentation format. - * return: - * pointer to presentation format address (`dst'), or NULL (see errno). - * author: - * Paul Vixie, 1996. - */ -const char * -inet_ntop(int af, const void *src, char *dst, socklen_t size) -{ - switch (af) { - case AF_INET: - return (inet_ntop4(src, dst, size)); - case AF_INET6: - return (inet_ntop6(src, dst, size)); - default: - errno = EAFNOSUPPORT; - return (NULL); - } - /* NOTREACHED */ -} - -/* const char * - * inet_ntop4(src, dst, size) - * format an IPv4 address, more or less like inet_ntoa() - * return: - * `dst' (as a const) - * notes: - * (1) uses no statics - * (2) takes a u_char* not an in_addr as input - * author: - * Paul Vixie, 1996. - */ -static const char * -inet_ntop4(const u_char *src, char *dst, size_t size) -{ - char tmp[sizeof "255.255.255.255"]; - int l; - - l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u", - src[0], src[1], src[2], src[3]); - if (l <= 0 || l >= size) { - errno = ENOSPC; - return (NULL); - } - strlcpy(dst, tmp, size); - return (dst); -} - -/* const char * - * inet_ntop6(src, dst, size) - * convert IPv6 binary address into presentation (printable) format - * author: - * Paul Vixie, 1996. - */ -static const char * -inet_ntop6(const u_char *src, char *dst, size_t size) -{ - /* - * Note that int32_t and int16_t need only be "at least" large enough - * to contain a value of the specified size. On some systems, like - * Crays, there is no such thing as an integer variable with 16 bits. - * Keep this in mind if you think this function should have been coded - * to use pointer overlays. All the world's not a VAX. - */ - char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"]; - char *tp, *ep; - struct { int base, len; } best, cur; - u_int words[IN6ADDRSZ / INT16SZ]; - int i; - int advance; - - /* - * Preprocess: - * Copy the input (bytewise) array into a wordwise array. - * Find the longest run of 0x00's in src[] for :: shorthanding. - */ - memset(words, '\0', sizeof words); - for (i = 0; i < IN6ADDRSZ; i++) - words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); - best.base = -1; - cur.base = -1; - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { - if (words[i] == 0) { - if (cur.base == -1) - cur.base = i, cur.len = 1; - else - cur.len++; - } else { - if (cur.base != -1) { - if (best.base == -1 || cur.len > best.len) - best = cur; - cur.base = -1; - } - } - } - if (cur.base != -1) { - if (best.base == -1 || cur.len > best.len) - best = cur; - } - if (best.base != -1 && best.len < 2) - best.base = -1; - - /* - * Format the result. - */ - tp = tmp; - ep = tmp + sizeof(tmp); - for (i = 0; i < (IN6ADDRSZ / INT16SZ) && tp < ep; i++) { - /* Are we inside the best run of 0x00's? */ - if (best.base != -1 && i >= best.base && - i < (best.base + best.len)) { - if (i == best.base) { - if (tp + 1 >= ep) { - errno = ENOSPC; - return (NULL); - } - *tp++ = ':'; - } - continue; - } - /* Are we following an initial run of 0x00s or any real hex? */ - if (i != 0) { - if (tp + 1 >= ep) { - errno = ENOSPC; - return (NULL); - } - *tp++ = ':'; - } - /* Is this address an encapsulated IPv4? */ - if (i == 6 && best.base == 0 && - (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { - if (!inet_ntop4(src+12, tp, ep - tp)) - return (NULL); - tp += strlen(tp); - break; - } - advance = snprintf(tp, ep - tp, "%x", words[i]); - if (advance <= 0 || advance >= ep - tp) { - errno = ENOSPC; - return (NULL); - } - tp += advance; - } - /* Was it a trailing run of 0x00's? */ - if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) { - if (tp + 1 >= ep) { - errno = ENOSPC; - return (NULL); - } - *tp++ = ':'; - } - if (tp + 1 >= ep) { - errno = ENOSPC; - return (NULL); - } - *tp++ = '\0'; - - /* - * Check for overflow, copy, and we're done. - */ - if ((size_t)(tp - tmp) > size) { - errno = ENOSPC; - return (NULL); - } - strlcpy(dst, tmp, size); - return (dst); -} diff --git a/apps/ocspcheck/http.c b/apps/ocspcheck/http.c index 4683f5ab..5c914a48 100644 --- a/apps/ocspcheck/http.c +++ b/apps/ocspcheck/http.c @@ -1,4 +1,4 @@ -/* $Id: http.c,v 1.9 2017/03/26 18:41:02 deraadt Exp $ */ +/* $Id: http.c,v 1.11 2018/11/29 14:25:07 tedu Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons * @@ -35,10 +35,6 @@ #include "http.h" #include -#ifndef DEFAULT_CA_FILE -#define DEFAULT_CA_FILE "/etc/ssl/cert.pem" -#endif - /* * A buffer for transferring HTTP/S data. */ @@ -139,7 +135,7 @@ http_init() goto err; } - if (tls_config_set_ca_file(tlscfg, DEFAULT_CA_FILE) == -1) { + if (tls_config_set_ca_file(tlscfg, tls_default_ca_cert_file()) == -1) { warn("tls_config_set_ca_file: %s", tls_config_error(tlscfg)); goto err; } diff --git a/apps/ocspcheck/ocspcheck.8 b/apps/ocspcheck/ocspcheck.8 index 21869205..19f55fb8 100644 --- a/apps/ocspcheck/ocspcheck.8 +++ b/apps/ocspcheck/ocspcheck.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ocspcheck.8,v 1.6 2017/01/26 22:59:55 jmc Exp $ +.\" $OpenBSD: ocspcheck.8,v 1.9 2017/11/29 21:15:45 jmc Exp $ .\" .\" Copyright (c) 2017 Bob Beck .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 26 2017 $ +.Dd $Mdocdate: November 29 2017 $ .Dt OCSPCHECK 8 .Os .Sh NAME @@ -24,6 +24,7 @@ .Nm .Op Fl Nv .Op Fl C Ar CAfile +.Op Fl i Ar staplefile .Op Fl o Ar staplefile .Ar file .Sh DESCRIPTION @@ -45,10 +46,18 @@ By default no certificates are used beyond those in the certificate chain provided by the .Ar file argument. +.It Fl i Ar staplefile +Specify an input filename from which a DER-encoded OCSP response +will be read instead of fetching it from the OCSP server. +A filename +of +.Sq - +will read the response from standard input. .It Fl N Do not use a nonce value in the OCSP request, or validate that the nonce was returned in the OCSP response. -By default a nonce is always used and validated. +By default a nonce is always used and validated when retrieving +a response from an OCSP server. The use of this flag is a security risk as it will allow OCSP responses to be replayed. It should not be used unless the OCSP server does not support the @@ -79,6 +88,11 @@ exits >0 if an error occurs or the OCSP response fails to validate. .Xr tls_config_set_ocsp_staple_file 3 , .Xr tls_config_set_ocsp_staple_mem 3 , .Xr httpd 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Ox 6.1 . .Sh AUTHORS .Nm was written by diff --git a/apps/ocspcheck/ocspcheck.c b/apps/ocspcheck/ocspcheck.c index df142653..551a8fa0 100644 --- a/apps/ocspcheck/ocspcheck.c +++ b/apps/ocspcheck/ocspcheck.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocspcheck.c,v 1.21 2017/05/08 20:15:34 beck Exp $ */ +/* $OpenBSD: ocspcheck.c,v 1.24 2017/12/01 14:42:23 visa Exp $ */ /* * Copyright (c) 2017 Bob Beck @@ -40,6 +40,7 @@ #define MAXAGE_SEC (14*24*60*60) #define JITTER_SEC (60) +#define OCSP_MAX_RESPONSE_SIZE (20480) typedef struct ocsp_request { STACK_OF(X509) *fullchain; @@ -497,7 +498,8 @@ static void usage(void) { fprintf(stderr, - "usage: ocspcheck [-Nv] [-C CAfile] [-o staplefile] file\n"); + "usage: ocspcheck [-Nv] [-C CAfile] [-i staplefile] " + "[-o staplefile] file\n"); exit(1); } @@ -505,19 +507,19 @@ int main(int argc, char **argv) { char *host = NULL, *path = "/", *certfile = NULL, *outfile = NULL, - *cafile = NULL; + *cafile = NULL, *instaple = NULL, *infile = NULL; struct addr addrs[MAX_SERVERS_DNS] = {{0}}; struct source sources[MAX_SERVERS_DNS]; - int i, ch, staplefd = -1, nonce = 1; + int i, ch, staplefd = -1, infd = -1, nonce = 1; ocsp_request *request = NULL; - size_t rescount, httphsz; - struct httphead *httph; + size_t rescount, httphsz = 0, instaplesz = 0; + struct httphead *httph = NULL; struct httpget *hget; X509_STORE *castore; ssize_t written, w; short port; - while ((ch = getopt(argc, argv, "C:No:v")) != -1) { + while ((ch = getopt(argc, argv, "C:i:No:v")) != -1) { switch (ch) { case 'C': cafile = optarg; @@ -528,6 +530,9 @@ main(int argc, char **argv) case 'o': outfile = optarg; break; + case 'i': + infile = optarg; + break; case 'v': verbose++; break; @@ -551,6 +556,16 @@ main(int argc, char **argv) err(1, "Unable to open output file %s", outfile); } + if (infile != NULL) { + if (strcmp(infile, "-") == 0) + infd = STDIN_FILENO; + else + infd = open(infile, O_RDONLY); + if (infd < 0) + err(1, "Unable to open input file %s", infile); + nonce = 0; /* Can't validate a nonce on a saved reply */ + } + if (pledge("stdio inet rpath dns", NULL) == -1) err(1, "pledge"); @@ -571,50 +586,84 @@ main(int argc, char **argv) certfile); if (*path == '\0') path = "/"; - vspew("Using %s to host %s, port %d, path %s\n", - port == 443 ? "https" : "http", host, port, path); - rescount = host_dns(host, addrs); - for (i = 0; i < rescount; i++) { - sources[i].ip = addrs[i].ip; - sources[i].family = addrs[i].family; - } + if (infd == -1) { + /* Get a new OCSP response from the indicated server */ - /* - * Do an HTTP post to send our request to the OCSP - * server, and hopefully get an answer back - */ - hget = http_get(sources, rescount, host, port, path, - request->data, request->size); - if (hget == NULL) - errx(1, "http_get"); + vspew("Using %s to host %s, port %d, path %s\n", + port == 443 ? "https" : "http", host, port, path); - /* - * Pledge minimally before fiddling with libcrypto init - * routines and parsing untrusted input from someone's OCSP - * server. - */ - if (pledge("stdio", NULL) == -1) - err(1, "pledge"); - - httph = http_head_parse(hget->http, hget->xfer, &httphsz); - dspew("Server at %s returns:\n", host); - for (i = 0; i < httphsz; i++) - dspew(" [%s]=[%s]\n", httph[i].key, httph[i].val); - dspew(" [Body]=[%zu bytes]\n", hget->bodypartsz); - if (hget->bodypartsz <= 0) - errx(1, "No body in reply from %s", host); - - if (hget->code != 200) - errx(1, "http reply code %d from %s", hget->code, host); + rescount = host_dns(host, addrs); + for (i = 0; i < rescount; i++) { + sources[i].ip = addrs[i].ip; + sources[i].family = addrs[i].family; + } - /* - * Validate the OCSP response we got back - */ - OPENSSL_add_all_algorithms_noconf(); - if (!validate_response(hget->bodypart, hget->bodypartsz, - request, castore, host, certfile)) - exit(1); + /* + * Do an HTTP post to send our request to the OCSP + * server, and hopefully get an answer back + */ + hget = http_get(sources, rescount, host, port, path, + request->data, request->size); + if (hget == NULL) + errx(1, "http_get"); + /* + * Pledge minimally before fiddling with libcrypto init + * routines and parsing untrusted input from someone's OCSP + * server. + */ + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + + dspew("Server at %s returns:\n", host); + for (i = 0; i < httphsz; i++) + dspew(" [%s]=[%s]\n", httph[i].key, httph[i].val); + dspew(" [Body]=[%zu bytes]\n", hget->bodypartsz); + if (hget->bodypartsz <= 0) + errx(1, "No body in reply from %s", host); + + if (hget->code != 200) + errx(1, "http reply code %d from %s", hget->code, host); + + /* + * Validate the OCSP response we got back + */ + OPENSSL_add_all_algorithms_noconf(); + if (!validate_response(hget->bodypart, hget->bodypartsz, + request, castore, host, certfile)) + exit(1); + instaple = hget->bodypart; + instaplesz = hget->bodypartsz; + } else { + size_t nr = 0; + instaplesz = 0; + + /* + * Pledge minimally before fiddling with libcrypto init + */ + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + + dspew("Using ocsp response saved in %s:\n", infile); + + /* Use the existing OCSP response saved in infd */ + instaple = calloc(OCSP_MAX_RESPONSE_SIZE, 1); + if (instaple) { + while ((nr = read(infd, instaple + instaplesz, + OCSP_MAX_RESPONSE_SIZE - instaplesz)) != -1 && + nr != 0) + instaplesz += nr; + } + if (instaplesz == 0) + exit(1); + /* + * Validate the OCSP staple we read in. + */ + OPENSSL_add_all_algorithms_noconf(); + if (!validate_response(instaple, instaplesz, + request, castore, host, certfile)) + exit(1); + } /* * If we have been given a place to save a staple, @@ -624,9 +673,9 @@ main(int argc, char **argv) (void) ftruncate(staplefd, 0); w = 0; written = 0; - while (written < hget->bodypartsz) { - w = write(staplefd, hget->bodypart + written, - hget->bodypartsz - written); + while (written < instaplesz) { + w = write(staplefd, instaple + written, + instaplesz - written); if (w == -1) { if (errno != EINTR && errno != EAGAIN) err(1, "Write of OCSP response failed"); diff --git a/apps/openssl/CMakeLists.txt b/apps/openssl/CMakeLists.txt index 718c2087..6d89c069 100644 --- a/apps/openssl/CMakeLists.txt +++ b/apps/openssl/CMakeLists.txt @@ -1,9 +1,3 @@ -include_directories( - . - ../../include - ../../include/compat -) - set( OPENSSL_SRC apps.c @@ -55,12 +49,12 @@ set( x509.c ) -if(CMAKE_HOST_UNIX) +if(UNIX) set(OPENSSL_SRC ${OPENSSL_SRC} apps_posix.c) set(OPENSSL_SRC ${OPENSSL_SRC} certhash.c) endif() -if(CMAKE_HOST_WIN32) +if(WIN32) set(OPENSSL_SRC ${OPENSSL_SRC} apps_win.c) set(OPENSSL_SRC ${OPENSSL_SRC} certhash_win.c) set(OPENSSL_SRC ${OPENSSL_SRC} compat/poll_win.c) @@ -73,7 +67,15 @@ else() set(OPENSSL_SRC ${OPENSSL_SRC} compat/strtonum.c) endif() +if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) + if(NOT HAVE_CLOCK_GETTIME) + set(OPENSSL_SRC ${OPENSSL_SRC} compat/clock_gettime_osx.c) + endif() +endif() + add_executable(openssl ${OPENSSL_SRC}) +target_include_directories(openssl PRIVATE . ../../include/compat) target_link_libraries(openssl ${OPENSSL_LIBS}) if(ENABLE_LIBRESSL_INSTALL) diff --git a/apps/openssl/Makefile.am b/apps/openssl/Makefile.am index 9b9eb10f..f100adb2 100644 --- a/apps/openssl/Makefile.am +++ b/apps/openssl/Makefile.am @@ -74,6 +74,12 @@ openssl_SOURCES += compat/poll_win.c endif endif +if !HAVE_CLOCK_GETTIME +if HOST_DARWIN +openssl_SOURCES += compat/clock_gettime_osx.c +endif +endif + if !HAVE_STRTONUM openssl_SOURCES += compat/strtonum.c endif diff --git a/apps/openssl/Makefile.in b/apps/openssl/Makefile.in index 0d42288f..09c5079f 100644 --- a/apps/openssl/Makefile.in +++ b/apps/openssl/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -95,7 +95,8 @@ bin_PROGRAMS = openssl$(EXEEXT) @HOST_WIN_TRUE@am__append_3 = apps_win.c @HOST_WIN_FALSE@am__append_4 = apps_posix.c @HAVE_POLL_FALSE@@HOST_WIN_TRUE@am__append_5 = compat/poll_win.c -@HAVE_STRTONUM_FALSE@am__append_6 = compat/strtonum.c +@HAVE_CLOCK_GETTIME_FALSE@@HOST_DARWIN_TRUE@am__append_6 = compat/clock_gettime_osx.c +@HAVE_STRTONUM_FALSE@am__append_7 = compat/strtonum.c subdir = apps/openssl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/check-hardening-options.m4 \ @@ -122,7 +123,7 @@ am__openssl_SOURCES_DIST = apps.c asn1pars.c ca.c ciphers.c crl.c \ s_cb.c s_client.c s_server.c s_socket.c s_time.c sess_id.c \ smime.c speed.c spkac.c ts.c verify.c version.c x509.c \ certhash.c certhash_win.c apps_win.c apps_posix.c \ - compat/poll_win.c compat/strtonum.c + compat/poll_win.c compat/clock_gettime_osx.c compat/strtonum.c @BUILD_CERTHASH_TRUE@am__objects_1 = certhash.$(OBJEXT) @BUILD_CERTHASH_FALSE@am__objects_2 = certhash_win.$(OBJEXT) @HOST_WIN_TRUE@am__objects_3 = apps_win.$(OBJEXT) @@ -130,7 +131,8 @@ am__openssl_SOURCES_DIST = apps.c asn1pars.c ca.c ciphers.c crl.c \ am__dirstamp = $(am__leading_dot)dirstamp @HAVE_POLL_FALSE@@HOST_WIN_TRUE@am__objects_5 = \ @HAVE_POLL_FALSE@@HOST_WIN_TRUE@ compat/poll_win.$(OBJEXT) -@HAVE_STRTONUM_FALSE@am__objects_6 = compat/strtonum.$(OBJEXT) +@HAVE_CLOCK_GETTIME_FALSE@@HOST_DARWIN_TRUE@am__objects_6 = compat/clock_gettime_osx.$(OBJEXT) +@HAVE_STRTONUM_FALSE@am__objects_7 = compat/strtonum.$(OBJEXT) am_openssl_OBJECTS = apps.$(OBJEXT) asn1pars.$(OBJEXT) ca.$(OBJEXT) \ ciphers.$(OBJEXT) crl.$(OBJEXT) crl2p7.$(OBJEXT) \ dgst.$(OBJEXT) dh.$(OBJEXT) dhparam.$(OBJEXT) dsa.$(OBJEXT) \ @@ -147,7 +149,7 @@ am_openssl_OBJECTS = apps.$(OBJEXT) asn1pars.$(OBJEXT) ca.$(OBJEXT) \ speed.$(OBJEXT) spkac.$(OBJEXT) ts.$(OBJEXT) verify.$(OBJEXT) \ version.$(OBJEXT) x509.$(OBJEXT) $(am__objects_1) \ $(am__objects_2) $(am__objects_3) $(am__objects_4) \ - $(am__objects_5) $(am__objects_6) + $(am__objects_5) $(am__objects_6) $(am__objects_7) openssl_OBJECTS = $(am_openssl_OBJECTS) am__DEPENDENCIES_1 = openssl_DEPENDENCIES = $(abs_top_builddir)/ssl/libssl.la \ @@ -171,7 +173,31 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/apps.Po ./$(DEPDIR)/apps_posix.Po \ + ./$(DEPDIR)/apps_win.Po ./$(DEPDIR)/asn1pars.Po \ + ./$(DEPDIR)/ca.Po ./$(DEPDIR)/certhash.Po \ + ./$(DEPDIR)/certhash_win.Po ./$(DEPDIR)/ciphers.Po \ + ./$(DEPDIR)/crl.Po ./$(DEPDIR)/crl2p7.Po ./$(DEPDIR)/dgst.Po \ + ./$(DEPDIR)/dh.Po ./$(DEPDIR)/dhparam.Po ./$(DEPDIR)/dsa.Po \ + ./$(DEPDIR)/dsaparam.Po ./$(DEPDIR)/ec.Po \ + ./$(DEPDIR)/ecparam.Po ./$(DEPDIR)/enc.Po \ + ./$(DEPDIR)/errstr.Po ./$(DEPDIR)/gendh.Po \ + ./$(DEPDIR)/gendsa.Po ./$(DEPDIR)/genpkey.Po \ + ./$(DEPDIR)/genrsa.Po ./$(DEPDIR)/nseq.Po ./$(DEPDIR)/ocsp.Po \ + ./$(DEPDIR)/openssl.Po ./$(DEPDIR)/passwd.Po \ + ./$(DEPDIR)/pkcs12.Po ./$(DEPDIR)/pkcs7.Po \ + ./$(DEPDIR)/pkcs8.Po ./$(DEPDIR)/pkey.Po \ + ./$(DEPDIR)/pkeyparam.Po ./$(DEPDIR)/pkeyutl.Po \ + ./$(DEPDIR)/prime.Po ./$(DEPDIR)/rand.Po ./$(DEPDIR)/req.Po \ + ./$(DEPDIR)/rsa.Po ./$(DEPDIR)/rsautl.Po ./$(DEPDIR)/s_cb.Po \ + ./$(DEPDIR)/s_client.Po ./$(DEPDIR)/s_server.Po \ + ./$(DEPDIR)/s_socket.Po ./$(DEPDIR)/s_time.Po \ + ./$(DEPDIR)/sess_id.Po ./$(DEPDIR)/smime.Po \ + ./$(DEPDIR)/speed.Po ./$(DEPDIR)/spkac.Po ./$(DEPDIR)/ts.Po \ + ./$(DEPDIR)/verify.Po ./$(DEPDIR)/version.Po \ + ./$(DEPDIR)/x509.Po compat/$(DEPDIR)/clock_gettime_osx.Po \ + compat/$(DEPDIR)/poll_win.Po compat/$(DEPDIR)/strtonum.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -390,7 +416,7 @@ openssl_SOURCES = apps.c asn1pars.c ca.c ciphers.c crl.c crl2p7.c \ s_client.c s_server.c s_socket.c s_time.c sess_id.c smime.c \ speed.c spkac.c ts.c verify.c version.c x509.c $(am__append_1) \ $(am__append_2) $(am__append_3) $(am__append_4) \ - $(am__append_5) $(am__append_6) + $(am__append_5) $(am__append_6) $(am__append_7) noinst_HEADERS = apps.h progs.h s_apps.h testdsa.h testrsa.h \ timeouts.h EXTRA_DIST = cert.pem openssl.cnf x509v3.cnf CMakeLists.txt @@ -415,8 +441,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/Makefile.am.common $(am__empty): @@ -485,6 +511,8 @@ compat/$(DEPDIR)/$(am__dirstamp): @: > compat/$(DEPDIR)/$(am__dirstamp) compat/poll_win.$(OBJEXT): compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) +compat/clock_gettime_osx.$(OBJEXT): compat/$(am__dirstamp) \ + compat/$(DEPDIR)/$(am__dirstamp) compat/strtonum.$(OBJEXT): compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) @@ -499,59 +527,66 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apps.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apps_posix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apps_win.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1pars.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ca.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/certhash.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/certhash_win.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ciphers.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crl2p7.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dgst.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dh.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dhparam.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsaparam.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecparam.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errstr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gendh.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gendsa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genpkey.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genrsa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nseq.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocsp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openssl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkcs12.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkcs7.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkcs8.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkeyparam.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkeyutl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rand.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/req.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsautl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_cb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_client.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_server.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_socket.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sess_id.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speed.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spkac.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ts.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x509.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/poll_win.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strtonum.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apps.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apps_posix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apps_win.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1pars.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ca.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/certhash.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/certhash_win.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ciphers.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crl2p7.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dgst.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dh.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dhparam.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsaparam.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecparam.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errstr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gendh.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gendsa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genpkey.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genrsa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nseq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocsp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openssl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkcs12.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkcs7.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkcs8.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkeyparam.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkeyutl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rand.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/req.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsautl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_cb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_client.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_server.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_socket.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sess_id.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speed.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spkac.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ts.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x509.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/clock_gettime_osx.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/poll_win.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -678,7 +713,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -752,7 +790,60 @@ clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) compat/$(DEPDIR) + -rm -f ./$(DEPDIR)/apps.Po + -rm -f ./$(DEPDIR)/apps_posix.Po + -rm -f ./$(DEPDIR)/apps_win.Po + -rm -f ./$(DEPDIR)/asn1pars.Po + -rm -f ./$(DEPDIR)/ca.Po + -rm -f ./$(DEPDIR)/certhash.Po + -rm -f ./$(DEPDIR)/certhash_win.Po + -rm -f ./$(DEPDIR)/ciphers.Po + -rm -f ./$(DEPDIR)/crl.Po + -rm -f ./$(DEPDIR)/crl2p7.Po + -rm -f ./$(DEPDIR)/dgst.Po + -rm -f ./$(DEPDIR)/dh.Po + -rm -f ./$(DEPDIR)/dhparam.Po + -rm -f ./$(DEPDIR)/dsa.Po + -rm -f ./$(DEPDIR)/dsaparam.Po + -rm -f ./$(DEPDIR)/ec.Po + -rm -f ./$(DEPDIR)/ecparam.Po + -rm -f ./$(DEPDIR)/enc.Po + -rm -f ./$(DEPDIR)/errstr.Po + -rm -f ./$(DEPDIR)/gendh.Po + -rm -f ./$(DEPDIR)/gendsa.Po + -rm -f ./$(DEPDIR)/genpkey.Po + -rm -f ./$(DEPDIR)/genrsa.Po + -rm -f ./$(DEPDIR)/nseq.Po + -rm -f ./$(DEPDIR)/ocsp.Po + -rm -f ./$(DEPDIR)/openssl.Po + -rm -f ./$(DEPDIR)/passwd.Po + -rm -f ./$(DEPDIR)/pkcs12.Po + -rm -f ./$(DEPDIR)/pkcs7.Po + -rm -f ./$(DEPDIR)/pkcs8.Po + -rm -f ./$(DEPDIR)/pkey.Po + -rm -f ./$(DEPDIR)/pkeyparam.Po + -rm -f ./$(DEPDIR)/pkeyutl.Po + -rm -f ./$(DEPDIR)/prime.Po + -rm -f ./$(DEPDIR)/rand.Po + -rm -f ./$(DEPDIR)/req.Po + -rm -f ./$(DEPDIR)/rsa.Po + -rm -f ./$(DEPDIR)/rsautl.Po + -rm -f ./$(DEPDIR)/s_cb.Po + -rm -f ./$(DEPDIR)/s_client.Po + -rm -f ./$(DEPDIR)/s_server.Po + -rm -f ./$(DEPDIR)/s_socket.Po + -rm -f ./$(DEPDIR)/s_time.Po + -rm -f ./$(DEPDIR)/sess_id.Po + -rm -f ./$(DEPDIR)/smime.Po + -rm -f ./$(DEPDIR)/speed.Po + -rm -f ./$(DEPDIR)/spkac.Po + -rm -f ./$(DEPDIR)/ts.Po + -rm -f ./$(DEPDIR)/verify.Po + -rm -f ./$(DEPDIR)/version.Po + -rm -f ./$(DEPDIR)/x509.Po + -rm -f compat/$(DEPDIR)/clock_gettime_osx.Po + -rm -f compat/$(DEPDIR)/poll_win.Po + -rm -f compat/$(DEPDIR)/strtonum.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -799,7 +890,60 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) compat/$(DEPDIR) + -rm -f ./$(DEPDIR)/apps.Po + -rm -f ./$(DEPDIR)/apps_posix.Po + -rm -f ./$(DEPDIR)/apps_win.Po + -rm -f ./$(DEPDIR)/asn1pars.Po + -rm -f ./$(DEPDIR)/ca.Po + -rm -f ./$(DEPDIR)/certhash.Po + -rm -f ./$(DEPDIR)/certhash_win.Po + -rm -f ./$(DEPDIR)/ciphers.Po + -rm -f ./$(DEPDIR)/crl.Po + -rm -f ./$(DEPDIR)/crl2p7.Po + -rm -f ./$(DEPDIR)/dgst.Po + -rm -f ./$(DEPDIR)/dh.Po + -rm -f ./$(DEPDIR)/dhparam.Po + -rm -f ./$(DEPDIR)/dsa.Po + -rm -f ./$(DEPDIR)/dsaparam.Po + -rm -f ./$(DEPDIR)/ec.Po + -rm -f ./$(DEPDIR)/ecparam.Po + -rm -f ./$(DEPDIR)/enc.Po + -rm -f ./$(DEPDIR)/errstr.Po + -rm -f ./$(DEPDIR)/gendh.Po + -rm -f ./$(DEPDIR)/gendsa.Po + -rm -f ./$(DEPDIR)/genpkey.Po + -rm -f ./$(DEPDIR)/genrsa.Po + -rm -f ./$(DEPDIR)/nseq.Po + -rm -f ./$(DEPDIR)/ocsp.Po + -rm -f ./$(DEPDIR)/openssl.Po + -rm -f ./$(DEPDIR)/passwd.Po + -rm -f ./$(DEPDIR)/pkcs12.Po + -rm -f ./$(DEPDIR)/pkcs7.Po + -rm -f ./$(DEPDIR)/pkcs8.Po + -rm -f ./$(DEPDIR)/pkey.Po + -rm -f ./$(DEPDIR)/pkeyparam.Po + -rm -f ./$(DEPDIR)/pkeyutl.Po + -rm -f ./$(DEPDIR)/prime.Po + -rm -f ./$(DEPDIR)/rand.Po + -rm -f ./$(DEPDIR)/req.Po + -rm -f ./$(DEPDIR)/rsa.Po + -rm -f ./$(DEPDIR)/rsautl.Po + -rm -f ./$(DEPDIR)/s_cb.Po + -rm -f ./$(DEPDIR)/s_client.Po + -rm -f ./$(DEPDIR)/s_server.Po + -rm -f ./$(DEPDIR)/s_socket.Po + -rm -f ./$(DEPDIR)/s_time.Po + -rm -f ./$(DEPDIR)/sess_id.Po + -rm -f ./$(DEPDIR)/smime.Po + -rm -f ./$(DEPDIR)/speed.Po + -rm -f ./$(DEPDIR)/spkac.Po + -rm -f ./$(DEPDIR)/ts.Po + -rm -f ./$(DEPDIR)/verify.Po + -rm -f ./$(DEPDIR)/version.Po + -rm -f ./$(DEPDIR)/x509.Po + -rm -f compat/$(DEPDIR)/clock_gettime_osx.Po + -rm -f compat/$(DEPDIR)/poll_win.Po + -rm -f compat/$(DEPDIR)/strtonum.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -822,7 +966,7 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-exec-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ diff --git a/apps/openssl/apps.c b/apps/openssl/apps.c index a63bbf9c..2297b5bf 100644 --- a/apps/openssl/apps.c +++ b/apps/openssl/apps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.c,v 1.44 2017/08/12 21:04:33 jsing Exp $ */ +/* $OpenBSD: apps.c,v 1.51 2019/02/09 15:49:21 inoguchi Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -583,9 +583,8 @@ load_pkcs12(BIO *err, BIO *in, const char *desc, pem_password_cb *pem_cb, } ret = PKCS12_parse(p12, pass, pkey, cert, ca); -die: - if (p12) - PKCS12_free(p12); + die: + PKCS12_free(p12); return ret; } @@ -643,7 +642,7 @@ load_cert(BIO *err, const char *file, int format, const char *pass, goto end; } -end: + end: if (x == NULL) { BIO_printf(err, "unable to load certificate\n"); ERR_print_errors(err); @@ -706,7 +705,7 @@ load_key(BIO *err, const char *file, int format, int maybe_stdin, BIO_printf(err, "bad input format specified for key file\n"); goto end; } -end: + end: BIO_free(key); if (pkey == NULL) { BIO_printf(err, "unable to load %s\n", key_descrip); @@ -783,7 +782,7 @@ load_pubkey(BIO *err, const char *file, int format, int maybe_stdin, goto end; } -end: + end: BIO_free(key); if (pkey == NULL) BIO_printf(err, "unable to load %s\n", key_descrip); @@ -828,7 +827,7 @@ load_netscape_key(BIO *err, BIO *key, const char *file, EVP_PKEY_set1_RSA(pkey, rsa); return pkey; -error: + error: BUF_MEM_free(buf); EVP_PKEY_free(pkey); return NULL; @@ -899,9 +898,8 @@ load_certs_crls(BIO *err, const char *file, int format, const char *pass, if (pcrls && sk_X509_CRL_num(*pcrls) > 0) rv = 1; -end: - if (xis) - sk_X509_INFO_pop_free(xis, X509_INFO_free); + end: + sk_X509_INFO_pop_free(xis, X509_INFO_free); if (rv == 0) { if (pcerts) { @@ -1066,7 +1064,7 @@ copy_extensions(X509 *x, X509_REQ *req, int copy_type) ret = 1; -end: + end: sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); return ret; @@ -1181,7 +1179,7 @@ setup_verify(BIO *bp, char *CAfile, char *CApath) ERR_clear_error(); return store; -end: + end: X509_STORE_free(store); return NULL; } @@ -1310,11 +1308,9 @@ load_serial(char *serialfile, int create, ASN1_INTEGER **retai) ai = NULL; } -err: - if (in != NULL) - BIO_free(in); - if (ai != NULL) - ASN1_INTEGER_free(ai); + err: + BIO_free(in); + ASN1_INTEGER_free(ai); return (ret); } @@ -1358,11 +1354,9 @@ save_serial(char *serialfile, char *suffix, BIGNUM *serial, ai = NULL; } -err: - if (out != NULL) - BIO_free_all(out); - if (ai != NULL) - ASN1_INTEGER_free(ai); + err: + BIO_free_all(out); + ASN1_INTEGER_free(ai); return (ret); } @@ -1405,7 +1399,7 @@ rotate_serial(char *serialfile, char *new_suffix, char *old_suffix) } return 1; -err: + err: return 0; } @@ -1430,8 +1424,8 @@ rand_serial(BIGNUM *b, ASN1_INTEGER *ai) ret = 1; -error: - if (!b) + error: + if (b != btmp) BN_free(btmp); return ret; @@ -1496,13 +1490,10 @@ load_index(char *dbfile, DB_ATTR *db_attr) } } -err: - if (dbattr_conf) - NCONF_free(dbattr_conf); - if (tmpdb) - TXT_DB_free(tmpdb); - if (in) - BIO_free_all(in); + err: + NCONF_free(dbattr_conf); + TXT_DB_free(tmpdb); + BIO_free_all(in); return retdb; } @@ -1572,7 +1563,7 @@ save_index(const char *file, const char *suffix, CA_DB *db) return 1; -err: + err: return 0; } @@ -1667,7 +1658,7 @@ rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix) } return 1; -err: + err: return 0; } @@ -1675,8 +1666,7 @@ void free_index(CA_DB *db) { if (db) { - if (db->db) - TXT_DB_free(db->db); + TXT_DB_free(db->db); free(db); } } @@ -1831,11 +1821,11 @@ parse_name(char *subject, long chtype, int multirdn) } goto done; -error: + error: X509_NAME_free(name); name = NULL; -done: + done: free(ne_values); free(ne_types); free(mval); @@ -1945,8 +1935,7 @@ args_verify(char ***pargs, int *pargc, int *badarg, BIO *err, return 0; if (*badarg) { - if (*pm) - X509_VERIFY_PARAM_free(*pm); + X509_VERIFY_PARAM_free(*pm); *pm = NULL; goto end; } @@ -1970,7 +1959,7 @@ args_verify(char ***pargs, int *pargc, int *badarg, BIO *err, if (at_time) X509_VERIFY_PARAM_set_time(*pm, at_time); -end: + end: (*pargs)++; if (pargc) @@ -2075,6 +2064,7 @@ policies_print(BIO *out, X509_STORE_CTX *ctx) nodes_print(out, "Authority", X509_policy_tree_get0_policies(tree)); nodes_print(out, "User", X509_policy_tree_get0_user_policies(tree)); + if (free_out) BIO_free(out); } @@ -2316,17 +2306,29 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed, } } -done: + done: if (argsused != NULL) *argsused = i; return (0); -toomany: + toomany: fprintf(stderr, "too many arguments\n"); return (1); -unknown: + unknown: fprintf(stderr, "unknown option '%s'\n", arg); return (1); } + +void +show_cipher(const OBJ_NAME *name, void *arg) +{ + int *n = arg; + + if (!islower((unsigned char)*name->name)) + return; + + fprintf(stderr, " -%-24s%s", name->name, (++*n % 3 != 0 ? "" : "\n")); +} + diff --git a/apps/openssl/apps.h b/apps/openssl/apps.h index 4276e533..bb2340a5 100644 --- a/apps/openssl/apps.h +++ b/apps/openssl/apps.h @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.h,v 1.19 2016/08/30 14:34:59 deraadt Exp $ */ +/* $OpenBSD: apps.h,v 1.22 2019/02/09 06:27:37 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -277,9 +277,10 @@ unsigned char *next_protos_parse(unsigned short *outlen, const char *in); int app_isdir(const char *); -#define TM_START 0 -#define TM_STOP 1 -double app_tminterval (int stop, int usertime); +#define TM_RESET 0 +#define TM_GET 1 +double app_timer_real(int); +double app_timer_user(int); #define OPENSSL_NO_SSL_INTERN @@ -320,4 +321,6 @@ void options_usage(struct option *opts); int options_parse(int argc, char **argv, struct option *opts, char **unnamed, int *argsused); +void show_cipher(const OBJ_NAME *name, void *arg); + #endif diff --git a/apps/openssl/apps_posix.c b/apps/openssl/apps_posix.c index 67cd4650..cdcf8213 100644 --- a/apps/openssl/apps_posix.c +++ b/apps/openssl/apps_posix.c @@ -116,31 +116,42 @@ * Functions that need to be overridden by non-POSIX operating systems. */ -#include +#include +#include -#include +#include #include "apps.h" double -app_tminterval(int stop, int usertime) +app_timer_real(int get) { - double ret = 0; - struct tms rus; - clock_t now = times(&rus); - static clock_t tmstart; + static struct timespec start; + struct timespec elapsed, now; - if (usertime) - now = rus.tms_utime; - - if (stop == TM_START) - tmstart = now; - else { - long int tck = sysconf(_SC_CLK_TCK); - ret = (now - tmstart) / (double) tck; + clock_gettime(CLOCK_MONOTONIC, &now); + if (get) { + timespecsub(&now, &start, &elapsed); + return elapsed.tv_sec + elapsed.tv_nsec / 1000000000.0; } + start = now; + return 0.0; +} + +double +app_timer_user(int get) +{ + static struct timeval start; + struct timeval elapsed; + struct rusage now; - return (ret); + getrusage(RUSAGE_SELF, &now); + if (get) { + timersub(&now.ru_utime, &start, &elapsed); + return elapsed.tv_sec + elapsed.tv_usec / 1000000.0; + } + start = now.ru_utime; + return 0.0; } int diff --git a/apps/openssl/apps_win.c b/apps/openssl/apps_win.c index 37bfcc99..364c033b 100644 --- a/apps/openssl/apps_win.c +++ b/apps/openssl/apps_win.c @@ -13,7 +13,21 @@ #include "apps.h" double -app_tminterval(int stop, int usertime) +app_timer_real(int get) +{ + static __int64 start; + __int64 now; + + now = GetTickCount64(); + if (get) { + return (now - start) / 1000.0; + } + start = now; + return 0.0; +} + +double +app_timer_user(int stop) { static unsigned __int64 tmstart; union { @@ -22,13 +36,11 @@ app_tminterval(int stop, int usertime) } ct, et, kt, ut; GetProcessTimes(GetCurrentProcess(), &ct.ft, &et.ft, &kt.ft, &ut.ft); - - if (stop == TM_START) { - tmstart = ut.u64 + kt.u64; - } else { + if (stop) return (ut.u64 + kt.u64 - tmstart) / (double) 10000000; - } - return 0; + + tmstart = ut.u64 + kt.u64; + return 0.0; } int diff --git a/apps/openssl/asn1pars.c b/apps/openssl/asn1pars.c index fe66b359..a17584e8 100644 --- a/apps/openssl/asn1pars.c +++ b/apps/openssl/asn1pars.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1pars.c,v 1.7 2017/01/20 08:57:11 deraadt Exp $ */ +/* $OpenBSD: asn1pars.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -408,7 +408,7 @@ asn1parse_main(int argc, char **argv) goto end; } ret = 0; -end: + end: BIO_free(derout); BIO_free(in); BIO_free_all(out); @@ -416,8 +416,7 @@ asn1parse_main(int argc, char **argv) if (ret != 0) ERR_print_errors(bio_err); BUF_MEM_free(buf); - if (at != NULL) - ASN1_TYPE_free(at); + ASN1_TYPE_free(at); sk_OPENSSL_STRING_free(asn1pars_config.osk); OBJ_cleanup(); @@ -465,7 +464,7 @@ do_generate(BIO * bio, char *genstr, char *genconf, BUF_MEM * buf) ASN1_TYPE_free(atyp); return len; -conferr: + conferr: if (errline > 0) BIO_printf(bio, "Error on line %ld of config file '%s'\n", @@ -473,7 +472,7 @@ do_generate(BIO * bio, char *genstr, char *genconf, BUF_MEM * buf) else BIO_printf(bio, "Error loading config file '%s'\n", genconf); -err: + err: NCONF_free(cnf); ASN1_TYPE_free(atyp); diff --git a/apps/openssl/ca.c b/apps/openssl/ca.c index 5414a921..2e798495 100644 --- a/apps/openssl/ca.c +++ b/apps/openssl/ca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ca.c,v 1.25 2017/05/08 21:12:36 beck Exp $ */ +/* $OpenBSD: ca.c,v 1.26 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -497,7 +497,7 @@ ca_main(int argc, char **argv) rev_type = REV_CA_COMPROMISE; } else { -bad: + bad: if (errstr) BIO_printf(bio_err, "invalid argument %s: %s\n", *argv, errstr); @@ -1310,7 +1310,7 @@ ca_main(int argc, char **argv) /*****************************************************************/ ret = 0; -err: + err: free(tofree); BIO_free_all(Cout); @@ -1407,7 +1407,7 @@ certify(X509 ** xret, char *infile, EVP_PKEY * pkey, X509 * x509, verbose, req, ext_sect, lconf, certopt, nameopt, default_op, ext_copy, selfsign); -err: + err: if (req != NULL) X509_REQ_free(req); if (in != NULL) @@ -1464,7 +1464,7 @@ certify_cert(X509 ** xret, char *infile, EVP_PKEY * pkey, X509 * x509, verbose, rreq, ext_sect, lconf, certopt, nameopt, default_op, ext_copy, 0); -err: + err: if (rreq != NULL) X509_REQ_free(rreq); if (req != NULL) @@ -1969,7 +1969,7 @@ do_body(X509 ** xret, EVP_PKEY * pkey, X509 * x509, const EVP_MD * dgst, goto err; } ok = 1; -err: + err: for (i = 0; i < DB_NUMBER; i++) free(row[i]); @@ -2126,7 +2126,7 @@ certify_spkac(X509 ** xret, char *infile, EVP_PKEY * pkey, X509 * x509, verbose, req, ext_sect, lconf, certopt, nameopt, default_op, ext_copy, 0); -err: + err: if (req != NULL) X509_REQ_free(req); if (parms != NULL) @@ -2248,7 +2248,7 @@ do_revoke(X509 * x509, CA_DB * db, int type, char *value) } ok = 1; -err: + err: for (i = 0; i < DB_NUMBER; i++) free(row[i]); @@ -2320,7 +2320,7 @@ get_certificate_status(const char *serial, CA_DB * db) ok = -1; } -err: + err: for (i = 0; i < DB_NUMBER; i++) free(row[i]); @@ -2383,7 +2383,7 @@ do_updatedb(CA_DB * db) } } -err: + err: ASN1_UTCTIME_free(a_tm); free(a_tm_s); @@ -2534,7 +2534,7 @@ make_revoked(X509_REVOKED * rev, const char *str) else ret = 1; -err: + err: free(tmp); ASN1_OBJECT_free(hold); @@ -2681,7 +2681,7 @@ unpack_revinfo(ASN1_TIME ** prevtm, int *preason, ASN1_OBJECT ** phold, ret = 1; -err: + err: free(tmp); if (!phold) diff --git a/apps/openssl/cert.pem b/apps/openssl/cert.pem index ff33c412..92263add 100644 --- a/apps/openssl/cert.pem +++ b/apps/openssl/cert.pem @@ -1,4 +1,352 @@ -# $OpenBSD: cert.pem,v 1.15 2017/02/24 10:42:00 sthen Exp $ +# $OpenBSD: cert.pem,v 1.19 2019/04/04 12:42:01 sthen Exp $ +### /C=ES/CN=Autoridad de Certificacion Firmaprofesional CIF A62634068 + +=== /C=ES/CN=Autoridad de Certificacion Firmaprofesional CIF A62634068 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 6047274297262753887 (0x53ec3beefbb2485f) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: May 20 08:38:15 2009 GMT + Not After : Dec 31 08:38:15 2030 GMT + Subject: C=ES, CN=Autoridad de Certificacion Firmaprofesional CIF A62634068 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE, pathlen:1 + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 65:CD:EB:AB:35:1E:00:3E:7E:D5:74:C0:1C:B4:73:47:0E:1A:64:2F + X509v3 Certificate Policies: + Policy: X509v3 Any Policy + CPS: http://www.firmaprofesional.com/cps + User Notice: + Explicit Text: + +SHA1 Fingerprint=AE:C5:FB:3F:C8:E1:BF:C4:E5:4F:03:07:5A:9A:E8:00:B7:F7:B6:FA +SHA256 Fingerprint=04:04:80:28:BF:1F:28:64:D4:8F:9A:D4:D8:32:94:36:6A:82:88:56:55:3F:3B:14:30:3F:90:14:7F:5D:40:EF +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UE +BhMCRVMxQjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1h +cHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEy +MzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUg +Q2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBBNjI2MzQwNjgwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDDUtd9 +thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQM +cas9UX4PB99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefG +L9ItWY16Ck6WaVICqjaY7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15i +NA9wBj4gGFrO93IbJWyTdBSTo3OxDqqHECNZXyAFGUftaI6SEspd/NYrspI8IM/h +X68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyIplD9amML9ZMWGxmPsu2b +m8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctXMbScyJCy +Z/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirja +EbsXLZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/T +KI8xWVvTyQKmtFLKbpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF +6NkBiDkal4ZkQdU7hwxu+g/GvUgUvzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVh +OSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNHDhpkLzCBpgYD +VR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp +cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBv +ACAAZABlACAAbABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBl +AGwAbwBuAGEAIAAwADgAMAAxADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF +661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx51tkljYyGOylMnfX40S2wBEqgLk9 +am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qkR71kMrv2JYSiJ0L1 +ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaPT481 +PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS +3a/DTg4fJl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5k +SeTy36LssUzAKh3ntLFlosS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF +3dvd6qJ2gHN99ZwExEWN57kci57q13XRcrHedUTnQn3iV2t93Jm8PYMo6oCTjcVM +ZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0g +StRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/icz +Q0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQB +jLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +### AC Camerfirma S.A. + +=== /C=EU/L=Madrid (see current address at www.camerfirma.com/address)/serialNumber=A82743287/O=AC Camerfirma S.A./CN=Chambers of Commerce Root - 2008 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 11806822484801597146 (0xa3da427ea4b1aeda) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Aug 1 12:29:50 2008 GMT + Not After : Jul 31 12:29:50 2038 GMT + Subject: C=EU, L=Madrid (see current address at www.camerfirma.com/address)/serialNumber=A82743287, O=AC Camerfirma S.A., CN=Chambers of Commerce Root - 2008 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE, pathlen:12 + X509v3 Subject Key Identifier: + F9:24:AC:0F:B2:B5:F8:79:C0:FA:60:88:1B:C4:D9:4D:02:9E:17:19 + X509v3 Authority Key Identifier: + keyid:F9:24:AC:0F:B2:B5:F8:79:C0:FA:60:88:1B:C4:D9:4D:02:9E:17:19 + DirName:/C=EU/L=Madrid (see current address at www.camerfirma.com/address)/serialNumber=A82743287/O=AC Camerfirma S.A./CN=Chambers of Commerce Root - 2008 + serial:A3:DA:42:7E:A4:B1:AE:DA + + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Certificate Policies: + Policy: X509v3 Any Policy + CPS: http://policy.camerfirma.com + +SHA1 Fingerprint=78:6A:74:AC:76:AB:14:7F:9C:6A:30:50:BA:9E:A8:7E:FE:9A:CE:3C +SHA256 Fingerprint=06:3E:4A:FA:C4:91:DF:D3:32:F3:08:9B:85:42:E9:46:17:D8:93:D7:FE:94:4E:10:A7:93:7E:E2:9D:96:93:C0 +-----BEGIN CERTIFICATE----- +MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD +VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 +IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 +MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xKTAnBgNVBAMTIENoYW1iZXJz +IG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEyMjk1MFoXDTM4MDcz +MTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBj +dXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIw +EAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEp +MCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0G +CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW9 +28sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKAXuFixrYp4YFs8r/lfTJq +VKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorjh40G072Q +DuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR +5gN/ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfL +ZEFHcpOrUMPrCXZkNNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05a +Sd+pZgvMPMZ4fKecHePOjlO+Bd5gD2vlGts/4+EhySnB8esHnFIbAURRPHsl18Tl +UlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331lubKgdaX8ZSD6e2wsWsSaR6s ++12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ0wlf2eOKNcx5 +Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj +ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAx +hduub+84Mxh2EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNV +HQ4EFgQU+SSsD7K1+HnA+mCIG8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1 ++HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpN +YWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29t +L2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVy +ZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAt +IDIwMDiCCQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRV +HSAAMCowKAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20w +DQYJKoZIhvcNAQEFBQADggIBAJASryI1wqM58C7e6bXpeHxIvj99RZJe6dqxGfwW +PJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH3qLPaYRgM+gQDROpI9CF +5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbURWpGqOt1 +glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaH +FoI6M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2 +pSB7+R5KBWIBpih1YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MD +xvbxrN8y8NmBGuScvfaAFPDRLLmF9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QG +tjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq +jktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1De +fhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg +OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZ +d0jQ +-----END CERTIFICATE----- +=== /C=EU/L=Madrid (see current address at www.camerfirma.com/address)/serialNumber=A82743287/O=AC Camerfirma S.A./CN=Global Chambersign Root - 2008 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 14541511773111788494 (0xc9cdd3e9d57d23ce) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Aug 1 12:31:40 2008 GMT + Not After : Jul 31 12:31:40 2038 GMT + Subject: C=EU, L=Madrid (see current address at www.camerfirma.com/address)/serialNumber=A82743287, O=AC Camerfirma S.A., CN=Global Chambersign Root - 2008 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE, pathlen:12 + X509v3 Subject Key Identifier: + B9:09:CA:9C:1E:DB:D3:6C:3A:6B:AE:ED:54:F1:5B:93:06:35:2E:5E + X509v3 Authority Key Identifier: + keyid:B9:09:CA:9C:1E:DB:D3:6C:3A:6B:AE:ED:54:F1:5B:93:06:35:2E:5E + DirName:/C=EU/L=Madrid (see current address at www.camerfirma.com/address)/serialNumber=A82743287/O=AC Camerfirma S.A./CN=Global Chambersign Root - 2008 + serial:C9:CD:D3:E9:D5:7D:23:CE + + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Certificate Policies: + Policy: X509v3 Any Policy + CPS: http://policy.camerfirma.com + +SHA1 Fingerprint=4A:BD:EE:EC:95:0D:35:9C:89:AE:C7:52:A1:2C:5B:29:F6:D6:AA:0C +SHA256 Fingerprint=13:63:35:43:93:34:A7:69:80:16:A0:D3:24:DE:72:28:4E:07:9D:7B:52:20:BB:8F:BD:74:78:16:EE:BE:BA:CA +-----BEGIN CERTIFICATE----- +MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYD +VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 +IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 +MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD +aGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMxNDBaFw0zODA3MzEx +MjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3Vy +cmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAG +A1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAl +BgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZI +hvcNAQEBBQADggIPADCCAgoCggIBAMDfVtPkOpt2RbQT2//BthmLN0EYlVJH6xed +KYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXfXjaOcNFccUMd2drvXNL7 +G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0ZJJ0YPP2 +zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4 +ddPB/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyG +HoiMvvKRhI9lNNgATH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2 +Id3UwD2ln58fQ1DJu7xsepeY7s2MH/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3V +yJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfeOx2YItaswTXbo6Al/3K1dh3e +beksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSFHTynyQbehP9r +6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh +wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsog +zCtLkykPAgMBAAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQW +BBS5CcqcHtvTbDprru1U8VuTBjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDpr +ru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UEBhMCRVUxQzBBBgNVBAcTOk1hZHJp +ZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJmaXJtYS5jb20vYWRk +cmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJmaXJt +YSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiC +CQDJzdPp1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCow +KAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZI +hvcNAQEFBQADggIBAICIf3DekijZBZRG/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZ +UohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6ReAJ3spED8IXDneRRXoz +X1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/x +fxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVz +a2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yyd +Yhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMd +SqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9O +AP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso +M0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4ge +v8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z +09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B +-----END CERTIFICATE----- + +### ACCV + +=== /CN=ACCVRAIZ1/OU=PKIACCV/O=ACCV/C=ES +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 6828503384748696800 (0x5ec3b7a6437fa4e0) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: May 5 09:37:37 2011 GMT + Not After : Dec 31 09:37:37 2030 GMT + Subject: CN=ACCVRAIZ1, OU=PKIACCV, O=ACCV, C=ES + X509v3 extensions: + Authority Information Access: + CA Issuers - URI:http://www.accv.es/fileadmin/Archivos/certificados/raizaccv1.crt + OCSP - URI:http://ocsp.accv.es + + X509v3 Subject Key Identifier: + D2:87:B4:E3:DF:37:27:93:55:F6:56:EA:81:E5:36:CC:8C:1E:3F:BD + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + keyid:D2:87:B4:E3:DF:37:27:93:55:F6:56:EA:81:E5:36:CC:8C:1E:3F:BD + + X509v3 Certificate Policies: + Policy: X509v3 Any Policy + User Notice: + Explicit Text: + CPS: http://www.accv.es/legislacion_c.htm + + X509v3 CRL Distribution Points: + + Full Name: + URI:http://www.accv.es/fileadmin/Archivos/certificados/raizaccv1_der.crl + + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Alternative Name: + email:accv@accv.es +SHA1 Fingerprint=93:05:7A:88:15:C6:4F:CE:88:2F:FA:91:16:52:28:78:BC:53:64:17 +SHA256 Fingerprint=9A:6E:C0:12:E1:A7:DA:9D:BE:34:19:4D:47:8A:D7:C0:DB:18:22:FB:07:1D:F1:29:81:49:6E:D1:04:38:41:13 +-----BEGIN CERTIFICATE----- +MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UE +AwwJQUNDVlJBSVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQsw +CQYDVQQGEwJFUzAeFw0xMTA1MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQ +BgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwHUEtJQUNDVjENMAsGA1UECgwEQUND +VjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCb +qau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gMjmoY +HtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWo +G2ioPej0RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpA +lHPrzg5XPAOBOp0KoVdDaaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhr +IA8wKFSVf+DuzgpmndFALW4ir50awQUZ0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/ +0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDGWuzndN9wrqODJerWx5eH +k6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs78yM2x/47 +4KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMO +m3WR5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpa +cXpkatcnYGMN285J9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPl +uUsXQA+xtrn13k/c4LOsOxFwYIRKQ26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYI +KwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRwOi8vd3d3LmFjY3YuZXMvZmls +ZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEuY3J0MB8GCCsG +AQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 +VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeT +VfZW6oHlNsyMHj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIG +CCsGAQUFBwICMIIBFB6CARAAQQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUA +cgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBhAO0AegAgAGQAZQAgAGwAYQAgAEEA +QwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUAYwBuAG8AbABvAGcA +7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBjAHQA +cgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAA +QwBQAFMAIABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUA +czAwBggrBgEFBQcCARYkaHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2Mu +aHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRt +aW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2MV9kZXIuY3JsMA4GA1Ud +DwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZIhvcNAQEF +BQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdp +D70ER9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gU +JyCpZET/LtZ1qmxNYEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+m +AM/EKXMRNt6GGT6d7hmKG9Ww7Y49nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepD +vV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJTS+xJlsndQAJxGJ3KQhfnlms +tn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3sCPdK6jT2iWH +7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h +I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szA +h1xA2syVP1XgNce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xF +d3+YJ5oyXSrjhO7FmGYvliAd3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2H +pPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3pEfbRD0tVNEYqi4Y7 +-----END CERTIFICATE----- + +### Actalis S.p.A./03358520967 + +=== /C=IT/L=Milan/O=Actalis S.p.A./03358520967/CN=Actalis Authentication Root CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 6271844772424770508 (0x570a119742c4e3cc) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Sep 22 11:22:02 2011 GMT + Not After : Sep 22 11:22:02 2030 GMT + Subject: C=IT, L=Milan, O=Actalis S.p.A./03358520967, CN=Actalis Authentication Root CA + X509v3 extensions: + X509v3 Subject Key Identifier: + 52:D8:88:3A:C8:9F:78:66:ED:89:F3:7B:38:70:94:C9:02:02:36:D0 + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + keyid:52:D8:88:3A:C8:9F:78:66:ED:89:F3:7B:38:70:94:C9:02:02:36:D0 + + X509v3 Key Usage: critical + Certificate Sign, CRL Sign +SHA1 Fingerprint=F3:73:B3:87:06:5A:28:84:8A:F2:F3:4A:CE:19:2B:DD:C7:8E:9C:AC +SHA256 Fingerprint=55:92:60:84:EC:96:3A:64:B9:6E:2A:BE:01:CE:0B:A8:6A:64:FB:FE:BC:C7:AA:B5:AF:C1:55:B3:7F:D7:60:66 +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE +BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w +MzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC +SVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1 +ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv +UTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX +4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9 +KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/ +gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1Yprb +rxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ +51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2F +be8lEfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxe +KF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4F +v6MGn8i1zeQf1xcGDXqVdFUNaBr8EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbn +fpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5jF66CyCU3nuDuP/jVo23Eek7 +jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLYiDrIn3hm7Ynz +ezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt +ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL +e3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70 +jsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz +WochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V +SM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j +pwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX +X04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok +fcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R +K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU +ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU +LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT +LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- ### AddTrust AB @@ -51,150 +399,441 @@ Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= -----END CERTIFICATE----- -=== /C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Class 1 CA Root + +### AffirmTrust + +=== /C=US/O=AffirmTrust/CN=AffirmTrust Commercial +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 8608355977964138876 (0x7777062726a9b17c) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Jan 29 14:06:06 2010 GMT + Not After : Dec 31 14:06:06 2030 GMT + Subject: C=US, O=AffirmTrust, CN=AffirmTrust Commercial + X509v3 extensions: + X509v3 Subject Key Identifier: + 9D:93:C6:53:8B:5E:CA:AF:3F:9F:1E:0F:E5:99:95:BC:24:F6:94:8F + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign +SHA1 Fingerprint=F9:B5:B6:32:45:5F:9C:BE:EC:57:5F:80:DC:E9:6E:2C:C7:B2:78:B7 +SHA256 Fingerprint=03:76:AB:1D:54:C5:F9:80:3C:E4:B2:E2:01:A0:EE:7E:EF:7B:57:B6:36:E8:A9:3C:9B:8D:48:60:C9:6F:5F:A7 +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP +Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr +ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL +MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1 +yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr +VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/ +nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG +XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj +vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt +Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g +N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC +nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- +=== /C=US/O=AffirmTrust/CN=AffirmTrust Networking Certificate: Data: Version: 3 (0x2) - Serial Number: 1 (0x1) + Serial Number: 8957382827206547757 (0x7c4f04391cd4992d) Signature Algorithm: sha1WithRSAEncryption Validity - Not Before: May 30 10:38:31 2000 GMT - Not After : May 30 10:38:31 2020 GMT - Subject: C=SE, O=AddTrust AB, OU=AddTrust TTP Network, CN=AddTrust Class 1 CA Root + Not Before: Jan 29 14:08:24 2010 GMT + Not After : Dec 31 14:08:24 2030 GMT + Subject: C=US, O=AffirmTrust, CN=AffirmTrust Networking X509v3 extensions: X509v3 Subject Key Identifier: - 95:B1:B4:F0:94:B6:BD:C7:DA:D1:11:09:21:BE:C1:AF:49:FD:10:7B - X509v3 Key Usage: + 07:1F:D2:E7:9C:DA:C2:6E:A2:40:B4:B0:7A:50:10:50:74:C4:C8:BD + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign +SHA1 Fingerprint=29:36:21:02:8B:20:ED:02:F5:66:C5:32:D1:D6:ED:90:9F:45:00:2F +SHA256 Fingerprint=0A:81:EC:5A:92:97:77:F1:45:90:4A:F3:8D:5D:50:9F:66:B5:E2:C5:8F:CD:B5:31:05:8B:0E:17:F3:F0:B4:1B +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y +YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua +kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL +QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp +6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG +yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i +QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO +tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu +QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ +Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u +olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48 +x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- +=== /C=US/O=AffirmTrust/CN=AffirmTrust Premium +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 7893706540734352110 (0x6d8c1446b1a60aee) + Signature Algorithm: sha384WithRSAEncryption + Validity + Not Before: Jan 29 14:10:36 2010 GMT + Not After : Dec 31 14:10:36 2040 GMT + Subject: C=US, O=AffirmTrust, CN=AffirmTrust Premium + X509v3 extensions: + X509v3 Subject Key Identifier: + 9D:C0:67:A6:0C:22:D9:26:F5:45:AB:A6:65:52:11:27:D8:45:AC:63 + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical Certificate Sign, CRL Sign +SHA1 Fingerprint=D8:A6:33:2C:E0:03:6F:B1:85:F6:63:4F:7D:6A:06:65:26:32:28:27 +SHA256 Fingerprint=70:A7:3F:7F:37:6B:60:07:42:48:90:45:34:B1:14:82:D5:BF:0E:69:8E:CC:49:8D:F5:25:77:EB:F2:E9:3B:9A +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz +dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG +A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U +cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf +qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ +JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ ++jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS +s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5 +HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7 +70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG +V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S +qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S +5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia +C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX +OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE +FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2 +KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B +8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ +MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc +0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ +u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF +u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH +YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8 +GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO +RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e +KeC2uAloGRwYQw== +-----END CERTIFICATE----- +=== /C=US/O=AffirmTrust/CN=AffirmTrust Premium ECC +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 8401224907861490260 (0x7497258ac73f7a54) + Signature Algorithm: ecdsa-with-SHA384 + Validity + Not Before: Jan 29 14:20:24 2010 GMT + Not After : Dec 31 14:20:24 2040 GMT + Subject: C=US, O=AffirmTrust, CN=AffirmTrust Premium ECC + X509v3 extensions: + X509v3 Subject Key Identifier: + 9A:AF:29:7A:C0:11:35:35:26:51:30:00:C3:6A:FE:40:D5:AE:D6:3C X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: - keyid:95:B1:B4:F0:94:B6:BD:C7:DA:D1:11:09:21:BE:C1:AF:49:FD:10:7B - DirName:/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Class 1 CA Root - serial:01 + X509v3 Key Usage: critical + Certificate Sign, CRL Sign +SHA1 Fingerprint=B8:23:6B:00:2F:1D:16:86:53:01:55:6C:11:A4:37:CA:EB:FF:C3:BB +SHA256 Fingerprint=BD:71:FD:F6:DA:97:E4:CF:62:D1:64:7A:DD:25:81:B0:7D:79:AD:F8:39:7E:B4:EC:BA:9C:5E:84:88:82:14:23 +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC +VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ +cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ +BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt +VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D +0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9 +ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G +A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs +aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I +flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ== +-----END CERTIFICATE----- -SHA1 Fingerprint=CC:AB:0E:A0:4C:23:01:D6:69:7B:DD:37:9F:CD:12:EB:24:E3:94:9D -SHA256 Fingerprint=8C:72:09:27:9A:C0:4E:27:5E:16:D0:7F:D3:B7:75:E8:01:54:B5:96:80:46:E3:1F:52:DD:25:76:63:24:E9:A7 ------BEGIN CERTIFICATE----- -MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 -b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMw -MTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYD -VQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ul -CDtbKRY654eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6n -tGO0/7Gcrjyvd7ZWxbWroulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyl -dI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1Zmne3yzxbrww2ywkEtvrNTVokMsAsJch -PXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJuiGMx1I4S+6+JNM3GOGvDC -+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8wHQYDVR0O -BBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8E -BTADAQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBl -MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFk -ZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENB -IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxtZBsfzQ3duQH6lmM0MkhHma6X -7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0PhiVYrqW9yTkkz -43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY -eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJl -pz/+0WatC7xrmYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOA -WiFeIc9TVPC6b4nbqKqVz4vjccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= ------END CERTIFICATE----- -=== /C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Public CA Root +### Agencia Catalana de Certificacio (NIF Q-0801176-I) + +=== /C=ES/O=Agencia Catalana de Certificacio (NIF Q-0801176-I)/OU=Serveis Publics de Certificacio/OU=Vegeu https://www.catcert.net/verarrel (c)03/OU=Jerarquia Entitats de Certificacio Catalanes/CN=EC-ACC Certificate: Data: Version: 3 (0x2) - Serial Number: 1 (0x1) + Serial Number: + (Negative)11:d4:c2:14:2b:de:21:eb:57:9d:53:fb:0c:22:3b:ff Signature Algorithm: sha1WithRSAEncryption Validity - Not Before: May 30 10:41:50 2000 GMT - Not After : May 30 10:41:50 2020 GMT - Subject: C=SE, O=AddTrust AB, OU=AddTrust TTP Network, CN=AddTrust Public CA Root + Not Before: Jan 7 23:00:00 2003 GMT + Not After : Jan 7 22:59:59 2031 GMT + Subject: C=ES, O=Agencia Catalana de Certificacio (NIF Q-0801176-I), OU=Serveis Publics de Certificacio, OU=Vegeu https://www.catcert.net/verarrel (c)03, OU=Jerarquia Entitats de Certificacio Catalanes, CN=EC-ACC X509v3 extensions: - X509v3 Subject Key Identifier: - 81:3E:37:D8:92:B0:1F:77:9F:5C:B4:AB:73:AA:E7:F6:34:60:2F:FA - X509v3 Key Usage: + X509v3 Subject Alternative Name: + email:ec_acc@catcert.net + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + A0:C3:8B:44:AA:37:A5:45:BF:97:80:5A:D1:F1:78:A2:9B:E9:5D:8D + X509v3 Certificate Policies: + Policy: 1.3.6.1.4.1.15096.1.3.1.10 + CPS: https://www.catcert.net/verarrel + User Notice: + Explicit Text: Vegeu https://www.catcert.net/verarrel + +SHA1 Fingerprint=28:90:3A:63:5B:52:80:FA:E6:77:4C:0B:6D:A7:D6:BA:A6:4A:F2:E8 +SHA256 Fingerprint=88:49:7F:01:60:2F:31:54:24:6A:E2:8C:4D:5A:EF:10:F1:D8:7E:BB:76:62:6F:4A:E0:B7:F9:5B:A7:96:87:99 +-----BEGIN CERTIFICATE----- +MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB +8zELMAkGA1UEBhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2Vy +dGlmaWNhY2lvIChOSUYgUS0wODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1 +YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYDVQQLEyxWZWdldSBodHRwczovL3d3 +dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UECxMsSmVyYXJxdWlh +IEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMTBkVD +LUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQG +EwJFUzE7MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8g +KE5JRiBRLTA4MDExNzYtSSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBD +ZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZlZ2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQu +bmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJhcnF1aWEgRW50aXRhdHMg +ZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUNDMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R +85iKw5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm +4CgPukLjbo73FCeTae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaV +HMf5NLWUhdWZXqBIoH7nF2W4onW4HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNd +QlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0aE9jD2z3Il3rucO2n5nzbcc8t +lGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw0JDnJwIDAQAB +o4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4 +opvpXY0wfwYDVR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBo +dHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidW +ZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAwDQYJKoZIhvcN +AQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJlF7W2u++AVtd0x7Y +/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNaAl6k +SBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhy +Rp/7SNVel+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOS +Agu+TGbrIP65y7WZf+a2E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xl +nJ2lYJU6Un/10asIbvPuW/mIPX64b24D5EI= +-----END CERTIFICATE----- + +### Amazon + +=== /C=US/O=Amazon/CN=Amazon Root CA 1 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 06:6c:9f:cf:99:bf:8c:0a:39:e2:f0:78:8a:43:e6:96:36:5b:ca + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: May 26 00:00:00 2015 GMT + Not After : Jan 17 00:00:00 2038 GMT + Subject: C=US, O=Amazon, CN=Amazon Root CA 1 + X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: - keyid:81:3E:37:D8:92:B0:1F:77:9F:5C:B4:AB:73:AA:E7:F6:34:60:2F:FA - DirName:/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Public CA Root - serial:01 + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 84:18:CC:85:34:EC:BC:0C:94:94:2E:08:59:9C:C7:B2:10:4E:0A:08 +SHA1 Fingerprint=8D:A7:F9:65:EC:5E:FC:37:91:0F:1C:6E:59:FD:C1:CC:6A:6E:DE:16 +SHA256 Fingerprint=8E:CD:E6:88:4F:3D:87:B1:12:5B:A3:1A:C3:FC:B1:3D:70:16:DE:7F:57:CC:90:4F:E1:CB:97:C6:AE:98:19:6E +-----BEGIN CERTIFICATE----- +MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF +ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 +b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL +MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv +b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj +ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM +9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw +IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6 +VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L +93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm +jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA +A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI +U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs +N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv +o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU +5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy +rqXRfboQnoZsG4q5WTP468SQvvG5 +-----END CERTIFICATE----- +=== /C=US/O=Amazon/CN=Amazon Root CA 2 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 06:6c:9f:d2:96:35:86:9f:0a:0f:e5:86:78:f8:5b:26:bb:8a:37 + Signature Algorithm: sha384WithRSAEncryption + Validity + Not Before: May 26 00:00:00 2015 GMT + Not After : May 26 00:00:00 2040 GMT + Subject: C=US, O=Amazon, CN=Amazon Root CA 2 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + B0:0C:F0:4C:30:F4:05:58:02:48:FD:33:E5:52:AF:4B:84:E3:66:52 +SHA1 Fingerprint=5A:8C:EF:45:D7:A6:98:59:76:7A:8C:8B:44:96:B5:78:CF:47:4B:1A +SHA256 Fingerprint=1B:A5:B2:AA:8C:65:40:1A:82:96:01:18:F8:0B:EC:4F:62:30:4D:83:CE:C4:71:3A:19:C3:9C:01:1E:A4:6D:B4 +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwF +ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 +b24gUm9vdCBDQSAyMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTEL +MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv +b3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK2Wny2cSkxK +gXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4kHbZ +W0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg +1dKmSYXpN+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eLfq0OQ6PBJTYv9K +8nu+NQWpEjTj82R0Yiw9AElaKP4yRLuH3WUnAnE72kr3H9rN9yFVkE8P7K6C4Z9r +2UXTu/Bfh+08LDmG2j/e7HJV63mjrdvdfLC6HM783k81ds8P+HgfajZRRidhW+me +z/CiVX18JYpvL7TFz4QuK/0NURBs+18bvBt+xa47mAExkv8LV/SasrlX6avvDXbR +8O70zoan4G7ptGmh32n2M8ZpLpcTnqWHsFcQgTfJU7O7f/aS0ZzQGPSSbtqDT6Zj +mUyl+17vIWR6IF9sZIUVyzfpYgwLKhbcAS4y2j5L9Z469hdAlO+ekQiG+r5jqFoz +7Mt0Q5X5bGlSNscpb/xVA1wf+5+9R+vnSUeVC06JIglJ4PVhHvG/LopyboBZ/1c6 ++XUyo05f7O0oYtlNc/LMgRdg7c3r3NunysV+Ar3yVAhU/bQtCSwXVEqY0VThUWcI +0u1ufm8/0i2BWSlmy5A5lREedCf+3euvAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMB +Af8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSwDPBMMPQFWAJI/TPlUq9LhONm +UjANBgkqhkiG9w0BAQwFAAOCAgEAqqiAjw54o+Ci1M3m9Zh6O+oAA7CXDpO8Wqj2 +LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY ++gn0oJMsXdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kS +k5Nrp+gvU5LEYFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl +7uxMMne0nxrpS10gxdr9HIcWxkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygm +btmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQgj9sAq+uEjonljYE1x2igGOpm/Hl +urR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbWaQbLU8uz/mtBzUF+ +fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoVYh63 +n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE +76KlXIx3KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H +9jVlpNMKVv/1F2Rs76giJUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT +4PsJYGw= +-----END CERTIFICATE----- +=== /C=US/O=Amazon/CN=Amazon Root CA 3 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 06:6c:9f:d5:74:97:36:66:3f:3b:0b:9a:d9:e8:9e:76:03:f2:4a + Signature Algorithm: ecdsa-with-SHA256 + Validity + Not Before: May 26 00:00:00 2015 GMT + Not After : May 26 00:00:00 2040 GMT + Subject: C=US, O=Amazon, CN=Amazon Root CA 3 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + AB:B6:DB:D7:06:9E:37:AC:30:86:07:91:70:C7:9C:C4:19:B1:78:C0 +SHA1 Fingerprint=0D:44:DD:8C:3C:8C:1A:1A:58:75:64:81:E9:0F:2E:2A:FF:B3:D2:6E +SHA256 Fingerprint=18:CE:6C:FE:7B:F1:4E:60:B2:E3:47:B8:DF:E8:68:CB:31:D0:2E:BB:3A:DA:27:15:69:F5:03:43:B4:6D:B3:A4 +-----BEGIN CERTIFICATE----- +MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5 +MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g +Um9vdCBDQSAzMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG +A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg +Q0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZBf8ANm+gBG1bG8lKl +ui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjrZt6j +QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSr +ttvXBp43rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkr +BqWTrBqYaGFy+uGh0PsceGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteM +YyRIHN8wfdVoOw== +-----END CERTIFICATE----- +=== /C=US/O=Amazon/CN=Amazon Root CA 4 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 06:6c:9f:d7:c1:bb:10:4c:29:43:e5:71:7b:7b:2c:c8:1a:c1:0e + Signature Algorithm: ecdsa-with-SHA384 + Validity + Not Before: May 26 00:00:00 2015 GMT + Not After : May 26 00:00:00 2040 GMT + Subject: C=US, O=Amazon, CN=Amazon Root CA 4 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + D3:EC:C7:3A:65:6E:CC:E1:DA:76:9A:56:FB:9C:F3:86:6D:57:E5:81 +SHA1 Fingerprint=F6:10:84:07:D6:F8:BB:67:98:0C:C2:E2:44:C2:EB:AE:1C:EF:63:BE +SHA256 Fingerprint=E3:5D:28:41:9E:D0:20:25:CF:A6:90:38:CD:62:39:62:45:8D:A5:C6:95:FB:DE:A3:C2:2B:0B:FB:25:89:70:92 +-----BEGIN CERTIFICATE----- +MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5 +MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g +Um9vdCBDQSA0MB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG +A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg +Q0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN/sGKe0uoe0ZLY7Bi +9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri83Bk +M6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WB +MAoGCCqGSM49BAMDA2gAMGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlw +CkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1AE47xDqUEpHJWEadIRNyp4iciuRMStuW +1KyLa2tJElMzrdfkviT8tQp21KW8EA== +-----END CERTIFICATE----- + +### AS Sertifitseerimiskeskus -SHA1 Fingerprint=2A:B6:28:48:5E:78:FB:F3:AD:9E:79:10:DD:6B:DF:99:72:2C:96:E5 -SHA256 Fingerprint=07:91:CA:07:49:B2:07:82:AA:D3:C7:D7:BD:0C:DF:C9:48:58:35:84:3E:B2:D7:99:60:09:CE:43:AB:6C:69:27 ------BEGIN CERTIFICATE----- -MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 -b3JrMSAwHgYDVQQDExdBZGRUcnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAx -MDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtB -ZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIDAeBgNV -BAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV -6tsfSlbunyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nX -GCwwfQ56HmIexkvA/X1id9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnP -dzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSGAa2Il+tmzV7R/9x98oTaunet3IAIx6eH -1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAwHM+A+WD+eeSI8t0A65RF -62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0GA1UdDgQW -BBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUw -AwEB/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDEL -MAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRU -cnVzdCBUVFAgTmV0d29yazEgMB4GA1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJv -b3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4JNojVhaTdt02KLmuG7jD8WS6 -IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL+YPoRNWyQSW/ -iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao -GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh -4SINhwBk/ox9Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQm -XiLsks3/QppEIW1cxeMiHV9HEufOX1362KqxMy3ZdvJOOjMMK7MtkAY= ------END CERTIFICATE----- -=== /C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Qualified CA Root + +### Atos + +=== /CN=Atos TrustedRoot 2011/O=Atos/C=DE Certificate: Data: Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: sha1WithRSAEncryption + Serial Number: 6643877497813316402 (0x5c33cb622c5fb332) + Signature Algorithm: sha256WithRSAEncryption Validity - Not Before: May 30 10:44:50 2000 GMT - Not After : May 30 10:44:50 2020 GMT - Subject: C=SE, O=AddTrust AB, OU=AddTrust TTP Network, CN=AddTrust Qualified CA Root + Not Before: Jul 7 14:58:30 2011 GMT + Not After : Dec 31 23:59:59 2030 GMT + Subject: CN=Atos TrustedRoot 2011, O=Atos, C=DE X509v3 extensions: X509v3 Subject Key Identifier: - 39:95:8B:62:8B:5C:C9:D4:80:BA:58:0F:97:3F:15:08:43:CC:98:A7 - X509v3 Key Usage: - Certificate Sign, CRL Sign + A7:A5:06:B1:2C:A6:09:60:EE:D1:97:E9:70:AE:BC:3B:19:6C:DB:21 X509v3 Basic Constraints: critical CA:TRUE X509v3 Authority Key Identifier: - keyid:39:95:8B:62:8B:5C:C9:D4:80:BA:58:0F:97:3F:15:08:43:CC:98:A7 - DirName:/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Qualified CA Root - serial:01 + keyid:A7:A5:06:B1:2C:A6:09:60:EE:D1:97:E9:70:AE:BC:3B:19:6C:DB:21 + + X509v3 Certificate Policies: + Policy: 1.3.6.1.4.1.6189.3.4.1.1 -SHA1 Fingerprint=4D:23:78:EC:91:95:39:B5:00:7F:75:8F:03:3B:21:1E:C5:4D:8B:CF -SHA256 Fingerprint=80:95:21:08:05:DB:4B:BC:35:5E:44:28:D8:FD:6E:C2:CD:E3:AB:5F:B9:7A:99:42:98:8E:B8:F4:DC:D0:60:16 ------BEGIN CERTIFICATE----- -MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 -b3JrMSMwIQYDVQQDExpBZGRUcnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1 -MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcxCzAJBgNVBAYTAlNFMRQwEgYDVQQK -EwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIzAh -BgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwq -xBb/4Oxx64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G -87B4pfYOQnrjfxvM0PC3KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i -2O+tCBGaKZnhqkRFmhJePp1tUvznoD1oL/BLcHwTOK28FSXx1s6rosAx1i+f4P8U -WfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GRwVY18BTcZTYJbqukB8c1 -0cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HUMIHRMB0G -A1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0T -AQH/BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6Fr -pGkwZzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQL -ExRBZGRUcnVzdCBUVFAgTmV0d29yazEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlm -aWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv -hsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm -hpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X -dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3 -P6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y -iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no -xqE= + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign +SHA1 Fingerprint=2B:B1:F5:3E:55:0C:1D:C5:F1:D4:E6:B7:6A:46:4B:55:06:02:AC:21 +SHA256 Fingerprint=F3:56:BE:A2:44:B7:A9:1E:B3:5D:53:CA:9A:D7:86:4A:CE:01:8E:2D:35:D5:F8:F9:6D:DF:68:A6:F4:1A:A4:74 +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UE +AwwVQXRvcyBUcnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQG +EwJERTAeFw0xMTA3MDcxNDU4MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMM +FUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsGA1UECgwEQXRvczELMAkGA1UEBhMC +REUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCVhTuXbyo7LjvPpvMp +Nb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr54rM +VD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+ +SZFhyBH+DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ +4J7sVaE3IqKHBAUsR320HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0L +cp2AMBYHlT8oDv3FdU9T1nSatCQujgKRz3bFmx5VdJx4IbHwLfELn8LVlhgf8FQi +eowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7Rl+lwrrw7GWzbITAPBgNV +HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZbNshMBgG +A1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3 +DQEBCwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8j +vZfza1zv7v1Apt+hk6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kP +DpFrdRbhIfzYJsdHt6bPWHJxfrrhTZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pc +maHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a961qn8FYiqTxlVMYVqL2Gns2D +lmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G3mB/ufNPRJLv +KrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed -----END CERTIFICATE----- ### Baltimore @@ -240,99 +879,168 @@ ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp -----END CERTIFICATE----- -### Certplus +### Buypass AS-983163327 -=== /C=FR/O=Certplus/CN=Certplus Root CA G1 +=== /C=NO/O=Buypass AS-983163327/CN=Buypass Class 2 Root CA Certificate: Data: Version: 3 (0x2) - Serial Number: - 11:20:55:83:e4:2d:3e:54:56:85:2d:83:37:b7:2c:dc:46:11 - Signature Algorithm: sha512WithRSAEncryption + Serial Number: 2 (0x2) + Signature Algorithm: sha256WithRSAEncryption Validity - Not Before: May 26 00:00:00 2014 GMT - Not After : Jan 15 00:00:00 2038 GMT - Subject: C=FR, O=Certplus, CN=Certplus Root CA G1 + Not Before: Oct 26 08:38:03 2010 GMT + Not After : Oct 26 08:38:03 2040 GMT + Subject: C=NO, O=Buypass AS-983163327, CN=Buypass Class 2 Root CA X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + C9:80:77:E0:62:92:82:F5:46:9C:F3:BA:F7:4C:C3:DE:B8:A3:AD:39 X509v3 Key Usage: critical Certificate Sign, CRL Sign +SHA1 Fingerprint=49:0A:75:74:DE:87:0A:47:FE:58:EE:F6:C7:6B:EB:C6:0B:12:40:99 +SHA256 Fingerprint=9A:11:40:25:19:7C:5B:B9:5D:94:E6:3D:55:CD:43:79:08:47:B6:46:B2:3C:DF:11:AD:A4:A0:0E:FF:15:FB:48 +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg +Q2xhc3MgMiBSb290IENBMB4XDTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1ow +TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw +HgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB +BQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1g1Lr +6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPV +L4O2fuPn9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC91 +1K2GScuVr1QGbNgGE41b/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHx +MlAQTn/0hpPshNOOvEu/XAFOBz3cFIqUCqTqc/sLUegTBxj6DvEr0VQVfTzh97QZ +QmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeffawrbD02TTqigzXsu8lkB +arcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgIzRFo1clr +Us3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLi +FRhnBkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRS +P/TizPJhk9H9Z2vXUq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN +9SG9dKpN6nIDSdvHXx1iY8f93ZHsM+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxP +AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMmAd+BikoL1Rpzz +uvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAU18h +9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s +A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3t +OluwlN5E40EIosHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo ++fsicdl9sz1Gv7SEr5AcD48Saq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7 +KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYdDnkM/crqJIByw5c/8nerQyIKx+u2 +DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us +H8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ +I+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7 +5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h +3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz +Y11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA= +-----END CERTIFICATE----- +=== /C=NO/O=Buypass AS-983163327/CN=Buypass Class 3 Root CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 2 (0x2) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Oct 26 08:28:58 2010 GMT + Not After : Oct 26 08:28:58 2040 GMT + Subject: C=NO, O=Buypass AS-983163327, CN=Buypass Class 3 Root CA + X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE X509v3 Subject Key Identifier: - A8:C1:C0:9B:91:A8:43:15:7C:5D:06:27:B4:2A:51:D8:97:0B:81:B1 - X509v3 Authority Key Identifier: - keyid:A8:C1:C0:9B:91:A8:43:15:7C:5D:06:27:B4:2A:51:D8:97:0B:81:B1 - -SHA1 Fingerprint=22:FD:D0:B7:FD:A2:4E:0D:AC:49:2C:A0:AC:A6:7B:6A:1F:E3:F7:66 -SHA256 Fingerprint=15:2A:40:2B:FC:DF:2C:D5:48:05:4D:22:75:B3:9C:7F:CA:3E:C0:97:80:78:B0:F0:EA:76:E5:61:A6:C7:43:3E ------BEGIN CERTIFICATE----- -MIIFazCCA1OgAwIBAgISESBVg+QtPlRWhS2DN7cs3EYRMA0GCSqGSIb3DQEBDQUA -MD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2Vy -dHBsdXMgUm9vdCBDQSBHMTAeFw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBa -MD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2Vy -dHBsdXMgUm9vdCBDQSBHMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB -ANpQh7bauKk+nWT6VjOaVj0W5QOVsjQcmm1iBdTYj+eJZJ+622SLZOZ5KmHNr49a -iZFluVj8tANfkT8tEBXgfs+8/H9DZ6itXjYj2JizTfNDnjl8KvzsiNWI7nC9hRYt -6kuJPKNxQv4c/dMcLRC4hlTqQ7jbxofaqK6AJc96Jh2qkbBIb6613p7Y1/oA/caP -0FG7Yn2ksYyy/yARujVjBYZHYEMzkPZHogNPlk2dT8Hq6pyi/jQu3rfKG3akt62f -6ajUeD94/vI4CTYd0hYCyOwqaK/1jpTvLRN6HkJKHRUxrgwEV/xhc/MxVoYxgKDE -EW4wduOU8F8ExKyHcomYxZ3MVwia9Az8fXoFOvpHgDm2z4QTd28n6v+WZxcIbekN -1iNQMLAVdBM+5S//Ds3EC0pd8NgAM0lm66EYfFkuPSi5YXHLtaW6uOrc4nBvCGrc -h2c0798wct3zyT8j/zXhviEpIDCB5BmlIOklynMxdCm+4kLV87ImZsdo/Rmz5yCT -mehd4F6H50boJZwKKSTUzViGUkAksnsPmBIgJPaQbEfIDbsYIC7Z/fyL8inqh3SV -4EJQeIQEQWGw9CEjjy3LKCHyamz0GqbFFLQ3ZU+V/YDI+HLlJWvEYLF7bY5KinPO -WftwenMGE9nTdDckQQoRb5fc5+R+ob0V8rqHDz1oihYHAgMBAAGjYzBhMA4GA1Ud -DwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSowcCbkahDFXxd -Bie0KlHYlwuBsTAfBgNVHSMEGDAWgBSowcCbkahDFXxdBie0KlHYlwuBsTANBgkq -hkiG9w0BAQ0FAAOCAgEAnFZvAX7RvUz1isbwJh/k4DgYzDLDKTudQSk0YcbX8ACh -66Ryj5QXvBMsdbRX7gp8CXrc1cqh0DQT+Hern+X+2B50ioUHj3/MeXrKls3N/U/7 -/SMNkPX0XtPGYX2eEeAC7gkE2Qfdpoq3DIMku4NQkv5gdRE+2J2winq14J2by5BS -S7CTKtQ+FjPlnsZlFT5kOwQ/2wyPX1wdaR+v8+khjPPvl/aatxm2hHSco1S1cE5j -2FddUyGbQJJD+tZ3VTNPZNX70Cxqjm0lpu+F6ALEUz65noe8zDUa3qHpimOHZR4R -Kttjd5cUvpoUmRGywO6wT/gUITJDT5+rosuoD6o7BlXGEilXCNQ314cnrUlZp5Gr -RHpejXDbl85IULFzk/bwg2D5zfHhMf1bfHEhYxQUqq/F3pN+aLHsIqKqkHWetUNy -6mSjhEv9DKgma3GX7lZjZuhCVPnHHd/Qj1vfyDBviP4NxDMcU6ij/UgQ8uQKTuEV -V/xuZDDCVRHc6qnNSlSsKWNEz0pAoNZoWRsz+e86i9sgktxChL8Bq4fA1SCC28a5 -g4VCXA9DO2pJNdWY9BW/+mGBDAkgGNLQFwzLSABQ6XaCjGTXOqAHVcweMcDvOrRl -++O/QmueD6i9a5jc2NvLi6Td11n0bt3+qsOR0C5CB8AMTVPNJLFMWx5R9N/pkvo= ------END CERTIFICATE----- -=== /C=FR/O=Certplus/CN=Certplus Root CA G2 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - 11:20:d9:91:ce:ae:a3:e8:c5:e7:ff:e9:02:af:cf:73:bc:55 - Signature Algorithm: ecdsa-with-SHA384 + 47:B8:CD:FF:E5:6F:EE:F8:B2:EC:2F:4E:0E:F9:25:B0:8E:3C:6B:C3 + X509v3 Key Usage: critical + Certificate Sign, CRL Sign +SHA1 Fingerprint=DA:FA:F7:FA:66:84:EC:06:8F:14:50:BD:C7:C2:81:A5:BC:A9:64:57 +SHA256 Fingerprint=ED:F7:EB:BC:A2:7A:2A:38:4D:38:7B:7D:40:10:C6:66:E2:ED:B4:84:3E:4C:29:B4:AE:1D:5B:93:32:E6:B2:4D +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg +Q2xhc3MgMyBSb290IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFow +TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw +HgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB +BQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRHsJ8Y +ZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3E +N3coTRiR5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9 +tznDDgFHmV0ST9tD+leh7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX +0DJq1l1sDPGzbjniazEuOQAnFN44wOwZZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c +/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH2xc519woe2v1n/MuwU8X +KhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV/afmiSTY +zIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvS +O1UQRwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D +34xFMFbG02SrZvPAXpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgP +K9Dx2hzLabjKSWJtyNBjYt1gD1iqj6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3 +AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEe4zf/lb+74suwv +Tg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAACAj +QTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV +cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXS +IGrs/CIBKM+GuIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2 +HJLw5QY33KbmkJs4j1xrG0aGQ0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsa +O5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8ZORK15FTAaggiG6cX0S5y2CBNOxv +033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2KSb12tjE8nVhz36u +dmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz6MkE +kbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg41 +3OEMXbugUZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvD +u79leNKGef9JOxqDDPDeeOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq +4/g7u9xN12TyUb7mqqta6THuBrxzvxNiCp/HuZc= +-----END CERTIFICATE----- + +### Certinomis + +=== /C=FR/O=Certinomis/OU=0002 433998903/CN=Certinomis - Root CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha256WithRSAEncryption Validity - Not Before: May 26 00:00:00 2014 GMT - Not After : Jan 15 00:00:00 2038 GMT - Subject: C=FR, O=Certplus, CN=Certplus Root CA G2 + Not Before: Oct 21 09:17:18 2013 GMT + Not After : Oct 21 09:17:18 2033 GMT + Subject: C=FR, O=Certinomis, OU=0002 433998903, CN=Certinomis - Root CA X509v3 extensions: X509v3 Key Usage: critical Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE X509v3 Subject Key Identifier: - DA:83:63:02:79:8E:DA:4C:C6:3C:23:14:D8:8F:C3:20:AB:28:60:59 + EF:91:4C:F5:A5:C3:30:E8:2F:08:EA:D3:71:22:A4:92:68:78:74:D9 X509v3 Authority Key Identifier: - keyid:DA:83:63:02:79:8E:DA:4C:C6:3C:23:14:D8:8F:C3:20:AB:28:60:59 - -SHA1 Fingerprint=4F:65:8E:1F:E9:06:D8:28:02:E9:54:47:41:C9:54:25:5D:69:CC:1A -SHA256 Fingerprint=6C:C0:50:41:E6:44:5E:74:69:6C:4C:FB:C9:F8:0F:54:3B:7E:AB:BB:44:B4:CE:6F:78:7C:6A:99:71:C4:2F:17 ------BEGIN CERTIFICATE----- -MIICHDCCAaKgAwIBAgISESDZkc6uo+jF5//pAq/Pc7xVMAoGCCqGSM49BAMDMD4x -CzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBs -dXMgUm9vdCBDQSBHMjAeFw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBaMD4x -CzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBs -dXMgUm9vdCBDQSBHMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABM0PW1aC3/BFGtat -93nwHcmsltaeTpwftEIRyoa/bfuFo8XlGVzX7qY/aWfYeOKmycTbLXku54uNAm8x -Ik0G42ByRZ0OQneezs/lf4WbGOT8zC5y0xaTTsqZY1yhBSpsBqNjMGEwDgYDVR0P -AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNqDYwJ5jtpMxjwj -FNiPwyCrKGBZMB8GA1UdIwQYMBaAFNqDYwJ5jtpMxjwjFNiPwyCrKGBZMAoGCCqG -SM49BAMDA2gAMGUCMHD+sAvZ94OX7PNVHdTcswYO/jOYnYs5kGuUIe22113WTNch -p+e/IQ8rzfcq3IUHnQIxAIYUFuXcsGXCwI4Un78kFmjlvPl5adytRSv3tjFzzAal -U5ORGpOucGpnutee5WEaXw== + keyid:EF:91:4C:F5:A5:C3:30:E8:2F:08:EA:D3:71:22:A4:92:68:78:74:D9 + +SHA1 Fingerprint=9D:70:BB:01:A5:A4:A0:18:11:2E:F7:1C:01:B9:32:C5:34:E7:88:A8 +SHA256 Fingerprint=2A:99:F5:BC:11:74:B7:3C:BB:1D:62:08:84:E0:1C:34:E5:1C:CB:39:78:DA:12:5F:0E:33:26:88:83:BF:41:58 +-----BEGIN CERTIFICATE----- +MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjET +MBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAb +BgNVBAMTFENlcnRpbm9taXMgLSBSb290IENBMB4XDTEzMTAyMTA5MTcxOFoXDTMz +MTAyMTA5MTcxOFowWjELMAkGA1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMx +FzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMR0wGwYDVQQDExRDZXJ0aW5vbWlzIC0g +Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANTMCQosP5L2 +fxSeC5yaah1AMGT9qt8OHgZbn1CF6s2Nq0Nn3rD6foCWnoR4kkjW4znuzuRZWJfl +LieY6pOod5tK8O90gC3rMB+12ceAnGInkYjwSond3IjmFPnVAy//ldu9n+ws+hQV +WZUKxkd8aRi5pwP5ynapz8dvtF4F/u7BUrJ1Mofs7SlmO/NKFoL21prbcpjp3vDF +TKWrteoB4owuZH9kb/2jJZOLyKIOSY008B/sWEUuNKqEUL3nskoTuLAPrjhdsKkb +5nPJWqHZZkCqqU2mNAKthH6yI8H7KsZn9DS2sJVqM09xRLWtwHkziOC/7aOgFLSc +CbAK42C++PhmiM1b8XcF4LVzbsF9Ri6OSyemzTUK/eVNfaoqoynHWmgE6OXWk6Ri +wsXm9E/G+Z8ajYJJGYrKWUM66A0ywfRMEwNvbqY/kXPLynNvEiCL7sCCeN5LLsJJ +wx3tFvYk9CcbXFcx3FXuqB5vbKziRcxXV4p1VxngtViZSTYxPDMBbRZKzbgqg4SG +m/lg0h9tkQPTYKbVPZrdd5A9NaSfD171UkRpucC63M9933zZxKyGIjK8e2uR73r4 +F2iw4lNVYC2vPsKD2NkJK/DAZNuHi5HMkesE/Xa0lZrmFAYb1TQdvtj/dBxThZng +WVJKYe2InmtJiUZ+IFrZ50rlau7SZRFDAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTvkUz1pcMw6C8I6tNxIqSSaHh0 +2TAfBgNVHSMEGDAWgBTvkUz1pcMw6C8I6tNxIqSSaHh02TANBgkqhkiG9w0BAQsF +AAOCAgEAfj1U2iJdGlg+O1QnurrMyOMaauo++RLrVl89UM7g6kgmJs95Vn6RHJk/ +0KGRHCwPT5iVWVO90CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWw +F6YSjNRieOpWauwK0kDDPAUwPk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZS +g081lLMSVX3l4kLr5JyTCcBMWwerx20RoFAXlCOotQqSD7J6wWAsOMwaplv/8gzj +qh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5nU7aJ+BIJy29SWwNyhlCVCNSN +h4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrjcOa4pvi2WsS9Iff/ +ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu6AdBBR8V +btaw5BngDwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwj +Y/M50n92Uaf0yKHxDHYiI0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ +8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nMcyrDflOR1m749fPH0FFNjkulW+YZFzvW +gQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVrhkIGuUE= -----END CERTIFICATE----- + +### Certplus + === /C=FR/O=Certplus/CN=Class 2 Primary CA Certificate: Data: @@ -383,163 +1091,160 @@ kJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 l7+ijrRU -----END CERTIFICATE----- -### Comodo CA Limited +### certSIGN -=== /C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=AAA Certificate Services +=== /C=RO/O=certSIGN/OU=certSIGN ROOT CA Certificate: Data: Version: 3 (0x2) - Serial Number: 1 (0x1) + Serial Number: 35210227249154 (0x200605167002) Signature Algorithm: sha1WithRSAEncryption Validity - Not Before: Jan 1 00:00:00 2004 GMT - Not After : Dec 31 23:59:59 2028 GMT - Subject: C=GB, ST=Greater Manchester, L=Salford, O=Comodo CA Limited, CN=AAA Certificate Services + Not Before: Jul 4 17:20:04 2006 GMT + Not After : Jul 4 17:20:04 2031 GMT + Subject: C=RO, O=certSIGN, OU=certSIGN ROOT CA X509v3 extensions: - X509v3 Subject Key Identifier: - A0:11:0A:23:3E:96:F1:07:EC:E2:AF:29:EF:82:A5:7F:D0:30:A4:B4 - X509v3 Key Usage: critical - Certificate Sign, CRL Sign X509v3 Basic Constraints: critical - CA:TRUE - X509v3 CRL Distribution Points: - - Full Name: - URI:http://crl.comodoca.com/AAACertificateServices.crl - - Full Name: - URI:http://crl.comodo.net/AAACertificateServices.crl - -SHA1 Fingerprint=D1:EB:23:A4:6D:17:D6:8F:D9:25:64:C2:F1:F1:60:17:64:D8:E3:49 -SHA256 Fingerprint=D7:A7:A0:FB:5D:7E:27:31:D7:71:E9:48:4E:BC:DE:F7:1D:5F:0C:3E:0A:29:48:78:2B:C8:3E:E0:EA:69:9E:F4 ------BEGIN CERTIFICATE----- -MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj -YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL -MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE -BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM -GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua -BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe -3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 -YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR -rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm -ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU -oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF -MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v -QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t -b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF -AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q -GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz -Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 -G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi -l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 -smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== + CA:TRUE + X509v3 Key Usage: critical + Digital Signature, Non Repudiation, Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + E0:8C:9B:DB:25:49:B3:F1:7C:86:D6:B2:42:87:0B:D0:6B:A0:D9:E4 +SHA1 Fingerprint=FA:B7:EE:36:97:26:62:FB:2D:B0:2A:F6:BF:03:FD:E8:7C:4B:2F:9B +SHA256 Fingerprint=EA:A9:62:C4:FA:4A:6B:AF:EB:E4:15:19:6D:35:1C:CD:88:8D:4F:53:F3:FA:8A:E6:D7:C4:66:A9:4E:60:42:BB +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYT +AlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBD +QTAeFw0wNjA3MDQxNzIwMDRaFw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJP +MREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7IJUqOtdu0KBuqV5Do +0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHHrfAQ +UySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5d +RdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQ +OA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv +JoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08C +AwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0O +BBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJ +LjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecY +MnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ +44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6I +Jd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNw +i/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5VaZVDADlN +9u6wWk5JRFRYX0KD -----END CERTIFICATE----- -=== /C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=Secure Certificate Services + +### China Financial Certification Authority + +=== /C=CN/O=China Financial Certification Authority/CN=CFCA EV ROOT Certificate: Data: Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: sha1WithRSAEncryption + Serial Number: 407555286 (0x184accd6) + Signature Algorithm: sha256WithRSAEncryption Validity - Not Before: Jan 1 00:00:00 2004 GMT - Not After : Dec 31 23:59:59 2028 GMT - Subject: C=GB, ST=Greater Manchester, L=Salford, O=Comodo CA Limited, CN=Secure Certificate Services + Not Before: Aug 8 03:07:01 2012 GMT + Not After : Dec 31 03:07:01 2029 GMT + Subject: C=CN, O=China Financial Certification Authority, CN=CFCA EV ROOT X509v3 extensions: - X509v3 Subject Key Identifier: - 3C:D8:93:88:C2:C0:82:09:CC:01:99:06:93:20:E9:9E:70:09:63:4F - X509v3 Key Usage: critical - Certificate Sign, CRL Sign + X509v3 Authority Key Identifier: + keyid:E3:FE:2D:FD:28:D0:0B:B5:BA:B6:A2:C4:BF:06:AA:05:8C:93:FB:2F + X509v3 Basic Constraints: critical CA:TRUE - X509v3 CRL Distribution Points: - - Full Name: - URI:http://crl.comodoca.com/SecureCertificateServices.crl + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + E3:FE:2D:FD:28:D0:0B:B5:BA:B6:A2:C4:BF:06:AA:05:8C:93:FB:2F +SHA1 Fingerprint=E2:B8:29:4B:55:84:AB:6B:58:C2:90:46:6C:AC:3F:B8:39:8F:84:83 +SHA256 Fingerprint=5C:C3:D7:8E:4E:1D:5E:45:54:7A:04:E6:87:3E:64:F9:0C:F9:53:6D:1C:CC:2E:F8:00:F3:55:C4:C5:FD:70:FD +-----BEGIN CERTIFICATE----- +MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJD +TjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y +aXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkx +MjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEwMC4GA1UECgwnQ2hpbmEgRmluYW5j +aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJP +T1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnVBU03 +sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpL +TIpTUnrD7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5 +/ZOkVIBMUtRSqy5J35DNuF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp +7hZZLDRJGqgG16iI0gNyejLi6mhNbiyWZXvKWfry4t3uMCz7zEasxGPrb382KzRz +EpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7xzbh72fROdOXW3NiGUgt +hxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9fpy25IGvP +a931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqot +aK8KgWU6cMGbrU1tVMoqLUuFG7OA5nBFDWteNfB/O7ic5ARwiRIlk9oKmSJgamNg +TnYGmE69g60dWIolhdLHZR4tjsbftsbhf4oEIRUpdPA+nJCdDC7xij5aqgwJHsfV +PKPtl8MeNPo4+QgO48BdK4PRVmrJtqhUUy54Mmc9gn900PvhtgVguXDbjgv5E1hv +cWAQUhC5wUEJ73IfZzF4/5YFjQIDAQABo2MwYTAfBgNVHSMEGDAWgBTj/i39KNAL +tbq2osS/BqoFjJP7LzAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAd +BgNVHQ4EFgQU4/4t/SjQC7W6tqLEvwaqBYyT+y8wDQYJKoZIhvcNAQELBQADggIB +ACXGumvrh8vegjmWPfBEp2uEcwPenStPuiB/vHiyz5ewG5zz13ku9Ui20vsXiObT +ej/tUxPQ4i9qecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdL +jOztUmCypAbqTuv0axn96/Ua4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBS +ESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sGE5uPhnEFtC+NiWYzKXZUmhH4J/qy +P5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfXBDrDMlI1Dlb4pd19 +xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjnaH9d +Ci77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN +5mydLIhyPDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe +/v5WOaHIz16eGWRGENoXkbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+Z +AAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3CekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ +5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su +-----END CERTIFICATE----- - Full Name: - URI:http://crl.comodo.net/SecureCertificateServices.crl +### Chunghwa Telecom Co., Ltd. -SHA1 Fingerprint=4A:65:D5:F4:1D:EF:39:B8:B8:90:4A:4A:D3:64:81:33:CF:C7:A1:D1 -SHA256 Fingerprint=BD:81:CE:3B:4F:65:91:D1:1A:67:B5:FC:7A:47:FD:EF:25:52:1B:F9:AA:4E:18:B9:E3:DF:2E:34:A7:80:3B:E8 ------BEGIN CERTIFICATE----- -MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRp -ZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVow -fjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAiBgNV -BAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPM -cm3ye5drswfxdySRXyWP9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3S -HpR7LZQdqnXXs5jLrLxkU0C8j6ysNstcrbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996 -CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rCoznl2yY4rYsK7hljxxwk -3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3Vp6ea5EQz -6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNV -HQ4EFgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1Ud -EwEB/wQFMAMBAf8wgYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2Rv -Y2EuY29tL1NlY3VyZUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRw -Oi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmww -DQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm4J4oqF7Tt/Q0 -5qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj -Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtI -gKvcnDe4IRRLDXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJ -aD61JlfutuC23bkpgHl9j6PwpCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDl -izeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1HRR3B7Hzs/Sk= ------END CERTIFICATE----- -=== /C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=Trusted Certificate Services +=== /C=TW/O=Chunghwa Telecom Co., Ltd./OU=ePKI Root Certification Authority Certificate: Data: Version: 3 (0x2) - Serial Number: 1 (0x1) + Serial Number: + 15:c8:bd:65:47:5c:af:b8:97:00:5e:e4:06:d2:bc:9d Signature Algorithm: sha1WithRSAEncryption Validity - Not Before: Jan 1 00:00:00 2004 GMT - Not After : Dec 31 23:59:59 2028 GMT - Subject: C=GB, ST=Greater Manchester, L=Salford, O=Comodo CA Limited, CN=Trusted Certificate Services + Not Before: Dec 20 02:31:27 2004 GMT + Not After : Dec 20 02:31:27 2034 GMT + Subject: C=TW, O=Chunghwa Telecom Co., Ltd., OU=ePKI Root Certification Authority X509v3 extensions: X509v3 Subject Key Identifier: - C5:7B:58:BD:ED:DA:25:69:D2:F7:59:16:A8:B3:32:C0:7B:27:5B:F4 - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical + 1E:0C:F7:B6:67:F2:E1:92:26:09:45:C0:55:39:2E:77:3F:42:4A:A2 + X509v3 Basic Constraints: CA:TRUE - X509v3 CRL Distribution Points: - - Full Name: - URI:http://crl.comodoca.com/TrustedCertificateServices.crl - - Full Name: - URI:http://crl.comodo.net/TrustedCertificateServices.crl - -SHA1 Fingerprint=E1:9F:E3:0E:8B:84:60:9E:80:9B:17:0D:72:A8:C5:BA:6E:14:09:BD -SHA256 Fingerprint=3F:06:E5:56:81:D4:96:F5:BE:16:9E:B5:38:9F:9F:2B:8F:F6:1E:17:08:DF:68:81:72:48:49:CD:5D:27:CB:69 + setCext-hashedRoot: + 0/0-...0...+......0...g*.....E... +V|.[x....S..... +SHA1 Fingerprint=67:65:0D:F1:7E:8E:7E:5B:82:40:A4:F4:56:4B:CF:E2:3D:69:C6:F0 +SHA256 Fingerprint=C0:A6:F4:DC:63:A2:4B:FD:CF:54:EF:2A:6A:08:2A:0A:72:DE:35:80:3E:2F:F5:FF:52:7A:E5:D8:72:06:DF:D5 -----BEGIN CERTIFICATE----- -MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0 -aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEwMDAwMDBaFw0yODEyMzEyMzU5NTla -MH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO -BgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUwIwYD -VQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWW -fnJSoBVC21ndZHoa0Lh73TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMt -TGo87IvDktJTdyR0nAducPy9C1t2ul/y/9c3S0pgePfw+spwtOpZqqPOSC+pw7IL -fhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6juljatEPmsbS9Is6FARW -1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsSivnkBbA7 -kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0G -A1UdDgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYD -VR0TAQH/BAUwAwEB/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21v -ZG9jYS5jb20vVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRo -dHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMu -Y3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8NtwuleGFTQQuS9/ -HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 -pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxIS -jBc/lDb+XbDABHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+ -xqFx7D+gIIxmOom0jtTYsU0lR+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/Atyjcn -dBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O9y5Xt5hwXsjEeLBi +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe +MQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0 +ZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMw +IQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBL +SSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAH +SyZbCUNsIZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAh +ijHyl3SJCRImHJ7K2RKilTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3X +DZoTM1PRYfl61dd4s5oz9wCGzh1NlDivqOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1 +TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX12ruOzjjK9SXDrkb5wdJ +fzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0OWQqraffA +sgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uU +WH1+ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLS +nT0IFaUQAS2zMnaolQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pH +dmX2Os+PYhcZewoozRrSgx4hxyy/vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJip +NiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXiZo1jDiVN1Rmy5nk3pyKdVDEC +AwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/QkqiMAwGA1UdEwQF +MAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGB +uvl2ICO1J2B01GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6Yl +PwZpVnPDimZI+ymBV3QGypzqKOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkP +JXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdVxrsStZf0X4OFunHB2WyBEXYKCrC/ +gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEPNXubrjlpC2JgQCA2 +j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+rGNm6 +5ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUB +o2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS +/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z +Gp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE +W9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D +hNQ+IIX3Sj0rnP0qCglN6oH4EZw= -----END CERTIFICATE----- ### COMODO CA Limited @@ -685,6 +1390,221 @@ QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl NVOFBkpdn627G190 -----END CERTIFICATE----- +### Comodo CA Limited + +=== /C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=AAA Certificate Services +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Jan 1 00:00:00 2004 GMT + Not After : Dec 31 23:59:59 2028 GMT + Subject: C=GB, ST=Greater Manchester, L=Salford, O=Comodo CA Limited, CN=AAA Certificate Services + X509v3 extensions: + X509v3 Subject Key Identifier: + A0:11:0A:23:3E:96:F1:07:EC:E2:AF:29:EF:82:A5:7F:D0:30:A4:B4 + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 CRL Distribution Points: + + Full Name: + URI:http://crl.comodoca.com/AAACertificateServices.crl + + Full Name: + URI:http://crl.comodo.net/AAACertificateServices.crl + +SHA1 Fingerprint=D1:EB:23:A4:6D:17:D6:8F:D9:25:64:C2:F1:F1:60:17:64:D8:E3:49 +SHA256 Fingerprint=D7:A7:A0:FB:5D:7E:27:31:D7:71:E9:48:4E:BC:DE:F7:1D:5F:0C:3E:0A:29:48:78:2B:C8:3E:E0:EA:69:9E:F4 +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj +YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM +GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua +BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe +3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 +YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR +rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm +ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU +oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v +QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t +b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF +AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q +GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 +G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi +l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 +smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +### Cybertrust, Inc + +=== /O=Cybertrust, Inc/CN=Cybertrust Global Root +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 04:00:00:00:00:01:0f:85:aa:2d:48 + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Dec 15 08:00:00 2006 GMT + Not After : Dec 15 08:00:00 2021 GMT + Subject: O=Cybertrust, Inc, CN=Cybertrust Global Root + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + B6:08:7B:0D:7A:CC:AC:20:4C:86:56:32:5E:CF:AB:6E:85:2D:70:57 + X509v3 CRL Distribution Points: + + Full Name: + URI:http://www2.public-trust.com/crl/ct/ctroot.crl + + X509v3 Authority Key Identifier: + keyid:B6:08:7B:0D:7A:CC:AC:20:4C:86:56:32:5E:CF:AB:6E:85:2D:70:57 + +SHA1 Fingerprint=5F:43:E5:B1:BF:F8:78:8C:AC:1C:C7:CA:4A:9A:C6:22:2B:CC:34:C6 +SHA256 Fingerprint=96:0A:DF:00:63:E9:63:56:75:0C:29:65:DD:0A:08:67:DA:0B:9C:BD:6E:77:71:4A:EA:FB:23:49:AB:39:3D:A3 +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG +A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh +bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE +ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS +b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5 +7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS +J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y +HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP +t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz +FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY +XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/ +MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw +hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js +MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA +A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj +Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx +XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o +omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc +A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +### D-Trust GmbH + +=== /C=DE/O=D-Trust GmbH/CN=D-TRUST Root Class 3 CA 2 2009 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 623603 (0x983f3) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Nov 5 08:35:58 2009 GMT + Not After : Nov 5 08:35:58 2029 GMT + Subject: C=DE, O=D-Trust GmbH, CN=D-TRUST Root Class 3 CA 2 2009 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + FD:DA:14:C4:9F:30:DE:21:BD:1E:42:39:FC:AB:63:23:49:E0:F1:84 + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 CRL Distribution Points: + + Full Name: + URI:ldap://directory.d-trust.net/CN=D-TRUST%20Root%20Class%203%20CA%202%202009,O=D-Trust%20GmbH,C=DE?certificaterevocationlist + + Full Name: + URI:http://www.d-trust.net/crl/d-trust_root_class_3_ca_2_2009.crl + +SHA1 Fingerprint=58:E8:AB:B0:36:15:33:FB:80:F7:9B:1B:6D:29:D3:FF:8D:5F:00:F0 +SHA256 Fingerprint=49:E7:A4:42:AC:F0:EA:62:87:05:00:54:B5:25:64:B6:50:E4:F4:9E:42:E3:48:D6:AA:38:E0:39:E9:57:B1:C1 +-----BEGIN CERTIFICATE----- +MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF +MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD +bGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NTha +ME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMM +HkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOADER03 +UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42 +tSHKXzlABF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9R +ySPocq60vFYJfxLLHLGvKZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsM +lFqVlNpQmvH/pStmMaTJOKDfHR+4CS7zp+hnUquVH+BGPtikw8paxTGA6Eian5Rp +/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUCAwEAAaOCARowggEWMA8G +A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ4PGEMA4G +A1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVj +dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUy +MENBJTIwMiUyMDIwMDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRl +cmV2b2NhdGlvbmxpc3QwQ6BBoD+GPWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3Js +L2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAwOS5jcmwwDQYJKoZIhvcNAQEL +BQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni +acfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 +o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4K +zCUqNQT4YJEVdT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8 +PIWmawomDeCTmGCufsYkl4phX5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3Y +Johw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- +=== /C=DE/O=D-Trust GmbH/CN=D-TRUST Root Class 3 CA 2 EV 2009 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 623604 (0x983f4) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Nov 5 08:50:46 2009 GMT + Not After : Nov 5 08:50:46 2029 GMT + Subject: C=DE, O=D-Trust GmbH, CN=D-TRUST Root Class 3 CA 2 EV 2009 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + D3:94:8A:4C:62:13:2A:19:2E:CC:AF:72:8A:7D:36:D7:9A:1C:DC:67 + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 CRL Distribution Points: + + Full Name: + URI:ldap://directory.d-trust.net/CN=D-TRUST%20Root%20Class%203%20CA%202%20EV%202009,O=D-Trust%20GmbH,C=DE?certificaterevocationlist + + Full Name: + URI:http://www.d-trust.net/crl/d-trust_root_class_3_ca_2_ev_2009.crl + +SHA1 Fingerprint=96:C9:1B:0B:95:B4:10:98:42:FA:D0:D8:22:79:FE:60:FA:B9:16:83 +SHA256 Fingerprint=EE:C5:49:6B:98:8C:E9:86:25:B9:34:09:2E:EC:29:08:BE:D0:B0:F3:16:C2:D4:73:0C:84:EA:F1:F3:D3:48:81 +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF +MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD +bGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUw +NDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNV +BAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAwOTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfSegpn +ljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM0 +3TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6Z +qQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lR +p75mpoo6Kr3HGrHhFPC+Oh25z1uxav60sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8 +HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure3511H3a6UCAwEAAaOCASQw +ggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyvcop9Ntea +HNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFw +Oi8vZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xh +c3MlMjAzJTIwQ0ElMjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1E +RT9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0MEagRKBChkBodHRwOi8vd3d3LmQt +dHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xhc3NfM19jYV8yX2V2XzIwMDku +Y3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+PPoeUSbrh/Yp +3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 +nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF +CSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na +xpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX +KVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1 +-----END CERTIFICATE----- + ### Deutsche Telekom AG === /C=DE/O=Deutsche Telekom AG/OU=T-TeleSec Trust Center/CN=Deutsche Telekom Root CA 2 @@ -729,6 +1649,128 @@ xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU Cm26OWMohpLzGITY+9HPBVZkVw== -----END CERTIFICATE----- +### Dhimyotis + +=== /C=FR/O=Dhimyotis/CN=Certigna +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 18364802974209362175 (0xfedce3010fc948ff) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Jun 29 15:13:05 2007 GMT + Not After : Jun 29 15:13:05 2027 GMT + Subject: C=FR, O=Dhimyotis, CN=Certigna + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + 1A:ED:FE:41:39:90:B4:24:59:BE:01:F2:52:D5:45:F6:5A:39:DC:11 + X509v3 Authority Key Identifier: + keyid:1A:ED:FE:41:39:90:B4:24:59:BE:01:F2:52:D5:45:F6:5A:39:DC:11 + DirName:/C=FR/O=Dhimyotis/CN=Certigna + serial:FE:DC:E3:01:0F:C9:48:FF + + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + Netscape Cert Type: + SSL CA, S/MIME CA, Object Signing CA +SHA1 Fingerprint=B1:2E:13:63:45:86:A4:6F:1A:B2:60:68:37:58:2D:C4:AC:FD:94:97 +SHA256 Fingerprint=E3:B6:A2:DB:2E:D7:CE:48:84:2F:7A:C5:32:41:C7:B7:1D:54:14:4B:FB:40:C1:1F:3F:1D:0B:42:F5:EE:A1:2D +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNV +BAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4X +DTA3MDYyOTE1MTMwNVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQ +BgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4 +QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyHGxny +gQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbw +zBfsV1/pogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q +130yGLMLLGq/jj8UEYkgDncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2 +JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKfIrjxwo1p3Po6WAbfAgMBAAGjgbwwgbkw +DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQtCRZvgHyUtVF9lo53BEw +ZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJBgNVBAYT +AkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzj +AQ/JSP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG +9w0BAQUFAAOCAQEAhQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8h +bV6lUmPOEvjvKtpv6zf+EwLHyzs+ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFnc +fca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1kluPBS1xp81HlDQwY9qcEQCYsuu +HWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY1gkIl2PlwS6w +t0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- +=== /C=FR/O=Dhimyotis/OU=0002 48146308100036/CN=Certigna Root CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + ca:e9:1b:89:f1:55:03:0d:a3:e6:41:6d:c4:e3:a6:e1 + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Oct 1 08:32:27 2013 GMT + Not After : Oct 1 08:32:27 2033 GMT + Subject: C=FR, O=Dhimyotis, OU=0002 48146308100036, CN=Certigna Root CA + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 18:87:56:E0:6E:77:EE:24:35:3C:4E:73:9A:1F:D6:E1:E2:79:7E:2B + X509v3 Authority Key Identifier: + keyid:18:87:56:E0:6E:77:EE:24:35:3C:4E:73:9A:1F:D6:E1:E2:79:7E:2B + + X509v3 Certificate Policies: + Policy: X509v3 Any Policy + CPS: https://wwww.certigna.fr/autorites/ + + X509v3 CRL Distribution Points: + + Full Name: + URI:http://crl.certigna.fr/certignarootca.crl + + Full Name: + URI:http://crl.dhimyotis.com/certignarootca.crl + +SHA1 Fingerprint=2D:0D:52:14:FF:9E:AD:99:24:01:74:20:47:6E:6C:85:27:27:F5:43 +SHA256 Fingerprint=D4:8D:3D:23:EE:DB:50:A4:59:E5:51:97:60:1C:27:77:4B:9D:7B:18:C9:4D:5A:05:95:11:A1:02:50:B9:31:68 +-----BEGIN CERTIFICATE----- +MIIGWzCCBEOgAwIBAgIRAMrpG4nxVQMNo+ZBbcTjpuEwDQYJKoZIhvcNAQELBQAw +WjELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczEcMBoGA1UECwwTMDAw +MiA0ODE0NjMwODEwMDAzNjEZMBcGA1UEAwwQQ2VydGlnbmEgUm9vdCBDQTAeFw0x +MzEwMDEwODMyMjdaFw0zMzEwMDEwODMyMjdaMFoxCzAJBgNVBAYTAkZSMRIwEAYD +VQQKDAlEaGlteW90aXMxHDAaBgNVBAsMEzAwMDIgNDgxNDYzMDgxMDAwMzYxGTAX +BgNVBAMMEENlcnRpZ25hIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDNGDllGlmx6mQWDoyUJJV8g9PFOSbcDO8WV43X2KyjQn+Cyu3NW9sO +ty3tRQgXstmzy9YXUnIo245Onoq2C/mehJpNdt4iKVzSs9IGPjA5qXSjklYcoW9M +CiBtnyN6tMbaLOQdLNyzKNAT8kxOAkmhVECe5uUFoC2EyP+YbNDrihqECB63aCPu +I9Vwzm1RaRDuoXrC0SIxwoKF0vJVdlB8JXrJhFwLrN1CTivngqIkicuQstDuI7pm +TLtipPlTWmR7fJj6o0ieD5Wupxj0auwuA0Wv8HT4Ks16XdG+RCYyKfHx9WzMfgIh +C59vpD++nVPiz32pLHxYGpfhPTc3GGYo0kDFUYqMwy3OU4gkWGQwFsWq4NYKpkDf +ePb1BHxpE4S80dGnBs8B92jAqFe7OmGtBIyT46388NtEbVncSVmurJqZNjBBe3Yz +IoejwpKGbvlw7q6Hh5UbxHq9MfPU0uWZ/75I7HX1eBYdpnDBfzwboZL7z8g81sWT +Co/1VTp2lc5ZmIoJlXcymoO6LAQ6l73UL77XbJuiyn1tJslV1c/DeVIICZkHJC1k +JWumIWmbat10TWuXekG9qxf5kBdIjzb5LdXF2+6qhUVB+s06RbFo5jZMm5BX7CO5 +hwjCxAnxl4YqKE3idMDaxIzb3+KhF1nOJFl0Mdp//TBt2dzhauH8XwIDAQABo4IB +GjCCARYwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE +FBiHVuBud+4kNTxOc5of1uHieX4rMB8GA1UdIwQYMBaAFBiHVuBud+4kNTxOc5of +1uHieX4rMEQGA1UdIAQ9MDswOQYEVR0gADAxMC8GCCsGAQUFBwIBFiNodHRwczov +L3d3d3cuY2VydGlnbmEuZnIvYXV0b3JpdGVzLzBtBgNVHR8EZjBkMC+gLaArhilo +dHRwOi8vY3JsLmNlcnRpZ25hLmZyL2NlcnRpZ25hcm9vdGNhLmNybDAxoC+gLYYr +aHR0cDovL2NybC5kaGlteW90aXMuY29tL2NlcnRpZ25hcm9vdGNhLmNybDANBgkq +hkiG9w0BAQsFAAOCAgEAlLieT/DjlQgi581oQfccVdV8AOItOoldaDgvUSILSo3L +6btdPrtcPbEo/uRTVRPPoZAbAh1fZkYJMyjhDSSXcNMQH+pkV5a7XdrnxIxPTGRG +HVyH41neQtGbqH6mid2PHMkwgu07nM3A6RngatgCdTer9zQoKJHyBApPNeNgJgH6 +0BGM+RFq7q89w1DTj18zeTyGqHNFkIwgtnJzFyO+B2XleJINugHA64wcZr+shncB +lA2c5uk5jR+mUYyZDDl34bSb+hxnV29qao6pK0xXeXpXIs/NX2NGjVxZOob4Mkdi +o2cNGJHc+6Zr9UhhcyNZjgKnvETq9Emd8VRY+WCv2hikLyhF3HqgiIZd8zvn/yk1 +gPxkQ5Tm4xxvvq0OKmOZK8l+hfZx6AYDlf7ej0gcWtSS6Cvu5zHbugRqh5jnxV/v +faci9wHYTfmJ0A6aBVmknpjZbyvKcL5kwlWj9Omvw5Ip3IgWJJk8jSaYtlu3zM63 +Nwf9JtmYhST/WSMDmu2dnajkXjjO11INb9I/bbEFa0nOipFGc/T2L/Coc3cOZayh +jWZSaX5LaAzHHjcng6WMxwLkFM1JAbBzs/3GkDpv0mztO+7skb6iQ12LAEpmJURw +3kAP+HwV96LOPNdeE4yBFxgX0b3xdxA61GU5wSesVywlVP+i2k+KYTlerj1KjL0= +-----END CERTIFICATE----- + ### DigiCert Inc === /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Assured ID Root CA @@ -1074,100 +2116,161 @@ r/OSmbaz5mEP0oUA51Aa5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1 gKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP82Z+ -----END CERTIFICATE----- -### Digital Signature Trust +### Digital Signature Trust Co. -=== /C=US/O=Digital Signature Trust/OU=DST ACES/CN=DST ACES CA X6 +=== /O=Digital Signature Trust Co./CN=DST Root CA X3 Certificate: Data: Version: 3 (0x2) Serial Number: - 0d:5e:99:0a:d6:9d:b7:78:ec:d8:07:56:3b:86:15:d9 + 44:af:b0:80:d6:a3:27:ba:89:30:39:86:2e:f8:40:6b Signature Algorithm: sha1WithRSAEncryption Validity - Not Before: Nov 20 21:19:58 2003 GMT - Not After : Nov 20 21:19:58 2017 GMT - Subject: C=US, O=Digital Signature Trust, OU=DST ACES, CN=DST ACES CA X6 + Not Before: Sep 30 21:12:19 2000 GMT + Not After : Sep 30 14:01:15 2021 GMT + Subject: O=Digital Signature Trust Co., CN=DST Root CA X3 X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE X509v3 Key Usage: critical - Digital Signature, Non Repudiation, Certificate Sign, CRL Sign - X509v3 Subject Alternative Name: - email:pki-ops@trustdst.com - X509v3 Certificate Policies: - Policy: 2.16.840.1.101.3.2.1.1.1 - CPS: http://www.trustdst.com/certificates/policy/ACES-index.html - - X509v3 Subject Key Identifier: - 09:72:06:4E:18:43:0F:E5:D6:CC:C3:6A:8B:31:7B:78:8F:A8:83:B8 -SHA1 Fingerprint=40:54:DA:6F:1C:3F:40:74:AC:ED:0F:EC:CD:DB:79:D1:53:FB:90:1D -SHA256 Fingerprint=76:7C:95:5A:76:41:2C:89:AF:68:8E:90:A1:C7:0F:55:6C:FD:6B:60:25:DB:EA:10:41:6D:7E:B6:83:1F:8C:40 ------BEGIN CERTIFICATE----- -MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBb -MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3Qx -ETAPBgNVBAsTCERTVCBBQ0VTMRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0w -MzExMjAyMTE5NThaFw0xNzExMjAyMTE5NThaMFsxCzAJBgNVBAYTAlVTMSAwHgYD -VQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UECxMIRFNUIEFDRVMx -FzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPu -ktKe1jzIDZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7 -gLFViYsx+tC3dr5BPTCapCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZH -fAjIgrrep4c9oW24MFbCswKBXy314powGCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4a -ahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPyMjwmR/onJALJfh1biEIT -ajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1UdEwEB/wQF -MAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rk -c3QuY29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjto -dHRwOi8vd3d3LnRydXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMt -aW5kZXguaHRtbDAdBgNVHQ4EFgQUCXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZI -hvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V25FYrnJmQ6AgwbN99Pe7lv7Uk -QIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6tFr8hlxCBPeP/ -h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq -nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpR -rscL9yuwNwXsvFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf2 -9w4LTJxoeHtxMcfrHuBnQfO3oKfN5XozNmr6mis= + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + C4:A7:B1:A4:7B:2C:71:FA:DB:E1:4B:90:75:FF:C4:15:60:85:89:10 +SHA1 Fingerprint=DA:C9:02:4F:54:D8:F6:DF:94:93:5F:B1:73:26:38:CA:6A:D7:7C:13 +SHA256 Fingerprint=06:87:26:03:31:A7:24:03:D9:09:F1:05:E6:9B:CF:0D:32:E1:BD:24:93:FF:C6:D9:20:6D:11:BC:D6:77:07:39 +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ +MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT +DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow +PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD +Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O +rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq +OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b +xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw +7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD +aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG +SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 +ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr +AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz +R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 +JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo +Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ -----END CERTIFICATE----- -### Digital Signature Trust Co. +### Disig a.s. -=== /O=Digital Signature Trust Co./CN=DST Root CA X3 +=== /C=SK/L=Bratislava/O=Disig a.s./CN=CA Disig Root R2 Certificate: Data: Version: 3 (0x2) - Serial Number: - 44:af:b0:80:d6:a3:27:ba:89:30:39:86:2e:f8:40:6b - Signature Algorithm: sha1WithRSAEncryption + Serial Number: 10572350602393338211 (0x92b888dbb08ac163) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Jul 19 09:15:30 2012 GMT + Not After : Jul 19 09:15:30 2042 GMT + Subject: C=SK, L=Bratislava, O=Disig a.s., CN=CA Disig Root R2 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + B5:99:F8:AF:B0:94:F5:E3:20:D6:0A:AD:CE:4E:56:A4:2E:6E:42:ED +SHA1 Fingerprint=B5:61:EB:EA:A4:DE:E4:25:4B:69:1A:98:A5:57:47:C2:34:C7:D9:71 +SHA256 Fingerprint=E2:3D:4A:03:6D:7B:70:E9:F5:95:B1:42:20:79:D2:B9:1E:DF:BB:1F:B6:51:A0:63:3E:AA:8A:9D:C5:F8:07:03 +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV +BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu +MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQy +MDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx +EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjIw +ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbCw3Oe +NcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNH +PWSb6WiaxswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3I +x2ymrdMxp7zo5eFm1tL7A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbe +QTg06ov80egEFGEtQX6sx3dOy1FU+16SGBsEWmjGycT6txOgmLcRK7fWV8x8nhfR +yyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqVg8NTEQxzHQuyRpDRQjrO +QG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa5Beny912 +H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJ +QfYEkoopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUD +i/ZnWejBBhG93c+AAk9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORs +nLMOPReisjQS1n6yqEm70XooQL6iFh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1 +rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5uQu0wDQYJKoZI +hvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM +tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqf +GopTpti72TVVsRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkb +lvdhuDvEK7Z4bLQjb/D907JedR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka ++elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W81k/BfDxujRNt+3vrMNDcTa/F1bal +TFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjxmHHEt38OFdAlab0i +nSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01utI3 +gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18Dr +G5gPcFw0sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3Os +zMOl6W8KjptlwlCFtaOgUxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8x +L4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL +-----END CERTIFICATE----- + +### E-Tu\U011Fra EBG Bili\U015Fim Teknolojileri ve Hizmetleri A.\U015E. + +=== /C=TR/L=Ankara/O=E-Tu\xC4\x9Fra EBG Bili\xC5\x9Fim Teknolojileri ve Hizmetleri A.\xC5\x9E./OU=E-Tugra Sertifikasyon Merkezi/CN=E-Tugra Certification Authority +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 7667447206703254355 (0x6a683e9c519bcb53) + Signature Algorithm: sha256WithRSAEncryption Validity - Not Before: Sep 30 21:12:19 2000 GMT - Not After : Sep 30 14:01:15 2021 GMT - Subject: O=Digital Signature Trust Co., CN=DST Root CA X3 + Not Before: Mar 5 12:09:48 2013 GMT + Not After : Mar 3 12:09:48 2023 GMT + Subject: C=TR, L=Ankara, O=E-Tu\xC4\x9Fra EBG Bili\xC5\x9Fim Teknolojileri ve Hizmetleri A.\xC5\x9E., OU=E-Tugra Sertifikasyon Merkezi, CN=E-Tugra Certification Authority X509v3 extensions: + X509v3 Subject Key Identifier: + 2E:E3:DB:B2:49:D0:9C:54:79:5C:FA:27:2A:FE:CC:4E:D2:E8:4E:54 X509v3 Basic Constraints: critical CA:TRUE + X509v3 Authority Key Identifier: + keyid:2E:E3:DB:B2:49:D0:9C:54:79:5C:FA:27:2A:FE:CC:4E:D2:E8:4E:54 + X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - C4:A7:B1:A4:7B:2C:71:FA:DB:E1:4B:90:75:FF:C4:15:60:85:89:10 -SHA1 Fingerprint=DA:C9:02:4F:54:D8:F6:DF:94:93:5F:B1:73:26:38:CA:6A:D7:7C:13 -SHA256 Fingerprint=06:87:26:03:31:A7:24:03:D9:09:F1:05:E6:9B:CF:0D:32:E1:BD:24:93:FF:C6:D9:20:6D:11:BC:D6:77:07:39 +SHA1 Fingerprint=51:C6:E7:08:49:06:6E:F3:92:D4:5C:A0:0D:6D:A3:62:8F:C3:52:39 +SHA256 Fingerprint=B0:BF:D5:2B:B0:D7:D9:BD:92:BF:5D:4D:C1:3D:A2:55:C0:2C:54:2F:37:83:65:EA:89:39:11:F5:5E:55:F2:3C -----BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ -MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT -DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow -PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD -Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O -rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq -OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b -xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw -7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD -aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV -HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG -SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 -ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr -AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz -R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 -JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo -Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNV +BAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBC +aWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNV +BAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQDDB9FLVR1 +Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMwNTEyMDk0OFoXDTIz +MDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+ +BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhp +em1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN +ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4vU/kwVRHoViVF56C/UY +B4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vdhQd2h8y/L5VMzH2nPbxH +D5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5KCKpbknSF +Q9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEo +q1+gElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3D +k14opz8n8Y4e0ypQBaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcH +fC425lAcP9tDJMW/hkd5s3kc91r0E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsut +dEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gzrt48Ue7LE3wBf4QOXVGUnhMM +ti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAqjqFGOjGY5RH8 +zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn +rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUX +U8u3Zg5mTPj5dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6 +Jyr+zE7S6E5UMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5 +XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAF +Nzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAKkEh47U6YA5n+KGCR +HTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jOXKqY +GwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c +77NCR807VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3 ++GbHeJAAFS6LrVE1Uweoa2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WK +vJUawSg5TB9D0pH0clmKuVb8P7Sd2nCcdlqMQ1DujjByTd//SffGqWfZbawCEeI6 +FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEVKV0jq9BgoRJP3vQXzTLl +yb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gTDx4JnW2P +AJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpD +y4Q08ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8d +NL/+I5c30jn6PQ0GC7TbO6Orb1wdtn7os4I07QZcJA== -----END CERTIFICATE----- ### Entrust, Inc. @@ -1355,6 +2458,65 @@ bYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er fF6adulZkMV8gzURZVE= -----END CERTIFICATE----- +### FNMT-RCM + +=== /C=ES/O=FNMT-RCM/OU=AC RAIZ FNMT-RCM +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 5d:93:8d:30:67:36:c8:06:1d:1a:c7:54:84:69:07 + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Oct 29 15:59:56 2008 GMT + Not After : Jan 1 00:00:00 2030 GMT + Subject: C=ES, O=FNMT-RCM, OU=AC RAIZ FNMT-RCM + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + F7:7D:C5:FD:C4:E8:9A:1B:77:64:A7:F5:1D:A0:CC:BF:87:60:9A:6D + X509v3 Certificate Policies: + Policy: X509v3 Any Policy + CPS: http://www.cert.fnmt.es/dpcs/ + +SHA1 Fingerprint=EC:50:35:07:B2:15:C4:95:62:19:E2:A8:9A:5B:42:99:2C:4C:2C:20 +SHA256 Fingerprint=EB:C5:57:0C:29:01:8C:4D:67:B1:AA:12:7B:AF:12:F7:03:B4:61:1E:BC:17:B7:DA:B5:57:38:94:17:9B:93:FA +-----BEGIN CERTIFICATE----- +MIIFgzCCA2ugAwIBAgIPXZONMGc2yAYdGsdUhGkHMA0GCSqGSIb3DQEBCwUAMDsx +CzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJ +WiBGTk1ULVJDTTAeFw0wODEwMjkxNTU5NTZaFw0zMDAxMDEwMDAwMDBaMDsxCzAJ +BgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBG +Tk1ULVJDTTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALpxgHpMhm5/ +yBNtwMZ9HACXjywMI7sQmkCpGreHiPibVmr75nuOi5KOpyVdWRHbNi63URcfqQgf +BBckWKo3Shjf5TnUV/3XwSyRAZHiItQDwFj8d0fsjz50Q7qsNI1NOHZnjrDIbzAz +WHFctPVrbtQBULgTfmxKo0nRIBnuvMApGGWn3v7v3QqQIecaZ5JCEJhfTzC8PhxF +tBDXaEAUwED653cXeuYLj2VbPNmaUtu1vZ5Gzz3rkQUCwJaydkxNEJY7kvqcfw+Z +374jNUUeAlz+taibmSXaXvMiwzn15Cou08YfxGyqxRxqAQVKL9LFwag0Jl1mpdIC +IfkYtwb1TplvqKtMUejPUBjFd8g5CSxJkjKZqLsXF3mwWsXmo8RZZUc1g16p6DUL +mbvkzSDGm0oGObVo/CK67lWMK07q87Hj/LaZmtVC+nFNCM+HHmpxffnTtOmlcYF7 +wk5HlqX2doWjKI/pgG6BU6VtX7hI+cL5NqYuSf+4lsKMB7ObiFj86xsc3i1w4peS +MKGJ47xVqCfWS+2QrYv6YyVZLag13cqXM7zlzced0ezvXg5KkAYmY6252TUtB7p2 +ZSysV4999AeU14ECll2jB0nVetBX+RvnU0Z1qrB5QstocQjpYL05ac70r8NWQMet +UqIJ5G+GR4of6ygnXYMgrwTJbFaai0b1AgMBAAGjgYMwgYAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFPd9xf3E6Jobd2Sn9R2gzL+H +YJptMD4GA1UdIAQ3MDUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1odHRwOi8vd3d3 +LmNlcnQuZm5tdC5lcy9kcGNzLzANBgkqhkiG9w0BAQsFAAOCAgEAB5BK3/MjTvDD +nFFlm5wioooMhfNzKWtN/gHiqQxjAb8EZ6WdmF/9ARP67Jpi6Yb+tmLSbkyU+8B1 +RXxlDPiyN8+sD8+Nb/kZ94/sHvJwnvDKuO+3/3Y3dlv2bojzr2IyIpMNOmqOFGYM +LVN0V2Ue1bLdI4E7pWYjJ2cJj+F3qkPNZVEI7VFY/uY5+ctHhKQV8Xa7pO6kO8Rf +77IzlhEYt8llvhjho6Tc+hj507wTmzl6NLrTQfv6MooqtyuGC2mDOL7Nii4LcK2N +JpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71uSANA+iW+YJF1DngoABd15jm +fZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8TxxuBEOb+dY7Ixjp +6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp +1txyM/1d8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B +9kiABdcPUXmsEKvU7ANm5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wok +RqEIr9baRRmW1FMdW4R58MD3R++Lj8UGrp1MYp3/RgT408m2ECVAdf4WqslKYIYv +uu8wd+RU4riEmViAqhOLUTpPSPaLtrM= +-----END CERTIFICATE----- + ### GeoTrust Inc. === /C=US/O=GeoTrust Inc./CN=GeoTrust Global CA @@ -1397,49 +2559,6 @@ PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV 5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== -----END CERTIFICATE----- -=== /C=US/O=GeoTrust Inc./CN=GeoTrust Global CA 2 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: sha1WithRSAEncryption - Validity - Not Before: Mar 4 05:00:00 2004 GMT - Not After : Mar 4 05:00:00 2019 GMT - Subject: C=US, O=GeoTrust Inc., CN=GeoTrust Global CA 2 - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Subject Key Identifier: - 71:38:36:F2:02:31:53:47:2B:6E:BA:65:46:A9:10:15:58:20:05:09 - X509v3 Authority Key Identifier: - keyid:71:38:36:F2:02:31:53:47:2B:6E:BA:65:46:A9:10:15:58:20:05:09 - - X509v3 Key Usage: critical - Digital Signature, Certificate Sign, CRL Sign -SHA1 Fingerprint=A9:E9:78:08:14:37:58:88:F2:05:19:B0:6D:2B:0D:2B:60:16:90:7D -SHA256 Fingerprint=CA:2D:82:A0:86:77:07:2F:8A:B6:76:4F:F0:35:67:6C:FE:3E:5E:32:5E:01:21:72:DF:3F:92:09:6D:B7:9B:85 ------BEGIN CERTIFICATE----- -MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEW -MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFs -IENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3Qg -R2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvPE1A -PRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/NTL8 -Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hL -TytCOb1kLUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL -5mkWRxHCJ1kDs6ZgwiFAVvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7 -S4wMcoKK+xfNAGw6EzywhIdLFnopsk/bHdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe -2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE -FHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNHK266ZUap -EBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6td -EPx7srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv -/NgdRN3ggX+d6YvhZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywN -A0ZF66D0f0hExghAzN4bcLUprbqLOzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0 -abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkCx1YAzUm5s2x7UwQa4qjJqhIF -I8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqFH4z1Ir+rzoPz -4iIprn2DQKi6bA== ------END CERTIFICATE----- === /C=US/O=GeoTrust Inc./CN=GeoTrust Primary Certification Authority Certificate: Data: @@ -1829,6 +2948,61 @@ mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH WD9f -----END CERTIFICATE----- +=== /OU=GlobalSign Root CA - R6/O=GlobalSign/CN=GlobalSign +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 45:e6:bb:03:83:33:c3:85:65:48:e6:ff:45:51 + Signature Algorithm: sha384WithRSAEncryption + Validity + Not Before: Dec 10 00:00:00 2014 GMT + Not After : Dec 10 00:00:00 2034 GMT + Subject: OU=GlobalSign Root CA - R6, O=GlobalSign, CN=GlobalSign + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + AE:6C:05:A3:93:13:E2:A2:E7:E2:D7:1C:D6:C7:F0:7F:C8:67:53:A0 + X509v3 Authority Key Identifier: + keyid:AE:6C:05:A3:93:13:E2:A2:E7:E2:D7:1C:D6:C7:F0:7F:C8:67:53:A0 + +SHA1 Fingerprint=80:94:64:0E:B5:A7:A1:CA:11:9C:1F:DD:D5:9F:81:02:63:A7:FB:D1 +SHA256 Fingerprint=2C:AB:EA:FE:37:D0:6C:A2:2A:BA:73:91:C0:03:3D:25:98:29:52:C4:53:64:73:49:76:3A:3A:B5:AD:6C:CF:69 +-----BEGIN CERTIFICATE----- +MIIFgzCCA2ugAwIBAgIORea7A4Mzw4VlSOb/RVEwDQYJKoZIhvcNAQEMBQAwTDEg +MB4GA1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2Jh +bFNpZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMTQxMjEwMDAwMDAwWhcNMzQx +MjEwMDAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSNjET +MBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCAiIwDQYJ +KoZIhvcNAQEBBQADggIPADCCAgoCggIBAJUH6HPKZvnsFMp7PPcNCPG0RQssgrRI +xutbPK6DuEGSMxSkb3/pKszGsIhrxbaJ0cay/xTOURQh7ErdG1rG1ofuTToVBu1k +ZguSgMpE3nOUTvOniX9PeGMIyBJQbUJmL025eShNUhqKGoC3GYEOfsSKvGRMIRxD +aNc9PIrFsmbVkJq3MQbFvuJtMgamHvm566qjuL++gmNQ0PAYid/kD3n16qIfKtJw +LnvnvJO7bVPiSHyMEAc4/2ayd2F+4OqMPKq0pPbzlUoSB239jLKJz9CgYXfIWHSw +1CM69106yqLbnQneXUQtkPGBzVeS+n68UARjNN9rkxi+azayOeSsJDa38O+2HBNX +k7besvjihbdzorg1qkXy4J02oW9UivFyVm4uiMVRQkQVlO6jxTiWm05OWgtH8wY2 +SXcwvHE35absIQh1/OZhFj931dmRl4QKbNQCTXTAFO39OfuD8l4UoQSwC+n+7o/h +bguyCLNhZglqsQY6ZZZZwPA1/cnaKI0aEYdwgQqomnUdnjqGBQCe24DWJfncBZ4n +WUx2OVvq+aWh2IMP0f/fMBH5hc8zSPXKbWQULHpYT9NLCEnFlWQaYw55PfWzjMpY +rZxCRXluDocZXFSxZba/jJvcE+kNb7gu3GduyYsRtYQUigAZcIN5kZeR1Bonvzce +MgfYFGM8KEyvAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBSubAWjkxPioufi1xzWx/B/yGdToDAfBgNVHSMEGDAWgBSu +bAWjkxPioufi1xzWx/B/yGdToDANBgkqhkiG9w0BAQwFAAOCAgEAgyXt6NH9lVLN +nsAEoJFp5lzQhN7craJP6Ed41mWYqVuoPId8AorRbrcWc+ZfwFSY1XS+wc3iEZGt +Ixg93eFyRJa0lV7Ae46ZeBZDE1ZXs6KzO7V33EByrKPrmzU+sQghoefEQzd5Mr61 +55wsTLxDKZmOMNOsIeDjHfrYBzN2VAAiKrlNIC5waNrlU/yDXNOd8v9EDERm8tLj +vUYAGm0CuiVdjaExUd1URhxN25mW7xocBFymFe944Hn+Xds+qkxV/ZoVqW/hpvvf +cDDpw+5CRu3CkwWJ+n1jez/QcYF8AOiYrg54NMMl+68KnyBr3TsTjxKM4kEaSHpz +oHdpx7Zcf4LIHv5YGygrqGytXm3ABdJ7t+uA/iU3/gKbaKxCXcPu9czc8FB10jZp +nOZ7BN9uBmm23goJSFmH63sUYHpkqmlD75HHTOwY3WzvUy2MmeFe8nI+z1TIvWfs +pA9MRf/TuTAjB0yPEL+GltmZWrSZVxykzLsViVO6LAUP5MSeGbEYNNVMnbrt9x+v +JJUEeKgDu+6B5dpffItKoZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R +8k8HWV+LLUNS60YMlOH1Zkd5d9VUWx+tJDfLRVpOoERIyNiwmcUVhAn21klJwGW4 +5hpxbqCo8YLoRT5s1gLXCmeDBVrJpBA= +-----END CERTIFICATE----- ### GlobalSign nv-sa @@ -1919,6 +3093,579 @@ LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI 4uJEvlz36hz1 -----END CERTIFICATE----- +### Google Trust Services LLC + +=== /C=US/O=Google Trust Services LLC/CN=GTS Root R1 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 6e:47:a9:c5:4b:47:0c:0d:ec:33:d0:89:b9:1c:f4:e1 + Signature Algorithm: sha384WithRSAEncryption + Validity + Not Before: Jun 22 00:00:00 2016 GMT + Not After : Jun 22 00:00:00 2036 GMT + Subject: C=US, O=Google Trust Services LLC, CN=GTS Root R1 + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + E4:AF:2B:26:71:1A:2B:48:27:85:2F:52:66:2C:EF:F0:89:13:71:3E +SHA1 Fingerprint=E1:C9:50:E6:EF:22:F8:4C:56:45:72:8B:92:20:60:D7:D5:A7:A3:E8 +SHA256 Fingerprint=2A:57:54:71:E3:13:40:BC:21:58:1C:BD:2C:F1:3E:15:84:63:20:3E:CE:94:BC:F9:D3:CC:19:6B:F0:9A:54:72 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQbkepxUtHDA3sM9CJuRz04TANBgkqhkiG9w0BAQwFADBH +MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM +QzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIy +MDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNl +cnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx9vaM +f/vo27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vX +mX7wCl7raKb0xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7 +zUjwTcLCeoiKu7rPWRnWr4+wB7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0P +fyblqAj+lug8aJRT7oM6iCsVlgmy4HqMLnXWnOunVmSPlk9orj2XwoSPwLxAwAtc +vfaHszVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly4cpk9+aCEI3oncKKiPo4 +Zor8Y/kB+Xj9e1x3+naH+uzfsQ55lVe0vSbv1gHR6xYKu44LtcXFilWr06zqkUsp +zBmkMiVOKvFlRNACzqrOSbTqn3yDsEB750Orp2yjj32JgfpMpf/VjsPOS+C12LOO +Rc92wO1AK/1TD7Cn1TsNsYqiA94xrcx36m97PtbfkSIS5r762DL8EGMUUXLeXdYW +k70paDPvOmbsB4om3xPXV2V4J95eSRQAogB/mqghtqmxlbCluQ0WEdrHbEg8QOB+ +DVrNVjzRlwW5y0vtOUucxD/SVRNuJLDWcfr0wbrM7Rv1/oFB2ACYPTrIrnqYNxgF +lQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQU5K8rJnEaK0gnhS9SZizv8IkTcT4wDQYJKoZIhvcNAQEMBQADggIBADiW +Cu49tJYeX++dnAsznyvgyv3SjgofQXSlfKqE1OXyHuY3UjKcC9FhHb8owbZEKTV1 +d5iyfNm9dKyKaOOpMQkpAWBz40d8U6iQSifvS9efk+eCNs6aaAyC58/UEBZvXw6Z +XPYfcX3v73svfuo21pdwCxXu11xWajOl40k4DLh9+42FpLFZXvRq4d2h9mREruZR +gyFmxhE+885H7pwoHyXa/6xmld01D1zvICxi/ZG6qcz8WpyTgYMpl0p8WnK0OdC3 +d8t5/Wk6kjftbjhlRn7pYL15iJdfOBL07q9bgsiG1eGZbYwE8na6SfZu6W0eX6Dv +J4J2QPim01hcDyxC2kLGe4g0x8HYRZvBPsVhHdljUEn2NIVq4BjFbkerQUIpm/Zg +DdIx02OYI5NaAIFItO/Nis3Jz5nu2Z6qNuFoS3FJFDYoOj0dzpqPJeaAcWErtXvM ++SUWgeExX6GjfhaknBZqlxi9dnKlC54dNuYvoS++cJEPqOba+MSSQGwlfnuzCdyy +F62ARPBopY+Udf90WuioAnwMCeKpSwughQtiue+hMZL77/ZRBIls6Kl0obsXs7X9 +SQ98POyDGCBDTtWTurQ0sR8WNh8M5mQ5Fkzc4P4dyKliPUDqysU0ArSuiYgzNdws +E3PYJ/HQcu51OyLemGhmW/HGY0dVHLqlCFF1pkgl +-----END CERTIFICATE----- +=== /C=US/O=Google Trust Services LLC/CN=GTS Root R2 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 6e:47:a9:c6:5a:b3:e7:20:c5:30:9a:3f:68:52:f2:6f + Signature Algorithm: sha384WithRSAEncryption + Validity + Not Before: Jun 22 00:00:00 2016 GMT + Not After : Jun 22 00:00:00 2036 GMT + Subject: C=US, O=Google Trust Services LLC, CN=GTS Root R2 + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + BB:FF:CA:8E:23:9F:4F:99:CA:DB:E2:68:A6:A5:15:27:17:1E:D9:0E +SHA1 Fingerprint=D2:73:96:2A:2A:5E:39:9F:73:3F:E1:C7:1E:64:3F:03:38:34:FC:4D +SHA256 Fingerprint=C4:5D:7B:B0:8E:6D:67:E6:2E:42:35:11:0B:56:4E:5F:78:FD:92:EF:05:8C:84:0A:EA:4E:64:55:D7:58:5C:60 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQbkepxlqz5yDFMJo/aFLybzANBgkqhkiG9w0BAQwFADBH +MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM +QzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIy +MDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNl +cnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQDO3v2m++zsFDQ8BwZabFn3GTXd98GdVarTzTukk3Lv +CvptnfbwhYBboUhSnznFt+4orO/LdmgUud+tAWyZH8QiHZ/+cnfgLFuv5AS/T3Kg +GjSY6Dlo7JUle3ah5mm5hRm9iYz+re026nO8/4Piy33B0s5Ks40FnotJk9/BW9Bu +XvAuMC6C/Pq8tBcKSOWIm8Wba96wyrQD8Nr0kLhlZPdcTK3ofmZemde4wj7I0BOd +re7kRXuJVfeKH2JShBKzwkCX44ofR5GmdFrS+LFjKBC4swm4VndAoiaYecb+3yXu +PuWgf9RhD1FLPD+M2uFwdNjCaKH5wQzpoeJ/u1U8dgbuak7MkogwTZq9TwtImoS1 +mKPV+3PBV2HdKFZ1E66HjucMUQkQdYhMvI35ezzUIkgfKtzra7tEscszcTJGr61K +8YzodDqs5xoic4DSMPclQsciOzsSrZYuxsN2B6ogtzVJV+mSSeh2FnIxZyuWfoqj +x5RWIr9qS34BIbIjMt/kmkRtWVtd9QCgHJvGeJeNkP+byKq0rxFROV7Z+2et1VsR +nTKaG73VululycslaVNVJ1zgyjbLiGH7HrfQy+4W+9OmTN6SpdTi3/UGVN4unUu0 +kzCqgc7dGtxRcw1PcOnlthYhGXmy5okLdWTK1au8CcEYof/UVKGFPP0UJAOyh9Ok +twIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUu//KjiOfT5nK2+JopqUVJxce2Q4wDQYJKoZIhvcNAQEMBQADggIBALZp +8KZ3/p7uC4Gt4cCpx/k1HUCCq+YEtN/L9x0Pg/B+E02NjO7jMyLDOfxA325BS0JT +vhaI8dI4XsRomRyYUpOM52jtG2pzegVATX9lO9ZY8c6DR2Dj/5epnGB3GFW1fgiT +z9D2PGcDFWEJ+YF59exTpJ/JjwGLc8R3dtyDovUMSRqodt6Sm2T4syzFJ9MHwAiA +pJiS4wGWAqoC7o87xdFtCjMwc3i5T1QWvwsHoaRc5svJXISPD+AVdyx+Jn7axEvb +pxZ3B7DNdehyQtaVhJ2Gg/LkkM0JR9SLA3DaWsYDQvTtN6LwG1BUSw7YhN4ZKJmB +R64JGz9I0cNv4rBgF/XuIwKl2gBbbZCr7qLpGzvpx0QnRY5rn/WkhLx3+WuXrD5R +RaIRpsyF7gpo8j5QOHokYh4XIDdtak23CZvJ/KRY9bb7nE4Yu5UC56GtmwfuNmsk +0jmGwZODUNKBRqhfYlcsu2xkiAhu7xNUX90txGdj08+JN7+dIPT7eoOboB6BAFDC +5AwiWVIQ7UNWhwD4FFKnHYuTjKJNRn8nxnGbJN7k2oaLDX5rIMHAnuFl2GqjpuiF +izoHCBy69Y9Vmhh1fuXsgWbRIXOhNUQLgD1bnF5vKheW0YMjiGZt5obicDIvUiLn +yOd/xCxgXS/Dr55FBcOEArf9LAhST4Ldo/DUhgkC +-----END CERTIFICATE----- +=== /C=US/O=Google Trust Services LLC/CN=GTS Root R3 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 6e:47:a9:c7:6c:a9:73:24:40:89:0f:03:55:dd:8d:1d + Signature Algorithm: ecdsa-with-SHA384 + Validity + Not Before: Jun 22 00:00:00 2016 GMT + Not After : Jun 22 00:00:00 2036 GMT + Subject: C=US, O=Google Trust Services LLC, CN=GTS Root R3 + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + C1:F1:26:BA:A0:2D:AE:85:81:CF:D3:F1:2A:12:BD:B8:0A:67:FD:BC +SHA1 Fingerprint=30:D4:24:6F:07:FF:DB:91:89:8A:0B:E9:49:66:11:EB:8C:5E:46:E5 +SHA256 Fingerprint=15:D5:B8:77:46:19:EA:7D:54:CE:1C:A6:D0:B0:C4:03:E0:37:A9:17:F1:31:E8:A0:4E:1E:6B:7A:71:BA:BC:E5 +-----BEGIN CERTIFICATE----- +MIICDDCCAZGgAwIBAgIQbkepx2ypcyRAiQ8DVd2NHTAKBggqhkjOPQQDAzBHMQsw +CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU +MBIGA1UEAxMLR1RTIFJvb3QgUjMwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAw +MDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp +Y2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjMwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQfTzOHMymKoYTey8chWEGJ6ladK0uFxh1MJ7x/JlFyb+Kf1qPKzEUURout +736GjOyxfi//qXGdGIRFBEFVbivqJn+7kAHjSxm65FSWRQmx1WyRRK2EE46ajA2A +DDL24CejQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud +DgQWBBTB8Sa6oC2uhYHP0/EqEr24Cmf9vDAKBggqhkjOPQQDAwNpADBmAjEAgFuk +fCPAlaUs3L6JbyO5o91lAFJekazInXJ0glMLfalAvWhgxeG4VDvBNhcl2MG9AjEA +njWSdIUlUfUk7GRSJFClH9voy8l27OyCbvWFGFPouOOaKaqW04MjyaR7YbPMAuhd +-----END CERTIFICATE----- +=== /C=US/O=Google Trust Services LLC/CN=GTS Root R4 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 6e:47:a9:c8:8b:94:b6:e8:bb:3b:2a:d8:a2:b2:c1:99 + Signature Algorithm: ecdsa-with-SHA384 + Validity + Not Before: Jun 22 00:00:00 2016 GMT + Not After : Jun 22 00:00:00 2036 GMT + Subject: C=US, O=Google Trust Services LLC, CN=GTS Root R4 + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + 80:4C:D6:EB:74:FF:49:36:A3:D5:D8:FC:B5:3E:C5:6A:F0:94:1D:8C +SHA1 Fingerprint=2A:1D:60:27:D9:4A:B1:0A:1C:4D:91:5C:CD:33:A0:CB:3E:2D:54:CB +SHA256 Fingerprint=71:CC:A5:39:1F:9E:79:4B:04:80:25:30:B3:63:E1:21:DA:8A:30:43:BB:26:66:2F:EA:4D:CA:7F:C9:51:A4:BD +-----BEGIN CERTIFICATE----- +MIICCjCCAZGgAwIBAgIQbkepyIuUtui7OyrYorLBmTAKBggqhkjOPQQDAzBHMQsw +CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU +MBIGA1UEAxMLR1RTIFJvb3QgUjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAw +MDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp +Y2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa6zzu +hXyiQHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/l +xKvRHYqjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud +DgQWBBSATNbrdP9JNqPV2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNnADBkAjBqUFJ0 +CMRw3J5QdCHojXohw0+WbhXRIjVhLfoIN+4Zba3bssx9BzT1YBkstTTZbyACMANx +sbqjYAuG7ZoIapVon+Kz4ZNkfF6Tpt95LY2F45TPI11xzPKwTdb+mciUqXWi4w== +-----END CERTIFICATE----- + +### Government Root Certification Authority + +=== /C=TW/O=Government Root Certification Authority +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 1f:9d:59:5a:d7:2f:c2:06:44:a5:80:08:69:e3:5e:f6 + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Dec 5 13:23:33 2002 GMT + Not After : Dec 5 13:23:33 2032 GMT + Subject: C=TW, O=Government Root Certification Authority + X509v3 extensions: + X509v3 Subject Key Identifier: + CC:CC:EF:CC:29:60:A4:3B:B1:92:B6:3C:FA:32:62:8F:AC:25:15:3B + X509v3 Basic Constraints: + CA:TRUE + setCext-hashedRoot: + 0/0-...0...+......0...g*........"...(6....2.1:.Qe +SHA1 Fingerprint=F4:8B:11:BF:DE:AB:BE:94:54:20:71:E6:41:DE:6B:BE:88:2B:40:B9 +SHA256 Fingerprint=76:00:29:5E:EF:E8:5B:9E:1F:D6:24:DB:76:06:2A:AA:AE:59:81:8A:54:D2:77:4C:D4:C0:B2:C0:11:31:E1:B3 +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/ +MQswCQYDVQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1ow +PzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB +AJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qNw8XR +IePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1q +gQdW8or5BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKy +yhwOeYHWtXBiCAEuTk8O1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAts +F/tnyMKtsc2AtJfcdgEWFelq16TheEfOhtX7MfP6Mb40qij7cEwdScevLJ1tZqa2 +jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wovJ5pGfaENda1UhhXcSTvx +ls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7Q3hub/FC +VGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHK +YS1tB6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoH +EgKXTiCQ8P8NHuJBO9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThN +Xo+EHWbNxWCWtFJaBYmOlXqYwZE8lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1Ud +DgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNVHRMEBTADAQH/MDkGBGcqBwAE +MTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg209yewDL7MTqK +UWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ +TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyf +qzvS/3WXy6TjZwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaK +ZEk9GhiHkASfQlK3T8v+R0F2Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFE +JPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlUD7gsL0u8qV1bYH+Mh6XgUmMqvtg7 +hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6QzDxARvBMB1uUO07+1 +EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+HbkZ6Mm +nD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WX +udpVBrkk7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44Vbnz +ssQwmSNOXfJIoRIM3BKQCZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDe +LMDDav7v3Aun+kbfYNucpllQdSNpc5Oy+fwC00fmcc4QAu4njIT/rEUNE1yDMuAl +pYYsfPQS +-----END CERTIFICATE----- + +### GUANG DONG CERTIFICATE AUTHORITY CO.,LTD. + +=== /C=CN/O=GUANG DONG CERTIFICATE AUTHORITY CO.,LTD./CN=GDCA TrustAUTH R5 ROOT +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 9009899650740120186 (0x7d0997fef047ea7a) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Nov 26 05:13:15 2014 GMT + Not After : Dec 31 15:59:59 2040 GMT + Subject: C=CN, O=GUANG DONG CERTIFICATE AUTHORITY CO.,LTD., CN=GDCA TrustAUTH R5 ROOT + X509v3 extensions: + X509v3 Subject Key Identifier: + E2:C9:40:9F:4D:CE:E8:9A:A1:7C:CF:0E:3F:65:C5:29:88:6A:19:51 + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign +SHA1 Fingerprint=0F:36:38:5B:81:1A:25:C3:9B:31:4E:83:CA:E9:34:66:70:CC:74:B4 +SHA256 Fingerprint=BF:FF:8F:D0:44:33:48:7D:6A:8A:A6:0C:1A:29:76:7A:9F:C2:BB:B0:5E:42:0F:71:3A:13:B9:92:89:1D:38:93 +-----BEGIN CERTIFICATE----- +MIIFiDCCA3CgAwIBAgIIfQmX/vBH6nowDQYJKoZIhvcNAQELBQAwYjELMAkGA1UE +BhMCQ04xMjAwBgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZ +IENPLixMVEQuMR8wHQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMB4XDTE0 +MTEyNjA1MTMxNVoXDTQwMTIzMTE1NTk1OVowYjELMAkGA1UEBhMCQ04xMjAwBgNV +BAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZIENPLixMVEQuMR8w +HQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA2aMW8Mh0dHeb7zMNOwZ+Vfy1YI92hhJCfVZmPoiC7XJj +Dp6L3TQsAlFRwxn9WVSEyfFrs0yw6ehGXTjGoqcuEVe6ghWinI9tsJlKCvLriXBj +TnnEt1u9ol2x8kECK62pOqPseQrsXzrj/e+APK00mxqriCZ7VqKChh/rNYmDf1+u +KU49tm7srsHwJ5uu4/Ts765/94Y9cnrrpftZTqfrlYwiOXnhLQiPzLyRuEH3FMEj +qcOtmkVEs7LXLM3GKeJQEK5cy4KOFxg2fZfmiJqwTTQJ9Cy5WmYqsBebnh52nUpm +MUHfP/vFBu8btn4aRjb3ZGM74zkYI+dndRTVdVeSN72+ahsmUPI2JgaQxXABZG12 +ZuGR224HwGGALrIuL4xwp9E7PLOR5G62xDtw8mySlwnNR30YwPO7ng/Wi64HtloP +zgsMR6flPri9fcebNaBhlzpBdRfMK5Z3KpIhHtmVdiBnaM8Nvd/WHwlqmuLMc3Gk +L30SgLdTMEZeS1SZD2fJpcjyIMGC7J0R38IC+xo70e0gmu9lZJIQDSri3nDxGGeC +jGHeuLzRL5z7D9Ar7Rt2ueQ5Vfj4oR24qoAATILnsn8JuLwwoC8N9VKejveSswoA +HQBUlwbgsQfZxw9cZX08bVlX5O2ljelAU58VS6Bx9hoh49pwBiFYFIeFd3mqgnkC +AwEAAaNCMEAwHQYDVR0OBBYEFOLJQJ9NzuiaoXzPDj9lxSmIahlRMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQDRSVfg +p8xoWLoBDysZzY2wYUWsEe1jUGn4H3++Fo/9nesLqjJHdtJnJO29fDMylyrHBYZm +DRd9FBUb1Ov9H5r2XpdptxolpAqzkT9fNqyL7FeoPueBihhXOYV0GkLH6VsTX4/5 +COmSdI31R9KrO9b7eGZONn356ZLpBN79SWP8bfsUcZNnL0dKt7n/HipzcEYwv1ry +L3ml4Y0M2fmyYzeMN2WFcGpcWwlyua1jPLHd+PwyvzeG5LuOmCd+uh8W4XAR8gPf +JWIyJyYYMoSf/wA6E7qaTfRPuBRwIrHKK5DOKcFw9C+df/KQHtZa37dG/OaG+svg +IHZ6uqbL9XzeYqWxi+7egmaKTjowHz+Ay60nugxe19CxVsp3cbK1daFQqUBDF8Io +2c9Si1vIY9RCPqAzekYu9wogRlR+ak8x8YF+QnQ4ZXMn7sZ8uI7XpTrXmKGcjBBV +09tL7ECQ8s1uV9JiDnxXk7Gnbc2dg7sq5+W2O3FYrf3RRbxake5TFW/TRQl1brqQ +XR4EzzffHqhmsYzmIGrv/EhOdJhCrylvLmrH+33RZjEizIYAfmaDDEL0vTSSwxrq +T8p+ck0LcIymSLumoRT2+1hEmRSuqguTaaApJUqlyyvdimYHFngVV3Eb7PVHhPOe +MTd61X8kreS8/f3MboPoDKi3QWwH3b08hpcv0g== +-----END CERTIFICATE----- + +### Hellenic Academic and Research Institutions Cert. Authority + +=== /C=GR/L=Athens/O=Hellenic Academic and Research Institutions Cert. Authority/CN=Hellenic Academic and Research Institutions ECC RootCA 2015 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 0 (0x0) + Signature Algorithm: ecdsa-with-SHA256 + Validity + Not Before: Jul 7 10:37:12 2015 GMT + Not After : Jun 30 10:37:12 2040 GMT + Subject: C=GR, L=Athens, O=Hellenic Academic and Research Institutions Cert. Authority, CN=Hellenic Academic and Research Institutions ECC RootCA 2015 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + B4:22:0B:82:99:24:01:0E:9C:BB:E4:0E:FD:BF:FB:97:20:93:99:2A +SHA1 Fingerprint=9F:F1:71:8D:92:D5:9A:F3:7D:74:97:B4:BC:6F:84:68:0B:BA:B6:66 +SHA256 Fingerprint=44:B5:45:AA:8A:25:E6:5A:73:CA:15:DC:27:FC:36:D2:4C:1C:B9:95:3A:06:65:39:B1:15:82:DC:48:7B:48:33 +-----BEGIN CERTIFICATE----- +MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzAN +BgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl +c2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hl +bGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgRUNDIFJv +b3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEwMzcxMlowgaoxCzAJ +BgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmljIEFj +YWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5 +MUQwQgYDVQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0 +dXRpb25zIEVDQyBSb290Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKg +QehLgoRc4vgxEZmGZE4JJS+dQS8KrjVPdJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJa +jq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoKVlp8aQuqgAkkbH7BRqNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFLQi +C4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaep +lSTAGiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7Sof +TUwJCA3sS61kFyjndc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR +-----END CERTIFICATE----- +=== /C=GR/L=Athens/O=Hellenic Academic and Research Institutions Cert. Authority/CN=Hellenic Academic and Research Institutions RootCA 2015 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 0 (0x0) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Jul 7 10:11:21 2015 GMT + Not After : Jun 30 10:11:21 2040 GMT + Subject: C=GR, L=Athens, O=Hellenic Academic and Research Institutions Cert. Authority, CN=Hellenic Academic and Research Institutions RootCA 2015 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 71:15:67:C8:C8:C9:BD:75:5D:72:D0:38:18:6A:9D:F3:71:24:54:0B +SHA1 Fingerprint=01:0C:06:95:A6:98:19:14:FF:BF:5F:C6:B0:B6:95:EA:29:E9:12:A6 +SHA256 Fingerprint=A0:40:92:9A:02:CE:53:B4:AC:F4:F2:FF:C6:98:1C:E4:49:6F:75:5E:6D:45:FE:0B:2A:69:2B:CD:52:52:3F:36 +-----BEGIN CERTIFICATE----- +MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1Ix +DzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5k +IFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMT +N0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9v +dENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAxMTIxWjCBpjELMAkG +A1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNh +ZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkx +QDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 +dGlvbnMgUm9vdENBIDIwMTUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDC+Kk/G4n8PDwEXT2QNrCROnk8ZlrvbTkBSRq0t89/TSNTt5AA4xMqKKYx8ZEA +4yjsriFBzh/a/X0SWwGDD7mwX5nh8hKDgE0GPt+sr+ehiGsxr/CL0BgzuNtFajT0 +AoAkKAoCFZVedioNmToUW/bLy1O8E00BiDeUJRtCvCLYjqOWXjrZMts+6PAQZe10 +4S+nfK8nNLspfZu2zwnI5dMK/IhlZXQK3HMcXM1AsRzUtoSMTFDPaI6oWa7CJ06C +ojXdFPQf/7J31Ycvqm59JCfnxssm5uX+Zwdj2EUN3TpZZTlYepKZcj2chF6IIbjV +9Cz82XBST3i4vTwri5WY9bPRaM8gFH5MXF/ni+X1NYEZN9cRCLdmvtNKzoNXADrD +gfgXy5I2XdGj2HUb4Ysn6npIQf1FGQatJ5lOwXBH3bWfgVMS5bGMSF0xQxfjjMZ6 +Y5ZLKTBOhE5iGV48zpeQpX8B653g+IuJ3SWYPZK2fu/Z8VFRfS0myGlZYeCsargq +NhEEelC9MoS+L9xy1dcdFkfkR2YgP/SWxa+OAXqlD3pk9Q0Yh9muiNX6hME6wGko +LfINaFGq46V3xqSQDqE3izEjR8EJCOtu93ib14L8hCCZSRm2Ekax+0VVFqmjZayc +Bw/qa9wfLgZy7IaIEuQt218FL+TwA9MmM+eAws1CoRc0CwIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVd +ctA4GGqd83EkVAswDQYJKoZIhvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0I +XtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg2mF+D1hYc2Ryx+hFjtyp8iY/xnmMsVMI +M4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrMd/K4kPFox/la/vot +9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+yd+2V +Z5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/ea +j8GsGsVn82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnh +X9izjFk0WaSrT2y7HxjbdavYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQ +l033DlZdwJVqwjbDG2jJ9SrcR5q+ss7FJej6A7na+RZukYT1HCjI/CbM1xyQVqdf +bzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVtJ94Cj8rDtSvK6evIIVM4 +pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGaJI7ZjnHK +e7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0 +vm9qp/UsQu0yrbYhnr68 +-----END CERTIFICATE----- +=== /C=GR/O=Hellenic Academic and Research Institutions Cert. Authority/CN=Hellenic Academic and Research Institutions RootCA 2011 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 0 (0x0) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Dec 6 13:49:52 2011 GMT + Not After : Dec 1 13:49:52 2031 GMT + Subject: C=GR, O=Hellenic Academic and Research Institutions Cert. Authority, CN=Hellenic Academic and Research Institutions RootCA 2011 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + A6:91:42:FD:13:61:4A:23:9E:08:A4:29:E5:D8:13:04:23:EE:41:25 + X509v3 Name Constraints: + Permitted: + DNS:.gr + DNS:.eu + DNS:.edu + DNS:.org + email:.gr + email:.eu + email:.edu + email:.org + +SHA1 Fingerprint=FE:45:65:9B:79:03:5B:98:A1:61:B5:51:2E:AC:DA:58:09:48:22:4D +SHA256 Fingerprint=BC:10:4F:15:A4:8B:E7:09:DC:A5:42:A7:E1:D4:B9:DF:6F:05:45:27:E8:02:EA:A9:2D:59:54:44:25:8A:FE:71 +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1Ix +RDBCBgNVBAoTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 +dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1p +YyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIFJvb3RDQSAyMDExMB4XDTExMTIw +NjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYTAkdSMUQwQgYDVQQK +EztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIENl +cnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl +c2VhcmNoIEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPz +dYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJ +fel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa71HFK9+WXesyHgLacEns +bgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u8yBRQlqD +75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSP +FEDH3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNV +HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp +5dgTBCPuQSUwRwYDVR0eBEAwPqA8MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQu +b3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQub3JnMA0GCSqGSIb3DQEBBQUA +A4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVtXdMiKahsog2p +6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 +TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7 +dIsXRSZMFpGD/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8Acys +Nnq/onN694/BtZqhFLKPM58N7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXI +l7WdmplNsDz4SgCbZN2fOUvRJ9e4 +-----END CERTIFICATE----- + +### Hongkong Post + +=== /C=HK/O=Hongkong Post/CN=Hongkong Post Root CA 1 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1000 (0x3e8) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: May 15 05:13:14 2003 GMT + Not After : May 15 04:52:29 2023 GMT + Subject: C=HK, O=Hongkong Post, CN=Hongkong Post Root CA 1 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE, pathlen:3 + X509v3 Key Usage: critical + Digital Signature, Non Repudiation, Certificate Sign, CRL Sign +SHA1 Fingerprint=D6:DA:A8:20:8D:09:D2:15:4D:24:B5:2F:CB:34:6E:B2:58:B2:8A:58 +SHA256 Fingerprint=F9:E6:7D:33:6C:51:00:2A:C0:54:C6:32:02:2D:66:DD:A2:E7:E3:FF:F1:0A:D0:61:ED:31:D8:BB:B4:10:CF:B2 +-----BEGIN CERTIFICATE----- +MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsx +FjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3Qg +Um9vdCBDQSAxMB4XDTAzMDUxNTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkG +A1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdr +b25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1ApzQ +jVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEn +PzlTCeqrauh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjh +ZY4bXSNmO7ilMlHIhqqhqZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9 +nnV0ttgCXjqQesBCNnLsak3c78QA3xMYV18meMjWCnl3v/evt3a5pQuEF10Q6m/h +q5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNVHRMBAf8ECDAGAQH/AgED +MA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7ih9legYsC +mEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI3 +7piol7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clB +oiMBdDhViw+5LmeiIAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJs +EhTkYY2sEJCehFC78JZvRZ+K88psT/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpO +fMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilTc4afU9hDDl3WY4JxHYB0yvbi +AmvZWg== +-----END CERTIFICATE----- + +### IdenTrust + +=== /C=US/O=IdenTrust/CN=IdenTrust Commercial Root CA 1 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 0a:01:42:80:00:00:01:45:23:c8:44:b5:00:00:00:02 + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Jan 16 18:12:23 2014 GMT + Not After : Jan 16 18:12:23 2034 GMT + Subject: C=US, O=IdenTrust, CN=IdenTrust Commercial Root CA 1 + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + ED:44:19:C0:D3:F0:06:8B:EE:A4:7B:BE:42:E7:26:54:C8:8E:36:76 +SHA1 Fingerprint=DF:71:7E:AA:4A:D9:4E:C9:55:84:99:60:2D:48:DE:5F:BC:F0:3A:25 +SHA256 Fingerprint=5D:56:49:9B:E4:D2:E0:8B:CF:CA:D0:8A:3E:38:72:3D:50:50:3B:DE:70:69:48:E4:2F:55:60:30:19:E5:28:AE +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBK +MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVu +VHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQw +MTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScw +JQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ldhNlT +3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU ++ehcCuz/mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gp +S0l4PJNgiCL8mdo2yMKi1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1 +bVoE/c40yiTcdCMbXTMTEl3EASX2MN0CXZ/g1Ue9tOsbobtJSdifWwLziuQkkORi +T0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl3ZBWzvurpWCdxJ35UrCL +vYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzyNeVJSQjK +Vsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZK +dHzVWYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHT +c+XvvqDtMwt0viAgxGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hv +l7yTmvmcEpB4eoCHFddydJxVdHixuuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5N +iGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZIhvcNAQELBQAD +ggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH +6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwt +LRvM7Kqas6pgghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93 +nAbowacYXVKV7cndJZ5t+qntozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3 ++wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmVYjzlVYA211QC//G5Xc7UI2/YRYRK +W2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUXfeu+h1sXIFRRk0pT +AwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/rokTLq +l1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG +4iZZRHUe2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZ +mUlO+KWA2yUPHGNiiskzZ2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A +7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7RcGzM7vRX+Bi6hG6H +-----END CERTIFICATE----- +=== /C=US/O=IdenTrust/CN=IdenTrust Public Sector Root CA 1 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 0a:01:42:80:00:00:01:45:23:cf:46:7c:00:00:00:02 + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Jan 16 17:53:32 2014 GMT + Not After : Jan 16 17:53:32 2034 GMT + Subject: C=US, O=IdenTrust, CN=IdenTrust Public Sector Root CA 1 + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + E3:71:E0:9E:D8:A7:42:D9:DB:71:91:6B:94:93:EB:C3:A3:D1:14:A3 +SHA1 Fingerprint=BA:29:41:60:77:98:3F:F4:F3:EF:F2:31:05:3B:2E:EA:6D:4D:45:FD +SHA256 Fingerprint=30:D0:89:5A:9A:44:8A:26:20:91:63:55:22:D1:F5:20:10:B5:86:7A:CA:E1:2C:78:EF:95:8F:D4:F4:38:9F:2F +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBN +MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVu +VHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcN +MzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0 +MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTyP4o7 +ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGy +RBb06tD6Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlS +bdsHyo+1W/CD80/HLaXIrcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF +/YTLNiCBWS2ab21ISGHKTN9T0a9SvESfqy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R +3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoSmJxZZoY+rfGwyj4GD3vw +EUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFnol57plzy +9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9V +GxyhLrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ +2fjXctscvG29ZV/viDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsV +WaFHVCkugyhfHMKiq3IXAAaOReyL4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gD +W/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMwDQYJKoZIhvcN +AQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj +t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHV +DRDtfULAj+7AmgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9 +TaDKQGXSc3z1i9kKlT/YPyNtGtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8G +lwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFtm6/n6J91eEyrRjuazr8FGF1NFTwW +mhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMxNRF4eKLg6TCMf4Df +WN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4Mhn5 ++bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJ +tshquDDIajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhA +GaQdp/lLQzfcaFpPz+vCZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv +8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ3Wl9af0AVqW3rLatt8o+Ae+c +-----END CERTIFICATE----- + ### Internet Security Research Group === /C=US/O=Internet Security Research Group/CN=ISRG Root X1 @@ -1973,6 +3720,266 @@ mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= -----END CERTIFICATE----- +### IZENPE S.A. + +=== /C=ES/O=IZENPE S.A./CN=Izenpe.com +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + b0:b7:5a:16:48:5f:bf:e1:cb:f5:8b:d7:19:e6:7d + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Dec 13 13:08:28 2007 GMT + Not After : Dec 13 08:27:25 2037 GMT + Subject: C=ES, O=IZENPE S.A., CN=Izenpe.com + X509v3 extensions: + X509v3 Subject Alternative Name: + email:info@izenpe.com, DirName:/O=IZENPE S.A. - CIF A01337260-RMerc.Vitoria-Gasteiz T1055 F62 S8/street=Avda del Mediterraneo Etorbidea 14 - 01010 Vitoria-Gasteiz + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 1D:1C:65:0E:A8:F2:25:7B:B4:91:CF:E4:B1:B1:E6:BD:55:74:6C:05 +SHA1 Fingerprint=2F:78:3D:25:52:18:A7:4A:65:39:71:B5:2C:A2:9C:45:15:6F:E9:19 +SHA256 Fingerprint=25:30:CC:8E:98:32:15:02:BA:D9:6F:9B:1F:BA:1B:09:9E:2D:29:9E:0F:45:48:BB:91:4F:36:3B:C0:D4:53:1F +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4 +MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6 +ZW5wZS5jb20wHhcNMDcxMjEzMTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYD +VQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5j +b20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ03rKDx6sp4boFmVq +scIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAKClaO +xdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6H +LmYRY2xU+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFX +uaOKmMPsOzTFlUFpfnXCPCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQD +yCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxTOTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+ +JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbKF7jJeodWLBoBHmy+E60Q +rLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK0GqfvEyN +BjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8L +hij+0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIB +QFqNeb+Lz0vPqhbBleStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+ +HMh3/1uaD7euBUbl8agW7EekFwIDAQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2lu +Zm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+SVpFTlBFIFMuQS4gLSBDSUYg +QTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBGNjIgUzgxQzBB +BgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx +MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUA +A4ICAQB4pgwWSp9MiDrAyw6lFn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWb +laQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbgakEyrkgPH7UIBzg/YsfqikuFgba56 +awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8qhT/AQKM6WfxZSzwo +JNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Csg1lw +LDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCT +VyvehQP5aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGk +LhObNA5me0mrZJfQRsN5nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJb +UjWumDqtujWTI6cfSN01RpiyEGjkpTHCClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/ +QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZoQ0iy2+tzJOeRf1SktoA+ +naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1ZWrOZyGls +QyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +### Japan Certification Services, Inc. + +=== /C=JP/O=Japan Certification Services, Inc./CN=SecureSign RootCA11 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Apr 8 04:56:47 2009 GMT + Not After : Apr 8 04:56:47 2029 GMT + Subject: C=JP, O=Japan Certification Services, Inc., CN=SecureSign RootCA11 + X509v3 extensions: + X509v3 Subject Key Identifier: + 5B:F8:4D:4F:B2:A5:86:D4:3A:D2:F1:63:9A:A0:BE:09:F6:57:B7:DE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE +SHA1 Fingerprint=3B:C4:9F:48:F8:F3:73:A0:9C:1E:BD:F8:5B:B1:C3:65:C7:D8:11:B3 +SHA256 Fingerprint=BF:0F:EE:FB:9E:3A:58:1A:D5:F9:E9:DB:75:89:98:57:43:D2:61:08:5C:4D:31:4F:6F:5D:72:59:AA:42:16:12 +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDEr +MCkGA1UEChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoG +A1UEAxMTU2VjdXJlU2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0 +MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZp +Y2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1cmVTaWduIFJvb3RD +QTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvLTJsz +i1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8 +h9uuywGOwvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOV +MdrAG/LuYpmGYz+/3ZMqg6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9 +UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rPO7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni +8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitAbpSACW22s293bzUIUPsC +h8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZXt94wDgYD +VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB +AKChOBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xm +KbabfSVSSUOrTC4rbnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQ +X5Ucv+2rIrVls4W6ng+4reV6G4pQOh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWr +QbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01y8hSyn+B/tlr0/cR7SXf+Of5 +pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061lgeLKBObjBmN +QSdJQO7e5iNEOdyhIta6A/I= +-----END CERTIFICATE----- + +### Krajowa Izba Rozliczeniowa S.A. + +=== /C=PL/O=Krajowa Izba Rozliczeniowa S.A./CN=SZAFIR ROOT CA2 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 3e:8a:5d:07:ec:55:d2:32:d5:b7:e3:b6:5f:01:eb:2d:dc:e4:d6:e4 + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Oct 19 07:43:30 2015 GMT + Not After : Oct 19 07:43:30 2035 GMT + Subject: C=PL, O=Krajowa Izba Rozliczeniowa S.A., CN=SZAFIR ROOT CA2 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 2E:16:A9:4A:18:B5:CB:CC:F5:6F:50:F3:23:5F:F8:5D:E7:AC:F0:C8 +SHA1 Fingerprint=E2:52:FA:95:3F:ED:DB:24:60:BD:6E:28:F3:9C:CC:CF:5E:B3:3F:DE +SHA256 Fingerprint=A1:33:9D:33:28:1A:0B:56:E5:57:D3:D3:2B:1C:E7:F9:36:7E:B0:94:BD:5F:A7:2A:7E:50:04:C8:DE:D7:CA:FE +-----BEGIN CERTIFICATE----- +MIIDcjCCAlqgAwIBAgIUPopdB+xV0jLVt+O2XwHrLdzk1uQwDQYJKoZIhvcNAQEL +BQAwUTELMAkGA1UEBhMCUEwxKDAmBgNVBAoMH0tyYWpvd2EgSXpiYSBSb3psaWN6 +ZW5pb3dhIFMuQS4xGDAWBgNVBAMMD1NaQUZJUiBST09UIENBMjAeFw0xNTEwMTkw +NzQzMzBaFw0zNTEwMTkwNzQzMzBaMFExCzAJBgNVBAYTAlBMMSgwJgYDVQQKDB9L +cmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMRgwFgYDVQQDDA9TWkFGSVIg +Uk9PVCBDQTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3vD5QqEvN +QLXOYeeWyrSh2gwisPq1e3YAd4wLz32ohswmUeQgPYUM1ljj5/QqGJ3a0a4m7utT +3PSQ1hNKDJA8w/Ta0o4NkjrcsbH/ON7Dui1fgLkCvUqdGw+0w8LBZwPd3BucPbOw +3gAeqDRHu5rr/gsUvTaE2g0gv/pby6kWIK05YO4vdbbnl5z5Pv1+TW9NL++IDWr6 +3fE9biCloBK0TXC5ztdyO4mTp4CEHCdJckm1/zuVnsHMyAHs6A6KCpbns6aH5db5 +BSsNl0BwPLqsdVqc1U2dAgrSS5tmS0YHF2Wtn2yIANwiieDhZNRnvDF5YTy7ykHN +XGoAyDw4jlivAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD +AgEGMB0GA1UdDgQWBBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsF +AAOCAQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw +8PRBEew/R40/cof5O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOG +nXkZ7/e7DDWQw4rtTw/1zBLZpD67oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCP +oky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul4+vJhaAlIDf7js4MNIThPIGy +d05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6+/NNIxuZMzSg +LvWpCz/UXeHPhJ/iGcJfitYgHuNztw== +-----END CERTIFICATE----- + +### LuxTrust S.A. + +=== /C=LU/O=LuxTrust S.A./CN=LuxTrust Global Root 2 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 0a:7e:a6:df:4b:44:9e:da:6a:24:85:9e:e6:b8:15:d3:16:7f:bb:b1 + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Mar 5 13:21:57 2015 GMT + Not After : Mar 5 13:21:57 2035 GMT + Subject: C=LU, O=LuxTrust S.A., CN=LuxTrust Global Root 2 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Certificate Policies: + Policy: 1.3.171.1.1.1.10 + CPS: https://repository.luxtrust.lu + + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Authority Key Identifier: + keyid:FF:18:28:76:F9:48:05:2C:A1:AE:F1:2B:1B:2B:B2:53:F8:4B:7C:B3 + + X509v3 Subject Key Identifier: + FF:18:28:76:F9:48:05:2C:A1:AE:F1:2B:1B:2B:B2:53:F8:4B:7C:B3 +SHA1 Fingerprint=1E:0E:56:19:0A:D1:8B:25:98:B2:04:44:FF:66:8A:04:17:99:5F:3F +SHA256 Fingerprint=54:45:5F:71:29:C2:0B:14:47:C4:18:F9:97:16:8F:24:C5:8F:C5:02:3B:F5:DA:5B:E2:EB:6E:1D:D8:90:2E:D5 +-----BEGIN CERTIFICATE----- +MIIFwzCCA6ugAwIBAgIUCn6m30tEntpqJIWe5rgV0xZ/u7EwDQYJKoZIhvcNAQEL +BQAwRjELMAkGA1UEBhMCTFUxFjAUBgNVBAoMDUx1eFRydXN0IFMuQS4xHzAdBgNV +BAMMFkx1eFRydXN0IEdsb2JhbCBSb290IDIwHhcNMTUwMzA1MTMyMTU3WhcNMzUw +MzA1MTMyMTU3WjBGMQswCQYDVQQGEwJMVTEWMBQGA1UECgwNTHV4VHJ1c3QgUy5B +LjEfMB0GA1UEAwwWTHV4VHJ1c3QgR2xvYmFsIFJvb3QgMjCCAiIwDQYJKoZIhvcN +AQEBBQADggIPADCCAgoCggIBANeFl78RmOnwYoNMPIf5U2o3C/IPPIfOb9wmKb3F +ibrJgz337spbxm1Jc7TJRqMbNBM/wYlFV/TZsfs2ZUv7COJIcRHIbjuend+JZTem +hfY7RBi2xjcwYkSSl2l9QjAk5A0MiWtj3sXh306pFGxT4GHO9hcvHTy95iJMHZP1 +EMShduxq3sVs35a0VkBCwGKSMKEtFZSg0iAGCW5qbeXrt77U8PEVfIvmTroTzEsn +Xpk8F12PgX8zPU/TPxvsXD/wPEx1bvKm1Z3aLQdjAsZy6ZS8TEmVT4hSyNvoaYL4 +zDRbIvCGp4m9SAptZoFtyMhk+wHh9OHe2Z7d21vUKpkmFRseTJIpgp7VkoGSQXAZ +96Tlk0u8d2cx3Rz9MXANF5kM+Qw5GSoXtTBxVdUPrljhPS80m8+f9niFwpN6cj5m +j5wWEWCPnolvZ77gR1o7DJpni89Gxq44o/KnvObWhWszJHAiS8sIm7vI+AIpHb4g +DEa/a4ebsypmQjVGbKq6rfmYe+lQVRQxv7HaLe2ArWgk+2mr2HETMOZns4dA/Yl+ +8kPREd8vZS9kzl8UubG/Mb2HeFpZZYiq/FkySIbWTLkpS5XTdvN3JW1CHDiDTf2j +X5t/Lax5Gw5CMZdjpPuKadUiDTSQMC6otOBttpSsvItO13D8xTiOZCXhTTmQzsmH +hFhxAgMBAAGjgagwgaUwDwYDVR0TAQH/BAUwAwEB/zBCBgNVHSAEOzA5MDcGByuB +KwEBAQowLDAqBggrBgEFBQcCARYeaHR0cHM6Ly9yZXBvc2l0b3J5Lmx1eHRydXN0 +Lmx1MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBT/GCh2+UgFLKGu8SsbK7JT ++Et8szAdBgNVHQ4EFgQU/xgodvlIBSyhrvErGyuyU/hLfLMwDQYJKoZIhvcNAQEL +BQADggIBAGoZFO1uecEsh9QNcH7X9njJCwROxLHOk3D+sFTAMs2ZMGQXvw/l4jP9 +BzZAcg4atmpZ1gDlaCDdLnINH2pkMSCEfUmmWjfrRcmF9dTHF5kH5ptV5AzoqbTO +jFu1EVzPig4N1qx3gf4ynCSecs5U89BvolbW7MM3LGVYvlcAGvI1+ut7MV3CwRI9 +loGIlonBWVx65n9wNOeD4rHh4bhY79SV5GCc8JaXcozrhAIuZY+kt9J/Z93I055c +qqmkoCUUBpvsT34tC38ddfEz2O3OuHVtPlu5mB0xDVbYQw8wkbIEa91WvpWAVWe+ +2M2D2RjuLg+GLZKecBPs3lHJQ3gCpU3I+V/EkVhGFndadKpAvAefMLmx9xIX3eP/ +JEAdemrRTxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKre +zrnK+T+Tb/mjuuqlPpmt/f97mfVl7vBZKGfXkJWkE4SphMHozs51k2MavDzq1WQf +LSoSOcbDWjLtR5EWDrw4wVDej8oqkDQc7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+ +x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31IiyBMz2TWuJdGsE7RKlY6 +oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr +-----END CERTIFICATE----- + +### Microsec Ltd. + +=== /C=HU/L=Budapest/O=Microsec Ltd./CN=Microsec e-Szigno Root CA 2009/emailAddress=info@e-szigno.hu +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 14014712776195784473 (0xc27e43044e473f19) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Jun 16 11:30:18 2009 GMT + Not After : Dec 30 11:30:18 2029 GMT + Subject: C=HU, L=Budapest, O=Microsec Ltd., CN=Microsec e-Szigno Root CA 2009/emailAddress=info@e-szigno.hu + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + CB:0F:C6:DF:42:43:CC:3D:CB:B5:48:23:A1:1A:7A:A6:2A:BB:34:68 + X509v3 Authority Key Identifier: + keyid:CB:0F:C6:DF:42:43:CC:3D:CB:B5:48:23:A1:1A:7A:A6:2A:BB:34:68 + + X509v3 Subject Alternative Name: + email:info@e-szigno.hu +SHA1 Fingerprint=89:DF:74:FE:5C:F4:0F:4A:80:F9:E3:37:7D:54:DA:91:E1:01:31:8E +SHA256 Fingerprint=3C:5F:81:FE:A5:FA:B8:2C:64:BF:A2:EA:EC:AF:CD:E8:E0:77:FC:86:20:A7:CA:E5:37:16:3D:F3:6E:DB:F3:78 +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD +VQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0 +ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0G +CSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0wOTA2MTYxMTMwMThaFw0y +OTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3Qx +FjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3pp +Z25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvP +kd6mJviZpWNwrZuuyjNAfW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tc +cbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG0IMZfcChEhyVbUr02MelTTMuhTlAdX4U +fIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKApxn1ntxVUwOXewdI/5n7 +N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm1HxdrtbC +xkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1 ++rUCAwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPM +Pcu1SCOhGnqmKrs0aDAbBgNVHREEFDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqG +SIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0olZMEyL/azXm4Q5DwpL7v8u8h +mLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfXI/OMn74dseGk +ddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c +2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t +HMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + ### NetLock Kft. === /C=HU/L=Budapest/O=NetLock Kft./OU=Tan\xC3\xBAs\xC3\xADtv\xC3\xA1nykiad\xC3\xB3k (Certification Services)/CN=NetLock Arany (Class Gold) F\xC5\x91tan\xC3\xBAs\xC3\xADtv\xC3\xA1ny @@ -2420,46 +4427,6 @@ SnQ2+Q== ### SECOM Trust Systems CO.,LTD. -=== /C=JP/O=SECOM Trust Systems CO.,LTD./OU=Security Communication EV RootCA1 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: sha1WithRSAEncryption - Validity - Not Before: Jun 6 02:12:32 2007 GMT - Not After : Jun 6 02:12:32 2037 GMT - Subject: C=JP, O=SECOM Trust Systems CO.,LTD., OU=Security Communication EV RootCA1 - X509v3 extensions: - X509v3 Subject Key Identifier: - 35:4A:F5:4D:AF:3F:D7:82:38:AC:AB:71:65:17:75:8C:9D:55:93:E6 - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE -SHA1 Fingerprint=FE:B8:C4:32:DC:F9:76:9A:CE:AE:3D:D8:90:8F:FD:28:86:65:64:7D -SHA256 Fingerprint=A2:2D:BA:68:1E:97:37:6E:2D:39:7D:72:8A:AE:3A:9B:62:96:B9:FD:BA:60:BC:2E:11:F6:47:F2:C6:75:FB:37 ------BEGIN CERTIFICATE----- -MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDEl -MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMh -U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIz -MloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09N -IFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNlY3VyaXR5IENvbW11 -bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSE -RMqm4miO/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gO -zXppFodEtZDkBp2uoQSXWHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5 -bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4zZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDF -MxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4bepJz11sS6/vmsJWXMY1 -VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK9U2vP9eC -OKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G -CSqGSIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HW -tWS3irO4G8za+6xmiEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZ -q51ihPZRwSzJIxXYKLerJRO1RuGGAv8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDb -EJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnWmHyojf6GPgcWkuF75x3sM3Z+ -Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEWT1MKZPlO9L9O -VL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 ------END CERTIFICATE----- === /C=JP/O=SECOM Trust Systems CO.,LTD./OU=Security Communication RootCA2 Certificate: Data: @@ -2543,6 +4510,504 @@ JRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw== -----END CERTIFICATE----- +### SecureTrust Corporation + +=== /C=US/O=SecureTrust Corporation/CN=Secure Global CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 07:56:22:a4:e8:d4:8a:89:4d:f4:13:c8:f0:f8:ea:a5 + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Nov 7 19:42:28 2006 GMT + Not After : Dec 31 19:52:06 2029 GMT + Subject: C=US, O=SecureTrust Corporation, CN=Secure Global CA + X509v3 extensions: + 1.3.6.1.4.1.311.20.2: + ...C.A + X509v3 Key Usage: + Digital Signature, Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + AF:44:04:C2:41:7E:48:83:DB:4E:39:02:EC:EC:84:7A:E6:CE:C9:A4 + X509v3 CRL Distribution Points: + + Full Name: + URI:http://crl.securetrust.com/SGCA.crl + + 1.3.6.1.4.1.311.21.1: + ... +SHA1 Fingerprint=3A:44:73:5A:E5:81:90:1F:24:86:61:46:1E:3B:9C:C4:5F:F5:3A:1B +SHA256 Fingerprint=42:00:F5:04:3A:C8:59:0E:BB:52:7D:20:9E:D1:50:30:29:FB:CB:D4:1C:A1:B5:06:EC:27:F1:5A:DE:7D:AC:69 +-----BEGIN CERTIFICATE----- +MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x +GTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx +MjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3Qg +Q29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jxYDiJ +iQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa +/FHtaMbQbqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJ +jnIFHovdRIWCQtBJwB1g8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnI +HmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYVHDGA76oYa8J719rO+TMg1fW9ajMtgQT7 +sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi0XPnj3pDAgMBAAGjgZ0w +gZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCsw +KaAnoCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsG +AQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0L +URYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO +H0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm +I50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY +iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- +=== /C=US/O=SecureTrust Corporation/CN=SecureTrust CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 0c:f0:8e:5c:08:16:a5:ad:42:7f:f0:eb:27:18:59:d0 + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Nov 7 19:31:18 2006 GMT + Not After : Dec 31 19:40:55 2029 GMT + Subject: C=US, O=SecureTrust Corporation, CN=SecureTrust CA + X509v3 extensions: + 1.3.6.1.4.1.311.20.2: + ...C.A + X509v3 Key Usage: + Digital Signature, Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + 42:32:B6:16:FA:04:FD:FE:5D:4B:7A:C3:FD:F7:4C:40:1D:5A:43:AF + X509v3 CRL Distribution Points: + + Full Name: + URI:http://crl.securetrust.com/STCA.crl + + 1.3.6.1.4.1.311.21.1: + ... +SHA1 Fingerprint=87:82:C6:C3:04:35:3B:CF:D2:96:92:D2:59:3E:7D:44:D9:34:FF:11 +SHA256 Fingerprint=F1:C1:B5:0A:E5:A2:0D:D8:03:0E:C9:F6:BC:24:82:3D:D3:67:B5:25:57:59:B4:E7:1B:61:FC:E9:F7:37:5D:73 +-----BEGIN CERTIFICATE----- +MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x +FzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz +MTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv +cnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQXOZEz +Zum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO +0gMdA+9tDWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIao +wW8xQmxSPmjL8xk037uHGFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj +7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b01k/unK8RCSc43Oz969XL0Imnal0ugBS +8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmHursCAwEAAaOBnTCBmjAT +BgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCeg +JYYjaHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGC +NxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt3 +6Z3q059c4EVlew3KW+JwULKUBRSuSceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/ +3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHfmbx8IVQr5Fiiu1cprp6poxkm +D5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZnMUFdAvnZyPS +CPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR +3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= +-----END CERTIFICATE----- + +### Sonera + +=== /C=FI/O=Sonera/CN=Sonera Class2 CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 29 (0x1d) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Apr 6 07:29:40 2001 GMT + Not After : Apr 6 07:29:40 2021 GMT + Subject: C=FI, O=Sonera, CN=Sonera Class2 CA + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + 4A:A0:AA:58:84:D3:5E:3C + X509v3 Key Usage: + Certificate Sign, CRL Sign +SHA1 Fingerprint=37:F7:6D:E6:07:7C:90:C5:B1:3E:93:1A:B7:41:10:B4:F2:E4:9A:27 +SHA256 Fingerprint=79:08:B4:03:14:C1:38:10:0B:51:8D:07:35:80:7F:FB:FC:F8:51:8A:00:95:33:71:05:BA:38:6B:15:3D:D9:27 +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP +MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx +MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV +BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o +Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt +5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s +3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej +vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu +8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw +DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG +MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil +zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/ +3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD +FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6 +Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2 +ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M +-----END CERTIFICATE----- + +### SSL Corporation + +=== /C=US/ST=Texas/L=Houston/O=SSL Corporation/CN=SSL.com EV Root Certification Authority ECC +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 3182246526754555285 (0x2c299c5b16ed0595) + Signature Algorithm: ecdsa-with-SHA256 + Validity + Not Before: Feb 12 18:15:23 2016 GMT + Not After : Feb 12 18:15:23 2041 GMT + Subject: C=US, ST=Texas, L=Houston, O=SSL Corporation, CN=SSL.com EV Root Certification Authority ECC + X509v3 extensions: + X509v3 Subject Key Identifier: + 5B:CA:5E:E5:DE:D2:81:AA:CD:A8:2D:64:51:B6:D9:72:9B:97:E6:4F + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + keyid:5B:CA:5E:E5:DE:D2:81:AA:CD:A8:2D:64:51:B6:D9:72:9B:97:E6:4F + + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign +SHA1 Fingerprint=4C:DD:51:A3:D1:F5:20:32:14:B0:C6:C5:32:23:03:91:C7:46:42:6D +SHA256 Fingerprint=22:A2:C1:F7:BD:ED:70:4C:C1:E7:01:B5:F4:08:C3:10:88:0F:E9:56:B5:DE:2A:4A:44:F9:9C:87:3A:25:A7:C8 +-----BEGIN CERTIFICATE----- +MIIClDCCAhqgAwIBAgIILCmcWxbtBZUwCgYIKoZIzj0EAwIwfzELMAkGA1UEBhMC +VVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9T +U0wgQ29ycG9yYXRpb24xNDAyBgNVBAMMK1NTTC5jb20gRVYgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEyMTgxNTIzWhcNNDEwMjEyMTgx +NTIzWjB/MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv +dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjE0MDIGA1UEAwwrU1NMLmNv +bSBFViBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABKoSR5CYG/vvw0AHgyBO8TCCogbR8pKGYfL2IWjKAMTH6kMA +VIbc/R/fALhBYlzccBYy3h+Z1MzFB8gIH2EWB1E9fVwHU+M1OIzfzZ/ZLg1Kthku +WnBaBu2+8KGwytAJKaNjMGEwHQYDVR0OBBYEFFvKXuXe0oGqzagtZFG22XKbl+ZP +MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUW8pe5d7SgarNqC1kUbbZcpuX +5k8wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2gAMGUCMQCK5kCJN+vp1RPZ +ytRrJPOwPYdGWBrssd9v+1a6cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZg +h5Mmm7I1HrrW9zzRHM76JTymGoEVW/MSD2zuZYrJh6j5B+BimoxcSg== +-----END CERTIFICATE----- +=== /C=US/ST=Texas/L=Houston/O=SSL Corporation/CN=SSL.com EV Root Certification Authority RSA R2 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 6248227494352943350 (0x56b629cd34bc78f6) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: May 31 18:14:37 2017 GMT + Not After : May 30 18:14:37 2042 GMT + Subject: C=US, ST=Texas, L=Houston, O=SSL Corporation, CN=SSL.com EV Root Certification Authority RSA R2 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + keyid:F9:60:BB:D4:E3:D5:34:F6:B8:F5:06:80:25:A7:73:DB:46:69:A8:9E + + X509v3 Subject Key Identifier: + F9:60:BB:D4:E3:D5:34:F6:B8:F5:06:80:25:A7:73:DB:46:69:A8:9E + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign +SHA1 Fingerprint=74:3A:F0:52:9B:D0:32:A0:F4:4A:83:CD:D4:BA:A9:7B:7C:2E:C4:9A +SHA256 Fingerprint=2E:7B:F1:6C:C2:24:85:A7:BB:E2:AA:86:96:75:07:61:B0:AE:39:BE:3B:2F:E9:D0:CC:6D:4E:F7:34:91:42:5C +-----BEGIN CERTIFICATE----- +MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNV +BAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UE +CgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2Vy +dGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIyMB4XDTE3MDUzMTE4MTQzN1oXDTQy +MDUzMDE4MTQzN1owgYIxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4G +A1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQD +DC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIy +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjzZlQOHWTcDXtOlG2mvq +M0fNTPl9fb69LT3w23jhhqXZuglXaO1XPqDQCEGD5yhBJB/jchXQARr7XnAjssuf +OePPxU7Gkm0mxnu7s9onnQqG6YE3Bf7wcXHswxzpY6IXFJ3vG2fThVUCAtZJycxa +4bH3bzKfydQ7iEGonL3Lq9ttewkfokxykNorCPzPPFTOZw+oz12WGQvE43LrrdF9 +HSfvkusQv1vrO6/PgN3B0pYEW3p+pKk8OHakYo6gOV7qd89dAFmPZiw+B6KjBSYR +aZfqhbcPlgtLyEDhULouisv3D5oi53+aNxPN8k0TayHRwMwi8qFG9kRpnMphNQcA +b9ZhCBHqurj26bNg5U257J8UZslXWNvNh2n4ioYSA0e/ZhN2rHd9NCSFg83XqpyQ +Gp8hLH94t2S42Oim9HizVcuE0jLEeK6jj2HdzghTreyI/BXkmg3mnxp3zkyPuBQV +PWKchjgGAGYS5Fl2WlPAApiiECtoRHuOec4zSnaqW4EWG7WK2NAAe15itAnWhmMO +pgWVSbooi4iTsjQc2KRVbrcc0N6ZVTsj9CLg+SlmJuwgUHfbSguPvuUCYHBBXtSu +UDkiFCbLsjtzdFVHB3mBOagwE0TlBIqulhMlQg+5U8Sb/M3kHN48+qvWBkofZ6aY +MBzdLNvcGJVXZsb/XItW9XcCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNV +HSMEGDAWgBT5YLvU49U09rj1BoAlp3PbRmmonjAdBgNVHQ4EFgQU+WC71OPVNPa4 +9QaAJadz20ZpqJ4wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBW +s47LCp1Jjr+kxJG7ZhcFUZh1++VQLHqe8RT6q9OKPv+RKY9ji9i0qVQBDb6Thi/5 +Sm3HXvVX+cpVHBK+Rw82xd9qt9t1wkclf7nxY/hoLVUE0fKNsKTPvDxeH3jnpaAg +cLAExbf3cqfeIg29MyVGjGSSJuM+LmOW2puMPfgYCdcDzH2GguDKBAdRUNf/ktUM +79qGn5nX67evaOI5JpS6aLe/g9Pqemc9YmeuJeVy6OLk7K4S9ksrPJ/psEDzOFSz +/bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXt +ll9ldDz7CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEm +Kf7GUmG6sXP/wwyc5WxqlD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKK +QbNmC1r7fSOl8hqw/96bg5Qu0T/fkreRrwU7ZcegbLHNYhLDkBvjJc40vG93drEQ +w/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1hlMYegouCRw2n5H9gooi +S9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX9hwJ1C07 +mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w== +-----END CERTIFICATE----- +=== /C=US/ST=Texas/L=Houston/O=SSL Corporation/CN=SSL.com Root Certification Authority ECC +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 8495723813297216424 (0x75e6dfcbc1685ba8) + Signature Algorithm: ecdsa-with-SHA256 + Validity + Not Before: Feb 12 18:14:03 2016 GMT + Not After : Feb 12 18:14:03 2041 GMT + Subject: C=US, ST=Texas, L=Houston, O=SSL Corporation, CN=SSL.com Root Certification Authority ECC + X509v3 extensions: + X509v3 Subject Key Identifier: + 82:D1:85:73:30:E7:35:04:D3:8E:02:92:FB:E5:A4:D1:C4:21:E8:CD + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + keyid:82:D1:85:73:30:E7:35:04:D3:8E:02:92:FB:E5:A4:D1:C4:21:E8:CD + + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign +SHA1 Fingerprint=C3:19:7C:39:24:E6:54:AF:1B:C4:AB:20:95:7A:E2:C3:0E:13:02:6A +SHA256 Fingerprint=34:17:BB:06:CC:60:07:DA:1B:96:1C:92:0B:8A:B4:CE:3F:AD:82:0E:4A:A3:0B:9A:CB:C4:A7:4E:BD:CE:BC:65 +-----BEGIN CERTIFICATE----- +MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMC +VVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9T +U0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0 +aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEyMTgxNDAzWhcNNDEwMjEyMTgxNDAz +WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0 +b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNvbSBS +b290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuB +BAAiA2IABEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI +7Z4INcgn64mMU1jrYor+8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPg +CemB+vNH06NjMGEwHQYDVR0OBBYEFILRhXMw5zUE044CkvvlpNHEIejNMA8GA1Ud +EwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTTjgKS++Wk0cQh6M0wDgYD +VR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCWe+0F+S8T +kdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+ +gA0z5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl +-----END CERTIFICATE----- +=== /C=US/ST=Texas/L=Houston/O=SSL Corporation/CN=SSL.com Root Certification Authority RSA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 8875640296558310041 (0x7b2c9bd316803299) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Feb 12 17:39:39 2016 GMT + Not After : Feb 12 17:39:39 2041 GMT + Subject: C=US, ST=Texas, L=Houston, O=SSL Corporation, CN=SSL.com Root Certification Authority RSA + X509v3 extensions: + X509v3 Subject Key Identifier: + DD:04:09:07:A2:F5:7A:7D:52:53:12:92:95:EE:38:80:25:0D:A6:59 + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + keyid:DD:04:09:07:A2:F5:7A:7D:52:53:12:92:95:EE:38:80:25:0D:A6:59 + + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign +SHA1 Fingerprint=B7:AB:33:08:D1:EA:44:77:BA:14:80:12:5A:6F:BD:A9:36:49:0C:BB +SHA256 Fingerprint=85:66:6A:56:2E:E0:BE:5C:E9:25:C1:D8:89:0A:6F:76:A8:7E:C1:6D:4D:7D:5F:29:EA:74:19:CF:20:12:3B:69 +-----BEGIN CERTIFICATE----- +MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UE +BhMCVVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQK +DA9TU0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYwMjEyMTczOTM5WhcNNDEwMjEyMTcz +OTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv +dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv +bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTCCAiIwDQYJKoZIhvcN +AQEBBQADggIPADCCAgoCggIBAPkP3aMrfcvQKv7sZ4Wm5y4bunfh4/WvpOz6Sl2R +xFdHaxh3a3by/ZPkPQ/CFp4LZsNWlJ4Xg4XOVu/yFv0AYvUiCVToZRdOQbngT0aX +qhvIuG5iXmmxX9sqAn78bMrzQdjt0Oj8P2FI7bADFB0QDksZ4LtO7IZl/zbzXmcC +C52GVWH9ejjt/uIZALdvoVBidXQ8oPrIJZK0bnoix/geoeOy3ZExqysdBP+lSgQ3 +6YWkMyv94tZVNHwZpEpox7Ko07fKoZOI68GXvIz5HdkihCR0xwQ9aqkpk8zruFvh +/l8lqjRYyMEjVJ0bmBHDOJx+PYZspQ9AhnwC9FwCTyjLrnGfDzrIM/4RJTXq/LrF +YD3ZfBjVsqnTdXgDciLKOsMf7yzlLqn6niy2UUb9rwPW6mBo6oUWNmuF6R7As93E +JNyAKoFBbZQ+yODJgUEAnl6/f8UImKIYLEJAs/lvOCdLToD0PYFH4Ih86hzOtXVc +US4cK38acijnALXRdMbX5J+tB5O2UzU1/Dfkw/ZdFr4hc96SCvigY2q8lpJqPvi8 +ZVWb3vUNiSYE/CUapiVpy8JtynziWV+XrOvvLsi81xtZPCvM8hnIk2snYxnP/Okm ++Mpxm3+T/jRnhE6Z6/yzeAkzcLpmpnbtG3PrGqUNxCITIJRWCk4sbE6x/c+cCbqi +M+2HAgMBAAGjYzBhMB0GA1UdDgQWBBTdBAkHovV6fVJTEpKV7jiAJQ2mWTAPBgNV +HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFN0ECQei9Xp9UlMSkpXuOIAlDaZZMA4G +A1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAIBgRlCn7Jp0cHh5wYfGV +cpNxJK1ok1iOMq8bs3AD/CUrdIWQPXhq9LmLpZc7tRiRux6n+UBbkflVma8eEdBc +Hadm47GUBwwyOabqG7B52B2ccETjit3E+ZUfijhDPwGFpUenPUayvOUiaPd7nNgs +PgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52jvATGGAslu1OJD7OAUN5F7kR/ +q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3oFRuIIhxdRjqerQ0 +cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfdSSLBv9jr +a6x+3uxjMxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90I +H37hVZkLId6Tngr75qNJvTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/Y +K9f1JmzJBjSWFupwWRoyeXkLtoh/D1JIPb9s2KJELtFOt3JY04kTlf5Eq/jXixtu +nLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406ywKBjYZC6VWg3dGq2ktuf +oYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NIWuuA8ShY +Ic2wBlX7Jz9TkHCpBB5XJ7k= +-----END CERTIFICATE----- + +### Staat der Nederlanden + +=== /C=NL/O=Staat der Nederlanden/CN=Staat der Nederlanden EV Root CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 10000013 (0x98968d) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Dec 8 11:19:29 2010 GMT + Not After : Dec 8 11:10:28 2022 GMT + Subject: C=NL, O=Staat der Nederlanden, CN=Staat der Nederlanden EV Root CA + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + FE:AB:00:90:98:9E:24:FC:A9:CC:1A:8A:FB:27:B8:BF:30:6E:A8:3B +SHA1 Fingerprint=76:E2:7E:C1:4F:DB:82:C1:C0:A6:75:B5:05:BE:3D:29:B4:ED:DB:BB +SHA256 Fingerprint=4D:24:91:41:4C:FE:95:67:46:EC:4C:EF:A6:CF:6F:72:E2:8A:13:29:43:2F:9D:8A:90:7A:C4:CB:5D:AD:C1:5A +-----BEGIN CERTIFICATE----- +MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJO +TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFh +dCBkZXIgTmVkZXJsYW5kZW4gRVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0y +MjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5MMR4wHAYDVQQKDBVTdGFhdCBkZXIg +TmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRlcmxhbmRlbiBFViBS +b290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkkSzrS +M4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nC +UiY4iKTWO0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3d +Z//BYY1jTw+bbRcwJu+r0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46p +rfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13l +pJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gVXJrm0w912fxBmJc+qiXb +j5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr08C+eKxC +KFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS +/ZbV0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0X +cgOPvZuM5l5Tnrmd74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH +1vI4gnPah1vlPNOePqc7nvQDs/nxfRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrP +px9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwaivsnuL8wbqg7 +MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI +eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u +2dfOWBfoqSmuc0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHS +v4ilf0X8rLiltTMMgsT7B/Zq5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTC +wPTxGfARKbalGAKb12NMcIxHowNDXLldRqANb/9Zjr7dn3LDWyvfjFvO5QxGbJKy +CqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tNf1zuacpzEPuKqf2e +vTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi5Dp6 +Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIa +Gl6I6lD4WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeL +eG9QgkRQP2YGiqtDhFZKDyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8 +FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGyeUN51q1veieQA6TqJIc/2b3Z6fJfUEkc +7uzXLg== +-----END CERTIFICATE----- +=== /C=NL/O=Staat der Nederlanden/CN=Staat der Nederlanden Root CA - G2 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 10000012 (0x98968c) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Mar 26 11:18:17 2008 GMT + Not After : Mar 25 11:03:10 2020 GMT + Subject: C=NL, O=Staat der Nederlanden, CN=Staat der Nederlanden Root CA - G2 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Certificate Policies: + Policy: X509v3 Any Policy + CPS: http://www.pkioverheid.nl/policies/root-policy-G2 + + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 91:68:32:87:15:1D:89:E2:B5:F1:AC:36:28:34:8D:0B:7C:62:88:EB +SHA1 Fingerprint=59:AF:82:79:91:86:C7:B4:75:07:CB:CF:03:57:46:EB:04:DD:B7:16 +SHA256 Fingerprint=66:8C:83:94:7D:A6:3B:72:4B:EC:E1:74:3C:31:A0:E6:AE:D0:DB:8E:C5:B3:1B:E3:77:BB:78:4F:91:B6:71:6F +-----BEGIN CERTIFICATE----- +MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO +TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh +dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oX +DTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl +ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv +b3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ5291 +qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8Sp +uOUfiUtnvWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPU +Z5uW6M7XxgpT0GtJlvOjCwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvE +pMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiile7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp +5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCROME4HYYEhLoaJXhena/M +UGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpICT0ugpTN +GmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy +5V6548r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv +6q012iDTiIJh8BIitrzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEK +eN5KzlW/HdXZt1bv8Hb/C3m1r737qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6 +B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMBAAGjgZcwgZQwDwYDVR0TAQH/ +BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcCARYxaHR0cDov +L3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqG +SIb3DQEBCwUAA4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLyS +CZa59sCrI2AGeYwRTlHSeYAz+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen +5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwjf/ST7ZwaUb7dRUG/kSS0H4zpX897 +IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaNkqbG9AclVMwWVxJK +gnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfkCpYL ++63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxL +vJxxcypFURmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkm +bEgeqmiSBeGCc1qb3AdbCG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvk +N1trSt8sV4pAWja63XVECDdCcAz+3F4hoKOKwJCcaNpQ5kUQR3i2TtJlycM33+FC +Y7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Z +ywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ== +-----END CERTIFICATE----- +=== /C=NL/O=Staat der Nederlanden/CN=Staat der Nederlanden Root CA - G3 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 10003001 (0x98a239) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Nov 14 11:28:42 2013 GMT + Not After : Nov 13 23:00:00 2028 GMT + Subject: C=NL, O=Staat der Nederlanden, CN=Staat der Nederlanden Root CA - G3 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 54:AD:FA:C7:92:57:AE:CA:35:9C:2E:12:FB:E4:BA:5D:20:DC:94:57 +SHA1 Fingerprint=D8:EB:6B:41:51:92:59:E0:F3:E7:85:00:C0:3D:B6:88:97:C9:EE:FC +SHA256 Fingerprint=3C:4F:B0:B9:5A:B8:B3:00:32:F4:32:B8:6F:53:5F:E1:72:C1:85:D0:FD:39:86:58:37:CF:36:18:7F:A6:F4:28 +-----BEGIN CERTIFICATE----- +MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO +TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh +dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloX +DTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl +ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv +b3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4yolQP +cPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WW +IkYFsO2tx1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqX +xz8ecAgwoNzFs21v0IJyEavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFy +KJLZWyNtZrVtB0LrpjPOktvA9mxjeM3KTj215VKb8b475lRgsGYeCasH/lSJEULR +9yS6YHgamPfJEf0WwTUaVHXvQ9Plrk7O53vDxk5hUUurmkVLoR9BvUhTFXFkC4az +5S6+zqQbwSmEorXLCCN2QyIkHxcE1G6cxvx/K2Ya7Irl1s9N9WMJtxU51nus6+N8 +6U78dULI7ViVDAZCopz35HCz33JvWjdAidiFpNfxC95DGdRKWCyMijmev4SH8RY7 +Ngzp07TKbBlBUgmhHbBqv4LvcFEhMtwFdozL92TkA1CvjJFnq8Xy7ljY3r735zHP +bMk7ccHViLVlvMDoFxcHErVc0qsgk7TmgoNwNsXNo42ti+yjwUOH5kPiNL6VizXt +BznaqB16nzaeErAMZRKQFWDZJkBE41ZgpRDUajz9QdwOWke275dhdU/Z/seyHdTt +XUmzqWrLZoQT1Vyg3N9udwbRcXXIV2+vD3dbAgMBAAGjQjBAMA8GA1UdEwEB/wQF +MAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRUrfrHkleuyjWcLhL75Lpd +INyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD +U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwp +LiniyMMB8jPqKqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8 +Ipf3YF3qKS9Ysr1YvY2WTxB1v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixp +gZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA8KCWAg8zxXHzniN9lLf9OtMJgwYh +/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b8KKaa8MFSu1BYBQw +0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0rmj1A +fsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq +4BZ+Extq1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR +1VmiiXTTn74eS9fGbbeIJG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/ +QFH1T/U67cjF68IeHRaVesd+QnGTbksVtzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM +94B7IWcnMFk= +-----END CERTIFICATE----- + ### Starfield Technologies, Inc. === /C=US/O=Starfield Technologies, Inc./OU=Starfield Class 2 Certification Authority @@ -2677,137 +5142,6 @@ iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn sSi6 -----END CERTIFICATE----- -### StartCom Ltd. - -=== /C=IL/O=StartCom Ltd./CN=StartCom Certification Authority G2 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 59 (0x3b) - Signature Algorithm: sha256WithRSAEncryption - Validity - Not Before: Jan 1 01:00:01 2010 GMT - Not After : Dec 31 23:59:01 2039 GMT - Subject: C=IL, O=StartCom Ltd., CN=StartCom Certification Authority G2 - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - 4B:C5:B4:40:6B:AD:1C:B3:A5:1C:65:6E:46:36:89:87:05:0C:0E:B6 -SHA1 Fingerprint=31:F1:FD:68:22:63:20:EE:C6:3B:3F:9D:EA:4A:3E:53:7C:7C:39:17 -SHA256 Fingerprint=C7:BA:65:67:DE:93:A7:98:AE:1F:AA:79:1E:71:2D:37:8F:AE:1F:93:C4:39:7F:EA:44:1B:B7:CB:E6:FD:59:95 ------BEGIN CERTIFICATE----- -MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEW -MBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlm -aWNhdGlvbiBBdXRob3JpdHkgRzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1 -OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoG -A1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRzIwggIiMA0G -CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8Oo1XJ -JZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsD -vfOpL9HG4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnoo -D/Uefyf3lLE3PbfHkffiAez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/ -Q0kGi4xDuFby2X8hQxfqp0iVAXV16iulQ5XqFYSdCI0mblWbq9zSOdIxHWDirMxW -RST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbsO+wmETRIjfaAKxojAuuK -HDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8HvKTlXcxN -nw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM -0D4LnMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/i -UUjXuG+v+E5+M5iSFGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9 -Ha90OrInwMEePnWjFqmveiJdnxMaz6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHg -TuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE -AwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJKoZIhvcNAQEL -BQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K -2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfX -UfEpY9Z1zRbkJ4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl -6/2o1PXWT6RbdejF0mCy2wl+JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK -9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG/+gyRr61M3Z3qAFdlsHB1b6uJcDJ -HgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTcnIhT76IxW1hPkWLI -wpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/XldblhY -XzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5l -IxKVCCIcl85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoo -hdVddLHRDiBYmxOlsGOm7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulr -so8uBtjRkcfGEvRM/TAXw8HaOFvjqermobp573PYtlNXLfbQ4ddI ------END CERTIFICATE----- -=== /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 45 (0x2d) - Signature Algorithm: sha256WithRSAEncryption - Validity - Not Before: Sep 17 19:46:37 2006 GMT - Not After : Sep 17 19:46:36 2036 GMT - Subject: C=IL, O=StartCom Ltd., OU=Secure Digital Certificate Signing, CN=StartCom Certification Authority - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - 4E:0B:EF:1A:A4:40:5B:A5:17:69:87:30:CA:34:68:43:D0:41:AE:F2 - X509v3 Authority Key Identifier: - keyid:4E:0B:EF:1A:A4:40:5B:A5:17:69:87:30:CA:34:68:43:D0:41:AE:F2 - - X509v3 Certificate Policies: - Policy: 1.3.6.1.4.1.23223.1.1.1 - CPS: http://www.startssl.com/policy.pdf - CPS: http://www.startssl.com/intermediate.pdf - User Notice: - Organization: Start Commercial (StartCom) Ltd. - Number: 1 - Explicit Text: Limited Liability, read the section *Legal Limitations* of the StartCom Certification Authority Policy available at http://www.startssl.com/policy.pdf - - Netscape Cert Type: - SSL CA, S/MIME CA, Object Signing CA - Netscape Comment: - StartCom Free SSL Certification Authority -SHA1 Fingerprint=A3:F1:33:3F:E2:42:BF:CF:C5:D1:4E:8F:39:42:98:40:68:10:D1:A0 -SHA256 Fingerprint=E1:78:90:EE:09:A3:FB:F4:F4:8B:9C:41:4A:17:D6:37:B7:A5:06:47:E9:BC:75:23:22:72:7F:CC:17:42:A9:11 ------BEGIN CERTIFICATE----- -MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEW -MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg -Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM3WhcNMzYwOTE3MTk0NjM2WjB9 -MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi -U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh -cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk -pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf -OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C -Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT -Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi -HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM -Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w -+2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ -Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 -Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B -26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID -AQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD -VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFul -F2mHMMo0aEPQQa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCC -ATgwLgYIKwYBBQUHAgEWImh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5w -ZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL2ludGVybWVk -aWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENvbW1lcmNpYWwgKFN0 -YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUg -c2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0 -aWZpY2F0aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93 -d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgG -CWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5fPGFf59Jb2vKXfuM/gTF -wWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWmN3PH/UvS -Ta0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst -0OcNOrg+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNc -pRJvkrKTlMeIFw6Ttn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKl -CcWw0bdT82AUuoVpaiF8H3VhFyAXe2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVF -P0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA2MFrLH9ZXF2RsXAiV+uKa0hK -1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBsHvUwyKMQ5bLm -KhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE -JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ -8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm -fyWl8kgAwKQB2j8= ------END CERTIFICATE----- - ### SwissSign AG === /C=CH/O=SwissSign AG/CN=SwissSign Gold CA - G2 @@ -3016,6 +5350,150 @@ e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p TpPDpFQUWw== -----END CERTIFICATE----- +### TAIWAN-CA + +=== /C=TW/O=TAIWAN-CA/OU=Root CA/CN=TWCA Global Root CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 3262 (0xcbe) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Jun 27 06:28:33 2012 GMT + Not After : Dec 31 15:59:59 2030 GMT + Subject: C=TW, O=TAIWAN-CA, OU=Root CA, CN=TWCA Global Root CA + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE +SHA1 Fingerprint=9C:BB:48:53:F6:A4:F6:D3:52:A4:E8:32:52:55:60:13:F5:AD:AF:65 +SHA256 Fingerprint=59:76:90:07:F7:68:5D:0F:CD:50:87:2F:9F:95:D5:75:5A:5B:2B:45:7D:81:F3:69:2B:61:0A:98:67:2F:0E:1B +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcx +EjAQBgNVBAoTCVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMT +VFdDQSBHbG9iYWwgUm9vdCBDQTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5 +NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQKEwlUQUlXQU4tQ0ExEDAOBgNVBAsT +B1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3QgQ0EwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2CnJfF +10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz +0ALfUPZVr2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfCh +MBwqoJimFb3u/Rk28OKRQ4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbH +zIh1HrtsBv+baz4X7GGqcXzGHaL3SekVtTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc +46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1WKKD+u4ZqyPpcC1jcxkt2 +yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99sy2sbZCi +laLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYP +oA/pyJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQA +BDzfuBSO6N+pjWxnkjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcE +qYSjMq+u7msXi7Kx/mzhkIyIqJdIzshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm +4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6gcFGn90xHNcgL +1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn +LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WF +H6vPNOw/KP4M8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNo +RI2T9GRwoD2dKAXDOXC4Ynsg/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+ +nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlglPx4mI88k1HtQJAH32RjJMtOcQWh +15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryPA9gK8kxkRr05YuWW +6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3mi4TW +nsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5j +wa19hAM8EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWz +aGHQRiapIVJpLesux+t3zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmy +KwbQBM0= +-----END CERTIFICATE----- +=== /C=TW/O=TAIWAN-CA/OU=Root CA/CN=TWCA Root Certification Authority +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Aug 28 07:24:33 2008 GMT + Not After : Dec 31 15:59:59 2030 GMT + Subject: C=TW, O=TAIWAN-CA, OU=Root CA, CN=TWCA Root Certification Authority + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + 6A:38:5B:26:8D:DE:8B:5A:F2:4F:7A:54:83:19:18:E3:08:35:A6:BA +SHA1 Fingerprint=CF:9E:87:6D:D3:EB:FC:42:26:97:A3:B5:A3:7A:A0:76:A9:06:23:48 +SHA256 Fingerprint=BF:D8:8F:E1:10:1C:41:AE:3E:80:1B:F8:BE:56:35:0E:E9:BA:D1:A6:B9:BD:51:5E:DC:5C:6D:5B:87:11:AC:44 +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzES +MBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFU +V0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMz +WhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FO +LUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFE +AcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HH +K3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX +RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/z +rX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx +3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkq +hkiG9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeC +MErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls +XebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D +lhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn +aspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ +YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +### TeliaSonera + +=== /O=TeliaSonera/CN=TeliaSonera Root CA v1 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 95:be:16:a0:f7:2e:46:f1:7b:39:82:72:fa:8b:cd:96 + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Oct 18 12:00:50 2007 GMT + Not After : Oct 18 12:00:50 2032 GMT + Subject: O=TeliaSonera, CN=TeliaSonera Root CA v1 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + F0:8F:59:38:00:B3:F5:8F:9A:96:0C:D5:EB:FA:7B:AA:17:E8:13:12 +SHA1 Fingerprint=43:13:BB:96:F1:D5:86:9B:C1:4E:6A:92:F6:CF:F6:34:69:87:82:37 +SHA256 Fingerprint=DD:69:36:FE:21:F8:F0:77:C1:23:A1:A5:21:C1:22:24:F7:22:55:B7:3E:03:A7:26:06:93:E8:A2:4B:0F:A3:89 +-----BEGIN CERTIFICATE----- +MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAw +NzEUMBIGA1UECgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJv +b3QgQ0EgdjEwHhcNMDcxMDE4MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYD +VQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwWVGVsaWFTb25lcmEgUm9vdCBDQSB2 +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+6yfwIaPzaSZVfp3F +VRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA3GV1 +7CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+X +Z75Ljo1kB1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+ +/jXh7VB7qTCNGdMJjmhnXb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs +81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxHoLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkm +dtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3F0fUTPHSiXk+TT2YqGHe +Oh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJoWjiUIMu +sDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4 +pgd7gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fs +slESl1MpWtTwEhDcTwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQ +arMCpgKIv7NHfirZ1fpoeDVNAgMBAAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYD +VR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qWDNXr+nuqF+gTEjANBgkqhkiG +9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNmzqjMDfz1mgbl +dxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx +0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1Tj +TQpgcmLNkQfWpb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBed +Y2gea+zDTYa4EzAvXUYNR0PVG6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7 +Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpcc41teyWRyu5FrgZLAMzTsVlQ2jqI +OylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOTJsjrDNYmiLbAJM+7 +vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2qReW +t88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcn +HL/EVlP6Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVx +SK236thZiNSQvxaz2emsWWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= +-----END CERTIFICATE----- + ### thawte, Inc. === /C=US/O=thawte, Inc./OU=(c) 2007 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA - G2 @@ -3286,95 +5764,358 @@ VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG jjxDah2nGN59PRbxYvnKkKj9 -----END CERTIFICATE----- -=== /C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware + +### TrustCor Systems S. de R.L. + +=== /C=PA/ST=Panama/L=Panama City/O=TrustCor Systems S. de R.L./OU=TrustCor Certificate Authority/CN=TrustCor ECA-1 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 9548242946988625984 (0x84822c5f1c62d040) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Feb 4 12:32:33 2016 GMT + Not After : Dec 31 17:28:07 2029 GMT + Subject: C=PA, ST=Panama, L=Panama City, O=TrustCor Systems S. de R.L., OU=TrustCor Certificate Authority, CN=TrustCor ECA-1 + X509v3 extensions: + X509v3 Subject Key Identifier: + 44:9E:48:F5:CC:6D:48:D4:A0:4B:7F:FE:59:24:2F:83:97:99:9A:86 + X509v3 Authority Key Identifier: + keyid:44:9E:48:F5:CC:6D:48:D4:A0:4B:7F:FE:59:24:2F:83:97:99:9A:86 + + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign +SHA1 Fingerprint=58:D1:DF:95:95:67:6B:63:C0:F0:5B:1C:17:4D:8B:84:0B:C8:78:BD +SHA256 Fingerprint=5A:88:5D:B1:9C:01:D9:12:C5:75:93:88:93:8C:AF:BB:DF:03:1A:B2:D4:8E:91:EE:15:58:9B:42:97:1D:03:9C +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIJAISCLF8cYtBAMA0GCSqGSIb3DQEBCwUAMIGcMQswCQYD +VQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEk +MCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U +cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxFzAVBgNVBAMMDlRydXN0Q29y +IEVDQS0xMB4XDTE2MDIwNDEyMzIzM1oXDTI5MTIzMTE3MjgwN1owgZwxCzAJBgNV +BAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQw +IgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRy +dXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0eTEXMBUGA1UEAwwOVHJ1c3RDb3Ig +RUNBLTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPj+ARtZ+odnbb +3w9U73NjKYKtR8aja+3+XzP4Q1HpGjORMRegdMTUpwHmspI+ap3tDvl0mEDTPwOA +BoJA6LHip1GnHYMma6ve+heRK9jGrB6xnhkB1Zem6g23xFUfJ3zSCNV2HykVh0A5 +3ThFEXXQmqc04L/NyFIduUd+Dbi7xgz2c1cWWn5DkR9VOsZtRASqnKmcp0yJF4Ou +owReUoCLHhIlERnXDH19MURB6tuvsBzvgdAsxZohmz3tQjtQJvLsznFhBmIhVE5/ +wZ0+fyCMgMsq2JdiyIMzkX2woloPV+g7zPIlstR8L+xNxqE6FXrntl019fZISjZF +ZtS6mFjBAgMBAAGjYzBhMB0GA1UdDgQWBBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAf +BgNVHSMEGDAWgBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAPBgNVHRMBAf8EBTADAQH/ +MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAQEABT41XBVwm8nHc2Fv +civUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u/ukZMjgDfxT2 +AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11F +hcCF5yWPldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50 +soIipX1TH0XsJ5F95yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BI +WJZpTdwHjFGTot+fDz2LYLSCjaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1Wi +tJ/X5g== +-----END CERTIFICATE----- +=== /C=PA/ST=Panama/L=Panama City/O=TrustCor Systems S. de R.L./OU=TrustCor Certificate Authority/CN=TrustCor RootCert CA-1 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 15752444095811006489 (0xda9bec71f303b019) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Feb 4 12:32:16 2016 GMT + Not After : Dec 31 17:23:16 2029 GMT + Subject: C=PA, ST=Panama, L=Panama City, O=TrustCor Systems S. de R.L., OU=TrustCor Certificate Authority, CN=TrustCor RootCert CA-1 + X509v3 extensions: + X509v3 Subject Key Identifier: + EE:6B:49:3C:7A:3F:0D:E3:B1:09:B7:8A:C8:AB:19:9F:73:33:50:E7 + X509v3 Authority Key Identifier: + keyid:EE:6B:49:3C:7A:3F:0D:E3:B1:09:B7:8A:C8:AB:19:9F:73:33:50:E7 + + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign +SHA1 Fingerprint=FF:BD:CD:E7:82:C8:43:5E:3C:6F:26:86:5C:CA:A8:3A:45:5B:C3:0A +SHA256 Fingerprint=D4:0E:9C:86:CD:8F:E4:68:C1:77:69:59:F4:9E:A7:74:FA:54:86:84:B6:C4:06:F3:90:92:61:F4:DC:E2:57:5C +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEBCwUAMIGkMQswCQYD +VQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEk +MCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U +cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRydXN0Q29y +IFJvb3RDZXJ0IENBLTEwHhcNMTYwMjA0MTIzMjE2WhcNMjkxMjMxMTcyMzE2WjCB +pDELMAkGA1UEBhMCUEExDzANBgNVBAgMBlBhbmFtYTEUMBIGA1UEBwwLUGFuYW1h +IENpdHkxJDAiBgNVBAoMG1RydXN0Q29yIFN5c3RlbXMgUy4gZGUgUi5MLjEnMCUG +A1UECwweVHJ1c3RDb3IgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYDVQQDDBZU +cnVzdENvciBSb290Q2VydCBDQS0xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAv463leLCJhJrMxnHQFgKq1mqjQCj/IDHUHuO1CAmujIS2CNUSSUQIpid +RtLByZ5OGy4sDjjzGiVoHKZaBeYei0i/mJZ0PmnK6bV4pQa81QBeCQryJ3pS/C3V +seq0iWEk8xoT26nPUu0MJLq5nux+AHT6k61sKZKuUbS701e/s/OojZz0JEsq1pme +9J7+wH5COucLlVPat2gOkEz7cD+PSiyU8ybdY2mplNgQTsVHCJCZGxdNuWxu72CV +EY4hgLW9oHPY0LJ3xEXqWib7ZnZ2+AYfYW0PVcWDtxBWcgYHpfOxGgMFZA6dWorW +hnAbJN7+KIor0Gqw/Hqi3LJ5DotlDwIDAQABo2MwYTAdBgNVHQ4EFgQU7mtJPHo/ +DeOxCbeKyKsZn3MzUOcwHwYDVR0jBBgwFoAU7mtJPHo/DeOxCbeKyKsZn3MzUOcw +DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQAD +ggEBACUY1JGPE+6PHh0RU9otRCkZoB5rMZ5NDp6tPVxBb5UrJKF5mDo4Nvu7Zp5I +/5CQ7z3UuJu0h3U/IJvOcs+hVcFNZKIZBqEHMwwLKeXx6quj7LUKdJDHfXLy11yf +ke+Ri7fc7Waiz45mO7yfOgLgJ90WmMCV1Aqk5IGadZQ1nJBfiDcGrVmVCrDRZ9MZ +yonnMlo2HD6CqFqTvsbQZJG2z9m2GM/bftJlo6bEjhcxwft+dtvTheNYsnd6djts +L1Ac59v2Z3kf9YKVmgenFK+P3CghZwnS1k1aHBkcjndcw5QkPTJrS37UeJSDvjdN +zl/HHk484IkzlQsPpTLWPFp5LBk= +-----END CERTIFICATE----- +=== /C=PA/ST=Panama/L=Panama City/O=TrustCor Systems S. de R.L./OU=TrustCor Certificate Authority/CN=TrustCor RootCert CA-2 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 2711694510199101698 (0x25a1dfca33cb5902) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Feb 4 12:32:23 2016 GMT + Not After : Dec 31 17:26:39 2034 GMT + Subject: C=PA, ST=Panama, L=Panama City, O=TrustCor Systems S. de R.L., OU=TrustCor Certificate Authority, CN=TrustCor RootCert CA-2 + X509v3 extensions: + X509v3 Subject Key Identifier: + D9:FE:21:40:6E:94:9E:BC:9B:3D:9C:7D:98:20:19:E5:8C:30:62:B2 + X509v3 Authority Key Identifier: + keyid:D9:FE:21:40:6E:94:9E:BC:9B:3D:9C:7D:98:20:19:E5:8C:30:62:B2 + + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign +SHA1 Fingerprint=B8:BE:6D:CB:56:F1:55:B9:63:D4:12:CA:4E:06:34:C7:94:B2:1C:C0 +SHA256 Fingerprint=07:53:E9:40:37:8C:1B:D5:E3:83:6E:39:5D:AE:A5:CB:83:9E:50:46:F1:BD:0E:AE:19:51:CF:10:FE:C7:C9:65 +-----BEGIN CERTIFICATE----- +MIIGLzCCBBegAwIBAgIIJaHfyjPLWQIwDQYJKoZIhvcNAQELBQAwgaQxCzAJBgNV +BAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQw +IgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRy +dXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0eTEfMB0GA1UEAwwWVHJ1c3RDb3Ig +Um9vdENlcnQgQ0EtMjAeFw0xNjAyMDQxMjMyMjNaFw0zNDEyMzExNzI2MzlaMIGk +MQswCQYDVQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEg +Q2l0eTEkMCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYD +VQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRy +dXN0Q29yIFJvb3RDZXJ0IENBLTIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK +AoICAQCnIG7CKqJiJJWQdsg4foDSq8GbZQWU9MEKENUCrO2fk8eHyLAnK0IMPQo+ +QVqedd2NyuCb7GgypGmSaIwLgQ5WoD4a3SwlFIIvl9NkRvRUqdw6VC0xK5mC8tkq +1+9xALgxpL56JAfDQiDyitSSBBtlVkxs1Pu2YVpHI7TYabS3OtB0PAx1oYxOdqHp +2yqlO/rOsP9+aij9JxzIsekp8VduZLTQwRVtDr4uDkbIXvRR/u8OYzo7cbrPb1nK +DOObXUm4TOJXsZiKQlecdu/vvdFoqNL0Cbt3Nb4lggjEFixEIFapRBF37120Hape +az6LMvYHL1cEksr1/p3C6eizjkxLAjHZ5DxIgif3GIJ2SDpxsROhOdUuxTTCHWKF +3wP+TfSvPd9cW436cOGlfifHhi5qjxLGhF5DUVCcGZt45vz27Ud+ez1m7xMTiF88 +oWP7+ayHNZ/zgp6kPwqcMWmLmaSISo5uZk3vFsQPeSghYA2FFn3XVDjxklb9tTNM +g9zXEJ9L/cb4Qr26fHMC4P99zVvh1Kxhe1fVSntb1IVYJ12/+CtgrKAmrhQhJ8Z3 +mjOAPF5GP/fDsaOGM8boXg25NSyqRsGFAnWAoOsk+xWq5Gd/bnc/9ASKL3x74xdh +8N0JqSDIvgmk0H5Ew7IwSjiqqewYmgeCK9u4nBit2uBGF6zPXQIDAQABo2MwYTAd +BgNVHQ4EFgQU2f4hQG6UnrybPZx9mCAZ5YwwYrIwHwYDVR0jBBgwFoAU2f4hQG6U +nrybPZx9mCAZ5YwwYrIwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYw +DQYJKoZIhvcNAQELBQADggIBAJ5Fngw7tu/hOsh80QA9z+LqBrWyOrsGS2h60COX +dKcs8AjYeVrXWoSK2BKaG9l9XE1wxaX5q+WjiYndAfrs3fnpkpfbsEZC89NiqpX+ +MWcUaViQCqoL7jcjx1BRtPV+nuN79+TMQjItSQzL/0kMmx40/W5ulop5A7Zv2wnL +/V9lFDfhOPXzYRZY5LVtDQsEGz9QLX+zx3oaFoBg+Iof6Rsqxvm6ARppv9JYx1RX +CI/hOWB3S6xZhBqI8d3LT3jX5+EzLfzuQfogsL7L9ziUwOHQhQ+77Sxzq+3+knYa +ZH9bDTMJBzN7Bj8RpFxwPIXAz+OQqIN3+tvmxYxoZxBnpVIt8MSZj3+/0WvitUfW +2dCFmU2Umw9Lje4AWkcdEQOsQRivh7dvDDqPys/cA8GiCcjl/YBeyGBCARsaU1q7 +N6a3vLqE6R5sGtRk2tRD/pOLS/IseRYQ1JMLiI+h2IYURpFHmygk71dSTlxCnKr3 +Sewn6EAes6aJInKc9Q0ztFijMDvd1GpUk74aTfOTlPf8hAs/hCBcNANExdqtvArB +As8e5ZTZ845b2EzwnexhF7sUMlQMAimTHpKG9n/v55IFDlndmQguLvqcAFLTxWYp +5KeXRKQOKIETNcX2b2TmQcTVL8w0RSXPQQCWPUouwpaYT05KnJe32x+SMsj/D1Fu +1uwJ +-----END CERTIFICATE----- + +### Trustis Limited + +=== /C=GB/O=Trustis Limited/OU=Trustis FPS Root CA Certificate: Data: Version: 3 (0x2) Serial Number: - 44:be:0c:8b:50:00:24:b4:11:d3:36:2a:fe:65:0a:fd + 1b:1f:ad:b6:20:f9:24:d3:36:6b:f7:c7:f1:8c:a0:59 Signature Algorithm: sha1WithRSAEncryption Validity - Not Before: Jul 9 18:10:42 1999 GMT - Not After : Jul 9 18:19:22 2019 GMT - Subject: C=US, ST=UT, L=Salt Lake City, O=The USERTRUST Network, OU=http://www.usertrust.com, CN=UTN-USERFirst-Hardware + Not Before: Dec 23 12:14:06 2003 GMT + Not After : Jan 21 11:36:54 2024 GMT + Subject: C=GB, O=Trustis Limited, OU=Trustis FPS Root CA X509v3 extensions: - X509v3 Key Usage: - Digital Signature, Non Repudiation, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE + X509v3 Authority Key Identifier: + keyid:BA:FA:71:25:79:8B:57:41:25:21:86:0B:71:EB:B2:64:0E:8B:21:67 + X509v3 Subject Key Identifier: - A1:72:5F:26:1B:28:98:43:95:5D:07:37:D5:85:96:9D:4B:D2:C3:45 - X509v3 CRL Distribution Points: + BA:FA:71:25:79:8B:57:41:25:21:86:0B:71:EB:B2:64:0E:8B:21:67 +SHA1 Fingerprint=3B:C0:38:0B:33:C3:F6:A6:0C:86:15:22:93:D9:DF:F5:4B:81:C0:04 +SHA256 Fingerprint=C1:B4:82:99:AB:A5:20:8F:E9:63:0A:CE:55:CA:68:A0:3E:DA:5A:51:9C:88:02:A0:D3:A6:73:BE:8F:8E:55:7D +-----BEGIN CERTIFICATE----- +MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBF +MQswCQYDVQQGEwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQL +ExNUcnVzdGlzIEZQUyBSb290IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTEx +MzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNVBAoTD1RydXN0aXMgTGltaXRlZDEc +MBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQRUN+ +AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihH +iTHcDnlkH5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjj +vSkCqPoc4Vu5g6hBSLwacY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA +0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zto3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlB +OrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEAAaNTMFEwDwYDVR0TAQH/ +BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAdBgNVHQ4E +FgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01 +GX2cGE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmW +zaD+vkAMXBJV+JOCyinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP4 +1BIy+Q7DsdwyhEQsb8tGD+pmQQ9P8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZE +f1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHVl/9D7S3B2l0pKoU/rGXuhg8F +jZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYliB6XzCGcKQEN +ZetX2fNXlrtIzYE= +-----END CERTIFICATE----- - Full Name: - URI:http://crl.usertrust.com/UTN-USERFirst-Hardware.crl - - X509v3 Extended Key Usage: - TLS Web Server Authentication, IPSec End System, IPSec Tunnel, IPSec User -SHA1 Fingerprint=04:83:ED:33:99:AC:36:08:05:87:22:ED:BC:5E:46:00:E3:BE:F9:D7 -SHA256 Fingerprint=6E:A5:47:41:D0:04:66:7E:ED:1B:48:16:63:4A:A3:A7:9E:6E:4B:96:95:0F:82:79:DA:FC:8D:9B:D8:81:21:37 ------BEGIN CERTIFICATE----- -MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB -lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug -Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho -dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt -SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG -A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe -MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v -d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh -cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn -0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ -M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a -MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd -oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI -DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy -oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD -VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0 -dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy -bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF -BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM -//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli -CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE -CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t -3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS -KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA== ------END CERTIFICATE----- - -### Unizeto Sp. z o.o. - -=== /C=PL/O=Unizeto Sp. z o.o./CN=Certum CA -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 65568 (0x10020) - Signature Algorithm: sha1WithRSAEncryption +### Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK + +=== /C=TR/L=Gebze - Kocaeli/O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK/OU=Kamu Sertifikasyon Merkezi - Kamu SM/CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Nov 25 08:25:55 2013 GMT + Not After : Oct 25 08:25:55 2043 GMT + Subject: C=TR, L=Gebze - Kocaeli, O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK, OU=Kamu Sertifikasyon Merkezi - Kamu SM, CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 + X509v3 extensions: + X509v3 Subject Key Identifier: + 65:3F:C7:8A:86:C6:3C:DD:3C:54:5C:35:F8:3A:ED:52:0C:47:57:C8 + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE +SHA1 Fingerprint=31:43:64:9B:EC:CE:27:EC:ED:3A:3F:0B:8F:0D:E4:E8:91:DD:EE:CA +SHA256 Fingerprint=46:ED:C3:68:90:46:D5:3A:45:3F:B3:10:4A:B8:0D:CA:EC:65:8B:26:60:EA:16:29:DD:7E:86:79:90:64:87:16 +-----BEGIN CERTIFICATE----- +MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIx +GDAWBgNVBAcTD0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxp +bXNlbCB2ZSBUZWtub2xvamlrIEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0w +KwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24gTWVya2V6aSAtIEthbXUgU00xNjA0 +BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRpZmlrYXNpIC0gU3Vy +dW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYDVQQG +EwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXll +IEJpbGltc2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklU +QUsxLTArBgNVBAsTJEthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBT +TTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11IFNNIFNTTCBLb2sgU2VydGlmaWthc2kg +LSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr3UwM6q7 +a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y86Ij5iySr +LqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INr +N3wcwv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2X +YacQuFWQfw4tJzh03+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/ +iSIzL+aFCr2lqBs23tPcLG07xxO9WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4f +AJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQUZT/HiobGPN08VFw1+DrtUgxH +V8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL +BQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh +AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPf +IPP54+M638yclNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4 +lzwDGrpDxpa5RXI4s6ehlj2Re37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c +8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0jq5Rm+K37DwhuJi1/FwcJsoz7UMCf +lo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= +-----END CERTIFICATE----- + +### UniTrust + +=== /C=CN/O=UniTrust/CN=UCA Extended Validation Root +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 4f:d2:2b:8f:f5:64:c8:33:9e:4f:34:58:66:23:70:60 + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Mar 13 00:00:00 2015 GMT + Not After : Dec 31 00:00:00 2038 GMT + Subject: C=CN, O=UniTrust, CN=UCA Extended Validation Root + X509v3 extensions: + X509v3 Subject Key Identifier: + D9:74:3A:E4:30:3D:0D:F7:12:DC:7E:5A:05:9F:1E:34:9A:F7:E1:14 + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign +SHA1 Fingerprint=A3:A1:B0:6F:24:61:23:4A:E3:36:A5:C2:37:FC:A6:FF:DD:F0:D7:3A +SHA256 Fingerprint=D4:3A:F9:B3:54:73:75:5C:96:84:FC:06:D7:D8:CB:70:EE:5C:28:E7:73:FB:29:4E:B4:1E:E7:17:22:92:4D:24 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQT9Irj/VkyDOeTzRYZiNwYDANBgkqhkiG9w0BAQsFADBH +MQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBF +eHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwHhcNMTUwMzEzMDAwMDAwWhcNMzgxMjMx +MDAwMDAwWjBHMQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNV +BAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQCpCQcoEwKwmeBkqh5DFnpzsZGgdT6o+uM4AHrsiWog +D4vFsJszA1qGxliG1cGFu0/GnEBNyr7uaZa4rYEwmnySBesFK5pI0Lh2PpbIILvS +sPGP2KxFRv+qZ2C0d35qHzwaUnoEPQc8hQ2E0B92CvdqFN9y4zR8V05WAT558aop +O2z6+I9tTcg1367r3CTueUWnhbYFiN6IXSV8l2RnCdm/WhUFhvMJHuxYMjMR83dk +sHYf5BA1FxvyDrFspCqjc/wJHx4yGVMR59mzLC52LqGj3n5qiAno8geK+LLNEOfi +c0CTuwjRP+H8C5SzJe98ptfRr5//lpr1kXuYC3fUfugH0mK1lTnj8/FtDw5lhIpj +VMWAtuCeS31HJqcBCF3RiJ7XwzJE+oJKCmhUfzhTA8ykADNkUVkLo4KRel7sFsLz +KuZi2irbWWIQJUoqgQtHB0MGcIfS+pMRKXpITeuUx3BNr2fVUbGAIAEBtHoIppB/ +TuDvB0GHr2qlXov7z1CymlSvw4m6WC31MJixNnI5fkkE/SmnTHnkBVfblLkWU41G +sx2VYVdWf6/wFlthWG82UBEL2KwrlRYaDh8IzTY0ZRBiZtWAXxQgXy0MoHgKaNYs +1+lvK9JKBZP8nm9rZ/+I8U6laUpSNwXqxhaN0sSZ0YIrO7o1dfdRUVjzyAfd5LQD +fwIDAQABo0IwQDAdBgNVHQ4EFgQU2XQ65DA9DfcS3H5aBZ8eNJr34RQwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBADaN +l8xCFWQpN5smLNb7rhVpLGsaGvdftvkHTFnq88nIua7Mui563MD1sC3AO6+fcAUR +ap8lTwEpcOPlDOHqWnzcSbvBHiqB9RZLcpHIojG5qtr8nR/zXUACE/xOHAbKsxSQ +VBcZEhrxH9cMaVr2cXj0lH2RC47skFSOvG+hTKv8dGT9cZr4QQehzZHkPJrgmzI5 +c6sq1WnIeJEmMX3ixzDx/BR4dxIOE/TdFpS/S2d7cFOFyrC78zhNLJA5wA3CXWvp +4uXViI3WLL+rG761KIcSF3Ru/H38j9CHJrAb+7lsq+KePRXBOy5nAliRn+/4Qh8s +t2j1da3Ptfb/EX3C8CSlrdP6oDyp+l3cpaDvRKS+1ujl5BOWF3sGPjLtx7dCvHaj +2GU4Kzg1USEODm8uNBNA4StnDG1KQTAYI1oyVZnJF+A83vbsea0rWBmirSwiGpWO +vpaQXUJXxPkUAzUrHC1RVwinOt4/5Mi0A3PCwSaAuwtCH60NryZy2sy+s6ODWA2C +xR9GUeOcGMyNm43sSet1UNWMKFnKdDTajAshqx7qG+XH/RU+wBeq+yNuJkbL+vmx +cmtpzyKEC2IPrNkZAJSidjzULZrtBJ4tBmIQN1IchXIbJ+XMxjHsN+xjWZsLHXbM +fjKaiJUINlK73nZfdklJrX+9ZSCyycErdhh2n1ax +-----END CERTIFICATE----- +=== /C=CN/O=UniTrust/CN=UCA Global G2 Root +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 5d:df:b1:da:5a:a3:ed:5d:be:5a:65:20:65:03:90:ef + Signature Algorithm: sha256WithRSAEncryption Validity - Not Before: Jun 11 10:46:39 2002 GMT - Not After : Jun 11 10:46:39 2027 GMT - Subject: C=PL, O=Unizeto Sp. z o.o., CN=Certum CA + Not Before: Mar 11 00:00:00 2016 GMT + Not After : Dec 31 00:00:00 2040 GMT + Subject: C=CN, O=UniTrust, CN=UCA Global G2 Root X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE -SHA1 Fingerprint=62:52:DC:40:F7:11:43:A2:2F:DE:9E:F7:34:8E:06:42:51:B1:81:18 -SHA256 Fingerprint=D8:E0:FE:BC:1D:B2:E3:8D:00:94:0F:37:D2:7D:41:34:4D:99:3E:73:4B:99:D5:65:6D:97:78:D4:D8:14:36:24 + X509v3 Subject Key Identifier: + 81:C4:8C:CC:F5:E4:30:FF:A5:0C:08:5F:8C:15:67:21:74:01:DF:DF +SHA1 Fingerprint=28:F9:78:16:19:7A:FF:18:25:18:AA:44:FE:C1:A0:CE:5C:B6:4C:8A +SHA256 Fingerprint=9B:EA:11:C9:76:FE:01:47:64:C1:BE:56:A6:F9:14:B5:A5:60:31:7A:BD:99:88:39:33:82:E5:16:1A:A0:49:3C -----BEGIN CERTIFICATE----- -MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM -MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD -QTAeFw0wMjA2MTExMDQ2MzlaFw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBM -MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD -QTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6xwS7TT3zNJc4YPk/E -jG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdLkKWo -ePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GI -ULdtlkIJ89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapu -Ob7kky/ZR6By6/qmW6/KUz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUg -AKpoC6EahQGcxEZjgoi2IrHu/qpGWX7PNSzVttpd90gzFFS269lvzs2I1qsb2pY7 -HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEA -uI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+GXYkHAQa -TOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTg -xSvgGrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1q -CjqTE5s7FCMTY5w/0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5x -O/fIR/RpbxXyEV6DHpx8Uq79AtoSqFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs -6GAqm4VKQPNriiTsBhYscw== +MIIFRjCCAy6gAwIBAgIQXd+x2lqj7V2+WmUgZQOQ7zANBgkqhkiG9w0BAQsFADA9 +MQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxGzAZBgNVBAMMElVDQSBH +bG9iYWwgRzIgUm9vdDAeFw0xNjAzMTEwMDAwMDBaFw00MDEyMzEwMDAwMDBaMD0x +CzAJBgNVBAYTAkNOMREwDwYDVQQKDAhVbmlUcnVzdDEbMBkGA1UEAwwSVUNBIEds +b2JhbCBHMiBSb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxeYr +b3zvJgUno4Ek2m/LAfmZmqkywiKHYUGRO8vDaBsGxUypK8FnFyIdK+35KYmToni9 +kmugow2ifsqTs6bRjDXVdfkX9s9FxeV67HeToI8jrg4aA3++1NDtLnurRiNb/yzm +VHqUwCoV8MmNsHo7JOHXaOIxPAYzRrZUEaalLyJUKlgNAQLx+hVRZ2zA+te2G3/R +VogvGjqNO7uCEeBHANBSh6v7hn4PJGtAnTRnvI3HLYZveT6OqTwXS3+wmeOwcWDc +C/Vkw85DvG1xudLeJ1uK6NjGruFZfc8oLTW4lVYa8bJYS7cSN8h8s+1LgOGN+jIj +tm+3SJUIsUROhYw6AlQgL9+/V087OpAh18EmNVQg7Mc/R+zvWr9LesGtOxdQXGLY +D0tK3Cv6brxzks3sx1DoQZbXqX5t2Okdj4q1uViSukqSKwxW/YDrCPBeKW4bHAyv +j5OJrdu9o54hyokZ7N+1wxrrFv54NkzWbtA+FxyQF2smuvt6L78RHBgOLXMDj6Dl +NaBa4kx1HXHhOThTeEDMg5PXCp6dW4+K5OXgSORIskfNTip1KnvyIvbJvgmRlld6 +iIis7nCs+dwp4wwcOxJORNanTrAmyPPZGpeRaOrvjUYG0lZFWJo8DA+DuAUlwznP +O6Q0ibd5Ei9Hxeepl2n8pndntd978XplFeRhVmUCAwEAAaNCMEAwDgYDVR0PAQH/ +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFIHEjMz15DD/pQwIX4wV +ZyF0Ad/fMA0GCSqGSIb3DQEBCwUAA4ICAQATZSL1jiutROTL/7lo5sOASD0Ee/oj +L3rtNtqyzm325p7lX1iPyzcyochltq44PTUbPrw7tgTQvPlJ9Zv3hcU2tsu8+Mg5 +1eRfB70VVJd0ysrtT7q6ZHafgbiERUlMjW+i67HM0cOU2kTC5uLqGOiiHycFutfl +1qnN3e92mI0ADs0b+gO3joBYDic/UvuUospeZcnWhNq5NXHzJsBPd+aBJ9J3O5oU +b3n09tDh05S60FdRvScFDcH9yBIw7m+NESsIndTUv4BFFJqIRNow6rSn4+7vW4LV +PtateJLbXDzz2K36uGt/xDYotgIVilQsnLAXc47QN6MUPJiVAAwpBVueSUmxX8fj +y88nZY41F7dXyDDZQVu5FLbowg+UMaeUmMxq67XhJ/UQqAHojhJi6IjMtX9Gl8Cb +EGY4GjZGXyJoPd/JxhMnq1MGrKI8hgZlb7F+sSlEmqO6SWkoaY/X5V+tBIZkbxqg +DMUIYs6Ao9Dz7GjevjPHF1t/gMRMTLGmhIrDO7gJzRSBuhjjVFc2/tsvfEehOjPI ++Vg7RE+xygKJBJYoaMVLuCaJu9YzL1DV/pqJuhgyklTGW+Cd+V7lDSKb9triyCGy +YiGqhkCyLmTTX8jjfhFnRR8F/uOi77Oos/N9j/gMHyIfLXC0uAE0djAA5SN4p1bX +UB+K+wb1whnw0A== -----END CERTIFICATE----- ### Unizeto Technologies S.A. @@ -3420,60 +6161,6 @@ J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY VoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI 03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= -----END CERTIFICATE----- -=== /C=PL/O=Unizeto Technologies S.A./OU=Certum Certification Authority/CN=Certum Trusted Network CA 2 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - 21:d6:d0:4a:4f:25:0f:c9:32:37:fc:aa:5e:12:8d:e9 - Signature Algorithm: sha512WithRSAEncryption - Validity - Not Before: Oct 6 08:39:56 2011 GMT - Not After : Oct 6 08:39:56 2046 GMT - Subject: C=PL, O=Unizeto Technologies S.A., OU=Certum Certification Authority, CN=Certum Trusted Network CA 2 - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Subject Key Identifier: - B6:A1:54:39:02:C3:A0:3F:8E:8A:BC:FA:D4:F8:1C:A6:D1:3A:0E:FD - X509v3 Key Usage: critical - Certificate Sign, CRL Sign -SHA1 Fingerprint=D3:DD:48:3E:2B:BF:4C:05:E8:AF:10:F5:FA:76:26:CF:D3:DC:30:92 -SHA256 Fingerprint=B6:76:F2:ED:DA:E8:77:5C:D3:6C:B0:F6:3C:D1:D4:60:39:61:F4:9E:62:65:BA:01:3A:2F:03:07:B6:D0:B8:04 ------BEGIN CERTIFICATE----- -MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCB -gDELMAkGA1UEBhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMu -QS4xJzAlBgNVBAsTHkNlcnR1bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIG -A1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29yayBDQSAyMCIYDzIwMTExMDA2MDgz -OTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQTDEiMCAGA1UEChMZ -VW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3 -b3JrIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC9+Xj45tWA -DGSdhhuWZGc/IjoedQF97/tcZ4zJzFxrqZHmuULlIEub2pt7uZld2ZuAS9eEQCsn -0+i6MLs+CRqnSZXvK0AkwpfHp+6bJe+oCgCXhVqqndwpyeI1B+twTUrWwbNWuKFB -OJvR+zF/j+Bf4bE/D44WSWDXBo0Y+aomEKsq09DRZ40bRr5HMNUuctHFY9rnY3lE -fktjJImGLjQ/KUxSiyqnwOKRKIm5wFv5HdnnJ63/mgKXwcZQkpsCLL2puTRZCr+E -Sv/f/rOf69me4Jgj7KZrdxYq28ytOxykh9xGc14ZYmhFV+SQgkK7QtbwYeDBoz1m -o130GO6IyY0XRSmZMnUCMe4pJshrAua1YkV/NxVaI2iJ1D7eTiew8EAMvE0Xy02i -sx7QBlrd9pPPV3WZ9fqGGmd4s7+W/jTcvedSVuWz5XV710GRBdxdaeOVDUO5/IOW -OZV7bIBaTxNyxtd9KXpEulKkKtVBRgkg/iKgtlswjbyJDNXXcPiHUv3a76xRLgez -Tv7QCdpw75j6VuZt27VXS9zlLCUVyJ4ueE742pyehizKV/Ma5ciSixqClnrDvFAS -adgOWkaLOusm+iPJtrCBvkIApPjW/jAux9JG9uWOdf3yzLnQh1vMBhBgu4M1t15n -3kfsmUjxpKEV/q2MYo45VU85FrmxY53/twIDAQABo0IwQDAPBgNVHRMBAf8EBTAD -AQH/MB0GA1UdDgQWBBS2oVQ5AsOgP46KvPrU+Bym0ToO/TAOBgNVHQ8BAf8EBAMC -AQYwDQYJKoZIhvcNAQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQ -F/xlhMcQSZDe28cmk4gmb3DWAl45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTf -CVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuAL55MYIR4PSFk1vtBHxgP58l1cb29 -XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMoclm2q8KMZiYcdywm -djWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tMpkT/ -WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jb -AoJnwTnbw3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksq -P/ujmv5zMnHCnsZy4YpoJ/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Ko -b7a6bINDd82Kkhehnlt4Fj1F4jNy3eFmypnTycUm/Q1oBEauttmbjL4ZvrHG8hnj -XALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLXis7VmFxWlgPF7ncGNf/P -5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7zAYspsbi -DrW5viSP ------END CERTIFICATE----- ### VeriSign, Inc. @@ -3657,3 +6344,190 @@ BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3 7M2CYfE45k+XmCpajQ== -----END CERTIFICATE----- + +### WISeKey + +=== /C=CH/O=WISeKey/OU=Copyright (c) 2005/OU=OISTE Foundation Endorsed/CN=OISTE WISeKey Global Root GA CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 41:3d:72:c7:f4:6b:1f:81:43:7d:f1:d2:28:54:df:9a + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Dec 11 16:03:44 2005 GMT + Not After : Dec 11 16:09:51 2037 GMT + Subject: C=CH, O=WISeKey, OU=Copyright (c) 2005, OU=OISTE Foundation Endorsed, CN=OISTE WISeKey Global Root GA CA + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + B3:03:7E:AE:36:BC:B0:79:D1:DC:94:26:B6:11:BE:21:B2:69:86:94 + 1.3.6.1.4.1.311.21.1: + ... +SHA1 Fingerprint=59:22:A1:E1:5A:EA:16:35:21:F8:98:39:6A:46:46:B0:44:1B:0F:A9 +SHA256 Fingerprint=41:C9:23:86:6A:B4:CA:D6:B7:AD:57:80:81:58:2E:02:07:97:A6:CB:DF:4F:FF:78:CE:83:96:B3:89:37:D7:F5 +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCB +ijELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHly +aWdodCAoYykgMjAwNTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl +ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQSBDQTAeFw0w +NTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYDVQQGEwJDSDEQMA4G +A1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIwIAYD +VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBX +SVNlS2V5IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAy0+zAJs9Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxR +VVuuk+g3/ytr6dTqvirdqFEr12bDYVxgAsj1znJ7O7jyTmUIms2kahnBAbtzptf2 +w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbDd50kc3vkDIzh2TbhmYsF +mQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ/yxViJGg +4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t9 +4B3RLoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYw +DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQw +EAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOx +SPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vImMMkQyh2I+3QZH4VFvbBsUfk2 +ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4+vg1YFkCExh8 +vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa +hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZi +Fj4A4xylNoEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ +/L7fCg0= +-----END CERTIFICATE----- +=== /C=CH/O=WISeKey/OU=OISTE Foundation Endorsed/CN=OISTE WISeKey Global Root GB CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 76:b1:20:52:74:f0:85:87:46:b3:f8:23:1a:f6:c2:c0 + Signature Algorithm: sha256WithRSAEncryption + Validity + Not Before: Dec 1 15:00:32 2014 GMT + Not After : Dec 1 15:10:31 2039 GMT + Subject: C=CH, O=WISeKey, OU=OISTE Foundation Endorsed, CN=OISTE WISeKey Global Root GB CA + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + 35:0F:C8:36:63:5E:E2:A3:EC:F9:3B:66:15:CE:51:52:E3:91:9A:3D + 1.3.6.1.4.1.311.21.1: + ... +SHA1 Fingerprint=0F:F9:40:76:18:D3:D7:6A:4B:98:F0:A8:35:9E:0C:FD:27:AC:CC:ED +SHA256 Fingerprint=6B:9C:08:E8:6E:B0:F7:67:CF:AD:65:CD:98:B6:21:49:E5:49:4A:67:F5:84:5E:7B:D1:ED:01:9F:27:B8:6B:D6 +-----BEGIN CERTIFICATE----- +MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBt +MQswCQYDVQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUg +Rm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9i +YWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAwMzJaFw0zOTEyMDExNTEwMzFaMG0x +CzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQLExlPSVNURSBG +b3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2Jh +bCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3 +HEokKtaXscriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGx +WuR51jIjK+FTzJlFXHtPrby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX +1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNk +u7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4oQnc/nSMbsrY9gBQHTC5P +99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvgGUpuuy9r +M2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUNQ/INmNe4qPs+TtmFc5RUuORmj0wEAYJKwYBBAGCNxUB +BAMCAQAwDQYJKoZIhvcNAQELBQADggEBAEBM+4eymYGQfp3FsLAmzYh7KzKNbrgh +cViXfa43FK8+5/ea4n32cZiZBKpDdHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5 +gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0VQreUGdNZtGn//3ZwLWoo4rO +ZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEuiHZeeevJuQHHf +aPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic +Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM= +-----END CERTIFICATE----- +=== /C=CH/O=WISeKey/OU=OISTE Foundation Endorsed/CN=OISTE WISeKey Global Root GC CA +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 21:2a:56:0c:ae:da:0c:ab:40:45:bf:2b:a2:2d:3a:ea + Signature Algorithm: ecdsa-with-SHA384 + Validity + Not Before: May 9 09:48:34 2017 GMT + Not After : May 9 09:58:33 2042 GMT + Subject: C=CH, O=WISeKey, OU=OISTE Foundation Endorsed, CN=OISTE WISeKey Global Root GC CA + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + 48:87:14:AC:E3:C3:9E:90:60:3A:D7:CA:89:EE:D3:AD:8C:B4:50:66 + 1.3.6.1.4.1.311.21.1: + ... +SHA1 Fingerprint=E0:11:84:5E:34:DE:BE:88:81:B9:9C:F6:16:26:D1:96:1F:C3:B9:31 +SHA256 Fingerprint=85:60:F9:1C:36:24:DA:BA:95:70:B5:FE:A0:DB:E3:6F:F1:1A:83:23:BE:94:86:85:4F:B3:F3:4A:55:71:19:8D +-----BEGIN CERTIFICATE----- +MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQsw +CQYDVQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91 +bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwg +Um9vdCBHQyBDQTAeFw0xNzA1MDkwOTQ4MzRaFw00MjA1MDkwOTU4MzNaMG0xCzAJ +BgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQLExlPSVNURSBGb3Vu +ZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2JhbCBS +b290IEdDIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETOlQwMYPchi82PG6s4ni +eUqjFqdrVCTbUf/q9Akkwwsin8tqJ4KBDdLArzHkdIJuyiXZjHWd8dvQmqJLIX4W +p2OQ0jnUsYd4XxiWD1AbNTcPasbc2RNNpI6QN+a9WzGRo1QwUjAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUSIcUrOPDnpBgOtfKie7T +rYy0UGYwEAYJKwYBBAGCNxUBBAMCAQAwCgYIKoZIzj0EAwMDaAAwZQIwJsdpW9zV +57LnyAyMjMPdeYwbY9XJUpROTYJKcx6ygISpJcBMWm1JKWB4E+J+SOtkAjEA2zQg +Mgj/mkkCtojeFK9dbJlxjRo/i9fgojaGHAeCOnZT/cKi7e97sIBPWA9LUzm9 +-----END CERTIFICATE----- + +### XRamp Security Services Inc + +=== /C=US/OU=www.xrampsecurity.com/O=XRamp Security Services Inc/CN=XRamp Global Certification Authority +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 50:94:6c:ec:18:ea:d5:9c:4d:d5:97:ef:75:8f:a0:ad + Signature Algorithm: sha1WithRSAEncryption + Validity + Not Before: Nov 1 17:14:04 2004 GMT + Not After : Jan 1 05:37:19 2035 GMT + Subject: C=US, OU=www.xrampsecurity.com, O=XRamp Security Services Inc, CN=XRamp Global Certification Authority + X509v3 extensions: + 1.3.6.1.4.1.311.20.2: + ...C.A + X509v3 Key Usage: + Digital Signature, Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + C6:4F:A2:3D:06:63:84:09:9C:CE:62:E4:04:AC:8D:5C:B5:E9:B6:1B + X509v3 CRL Distribution Points: + + Full Name: + URI:http://crl.xrampsecurity.com/XGCA.crl + + 1.3.6.1.4.1.311.21.1: + ... +SHA1 Fingerprint=B8:01:86:D1:EB:9C:86:A5:41:04:CF:30:54:F3:4C:52:B7:E5:58:C6 +SHA256 Fingerprint=CE:CD:DC:90:50:99:D8:DA:DF:C5:B1:D2:09:B7:37:CB:E2:C1:8C:FB:2C:10:C0:FF:0B:CF:0D:32:86:FC:1A:A2 +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB +gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk +MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY +UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx +NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3 +dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy +dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6 +38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP +KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q +DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4 +qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa +JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi +PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P +BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs +jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0 +eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD +ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR +vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa +IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy +i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ +O+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- diff --git a/apps/openssl/certhash.c b/apps/openssl/certhash.c index fdd719ea..5838f020 100644 --- a/apps/openssl/certhash.c +++ b/apps/openssl/certhash.c @@ -285,11 +285,11 @@ hashinfo_from_linkname(const char *linkname, const char *target) goto done; -err: + err: hashinfo_free(hi); hi = NULL; -done: + done: free(l); return (hi); @@ -318,7 +318,7 @@ certhash_cert(BIO *bio, const char *filename) hi = hashinfo(filename, hash, fingerprint); -err: + err: X509_free(cert); return (hi); @@ -347,7 +347,7 @@ certhash_crl(BIO *bio, const char *filename) hi = hashinfo(filename, hash, fingerprint); -err: + err: X509_CRL_free(crl); return (hi); @@ -371,7 +371,7 @@ certhash_addlink(struct hashinfo **links, struct hashinfo *hi) return (0); -err: + err: hashinfo_free(link); return (-1); } @@ -545,7 +545,7 @@ certhash_file(struct dirent *dep, struct hashinfo **certs, ret = 0; -err: + err: BIO_free(bio); return (ret); @@ -622,10 +622,10 @@ certhash_directory(const char *path) goto done; -err: + err: ret = 1; -done: + done: hashinfo_chain_free(certs); hashinfo_chain_free(crls); hashinfo_chain_free(links); diff --git a/apps/openssl/ciphers.c b/apps/openssl/ciphers.c index 72e12a3a..2b8ad5ba 100644 --- a/apps/openssl/ciphers.c +++ b/apps/openssl/ciphers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciphers.c,v 1.8 2015/10/17 15:00:11 doug Exp $ */ +/* $OpenBSD: ciphers.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -140,11 +140,11 @@ ciphers_main(int argc, char **argv) goto done; -err: + err: ERR_print_errors_fp(stderr); rv = 1; -done: + done: SSL_CTX_free(ssl_ctx); SSL_free(ssl); diff --git a/apps/openssl/compat/clock_gettime_osx.c b/apps/openssl/compat/clock_gettime_osx.c new file mode 100644 index 00000000..5545187c --- /dev/null +++ b/apps/openssl/compat/clock_gettime_osx.c @@ -0,0 +1,26 @@ +#include + +#include +#define ORWL_NANO (+1.0E-9) +#define ORWL_GIGA UINT64_C(1000000000) + +int +clock_gettime(clockid_t clock_id, struct timespec *tp) +{ + static double orwl_timebase = 0.0; + static uint64_t orwl_timestart = 0; + + if (!orwl_timestart) { + mach_timebase_info_data_t tb = { 0 }; + mach_timebase_info(&tb); + orwl_timebase = tb.numer; + orwl_timebase /= tb.denom; + orwl_timestart = mach_absolute_time(); + } + + double diff = (mach_absolute_time() - orwl_timestart) * orwl_timebase; + tp->tv_sec = diff * ORWL_NANO; + tp->tv_nsec = diff - (tp->tv_sec * ORWL_GIGA); + + return 0; +} diff --git a/apps/openssl/crl.c b/apps/openssl/crl.c index bb7ff627..cb1c18fa 100644 --- a/apps/openssl/crl.c +++ b/apps/openssl/crl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crl.c,v 1.10 2017/01/20 08:57:11 deraadt Exp $ */ +/* $OpenBSD: crl.c,v 1.12 2019/01/19 21:17:05 jsg Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -243,7 +243,7 @@ crl_main(int argc, char **argv) } } - digest = EVP_sha1(); + digest = EVP_sha256(); memset(&crl_config, 0, sizeof(crl_config)); crl_config.informat = FORMAT_PEM; @@ -424,7 +424,7 @@ crl_main(int argc, char **argv) } ret = 0; -end: + end: BIO_free_all(out); BIO_free_all(bio_out); bio_out = NULL; @@ -471,7 +471,7 @@ load_crl(char *infile, int format) goto end; } -end: + end: BIO_free(in); return (x); } diff --git a/apps/openssl/crl2p7.c b/apps/openssl/crl2p7.c index 9fceee80..a9c48a3d 100644 --- a/apps/openssl/crl2p7.c +++ b/apps/openssl/crl2p7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crl2p7.c,v 1.7 2017/01/20 08:57:11 deraadt Exp $ */ +/* $OpenBSD: crl2p7.c,v 1.8 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -277,7 +277,7 @@ crl2pkcs7_main(int argc, char **argv) } ret = 0; -end: + end: if (in != NULL) BIO_free(in); if (out != NULL) @@ -323,7 +323,7 @@ add_certs_from_file(STACK_OF(X509) *stack, char *certfile) ret = count; -end: + end: /* never need to free x */ if (in != NULL) BIO_free(in); diff --git a/apps/openssl/dgst.c b/apps/openssl/dgst.c index bcc9f1c7..5456a6c7 100644 --- a/apps/openssl/dgst.c +++ b/apps/openssl/dgst.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dgst.c,v 1.11 2017/04/18 02:15:50 deraadt Exp $ */ +/* $OpenBSD: dgst.c,v 1.13 2019/01/18 23:33:57 naddy Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -373,7 +373,7 @@ dgst_main(int argc, char **argv) /* we use md as a filter, reading from 'in' */ else { if (md == NULL) - md = EVP_md5(); + md = EVP_sha256(); if (!BIO_set_md(bmd, md)) { BIO_printf(bio_err, "Error setting digest %s\n", pname); ERR_print_errors(bio_err); @@ -447,7 +447,7 @@ dgst_main(int argc, char **argv) } } -end: + end: freezero(buf, BUFSIZE); if (in != NULL) BIO_free(in); diff --git a/apps/openssl/dh.c b/apps/openssl/dh.c index eb51b4b1..827ca9c7 100644 --- a/apps/openssl/dh.c +++ b/apps/openssl/dh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh.c,v 1.9 2017/01/20 08:57:11 deraadt Exp $ */ +/* $OpenBSD: dh.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -288,12 +288,10 @@ dh_main(int argc, char **argv) } ret = 0; -end: + end: BIO_free(in); - if (out != NULL) - BIO_free_all(out); - if (dh != NULL) - DH_free(dh); + BIO_free_all(out); + DH_free(dh); return (ret); } diff --git a/apps/openssl/dhparam.c b/apps/openssl/dhparam.c index 7c3bfb44..f27a5c9e 100644 --- a/apps/openssl/dhparam.c +++ b/apps/openssl/dhparam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhparam.c,v 1.9 2017/01/20 08:57:11 deraadt Exp $ */ +/* $OpenBSD: dhparam.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -292,8 +292,7 @@ dhparam_main(int argc, char **argv) BIO_printf(bio_err, "Generating DSA parameters, %d bit long prime\n", num); if (!dsa || !DSA_generate_parameters_ex(dsa, num, NULL, 0, NULL, NULL, &cb)) { - if (dsa) - DSA_free(dsa); + DSA_free(dsa); ERR_print_errors(bio_err); goto end; } @@ -467,12 +466,10 @@ dhparam_main(int argc, char **argv) } ret = 0; -end: + end: BIO_free(in); - if (out != NULL) - BIO_free_all(out); - if (dh != NULL) - DH_free(dh); + BIO_free_all(out); + DH_free(dh); return (ret); } diff --git a/apps/openssl/dsa.c b/apps/openssl/dsa.c index 5e0301c7..c988283b 100644 --- a/apps/openssl/dsa.c +++ b/apps/openssl/dsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa.c,v 1.9 2017/01/20 08:57:11 deraadt Exp $ */ +/* $OpenBSD: dsa.c,v 1.13 2019/02/09 15:49:21 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -58,7 +58,6 @@ #include /* for OPENSSL_NO_DSA */ -#include #include #include #include @@ -204,20 +203,11 @@ static struct option dsa_options[] = { { NULL }, }; -static void -show_ciphers(const OBJ_NAME *name, void *arg) -{ - static int n; - - if (!islower((unsigned char)*name->name)) - return; - - fprintf(stderr, " -%-24s%s", name->name, (++n % 3 ? "" : "\n")); -} - static void dsa_usage(void) { + int n = 0; + fprintf(stderr, "usage: dsa [-in file] [-inform format] [-noout]\n" " [-out file] [-outform format] [-passin src] [-passout src]\n" @@ -227,7 +217,7 @@ dsa_usage(void) fprintf(stderr, "\n"); fprintf(stderr, "Valid ciphername values:\n\n"); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_ciphers, NULL); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_cipher, &n); fprintf(stderr, "\n"); } @@ -360,12 +350,10 @@ dsa_main(int argc, char **argv) ERR_print_errors(bio_err); } else ret = 0; -end: + end: BIO_free(in); - if (out != NULL) - BIO_free_all(out); - if (dsa != NULL) - DSA_free(dsa); + BIO_free_all(out); + DSA_free(dsa); free(passin); free(passout); diff --git a/apps/openssl/dsaparam.c b/apps/openssl/dsaparam.c index 46efd5d4..8b189cf5 100644 --- a/apps/openssl/dsaparam.c +++ b/apps/openssl/dsaparam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsaparam.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: dsaparam.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -338,12 +338,10 @@ dsaparam_main(int argc, char **argv) } ret = 0; -end: + end: BIO_free(in); - if (out != NULL) - BIO_free_all(out); - if (dsa != NULL) - DSA_free(dsa); + BIO_free_all(out); + DSA_free(dsa); return (ret); } diff --git a/apps/openssl/ec.c b/apps/openssl/ec.c index e557990c..f9056154 100644 --- a/apps/openssl/ec.c +++ b/apps/openssl/ec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: ec.c,v 1.13 2019/02/09 15:49:21 inoguchi Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -60,7 +60,6 @@ #ifndef OPENSSL_NO_EC -#include #include #include #include @@ -239,20 +238,11 @@ static struct option ec_options[] = { { NULL }, }; -static void -show_ciphers(const OBJ_NAME *name, void *arg) -{ - static int n; - - if (!islower((unsigned char)*name->name)) - return; - - fprintf(stderr, " -%-24s%s", name->name, (++n % 3 ? "" : "\n")); -} - static void ec_usage(void) { + int n = 0; + fprintf(stderr, "usage: ec [-conv_form form] [-in file]\n" " [-inform format] [-noout] [-out file] [-outform format]\n" @@ -263,7 +253,7 @@ ec_usage(void) fprintf(stderr, "\n"); fprintf(stderr, "Valid ciphername values:\n\n"); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_ciphers, NULL); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_cipher, &n); fprintf(stderr, "\n"); } @@ -392,12 +382,10 @@ ec_main(int argc, char **argv) ERR_print_errors(bio_err); } else ret = 0; -end: + end: BIO_free(in); - if (out) - BIO_free_all(out); - if (eckey) - EC_KEY_free(eckey); + BIO_free_all(out); + EC_KEY_free(eckey); free(passin); free(passout); diff --git a/apps/openssl/ecparam.c b/apps/openssl/ecparam.c index 6c497bd3..b1e52fad 100644 --- a/apps/openssl/ecparam.c +++ b/apps/openssl/ecparam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecparam.c,v 1.16 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: ecparam.c,v 1.17 2018/02/07 05:47:55 jsing Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -572,7 +572,7 @@ ecparam_main(int argc, char **argv) } ret = 0; -end: + end: BN_free(ec_p); BN_free(ec_a); BN_free(ec_b); diff --git a/apps/openssl/enc.c b/apps/openssl/enc.c index 195dc2fc..4de92bd6 100644 --- a/apps/openssl/enc.c +++ b/apps/openssl/enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: enc.c,v 1.12 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: enc.c,v 1.20 2019/04/01 16:06:54 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -56,7 +56,6 @@ * [including the GNU Public Licence.] */ -#include #include #include #include @@ -89,6 +88,7 @@ static struct { char *hkey; char *hsalt; char *inf; + int iter; char *keyfile; char *keystr; char *md; @@ -97,6 +97,7 @@ static struct { int olb64; char *outf; char *passarg; + int pbkdf2; int printkey; int verbose; } enc_config; @@ -175,6 +176,13 @@ static struct option enc_options[] = { .type = OPTION_ARG, .opt.arg = &enc_config.inf, }, + { + .name = "iter", + .argname = "iterations", + .desc = "Specify iteration count and force use of PBKDF2", + .type = OPTION_ARG_INT, + .opt.value = &enc_config.iter, + }, { .name = "iv", .argname = "IV", @@ -253,6 +261,12 @@ static struct option enc_options[] = { .type = OPTION_ARG, .opt.arg = &enc_config.passarg, }, + { + .name = "pbkdf2", + .desc = "Use the pbkdf2 key derivation function", + .type = OPTION_FLAG, + .opt.flag = &enc_config.pbkdf2, + }, { .name = "S", .argname = "salt", @@ -289,30 +303,22 @@ static struct option enc_options[] = { { NULL }, }; -static void -show_ciphers(const OBJ_NAME *name, void *arg) -{ - static int n; - - if (!islower((unsigned char)*name->name)) - return; - - fprintf(stderr, " -%-24s%s", name->name, (++n % 3 ? "" : "\n")); -} - static void enc_usage(void) { + int n = 0; + fprintf(stderr, "usage: enc -ciphername [-AadePp] [-base64] " "[-bufsize number] [-debug]\n" - " [-in file] [-iv IV] [-K key] [-k password]\n" + " [-in file] [-iter iterations] [-iv IV] [-K key] " + "[-k password]\n" " [-kfile file] [-md digest] [-none] [-nopad] [-nosalt]\n" - " [-out file] [-pass arg] [-S salt] [-salt]\n\n"); + " [-out file] [-pass source] [-pbkdf2] [-S salt] [-salt]\n\n"); options_usage(enc_options); fprintf(stderr, "\n"); fprintf(stderr, "Valid ciphername values:\n\n"); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_ciphers, NULL); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_cipher, &n); fprintf(stderr, "\n"); } @@ -416,7 +422,7 @@ enc_main(int argc, char **argv) goto end; } if (dgst == NULL) { - dgst = EVP_md5(); /* XXX */ + dgst = EVP_sha256(); } if (enc_config.bufsize != NULL) { @@ -604,10 +610,35 @@ enc_main(int argc, char **argv) } sptr = salt; } + if (enc_config.pbkdf2 == 1 || enc_config.iter > 0) { + /* + * derive key and default iv + * concatenated into a temporary buffer + */ + unsigned char tmpkeyiv[EVP_MAX_KEY_LENGTH + EVP_MAX_IV_LENGTH]; + int iklen = EVP_CIPHER_key_length(enc_config.cipher); + int ivlen = EVP_CIPHER_iv_length(enc_config.cipher); + /* not needed if HASH_UPDATE() is fixed : */ + int islen = (sptr != NULL ? sizeof(salt) : 0); + + if (enc_config.iter == 0) + enc_config.iter = 10000; + + if (!PKCS5_PBKDF2_HMAC(enc_config.keystr, + strlen(enc_config.keystr), sptr, islen, + enc_config.iter, dgst, iklen+ivlen, tmpkeyiv)) { + BIO_printf(bio_err, "PKCS5_PBKDF2_HMAC failed\n"); + goto end; + } + /* split and move data back to global buffer */ + memcpy(key, tmpkeyiv, iklen); + memcpy(iv, tmpkeyiv+iklen, ivlen); + } else { + EVP_BytesToKey(enc_config.cipher, dgst, sptr, + (unsigned char *)enc_config.keystr, + strlen(enc_config.keystr), 1, key, iv); + } - EVP_BytesToKey(enc_config.cipher, dgst, sptr, - (unsigned char *)enc_config.keystr, - strlen(enc_config.keystr), 1, key, iv); /* * zero the complete buffer or the string passed from * the command line bug picked up by Larry J. Hughes @@ -717,13 +748,12 @@ enc_main(int argc, char **argv) BIO_printf(bio_err, "bytes read :%8ld\n", BIO_number_read(in)); BIO_printf(bio_err, "bytes written:%8ld\n", BIO_number_written(out)); } -end: + end: ERR_print_errors(bio_err); free(strbuf); free(buff); BIO_free(in); - if (out != NULL) - BIO_free_all(out); + BIO_free_all(out); BIO_free(benc); BIO_free(b64); #ifdef ZLIB diff --git a/apps/openssl/gendh.c b/apps/openssl/gendh.c index 7c037f44..18ff504e 100644 --- a/apps/openssl/gendh.c +++ b/apps/openssl/gendh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gendh.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: gendh.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -186,13 +186,11 @@ gendh_main(int argc, char **argv) if (!PEM_write_bio_DHparams(out, dh)) goto end; ret = 0; -end: + end: if (ret != 0) ERR_print_errors(bio_err); - if (out != NULL) - BIO_free_all(out); - if (dh != NULL) - DH_free(dh); + BIO_free_all(out); + DH_free(dh); return (ret); } diff --git a/apps/openssl/gendsa.c b/apps/openssl/gendsa.c index 5aeb294e..3197e7be 100644 --- a/apps/openssl/gendsa.c +++ b/apps/openssl/gendsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gendsa.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: gendsa.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -143,7 +143,7 @@ gendsa_main(int argc, char **argv) } if (dsaparams == NULL) { -bad: + bad: BIO_printf(bio_err, "usage: gendsa [args] dsaparam-file\n"); BIO_printf(bio_err, " -out file - output the key to 'file'\n"); #ifndef OPENSSL_NO_DES @@ -202,14 +202,12 @@ gendsa_main(int argc, char **argv) if (!PEM_write_bio_DSAPrivateKey(out, dsa, enc, NULL, 0, NULL, passout)) goto end; ret = 0; -end: + end: if (ret != 0) ERR_print_errors(bio_err); BIO_free(in); - if (out != NULL) - BIO_free_all(out); - if (dsa != NULL) - DSA_free(dsa); + BIO_free_all(out); + DSA_free(dsa); free(passout); return (ret); diff --git a/apps/openssl/genpkey.c b/apps/openssl/genpkey.c index cae7eacd..ef16a5e0 100644 --- a/apps/openssl/genpkey.c +++ b/apps/openssl/genpkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: genpkey.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: genpkey.c,v 1.12 2018/02/08 11:17:44 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006 */ @@ -65,27 +65,165 @@ #include #include -static int -init_keygen_file(BIO * err, EVP_PKEY_CTX ** pctx, const char *file); +static int init_keygen_file(BIO * err, EVP_PKEY_CTX **pctx, const char *file); static int genpkey_cb(EVP_PKEY_CTX * ctx); +struct { + const EVP_CIPHER *cipher; + EVP_PKEY_CTX **ctx; + int do_param; + char *outfile; + int outformat; + char *passarg; + int text; +} genpkey_config; + +static int +genpkey_opt_algorithm(char *arg) +{ + if (!init_gen_str(bio_err, genpkey_config.ctx, arg, + genpkey_config.do_param)) + return (1); + + return (0); +} + +static int +genpkey_opt_cipher(int argc, char **argv, int *argsused) +{ + char *name = argv[0]; + + if (*name++ != '-') + return (1); + + if (genpkey_config.do_param == 1) + return (1); + + if (strcmp(name, "none") == 0) { + genpkey_config.cipher = NULL; + *argsused = 1; + return (0); + } + + if ((genpkey_config.cipher = EVP_get_cipherbyname(name)) != NULL) { + *argsused = 1; + return (0); + } + + return (1); +} + +static int +genpkey_opt_paramfile(char *arg) +{ + if (genpkey_config.do_param == 1) + return (1); + if (!init_keygen_file(bio_err, genpkey_config.ctx, arg)) + return (1); + + return (0); +} + +static int +genpkey_opt_pkeyopt(char *arg) +{ + if (*genpkey_config.ctx == NULL) { + BIO_puts(bio_err, "No keytype specified\n"); + return (1); + } + + if (pkey_ctrl_string(*genpkey_config.ctx, arg) <= 0) { + BIO_puts(bio_err, "parameter setting error\n"); + ERR_print_errors(bio_err); + return (1); + } + + return (0); +} + +struct option genpkey_options[] = { + { + .name = "algorithm", + .argname = "name", + .desc = "Public key algorithm to use (must precede -pkeyopt)", + .type = OPTION_ARG_FUNC, + .opt.argfunc = genpkey_opt_algorithm, + }, + { + .name = "genparam", + .desc = "Generate a set of parameters instead of a private key", + .type = OPTION_FLAG, + .opt.flag = &genpkey_config.do_param, + }, + { + .name = "out", + .argname = "file", + .desc = "Output file to write to (default stdout)", + .type = OPTION_ARG, + .opt.arg = &genpkey_config.outfile, + }, + { + .name = "outform", + .argname = "format", + .desc = "Output format (DER or PEM)", + .type = OPTION_ARG_FORMAT, + .opt.value = &genpkey_config.outformat, + }, + { + .name = "paramfile", + .argname = "file", + .desc = "File to load public key algorithm parameters from\n" + "(must precede -pkeyopt)", + .type = OPTION_ARG_FUNC, + .opt.argfunc = genpkey_opt_paramfile, + }, + { + .name = "pass", + .argname = "arg", + .desc = "Output file password source", + .type = OPTION_ARG, + .opt.arg = &genpkey_config.passarg, + }, + { + .name = "pkeyopt", + .argname = "opt:value", + .desc = "Set public key algorithm option to the given value", + .type = OPTION_ARG_FUNC, + .opt.argfunc = genpkey_opt_pkeyopt, + }, + { + .name = "text", + .desc = "Print the private/public key in human readable form", + .type = OPTION_FLAG, + .opt.flag = &genpkey_config.text, + }, + { + .name = NULL, + .type = OPTION_ARGV_FUNC, + .opt.argvfunc = genpkey_opt_cipher, + }, + {NULL}, +}; + +static void +genpkey_usage() +{ + fprintf(stderr, + "usage: genpkey [-algorithm alg] [cipher] [-genparam] [-out file]\n" + " [-outform der | pem] [-paramfile file] [-pass arg]\n" + " [-pkeyopt opt:value] [-text]\n\n"); + options_usage(genpkey_options); +} + int genpkey_main(int argc, char **argv) { - char **args, *outfile = NULL; - char *passarg = NULL; BIO *in = NULL, *out = NULL; - const EVP_CIPHER *cipher = NULL; - int outformat; - int text = 0; - EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *ctx = NULL; + EVP_PKEY *pkey = NULL; char *pass = NULL; - int badarg = 0; int ret = 1, rv; - int do_param = 0; - if (single_execution) { if (pledge("stdio cpath wpath rpath tty", NULL) == -1) { perror("pledge"); @@ -93,98 +231,29 @@ genpkey_main(int argc, char **argv) } } - outformat = FORMAT_PEM; - - args = argv + 1; - while (!badarg && *args && *args[0] == '-') { - if (!strcmp(*args, "-outform")) { - if (args[1]) { - args++; - outformat = str2fmt(*args); - } else - badarg = 1; - } else if (!strcmp(*args, "-pass")) { - if (!args[1]) - goto bad; - passarg = *(++args); - } - else if (!strcmp(*args, "-paramfile")) { - if (!args[1]) - goto bad; - args++; - if (do_param == 1) - goto bad; - if (!init_keygen_file(bio_err, &ctx, *args)) - goto end; - } else if (!strcmp(*args, "-out")) { - if (args[1]) { - args++; - outfile = *args; - } else - badarg = 1; - } else if (strcmp(*args, "-algorithm") == 0) { - if (!args[1]) - goto bad; - if (!init_gen_str(bio_err, &ctx, *(++args), do_param)) - goto end; - } else if (strcmp(*args, "-pkeyopt") == 0) { - if (!args[1]) - goto bad; - if (!ctx) { - BIO_puts(bio_err, "No keytype specified\n"); - goto bad; - } else if (pkey_ctrl_string(ctx, *(++args)) <= 0) { - BIO_puts(bio_err, "parameter setting error\n"); - ERR_print_errors(bio_err); - goto end; - } - } else if (strcmp(*args, "-genparam") == 0) { - if (ctx) - goto bad; - do_param = 1; - } else if (strcmp(*args, "-text") == 0) - text = 1; - else { - cipher = EVP_get_cipherbyname(*args + 1); - if (!cipher) { - BIO_printf(bio_err, "Unknown cipher %s\n", - *args + 1); - badarg = 1; - } - if (do_param == 1) - badarg = 1; - } - args++; + memset(&genpkey_config, 0, sizeof(genpkey_config)); + genpkey_config.ctx = &ctx; + genpkey_config.outformat = FORMAT_PEM; + + if (options_parse(argc, argv, genpkey_options, NULL, NULL) != 0) { + genpkey_usage(); + goto end; } - if (!ctx) - badarg = 1; - - if (badarg) { -bad: - BIO_printf(bio_err, "Usage: genpkey [options]\n"); - BIO_printf(bio_err, "where options may be\n"); - BIO_printf(bio_err, "-out file output file\n"); - BIO_printf(bio_err, "-outform X output format (DER or PEM)\n"); - BIO_printf(bio_err, "-pass arg output file pass phrase source\n"); - BIO_printf(bio_err, "- use cipher to encrypt the key\n"); - BIO_printf(bio_err, "-paramfile file parameters file\n"); - BIO_printf(bio_err, "-algorithm alg the public key algorithm\n"); - BIO_printf(bio_err, "-pkeyopt opt:value set the public key algorithm option \n" - " to value \n"); - BIO_printf(bio_err, "-genparam generate parameters, not key\n"); - BIO_printf(bio_err, "-text print the in text\n"); - BIO_printf(bio_err, "NB: options order may be important! See the manual page.\n"); + if (ctx == NULL) { + genpkey_usage(); goto end; } - if (!app_passwd(bio_err, passarg, NULL, &pass, NULL)) { + + if (!app_passwd(bio_err, genpkey_config.passarg, NULL, &pass, NULL)) { BIO_puts(bio_err, "Error getting password\n"); goto end; } - if (outfile) { - if (!(out = BIO_new_file(outfile, "wb"))) { - BIO_printf(bio_err, - "Can't open output file %s\n", outfile); + if (genpkey_config.outfile != NULL) { + if ((out = BIO_new_file(genpkey_config.outfile, "wb")) == + NULL) { + BIO_printf(bio_err, "Can't open output file %s\n", + genpkey_config.outfile); goto end; } } else { @@ -194,7 +263,7 @@ genpkey_main(int argc, char **argv) EVP_PKEY_CTX_set_cb(ctx, genpkey_cb); EVP_PKEY_CTX_set_app_data(ctx, bio_err); - if (do_param) { + if (genpkey_config.do_param) { if (EVP_PKEY_paramgen(ctx, &pkey) <= 0) { BIO_puts(bio_err, "Error generating parameters\n"); ERR_print_errors(bio_err); @@ -208,12 +277,12 @@ genpkey_main(int argc, char **argv) } } - if (do_param) + if (genpkey_config.do_param) rv = PEM_write_bio_Parameters(out, pkey); - else if (outformat == FORMAT_PEM) - rv = PEM_write_bio_PrivateKey(out, pkey, cipher, NULL, 0, - NULL, pass); - else if (outformat == FORMAT_ASN1) + else if (genpkey_config.outformat == FORMAT_PEM) + rv = PEM_write_bio_PrivateKey(out, pkey, genpkey_config.cipher, + NULL, 0, NULL, pass); + else if (genpkey_config.outformat == FORMAT_ASN1) rv = i2d_PrivateKey_bio(out, pkey); else { BIO_printf(bio_err, "Bad format specified for key\n"); @@ -224,8 +293,8 @@ genpkey_main(int argc, char **argv) BIO_puts(bio_err, "Error writing key\n"); ERR_print_errors(bio_err); } - if (text) { - if (do_param) + if (genpkey_config.text) { + if (genpkey_config.do_param) rv = EVP_PKEY_print_params(out, pkey, 0, NULL); else rv = EVP_PKEY_print_private(out, pkey, 0, NULL); @@ -237,13 +306,10 @@ genpkey_main(int argc, char **argv) } ret = 0; -end: - if (pkey) - EVP_PKEY_free(pkey); - if (ctx) - EVP_PKEY_CTX_free(ctx); - if (out) - BIO_free_all(out); + end: + EVP_PKEY_free(pkey); + EVP_PKEY_CTX_free(ctx); + BIO_free_all(out); BIO_free(in); free(pass); @@ -251,8 +317,7 @@ genpkey_main(int argc, char **argv) } static int -init_keygen_file(BIO * err, EVP_PKEY_CTX ** pctx, - const char *file) +init_keygen_file(BIO * err, EVP_PKEY_CTX ** pctx, const char *file) { BIO *pbio; EVP_PKEY *pkey = NULL; @@ -282,23 +347,20 @@ init_keygen_file(BIO * err, EVP_PKEY_CTX ** pctx, *pctx = ctx; return 1; -err: + err: BIO_puts(err, "Error initializing context\n"); ERR_print_errors(err); - if (ctx) - EVP_PKEY_CTX_free(ctx); - if (pkey) - EVP_PKEY_free(pkey); + EVP_PKEY_CTX_free(ctx); + EVP_PKEY_free(pkey); return 0; } int -init_gen_str(BIO * err, EVP_PKEY_CTX ** pctx, - const char *algname, int do_param) +init_gen_str(BIO * err, EVP_PKEY_CTX ** pctx, const char *algname, int do_param) { - EVP_PKEY_CTX *ctx = NULL; const EVP_PKEY_ASN1_METHOD *ameth; + EVP_PKEY_CTX *ctx = NULL; int pkey_id; if (*pctx) { @@ -329,11 +391,10 @@ init_gen_str(BIO * err, EVP_PKEY_CTX ** pctx, *pctx = ctx; return 1; -err: + err: BIO_printf(err, "Error initializing %s context\n", algname); ERR_print_errors(err); - if (ctx) - EVP_PKEY_CTX_free(ctx); + EVP_PKEY_CTX_free(ctx); return 0; } diff --git a/apps/openssl/genrsa.c b/apps/openssl/genrsa.c index 4fa5747b..3b643ab5 100644 --- a/apps/openssl/genrsa.c +++ b/apps/openssl/genrsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: genrsa.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: genrsa.c,v 1.12 2018/12/09 19:30:34 tobias Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -165,10 +165,12 @@ genrsa_main(int argc, char **argv) argc--; } if ((argc >= 1) && ((sscanf(*argv, "%d", &num) == 0) || (num < 0))) { -bad: + bad: BIO_printf(bio_err, "usage: genrsa [args] [numbits]\n"); +#ifndef OPENSSL_NO_DES BIO_printf(bio_err, " -des encrypt the generated key with DES in cbc mode\n"); BIO_printf(bio_err, " -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)\n"); +#endif #ifndef OPENSSL_NO_IDEA BIO_printf(bio_err, " -idea encrypt the generated key with IDEA in cbc mode\n"); #endif @@ -233,14 +235,12 @@ genrsa_main(int argc, char **argv) } ret = 0; -err: - if (bn) - BN_free(bn); - if (rsa) - RSA_free(rsa); - if (out) - BIO_free_all(out); + err: + BN_free(bn); + RSA_free(rsa); + BIO_free_all(out); free(passout); + if (ret != 0) ERR_print_errors(bio_err); diff --git a/apps/openssl/nseq.c b/apps/openssl/nseq.c index 46691474..d50bace1 100644 --- a/apps/openssl/nseq.c +++ b/apps/openssl/nseq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nseq.c,v 1.7 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: nseq.c,v 1.8 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -167,7 +167,7 @@ nseq_main(int argc, char **argv) PEM_write_bio_X509(out, x509); } ret = 0; -end: + end: BIO_free(in); BIO_free_all(out); NETSCAPE_CERT_SEQUENCE_free(seq); diff --git a/apps/openssl/ocsp.c b/apps/openssl/ocsp.c index 64eeef8e..04a719bf 100644 --- a/apps/openssl/ocsp.c +++ b/apps/openssl/ocsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp.c,v 1.12 2017/01/21 09:29:09 deraadt Exp $ */ +/* $OpenBSD: ocsp.c,v 1.15 2018/02/07 05:49:36 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -106,7 +106,7 @@ int ocsp_main(int argc, char **argv) { char **args; - char *host = NULL, *port = NULL, *path = "/"; + char *host = NULL, *port = NULL, *path = NULL; char *reqin = NULL, *respin = NULL; char *reqout = NULL, *respout = NULL; char *signfile = NULL, *keyfile = NULL; @@ -177,7 +177,8 @@ ocsp_main(int argc, char **argv) } else badarg = 1; } else if (!strcmp(*args, "-url")) { - if (args[1]) { + if (args[1] && host == NULL && port == NULL && + path == NULL) { args++; if (!OCSP_parse_url(*args, &host, &port, &path, &use_ssl)) { BIO_printf(bio_err, "Error parsing URL\n"); @@ -186,13 +187,13 @@ ocsp_main(int argc, char **argv) } else badarg = 1; } else if (!strcmp(*args, "-host")) { - if (args[1]) { + if (args[1] && use_ssl == -1) { args++; host = *args; } else badarg = 1; } else if (!strcmp(*args, "-port")) { - if (args[1]) { + if (args[1] && use_ssl == -1) { args++; port = *args; } else @@ -331,7 +332,7 @@ ocsp_main(int argc, char **argv) } else badarg = 1; } else if (!strcmp(*args, "-path")) { - if (args[1]) { + if (args[1] && use_ssl == -1) { args++; path = *args; } else @@ -629,7 +630,7 @@ ocsp_main(int argc, char **argv) if (cbio) send_ocsp_response(cbio, resp); } else if (host) { - resp = process_responder(bio_err, req, host, path, + resp = process_responder(bio_err, req, host, path ? path : "/", port, use_ssl, headers, req_timeout); if (!resp) goto end; @@ -731,7 +732,7 @@ ocsp_main(int argc, char **argv) ret = 0; -end: + end: ERR_print_errors(bio_err); X509_free(signer); X509_STORE_free(store); @@ -782,7 +783,7 @@ add_ocsp_cert(OCSP_REQUEST ** req, X509 * cert, const EVP_MD * cert_id_md, X509 goto err; return 1; -err: + err: BIO_printf(bio_err, "Error Creating OCSP request\n"); return 0; } @@ -818,7 +819,7 @@ add_ocsp_serial(OCSP_REQUEST ** req, char *serial, const EVP_MD * cert_id_md, X5 goto err; return 1; -err: + err: BIO_printf(bio_err, "Error Creating OCSP request\n"); return 0; } @@ -925,8 +926,7 @@ make_ocsp_response(OCSP_RESPONSE ** resp, OCSP_REQUEST * req, CA_DB * db, NULL); goto end; } - if (ca_id) - OCSP_CERTID_free(ca_id); + OCSP_CERTID_free(ca_id); ca_id = OCSP_cert_to_id(cert_id_md, NULL, ca); /* Is this request about our CA? */ @@ -976,7 +976,7 @@ make_ocsp_response(OCSP_RESPONSE ** resp, OCSP_REQUEST * req, CA_DB * db, *resp = OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs); -end: + end: ASN1_TIME_free(thisupd); ASN1_TIME_free(nextupd); OCSP_CERTID_free(ca_id); @@ -1029,7 +1029,7 @@ init_responder(char *port) } return acbio; -err: + err: BIO_free_all(acbio); BIO_free(bufbio); return NULL; @@ -1172,9 +1172,8 @@ query_responder(BIO * err, BIO * cbio, char *path, break; } } -err: - if (ctx) - OCSP_REQ_CTX_free(ctx); + err: + OCSP_REQ_CTX_free(ctx); return rsp; } @@ -1209,11 +1208,9 @@ process_responder(BIO * err, OCSP_REQUEST * req, resp = query_responder(err, cbio, path, headers, req, req_timeout); if (!resp) BIO_printf(bio_err, "Error querying OCSP responder\n"); -end: - if (cbio) - BIO_free_all(cbio); - if (ctx) - SSL_CTX_free(ctx); + end: + BIO_free_all(cbio); + SSL_CTX_free(ctx); return resp; } diff --git a/apps/openssl/openssl.1 b/apps/openssl/openssl.1 index 58f88d02..d00d5a8e 100644 --- a/apps/openssl/openssl.1 +++ b/apps/openssl/openssl.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: openssl.1,v 1.86 2017/08/28 17:50:58 jsing Exp $ +.\" $OpenBSD: openssl.1,v 1.100 2019/02/04 11:21:05 tb Exp $ .\" ==================================================================== .\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. .\" @@ -110,9 +110,7 @@ .\" copied and put under another distribution licence .\" [including the GNU Public Licence.] .\" -.\" OPENSSL -.\" -.Dd $Mdocdate: August 28 2017 $ +.Dd $Mdocdate: February 4 2019 $ .Dt OPENSSL 1 .Os .Sh NAME @@ -120,7 +118,7 @@ .Nd OpenSSL command line tool .Sh SYNOPSIS .Nm -.Cm command +.Ar command .Op Ar command_opts .Op Ar command_args .Pp @@ -302,6 +300,7 @@ into a nested structure. .Op Fl batch .Op Fl cert Ar file .Op Fl config Ar file +.Op Fl create_serial .Op Fl crl_CA_compromise Ar time .Op Fl crl_compromise Ar time .Op Fl crl_hold Ar instruction @@ -316,11 +315,12 @@ into a nested structure. .Op Fl gencrl .Op Fl in Ar file .Op Fl infiles -.Op Fl key Ar keyfile +.Op Fl key Ar password .Op Fl keyfile Ar arg -.Op Fl keyform Ar pem +.Op Fl keyform Cm pem | der .Op Fl md Ar arg .Op Fl msie_hack +.Op Fl multivalue\-rdn .Op Fl name Ar section .Op Fl noemailDN .Op Fl notext @@ -330,12 +330,14 @@ into a nested structure. .Op Fl policy Ar arg .Op Fl preserveDN .Op Fl revoke Ar file +.Op Fl selfsign .Op Fl spkac Ar file .Op Fl ss_cert Ar file .Op Fl startdate Ar date .Op Fl status Ar serial .Op Fl subj Ar arg .Op Fl updatedb +.Op Fl utf8 .Op Fl verbose .nr nS 0 .Pp @@ -356,12 +358,16 @@ and all certificates will be certified automatically. The CA certificate file. .It Fl config Ar file Specify an alternative configuration file. +.It Fl create_serial +If reading the serial from the text file as specified in the +configuration fails, create a new random serial to be used as the +next serial number. .It Fl days Ar arg The number of days to certify the certificate for. .It Fl enddate Ar date Set the expiry date. -The format of the date is YYMMDDHHMMSSZ -.Pq the same as an ASN.1 UTCTime structure . +The format of the date is [YY]YYMMDDHHMMSSZ, +with all four year digits required for dates from 2050 onwards. .It Fl extensions Ar section The section of the configuration file containing certificate extensions to be added when a certificate is issued (defaults to @@ -373,6 +379,9 @@ If no extension section is present, a V1 certificate is created. If the extension section is present .Pq even if it is empty , then a V3 certificate is created. +See the +.Xr x509v3.cnf 5 +manual page for details of the extension section format. .It Fl extfile Ar file An additional configuration .Ar file @@ -387,14 +396,18 @@ containing a single certificate request to be signed by the CA. .It Fl infiles If present, this should be the last option; all subsequent arguments are assumed to be the names of files containing certificate requests. -.It Fl key Ar keyfile -The password used to encrypt the private key. +.It Fl key Ar password +The +.Fa password +used to encrypt the private key. Since on some systems the command line arguments are visible, this option should be used with caution. .It Fl keyfile Ar file The private key to sign requests with. -.It Fl keyform Ar pem +.It Fl keyform Cm pem | der Private key file format. +The default is +.Cm pem . .It Fl md Ar alg The message digest to use. Possible values include @@ -413,6 +426,16 @@ its use is strongly discouraged. The newer control .Qq Xenroll does not need this option. +.It Fl multivalue\-rdn +This option causes the +.Fl subj +argument to be interpreted with full support for multivalued RDNs, +for example +.Qq "/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe" . +If +.Fl multivalue\-rdn +is not used, the UID value is set to +.Qq "123456+CN=John Doe" . .It Fl name Ar section Specifies the configuration file .Ar section @@ -437,7 +460,10 @@ Don't output the text form of a certificate to the output file. .It Fl out Ar file The output file to output certificates to. The default is standard output. -The certificate details will also be printed out to this file. +The certificate details will also be printed out to this file in +PEM format, except that +.Fl spkac +outputs DER format. .It Fl outdir Ar directory The .Ar directory @@ -474,6 +500,27 @@ This is largely for compatibility with the older IE enrollment control which would only accept certificates if their DNs matched the order of the request. This is not needed for Xenroll. +.It Fl selfsign +Indicates the issued certificates are to be signed with the key the +certificate requests were signed with, given with +.Fl keyfile . +Certificate requests signed with a different key are ignored. +If +.Fl gencrl , +.Fl spkac , +or +.Fl ss_cert +are given, +.Fl selfsign +is ignored. +.Pp +A consequence of using +.Fl selfsign +is that the self-signed certificate appears among the entries in +the certificate database (see the configuration option +.Cm database ) +and uses the same serial number counter as all other certificates +signed with the self-signed certificate. .It Fl spkac Ar file A file containing a single Netscape signed public key and challenge, and additional field values to be signed by the CA. @@ -492,13 +539,25 @@ then it can be preceded by a number and a A single self-signed certificate to be signed by the CA. .It Fl startdate Ar date Set the start date. -The format of the date is YYMMDDHHMMSSZ -.Pq the same as an ASN.1 UTCTime structure . -.It Fl status Ar serial -Show the status of the certificate with serial number -.Ar serial . -.It Fl updatedb -Update database for expired certificates. +The format of the date is [YY]YYMMDDHHMMSSZ, +with all four year digits required for dates from 2050 onwards. +.It Fl subj Ar arg +Supersedes the subject name given in the request. +The +.Ar arg +must be formatted as +.Sm off +.Pf / Ar type0 Ns = Ar value0 Ns / Ar type 1 Ns = Ar value 1 Ns / +.Ar type2 Ns = Ar ... ; +.Sm on +characters may be escaped by +.Sq \e +.Pq backslash , +no spaces are skipped. +.It Fl utf8 +Interpret field values read from a terminal or obtained from a +configuration file as UTF-8 strings. +By default, they are interpreted as ASCII. .It Fl verbose Print extra details about the operations being performed. .El @@ -549,6 +608,9 @@ if the CRL extension section is present then a V2 CRL is created. The CRL extensions specified are CRL extensions and not CRL entry extensions. It should be noted that some software can't handle V2 CRLs. +See the +.Xr x509v3.cnf 5 +manual page for details of the extension section format. .It Fl crlhours Ar num The number of hours before the next CRL is due. .It Fl gencrl @@ -557,16 +619,11 @@ Generate a CRL based on information in the index file. A .Ar file containing a certificate to revoke. -.It Fl subj Ar arg -Supersedes the subject name given in the request. -The -.Ar arg -must be formatted as -.Ar /type0=value0/type1=value1/type2=... ; -characters may be escaped by -.Sq \e -.Pq backslash , -no spaces are skipped. +.It Fl status Ar serial +Show the status of the certificate with serial number +.Ar serial . +.It Fl updatedb +Update the database index to purge expired certificates. .El .Pp Many of the options can be set in the @@ -625,7 +682,7 @@ extension with CA:TRUE and the value is set to .Cm copyall and the user does not spot -this when the certificate is displayed, then this will hand the requestor +this when the certificate is displayed, then this will hand the requester a valid CA certificate. .Pp This situation can be avoided by setting @@ -780,170 +837,34 @@ The same as .Sh CIPHERS .Nm openssl ciphers .Op Fl hVv -.Op Fl tls1 -.Op Ar cipherlist +.Op Ar control .Pp The .Nm ciphers -command converts -.Nm openssl -cipher lists into ordered SSL cipher preference lists. -It can be used as a way to determine the appropriate cipher list. +command converts the +.Ar control +string from the format documented in +.Xr SSL_CTX_set_cipher_list 3 +into an ordered SSL cipher suite preference list. +If no +.Ar control +string is specified, the +.Cm DEFAULT +list is printed. .Pp The options are as follows: .Bl -tag -width Ds .It Fl h , \&? Print a brief usage message. -.It Fl tls1 -Only include TLS v1 ciphers. .It Fl V Verbose. -List ciphers with a complete description of protocol version, -key exchange, authentication, encryption and mac algorithms, -any key size restrictions, -and cipher suite codes (hex format). +List ciphers with cipher suite code in hex format, +cipher name, and a complete description of protocol version, +key exchange, authentication, encryption, and mac algorithms. .It Fl v Like .Fl V , but without cipher suite codes. -.It Ar cipherlist -A cipher list to convert to a cipher preference list. -If it is not included, the default cipher list will be used. -.Pp -The cipher list consists of one or more cipher strings -separated by colons. -Commas or spaces are also acceptable separators, but colons are normally used. -.Pp -The actual cipher string can take several different forms: -.Pp -It can consist of a single cipher suite, such as RC4-SHA. -.Pp -It can represent a list of cipher suites containing a certain algorithm, -or cipher suites of a certain type. -For example SHA1 represents all cipher suites using the digest algorithm SHA1. -.Pp -Lists of cipher suites can be combined in a single cipher string using the -.Sq + -character -(logical AND operation). -For example, SHA1+DES represents all cipher suites -containing the SHA1 and DES algorithms. -.Pp -Each cipher string can be optionally preceded by the characters -.Sq \&! , -.Sq - , -or -.Sq + . -If -.Sq !\& -is used, then the ciphers are permanently deleted from the list. -The ciphers deleted can never reappear in the list even if they are -explicitly stated. -If -.Sq - -is used, then the ciphers are deleted from the list, but some or -all of the ciphers can be added again by later options. -If -.Sq + -is used, then the ciphers are moved to the end of the list. -This option doesn't add any new ciphers, it just moves matching existing ones. -.Pp -If none of these characters is present, the string is just interpreted -as a list of ciphers to be appended to the current preference list. -If the list includes any ciphers already present, they will be ignored; -that is, they will not be moved to the end of the list. -.Pp -Additionally, the cipher string -.Cm @STRENGTH -can be used at any point to sort the current cipher list in order of -encryption algorithm key length. -.El -.Pp -The following is a list of all permitted cipher strings and their meanings. -.Bl -tag -width "XXXX" -.It Cm DEFAULT -The default cipher list. -This is determined at compile time and is currently -.Cm ALL:!aNULL:!eNULL:!SSLv2 . -This must be the first cipher string specified. -.It Cm COMPLEMENTOFDEFAULT -The ciphers included in -.Cm ALL , -but not enabled by default. -Currently this is -.Cm ADH . -Note that this rule does not cover -.Cm eNULL , -which is not included by -.Cm ALL -(use -.Cm COMPLEMENTOFALL -if necessary). -.It Cm ALL -All cipher suites except the -.Cm eNULL -ciphers, which must be explicitly enabled. -.It Cm COMPLEMENTOFALL -The cipher suites not enabled by -.Cm ALL , -currently being -.Cm eNULL . -.It Cm HIGH -.Qq High -encryption cipher suites. -This currently means those with key lengths larger than 128 bits. -.It Cm MEDIUM -.Qq Medium -encryption cipher suites, currently those using 128-bit encryption. -.It Cm LOW -.Qq Low -encryption cipher suites, currently those using 64- or 56-bit encryption -algorithms. -.It Cm eNULL , NULL -The -.Qq NULL -ciphers; that is, those offering no encryption. -Because these offer no encryption at all and are a security risk, -they are disabled unless explicitly included. -.It Cm aNULL -The cipher suites offering no authentication. -This is currently the anonymous DH algorithms. -These cipher suites are vulnerable to a -.Qq man in the middle -attack, so their use is normally discouraged. -.It Cm kRSA , RSA -Cipher suites using RSA key exchange. -.It Cm kEDH -Cipher suites using ephemeral DH key agreement. -.It Cm aRSA -Cipher suites using RSA authentication, i.e. the certificates carry RSA keys. -.It Cm aDSS , DSS -Cipher suites using DSS authentication, i.e. the certificates carry DSS keys. -.It Cm TLSv1 -TLS v1.0 cipher suites. -.It Cm DH -Cipher suites using DH, including anonymous DH. -.It Cm ADH -Anonymous DH cipher suites. -.It Cm AES -Cipher suites using AES. -.It Cm 3DES -Cipher suites using triple DES. -.It Cm DES -Cipher suites using DES -.Pq not triple DES . -.It Cm RC4 -Cipher suites using RC4. -.It Cm CAMELLIA -Cipher suites using Camellia. -.It Cm CHACHA20 -Cipher suites using ChaCha20. -.It Cm IDEA -Cipher suites using IDEA. -.It Cm MD5 -Cipher suites using MD5. -.It Cm SHA1 , SHA -Cipher suites using SHA1. .El .Sh CRL .nr nS 1 @@ -1089,16 +1010,16 @@ Print BIO debugging information. .It Fl Ar digest Use the specified message .Ar digest . -The default is MD5. +The default is SHA256. The available digests can be displayed using .Nm openssl .Cm list-message-digest-commands . The following are equivalent: .Nm openssl dgst -.Fl md5 +.Fl sha256 and .Nm openssl -.Cm md5 . +.Cm sha256 . .It Fl hex Digest is to be output as a hex dump. This is the default case for a @@ -1403,9 +1324,9 @@ The options are as follows: Specify how the points on the elliptic curve are converted into octet strings. Possible values are: -.Cm compressed +.Cm compressed , +.Cm uncompressed (the default), -.Cm uncompressed , and .Cm hybrid . For more information regarding @@ -1511,9 +1432,9 @@ Validate the elliptic curve parameters. Specify how the points on the elliptic curve are converted into octet strings. Possible values are: -.Cm compressed +.Cm compressed , +.Cm uncompressed (the default), -.Cm uncompressed , and .Cm hybrid . For more information regarding @@ -1573,6 +1494,7 @@ Print the EC parameters in plain text. .Op Fl bufsize Ar number .Op Fl debug .Op Fl in Ar file +.Op Fl iter Ar iterations .Op Fl iv Ar IV .Op Fl K Ar key .Op Fl k Ar password @@ -1583,6 +1505,7 @@ Print the EC parameters in plain text. .Op Fl nosalt .Op Fl out Ar file .Op Fl pass Ar arg +.Op Fl pbkdf2 .Op Fl S Ar salt .Op Fl salt .nr nS 0 @@ -1628,6 +1551,10 @@ This is the default. .It Fl in Ar file The input file to read from, or standard input if not specified. +.It Fl iter Ar iterations +Use the pbkdf2 key derivation function, with +.Ar iterations +as the number of iterations. .It Fl iv Ar IV The actual .Ar IV @@ -1705,6 +1632,9 @@ don't do any encryption or decryption. Print out the salt, key, and IV used. .It Fl pass Ar arg The password source. +.It Fl pbkdf2 +Use the pbkdf2 key derivation function, with +the default of 10000 iterations. .It Fl S Ar salt The actual .Ar salt @@ -2405,13 +2335,10 @@ Print certificate details in full rather than just subject and issuer names. .Sh PKCS8 .nr nS 1 .Nm "openssl pkcs8" -.Op Fl embed .Op Fl in Ar file .Op Fl inform Cm der | pem .Op Fl nocrypt .Op Fl noiter -.Op Fl nooct -.Op Fl nsdb .Op Fl out Ar file .Op Fl outform Cm der | pem .Op Fl passin Ar arg @@ -2433,13 +2360,6 @@ are more secure. .Pp The options are as follows: .Bl -tag -width Ds -.It Fl embed -Generate DSA keys in a broken format. -The DSA parameters are embedded inside the PrivateKey structure. -In this form the OCTET STRING contains an ASN.1 SEQUENCE consisting of -two structures: -a SEQUENCE containing the parameters and an ASN.1 INTEGER containing -the private key. .It Fl in Ar file The input file to read from, or standard input if not specified. @@ -2455,16 +2375,6 @@ Use an iteration count of 1. See the .Sx PKCS12 section below for a detailed explanation of this option. -.It Fl nooct -Generate RSA private keys in a broken format that some software uses. -Specifically the private key should be enclosed in an OCTET STRING, -but some software just includes the structure itself without the -surrounding OCTET STRING. -.It Fl nsdb -Generate DSA keys in a broken format compatible with Netscape -private key databases. -The PrivateKey contains a SEQUENCE -consisting of the public and private keys, respectively. .It Fl out Ar file The output file to write to, or standard output if none is specified. @@ -3162,7 +3072,7 @@ Do not encrypt the private key. Do not output the encoded version of the request. .It Fl out Ar file The output file to write to, -or standard output if not spceified. +or standard output if not specified. .It Fl outform Cm der | pem The output format. .It Fl passin Ar arg @@ -3404,7 +3314,7 @@ These are compiled into .Nm openssl and include the usual values such as .Cm commonName , countryName , localityName , organizationName , -.Cm organizationUnitName , stateOrProvinceName . +.Cm organizationalUnitName , stateOrProvinceName . Additionally, .Cm emailAddress is included as well as @@ -3508,9 +3418,11 @@ Print the public/private key components in plain text. .Op Fl in Ar file .Op Fl inkey Ar file .Op Fl keyform Cm der | pem -.Op Fl oaep | pkcs | raw +.Op Fl oaep | pkcs | raw | x931 .Op Fl out Ar file +.Op Fl passin Ar arg .Op Fl pubin +.Op Fl rev .Op Fl sign .Op Fl verify .nr nS 0 @@ -3543,9 +3455,10 @@ The input key file; by default an RSA private key. The private key format. The default is .Cm pem . -.It Fl oaep | pkcs | raw +.It Fl oaep | pkcs | raw | x931 The padding to use: -PKCS#1 OAEP, PKCS#1 v1.5 (the default), or no padding, respectively. +PKCS#1 OAEP, PKCS#1 v1.5 (the default), no padding, or ANSI X9.31, +respectively. For signatures, only .Fl pkcs and @@ -3554,8 +3467,12 @@ can be used. .It Fl out Ar file The output file to write to, or standard output if not specified. +.It Fl passin Ar arg +The key password source. .It Fl pubin The input file is an RSA public key. +.It Fl rev +Reverse the order of the input buffer. .It Fl sign Sign the input data and output the signed result. This requires an RSA private key. @@ -3578,6 +3495,7 @@ Verify the input data and output the recovered data. .Op Fl crlf .Op Fl debug .Op Fl extended_crl +.Op Fl groups .Op Fl ign_eof .Op Fl ignore_critical .Op Fl issuer_checks @@ -3691,6 +3609,8 @@ Translate a line feed from the terminal into CR+LF, as required by some servers. .It Fl debug Print extensive debugging information, including a hex dump of all traffic. +.It Fl groups Ar ecgroups +Specify a colon-separated list of permitted EC curve groups. .It Fl ign_eof Inhibit shutting down the connection when end of file is reached in the input. .It Fl key Ar keyfile @@ -6051,6 +5971,8 @@ certificates. .Sh SEE ALSO .Xr acme-client 1 , .Xr nc 1 , +.Xr openssl.cnf 5 , +.Xr x509v3.cnf 5 , .Xr ssl 8 , .Xr starttls 8 .Sh STANDARDS diff --git a/apps/openssl/openssl.c b/apps/openssl/openssl.c index 36c69ff9..73e5117d 100644 --- a/apps/openssl/openssl.c +++ b/apps/openssl/openssl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openssl.c,v 1.25 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: openssl.c,v 1.29 2019/03/17 17:46:00 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -241,6 +241,10 @@ FUNCTION functions[] = { #ifndef OPENSSL_NO_SHA512 { FUNC_TYPE_MD, "sha512", dgst_main }, #endif +#ifndef OPENSSL_NO_SM3 + { FUNC_TYPE_MD, "sm3", dgst_main }, + { FUNC_TYPE_MD, "sm3WithRSAEncryption", dgst_main }, +#endif #ifndef OPENSSL_NO_WHIRLPOOL { FUNC_TYPE_MD, "whirlpool", dgst_main }, #endif @@ -318,6 +322,13 @@ FUNCTION functions[] = { { FUNC_TYPE_CIPHER, "rc4", enc_main }, { FUNC_TYPE_CIPHER, "rc4-40", enc_main }, #endif +#ifndef OPENSSL_NO_SM4 + { FUNC_TYPE_CIPHER, "sm4", enc_main }, + { FUNC_TYPE_CIPHER, "sm4-ecb", enc_main }, + { FUNC_TYPE_CIPHER, "sm4-cbc", enc_main }, + { FUNC_TYPE_CIPHER, "sm4-ofb", enc_main }, + { FUNC_TYPE_CIPHER, "sm4-cfb", enc_main }, +#endif #ifdef ZLIB { FUNC_TYPE_CIPHER, "zlib", enc_main }, #endif @@ -343,56 +354,6 @@ char *default_config_file = NULL; CONF *config = NULL; BIO *bio_err = NULL; -static void -lock_dbg_cb(int mode, int type, const char *file, int line) -{ - static int modes[CRYPTO_NUM_LOCKS]; /* = {0, 0, ... } */ - const char *errstr = NULL; - int rw; - - rw = mode & (CRYPTO_READ | CRYPTO_WRITE); - if (!((rw == CRYPTO_READ) || (rw == CRYPTO_WRITE))) { - errstr = "invalid mode"; - goto err; - } - if (type < 0 || type >= CRYPTO_NUM_LOCKS) { - errstr = "type out of bounds"; - goto err; - } - if (mode & CRYPTO_LOCK) { - if (modes[type]) { - errstr = "already locked"; - /* - * must not happen in a single-threaded program - * (would deadlock) - */ - goto err; - } - modes[type] = rw; - } else if (mode & CRYPTO_UNLOCK) { - if (!modes[type]) { - errstr = "not locked"; - goto err; - } - if (modes[type] != rw) { - errstr = (rw == CRYPTO_READ) ? - "CRYPTO_r_unlock on write lock" : - "CRYPTO_w_unlock on read lock"; - } - modes[type] = 0; - } else { - errstr = "invalid mode"; - goto err; - } - -err: - if (errstr) { - /* we cannot use bio_err here */ - fprintf(stderr, "openssl (lock_dbg_cb): %s (mode=%d, type=%d) at %s:%d\n", - errstr, mode, type, file, line); - } -} - static void openssl_startup(void) { @@ -453,8 +414,6 @@ main(int argc, char **argv) exit(1); } - CRYPTO_set_locking_callback(lock_dbg_cb); - openssl_startup(); /* Lets load up our environment a little */ @@ -562,7 +521,7 @@ main(int argc, char **argv) BIO_printf(bio_err, "bad exit\n"); ret = 1; -end: + end: free(to_free); if (config != NULL) { @@ -709,7 +668,7 @@ do_cmd(LHASH_OF(FUNCTION) * prog, int argc, char *argv[]) BIO_printf(bio_err, "\n\n"); ret = 0; } -end: + end: return (ret); } diff --git a/apps/openssl/passwd.c b/apps/openssl/passwd.c index af536044..428f75a7 100644 --- a/apps/openssl/passwd.c +++ b/apps/openssl/passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: passwd.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: passwd.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ #if defined OPENSSL_NO_MD5 #define NO_MD5CRYPT_1 @@ -273,7 +273,7 @@ passwd_main(int argc, char **argv) } ret = 0; -err: + err: ERR_print_errors(bio_err); free(salt_malloc); @@ -477,7 +477,7 @@ do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p, BIO_printf(out, "%s\n", hash); return 1; -err: + err: return 0; } #else diff --git a/apps/openssl/pkcs12.c b/apps/openssl/pkcs12.c index 69d2d0a9..2e852ceb 100644 --- a/apps/openssl/pkcs12.c +++ b/apps/openssl/pkcs12.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs12.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkcs12.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -584,7 +584,7 @@ pkcs12_main(int argc, char **argv) goto end; } ret = 0; -end: + end: if (p12) PKCS12_free(p12); BIO_free(in); @@ -637,7 +637,7 @@ dump_certs_keys_p12(BIO * out, PKCS12 * p12, char *pass, } ret = 1; -err: + err: if (asafes) sk_PKCS7_pop_free(asafes, PKCS7_free); @@ -768,7 +768,7 @@ get_cert_chain(X509 * cert, X509_STORE * store, STACK_OF(X509) ** chain) goto err; } else chn = X509_STORE_CTX_get1_chain(&store_ctx); -err: + err: X509_STORE_CTX_cleanup(&store_ctx); *chain = chn; diff --git a/apps/openssl/pkcs7.c b/apps/openssl/pkcs7.c index 32d1682f..f1edc9e4 100644 --- a/apps/openssl/pkcs7.c +++ b/apps/openssl/pkcs7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs7.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkcs7.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -277,7 +277,7 @@ pkcs7_main(int argc, char **argv) } } ret = 0; -end: + end: if (p7 != NULL) PKCS7_free(p7); if (in != NULL) diff --git a/apps/openssl/pkcs8.c b/apps/openssl/pkcs8.c index 5d1c2023..7938bf8b 100644 --- a/apps/openssl/pkcs8.c +++ b/apps/openssl/pkcs8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs8.c,v 1.10 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkcs8.c,v 1.13 2018/08/24 22:56:45 jmc Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999-2004. */ @@ -75,7 +75,6 @@ static struct { int nocrypt; char *outfile; int outformat; - int p8_broken; char *passargin; char *passargout; int pbe_nid; @@ -105,13 +104,6 @@ pkcs8_opt_v2(char *arg) } static struct option pkcs8_options[] = { - { - .name = "embed", - .desc = "Generate DSA keys in a broken format", - .type = OPTION_VALUE, - .value = PKCS8_EMBEDDED_PARAM, - .opt.value = &pkcs8_config.p8_broken, - }, { .name = "in", .argname = "file", @@ -121,8 +113,8 @@ static struct option pkcs8_options[] = { }, { .name = "inform", - .argname = "format", - .desc = "Input format (DER or PEM (default))", + .argname = "der | pem", + .desc = "Input format (default PEM)", .type = OPTION_ARG_FORMAT, .opt.value = &pkcs8_config.informat, }, @@ -139,20 +131,6 @@ static struct option pkcs8_options[] = { .value = 1, .opt.value = &pkcs8_config.iter, }, - { - .name = "nooct", - .desc = "Generate RSA keys in a broken format (no octet)", - .type = OPTION_VALUE, - .value = PKCS8_NO_OCTET, - .opt.value = &pkcs8_config.p8_broken, - }, - { - .name = "nsdb", - .desc = "Generate DSA keys in the broken Netscape DB format", - .type = OPTION_VALUE, - .value = PKCS8_NS_DB, - .opt.value = &pkcs8_config.p8_broken, - }, { .name = "out", .argname = "file", @@ -162,8 +140,8 @@ static struct option pkcs8_options[] = { }, { .name = "outform", - .argname = "format", - .desc = "Output format (DER or PEM (default))", + .argname = "der | pem", + .desc = "Output format (default PEM)", .type = OPTION_ARG_FORMAT, .opt.value = &pkcs8_config.outformat, }, @@ -208,11 +186,10 @@ static struct option pkcs8_options[] = { static void pkcs8_usage() { - fprintf(stderr, "usage: pkcs8 [-embed] [-in file] " - "[-inform fmt] [-nocrypt]\n" - " [-noiter] [-nooct] [-nsdb] [-out file] [-outform fmt] " - "[-passin src]\n" - " [-passout src] [-topk8] [-v1 alg] [-v2 alg]\n\n"); + fprintf(stderr, "usage: pkcs8 [-in file] [inform der | pem] " + "[-nocrypt] [-noiter]\n" + " [-out file] [-outform der | pem] [-passin arg]\n" + " [-passout arg] [-topk8] [-v1 alg] [-v2 alg]\n\n"); options_usage(pkcs8_options); } @@ -238,7 +215,6 @@ pkcs8_main(int argc, char **argv) pkcs8_config.iter = PKCS12_DEFAULT_ITER; pkcs8_config.informat = FORMAT_PEM; pkcs8_config.outformat = FORMAT_PEM; - pkcs8_config.p8_broken = PKCS8_OK; pkcs8_config.pbe_nid = -1; if (options_parse(argc, argv, pkcs8_options, NULL, NULL) != 0) { @@ -278,8 +254,7 @@ pkcs8_main(int argc, char **argv) pkcs8_config.informat, 1, passin, "key"); if (!pkey) goto end; - if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, - pkcs8_config.p8_broken))) { + if (!(p8inf = EVP_PKEY2PKCS8(pkey))) { BIO_printf(bio_err, "Error converting key\n"); ERR_print_errors(bio_err); goto end; @@ -369,32 +344,6 @@ pkcs8_main(int argc, char **argv) ERR_print_errors(bio_err); goto end; } - if (p8inf->broken) { - BIO_printf(bio_err, "Warning: broken key encoding: "); - switch (p8inf->broken) { - case PKCS8_NO_OCTET: - BIO_printf(bio_err, "No Octet String in PrivateKey\n"); - break; - - case PKCS8_EMBEDDED_PARAM: - BIO_printf(bio_err, - "DSA parameters included in PrivateKey\n"); - break; - - case PKCS8_NS_DB: - BIO_printf(bio_err, - "DSA public key include in PrivateKey\n"); - break; - - case PKCS8_NEG_PRIVKEY: - BIO_printf(bio_err, "DSA private key value is negative\n"); - break; - - default: - BIO_printf(bio_err, "Unknown broken type\n"); - break; - } - } if (pkcs8_config.outformat == FORMAT_PEM) PEM_write_bio_PrivateKey(out, pkey, NULL, NULL, 0, NULL, passout); @@ -406,7 +355,7 @@ pkcs8_main(int argc, char **argv) } ret = 0; -end: + end: X509_SIG_free(p8); PKCS8_PRIV_KEY_INFO_free(p8inf); EVP_PKEY_free(pkey); diff --git a/apps/openssl/pkey.c b/apps/openssl/pkey.c index e91bc790..fa88e550 100644 --- a/apps/openssl/pkey.c +++ b/apps/openssl/pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkey.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkey.c,v 1.14 2019/02/09 15:49:21 inoguchi Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006 */ @@ -65,18 +65,146 @@ #include #include +static struct { + const EVP_CIPHER *cipher; + char *infile; + int informat; + int noout; + char *outfile; + int outformat; + char *passargin; + char *passargout; + int pubin; + int pubout; + int pubtext; + int text; +} pkey_config; + +static int +pkey_opt_cipher(int argc, char **argv, int *argsused) +{ + char *name = argv[0]; + + if (*name++ != '-') + return (1); + + if ((pkey_config.cipher = EVP_get_cipherbyname(name)) == NULL) { + BIO_printf(bio_err, "Unknown cipher %s\n", name); + return (1); + } + + *argsused = 1; + return (0); +} + +static struct option pkey_options[] = { + { + .name = "in", + .argname = "file", + .desc = "Input file (default stdin)", + .type = OPTION_ARG, + .opt.arg = &pkey_config.infile, + }, + { + .name = "inform", + .argname = "format", + .desc = "Input format (DER or PEM (default))", + .type = OPTION_ARG_FORMAT, + .opt.value = &pkey_config.informat, + }, + { + .name = "noout", + .desc = "Do not print encoded version of the key", + .type = OPTION_FLAG, + .opt.flag = &pkey_config.noout, + }, + { + .name = "out", + .argname = "file", + .desc = "Output file (default stdout)", + .type = OPTION_ARG, + .opt.arg = &pkey_config.outfile, + }, + { + .name = "outform", + .argname = "format", + .desc = "Output format (DER or PEM (default))", + .type = OPTION_ARG_FORMAT, + .opt.value = &pkey_config.outformat, + }, + { + .name = "passin", + .argname = "src", + .desc = "Input file passphrase source", + .type = OPTION_ARG, + .opt.arg = &pkey_config.passargin, + }, + { + .name = "passout", + .argname = "src", + .desc = "Output file passphrase source", + .type = OPTION_ARG, + .opt.arg = &pkey_config.passargout, + }, + { + .name = "pubin", + .desc = "Expect a public key (default private key)", + .type = OPTION_VALUE, + .value = 1, + .opt.value = &pkey_config.pubin, + }, + { + .name = "pubout", + .desc = "Output a public key (default private key)", + .type = OPTION_VALUE, + .value = 1, + .opt.value = &pkey_config.pubout, + }, + { + .name = "text", + .desc = "Print the public/private key in plain text", + .type = OPTION_FLAG, + .opt.flag = &pkey_config.text, + }, + { + .name = "text_pub", + .desc = "Print out only public key in plain text", + .type = OPTION_FLAG, + .opt.flag = &pkey_config.pubtext, + }, + { + .name = NULL, + .type = OPTION_ARGV_FUNC, + .opt.argvfunc = pkey_opt_cipher, + }, + { NULL } +}; + +static void +pkey_usage() +{ + int n = 0; + + fprintf(stderr, + "usage: pkey [-ciphername] [-in file] [-inform fmt] [-noout] " + "[-out file]\n" + " [-outform fmt] [-passin src] [-passout src] [-pubin] " + "[-pubout] [-text]\n" + " [-text_pub]\n\n"); + options_usage(pkey_options); + fprintf(stderr, "\n"); + + fprintf(stderr, "Valid ciphername values:\n\n"); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_cipher, &n); + fprintf(stderr, "\n"); +} + int pkey_main(int argc, char **argv) { - char **args, *infile = NULL, *outfile = NULL; - char *passargin = NULL, *passargout = NULL; BIO *in = NULL, *out = NULL; - const EVP_CIPHER *cipher = NULL; - int informat, outformat; - int pubin = 0, pubout = 0, pubtext = 0, text = 0, noout = 0; EVP_PKEY *pkey = NULL; char *passin = NULL, *passout = NULL; - int badarg = 0; int ret = 1; if (single_execution) { @@ -86,112 +214,53 @@ pkey_main(int argc, char **argv) } } - informat = FORMAT_PEM; - outformat = FORMAT_PEM; - - args = argv + 1; - while (!badarg && *args && *args[0] == '-') { - if (!strcmp(*args, "-inform")) { - if (args[1]) { - args++; - informat = str2fmt(*args); - } else - badarg = 1; - } else if (!strcmp(*args, "-outform")) { - if (args[1]) { - args++; - outformat = str2fmt(*args); - } else - badarg = 1; - } else if (!strcmp(*args, "-passin")) { - if (!args[1]) - goto bad; - passargin = *(++args); - } else if (!strcmp(*args, "-passout")) { - if (!args[1]) - goto bad; - passargout = *(++args); - } - else if (!strcmp(*args, "-in")) { - if (args[1]) { - args++; - infile = *args; - } else - badarg = 1; - } else if (!strcmp(*args, "-out")) { - if (args[1]) { - args++; - outfile = *args; - } else - badarg = 1; - } else if (strcmp(*args, "-pubin") == 0) { - pubin = 1; - pubout = 1; - pubtext = 1; - } else if (strcmp(*args, "-pubout") == 0) - pubout = 1; - else if (strcmp(*args, "-text_pub") == 0) { - pubtext = 1; - text = 1; - } else if (strcmp(*args, "-text") == 0) - text = 1; - else if (strcmp(*args, "-noout") == 0) - noout = 1; - else { - cipher = EVP_get_cipherbyname(*args + 1); - if (!cipher) { - BIO_printf(bio_err, "Unknown cipher %s\n", - *args + 1); - badarg = 1; - } - } - args++; - } + memset(&pkey_config, 0, sizeof(pkey_config)); + pkey_config.informat = FORMAT_PEM; + pkey_config.outformat = FORMAT_PEM; - if (badarg) { -bad: - BIO_printf(bio_err, "Usage pkey [options]\n"); - BIO_printf(bio_err, "where options are\n"); - BIO_printf(bio_err, "-in file input file\n"); - BIO_printf(bio_err, "-inform X input format (DER or PEM)\n"); - BIO_printf(bio_err, "-passin arg input file pass phrase source\n"); - BIO_printf(bio_err, "-outform X output format (DER or PEM)\n"); - BIO_printf(bio_err, "-out file output file\n"); - BIO_printf(bio_err, "-passout arg output file pass phrase source\n"); - return 1; + if (options_parse(argc, argv, pkey_options, NULL, NULL) != 0) { + pkey_usage(); + goto end; } - if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) { + if (pkey_config.pubtext) + pkey_config.text = 1; + if (pkey_config.pubin) + pkey_config.pubout = pkey_config.pubtext = 1; + + if (!app_passwd(bio_err, pkey_config.passargin, pkey_config.passargout, + &passin, &passout)) { BIO_printf(bio_err, "Error getting passwords\n"); goto end; } - if (outfile) { - if (!(out = BIO_new_file(outfile, "wb"))) { + if (pkey_config.outfile) { + if (!(out = BIO_new_file(pkey_config.outfile, "wb"))) { BIO_printf(bio_err, - "Can't open output file %s\n", outfile); + "Can't open output file %s\n", pkey_config.outfile); goto end; } } else { out = BIO_new_fp(stdout, BIO_NOCLOSE); } - if (pubin) - pkey = load_pubkey(bio_err, infile, informat, 1, - passin, "Public Key"); + if (pkey_config.pubin) + pkey = load_pubkey(bio_err, pkey_config.infile, + pkey_config.informat, 1, passin, "Public Key"); else - pkey = load_key(bio_err, infile, informat, 1, passin, "key"); + pkey = load_key(bio_err, pkey_config.infile, + pkey_config.informat, 1, passin, "key"); if (!pkey) goto end; - if (!noout) { - if (outformat == FORMAT_PEM) { - if (pubout) + if (!pkey_config.noout) { + if (pkey_config.outformat == FORMAT_PEM) { + if (pkey_config.pubout) PEM_write_bio_PUBKEY(out, pkey); else - PEM_write_bio_PrivateKey(out, pkey, cipher, - NULL, 0, NULL, passout); - } else if (outformat == FORMAT_ASN1) { - if (pubout) + PEM_write_bio_PrivateKey(out, pkey, + pkey_config.cipher, NULL, 0, NULL, passout); + } else if (pkey_config.outformat == FORMAT_ASN1) { + if (pkey_config.pubout) i2d_PUBKEY_bio(out, pkey); else i2d_PrivateKey_bio(out, pkey); @@ -201,15 +270,15 @@ pkey_main(int argc, char **argv) } } - if (text) { - if (pubtext) + if (pkey_config.text) { + if (pkey_config.pubtext) EVP_PKEY_print_public(out, pkey, 0, NULL); else EVP_PKEY_print_private(out, pkey, 0, NULL); } ret = 0; -end: + end: EVP_PKEY_free(pkey); BIO_free_all(out); BIO_free(in); diff --git a/apps/openssl/pkeyparam.c b/apps/openssl/pkeyparam.c index 698c1051..51ea2b55 100644 --- a/apps/openssl/pkeyparam.c +++ b/apps/openssl/pkeyparam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkeyparam.c,v 1.10 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkeyparam.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006 */ @@ -165,7 +165,7 @@ pkeyparam_main(int argc, char **argv) ret = 0; -end: + end: EVP_PKEY_free(pkey); BIO_free_all(out); BIO_free(in); diff --git a/apps/openssl/pkeyutl.c b/apps/openssl/pkeyutl.c index 4752b4c7..b0800181 100644 --- a/apps/openssl/pkeyutl.c +++ b/apps/openssl/pkeyutl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkeyutl.c,v 1.11 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: pkeyutl.c,v 1.15 2019/02/17 15:01:08 inoguchi Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -68,34 +68,197 @@ #define KEY_PUBKEY 2 #define KEY_CERT 3 -static void usage(void); +struct { + int asn1parse; + EVP_PKEY_CTX *ctx; + int hexdump; + char *infile; + int key_type; + int keyform; + int keysize; + char *outfile; + char *passargin; + int peerform; + int pkey_op; + int rev; + char *sigfile; +} pkeyutl_config; -static EVP_PKEY_CTX *init_ctx(int *pkeysize, - char *keyfile, int keyform, int key_type, - char *passargin, int pkey_op); +static void pkeyutl_usage(void); -static int setup_peer(BIO * err, EVP_PKEY_CTX * ctx, int peerform, - const char *file); +static int init_ctx(char *keyfile); + +static int setup_peer(char *file); + +static int pkeyutl_pkeyopt(char *pkeyopt); static int do_keyop(EVP_PKEY_CTX * ctx, int pkey_op, unsigned char *out, size_t * poutlen, unsigned char *in, size_t inlen); +struct option pkeyutl_options[] = { + { + .name = "asn1parse", + .desc = "ASN.1 parse the output data", + .type = OPTION_FLAG, + .opt.flag = &pkeyutl_config.asn1parse, + }, + { + .name = "certin", + .desc = "Input is a certificate containing a public key", + .type = OPTION_VALUE, + .value = KEY_CERT, + .opt.value = &pkeyutl_config.key_type, + }, + { + .name = "decrypt", + .desc = "Decrypt the input data using a private key", + .type = OPTION_VALUE, + .value = EVP_PKEY_OP_DECRYPT, + .opt.value = &pkeyutl_config.pkey_op, + }, + { + .name = "derive", + .desc = "Derive a shared secret using the peer key", + .type = OPTION_VALUE, + .value = EVP_PKEY_OP_DERIVE, + .opt.value = &pkeyutl_config.pkey_op, + }, + { + .name = "encrypt", + .desc = "Encrypt the input data using a public key", + .type = OPTION_VALUE, + .value = EVP_PKEY_OP_ENCRYPT, + .opt.value = &pkeyutl_config.pkey_op, + }, + { + .name = "hexdump", + .desc = "Hex dump the output data", + .type = OPTION_FLAG, + .opt.flag = &pkeyutl_config.hexdump, + }, + { + .name = "in", + .argname = "file", + .desc = "Input file (default stdin)", + .type = OPTION_ARG, + .opt.arg = &pkeyutl_config.infile, + }, + { + .name = "inkey", + .argname = "file", + .desc = "Input key file", + .type = OPTION_ARG_FUNC, + .opt.argfunc = init_ctx, + }, + { + .name = "keyform", + .argname = "fmt", + .desc = "Input key format (DER or PEM (default))", + .type = OPTION_ARG_FORMAT, + .opt.value = &pkeyutl_config.keyform, + }, + { + .name = "out", + .argname = "file", + .desc = "Output file (default stdout)", + .type = OPTION_ARG, + .opt.arg = &pkeyutl_config.outfile, + }, + { + .name = "passin", + .argname = "arg", + .desc = "Key password source", + .type = OPTION_ARG, + .opt.arg = &pkeyutl_config.passargin, + }, + { + .name = "peerform", + .argname = "fmt", + .desc = "Input key format (DER or PEM (default))", + .type = OPTION_ARG_FORMAT, + .opt.value = &pkeyutl_config.peerform, + }, + { + .name = "peerkey", + .argname = "file", + .desc = "Peer key file", + .type = OPTION_ARG_FUNC, + .opt.argfunc = setup_peer, + }, + { + .name = "pkeyopt", + .argname = "opt:value", + .desc = "Public key options", + .type = OPTION_ARG_FUNC, + .opt.argfunc = pkeyutl_pkeyopt, + }, + { + .name = "pubin", + .desc = "Input is a public key", + .type = OPTION_VALUE, + .value = KEY_PUBKEY, + .opt.value = &pkeyutl_config.key_type, + }, + { + .name = "rev", + .desc = "Reverse the input data", + .type = OPTION_FLAG, + .opt.flag = &pkeyutl_config.rev, + }, + { + .name = "sigfile", + .argname = "file", + .desc = "Signature file (verify operation only)", + .type = OPTION_ARG, + .opt.arg = &pkeyutl_config.sigfile, + }, + { + .name = "sign", + .desc = "Sign the input data using private key", + .type = OPTION_VALUE, + .value = EVP_PKEY_OP_SIGN, + .opt.value = &pkeyutl_config.pkey_op, + }, + { + .name = "verify", + .desc = "Verify the input data using public key", + .type = OPTION_VALUE, + .value = EVP_PKEY_OP_VERIFY, + .opt.value = &pkeyutl_config.pkey_op, + }, + { + .name = "verifyrecover", + .desc = "Verify with public key, recover original data", + .type = OPTION_VALUE, + .value = EVP_PKEY_OP_VERIFYRECOVER, + .opt.value = &pkeyutl_config.pkey_op, + }, + + {NULL}, +}; + +static void +pkeyutl_usage() +{ + fprintf(stderr, + "usage: pkeyutl [-asn1parse] [-certin] [-decrypt] [-derive] " + "[-encrypt]\n" + " [-hexdump] [-in file] [-inkey file] [-keyform fmt]\n" + " [-out file] [-passin arg] [-peerform fmt]\n" + " [-peerkey file] [-pkeyopt opt:value] [-pubin] [-rev]\n" + " [-sigfile file] [-sign] [-verify] [-verifyrecover]\n\n"); + options_usage(pkeyutl_options); + fprintf(stderr, "\n"); +} + int pkeyutl_main(int argc, char **argv) { BIO *in = NULL, *out = NULL; - char *infile = NULL, *outfile = NULL, *sigfile = NULL; - int pkey_op = EVP_PKEY_OP_SIGN, key_type = KEY_PRIVKEY; - int keyform = FORMAT_PEM, peerform = FORMAT_PEM; - char badarg = 0, rev = 0; - char hexdump = 0, asn1parse = 0; - EVP_PKEY_CTX *ctx = NULL; - char *passargin = NULL; - int keysize = -1; unsigned char *buf_in = NULL, *buf_out = NULL, *sig = NULL; - size_t buf_outlen; + size_t buf_outlen = 0; int buf_inlen = 0, siglen = -1; int ret = 1, rv = -1; @@ -107,120 +270,36 @@ pkeyutl_main(int argc, char **argv) } } - argc--; - argv++; + memset(&pkeyutl_config, 0, sizeof(pkeyutl_config)); + pkeyutl_config.pkey_op = EVP_PKEY_OP_SIGN; + pkeyutl_config.key_type = KEY_PRIVKEY; + pkeyutl_config.keyform = FORMAT_PEM; + pkeyutl_config.peerform = FORMAT_PEM; + pkeyutl_config.keysize = -1; - while (argc >= 1) { - if (!strcmp(*argv, "-in")) { - if (--argc < 1) - badarg = 1; - else - infile = *(++argv); - } else if (!strcmp(*argv, "-out")) { - if (--argc < 1) - badarg = 1; - else - outfile = *(++argv); - } else if (!strcmp(*argv, "-sigfile")) { - if (--argc < 1) - badarg = 1; - else - sigfile = *(++argv); - } else if (!strcmp(*argv, "-inkey")) { - if (--argc < 1) - badarg = 1; - else { - ctx = init_ctx(&keysize, - *(++argv), keyform, key_type, - passargin, pkey_op); - if (!ctx) { - BIO_puts(bio_err, - "Error initializing context\n"); - ERR_print_errors(bio_err); - badarg = 1; - } - } - } else if (!strcmp(*argv, "-peerkey")) { - if (--argc < 1) - badarg = 1; - else if (!setup_peer(bio_err, ctx, peerform, *(++argv))) - badarg = 1; - } else if (!strcmp(*argv, "-passin")) { - if (--argc < 1) - badarg = 1; - else - passargin = *(++argv); - } else if (strcmp(*argv, "-peerform") == 0) { - if (--argc < 1) - badarg = 1; - else - peerform = str2fmt(*(++argv)); - } else if (strcmp(*argv, "-keyform") == 0) { - if (--argc < 1) - badarg = 1; - else - keyform = str2fmt(*(++argv)); - } - else if (!strcmp(*argv, "-pubin")) - key_type = KEY_PUBKEY; - else if (!strcmp(*argv, "-certin")) - key_type = KEY_CERT; - else if (!strcmp(*argv, "-asn1parse")) - asn1parse = 1; - else if (!strcmp(*argv, "-hexdump")) - hexdump = 1; - else if (!strcmp(*argv, "-sign")) - pkey_op = EVP_PKEY_OP_SIGN; - else if (!strcmp(*argv, "-verify")) - pkey_op = EVP_PKEY_OP_VERIFY; - else if (!strcmp(*argv, "-verifyrecover")) - pkey_op = EVP_PKEY_OP_VERIFYRECOVER; - else if (!strcmp(*argv, "-rev")) - rev = 1; - else if (!strcmp(*argv, "-encrypt")) - pkey_op = EVP_PKEY_OP_ENCRYPT; - else if (!strcmp(*argv, "-decrypt")) - pkey_op = EVP_PKEY_OP_DECRYPT; - else if (!strcmp(*argv, "-derive")) - pkey_op = EVP_PKEY_OP_DERIVE; - else if (strcmp(*argv, "-pkeyopt") == 0) { - if (--argc < 1) - badarg = 1; - else if (!ctx) { - BIO_puts(bio_err, - "-pkeyopt command before -inkey\n"); - badarg = 1; - } else if (pkey_ctrl_string(ctx, *(++argv)) <= 0) { - BIO_puts(bio_err, "parameter setting error\n"); - ERR_print_errors(bio_err); - goto end; - } - } else - badarg = 1; - if (badarg) { - usage(); - goto end; - } - argc--; - argv++; + if (options_parse(argc, argv, pkeyutl_options, NULL, NULL) != 0) { + pkeyutl_usage(); + goto end; } - if (!ctx) { - usage(); + if (!pkeyutl_config.ctx) { + pkeyutl_usage(); goto end; } - if (sigfile && (pkey_op != EVP_PKEY_OP_VERIFY)) { + if (pkeyutl_config.sigfile && + (pkeyutl_config.pkey_op != EVP_PKEY_OP_VERIFY)) { BIO_puts(bio_err, "Signature file specified for non verify\n"); goto end; } - if (!sigfile && (pkey_op == EVP_PKEY_OP_VERIFY)) { + if (!pkeyutl_config.sigfile && + (pkeyutl_config.pkey_op == EVP_PKEY_OP_VERIFY)) { BIO_puts(bio_err, "No signature file specified for verify\n"); goto end; } - if (pkey_op != EVP_PKEY_OP_DERIVE) { - if (infile) { - if (!(in = BIO_new_file(infile, "rb"))) { + if (pkeyutl_config.pkey_op != EVP_PKEY_OP_DERIVE) { + if (pkeyutl_config.infile) { + if (!(in = BIO_new_file(pkeyutl_config.infile, "rb"))) { BIO_puts(bio_err, "Error Opening Input File\n"); ERR_print_errors(bio_err); @@ -229,8 +308,8 @@ pkeyutl_main(int argc, char **argv) } else in = BIO_new_fp(stdin, BIO_NOCLOSE); } - if (outfile) { - if (!(out = BIO_new_file(outfile, "wb"))) { + if (pkeyutl_config.outfile) { + if (!(out = BIO_new_file(pkeyutl_config.outfile, "wb"))) { BIO_printf(bio_err, "Error Creating Output File\n"); ERR_print_errors(bio_err); goto end; @@ -239,14 +318,14 @@ pkeyutl_main(int argc, char **argv) out = BIO_new_fp(stdout, BIO_NOCLOSE); } - if (sigfile) { - BIO *sigbio = BIO_new_file(sigfile, "rb"); + if (pkeyutl_config.sigfile) { + BIO *sigbio = BIO_new_file(pkeyutl_config.sigfile, "rb"); if (!sigbio) { BIO_printf(bio_err, "Can't open signature file %s\n", - sigfile); + pkeyutl_config.sigfile); goto end; } - siglen = bio_to_mem(&sig, keysize * 10, sigbio); + siglen = bio_to_mem(&sig, pkeyutl_config.keysize * 10, sigbio); BIO_free(sigbio); if (siglen <= 0) { BIO_printf(bio_err, "Error reading signature data\n"); @@ -255,12 +334,12 @@ pkeyutl_main(int argc, char **argv) } if (in) { /* Read the input data */ - buf_inlen = bio_to_mem(&buf_in, keysize * 10, in); + buf_inlen = bio_to_mem(&buf_in, pkeyutl_config.keysize * 10, in); if (buf_inlen <= 0) { BIO_printf(bio_err, "Error reading input Data\n"); exit(1); } - if (rev) { + if (pkeyutl_config.rev) { size_t i; unsigned char ctmp; size_t l = (size_t) buf_inlen; @@ -271,8 +350,8 @@ pkeyutl_main(int argc, char **argv) } } } - if (pkey_op == EVP_PKEY_OP_VERIFY) { - rv = EVP_PKEY_verify(ctx, sig, (size_t) siglen, + if (pkeyutl_config.pkey_op == EVP_PKEY_OP_VERIFY) { + rv = EVP_PKEY_verify(pkeyutl_config.ctx, sig, (size_t) siglen, buf_in, (size_t) buf_inlen); if (rv == 1) { BIO_puts(out, "Signature Verified Successfully\n"); @@ -282,14 +361,15 @@ pkeyutl_main(int argc, char **argv) if (rv >= 0) goto end; } else { - rv = do_keyop(ctx, pkey_op, NULL, (size_t *)&buf_outlen, - buf_in, (size_t) buf_inlen); + rv = do_keyop(pkeyutl_config.ctx, pkeyutl_config.pkey_op, NULL, + (size_t *)&buf_outlen, buf_in, (size_t) buf_inlen); if (rv > 0) { buf_out = malloc(buf_outlen); if (!buf_out) rv = -1; else - rv = do_keyop(ctx, pkey_op, + rv = do_keyop(pkeyutl_config.ctx, + pkeyutl_config.pkey_op, buf_out, (size_t *) & buf_outlen, buf_in, (size_t) buf_inlen); } @@ -301,17 +381,16 @@ pkeyutl_main(int argc, char **argv) goto end; } ret = 0; - if (asn1parse) { + if (pkeyutl_config.asn1parse) { if (!ASN1_parse_dump(out, buf_out, buf_outlen, 1, -1)) ERR_print_errors(bio_err); - } else if (hexdump) + } else if (pkeyutl_config.hexdump) BIO_dump(out, (char *) buf_out, buf_outlen); else BIO_write(out, buf_out, buf_outlen); -end: - if (ctx) - EVP_PKEY_CTX_free(ctx); + end: + EVP_PKEY_CTX_free(pkeyutl_config.ctx); BIO_free(in); BIO_free_all(out); free(buf_in); @@ -321,145 +400,145 @@ pkeyutl_main(int argc, char **argv) return ret; } -static void -usage() -{ - BIO_printf(bio_err, "Usage: pkeyutl [options]\n"); - BIO_printf(bio_err, "-in file input file\n"); - BIO_printf(bio_err, "-out file output file\n"); - BIO_printf(bio_err, "-sigfile file signature file (verify operation only)\n"); - BIO_printf(bio_err, "-inkey file input key\n"); - BIO_printf(bio_err, "-keyform arg private key format - default PEM\n"); - BIO_printf(bio_err, "-pubin input is a public key\n"); - BIO_printf(bio_err, "-certin input is a certificate carrying a public key\n"); - BIO_printf(bio_err, "-pkeyopt X:Y public key options\n"); - BIO_printf(bio_err, "-sign sign with private key\n"); - BIO_printf(bio_err, "-verify verify with public key\n"); - BIO_printf(bio_err, "-verifyrecover verify with public key, recover original data\n"); - BIO_printf(bio_err, "-encrypt encrypt with public key\n"); - BIO_printf(bio_err, "-decrypt decrypt with private key\n"); - BIO_printf(bio_err, "-derive derive shared secret\n"); - BIO_printf(bio_err, "-hexdump hex dump output\n"); - BIO_printf(bio_err, "-passin arg pass phrase source\n"); - -} - -static EVP_PKEY_CTX * -init_ctx(int *pkeysize, - char *keyfile, int keyform, int key_type, - char *passargin, int pkey_op) +static int +init_ctx(char *keyfile) { EVP_PKEY *pkey = NULL; - EVP_PKEY_CTX *ctx = NULL; char *passin = NULL; int rv = -1; X509 *x; - if (((pkey_op == EVP_PKEY_OP_SIGN) || (pkey_op == EVP_PKEY_OP_DECRYPT) - || (pkey_op == EVP_PKEY_OP_DERIVE)) - && (key_type != KEY_PRIVKEY)) { - BIO_printf(bio_err, "A private key is needed for this operation\n"); + + if (((pkeyutl_config.pkey_op == EVP_PKEY_OP_SIGN) + || (pkeyutl_config.pkey_op == EVP_PKEY_OP_DECRYPT) + || (pkeyutl_config.pkey_op == EVP_PKEY_OP_DERIVE)) + && (pkeyutl_config.key_type != KEY_PRIVKEY)) { + BIO_printf(bio_err, + "A private key is needed for this operation\n"); goto end; } - if (!app_passwd(bio_err, passargin, NULL, &passin, NULL)) { + if (!app_passwd(bio_err, pkeyutl_config.passargin, NULL, &passin, + NULL)) { BIO_printf(bio_err, "Error getting password\n"); goto end; } - switch (key_type) { + switch (pkeyutl_config.key_type) { case KEY_PRIVKEY: - pkey = load_key(bio_err, keyfile, keyform, 0, + pkey = load_key(bio_err, keyfile, pkeyutl_config.keyform, 0, passin, "Private Key"); break; case KEY_PUBKEY: - pkey = load_pubkey(bio_err, keyfile, keyform, 0, + pkey = load_pubkey(bio_err, keyfile, pkeyutl_config.keyform, 0, NULL, "Public Key"); break; case KEY_CERT: - x = load_cert(bio_err, keyfile, keyform, + x = load_cert(bio_err, keyfile, pkeyutl_config.keyform, NULL, "Certificate"); if (x) { pkey = X509_get_pubkey(x); X509_free(x); } break; - } - *pkeysize = EVP_PKEY_size(pkey); + pkeyutl_config.keysize = EVP_PKEY_size(pkey); if (!pkey) goto end; - ctx = EVP_PKEY_CTX_new(pkey, NULL); + pkeyutl_config.ctx = EVP_PKEY_CTX_new(pkey, NULL); EVP_PKEY_free(pkey); - if (!ctx) + if (!pkeyutl_config.ctx) goto end; - switch (pkey_op) { + switch (pkeyutl_config.pkey_op) { case EVP_PKEY_OP_SIGN: - rv = EVP_PKEY_sign_init(ctx); + rv = EVP_PKEY_sign_init(pkeyutl_config.ctx); break; case EVP_PKEY_OP_VERIFY: - rv = EVP_PKEY_verify_init(ctx); + rv = EVP_PKEY_verify_init(pkeyutl_config.ctx); break; case EVP_PKEY_OP_VERIFYRECOVER: - rv = EVP_PKEY_verify_recover_init(ctx); + rv = EVP_PKEY_verify_recover_init(pkeyutl_config.ctx); break; case EVP_PKEY_OP_ENCRYPT: - rv = EVP_PKEY_encrypt_init(ctx); + rv = EVP_PKEY_encrypt_init(pkeyutl_config.ctx); break; case EVP_PKEY_OP_DECRYPT: - rv = EVP_PKEY_decrypt_init(ctx); + rv = EVP_PKEY_decrypt_init(pkeyutl_config.ctx); break; case EVP_PKEY_OP_DERIVE: - rv = EVP_PKEY_derive_init(ctx); + rv = EVP_PKEY_derive_init(pkeyutl_config.ctx); break; } if (rv <= 0) { - EVP_PKEY_CTX_free(ctx); - ctx = NULL; + EVP_PKEY_CTX_free(pkeyutl_config.ctx); + pkeyutl_config.ctx = NULL; } -end: + end: free(passin); - return ctx; - + if (!pkeyutl_config.ctx) { + BIO_puts(bio_err, "Error initializing context\n"); + ERR_print_errors(bio_err); + return (1); + } + return (0); } static int -setup_peer(BIO * err, EVP_PKEY_CTX * ctx, int peerform, - const char *file) +setup_peer(char *file) { EVP_PKEY *peer = NULL; int ret; - if (!ctx) { - BIO_puts(err, "-peerkey command before -inkey\n"); - return 0; + + if (!pkeyutl_config.ctx) { + BIO_puts(bio_err, "-peerkey command before -inkey\n"); + return (1); } - peer = load_pubkey(bio_err, file, peerform, 0, NULL, "Peer Key"); + peer = load_pubkey(bio_err, file, pkeyutl_config.peerform, 0, NULL, + "Peer Key"); if (!peer) { BIO_printf(bio_err, "Error reading peer key %s\n", file); - ERR_print_errors(err); - return 0; + ERR_print_errors(bio_err); + return (1); } - ret = EVP_PKEY_derive_set_peer(ctx, peer); + ret = EVP_PKEY_derive_set_peer(pkeyutl_config.ctx, peer); EVP_PKEY_free(peer); - if (ret <= 0) - ERR_print_errors(err); - return ret; + if (ret <= 0) { + ERR_print_errors(bio_err); + return (1); + } + + return (0); +} + +static int +pkeyutl_pkeyopt(char *pkeyopt) +{ + if (!pkeyutl_config.ctx) { + BIO_puts(bio_err, "-pkeyopt command before -inkey\n"); + return (1); + } else if (pkey_ctrl_string(pkeyutl_config.ctx, pkeyopt) <= 0) { + BIO_puts(bio_err, "parameter setting error\n"); + ERR_print_errors(bio_err); + return (1); + } + + return (0); } static int diff --git a/apps/openssl/prime.c b/apps/openssl/prime.c index c9bf33bf..5e1ad70c 100644 --- a/apps/openssl/prime.c +++ b/apps/openssl/prime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prime.c,v 1.10 2015/10/17 15:00:11 doug Exp $ */ +/* $OpenBSD: prime.c,v 1.12 2019/01/20 01:59:06 tb Exp $ */ /* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved. * @@ -116,7 +116,7 @@ prime_main(int argc, char **argv) char *prime = NULL; BIO *bio_out; char *s; - int ret = 1; + int is_prime, ret = 1; if (single_execution) { if (pledge("stdio rpath", NULL) == -1) { @@ -184,14 +184,18 @@ prime_main(int argc, char **argv) } } + is_prime = BN_is_prime_ex(bn, prime_config.checks, NULL, NULL); + if (is_prime < 0) { + BIO_printf(bio_err, "BN_is_prime_ex failed.\n"); + goto end; + } BIO_printf(bio_out, "%s is %sprime\n", prime, - BN_is_prime_ex(bn, prime_config.checks, - NULL, NULL) ? "" : "not "); + is_prime == 1 ? "" : "not "); } ret = 0; -end: + end: BN_free(bn); BIO_free_all(bio_out); diff --git a/apps/openssl/rand.c b/apps/openssl/rand.c index 04105bc4..0f91dde8 100644 --- a/apps/openssl/rand.c +++ b/apps/openssl/rand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rand.c,v 1.11 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: rand.c,v 1.13 2018/02/07 05:47:55 jsing Exp $ */ /* ==================================================================== * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. * @@ -176,10 +176,9 @@ rand_main(int argc, char **argv) ret = 0; -err: + err: ERR_print_errors(bio_err); - if (out) - BIO_free_all(out); + BIO_free_all(out); return (ret); } diff --git a/apps/openssl/req.c b/apps/openssl/req.c index 352e38b2..c5cae4df 100644 --- a/apps/openssl/req.c +++ b/apps/openssl/req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: req.c,v 1.14 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: req.c,v 1.15 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -340,7 +340,7 @@ req_main(int argc, char **argv) } if (badops) { -bad: + bad: BIO_printf(bio_err, "%s [options] outfile\n", prog); BIO_printf(bio_err, "where options are\n"); BIO_printf(bio_err, " -inform arg input format - DER or PEM\n"); @@ -591,7 +591,7 @@ req_main(int argc, char **argv) cipher = NULL; i = 0; -loop: + loop: if (!PEM_write_bio_PrivateKey(out, pkey, cipher, NULL, 0, NULL, passout)) { if ((ERR_GET_REASON(ERR_peek_error()) == @@ -858,7 +858,7 @@ req_main(int argc, char **argv) } } ex = 0; -end: + end: if (ex) { ERR_print_errors(bio_err); } @@ -943,7 +943,7 @@ make_REQ(X509_REQ * req, EVP_PKEY * pkey, char *subj, int multirdn, goto err; ret = 1; -err: + err: return (ret); } @@ -996,7 +996,7 @@ prompt_info(X509_REQ * req, } if (sk_CONF_VALUE_num(dn_sk)) { i = -1; -start: for (;;) { + start: for (;;) { int ret; i++; if (sk_CONF_VALUE_num(dn_sk) <= i) @@ -1214,7 +1214,7 @@ add_DN_object(X509_NAME * n, char *text, const char *def, char *value, { int i, ret = 0; char buf[1024]; -start: + start: if (!batch) BIO_printf(bio_err, "%s [%s]:", text, def); (void) BIO_flush(bio_err); @@ -1255,7 +1255,7 @@ add_DN_object(X509_NAME * n, char *text, const char *def, char *value, (unsigned char *) buf, -1, -1, mval)) goto err; ret = 1; -err: + err: return (ret); } @@ -1267,7 +1267,7 @@ add_attribute_object(X509_REQ * req, char *text, const char *def, int i; static char buf[1024]; -start: + start: if (!batch) BIO_printf(bio_err, "%s [%s]:", text, def); (void) BIO_flush(bio_err); @@ -1312,7 +1312,7 @@ add_attribute_object(X509_REQ * req, char *text, const char *def, goto err; } return (1); -err: + err: return (0); } diff --git a/apps/openssl/rsa.c b/apps/openssl/rsa.c index 7ad1da13..4017899c 100644 --- a/apps/openssl/rsa.c +++ b/apps/openssl/rsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: rsa.c,v 1.13 2019/02/09 15:49:21 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -234,17 +234,11 @@ static struct option rsa_options[] = { { NULL } }; -static void -show_ciphers(const OBJ_NAME *name, void *arg) -{ - static int n; - - fprintf(stderr, " -%-24s%s", name->name, (++n % 3 ? "" : "\n")); -} - static void rsa_usage() { + int n = 0; + fprintf(stderr, "usage: rsa [-ciphername] [-check] [-in file] " "[-inform fmt]\n" @@ -255,7 +249,7 @@ rsa_usage() fprintf(stderr, "\n"); fprintf(stderr, "Valid ciphername values:\n\n"); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_ciphers, NULL); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_cipher, &n); fprintf(stderr, "\n"); } @@ -439,7 +433,7 @@ rsa_main(int argc, char **argv) } else ret = 0; -end: + end: BIO_free_all(out); RSA_free(rsa); free(passin); diff --git a/apps/openssl/rsautl.c b/apps/openssl/rsautl.c index 1c22e5df..7d7434c6 100644 --- a/apps/openssl/rsautl.c +++ b/apps/openssl/rsautl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsautl.c,v 1.12 2017/08/28 17:50:58 jsing Exp $ */ +/* $OpenBSD: rsautl.c,v 1.17 2019/02/04 11:21:05 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -58,7 +58,6 @@ #include - #include #include "apps.h" @@ -67,35 +66,182 @@ #include #include -#define RSA_SIGN 1 -#define RSA_VERIFY 2 -#define RSA_ENCRYPT 3 -#define RSA_DECRYPT 4 +#define RSA_SIGN 1 +#define RSA_VERIFY 2 +#define RSA_ENCRYPT 3 +#define RSA_DECRYPT 4 #define KEY_PRIVKEY 1 #define KEY_PUBKEY 2 #define KEY_CERT 3 -static void usage(void); +struct { + int asn1parse; + int hexdump; + char *infile; + char *keyfile; + int keyform; + int key_type; + char *outfile; + int pad; + char *passargin; + int rev; + int rsa_mode; +} rsautl_config; + +struct option rsautl_options[] = { + { + .name = "asn1parse", + .desc = "ASN.1 parse the output data", + .type = OPTION_FLAG, + .opt.flag = &rsautl_config.asn1parse, + }, + { + .name = "certin", + .desc = "Input is a certificate containing an RSA public key", + .type = OPTION_VALUE, + .value = KEY_CERT, + .opt.value = &rsautl_config.key_type, + }, + { + .name = "decrypt", + .desc = "Decrypt the input data using RSA private key", + .type = OPTION_VALUE, + .value = RSA_DECRYPT, + .opt.value = &rsautl_config.rsa_mode, + }, + { + .name = "encrypt", + .desc = "Encrypt the input data using RSA public key", + .type = OPTION_VALUE, + .value = RSA_ENCRYPT, + .opt.value = &rsautl_config.rsa_mode, + }, + { + .name = "hexdump", + .desc = "Hex dump the output data", + .type = OPTION_FLAG, + .opt.flag = &rsautl_config.hexdump, + }, + { + .name = "in", + .argname = "file", + .desc = "Input file (default stdin)", + .type = OPTION_ARG, + .opt.arg = &rsautl_config.infile, + }, + { + .name = "inkey", + .argname = "file", + .desc = "Input key file", + .type = OPTION_ARG, + .opt.arg = &rsautl_config.keyfile, + }, + { + .name = "keyform", + .argname = "fmt", + .desc = "Input key format (DER, TXT or PEM (default))", + .type = OPTION_ARG_FORMAT, + .opt.value = &rsautl_config.keyform, + }, + { + .name = "oaep", + .desc = "Use PKCS#1 OAEP padding", + .type = OPTION_VALUE, + .value = RSA_PKCS1_OAEP_PADDING, + .opt.value = &rsautl_config.pad, + }, + { + .name = "out", + .argname = "file", + .desc = "Output file (default stdout)", + .type = OPTION_ARG, + .opt.arg = &rsautl_config.outfile, + }, + { + .name = "passin", + .argname = "arg", + .desc = "Key password source", + .type = OPTION_ARG, + .opt.arg = &rsautl_config.passargin, + }, + { + .name = "pkcs", + .desc = "Use PKCS#1 v1.5 padding (default)", + .type = OPTION_VALUE, + .value = RSA_PKCS1_PADDING, + .opt.value = &rsautl_config.pad, + }, + { + .name = "pubin", + .desc = "Input is an RSA public key", + .type = OPTION_VALUE, + .value = KEY_PUBKEY, + .opt.value = &rsautl_config.key_type, + }, + { + .name = "raw", + .desc = "Use no padding", + .type = OPTION_VALUE, + .value = RSA_NO_PADDING, + .opt.value = &rsautl_config.pad, + }, + { + .name = "rev", + .desc = "Reverse the input data", + .type = OPTION_FLAG, + .opt.flag = &rsautl_config.rev, + }, + { + .name = "sign", + .desc = "Sign the input data using RSA private key", + .type = OPTION_VALUE, + .value = RSA_SIGN, + .opt.value = &rsautl_config.rsa_mode, + }, + { + .name = "verify", + .desc = "Verify the input data using RSA public key", + .type = OPTION_VALUE, + .value = RSA_VERIFY, + .opt.value = &rsautl_config.rsa_mode, + }, + { + .name = "x931", + .desc = "Use ANSI X9.31 padding", + .type = OPTION_VALUE, + .value = RSA_X931_PADDING, + .opt.value = &rsautl_config.pad, + }, + + {NULL}, +}; + +static void +rsautl_usage() +{ + fprintf(stderr, + "usage: rsautl [-asn1parse] [-certin] [-decrypt] [-encrypt] " + "[-hexdump]\n" + " [-in file] [-inkey file] [-keyform der | pem]\n" + " [-oaep | -pkcs | -raw | -x931] [-out file] [-passin arg]\n" + " [-pubin] [-rev] [-sign] [-verify]\n\n"); + + options_usage(rsautl_options); +} int rsautl_main(int argc, char **argv) { BIO *in = NULL, *out = NULL; - char *infile = NULL, *outfile = NULL; - char *keyfile = NULL; - char rsa_mode = RSA_VERIFY, key_type = KEY_PRIVKEY; - int keyform = FORMAT_PEM; - char need_priv = 0, badarg = 0, rev = 0; - char hexdump = 0, asn1parse = 0; X509 *x; EVP_PKEY *pkey = NULL; RSA *rsa = NULL; - unsigned char *rsa_in = NULL, *rsa_out = NULL, pad; - char *passargin = NULL, *passin = NULL; + unsigned char *rsa_in = NULL, *rsa_out = NULL; + char *passin = NULL; int rsa_inlen, rsa_outlen = 0; + int need_priv = 0; int keysize; - int ret = 1; if (single_execution) { @@ -105,98 +251,44 @@ rsautl_main(int argc, char **argv) } } - argc--; - argv++; - - pad = RSA_PKCS1_PADDING; - - while (argc >= 1) { - if (!strcmp(*argv, "-in")) { - if (--argc < 1) - badarg = 1; - else - infile = *(++argv); - } else if (!strcmp(*argv, "-out")) { - if (--argc < 1) - badarg = 1; - else - outfile = *(++argv); - } else if (!strcmp(*argv, "-inkey")) { - if (--argc < 1) - badarg = 1; - else - keyfile = *(++argv); - } else if (!strcmp(*argv, "-passin")) { - if (--argc < 1) - badarg = 1; - else - passargin = *(++argv); - } else if (strcmp(*argv, "-keyform") == 0) { - if (--argc < 1) - badarg = 1; - else - keyform = str2fmt(*(++argv)); - } else if (!strcmp(*argv, "-pubin")) { - key_type = KEY_PUBKEY; - } else if (!strcmp(*argv, "-certin")) { - key_type = KEY_CERT; - } else if (!strcmp(*argv, "-asn1parse")) - asn1parse = 1; - else if (!strcmp(*argv, "-hexdump")) - hexdump = 1; - else if (!strcmp(*argv, "-raw")) - pad = RSA_NO_PADDING; - else if (!strcmp(*argv, "-oaep")) - pad = RSA_PKCS1_OAEP_PADDING; - else if (!strcmp(*argv, "-pkcs")) - pad = RSA_PKCS1_PADDING; - else if (!strcmp(*argv, "-x931")) - pad = RSA_X931_PADDING; - else if (!strcmp(*argv, "-sign")) { - rsa_mode = RSA_SIGN; - need_priv = 1; - } else if (!strcmp(*argv, "-verify")) - rsa_mode = RSA_VERIFY; - else if (!strcmp(*argv, "-rev")) - rev = 1; - else if (!strcmp(*argv, "-encrypt")) - rsa_mode = RSA_ENCRYPT; - else if (!strcmp(*argv, "-decrypt")) { - rsa_mode = RSA_DECRYPT; - need_priv = 1; - } else - badarg = 1; - if (badarg) { - usage(); - goto end; - } - argc--; - argv++; + memset(&rsautl_config, 0, sizeof(rsautl_config)); + rsautl_config.keyform = FORMAT_PEM; + rsautl_config.key_type = KEY_PRIVKEY; + rsautl_config.pad = RSA_PKCS1_PADDING; + rsautl_config.rsa_mode = RSA_VERIFY; + + if (options_parse(argc, argv, rsautl_options, NULL, NULL) != 0) { + rsautl_usage(); + return (1); } - if (need_priv && (key_type != KEY_PRIVKEY)) { + if (rsautl_config.rsa_mode == RSA_SIGN || + rsautl_config.rsa_mode == RSA_DECRYPT) + need_priv = 1; + + if (need_priv && rsautl_config.key_type != KEY_PRIVKEY) { BIO_printf(bio_err, "A private key is needed for this operation\n"); goto end; } - if (!app_passwd(bio_err, passargin, NULL, &passin, NULL)) { + if (!app_passwd(bio_err, rsautl_config.passargin, NULL, &passin, NULL)) { BIO_printf(bio_err, "Error getting password\n"); goto end; } - switch (key_type) { + switch (rsautl_config.key_type) { case KEY_PRIVKEY: - pkey = load_key(bio_err, keyfile, keyform, 0, - passin, "Private Key"); + pkey = load_key(bio_err, rsautl_config.keyfile, + rsautl_config.keyform, 0, passin, "Private Key"); break; case KEY_PUBKEY: - pkey = load_pubkey(bio_err, keyfile, keyform, 0, - NULL, "Public Key"); + pkey = load_pubkey(bio_err, rsautl_config.keyfile, + rsautl_config.keyform, 0, NULL, "Public Key"); break; case KEY_CERT: - x = load_cert(bio_err, keyfile, keyform, - NULL, "Certificate"); + x = load_cert(bio_err, rsautl_config.keyfile, + rsautl_config.keyform, NULL, "Certificate"); if (x) { pkey = X509_get_pubkey(x); X509_free(x); @@ -215,8 +307,8 @@ rsautl_main(int argc, char **argv) ERR_print_errors(bio_err); goto end; } - if (infile) { - if (!(in = BIO_new_file(infile, "rb"))) { + if (rsautl_config.infile) { + if (!(in = BIO_new_file(rsautl_config.infile, "rb"))) { BIO_printf(bio_err, "Error Reading Input File\n"); ERR_print_errors(bio_err); goto end; @@ -224,8 +316,8 @@ rsautl_main(int argc, char **argv) } else in = BIO_new_fp(stdin, BIO_NOCLOSE); - if (outfile) { - if (!(out = BIO_new_file(outfile, "wb"))) { + if (rsautl_config.outfile) { + if (!(out = BIO_new_file(rsautl_config.outfile, "wb"))) { BIO_printf(bio_err, "Error Reading Output File\n"); ERR_print_errors(bio_err); goto end; @@ -253,7 +345,7 @@ rsautl_main(int argc, char **argv) BIO_printf(bio_err, "Error reading input Data\n"); exit(1); } - if (rev) { + if (rsautl_config.rev) { int i; unsigned char ctmp; for (i = 0; i < rsa_inlen / 2; i++) { @@ -262,24 +354,27 @@ rsautl_main(int argc, char **argv) rsa_in[rsa_inlen - 1 - i] = ctmp; } } - switch (rsa_mode) { + switch (rsautl_config.rsa_mode) { case RSA_VERIFY: - rsa_outlen = RSA_public_decrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad); + rsa_outlen = RSA_public_decrypt(rsa_inlen, rsa_in, rsa_out, + rsa, rsautl_config.pad); break; case RSA_SIGN: - rsa_outlen = RSA_private_encrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad); + rsa_outlen = RSA_private_encrypt(rsa_inlen, rsa_in, rsa_out, + rsa, rsautl_config.pad); break; case RSA_ENCRYPT: - rsa_outlen = RSA_public_encrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad); + rsa_outlen = RSA_public_encrypt(rsa_inlen, rsa_in, rsa_out, + rsa, rsautl_config.pad); break; case RSA_DECRYPT: - rsa_outlen = RSA_private_decrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad); + rsa_outlen = RSA_private_decrypt(rsa_inlen, rsa_in, rsa_out, + rsa, rsautl_config.pad); break; - } if (rsa_outlen <= 0) { @@ -288,16 +383,16 @@ rsautl_main(int argc, char **argv) goto end; } ret = 0; - if (asn1parse) { + if (rsautl_config.asn1parse) { if (!ASN1_parse_dump(out, rsa_out, rsa_outlen, 1, -1)) { ERR_print_errors(bio_err); } - } else if (hexdump) + } else if (rsautl_config.hexdump) BIO_dump(out, (char *) rsa_out, rsa_outlen); else BIO_write(out, rsa_out, rsa_outlen); -end: + end: RSA_free(rsa); BIO_free(in); BIO_free_all(out); @@ -307,24 +402,3 @@ rsautl_main(int argc, char **argv) return ret; } - -static void -usage() -{ - BIO_printf(bio_err, "Usage: rsautl [options]\n"); - BIO_printf(bio_err, "-in file input file\n"); - BIO_printf(bio_err, "-out file output file\n"); - BIO_printf(bio_err, "-inkey file input key\n"); - BIO_printf(bio_err, "-keyform arg private key format - default PEM\n"); - BIO_printf(bio_err, "-pubin input is an RSA public\n"); - BIO_printf(bio_err, "-certin input is a certificate carrying an RSA public key\n"); - BIO_printf(bio_err, "-ssl use SSL v2 padding\n"); - BIO_printf(bio_err, "-raw use no padding\n"); - BIO_printf(bio_err, "-pkcs use PKCS#1 v1.5 padding (default)\n"); - BIO_printf(bio_err, "-oaep use PKCS#1 OAEP\n"); - BIO_printf(bio_err, "-sign sign with private key\n"); - BIO_printf(bio_err, "-verify verify with public key\n"); - BIO_printf(bio_err, "-encrypt encrypt with public key\n"); - BIO_printf(bio_err, "-decrypt decrypt with private key\n"); - BIO_printf(bio_err, "-hexdump hex dump output\n"); -} diff --git a/apps/openssl/s_apps.h b/apps/openssl/s_apps.h index ecadff5c..9ee0bb7d 100644 --- a/apps/openssl/s_apps.h +++ b/apps/openssl/s_apps.h @@ -1,4 +1,4 @@ -/* $OpenBSD: s_apps.h,v 1.4 2016/12/30 17:25:48 jsing Exp $ */ +/* $OpenBSD: s_apps.h,v 1.5 2018/04/25 07:12:33 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -147,5 +147,5 @@ void tlsext_cb(SSL *s, int client_server, int type, unsigned char *data, int generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len); -int verify_cookie_callback(SSL *ssl, unsigned char *cookie, +int verify_cookie_callback(SSL *ssl, const unsigned char *cookie, unsigned int cookie_len); diff --git a/apps/openssl/s_cb.c b/apps/openssl/s_cb.c index 73c4953c..ec25515b 100644 --- a/apps/openssl/s_cb.c +++ b/apps/openssl/s_cb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cb.c,v 1.8 2017/08/12 21:04:33 jsing Exp $ */ +/* $OpenBSD: s_cb.c,v 1.11 2018/11/06 05:45:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -700,8 +700,8 @@ tlsext_cb(SSL * s, int client_server, int type, unsigned char *data, int len, extname = "cert type"; break; - case TLSEXT_TYPE_elliptic_curves: - extname = "elliptic curves"; + case TLSEXT_TYPE_supported_groups: + extname = "supported groups"; break; case TLSEXT_TYPE_ec_point_formats: @@ -732,6 +732,14 @@ tlsext_cb(SSL * s, int client_server, int type, unsigned char *data, int len, extname = "renegotiation info"; break; + case TLSEXT_TYPE_application_layer_protocol_negotiation: + extname = "application layer protocol negotiation"; + break; + + case TLSEXT_TYPE_padding: + extname = "TLS padding"; + break; + default: extname = "unknown"; break; @@ -813,7 +821,8 @@ generate_cookie_callback(SSL * ssl, unsigned char *cookie, } int -verify_cookie_callback(SSL * ssl, unsigned char *cookie, unsigned int cookie_len) +verify_cookie_callback(SSL * ssl, const unsigned char *cookie, + unsigned int cookie_len) { unsigned char *buffer, result[EVP_MAX_MD_SIZE]; unsigned int length, resultlength; diff --git a/apps/openssl/s_client.c b/apps/openssl/s_client.c index f81d1a61..e542f084 100644 --- a/apps/openssl/s_client.c +++ b/apps/openssl/s_client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_client.c,v 1.33 2017/08/12 21:04:33 jsing Exp $ */ +/* $OpenBSD: s_client.c,v 1.37 2018/11/14 06:24:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -592,7 +592,7 @@ s_client_main(int argc, char **argv) goto bad; } if (badop) { -bad: + bad: if (errstr) BIO_printf(bio_err, "invalid argument %s: %s\n", *argv, errstr); @@ -859,7 +859,7 @@ s_client_main(int argc, char **argv) BIO_free(fbio); if (!foundit) BIO_printf(bio_err, - "didn't found starttls in server response," + "didn't find starttls in server response," " try anyway...\n"); BIO_printf(sbio, "STARTTLS\r\n"); BIO_read(sbio, sbuf, BUFSIZZ); @@ -891,7 +891,7 @@ s_client_main(int argc, char **argv) BIO_free(fbio); if (!foundit) BIO_printf(bio_err, - "didn't found STARTTLS in server response," + "didn't find STARTTLS in server response," " try anyway...\n"); BIO_printf(sbio, ". STARTTLS\r\n"); BIO_read(sbio, sbuf, BUFSIZZ); @@ -1200,27 +1200,23 @@ s_client_main(int argc, char **argv) } ret = 0; -shut: + shut: if (in_init) print_stuff(bio_c_out, con, full_log); SSL_shutdown(con); shutdown(SSL_get_fd(con), SHUT_RD); close(SSL_get_fd(con)); -end: + end: if (con != NULL) { if (prexit != 0) print_stuff(bio_c_out, con, 1); SSL_free(con); } - if (ctx != NULL) - SSL_CTX_free(ctx); - if (cert) - X509_free(cert); - if (key) - EVP_PKEY_free(key); + SSL_CTX_free(ctx); + X509_free(cert); + EVP_PKEY_free(key); free(pass); - if (vpm) - X509_VERIFY_PARAM_free(vpm); + X509_VERIFY_PARAM_free(vpm); freezero(cbuf, BUFSIZZ); freezero(sbuf, BUFSIZZ); freezero(mbuf, BUFSIZZ); @@ -1405,8 +1401,7 @@ print_stuff(BIO * bio, SSL * s, int full) } } BIO_printf(bio, "---\n"); - if (peer != NULL) - X509_free(peer); + X509_free(peer); /* flush, or debugging output gets mixed with http response */ (void) BIO_flush(bio); } diff --git a/apps/openssl/s_server.c b/apps/openssl/s_server.c index 7254109f..4bdafaf6 100644 --- a/apps/openssl/s_server.c +++ b/apps/openssl/s_server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_server.c,v 1.27 2017/08/12 21:04:33 jsing Exp $ */ +/* $OpenBSD: s_server.c,v 1.30 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -404,7 +404,7 @@ cert_status_cb(SSL * s, void *arg) { tlsextstatusctx *srctx = arg; BIO *err = srctx->err; - char *host, *port, *path; + char *host = NULL, *port = NULL, *path = NULL; int use_ssl; unsigned char *rspder = NULL; int rspderlen; @@ -487,7 +487,7 @@ cert_status_cb(SSL * s, void *arg) OCSP_RESPONSE_print(err, resp, 2); } ret = SSL_TLSEXT_ERR_OK; -done: + done: if (ret != SSL_TLSEXT_ERR_OK) ERR_print_errors(err); if (aia) { @@ -503,7 +503,7 @@ cert_status_cb(SSL * s, void *arg) if (resp) OCSP_RESPONSE_free(resp); return ret; -err: + err: ret = SSL_TLSEXT_ERR_ALERT_FATAL; goto done; } @@ -858,7 +858,7 @@ s_server_main(int argc, char *argv[]) argv++; } if (badop) { -bad: + bad: if (errstr) BIO_printf(bio_err, "invalid argument %s: %s\n", *argv, errstr); @@ -1198,30 +1198,21 @@ s_server_main(int argc, char *argv[]) do_server(port, socket_type, &accept_socket, sv_body, context); print_stats(bio_s_out, ctx); ret = 0; -end: - if (ctx != NULL) - SSL_CTX_free(ctx); - if (s_cert) - X509_free(s_cert); - if (s_dcert) - X509_free(s_dcert); - if (s_key) - EVP_PKEY_free(s_key); - if (s_dkey) - EVP_PKEY_free(s_dkey); + end: + SSL_CTX_free(ctx); + X509_free(s_cert); + X509_free(s_dcert); + EVP_PKEY_free(s_key); + EVP_PKEY_free(s_dkey); free(pass); free(dpass); - if (vpm) - X509_VERIFY_PARAM_free(vpm); + X509_VERIFY_PARAM_free(vpm); free(tlscstatp.host); free(tlscstatp.port); free(tlscstatp.path); - if (ctx2 != NULL) - SSL_CTX_free(ctx2); - if (s_cert2) - X509_free(s_cert2); - if (s_key2) - EVP_PKEY_free(s_key2); + SSL_CTX_free(ctx2); + X509_free(s_cert2); + EVP_PKEY_free(s_key2); free(alpn_ctx.data); if (bio_s_out != NULL) { BIO_free(bio_s_out); @@ -1549,7 +1540,7 @@ sv_body(char *hostname, int s, unsigned char *context) } } } -err: + err: if (con != NULL) { BIO_printf(bio_s_out, "shutting down SSL\n"); SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); @@ -1664,7 +1655,7 @@ load_dh_param(const char *dhfile) if ((bio = BIO_new_file(dhfile, "r")) == NULL) goto err; ret = PEM_read_bio_DHparams(bio, NULL, NULL, NULL); -err: + err: BIO_free(bio); return (ret); } @@ -1949,18 +1940,17 @@ www_body(char *hostname, int s, unsigned char *context) } else break; } -end: + end: /* make sure we re-use sessions */ SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); -err: + err: if (ret >= 0) BIO_printf(bio_s_out, "ACCEPT\n"); free(buf); - if (io != NULL) - BIO_free_all(io); + BIO_free_all(io); /* if (ssl_bio != NULL) BIO_free(ssl_bio);*/ return (ret); } diff --git a/apps/openssl/s_socket.c b/apps/openssl/s_socket.c index 869211de..62b32d39 100644 --- a/apps/openssl/s_socket.c +++ b/apps/openssl/s_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_socket.c,v 1.8 2015/09/10 02:23:29 lteo Exp $ */ +/* $OpenBSD: s_socket.c,v 1.10 2018/08/19 20:07:06 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -122,7 +122,7 @@ init_client(int *sock, char *host, char *port, int type, int af) } perror("connect"); -out: + out: if (s != -1) close(s); freeaddrinfo(ai_top); @@ -210,7 +210,7 @@ init_server_long(int *sock, int port, char *ip, int type) goto err; *sock = s; ret = 1; -err: + err: if ((ret == 0) && (s != -1)) { shutdown(s, SHUT_RD); close(s); @@ -233,7 +233,7 @@ do_accept(int acc_sock, int *sock, char **host) socklen_t len; /* struct linger ling; */ -redoit: + redoit: memset((char *) &from, 0, sizeof(from)); len = sizeof(from); @@ -276,16 +276,18 @@ do_accept(int acc_sock, int *sock, char **host) if (h2 == NULL) { BIO_printf(bio_err, "gethostbyname failure\n"); close(ret); + free(*host); return (0); } if (h2->h_addrtype != AF_INET) { BIO_printf(bio_err, "gethostbyname addr is not AF_INET\n"); close(ret); + free(*host); return (0); } } -end: + end: *sock = ret; return (1); } diff --git a/apps/openssl/s_time.c b/apps/openssl/s_time.c index 3644e108..1506ca35 100644 --- a/apps/openssl/s_time.c +++ b/apps/openssl/s_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_time.c,v 1.17 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: s_time.c,v 1.32 2018/09/17 15:37:35 cheloha Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -88,10 +88,11 @@ #define SECONDS 30 extern int verify_depth; -extern int verify_error; static void s_time_usage(void); -static SSL *doConnection(SSL * scon); +static int run_test(SSL *); +static int benchmark(int); +static void print_tally_mark(SSL *); static SSL_CTX *tm_ctx = NULL; static const SSL_METHOD *s_time_meth = NULL; @@ -226,18 +227,6 @@ s_time_usage(void) options_usage(s_time_options); } -/*********************************************************************** - * TIME - time functions - */ -#define START 0 -#define STOP 1 - -static double -tm_Time_F(int s) -{ - return app_tminterval(s, 1); -} - /*********************************************************************** * MAIN - main processing area for client * real name depends on MONOLITH @@ -245,22 +234,16 @@ tm_Time_F(int s) int s_time_main(int argc, char **argv) { - double totalTime = 0.0; - int nConn = 0; - SSL *scon = NULL; - time_t finishtime; int ret = 1; - char buf[1024 * 8]; - int ver; if (single_execution) { - if (pledge("stdio rpath inet", NULL) == -1) { + if (pledge("stdio rpath inet dns", NULL) == -1) { perror("pledge"); exit(1); } } - s_time_meth = SSLv23_client_method(); + s_time_meth = TLS_client_method(); verify_depth = 0; @@ -322,167 +305,24 @@ s_time_main(int argc, char **argv) /* goto end; */ } - if (!(s_time_config.perform & 1)) - goto next; - printf("Collecting connection statistics for %lld seconds\n", - (long long)s_time_config.maxtime); - /* Loop and time how long it takes to make connections */ - - bytes_read = 0; - finishtime = time(NULL) + s_time_config.maxtime; - tm_Time_F(START); - for (;;) { - if (finishtime < time(NULL)) - break; - if ((scon = doConnection(NULL)) == NULL) + if (s_time_config.perform & 1) { + printf("Collecting connection statistics for %lld seconds\n", + (long long)s_time_config.maxtime); + if (benchmark(0)) goto end; - - if (s_time_config.www_path != NULL) { - int i, retval = snprintf(buf, sizeof buf, - "GET %s HTTP/1.0\r\n\r\n", s_time_config.www_path); - if ((size_t)retval >= sizeof buf) { - fprintf(stderr, "URL too long\n"); - goto end; - } - SSL_write(scon, buf, strlen(buf)); - while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) - bytes_read += i; - } - if (s_time_config.no_shutdown) - SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | - SSL_RECEIVED_SHUTDOWN); - else - SSL_shutdown(scon); - shutdown(SSL_get_fd(scon), SHUT_RDWR); - close(SSL_get_fd(scon)); - - nConn += 1; - if (SSL_session_reused(scon)) - ver = 'r'; - else { - ver = SSL_version(scon); - if (ver == TLS1_VERSION) - ver = 't'; - else if (ver == SSL3_VERSION) - ver = '3'; - else if (ver == SSL2_VERSION) - ver = '2'; - else - ver = '*'; - } - fputc(ver, stdout); - fflush(stdout); - - SSL_free(scon); - scon = NULL; } - totalTime += tm_Time_F(STOP); /* Add the time for this iteration */ - - printf("\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", - nConn, totalTime, ((double) nConn / totalTime), bytes_read); - printf("%d connections in %lld real seconds, %ld bytes read per connection\n", - nConn, - (long long)(time(NULL) - finishtime + s_time_config.maxtime), - bytes_read / nConn); - /* * Now loop and time connections using the same session id over and * over */ - -next: - if (!(s_time_config.perform & 2)) - goto end; - printf("\n\nNow timing with session id reuse.\n"); - - /* Get an SSL object so we can reuse the session id */ - if ((scon = doConnection(NULL)) == NULL) { - fprintf(stderr, "Unable to get connection\n"); - goto end; - } - if (s_time_config.www_path != NULL) { - int retval = snprintf(buf, sizeof buf, - "GET %s HTTP/1.0\r\n\r\n", s_time_config.www_path); - if ((size_t)retval >= sizeof buf) { - fprintf(stderr, "URL too long\n"); - goto end; - } - SSL_write(scon, buf, strlen(buf)); - while (SSL_read(scon, buf, sizeof(buf)) > 0); - } - if (s_time_config.no_shutdown) - SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | - SSL_RECEIVED_SHUTDOWN); - else - SSL_shutdown(scon); - shutdown(SSL_get_fd(scon), SHUT_RDWR); - close(SSL_get_fd(scon)); - - nConn = 0; - totalTime = 0.0; - - finishtime = time(NULL) + s_time_config.maxtime; - - printf("starting\n"); - bytes_read = 0; - tm_Time_F(START); - - for (;;) { - if (finishtime < time(NULL)) - break; - if ((doConnection(scon)) == NULL) + if (s_time_config.perform & 2) { + printf("\n\nNow timing with session id reuse.\n"); + if (benchmark(1)) goto end; - - if (s_time_config.www_path) { - int i, retval = snprintf(buf, sizeof buf, - "GET %s HTTP/1.0\r\n\r\n", s_time_config.www_path); - if ((size_t)retval >= sizeof buf) { - fprintf(stderr, "URL too long\n"); - goto end; - } - SSL_write(scon, buf, strlen(buf)); - while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) - bytes_read += i; - } - if (s_time_config.no_shutdown) - SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | - SSL_RECEIVED_SHUTDOWN); - else - SSL_shutdown(scon); - shutdown(SSL_get_fd(scon), SHUT_RDWR); - close(SSL_get_fd(scon)); - - nConn += 1; - if (SSL_session_reused(scon)) - ver = 'r'; - else { - ver = SSL_version(scon); - if (ver == TLS1_VERSION) - ver = 't'; - else if (ver == SSL3_VERSION) - ver = '3'; - else if (ver == SSL2_VERSION) - ver = '2'; - else - ver = '*'; - } - fputc(ver, stdout); - fflush(stdout); } - totalTime += tm_Time_F(STOP); /* Add the time for this iteration */ - - printf("\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double) nConn / totalTime), bytes_read); - printf("%d connections in %lld real seconds, %ld bytes read per connection\n", - nConn, - (long long)(time(NULL) - finishtime + s_time_config.maxtime), - bytes_read / nConn); - ret = 0; -end: - if (scon != NULL) - SSL_free(scon); - + end: if (tm_ctx != NULL) { SSL_CTX_free(tm_ctx); tm_ctx = NULL; @@ -492,44 +332,32 @@ s_time_main(int argc, char **argv) } /*********************************************************************** - * doConnection - make a connection + * run_test - make a connection, get a file, and shut down the connection + * * Args: - * scon = earlier ssl connection for session id, or NULL + * scon = SSL connection * Returns: - * SSL * = the connection pointer. + * 1 on success, 0 on error */ -static SSL * -doConnection(SSL * scon) +static int +run_test(SSL *scon) { + char buf[1024 * 8]; struct pollfd pfd[1]; - SSL *serverCon; BIO *conn; long verify_error; - int i; + int i, retval; if ((conn = BIO_new(BIO_s_connect())) == NULL) - return (NULL); - -/* BIO_set_conn_port(conn,port);*/ + return 0; BIO_set_conn_hostname(conn, s_time_config.host); - - if (scon == NULL) - serverCon = SSL_new(tm_ctx); - else { - serverCon = scon; - SSL_set_connect_state(serverCon); - } - - SSL_set_bio(serverCon, conn, conn); - - /* ok, lets connect */ + SSL_set_connect_state(scon); + SSL_set_bio(scon, conn, conn); for (;;) { - i = SSL_connect(serverCon); + i = SSL_connect(scon); if (BIO_sock_should_retry(i)) { BIO_printf(bio_err, "DELAY\n"); - - i = SSL_get_fd(serverCon); - pfd[0].fd = i; + pfd[0].fd = SSL_get_fd(scon); pfd[0].events = POLLIN; poll(pfd, 1, -1); continue; @@ -538,15 +366,104 @@ doConnection(SSL * scon) } if (i <= 0) { BIO_printf(bio_err, "ERROR\n"); - verify_error = SSL_get_verify_result(serverCon); + verify_error = SSL_get_verify_result(scon); if (verify_error != X509_V_OK) BIO_printf(bio_err, "verify error:%s\n", X509_verify_cert_error_string(verify_error)); else ERR_print_errors(bio_err); - if (scon == NULL) - SSL_free(serverCon); - return NULL; + return 0; + } + if (s_time_config.www_path != NULL) { + retval = snprintf(buf, sizeof buf, + "GET %s HTTP/1.0\r\n\r\n", s_time_config.www_path); + if (retval == -1 || retval >= sizeof buf) { + fprintf(stderr, "URL too long\n"); + return 0; + } + if (SSL_write(scon, buf, retval) != retval) + return 0; + while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) + bytes_read += i; + } + if (s_time_config.no_shutdown) + SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | + SSL_RECEIVED_SHUTDOWN); + else + SSL_shutdown(scon); + return 1; +} + +static void +print_tally_mark(SSL *scon) +{ + int ver; + + if (SSL_session_reused(scon)) + ver = 'r'; + else { + ver = SSL_version(scon); + if (ver == TLS1_VERSION) + ver = 't'; + else + ver = '*'; } - return serverCon; + fputc(ver, stdout); + fflush(stdout); +} + +static int +benchmark(int reuse_session) +{ + double elapsed, totalTime; + int nConn = 0; + SSL *scon = NULL; + int ret = 1; + + if (reuse_session) { + /* Get an SSL object so we can reuse the session id */ + if ((scon = SSL_new(tm_ctx)) == NULL) + goto end; + if (!run_test(scon)) { + fprintf(stderr, "Unable to get connection\n"); + goto end; + } + printf("starting\n"); + } + + nConn = 0; + bytes_read = 0; + + app_timer_real(TM_RESET); + app_timer_user(TM_RESET); + for (;;) { + elapsed = app_timer_real(TM_GET); + if (elapsed > s_time_config.maxtime) + break; + if (scon == NULL) { + if ((scon = SSL_new(tm_ctx)) == NULL) + goto end; + } + if (!run_test(scon)) + goto end; + nConn += 1; + print_tally_mark(scon); + if (!reuse_session) { + SSL_free(scon); + scon = NULL; + } + } + totalTime = app_timer_user(TM_GET); + + printf("\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", + nConn, totalTime, ((double) nConn / totalTime), bytes_read); + printf("%d connections in %.0f real seconds, %ld bytes read per connection\n", + nConn, + elapsed, + bytes_read / nConn); + + ret = 0; + end: + SSL_free(scon); + return ret; } diff --git a/apps/openssl/sess_id.c b/apps/openssl/sess_id.c index 3670f540..e739d99d 100644 --- a/apps/openssl/sess_id.c +++ b/apps/openssl/sess_id.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sess_id.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: sess_id.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -249,7 +249,7 @@ sess_id_main(int argc, char **argv) } ret = 0; -end: + end: BIO_free_all(out); SSL_SESSION_free(x); @@ -289,7 +289,7 @@ load_sess_id(char *infile, int format) ERR_print_errors(bio_err); goto end; } -end: + end: BIO_free(in); return (x); } diff --git a/apps/openssl/smime.c b/apps/openssl/smime.c index 847ee133..e8f5201e 100644 --- a/apps/openssl/smime.c +++ b/apps/openssl/smime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smime.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: smime.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -342,7 +342,7 @@ smime_main(int argc, char **argv) badarg = 1; if (badarg) { -argerr: + argerr: BIO_printf(bio_err, "Usage smime [options] cert.pem ...\n"); BIO_printf(bio_err, "where options are\n"); BIO_printf(bio_err, "-encrypt encrypt message\n"); @@ -620,17 +620,14 @@ smime_main(int argc, char **argv) } } ret = 0; -end: + end: if (ret) ERR_print_errors(bio_err); sk_X509_pop_free(encerts, X509_free); sk_X509_pop_free(other, X509_free); - if (vpm) - X509_VERIFY_PARAM_free(vpm); - if (sksigners) - sk_OPENSSL_STRING_free(sksigners); - if (skkeys) - sk_OPENSSL_STRING_free(skkeys); + X509_VERIFY_PARAM_free(vpm); + sk_OPENSSL_STRING_free(sksigners); + sk_OPENSSL_STRING_free(skkeys); X509_STORE_free(store); X509_free(cert); X509_free(recip); diff --git a/apps/openssl/speed.c b/apps/openssl/speed.c index 0ca87687..3d226a20 100644 --- a/apps/openssl/speed.c +++ b/apps/openssl/speed.c @@ -1,4 +1,4 @@ -/* $OpenBSD: speed.c,v 1.19 2016/08/22 04:33:07 deraadt Exp $ */ +/* $OpenBSD: speed.c,v 1.23 2018/07/13 18:36:56 cheloha Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -195,14 +195,17 @@ sig_done(int sig) run = 0; } -#define START 0 -#define STOP 1 +#define START TM_RESET +#define STOP TM_GET static double Time_F(int s) { - return app_tminterval(s, usertime); + if (usertime) + return app_timer_user(s); + else + return app_timer_real(s); } @@ -538,7 +541,7 @@ speed_main(int argc, char **argv) doit[D_EVP] = 1; } else if (argc > 0 && !strcmp(*argv, "-decrypt")) { decrypt = 1; - j--; /* Otherwise, -elapsed gets confused with an + j--; /* Otherwise, -decrypt gets confused with an * algorithm. */ } else if ((argc > 0) && (strcmp(*argv, "-multi") == 0)) { @@ -553,7 +556,7 @@ speed_main(int argc, char **argv) BIO_printf(bio_err, "bad multi count: %s", errstr); goto end; } - j--; /* Otherwise, -mr gets confused with an + j--; /* Otherwise, -multi gets confused with an * algorithm. */ } else if (argc > 0 && !strcmp(*argv, "-mr")) { @@ -1894,7 +1897,7 @@ speed_main(int argc, char **argv) mret = 0; -end: + end: ERR_print_errors(bio_err); free(buf); free(buf2); diff --git a/apps/openssl/spkac.c b/apps/openssl/spkac.c index 77f3e347..549a2205 100644 --- a/apps/openssl/spkac.c +++ b/apps/openssl/spkac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spkac.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: spkac.c,v 1.10 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. Based on an original idea by Massimiliano Pala * (madwolf@openca.org). @@ -301,7 +301,7 @@ spkac_main(int argc, char **argv) ret = 0; -end: + end: NCONF_free(conf); NETSCAPE_SPKI_free(spki); BIO_free(in); diff --git a/apps/openssl/ts.c b/apps/openssl/ts.c index 28462430..cac10d0d 100644 --- a/apps/openssl/ts.c +++ b/apps/openssl/ts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts.c,v 1.14 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: ts.c,v 1.15 2018/02/07 05:47:55 jsing Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ @@ -301,7 +301,7 @@ ts_main(int argc, char **argv) goto cleanup; -usage: + usage: BIO_printf(bio_err, "usage:\n" "ts -query [-config configfile] " "[-data file_to_hash] [-digest digest_bytes]" @@ -322,7 +322,7 @@ ts_main(int argc, char **argv) "-CApath ca_path -CAfile ca_file.pem " "-untrusted cert_file.pem\n"); -cleanup: + cleanup: /* Clean up. */ NCONF_free(conf); free(password); @@ -435,7 +435,7 @@ query_command(const char *data, char *digest, const EVP_MD * md, ret = 1; -end: + end: ERR_print_errors(bio_err); /* Clean up. */ @@ -521,7 +521,7 @@ create_query(BIO * data_bio, char *digest, const EVP_MD * md, ret = 1; -err: + err: if (!ret) { TS_REQ_free(ts_req); ts_req = NULL; @@ -574,7 +574,7 @@ create_digest(BIO * input, char *digest, const EVP_MD * md, } return md_value_len; -err: + err: return 0; } @@ -605,7 +605,7 @@ create_nonce(int bits) return nonce; -err: + err: BIO_printf(bio_err, "could not create nonce\n"); ASN1_INTEGER_free(nonce); return NULL; @@ -680,7 +680,7 @@ reply_command(CONF * conf, char *section, char *queryfile, ret = 1; -end: + end: ERR_print_errors(bio_err); /* Clean up. */ @@ -728,7 +728,7 @@ read_PKCS7(BIO * in_bio) tst_info = NULL; /* Ownership is lost. */ ret = 1; -end: + end: PKCS7_free(token); TS_TST_INFO_free(tst_info); if (!ret) { @@ -813,7 +813,7 @@ create_response(CONF * conf, const char *section, goto end; ret = 1; -end: + end: if (!ret) { TS_RESP_free(response); response = NULL; @@ -876,7 +876,7 @@ next_serial(const char *serialfile) goto err; } ret = 1; -err: + err: if (!ret) { ASN1_INTEGER_free(serial); serial = NULL; @@ -899,7 +899,7 @@ save_ts_serial(const char *serialfile, ASN1_INTEGER * serial) if (BIO_puts(out, "\n") <= 0) goto err; ret = 1; -err: + err: if (!ret) BIO_printf(bio_err, "could not save serial number to %s\n", serialfile); @@ -941,7 +941,7 @@ verify_command(char *data, char *digest, char *queryfile, char *in, TS_RESP_verify_token(verify_ctx, token) : TS_RESP_verify_response(verify_ctx, response); -end: + end: printf("Verification: "); if (ret) printf("OK\n"); @@ -1012,7 +1012,7 @@ create_verify_ctx(char *data, char *digest, char *queryfile, char *ca_path, goto err; ret = 1; -err: + err: if (!ret) { TS_VERIFY_CTX_free(ctx); ctx = NULL; @@ -1064,7 +1064,7 @@ create_cert_store(char *ca_path, char *ca_file) } } return cert_ctx; -err: + err: X509_STORE_free(cert_ctx); return NULL; } diff --git a/apps/openssl/verify.c b/apps/openssl/verify.c index d9b5ef97..f616e3c4 100644 --- a/apps/openssl/verify.c +++ b/apps/openssl/verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: verify.c,v 1.6 2015/10/17 15:00:11 doug Exp $ */ +/* $OpenBSD: verify.c,v 1.7 2018/02/07 05:47:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -201,7 +201,7 @@ verify_main(int argc, char **argv) ret = -1; } -end: + end: if (ret == 1) { BIO_printf(bio_err, "usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]"); BIO_printf(bio_err, " [-attime timestamp]"); @@ -259,7 +259,7 @@ check(X509_STORE * ctx, char *file, STACK_OF(X509) * uchain, ret = 0; -end: + end: if (i > 0) { fprintf(stdout, "OK\n"); ret = 1; diff --git a/apps/openssl/x509.c b/apps/openssl/x509.c index f43b0156..b25a7c82 100644 --- a/apps/openssl/x509.c +++ b/apps/openssl/x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.c,v 1.14 2017/01/20 08:57:12 deraadt Exp $ */ +/* $OpenBSD: x509.c,v 1.17 2019/01/19 21:17:05 jsg Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -429,7 +429,7 @@ x509_main(int argc, char **argv) } if (badops) { -bad: + bad: for (pp = x509_usage; (*pp != NULL); pp++) BIO_printf(bio_err, "%s", *pp); goto end; @@ -788,7 +788,7 @@ x509_main(int argc, char **argv) const EVP_MD *fdig = digest; if (!fdig) - fdig = EVP_sha1(); + fdig = EVP_sha256(); if (!X509_digest(x, fdig, md, &n)) { BIO_printf(bio_err, "out of memory\n"); @@ -905,7 +905,7 @@ x509_main(int argc, char **argv) } ret = 0; -end: + end: OBJ_cleanup(); NCONF_free(extconf); BIO_free_all(out); @@ -916,8 +916,7 @@ x509_main(int argc, char **argv) X509_free(xca); EVP_PKEY_free(Upkey); EVP_PKEY_free(CApkey); - if (sigopts) - sk_OPENSSL_STRING_free(sigopts); + sk_OPENSSL_STRING_free(sigopts); X509_REQ_free(rq); ASN1_INTEGER_free(sno); sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free); @@ -964,7 +963,7 @@ x509_load_serial(char *CAfile, char *serialfile, int create) if (!save_serial(buf, NULL, serial, &bs)) goto end; -end: + end: free(buf); BN_free(serial); @@ -1037,7 +1036,7 @@ x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, X509 *x, if (!do_X509_sign(bio_err, x, pkey, digest, sigopts)) goto end; ret = 1; -end: + end: X509_STORE_CTX_cleanup(&xsc); if (!ret) ERR_print_errors(bio_err); @@ -1123,7 +1122,7 @@ sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest, goto err; return 1; -err: + err: ERR_print_errors(bio_err); return 0; } diff --git a/cmake_export_symbol.cmake b/cmake_export_symbol.cmake index cbc65f2a..08830019 100644 --- a/cmake_export_symbol.cmake +++ b/cmake_export_symbol.cmake @@ -1,49 +1,55 @@ -macro(export_symbol TARGET FILENAME) +macro(export_symbol TARGET SYMBOLS_PATH) set(FLAG "") + get_filename_component(FILENAME ${SYMBOLS_PATH} NAME) if(WIN32) string(REPLACE ".sym" ".def" DEF_FILENAME ${FILENAME}) - file(WRITE ${DEF_FILENAME} "EXPORTS\n") - file(READ ${FILENAME} SYMBOLS) - file(APPEND ${DEF_FILENAME} "${SYMBOLS}") - target_sources(${TARGET} PRIVATE ${DEF_FILENAME}) + file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${DEF_FILENAME}" DEF_PATH) + file(WRITE ${DEF_PATH} "EXPORTS\n") + file(READ ${SYMBOLS_PATH} SYMBOLS) + file(APPEND ${DEF_PATH} "${SYMBOLS}") + target_sources(${TARGET} PRIVATE ${DEF_PATH}) elseif(APPLE) - file(READ ${FILENAME} SYMBOLS) + file(READ ${SYMBOLS_PATH} SYMBOLS) string(REGEX REPLACE "\n$" "" SYMBOLS ${SYMBOLS}) string(REPLACE "\n" "\n_" SYMBOLS ${SYMBOLS}) string(REGEX REPLACE "(.)$" "\\1\\n" SYMBOLS ${SYMBOLS}) string(REPLACE ".sym" ".exp" EXP_FILENAME ${FILENAME}) - file(WRITE ${EXP_FILENAME} "_${SYMBOLS}") - set(FLAG "-exported_symbols_list ${EXP_FILENAME}") + file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXP_FILENAME}" EXP_PATH) + file(WRITE ${EXP_PATH} "_${SYMBOLS}") + set(FLAG "-exported_symbols_list ${EXP_PATH}") set_target_properties(${TARGET} PROPERTIES LINK_FLAGS ${FLAG}) elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX") - file(READ ${FILENAME} SYMBOLS) + file(READ ${SYMBOLS_PATH} SYMBOLS) string(REGEX REPLACE "\n$" "" SYMBOLS ${SYMBOLS}) string(REPLACE "\n" "\n+e " SYMBOLS ${SYMBOLS}) string(REPLACE ".sym" ".opt" OPT_FILENAME ${FILENAME}) - file(WRITE ${OPT_FILENAME} "+e ${SYMBOLS}") - set(FLAG "-Wl,-c,${OPT_FILENAME}") + file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${OPT_FILENAME}" OPT_PATH) + file(WRITE ${OPT_PATH} "+e ${SYMBOLS}") + set(FLAG "-Wl,-c,${OPT_PATH}") set_target_properties(${TARGET} PROPERTIES LINK_FLAGS ${FLAG}) elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS") - file(READ ${FILENAME} SYMBOLS) + file(READ ${SYMBOLS_PATH} SYMBOLS) string(REPLACE "\n" ";\n" SYMBOLS ${SYMBOLS}) string(REPLACE ".sym" ".ver" VER_FILENAME ${FILENAME}) - file(WRITE ${VER_FILENAME} + file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${VER_FILENAME}" VER_PATH) + file(WRITE ${VER_PATH} "{\nglobal:\n${SYMBOLS}\nlocal:\n*;\n};\n") - set(FLAG "-Wl,-M${VER_FILENAME}") + set(FLAG "-Wl,-M${VER_PATH}") set_target_properties(${TARGET} PROPERTIES LINK_FLAGS ${FLAG}) elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") - file(READ ${FILENAME} SYMBOLS) + file(READ ${SYMBOLS_PATH} SYMBOLS) string(REPLACE "\n" ";\n" SYMBOLS ${SYMBOLS}) string(REPLACE ".sym" ".ver" VER_FILENAME ${FILENAME}) - file(WRITE ${VER_FILENAME} + file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${VER_FILENAME}" VER_PATH) + file(WRITE ${VER_PATH} "{\nglobal:\n${SYMBOLS}\nlocal:\n*;\n};\n") - set(FLAG "-Wl,--version-script,\"${VER_FILENAME}\"") + set(FLAG "-Wl,--version-script,\"${VER_PATH}\"") set_target_properties(${TARGET} PROPERTIES LINK_FLAGS ${FLAG}) endif() diff --git a/compile b/compile index 2ab71e4e..99e50524 100644 --- a/compile +++ b/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC # 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 . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -340,7 +340,7 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/configure b/configure index 7cd2a0b8..76a872b1 100644 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libressl 2.6.5. +# Generated by GNU Autoconf 2.69 for libressl 2.9.2. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libressl' PACKAGE_TARNAME='libressl' -PACKAGE_VERSION='2.6.5' -PACKAGE_STRING='libressl 2.6.5' +PACKAGE_VERSION='2.9.2' +PACKAGE_STRING='libressl 2.9.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -634,10 +634,16 @@ LTLIBOBJS LIBOBJS SMALL_TIME_T_FALSE SMALL_TIME_T_TRUE +HOST_ASM_MINGW64_X86_64_FALSE +HOST_ASM_MINGW64_X86_64_TRUE +HOST_ASM_MASM_X86_64_FALSE +HOST_ASM_MASM_X86_64_TRUE HOST_ASM_MACOSX_X86_64_FALSE HOST_ASM_MACOSX_X86_64_TRUE HOST_ASM_ELF_X86_64_FALSE HOST_ASM_ELF_X86_64_TRUE +HOST_ASM_ELF_ARM_FALSE +HOST_ASM_ELF_ARM_TRUE OPENSSL_NO_ASM_FALSE OPENSSL_NO_ASM_TRUE HOST_CPU_IS_INTEL_FALSE @@ -649,6 +655,8 @@ OPENSSLDIR_DEFINED_TRUE OPENSSLDIR HAVE_B64_NTOP_FALSE HAVE_B64_NTOP_TRUE +HAVE_CLOCK_GETTIME_FALSE +HAVE_CLOCK_GETTIME_TRUE HAVE_TIMINGSAFE_MEMCMP_FALSE HAVE_TIMINGSAFE_MEMCMP_TRUE HAVE_TIMINGSAFE_BCMP_FALSE @@ -673,6 +681,12 @@ HAVE_PIPE2_FALSE HAVE_PIPE2_TRUE HAVE_ACCEPT4_FALSE HAVE_ACCEPT4_TRUE +HAVE_SYSLOG_R_FALSE +HAVE_SYSLOG_R_TRUE +HAVE_SYSLOG_FALSE +HAVE_SYSLOG_TRUE +HAVE_GETPROGNAME_FALSE +HAVE_GETPROGNAME_TRUE HAVE_TIMEGM_FALSE HAVE_TIMEGM_TRUE HAVE_STRTONUM_FALSE @@ -695,10 +709,6 @@ HAVE_READPASSPHRASE_FALSE HAVE_READPASSPHRASE_TRUE HAVE_MEMMEM_FALSE HAVE_MEMMEM_TRUE -HAVE_INET_PTON_FALSE -HAVE_INET_PTON_TRUE -HAVE_INET_NTOP_FALSE -HAVE_INET_NTOP_TRUE HAVE_GETPAGESIZE_FALSE HAVE_GETPAGESIZE_TRUE HAVE_FREEZERO_FALSE @@ -767,7 +777,6 @@ am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR OBJEXT @@ -852,7 +861,8 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -1423,7 +1433,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libressl 2.6.5 to adapt to many kinds of systems. +\`configure' configures libressl 2.9.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1493,7 +1503,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libressl 2.6.5:";; + short | recursive ) echo "Configuration of libressl 2.9.2:";; esac cat <<\_ACEOF @@ -1609,7 +1619,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libressl configure 2.6.5 +libressl configure 2.9.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2157,7 +2167,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libressl $as_me 2.6.5, which was +It was created by libressl $as_me 2.9.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2505,11 +2515,11 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -LIBCRYPTO_VERSION=42:0:0 +LIBCRYPTO_VERSION=45:4:0 -LIBSSL_VERSION=44:1:0 +LIBSSL_VERSION=47:5:0 -LIBTLS_VERSION=16:1:0 +LIBTLS_VERSION=19:6:0 ac_aux_dir= @@ -2612,7 +2622,7 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -am__api_version='1.15' +am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -3098,7 +3108,7 @@ fi # Define the identity of the package. PACKAGE='libressl' - VERSION='2.6.5' + VERSION='2.9.2' cat >>confdefs.h <<_ACEOF @@ -3128,8 +3138,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The @@ -3180,7 +3190,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -3242,197 +3252,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe + for ac_prog in cc gcc do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 @@ -3476,7 +3296,7 @@ fi fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe + for ac_prog in cc gcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -3531,8 +3351,6 @@ esac fi fi -fi - test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -4087,45 +3905,45 @@ DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : @@ -12092,7 +11910,7 @@ case $host_os in if test "`echo $CC | cut -d ' ' -f 1`" != "gcc" ; then CFLAGS="-qnoansialias $USER_CFLAGS" fi - PLATFORM_LDADD='-lperfstat -lpthread' + PLATFORM_LDADD='-lperfstat' ;; *cygwin*) @@ -12182,8 +12000,6 @@ fi CFLAGS="-g -O2 +DD64 +Otype_safety=off $USER_CFLAGS" fi CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT" - PLATFORM_LDADD='-lpthread' - ;; *linux*) HOST_OS=linux @@ -12224,13 +12040,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext $as_echo "#define HAVE_ATTRIBUTE__BOUNDED__ 1" >>confdefs.h + +$as_echo "#define HAVE_ATTRIBUTE__DEAD 1" >>confdefs.h + ;; *mingw*) HOST_OS=win + HOST_ABI=mingw64 BUILD_NC=no CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_POSIX -D_POSIX_SOURCE -D__USE_MINGW_ANSI_STDIO" CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS" - CPPFLAGS="$CPPFLAGS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0501" + CPPFLAGS="$CPPFLAGS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600" CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SPEED" PLATFORM_LDADD='-lws2_32' @@ -12238,9 +12058,8 @@ $as_echo "#define HAVE_ATTRIBUTE__BOUNDED__ 1" >>confdefs.h *solaris*) HOST_OS=solaris HOST_ABI=elf - CFLAGS="$CFLAGS -m64" CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP" - PLATFORM_LDADD='-lnsl -lsocket' + PLATFORM_LDADD='-ldl -lnsl -lsocket' ;; *) ;; @@ -13037,7 +12856,7 @@ fi done # Check for general libc functions -for ac_func in asprintf freezero inet_ntop inet_pton memmem +for ac_func in asprintf freezero memmem do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -13073,7 +12892,19 @@ _ACEOF fi done -for ac_func in timegm _mkgmtime +for ac_func in timegm _mkgmtime timespecsub +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in getprogname syslog syslog_r do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -13145,22 +12976,6 @@ else HAVE_GETPAGESIZE_FALSE= fi - if test "x$ac_cv_func_inet_ntop" = xyes; then - HAVE_INET_NTOP_TRUE= - HAVE_INET_NTOP_FALSE='#' -else - HAVE_INET_NTOP_TRUE='#' - HAVE_INET_NTOP_FALSE= -fi - - if test "x$ac_cv_func_inet_pton" = xyes; then - HAVE_INET_PTON_TRUE= - HAVE_INET_PTON_FALSE='#' -else - HAVE_INET_PTON_TRUE='#' - HAVE_INET_PTON_FALSE= -fi - if test "x$ac_cv_func_memmem" = xyes; then HAVE_MEMMEM_TRUE= HAVE_MEMMEM_FALSE='#' @@ -13249,6 +13064,30 @@ else HAVE_TIMEGM_FALSE= fi + if test "x$ac_cv_func_getprogname" = xyes; then + HAVE_GETPROGNAME_TRUE= + HAVE_GETPROGNAME_FALSE='#' +else + HAVE_GETPROGNAME_TRUE='#' + HAVE_GETPROGNAME_FALSE= +fi + + if test "x$ac_cv_func_syslog" = xyes; then + HAVE_SYSLOG_TRUE= + HAVE_SYSLOG_FALSE='#' +else + HAVE_SYSLOG_TRUE='#' + HAVE_SYSLOG_FALSE= +fi + + if test "x$ac_cv_func_syslog_r" = xyes; then + HAVE_SYSLOG_R_TRUE= + HAVE_SYSLOG_R_FALSE='#' +else + HAVE_SYSLOG_R_TRUE='#' + HAVE_SYSLOG_R_FALSE= +fi + for ac_func in accept4 pipe2 pledge poll socketpair @@ -13479,14 +13318,20 @@ fi # Check for getentropy fallback dependencies -ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval" +for ac_func in getauxval +do : + ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval" if test "x$ac_cv_func_getauxval" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETAUXVAL 1 +_ACEOF fi +done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -$as_echo_n "checking for library containing clock_gettime... " >&6; } -if ${ac_cv_search_clock_gettime+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dl_iterate_phdr" >&5 +$as_echo_n "checking for library containing dl_iterate_phdr... " >&6; } +if ${ac_cv_search_dl_iterate_phdr+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -13499,16 +13344,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char clock_gettime (); +char dl_iterate_phdr (); int main () { -return clock_gettime (); +return dl_iterate_phdr (); ; return 0; } _ACEOF -for ac_lib in '' rt posix4; do +for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else @@ -13516,38 +13361,45 @@ for ac_lib in '' rt posix4; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_clock_gettime=$ac_res + ac_cv_search_dl_iterate_phdr=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if ${ac_cv_search_clock_gettime+:} false; then : + if ${ac_cv_search_dl_iterate_phdr+:} false; then : break fi done -if ${ac_cv_search_clock_gettime+:} false; then : +if ${ac_cv_search_dl_iterate_phdr+:} false; then : else - ac_cv_search_clock_gettime=no + ac_cv_search_dl_iterate_phdr=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -$as_echo "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dl_iterate_phdr" >&5 +$as_echo "$ac_cv_search_dl_iterate_phdr" >&6; } +ac_res=$ac_cv_search_dl_iterate_phdr if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" -if test "x$ac_cv_func_clock_gettime" = xyes; then : +for ac_func in dl_iterate_phdr +do : + ac_fn_c_check_func "$LINENO" "dl_iterate_phdr" "ac_cv_func_dl_iterate_phdr" +if test "x$ac_cv_func_dl_iterate_phdr" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DL_ITERATE_PHDR 1 +_ACEOF fi +done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dl_iterate_phdr" >&5 -$as_echo_n "checking for library containing dl_iterate_phdr... " >&6; } -if ${ac_cv_search_dl_iterate_phdr+:} false; then : + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_once" >&5 +$as_echo_n "checking for library containing pthread_once... " >&6; } +if ${ac_cv_search_pthread_once+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -13560,16 +13412,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char dl_iterate_phdr (); +char pthread_once (); int main () { -return dl_iterate_phdr (); +return pthread_once (); ; return 0; } _ACEOF -for ac_lib in '' dl; do +for ac_lib in '' pthread; do if test -z "$ac_lib"; then ac_res="none required" else @@ -13577,33 +13429,159 @@ for ac_lib in '' dl; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_dl_iterate_phdr=$ac_res + ac_cv_search_pthread_once=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if ${ac_cv_search_dl_iterate_phdr+:} false; then : + if ${ac_cv_search_pthread_once+:} false; then : break fi done -if ${ac_cv_search_dl_iterate_phdr+:} false; then : +if ${ac_cv_search_pthread_once+:} false; then : else - ac_cv_search_dl_iterate_phdr=no + ac_cv_search_pthread_once=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dl_iterate_phdr" >&5 -$as_echo "$ac_cv_search_dl_iterate_phdr" >&6; } -ac_res=$ac_cv_search_dl_iterate_phdr +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_once" >&5 +$as_echo "$ac_cv_search_pthread_once" >&6; } +ac_res=$ac_cv_search_pthread_once if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -ac_fn_c_check_func "$LINENO" "dl_iterate_phdr" "ac_cv_func_dl_iterate_phdr" -if test "x$ac_cv_func_dl_iterate_phdr" = xyes; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutex_lock" >&5 +$as_echo_n "checking for library containing pthread_mutex_lock... " >&6; } +if ${ac_cv_search_pthread_mutex_lock+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_lock (); +int +main () +{ +return pthread_mutex_lock (); + ; + return 0; +} +_ACEOF +for ac_lib in '' pthread; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_pthread_mutex_lock=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_pthread_mutex_lock+:} false; then : + break +fi +done +if ${ac_cv_search_pthread_mutex_lock+:} false; then : + +else + ac_cv_search_pthread_mutex_lock=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutex_lock" >&5 +$as_echo "$ac_cv_search_pthread_mutex_lock" >&6; } +ac_res=$ac_cv_search_pthread_mutex_lock +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +$as_echo_n "checking for library containing clock_gettime... " >&6; } +if ${ac_cv_search_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_clock_gettime+:} false; then : + break +fi +done +if ${ac_cv_search_clock_gettime+:} false; then : +else + ac_cv_search_clock_gettime=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +$as_echo "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +for ac_func in clock_gettime +do : + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CLOCK_GETTIME 1 +_ACEOF + +fi +done + + if test "x$ac_cv_func_clock_gettime" = xyes; then + HAVE_CLOCK_GETTIME_TRUE= + HAVE_CLOCK_GETTIME_FALSE='#' +else + HAVE_CLOCK_GETTIME_TRUE='#' + HAVE_CLOCK_GETTIME_FALSE= fi @@ -13905,13 +13883,9 @@ case $host_cpu in #( *sparc*) : CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT" ;; #( *arm*) : - if test "x$BSWAP4" = "xyes"; then : - -else - CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT" -fi ;; #( + host_cpu=arm ;; #( *amd64*) : - host_cpu=x86_64, HOSTARCH=intel ;; #( + host_cpu=x86_64 HOSTARCH=intel ;; #( i?86) : HOSTARCH=intel ;; #( x86_64) : @@ -13920,6 +13894,11 @@ fi ;; #( *) : ;; esac +if test "x$BSWAP4" = "xyes" -a "$host_cpu" = "arm" ; then : + +else + CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT" +fi if test "x$HOSTARCH" = "xintel"; then HOST_CPU_IS_INTEL_TRUE= HOST_CPU_IS_INTEL_FALSE='#' @@ -13935,7 +13914,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern void SSLv3_method(); -__asm__(".section .gnu.warning.SSLv3_method; .ascii \"SSLv3_method is insecure\" ; .text"); +__asm__(".section .gnu.warning.SSLv3_method\n\t.ascii \"SSLv3_method is insecure\"\n\t.text"); int main() {return 0;} _ACEOF @@ -13971,6 +13950,14 @@ fi # Conditionally enable assembly by default + if test "x$HOST_ABI" = "xelf" -a "$host_cpu" = "arm" -a "x$enable_asm" != "xno"; then + HOST_ASM_ELF_ARM_TRUE= + HOST_ASM_ELF_ARM_FALSE='#' +else + HOST_ASM_ELF_ARM_TRUE='#' + HOST_ASM_ELF_ARM_FALSE= +fi + if test "x$HOST_ABI" = "xelf" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"; then HOST_ASM_ELF_X86_64_TRUE= HOST_ASM_ELF_X86_64_FALSE='#' @@ -13987,6 +13974,22 @@ else HOST_ASM_MACOSX_X86_64_FALSE= fi + if test "x$HOST_ABI" = "xmasm" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"; then + HOST_ASM_MASM_X86_64_TRUE= + HOST_ASM_MASM_X86_64_FALSE='#' +else + HOST_ASM_MASM_X86_64_TRUE='#' + HOST_ASM_MASM_X86_64_FALSE= +fi + + if test "x$HOST_ABI" = "xmingw64" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"; then + HOST_ASM_MINGW64_X86_64_TRUE= + HOST_ASM_MINGW64_X86_64_FALSE='#' +else + HOST_ASM_MINGW64_X86_64_TRUE='#' + HOST_ASM_MINGW64_X86_64_FALSE= +fi + # Check if time_t is sized correctly # The cast to long int works around a bug in the HP C Compiler @@ -14286,14 +14289,6 @@ if test -z "${HAVE_GETPAGESIZE_TRUE}" && test -z "${HAVE_GETPAGESIZE_FALSE}"; th as_fn_error $? "conditional \"HAVE_GETPAGESIZE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_INET_NTOP_TRUE}" && test -z "${HAVE_INET_NTOP_FALSE}"; then - as_fn_error $? "conditional \"HAVE_INET_NTOP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_INET_PTON_TRUE}" && test -z "${HAVE_INET_PTON_FALSE}"; then - as_fn_error $? "conditional \"HAVE_INET_PTON\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${HAVE_MEMMEM_TRUE}" && test -z "${HAVE_MEMMEM_FALSE}"; then as_fn_error $? "conditional \"HAVE_MEMMEM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -14338,6 +14333,18 @@ if test -z "${HAVE_TIMEGM_TRUE}" && test -z "${HAVE_TIMEGM_FALSE}"; then as_fn_error $? "conditional \"HAVE_TIMEGM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_GETPROGNAME_TRUE}" && test -z "${HAVE_GETPROGNAME_FALSE}"; then + as_fn_error $? "conditional \"HAVE_GETPROGNAME\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SYSLOG_TRUE}" && test -z "${HAVE_SYSLOG_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SYSLOG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SYSLOG_R_TRUE}" && test -z "${HAVE_SYSLOG_R_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SYSLOG_R\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_ACCEPT4_TRUE}" && test -z "${HAVE_ACCEPT4_FALSE}"; then as_fn_error $? "conditional \"HAVE_ACCEPT4\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -14390,6 +14397,10 @@ if test -z "${HAVE_ARC4RANDOM_BUF_TRUE}" && test -z "${HAVE_ARC4RANDOM_BUF_FALSE as_fn_error $? "conditional \"HAVE_ARC4RANDOM_BUF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_CLOCK_GETTIME_TRUE}" && test -z "${HAVE_CLOCK_GETTIME_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CLOCK_GETTIME\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_B64_NTOP_TRUE}" && test -z "${HAVE_B64_NTOP_FALSE}"; then as_fn_error $? "conditional \"HAVE_B64_NTOP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -14410,6 +14421,10 @@ if test -z "${OPENSSL_NO_ASM_TRUE}" && test -z "${OPENSSL_NO_ASM_FALSE}"; then as_fn_error $? "conditional \"OPENSSL_NO_ASM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HOST_ASM_ELF_ARM_TRUE}" && test -z "${HOST_ASM_ELF_ARM_FALSE}"; then + as_fn_error $? "conditional \"HOST_ASM_ELF_ARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HOST_ASM_ELF_X86_64_TRUE}" && test -z "${HOST_ASM_ELF_X86_64_FALSE}"; then as_fn_error $? "conditional \"HOST_ASM_ELF_X86_64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -14418,6 +14433,14 @@ if test -z "${HOST_ASM_MACOSX_X86_64_TRUE}" && test -z "${HOST_ASM_MACOSX_X86_64 as_fn_error $? "conditional \"HOST_ASM_MACOSX_X86_64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HOST_ASM_MASM_X86_64_TRUE}" && test -z "${HOST_ASM_MASM_X86_64_FALSE}"; then + as_fn_error $? "conditional \"HOST_ASM_MASM_X86_64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HOST_ASM_MINGW64_X86_64_TRUE}" && test -z "${HOST_ASM_MINGW64_X86_64_FALSE}"; then + as_fn_error $? "conditional \"HOST_ASM_MINGW64_X86_64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${SMALL_TIME_T_TRUE}" && test -z "${SMALL_TIME_T_FALSE}"; then as_fn_error $? "conditional \"SMALL_TIME_T\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -14819,7 +14842,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libressl $as_me 2.6.5, which was +This file was extended by libressl $as_me 2.9.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14876,7 +14899,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libressl config.status 2.6.5 +libressl config.status 2.9.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -14984,7 +15007,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -15722,29 +15745,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -15762,53 +15791,48 @@ $as_echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)$/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; "libtool":C) diff --git a/configure.ac b/configure.ac index 384a2b61..e584113d 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # This must be saved before AC_PROG_CC USER_CFLAGS="$CFLAGS" -AC_PROG_CC +AC_PROG_CC([cc gcc]) AC_PROG_CC_STDC AM_PROG_CC_C_O AC_PROG_LIBTOOL @@ -80,18 +80,18 @@ CFLAGS="$old_cflags" AS_CASE([$host_cpu], [*sparc*], [CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT"], - [*arm*], AS_IF([test "x$BSWAP4" = "xyes"],, - CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT"), - [*amd64*], [host_cpu=x86_64, HOSTARCH=intel], + [*arm*], [host_cpu=arm], + [*amd64*], [host_cpu=x86_64 HOSTARCH=intel], [i?86], [HOSTARCH=intel], [x86_64], [HOSTARCH=intel] ) +AS_IF([test "x$BSWAP4" = "xyes" -a "$host_cpu" = "arm" ],,CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT") AM_CONDITIONAL([HOST_CPU_IS_INTEL], [test "x$HOSTARCH" = "xintel"]) AC_MSG_CHECKING([if .gnu.warning accepts long strings]) AC_LINK_IFELSE([AC_LANG_SOURCE([[ extern void SSLv3_method(); -__asm__(".section .gnu.warning.SSLv3_method; .ascii \"SSLv3_method is insecure\" ; .text"); +__asm__(".section .gnu.warning.SSLv3_method\n\t.ascii \"SSLv3_method is insecure\"\n\t.text"); int main() {return 0;} ]])], [ AC_DEFINE(HAS_GNU_WARNING_LONG, 1, [Define if .gnu.warning accepts long strings.]) @@ -105,10 +105,16 @@ AC_ARG_ENABLE([asm], AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"]) # Conditionally enable assembly by default +AM_CONDITIONAL([HOST_ASM_ELF_ARM], + [test "x$HOST_ABI" = "xelf" -a "$host_cpu" = "arm" -a "x$enable_asm" != "xno"]) AM_CONDITIONAL([HOST_ASM_ELF_X86_64], [test "x$HOST_ABI" = "xelf" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"]) AM_CONDITIONAL([HOST_ASM_MACOSX_X86_64], [test "x$HOST_ABI" = "xmacosx" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"]) +AM_CONDITIONAL([HOST_ASM_MASM_X86_64], + [test "x$HOST_ABI" = "xmasm" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"]) +AM_CONDITIONAL([HOST_ASM_MINGW64_X86_64], + [test "x$HOST_ABI" = "xmingw64" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"]) # Check if time_t is sized correctly AC_CHECK_SIZEOF([time_t], [time.h]) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index e347bb67..0d658742 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -1,13 +1,27 @@ -include_directories( - . - ../include - ../include/compat - asn1 - bn - dsa - evp - modes -) +if(HOST_ASM_ELF_ARMV4) + set( + ASM_ARMV4_ELF_SRC + aes/aes-elf-armv4.S + bn/gf2m-elf-armv4.S + bn/mont-elf-armv4.S + sha/sha1-elf-armv4.S + sha/sha512-elf-armv4.S + sha/sha256-elf-armv4.S + modes/ghash-elf-armv4.S + armv4cpuid.S + armcap.c + ) + add_definitions(-DAES_ASM) + add_definitions(-DOPENSSL_BN_ASM_MONT) + add_definitions(-DOPENSSL_BN_ASM_GF2m) + add_definitions(-DGHASH_ASM) + add_definitions(-DSHA1_ASM) + add_definitions(-DSHA256_ASM) + add_definitions(-DSHA512_ASM) + add_definitions(-DOPENSSL_CPUID_OBJ) + set_property(SOURCE ${ASM_ARMV4_ELF_SRC} PROPERTY LANGUAGE C) + set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_ARMV4_ELF_SRC}) +endif() if(HOST_ASM_ELF_X86_64) set( @@ -91,14 +105,113 @@ if(HOST_ASM_MACOSX_X86_64) add_definitions(-DOPENSSL_CPUID_OBJ) set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MACOSX_SRC}) set_property(SOURCE ${ASM_X86_64_MACOSX_SRC} PROPERTY LANGUAGE C) + set_property(SOURCE ${ASM_X86_64_MACOSX_SRC} PROPERTY XCODE_EXPLICIT_FILE_TYPE "sourcecode.asm") +endif() + +if(HOST_ASM_MASM_X86_64) + set( + ASM_X86_64_MASM_SRC + aes/aes-masm-x86_64.S + aes/bsaes-masm-x86_64.S + aes/vpaes-masm-x86_64.S + aes/aesni-masm-x86_64.S + aes/aesni-sha1-masm-x86_64.S + #bn/modexp512-masm-x86_64.S + #bn/mont-masm-x86_64.S + #bn/mont5-masm-x86_64.S + #bn/gf2m-masm-x86_64.S + camellia/cmll-masm-x86_64.S + md5/md5-masm-x86_64.S + modes/ghash-masm-x86_64.S + rc4/rc4-masm-x86_64.S + rc4/rc4-md5-masm-x86_64.S + sha/sha1-masm-x86_64.S + sha/sha256-masm-x86_64.S + sha/sha512-masm-x86_64.S + whrlpool/wp-masm-x86_64.S + cpuid-masm-x86_64.S + ) + add_definitions(-DAES_ASM) + add_definitions(-DBSAES_ASM) + add_definitions(-DVPAES_ASM) + add_definitions(-DOPENSSL_IA32_SSE2) + #add_definitions(-DOPENSSL_BN_ASM_MONT) + #add_definitions(-DOPENSSL_BN_ASM_MONT5) + #add_definitions(-DOPENSSL_BN_ASM_GF2m) + add_definitions(-DMD5_ASM) + add_definitions(-DGHASH_ASM) + add_definitions(-DRSA_ASM) + add_definitions(-DSHA1_ASM) + add_definitions(-DSHA256_ASM) + add_definitions(-DSHA512_ASM) + add_definitions(-DWHIRLPOOL_ASM) + add_definitions(-DOPENSSL_CPUID_OBJ) + set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MASM_SRC}) + set_property(SOURCE ${ASM_X86_64_MASM_SRC} PROPERTY LANGUAGE C) endif() -if((NOT HOST_ASM_ELF_X86_64) AND (NOT HOST_ASM_MACOSX_X86_64)) +if(HOST_ASM_MINGW64_X86_64) + set( + ASM_X86_64_MINGW64_SRC + aes/aes-mingw64-x86_64.S + aes/bsaes-mingw64-x86_64.S + aes/vpaes-mingw64-x86_64.S + aes/aesni-mingw64-x86_64.S + aes/aesni-sha1-mingw64-x86_64.S + #bn/modexp512-mingw64-x86_64.S + #bn/mont-mingw64-x86_64.S + #bn/mont5-mingw64-x86_64.S + #bn/gf2m-mingw64-x86_64.S + camellia/cmll-mingw64-x86_64.S + md5/md5-mingw64-x86_64.S + modes/ghash-mingw64-x86_64.S + rc4/rc4-mingw64-x86_64.S + rc4/rc4-md5-mingw64-x86_64.S + sha/sha1-mingw64-x86_64.S + sha/sha256-mingw64-x86_64.S + sha/sha512-mingw64-x86_64.S + whrlpool/wp-mingw64-x86_64.S + cpuid-mingw64-x86_64.S + ) + add_definitions(-DAES_ASM) + add_definitions(-DBSAES_ASM) + add_definitions(-DVPAES_ASM) + add_definitions(-DOPENSSL_IA32_SSE2) + #add_definitions(-DOPENSSL_BN_ASM_MONT) + #add_definitions(-DOPENSSL_BN_ASM_MONT5) + #add_definitions(-DOPENSSL_BN_ASM_GF2m) + add_definitions(-DMD5_ASM) + add_definitions(-DGHASH_ASM) + add_definitions(-DRSA_ASM) + add_definitions(-DSHA1_ASM) + add_definitions(-DSHA256_ASM) + add_definitions(-DSHA512_ASM) + add_definitions(-DWHIRLPOOL_ASM) + add_definitions(-DOPENSSL_CPUID_OBJ) + set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MINGW64_SRC}) + set_property(SOURCE ${ASM_X86_64_MINGW64_SRC} PROPERTY LANGUAGE C) +endif() + +if((NOT HOST_ASM_ELF_X86_64) AND + (NOT HOST_ASM_MACOSX_X86_64) AND + (NOT HOST_ASM_MASM_X86_64) AND + (NOT HOST_ASM_MINGW64_X86_64) AND + (NOT HOST_ASM_ELF_ARMV4)) set( CRYPTO_SRC ${CRYPTO_SRC} - aes/aes_cbc.c aes/aes_core.c + ) +endif() + +if((NOT HOST_ASM_ELF_X86_64) AND + (NOT HOST_ASM_MACOSX_X86_64) AND + (NOT HOST_ASM_MASM_X86_64) AND + (NOT HOST_ASM_MINGW64_X86_64)) + set( + CRYPTO_SRC + ${CRYPTO_SRC} + aes/aes_cbc.c camellia/camellia.c camellia/cmll_cbc.c rc4/rc4_enc.c @@ -112,6 +225,7 @@ set( ${CRYPTO_SRC} cpt_err.c cryptlib.c + crypto_init.c cversion.c ex_data.c malloc-wrapper.c @@ -129,7 +243,6 @@ set( aes/aes_wrap.c asn1/a_bitstr.c asn1/a_bool.c - asn1/a_bytes.c asn1/a_d2i_fp.c asn1/a_digest.c asn1/a_dup.c @@ -140,7 +253,6 @@ set( asn1/a_object.c asn1/a_octet.c asn1/a_print.c - asn1/a_set.c asn1/a_sign.c asn1/a_strex.c asn1/a_strnid.c @@ -217,6 +329,7 @@ set( bio/bio_cb.c bio/bio_err.c bio/bio_lib.c + bio/bio_meth.c bio/bss_acpt.c bio/bss_bio.c bio/bss_conn.c @@ -323,6 +436,7 @@ set( dsa/dsa_gen.c dsa/dsa_key.c dsa/dsa_lib.c + dsa/dsa_meth.c dsa/dsa_ossl.c dsa/dsa_pmeth.c dsa/dsa_prn.c @@ -343,6 +457,7 @@ set( ec/ec_cvt.c ec/ec_err.c ec/ec_key.c + ec/ec_kmeth.c ec/ec_lib.c ec/ec_mult.c ec/ec_oct.c @@ -381,6 +496,7 @@ set( engine/tb_dsa.c engine/tb_ecdh.c engine/tb_ecdsa.c + engine/tb_eckey.c engine/tb_pkmeth.c engine/tb_rand.c engine/tb_rsa.c @@ -409,6 +525,7 @@ set( evp/e_rc2.c evp/e_rc4.c evp/e_rc4_hmac_md5.c + evp/e_sm4.c evp/e_xcbc_d.c evp/encode.c evp/evp_aead.c @@ -431,6 +548,7 @@ set( evp/m_sha1.c evp/m_sigver.c evp/m_streebog.c + evp/m_sm3.c evp/m_wp.c evp/names.c evp/p5_crpt.c @@ -551,6 +669,7 @@ set( rsa/rsa_err.c rsa/rsa_gen.c rsa/rsa_lib.c + rsa/rsa_meth.c rsa/rsa_none.c rsa/rsa_oaep.c rsa/rsa_pk1.c @@ -564,6 +683,8 @@ set( sha/sha1dgst.c sha/sha256.c sha/sha512.c + sm3/sm3.c + sm4/sm4.c stack/stack.c ts/ts_asn1.c ts/ts_conf.c @@ -642,21 +763,24 @@ set( x509v3/v3err.c ) -if(CMAKE_HOST_UNIX) +if(UNIX) + set(CRYPTO_SRC ${CRYPTO_SRC} crypto_lock.c) set(CRYPTO_SRC ${CRYPTO_SRC} bio/b_posix.c) set(CRYPTO_SRC ${CRYPTO_SRC} bio/bss_log.c) set(CRYPTO_SRC ${CRYPTO_SRC} ui/ui_openssl.c) endif() -if(CMAKE_HOST_WIN32) +if(WIN32) + set(CRYPTO_SRC ${CRYPTO_SRC} compat/crypto_lock_win.c) set(CRYPTO_SRC ${CRYPTO_SRC} bio/b_win.c) set(CRYPTO_UNEXPORT ${CRYPTO_UNEXPORT} BIO_s_log) set(CRYPTO_SRC ${CRYPTO_SRC} ui/ui_openssl_win.c) endif() -if(CMAKE_HOST_WIN32) +if(WIN32) set(CRYPTO_SRC ${CRYPTO_SRC} compat/posix_win.c) set(EXTRA_EXPORT ${EXTRA_EXPORT} gettimeofday) + set(EXTRA_EXPORT ${EXTRA_EXPORT} getuid) set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_perror) set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_fopen) set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_fgets) @@ -686,9 +810,14 @@ if(NOT HAVE_GETPAGESIZE) set(CRYPTO_SRC ${CRYPTO_SRC} compat/getpagesize.c) endif() -if(NOT HAVE_INET_PTON) - set(CRYPTO_SRC ${CRYPTO_SRC} compat/inet_pton.c) - set(EXTRA_EXPORT ${EXTRA_EXPORT} inet_pton) +if(NOT HAVE_GETPROGNAME) + if(WIN32) + set(CRYPTO_SRC ${CRYPTO_SRC} compat/getprogname_windows.c) + elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") + set(CRYPTO_SRC ${CRYPTO_SRC} compat/getprogname_linux.c) + else() + set(CRYPTO_SRC ${CRYPTO_SRC} compat/getprogname_unimpl.c) + endif() endif() if(NOT HAVE_REALLOCARRAY) @@ -730,13 +859,17 @@ if(NOT HAVE_STRSEP) set(EXTRA_EXPORT ${EXTRA_EXPORT} strsep) endif() +if(NOT HAVE_SYSLOG_R) + set(CRYPTO_SRC ${CRYPTO_SRC} compat/syslog_r.c) +endif() + if(NOT HAVE_TIMEGM) set(CRYPTO_SRC ${CRYPTO_SRC} compat/timegm.c) set(EXTRA_EXPORT ${EXTRA_EXPORT} timegm) endif() if(NOT HAVE_EXPLICIT_BZERO) - if(CMAKE_HOST_WIN32) + if(WIN32) set(CRYPTO_SRC ${CRYPTO_SRC} compat/explicit_bzero_win.c) else() set(CRYPTO_SRC ${CRYPTO_SRC} compat/explicit_bzero.c) @@ -753,7 +886,7 @@ if(NOT HAVE_ARC4RANDOM_BUF) set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_uniform) if(NOT HAVE_GETENTROPY) - if(CMAKE_HOST_WIN32) + if(WIN32) set(CRYPTO_SRC ${CRYPTO_SRC} compat/getentropy_win.c) elseif(CMAKE_SYSTEM_NAME MATCHES "AIX") set(CRYPTO_SRC ${CRYPTO_SRC} compat/getentropy_aix.c) @@ -787,7 +920,7 @@ endif() if(NOT ENABLE_ASM) add_definitions(-DOPENSSL_NO_ASM) else() - if(CMAKE_HOST_WIN32) + if(WIN32) add_definitions(-DOPENSSL_NO_ASM) endif() endif() @@ -802,35 +935,47 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/crypto.sym SYMS) foreach(SYM IN LISTS CRYPTO_UNEXPORT) string(REPLACE "${SYM}\n" "" SYMS ${SYMS}) endforeach() -file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/crypto_p.sym ${SYMS}) +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym ${SYMS}) if(EXTRA_EXPORT) list(SORT EXTRA_EXPORT) foreach(SYM IN LISTS EXTRA_EXPORT) - file(APPEND ${CMAKE_CURRENT_SOURCE_DIR}/crypto_p.sym "${SYM}\n") + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym "${SYM}\n") endforeach() endif() -add_library(crypto-objects OBJECT ${CRYPTO_SRC}) -if (BUILD_SHARED) - add_library(crypto STATIC $) - add_library(crypto-shared SHARED $) - export_symbol(crypto-shared ${CMAKE_CURRENT_SOURCE_DIR}/crypto_p.sym) +add_library(crypto ${CRYPTO_SRC}) +target_include_directories(crypto + PRIVATE + . + asn1 + bn + dsa + ec + ecdsa + evp + modes + ../include/compat + PUBLIC + ../include) + +if (BUILD_SHARED_LIBS) + export_symbol(crypto ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym) + target_link_libraries(crypto ${PLATFORM_LIBS}) if (WIN32) - target_link_libraries(crypto-shared Ws2_32.lib) set(CRYPTO_POSTFIX -${CRYPTO_MAJOR_VERSION}) endif() - set_target_properties(crypto-shared PROPERTIES + set_target_properties(crypto PROPERTIES OUTPUT_NAME crypto${CRYPTO_POSTFIX} ARCHIVE_OUTPUT_NAME crypto${CRYPTO_POSTFIX}) - set_target_properties(crypto-shared PROPERTIES VERSION + set_target_properties(crypto PROPERTIES VERSION ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION}) - if(ENABLE_LIBRESSL_INSTALL) - install(TARGETS crypto crypto-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_LIBRESSL_INSTALL) -else() - add_library(crypto STATIC ${CRYPTO_SRC}) - if(ENABLE_LIBRESSL_INSTALL) - install(TARGETS crypto DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_LIBRESSL_INSTALL) endif() +if(ENABLE_LIBRESSL_INSTALL) + install( + TARGETS crypto + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +endif(ENABLE_LIBRESSL_INSTALL) diff --git a/crypto/Makefile.am b/crypto/Makefile.am index 43d36651..ab4ceb17 100644 --- a/crypto/Makefile.am +++ b/crypto/Makefile.am @@ -2,6 +2,8 @@ include $(top_srcdir)/Makefile.am.common AM_CPPFLAGS += -I$(top_srcdir)/crypto/asn1 AM_CPPFLAGS += -I$(top_srcdir)/crypto/bn +AM_CPPFLAGS += -I$(top_srcdir)/crypto/ec +AM_CPPFLAGS += -I$(top_srcdir)/crypto/ecdsa AM_CPPFLAGS += -I$(top_srcdir)/crypto/evp AM_CPPFLAGS += -I$(top_srcdir)/crypto/modes AM_CPPFLAGS += -I$(top_srcdir)/crypto @@ -40,9 +42,6 @@ endif if !HAVE_FREEZERO -echo freezero >> crypto_portable.sym endif -if !HAVE_INET_PTON - -echo inet_pton >> crypto_portable.sym -endif if !HAVE_REALLOCARRAY -echo reallocarray >> crypto_portable.sym endif @@ -88,6 +87,7 @@ if HOST_WIN -echo posix_write >> crypto_portable.sym -echo posix_getsockopt >> crypto_portable.sym -echo posix_setsockopt >> crypto_portable.sym + -echo getuid >> crypto_portable.sym -grep -v BIO_s_log crypto_portable.sym > crypto_portable.sym.tmp -mv crypto_portable.sym.tmp crypto_portable.sym endif @@ -103,9 +103,6 @@ libcrypto_la_CPPFLAGS += -DOPENSSL_NO_HW_PADLOCK if OPENSSL_NO_ASM libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM else -if HOST_WIN -libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM -endif endif if OPENSSLDIR_DEFINED @@ -166,8 +163,16 @@ if !HAVE_GETPAGESIZE libcompat_la_SOURCES += compat/getpagesize.c endif -if !HAVE_INET_PTON -libcompat_la_SOURCES += compat/inet_pton.c +if !HAVE_GETPROGNAME +if HOST_LINUX +libcompat_la_SOURCES += compat/getprogname_linux.c +else +if HOST_WIN +libcompat_la_SOURCES += compat/getprogname_windows.c +else +libcompat_la_SOURCES += compat/getprogname_unimpl.c +endif +endif endif if !HAVE_TIMEGM @@ -182,6 +187,10 @@ if !HAVE_RECALLOCARRAY libcompat_la_SOURCES += compat/recallocarray.c endif +if !HAVE_SYSLOG_R +libcompat_la_SOURCES += compat/syslog_r.c +endif + if !HAVE_TIMINGSAFE_MEMCMP libcompat_la_SOURCES += compat/timingsafe_memcmp.c endif @@ -199,11 +208,17 @@ include Makefile.am.arc4random libcrypto_la_SOURCES = EXTRA_libcrypto_la_SOURCES = +include Makefile.am.elf-arm include Makefile.am.elf-x86_64 include Makefile.am.macosx-x86_64 +include Makefile.am.masm-x86_64 +include Makefile.am.mingw64-x86_64 +if !HOST_ASM_ELF_ARM if !HOST_ASM_ELF_X86_64 if !HOST_ASM_MACOSX_X86_64 +if !HOST_ASM_MASM_X86_64 +if !HOST_ASM_MINGW64_X86_64 libcrypto_la_SOURCES += aes/aes_cbc.c libcrypto_la_SOURCES += aes/aes_core.c libcrypto_la_SOURCES += camellia/camellia.c @@ -213,9 +228,18 @@ libcrypto_la_SOURCES += rc4/rc4_skey.c libcrypto_la_SOURCES += whrlpool/wp_block.c endif endif +endif +endif +endif libcrypto_la_SOURCES += cpt_err.c libcrypto_la_SOURCES += cryptlib.c +libcrypto_la_SOURCES += crypto_init.c +if !HOST_WIN +libcrypto_la_SOURCES += crypto_lock.c +else +libcrypto_la_SOURCES += compat/crypto_lock_win.c +endif libcrypto_la_SOURCES += cversion.c libcrypto_la_SOURCES += ex_data.c libcrypto_la_SOURCES += malloc-wrapper.c @@ -224,6 +248,7 @@ libcrypto_la_SOURCES += mem_dbg.c libcrypto_la_SOURCES += o_init.c libcrypto_la_SOURCES += o_str.c libcrypto_la_SOURCES += o_time.c +noinst_HEADERS += arm_arch.h noinst_HEADERS += constant_time_locl.h noinst_HEADERS += cryptlib.h noinst_HEADERS += md32_common.h @@ -243,7 +268,6 @@ noinst_HEADERS += aes/aes_locl.h # asn1 libcrypto_la_SOURCES += asn1/a_bitstr.c libcrypto_la_SOURCES += asn1/a_bool.c -libcrypto_la_SOURCES += asn1/a_bytes.c libcrypto_la_SOURCES += asn1/a_d2i_fp.c libcrypto_la_SOURCES += asn1/a_digest.c libcrypto_la_SOURCES += asn1/a_dup.c @@ -254,7 +278,6 @@ libcrypto_la_SOURCES += asn1/a_mbstr.c libcrypto_la_SOURCES += asn1/a_object.c libcrypto_la_SOURCES += asn1/a_octet.c libcrypto_la_SOURCES += asn1/a_print.c -libcrypto_la_SOURCES += asn1/a_set.c libcrypto_la_SOURCES += asn1/a_sign.c libcrypto_la_SOURCES += asn1/a_strex.c libcrypto_la_SOURCES += asn1/a_strnid.c @@ -345,6 +368,7 @@ libcrypto_la_SOURCES += bio/bf_null.c libcrypto_la_SOURCES += bio/bio_cb.c libcrypto_la_SOURCES += bio/bio_err.c libcrypto_la_SOURCES += bio/bio_lib.c +libcrypto_la_SOURCES += bio/bio_meth.c libcrypto_la_SOURCES += bio/bss_acpt.c libcrypto_la_SOURCES += bio/bss_bio.c libcrypto_la_SOURCES += bio/bss_conn.c @@ -491,6 +515,7 @@ libcrypto_la_SOURCES += dsa/dsa_err.c libcrypto_la_SOURCES += dsa/dsa_gen.c libcrypto_la_SOURCES += dsa/dsa_key.c libcrypto_la_SOURCES += dsa/dsa_lib.c +libcrypto_la_SOURCES += dsa/dsa_meth.c libcrypto_la_SOURCES += dsa/dsa_ossl.c libcrypto_la_SOURCES += dsa/dsa_pmeth.c libcrypto_la_SOURCES += dsa/dsa_prn.c @@ -516,6 +541,7 @@ libcrypto_la_SOURCES += ec/ec_curve.c libcrypto_la_SOURCES += ec/ec_cvt.c libcrypto_la_SOURCES += ec/ec_err.c libcrypto_la_SOURCES += ec/ec_key.c +libcrypto_la_SOURCES += ec/ec_kmeth.c libcrypto_la_SOURCES += ec/ec_lib.c libcrypto_la_SOURCES += ec/ec_mult.c libcrypto_la_SOURCES += ec/ec_oct.c @@ -563,6 +589,7 @@ libcrypto_la_SOURCES += engine/tb_digest.c libcrypto_la_SOURCES += engine/tb_dsa.c libcrypto_la_SOURCES += engine/tb_ecdh.c libcrypto_la_SOURCES += engine/tb_ecdsa.c +libcrypto_la_SOURCES += engine/tb_eckey.c libcrypto_la_SOURCES += engine/tb_pkmeth.c libcrypto_la_SOURCES += engine/tb_rand.c libcrypto_la_SOURCES += engine/tb_rsa.c @@ -596,6 +623,7 @@ libcrypto_la_SOURCES += evp/e_old.c libcrypto_la_SOURCES += evp/e_rc2.c libcrypto_la_SOURCES += evp/e_rc4.c libcrypto_la_SOURCES += evp/e_rc4_hmac_md5.c +libcrypto_la_SOURCES += evp/e_sm4.c libcrypto_la_SOURCES += evp/e_xcbc_d.c libcrypto_la_SOURCES += evp/encode.c libcrypto_la_SOURCES += evp/evp_aead.c @@ -618,6 +646,7 @@ libcrypto_la_SOURCES += evp/m_ripemd.c libcrypto_la_SOURCES += evp/m_sha1.c libcrypto_la_SOURCES += evp/m_sigver.c libcrypto_la_SOURCES += evp/m_streebog.c +libcrypto_la_SOURCES += evp/m_sm3.c libcrypto_la_SOURCES += evp/m_wp.c libcrypto_la_SOURCES += evp/names.c libcrypto_la_SOURCES += evp/p5_crpt.c @@ -791,6 +820,7 @@ libcrypto_la_SOURCES += rsa/rsa_eay.c libcrypto_la_SOURCES += rsa/rsa_err.c libcrypto_la_SOURCES += rsa/rsa_gen.c libcrypto_la_SOURCES += rsa/rsa_lib.c +libcrypto_la_SOURCES += rsa/rsa_meth.c libcrypto_la_SOURCES += rsa/rsa_none.c libcrypto_la_SOURCES += rsa/rsa_oaep.c libcrypto_la_SOURCES += rsa/rsa_pk1.c @@ -809,6 +839,13 @@ libcrypto_la_SOURCES += sha/sha256.c libcrypto_la_SOURCES += sha/sha512.c noinst_HEADERS += sha/sha_locl.h +# sm3 +libcrypto_la_SOURCES += sm3/sm3.c +noinst_HEADERS += sm3/sm3_locl.h + +# sm4 +libcrypto_la_SOURCES += sm4/sm4.c + # stack libcrypto_la_SOURCES += stack/stack.c diff --git a/crypto/Makefile.am.elf-arm b/crypto/Makefile.am.elf-arm new file mode 100644 index 00000000..a77c4d3b --- /dev/null +++ b/crypto/Makefile.am.elf-arm @@ -0,0 +1,30 @@ +ASM_ARM_ELF = aes/aes-elf-armv4.S +ASM_ARM_ELF += bn/gf2m-elf-armv4.S +ASM_ARM_ELF += bn/mont-elf-armv4.S +ASM_ARM_ELF += sha/sha1-elf-armv4.S +ASM_ARM_ELF += sha/sha512-elf-armv4.S +ASM_ARM_ELF += sha/sha256-elf-armv4.S +ASM_ARM_ELF += modes/ghash-elf-armv4.S +ASM_ARM_ELF += armv4cpuid.S +ASM_ARM_ELF += armcap.c + +ASM_ARM_ELF += aes/aes_cbc.c +ASM_ARM_ELF += camellia/camellia.c +ASM_ARM_ELF += camellia/cmll_cbc.c +ASM_ARM_ELF += rc4/rc4_enc.c +ASM_ARM_ELF += rc4/rc4_skey.c +ASM_ARM_ELF += whrlpool/wp_block.c + +EXTRA_DIST += $(ASM_ARM_ELF) + +if HOST_ASM_ELF_ARM +libcrypto_la_CPPFLAGS += -DAES_ASM +libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT +libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_GF2m +libcrypto_la_CPPFLAGS += -DGHASH_ASM +libcrypto_la_CPPFLAGS += -DSHA1_ASM +libcrypto_la_CPPFLAGS += -DSHA256_ASM +libcrypto_la_CPPFLAGS += -DSHA512_ASM +libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ +libcrypto_la_SOURCES += $(ASM_ARM_ELF) +endif diff --git a/crypto/Makefile.am.masm-x86_64 b/crypto/Makefile.am.masm-x86_64 new file mode 100644 index 00000000..27094c0b --- /dev/null +++ b/crypto/Makefile.am.masm-x86_64 @@ -0,0 +1,41 @@ + +ASM_X86_64_MASM = aes/aes-masm-x86_64.S +ASM_X86_64_MASM += aes/bsaes-masm-x86_64.S +ASM_X86_64_MASM += aes/vpaes-masm-x86_64.S +ASM_X86_64_MASM += aes/aesni-masm-x86_64.S +ASM_X86_64_MASM += aes/aesni-sha1-masm-x86_64.S +ASM_X86_64_MASM += bn/modexp512-masm-x86_64.S +ASM_X86_64_MASM += bn/mont-masm-x86_64.S +ASM_X86_64_MASM += bn/mont5-masm-x86_64.S +ASM_X86_64_MASM += bn/gf2m-masm-x86_64.S +ASM_X86_64_MASM += camellia/cmll-masm-x86_64.S +ASM_X86_64_MASM += md5/md5-masm-x86_64.S +ASM_X86_64_MASM += modes/ghash-masm-x86_64.S +ASM_X86_64_MASM += rc4/rc4-masm-x86_64.S +ASM_X86_64_MASM += rc4/rc4-md5-masm-x86_64.S +ASM_X86_64_MASM += sha/sha1-masm-x86_64.S +ASM_X86_64_MASM += sha/sha256-masm-x86_64.S +ASM_X86_64_MASM += sha/sha512-masm-x86_64.S +ASM_X86_64_MASM += whrlpool/wp-masm-x86_64.S +ASM_X86_64_MASM += cpuid-masm-x86_64.S + +EXTRA_DIST += $(ASM_X86_64_MASM) + +if HOST_ASM_MASM_X86_64 +libcrypto_la_CPPFLAGS += -DAES_ASM +libcrypto_la_CPPFLAGS += -DBSAES_ASM +libcrypto_la_CPPFLAGS += -DVPAES_ASM +libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 +libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT +libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 +libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_GF2m +libcrypto_la_CPPFLAGS += -DMD5_ASM +libcrypto_la_CPPFLAGS += -DGHASH_ASM +libcrypto_la_CPPFLAGS += -DRSA_ASM +libcrypto_la_CPPFLAGS += -DSHA1_ASM +libcrypto_la_CPPFLAGS += -DSHA256_ASM +libcrypto_la_CPPFLAGS += -DSHA512_ASM +libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM +libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ +libcrypto_la_SOURCES += $(ASM_X86_64_MASM) +endif diff --git a/crypto/Makefile.am.mingw64-x86_64 b/crypto/Makefile.am.mingw64-x86_64 new file mode 100644 index 00000000..bce854b2 --- /dev/null +++ b/crypto/Makefile.am.mingw64-x86_64 @@ -0,0 +1,41 @@ + +ASM_X86_64_MINGW64 = aes/aes-mingw64-x86_64.S +ASM_X86_64_MINGW64 += aes/bsaes-mingw64-x86_64.S +ASM_X86_64_MINGW64 += aes/vpaes-mingw64-x86_64.S +ASM_X86_64_MINGW64 += aes/aesni-mingw64-x86_64.S +ASM_X86_64_MINGW64 += aes/aesni-sha1-mingw64-x86_64.S +#ASM_X86_64_MINGW64 += bn/modexp512-mingw64-x86_64.S +#ASM_X86_64_MINGW64 += bn/mont-mingw64-x86_64.S +#ASM_X86_64_MINGW64 += bn/mont5-mingw64-x86_64.S +#ASM_X86_64_MINGW64 += bn/gf2m-mingw64-x86_64.S +ASM_X86_64_MINGW64 += camellia/cmll-mingw64-x86_64.S +ASM_X86_64_MINGW64 += md5/md5-mingw64-x86_64.S +ASM_X86_64_MINGW64 += modes/ghash-mingw64-x86_64.S +ASM_X86_64_MINGW64 += rc4/rc4-mingw64-x86_64.S +ASM_X86_64_MINGW64 += rc4/rc4-md5-mingw64-x86_64.S +ASM_X86_64_MINGW64 += sha/sha1-mingw64-x86_64.S +ASM_X86_64_MINGW64 += sha/sha256-mingw64-x86_64.S +ASM_X86_64_MINGW64 += sha/sha512-mingw64-x86_64.S +ASM_X86_64_MINGW64 += whrlpool/wp-mingw64-x86_64.S +ASM_X86_64_MINGW64 += cpuid-mingw64-x86_64.S + +EXTRA_DIST += $(ASM_X86_64_MINGW64) + +if HOST_ASM_MINGW64_X86_64 +libcrypto_la_CPPFLAGS += -DAES_ASM +libcrypto_la_CPPFLAGS += -DBSAES_ASM +libcrypto_la_CPPFLAGS += -DVPAES_ASM +libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 +#libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT +#libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 +#libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_GF2m +libcrypto_la_CPPFLAGS += -DMD5_ASM +libcrypto_la_CPPFLAGS += -DGHASH_ASM +libcrypto_la_CPPFLAGS += -DRSA_ASM +libcrypto_la_CPPFLAGS += -DSHA1_ASM +libcrypto_la_CPPFLAGS += -DSHA256_ASM +libcrypto_la_CPPFLAGS += -DSHA512_ASM +libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM +libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ +libcrypto_la_SOURCES += $(ASM_X86_64_MINGW64) +endif diff --git a/crypto/Makefile.in b/crypto/Makefile.in index 2c2acdfb..f5d087c1 100644 --- a/crypto/Makefile.in +++ b/crypto/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,41 +91,48 @@ build_triplet = @build@ host_triplet = @host@ @HAVE_EXPLICIT_BZERO_FALSE@am__append_1 = libcompatnoopt.la @OPENSSL_NO_ASM_TRUE@am__append_2 = -DOPENSSL_NO_ASM -@HOST_WIN_TRUE@@OPENSSL_NO_ASM_FALSE@am__append_3 = -DOPENSSL_NO_ASM -@OPENSSLDIR_DEFINED_TRUE@am__append_4 = -DOPENSSLDIR=\"@OPENSSLDIR@\" -@OPENSSLDIR_DEFINED_FALSE@am__append_5 = -DOPENSSLDIR=\"$(sysconfdir)/ssl\" +@OPENSSLDIR_DEFINED_TRUE@am__append_3 = -DOPENSSLDIR=\"@OPENSSLDIR@\" +@OPENSSLDIR_DEFINED_FALSE@am__append_4 = -DOPENSSLDIR=\"$(sysconfdir)/ssl\" # compatibility functions that need to be built without optimizations -@HAVE_EXPLICIT_BZERO_FALSE@am__append_6 = libcompatnoopt.la -@HAVE_EXPLICIT_BZERO_FALSE@@HOST_WIN_TRUE@am__append_7 = compat/explicit_bzero_win.c -@HAVE_EXPLICIT_BZERO_FALSE@@HOST_WIN_FALSE@am__append_8 = compat/explicit_bzero.c -@HAVE_STRLCAT_FALSE@am__append_9 = compat/strlcat.c -@HAVE_STRLCPY_FALSE@am__append_10 = compat/strlcpy.c -@HAVE_STRNDUP_FALSE@am__append_11 = compat/strndup.c +@HAVE_EXPLICIT_BZERO_FALSE@am__append_5 = libcompatnoopt.la +@HAVE_EXPLICIT_BZERO_FALSE@@HOST_WIN_TRUE@am__append_6 = compat/explicit_bzero_win.c +@HAVE_EXPLICIT_BZERO_FALSE@@HOST_WIN_FALSE@am__append_7 = compat/explicit_bzero.c +@HAVE_STRLCAT_FALSE@am__append_8 = compat/strlcat.c +@HAVE_STRLCPY_FALSE@am__append_9 = compat/strlcpy.c +@HAVE_STRNDUP_FALSE@am__append_10 = compat/strndup.c # the only user of strnlen is strndup, so only build it if needed -@HAVE_STRNDUP_FALSE@@HAVE_STRNLEN_FALSE@am__append_12 = compat/strnlen.c -@HAVE_STRSEP_FALSE@am__append_13 = compat/strsep.c -@HAVE_ASPRINTF_FALSE@am__append_14 = compat/bsd-asprintf.c -@HAVE_FREEZERO_FALSE@am__append_15 = compat/freezero.c -@HAVE_GETPAGESIZE_FALSE@am__append_16 = compat/getpagesize.c -@HAVE_INET_PTON_FALSE@am__append_17 = compat/inet_pton.c -@HAVE_TIMEGM_FALSE@am__append_18 = compat/timegm.c -@HAVE_REALLOCARRAY_FALSE@am__append_19 = compat/reallocarray.c -@HAVE_RECALLOCARRAY_FALSE@am__append_20 = compat/recallocarray.c -@HAVE_TIMINGSAFE_MEMCMP_FALSE@am__append_21 = compat/timingsafe_memcmp.c -@HAVE_TIMINGSAFE_BCMP_FALSE@am__append_22 = compat/timingsafe_bcmp.c -@HOST_WIN_TRUE@am__append_23 = compat/posix_win.c -@HAVE_ARC4RANDOM_BUF_FALSE@am__append_24 = compat/arc4random.c \ +@HAVE_STRNDUP_FALSE@@HAVE_STRNLEN_FALSE@am__append_11 = compat/strnlen.c +@HAVE_STRSEP_FALSE@am__append_12 = compat/strsep.c +@HAVE_ASPRINTF_FALSE@am__append_13 = compat/bsd-asprintf.c +@HAVE_FREEZERO_FALSE@am__append_14 = compat/freezero.c +@HAVE_GETPAGESIZE_FALSE@am__append_15 = compat/getpagesize.c +@HAVE_GETPROGNAME_FALSE@@HOST_LINUX_TRUE@am__append_16 = compat/getprogname_linux.c +@HAVE_GETPROGNAME_FALSE@@HOST_LINUX_FALSE@@HOST_WIN_TRUE@am__append_17 = compat/getprogname_windows.c +@HAVE_GETPROGNAME_FALSE@@HOST_LINUX_FALSE@@HOST_WIN_FALSE@am__append_18 = compat/getprogname_unimpl.c +@HAVE_TIMEGM_FALSE@am__append_19 = compat/timegm.c +@HAVE_REALLOCARRAY_FALSE@am__append_20 = compat/reallocarray.c +@HAVE_RECALLOCARRAY_FALSE@am__append_21 = compat/recallocarray.c +@HAVE_SYSLOG_R_FALSE@am__append_22 = compat/syslog_r.c +@HAVE_TIMINGSAFE_MEMCMP_FALSE@am__append_23 = compat/timingsafe_memcmp.c +@HAVE_TIMINGSAFE_BCMP_FALSE@am__append_24 = compat/timingsafe_bcmp.c +@HOST_WIN_TRUE@am__append_25 = compat/posix_win.c +@HAVE_ARC4RANDOM_BUF_FALSE@am__append_26 = compat/arc4random.c \ @HAVE_ARC4RANDOM_BUF_FALSE@ compat/arc4random_uniform.c -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_AIX_TRUE@am__append_25 = compat/getentropy_aix.c -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_FREEBSD_TRUE@am__append_26 = compat/getentropy_freebsd.c -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_HPUX_TRUE@am__append_27 = compat/getentropy_hpux.c -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_LINUX_TRUE@am__append_28 = compat/getentropy_linux.c -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_NETBSD_TRUE@am__append_29 = compat/getentropy_netbsd.c -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_DARWIN_TRUE@am__append_30 = compat/getentropy_osx.c -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_SOLARIS_TRUE@am__append_31 = compat/getentropy_solaris.c -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_WIN_TRUE@am__append_32 = compat/getentropy_win.c -@HOST_ASM_ELF_X86_64_TRUE@am__append_33 = -DAES_ASM -DBSAES_ASM \ +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_AIX_TRUE@am__append_27 = compat/getentropy_aix.c +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_FREEBSD_TRUE@am__append_28 = compat/getentropy_freebsd.c +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_HPUX_TRUE@am__append_29 = compat/getentropy_hpux.c +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_LINUX_TRUE@am__append_30 = compat/getentropy_linux.c +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_NETBSD_TRUE@am__append_31 = compat/getentropy_netbsd.c +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_DARWIN_TRUE@am__append_32 = compat/getentropy_osx.c +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_SOLARIS_TRUE@am__append_33 = compat/getentropy_solaris.c +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_WIN_TRUE@am__append_34 = compat/getentropy_win.c +@HOST_ASM_ELF_ARM_TRUE@am__append_35 = -DAES_ASM -DOPENSSL_BN_ASM_MONT \ +@HOST_ASM_ELF_ARM_TRUE@ -DOPENSSL_BN_ASM_GF2m -DGHASH_ASM \ +@HOST_ASM_ELF_ARM_TRUE@ -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM \ +@HOST_ASM_ELF_ARM_TRUE@ -DOPENSSL_CPUID_OBJ +@HOST_ASM_ELF_ARM_TRUE@am__append_36 = $(ASM_ARM_ELF) +@HOST_ASM_ELF_X86_64_TRUE@am__append_37 = -DAES_ASM -DBSAES_ASM \ @HOST_ASM_ELF_X86_64_TRUE@ -DVPAES_ASM -DOPENSSL_IA32_SSE2 \ @HOST_ASM_ELF_X86_64_TRUE@ -DOPENSSL_BN_ASM_MONT \ @HOST_ASM_ELF_X86_64_TRUE@ -DOPENSSL_BN_ASM_MONT5 \ @@ -133,8 +140,8 @@ host_triplet = @host@ @HOST_ASM_ELF_X86_64_TRUE@ -DGHASH_ASM -DRSA_ASM -DSHA1_ASM \ @HOST_ASM_ELF_X86_64_TRUE@ -DSHA256_ASM -DSHA512_ASM \ @HOST_ASM_ELF_X86_64_TRUE@ -DWHIRLPOOL_ASM -DOPENSSL_CPUID_OBJ -@HOST_ASM_ELF_X86_64_TRUE@am__append_34 = $(ASM_X86_64_ELF) -@HOST_ASM_MACOSX_X86_64_TRUE@am__append_35 = -DAES_ASM -DBSAES_ASM \ +@HOST_ASM_ELF_X86_64_TRUE@am__append_38 = $(ASM_X86_64_ELF) +@HOST_ASM_MACOSX_X86_64_TRUE@am__append_39 = -DAES_ASM -DBSAES_ASM \ @HOST_ASM_MACOSX_X86_64_TRUE@ -DVPAES_ASM -DOPENSSL_IA32_SSE2 \ @HOST_ASM_MACOSX_X86_64_TRUE@ -DOPENSSL_BN_ASM_MONT \ @HOST_ASM_MACOSX_X86_64_TRUE@ -DOPENSSL_BN_ASM_MONT5 \ @@ -143,19 +150,40 @@ host_triplet = @host@ @HOST_ASM_MACOSX_X86_64_TRUE@ -DSHA256_ASM -DSHA512_ASM \ @HOST_ASM_MACOSX_X86_64_TRUE@ -DWHIRLPOOL_ASM \ @HOST_ASM_MACOSX_X86_64_TRUE@ -DOPENSSL_CPUID_OBJ -@HOST_ASM_MACOSX_X86_64_TRUE@am__append_36 = $(ASM_X86_64_MACOSX) -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@am__append_37 = aes/aes_cbc.c \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ aes/aes_core.c \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ camellia/camellia.c \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ camellia/cmll_cbc.c \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ rc4/rc4_enc.c \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ rc4/rc4_skey.c \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ whrlpool/wp_block.c -@HOST_WIN_FALSE@am__append_38 = bio/b_posix.c -@HOST_WIN_TRUE@am__append_39 = bio/b_win.c -@HOST_WIN_FALSE@am__append_40 = bio/bss_log.c -@HOST_WIN_FALSE@am__append_41 = ui/ui_openssl.c -@HOST_WIN_TRUE@am__append_42 = ui/ui_openssl_win.c +@HOST_ASM_MACOSX_X86_64_TRUE@am__append_40 = $(ASM_X86_64_MACOSX) +@HOST_ASM_MASM_X86_64_TRUE@am__append_41 = -DAES_ASM -DBSAES_ASM \ +@HOST_ASM_MASM_X86_64_TRUE@ -DVPAES_ASM -DOPENSSL_IA32_SSE2 \ +@HOST_ASM_MASM_X86_64_TRUE@ -DOPENSSL_BN_ASM_MONT \ +@HOST_ASM_MASM_X86_64_TRUE@ -DOPENSSL_BN_ASM_MONT5 \ +@HOST_ASM_MASM_X86_64_TRUE@ -DOPENSSL_BN_ASM_GF2m -DMD5_ASM \ +@HOST_ASM_MASM_X86_64_TRUE@ -DGHASH_ASM -DRSA_ASM -DSHA1_ASM \ +@HOST_ASM_MASM_X86_64_TRUE@ -DSHA256_ASM -DSHA512_ASM \ +@HOST_ASM_MASM_X86_64_TRUE@ -DWHIRLPOOL_ASM -DOPENSSL_CPUID_OBJ +@HOST_ASM_MASM_X86_64_TRUE@am__append_42 = $(ASM_X86_64_MASM) +#libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT +#libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 +#libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_GF2m +@HOST_ASM_MINGW64_X86_64_TRUE@am__append_43 = -DAES_ASM -DBSAES_ASM \ +@HOST_ASM_MINGW64_X86_64_TRUE@ -DVPAES_ASM -DOPENSSL_IA32_SSE2 \ +@HOST_ASM_MINGW64_X86_64_TRUE@ -DMD5_ASM -DGHASH_ASM -DRSA_ASM \ +@HOST_ASM_MINGW64_X86_64_TRUE@ -DSHA1_ASM -DSHA256_ASM \ +@HOST_ASM_MINGW64_X86_64_TRUE@ -DSHA512_ASM -DWHIRLPOOL_ASM \ +@HOST_ASM_MINGW64_X86_64_TRUE@ -DOPENSSL_CPUID_OBJ +@HOST_ASM_MINGW64_X86_64_TRUE@am__append_44 = $(ASM_X86_64_MINGW64) +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@am__append_45 = aes/aes_cbc.c \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ aes/aes_core.c \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ camellia/camellia.c \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ camellia/cmll_cbc.c \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ rc4/rc4_enc.c \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ rc4/rc4_skey.c \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ whrlpool/wp_block.c +@HOST_WIN_FALSE@am__append_46 = crypto_lock.c +@HOST_WIN_TRUE@am__append_47 = compat/crypto_lock_win.c +@HOST_WIN_FALSE@am__append_48 = bio/b_posix.c +@HOST_WIN_TRUE@am__append_49 = bio/b_win.c +@HOST_WIN_FALSE@am__append_50 = bio/bss_log.c +@HOST_WIN_FALSE@am__append_51 = ui/ui_openssl.c +@HOST_WIN_TRUE@am__append_52 = ui/ui_openssl_win.c subdir = crypto ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/check-hardening-options.m4 \ @@ -206,14 +234,16 @@ libcompat_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__libcompat_la_SOURCES_DIST = compat/strlcat.c compat/strlcpy.c \ compat/strndup.c compat/strnlen.c compat/strsep.c \ compat/bsd-asprintf.c compat/freezero.c compat/getpagesize.c \ - compat/inet_pton.c compat/timegm.c compat/reallocarray.c \ - compat/recallocarray.c compat/timingsafe_memcmp.c \ - compat/timingsafe_bcmp.c compat/posix_win.c \ - compat/arc4random.c compat/arc4random_uniform.c \ - compat/getentropy_aix.c compat/getentropy_freebsd.c \ - compat/getentropy_hpux.c compat/getentropy_linux.c \ - compat/getentropy_netbsd.c compat/getentropy_osx.c \ - compat/getentropy_solaris.c compat/getentropy_win.c + compat/getprogname_linux.c compat/getprogname_windows.c \ + compat/getprogname_unimpl.c compat/timegm.c \ + compat/reallocarray.c compat/recallocarray.c compat/syslog_r.c \ + compat/timingsafe_memcmp.c compat/timingsafe_bcmp.c \ + compat/posix_win.c compat/arc4random.c \ + compat/arc4random_uniform.c compat/getentropy_aix.c \ + compat/getentropy_freebsd.c compat/getentropy_hpux.c \ + compat/getentropy_linux.c compat/getentropy_netbsd.c \ + compat/getentropy_osx.c compat/getentropy_solaris.c \ + compat/getentropy_win.c am__dirstamp = $(am__leading_dot)dirstamp @HAVE_STRLCAT_FALSE@am__objects_1 = compat/strlcat.lo @HAVE_STRLCPY_FALSE@am__objects_2 = compat/strlcpy.lo @@ -224,25 +254,28 @@ am__dirstamp = $(am__leading_dot)dirstamp @HAVE_ASPRINTF_FALSE@am__objects_6 = compat/bsd-asprintf.lo @HAVE_FREEZERO_FALSE@am__objects_7 = compat/freezero.lo @HAVE_GETPAGESIZE_FALSE@am__objects_8 = compat/getpagesize.lo -@HAVE_INET_PTON_FALSE@am__objects_9 = compat/inet_pton.lo -@HAVE_TIMEGM_FALSE@am__objects_10 = compat/timegm.lo -@HAVE_REALLOCARRAY_FALSE@am__objects_11 = compat/reallocarray.lo -@HAVE_RECALLOCARRAY_FALSE@am__objects_12 = compat/recallocarray.lo -@HAVE_TIMINGSAFE_MEMCMP_FALSE@am__objects_13 = \ +@HAVE_GETPROGNAME_FALSE@@HOST_LINUX_TRUE@am__objects_9 = compat/getprogname_linux.lo +@HAVE_GETPROGNAME_FALSE@@HOST_LINUX_FALSE@@HOST_WIN_TRUE@am__objects_10 = compat/getprogname_windows.lo +@HAVE_GETPROGNAME_FALSE@@HOST_LINUX_FALSE@@HOST_WIN_FALSE@am__objects_11 = compat/getprogname_unimpl.lo +@HAVE_TIMEGM_FALSE@am__objects_12 = compat/timegm.lo +@HAVE_REALLOCARRAY_FALSE@am__objects_13 = compat/reallocarray.lo +@HAVE_RECALLOCARRAY_FALSE@am__objects_14 = compat/recallocarray.lo +@HAVE_SYSLOG_R_FALSE@am__objects_15 = compat/syslog_r.lo +@HAVE_TIMINGSAFE_MEMCMP_FALSE@am__objects_16 = \ @HAVE_TIMINGSAFE_MEMCMP_FALSE@ compat/timingsafe_memcmp.lo -@HAVE_TIMINGSAFE_BCMP_FALSE@am__objects_14 = \ +@HAVE_TIMINGSAFE_BCMP_FALSE@am__objects_17 = \ @HAVE_TIMINGSAFE_BCMP_FALSE@ compat/timingsafe_bcmp.lo -@HOST_WIN_TRUE@am__objects_15 = compat/posix_win.lo -@HAVE_ARC4RANDOM_BUF_FALSE@am__objects_16 = compat/arc4random.lo \ +@HOST_WIN_TRUE@am__objects_18 = compat/posix_win.lo +@HAVE_ARC4RANDOM_BUF_FALSE@am__objects_19 = compat/arc4random.lo \ @HAVE_ARC4RANDOM_BUF_FALSE@ compat/arc4random_uniform.lo -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_AIX_TRUE@am__objects_17 = compat/getentropy_aix.lo -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_FREEBSD_TRUE@am__objects_18 = compat/getentropy_freebsd.lo -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_HPUX_TRUE@am__objects_19 = compat/getentropy_hpux.lo -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_LINUX_TRUE@am__objects_20 = compat/getentropy_linux.lo -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_NETBSD_TRUE@am__objects_21 = compat/getentropy_netbsd.lo -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_DARWIN_TRUE@am__objects_22 = compat/getentropy_osx.lo -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_SOLARIS_TRUE@am__objects_23 = compat/getentropy_solaris.lo -@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_WIN_TRUE@am__objects_24 = compat/getentropy_win.lo +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_AIX_TRUE@am__objects_20 = compat/getentropy_aix.lo +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_FREEBSD_TRUE@am__objects_21 = compat/getentropy_freebsd.lo +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_HPUX_TRUE@am__objects_22 = compat/getentropy_hpux.lo +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_LINUX_TRUE@am__objects_23 = compat/getentropy_linux.lo +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_NETBSD_TRUE@am__objects_24 = compat/getentropy_netbsd.lo +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_DARWIN_TRUE@am__objects_25 = compat/getentropy_osx.lo +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_SOLARIS_TRUE@am__objects_26 = compat/getentropy_solaris.lo +@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_WIN_TRUE@am__objects_27 = compat/getentropy_win.lo am_libcompat_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) $(am__objects_5) \ $(am__objects_6) $(am__objects_7) $(am__objects_8) \ @@ -251,7 +284,8 @@ am_libcompat_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_15) $(am__objects_16) $(am__objects_17) \ $(am__objects_18) $(am__objects_19) $(am__objects_20) \ $(am__objects_21) $(am__objects_22) $(am__objects_23) \ - $(am__objects_24) + $(am__objects_24) $(am__objects_25) $(am__objects_26) \ + $(am__objects_27) libcompat_la_OBJECTS = $(am_libcompat_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -260,10 +294,10 @@ am__v_lt_1 = libcompatnoopt_la_LIBADD = am__libcompatnoopt_la_SOURCES_DIST = compat/explicit_bzero_win.c \ compat/explicit_bzero.c -@HAVE_EXPLICIT_BZERO_FALSE@@HOST_WIN_TRUE@am__objects_25 = compat/libcompatnoopt_la-explicit_bzero_win.lo -@HAVE_EXPLICIT_BZERO_FALSE@@HOST_WIN_FALSE@am__objects_26 = compat/libcompatnoopt_la-explicit_bzero.lo +@HAVE_EXPLICIT_BZERO_FALSE@@HOST_WIN_TRUE@am__objects_28 = compat/libcompatnoopt_la-explicit_bzero_win.lo +@HAVE_EXPLICIT_BZERO_FALSE@@HOST_WIN_FALSE@am__objects_29 = compat/libcompatnoopt_la-explicit_bzero.lo @HAVE_EXPLICIT_BZERO_FALSE@am_libcompatnoopt_la_OBJECTS = \ -@HAVE_EXPLICIT_BZERO_FALSE@ $(am__objects_25) $(am__objects_26) +@HAVE_EXPLICIT_BZERO_FALSE@ $(am__objects_28) $(am__objects_29) libcompatnoopt_la_OBJECTS = $(am_libcompatnoopt_la_OBJECTS) libcompatnoopt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -271,7 +305,12 @@ libcompatnoopt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ -o $@ @HAVE_EXPLICIT_BZERO_FALSE@am_libcompatnoopt_la_rpath = libcrypto_la_DEPENDENCIES = libcompat.la $(am__append_1) -am__libcrypto_la_SOURCES_DIST = aes/aes-elf-x86_64.S \ +am__libcrypto_la_SOURCES_DIST = aes/aes-elf-armv4.S \ + bn/gf2m-elf-armv4.S bn/mont-elf-armv4.S sha/sha1-elf-armv4.S \ + sha/sha512-elf-armv4.S sha/sha256-elf-armv4.S \ + modes/ghash-elf-armv4.S armv4cpuid.S armcap.c aes/aes_cbc.c \ + camellia/camellia.c camellia/cmll_cbc.c rc4/rc4_enc.c \ + rc4/rc4_skey.c whrlpool/wp_block.c aes/aes-elf-x86_64.S \ aes/bsaes-elf-x86_64.S aes/vpaes-elf-x86_64.S \ aes/aesni-elf-x86_64.S aes/aesni-sha1-elf-x86_64.S \ bn/modexp512-elf-x86_64.S bn/mont-elf-x86_64.S \ @@ -290,36 +329,52 @@ am__libcrypto_la_SOURCES_DIST = aes/aes-elf-x86_64.S \ rc4/rc4-macosx-x86_64.S rc4/rc4-md5-macosx-x86_64.S \ sha/sha1-macosx-x86_64.S sha/sha256-macosx-x86_64.S \ sha/sha512-macosx-x86_64.S whrlpool/wp-macosx-x86_64.S \ - cpuid-macosx-x86_64.S aes/aes_cbc.c aes/aes_core.c \ - camellia/camellia.c camellia/cmll_cbc.c rc4/rc4_enc.c \ - rc4/rc4_skey.c whrlpool/wp_block.c cpt_err.c cryptlib.c \ + cpuid-macosx-x86_64.S aes/aes-masm-x86_64.S \ + aes/bsaes-masm-x86_64.S aes/vpaes-masm-x86_64.S \ + aes/aesni-masm-x86_64.S aes/aesni-sha1-masm-x86_64.S \ + bn/modexp512-masm-x86_64.S bn/mont-masm-x86_64.S \ + bn/mont5-masm-x86_64.S bn/gf2m-masm-x86_64.S \ + camellia/cmll-masm-x86_64.S md5/md5-masm-x86_64.S \ + modes/ghash-masm-x86_64.S rc4/rc4-masm-x86_64.S \ + rc4/rc4-md5-masm-x86_64.S sha/sha1-masm-x86_64.S \ + sha/sha256-masm-x86_64.S sha/sha512-masm-x86_64.S \ + whrlpool/wp-masm-x86_64.S cpuid-masm-x86_64.S \ + aes/aes-mingw64-x86_64.S aes/bsaes-mingw64-x86_64.S \ + aes/vpaes-mingw64-x86_64.S aes/aesni-mingw64-x86_64.S \ + aes/aesni-sha1-mingw64-x86_64.S camellia/cmll-mingw64-x86_64.S \ + md5/md5-mingw64-x86_64.S modes/ghash-mingw64-x86_64.S \ + rc4/rc4-mingw64-x86_64.S rc4/rc4-md5-mingw64-x86_64.S \ + sha/sha1-mingw64-x86_64.S sha/sha256-mingw64-x86_64.S \ + sha/sha512-mingw64-x86_64.S whrlpool/wp-mingw64-x86_64.S \ + cpuid-mingw64-x86_64.S aes/aes_core.c cpt_err.c cryptlib.c \ + crypto_init.c crypto_lock.c compat/crypto_lock_win.c \ cversion.c ex_data.c malloc-wrapper.c mem_clr.c mem_dbg.c \ o_init.c o_str.c o_time.c aes/aes_cfb.c aes/aes_ctr.c \ aes/aes_ecb.c aes/aes_ige.c aes/aes_misc.c aes/aes_ofb.c \ - aes/aes_wrap.c asn1/a_bitstr.c asn1/a_bool.c asn1/a_bytes.c \ - asn1/a_d2i_fp.c asn1/a_digest.c asn1/a_dup.c asn1/a_enum.c \ - asn1/a_i2d_fp.c asn1/a_int.c asn1/a_mbstr.c asn1/a_object.c \ - asn1/a_octet.c asn1/a_print.c asn1/a_set.c asn1/a_sign.c \ - asn1/a_strex.c asn1/a_strnid.c asn1/a_time.c asn1/a_time_tm.c \ - asn1/a_type.c asn1/a_utf8.c asn1/a_verify.c asn1/ameth_lib.c \ - asn1/asn1_err.c asn1/asn1_gen.c asn1/asn1_lib.c \ - asn1/asn1_par.c asn1/asn_mime.c asn1/asn_moid.c \ - asn1/asn_pack.c asn1/bio_asn1.c asn1/bio_ndef.c asn1/d2i_pr.c \ - asn1/d2i_pu.c asn1/evp_asn1.c asn1/f_enum.c asn1/f_int.c \ - asn1/f_string.c asn1/i2d_pr.c asn1/i2d_pu.c asn1/n_pkey.c \ - asn1/nsseq.c asn1/p5_pbe.c asn1/p5_pbev2.c asn1/p8_pkey.c \ - asn1/t_bitst.c asn1/t_crl.c asn1/t_pkey.c asn1/t_req.c \ - asn1/t_spki.c asn1/t_x509.c asn1/t_x509a.c asn1/tasn_dec.c \ - asn1/tasn_enc.c asn1/tasn_fre.c asn1/tasn_new.c \ - asn1/tasn_prn.c asn1/tasn_typ.c asn1/tasn_utl.c asn1/x_algor.c \ - asn1/x_attrib.c asn1/x_bignum.c asn1/x_crl.c asn1/x_exten.c \ - asn1/x_info.c asn1/x_long.c asn1/x_name.c asn1/x_nx509.c \ - asn1/x_pkey.c asn1/x_pubkey.c asn1/x_req.c asn1/x_sig.c \ - asn1/x_spki.c asn1/x_val.c asn1/x_x509.c asn1/x_x509a.c \ - bf/bf_cfb64.c bf/bf_ecb.c bf/bf_enc.c bf/bf_ofb64.c \ - bf/bf_skey.c bio/b_dump.c bio/b_posix.c bio/b_print.c \ - bio/b_sock.c bio/b_win.c bio/bf_buff.c bio/bf_nbio.c \ - bio/bf_null.c bio/bio_cb.c bio/bio_err.c bio/bio_lib.c \ + aes/aes_wrap.c asn1/a_bitstr.c asn1/a_bool.c asn1/a_d2i_fp.c \ + asn1/a_digest.c asn1/a_dup.c asn1/a_enum.c asn1/a_i2d_fp.c \ + asn1/a_int.c asn1/a_mbstr.c asn1/a_object.c asn1/a_octet.c \ + asn1/a_print.c asn1/a_sign.c asn1/a_strex.c asn1/a_strnid.c \ + asn1/a_time.c asn1/a_time_tm.c asn1/a_type.c asn1/a_utf8.c \ + asn1/a_verify.c asn1/ameth_lib.c asn1/asn1_err.c \ + asn1/asn1_gen.c asn1/asn1_lib.c asn1/asn1_par.c \ + asn1/asn_mime.c asn1/asn_moid.c asn1/asn_pack.c \ + asn1/bio_asn1.c asn1/bio_ndef.c asn1/d2i_pr.c asn1/d2i_pu.c \ + asn1/evp_asn1.c asn1/f_enum.c asn1/f_int.c asn1/f_string.c \ + asn1/i2d_pr.c asn1/i2d_pu.c asn1/n_pkey.c asn1/nsseq.c \ + asn1/p5_pbe.c asn1/p5_pbev2.c asn1/p8_pkey.c asn1/t_bitst.c \ + asn1/t_crl.c asn1/t_pkey.c asn1/t_req.c asn1/t_spki.c \ + asn1/t_x509.c asn1/t_x509a.c asn1/tasn_dec.c asn1/tasn_enc.c \ + asn1/tasn_fre.c asn1/tasn_new.c asn1/tasn_prn.c \ + asn1/tasn_typ.c asn1/tasn_utl.c asn1/x_algor.c asn1/x_attrib.c \ + asn1/x_bignum.c asn1/x_crl.c asn1/x_exten.c asn1/x_info.c \ + asn1/x_long.c asn1/x_name.c asn1/x_nx509.c asn1/x_pkey.c \ + asn1/x_pubkey.c asn1/x_req.c asn1/x_sig.c asn1/x_spki.c \ + asn1/x_val.c asn1/x_x509.c asn1/x_x509a.c bf/bf_cfb64.c \ + bf/bf_ecb.c bf/bf_enc.c bf/bf_ofb64.c bf/bf_skey.c \ + bio/b_dump.c bio/b_posix.c bio/b_print.c bio/b_sock.c \ + bio/b_win.c bio/bf_buff.c bio/bf_nbio.c bio/bf_null.c \ + bio/bio_cb.c bio/bio_err.c bio/bio_lib.c bio/bio_meth.c \ bio/bss_acpt.c bio/bss_bio.c bio/bss_conn.c bio/bss_dgram.c \ bio/bss_fd.c bio/bss_file.c bio/bss_log.c bio/bss_mem.c \ bio/bss_null.c bio/bss_sock.c bn/bn_add.c bn/bn_asm.c \ @@ -348,99 +403,112 @@ am__libcrypto_la_SOURCES_DIST = aes/aes-elf-x86_64.S \ dh/dh_err.c dh/dh_gen.c dh/dh_key.c dh/dh_lib.c dh/dh_pmeth.c \ dh/dh_prn.c dsa/dsa_ameth.c dsa/dsa_asn1.c dsa/dsa_depr.c \ dsa/dsa_err.c dsa/dsa_gen.c dsa/dsa_key.c dsa/dsa_lib.c \ - dsa/dsa_ossl.c dsa/dsa_pmeth.c dsa/dsa_prn.c dsa/dsa_sign.c \ - dsa/dsa_vrf.c dso/dso_dlfcn.c dso/dso_err.c dso/dso_lib.c \ - dso/dso_null.c dso/dso_openssl.c ec/ec2_mult.c ec/ec2_oct.c \ - ec/ec2_smpl.c ec/ec_ameth.c ec/ec_asn1.c ec/ec_check.c \ - ec/ec_curve.c ec/ec_cvt.c ec/ec_err.c ec/ec_key.c ec/ec_lib.c \ - ec/ec_mult.c ec/ec_oct.c ec/ec_pmeth.c ec/ec_print.c \ - ec/eck_prn.c ec/ecp_mont.c ec/ecp_nist.c ec/ecp_oct.c \ - ec/ecp_smpl.c ecdh/ech_err.c ecdh/ech_key.c ecdh/ech_lib.c \ - ecdsa/ecs_asn1.c ecdsa/ecs_err.c ecdsa/ecs_lib.c \ - ecdsa/ecs_ossl.c ecdsa/ecs_sign.c ecdsa/ecs_vrf.c \ - engine/eng_all.c engine/eng_cnf.c engine/eng_ctrl.c \ - engine/eng_dyn.c engine/eng_err.c engine/eng_fat.c \ - engine/eng_init.c engine/eng_lib.c engine/eng_list.c \ - engine/eng_openssl.c engine/eng_pkey.c engine/eng_table.c \ - engine/tb_asnmth.c engine/tb_cipher.c engine/tb_dh.c \ - engine/tb_digest.c engine/tb_dsa.c engine/tb_ecdh.c \ - engine/tb_ecdsa.c engine/tb_pkmeth.c engine/tb_rand.c \ - engine/tb_rsa.c engine/tb_store.c err/err.c err/err_all.c \ - err/err_prn.c evp/bio_b64.c evp/bio_enc.c evp/bio_md.c \ - evp/c_all.c evp/digest.c evp/e_aes.c evp/e_aes_cbc_hmac_sha1.c \ - evp/e_bf.c evp/e_camellia.c evp/e_cast.c evp/e_chacha.c \ + dsa/dsa_meth.c dsa/dsa_ossl.c dsa/dsa_pmeth.c dsa/dsa_prn.c \ + dsa/dsa_sign.c dsa/dsa_vrf.c dso/dso_dlfcn.c dso/dso_err.c \ + dso/dso_lib.c dso/dso_null.c dso/dso_openssl.c ec/ec2_mult.c \ + ec/ec2_oct.c ec/ec2_smpl.c ec/ec_ameth.c ec/ec_asn1.c \ + ec/ec_check.c ec/ec_curve.c ec/ec_cvt.c ec/ec_err.c \ + ec/ec_key.c ec/ec_kmeth.c ec/ec_lib.c ec/ec_mult.c ec/ec_oct.c \ + ec/ec_pmeth.c ec/ec_print.c ec/eck_prn.c ec/ecp_mont.c \ + ec/ecp_nist.c ec/ecp_oct.c ec/ecp_smpl.c ecdh/ech_err.c \ + ecdh/ech_key.c ecdh/ech_lib.c ecdsa/ecs_asn1.c ecdsa/ecs_err.c \ + ecdsa/ecs_lib.c ecdsa/ecs_ossl.c ecdsa/ecs_sign.c \ + ecdsa/ecs_vrf.c engine/eng_all.c engine/eng_cnf.c \ + engine/eng_ctrl.c engine/eng_dyn.c engine/eng_err.c \ + engine/eng_fat.c engine/eng_init.c engine/eng_lib.c \ + engine/eng_list.c engine/eng_openssl.c engine/eng_pkey.c \ + engine/eng_table.c engine/tb_asnmth.c engine/tb_cipher.c \ + engine/tb_dh.c engine/tb_digest.c engine/tb_dsa.c \ + engine/tb_ecdh.c engine/tb_ecdsa.c engine/tb_eckey.c \ + engine/tb_pkmeth.c engine/tb_rand.c engine/tb_rsa.c \ + engine/tb_store.c err/err.c err/err_all.c err/err_prn.c \ + evp/bio_b64.c evp/bio_enc.c evp/bio_md.c evp/c_all.c \ + evp/digest.c evp/e_aes.c evp/e_aes_cbc_hmac_sha1.c evp/e_bf.c \ + evp/e_camellia.c evp/e_cast.c evp/e_chacha.c \ evp/e_chacha20poly1305.c evp/e_des.c evp/e_des3.c \ evp/e_gost2814789.c evp/e_idea.c evp/e_null.c evp/e_old.c \ - evp/e_rc2.c evp/e_rc4.c evp/e_rc4_hmac_md5.c evp/e_xcbc_d.c \ - evp/encode.c evp/evp_aead.c evp/evp_enc.c evp/evp_err.c \ - evp/evp_key.c evp/evp_lib.c evp/evp_pbe.c evp/evp_pkey.c \ - evp/m_dss.c evp/m_dss1.c evp/m_ecdsa.c evp/m_gost2814789.c \ - evp/m_gostr341194.c evp/m_md4.c evp/m_md5.c evp/m_md5_sha1.c \ - evp/m_null.c evp/m_ripemd.c evp/m_sha1.c evp/m_sigver.c \ - evp/m_streebog.c evp/m_wp.c evp/names.c evp/p5_crpt.c \ - evp/p5_crpt2.c evp/p_dec.c evp/p_enc.c evp/p_lib.c \ - evp/p_open.c evp/p_seal.c evp/p_sign.c evp/p_verify.c \ - evp/pmeth_fn.c evp/pmeth_gn.c evp/pmeth_lib.c \ - gost/gost2814789.c gost/gost89_keywrap.c gost/gost89_params.c \ - gost/gost89imit_ameth.c gost/gost89imit_pmeth.c \ - gost/gost_asn1.c gost/gost_err.c gost/gostr341001.c \ - gost/gostr341001_ameth.c gost/gostr341001_key.c \ - gost/gostr341001_params.c gost/gostr341001_pmeth.c \ - gost/gostr341194.c gost/streebog.c hkdf/hkdf.c hmac/hm_ameth.c \ - hmac/hm_pmeth.c hmac/hmac.c idea/i_cbc.c idea/i_cfb64.c \ - idea/i_ecb.c idea/i_ofb64.c idea/i_skey.c lhash/lh_stats.c \ - lhash/lhash.c md4/md4_dgst.c md4/md4_one.c md5/md5_dgst.c \ - md5/md5_one.c modes/cbc128.c modes/ccm128.c modes/cfb128.c \ - modes/ctr128.c modes/cts128.c modes/gcm128.c modes/ofb128.c \ - modes/xts128.c objects/o_names.c objects/obj_dat.c \ - objects/obj_err.c objects/obj_lib.c objects/obj_xref.c \ - ocsp/ocsp_asn.c ocsp/ocsp_cl.c ocsp/ocsp_err.c ocsp/ocsp_ext.c \ - ocsp/ocsp_ht.c ocsp/ocsp_lib.c ocsp/ocsp_prn.c ocsp/ocsp_srv.c \ - ocsp/ocsp_vfy.c pem/pem_all.c pem/pem_err.c pem/pem_info.c \ - pem/pem_lib.c pem/pem_oth.c pem/pem_pk8.c pem/pem_pkey.c \ - pem/pem_seal.c pem/pem_sign.c pem/pem_x509.c pem/pem_xaux.c \ - pem/pvkfmt.c pkcs12/p12_add.c pkcs12/p12_asn.c \ - pkcs12/p12_attr.c pkcs12/p12_crpt.c pkcs12/p12_crt.c \ - pkcs12/p12_decr.c pkcs12/p12_init.c pkcs12/p12_key.c \ - pkcs12/p12_kiss.c pkcs12/p12_mutl.c pkcs12/p12_npas.c \ - pkcs12/p12_p8d.c pkcs12/p12_p8e.c pkcs12/p12_utl.c \ - pkcs12/pk12err.c pkcs7/bio_pk7.c pkcs7/pk7_asn1.c \ - pkcs7/pk7_attr.c pkcs7/pk7_doit.c pkcs7/pk7_lib.c \ - pkcs7/pk7_mime.c pkcs7/pk7_smime.c pkcs7/pkcs7err.c \ - poly1305/poly1305.c rand/rand_err.c rand/rand_lib.c \ - rand/randfile.c rc2/rc2_cbc.c rc2/rc2_ecb.c rc2/rc2_skey.c \ - rc2/rc2cfb64.c rc2/rc2ofb64.c ripemd/rmd_dgst.c \ + evp/e_rc2.c evp/e_rc4.c evp/e_rc4_hmac_md5.c evp/e_sm4.c \ + evp/e_xcbc_d.c evp/encode.c evp/evp_aead.c evp/evp_enc.c \ + evp/evp_err.c evp/evp_key.c evp/evp_lib.c evp/evp_pbe.c \ + evp/evp_pkey.c evp/m_dss.c evp/m_dss1.c evp/m_ecdsa.c \ + evp/m_gost2814789.c evp/m_gostr341194.c evp/m_md4.c \ + evp/m_md5.c evp/m_md5_sha1.c evp/m_null.c evp/m_ripemd.c \ + evp/m_sha1.c evp/m_sigver.c evp/m_streebog.c evp/m_sm3.c \ + evp/m_wp.c evp/names.c evp/p5_crpt.c evp/p5_crpt2.c \ + evp/p_dec.c evp/p_enc.c evp/p_lib.c evp/p_open.c evp/p_seal.c \ + evp/p_sign.c evp/p_verify.c evp/pmeth_fn.c evp/pmeth_gn.c \ + evp/pmeth_lib.c gost/gost2814789.c gost/gost89_keywrap.c \ + gost/gost89_params.c gost/gost89imit_ameth.c \ + gost/gost89imit_pmeth.c gost/gost_asn1.c gost/gost_err.c \ + gost/gostr341001.c gost/gostr341001_ameth.c \ + gost/gostr341001_key.c gost/gostr341001_params.c \ + gost/gostr341001_pmeth.c gost/gostr341194.c gost/streebog.c \ + hkdf/hkdf.c hmac/hm_ameth.c hmac/hm_pmeth.c hmac/hmac.c \ + idea/i_cbc.c idea/i_cfb64.c idea/i_ecb.c idea/i_ofb64.c \ + idea/i_skey.c lhash/lh_stats.c lhash/lhash.c md4/md4_dgst.c \ + md4/md4_one.c md5/md5_dgst.c md5/md5_one.c modes/cbc128.c \ + modes/ccm128.c modes/cfb128.c modes/ctr128.c modes/cts128.c \ + modes/gcm128.c modes/ofb128.c modes/xts128.c objects/o_names.c \ + objects/obj_dat.c objects/obj_err.c objects/obj_lib.c \ + objects/obj_xref.c ocsp/ocsp_asn.c ocsp/ocsp_cl.c \ + ocsp/ocsp_err.c ocsp/ocsp_ext.c ocsp/ocsp_ht.c ocsp/ocsp_lib.c \ + ocsp/ocsp_prn.c ocsp/ocsp_srv.c ocsp/ocsp_vfy.c pem/pem_all.c \ + pem/pem_err.c pem/pem_info.c pem/pem_lib.c pem/pem_oth.c \ + pem/pem_pk8.c pem/pem_pkey.c pem/pem_seal.c pem/pem_sign.c \ + pem/pem_x509.c pem/pem_xaux.c pem/pvkfmt.c pkcs12/p12_add.c \ + pkcs12/p12_asn.c pkcs12/p12_attr.c pkcs12/p12_crpt.c \ + pkcs12/p12_crt.c pkcs12/p12_decr.c pkcs12/p12_init.c \ + pkcs12/p12_key.c pkcs12/p12_kiss.c pkcs12/p12_mutl.c \ + pkcs12/p12_npas.c pkcs12/p12_p8d.c pkcs12/p12_p8e.c \ + pkcs12/p12_utl.c pkcs12/pk12err.c pkcs7/bio_pk7.c \ + pkcs7/pk7_asn1.c pkcs7/pk7_attr.c pkcs7/pk7_doit.c \ + pkcs7/pk7_lib.c pkcs7/pk7_mime.c pkcs7/pk7_smime.c \ + pkcs7/pkcs7err.c poly1305/poly1305.c rand/rand_err.c \ + rand/rand_lib.c rand/randfile.c rc2/rc2_cbc.c rc2/rc2_ecb.c \ + rc2/rc2_skey.c rc2/rc2cfb64.c rc2/rc2ofb64.c ripemd/rmd_dgst.c \ ripemd/rmd_one.c rsa/rsa_ameth.c rsa/rsa_asn1.c rsa/rsa_chk.c \ rsa/rsa_crpt.c rsa/rsa_depr.c rsa/rsa_eay.c rsa/rsa_err.c \ - rsa/rsa_gen.c rsa/rsa_lib.c rsa/rsa_none.c rsa/rsa_oaep.c \ - rsa/rsa_pk1.c rsa/rsa_pmeth.c rsa/rsa_prn.c rsa/rsa_pss.c \ - rsa/rsa_saos.c rsa/rsa_sign.c rsa/rsa_x931.c sha/sha1_one.c \ - sha/sha1dgst.c sha/sha256.c sha/sha512.c stack/stack.c \ - ts/ts_asn1.c ts/ts_conf.c ts/ts_err.c ts/ts_lib.c \ - ts/ts_req_print.c ts/ts_req_utils.c ts/ts_rsp_print.c \ - ts/ts_rsp_sign.c ts/ts_rsp_utils.c ts/ts_rsp_verify.c \ - ts/ts_verify_ctx.c txt_db/txt_db.c ui/ui_err.c ui/ui_lib.c \ - ui/ui_openssl.c ui/ui_openssl_win.c ui/ui_util.c \ - whrlpool/wp_dgst.c x509/by_dir.c x509/by_file.c x509/by_mem.c \ - x509/x509_att.c x509/x509_cmp.c x509/x509_d2.c x509/x509_def.c \ - x509/x509_err.c x509/x509_ext.c x509/x509_lu.c x509/x509_obj.c \ - x509/x509_r2x.c x509/x509_req.c x509/x509_set.c \ - x509/x509_trs.c x509/x509_txt.c x509/x509_v3.c x509/x509_vfy.c \ - x509/x509_vpm.c x509/x509cset.c x509/x509name.c \ - x509/x509rset.c x509/x509spki.c x509/x509type.c x509/x_all.c \ - x509v3/pcy_cache.c x509v3/pcy_data.c x509v3/pcy_lib.c \ - x509v3/pcy_map.c x509v3/pcy_node.c x509v3/pcy_tree.c \ - x509v3/v3_akey.c x509v3/v3_akeya.c x509v3/v3_alt.c \ - x509v3/v3_bcons.c x509v3/v3_bitst.c x509v3/v3_conf.c \ - x509v3/v3_cpols.c x509v3/v3_crld.c x509v3/v3_enum.c \ - x509v3/v3_extku.c x509v3/v3_genn.c x509v3/v3_ia5.c \ - x509v3/v3_info.c x509v3/v3_int.c x509v3/v3_lib.c \ - x509v3/v3_ncons.c x509v3/v3_ocsp.c x509v3/v3_pci.c \ - x509v3/v3_pcia.c x509v3/v3_pcons.c x509v3/v3_pku.c \ - x509v3/v3_pmaps.c x509v3/v3_prn.c x509v3/v3_purp.c \ - x509v3/v3_skey.c x509v3/v3_sxnet.c x509v3/v3_utl.c \ - x509v3/v3err.c -am__objects_27 = aes/libcrypto_la-aes-elf-x86_64.lo \ + rsa/rsa_gen.c rsa/rsa_lib.c rsa/rsa_meth.c rsa/rsa_none.c \ + rsa/rsa_oaep.c rsa/rsa_pk1.c rsa/rsa_pmeth.c rsa/rsa_prn.c \ + rsa/rsa_pss.c rsa/rsa_saos.c rsa/rsa_sign.c rsa/rsa_x931.c \ + sha/sha1_one.c sha/sha1dgst.c sha/sha256.c sha/sha512.c \ + sm3/sm3.c sm4/sm4.c stack/stack.c ts/ts_asn1.c ts/ts_conf.c \ + ts/ts_err.c ts/ts_lib.c ts/ts_req_print.c ts/ts_req_utils.c \ + ts/ts_rsp_print.c ts/ts_rsp_sign.c ts/ts_rsp_utils.c \ + ts/ts_rsp_verify.c ts/ts_verify_ctx.c txt_db/txt_db.c \ + ui/ui_err.c ui/ui_lib.c ui/ui_openssl.c ui/ui_openssl_win.c \ + ui/ui_util.c whrlpool/wp_dgst.c x509/by_dir.c x509/by_file.c \ + x509/by_mem.c x509/x509_att.c x509/x509_cmp.c x509/x509_d2.c \ + x509/x509_def.c x509/x509_err.c x509/x509_ext.c x509/x509_lu.c \ + x509/x509_obj.c x509/x509_r2x.c x509/x509_req.c \ + x509/x509_set.c x509/x509_trs.c x509/x509_txt.c x509/x509_v3.c \ + x509/x509_vfy.c x509/x509_vpm.c x509/x509cset.c \ + x509/x509name.c x509/x509rset.c x509/x509spki.c \ + x509/x509type.c x509/x_all.c x509v3/pcy_cache.c \ + x509v3/pcy_data.c x509v3/pcy_lib.c x509v3/pcy_map.c \ + x509v3/pcy_node.c x509v3/pcy_tree.c x509v3/v3_akey.c \ + x509v3/v3_akeya.c x509v3/v3_alt.c x509v3/v3_bcons.c \ + x509v3/v3_bitst.c x509v3/v3_conf.c x509v3/v3_cpols.c \ + x509v3/v3_crld.c x509v3/v3_enum.c x509v3/v3_extku.c \ + x509v3/v3_genn.c x509v3/v3_ia5.c x509v3/v3_info.c \ + x509v3/v3_int.c x509v3/v3_lib.c x509v3/v3_ncons.c \ + x509v3/v3_ocsp.c x509v3/v3_pci.c x509v3/v3_pcia.c \ + x509v3/v3_pcons.c x509v3/v3_pku.c x509v3/v3_pmaps.c \ + x509v3/v3_prn.c x509v3/v3_purp.c x509v3/v3_skey.c \ + x509v3/v3_sxnet.c x509v3/v3_utl.c x509v3/v3err.c +am__objects_30 = aes/libcrypto_la-aes-elf-armv4.lo \ + bn/libcrypto_la-gf2m-elf-armv4.lo \ + bn/libcrypto_la-mont-elf-armv4.lo \ + sha/libcrypto_la-sha1-elf-armv4.lo \ + sha/libcrypto_la-sha512-elf-armv4.lo \ + sha/libcrypto_la-sha256-elf-armv4.lo \ + modes/libcrypto_la-ghash-elf-armv4.lo \ + libcrypto_la-armv4cpuid.lo libcrypto_la-armcap.lo \ + aes/libcrypto_la-aes_cbc.lo camellia/libcrypto_la-camellia.lo \ + camellia/libcrypto_la-cmll_cbc.lo rc4/libcrypto_la-rc4_enc.lo \ + rc4/libcrypto_la-rc4_skey.lo whrlpool/libcrypto_la-wp_block.lo +@HOST_ASM_ELF_ARM_TRUE@am__objects_31 = $(am__objects_30) +am__objects_32 = aes/libcrypto_la-aes-elf-x86_64.lo \ aes/libcrypto_la-bsaes-elf-x86_64.lo \ aes/libcrypto_la-vpaes-elf-x86_64.lo \ aes/libcrypto_la-aesni-elf-x86_64.lo \ @@ -459,8 +527,8 @@ am__objects_27 = aes/libcrypto_la-aes-elf-x86_64.lo \ sha/libcrypto_la-sha512-elf-x86_64.lo \ whrlpool/libcrypto_la-wp-elf-x86_64.lo \ libcrypto_la-cpuid-elf-x86_64.lo -@HOST_ASM_ELF_X86_64_TRUE@am__objects_28 = $(am__objects_27) -am__objects_29 = aes/libcrypto_la-aes-macosx-x86_64.lo \ +@HOST_ASM_ELF_X86_64_TRUE@am__objects_33 = $(am__objects_32) +am__objects_34 = aes/libcrypto_la-aes-macosx-x86_64.lo \ aes/libcrypto_la-bsaes-macosx-x86_64.lo \ aes/libcrypto_la-vpaes-macosx-x86_64.lo \ aes/libcrypto_la-aesni-macosx-x86_64.lo \ @@ -479,22 +547,63 @@ am__objects_29 = aes/libcrypto_la-aes-macosx-x86_64.lo \ sha/libcrypto_la-sha512-macosx-x86_64.lo \ whrlpool/libcrypto_la-wp-macosx-x86_64.lo \ libcrypto_la-cpuid-macosx-x86_64.lo -@HOST_ASM_MACOSX_X86_64_TRUE@am__objects_30 = $(am__objects_29) -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@am__objects_31 = aes/libcrypto_la-aes_cbc.lo \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ aes/libcrypto_la-aes_core.lo \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ camellia/libcrypto_la-camellia.lo \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ camellia/libcrypto_la-cmll_cbc.lo \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ rc4/libcrypto_la-rc4_enc.lo \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ rc4/libcrypto_la-rc4_skey.lo \ -@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@ whrlpool/libcrypto_la-wp_block.lo -@HOST_WIN_FALSE@am__objects_32 = bio/libcrypto_la-b_posix.lo -@HOST_WIN_TRUE@am__objects_33 = bio/libcrypto_la-b_win.lo -@HOST_WIN_FALSE@am__objects_34 = bio/libcrypto_la-bss_log.lo -@HOST_WIN_FALSE@am__objects_35 = ui/libcrypto_la-ui_openssl.lo -@HOST_WIN_TRUE@am__objects_36 = ui/libcrypto_la-ui_openssl_win.lo -am_libcrypto_la_OBJECTS = $(am__objects_28) $(am__objects_30) \ - $(am__objects_31) libcrypto_la-cpt_err.lo \ - libcrypto_la-cryptlib.lo libcrypto_la-cversion.lo \ +@HOST_ASM_MACOSX_X86_64_TRUE@am__objects_35 = $(am__objects_34) +am__objects_36 = aes/libcrypto_la-aes-masm-x86_64.lo \ + aes/libcrypto_la-bsaes-masm-x86_64.lo \ + aes/libcrypto_la-vpaes-masm-x86_64.lo \ + aes/libcrypto_la-aesni-masm-x86_64.lo \ + aes/libcrypto_la-aesni-sha1-masm-x86_64.lo \ + bn/libcrypto_la-modexp512-masm-x86_64.lo \ + bn/libcrypto_la-mont-masm-x86_64.lo \ + bn/libcrypto_la-mont5-masm-x86_64.lo \ + bn/libcrypto_la-gf2m-masm-x86_64.lo \ + camellia/libcrypto_la-cmll-masm-x86_64.lo \ + md5/libcrypto_la-md5-masm-x86_64.lo \ + modes/libcrypto_la-ghash-masm-x86_64.lo \ + rc4/libcrypto_la-rc4-masm-x86_64.lo \ + rc4/libcrypto_la-rc4-md5-masm-x86_64.lo \ + sha/libcrypto_la-sha1-masm-x86_64.lo \ + sha/libcrypto_la-sha256-masm-x86_64.lo \ + sha/libcrypto_la-sha512-masm-x86_64.lo \ + whrlpool/libcrypto_la-wp-masm-x86_64.lo \ + libcrypto_la-cpuid-masm-x86_64.lo +@HOST_ASM_MASM_X86_64_TRUE@am__objects_37 = $(am__objects_36) +am__objects_38 = aes/libcrypto_la-aes-mingw64-x86_64.lo \ + aes/libcrypto_la-bsaes-mingw64-x86_64.lo \ + aes/libcrypto_la-vpaes-mingw64-x86_64.lo \ + aes/libcrypto_la-aesni-mingw64-x86_64.lo \ + aes/libcrypto_la-aesni-sha1-mingw64-x86_64.lo \ + camellia/libcrypto_la-cmll-mingw64-x86_64.lo \ + md5/libcrypto_la-md5-mingw64-x86_64.lo \ + modes/libcrypto_la-ghash-mingw64-x86_64.lo \ + rc4/libcrypto_la-rc4-mingw64-x86_64.lo \ + rc4/libcrypto_la-rc4-md5-mingw64-x86_64.lo \ + sha/libcrypto_la-sha1-mingw64-x86_64.lo \ + sha/libcrypto_la-sha256-mingw64-x86_64.lo \ + sha/libcrypto_la-sha512-mingw64-x86_64.lo \ + whrlpool/libcrypto_la-wp-mingw64-x86_64.lo \ + libcrypto_la-cpuid-mingw64-x86_64.lo +@HOST_ASM_MINGW64_X86_64_TRUE@am__objects_39 = $(am__objects_38) +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@am__objects_40 = aes/libcrypto_la-aes_cbc.lo \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ aes/libcrypto_la-aes_core.lo \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ camellia/libcrypto_la-camellia.lo \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ camellia/libcrypto_la-cmll_cbc.lo \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ rc4/libcrypto_la-rc4_enc.lo \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ rc4/libcrypto_la-rc4_skey.lo \ +@HOST_ASM_ELF_ARM_FALSE@@HOST_ASM_ELF_X86_64_FALSE@@HOST_ASM_MACOSX_X86_64_FALSE@@HOST_ASM_MASM_X86_64_FALSE@@HOST_ASM_MINGW64_X86_64_FALSE@ whrlpool/libcrypto_la-wp_block.lo +@HOST_WIN_FALSE@am__objects_41 = libcrypto_la-crypto_lock.lo +@HOST_WIN_TRUE@am__objects_42 = \ +@HOST_WIN_TRUE@ compat/libcrypto_la-crypto_lock_win.lo +@HOST_WIN_FALSE@am__objects_43 = bio/libcrypto_la-b_posix.lo +@HOST_WIN_TRUE@am__objects_44 = bio/libcrypto_la-b_win.lo +@HOST_WIN_FALSE@am__objects_45 = bio/libcrypto_la-bss_log.lo +@HOST_WIN_FALSE@am__objects_46 = ui/libcrypto_la-ui_openssl.lo +@HOST_WIN_TRUE@am__objects_47 = ui/libcrypto_la-ui_openssl_win.lo +am_libcrypto_la_OBJECTS = $(am__objects_31) $(am__objects_33) \ + $(am__objects_35) $(am__objects_37) $(am__objects_39) \ + $(am__objects_40) libcrypto_la-cpt_err.lo \ + libcrypto_la-cryptlib.lo libcrypto_la-crypto_init.lo \ + $(am__objects_41) $(am__objects_42) libcrypto_la-cversion.lo \ libcrypto_la-ex_data.lo libcrypto_la-malloc-wrapper.lo \ libcrypto_la-mem_clr.lo libcrypto_la-mem_dbg.lo \ libcrypto_la-o_init.lo libcrypto_la-o_str.lo \ @@ -503,12 +612,11 @@ am_libcrypto_la_OBJECTS = $(am__objects_28) $(am__objects_30) \ aes/libcrypto_la-aes_ige.lo aes/libcrypto_la-aes_misc.lo \ aes/libcrypto_la-aes_ofb.lo aes/libcrypto_la-aes_wrap.lo \ asn1/libcrypto_la-a_bitstr.lo asn1/libcrypto_la-a_bool.lo \ - asn1/libcrypto_la-a_bytes.lo asn1/libcrypto_la-a_d2i_fp.lo \ - asn1/libcrypto_la-a_digest.lo asn1/libcrypto_la-a_dup.lo \ - asn1/libcrypto_la-a_enum.lo asn1/libcrypto_la-a_i2d_fp.lo \ - asn1/libcrypto_la-a_int.lo asn1/libcrypto_la-a_mbstr.lo \ - asn1/libcrypto_la-a_object.lo asn1/libcrypto_la-a_octet.lo \ - asn1/libcrypto_la-a_print.lo asn1/libcrypto_la-a_set.lo \ + asn1/libcrypto_la-a_d2i_fp.lo asn1/libcrypto_la-a_digest.lo \ + asn1/libcrypto_la-a_dup.lo asn1/libcrypto_la-a_enum.lo \ + asn1/libcrypto_la-a_i2d_fp.lo asn1/libcrypto_la-a_int.lo \ + asn1/libcrypto_la-a_mbstr.lo asn1/libcrypto_la-a_object.lo \ + asn1/libcrypto_la-a_octet.lo asn1/libcrypto_la-a_print.lo \ asn1/libcrypto_la-a_sign.lo asn1/libcrypto_la-a_strex.lo \ asn1/libcrypto_la-a_strnid.lo asn1/libcrypto_la-a_time.lo \ asn1/libcrypto_la-a_time_tm.lo asn1/libcrypto_la-a_type.lo \ @@ -543,32 +651,32 @@ am_libcrypto_la_OBJECTS = $(am__objects_28) $(am__objects_30) \ bf/libcrypto_la-bf_cfb64.lo bf/libcrypto_la-bf_ecb.lo \ bf/libcrypto_la-bf_enc.lo bf/libcrypto_la-bf_ofb64.lo \ bf/libcrypto_la-bf_skey.lo bio/libcrypto_la-b_dump.lo \ - $(am__objects_32) bio/libcrypto_la-b_print.lo \ - bio/libcrypto_la-b_sock.lo $(am__objects_33) \ + $(am__objects_43) bio/libcrypto_la-b_print.lo \ + bio/libcrypto_la-b_sock.lo $(am__objects_44) \ bio/libcrypto_la-bf_buff.lo bio/libcrypto_la-bf_nbio.lo \ bio/libcrypto_la-bf_null.lo bio/libcrypto_la-bio_cb.lo \ bio/libcrypto_la-bio_err.lo bio/libcrypto_la-bio_lib.lo \ - bio/libcrypto_la-bss_acpt.lo bio/libcrypto_la-bss_bio.lo \ - bio/libcrypto_la-bss_conn.lo bio/libcrypto_la-bss_dgram.lo \ - bio/libcrypto_la-bss_fd.lo bio/libcrypto_la-bss_file.lo \ - $(am__objects_34) bio/libcrypto_la-bss_mem.lo \ - bio/libcrypto_la-bss_null.lo bio/libcrypto_la-bss_sock.lo \ - bn/libcrypto_la-bn_add.lo bn/libcrypto_la-bn_asm.lo \ - bn/libcrypto_la-bn_blind.lo bn/libcrypto_la-bn_const.lo \ - bn/libcrypto_la-bn_ctx.lo bn/libcrypto_la-bn_depr.lo \ - bn/libcrypto_la-bn_div.lo bn/libcrypto_la-bn_err.lo \ - bn/libcrypto_la-bn_exp.lo bn/libcrypto_la-bn_exp2.lo \ - bn/libcrypto_la-bn_gcd.lo bn/libcrypto_la-bn_gf2m.lo \ - bn/libcrypto_la-bn_kron.lo bn/libcrypto_la-bn_lib.lo \ - bn/libcrypto_la-bn_mod.lo bn/libcrypto_la-bn_mont.lo \ - bn/libcrypto_la-bn_mpi.lo bn/libcrypto_la-bn_mul.lo \ - bn/libcrypto_la-bn_nist.lo bn/libcrypto_la-bn_prime.lo \ - bn/libcrypto_la-bn_print.lo bn/libcrypto_la-bn_rand.lo \ - bn/libcrypto_la-bn_recp.lo bn/libcrypto_la-bn_shift.lo \ - bn/libcrypto_la-bn_sqr.lo bn/libcrypto_la-bn_sqrt.lo \ - bn/libcrypto_la-bn_word.lo bn/libcrypto_la-bn_x931p.lo \ - buffer/libcrypto_la-buf_err.lo buffer/libcrypto_la-buf_str.lo \ - buffer/libcrypto_la-buffer.lo \ + bio/libcrypto_la-bio_meth.lo bio/libcrypto_la-bss_acpt.lo \ + bio/libcrypto_la-bss_bio.lo bio/libcrypto_la-bss_conn.lo \ + bio/libcrypto_la-bss_dgram.lo bio/libcrypto_la-bss_fd.lo \ + bio/libcrypto_la-bss_file.lo $(am__objects_45) \ + bio/libcrypto_la-bss_mem.lo bio/libcrypto_la-bss_null.lo \ + bio/libcrypto_la-bss_sock.lo bn/libcrypto_la-bn_add.lo \ + bn/libcrypto_la-bn_asm.lo bn/libcrypto_la-bn_blind.lo \ + bn/libcrypto_la-bn_const.lo bn/libcrypto_la-bn_ctx.lo \ + bn/libcrypto_la-bn_depr.lo bn/libcrypto_la-bn_div.lo \ + bn/libcrypto_la-bn_err.lo bn/libcrypto_la-bn_exp.lo \ + bn/libcrypto_la-bn_exp2.lo bn/libcrypto_la-bn_gcd.lo \ + bn/libcrypto_la-bn_gf2m.lo bn/libcrypto_la-bn_kron.lo \ + bn/libcrypto_la-bn_lib.lo bn/libcrypto_la-bn_mod.lo \ + bn/libcrypto_la-bn_mont.lo bn/libcrypto_la-bn_mpi.lo \ + bn/libcrypto_la-bn_mul.lo bn/libcrypto_la-bn_nist.lo \ + bn/libcrypto_la-bn_prime.lo bn/libcrypto_la-bn_print.lo \ + bn/libcrypto_la-bn_rand.lo bn/libcrypto_la-bn_recp.lo \ + bn/libcrypto_la-bn_shift.lo bn/libcrypto_la-bn_sqr.lo \ + bn/libcrypto_la-bn_sqrt.lo bn/libcrypto_la-bn_word.lo \ + bn/libcrypto_la-bn_x931p.lo buffer/libcrypto_la-buf_err.lo \ + buffer/libcrypto_la-buf_str.lo buffer/libcrypto_la-buffer.lo \ camellia/libcrypto_la-cmll_cfb.lo \ camellia/libcrypto_la-cmll_ctr.lo \ camellia/libcrypto_la-cmll_ecb.lo \ @@ -605,17 +713,18 @@ am_libcrypto_la_OBJECTS = $(am__objects_28) $(am__objects_30) \ dsa/libcrypto_la-dsa_ameth.lo dsa/libcrypto_la-dsa_asn1.lo \ dsa/libcrypto_la-dsa_depr.lo dsa/libcrypto_la-dsa_err.lo \ dsa/libcrypto_la-dsa_gen.lo dsa/libcrypto_la-dsa_key.lo \ - dsa/libcrypto_la-dsa_lib.lo dsa/libcrypto_la-dsa_ossl.lo \ - dsa/libcrypto_la-dsa_pmeth.lo dsa/libcrypto_la-dsa_prn.lo \ - dsa/libcrypto_la-dsa_sign.lo dsa/libcrypto_la-dsa_vrf.lo \ - dso/libcrypto_la-dso_dlfcn.lo dso/libcrypto_la-dso_err.lo \ - dso/libcrypto_la-dso_lib.lo dso/libcrypto_la-dso_null.lo \ - dso/libcrypto_la-dso_openssl.lo ec/libcrypto_la-ec2_mult.lo \ - ec/libcrypto_la-ec2_oct.lo ec/libcrypto_la-ec2_smpl.lo \ - ec/libcrypto_la-ec_ameth.lo ec/libcrypto_la-ec_asn1.lo \ - ec/libcrypto_la-ec_check.lo ec/libcrypto_la-ec_curve.lo \ - ec/libcrypto_la-ec_cvt.lo ec/libcrypto_la-ec_err.lo \ - ec/libcrypto_la-ec_key.lo ec/libcrypto_la-ec_lib.lo \ + dsa/libcrypto_la-dsa_lib.lo dsa/libcrypto_la-dsa_meth.lo \ + dsa/libcrypto_la-dsa_ossl.lo dsa/libcrypto_la-dsa_pmeth.lo \ + dsa/libcrypto_la-dsa_prn.lo dsa/libcrypto_la-dsa_sign.lo \ + dsa/libcrypto_la-dsa_vrf.lo dso/libcrypto_la-dso_dlfcn.lo \ + dso/libcrypto_la-dso_err.lo dso/libcrypto_la-dso_lib.lo \ + dso/libcrypto_la-dso_null.lo dso/libcrypto_la-dso_openssl.lo \ + ec/libcrypto_la-ec2_mult.lo ec/libcrypto_la-ec2_oct.lo \ + ec/libcrypto_la-ec2_smpl.lo ec/libcrypto_la-ec_ameth.lo \ + ec/libcrypto_la-ec_asn1.lo ec/libcrypto_la-ec_check.lo \ + ec/libcrypto_la-ec_curve.lo ec/libcrypto_la-ec_cvt.lo \ + ec/libcrypto_la-ec_err.lo ec/libcrypto_la-ec_key.lo \ + ec/libcrypto_la-ec_kmeth.lo ec/libcrypto_la-ec_lib.lo \ ec/libcrypto_la-ec_mult.lo ec/libcrypto_la-ec_oct.lo \ ec/libcrypto_la-ec_pmeth.lo ec/libcrypto_la-ec_print.lo \ ec/libcrypto_la-eck_prn.lo ec/libcrypto_la-ecp_mont.lo \ @@ -637,6 +746,7 @@ am_libcrypto_la_OBJECTS = $(am__objects_28) $(am__objects_30) \ engine/libcrypto_la-tb_cipher.lo engine/libcrypto_la-tb_dh.lo \ engine/libcrypto_la-tb_digest.lo engine/libcrypto_la-tb_dsa.lo \ engine/libcrypto_la-tb_ecdh.lo engine/libcrypto_la-tb_ecdsa.lo \ + engine/libcrypto_la-tb_eckey.lo \ engine/libcrypto_la-tb_pkmeth.lo \ engine/libcrypto_la-tb_rand.lo engine/libcrypto_la-tb_rsa.lo \ engine/libcrypto_la-tb_store.lo err/libcrypto_la-err.lo \ @@ -652,7 +762,7 @@ am_libcrypto_la_OBJECTS = $(am__objects_28) $(am__objects_30) \ evp/libcrypto_la-e_gost2814789.lo evp/libcrypto_la-e_idea.lo \ evp/libcrypto_la-e_null.lo evp/libcrypto_la-e_old.lo \ evp/libcrypto_la-e_rc2.lo evp/libcrypto_la-e_rc4.lo \ - evp/libcrypto_la-e_rc4_hmac_md5.lo \ + evp/libcrypto_la-e_rc4_hmac_md5.lo evp/libcrypto_la-e_sm4.lo \ evp/libcrypto_la-e_xcbc_d.lo evp/libcrypto_la-encode.lo \ evp/libcrypto_la-evp_aead.lo evp/libcrypto_la-evp_enc.lo \ evp/libcrypto_la-evp_err.lo evp/libcrypto_la-evp_key.lo \ @@ -664,14 +774,15 @@ am_libcrypto_la_OBJECTS = $(am__objects_28) $(am__objects_30) \ evp/libcrypto_la-m_md5.lo evp/libcrypto_la-m_md5_sha1.lo \ evp/libcrypto_la-m_null.lo evp/libcrypto_la-m_ripemd.lo \ evp/libcrypto_la-m_sha1.lo evp/libcrypto_la-m_sigver.lo \ - evp/libcrypto_la-m_streebog.lo evp/libcrypto_la-m_wp.lo \ - evp/libcrypto_la-names.lo evp/libcrypto_la-p5_crpt.lo \ - evp/libcrypto_la-p5_crpt2.lo evp/libcrypto_la-p_dec.lo \ - evp/libcrypto_la-p_enc.lo evp/libcrypto_la-p_lib.lo \ - evp/libcrypto_la-p_open.lo evp/libcrypto_la-p_seal.lo \ - evp/libcrypto_la-p_sign.lo evp/libcrypto_la-p_verify.lo \ - evp/libcrypto_la-pmeth_fn.lo evp/libcrypto_la-pmeth_gn.lo \ - evp/libcrypto_la-pmeth_lib.lo gost/libcrypto_la-gost2814789.lo \ + evp/libcrypto_la-m_streebog.lo evp/libcrypto_la-m_sm3.lo \ + evp/libcrypto_la-m_wp.lo evp/libcrypto_la-names.lo \ + evp/libcrypto_la-p5_crpt.lo evp/libcrypto_la-p5_crpt2.lo \ + evp/libcrypto_la-p_dec.lo evp/libcrypto_la-p_enc.lo \ + evp/libcrypto_la-p_lib.lo evp/libcrypto_la-p_open.lo \ + evp/libcrypto_la-p_seal.lo evp/libcrypto_la-p_sign.lo \ + evp/libcrypto_la-p_verify.lo evp/libcrypto_la-pmeth_fn.lo \ + evp/libcrypto_la-pmeth_gn.lo evp/libcrypto_la-pmeth_lib.lo \ + gost/libcrypto_la-gost2814789.lo \ gost/libcrypto_la-gost89_keywrap.lo \ gost/libcrypto_la-gost89_params.lo \ gost/libcrypto_la-gost89imit_ameth.lo \ @@ -733,23 +844,25 @@ am_libcrypto_la_OBJECTS = $(am__objects_28) $(am__objects_30) \ rsa/libcrypto_la-rsa_chk.lo rsa/libcrypto_la-rsa_crpt.lo \ rsa/libcrypto_la-rsa_depr.lo rsa/libcrypto_la-rsa_eay.lo \ rsa/libcrypto_la-rsa_err.lo rsa/libcrypto_la-rsa_gen.lo \ - rsa/libcrypto_la-rsa_lib.lo rsa/libcrypto_la-rsa_none.lo \ - rsa/libcrypto_la-rsa_oaep.lo rsa/libcrypto_la-rsa_pk1.lo \ - rsa/libcrypto_la-rsa_pmeth.lo rsa/libcrypto_la-rsa_prn.lo \ - rsa/libcrypto_la-rsa_pss.lo rsa/libcrypto_la-rsa_saos.lo \ - rsa/libcrypto_la-rsa_sign.lo rsa/libcrypto_la-rsa_x931.lo \ - sha/libcrypto_la-sha1_one.lo sha/libcrypto_la-sha1dgst.lo \ - sha/libcrypto_la-sha256.lo sha/libcrypto_la-sha512.lo \ - stack/libcrypto_la-stack.lo ts/libcrypto_la-ts_asn1.lo \ - ts/libcrypto_la-ts_conf.lo ts/libcrypto_la-ts_err.lo \ - ts/libcrypto_la-ts_lib.lo ts/libcrypto_la-ts_req_print.lo \ + rsa/libcrypto_la-rsa_lib.lo rsa/libcrypto_la-rsa_meth.lo \ + rsa/libcrypto_la-rsa_none.lo rsa/libcrypto_la-rsa_oaep.lo \ + rsa/libcrypto_la-rsa_pk1.lo rsa/libcrypto_la-rsa_pmeth.lo \ + rsa/libcrypto_la-rsa_prn.lo rsa/libcrypto_la-rsa_pss.lo \ + rsa/libcrypto_la-rsa_saos.lo rsa/libcrypto_la-rsa_sign.lo \ + rsa/libcrypto_la-rsa_x931.lo sha/libcrypto_la-sha1_one.lo \ + sha/libcrypto_la-sha1dgst.lo sha/libcrypto_la-sha256.lo \ + sha/libcrypto_la-sha512.lo sm3/libcrypto_la-sm3.lo \ + sm4/libcrypto_la-sm4.lo stack/libcrypto_la-stack.lo \ + ts/libcrypto_la-ts_asn1.lo ts/libcrypto_la-ts_conf.lo \ + ts/libcrypto_la-ts_err.lo ts/libcrypto_la-ts_lib.lo \ + ts/libcrypto_la-ts_req_print.lo \ ts/libcrypto_la-ts_req_utils.lo \ ts/libcrypto_la-ts_rsp_print.lo ts/libcrypto_la-ts_rsp_sign.lo \ ts/libcrypto_la-ts_rsp_utils.lo \ ts/libcrypto_la-ts_rsp_verify.lo \ ts/libcrypto_la-ts_verify_ctx.lo txt_db/libcrypto_la-txt_db.lo \ ui/libcrypto_la-ui_err.lo ui/libcrypto_la-ui_lib.lo \ - $(am__objects_35) $(am__objects_36) ui/libcrypto_la-ui_util.lo \ + $(am__objects_46) $(am__objects_47) ui/libcrypto_la-ui_util.lo \ whrlpool/libcrypto_la-wp_dgst.lo x509/libcrypto_la-by_dir.lo \ x509/libcrypto_la-by_file.lo x509/libcrypto_la-by_mem.lo \ x509/libcrypto_la-x509_att.lo x509/libcrypto_la-x509_cmp.lo \ @@ -799,11 +912,674 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/libcrypto_la-armcap.Plo \ + ./$(DEPDIR)/libcrypto_la-armv4cpuid.Plo \ + ./$(DEPDIR)/libcrypto_la-cpt_err.Plo \ + ./$(DEPDIR)/libcrypto_la-cpuid-elf-x86_64.Plo \ + ./$(DEPDIR)/libcrypto_la-cpuid-macosx-x86_64.Plo \ + ./$(DEPDIR)/libcrypto_la-cpuid-masm-x86_64.Plo \ + ./$(DEPDIR)/libcrypto_la-cpuid-mingw64-x86_64.Plo \ + ./$(DEPDIR)/libcrypto_la-cryptlib.Plo \ + ./$(DEPDIR)/libcrypto_la-crypto_init.Plo \ + ./$(DEPDIR)/libcrypto_la-crypto_lock.Plo \ + ./$(DEPDIR)/libcrypto_la-cversion.Plo \ + ./$(DEPDIR)/libcrypto_la-ex_data.Plo \ + ./$(DEPDIR)/libcrypto_la-malloc-wrapper.Plo \ + ./$(DEPDIR)/libcrypto_la-mem_clr.Plo \ + ./$(DEPDIR)/libcrypto_la-mem_dbg.Plo \ + ./$(DEPDIR)/libcrypto_la-o_init.Plo \ + ./$(DEPDIR)/libcrypto_la-o_str.Plo \ + ./$(DEPDIR)/libcrypto_la-o_time.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes-elf-armv4.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes-elf-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes-macosx-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes-masm-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes-mingw64-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes_cbc.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes_cfb.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes_core.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes_ctr.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes_ecb.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes_ige.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes_misc.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes_ofb.Plo \ + aes/$(DEPDIR)/libcrypto_la-aes_wrap.Plo \ + aes/$(DEPDIR)/libcrypto_la-aesni-elf-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aesni-macosx-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aesni-masm-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aesni-mingw64-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aesni-sha1-elf-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aesni-sha1-macosx-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aesni-sha1-masm-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-aesni-sha1-mingw64-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-bsaes-elf-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-bsaes-macosx-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-bsaes-masm-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-bsaes-mingw64-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-vpaes-elf-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-vpaes-macosx-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-vpaes-masm-x86_64.Plo \ + aes/$(DEPDIR)/libcrypto_la-vpaes-mingw64-x86_64.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_bitstr.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_bool.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_d2i_fp.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_digest.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_dup.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_enum.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_i2d_fp.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_int.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_mbstr.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_object.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_octet.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_print.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_sign.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_strex.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_strnid.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_time.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_time_tm.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_type.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_utf8.Plo \ + asn1/$(DEPDIR)/libcrypto_la-a_verify.Plo \ + asn1/$(DEPDIR)/libcrypto_la-ameth_lib.Plo \ + asn1/$(DEPDIR)/libcrypto_la-asn1_err.Plo \ + asn1/$(DEPDIR)/libcrypto_la-asn1_gen.Plo \ + asn1/$(DEPDIR)/libcrypto_la-asn1_lib.Plo \ + asn1/$(DEPDIR)/libcrypto_la-asn1_par.Plo \ + asn1/$(DEPDIR)/libcrypto_la-asn_mime.Plo \ + asn1/$(DEPDIR)/libcrypto_la-asn_moid.Plo \ + asn1/$(DEPDIR)/libcrypto_la-asn_pack.Plo \ + asn1/$(DEPDIR)/libcrypto_la-bio_asn1.Plo \ + asn1/$(DEPDIR)/libcrypto_la-bio_ndef.Plo \ + asn1/$(DEPDIR)/libcrypto_la-d2i_pr.Plo \ + asn1/$(DEPDIR)/libcrypto_la-d2i_pu.Plo \ + asn1/$(DEPDIR)/libcrypto_la-evp_asn1.Plo \ + asn1/$(DEPDIR)/libcrypto_la-f_enum.Plo \ + asn1/$(DEPDIR)/libcrypto_la-f_int.Plo \ + asn1/$(DEPDIR)/libcrypto_la-f_string.Plo \ + asn1/$(DEPDIR)/libcrypto_la-i2d_pr.Plo \ + asn1/$(DEPDIR)/libcrypto_la-i2d_pu.Plo \ + asn1/$(DEPDIR)/libcrypto_la-n_pkey.Plo \ + asn1/$(DEPDIR)/libcrypto_la-nsseq.Plo \ + asn1/$(DEPDIR)/libcrypto_la-p5_pbe.Plo \ + asn1/$(DEPDIR)/libcrypto_la-p5_pbev2.Plo \ + asn1/$(DEPDIR)/libcrypto_la-p8_pkey.Plo \ + asn1/$(DEPDIR)/libcrypto_la-t_bitst.Plo \ + asn1/$(DEPDIR)/libcrypto_la-t_crl.Plo \ + asn1/$(DEPDIR)/libcrypto_la-t_pkey.Plo \ + asn1/$(DEPDIR)/libcrypto_la-t_req.Plo \ + asn1/$(DEPDIR)/libcrypto_la-t_spki.Plo \ + asn1/$(DEPDIR)/libcrypto_la-t_x509.Plo \ + asn1/$(DEPDIR)/libcrypto_la-t_x509a.Plo \ + asn1/$(DEPDIR)/libcrypto_la-tasn_dec.Plo \ + asn1/$(DEPDIR)/libcrypto_la-tasn_enc.Plo \ + asn1/$(DEPDIR)/libcrypto_la-tasn_fre.Plo \ + asn1/$(DEPDIR)/libcrypto_la-tasn_new.Plo \ + asn1/$(DEPDIR)/libcrypto_la-tasn_prn.Plo \ + asn1/$(DEPDIR)/libcrypto_la-tasn_typ.Plo \ + asn1/$(DEPDIR)/libcrypto_la-tasn_utl.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_algor.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_attrib.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_bignum.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_crl.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_exten.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_info.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_long.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_name.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_nx509.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_pkey.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_pubkey.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_req.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_sig.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_spki.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_val.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_x509.Plo \ + asn1/$(DEPDIR)/libcrypto_la-x_x509a.Plo \ + bf/$(DEPDIR)/libcrypto_la-bf_cfb64.Plo \ + bf/$(DEPDIR)/libcrypto_la-bf_ecb.Plo \ + bf/$(DEPDIR)/libcrypto_la-bf_enc.Plo \ + bf/$(DEPDIR)/libcrypto_la-bf_ofb64.Plo \ + bf/$(DEPDIR)/libcrypto_la-bf_skey.Plo \ + bio/$(DEPDIR)/libcrypto_la-b_dump.Plo \ + bio/$(DEPDIR)/libcrypto_la-b_posix.Plo \ + bio/$(DEPDIR)/libcrypto_la-b_print.Plo \ + bio/$(DEPDIR)/libcrypto_la-b_sock.Plo \ + bio/$(DEPDIR)/libcrypto_la-b_win.Plo \ + bio/$(DEPDIR)/libcrypto_la-bf_buff.Plo \ + bio/$(DEPDIR)/libcrypto_la-bf_nbio.Plo \ + bio/$(DEPDIR)/libcrypto_la-bf_null.Plo \ + bio/$(DEPDIR)/libcrypto_la-bio_cb.Plo \ + bio/$(DEPDIR)/libcrypto_la-bio_err.Plo \ + bio/$(DEPDIR)/libcrypto_la-bio_lib.Plo \ + bio/$(DEPDIR)/libcrypto_la-bio_meth.Plo \ + bio/$(DEPDIR)/libcrypto_la-bss_acpt.Plo \ + bio/$(DEPDIR)/libcrypto_la-bss_bio.Plo \ + bio/$(DEPDIR)/libcrypto_la-bss_conn.Plo \ + bio/$(DEPDIR)/libcrypto_la-bss_dgram.Plo \ + bio/$(DEPDIR)/libcrypto_la-bss_fd.Plo \ + bio/$(DEPDIR)/libcrypto_la-bss_file.Plo \ + bio/$(DEPDIR)/libcrypto_la-bss_log.Plo \ + bio/$(DEPDIR)/libcrypto_la-bss_mem.Plo \ + bio/$(DEPDIR)/libcrypto_la-bss_null.Plo \ + bio/$(DEPDIR)/libcrypto_la-bss_sock.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_add.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_asm.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_blind.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_const.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_ctx.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_depr.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_div.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_err.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_exp.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_exp2.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_gcd.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_gf2m.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_kron.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_lib.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_mod.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_mont.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_mpi.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_mul.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_nist.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_prime.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_print.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_rand.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_recp.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_shift.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_sqr.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_sqrt.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_word.Plo \ + bn/$(DEPDIR)/libcrypto_la-bn_x931p.Plo \ + bn/$(DEPDIR)/libcrypto_la-gf2m-elf-armv4.Plo \ + bn/$(DEPDIR)/libcrypto_la-gf2m-elf-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-gf2m-macosx-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-gf2m-masm-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-modexp512-elf-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-modexp512-macosx-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-modexp512-masm-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-mont-elf-armv4.Plo \ + bn/$(DEPDIR)/libcrypto_la-mont-elf-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-mont-macosx-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-mont-masm-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-mont5-elf-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-mont5-macosx-x86_64.Plo \ + bn/$(DEPDIR)/libcrypto_la-mont5-masm-x86_64.Plo \ + buffer/$(DEPDIR)/libcrypto_la-buf_err.Plo \ + buffer/$(DEPDIR)/libcrypto_la-buf_str.Plo \ + buffer/$(DEPDIR)/libcrypto_la-buffer.Plo \ + camellia/$(DEPDIR)/libcrypto_la-camellia.Plo \ + camellia/$(DEPDIR)/libcrypto_la-cmll-elf-x86_64.Plo \ + camellia/$(DEPDIR)/libcrypto_la-cmll-macosx-x86_64.Plo \ + camellia/$(DEPDIR)/libcrypto_la-cmll-masm-x86_64.Plo \ + camellia/$(DEPDIR)/libcrypto_la-cmll-mingw64-x86_64.Plo \ + camellia/$(DEPDIR)/libcrypto_la-cmll_cbc.Plo \ + camellia/$(DEPDIR)/libcrypto_la-cmll_cfb.Plo \ + camellia/$(DEPDIR)/libcrypto_la-cmll_ctr.Plo \ + camellia/$(DEPDIR)/libcrypto_la-cmll_ecb.Plo \ + camellia/$(DEPDIR)/libcrypto_la-cmll_misc.Plo \ + camellia/$(DEPDIR)/libcrypto_la-cmll_ofb.Plo \ + cast/$(DEPDIR)/libcrypto_la-c_cfb64.Plo \ + cast/$(DEPDIR)/libcrypto_la-c_ecb.Plo \ + cast/$(DEPDIR)/libcrypto_la-c_enc.Plo \ + cast/$(DEPDIR)/libcrypto_la-c_ofb64.Plo \ + cast/$(DEPDIR)/libcrypto_la-c_skey.Plo \ + chacha/$(DEPDIR)/libcrypto_la-chacha-merged.Plo \ + chacha/$(DEPDIR)/libcrypto_la-chacha.Plo \ + cmac/$(DEPDIR)/libcrypto_la-cm_ameth.Plo \ + cmac/$(DEPDIR)/libcrypto_la-cm_pmeth.Plo \ + cmac/$(DEPDIR)/libcrypto_la-cmac.Plo \ + comp/$(DEPDIR)/libcrypto_la-c_rle.Plo \ + comp/$(DEPDIR)/libcrypto_la-c_zlib.Plo \ + comp/$(DEPDIR)/libcrypto_la-comp_err.Plo \ + comp/$(DEPDIR)/libcrypto_la-comp_lib.Plo \ + compat/$(DEPDIR)/arc4random.Plo \ + compat/$(DEPDIR)/arc4random_uniform.Plo \ + compat/$(DEPDIR)/bsd-asprintf.Plo \ + compat/$(DEPDIR)/freezero.Plo \ + compat/$(DEPDIR)/getentropy_aix.Plo \ + compat/$(DEPDIR)/getentropy_freebsd.Plo \ + compat/$(DEPDIR)/getentropy_hpux.Plo \ + compat/$(DEPDIR)/getentropy_linux.Plo \ + compat/$(DEPDIR)/getentropy_netbsd.Plo \ + compat/$(DEPDIR)/getentropy_osx.Plo \ + compat/$(DEPDIR)/getentropy_solaris.Plo \ + compat/$(DEPDIR)/getentropy_win.Plo \ + compat/$(DEPDIR)/getpagesize.Plo \ + compat/$(DEPDIR)/getprogname_linux.Plo \ + compat/$(DEPDIR)/getprogname_unimpl.Plo \ + compat/$(DEPDIR)/getprogname_windows.Plo \ + compat/$(DEPDIR)/libcompatnoopt_la-explicit_bzero.Plo \ + compat/$(DEPDIR)/libcompatnoopt_la-explicit_bzero_win.Plo \ + compat/$(DEPDIR)/libcrypto_la-crypto_lock_win.Plo \ + compat/$(DEPDIR)/posix_win.Plo \ + compat/$(DEPDIR)/reallocarray.Plo \ + compat/$(DEPDIR)/recallocarray.Plo \ + compat/$(DEPDIR)/strlcat.Plo compat/$(DEPDIR)/strlcpy.Plo \ + compat/$(DEPDIR)/strndup.Plo compat/$(DEPDIR)/strnlen.Plo \ + compat/$(DEPDIR)/strsep.Plo compat/$(DEPDIR)/syslog_r.Plo \ + compat/$(DEPDIR)/timegm.Plo \ + compat/$(DEPDIR)/timingsafe_bcmp.Plo \ + compat/$(DEPDIR)/timingsafe_memcmp.Plo \ + conf/$(DEPDIR)/libcrypto_la-conf_api.Plo \ + conf/$(DEPDIR)/libcrypto_la-conf_def.Plo \ + conf/$(DEPDIR)/libcrypto_la-conf_err.Plo \ + conf/$(DEPDIR)/libcrypto_la-conf_lib.Plo \ + conf/$(DEPDIR)/libcrypto_la-conf_mall.Plo \ + conf/$(DEPDIR)/libcrypto_la-conf_mod.Plo \ + conf/$(DEPDIR)/libcrypto_la-conf_sap.Plo \ + curve25519/$(DEPDIR)/libcrypto_la-curve25519-generic.Plo \ + curve25519/$(DEPDIR)/libcrypto_la-curve25519.Plo \ + des/$(DEPDIR)/libcrypto_la-cbc_cksm.Plo \ + des/$(DEPDIR)/libcrypto_la-cbc_enc.Plo \ + des/$(DEPDIR)/libcrypto_la-cfb64ede.Plo \ + des/$(DEPDIR)/libcrypto_la-cfb64enc.Plo \ + des/$(DEPDIR)/libcrypto_la-cfb_enc.Plo \ + des/$(DEPDIR)/libcrypto_la-des_enc.Plo \ + des/$(DEPDIR)/libcrypto_la-ecb3_enc.Plo \ + des/$(DEPDIR)/libcrypto_la-ecb_enc.Plo \ + des/$(DEPDIR)/libcrypto_la-ede_cbcm_enc.Plo \ + des/$(DEPDIR)/libcrypto_la-enc_read.Plo \ + des/$(DEPDIR)/libcrypto_la-enc_writ.Plo \ + des/$(DEPDIR)/libcrypto_la-fcrypt.Plo \ + des/$(DEPDIR)/libcrypto_la-fcrypt_b.Plo \ + des/$(DEPDIR)/libcrypto_la-ncbc_enc.Plo \ + des/$(DEPDIR)/libcrypto_la-ofb64ede.Plo \ + des/$(DEPDIR)/libcrypto_la-ofb64enc.Plo \ + des/$(DEPDIR)/libcrypto_la-ofb_enc.Plo \ + des/$(DEPDIR)/libcrypto_la-pcbc_enc.Plo \ + des/$(DEPDIR)/libcrypto_la-qud_cksm.Plo \ + des/$(DEPDIR)/libcrypto_la-rand_key.Plo \ + des/$(DEPDIR)/libcrypto_la-set_key.Plo \ + des/$(DEPDIR)/libcrypto_la-str2key.Plo \ + des/$(DEPDIR)/libcrypto_la-xcbc_enc.Plo \ + dh/$(DEPDIR)/libcrypto_la-dh_ameth.Plo \ + dh/$(DEPDIR)/libcrypto_la-dh_asn1.Plo \ + dh/$(DEPDIR)/libcrypto_la-dh_check.Plo \ + dh/$(DEPDIR)/libcrypto_la-dh_depr.Plo \ + dh/$(DEPDIR)/libcrypto_la-dh_err.Plo \ + dh/$(DEPDIR)/libcrypto_la-dh_gen.Plo \ + dh/$(DEPDIR)/libcrypto_la-dh_key.Plo \ + dh/$(DEPDIR)/libcrypto_la-dh_lib.Plo \ + dh/$(DEPDIR)/libcrypto_la-dh_pmeth.Plo \ + dh/$(DEPDIR)/libcrypto_la-dh_prn.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_ameth.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_asn1.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_depr.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_err.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_gen.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_key.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_lib.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_meth.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_ossl.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_pmeth.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_prn.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_sign.Plo \ + dsa/$(DEPDIR)/libcrypto_la-dsa_vrf.Plo \ + dso/$(DEPDIR)/libcrypto_la-dso_dlfcn.Plo \ + dso/$(DEPDIR)/libcrypto_la-dso_err.Plo \ + dso/$(DEPDIR)/libcrypto_la-dso_lib.Plo \ + dso/$(DEPDIR)/libcrypto_la-dso_null.Plo \ + dso/$(DEPDIR)/libcrypto_la-dso_openssl.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec2_mult.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec2_oct.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec2_smpl.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_ameth.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_asn1.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_check.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_curve.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_cvt.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_err.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_key.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_kmeth.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_lib.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_mult.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_oct.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_pmeth.Plo \ + ec/$(DEPDIR)/libcrypto_la-ec_print.Plo \ + ec/$(DEPDIR)/libcrypto_la-eck_prn.Plo \ + ec/$(DEPDIR)/libcrypto_la-ecp_mont.Plo \ + ec/$(DEPDIR)/libcrypto_la-ecp_nist.Plo \ + ec/$(DEPDIR)/libcrypto_la-ecp_oct.Plo \ + ec/$(DEPDIR)/libcrypto_la-ecp_smpl.Plo \ + ecdh/$(DEPDIR)/libcrypto_la-ech_err.Plo \ + ecdh/$(DEPDIR)/libcrypto_la-ech_key.Plo \ + ecdh/$(DEPDIR)/libcrypto_la-ech_lib.Plo \ + ecdsa/$(DEPDIR)/libcrypto_la-ecs_asn1.Plo \ + ecdsa/$(DEPDIR)/libcrypto_la-ecs_err.Plo \ + ecdsa/$(DEPDIR)/libcrypto_la-ecs_lib.Plo \ + ecdsa/$(DEPDIR)/libcrypto_la-ecs_ossl.Plo \ + ecdsa/$(DEPDIR)/libcrypto_la-ecs_sign.Plo \ + ecdsa/$(DEPDIR)/libcrypto_la-ecs_vrf.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_all.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_cnf.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_ctrl.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_dyn.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_err.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_fat.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_init.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_lib.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_list.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_openssl.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_pkey.Plo \ + engine/$(DEPDIR)/libcrypto_la-eng_table.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_asnmth.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_cipher.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_dh.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_digest.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_dsa.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_ecdh.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_ecdsa.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_eckey.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_pkmeth.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_rand.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_rsa.Plo \ + engine/$(DEPDIR)/libcrypto_la-tb_store.Plo \ + err/$(DEPDIR)/libcrypto_la-err.Plo \ + err/$(DEPDIR)/libcrypto_la-err_all.Plo \ + err/$(DEPDIR)/libcrypto_la-err_prn.Plo \ + evp/$(DEPDIR)/libcrypto_la-bio_b64.Plo \ + evp/$(DEPDIR)/libcrypto_la-bio_enc.Plo \ + evp/$(DEPDIR)/libcrypto_la-bio_md.Plo \ + evp/$(DEPDIR)/libcrypto_la-c_all.Plo \ + evp/$(DEPDIR)/libcrypto_la-digest.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_aes.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_aes_cbc_hmac_sha1.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_bf.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_camellia.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_cast.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_chacha.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_chacha20poly1305.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_des.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_des3.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_gost2814789.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_idea.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_null.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_old.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_rc2.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_rc4.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_rc4_hmac_md5.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_sm4.Plo \ + evp/$(DEPDIR)/libcrypto_la-e_xcbc_d.Plo \ + evp/$(DEPDIR)/libcrypto_la-encode.Plo \ + evp/$(DEPDIR)/libcrypto_la-evp_aead.Plo \ + evp/$(DEPDIR)/libcrypto_la-evp_enc.Plo \ + evp/$(DEPDIR)/libcrypto_la-evp_err.Plo \ + evp/$(DEPDIR)/libcrypto_la-evp_key.Plo \ + evp/$(DEPDIR)/libcrypto_la-evp_lib.Plo \ + evp/$(DEPDIR)/libcrypto_la-evp_pbe.Plo \ + evp/$(DEPDIR)/libcrypto_la-evp_pkey.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_dss.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_dss1.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_ecdsa.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_gost2814789.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_gostr341194.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_md4.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_md5.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_md5_sha1.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_null.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_ripemd.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_sha1.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_sigver.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_sm3.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_streebog.Plo \ + evp/$(DEPDIR)/libcrypto_la-m_wp.Plo \ + evp/$(DEPDIR)/libcrypto_la-names.Plo \ + evp/$(DEPDIR)/libcrypto_la-p5_crpt.Plo \ + evp/$(DEPDIR)/libcrypto_la-p5_crpt2.Plo \ + evp/$(DEPDIR)/libcrypto_la-p_dec.Plo \ + evp/$(DEPDIR)/libcrypto_la-p_enc.Plo \ + evp/$(DEPDIR)/libcrypto_la-p_lib.Plo \ + evp/$(DEPDIR)/libcrypto_la-p_open.Plo \ + evp/$(DEPDIR)/libcrypto_la-p_seal.Plo \ + evp/$(DEPDIR)/libcrypto_la-p_sign.Plo \ + evp/$(DEPDIR)/libcrypto_la-p_verify.Plo \ + evp/$(DEPDIR)/libcrypto_la-pmeth_fn.Plo \ + evp/$(DEPDIR)/libcrypto_la-pmeth_gn.Plo \ + evp/$(DEPDIR)/libcrypto_la-pmeth_lib.Plo \ + gost/$(DEPDIR)/libcrypto_la-gost2814789.Plo \ + gost/$(DEPDIR)/libcrypto_la-gost89_keywrap.Plo \ + gost/$(DEPDIR)/libcrypto_la-gost89_params.Plo \ + gost/$(DEPDIR)/libcrypto_la-gost89imit_ameth.Plo \ + gost/$(DEPDIR)/libcrypto_la-gost89imit_pmeth.Plo \ + gost/$(DEPDIR)/libcrypto_la-gost_asn1.Plo \ + gost/$(DEPDIR)/libcrypto_la-gost_err.Plo \ + gost/$(DEPDIR)/libcrypto_la-gostr341001.Plo \ + gost/$(DEPDIR)/libcrypto_la-gostr341001_ameth.Plo \ + gost/$(DEPDIR)/libcrypto_la-gostr341001_key.Plo \ + gost/$(DEPDIR)/libcrypto_la-gostr341001_params.Plo \ + gost/$(DEPDIR)/libcrypto_la-gostr341001_pmeth.Plo \ + gost/$(DEPDIR)/libcrypto_la-gostr341194.Plo \ + gost/$(DEPDIR)/libcrypto_la-streebog.Plo \ + hkdf/$(DEPDIR)/libcrypto_la-hkdf.Plo \ + hmac/$(DEPDIR)/libcrypto_la-hm_ameth.Plo \ + hmac/$(DEPDIR)/libcrypto_la-hm_pmeth.Plo \ + hmac/$(DEPDIR)/libcrypto_la-hmac.Plo \ + idea/$(DEPDIR)/libcrypto_la-i_cbc.Plo \ + idea/$(DEPDIR)/libcrypto_la-i_cfb64.Plo \ + idea/$(DEPDIR)/libcrypto_la-i_ecb.Plo \ + idea/$(DEPDIR)/libcrypto_la-i_ofb64.Plo \ + idea/$(DEPDIR)/libcrypto_la-i_skey.Plo \ + lhash/$(DEPDIR)/libcrypto_la-lh_stats.Plo \ + lhash/$(DEPDIR)/libcrypto_la-lhash.Plo \ + md4/$(DEPDIR)/libcrypto_la-md4_dgst.Plo \ + md4/$(DEPDIR)/libcrypto_la-md4_one.Plo \ + md5/$(DEPDIR)/libcrypto_la-md5-elf-x86_64.Plo \ + md5/$(DEPDIR)/libcrypto_la-md5-macosx-x86_64.Plo \ + md5/$(DEPDIR)/libcrypto_la-md5-masm-x86_64.Plo \ + md5/$(DEPDIR)/libcrypto_la-md5-mingw64-x86_64.Plo \ + md5/$(DEPDIR)/libcrypto_la-md5_dgst.Plo \ + md5/$(DEPDIR)/libcrypto_la-md5_one.Plo \ + modes/$(DEPDIR)/libcrypto_la-cbc128.Plo \ + modes/$(DEPDIR)/libcrypto_la-ccm128.Plo \ + modes/$(DEPDIR)/libcrypto_la-cfb128.Plo \ + modes/$(DEPDIR)/libcrypto_la-ctr128.Plo \ + modes/$(DEPDIR)/libcrypto_la-cts128.Plo \ + modes/$(DEPDIR)/libcrypto_la-gcm128.Plo \ + modes/$(DEPDIR)/libcrypto_la-ghash-elf-armv4.Plo \ + modes/$(DEPDIR)/libcrypto_la-ghash-elf-x86_64.Plo \ + modes/$(DEPDIR)/libcrypto_la-ghash-macosx-x86_64.Plo \ + modes/$(DEPDIR)/libcrypto_la-ghash-masm-x86_64.Plo \ + modes/$(DEPDIR)/libcrypto_la-ghash-mingw64-x86_64.Plo \ + modes/$(DEPDIR)/libcrypto_la-ofb128.Plo \ + modes/$(DEPDIR)/libcrypto_la-xts128.Plo \ + objects/$(DEPDIR)/libcrypto_la-o_names.Plo \ + objects/$(DEPDIR)/libcrypto_la-obj_dat.Plo \ + objects/$(DEPDIR)/libcrypto_la-obj_err.Plo \ + objects/$(DEPDIR)/libcrypto_la-obj_lib.Plo \ + objects/$(DEPDIR)/libcrypto_la-obj_xref.Plo \ + ocsp/$(DEPDIR)/libcrypto_la-ocsp_asn.Plo \ + ocsp/$(DEPDIR)/libcrypto_la-ocsp_cl.Plo \ + ocsp/$(DEPDIR)/libcrypto_la-ocsp_err.Plo \ + ocsp/$(DEPDIR)/libcrypto_la-ocsp_ext.Plo \ + ocsp/$(DEPDIR)/libcrypto_la-ocsp_ht.Plo \ + ocsp/$(DEPDIR)/libcrypto_la-ocsp_lib.Plo \ + ocsp/$(DEPDIR)/libcrypto_la-ocsp_prn.Plo \ + ocsp/$(DEPDIR)/libcrypto_la-ocsp_srv.Plo \ + ocsp/$(DEPDIR)/libcrypto_la-ocsp_vfy.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_all.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_err.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_info.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_lib.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_oth.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_pk8.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_pkey.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_seal.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_sign.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_x509.Plo \ + pem/$(DEPDIR)/libcrypto_la-pem_xaux.Plo \ + pem/$(DEPDIR)/libcrypto_la-pvkfmt.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_add.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_asn.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_attr.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_crpt.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_crt.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_decr.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_init.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_key.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_kiss.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_mutl.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_npas.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_p8d.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_p8e.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-p12_utl.Plo \ + pkcs12/$(DEPDIR)/libcrypto_la-pk12err.Plo \ + pkcs7/$(DEPDIR)/libcrypto_la-bio_pk7.Plo \ + pkcs7/$(DEPDIR)/libcrypto_la-pk7_asn1.Plo \ + pkcs7/$(DEPDIR)/libcrypto_la-pk7_attr.Plo \ + pkcs7/$(DEPDIR)/libcrypto_la-pk7_doit.Plo \ + pkcs7/$(DEPDIR)/libcrypto_la-pk7_lib.Plo \ + pkcs7/$(DEPDIR)/libcrypto_la-pk7_mime.Plo \ + pkcs7/$(DEPDIR)/libcrypto_la-pk7_smime.Plo \ + pkcs7/$(DEPDIR)/libcrypto_la-pkcs7err.Plo \ + poly1305/$(DEPDIR)/libcrypto_la-poly1305-donna.Plo \ + poly1305/$(DEPDIR)/libcrypto_la-poly1305.Plo \ + rand/$(DEPDIR)/libcrypto_la-rand_err.Plo \ + rand/$(DEPDIR)/libcrypto_la-rand_lib.Plo \ + rand/$(DEPDIR)/libcrypto_la-randfile.Plo \ + rc2/$(DEPDIR)/libcrypto_la-rc2_cbc.Plo \ + rc2/$(DEPDIR)/libcrypto_la-rc2_ecb.Plo \ + rc2/$(DEPDIR)/libcrypto_la-rc2_skey.Plo \ + rc2/$(DEPDIR)/libcrypto_la-rc2cfb64.Plo \ + rc2/$(DEPDIR)/libcrypto_la-rc2ofb64.Plo \ + rc4/$(DEPDIR)/libcrypto_la-rc4-elf-x86_64.Plo \ + rc4/$(DEPDIR)/libcrypto_la-rc4-macosx-x86_64.Plo \ + rc4/$(DEPDIR)/libcrypto_la-rc4-masm-x86_64.Plo \ + rc4/$(DEPDIR)/libcrypto_la-rc4-md5-elf-x86_64.Plo \ + rc4/$(DEPDIR)/libcrypto_la-rc4-md5-macosx-x86_64.Plo \ + rc4/$(DEPDIR)/libcrypto_la-rc4-md5-masm-x86_64.Plo \ + rc4/$(DEPDIR)/libcrypto_la-rc4-md5-mingw64-x86_64.Plo \ + rc4/$(DEPDIR)/libcrypto_la-rc4-mingw64-x86_64.Plo \ + rc4/$(DEPDIR)/libcrypto_la-rc4_enc.Plo \ + rc4/$(DEPDIR)/libcrypto_la-rc4_skey.Plo \ + ripemd/$(DEPDIR)/libcrypto_la-rmd_dgst.Plo \ + ripemd/$(DEPDIR)/libcrypto_la-rmd_one.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_ameth.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_asn1.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_chk.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_crpt.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_depr.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_eay.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_err.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_gen.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_lib.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_meth.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_none.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_oaep.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_pk1.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_pmeth.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_prn.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_pss.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_saos.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_sign.Plo \ + rsa/$(DEPDIR)/libcrypto_la-rsa_x931.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha1-elf-armv4.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha1-elf-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha1-macosx-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha1-masm-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha1-mingw64-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha1_one.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha1dgst.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha256-elf-armv4.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha256-elf-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha256-macosx-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha256-masm-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha256-mingw64-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha256.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha512-elf-armv4.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha512-elf-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha512-macosx-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha512-masm-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha512-mingw64-x86_64.Plo \ + sha/$(DEPDIR)/libcrypto_la-sha512.Plo \ + sm3/$(DEPDIR)/libcrypto_la-sm3.Plo \ + sm4/$(DEPDIR)/libcrypto_la-sm4.Plo \ + stack/$(DEPDIR)/libcrypto_la-stack.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_asn1.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_conf.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_err.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_lib.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_req_print.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_req_utils.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_rsp_print.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_rsp_sign.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_rsp_utils.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_rsp_verify.Plo \ + ts/$(DEPDIR)/libcrypto_la-ts_verify_ctx.Plo \ + txt_db/$(DEPDIR)/libcrypto_la-txt_db.Plo \ + ui/$(DEPDIR)/libcrypto_la-ui_err.Plo \ + ui/$(DEPDIR)/libcrypto_la-ui_lib.Plo \ + ui/$(DEPDIR)/libcrypto_la-ui_openssl.Plo \ + ui/$(DEPDIR)/libcrypto_la-ui_openssl_win.Plo \ + ui/$(DEPDIR)/libcrypto_la-ui_util.Plo \ + whrlpool/$(DEPDIR)/libcrypto_la-wp-elf-x86_64.Plo \ + whrlpool/$(DEPDIR)/libcrypto_la-wp-macosx-x86_64.Plo \ + whrlpool/$(DEPDIR)/libcrypto_la-wp-masm-x86_64.Plo \ + whrlpool/$(DEPDIR)/libcrypto_la-wp-mingw64-x86_64.Plo \ + whrlpool/$(DEPDIR)/libcrypto_la-wp_block.Plo \ + whrlpool/$(DEPDIR)/libcrypto_la-wp_dgst.Plo \ + x509/$(DEPDIR)/libcrypto_la-by_dir.Plo \ + x509/$(DEPDIR)/libcrypto_la-by_file.Plo \ + x509/$(DEPDIR)/libcrypto_la-by_mem.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_att.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_cmp.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_d2.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_def.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_err.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_ext.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_lu.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_obj.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_r2x.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_req.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_set.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_trs.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_txt.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_v3.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_vfy.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509_vpm.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509cset.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509name.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509rset.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509spki.Plo \ + x509/$(DEPDIR)/libcrypto_la-x509type.Plo \ + x509/$(DEPDIR)/libcrypto_la-x_all.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-pcy_cache.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-pcy_data.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-pcy_lib.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-pcy_map.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-pcy_node.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-pcy_tree.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_akey.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_akeya.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_alt.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_bcons.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_bitst.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_conf.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_cpols.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_crld.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_enum.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_extku.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_genn.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_ia5.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_info.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_int.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_lib.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_ncons.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_ocsp.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_pci.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_pcia.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_pcons.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_pku.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_pmaps.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_prn.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_purp.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_skey.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_sxnet.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3_utl.Plo \ + x509v3/$(DEPDIR)/libcrypto_la-v3err.Plo am__mv = mv -f CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ +LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CCASFLAGS) $(CCASFLAGS) @@ -860,8 +1636,10 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.am.arc4random \ - $(srcdir)/Makefile.am.elf-x86_64 \ - $(srcdir)/Makefile.am.macosx-x86_64 $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am.elf-arm $(srcdir)/Makefile.am.elf-x86_64 \ + $(srcdir)/Makefile.am.macosx-x86_64 \ + $(srcdir)/Makefile.am.masm-x86_64 \ + $(srcdir)/Makefile.am.mingw64-x86_64 $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.am.common $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -991,36 +1769,39 @@ AM_CFLAGS = AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/compat \ -DLIBRESSL_INTERNAL -D__BEGIN_HIDDEN_DECLS= \ -D__END_HIDDEN_DECLS= -I$(top_srcdir)/crypto/asn1 \ - -I$(top_srcdir)/crypto/bn -I$(top_srcdir)/crypto/evp \ + -I$(top_srcdir)/crypto/bn -I$(top_srcdir)/crypto/ec \ + -I$(top_srcdir)/crypto/ecdsa -I$(top_srcdir)/crypto/evp \ -I$(top_srcdir)/crypto/modes -I$(top_srcdir)/crypto lib_LTLIBRARIES = libcrypto.la # needed for a CMake target EXTRA_DIST = VERSION CMakeLists.txt crypto.sym compat/strcasecmp.c \ - $(ASM_X86_64_ELF) $(ASM_X86_64_MACOSX) + $(ASM_ARM_ELF) $(ASM_X86_64_ELF) $(ASM_X86_64_MACOSX) \ + $(ASM_X86_64_MASM) $(ASM_X86_64_MINGW64) BUILT_SOURCES = crypto_portable.sym CLEANFILES = crypto_portable.sym libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols crypto_portable.sym libcrypto_la_LIBADD = libcompat.la $(am__append_1) libcrypto_la_CPPFLAGS = $(AM_CPPFLAGS) -DLIBRESSL_INTERNAL \ -DOPENSSL_NO_HW_PADLOCK $(am__append_2) $(am__append_3) \ - $(am__append_4) $(am__append_5) $(am__append_33) \ - $(am__append_35) -noinst_LTLIBRARIES = libcompat.la $(am__append_6) + $(am__append_4) $(am__append_35) $(am__append_37) \ + $(am__append_39) $(am__append_41) $(am__append_43) +noinst_LTLIBRARIES = libcompat.la $(am__append_5) @HAVE_EXPLICIT_BZERO_FALSE@libcompatnoopt_la_CFLAGS = -O0 @HAVE_EXPLICIT_BZERO_FALSE@libcompatnoopt_la_SOURCES = \ -@HAVE_EXPLICIT_BZERO_FALSE@ $(am__append_7) $(am__append_8) +@HAVE_EXPLICIT_BZERO_FALSE@ $(am__append_6) $(am__append_7) # other compatibility functions -libcompat_la_SOURCES = $(am__append_9) $(am__append_10) \ - $(am__append_11) $(am__append_12) $(am__append_13) \ - $(am__append_14) $(am__append_15) $(am__append_16) \ - $(am__append_17) $(am__append_18) $(am__append_19) \ - $(am__append_20) $(am__append_21) $(am__append_22) \ - $(am__append_23) $(am__append_24) $(am__append_25) \ - $(am__append_26) $(am__append_27) $(am__append_28) \ - $(am__append_29) $(am__append_30) $(am__append_31) \ - $(am__append_32) +libcompat_la_SOURCES = $(am__append_8) $(am__append_9) \ + $(am__append_10) $(am__append_11) $(am__append_12) \ + $(am__append_13) $(am__append_14) $(am__append_15) \ + $(am__append_16) $(am__append_17) $(am__append_18) \ + $(am__append_19) $(am__append_20) $(am__append_21) \ + $(am__append_22) $(am__append_23) $(am__append_24) \ + $(am__append_25) $(am__append_26) $(am__append_27) \ + $(am__append_28) $(am__append_29) $(am__append_30) \ + $(am__append_31) $(am__append_32) $(am__append_33) \ + $(am__append_34) libcompat_la_LIBADD = $(PLATFORM_LDADD) # rc4 @@ -1028,7 +1809,7 @@ noinst_HEADERS = compat/arc4random.h compat/arc4random_aix.h \ compat/arc4random_freebsd.h compat/arc4random_hpux.h \ compat/arc4random_linux.h compat/arc4random_netbsd.h \ compat/arc4random_osx.h compat/arc4random_solaris.h \ - compat/arc4random_win.h compat/chacha_private.h \ + compat/arc4random_win.h compat/chacha_private.h arm_arch.h \ constant_time_locl.h cryptlib.h md32_common.h o_time.h \ x86_arch.h aes/aes_locl.h asn1/asn1_locl.h asn1/charmap.h \ bf/bf_locl.h bf/bf_pi.h bn/bn_lcl.h bn/bn_prime.h \ @@ -1040,8 +1821,8 @@ noinst_HEADERS = compat/arc4random.h compat/arc4random_aix.h \ idea/idea_lcl.h md4/md4_locl.h md5/md5_locl.h \ modes/modes_lcl.h objects/obj_dat.h objects/obj_xref.h \ rc2/rc2_locl.h rc4/rc4_locl.h ripemd/rmd_locl.h \ - ripemd/rmdconst.h rsa/rsa_locl.h sha/sha_locl.h ui/ui_locl.h \ - whrlpool/wp_locl.h x509/x509_lcl.h x509/vpm_int.h \ + ripemd/rmdconst.h rsa/rsa_locl.h sha/sha_locl.h sm3/sm3_locl.h \ + ui/ui_locl.h whrlpool/wp_locl.h x509/x509_lcl.h x509/vpm_int.h \ x509v3/ext_dat.h x509v3/pcy_int.h # aes @@ -1124,6 +1905,10 @@ noinst_HEADERS = compat/arc4random.h compat/arc4random_aix.h \ # sha +# sm3 + +# sm4 + # stack # ts @@ -1137,44 +1922,46 @@ noinst_HEADERS = compat/arc4random.h compat/arc4random_aix.h \ # x509 # x509v3 -libcrypto_la_SOURCES = $(am__append_34) $(am__append_36) \ - $(am__append_37) cpt_err.c cryptlib.c cversion.c ex_data.c \ +libcrypto_la_SOURCES = $(am__append_36) $(am__append_38) \ + $(am__append_40) $(am__append_42) $(am__append_44) \ + $(am__append_45) cpt_err.c cryptlib.c crypto_init.c \ + $(am__append_46) $(am__append_47) cversion.c ex_data.c \ malloc-wrapper.c mem_clr.c mem_dbg.c o_init.c o_str.c o_time.c \ aes/aes_cfb.c aes/aes_ctr.c aes/aes_ecb.c aes/aes_ige.c \ aes/aes_misc.c aes/aes_ofb.c aes/aes_wrap.c asn1/a_bitstr.c \ - asn1/a_bool.c asn1/a_bytes.c asn1/a_d2i_fp.c asn1/a_digest.c \ - asn1/a_dup.c asn1/a_enum.c asn1/a_i2d_fp.c asn1/a_int.c \ - asn1/a_mbstr.c asn1/a_object.c asn1/a_octet.c asn1/a_print.c \ - asn1/a_set.c asn1/a_sign.c asn1/a_strex.c asn1/a_strnid.c \ - asn1/a_time.c asn1/a_time_tm.c asn1/a_type.c asn1/a_utf8.c \ - asn1/a_verify.c asn1/ameth_lib.c asn1/asn1_err.c \ - asn1/asn1_gen.c asn1/asn1_lib.c asn1/asn1_par.c \ - asn1/asn_mime.c asn1/asn_moid.c asn1/asn_pack.c \ - asn1/bio_asn1.c asn1/bio_ndef.c asn1/d2i_pr.c asn1/d2i_pu.c \ - asn1/evp_asn1.c asn1/f_enum.c asn1/f_int.c asn1/f_string.c \ - asn1/i2d_pr.c asn1/i2d_pu.c asn1/n_pkey.c asn1/nsseq.c \ - asn1/p5_pbe.c asn1/p5_pbev2.c asn1/p8_pkey.c asn1/t_bitst.c \ - asn1/t_crl.c asn1/t_pkey.c asn1/t_req.c asn1/t_spki.c \ - asn1/t_x509.c asn1/t_x509a.c asn1/tasn_dec.c asn1/tasn_enc.c \ - asn1/tasn_fre.c asn1/tasn_new.c asn1/tasn_prn.c \ - asn1/tasn_typ.c asn1/tasn_utl.c asn1/x_algor.c asn1/x_attrib.c \ - asn1/x_bignum.c asn1/x_crl.c asn1/x_exten.c asn1/x_info.c \ - asn1/x_long.c asn1/x_name.c asn1/x_nx509.c asn1/x_pkey.c \ - asn1/x_pubkey.c asn1/x_req.c asn1/x_sig.c asn1/x_spki.c \ - asn1/x_val.c asn1/x_x509.c asn1/x_x509a.c bf/bf_cfb64.c \ - bf/bf_ecb.c bf/bf_enc.c bf/bf_ofb64.c bf/bf_skey.c \ - bio/b_dump.c $(am__append_38) bio/b_print.c bio/b_sock.c \ - $(am__append_39) bio/bf_buff.c bio/bf_nbio.c bio/bf_null.c \ - bio/bio_cb.c bio/bio_err.c bio/bio_lib.c bio/bss_acpt.c \ - bio/bss_bio.c bio/bss_conn.c bio/bss_dgram.c bio/bss_fd.c \ - bio/bss_file.c $(am__append_40) bio/bss_mem.c bio/bss_null.c \ - bio/bss_sock.c bn/bn_add.c bn/bn_asm.c bn/bn_blind.c \ - bn/bn_const.c bn/bn_ctx.c bn/bn_depr.c bn/bn_div.c bn/bn_err.c \ - bn/bn_exp.c bn/bn_exp2.c bn/bn_gcd.c bn/bn_gf2m.c bn/bn_kron.c \ - bn/bn_lib.c bn/bn_mod.c bn/bn_mont.c bn/bn_mpi.c bn/bn_mul.c \ - bn/bn_nist.c bn/bn_prime.c bn/bn_print.c bn/bn_rand.c \ - bn/bn_recp.c bn/bn_shift.c bn/bn_sqr.c bn/bn_sqrt.c \ - bn/bn_word.c bn/bn_x931p.c buffer/buf_err.c buffer/buf_str.c \ + asn1/a_bool.c asn1/a_d2i_fp.c asn1/a_digest.c asn1/a_dup.c \ + asn1/a_enum.c asn1/a_i2d_fp.c asn1/a_int.c asn1/a_mbstr.c \ + asn1/a_object.c asn1/a_octet.c asn1/a_print.c asn1/a_sign.c \ + asn1/a_strex.c asn1/a_strnid.c asn1/a_time.c asn1/a_time_tm.c \ + asn1/a_type.c asn1/a_utf8.c asn1/a_verify.c asn1/ameth_lib.c \ + asn1/asn1_err.c asn1/asn1_gen.c asn1/asn1_lib.c \ + asn1/asn1_par.c asn1/asn_mime.c asn1/asn_moid.c \ + asn1/asn_pack.c asn1/bio_asn1.c asn1/bio_ndef.c asn1/d2i_pr.c \ + asn1/d2i_pu.c asn1/evp_asn1.c asn1/f_enum.c asn1/f_int.c \ + asn1/f_string.c asn1/i2d_pr.c asn1/i2d_pu.c asn1/n_pkey.c \ + asn1/nsseq.c asn1/p5_pbe.c asn1/p5_pbev2.c asn1/p8_pkey.c \ + asn1/t_bitst.c asn1/t_crl.c asn1/t_pkey.c asn1/t_req.c \ + asn1/t_spki.c asn1/t_x509.c asn1/t_x509a.c asn1/tasn_dec.c \ + asn1/tasn_enc.c asn1/tasn_fre.c asn1/tasn_new.c \ + asn1/tasn_prn.c asn1/tasn_typ.c asn1/tasn_utl.c asn1/x_algor.c \ + asn1/x_attrib.c asn1/x_bignum.c asn1/x_crl.c asn1/x_exten.c \ + asn1/x_info.c asn1/x_long.c asn1/x_name.c asn1/x_nx509.c \ + asn1/x_pkey.c asn1/x_pubkey.c asn1/x_req.c asn1/x_sig.c \ + asn1/x_spki.c asn1/x_val.c asn1/x_x509.c asn1/x_x509a.c \ + bf/bf_cfb64.c bf/bf_ecb.c bf/bf_enc.c bf/bf_ofb64.c \ + bf/bf_skey.c bio/b_dump.c $(am__append_48) bio/b_print.c \ + bio/b_sock.c $(am__append_49) bio/bf_buff.c bio/bf_nbio.c \ + bio/bf_null.c bio/bio_cb.c bio/bio_err.c bio/bio_lib.c \ + bio/bio_meth.c bio/bss_acpt.c bio/bss_bio.c bio/bss_conn.c \ + bio/bss_dgram.c bio/bss_fd.c bio/bss_file.c $(am__append_50) \ + bio/bss_mem.c bio/bss_null.c bio/bss_sock.c bn/bn_add.c \ + bn/bn_asm.c bn/bn_blind.c bn/bn_const.c bn/bn_ctx.c \ + bn/bn_depr.c bn/bn_div.c bn/bn_err.c bn/bn_exp.c bn/bn_exp2.c \ + bn/bn_gcd.c bn/bn_gf2m.c bn/bn_kron.c bn/bn_lib.c bn/bn_mod.c \ + bn/bn_mont.c bn/bn_mpi.c bn/bn_mul.c bn/bn_nist.c \ + bn/bn_prime.c bn/bn_print.c bn/bn_rand.c bn/bn_recp.c \ + bn/bn_shift.c bn/bn_sqr.c bn/bn_sqrt.c bn/bn_word.c \ + bn/bn_x931p.c buffer/buf_err.c buffer/buf_str.c \ buffer/buffer.c camellia/cmll_cfb.c camellia/cmll_ctr.c \ camellia/cmll_ecb.c camellia/cmll_misc.c camellia/cmll_ofb.c \ cast/c_cfb64.c cast/c_ecb.c cast/c_enc.c cast/c_ofb64.c \ @@ -1193,23 +1980,24 @@ libcrypto_la_SOURCES = $(am__append_34) $(am__append_36) \ dh/dh_check.c dh/dh_depr.c dh/dh_err.c dh/dh_gen.c dh/dh_key.c \ dh/dh_lib.c dh/dh_pmeth.c dh/dh_prn.c dsa/dsa_ameth.c \ dsa/dsa_asn1.c dsa/dsa_depr.c dsa/dsa_err.c dsa/dsa_gen.c \ - dsa/dsa_key.c dsa/dsa_lib.c dsa/dsa_ossl.c dsa/dsa_pmeth.c \ - dsa/dsa_prn.c dsa/dsa_sign.c dsa/dsa_vrf.c dso/dso_dlfcn.c \ - dso/dso_err.c dso/dso_lib.c dso/dso_null.c dso/dso_openssl.c \ - ec/ec2_mult.c ec/ec2_oct.c ec/ec2_smpl.c ec/ec_ameth.c \ - ec/ec_asn1.c ec/ec_check.c ec/ec_curve.c ec/ec_cvt.c \ - ec/ec_err.c ec/ec_key.c ec/ec_lib.c ec/ec_mult.c ec/ec_oct.c \ - ec/ec_pmeth.c ec/ec_print.c ec/eck_prn.c ec/ecp_mont.c \ - ec/ecp_nist.c ec/ecp_oct.c ec/ecp_smpl.c ecdh/ech_err.c \ - ecdh/ech_key.c ecdh/ech_lib.c ecdsa/ecs_asn1.c ecdsa/ecs_err.c \ - ecdsa/ecs_lib.c ecdsa/ecs_ossl.c ecdsa/ecs_sign.c \ - ecdsa/ecs_vrf.c engine/eng_all.c engine/eng_cnf.c \ - engine/eng_ctrl.c engine/eng_dyn.c engine/eng_err.c \ - engine/eng_fat.c engine/eng_init.c engine/eng_lib.c \ - engine/eng_list.c engine/eng_openssl.c engine/eng_pkey.c \ - engine/eng_table.c engine/tb_asnmth.c engine/tb_cipher.c \ - engine/tb_dh.c engine/tb_digest.c engine/tb_dsa.c \ - engine/tb_ecdh.c engine/tb_ecdsa.c engine/tb_pkmeth.c \ + dsa/dsa_key.c dsa/dsa_lib.c dsa/dsa_meth.c dsa/dsa_ossl.c \ + dsa/dsa_pmeth.c dsa/dsa_prn.c dsa/dsa_sign.c dsa/dsa_vrf.c \ + dso/dso_dlfcn.c dso/dso_err.c dso/dso_lib.c dso/dso_null.c \ + dso/dso_openssl.c ec/ec2_mult.c ec/ec2_oct.c ec/ec2_smpl.c \ + ec/ec_ameth.c ec/ec_asn1.c ec/ec_check.c ec/ec_curve.c \ + ec/ec_cvt.c ec/ec_err.c ec/ec_key.c ec/ec_kmeth.c ec/ec_lib.c \ + ec/ec_mult.c ec/ec_oct.c ec/ec_pmeth.c ec/ec_print.c \ + ec/eck_prn.c ec/ecp_mont.c ec/ecp_nist.c ec/ecp_oct.c \ + ec/ecp_smpl.c ecdh/ech_err.c ecdh/ech_key.c ecdh/ech_lib.c \ + ecdsa/ecs_asn1.c ecdsa/ecs_err.c ecdsa/ecs_lib.c \ + ecdsa/ecs_ossl.c ecdsa/ecs_sign.c ecdsa/ecs_vrf.c \ + engine/eng_all.c engine/eng_cnf.c engine/eng_ctrl.c \ + engine/eng_dyn.c engine/eng_err.c engine/eng_fat.c \ + engine/eng_init.c engine/eng_lib.c engine/eng_list.c \ + engine/eng_openssl.c engine/eng_pkey.c engine/eng_table.c \ + engine/tb_asnmth.c engine/tb_cipher.c engine/tb_dh.c \ + engine/tb_digest.c engine/tb_dsa.c engine/tb_ecdh.c \ + engine/tb_ecdsa.c engine/tb_eckey.c engine/tb_pkmeth.c \ engine/tb_rand.c engine/tb_rsa.c engine/tb_store.c err/err.c \ err/err_all.c err/err_prn.c evp/bio_b64.c evp/bio_enc.c \ evp/bio_md.c evp/c_all.c evp/digest.c evp/e_aes.c \ @@ -1217,16 +2005,16 @@ libcrypto_la_SOURCES = $(am__append_34) $(am__append_36) \ evp/e_cast.c evp/e_chacha.c evp/e_chacha20poly1305.c \ evp/e_des.c evp/e_des3.c evp/e_gost2814789.c evp/e_idea.c \ evp/e_null.c evp/e_old.c evp/e_rc2.c evp/e_rc4.c \ - evp/e_rc4_hmac_md5.c evp/e_xcbc_d.c evp/encode.c \ + evp/e_rc4_hmac_md5.c evp/e_sm4.c evp/e_xcbc_d.c evp/encode.c \ evp/evp_aead.c evp/evp_enc.c evp/evp_err.c evp/evp_key.c \ evp/evp_lib.c evp/evp_pbe.c evp/evp_pkey.c evp/m_dss.c \ evp/m_dss1.c evp/m_ecdsa.c evp/m_gost2814789.c \ evp/m_gostr341194.c evp/m_md4.c evp/m_md5.c evp/m_md5_sha1.c \ evp/m_null.c evp/m_ripemd.c evp/m_sha1.c evp/m_sigver.c \ - evp/m_streebog.c evp/m_wp.c evp/names.c evp/p5_crpt.c \ - evp/p5_crpt2.c evp/p_dec.c evp/p_enc.c evp/p_lib.c \ - evp/p_open.c evp/p_seal.c evp/p_sign.c evp/p_verify.c \ - evp/pmeth_fn.c evp/pmeth_gn.c evp/pmeth_lib.c \ + evp/m_streebog.c evp/m_sm3.c evp/m_wp.c evp/names.c \ + evp/p5_crpt.c evp/p5_crpt2.c evp/p_dec.c evp/p_enc.c \ + evp/p_lib.c evp/p_open.c evp/p_seal.c evp/p_sign.c \ + evp/p_verify.c evp/pmeth_fn.c evp/pmeth_gn.c evp/pmeth_lib.c \ gost/gost2814789.c gost/gost89_keywrap.c gost/gost89_params.c \ gost/gost89imit_ameth.c gost/gost89imit_pmeth.c \ gost/gost_asn1.c gost/gost_err.c gost/gostr341001.c \ @@ -1258,40 +2046,46 @@ libcrypto_la_SOURCES = $(am__append_34) $(am__append_36) \ rc2/rc2cfb64.c rc2/rc2ofb64.c ripemd/rmd_dgst.c \ ripemd/rmd_one.c rsa/rsa_ameth.c rsa/rsa_asn1.c rsa/rsa_chk.c \ rsa/rsa_crpt.c rsa/rsa_depr.c rsa/rsa_eay.c rsa/rsa_err.c \ - rsa/rsa_gen.c rsa/rsa_lib.c rsa/rsa_none.c rsa/rsa_oaep.c \ - rsa/rsa_pk1.c rsa/rsa_pmeth.c rsa/rsa_prn.c rsa/rsa_pss.c \ - rsa/rsa_saos.c rsa/rsa_sign.c rsa/rsa_x931.c sha/sha1_one.c \ - sha/sha1dgst.c sha/sha256.c sha/sha512.c stack/stack.c \ - ts/ts_asn1.c ts/ts_conf.c ts/ts_err.c ts/ts_lib.c \ - ts/ts_req_print.c ts/ts_req_utils.c ts/ts_rsp_print.c \ - ts/ts_rsp_sign.c ts/ts_rsp_utils.c ts/ts_rsp_verify.c \ - ts/ts_verify_ctx.c txt_db/txt_db.c ui/ui_err.c ui/ui_lib.c \ - $(am__append_41) $(am__append_42) ui/ui_util.c \ - whrlpool/wp_dgst.c x509/by_dir.c x509/by_file.c x509/by_mem.c \ - x509/x509_att.c x509/x509_cmp.c x509/x509_d2.c x509/x509_def.c \ - x509/x509_err.c x509/x509_ext.c x509/x509_lu.c x509/x509_obj.c \ - x509/x509_r2x.c x509/x509_req.c x509/x509_set.c \ - x509/x509_trs.c x509/x509_txt.c x509/x509_v3.c x509/x509_vfy.c \ - x509/x509_vpm.c x509/x509cset.c x509/x509name.c \ - x509/x509rset.c x509/x509spki.c x509/x509type.c x509/x_all.c \ - x509v3/pcy_cache.c x509v3/pcy_data.c x509v3/pcy_lib.c \ - x509v3/pcy_map.c x509v3/pcy_node.c x509v3/pcy_tree.c \ - x509v3/v3_akey.c x509v3/v3_akeya.c x509v3/v3_alt.c \ - x509v3/v3_bcons.c x509v3/v3_bitst.c x509v3/v3_conf.c \ - x509v3/v3_cpols.c x509v3/v3_crld.c x509v3/v3_enum.c \ - x509v3/v3_extku.c x509v3/v3_genn.c x509v3/v3_ia5.c \ - x509v3/v3_info.c x509v3/v3_int.c x509v3/v3_lib.c \ - x509v3/v3_ncons.c x509v3/v3_ocsp.c x509v3/v3_pci.c \ - x509v3/v3_pcia.c x509v3/v3_pcons.c x509v3/v3_pku.c \ - x509v3/v3_pmaps.c x509v3/v3_prn.c x509v3/v3_purp.c \ - x509v3/v3_skey.c x509v3/v3_sxnet.c x509v3/v3_utl.c \ - x509v3/v3err.c + rsa/rsa_gen.c rsa/rsa_lib.c rsa/rsa_meth.c rsa/rsa_none.c \ + rsa/rsa_oaep.c rsa/rsa_pk1.c rsa/rsa_pmeth.c rsa/rsa_prn.c \ + rsa/rsa_pss.c rsa/rsa_saos.c rsa/rsa_sign.c rsa/rsa_x931.c \ + sha/sha1_one.c sha/sha1dgst.c sha/sha256.c sha/sha512.c \ + sm3/sm3.c sm4/sm4.c stack/stack.c ts/ts_asn1.c ts/ts_conf.c \ + ts/ts_err.c ts/ts_lib.c ts/ts_req_print.c ts/ts_req_utils.c \ + ts/ts_rsp_print.c ts/ts_rsp_sign.c ts/ts_rsp_utils.c \ + ts/ts_rsp_verify.c ts/ts_verify_ctx.c txt_db/txt_db.c \ + ui/ui_err.c ui/ui_lib.c $(am__append_51) $(am__append_52) \ + ui/ui_util.c whrlpool/wp_dgst.c x509/by_dir.c x509/by_file.c \ + x509/by_mem.c x509/x509_att.c x509/x509_cmp.c x509/x509_d2.c \ + x509/x509_def.c x509/x509_err.c x509/x509_ext.c x509/x509_lu.c \ + x509/x509_obj.c x509/x509_r2x.c x509/x509_req.c \ + x509/x509_set.c x509/x509_trs.c x509/x509_txt.c x509/x509_v3.c \ + x509/x509_vfy.c x509/x509_vpm.c x509/x509cset.c \ + x509/x509name.c x509/x509rset.c x509/x509spki.c \ + x509/x509type.c x509/x_all.c x509v3/pcy_cache.c \ + x509v3/pcy_data.c x509v3/pcy_lib.c x509v3/pcy_map.c \ + x509v3/pcy_node.c x509v3/pcy_tree.c x509v3/v3_akey.c \ + x509v3/v3_akeya.c x509v3/v3_alt.c x509v3/v3_bcons.c \ + x509v3/v3_bitst.c x509v3/v3_conf.c x509v3/v3_cpols.c \ + x509v3/v3_crld.c x509v3/v3_enum.c x509v3/v3_extku.c \ + x509v3/v3_genn.c x509v3/v3_ia5.c x509v3/v3_info.c \ + x509v3/v3_int.c x509v3/v3_lib.c x509v3/v3_ncons.c \ + x509v3/v3_ocsp.c x509v3/v3_pci.c x509v3/v3_pcia.c \ + x509v3/v3_pcons.c x509v3/v3_pku.c x509v3/v3_pmaps.c \ + x509v3/v3_prn.c x509v3/v3_purp.c x509v3/v3_skey.c \ + x509v3/v3_sxnet.c x509v3/v3_utl.c x509v3/v3err.c # chacha # poly1305 EXTRA_libcrypto_la_SOURCES = chacha/chacha-merged.c des/ncbc_enc.c \ poly1305/poly1305-donna.c +ASM_ARM_ELF = aes/aes-elf-armv4.S bn/gf2m-elf-armv4.S \ + bn/mont-elf-armv4.S sha/sha1-elf-armv4.S \ + sha/sha512-elf-armv4.S sha/sha256-elf-armv4.S \ + modes/ghash-elf-armv4.S armv4cpuid.S armcap.c aes/aes_cbc.c \ + camellia/camellia.c camellia/cmll_cbc.c rc4/rc4_enc.c \ + rc4/rc4_skey.c whrlpool/wp_block.c ASM_X86_64_ELF = aes/aes-elf-x86_64.S aes/bsaes-elf-x86_64.S \ aes/vpaes-elf-x86_64.S aes/aesni-elf-x86_64.S \ aes/aesni-sha1-elf-x86_64.S bn/modexp512-elf-x86_64.S \ @@ -1312,12 +2106,34 @@ ASM_X86_64_MACOSX = aes/aes-macosx-x86_64.S aes/bsaes-macosx-x86_64.S \ sha/sha1-macosx-x86_64.S sha/sha256-macosx-x86_64.S \ sha/sha512-macosx-x86_64.S whrlpool/wp-macosx-x86_64.S \ cpuid-macosx-x86_64.S +ASM_X86_64_MASM = aes/aes-masm-x86_64.S aes/bsaes-masm-x86_64.S \ + aes/vpaes-masm-x86_64.S aes/aesni-masm-x86_64.S \ + aes/aesni-sha1-masm-x86_64.S bn/modexp512-masm-x86_64.S \ + bn/mont-masm-x86_64.S bn/mont5-masm-x86_64.S \ + bn/gf2m-masm-x86_64.S camellia/cmll-masm-x86_64.S \ + md5/md5-masm-x86_64.S modes/ghash-masm-x86_64.S \ + rc4/rc4-masm-x86_64.S rc4/rc4-md5-masm-x86_64.S \ + sha/sha1-masm-x86_64.S sha/sha256-masm-x86_64.S \ + sha/sha512-masm-x86_64.S whrlpool/wp-masm-x86_64.S \ + cpuid-masm-x86_64.S +#ASM_X86_64_MINGW64 += bn/modexp512-mingw64-x86_64.S +#ASM_X86_64_MINGW64 += bn/mont-mingw64-x86_64.S +#ASM_X86_64_MINGW64 += bn/mont5-mingw64-x86_64.S +#ASM_X86_64_MINGW64 += bn/gf2m-mingw64-x86_64.S +ASM_X86_64_MINGW64 = aes/aes-mingw64-x86_64.S \ + aes/bsaes-mingw64-x86_64.S aes/vpaes-mingw64-x86_64.S \ + aes/aesni-mingw64-x86_64.S aes/aesni-sha1-mingw64-x86_64.S \ + camellia/cmll-mingw64-x86_64.S md5/md5-mingw64-x86_64.S \ + modes/ghash-mingw64-x86_64.S rc4/rc4-mingw64-x86_64.S \ + rc4/rc4-md5-mingw64-x86_64.S sha/sha1-mingw64-x86_64.S \ + sha/sha256-mingw64-x86_64.S sha/sha512-mingw64-x86_64.S \ + whrlpool/wp-mingw64-x86_64.S cpuid-mingw64-x86_64.S all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.common $(srcdir)/Makefile.am.arc4random $(srcdir)/Makefile.am.elf-x86_64 $(srcdir)/Makefile.am.macosx-x86_64 $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.common $(srcdir)/Makefile.am.arc4random $(srcdir)/Makefile.am.elf-arm $(srcdir)/Makefile.am.elf-x86_64 $(srcdir)/Makefile.am.macosx-x86_64 $(srcdir)/Makefile.am.masm-x86_64 $(srcdir)/Makefile.am.mingw64-x86_64 $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -1334,10 +2150,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(top_srcdir)/Makefile.am.common $(srcdir)/Makefile.am.arc4random $(srcdir)/Makefile.am.elf-x86_64 $(srcdir)/Makefile.am.macosx-x86_64 $(am__empty): +$(top_srcdir)/Makefile.am.common $(srcdir)/Makefile.am.arc4random $(srcdir)/Makefile.am.elf-arm $(srcdir)/Makefile.am.elf-x86_64 $(srcdir)/Makefile.am.macosx-x86_64 $(srcdir)/Makefile.am.masm-x86_64 $(srcdir)/Makefile.am.mingw64-x86_64 $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -1415,7 +2231,11 @@ compat/freezero.lo: compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) compat/getpagesize.lo: compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) -compat/inet_pton.lo: compat/$(am__dirstamp) \ +compat/getprogname_linux.lo: compat/$(am__dirstamp) \ + compat/$(DEPDIR)/$(am__dirstamp) +compat/getprogname_windows.lo: compat/$(am__dirstamp) \ + compat/$(DEPDIR)/$(am__dirstamp) +compat/getprogname_unimpl.lo: compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) compat/timegm.lo: compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) @@ -1423,6 +2243,8 @@ compat/reallocarray.lo: compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) compat/recallocarray.lo: compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) +compat/syslog_r.lo: compat/$(am__dirstamp) \ + compat/$(DEPDIR)/$(am__dirstamp) compat/timingsafe_memcmp.lo: compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) compat/timingsafe_bcmp.lo: compat/$(am__dirstamp) \ @@ -1465,6 +2287,68 @@ aes/$(am__dirstamp): aes/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) aes/$(DEPDIR) @: > aes/$(DEPDIR)/$(am__dirstamp) +aes/libcrypto_la-aes-elf-armv4.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +bn/$(am__dirstamp): + @$(MKDIR_P) bn + @: > bn/$(am__dirstamp) +bn/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) bn/$(DEPDIR) + @: > bn/$(DEPDIR)/$(am__dirstamp) +bn/libcrypto_la-gf2m-elf-armv4.lo: bn/$(am__dirstamp) \ + bn/$(DEPDIR)/$(am__dirstamp) +bn/libcrypto_la-mont-elf-armv4.lo: bn/$(am__dirstamp) \ + bn/$(DEPDIR)/$(am__dirstamp) +sha/$(am__dirstamp): + @$(MKDIR_P) sha + @: > sha/$(am__dirstamp) +sha/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) sha/$(DEPDIR) + @: > sha/$(DEPDIR)/$(am__dirstamp) +sha/libcrypto_la-sha1-elf-armv4.lo: sha/$(am__dirstamp) \ + sha/$(DEPDIR)/$(am__dirstamp) +sha/libcrypto_la-sha512-elf-armv4.lo: sha/$(am__dirstamp) \ + sha/$(DEPDIR)/$(am__dirstamp) +sha/libcrypto_la-sha256-elf-armv4.lo: sha/$(am__dirstamp) \ + sha/$(DEPDIR)/$(am__dirstamp) +modes/$(am__dirstamp): + @$(MKDIR_P) modes + @: > modes/$(am__dirstamp) +modes/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) modes/$(DEPDIR) + @: > modes/$(DEPDIR)/$(am__dirstamp) +modes/libcrypto_la-ghash-elf-armv4.lo: modes/$(am__dirstamp) \ + modes/$(DEPDIR)/$(am__dirstamp) +aes/libcrypto_la-aes_cbc.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +camellia/$(am__dirstamp): + @$(MKDIR_P) camellia + @: > camellia/$(am__dirstamp) +camellia/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) camellia/$(DEPDIR) + @: > camellia/$(DEPDIR)/$(am__dirstamp) +camellia/libcrypto_la-camellia.lo: camellia/$(am__dirstamp) \ + camellia/$(DEPDIR)/$(am__dirstamp) +camellia/libcrypto_la-cmll_cbc.lo: camellia/$(am__dirstamp) \ + camellia/$(DEPDIR)/$(am__dirstamp) +rc4/$(am__dirstamp): + @$(MKDIR_P) rc4 + @: > rc4/$(am__dirstamp) +rc4/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) rc4/$(DEPDIR) + @: > rc4/$(DEPDIR)/$(am__dirstamp) +rc4/libcrypto_la-rc4_enc.lo: rc4/$(am__dirstamp) \ + rc4/$(DEPDIR)/$(am__dirstamp) +rc4/libcrypto_la-rc4_skey.lo: rc4/$(am__dirstamp) \ + rc4/$(DEPDIR)/$(am__dirstamp) +whrlpool/$(am__dirstamp): + @$(MKDIR_P) whrlpool + @: > whrlpool/$(am__dirstamp) +whrlpool/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) whrlpool/$(DEPDIR) + @: > whrlpool/$(DEPDIR)/$(am__dirstamp) +whrlpool/libcrypto_la-wp_block.lo: whrlpool/$(am__dirstamp) \ + whrlpool/$(DEPDIR)/$(am__dirstamp) aes/libcrypto_la-aes-elf-x86_64.lo: aes/$(am__dirstamp) \ aes/$(DEPDIR)/$(am__dirstamp) aes/libcrypto_la-bsaes-elf-x86_64.lo: aes/$(am__dirstamp) \ @@ -1475,12 +2359,6 @@ aes/libcrypto_la-aesni-elf-x86_64.lo: aes/$(am__dirstamp) \ aes/$(DEPDIR)/$(am__dirstamp) aes/libcrypto_la-aesni-sha1-elf-x86_64.lo: aes/$(am__dirstamp) \ aes/$(DEPDIR)/$(am__dirstamp) -bn/$(am__dirstamp): - @$(MKDIR_P) bn - @: > bn/$(am__dirstamp) -bn/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) bn/$(DEPDIR) - @: > bn/$(DEPDIR)/$(am__dirstamp) bn/libcrypto_la-modexp512-elf-x86_64.lo: bn/$(am__dirstamp) \ bn/$(DEPDIR)/$(am__dirstamp) bn/libcrypto_la-mont-elf-x86_64.lo: bn/$(am__dirstamp) \ @@ -1489,12 +2367,6 @@ bn/libcrypto_la-mont5-elf-x86_64.lo: bn/$(am__dirstamp) \ bn/$(DEPDIR)/$(am__dirstamp) bn/libcrypto_la-gf2m-elf-x86_64.lo: bn/$(am__dirstamp) \ bn/$(DEPDIR)/$(am__dirstamp) -camellia/$(am__dirstamp): - @$(MKDIR_P) camellia - @: > camellia/$(am__dirstamp) -camellia/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) camellia/$(DEPDIR) - @: > camellia/$(DEPDIR)/$(am__dirstamp) camellia/libcrypto_la-cmll-elf-x86_64.lo: camellia/$(am__dirstamp) \ camellia/$(DEPDIR)/$(am__dirstamp) md5/$(am__dirstamp): @@ -1505,42 +2377,18 @@ md5/$(DEPDIR)/$(am__dirstamp): @: > md5/$(DEPDIR)/$(am__dirstamp) md5/libcrypto_la-md5-elf-x86_64.lo: md5/$(am__dirstamp) \ md5/$(DEPDIR)/$(am__dirstamp) -modes/$(am__dirstamp): - @$(MKDIR_P) modes - @: > modes/$(am__dirstamp) -modes/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) modes/$(DEPDIR) - @: > modes/$(DEPDIR)/$(am__dirstamp) modes/libcrypto_la-ghash-elf-x86_64.lo: modes/$(am__dirstamp) \ modes/$(DEPDIR)/$(am__dirstamp) -rc4/$(am__dirstamp): - @$(MKDIR_P) rc4 - @: > rc4/$(am__dirstamp) -rc4/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) rc4/$(DEPDIR) - @: > rc4/$(DEPDIR)/$(am__dirstamp) rc4/libcrypto_la-rc4-elf-x86_64.lo: rc4/$(am__dirstamp) \ rc4/$(DEPDIR)/$(am__dirstamp) rc4/libcrypto_la-rc4-md5-elf-x86_64.lo: rc4/$(am__dirstamp) \ rc4/$(DEPDIR)/$(am__dirstamp) -sha/$(am__dirstamp): - @$(MKDIR_P) sha - @: > sha/$(am__dirstamp) -sha/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) sha/$(DEPDIR) - @: > sha/$(DEPDIR)/$(am__dirstamp) sha/libcrypto_la-sha1-elf-x86_64.lo: sha/$(am__dirstamp) \ sha/$(DEPDIR)/$(am__dirstamp) sha/libcrypto_la-sha256-elf-x86_64.lo: sha/$(am__dirstamp) \ sha/$(DEPDIR)/$(am__dirstamp) sha/libcrypto_la-sha512-elf-x86_64.lo: sha/$(am__dirstamp) \ sha/$(DEPDIR)/$(am__dirstamp) -whrlpool/$(am__dirstamp): - @$(MKDIR_P) whrlpool - @: > whrlpool/$(am__dirstamp) -whrlpool/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) whrlpool/$(DEPDIR) - @: > whrlpool/$(DEPDIR)/$(am__dirstamp) whrlpool/libcrypto_la-wp-elf-x86_64.lo: whrlpool/$(am__dirstamp) \ whrlpool/$(DEPDIR)/$(am__dirstamp) aes/libcrypto_la-aes-macosx-x86_64.lo: aes/$(am__dirstamp) \ @@ -1579,20 +2427,74 @@ sha/libcrypto_la-sha512-macosx-x86_64.lo: sha/$(am__dirstamp) \ sha/$(DEPDIR)/$(am__dirstamp) whrlpool/libcrypto_la-wp-macosx-x86_64.lo: whrlpool/$(am__dirstamp) \ whrlpool/$(DEPDIR)/$(am__dirstamp) -aes/libcrypto_la-aes_cbc.lo: aes/$(am__dirstamp) \ +aes/libcrypto_la-aes-masm-x86_64.lo: aes/$(am__dirstamp) \ aes/$(DEPDIR)/$(am__dirstamp) -aes/libcrypto_la-aes_core.lo: aes/$(am__dirstamp) \ +aes/libcrypto_la-bsaes-masm-x86_64.lo: aes/$(am__dirstamp) \ aes/$(DEPDIR)/$(am__dirstamp) -camellia/libcrypto_la-camellia.lo: camellia/$(am__dirstamp) \ - camellia/$(DEPDIR)/$(am__dirstamp) -camellia/libcrypto_la-cmll_cbc.lo: camellia/$(am__dirstamp) \ +aes/libcrypto_la-vpaes-masm-x86_64.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +aes/libcrypto_la-aesni-masm-x86_64.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +aes/libcrypto_la-aesni-sha1-masm-x86_64.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +bn/libcrypto_la-modexp512-masm-x86_64.lo: bn/$(am__dirstamp) \ + bn/$(DEPDIR)/$(am__dirstamp) +bn/libcrypto_la-mont-masm-x86_64.lo: bn/$(am__dirstamp) \ + bn/$(DEPDIR)/$(am__dirstamp) +bn/libcrypto_la-mont5-masm-x86_64.lo: bn/$(am__dirstamp) \ + bn/$(DEPDIR)/$(am__dirstamp) +bn/libcrypto_la-gf2m-masm-x86_64.lo: bn/$(am__dirstamp) \ + bn/$(DEPDIR)/$(am__dirstamp) +camellia/libcrypto_la-cmll-masm-x86_64.lo: camellia/$(am__dirstamp) \ camellia/$(DEPDIR)/$(am__dirstamp) -rc4/libcrypto_la-rc4_enc.lo: rc4/$(am__dirstamp) \ +md5/libcrypto_la-md5-masm-x86_64.lo: md5/$(am__dirstamp) \ + md5/$(DEPDIR)/$(am__dirstamp) +modes/libcrypto_la-ghash-masm-x86_64.lo: modes/$(am__dirstamp) \ + modes/$(DEPDIR)/$(am__dirstamp) +rc4/libcrypto_la-rc4-masm-x86_64.lo: rc4/$(am__dirstamp) \ rc4/$(DEPDIR)/$(am__dirstamp) -rc4/libcrypto_la-rc4_skey.lo: rc4/$(am__dirstamp) \ +rc4/libcrypto_la-rc4-md5-masm-x86_64.lo: rc4/$(am__dirstamp) \ rc4/$(DEPDIR)/$(am__dirstamp) -whrlpool/libcrypto_la-wp_block.lo: whrlpool/$(am__dirstamp) \ +sha/libcrypto_la-sha1-masm-x86_64.lo: sha/$(am__dirstamp) \ + sha/$(DEPDIR)/$(am__dirstamp) +sha/libcrypto_la-sha256-masm-x86_64.lo: sha/$(am__dirstamp) \ + sha/$(DEPDIR)/$(am__dirstamp) +sha/libcrypto_la-sha512-masm-x86_64.lo: sha/$(am__dirstamp) \ + sha/$(DEPDIR)/$(am__dirstamp) +whrlpool/libcrypto_la-wp-masm-x86_64.lo: whrlpool/$(am__dirstamp) \ + whrlpool/$(DEPDIR)/$(am__dirstamp) +aes/libcrypto_la-aes-mingw64-x86_64.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +aes/libcrypto_la-bsaes-mingw64-x86_64.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +aes/libcrypto_la-vpaes-mingw64-x86_64.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +aes/libcrypto_la-aesni-mingw64-x86_64.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +aes/libcrypto_la-aesni-sha1-mingw64-x86_64.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +camellia/libcrypto_la-cmll-mingw64-x86_64.lo: \ + camellia/$(am__dirstamp) camellia/$(DEPDIR)/$(am__dirstamp) +md5/libcrypto_la-md5-mingw64-x86_64.lo: md5/$(am__dirstamp) \ + md5/$(DEPDIR)/$(am__dirstamp) +modes/libcrypto_la-ghash-mingw64-x86_64.lo: modes/$(am__dirstamp) \ + modes/$(DEPDIR)/$(am__dirstamp) +rc4/libcrypto_la-rc4-mingw64-x86_64.lo: rc4/$(am__dirstamp) \ + rc4/$(DEPDIR)/$(am__dirstamp) +rc4/libcrypto_la-rc4-md5-mingw64-x86_64.lo: rc4/$(am__dirstamp) \ + rc4/$(DEPDIR)/$(am__dirstamp) +sha/libcrypto_la-sha1-mingw64-x86_64.lo: sha/$(am__dirstamp) \ + sha/$(DEPDIR)/$(am__dirstamp) +sha/libcrypto_la-sha256-mingw64-x86_64.lo: sha/$(am__dirstamp) \ + sha/$(DEPDIR)/$(am__dirstamp) +sha/libcrypto_la-sha512-mingw64-x86_64.lo: sha/$(am__dirstamp) \ + sha/$(DEPDIR)/$(am__dirstamp) +whrlpool/libcrypto_la-wp-mingw64-x86_64.lo: whrlpool/$(am__dirstamp) \ whrlpool/$(DEPDIR)/$(am__dirstamp) +aes/libcrypto_la-aes_core.lo: aes/$(am__dirstamp) \ + aes/$(DEPDIR)/$(am__dirstamp) +compat/libcrypto_la-crypto_lock_win.lo: compat/$(am__dirstamp) \ + compat/$(DEPDIR)/$(am__dirstamp) aes/libcrypto_la-aes_cfb.lo: aes/$(am__dirstamp) \ aes/$(DEPDIR)/$(am__dirstamp) aes/libcrypto_la-aes_ctr.lo: aes/$(am__dirstamp) \ @@ -1617,8 +2519,6 @@ asn1/libcrypto_la-a_bitstr.lo: asn1/$(am__dirstamp) \ asn1/$(DEPDIR)/$(am__dirstamp) asn1/libcrypto_la-a_bool.lo: asn1/$(am__dirstamp) \ asn1/$(DEPDIR)/$(am__dirstamp) -asn1/libcrypto_la-a_bytes.lo: asn1/$(am__dirstamp) \ - asn1/$(DEPDIR)/$(am__dirstamp) asn1/libcrypto_la-a_d2i_fp.lo: asn1/$(am__dirstamp) \ asn1/$(DEPDIR)/$(am__dirstamp) asn1/libcrypto_la-a_digest.lo: asn1/$(am__dirstamp) \ @@ -1639,8 +2539,6 @@ asn1/libcrypto_la-a_octet.lo: asn1/$(am__dirstamp) \ asn1/$(DEPDIR)/$(am__dirstamp) asn1/libcrypto_la-a_print.lo: asn1/$(am__dirstamp) \ asn1/$(DEPDIR)/$(am__dirstamp) -asn1/libcrypto_la-a_set.lo: asn1/$(am__dirstamp) \ - asn1/$(DEPDIR)/$(am__dirstamp) asn1/libcrypto_la-a_sign.lo: asn1/$(am__dirstamp) \ asn1/$(DEPDIR)/$(am__dirstamp) asn1/libcrypto_la-a_strex.lo: asn1/$(am__dirstamp) \ @@ -1809,6 +2707,8 @@ bio/libcrypto_la-bio_err.lo: bio/$(am__dirstamp) \ bio/$(DEPDIR)/$(am__dirstamp) bio/libcrypto_la-bio_lib.lo: bio/$(am__dirstamp) \ bio/$(DEPDIR)/$(am__dirstamp) +bio/libcrypto_la-bio_meth.lo: bio/$(am__dirstamp) \ + bio/$(DEPDIR)/$(am__dirstamp) bio/libcrypto_la-bss_acpt.lo: bio/$(am__dirstamp) \ bio/$(DEPDIR)/$(am__dirstamp) bio/libcrypto_la-bss_bio.lo: bio/$(am__dirstamp) \ @@ -2084,6 +2984,8 @@ dsa/libcrypto_la-dsa_key.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) dsa/libcrypto_la-dsa_lib.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) +dsa/libcrypto_la-dsa_meth.lo: dsa/$(am__dirstamp) \ + dsa/$(DEPDIR)/$(am__dirstamp) dsa/libcrypto_la-dsa_ossl.lo: dsa/$(am__dirstamp) \ dsa/$(DEPDIR)/$(am__dirstamp) dsa/libcrypto_la-dsa_pmeth.lo: dsa/$(am__dirstamp) \ @@ -2136,6 +3038,8 @@ ec/libcrypto_la-ec_err.lo: ec/$(am__dirstamp) \ ec/$(DEPDIR)/$(am__dirstamp) ec/libcrypto_la-ec_key.lo: ec/$(am__dirstamp) \ ec/$(DEPDIR)/$(am__dirstamp) +ec/libcrypto_la-ec_kmeth.lo: ec/$(am__dirstamp) \ + ec/$(DEPDIR)/$(am__dirstamp) ec/libcrypto_la-ec_lib.lo: ec/$(am__dirstamp) \ ec/$(DEPDIR)/$(am__dirstamp) ec/libcrypto_la-ec_mult.lo: ec/$(am__dirstamp) \ @@ -2230,6 +3134,8 @@ engine/libcrypto_la-tb_ecdh.lo: engine/$(am__dirstamp) \ engine/$(DEPDIR)/$(am__dirstamp) engine/libcrypto_la-tb_ecdsa.lo: engine/$(am__dirstamp) \ engine/$(DEPDIR)/$(am__dirstamp) +engine/libcrypto_la-tb_eckey.lo: engine/$(am__dirstamp) \ + engine/$(DEPDIR)/$(am__dirstamp) engine/libcrypto_la-tb_pkmeth.lo: engine/$(am__dirstamp) \ engine/$(DEPDIR)/$(am__dirstamp) engine/libcrypto_la-tb_rand.lo: engine/$(am__dirstamp) \ @@ -2298,6 +3204,8 @@ evp/libcrypto_la-e_rc4.lo: evp/$(am__dirstamp) \ evp/$(DEPDIR)/$(am__dirstamp) evp/libcrypto_la-e_rc4_hmac_md5.lo: evp/$(am__dirstamp) \ evp/$(DEPDIR)/$(am__dirstamp) +evp/libcrypto_la-e_sm4.lo: evp/$(am__dirstamp) \ + evp/$(DEPDIR)/$(am__dirstamp) evp/libcrypto_la-e_xcbc_d.lo: evp/$(am__dirstamp) \ evp/$(DEPDIR)/$(am__dirstamp) evp/libcrypto_la-encode.lo: evp/$(am__dirstamp) \ @@ -2342,6 +3250,8 @@ evp/libcrypto_la-m_sigver.lo: evp/$(am__dirstamp) \ evp/$(DEPDIR)/$(am__dirstamp) evp/libcrypto_la-m_streebog.lo: evp/$(am__dirstamp) \ evp/$(DEPDIR)/$(am__dirstamp) +evp/libcrypto_la-m_sm3.lo: evp/$(am__dirstamp) \ + evp/$(DEPDIR)/$(am__dirstamp) evp/libcrypto_la-m_wp.lo: evp/$(am__dirstamp) \ evp/$(DEPDIR)/$(am__dirstamp) evp/libcrypto_la-names.lo: evp/$(am__dirstamp) \ @@ -2678,6 +3588,8 @@ rsa/libcrypto_la-rsa_gen.lo: rsa/$(am__dirstamp) \ rsa/$(DEPDIR)/$(am__dirstamp) rsa/libcrypto_la-rsa_lib.lo: rsa/$(am__dirstamp) \ rsa/$(DEPDIR)/$(am__dirstamp) +rsa/libcrypto_la-rsa_meth.lo: rsa/$(am__dirstamp) \ + rsa/$(DEPDIR)/$(am__dirstamp) rsa/libcrypto_la-rsa_none.lo: rsa/$(am__dirstamp) \ rsa/$(DEPDIR)/$(am__dirstamp) rsa/libcrypto_la-rsa_oaep.lo: rsa/$(am__dirstamp) \ @@ -2704,6 +3616,22 @@ sha/libcrypto_la-sha256.lo: sha/$(am__dirstamp) \ sha/$(DEPDIR)/$(am__dirstamp) sha/libcrypto_la-sha512.lo: sha/$(am__dirstamp) \ sha/$(DEPDIR)/$(am__dirstamp) +sm3/$(am__dirstamp): + @$(MKDIR_P) sm3 + @: > sm3/$(am__dirstamp) +sm3/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) sm3/$(DEPDIR) + @: > sm3/$(DEPDIR)/$(am__dirstamp) +sm3/libcrypto_la-sm3.lo: sm3/$(am__dirstamp) \ + sm3/$(DEPDIR)/$(am__dirstamp) +sm4/$(am__dirstamp): + @$(MKDIR_P) sm4 + @: > sm4/$(am__dirstamp) +sm4/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) sm4/$(DEPDIR) + @: > sm4/$(DEPDIR)/$(am__dirstamp) +sm4/libcrypto_la-sm4.lo: sm4/$(am__dirstamp) \ + sm4/$(DEPDIR)/$(am__dirstamp) stack/$(am__dirstamp): @$(MKDIR_P) stack @: > stack/$(am__dirstamp) @@ -2996,6 +3924,10 @@ mostlyclean-compile: -rm -f rsa/*.lo -rm -f sha/*.$(OBJEXT) -rm -f sha/*.lo + -rm -f sm3/*.$(OBJEXT) + -rm -f sm3/*.lo + -rm -f sm4/*.$(OBJEXT) + -rm -f sm4/*.lo -rm -f stack/*.$(OBJEXT) -rm -f stack/*.lo -rm -f ts/*.$(OBJEXT) @@ -3014,616 +3946,678 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cpt_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cpuid-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cpuid-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cryptlib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cversion.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-ex_data.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-malloc-wrapper.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-mem_clr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-mem_dbg.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-o_init.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-o_str.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-o_time.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_cbc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_cfb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_core.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_ctr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_ecb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_ige.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_misc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_ofb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_wrap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-sha1-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-sha1-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-bsaes-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-bsaes-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-vpaes-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-vpaes-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_bitstr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_bool.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_bytes.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_d2i_fp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_digest.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_dup.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_enum.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_i2d_fp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_int.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_mbstr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_object.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_octet.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_print.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_set.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_sign.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_strex.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_strnid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_time.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_time_tm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_utf8.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_verify.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-ameth_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn1_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn1_gen.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn1_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn1_par.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn_mime.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn_moid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn_pack.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-bio_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-bio_ndef.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-d2i_pr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-d2i_pu.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-evp_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-f_enum.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-f_int.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-f_string.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-i2d_pr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-i2d_pu.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-n_pkey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-nsseq.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-p5_pbe.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-p5_pbev2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-p8_pkey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_bitst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_crl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_pkey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_req.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_spki.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_x509.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_x509a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_dec.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_fre.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_new.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_prn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_typ.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_utl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_algor.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_attrib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_bignum.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_crl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_exten.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_info.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_long.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_name.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_nx509.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_pkey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_pubkey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_req.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_sig.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_spki.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_val.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_x509.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_x509a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bf/$(DEPDIR)/libcrypto_la-bf_cfb64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bf/$(DEPDIR)/libcrypto_la-bf_ecb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bf/$(DEPDIR)/libcrypto_la-bf_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bf/$(DEPDIR)/libcrypto_la-bf_ofb64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bf/$(DEPDIR)/libcrypto_la-bf_skey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-b_dump.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-b_posix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-b_print.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-b_sock.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-b_win.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bf_buff.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bf_nbio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bf_null.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bio_cb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bio_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bio_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_acpt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_bio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_conn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_dgram.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_fd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_file.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_log.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_mem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_null.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_sock.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_add.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_asm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_blind.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_const.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_ctx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_depr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_div.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_exp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_exp2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_gcd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_gf2m.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_kron.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_mod.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_mont.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_mpi.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_mul.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_nist.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_prime.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_print.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_rand.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_recp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_shift.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_sqr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_sqrt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_word.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_x931p.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-gf2m-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-gf2m-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-modexp512-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-modexp512-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont5-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont5-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@buffer/$(DEPDIR)/libcrypto_la-buf_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@buffer/$(DEPDIR)/libcrypto_la-buf_str.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@buffer/$(DEPDIR)/libcrypto_la-buffer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-camellia.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_cbc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_cfb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_ctr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_ecb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_misc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_ofb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cast/$(DEPDIR)/libcrypto_la-c_cfb64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cast/$(DEPDIR)/libcrypto_la-c_ecb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cast/$(DEPDIR)/libcrypto_la-c_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cast/$(DEPDIR)/libcrypto_la-c_ofb64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cast/$(DEPDIR)/libcrypto_la-c_skey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@chacha/$(DEPDIR)/libcrypto_la-chacha-merged.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@chacha/$(DEPDIR)/libcrypto_la-chacha.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cmac/$(DEPDIR)/libcrypto_la-cm_ameth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cmac/$(DEPDIR)/libcrypto_la-cm_pmeth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cmac/$(DEPDIR)/libcrypto_la-cmac.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@comp/$(DEPDIR)/libcrypto_la-c_rle.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@comp/$(DEPDIR)/libcrypto_la-c_zlib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@comp/$(DEPDIR)/libcrypto_la-comp_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@comp/$(DEPDIR)/libcrypto_la-comp_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/arc4random.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/arc4random_uniform.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/bsd-asprintf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/freezero.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_aix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_freebsd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_hpux.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_linux.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_netbsd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_osx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_solaris.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_win.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getpagesize.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/inet_pton.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/libcompatnoopt_la-explicit_bzero.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/libcompatnoopt_la-explicit_bzero_win.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/posix_win.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/reallocarray.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/recallocarray.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strlcat.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strlcpy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strndup.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strnlen.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strsep.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/timegm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/timingsafe_bcmp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/timingsafe_memcmp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_api.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_def.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_mall.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_mod.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_sap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@curve25519/$(DEPDIR)/libcrypto_la-curve25519-generic.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@curve25519/$(DEPDIR)/libcrypto_la-curve25519.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-cbc_cksm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-cbc_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-cfb64ede.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-cfb64enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-cfb_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-des_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ecb3_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ecb_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ede_cbcm_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-enc_read.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-enc_writ.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-fcrypt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-fcrypt_b.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ncbc_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ofb64ede.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ofb64enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ofb_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-pcbc_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-qud_cksm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-rand_key.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-set_key.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-str2key.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-xcbc_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_ameth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_check.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_depr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_gen.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_key.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_pmeth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_prn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_ameth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_depr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_gen.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_key.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_ossl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_pmeth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_prn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_sign.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_vrf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dso/$(DEPDIR)/libcrypto_la-dso_dlfcn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dso/$(DEPDIR)/libcrypto_la-dso_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dso/$(DEPDIR)/libcrypto_la-dso_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dso/$(DEPDIR)/libcrypto_la-dso_null.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dso/$(DEPDIR)/libcrypto_la-dso_openssl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec2_mult.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec2_oct.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec2_smpl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_ameth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_check.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_curve.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_cvt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_key.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_mult.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_oct.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_pmeth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_print.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-eck_prn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ecp_mont.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ecp_nist.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ecp_oct.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ecp_smpl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ecdh/$(DEPDIR)/libcrypto_la-ech_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ecdh/$(DEPDIR)/libcrypto_la-ech_key.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ecdh/$(DEPDIR)/libcrypto_la-ech_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_ossl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_sign.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_vrf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_all.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_cnf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_ctrl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_dyn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_fat.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_init.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_list.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_openssl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_pkey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_table.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_asnmth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_cipher.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_dh.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_digest.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_dsa.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_ecdh.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_ecdsa.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_pkmeth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_rand.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_rsa.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_store.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@err/$(DEPDIR)/libcrypto_la-err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@err/$(DEPDIR)/libcrypto_la-err_all.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@err/$(DEPDIR)/libcrypto_la-err_prn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-bio_b64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-bio_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-bio_md.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-c_all.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-digest.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_aes.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_aes_cbc_hmac_sha1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_bf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_camellia.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_cast.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_chacha.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_chacha20poly1305.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_des.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_des3.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_gost2814789.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_idea.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_null.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_old.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_rc2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_rc4.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_rc4_hmac_md5.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_xcbc_d.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-encode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_aead.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_key.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_pbe.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_pkey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_dss.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_dss1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_ecdsa.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_gost2814789.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_gostr341194.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_md4.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_md5.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_md5_sha1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_null.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_ripemd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_sha1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_sigver.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_streebog.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_wp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-names.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p5_crpt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p5_crpt2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_dec.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_open.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_seal.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_sign.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_verify.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-pmeth_fn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-pmeth_gn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-pmeth_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost2814789.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost89_keywrap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost89_params.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost89imit_ameth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost89imit_pmeth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341001.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341001_ameth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341001_key.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341001_params.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341001_pmeth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341194.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-streebog.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@hkdf/$(DEPDIR)/libcrypto_la-hkdf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@hmac/$(DEPDIR)/libcrypto_la-hm_ameth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@hmac/$(DEPDIR)/libcrypto_la-hm_pmeth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@hmac/$(DEPDIR)/libcrypto_la-hmac.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@idea/$(DEPDIR)/libcrypto_la-i_cbc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@idea/$(DEPDIR)/libcrypto_la-i_cfb64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@idea/$(DEPDIR)/libcrypto_la-i_ecb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@idea/$(DEPDIR)/libcrypto_la-i_ofb64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@idea/$(DEPDIR)/libcrypto_la-i_skey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lhash/$(DEPDIR)/libcrypto_la-lh_stats.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@lhash/$(DEPDIR)/libcrypto_la-lhash.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@md4/$(DEPDIR)/libcrypto_la-md4_dgst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@md4/$(DEPDIR)/libcrypto_la-md4_one.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@md5/$(DEPDIR)/libcrypto_la-md5-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@md5/$(DEPDIR)/libcrypto_la-md5-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@md5/$(DEPDIR)/libcrypto_la-md5_dgst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@md5/$(DEPDIR)/libcrypto_la-md5_one.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-cbc128.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ccm128.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-cfb128.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ctr128.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-cts128.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-gcm128.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ghash-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ghash-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ofb128.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-xts128.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@objects/$(DEPDIR)/libcrypto_la-o_names.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@objects/$(DEPDIR)/libcrypto_la-obj_dat.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@objects/$(DEPDIR)/libcrypto_la-obj_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@objects/$(DEPDIR)/libcrypto_la-obj_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@objects/$(DEPDIR)/libcrypto_la-obj_xref.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_asn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_cl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_ext.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_ht.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_prn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_srv.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_vfy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_all.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_info.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_oth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_pk8.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_pkey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_seal.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_sign.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_x509.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_xaux.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pvkfmt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_add.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_asn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_attr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_crpt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_crt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_decr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_init.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_key.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_kiss.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_mutl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_npas.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_p8d.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_p8e.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_utl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-pk12err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-bio_pk7.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_attr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_doit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_mime.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_smime.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pkcs7err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@poly1305/$(DEPDIR)/libcrypto_la-poly1305-donna.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@poly1305/$(DEPDIR)/libcrypto_la-poly1305.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rand/$(DEPDIR)/libcrypto_la-rand_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rand/$(DEPDIR)/libcrypto_la-rand_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rand/$(DEPDIR)/libcrypto_la-randfile.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc2/$(DEPDIR)/libcrypto_la-rc2_cbc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc2/$(DEPDIR)/libcrypto_la-rc2_ecb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc2/$(DEPDIR)/libcrypto_la-rc2_skey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc2/$(DEPDIR)/libcrypto_la-rc2cfb64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc2/$(DEPDIR)/libcrypto_la-rc2ofb64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-md5-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-md5-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4_skey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ripemd/$(DEPDIR)/libcrypto_la-rmd_dgst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ripemd/$(DEPDIR)/libcrypto_la-rmd_one.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_ameth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_chk.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_crpt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_depr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_eay.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_gen.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_none.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_oaep.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_pk1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_pmeth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_prn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_pss.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_saos.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_sign.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_x931.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1_one.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1dgst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha256-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha256-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha256.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha512-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha512-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha512.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@stack/$(DEPDIR)/libcrypto_la-stack.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_conf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_req_print.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_req_utils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_rsp_print.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_rsp_sign.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_rsp_utils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_rsp_verify.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_verify_ctx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@txt_db/$(DEPDIR)/libcrypto_la-txt_db.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ui/$(DEPDIR)/libcrypto_la-ui_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ui/$(DEPDIR)/libcrypto_la-ui_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ui/$(DEPDIR)/libcrypto_la-ui_openssl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ui/$(DEPDIR)/libcrypto_la-ui_openssl_win.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@ui/$(DEPDIR)/libcrypto_la-ui_util.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@whrlpool/$(DEPDIR)/libcrypto_la-wp-elf-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@whrlpool/$(DEPDIR)/libcrypto_la-wp-macosx-x86_64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@whrlpool/$(DEPDIR)/libcrypto_la-wp_block.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@whrlpool/$(DEPDIR)/libcrypto_la-wp_dgst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-by_dir.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-by_file.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-by_mem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_att.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_cmp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_d2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_def.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_ext.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_lu.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_obj.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_r2x.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_req.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_set.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_trs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_txt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_v3.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_vfy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_vpm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509cset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509name.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509rset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509spki.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509type.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x_all.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_cache.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_data.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_map.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_node.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_tree.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_akey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_akeya.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_alt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_bcons.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_bitst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_conf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_cpols.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_crld.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_enum.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_extku.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_genn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_ia5.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_info.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_int.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_ncons.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_ocsp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_pci.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_pcia.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_pcons.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_pku.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_pmaps.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_prn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_purp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_skey.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_sxnet.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_utl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3err.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-armcap.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-armv4cpuid.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cpt_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cpuid-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cpuid-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cpuid-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cpuid-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cryptlib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-crypto_init.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-crypto_lock.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-cversion.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-ex_data.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-malloc-wrapper.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-mem_clr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-mem_dbg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-o_init.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-o_str.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcrypto_la-o_time.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes-elf-armv4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_cbc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_cfb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_core.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_ctr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_ecb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_ige.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_misc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_ofb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aes_wrap.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-sha1-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-sha1-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-sha1-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-aesni-sha1-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-bsaes-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-bsaes-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-bsaes-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-bsaes-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-vpaes-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-vpaes-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-vpaes-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aes/$(DEPDIR)/libcrypto_la-vpaes-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_bitstr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_bool.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_d2i_fp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_digest.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_dup.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_enum.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_i2d_fp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_int.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_mbstr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_object.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_octet.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_print.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_sign.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_strex.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_strnid.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_time.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_time_tm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_type.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_utf8.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-a_verify.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-ameth_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn1_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn1_gen.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn1_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn1_par.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn_mime.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn_moid.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-asn_pack.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-bio_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-bio_ndef.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-d2i_pr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-d2i_pu.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-evp_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-f_enum.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-f_int.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-f_string.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-i2d_pr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-i2d_pu.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-n_pkey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-nsseq.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-p5_pbe.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-p5_pbev2.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-p8_pkey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_bitst.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_crl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_pkey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_req.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_spki.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_x509.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-t_x509a.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_dec.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_fre.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_new.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_prn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_typ.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-tasn_utl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_algor.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_attrib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_bignum.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_crl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_exten.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_long.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_name.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_nx509.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_pkey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_pubkey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_req.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_sig.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_spki.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_val.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_x509.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@asn1/$(DEPDIR)/libcrypto_la-x_x509a.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bf/$(DEPDIR)/libcrypto_la-bf_cfb64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bf/$(DEPDIR)/libcrypto_la-bf_ecb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bf/$(DEPDIR)/libcrypto_la-bf_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bf/$(DEPDIR)/libcrypto_la-bf_ofb64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bf/$(DEPDIR)/libcrypto_la-bf_skey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-b_dump.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-b_posix.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-b_print.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-b_sock.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-b_win.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bf_buff.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bf_nbio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bf_null.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bio_cb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bio_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bio_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bio_meth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_acpt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_bio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_conn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_dgram.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_fd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_file.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_log.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_mem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_null.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bio/$(DEPDIR)/libcrypto_la-bss_sock.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_add.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_asm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_blind.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_const.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_ctx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_depr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_div.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_exp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_exp2.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_gcd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_gf2m.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_kron.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_mod.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_mont.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_mpi.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_mul.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_nist.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_prime.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_print.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_rand.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_recp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_shift.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_sqr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_sqrt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_word.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-bn_x931p.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-gf2m-elf-armv4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-gf2m-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-gf2m-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-gf2m-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-modexp512-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-modexp512-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-modexp512-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont-elf-armv4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont5-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont5-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@bn/$(DEPDIR)/libcrypto_la-mont5-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@buffer/$(DEPDIR)/libcrypto_la-buf_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@buffer/$(DEPDIR)/libcrypto_la-buf_str.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@buffer/$(DEPDIR)/libcrypto_la-buffer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-camellia.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_cbc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_cfb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_ctr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_ecb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_misc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@camellia/$(DEPDIR)/libcrypto_la-cmll_ofb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cast/$(DEPDIR)/libcrypto_la-c_cfb64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cast/$(DEPDIR)/libcrypto_la-c_ecb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cast/$(DEPDIR)/libcrypto_la-c_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cast/$(DEPDIR)/libcrypto_la-c_ofb64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cast/$(DEPDIR)/libcrypto_la-c_skey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@chacha/$(DEPDIR)/libcrypto_la-chacha-merged.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@chacha/$(DEPDIR)/libcrypto_la-chacha.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cmac/$(DEPDIR)/libcrypto_la-cm_ameth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cmac/$(DEPDIR)/libcrypto_la-cm_pmeth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cmac/$(DEPDIR)/libcrypto_la-cmac.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@comp/$(DEPDIR)/libcrypto_la-c_rle.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@comp/$(DEPDIR)/libcrypto_la-c_zlib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@comp/$(DEPDIR)/libcrypto_la-comp_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@comp/$(DEPDIR)/libcrypto_la-comp_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/arc4random.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/arc4random_uniform.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/bsd-asprintf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/freezero.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_aix.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_hpux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_netbsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_osx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_solaris.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getentropy_win.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getpagesize.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getprogname_linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getprogname_unimpl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getprogname_windows.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/libcompatnoopt_la-explicit_bzero.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/libcompatnoopt_la-explicit_bzero_win.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/libcrypto_la-crypto_lock_win.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/posix_win.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/reallocarray.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/recallocarray.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strlcat.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strlcpy.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strndup.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strnlen.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/strsep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/syslog_r.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/timegm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/timingsafe_bcmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/timingsafe_memcmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_api.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_def.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_mall.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_mod.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@conf/$(DEPDIR)/libcrypto_la-conf_sap.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@curve25519/$(DEPDIR)/libcrypto_la-curve25519-generic.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@curve25519/$(DEPDIR)/libcrypto_la-curve25519.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-cbc_cksm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-cbc_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-cfb64ede.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-cfb64enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-cfb_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-des_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ecb3_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ecb_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ede_cbcm_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-enc_read.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-enc_writ.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-fcrypt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-fcrypt_b.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ncbc_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ofb64ede.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ofb64enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-ofb_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-pcbc_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-qud_cksm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-rand_key.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-set_key.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-str2key.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@des/$(DEPDIR)/libcrypto_la-xcbc_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_ameth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_check.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_depr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_gen.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_key.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_pmeth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dh/$(DEPDIR)/libcrypto_la-dh_prn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_ameth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_depr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_gen.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_key.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_meth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_ossl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_pmeth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_prn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_sign.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dsa/$(DEPDIR)/libcrypto_la-dsa_vrf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dso/$(DEPDIR)/libcrypto_la-dso_dlfcn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dso/$(DEPDIR)/libcrypto_la-dso_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dso/$(DEPDIR)/libcrypto_la-dso_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dso/$(DEPDIR)/libcrypto_la-dso_null.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dso/$(DEPDIR)/libcrypto_la-dso_openssl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec2_mult.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec2_oct.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec2_smpl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_ameth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_check.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_curve.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_cvt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_key.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_kmeth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_mult.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_oct.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_pmeth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ec_print.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-eck_prn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ecp_mont.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ecp_nist.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ecp_oct.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ec/$(DEPDIR)/libcrypto_la-ecp_smpl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ecdh/$(DEPDIR)/libcrypto_la-ech_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ecdh/$(DEPDIR)/libcrypto_la-ech_key.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ecdh/$(DEPDIR)/libcrypto_la-ech_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_ossl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_sign.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ecdsa/$(DEPDIR)/libcrypto_la-ecs_vrf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_all.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_cnf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_ctrl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_dyn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_fat.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_init.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_list.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_openssl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_pkey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-eng_table.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_asnmth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_cipher.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_dh.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_digest.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_dsa.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_ecdh.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_ecdsa.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_eckey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_pkmeth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_rand.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_rsa.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@engine/$(DEPDIR)/libcrypto_la-tb_store.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@err/$(DEPDIR)/libcrypto_la-err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@err/$(DEPDIR)/libcrypto_la-err_all.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@err/$(DEPDIR)/libcrypto_la-err_prn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-bio_b64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-bio_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-bio_md.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-c_all.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-digest.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_aes.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_aes_cbc_hmac_sha1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_bf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_camellia.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_cast.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_chacha.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_chacha20poly1305.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_des.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_des3.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_gost2814789.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_idea.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_null.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_old.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_rc2.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_rc4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_rc4_hmac_md5.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_sm4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-e_xcbc_d.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-encode.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_aead.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_key.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_pbe.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-evp_pkey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_dss.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_dss1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_ecdsa.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_gost2814789.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_gostr341194.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_md4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_md5.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_md5_sha1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_null.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_ripemd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_sha1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_sigver.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_sm3.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_streebog.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-m_wp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-names.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p5_crpt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p5_crpt2.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_dec.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_open.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_seal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_sign.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-p_verify.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-pmeth_fn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-pmeth_gn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@evp/$(DEPDIR)/libcrypto_la-pmeth_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost2814789.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost89_keywrap.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost89_params.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost89imit_ameth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost89imit_pmeth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gost_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341001.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341001_ameth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341001_key.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341001_params.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341001_pmeth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-gostr341194.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@gost/$(DEPDIR)/libcrypto_la-streebog.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hkdf/$(DEPDIR)/libcrypto_la-hkdf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hmac/$(DEPDIR)/libcrypto_la-hm_ameth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hmac/$(DEPDIR)/libcrypto_la-hm_pmeth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hmac/$(DEPDIR)/libcrypto_la-hmac.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@idea/$(DEPDIR)/libcrypto_la-i_cbc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@idea/$(DEPDIR)/libcrypto_la-i_cfb64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@idea/$(DEPDIR)/libcrypto_la-i_ecb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@idea/$(DEPDIR)/libcrypto_la-i_ofb64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@idea/$(DEPDIR)/libcrypto_la-i_skey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lhash/$(DEPDIR)/libcrypto_la-lh_stats.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lhash/$(DEPDIR)/libcrypto_la-lhash.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@md4/$(DEPDIR)/libcrypto_la-md4_dgst.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@md4/$(DEPDIR)/libcrypto_la-md4_one.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@md5/$(DEPDIR)/libcrypto_la-md5-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@md5/$(DEPDIR)/libcrypto_la-md5-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@md5/$(DEPDIR)/libcrypto_la-md5-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@md5/$(DEPDIR)/libcrypto_la-md5-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@md5/$(DEPDIR)/libcrypto_la-md5_dgst.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@md5/$(DEPDIR)/libcrypto_la-md5_one.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-cbc128.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ccm128.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-cfb128.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ctr128.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-cts128.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-gcm128.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ghash-elf-armv4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ghash-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ghash-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ghash-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ghash-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-ofb128.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@modes/$(DEPDIR)/libcrypto_la-xts128.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@objects/$(DEPDIR)/libcrypto_la-o_names.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@objects/$(DEPDIR)/libcrypto_la-obj_dat.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@objects/$(DEPDIR)/libcrypto_la-obj_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@objects/$(DEPDIR)/libcrypto_la-obj_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@objects/$(DEPDIR)/libcrypto_la-obj_xref.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_asn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_cl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_ext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_ht.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_prn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_srv.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ocsp/$(DEPDIR)/libcrypto_la-ocsp_vfy.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_all.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_oth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_pk8.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_pkey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_seal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_sign.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_x509.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pem_xaux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pem/$(DEPDIR)/libcrypto_la-pvkfmt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_add.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_asn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_attr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_crpt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_crt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_decr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_init.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_key.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_kiss.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_mutl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_npas.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_p8d.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_p8e.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-p12_utl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs12/$(DEPDIR)/libcrypto_la-pk12err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-bio_pk7.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_attr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_doit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_mime.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pk7_smime.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pkcs7/$(DEPDIR)/libcrypto_la-pkcs7err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@poly1305/$(DEPDIR)/libcrypto_la-poly1305-donna.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@poly1305/$(DEPDIR)/libcrypto_la-poly1305.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rand/$(DEPDIR)/libcrypto_la-rand_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rand/$(DEPDIR)/libcrypto_la-rand_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rand/$(DEPDIR)/libcrypto_la-randfile.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc2/$(DEPDIR)/libcrypto_la-rc2_cbc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc2/$(DEPDIR)/libcrypto_la-rc2_ecb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc2/$(DEPDIR)/libcrypto_la-rc2_skey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc2/$(DEPDIR)/libcrypto_la-rc2cfb64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc2/$(DEPDIR)/libcrypto_la-rc2ofb64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-md5-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-md5-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-md5-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-md5-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rc4/$(DEPDIR)/libcrypto_la-rc4_skey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ripemd/$(DEPDIR)/libcrypto_la-rmd_dgst.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ripemd/$(DEPDIR)/libcrypto_la-rmd_one.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_ameth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_chk.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_crpt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_depr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_eay.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_gen.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_meth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_none.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_oaep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_pk1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_pmeth.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_prn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_pss.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_saos.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_sign.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@rsa/$(DEPDIR)/libcrypto_la-rsa_x931.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1-elf-armv4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1_one.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha1dgst.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha256-elf-armv4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha256-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha256-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha256-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha256-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha256.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha512-elf-armv4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha512-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha512-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha512-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha512-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sha/$(DEPDIR)/libcrypto_la-sha512.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sm3/$(DEPDIR)/libcrypto_la-sm3.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sm4/$(DEPDIR)/libcrypto_la-sm4.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@stack/$(DEPDIR)/libcrypto_la-stack.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_conf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_req_print.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_req_utils.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_rsp_print.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_rsp_sign.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_rsp_utils.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_rsp_verify.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ts/$(DEPDIR)/libcrypto_la-ts_verify_ctx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@txt_db/$(DEPDIR)/libcrypto_la-txt_db.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ui/$(DEPDIR)/libcrypto_la-ui_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ui/$(DEPDIR)/libcrypto_la-ui_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ui/$(DEPDIR)/libcrypto_la-ui_openssl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ui/$(DEPDIR)/libcrypto_la-ui_openssl_win.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ui/$(DEPDIR)/libcrypto_la-ui_util.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@whrlpool/$(DEPDIR)/libcrypto_la-wp-elf-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@whrlpool/$(DEPDIR)/libcrypto_la-wp-macosx-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@whrlpool/$(DEPDIR)/libcrypto_la-wp-masm-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@whrlpool/$(DEPDIR)/libcrypto_la-wp-mingw64-x86_64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@whrlpool/$(DEPDIR)/libcrypto_la-wp_block.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@whrlpool/$(DEPDIR)/libcrypto_la-wp_dgst.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-by_dir.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-by_file.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-by_mem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_att.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_cmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_d2.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_def.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_ext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_lu.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_obj.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_r2x.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_req.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_set.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_trs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_txt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_v3.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_vfy.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509_vpm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509cset.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509name.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509rset.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509spki.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x509type.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509/$(DEPDIR)/libcrypto_la-x_all.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_cache.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_data.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_map.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_node.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-pcy_tree.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_akey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_akeya.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_alt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_bcons.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_bitst.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_conf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_cpols.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_crld.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_enum.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_extku.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_genn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_ia5.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_int.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_ncons.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_ocsp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_pci.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_pcia.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_pcons.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_pku.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_pmaps.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_prn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_purp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_skey.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_sxnet.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3_utl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x509v3/$(DEPDIR)/libcrypto_la-v3err.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .S.o: @am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -3649,271 +4643,565 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $< +aes/libcrypto_la-aes-elf-armv4.lo: aes/aes-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aes-elf-armv4.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aes-elf-armv4.Tpo -c -o aes/libcrypto_la-aes-elf-armv4.lo `test -f 'aes/aes-elf-armv4.S' || echo '$(srcdir)/'`aes/aes-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aes-elf-armv4.Tpo aes/$(DEPDIR)/libcrypto_la-aes-elf-armv4.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aes-elf-armv4.S' object='aes/libcrypto_la-aes-elf-armv4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aes-elf-armv4.lo `test -f 'aes/aes-elf-armv4.S' || echo '$(srcdir)/'`aes/aes-elf-armv4.S + +bn/libcrypto_la-gf2m-elf-armv4.lo: bn/gf2m-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-gf2m-elf-armv4.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-gf2m-elf-armv4.Tpo -c -o bn/libcrypto_la-gf2m-elf-armv4.lo `test -f 'bn/gf2m-elf-armv4.S' || echo '$(srcdir)/'`bn/gf2m-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-gf2m-elf-armv4.Tpo bn/$(DEPDIR)/libcrypto_la-gf2m-elf-armv4.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/gf2m-elf-armv4.S' object='bn/libcrypto_la-gf2m-elf-armv4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-gf2m-elf-armv4.lo `test -f 'bn/gf2m-elf-armv4.S' || echo '$(srcdir)/'`bn/gf2m-elf-armv4.S + +bn/libcrypto_la-mont-elf-armv4.lo: bn/mont-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont-elf-armv4.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont-elf-armv4.Tpo -c -o bn/libcrypto_la-mont-elf-armv4.lo `test -f 'bn/mont-elf-armv4.S' || echo '$(srcdir)/'`bn/mont-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-mont-elf-armv4.Tpo bn/$(DEPDIR)/libcrypto_la-mont-elf-armv4.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/mont-elf-armv4.S' object='bn/libcrypto_la-mont-elf-armv4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont-elf-armv4.lo `test -f 'bn/mont-elf-armv4.S' || echo '$(srcdir)/'`bn/mont-elf-armv4.S + +sha/libcrypto_la-sha1-elf-armv4.lo: sha/sha1-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha1-elf-armv4.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha1-elf-armv4.Tpo -c -o sha/libcrypto_la-sha1-elf-armv4.lo `test -f 'sha/sha1-elf-armv4.S' || echo '$(srcdir)/'`sha/sha1-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha1-elf-armv4.Tpo sha/$(DEPDIR)/libcrypto_la-sha1-elf-armv4.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha1-elf-armv4.S' object='sha/libcrypto_la-sha1-elf-armv4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha1-elf-armv4.lo `test -f 'sha/sha1-elf-armv4.S' || echo '$(srcdir)/'`sha/sha1-elf-armv4.S + +sha/libcrypto_la-sha512-elf-armv4.lo: sha/sha512-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha512-elf-armv4.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha512-elf-armv4.Tpo -c -o sha/libcrypto_la-sha512-elf-armv4.lo `test -f 'sha/sha512-elf-armv4.S' || echo '$(srcdir)/'`sha/sha512-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha512-elf-armv4.Tpo sha/$(DEPDIR)/libcrypto_la-sha512-elf-armv4.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha512-elf-armv4.S' object='sha/libcrypto_la-sha512-elf-armv4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha512-elf-armv4.lo `test -f 'sha/sha512-elf-armv4.S' || echo '$(srcdir)/'`sha/sha512-elf-armv4.S + +sha/libcrypto_la-sha256-elf-armv4.lo: sha/sha256-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha256-elf-armv4.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha256-elf-armv4.Tpo -c -o sha/libcrypto_la-sha256-elf-armv4.lo `test -f 'sha/sha256-elf-armv4.S' || echo '$(srcdir)/'`sha/sha256-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha256-elf-armv4.Tpo sha/$(DEPDIR)/libcrypto_la-sha256-elf-armv4.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha256-elf-armv4.S' object='sha/libcrypto_la-sha256-elf-armv4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha256-elf-armv4.lo `test -f 'sha/sha256-elf-armv4.S' || echo '$(srcdir)/'`sha/sha256-elf-armv4.S + +modes/libcrypto_la-ghash-elf-armv4.lo: modes/ghash-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT modes/libcrypto_la-ghash-elf-armv4.lo -MD -MP -MF modes/$(DEPDIR)/libcrypto_la-ghash-elf-armv4.Tpo -c -o modes/libcrypto_la-ghash-elf-armv4.lo `test -f 'modes/ghash-elf-armv4.S' || echo '$(srcdir)/'`modes/ghash-elf-armv4.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) modes/$(DEPDIR)/libcrypto_la-ghash-elf-armv4.Tpo modes/$(DEPDIR)/libcrypto_la-ghash-elf-armv4.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='modes/ghash-elf-armv4.S' object='modes/libcrypto_la-ghash-elf-armv4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o modes/libcrypto_la-ghash-elf-armv4.lo `test -f 'modes/ghash-elf-armv4.S' || echo '$(srcdir)/'`modes/ghash-elf-armv4.S + +libcrypto_la-armv4cpuid.lo: armv4cpuid.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT libcrypto_la-armv4cpuid.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-armv4cpuid.Tpo -c -o libcrypto_la-armv4cpuid.lo `test -f 'armv4cpuid.S' || echo '$(srcdir)/'`armv4cpuid.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcrypto_la-armv4cpuid.Tpo $(DEPDIR)/libcrypto_la-armv4cpuid.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='armv4cpuid.S' object='libcrypto_la-armv4cpuid.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o libcrypto_la-armv4cpuid.lo `test -f 'armv4cpuid.S' || echo '$(srcdir)/'`armv4cpuid.S + aes/libcrypto_la-aes-elf-x86_64.lo: aes/aes-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aes-elf-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aes-elf-x86_64.Tpo -c -o aes/libcrypto_la-aes-elf-x86_64.lo `test -f 'aes/aes-elf-x86_64.S' || echo '$(srcdir)/'`aes/aes-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aes-elf-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aes-elf-x86_64.Tpo -c -o aes/libcrypto_la-aes-elf-x86_64.lo `test -f 'aes/aes-elf-x86_64.S' || echo '$(srcdir)/'`aes/aes-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aes-elf-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aes-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aes-elf-x86_64.S' object='aes/libcrypto_la-aes-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aes-elf-x86_64.lo `test -f 'aes/aes-elf-x86_64.S' || echo '$(srcdir)/'`aes/aes-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aes-elf-x86_64.lo `test -f 'aes/aes-elf-x86_64.S' || echo '$(srcdir)/'`aes/aes-elf-x86_64.S aes/libcrypto_la-bsaes-elf-x86_64.lo: aes/bsaes-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-bsaes-elf-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-bsaes-elf-x86_64.Tpo -c -o aes/libcrypto_la-bsaes-elf-x86_64.lo `test -f 'aes/bsaes-elf-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-bsaes-elf-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-bsaes-elf-x86_64.Tpo -c -o aes/libcrypto_la-bsaes-elf-x86_64.lo `test -f 'aes/bsaes-elf-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-bsaes-elf-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-bsaes-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/bsaes-elf-x86_64.S' object='aes/libcrypto_la-bsaes-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-bsaes-elf-x86_64.lo `test -f 'aes/bsaes-elf-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-bsaes-elf-x86_64.lo `test -f 'aes/bsaes-elf-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-elf-x86_64.S aes/libcrypto_la-vpaes-elf-x86_64.lo: aes/vpaes-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-vpaes-elf-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-vpaes-elf-x86_64.Tpo -c -o aes/libcrypto_la-vpaes-elf-x86_64.lo `test -f 'aes/vpaes-elf-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-vpaes-elf-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-vpaes-elf-x86_64.Tpo -c -o aes/libcrypto_la-vpaes-elf-x86_64.lo `test -f 'aes/vpaes-elf-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-vpaes-elf-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-vpaes-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/vpaes-elf-x86_64.S' object='aes/libcrypto_la-vpaes-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-vpaes-elf-x86_64.lo `test -f 'aes/vpaes-elf-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-vpaes-elf-x86_64.lo `test -f 'aes/vpaes-elf-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-elf-x86_64.S aes/libcrypto_la-aesni-elf-x86_64.lo: aes/aesni-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-elf-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-elf-x86_64.Tpo -c -o aes/libcrypto_la-aesni-elf-x86_64.lo `test -f 'aes/aesni-elf-x86_64.S' || echo '$(srcdir)/'`aes/aesni-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-elf-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-elf-x86_64.Tpo -c -o aes/libcrypto_la-aesni-elf-x86_64.lo `test -f 'aes/aesni-elf-x86_64.S' || echo '$(srcdir)/'`aes/aesni-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aesni-elf-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aesni-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aesni-elf-x86_64.S' object='aes/libcrypto_la-aesni-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-elf-x86_64.lo `test -f 'aes/aesni-elf-x86_64.S' || echo '$(srcdir)/'`aes/aesni-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-elf-x86_64.lo `test -f 'aes/aesni-elf-x86_64.S' || echo '$(srcdir)/'`aes/aesni-elf-x86_64.S aes/libcrypto_la-aesni-sha1-elf-x86_64.lo: aes/aesni-sha1-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-sha1-elf-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-sha1-elf-x86_64.Tpo -c -o aes/libcrypto_la-aesni-sha1-elf-x86_64.lo `test -f 'aes/aesni-sha1-elf-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-sha1-elf-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-sha1-elf-x86_64.Tpo -c -o aes/libcrypto_la-aesni-sha1-elf-x86_64.lo `test -f 'aes/aesni-sha1-elf-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aesni-sha1-elf-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aesni-sha1-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aesni-sha1-elf-x86_64.S' object='aes/libcrypto_la-aesni-sha1-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-sha1-elf-x86_64.lo `test -f 'aes/aesni-sha1-elf-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-sha1-elf-x86_64.lo `test -f 'aes/aesni-sha1-elf-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-elf-x86_64.S bn/libcrypto_la-modexp512-elf-x86_64.lo: bn/modexp512-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-modexp512-elf-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-modexp512-elf-x86_64.Tpo -c -o bn/libcrypto_la-modexp512-elf-x86_64.lo `test -f 'bn/modexp512-elf-x86_64.S' || echo '$(srcdir)/'`bn/modexp512-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-modexp512-elf-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-modexp512-elf-x86_64.Tpo -c -o bn/libcrypto_la-modexp512-elf-x86_64.lo `test -f 'bn/modexp512-elf-x86_64.S' || echo '$(srcdir)/'`bn/modexp512-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-modexp512-elf-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-modexp512-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/modexp512-elf-x86_64.S' object='bn/libcrypto_la-modexp512-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-modexp512-elf-x86_64.lo `test -f 'bn/modexp512-elf-x86_64.S' || echo '$(srcdir)/'`bn/modexp512-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-modexp512-elf-x86_64.lo `test -f 'bn/modexp512-elf-x86_64.S' || echo '$(srcdir)/'`bn/modexp512-elf-x86_64.S bn/libcrypto_la-mont-elf-x86_64.lo: bn/mont-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont-elf-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont-elf-x86_64.Tpo -c -o bn/libcrypto_la-mont-elf-x86_64.lo `test -f 'bn/mont-elf-x86_64.S' || echo '$(srcdir)/'`bn/mont-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont-elf-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont-elf-x86_64.Tpo -c -o bn/libcrypto_la-mont-elf-x86_64.lo `test -f 'bn/mont-elf-x86_64.S' || echo '$(srcdir)/'`bn/mont-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-mont-elf-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-mont-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/mont-elf-x86_64.S' object='bn/libcrypto_la-mont-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont-elf-x86_64.lo `test -f 'bn/mont-elf-x86_64.S' || echo '$(srcdir)/'`bn/mont-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont-elf-x86_64.lo `test -f 'bn/mont-elf-x86_64.S' || echo '$(srcdir)/'`bn/mont-elf-x86_64.S bn/libcrypto_la-mont5-elf-x86_64.lo: bn/mont5-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont5-elf-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont5-elf-x86_64.Tpo -c -o bn/libcrypto_la-mont5-elf-x86_64.lo `test -f 'bn/mont5-elf-x86_64.S' || echo '$(srcdir)/'`bn/mont5-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont5-elf-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont5-elf-x86_64.Tpo -c -o bn/libcrypto_la-mont5-elf-x86_64.lo `test -f 'bn/mont5-elf-x86_64.S' || echo '$(srcdir)/'`bn/mont5-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-mont5-elf-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-mont5-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/mont5-elf-x86_64.S' object='bn/libcrypto_la-mont5-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont5-elf-x86_64.lo `test -f 'bn/mont5-elf-x86_64.S' || echo '$(srcdir)/'`bn/mont5-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont5-elf-x86_64.lo `test -f 'bn/mont5-elf-x86_64.S' || echo '$(srcdir)/'`bn/mont5-elf-x86_64.S bn/libcrypto_la-gf2m-elf-x86_64.lo: bn/gf2m-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-gf2m-elf-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-gf2m-elf-x86_64.Tpo -c -o bn/libcrypto_la-gf2m-elf-x86_64.lo `test -f 'bn/gf2m-elf-x86_64.S' || echo '$(srcdir)/'`bn/gf2m-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-gf2m-elf-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-gf2m-elf-x86_64.Tpo -c -o bn/libcrypto_la-gf2m-elf-x86_64.lo `test -f 'bn/gf2m-elf-x86_64.S' || echo '$(srcdir)/'`bn/gf2m-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-gf2m-elf-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-gf2m-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/gf2m-elf-x86_64.S' object='bn/libcrypto_la-gf2m-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-gf2m-elf-x86_64.lo `test -f 'bn/gf2m-elf-x86_64.S' || echo '$(srcdir)/'`bn/gf2m-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-gf2m-elf-x86_64.lo `test -f 'bn/gf2m-elf-x86_64.S' || echo '$(srcdir)/'`bn/gf2m-elf-x86_64.S camellia/libcrypto_la-cmll-elf-x86_64.lo: camellia/cmll-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT camellia/libcrypto_la-cmll-elf-x86_64.lo -MD -MP -MF camellia/$(DEPDIR)/libcrypto_la-cmll-elf-x86_64.Tpo -c -o camellia/libcrypto_la-cmll-elf-x86_64.lo `test -f 'camellia/cmll-elf-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT camellia/libcrypto_la-cmll-elf-x86_64.lo -MD -MP -MF camellia/$(DEPDIR)/libcrypto_la-cmll-elf-x86_64.Tpo -c -o camellia/libcrypto_la-cmll-elf-x86_64.lo `test -f 'camellia/cmll-elf-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) camellia/$(DEPDIR)/libcrypto_la-cmll-elf-x86_64.Tpo camellia/$(DEPDIR)/libcrypto_la-cmll-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='camellia/cmll-elf-x86_64.S' object='camellia/libcrypto_la-cmll-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o camellia/libcrypto_la-cmll-elf-x86_64.lo `test -f 'camellia/cmll-elf-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o camellia/libcrypto_la-cmll-elf-x86_64.lo `test -f 'camellia/cmll-elf-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-elf-x86_64.S md5/libcrypto_la-md5-elf-x86_64.lo: md5/md5-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT md5/libcrypto_la-md5-elf-x86_64.lo -MD -MP -MF md5/$(DEPDIR)/libcrypto_la-md5-elf-x86_64.Tpo -c -o md5/libcrypto_la-md5-elf-x86_64.lo `test -f 'md5/md5-elf-x86_64.S' || echo '$(srcdir)/'`md5/md5-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT md5/libcrypto_la-md5-elf-x86_64.lo -MD -MP -MF md5/$(DEPDIR)/libcrypto_la-md5-elf-x86_64.Tpo -c -o md5/libcrypto_la-md5-elf-x86_64.lo `test -f 'md5/md5-elf-x86_64.S' || echo '$(srcdir)/'`md5/md5-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) md5/$(DEPDIR)/libcrypto_la-md5-elf-x86_64.Tpo md5/$(DEPDIR)/libcrypto_la-md5-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='md5/md5-elf-x86_64.S' object='md5/libcrypto_la-md5-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o md5/libcrypto_la-md5-elf-x86_64.lo `test -f 'md5/md5-elf-x86_64.S' || echo '$(srcdir)/'`md5/md5-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o md5/libcrypto_la-md5-elf-x86_64.lo `test -f 'md5/md5-elf-x86_64.S' || echo '$(srcdir)/'`md5/md5-elf-x86_64.S modes/libcrypto_la-ghash-elf-x86_64.lo: modes/ghash-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT modes/libcrypto_la-ghash-elf-x86_64.lo -MD -MP -MF modes/$(DEPDIR)/libcrypto_la-ghash-elf-x86_64.Tpo -c -o modes/libcrypto_la-ghash-elf-x86_64.lo `test -f 'modes/ghash-elf-x86_64.S' || echo '$(srcdir)/'`modes/ghash-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT modes/libcrypto_la-ghash-elf-x86_64.lo -MD -MP -MF modes/$(DEPDIR)/libcrypto_la-ghash-elf-x86_64.Tpo -c -o modes/libcrypto_la-ghash-elf-x86_64.lo `test -f 'modes/ghash-elf-x86_64.S' || echo '$(srcdir)/'`modes/ghash-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) modes/$(DEPDIR)/libcrypto_la-ghash-elf-x86_64.Tpo modes/$(DEPDIR)/libcrypto_la-ghash-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='modes/ghash-elf-x86_64.S' object='modes/libcrypto_la-ghash-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o modes/libcrypto_la-ghash-elf-x86_64.lo `test -f 'modes/ghash-elf-x86_64.S' || echo '$(srcdir)/'`modes/ghash-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o modes/libcrypto_la-ghash-elf-x86_64.lo `test -f 'modes/ghash-elf-x86_64.S' || echo '$(srcdir)/'`modes/ghash-elf-x86_64.S rc4/libcrypto_la-rc4-elf-x86_64.lo: rc4/rc4-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-elf-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-elf-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-elf-x86_64.lo `test -f 'rc4/rc4-elf-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-elf-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-elf-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-elf-x86_64.lo `test -f 'rc4/rc4-elf-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) rc4/$(DEPDIR)/libcrypto_la-rc4-elf-x86_64.Tpo rc4/$(DEPDIR)/libcrypto_la-rc4-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='rc4/rc4-elf-x86_64.S' object='rc4/libcrypto_la-rc4-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-elf-x86_64.lo `test -f 'rc4/rc4-elf-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-elf-x86_64.lo `test -f 'rc4/rc4-elf-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-elf-x86_64.S rc4/libcrypto_la-rc4-md5-elf-x86_64.lo: rc4/rc4-md5-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-md5-elf-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-md5-elf-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-md5-elf-x86_64.lo `test -f 'rc4/rc4-md5-elf-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-md5-elf-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-md5-elf-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-md5-elf-x86_64.lo `test -f 'rc4/rc4-md5-elf-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) rc4/$(DEPDIR)/libcrypto_la-rc4-md5-elf-x86_64.Tpo rc4/$(DEPDIR)/libcrypto_la-rc4-md5-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='rc4/rc4-md5-elf-x86_64.S' object='rc4/libcrypto_la-rc4-md5-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-md5-elf-x86_64.lo `test -f 'rc4/rc4-md5-elf-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-md5-elf-x86_64.lo `test -f 'rc4/rc4-md5-elf-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-elf-x86_64.S sha/libcrypto_la-sha1-elf-x86_64.lo: sha/sha1-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha1-elf-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha1-elf-x86_64.Tpo -c -o sha/libcrypto_la-sha1-elf-x86_64.lo `test -f 'sha/sha1-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha1-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha1-elf-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha1-elf-x86_64.Tpo -c -o sha/libcrypto_la-sha1-elf-x86_64.lo `test -f 'sha/sha1-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha1-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha1-elf-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha1-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha1-elf-x86_64.S' object='sha/libcrypto_la-sha1-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha1-elf-x86_64.lo `test -f 'sha/sha1-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha1-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha1-elf-x86_64.lo `test -f 'sha/sha1-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha1-elf-x86_64.S sha/libcrypto_la-sha256-elf-x86_64.lo: sha/sha256-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha256-elf-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha256-elf-x86_64.Tpo -c -o sha/libcrypto_la-sha256-elf-x86_64.lo `test -f 'sha/sha256-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha256-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha256-elf-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha256-elf-x86_64.Tpo -c -o sha/libcrypto_la-sha256-elf-x86_64.lo `test -f 'sha/sha256-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha256-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha256-elf-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha256-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha256-elf-x86_64.S' object='sha/libcrypto_la-sha256-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha256-elf-x86_64.lo `test -f 'sha/sha256-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha256-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha256-elf-x86_64.lo `test -f 'sha/sha256-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha256-elf-x86_64.S sha/libcrypto_la-sha512-elf-x86_64.lo: sha/sha512-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha512-elf-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha512-elf-x86_64.Tpo -c -o sha/libcrypto_la-sha512-elf-x86_64.lo `test -f 'sha/sha512-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha512-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha512-elf-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha512-elf-x86_64.Tpo -c -o sha/libcrypto_la-sha512-elf-x86_64.lo `test -f 'sha/sha512-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha512-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha512-elf-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha512-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha512-elf-x86_64.S' object='sha/libcrypto_la-sha512-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha512-elf-x86_64.lo `test -f 'sha/sha512-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha512-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha512-elf-x86_64.lo `test -f 'sha/sha512-elf-x86_64.S' || echo '$(srcdir)/'`sha/sha512-elf-x86_64.S whrlpool/libcrypto_la-wp-elf-x86_64.lo: whrlpool/wp-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT whrlpool/libcrypto_la-wp-elf-x86_64.lo -MD -MP -MF whrlpool/$(DEPDIR)/libcrypto_la-wp-elf-x86_64.Tpo -c -o whrlpool/libcrypto_la-wp-elf-x86_64.lo `test -f 'whrlpool/wp-elf-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT whrlpool/libcrypto_la-wp-elf-x86_64.lo -MD -MP -MF whrlpool/$(DEPDIR)/libcrypto_la-wp-elf-x86_64.Tpo -c -o whrlpool/libcrypto_la-wp-elf-x86_64.lo `test -f 'whrlpool/wp-elf-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) whrlpool/$(DEPDIR)/libcrypto_la-wp-elf-x86_64.Tpo whrlpool/$(DEPDIR)/libcrypto_la-wp-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='whrlpool/wp-elf-x86_64.S' object='whrlpool/libcrypto_la-wp-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o whrlpool/libcrypto_la-wp-elf-x86_64.lo `test -f 'whrlpool/wp-elf-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o whrlpool/libcrypto_la-wp-elf-x86_64.lo `test -f 'whrlpool/wp-elf-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-elf-x86_64.S libcrypto_la-cpuid-elf-x86_64.lo: cpuid-elf-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT libcrypto_la-cpuid-elf-x86_64.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-cpuid-elf-x86_64.Tpo -c -o libcrypto_la-cpuid-elf-x86_64.lo `test -f 'cpuid-elf-x86_64.S' || echo '$(srcdir)/'`cpuid-elf-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT libcrypto_la-cpuid-elf-x86_64.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-cpuid-elf-x86_64.Tpo -c -o libcrypto_la-cpuid-elf-x86_64.lo `test -f 'cpuid-elf-x86_64.S' || echo '$(srcdir)/'`cpuid-elf-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcrypto_la-cpuid-elf-x86_64.Tpo $(DEPDIR)/libcrypto_la-cpuid-elf-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='cpuid-elf-x86_64.S' object='libcrypto_la-cpuid-elf-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o libcrypto_la-cpuid-elf-x86_64.lo `test -f 'cpuid-elf-x86_64.S' || echo '$(srcdir)/'`cpuid-elf-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o libcrypto_la-cpuid-elf-x86_64.lo `test -f 'cpuid-elf-x86_64.S' || echo '$(srcdir)/'`cpuid-elf-x86_64.S aes/libcrypto_la-aes-macosx-x86_64.lo: aes/aes-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aes-macosx-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aes-macosx-x86_64.Tpo -c -o aes/libcrypto_la-aes-macosx-x86_64.lo `test -f 'aes/aes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aes-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aes-macosx-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aes-macosx-x86_64.Tpo -c -o aes/libcrypto_la-aes-macosx-x86_64.lo `test -f 'aes/aes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aes-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aes-macosx-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aes-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aes-macosx-x86_64.S' object='aes/libcrypto_la-aes-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aes-macosx-x86_64.lo `test -f 'aes/aes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aes-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aes-macosx-x86_64.lo `test -f 'aes/aes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aes-macosx-x86_64.S aes/libcrypto_la-bsaes-macosx-x86_64.lo: aes/bsaes-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-bsaes-macosx-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-bsaes-macosx-x86_64.Tpo -c -o aes/libcrypto_la-bsaes-macosx-x86_64.lo `test -f 'aes/bsaes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-bsaes-macosx-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-bsaes-macosx-x86_64.Tpo -c -o aes/libcrypto_la-bsaes-macosx-x86_64.lo `test -f 'aes/bsaes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-bsaes-macosx-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-bsaes-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/bsaes-macosx-x86_64.S' object='aes/libcrypto_la-bsaes-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-bsaes-macosx-x86_64.lo `test -f 'aes/bsaes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-bsaes-macosx-x86_64.lo `test -f 'aes/bsaes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-macosx-x86_64.S aes/libcrypto_la-vpaes-macosx-x86_64.lo: aes/vpaes-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-vpaes-macosx-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-vpaes-macosx-x86_64.Tpo -c -o aes/libcrypto_la-vpaes-macosx-x86_64.lo `test -f 'aes/vpaes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-vpaes-macosx-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-vpaes-macosx-x86_64.Tpo -c -o aes/libcrypto_la-vpaes-macosx-x86_64.lo `test -f 'aes/vpaes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-vpaes-macosx-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-vpaes-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/vpaes-macosx-x86_64.S' object='aes/libcrypto_la-vpaes-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-vpaes-macosx-x86_64.lo `test -f 'aes/vpaes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-vpaes-macosx-x86_64.lo `test -f 'aes/vpaes-macosx-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-macosx-x86_64.S aes/libcrypto_la-aesni-macosx-x86_64.lo: aes/aesni-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-macosx-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-macosx-x86_64.Tpo -c -o aes/libcrypto_la-aesni-macosx-x86_64.lo `test -f 'aes/aesni-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aesni-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-macosx-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-macosx-x86_64.Tpo -c -o aes/libcrypto_la-aesni-macosx-x86_64.lo `test -f 'aes/aesni-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aesni-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aesni-macosx-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aesni-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aesni-macosx-x86_64.S' object='aes/libcrypto_la-aesni-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-macosx-x86_64.lo `test -f 'aes/aesni-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aesni-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-macosx-x86_64.lo `test -f 'aes/aesni-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aesni-macosx-x86_64.S aes/libcrypto_la-aesni-sha1-macosx-x86_64.lo: aes/aesni-sha1-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-sha1-macosx-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-sha1-macosx-x86_64.Tpo -c -o aes/libcrypto_la-aesni-sha1-macosx-x86_64.lo `test -f 'aes/aesni-sha1-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-sha1-macosx-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-sha1-macosx-x86_64.Tpo -c -o aes/libcrypto_la-aesni-sha1-macosx-x86_64.lo `test -f 'aes/aesni-sha1-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aesni-sha1-macosx-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aesni-sha1-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aesni-sha1-macosx-x86_64.S' object='aes/libcrypto_la-aesni-sha1-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-sha1-macosx-x86_64.lo `test -f 'aes/aesni-sha1-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-sha1-macosx-x86_64.lo `test -f 'aes/aesni-sha1-macosx-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-macosx-x86_64.S bn/libcrypto_la-modexp512-macosx-x86_64.lo: bn/modexp512-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-modexp512-macosx-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-modexp512-macosx-x86_64.Tpo -c -o bn/libcrypto_la-modexp512-macosx-x86_64.lo `test -f 'bn/modexp512-macosx-x86_64.S' || echo '$(srcdir)/'`bn/modexp512-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-modexp512-macosx-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-modexp512-macosx-x86_64.Tpo -c -o bn/libcrypto_la-modexp512-macosx-x86_64.lo `test -f 'bn/modexp512-macosx-x86_64.S' || echo '$(srcdir)/'`bn/modexp512-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-modexp512-macosx-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-modexp512-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/modexp512-macosx-x86_64.S' object='bn/libcrypto_la-modexp512-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-modexp512-macosx-x86_64.lo `test -f 'bn/modexp512-macosx-x86_64.S' || echo '$(srcdir)/'`bn/modexp512-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-modexp512-macosx-x86_64.lo `test -f 'bn/modexp512-macosx-x86_64.S' || echo '$(srcdir)/'`bn/modexp512-macosx-x86_64.S bn/libcrypto_la-mont-macosx-x86_64.lo: bn/mont-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont-macosx-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont-macosx-x86_64.Tpo -c -o bn/libcrypto_la-mont-macosx-x86_64.lo `test -f 'bn/mont-macosx-x86_64.S' || echo '$(srcdir)/'`bn/mont-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont-macosx-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont-macosx-x86_64.Tpo -c -o bn/libcrypto_la-mont-macosx-x86_64.lo `test -f 'bn/mont-macosx-x86_64.S' || echo '$(srcdir)/'`bn/mont-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-mont-macosx-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-mont-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/mont-macosx-x86_64.S' object='bn/libcrypto_la-mont-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont-macosx-x86_64.lo `test -f 'bn/mont-macosx-x86_64.S' || echo '$(srcdir)/'`bn/mont-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont-macosx-x86_64.lo `test -f 'bn/mont-macosx-x86_64.S' || echo '$(srcdir)/'`bn/mont-macosx-x86_64.S bn/libcrypto_la-mont5-macosx-x86_64.lo: bn/mont5-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont5-macosx-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont5-macosx-x86_64.Tpo -c -o bn/libcrypto_la-mont5-macosx-x86_64.lo `test -f 'bn/mont5-macosx-x86_64.S' || echo '$(srcdir)/'`bn/mont5-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont5-macosx-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont5-macosx-x86_64.Tpo -c -o bn/libcrypto_la-mont5-macosx-x86_64.lo `test -f 'bn/mont5-macosx-x86_64.S' || echo '$(srcdir)/'`bn/mont5-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-mont5-macosx-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-mont5-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/mont5-macosx-x86_64.S' object='bn/libcrypto_la-mont5-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont5-macosx-x86_64.lo `test -f 'bn/mont5-macosx-x86_64.S' || echo '$(srcdir)/'`bn/mont5-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont5-macosx-x86_64.lo `test -f 'bn/mont5-macosx-x86_64.S' || echo '$(srcdir)/'`bn/mont5-macosx-x86_64.S bn/libcrypto_la-gf2m-macosx-x86_64.lo: bn/gf2m-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-gf2m-macosx-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-gf2m-macosx-x86_64.Tpo -c -o bn/libcrypto_la-gf2m-macosx-x86_64.lo `test -f 'bn/gf2m-macosx-x86_64.S' || echo '$(srcdir)/'`bn/gf2m-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-gf2m-macosx-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-gf2m-macosx-x86_64.Tpo -c -o bn/libcrypto_la-gf2m-macosx-x86_64.lo `test -f 'bn/gf2m-macosx-x86_64.S' || echo '$(srcdir)/'`bn/gf2m-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-gf2m-macosx-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-gf2m-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/gf2m-macosx-x86_64.S' object='bn/libcrypto_la-gf2m-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-gf2m-macosx-x86_64.lo `test -f 'bn/gf2m-macosx-x86_64.S' || echo '$(srcdir)/'`bn/gf2m-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-gf2m-macosx-x86_64.lo `test -f 'bn/gf2m-macosx-x86_64.S' || echo '$(srcdir)/'`bn/gf2m-macosx-x86_64.S camellia/libcrypto_la-cmll-macosx-x86_64.lo: camellia/cmll-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT camellia/libcrypto_la-cmll-macosx-x86_64.lo -MD -MP -MF camellia/$(DEPDIR)/libcrypto_la-cmll-macosx-x86_64.Tpo -c -o camellia/libcrypto_la-cmll-macosx-x86_64.lo `test -f 'camellia/cmll-macosx-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT camellia/libcrypto_la-cmll-macosx-x86_64.lo -MD -MP -MF camellia/$(DEPDIR)/libcrypto_la-cmll-macosx-x86_64.Tpo -c -o camellia/libcrypto_la-cmll-macosx-x86_64.lo `test -f 'camellia/cmll-macosx-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) camellia/$(DEPDIR)/libcrypto_la-cmll-macosx-x86_64.Tpo camellia/$(DEPDIR)/libcrypto_la-cmll-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='camellia/cmll-macosx-x86_64.S' object='camellia/libcrypto_la-cmll-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o camellia/libcrypto_la-cmll-macosx-x86_64.lo `test -f 'camellia/cmll-macosx-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o camellia/libcrypto_la-cmll-macosx-x86_64.lo `test -f 'camellia/cmll-macosx-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-macosx-x86_64.S md5/libcrypto_la-md5-macosx-x86_64.lo: md5/md5-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT md5/libcrypto_la-md5-macosx-x86_64.lo -MD -MP -MF md5/$(DEPDIR)/libcrypto_la-md5-macosx-x86_64.Tpo -c -o md5/libcrypto_la-md5-macosx-x86_64.lo `test -f 'md5/md5-macosx-x86_64.S' || echo '$(srcdir)/'`md5/md5-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT md5/libcrypto_la-md5-macosx-x86_64.lo -MD -MP -MF md5/$(DEPDIR)/libcrypto_la-md5-macosx-x86_64.Tpo -c -o md5/libcrypto_la-md5-macosx-x86_64.lo `test -f 'md5/md5-macosx-x86_64.S' || echo '$(srcdir)/'`md5/md5-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) md5/$(DEPDIR)/libcrypto_la-md5-macosx-x86_64.Tpo md5/$(DEPDIR)/libcrypto_la-md5-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='md5/md5-macosx-x86_64.S' object='md5/libcrypto_la-md5-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o md5/libcrypto_la-md5-macosx-x86_64.lo `test -f 'md5/md5-macosx-x86_64.S' || echo '$(srcdir)/'`md5/md5-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o md5/libcrypto_la-md5-macosx-x86_64.lo `test -f 'md5/md5-macosx-x86_64.S' || echo '$(srcdir)/'`md5/md5-macosx-x86_64.S modes/libcrypto_la-ghash-macosx-x86_64.lo: modes/ghash-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT modes/libcrypto_la-ghash-macosx-x86_64.lo -MD -MP -MF modes/$(DEPDIR)/libcrypto_la-ghash-macosx-x86_64.Tpo -c -o modes/libcrypto_la-ghash-macosx-x86_64.lo `test -f 'modes/ghash-macosx-x86_64.S' || echo '$(srcdir)/'`modes/ghash-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT modes/libcrypto_la-ghash-macosx-x86_64.lo -MD -MP -MF modes/$(DEPDIR)/libcrypto_la-ghash-macosx-x86_64.Tpo -c -o modes/libcrypto_la-ghash-macosx-x86_64.lo `test -f 'modes/ghash-macosx-x86_64.S' || echo '$(srcdir)/'`modes/ghash-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) modes/$(DEPDIR)/libcrypto_la-ghash-macosx-x86_64.Tpo modes/$(DEPDIR)/libcrypto_la-ghash-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='modes/ghash-macosx-x86_64.S' object='modes/libcrypto_la-ghash-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o modes/libcrypto_la-ghash-macosx-x86_64.lo `test -f 'modes/ghash-macosx-x86_64.S' || echo '$(srcdir)/'`modes/ghash-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o modes/libcrypto_la-ghash-macosx-x86_64.lo `test -f 'modes/ghash-macosx-x86_64.S' || echo '$(srcdir)/'`modes/ghash-macosx-x86_64.S rc4/libcrypto_la-rc4-macosx-x86_64.lo: rc4/rc4-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-macosx-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-macosx-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-macosx-x86_64.lo `test -f 'rc4/rc4-macosx-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-macosx-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-macosx-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-macosx-x86_64.lo `test -f 'rc4/rc4-macosx-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) rc4/$(DEPDIR)/libcrypto_la-rc4-macosx-x86_64.Tpo rc4/$(DEPDIR)/libcrypto_la-rc4-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='rc4/rc4-macosx-x86_64.S' object='rc4/libcrypto_la-rc4-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-macosx-x86_64.lo `test -f 'rc4/rc4-macosx-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-macosx-x86_64.lo `test -f 'rc4/rc4-macosx-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-macosx-x86_64.S rc4/libcrypto_la-rc4-md5-macosx-x86_64.lo: rc4/rc4-md5-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-md5-macosx-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-md5-macosx-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-md5-macosx-x86_64.lo `test -f 'rc4/rc4-md5-macosx-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-md5-macosx-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-md5-macosx-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-md5-macosx-x86_64.lo `test -f 'rc4/rc4-md5-macosx-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) rc4/$(DEPDIR)/libcrypto_la-rc4-md5-macosx-x86_64.Tpo rc4/$(DEPDIR)/libcrypto_la-rc4-md5-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='rc4/rc4-md5-macosx-x86_64.S' object='rc4/libcrypto_la-rc4-md5-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-md5-macosx-x86_64.lo `test -f 'rc4/rc4-md5-macosx-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-md5-macosx-x86_64.lo `test -f 'rc4/rc4-md5-macosx-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-macosx-x86_64.S sha/libcrypto_la-sha1-macosx-x86_64.lo: sha/sha1-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha1-macosx-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha1-macosx-x86_64.Tpo -c -o sha/libcrypto_la-sha1-macosx-x86_64.lo `test -f 'sha/sha1-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha1-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha1-macosx-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha1-macosx-x86_64.Tpo -c -o sha/libcrypto_la-sha1-macosx-x86_64.lo `test -f 'sha/sha1-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha1-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha1-macosx-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha1-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha1-macosx-x86_64.S' object='sha/libcrypto_la-sha1-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha1-macosx-x86_64.lo `test -f 'sha/sha1-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha1-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha1-macosx-x86_64.lo `test -f 'sha/sha1-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha1-macosx-x86_64.S sha/libcrypto_la-sha256-macosx-x86_64.lo: sha/sha256-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha256-macosx-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha256-macosx-x86_64.Tpo -c -o sha/libcrypto_la-sha256-macosx-x86_64.lo `test -f 'sha/sha256-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha256-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha256-macosx-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha256-macosx-x86_64.Tpo -c -o sha/libcrypto_la-sha256-macosx-x86_64.lo `test -f 'sha/sha256-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha256-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha256-macosx-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha256-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha256-macosx-x86_64.S' object='sha/libcrypto_la-sha256-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha256-macosx-x86_64.lo `test -f 'sha/sha256-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha256-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha256-macosx-x86_64.lo `test -f 'sha/sha256-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha256-macosx-x86_64.S sha/libcrypto_la-sha512-macosx-x86_64.lo: sha/sha512-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha512-macosx-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha512-macosx-x86_64.Tpo -c -o sha/libcrypto_la-sha512-macosx-x86_64.lo `test -f 'sha/sha512-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha512-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha512-macosx-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha512-macosx-x86_64.Tpo -c -o sha/libcrypto_la-sha512-macosx-x86_64.lo `test -f 'sha/sha512-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha512-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha512-macosx-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha512-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha512-macosx-x86_64.S' object='sha/libcrypto_la-sha512-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha512-macosx-x86_64.lo `test -f 'sha/sha512-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha512-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha512-macosx-x86_64.lo `test -f 'sha/sha512-macosx-x86_64.S' || echo '$(srcdir)/'`sha/sha512-macosx-x86_64.S whrlpool/libcrypto_la-wp-macosx-x86_64.lo: whrlpool/wp-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT whrlpool/libcrypto_la-wp-macosx-x86_64.lo -MD -MP -MF whrlpool/$(DEPDIR)/libcrypto_la-wp-macosx-x86_64.Tpo -c -o whrlpool/libcrypto_la-wp-macosx-x86_64.lo `test -f 'whrlpool/wp-macosx-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT whrlpool/libcrypto_la-wp-macosx-x86_64.lo -MD -MP -MF whrlpool/$(DEPDIR)/libcrypto_la-wp-macosx-x86_64.Tpo -c -o whrlpool/libcrypto_la-wp-macosx-x86_64.lo `test -f 'whrlpool/wp-macosx-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) whrlpool/$(DEPDIR)/libcrypto_la-wp-macosx-x86_64.Tpo whrlpool/$(DEPDIR)/libcrypto_la-wp-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='whrlpool/wp-macosx-x86_64.S' object='whrlpool/libcrypto_la-wp-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o whrlpool/libcrypto_la-wp-macosx-x86_64.lo `test -f 'whrlpool/wp-macosx-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o whrlpool/libcrypto_la-wp-macosx-x86_64.lo `test -f 'whrlpool/wp-macosx-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-macosx-x86_64.S libcrypto_la-cpuid-macosx-x86_64.lo: cpuid-macosx-x86_64.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT libcrypto_la-cpuid-macosx-x86_64.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-cpuid-macosx-x86_64.Tpo -c -o libcrypto_la-cpuid-macosx-x86_64.lo `test -f 'cpuid-macosx-x86_64.S' || echo '$(srcdir)/'`cpuid-macosx-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT libcrypto_la-cpuid-macosx-x86_64.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-cpuid-macosx-x86_64.Tpo -c -o libcrypto_la-cpuid-macosx-x86_64.lo `test -f 'cpuid-macosx-x86_64.S' || echo '$(srcdir)/'`cpuid-macosx-x86_64.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcrypto_la-cpuid-macosx-x86_64.Tpo $(DEPDIR)/libcrypto_la-cpuid-macosx-x86_64.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='cpuid-macosx-x86_64.S' object='libcrypto_la-cpuid-macosx-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o libcrypto_la-cpuid-macosx-x86_64.lo `test -f 'cpuid-macosx-x86_64.S' || echo '$(srcdir)/'`cpuid-macosx-x86_64.S +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o libcrypto_la-cpuid-macosx-x86_64.lo `test -f 'cpuid-macosx-x86_64.S' || echo '$(srcdir)/'`cpuid-macosx-x86_64.S + +aes/libcrypto_la-aes-masm-x86_64.lo: aes/aes-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aes-masm-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aes-masm-x86_64.Tpo -c -o aes/libcrypto_la-aes-masm-x86_64.lo `test -f 'aes/aes-masm-x86_64.S' || echo '$(srcdir)/'`aes/aes-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aes-masm-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aes-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aes-masm-x86_64.S' object='aes/libcrypto_la-aes-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aes-masm-x86_64.lo `test -f 'aes/aes-masm-x86_64.S' || echo '$(srcdir)/'`aes/aes-masm-x86_64.S + +aes/libcrypto_la-bsaes-masm-x86_64.lo: aes/bsaes-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-bsaes-masm-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-bsaes-masm-x86_64.Tpo -c -o aes/libcrypto_la-bsaes-masm-x86_64.lo `test -f 'aes/bsaes-masm-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-bsaes-masm-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-bsaes-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/bsaes-masm-x86_64.S' object='aes/libcrypto_la-bsaes-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-bsaes-masm-x86_64.lo `test -f 'aes/bsaes-masm-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-masm-x86_64.S + +aes/libcrypto_la-vpaes-masm-x86_64.lo: aes/vpaes-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-vpaes-masm-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-vpaes-masm-x86_64.Tpo -c -o aes/libcrypto_la-vpaes-masm-x86_64.lo `test -f 'aes/vpaes-masm-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-vpaes-masm-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-vpaes-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/vpaes-masm-x86_64.S' object='aes/libcrypto_la-vpaes-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-vpaes-masm-x86_64.lo `test -f 'aes/vpaes-masm-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-masm-x86_64.S + +aes/libcrypto_la-aesni-masm-x86_64.lo: aes/aesni-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-masm-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-masm-x86_64.Tpo -c -o aes/libcrypto_la-aesni-masm-x86_64.lo `test -f 'aes/aesni-masm-x86_64.S' || echo '$(srcdir)/'`aes/aesni-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aesni-masm-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aesni-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aesni-masm-x86_64.S' object='aes/libcrypto_la-aesni-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-masm-x86_64.lo `test -f 'aes/aesni-masm-x86_64.S' || echo '$(srcdir)/'`aes/aesni-masm-x86_64.S + +aes/libcrypto_la-aesni-sha1-masm-x86_64.lo: aes/aesni-sha1-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-sha1-masm-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-sha1-masm-x86_64.Tpo -c -o aes/libcrypto_la-aesni-sha1-masm-x86_64.lo `test -f 'aes/aesni-sha1-masm-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aesni-sha1-masm-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aesni-sha1-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aesni-sha1-masm-x86_64.S' object='aes/libcrypto_la-aesni-sha1-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-sha1-masm-x86_64.lo `test -f 'aes/aesni-sha1-masm-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-masm-x86_64.S + +bn/libcrypto_la-modexp512-masm-x86_64.lo: bn/modexp512-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-modexp512-masm-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-modexp512-masm-x86_64.Tpo -c -o bn/libcrypto_la-modexp512-masm-x86_64.lo `test -f 'bn/modexp512-masm-x86_64.S' || echo '$(srcdir)/'`bn/modexp512-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-modexp512-masm-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-modexp512-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/modexp512-masm-x86_64.S' object='bn/libcrypto_la-modexp512-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-modexp512-masm-x86_64.lo `test -f 'bn/modexp512-masm-x86_64.S' || echo '$(srcdir)/'`bn/modexp512-masm-x86_64.S + +bn/libcrypto_la-mont-masm-x86_64.lo: bn/mont-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont-masm-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont-masm-x86_64.Tpo -c -o bn/libcrypto_la-mont-masm-x86_64.lo `test -f 'bn/mont-masm-x86_64.S' || echo '$(srcdir)/'`bn/mont-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-mont-masm-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-mont-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/mont-masm-x86_64.S' object='bn/libcrypto_la-mont-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont-masm-x86_64.lo `test -f 'bn/mont-masm-x86_64.S' || echo '$(srcdir)/'`bn/mont-masm-x86_64.S + +bn/libcrypto_la-mont5-masm-x86_64.lo: bn/mont5-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-mont5-masm-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-mont5-masm-x86_64.Tpo -c -o bn/libcrypto_la-mont5-masm-x86_64.lo `test -f 'bn/mont5-masm-x86_64.S' || echo '$(srcdir)/'`bn/mont5-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-mont5-masm-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-mont5-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/mont5-masm-x86_64.S' object='bn/libcrypto_la-mont5-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-mont5-masm-x86_64.lo `test -f 'bn/mont5-masm-x86_64.S' || echo '$(srcdir)/'`bn/mont5-masm-x86_64.S + +bn/libcrypto_la-gf2m-masm-x86_64.lo: bn/gf2m-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT bn/libcrypto_la-gf2m-masm-x86_64.lo -MD -MP -MF bn/$(DEPDIR)/libcrypto_la-gf2m-masm-x86_64.Tpo -c -o bn/libcrypto_la-gf2m-masm-x86_64.lo `test -f 'bn/gf2m-masm-x86_64.S' || echo '$(srcdir)/'`bn/gf2m-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) bn/$(DEPDIR)/libcrypto_la-gf2m-masm-x86_64.Tpo bn/$(DEPDIR)/libcrypto_la-gf2m-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='bn/gf2m-masm-x86_64.S' object='bn/libcrypto_la-gf2m-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o bn/libcrypto_la-gf2m-masm-x86_64.lo `test -f 'bn/gf2m-masm-x86_64.S' || echo '$(srcdir)/'`bn/gf2m-masm-x86_64.S + +camellia/libcrypto_la-cmll-masm-x86_64.lo: camellia/cmll-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT camellia/libcrypto_la-cmll-masm-x86_64.lo -MD -MP -MF camellia/$(DEPDIR)/libcrypto_la-cmll-masm-x86_64.Tpo -c -o camellia/libcrypto_la-cmll-masm-x86_64.lo `test -f 'camellia/cmll-masm-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) camellia/$(DEPDIR)/libcrypto_la-cmll-masm-x86_64.Tpo camellia/$(DEPDIR)/libcrypto_la-cmll-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='camellia/cmll-masm-x86_64.S' object='camellia/libcrypto_la-cmll-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o camellia/libcrypto_la-cmll-masm-x86_64.lo `test -f 'camellia/cmll-masm-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-masm-x86_64.S + +md5/libcrypto_la-md5-masm-x86_64.lo: md5/md5-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT md5/libcrypto_la-md5-masm-x86_64.lo -MD -MP -MF md5/$(DEPDIR)/libcrypto_la-md5-masm-x86_64.Tpo -c -o md5/libcrypto_la-md5-masm-x86_64.lo `test -f 'md5/md5-masm-x86_64.S' || echo '$(srcdir)/'`md5/md5-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) md5/$(DEPDIR)/libcrypto_la-md5-masm-x86_64.Tpo md5/$(DEPDIR)/libcrypto_la-md5-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='md5/md5-masm-x86_64.S' object='md5/libcrypto_la-md5-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o md5/libcrypto_la-md5-masm-x86_64.lo `test -f 'md5/md5-masm-x86_64.S' || echo '$(srcdir)/'`md5/md5-masm-x86_64.S + +modes/libcrypto_la-ghash-masm-x86_64.lo: modes/ghash-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT modes/libcrypto_la-ghash-masm-x86_64.lo -MD -MP -MF modes/$(DEPDIR)/libcrypto_la-ghash-masm-x86_64.Tpo -c -o modes/libcrypto_la-ghash-masm-x86_64.lo `test -f 'modes/ghash-masm-x86_64.S' || echo '$(srcdir)/'`modes/ghash-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) modes/$(DEPDIR)/libcrypto_la-ghash-masm-x86_64.Tpo modes/$(DEPDIR)/libcrypto_la-ghash-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='modes/ghash-masm-x86_64.S' object='modes/libcrypto_la-ghash-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o modes/libcrypto_la-ghash-masm-x86_64.lo `test -f 'modes/ghash-masm-x86_64.S' || echo '$(srcdir)/'`modes/ghash-masm-x86_64.S + +rc4/libcrypto_la-rc4-masm-x86_64.lo: rc4/rc4-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-masm-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-masm-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-masm-x86_64.lo `test -f 'rc4/rc4-masm-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) rc4/$(DEPDIR)/libcrypto_la-rc4-masm-x86_64.Tpo rc4/$(DEPDIR)/libcrypto_la-rc4-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='rc4/rc4-masm-x86_64.S' object='rc4/libcrypto_la-rc4-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-masm-x86_64.lo `test -f 'rc4/rc4-masm-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-masm-x86_64.S + +rc4/libcrypto_la-rc4-md5-masm-x86_64.lo: rc4/rc4-md5-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-md5-masm-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-md5-masm-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-md5-masm-x86_64.lo `test -f 'rc4/rc4-md5-masm-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) rc4/$(DEPDIR)/libcrypto_la-rc4-md5-masm-x86_64.Tpo rc4/$(DEPDIR)/libcrypto_la-rc4-md5-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='rc4/rc4-md5-masm-x86_64.S' object='rc4/libcrypto_la-rc4-md5-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-md5-masm-x86_64.lo `test -f 'rc4/rc4-md5-masm-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-masm-x86_64.S + +sha/libcrypto_la-sha1-masm-x86_64.lo: sha/sha1-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha1-masm-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha1-masm-x86_64.Tpo -c -o sha/libcrypto_la-sha1-masm-x86_64.lo `test -f 'sha/sha1-masm-x86_64.S' || echo '$(srcdir)/'`sha/sha1-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha1-masm-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha1-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha1-masm-x86_64.S' object='sha/libcrypto_la-sha1-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha1-masm-x86_64.lo `test -f 'sha/sha1-masm-x86_64.S' || echo '$(srcdir)/'`sha/sha1-masm-x86_64.S + +sha/libcrypto_la-sha256-masm-x86_64.lo: sha/sha256-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha256-masm-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha256-masm-x86_64.Tpo -c -o sha/libcrypto_la-sha256-masm-x86_64.lo `test -f 'sha/sha256-masm-x86_64.S' || echo '$(srcdir)/'`sha/sha256-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha256-masm-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha256-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha256-masm-x86_64.S' object='sha/libcrypto_la-sha256-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha256-masm-x86_64.lo `test -f 'sha/sha256-masm-x86_64.S' || echo '$(srcdir)/'`sha/sha256-masm-x86_64.S + +sha/libcrypto_la-sha512-masm-x86_64.lo: sha/sha512-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha512-masm-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha512-masm-x86_64.Tpo -c -o sha/libcrypto_la-sha512-masm-x86_64.lo `test -f 'sha/sha512-masm-x86_64.S' || echo '$(srcdir)/'`sha/sha512-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha512-masm-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha512-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha512-masm-x86_64.S' object='sha/libcrypto_la-sha512-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha512-masm-x86_64.lo `test -f 'sha/sha512-masm-x86_64.S' || echo '$(srcdir)/'`sha/sha512-masm-x86_64.S + +whrlpool/libcrypto_la-wp-masm-x86_64.lo: whrlpool/wp-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT whrlpool/libcrypto_la-wp-masm-x86_64.lo -MD -MP -MF whrlpool/$(DEPDIR)/libcrypto_la-wp-masm-x86_64.Tpo -c -o whrlpool/libcrypto_la-wp-masm-x86_64.lo `test -f 'whrlpool/wp-masm-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) whrlpool/$(DEPDIR)/libcrypto_la-wp-masm-x86_64.Tpo whrlpool/$(DEPDIR)/libcrypto_la-wp-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='whrlpool/wp-masm-x86_64.S' object='whrlpool/libcrypto_la-wp-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o whrlpool/libcrypto_la-wp-masm-x86_64.lo `test -f 'whrlpool/wp-masm-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-masm-x86_64.S + +libcrypto_la-cpuid-masm-x86_64.lo: cpuid-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT libcrypto_la-cpuid-masm-x86_64.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-cpuid-masm-x86_64.Tpo -c -o libcrypto_la-cpuid-masm-x86_64.lo `test -f 'cpuid-masm-x86_64.S' || echo '$(srcdir)/'`cpuid-masm-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcrypto_la-cpuid-masm-x86_64.Tpo $(DEPDIR)/libcrypto_la-cpuid-masm-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='cpuid-masm-x86_64.S' object='libcrypto_la-cpuid-masm-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o libcrypto_la-cpuid-masm-x86_64.lo `test -f 'cpuid-masm-x86_64.S' || echo '$(srcdir)/'`cpuid-masm-x86_64.S + +aes/libcrypto_la-aes-mingw64-x86_64.lo: aes/aes-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aes-mingw64-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aes-mingw64-x86_64.Tpo -c -o aes/libcrypto_la-aes-mingw64-x86_64.lo `test -f 'aes/aes-mingw64-x86_64.S' || echo '$(srcdir)/'`aes/aes-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aes-mingw64-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aes-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aes-mingw64-x86_64.S' object='aes/libcrypto_la-aes-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aes-mingw64-x86_64.lo `test -f 'aes/aes-mingw64-x86_64.S' || echo '$(srcdir)/'`aes/aes-mingw64-x86_64.S + +aes/libcrypto_la-bsaes-mingw64-x86_64.lo: aes/bsaes-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-bsaes-mingw64-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-bsaes-mingw64-x86_64.Tpo -c -o aes/libcrypto_la-bsaes-mingw64-x86_64.lo `test -f 'aes/bsaes-mingw64-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-bsaes-mingw64-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-bsaes-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/bsaes-mingw64-x86_64.S' object='aes/libcrypto_la-bsaes-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-bsaes-mingw64-x86_64.lo `test -f 'aes/bsaes-mingw64-x86_64.S' || echo '$(srcdir)/'`aes/bsaes-mingw64-x86_64.S + +aes/libcrypto_la-vpaes-mingw64-x86_64.lo: aes/vpaes-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-vpaes-mingw64-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-vpaes-mingw64-x86_64.Tpo -c -o aes/libcrypto_la-vpaes-mingw64-x86_64.lo `test -f 'aes/vpaes-mingw64-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-vpaes-mingw64-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-vpaes-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/vpaes-mingw64-x86_64.S' object='aes/libcrypto_la-vpaes-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-vpaes-mingw64-x86_64.lo `test -f 'aes/vpaes-mingw64-x86_64.S' || echo '$(srcdir)/'`aes/vpaes-mingw64-x86_64.S + +aes/libcrypto_la-aesni-mingw64-x86_64.lo: aes/aesni-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-mingw64-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-mingw64-x86_64.Tpo -c -o aes/libcrypto_la-aesni-mingw64-x86_64.lo `test -f 'aes/aesni-mingw64-x86_64.S' || echo '$(srcdir)/'`aes/aesni-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aesni-mingw64-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aesni-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aesni-mingw64-x86_64.S' object='aes/libcrypto_la-aesni-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-mingw64-x86_64.lo `test -f 'aes/aesni-mingw64-x86_64.S' || echo '$(srcdir)/'`aes/aesni-mingw64-x86_64.S + +aes/libcrypto_la-aesni-sha1-mingw64-x86_64.lo: aes/aesni-sha1-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT aes/libcrypto_la-aesni-sha1-mingw64-x86_64.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aesni-sha1-mingw64-x86_64.Tpo -c -o aes/libcrypto_la-aesni-sha1-mingw64-x86_64.lo `test -f 'aes/aesni-sha1-mingw64-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aesni-sha1-mingw64-x86_64.Tpo aes/$(DEPDIR)/libcrypto_la-aesni-sha1-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='aes/aesni-sha1-mingw64-x86_64.S' object='aes/libcrypto_la-aesni-sha1-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o aes/libcrypto_la-aesni-sha1-mingw64-x86_64.lo `test -f 'aes/aesni-sha1-mingw64-x86_64.S' || echo '$(srcdir)/'`aes/aesni-sha1-mingw64-x86_64.S + +camellia/libcrypto_la-cmll-mingw64-x86_64.lo: camellia/cmll-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT camellia/libcrypto_la-cmll-mingw64-x86_64.lo -MD -MP -MF camellia/$(DEPDIR)/libcrypto_la-cmll-mingw64-x86_64.Tpo -c -o camellia/libcrypto_la-cmll-mingw64-x86_64.lo `test -f 'camellia/cmll-mingw64-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) camellia/$(DEPDIR)/libcrypto_la-cmll-mingw64-x86_64.Tpo camellia/$(DEPDIR)/libcrypto_la-cmll-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='camellia/cmll-mingw64-x86_64.S' object='camellia/libcrypto_la-cmll-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o camellia/libcrypto_la-cmll-mingw64-x86_64.lo `test -f 'camellia/cmll-mingw64-x86_64.S' || echo '$(srcdir)/'`camellia/cmll-mingw64-x86_64.S + +md5/libcrypto_la-md5-mingw64-x86_64.lo: md5/md5-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT md5/libcrypto_la-md5-mingw64-x86_64.lo -MD -MP -MF md5/$(DEPDIR)/libcrypto_la-md5-mingw64-x86_64.Tpo -c -o md5/libcrypto_la-md5-mingw64-x86_64.lo `test -f 'md5/md5-mingw64-x86_64.S' || echo '$(srcdir)/'`md5/md5-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) md5/$(DEPDIR)/libcrypto_la-md5-mingw64-x86_64.Tpo md5/$(DEPDIR)/libcrypto_la-md5-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='md5/md5-mingw64-x86_64.S' object='md5/libcrypto_la-md5-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o md5/libcrypto_la-md5-mingw64-x86_64.lo `test -f 'md5/md5-mingw64-x86_64.S' || echo '$(srcdir)/'`md5/md5-mingw64-x86_64.S + +modes/libcrypto_la-ghash-mingw64-x86_64.lo: modes/ghash-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT modes/libcrypto_la-ghash-mingw64-x86_64.lo -MD -MP -MF modes/$(DEPDIR)/libcrypto_la-ghash-mingw64-x86_64.Tpo -c -o modes/libcrypto_la-ghash-mingw64-x86_64.lo `test -f 'modes/ghash-mingw64-x86_64.S' || echo '$(srcdir)/'`modes/ghash-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) modes/$(DEPDIR)/libcrypto_la-ghash-mingw64-x86_64.Tpo modes/$(DEPDIR)/libcrypto_la-ghash-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='modes/ghash-mingw64-x86_64.S' object='modes/libcrypto_la-ghash-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o modes/libcrypto_la-ghash-mingw64-x86_64.lo `test -f 'modes/ghash-mingw64-x86_64.S' || echo '$(srcdir)/'`modes/ghash-mingw64-x86_64.S + +rc4/libcrypto_la-rc4-mingw64-x86_64.lo: rc4/rc4-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-mingw64-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-mingw64-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-mingw64-x86_64.lo `test -f 'rc4/rc4-mingw64-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) rc4/$(DEPDIR)/libcrypto_la-rc4-mingw64-x86_64.Tpo rc4/$(DEPDIR)/libcrypto_la-rc4-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='rc4/rc4-mingw64-x86_64.S' object='rc4/libcrypto_la-rc4-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-mingw64-x86_64.lo `test -f 'rc4/rc4-mingw64-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-mingw64-x86_64.S + +rc4/libcrypto_la-rc4-md5-mingw64-x86_64.lo: rc4/rc4-md5-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT rc4/libcrypto_la-rc4-md5-mingw64-x86_64.lo -MD -MP -MF rc4/$(DEPDIR)/libcrypto_la-rc4-md5-mingw64-x86_64.Tpo -c -o rc4/libcrypto_la-rc4-md5-mingw64-x86_64.lo `test -f 'rc4/rc4-md5-mingw64-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) rc4/$(DEPDIR)/libcrypto_la-rc4-md5-mingw64-x86_64.Tpo rc4/$(DEPDIR)/libcrypto_la-rc4-md5-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='rc4/rc4-md5-mingw64-x86_64.S' object='rc4/libcrypto_la-rc4-md5-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o rc4/libcrypto_la-rc4-md5-mingw64-x86_64.lo `test -f 'rc4/rc4-md5-mingw64-x86_64.S' || echo '$(srcdir)/'`rc4/rc4-md5-mingw64-x86_64.S + +sha/libcrypto_la-sha1-mingw64-x86_64.lo: sha/sha1-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha1-mingw64-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha1-mingw64-x86_64.Tpo -c -o sha/libcrypto_la-sha1-mingw64-x86_64.lo `test -f 'sha/sha1-mingw64-x86_64.S' || echo '$(srcdir)/'`sha/sha1-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha1-mingw64-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha1-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha1-mingw64-x86_64.S' object='sha/libcrypto_la-sha1-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha1-mingw64-x86_64.lo `test -f 'sha/sha1-mingw64-x86_64.S' || echo '$(srcdir)/'`sha/sha1-mingw64-x86_64.S + +sha/libcrypto_la-sha256-mingw64-x86_64.lo: sha/sha256-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha256-mingw64-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha256-mingw64-x86_64.Tpo -c -o sha/libcrypto_la-sha256-mingw64-x86_64.lo `test -f 'sha/sha256-mingw64-x86_64.S' || echo '$(srcdir)/'`sha/sha256-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha256-mingw64-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha256-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha256-mingw64-x86_64.S' object='sha/libcrypto_la-sha256-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha256-mingw64-x86_64.lo `test -f 'sha/sha256-mingw64-x86_64.S' || echo '$(srcdir)/'`sha/sha256-mingw64-x86_64.S + +sha/libcrypto_la-sha512-mingw64-x86_64.lo: sha/sha512-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT sha/libcrypto_la-sha512-mingw64-x86_64.lo -MD -MP -MF sha/$(DEPDIR)/libcrypto_la-sha512-mingw64-x86_64.Tpo -c -o sha/libcrypto_la-sha512-mingw64-x86_64.lo `test -f 'sha/sha512-mingw64-x86_64.S' || echo '$(srcdir)/'`sha/sha512-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) sha/$(DEPDIR)/libcrypto_la-sha512-mingw64-x86_64.Tpo sha/$(DEPDIR)/libcrypto_la-sha512-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='sha/sha512-mingw64-x86_64.S' object='sha/libcrypto_la-sha512-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o sha/libcrypto_la-sha512-mingw64-x86_64.lo `test -f 'sha/sha512-mingw64-x86_64.S' || echo '$(srcdir)/'`sha/sha512-mingw64-x86_64.S + +whrlpool/libcrypto_la-wp-mingw64-x86_64.lo: whrlpool/wp-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT whrlpool/libcrypto_la-wp-mingw64-x86_64.lo -MD -MP -MF whrlpool/$(DEPDIR)/libcrypto_la-wp-mingw64-x86_64.Tpo -c -o whrlpool/libcrypto_la-wp-mingw64-x86_64.lo `test -f 'whrlpool/wp-mingw64-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) whrlpool/$(DEPDIR)/libcrypto_la-wp-mingw64-x86_64.Tpo whrlpool/$(DEPDIR)/libcrypto_la-wp-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='whrlpool/wp-mingw64-x86_64.S' object='whrlpool/libcrypto_la-wp-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o whrlpool/libcrypto_la-wp-mingw64-x86_64.lo `test -f 'whrlpool/wp-mingw64-x86_64.S' || echo '$(srcdir)/'`whrlpool/wp-mingw64-x86_64.S + +libcrypto_la-cpuid-mingw64-x86_64.lo: cpuid-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT libcrypto_la-cpuid-mingw64-x86_64.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-cpuid-mingw64-x86_64.Tpo -c -o libcrypto_la-cpuid-mingw64-x86_64.lo `test -f 'cpuid-mingw64-x86_64.S' || echo '$(srcdir)/'`cpuid-mingw64-x86_64.S +@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcrypto_la-cpuid-mingw64-x86_64.Tpo $(DEPDIR)/libcrypto_la-cpuid-mingw64-x86_64.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='cpuid-mingw64-x86_64.S' object='libcrypto_la-cpuid-mingw64-x86_64.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o libcrypto_la-cpuid-mingw64-x86_64.lo `test -f 'cpuid-mingw64-x86_64.S' || echo '$(srcdir)/'`cpuid-mingw64-x86_64.S .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -3953,6 +5241,13 @@ compat/libcompatnoopt_la-explicit_bzero.lo: compat/explicit_bzero.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcompatnoopt_la_CFLAGS) $(CFLAGS) -c -o compat/libcompatnoopt_la-explicit_bzero.lo `test -f 'compat/explicit_bzero.c' || echo '$(srcdir)/'`compat/explicit_bzero.c +libcrypto_la-armcap.lo: armcap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcrypto_la-armcap.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-armcap.Tpo -c -o libcrypto_la-armcap.lo `test -f 'armcap.c' || echo '$(srcdir)/'`armcap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcrypto_la-armcap.Tpo $(DEPDIR)/libcrypto_la-armcap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='armcap.c' object='libcrypto_la-armcap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcrypto_la-armcap.lo `test -f 'armcap.c' || echo '$(srcdir)/'`armcap.c + aes/libcrypto_la-aes_cbc.lo: aes/aes_cbc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT aes/libcrypto_la-aes_cbc.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aes_cbc.Tpo -c -o aes/libcrypto_la-aes_cbc.lo `test -f 'aes/aes_cbc.c' || echo '$(srcdir)/'`aes/aes_cbc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aes_cbc.Tpo aes/$(DEPDIR)/libcrypto_la-aes_cbc.Plo @@ -3960,13 +5255,6 @@ aes/libcrypto_la-aes_cbc.lo: aes/aes_cbc.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o aes/libcrypto_la-aes_cbc.lo `test -f 'aes/aes_cbc.c' || echo '$(srcdir)/'`aes/aes_cbc.c -aes/libcrypto_la-aes_core.lo: aes/aes_core.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT aes/libcrypto_la-aes_core.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aes_core.Tpo -c -o aes/libcrypto_la-aes_core.lo `test -f 'aes/aes_core.c' || echo '$(srcdir)/'`aes/aes_core.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aes_core.Tpo aes/$(DEPDIR)/libcrypto_la-aes_core.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='aes/aes_core.c' object='aes/libcrypto_la-aes_core.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o aes/libcrypto_la-aes_core.lo `test -f 'aes/aes_core.c' || echo '$(srcdir)/'`aes/aes_core.c - camellia/libcrypto_la-camellia.lo: camellia/camellia.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT camellia/libcrypto_la-camellia.lo -MD -MP -MF camellia/$(DEPDIR)/libcrypto_la-camellia.Tpo -c -o camellia/libcrypto_la-camellia.lo `test -f 'camellia/camellia.c' || echo '$(srcdir)/'`camellia/camellia.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) camellia/$(DEPDIR)/libcrypto_la-camellia.Tpo camellia/$(DEPDIR)/libcrypto_la-camellia.Plo @@ -4002,6 +5290,13 @@ whrlpool/libcrypto_la-wp_block.lo: whrlpool/wp_block.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o whrlpool/libcrypto_la-wp_block.lo `test -f 'whrlpool/wp_block.c' || echo '$(srcdir)/'`whrlpool/wp_block.c +aes/libcrypto_la-aes_core.lo: aes/aes_core.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT aes/libcrypto_la-aes_core.lo -MD -MP -MF aes/$(DEPDIR)/libcrypto_la-aes_core.Tpo -c -o aes/libcrypto_la-aes_core.lo `test -f 'aes/aes_core.c' || echo '$(srcdir)/'`aes/aes_core.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) aes/$(DEPDIR)/libcrypto_la-aes_core.Tpo aes/$(DEPDIR)/libcrypto_la-aes_core.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='aes/aes_core.c' object='aes/libcrypto_la-aes_core.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o aes/libcrypto_la-aes_core.lo `test -f 'aes/aes_core.c' || echo '$(srcdir)/'`aes/aes_core.c + libcrypto_la-cpt_err.lo: cpt_err.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcrypto_la-cpt_err.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-cpt_err.Tpo -c -o libcrypto_la-cpt_err.lo `test -f 'cpt_err.c' || echo '$(srcdir)/'`cpt_err.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcrypto_la-cpt_err.Tpo $(DEPDIR)/libcrypto_la-cpt_err.Plo @@ -4016,6 +5311,27 @@ libcrypto_la-cryptlib.lo: cryptlib.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcrypto_la-cryptlib.lo `test -f 'cryptlib.c' || echo '$(srcdir)/'`cryptlib.c +libcrypto_la-crypto_init.lo: crypto_init.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcrypto_la-crypto_init.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-crypto_init.Tpo -c -o libcrypto_la-crypto_init.lo `test -f 'crypto_init.c' || echo '$(srcdir)/'`crypto_init.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcrypto_la-crypto_init.Tpo $(DEPDIR)/libcrypto_la-crypto_init.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_init.c' object='libcrypto_la-crypto_init.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcrypto_la-crypto_init.lo `test -f 'crypto_init.c' || echo '$(srcdir)/'`crypto_init.c + +libcrypto_la-crypto_lock.lo: crypto_lock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcrypto_la-crypto_lock.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-crypto_lock.Tpo -c -o libcrypto_la-crypto_lock.lo `test -f 'crypto_lock.c' || echo '$(srcdir)/'`crypto_lock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcrypto_la-crypto_lock.Tpo $(DEPDIR)/libcrypto_la-crypto_lock.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_lock.c' object='libcrypto_la-crypto_lock.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcrypto_la-crypto_lock.lo `test -f 'crypto_lock.c' || echo '$(srcdir)/'`crypto_lock.c + +compat/libcrypto_la-crypto_lock_win.lo: compat/crypto_lock_win.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compat/libcrypto_la-crypto_lock_win.lo -MD -MP -MF compat/$(DEPDIR)/libcrypto_la-crypto_lock_win.Tpo -c -o compat/libcrypto_la-crypto_lock_win.lo `test -f 'compat/crypto_lock_win.c' || echo '$(srcdir)/'`compat/crypto_lock_win.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) compat/$(DEPDIR)/libcrypto_la-crypto_lock_win.Tpo compat/$(DEPDIR)/libcrypto_la-crypto_lock_win.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='compat/crypto_lock_win.c' object='compat/libcrypto_la-crypto_lock_win.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat/libcrypto_la-crypto_lock_win.lo `test -f 'compat/crypto_lock_win.c' || echo '$(srcdir)/'`compat/crypto_lock_win.c + libcrypto_la-cversion.lo: cversion.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcrypto_la-cversion.lo -MD -MP -MF $(DEPDIR)/libcrypto_la-cversion.Tpo -c -o libcrypto_la-cversion.lo `test -f 'cversion.c' || echo '$(srcdir)/'`cversion.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcrypto_la-cversion.Tpo $(DEPDIR)/libcrypto_la-cversion.Plo @@ -4135,13 +5451,6 @@ asn1/libcrypto_la-a_bool.lo: asn1/a_bool.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o asn1/libcrypto_la-a_bool.lo `test -f 'asn1/a_bool.c' || echo '$(srcdir)/'`asn1/a_bool.c -asn1/libcrypto_la-a_bytes.lo: asn1/a_bytes.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT asn1/libcrypto_la-a_bytes.lo -MD -MP -MF asn1/$(DEPDIR)/libcrypto_la-a_bytes.Tpo -c -o asn1/libcrypto_la-a_bytes.lo `test -f 'asn1/a_bytes.c' || echo '$(srcdir)/'`asn1/a_bytes.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) asn1/$(DEPDIR)/libcrypto_la-a_bytes.Tpo asn1/$(DEPDIR)/libcrypto_la-a_bytes.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asn1/a_bytes.c' object='asn1/libcrypto_la-a_bytes.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o asn1/libcrypto_la-a_bytes.lo `test -f 'asn1/a_bytes.c' || echo '$(srcdir)/'`asn1/a_bytes.c - asn1/libcrypto_la-a_d2i_fp.lo: asn1/a_d2i_fp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT asn1/libcrypto_la-a_d2i_fp.lo -MD -MP -MF asn1/$(DEPDIR)/libcrypto_la-a_d2i_fp.Tpo -c -o asn1/libcrypto_la-a_d2i_fp.lo `test -f 'asn1/a_d2i_fp.c' || echo '$(srcdir)/'`asn1/a_d2i_fp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) asn1/$(DEPDIR)/libcrypto_la-a_d2i_fp.Tpo asn1/$(DEPDIR)/libcrypto_la-a_d2i_fp.Plo @@ -4212,13 +5521,6 @@ asn1/libcrypto_la-a_print.lo: asn1/a_print.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o asn1/libcrypto_la-a_print.lo `test -f 'asn1/a_print.c' || echo '$(srcdir)/'`asn1/a_print.c -asn1/libcrypto_la-a_set.lo: asn1/a_set.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT asn1/libcrypto_la-a_set.lo -MD -MP -MF asn1/$(DEPDIR)/libcrypto_la-a_set.Tpo -c -o asn1/libcrypto_la-a_set.lo `test -f 'asn1/a_set.c' || echo '$(srcdir)/'`asn1/a_set.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) asn1/$(DEPDIR)/libcrypto_la-a_set.Tpo asn1/$(DEPDIR)/libcrypto_la-a_set.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asn1/a_set.c' object='asn1/libcrypto_la-a_set.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o asn1/libcrypto_la-a_set.lo `test -f 'asn1/a_set.c' || echo '$(srcdir)/'`asn1/a_set.c - asn1/libcrypto_la-a_sign.lo: asn1/a_sign.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT asn1/libcrypto_la-a_sign.lo -MD -MP -MF asn1/$(DEPDIR)/libcrypto_la-a_sign.Tpo -c -o asn1/libcrypto_la-a_sign.lo `test -f 'asn1/a_sign.c' || echo '$(srcdir)/'`asn1/a_sign.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) asn1/$(DEPDIR)/libcrypto_la-a_sign.Tpo asn1/$(DEPDIR)/libcrypto_la-a_sign.Plo @@ -4765,6 +6067,13 @@ bio/libcrypto_la-bio_lib.lo: bio/bio_lib.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bio/libcrypto_la-bio_lib.lo `test -f 'bio/bio_lib.c' || echo '$(srcdir)/'`bio/bio_lib.c +bio/libcrypto_la-bio_meth.lo: bio/bio_meth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bio/libcrypto_la-bio_meth.lo -MD -MP -MF bio/$(DEPDIR)/libcrypto_la-bio_meth.Tpo -c -o bio/libcrypto_la-bio_meth.lo `test -f 'bio/bio_meth.c' || echo '$(srcdir)/'`bio/bio_meth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) bio/$(DEPDIR)/libcrypto_la-bio_meth.Tpo bio/$(DEPDIR)/libcrypto_la-bio_meth.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bio/bio_meth.c' object='bio/libcrypto_la-bio_meth.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bio/libcrypto_la-bio_meth.lo `test -f 'bio/bio_meth.c' || echo '$(srcdir)/'`bio/bio_meth.c + bio/libcrypto_la-bss_acpt.lo: bio/bss_acpt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bio/libcrypto_la-bss_acpt.lo -MD -MP -MF bio/$(DEPDIR)/libcrypto_la-bss_acpt.Tpo -c -o bio/libcrypto_la-bss_acpt.lo `test -f 'bio/bss_acpt.c' || echo '$(srcdir)/'`bio/bss_acpt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) bio/$(DEPDIR)/libcrypto_la-bss_acpt.Tpo bio/$(DEPDIR)/libcrypto_la-bss_acpt.Plo @@ -5514,6 +6823,13 @@ dsa/libcrypto_la-dsa_lib.lo: dsa/dsa_lib.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dsa/libcrypto_la-dsa_lib.lo `test -f 'dsa/dsa_lib.c' || echo '$(srcdir)/'`dsa/dsa_lib.c +dsa/libcrypto_la-dsa_meth.lo: dsa/dsa_meth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dsa/libcrypto_la-dsa_meth.lo -MD -MP -MF dsa/$(DEPDIR)/libcrypto_la-dsa_meth.Tpo -c -o dsa/libcrypto_la-dsa_meth.lo `test -f 'dsa/dsa_meth.c' || echo '$(srcdir)/'`dsa/dsa_meth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcrypto_la-dsa_meth.Tpo dsa/$(DEPDIR)/libcrypto_la-dsa_meth.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsa/dsa_meth.c' object='dsa/libcrypto_la-dsa_meth.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dsa/libcrypto_la-dsa_meth.lo `test -f 'dsa/dsa_meth.c' || echo '$(srcdir)/'`dsa/dsa_meth.c + dsa/libcrypto_la-dsa_ossl.lo: dsa/dsa_ossl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dsa/libcrypto_la-dsa_ossl.lo -MD -MP -MF dsa/$(DEPDIR)/libcrypto_la-dsa_ossl.Tpo -c -o dsa/libcrypto_la-dsa_ossl.lo `test -f 'dsa/dsa_ossl.c' || echo '$(srcdir)/'`dsa/dsa_ossl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dsa/$(DEPDIR)/libcrypto_la-dsa_ossl.Tpo dsa/$(DEPDIR)/libcrypto_la-dsa_ossl.Plo @@ -5654,6 +6970,13 @@ ec/libcrypto_la-ec_key.lo: ec/ec_key.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ec/libcrypto_la-ec_key.lo `test -f 'ec/ec_key.c' || echo '$(srcdir)/'`ec/ec_key.c +ec/libcrypto_la-ec_kmeth.lo: ec/ec_kmeth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ec/libcrypto_la-ec_kmeth.lo -MD -MP -MF ec/$(DEPDIR)/libcrypto_la-ec_kmeth.Tpo -c -o ec/libcrypto_la-ec_kmeth.lo `test -f 'ec/ec_kmeth.c' || echo '$(srcdir)/'`ec/ec_kmeth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ec/$(DEPDIR)/libcrypto_la-ec_kmeth.Tpo ec/$(DEPDIR)/libcrypto_la-ec_kmeth.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ec/ec_kmeth.c' object='ec/libcrypto_la-ec_kmeth.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ec/libcrypto_la-ec_kmeth.lo `test -f 'ec/ec_kmeth.c' || echo '$(srcdir)/'`ec/ec_kmeth.c + ec/libcrypto_la-ec_lib.lo: ec/ec_lib.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ec/libcrypto_la-ec_lib.lo -MD -MP -MF ec/$(DEPDIR)/libcrypto_la-ec_lib.Tpo -c -o ec/libcrypto_la-ec_lib.lo `test -f 'ec/ec_lib.c' || echo '$(srcdir)/'`ec/ec_lib.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ec/$(DEPDIR)/libcrypto_la-ec_lib.Tpo ec/$(DEPDIR)/libcrypto_la-ec_lib.Plo @@ -5920,6 +7243,13 @@ engine/libcrypto_la-tb_ecdsa.lo: engine/tb_ecdsa.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o engine/libcrypto_la-tb_ecdsa.lo `test -f 'engine/tb_ecdsa.c' || echo '$(srcdir)/'`engine/tb_ecdsa.c +engine/libcrypto_la-tb_eckey.lo: engine/tb_eckey.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT engine/libcrypto_la-tb_eckey.lo -MD -MP -MF engine/$(DEPDIR)/libcrypto_la-tb_eckey.Tpo -c -o engine/libcrypto_la-tb_eckey.lo `test -f 'engine/tb_eckey.c' || echo '$(srcdir)/'`engine/tb_eckey.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) engine/$(DEPDIR)/libcrypto_la-tb_eckey.Tpo engine/$(DEPDIR)/libcrypto_la-tb_eckey.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='engine/tb_eckey.c' object='engine/libcrypto_la-tb_eckey.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o engine/libcrypto_la-tb_eckey.lo `test -f 'engine/tb_eckey.c' || echo '$(srcdir)/'`engine/tb_eckey.c + engine/libcrypto_la-tb_pkmeth.lo: engine/tb_pkmeth.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT engine/libcrypto_la-tb_pkmeth.lo -MD -MP -MF engine/$(DEPDIR)/libcrypto_la-tb_pkmeth.Tpo -c -o engine/libcrypto_la-tb_pkmeth.lo `test -f 'engine/tb_pkmeth.c' || echo '$(srcdir)/'`engine/tb_pkmeth.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) engine/$(DEPDIR)/libcrypto_la-tb_pkmeth.Tpo engine/$(DEPDIR)/libcrypto_la-tb_pkmeth.Plo @@ -6116,6 +7446,13 @@ evp/libcrypto_la-e_rc4_hmac_md5.lo: evp/e_rc4_hmac_md5.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o evp/libcrypto_la-e_rc4_hmac_md5.lo `test -f 'evp/e_rc4_hmac_md5.c' || echo '$(srcdir)/'`evp/e_rc4_hmac_md5.c +evp/libcrypto_la-e_sm4.lo: evp/e_sm4.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT evp/libcrypto_la-e_sm4.lo -MD -MP -MF evp/$(DEPDIR)/libcrypto_la-e_sm4.Tpo -c -o evp/libcrypto_la-e_sm4.lo `test -f 'evp/e_sm4.c' || echo '$(srcdir)/'`evp/e_sm4.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) evp/$(DEPDIR)/libcrypto_la-e_sm4.Tpo evp/$(DEPDIR)/libcrypto_la-e_sm4.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evp/e_sm4.c' object='evp/libcrypto_la-e_sm4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o evp/libcrypto_la-e_sm4.lo `test -f 'evp/e_sm4.c' || echo '$(srcdir)/'`evp/e_sm4.c + evp/libcrypto_la-e_xcbc_d.lo: evp/e_xcbc_d.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT evp/libcrypto_la-e_xcbc_d.lo -MD -MP -MF evp/$(DEPDIR)/libcrypto_la-e_xcbc_d.Tpo -c -o evp/libcrypto_la-e_xcbc_d.lo `test -f 'evp/e_xcbc_d.c' || echo '$(srcdir)/'`evp/e_xcbc_d.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) evp/$(DEPDIR)/libcrypto_la-e_xcbc_d.Tpo evp/$(DEPDIR)/libcrypto_la-e_xcbc_d.Plo @@ -6270,6 +7607,13 @@ evp/libcrypto_la-m_streebog.lo: evp/m_streebog.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o evp/libcrypto_la-m_streebog.lo `test -f 'evp/m_streebog.c' || echo '$(srcdir)/'`evp/m_streebog.c +evp/libcrypto_la-m_sm3.lo: evp/m_sm3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT evp/libcrypto_la-m_sm3.lo -MD -MP -MF evp/$(DEPDIR)/libcrypto_la-m_sm3.Tpo -c -o evp/libcrypto_la-m_sm3.lo `test -f 'evp/m_sm3.c' || echo '$(srcdir)/'`evp/m_sm3.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) evp/$(DEPDIR)/libcrypto_la-m_sm3.Tpo evp/$(DEPDIR)/libcrypto_la-m_sm3.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evp/m_sm3.c' object='evp/libcrypto_la-m_sm3.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o evp/libcrypto_la-m_sm3.lo `test -f 'evp/m_sm3.c' || echo '$(srcdir)/'`evp/m_sm3.c + evp/libcrypto_la-m_wp.lo: evp/m_wp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT evp/libcrypto_la-m_wp.lo -MD -MP -MF evp/$(DEPDIR)/libcrypto_la-m_wp.Tpo -c -o evp/libcrypto_la-m_wp.lo `test -f 'evp/m_wp.c' || echo '$(srcdir)/'`evp/m_wp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) evp/$(DEPDIR)/libcrypto_la-m_wp.Tpo evp/$(DEPDIR)/libcrypto_la-m_wp.Plo @@ -7110,6 +8454,13 @@ rsa/libcrypto_la-rsa_lib.lo: rsa/rsa_lib.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsa/libcrypto_la-rsa_lib.lo `test -f 'rsa/rsa_lib.c' || echo '$(srcdir)/'`rsa/rsa_lib.c +rsa/libcrypto_la-rsa_meth.lo: rsa/rsa_meth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsa/libcrypto_la-rsa_meth.lo -MD -MP -MF rsa/$(DEPDIR)/libcrypto_la-rsa_meth.Tpo -c -o rsa/libcrypto_la-rsa_meth.lo `test -f 'rsa/rsa_meth.c' || echo '$(srcdir)/'`rsa/rsa_meth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) rsa/$(DEPDIR)/libcrypto_la-rsa_meth.Tpo rsa/$(DEPDIR)/libcrypto_la-rsa_meth.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rsa/rsa_meth.c' object='rsa/libcrypto_la-rsa_meth.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsa/libcrypto_la-rsa_meth.lo `test -f 'rsa/rsa_meth.c' || echo '$(srcdir)/'`rsa/rsa_meth.c + rsa/libcrypto_la-rsa_none.lo: rsa/rsa_none.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsa/libcrypto_la-rsa_none.lo -MD -MP -MF rsa/$(DEPDIR)/libcrypto_la-rsa_none.Tpo -c -o rsa/libcrypto_la-rsa_none.lo `test -f 'rsa/rsa_none.c' || echo '$(srcdir)/'`rsa/rsa_none.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) rsa/$(DEPDIR)/libcrypto_la-rsa_none.Tpo rsa/$(DEPDIR)/libcrypto_la-rsa_none.Plo @@ -7201,6 +8552,20 @@ sha/libcrypto_la-sha512.lo: sha/sha512.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha/libcrypto_la-sha512.lo `test -f 'sha/sha512.c' || echo '$(srcdir)/'`sha/sha512.c +sm3/libcrypto_la-sm3.lo: sm3/sm3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sm3/libcrypto_la-sm3.lo -MD -MP -MF sm3/$(DEPDIR)/libcrypto_la-sm3.Tpo -c -o sm3/libcrypto_la-sm3.lo `test -f 'sm3/sm3.c' || echo '$(srcdir)/'`sm3/sm3.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sm3/$(DEPDIR)/libcrypto_la-sm3.Tpo sm3/$(DEPDIR)/libcrypto_la-sm3.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sm3/sm3.c' object='sm3/libcrypto_la-sm3.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sm3/libcrypto_la-sm3.lo `test -f 'sm3/sm3.c' || echo '$(srcdir)/'`sm3/sm3.c + +sm4/libcrypto_la-sm4.lo: sm4/sm4.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sm4/libcrypto_la-sm4.lo -MD -MP -MF sm4/$(DEPDIR)/libcrypto_la-sm4.Tpo -c -o sm4/libcrypto_la-sm4.lo `test -f 'sm4/sm4.c' || echo '$(srcdir)/'`sm4/sm4.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sm4/$(DEPDIR)/libcrypto_la-sm4.Tpo sm4/$(DEPDIR)/libcrypto_la-sm4.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sm4/sm4.c' object='sm4/libcrypto_la-sm4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sm4/libcrypto_la-sm4.lo `test -f 'sm4/sm4.c' || echo '$(srcdir)/'`sm4/sm4.c + stack/libcrypto_la-stack.lo: stack/stack.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stack/libcrypto_la-stack.lo -MD -MP -MF stack/$(DEPDIR)/libcrypto_la-stack.Tpo -c -o stack/libcrypto_la-stack.lo `test -f 'stack/stack.c' || echo '$(srcdir)/'`stack/stack.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) stack/$(DEPDIR)/libcrypto_la-stack.Tpo stack/$(DEPDIR)/libcrypto_la-stack.Plo @@ -7817,6 +9182,8 @@ clean-libtool: -rm -rf ripemd/.libs ripemd/_libs -rm -rf rsa/.libs rsa/_libs -rm -rf sha/.libs sha/_libs + -rm -rf sm3/.libs sm3/_libs + -rm -rf sm4/.libs sm4/_libs -rm -rf stack/.libs stack/_libs -rm -rf ts/.libs ts/_libs -rm -rf txt_db/.libs txt_db/_libs @@ -7877,7 +9244,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -8031,6 +9401,10 @@ distclean-generic: -rm -f rsa/$(am__dirstamp) -rm -f sha/$(DEPDIR)/$(am__dirstamp) -rm -f sha/$(am__dirstamp) + -rm -f sm3/$(DEPDIR)/$(am__dirstamp) + -rm -f sm3/$(am__dirstamp) + -rm -f sm4/$(DEPDIR)/$(am__dirstamp) + -rm -f sm4/$(am__dirstamp) -rm -f stack/$(DEPDIR)/$(am__dirstamp) -rm -f stack/$(am__dirstamp) -rm -f ts/$(DEPDIR)/$(am__dirstamp) @@ -8056,7 +9430,672 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) aes/$(DEPDIR) asn1/$(DEPDIR) bf/$(DEPDIR) bio/$(DEPDIR) bn/$(DEPDIR) buffer/$(DEPDIR) camellia/$(DEPDIR) cast/$(DEPDIR) chacha/$(DEPDIR) cmac/$(DEPDIR) comp/$(DEPDIR) compat/$(DEPDIR) conf/$(DEPDIR) curve25519/$(DEPDIR) des/$(DEPDIR) dh/$(DEPDIR) dsa/$(DEPDIR) dso/$(DEPDIR) ec/$(DEPDIR) ecdh/$(DEPDIR) ecdsa/$(DEPDIR) engine/$(DEPDIR) err/$(DEPDIR) evp/$(DEPDIR) gost/$(DEPDIR) hkdf/$(DEPDIR) hmac/$(DEPDIR) idea/$(DEPDIR) lhash/$(DEPDIR) md4/$(DEPDIR) md5/$(DEPDIR) modes/$(DEPDIR) objects/$(DEPDIR) ocsp/$(DEPDIR) pem/$(DEPDIR) pkcs12/$(DEPDIR) pkcs7/$(DEPDIR) poly1305/$(DEPDIR) rand/$(DEPDIR) rc2/$(DEPDIR) rc4/$(DEPDIR) ripemd/$(DEPDIR) rsa/$(DEPDIR) sha/$(DEPDIR) stack/$(DEPDIR) ts/$(DEPDIR) txt_db/$(DEPDIR) ui/$(DEPDIR) whrlpool/$(DEPDIR) x509/$(DEPDIR) x509v3/$(DEPDIR) + -rm -f ./$(DEPDIR)/libcrypto_la-armcap.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-armv4cpuid.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cpt_err.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cpuid-elf-x86_64.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cpuid-macosx-x86_64.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cpuid-masm-x86_64.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cpuid-mingw64-x86_64.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cryptlib.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-crypto_init.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-crypto_lock.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cversion.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-ex_data.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-malloc-wrapper.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-mem_clr.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-mem_dbg.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-o_init.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-o_str.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-o_time.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes-elf-armv4.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes-elf-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes-macosx-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes-masm-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes-mingw64-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_cbc.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_cfb.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_core.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_ctr.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_ecb.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_ige.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_misc.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_ofb.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_wrap.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-elf-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-macosx-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-masm-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-mingw64-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-sha1-elf-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-sha1-macosx-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-sha1-masm-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-sha1-mingw64-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-bsaes-elf-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-bsaes-macosx-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-bsaes-masm-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-bsaes-mingw64-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-vpaes-elf-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-vpaes-macosx-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-vpaes-masm-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-vpaes-mingw64-x86_64.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_bitstr.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_bool.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_d2i_fp.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_digest.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_dup.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_enum.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_i2d_fp.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_int.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_mbstr.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_object.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_octet.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_print.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_sign.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_strex.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_strnid.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_time.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_time_tm.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_type.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_utf8.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_verify.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-ameth_lib.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn1_err.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn1_gen.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn1_lib.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn1_par.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn_mime.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn_moid.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn_pack.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-bio_asn1.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-bio_ndef.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-d2i_pr.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-d2i_pu.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-evp_asn1.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-f_enum.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-f_int.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-f_string.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-i2d_pr.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-i2d_pu.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-n_pkey.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-nsseq.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-p5_pbe.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-p5_pbev2.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-p8_pkey.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_bitst.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_crl.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_pkey.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_req.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_spki.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_x509.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_x509a.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_dec.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_enc.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_fre.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_new.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_prn.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_typ.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_utl.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_algor.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_attrib.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_bignum.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_crl.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_exten.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_info.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_long.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_name.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_nx509.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_pkey.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_pubkey.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_req.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_sig.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_spki.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_val.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_x509.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_x509a.Plo + -rm -f bf/$(DEPDIR)/libcrypto_la-bf_cfb64.Plo + -rm -f bf/$(DEPDIR)/libcrypto_la-bf_ecb.Plo + -rm -f bf/$(DEPDIR)/libcrypto_la-bf_enc.Plo + -rm -f bf/$(DEPDIR)/libcrypto_la-bf_ofb64.Plo + -rm -f bf/$(DEPDIR)/libcrypto_la-bf_skey.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-b_dump.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-b_posix.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-b_print.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-b_sock.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-b_win.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bf_buff.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bf_nbio.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bf_null.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bio_cb.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bio_err.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bio_lib.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bio_meth.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_acpt.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_bio.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_conn.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_dgram.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_fd.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_file.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_log.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_mem.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_null.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_sock.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_add.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_asm.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_blind.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_const.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_ctx.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_depr.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_div.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_err.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_exp.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_exp2.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_gcd.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_gf2m.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_kron.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_lib.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_mod.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_mont.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_mpi.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_mul.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_nist.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_prime.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_print.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_rand.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_recp.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_shift.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_sqr.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_sqrt.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_word.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_x931p.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-gf2m-elf-armv4.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-gf2m-elf-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-gf2m-macosx-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-gf2m-masm-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-modexp512-elf-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-modexp512-macosx-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-modexp512-masm-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont-elf-armv4.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont-elf-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont-macosx-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont-masm-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont5-elf-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont5-macosx-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont5-masm-x86_64.Plo + -rm -f buffer/$(DEPDIR)/libcrypto_la-buf_err.Plo + -rm -f buffer/$(DEPDIR)/libcrypto_la-buf_str.Plo + -rm -f buffer/$(DEPDIR)/libcrypto_la-buffer.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-camellia.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll-elf-x86_64.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll-macosx-x86_64.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll-masm-x86_64.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll-mingw64-x86_64.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_cbc.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_cfb.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_ctr.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_ecb.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_misc.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_ofb.Plo + -rm -f cast/$(DEPDIR)/libcrypto_la-c_cfb64.Plo + -rm -f cast/$(DEPDIR)/libcrypto_la-c_ecb.Plo + -rm -f cast/$(DEPDIR)/libcrypto_la-c_enc.Plo + -rm -f cast/$(DEPDIR)/libcrypto_la-c_ofb64.Plo + -rm -f cast/$(DEPDIR)/libcrypto_la-c_skey.Plo + -rm -f chacha/$(DEPDIR)/libcrypto_la-chacha-merged.Plo + -rm -f chacha/$(DEPDIR)/libcrypto_la-chacha.Plo + -rm -f cmac/$(DEPDIR)/libcrypto_la-cm_ameth.Plo + -rm -f cmac/$(DEPDIR)/libcrypto_la-cm_pmeth.Plo + -rm -f cmac/$(DEPDIR)/libcrypto_la-cmac.Plo + -rm -f comp/$(DEPDIR)/libcrypto_la-c_rle.Plo + -rm -f comp/$(DEPDIR)/libcrypto_la-c_zlib.Plo + -rm -f comp/$(DEPDIR)/libcrypto_la-comp_err.Plo + -rm -f comp/$(DEPDIR)/libcrypto_la-comp_lib.Plo + -rm -f compat/$(DEPDIR)/arc4random.Plo + -rm -f compat/$(DEPDIR)/arc4random_uniform.Plo + -rm -f compat/$(DEPDIR)/bsd-asprintf.Plo + -rm -f compat/$(DEPDIR)/freezero.Plo + -rm -f compat/$(DEPDIR)/getentropy_aix.Plo + -rm -f compat/$(DEPDIR)/getentropy_freebsd.Plo + -rm -f compat/$(DEPDIR)/getentropy_hpux.Plo + -rm -f compat/$(DEPDIR)/getentropy_linux.Plo + -rm -f compat/$(DEPDIR)/getentropy_netbsd.Plo + -rm -f compat/$(DEPDIR)/getentropy_osx.Plo + -rm -f compat/$(DEPDIR)/getentropy_solaris.Plo + -rm -f compat/$(DEPDIR)/getentropy_win.Plo + -rm -f compat/$(DEPDIR)/getpagesize.Plo + -rm -f compat/$(DEPDIR)/getprogname_linux.Plo + -rm -f compat/$(DEPDIR)/getprogname_unimpl.Plo + -rm -f compat/$(DEPDIR)/getprogname_windows.Plo + -rm -f compat/$(DEPDIR)/libcompatnoopt_la-explicit_bzero.Plo + -rm -f compat/$(DEPDIR)/libcompatnoopt_la-explicit_bzero_win.Plo + -rm -f compat/$(DEPDIR)/libcrypto_la-crypto_lock_win.Plo + -rm -f compat/$(DEPDIR)/posix_win.Plo + -rm -f compat/$(DEPDIR)/reallocarray.Plo + -rm -f compat/$(DEPDIR)/recallocarray.Plo + -rm -f compat/$(DEPDIR)/strlcat.Plo + -rm -f compat/$(DEPDIR)/strlcpy.Plo + -rm -f compat/$(DEPDIR)/strndup.Plo + -rm -f compat/$(DEPDIR)/strnlen.Plo + -rm -f compat/$(DEPDIR)/strsep.Plo + -rm -f compat/$(DEPDIR)/syslog_r.Plo + -rm -f compat/$(DEPDIR)/timegm.Plo + -rm -f compat/$(DEPDIR)/timingsafe_bcmp.Plo + -rm -f compat/$(DEPDIR)/timingsafe_memcmp.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_api.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_def.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_err.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_lib.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_mall.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_mod.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_sap.Plo + -rm -f curve25519/$(DEPDIR)/libcrypto_la-curve25519-generic.Plo + -rm -f curve25519/$(DEPDIR)/libcrypto_la-curve25519.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-cbc_cksm.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-cbc_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-cfb64ede.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-cfb64enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-cfb_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-des_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ecb3_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ecb_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ede_cbcm_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-enc_read.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-enc_writ.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-fcrypt.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-fcrypt_b.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ncbc_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ofb64ede.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ofb64enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ofb_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-pcbc_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-qud_cksm.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-rand_key.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-set_key.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-str2key.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-xcbc_enc.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_ameth.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_asn1.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_check.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_depr.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_err.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_gen.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_key.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_lib.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_pmeth.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_prn.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_ameth.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_asn1.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_depr.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_err.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_gen.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_key.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_lib.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_meth.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_ossl.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_pmeth.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_prn.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_sign.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_vrf.Plo + -rm -f dso/$(DEPDIR)/libcrypto_la-dso_dlfcn.Plo + -rm -f dso/$(DEPDIR)/libcrypto_la-dso_err.Plo + -rm -f dso/$(DEPDIR)/libcrypto_la-dso_lib.Plo + -rm -f dso/$(DEPDIR)/libcrypto_la-dso_null.Plo + -rm -f dso/$(DEPDIR)/libcrypto_la-dso_openssl.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec2_mult.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec2_oct.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec2_smpl.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_ameth.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_asn1.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_check.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_curve.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_cvt.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_err.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_key.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_kmeth.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_lib.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_mult.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_oct.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_pmeth.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_print.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-eck_prn.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ecp_mont.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ecp_nist.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ecp_oct.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ecp_smpl.Plo + -rm -f ecdh/$(DEPDIR)/libcrypto_la-ech_err.Plo + -rm -f ecdh/$(DEPDIR)/libcrypto_la-ech_key.Plo + -rm -f ecdh/$(DEPDIR)/libcrypto_la-ech_lib.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_asn1.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_err.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_lib.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_ossl.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_sign.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_vrf.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_all.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_cnf.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_ctrl.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_dyn.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_err.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_fat.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_init.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_lib.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_list.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_openssl.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_pkey.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_table.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_asnmth.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_cipher.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_dh.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_digest.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_dsa.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_ecdh.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_ecdsa.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_eckey.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_pkmeth.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_rand.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_rsa.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_store.Plo + -rm -f err/$(DEPDIR)/libcrypto_la-err.Plo + -rm -f err/$(DEPDIR)/libcrypto_la-err_all.Plo + -rm -f err/$(DEPDIR)/libcrypto_la-err_prn.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-bio_b64.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-bio_enc.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-bio_md.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-c_all.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-digest.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_aes.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_aes_cbc_hmac_sha1.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_bf.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_camellia.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_cast.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_chacha.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_chacha20poly1305.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_des.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_des3.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_gost2814789.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_idea.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_null.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_old.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_rc2.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_rc4.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_rc4_hmac_md5.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_sm4.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_xcbc_d.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-encode.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_aead.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_enc.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_err.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_key.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_lib.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_pbe.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_pkey.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_dss.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_dss1.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_ecdsa.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_gost2814789.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_gostr341194.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_md4.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_md5.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_md5_sha1.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_null.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_ripemd.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_sha1.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_sigver.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_sm3.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_streebog.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_wp.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-names.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p5_crpt.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p5_crpt2.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_dec.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_enc.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_lib.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_open.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_seal.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_sign.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_verify.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-pmeth_fn.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-pmeth_gn.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-pmeth_lib.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost2814789.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost89_keywrap.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost89_params.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost89imit_ameth.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost89imit_pmeth.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost_asn1.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost_err.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341001.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341001_ameth.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341001_key.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341001_params.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341001_pmeth.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341194.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-streebog.Plo + -rm -f hkdf/$(DEPDIR)/libcrypto_la-hkdf.Plo + -rm -f hmac/$(DEPDIR)/libcrypto_la-hm_ameth.Plo + -rm -f hmac/$(DEPDIR)/libcrypto_la-hm_pmeth.Plo + -rm -f hmac/$(DEPDIR)/libcrypto_la-hmac.Plo + -rm -f idea/$(DEPDIR)/libcrypto_la-i_cbc.Plo + -rm -f idea/$(DEPDIR)/libcrypto_la-i_cfb64.Plo + -rm -f idea/$(DEPDIR)/libcrypto_la-i_ecb.Plo + -rm -f idea/$(DEPDIR)/libcrypto_la-i_ofb64.Plo + -rm -f idea/$(DEPDIR)/libcrypto_la-i_skey.Plo + -rm -f lhash/$(DEPDIR)/libcrypto_la-lh_stats.Plo + -rm -f lhash/$(DEPDIR)/libcrypto_la-lhash.Plo + -rm -f md4/$(DEPDIR)/libcrypto_la-md4_dgst.Plo + -rm -f md4/$(DEPDIR)/libcrypto_la-md4_one.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5-elf-x86_64.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5-macosx-x86_64.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5-masm-x86_64.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5-mingw64-x86_64.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5_dgst.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5_one.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-cbc128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ccm128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-cfb128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ctr128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-cts128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-gcm128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ghash-elf-armv4.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ghash-elf-x86_64.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ghash-macosx-x86_64.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ghash-masm-x86_64.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ghash-mingw64-x86_64.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ofb128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-xts128.Plo + -rm -f objects/$(DEPDIR)/libcrypto_la-o_names.Plo + -rm -f objects/$(DEPDIR)/libcrypto_la-obj_dat.Plo + -rm -f objects/$(DEPDIR)/libcrypto_la-obj_err.Plo + -rm -f objects/$(DEPDIR)/libcrypto_la-obj_lib.Plo + -rm -f objects/$(DEPDIR)/libcrypto_la-obj_xref.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_asn.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_cl.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_err.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_ext.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_ht.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_lib.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_prn.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_srv.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_vfy.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_all.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_err.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_info.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_lib.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_oth.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_pk8.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_pkey.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_seal.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_sign.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_x509.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_xaux.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pvkfmt.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_add.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_asn.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_attr.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_crpt.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_crt.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_decr.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_init.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_key.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_kiss.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_mutl.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_npas.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_p8d.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_p8e.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_utl.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-pk12err.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-bio_pk7.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_asn1.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_attr.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_doit.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_lib.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_mime.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_smime.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pkcs7err.Plo + -rm -f poly1305/$(DEPDIR)/libcrypto_la-poly1305-donna.Plo + -rm -f poly1305/$(DEPDIR)/libcrypto_la-poly1305.Plo + -rm -f rand/$(DEPDIR)/libcrypto_la-rand_err.Plo + -rm -f rand/$(DEPDIR)/libcrypto_la-rand_lib.Plo + -rm -f rand/$(DEPDIR)/libcrypto_la-randfile.Plo + -rm -f rc2/$(DEPDIR)/libcrypto_la-rc2_cbc.Plo + -rm -f rc2/$(DEPDIR)/libcrypto_la-rc2_ecb.Plo + -rm -f rc2/$(DEPDIR)/libcrypto_la-rc2_skey.Plo + -rm -f rc2/$(DEPDIR)/libcrypto_la-rc2cfb64.Plo + -rm -f rc2/$(DEPDIR)/libcrypto_la-rc2ofb64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-elf-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-macosx-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-masm-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-md5-elf-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-md5-macosx-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-md5-masm-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-md5-mingw64-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-mingw64-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4_enc.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4_skey.Plo + -rm -f ripemd/$(DEPDIR)/libcrypto_la-rmd_dgst.Plo + -rm -f ripemd/$(DEPDIR)/libcrypto_la-rmd_one.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_ameth.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_asn1.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_chk.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_crpt.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_depr.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_eay.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_err.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_gen.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_lib.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_meth.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_none.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_oaep.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_pk1.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_pmeth.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_prn.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_pss.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_saos.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_sign.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_x931.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1-elf-armv4.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1-elf-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1-macosx-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1-masm-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1-mingw64-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1_one.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1dgst.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256-elf-armv4.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256-elf-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256-macosx-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256-masm-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256-mingw64-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512-elf-armv4.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512-elf-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512-macosx-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512-masm-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512-mingw64-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512.Plo + -rm -f sm3/$(DEPDIR)/libcrypto_la-sm3.Plo + -rm -f sm4/$(DEPDIR)/libcrypto_la-sm4.Plo + -rm -f stack/$(DEPDIR)/libcrypto_la-stack.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_asn1.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_conf.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_err.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_lib.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_req_print.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_req_utils.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_rsp_print.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_rsp_sign.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_rsp_utils.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_rsp_verify.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_verify_ctx.Plo + -rm -f txt_db/$(DEPDIR)/libcrypto_la-txt_db.Plo + -rm -f ui/$(DEPDIR)/libcrypto_la-ui_err.Plo + -rm -f ui/$(DEPDIR)/libcrypto_la-ui_lib.Plo + -rm -f ui/$(DEPDIR)/libcrypto_la-ui_openssl.Plo + -rm -f ui/$(DEPDIR)/libcrypto_la-ui_openssl_win.Plo + -rm -f ui/$(DEPDIR)/libcrypto_la-ui_util.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp-elf-x86_64.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp-macosx-x86_64.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp-masm-x86_64.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp-mingw64-x86_64.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp_block.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp_dgst.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-by_dir.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-by_file.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-by_mem.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_att.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_cmp.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_d2.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_def.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_err.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_ext.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_lu.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_obj.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_r2x.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_req.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_set.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_trs.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_txt.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_v3.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_vfy.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_vpm.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509cset.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509name.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509rset.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509spki.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509type.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x_all.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_cache.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_data.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_lib.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_map.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_node.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_tree.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_akey.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_akeya.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_alt.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_bcons.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_bitst.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_conf.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_cpols.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_crld.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_enum.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_extku.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_genn.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_ia5.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_info.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_int.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_lib.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_ncons.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_ocsp.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_pci.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_pcia.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_pcons.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_pku.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_pmaps.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_prn.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_purp.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_skey.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_sxnet.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_utl.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3err.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -8102,7 +10141,672 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) aes/$(DEPDIR) asn1/$(DEPDIR) bf/$(DEPDIR) bio/$(DEPDIR) bn/$(DEPDIR) buffer/$(DEPDIR) camellia/$(DEPDIR) cast/$(DEPDIR) chacha/$(DEPDIR) cmac/$(DEPDIR) comp/$(DEPDIR) compat/$(DEPDIR) conf/$(DEPDIR) curve25519/$(DEPDIR) des/$(DEPDIR) dh/$(DEPDIR) dsa/$(DEPDIR) dso/$(DEPDIR) ec/$(DEPDIR) ecdh/$(DEPDIR) ecdsa/$(DEPDIR) engine/$(DEPDIR) err/$(DEPDIR) evp/$(DEPDIR) gost/$(DEPDIR) hkdf/$(DEPDIR) hmac/$(DEPDIR) idea/$(DEPDIR) lhash/$(DEPDIR) md4/$(DEPDIR) md5/$(DEPDIR) modes/$(DEPDIR) objects/$(DEPDIR) ocsp/$(DEPDIR) pem/$(DEPDIR) pkcs12/$(DEPDIR) pkcs7/$(DEPDIR) poly1305/$(DEPDIR) rand/$(DEPDIR) rc2/$(DEPDIR) rc4/$(DEPDIR) ripemd/$(DEPDIR) rsa/$(DEPDIR) sha/$(DEPDIR) stack/$(DEPDIR) ts/$(DEPDIR) txt_db/$(DEPDIR) ui/$(DEPDIR) whrlpool/$(DEPDIR) x509/$(DEPDIR) x509v3/$(DEPDIR) + -rm -f ./$(DEPDIR)/libcrypto_la-armcap.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-armv4cpuid.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cpt_err.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cpuid-elf-x86_64.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cpuid-macosx-x86_64.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cpuid-masm-x86_64.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cpuid-mingw64-x86_64.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cryptlib.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-crypto_init.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-crypto_lock.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-cversion.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-ex_data.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-malloc-wrapper.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-mem_clr.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-mem_dbg.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-o_init.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-o_str.Plo + -rm -f ./$(DEPDIR)/libcrypto_la-o_time.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes-elf-armv4.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes-elf-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes-macosx-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes-masm-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes-mingw64-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_cbc.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_cfb.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_core.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_ctr.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_ecb.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_ige.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_misc.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_ofb.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aes_wrap.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-elf-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-macosx-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-masm-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-mingw64-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-sha1-elf-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-sha1-macosx-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-sha1-masm-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-aesni-sha1-mingw64-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-bsaes-elf-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-bsaes-macosx-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-bsaes-masm-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-bsaes-mingw64-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-vpaes-elf-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-vpaes-macosx-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-vpaes-masm-x86_64.Plo + -rm -f aes/$(DEPDIR)/libcrypto_la-vpaes-mingw64-x86_64.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_bitstr.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_bool.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_d2i_fp.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_digest.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_dup.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_enum.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_i2d_fp.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_int.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_mbstr.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_object.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_octet.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_print.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_sign.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_strex.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_strnid.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_time.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_time_tm.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_type.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_utf8.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-a_verify.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-ameth_lib.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn1_err.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn1_gen.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn1_lib.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn1_par.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn_mime.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn_moid.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-asn_pack.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-bio_asn1.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-bio_ndef.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-d2i_pr.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-d2i_pu.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-evp_asn1.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-f_enum.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-f_int.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-f_string.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-i2d_pr.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-i2d_pu.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-n_pkey.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-nsseq.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-p5_pbe.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-p5_pbev2.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-p8_pkey.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_bitst.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_crl.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_pkey.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_req.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_spki.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_x509.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-t_x509a.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_dec.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_enc.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_fre.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_new.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_prn.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_typ.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-tasn_utl.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_algor.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_attrib.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_bignum.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_crl.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_exten.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_info.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_long.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_name.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_nx509.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_pkey.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_pubkey.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_req.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_sig.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_spki.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_val.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_x509.Plo + -rm -f asn1/$(DEPDIR)/libcrypto_la-x_x509a.Plo + -rm -f bf/$(DEPDIR)/libcrypto_la-bf_cfb64.Plo + -rm -f bf/$(DEPDIR)/libcrypto_la-bf_ecb.Plo + -rm -f bf/$(DEPDIR)/libcrypto_la-bf_enc.Plo + -rm -f bf/$(DEPDIR)/libcrypto_la-bf_ofb64.Plo + -rm -f bf/$(DEPDIR)/libcrypto_la-bf_skey.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-b_dump.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-b_posix.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-b_print.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-b_sock.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-b_win.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bf_buff.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bf_nbio.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bf_null.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bio_cb.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bio_err.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bio_lib.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bio_meth.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_acpt.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_bio.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_conn.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_dgram.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_fd.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_file.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_log.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_mem.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_null.Plo + -rm -f bio/$(DEPDIR)/libcrypto_la-bss_sock.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_add.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_asm.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_blind.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_const.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_ctx.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_depr.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_div.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_err.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_exp.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_exp2.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_gcd.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_gf2m.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_kron.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_lib.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_mod.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_mont.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_mpi.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_mul.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_nist.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_prime.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_print.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_rand.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_recp.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_shift.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_sqr.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_sqrt.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_word.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-bn_x931p.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-gf2m-elf-armv4.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-gf2m-elf-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-gf2m-macosx-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-gf2m-masm-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-modexp512-elf-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-modexp512-macosx-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-modexp512-masm-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont-elf-armv4.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont-elf-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont-macosx-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont-masm-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont5-elf-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont5-macosx-x86_64.Plo + -rm -f bn/$(DEPDIR)/libcrypto_la-mont5-masm-x86_64.Plo + -rm -f buffer/$(DEPDIR)/libcrypto_la-buf_err.Plo + -rm -f buffer/$(DEPDIR)/libcrypto_la-buf_str.Plo + -rm -f buffer/$(DEPDIR)/libcrypto_la-buffer.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-camellia.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll-elf-x86_64.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll-macosx-x86_64.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll-masm-x86_64.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll-mingw64-x86_64.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_cbc.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_cfb.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_ctr.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_ecb.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_misc.Plo + -rm -f camellia/$(DEPDIR)/libcrypto_la-cmll_ofb.Plo + -rm -f cast/$(DEPDIR)/libcrypto_la-c_cfb64.Plo + -rm -f cast/$(DEPDIR)/libcrypto_la-c_ecb.Plo + -rm -f cast/$(DEPDIR)/libcrypto_la-c_enc.Plo + -rm -f cast/$(DEPDIR)/libcrypto_la-c_ofb64.Plo + -rm -f cast/$(DEPDIR)/libcrypto_la-c_skey.Plo + -rm -f chacha/$(DEPDIR)/libcrypto_la-chacha-merged.Plo + -rm -f chacha/$(DEPDIR)/libcrypto_la-chacha.Plo + -rm -f cmac/$(DEPDIR)/libcrypto_la-cm_ameth.Plo + -rm -f cmac/$(DEPDIR)/libcrypto_la-cm_pmeth.Plo + -rm -f cmac/$(DEPDIR)/libcrypto_la-cmac.Plo + -rm -f comp/$(DEPDIR)/libcrypto_la-c_rle.Plo + -rm -f comp/$(DEPDIR)/libcrypto_la-c_zlib.Plo + -rm -f comp/$(DEPDIR)/libcrypto_la-comp_err.Plo + -rm -f comp/$(DEPDIR)/libcrypto_la-comp_lib.Plo + -rm -f compat/$(DEPDIR)/arc4random.Plo + -rm -f compat/$(DEPDIR)/arc4random_uniform.Plo + -rm -f compat/$(DEPDIR)/bsd-asprintf.Plo + -rm -f compat/$(DEPDIR)/freezero.Plo + -rm -f compat/$(DEPDIR)/getentropy_aix.Plo + -rm -f compat/$(DEPDIR)/getentropy_freebsd.Plo + -rm -f compat/$(DEPDIR)/getentropy_hpux.Plo + -rm -f compat/$(DEPDIR)/getentropy_linux.Plo + -rm -f compat/$(DEPDIR)/getentropy_netbsd.Plo + -rm -f compat/$(DEPDIR)/getentropy_osx.Plo + -rm -f compat/$(DEPDIR)/getentropy_solaris.Plo + -rm -f compat/$(DEPDIR)/getentropy_win.Plo + -rm -f compat/$(DEPDIR)/getpagesize.Plo + -rm -f compat/$(DEPDIR)/getprogname_linux.Plo + -rm -f compat/$(DEPDIR)/getprogname_unimpl.Plo + -rm -f compat/$(DEPDIR)/getprogname_windows.Plo + -rm -f compat/$(DEPDIR)/libcompatnoopt_la-explicit_bzero.Plo + -rm -f compat/$(DEPDIR)/libcompatnoopt_la-explicit_bzero_win.Plo + -rm -f compat/$(DEPDIR)/libcrypto_la-crypto_lock_win.Plo + -rm -f compat/$(DEPDIR)/posix_win.Plo + -rm -f compat/$(DEPDIR)/reallocarray.Plo + -rm -f compat/$(DEPDIR)/recallocarray.Plo + -rm -f compat/$(DEPDIR)/strlcat.Plo + -rm -f compat/$(DEPDIR)/strlcpy.Plo + -rm -f compat/$(DEPDIR)/strndup.Plo + -rm -f compat/$(DEPDIR)/strnlen.Plo + -rm -f compat/$(DEPDIR)/strsep.Plo + -rm -f compat/$(DEPDIR)/syslog_r.Plo + -rm -f compat/$(DEPDIR)/timegm.Plo + -rm -f compat/$(DEPDIR)/timingsafe_bcmp.Plo + -rm -f compat/$(DEPDIR)/timingsafe_memcmp.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_api.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_def.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_err.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_lib.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_mall.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_mod.Plo + -rm -f conf/$(DEPDIR)/libcrypto_la-conf_sap.Plo + -rm -f curve25519/$(DEPDIR)/libcrypto_la-curve25519-generic.Plo + -rm -f curve25519/$(DEPDIR)/libcrypto_la-curve25519.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-cbc_cksm.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-cbc_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-cfb64ede.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-cfb64enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-cfb_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-des_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ecb3_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ecb_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ede_cbcm_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-enc_read.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-enc_writ.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-fcrypt.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-fcrypt_b.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ncbc_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ofb64ede.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ofb64enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-ofb_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-pcbc_enc.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-qud_cksm.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-rand_key.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-set_key.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-str2key.Plo + -rm -f des/$(DEPDIR)/libcrypto_la-xcbc_enc.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_ameth.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_asn1.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_check.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_depr.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_err.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_gen.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_key.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_lib.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_pmeth.Plo + -rm -f dh/$(DEPDIR)/libcrypto_la-dh_prn.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_ameth.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_asn1.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_depr.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_err.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_gen.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_key.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_lib.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_meth.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_ossl.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_pmeth.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_prn.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_sign.Plo + -rm -f dsa/$(DEPDIR)/libcrypto_la-dsa_vrf.Plo + -rm -f dso/$(DEPDIR)/libcrypto_la-dso_dlfcn.Plo + -rm -f dso/$(DEPDIR)/libcrypto_la-dso_err.Plo + -rm -f dso/$(DEPDIR)/libcrypto_la-dso_lib.Plo + -rm -f dso/$(DEPDIR)/libcrypto_la-dso_null.Plo + -rm -f dso/$(DEPDIR)/libcrypto_la-dso_openssl.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec2_mult.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec2_oct.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec2_smpl.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_ameth.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_asn1.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_check.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_curve.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_cvt.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_err.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_key.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_kmeth.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_lib.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_mult.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_oct.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_pmeth.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ec_print.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-eck_prn.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ecp_mont.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ecp_nist.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ecp_oct.Plo + -rm -f ec/$(DEPDIR)/libcrypto_la-ecp_smpl.Plo + -rm -f ecdh/$(DEPDIR)/libcrypto_la-ech_err.Plo + -rm -f ecdh/$(DEPDIR)/libcrypto_la-ech_key.Plo + -rm -f ecdh/$(DEPDIR)/libcrypto_la-ech_lib.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_asn1.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_err.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_lib.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_ossl.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_sign.Plo + -rm -f ecdsa/$(DEPDIR)/libcrypto_la-ecs_vrf.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_all.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_cnf.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_ctrl.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_dyn.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_err.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_fat.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_init.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_lib.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_list.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_openssl.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_pkey.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-eng_table.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_asnmth.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_cipher.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_dh.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_digest.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_dsa.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_ecdh.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_ecdsa.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_eckey.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_pkmeth.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_rand.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_rsa.Plo + -rm -f engine/$(DEPDIR)/libcrypto_la-tb_store.Plo + -rm -f err/$(DEPDIR)/libcrypto_la-err.Plo + -rm -f err/$(DEPDIR)/libcrypto_la-err_all.Plo + -rm -f err/$(DEPDIR)/libcrypto_la-err_prn.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-bio_b64.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-bio_enc.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-bio_md.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-c_all.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-digest.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_aes.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_aes_cbc_hmac_sha1.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_bf.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_camellia.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_cast.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_chacha.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_chacha20poly1305.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_des.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_des3.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_gost2814789.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_idea.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_null.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_old.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_rc2.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_rc4.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_rc4_hmac_md5.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_sm4.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-e_xcbc_d.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-encode.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_aead.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_enc.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_err.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_key.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_lib.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_pbe.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-evp_pkey.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_dss.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_dss1.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_ecdsa.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_gost2814789.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_gostr341194.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_md4.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_md5.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_md5_sha1.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_null.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_ripemd.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_sha1.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_sigver.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_sm3.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_streebog.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-m_wp.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-names.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p5_crpt.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p5_crpt2.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_dec.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_enc.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_lib.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_open.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_seal.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_sign.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-p_verify.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-pmeth_fn.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-pmeth_gn.Plo + -rm -f evp/$(DEPDIR)/libcrypto_la-pmeth_lib.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost2814789.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost89_keywrap.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost89_params.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost89imit_ameth.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost89imit_pmeth.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost_asn1.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gost_err.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341001.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341001_ameth.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341001_key.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341001_params.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341001_pmeth.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-gostr341194.Plo + -rm -f gost/$(DEPDIR)/libcrypto_la-streebog.Plo + -rm -f hkdf/$(DEPDIR)/libcrypto_la-hkdf.Plo + -rm -f hmac/$(DEPDIR)/libcrypto_la-hm_ameth.Plo + -rm -f hmac/$(DEPDIR)/libcrypto_la-hm_pmeth.Plo + -rm -f hmac/$(DEPDIR)/libcrypto_la-hmac.Plo + -rm -f idea/$(DEPDIR)/libcrypto_la-i_cbc.Plo + -rm -f idea/$(DEPDIR)/libcrypto_la-i_cfb64.Plo + -rm -f idea/$(DEPDIR)/libcrypto_la-i_ecb.Plo + -rm -f idea/$(DEPDIR)/libcrypto_la-i_ofb64.Plo + -rm -f idea/$(DEPDIR)/libcrypto_la-i_skey.Plo + -rm -f lhash/$(DEPDIR)/libcrypto_la-lh_stats.Plo + -rm -f lhash/$(DEPDIR)/libcrypto_la-lhash.Plo + -rm -f md4/$(DEPDIR)/libcrypto_la-md4_dgst.Plo + -rm -f md4/$(DEPDIR)/libcrypto_la-md4_one.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5-elf-x86_64.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5-macosx-x86_64.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5-masm-x86_64.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5-mingw64-x86_64.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5_dgst.Plo + -rm -f md5/$(DEPDIR)/libcrypto_la-md5_one.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-cbc128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ccm128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-cfb128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ctr128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-cts128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-gcm128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ghash-elf-armv4.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ghash-elf-x86_64.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ghash-macosx-x86_64.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ghash-masm-x86_64.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ghash-mingw64-x86_64.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-ofb128.Plo + -rm -f modes/$(DEPDIR)/libcrypto_la-xts128.Plo + -rm -f objects/$(DEPDIR)/libcrypto_la-o_names.Plo + -rm -f objects/$(DEPDIR)/libcrypto_la-obj_dat.Plo + -rm -f objects/$(DEPDIR)/libcrypto_la-obj_err.Plo + -rm -f objects/$(DEPDIR)/libcrypto_la-obj_lib.Plo + -rm -f objects/$(DEPDIR)/libcrypto_la-obj_xref.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_asn.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_cl.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_err.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_ext.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_ht.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_lib.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_prn.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_srv.Plo + -rm -f ocsp/$(DEPDIR)/libcrypto_la-ocsp_vfy.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_all.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_err.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_info.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_lib.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_oth.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_pk8.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_pkey.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_seal.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_sign.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_x509.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pem_xaux.Plo + -rm -f pem/$(DEPDIR)/libcrypto_la-pvkfmt.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_add.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_asn.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_attr.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_crpt.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_crt.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_decr.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_init.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_key.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_kiss.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_mutl.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_npas.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_p8d.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_p8e.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-p12_utl.Plo + -rm -f pkcs12/$(DEPDIR)/libcrypto_la-pk12err.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-bio_pk7.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_asn1.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_attr.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_doit.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_lib.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_mime.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pk7_smime.Plo + -rm -f pkcs7/$(DEPDIR)/libcrypto_la-pkcs7err.Plo + -rm -f poly1305/$(DEPDIR)/libcrypto_la-poly1305-donna.Plo + -rm -f poly1305/$(DEPDIR)/libcrypto_la-poly1305.Plo + -rm -f rand/$(DEPDIR)/libcrypto_la-rand_err.Plo + -rm -f rand/$(DEPDIR)/libcrypto_la-rand_lib.Plo + -rm -f rand/$(DEPDIR)/libcrypto_la-randfile.Plo + -rm -f rc2/$(DEPDIR)/libcrypto_la-rc2_cbc.Plo + -rm -f rc2/$(DEPDIR)/libcrypto_la-rc2_ecb.Plo + -rm -f rc2/$(DEPDIR)/libcrypto_la-rc2_skey.Plo + -rm -f rc2/$(DEPDIR)/libcrypto_la-rc2cfb64.Plo + -rm -f rc2/$(DEPDIR)/libcrypto_la-rc2ofb64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-elf-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-macosx-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-masm-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-md5-elf-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-md5-macosx-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-md5-masm-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-md5-mingw64-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4-mingw64-x86_64.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4_enc.Plo + -rm -f rc4/$(DEPDIR)/libcrypto_la-rc4_skey.Plo + -rm -f ripemd/$(DEPDIR)/libcrypto_la-rmd_dgst.Plo + -rm -f ripemd/$(DEPDIR)/libcrypto_la-rmd_one.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_ameth.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_asn1.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_chk.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_crpt.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_depr.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_eay.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_err.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_gen.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_lib.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_meth.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_none.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_oaep.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_pk1.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_pmeth.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_prn.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_pss.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_saos.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_sign.Plo + -rm -f rsa/$(DEPDIR)/libcrypto_la-rsa_x931.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1-elf-armv4.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1-elf-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1-macosx-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1-masm-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1-mingw64-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1_one.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha1dgst.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256-elf-armv4.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256-elf-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256-macosx-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256-masm-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256-mingw64-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha256.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512-elf-armv4.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512-elf-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512-macosx-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512-masm-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512-mingw64-x86_64.Plo + -rm -f sha/$(DEPDIR)/libcrypto_la-sha512.Plo + -rm -f sm3/$(DEPDIR)/libcrypto_la-sm3.Plo + -rm -f sm4/$(DEPDIR)/libcrypto_la-sm4.Plo + -rm -f stack/$(DEPDIR)/libcrypto_la-stack.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_asn1.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_conf.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_err.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_lib.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_req_print.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_req_utils.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_rsp_print.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_rsp_sign.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_rsp_utils.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_rsp_verify.Plo + -rm -f ts/$(DEPDIR)/libcrypto_la-ts_verify_ctx.Plo + -rm -f txt_db/$(DEPDIR)/libcrypto_la-txt_db.Plo + -rm -f ui/$(DEPDIR)/libcrypto_la-ui_err.Plo + -rm -f ui/$(DEPDIR)/libcrypto_la-ui_lib.Plo + -rm -f ui/$(DEPDIR)/libcrypto_la-ui_openssl.Plo + -rm -f ui/$(DEPDIR)/libcrypto_la-ui_openssl_win.Plo + -rm -f ui/$(DEPDIR)/libcrypto_la-ui_util.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp-elf-x86_64.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp-macosx-x86_64.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp-masm-x86_64.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp-mingw64-x86_64.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp_block.Plo + -rm -f whrlpool/$(DEPDIR)/libcrypto_la-wp_dgst.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-by_dir.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-by_file.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-by_mem.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_att.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_cmp.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_d2.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_def.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_err.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_ext.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_lu.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_obj.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_r2x.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_req.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_set.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_trs.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_txt.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_v3.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_vfy.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509_vpm.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509cset.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509name.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509rset.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509spki.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x509type.Plo + -rm -f x509/$(DEPDIR)/libcrypto_la-x_all.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_cache.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_data.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_lib.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_map.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_node.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-pcy_tree.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_akey.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_akeya.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_alt.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_bcons.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_bitst.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_conf.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_cpols.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_crld.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_enum.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_extku.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_genn.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_ia5.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_info.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_int.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_lib.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_ncons.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_ocsp.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_pci.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_pcia.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_pcons.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_pku.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_pmaps.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_prn.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_purp.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_skey.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_sxnet.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3_utl.Plo + -rm -f x509v3/$(DEPDIR)/libcrypto_la-v3err.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -8123,20 +10827,20 @@ uninstall-am: uninstall-libLTLIBRARIES .MAKE: all check install install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-libLTLIBRARIES +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile @@ -8153,7 +10857,6 @@ crypto_portable.sym: @HAVE_ASPRINTF_FALSE@ -echo vasprintf >> crypto_portable.sym @HAVE_EXPLICIT_BZERO_FALSE@ -echo explicit_bzero >> crypto_portable.sym @HAVE_FREEZERO_FALSE@ -echo freezero >> crypto_portable.sym -@HAVE_INET_PTON_FALSE@ -echo inet_pton >> crypto_portable.sym @HAVE_REALLOCARRAY_FALSE@ -echo reallocarray >> crypto_portable.sym @HAVE_RECALLOCARRAY_FALSE@ -echo recallocarray >> crypto_portable.sym @HAVE_STRLCAT_FALSE@ -echo strlcat >> crypto_portable.sym @@ -8176,6 +10879,7 @@ crypto_portable.sym: @HOST_WIN_TRUE@ -echo posix_write >> crypto_portable.sym @HOST_WIN_TRUE@ -echo posix_getsockopt >> crypto_portable.sym @HOST_WIN_TRUE@ -echo posix_setsockopt >> crypto_portable.sym +@HOST_WIN_TRUE@ -echo getuid >> crypto_portable.sym @HOST_WIN_TRUE@ -grep -v BIO_s_log crypto_portable.sym > crypto_portable.sym.tmp @HOST_WIN_TRUE@ -mv crypto_portable.sym.tmp crypto_portable.sym diff --git a/crypto/VERSION b/crypto/VERSION index bcd47822..ee6bcab7 100644 --- a/crypto/VERSION +++ b/crypto/VERSION @@ -1 +1 @@ -42:0:0 +45:4:0 diff --git a/crypto/aes/aes-elf-armv4.S b/crypto/aes/aes-elf-armv4.S new file mode 100644 index 00000000..8164b535 --- /dev/null +++ b/crypto/aes/aes-elf-armv4.S @@ -0,0 +1,1074 @@ +#include "arm_arch.h" +.text +.code 32 + +.type AES_Te,%object +.align 5 +AES_Te: +.word 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d +.word 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554 +.word 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d +.word 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a +.word 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87 +.word 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b +.word 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea +.word 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b +.word 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a +.word 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f +.word 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108 +.word 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f +.word 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e +.word 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5 +.word 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d +.word 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f +.word 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e +.word 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb +.word 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce +.word 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497 +.word 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c +.word 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed +.word 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b +.word 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a +.word 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16 +.word 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594 +.word 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81 +.word 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3 +.word 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a +.word 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504 +.word 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163 +.word 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d +.word 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f +.word 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739 +.word 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47 +.word 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395 +.word 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f +.word 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883 +.word 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c +.word 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76 +.word 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e +.word 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4 +.word 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6 +.word 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b +.word 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7 +.word 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0 +.word 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25 +.word 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818 +.word 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72 +.word 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651 +.word 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21 +.word 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85 +.word 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa +.word 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12 +.word 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0 +.word 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9 +.word 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133 +.word 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7 +.word 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920 +.word 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a +.word 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17 +.word 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8 +.word 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11 +.word 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a +@ Te4[256] +.byte 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5 +.byte 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76 +.byte 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0 +.byte 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0 +.byte 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc +.byte 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15 +.byte 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a +.byte 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75 +.byte 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0 +.byte 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84 +.byte 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b +.byte 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf +.byte 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85 +.byte 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8 +.byte 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5 +.byte 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2 +.byte 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17 +.byte 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73 +.byte 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88 +.byte 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb +.byte 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c +.byte 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79 +.byte 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9 +.byte 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08 +.byte 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6 +.byte 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a +.byte 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e +.byte 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e +.byte 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94 +.byte 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf +.byte 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68 +.byte 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 +@ rcon[] +.word 0x01000000, 0x02000000, 0x04000000, 0x08000000 +.word 0x10000000, 0x20000000, 0x40000000, 0x80000000 +.word 0x1B000000, 0x36000000, 0, 0, 0, 0, 0, 0 +.size AES_Te,.-AES_Te + +@ void AES_encrypt(const unsigned char *in, unsigned char *out, +@ const AES_KEY *key) { +.global AES_encrypt +.type AES_encrypt,%function +.align 5 +AES_encrypt: + sub r3,pc,#8 @ AES_encrypt + stmdb sp!,{r1,r4-r12,lr} + mov r12,r0 @ inp + mov r11,r2 + sub r10,r3,#AES_encrypt-AES_Te @ Te +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r0,[r12,#3] @ load input data in endian-neutral + ldrb r4,[r12,#2] @ manner... + ldrb r5,[r12,#1] + ldrb r6,[r12,#0] + orr r0,r0,r4,lsl#8 + ldrb r1,[r12,#7] + orr r0,r0,r5,lsl#16 + ldrb r4,[r12,#6] + orr r0,r0,r6,lsl#24 + ldrb r5,[r12,#5] + ldrb r6,[r12,#4] + orr r1,r1,r4,lsl#8 + ldrb r2,[r12,#11] + orr r1,r1,r5,lsl#16 + ldrb r4,[r12,#10] + orr r1,r1,r6,lsl#24 + ldrb r5,[r12,#9] + ldrb r6,[r12,#8] + orr r2,r2,r4,lsl#8 + ldrb r3,[r12,#15] + orr r2,r2,r5,lsl#16 + ldrb r4,[r12,#14] + orr r2,r2,r6,lsl#24 + ldrb r5,[r12,#13] + ldrb r6,[r12,#12] + orr r3,r3,r4,lsl#8 + orr r3,r3,r5,lsl#16 + orr r3,r3,r6,lsl#24 +#else + ldr r0,[r12,#0] + ldr r1,[r12,#4] + ldr r2,[r12,#8] + ldr r3,[r12,#12] +#ifdef __ARMEL__ + rev r0,r0 + rev r1,r1 + rev r2,r2 + rev r3,r3 +#endif +#endif + bl _armv4_AES_encrypt + + ldr r12,[sp],#4 @ pop out +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) +#ifdef __ARMEL__ + rev r0,r0 + rev r1,r1 + rev r2,r2 + rev r3,r3 +#endif + str r0,[r12,#0] + str r1,[r12,#4] + str r2,[r12,#8] + str r3,[r12,#12] +#else + mov r4,r0,lsr#24 @ write output in endian-neutral + mov r5,r0,lsr#16 @ manner... + mov r6,r0,lsr#8 + strb r4,[r12,#0] + strb r5,[r12,#1] + mov r4,r1,lsr#24 + strb r6,[r12,#2] + mov r5,r1,lsr#16 + strb r0,[r12,#3] + mov r6,r1,lsr#8 + strb r4,[r12,#4] + strb r5,[r12,#5] + mov r4,r2,lsr#24 + strb r6,[r12,#6] + mov r5,r2,lsr#16 + strb r1,[r12,#7] + mov r6,r2,lsr#8 + strb r4,[r12,#8] + strb r5,[r12,#9] + mov r4,r3,lsr#24 + strb r6,[r12,#10] + mov r5,r3,lsr#16 + strb r2,[r12,#11] + mov r6,r3,lsr#8 + strb r4,[r12,#12] + strb r5,[r12,#13] + strb r6,[r12,#14] + strb r3,[r12,#15] +#endif +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r12,pc} +#else + ldmia sp!,{r4-r12,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.size AES_encrypt,.-AES_encrypt + +.type _armv4_AES_encrypt,%function +.align 2 +_armv4_AES_encrypt: + str lr,[sp,#-4]! @ push lr + ldmia r11!,{r4-r7} + eor r0,r0,r4 + ldr r12,[r11,#240-16] + eor r1,r1,r5 + eor r2,r2,r6 + eor r3,r3,r7 + sub r12,r12,#1 + mov lr,#255 + + and r7,lr,r0 + and r8,lr,r0,lsr#8 + and r9,lr,r0,lsr#16 + mov r0,r0,lsr#24 +.Lenc_loop: + ldr r4,[r10,r7,lsl#2] @ Te3[s0>>0] + and r7,lr,r1,lsr#16 @ i0 + ldr r5,[r10,r8,lsl#2] @ Te2[s0>>8] + and r8,lr,r1 + ldr r6,[r10,r9,lsl#2] @ Te1[s0>>16] + and r9,lr,r1,lsr#8 + ldr r0,[r10,r0,lsl#2] @ Te0[s0>>24] + mov r1,r1,lsr#24 + + ldr r7,[r10,r7,lsl#2] @ Te1[s1>>16] + ldr r8,[r10,r8,lsl#2] @ Te3[s1>>0] + ldr r9,[r10,r9,lsl#2] @ Te2[s1>>8] + eor r0,r0,r7,ror#8 + ldr r1,[r10,r1,lsl#2] @ Te0[s1>>24] + and r7,lr,r2,lsr#8 @ i0 + eor r5,r5,r8,ror#8 + and r8,lr,r2,lsr#16 @ i1 + eor r6,r6,r9,ror#8 + and r9,lr,r2 + ldr r7,[r10,r7,lsl#2] @ Te2[s2>>8] + eor r1,r1,r4,ror#24 + ldr r8,[r10,r8,lsl#2] @ Te1[s2>>16] + mov r2,r2,lsr#24 + + ldr r9,[r10,r9,lsl#2] @ Te3[s2>>0] + eor r0,r0,r7,ror#16 + ldr r2,[r10,r2,lsl#2] @ Te0[s2>>24] + and r7,lr,r3 @ i0 + eor r1,r1,r8,ror#8 + and r8,lr,r3,lsr#8 @ i1 + eor r6,r6,r9,ror#16 + and r9,lr,r3,lsr#16 @ i2 + ldr r7,[r10,r7,lsl#2] @ Te3[s3>>0] + eor r2,r2,r5,ror#16 + ldr r8,[r10,r8,lsl#2] @ Te2[s3>>8] + mov r3,r3,lsr#24 + + ldr r9,[r10,r9,lsl#2] @ Te1[s3>>16] + eor r0,r0,r7,ror#24 + ldr r7,[r11],#16 + eor r1,r1,r8,ror#16 + ldr r3,[r10,r3,lsl#2] @ Te0[s3>>24] + eor r2,r2,r9,ror#8 + ldr r4,[r11,#-12] + eor r3,r3,r6,ror#8 + + ldr r5,[r11,#-8] + eor r0,r0,r7 + ldr r6,[r11,#-4] + and r7,lr,r0 + eor r1,r1,r4 + and r8,lr,r0,lsr#8 + eor r2,r2,r5 + and r9,lr,r0,lsr#16 + eor r3,r3,r6 + mov r0,r0,lsr#24 + + subs r12,r12,#1 + bne .Lenc_loop + + add r10,r10,#2 + + ldrb r4,[r10,r7,lsl#2] @ Te4[s0>>0] + and r7,lr,r1,lsr#16 @ i0 + ldrb r5,[r10,r8,lsl#2] @ Te4[s0>>8] + and r8,lr,r1 + ldrb r6,[r10,r9,lsl#2] @ Te4[s0>>16] + and r9,lr,r1,lsr#8 + ldrb r0,[r10,r0,lsl#2] @ Te4[s0>>24] + mov r1,r1,lsr#24 + + ldrb r7,[r10,r7,lsl#2] @ Te4[s1>>16] + ldrb r8,[r10,r8,lsl#2] @ Te4[s1>>0] + ldrb r9,[r10,r9,lsl#2] @ Te4[s1>>8] + eor r0,r7,r0,lsl#8 + ldrb r1,[r10,r1,lsl#2] @ Te4[s1>>24] + and r7,lr,r2,lsr#8 @ i0 + eor r5,r8,r5,lsl#8 + and r8,lr,r2,lsr#16 @ i1 + eor r6,r9,r6,lsl#8 + and r9,lr,r2 + ldrb r7,[r10,r7,lsl#2] @ Te4[s2>>8] + eor r1,r4,r1,lsl#24 + ldrb r8,[r10,r8,lsl#2] @ Te4[s2>>16] + mov r2,r2,lsr#24 + + ldrb r9,[r10,r9,lsl#2] @ Te4[s2>>0] + eor r0,r7,r0,lsl#8 + ldrb r2,[r10,r2,lsl#2] @ Te4[s2>>24] + and r7,lr,r3 @ i0 + eor r1,r1,r8,lsl#16 + and r8,lr,r3,lsr#8 @ i1 + eor r6,r9,r6,lsl#8 + and r9,lr,r3,lsr#16 @ i2 + ldrb r7,[r10,r7,lsl#2] @ Te4[s3>>0] + eor r2,r5,r2,lsl#24 + ldrb r8,[r10,r8,lsl#2] @ Te4[s3>>8] + mov r3,r3,lsr#24 + + ldrb r9,[r10,r9,lsl#2] @ Te4[s3>>16] + eor r0,r7,r0,lsl#8 + ldr r7,[r11,#0] + ldrb r3,[r10,r3,lsl#2] @ Te4[s3>>24] + eor r1,r1,r8,lsl#8 + ldr r4,[r11,#4] + eor r2,r2,r9,lsl#16 + ldr r5,[r11,#8] + eor r3,r6,r3,lsl#24 + ldr r6,[r11,#12] + + eor r0,r0,r7 + eor r1,r1,r4 + eor r2,r2,r5 + eor r3,r3,r6 + + sub r10,r10,#2 + ldr pc,[sp],#4 @ pop and return +.size _armv4_AES_encrypt,.-_armv4_AES_encrypt + +.global AES_set_encrypt_key +.type AES_set_encrypt_key,%function +.align 5 +AES_set_encrypt_key: +_armv4_AES_set_encrypt_key: + sub r3,pc,#8 @ AES_set_encrypt_key + teq r0,#0 + moveq r0,#-1 + beq .Labrt + teq r2,#0 + moveq r0,#-1 + beq .Labrt + + teq r1,#128 + beq .Lok + teq r1,#192 + beq .Lok + teq r1,#256 + movne r0,#-1 + bne .Labrt + +.Lok: stmdb sp!,{r4-r12,lr} + sub r10,r3,#_armv4_AES_set_encrypt_key-AES_Te-1024 @ Te4 + + mov r12,r0 @ inp + mov lr,r1 @ bits + mov r11,r2 @ key + +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r0,[r12,#3] @ load input data in endian-neutral + ldrb r4,[r12,#2] @ manner... + ldrb r5,[r12,#1] + ldrb r6,[r12,#0] + orr r0,r0,r4,lsl#8 + ldrb r1,[r12,#7] + orr r0,r0,r5,lsl#16 + ldrb r4,[r12,#6] + orr r0,r0,r6,lsl#24 + ldrb r5,[r12,#5] + ldrb r6,[r12,#4] + orr r1,r1,r4,lsl#8 + ldrb r2,[r12,#11] + orr r1,r1,r5,lsl#16 + ldrb r4,[r12,#10] + orr r1,r1,r6,lsl#24 + ldrb r5,[r12,#9] + ldrb r6,[r12,#8] + orr r2,r2,r4,lsl#8 + ldrb r3,[r12,#15] + orr r2,r2,r5,lsl#16 + ldrb r4,[r12,#14] + orr r2,r2,r6,lsl#24 + ldrb r5,[r12,#13] + ldrb r6,[r12,#12] + orr r3,r3,r4,lsl#8 + str r0,[r11],#16 + orr r3,r3,r5,lsl#16 + str r1,[r11,#-12] + orr r3,r3,r6,lsl#24 + str r2,[r11,#-8] + str r3,[r11,#-4] +#else + ldr r0,[r12,#0] + ldr r1,[r12,#4] + ldr r2,[r12,#8] + ldr r3,[r12,#12] +#ifdef __ARMEL__ + rev r0,r0 + rev r1,r1 + rev r2,r2 + rev r3,r3 +#endif + str r0,[r11],#16 + str r1,[r11,#-12] + str r2,[r11,#-8] + str r3,[r11,#-4] +#endif + + teq lr,#128 + bne .Lnot128 + mov r12,#10 + str r12,[r11,#240-16] + add r6,r10,#256 @ rcon + mov lr,#255 + +.L128_loop: + and r5,lr,r3,lsr#24 + and r7,lr,r3,lsr#16 + ldrb r5,[r10,r5] + and r8,lr,r3,lsr#8 + ldrb r7,[r10,r7] + and r9,lr,r3 + ldrb r8,[r10,r8] + orr r5,r5,r7,lsl#24 + ldrb r9,[r10,r9] + orr r5,r5,r8,lsl#16 + ldr r4,[r6],#4 @ rcon[i++] + orr r5,r5,r9,lsl#8 + eor r5,r5,r4 + eor r0,r0,r5 @ rk[4]=rk[0]^... + eor r1,r1,r0 @ rk[5]=rk[1]^rk[4] + str r0,[r11],#16 + eor r2,r2,r1 @ rk[6]=rk[2]^rk[5] + str r1,[r11,#-12] + eor r3,r3,r2 @ rk[7]=rk[3]^rk[6] + str r2,[r11,#-8] + subs r12,r12,#1 + str r3,[r11,#-4] + bne .L128_loop + sub r2,r11,#176 + b .Ldone + +.Lnot128: +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r8,[r12,#19] + ldrb r4,[r12,#18] + ldrb r5,[r12,#17] + ldrb r6,[r12,#16] + orr r8,r8,r4,lsl#8 + ldrb r9,[r12,#23] + orr r8,r8,r5,lsl#16 + ldrb r4,[r12,#22] + orr r8,r8,r6,lsl#24 + ldrb r5,[r12,#21] + ldrb r6,[r12,#20] + orr r9,r9,r4,lsl#8 + orr r9,r9,r5,lsl#16 + str r8,[r11],#8 + orr r9,r9,r6,lsl#24 + str r9,[r11,#-4] +#else + ldr r8,[r12,#16] + ldr r9,[r12,#20] +#ifdef __ARMEL__ + rev r8,r8 + rev r9,r9 +#endif + str r8,[r11],#8 + str r9,[r11,#-4] +#endif + + teq lr,#192 + bne .Lnot192 + mov r12,#12 + str r12,[r11,#240-24] + add r6,r10,#256 @ rcon + mov lr,#255 + mov r12,#8 + +.L192_loop: + and r5,lr,r9,lsr#24 + and r7,lr,r9,lsr#16 + ldrb r5,[r10,r5] + and r8,lr,r9,lsr#8 + ldrb r7,[r10,r7] + and r9,lr,r9 + ldrb r8,[r10,r8] + orr r5,r5,r7,lsl#24 + ldrb r9,[r10,r9] + orr r5,r5,r8,lsl#16 + ldr r4,[r6],#4 @ rcon[i++] + orr r5,r5,r9,lsl#8 + eor r9,r5,r4 + eor r0,r0,r9 @ rk[6]=rk[0]^... + eor r1,r1,r0 @ rk[7]=rk[1]^rk[6] + str r0,[r11],#24 + eor r2,r2,r1 @ rk[8]=rk[2]^rk[7] + str r1,[r11,#-20] + eor r3,r3,r2 @ rk[9]=rk[3]^rk[8] + str r2,[r11,#-16] + subs r12,r12,#1 + str r3,[r11,#-12] + subeq r2,r11,#216 + beq .Ldone + + ldr r7,[r11,#-32] + ldr r8,[r11,#-28] + eor r7,r7,r3 @ rk[10]=rk[4]^rk[9] + eor r9,r8,r7 @ rk[11]=rk[5]^rk[10] + str r7,[r11,#-8] + str r9,[r11,#-4] + b .L192_loop + +.Lnot192: +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r8,[r12,#27] + ldrb r4,[r12,#26] + ldrb r5,[r12,#25] + ldrb r6,[r12,#24] + orr r8,r8,r4,lsl#8 + ldrb r9,[r12,#31] + orr r8,r8,r5,lsl#16 + ldrb r4,[r12,#30] + orr r8,r8,r6,lsl#24 + ldrb r5,[r12,#29] + ldrb r6,[r12,#28] + orr r9,r9,r4,lsl#8 + orr r9,r9,r5,lsl#16 + str r8,[r11],#8 + orr r9,r9,r6,lsl#24 + str r9,[r11,#-4] +#else + ldr r8,[r12,#24] + ldr r9,[r12,#28] +#ifdef __ARMEL__ + rev r8,r8 + rev r9,r9 +#endif + str r8,[r11],#8 + str r9,[r11,#-4] +#endif + + mov r12,#14 + str r12,[r11,#240-32] + add r6,r10,#256 @ rcon + mov lr,#255 + mov r12,#7 + +.L256_loop: + and r5,lr,r9,lsr#24 + and r7,lr,r9,lsr#16 + ldrb r5,[r10,r5] + and r8,lr,r9,lsr#8 + ldrb r7,[r10,r7] + and r9,lr,r9 + ldrb r8,[r10,r8] + orr r5,r5,r7,lsl#24 + ldrb r9,[r10,r9] + orr r5,r5,r8,lsl#16 + ldr r4,[r6],#4 @ rcon[i++] + orr r5,r5,r9,lsl#8 + eor r9,r5,r4 + eor r0,r0,r9 @ rk[8]=rk[0]^... + eor r1,r1,r0 @ rk[9]=rk[1]^rk[8] + str r0,[r11],#32 + eor r2,r2,r1 @ rk[10]=rk[2]^rk[9] + str r1,[r11,#-28] + eor r3,r3,r2 @ rk[11]=rk[3]^rk[10] + str r2,[r11,#-24] + subs r12,r12,#1 + str r3,[r11,#-20] + subeq r2,r11,#256 + beq .Ldone + + and r5,lr,r3 + and r7,lr,r3,lsr#8 + ldrb r5,[r10,r5] + and r8,lr,r3,lsr#16 + ldrb r7,[r10,r7] + and r9,lr,r3,lsr#24 + ldrb r8,[r10,r8] + orr r5,r5,r7,lsl#8 + ldrb r9,[r10,r9] + orr r5,r5,r8,lsl#16 + ldr r4,[r11,#-48] + orr r5,r5,r9,lsl#24 + + ldr r7,[r11,#-44] + ldr r8,[r11,#-40] + eor r4,r4,r5 @ rk[12]=rk[4]^... + ldr r9,[r11,#-36] + eor r7,r7,r4 @ rk[13]=rk[5]^rk[12] + str r4,[r11,#-16] + eor r8,r8,r7 @ rk[14]=rk[6]^rk[13] + str r7,[r11,#-12] + eor r9,r9,r8 @ rk[15]=rk[7]^rk[14] + str r8,[r11,#-8] + str r9,[r11,#-4] + b .L256_loop + +.Ldone: mov r0,#0 + ldmia sp!,{r4-r12,lr} +.Labrt: tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +.size AES_set_encrypt_key,.-AES_set_encrypt_key + +.global AES_set_decrypt_key +.type AES_set_decrypt_key,%function +.align 5 +AES_set_decrypt_key: + str lr,[sp,#-4]! @ push lr + bl _armv4_AES_set_encrypt_key + teq r0,#0 + ldrne lr,[sp],#4 @ pop lr + bne .Labrt + + stmdb sp!,{r4-r12} + + ldr r12,[r2,#240] @ AES_set_encrypt_key preserves r2, + mov r11,r2 @ which is AES_KEY *key + mov r7,r2 + add r8,r2,r12,lsl#4 + +.Linv: ldr r0,[r7] + ldr r1,[r7,#4] + ldr r2,[r7,#8] + ldr r3,[r7,#12] + ldr r4,[r8] + ldr r5,[r8,#4] + ldr r6,[r8,#8] + ldr r9,[r8,#12] + str r0,[r8],#-16 + str r1,[r8,#16+4] + str r2,[r8,#16+8] + str r3,[r8,#16+12] + str r4,[r7],#16 + str r5,[r7,#-12] + str r6,[r7,#-8] + str r9,[r7,#-4] + teq r7,r8 + bne .Linv + ldr r0,[r11,#16]! @ prefetch tp1 + mov r7,#0x80 + mov r8,#0x1b + orr r7,r7,#0x8000 + orr r8,r8,#0x1b00 + orr r7,r7,r7,lsl#16 + orr r8,r8,r8,lsl#16 + sub r12,r12,#1 + mvn r9,r7 + mov r12,r12,lsl#2 @ (rounds-1)*4 + +.Lmix: and r4,r0,r7 + and r1,r0,r9 + sub r4,r4,r4,lsr#7 + and r4,r4,r8 + eor r1,r4,r1,lsl#1 @ tp2 + + and r4,r1,r7 + and r2,r1,r9 + sub r4,r4,r4,lsr#7 + and r4,r4,r8 + eor r2,r4,r2,lsl#1 @ tp4 + + and r4,r2,r7 + and r3,r2,r9 + sub r4,r4,r4,lsr#7 + and r4,r4,r8 + eor r3,r4,r3,lsl#1 @ tp8 + + eor r4,r1,r2 + eor r5,r0,r3 @ tp9 + eor r4,r4,r3 @ tpe + eor r4,r4,r1,ror#24 + eor r4,r4,r5,ror#24 @ ^= ROTATE(tpb=tp9^tp2,8) + eor r4,r4,r2,ror#16 + eor r4,r4,r5,ror#16 @ ^= ROTATE(tpd=tp9^tp4,16) + eor r4,r4,r5,ror#8 @ ^= ROTATE(tp9,24) + + ldr r0,[r11,#4] @ prefetch tp1 + str r4,[r11],#4 + subs r12,r12,#1 + bne .Lmix + + mov r0,#0 +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r12,pc} +#else + ldmia sp!,{r4-r12,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.size AES_set_decrypt_key,.-AES_set_decrypt_key + +.type AES_Td,%object +.align 5 +AES_Td: +.word 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96 +.word 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393 +.word 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25 +.word 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f +.word 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1 +.word 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6 +.word 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da +.word 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844 +.word 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd +.word 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4 +.word 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45 +.word 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94 +.word 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7 +.word 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a +.word 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5 +.word 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c +.word 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1 +.word 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a +.word 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75 +.word 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051 +.word 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46 +.word 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff +.word 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77 +.word 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb +.word 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000 +.word 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e +.word 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927 +.word 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a +.word 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e +.word 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16 +.word 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d +.word 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8 +.word 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd +.word 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34 +.word 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163 +.word 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120 +.word 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d +.word 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0 +.word 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422 +.word 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef +.word 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36 +.word 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4 +.word 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662 +.word 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5 +.word 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3 +.word 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b +.word 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8 +.word 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6 +.word 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6 +.word 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0 +.word 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815 +.word 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f +.word 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df +.word 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f +.word 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e +.word 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713 +.word 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89 +.word 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c +.word 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf +.word 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86 +.word 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f +.word 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541 +.word 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190 +.word 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742 +@ Td4[256] +.byte 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38 +.byte 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb +.byte 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87 +.byte 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb +.byte 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d +.byte 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e +.byte 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2 +.byte 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25 +.byte 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16 +.byte 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92 +.byte 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda +.byte 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84 +.byte 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a +.byte 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06 +.byte 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02 +.byte 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b +.byte 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea +.byte 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73 +.byte 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85 +.byte 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e +.byte 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89 +.byte 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b +.byte 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20 +.byte 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4 +.byte 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31 +.byte 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f +.byte 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d +.byte 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef +.byte 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0 +.byte 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61 +.byte 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26 +.byte 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d +.size AES_Td,.-AES_Td + +@ void AES_decrypt(const unsigned char *in, unsigned char *out, +@ const AES_KEY *key) { +.global AES_decrypt +.type AES_decrypt,%function +.align 5 +AES_decrypt: + sub r3,pc,#8 @ AES_decrypt + stmdb sp!,{r1,r4-r12,lr} + mov r12,r0 @ inp + mov r11,r2 + sub r10,r3,#AES_decrypt-AES_Td @ Td +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r0,[r12,#3] @ load input data in endian-neutral + ldrb r4,[r12,#2] @ manner... + ldrb r5,[r12,#1] + ldrb r6,[r12,#0] + orr r0,r0,r4,lsl#8 + ldrb r1,[r12,#7] + orr r0,r0,r5,lsl#16 + ldrb r4,[r12,#6] + orr r0,r0,r6,lsl#24 + ldrb r5,[r12,#5] + ldrb r6,[r12,#4] + orr r1,r1,r4,lsl#8 + ldrb r2,[r12,#11] + orr r1,r1,r5,lsl#16 + ldrb r4,[r12,#10] + orr r1,r1,r6,lsl#24 + ldrb r5,[r12,#9] + ldrb r6,[r12,#8] + orr r2,r2,r4,lsl#8 + ldrb r3,[r12,#15] + orr r2,r2,r5,lsl#16 + ldrb r4,[r12,#14] + orr r2,r2,r6,lsl#24 + ldrb r5,[r12,#13] + ldrb r6,[r12,#12] + orr r3,r3,r4,lsl#8 + orr r3,r3,r5,lsl#16 + orr r3,r3,r6,lsl#24 +#else + ldr r0,[r12,#0] + ldr r1,[r12,#4] + ldr r2,[r12,#8] + ldr r3,[r12,#12] +#ifdef __ARMEL__ + rev r0,r0 + rev r1,r1 + rev r2,r2 + rev r3,r3 +#endif +#endif + bl _armv4_AES_decrypt + + ldr r12,[sp],#4 @ pop out +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) +#ifdef __ARMEL__ + rev r0,r0 + rev r1,r1 + rev r2,r2 + rev r3,r3 +#endif + str r0,[r12,#0] + str r1,[r12,#4] + str r2,[r12,#8] + str r3,[r12,#12] +#else + mov r4,r0,lsr#24 @ write output in endian-neutral + mov r5,r0,lsr#16 @ manner... + mov r6,r0,lsr#8 + strb r4,[r12,#0] + strb r5,[r12,#1] + mov r4,r1,lsr#24 + strb r6,[r12,#2] + mov r5,r1,lsr#16 + strb r0,[r12,#3] + mov r6,r1,lsr#8 + strb r4,[r12,#4] + strb r5,[r12,#5] + mov r4,r2,lsr#24 + strb r6,[r12,#6] + mov r5,r2,lsr#16 + strb r1,[r12,#7] + mov r6,r2,lsr#8 + strb r4,[r12,#8] + strb r5,[r12,#9] + mov r4,r3,lsr#24 + strb r6,[r12,#10] + mov r5,r3,lsr#16 + strb r2,[r12,#11] + mov r6,r3,lsr#8 + strb r4,[r12,#12] + strb r5,[r12,#13] + strb r6,[r12,#14] + strb r3,[r12,#15] +#endif +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r12,pc} +#else + ldmia sp!,{r4-r12,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.size AES_decrypt,.-AES_decrypt + +.type _armv4_AES_decrypt,%function +.align 2 +_armv4_AES_decrypt: + str lr,[sp,#-4]! @ push lr + ldmia r11!,{r4-r7} + eor r0,r0,r4 + ldr r12,[r11,#240-16] + eor r1,r1,r5 + eor r2,r2,r6 + eor r3,r3,r7 + sub r12,r12,#1 + mov lr,#255 + + and r7,lr,r0,lsr#16 + and r8,lr,r0,lsr#8 + and r9,lr,r0 + mov r0,r0,lsr#24 +.Ldec_loop: + ldr r4,[r10,r7,lsl#2] @ Td1[s0>>16] + and r7,lr,r1 @ i0 + ldr r5,[r10,r8,lsl#2] @ Td2[s0>>8] + and r8,lr,r1,lsr#16 + ldr r6,[r10,r9,lsl#2] @ Td3[s0>>0] + and r9,lr,r1,lsr#8 + ldr r0,[r10,r0,lsl#2] @ Td0[s0>>24] + mov r1,r1,lsr#24 + + ldr r7,[r10,r7,lsl#2] @ Td3[s1>>0] + ldr r8,[r10,r8,lsl#2] @ Td1[s1>>16] + ldr r9,[r10,r9,lsl#2] @ Td2[s1>>8] + eor r0,r0,r7,ror#24 + ldr r1,[r10,r1,lsl#2] @ Td0[s1>>24] + and r7,lr,r2,lsr#8 @ i0 + eor r5,r8,r5,ror#8 + and r8,lr,r2 @ i1 + eor r6,r9,r6,ror#8 + and r9,lr,r2,lsr#16 + ldr r7,[r10,r7,lsl#2] @ Td2[s2>>8] + eor r1,r1,r4,ror#8 + ldr r8,[r10,r8,lsl#2] @ Td3[s2>>0] + mov r2,r2,lsr#24 + + ldr r9,[r10,r9,lsl#2] @ Td1[s2>>16] + eor r0,r0,r7,ror#16 + ldr r2,[r10,r2,lsl#2] @ Td0[s2>>24] + and r7,lr,r3,lsr#16 @ i0 + eor r1,r1,r8,ror#24 + and r8,lr,r3,lsr#8 @ i1 + eor r6,r9,r6,ror#8 + and r9,lr,r3 @ i2 + ldr r7,[r10,r7,lsl#2] @ Td1[s3>>16] + eor r2,r2,r5,ror#8 + ldr r8,[r10,r8,lsl#2] @ Td2[s3>>8] + mov r3,r3,lsr#24 + + ldr r9,[r10,r9,lsl#2] @ Td3[s3>>0] + eor r0,r0,r7,ror#8 + ldr r7,[r11],#16 + eor r1,r1,r8,ror#16 + ldr r3,[r10,r3,lsl#2] @ Td0[s3>>24] + eor r2,r2,r9,ror#24 + + ldr r4,[r11,#-12] + eor r0,r0,r7 + ldr r5,[r11,#-8] + eor r3,r3,r6,ror#8 + ldr r6,[r11,#-4] + and r7,lr,r0,lsr#16 + eor r1,r1,r4 + and r8,lr,r0,lsr#8 + eor r2,r2,r5 + and r9,lr,r0 + eor r3,r3,r6 + mov r0,r0,lsr#24 + + subs r12,r12,#1 + bne .Ldec_loop + + add r10,r10,#1024 + + ldr r5,[r10,#0] @ prefetch Td4 + ldr r6,[r10,#32] + ldr r4,[r10,#64] + ldr r5,[r10,#96] + ldr r6,[r10,#128] + ldr r4,[r10,#160] + ldr r5,[r10,#192] + ldr r6,[r10,#224] + + ldrb r0,[r10,r0] @ Td4[s0>>24] + ldrb r4,[r10,r7] @ Td4[s0>>16] + and r7,lr,r1 @ i0 + ldrb r5,[r10,r8] @ Td4[s0>>8] + and r8,lr,r1,lsr#16 + ldrb r6,[r10,r9] @ Td4[s0>>0] + and r9,lr,r1,lsr#8 + + ldrb r7,[r10,r7] @ Td4[s1>>0] + ldrb r1,[r10,r1,lsr#24] @ Td4[s1>>24] + ldrb r8,[r10,r8] @ Td4[s1>>16] + eor r0,r7,r0,lsl#24 + ldrb r9,[r10,r9] @ Td4[s1>>8] + eor r1,r4,r1,lsl#8 + and r7,lr,r2,lsr#8 @ i0 + eor r5,r5,r8,lsl#8 + and r8,lr,r2 @ i1 + ldrb r7,[r10,r7] @ Td4[s2>>8] + eor r6,r6,r9,lsl#8 + ldrb r8,[r10,r8] @ Td4[s2>>0] + and r9,lr,r2,lsr#16 + + ldrb r2,[r10,r2,lsr#24] @ Td4[s2>>24] + eor r0,r0,r7,lsl#8 + ldrb r9,[r10,r9] @ Td4[s2>>16] + eor r1,r8,r1,lsl#16 + and r7,lr,r3,lsr#16 @ i0 + eor r2,r5,r2,lsl#16 + and r8,lr,r3,lsr#8 @ i1 + ldrb r7,[r10,r7] @ Td4[s3>>16] + eor r6,r6,r9,lsl#16 + ldrb r8,[r10,r8] @ Td4[s3>>8] + and r9,lr,r3 @ i2 + + ldrb r9,[r10,r9] @ Td4[s3>>0] + ldrb r3,[r10,r3,lsr#24] @ Td4[s3>>24] + eor r0,r0,r7,lsl#16 + ldr r7,[r11,#0] + eor r1,r1,r8,lsl#8 + ldr r4,[r11,#4] + eor r2,r9,r2,lsl#8 + ldr r5,[r11,#8] + eor r3,r6,r3,lsl#24 + ldr r6,[r11,#12] + + eor r0,r0,r7 + eor r1,r1,r4 + eor r2,r2,r5 + eor r3,r3,r6 + + sub r10,r10,#1024 + ldr pc,[sp],#4 @ pop and return +.size _armv4_AES_decrypt,.-_armv4_AES_decrypt +.asciz "AES for ARMv4, CRYPTOGAMS by " +.align 2 +#if defined(HAVE_GNU_STACK) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/crypto/aes/aes-elf-x86_64.S b/crypto/aes/aes-elf-x86_64.S index abc90059..83c0053a 100644 --- a/crypto/aes/aes-elf-x86_64.S +++ b/crypto/aes/aes-elf-x86_64.S @@ -152,7 +152,7 @@ _x86_64_AES_encrypt: xorl %r11d,%ebx xorl %r12d,%ecx xorl %r8d,%edx -.byte 0xf3,0xc3 + retq .size _x86_64_AES_encrypt,.-_x86_64_AES_encrypt .type _x86_64_AES_encrypt_compact,@function .align 16 @@ -327,7 +327,7 @@ _x86_64_AES_encrypt_compact: xorl 4(%r15),%ebx xorl 8(%r15),%ecx xorl 12(%r15),%edx -.byte 0xf3,0xc3 + retq .size _x86_64_AES_encrypt_compact,.-_x86_64_AES_encrypt_compact .globl AES_encrypt .type AES_encrypt,@function @@ -394,7 +394,7 @@ AES_encrypt: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lenc_epilogue: - .byte 0xf3,0xc3 + retq .size AES_encrypt,.-AES_encrypt .type _x86_64_AES_decrypt,@function .align 16 @@ -549,7 +549,7 @@ _x86_64_AES_decrypt: xorl %r11d,%ebx xorl %r12d,%ecx xorl %r8d,%edx -.byte 0xf3,0xc3 + retq .size _x86_64_AES_decrypt,.-_x86_64_AES_decrypt .type _x86_64_AES_decrypt_compact,@function .align 16 @@ -775,7 +775,7 @@ _x86_64_AES_decrypt_compact: xorl 4(%r15),%ebx xorl 8(%r15),%ecx xorl 12(%r15),%edx -.byte 0xf3,0xc3 + retq .size _x86_64_AES_decrypt_compact,.-_x86_64_AES_decrypt_compact .globl AES_decrypt .type AES_decrypt,@function @@ -844,7 +844,7 @@ AES_decrypt: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Ldec_epilogue: - .byte 0xf3,0xc3 + retq .size AES_decrypt,.-AES_decrypt .globl AES_set_encrypt_key .type AES_set_encrypt_key,@function @@ -869,7 +869,7 @@ AES_set_encrypt_key: movq 48(%rsp),%rbx addq $56,%rsp .Lenc_key_epilogue: - .byte 0xf3,0xc3 + retq .size AES_set_encrypt_key,.-AES_set_encrypt_key .type _x86_64_AES_set_encrypt_key,@function @@ -1109,7 +1109,7 @@ _x86_64_AES_set_encrypt_key: .Lbadpointer: movq $-1,%rax .Lexit: -.byte 0xf3,0xc3 + retq .size _x86_64_AES_set_encrypt_key,.-_x86_64_AES_set_encrypt_key .globl AES_set_decrypt_key .type AES_set_decrypt_key,@function @@ -1296,7 +1296,7 @@ AES_set_decrypt_key: movq 48(%rsp),%rbx addq $56,%rsp .Ldec_key_epilogue: - .byte 0xf3,0xc3 + retq .size AES_set_decrypt_key,.-AES_set_decrypt_key .globl AES_cbc_encrypt .type AES_cbc_encrypt,@function @@ -1754,7 +1754,7 @@ AES_cbc_encrypt: .Lcbc_popfq: popfq .Lcbc_epilogue: - .byte 0xf3,0xc3 + retq .size AES_cbc_encrypt,.-AES_cbc_encrypt .align 64 .LAES_Te: diff --git a/crypto/aes/aes-macosx-x86_64.S b/crypto/aes/aes-macosx-x86_64.S index 9d8b1f13..8a9c36eb 100644 --- a/crypto/aes/aes-macosx-x86_64.S +++ b/crypto/aes/aes-macosx-x86_64.S @@ -152,7 +152,7 @@ L$enc_loop: xorl %r11d,%ebx xorl %r12d,%ecx xorl %r8d,%edx -.byte 0xf3,0xc3 + retq .p2align 4 @@ -327,7 +327,7 @@ L$enc_compact_done: xorl 4(%r15),%ebx xorl 8(%r15),%ecx xorl 12(%r15),%edx -.byte 0xf3,0xc3 + retq .globl _AES_encrypt @@ -394,7 +394,7 @@ L$enc_prologue: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$enc_epilogue: - .byte 0xf3,0xc3 + retq .p2align 4 @@ -549,7 +549,7 @@ L$dec_loop: xorl %r11d,%ebx xorl %r12d,%ecx xorl %r8d,%edx -.byte 0xf3,0xc3 + retq .p2align 4 @@ -775,7 +775,7 @@ L$dec_compact_done: xorl 4(%r15),%ebx xorl 8(%r15),%ecx xorl 12(%r15),%edx -.byte 0xf3,0xc3 + retq .globl _AES_decrypt @@ -844,7 +844,7 @@ L$dec_prologue: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$dec_epilogue: - .byte 0xf3,0xc3 + retq .globl _AES_set_encrypt_key @@ -869,7 +869,7 @@ L$enc_key_prologue: movq 48(%rsp),%rbx addq $56,%rsp L$enc_key_epilogue: - .byte 0xf3,0xc3 + retq @@ -1109,7 +1109,7 @@ L$14break: L$badpointer: movq $-1,%rax L$exit: -.byte 0xf3,0xc3 + retq .globl _AES_set_decrypt_key @@ -1296,7 +1296,7 @@ L$abort: movq 48(%rsp),%rbx addq $56,%rsp L$dec_key_epilogue: - .byte 0xf3,0xc3 + retq .globl _AES_cbc_encrypt @@ -1754,7 +1754,7 @@ L$cbc_exit: L$cbc_popfq: popfq L$cbc_epilogue: - .byte 0xf3,0xc3 + retq .p2align 6 L$AES_Te: diff --git a/crypto/aes/aes-masm-x86_64.S b/crypto/aes/aes-masm-x86_64.S new file mode 100644 index 00000000..d191af10 --- /dev/null +++ b/crypto/aes/aes-masm-x86_64.S @@ -0,0 +1,2880 @@ +OPTION DOTNAME +#include "x86_arch.h" + +.text$ SEGMENT ALIGN(64) 'CODE' + +ALIGN 16 +_x86_64_AES_encrypt PROC PRIVATE + xor eax,DWORD PTR[r15] + xor ebx,DWORD PTR[4+r15] + xor ecx,DWORD PTR[8+r15] + xor edx,DWORD PTR[12+r15] + + mov r13d,DWORD PTR[240+r15] + sub r13d,1 + jmp $L$enc_loop +ALIGN 16 +$L$enc_loop:: + + movzx esi,al + movzx edi,bl + movzx ebp,cl + mov r10d,DWORD PTR[rsi*8+r14] + mov r11d,DWORD PTR[rdi*8+r14] + mov r12d,DWORD PTR[rbp*8+r14] + + movzx esi,bh + movzx edi,ch + movzx ebp,dl + xor r10d,DWORD PTR[3+rsi*8+r14] + xor r11d,DWORD PTR[3+rdi*8+r14] + mov r8d,DWORD PTR[rbp*8+r14] + + movzx esi,dh + shr ecx,16 + movzx ebp,ah + xor r12d,DWORD PTR[3+rsi*8+r14] + shr edx,16 + xor r8d,DWORD PTR[3+rbp*8+r14] + + shr ebx,16 + lea r15,QWORD PTR[16+r15] + shr eax,16 + + movzx esi,cl + movzx edi,dl + movzx ebp,al + xor r10d,DWORD PTR[2+rsi*8+r14] + xor r11d,DWORD PTR[2+rdi*8+r14] + xor r12d,DWORD PTR[2+rbp*8+r14] + + movzx esi,dh + movzx edi,ah + movzx ebp,bl + xor r10d,DWORD PTR[1+rsi*8+r14] + xor r11d,DWORD PTR[1+rdi*8+r14] + xor r8d,DWORD PTR[2+rbp*8+r14] + + mov edx,DWORD PTR[12+r15] + movzx edi,bh + movzx ebp,ch + mov eax,DWORD PTR[r15] + xor r12d,DWORD PTR[1+rdi*8+r14] + xor r8d,DWORD PTR[1+rbp*8+r14] + + mov ebx,DWORD PTR[4+r15] + mov ecx,DWORD PTR[8+r15] + xor eax,r10d + xor ebx,r11d + xor ecx,r12d + xor edx,r8d + sub r13d,1 + jnz $L$enc_loop + movzx esi,al + movzx edi,bl + movzx ebp,cl + movzx r10d,BYTE PTR[2+rsi*8+r14] + movzx r11d,BYTE PTR[2+rdi*8+r14] + movzx r12d,BYTE PTR[2+rbp*8+r14] + + movzx esi,dl + movzx edi,bh + movzx ebp,ch + movzx r8d,BYTE PTR[2+rsi*8+r14] + mov edi,DWORD PTR[rdi*8+r14] + mov ebp,DWORD PTR[rbp*8+r14] + + and edi,00000ff00h + and ebp,00000ff00h + + xor r10d,edi + xor r11d,ebp + shr ecx,16 + + movzx esi,dh + movzx edi,ah + shr edx,16 + mov esi,DWORD PTR[rsi*8+r14] + mov edi,DWORD PTR[rdi*8+r14] + + and esi,00000ff00h + and edi,00000ff00h + shr ebx,16 + xor r12d,esi + xor r8d,edi + shr eax,16 + + movzx esi,cl + movzx edi,dl + movzx ebp,al + mov esi,DWORD PTR[rsi*8+r14] + mov edi,DWORD PTR[rdi*8+r14] + mov ebp,DWORD PTR[rbp*8+r14] + + and esi,000ff0000h + and edi,000ff0000h + and ebp,000ff0000h + + xor r10d,esi + xor r11d,edi + xor r12d,ebp + + movzx esi,bl + movzx edi,dh + movzx ebp,ah + mov esi,DWORD PTR[rsi*8+r14] + mov edi,DWORD PTR[2+rdi*8+r14] + mov ebp,DWORD PTR[2+rbp*8+r14] + + and esi,000ff0000h + and edi,0ff000000h + and ebp,0ff000000h + + xor r8d,esi + xor r10d,edi + xor r11d,ebp + + movzx esi,bh + movzx edi,ch + mov edx,DWORD PTR[((16+12))+r15] + mov esi,DWORD PTR[2+rsi*8+r14] + mov edi,DWORD PTR[2+rdi*8+r14] + mov eax,DWORD PTR[((16+0))+r15] + + and esi,0ff000000h + and edi,0ff000000h + + xor r12d,esi + xor r8d,edi + + mov ebx,DWORD PTR[((16+4))+r15] + mov ecx,DWORD PTR[((16+8))+r15] + xor eax,r10d + xor ebx,r11d + xor ecx,r12d + xor edx,r8d + DB 0F3h,0C3h ;repret +_x86_64_AES_encrypt ENDP + +ALIGN 16 +_x86_64_AES_encrypt_compact PROC PRIVATE + lea r8,QWORD PTR[128+r14] + mov edi,DWORD PTR[((0-128))+r8] + mov ebp,DWORD PTR[((32-128))+r8] + mov r10d,DWORD PTR[((64-128))+r8] + mov r11d,DWORD PTR[((96-128))+r8] + mov edi,DWORD PTR[((128-128))+r8] + mov ebp,DWORD PTR[((160-128))+r8] + mov r10d,DWORD PTR[((192-128))+r8] + mov r11d,DWORD PTR[((224-128))+r8] + jmp $L$enc_loop_compact +ALIGN 16 +$L$enc_loop_compact:: + xor eax,DWORD PTR[r15] + xor ebx,DWORD PTR[4+r15] + xor ecx,DWORD PTR[8+r15] + xor edx,DWORD PTR[12+r15] + lea r15,QWORD PTR[16+r15] + movzx r10d,al + movzx r11d,bl + movzx r12d,cl + movzx r10d,BYTE PTR[r10*1+r14] + movzx r11d,BYTE PTR[r11*1+r14] + movzx r12d,BYTE PTR[r12*1+r14] + + movzx r8d,dl + movzx esi,bh + movzx edi,ch + movzx r8d,BYTE PTR[r8*1+r14] + movzx r9d,BYTE PTR[rsi*1+r14] + movzx r13d,BYTE PTR[rdi*1+r14] + + movzx ebp,dh + movzx esi,ah + shr ecx,16 + movzx ebp,BYTE PTR[rbp*1+r14] + movzx esi,BYTE PTR[rsi*1+r14] + shr edx,16 + + movzx edi,cl + shl r9d,8 + shl r13d,8 + movzx edi,BYTE PTR[rdi*1+r14] + xor r10d,r9d + xor r11d,r13d + + movzx r9d,dl + shr eax,16 + shr ebx,16 + movzx r13d,al + shl ebp,8 + shl esi,8 + movzx r9d,BYTE PTR[r9*1+r14] + movzx r13d,BYTE PTR[r13*1+r14] + xor r12d,ebp + xor r8d,esi + + movzx ebp,bl + movzx esi,dh + shl edi,16 + movzx ebp,BYTE PTR[rbp*1+r14] + movzx esi,BYTE PTR[rsi*1+r14] + xor r10d,edi + + movzx edi,ah + shr ecx,8 + shr ebx,8 + movzx edi,BYTE PTR[rdi*1+r14] + movzx edx,BYTE PTR[rcx*1+r14] + movzx ecx,BYTE PTR[rbx*1+r14] + shl r9d,16 + shl r13d,16 + shl ebp,16 + xor r11d,r9d + xor r12d,r13d + xor r8d,ebp + + shl esi,24 + shl edi,24 + shl edx,24 + xor r10d,esi + shl ecx,24 + xor r11d,edi + mov eax,r10d + mov ebx,r11d + xor ecx,r12d + xor edx,r8d + cmp r15,QWORD PTR[16+rsp] + je $L$enc_compact_done + mov esi,eax + mov edi,ebx + and esi,080808080h + and edi,080808080h + mov r10d,esi + mov r11d,edi + shr r10d,7 + lea r8d,DWORD PTR[rax*1+rax] + shr r11d,7 + lea r9d,DWORD PTR[rbx*1+rbx] + sub esi,r10d + sub edi,r11d + and r8d,0fefefefeh + and r9d,0fefefefeh + and esi,01b1b1b1bh + and edi,01b1b1b1bh + mov r10d,eax + mov r11d,ebx + xor r8d,esi + xor r9d,edi + + xor eax,r8d + xor ebx,r9d + mov esi,ecx + mov edi,edx + rol eax,24 + rol ebx,24 + and esi,080808080h + and edi,080808080h + xor eax,r8d + xor ebx,r9d + mov r12d,esi + mov ebp,edi + ror r10d,16 + ror r11d,16 + shr r12d,7 + lea r8d,DWORD PTR[rcx*1+rcx] + xor eax,r10d + xor ebx,r11d + shr ebp,7 + lea r9d,DWORD PTR[rdx*1+rdx] + ror r10d,8 + ror r11d,8 + sub esi,r12d + sub edi,ebp + xor eax,r10d + xor ebx,r11d + + and r8d,0fefefefeh + and r9d,0fefefefeh + and esi,01b1b1b1bh + and edi,01b1b1b1bh + mov r12d,ecx + mov ebp,edx + xor r8d,esi + xor r9d,edi + + xor ecx,r8d + xor edx,r9d + rol ecx,24 + rol edx,24 + xor ecx,r8d + xor edx,r9d + mov esi,DWORD PTR[r14] + ror r12d,16 + ror ebp,16 + mov edi,DWORD PTR[64+r14] + xor ecx,r12d + xor edx,ebp + mov r8d,DWORD PTR[128+r14] + ror r12d,8 + ror ebp,8 + mov r9d,DWORD PTR[192+r14] + xor ecx,r12d + xor edx,ebp + jmp $L$enc_loop_compact +ALIGN 16 +$L$enc_compact_done:: + xor eax,DWORD PTR[r15] + xor ebx,DWORD PTR[4+r15] + xor ecx,DWORD PTR[8+r15] + xor edx,DWORD PTR[12+r15] + DB 0F3h,0C3h ;repret +_x86_64_AES_encrypt_compact ENDP +PUBLIC AES_encrypt + +ALIGN 16 +PUBLIC asm_AES_encrypt + +asm_AES_encrypt:: +AES_encrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_AES_encrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + + + mov r10,rsp + lea rcx,QWORD PTR[((-63))+rdx] + and rsp,-64 + sub rcx,rsp + neg rcx + and rcx,03c0h + sub rsp,rcx + sub rsp,32 + + mov QWORD PTR[16+rsp],rsi + mov QWORD PTR[24+rsp],r10 +$L$enc_prologue:: + + mov r15,rdx + mov r13d,DWORD PTR[240+r15] + + mov eax,DWORD PTR[rdi] + mov ebx,DWORD PTR[4+rdi] + mov ecx,DWORD PTR[8+rdi] + mov edx,DWORD PTR[12+rdi] + + shl r13d,4 + lea rbp,QWORD PTR[r13*1+r15] + mov QWORD PTR[rsp],r15 + mov QWORD PTR[8+rsp],rbp + + + lea r14,QWORD PTR[(($L$AES_Te+2048))] + lea rbp,QWORD PTR[768+rsp] + sub rbp,r14 + and rbp,0300h + lea r14,QWORD PTR[rbp*1+r14] + + call _x86_64_AES_encrypt_compact + + mov r9,QWORD PTR[16+rsp] + mov rsi,QWORD PTR[24+rsp] + mov DWORD PTR[r9],eax + mov DWORD PTR[4+r9],ebx + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$enc_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_AES_encrypt:: +AES_encrypt ENDP + +ALIGN 16 +_x86_64_AES_decrypt PROC PRIVATE + xor eax,DWORD PTR[r15] + xor ebx,DWORD PTR[4+r15] + xor ecx,DWORD PTR[8+r15] + xor edx,DWORD PTR[12+r15] + + mov r13d,DWORD PTR[240+r15] + sub r13d,1 + jmp $L$dec_loop +ALIGN 16 +$L$dec_loop:: + + movzx esi,al + movzx edi,bl + movzx ebp,cl + mov r10d,DWORD PTR[rsi*8+r14] + mov r11d,DWORD PTR[rdi*8+r14] + mov r12d,DWORD PTR[rbp*8+r14] + + movzx esi,dh + movzx edi,ah + movzx ebp,dl + xor r10d,DWORD PTR[3+rsi*8+r14] + xor r11d,DWORD PTR[3+rdi*8+r14] + mov r8d,DWORD PTR[rbp*8+r14] + + movzx esi,bh + shr eax,16 + movzx ebp,ch + xor r12d,DWORD PTR[3+rsi*8+r14] + shr edx,16 + xor r8d,DWORD PTR[3+rbp*8+r14] + + shr ebx,16 + lea r15,QWORD PTR[16+r15] + shr ecx,16 + + movzx esi,cl + movzx edi,dl + movzx ebp,al + xor r10d,DWORD PTR[2+rsi*8+r14] + xor r11d,DWORD PTR[2+rdi*8+r14] + xor r12d,DWORD PTR[2+rbp*8+r14] + + movzx esi,bh + movzx edi,ch + movzx ebp,bl + xor r10d,DWORD PTR[1+rsi*8+r14] + xor r11d,DWORD PTR[1+rdi*8+r14] + xor r8d,DWORD PTR[2+rbp*8+r14] + + movzx esi,dh + mov edx,DWORD PTR[12+r15] + movzx ebp,ah + xor r12d,DWORD PTR[1+rsi*8+r14] + mov eax,DWORD PTR[r15] + xor r8d,DWORD PTR[1+rbp*8+r14] + + xor eax,r10d + mov ebx,DWORD PTR[4+r15] + mov ecx,DWORD PTR[8+r15] + xor ecx,r12d + xor ebx,r11d + xor edx,r8d + sub r13d,1 + jnz $L$dec_loop + lea r14,QWORD PTR[2048+r14] + movzx esi,al + movzx edi,bl + movzx ebp,cl + movzx r10d,BYTE PTR[rsi*1+r14] + movzx r11d,BYTE PTR[rdi*1+r14] + movzx r12d,BYTE PTR[rbp*1+r14] + + movzx esi,dl + movzx edi,dh + movzx ebp,ah + movzx r8d,BYTE PTR[rsi*1+r14] + movzx edi,BYTE PTR[rdi*1+r14] + movzx ebp,BYTE PTR[rbp*1+r14] + + shl edi,8 + shl ebp,8 + + xor r10d,edi + xor r11d,ebp + shr edx,16 + + movzx esi,bh + movzx edi,ch + shr eax,16 + movzx esi,BYTE PTR[rsi*1+r14] + movzx edi,BYTE PTR[rdi*1+r14] + + shl esi,8 + shl edi,8 + shr ebx,16 + xor r12d,esi + xor r8d,edi + shr ecx,16 + + movzx esi,cl + movzx edi,dl + movzx ebp,al + movzx esi,BYTE PTR[rsi*1+r14] + movzx edi,BYTE PTR[rdi*1+r14] + movzx ebp,BYTE PTR[rbp*1+r14] + + shl esi,16 + shl edi,16 + shl ebp,16 + + xor r10d,esi + xor r11d,edi + xor r12d,ebp + + movzx esi,bl + movzx edi,bh + movzx ebp,ch + movzx esi,BYTE PTR[rsi*1+r14] + movzx edi,BYTE PTR[rdi*1+r14] + movzx ebp,BYTE PTR[rbp*1+r14] + + shl esi,16 + shl edi,24 + shl ebp,24 + + xor r8d,esi + xor r10d,edi + xor r11d,ebp + + movzx esi,dh + movzx edi,ah + mov edx,DWORD PTR[((16+12))+r15] + movzx esi,BYTE PTR[rsi*1+r14] + movzx edi,BYTE PTR[rdi*1+r14] + mov eax,DWORD PTR[((16+0))+r15] + + shl esi,24 + shl edi,24 + + xor r12d,esi + xor r8d,edi + + mov ebx,DWORD PTR[((16+4))+r15] + mov ecx,DWORD PTR[((16+8))+r15] + lea r14,QWORD PTR[((-2048))+r14] + xor eax,r10d + xor ebx,r11d + xor ecx,r12d + xor edx,r8d + DB 0F3h,0C3h ;repret +_x86_64_AES_decrypt ENDP + +ALIGN 16 +_x86_64_AES_decrypt_compact PROC PRIVATE + lea r8,QWORD PTR[128+r14] + mov edi,DWORD PTR[((0-128))+r8] + mov ebp,DWORD PTR[((32-128))+r8] + mov r10d,DWORD PTR[((64-128))+r8] + mov r11d,DWORD PTR[((96-128))+r8] + mov edi,DWORD PTR[((128-128))+r8] + mov ebp,DWORD PTR[((160-128))+r8] + mov r10d,DWORD PTR[((192-128))+r8] + mov r11d,DWORD PTR[((224-128))+r8] + jmp $L$dec_loop_compact + +ALIGN 16 +$L$dec_loop_compact:: + xor eax,DWORD PTR[r15] + xor ebx,DWORD PTR[4+r15] + xor ecx,DWORD PTR[8+r15] + xor edx,DWORD PTR[12+r15] + lea r15,QWORD PTR[16+r15] + movzx r10d,al + movzx r11d,bl + movzx r12d,cl + movzx r10d,BYTE PTR[r10*1+r14] + movzx r11d,BYTE PTR[r11*1+r14] + movzx r12d,BYTE PTR[r12*1+r14] + + movzx r8d,dl + movzx esi,dh + movzx edi,ah + movzx r8d,BYTE PTR[r8*1+r14] + movzx r9d,BYTE PTR[rsi*1+r14] + movzx r13d,BYTE PTR[rdi*1+r14] + + movzx ebp,bh + movzx esi,ch + shr ecx,16 + movzx ebp,BYTE PTR[rbp*1+r14] + movzx esi,BYTE PTR[rsi*1+r14] + shr edx,16 + + movzx edi,cl + shl r9d,8 + shl r13d,8 + movzx edi,BYTE PTR[rdi*1+r14] + xor r10d,r9d + xor r11d,r13d + + movzx r9d,dl + shr eax,16 + shr ebx,16 + movzx r13d,al + shl ebp,8 + shl esi,8 + movzx r9d,BYTE PTR[r9*1+r14] + movzx r13d,BYTE PTR[r13*1+r14] + xor r12d,ebp + xor r8d,esi + + movzx ebp,bl + movzx esi,bh + shl edi,16 + movzx ebp,BYTE PTR[rbp*1+r14] + movzx esi,BYTE PTR[rsi*1+r14] + xor r10d,edi + + movzx edi,ch + shl r9d,16 + shl r13d,16 + movzx ebx,BYTE PTR[rdi*1+r14] + xor r11d,r9d + xor r12d,r13d + + movzx edi,dh + shr eax,8 + shl ebp,16 + movzx ecx,BYTE PTR[rdi*1+r14] + movzx edx,BYTE PTR[rax*1+r14] + xor r8d,ebp + + shl esi,24 + shl ebx,24 + shl ecx,24 + xor r10d,esi + shl edx,24 + xor ebx,r11d + mov eax,r10d + xor ecx,r12d + xor edx,r8d + cmp r15,QWORD PTR[16+rsp] + je $L$dec_compact_done + + mov rsi,QWORD PTR[((256+0))+r14] + shl rbx,32 + shl rdx,32 + mov rdi,QWORD PTR[((256+8))+r14] + or rax,rbx + or rcx,rdx + mov rbp,QWORD PTR[((256+16))+r14] + mov rbx,rax + mov rdx,rcx + and rbx,rsi + and rdx,rsi + mov r9,rbx + mov r12,rdx + shr r9,7 + lea r8,QWORD PTR[rax*1+rax] + shr r12,7 + lea r11,QWORD PTR[rcx*1+rcx] + sub rbx,r9 + sub rdx,r12 + and r8,rdi + and r11,rdi + and rbx,rbp + and rdx,rbp + xor rbx,r8 + xor rdx,r11 + mov r8,rbx + mov r11,rdx + + and rbx,rsi + and rdx,rsi + mov r10,rbx + mov r13,rdx + shr r10,7 + lea r9,QWORD PTR[r8*1+r8] + shr r13,7 + lea r12,QWORD PTR[r11*1+r11] + sub rbx,r10 + sub rdx,r13 + and r9,rdi + and r12,rdi + and rbx,rbp + and rdx,rbp + xor rbx,r9 + xor rdx,r12 + mov r9,rbx + mov r12,rdx + + and rbx,rsi + and rdx,rsi + mov r10,rbx + mov r13,rdx + shr r10,7 + xor r8,rax + shr r13,7 + xor r11,rcx + sub rbx,r10 + sub rdx,r13 + lea r10,QWORD PTR[r9*1+r9] + lea r13,QWORD PTR[r12*1+r12] + xor r9,rax + xor r12,rcx + and r10,rdi + and r13,rdi + and rbx,rbp + and rdx,rbp + xor r10,rbx + xor r13,rdx + + xor rax,r10 + xor rcx,r13 + xor r8,r10 + xor r11,r13 + mov rbx,rax + mov rdx,rcx + xor r9,r10 + xor r12,r13 + shr rbx,32 + shr rdx,32 + xor r10,r8 + xor r13,r11 + rol eax,8 + rol ecx,8 + xor r10,r9 + xor r13,r12 + + rol ebx,8 + rol edx,8 + xor eax,r10d + xor ecx,r13d + shr r10,32 + shr r13,32 + xor ebx,r10d + xor edx,r13d + + mov r10,r8 + mov r13,r11 + shr r10,32 + shr r13,32 + rol r8d,24 + rol r11d,24 + rol r10d,24 + rol r13d,24 + xor eax,r8d + xor ecx,r11d + mov r8,r9 + mov r11,r12 + xor ebx,r10d + xor edx,r13d + + mov rsi,QWORD PTR[r14] + shr r8,32 + shr r11,32 + mov rdi,QWORD PTR[64+r14] + rol r9d,16 + rol r12d,16 + mov rbp,QWORD PTR[128+r14] + rol r8d,16 + rol r11d,16 + mov r10,QWORD PTR[192+r14] + xor eax,r9d + xor ecx,r12d + mov r13,QWORD PTR[256+r14] + xor ebx,r8d + xor edx,r11d + jmp $L$dec_loop_compact +ALIGN 16 +$L$dec_compact_done:: + xor eax,DWORD PTR[r15] + xor ebx,DWORD PTR[4+r15] + xor ecx,DWORD PTR[8+r15] + xor edx,DWORD PTR[12+r15] + DB 0F3h,0C3h ;repret +_x86_64_AES_decrypt_compact ENDP +PUBLIC AES_decrypt + +ALIGN 16 +PUBLIC asm_AES_decrypt + +asm_AES_decrypt:: +AES_decrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_AES_decrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + + + mov r10,rsp + lea rcx,QWORD PTR[((-63))+rdx] + and rsp,-64 + sub rcx,rsp + neg rcx + and rcx,03c0h + sub rsp,rcx + sub rsp,32 + + mov QWORD PTR[16+rsp],rsi + mov QWORD PTR[24+rsp],r10 +$L$dec_prologue:: + + mov r15,rdx + mov r13d,DWORD PTR[240+r15] + + mov eax,DWORD PTR[rdi] + mov ebx,DWORD PTR[4+rdi] + mov ecx,DWORD PTR[8+rdi] + mov edx,DWORD PTR[12+rdi] + + shl r13d,4 + lea rbp,QWORD PTR[r13*1+r15] + mov QWORD PTR[rsp],r15 + mov QWORD PTR[8+rsp],rbp + + + lea r14,QWORD PTR[(($L$AES_Td+2048))] + lea rbp,QWORD PTR[768+rsp] + sub rbp,r14 + and rbp,0300h + lea r14,QWORD PTR[rbp*1+r14] + shr rbp,3 + add r14,rbp + + call _x86_64_AES_decrypt_compact + + mov r9,QWORD PTR[16+rsp] + mov rsi,QWORD PTR[24+rsp] + mov DWORD PTR[r9],eax + mov DWORD PTR[4+r9],ebx + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$dec_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_AES_decrypt:: +AES_decrypt ENDP +PUBLIC AES_set_encrypt_key + +ALIGN 16 +AES_set_encrypt_key PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_AES_set_encrypt_key:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + sub rsp,8 +$L$enc_key_prologue:: + + call _x86_64_AES_set_encrypt_key + + mov r15,QWORD PTR[8+rsp] + mov r14,QWORD PTR[16+rsp] + mov r13,QWORD PTR[24+rsp] + mov r12,QWORD PTR[32+rsp] + mov rbp,QWORD PTR[40+rsp] + mov rbx,QWORD PTR[48+rsp] + add rsp,56 +$L$enc_key_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_AES_set_encrypt_key:: +AES_set_encrypt_key ENDP + + +ALIGN 16 +_x86_64_AES_set_encrypt_key PROC PRIVATE + mov ecx,esi + mov rsi,rdi + mov rdi,rdx + + test rsi,-1 + jz $L$badpointer + test rdi,-1 + jz $L$badpointer + + lea rbp,QWORD PTR[$L$AES_Te] + lea rbp,QWORD PTR[((2048+128))+rbp] + + + mov eax,DWORD PTR[((0-128))+rbp] + mov ebx,DWORD PTR[((32-128))+rbp] + mov r8d,DWORD PTR[((64-128))+rbp] + mov edx,DWORD PTR[((96-128))+rbp] + mov eax,DWORD PTR[((128-128))+rbp] + mov ebx,DWORD PTR[((160-128))+rbp] + mov r8d,DWORD PTR[((192-128))+rbp] + mov edx,DWORD PTR[((224-128))+rbp] + + cmp ecx,128 + je $L$10rounds + cmp ecx,192 + je $L$12rounds + cmp ecx,256 + je $L$14rounds + mov rax,-2 + jmp $L$exit + +$L$10rounds:: + mov rax,QWORD PTR[rsi] + mov rdx,QWORD PTR[8+rsi] + mov QWORD PTR[rdi],rax + mov QWORD PTR[8+rdi],rdx + + shr rdx,32 + xor ecx,ecx + jmp $L$10shortcut +ALIGN 4 +$L$10loop:: + mov eax,DWORD PTR[rdi] + mov edx,DWORD PTR[12+rdi] +$L$10shortcut:: + movzx esi,dl + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + movzx esi,dh + shl ebx,24 + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + shr edx,16 + movzx esi,dl + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + movzx esi,dh + shl ebx,8 + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + shl ebx,16 + xor eax,ebx + + xor eax,DWORD PTR[((1024-128))+rcx*4+rbp] + mov DWORD PTR[16+rdi],eax + xor eax,DWORD PTR[4+rdi] + mov DWORD PTR[20+rdi],eax + xor eax,DWORD PTR[8+rdi] + mov DWORD PTR[24+rdi],eax + xor eax,DWORD PTR[12+rdi] + mov DWORD PTR[28+rdi],eax + add ecx,1 + lea rdi,QWORD PTR[16+rdi] + cmp ecx,10 + jl $L$10loop + + mov DWORD PTR[80+rdi],10 + xor rax,rax + jmp $L$exit + +$L$12rounds:: + mov rax,QWORD PTR[rsi] + mov rbx,QWORD PTR[8+rsi] + mov rdx,QWORD PTR[16+rsi] + mov QWORD PTR[rdi],rax + mov QWORD PTR[8+rdi],rbx + mov QWORD PTR[16+rdi],rdx + + shr rdx,32 + xor ecx,ecx + jmp $L$12shortcut +ALIGN 4 +$L$12loop:: + mov eax,DWORD PTR[rdi] + mov edx,DWORD PTR[20+rdi] +$L$12shortcut:: + movzx esi,dl + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + movzx esi,dh + shl ebx,24 + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + shr edx,16 + movzx esi,dl + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + movzx esi,dh + shl ebx,8 + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + shl ebx,16 + xor eax,ebx + + xor eax,DWORD PTR[((1024-128))+rcx*4+rbp] + mov DWORD PTR[24+rdi],eax + xor eax,DWORD PTR[4+rdi] + mov DWORD PTR[28+rdi],eax + xor eax,DWORD PTR[8+rdi] + mov DWORD PTR[32+rdi],eax + xor eax,DWORD PTR[12+rdi] + mov DWORD PTR[36+rdi],eax + + cmp ecx,7 + je $L$12break + add ecx,1 + + xor eax,DWORD PTR[16+rdi] + mov DWORD PTR[40+rdi],eax + xor eax,DWORD PTR[20+rdi] + mov DWORD PTR[44+rdi],eax + + lea rdi,QWORD PTR[24+rdi] + jmp $L$12loop +$L$12break:: + mov DWORD PTR[72+rdi],12 + xor rax,rax + jmp $L$exit + +$L$14rounds:: + mov rax,QWORD PTR[rsi] + mov rbx,QWORD PTR[8+rsi] + mov rcx,QWORD PTR[16+rsi] + mov rdx,QWORD PTR[24+rsi] + mov QWORD PTR[rdi],rax + mov QWORD PTR[8+rdi],rbx + mov QWORD PTR[16+rdi],rcx + mov QWORD PTR[24+rdi],rdx + + shr rdx,32 + xor ecx,ecx + jmp $L$14shortcut +ALIGN 4 +$L$14loop:: + mov eax,DWORD PTR[rdi] + mov edx,DWORD PTR[28+rdi] +$L$14shortcut:: + movzx esi,dl + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + movzx esi,dh + shl ebx,24 + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + shr edx,16 + movzx esi,dl + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + movzx esi,dh + shl ebx,8 + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + shl ebx,16 + xor eax,ebx + + xor eax,DWORD PTR[((1024-128))+rcx*4+rbp] + mov DWORD PTR[32+rdi],eax + xor eax,DWORD PTR[4+rdi] + mov DWORD PTR[36+rdi],eax + xor eax,DWORD PTR[8+rdi] + mov DWORD PTR[40+rdi],eax + xor eax,DWORD PTR[12+rdi] + mov DWORD PTR[44+rdi],eax + + cmp ecx,6 + je $L$14break + add ecx,1 + + mov edx,eax + mov eax,DWORD PTR[16+rdi] + movzx esi,dl + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + movzx esi,dh + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + shr edx,16 + shl ebx,8 + movzx esi,dl + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + movzx esi,dh + shl ebx,16 + xor eax,ebx + + movzx ebx,BYTE PTR[((-128))+rsi*1+rbp] + shl ebx,24 + xor eax,ebx + + mov DWORD PTR[48+rdi],eax + xor eax,DWORD PTR[20+rdi] + mov DWORD PTR[52+rdi],eax + xor eax,DWORD PTR[24+rdi] + mov DWORD PTR[56+rdi],eax + xor eax,DWORD PTR[28+rdi] + mov DWORD PTR[60+rdi],eax + + lea rdi,QWORD PTR[32+rdi] + jmp $L$14loop +$L$14break:: + mov DWORD PTR[48+rdi],14 + xor rax,rax + jmp $L$exit + +$L$badpointer:: + mov rax,-1 +$L$exit:: + DB 0F3h,0C3h ;repret +_x86_64_AES_set_encrypt_key ENDP +PUBLIC AES_set_decrypt_key + +ALIGN 16 +AES_set_decrypt_key PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_AES_set_decrypt_key:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + push rdx +$L$dec_key_prologue:: + + call _x86_64_AES_set_encrypt_key + mov r8,QWORD PTR[rsp] + cmp eax,0 + jne $L$abort + + mov r14d,DWORD PTR[240+r8] + xor rdi,rdi + lea rcx,QWORD PTR[r14*4+rdi] + mov rsi,r8 + lea rdi,QWORD PTR[rcx*4+r8] +ALIGN 4 +$L$invert:: + mov rax,QWORD PTR[rsi] + mov rbx,QWORD PTR[8+rsi] + mov rcx,QWORD PTR[rdi] + mov rdx,QWORD PTR[8+rdi] + mov QWORD PTR[rdi],rax + mov QWORD PTR[8+rdi],rbx + mov QWORD PTR[rsi],rcx + mov QWORD PTR[8+rsi],rdx + lea rsi,QWORD PTR[16+rsi] + lea rdi,QWORD PTR[((-16))+rdi] + cmp rdi,rsi + jne $L$invert + + lea rax,QWORD PTR[(($L$AES_Te+2048+1024))] + + mov rsi,QWORD PTR[40+rax] + mov rdi,QWORD PTR[48+rax] + mov rbp,QWORD PTR[56+rax] + + mov r15,r8 + sub r14d,1 +ALIGN 4 +$L$permute:: + lea r15,QWORD PTR[16+r15] + mov rax,QWORD PTR[r15] + mov rcx,QWORD PTR[8+r15] + mov rbx,rax + mov rdx,rcx + and rbx,rsi + and rdx,rsi + mov r9,rbx + mov r12,rdx + shr r9,7 + lea r8,QWORD PTR[rax*1+rax] + shr r12,7 + lea r11,QWORD PTR[rcx*1+rcx] + sub rbx,r9 + sub rdx,r12 + and r8,rdi + and r11,rdi + and rbx,rbp + and rdx,rbp + xor rbx,r8 + xor rdx,r11 + mov r8,rbx + mov r11,rdx + + and rbx,rsi + and rdx,rsi + mov r10,rbx + mov r13,rdx + shr r10,7 + lea r9,QWORD PTR[r8*1+r8] + shr r13,7 + lea r12,QWORD PTR[r11*1+r11] + sub rbx,r10 + sub rdx,r13 + and r9,rdi + and r12,rdi + and rbx,rbp + and rdx,rbp + xor rbx,r9 + xor rdx,r12 + mov r9,rbx + mov r12,rdx + + and rbx,rsi + and rdx,rsi + mov r10,rbx + mov r13,rdx + shr r10,7 + xor r8,rax + shr r13,7 + xor r11,rcx + sub rbx,r10 + sub rdx,r13 + lea r10,QWORD PTR[r9*1+r9] + lea r13,QWORD PTR[r12*1+r12] + xor r9,rax + xor r12,rcx + and r10,rdi + and r13,rdi + and rbx,rbp + and rdx,rbp + xor r10,rbx + xor r13,rdx + + xor rax,r10 + xor rcx,r13 + xor r8,r10 + xor r11,r13 + mov rbx,rax + mov rdx,rcx + xor r9,r10 + xor r12,r13 + shr rbx,32 + shr rdx,32 + xor r10,r8 + xor r13,r11 + rol eax,8 + rol ecx,8 + xor r10,r9 + xor r13,r12 + + rol ebx,8 + rol edx,8 + xor eax,r10d + xor ecx,r13d + shr r10,32 + shr r13,32 + xor ebx,r10d + xor edx,r13d + + mov r10,r8 + mov r13,r11 + shr r10,32 + shr r13,32 + rol r8d,24 + rol r11d,24 + rol r10d,24 + rol r13d,24 + xor eax,r8d + xor ecx,r11d + mov r8,r9 + mov r11,r12 + xor ebx,r10d + xor edx,r13d + + + shr r8,32 + shr r11,32 + + rol r9d,16 + rol r12d,16 + + rol r8d,16 + rol r11d,16 + + xor eax,r9d + xor ecx,r12d + + xor ebx,r8d + xor edx,r11d + mov DWORD PTR[r15],eax + mov DWORD PTR[4+r15],ebx + mov DWORD PTR[8+r15],ecx + mov DWORD PTR[12+r15],edx + sub r14d,1 + jnz $L$permute + + xor rax,rax +$L$abort:: + mov r15,QWORD PTR[8+rsp] + mov r14,QWORD PTR[16+rsp] + mov r13,QWORD PTR[24+rsp] + mov r12,QWORD PTR[32+rsp] + mov rbp,QWORD PTR[40+rsp] + mov rbx,QWORD PTR[48+rsp] + add rsp,56 +$L$dec_key_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_AES_set_decrypt_key:: +AES_set_decrypt_key ENDP +PUBLIC AES_cbc_encrypt + +ALIGN 16 +EXTERN OPENSSL_ia32cap_P:NEAR + +PUBLIC asm_AES_cbc_encrypt + +asm_AES_cbc_encrypt:: +AES_cbc_encrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_AES_cbc_encrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + cmp rdx,0 + je $L$cbc_epilogue + pushfq + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 +$L$cbc_prologue:: + + cld + mov r9d,r9d + + lea r14,QWORD PTR[$L$AES_Te] + cmp r9,0 + jne $L$cbc_picked_te + lea r14,QWORD PTR[$L$AES_Td] +$L$cbc_picked_te:: + + mov r10d,DWORD PTR[OPENSSL_ia32cap_P] + cmp rdx,512 + jb $L$cbc_slow_prologue + test rdx,15 + jnz $L$cbc_slow_prologue + bt r10d,IA32CAP_BIT0_HT + jc $L$cbc_slow_prologue + + + lea r15,QWORD PTR[((-88-248))+rsp] + and r15,-64 + + + mov r10,r14 + lea r11,QWORD PTR[2304+r14] + mov r12,r15 + and r10,0FFFh + and r11,0FFFh + and r12,0FFFh + + cmp r12,r11 + jb $L$cbc_te_break_out + sub r12,r11 + sub r15,r12 + jmp $L$cbc_te_ok +$L$cbc_te_break_out:: + sub r12,r10 + and r12,0FFFh + add r12,320 + sub r15,r12 +ALIGN 4 +$L$cbc_te_ok:: + + xchg r15,rsp + + mov QWORD PTR[16+rsp],r15 +$L$cbc_fast_body:: + mov QWORD PTR[24+rsp],rdi + mov QWORD PTR[32+rsp],rsi + mov QWORD PTR[40+rsp],rdx + mov QWORD PTR[48+rsp],rcx + mov QWORD PTR[56+rsp],r8 + mov DWORD PTR[((80+240))+rsp],0 + mov rbp,r8 + mov rbx,r9 + mov r9,rsi + mov r8,rdi + mov r15,rcx + + mov eax,DWORD PTR[240+r15] + + mov r10,r15 + sub r10,r14 + and r10,0fffh + cmp r10,2304 + jb $L$cbc_do_ecopy + cmp r10,4096-248 + jb $L$cbc_skip_ecopy +ALIGN 4 +$L$cbc_do_ecopy:: + mov rsi,r15 + lea rdi,QWORD PTR[80+rsp] + lea r15,QWORD PTR[80+rsp] + mov ecx,240/8 + DD 090A548F3h + mov DWORD PTR[rdi],eax +$L$cbc_skip_ecopy:: + mov QWORD PTR[rsp],r15 + + mov ecx,18 +ALIGN 4 +$L$cbc_prefetch_te:: + mov r10,QWORD PTR[r14] + mov r11,QWORD PTR[32+r14] + mov r12,QWORD PTR[64+r14] + mov r13,QWORD PTR[96+r14] + lea r14,QWORD PTR[128+r14] + sub ecx,1 + jnz $L$cbc_prefetch_te + lea r14,QWORD PTR[((-2304))+r14] + + cmp rbx,0 + je $L$FAST_DECRYPT + + + mov eax,DWORD PTR[rbp] + mov ebx,DWORD PTR[4+rbp] + mov ecx,DWORD PTR[8+rbp] + mov edx,DWORD PTR[12+rbp] + +ALIGN 4 +$L$cbc_fast_enc_loop:: + xor eax,DWORD PTR[r8] + xor ebx,DWORD PTR[4+r8] + xor ecx,DWORD PTR[8+r8] + xor edx,DWORD PTR[12+r8] + mov r15,QWORD PTR[rsp] + mov QWORD PTR[24+rsp],r8 + + call _x86_64_AES_encrypt + + mov r8,QWORD PTR[24+rsp] + mov r10,QWORD PTR[40+rsp] + mov DWORD PTR[r9],eax + mov DWORD PTR[4+r9],ebx + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + + lea r8,QWORD PTR[16+r8] + lea r9,QWORD PTR[16+r9] + sub r10,16 + test r10,-16 + mov QWORD PTR[40+rsp],r10 + jnz $L$cbc_fast_enc_loop + mov rbp,QWORD PTR[56+rsp] + mov DWORD PTR[rbp],eax + mov DWORD PTR[4+rbp],ebx + mov DWORD PTR[8+rbp],ecx + mov DWORD PTR[12+rbp],edx + + jmp $L$cbc_fast_cleanup + + +ALIGN 16 +$L$FAST_DECRYPT:: + cmp r9,r8 + je $L$cbc_fast_dec_in_place + + mov QWORD PTR[64+rsp],rbp +ALIGN 4 +$L$cbc_fast_dec_loop:: + mov eax,DWORD PTR[r8] + mov ebx,DWORD PTR[4+r8] + mov ecx,DWORD PTR[8+r8] + mov edx,DWORD PTR[12+r8] + mov r15,QWORD PTR[rsp] + mov QWORD PTR[24+rsp],r8 + + call _x86_64_AES_decrypt + + mov rbp,QWORD PTR[64+rsp] + mov r8,QWORD PTR[24+rsp] + mov r10,QWORD PTR[40+rsp] + xor eax,DWORD PTR[rbp] + xor ebx,DWORD PTR[4+rbp] + xor ecx,DWORD PTR[8+rbp] + xor edx,DWORD PTR[12+rbp] + mov rbp,r8 + + sub r10,16 + mov QWORD PTR[40+rsp],r10 + mov QWORD PTR[64+rsp],rbp + + mov DWORD PTR[r9],eax + mov DWORD PTR[4+r9],ebx + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + + lea r8,QWORD PTR[16+r8] + lea r9,QWORD PTR[16+r9] + jnz $L$cbc_fast_dec_loop + mov r12,QWORD PTR[56+rsp] + mov r10,QWORD PTR[rbp] + mov r11,QWORD PTR[8+rbp] + mov QWORD PTR[r12],r10 + mov QWORD PTR[8+r12],r11 + jmp $L$cbc_fast_cleanup + +ALIGN 16 +$L$cbc_fast_dec_in_place:: + mov r10,QWORD PTR[rbp] + mov r11,QWORD PTR[8+rbp] + mov QWORD PTR[((0+64))+rsp],r10 + mov QWORD PTR[((8+64))+rsp],r11 +ALIGN 4 +$L$cbc_fast_dec_in_place_loop:: + mov eax,DWORD PTR[r8] + mov ebx,DWORD PTR[4+r8] + mov ecx,DWORD PTR[8+r8] + mov edx,DWORD PTR[12+r8] + mov r15,QWORD PTR[rsp] + mov QWORD PTR[24+rsp],r8 + + call _x86_64_AES_decrypt + + mov r8,QWORD PTR[24+rsp] + mov r10,QWORD PTR[40+rsp] + xor eax,DWORD PTR[((0+64))+rsp] + xor ebx,DWORD PTR[((4+64))+rsp] + xor ecx,DWORD PTR[((8+64))+rsp] + xor edx,DWORD PTR[((12+64))+rsp] + + mov r11,QWORD PTR[r8] + mov r12,QWORD PTR[8+r8] + sub r10,16 + jz $L$cbc_fast_dec_in_place_done + + mov QWORD PTR[((0+64))+rsp],r11 + mov QWORD PTR[((8+64))+rsp],r12 + + mov DWORD PTR[r9],eax + mov DWORD PTR[4+r9],ebx + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + + lea r8,QWORD PTR[16+r8] + lea r9,QWORD PTR[16+r9] + mov QWORD PTR[40+rsp],r10 + jmp $L$cbc_fast_dec_in_place_loop +$L$cbc_fast_dec_in_place_done:: + mov rdi,QWORD PTR[56+rsp] + mov QWORD PTR[rdi],r11 + mov QWORD PTR[8+rdi],r12 + + mov DWORD PTR[r9],eax + mov DWORD PTR[4+r9],ebx + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + +ALIGN 4 +$L$cbc_fast_cleanup:: + cmp DWORD PTR[((80+240))+rsp],0 + lea rdi,QWORD PTR[80+rsp] + je $L$cbc_exit + mov ecx,240/8 + xor rax,rax + DD 090AB48F3h + + jmp $L$cbc_exit + + +ALIGN 16 +$L$cbc_slow_prologue:: + + lea rbp,QWORD PTR[((-88))+rsp] + and rbp,-64 + + lea r10,QWORD PTR[((-88-63))+rcx] + sub r10,rbp + neg r10 + and r10,03c0h + sub rbp,r10 + + xchg rbp,rsp + + mov QWORD PTR[16+rsp],rbp +$L$cbc_slow_body:: + + + + + mov QWORD PTR[56+rsp],r8 + mov rbp,r8 + mov rbx,r9 + mov r9,rsi + mov r8,rdi + mov r15,rcx + mov r10,rdx + + mov eax,DWORD PTR[240+r15] + mov QWORD PTR[rsp],r15 + shl eax,4 + lea rax,QWORD PTR[rax*1+r15] + mov QWORD PTR[8+rsp],rax + + + lea r14,QWORD PTR[2048+r14] + lea rax,QWORD PTR[((768-8))+rsp] + sub rax,r14 + and rax,0300h + lea r14,QWORD PTR[rax*1+r14] + + cmp rbx,0 + je $L$SLOW_DECRYPT + + + test r10,-16 + mov eax,DWORD PTR[rbp] + mov ebx,DWORD PTR[4+rbp] + mov ecx,DWORD PTR[8+rbp] + mov edx,DWORD PTR[12+rbp] + jz $L$cbc_slow_enc_tail + +ALIGN 4 +$L$cbc_slow_enc_loop:: + xor eax,DWORD PTR[r8] + xor ebx,DWORD PTR[4+r8] + xor ecx,DWORD PTR[8+r8] + xor edx,DWORD PTR[12+r8] + mov r15,QWORD PTR[rsp] + mov QWORD PTR[24+rsp],r8 + mov QWORD PTR[32+rsp],r9 + mov QWORD PTR[40+rsp],r10 + + call _x86_64_AES_encrypt_compact + + mov r8,QWORD PTR[24+rsp] + mov r9,QWORD PTR[32+rsp] + mov r10,QWORD PTR[40+rsp] + mov DWORD PTR[r9],eax + mov DWORD PTR[4+r9],ebx + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + + lea r8,QWORD PTR[16+r8] + lea r9,QWORD PTR[16+r9] + sub r10,16 + test r10,-16 + jnz $L$cbc_slow_enc_loop + test r10,15 + jnz $L$cbc_slow_enc_tail + mov rbp,QWORD PTR[56+rsp] + mov DWORD PTR[rbp],eax + mov DWORD PTR[4+rbp],ebx + mov DWORD PTR[8+rbp],ecx + mov DWORD PTR[12+rbp],edx + + jmp $L$cbc_exit + +ALIGN 4 +$L$cbc_slow_enc_tail:: + mov r11,rax + mov r12,rcx + mov rcx,r10 + mov rsi,r8 + mov rdi,r9 + DD 09066A4F3h + mov rcx,16 + sub rcx,r10 + xor rax,rax + DD 09066AAF3h + mov r8,r9 + mov r10,16 + mov rax,r11 + mov rcx,r12 + jmp $L$cbc_slow_enc_loop + +ALIGN 16 +$L$SLOW_DECRYPT:: + shr rax,3 + add r14,rax + + mov r11,QWORD PTR[rbp] + mov r12,QWORD PTR[8+rbp] + mov QWORD PTR[((0+64))+rsp],r11 + mov QWORD PTR[((8+64))+rsp],r12 + +ALIGN 4 +$L$cbc_slow_dec_loop:: + mov eax,DWORD PTR[r8] + mov ebx,DWORD PTR[4+r8] + mov ecx,DWORD PTR[8+r8] + mov edx,DWORD PTR[12+r8] + mov r15,QWORD PTR[rsp] + mov QWORD PTR[24+rsp],r8 + mov QWORD PTR[32+rsp],r9 + mov QWORD PTR[40+rsp],r10 + + call _x86_64_AES_decrypt_compact + + mov r8,QWORD PTR[24+rsp] + mov r9,QWORD PTR[32+rsp] + mov r10,QWORD PTR[40+rsp] + xor eax,DWORD PTR[((0+64))+rsp] + xor ebx,DWORD PTR[((4+64))+rsp] + xor ecx,DWORD PTR[((8+64))+rsp] + xor edx,DWORD PTR[((12+64))+rsp] + + mov r11,QWORD PTR[r8] + mov r12,QWORD PTR[8+r8] + sub r10,16 + jc $L$cbc_slow_dec_partial + jz $L$cbc_slow_dec_done + + mov QWORD PTR[((0+64))+rsp],r11 + mov QWORD PTR[((8+64))+rsp],r12 + + mov DWORD PTR[r9],eax + mov DWORD PTR[4+r9],ebx + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + + lea r8,QWORD PTR[16+r8] + lea r9,QWORD PTR[16+r9] + jmp $L$cbc_slow_dec_loop +$L$cbc_slow_dec_done:: + mov rdi,QWORD PTR[56+rsp] + mov QWORD PTR[rdi],r11 + mov QWORD PTR[8+rdi],r12 + + mov DWORD PTR[r9],eax + mov DWORD PTR[4+r9],ebx + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + + jmp $L$cbc_exit + +ALIGN 4 +$L$cbc_slow_dec_partial:: + mov rdi,QWORD PTR[56+rsp] + mov QWORD PTR[rdi],r11 + mov QWORD PTR[8+rdi],r12 + + mov DWORD PTR[((0+64))+rsp],eax + mov DWORD PTR[((4+64))+rsp],ebx + mov DWORD PTR[((8+64))+rsp],ecx + mov DWORD PTR[((12+64))+rsp],edx + + mov rdi,r9 + lea rsi,QWORD PTR[64+rsp] + lea rcx,QWORD PTR[16+r10] + DD 09066A4F3h + jmp $L$cbc_exit + +ALIGN 16 +$L$cbc_exit:: + mov rsi,QWORD PTR[16+rsp] + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$cbc_popfq:: + popfq +$L$cbc_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_AES_cbc_encrypt:: +AES_cbc_encrypt ENDP +ALIGN 64 +$L$AES_Te:: + DD 0a56363c6h,0a56363c6h + DD 0847c7cf8h,0847c7cf8h + DD 0997777eeh,0997777eeh + DD 08d7b7bf6h,08d7b7bf6h + DD 00df2f2ffh,00df2f2ffh + DD 0bd6b6bd6h,0bd6b6bd6h + DD 0b16f6fdeh,0b16f6fdeh + DD 054c5c591h,054c5c591h + DD 050303060h,050303060h + DD 003010102h,003010102h + DD 0a96767ceh,0a96767ceh + DD 07d2b2b56h,07d2b2b56h + DD 019fefee7h,019fefee7h + DD 062d7d7b5h,062d7d7b5h + DD 0e6abab4dh,0e6abab4dh + DD 09a7676ech,09a7676ech + DD 045caca8fh,045caca8fh + DD 09d82821fh,09d82821fh + DD 040c9c989h,040c9c989h + DD 0877d7dfah,0877d7dfah + DD 015fafaefh,015fafaefh + DD 0eb5959b2h,0eb5959b2h + DD 0c947478eh,0c947478eh + DD 00bf0f0fbh,00bf0f0fbh + DD 0ecadad41h,0ecadad41h + DD 067d4d4b3h,067d4d4b3h + DD 0fda2a25fh,0fda2a25fh + DD 0eaafaf45h,0eaafaf45h + DD 0bf9c9c23h,0bf9c9c23h + DD 0f7a4a453h,0f7a4a453h + DD 0967272e4h,0967272e4h + DD 05bc0c09bh,05bc0c09bh + DD 0c2b7b775h,0c2b7b775h + DD 01cfdfde1h,01cfdfde1h + DD 0ae93933dh,0ae93933dh + DD 06a26264ch,06a26264ch + DD 05a36366ch,05a36366ch + DD 0413f3f7eh,0413f3f7eh + DD 002f7f7f5h,002f7f7f5h + DD 04fcccc83h,04fcccc83h + DD 05c343468h,05c343468h + DD 0f4a5a551h,0f4a5a551h + DD 034e5e5d1h,034e5e5d1h + DD 008f1f1f9h,008f1f1f9h + DD 0937171e2h,0937171e2h + DD 073d8d8abh,073d8d8abh + DD 053313162h,053313162h + DD 03f15152ah,03f15152ah + DD 00c040408h,00c040408h + DD 052c7c795h,052c7c795h + DD 065232346h,065232346h + DD 05ec3c39dh,05ec3c39dh + DD 028181830h,028181830h + DD 0a1969637h,0a1969637h + DD 00f05050ah,00f05050ah + DD 0b59a9a2fh,0b59a9a2fh + DD 00907070eh,00907070eh + DD 036121224h,036121224h + DD 09b80801bh,09b80801bh + DD 03de2e2dfh,03de2e2dfh + DD 026ebebcdh,026ebebcdh + DD 06927274eh,06927274eh + DD 0cdb2b27fh,0cdb2b27fh + DD 09f7575eah,09f7575eah + DD 01b090912h,01b090912h + DD 09e83831dh,09e83831dh + DD 0742c2c58h,0742c2c58h + DD 02e1a1a34h,02e1a1a34h + DD 02d1b1b36h,02d1b1b36h + DD 0b26e6edch,0b26e6edch + DD 0ee5a5ab4h,0ee5a5ab4h + DD 0fba0a05bh,0fba0a05bh + DD 0f65252a4h,0f65252a4h + DD 04d3b3b76h,04d3b3b76h + DD 061d6d6b7h,061d6d6b7h + DD 0ceb3b37dh,0ceb3b37dh + DD 07b292952h,07b292952h + DD 03ee3e3ddh,03ee3e3ddh + DD 0712f2f5eh,0712f2f5eh + DD 097848413h,097848413h + DD 0f55353a6h,0f55353a6h + DD 068d1d1b9h,068d1d1b9h + DD 000000000h,000000000h + DD 02cededc1h,02cededc1h + DD 060202040h,060202040h + DD 01ffcfce3h,01ffcfce3h + DD 0c8b1b179h,0c8b1b179h + DD 0ed5b5bb6h,0ed5b5bb6h + DD 0be6a6ad4h,0be6a6ad4h + DD 046cbcb8dh,046cbcb8dh + DD 0d9bebe67h,0d9bebe67h + DD 04b393972h,04b393972h + DD 0de4a4a94h,0de4a4a94h + DD 0d44c4c98h,0d44c4c98h + DD 0e85858b0h,0e85858b0h + DD 04acfcf85h,04acfcf85h + DD 06bd0d0bbh,06bd0d0bbh + DD 02aefefc5h,02aefefc5h + DD 0e5aaaa4fh,0e5aaaa4fh + DD 016fbfbedh,016fbfbedh + DD 0c5434386h,0c5434386h + DD 0d74d4d9ah,0d74d4d9ah + DD 055333366h,055333366h + DD 094858511h,094858511h + DD 0cf45458ah,0cf45458ah + DD 010f9f9e9h,010f9f9e9h + DD 006020204h,006020204h + DD 0817f7ffeh,0817f7ffeh + DD 0f05050a0h,0f05050a0h + DD 0443c3c78h,0443c3c78h + DD 0ba9f9f25h,0ba9f9f25h + DD 0e3a8a84bh,0e3a8a84bh + DD 0f35151a2h,0f35151a2h + DD 0fea3a35dh,0fea3a35dh + DD 0c0404080h,0c0404080h + DD 08a8f8f05h,08a8f8f05h + DD 0ad92923fh,0ad92923fh + DD 0bc9d9d21h,0bc9d9d21h + DD 048383870h,048383870h + DD 004f5f5f1h,004f5f5f1h + DD 0dfbcbc63h,0dfbcbc63h + DD 0c1b6b677h,0c1b6b677h + DD 075dadaafh,075dadaafh + DD 063212142h,063212142h + DD 030101020h,030101020h + DD 01affffe5h,01affffe5h + DD 00ef3f3fdh,00ef3f3fdh + DD 06dd2d2bfh,06dd2d2bfh + DD 04ccdcd81h,04ccdcd81h + DD 0140c0c18h,0140c0c18h + DD 035131326h,035131326h + DD 02fececc3h,02fececc3h + DD 0e15f5fbeh,0e15f5fbeh + DD 0a2979735h,0a2979735h + DD 0cc444488h,0cc444488h + DD 03917172eh,03917172eh + DD 057c4c493h,057c4c493h + DD 0f2a7a755h,0f2a7a755h + DD 0827e7efch,0827e7efch + DD 0473d3d7ah,0473d3d7ah + DD 0ac6464c8h,0ac6464c8h + DD 0e75d5dbah,0e75d5dbah + DD 02b191932h,02b191932h + DD 0957373e6h,0957373e6h + DD 0a06060c0h,0a06060c0h + DD 098818119h,098818119h + DD 0d14f4f9eh,0d14f4f9eh + DD 07fdcdca3h,07fdcdca3h + DD 066222244h,066222244h + DD 07e2a2a54h,07e2a2a54h + DD 0ab90903bh,0ab90903bh + DD 08388880bh,08388880bh + DD 0ca46468ch,0ca46468ch + DD 029eeeec7h,029eeeec7h + DD 0d3b8b86bh,0d3b8b86bh + DD 03c141428h,03c141428h + DD 079dedea7h,079dedea7h + DD 0e25e5ebch,0e25e5ebch + DD 01d0b0b16h,01d0b0b16h + DD 076dbdbadh,076dbdbadh + DD 03be0e0dbh,03be0e0dbh + DD 056323264h,056323264h + DD 04e3a3a74h,04e3a3a74h + DD 01e0a0a14h,01e0a0a14h + DD 0db494992h,0db494992h + DD 00a06060ch,00a06060ch + DD 06c242448h,06c242448h + DD 0e45c5cb8h,0e45c5cb8h + DD 05dc2c29fh,05dc2c29fh + DD 06ed3d3bdh,06ed3d3bdh + DD 0efacac43h,0efacac43h + DD 0a66262c4h,0a66262c4h + DD 0a8919139h,0a8919139h + DD 0a4959531h,0a4959531h + DD 037e4e4d3h,037e4e4d3h + DD 08b7979f2h,08b7979f2h + DD 032e7e7d5h,032e7e7d5h + DD 043c8c88bh,043c8c88bh + DD 05937376eh,05937376eh + DD 0b76d6ddah,0b76d6ddah + DD 08c8d8d01h,08c8d8d01h + DD 064d5d5b1h,064d5d5b1h + DD 0d24e4e9ch,0d24e4e9ch + DD 0e0a9a949h,0e0a9a949h + DD 0b46c6cd8h,0b46c6cd8h + DD 0fa5656ach,0fa5656ach + DD 007f4f4f3h,007f4f4f3h + DD 025eaeacfh,025eaeacfh + DD 0af6565cah,0af6565cah + DD 08e7a7af4h,08e7a7af4h + DD 0e9aeae47h,0e9aeae47h + DD 018080810h,018080810h + DD 0d5baba6fh,0d5baba6fh + DD 0887878f0h,0887878f0h + DD 06f25254ah,06f25254ah + DD 0722e2e5ch,0722e2e5ch + DD 0241c1c38h,0241c1c38h + DD 0f1a6a657h,0f1a6a657h + DD 0c7b4b473h,0c7b4b473h + DD 051c6c697h,051c6c697h + DD 023e8e8cbh,023e8e8cbh + DD 07cdddda1h,07cdddda1h + DD 09c7474e8h,09c7474e8h + DD 0211f1f3eh,0211f1f3eh + DD 0dd4b4b96h,0dd4b4b96h + DD 0dcbdbd61h,0dcbdbd61h + DD 0868b8b0dh,0868b8b0dh + DD 0858a8a0fh,0858a8a0fh + DD 0907070e0h,0907070e0h + DD 0423e3e7ch,0423e3e7ch + DD 0c4b5b571h,0c4b5b571h + DD 0aa6666cch,0aa6666cch + DD 0d8484890h,0d8484890h + DD 005030306h,005030306h + DD 001f6f6f7h,001f6f6f7h + DD 0120e0e1ch,0120e0e1ch + DD 0a36161c2h,0a36161c2h + DD 05f35356ah,05f35356ah + DD 0f95757aeh,0f95757aeh + DD 0d0b9b969h,0d0b9b969h + DD 091868617h,091868617h + DD 058c1c199h,058c1c199h + DD 0271d1d3ah,0271d1d3ah + DD 0b99e9e27h,0b99e9e27h + DD 038e1e1d9h,038e1e1d9h + DD 013f8f8ebh,013f8f8ebh + DD 0b398982bh,0b398982bh + DD 033111122h,033111122h + DD 0bb6969d2h,0bb6969d2h + DD 070d9d9a9h,070d9d9a9h + DD 0898e8e07h,0898e8e07h + DD 0a7949433h,0a7949433h + DD 0b69b9b2dh,0b69b9b2dh + DD 0221e1e3ch,0221e1e3ch + DD 092878715h,092878715h + DD 020e9e9c9h,020e9e9c9h + DD 049cece87h,049cece87h + DD 0ff5555aah,0ff5555aah + DD 078282850h,078282850h + DD 07adfdfa5h,07adfdfa5h + DD 08f8c8c03h,08f8c8c03h + DD 0f8a1a159h,0f8a1a159h + DD 080898909h,080898909h + DD 0170d0d1ah,0170d0d1ah + DD 0dabfbf65h,0dabfbf65h + DD 031e6e6d7h,031e6e6d7h + DD 0c6424284h,0c6424284h + DD 0b86868d0h,0b86868d0h + DD 0c3414182h,0c3414182h + DD 0b0999929h,0b0999929h + DD 0772d2d5ah,0772d2d5ah + DD 0110f0f1eh,0110f0f1eh + DD 0cbb0b07bh,0cbb0b07bh + DD 0fc5454a8h,0fc5454a8h + DD 0d6bbbb6dh,0d6bbbb6dh + DD 03a16162ch,03a16162ch +DB 063h,07ch,077h,07bh,0f2h,06bh,06fh,0c5h +DB 030h,001h,067h,02bh,0feh,0d7h,0abh,076h +DB 0cah,082h,0c9h,07dh,0fah,059h,047h,0f0h +DB 0adh,0d4h,0a2h,0afh,09ch,0a4h,072h,0c0h +DB 0b7h,0fdh,093h,026h,036h,03fh,0f7h,0cch +DB 034h,0a5h,0e5h,0f1h,071h,0d8h,031h,015h +DB 004h,0c7h,023h,0c3h,018h,096h,005h,09ah +DB 007h,012h,080h,0e2h,0ebh,027h,0b2h,075h +DB 009h,083h,02ch,01ah,01bh,06eh,05ah,0a0h +DB 052h,03bh,0d6h,0b3h,029h,0e3h,02fh,084h +DB 053h,0d1h,000h,0edh,020h,0fch,0b1h,05bh +DB 06ah,0cbh,0beh,039h,04ah,04ch,058h,0cfh +DB 0d0h,0efh,0aah,0fbh,043h,04dh,033h,085h +DB 045h,0f9h,002h,07fh,050h,03ch,09fh,0a8h +DB 051h,0a3h,040h,08fh,092h,09dh,038h,0f5h +DB 0bch,0b6h,0dah,021h,010h,0ffh,0f3h,0d2h +DB 0cdh,00ch,013h,0ech,05fh,097h,044h,017h +DB 0c4h,0a7h,07eh,03dh,064h,05dh,019h,073h +DB 060h,081h,04fh,0dch,022h,02ah,090h,088h +DB 046h,0eeh,0b8h,014h,0deh,05eh,00bh,0dbh +DB 0e0h,032h,03ah,00ah,049h,006h,024h,05ch +DB 0c2h,0d3h,0ach,062h,091h,095h,0e4h,079h +DB 0e7h,0c8h,037h,06dh,08dh,0d5h,04eh,0a9h +DB 06ch,056h,0f4h,0eah,065h,07ah,0aeh,008h +DB 0bah,078h,025h,02eh,01ch,0a6h,0b4h,0c6h +DB 0e8h,0ddh,074h,01fh,04bh,0bdh,08bh,08ah +DB 070h,03eh,0b5h,066h,048h,003h,0f6h,00eh +DB 061h,035h,057h,0b9h,086h,0c1h,01dh,09eh +DB 0e1h,0f8h,098h,011h,069h,0d9h,08eh,094h +DB 09bh,01eh,087h,0e9h,0ceh,055h,028h,0dfh +DB 08ch,0a1h,089h,00dh,0bfh,0e6h,042h,068h +DB 041h,099h,02dh,00fh,0b0h,054h,0bbh,016h +DB 063h,07ch,077h,07bh,0f2h,06bh,06fh,0c5h +DB 030h,001h,067h,02bh,0feh,0d7h,0abh,076h +DB 0cah,082h,0c9h,07dh,0fah,059h,047h,0f0h +DB 0adh,0d4h,0a2h,0afh,09ch,0a4h,072h,0c0h +DB 0b7h,0fdh,093h,026h,036h,03fh,0f7h,0cch +DB 034h,0a5h,0e5h,0f1h,071h,0d8h,031h,015h +DB 004h,0c7h,023h,0c3h,018h,096h,005h,09ah +DB 007h,012h,080h,0e2h,0ebh,027h,0b2h,075h +DB 009h,083h,02ch,01ah,01bh,06eh,05ah,0a0h +DB 052h,03bh,0d6h,0b3h,029h,0e3h,02fh,084h +DB 053h,0d1h,000h,0edh,020h,0fch,0b1h,05bh +DB 06ah,0cbh,0beh,039h,04ah,04ch,058h,0cfh +DB 0d0h,0efh,0aah,0fbh,043h,04dh,033h,085h +DB 045h,0f9h,002h,07fh,050h,03ch,09fh,0a8h +DB 051h,0a3h,040h,08fh,092h,09dh,038h,0f5h +DB 0bch,0b6h,0dah,021h,010h,0ffh,0f3h,0d2h +DB 0cdh,00ch,013h,0ech,05fh,097h,044h,017h +DB 0c4h,0a7h,07eh,03dh,064h,05dh,019h,073h +DB 060h,081h,04fh,0dch,022h,02ah,090h,088h +DB 046h,0eeh,0b8h,014h,0deh,05eh,00bh,0dbh +DB 0e0h,032h,03ah,00ah,049h,006h,024h,05ch +DB 0c2h,0d3h,0ach,062h,091h,095h,0e4h,079h +DB 0e7h,0c8h,037h,06dh,08dh,0d5h,04eh,0a9h +DB 06ch,056h,0f4h,0eah,065h,07ah,0aeh,008h +DB 0bah,078h,025h,02eh,01ch,0a6h,0b4h,0c6h +DB 0e8h,0ddh,074h,01fh,04bh,0bdh,08bh,08ah +DB 070h,03eh,0b5h,066h,048h,003h,0f6h,00eh +DB 061h,035h,057h,0b9h,086h,0c1h,01dh,09eh +DB 0e1h,0f8h,098h,011h,069h,0d9h,08eh,094h +DB 09bh,01eh,087h,0e9h,0ceh,055h,028h,0dfh +DB 08ch,0a1h,089h,00dh,0bfh,0e6h,042h,068h +DB 041h,099h,02dh,00fh,0b0h,054h,0bbh,016h +DB 063h,07ch,077h,07bh,0f2h,06bh,06fh,0c5h +DB 030h,001h,067h,02bh,0feh,0d7h,0abh,076h +DB 0cah,082h,0c9h,07dh,0fah,059h,047h,0f0h +DB 0adh,0d4h,0a2h,0afh,09ch,0a4h,072h,0c0h +DB 0b7h,0fdh,093h,026h,036h,03fh,0f7h,0cch +DB 034h,0a5h,0e5h,0f1h,071h,0d8h,031h,015h +DB 004h,0c7h,023h,0c3h,018h,096h,005h,09ah +DB 007h,012h,080h,0e2h,0ebh,027h,0b2h,075h +DB 009h,083h,02ch,01ah,01bh,06eh,05ah,0a0h +DB 052h,03bh,0d6h,0b3h,029h,0e3h,02fh,084h +DB 053h,0d1h,000h,0edh,020h,0fch,0b1h,05bh +DB 06ah,0cbh,0beh,039h,04ah,04ch,058h,0cfh +DB 0d0h,0efh,0aah,0fbh,043h,04dh,033h,085h +DB 045h,0f9h,002h,07fh,050h,03ch,09fh,0a8h +DB 051h,0a3h,040h,08fh,092h,09dh,038h,0f5h +DB 0bch,0b6h,0dah,021h,010h,0ffh,0f3h,0d2h +DB 0cdh,00ch,013h,0ech,05fh,097h,044h,017h +DB 0c4h,0a7h,07eh,03dh,064h,05dh,019h,073h +DB 060h,081h,04fh,0dch,022h,02ah,090h,088h +DB 046h,0eeh,0b8h,014h,0deh,05eh,00bh,0dbh +DB 0e0h,032h,03ah,00ah,049h,006h,024h,05ch +DB 0c2h,0d3h,0ach,062h,091h,095h,0e4h,079h +DB 0e7h,0c8h,037h,06dh,08dh,0d5h,04eh,0a9h +DB 06ch,056h,0f4h,0eah,065h,07ah,0aeh,008h +DB 0bah,078h,025h,02eh,01ch,0a6h,0b4h,0c6h +DB 0e8h,0ddh,074h,01fh,04bh,0bdh,08bh,08ah +DB 070h,03eh,0b5h,066h,048h,003h,0f6h,00eh +DB 061h,035h,057h,0b9h,086h,0c1h,01dh,09eh +DB 0e1h,0f8h,098h,011h,069h,0d9h,08eh,094h +DB 09bh,01eh,087h,0e9h,0ceh,055h,028h,0dfh +DB 08ch,0a1h,089h,00dh,0bfh,0e6h,042h,068h +DB 041h,099h,02dh,00fh,0b0h,054h,0bbh,016h +DB 063h,07ch,077h,07bh,0f2h,06bh,06fh,0c5h +DB 030h,001h,067h,02bh,0feh,0d7h,0abh,076h +DB 0cah,082h,0c9h,07dh,0fah,059h,047h,0f0h +DB 0adh,0d4h,0a2h,0afh,09ch,0a4h,072h,0c0h +DB 0b7h,0fdh,093h,026h,036h,03fh,0f7h,0cch +DB 034h,0a5h,0e5h,0f1h,071h,0d8h,031h,015h +DB 004h,0c7h,023h,0c3h,018h,096h,005h,09ah +DB 007h,012h,080h,0e2h,0ebh,027h,0b2h,075h +DB 009h,083h,02ch,01ah,01bh,06eh,05ah,0a0h +DB 052h,03bh,0d6h,0b3h,029h,0e3h,02fh,084h +DB 053h,0d1h,000h,0edh,020h,0fch,0b1h,05bh +DB 06ah,0cbh,0beh,039h,04ah,04ch,058h,0cfh +DB 0d0h,0efh,0aah,0fbh,043h,04dh,033h,085h +DB 045h,0f9h,002h,07fh,050h,03ch,09fh,0a8h +DB 051h,0a3h,040h,08fh,092h,09dh,038h,0f5h +DB 0bch,0b6h,0dah,021h,010h,0ffh,0f3h,0d2h +DB 0cdh,00ch,013h,0ech,05fh,097h,044h,017h +DB 0c4h,0a7h,07eh,03dh,064h,05dh,019h,073h +DB 060h,081h,04fh,0dch,022h,02ah,090h,088h +DB 046h,0eeh,0b8h,014h,0deh,05eh,00bh,0dbh +DB 0e0h,032h,03ah,00ah,049h,006h,024h,05ch +DB 0c2h,0d3h,0ach,062h,091h,095h,0e4h,079h +DB 0e7h,0c8h,037h,06dh,08dh,0d5h,04eh,0a9h +DB 06ch,056h,0f4h,0eah,065h,07ah,0aeh,008h +DB 0bah,078h,025h,02eh,01ch,0a6h,0b4h,0c6h +DB 0e8h,0ddh,074h,01fh,04bh,0bdh,08bh,08ah +DB 070h,03eh,0b5h,066h,048h,003h,0f6h,00eh +DB 061h,035h,057h,0b9h,086h,0c1h,01dh,09eh +DB 0e1h,0f8h,098h,011h,069h,0d9h,08eh,094h +DB 09bh,01eh,087h,0e9h,0ceh,055h,028h,0dfh +DB 08ch,0a1h,089h,00dh,0bfh,0e6h,042h,068h +DB 041h,099h,02dh,00fh,0b0h,054h,0bbh,016h + DD 000000001h,000000002h,000000004h,000000008h + DD 000000010h,000000020h,000000040h,000000080h + DD 00000001bh,000000036h,080808080h,080808080h + DD 0fefefefeh,0fefefefeh,01b1b1b1bh,01b1b1b1bh +ALIGN 64 +$L$AES_Td:: + DD 050a7f451h,050a7f451h + DD 05365417eh,05365417eh + DD 0c3a4171ah,0c3a4171ah + DD 0965e273ah,0965e273ah + DD 0cb6bab3bh,0cb6bab3bh + DD 0f1459d1fh,0f1459d1fh + DD 0ab58faach,0ab58faach + DD 09303e34bh,09303e34bh + DD 055fa3020h,055fa3020h + DD 0f66d76adh,0f66d76adh + DD 09176cc88h,09176cc88h + DD 0254c02f5h,0254c02f5h + DD 0fcd7e54fh,0fcd7e54fh + DD 0d7cb2ac5h,0d7cb2ac5h + DD 080443526h,080443526h + DD 08fa362b5h,08fa362b5h + DD 0495ab1deh,0495ab1deh + DD 0671bba25h,0671bba25h + DD 0980eea45h,0980eea45h + DD 0e1c0fe5dh,0e1c0fe5dh + DD 002752fc3h,002752fc3h + DD 012f04c81h,012f04c81h + DD 0a397468dh,0a397468dh + DD 0c6f9d36bh,0c6f9d36bh + DD 0e75f8f03h,0e75f8f03h + DD 0959c9215h,0959c9215h + DD 0eb7a6dbfh,0eb7a6dbfh + DD 0da595295h,0da595295h + DD 02d83bed4h,02d83bed4h + DD 0d3217458h,0d3217458h + DD 02969e049h,02969e049h + DD 044c8c98eh,044c8c98eh + DD 06a89c275h,06a89c275h + DD 078798ef4h,078798ef4h + DD 06b3e5899h,06b3e5899h + DD 0dd71b927h,0dd71b927h + DD 0b64fe1beh,0b64fe1beh + DD 017ad88f0h,017ad88f0h + DD 066ac20c9h,066ac20c9h + DD 0b43ace7dh,0b43ace7dh + DD 0184adf63h,0184adf63h + DD 082311ae5h,082311ae5h + DD 060335197h,060335197h + DD 0457f5362h,0457f5362h + DD 0e07764b1h,0e07764b1h + DD 084ae6bbbh,084ae6bbbh + DD 01ca081feh,01ca081feh + DD 0942b08f9h,0942b08f9h + DD 058684870h,058684870h + DD 019fd458fh,019fd458fh + DD 0876cde94h,0876cde94h + DD 0b7f87b52h,0b7f87b52h + DD 023d373abh,023d373abh + DD 0e2024b72h,0e2024b72h + DD 0578f1fe3h,0578f1fe3h + DD 02aab5566h,02aab5566h + DD 00728ebb2h,00728ebb2h + DD 003c2b52fh,003c2b52fh + DD 09a7bc586h,09a7bc586h + DD 0a50837d3h,0a50837d3h + DD 0f2872830h,0f2872830h + DD 0b2a5bf23h,0b2a5bf23h + DD 0ba6a0302h,0ba6a0302h + DD 05c8216edh,05c8216edh + DD 02b1ccf8ah,02b1ccf8ah + DD 092b479a7h,092b479a7h + DD 0f0f207f3h,0f0f207f3h + DD 0a1e2694eh,0a1e2694eh + DD 0cdf4da65h,0cdf4da65h + DD 0d5be0506h,0d5be0506h + DD 01f6234d1h,01f6234d1h + DD 08afea6c4h,08afea6c4h + DD 09d532e34h,09d532e34h + DD 0a055f3a2h,0a055f3a2h + DD 032e18a05h,032e18a05h + DD 075ebf6a4h,075ebf6a4h + DD 039ec830bh,039ec830bh + DD 0aaef6040h,0aaef6040h + DD 0069f715eh,0069f715eh + DD 051106ebdh,051106ebdh + DD 0f98a213eh,0f98a213eh + DD 03d06dd96h,03d06dd96h + DD 0ae053eddh,0ae053eddh + DD 046bde64dh,046bde64dh + DD 0b58d5491h,0b58d5491h + DD 0055dc471h,0055dc471h + DD 06fd40604h,06fd40604h + DD 0ff155060h,0ff155060h + DD 024fb9819h,024fb9819h + DD 097e9bdd6h,097e9bdd6h + DD 0cc434089h,0cc434089h + DD 0779ed967h,0779ed967h + DD 0bd42e8b0h,0bd42e8b0h + DD 0888b8907h,0888b8907h + DD 0385b19e7h,0385b19e7h + DD 0dbeec879h,0dbeec879h + DD 0470a7ca1h,0470a7ca1h + DD 0e90f427ch,0e90f427ch + DD 0c91e84f8h,0c91e84f8h + DD 000000000h,000000000h + DD 083868009h,083868009h + DD 048ed2b32h,048ed2b32h + DD 0ac70111eh,0ac70111eh + DD 04e725a6ch,04e725a6ch + DD 0fbff0efdh,0fbff0efdh + DD 05638850fh,05638850fh + DD 01ed5ae3dh,01ed5ae3dh + DD 027392d36h,027392d36h + DD 064d90f0ah,064d90f0ah + DD 021a65c68h,021a65c68h + DD 0d1545b9bh,0d1545b9bh + DD 03a2e3624h,03a2e3624h + DD 0b1670a0ch,0b1670a0ch + DD 00fe75793h,00fe75793h + DD 0d296eeb4h,0d296eeb4h + DD 09e919b1bh,09e919b1bh + DD 04fc5c080h,04fc5c080h + DD 0a220dc61h,0a220dc61h + DD 0694b775ah,0694b775ah + DD 0161a121ch,0161a121ch + DD 00aba93e2h,00aba93e2h + DD 0e52aa0c0h,0e52aa0c0h + DD 043e0223ch,043e0223ch + DD 01d171b12h,01d171b12h + DD 00b0d090eh,00b0d090eh + DD 0adc78bf2h,0adc78bf2h + DD 0b9a8b62dh,0b9a8b62dh + DD 0c8a91e14h,0c8a91e14h + DD 08519f157h,08519f157h + DD 04c0775afh,04c0775afh + DD 0bbdd99eeh,0bbdd99eeh + DD 0fd607fa3h,0fd607fa3h + DD 09f2601f7h,09f2601f7h + DD 0bcf5725ch,0bcf5725ch + DD 0c53b6644h,0c53b6644h + DD 0347efb5bh,0347efb5bh + DD 07629438bh,07629438bh + DD 0dcc623cbh,0dcc623cbh + DD 068fcedb6h,068fcedb6h + DD 063f1e4b8h,063f1e4b8h + DD 0cadc31d7h,0cadc31d7h + DD 010856342h,010856342h + DD 040229713h,040229713h + DD 02011c684h,02011c684h + DD 07d244a85h,07d244a85h + DD 0f83dbbd2h,0f83dbbd2h + DD 01132f9aeh,01132f9aeh + DD 06da129c7h,06da129c7h + DD 04b2f9e1dh,04b2f9e1dh + DD 0f330b2dch,0f330b2dch + DD 0ec52860dh,0ec52860dh + DD 0d0e3c177h,0d0e3c177h + DD 06c16b32bh,06c16b32bh + DD 099b970a9h,099b970a9h + DD 0fa489411h,0fa489411h + DD 02264e947h,02264e947h + DD 0c48cfca8h,0c48cfca8h + DD 01a3ff0a0h,01a3ff0a0h + DD 0d82c7d56h,0d82c7d56h + DD 0ef903322h,0ef903322h + DD 0c74e4987h,0c74e4987h + DD 0c1d138d9h,0c1d138d9h + DD 0fea2ca8ch,0fea2ca8ch + DD 0360bd498h,0360bd498h + DD 0cf81f5a6h,0cf81f5a6h + DD 028de7aa5h,028de7aa5h + DD 0268eb7dah,0268eb7dah + DD 0a4bfad3fh,0a4bfad3fh + DD 0e49d3a2ch,0e49d3a2ch + DD 00d927850h,00d927850h + DD 09bcc5f6ah,09bcc5f6ah + DD 062467e54h,062467e54h + DD 0c2138df6h,0c2138df6h + DD 0e8b8d890h,0e8b8d890h + DD 05ef7392eh,05ef7392eh + DD 0f5afc382h,0f5afc382h + DD 0be805d9fh,0be805d9fh + DD 07c93d069h,07c93d069h + DD 0a92dd56fh,0a92dd56fh + DD 0b31225cfh,0b31225cfh + DD 03b99acc8h,03b99acc8h + DD 0a77d1810h,0a77d1810h + DD 06e639ce8h,06e639ce8h + DD 07bbb3bdbh,07bbb3bdbh + DD 0097826cdh,0097826cdh + DD 0f418596eh,0f418596eh + DD 001b79aech,001b79aech + DD 0a89a4f83h,0a89a4f83h + DD 0656e95e6h,0656e95e6h + DD 07ee6ffaah,07ee6ffaah + DD 008cfbc21h,008cfbc21h + DD 0e6e815efh,0e6e815efh + DD 0d99be7bah,0d99be7bah + DD 0ce366f4ah,0ce366f4ah + DD 0d4099feah,0d4099feah + DD 0d67cb029h,0d67cb029h + DD 0afb2a431h,0afb2a431h + DD 031233f2ah,031233f2ah + DD 03094a5c6h,03094a5c6h + DD 0c066a235h,0c066a235h + DD 037bc4e74h,037bc4e74h + DD 0a6ca82fch,0a6ca82fch + DD 0b0d090e0h,0b0d090e0h + DD 015d8a733h,015d8a733h + DD 04a9804f1h,04a9804f1h + DD 0f7daec41h,0f7daec41h + DD 00e50cd7fh,00e50cd7fh + DD 02ff69117h,02ff69117h + DD 08dd64d76h,08dd64d76h + DD 04db0ef43h,04db0ef43h + DD 0544daacch,0544daacch + DD 0df0496e4h,0df0496e4h + DD 0e3b5d19eh,0e3b5d19eh + DD 01b886a4ch,01b886a4ch + DD 0b81f2cc1h,0b81f2cc1h + DD 07f516546h,07f516546h + DD 004ea5e9dh,004ea5e9dh + DD 05d358c01h,05d358c01h + DD 0737487fah,0737487fah + DD 02e410bfbh,02e410bfbh + DD 05a1d67b3h,05a1d67b3h + DD 052d2db92h,052d2db92h + DD 0335610e9h,0335610e9h + DD 01347d66dh,01347d66dh + DD 08c61d79ah,08c61d79ah + DD 07a0ca137h,07a0ca137h + DD 08e14f859h,08e14f859h + DD 0893c13ebh,0893c13ebh + DD 0ee27a9ceh,0ee27a9ceh + DD 035c961b7h,035c961b7h + DD 0ede51ce1h,0ede51ce1h + DD 03cb1477ah,03cb1477ah + DD 059dfd29ch,059dfd29ch + DD 03f73f255h,03f73f255h + DD 079ce1418h,079ce1418h + DD 0bf37c773h,0bf37c773h + DD 0eacdf753h,0eacdf753h + DD 05baafd5fh,05baafd5fh + DD 0146f3ddfh,0146f3ddfh + DD 086db4478h,086db4478h + DD 081f3afcah,081f3afcah + DD 03ec468b9h,03ec468b9h + DD 02c342438h,02c342438h + DD 05f40a3c2h,05f40a3c2h + DD 072c31d16h,072c31d16h + DD 00c25e2bch,00c25e2bch + DD 08b493c28h,08b493c28h + DD 041950dffh,041950dffh + DD 07101a839h,07101a839h + DD 0deb30c08h,0deb30c08h + DD 09ce4b4d8h,09ce4b4d8h + DD 090c15664h,090c15664h + DD 06184cb7bh,06184cb7bh + DD 070b632d5h,070b632d5h + DD 0745c6c48h,0745c6c48h + DD 04257b8d0h,04257b8d0h +DB 052h,009h,06ah,0d5h,030h,036h,0a5h,038h +DB 0bfh,040h,0a3h,09eh,081h,0f3h,0d7h,0fbh +DB 07ch,0e3h,039h,082h,09bh,02fh,0ffh,087h +DB 034h,08eh,043h,044h,0c4h,0deh,0e9h,0cbh +DB 054h,07bh,094h,032h,0a6h,0c2h,023h,03dh +DB 0eeh,04ch,095h,00bh,042h,0fah,0c3h,04eh +DB 008h,02eh,0a1h,066h,028h,0d9h,024h,0b2h +DB 076h,05bh,0a2h,049h,06dh,08bh,0d1h,025h +DB 072h,0f8h,0f6h,064h,086h,068h,098h,016h +DB 0d4h,0a4h,05ch,0cch,05dh,065h,0b6h,092h +DB 06ch,070h,048h,050h,0fdh,0edh,0b9h,0dah +DB 05eh,015h,046h,057h,0a7h,08dh,09dh,084h +DB 090h,0d8h,0abh,000h,08ch,0bch,0d3h,00ah +DB 0f7h,0e4h,058h,005h,0b8h,0b3h,045h,006h +DB 0d0h,02ch,01eh,08fh,0cah,03fh,00fh,002h +DB 0c1h,0afh,0bdh,003h,001h,013h,08ah,06bh +DB 03ah,091h,011h,041h,04fh,067h,0dch,0eah +DB 097h,0f2h,0cfh,0ceh,0f0h,0b4h,0e6h,073h +DB 096h,0ach,074h,022h,0e7h,0adh,035h,085h +DB 0e2h,0f9h,037h,0e8h,01ch,075h,0dfh,06eh +DB 047h,0f1h,01ah,071h,01dh,029h,0c5h,089h +DB 06fh,0b7h,062h,00eh,0aah,018h,0beh,01bh +DB 0fch,056h,03eh,04bh,0c6h,0d2h,079h,020h +DB 09ah,0dbh,0c0h,0feh,078h,0cdh,05ah,0f4h +DB 01fh,0ddh,0a8h,033h,088h,007h,0c7h,031h +DB 0b1h,012h,010h,059h,027h,080h,0ech,05fh +DB 060h,051h,07fh,0a9h,019h,0b5h,04ah,00dh +DB 02dh,0e5h,07ah,09fh,093h,0c9h,09ch,0efh +DB 0a0h,0e0h,03bh,04dh,0aeh,02ah,0f5h,0b0h +DB 0c8h,0ebh,0bbh,03ch,083h,053h,099h,061h +DB 017h,02bh,004h,07eh,0bah,077h,0d6h,026h +DB 0e1h,069h,014h,063h,055h,021h,00ch,07dh + DD 080808080h,080808080h,0fefefefeh,0fefefefeh + DD 01b1b1b1bh,01b1b1b1bh,0,0 +DB 052h,009h,06ah,0d5h,030h,036h,0a5h,038h +DB 0bfh,040h,0a3h,09eh,081h,0f3h,0d7h,0fbh +DB 07ch,0e3h,039h,082h,09bh,02fh,0ffh,087h +DB 034h,08eh,043h,044h,0c4h,0deh,0e9h,0cbh +DB 054h,07bh,094h,032h,0a6h,0c2h,023h,03dh +DB 0eeh,04ch,095h,00bh,042h,0fah,0c3h,04eh +DB 008h,02eh,0a1h,066h,028h,0d9h,024h,0b2h +DB 076h,05bh,0a2h,049h,06dh,08bh,0d1h,025h +DB 072h,0f8h,0f6h,064h,086h,068h,098h,016h +DB 0d4h,0a4h,05ch,0cch,05dh,065h,0b6h,092h +DB 06ch,070h,048h,050h,0fdh,0edh,0b9h,0dah +DB 05eh,015h,046h,057h,0a7h,08dh,09dh,084h +DB 090h,0d8h,0abh,000h,08ch,0bch,0d3h,00ah +DB 0f7h,0e4h,058h,005h,0b8h,0b3h,045h,006h +DB 0d0h,02ch,01eh,08fh,0cah,03fh,00fh,002h +DB 0c1h,0afh,0bdh,003h,001h,013h,08ah,06bh +DB 03ah,091h,011h,041h,04fh,067h,0dch,0eah +DB 097h,0f2h,0cfh,0ceh,0f0h,0b4h,0e6h,073h +DB 096h,0ach,074h,022h,0e7h,0adh,035h,085h +DB 0e2h,0f9h,037h,0e8h,01ch,075h,0dfh,06eh +DB 047h,0f1h,01ah,071h,01dh,029h,0c5h,089h +DB 06fh,0b7h,062h,00eh,0aah,018h,0beh,01bh +DB 0fch,056h,03eh,04bh,0c6h,0d2h,079h,020h +DB 09ah,0dbh,0c0h,0feh,078h,0cdh,05ah,0f4h +DB 01fh,0ddh,0a8h,033h,088h,007h,0c7h,031h +DB 0b1h,012h,010h,059h,027h,080h,0ech,05fh +DB 060h,051h,07fh,0a9h,019h,0b5h,04ah,00dh +DB 02dh,0e5h,07ah,09fh,093h,0c9h,09ch,0efh +DB 0a0h,0e0h,03bh,04dh,0aeh,02ah,0f5h,0b0h +DB 0c8h,0ebh,0bbh,03ch,083h,053h,099h,061h +DB 017h,02bh,004h,07eh,0bah,077h,0d6h,026h +DB 0e1h,069h,014h,063h,055h,021h,00ch,07dh + DD 080808080h,080808080h,0fefefefeh,0fefefefeh + DD 01b1b1b1bh,01b1b1b1bh,0,0 +DB 052h,009h,06ah,0d5h,030h,036h,0a5h,038h +DB 0bfh,040h,0a3h,09eh,081h,0f3h,0d7h,0fbh +DB 07ch,0e3h,039h,082h,09bh,02fh,0ffh,087h +DB 034h,08eh,043h,044h,0c4h,0deh,0e9h,0cbh +DB 054h,07bh,094h,032h,0a6h,0c2h,023h,03dh +DB 0eeh,04ch,095h,00bh,042h,0fah,0c3h,04eh +DB 008h,02eh,0a1h,066h,028h,0d9h,024h,0b2h +DB 076h,05bh,0a2h,049h,06dh,08bh,0d1h,025h +DB 072h,0f8h,0f6h,064h,086h,068h,098h,016h +DB 0d4h,0a4h,05ch,0cch,05dh,065h,0b6h,092h +DB 06ch,070h,048h,050h,0fdh,0edh,0b9h,0dah +DB 05eh,015h,046h,057h,0a7h,08dh,09dh,084h +DB 090h,0d8h,0abh,000h,08ch,0bch,0d3h,00ah +DB 0f7h,0e4h,058h,005h,0b8h,0b3h,045h,006h +DB 0d0h,02ch,01eh,08fh,0cah,03fh,00fh,002h +DB 0c1h,0afh,0bdh,003h,001h,013h,08ah,06bh +DB 03ah,091h,011h,041h,04fh,067h,0dch,0eah +DB 097h,0f2h,0cfh,0ceh,0f0h,0b4h,0e6h,073h +DB 096h,0ach,074h,022h,0e7h,0adh,035h,085h +DB 0e2h,0f9h,037h,0e8h,01ch,075h,0dfh,06eh +DB 047h,0f1h,01ah,071h,01dh,029h,0c5h,089h +DB 06fh,0b7h,062h,00eh,0aah,018h,0beh,01bh +DB 0fch,056h,03eh,04bh,0c6h,0d2h,079h,020h +DB 09ah,0dbh,0c0h,0feh,078h,0cdh,05ah,0f4h +DB 01fh,0ddh,0a8h,033h,088h,007h,0c7h,031h +DB 0b1h,012h,010h,059h,027h,080h,0ech,05fh +DB 060h,051h,07fh,0a9h,019h,0b5h,04ah,00dh +DB 02dh,0e5h,07ah,09fh,093h,0c9h,09ch,0efh +DB 0a0h,0e0h,03bh,04dh,0aeh,02ah,0f5h,0b0h +DB 0c8h,0ebh,0bbh,03ch,083h,053h,099h,061h +DB 017h,02bh,004h,07eh,0bah,077h,0d6h,026h +DB 0e1h,069h,014h,063h,055h,021h,00ch,07dh + DD 080808080h,080808080h,0fefefefeh,0fefefefeh + DD 01b1b1b1bh,01b1b1b1bh,0,0 +DB 052h,009h,06ah,0d5h,030h,036h,0a5h,038h +DB 0bfh,040h,0a3h,09eh,081h,0f3h,0d7h,0fbh +DB 07ch,0e3h,039h,082h,09bh,02fh,0ffh,087h +DB 034h,08eh,043h,044h,0c4h,0deh,0e9h,0cbh +DB 054h,07bh,094h,032h,0a6h,0c2h,023h,03dh +DB 0eeh,04ch,095h,00bh,042h,0fah,0c3h,04eh +DB 008h,02eh,0a1h,066h,028h,0d9h,024h,0b2h +DB 076h,05bh,0a2h,049h,06dh,08bh,0d1h,025h +DB 072h,0f8h,0f6h,064h,086h,068h,098h,016h +DB 0d4h,0a4h,05ch,0cch,05dh,065h,0b6h,092h +DB 06ch,070h,048h,050h,0fdh,0edh,0b9h,0dah +DB 05eh,015h,046h,057h,0a7h,08dh,09dh,084h +DB 090h,0d8h,0abh,000h,08ch,0bch,0d3h,00ah +DB 0f7h,0e4h,058h,005h,0b8h,0b3h,045h,006h +DB 0d0h,02ch,01eh,08fh,0cah,03fh,00fh,002h +DB 0c1h,0afh,0bdh,003h,001h,013h,08ah,06bh +DB 03ah,091h,011h,041h,04fh,067h,0dch,0eah +DB 097h,0f2h,0cfh,0ceh,0f0h,0b4h,0e6h,073h +DB 096h,0ach,074h,022h,0e7h,0adh,035h,085h +DB 0e2h,0f9h,037h,0e8h,01ch,075h,0dfh,06eh +DB 047h,0f1h,01ah,071h,01dh,029h,0c5h,089h +DB 06fh,0b7h,062h,00eh,0aah,018h,0beh,01bh +DB 0fch,056h,03eh,04bh,0c6h,0d2h,079h,020h +DB 09ah,0dbh,0c0h,0feh,078h,0cdh,05ah,0f4h +DB 01fh,0ddh,0a8h,033h,088h,007h,0c7h,031h +DB 0b1h,012h,010h,059h,027h,080h,0ech,05fh +DB 060h,051h,07fh,0a9h,019h,0b5h,04ah,00dh +DB 02dh,0e5h,07ah,09fh,093h,0c9h,09ch,0efh +DB 0a0h,0e0h,03bh,04dh,0aeh,02ah,0f5h,0b0h +DB 0c8h,0ebh,0bbh,03ch,083h,053h,099h,061h +DB 017h,02bh,004h,07eh,0bah,077h,0d6h,026h +DB 0e1h,069h,014h,063h,055h,021h,00ch,07dh + DD 080808080h,080808080h,0fefefefeh,0fefefefeh + DD 01b1b1b1bh,01b1b1b1bh,0,0 +DB 65,69,83,32,102,111,114,32,120,56,54,95,54,52,44,32 +DB 67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97 +DB 112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103 +DB 62,0 +ALIGN 64 +EXTERN __imp_RtlVirtualUnwind:NEAR + +ALIGN 16 +block_se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + mov rsi,QWORD PTR[8+r9] + mov r11,QWORD PTR[56+r9] + + mov r10d,DWORD PTR[r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$in_block_prologue + + mov rax,QWORD PTR[152+r8] + + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jae $L$in_block_prologue + + mov rax,QWORD PTR[24+rax] + lea rax,QWORD PTR[48+rax] + + mov rbx,QWORD PTR[((-8))+rax] + mov rbp,QWORD PTR[((-16))+rax] + mov r12,QWORD PTR[((-24))+rax] + mov r13,QWORD PTR[((-32))+rax] + mov r14,QWORD PTR[((-40))+rax] + mov r15,QWORD PTR[((-48))+rax] + mov QWORD PTR[144+r8],rbx + mov QWORD PTR[160+r8],rbp + mov QWORD PTR[216+r8],r12 + mov QWORD PTR[224+r8],r13 + mov QWORD PTR[232+r8],r14 + mov QWORD PTR[240+r8],r15 + +$L$in_block_prologue:: + mov rdi,QWORD PTR[8+rax] + mov rsi,QWORD PTR[16+rax] + mov QWORD PTR[152+r8],rax + mov QWORD PTR[168+r8],rsi + mov QWORD PTR[176+r8],rdi + + jmp $L$common_seh_exit +block_se_handler ENDP + + +ALIGN 16 +key_se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + mov rsi,QWORD PTR[8+r9] + mov r11,QWORD PTR[56+r9] + + mov r10d,DWORD PTR[r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$in_key_prologue + + mov rax,QWORD PTR[152+r8] + + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jae $L$in_key_prologue + + lea rax,QWORD PTR[56+rax] + + mov rbx,QWORD PTR[((-8))+rax] + mov rbp,QWORD PTR[((-16))+rax] + mov r12,QWORD PTR[((-24))+rax] + mov r13,QWORD PTR[((-32))+rax] + mov r14,QWORD PTR[((-40))+rax] + mov r15,QWORD PTR[((-48))+rax] + mov QWORD PTR[144+r8],rbx + mov QWORD PTR[160+r8],rbp + mov QWORD PTR[216+r8],r12 + mov QWORD PTR[224+r8],r13 + mov QWORD PTR[232+r8],r14 + mov QWORD PTR[240+r8],r15 + +$L$in_key_prologue:: + mov rdi,QWORD PTR[8+rax] + mov rsi,QWORD PTR[16+rax] + mov QWORD PTR[152+r8],rax + mov QWORD PTR[168+r8],rsi + mov QWORD PTR[176+r8],rdi + + jmp $L$common_seh_exit +key_se_handler ENDP + + +ALIGN 16 +cbc_se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + lea r10,QWORD PTR[$L$cbc_prologue] + cmp rbx,r10 + jb $L$in_cbc_prologue + + lea r10,QWORD PTR[$L$cbc_fast_body] + cmp rbx,r10 + jb $L$in_cbc_frame_setup + + lea r10,QWORD PTR[$L$cbc_slow_prologue] + cmp rbx,r10 + jb $L$in_cbc_body + + lea r10,QWORD PTR[$L$cbc_slow_body] + cmp rbx,r10 + jb $L$in_cbc_frame_setup + +$L$in_cbc_body:: + mov rax,QWORD PTR[152+r8] + + lea r10,QWORD PTR[$L$cbc_epilogue] + cmp rbx,r10 + jae $L$in_cbc_prologue + + lea rax,QWORD PTR[8+rax] + + lea r10,QWORD PTR[$L$cbc_popfq] + cmp rbx,r10 + jae $L$in_cbc_prologue + + mov rax,QWORD PTR[8+rax] + lea rax,QWORD PTR[56+rax] + +$L$in_cbc_frame_setup:: + mov rbx,QWORD PTR[((-16))+rax] + mov rbp,QWORD PTR[((-24))+rax] + mov r12,QWORD PTR[((-32))+rax] + mov r13,QWORD PTR[((-40))+rax] + mov r14,QWORD PTR[((-48))+rax] + mov r15,QWORD PTR[((-56))+rax] + mov QWORD PTR[144+r8],rbx + mov QWORD PTR[160+r8],rbp + mov QWORD PTR[216+r8],r12 + mov QWORD PTR[224+r8],r13 + mov QWORD PTR[232+r8],r14 + mov QWORD PTR[240+r8],r15 + +$L$in_cbc_prologue:: + mov rdi,QWORD PTR[8+rax] + mov rsi,QWORD PTR[16+rax] + mov QWORD PTR[152+r8],rax + mov QWORD PTR[168+r8],rsi + mov QWORD PTR[176+r8],rdi + +$L$common_seh_exit:: + + mov rdi,QWORD PTR[40+r9] + mov rsi,r8 + mov ecx,154 + DD 0a548f3fch + + mov rsi,r9 + xor rcx,rcx + mov rdx,QWORD PTR[8+rsi] + mov r8,QWORD PTR[rsi] + mov r9,QWORD PTR[16+rsi] + mov r10,QWORD PTR[40+rsi] + lea r11,QWORD PTR[56+rsi] + lea r12,QWORD PTR[24+rsi] + mov QWORD PTR[32+rsp],r10 + mov QWORD PTR[40+rsp],r11 + mov QWORD PTR[48+rsp],r12 + mov QWORD PTR[56+rsp],rcx + call QWORD PTR[__imp_RtlVirtualUnwind] + + mov eax,1 + add rsp,64 + popfq + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + pop rbx + pop rdi + pop rsi + DB 0F3h,0C3h ;repret +cbc_se_handler ENDP + +.text$ ENDS +.pdata SEGMENT READONLY ALIGN(4) +ALIGN 4 + DD imagerel $L$SEH_begin_AES_encrypt + DD imagerel $L$SEH_end_AES_encrypt + DD imagerel $L$SEH_info_AES_encrypt + + DD imagerel $L$SEH_begin_AES_decrypt + DD imagerel $L$SEH_end_AES_decrypt + DD imagerel $L$SEH_info_AES_decrypt + + DD imagerel $L$SEH_begin_AES_set_encrypt_key + DD imagerel $L$SEH_end_AES_set_encrypt_key + DD imagerel $L$SEH_info_AES_set_encrypt_key + + DD imagerel $L$SEH_begin_AES_set_decrypt_key + DD imagerel $L$SEH_end_AES_set_decrypt_key + DD imagerel $L$SEH_info_AES_set_decrypt_key + + DD imagerel $L$SEH_begin_AES_cbc_encrypt + DD imagerel $L$SEH_end_AES_cbc_encrypt + DD imagerel $L$SEH_info_AES_cbc_encrypt + +.pdata ENDS +.xdata SEGMENT READONLY ALIGN(8) +ALIGN 8 +$L$SEH_info_AES_encrypt:: +DB 9,0,0,0 + DD imagerel block_se_handler + DD imagerel $L$enc_prologue,imagerel $L$enc_epilogue +$L$SEH_info_AES_decrypt:: +DB 9,0,0,0 + DD imagerel block_se_handler + DD imagerel $L$dec_prologue,imagerel $L$dec_epilogue +$L$SEH_info_AES_set_encrypt_key:: +DB 9,0,0,0 + DD imagerel key_se_handler + DD imagerel $L$enc_key_prologue,imagerel $L$enc_key_epilogue +$L$SEH_info_AES_set_decrypt_key:: +DB 9,0,0,0 + DD imagerel key_se_handler + DD imagerel $L$dec_key_prologue,imagerel $L$dec_key_epilogue +$L$SEH_info_AES_cbc_encrypt:: +DB 9,0,0,0 + DD imagerel cbc_se_handler + +.xdata ENDS +END diff --git a/crypto/aes/aes-mingw64-x86_64.S b/crypto/aes/aes-mingw64-x86_64.S new file mode 100644 index 00000000..ca2d60f9 --- /dev/null +++ b/crypto/aes/aes-mingw64-x86_64.S @@ -0,0 +1,2861 @@ +#include "x86_arch.h" + +.text +.def _x86_64_AES_encrypt; .scl 3; .type 32; .endef +.p2align 4 +_x86_64_AES_encrypt: + xorl 0(%r15),%eax + xorl 4(%r15),%ebx + xorl 8(%r15),%ecx + xorl 12(%r15),%edx + + movl 240(%r15),%r13d + subl $1,%r13d + jmp .Lenc_loop +.p2align 4 +.Lenc_loop: + + movzbl %al,%esi + movzbl %bl,%edi + movzbl %cl,%ebp + movl 0(%r14,%rsi,8),%r10d + movl 0(%r14,%rdi,8),%r11d + movl 0(%r14,%rbp,8),%r12d + + movzbl %bh,%esi + movzbl %ch,%edi + movzbl %dl,%ebp + xorl 3(%r14,%rsi,8),%r10d + xorl 3(%r14,%rdi,8),%r11d + movl 0(%r14,%rbp,8),%r8d + + movzbl %dh,%esi + shrl $16,%ecx + movzbl %ah,%ebp + xorl 3(%r14,%rsi,8),%r12d + shrl $16,%edx + xorl 3(%r14,%rbp,8),%r8d + + shrl $16,%ebx + leaq 16(%r15),%r15 + shrl $16,%eax + + movzbl %cl,%esi + movzbl %dl,%edi + movzbl %al,%ebp + xorl 2(%r14,%rsi,8),%r10d + xorl 2(%r14,%rdi,8),%r11d + xorl 2(%r14,%rbp,8),%r12d + + movzbl %dh,%esi + movzbl %ah,%edi + movzbl %bl,%ebp + xorl 1(%r14,%rsi,8),%r10d + xorl 1(%r14,%rdi,8),%r11d + xorl 2(%r14,%rbp,8),%r8d + + movl 12(%r15),%edx + movzbl %bh,%edi + movzbl %ch,%ebp + movl 0(%r15),%eax + xorl 1(%r14,%rdi,8),%r12d + xorl 1(%r14,%rbp,8),%r8d + + movl 4(%r15),%ebx + movl 8(%r15),%ecx + xorl %r10d,%eax + xorl %r11d,%ebx + xorl %r12d,%ecx + xorl %r8d,%edx + subl $1,%r13d + jnz .Lenc_loop + movzbl %al,%esi + movzbl %bl,%edi + movzbl %cl,%ebp + movzbl 2(%r14,%rsi,8),%r10d + movzbl 2(%r14,%rdi,8),%r11d + movzbl 2(%r14,%rbp,8),%r12d + + movzbl %dl,%esi + movzbl %bh,%edi + movzbl %ch,%ebp + movzbl 2(%r14,%rsi,8),%r8d + movl 0(%r14,%rdi,8),%edi + movl 0(%r14,%rbp,8),%ebp + + andl $65280,%edi + andl $65280,%ebp + + xorl %edi,%r10d + xorl %ebp,%r11d + shrl $16,%ecx + + movzbl %dh,%esi + movzbl %ah,%edi + shrl $16,%edx + movl 0(%r14,%rsi,8),%esi + movl 0(%r14,%rdi,8),%edi + + andl $65280,%esi + andl $65280,%edi + shrl $16,%ebx + xorl %esi,%r12d + xorl %edi,%r8d + shrl $16,%eax + + movzbl %cl,%esi + movzbl %dl,%edi + movzbl %al,%ebp + movl 0(%r14,%rsi,8),%esi + movl 0(%r14,%rdi,8),%edi + movl 0(%r14,%rbp,8),%ebp + + andl $16711680,%esi + andl $16711680,%edi + andl $16711680,%ebp + + xorl %esi,%r10d + xorl %edi,%r11d + xorl %ebp,%r12d + + movzbl %bl,%esi + movzbl %dh,%edi + movzbl %ah,%ebp + movl 0(%r14,%rsi,8),%esi + movl 2(%r14,%rdi,8),%edi + movl 2(%r14,%rbp,8),%ebp + + andl $16711680,%esi + andl $4278190080,%edi + andl $4278190080,%ebp + + xorl %esi,%r8d + xorl %edi,%r10d + xorl %ebp,%r11d + + movzbl %bh,%esi + movzbl %ch,%edi + movl 16+12(%r15),%edx + movl 2(%r14,%rsi,8),%esi + movl 2(%r14,%rdi,8),%edi + movl 16+0(%r15),%eax + + andl $4278190080,%esi + andl $4278190080,%edi + + xorl %esi,%r12d + xorl %edi,%r8d + + movl 16+4(%r15),%ebx + movl 16+8(%r15),%ecx + xorl %r10d,%eax + xorl %r11d,%ebx + xorl %r12d,%ecx + xorl %r8d,%edx + retq + +.def _x86_64_AES_encrypt_compact; .scl 3; .type 32; .endef +.p2align 4 +_x86_64_AES_encrypt_compact: + leaq 128(%r14),%r8 + movl 0-128(%r8),%edi + movl 32-128(%r8),%ebp + movl 64-128(%r8),%r10d + movl 96-128(%r8),%r11d + movl 128-128(%r8),%edi + movl 160-128(%r8),%ebp + movl 192-128(%r8),%r10d + movl 224-128(%r8),%r11d + jmp .Lenc_loop_compact +.p2align 4 +.Lenc_loop_compact: + xorl 0(%r15),%eax + xorl 4(%r15),%ebx + xorl 8(%r15),%ecx + xorl 12(%r15),%edx + leaq 16(%r15),%r15 + movzbl %al,%r10d + movzbl %bl,%r11d + movzbl %cl,%r12d + movzbl (%r14,%r10,1),%r10d + movzbl (%r14,%r11,1),%r11d + movzbl (%r14,%r12,1),%r12d + + movzbl %dl,%r8d + movzbl %bh,%esi + movzbl %ch,%edi + movzbl (%r14,%r8,1),%r8d + movzbl (%r14,%rsi,1),%r9d + movzbl (%r14,%rdi,1),%r13d + + movzbl %dh,%ebp + movzbl %ah,%esi + shrl $16,%ecx + movzbl (%r14,%rbp,1),%ebp + movzbl (%r14,%rsi,1),%esi + shrl $16,%edx + + movzbl %cl,%edi + shll $8,%r9d + shll $8,%r13d + movzbl (%r14,%rdi,1),%edi + xorl %r9d,%r10d + xorl %r13d,%r11d + + movzbl %dl,%r9d + shrl $16,%eax + shrl $16,%ebx + movzbl %al,%r13d + shll $8,%ebp + shll $8,%esi + movzbl (%r14,%r9,1),%r9d + movzbl (%r14,%r13,1),%r13d + xorl %ebp,%r12d + xorl %esi,%r8d + + movzbl %bl,%ebp + movzbl %dh,%esi + shll $16,%edi + movzbl (%r14,%rbp,1),%ebp + movzbl (%r14,%rsi,1),%esi + xorl %edi,%r10d + + movzbl %ah,%edi + shrl $8,%ecx + shrl $8,%ebx + movzbl (%r14,%rdi,1),%edi + movzbl (%r14,%rcx,1),%edx + movzbl (%r14,%rbx,1),%ecx + shll $16,%r9d + shll $16,%r13d + shll $16,%ebp + xorl %r9d,%r11d + xorl %r13d,%r12d + xorl %ebp,%r8d + + shll $24,%esi + shll $24,%edi + shll $24,%edx + xorl %esi,%r10d + shll $24,%ecx + xorl %edi,%r11d + movl %r10d,%eax + movl %r11d,%ebx + xorl %r12d,%ecx + xorl %r8d,%edx + cmpq 16(%rsp),%r15 + je .Lenc_compact_done + movl %eax,%esi + movl %ebx,%edi + andl $2155905152,%esi + andl $2155905152,%edi + movl %esi,%r10d + movl %edi,%r11d + shrl $7,%r10d + leal (%rax,%rax,1),%r8d + shrl $7,%r11d + leal (%rbx,%rbx,1),%r9d + subl %r10d,%esi + subl %r11d,%edi + andl $4278124286,%r8d + andl $4278124286,%r9d + andl $454761243,%esi + andl $454761243,%edi + movl %eax,%r10d + movl %ebx,%r11d + xorl %esi,%r8d + xorl %edi,%r9d + + xorl %r8d,%eax + xorl %r9d,%ebx + movl %ecx,%esi + movl %edx,%edi + roll $24,%eax + roll $24,%ebx + andl $2155905152,%esi + andl $2155905152,%edi + xorl %r8d,%eax + xorl %r9d,%ebx + movl %esi,%r12d + movl %edi,%ebp + rorl $16,%r10d + rorl $16,%r11d + shrl $7,%r12d + leal (%rcx,%rcx,1),%r8d + xorl %r10d,%eax + xorl %r11d,%ebx + shrl $7,%ebp + leal (%rdx,%rdx,1),%r9d + rorl $8,%r10d + rorl $8,%r11d + subl %r12d,%esi + subl %ebp,%edi + xorl %r10d,%eax + xorl %r11d,%ebx + + andl $4278124286,%r8d + andl $4278124286,%r9d + andl $454761243,%esi + andl $454761243,%edi + movl %ecx,%r12d + movl %edx,%ebp + xorl %esi,%r8d + xorl %edi,%r9d + + xorl %r8d,%ecx + xorl %r9d,%edx + roll $24,%ecx + roll $24,%edx + xorl %r8d,%ecx + xorl %r9d,%edx + movl 0(%r14),%esi + rorl $16,%r12d + rorl $16,%ebp + movl 64(%r14),%edi + xorl %r12d,%ecx + xorl %ebp,%edx + movl 128(%r14),%r8d + rorl $8,%r12d + rorl $8,%ebp + movl 192(%r14),%r9d + xorl %r12d,%ecx + xorl %ebp,%edx + jmp .Lenc_loop_compact +.p2align 4 +.Lenc_compact_done: + xorl 0(%r15),%eax + xorl 4(%r15),%ebx + xorl 8(%r15),%ecx + xorl 12(%r15),%edx + retq + +.globl AES_encrypt +.def AES_encrypt; .scl 2; .type 32; .endef +.p2align 4 +.globl asm_AES_encrypt + +asm_AES_encrypt: +AES_encrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_AES_encrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + + + movq %rsp,%r10 + leaq -63(%rdx),%rcx + andq $-64,%rsp + subq %rsp,%rcx + negq %rcx + andq $960,%rcx + subq %rcx,%rsp + subq $32,%rsp + + movq %rsi,16(%rsp) + movq %r10,24(%rsp) +.Lenc_prologue: + + movq %rdx,%r15 + movl 240(%r15),%r13d + + movl 0(%rdi),%eax + movl 4(%rdi),%ebx + movl 8(%rdi),%ecx + movl 12(%rdi),%edx + + shll $4,%r13d + leaq (%r15,%r13,1),%rbp + movq %r15,(%rsp) + movq %rbp,8(%rsp) + + + leaq .LAES_Te+2048(%rip),%r14 + leaq 768(%rsp),%rbp + subq %r14,%rbp + andq $768,%rbp + leaq (%r14,%rbp,1),%r14 + + call _x86_64_AES_encrypt_compact + + movq 16(%rsp),%r9 + movq 24(%rsp),%rsi + movl %eax,0(%r9) + movl %ebx,4(%r9) + movl %ecx,8(%r9) + movl %edx,12(%r9) + + movq (%rsi),%r15 + movq 8(%rsi),%r14 + movq 16(%rsi),%r13 + movq 24(%rsi),%r12 + movq 32(%rsi),%rbp + movq 40(%rsi),%rbx + leaq 48(%rsi),%rsp +.Lenc_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_AES_encrypt: +.def _x86_64_AES_decrypt; .scl 3; .type 32; .endef +.p2align 4 +_x86_64_AES_decrypt: + xorl 0(%r15),%eax + xorl 4(%r15),%ebx + xorl 8(%r15),%ecx + xorl 12(%r15),%edx + + movl 240(%r15),%r13d + subl $1,%r13d + jmp .Ldec_loop +.p2align 4 +.Ldec_loop: + + movzbl %al,%esi + movzbl %bl,%edi + movzbl %cl,%ebp + movl 0(%r14,%rsi,8),%r10d + movl 0(%r14,%rdi,8),%r11d + movl 0(%r14,%rbp,8),%r12d + + movzbl %dh,%esi + movzbl %ah,%edi + movzbl %dl,%ebp + xorl 3(%r14,%rsi,8),%r10d + xorl 3(%r14,%rdi,8),%r11d + movl 0(%r14,%rbp,8),%r8d + + movzbl %bh,%esi + shrl $16,%eax + movzbl %ch,%ebp + xorl 3(%r14,%rsi,8),%r12d + shrl $16,%edx + xorl 3(%r14,%rbp,8),%r8d + + shrl $16,%ebx + leaq 16(%r15),%r15 + shrl $16,%ecx + + movzbl %cl,%esi + movzbl %dl,%edi + movzbl %al,%ebp + xorl 2(%r14,%rsi,8),%r10d + xorl 2(%r14,%rdi,8),%r11d + xorl 2(%r14,%rbp,8),%r12d + + movzbl %bh,%esi + movzbl %ch,%edi + movzbl %bl,%ebp + xorl 1(%r14,%rsi,8),%r10d + xorl 1(%r14,%rdi,8),%r11d + xorl 2(%r14,%rbp,8),%r8d + + movzbl %dh,%esi + movl 12(%r15),%edx + movzbl %ah,%ebp + xorl 1(%r14,%rsi,8),%r12d + movl 0(%r15),%eax + xorl 1(%r14,%rbp,8),%r8d + + xorl %r10d,%eax + movl 4(%r15),%ebx + movl 8(%r15),%ecx + xorl %r12d,%ecx + xorl %r11d,%ebx + xorl %r8d,%edx + subl $1,%r13d + jnz .Ldec_loop + leaq 2048(%r14),%r14 + movzbl %al,%esi + movzbl %bl,%edi + movzbl %cl,%ebp + movzbl (%r14,%rsi,1),%r10d + movzbl (%r14,%rdi,1),%r11d + movzbl (%r14,%rbp,1),%r12d + + movzbl %dl,%esi + movzbl %dh,%edi + movzbl %ah,%ebp + movzbl (%r14,%rsi,1),%r8d + movzbl (%r14,%rdi,1),%edi + movzbl (%r14,%rbp,1),%ebp + + shll $8,%edi + shll $8,%ebp + + xorl %edi,%r10d + xorl %ebp,%r11d + shrl $16,%edx + + movzbl %bh,%esi + movzbl %ch,%edi + shrl $16,%eax + movzbl (%r14,%rsi,1),%esi + movzbl (%r14,%rdi,1),%edi + + shll $8,%esi + shll $8,%edi + shrl $16,%ebx + xorl %esi,%r12d + xorl %edi,%r8d + shrl $16,%ecx + + movzbl %cl,%esi + movzbl %dl,%edi + movzbl %al,%ebp + movzbl (%r14,%rsi,1),%esi + movzbl (%r14,%rdi,1),%edi + movzbl (%r14,%rbp,1),%ebp + + shll $16,%esi + shll $16,%edi + shll $16,%ebp + + xorl %esi,%r10d + xorl %edi,%r11d + xorl %ebp,%r12d + + movzbl %bl,%esi + movzbl %bh,%edi + movzbl %ch,%ebp + movzbl (%r14,%rsi,1),%esi + movzbl (%r14,%rdi,1),%edi + movzbl (%r14,%rbp,1),%ebp + + shll $16,%esi + shll $24,%edi + shll $24,%ebp + + xorl %esi,%r8d + xorl %edi,%r10d + xorl %ebp,%r11d + + movzbl %dh,%esi + movzbl %ah,%edi + movl 16+12(%r15),%edx + movzbl (%r14,%rsi,1),%esi + movzbl (%r14,%rdi,1),%edi + movl 16+0(%r15),%eax + + shll $24,%esi + shll $24,%edi + + xorl %esi,%r12d + xorl %edi,%r8d + + movl 16+4(%r15),%ebx + movl 16+8(%r15),%ecx + leaq -2048(%r14),%r14 + xorl %r10d,%eax + xorl %r11d,%ebx + xorl %r12d,%ecx + xorl %r8d,%edx + retq + +.def _x86_64_AES_decrypt_compact; .scl 3; .type 32; .endef +.p2align 4 +_x86_64_AES_decrypt_compact: + leaq 128(%r14),%r8 + movl 0-128(%r8),%edi + movl 32-128(%r8),%ebp + movl 64-128(%r8),%r10d + movl 96-128(%r8),%r11d + movl 128-128(%r8),%edi + movl 160-128(%r8),%ebp + movl 192-128(%r8),%r10d + movl 224-128(%r8),%r11d + jmp .Ldec_loop_compact + +.p2align 4 +.Ldec_loop_compact: + xorl 0(%r15),%eax + xorl 4(%r15),%ebx + xorl 8(%r15),%ecx + xorl 12(%r15),%edx + leaq 16(%r15),%r15 + movzbl %al,%r10d + movzbl %bl,%r11d + movzbl %cl,%r12d + movzbl (%r14,%r10,1),%r10d + movzbl (%r14,%r11,1),%r11d + movzbl (%r14,%r12,1),%r12d + + movzbl %dl,%r8d + movzbl %dh,%esi + movzbl %ah,%edi + movzbl (%r14,%r8,1),%r8d + movzbl (%r14,%rsi,1),%r9d + movzbl (%r14,%rdi,1),%r13d + + movzbl %bh,%ebp + movzbl %ch,%esi + shrl $16,%ecx + movzbl (%r14,%rbp,1),%ebp + movzbl (%r14,%rsi,1),%esi + shrl $16,%edx + + movzbl %cl,%edi + shll $8,%r9d + shll $8,%r13d + movzbl (%r14,%rdi,1),%edi + xorl %r9d,%r10d + xorl %r13d,%r11d + + movzbl %dl,%r9d + shrl $16,%eax + shrl $16,%ebx + movzbl %al,%r13d + shll $8,%ebp + shll $8,%esi + movzbl (%r14,%r9,1),%r9d + movzbl (%r14,%r13,1),%r13d + xorl %ebp,%r12d + xorl %esi,%r8d + + movzbl %bl,%ebp + movzbl %bh,%esi + shll $16,%edi + movzbl (%r14,%rbp,1),%ebp + movzbl (%r14,%rsi,1),%esi + xorl %edi,%r10d + + movzbl %ch,%edi + shll $16,%r9d + shll $16,%r13d + movzbl (%r14,%rdi,1),%ebx + xorl %r9d,%r11d + xorl %r13d,%r12d + + movzbl %dh,%edi + shrl $8,%eax + shll $16,%ebp + movzbl (%r14,%rdi,1),%ecx + movzbl (%r14,%rax,1),%edx + xorl %ebp,%r8d + + shll $24,%esi + shll $24,%ebx + shll $24,%ecx + xorl %esi,%r10d + shll $24,%edx + xorl %r11d,%ebx + movl %r10d,%eax + xorl %r12d,%ecx + xorl %r8d,%edx + cmpq 16(%rsp),%r15 + je .Ldec_compact_done + + movq 256+0(%r14),%rsi + shlq $32,%rbx + shlq $32,%rdx + movq 256+8(%r14),%rdi + orq %rbx,%rax + orq %rdx,%rcx + movq 256+16(%r14),%rbp + movq %rax,%rbx + movq %rcx,%rdx + andq %rsi,%rbx + andq %rsi,%rdx + movq %rbx,%r9 + movq %rdx,%r12 + shrq $7,%r9 + leaq (%rax,%rax,1),%r8 + shrq $7,%r12 + leaq (%rcx,%rcx,1),%r11 + subq %r9,%rbx + subq %r12,%rdx + andq %rdi,%r8 + andq %rdi,%r11 + andq %rbp,%rbx + andq %rbp,%rdx + xorq %r8,%rbx + xorq %r11,%rdx + movq %rbx,%r8 + movq %rdx,%r11 + + andq %rsi,%rbx + andq %rsi,%rdx + movq %rbx,%r10 + movq %rdx,%r13 + shrq $7,%r10 + leaq (%r8,%r8,1),%r9 + shrq $7,%r13 + leaq (%r11,%r11,1),%r12 + subq %r10,%rbx + subq %r13,%rdx + andq %rdi,%r9 + andq %rdi,%r12 + andq %rbp,%rbx + andq %rbp,%rdx + xorq %r9,%rbx + xorq %r12,%rdx + movq %rbx,%r9 + movq %rdx,%r12 + + andq %rsi,%rbx + andq %rsi,%rdx + movq %rbx,%r10 + movq %rdx,%r13 + shrq $7,%r10 + xorq %rax,%r8 + shrq $7,%r13 + xorq %rcx,%r11 + subq %r10,%rbx + subq %r13,%rdx + leaq (%r9,%r9,1),%r10 + leaq (%r12,%r12,1),%r13 + xorq %rax,%r9 + xorq %rcx,%r12 + andq %rdi,%r10 + andq %rdi,%r13 + andq %rbp,%rbx + andq %rbp,%rdx + xorq %rbx,%r10 + xorq %rdx,%r13 + + xorq %r10,%rax + xorq %r13,%rcx + xorq %r10,%r8 + xorq %r13,%r11 + movq %rax,%rbx + movq %rcx,%rdx + xorq %r10,%r9 + xorq %r13,%r12 + shrq $32,%rbx + shrq $32,%rdx + xorq %r8,%r10 + xorq %r11,%r13 + roll $8,%eax + roll $8,%ecx + xorq %r9,%r10 + xorq %r12,%r13 + + roll $8,%ebx + roll $8,%edx + xorl %r10d,%eax + xorl %r13d,%ecx + shrq $32,%r10 + shrq $32,%r13 + xorl %r10d,%ebx + xorl %r13d,%edx + + movq %r8,%r10 + movq %r11,%r13 + shrq $32,%r10 + shrq $32,%r13 + roll $24,%r8d + roll $24,%r11d + roll $24,%r10d + roll $24,%r13d + xorl %r8d,%eax + xorl %r11d,%ecx + movq %r9,%r8 + movq %r12,%r11 + xorl %r10d,%ebx + xorl %r13d,%edx + + movq 0(%r14),%rsi + shrq $32,%r8 + shrq $32,%r11 + movq 64(%r14),%rdi + roll $16,%r9d + roll $16,%r12d + movq 128(%r14),%rbp + roll $16,%r8d + roll $16,%r11d + movq 192(%r14),%r10 + xorl %r9d,%eax + xorl %r12d,%ecx + movq 256(%r14),%r13 + xorl %r8d,%ebx + xorl %r11d,%edx + jmp .Ldec_loop_compact +.p2align 4 +.Ldec_compact_done: + xorl 0(%r15),%eax + xorl 4(%r15),%ebx + xorl 8(%r15),%ecx + xorl 12(%r15),%edx + retq + +.globl AES_decrypt +.def AES_decrypt; .scl 2; .type 32; .endef +.p2align 4 +.globl asm_AES_decrypt + +asm_AES_decrypt: +AES_decrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_AES_decrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + + + movq %rsp,%r10 + leaq -63(%rdx),%rcx + andq $-64,%rsp + subq %rsp,%rcx + negq %rcx + andq $960,%rcx + subq %rcx,%rsp + subq $32,%rsp + + movq %rsi,16(%rsp) + movq %r10,24(%rsp) +.Ldec_prologue: + + movq %rdx,%r15 + movl 240(%r15),%r13d + + movl 0(%rdi),%eax + movl 4(%rdi),%ebx + movl 8(%rdi),%ecx + movl 12(%rdi),%edx + + shll $4,%r13d + leaq (%r15,%r13,1),%rbp + movq %r15,(%rsp) + movq %rbp,8(%rsp) + + + leaq .LAES_Td+2048(%rip),%r14 + leaq 768(%rsp),%rbp + subq %r14,%rbp + andq $768,%rbp + leaq (%r14,%rbp,1),%r14 + shrq $3,%rbp + addq %rbp,%r14 + + call _x86_64_AES_decrypt_compact + + movq 16(%rsp),%r9 + movq 24(%rsp),%rsi + movl %eax,0(%r9) + movl %ebx,4(%r9) + movl %ecx,8(%r9) + movl %edx,12(%r9) + + movq (%rsi),%r15 + movq 8(%rsi),%r14 + movq 16(%rsi),%r13 + movq 24(%rsi),%r12 + movq 32(%rsi),%rbp + movq 40(%rsi),%rbx + leaq 48(%rsi),%rsp +.Ldec_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_AES_decrypt: +.globl AES_set_encrypt_key +.def AES_set_encrypt_key; .scl 2; .type 32; .endef +.p2align 4 +AES_set_encrypt_key: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_AES_set_encrypt_key: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + subq $8,%rsp +.Lenc_key_prologue: + + call _x86_64_AES_set_encrypt_key + + movq 8(%rsp),%r15 + movq 16(%rsp),%r14 + movq 24(%rsp),%r13 + movq 32(%rsp),%r12 + movq 40(%rsp),%rbp + movq 48(%rsp),%rbx + addq $56,%rsp +.Lenc_key_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_AES_set_encrypt_key: + +.def _x86_64_AES_set_encrypt_key; .scl 3; .type 32; .endef +.p2align 4 +_x86_64_AES_set_encrypt_key: + movl %esi,%ecx + movq %rdi,%rsi + movq %rdx,%rdi + + testq $-1,%rsi + jz .Lbadpointer + testq $-1,%rdi + jz .Lbadpointer + + leaq .LAES_Te(%rip),%rbp + leaq 2048+128(%rbp),%rbp + + + movl 0-128(%rbp),%eax + movl 32-128(%rbp),%ebx + movl 64-128(%rbp),%r8d + movl 96-128(%rbp),%edx + movl 128-128(%rbp),%eax + movl 160-128(%rbp),%ebx + movl 192-128(%rbp),%r8d + movl 224-128(%rbp),%edx + + cmpl $128,%ecx + je .L10rounds + cmpl $192,%ecx + je .L12rounds + cmpl $256,%ecx + je .L14rounds + movq $-2,%rax + jmp .Lexit + +.L10rounds: + movq 0(%rsi),%rax + movq 8(%rsi),%rdx + movq %rax,0(%rdi) + movq %rdx,8(%rdi) + + shrq $32,%rdx + xorl %ecx,%ecx + jmp .L10shortcut +.p2align 2 +.L10loop: + movl 0(%rdi),%eax + movl 12(%rdi),%edx +.L10shortcut: + movzbl %dl,%esi + movzbl -128(%rbp,%rsi,1),%ebx + movzbl %dh,%esi + shll $24,%ebx + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + shrl $16,%edx + movzbl %dl,%esi + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + movzbl %dh,%esi + shll $8,%ebx + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + shll $16,%ebx + xorl %ebx,%eax + + xorl 1024-128(%rbp,%rcx,4),%eax + movl %eax,16(%rdi) + xorl 4(%rdi),%eax + movl %eax,20(%rdi) + xorl 8(%rdi),%eax + movl %eax,24(%rdi) + xorl 12(%rdi),%eax + movl %eax,28(%rdi) + addl $1,%ecx + leaq 16(%rdi),%rdi + cmpl $10,%ecx + jl .L10loop + + movl $10,80(%rdi) + xorq %rax,%rax + jmp .Lexit + +.L12rounds: + movq 0(%rsi),%rax + movq 8(%rsi),%rbx + movq 16(%rsi),%rdx + movq %rax,0(%rdi) + movq %rbx,8(%rdi) + movq %rdx,16(%rdi) + + shrq $32,%rdx + xorl %ecx,%ecx + jmp .L12shortcut +.p2align 2 +.L12loop: + movl 0(%rdi),%eax + movl 20(%rdi),%edx +.L12shortcut: + movzbl %dl,%esi + movzbl -128(%rbp,%rsi,1),%ebx + movzbl %dh,%esi + shll $24,%ebx + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + shrl $16,%edx + movzbl %dl,%esi + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + movzbl %dh,%esi + shll $8,%ebx + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + shll $16,%ebx + xorl %ebx,%eax + + xorl 1024-128(%rbp,%rcx,4),%eax + movl %eax,24(%rdi) + xorl 4(%rdi),%eax + movl %eax,28(%rdi) + xorl 8(%rdi),%eax + movl %eax,32(%rdi) + xorl 12(%rdi),%eax + movl %eax,36(%rdi) + + cmpl $7,%ecx + je .L12break + addl $1,%ecx + + xorl 16(%rdi),%eax + movl %eax,40(%rdi) + xorl 20(%rdi),%eax + movl %eax,44(%rdi) + + leaq 24(%rdi),%rdi + jmp .L12loop +.L12break: + movl $12,72(%rdi) + xorq %rax,%rax + jmp .Lexit + +.L14rounds: + movq 0(%rsi),%rax + movq 8(%rsi),%rbx + movq 16(%rsi),%rcx + movq 24(%rsi),%rdx + movq %rax,0(%rdi) + movq %rbx,8(%rdi) + movq %rcx,16(%rdi) + movq %rdx,24(%rdi) + + shrq $32,%rdx + xorl %ecx,%ecx + jmp .L14shortcut +.p2align 2 +.L14loop: + movl 0(%rdi),%eax + movl 28(%rdi),%edx +.L14shortcut: + movzbl %dl,%esi + movzbl -128(%rbp,%rsi,1),%ebx + movzbl %dh,%esi + shll $24,%ebx + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + shrl $16,%edx + movzbl %dl,%esi + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + movzbl %dh,%esi + shll $8,%ebx + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + shll $16,%ebx + xorl %ebx,%eax + + xorl 1024-128(%rbp,%rcx,4),%eax + movl %eax,32(%rdi) + xorl 4(%rdi),%eax + movl %eax,36(%rdi) + xorl 8(%rdi),%eax + movl %eax,40(%rdi) + xorl 12(%rdi),%eax + movl %eax,44(%rdi) + + cmpl $6,%ecx + je .L14break + addl $1,%ecx + + movl %eax,%edx + movl 16(%rdi),%eax + movzbl %dl,%esi + movzbl -128(%rbp,%rsi,1),%ebx + movzbl %dh,%esi + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + shrl $16,%edx + shll $8,%ebx + movzbl %dl,%esi + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + movzbl %dh,%esi + shll $16,%ebx + xorl %ebx,%eax + + movzbl -128(%rbp,%rsi,1),%ebx + shll $24,%ebx + xorl %ebx,%eax + + movl %eax,48(%rdi) + xorl 20(%rdi),%eax + movl %eax,52(%rdi) + xorl 24(%rdi),%eax + movl %eax,56(%rdi) + xorl 28(%rdi),%eax + movl %eax,60(%rdi) + + leaq 32(%rdi),%rdi + jmp .L14loop +.L14break: + movl $14,48(%rdi) + xorq %rax,%rax + jmp .Lexit + +.Lbadpointer: + movq $-1,%rax +.Lexit: + retq + +.globl AES_set_decrypt_key +.def AES_set_decrypt_key; .scl 2; .type 32; .endef +.p2align 4 +AES_set_decrypt_key: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_AES_set_decrypt_key: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushq %rdx +.Ldec_key_prologue: + + call _x86_64_AES_set_encrypt_key + movq (%rsp),%r8 + cmpl $0,%eax + jne .Labort + + movl 240(%r8),%r14d + xorq %rdi,%rdi + leaq (%rdi,%r14,4),%rcx + movq %r8,%rsi + leaq (%r8,%rcx,4),%rdi +.p2align 2 +.Linvert: + movq 0(%rsi),%rax + movq 8(%rsi),%rbx + movq 0(%rdi),%rcx + movq 8(%rdi),%rdx + movq %rax,0(%rdi) + movq %rbx,8(%rdi) + movq %rcx,0(%rsi) + movq %rdx,8(%rsi) + leaq 16(%rsi),%rsi + leaq -16(%rdi),%rdi + cmpq %rsi,%rdi + jne .Linvert + + leaq .LAES_Te+2048+1024(%rip),%rax + + movq 40(%rax),%rsi + movq 48(%rax),%rdi + movq 56(%rax),%rbp + + movq %r8,%r15 + subl $1,%r14d +.p2align 2 +.Lpermute: + leaq 16(%r15),%r15 + movq 0(%r15),%rax + movq 8(%r15),%rcx + movq %rax,%rbx + movq %rcx,%rdx + andq %rsi,%rbx + andq %rsi,%rdx + movq %rbx,%r9 + movq %rdx,%r12 + shrq $7,%r9 + leaq (%rax,%rax,1),%r8 + shrq $7,%r12 + leaq (%rcx,%rcx,1),%r11 + subq %r9,%rbx + subq %r12,%rdx + andq %rdi,%r8 + andq %rdi,%r11 + andq %rbp,%rbx + andq %rbp,%rdx + xorq %r8,%rbx + xorq %r11,%rdx + movq %rbx,%r8 + movq %rdx,%r11 + + andq %rsi,%rbx + andq %rsi,%rdx + movq %rbx,%r10 + movq %rdx,%r13 + shrq $7,%r10 + leaq (%r8,%r8,1),%r9 + shrq $7,%r13 + leaq (%r11,%r11,1),%r12 + subq %r10,%rbx + subq %r13,%rdx + andq %rdi,%r9 + andq %rdi,%r12 + andq %rbp,%rbx + andq %rbp,%rdx + xorq %r9,%rbx + xorq %r12,%rdx + movq %rbx,%r9 + movq %rdx,%r12 + + andq %rsi,%rbx + andq %rsi,%rdx + movq %rbx,%r10 + movq %rdx,%r13 + shrq $7,%r10 + xorq %rax,%r8 + shrq $7,%r13 + xorq %rcx,%r11 + subq %r10,%rbx + subq %r13,%rdx + leaq (%r9,%r9,1),%r10 + leaq (%r12,%r12,1),%r13 + xorq %rax,%r9 + xorq %rcx,%r12 + andq %rdi,%r10 + andq %rdi,%r13 + andq %rbp,%rbx + andq %rbp,%rdx + xorq %rbx,%r10 + xorq %rdx,%r13 + + xorq %r10,%rax + xorq %r13,%rcx + xorq %r10,%r8 + xorq %r13,%r11 + movq %rax,%rbx + movq %rcx,%rdx + xorq %r10,%r9 + xorq %r13,%r12 + shrq $32,%rbx + shrq $32,%rdx + xorq %r8,%r10 + xorq %r11,%r13 + roll $8,%eax + roll $8,%ecx + xorq %r9,%r10 + xorq %r12,%r13 + + roll $8,%ebx + roll $8,%edx + xorl %r10d,%eax + xorl %r13d,%ecx + shrq $32,%r10 + shrq $32,%r13 + xorl %r10d,%ebx + xorl %r13d,%edx + + movq %r8,%r10 + movq %r11,%r13 + shrq $32,%r10 + shrq $32,%r13 + roll $24,%r8d + roll $24,%r11d + roll $24,%r10d + roll $24,%r13d + xorl %r8d,%eax + xorl %r11d,%ecx + movq %r9,%r8 + movq %r12,%r11 + xorl %r10d,%ebx + xorl %r13d,%edx + + + shrq $32,%r8 + shrq $32,%r11 + + roll $16,%r9d + roll $16,%r12d + + roll $16,%r8d + roll $16,%r11d + + xorl %r9d,%eax + xorl %r12d,%ecx + + xorl %r8d,%ebx + xorl %r11d,%edx + movl %eax,0(%r15) + movl %ebx,4(%r15) + movl %ecx,8(%r15) + movl %edx,12(%r15) + subl $1,%r14d + jnz .Lpermute + + xorq %rax,%rax +.Labort: + movq 8(%rsp),%r15 + movq 16(%rsp),%r14 + movq 24(%rsp),%r13 + movq 32(%rsp),%r12 + movq 40(%rsp),%rbp + movq 48(%rsp),%rbx + addq $56,%rsp +.Ldec_key_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_AES_set_decrypt_key: +.globl AES_cbc_encrypt +.def AES_cbc_encrypt; .scl 2; .type 32; .endef +.p2align 4 + + +.globl asm_AES_cbc_encrypt + +asm_AES_cbc_encrypt: +AES_cbc_encrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_AES_cbc_encrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + movq 48(%rsp),%r9 + + cmpq $0,%rdx + je .Lcbc_epilogue + pushfq + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 +.Lcbc_prologue: + + cld + movl %r9d,%r9d + + leaq .LAES_Te(%rip),%r14 + cmpq $0,%r9 + jne .Lcbc_picked_te + leaq .LAES_Td(%rip),%r14 +.Lcbc_picked_te: + + movl OPENSSL_ia32cap_P(%rip),%r10d + cmpq $512,%rdx + jb .Lcbc_slow_prologue + testq $15,%rdx + jnz .Lcbc_slow_prologue + btl $IA32CAP_BIT0_HT,%r10d + jc .Lcbc_slow_prologue + + + leaq -88-248(%rsp),%r15 + andq $-64,%r15 + + + movq %r14,%r10 + leaq 2304(%r14),%r11 + movq %r15,%r12 + andq $4095,%r10 + andq $4095,%r11 + andq $4095,%r12 + + cmpq %r11,%r12 + jb .Lcbc_te_break_out + subq %r11,%r12 + subq %r12,%r15 + jmp .Lcbc_te_ok +.Lcbc_te_break_out: + subq %r10,%r12 + andq $4095,%r12 + addq $320,%r12 + subq %r12,%r15 +.p2align 2 +.Lcbc_te_ok: + + xchgq %rsp,%r15 + + movq %r15,16(%rsp) +.Lcbc_fast_body: + movq %rdi,24(%rsp) + movq %rsi,32(%rsp) + movq %rdx,40(%rsp) + movq %rcx,48(%rsp) + movq %r8,56(%rsp) + movl $0,80+240(%rsp) + movq %r8,%rbp + movq %r9,%rbx + movq %rsi,%r9 + movq %rdi,%r8 + movq %rcx,%r15 + + movl 240(%r15),%eax + + movq %r15,%r10 + subq %r14,%r10 + andq $4095,%r10 + cmpq $2304,%r10 + jb .Lcbc_do_ecopy + cmpq $4096-248,%r10 + jb .Lcbc_skip_ecopy +.p2align 2 +.Lcbc_do_ecopy: + movq %r15,%rsi + leaq 80(%rsp),%rdi + leaq 80(%rsp),%r15 + movl $30,%ecx +.long 0x90A548F3 + movl %eax,(%rdi) +.Lcbc_skip_ecopy: + movq %r15,0(%rsp) + + movl $18,%ecx +.p2align 2 +.Lcbc_prefetch_te: + movq 0(%r14),%r10 + movq 32(%r14),%r11 + movq 64(%r14),%r12 + movq 96(%r14),%r13 + leaq 128(%r14),%r14 + subl $1,%ecx + jnz .Lcbc_prefetch_te + leaq -2304(%r14),%r14 + + cmpq $0,%rbx + je .LFAST_DECRYPT + + + movl 0(%rbp),%eax + movl 4(%rbp),%ebx + movl 8(%rbp),%ecx + movl 12(%rbp),%edx + +.p2align 2 +.Lcbc_fast_enc_loop: + xorl 0(%r8),%eax + xorl 4(%r8),%ebx + xorl 8(%r8),%ecx + xorl 12(%r8),%edx + movq 0(%rsp),%r15 + movq %r8,24(%rsp) + + call _x86_64_AES_encrypt + + movq 24(%rsp),%r8 + movq 40(%rsp),%r10 + movl %eax,0(%r9) + movl %ebx,4(%r9) + movl %ecx,8(%r9) + movl %edx,12(%r9) + + leaq 16(%r8),%r8 + leaq 16(%r9),%r9 + subq $16,%r10 + testq $-16,%r10 + movq %r10,40(%rsp) + jnz .Lcbc_fast_enc_loop + movq 56(%rsp),%rbp + movl %eax,0(%rbp) + movl %ebx,4(%rbp) + movl %ecx,8(%rbp) + movl %edx,12(%rbp) + + jmp .Lcbc_fast_cleanup + + +.p2align 4 +.LFAST_DECRYPT: + cmpq %r8,%r9 + je .Lcbc_fast_dec_in_place + + movq %rbp,64(%rsp) +.p2align 2 +.Lcbc_fast_dec_loop: + movl 0(%r8),%eax + movl 4(%r8),%ebx + movl 8(%r8),%ecx + movl 12(%r8),%edx + movq 0(%rsp),%r15 + movq %r8,24(%rsp) + + call _x86_64_AES_decrypt + + movq 64(%rsp),%rbp + movq 24(%rsp),%r8 + movq 40(%rsp),%r10 + xorl 0(%rbp),%eax + xorl 4(%rbp),%ebx + xorl 8(%rbp),%ecx + xorl 12(%rbp),%edx + movq %r8,%rbp + + subq $16,%r10 + movq %r10,40(%rsp) + movq %rbp,64(%rsp) + + movl %eax,0(%r9) + movl %ebx,4(%r9) + movl %ecx,8(%r9) + movl %edx,12(%r9) + + leaq 16(%r8),%r8 + leaq 16(%r9),%r9 + jnz .Lcbc_fast_dec_loop + movq 56(%rsp),%r12 + movq 0(%rbp),%r10 + movq 8(%rbp),%r11 + movq %r10,0(%r12) + movq %r11,8(%r12) + jmp .Lcbc_fast_cleanup + +.p2align 4 +.Lcbc_fast_dec_in_place: + movq 0(%rbp),%r10 + movq 8(%rbp),%r11 + movq %r10,0+64(%rsp) + movq %r11,8+64(%rsp) +.p2align 2 +.Lcbc_fast_dec_in_place_loop: + movl 0(%r8),%eax + movl 4(%r8),%ebx + movl 8(%r8),%ecx + movl 12(%r8),%edx + movq 0(%rsp),%r15 + movq %r8,24(%rsp) + + call _x86_64_AES_decrypt + + movq 24(%rsp),%r8 + movq 40(%rsp),%r10 + xorl 0+64(%rsp),%eax + xorl 4+64(%rsp),%ebx + xorl 8+64(%rsp),%ecx + xorl 12+64(%rsp),%edx + + movq 0(%r8),%r11 + movq 8(%r8),%r12 + subq $16,%r10 + jz .Lcbc_fast_dec_in_place_done + + movq %r11,0+64(%rsp) + movq %r12,8+64(%rsp) + + movl %eax,0(%r9) + movl %ebx,4(%r9) + movl %ecx,8(%r9) + movl %edx,12(%r9) + + leaq 16(%r8),%r8 + leaq 16(%r9),%r9 + movq %r10,40(%rsp) + jmp .Lcbc_fast_dec_in_place_loop +.Lcbc_fast_dec_in_place_done: + movq 56(%rsp),%rdi + movq %r11,0(%rdi) + movq %r12,8(%rdi) + + movl %eax,0(%r9) + movl %ebx,4(%r9) + movl %ecx,8(%r9) + movl %edx,12(%r9) + +.p2align 2 +.Lcbc_fast_cleanup: + cmpl $0,80+240(%rsp) + leaq 80(%rsp),%rdi + je .Lcbc_exit + movl $30,%ecx + xorq %rax,%rax +.long 0x90AB48F3 + + jmp .Lcbc_exit + + +.p2align 4 +.Lcbc_slow_prologue: + + leaq -88(%rsp),%rbp + andq $-64,%rbp + + leaq -88-63(%rcx),%r10 + subq %rbp,%r10 + negq %r10 + andq $960,%r10 + subq %r10,%rbp + + xchgq %rsp,%rbp + + movq %rbp,16(%rsp) +.Lcbc_slow_body: + + + + + movq %r8,56(%rsp) + movq %r8,%rbp + movq %r9,%rbx + movq %rsi,%r9 + movq %rdi,%r8 + movq %rcx,%r15 + movq %rdx,%r10 + + movl 240(%r15),%eax + movq %r15,0(%rsp) + shll $4,%eax + leaq (%r15,%rax,1),%rax + movq %rax,8(%rsp) + + + leaq 2048(%r14),%r14 + leaq 768-8(%rsp),%rax + subq %r14,%rax + andq $768,%rax + leaq (%r14,%rax,1),%r14 + + cmpq $0,%rbx + je .LSLOW_DECRYPT + + + testq $-16,%r10 + movl 0(%rbp),%eax + movl 4(%rbp),%ebx + movl 8(%rbp),%ecx + movl 12(%rbp),%edx + jz .Lcbc_slow_enc_tail + +.p2align 2 +.Lcbc_slow_enc_loop: + xorl 0(%r8),%eax + xorl 4(%r8),%ebx + xorl 8(%r8),%ecx + xorl 12(%r8),%edx + movq 0(%rsp),%r15 + movq %r8,24(%rsp) + movq %r9,32(%rsp) + movq %r10,40(%rsp) + + call _x86_64_AES_encrypt_compact + + movq 24(%rsp),%r8 + movq 32(%rsp),%r9 + movq 40(%rsp),%r10 + movl %eax,0(%r9) + movl %ebx,4(%r9) + movl %ecx,8(%r9) + movl %edx,12(%r9) + + leaq 16(%r8),%r8 + leaq 16(%r9),%r9 + subq $16,%r10 + testq $-16,%r10 + jnz .Lcbc_slow_enc_loop + testq $15,%r10 + jnz .Lcbc_slow_enc_tail + movq 56(%rsp),%rbp + movl %eax,0(%rbp) + movl %ebx,4(%rbp) + movl %ecx,8(%rbp) + movl %edx,12(%rbp) + + jmp .Lcbc_exit + +.p2align 2 +.Lcbc_slow_enc_tail: + movq %rax,%r11 + movq %rcx,%r12 + movq %r10,%rcx + movq %r8,%rsi + movq %r9,%rdi +.long 0x9066A4F3 + movq $16,%rcx + subq %r10,%rcx + xorq %rax,%rax +.long 0x9066AAF3 + movq %r9,%r8 + movq $16,%r10 + movq %r11,%rax + movq %r12,%rcx + jmp .Lcbc_slow_enc_loop + +.p2align 4 +.LSLOW_DECRYPT: + shrq $3,%rax + addq %rax,%r14 + + movq 0(%rbp),%r11 + movq 8(%rbp),%r12 + movq %r11,0+64(%rsp) + movq %r12,8+64(%rsp) + +.p2align 2 +.Lcbc_slow_dec_loop: + movl 0(%r8),%eax + movl 4(%r8),%ebx + movl 8(%r8),%ecx + movl 12(%r8),%edx + movq 0(%rsp),%r15 + movq %r8,24(%rsp) + movq %r9,32(%rsp) + movq %r10,40(%rsp) + + call _x86_64_AES_decrypt_compact + + movq 24(%rsp),%r8 + movq 32(%rsp),%r9 + movq 40(%rsp),%r10 + xorl 0+64(%rsp),%eax + xorl 4+64(%rsp),%ebx + xorl 8+64(%rsp),%ecx + xorl 12+64(%rsp),%edx + + movq 0(%r8),%r11 + movq 8(%r8),%r12 + subq $16,%r10 + jc .Lcbc_slow_dec_partial + jz .Lcbc_slow_dec_done + + movq %r11,0+64(%rsp) + movq %r12,8+64(%rsp) + + movl %eax,0(%r9) + movl %ebx,4(%r9) + movl %ecx,8(%r9) + movl %edx,12(%r9) + + leaq 16(%r8),%r8 + leaq 16(%r9),%r9 + jmp .Lcbc_slow_dec_loop +.Lcbc_slow_dec_done: + movq 56(%rsp),%rdi + movq %r11,0(%rdi) + movq %r12,8(%rdi) + + movl %eax,0(%r9) + movl %ebx,4(%r9) + movl %ecx,8(%r9) + movl %edx,12(%r9) + + jmp .Lcbc_exit + +.p2align 2 +.Lcbc_slow_dec_partial: + movq 56(%rsp),%rdi + movq %r11,0(%rdi) + movq %r12,8(%rdi) + + movl %eax,0+64(%rsp) + movl %ebx,4+64(%rsp) + movl %ecx,8+64(%rsp) + movl %edx,12+64(%rsp) + + movq %r9,%rdi + leaq 64(%rsp),%rsi + leaq 16(%r10),%rcx +.long 0x9066A4F3 + jmp .Lcbc_exit + +.p2align 4 +.Lcbc_exit: + movq 16(%rsp),%rsi + movq (%rsi),%r15 + movq 8(%rsi),%r14 + movq 16(%rsi),%r13 + movq 24(%rsi),%r12 + movq 32(%rsi),%rbp + movq 40(%rsi),%rbx + leaq 48(%rsi),%rsp +.Lcbc_popfq: + popfq +.Lcbc_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_AES_cbc_encrypt: +.p2align 6 +.LAES_Te: +.long 0xa56363c6,0xa56363c6 +.long 0x847c7cf8,0x847c7cf8 +.long 0x997777ee,0x997777ee +.long 0x8d7b7bf6,0x8d7b7bf6 +.long 0x0df2f2ff,0x0df2f2ff +.long 0xbd6b6bd6,0xbd6b6bd6 +.long 0xb16f6fde,0xb16f6fde +.long 0x54c5c591,0x54c5c591 +.long 0x50303060,0x50303060 +.long 0x03010102,0x03010102 +.long 0xa96767ce,0xa96767ce +.long 0x7d2b2b56,0x7d2b2b56 +.long 0x19fefee7,0x19fefee7 +.long 0x62d7d7b5,0x62d7d7b5 +.long 0xe6abab4d,0xe6abab4d +.long 0x9a7676ec,0x9a7676ec +.long 0x45caca8f,0x45caca8f +.long 0x9d82821f,0x9d82821f +.long 0x40c9c989,0x40c9c989 +.long 0x877d7dfa,0x877d7dfa +.long 0x15fafaef,0x15fafaef +.long 0xeb5959b2,0xeb5959b2 +.long 0xc947478e,0xc947478e +.long 0x0bf0f0fb,0x0bf0f0fb +.long 0xecadad41,0xecadad41 +.long 0x67d4d4b3,0x67d4d4b3 +.long 0xfda2a25f,0xfda2a25f +.long 0xeaafaf45,0xeaafaf45 +.long 0xbf9c9c23,0xbf9c9c23 +.long 0xf7a4a453,0xf7a4a453 +.long 0x967272e4,0x967272e4 +.long 0x5bc0c09b,0x5bc0c09b +.long 0xc2b7b775,0xc2b7b775 +.long 0x1cfdfde1,0x1cfdfde1 +.long 0xae93933d,0xae93933d +.long 0x6a26264c,0x6a26264c +.long 0x5a36366c,0x5a36366c +.long 0x413f3f7e,0x413f3f7e +.long 0x02f7f7f5,0x02f7f7f5 +.long 0x4fcccc83,0x4fcccc83 +.long 0x5c343468,0x5c343468 +.long 0xf4a5a551,0xf4a5a551 +.long 0x34e5e5d1,0x34e5e5d1 +.long 0x08f1f1f9,0x08f1f1f9 +.long 0x937171e2,0x937171e2 +.long 0x73d8d8ab,0x73d8d8ab +.long 0x53313162,0x53313162 +.long 0x3f15152a,0x3f15152a +.long 0x0c040408,0x0c040408 +.long 0x52c7c795,0x52c7c795 +.long 0x65232346,0x65232346 +.long 0x5ec3c39d,0x5ec3c39d +.long 0x28181830,0x28181830 +.long 0xa1969637,0xa1969637 +.long 0x0f05050a,0x0f05050a +.long 0xb59a9a2f,0xb59a9a2f +.long 0x0907070e,0x0907070e +.long 0x36121224,0x36121224 +.long 0x9b80801b,0x9b80801b +.long 0x3de2e2df,0x3de2e2df +.long 0x26ebebcd,0x26ebebcd +.long 0x6927274e,0x6927274e +.long 0xcdb2b27f,0xcdb2b27f +.long 0x9f7575ea,0x9f7575ea +.long 0x1b090912,0x1b090912 +.long 0x9e83831d,0x9e83831d +.long 0x742c2c58,0x742c2c58 +.long 0x2e1a1a34,0x2e1a1a34 +.long 0x2d1b1b36,0x2d1b1b36 +.long 0xb26e6edc,0xb26e6edc +.long 0xee5a5ab4,0xee5a5ab4 +.long 0xfba0a05b,0xfba0a05b +.long 0xf65252a4,0xf65252a4 +.long 0x4d3b3b76,0x4d3b3b76 +.long 0x61d6d6b7,0x61d6d6b7 +.long 0xceb3b37d,0xceb3b37d +.long 0x7b292952,0x7b292952 +.long 0x3ee3e3dd,0x3ee3e3dd +.long 0x712f2f5e,0x712f2f5e +.long 0x97848413,0x97848413 +.long 0xf55353a6,0xf55353a6 +.long 0x68d1d1b9,0x68d1d1b9 +.long 0x00000000,0x00000000 +.long 0x2cededc1,0x2cededc1 +.long 0x60202040,0x60202040 +.long 0x1ffcfce3,0x1ffcfce3 +.long 0xc8b1b179,0xc8b1b179 +.long 0xed5b5bb6,0xed5b5bb6 +.long 0xbe6a6ad4,0xbe6a6ad4 +.long 0x46cbcb8d,0x46cbcb8d +.long 0xd9bebe67,0xd9bebe67 +.long 0x4b393972,0x4b393972 +.long 0xde4a4a94,0xde4a4a94 +.long 0xd44c4c98,0xd44c4c98 +.long 0xe85858b0,0xe85858b0 +.long 0x4acfcf85,0x4acfcf85 +.long 0x6bd0d0bb,0x6bd0d0bb +.long 0x2aefefc5,0x2aefefc5 +.long 0xe5aaaa4f,0xe5aaaa4f +.long 0x16fbfbed,0x16fbfbed +.long 0xc5434386,0xc5434386 +.long 0xd74d4d9a,0xd74d4d9a +.long 0x55333366,0x55333366 +.long 0x94858511,0x94858511 +.long 0xcf45458a,0xcf45458a +.long 0x10f9f9e9,0x10f9f9e9 +.long 0x06020204,0x06020204 +.long 0x817f7ffe,0x817f7ffe +.long 0xf05050a0,0xf05050a0 +.long 0x443c3c78,0x443c3c78 +.long 0xba9f9f25,0xba9f9f25 +.long 0xe3a8a84b,0xe3a8a84b +.long 0xf35151a2,0xf35151a2 +.long 0xfea3a35d,0xfea3a35d +.long 0xc0404080,0xc0404080 +.long 0x8a8f8f05,0x8a8f8f05 +.long 0xad92923f,0xad92923f +.long 0xbc9d9d21,0xbc9d9d21 +.long 0x48383870,0x48383870 +.long 0x04f5f5f1,0x04f5f5f1 +.long 0xdfbcbc63,0xdfbcbc63 +.long 0xc1b6b677,0xc1b6b677 +.long 0x75dadaaf,0x75dadaaf +.long 0x63212142,0x63212142 +.long 0x30101020,0x30101020 +.long 0x1affffe5,0x1affffe5 +.long 0x0ef3f3fd,0x0ef3f3fd +.long 0x6dd2d2bf,0x6dd2d2bf +.long 0x4ccdcd81,0x4ccdcd81 +.long 0x140c0c18,0x140c0c18 +.long 0x35131326,0x35131326 +.long 0x2fececc3,0x2fececc3 +.long 0xe15f5fbe,0xe15f5fbe +.long 0xa2979735,0xa2979735 +.long 0xcc444488,0xcc444488 +.long 0x3917172e,0x3917172e +.long 0x57c4c493,0x57c4c493 +.long 0xf2a7a755,0xf2a7a755 +.long 0x827e7efc,0x827e7efc +.long 0x473d3d7a,0x473d3d7a +.long 0xac6464c8,0xac6464c8 +.long 0xe75d5dba,0xe75d5dba +.long 0x2b191932,0x2b191932 +.long 0x957373e6,0x957373e6 +.long 0xa06060c0,0xa06060c0 +.long 0x98818119,0x98818119 +.long 0xd14f4f9e,0xd14f4f9e +.long 0x7fdcdca3,0x7fdcdca3 +.long 0x66222244,0x66222244 +.long 0x7e2a2a54,0x7e2a2a54 +.long 0xab90903b,0xab90903b +.long 0x8388880b,0x8388880b +.long 0xca46468c,0xca46468c +.long 0x29eeeec7,0x29eeeec7 +.long 0xd3b8b86b,0xd3b8b86b +.long 0x3c141428,0x3c141428 +.long 0x79dedea7,0x79dedea7 +.long 0xe25e5ebc,0xe25e5ebc +.long 0x1d0b0b16,0x1d0b0b16 +.long 0x76dbdbad,0x76dbdbad +.long 0x3be0e0db,0x3be0e0db +.long 0x56323264,0x56323264 +.long 0x4e3a3a74,0x4e3a3a74 +.long 0x1e0a0a14,0x1e0a0a14 +.long 0xdb494992,0xdb494992 +.long 0x0a06060c,0x0a06060c +.long 0x6c242448,0x6c242448 +.long 0xe45c5cb8,0xe45c5cb8 +.long 0x5dc2c29f,0x5dc2c29f +.long 0x6ed3d3bd,0x6ed3d3bd +.long 0xefacac43,0xefacac43 +.long 0xa66262c4,0xa66262c4 +.long 0xa8919139,0xa8919139 +.long 0xa4959531,0xa4959531 +.long 0x37e4e4d3,0x37e4e4d3 +.long 0x8b7979f2,0x8b7979f2 +.long 0x32e7e7d5,0x32e7e7d5 +.long 0x43c8c88b,0x43c8c88b +.long 0x5937376e,0x5937376e +.long 0xb76d6dda,0xb76d6dda +.long 0x8c8d8d01,0x8c8d8d01 +.long 0x64d5d5b1,0x64d5d5b1 +.long 0xd24e4e9c,0xd24e4e9c +.long 0xe0a9a949,0xe0a9a949 +.long 0xb46c6cd8,0xb46c6cd8 +.long 0xfa5656ac,0xfa5656ac +.long 0x07f4f4f3,0x07f4f4f3 +.long 0x25eaeacf,0x25eaeacf +.long 0xaf6565ca,0xaf6565ca +.long 0x8e7a7af4,0x8e7a7af4 +.long 0xe9aeae47,0xe9aeae47 +.long 0x18080810,0x18080810 +.long 0xd5baba6f,0xd5baba6f +.long 0x887878f0,0x887878f0 +.long 0x6f25254a,0x6f25254a +.long 0x722e2e5c,0x722e2e5c +.long 0x241c1c38,0x241c1c38 +.long 0xf1a6a657,0xf1a6a657 +.long 0xc7b4b473,0xc7b4b473 +.long 0x51c6c697,0x51c6c697 +.long 0x23e8e8cb,0x23e8e8cb +.long 0x7cdddda1,0x7cdddda1 +.long 0x9c7474e8,0x9c7474e8 +.long 0x211f1f3e,0x211f1f3e +.long 0xdd4b4b96,0xdd4b4b96 +.long 0xdcbdbd61,0xdcbdbd61 +.long 0x868b8b0d,0x868b8b0d +.long 0x858a8a0f,0x858a8a0f +.long 0x907070e0,0x907070e0 +.long 0x423e3e7c,0x423e3e7c +.long 0xc4b5b571,0xc4b5b571 +.long 0xaa6666cc,0xaa6666cc +.long 0xd8484890,0xd8484890 +.long 0x05030306,0x05030306 +.long 0x01f6f6f7,0x01f6f6f7 +.long 0x120e0e1c,0x120e0e1c +.long 0xa36161c2,0xa36161c2 +.long 0x5f35356a,0x5f35356a +.long 0xf95757ae,0xf95757ae +.long 0xd0b9b969,0xd0b9b969 +.long 0x91868617,0x91868617 +.long 0x58c1c199,0x58c1c199 +.long 0x271d1d3a,0x271d1d3a +.long 0xb99e9e27,0xb99e9e27 +.long 0x38e1e1d9,0x38e1e1d9 +.long 0x13f8f8eb,0x13f8f8eb +.long 0xb398982b,0xb398982b +.long 0x33111122,0x33111122 +.long 0xbb6969d2,0xbb6969d2 +.long 0x70d9d9a9,0x70d9d9a9 +.long 0x898e8e07,0x898e8e07 +.long 0xa7949433,0xa7949433 +.long 0xb69b9b2d,0xb69b9b2d +.long 0x221e1e3c,0x221e1e3c +.long 0x92878715,0x92878715 +.long 0x20e9e9c9,0x20e9e9c9 +.long 0x49cece87,0x49cece87 +.long 0xff5555aa,0xff5555aa +.long 0x78282850,0x78282850 +.long 0x7adfdfa5,0x7adfdfa5 +.long 0x8f8c8c03,0x8f8c8c03 +.long 0xf8a1a159,0xf8a1a159 +.long 0x80898909,0x80898909 +.long 0x170d0d1a,0x170d0d1a +.long 0xdabfbf65,0xdabfbf65 +.long 0x31e6e6d7,0x31e6e6d7 +.long 0xc6424284,0xc6424284 +.long 0xb86868d0,0xb86868d0 +.long 0xc3414182,0xc3414182 +.long 0xb0999929,0xb0999929 +.long 0x772d2d5a,0x772d2d5a +.long 0x110f0f1e,0x110f0f1e +.long 0xcbb0b07b,0xcbb0b07b +.long 0xfc5454a8,0xfc5454a8 +.long 0xd6bbbb6d,0xd6bbbb6d +.long 0x3a16162c,0x3a16162c +.byte 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5 +.byte 0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76 +.byte 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0 +.byte 0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0 +.byte 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc +.byte 0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15 +.byte 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a +.byte 0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75 +.byte 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0 +.byte 0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84 +.byte 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b +.byte 0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf +.byte 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85 +.byte 0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8 +.byte 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5 +.byte 0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2 +.byte 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17 +.byte 0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73 +.byte 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88 +.byte 0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb +.byte 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c +.byte 0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79 +.byte 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9 +.byte 0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08 +.byte 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6 +.byte 0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a +.byte 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e +.byte 0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e +.byte 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94 +.byte 0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf +.byte 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68 +.byte 0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16 +.byte 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5 +.byte 0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76 +.byte 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0 +.byte 0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0 +.byte 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc +.byte 0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15 +.byte 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a +.byte 0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75 +.byte 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0 +.byte 0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84 +.byte 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b +.byte 0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf +.byte 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85 +.byte 0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8 +.byte 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5 +.byte 0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2 +.byte 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17 +.byte 0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73 +.byte 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88 +.byte 0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb +.byte 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c +.byte 0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79 +.byte 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9 +.byte 0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08 +.byte 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6 +.byte 0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a +.byte 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e +.byte 0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e +.byte 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94 +.byte 0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf +.byte 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68 +.byte 0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16 +.byte 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5 +.byte 0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76 +.byte 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0 +.byte 0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0 +.byte 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc +.byte 0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15 +.byte 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a +.byte 0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75 +.byte 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0 +.byte 0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84 +.byte 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b +.byte 0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf +.byte 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85 +.byte 0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8 +.byte 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5 +.byte 0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2 +.byte 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17 +.byte 0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73 +.byte 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88 +.byte 0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb +.byte 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c +.byte 0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79 +.byte 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9 +.byte 0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08 +.byte 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6 +.byte 0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a +.byte 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e +.byte 0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e +.byte 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94 +.byte 0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf +.byte 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68 +.byte 0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16 +.byte 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5 +.byte 0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76 +.byte 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0 +.byte 0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0 +.byte 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc +.byte 0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15 +.byte 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a +.byte 0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75 +.byte 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0 +.byte 0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84 +.byte 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b +.byte 0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf +.byte 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85 +.byte 0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8 +.byte 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5 +.byte 0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2 +.byte 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17 +.byte 0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73 +.byte 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88 +.byte 0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb +.byte 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c +.byte 0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79 +.byte 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9 +.byte 0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08 +.byte 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6 +.byte 0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a +.byte 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e +.byte 0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e +.byte 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94 +.byte 0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf +.byte 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68 +.byte 0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16 +.long 0x00000001, 0x00000002, 0x00000004, 0x00000008 +.long 0x00000010, 0x00000020, 0x00000040, 0x00000080 +.long 0x0000001b, 0x00000036, 0x80808080, 0x80808080 +.long 0xfefefefe, 0xfefefefe, 0x1b1b1b1b, 0x1b1b1b1b +.p2align 6 +.LAES_Td: +.long 0x50a7f451,0x50a7f451 +.long 0x5365417e,0x5365417e +.long 0xc3a4171a,0xc3a4171a +.long 0x965e273a,0x965e273a +.long 0xcb6bab3b,0xcb6bab3b +.long 0xf1459d1f,0xf1459d1f +.long 0xab58faac,0xab58faac +.long 0x9303e34b,0x9303e34b +.long 0x55fa3020,0x55fa3020 +.long 0xf66d76ad,0xf66d76ad +.long 0x9176cc88,0x9176cc88 +.long 0x254c02f5,0x254c02f5 +.long 0xfcd7e54f,0xfcd7e54f +.long 0xd7cb2ac5,0xd7cb2ac5 +.long 0x80443526,0x80443526 +.long 0x8fa362b5,0x8fa362b5 +.long 0x495ab1de,0x495ab1de +.long 0x671bba25,0x671bba25 +.long 0x980eea45,0x980eea45 +.long 0xe1c0fe5d,0xe1c0fe5d +.long 0x02752fc3,0x02752fc3 +.long 0x12f04c81,0x12f04c81 +.long 0xa397468d,0xa397468d +.long 0xc6f9d36b,0xc6f9d36b +.long 0xe75f8f03,0xe75f8f03 +.long 0x959c9215,0x959c9215 +.long 0xeb7a6dbf,0xeb7a6dbf +.long 0xda595295,0xda595295 +.long 0x2d83bed4,0x2d83bed4 +.long 0xd3217458,0xd3217458 +.long 0x2969e049,0x2969e049 +.long 0x44c8c98e,0x44c8c98e +.long 0x6a89c275,0x6a89c275 +.long 0x78798ef4,0x78798ef4 +.long 0x6b3e5899,0x6b3e5899 +.long 0xdd71b927,0xdd71b927 +.long 0xb64fe1be,0xb64fe1be +.long 0x17ad88f0,0x17ad88f0 +.long 0x66ac20c9,0x66ac20c9 +.long 0xb43ace7d,0xb43ace7d +.long 0x184adf63,0x184adf63 +.long 0x82311ae5,0x82311ae5 +.long 0x60335197,0x60335197 +.long 0x457f5362,0x457f5362 +.long 0xe07764b1,0xe07764b1 +.long 0x84ae6bbb,0x84ae6bbb +.long 0x1ca081fe,0x1ca081fe +.long 0x942b08f9,0x942b08f9 +.long 0x58684870,0x58684870 +.long 0x19fd458f,0x19fd458f +.long 0x876cde94,0x876cde94 +.long 0xb7f87b52,0xb7f87b52 +.long 0x23d373ab,0x23d373ab +.long 0xe2024b72,0xe2024b72 +.long 0x578f1fe3,0x578f1fe3 +.long 0x2aab5566,0x2aab5566 +.long 0x0728ebb2,0x0728ebb2 +.long 0x03c2b52f,0x03c2b52f +.long 0x9a7bc586,0x9a7bc586 +.long 0xa50837d3,0xa50837d3 +.long 0xf2872830,0xf2872830 +.long 0xb2a5bf23,0xb2a5bf23 +.long 0xba6a0302,0xba6a0302 +.long 0x5c8216ed,0x5c8216ed +.long 0x2b1ccf8a,0x2b1ccf8a +.long 0x92b479a7,0x92b479a7 +.long 0xf0f207f3,0xf0f207f3 +.long 0xa1e2694e,0xa1e2694e +.long 0xcdf4da65,0xcdf4da65 +.long 0xd5be0506,0xd5be0506 +.long 0x1f6234d1,0x1f6234d1 +.long 0x8afea6c4,0x8afea6c4 +.long 0x9d532e34,0x9d532e34 +.long 0xa055f3a2,0xa055f3a2 +.long 0x32e18a05,0x32e18a05 +.long 0x75ebf6a4,0x75ebf6a4 +.long 0x39ec830b,0x39ec830b +.long 0xaaef6040,0xaaef6040 +.long 0x069f715e,0x069f715e +.long 0x51106ebd,0x51106ebd +.long 0xf98a213e,0xf98a213e +.long 0x3d06dd96,0x3d06dd96 +.long 0xae053edd,0xae053edd +.long 0x46bde64d,0x46bde64d +.long 0xb58d5491,0xb58d5491 +.long 0x055dc471,0x055dc471 +.long 0x6fd40604,0x6fd40604 +.long 0xff155060,0xff155060 +.long 0x24fb9819,0x24fb9819 +.long 0x97e9bdd6,0x97e9bdd6 +.long 0xcc434089,0xcc434089 +.long 0x779ed967,0x779ed967 +.long 0xbd42e8b0,0xbd42e8b0 +.long 0x888b8907,0x888b8907 +.long 0x385b19e7,0x385b19e7 +.long 0xdbeec879,0xdbeec879 +.long 0x470a7ca1,0x470a7ca1 +.long 0xe90f427c,0xe90f427c +.long 0xc91e84f8,0xc91e84f8 +.long 0x00000000,0x00000000 +.long 0x83868009,0x83868009 +.long 0x48ed2b32,0x48ed2b32 +.long 0xac70111e,0xac70111e +.long 0x4e725a6c,0x4e725a6c +.long 0xfbff0efd,0xfbff0efd +.long 0x5638850f,0x5638850f +.long 0x1ed5ae3d,0x1ed5ae3d +.long 0x27392d36,0x27392d36 +.long 0x64d90f0a,0x64d90f0a +.long 0x21a65c68,0x21a65c68 +.long 0xd1545b9b,0xd1545b9b +.long 0x3a2e3624,0x3a2e3624 +.long 0xb1670a0c,0xb1670a0c +.long 0x0fe75793,0x0fe75793 +.long 0xd296eeb4,0xd296eeb4 +.long 0x9e919b1b,0x9e919b1b +.long 0x4fc5c080,0x4fc5c080 +.long 0xa220dc61,0xa220dc61 +.long 0x694b775a,0x694b775a +.long 0x161a121c,0x161a121c +.long 0x0aba93e2,0x0aba93e2 +.long 0xe52aa0c0,0xe52aa0c0 +.long 0x43e0223c,0x43e0223c +.long 0x1d171b12,0x1d171b12 +.long 0x0b0d090e,0x0b0d090e +.long 0xadc78bf2,0xadc78bf2 +.long 0xb9a8b62d,0xb9a8b62d +.long 0xc8a91e14,0xc8a91e14 +.long 0x8519f157,0x8519f157 +.long 0x4c0775af,0x4c0775af +.long 0xbbdd99ee,0xbbdd99ee +.long 0xfd607fa3,0xfd607fa3 +.long 0x9f2601f7,0x9f2601f7 +.long 0xbcf5725c,0xbcf5725c +.long 0xc53b6644,0xc53b6644 +.long 0x347efb5b,0x347efb5b +.long 0x7629438b,0x7629438b +.long 0xdcc623cb,0xdcc623cb +.long 0x68fcedb6,0x68fcedb6 +.long 0x63f1e4b8,0x63f1e4b8 +.long 0xcadc31d7,0xcadc31d7 +.long 0x10856342,0x10856342 +.long 0x40229713,0x40229713 +.long 0x2011c684,0x2011c684 +.long 0x7d244a85,0x7d244a85 +.long 0xf83dbbd2,0xf83dbbd2 +.long 0x1132f9ae,0x1132f9ae +.long 0x6da129c7,0x6da129c7 +.long 0x4b2f9e1d,0x4b2f9e1d +.long 0xf330b2dc,0xf330b2dc +.long 0xec52860d,0xec52860d +.long 0xd0e3c177,0xd0e3c177 +.long 0x6c16b32b,0x6c16b32b +.long 0x99b970a9,0x99b970a9 +.long 0xfa489411,0xfa489411 +.long 0x2264e947,0x2264e947 +.long 0xc48cfca8,0xc48cfca8 +.long 0x1a3ff0a0,0x1a3ff0a0 +.long 0xd82c7d56,0xd82c7d56 +.long 0xef903322,0xef903322 +.long 0xc74e4987,0xc74e4987 +.long 0xc1d138d9,0xc1d138d9 +.long 0xfea2ca8c,0xfea2ca8c +.long 0x360bd498,0x360bd498 +.long 0xcf81f5a6,0xcf81f5a6 +.long 0x28de7aa5,0x28de7aa5 +.long 0x268eb7da,0x268eb7da +.long 0xa4bfad3f,0xa4bfad3f +.long 0xe49d3a2c,0xe49d3a2c +.long 0x0d927850,0x0d927850 +.long 0x9bcc5f6a,0x9bcc5f6a +.long 0x62467e54,0x62467e54 +.long 0xc2138df6,0xc2138df6 +.long 0xe8b8d890,0xe8b8d890 +.long 0x5ef7392e,0x5ef7392e +.long 0xf5afc382,0xf5afc382 +.long 0xbe805d9f,0xbe805d9f +.long 0x7c93d069,0x7c93d069 +.long 0xa92dd56f,0xa92dd56f +.long 0xb31225cf,0xb31225cf +.long 0x3b99acc8,0x3b99acc8 +.long 0xa77d1810,0xa77d1810 +.long 0x6e639ce8,0x6e639ce8 +.long 0x7bbb3bdb,0x7bbb3bdb +.long 0x097826cd,0x097826cd +.long 0xf418596e,0xf418596e +.long 0x01b79aec,0x01b79aec +.long 0xa89a4f83,0xa89a4f83 +.long 0x656e95e6,0x656e95e6 +.long 0x7ee6ffaa,0x7ee6ffaa +.long 0x08cfbc21,0x08cfbc21 +.long 0xe6e815ef,0xe6e815ef +.long 0xd99be7ba,0xd99be7ba +.long 0xce366f4a,0xce366f4a +.long 0xd4099fea,0xd4099fea +.long 0xd67cb029,0xd67cb029 +.long 0xafb2a431,0xafb2a431 +.long 0x31233f2a,0x31233f2a +.long 0x3094a5c6,0x3094a5c6 +.long 0xc066a235,0xc066a235 +.long 0x37bc4e74,0x37bc4e74 +.long 0xa6ca82fc,0xa6ca82fc +.long 0xb0d090e0,0xb0d090e0 +.long 0x15d8a733,0x15d8a733 +.long 0x4a9804f1,0x4a9804f1 +.long 0xf7daec41,0xf7daec41 +.long 0x0e50cd7f,0x0e50cd7f +.long 0x2ff69117,0x2ff69117 +.long 0x8dd64d76,0x8dd64d76 +.long 0x4db0ef43,0x4db0ef43 +.long 0x544daacc,0x544daacc +.long 0xdf0496e4,0xdf0496e4 +.long 0xe3b5d19e,0xe3b5d19e +.long 0x1b886a4c,0x1b886a4c +.long 0xb81f2cc1,0xb81f2cc1 +.long 0x7f516546,0x7f516546 +.long 0x04ea5e9d,0x04ea5e9d +.long 0x5d358c01,0x5d358c01 +.long 0x737487fa,0x737487fa +.long 0x2e410bfb,0x2e410bfb +.long 0x5a1d67b3,0x5a1d67b3 +.long 0x52d2db92,0x52d2db92 +.long 0x335610e9,0x335610e9 +.long 0x1347d66d,0x1347d66d +.long 0x8c61d79a,0x8c61d79a +.long 0x7a0ca137,0x7a0ca137 +.long 0x8e14f859,0x8e14f859 +.long 0x893c13eb,0x893c13eb +.long 0xee27a9ce,0xee27a9ce +.long 0x35c961b7,0x35c961b7 +.long 0xede51ce1,0xede51ce1 +.long 0x3cb1477a,0x3cb1477a +.long 0x59dfd29c,0x59dfd29c +.long 0x3f73f255,0x3f73f255 +.long 0x79ce1418,0x79ce1418 +.long 0xbf37c773,0xbf37c773 +.long 0xeacdf753,0xeacdf753 +.long 0x5baafd5f,0x5baafd5f +.long 0x146f3ddf,0x146f3ddf +.long 0x86db4478,0x86db4478 +.long 0x81f3afca,0x81f3afca +.long 0x3ec468b9,0x3ec468b9 +.long 0x2c342438,0x2c342438 +.long 0x5f40a3c2,0x5f40a3c2 +.long 0x72c31d16,0x72c31d16 +.long 0x0c25e2bc,0x0c25e2bc +.long 0x8b493c28,0x8b493c28 +.long 0x41950dff,0x41950dff +.long 0x7101a839,0x7101a839 +.long 0xdeb30c08,0xdeb30c08 +.long 0x9ce4b4d8,0x9ce4b4d8 +.long 0x90c15664,0x90c15664 +.long 0x6184cb7b,0x6184cb7b +.long 0x70b632d5,0x70b632d5 +.long 0x745c6c48,0x745c6c48 +.long 0x4257b8d0,0x4257b8d0 +.byte 0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38 +.byte 0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb +.byte 0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87 +.byte 0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb +.byte 0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d +.byte 0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e +.byte 0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2 +.byte 0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25 +.byte 0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16 +.byte 0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92 +.byte 0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda +.byte 0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84 +.byte 0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a +.byte 0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06 +.byte 0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02 +.byte 0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b +.byte 0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea +.byte 0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73 +.byte 0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85 +.byte 0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e +.byte 0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89 +.byte 0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b +.byte 0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20 +.byte 0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4 +.byte 0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31 +.byte 0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f +.byte 0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d +.byte 0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef +.byte 0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0 +.byte 0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61 +.byte 0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26 +.byte 0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d +.long 0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe +.long 0x1b1b1b1b, 0x1b1b1b1b, 0, 0 +.byte 0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38 +.byte 0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb +.byte 0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87 +.byte 0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb +.byte 0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d +.byte 0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e +.byte 0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2 +.byte 0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25 +.byte 0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16 +.byte 0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92 +.byte 0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda +.byte 0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84 +.byte 0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a +.byte 0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06 +.byte 0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02 +.byte 0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b +.byte 0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea +.byte 0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73 +.byte 0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85 +.byte 0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e +.byte 0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89 +.byte 0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b +.byte 0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20 +.byte 0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4 +.byte 0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31 +.byte 0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f +.byte 0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d +.byte 0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef +.byte 0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0 +.byte 0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61 +.byte 0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26 +.byte 0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d +.long 0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe +.long 0x1b1b1b1b, 0x1b1b1b1b, 0, 0 +.byte 0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38 +.byte 0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb +.byte 0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87 +.byte 0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb +.byte 0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d +.byte 0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e +.byte 0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2 +.byte 0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25 +.byte 0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16 +.byte 0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92 +.byte 0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda +.byte 0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84 +.byte 0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a +.byte 0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06 +.byte 0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02 +.byte 0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b +.byte 0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea +.byte 0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73 +.byte 0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85 +.byte 0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e +.byte 0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89 +.byte 0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b +.byte 0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20 +.byte 0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4 +.byte 0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31 +.byte 0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f +.byte 0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d +.byte 0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef +.byte 0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0 +.byte 0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61 +.byte 0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26 +.byte 0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d +.long 0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe +.long 0x1b1b1b1b, 0x1b1b1b1b, 0, 0 +.byte 0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38 +.byte 0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb +.byte 0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87 +.byte 0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb +.byte 0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d +.byte 0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e +.byte 0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2 +.byte 0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25 +.byte 0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16 +.byte 0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92 +.byte 0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda +.byte 0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84 +.byte 0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a +.byte 0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06 +.byte 0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02 +.byte 0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b +.byte 0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea +.byte 0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73 +.byte 0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85 +.byte 0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e +.byte 0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89 +.byte 0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b +.byte 0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20 +.byte 0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4 +.byte 0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31 +.byte 0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f +.byte 0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d +.byte 0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef +.byte 0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0 +.byte 0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61 +.byte 0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26 +.byte 0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d +.long 0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe +.long 0x1b1b1b1b, 0x1b1b1b1b, 0, 0 +.byte 65,69,83,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 +.p2align 6 + +.def block_se_handler; .scl 3; .type 32; .endef +.p2align 4 +block_se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + movq 8(%r9),%rsi + movq 56(%r9),%r11 + + movl 0(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jb .Lin_block_prologue + + movq 152(%r8),%rax + + movl 4(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jae .Lin_block_prologue + + movq 24(%rax),%rax + leaq 48(%rax),%rax + + movq -8(%rax),%rbx + movq -16(%rax),%rbp + movq -24(%rax),%r12 + movq -32(%rax),%r13 + movq -40(%rax),%r14 + movq -48(%rax),%r15 + movq %rbx,144(%r8) + movq %rbp,160(%r8) + movq %r12,216(%r8) + movq %r13,224(%r8) + movq %r14,232(%r8) + movq %r15,240(%r8) + +.Lin_block_prologue: + movq 8(%rax),%rdi + movq 16(%rax),%rsi + movq %rax,152(%r8) + movq %rsi,168(%r8) + movq %rdi,176(%r8) + + jmp .Lcommon_seh_exit + + +.def key_se_handler; .scl 3; .type 32; .endef +.p2align 4 +key_se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + movq 8(%r9),%rsi + movq 56(%r9),%r11 + + movl 0(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jb .Lin_key_prologue + + movq 152(%r8),%rax + + movl 4(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jae .Lin_key_prologue + + leaq 56(%rax),%rax + + movq -8(%rax),%rbx + movq -16(%rax),%rbp + movq -24(%rax),%r12 + movq -32(%rax),%r13 + movq -40(%rax),%r14 + movq -48(%rax),%r15 + movq %rbx,144(%r8) + movq %rbp,160(%r8) + movq %r12,216(%r8) + movq %r13,224(%r8) + movq %r14,232(%r8) + movq %r15,240(%r8) + +.Lin_key_prologue: + movq 8(%rax),%rdi + movq 16(%rax),%rsi + movq %rax,152(%r8) + movq %rsi,168(%r8) + movq %rdi,176(%r8) + + jmp .Lcommon_seh_exit + + +.def cbc_se_handler; .scl 3; .type 32; .endef +.p2align 4 +cbc_se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + leaq .Lcbc_prologue(%rip),%r10 + cmpq %r10,%rbx + jb .Lin_cbc_prologue + + leaq .Lcbc_fast_body(%rip),%r10 + cmpq %r10,%rbx + jb .Lin_cbc_frame_setup + + leaq .Lcbc_slow_prologue(%rip),%r10 + cmpq %r10,%rbx + jb .Lin_cbc_body + + leaq .Lcbc_slow_body(%rip),%r10 + cmpq %r10,%rbx + jb .Lin_cbc_frame_setup + +.Lin_cbc_body: + movq 152(%r8),%rax + + leaq .Lcbc_epilogue(%rip),%r10 + cmpq %r10,%rbx + jae .Lin_cbc_prologue + + leaq 8(%rax),%rax + + leaq .Lcbc_popfq(%rip),%r10 + cmpq %r10,%rbx + jae .Lin_cbc_prologue + + movq 8(%rax),%rax + leaq 56(%rax),%rax + +.Lin_cbc_frame_setup: + movq -16(%rax),%rbx + movq -24(%rax),%rbp + movq -32(%rax),%r12 + movq -40(%rax),%r13 + movq -48(%rax),%r14 + movq -56(%rax),%r15 + movq %rbx,144(%r8) + movq %rbp,160(%r8) + movq %r12,216(%r8) + movq %r13,224(%r8) + movq %r14,232(%r8) + movq %r15,240(%r8) + +.Lin_cbc_prologue: + movq 8(%rax),%rdi + movq 16(%rax),%rsi + movq %rax,152(%r8) + movq %rsi,168(%r8) + movq %rdi,176(%r8) + +.Lcommon_seh_exit: + + movq 40(%r9),%rdi + movq %r8,%rsi + movl $154,%ecx +.long 0xa548f3fc + + movq %r9,%rsi + xorq %rcx,%rcx + movq 8(%rsi),%rdx + movq 0(%rsi),%r8 + movq 16(%rsi),%r9 + movq 40(%rsi),%r10 + leaq 56(%rsi),%r11 + leaq 24(%rsi),%r12 + movq %r10,32(%rsp) + movq %r11,40(%rsp) + movq %r12,48(%rsp) + movq %rcx,56(%rsp) + call *__imp_RtlVirtualUnwind(%rip) + + movl $1,%eax + addq $64,%rsp + popfq + popq %r15 + popq %r14 + popq %r13 + popq %r12 + popq %rbp + popq %rbx + popq %rdi + popq %rsi + retq + + +.section .pdata +.p2align 2 +.rva .LSEH_begin_AES_encrypt +.rva .LSEH_end_AES_encrypt +.rva .LSEH_info_AES_encrypt + +.rva .LSEH_begin_AES_decrypt +.rva .LSEH_end_AES_decrypt +.rva .LSEH_info_AES_decrypt + +.rva .LSEH_begin_AES_set_encrypt_key +.rva .LSEH_end_AES_set_encrypt_key +.rva .LSEH_info_AES_set_encrypt_key + +.rva .LSEH_begin_AES_set_decrypt_key +.rva .LSEH_end_AES_set_decrypt_key +.rva .LSEH_info_AES_set_decrypt_key + +.rva .LSEH_begin_AES_cbc_encrypt +.rva .LSEH_end_AES_cbc_encrypt +.rva .LSEH_info_AES_cbc_encrypt + +.section .xdata +.p2align 3 +.LSEH_info_AES_encrypt: +.byte 9,0,0,0 +.rva block_se_handler +.rva .Lenc_prologue,.Lenc_epilogue +.LSEH_info_AES_decrypt: +.byte 9,0,0,0 +.rva block_se_handler +.rva .Ldec_prologue,.Ldec_epilogue +.LSEH_info_AES_set_encrypt_key: +.byte 9,0,0,0 +.rva key_se_handler +.rva .Lenc_key_prologue,.Lenc_key_epilogue +.LSEH_info_AES_set_decrypt_key: +.byte 9,0,0,0 +.rva key_se_handler +.rva .Ldec_key_prologue,.Ldec_key_epilogue +.LSEH_info_AES_cbc_encrypt: +.byte 9,0,0,0 +.rva cbc_se_handler diff --git a/crypto/aes/aes_wrap.c b/crypto/aes/aes_wrap.c index ac2f83a9..b30630fe 100644 --- a/crypto/aes/aes_wrap.c +++ b/crypto/aes/aes_wrap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes_wrap.c,v 1.10 2015/09/10 15:56:24 jsing Exp $ */ +/* $OpenBSD: aes_wrap.c,v 1.12 2018/11/07 18:31:16 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -66,11 +66,12 @@ AES_wrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, { unsigned char *A, B[16], *R; unsigned int i, j, t; - if ((inlen & 0x7) || (inlen < 8)) + + if ((inlen & 0x7) || (inlen < 16)) return -1; A = B; t = 1; - memcpy(out + 8, in, inlen); + memmove(out + 8, in, inlen); if (!iv) iv = default_iv; @@ -100,15 +101,14 @@ AES_unwrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, { unsigned char *A, B[16], *R; unsigned int i, j, t; - inlen -= 8; - if (inlen & 0x7) - return -1; - if (inlen < 8) + + if ((inlen & 0x7) || (inlen < 24)) return -1; + inlen -= 8; A = B; t = 6 * (inlen >> 3); memcpy(A, in, 8); - memcpy(out, in + 8, inlen); + memmove(out, in + 8, inlen); for (j = 0; j < 6; j++) { R = out + inlen - 8; for (i = 0; i < inlen; i += 8, t--, R -= 8) { diff --git a/crypto/aes/aesni-elf-x86_64.S b/crypto/aes/aesni-elf-x86_64.S index 613ecfa6..3b3dabf8 100644 --- a/crypto/aes/aesni-elf-x86_64.S +++ b/crypto/aes/aesni-elf-x86_64.S @@ -18,7 +18,7 @@ aesni_encrypt: jnz .Loop_enc1_1 aesenclast %xmm1,%xmm2 movups %xmm2,(%rsi) - .byte 0xf3,0xc3 + retq .size aesni_encrypt,.-aesni_encrypt .globl aesni_decrypt @@ -39,7 +39,7 @@ aesni_decrypt: jnz .Loop_dec1_2 aesdeclast %xmm1,%xmm2 movups %xmm2,(%rsi) - .byte 0xf3,0xc3 + retq .size aesni_decrypt, .-aesni_decrypt .type _aesni_encrypt3,@function .align 16 @@ -72,7 +72,7 @@ _aesni_encrypt3: aesenclast %xmm0,%xmm2 aesenclast %xmm0,%xmm3 aesenclast %xmm0,%xmm4 - .byte 0xf3,0xc3 + retq .size _aesni_encrypt3,.-_aesni_encrypt3 .type _aesni_decrypt3,@function .align 16 @@ -105,7 +105,7 @@ _aesni_decrypt3: aesdeclast %xmm0,%xmm2 aesdeclast %xmm0,%xmm3 aesdeclast %xmm0,%xmm4 - .byte 0xf3,0xc3 + retq .size _aesni_decrypt3,.-_aesni_decrypt3 .type _aesni_encrypt4,@function .align 16 @@ -143,7 +143,7 @@ _aesni_encrypt4: aesenclast %xmm0,%xmm3 aesenclast %xmm0,%xmm4 aesenclast %xmm0,%xmm5 - .byte 0xf3,0xc3 + retq .size _aesni_encrypt4,.-_aesni_encrypt4 .type _aesni_decrypt4,@function .align 16 @@ -181,7 +181,7 @@ _aesni_decrypt4: aesdeclast %xmm0,%xmm3 aesdeclast %xmm0,%xmm4 aesdeclast %xmm0,%xmm5 - .byte 0xf3,0xc3 + retq .size _aesni_decrypt4,.-_aesni_decrypt4 .type _aesni_encrypt6,@function .align 16 @@ -238,7 +238,7 @@ _aesni_encrypt6: aesenclast %xmm0,%xmm5 aesenclast %xmm0,%xmm6 aesenclast %xmm0,%xmm7 - .byte 0xf3,0xc3 + retq .size _aesni_encrypt6,.-_aesni_encrypt6 .type _aesni_decrypt6,@function .align 16 @@ -295,7 +295,7 @@ _aesni_decrypt6: aesdeclast %xmm0,%xmm5 aesdeclast %xmm0,%xmm6 aesdeclast %xmm0,%xmm7 - .byte 0xf3,0xc3 + retq .size _aesni_decrypt6,.-_aesni_decrypt6 .type _aesni_encrypt8,@function .align 16 @@ -365,7 +365,7 @@ _aesni_encrypt8: aesenclast %xmm0,%xmm7 aesenclast %xmm0,%xmm8 aesenclast %xmm0,%xmm9 - .byte 0xf3,0xc3 + retq .size _aesni_encrypt8,.-_aesni_encrypt8 .type _aesni_decrypt8,@function .align 16 @@ -435,7 +435,7 @@ _aesni_decrypt8: aesdeclast %xmm0,%xmm7 aesdeclast %xmm0,%xmm8 aesdeclast %xmm0,%xmm9 - .byte 0xf3,0xc3 + retq .size _aesni_decrypt8,.-_aesni_decrypt8 .globl aesni_ecb_encrypt .type aesni_ecb_encrypt,@function @@ -737,7 +737,7 @@ aesni_ecb_encrypt: movups %xmm7,80(%rsi) .Lecb_ret: - .byte 0xf3,0xc3 + retq .size aesni_ecb_encrypt,.-aesni_ecb_encrypt .globl aesni_ccm64_encrypt_blocks .type aesni_ccm64_encrypt_blocks,@function @@ -794,7 +794,7 @@ aesni_ccm64_encrypt_blocks: jnz .Lccm64_enc_outer movups %xmm3,(%r9) - .byte 0xf3,0xc3 + retq .size aesni_ccm64_encrypt_blocks,.-aesni_ccm64_encrypt_blocks .globl aesni_ccm64_decrypt_blocks .type aesni_ccm64_decrypt_blocks,@function @@ -881,7 +881,7 @@ aesni_ccm64_decrypt_blocks: jnz .Loop_enc1_6 aesenclast %xmm1,%xmm3 movups %xmm3,(%r9) - .byte 0xf3,0xc3 + retq .size aesni_ccm64_decrypt_blocks,.-aesni_ccm64_decrypt_blocks .globl aesni_ctr32_encrypt_blocks .type aesni_ctr32_encrypt_blocks,@function @@ -1129,7 +1129,7 @@ aesni_ctr32_encrypt_blocks: movups %xmm11,48(%rsi) .Lctr32_done: - .byte 0xf3,0xc3 + retq .size aesni_ctr32_encrypt_blocks,.-aesni_ctr32_encrypt_blocks .globl aesni_xts_encrypt .type aesni_xts_encrypt,@function @@ -1525,7 +1525,7 @@ aesni_xts_encrypt: .Lxts_enc_ret: leaq 104(%rsp),%rsp .Lxts_enc_epilogue: - .byte 0xf3,0xc3 + retq .size aesni_xts_encrypt,.-aesni_xts_encrypt .globl aesni_xts_decrypt .type aesni_xts_decrypt,@function @@ -1965,7 +1965,7 @@ aesni_xts_decrypt: .Lxts_dec_ret: leaq 104(%rsp),%rsp .Lxts_dec_epilogue: - .byte 0xf3,0xc3 + retq .size aesni_xts_decrypt,.-aesni_xts_decrypt .globl aesni_cbc_encrypt .type aesni_cbc_encrypt,@function @@ -2290,7 +2290,7 @@ aesni_cbc_encrypt: .Lcbc_dec_ret: .Lcbc_ret: - .byte 0xf3,0xc3 + retq .size aesni_cbc_encrypt,.-aesni_cbc_encrypt .globl aesni_set_decrypt_key .type aesni_set_decrypt_key,@function @@ -2327,7 +2327,7 @@ aesni_set_decrypt_key: movups %xmm0,(%rdi) .Ldec_key_ret: addq $8,%rsp - .byte 0xf3,0xc3 + retq .LSEH_end_set_decrypt_key: .size aesni_set_decrypt_key,.-aesni_set_decrypt_key .globl aesni_set_encrypt_key @@ -2449,7 +2449,7 @@ __aesni_set_encrypt_key: movq $-2,%rax .Lenc_key_ret: addq $8,%rsp - .byte 0xf3,0xc3 + retq .LSEH_end_set_encrypt_key: .align 16 @@ -2463,7 +2463,7 @@ __aesni_set_encrypt_key: xorps %xmm4,%xmm0 shufps $255,%xmm1,%xmm1 xorps %xmm1,%xmm0 - .byte 0xf3,0xc3 + retq .align 16 .Lkey_expansion_192a: @@ -2483,7 +2483,7 @@ __aesni_set_encrypt_key: pxor %xmm1,%xmm0 pshufd $255,%xmm0,%xmm3 pxor %xmm3,%xmm2 - .byte 0xf3,0xc3 + retq .align 16 .Lkey_expansion_192b: @@ -2506,7 +2506,7 @@ __aesni_set_encrypt_key: xorps %xmm4,%xmm0 shufps $255,%xmm1,%xmm1 xorps %xmm1,%xmm0 - .byte 0xf3,0xc3 + retq .align 16 .Lkey_expansion_256b: @@ -2519,7 +2519,7 @@ __aesni_set_encrypt_key: xorps %xmm4,%xmm2 shufps $170,%xmm1,%xmm1 xorps %xmm1,%xmm2 - .byte 0xf3,0xc3 + retq .size aesni_set_encrypt_key,.-aesni_set_encrypt_key .size __aesni_set_encrypt_key,.-__aesni_set_encrypt_key .align 64 diff --git a/crypto/aes/aesni-macosx-x86_64.S b/crypto/aes/aesni-macosx-x86_64.S index 581b0794..6b3216b8 100644 --- a/crypto/aes/aesni-macosx-x86_64.S +++ b/crypto/aes/aesni-macosx-x86_64.S @@ -18,7 +18,7 @@ L$oop_enc1_1: jnz L$oop_enc1_1 aesenclast %xmm1,%xmm2 movups %xmm2,(%rsi) - .byte 0xf3,0xc3 + retq .globl _aesni_decrypt @@ -39,7 +39,7 @@ L$oop_dec1_2: jnz L$oop_dec1_2 aesdeclast %xmm1,%xmm2 movups %xmm2,(%rsi) - .byte 0xf3,0xc3 + retq .p2align 4 @@ -72,7 +72,7 @@ L$enc_loop3: aesenclast %xmm0,%xmm2 aesenclast %xmm0,%xmm3 aesenclast %xmm0,%xmm4 - .byte 0xf3,0xc3 + retq .p2align 4 @@ -105,7 +105,7 @@ L$dec_loop3: aesdeclast %xmm0,%xmm2 aesdeclast %xmm0,%xmm3 aesdeclast %xmm0,%xmm4 - .byte 0xf3,0xc3 + retq .p2align 4 @@ -143,7 +143,7 @@ L$enc_loop4: aesenclast %xmm0,%xmm3 aesenclast %xmm0,%xmm4 aesenclast %xmm0,%xmm5 - .byte 0xf3,0xc3 + retq .p2align 4 @@ -181,7 +181,7 @@ L$dec_loop4: aesdeclast %xmm0,%xmm3 aesdeclast %xmm0,%xmm4 aesdeclast %xmm0,%xmm5 - .byte 0xf3,0xc3 + retq .p2align 4 @@ -238,7 +238,7 @@ L$enc_loop6_enter: aesenclast %xmm0,%xmm5 aesenclast %xmm0,%xmm6 aesenclast %xmm0,%xmm7 - .byte 0xf3,0xc3 + retq .p2align 4 @@ -295,7 +295,7 @@ L$dec_loop6_enter: aesdeclast %xmm0,%xmm5 aesdeclast %xmm0,%xmm6 aesdeclast %xmm0,%xmm7 - .byte 0xf3,0xc3 + retq .p2align 4 @@ -365,7 +365,7 @@ L$enc_loop8_enter: aesenclast %xmm0,%xmm7 aesenclast %xmm0,%xmm8 aesenclast %xmm0,%xmm9 - .byte 0xf3,0xc3 + retq .p2align 4 @@ -435,7 +435,7 @@ L$dec_loop8_enter: aesdeclast %xmm0,%xmm7 aesdeclast %xmm0,%xmm8 aesdeclast %xmm0,%xmm9 - .byte 0xf3,0xc3 + retq .globl _aesni_ecb_encrypt @@ -737,7 +737,7 @@ L$ecb_dec_six: movups %xmm7,80(%rsi) L$ecb_ret: - .byte 0xf3,0xc3 + retq .globl _aesni_ccm64_encrypt_blocks @@ -794,7 +794,7 @@ L$ccm64_enc2_loop: jnz L$ccm64_enc_outer movups %xmm3,(%r9) - .byte 0xf3,0xc3 + retq .globl _aesni_ccm64_decrypt_blocks @@ -881,7 +881,7 @@ L$oop_enc1_6: jnz L$oop_enc1_6 aesenclast %xmm1,%xmm3 movups %xmm3,(%r9) - .byte 0xf3,0xc3 + retq .globl _aesni_ctr32_encrypt_blocks @@ -1129,7 +1129,7 @@ L$ctr32_four: movups %xmm11,48(%rsi) L$ctr32_done: - .byte 0xf3,0xc3 + retq .globl _aesni_xts_encrypt @@ -1525,7 +1525,7 @@ L$oop_enc1_10: L$xts_enc_ret: leaq 104(%rsp),%rsp L$xts_enc_epilogue: - .byte 0xf3,0xc3 + retq .globl _aesni_xts_decrypt @@ -1965,7 +1965,7 @@ L$oop_dec1_14: L$xts_dec_ret: leaq 104(%rsp),%rsp L$xts_dec_epilogue: - .byte 0xf3,0xc3 + retq .globl _aesni_cbc_encrypt @@ -2290,7 +2290,7 @@ L$cbc_dec_tail_partial: L$cbc_dec_ret: L$cbc_ret: - .byte 0xf3,0xc3 + retq .globl _aesni_set_decrypt_key @@ -2327,7 +2327,7 @@ L$dec_key_inverse: movups %xmm0,(%rdi) L$dec_key_ret: addq $8,%rsp - .byte 0xf3,0xc3 + retq L$SEH_end_set_decrypt_key: .globl _aesni_set_encrypt_key @@ -2449,7 +2449,7 @@ L$bad_keybits: movq $-2,%rax L$enc_key_ret: addq $8,%rsp - .byte 0xf3,0xc3 + retq L$SEH_end_set_encrypt_key: .p2align 4 @@ -2463,7 +2463,7 @@ L$key_expansion_128_cold: xorps %xmm4,%xmm0 shufps $255,%xmm1,%xmm1 xorps %xmm1,%xmm0 - .byte 0xf3,0xc3 + retq .p2align 4 L$key_expansion_192a: @@ -2483,7 +2483,7 @@ L$key_expansion_192b_warm: pxor %xmm1,%xmm0 pshufd $255,%xmm0,%xmm3 pxor %xmm3,%xmm2 - .byte 0xf3,0xc3 + retq .p2align 4 L$key_expansion_192b: @@ -2506,7 +2506,7 @@ L$key_expansion_256a_cold: xorps %xmm4,%xmm0 shufps $255,%xmm1,%xmm1 xorps %xmm1,%xmm0 - .byte 0xf3,0xc3 + retq .p2align 4 L$key_expansion_256b: @@ -2519,7 +2519,7 @@ L$key_expansion_256b: xorps %xmm4,%xmm2 shufps $170,%xmm1,%xmm1 xorps %xmm1,%xmm2 - .byte 0xf3,0xc3 + retq .p2align 6 diff --git a/crypto/aes/aesni-masm-x86_64.S b/crypto/aes/aesni-masm-x86_64.S new file mode 100644 index 00000000..c06b5ab6 --- /dev/null +++ b/crypto/aes/aesni-masm-x86_64.S @@ -0,0 +1,3031 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' +PUBLIC aesni_encrypt + +ALIGN 16 +aesni_encrypt PROC PUBLIC + movups xmm2,XMMWORD PTR[rcx] + mov eax,DWORD PTR[240+r8] + movups xmm0,XMMWORD PTR[r8] + movups xmm1,XMMWORD PTR[16+r8] + lea r8,QWORD PTR[32+r8] + xorps xmm2,xmm0 +$L$oop_enc1_1:: + aesenc xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[r8] + lea r8,QWORD PTR[16+r8] + jnz $L$oop_enc1_1 + aesenclast xmm2,xmm1 + movups XMMWORD PTR[rdx],xmm2 + DB 0F3h,0C3h ;repret +aesni_encrypt ENDP + +PUBLIC aesni_decrypt + +ALIGN 16 +aesni_decrypt PROC PUBLIC + movups xmm2,XMMWORD PTR[rcx] + mov eax,DWORD PTR[240+r8] + movups xmm0,XMMWORD PTR[r8] + movups xmm1,XMMWORD PTR[16+r8] + lea r8,QWORD PTR[32+r8] + xorps xmm2,xmm0 +$L$oop_dec1_2:: + aesdec xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[r8] + lea r8,QWORD PTR[16+r8] + jnz $L$oop_dec1_2 + aesdeclast xmm2,xmm1 + movups XMMWORD PTR[rdx],xmm2 + DB 0F3h,0C3h ;repret +aesni_decrypt ENDP + +ALIGN 16 +_aesni_encrypt3 PROC PRIVATE + movups xmm0,XMMWORD PTR[rcx] + shr eax,1 + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 + xorps xmm3,xmm0 + xorps xmm4,xmm0 + movups xmm0,XMMWORD PTR[rcx] + +$L$enc_loop3:: + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + dec eax + aesenc xmm4,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + aesenc xmm2,xmm0 + aesenc xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesenc xmm4,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$enc_loop3 + + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + aesenc xmm4,xmm1 + aesenclast xmm2,xmm0 + aesenclast xmm3,xmm0 + aesenclast xmm4,xmm0 + DB 0F3h,0C3h ;repret +_aesni_encrypt3 ENDP + +ALIGN 16 +_aesni_decrypt3 PROC PRIVATE + movups xmm0,XMMWORD PTR[rcx] + shr eax,1 + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 + xorps xmm3,xmm0 + xorps xmm4,xmm0 + movups xmm0,XMMWORD PTR[rcx] + +$L$dec_loop3:: + aesdec xmm2,xmm1 + aesdec xmm3,xmm1 + dec eax + aesdec xmm4,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + aesdec xmm2,xmm0 + aesdec xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesdec xmm4,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$dec_loop3 + + aesdec xmm2,xmm1 + aesdec xmm3,xmm1 + aesdec xmm4,xmm1 + aesdeclast xmm2,xmm0 + aesdeclast xmm3,xmm0 + aesdeclast xmm4,xmm0 + DB 0F3h,0C3h ;repret +_aesni_decrypt3 ENDP + +ALIGN 16 +_aesni_encrypt4 PROC PRIVATE + movups xmm0,XMMWORD PTR[rcx] + shr eax,1 + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 + xorps xmm3,xmm0 + xorps xmm4,xmm0 + xorps xmm5,xmm0 + movups xmm0,XMMWORD PTR[rcx] + +$L$enc_loop4:: + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + dec eax + aesenc xmm4,xmm1 + aesenc xmm5,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + aesenc xmm2,xmm0 + aesenc xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesenc xmm4,xmm0 + aesenc xmm5,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$enc_loop4 + + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + aesenc xmm4,xmm1 + aesenc xmm5,xmm1 + aesenclast xmm2,xmm0 + aesenclast xmm3,xmm0 + aesenclast xmm4,xmm0 + aesenclast xmm5,xmm0 + DB 0F3h,0C3h ;repret +_aesni_encrypt4 ENDP + +ALIGN 16 +_aesni_decrypt4 PROC PRIVATE + movups xmm0,XMMWORD PTR[rcx] + shr eax,1 + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 + xorps xmm3,xmm0 + xorps xmm4,xmm0 + xorps xmm5,xmm0 + movups xmm0,XMMWORD PTR[rcx] + +$L$dec_loop4:: + aesdec xmm2,xmm1 + aesdec xmm3,xmm1 + dec eax + aesdec xmm4,xmm1 + aesdec xmm5,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + aesdec xmm2,xmm0 + aesdec xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesdec xmm4,xmm0 + aesdec xmm5,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$dec_loop4 + + aesdec xmm2,xmm1 + aesdec xmm3,xmm1 + aesdec xmm4,xmm1 + aesdec xmm5,xmm1 + aesdeclast xmm2,xmm0 + aesdeclast xmm3,xmm0 + aesdeclast xmm4,xmm0 + aesdeclast xmm5,xmm0 + DB 0F3h,0C3h ;repret +_aesni_decrypt4 ENDP + +ALIGN 16 +_aesni_encrypt6 PROC PRIVATE + movups xmm0,XMMWORD PTR[rcx] + shr eax,1 + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 + pxor xmm3,xmm0 + aesenc xmm2,xmm1 + pxor xmm4,xmm0 + aesenc xmm3,xmm1 + pxor xmm5,xmm0 + aesenc xmm4,xmm1 + pxor xmm6,xmm0 + aesenc xmm5,xmm1 + pxor xmm7,xmm0 + dec eax + aesenc xmm6,xmm1 + movups xmm0,XMMWORD PTR[rcx] + aesenc xmm7,xmm1 + jmp $L$enc_loop6_enter +ALIGN 16 +$L$enc_loop6:: + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + dec eax + aesenc xmm4,xmm1 + aesenc xmm5,xmm1 + aesenc xmm6,xmm1 + aesenc xmm7,xmm1 +$L$enc_loop6_enter:: + movups xmm1,XMMWORD PTR[16+rcx] + aesenc xmm2,xmm0 + aesenc xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesenc xmm4,xmm0 + aesenc xmm5,xmm0 + aesenc xmm6,xmm0 + aesenc xmm7,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$enc_loop6 + + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + aesenc xmm4,xmm1 + aesenc xmm5,xmm1 + aesenc xmm6,xmm1 + aesenc xmm7,xmm1 + aesenclast xmm2,xmm0 + aesenclast xmm3,xmm0 + aesenclast xmm4,xmm0 + aesenclast xmm5,xmm0 + aesenclast xmm6,xmm0 + aesenclast xmm7,xmm0 + DB 0F3h,0C3h ;repret +_aesni_encrypt6 ENDP + +ALIGN 16 +_aesni_decrypt6 PROC PRIVATE + movups xmm0,XMMWORD PTR[rcx] + shr eax,1 + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 + pxor xmm3,xmm0 + aesdec xmm2,xmm1 + pxor xmm4,xmm0 + aesdec xmm3,xmm1 + pxor xmm5,xmm0 + aesdec xmm4,xmm1 + pxor xmm6,xmm0 + aesdec xmm5,xmm1 + pxor xmm7,xmm0 + dec eax + aesdec xmm6,xmm1 + movups xmm0,XMMWORD PTR[rcx] + aesdec xmm7,xmm1 + jmp $L$dec_loop6_enter +ALIGN 16 +$L$dec_loop6:: + aesdec xmm2,xmm1 + aesdec xmm3,xmm1 + dec eax + aesdec xmm4,xmm1 + aesdec xmm5,xmm1 + aesdec xmm6,xmm1 + aesdec xmm7,xmm1 +$L$dec_loop6_enter:: + movups xmm1,XMMWORD PTR[16+rcx] + aesdec xmm2,xmm0 + aesdec xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesdec xmm4,xmm0 + aesdec xmm5,xmm0 + aesdec xmm6,xmm0 + aesdec xmm7,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$dec_loop6 + + aesdec xmm2,xmm1 + aesdec xmm3,xmm1 + aesdec xmm4,xmm1 + aesdec xmm5,xmm1 + aesdec xmm6,xmm1 + aesdec xmm7,xmm1 + aesdeclast xmm2,xmm0 + aesdeclast xmm3,xmm0 + aesdeclast xmm4,xmm0 + aesdeclast xmm5,xmm0 + aesdeclast xmm6,xmm0 + aesdeclast xmm7,xmm0 + DB 0F3h,0C3h ;repret +_aesni_decrypt6 ENDP + +ALIGN 16 +_aesni_encrypt8 PROC PRIVATE + movups xmm0,XMMWORD PTR[rcx] + shr eax,1 + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 + xorps xmm3,xmm0 + aesenc xmm2,xmm1 + pxor xmm4,xmm0 + aesenc xmm3,xmm1 + pxor xmm5,xmm0 + aesenc xmm4,xmm1 + pxor xmm6,xmm0 + aesenc xmm5,xmm1 + pxor xmm7,xmm0 + dec eax + aesenc xmm6,xmm1 + pxor xmm8,xmm0 + aesenc xmm7,xmm1 + pxor xmm9,xmm0 + movups xmm0,XMMWORD PTR[rcx] + aesenc xmm8,xmm1 + aesenc xmm9,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + jmp $L$enc_loop8_enter +ALIGN 16 +$L$enc_loop8:: + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + dec eax + aesenc xmm4,xmm1 + aesenc xmm5,xmm1 + aesenc xmm6,xmm1 + aesenc xmm7,xmm1 + aesenc xmm8,xmm1 + aesenc xmm9,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] +$L$enc_loop8_enter:: + aesenc xmm2,xmm0 + aesenc xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesenc xmm4,xmm0 + aesenc xmm5,xmm0 + aesenc xmm6,xmm0 + aesenc xmm7,xmm0 + aesenc xmm8,xmm0 + aesenc xmm9,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$enc_loop8 + + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + aesenc xmm4,xmm1 + aesenc xmm5,xmm1 + aesenc xmm6,xmm1 + aesenc xmm7,xmm1 + aesenc xmm8,xmm1 + aesenc xmm9,xmm1 + aesenclast xmm2,xmm0 + aesenclast xmm3,xmm0 + aesenclast xmm4,xmm0 + aesenclast xmm5,xmm0 + aesenclast xmm6,xmm0 + aesenclast xmm7,xmm0 + aesenclast xmm8,xmm0 + aesenclast xmm9,xmm0 + DB 0F3h,0C3h ;repret +_aesni_encrypt8 ENDP + +ALIGN 16 +_aesni_decrypt8 PROC PRIVATE + movups xmm0,XMMWORD PTR[rcx] + shr eax,1 + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 + xorps xmm3,xmm0 + aesdec xmm2,xmm1 + pxor xmm4,xmm0 + aesdec xmm3,xmm1 + pxor xmm5,xmm0 + aesdec xmm4,xmm1 + pxor xmm6,xmm0 + aesdec xmm5,xmm1 + pxor xmm7,xmm0 + dec eax + aesdec xmm6,xmm1 + pxor xmm8,xmm0 + aesdec xmm7,xmm1 + pxor xmm9,xmm0 + movups xmm0,XMMWORD PTR[rcx] + aesdec xmm8,xmm1 + aesdec xmm9,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + jmp $L$dec_loop8_enter +ALIGN 16 +$L$dec_loop8:: + aesdec xmm2,xmm1 + aesdec xmm3,xmm1 + dec eax + aesdec xmm4,xmm1 + aesdec xmm5,xmm1 + aesdec xmm6,xmm1 + aesdec xmm7,xmm1 + aesdec xmm8,xmm1 + aesdec xmm9,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] +$L$dec_loop8_enter:: + aesdec xmm2,xmm0 + aesdec xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesdec xmm4,xmm0 + aesdec xmm5,xmm0 + aesdec xmm6,xmm0 + aesdec xmm7,xmm0 + aesdec xmm8,xmm0 + aesdec xmm9,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$dec_loop8 + + aesdec xmm2,xmm1 + aesdec xmm3,xmm1 + aesdec xmm4,xmm1 + aesdec xmm5,xmm1 + aesdec xmm6,xmm1 + aesdec xmm7,xmm1 + aesdec xmm8,xmm1 + aesdec xmm9,xmm1 + aesdeclast xmm2,xmm0 + aesdeclast xmm3,xmm0 + aesdeclast xmm4,xmm0 + aesdeclast xmm5,xmm0 + aesdeclast xmm6,xmm0 + aesdeclast xmm7,xmm0 + aesdeclast xmm8,xmm0 + aesdeclast xmm9,xmm0 + DB 0F3h,0C3h ;repret +_aesni_decrypt8 ENDP +PUBLIC aesni_ecb_encrypt + +ALIGN 16 +aesni_ecb_encrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_aesni_ecb_encrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + + + and rdx,-16 + jz $L$ecb_ret + + mov eax,DWORD PTR[240+rcx] + movups xmm0,XMMWORD PTR[rcx] + mov r11,rcx + mov r10d,eax + test r8d,r8d + jz $L$ecb_decrypt + + cmp rdx,080h + jb $L$ecb_enc_tail + + movdqu xmm2,XMMWORD PTR[rdi] + movdqu xmm3,XMMWORD PTR[16+rdi] + movdqu xmm4,XMMWORD PTR[32+rdi] + movdqu xmm5,XMMWORD PTR[48+rdi] + movdqu xmm6,XMMWORD PTR[64+rdi] + movdqu xmm7,XMMWORD PTR[80+rdi] + movdqu xmm8,XMMWORD PTR[96+rdi] + movdqu xmm9,XMMWORD PTR[112+rdi] + lea rdi,QWORD PTR[128+rdi] + sub rdx,080h + jmp $L$ecb_enc_loop8_enter +ALIGN 16 +$L$ecb_enc_loop8:: + movups XMMWORD PTR[rsi],xmm2 + mov rcx,r11 + movdqu xmm2,XMMWORD PTR[rdi] + mov eax,r10d + movups XMMWORD PTR[16+rsi],xmm3 + movdqu xmm3,XMMWORD PTR[16+rdi] + movups XMMWORD PTR[32+rsi],xmm4 + movdqu xmm4,XMMWORD PTR[32+rdi] + movups XMMWORD PTR[48+rsi],xmm5 + movdqu xmm5,XMMWORD PTR[48+rdi] + movups XMMWORD PTR[64+rsi],xmm6 + movdqu xmm6,XMMWORD PTR[64+rdi] + movups XMMWORD PTR[80+rsi],xmm7 + movdqu xmm7,XMMWORD PTR[80+rdi] + movups XMMWORD PTR[96+rsi],xmm8 + movdqu xmm8,XMMWORD PTR[96+rdi] + movups XMMWORD PTR[112+rsi],xmm9 + lea rsi,QWORD PTR[128+rsi] + movdqu xmm9,XMMWORD PTR[112+rdi] + lea rdi,QWORD PTR[128+rdi] +$L$ecb_enc_loop8_enter:: + + call _aesni_encrypt8 + + sub rdx,080h + jnc $L$ecb_enc_loop8 + + movups XMMWORD PTR[rsi],xmm2 + mov rcx,r11 + movups XMMWORD PTR[16+rsi],xmm3 + mov eax,r10d + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + movups XMMWORD PTR[64+rsi],xmm6 + movups XMMWORD PTR[80+rsi],xmm7 + movups XMMWORD PTR[96+rsi],xmm8 + movups XMMWORD PTR[112+rsi],xmm9 + lea rsi,QWORD PTR[128+rsi] + add rdx,080h + jz $L$ecb_ret + +$L$ecb_enc_tail:: + movups xmm2,XMMWORD PTR[rdi] + cmp rdx,020h + jb $L$ecb_enc_one + movups xmm3,XMMWORD PTR[16+rdi] + je $L$ecb_enc_two + movups xmm4,XMMWORD PTR[32+rdi] + cmp rdx,040h + jb $L$ecb_enc_three + movups xmm5,XMMWORD PTR[48+rdi] + je $L$ecb_enc_four + movups xmm6,XMMWORD PTR[64+rdi] + cmp rdx,060h + jb $L$ecb_enc_five + movups xmm7,XMMWORD PTR[80+rdi] + je $L$ecb_enc_six + movdqu xmm8,XMMWORD PTR[96+rdi] + call _aesni_encrypt8 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + movups XMMWORD PTR[64+rsi],xmm6 + movups XMMWORD PTR[80+rsi],xmm7 + movups XMMWORD PTR[96+rsi],xmm8 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_enc_one:: + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 +$L$oop_enc1_3:: + aesenc xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_enc1_3 + aesenclast xmm2,xmm1 + movups XMMWORD PTR[rsi],xmm2 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_enc_two:: + xorps xmm4,xmm4 + call _aesni_encrypt3 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_enc_three:: + call _aesni_encrypt3 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_enc_four:: + call _aesni_encrypt4 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_enc_five:: + xorps xmm7,xmm7 + call _aesni_encrypt6 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + movups XMMWORD PTR[64+rsi],xmm6 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_enc_six:: + call _aesni_encrypt6 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + movups XMMWORD PTR[64+rsi],xmm6 + movups XMMWORD PTR[80+rsi],xmm7 + jmp $L$ecb_ret + +ALIGN 16 +$L$ecb_decrypt:: + cmp rdx,080h + jb $L$ecb_dec_tail + + movdqu xmm2,XMMWORD PTR[rdi] + movdqu xmm3,XMMWORD PTR[16+rdi] + movdqu xmm4,XMMWORD PTR[32+rdi] + movdqu xmm5,XMMWORD PTR[48+rdi] + movdqu xmm6,XMMWORD PTR[64+rdi] + movdqu xmm7,XMMWORD PTR[80+rdi] + movdqu xmm8,XMMWORD PTR[96+rdi] + movdqu xmm9,XMMWORD PTR[112+rdi] + lea rdi,QWORD PTR[128+rdi] + sub rdx,080h + jmp $L$ecb_dec_loop8_enter +ALIGN 16 +$L$ecb_dec_loop8:: + movups XMMWORD PTR[rsi],xmm2 + mov rcx,r11 + movdqu xmm2,XMMWORD PTR[rdi] + mov eax,r10d + movups XMMWORD PTR[16+rsi],xmm3 + movdqu xmm3,XMMWORD PTR[16+rdi] + movups XMMWORD PTR[32+rsi],xmm4 + movdqu xmm4,XMMWORD PTR[32+rdi] + movups XMMWORD PTR[48+rsi],xmm5 + movdqu xmm5,XMMWORD PTR[48+rdi] + movups XMMWORD PTR[64+rsi],xmm6 + movdqu xmm6,XMMWORD PTR[64+rdi] + movups XMMWORD PTR[80+rsi],xmm7 + movdqu xmm7,XMMWORD PTR[80+rdi] + movups XMMWORD PTR[96+rsi],xmm8 + movdqu xmm8,XMMWORD PTR[96+rdi] + movups XMMWORD PTR[112+rsi],xmm9 + lea rsi,QWORD PTR[128+rsi] + movdqu xmm9,XMMWORD PTR[112+rdi] + lea rdi,QWORD PTR[128+rdi] +$L$ecb_dec_loop8_enter:: + + call _aesni_decrypt8 + + movups xmm0,XMMWORD PTR[r11] + sub rdx,080h + jnc $L$ecb_dec_loop8 + + movups XMMWORD PTR[rsi],xmm2 + mov rcx,r11 + movups XMMWORD PTR[16+rsi],xmm3 + mov eax,r10d + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + movups XMMWORD PTR[64+rsi],xmm6 + movups XMMWORD PTR[80+rsi],xmm7 + movups XMMWORD PTR[96+rsi],xmm8 + movups XMMWORD PTR[112+rsi],xmm9 + lea rsi,QWORD PTR[128+rsi] + add rdx,080h + jz $L$ecb_ret + +$L$ecb_dec_tail:: + movups xmm2,XMMWORD PTR[rdi] + cmp rdx,020h + jb $L$ecb_dec_one + movups xmm3,XMMWORD PTR[16+rdi] + je $L$ecb_dec_two + movups xmm4,XMMWORD PTR[32+rdi] + cmp rdx,040h + jb $L$ecb_dec_three + movups xmm5,XMMWORD PTR[48+rdi] + je $L$ecb_dec_four + movups xmm6,XMMWORD PTR[64+rdi] + cmp rdx,060h + jb $L$ecb_dec_five + movups xmm7,XMMWORD PTR[80+rdi] + je $L$ecb_dec_six + movups xmm8,XMMWORD PTR[96+rdi] + movups xmm0,XMMWORD PTR[rcx] + call _aesni_decrypt8 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + movups XMMWORD PTR[64+rsi],xmm6 + movups XMMWORD PTR[80+rsi],xmm7 + movups XMMWORD PTR[96+rsi],xmm8 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_dec_one:: + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 +$L$oop_dec1_4:: + aesdec xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_dec1_4 + aesdeclast xmm2,xmm1 + movups XMMWORD PTR[rsi],xmm2 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_dec_two:: + xorps xmm4,xmm4 + call _aesni_decrypt3 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_dec_three:: + call _aesni_decrypt3 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_dec_four:: + call _aesni_decrypt4 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_dec_five:: + xorps xmm7,xmm7 + call _aesni_decrypt6 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + movups XMMWORD PTR[64+rsi],xmm6 + jmp $L$ecb_ret +ALIGN 16 +$L$ecb_dec_six:: + call _aesni_decrypt6 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + movups XMMWORD PTR[64+rsi],xmm6 + movups XMMWORD PTR[80+rsi],xmm7 + +$L$ecb_ret:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_aesni_ecb_encrypt:: +aesni_ecb_encrypt ENDP +PUBLIC aesni_ccm64_encrypt_blocks + +ALIGN 16 +aesni_ccm64_encrypt_blocks PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_aesni_ccm64_encrypt_blocks:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + lea rsp,QWORD PTR[((-88))+rsp] + movaps XMMWORD PTR[rsp],xmm6 + movaps XMMWORD PTR[16+rsp],xmm7 + movaps XMMWORD PTR[32+rsp],xmm8 + movaps XMMWORD PTR[48+rsp],xmm9 +$L$ccm64_enc_body:: + mov eax,DWORD PTR[240+rcx] + movdqu xmm9,XMMWORD PTR[r8] + movdqa xmm6,XMMWORD PTR[$L$increment64] + movdqa xmm7,XMMWORD PTR[$L$bswap_mask] + + shr eax,1 + lea r11,QWORD PTR[rcx] + movdqu xmm3,XMMWORD PTR[r9] + movdqa xmm2,xmm9 + mov r10d,eax +DB 102,68,15,56,0,207 + jmp $L$ccm64_enc_outer +ALIGN 16 +$L$ccm64_enc_outer:: + movups xmm0,XMMWORD PTR[r11] + mov eax,r10d + movups xmm8,XMMWORD PTR[rdi] + + xorps xmm2,xmm0 + movups xmm1,XMMWORD PTR[16+r11] + xorps xmm0,xmm8 + lea rcx,QWORD PTR[32+r11] + xorps xmm3,xmm0 + movups xmm0,XMMWORD PTR[rcx] + +$L$ccm64_enc2_loop:: + aesenc xmm2,xmm1 + dec eax + aesenc xmm3,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + aesenc xmm2,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesenc xmm3,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$ccm64_enc2_loop + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + paddq xmm9,xmm6 + aesenclast xmm2,xmm0 + aesenclast xmm3,xmm0 + + dec rdx + lea rdi,QWORD PTR[16+rdi] + xorps xmm8,xmm2 + movdqa xmm2,xmm9 + movups XMMWORD PTR[rsi],xmm8 + lea rsi,QWORD PTR[16+rsi] +DB 102,15,56,0,215 + jnz $L$ccm64_enc_outer + + movups XMMWORD PTR[r9],xmm3 + movaps xmm6,XMMWORD PTR[rsp] + movaps xmm7,XMMWORD PTR[16+rsp] + movaps xmm8,XMMWORD PTR[32+rsp] + movaps xmm9,XMMWORD PTR[48+rsp] + lea rsp,QWORD PTR[88+rsp] +$L$ccm64_enc_ret:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_aesni_ccm64_encrypt_blocks:: +aesni_ccm64_encrypt_blocks ENDP +PUBLIC aesni_ccm64_decrypt_blocks + +ALIGN 16 +aesni_ccm64_decrypt_blocks PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_aesni_ccm64_decrypt_blocks:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + lea rsp,QWORD PTR[((-88))+rsp] + movaps XMMWORD PTR[rsp],xmm6 + movaps XMMWORD PTR[16+rsp],xmm7 + movaps XMMWORD PTR[32+rsp],xmm8 + movaps XMMWORD PTR[48+rsp],xmm9 +$L$ccm64_dec_body:: + mov eax,DWORD PTR[240+rcx] + movups xmm9,XMMWORD PTR[r8] + movdqu xmm3,XMMWORD PTR[r9] + movdqa xmm6,XMMWORD PTR[$L$increment64] + movdqa xmm7,XMMWORD PTR[$L$bswap_mask] + + movaps xmm2,xmm9 + mov r10d,eax + mov r11,rcx +DB 102,68,15,56,0,207 + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 +$L$oop_enc1_5:: + aesenc xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_enc1_5 + aesenclast xmm2,xmm1 + movups xmm8,XMMWORD PTR[rdi] + paddq xmm9,xmm6 + lea rdi,QWORD PTR[16+rdi] + jmp $L$ccm64_dec_outer +ALIGN 16 +$L$ccm64_dec_outer:: + xorps xmm8,xmm2 + movdqa xmm2,xmm9 + mov eax,r10d + movups XMMWORD PTR[rsi],xmm8 + lea rsi,QWORD PTR[16+rsi] +DB 102,15,56,0,215 + + sub rdx,1 + jz $L$ccm64_dec_break + + movups xmm0,XMMWORD PTR[r11] + shr eax,1 + movups xmm1,XMMWORD PTR[16+r11] + xorps xmm8,xmm0 + lea rcx,QWORD PTR[32+r11] + xorps xmm2,xmm0 + xorps xmm3,xmm8 + movups xmm0,XMMWORD PTR[rcx] + +$L$ccm64_dec2_loop:: + aesenc xmm2,xmm1 + dec eax + aesenc xmm3,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + aesenc xmm2,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesenc xmm3,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$ccm64_dec2_loop + movups xmm8,XMMWORD PTR[rdi] + paddq xmm9,xmm6 + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + lea rdi,QWORD PTR[16+rdi] + aesenclast xmm2,xmm0 + aesenclast xmm3,xmm0 + jmp $L$ccm64_dec_outer + +ALIGN 16 +$L$ccm64_dec_break:: + + movups xmm0,XMMWORD PTR[r11] + movups xmm1,XMMWORD PTR[16+r11] + xorps xmm8,xmm0 + lea r11,QWORD PTR[32+r11] + xorps xmm3,xmm8 +$L$oop_enc1_6:: + aesenc xmm3,xmm1 + dec eax + movups xmm1,XMMWORD PTR[r11] + lea r11,QWORD PTR[16+r11] + jnz $L$oop_enc1_6 + aesenclast xmm3,xmm1 + movups XMMWORD PTR[r9],xmm3 + movaps xmm6,XMMWORD PTR[rsp] + movaps xmm7,XMMWORD PTR[16+rsp] + movaps xmm8,XMMWORD PTR[32+rsp] + movaps xmm9,XMMWORD PTR[48+rsp] + lea rsp,QWORD PTR[88+rsp] +$L$ccm64_dec_ret:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_aesni_ccm64_decrypt_blocks:: +aesni_ccm64_decrypt_blocks ENDP +PUBLIC aesni_ctr32_encrypt_blocks + +ALIGN 16 +aesni_ctr32_encrypt_blocks PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_aesni_ctr32_encrypt_blocks:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + + + lea rsp,QWORD PTR[((-200))+rsp] + movaps XMMWORD PTR[32+rsp],xmm6 + movaps XMMWORD PTR[48+rsp],xmm7 + movaps XMMWORD PTR[64+rsp],xmm8 + movaps XMMWORD PTR[80+rsp],xmm9 + movaps XMMWORD PTR[96+rsp],xmm10 + movaps XMMWORD PTR[112+rsp],xmm11 + movaps XMMWORD PTR[128+rsp],xmm12 + movaps XMMWORD PTR[144+rsp],xmm13 + movaps XMMWORD PTR[160+rsp],xmm14 + movaps XMMWORD PTR[176+rsp],xmm15 +$L$ctr32_body:: + cmp rdx,1 + je $L$ctr32_one_shortcut + + movdqu xmm14,XMMWORD PTR[r8] + movdqa xmm15,XMMWORD PTR[$L$bswap_mask] + xor eax,eax +DB 102,69,15,58,22,242,3 +DB 102,68,15,58,34,240,3 + + mov eax,DWORD PTR[240+rcx] + bswap r10d + pxor xmm12,xmm12 + pxor xmm13,xmm13 +DB 102,69,15,58,34,226,0 + lea r11,QWORD PTR[3+r10] +DB 102,69,15,58,34,235,0 + inc r10d +DB 102,69,15,58,34,226,1 + inc r11 +DB 102,69,15,58,34,235,1 + inc r10d +DB 102,69,15,58,34,226,2 + inc r11 +DB 102,69,15,58,34,235,2 + movdqa XMMWORD PTR[rsp],xmm12 +DB 102,69,15,56,0,231 + movdqa XMMWORD PTR[16+rsp],xmm13 +DB 102,69,15,56,0,239 + + pshufd xmm2,xmm12,192 + pshufd xmm3,xmm12,128 + pshufd xmm4,xmm12,64 + cmp rdx,6 + jb $L$ctr32_tail + shr eax,1 + mov r11,rcx + mov r10d,eax + sub rdx,6 + jmp $L$ctr32_loop6 + +ALIGN 16 +$L$ctr32_loop6:: + pshufd xmm5,xmm13,192 + por xmm2,xmm14 + movups xmm0,XMMWORD PTR[r11] + pshufd xmm6,xmm13,128 + por xmm3,xmm14 + movups xmm1,XMMWORD PTR[16+r11] + pshufd xmm7,xmm13,64 + por xmm4,xmm14 + por xmm5,xmm14 + xorps xmm2,xmm0 + por xmm6,xmm14 + por xmm7,xmm14 + + + + + pxor xmm3,xmm0 + aesenc xmm2,xmm1 + lea rcx,QWORD PTR[32+r11] + pxor xmm4,xmm0 + aesenc xmm3,xmm1 + movdqa xmm13,XMMWORD PTR[$L$increment32] + pxor xmm5,xmm0 + aesenc xmm4,xmm1 + movdqa xmm12,XMMWORD PTR[rsp] + pxor xmm6,xmm0 + aesenc xmm5,xmm1 + pxor xmm7,xmm0 + movups xmm0,XMMWORD PTR[rcx] + dec eax + aesenc xmm6,xmm1 + aesenc xmm7,xmm1 + jmp $L$ctr32_enc_loop6_enter +ALIGN 16 +$L$ctr32_enc_loop6:: + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + dec eax + aesenc xmm4,xmm1 + aesenc xmm5,xmm1 + aesenc xmm6,xmm1 + aesenc xmm7,xmm1 +$L$ctr32_enc_loop6_enter:: + movups xmm1,XMMWORD PTR[16+rcx] + aesenc xmm2,xmm0 + aesenc xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesenc xmm4,xmm0 + aesenc xmm5,xmm0 + aesenc xmm6,xmm0 + aesenc xmm7,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$ctr32_enc_loop6 + + aesenc xmm2,xmm1 + paddd xmm12,xmm13 + aesenc xmm3,xmm1 + paddd xmm13,XMMWORD PTR[16+rsp] + aesenc xmm4,xmm1 + movdqa XMMWORD PTR[rsp],xmm12 + aesenc xmm5,xmm1 + movdqa XMMWORD PTR[16+rsp],xmm13 + aesenc xmm6,xmm1 +DB 102,69,15,56,0,231 + aesenc xmm7,xmm1 +DB 102,69,15,56,0,239 + + aesenclast xmm2,xmm0 + movups xmm8,XMMWORD PTR[rdi] + aesenclast xmm3,xmm0 + movups xmm9,XMMWORD PTR[16+rdi] + aesenclast xmm4,xmm0 + movups xmm10,XMMWORD PTR[32+rdi] + aesenclast xmm5,xmm0 + movups xmm11,XMMWORD PTR[48+rdi] + aesenclast xmm6,xmm0 + movups xmm1,XMMWORD PTR[64+rdi] + aesenclast xmm7,xmm0 + movups xmm0,XMMWORD PTR[80+rdi] + lea rdi,QWORD PTR[96+rdi] + + xorps xmm8,xmm2 + pshufd xmm2,xmm12,192 + xorps xmm9,xmm3 + pshufd xmm3,xmm12,128 + movups XMMWORD PTR[rsi],xmm8 + xorps xmm10,xmm4 + pshufd xmm4,xmm12,64 + movups XMMWORD PTR[16+rsi],xmm9 + xorps xmm11,xmm5 + movups XMMWORD PTR[32+rsi],xmm10 + xorps xmm1,xmm6 + movups XMMWORD PTR[48+rsi],xmm11 + xorps xmm0,xmm7 + movups XMMWORD PTR[64+rsi],xmm1 + movups XMMWORD PTR[80+rsi],xmm0 + lea rsi,QWORD PTR[96+rsi] + mov eax,r10d + sub rdx,6 + jnc $L$ctr32_loop6 + + add rdx,6 + jz $L$ctr32_done + mov rcx,r11 + lea eax,DWORD PTR[1+rax*1+rax] + +$L$ctr32_tail:: + por xmm2,xmm14 + movups xmm8,XMMWORD PTR[rdi] + cmp rdx,2 + jb $L$ctr32_one + + por xmm3,xmm14 + movups xmm9,XMMWORD PTR[16+rdi] + je $L$ctr32_two + + pshufd xmm5,xmm13,192 + por xmm4,xmm14 + movups xmm10,XMMWORD PTR[32+rdi] + cmp rdx,4 + jb $L$ctr32_three + + pshufd xmm6,xmm13,128 + por xmm5,xmm14 + movups xmm11,XMMWORD PTR[48+rdi] + je $L$ctr32_four + + por xmm6,xmm14 + xorps xmm7,xmm7 + + call _aesni_encrypt6 + + movups xmm1,XMMWORD PTR[64+rdi] + xorps xmm8,xmm2 + xorps xmm9,xmm3 + movups XMMWORD PTR[rsi],xmm8 + xorps xmm10,xmm4 + movups XMMWORD PTR[16+rsi],xmm9 + xorps xmm11,xmm5 + movups XMMWORD PTR[32+rsi],xmm10 + xorps xmm1,xmm6 + movups XMMWORD PTR[48+rsi],xmm11 + movups XMMWORD PTR[64+rsi],xmm1 + jmp $L$ctr32_done + +ALIGN 16 +$L$ctr32_one_shortcut:: + movups xmm2,XMMWORD PTR[r8] + movups xmm8,XMMWORD PTR[rdi] + mov eax,DWORD PTR[240+rcx] +$L$ctr32_one:: + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 +$L$oop_enc1_7:: + aesenc xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_enc1_7 + aesenclast xmm2,xmm1 + xorps xmm8,xmm2 + movups XMMWORD PTR[rsi],xmm8 + jmp $L$ctr32_done + +ALIGN 16 +$L$ctr32_two:: + xorps xmm4,xmm4 + call _aesni_encrypt3 + xorps xmm8,xmm2 + xorps xmm9,xmm3 + movups XMMWORD PTR[rsi],xmm8 + movups XMMWORD PTR[16+rsi],xmm9 + jmp $L$ctr32_done + +ALIGN 16 +$L$ctr32_three:: + call _aesni_encrypt3 + xorps xmm8,xmm2 + xorps xmm9,xmm3 + movups XMMWORD PTR[rsi],xmm8 + xorps xmm10,xmm4 + movups XMMWORD PTR[16+rsi],xmm9 + movups XMMWORD PTR[32+rsi],xmm10 + jmp $L$ctr32_done + +ALIGN 16 +$L$ctr32_four:: + call _aesni_encrypt4 + xorps xmm8,xmm2 + xorps xmm9,xmm3 + movups XMMWORD PTR[rsi],xmm8 + xorps xmm10,xmm4 + movups XMMWORD PTR[16+rsi],xmm9 + xorps xmm11,xmm5 + movups XMMWORD PTR[32+rsi],xmm10 + movups XMMWORD PTR[48+rsi],xmm11 + +$L$ctr32_done:: + movaps xmm6,XMMWORD PTR[32+rsp] + movaps xmm7,XMMWORD PTR[48+rsp] + movaps xmm8,XMMWORD PTR[64+rsp] + movaps xmm9,XMMWORD PTR[80+rsp] + movaps xmm10,XMMWORD PTR[96+rsp] + movaps xmm11,XMMWORD PTR[112+rsp] + movaps xmm12,XMMWORD PTR[128+rsp] + movaps xmm13,XMMWORD PTR[144+rsp] + movaps xmm14,XMMWORD PTR[160+rsp] + movaps xmm15,XMMWORD PTR[176+rsp] + lea rsp,QWORD PTR[200+rsp] +$L$ctr32_ret:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_aesni_ctr32_encrypt_blocks:: +aesni_ctr32_encrypt_blocks ENDP +PUBLIC aesni_xts_encrypt + +ALIGN 16 +aesni_xts_encrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_aesni_xts_encrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + lea rsp,QWORD PTR[((-264))+rsp] + movaps XMMWORD PTR[96+rsp],xmm6 + movaps XMMWORD PTR[112+rsp],xmm7 + movaps XMMWORD PTR[128+rsp],xmm8 + movaps XMMWORD PTR[144+rsp],xmm9 + movaps XMMWORD PTR[160+rsp],xmm10 + movaps XMMWORD PTR[176+rsp],xmm11 + movaps XMMWORD PTR[192+rsp],xmm12 + movaps XMMWORD PTR[208+rsp],xmm13 + movaps XMMWORD PTR[224+rsp],xmm14 + movaps XMMWORD PTR[240+rsp],xmm15 +$L$xts_enc_body:: + movups xmm15,XMMWORD PTR[r9] + mov eax,DWORD PTR[240+r8] + mov r10d,DWORD PTR[240+rcx] + movups xmm0,XMMWORD PTR[r8] + movups xmm1,XMMWORD PTR[16+r8] + lea r8,QWORD PTR[32+r8] + xorps xmm15,xmm0 +$L$oop_enc1_8:: + aesenc xmm15,xmm1 + dec eax + movups xmm1,XMMWORD PTR[r8] + lea r8,QWORD PTR[16+r8] + jnz $L$oop_enc1_8 + aesenclast xmm15,xmm1 + mov r11,rcx + mov eax,r10d + mov r9,rdx + and rdx,-16 + + movdqa xmm8,XMMWORD PTR[$L$xts_magic] + pxor xmm14,xmm14 + pcmpgtd xmm14,xmm15 + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm10,xmm15 + paddq xmm15,xmm15 + pand xmm9,xmm8 + pcmpgtd xmm14,xmm15 + pxor xmm15,xmm9 + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm11,xmm15 + paddq xmm15,xmm15 + pand xmm9,xmm8 + pcmpgtd xmm14,xmm15 + pxor xmm15,xmm9 + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm12,xmm15 + paddq xmm15,xmm15 + pand xmm9,xmm8 + pcmpgtd xmm14,xmm15 + pxor xmm15,xmm9 + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm13,xmm15 + paddq xmm15,xmm15 + pand xmm9,xmm8 + pcmpgtd xmm14,xmm15 + pxor xmm15,xmm9 + sub rdx,16*6 + jc $L$xts_enc_short + + shr eax,1 + sub eax,1 + mov r10d,eax + jmp $L$xts_enc_grandloop + +ALIGN 16 +$L$xts_enc_grandloop:: + pshufd xmm9,xmm14,013h + movdqa xmm14,xmm15 + paddq xmm15,xmm15 + movdqu xmm2,XMMWORD PTR[rdi] + pand xmm9,xmm8 + movdqu xmm3,XMMWORD PTR[16+rdi] + pxor xmm15,xmm9 + + movdqu xmm4,XMMWORD PTR[32+rdi] + pxor xmm2,xmm10 + movdqu xmm5,XMMWORD PTR[48+rdi] + pxor xmm3,xmm11 + movdqu xmm6,XMMWORD PTR[64+rdi] + pxor xmm4,xmm12 + movdqu xmm7,XMMWORD PTR[80+rdi] + lea rdi,QWORD PTR[96+rdi] + pxor xmm5,xmm13 + movups xmm0,XMMWORD PTR[r11] + pxor xmm6,xmm14 + pxor xmm7,xmm15 + + + + movups xmm1,XMMWORD PTR[16+r11] + pxor xmm2,xmm0 + pxor xmm3,xmm0 + movdqa XMMWORD PTR[rsp],xmm10 + aesenc xmm2,xmm1 + lea rcx,QWORD PTR[32+r11] + pxor xmm4,xmm0 + movdqa XMMWORD PTR[16+rsp],xmm11 + aesenc xmm3,xmm1 + pxor xmm5,xmm0 + movdqa XMMWORD PTR[32+rsp],xmm12 + aesenc xmm4,xmm1 + pxor xmm6,xmm0 + movdqa XMMWORD PTR[48+rsp],xmm13 + aesenc xmm5,xmm1 + pxor xmm7,xmm0 + movups xmm0,XMMWORD PTR[rcx] + dec eax + movdqa XMMWORD PTR[64+rsp],xmm14 + aesenc xmm6,xmm1 + movdqa XMMWORD PTR[80+rsp],xmm15 + aesenc xmm7,xmm1 + pxor xmm14,xmm14 + pcmpgtd xmm14,xmm15 + jmp $L$xts_enc_loop6_enter + +ALIGN 16 +$L$xts_enc_loop6:: + aesenc xmm2,xmm1 + aesenc xmm3,xmm1 + dec eax + aesenc xmm4,xmm1 + aesenc xmm5,xmm1 + aesenc xmm6,xmm1 + aesenc xmm7,xmm1 +$L$xts_enc_loop6_enter:: + movups xmm1,XMMWORD PTR[16+rcx] + aesenc xmm2,xmm0 + aesenc xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesenc xmm4,xmm0 + aesenc xmm5,xmm0 + aesenc xmm6,xmm0 + aesenc xmm7,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$xts_enc_loop6 + + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + paddq xmm15,xmm15 + aesenc xmm2,xmm1 + pand xmm9,xmm8 + aesenc xmm3,xmm1 + pcmpgtd xmm14,xmm15 + aesenc xmm4,xmm1 + pxor xmm15,xmm9 + aesenc xmm5,xmm1 + aesenc xmm6,xmm1 + aesenc xmm7,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm10,xmm15 + paddq xmm15,xmm15 + aesenc xmm2,xmm0 + pand xmm9,xmm8 + aesenc xmm3,xmm0 + pcmpgtd xmm14,xmm15 + aesenc xmm4,xmm0 + pxor xmm15,xmm9 + aesenc xmm5,xmm0 + aesenc xmm6,xmm0 + aesenc xmm7,xmm0 + movups xmm0,XMMWORD PTR[32+rcx] + + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm11,xmm15 + paddq xmm15,xmm15 + aesenc xmm2,xmm1 + pand xmm9,xmm8 + aesenc xmm3,xmm1 + pcmpgtd xmm14,xmm15 + aesenc xmm4,xmm1 + pxor xmm15,xmm9 + aesenc xmm5,xmm1 + aesenc xmm6,xmm1 + aesenc xmm7,xmm1 + + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm12,xmm15 + paddq xmm15,xmm15 + aesenclast xmm2,xmm0 + pand xmm9,xmm8 + aesenclast xmm3,xmm0 + pcmpgtd xmm14,xmm15 + aesenclast xmm4,xmm0 + pxor xmm15,xmm9 + aesenclast xmm5,xmm0 + aesenclast xmm6,xmm0 + aesenclast xmm7,xmm0 + + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm13,xmm15 + paddq xmm15,xmm15 + xorps xmm2,XMMWORD PTR[rsp] + pand xmm9,xmm8 + xorps xmm3,XMMWORD PTR[16+rsp] + pcmpgtd xmm14,xmm15 + pxor xmm15,xmm9 + + xorps xmm4,XMMWORD PTR[32+rsp] + movups XMMWORD PTR[rsi],xmm2 + xorps xmm5,XMMWORD PTR[48+rsp] + movups XMMWORD PTR[16+rsi],xmm3 + xorps xmm6,XMMWORD PTR[64+rsp] + movups XMMWORD PTR[32+rsi],xmm4 + xorps xmm7,XMMWORD PTR[80+rsp] + movups XMMWORD PTR[48+rsi],xmm5 + mov eax,r10d + movups XMMWORD PTR[64+rsi],xmm6 + movups XMMWORD PTR[80+rsi],xmm7 + lea rsi,QWORD PTR[96+rsi] + sub rdx,16*6 + jnc $L$xts_enc_grandloop + + lea eax,DWORD PTR[3+rax*1+rax] + mov rcx,r11 + mov r10d,eax + +$L$xts_enc_short:: + add rdx,16*6 + jz $L$xts_enc_done + + cmp rdx,020h + jb $L$xts_enc_one + je $L$xts_enc_two + + cmp rdx,040h + jb $L$xts_enc_three + je $L$xts_enc_four + + pshufd xmm9,xmm14,013h + movdqa xmm14,xmm15 + paddq xmm15,xmm15 + movdqu xmm2,XMMWORD PTR[rdi] + pand xmm9,xmm8 + movdqu xmm3,XMMWORD PTR[16+rdi] + pxor xmm15,xmm9 + + movdqu xmm4,XMMWORD PTR[32+rdi] + pxor xmm2,xmm10 + movdqu xmm5,XMMWORD PTR[48+rdi] + pxor xmm3,xmm11 + movdqu xmm6,XMMWORD PTR[64+rdi] + lea rdi,QWORD PTR[80+rdi] + pxor xmm4,xmm12 + pxor xmm5,xmm13 + pxor xmm6,xmm14 + + call _aesni_encrypt6 + + xorps xmm2,xmm10 + movdqa xmm10,xmm15 + xorps xmm3,xmm11 + xorps xmm4,xmm12 + movdqu XMMWORD PTR[rsi],xmm2 + xorps xmm5,xmm13 + movdqu XMMWORD PTR[16+rsi],xmm3 + xorps xmm6,xmm14 + movdqu XMMWORD PTR[32+rsi],xmm4 + movdqu XMMWORD PTR[48+rsi],xmm5 + movdqu XMMWORD PTR[64+rsi],xmm6 + lea rsi,QWORD PTR[80+rsi] + jmp $L$xts_enc_done + +ALIGN 16 +$L$xts_enc_one:: + movups xmm2,XMMWORD PTR[rdi] + lea rdi,QWORD PTR[16+rdi] + xorps xmm2,xmm10 + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 +$L$oop_enc1_9:: + aesenc xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_enc1_9 + aesenclast xmm2,xmm1 + xorps xmm2,xmm10 + movdqa xmm10,xmm11 + movups XMMWORD PTR[rsi],xmm2 + lea rsi,QWORD PTR[16+rsi] + jmp $L$xts_enc_done + +ALIGN 16 +$L$xts_enc_two:: + movups xmm2,XMMWORD PTR[rdi] + movups xmm3,XMMWORD PTR[16+rdi] + lea rdi,QWORD PTR[32+rdi] + xorps xmm2,xmm10 + xorps xmm3,xmm11 + + call _aesni_encrypt3 + + xorps xmm2,xmm10 + movdqa xmm10,xmm12 + xorps xmm3,xmm11 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + lea rsi,QWORD PTR[32+rsi] + jmp $L$xts_enc_done + +ALIGN 16 +$L$xts_enc_three:: + movups xmm2,XMMWORD PTR[rdi] + movups xmm3,XMMWORD PTR[16+rdi] + movups xmm4,XMMWORD PTR[32+rdi] + lea rdi,QWORD PTR[48+rdi] + xorps xmm2,xmm10 + xorps xmm3,xmm11 + xorps xmm4,xmm12 + + call _aesni_encrypt3 + + xorps xmm2,xmm10 + movdqa xmm10,xmm13 + xorps xmm3,xmm11 + xorps xmm4,xmm12 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + lea rsi,QWORD PTR[48+rsi] + jmp $L$xts_enc_done + +ALIGN 16 +$L$xts_enc_four:: + movups xmm2,XMMWORD PTR[rdi] + movups xmm3,XMMWORD PTR[16+rdi] + movups xmm4,XMMWORD PTR[32+rdi] + xorps xmm2,xmm10 + movups xmm5,XMMWORD PTR[48+rdi] + lea rdi,QWORD PTR[64+rdi] + xorps xmm3,xmm11 + xorps xmm4,xmm12 + xorps xmm5,xmm13 + + call _aesni_encrypt4 + + xorps xmm2,xmm10 + movdqa xmm10,xmm15 + xorps xmm3,xmm11 + xorps xmm4,xmm12 + movups XMMWORD PTR[rsi],xmm2 + xorps xmm5,xmm13 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + lea rsi,QWORD PTR[64+rsi] + jmp $L$xts_enc_done + +ALIGN 16 +$L$xts_enc_done:: + and r9,15 + jz $L$xts_enc_ret + mov rdx,r9 + +$L$xts_enc_steal:: + movzx eax,BYTE PTR[rdi] + movzx ecx,BYTE PTR[((-16))+rsi] + lea rdi,QWORD PTR[1+rdi] + mov BYTE PTR[((-16))+rsi],al + mov BYTE PTR[rsi],cl + lea rsi,QWORD PTR[1+rsi] + sub rdx,1 + jnz $L$xts_enc_steal + + sub rsi,r9 + mov rcx,r11 + mov eax,r10d + + movups xmm2,XMMWORD PTR[((-16))+rsi] + xorps xmm2,xmm10 + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 +$L$oop_enc1_10:: + aesenc xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_enc1_10 + aesenclast xmm2,xmm1 + xorps xmm2,xmm10 + movups XMMWORD PTR[(-16)+rsi],xmm2 + +$L$xts_enc_ret:: + movaps xmm6,XMMWORD PTR[96+rsp] + movaps xmm7,XMMWORD PTR[112+rsp] + movaps xmm8,XMMWORD PTR[128+rsp] + movaps xmm9,XMMWORD PTR[144+rsp] + movaps xmm10,XMMWORD PTR[160+rsp] + movaps xmm11,XMMWORD PTR[176+rsp] + movaps xmm12,XMMWORD PTR[192+rsp] + movaps xmm13,XMMWORD PTR[208+rsp] + movaps xmm14,XMMWORD PTR[224+rsp] + movaps xmm15,XMMWORD PTR[240+rsp] + lea rsp,QWORD PTR[264+rsp] +$L$xts_enc_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_aesni_xts_encrypt:: +aesni_xts_encrypt ENDP +PUBLIC aesni_xts_decrypt + +ALIGN 16 +aesni_xts_decrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_aesni_xts_decrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + lea rsp,QWORD PTR[((-264))+rsp] + movaps XMMWORD PTR[96+rsp],xmm6 + movaps XMMWORD PTR[112+rsp],xmm7 + movaps XMMWORD PTR[128+rsp],xmm8 + movaps XMMWORD PTR[144+rsp],xmm9 + movaps XMMWORD PTR[160+rsp],xmm10 + movaps XMMWORD PTR[176+rsp],xmm11 + movaps XMMWORD PTR[192+rsp],xmm12 + movaps XMMWORD PTR[208+rsp],xmm13 + movaps XMMWORD PTR[224+rsp],xmm14 + movaps XMMWORD PTR[240+rsp],xmm15 +$L$xts_dec_body:: + movups xmm15,XMMWORD PTR[r9] + mov eax,DWORD PTR[240+r8] + mov r10d,DWORD PTR[240+rcx] + movups xmm0,XMMWORD PTR[r8] + movups xmm1,XMMWORD PTR[16+r8] + lea r8,QWORD PTR[32+r8] + xorps xmm15,xmm0 +$L$oop_enc1_11:: + aesenc xmm15,xmm1 + dec eax + movups xmm1,XMMWORD PTR[r8] + lea r8,QWORD PTR[16+r8] + jnz $L$oop_enc1_11 + aesenclast xmm15,xmm1 + xor eax,eax + test rdx,15 + setnz al + shl rax,4 + sub rdx,rax + + mov r11,rcx + mov eax,r10d + mov r9,rdx + and rdx,-16 + + movdqa xmm8,XMMWORD PTR[$L$xts_magic] + pxor xmm14,xmm14 + pcmpgtd xmm14,xmm15 + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm10,xmm15 + paddq xmm15,xmm15 + pand xmm9,xmm8 + pcmpgtd xmm14,xmm15 + pxor xmm15,xmm9 + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm11,xmm15 + paddq xmm15,xmm15 + pand xmm9,xmm8 + pcmpgtd xmm14,xmm15 + pxor xmm15,xmm9 + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm12,xmm15 + paddq xmm15,xmm15 + pand xmm9,xmm8 + pcmpgtd xmm14,xmm15 + pxor xmm15,xmm9 + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm13,xmm15 + paddq xmm15,xmm15 + pand xmm9,xmm8 + pcmpgtd xmm14,xmm15 + pxor xmm15,xmm9 + sub rdx,16*6 + jc $L$xts_dec_short + + shr eax,1 + sub eax,1 + mov r10d,eax + jmp $L$xts_dec_grandloop + +ALIGN 16 +$L$xts_dec_grandloop:: + pshufd xmm9,xmm14,013h + movdqa xmm14,xmm15 + paddq xmm15,xmm15 + movdqu xmm2,XMMWORD PTR[rdi] + pand xmm9,xmm8 + movdqu xmm3,XMMWORD PTR[16+rdi] + pxor xmm15,xmm9 + + movdqu xmm4,XMMWORD PTR[32+rdi] + pxor xmm2,xmm10 + movdqu xmm5,XMMWORD PTR[48+rdi] + pxor xmm3,xmm11 + movdqu xmm6,XMMWORD PTR[64+rdi] + pxor xmm4,xmm12 + movdqu xmm7,XMMWORD PTR[80+rdi] + lea rdi,QWORD PTR[96+rdi] + pxor xmm5,xmm13 + movups xmm0,XMMWORD PTR[r11] + pxor xmm6,xmm14 + pxor xmm7,xmm15 + + + + movups xmm1,XMMWORD PTR[16+r11] + pxor xmm2,xmm0 + pxor xmm3,xmm0 + movdqa XMMWORD PTR[rsp],xmm10 + aesdec xmm2,xmm1 + lea rcx,QWORD PTR[32+r11] + pxor xmm4,xmm0 + movdqa XMMWORD PTR[16+rsp],xmm11 + aesdec xmm3,xmm1 + pxor xmm5,xmm0 + movdqa XMMWORD PTR[32+rsp],xmm12 + aesdec xmm4,xmm1 + pxor xmm6,xmm0 + movdqa XMMWORD PTR[48+rsp],xmm13 + aesdec xmm5,xmm1 + pxor xmm7,xmm0 + movups xmm0,XMMWORD PTR[rcx] + dec eax + movdqa XMMWORD PTR[64+rsp],xmm14 + aesdec xmm6,xmm1 + movdqa XMMWORD PTR[80+rsp],xmm15 + aesdec xmm7,xmm1 + pxor xmm14,xmm14 + pcmpgtd xmm14,xmm15 + jmp $L$xts_dec_loop6_enter + +ALIGN 16 +$L$xts_dec_loop6:: + aesdec xmm2,xmm1 + aesdec xmm3,xmm1 + dec eax + aesdec xmm4,xmm1 + aesdec xmm5,xmm1 + aesdec xmm6,xmm1 + aesdec xmm7,xmm1 +$L$xts_dec_loop6_enter:: + movups xmm1,XMMWORD PTR[16+rcx] + aesdec xmm2,xmm0 + aesdec xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + aesdec xmm4,xmm0 + aesdec xmm5,xmm0 + aesdec xmm6,xmm0 + aesdec xmm7,xmm0 + movups xmm0,XMMWORD PTR[rcx] + jnz $L$xts_dec_loop6 + + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + paddq xmm15,xmm15 + aesdec xmm2,xmm1 + pand xmm9,xmm8 + aesdec xmm3,xmm1 + pcmpgtd xmm14,xmm15 + aesdec xmm4,xmm1 + pxor xmm15,xmm9 + aesdec xmm5,xmm1 + aesdec xmm6,xmm1 + aesdec xmm7,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm10,xmm15 + paddq xmm15,xmm15 + aesdec xmm2,xmm0 + pand xmm9,xmm8 + aesdec xmm3,xmm0 + pcmpgtd xmm14,xmm15 + aesdec xmm4,xmm0 + pxor xmm15,xmm9 + aesdec xmm5,xmm0 + aesdec xmm6,xmm0 + aesdec xmm7,xmm0 + movups xmm0,XMMWORD PTR[32+rcx] + + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm11,xmm15 + paddq xmm15,xmm15 + aesdec xmm2,xmm1 + pand xmm9,xmm8 + aesdec xmm3,xmm1 + pcmpgtd xmm14,xmm15 + aesdec xmm4,xmm1 + pxor xmm15,xmm9 + aesdec xmm5,xmm1 + aesdec xmm6,xmm1 + aesdec xmm7,xmm1 + + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm12,xmm15 + paddq xmm15,xmm15 + aesdeclast xmm2,xmm0 + pand xmm9,xmm8 + aesdeclast xmm3,xmm0 + pcmpgtd xmm14,xmm15 + aesdeclast xmm4,xmm0 + pxor xmm15,xmm9 + aesdeclast xmm5,xmm0 + aesdeclast xmm6,xmm0 + aesdeclast xmm7,xmm0 + + pshufd xmm9,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm13,xmm15 + paddq xmm15,xmm15 + xorps xmm2,XMMWORD PTR[rsp] + pand xmm9,xmm8 + xorps xmm3,XMMWORD PTR[16+rsp] + pcmpgtd xmm14,xmm15 + pxor xmm15,xmm9 + + xorps xmm4,XMMWORD PTR[32+rsp] + movups XMMWORD PTR[rsi],xmm2 + xorps xmm5,XMMWORD PTR[48+rsp] + movups XMMWORD PTR[16+rsi],xmm3 + xorps xmm6,XMMWORD PTR[64+rsp] + movups XMMWORD PTR[32+rsi],xmm4 + xorps xmm7,XMMWORD PTR[80+rsp] + movups XMMWORD PTR[48+rsi],xmm5 + mov eax,r10d + movups XMMWORD PTR[64+rsi],xmm6 + movups XMMWORD PTR[80+rsi],xmm7 + lea rsi,QWORD PTR[96+rsi] + sub rdx,16*6 + jnc $L$xts_dec_grandloop + + lea eax,DWORD PTR[3+rax*1+rax] + mov rcx,r11 + mov r10d,eax + +$L$xts_dec_short:: + add rdx,16*6 + jz $L$xts_dec_done + + cmp rdx,020h + jb $L$xts_dec_one + je $L$xts_dec_two + + cmp rdx,040h + jb $L$xts_dec_three + je $L$xts_dec_four + + pshufd xmm9,xmm14,013h + movdqa xmm14,xmm15 + paddq xmm15,xmm15 + movdqu xmm2,XMMWORD PTR[rdi] + pand xmm9,xmm8 + movdqu xmm3,XMMWORD PTR[16+rdi] + pxor xmm15,xmm9 + + movdqu xmm4,XMMWORD PTR[32+rdi] + pxor xmm2,xmm10 + movdqu xmm5,XMMWORD PTR[48+rdi] + pxor xmm3,xmm11 + movdqu xmm6,XMMWORD PTR[64+rdi] + lea rdi,QWORD PTR[80+rdi] + pxor xmm4,xmm12 + pxor xmm5,xmm13 + pxor xmm6,xmm14 + + call _aesni_decrypt6 + + xorps xmm2,xmm10 + xorps xmm3,xmm11 + xorps xmm4,xmm12 + movdqu XMMWORD PTR[rsi],xmm2 + xorps xmm5,xmm13 + movdqu XMMWORD PTR[16+rsi],xmm3 + xorps xmm6,xmm14 + movdqu XMMWORD PTR[32+rsi],xmm4 + pxor xmm14,xmm14 + movdqu XMMWORD PTR[48+rsi],xmm5 + pcmpgtd xmm14,xmm15 + movdqu XMMWORD PTR[64+rsi],xmm6 + lea rsi,QWORD PTR[80+rsi] + pshufd xmm11,xmm14,013h + and r9,15 + jz $L$xts_dec_ret + + movdqa xmm10,xmm15 + paddq xmm15,xmm15 + pand xmm11,xmm8 + pxor xmm11,xmm15 + jmp $L$xts_dec_done2 + +ALIGN 16 +$L$xts_dec_one:: + movups xmm2,XMMWORD PTR[rdi] + lea rdi,QWORD PTR[16+rdi] + xorps xmm2,xmm10 + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 +$L$oop_dec1_12:: + aesdec xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_dec1_12 + aesdeclast xmm2,xmm1 + xorps xmm2,xmm10 + movdqa xmm10,xmm11 + movups XMMWORD PTR[rsi],xmm2 + movdqa xmm11,xmm12 + lea rsi,QWORD PTR[16+rsi] + jmp $L$xts_dec_done + +ALIGN 16 +$L$xts_dec_two:: + movups xmm2,XMMWORD PTR[rdi] + movups xmm3,XMMWORD PTR[16+rdi] + lea rdi,QWORD PTR[32+rdi] + xorps xmm2,xmm10 + xorps xmm3,xmm11 + + call _aesni_decrypt3 + + xorps xmm2,xmm10 + movdqa xmm10,xmm12 + xorps xmm3,xmm11 + movdqa xmm11,xmm13 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + lea rsi,QWORD PTR[32+rsi] + jmp $L$xts_dec_done + +ALIGN 16 +$L$xts_dec_three:: + movups xmm2,XMMWORD PTR[rdi] + movups xmm3,XMMWORD PTR[16+rdi] + movups xmm4,XMMWORD PTR[32+rdi] + lea rdi,QWORD PTR[48+rdi] + xorps xmm2,xmm10 + xorps xmm3,xmm11 + xorps xmm4,xmm12 + + call _aesni_decrypt3 + + xorps xmm2,xmm10 + movdqa xmm10,xmm13 + xorps xmm3,xmm11 + movdqa xmm11,xmm15 + xorps xmm4,xmm12 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + lea rsi,QWORD PTR[48+rsi] + jmp $L$xts_dec_done + +ALIGN 16 +$L$xts_dec_four:: + pshufd xmm9,xmm14,013h + movdqa xmm14,xmm15 + paddq xmm15,xmm15 + movups xmm2,XMMWORD PTR[rdi] + pand xmm9,xmm8 + movups xmm3,XMMWORD PTR[16+rdi] + pxor xmm15,xmm9 + + movups xmm4,XMMWORD PTR[32+rdi] + xorps xmm2,xmm10 + movups xmm5,XMMWORD PTR[48+rdi] + lea rdi,QWORD PTR[64+rdi] + xorps xmm3,xmm11 + xorps xmm4,xmm12 + xorps xmm5,xmm13 + + call _aesni_decrypt4 + + xorps xmm2,xmm10 + movdqa xmm10,xmm14 + xorps xmm3,xmm11 + movdqa xmm11,xmm15 + xorps xmm4,xmm12 + movups XMMWORD PTR[rsi],xmm2 + xorps xmm5,xmm13 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + lea rsi,QWORD PTR[64+rsi] + jmp $L$xts_dec_done + +ALIGN 16 +$L$xts_dec_done:: + and r9,15 + jz $L$xts_dec_ret +$L$xts_dec_done2:: + mov rdx,r9 + mov rcx,r11 + mov eax,r10d + + movups xmm2,XMMWORD PTR[rdi] + xorps xmm2,xmm11 + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 +$L$oop_dec1_13:: + aesdec xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_dec1_13 + aesdeclast xmm2,xmm1 + xorps xmm2,xmm11 + movups XMMWORD PTR[rsi],xmm2 + +$L$xts_dec_steal:: + movzx eax,BYTE PTR[16+rdi] + movzx ecx,BYTE PTR[rsi] + lea rdi,QWORD PTR[1+rdi] + mov BYTE PTR[rsi],al + mov BYTE PTR[16+rsi],cl + lea rsi,QWORD PTR[1+rsi] + sub rdx,1 + jnz $L$xts_dec_steal + + sub rsi,r9 + mov rcx,r11 + mov eax,r10d + + movups xmm2,XMMWORD PTR[rsi] + xorps xmm2,xmm10 + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 +$L$oop_dec1_14:: + aesdec xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_dec1_14 + aesdeclast xmm2,xmm1 + xorps xmm2,xmm10 + movups XMMWORD PTR[rsi],xmm2 + +$L$xts_dec_ret:: + movaps xmm6,XMMWORD PTR[96+rsp] + movaps xmm7,XMMWORD PTR[112+rsp] + movaps xmm8,XMMWORD PTR[128+rsp] + movaps xmm9,XMMWORD PTR[144+rsp] + movaps xmm10,XMMWORD PTR[160+rsp] + movaps xmm11,XMMWORD PTR[176+rsp] + movaps xmm12,XMMWORD PTR[192+rsp] + movaps xmm13,XMMWORD PTR[208+rsp] + movaps xmm14,XMMWORD PTR[224+rsp] + movaps xmm15,XMMWORD PTR[240+rsp] + lea rsp,QWORD PTR[264+rsp] +$L$xts_dec_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_aesni_xts_decrypt:: +aesni_xts_decrypt ENDP +PUBLIC aesni_cbc_encrypt + +ALIGN 16 +aesni_cbc_encrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_aesni_cbc_encrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + test rdx,rdx + jz $L$cbc_ret + + mov r10d,DWORD PTR[240+rcx] + mov r11,rcx + test r9d,r9d + jz $L$cbc_decrypt + + movups xmm2,XMMWORD PTR[r8] + mov eax,r10d + cmp rdx,16 + jb $L$cbc_enc_tail + sub rdx,16 + jmp $L$cbc_enc_loop +ALIGN 16 +$L$cbc_enc_loop:: + movups xmm3,XMMWORD PTR[rdi] + lea rdi,QWORD PTR[16+rdi] + + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + xorps xmm3,xmm0 + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm3 +$L$oop_enc1_15:: + aesenc xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_enc1_15 + aesenclast xmm2,xmm1 + mov eax,r10d + mov rcx,r11 + movups XMMWORD PTR[rsi],xmm2 + lea rsi,QWORD PTR[16+rsi] + sub rdx,16 + jnc $L$cbc_enc_loop + add rdx,16 + jnz $L$cbc_enc_tail + movups XMMWORD PTR[r8],xmm2 + jmp $L$cbc_ret + +$L$cbc_enc_tail:: + mov rcx,rdx + xchg rsi,rdi + DD 09066A4F3h + mov ecx,16 + sub rcx,rdx + xor eax,eax + DD 09066AAF3h + lea rdi,QWORD PTR[((-16))+rdi] + mov eax,r10d + mov rsi,rdi + mov rcx,r11 + xor rdx,rdx + jmp $L$cbc_enc_loop + +ALIGN 16 +$L$cbc_decrypt:: + lea rsp,QWORD PTR[((-88))+rsp] + movaps XMMWORD PTR[rsp],xmm6 + movaps XMMWORD PTR[16+rsp],xmm7 + movaps XMMWORD PTR[32+rsp],xmm8 + movaps XMMWORD PTR[48+rsp],xmm9 +$L$cbc_decrypt_body:: + movups xmm9,XMMWORD PTR[r8] + mov eax,r10d + cmp rdx,070h + jbe $L$cbc_dec_tail + shr r10d,1 + sub rdx,070h + mov eax,r10d + movaps XMMWORD PTR[64+rsp],xmm9 + jmp $L$cbc_dec_loop8_enter +ALIGN 16 +$L$cbc_dec_loop8:: + movaps XMMWORD PTR[64+rsp],xmm0 + movups XMMWORD PTR[rsi],xmm9 + lea rsi,QWORD PTR[16+rsi] +$L$cbc_dec_loop8_enter:: + movups xmm0,XMMWORD PTR[rcx] + movups xmm2,XMMWORD PTR[rdi] + movups xmm3,XMMWORD PTR[16+rdi] + movups xmm1,XMMWORD PTR[16+rcx] + + lea rcx,QWORD PTR[32+rcx] + movdqu xmm4,XMMWORD PTR[32+rdi] + xorps xmm2,xmm0 + movdqu xmm5,XMMWORD PTR[48+rdi] + xorps xmm3,xmm0 + movdqu xmm6,XMMWORD PTR[64+rdi] + aesdec xmm2,xmm1 + pxor xmm4,xmm0 + movdqu xmm7,XMMWORD PTR[80+rdi] + aesdec xmm3,xmm1 + pxor xmm5,xmm0 + movdqu xmm8,XMMWORD PTR[96+rdi] + aesdec xmm4,xmm1 + pxor xmm6,xmm0 + movdqu xmm9,XMMWORD PTR[112+rdi] + aesdec xmm5,xmm1 + pxor xmm7,xmm0 + dec eax + aesdec xmm6,xmm1 + pxor xmm8,xmm0 + aesdec xmm7,xmm1 + pxor xmm9,xmm0 + movups xmm0,XMMWORD PTR[rcx] + aesdec xmm8,xmm1 + aesdec xmm9,xmm1 + movups xmm1,XMMWORD PTR[16+rcx] + + call $L$dec_loop8_enter + + movups xmm1,XMMWORD PTR[rdi] + movups xmm0,XMMWORD PTR[16+rdi] + xorps xmm2,XMMWORD PTR[64+rsp] + xorps xmm3,xmm1 + movups xmm1,XMMWORD PTR[32+rdi] + xorps xmm4,xmm0 + movups xmm0,XMMWORD PTR[48+rdi] + xorps xmm5,xmm1 + movups xmm1,XMMWORD PTR[64+rdi] + xorps xmm6,xmm0 + movups xmm0,XMMWORD PTR[80+rdi] + xorps xmm7,xmm1 + movups xmm1,XMMWORD PTR[96+rdi] + xorps xmm8,xmm0 + movups xmm0,XMMWORD PTR[112+rdi] + xorps xmm9,xmm1 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + mov eax,r10d + movups XMMWORD PTR[64+rsi],xmm6 + mov rcx,r11 + movups XMMWORD PTR[80+rsi],xmm7 + lea rdi,QWORD PTR[128+rdi] + movups XMMWORD PTR[96+rsi],xmm8 + lea rsi,QWORD PTR[112+rsi] + sub rdx,080h + ja $L$cbc_dec_loop8 + + movaps xmm2,xmm9 + movaps xmm9,xmm0 + add rdx,070h + jle $L$cbc_dec_tail_collected + movups XMMWORD PTR[rsi],xmm2 + lea eax,DWORD PTR[1+r10*1+r10] + lea rsi,QWORD PTR[16+rsi] +$L$cbc_dec_tail:: + movups xmm2,XMMWORD PTR[rdi] + movaps xmm8,xmm2 + cmp rdx,010h + jbe $L$cbc_dec_one + + movups xmm3,XMMWORD PTR[16+rdi] + movaps xmm7,xmm3 + cmp rdx,020h + jbe $L$cbc_dec_two + + movups xmm4,XMMWORD PTR[32+rdi] + movaps xmm6,xmm4 + cmp rdx,030h + jbe $L$cbc_dec_three + + movups xmm5,XMMWORD PTR[48+rdi] + cmp rdx,040h + jbe $L$cbc_dec_four + + movups xmm6,XMMWORD PTR[64+rdi] + cmp rdx,050h + jbe $L$cbc_dec_five + + movups xmm7,XMMWORD PTR[80+rdi] + cmp rdx,060h + jbe $L$cbc_dec_six + + movups xmm8,XMMWORD PTR[96+rdi] + movaps XMMWORD PTR[64+rsp],xmm9 + call _aesni_decrypt8 + movups xmm1,XMMWORD PTR[rdi] + movups xmm0,XMMWORD PTR[16+rdi] + xorps xmm2,XMMWORD PTR[64+rsp] + xorps xmm3,xmm1 + movups xmm1,XMMWORD PTR[32+rdi] + xorps xmm4,xmm0 + movups xmm0,XMMWORD PTR[48+rdi] + xorps xmm5,xmm1 + movups xmm1,XMMWORD PTR[64+rdi] + xorps xmm6,xmm0 + movups xmm0,XMMWORD PTR[80+rdi] + xorps xmm7,xmm1 + movups xmm9,XMMWORD PTR[96+rdi] + xorps xmm8,xmm0 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + movups XMMWORD PTR[64+rsi],xmm6 + movups XMMWORD PTR[80+rsi],xmm7 + lea rsi,QWORD PTR[96+rsi] + movaps xmm2,xmm8 + sub rdx,070h + jmp $L$cbc_dec_tail_collected +ALIGN 16 +$L$cbc_dec_one:: + movups xmm0,XMMWORD PTR[rcx] + movups xmm1,XMMWORD PTR[16+rcx] + lea rcx,QWORD PTR[32+rcx] + xorps xmm2,xmm0 +$L$oop_dec1_16:: + aesdec xmm2,xmm1 + dec eax + movups xmm1,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + jnz $L$oop_dec1_16 + aesdeclast xmm2,xmm1 + xorps xmm2,xmm9 + movaps xmm9,xmm8 + sub rdx,010h + jmp $L$cbc_dec_tail_collected +ALIGN 16 +$L$cbc_dec_two:: + xorps xmm4,xmm4 + call _aesni_decrypt3 + xorps xmm2,xmm9 + xorps xmm3,xmm8 + movups XMMWORD PTR[rsi],xmm2 + movaps xmm9,xmm7 + movaps xmm2,xmm3 + lea rsi,QWORD PTR[16+rsi] + sub rdx,020h + jmp $L$cbc_dec_tail_collected +ALIGN 16 +$L$cbc_dec_three:: + call _aesni_decrypt3 + xorps xmm2,xmm9 + xorps xmm3,xmm8 + movups XMMWORD PTR[rsi],xmm2 + xorps xmm4,xmm7 + movups XMMWORD PTR[16+rsi],xmm3 + movaps xmm9,xmm6 + movaps xmm2,xmm4 + lea rsi,QWORD PTR[32+rsi] + sub rdx,030h + jmp $L$cbc_dec_tail_collected +ALIGN 16 +$L$cbc_dec_four:: + call _aesni_decrypt4 + xorps xmm2,xmm9 + movups xmm9,XMMWORD PTR[48+rdi] + xorps xmm3,xmm8 + movups XMMWORD PTR[rsi],xmm2 + xorps xmm4,xmm7 + movups XMMWORD PTR[16+rsi],xmm3 + xorps xmm5,xmm6 + movups XMMWORD PTR[32+rsi],xmm4 + movaps xmm2,xmm5 + lea rsi,QWORD PTR[48+rsi] + sub rdx,040h + jmp $L$cbc_dec_tail_collected +ALIGN 16 +$L$cbc_dec_five:: + xorps xmm7,xmm7 + call _aesni_decrypt6 + movups xmm1,XMMWORD PTR[16+rdi] + movups xmm0,XMMWORD PTR[32+rdi] + xorps xmm2,xmm9 + xorps xmm3,xmm8 + xorps xmm4,xmm1 + movups xmm1,XMMWORD PTR[48+rdi] + xorps xmm5,xmm0 + movups xmm9,XMMWORD PTR[64+rdi] + xorps xmm6,xmm1 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + lea rsi,QWORD PTR[64+rsi] + movaps xmm2,xmm6 + sub rdx,050h + jmp $L$cbc_dec_tail_collected +ALIGN 16 +$L$cbc_dec_six:: + call _aesni_decrypt6 + movups xmm1,XMMWORD PTR[16+rdi] + movups xmm0,XMMWORD PTR[32+rdi] + xorps xmm2,xmm9 + xorps xmm3,xmm8 + xorps xmm4,xmm1 + movups xmm1,XMMWORD PTR[48+rdi] + xorps xmm5,xmm0 + movups xmm0,XMMWORD PTR[64+rdi] + xorps xmm6,xmm1 + movups xmm9,XMMWORD PTR[80+rdi] + xorps xmm7,xmm0 + movups XMMWORD PTR[rsi],xmm2 + movups XMMWORD PTR[16+rsi],xmm3 + movups XMMWORD PTR[32+rsi],xmm4 + movups XMMWORD PTR[48+rsi],xmm5 + movups XMMWORD PTR[64+rsi],xmm6 + lea rsi,QWORD PTR[80+rsi] + movaps xmm2,xmm7 + sub rdx,060h + jmp $L$cbc_dec_tail_collected +ALIGN 16 +$L$cbc_dec_tail_collected:: + and rdx,15 + movups XMMWORD PTR[r8],xmm9 + jnz $L$cbc_dec_tail_partial + movups XMMWORD PTR[rsi],xmm2 + jmp $L$cbc_dec_ret +ALIGN 16 +$L$cbc_dec_tail_partial:: + movaps XMMWORD PTR[64+rsp],xmm2 + mov rcx,16 + mov rdi,rsi + sub rcx,rdx + lea rsi,QWORD PTR[64+rsp] + DD 09066A4F3h + +$L$cbc_dec_ret:: + movaps xmm6,XMMWORD PTR[rsp] + movaps xmm7,XMMWORD PTR[16+rsp] + movaps xmm8,XMMWORD PTR[32+rsp] + movaps xmm9,XMMWORD PTR[48+rsp] + lea rsp,QWORD PTR[88+rsp] +$L$cbc_ret:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_aesni_cbc_encrypt:: +aesni_cbc_encrypt ENDP +PUBLIC aesni_set_decrypt_key + +ALIGN 16 +aesni_set_decrypt_key PROC PUBLIC + sub rsp,8 + call __aesni_set_encrypt_key + shl edx,4 + test eax,eax + jnz $L$dec_key_ret + lea rcx,QWORD PTR[16+rdx*1+r8] + + movups xmm0,XMMWORD PTR[r8] + movups xmm1,XMMWORD PTR[rcx] + movups XMMWORD PTR[rcx],xmm0 + movups XMMWORD PTR[r8],xmm1 + lea r8,QWORD PTR[16+r8] + lea rcx,QWORD PTR[((-16))+rcx] + +$L$dec_key_inverse:: + movups xmm0,XMMWORD PTR[r8] + movups xmm1,XMMWORD PTR[rcx] + aesimc xmm0,xmm0 + aesimc xmm1,xmm1 + lea r8,QWORD PTR[16+r8] + lea rcx,QWORD PTR[((-16))+rcx] + movups XMMWORD PTR[16+rcx],xmm0 + movups XMMWORD PTR[(-16)+r8],xmm1 + cmp rcx,r8 + ja $L$dec_key_inverse + + movups xmm0,XMMWORD PTR[r8] + aesimc xmm0,xmm0 + movups XMMWORD PTR[rcx],xmm0 +$L$dec_key_ret:: + add rsp,8 + DB 0F3h,0C3h ;repret +$L$SEH_end_set_decrypt_key:: +aesni_set_decrypt_key ENDP +PUBLIC aesni_set_encrypt_key + +ALIGN 16 +aesni_set_encrypt_key PROC PUBLIC +__aesni_set_encrypt_key:: + sub rsp,8 + mov rax,-1 + test rcx,rcx + jz $L$enc_key_ret + test r8,r8 + jz $L$enc_key_ret + + movups xmm0,XMMWORD PTR[rcx] + xorps xmm4,xmm4 + lea rax,QWORD PTR[16+r8] + cmp edx,256 + je $L$14rounds + cmp edx,192 + je $L$12rounds + cmp edx,128 + jne $L$bad_keybits + +$L$10rounds:: + mov edx,9 + movups XMMWORD PTR[r8],xmm0 + aeskeygenassist xmm1,xmm0,01h + call $L$key_expansion_128_cold + aeskeygenassist xmm1,xmm0,02h + call $L$key_expansion_128 + aeskeygenassist xmm1,xmm0,04h + call $L$key_expansion_128 + aeskeygenassist xmm1,xmm0,08h + call $L$key_expansion_128 + aeskeygenassist xmm1,xmm0,010h + call $L$key_expansion_128 + aeskeygenassist xmm1,xmm0,020h + call $L$key_expansion_128 + aeskeygenassist xmm1,xmm0,040h + call $L$key_expansion_128 + aeskeygenassist xmm1,xmm0,080h + call $L$key_expansion_128 + aeskeygenassist xmm1,xmm0,01bh + call $L$key_expansion_128 + aeskeygenassist xmm1,xmm0,036h + call $L$key_expansion_128 + movups XMMWORD PTR[rax],xmm0 + mov DWORD PTR[80+rax],edx + xor eax,eax + jmp $L$enc_key_ret + +ALIGN 16 +$L$12rounds:: + movq xmm2,QWORD PTR[16+rcx] + mov edx,11 + movups XMMWORD PTR[r8],xmm0 + aeskeygenassist xmm1,xmm2,01h + call $L$key_expansion_192a_cold + aeskeygenassist xmm1,xmm2,02h + call $L$key_expansion_192b + aeskeygenassist xmm1,xmm2,04h + call $L$key_expansion_192a + aeskeygenassist xmm1,xmm2,08h + call $L$key_expansion_192b + aeskeygenassist xmm1,xmm2,010h + call $L$key_expansion_192a + aeskeygenassist xmm1,xmm2,020h + call $L$key_expansion_192b + aeskeygenassist xmm1,xmm2,040h + call $L$key_expansion_192a + aeskeygenassist xmm1,xmm2,080h + call $L$key_expansion_192b + movups XMMWORD PTR[rax],xmm0 + mov DWORD PTR[48+rax],edx + xor rax,rax + jmp $L$enc_key_ret + +ALIGN 16 +$L$14rounds:: + movups xmm2,XMMWORD PTR[16+rcx] + mov edx,13 + lea rax,QWORD PTR[16+rax] + movups XMMWORD PTR[r8],xmm0 + movups XMMWORD PTR[16+r8],xmm2 + aeskeygenassist xmm1,xmm2,01h + call $L$key_expansion_256a_cold + aeskeygenassist xmm1,xmm0,01h + call $L$key_expansion_256b + aeskeygenassist xmm1,xmm2,02h + call $L$key_expansion_256a + aeskeygenassist xmm1,xmm0,02h + call $L$key_expansion_256b + aeskeygenassist xmm1,xmm2,04h + call $L$key_expansion_256a + aeskeygenassist xmm1,xmm0,04h + call $L$key_expansion_256b + aeskeygenassist xmm1,xmm2,08h + call $L$key_expansion_256a + aeskeygenassist xmm1,xmm0,08h + call $L$key_expansion_256b + aeskeygenassist xmm1,xmm2,010h + call $L$key_expansion_256a + aeskeygenassist xmm1,xmm0,010h + call $L$key_expansion_256b + aeskeygenassist xmm1,xmm2,020h + call $L$key_expansion_256a + aeskeygenassist xmm1,xmm0,020h + call $L$key_expansion_256b + aeskeygenassist xmm1,xmm2,040h + call $L$key_expansion_256a + movups XMMWORD PTR[rax],xmm0 + mov DWORD PTR[16+rax],edx + xor rax,rax + jmp $L$enc_key_ret + +ALIGN 16 +$L$bad_keybits:: + mov rax,-2 +$L$enc_key_ret:: + add rsp,8 + DB 0F3h,0C3h ;repret +$L$SEH_end_set_encrypt_key:: + +ALIGN 16 +$L$key_expansion_128:: + movups XMMWORD PTR[rax],xmm0 + lea rax,QWORD PTR[16+rax] +$L$key_expansion_128_cold:: + shufps xmm4,xmm0,16 + xorps xmm0,xmm4 + shufps xmm4,xmm0,140 + xorps xmm0,xmm4 + shufps xmm1,xmm1,255 + xorps xmm0,xmm1 + DB 0F3h,0C3h ;repret + +ALIGN 16 +$L$key_expansion_192a:: + movups XMMWORD PTR[rax],xmm0 + lea rax,QWORD PTR[16+rax] +$L$key_expansion_192a_cold:: + movaps xmm5,xmm2 +$L$key_expansion_192b_warm:: + shufps xmm4,xmm0,16 + movdqa xmm3,xmm2 + xorps xmm0,xmm4 + shufps xmm4,xmm0,140 + pslldq xmm3,4 + xorps xmm0,xmm4 + pshufd xmm1,xmm1,85 + pxor xmm2,xmm3 + pxor xmm0,xmm1 + pshufd xmm3,xmm0,255 + pxor xmm2,xmm3 + DB 0F3h,0C3h ;repret + +ALIGN 16 +$L$key_expansion_192b:: + movaps xmm3,xmm0 + shufps xmm5,xmm0,68 + movups XMMWORD PTR[rax],xmm5 + shufps xmm3,xmm2,78 + movups XMMWORD PTR[16+rax],xmm3 + lea rax,QWORD PTR[32+rax] + jmp $L$key_expansion_192b_warm + +ALIGN 16 +$L$key_expansion_256a:: + movups XMMWORD PTR[rax],xmm2 + lea rax,QWORD PTR[16+rax] +$L$key_expansion_256a_cold:: + shufps xmm4,xmm0,16 + xorps xmm0,xmm4 + shufps xmm4,xmm0,140 + xorps xmm0,xmm4 + shufps xmm1,xmm1,255 + xorps xmm0,xmm1 + DB 0F3h,0C3h ;repret + +ALIGN 16 +$L$key_expansion_256b:: + movups XMMWORD PTR[rax],xmm0 + lea rax,QWORD PTR[16+rax] + + shufps xmm4,xmm2,16 + xorps xmm2,xmm4 + shufps xmm4,xmm2,140 + xorps xmm2,xmm4 + shufps xmm1,xmm1,170 + xorps xmm2,xmm1 + DB 0F3h,0C3h ;repret +aesni_set_encrypt_key ENDP + +ALIGN 64 +$L$bswap_mask:: +DB 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 +$L$increment32:: + DD 6,6,6,0 +$L$increment64:: + DD 1,0,0,0 +$L$xts_magic:: + DD 087h,0,1,0 + +DB 65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69 +DB 83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83 +DB 32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115 +DB 115,108,46,111,114,103,62,0 +ALIGN 64 +EXTERN __imp_RtlVirtualUnwind:NEAR + +ALIGN 16 +ecb_se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[152+r8] + + jmp $L$common_seh_tail +ecb_se_handler ENDP + + +ALIGN 16 +ccm64_se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + mov rsi,QWORD PTR[8+r9] + mov r11,QWORD PTR[56+r9] + + mov r10d,DWORD PTR[r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$common_seh_tail + + mov rax,QWORD PTR[152+r8] + + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jae $L$common_seh_tail + + lea rsi,QWORD PTR[rax] + lea rdi,QWORD PTR[512+r8] + mov ecx,8 + DD 0a548f3fch + lea rax,QWORD PTR[88+rax] + + jmp $L$common_seh_tail +ccm64_se_handler ENDP + + +ALIGN 16 +ctr32_se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + lea r10,QWORD PTR[$L$ctr32_body] + cmp rbx,r10 + jb $L$common_seh_tail + + mov rax,QWORD PTR[152+r8] + + lea r10,QWORD PTR[$L$ctr32_ret] + cmp rbx,r10 + jae $L$common_seh_tail + + lea rsi,QWORD PTR[32+rax] + lea rdi,QWORD PTR[512+r8] + mov ecx,20 + DD 0a548f3fch + lea rax,QWORD PTR[200+rax] + + jmp $L$common_seh_tail +ctr32_se_handler ENDP + + +ALIGN 16 +xts_se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + mov rsi,QWORD PTR[8+r9] + mov r11,QWORD PTR[56+r9] + + mov r10d,DWORD PTR[r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$common_seh_tail + + mov rax,QWORD PTR[152+r8] + + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jae $L$common_seh_tail + + lea rsi,QWORD PTR[96+rax] + lea rdi,QWORD PTR[512+r8] + mov ecx,20 + DD 0a548f3fch + lea rax,QWORD PTR[((104+160))+rax] + + jmp $L$common_seh_tail +xts_se_handler ENDP + +ALIGN 16 +cbc_se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[152+r8] + mov rbx,QWORD PTR[248+r8] + + lea r10,QWORD PTR[$L$cbc_decrypt] + cmp rbx,r10 + jb $L$common_seh_tail + + lea r10,QWORD PTR[$L$cbc_decrypt_body] + cmp rbx,r10 + jb $L$restore_cbc_rax + + lea r10,QWORD PTR[$L$cbc_ret] + cmp rbx,r10 + jae $L$common_seh_tail + + lea rsi,QWORD PTR[rax] + lea rdi,QWORD PTR[512+r8] + mov ecx,8 + DD 0a548f3fch + lea rax,QWORD PTR[88+rax] + jmp $L$common_seh_tail + +$L$restore_cbc_rax:: + mov rax,QWORD PTR[120+r8] + +$L$common_seh_tail:: + mov rdi,QWORD PTR[8+rax] + mov rsi,QWORD PTR[16+rax] + mov QWORD PTR[152+r8],rax + mov QWORD PTR[168+r8],rsi + mov QWORD PTR[176+r8],rdi + + mov rdi,QWORD PTR[40+r9] + mov rsi,r8 + mov ecx,154 + DD 0a548f3fch + + mov rsi,r9 + xor rcx,rcx + mov rdx,QWORD PTR[8+rsi] + mov r8,QWORD PTR[rsi] + mov r9,QWORD PTR[16+rsi] + mov r10,QWORD PTR[40+rsi] + lea r11,QWORD PTR[56+rsi] + lea r12,QWORD PTR[24+rsi] + mov QWORD PTR[32+rsp],r10 + mov QWORD PTR[40+rsp],r11 + mov QWORD PTR[48+rsp],r12 + mov QWORD PTR[56+rsp],rcx + call QWORD PTR[__imp_RtlVirtualUnwind] + + mov eax,1 + add rsp,64 + popfq + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + pop rbx + pop rdi + pop rsi + DB 0F3h,0C3h ;repret +cbc_se_handler ENDP + +.text$ ENDS +.pdata SEGMENT READONLY ALIGN(4) +ALIGN 4 + DD imagerel $L$SEH_begin_aesni_ecb_encrypt + DD imagerel $L$SEH_end_aesni_ecb_encrypt + DD imagerel $L$SEH_info_ecb + + DD imagerel $L$SEH_begin_aesni_ccm64_encrypt_blocks + DD imagerel $L$SEH_end_aesni_ccm64_encrypt_blocks + DD imagerel $L$SEH_info_ccm64_enc + + DD imagerel $L$SEH_begin_aesni_ccm64_decrypt_blocks + DD imagerel $L$SEH_end_aesni_ccm64_decrypt_blocks + DD imagerel $L$SEH_info_ccm64_dec + + DD imagerel $L$SEH_begin_aesni_ctr32_encrypt_blocks + DD imagerel $L$SEH_end_aesni_ctr32_encrypt_blocks + DD imagerel $L$SEH_info_ctr32 + + DD imagerel $L$SEH_begin_aesni_xts_encrypt + DD imagerel $L$SEH_end_aesni_xts_encrypt + DD imagerel $L$SEH_info_xts_enc + + DD imagerel $L$SEH_begin_aesni_xts_decrypt + DD imagerel $L$SEH_end_aesni_xts_decrypt + DD imagerel $L$SEH_info_xts_dec + DD imagerel $L$SEH_begin_aesni_cbc_encrypt + DD imagerel $L$SEH_end_aesni_cbc_encrypt + DD imagerel $L$SEH_info_cbc + + DD imagerel aesni_set_decrypt_key + DD imagerel $L$SEH_end_set_decrypt_key + DD imagerel $L$SEH_info_key + + DD imagerel aesni_set_encrypt_key + DD imagerel $L$SEH_end_set_encrypt_key + DD imagerel $L$SEH_info_key +.pdata ENDS +.xdata SEGMENT READONLY ALIGN(8) +ALIGN 8 +$L$SEH_info_ecb:: +DB 9,0,0,0 + DD imagerel ecb_se_handler +$L$SEH_info_ccm64_enc:: +DB 9,0,0,0 + DD imagerel ccm64_se_handler + DD imagerel $L$ccm64_enc_body,imagerel $L$ccm64_enc_ret +$L$SEH_info_ccm64_dec:: +DB 9,0,0,0 + DD imagerel ccm64_se_handler + DD imagerel $L$ccm64_dec_body,imagerel $L$ccm64_dec_ret +$L$SEH_info_ctr32:: +DB 9,0,0,0 + DD imagerel ctr32_se_handler +$L$SEH_info_xts_enc:: +DB 9,0,0,0 + DD imagerel xts_se_handler + DD imagerel $L$xts_enc_body,imagerel $L$xts_enc_epilogue +$L$SEH_info_xts_dec:: +DB 9,0,0,0 + DD imagerel xts_se_handler + DD imagerel $L$xts_dec_body,imagerel $L$xts_dec_epilogue +$L$SEH_info_cbc:: +DB 9,0,0,0 + DD imagerel cbc_se_handler +$L$SEH_info_key:: +DB 001h,004h,001h,000h +DB 004h,002h,000h,000h + +.xdata ENDS +END diff --git a/crypto/aes/aesni-mingw64-x86_64.S b/crypto/aes/aesni-mingw64-x86_64.S new file mode 100644 index 00000000..0a82a10c --- /dev/null +++ b/crypto/aes/aesni-mingw64-x86_64.S @@ -0,0 +1,3008 @@ +#include "x86_arch.h" +.text +.globl aesni_encrypt +.def aesni_encrypt; .scl 2; .type 32; .endef +.p2align 4 +aesni_encrypt: + movups (%rcx),%xmm2 + movl 240(%r8),%eax + movups (%r8),%xmm0 + movups 16(%r8),%xmm1 + leaq 32(%r8),%r8 + xorps %xmm0,%xmm2 +.Loop_enc1_1: + aesenc %xmm1,%xmm2 + decl %eax + movups (%r8),%xmm1 + leaq 16(%r8),%r8 + jnz .Loop_enc1_1 + aesenclast %xmm1,%xmm2 + movups %xmm2,(%rdx) + retq + + +.globl aesni_decrypt +.def aesni_decrypt; .scl 2; .type 32; .endef +.p2align 4 +aesni_decrypt: + movups (%rcx),%xmm2 + movl 240(%r8),%eax + movups (%r8),%xmm0 + movups 16(%r8),%xmm1 + leaq 32(%r8),%r8 + xorps %xmm0,%xmm2 +.Loop_dec1_2: + aesdec %xmm1,%xmm2 + decl %eax + movups (%r8),%xmm1 + leaq 16(%r8),%r8 + jnz .Loop_dec1_2 + aesdeclast %xmm1,%xmm2 + movups %xmm2,(%rdx) + retq + +.def _aesni_encrypt3; .scl 3; .type 32; .endef +.p2align 4 +_aesni_encrypt3: + movups (%rcx),%xmm0 + shrl $1,%eax + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 + xorps %xmm0,%xmm3 + xorps %xmm0,%xmm4 + movups (%rcx),%xmm0 + +.Lenc_loop3: + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + decl %eax + aesenc %xmm1,%xmm4 + movups 16(%rcx),%xmm1 + aesenc %xmm0,%xmm2 + aesenc %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesenc %xmm0,%xmm4 + movups (%rcx),%xmm0 + jnz .Lenc_loop3 + + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + aesenc %xmm1,%xmm4 + aesenclast %xmm0,%xmm2 + aesenclast %xmm0,%xmm3 + aesenclast %xmm0,%xmm4 + retq + +.def _aesni_decrypt3; .scl 3; .type 32; .endef +.p2align 4 +_aesni_decrypt3: + movups (%rcx),%xmm0 + shrl $1,%eax + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 + xorps %xmm0,%xmm3 + xorps %xmm0,%xmm4 + movups (%rcx),%xmm0 + +.Ldec_loop3: + aesdec %xmm1,%xmm2 + aesdec %xmm1,%xmm3 + decl %eax + aesdec %xmm1,%xmm4 + movups 16(%rcx),%xmm1 + aesdec %xmm0,%xmm2 + aesdec %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesdec %xmm0,%xmm4 + movups (%rcx),%xmm0 + jnz .Ldec_loop3 + + aesdec %xmm1,%xmm2 + aesdec %xmm1,%xmm3 + aesdec %xmm1,%xmm4 + aesdeclast %xmm0,%xmm2 + aesdeclast %xmm0,%xmm3 + aesdeclast %xmm0,%xmm4 + retq + +.def _aesni_encrypt4; .scl 3; .type 32; .endef +.p2align 4 +_aesni_encrypt4: + movups (%rcx),%xmm0 + shrl $1,%eax + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 + xorps %xmm0,%xmm3 + xorps %xmm0,%xmm4 + xorps %xmm0,%xmm5 + movups (%rcx),%xmm0 + +.Lenc_loop4: + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + decl %eax + aesenc %xmm1,%xmm4 + aesenc %xmm1,%xmm5 + movups 16(%rcx),%xmm1 + aesenc %xmm0,%xmm2 + aesenc %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesenc %xmm0,%xmm4 + aesenc %xmm0,%xmm5 + movups (%rcx),%xmm0 + jnz .Lenc_loop4 + + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + aesenc %xmm1,%xmm4 + aesenc %xmm1,%xmm5 + aesenclast %xmm0,%xmm2 + aesenclast %xmm0,%xmm3 + aesenclast %xmm0,%xmm4 + aesenclast %xmm0,%xmm5 + retq + +.def _aesni_decrypt4; .scl 3; .type 32; .endef +.p2align 4 +_aesni_decrypt4: + movups (%rcx),%xmm0 + shrl $1,%eax + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 + xorps %xmm0,%xmm3 + xorps %xmm0,%xmm4 + xorps %xmm0,%xmm5 + movups (%rcx),%xmm0 + +.Ldec_loop4: + aesdec %xmm1,%xmm2 + aesdec %xmm1,%xmm3 + decl %eax + aesdec %xmm1,%xmm4 + aesdec %xmm1,%xmm5 + movups 16(%rcx),%xmm1 + aesdec %xmm0,%xmm2 + aesdec %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesdec %xmm0,%xmm4 + aesdec %xmm0,%xmm5 + movups (%rcx),%xmm0 + jnz .Ldec_loop4 + + aesdec %xmm1,%xmm2 + aesdec %xmm1,%xmm3 + aesdec %xmm1,%xmm4 + aesdec %xmm1,%xmm5 + aesdeclast %xmm0,%xmm2 + aesdeclast %xmm0,%xmm3 + aesdeclast %xmm0,%xmm4 + aesdeclast %xmm0,%xmm5 + retq + +.def _aesni_encrypt6; .scl 3; .type 32; .endef +.p2align 4 +_aesni_encrypt6: + movups (%rcx),%xmm0 + shrl $1,%eax + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 + pxor %xmm0,%xmm3 + aesenc %xmm1,%xmm2 + pxor %xmm0,%xmm4 + aesenc %xmm1,%xmm3 + pxor %xmm0,%xmm5 + aesenc %xmm1,%xmm4 + pxor %xmm0,%xmm6 + aesenc %xmm1,%xmm5 + pxor %xmm0,%xmm7 + decl %eax + aesenc %xmm1,%xmm6 + movups (%rcx),%xmm0 + aesenc %xmm1,%xmm7 + jmp .Lenc_loop6_enter +.p2align 4 +.Lenc_loop6: + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + decl %eax + aesenc %xmm1,%xmm4 + aesenc %xmm1,%xmm5 + aesenc %xmm1,%xmm6 + aesenc %xmm1,%xmm7 +.Lenc_loop6_enter: + movups 16(%rcx),%xmm1 + aesenc %xmm0,%xmm2 + aesenc %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesenc %xmm0,%xmm4 + aesenc %xmm0,%xmm5 + aesenc %xmm0,%xmm6 + aesenc %xmm0,%xmm7 + movups (%rcx),%xmm0 + jnz .Lenc_loop6 + + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + aesenc %xmm1,%xmm4 + aesenc %xmm1,%xmm5 + aesenc %xmm1,%xmm6 + aesenc %xmm1,%xmm7 + aesenclast %xmm0,%xmm2 + aesenclast %xmm0,%xmm3 + aesenclast %xmm0,%xmm4 + aesenclast %xmm0,%xmm5 + aesenclast %xmm0,%xmm6 + aesenclast %xmm0,%xmm7 + retq + +.def _aesni_decrypt6; .scl 3; .type 32; .endef +.p2align 4 +_aesni_decrypt6: + movups (%rcx),%xmm0 + shrl $1,%eax + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 + pxor %xmm0,%xmm3 + aesdec %xmm1,%xmm2 + pxor %xmm0,%xmm4 + aesdec %xmm1,%xmm3 + pxor %xmm0,%xmm5 + aesdec %xmm1,%xmm4 + pxor %xmm0,%xmm6 + aesdec %xmm1,%xmm5 + pxor %xmm0,%xmm7 + decl %eax + aesdec %xmm1,%xmm6 + movups (%rcx),%xmm0 + aesdec %xmm1,%xmm7 + jmp .Ldec_loop6_enter +.p2align 4 +.Ldec_loop6: + aesdec %xmm1,%xmm2 + aesdec %xmm1,%xmm3 + decl %eax + aesdec %xmm1,%xmm4 + aesdec %xmm1,%xmm5 + aesdec %xmm1,%xmm6 + aesdec %xmm1,%xmm7 +.Ldec_loop6_enter: + movups 16(%rcx),%xmm1 + aesdec %xmm0,%xmm2 + aesdec %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesdec %xmm0,%xmm4 + aesdec %xmm0,%xmm5 + aesdec %xmm0,%xmm6 + aesdec %xmm0,%xmm7 + movups (%rcx),%xmm0 + jnz .Ldec_loop6 + + aesdec %xmm1,%xmm2 + aesdec %xmm1,%xmm3 + aesdec %xmm1,%xmm4 + aesdec %xmm1,%xmm5 + aesdec %xmm1,%xmm6 + aesdec %xmm1,%xmm7 + aesdeclast %xmm0,%xmm2 + aesdeclast %xmm0,%xmm3 + aesdeclast %xmm0,%xmm4 + aesdeclast %xmm0,%xmm5 + aesdeclast %xmm0,%xmm6 + aesdeclast %xmm0,%xmm7 + retq + +.def _aesni_encrypt8; .scl 3; .type 32; .endef +.p2align 4 +_aesni_encrypt8: + movups (%rcx),%xmm0 + shrl $1,%eax + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 + xorps %xmm0,%xmm3 + aesenc %xmm1,%xmm2 + pxor %xmm0,%xmm4 + aesenc %xmm1,%xmm3 + pxor %xmm0,%xmm5 + aesenc %xmm1,%xmm4 + pxor %xmm0,%xmm6 + aesenc %xmm1,%xmm5 + pxor %xmm0,%xmm7 + decl %eax + aesenc %xmm1,%xmm6 + pxor %xmm0,%xmm8 + aesenc %xmm1,%xmm7 + pxor %xmm0,%xmm9 + movups (%rcx),%xmm0 + aesenc %xmm1,%xmm8 + aesenc %xmm1,%xmm9 + movups 16(%rcx),%xmm1 + jmp .Lenc_loop8_enter +.p2align 4 +.Lenc_loop8: + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + decl %eax + aesenc %xmm1,%xmm4 + aesenc %xmm1,%xmm5 + aesenc %xmm1,%xmm6 + aesenc %xmm1,%xmm7 + aesenc %xmm1,%xmm8 + aesenc %xmm1,%xmm9 + movups 16(%rcx),%xmm1 +.Lenc_loop8_enter: + aesenc %xmm0,%xmm2 + aesenc %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesenc %xmm0,%xmm4 + aesenc %xmm0,%xmm5 + aesenc %xmm0,%xmm6 + aesenc %xmm0,%xmm7 + aesenc %xmm0,%xmm8 + aesenc %xmm0,%xmm9 + movups (%rcx),%xmm0 + jnz .Lenc_loop8 + + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + aesenc %xmm1,%xmm4 + aesenc %xmm1,%xmm5 + aesenc %xmm1,%xmm6 + aesenc %xmm1,%xmm7 + aesenc %xmm1,%xmm8 + aesenc %xmm1,%xmm9 + aesenclast %xmm0,%xmm2 + aesenclast %xmm0,%xmm3 + aesenclast %xmm0,%xmm4 + aesenclast %xmm0,%xmm5 + aesenclast %xmm0,%xmm6 + aesenclast %xmm0,%xmm7 + aesenclast %xmm0,%xmm8 + aesenclast %xmm0,%xmm9 + retq + +.def _aesni_decrypt8; .scl 3; .type 32; .endef +.p2align 4 +_aesni_decrypt8: + movups (%rcx),%xmm0 + shrl $1,%eax + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 + xorps %xmm0,%xmm3 + aesdec %xmm1,%xmm2 + pxor %xmm0,%xmm4 + aesdec %xmm1,%xmm3 + pxor %xmm0,%xmm5 + aesdec %xmm1,%xmm4 + pxor %xmm0,%xmm6 + aesdec %xmm1,%xmm5 + pxor %xmm0,%xmm7 + decl %eax + aesdec %xmm1,%xmm6 + pxor %xmm0,%xmm8 + aesdec %xmm1,%xmm7 + pxor %xmm0,%xmm9 + movups (%rcx),%xmm0 + aesdec %xmm1,%xmm8 + aesdec %xmm1,%xmm9 + movups 16(%rcx),%xmm1 + jmp .Ldec_loop8_enter +.p2align 4 +.Ldec_loop8: + aesdec %xmm1,%xmm2 + aesdec %xmm1,%xmm3 + decl %eax + aesdec %xmm1,%xmm4 + aesdec %xmm1,%xmm5 + aesdec %xmm1,%xmm6 + aesdec %xmm1,%xmm7 + aesdec %xmm1,%xmm8 + aesdec %xmm1,%xmm9 + movups 16(%rcx),%xmm1 +.Ldec_loop8_enter: + aesdec %xmm0,%xmm2 + aesdec %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesdec %xmm0,%xmm4 + aesdec %xmm0,%xmm5 + aesdec %xmm0,%xmm6 + aesdec %xmm0,%xmm7 + aesdec %xmm0,%xmm8 + aesdec %xmm0,%xmm9 + movups (%rcx),%xmm0 + jnz .Ldec_loop8 + + aesdec %xmm1,%xmm2 + aesdec %xmm1,%xmm3 + aesdec %xmm1,%xmm4 + aesdec %xmm1,%xmm5 + aesdec %xmm1,%xmm6 + aesdec %xmm1,%xmm7 + aesdec %xmm1,%xmm8 + aesdec %xmm1,%xmm9 + aesdeclast %xmm0,%xmm2 + aesdeclast %xmm0,%xmm3 + aesdeclast %xmm0,%xmm4 + aesdeclast %xmm0,%xmm5 + aesdeclast %xmm0,%xmm6 + aesdeclast %xmm0,%xmm7 + aesdeclast %xmm0,%xmm8 + aesdeclast %xmm0,%xmm9 + retq + +.globl aesni_ecb_encrypt +.def aesni_ecb_encrypt; .scl 2; .type 32; .endef +.p2align 4 +aesni_ecb_encrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_aesni_ecb_encrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + + andq $-16,%rdx + jz .Lecb_ret + + movl 240(%rcx),%eax + movups (%rcx),%xmm0 + movq %rcx,%r11 + movl %eax,%r10d + testl %r8d,%r8d + jz .Lecb_decrypt + + cmpq $128,%rdx + jb .Lecb_enc_tail + + movdqu (%rdi),%xmm2 + movdqu 16(%rdi),%xmm3 + movdqu 32(%rdi),%xmm4 + movdqu 48(%rdi),%xmm5 + movdqu 64(%rdi),%xmm6 + movdqu 80(%rdi),%xmm7 + movdqu 96(%rdi),%xmm8 + movdqu 112(%rdi),%xmm9 + leaq 128(%rdi),%rdi + subq $128,%rdx + jmp .Lecb_enc_loop8_enter +.p2align 4 +.Lecb_enc_loop8: + movups %xmm2,(%rsi) + movq %r11,%rcx + movdqu (%rdi),%xmm2 + movl %r10d,%eax + movups %xmm3,16(%rsi) + movdqu 16(%rdi),%xmm3 + movups %xmm4,32(%rsi) + movdqu 32(%rdi),%xmm4 + movups %xmm5,48(%rsi) + movdqu 48(%rdi),%xmm5 + movups %xmm6,64(%rsi) + movdqu 64(%rdi),%xmm6 + movups %xmm7,80(%rsi) + movdqu 80(%rdi),%xmm7 + movups %xmm8,96(%rsi) + movdqu 96(%rdi),%xmm8 + movups %xmm9,112(%rsi) + leaq 128(%rsi),%rsi + movdqu 112(%rdi),%xmm9 + leaq 128(%rdi),%rdi +.Lecb_enc_loop8_enter: + + call _aesni_encrypt8 + + subq $128,%rdx + jnc .Lecb_enc_loop8 + + movups %xmm2,(%rsi) + movq %r11,%rcx + movups %xmm3,16(%rsi) + movl %r10d,%eax + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movups %xmm6,64(%rsi) + movups %xmm7,80(%rsi) + movups %xmm8,96(%rsi) + movups %xmm9,112(%rsi) + leaq 128(%rsi),%rsi + addq $128,%rdx + jz .Lecb_ret + +.Lecb_enc_tail: + movups (%rdi),%xmm2 + cmpq $32,%rdx + jb .Lecb_enc_one + movups 16(%rdi),%xmm3 + je .Lecb_enc_two + movups 32(%rdi),%xmm4 + cmpq $64,%rdx + jb .Lecb_enc_three + movups 48(%rdi),%xmm5 + je .Lecb_enc_four + movups 64(%rdi),%xmm6 + cmpq $96,%rdx + jb .Lecb_enc_five + movups 80(%rdi),%xmm7 + je .Lecb_enc_six + movdqu 96(%rdi),%xmm8 + call _aesni_encrypt8 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movups %xmm6,64(%rsi) + movups %xmm7,80(%rsi) + movups %xmm8,96(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_enc_one: + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 +.Loop_enc1_3: + aesenc %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_enc1_3 + aesenclast %xmm1,%xmm2 + movups %xmm2,(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_enc_two: + xorps %xmm4,%xmm4 + call _aesni_encrypt3 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_enc_three: + call _aesni_encrypt3 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_enc_four: + call _aesni_encrypt4 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_enc_five: + xorps %xmm7,%xmm7 + call _aesni_encrypt6 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movups %xmm6,64(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_enc_six: + call _aesni_encrypt6 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movups %xmm6,64(%rsi) + movups %xmm7,80(%rsi) + jmp .Lecb_ret + +.p2align 4 +.Lecb_decrypt: + cmpq $128,%rdx + jb .Lecb_dec_tail + + movdqu (%rdi),%xmm2 + movdqu 16(%rdi),%xmm3 + movdqu 32(%rdi),%xmm4 + movdqu 48(%rdi),%xmm5 + movdqu 64(%rdi),%xmm6 + movdqu 80(%rdi),%xmm7 + movdqu 96(%rdi),%xmm8 + movdqu 112(%rdi),%xmm9 + leaq 128(%rdi),%rdi + subq $128,%rdx + jmp .Lecb_dec_loop8_enter +.p2align 4 +.Lecb_dec_loop8: + movups %xmm2,(%rsi) + movq %r11,%rcx + movdqu (%rdi),%xmm2 + movl %r10d,%eax + movups %xmm3,16(%rsi) + movdqu 16(%rdi),%xmm3 + movups %xmm4,32(%rsi) + movdqu 32(%rdi),%xmm4 + movups %xmm5,48(%rsi) + movdqu 48(%rdi),%xmm5 + movups %xmm6,64(%rsi) + movdqu 64(%rdi),%xmm6 + movups %xmm7,80(%rsi) + movdqu 80(%rdi),%xmm7 + movups %xmm8,96(%rsi) + movdqu 96(%rdi),%xmm8 + movups %xmm9,112(%rsi) + leaq 128(%rsi),%rsi + movdqu 112(%rdi),%xmm9 + leaq 128(%rdi),%rdi +.Lecb_dec_loop8_enter: + + call _aesni_decrypt8 + + movups (%r11),%xmm0 + subq $128,%rdx + jnc .Lecb_dec_loop8 + + movups %xmm2,(%rsi) + movq %r11,%rcx + movups %xmm3,16(%rsi) + movl %r10d,%eax + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movups %xmm6,64(%rsi) + movups %xmm7,80(%rsi) + movups %xmm8,96(%rsi) + movups %xmm9,112(%rsi) + leaq 128(%rsi),%rsi + addq $128,%rdx + jz .Lecb_ret + +.Lecb_dec_tail: + movups (%rdi),%xmm2 + cmpq $32,%rdx + jb .Lecb_dec_one + movups 16(%rdi),%xmm3 + je .Lecb_dec_two + movups 32(%rdi),%xmm4 + cmpq $64,%rdx + jb .Lecb_dec_three + movups 48(%rdi),%xmm5 + je .Lecb_dec_four + movups 64(%rdi),%xmm6 + cmpq $96,%rdx + jb .Lecb_dec_five + movups 80(%rdi),%xmm7 + je .Lecb_dec_six + movups 96(%rdi),%xmm8 + movups (%rcx),%xmm0 + call _aesni_decrypt8 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movups %xmm6,64(%rsi) + movups %xmm7,80(%rsi) + movups %xmm8,96(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_dec_one: + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 +.Loop_dec1_4: + aesdec %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_dec1_4 + aesdeclast %xmm1,%xmm2 + movups %xmm2,(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_dec_two: + xorps %xmm4,%xmm4 + call _aesni_decrypt3 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_dec_three: + call _aesni_decrypt3 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_dec_four: + call _aesni_decrypt4 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_dec_five: + xorps %xmm7,%xmm7 + call _aesni_decrypt6 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movups %xmm6,64(%rsi) + jmp .Lecb_ret +.p2align 4 +.Lecb_dec_six: + call _aesni_decrypt6 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movups %xmm6,64(%rsi) + movups %xmm7,80(%rsi) + +.Lecb_ret: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_aesni_ecb_encrypt: +.globl aesni_ccm64_encrypt_blocks +.def aesni_ccm64_encrypt_blocks; .scl 2; .type 32; .endef +.p2align 4 +aesni_ccm64_encrypt_blocks: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_aesni_ccm64_encrypt_blocks: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + movq 48(%rsp),%r9 + + leaq -88(%rsp),%rsp + movaps %xmm6,(%rsp) + movaps %xmm7,16(%rsp) + movaps %xmm8,32(%rsp) + movaps %xmm9,48(%rsp) +.Lccm64_enc_body: + movl 240(%rcx),%eax + movdqu (%r8),%xmm9 + movdqa .Lincrement64(%rip),%xmm6 + movdqa .Lbswap_mask(%rip),%xmm7 + + shrl $1,%eax + leaq 0(%rcx),%r11 + movdqu (%r9),%xmm3 + movdqa %xmm9,%xmm2 + movl %eax,%r10d +.byte 102,68,15,56,0,207 + jmp .Lccm64_enc_outer +.p2align 4 +.Lccm64_enc_outer: + movups (%r11),%xmm0 + movl %r10d,%eax + movups (%rdi),%xmm8 + + xorps %xmm0,%xmm2 + movups 16(%r11),%xmm1 + xorps %xmm8,%xmm0 + leaq 32(%r11),%rcx + xorps %xmm0,%xmm3 + movups (%rcx),%xmm0 + +.Lccm64_enc2_loop: + aesenc %xmm1,%xmm2 + decl %eax + aesenc %xmm1,%xmm3 + movups 16(%rcx),%xmm1 + aesenc %xmm0,%xmm2 + leaq 32(%rcx),%rcx + aesenc %xmm0,%xmm3 + movups 0(%rcx),%xmm0 + jnz .Lccm64_enc2_loop + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + paddq %xmm6,%xmm9 + aesenclast %xmm0,%xmm2 + aesenclast %xmm0,%xmm3 + + decq %rdx + leaq 16(%rdi),%rdi + xorps %xmm2,%xmm8 + movdqa %xmm9,%xmm2 + movups %xmm8,(%rsi) + leaq 16(%rsi),%rsi +.byte 102,15,56,0,215 + jnz .Lccm64_enc_outer + + movups %xmm3,(%r9) + movaps (%rsp),%xmm6 + movaps 16(%rsp),%xmm7 + movaps 32(%rsp),%xmm8 + movaps 48(%rsp),%xmm9 + leaq 88(%rsp),%rsp +.Lccm64_enc_ret: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_aesni_ccm64_encrypt_blocks: +.globl aesni_ccm64_decrypt_blocks +.def aesni_ccm64_decrypt_blocks; .scl 2; .type 32; .endef +.p2align 4 +aesni_ccm64_decrypt_blocks: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_aesni_ccm64_decrypt_blocks: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + movq 48(%rsp),%r9 + + leaq -88(%rsp),%rsp + movaps %xmm6,(%rsp) + movaps %xmm7,16(%rsp) + movaps %xmm8,32(%rsp) + movaps %xmm9,48(%rsp) +.Lccm64_dec_body: + movl 240(%rcx),%eax + movups (%r8),%xmm9 + movdqu (%r9),%xmm3 + movdqa .Lincrement64(%rip),%xmm6 + movdqa .Lbswap_mask(%rip),%xmm7 + + movaps %xmm9,%xmm2 + movl %eax,%r10d + movq %rcx,%r11 +.byte 102,68,15,56,0,207 + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 +.Loop_enc1_5: + aesenc %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_enc1_5 + aesenclast %xmm1,%xmm2 + movups (%rdi),%xmm8 + paddq %xmm6,%xmm9 + leaq 16(%rdi),%rdi + jmp .Lccm64_dec_outer +.p2align 4 +.Lccm64_dec_outer: + xorps %xmm2,%xmm8 + movdqa %xmm9,%xmm2 + movl %r10d,%eax + movups %xmm8,(%rsi) + leaq 16(%rsi),%rsi +.byte 102,15,56,0,215 + + subq $1,%rdx + jz .Lccm64_dec_break + + movups (%r11),%xmm0 + shrl $1,%eax + movups 16(%r11),%xmm1 + xorps %xmm0,%xmm8 + leaq 32(%r11),%rcx + xorps %xmm0,%xmm2 + xorps %xmm8,%xmm3 + movups (%rcx),%xmm0 + +.Lccm64_dec2_loop: + aesenc %xmm1,%xmm2 + decl %eax + aesenc %xmm1,%xmm3 + movups 16(%rcx),%xmm1 + aesenc %xmm0,%xmm2 + leaq 32(%rcx),%rcx + aesenc %xmm0,%xmm3 + movups 0(%rcx),%xmm0 + jnz .Lccm64_dec2_loop + movups (%rdi),%xmm8 + paddq %xmm6,%xmm9 + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + leaq 16(%rdi),%rdi + aesenclast %xmm0,%xmm2 + aesenclast %xmm0,%xmm3 + jmp .Lccm64_dec_outer + +.p2align 4 +.Lccm64_dec_break: + + movups (%r11),%xmm0 + movups 16(%r11),%xmm1 + xorps %xmm0,%xmm8 + leaq 32(%r11),%r11 + xorps %xmm8,%xmm3 +.Loop_enc1_6: + aesenc %xmm1,%xmm3 + decl %eax + movups (%r11),%xmm1 + leaq 16(%r11),%r11 + jnz .Loop_enc1_6 + aesenclast %xmm1,%xmm3 + movups %xmm3,(%r9) + movaps (%rsp),%xmm6 + movaps 16(%rsp),%xmm7 + movaps 32(%rsp),%xmm8 + movaps 48(%rsp),%xmm9 + leaq 88(%rsp),%rsp +.Lccm64_dec_ret: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_aesni_ccm64_decrypt_blocks: +.globl aesni_ctr32_encrypt_blocks +.def aesni_ctr32_encrypt_blocks; .scl 2; .type 32; .endef +.p2align 4 +aesni_ctr32_encrypt_blocks: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_aesni_ctr32_encrypt_blocks: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + + leaq -200(%rsp),%rsp + movaps %xmm6,32(%rsp) + movaps %xmm7,48(%rsp) + movaps %xmm8,64(%rsp) + movaps %xmm9,80(%rsp) + movaps %xmm10,96(%rsp) + movaps %xmm11,112(%rsp) + movaps %xmm12,128(%rsp) + movaps %xmm13,144(%rsp) + movaps %xmm14,160(%rsp) + movaps %xmm15,176(%rsp) +.Lctr32_body: + cmpq $1,%rdx + je .Lctr32_one_shortcut + + movdqu (%r8),%xmm14 + movdqa .Lbswap_mask(%rip),%xmm15 + xorl %eax,%eax +.byte 102,69,15,58,22,242,3 +.byte 102,68,15,58,34,240,3 + + movl 240(%rcx),%eax + bswapl %r10d + pxor %xmm12,%xmm12 + pxor %xmm13,%xmm13 +.byte 102,69,15,58,34,226,0 + leaq 3(%r10),%r11 +.byte 102,69,15,58,34,235,0 + incl %r10d +.byte 102,69,15,58,34,226,1 + incq %r11 +.byte 102,69,15,58,34,235,1 + incl %r10d +.byte 102,69,15,58,34,226,2 + incq %r11 +.byte 102,69,15,58,34,235,2 + movdqa %xmm12,0(%rsp) +.byte 102,69,15,56,0,231 + movdqa %xmm13,16(%rsp) +.byte 102,69,15,56,0,239 + + pshufd $192,%xmm12,%xmm2 + pshufd $128,%xmm12,%xmm3 + pshufd $64,%xmm12,%xmm4 + cmpq $6,%rdx + jb .Lctr32_tail + shrl $1,%eax + movq %rcx,%r11 + movl %eax,%r10d + subq $6,%rdx + jmp .Lctr32_loop6 + +.p2align 4 +.Lctr32_loop6: + pshufd $192,%xmm13,%xmm5 + por %xmm14,%xmm2 + movups (%r11),%xmm0 + pshufd $128,%xmm13,%xmm6 + por %xmm14,%xmm3 + movups 16(%r11),%xmm1 + pshufd $64,%xmm13,%xmm7 + por %xmm14,%xmm4 + por %xmm14,%xmm5 + xorps %xmm0,%xmm2 + por %xmm14,%xmm6 + por %xmm14,%xmm7 + + + + + pxor %xmm0,%xmm3 + aesenc %xmm1,%xmm2 + leaq 32(%r11),%rcx + pxor %xmm0,%xmm4 + aesenc %xmm1,%xmm3 + movdqa .Lincrement32(%rip),%xmm13 + pxor %xmm0,%xmm5 + aesenc %xmm1,%xmm4 + movdqa 0(%rsp),%xmm12 + pxor %xmm0,%xmm6 + aesenc %xmm1,%xmm5 + pxor %xmm0,%xmm7 + movups (%rcx),%xmm0 + decl %eax + aesenc %xmm1,%xmm6 + aesenc %xmm1,%xmm7 + jmp .Lctr32_enc_loop6_enter +.p2align 4 +.Lctr32_enc_loop6: + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + decl %eax + aesenc %xmm1,%xmm4 + aesenc %xmm1,%xmm5 + aesenc %xmm1,%xmm6 + aesenc %xmm1,%xmm7 +.Lctr32_enc_loop6_enter: + movups 16(%rcx),%xmm1 + aesenc %xmm0,%xmm2 + aesenc %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesenc %xmm0,%xmm4 + aesenc %xmm0,%xmm5 + aesenc %xmm0,%xmm6 + aesenc %xmm0,%xmm7 + movups (%rcx),%xmm0 + jnz .Lctr32_enc_loop6 + + aesenc %xmm1,%xmm2 + paddd %xmm13,%xmm12 + aesenc %xmm1,%xmm3 + paddd 16(%rsp),%xmm13 + aesenc %xmm1,%xmm4 + movdqa %xmm12,0(%rsp) + aesenc %xmm1,%xmm5 + movdqa %xmm13,16(%rsp) + aesenc %xmm1,%xmm6 +.byte 102,69,15,56,0,231 + aesenc %xmm1,%xmm7 +.byte 102,69,15,56,0,239 + + aesenclast %xmm0,%xmm2 + movups (%rdi),%xmm8 + aesenclast %xmm0,%xmm3 + movups 16(%rdi),%xmm9 + aesenclast %xmm0,%xmm4 + movups 32(%rdi),%xmm10 + aesenclast %xmm0,%xmm5 + movups 48(%rdi),%xmm11 + aesenclast %xmm0,%xmm6 + movups 64(%rdi),%xmm1 + aesenclast %xmm0,%xmm7 + movups 80(%rdi),%xmm0 + leaq 96(%rdi),%rdi + + xorps %xmm2,%xmm8 + pshufd $192,%xmm12,%xmm2 + xorps %xmm3,%xmm9 + pshufd $128,%xmm12,%xmm3 + movups %xmm8,(%rsi) + xorps %xmm4,%xmm10 + pshufd $64,%xmm12,%xmm4 + movups %xmm9,16(%rsi) + xorps %xmm5,%xmm11 + movups %xmm10,32(%rsi) + xorps %xmm6,%xmm1 + movups %xmm11,48(%rsi) + xorps %xmm7,%xmm0 + movups %xmm1,64(%rsi) + movups %xmm0,80(%rsi) + leaq 96(%rsi),%rsi + movl %r10d,%eax + subq $6,%rdx + jnc .Lctr32_loop6 + + addq $6,%rdx + jz .Lctr32_done + movq %r11,%rcx + leal 1(%rax,%rax,1),%eax + +.Lctr32_tail: + por %xmm14,%xmm2 + movups (%rdi),%xmm8 + cmpq $2,%rdx + jb .Lctr32_one + + por %xmm14,%xmm3 + movups 16(%rdi),%xmm9 + je .Lctr32_two + + pshufd $192,%xmm13,%xmm5 + por %xmm14,%xmm4 + movups 32(%rdi),%xmm10 + cmpq $4,%rdx + jb .Lctr32_three + + pshufd $128,%xmm13,%xmm6 + por %xmm14,%xmm5 + movups 48(%rdi),%xmm11 + je .Lctr32_four + + por %xmm14,%xmm6 + xorps %xmm7,%xmm7 + + call _aesni_encrypt6 + + movups 64(%rdi),%xmm1 + xorps %xmm2,%xmm8 + xorps %xmm3,%xmm9 + movups %xmm8,(%rsi) + xorps %xmm4,%xmm10 + movups %xmm9,16(%rsi) + xorps %xmm5,%xmm11 + movups %xmm10,32(%rsi) + xorps %xmm6,%xmm1 + movups %xmm11,48(%rsi) + movups %xmm1,64(%rsi) + jmp .Lctr32_done + +.p2align 4 +.Lctr32_one_shortcut: + movups (%r8),%xmm2 + movups (%rdi),%xmm8 + movl 240(%rcx),%eax +.Lctr32_one: + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 +.Loop_enc1_7: + aesenc %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_enc1_7 + aesenclast %xmm1,%xmm2 + xorps %xmm2,%xmm8 + movups %xmm8,(%rsi) + jmp .Lctr32_done + +.p2align 4 +.Lctr32_two: + xorps %xmm4,%xmm4 + call _aesni_encrypt3 + xorps %xmm2,%xmm8 + xorps %xmm3,%xmm9 + movups %xmm8,(%rsi) + movups %xmm9,16(%rsi) + jmp .Lctr32_done + +.p2align 4 +.Lctr32_three: + call _aesni_encrypt3 + xorps %xmm2,%xmm8 + xorps %xmm3,%xmm9 + movups %xmm8,(%rsi) + xorps %xmm4,%xmm10 + movups %xmm9,16(%rsi) + movups %xmm10,32(%rsi) + jmp .Lctr32_done + +.p2align 4 +.Lctr32_four: + call _aesni_encrypt4 + xorps %xmm2,%xmm8 + xorps %xmm3,%xmm9 + movups %xmm8,(%rsi) + xorps %xmm4,%xmm10 + movups %xmm9,16(%rsi) + xorps %xmm5,%xmm11 + movups %xmm10,32(%rsi) + movups %xmm11,48(%rsi) + +.Lctr32_done: + movaps 32(%rsp),%xmm6 + movaps 48(%rsp),%xmm7 + movaps 64(%rsp),%xmm8 + movaps 80(%rsp),%xmm9 + movaps 96(%rsp),%xmm10 + movaps 112(%rsp),%xmm11 + movaps 128(%rsp),%xmm12 + movaps 144(%rsp),%xmm13 + movaps 160(%rsp),%xmm14 + movaps 176(%rsp),%xmm15 + leaq 200(%rsp),%rsp +.Lctr32_ret: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_aesni_ctr32_encrypt_blocks: +.globl aesni_xts_encrypt +.def aesni_xts_encrypt; .scl 2; .type 32; .endef +.p2align 4 +aesni_xts_encrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_aesni_xts_encrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + movq 48(%rsp),%r9 + + leaq -264(%rsp),%rsp + movaps %xmm6,96(%rsp) + movaps %xmm7,112(%rsp) + movaps %xmm8,128(%rsp) + movaps %xmm9,144(%rsp) + movaps %xmm10,160(%rsp) + movaps %xmm11,176(%rsp) + movaps %xmm12,192(%rsp) + movaps %xmm13,208(%rsp) + movaps %xmm14,224(%rsp) + movaps %xmm15,240(%rsp) +.Lxts_enc_body: + movups (%r9),%xmm15 + movl 240(%r8),%eax + movl 240(%rcx),%r10d + movups (%r8),%xmm0 + movups 16(%r8),%xmm1 + leaq 32(%r8),%r8 + xorps %xmm0,%xmm15 +.Loop_enc1_8: + aesenc %xmm1,%xmm15 + decl %eax + movups (%r8),%xmm1 + leaq 16(%r8),%r8 + jnz .Loop_enc1_8 + aesenclast %xmm1,%xmm15 + movq %rcx,%r11 + movl %r10d,%eax + movq %rdx,%r9 + andq $-16,%rdx + + movdqa .Lxts_magic(%rip),%xmm8 + pxor %xmm14,%xmm14 + pcmpgtd %xmm15,%xmm14 + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm10 + paddq %xmm15,%xmm15 + pand %xmm8,%xmm9 + pcmpgtd %xmm15,%xmm14 + pxor %xmm9,%xmm15 + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm11 + paddq %xmm15,%xmm15 + pand %xmm8,%xmm9 + pcmpgtd %xmm15,%xmm14 + pxor %xmm9,%xmm15 + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm12 + paddq %xmm15,%xmm15 + pand %xmm8,%xmm9 + pcmpgtd %xmm15,%xmm14 + pxor %xmm9,%xmm15 + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm13 + paddq %xmm15,%xmm15 + pand %xmm8,%xmm9 + pcmpgtd %xmm15,%xmm14 + pxor %xmm9,%xmm15 + subq $96,%rdx + jc .Lxts_enc_short + + shrl $1,%eax + subl $1,%eax + movl %eax,%r10d + jmp .Lxts_enc_grandloop + +.p2align 4 +.Lxts_enc_grandloop: + pshufd $19,%xmm14,%xmm9 + movdqa %xmm15,%xmm14 + paddq %xmm15,%xmm15 + movdqu 0(%rdi),%xmm2 + pand %xmm8,%xmm9 + movdqu 16(%rdi),%xmm3 + pxor %xmm9,%xmm15 + + movdqu 32(%rdi),%xmm4 + pxor %xmm10,%xmm2 + movdqu 48(%rdi),%xmm5 + pxor %xmm11,%xmm3 + movdqu 64(%rdi),%xmm6 + pxor %xmm12,%xmm4 + movdqu 80(%rdi),%xmm7 + leaq 96(%rdi),%rdi + pxor %xmm13,%xmm5 + movups (%r11),%xmm0 + pxor %xmm14,%xmm6 + pxor %xmm15,%xmm7 + + + + movups 16(%r11),%xmm1 + pxor %xmm0,%xmm2 + pxor %xmm0,%xmm3 + movdqa %xmm10,0(%rsp) + aesenc %xmm1,%xmm2 + leaq 32(%r11),%rcx + pxor %xmm0,%xmm4 + movdqa %xmm11,16(%rsp) + aesenc %xmm1,%xmm3 + pxor %xmm0,%xmm5 + movdqa %xmm12,32(%rsp) + aesenc %xmm1,%xmm4 + pxor %xmm0,%xmm6 + movdqa %xmm13,48(%rsp) + aesenc %xmm1,%xmm5 + pxor %xmm0,%xmm7 + movups (%rcx),%xmm0 + decl %eax + movdqa %xmm14,64(%rsp) + aesenc %xmm1,%xmm6 + movdqa %xmm15,80(%rsp) + aesenc %xmm1,%xmm7 + pxor %xmm14,%xmm14 + pcmpgtd %xmm15,%xmm14 + jmp .Lxts_enc_loop6_enter + +.p2align 4 +.Lxts_enc_loop6: + aesenc %xmm1,%xmm2 + aesenc %xmm1,%xmm3 + decl %eax + aesenc %xmm1,%xmm4 + aesenc %xmm1,%xmm5 + aesenc %xmm1,%xmm6 + aesenc %xmm1,%xmm7 +.Lxts_enc_loop6_enter: + movups 16(%rcx),%xmm1 + aesenc %xmm0,%xmm2 + aesenc %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesenc %xmm0,%xmm4 + aesenc %xmm0,%xmm5 + aesenc %xmm0,%xmm6 + aesenc %xmm0,%xmm7 + movups (%rcx),%xmm0 + jnz .Lxts_enc_loop6 + + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + paddq %xmm15,%xmm15 + aesenc %xmm1,%xmm2 + pand %xmm8,%xmm9 + aesenc %xmm1,%xmm3 + pcmpgtd %xmm15,%xmm14 + aesenc %xmm1,%xmm4 + pxor %xmm9,%xmm15 + aesenc %xmm1,%xmm5 + aesenc %xmm1,%xmm6 + aesenc %xmm1,%xmm7 + movups 16(%rcx),%xmm1 + + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm10 + paddq %xmm15,%xmm15 + aesenc %xmm0,%xmm2 + pand %xmm8,%xmm9 + aesenc %xmm0,%xmm3 + pcmpgtd %xmm15,%xmm14 + aesenc %xmm0,%xmm4 + pxor %xmm9,%xmm15 + aesenc %xmm0,%xmm5 + aesenc %xmm0,%xmm6 + aesenc %xmm0,%xmm7 + movups 32(%rcx),%xmm0 + + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm11 + paddq %xmm15,%xmm15 + aesenc %xmm1,%xmm2 + pand %xmm8,%xmm9 + aesenc %xmm1,%xmm3 + pcmpgtd %xmm15,%xmm14 + aesenc %xmm1,%xmm4 + pxor %xmm9,%xmm15 + aesenc %xmm1,%xmm5 + aesenc %xmm1,%xmm6 + aesenc %xmm1,%xmm7 + + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm12 + paddq %xmm15,%xmm15 + aesenclast %xmm0,%xmm2 + pand %xmm8,%xmm9 + aesenclast %xmm0,%xmm3 + pcmpgtd %xmm15,%xmm14 + aesenclast %xmm0,%xmm4 + pxor %xmm9,%xmm15 + aesenclast %xmm0,%xmm5 + aesenclast %xmm0,%xmm6 + aesenclast %xmm0,%xmm7 + + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm13 + paddq %xmm15,%xmm15 + xorps 0(%rsp),%xmm2 + pand %xmm8,%xmm9 + xorps 16(%rsp),%xmm3 + pcmpgtd %xmm15,%xmm14 + pxor %xmm9,%xmm15 + + xorps 32(%rsp),%xmm4 + movups %xmm2,0(%rsi) + xorps 48(%rsp),%xmm5 + movups %xmm3,16(%rsi) + xorps 64(%rsp),%xmm6 + movups %xmm4,32(%rsi) + xorps 80(%rsp),%xmm7 + movups %xmm5,48(%rsi) + movl %r10d,%eax + movups %xmm6,64(%rsi) + movups %xmm7,80(%rsi) + leaq 96(%rsi),%rsi + subq $96,%rdx + jnc .Lxts_enc_grandloop + + leal 3(%rax,%rax,1),%eax + movq %r11,%rcx + movl %eax,%r10d + +.Lxts_enc_short: + addq $96,%rdx + jz .Lxts_enc_done + + cmpq $32,%rdx + jb .Lxts_enc_one + je .Lxts_enc_two + + cmpq $64,%rdx + jb .Lxts_enc_three + je .Lxts_enc_four + + pshufd $19,%xmm14,%xmm9 + movdqa %xmm15,%xmm14 + paddq %xmm15,%xmm15 + movdqu (%rdi),%xmm2 + pand %xmm8,%xmm9 + movdqu 16(%rdi),%xmm3 + pxor %xmm9,%xmm15 + + movdqu 32(%rdi),%xmm4 + pxor %xmm10,%xmm2 + movdqu 48(%rdi),%xmm5 + pxor %xmm11,%xmm3 + movdqu 64(%rdi),%xmm6 + leaq 80(%rdi),%rdi + pxor %xmm12,%xmm4 + pxor %xmm13,%xmm5 + pxor %xmm14,%xmm6 + + call _aesni_encrypt6 + + xorps %xmm10,%xmm2 + movdqa %xmm15,%xmm10 + xorps %xmm11,%xmm3 + xorps %xmm12,%xmm4 + movdqu %xmm2,(%rsi) + xorps %xmm13,%xmm5 + movdqu %xmm3,16(%rsi) + xorps %xmm14,%xmm6 + movdqu %xmm4,32(%rsi) + movdqu %xmm5,48(%rsi) + movdqu %xmm6,64(%rsi) + leaq 80(%rsi),%rsi + jmp .Lxts_enc_done + +.p2align 4 +.Lxts_enc_one: + movups (%rdi),%xmm2 + leaq 16(%rdi),%rdi + xorps %xmm10,%xmm2 + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 +.Loop_enc1_9: + aesenc %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_enc1_9 + aesenclast %xmm1,%xmm2 + xorps %xmm10,%xmm2 + movdqa %xmm11,%xmm10 + movups %xmm2,(%rsi) + leaq 16(%rsi),%rsi + jmp .Lxts_enc_done + +.p2align 4 +.Lxts_enc_two: + movups (%rdi),%xmm2 + movups 16(%rdi),%xmm3 + leaq 32(%rdi),%rdi + xorps %xmm10,%xmm2 + xorps %xmm11,%xmm3 + + call _aesni_encrypt3 + + xorps %xmm10,%xmm2 + movdqa %xmm12,%xmm10 + xorps %xmm11,%xmm3 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + leaq 32(%rsi),%rsi + jmp .Lxts_enc_done + +.p2align 4 +.Lxts_enc_three: + movups (%rdi),%xmm2 + movups 16(%rdi),%xmm3 + movups 32(%rdi),%xmm4 + leaq 48(%rdi),%rdi + xorps %xmm10,%xmm2 + xorps %xmm11,%xmm3 + xorps %xmm12,%xmm4 + + call _aesni_encrypt3 + + xorps %xmm10,%xmm2 + movdqa %xmm13,%xmm10 + xorps %xmm11,%xmm3 + xorps %xmm12,%xmm4 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + leaq 48(%rsi),%rsi + jmp .Lxts_enc_done + +.p2align 4 +.Lxts_enc_four: + movups (%rdi),%xmm2 + movups 16(%rdi),%xmm3 + movups 32(%rdi),%xmm4 + xorps %xmm10,%xmm2 + movups 48(%rdi),%xmm5 + leaq 64(%rdi),%rdi + xorps %xmm11,%xmm3 + xorps %xmm12,%xmm4 + xorps %xmm13,%xmm5 + + call _aesni_encrypt4 + + xorps %xmm10,%xmm2 + movdqa %xmm15,%xmm10 + xorps %xmm11,%xmm3 + xorps %xmm12,%xmm4 + movups %xmm2,(%rsi) + xorps %xmm13,%xmm5 + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + leaq 64(%rsi),%rsi + jmp .Lxts_enc_done + +.p2align 4 +.Lxts_enc_done: + andq $15,%r9 + jz .Lxts_enc_ret + movq %r9,%rdx + +.Lxts_enc_steal: + movzbl (%rdi),%eax + movzbl -16(%rsi),%ecx + leaq 1(%rdi),%rdi + movb %al,-16(%rsi) + movb %cl,0(%rsi) + leaq 1(%rsi),%rsi + subq $1,%rdx + jnz .Lxts_enc_steal + + subq %r9,%rsi + movq %r11,%rcx + movl %r10d,%eax + + movups -16(%rsi),%xmm2 + xorps %xmm10,%xmm2 + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 +.Loop_enc1_10: + aesenc %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_enc1_10 + aesenclast %xmm1,%xmm2 + xorps %xmm10,%xmm2 + movups %xmm2,-16(%rsi) + +.Lxts_enc_ret: + movaps 96(%rsp),%xmm6 + movaps 112(%rsp),%xmm7 + movaps 128(%rsp),%xmm8 + movaps 144(%rsp),%xmm9 + movaps 160(%rsp),%xmm10 + movaps 176(%rsp),%xmm11 + movaps 192(%rsp),%xmm12 + movaps 208(%rsp),%xmm13 + movaps 224(%rsp),%xmm14 + movaps 240(%rsp),%xmm15 + leaq 264(%rsp),%rsp +.Lxts_enc_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_aesni_xts_encrypt: +.globl aesni_xts_decrypt +.def aesni_xts_decrypt; .scl 2; .type 32; .endef +.p2align 4 +aesni_xts_decrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_aesni_xts_decrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + movq 48(%rsp),%r9 + + leaq -264(%rsp),%rsp + movaps %xmm6,96(%rsp) + movaps %xmm7,112(%rsp) + movaps %xmm8,128(%rsp) + movaps %xmm9,144(%rsp) + movaps %xmm10,160(%rsp) + movaps %xmm11,176(%rsp) + movaps %xmm12,192(%rsp) + movaps %xmm13,208(%rsp) + movaps %xmm14,224(%rsp) + movaps %xmm15,240(%rsp) +.Lxts_dec_body: + movups (%r9),%xmm15 + movl 240(%r8),%eax + movl 240(%rcx),%r10d + movups (%r8),%xmm0 + movups 16(%r8),%xmm1 + leaq 32(%r8),%r8 + xorps %xmm0,%xmm15 +.Loop_enc1_11: + aesenc %xmm1,%xmm15 + decl %eax + movups (%r8),%xmm1 + leaq 16(%r8),%r8 + jnz .Loop_enc1_11 + aesenclast %xmm1,%xmm15 + xorl %eax,%eax + testq $15,%rdx + setnz %al + shlq $4,%rax + subq %rax,%rdx + + movq %rcx,%r11 + movl %r10d,%eax + movq %rdx,%r9 + andq $-16,%rdx + + movdqa .Lxts_magic(%rip),%xmm8 + pxor %xmm14,%xmm14 + pcmpgtd %xmm15,%xmm14 + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm10 + paddq %xmm15,%xmm15 + pand %xmm8,%xmm9 + pcmpgtd %xmm15,%xmm14 + pxor %xmm9,%xmm15 + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm11 + paddq %xmm15,%xmm15 + pand %xmm8,%xmm9 + pcmpgtd %xmm15,%xmm14 + pxor %xmm9,%xmm15 + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm12 + paddq %xmm15,%xmm15 + pand %xmm8,%xmm9 + pcmpgtd %xmm15,%xmm14 + pxor %xmm9,%xmm15 + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm13 + paddq %xmm15,%xmm15 + pand %xmm8,%xmm9 + pcmpgtd %xmm15,%xmm14 + pxor %xmm9,%xmm15 + subq $96,%rdx + jc .Lxts_dec_short + + shrl $1,%eax + subl $1,%eax + movl %eax,%r10d + jmp .Lxts_dec_grandloop + +.p2align 4 +.Lxts_dec_grandloop: + pshufd $19,%xmm14,%xmm9 + movdqa %xmm15,%xmm14 + paddq %xmm15,%xmm15 + movdqu 0(%rdi),%xmm2 + pand %xmm8,%xmm9 + movdqu 16(%rdi),%xmm3 + pxor %xmm9,%xmm15 + + movdqu 32(%rdi),%xmm4 + pxor %xmm10,%xmm2 + movdqu 48(%rdi),%xmm5 + pxor %xmm11,%xmm3 + movdqu 64(%rdi),%xmm6 + pxor %xmm12,%xmm4 + movdqu 80(%rdi),%xmm7 + leaq 96(%rdi),%rdi + pxor %xmm13,%xmm5 + movups (%r11),%xmm0 + pxor %xmm14,%xmm6 + pxor %xmm15,%xmm7 + + + + movups 16(%r11),%xmm1 + pxor %xmm0,%xmm2 + pxor %xmm0,%xmm3 + movdqa %xmm10,0(%rsp) + aesdec %xmm1,%xmm2 + leaq 32(%r11),%rcx + pxor %xmm0,%xmm4 + movdqa %xmm11,16(%rsp) + aesdec %xmm1,%xmm3 + pxor %xmm0,%xmm5 + movdqa %xmm12,32(%rsp) + aesdec %xmm1,%xmm4 + pxor %xmm0,%xmm6 + movdqa %xmm13,48(%rsp) + aesdec %xmm1,%xmm5 + pxor %xmm0,%xmm7 + movups (%rcx),%xmm0 + decl %eax + movdqa %xmm14,64(%rsp) + aesdec %xmm1,%xmm6 + movdqa %xmm15,80(%rsp) + aesdec %xmm1,%xmm7 + pxor %xmm14,%xmm14 + pcmpgtd %xmm15,%xmm14 + jmp .Lxts_dec_loop6_enter + +.p2align 4 +.Lxts_dec_loop6: + aesdec %xmm1,%xmm2 + aesdec %xmm1,%xmm3 + decl %eax + aesdec %xmm1,%xmm4 + aesdec %xmm1,%xmm5 + aesdec %xmm1,%xmm6 + aesdec %xmm1,%xmm7 +.Lxts_dec_loop6_enter: + movups 16(%rcx),%xmm1 + aesdec %xmm0,%xmm2 + aesdec %xmm0,%xmm3 + leaq 32(%rcx),%rcx + aesdec %xmm0,%xmm4 + aesdec %xmm0,%xmm5 + aesdec %xmm0,%xmm6 + aesdec %xmm0,%xmm7 + movups (%rcx),%xmm0 + jnz .Lxts_dec_loop6 + + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + paddq %xmm15,%xmm15 + aesdec %xmm1,%xmm2 + pand %xmm8,%xmm9 + aesdec %xmm1,%xmm3 + pcmpgtd %xmm15,%xmm14 + aesdec %xmm1,%xmm4 + pxor %xmm9,%xmm15 + aesdec %xmm1,%xmm5 + aesdec %xmm1,%xmm6 + aesdec %xmm1,%xmm7 + movups 16(%rcx),%xmm1 + + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm10 + paddq %xmm15,%xmm15 + aesdec %xmm0,%xmm2 + pand %xmm8,%xmm9 + aesdec %xmm0,%xmm3 + pcmpgtd %xmm15,%xmm14 + aesdec %xmm0,%xmm4 + pxor %xmm9,%xmm15 + aesdec %xmm0,%xmm5 + aesdec %xmm0,%xmm6 + aesdec %xmm0,%xmm7 + movups 32(%rcx),%xmm0 + + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm11 + paddq %xmm15,%xmm15 + aesdec %xmm1,%xmm2 + pand %xmm8,%xmm9 + aesdec %xmm1,%xmm3 + pcmpgtd %xmm15,%xmm14 + aesdec %xmm1,%xmm4 + pxor %xmm9,%xmm15 + aesdec %xmm1,%xmm5 + aesdec %xmm1,%xmm6 + aesdec %xmm1,%xmm7 + + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm12 + paddq %xmm15,%xmm15 + aesdeclast %xmm0,%xmm2 + pand %xmm8,%xmm9 + aesdeclast %xmm0,%xmm3 + pcmpgtd %xmm15,%xmm14 + aesdeclast %xmm0,%xmm4 + pxor %xmm9,%xmm15 + aesdeclast %xmm0,%xmm5 + aesdeclast %xmm0,%xmm6 + aesdeclast %xmm0,%xmm7 + + pshufd $19,%xmm14,%xmm9 + pxor %xmm14,%xmm14 + movdqa %xmm15,%xmm13 + paddq %xmm15,%xmm15 + xorps 0(%rsp),%xmm2 + pand %xmm8,%xmm9 + xorps 16(%rsp),%xmm3 + pcmpgtd %xmm15,%xmm14 + pxor %xmm9,%xmm15 + + xorps 32(%rsp),%xmm4 + movups %xmm2,0(%rsi) + xorps 48(%rsp),%xmm5 + movups %xmm3,16(%rsi) + xorps 64(%rsp),%xmm6 + movups %xmm4,32(%rsi) + xorps 80(%rsp),%xmm7 + movups %xmm5,48(%rsi) + movl %r10d,%eax + movups %xmm6,64(%rsi) + movups %xmm7,80(%rsi) + leaq 96(%rsi),%rsi + subq $96,%rdx + jnc .Lxts_dec_grandloop + + leal 3(%rax,%rax,1),%eax + movq %r11,%rcx + movl %eax,%r10d + +.Lxts_dec_short: + addq $96,%rdx + jz .Lxts_dec_done + + cmpq $32,%rdx + jb .Lxts_dec_one + je .Lxts_dec_two + + cmpq $64,%rdx + jb .Lxts_dec_three + je .Lxts_dec_four + + pshufd $19,%xmm14,%xmm9 + movdqa %xmm15,%xmm14 + paddq %xmm15,%xmm15 + movdqu (%rdi),%xmm2 + pand %xmm8,%xmm9 + movdqu 16(%rdi),%xmm3 + pxor %xmm9,%xmm15 + + movdqu 32(%rdi),%xmm4 + pxor %xmm10,%xmm2 + movdqu 48(%rdi),%xmm5 + pxor %xmm11,%xmm3 + movdqu 64(%rdi),%xmm6 + leaq 80(%rdi),%rdi + pxor %xmm12,%xmm4 + pxor %xmm13,%xmm5 + pxor %xmm14,%xmm6 + + call _aesni_decrypt6 + + xorps %xmm10,%xmm2 + xorps %xmm11,%xmm3 + xorps %xmm12,%xmm4 + movdqu %xmm2,(%rsi) + xorps %xmm13,%xmm5 + movdqu %xmm3,16(%rsi) + xorps %xmm14,%xmm6 + movdqu %xmm4,32(%rsi) + pxor %xmm14,%xmm14 + movdqu %xmm5,48(%rsi) + pcmpgtd %xmm15,%xmm14 + movdqu %xmm6,64(%rsi) + leaq 80(%rsi),%rsi + pshufd $19,%xmm14,%xmm11 + andq $15,%r9 + jz .Lxts_dec_ret + + movdqa %xmm15,%xmm10 + paddq %xmm15,%xmm15 + pand %xmm8,%xmm11 + pxor %xmm15,%xmm11 + jmp .Lxts_dec_done2 + +.p2align 4 +.Lxts_dec_one: + movups (%rdi),%xmm2 + leaq 16(%rdi),%rdi + xorps %xmm10,%xmm2 + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 +.Loop_dec1_12: + aesdec %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_dec1_12 + aesdeclast %xmm1,%xmm2 + xorps %xmm10,%xmm2 + movdqa %xmm11,%xmm10 + movups %xmm2,(%rsi) + movdqa %xmm12,%xmm11 + leaq 16(%rsi),%rsi + jmp .Lxts_dec_done + +.p2align 4 +.Lxts_dec_two: + movups (%rdi),%xmm2 + movups 16(%rdi),%xmm3 + leaq 32(%rdi),%rdi + xorps %xmm10,%xmm2 + xorps %xmm11,%xmm3 + + call _aesni_decrypt3 + + xorps %xmm10,%xmm2 + movdqa %xmm12,%xmm10 + xorps %xmm11,%xmm3 + movdqa %xmm13,%xmm11 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + leaq 32(%rsi),%rsi + jmp .Lxts_dec_done + +.p2align 4 +.Lxts_dec_three: + movups (%rdi),%xmm2 + movups 16(%rdi),%xmm3 + movups 32(%rdi),%xmm4 + leaq 48(%rdi),%rdi + xorps %xmm10,%xmm2 + xorps %xmm11,%xmm3 + xorps %xmm12,%xmm4 + + call _aesni_decrypt3 + + xorps %xmm10,%xmm2 + movdqa %xmm13,%xmm10 + xorps %xmm11,%xmm3 + movdqa %xmm15,%xmm11 + xorps %xmm12,%xmm4 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + leaq 48(%rsi),%rsi + jmp .Lxts_dec_done + +.p2align 4 +.Lxts_dec_four: + pshufd $19,%xmm14,%xmm9 + movdqa %xmm15,%xmm14 + paddq %xmm15,%xmm15 + movups (%rdi),%xmm2 + pand %xmm8,%xmm9 + movups 16(%rdi),%xmm3 + pxor %xmm9,%xmm15 + + movups 32(%rdi),%xmm4 + xorps %xmm10,%xmm2 + movups 48(%rdi),%xmm5 + leaq 64(%rdi),%rdi + xorps %xmm11,%xmm3 + xorps %xmm12,%xmm4 + xorps %xmm13,%xmm5 + + call _aesni_decrypt4 + + xorps %xmm10,%xmm2 + movdqa %xmm14,%xmm10 + xorps %xmm11,%xmm3 + movdqa %xmm15,%xmm11 + xorps %xmm12,%xmm4 + movups %xmm2,(%rsi) + xorps %xmm13,%xmm5 + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + leaq 64(%rsi),%rsi + jmp .Lxts_dec_done + +.p2align 4 +.Lxts_dec_done: + andq $15,%r9 + jz .Lxts_dec_ret +.Lxts_dec_done2: + movq %r9,%rdx + movq %r11,%rcx + movl %r10d,%eax + + movups (%rdi),%xmm2 + xorps %xmm11,%xmm2 + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 +.Loop_dec1_13: + aesdec %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_dec1_13 + aesdeclast %xmm1,%xmm2 + xorps %xmm11,%xmm2 + movups %xmm2,(%rsi) + +.Lxts_dec_steal: + movzbl 16(%rdi),%eax + movzbl (%rsi),%ecx + leaq 1(%rdi),%rdi + movb %al,(%rsi) + movb %cl,16(%rsi) + leaq 1(%rsi),%rsi + subq $1,%rdx + jnz .Lxts_dec_steal + + subq %r9,%rsi + movq %r11,%rcx + movl %r10d,%eax + + movups (%rsi),%xmm2 + xorps %xmm10,%xmm2 + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 +.Loop_dec1_14: + aesdec %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_dec1_14 + aesdeclast %xmm1,%xmm2 + xorps %xmm10,%xmm2 + movups %xmm2,(%rsi) + +.Lxts_dec_ret: + movaps 96(%rsp),%xmm6 + movaps 112(%rsp),%xmm7 + movaps 128(%rsp),%xmm8 + movaps 144(%rsp),%xmm9 + movaps 160(%rsp),%xmm10 + movaps 176(%rsp),%xmm11 + movaps 192(%rsp),%xmm12 + movaps 208(%rsp),%xmm13 + movaps 224(%rsp),%xmm14 + movaps 240(%rsp),%xmm15 + leaq 264(%rsp),%rsp +.Lxts_dec_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_aesni_xts_decrypt: +.globl aesni_cbc_encrypt +.def aesni_cbc_encrypt; .scl 2; .type 32; .endef +.p2align 4 +aesni_cbc_encrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_aesni_cbc_encrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + movq 48(%rsp),%r9 + + testq %rdx,%rdx + jz .Lcbc_ret + + movl 240(%rcx),%r10d + movq %rcx,%r11 + testl %r9d,%r9d + jz .Lcbc_decrypt + + movups (%r8),%xmm2 + movl %r10d,%eax + cmpq $16,%rdx + jb .Lcbc_enc_tail + subq $16,%rdx + jmp .Lcbc_enc_loop +.p2align 4 +.Lcbc_enc_loop: + movups (%rdi),%xmm3 + leaq 16(%rdi),%rdi + + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + xorps %xmm0,%xmm3 + leaq 32(%rcx),%rcx + xorps %xmm3,%xmm2 +.Loop_enc1_15: + aesenc %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_enc1_15 + aesenclast %xmm1,%xmm2 + movl %r10d,%eax + movq %r11,%rcx + movups %xmm2,0(%rsi) + leaq 16(%rsi),%rsi + subq $16,%rdx + jnc .Lcbc_enc_loop + addq $16,%rdx + jnz .Lcbc_enc_tail + movups %xmm2,(%r8) + jmp .Lcbc_ret + +.Lcbc_enc_tail: + movq %rdx,%rcx + xchgq %rdi,%rsi +.long 0x9066A4F3 + movl $16,%ecx + subq %rdx,%rcx + xorl %eax,%eax +.long 0x9066AAF3 + leaq -16(%rdi),%rdi + movl %r10d,%eax + movq %rdi,%rsi + movq %r11,%rcx + xorq %rdx,%rdx + jmp .Lcbc_enc_loop + +.p2align 4 +.Lcbc_decrypt: + leaq -88(%rsp),%rsp + movaps %xmm6,(%rsp) + movaps %xmm7,16(%rsp) + movaps %xmm8,32(%rsp) + movaps %xmm9,48(%rsp) +.Lcbc_decrypt_body: + movups (%r8),%xmm9 + movl %r10d,%eax + cmpq $112,%rdx + jbe .Lcbc_dec_tail + shrl $1,%r10d + subq $112,%rdx + movl %r10d,%eax + movaps %xmm9,64(%rsp) + jmp .Lcbc_dec_loop8_enter +.p2align 4 +.Lcbc_dec_loop8: + movaps %xmm0,64(%rsp) + movups %xmm9,(%rsi) + leaq 16(%rsi),%rsi +.Lcbc_dec_loop8_enter: + movups (%rcx),%xmm0 + movups (%rdi),%xmm2 + movups 16(%rdi),%xmm3 + movups 16(%rcx),%xmm1 + + leaq 32(%rcx),%rcx + movdqu 32(%rdi),%xmm4 + xorps %xmm0,%xmm2 + movdqu 48(%rdi),%xmm5 + xorps %xmm0,%xmm3 + movdqu 64(%rdi),%xmm6 + aesdec %xmm1,%xmm2 + pxor %xmm0,%xmm4 + movdqu 80(%rdi),%xmm7 + aesdec %xmm1,%xmm3 + pxor %xmm0,%xmm5 + movdqu 96(%rdi),%xmm8 + aesdec %xmm1,%xmm4 + pxor %xmm0,%xmm6 + movdqu 112(%rdi),%xmm9 + aesdec %xmm1,%xmm5 + pxor %xmm0,%xmm7 + decl %eax + aesdec %xmm1,%xmm6 + pxor %xmm0,%xmm8 + aesdec %xmm1,%xmm7 + pxor %xmm0,%xmm9 + movups (%rcx),%xmm0 + aesdec %xmm1,%xmm8 + aesdec %xmm1,%xmm9 + movups 16(%rcx),%xmm1 + + call .Ldec_loop8_enter + + movups (%rdi),%xmm1 + movups 16(%rdi),%xmm0 + xorps 64(%rsp),%xmm2 + xorps %xmm1,%xmm3 + movups 32(%rdi),%xmm1 + xorps %xmm0,%xmm4 + movups 48(%rdi),%xmm0 + xorps %xmm1,%xmm5 + movups 64(%rdi),%xmm1 + xorps %xmm0,%xmm6 + movups 80(%rdi),%xmm0 + xorps %xmm1,%xmm7 + movups 96(%rdi),%xmm1 + xorps %xmm0,%xmm8 + movups 112(%rdi),%xmm0 + xorps %xmm1,%xmm9 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movl %r10d,%eax + movups %xmm6,64(%rsi) + movq %r11,%rcx + movups %xmm7,80(%rsi) + leaq 128(%rdi),%rdi + movups %xmm8,96(%rsi) + leaq 112(%rsi),%rsi + subq $128,%rdx + ja .Lcbc_dec_loop8 + + movaps %xmm9,%xmm2 + movaps %xmm0,%xmm9 + addq $112,%rdx + jle .Lcbc_dec_tail_collected + movups %xmm2,(%rsi) + leal 1(%r10,%r10,1),%eax + leaq 16(%rsi),%rsi +.Lcbc_dec_tail: + movups (%rdi),%xmm2 + movaps %xmm2,%xmm8 + cmpq $16,%rdx + jbe .Lcbc_dec_one + + movups 16(%rdi),%xmm3 + movaps %xmm3,%xmm7 + cmpq $32,%rdx + jbe .Lcbc_dec_two + + movups 32(%rdi),%xmm4 + movaps %xmm4,%xmm6 + cmpq $48,%rdx + jbe .Lcbc_dec_three + + movups 48(%rdi),%xmm5 + cmpq $64,%rdx + jbe .Lcbc_dec_four + + movups 64(%rdi),%xmm6 + cmpq $80,%rdx + jbe .Lcbc_dec_five + + movups 80(%rdi),%xmm7 + cmpq $96,%rdx + jbe .Lcbc_dec_six + + movups 96(%rdi),%xmm8 + movaps %xmm9,64(%rsp) + call _aesni_decrypt8 + movups (%rdi),%xmm1 + movups 16(%rdi),%xmm0 + xorps 64(%rsp),%xmm2 + xorps %xmm1,%xmm3 + movups 32(%rdi),%xmm1 + xorps %xmm0,%xmm4 + movups 48(%rdi),%xmm0 + xorps %xmm1,%xmm5 + movups 64(%rdi),%xmm1 + xorps %xmm0,%xmm6 + movups 80(%rdi),%xmm0 + xorps %xmm1,%xmm7 + movups 96(%rdi),%xmm9 + xorps %xmm0,%xmm8 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movups %xmm6,64(%rsi) + movups %xmm7,80(%rsi) + leaq 96(%rsi),%rsi + movaps %xmm8,%xmm2 + subq $112,%rdx + jmp .Lcbc_dec_tail_collected +.p2align 4 +.Lcbc_dec_one: + movups (%rcx),%xmm0 + movups 16(%rcx),%xmm1 + leaq 32(%rcx),%rcx + xorps %xmm0,%xmm2 +.Loop_dec1_16: + aesdec %xmm1,%xmm2 + decl %eax + movups (%rcx),%xmm1 + leaq 16(%rcx),%rcx + jnz .Loop_dec1_16 + aesdeclast %xmm1,%xmm2 + xorps %xmm9,%xmm2 + movaps %xmm8,%xmm9 + subq $16,%rdx + jmp .Lcbc_dec_tail_collected +.p2align 4 +.Lcbc_dec_two: + xorps %xmm4,%xmm4 + call _aesni_decrypt3 + xorps %xmm9,%xmm2 + xorps %xmm8,%xmm3 + movups %xmm2,(%rsi) + movaps %xmm7,%xmm9 + movaps %xmm3,%xmm2 + leaq 16(%rsi),%rsi + subq $32,%rdx + jmp .Lcbc_dec_tail_collected +.p2align 4 +.Lcbc_dec_three: + call _aesni_decrypt3 + xorps %xmm9,%xmm2 + xorps %xmm8,%xmm3 + movups %xmm2,(%rsi) + xorps %xmm7,%xmm4 + movups %xmm3,16(%rsi) + movaps %xmm6,%xmm9 + movaps %xmm4,%xmm2 + leaq 32(%rsi),%rsi + subq $48,%rdx + jmp .Lcbc_dec_tail_collected +.p2align 4 +.Lcbc_dec_four: + call _aesni_decrypt4 + xorps %xmm9,%xmm2 + movups 48(%rdi),%xmm9 + xorps %xmm8,%xmm3 + movups %xmm2,(%rsi) + xorps %xmm7,%xmm4 + movups %xmm3,16(%rsi) + xorps %xmm6,%xmm5 + movups %xmm4,32(%rsi) + movaps %xmm5,%xmm2 + leaq 48(%rsi),%rsi + subq $64,%rdx + jmp .Lcbc_dec_tail_collected +.p2align 4 +.Lcbc_dec_five: + xorps %xmm7,%xmm7 + call _aesni_decrypt6 + movups 16(%rdi),%xmm1 + movups 32(%rdi),%xmm0 + xorps %xmm9,%xmm2 + xorps %xmm8,%xmm3 + xorps %xmm1,%xmm4 + movups 48(%rdi),%xmm1 + xorps %xmm0,%xmm5 + movups 64(%rdi),%xmm9 + xorps %xmm1,%xmm6 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + leaq 64(%rsi),%rsi + movaps %xmm6,%xmm2 + subq $80,%rdx + jmp .Lcbc_dec_tail_collected +.p2align 4 +.Lcbc_dec_six: + call _aesni_decrypt6 + movups 16(%rdi),%xmm1 + movups 32(%rdi),%xmm0 + xorps %xmm9,%xmm2 + xorps %xmm8,%xmm3 + xorps %xmm1,%xmm4 + movups 48(%rdi),%xmm1 + xorps %xmm0,%xmm5 + movups 64(%rdi),%xmm0 + xorps %xmm1,%xmm6 + movups 80(%rdi),%xmm9 + xorps %xmm0,%xmm7 + movups %xmm2,(%rsi) + movups %xmm3,16(%rsi) + movups %xmm4,32(%rsi) + movups %xmm5,48(%rsi) + movups %xmm6,64(%rsi) + leaq 80(%rsi),%rsi + movaps %xmm7,%xmm2 + subq $96,%rdx + jmp .Lcbc_dec_tail_collected +.p2align 4 +.Lcbc_dec_tail_collected: + andq $15,%rdx + movups %xmm9,(%r8) + jnz .Lcbc_dec_tail_partial + movups %xmm2,(%rsi) + jmp .Lcbc_dec_ret +.p2align 4 +.Lcbc_dec_tail_partial: + movaps %xmm2,64(%rsp) + movq $16,%rcx + movq %rsi,%rdi + subq %rdx,%rcx + leaq 64(%rsp),%rsi +.long 0x9066A4F3 + +.Lcbc_dec_ret: + movaps (%rsp),%xmm6 + movaps 16(%rsp),%xmm7 + movaps 32(%rsp),%xmm8 + movaps 48(%rsp),%xmm9 + leaq 88(%rsp),%rsp +.Lcbc_ret: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_aesni_cbc_encrypt: +.globl aesni_set_decrypt_key +.def aesni_set_decrypt_key; .scl 2; .type 32; .endef +.p2align 4 +aesni_set_decrypt_key: + subq $8,%rsp + call __aesni_set_encrypt_key + shll $4,%edx + testl %eax,%eax + jnz .Ldec_key_ret + leaq 16(%r8,%rdx,1),%rcx + + movups (%r8),%xmm0 + movups (%rcx),%xmm1 + movups %xmm0,(%rcx) + movups %xmm1,(%r8) + leaq 16(%r8),%r8 + leaq -16(%rcx),%rcx + +.Ldec_key_inverse: + movups (%r8),%xmm0 + movups (%rcx),%xmm1 + aesimc %xmm0,%xmm0 + aesimc %xmm1,%xmm1 + leaq 16(%r8),%r8 + leaq -16(%rcx),%rcx + movups %xmm0,16(%rcx) + movups %xmm1,-16(%r8) + cmpq %r8,%rcx + ja .Ldec_key_inverse + + movups (%r8),%xmm0 + aesimc %xmm0,%xmm0 + movups %xmm0,(%rcx) +.Ldec_key_ret: + addq $8,%rsp + retq +.LSEH_end_set_decrypt_key: + +.globl aesni_set_encrypt_key +.def aesni_set_encrypt_key; .scl 2; .type 32; .endef +.p2align 4 +aesni_set_encrypt_key: +__aesni_set_encrypt_key: + subq $8,%rsp + movq $-1,%rax + testq %rcx,%rcx + jz .Lenc_key_ret + testq %r8,%r8 + jz .Lenc_key_ret + + movups (%rcx),%xmm0 + xorps %xmm4,%xmm4 + leaq 16(%r8),%rax + cmpl $256,%edx + je .L14rounds + cmpl $192,%edx + je .L12rounds + cmpl $128,%edx + jne .Lbad_keybits + +.L10rounds: + movl $9,%edx + movups %xmm0,(%r8) + aeskeygenassist $1,%xmm0,%xmm1 + call .Lkey_expansion_128_cold + aeskeygenassist $2,%xmm0,%xmm1 + call .Lkey_expansion_128 + aeskeygenassist $4,%xmm0,%xmm1 + call .Lkey_expansion_128 + aeskeygenassist $8,%xmm0,%xmm1 + call .Lkey_expansion_128 + aeskeygenassist $16,%xmm0,%xmm1 + call .Lkey_expansion_128 + aeskeygenassist $32,%xmm0,%xmm1 + call .Lkey_expansion_128 + aeskeygenassist $64,%xmm0,%xmm1 + call .Lkey_expansion_128 + aeskeygenassist $128,%xmm0,%xmm1 + call .Lkey_expansion_128 + aeskeygenassist $27,%xmm0,%xmm1 + call .Lkey_expansion_128 + aeskeygenassist $54,%xmm0,%xmm1 + call .Lkey_expansion_128 + movups %xmm0,(%rax) + movl %edx,80(%rax) + xorl %eax,%eax + jmp .Lenc_key_ret + +.p2align 4 +.L12rounds: + movq 16(%rcx),%xmm2 + movl $11,%edx + movups %xmm0,(%r8) + aeskeygenassist $1,%xmm2,%xmm1 + call .Lkey_expansion_192a_cold + aeskeygenassist $2,%xmm2,%xmm1 + call .Lkey_expansion_192b + aeskeygenassist $4,%xmm2,%xmm1 + call .Lkey_expansion_192a + aeskeygenassist $8,%xmm2,%xmm1 + call .Lkey_expansion_192b + aeskeygenassist $16,%xmm2,%xmm1 + call .Lkey_expansion_192a + aeskeygenassist $32,%xmm2,%xmm1 + call .Lkey_expansion_192b + aeskeygenassist $64,%xmm2,%xmm1 + call .Lkey_expansion_192a + aeskeygenassist $128,%xmm2,%xmm1 + call .Lkey_expansion_192b + movups %xmm0,(%rax) + movl %edx,48(%rax) + xorq %rax,%rax + jmp .Lenc_key_ret + +.p2align 4 +.L14rounds: + movups 16(%rcx),%xmm2 + movl $13,%edx + leaq 16(%rax),%rax + movups %xmm0,(%r8) + movups %xmm2,16(%r8) + aeskeygenassist $1,%xmm2,%xmm1 + call .Lkey_expansion_256a_cold + aeskeygenassist $1,%xmm0,%xmm1 + call .Lkey_expansion_256b + aeskeygenassist $2,%xmm2,%xmm1 + call .Lkey_expansion_256a + aeskeygenassist $2,%xmm0,%xmm1 + call .Lkey_expansion_256b + aeskeygenassist $4,%xmm2,%xmm1 + call .Lkey_expansion_256a + aeskeygenassist $4,%xmm0,%xmm1 + call .Lkey_expansion_256b + aeskeygenassist $8,%xmm2,%xmm1 + call .Lkey_expansion_256a + aeskeygenassist $8,%xmm0,%xmm1 + call .Lkey_expansion_256b + aeskeygenassist $16,%xmm2,%xmm1 + call .Lkey_expansion_256a + aeskeygenassist $16,%xmm0,%xmm1 + call .Lkey_expansion_256b + aeskeygenassist $32,%xmm2,%xmm1 + call .Lkey_expansion_256a + aeskeygenassist $32,%xmm0,%xmm1 + call .Lkey_expansion_256b + aeskeygenassist $64,%xmm2,%xmm1 + call .Lkey_expansion_256a + movups %xmm0,(%rax) + movl %edx,16(%rax) + xorq %rax,%rax + jmp .Lenc_key_ret + +.p2align 4 +.Lbad_keybits: + movq $-2,%rax +.Lenc_key_ret: + addq $8,%rsp + retq +.LSEH_end_set_encrypt_key: + +.p2align 4 +.Lkey_expansion_128: + movups %xmm0,(%rax) + leaq 16(%rax),%rax +.Lkey_expansion_128_cold: + shufps $16,%xmm0,%xmm4 + xorps %xmm4,%xmm0 + shufps $140,%xmm0,%xmm4 + xorps %xmm4,%xmm0 + shufps $255,%xmm1,%xmm1 + xorps %xmm1,%xmm0 + retq + +.p2align 4 +.Lkey_expansion_192a: + movups %xmm0,(%rax) + leaq 16(%rax),%rax +.Lkey_expansion_192a_cold: + movaps %xmm2,%xmm5 +.Lkey_expansion_192b_warm: + shufps $16,%xmm0,%xmm4 + movdqa %xmm2,%xmm3 + xorps %xmm4,%xmm0 + shufps $140,%xmm0,%xmm4 + pslldq $4,%xmm3 + xorps %xmm4,%xmm0 + pshufd $85,%xmm1,%xmm1 + pxor %xmm3,%xmm2 + pxor %xmm1,%xmm0 + pshufd $255,%xmm0,%xmm3 + pxor %xmm3,%xmm2 + retq + +.p2align 4 +.Lkey_expansion_192b: + movaps %xmm0,%xmm3 + shufps $68,%xmm0,%xmm5 + movups %xmm5,(%rax) + shufps $78,%xmm2,%xmm3 + movups %xmm3,16(%rax) + leaq 32(%rax),%rax + jmp .Lkey_expansion_192b_warm + +.p2align 4 +.Lkey_expansion_256a: + movups %xmm2,(%rax) + leaq 16(%rax),%rax +.Lkey_expansion_256a_cold: + shufps $16,%xmm0,%xmm4 + xorps %xmm4,%xmm0 + shufps $140,%xmm0,%xmm4 + xorps %xmm4,%xmm0 + shufps $255,%xmm1,%xmm1 + xorps %xmm1,%xmm0 + retq + +.p2align 4 +.Lkey_expansion_256b: + movups %xmm0,(%rax) + leaq 16(%rax),%rax + + shufps $16,%xmm2,%xmm4 + xorps %xmm4,%xmm2 + shufps $140,%xmm2,%xmm4 + xorps %xmm4,%xmm2 + shufps $170,%xmm1,%xmm1 + xorps %xmm1,%xmm2 + retq + + +.p2align 6 +.Lbswap_mask: +.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 +.Lincrement32: +.long 6,6,6,0 +.Lincrement64: +.long 1,0,0,0 +.Lxts_magic: +.long 0x87,0,1,0 + +.byte 65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69,83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 +.p2align 6 + +.def ecb_se_handler; .scl 3; .type 32; .endef +.p2align 4 +ecb_se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 152(%r8),%rax + + jmp .Lcommon_seh_tail + + +.def ccm64_se_handler; .scl 3; .type 32; .endef +.p2align 4 +ccm64_se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + movq 8(%r9),%rsi + movq 56(%r9),%r11 + + movl 0(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jb .Lcommon_seh_tail + + movq 152(%r8),%rax + + movl 4(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jae .Lcommon_seh_tail + + leaq 0(%rax),%rsi + leaq 512(%r8),%rdi + movl $8,%ecx +.long 0xa548f3fc + leaq 88(%rax),%rax + + jmp .Lcommon_seh_tail + + +.def ctr32_se_handler; .scl 3; .type 32; .endef +.p2align 4 +ctr32_se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + leaq .Lctr32_body(%rip),%r10 + cmpq %r10,%rbx + jb .Lcommon_seh_tail + + movq 152(%r8),%rax + + leaq .Lctr32_ret(%rip),%r10 + cmpq %r10,%rbx + jae .Lcommon_seh_tail + + leaq 32(%rax),%rsi + leaq 512(%r8),%rdi + movl $20,%ecx +.long 0xa548f3fc + leaq 200(%rax),%rax + + jmp .Lcommon_seh_tail + + +.def xts_se_handler; .scl 3; .type 32; .endef +.p2align 4 +xts_se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + movq 8(%r9),%rsi + movq 56(%r9),%r11 + + movl 0(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jb .Lcommon_seh_tail + + movq 152(%r8),%rax + + movl 4(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jae .Lcommon_seh_tail + + leaq 96(%rax),%rsi + leaq 512(%r8),%rdi + movl $20,%ecx +.long 0xa548f3fc + leaq 104+160(%rax),%rax + + jmp .Lcommon_seh_tail + +.def cbc_se_handler; .scl 3; .type 32; .endef +.p2align 4 +cbc_se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 152(%r8),%rax + movq 248(%r8),%rbx + + leaq .Lcbc_decrypt(%rip),%r10 + cmpq %r10,%rbx + jb .Lcommon_seh_tail + + leaq .Lcbc_decrypt_body(%rip),%r10 + cmpq %r10,%rbx + jb .Lrestore_cbc_rax + + leaq .Lcbc_ret(%rip),%r10 + cmpq %r10,%rbx + jae .Lcommon_seh_tail + + leaq 0(%rax),%rsi + leaq 512(%r8),%rdi + movl $8,%ecx +.long 0xa548f3fc + leaq 88(%rax),%rax + jmp .Lcommon_seh_tail + +.Lrestore_cbc_rax: + movq 120(%r8),%rax + +.Lcommon_seh_tail: + movq 8(%rax),%rdi + movq 16(%rax),%rsi + movq %rax,152(%r8) + movq %rsi,168(%r8) + movq %rdi,176(%r8) + + movq 40(%r9),%rdi + movq %r8,%rsi + movl $154,%ecx +.long 0xa548f3fc + + movq %r9,%rsi + xorq %rcx,%rcx + movq 8(%rsi),%rdx + movq 0(%rsi),%r8 + movq 16(%rsi),%r9 + movq 40(%rsi),%r10 + leaq 56(%rsi),%r11 + leaq 24(%rsi),%r12 + movq %r10,32(%rsp) + movq %r11,40(%rsp) + movq %r12,48(%rsp) + movq %rcx,56(%rsp) + call *__imp_RtlVirtualUnwind(%rip) + + movl $1,%eax + addq $64,%rsp + popfq + popq %r15 + popq %r14 + popq %r13 + popq %r12 + popq %rbp + popq %rbx + popq %rdi + popq %rsi + retq + + +.section .pdata +.p2align 2 +.rva .LSEH_begin_aesni_ecb_encrypt +.rva .LSEH_end_aesni_ecb_encrypt +.rva .LSEH_info_ecb + +.rva .LSEH_begin_aesni_ccm64_encrypt_blocks +.rva .LSEH_end_aesni_ccm64_encrypt_blocks +.rva .LSEH_info_ccm64_enc + +.rva .LSEH_begin_aesni_ccm64_decrypt_blocks +.rva .LSEH_end_aesni_ccm64_decrypt_blocks +.rva .LSEH_info_ccm64_dec + +.rva .LSEH_begin_aesni_ctr32_encrypt_blocks +.rva .LSEH_end_aesni_ctr32_encrypt_blocks +.rva .LSEH_info_ctr32 + +.rva .LSEH_begin_aesni_xts_encrypt +.rva .LSEH_end_aesni_xts_encrypt +.rva .LSEH_info_xts_enc + +.rva .LSEH_begin_aesni_xts_decrypt +.rva .LSEH_end_aesni_xts_decrypt +.rva .LSEH_info_xts_dec +.rva .LSEH_begin_aesni_cbc_encrypt +.rva .LSEH_end_aesni_cbc_encrypt +.rva .LSEH_info_cbc + +.rva aesni_set_decrypt_key +.rva .LSEH_end_set_decrypt_key +.rva .LSEH_info_key + +.rva aesni_set_encrypt_key +.rva .LSEH_end_set_encrypt_key +.rva .LSEH_info_key +.section .xdata +.p2align 3 +.LSEH_info_ecb: +.byte 9,0,0,0 +.rva ecb_se_handler +.LSEH_info_ccm64_enc: +.byte 9,0,0,0 +.rva ccm64_se_handler +.rva .Lccm64_enc_body,.Lccm64_enc_ret +.LSEH_info_ccm64_dec: +.byte 9,0,0,0 +.rva ccm64_se_handler +.rva .Lccm64_dec_body,.Lccm64_dec_ret +.LSEH_info_ctr32: +.byte 9,0,0,0 +.rva ctr32_se_handler +.LSEH_info_xts_enc: +.byte 9,0,0,0 +.rva xts_se_handler +.rva .Lxts_enc_body,.Lxts_enc_epilogue +.LSEH_info_xts_dec: +.byte 9,0,0,0 +.rva xts_se_handler +.rva .Lxts_dec_body,.Lxts_dec_epilogue +.LSEH_info_cbc: +.byte 9,0,0,0 +.rva cbc_se_handler +.LSEH_info_key: +.byte 0x01,0x04,0x01,0x00 +.byte 0x04,0x02,0x00,0x00 diff --git a/crypto/aes/aesni-sha1-elf-x86_64.S b/crypto/aes/aesni-sha1-elf-x86_64.S index a534d1d1..c0b3e5f6 100644 --- a/crypto/aes/aesni-sha1-elf-x86_64.S +++ b/crypto/aes/aesni-sha1-elf-x86_64.S @@ -11,7 +11,7 @@ aesni_cbc_sha1_enc: movl OPENSSL_ia32cap_P+0(%rip),%r10d movl OPENSSL_ia32cap_P+4(%rip),%r11d jmp aesni_cbc_sha1_enc_ssse3 - .byte 0xf3,0xc3 + retq .size aesni_cbc_sha1_enc,.-aesni_cbc_sha1_enc .type aesni_cbc_sha1_enc_ssse3,@function .align 16 @@ -1384,7 +1384,7 @@ aesni_cbc_sha1_enc_ssse3: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lepilogue_ssse3: - .byte 0xf3,0xc3 + retq .size aesni_cbc_sha1_enc_ssse3,.-aesni_cbc_sha1_enc_ssse3 .align 64 K_XX_XX: diff --git a/crypto/aes/aesni-sha1-macosx-x86_64.S b/crypto/aes/aesni-sha1-macosx-x86_64.S index f382d367..3e88b1ac 100644 --- a/crypto/aes/aesni-sha1-macosx-x86_64.S +++ b/crypto/aes/aesni-sha1-macosx-x86_64.S @@ -11,7 +11,7 @@ _aesni_cbc_sha1_enc: movl _OPENSSL_ia32cap_P+0(%rip),%r10d movl _OPENSSL_ia32cap_P+4(%rip),%r11d jmp aesni_cbc_sha1_enc_ssse3 - .byte 0xf3,0xc3 + retq .p2align 4 @@ -1384,7 +1384,7 @@ L$aesenclast5: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$epilogue_ssse3: - .byte 0xf3,0xc3 + retq .p2align 6 K_XX_XX: diff --git a/crypto/aes/aesni-sha1-masm-x86_64.S b/crypto/aes/aesni-sha1-masm-x86_64.S new file mode 100644 index 00000000..746d64c7 --- /dev/null +++ b/crypto/aes/aesni-sha1-masm-x86_64.S @@ -0,0 +1,1548 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' +EXTERN OPENSSL_ia32cap_P:NEAR + + +PUBLIC aesni_cbc_sha1_enc + +ALIGN 16 +aesni_cbc_sha1_enc PROC PUBLIC + + mov r10d,DWORD PTR[((OPENSSL_ia32cap_P+0))] + mov r11d,DWORD PTR[((OPENSSL_ia32cap_P+4))] + jmp aesni_cbc_sha1_enc_ssse3 + DB 0F3h,0C3h ;repret +aesni_cbc_sha1_enc ENDP + +ALIGN 16 +aesni_cbc_sha1_enc_ssse3 PROC PRIVATE + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_aesni_cbc_sha1_enc_ssse3:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + mov r10,QWORD PTR[56+rsp] + + + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + lea rsp,QWORD PTR[((-264))+rsp] + + + movaps XMMWORD PTR[(96+0)+rsp],xmm6 + movaps XMMWORD PTR[(96+16)+rsp],xmm7 + movaps XMMWORD PTR[(96+32)+rsp],xmm8 + movaps XMMWORD PTR[(96+48)+rsp],xmm9 + movaps XMMWORD PTR[(96+64)+rsp],xmm10 + movaps XMMWORD PTR[(96+80)+rsp],xmm11 + movaps XMMWORD PTR[(96+96)+rsp],xmm12 + movaps XMMWORD PTR[(96+112)+rsp],xmm13 + movaps XMMWORD PTR[(96+128)+rsp],xmm14 + movaps XMMWORD PTR[(96+144)+rsp],xmm15 +$L$prologue_ssse3:: + mov r12,rdi + mov r13,rsi + mov r14,rdx + mov r15,rcx + movdqu xmm11,XMMWORD PTR[r8] + mov QWORD PTR[88+rsp],r8 + shl r14,6 + sub r13,r12 + mov r8d,DWORD PTR[240+r15] + add r14,r10 + + lea r11,QWORD PTR[K_XX_XX] + mov eax,DWORD PTR[r9] + mov ebx,DWORD PTR[4+r9] + mov ecx,DWORD PTR[8+r9] + mov edx,DWORD PTR[12+r9] + mov esi,ebx + mov ebp,DWORD PTR[16+r9] + + movdqa xmm6,XMMWORD PTR[64+r11] + movdqa xmm9,XMMWORD PTR[r11] + movdqu xmm0,XMMWORD PTR[r10] + movdqu xmm1,XMMWORD PTR[16+r10] + movdqu xmm2,XMMWORD PTR[32+r10] + movdqu xmm3,XMMWORD PTR[48+r10] +DB 102,15,56,0,198 + add r10,64 +DB 102,15,56,0,206 +DB 102,15,56,0,214 +DB 102,15,56,0,222 + paddd xmm0,xmm9 + paddd xmm1,xmm9 + paddd xmm2,xmm9 + movdqa XMMWORD PTR[rsp],xmm0 + psubd xmm0,xmm9 + movdqa XMMWORD PTR[16+rsp],xmm1 + psubd xmm1,xmm9 + movdqa XMMWORD PTR[32+rsp],xmm2 + psubd xmm2,xmm9 + movups xmm13,XMMWORD PTR[r15] + movups xmm14,XMMWORD PTR[16+r15] + jmp $L$oop_ssse3 +ALIGN 16 +$L$oop_ssse3:: + movdqa xmm4,xmm1 + add ebp,DWORD PTR[rsp] + movups xmm12,XMMWORD PTR[r12] + xorps xmm12,xmm13 + xorps xmm11,xmm12 + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[32+r15] + xor ecx,edx + movdqa xmm8,xmm3 +DB 102,15,58,15,224,8 + mov edi,eax + rol eax,5 + paddd xmm9,xmm3 + and esi,ecx + xor ecx,edx + psrldq xmm8,4 + xor esi,edx + add ebp,eax + pxor xmm4,xmm0 + ror ebx,2 + add ebp,esi + pxor xmm8,xmm2 + add edx,DWORD PTR[4+rsp] + xor ebx,ecx + mov esi,ebp + rol ebp,5 + pxor xmm4,xmm8 + and edi,ebx + xor ebx,ecx + movdqa XMMWORD PTR[48+rsp],xmm9 + xor edi,ecx + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[48+r15] + add edx,ebp + movdqa xmm10,xmm4 + movdqa xmm8,xmm4 + ror eax,7 + add edx,edi + add ecx,DWORD PTR[8+rsp] + xor eax,ebx + pslldq xmm10,12 + paddd xmm4,xmm4 + mov edi,edx + rol edx,5 + and esi,eax + xor eax,ebx + psrld xmm8,31 + xor esi,ebx + add ecx,edx + movdqa xmm9,xmm10 + ror ebp,7 + add ecx,esi + psrld xmm10,30 + por xmm4,xmm8 + add ebx,DWORD PTR[12+rsp] + xor ebp,eax + mov esi,ecx + rol ecx,5 + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[64+r15] + pslld xmm9,2 + pxor xmm4,xmm10 + and edi,ebp + xor ebp,eax + movdqa xmm10,XMMWORD PTR[r11] + xor edi,eax + add ebx,ecx + pxor xmm4,xmm9 + ror edx,7 + add ebx,edi + movdqa xmm5,xmm2 + add eax,DWORD PTR[16+rsp] + xor edx,ebp + movdqa xmm9,xmm4 +DB 102,15,58,15,233,8 + mov edi,ebx + rol ebx,5 + paddd xmm10,xmm4 + and esi,edx + xor edx,ebp + psrldq xmm9,4 + xor esi,ebp + add eax,ebx + pxor xmm5,xmm1 + ror ecx,7 + add eax,esi + pxor xmm9,xmm3 + add ebp,DWORD PTR[20+rsp] + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[80+r15] + xor ecx,edx + mov esi,eax + rol eax,5 + pxor xmm5,xmm9 + and edi,ecx + xor ecx,edx + movdqa XMMWORD PTR[rsp],xmm10 + xor edi,edx + add ebp,eax + movdqa xmm8,xmm5 + movdqa xmm9,xmm5 + ror ebx,7 + add ebp,edi + add edx,DWORD PTR[24+rsp] + xor ebx,ecx + pslldq xmm8,12 + paddd xmm5,xmm5 + mov edi,ebp + rol ebp,5 + and esi,ebx + xor ebx,ecx + psrld xmm9,31 + xor esi,ecx + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[96+r15] + add edx,ebp + movdqa xmm10,xmm8 + ror eax,7 + add edx,esi + psrld xmm8,30 + por xmm5,xmm9 + add ecx,DWORD PTR[28+rsp] + xor eax,ebx + mov esi,edx + rol edx,5 + pslld xmm10,2 + pxor xmm5,xmm8 + and edi,eax + xor eax,ebx + movdqa xmm8,XMMWORD PTR[16+r11] + xor edi,ebx + add ecx,edx + pxor xmm5,xmm10 + ror ebp,7 + add ecx,edi + movdqa xmm6,xmm3 + add ebx,DWORD PTR[32+rsp] + xor ebp,eax + movdqa xmm10,xmm5 +DB 102,15,58,15,242,8 + mov edi,ecx + rol ecx,5 + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[112+r15] + paddd xmm8,xmm5 + and esi,ebp + xor ebp,eax + psrldq xmm10,4 + xor esi,eax + add ebx,ecx + pxor xmm6,xmm2 + ror edx,7 + add ebx,esi + pxor xmm10,xmm4 + add eax,DWORD PTR[36+rsp] + xor edx,ebp + mov esi,ebx + rol ebx,5 + pxor xmm6,xmm10 + and edi,edx + xor edx,ebp + movdqa XMMWORD PTR[16+rsp],xmm8 + xor edi,ebp + add eax,ebx + movdqa xmm9,xmm6 + movdqa xmm10,xmm6 + ror ecx,7 + add eax,edi + add ebp,DWORD PTR[40+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[128+r15] + xor ecx,edx + pslldq xmm9,12 + paddd xmm6,xmm6 + mov edi,eax + rol eax,5 + and esi,ecx + xor ecx,edx + psrld xmm10,31 + xor esi,edx + add ebp,eax + movdqa xmm8,xmm9 + ror ebx,7 + add ebp,esi + psrld xmm9,30 + por xmm6,xmm10 + add edx,DWORD PTR[44+rsp] + xor ebx,ecx + mov esi,ebp + rol ebp,5 + pslld xmm8,2 + pxor xmm6,xmm9 + and edi,ebx + xor ebx,ecx + movdqa xmm9,XMMWORD PTR[16+r11] + xor edi,ecx + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[144+r15] + add edx,ebp + pxor xmm6,xmm8 + ror eax,7 + add edx,edi + movdqa xmm7,xmm4 + add ecx,DWORD PTR[48+rsp] + xor eax,ebx + movdqa xmm8,xmm6 +DB 102,15,58,15,251,8 + mov edi,edx + rol edx,5 + paddd xmm9,xmm6 + and esi,eax + xor eax,ebx + psrldq xmm8,4 + xor esi,ebx + add ecx,edx + pxor xmm7,xmm3 + ror ebp,7 + add ecx,esi + pxor xmm8,xmm5 + add ebx,DWORD PTR[52+rsp] + xor ebp,eax + mov esi,ecx + rol ecx,5 + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[160+r15] + pxor xmm7,xmm8 + and edi,ebp + xor ebp,eax + movdqa XMMWORD PTR[32+rsp],xmm9 + xor edi,eax + add ebx,ecx + movdqa xmm10,xmm7 + movdqa xmm8,xmm7 + ror edx,7 + add ebx,edi + add eax,DWORD PTR[56+rsp] + xor edx,ebp + pslldq xmm10,12 + paddd xmm7,xmm7 + mov edi,ebx + rol ebx,5 + and esi,edx + xor edx,ebp + psrld xmm8,31 + xor esi,ebp + add eax,ebx + movdqa xmm9,xmm10 + ror ecx,7 + add eax,esi + psrld xmm10,30 + por xmm7,xmm8 + add ebp,DWORD PTR[60+rsp] + cmp r8d,11 + jb $L$aesenclast1 + movups xmm14,XMMWORD PTR[176+r15] + aesenc xmm11,xmm15 + movups xmm15,XMMWORD PTR[192+r15] + aesenc xmm11,xmm14 + je $L$aesenclast1 + movups xmm14,XMMWORD PTR[208+r15] + aesenc xmm11,xmm15 + movups xmm15,XMMWORD PTR[224+r15] + aesenc xmm11,xmm14 +$L$aesenclast1:: + aesenclast xmm11,xmm15 + movups xmm14,XMMWORD PTR[16+r15] + xor ecx,edx + mov esi,eax + rol eax,5 + pslld xmm9,2 + pxor xmm7,xmm10 + and edi,ecx + xor ecx,edx + movdqa xmm10,XMMWORD PTR[16+r11] + xor edi,edx + add ebp,eax + pxor xmm7,xmm9 + ror ebx,7 + add ebp,edi + movdqa xmm9,xmm7 + add edx,DWORD PTR[rsp] + pxor xmm0,xmm4 +DB 102,68,15,58,15,206,8 + xor ebx,ecx + mov edi,ebp + rol ebp,5 + pxor xmm0,xmm1 + and esi,ebx + xor ebx,ecx + movdqa xmm8,xmm10 + paddd xmm10,xmm7 + xor esi,ecx + movups xmm12,XMMWORD PTR[16+r12] + xorps xmm12,xmm13 + movups XMMWORD PTR[r12*1+r13],xmm11 + xorps xmm11,xmm12 + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[32+r15] + add edx,ebp + pxor xmm0,xmm9 + ror eax,7 + add edx,esi + add ecx,DWORD PTR[4+rsp] + xor eax,ebx + movdqa xmm9,xmm0 + movdqa XMMWORD PTR[48+rsp],xmm10 + mov esi,edx + rol edx,5 + and edi,eax + xor eax,ebx + pslld xmm0,2 + xor edi,ebx + add ecx,edx + psrld xmm9,30 + ror ebp,7 + add ecx,edi + add ebx,DWORD PTR[8+rsp] + xor ebp,eax + mov edi,ecx + rol ecx,5 + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[48+r15] + por xmm0,xmm9 + and esi,ebp + xor ebp,eax + movdqa xmm10,xmm0 + xor esi,eax + add ebx,ecx + ror edx,7 + add ebx,esi + add eax,DWORD PTR[12+rsp] + xor edx,ebp + mov esi,ebx + rol ebx,5 + and edi,edx + xor edx,ebp + xor edi,ebp + add eax,ebx + ror ecx,7 + add eax,edi + add ebp,DWORD PTR[16+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[64+r15] + pxor xmm1,xmm5 +DB 102,68,15,58,15,215,8 + xor esi,edx + mov edi,eax + rol eax,5 + pxor xmm1,xmm2 + xor esi,ecx + add ebp,eax + movdqa xmm9,xmm8 + paddd xmm8,xmm0 + ror ebx,7 + add ebp,esi + pxor xmm1,xmm10 + add edx,DWORD PTR[20+rsp] + xor edi,ecx + mov esi,ebp + rol ebp,5 + movdqa xmm10,xmm1 + movdqa XMMWORD PTR[rsp],xmm8 + xor edi,ebx + add edx,ebp + ror eax,7 + add edx,edi + pslld xmm1,2 + add ecx,DWORD PTR[24+rsp] + xor esi,ebx + psrld xmm10,30 + mov edi,edx + rol edx,5 + xor esi,eax + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[80+r15] + add ecx,edx + ror ebp,7 + add ecx,esi + por xmm1,xmm10 + add ebx,DWORD PTR[28+rsp] + xor edi,eax + movdqa xmm8,xmm1 + mov esi,ecx + rol ecx,5 + xor edi,ebp + add ebx,ecx + ror edx,7 + add ebx,edi + add eax,DWORD PTR[32+rsp] + pxor xmm2,xmm6 +DB 102,68,15,58,15,192,8 + xor esi,ebp + mov edi,ebx + rol ebx,5 + pxor xmm2,xmm3 + xor esi,edx + add eax,ebx + movdqa xmm10,XMMWORD PTR[32+r11] + paddd xmm9,xmm1 + ror ecx,7 + add eax,esi + pxor xmm2,xmm8 + add ebp,DWORD PTR[36+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[96+r15] + xor edi,edx + mov esi,eax + rol eax,5 + movdqa xmm8,xmm2 + movdqa XMMWORD PTR[16+rsp],xmm9 + xor edi,ecx + add ebp,eax + ror ebx,7 + add ebp,edi + pslld xmm2,2 + add edx,DWORD PTR[40+rsp] + xor esi,ecx + psrld xmm8,30 + mov edi,ebp + rol ebp,5 + xor esi,ebx + add edx,ebp + ror eax,7 + add edx,esi + por xmm2,xmm8 + add ecx,DWORD PTR[44+rsp] + xor edi,ebx + movdqa xmm9,xmm2 + mov esi,edx + rol edx,5 + xor edi,eax + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[112+r15] + add ecx,edx + ror ebp,7 + add ecx,edi + add ebx,DWORD PTR[48+rsp] + pxor xmm3,xmm7 +DB 102,68,15,58,15,201,8 + xor esi,eax + mov edi,ecx + rol ecx,5 + pxor xmm3,xmm4 + xor esi,ebp + add ebx,ecx + movdqa xmm8,xmm10 + paddd xmm10,xmm2 + ror edx,7 + add ebx,esi + pxor xmm3,xmm9 + add eax,DWORD PTR[52+rsp] + xor edi,ebp + mov esi,ebx + rol ebx,5 + movdqa xmm9,xmm3 + movdqa XMMWORD PTR[32+rsp],xmm10 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + pslld xmm3,2 + add ebp,DWORD PTR[56+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[128+r15] + xor esi,edx + psrld xmm9,30 + mov edi,eax + rol eax,5 + xor esi,ecx + add ebp,eax + ror ebx,7 + add ebp,esi + por xmm3,xmm9 + add edx,DWORD PTR[60+rsp] + xor edi,ecx + movdqa xmm10,xmm3 + mov esi,ebp + rol ebp,5 + xor edi,ebx + add edx,ebp + ror eax,7 + add edx,edi + add ecx,DWORD PTR[rsp] + pxor xmm4,xmm0 +DB 102,68,15,58,15,210,8 + xor esi,ebx + mov edi,edx + rol edx,5 + pxor xmm4,xmm5 + xor esi,eax + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[144+r15] + add ecx,edx + movdqa xmm9,xmm8 + paddd xmm8,xmm3 + ror ebp,7 + add ecx,esi + pxor xmm4,xmm10 + add ebx,DWORD PTR[4+rsp] + xor edi,eax + mov esi,ecx + rol ecx,5 + movdqa xmm10,xmm4 + movdqa XMMWORD PTR[48+rsp],xmm8 + xor edi,ebp + add ebx,ecx + ror edx,7 + add ebx,edi + pslld xmm4,2 + add eax,DWORD PTR[8+rsp] + xor esi,ebp + psrld xmm10,30 + mov edi,ebx + rol ebx,5 + xor esi,edx + add eax,ebx + ror ecx,7 + add eax,esi + por xmm4,xmm10 + add ebp,DWORD PTR[12+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[160+r15] + xor edi,edx + movdqa xmm8,xmm4 + mov esi,eax + rol eax,5 + xor edi,ecx + add ebp,eax + ror ebx,7 + add ebp,edi + add edx,DWORD PTR[16+rsp] + pxor xmm5,xmm1 +DB 102,68,15,58,15,195,8 + xor esi,ecx + mov edi,ebp + rol ebp,5 + pxor xmm5,xmm6 + xor esi,ebx + add edx,ebp + movdqa xmm10,xmm9 + paddd xmm9,xmm4 + ror eax,7 + add edx,esi + pxor xmm5,xmm8 + add ecx,DWORD PTR[20+rsp] + xor edi,ebx + mov esi,edx + rol edx,5 + movdqa xmm8,xmm5 + movdqa XMMWORD PTR[rsp],xmm9 + xor edi,eax + cmp r8d,11 + jb $L$aesenclast2 + movups xmm14,XMMWORD PTR[176+r15] + aesenc xmm11,xmm15 + movups xmm15,XMMWORD PTR[192+r15] + aesenc xmm11,xmm14 + je $L$aesenclast2 + movups xmm14,XMMWORD PTR[208+r15] + aesenc xmm11,xmm15 + movups xmm15,XMMWORD PTR[224+r15] + aesenc xmm11,xmm14 +$L$aesenclast2:: + aesenclast xmm11,xmm15 + movups xmm14,XMMWORD PTR[16+r15] + add ecx,edx + ror ebp,7 + add ecx,edi + pslld xmm5,2 + add ebx,DWORD PTR[24+rsp] + xor esi,eax + psrld xmm8,30 + mov edi,ecx + rol ecx,5 + xor esi,ebp + add ebx,ecx + ror edx,7 + add ebx,esi + por xmm5,xmm8 + add eax,DWORD PTR[28+rsp] + xor edi,ebp + movdqa xmm9,xmm5 + mov esi,ebx + rol ebx,5 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + mov edi,ecx + movups xmm12,XMMWORD PTR[32+r12] + xorps xmm12,xmm13 + movups XMMWORD PTR[16+r12*1+r13],xmm11 + xorps xmm11,xmm12 + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[32+r15] + pxor xmm6,xmm2 +DB 102,68,15,58,15,204,8 + xor ecx,edx + add ebp,DWORD PTR[32+rsp] + and edi,edx + pxor xmm6,xmm7 + and esi,ecx + ror ebx,7 + movdqa xmm8,xmm10 + paddd xmm10,xmm5 + add ebp,edi + mov edi,eax + pxor xmm6,xmm9 + rol eax,5 + add ebp,esi + xor ecx,edx + add ebp,eax + movdqa xmm9,xmm6 + movdqa XMMWORD PTR[16+rsp],xmm10 + mov esi,ebx + xor ebx,ecx + add edx,DWORD PTR[36+rsp] + and esi,ecx + pslld xmm6,2 + and edi,ebx + ror eax,7 + psrld xmm9,30 + add edx,esi + mov esi,ebp + rol ebp,5 + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[48+r15] + add edx,edi + xor ebx,ecx + add edx,ebp + por xmm6,xmm9 + mov edi,eax + xor eax,ebx + movdqa xmm10,xmm6 + add ecx,DWORD PTR[40+rsp] + and edi,ebx + and esi,eax + ror ebp,7 + add ecx,edi + mov edi,edx + rol edx,5 + add ecx,esi + xor eax,ebx + add ecx,edx + mov esi,ebp + xor ebp,eax + add ebx,DWORD PTR[44+rsp] + and esi,eax + and edi,ebp + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[64+r15] + ror edx,7 + add ebx,esi + mov esi,ecx + rol ecx,5 + add ebx,edi + xor ebp,eax + add ebx,ecx + mov edi,edx + pxor xmm7,xmm3 +DB 102,68,15,58,15,213,8 + xor edx,ebp + add eax,DWORD PTR[48+rsp] + and edi,ebp + pxor xmm7,xmm0 + and esi,edx + ror ecx,7 + movdqa xmm9,XMMWORD PTR[48+r11] + paddd xmm8,xmm6 + add eax,edi + mov edi,ebx + pxor xmm7,xmm10 + rol ebx,5 + add eax,esi + xor edx,ebp + add eax,ebx + movdqa xmm10,xmm7 + movdqa XMMWORD PTR[32+rsp],xmm8 + mov esi,ecx + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[80+r15] + xor ecx,edx + add ebp,DWORD PTR[52+rsp] + and esi,edx + pslld xmm7,2 + and edi,ecx + ror ebx,7 + psrld xmm10,30 + add ebp,esi + mov esi,eax + rol eax,5 + add ebp,edi + xor ecx,edx + add ebp,eax + por xmm7,xmm10 + mov edi,ebx + xor ebx,ecx + movdqa xmm8,xmm7 + add edx,DWORD PTR[56+rsp] + and edi,ecx + and esi,ebx + ror eax,7 + add edx,edi + mov edi,ebp + rol ebp,5 + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[96+r15] + add edx,esi + xor ebx,ecx + add edx,ebp + mov esi,eax + xor eax,ebx + add ecx,DWORD PTR[60+rsp] + and esi,ebx + and edi,eax + ror ebp,7 + add ecx,esi + mov esi,edx + rol edx,5 + add ecx,edi + xor eax,ebx + add ecx,edx + mov edi,ebp + pxor xmm0,xmm4 +DB 102,68,15,58,15,198,8 + xor ebp,eax + add ebx,DWORD PTR[rsp] + and edi,eax + pxor xmm0,xmm1 + and esi,ebp + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[112+r15] + ror edx,7 + movdqa xmm10,xmm9 + paddd xmm9,xmm7 + add ebx,edi + mov edi,ecx + pxor xmm0,xmm8 + rol ecx,5 + add ebx,esi + xor ebp,eax + add ebx,ecx + movdqa xmm8,xmm0 + movdqa XMMWORD PTR[48+rsp],xmm9 + mov esi,edx + xor edx,ebp + add eax,DWORD PTR[4+rsp] + and esi,ebp + pslld xmm0,2 + and edi,edx + ror ecx,7 + psrld xmm8,30 + add eax,esi + mov esi,ebx + rol ebx,5 + add eax,edi + xor edx,ebp + add eax,ebx + por xmm0,xmm8 + mov edi,ecx + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[128+r15] + xor ecx,edx + movdqa xmm9,xmm0 + add ebp,DWORD PTR[8+rsp] + and edi,edx + and esi,ecx + ror ebx,7 + add ebp,edi + mov edi,eax + rol eax,5 + add ebp,esi + xor ecx,edx + add ebp,eax + mov esi,ebx + xor ebx,ecx + add edx,DWORD PTR[12+rsp] + and esi,ecx + and edi,ebx + ror eax,7 + add edx,esi + mov esi,ebp + rol ebp,5 + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[144+r15] + add edx,edi + xor ebx,ecx + add edx,ebp + mov edi,eax + pxor xmm1,xmm5 +DB 102,68,15,58,15,207,8 + xor eax,ebx + add ecx,DWORD PTR[16+rsp] + and edi,ebx + pxor xmm1,xmm2 + and esi,eax + ror ebp,7 + movdqa xmm8,xmm10 + paddd xmm10,xmm0 + add ecx,edi + mov edi,edx + pxor xmm1,xmm9 + rol edx,5 + add ecx,esi + xor eax,ebx + add ecx,edx + movdqa xmm9,xmm1 + movdqa XMMWORD PTR[rsp],xmm10 + mov esi,ebp + xor ebp,eax + add ebx,DWORD PTR[20+rsp] + and esi,eax + pslld xmm1,2 + and edi,ebp + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[160+r15] + ror edx,7 + psrld xmm9,30 + add ebx,esi + mov esi,ecx + rol ecx,5 + add ebx,edi + xor ebp,eax + add ebx,ecx + por xmm1,xmm9 + mov edi,edx + xor edx,ebp + movdqa xmm10,xmm1 + add eax,DWORD PTR[24+rsp] + and edi,ebp + and esi,edx + ror ecx,7 + add eax,edi + mov edi,ebx + rol ebx,5 + add eax,esi + xor edx,ebp + add eax,ebx + mov esi,ecx + cmp r8d,11 + jb $L$aesenclast3 + movups xmm14,XMMWORD PTR[176+r15] + aesenc xmm11,xmm15 + movups xmm15,XMMWORD PTR[192+r15] + aesenc xmm11,xmm14 + je $L$aesenclast3 + movups xmm14,XMMWORD PTR[208+r15] + aesenc xmm11,xmm15 + movups xmm15,XMMWORD PTR[224+r15] + aesenc xmm11,xmm14 +$L$aesenclast3:: + aesenclast xmm11,xmm15 + movups xmm14,XMMWORD PTR[16+r15] + xor ecx,edx + add ebp,DWORD PTR[28+rsp] + and esi,edx + and edi,ecx + ror ebx,7 + add ebp,esi + mov esi,eax + rol eax,5 + add ebp,edi + xor ecx,edx + add ebp,eax + mov edi,ebx + pxor xmm2,xmm6 +DB 102,68,15,58,15,208,8 + xor ebx,ecx + add edx,DWORD PTR[32+rsp] + and edi,ecx + pxor xmm2,xmm3 + and esi,ebx + ror eax,7 + movdqa xmm9,xmm8 + paddd xmm8,xmm1 + add edx,edi + mov edi,ebp + pxor xmm2,xmm10 + rol ebp,5 + movups xmm12,XMMWORD PTR[48+r12] + xorps xmm12,xmm13 + movups XMMWORD PTR[32+r12*1+r13],xmm11 + xorps xmm11,xmm12 + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[32+r15] + add edx,esi + xor ebx,ecx + add edx,ebp + movdqa xmm10,xmm2 + movdqa XMMWORD PTR[16+rsp],xmm8 + mov esi,eax + xor eax,ebx + add ecx,DWORD PTR[36+rsp] + and esi,ebx + pslld xmm2,2 + and edi,eax + ror ebp,7 + psrld xmm10,30 + add ecx,esi + mov esi,edx + rol edx,5 + add ecx,edi + xor eax,ebx + add ecx,edx + por xmm2,xmm10 + mov edi,ebp + xor ebp,eax + movdqa xmm8,xmm2 + add ebx,DWORD PTR[40+rsp] + and edi,eax + and esi,ebp + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[48+r15] + ror edx,7 + add ebx,edi + mov edi,ecx + rol ecx,5 + add ebx,esi + xor ebp,eax + add ebx,ecx + mov esi,edx + xor edx,ebp + add eax,DWORD PTR[44+rsp] + and esi,ebp + and edi,edx + ror ecx,7 + add eax,esi + mov esi,ebx + rol ebx,5 + add eax,edi + xor edx,ebp + add eax,ebx + add ebp,DWORD PTR[48+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[64+r15] + pxor xmm3,xmm7 +DB 102,68,15,58,15,193,8 + xor esi,edx + mov edi,eax + rol eax,5 + pxor xmm3,xmm4 + xor esi,ecx + add ebp,eax + movdqa xmm10,xmm9 + paddd xmm9,xmm2 + ror ebx,7 + add ebp,esi + pxor xmm3,xmm8 + add edx,DWORD PTR[52+rsp] + xor edi,ecx + mov esi,ebp + rol ebp,5 + movdqa xmm8,xmm3 + movdqa XMMWORD PTR[32+rsp],xmm9 + xor edi,ebx + add edx,ebp + ror eax,7 + add edx,edi + pslld xmm3,2 + add ecx,DWORD PTR[56+rsp] + xor esi,ebx + psrld xmm8,30 + mov edi,edx + rol edx,5 + xor esi,eax + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[80+r15] + add ecx,edx + ror ebp,7 + add ecx,esi + por xmm3,xmm8 + add ebx,DWORD PTR[60+rsp] + xor edi,eax + mov esi,ecx + rol ecx,5 + xor edi,ebp + add ebx,ecx + ror edx,7 + add ebx,edi + add eax,DWORD PTR[rsp] + paddd xmm10,xmm3 + xor esi,ebp + mov edi,ebx + rol ebx,5 + xor esi,edx + movdqa XMMWORD PTR[48+rsp],xmm10 + add eax,ebx + ror ecx,7 + add eax,esi + add ebp,DWORD PTR[4+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[96+r15] + xor edi,edx + mov esi,eax + rol eax,5 + xor edi,ecx + add ebp,eax + ror ebx,7 + add ebp,edi + add edx,DWORD PTR[8+rsp] + xor esi,ecx + mov edi,ebp + rol ebp,5 + xor esi,ebx + add edx,ebp + ror eax,7 + add edx,esi + add ecx,DWORD PTR[12+rsp] + xor edi,ebx + mov esi,edx + rol edx,5 + xor edi,eax + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[112+r15] + add ecx,edx + ror ebp,7 + add ecx,edi + cmp r10,r14 + je $L$done_ssse3 + movdqa xmm6,XMMWORD PTR[64+r11] + movdqa xmm9,XMMWORD PTR[r11] + movdqu xmm0,XMMWORD PTR[r10] + movdqu xmm1,XMMWORD PTR[16+r10] + movdqu xmm2,XMMWORD PTR[32+r10] + movdqu xmm3,XMMWORD PTR[48+r10] +DB 102,15,56,0,198 + add r10,64 + add ebx,DWORD PTR[16+rsp] + xor esi,eax +DB 102,15,56,0,206 + mov edi,ecx + rol ecx,5 + paddd xmm0,xmm9 + xor esi,ebp + add ebx,ecx + ror edx,7 + add ebx,esi + movdqa XMMWORD PTR[rsp],xmm0 + add eax,DWORD PTR[20+rsp] + xor edi,ebp + psubd xmm0,xmm9 + mov esi,ebx + rol ebx,5 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + add ebp,DWORD PTR[24+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[128+r15] + xor esi,edx + mov edi,eax + rol eax,5 + xor esi,ecx + add ebp,eax + ror ebx,7 + add ebp,esi + add edx,DWORD PTR[28+rsp] + xor edi,ecx + mov esi,ebp + rol ebp,5 + xor edi,ebx + add edx,ebp + ror eax,7 + add edx,edi + add ecx,DWORD PTR[32+rsp] + xor esi,ebx +DB 102,15,56,0,214 + mov edi,edx + rol edx,5 + paddd xmm1,xmm9 + xor esi,eax + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[144+r15] + add ecx,edx + ror ebp,7 + add ecx,esi + movdqa XMMWORD PTR[16+rsp],xmm1 + add ebx,DWORD PTR[36+rsp] + xor edi,eax + psubd xmm1,xmm9 + mov esi,ecx + rol ecx,5 + xor edi,ebp + add ebx,ecx + ror edx,7 + add ebx,edi + add eax,DWORD PTR[40+rsp] + xor esi,ebp + mov edi,ebx + rol ebx,5 + xor esi,edx + add eax,ebx + ror ecx,7 + add eax,esi + add ebp,DWORD PTR[44+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[160+r15] + xor edi,edx + mov esi,eax + rol eax,5 + xor edi,ecx + add ebp,eax + ror ebx,7 + add ebp,edi + add edx,DWORD PTR[48+rsp] + xor esi,ecx +DB 102,15,56,0,222 + mov edi,ebp + rol ebp,5 + paddd xmm2,xmm9 + xor esi,ebx + add edx,ebp + ror eax,7 + add edx,esi + movdqa XMMWORD PTR[32+rsp],xmm2 + add ecx,DWORD PTR[52+rsp] + xor edi,ebx + psubd xmm2,xmm9 + mov esi,edx + rol edx,5 + xor edi,eax + cmp r8d,11 + jb $L$aesenclast4 + movups xmm14,XMMWORD PTR[176+r15] + aesenc xmm11,xmm15 + movups xmm15,XMMWORD PTR[192+r15] + aesenc xmm11,xmm14 + je $L$aesenclast4 + movups xmm14,XMMWORD PTR[208+r15] + aesenc xmm11,xmm15 + movups xmm15,XMMWORD PTR[224+r15] + aesenc xmm11,xmm14 +$L$aesenclast4:: + aesenclast xmm11,xmm15 + movups xmm14,XMMWORD PTR[16+r15] + add ecx,edx + ror ebp,7 + add ecx,edi + add ebx,DWORD PTR[56+rsp] + xor esi,eax + mov edi,ecx + rol ecx,5 + xor esi,ebp + add ebx,ecx + ror edx,7 + add ebx,esi + add eax,DWORD PTR[60+rsp] + xor edi,ebp + mov esi,ebx + rol ebx,5 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + movups XMMWORD PTR[48+r12*1+r13],xmm11 + lea r12,QWORD PTR[64+r12] + + add eax,DWORD PTR[r9] + add esi,DWORD PTR[4+r9] + add ecx,DWORD PTR[8+r9] + add edx,DWORD PTR[12+r9] + mov DWORD PTR[r9],eax + add ebp,DWORD PTR[16+r9] + mov DWORD PTR[4+r9],esi + mov ebx,esi + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + mov DWORD PTR[16+r9],ebp + jmp $L$oop_ssse3 + +ALIGN 16 +$L$done_ssse3:: + add ebx,DWORD PTR[16+rsp] + xor esi,eax + mov edi,ecx + rol ecx,5 + xor esi,ebp + add ebx,ecx + ror edx,7 + add ebx,esi + add eax,DWORD PTR[20+rsp] + xor edi,ebp + mov esi,ebx + rol ebx,5 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + add ebp,DWORD PTR[24+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[128+r15] + xor esi,edx + mov edi,eax + rol eax,5 + xor esi,ecx + add ebp,eax + ror ebx,7 + add ebp,esi + add edx,DWORD PTR[28+rsp] + xor edi,ecx + mov esi,ebp + rol ebp,5 + xor edi,ebx + add edx,ebp + ror eax,7 + add edx,edi + add ecx,DWORD PTR[32+rsp] + xor esi,ebx + mov edi,edx + rol edx,5 + xor esi,eax + aesenc xmm11,xmm15 + movups xmm14,XMMWORD PTR[144+r15] + add ecx,edx + ror ebp,7 + add ecx,esi + add ebx,DWORD PTR[36+rsp] + xor edi,eax + mov esi,ecx + rol ecx,5 + xor edi,ebp + add ebx,ecx + ror edx,7 + add ebx,edi + add eax,DWORD PTR[40+rsp] + xor esi,ebp + mov edi,ebx + rol ebx,5 + xor esi,edx + add eax,ebx + ror ecx,7 + add eax,esi + add ebp,DWORD PTR[44+rsp] + aesenc xmm11,xmm14 + movups xmm15,XMMWORD PTR[160+r15] + xor edi,edx + mov esi,eax + rol eax,5 + xor edi,ecx + add ebp,eax + ror ebx,7 + add ebp,edi + add edx,DWORD PTR[48+rsp] + xor esi,ecx + mov edi,ebp + rol ebp,5 + xor esi,ebx + add edx,ebp + ror eax,7 + add edx,esi + add ecx,DWORD PTR[52+rsp] + xor edi,ebx + mov esi,edx + rol edx,5 + xor edi,eax + cmp r8d,11 + jb $L$aesenclast5 + movups xmm14,XMMWORD PTR[176+r15] + aesenc xmm11,xmm15 + movups xmm15,XMMWORD PTR[192+r15] + aesenc xmm11,xmm14 + je $L$aesenclast5 + movups xmm14,XMMWORD PTR[208+r15] + aesenc xmm11,xmm15 + movups xmm15,XMMWORD PTR[224+r15] + aesenc xmm11,xmm14 +$L$aesenclast5:: + aesenclast xmm11,xmm15 + movups xmm14,XMMWORD PTR[16+r15] + add ecx,edx + ror ebp,7 + add ecx,edi + add ebx,DWORD PTR[56+rsp] + xor esi,eax + mov edi,ecx + rol ecx,5 + xor esi,ebp + add ebx,ecx + ror edx,7 + add ebx,esi + add eax,DWORD PTR[60+rsp] + xor edi,ebp + mov esi,ebx + rol ebx,5 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + movups XMMWORD PTR[48+r12*1+r13],xmm11 + mov r8,QWORD PTR[88+rsp] + + add eax,DWORD PTR[r9] + add esi,DWORD PTR[4+r9] + add ecx,DWORD PTR[8+r9] + mov DWORD PTR[r9],eax + add edx,DWORD PTR[12+r9] + mov DWORD PTR[4+r9],esi + add ebp,DWORD PTR[16+r9] + mov DWORD PTR[8+r9],ecx + mov DWORD PTR[12+r9],edx + mov DWORD PTR[16+r9],ebp + movups XMMWORD PTR[r8],xmm11 + movaps xmm6,XMMWORD PTR[((96+0))+rsp] + movaps xmm7,XMMWORD PTR[((96+16))+rsp] + movaps xmm8,XMMWORD PTR[((96+32))+rsp] + movaps xmm9,XMMWORD PTR[((96+48))+rsp] + movaps xmm10,XMMWORD PTR[((96+64))+rsp] + movaps xmm11,XMMWORD PTR[((96+80))+rsp] + movaps xmm12,XMMWORD PTR[((96+96))+rsp] + movaps xmm13,XMMWORD PTR[((96+112))+rsp] + movaps xmm14,XMMWORD PTR[((96+128))+rsp] + movaps xmm15,XMMWORD PTR[((96+144))+rsp] + lea rsi,QWORD PTR[264+rsp] + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$epilogue_ssse3:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_aesni_cbc_sha1_enc_ssse3:: +aesni_cbc_sha1_enc_ssse3 ENDP +ALIGN 64 +K_XX_XX:: + DD 05a827999h,05a827999h,05a827999h,05a827999h + DD 06ed9eba1h,06ed9eba1h,06ed9eba1h,06ed9eba1h + DD 08f1bbcdch,08f1bbcdch,08f1bbcdch,08f1bbcdch + DD 0ca62c1d6h,0ca62c1d6h,0ca62c1d6h,0ca62c1d6h + DD 000010203h,004050607h,008090a0bh,00c0d0e0fh + +DB 65,69,83,78,73,45,67,66,67,43,83,72,65,49,32,115 +DB 116,105,116,99,104,32,102,111,114,32,120,56,54,95,54,52 +DB 44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32 +DB 60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111 +DB 114,103,62,0 +ALIGN 64 +EXTERN __imp_RtlVirtualUnwind:NEAR + +ALIGN 16 +ssse3_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + mov rsi,QWORD PTR[8+r9] + mov r11,QWORD PTR[56+r9] + + mov r10d,DWORD PTR[r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$common_seh_tail + + mov rax,QWORD PTR[152+r8] + + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jae $L$common_seh_tail + + lea rsi,QWORD PTR[96+rax] + lea rdi,QWORD PTR[512+r8] + mov ecx,20 + DD 0a548f3fch + lea rax,QWORD PTR[264+rax] + + mov r15,QWORD PTR[rax] + mov r14,QWORD PTR[8+rax] + mov r13,QWORD PTR[16+rax] + mov r12,QWORD PTR[24+rax] + mov rbp,QWORD PTR[32+rax] + mov rbx,QWORD PTR[40+rax] + lea rax,QWORD PTR[48+rax] + mov QWORD PTR[144+r8],rbx + mov QWORD PTR[160+r8],rbp + mov QWORD PTR[216+r8],r12 + mov QWORD PTR[224+r8],r13 + mov QWORD PTR[232+r8],r14 + mov QWORD PTR[240+r8],r15 + +$L$common_seh_tail:: + mov rdi,QWORD PTR[8+rax] + mov rsi,QWORD PTR[16+rax] + mov QWORD PTR[152+r8],rax + mov QWORD PTR[168+r8],rsi + mov QWORD PTR[176+r8],rdi + + mov rdi,QWORD PTR[40+r9] + mov rsi,r8 + mov ecx,154 + DD 0a548f3fch + + mov rsi,r9 + xor rcx,rcx + mov rdx,QWORD PTR[8+rsi] + mov r8,QWORD PTR[rsi] + mov r9,QWORD PTR[16+rsi] + mov r10,QWORD PTR[40+rsi] + lea r11,QWORD PTR[56+rsi] + lea r12,QWORD PTR[24+rsi] + mov QWORD PTR[32+rsp],r10 + mov QWORD PTR[40+rsp],r11 + mov QWORD PTR[48+rsp],r12 + mov QWORD PTR[56+rsp],rcx + call QWORD PTR[__imp_RtlVirtualUnwind] + + mov eax,1 + add rsp,64 + popfq + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + pop rbx + pop rdi + pop rsi + DB 0F3h,0C3h ;repret +ssse3_handler ENDP + +.text$ ENDS +.pdata SEGMENT READONLY ALIGN(4) +ALIGN 4 + DD imagerel $L$SEH_begin_aesni_cbc_sha1_enc_ssse3 + DD imagerel $L$SEH_end_aesni_cbc_sha1_enc_ssse3 + DD imagerel $L$SEH_info_aesni_cbc_sha1_enc_ssse3 +.pdata ENDS +.xdata SEGMENT READONLY ALIGN(8) +ALIGN 8 +$L$SEH_info_aesni_cbc_sha1_enc_ssse3:: +DB 9,0,0,0 + DD imagerel ssse3_handler + DD imagerel $L$prologue_ssse3,imagerel $L$epilogue_ssse3 + +.xdata ENDS +END diff --git a/crypto/aes/aesni-sha1-mingw64-x86_64.S b/crypto/aes/aesni-sha1-mingw64-x86_64.S new file mode 100644 index 00000000..c7a2d5cb --- /dev/null +++ b/crypto/aes/aesni-sha1-mingw64-x86_64.S @@ -0,0 +1,1536 @@ +#include "x86_arch.h" +.text + + + +.globl aesni_cbc_sha1_enc +.def aesni_cbc_sha1_enc; .scl 2; .type 32; .endef +.p2align 4 +aesni_cbc_sha1_enc: + + movl OPENSSL_ia32cap_P+0(%rip),%r10d + movl OPENSSL_ia32cap_P+4(%rip),%r11d + jmp aesni_cbc_sha1_enc_ssse3 + retq + +.def aesni_cbc_sha1_enc_ssse3; .scl 3; .type 32; .endef +.p2align 4 +aesni_cbc_sha1_enc_ssse3: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_aesni_cbc_sha1_enc_ssse3: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + movq 48(%rsp),%r9 + + movq 56(%rsp),%r10 + + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + leaq -264(%rsp),%rsp + + + movaps %xmm6,96+0(%rsp) + movaps %xmm7,96+16(%rsp) + movaps %xmm8,96+32(%rsp) + movaps %xmm9,96+48(%rsp) + movaps %xmm10,96+64(%rsp) + movaps %xmm11,96+80(%rsp) + movaps %xmm12,96+96(%rsp) + movaps %xmm13,96+112(%rsp) + movaps %xmm14,96+128(%rsp) + movaps %xmm15,96+144(%rsp) +.Lprologue_ssse3: + movq %rdi,%r12 + movq %rsi,%r13 + movq %rdx,%r14 + movq %rcx,%r15 + movdqu (%r8),%xmm11 + movq %r8,88(%rsp) + shlq $6,%r14 + subq %r12,%r13 + movl 240(%r15),%r8d + addq %r10,%r14 + + leaq K_XX_XX(%rip),%r11 + movl 0(%r9),%eax + movl 4(%r9),%ebx + movl 8(%r9),%ecx + movl 12(%r9),%edx + movl %ebx,%esi + movl 16(%r9),%ebp + + movdqa 64(%r11),%xmm6 + movdqa 0(%r11),%xmm9 + movdqu 0(%r10),%xmm0 + movdqu 16(%r10),%xmm1 + movdqu 32(%r10),%xmm2 + movdqu 48(%r10),%xmm3 +.byte 102,15,56,0,198 + addq $64,%r10 +.byte 102,15,56,0,206 +.byte 102,15,56,0,214 +.byte 102,15,56,0,222 + paddd %xmm9,%xmm0 + paddd %xmm9,%xmm1 + paddd %xmm9,%xmm2 + movdqa %xmm0,0(%rsp) + psubd %xmm9,%xmm0 + movdqa %xmm1,16(%rsp) + psubd %xmm9,%xmm1 + movdqa %xmm2,32(%rsp) + psubd %xmm9,%xmm2 + movups (%r15),%xmm13 + movups 16(%r15),%xmm14 + jmp .Loop_ssse3 +.p2align 4 +.Loop_ssse3: + movdqa %xmm1,%xmm4 + addl 0(%rsp),%ebp + movups 0(%r12),%xmm12 + xorps %xmm13,%xmm12 + xorps %xmm12,%xmm11 + aesenc %xmm14,%xmm11 + movups 32(%r15),%xmm15 + xorl %edx,%ecx + movdqa %xmm3,%xmm8 +.byte 102,15,58,15,224,8 + movl %eax,%edi + roll $5,%eax + paddd %xmm3,%xmm9 + andl %ecx,%esi + xorl %edx,%ecx + psrldq $4,%xmm8 + xorl %edx,%esi + addl %eax,%ebp + pxor %xmm0,%xmm4 + rorl $2,%ebx + addl %esi,%ebp + pxor %xmm2,%xmm8 + addl 4(%rsp),%edx + xorl %ecx,%ebx + movl %ebp,%esi + roll $5,%ebp + pxor %xmm8,%xmm4 + andl %ebx,%edi + xorl %ecx,%ebx + movdqa %xmm9,48(%rsp) + xorl %ecx,%edi + aesenc %xmm15,%xmm11 + movups 48(%r15),%xmm14 + addl %ebp,%edx + movdqa %xmm4,%xmm10 + movdqa %xmm4,%xmm8 + rorl $7,%eax + addl %edi,%edx + addl 8(%rsp),%ecx + xorl %ebx,%eax + pslldq $12,%xmm10 + paddd %xmm4,%xmm4 + movl %edx,%edi + roll $5,%edx + andl %eax,%esi + xorl %ebx,%eax + psrld $31,%xmm8 + xorl %ebx,%esi + addl %edx,%ecx + movdqa %xmm10,%xmm9 + rorl $7,%ebp + addl %esi,%ecx + psrld $30,%xmm10 + por %xmm8,%xmm4 + addl 12(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%esi + roll $5,%ecx + aesenc %xmm14,%xmm11 + movups 64(%r15),%xmm15 + pslld $2,%xmm9 + pxor %xmm10,%xmm4 + andl %ebp,%edi + xorl %eax,%ebp + movdqa 0(%r11),%xmm10 + xorl %eax,%edi + addl %ecx,%ebx + pxor %xmm9,%xmm4 + rorl $7,%edx + addl %edi,%ebx + movdqa %xmm2,%xmm5 + addl 16(%rsp),%eax + xorl %ebp,%edx + movdqa %xmm4,%xmm9 +.byte 102,15,58,15,233,8 + movl %ebx,%edi + roll $5,%ebx + paddd %xmm4,%xmm10 + andl %edx,%esi + xorl %ebp,%edx + psrldq $4,%xmm9 + xorl %ebp,%esi + addl %ebx,%eax + pxor %xmm1,%xmm5 + rorl $7,%ecx + addl %esi,%eax + pxor %xmm3,%xmm9 + addl 20(%rsp),%ebp + aesenc %xmm15,%xmm11 + movups 80(%r15),%xmm14 + xorl %edx,%ecx + movl %eax,%esi + roll $5,%eax + pxor %xmm9,%xmm5 + andl %ecx,%edi + xorl %edx,%ecx + movdqa %xmm10,0(%rsp) + xorl %edx,%edi + addl %eax,%ebp + movdqa %xmm5,%xmm8 + movdqa %xmm5,%xmm9 + rorl $7,%ebx + addl %edi,%ebp + addl 24(%rsp),%edx + xorl %ecx,%ebx + pslldq $12,%xmm8 + paddd %xmm5,%xmm5 + movl %ebp,%edi + roll $5,%ebp + andl %ebx,%esi + xorl %ecx,%ebx + psrld $31,%xmm9 + xorl %ecx,%esi + aesenc %xmm14,%xmm11 + movups 96(%r15),%xmm15 + addl %ebp,%edx + movdqa %xmm8,%xmm10 + rorl $7,%eax + addl %esi,%edx + psrld $30,%xmm8 + por %xmm9,%xmm5 + addl 28(%rsp),%ecx + xorl %ebx,%eax + movl %edx,%esi + roll $5,%edx + pslld $2,%xmm10 + pxor %xmm8,%xmm5 + andl %eax,%edi + xorl %ebx,%eax + movdqa 16(%r11),%xmm8 + xorl %ebx,%edi + addl %edx,%ecx + pxor %xmm10,%xmm5 + rorl $7,%ebp + addl %edi,%ecx + movdqa %xmm3,%xmm6 + addl 32(%rsp),%ebx + xorl %eax,%ebp + movdqa %xmm5,%xmm10 +.byte 102,15,58,15,242,8 + movl %ecx,%edi + roll $5,%ecx + aesenc %xmm15,%xmm11 + movups 112(%r15),%xmm14 + paddd %xmm5,%xmm8 + andl %ebp,%esi + xorl %eax,%ebp + psrldq $4,%xmm10 + xorl %eax,%esi + addl %ecx,%ebx + pxor %xmm2,%xmm6 + rorl $7,%edx + addl %esi,%ebx + pxor %xmm4,%xmm10 + addl 36(%rsp),%eax + xorl %ebp,%edx + movl %ebx,%esi + roll $5,%ebx + pxor %xmm10,%xmm6 + andl %edx,%edi + xorl %ebp,%edx + movdqa %xmm8,16(%rsp) + xorl %ebp,%edi + addl %ebx,%eax + movdqa %xmm6,%xmm9 + movdqa %xmm6,%xmm10 + rorl $7,%ecx + addl %edi,%eax + addl 40(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 128(%r15),%xmm15 + xorl %edx,%ecx + pslldq $12,%xmm9 + paddd %xmm6,%xmm6 + movl %eax,%edi + roll $5,%eax + andl %ecx,%esi + xorl %edx,%ecx + psrld $31,%xmm10 + xorl %edx,%esi + addl %eax,%ebp + movdqa %xmm9,%xmm8 + rorl $7,%ebx + addl %esi,%ebp + psrld $30,%xmm9 + por %xmm10,%xmm6 + addl 44(%rsp),%edx + xorl %ecx,%ebx + movl %ebp,%esi + roll $5,%ebp + pslld $2,%xmm8 + pxor %xmm9,%xmm6 + andl %ebx,%edi + xorl %ecx,%ebx + movdqa 16(%r11),%xmm9 + xorl %ecx,%edi + aesenc %xmm15,%xmm11 + movups 144(%r15),%xmm14 + addl %ebp,%edx + pxor %xmm8,%xmm6 + rorl $7,%eax + addl %edi,%edx + movdqa %xmm4,%xmm7 + addl 48(%rsp),%ecx + xorl %ebx,%eax + movdqa %xmm6,%xmm8 +.byte 102,15,58,15,251,8 + movl %edx,%edi + roll $5,%edx + paddd %xmm6,%xmm9 + andl %eax,%esi + xorl %ebx,%eax + psrldq $4,%xmm8 + xorl %ebx,%esi + addl %edx,%ecx + pxor %xmm3,%xmm7 + rorl $7,%ebp + addl %esi,%ecx + pxor %xmm5,%xmm8 + addl 52(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%esi + roll $5,%ecx + aesenc %xmm14,%xmm11 + movups 160(%r15),%xmm15 + pxor %xmm8,%xmm7 + andl %ebp,%edi + xorl %eax,%ebp + movdqa %xmm9,32(%rsp) + xorl %eax,%edi + addl %ecx,%ebx + movdqa %xmm7,%xmm10 + movdqa %xmm7,%xmm8 + rorl $7,%edx + addl %edi,%ebx + addl 56(%rsp),%eax + xorl %ebp,%edx + pslldq $12,%xmm10 + paddd %xmm7,%xmm7 + movl %ebx,%edi + roll $5,%ebx + andl %edx,%esi + xorl %ebp,%edx + psrld $31,%xmm8 + xorl %ebp,%esi + addl %ebx,%eax + movdqa %xmm10,%xmm9 + rorl $7,%ecx + addl %esi,%eax + psrld $30,%xmm10 + por %xmm8,%xmm7 + addl 60(%rsp),%ebp + cmpl $11,%r8d + jb .Laesenclast1 + movups 176(%r15),%xmm14 + aesenc %xmm15,%xmm11 + movups 192(%r15),%xmm15 + aesenc %xmm14,%xmm11 + je .Laesenclast1 + movups 208(%r15),%xmm14 + aesenc %xmm15,%xmm11 + movups 224(%r15),%xmm15 + aesenc %xmm14,%xmm11 +.Laesenclast1: + aesenclast %xmm15,%xmm11 + movups 16(%r15),%xmm14 + xorl %edx,%ecx + movl %eax,%esi + roll $5,%eax + pslld $2,%xmm9 + pxor %xmm10,%xmm7 + andl %ecx,%edi + xorl %edx,%ecx + movdqa 16(%r11),%xmm10 + xorl %edx,%edi + addl %eax,%ebp + pxor %xmm9,%xmm7 + rorl $7,%ebx + addl %edi,%ebp + movdqa %xmm7,%xmm9 + addl 0(%rsp),%edx + pxor %xmm4,%xmm0 +.byte 102,68,15,58,15,206,8 + xorl %ecx,%ebx + movl %ebp,%edi + roll $5,%ebp + pxor %xmm1,%xmm0 + andl %ebx,%esi + xorl %ecx,%ebx + movdqa %xmm10,%xmm8 + paddd %xmm7,%xmm10 + xorl %ecx,%esi + movups 16(%r12),%xmm12 + xorps %xmm13,%xmm12 + movups %xmm11,0(%r13,%r12,1) + xorps %xmm12,%xmm11 + aesenc %xmm14,%xmm11 + movups 32(%r15),%xmm15 + addl %ebp,%edx + pxor %xmm9,%xmm0 + rorl $7,%eax + addl %esi,%edx + addl 4(%rsp),%ecx + xorl %ebx,%eax + movdqa %xmm0,%xmm9 + movdqa %xmm10,48(%rsp) + movl %edx,%esi + roll $5,%edx + andl %eax,%edi + xorl %ebx,%eax + pslld $2,%xmm0 + xorl %ebx,%edi + addl %edx,%ecx + psrld $30,%xmm9 + rorl $7,%ebp + addl %edi,%ecx + addl 8(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%edi + roll $5,%ecx + aesenc %xmm15,%xmm11 + movups 48(%r15),%xmm14 + por %xmm9,%xmm0 + andl %ebp,%esi + xorl %eax,%ebp + movdqa %xmm0,%xmm10 + xorl %eax,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + addl 12(%rsp),%eax + xorl %ebp,%edx + movl %ebx,%esi + roll $5,%ebx + andl %edx,%edi + xorl %ebp,%edx + xorl %ebp,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + addl 16(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 64(%r15),%xmm15 + pxor %xmm5,%xmm1 +.byte 102,68,15,58,15,215,8 + xorl %edx,%esi + movl %eax,%edi + roll $5,%eax + pxor %xmm2,%xmm1 + xorl %ecx,%esi + addl %eax,%ebp + movdqa %xmm8,%xmm9 + paddd %xmm0,%xmm8 + rorl $7,%ebx + addl %esi,%ebp + pxor %xmm10,%xmm1 + addl 20(%rsp),%edx + xorl %ecx,%edi + movl %ebp,%esi + roll $5,%ebp + movdqa %xmm1,%xmm10 + movdqa %xmm8,0(%rsp) + xorl %ebx,%edi + addl %ebp,%edx + rorl $7,%eax + addl %edi,%edx + pslld $2,%xmm1 + addl 24(%rsp),%ecx + xorl %ebx,%esi + psrld $30,%xmm10 + movl %edx,%edi + roll $5,%edx + xorl %eax,%esi + aesenc %xmm15,%xmm11 + movups 80(%r15),%xmm14 + addl %edx,%ecx + rorl $7,%ebp + addl %esi,%ecx + por %xmm10,%xmm1 + addl 28(%rsp),%ebx + xorl %eax,%edi + movdqa %xmm1,%xmm8 + movl %ecx,%esi + roll $5,%ecx + xorl %ebp,%edi + addl %ecx,%ebx + rorl $7,%edx + addl %edi,%ebx + addl 32(%rsp),%eax + pxor %xmm6,%xmm2 +.byte 102,68,15,58,15,192,8 + xorl %ebp,%esi + movl %ebx,%edi + roll $5,%ebx + pxor %xmm3,%xmm2 + xorl %edx,%esi + addl %ebx,%eax + movdqa 32(%r11),%xmm10 + paddd %xmm1,%xmm9 + rorl $7,%ecx + addl %esi,%eax + pxor %xmm8,%xmm2 + addl 36(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 96(%r15),%xmm15 + xorl %edx,%edi + movl %eax,%esi + roll $5,%eax + movdqa %xmm2,%xmm8 + movdqa %xmm9,16(%rsp) + xorl %ecx,%edi + addl %eax,%ebp + rorl $7,%ebx + addl %edi,%ebp + pslld $2,%xmm2 + addl 40(%rsp),%edx + xorl %ecx,%esi + psrld $30,%xmm8 + movl %ebp,%edi + roll $5,%ebp + xorl %ebx,%esi + addl %ebp,%edx + rorl $7,%eax + addl %esi,%edx + por %xmm8,%xmm2 + addl 44(%rsp),%ecx + xorl %ebx,%edi + movdqa %xmm2,%xmm9 + movl %edx,%esi + roll $5,%edx + xorl %eax,%edi + aesenc %xmm15,%xmm11 + movups 112(%r15),%xmm14 + addl %edx,%ecx + rorl $7,%ebp + addl %edi,%ecx + addl 48(%rsp),%ebx + pxor %xmm7,%xmm3 +.byte 102,68,15,58,15,201,8 + xorl %eax,%esi + movl %ecx,%edi + roll $5,%ecx + pxor %xmm4,%xmm3 + xorl %ebp,%esi + addl %ecx,%ebx + movdqa %xmm10,%xmm8 + paddd %xmm2,%xmm10 + rorl $7,%edx + addl %esi,%ebx + pxor %xmm9,%xmm3 + addl 52(%rsp),%eax + xorl %ebp,%edi + movl %ebx,%esi + roll $5,%ebx + movdqa %xmm3,%xmm9 + movdqa %xmm10,32(%rsp) + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + pslld $2,%xmm3 + addl 56(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 128(%r15),%xmm15 + xorl %edx,%esi + psrld $30,%xmm9 + movl %eax,%edi + roll $5,%eax + xorl %ecx,%esi + addl %eax,%ebp + rorl $7,%ebx + addl %esi,%ebp + por %xmm9,%xmm3 + addl 60(%rsp),%edx + xorl %ecx,%edi + movdqa %xmm3,%xmm10 + movl %ebp,%esi + roll $5,%ebp + xorl %ebx,%edi + addl %ebp,%edx + rorl $7,%eax + addl %edi,%edx + addl 0(%rsp),%ecx + pxor %xmm0,%xmm4 +.byte 102,68,15,58,15,210,8 + xorl %ebx,%esi + movl %edx,%edi + roll $5,%edx + pxor %xmm5,%xmm4 + xorl %eax,%esi + aesenc %xmm15,%xmm11 + movups 144(%r15),%xmm14 + addl %edx,%ecx + movdqa %xmm8,%xmm9 + paddd %xmm3,%xmm8 + rorl $7,%ebp + addl %esi,%ecx + pxor %xmm10,%xmm4 + addl 4(%rsp),%ebx + xorl %eax,%edi + movl %ecx,%esi + roll $5,%ecx + movdqa %xmm4,%xmm10 + movdqa %xmm8,48(%rsp) + xorl %ebp,%edi + addl %ecx,%ebx + rorl $7,%edx + addl %edi,%ebx + pslld $2,%xmm4 + addl 8(%rsp),%eax + xorl %ebp,%esi + psrld $30,%xmm10 + movl %ebx,%edi + roll $5,%ebx + xorl %edx,%esi + addl %ebx,%eax + rorl $7,%ecx + addl %esi,%eax + por %xmm10,%xmm4 + addl 12(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 160(%r15),%xmm15 + xorl %edx,%edi + movdqa %xmm4,%xmm8 + movl %eax,%esi + roll $5,%eax + xorl %ecx,%edi + addl %eax,%ebp + rorl $7,%ebx + addl %edi,%ebp + addl 16(%rsp),%edx + pxor %xmm1,%xmm5 +.byte 102,68,15,58,15,195,8 + xorl %ecx,%esi + movl %ebp,%edi + roll $5,%ebp + pxor %xmm6,%xmm5 + xorl %ebx,%esi + addl %ebp,%edx + movdqa %xmm9,%xmm10 + paddd %xmm4,%xmm9 + rorl $7,%eax + addl %esi,%edx + pxor %xmm8,%xmm5 + addl 20(%rsp),%ecx + xorl %ebx,%edi + movl %edx,%esi + roll $5,%edx + movdqa %xmm5,%xmm8 + movdqa %xmm9,0(%rsp) + xorl %eax,%edi + cmpl $11,%r8d + jb .Laesenclast2 + movups 176(%r15),%xmm14 + aesenc %xmm15,%xmm11 + movups 192(%r15),%xmm15 + aesenc %xmm14,%xmm11 + je .Laesenclast2 + movups 208(%r15),%xmm14 + aesenc %xmm15,%xmm11 + movups 224(%r15),%xmm15 + aesenc %xmm14,%xmm11 +.Laesenclast2: + aesenclast %xmm15,%xmm11 + movups 16(%r15),%xmm14 + addl %edx,%ecx + rorl $7,%ebp + addl %edi,%ecx + pslld $2,%xmm5 + addl 24(%rsp),%ebx + xorl %eax,%esi + psrld $30,%xmm8 + movl %ecx,%edi + roll $5,%ecx + xorl %ebp,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + por %xmm8,%xmm5 + addl 28(%rsp),%eax + xorl %ebp,%edi + movdqa %xmm5,%xmm9 + movl %ebx,%esi + roll $5,%ebx + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + movl %ecx,%edi + movups 32(%r12),%xmm12 + xorps %xmm13,%xmm12 + movups %xmm11,16(%r13,%r12,1) + xorps %xmm12,%xmm11 + aesenc %xmm14,%xmm11 + movups 32(%r15),%xmm15 + pxor %xmm2,%xmm6 +.byte 102,68,15,58,15,204,8 + xorl %edx,%ecx + addl 32(%rsp),%ebp + andl %edx,%edi + pxor %xmm7,%xmm6 + andl %ecx,%esi + rorl $7,%ebx + movdqa %xmm10,%xmm8 + paddd %xmm5,%xmm10 + addl %edi,%ebp + movl %eax,%edi + pxor %xmm9,%xmm6 + roll $5,%eax + addl %esi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + movdqa %xmm6,%xmm9 + movdqa %xmm10,16(%rsp) + movl %ebx,%esi + xorl %ecx,%ebx + addl 36(%rsp),%edx + andl %ecx,%esi + pslld $2,%xmm6 + andl %ebx,%edi + rorl $7,%eax + psrld $30,%xmm9 + addl %esi,%edx + movl %ebp,%esi + roll $5,%ebp + aesenc %xmm15,%xmm11 + movups 48(%r15),%xmm14 + addl %edi,%edx + xorl %ecx,%ebx + addl %ebp,%edx + por %xmm9,%xmm6 + movl %eax,%edi + xorl %ebx,%eax + movdqa %xmm6,%xmm10 + addl 40(%rsp),%ecx + andl %ebx,%edi + andl %eax,%esi + rorl $7,%ebp + addl %edi,%ecx + movl %edx,%edi + roll $5,%edx + addl %esi,%ecx + xorl %ebx,%eax + addl %edx,%ecx + movl %ebp,%esi + xorl %eax,%ebp + addl 44(%rsp),%ebx + andl %eax,%esi + andl %ebp,%edi + aesenc %xmm14,%xmm11 + movups 64(%r15),%xmm15 + rorl $7,%edx + addl %esi,%ebx + movl %ecx,%esi + roll $5,%ecx + addl %edi,%ebx + xorl %eax,%ebp + addl %ecx,%ebx + movl %edx,%edi + pxor %xmm3,%xmm7 +.byte 102,68,15,58,15,213,8 + xorl %ebp,%edx + addl 48(%rsp),%eax + andl %ebp,%edi + pxor %xmm0,%xmm7 + andl %edx,%esi + rorl $7,%ecx + movdqa 48(%r11),%xmm9 + paddd %xmm6,%xmm8 + addl %edi,%eax + movl %ebx,%edi + pxor %xmm10,%xmm7 + roll $5,%ebx + addl %esi,%eax + xorl %ebp,%edx + addl %ebx,%eax + movdqa %xmm7,%xmm10 + movdqa %xmm8,32(%rsp) + movl %ecx,%esi + aesenc %xmm15,%xmm11 + movups 80(%r15),%xmm14 + xorl %edx,%ecx + addl 52(%rsp),%ebp + andl %edx,%esi + pslld $2,%xmm7 + andl %ecx,%edi + rorl $7,%ebx + psrld $30,%xmm10 + addl %esi,%ebp + movl %eax,%esi + roll $5,%eax + addl %edi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + por %xmm10,%xmm7 + movl %ebx,%edi + xorl %ecx,%ebx + movdqa %xmm7,%xmm8 + addl 56(%rsp),%edx + andl %ecx,%edi + andl %ebx,%esi + rorl $7,%eax + addl %edi,%edx + movl %ebp,%edi + roll $5,%ebp + aesenc %xmm14,%xmm11 + movups 96(%r15),%xmm15 + addl %esi,%edx + xorl %ecx,%ebx + addl %ebp,%edx + movl %eax,%esi + xorl %ebx,%eax + addl 60(%rsp),%ecx + andl %ebx,%esi + andl %eax,%edi + rorl $7,%ebp + addl %esi,%ecx + movl %edx,%esi + roll $5,%edx + addl %edi,%ecx + xorl %ebx,%eax + addl %edx,%ecx + movl %ebp,%edi + pxor %xmm4,%xmm0 +.byte 102,68,15,58,15,198,8 + xorl %eax,%ebp + addl 0(%rsp),%ebx + andl %eax,%edi + pxor %xmm1,%xmm0 + andl %ebp,%esi + aesenc %xmm15,%xmm11 + movups 112(%r15),%xmm14 + rorl $7,%edx + movdqa %xmm9,%xmm10 + paddd %xmm7,%xmm9 + addl %edi,%ebx + movl %ecx,%edi + pxor %xmm8,%xmm0 + roll $5,%ecx + addl %esi,%ebx + xorl %eax,%ebp + addl %ecx,%ebx + movdqa %xmm0,%xmm8 + movdqa %xmm9,48(%rsp) + movl %edx,%esi + xorl %ebp,%edx + addl 4(%rsp),%eax + andl %ebp,%esi + pslld $2,%xmm0 + andl %edx,%edi + rorl $7,%ecx + psrld $30,%xmm8 + addl %esi,%eax + movl %ebx,%esi + roll $5,%ebx + addl %edi,%eax + xorl %ebp,%edx + addl %ebx,%eax + por %xmm8,%xmm0 + movl %ecx,%edi + aesenc %xmm14,%xmm11 + movups 128(%r15),%xmm15 + xorl %edx,%ecx + movdqa %xmm0,%xmm9 + addl 8(%rsp),%ebp + andl %edx,%edi + andl %ecx,%esi + rorl $7,%ebx + addl %edi,%ebp + movl %eax,%edi + roll $5,%eax + addl %esi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + movl %ebx,%esi + xorl %ecx,%ebx + addl 12(%rsp),%edx + andl %ecx,%esi + andl %ebx,%edi + rorl $7,%eax + addl %esi,%edx + movl %ebp,%esi + roll $5,%ebp + aesenc %xmm15,%xmm11 + movups 144(%r15),%xmm14 + addl %edi,%edx + xorl %ecx,%ebx + addl %ebp,%edx + movl %eax,%edi + pxor %xmm5,%xmm1 +.byte 102,68,15,58,15,207,8 + xorl %ebx,%eax + addl 16(%rsp),%ecx + andl %ebx,%edi + pxor %xmm2,%xmm1 + andl %eax,%esi + rorl $7,%ebp + movdqa %xmm10,%xmm8 + paddd %xmm0,%xmm10 + addl %edi,%ecx + movl %edx,%edi + pxor %xmm9,%xmm1 + roll $5,%edx + addl %esi,%ecx + xorl %ebx,%eax + addl %edx,%ecx + movdqa %xmm1,%xmm9 + movdqa %xmm10,0(%rsp) + movl %ebp,%esi + xorl %eax,%ebp + addl 20(%rsp),%ebx + andl %eax,%esi + pslld $2,%xmm1 + andl %ebp,%edi + aesenc %xmm14,%xmm11 + movups 160(%r15),%xmm15 + rorl $7,%edx + psrld $30,%xmm9 + addl %esi,%ebx + movl %ecx,%esi + roll $5,%ecx + addl %edi,%ebx + xorl %eax,%ebp + addl %ecx,%ebx + por %xmm9,%xmm1 + movl %edx,%edi + xorl %ebp,%edx + movdqa %xmm1,%xmm10 + addl 24(%rsp),%eax + andl %ebp,%edi + andl %edx,%esi + rorl $7,%ecx + addl %edi,%eax + movl %ebx,%edi + roll $5,%ebx + addl %esi,%eax + xorl %ebp,%edx + addl %ebx,%eax + movl %ecx,%esi + cmpl $11,%r8d + jb .Laesenclast3 + movups 176(%r15),%xmm14 + aesenc %xmm15,%xmm11 + movups 192(%r15),%xmm15 + aesenc %xmm14,%xmm11 + je .Laesenclast3 + movups 208(%r15),%xmm14 + aesenc %xmm15,%xmm11 + movups 224(%r15),%xmm15 + aesenc %xmm14,%xmm11 +.Laesenclast3: + aesenclast %xmm15,%xmm11 + movups 16(%r15),%xmm14 + xorl %edx,%ecx + addl 28(%rsp),%ebp + andl %edx,%esi + andl %ecx,%edi + rorl $7,%ebx + addl %esi,%ebp + movl %eax,%esi + roll $5,%eax + addl %edi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + movl %ebx,%edi + pxor %xmm6,%xmm2 +.byte 102,68,15,58,15,208,8 + xorl %ecx,%ebx + addl 32(%rsp),%edx + andl %ecx,%edi + pxor %xmm3,%xmm2 + andl %ebx,%esi + rorl $7,%eax + movdqa %xmm8,%xmm9 + paddd %xmm1,%xmm8 + addl %edi,%edx + movl %ebp,%edi + pxor %xmm10,%xmm2 + roll $5,%ebp + movups 48(%r12),%xmm12 + xorps %xmm13,%xmm12 + movups %xmm11,32(%r13,%r12,1) + xorps %xmm12,%xmm11 + aesenc %xmm14,%xmm11 + movups 32(%r15),%xmm15 + addl %esi,%edx + xorl %ecx,%ebx + addl %ebp,%edx + movdqa %xmm2,%xmm10 + movdqa %xmm8,16(%rsp) + movl %eax,%esi + xorl %ebx,%eax + addl 36(%rsp),%ecx + andl %ebx,%esi + pslld $2,%xmm2 + andl %eax,%edi + rorl $7,%ebp + psrld $30,%xmm10 + addl %esi,%ecx + movl %edx,%esi + roll $5,%edx + addl %edi,%ecx + xorl %ebx,%eax + addl %edx,%ecx + por %xmm10,%xmm2 + movl %ebp,%edi + xorl %eax,%ebp + movdqa %xmm2,%xmm8 + addl 40(%rsp),%ebx + andl %eax,%edi + andl %ebp,%esi + aesenc %xmm15,%xmm11 + movups 48(%r15),%xmm14 + rorl $7,%edx + addl %edi,%ebx + movl %ecx,%edi + roll $5,%ecx + addl %esi,%ebx + xorl %eax,%ebp + addl %ecx,%ebx + movl %edx,%esi + xorl %ebp,%edx + addl 44(%rsp),%eax + andl %ebp,%esi + andl %edx,%edi + rorl $7,%ecx + addl %esi,%eax + movl %ebx,%esi + roll $5,%ebx + addl %edi,%eax + xorl %ebp,%edx + addl %ebx,%eax + addl 48(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 64(%r15),%xmm15 + pxor %xmm7,%xmm3 +.byte 102,68,15,58,15,193,8 + xorl %edx,%esi + movl %eax,%edi + roll $5,%eax + pxor %xmm4,%xmm3 + xorl %ecx,%esi + addl %eax,%ebp + movdqa %xmm9,%xmm10 + paddd %xmm2,%xmm9 + rorl $7,%ebx + addl %esi,%ebp + pxor %xmm8,%xmm3 + addl 52(%rsp),%edx + xorl %ecx,%edi + movl %ebp,%esi + roll $5,%ebp + movdqa %xmm3,%xmm8 + movdqa %xmm9,32(%rsp) + xorl %ebx,%edi + addl %ebp,%edx + rorl $7,%eax + addl %edi,%edx + pslld $2,%xmm3 + addl 56(%rsp),%ecx + xorl %ebx,%esi + psrld $30,%xmm8 + movl %edx,%edi + roll $5,%edx + xorl %eax,%esi + aesenc %xmm15,%xmm11 + movups 80(%r15),%xmm14 + addl %edx,%ecx + rorl $7,%ebp + addl %esi,%ecx + por %xmm8,%xmm3 + addl 60(%rsp),%ebx + xorl %eax,%edi + movl %ecx,%esi + roll $5,%ecx + xorl %ebp,%edi + addl %ecx,%ebx + rorl $7,%edx + addl %edi,%ebx + addl 0(%rsp),%eax + paddd %xmm3,%xmm10 + xorl %ebp,%esi + movl %ebx,%edi + roll $5,%ebx + xorl %edx,%esi + movdqa %xmm10,48(%rsp) + addl %ebx,%eax + rorl $7,%ecx + addl %esi,%eax + addl 4(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 96(%r15),%xmm15 + xorl %edx,%edi + movl %eax,%esi + roll $5,%eax + xorl %ecx,%edi + addl %eax,%ebp + rorl $7,%ebx + addl %edi,%ebp + addl 8(%rsp),%edx + xorl %ecx,%esi + movl %ebp,%edi + roll $5,%ebp + xorl %ebx,%esi + addl %ebp,%edx + rorl $7,%eax + addl %esi,%edx + addl 12(%rsp),%ecx + xorl %ebx,%edi + movl %edx,%esi + roll $5,%edx + xorl %eax,%edi + aesenc %xmm15,%xmm11 + movups 112(%r15),%xmm14 + addl %edx,%ecx + rorl $7,%ebp + addl %edi,%ecx + cmpq %r14,%r10 + je .Ldone_ssse3 + movdqa 64(%r11),%xmm6 + movdqa 0(%r11),%xmm9 + movdqu 0(%r10),%xmm0 + movdqu 16(%r10),%xmm1 + movdqu 32(%r10),%xmm2 + movdqu 48(%r10),%xmm3 +.byte 102,15,56,0,198 + addq $64,%r10 + addl 16(%rsp),%ebx + xorl %eax,%esi +.byte 102,15,56,0,206 + movl %ecx,%edi + roll $5,%ecx + paddd %xmm9,%xmm0 + xorl %ebp,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + movdqa %xmm0,0(%rsp) + addl 20(%rsp),%eax + xorl %ebp,%edi + psubd %xmm9,%xmm0 + movl %ebx,%esi + roll $5,%ebx + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + addl 24(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 128(%r15),%xmm15 + xorl %edx,%esi + movl %eax,%edi + roll $5,%eax + xorl %ecx,%esi + addl %eax,%ebp + rorl $7,%ebx + addl %esi,%ebp + addl 28(%rsp),%edx + xorl %ecx,%edi + movl %ebp,%esi + roll $5,%ebp + xorl %ebx,%edi + addl %ebp,%edx + rorl $7,%eax + addl %edi,%edx + addl 32(%rsp),%ecx + xorl %ebx,%esi +.byte 102,15,56,0,214 + movl %edx,%edi + roll $5,%edx + paddd %xmm9,%xmm1 + xorl %eax,%esi + aesenc %xmm15,%xmm11 + movups 144(%r15),%xmm14 + addl %edx,%ecx + rorl $7,%ebp + addl %esi,%ecx + movdqa %xmm1,16(%rsp) + addl 36(%rsp),%ebx + xorl %eax,%edi + psubd %xmm9,%xmm1 + movl %ecx,%esi + roll $5,%ecx + xorl %ebp,%edi + addl %ecx,%ebx + rorl $7,%edx + addl %edi,%ebx + addl 40(%rsp),%eax + xorl %ebp,%esi + movl %ebx,%edi + roll $5,%ebx + xorl %edx,%esi + addl %ebx,%eax + rorl $7,%ecx + addl %esi,%eax + addl 44(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 160(%r15),%xmm15 + xorl %edx,%edi + movl %eax,%esi + roll $5,%eax + xorl %ecx,%edi + addl %eax,%ebp + rorl $7,%ebx + addl %edi,%ebp + addl 48(%rsp),%edx + xorl %ecx,%esi +.byte 102,15,56,0,222 + movl %ebp,%edi + roll $5,%ebp + paddd %xmm9,%xmm2 + xorl %ebx,%esi + addl %ebp,%edx + rorl $7,%eax + addl %esi,%edx + movdqa %xmm2,32(%rsp) + addl 52(%rsp),%ecx + xorl %ebx,%edi + psubd %xmm9,%xmm2 + movl %edx,%esi + roll $5,%edx + xorl %eax,%edi + cmpl $11,%r8d + jb .Laesenclast4 + movups 176(%r15),%xmm14 + aesenc %xmm15,%xmm11 + movups 192(%r15),%xmm15 + aesenc %xmm14,%xmm11 + je .Laesenclast4 + movups 208(%r15),%xmm14 + aesenc %xmm15,%xmm11 + movups 224(%r15),%xmm15 + aesenc %xmm14,%xmm11 +.Laesenclast4: + aesenclast %xmm15,%xmm11 + movups 16(%r15),%xmm14 + addl %edx,%ecx + rorl $7,%ebp + addl %edi,%ecx + addl 56(%rsp),%ebx + xorl %eax,%esi + movl %ecx,%edi + roll $5,%ecx + xorl %ebp,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + addl 60(%rsp),%eax + xorl %ebp,%edi + movl %ebx,%esi + roll $5,%ebx + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + movups %xmm11,48(%r13,%r12,1) + leaq 64(%r12),%r12 + + addl 0(%r9),%eax + addl 4(%r9),%esi + addl 8(%r9),%ecx + addl 12(%r9),%edx + movl %eax,0(%r9) + addl 16(%r9),%ebp + movl %esi,4(%r9) + movl %esi,%ebx + movl %ecx,8(%r9) + movl %edx,12(%r9) + movl %ebp,16(%r9) + jmp .Loop_ssse3 + +.p2align 4 +.Ldone_ssse3: + addl 16(%rsp),%ebx + xorl %eax,%esi + movl %ecx,%edi + roll $5,%ecx + xorl %ebp,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + addl 20(%rsp),%eax + xorl %ebp,%edi + movl %ebx,%esi + roll $5,%ebx + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + addl 24(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 128(%r15),%xmm15 + xorl %edx,%esi + movl %eax,%edi + roll $5,%eax + xorl %ecx,%esi + addl %eax,%ebp + rorl $7,%ebx + addl %esi,%ebp + addl 28(%rsp),%edx + xorl %ecx,%edi + movl %ebp,%esi + roll $5,%ebp + xorl %ebx,%edi + addl %ebp,%edx + rorl $7,%eax + addl %edi,%edx + addl 32(%rsp),%ecx + xorl %ebx,%esi + movl %edx,%edi + roll $5,%edx + xorl %eax,%esi + aesenc %xmm15,%xmm11 + movups 144(%r15),%xmm14 + addl %edx,%ecx + rorl $7,%ebp + addl %esi,%ecx + addl 36(%rsp),%ebx + xorl %eax,%edi + movl %ecx,%esi + roll $5,%ecx + xorl %ebp,%edi + addl %ecx,%ebx + rorl $7,%edx + addl %edi,%ebx + addl 40(%rsp),%eax + xorl %ebp,%esi + movl %ebx,%edi + roll $5,%ebx + xorl %edx,%esi + addl %ebx,%eax + rorl $7,%ecx + addl %esi,%eax + addl 44(%rsp),%ebp + aesenc %xmm14,%xmm11 + movups 160(%r15),%xmm15 + xorl %edx,%edi + movl %eax,%esi + roll $5,%eax + xorl %ecx,%edi + addl %eax,%ebp + rorl $7,%ebx + addl %edi,%ebp + addl 48(%rsp),%edx + xorl %ecx,%esi + movl %ebp,%edi + roll $5,%ebp + xorl %ebx,%esi + addl %ebp,%edx + rorl $7,%eax + addl %esi,%edx + addl 52(%rsp),%ecx + xorl %ebx,%edi + movl %edx,%esi + roll $5,%edx + xorl %eax,%edi + cmpl $11,%r8d + jb .Laesenclast5 + movups 176(%r15),%xmm14 + aesenc %xmm15,%xmm11 + movups 192(%r15),%xmm15 + aesenc %xmm14,%xmm11 + je .Laesenclast5 + movups 208(%r15),%xmm14 + aesenc %xmm15,%xmm11 + movups 224(%r15),%xmm15 + aesenc %xmm14,%xmm11 +.Laesenclast5: + aesenclast %xmm15,%xmm11 + movups 16(%r15),%xmm14 + addl %edx,%ecx + rorl $7,%ebp + addl %edi,%ecx + addl 56(%rsp),%ebx + xorl %eax,%esi + movl %ecx,%edi + roll $5,%ecx + xorl %ebp,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + addl 60(%rsp),%eax + xorl %ebp,%edi + movl %ebx,%esi + roll $5,%ebx + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + movups %xmm11,48(%r13,%r12,1) + movq 88(%rsp),%r8 + + addl 0(%r9),%eax + addl 4(%r9),%esi + addl 8(%r9),%ecx + movl %eax,0(%r9) + addl 12(%r9),%edx + movl %esi,4(%r9) + addl 16(%r9),%ebp + movl %ecx,8(%r9) + movl %edx,12(%r9) + movl %ebp,16(%r9) + movups %xmm11,(%r8) + movaps 96+0(%rsp),%xmm6 + movaps 96+16(%rsp),%xmm7 + movaps 96+32(%rsp),%xmm8 + movaps 96+48(%rsp),%xmm9 + movaps 96+64(%rsp),%xmm10 + movaps 96+80(%rsp),%xmm11 + movaps 96+96(%rsp),%xmm12 + movaps 96+112(%rsp),%xmm13 + movaps 96+128(%rsp),%xmm14 + movaps 96+144(%rsp),%xmm15 + leaq 264(%rsp),%rsi + movq 0(%rsi),%r15 + movq 8(%rsi),%r14 + movq 16(%rsi),%r13 + movq 24(%rsi),%r12 + movq 32(%rsi),%rbp + movq 40(%rsi),%rbx + leaq 48(%rsi),%rsp +.Lepilogue_ssse3: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_aesni_cbc_sha1_enc_ssse3: +.p2align 6 +K_XX_XX: +.long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 +.long 0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1 +.long 0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc +.long 0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6 +.long 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f + +.byte 65,69,83,78,73,45,67,66,67,43,83,72,65,49,32,115,116,105,116,99,104,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 +.p2align 6 + +.def ssse3_handler; .scl 3; .type 32; .endef +.p2align 4 +ssse3_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + movq 8(%r9),%rsi + movq 56(%r9),%r11 + + movl 0(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jb .Lcommon_seh_tail + + movq 152(%r8),%rax + + movl 4(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jae .Lcommon_seh_tail + + leaq 96(%rax),%rsi + leaq 512(%r8),%rdi + movl $20,%ecx +.long 0xa548f3fc + leaq 264(%rax),%rax + + movq 0(%rax),%r15 + movq 8(%rax),%r14 + movq 16(%rax),%r13 + movq 24(%rax),%r12 + movq 32(%rax),%rbp + movq 40(%rax),%rbx + leaq 48(%rax),%rax + movq %rbx,144(%r8) + movq %rbp,160(%r8) + movq %r12,216(%r8) + movq %r13,224(%r8) + movq %r14,232(%r8) + movq %r15,240(%r8) + +.Lcommon_seh_tail: + movq 8(%rax),%rdi + movq 16(%rax),%rsi + movq %rax,152(%r8) + movq %rsi,168(%r8) + movq %rdi,176(%r8) + + movq 40(%r9),%rdi + movq %r8,%rsi + movl $154,%ecx +.long 0xa548f3fc + + movq %r9,%rsi + xorq %rcx,%rcx + movq 8(%rsi),%rdx + movq 0(%rsi),%r8 + movq 16(%rsi),%r9 + movq 40(%rsi),%r10 + leaq 56(%rsi),%r11 + leaq 24(%rsi),%r12 + movq %r10,32(%rsp) + movq %r11,40(%rsp) + movq %r12,48(%rsp) + movq %rcx,56(%rsp) + call *__imp_RtlVirtualUnwind(%rip) + + movl $1,%eax + addq $64,%rsp + popfq + popq %r15 + popq %r14 + popq %r13 + popq %r12 + popq %rbp + popq %rbx + popq %rdi + popq %rsi + retq + + +.section .pdata +.p2align 2 +.rva .LSEH_begin_aesni_cbc_sha1_enc_ssse3 +.rva .LSEH_end_aesni_cbc_sha1_enc_ssse3 +.rva .LSEH_info_aesni_cbc_sha1_enc_ssse3 +.section .xdata +.p2align 3 +.LSEH_info_aesni_cbc_sha1_enc_ssse3: +.byte 9,0,0,0 +.rva ssse3_handler +.rva .Lprologue_ssse3,.Lepilogue_ssse3 diff --git a/crypto/aes/bsaes-elf-x86_64.S b/crypto/aes/bsaes-elf-x86_64.S index 547f3ee4..903e3745 100644 --- a/crypto/aes/bsaes-elf-x86_64.S +++ b/crypto/aes/bsaes-elf-x86_64.S @@ -473,7 +473,7 @@ _bsaes_encrypt8_bitslice: pxor %xmm7,%xmm4 pxor %xmm7,%xmm15 pxor %xmm7,%xmm0 - .byte 0xf3,0xc3 + retq .size _bsaes_encrypt8,.-_bsaes_encrypt8 .type _bsaes_decrypt8,@function @@ -979,7 +979,7 @@ _bsaes_decrypt8: pxor %xmm7,%xmm4 pxor %xmm7,%xmm15 pxor %xmm7,%xmm0 - .byte 0xf3,0xc3 + retq .size _bsaes_decrypt8,.-_bsaes_decrypt8 .type _bsaes_key_convert,@function .align 16 @@ -1061,7 +1061,7 @@ _bsaes_key_convert: movdqa 80(%r11),%xmm7 - .byte 0xf3,0xc3 + retq .size _bsaes_key_convert,.-_bsaes_key_convert .globl bsaes_cbc_encrypt @@ -1311,7 +1311,7 @@ bsaes_cbc_encrypt: leaq 120(%rsp),%rsp movq %rax,%rbp .Lcbc_dec_epilogue: - .byte 0xf3,0xc3 + retq .size bsaes_cbc_encrypt,.-bsaes_cbc_encrypt .globl bsaes_ctr32_encrypt_blocks @@ -1511,7 +1511,7 @@ bsaes_ctr32_encrypt_blocks: leaq 120(%rsp),%rsp movq %rax,%rbp .Lctr_enc_epilogue: - .byte 0xf3,0xc3 + retq .size bsaes_ctr32_encrypt_blocks,.-bsaes_ctr32_encrypt_blocks .globl bsaes_xts_encrypt .type bsaes_xts_encrypt,@function @@ -1962,7 +1962,7 @@ bsaes_xts_encrypt: leaq 120(%rsp),%rsp movq %rax,%rbp .Lxts_enc_epilogue: - .byte 0xf3,0xc3 + retq .size bsaes_xts_encrypt,.-bsaes_xts_encrypt .globl bsaes_xts_decrypt @@ -2440,7 +2440,7 @@ bsaes_xts_decrypt: leaq 120(%rsp),%rsp movq %rax,%rbp .Lxts_dec_epilogue: - .byte 0xf3,0xc3 + retq .size bsaes_xts_decrypt,.-bsaes_xts_decrypt .type _bsaes_const,@object .align 64 diff --git a/crypto/aes/bsaes-macosx-x86_64.S b/crypto/aes/bsaes-macosx-x86_64.S index 0e90b2bb..5f780f0e 100644 --- a/crypto/aes/bsaes-macosx-x86_64.S +++ b/crypto/aes/bsaes-macosx-x86_64.S @@ -473,7 +473,7 @@ L$enc_done: pxor %xmm7,%xmm4 pxor %xmm7,%xmm15 pxor %xmm7,%xmm0 - .byte 0xf3,0xc3 + retq @@ -979,7 +979,7 @@ L$dec_done: pxor %xmm7,%xmm4 pxor %xmm7,%xmm15 pxor %xmm7,%xmm0 - .byte 0xf3,0xc3 + retq .p2align 4 @@ -1061,7 +1061,7 @@ L$key_loop: movdqa 80(%r11),%xmm7 - .byte 0xf3,0xc3 + retq .globl _bsaes_cbc_encrypt @@ -1311,7 +1311,7 @@ L$cbc_dec_bzero: leaq 120(%rsp),%rsp movq %rax,%rbp L$cbc_dec_epilogue: - .byte 0xf3,0xc3 + retq .globl _bsaes_ctr32_encrypt_blocks @@ -1511,7 +1511,7 @@ L$ctr_enc_bzero: leaq 120(%rsp),%rsp movq %rax,%rbp L$ctr_enc_epilogue: - .byte 0xf3,0xc3 + retq .globl _bsaes_xts_encrypt @@ -1962,7 +1962,7 @@ L$xts_enc_bzero: leaq 120(%rsp),%rsp movq %rax,%rbp L$xts_enc_epilogue: - .byte 0xf3,0xc3 + retq .globl _bsaes_xts_decrypt @@ -2440,7 +2440,7 @@ L$xts_dec_bzero: leaq 120(%rsp),%rsp movq %rax,%rbp L$xts_dec_epilogue: - .byte 0xf3,0xc3 + retq .p2align 6 diff --git a/crypto/aes/bsaes-masm-x86_64.S b/crypto/aes/bsaes-masm-x86_64.S new file mode 100644 index 00000000..30384475 --- /dev/null +++ b/crypto/aes/bsaes-masm-x86_64.S @@ -0,0 +1,2735 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + +EXTERN asm_AES_encrypt:NEAR +EXTERN asm_AES_decrypt:NEAR + + +ALIGN 64 +_bsaes_encrypt8 PROC PRIVATE + lea r11,QWORD PTR[$L$BS0] + + movdqa xmm8,XMMWORD PTR[rax] + lea rax,QWORD PTR[16+rax] + movdqa xmm7,XMMWORD PTR[80+r11] + pxor xmm15,xmm8 + pxor xmm0,xmm8 +DB 102,68,15,56,0,255 + pxor xmm1,xmm8 +DB 102,15,56,0,199 + pxor xmm2,xmm8 +DB 102,15,56,0,207 + pxor xmm3,xmm8 +DB 102,15,56,0,215 + pxor xmm4,xmm8 +DB 102,15,56,0,223 + pxor xmm5,xmm8 +DB 102,15,56,0,231 + pxor xmm6,xmm8 +DB 102,15,56,0,239 +DB 102,15,56,0,247 +_bsaes_encrypt8_bitslice:: + movdqa xmm7,XMMWORD PTR[r11] + movdqa xmm8,XMMWORD PTR[16+r11] + movdqa xmm9,xmm5 + psrlq xmm5,1 + movdqa xmm10,xmm3 + psrlq xmm3,1 + pxor xmm5,xmm6 + pxor xmm3,xmm4 + pand xmm5,xmm7 + pand xmm3,xmm7 + pxor xmm6,xmm5 + psllq xmm5,1 + pxor xmm4,xmm3 + psllq xmm3,1 + pxor xmm5,xmm9 + pxor xmm3,xmm10 + movdqa xmm9,xmm1 + psrlq xmm1,1 + movdqa xmm10,xmm15 + psrlq xmm15,1 + pxor xmm1,xmm2 + pxor xmm15,xmm0 + pand xmm1,xmm7 + pand xmm15,xmm7 + pxor xmm2,xmm1 + psllq xmm1,1 + pxor xmm0,xmm15 + psllq xmm15,1 + pxor xmm1,xmm9 + pxor xmm15,xmm10 + movdqa xmm7,XMMWORD PTR[32+r11] + movdqa xmm9,xmm4 + psrlq xmm4,2 + movdqa xmm10,xmm3 + psrlq xmm3,2 + pxor xmm4,xmm6 + pxor xmm3,xmm5 + pand xmm4,xmm8 + pand xmm3,xmm8 + pxor xmm6,xmm4 + psllq xmm4,2 + pxor xmm5,xmm3 + psllq xmm3,2 + pxor xmm4,xmm9 + pxor xmm3,xmm10 + movdqa xmm9,xmm0 + psrlq xmm0,2 + movdqa xmm10,xmm15 + psrlq xmm15,2 + pxor xmm0,xmm2 + pxor xmm15,xmm1 + pand xmm0,xmm8 + pand xmm15,xmm8 + pxor xmm2,xmm0 + psllq xmm0,2 + pxor xmm1,xmm15 + psllq xmm15,2 + pxor xmm0,xmm9 + pxor xmm15,xmm10 + movdqa xmm9,xmm2 + psrlq xmm2,4 + movdqa xmm10,xmm1 + psrlq xmm1,4 + pxor xmm2,xmm6 + pxor xmm1,xmm5 + pand xmm2,xmm7 + pand xmm1,xmm7 + pxor xmm6,xmm2 + psllq xmm2,4 + pxor xmm5,xmm1 + psllq xmm1,4 + pxor xmm2,xmm9 + pxor xmm1,xmm10 + movdqa xmm9,xmm0 + psrlq xmm0,4 + movdqa xmm10,xmm15 + psrlq xmm15,4 + pxor xmm0,xmm4 + pxor xmm15,xmm3 + pand xmm0,xmm7 + pand xmm15,xmm7 + pxor xmm4,xmm0 + psllq xmm0,4 + pxor xmm3,xmm15 + psllq xmm15,4 + pxor xmm0,xmm9 + pxor xmm15,xmm10 + dec r10d + jmp $L$enc_sbox +ALIGN 16 +$L$enc_loop:: + pxor xmm15,XMMWORD PTR[rax] + pxor xmm0,XMMWORD PTR[16+rax] +DB 102,68,15,56,0,255 + pxor xmm1,XMMWORD PTR[32+rax] +DB 102,15,56,0,199 + pxor xmm2,XMMWORD PTR[48+rax] +DB 102,15,56,0,207 + pxor xmm3,XMMWORD PTR[64+rax] +DB 102,15,56,0,215 + pxor xmm4,XMMWORD PTR[80+rax] +DB 102,15,56,0,223 + pxor xmm5,XMMWORD PTR[96+rax] +DB 102,15,56,0,231 + pxor xmm6,XMMWORD PTR[112+rax] +DB 102,15,56,0,239 + lea rax,QWORD PTR[128+rax] +DB 102,15,56,0,247 +$L$enc_sbox:: + pxor xmm4,xmm5 + pxor xmm1,xmm0 + pxor xmm2,xmm15 + pxor xmm5,xmm1 + pxor xmm4,xmm15 + + pxor xmm5,xmm2 + pxor xmm2,xmm6 + pxor xmm6,xmm4 + pxor xmm2,xmm3 + pxor xmm3,xmm4 + pxor xmm2,xmm0 + + pxor xmm1,xmm6 + pxor xmm0,xmm4 + movdqa xmm10,xmm6 + movdqa xmm9,xmm0 + movdqa xmm8,xmm4 + movdqa xmm12,xmm1 + movdqa xmm11,xmm5 + + pxor xmm10,xmm3 + pxor xmm9,xmm1 + pxor xmm8,xmm2 + movdqa xmm13,xmm10 + pxor xmm12,xmm3 + movdqa xmm7,xmm9 + pxor xmm11,xmm15 + movdqa xmm14,xmm10 + + por xmm9,xmm8 + por xmm10,xmm11 + pxor xmm14,xmm7 + pand xmm13,xmm11 + pxor xmm11,xmm8 + pand xmm7,xmm8 + pand xmm14,xmm11 + movdqa xmm11,xmm2 + pxor xmm11,xmm15 + pand xmm12,xmm11 + pxor xmm10,xmm12 + pxor xmm9,xmm12 + movdqa xmm12,xmm6 + movdqa xmm11,xmm4 + pxor xmm12,xmm0 + pxor xmm11,xmm5 + movdqa xmm8,xmm12 + pand xmm12,xmm11 + por xmm8,xmm11 + pxor xmm7,xmm12 + pxor xmm10,xmm14 + pxor xmm9,xmm13 + pxor xmm8,xmm14 + movdqa xmm11,xmm1 + pxor xmm7,xmm13 + movdqa xmm12,xmm3 + pxor xmm8,xmm13 + movdqa xmm13,xmm0 + pand xmm11,xmm2 + movdqa xmm14,xmm6 + pand xmm12,xmm15 + pand xmm13,xmm4 + por xmm14,xmm5 + pxor xmm10,xmm11 + pxor xmm9,xmm12 + pxor xmm8,xmm13 + pxor xmm7,xmm14 + + + + + + movdqa xmm11,xmm10 + pand xmm10,xmm8 + pxor xmm11,xmm9 + + movdqa xmm13,xmm7 + movdqa xmm14,xmm11 + pxor xmm13,xmm10 + pand xmm14,xmm13 + + movdqa xmm12,xmm8 + pxor xmm14,xmm9 + pxor xmm12,xmm7 + + pxor xmm10,xmm9 + + pand xmm12,xmm10 + + movdqa xmm9,xmm13 + pxor xmm12,xmm7 + + pxor xmm9,xmm12 + pxor xmm8,xmm12 + + pand xmm9,xmm7 + + pxor xmm13,xmm9 + pxor xmm8,xmm9 + + pand xmm13,xmm14 + + pxor xmm13,xmm11 + movdqa xmm11,xmm5 + movdqa xmm7,xmm4 + movdqa xmm9,xmm14 + pxor xmm9,xmm13 + pand xmm9,xmm5 + pxor xmm5,xmm4 + pand xmm4,xmm14 + pand xmm5,xmm13 + pxor xmm5,xmm4 + pxor xmm4,xmm9 + pxor xmm11,xmm15 + pxor xmm7,xmm2 + pxor xmm14,xmm12 + pxor xmm13,xmm8 + movdqa xmm10,xmm14 + movdqa xmm9,xmm12 + pxor xmm10,xmm13 + pxor xmm9,xmm8 + pand xmm10,xmm11 + pand xmm9,xmm15 + pxor xmm11,xmm7 + pxor xmm15,xmm2 + pand xmm7,xmm14 + pand xmm2,xmm12 + pand xmm11,xmm13 + pand xmm15,xmm8 + pxor xmm7,xmm11 + pxor xmm15,xmm2 + pxor xmm11,xmm10 + pxor xmm2,xmm9 + pxor xmm5,xmm11 + pxor xmm15,xmm11 + pxor xmm4,xmm7 + pxor xmm2,xmm7 + + movdqa xmm11,xmm6 + movdqa xmm7,xmm0 + pxor xmm11,xmm3 + pxor xmm7,xmm1 + movdqa xmm10,xmm14 + movdqa xmm9,xmm12 + pxor xmm10,xmm13 + pxor xmm9,xmm8 + pand xmm10,xmm11 + pand xmm9,xmm3 + pxor xmm11,xmm7 + pxor xmm3,xmm1 + pand xmm7,xmm14 + pand xmm1,xmm12 + pand xmm11,xmm13 + pand xmm3,xmm8 + pxor xmm7,xmm11 + pxor xmm3,xmm1 + pxor xmm11,xmm10 + pxor xmm1,xmm9 + pxor xmm14,xmm12 + pxor xmm13,xmm8 + movdqa xmm10,xmm14 + pxor xmm10,xmm13 + pand xmm10,xmm6 + pxor xmm6,xmm0 + pand xmm0,xmm14 + pand xmm6,xmm13 + pxor xmm6,xmm0 + pxor xmm0,xmm10 + pxor xmm6,xmm11 + pxor xmm3,xmm11 + pxor xmm0,xmm7 + pxor xmm1,xmm7 + pxor xmm6,xmm15 + pxor xmm0,xmm5 + pxor xmm3,xmm6 + pxor xmm5,xmm15 + pxor xmm15,xmm0 + + pxor xmm0,xmm4 + pxor xmm4,xmm1 + pxor xmm1,xmm2 + pxor xmm2,xmm4 + pxor xmm3,xmm4 + + pxor xmm5,xmm2 + dec r10d + jl $L$enc_done + pshufd xmm7,xmm15,093h + pshufd xmm8,xmm0,093h + pxor xmm15,xmm7 + pshufd xmm9,xmm3,093h + pxor xmm0,xmm8 + pshufd xmm10,xmm5,093h + pxor xmm3,xmm9 + pshufd xmm11,xmm2,093h + pxor xmm5,xmm10 + pshufd xmm12,xmm6,093h + pxor xmm2,xmm11 + pshufd xmm13,xmm1,093h + pxor xmm6,xmm12 + pshufd xmm14,xmm4,093h + pxor xmm1,xmm13 + pxor xmm4,xmm14 + + pxor xmm8,xmm15 + pxor xmm7,xmm4 + pxor xmm8,xmm4 + pshufd xmm15,xmm15,04Eh + pxor xmm9,xmm0 + pshufd xmm0,xmm0,04Eh + pxor xmm12,xmm2 + pxor xmm15,xmm7 + pxor xmm13,xmm6 + pxor xmm0,xmm8 + pxor xmm11,xmm5 + pshufd xmm7,xmm2,04Eh + pxor xmm14,xmm1 + pshufd xmm8,xmm6,04Eh + pxor xmm10,xmm3 + pshufd xmm2,xmm5,04Eh + pxor xmm10,xmm4 + pshufd xmm6,xmm4,04Eh + pxor xmm11,xmm4 + pshufd xmm5,xmm1,04Eh + pxor xmm7,xmm11 + pshufd xmm1,xmm3,04Eh + pxor xmm8,xmm12 + pxor xmm2,xmm10 + pxor xmm6,xmm14 + pxor xmm5,xmm13 + movdqa xmm3,xmm7 + pxor xmm1,xmm9 + movdqa xmm4,xmm8 + movdqa xmm7,XMMWORD PTR[48+r11] + jnz $L$enc_loop + movdqa xmm7,XMMWORD PTR[64+r11] + jmp $L$enc_loop +ALIGN 16 +$L$enc_done:: + movdqa xmm7,XMMWORD PTR[r11] + movdqa xmm8,XMMWORD PTR[16+r11] + movdqa xmm9,xmm1 + psrlq xmm1,1 + movdqa xmm10,xmm2 + psrlq xmm2,1 + pxor xmm1,xmm4 + pxor xmm2,xmm6 + pand xmm1,xmm7 + pand xmm2,xmm7 + pxor xmm4,xmm1 + psllq xmm1,1 + pxor xmm6,xmm2 + psllq xmm2,1 + pxor xmm1,xmm9 + pxor xmm2,xmm10 + movdqa xmm9,xmm3 + psrlq xmm3,1 + movdqa xmm10,xmm15 + psrlq xmm15,1 + pxor xmm3,xmm5 + pxor xmm15,xmm0 + pand xmm3,xmm7 + pand xmm15,xmm7 + pxor xmm5,xmm3 + psllq xmm3,1 + pxor xmm0,xmm15 + psllq xmm15,1 + pxor xmm3,xmm9 + pxor xmm15,xmm10 + movdqa xmm7,XMMWORD PTR[32+r11] + movdqa xmm9,xmm6 + psrlq xmm6,2 + movdqa xmm10,xmm2 + psrlq xmm2,2 + pxor xmm6,xmm4 + pxor xmm2,xmm1 + pand xmm6,xmm8 + pand xmm2,xmm8 + pxor xmm4,xmm6 + psllq xmm6,2 + pxor xmm1,xmm2 + psllq xmm2,2 + pxor xmm6,xmm9 + pxor xmm2,xmm10 + movdqa xmm9,xmm0 + psrlq xmm0,2 + movdqa xmm10,xmm15 + psrlq xmm15,2 + pxor xmm0,xmm5 + pxor xmm15,xmm3 + pand xmm0,xmm8 + pand xmm15,xmm8 + pxor xmm5,xmm0 + psllq xmm0,2 + pxor xmm3,xmm15 + psllq xmm15,2 + pxor xmm0,xmm9 + pxor xmm15,xmm10 + movdqa xmm9,xmm5 + psrlq xmm5,4 + movdqa xmm10,xmm3 + psrlq xmm3,4 + pxor xmm5,xmm4 + pxor xmm3,xmm1 + pand xmm5,xmm7 + pand xmm3,xmm7 + pxor xmm4,xmm5 + psllq xmm5,4 + pxor xmm1,xmm3 + psllq xmm3,4 + pxor xmm5,xmm9 + pxor xmm3,xmm10 + movdqa xmm9,xmm0 + psrlq xmm0,4 + movdqa xmm10,xmm15 + psrlq xmm15,4 + pxor xmm0,xmm6 + pxor xmm15,xmm2 + pand xmm0,xmm7 + pand xmm15,xmm7 + pxor xmm6,xmm0 + psllq xmm0,4 + pxor xmm2,xmm15 + psllq xmm15,4 + pxor xmm0,xmm9 + pxor xmm15,xmm10 + movdqa xmm7,XMMWORD PTR[rax] + pxor xmm3,xmm7 + pxor xmm5,xmm7 + pxor xmm2,xmm7 + pxor xmm6,xmm7 + pxor xmm1,xmm7 + pxor xmm4,xmm7 + pxor xmm15,xmm7 + pxor xmm0,xmm7 + DB 0F3h,0C3h ;repret +_bsaes_encrypt8 ENDP + + +ALIGN 64 +_bsaes_decrypt8 PROC PRIVATE + lea r11,QWORD PTR[$L$BS0] + + movdqa xmm8,XMMWORD PTR[rax] + lea rax,QWORD PTR[16+rax] + movdqa xmm7,XMMWORD PTR[((-48))+r11] + pxor xmm15,xmm8 + pxor xmm0,xmm8 +DB 102,68,15,56,0,255 + pxor xmm1,xmm8 +DB 102,15,56,0,199 + pxor xmm2,xmm8 +DB 102,15,56,0,207 + pxor xmm3,xmm8 +DB 102,15,56,0,215 + pxor xmm4,xmm8 +DB 102,15,56,0,223 + pxor xmm5,xmm8 +DB 102,15,56,0,231 + pxor xmm6,xmm8 +DB 102,15,56,0,239 +DB 102,15,56,0,247 + movdqa xmm7,XMMWORD PTR[r11] + movdqa xmm8,XMMWORD PTR[16+r11] + movdqa xmm9,xmm5 + psrlq xmm5,1 + movdqa xmm10,xmm3 + psrlq xmm3,1 + pxor xmm5,xmm6 + pxor xmm3,xmm4 + pand xmm5,xmm7 + pand xmm3,xmm7 + pxor xmm6,xmm5 + psllq xmm5,1 + pxor xmm4,xmm3 + psllq xmm3,1 + pxor xmm5,xmm9 + pxor xmm3,xmm10 + movdqa xmm9,xmm1 + psrlq xmm1,1 + movdqa xmm10,xmm15 + psrlq xmm15,1 + pxor xmm1,xmm2 + pxor xmm15,xmm0 + pand xmm1,xmm7 + pand xmm15,xmm7 + pxor xmm2,xmm1 + psllq xmm1,1 + pxor xmm0,xmm15 + psllq xmm15,1 + pxor xmm1,xmm9 + pxor xmm15,xmm10 + movdqa xmm7,XMMWORD PTR[32+r11] + movdqa xmm9,xmm4 + psrlq xmm4,2 + movdqa xmm10,xmm3 + psrlq xmm3,2 + pxor xmm4,xmm6 + pxor xmm3,xmm5 + pand xmm4,xmm8 + pand xmm3,xmm8 + pxor xmm6,xmm4 + psllq xmm4,2 + pxor xmm5,xmm3 + psllq xmm3,2 + pxor xmm4,xmm9 + pxor xmm3,xmm10 + movdqa xmm9,xmm0 + psrlq xmm0,2 + movdqa xmm10,xmm15 + psrlq xmm15,2 + pxor xmm0,xmm2 + pxor xmm15,xmm1 + pand xmm0,xmm8 + pand xmm15,xmm8 + pxor xmm2,xmm0 + psllq xmm0,2 + pxor xmm1,xmm15 + psllq xmm15,2 + pxor xmm0,xmm9 + pxor xmm15,xmm10 + movdqa xmm9,xmm2 + psrlq xmm2,4 + movdqa xmm10,xmm1 + psrlq xmm1,4 + pxor xmm2,xmm6 + pxor xmm1,xmm5 + pand xmm2,xmm7 + pand xmm1,xmm7 + pxor xmm6,xmm2 + psllq xmm2,4 + pxor xmm5,xmm1 + psllq xmm1,4 + pxor xmm2,xmm9 + pxor xmm1,xmm10 + movdqa xmm9,xmm0 + psrlq xmm0,4 + movdqa xmm10,xmm15 + psrlq xmm15,4 + pxor xmm0,xmm4 + pxor xmm15,xmm3 + pand xmm0,xmm7 + pand xmm15,xmm7 + pxor xmm4,xmm0 + psllq xmm0,4 + pxor xmm3,xmm15 + psllq xmm15,4 + pxor xmm0,xmm9 + pxor xmm15,xmm10 + dec r10d + jmp $L$dec_sbox +ALIGN 16 +$L$dec_loop:: + pxor xmm15,XMMWORD PTR[rax] + pxor xmm0,XMMWORD PTR[16+rax] +DB 102,68,15,56,0,255 + pxor xmm1,XMMWORD PTR[32+rax] +DB 102,15,56,0,199 + pxor xmm2,XMMWORD PTR[48+rax] +DB 102,15,56,0,207 + pxor xmm3,XMMWORD PTR[64+rax] +DB 102,15,56,0,215 + pxor xmm4,XMMWORD PTR[80+rax] +DB 102,15,56,0,223 + pxor xmm5,XMMWORD PTR[96+rax] +DB 102,15,56,0,231 + pxor xmm6,XMMWORD PTR[112+rax] +DB 102,15,56,0,239 + lea rax,QWORD PTR[128+rax] +DB 102,15,56,0,247 +$L$dec_sbox:: + pxor xmm2,xmm3 + + pxor xmm3,xmm6 + pxor xmm1,xmm6 + pxor xmm5,xmm3 + pxor xmm6,xmm5 + pxor xmm0,xmm6 + + pxor xmm15,xmm0 + pxor xmm1,xmm4 + pxor xmm2,xmm15 + pxor xmm4,xmm15 + pxor xmm0,xmm2 + movdqa xmm10,xmm2 + movdqa xmm9,xmm6 + movdqa xmm8,xmm0 + movdqa xmm12,xmm3 + movdqa xmm11,xmm4 + + pxor xmm10,xmm15 + pxor xmm9,xmm3 + pxor xmm8,xmm5 + movdqa xmm13,xmm10 + pxor xmm12,xmm15 + movdqa xmm7,xmm9 + pxor xmm11,xmm1 + movdqa xmm14,xmm10 + + por xmm9,xmm8 + por xmm10,xmm11 + pxor xmm14,xmm7 + pand xmm13,xmm11 + pxor xmm11,xmm8 + pand xmm7,xmm8 + pand xmm14,xmm11 + movdqa xmm11,xmm5 + pxor xmm11,xmm1 + pand xmm12,xmm11 + pxor xmm10,xmm12 + pxor xmm9,xmm12 + movdqa xmm12,xmm2 + movdqa xmm11,xmm0 + pxor xmm12,xmm6 + pxor xmm11,xmm4 + movdqa xmm8,xmm12 + pand xmm12,xmm11 + por xmm8,xmm11 + pxor xmm7,xmm12 + pxor xmm10,xmm14 + pxor xmm9,xmm13 + pxor xmm8,xmm14 + movdqa xmm11,xmm3 + pxor xmm7,xmm13 + movdqa xmm12,xmm15 + pxor xmm8,xmm13 + movdqa xmm13,xmm6 + pand xmm11,xmm5 + movdqa xmm14,xmm2 + pand xmm12,xmm1 + pand xmm13,xmm0 + por xmm14,xmm4 + pxor xmm10,xmm11 + pxor xmm9,xmm12 + pxor xmm8,xmm13 + pxor xmm7,xmm14 + + + + + + movdqa xmm11,xmm10 + pand xmm10,xmm8 + pxor xmm11,xmm9 + + movdqa xmm13,xmm7 + movdqa xmm14,xmm11 + pxor xmm13,xmm10 + pand xmm14,xmm13 + + movdqa xmm12,xmm8 + pxor xmm14,xmm9 + pxor xmm12,xmm7 + + pxor xmm10,xmm9 + + pand xmm12,xmm10 + + movdqa xmm9,xmm13 + pxor xmm12,xmm7 + + pxor xmm9,xmm12 + pxor xmm8,xmm12 + + pand xmm9,xmm7 + + pxor xmm13,xmm9 + pxor xmm8,xmm9 + + pand xmm13,xmm14 + + pxor xmm13,xmm11 + movdqa xmm11,xmm4 + movdqa xmm7,xmm0 + movdqa xmm9,xmm14 + pxor xmm9,xmm13 + pand xmm9,xmm4 + pxor xmm4,xmm0 + pand xmm0,xmm14 + pand xmm4,xmm13 + pxor xmm4,xmm0 + pxor xmm0,xmm9 + pxor xmm11,xmm1 + pxor xmm7,xmm5 + pxor xmm14,xmm12 + pxor xmm13,xmm8 + movdqa xmm10,xmm14 + movdqa xmm9,xmm12 + pxor xmm10,xmm13 + pxor xmm9,xmm8 + pand xmm10,xmm11 + pand xmm9,xmm1 + pxor xmm11,xmm7 + pxor xmm1,xmm5 + pand xmm7,xmm14 + pand xmm5,xmm12 + pand xmm11,xmm13 + pand xmm1,xmm8 + pxor xmm7,xmm11 + pxor xmm1,xmm5 + pxor xmm11,xmm10 + pxor xmm5,xmm9 + pxor xmm4,xmm11 + pxor xmm1,xmm11 + pxor xmm0,xmm7 + pxor xmm5,xmm7 + + movdqa xmm11,xmm2 + movdqa xmm7,xmm6 + pxor xmm11,xmm15 + pxor xmm7,xmm3 + movdqa xmm10,xmm14 + movdqa xmm9,xmm12 + pxor xmm10,xmm13 + pxor xmm9,xmm8 + pand xmm10,xmm11 + pand xmm9,xmm15 + pxor xmm11,xmm7 + pxor xmm15,xmm3 + pand xmm7,xmm14 + pand xmm3,xmm12 + pand xmm11,xmm13 + pand xmm15,xmm8 + pxor xmm7,xmm11 + pxor xmm15,xmm3 + pxor xmm11,xmm10 + pxor xmm3,xmm9 + pxor xmm14,xmm12 + pxor xmm13,xmm8 + movdqa xmm10,xmm14 + pxor xmm10,xmm13 + pand xmm10,xmm2 + pxor xmm2,xmm6 + pand xmm6,xmm14 + pand xmm2,xmm13 + pxor xmm2,xmm6 + pxor xmm6,xmm10 + pxor xmm2,xmm11 + pxor xmm15,xmm11 + pxor xmm6,xmm7 + pxor xmm3,xmm7 + pxor xmm0,xmm6 + pxor xmm5,xmm4 + + pxor xmm3,xmm0 + pxor xmm1,xmm6 + pxor xmm4,xmm6 + pxor xmm3,xmm1 + pxor xmm6,xmm15 + pxor xmm3,xmm4 + pxor xmm2,xmm5 + pxor xmm5,xmm0 + pxor xmm2,xmm3 + + pxor xmm3,xmm15 + pxor xmm6,xmm2 + dec r10d + jl $L$dec_done + + pshufd xmm7,xmm15,04Eh + pshufd xmm13,xmm2,04Eh + pxor xmm7,xmm15 + pshufd xmm14,xmm4,04Eh + pxor xmm13,xmm2 + pshufd xmm8,xmm0,04Eh + pxor xmm14,xmm4 + pshufd xmm9,xmm5,04Eh + pxor xmm8,xmm0 + pshufd xmm10,xmm3,04Eh + pxor xmm9,xmm5 + pxor xmm15,xmm13 + pxor xmm0,xmm13 + pshufd xmm11,xmm1,04Eh + pxor xmm10,xmm3 + pxor xmm5,xmm7 + pxor xmm3,xmm8 + pshufd xmm12,xmm6,04Eh + pxor xmm11,xmm1 + pxor xmm0,xmm14 + pxor xmm1,xmm9 + pxor xmm12,xmm6 + + pxor xmm5,xmm14 + pxor xmm3,xmm13 + pxor xmm1,xmm13 + pxor xmm6,xmm10 + pxor xmm2,xmm11 + pxor xmm1,xmm14 + pxor xmm6,xmm14 + pxor xmm4,xmm12 + pshufd xmm7,xmm15,093h + pshufd xmm8,xmm0,093h + pxor xmm15,xmm7 + pshufd xmm9,xmm5,093h + pxor xmm0,xmm8 + pshufd xmm10,xmm3,093h + pxor xmm5,xmm9 + pshufd xmm11,xmm1,093h + pxor xmm3,xmm10 + pshufd xmm12,xmm6,093h + pxor xmm1,xmm11 + pshufd xmm13,xmm2,093h + pxor xmm6,xmm12 + pshufd xmm14,xmm4,093h + pxor xmm2,xmm13 + pxor xmm4,xmm14 + + pxor xmm8,xmm15 + pxor xmm7,xmm4 + pxor xmm8,xmm4 + pshufd xmm15,xmm15,04Eh + pxor xmm9,xmm0 + pshufd xmm0,xmm0,04Eh + pxor xmm12,xmm1 + pxor xmm15,xmm7 + pxor xmm13,xmm6 + pxor xmm0,xmm8 + pxor xmm11,xmm3 + pshufd xmm7,xmm1,04Eh + pxor xmm14,xmm2 + pshufd xmm8,xmm6,04Eh + pxor xmm10,xmm5 + pshufd xmm1,xmm3,04Eh + pxor xmm10,xmm4 + pshufd xmm6,xmm4,04Eh + pxor xmm11,xmm4 + pshufd xmm3,xmm2,04Eh + pxor xmm7,xmm11 + pshufd xmm2,xmm5,04Eh + pxor xmm8,xmm12 + pxor xmm10,xmm1 + pxor xmm6,xmm14 + pxor xmm13,xmm3 + movdqa xmm3,xmm7 + pxor xmm2,xmm9 + movdqa xmm5,xmm13 + movdqa xmm4,xmm8 + movdqa xmm1,xmm2 + movdqa xmm2,xmm10 + movdqa xmm7,XMMWORD PTR[((-16))+r11] + jnz $L$dec_loop + movdqa xmm7,XMMWORD PTR[((-32))+r11] + jmp $L$dec_loop +ALIGN 16 +$L$dec_done:: + movdqa xmm7,XMMWORD PTR[r11] + movdqa xmm8,XMMWORD PTR[16+r11] + movdqa xmm9,xmm2 + psrlq xmm2,1 + movdqa xmm10,xmm1 + psrlq xmm1,1 + pxor xmm2,xmm4 + pxor xmm1,xmm6 + pand xmm2,xmm7 + pand xmm1,xmm7 + pxor xmm4,xmm2 + psllq xmm2,1 + pxor xmm6,xmm1 + psllq xmm1,1 + pxor xmm2,xmm9 + pxor xmm1,xmm10 + movdqa xmm9,xmm5 + psrlq xmm5,1 + movdqa xmm10,xmm15 + psrlq xmm15,1 + pxor xmm5,xmm3 + pxor xmm15,xmm0 + pand xmm5,xmm7 + pand xmm15,xmm7 + pxor xmm3,xmm5 + psllq xmm5,1 + pxor xmm0,xmm15 + psllq xmm15,1 + pxor xmm5,xmm9 + pxor xmm15,xmm10 + movdqa xmm7,XMMWORD PTR[32+r11] + movdqa xmm9,xmm6 + psrlq xmm6,2 + movdqa xmm10,xmm1 + psrlq xmm1,2 + pxor xmm6,xmm4 + pxor xmm1,xmm2 + pand xmm6,xmm8 + pand xmm1,xmm8 + pxor xmm4,xmm6 + psllq xmm6,2 + pxor xmm2,xmm1 + psllq xmm1,2 + pxor xmm6,xmm9 + pxor xmm1,xmm10 + movdqa xmm9,xmm0 + psrlq xmm0,2 + movdqa xmm10,xmm15 + psrlq xmm15,2 + pxor xmm0,xmm3 + pxor xmm15,xmm5 + pand xmm0,xmm8 + pand xmm15,xmm8 + pxor xmm3,xmm0 + psllq xmm0,2 + pxor xmm5,xmm15 + psllq xmm15,2 + pxor xmm0,xmm9 + pxor xmm15,xmm10 + movdqa xmm9,xmm3 + psrlq xmm3,4 + movdqa xmm10,xmm5 + psrlq xmm5,4 + pxor xmm3,xmm4 + pxor xmm5,xmm2 + pand xmm3,xmm7 + pand xmm5,xmm7 + pxor xmm4,xmm3 + psllq xmm3,4 + pxor xmm2,xmm5 + psllq xmm5,4 + pxor xmm3,xmm9 + pxor xmm5,xmm10 + movdqa xmm9,xmm0 + psrlq xmm0,4 + movdqa xmm10,xmm15 + psrlq xmm15,4 + pxor xmm0,xmm6 + pxor xmm15,xmm1 + pand xmm0,xmm7 + pand xmm15,xmm7 + pxor xmm6,xmm0 + psllq xmm0,4 + pxor xmm1,xmm15 + psllq xmm15,4 + pxor xmm0,xmm9 + pxor xmm15,xmm10 + movdqa xmm7,XMMWORD PTR[rax] + pxor xmm5,xmm7 + pxor xmm3,xmm7 + pxor xmm1,xmm7 + pxor xmm6,xmm7 + pxor xmm2,xmm7 + pxor xmm4,xmm7 + pxor xmm15,xmm7 + pxor xmm0,xmm7 + DB 0F3h,0C3h ;repret +_bsaes_decrypt8 ENDP + +ALIGN 16 +_bsaes_key_convert PROC PRIVATE + lea r11,QWORD PTR[$L$masks] + movdqu xmm7,XMMWORD PTR[rcx] + lea rcx,QWORD PTR[16+rcx] + movdqa xmm0,XMMWORD PTR[r11] + movdqa xmm1,XMMWORD PTR[16+r11] + movdqa xmm2,XMMWORD PTR[32+r11] + movdqa xmm3,XMMWORD PTR[48+r11] + movdqa xmm4,XMMWORD PTR[64+r11] + pcmpeqd xmm5,xmm5 + + movdqu xmm6,XMMWORD PTR[rcx] + movdqa XMMWORD PTR[rax],xmm7 + lea rax,QWORD PTR[16+rax] + dec r10d + jmp $L$key_loop +ALIGN 16 +$L$key_loop:: +DB 102,15,56,0,244 + + movdqa xmm8,xmm0 + movdqa xmm9,xmm1 + + pand xmm8,xmm6 + pand xmm9,xmm6 + movdqa xmm10,xmm2 + pcmpeqb xmm8,xmm0 + psllq xmm0,4 + movdqa xmm11,xmm3 + pcmpeqb xmm9,xmm1 + psllq xmm1,4 + + pand xmm10,xmm6 + pand xmm11,xmm6 + movdqa xmm12,xmm0 + pcmpeqb xmm10,xmm2 + psllq xmm2,4 + movdqa xmm13,xmm1 + pcmpeqb xmm11,xmm3 + psllq xmm3,4 + + movdqa xmm14,xmm2 + movdqa xmm15,xmm3 + pxor xmm8,xmm5 + pxor xmm9,xmm5 + + pand xmm12,xmm6 + pand xmm13,xmm6 + movdqa XMMWORD PTR[rax],xmm8 + pcmpeqb xmm12,xmm0 + psrlq xmm0,4 + movdqa XMMWORD PTR[16+rax],xmm9 + pcmpeqb xmm13,xmm1 + psrlq xmm1,4 + lea rcx,QWORD PTR[16+rcx] + + pand xmm14,xmm6 + pand xmm15,xmm6 + movdqa XMMWORD PTR[32+rax],xmm10 + pcmpeqb xmm14,xmm2 + psrlq xmm2,4 + movdqa XMMWORD PTR[48+rax],xmm11 + pcmpeqb xmm15,xmm3 + psrlq xmm3,4 + movdqu xmm6,XMMWORD PTR[rcx] + + pxor xmm13,xmm5 + pxor xmm14,xmm5 + movdqa XMMWORD PTR[64+rax],xmm12 + movdqa XMMWORD PTR[80+rax],xmm13 + movdqa XMMWORD PTR[96+rax],xmm14 + movdqa XMMWORD PTR[112+rax],xmm15 + lea rax,QWORD PTR[128+rax] + dec r10d + jnz $L$key_loop + + movdqa xmm7,XMMWORD PTR[80+r11] + + DB 0F3h,0C3h ;repret +_bsaes_key_convert ENDP +EXTERN asm_AES_cbc_encrypt:NEAR +PUBLIC bsaes_cbc_encrypt + +ALIGN 16 +bsaes_cbc_encrypt PROC PUBLIC + mov r11d,DWORD PTR[48+rsp] + cmp r11d,0 + jne asm_AES_cbc_encrypt + cmp r8,128 + jb asm_AES_cbc_encrypt + + mov rax,rsp +$L$cbc_dec_prologue:: + push rbp + push rbx + push r12 + push r13 + push r14 + push r15 + lea rsp,QWORD PTR[((-72))+rsp] + mov r10,QWORD PTR[160+rsp] + lea rsp,QWORD PTR[((-160))+rsp] + movaps XMMWORD PTR[64+rsp],xmm6 + movaps XMMWORD PTR[80+rsp],xmm7 + movaps XMMWORD PTR[96+rsp],xmm8 + movaps XMMWORD PTR[112+rsp],xmm9 + movaps XMMWORD PTR[128+rsp],xmm10 + movaps XMMWORD PTR[144+rsp],xmm11 + movaps XMMWORD PTR[160+rsp],xmm12 + movaps XMMWORD PTR[176+rsp],xmm13 + movaps XMMWORD PTR[192+rsp],xmm14 + movaps XMMWORD PTR[208+rsp],xmm15 +$L$cbc_dec_body:: + mov rbp,rsp + mov eax,DWORD PTR[240+r9] + mov r12,rcx + mov r13,rdx + mov r14,r8 + mov r15,r9 + mov rbx,r10 + shr r14,4 + + mov edx,eax + shl rax,7 + sub rax,96 + sub rsp,rax + + mov rax,rsp + mov rcx,r15 + mov r10d,edx + call _bsaes_key_convert + pxor xmm7,XMMWORD PTR[rsp] + movdqa XMMWORD PTR[rax],xmm6 + movdqa XMMWORD PTR[rsp],xmm7 + + movdqu xmm14,XMMWORD PTR[rbx] + sub r14,8 +$L$cbc_dec_loop:: + movdqu xmm15,XMMWORD PTR[r12] + movdqu xmm0,XMMWORD PTR[16+r12] + movdqu xmm1,XMMWORD PTR[32+r12] + movdqu xmm2,XMMWORD PTR[48+r12] + movdqu xmm3,XMMWORD PTR[64+r12] + movdqu xmm4,XMMWORD PTR[80+r12] + mov rax,rsp + movdqu xmm5,XMMWORD PTR[96+r12] + mov r10d,edx + movdqu xmm6,XMMWORD PTR[112+r12] + movdqa XMMWORD PTR[32+rbp],xmm14 + + call _bsaes_decrypt8 + + pxor xmm15,XMMWORD PTR[32+rbp] + movdqu xmm7,XMMWORD PTR[r12] + movdqu xmm8,XMMWORD PTR[16+r12] + pxor xmm0,xmm7 + movdqu xmm9,XMMWORD PTR[32+r12] + pxor xmm5,xmm8 + movdqu xmm10,XMMWORD PTR[48+r12] + pxor xmm3,xmm9 + movdqu xmm11,XMMWORD PTR[64+r12] + pxor xmm1,xmm10 + movdqu xmm12,XMMWORD PTR[80+r12] + pxor xmm6,xmm11 + movdqu xmm13,XMMWORD PTR[96+r12] + pxor xmm2,xmm12 + movdqu xmm14,XMMWORD PTR[112+r12] + pxor xmm4,xmm13 + movdqu XMMWORD PTR[r13],xmm15 + lea r12,QWORD PTR[128+r12] + movdqu XMMWORD PTR[16+r13],xmm0 + movdqu XMMWORD PTR[32+r13],xmm5 + movdqu XMMWORD PTR[48+r13],xmm3 + movdqu XMMWORD PTR[64+r13],xmm1 + movdqu XMMWORD PTR[80+r13],xmm6 + movdqu XMMWORD PTR[96+r13],xmm2 + movdqu XMMWORD PTR[112+r13],xmm4 + lea r13,QWORD PTR[128+r13] + sub r14,8 + jnc $L$cbc_dec_loop + + add r14,8 + jz $L$cbc_dec_done + + movdqu xmm15,XMMWORD PTR[r12] + mov rax,rsp + mov r10d,edx + cmp r14,2 + jb $L$cbc_dec_one + movdqu xmm0,XMMWORD PTR[16+r12] + je $L$cbc_dec_two + movdqu xmm1,XMMWORD PTR[32+r12] + cmp r14,4 + jb $L$cbc_dec_three + movdqu xmm2,XMMWORD PTR[48+r12] + je $L$cbc_dec_four + movdqu xmm3,XMMWORD PTR[64+r12] + cmp r14,6 + jb $L$cbc_dec_five + movdqu xmm4,XMMWORD PTR[80+r12] + je $L$cbc_dec_six + movdqu xmm5,XMMWORD PTR[96+r12] + movdqa XMMWORD PTR[32+rbp],xmm14 + call _bsaes_decrypt8 + pxor xmm15,XMMWORD PTR[32+rbp] + movdqu xmm7,XMMWORD PTR[r12] + movdqu xmm8,XMMWORD PTR[16+r12] + pxor xmm0,xmm7 + movdqu xmm9,XMMWORD PTR[32+r12] + pxor xmm5,xmm8 + movdqu xmm10,XMMWORD PTR[48+r12] + pxor xmm3,xmm9 + movdqu xmm11,XMMWORD PTR[64+r12] + pxor xmm1,xmm10 + movdqu xmm12,XMMWORD PTR[80+r12] + pxor xmm6,xmm11 + movdqu xmm14,XMMWORD PTR[96+r12] + pxor xmm2,xmm12 + movdqu XMMWORD PTR[r13],xmm15 + movdqu XMMWORD PTR[16+r13],xmm0 + movdqu XMMWORD PTR[32+r13],xmm5 + movdqu XMMWORD PTR[48+r13],xmm3 + movdqu XMMWORD PTR[64+r13],xmm1 + movdqu XMMWORD PTR[80+r13],xmm6 + movdqu XMMWORD PTR[96+r13],xmm2 + jmp $L$cbc_dec_done +ALIGN 16 +$L$cbc_dec_six:: + movdqa XMMWORD PTR[32+rbp],xmm14 + call _bsaes_decrypt8 + pxor xmm15,XMMWORD PTR[32+rbp] + movdqu xmm7,XMMWORD PTR[r12] + movdqu xmm8,XMMWORD PTR[16+r12] + pxor xmm0,xmm7 + movdqu xmm9,XMMWORD PTR[32+r12] + pxor xmm5,xmm8 + movdqu xmm10,XMMWORD PTR[48+r12] + pxor xmm3,xmm9 + movdqu xmm11,XMMWORD PTR[64+r12] + pxor xmm1,xmm10 + movdqu xmm14,XMMWORD PTR[80+r12] + pxor xmm6,xmm11 + movdqu XMMWORD PTR[r13],xmm15 + movdqu XMMWORD PTR[16+r13],xmm0 + movdqu XMMWORD PTR[32+r13],xmm5 + movdqu XMMWORD PTR[48+r13],xmm3 + movdqu XMMWORD PTR[64+r13],xmm1 + movdqu XMMWORD PTR[80+r13],xmm6 + jmp $L$cbc_dec_done +ALIGN 16 +$L$cbc_dec_five:: + movdqa XMMWORD PTR[32+rbp],xmm14 + call _bsaes_decrypt8 + pxor xmm15,XMMWORD PTR[32+rbp] + movdqu xmm7,XMMWORD PTR[r12] + movdqu xmm8,XMMWORD PTR[16+r12] + pxor xmm0,xmm7 + movdqu xmm9,XMMWORD PTR[32+r12] + pxor xmm5,xmm8 + movdqu xmm10,XMMWORD PTR[48+r12] + pxor xmm3,xmm9 + movdqu xmm14,XMMWORD PTR[64+r12] + pxor xmm1,xmm10 + movdqu XMMWORD PTR[r13],xmm15 + movdqu XMMWORD PTR[16+r13],xmm0 + movdqu XMMWORD PTR[32+r13],xmm5 + movdqu XMMWORD PTR[48+r13],xmm3 + movdqu XMMWORD PTR[64+r13],xmm1 + jmp $L$cbc_dec_done +ALIGN 16 +$L$cbc_dec_four:: + movdqa XMMWORD PTR[32+rbp],xmm14 + call _bsaes_decrypt8 + pxor xmm15,XMMWORD PTR[32+rbp] + movdqu xmm7,XMMWORD PTR[r12] + movdqu xmm8,XMMWORD PTR[16+r12] + pxor xmm0,xmm7 + movdqu xmm9,XMMWORD PTR[32+r12] + pxor xmm5,xmm8 + movdqu xmm14,XMMWORD PTR[48+r12] + pxor xmm3,xmm9 + movdqu XMMWORD PTR[r13],xmm15 + movdqu XMMWORD PTR[16+r13],xmm0 + movdqu XMMWORD PTR[32+r13],xmm5 + movdqu XMMWORD PTR[48+r13],xmm3 + jmp $L$cbc_dec_done +ALIGN 16 +$L$cbc_dec_three:: + movdqa XMMWORD PTR[32+rbp],xmm14 + call _bsaes_decrypt8 + pxor xmm15,XMMWORD PTR[32+rbp] + movdqu xmm7,XMMWORD PTR[r12] + movdqu xmm8,XMMWORD PTR[16+r12] + pxor xmm0,xmm7 + movdqu xmm14,XMMWORD PTR[32+r12] + pxor xmm5,xmm8 + movdqu XMMWORD PTR[r13],xmm15 + movdqu XMMWORD PTR[16+r13],xmm0 + movdqu XMMWORD PTR[32+r13],xmm5 + jmp $L$cbc_dec_done +ALIGN 16 +$L$cbc_dec_two:: + movdqa XMMWORD PTR[32+rbp],xmm14 + call _bsaes_decrypt8 + pxor xmm15,XMMWORD PTR[32+rbp] + movdqu xmm7,XMMWORD PTR[r12] + movdqu xmm14,XMMWORD PTR[16+r12] + pxor xmm0,xmm7 + movdqu XMMWORD PTR[r13],xmm15 + movdqu XMMWORD PTR[16+r13],xmm0 + jmp $L$cbc_dec_done +ALIGN 16 +$L$cbc_dec_one:: + lea rcx,QWORD PTR[r12] + lea rdx,QWORD PTR[32+rbp] + lea r8,QWORD PTR[r15] + call asm_AES_decrypt + pxor xmm14,XMMWORD PTR[32+rbp] + movdqu XMMWORD PTR[r13],xmm14 + movdqa xmm14,xmm15 + +$L$cbc_dec_done:: + movdqu XMMWORD PTR[rbx],xmm14 + lea rax,QWORD PTR[rsp] + pxor xmm0,xmm0 +$L$cbc_dec_bzero:: + movdqa XMMWORD PTR[rax],xmm0 + movdqa XMMWORD PTR[16+rax],xmm0 + lea rax,QWORD PTR[32+rax] + cmp rbp,rax + ja $L$cbc_dec_bzero + + lea rsp,QWORD PTR[rbp] + movaps xmm6,XMMWORD PTR[64+rbp] + movaps xmm7,XMMWORD PTR[80+rbp] + movaps xmm8,XMMWORD PTR[96+rbp] + movaps xmm9,XMMWORD PTR[112+rbp] + movaps xmm10,XMMWORD PTR[128+rbp] + movaps xmm11,XMMWORD PTR[144+rbp] + movaps xmm12,XMMWORD PTR[160+rbp] + movaps xmm13,XMMWORD PTR[176+rbp] + movaps xmm14,XMMWORD PTR[192+rbp] + movaps xmm15,XMMWORD PTR[208+rbp] + lea rsp,QWORD PTR[160+rbp] + mov r15,QWORD PTR[72+rsp] + mov r14,QWORD PTR[80+rsp] + mov r13,QWORD PTR[88+rsp] + mov r12,QWORD PTR[96+rsp] + mov rbx,QWORD PTR[104+rsp] + mov rax,QWORD PTR[112+rsp] + lea rsp,QWORD PTR[120+rsp] + mov rbp,rax +$L$cbc_dec_epilogue:: + DB 0F3h,0C3h ;repret +bsaes_cbc_encrypt ENDP + +PUBLIC bsaes_ctr32_encrypt_blocks + +ALIGN 16 +bsaes_ctr32_encrypt_blocks PROC PUBLIC + mov rax,rsp +$L$ctr_enc_prologue:: + push rbp + push rbx + push r12 + push r13 + push r14 + push r15 + lea rsp,QWORD PTR[((-72))+rsp] + mov r10,QWORD PTR[160+rsp] + lea rsp,QWORD PTR[((-160))+rsp] + movaps XMMWORD PTR[64+rsp],xmm6 + movaps XMMWORD PTR[80+rsp],xmm7 + movaps XMMWORD PTR[96+rsp],xmm8 + movaps XMMWORD PTR[112+rsp],xmm9 + movaps XMMWORD PTR[128+rsp],xmm10 + movaps XMMWORD PTR[144+rsp],xmm11 + movaps XMMWORD PTR[160+rsp],xmm12 + movaps XMMWORD PTR[176+rsp],xmm13 + movaps XMMWORD PTR[192+rsp],xmm14 + movaps XMMWORD PTR[208+rsp],xmm15 +$L$ctr_enc_body:: + mov rbp,rsp + movdqu xmm0,XMMWORD PTR[r10] + mov eax,DWORD PTR[240+r9] + mov r12,rcx + mov r13,rdx + mov r14,r8 + mov r15,r9 + movdqa XMMWORD PTR[32+rbp],xmm0 + cmp r8,8 + jb $L$ctr_enc_short + + mov ebx,eax + shl rax,7 + sub rax,96 + sub rsp,rax + + mov rax,rsp + mov rcx,r15 + mov r10d,ebx + call _bsaes_key_convert + pxor xmm7,xmm6 + movdqa XMMWORD PTR[rax],xmm7 + + movdqa xmm8,XMMWORD PTR[rsp] + lea r11,QWORD PTR[$L$ADD1] + movdqa xmm15,XMMWORD PTR[32+rbp] + movdqa xmm7,XMMWORD PTR[((-32))+r11] +DB 102,68,15,56,0,199 +DB 102,68,15,56,0,255 + movdqa XMMWORD PTR[rsp],xmm8 + jmp $L$ctr_enc_loop +ALIGN 16 +$L$ctr_enc_loop:: + movdqa XMMWORD PTR[32+rbp],xmm15 + movdqa xmm0,xmm15 + movdqa xmm1,xmm15 + paddd xmm0,XMMWORD PTR[r11] + movdqa xmm2,xmm15 + paddd xmm1,XMMWORD PTR[16+r11] + movdqa xmm3,xmm15 + paddd xmm2,XMMWORD PTR[32+r11] + movdqa xmm4,xmm15 + paddd xmm3,XMMWORD PTR[48+r11] + movdqa xmm5,xmm15 + paddd xmm4,XMMWORD PTR[64+r11] + movdqa xmm6,xmm15 + paddd xmm5,XMMWORD PTR[80+r11] + paddd xmm6,XMMWORD PTR[96+r11] + + + + movdqa xmm8,XMMWORD PTR[rsp] + lea rax,QWORD PTR[16+rsp] + movdqa xmm7,XMMWORD PTR[((-16))+r11] + pxor xmm15,xmm8 + pxor xmm0,xmm8 +DB 102,68,15,56,0,255 + pxor xmm1,xmm8 +DB 102,15,56,0,199 + pxor xmm2,xmm8 +DB 102,15,56,0,207 + pxor xmm3,xmm8 +DB 102,15,56,0,215 + pxor xmm4,xmm8 +DB 102,15,56,0,223 + pxor xmm5,xmm8 +DB 102,15,56,0,231 + pxor xmm6,xmm8 +DB 102,15,56,0,239 + lea r11,QWORD PTR[$L$BS0] +DB 102,15,56,0,247 + mov r10d,ebx + + call _bsaes_encrypt8_bitslice + + sub r14,8 + jc $L$ctr_enc_loop_done + + movdqu xmm7,XMMWORD PTR[r12] + movdqu xmm8,XMMWORD PTR[16+r12] + movdqu xmm9,XMMWORD PTR[32+r12] + movdqu xmm10,XMMWORD PTR[48+r12] + movdqu xmm11,XMMWORD PTR[64+r12] + movdqu xmm12,XMMWORD PTR[80+r12] + movdqu xmm13,XMMWORD PTR[96+r12] + movdqu xmm14,XMMWORD PTR[112+r12] + lea r12,QWORD PTR[128+r12] + pxor xmm7,xmm15 + movdqa xmm15,XMMWORD PTR[32+rbp] + pxor xmm0,xmm8 + movdqu XMMWORD PTR[r13],xmm7 + pxor xmm3,xmm9 + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm5,xmm10 + movdqu XMMWORD PTR[32+r13],xmm3 + pxor xmm2,xmm11 + movdqu XMMWORD PTR[48+r13],xmm5 + pxor xmm6,xmm12 + movdqu XMMWORD PTR[64+r13],xmm2 + pxor xmm1,xmm13 + movdqu XMMWORD PTR[80+r13],xmm6 + pxor xmm4,xmm14 + movdqu XMMWORD PTR[96+r13],xmm1 + lea r11,QWORD PTR[$L$ADD1] + movdqu XMMWORD PTR[112+r13],xmm4 + lea r13,QWORD PTR[128+r13] + paddd xmm15,XMMWORD PTR[112+r11] + jnz $L$ctr_enc_loop + + jmp $L$ctr_enc_done +ALIGN 16 +$L$ctr_enc_loop_done:: + add r14,8 + movdqu xmm7,XMMWORD PTR[r12] + pxor xmm15,xmm7 + movdqu XMMWORD PTR[r13],xmm15 + cmp r14,2 + jb $L$ctr_enc_done + movdqu xmm8,XMMWORD PTR[16+r12] + pxor xmm0,xmm8 + movdqu XMMWORD PTR[16+r13],xmm0 + je $L$ctr_enc_done + movdqu xmm9,XMMWORD PTR[32+r12] + pxor xmm3,xmm9 + movdqu XMMWORD PTR[32+r13],xmm3 + cmp r14,4 + jb $L$ctr_enc_done + movdqu xmm10,XMMWORD PTR[48+r12] + pxor xmm5,xmm10 + movdqu XMMWORD PTR[48+r13],xmm5 + je $L$ctr_enc_done + movdqu xmm11,XMMWORD PTR[64+r12] + pxor xmm2,xmm11 + movdqu XMMWORD PTR[64+r13],xmm2 + cmp r14,6 + jb $L$ctr_enc_done + movdqu xmm12,XMMWORD PTR[80+r12] + pxor xmm6,xmm12 + movdqu XMMWORD PTR[80+r13],xmm6 + je $L$ctr_enc_done + movdqu xmm13,XMMWORD PTR[96+r12] + pxor xmm1,xmm13 + movdqu XMMWORD PTR[96+r13],xmm1 + jmp $L$ctr_enc_done + +ALIGN 16 +$L$ctr_enc_short:: + lea rcx,QWORD PTR[32+rbp] + lea rdx,QWORD PTR[48+rbp] + lea r8,QWORD PTR[r15] + call asm_AES_encrypt + movdqu xmm0,XMMWORD PTR[r12] + lea r12,QWORD PTR[16+r12] + mov eax,DWORD PTR[44+rbp] + bswap eax + pxor xmm0,XMMWORD PTR[48+rbp] + inc eax + movdqu XMMWORD PTR[r13],xmm0 + bswap eax + lea r13,QWORD PTR[16+r13] + mov DWORD PTR[44+rsp],eax + dec r14 + jnz $L$ctr_enc_short + +$L$ctr_enc_done:: + lea rax,QWORD PTR[rsp] + pxor xmm0,xmm0 +$L$ctr_enc_bzero:: + movdqa XMMWORD PTR[rax],xmm0 + movdqa XMMWORD PTR[16+rax],xmm0 + lea rax,QWORD PTR[32+rax] + cmp rbp,rax + ja $L$ctr_enc_bzero + + lea rsp,QWORD PTR[rbp] + movaps xmm6,XMMWORD PTR[64+rbp] + movaps xmm7,XMMWORD PTR[80+rbp] + movaps xmm8,XMMWORD PTR[96+rbp] + movaps xmm9,XMMWORD PTR[112+rbp] + movaps xmm10,XMMWORD PTR[128+rbp] + movaps xmm11,XMMWORD PTR[144+rbp] + movaps xmm12,XMMWORD PTR[160+rbp] + movaps xmm13,XMMWORD PTR[176+rbp] + movaps xmm14,XMMWORD PTR[192+rbp] + movaps xmm15,XMMWORD PTR[208+rbp] + lea rsp,QWORD PTR[160+rbp] + mov r15,QWORD PTR[72+rsp] + mov r14,QWORD PTR[80+rsp] + mov r13,QWORD PTR[88+rsp] + mov r12,QWORD PTR[96+rsp] + mov rbx,QWORD PTR[104+rsp] + mov rax,QWORD PTR[112+rsp] + lea rsp,QWORD PTR[120+rsp] + mov rbp,rax +$L$ctr_enc_epilogue:: + DB 0F3h,0C3h ;repret +bsaes_ctr32_encrypt_blocks ENDP +PUBLIC bsaes_xts_encrypt + +ALIGN 16 +bsaes_xts_encrypt PROC PUBLIC + mov rax,rsp +$L$xts_enc_prologue:: + push rbp + push rbx + push r12 + push r13 + push r14 + push r15 + lea rsp,QWORD PTR[((-72))+rsp] + mov r10,QWORD PTR[160+rsp] + mov r11,QWORD PTR[168+rsp] + lea rsp,QWORD PTR[((-160))+rsp] + movaps XMMWORD PTR[64+rsp],xmm6 + movaps XMMWORD PTR[80+rsp],xmm7 + movaps XMMWORD PTR[96+rsp],xmm8 + movaps XMMWORD PTR[112+rsp],xmm9 + movaps XMMWORD PTR[128+rsp],xmm10 + movaps XMMWORD PTR[144+rsp],xmm11 + movaps XMMWORD PTR[160+rsp],xmm12 + movaps XMMWORD PTR[176+rsp],xmm13 + movaps XMMWORD PTR[192+rsp],xmm14 + movaps XMMWORD PTR[208+rsp],xmm15 +$L$xts_enc_body:: + mov rbp,rsp + mov r12,rcx + mov r13,rdx + mov r14,r8 + mov r15,r9 + + lea rcx,QWORD PTR[r11] + lea rdx,QWORD PTR[32+rbp] + lea r8,QWORD PTR[r10] + call asm_AES_encrypt + + mov eax,DWORD PTR[240+r15] + mov rbx,r14 + + mov edx,eax + shl rax,7 + sub rax,96 + sub rsp,rax + + mov rax,rsp + mov rcx,r15 + mov r10d,edx + call _bsaes_key_convert + pxor xmm7,xmm6 + movdqa XMMWORD PTR[rax],xmm7 + + and r14,-16 + sub rsp,080h + movdqa xmm6,XMMWORD PTR[32+rbp] + + pxor xmm14,xmm14 + movdqa xmm12,XMMWORD PTR[$L$xts_magic] + pcmpgtd xmm14,xmm6 + + sub r14,080h + jc $L$xts_enc_short + jmp $L$xts_enc_loop + +ALIGN 16 +$L$xts_enc_loop:: + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm15,xmm6 + movdqa XMMWORD PTR[rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm0,xmm6 + movdqa XMMWORD PTR[16+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm7,XMMWORD PTR[r12] + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm1,xmm6 + movdqa XMMWORD PTR[32+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm8,XMMWORD PTR[16+r12] + pxor xmm15,xmm7 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm2,xmm6 + movdqa XMMWORD PTR[48+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm9,XMMWORD PTR[32+r12] + pxor xmm0,xmm8 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm3,xmm6 + movdqa XMMWORD PTR[64+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm10,XMMWORD PTR[48+r12] + pxor xmm1,xmm9 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm4,xmm6 + movdqa XMMWORD PTR[80+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm11,XMMWORD PTR[64+r12] + pxor xmm2,xmm10 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm5,xmm6 + movdqa XMMWORD PTR[96+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm12,XMMWORD PTR[80+r12] + pxor xmm3,xmm11 + movdqu xmm13,XMMWORD PTR[96+r12] + pxor xmm4,xmm12 + movdqu xmm14,XMMWORD PTR[112+r12] + lea r12,QWORD PTR[128+r12] + movdqa XMMWORD PTR[112+rsp],xmm6 + pxor xmm5,xmm13 + lea rax,QWORD PTR[128+rsp] + pxor xmm6,xmm14 + mov r10d,edx + + call _bsaes_encrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm3,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm5,XMMWORD PTR[48+rsp] + movdqu XMMWORD PTR[32+r13],xmm3 + pxor xmm2,XMMWORD PTR[64+rsp] + movdqu XMMWORD PTR[48+r13],xmm5 + pxor xmm6,XMMWORD PTR[80+rsp] + movdqu XMMWORD PTR[64+r13],xmm2 + pxor xmm1,XMMWORD PTR[96+rsp] + movdqu XMMWORD PTR[80+r13],xmm6 + pxor xmm4,XMMWORD PTR[112+rsp] + movdqu XMMWORD PTR[96+r13],xmm1 + movdqu XMMWORD PTR[112+r13],xmm4 + lea r13,QWORD PTR[128+r13] + + movdqa xmm6,XMMWORD PTR[112+rsp] + pxor xmm14,xmm14 + movdqa xmm12,XMMWORD PTR[$L$xts_magic] + pcmpgtd xmm14,xmm6 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + + sub r14,080h + jnc $L$xts_enc_loop + +$L$xts_enc_short:: + add r14,080h + jz $L$xts_enc_done + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm15,xmm6 + movdqa XMMWORD PTR[rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm0,xmm6 + movdqa XMMWORD PTR[16+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm7,XMMWORD PTR[r12] + cmp r14,16 + je $L$xts_enc_1 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm1,xmm6 + movdqa XMMWORD PTR[32+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm8,XMMWORD PTR[16+r12] + cmp r14,32 + je $L$xts_enc_2 + pxor xmm15,xmm7 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm2,xmm6 + movdqa XMMWORD PTR[48+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm9,XMMWORD PTR[32+r12] + cmp r14,48 + je $L$xts_enc_3 + pxor xmm0,xmm8 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm3,xmm6 + movdqa XMMWORD PTR[64+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm10,XMMWORD PTR[48+r12] + cmp r14,64 + je $L$xts_enc_4 + pxor xmm1,xmm9 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm4,xmm6 + movdqa XMMWORD PTR[80+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm11,XMMWORD PTR[64+r12] + cmp r14,80 + je $L$xts_enc_5 + pxor xmm2,xmm10 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm5,xmm6 + movdqa XMMWORD PTR[96+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm12,XMMWORD PTR[80+r12] + cmp r14,96 + je $L$xts_enc_6 + pxor xmm3,xmm11 + movdqu xmm13,XMMWORD PTR[96+r12] + pxor xmm4,xmm12 + movdqa XMMWORD PTR[112+rsp],xmm6 + lea r12,QWORD PTR[112+r12] + pxor xmm5,xmm13 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_encrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm3,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm5,XMMWORD PTR[48+rsp] + movdqu XMMWORD PTR[32+r13],xmm3 + pxor xmm2,XMMWORD PTR[64+rsp] + movdqu XMMWORD PTR[48+r13],xmm5 + pxor xmm6,XMMWORD PTR[80+rsp] + movdqu XMMWORD PTR[64+r13],xmm2 + pxor xmm1,XMMWORD PTR[96+rsp] + movdqu XMMWORD PTR[80+r13],xmm6 + movdqu XMMWORD PTR[96+r13],xmm1 + lea r13,QWORD PTR[112+r13] + + movdqa xmm6,XMMWORD PTR[112+rsp] + jmp $L$xts_enc_done +ALIGN 16 +$L$xts_enc_6:: + pxor xmm3,xmm11 + lea r12,QWORD PTR[96+r12] + pxor xmm4,xmm12 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_encrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm3,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm5,XMMWORD PTR[48+rsp] + movdqu XMMWORD PTR[32+r13],xmm3 + pxor xmm2,XMMWORD PTR[64+rsp] + movdqu XMMWORD PTR[48+r13],xmm5 + pxor xmm6,XMMWORD PTR[80+rsp] + movdqu XMMWORD PTR[64+r13],xmm2 + movdqu XMMWORD PTR[80+r13],xmm6 + lea r13,QWORD PTR[96+r13] + + movdqa xmm6,XMMWORD PTR[96+rsp] + jmp $L$xts_enc_done +ALIGN 16 +$L$xts_enc_5:: + pxor xmm2,xmm10 + lea r12,QWORD PTR[80+r12] + pxor xmm3,xmm11 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_encrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm3,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm5,XMMWORD PTR[48+rsp] + movdqu XMMWORD PTR[32+r13],xmm3 + pxor xmm2,XMMWORD PTR[64+rsp] + movdqu XMMWORD PTR[48+r13],xmm5 + movdqu XMMWORD PTR[64+r13],xmm2 + lea r13,QWORD PTR[80+r13] + + movdqa xmm6,XMMWORD PTR[80+rsp] + jmp $L$xts_enc_done +ALIGN 16 +$L$xts_enc_4:: + pxor xmm1,xmm9 + lea r12,QWORD PTR[64+r12] + pxor xmm2,xmm10 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_encrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm3,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm5,XMMWORD PTR[48+rsp] + movdqu XMMWORD PTR[32+r13],xmm3 + movdqu XMMWORD PTR[48+r13],xmm5 + lea r13,QWORD PTR[64+r13] + + movdqa xmm6,XMMWORD PTR[64+rsp] + jmp $L$xts_enc_done +ALIGN 16 +$L$xts_enc_3:: + pxor xmm0,xmm8 + lea r12,QWORD PTR[48+r12] + pxor xmm1,xmm9 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_encrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm3,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + movdqu XMMWORD PTR[32+r13],xmm3 + lea r13,QWORD PTR[48+r13] + + movdqa xmm6,XMMWORD PTR[48+rsp] + jmp $L$xts_enc_done +ALIGN 16 +$L$xts_enc_2:: + pxor xmm15,xmm7 + lea r12,QWORD PTR[32+r12] + pxor xmm0,xmm8 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_encrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + movdqu XMMWORD PTR[16+r13],xmm0 + lea r13,QWORD PTR[32+r13] + + movdqa xmm6,XMMWORD PTR[32+rsp] + jmp $L$xts_enc_done +ALIGN 16 +$L$xts_enc_1:: + pxor xmm7,xmm15 + lea r12,QWORD PTR[16+r12] + movdqa XMMWORD PTR[32+rbp],xmm7 + lea rcx,QWORD PTR[32+rbp] + lea rdx,QWORD PTR[32+rbp] + lea r8,QWORD PTR[r15] + call asm_AES_encrypt + pxor xmm15,XMMWORD PTR[32+rbp] + + + + + + movdqu XMMWORD PTR[r13],xmm15 + lea r13,QWORD PTR[16+r13] + + movdqa xmm6,XMMWORD PTR[16+rsp] + +$L$xts_enc_done:: + and ebx,15 + jz $L$xts_enc_ret + mov rdx,r13 + +$L$xts_enc_steal:: + movzx eax,BYTE PTR[r12] + movzx ecx,BYTE PTR[((-16))+rdx] + lea r12,QWORD PTR[1+r12] + mov BYTE PTR[((-16))+rdx],al + mov BYTE PTR[rdx],cl + lea rdx,QWORD PTR[1+rdx] + sub ebx,1 + jnz $L$xts_enc_steal + + movdqu xmm15,XMMWORD PTR[((-16))+r13] + lea rcx,QWORD PTR[32+rbp] + pxor xmm15,xmm6 + lea rdx,QWORD PTR[32+rbp] + movdqa XMMWORD PTR[32+rbp],xmm15 + lea r8,QWORD PTR[r15] + call asm_AES_encrypt + pxor xmm6,XMMWORD PTR[32+rbp] + movdqu XMMWORD PTR[(-16)+r13],xmm6 + +$L$xts_enc_ret:: + lea rax,QWORD PTR[rsp] + pxor xmm0,xmm0 +$L$xts_enc_bzero:: + movdqa XMMWORD PTR[rax],xmm0 + movdqa XMMWORD PTR[16+rax],xmm0 + lea rax,QWORD PTR[32+rax] + cmp rbp,rax + ja $L$xts_enc_bzero + + lea rsp,QWORD PTR[rbp] + movaps xmm6,XMMWORD PTR[64+rbp] + movaps xmm7,XMMWORD PTR[80+rbp] + movaps xmm8,XMMWORD PTR[96+rbp] + movaps xmm9,XMMWORD PTR[112+rbp] + movaps xmm10,XMMWORD PTR[128+rbp] + movaps xmm11,XMMWORD PTR[144+rbp] + movaps xmm12,XMMWORD PTR[160+rbp] + movaps xmm13,XMMWORD PTR[176+rbp] + movaps xmm14,XMMWORD PTR[192+rbp] + movaps xmm15,XMMWORD PTR[208+rbp] + lea rsp,QWORD PTR[160+rbp] + mov r15,QWORD PTR[72+rsp] + mov r14,QWORD PTR[80+rsp] + mov r13,QWORD PTR[88+rsp] + mov r12,QWORD PTR[96+rsp] + mov rbx,QWORD PTR[104+rsp] + mov rax,QWORD PTR[112+rsp] + lea rsp,QWORD PTR[120+rsp] + mov rbp,rax +$L$xts_enc_epilogue:: + DB 0F3h,0C3h ;repret +bsaes_xts_encrypt ENDP + +PUBLIC bsaes_xts_decrypt + +ALIGN 16 +bsaes_xts_decrypt PROC PUBLIC + mov rax,rsp +$L$xts_dec_prologue:: + push rbp + push rbx + push r12 + push r13 + push r14 + push r15 + lea rsp,QWORD PTR[((-72))+rsp] + mov r10,QWORD PTR[160+rsp] + mov r11,QWORD PTR[168+rsp] + lea rsp,QWORD PTR[((-160))+rsp] + movaps XMMWORD PTR[64+rsp],xmm6 + movaps XMMWORD PTR[80+rsp],xmm7 + movaps XMMWORD PTR[96+rsp],xmm8 + movaps XMMWORD PTR[112+rsp],xmm9 + movaps XMMWORD PTR[128+rsp],xmm10 + movaps XMMWORD PTR[144+rsp],xmm11 + movaps XMMWORD PTR[160+rsp],xmm12 + movaps XMMWORD PTR[176+rsp],xmm13 + movaps XMMWORD PTR[192+rsp],xmm14 + movaps XMMWORD PTR[208+rsp],xmm15 +$L$xts_dec_body:: + mov rbp,rsp + mov r12,rcx + mov r13,rdx + mov r14,r8 + mov r15,r9 + + lea rcx,QWORD PTR[r11] + lea rdx,QWORD PTR[32+rbp] + lea r8,QWORD PTR[r10] + call asm_AES_encrypt + + mov eax,DWORD PTR[240+r15] + mov rbx,r14 + + mov edx,eax + shl rax,7 + sub rax,96 + sub rsp,rax + + mov rax,rsp + mov rcx,r15 + mov r10d,edx + call _bsaes_key_convert + pxor xmm7,XMMWORD PTR[rsp] + movdqa XMMWORD PTR[rax],xmm6 + movdqa XMMWORD PTR[rsp],xmm7 + + xor eax,eax + and r14,-16 + test ebx,15 + setnz al + shl rax,4 + sub r14,rax + + sub rsp,080h + movdqa xmm6,XMMWORD PTR[32+rbp] + + pxor xmm14,xmm14 + movdqa xmm12,XMMWORD PTR[$L$xts_magic] + pcmpgtd xmm14,xmm6 + + sub r14,080h + jc $L$xts_dec_short + jmp $L$xts_dec_loop + +ALIGN 16 +$L$xts_dec_loop:: + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm15,xmm6 + movdqa XMMWORD PTR[rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm0,xmm6 + movdqa XMMWORD PTR[16+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm7,XMMWORD PTR[r12] + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm1,xmm6 + movdqa XMMWORD PTR[32+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm8,XMMWORD PTR[16+r12] + pxor xmm15,xmm7 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm2,xmm6 + movdqa XMMWORD PTR[48+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm9,XMMWORD PTR[32+r12] + pxor xmm0,xmm8 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm3,xmm6 + movdqa XMMWORD PTR[64+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm10,XMMWORD PTR[48+r12] + pxor xmm1,xmm9 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm4,xmm6 + movdqa XMMWORD PTR[80+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm11,XMMWORD PTR[64+r12] + pxor xmm2,xmm10 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm5,xmm6 + movdqa XMMWORD PTR[96+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm12,XMMWORD PTR[80+r12] + pxor xmm3,xmm11 + movdqu xmm13,XMMWORD PTR[96+r12] + pxor xmm4,xmm12 + movdqu xmm14,XMMWORD PTR[112+r12] + lea r12,QWORD PTR[128+r12] + movdqa XMMWORD PTR[112+rsp],xmm6 + pxor xmm5,xmm13 + lea rax,QWORD PTR[128+rsp] + pxor xmm6,xmm14 + mov r10d,edx + + call _bsaes_decrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm5,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm3,XMMWORD PTR[48+rsp] + movdqu XMMWORD PTR[32+r13],xmm5 + pxor xmm1,XMMWORD PTR[64+rsp] + movdqu XMMWORD PTR[48+r13],xmm3 + pxor xmm6,XMMWORD PTR[80+rsp] + movdqu XMMWORD PTR[64+r13],xmm1 + pxor xmm2,XMMWORD PTR[96+rsp] + movdqu XMMWORD PTR[80+r13],xmm6 + pxor xmm4,XMMWORD PTR[112+rsp] + movdqu XMMWORD PTR[96+r13],xmm2 + movdqu XMMWORD PTR[112+r13],xmm4 + lea r13,QWORD PTR[128+r13] + + movdqa xmm6,XMMWORD PTR[112+rsp] + pxor xmm14,xmm14 + movdqa xmm12,XMMWORD PTR[$L$xts_magic] + pcmpgtd xmm14,xmm6 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + + sub r14,080h + jnc $L$xts_dec_loop + +$L$xts_dec_short:: + add r14,080h + jz $L$xts_dec_done + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm15,xmm6 + movdqa XMMWORD PTR[rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm0,xmm6 + movdqa XMMWORD PTR[16+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm7,XMMWORD PTR[r12] + cmp r14,16 + je $L$xts_dec_1 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm1,xmm6 + movdqa XMMWORD PTR[32+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm8,XMMWORD PTR[16+r12] + cmp r14,32 + je $L$xts_dec_2 + pxor xmm15,xmm7 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm2,xmm6 + movdqa XMMWORD PTR[48+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm9,XMMWORD PTR[32+r12] + cmp r14,48 + je $L$xts_dec_3 + pxor xmm0,xmm8 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm3,xmm6 + movdqa XMMWORD PTR[64+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm10,XMMWORD PTR[48+r12] + cmp r14,64 + je $L$xts_dec_4 + pxor xmm1,xmm9 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm4,xmm6 + movdqa XMMWORD PTR[80+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm11,XMMWORD PTR[64+r12] + cmp r14,80 + je $L$xts_dec_5 + pxor xmm2,xmm10 + pshufd xmm13,xmm14,013h + pxor xmm14,xmm14 + movdqa xmm5,xmm6 + movdqa XMMWORD PTR[96+rsp],xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + pcmpgtd xmm14,xmm6 + pxor xmm6,xmm13 + movdqu xmm12,XMMWORD PTR[80+r12] + cmp r14,96 + je $L$xts_dec_6 + pxor xmm3,xmm11 + movdqu xmm13,XMMWORD PTR[96+r12] + pxor xmm4,xmm12 + movdqa XMMWORD PTR[112+rsp],xmm6 + lea r12,QWORD PTR[112+r12] + pxor xmm5,xmm13 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_decrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm5,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm3,XMMWORD PTR[48+rsp] + movdqu XMMWORD PTR[32+r13],xmm5 + pxor xmm1,XMMWORD PTR[64+rsp] + movdqu XMMWORD PTR[48+r13],xmm3 + pxor xmm6,XMMWORD PTR[80+rsp] + movdqu XMMWORD PTR[64+r13],xmm1 + pxor xmm2,XMMWORD PTR[96+rsp] + movdqu XMMWORD PTR[80+r13],xmm6 + movdqu XMMWORD PTR[96+r13],xmm2 + lea r13,QWORD PTR[112+r13] + + movdqa xmm6,XMMWORD PTR[112+rsp] + jmp $L$xts_dec_done +ALIGN 16 +$L$xts_dec_6:: + pxor xmm3,xmm11 + lea r12,QWORD PTR[96+r12] + pxor xmm4,xmm12 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_decrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm5,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm3,XMMWORD PTR[48+rsp] + movdqu XMMWORD PTR[32+r13],xmm5 + pxor xmm1,XMMWORD PTR[64+rsp] + movdqu XMMWORD PTR[48+r13],xmm3 + pxor xmm6,XMMWORD PTR[80+rsp] + movdqu XMMWORD PTR[64+r13],xmm1 + movdqu XMMWORD PTR[80+r13],xmm6 + lea r13,QWORD PTR[96+r13] + + movdqa xmm6,XMMWORD PTR[96+rsp] + jmp $L$xts_dec_done +ALIGN 16 +$L$xts_dec_5:: + pxor xmm2,xmm10 + lea r12,QWORD PTR[80+r12] + pxor xmm3,xmm11 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_decrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm5,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm3,XMMWORD PTR[48+rsp] + movdqu XMMWORD PTR[32+r13],xmm5 + pxor xmm1,XMMWORD PTR[64+rsp] + movdqu XMMWORD PTR[48+r13],xmm3 + movdqu XMMWORD PTR[64+r13],xmm1 + lea r13,QWORD PTR[80+r13] + + movdqa xmm6,XMMWORD PTR[80+rsp] + jmp $L$xts_dec_done +ALIGN 16 +$L$xts_dec_4:: + pxor xmm1,xmm9 + lea r12,QWORD PTR[64+r12] + pxor xmm2,xmm10 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_decrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm5,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + pxor xmm3,XMMWORD PTR[48+rsp] + movdqu XMMWORD PTR[32+r13],xmm5 + movdqu XMMWORD PTR[48+r13],xmm3 + lea r13,QWORD PTR[64+r13] + + movdqa xmm6,XMMWORD PTR[64+rsp] + jmp $L$xts_dec_done +ALIGN 16 +$L$xts_dec_3:: + pxor xmm0,xmm8 + lea r12,QWORD PTR[48+r12] + pxor xmm1,xmm9 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_decrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + pxor xmm5,XMMWORD PTR[32+rsp] + movdqu XMMWORD PTR[16+r13],xmm0 + movdqu XMMWORD PTR[32+r13],xmm5 + lea r13,QWORD PTR[48+r13] + + movdqa xmm6,XMMWORD PTR[48+rsp] + jmp $L$xts_dec_done +ALIGN 16 +$L$xts_dec_2:: + pxor xmm15,xmm7 + lea r12,QWORD PTR[32+r12] + pxor xmm0,xmm8 + lea rax,QWORD PTR[128+rsp] + mov r10d,edx + + call _bsaes_decrypt8 + + pxor xmm15,XMMWORD PTR[rsp] + pxor xmm0,XMMWORD PTR[16+rsp] + movdqu XMMWORD PTR[r13],xmm15 + movdqu XMMWORD PTR[16+r13],xmm0 + lea r13,QWORD PTR[32+r13] + + movdqa xmm6,XMMWORD PTR[32+rsp] + jmp $L$xts_dec_done +ALIGN 16 +$L$xts_dec_1:: + pxor xmm7,xmm15 + lea r12,QWORD PTR[16+r12] + movdqa XMMWORD PTR[32+rbp],xmm7 + lea rcx,QWORD PTR[32+rbp] + lea rdx,QWORD PTR[32+rbp] + lea r8,QWORD PTR[r15] + call asm_AES_decrypt + pxor xmm15,XMMWORD PTR[32+rbp] + + + + + + movdqu XMMWORD PTR[r13],xmm15 + lea r13,QWORD PTR[16+r13] + + movdqa xmm6,XMMWORD PTR[16+rsp] + +$L$xts_dec_done:: + and ebx,15 + jz $L$xts_dec_ret + + pxor xmm14,xmm14 + movdqa xmm12,XMMWORD PTR[$L$xts_magic] + pcmpgtd xmm14,xmm6 + pshufd xmm13,xmm14,013h + movdqa xmm5,xmm6 + paddq xmm6,xmm6 + pand xmm13,xmm12 + movdqu xmm15,XMMWORD PTR[r12] + pxor xmm6,xmm13 + + lea rcx,QWORD PTR[32+rbp] + pxor xmm15,xmm6 + lea rdx,QWORD PTR[32+rbp] + movdqa XMMWORD PTR[32+rbp],xmm15 + lea r8,QWORD PTR[r15] + call asm_AES_decrypt + pxor xmm6,XMMWORD PTR[32+rbp] + mov rdx,r13 + movdqu XMMWORD PTR[r13],xmm6 + +$L$xts_dec_steal:: + movzx eax,BYTE PTR[16+r12] + movzx ecx,BYTE PTR[rdx] + lea r12,QWORD PTR[1+r12] + mov BYTE PTR[rdx],al + mov BYTE PTR[16+rdx],cl + lea rdx,QWORD PTR[1+rdx] + sub ebx,1 + jnz $L$xts_dec_steal + + movdqu xmm15,XMMWORD PTR[r13] + lea rcx,QWORD PTR[32+rbp] + pxor xmm15,xmm5 + lea rdx,QWORD PTR[32+rbp] + movdqa XMMWORD PTR[32+rbp],xmm15 + lea r8,QWORD PTR[r15] + call asm_AES_decrypt + pxor xmm5,XMMWORD PTR[32+rbp] + movdqu XMMWORD PTR[r13],xmm5 + +$L$xts_dec_ret:: + lea rax,QWORD PTR[rsp] + pxor xmm0,xmm0 +$L$xts_dec_bzero:: + movdqa XMMWORD PTR[rax],xmm0 + movdqa XMMWORD PTR[16+rax],xmm0 + lea rax,QWORD PTR[32+rax] + cmp rbp,rax + ja $L$xts_dec_bzero + + lea rsp,QWORD PTR[rbp] + movaps xmm6,XMMWORD PTR[64+rbp] + movaps xmm7,XMMWORD PTR[80+rbp] + movaps xmm8,XMMWORD PTR[96+rbp] + movaps xmm9,XMMWORD PTR[112+rbp] + movaps xmm10,XMMWORD PTR[128+rbp] + movaps xmm11,XMMWORD PTR[144+rbp] + movaps xmm12,XMMWORD PTR[160+rbp] + movaps xmm13,XMMWORD PTR[176+rbp] + movaps xmm14,XMMWORD PTR[192+rbp] + movaps xmm15,XMMWORD PTR[208+rbp] + lea rsp,QWORD PTR[160+rbp] + mov r15,QWORD PTR[72+rsp] + mov r14,QWORD PTR[80+rsp] + mov r13,QWORD PTR[88+rsp] + mov r12,QWORD PTR[96+rsp] + mov rbx,QWORD PTR[104+rsp] + mov rax,QWORD PTR[112+rsp] + lea rsp,QWORD PTR[120+rsp] + mov rbp,rax +$L$xts_dec_epilogue:: + DB 0F3h,0C3h ;repret +bsaes_xts_decrypt ENDP + +ALIGN 64 +_bsaes_const:: +$L$M0ISR:: + DQ 00a0e0206070b0f03h,00004080c0d010509h +$L$ISRM0:: + DQ 001040b0e0205080fh,00306090c00070a0dh +$L$ISR:: + DQ 00504070602010003h,00f0e0d0c080b0a09h +$L$BS0:: + DQ 05555555555555555h,05555555555555555h +$L$BS1:: + DQ 03333333333333333h,03333333333333333h +$L$BS2:: + DQ 00f0f0f0f0f0f0f0fh,00f0f0f0f0f0f0f0fh +$L$SR:: + DQ 00504070600030201h,00f0e0d0c0a09080bh +$L$SRM0:: + DQ 00304090e00050a0fh,001060b0c0207080dh +$L$M0SR:: + DQ 00a0e02060f03070bh,00004080c05090d01h +$L$SWPUP:: + DQ 00706050403020100h,00c0d0e0f0b0a0908h +$L$SWPUPM0SR:: + DQ 00a0d02060c03070bh,00004080f05090e01h +$L$ADD1:: + DQ 00000000000000000h,00000000100000000h +$L$ADD2:: + DQ 00000000000000000h,00000000200000000h +$L$ADD3:: + DQ 00000000000000000h,00000000300000000h +$L$ADD4:: + DQ 00000000000000000h,00000000400000000h +$L$ADD5:: + DQ 00000000000000000h,00000000500000000h +$L$ADD6:: + DQ 00000000000000000h,00000000600000000h +$L$ADD7:: + DQ 00000000000000000h,00000000700000000h +$L$ADD8:: + DQ 00000000000000000h,00000000800000000h +$L$xts_magic:: + DD 087h,0,1,0 +$L$masks:: + DQ 00101010101010101h,00101010101010101h + DQ 00202020202020202h,00202020202020202h + DQ 00404040404040404h,00404040404040404h + DQ 00808080808080808h,00808080808080808h +$L$M0:: + DQ 002060a0e03070b0fh,00004080c0105090dh +$L$63:: + DQ 06363636363636363h,06363636363636363h +DB 66,105,116,45,115,108,105,99,101,100,32,65,69,83,32,102 +DB 111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44 +DB 32,69,109,105,108,105,97,32,75,195,164,115,112,101,114,44 +DB 32,80,101,116,101,114,32,83,99,104,119,97,98,101,44,32 +DB 65,110,100,121,32,80,111,108,121,97,107,111,118,0 +ALIGN 64 + +EXTERN __imp_RtlVirtualUnwind:NEAR + +ALIGN 16 +se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + mov rsi,QWORD PTR[8+r9] + mov r11,QWORD PTR[56+r9] + + mov r10d,DWORD PTR[r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$in_prologue + + mov rax,QWORD PTR[152+r8] + + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jae $L$in_prologue + + mov rax,QWORD PTR[160+r8] + + lea rsi,QWORD PTR[64+rax] + lea rdi,QWORD PTR[512+r8] + mov ecx,20 + DD 0a548f3fch + lea rax,QWORD PTR[160+rax] + + mov rbp,QWORD PTR[112+rax] + mov rbx,QWORD PTR[104+rax] + mov r12,QWORD PTR[96+rax] + mov r13,QWORD PTR[88+rax] + mov r14,QWORD PTR[80+rax] + mov r15,QWORD PTR[72+rax] + lea rax,QWORD PTR[120+rax] + mov QWORD PTR[144+r8],rbx + mov QWORD PTR[160+r8],rbp + mov QWORD PTR[216+r8],r12 + mov QWORD PTR[224+r8],r13 + mov QWORD PTR[232+r8],r14 + mov QWORD PTR[240+r8],r15 + +$L$in_prologue:: + mov QWORD PTR[152+r8],rax + + mov rdi,QWORD PTR[40+r9] + mov rsi,r8 + mov ecx,154 + DD 0a548f3fch + + mov rsi,r9 + xor rcx,rcx + mov rdx,QWORD PTR[8+rsi] + mov r8,QWORD PTR[rsi] + mov r9,QWORD PTR[16+rsi] + mov r10,QWORD PTR[40+rsi] + lea r11,QWORD PTR[56+rsi] + lea r12,QWORD PTR[24+rsi] + mov QWORD PTR[32+rsp],r10 + mov QWORD PTR[40+rsp],r11 + mov QWORD PTR[48+rsp],r12 + mov QWORD PTR[56+rsp],rcx + call QWORD PTR[__imp_RtlVirtualUnwind] + + mov eax,1 + add rsp,64 + popfq + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + pop rbx + pop rdi + pop rsi + DB 0F3h,0C3h ;repret +se_handler ENDP + +.text$ ENDS +.pdata SEGMENT READONLY ALIGN(4) +ALIGN 4 + DD imagerel $L$cbc_dec_prologue + DD imagerel $L$cbc_dec_epilogue + DD imagerel $L$cbc_dec_info + + DD imagerel $L$ctr_enc_prologue + DD imagerel $L$ctr_enc_epilogue + DD imagerel $L$ctr_enc_info + + DD imagerel $L$xts_enc_prologue + DD imagerel $L$xts_enc_epilogue + DD imagerel $L$xts_enc_info + + DD imagerel $L$xts_dec_prologue + DD imagerel $L$xts_dec_epilogue + DD imagerel $L$xts_dec_info + +.pdata ENDS +.xdata SEGMENT READONLY ALIGN(8) +ALIGN 8 +$L$cbc_dec_info:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$cbc_dec_body,imagerel $L$cbc_dec_epilogue +$L$ctr_enc_info:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$ctr_enc_body,imagerel $L$ctr_enc_epilogue +$L$xts_enc_info:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$xts_enc_body,imagerel $L$xts_enc_epilogue +$L$xts_dec_info:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$xts_dec_body,imagerel $L$xts_dec_epilogue + +.xdata ENDS +END diff --git a/crypto/aes/bsaes-mingw64-x86_64.S b/crypto/aes/bsaes-mingw64-x86_64.S new file mode 100644 index 00000000..f0b07cba --- /dev/null +++ b/crypto/aes/bsaes-mingw64-x86_64.S @@ -0,0 +1,2725 @@ +#include "x86_arch.h" +.text + + + + +.def _bsaes_encrypt8; .scl 3; .type 32; .endef +.p2align 6 +_bsaes_encrypt8: + leaq .LBS0(%rip),%r11 + + movdqa (%rax),%xmm8 + leaq 16(%rax),%rax + movdqa 80(%r11),%xmm7 + pxor %xmm8,%xmm15 + pxor %xmm8,%xmm0 +.byte 102,68,15,56,0,255 + pxor %xmm8,%xmm1 +.byte 102,15,56,0,199 + pxor %xmm8,%xmm2 +.byte 102,15,56,0,207 + pxor %xmm8,%xmm3 +.byte 102,15,56,0,215 + pxor %xmm8,%xmm4 +.byte 102,15,56,0,223 + pxor %xmm8,%xmm5 +.byte 102,15,56,0,231 + pxor %xmm8,%xmm6 +.byte 102,15,56,0,239 +.byte 102,15,56,0,247 +_bsaes_encrypt8_bitslice: + movdqa 0(%r11),%xmm7 + movdqa 16(%r11),%xmm8 + movdqa %xmm5,%xmm9 + psrlq $1,%xmm5 + movdqa %xmm3,%xmm10 + psrlq $1,%xmm3 + pxor %xmm6,%xmm5 + pxor %xmm4,%xmm3 + pand %xmm7,%xmm5 + pand %xmm7,%xmm3 + pxor %xmm5,%xmm6 + psllq $1,%xmm5 + pxor %xmm3,%xmm4 + psllq $1,%xmm3 + pxor %xmm9,%xmm5 + pxor %xmm10,%xmm3 + movdqa %xmm1,%xmm9 + psrlq $1,%xmm1 + movdqa %xmm15,%xmm10 + psrlq $1,%xmm15 + pxor %xmm2,%xmm1 + pxor %xmm0,%xmm15 + pand %xmm7,%xmm1 + pand %xmm7,%xmm15 + pxor %xmm1,%xmm2 + psllq $1,%xmm1 + pxor %xmm15,%xmm0 + psllq $1,%xmm15 + pxor %xmm9,%xmm1 + pxor %xmm10,%xmm15 + movdqa 32(%r11),%xmm7 + movdqa %xmm4,%xmm9 + psrlq $2,%xmm4 + movdqa %xmm3,%xmm10 + psrlq $2,%xmm3 + pxor %xmm6,%xmm4 + pxor %xmm5,%xmm3 + pand %xmm8,%xmm4 + pand %xmm8,%xmm3 + pxor %xmm4,%xmm6 + psllq $2,%xmm4 + pxor %xmm3,%xmm5 + psllq $2,%xmm3 + pxor %xmm9,%xmm4 + pxor %xmm10,%xmm3 + movdqa %xmm0,%xmm9 + psrlq $2,%xmm0 + movdqa %xmm15,%xmm10 + psrlq $2,%xmm15 + pxor %xmm2,%xmm0 + pxor %xmm1,%xmm15 + pand %xmm8,%xmm0 + pand %xmm8,%xmm15 + pxor %xmm0,%xmm2 + psllq $2,%xmm0 + pxor %xmm15,%xmm1 + psllq $2,%xmm15 + pxor %xmm9,%xmm0 + pxor %xmm10,%xmm15 + movdqa %xmm2,%xmm9 + psrlq $4,%xmm2 + movdqa %xmm1,%xmm10 + psrlq $4,%xmm1 + pxor %xmm6,%xmm2 + pxor %xmm5,%xmm1 + pand %xmm7,%xmm2 + pand %xmm7,%xmm1 + pxor %xmm2,%xmm6 + psllq $4,%xmm2 + pxor %xmm1,%xmm5 + psllq $4,%xmm1 + pxor %xmm9,%xmm2 + pxor %xmm10,%xmm1 + movdqa %xmm0,%xmm9 + psrlq $4,%xmm0 + movdqa %xmm15,%xmm10 + psrlq $4,%xmm15 + pxor %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pand %xmm7,%xmm0 + pand %xmm7,%xmm15 + pxor %xmm0,%xmm4 + psllq $4,%xmm0 + pxor %xmm15,%xmm3 + psllq $4,%xmm15 + pxor %xmm9,%xmm0 + pxor %xmm10,%xmm15 + decl %r10d + jmp .Lenc_sbox +.p2align 4 +.Lenc_loop: + pxor 0(%rax),%xmm15 + pxor 16(%rax),%xmm0 +.byte 102,68,15,56,0,255 + pxor 32(%rax),%xmm1 +.byte 102,15,56,0,199 + pxor 48(%rax),%xmm2 +.byte 102,15,56,0,207 + pxor 64(%rax),%xmm3 +.byte 102,15,56,0,215 + pxor 80(%rax),%xmm4 +.byte 102,15,56,0,223 + pxor 96(%rax),%xmm5 +.byte 102,15,56,0,231 + pxor 112(%rax),%xmm6 +.byte 102,15,56,0,239 + leaq 128(%rax),%rax +.byte 102,15,56,0,247 +.Lenc_sbox: + pxor %xmm5,%xmm4 + pxor %xmm0,%xmm1 + pxor %xmm15,%xmm2 + pxor %xmm1,%xmm5 + pxor %xmm15,%xmm4 + + pxor %xmm2,%xmm5 + pxor %xmm6,%xmm2 + pxor %xmm4,%xmm6 + pxor %xmm3,%xmm2 + pxor %xmm4,%xmm3 + pxor %xmm0,%xmm2 + + pxor %xmm6,%xmm1 + pxor %xmm4,%xmm0 + movdqa %xmm6,%xmm10 + movdqa %xmm0,%xmm9 + movdqa %xmm4,%xmm8 + movdqa %xmm1,%xmm12 + movdqa %xmm5,%xmm11 + + pxor %xmm3,%xmm10 + pxor %xmm1,%xmm9 + pxor %xmm2,%xmm8 + movdqa %xmm10,%xmm13 + pxor %xmm3,%xmm12 + movdqa %xmm9,%xmm7 + pxor %xmm15,%xmm11 + movdqa %xmm10,%xmm14 + + por %xmm8,%xmm9 + por %xmm11,%xmm10 + pxor %xmm7,%xmm14 + pand %xmm11,%xmm13 + pxor %xmm8,%xmm11 + pand %xmm8,%xmm7 + pand %xmm11,%xmm14 + movdqa %xmm2,%xmm11 + pxor %xmm15,%xmm11 + pand %xmm11,%xmm12 + pxor %xmm12,%xmm10 + pxor %xmm12,%xmm9 + movdqa %xmm6,%xmm12 + movdqa %xmm4,%xmm11 + pxor %xmm0,%xmm12 + pxor %xmm5,%xmm11 + movdqa %xmm12,%xmm8 + pand %xmm11,%xmm12 + por %xmm11,%xmm8 + pxor %xmm12,%xmm7 + pxor %xmm14,%xmm10 + pxor %xmm13,%xmm9 + pxor %xmm14,%xmm8 + movdqa %xmm1,%xmm11 + pxor %xmm13,%xmm7 + movdqa %xmm3,%xmm12 + pxor %xmm13,%xmm8 + movdqa %xmm0,%xmm13 + pand %xmm2,%xmm11 + movdqa %xmm6,%xmm14 + pand %xmm15,%xmm12 + pand %xmm4,%xmm13 + por %xmm5,%xmm14 + pxor %xmm11,%xmm10 + pxor %xmm12,%xmm9 + pxor %xmm13,%xmm8 + pxor %xmm14,%xmm7 + + + + + + movdqa %xmm10,%xmm11 + pand %xmm8,%xmm10 + pxor %xmm9,%xmm11 + + movdqa %xmm7,%xmm13 + movdqa %xmm11,%xmm14 + pxor %xmm10,%xmm13 + pand %xmm13,%xmm14 + + movdqa %xmm8,%xmm12 + pxor %xmm9,%xmm14 + pxor %xmm7,%xmm12 + + pxor %xmm9,%xmm10 + + pand %xmm10,%xmm12 + + movdqa %xmm13,%xmm9 + pxor %xmm7,%xmm12 + + pxor %xmm12,%xmm9 + pxor %xmm12,%xmm8 + + pand %xmm7,%xmm9 + + pxor %xmm9,%xmm13 + pxor %xmm9,%xmm8 + + pand %xmm14,%xmm13 + + pxor %xmm11,%xmm13 + movdqa %xmm5,%xmm11 + movdqa %xmm4,%xmm7 + movdqa %xmm14,%xmm9 + pxor %xmm13,%xmm9 + pand %xmm5,%xmm9 + pxor %xmm4,%xmm5 + pand %xmm14,%xmm4 + pand %xmm13,%xmm5 + pxor %xmm4,%xmm5 + pxor %xmm9,%xmm4 + pxor %xmm15,%xmm11 + pxor %xmm2,%xmm7 + pxor %xmm12,%xmm14 + pxor %xmm8,%xmm13 + movdqa %xmm14,%xmm10 + movdqa %xmm12,%xmm9 + pxor %xmm13,%xmm10 + pxor %xmm8,%xmm9 + pand %xmm11,%xmm10 + pand %xmm15,%xmm9 + pxor %xmm7,%xmm11 + pxor %xmm2,%xmm15 + pand %xmm14,%xmm7 + pand %xmm12,%xmm2 + pand %xmm13,%xmm11 + pand %xmm8,%xmm15 + pxor %xmm11,%xmm7 + pxor %xmm2,%xmm15 + pxor %xmm10,%xmm11 + pxor %xmm9,%xmm2 + pxor %xmm11,%xmm5 + pxor %xmm11,%xmm15 + pxor %xmm7,%xmm4 + pxor %xmm7,%xmm2 + + movdqa %xmm6,%xmm11 + movdqa %xmm0,%xmm7 + pxor %xmm3,%xmm11 + pxor %xmm1,%xmm7 + movdqa %xmm14,%xmm10 + movdqa %xmm12,%xmm9 + pxor %xmm13,%xmm10 + pxor %xmm8,%xmm9 + pand %xmm11,%xmm10 + pand %xmm3,%xmm9 + pxor %xmm7,%xmm11 + pxor %xmm1,%xmm3 + pand %xmm14,%xmm7 + pand %xmm12,%xmm1 + pand %xmm13,%xmm11 + pand %xmm8,%xmm3 + pxor %xmm11,%xmm7 + pxor %xmm1,%xmm3 + pxor %xmm10,%xmm11 + pxor %xmm9,%xmm1 + pxor %xmm12,%xmm14 + pxor %xmm8,%xmm13 + movdqa %xmm14,%xmm10 + pxor %xmm13,%xmm10 + pand %xmm6,%xmm10 + pxor %xmm0,%xmm6 + pand %xmm14,%xmm0 + pand %xmm13,%xmm6 + pxor %xmm0,%xmm6 + pxor %xmm10,%xmm0 + pxor %xmm11,%xmm6 + pxor %xmm11,%xmm3 + pxor %xmm7,%xmm0 + pxor %xmm7,%xmm1 + pxor %xmm15,%xmm6 + pxor %xmm5,%xmm0 + pxor %xmm6,%xmm3 + pxor %xmm15,%xmm5 + pxor %xmm0,%xmm15 + + pxor %xmm4,%xmm0 + pxor %xmm1,%xmm4 + pxor %xmm2,%xmm1 + pxor %xmm4,%xmm2 + pxor %xmm4,%xmm3 + + pxor %xmm2,%xmm5 + decl %r10d + jl .Lenc_done + pshufd $147,%xmm15,%xmm7 + pshufd $147,%xmm0,%xmm8 + pxor %xmm7,%xmm15 + pshufd $147,%xmm3,%xmm9 + pxor %xmm8,%xmm0 + pshufd $147,%xmm5,%xmm10 + pxor %xmm9,%xmm3 + pshufd $147,%xmm2,%xmm11 + pxor %xmm10,%xmm5 + pshufd $147,%xmm6,%xmm12 + pxor %xmm11,%xmm2 + pshufd $147,%xmm1,%xmm13 + pxor %xmm12,%xmm6 + pshufd $147,%xmm4,%xmm14 + pxor %xmm13,%xmm1 + pxor %xmm14,%xmm4 + + pxor %xmm15,%xmm8 + pxor %xmm4,%xmm7 + pxor %xmm4,%xmm8 + pshufd $78,%xmm15,%xmm15 + pxor %xmm0,%xmm9 + pshufd $78,%xmm0,%xmm0 + pxor %xmm2,%xmm12 + pxor %xmm7,%xmm15 + pxor %xmm6,%xmm13 + pxor %xmm8,%xmm0 + pxor %xmm5,%xmm11 + pshufd $78,%xmm2,%xmm7 + pxor %xmm1,%xmm14 + pshufd $78,%xmm6,%xmm8 + pxor %xmm3,%xmm10 + pshufd $78,%xmm5,%xmm2 + pxor %xmm4,%xmm10 + pshufd $78,%xmm4,%xmm6 + pxor %xmm4,%xmm11 + pshufd $78,%xmm1,%xmm5 + pxor %xmm11,%xmm7 + pshufd $78,%xmm3,%xmm1 + pxor %xmm12,%xmm8 + pxor %xmm10,%xmm2 + pxor %xmm14,%xmm6 + pxor %xmm13,%xmm5 + movdqa %xmm7,%xmm3 + pxor %xmm9,%xmm1 + movdqa %xmm8,%xmm4 + movdqa 48(%r11),%xmm7 + jnz .Lenc_loop + movdqa 64(%r11),%xmm7 + jmp .Lenc_loop +.p2align 4 +.Lenc_done: + movdqa 0(%r11),%xmm7 + movdqa 16(%r11),%xmm8 + movdqa %xmm1,%xmm9 + psrlq $1,%xmm1 + movdqa %xmm2,%xmm10 + psrlq $1,%xmm2 + pxor %xmm4,%xmm1 + pxor %xmm6,%xmm2 + pand %xmm7,%xmm1 + pand %xmm7,%xmm2 + pxor %xmm1,%xmm4 + psllq $1,%xmm1 + pxor %xmm2,%xmm6 + psllq $1,%xmm2 + pxor %xmm9,%xmm1 + pxor %xmm10,%xmm2 + movdqa %xmm3,%xmm9 + psrlq $1,%xmm3 + movdqa %xmm15,%xmm10 + psrlq $1,%xmm15 + pxor %xmm5,%xmm3 + pxor %xmm0,%xmm15 + pand %xmm7,%xmm3 + pand %xmm7,%xmm15 + pxor %xmm3,%xmm5 + psllq $1,%xmm3 + pxor %xmm15,%xmm0 + psllq $1,%xmm15 + pxor %xmm9,%xmm3 + pxor %xmm10,%xmm15 + movdqa 32(%r11),%xmm7 + movdqa %xmm6,%xmm9 + psrlq $2,%xmm6 + movdqa %xmm2,%xmm10 + psrlq $2,%xmm2 + pxor %xmm4,%xmm6 + pxor %xmm1,%xmm2 + pand %xmm8,%xmm6 + pand %xmm8,%xmm2 + pxor %xmm6,%xmm4 + psllq $2,%xmm6 + pxor %xmm2,%xmm1 + psllq $2,%xmm2 + pxor %xmm9,%xmm6 + pxor %xmm10,%xmm2 + movdqa %xmm0,%xmm9 + psrlq $2,%xmm0 + movdqa %xmm15,%xmm10 + psrlq $2,%xmm15 + pxor %xmm5,%xmm0 + pxor %xmm3,%xmm15 + pand %xmm8,%xmm0 + pand %xmm8,%xmm15 + pxor %xmm0,%xmm5 + psllq $2,%xmm0 + pxor %xmm15,%xmm3 + psllq $2,%xmm15 + pxor %xmm9,%xmm0 + pxor %xmm10,%xmm15 + movdqa %xmm5,%xmm9 + psrlq $4,%xmm5 + movdqa %xmm3,%xmm10 + psrlq $4,%xmm3 + pxor %xmm4,%xmm5 + pxor %xmm1,%xmm3 + pand %xmm7,%xmm5 + pand %xmm7,%xmm3 + pxor %xmm5,%xmm4 + psllq $4,%xmm5 + pxor %xmm3,%xmm1 + psllq $4,%xmm3 + pxor %xmm9,%xmm5 + pxor %xmm10,%xmm3 + movdqa %xmm0,%xmm9 + psrlq $4,%xmm0 + movdqa %xmm15,%xmm10 + psrlq $4,%xmm15 + pxor %xmm6,%xmm0 + pxor %xmm2,%xmm15 + pand %xmm7,%xmm0 + pand %xmm7,%xmm15 + pxor %xmm0,%xmm6 + psllq $4,%xmm0 + pxor %xmm15,%xmm2 + psllq $4,%xmm15 + pxor %xmm9,%xmm0 + pxor %xmm10,%xmm15 + movdqa (%rax),%xmm7 + pxor %xmm7,%xmm3 + pxor %xmm7,%xmm5 + pxor %xmm7,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm7,%xmm1 + pxor %xmm7,%xmm4 + pxor %xmm7,%xmm15 + pxor %xmm7,%xmm0 + retq + + +.def _bsaes_decrypt8; .scl 3; .type 32; .endef +.p2align 6 +_bsaes_decrypt8: + leaq .LBS0(%rip),%r11 + + movdqa (%rax),%xmm8 + leaq 16(%rax),%rax + movdqa -48(%r11),%xmm7 + pxor %xmm8,%xmm15 + pxor %xmm8,%xmm0 +.byte 102,68,15,56,0,255 + pxor %xmm8,%xmm1 +.byte 102,15,56,0,199 + pxor %xmm8,%xmm2 +.byte 102,15,56,0,207 + pxor %xmm8,%xmm3 +.byte 102,15,56,0,215 + pxor %xmm8,%xmm4 +.byte 102,15,56,0,223 + pxor %xmm8,%xmm5 +.byte 102,15,56,0,231 + pxor %xmm8,%xmm6 +.byte 102,15,56,0,239 +.byte 102,15,56,0,247 + movdqa 0(%r11),%xmm7 + movdqa 16(%r11),%xmm8 + movdqa %xmm5,%xmm9 + psrlq $1,%xmm5 + movdqa %xmm3,%xmm10 + psrlq $1,%xmm3 + pxor %xmm6,%xmm5 + pxor %xmm4,%xmm3 + pand %xmm7,%xmm5 + pand %xmm7,%xmm3 + pxor %xmm5,%xmm6 + psllq $1,%xmm5 + pxor %xmm3,%xmm4 + psllq $1,%xmm3 + pxor %xmm9,%xmm5 + pxor %xmm10,%xmm3 + movdqa %xmm1,%xmm9 + psrlq $1,%xmm1 + movdqa %xmm15,%xmm10 + psrlq $1,%xmm15 + pxor %xmm2,%xmm1 + pxor %xmm0,%xmm15 + pand %xmm7,%xmm1 + pand %xmm7,%xmm15 + pxor %xmm1,%xmm2 + psllq $1,%xmm1 + pxor %xmm15,%xmm0 + psllq $1,%xmm15 + pxor %xmm9,%xmm1 + pxor %xmm10,%xmm15 + movdqa 32(%r11),%xmm7 + movdqa %xmm4,%xmm9 + psrlq $2,%xmm4 + movdqa %xmm3,%xmm10 + psrlq $2,%xmm3 + pxor %xmm6,%xmm4 + pxor %xmm5,%xmm3 + pand %xmm8,%xmm4 + pand %xmm8,%xmm3 + pxor %xmm4,%xmm6 + psllq $2,%xmm4 + pxor %xmm3,%xmm5 + psllq $2,%xmm3 + pxor %xmm9,%xmm4 + pxor %xmm10,%xmm3 + movdqa %xmm0,%xmm9 + psrlq $2,%xmm0 + movdqa %xmm15,%xmm10 + psrlq $2,%xmm15 + pxor %xmm2,%xmm0 + pxor %xmm1,%xmm15 + pand %xmm8,%xmm0 + pand %xmm8,%xmm15 + pxor %xmm0,%xmm2 + psllq $2,%xmm0 + pxor %xmm15,%xmm1 + psllq $2,%xmm15 + pxor %xmm9,%xmm0 + pxor %xmm10,%xmm15 + movdqa %xmm2,%xmm9 + psrlq $4,%xmm2 + movdqa %xmm1,%xmm10 + psrlq $4,%xmm1 + pxor %xmm6,%xmm2 + pxor %xmm5,%xmm1 + pand %xmm7,%xmm2 + pand %xmm7,%xmm1 + pxor %xmm2,%xmm6 + psllq $4,%xmm2 + pxor %xmm1,%xmm5 + psllq $4,%xmm1 + pxor %xmm9,%xmm2 + pxor %xmm10,%xmm1 + movdqa %xmm0,%xmm9 + psrlq $4,%xmm0 + movdqa %xmm15,%xmm10 + psrlq $4,%xmm15 + pxor %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pand %xmm7,%xmm0 + pand %xmm7,%xmm15 + pxor %xmm0,%xmm4 + psllq $4,%xmm0 + pxor %xmm15,%xmm3 + psllq $4,%xmm15 + pxor %xmm9,%xmm0 + pxor %xmm10,%xmm15 + decl %r10d + jmp .Ldec_sbox +.p2align 4 +.Ldec_loop: + pxor 0(%rax),%xmm15 + pxor 16(%rax),%xmm0 +.byte 102,68,15,56,0,255 + pxor 32(%rax),%xmm1 +.byte 102,15,56,0,199 + pxor 48(%rax),%xmm2 +.byte 102,15,56,0,207 + pxor 64(%rax),%xmm3 +.byte 102,15,56,0,215 + pxor 80(%rax),%xmm4 +.byte 102,15,56,0,223 + pxor 96(%rax),%xmm5 +.byte 102,15,56,0,231 + pxor 112(%rax),%xmm6 +.byte 102,15,56,0,239 + leaq 128(%rax),%rax +.byte 102,15,56,0,247 +.Ldec_sbox: + pxor %xmm3,%xmm2 + + pxor %xmm6,%xmm3 + pxor %xmm6,%xmm1 + pxor %xmm3,%xmm5 + pxor %xmm5,%xmm6 + pxor %xmm6,%xmm0 + + pxor %xmm0,%xmm15 + pxor %xmm4,%xmm1 + pxor %xmm15,%xmm2 + pxor %xmm15,%xmm4 + pxor %xmm2,%xmm0 + movdqa %xmm2,%xmm10 + movdqa %xmm6,%xmm9 + movdqa %xmm0,%xmm8 + movdqa %xmm3,%xmm12 + movdqa %xmm4,%xmm11 + + pxor %xmm15,%xmm10 + pxor %xmm3,%xmm9 + pxor %xmm5,%xmm8 + movdqa %xmm10,%xmm13 + pxor %xmm15,%xmm12 + movdqa %xmm9,%xmm7 + pxor %xmm1,%xmm11 + movdqa %xmm10,%xmm14 + + por %xmm8,%xmm9 + por %xmm11,%xmm10 + pxor %xmm7,%xmm14 + pand %xmm11,%xmm13 + pxor %xmm8,%xmm11 + pand %xmm8,%xmm7 + pand %xmm11,%xmm14 + movdqa %xmm5,%xmm11 + pxor %xmm1,%xmm11 + pand %xmm11,%xmm12 + pxor %xmm12,%xmm10 + pxor %xmm12,%xmm9 + movdqa %xmm2,%xmm12 + movdqa %xmm0,%xmm11 + pxor %xmm6,%xmm12 + pxor %xmm4,%xmm11 + movdqa %xmm12,%xmm8 + pand %xmm11,%xmm12 + por %xmm11,%xmm8 + pxor %xmm12,%xmm7 + pxor %xmm14,%xmm10 + pxor %xmm13,%xmm9 + pxor %xmm14,%xmm8 + movdqa %xmm3,%xmm11 + pxor %xmm13,%xmm7 + movdqa %xmm15,%xmm12 + pxor %xmm13,%xmm8 + movdqa %xmm6,%xmm13 + pand %xmm5,%xmm11 + movdqa %xmm2,%xmm14 + pand %xmm1,%xmm12 + pand %xmm0,%xmm13 + por %xmm4,%xmm14 + pxor %xmm11,%xmm10 + pxor %xmm12,%xmm9 + pxor %xmm13,%xmm8 + pxor %xmm14,%xmm7 + + + + + + movdqa %xmm10,%xmm11 + pand %xmm8,%xmm10 + pxor %xmm9,%xmm11 + + movdqa %xmm7,%xmm13 + movdqa %xmm11,%xmm14 + pxor %xmm10,%xmm13 + pand %xmm13,%xmm14 + + movdqa %xmm8,%xmm12 + pxor %xmm9,%xmm14 + pxor %xmm7,%xmm12 + + pxor %xmm9,%xmm10 + + pand %xmm10,%xmm12 + + movdqa %xmm13,%xmm9 + pxor %xmm7,%xmm12 + + pxor %xmm12,%xmm9 + pxor %xmm12,%xmm8 + + pand %xmm7,%xmm9 + + pxor %xmm9,%xmm13 + pxor %xmm9,%xmm8 + + pand %xmm14,%xmm13 + + pxor %xmm11,%xmm13 + movdqa %xmm4,%xmm11 + movdqa %xmm0,%xmm7 + movdqa %xmm14,%xmm9 + pxor %xmm13,%xmm9 + pand %xmm4,%xmm9 + pxor %xmm0,%xmm4 + pand %xmm14,%xmm0 + pand %xmm13,%xmm4 + pxor %xmm0,%xmm4 + pxor %xmm9,%xmm0 + pxor %xmm1,%xmm11 + pxor %xmm5,%xmm7 + pxor %xmm12,%xmm14 + pxor %xmm8,%xmm13 + movdqa %xmm14,%xmm10 + movdqa %xmm12,%xmm9 + pxor %xmm13,%xmm10 + pxor %xmm8,%xmm9 + pand %xmm11,%xmm10 + pand %xmm1,%xmm9 + pxor %xmm7,%xmm11 + pxor %xmm5,%xmm1 + pand %xmm14,%xmm7 + pand %xmm12,%xmm5 + pand %xmm13,%xmm11 + pand %xmm8,%xmm1 + pxor %xmm11,%xmm7 + pxor %xmm5,%xmm1 + pxor %xmm10,%xmm11 + pxor %xmm9,%xmm5 + pxor %xmm11,%xmm4 + pxor %xmm11,%xmm1 + pxor %xmm7,%xmm0 + pxor %xmm7,%xmm5 + + movdqa %xmm2,%xmm11 + movdqa %xmm6,%xmm7 + pxor %xmm15,%xmm11 + pxor %xmm3,%xmm7 + movdqa %xmm14,%xmm10 + movdqa %xmm12,%xmm9 + pxor %xmm13,%xmm10 + pxor %xmm8,%xmm9 + pand %xmm11,%xmm10 + pand %xmm15,%xmm9 + pxor %xmm7,%xmm11 + pxor %xmm3,%xmm15 + pand %xmm14,%xmm7 + pand %xmm12,%xmm3 + pand %xmm13,%xmm11 + pand %xmm8,%xmm15 + pxor %xmm11,%xmm7 + pxor %xmm3,%xmm15 + pxor %xmm10,%xmm11 + pxor %xmm9,%xmm3 + pxor %xmm12,%xmm14 + pxor %xmm8,%xmm13 + movdqa %xmm14,%xmm10 + pxor %xmm13,%xmm10 + pand %xmm2,%xmm10 + pxor %xmm6,%xmm2 + pand %xmm14,%xmm6 + pand %xmm13,%xmm2 + pxor %xmm6,%xmm2 + pxor %xmm10,%xmm6 + pxor %xmm11,%xmm2 + pxor %xmm11,%xmm15 + pxor %xmm7,%xmm6 + pxor %xmm7,%xmm3 + pxor %xmm6,%xmm0 + pxor %xmm4,%xmm5 + + pxor %xmm0,%xmm3 + pxor %xmm6,%xmm1 + pxor %xmm6,%xmm4 + pxor %xmm1,%xmm3 + pxor %xmm15,%xmm6 + pxor %xmm4,%xmm3 + pxor %xmm5,%xmm2 + pxor %xmm0,%xmm5 + pxor %xmm3,%xmm2 + + pxor %xmm15,%xmm3 + pxor %xmm2,%xmm6 + decl %r10d + jl .Ldec_done + + pshufd $78,%xmm15,%xmm7 + pshufd $78,%xmm2,%xmm13 + pxor %xmm15,%xmm7 + pshufd $78,%xmm4,%xmm14 + pxor %xmm2,%xmm13 + pshufd $78,%xmm0,%xmm8 + pxor %xmm4,%xmm14 + pshufd $78,%xmm5,%xmm9 + pxor %xmm0,%xmm8 + pshufd $78,%xmm3,%xmm10 + pxor %xmm5,%xmm9 + pxor %xmm13,%xmm15 + pxor %xmm13,%xmm0 + pshufd $78,%xmm1,%xmm11 + pxor %xmm3,%xmm10 + pxor %xmm7,%xmm5 + pxor %xmm8,%xmm3 + pshufd $78,%xmm6,%xmm12 + pxor %xmm1,%xmm11 + pxor %xmm14,%xmm0 + pxor %xmm9,%xmm1 + pxor %xmm6,%xmm12 + + pxor %xmm14,%xmm5 + pxor %xmm13,%xmm3 + pxor %xmm13,%xmm1 + pxor %xmm10,%xmm6 + pxor %xmm11,%xmm2 + pxor %xmm14,%xmm1 + pxor %xmm14,%xmm6 + pxor %xmm12,%xmm4 + pshufd $147,%xmm15,%xmm7 + pshufd $147,%xmm0,%xmm8 + pxor %xmm7,%xmm15 + pshufd $147,%xmm5,%xmm9 + pxor %xmm8,%xmm0 + pshufd $147,%xmm3,%xmm10 + pxor %xmm9,%xmm5 + pshufd $147,%xmm1,%xmm11 + pxor %xmm10,%xmm3 + pshufd $147,%xmm6,%xmm12 + pxor %xmm11,%xmm1 + pshufd $147,%xmm2,%xmm13 + pxor %xmm12,%xmm6 + pshufd $147,%xmm4,%xmm14 + pxor %xmm13,%xmm2 + pxor %xmm14,%xmm4 + + pxor %xmm15,%xmm8 + pxor %xmm4,%xmm7 + pxor %xmm4,%xmm8 + pshufd $78,%xmm15,%xmm15 + pxor %xmm0,%xmm9 + pshufd $78,%xmm0,%xmm0 + pxor %xmm1,%xmm12 + pxor %xmm7,%xmm15 + pxor %xmm6,%xmm13 + pxor %xmm8,%xmm0 + pxor %xmm3,%xmm11 + pshufd $78,%xmm1,%xmm7 + pxor %xmm2,%xmm14 + pshufd $78,%xmm6,%xmm8 + pxor %xmm5,%xmm10 + pshufd $78,%xmm3,%xmm1 + pxor %xmm4,%xmm10 + pshufd $78,%xmm4,%xmm6 + pxor %xmm4,%xmm11 + pshufd $78,%xmm2,%xmm3 + pxor %xmm11,%xmm7 + pshufd $78,%xmm5,%xmm2 + pxor %xmm12,%xmm8 + pxor %xmm1,%xmm10 + pxor %xmm14,%xmm6 + pxor %xmm3,%xmm13 + movdqa %xmm7,%xmm3 + pxor %xmm9,%xmm2 + movdqa %xmm13,%xmm5 + movdqa %xmm8,%xmm4 + movdqa %xmm2,%xmm1 + movdqa %xmm10,%xmm2 + movdqa -16(%r11),%xmm7 + jnz .Ldec_loop + movdqa -32(%r11),%xmm7 + jmp .Ldec_loop +.p2align 4 +.Ldec_done: + movdqa 0(%r11),%xmm7 + movdqa 16(%r11),%xmm8 + movdqa %xmm2,%xmm9 + psrlq $1,%xmm2 + movdqa %xmm1,%xmm10 + psrlq $1,%xmm1 + pxor %xmm4,%xmm2 + pxor %xmm6,%xmm1 + pand %xmm7,%xmm2 + pand %xmm7,%xmm1 + pxor %xmm2,%xmm4 + psllq $1,%xmm2 + pxor %xmm1,%xmm6 + psllq $1,%xmm1 + pxor %xmm9,%xmm2 + pxor %xmm10,%xmm1 + movdqa %xmm5,%xmm9 + psrlq $1,%xmm5 + movdqa %xmm15,%xmm10 + psrlq $1,%xmm15 + pxor %xmm3,%xmm5 + pxor %xmm0,%xmm15 + pand %xmm7,%xmm5 + pand %xmm7,%xmm15 + pxor %xmm5,%xmm3 + psllq $1,%xmm5 + pxor %xmm15,%xmm0 + psllq $1,%xmm15 + pxor %xmm9,%xmm5 + pxor %xmm10,%xmm15 + movdqa 32(%r11),%xmm7 + movdqa %xmm6,%xmm9 + psrlq $2,%xmm6 + movdqa %xmm1,%xmm10 + psrlq $2,%xmm1 + pxor %xmm4,%xmm6 + pxor %xmm2,%xmm1 + pand %xmm8,%xmm6 + pand %xmm8,%xmm1 + pxor %xmm6,%xmm4 + psllq $2,%xmm6 + pxor %xmm1,%xmm2 + psllq $2,%xmm1 + pxor %xmm9,%xmm6 + pxor %xmm10,%xmm1 + movdqa %xmm0,%xmm9 + psrlq $2,%xmm0 + movdqa %xmm15,%xmm10 + psrlq $2,%xmm15 + pxor %xmm3,%xmm0 + pxor %xmm5,%xmm15 + pand %xmm8,%xmm0 + pand %xmm8,%xmm15 + pxor %xmm0,%xmm3 + psllq $2,%xmm0 + pxor %xmm15,%xmm5 + psllq $2,%xmm15 + pxor %xmm9,%xmm0 + pxor %xmm10,%xmm15 + movdqa %xmm3,%xmm9 + psrlq $4,%xmm3 + movdqa %xmm5,%xmm10 + psrlq $4,%xmm5 + pxor %xmm4,%xmm3 + pxor %xmm2,%xmm5 + pand %xmm7,%xmm3 + pand %xmm7,%xmm5 + pxor %xmm3,%xmm4 + psllq $4,%xmm3 + pxor %xmm5,%xmm2 + psllq $4,%xmm5 + pxor %xmm9,%xmm3 + pxor %xmm10,%xmm5 + movdqa %xmm0,%xmm9 + psrlq $4,%xmm0 + movdqa %xmm15,%xmm10 + psrlq $4,%xmm15 + pxor %xmm6,%xmm0 + pxor %xmm1,%xmm15 + pand %xmm7,%xmm0 + pand %xmm7,%xmm15 + pxor %xmm0,%xmm6 + psllq $4,%xmm0 + pxor %xmm15,%xmm1 + psllq $4,%xmm15 + pxor %xmm9,%xmm0 + pxor %xmm10,%xmm15 + movdqa (%rax),%xmm7 + pxor %xmm7,%xmm5 + pxor %xmm7,%xmm3 + pxor %xmm7,%xmm1 + pxor %xmm7,%xmm6 + pxor %xmm7,%xmm2 + pxor %xmm7,%xmm4 + pxor %xmm7,%xmm15 + pxor %xmm7,%xmm0 + retq + +.def _bsaes_key_convert; .scl 3; .type 32; .endef +.p2align 4 +_bsaes_key_convert: + leaq .Lmasks(%rip),%r11 + movdqu (%rcx),%xmm7 + leaq 16(%rcx),%rcx + movdqa 0(%r11),%xmm0 + movdqa 16(%r11),%xmm1 + movdqa 32(%r11),%xmm2 + movdqa 48(%r11),%xmm3 + movdqa 64(%r11),%xmm4 + pcmpeqd %xmm5,%xmm5 + + movdqu (%rcx),%xmm6 + movdqa %xmm7,(%rax) + leaq 16(%rax),%rax + decl %r10d + jmp .Lkey_loop +.p2align 4 +.Lkey_loop: +.byte 102,15,56,0,244 + + movdqa %xmm0,%xmm8 + movdqa %xmm1,%xmm9 + + pand %xmm6,%xmm8 + pand %xmm6,%xmm9 + movdqa %xmm2,%xmm10 + pcmpeqb %xmm0,%xmm8 + psllq $4,%xmm0 + movdqa %xmm3,%xmm11 + pcmpeqb %xmm1,%xmm9 + psllq $4,%xmm1 + + pand %xmm6,%xmm10 + pand %xmm6,%xmm11 + movdqa %xmm0,%xmm12 + pcmpeqb %xmm2,%xmm10 + psllq $4,%xmm2 + movdqa %xmm1,%xmm13 + pcmpeqb %xmm3,%xmm11 + psllq $4,%xmm3 + + movdqa %xmm2,%xmm14 + movdqa %xmm3,%xmm15 + pxor %xmm5,%xmm8 + pxor %xmm5,%xmm9 + + pand %xmm6,%xmm12 + pand %xmm6,%xmm13 + movdqa %xmm8,0(%rax) + pcmpeqb %xmm0,%xmm12 + psrlq $4,%xmm0 + movdqa %xmm9,16(%rax) + pcmpeqb %xmm1,%xmm13 + psrlq $4,%xmm1 + leaq 16(%rcx),%rcx + + pand %xmm6,%xmm14 + pand %xmm6,%xmm15 + movdqa %xmm10,32(%rax) + pcmpeqb %xmm2,%xmm14 + psrlq $4,%xmm2 + movdqa %xmm11,48(%rax) + pcmpeqb %xmm3,%xmm15 + psrlq $4,%xmm3 + movdqu (%rcx),%xmm6 + + pxor %xmm5,%xmm13 + pxor %xmm5,%xmm14 + movdqa %xmm12,64(%rax) + movdqa %xmm13,80(%rax) + movdqa %xmm14,96(%rax) + movdqa %xmm15,112(%rax) + leaq 128(%rax),%rax + decl %r10d + jnz .Lkey_loop + + movdqa 80(%r11),%xmm7 + + retq + + +.globl bsaes_cbc_encrypt +.def bsaes_cbc_encrypt; .scl 2; .type 32; .endef +.p2align 4 +bsaes_cbc_encrypt: + movl 48(%rsp),%r11d + cmpl $0,%r11d + jne asm_AES_cbc_encrypt + cmpq $128,%r8 + jb asm_AES_cbc_encrypt + + movq %rsp,%rax +.Lcbc_dec_prologue: + pushq %rbp + pushq %rbx + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + leaq -72(%rsp),%rsp + movq 160(%rsp),%r10 + leaq -160(%rsp),%rsp + movaps %xmm6,64(%rsp) + movaps %xmm7,80(%rsp) + movaps %xmm8,96(%rsp) + movaps %xmm9,112(%rsp) + movaps %xmm10,128(%rsp) + movaps %xmm11,144(%rsp) + movaps %xmm12,160(%rsp) + movaps %xmm13,176(%rsp) + movaps %xmm14,192(%rsp) + movaps %xmm15,208(%rsp) +.Lcbc_dec_body: + movq %rsp,%rbp + movl 240(%r9),%eax + movq %rcx,%r12 + movq %rdx,%r13 + movq %r8,%r14 + movq %r9,%r15 + movq %r10,%rbx + shrq $4,%r14 + + movl %eax,%edx + shlq $7,%rax + subq $96,%rax + subq %rax,%rsp + + movq %rsp,%rax + movq %r15,%rcx + movl %edx,%r10d + call _bsaes_key_convert + pxor (%rsp),%xmm7 + movdqa %xmm6,(%rax) + movdqa %xmm7,(%rsp) + + movdqu (%rbx),%xmm14 + subq $8,%r14 +.Lcbc_dec_loop: + movdqu 0(%r12),%xmm15 + movdqu 16(%r12),%xmm0 + movdqu 32(%r12),%xmm1 + movdqu 48(%r12),%xmm2 + movdqu 64(%r12),%xmm3 + movdqu 80(%r12),%xmm4 + movq %rsp,%rax + movdqu 96(%r12),%xmm5 + movl %edx,%r10d + movdqu 112(%r12),%xmm6 + movdqa %xmm14,32(%rbp) + + call _bsaes_decrypt8 + + pxor 32(%rbp),%xmm15 + movdqu 0(%r12),%xmm7 + movdqu 16(%r12),%xmm8 + pxor %xmm7,%xmm0 + movdqu 32(%r12),%xmm9 + pxor %xmm8,%xmm5 + movdqu 48(%r12),%xmm10 + pxor %xmm9,%xmm3 + movdqu 64(%r12),%xmm11 + pxor %xmm10,%xmm1 + movdqu 80(%r12),%xmm12 + pxor %xmm11,%xmm6 + movdqu 96(%r12),%xmm13 + pxor %xmm12,%xmm2 + movdqu 112(%r12),%xmm14 + pxor %xmm13,%xmm4 + movdqu %xmm15,0(%r13) + leaq 128(%r12),%r12 + movdqu %xmm0,16(%r13) + movdqu %xmm5,32(%r13) + movdqu %xmm3,48(%r13) + movdqu %xmm1,64(%r13) + movdqu %xmm6,80(%r13) + movdqu %xmm2,96(%r13) + movdqu %xmm4,112(%r13) + leaq 128(%r13),%r13 + subq $8,%r14 + jnc .Lcbc_dec_loop + + addq $8,%r14 + jz .Lcbc_dec_done + + movdqu 0(%r12),%xmm15 + movq %rsp,%rax + movl %edx,%r10d + cmpq $2,%r14 + jb .Lcbc_dec_one + movdqu 16(%r12),%xmm0 + je .Lcbc_dec_two + movdqu 32(%r12),%xmm1 + cmpq $4,%r14 + jb .Lcbc_dec_three + movdqu 48(%r12),%xmm2 + je .Lcbc_dec_four + movdqu 64(%r12),%xmm3 + cmpq $6,%r14 + jb .Lcbc_dec_five + movdqu 80(%r12),%xmm4 + je .Lcbc_dec_six + movdqu 96(%r12),%xmm5 + movdqa %xmm14,32(%rbp) + call _bsaes_decrypt8 + pxor 32(%rbp),%xmm15 + movdqu 0(%r12),%xmm7 + movdqu 16(%r12),%xmm8 + pxor %xmm7,%xmm0 + movdqu 32(%r12),%xmm9 + pxor %xmm8,%xmm5 + movdqu 48(%r12),%xmm10 + pxor %xmm9,%xmm3 + movdqu 64(%r12),%xmm11 + pxor %xmm10,%xmm1 + movdqu 80(%r12),%xmm12 + pxor %xmm11,%xmm6 + movdqu 96(%r12),%xmm14 + pxor %xmm12,%xmm2 + movdqu %xmm15,0(%r13) + movdqu %xmm0,16(%r13) + movdqu %xmm5,32(%r13) + movdqu %xmm3,48(%r13) + movdqu %xmm1,64(%r13) + movdqu %xmm6,80(%r13) + movdqu %xmm2,96(%r13) + jmp .Lcbc_dec_done +.p2align 4 +.Lcbc_dec_six: + movdqa %xmm14,32(%rbp) + call _bsaes_decrypt8 + pxor 32(%rbp),%xmm15 + movdqu 0(%r12),%xmm7 + movdqu 16(%r12),%xmm8 + pxor %xmm7,%xmm0 + movdqu 32(%r12),%xmm9 + pxor %xmm8,%xmm5 + movdqu 48(%r12),%xmm10 + pxor %xmm9,%xmm3 + movdqu 64(%r12),%xmm11 + pxor %xmm10,%xmm1 + movdqu 80(%r12),%xmm14 + pxor %xmm11,%xmm6 + movdqu %xmm15,0(%r13) + movdqu %xmm0,16(%r13) + movdqu %xmm5,32(%r13) + movdqu %xmm3,48(%r13) + movdqu %xmm1,64(%r13) + movdqu %xmm6,80(%r13) + jmp .Lcbc_dec_done +.p2align 4 +.Lcbc_dec_five: + movdqa %xmm14,32(%rbp) + call _bsaes_decrypt8 + pxor 32(%rbp),%xmm15 + movdqu 0(%r12),%xmm7 + movdqu 16(%r12),%xmm8 + pxor %xmm7,%xmm0 + movdqu 32(%r12),%xmm9 + pxor %xmm8,%xmm5 + movdqu 48(%r12),%xmm10 + pxor %xmm9,%xmm3 + movdqu 64(%r12),%xmm14 + pxor %xmm10,%xmm1 + movdqu %xmm15,0(%r13) + movdqu %xmm0,16(%r13) + movdqu %xmm5,32(%r13) + movdqu %xmm3,48(%r13) + movdqu %xmm1,64(%r13) + jmp .Lcbc_dec_done +.p2align 4 +.Lcbc_dec_four: + movdqa %xmm14,32(%rbp) + call _bsaes_decrypt8 + pxor 32(%rbp),%xmm15 + movdqu 0(%r12),%xmm7 + movdqu 16(%r12),%xmm8 + pxor %xmm7,%xmm0 + movdqu 32(%r12),%xmm9 + pxor %xmm8,%xmm5 + movdqu 48(%r12),%xmm14 + pxor %xmm9,%xmm3 + movdqu %xmm15,0(%r13) + movdqu %xmm0,16(%r13) + movdqu %xmm5,32(%r13) + movdqu %xmm3,48(%r13) + jmp .Lcbc_dec_done +.p2align 4 +.Lcbc_dec_three: + movdqa %xmm14,32(%rbp) + call _bsaes_decrypt8 + pxor 32(%rbp),%xmm15 + movdqu 0(%r12),%xmm7 + movdqu 16(%r12),%xmm8 + pxor %xmm7,%xmm0 + movdqu 32(%r12),%xmm14 + pxor %xmm8,%xmm5 + movdqu %xmm15,0(%r13) + movdqu %xmm0,16(%r13) + movdqu %xmm5,32(%r13) + jmp .Lcbc_dec_done +.p2align 4 +.Lcbc_dec_two: + movdqa %xmm14,32(%rbp) + call _bsaes_decrypt8 + pxor 32(%rbp),%xmm15 + movdqu 0(%r12),%xmm7 + movdqu 16(%r12),%xmm14 + pxor %xmm7,%xmm0 + movdqu %xmm15,0(%r13) + movdqu %xmm0,16(%r13) + jmp .Lcbc_dec_done +.p2align 4 +.Lcbc_dec_one: + leaq (%r12),%rcx + leaq 32(%rbp),%rdx + leaq (%r15),%r8 + call asm_AES_decrypt + pxor 32(%rbp),%xmm14 + movdqu %xmm14,(%r13) + movdqa %xmm15,%xmm14 + +.Lcbc_dec_done: + movdqu %xmm14,(%rbx) + leaq (%rsp),%rax + pxor %xmm0,%xmm0 +.Lcbc_dec_bzero: + movdqa %xmm0,0(%rax) + movdqa %xmm0,16(%rax) + leaq 32(%rax),%rax + cmpq %rax,%rbp + ja .Lcbc_dec_bzero + + leaq (%rbp),%rsp + movaps 64(%rbp),%xmm6 + movaps 80(%rbp),%xmm7 + movaps 96(%rbp),%xmm8 + movaps 112(%rbp),%xmm9 + movaps 128(%rbp),%xmm10 + movaps 144(%rbp),%xmm11 + movaps 160(%rbp),%xmm12 + movaps 176(%rbp),%xmm13 + movaps 192(%rbp),%xmm14 + movaps 208(%rbp),%xmm15 + leaq 160(%rbp),%rsp + movq 72(%rsp),%r15 + movq 80(%rsp),%r14 + movq 88(%rsp),%r13 + movq 96(%rsp),%r12 + movq 104(%rsp),%rbx + movq 112(%rsp),%rax + leaq 120(%rsp),%rsp + movq %rax,%rbp +.Lcbc_dec_epilogue: + retq + + +.globl bsaes_ctr32_encrypt_blocks +.def bsaes_ctr32_encrypt_blocks; .scl 2; .type 32; .endef +.p2align 4 +bsaes_ctr32_encrypt_blocks: + movq %rsp,%rax +.Lctr_enc_prologue: + pushq %rbp + pushq %rbx + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + leaq -72(%rsp),%rsp + movq 160(%rsp),%r10 + leaq -160(%rsp),%rsp + movaps %xmm6,64(%rsp) + movaps %xmm7,80(%rsp) + movaps %xmm8,96(%rsp) + movaps %xmm9,112(%rsp) + movaps %xmm10,128(%rsp) + movaps %xmm11,144(%rsp) + movaps %xmm12,160(%rsp) + movaps %xmm13,176(%rsp) + movaps %xmm14,192(%rsp) + movaps %xmm15,208(%rsp) +.Lctr_enc_body: + movq %rsp,%rbp + movdqu (%r10),%xmm0 + movl 240(%r9),%eax + movq %rcx,%r12 + movq %rdx,%r13 + movq %r8,%r14 + movq %r9,%r15 + movdqa %xmm0,32(%rbp) + cmpq $8,%r8 + jb .Lctr_enc_short + + movl %eax,%ebx + shlq $7,%rax + subq $96,%rax + subq %rax,%rsp + + movq %rsp,%rax + movq %r15,%rcx + movl %ebx,%r10d + call _bsaes_key_convert + pxor %xmm6,%xmm7 + movdqa %xmm7,(%rax) + + movdqa (%rsp),%xmm8 + leaq .LADD1(%rip),%r11 + movdqa 32(%rbp),%xmm15 + movdqa -32(%r11),%xmm7 +.byte 102,68,15,56,0,199 +.byte 102,68,15,56,0,255 + movdqa %xmm8,(%rsp) + jmp .Lctr_enc_loop +.p2align 4 +.Lctr_enc_loop: + movdqa %xmm15,32(%rbp) + movdqa %xmm15,%xmm0 + movdqa %xmm15,%xmm1 + paddd 0(%r11),%xmm0 + movdqa %xmm15,%xmm2 + paddd 16(%r11),%xmm1 + movdqa %xmm15,%xmm3 + paddd 32(%r11),%xmm2 + movdqa %xmm15,%xmm4 + paddd 48(%r11),%xmm3 + movdqa %xmm15,%xmm5 + paddd 64(%r11),%xmm4 + movdqa %xmm15,%xmm6 + paddd 80(%r11),%xmm5 + paddd 96(%r11),%xmm6 + + + + movdqa (%rsp),%xmm8 + leaq 16(%rsp),%rax + movdqa -16(%r11),%xmm7 + pxor %xmm8,%xmm15 + pxor %xmm8,%xmm0 +.byte 102,68,15,56,0,255 + pxor %xmm8,%xmm1 +.byte 102,15,56,0,199 + pxor %xmm8,%xmm2 +.byte 102,15,56,0,207 + pxor %xmm8,%xmm3 +.byte 102,15,56,0,215 + pxor %xmm8,%xmm4 +.byte 102,15,56,0,223 + pxor %xmm8,%xmm5 +.byte 102,15,56,0,231 + pxor %xmm8,%xmm6 +.byte 102,15,56,0,239 + leaq .LBS0(%rip),%r11 +.byte 102,15,56,0,247 + movl %ebx,%r10d + + call _bsaes_encrypt8_bitslice + + subq $8,%r14 + jc .Lctr_enc_loop_done + + movdqu 0(%r12),%xmm7 + movdqu 16(%r12),%xmm8 + movdqu 32(%r12),%xmm9 + movdqu 48(%r12),%xmm10 + movdqu 64(%r12),%xmm11 + movdqu 80(%r12),%xmm12 + movdqu 96(%r12),%xmm13 + movdqu 112(%r12),%xmm14 + leaq 128(%r12),%r12 + pxor %xmm15,%xmm7 + movdqa 32(%rbp),%xmm15 + pxor %xmm8,%xmm0 + movdqu %xmm7,0(%r13) + pxor %xmm9,%xmm3 + movdqu %xmm0,16(%r13) + pxor %xmm10,%xmm5 + movdqu %xmm3,32(%r13) + pxor %xmm11,%xmm2 + movdqu %xmm5,48(%r13) + pxor %xmm12,%xmm6 + movdqu %xmm2,64(%r13) + pxor %xmm13,%xmm1 + movdqu %xmm6,80(%r13) + pxor %xmm14,%xmm4 + movdqu %xmm1,96(%r13) + leaq .LADD1(%rip),%r11 + movdqu %xmm4,112(%r13) + leaq 128(%r13),%r13 + paddd 112(%r11),%xmm15 + jnz .Lctr_enc_loop + + jmp .Lctr_enc_done +.p2align 4 +.Lctr_enc_loop_done: + addq $8,%r14 + movdqu 0(%r12),%xmm7 + pxor %xmm7,%xmm15 + movdqu %xmm15,0(%r13) + cmpq $2,%r14 + jb .Lctr_enc_done + movdqu 16(%r12),%xmm8 + pxor %xmm8,%xmm0 + movdqu %xmm0,16(%r13) + je .Lctr_enc_done + movdqu 32(%r12),%xmm9 + pxor %xmm9,%xmm3 + movdqu %xmm3,32(%r13) + cmpq $4,%r14 + jb .Lctr_enc_done + movdqu 48(%r12),%xmm10 + pxor %xmm10,%xmm5 + movdqu %xmm5,48(%r13) + je .Lctr_enc_done + movdqu 64(%r12),%xmm11 + pxor %xmm11,%xmm2 + movdqu %xmm2,64(%r13) + cmpq $6,%r14 + jb .Lctr_enc_done + movdqu 80(%r12),%xmm12 + pxor %xmm12,%xmm6 + movdqu %xmm6,80(%r13) + je .Lctr_enc_done + movdqu 96(%r12),%xmm13 + pxor %xmm13,%xmm1 + movdqu %xmm1,96(%r13) + jmp .Lctr_enc_done + +.p2align 4 +.Lctr_enc_short: + leaq 32(%rbp),%rcx + leaq 48(%rbp),%rdx + leaq (%r15),%r8 + call asm_AES_encrypt + movdqu (%r12),%xmm0 + leaq 16(%r12),%r12 + movl 44(%rbp),%eax + bswapl %eax + pxor 48(%rbp),%xmm0 + incl %eax + movdqu %xmm0,(%r13) + bswapl %eax + leaq 16(%r13),%r13 + movl %eax,44(%rsp) + decq %r14 + jnz .Lctr_enc_short + +.Lctr_enc_done: + leaq (%rsp),%rax + pxor %xmm0,%xmm0 +.Lctr_enc_bzero: + movdqa %xmm0,0(%rax) + movdqa %xmm0,16(%rax) + leaq 32(%rax),%rax + cmpq %rax,%rbp + ja .Lctr_enc_bzero + + leaq (%rbp),%rsp + movaps 64(%rbp),%xmm6 + movaps 80(%rbp),%xmm7 + movaps 96(%rbp),%xmm8 + movaps 112(%rbp),%xmm9 + movaps 128(%rbp),%xmm10 + movaps 144(%rbp),%xmm11 + movaps 160(%rbp),%xmm12 + movaps 176(%rbp),%xmm13 + movaps 192(%rbp),%xmm14 + movaps 208(%rbp),%xmm15 + leaq 160(%rbp),%rsp + movq 72(%rsp),%r15 + movq 80(%rsp),%r14 + movq 88(%rsp),%r13 + movq 96(%rsp),%r12 + movq 104(%rsp),%rbx + movq 112(%rsp),%rax + leaq 120(%rsp),%rsp + movq %rax,%rbp +.Lctr_enc_epilogue: + retq + +.globl bsaes_xts_encrypt +.def bsaes_xts_encrypt; .scl 2; .type 32; .endef +.p2align 4 +bsaes_xts_encrypt: + movq %rsp,%rax +.Lxts_enc_prologue: + pushq %rbp + pushq %rbx + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + leaq -72(%rsp),%rsp + movq 160(%rsp),%r10 + movq 168(%rsp),%r11 + leaq -160(%rsp),%rsp + movaps %xmm6,64(%rsp) + movaps %xmm7,80(%rsp) + movaps %xmm8,96(%rsp) + movaps %xmm9,112(%rsp) + movaps %xmm10,128(%rsp) + movaps %xmm11,144(%rsp) + movaps %xmm12,160(%rsp) + movaps %xmm13,176(%rsp) + movaps %xmm14,192(%rsp) + movaps %xmm15,208(%rsp) +.Lxts_enc_body: + movq %rsp,%rbp + movq %rcx,%r12 + movq %rdx,%r13 + movq %r8,%r14 + movq %r9,%r15 + + leaq (%r11),%rcx + leaq 32(%rbp),%rdx + leaq (%r10),%r8 + call asm_AES_encrypt + + movl 240(%r15),%eax + movq %r14,%rbx + + movl %eax,%edx + shlq $7,%rax + subq $96,%rax + subq %rax,%rsp + + movq %rsp,%rax + movq %r15,%rcx + movl %edx,%r10d + call _bsaes_key_convert + pxor %xmm6,%xmm7 + movdqa %xmm7,(%rax) + + andq $-16,%r14 + subq $128,%rsp + movdqa 32(%rbp),%xmm6 + + pxor %xmm14,%xmm14 + movdqa .Lxts_magic(%rip),%xmm12 + pcmpgtd %xmm6,%xmm14 + + subq $128,%r14 + jc .Lxts_enc_short + jmp .Lxts_enc_loop + +.p2align 4 +.Lxts_enc_loop: + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm15 + movdqa %xmm6,0(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm0 + movdqa %xmm6,16(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 0(%r12),%xmm7 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm1 + movdqa %xmm6,32(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 16(%r12),%xmm8 + pxor %xmm7,%xmm15 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm2 + movdqa %xmm6,48(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 32(%r12),%xmm9 + pxor %xmm8,%xmm0 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm3 + movdqa %xmm6,64(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 48(%r12),%xmm10 + pxor %xmm9,%xmm1 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm4 + movdqa %xmm6,80(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 64(%r12),%xmm11 + pxor %xmm10,%xmm2 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm5 + movdqa %xmm6,96(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 80(%r12),%xmm12 + pxor %xmm11,%xmm3 + movdqu 96(%r12),%xmm13 + pxor %xmm12,%xmm4 + movdqu 112(%r12),%xmm14 + leaq 128(%r12),%r12 + movdqa %xmm6,112(%rsp) + pxor %xmm13,%xmm5 + leaq 128(%rsp),%rax + pxor %xmm14,%xmm6 + movl %edx,%r10d + + call _bsaes_encrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm3 + movdqu %xmm0,16(%r13) + pxor 48(%rsp),%xmm5 + movdqu %xmm3,32(%r13) + pxor 64(%rsp),%xmm2 + movdqu %xmm5,48(%r13) + pxor 80(%rsp),%xmm6 + movdqu %xmm2,64(%r13) + pxor 96(%rsp),%xmm1 + movdqu %xmm6,80(%r13) + pxor 112(%rsp),%xmm4 + movdqu %xmm1,96(%r13) + movdqu %xmm4,112(%r13) + leaq 128(%r13),%r13 + + movdqa 112(%rsp),%xmm6 + pxor %xmm14,%xmm14 + movdqa .Lxts_magic(%rip),%xmm12 + pcmpgtd %xmm6,%xmm14 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + + subq $128,%r14 + jnc .Lxts_enc_loop + +.Lxts_enc_short: + addq $128,%r14 + jz .Lxts_enc_done + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm15 + movdqa %xmm6,0(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm0 + movdqa %xmm6,16(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 0(%r12),%xmm7 + cmpq $16,%r14 + je .Lxts_enc_1 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm1 + movdqa %xmm6,32(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 16(%r12),%xmm8 + cmpq $32,%r14 + je .Lxts_enc_2 + pxor %xmm7,%xmm15 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm2 + movdqa %xmm6,48(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 32(%r12),%xmm9 + cmpq $48,%r14 + je .Lxts_enc_3 + pxor %xmm8,%xmm0 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm3 + movdqa %xmm6,64(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 48(%r12),%xmm10 + cmpq $64,%r14 + je .Lxts_enc_4 + pxor %xmm9,%xmm1 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm4 + movdqa %xmm6,80(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 64(%r12),%xmm11 + cmpq $80,%r14 + je .Lxts_enc_5 + pxor %xmm10,%xmm2 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm5 + movdqa %xmm6,96(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 80(%r12),%xmm12 + cmpq $96,%r14 + je .Lxts_enc_6 + pxor %xmm11,%xmm3 + movdqu 96(%r12),%xmm13 + pxor %xmm12,%xmm4 + movdqa %xmm6,112(%rsp) + leaq 112(%r12),%r12 + pxor %xmm13,%xmm5 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_encrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm3 + movdqu %xmm0,16(%r13) + pxor 48(%rsp),%xmm5 + movdqu %xmm3,32(%r13) + pxor 64(%rsp),%xmm2 + movdqu %xmm5,48(%r13) + pxor 80(%rsp),%xmm6 + movdqu %xmm2,64(%r13) + pxor 96(%rsp),%xmm1 + movdqu %xmm6,80(%r13) + movdqu %xmm1,96(%r13) + leaq 112(%r13),%r13 + + movdqa 112(%rsp),%xmm6 + jmp .Lxts_enc_done +.p2align 4 +.Lxts_enc_6: + pxor %xmm11,%xmm3 + leaq 96(%r12),%r12 + pxor %xmm12,%xmm4 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_encrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm3 + movdqu %xmm0,16(%r13) + pxor 48(%rsp),%xmm5 + movdqu %xmm3,32(%r13) + pxor 64(%rsp),%xmm2 + movdqu %xmm5,48(%r13) + pxor 80(%rsp),%xmm6 + movdqu %xmm2,64(%r13) + movdqu %xmm6,80(%r13) + leaq 96(%r13),%r13 + + movdqa 96(%rsp),%xmm6 + jmp .Lxts_enc_done +.p2align 4 +.Lxts_enc_5: + pxor %xmm10,%xmm2 + leaq 80(%r12),%r12 + pxor %xmm11,%xmm3 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_encrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm3 + movdqu %xmm0,16(%r13) + pxor 48(%rsp),%xmm5 + movdqu %xmm3,32(%r13) + pxor 64(%rsp),%xmm2 + movdqu %xmm5,48(%r13) + movdqu %xmm2,64(%r13) + leaq 80(%r13),%r13 + + movdqa 80(%rsp),%xmm6 + jmp .Lxts_enc_done +.p2align 4 +.Lxts_enc_4: + pxor %xmm9,%xmm1 + leaq 64(%r12),%r12 + pxor %xmm10,%xmm2 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_encrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm3 + movdqu %xmm0,16(%r13) + pxor 48(%rsp),%xmm5 + movdqu %xmm3,32(%r13) + movdqu %xmm5,48(%r13) + leaq 64(%r13),%r13 + + movdqa 64(%rsp),%xmm6 + jmp .Lxts_enc_done +.p2align 4 +.Lxts_enc_3: + pxor %xmm8,%xmm0 + leaq 48(%r12),%r12 + pxor %xmm9,%xmm1 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_encrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm3 + movdqu %xmm0,16(%r13) + movdqu %xmm3,32(%r13) + leaq 48(%r13),%r13 + + movdqa 48(%rsp),%xmm6 + jmp .Lxts_enc_done +.p2align 4 +.Lxts_enc_2: + pxor %xmm7,%xmm15 + leaq 32(%r12),%r12 + pxor %xmm8,%xmm0 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_encrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + movdqu %xmm0,16(%r13) + leaq 32(%r13),%r13 + + movdqa 32(%rsp),%xmm6 + jmp .Lxts_enc_done +.p2align 4 +.Lxts_enc_1: + pxor %xmm15,%xmm7 + leaq 16(%r12),%r12 + movdqa %xmm7,32(%rbp) + leaq 32(%rbp),%rcx + leaq 32(%rbp),%rdx + leaq (%r15),%r8 + call asm_AES_encrypt + pxor 32(%rbp),%xmm15 + + + + + + movdqu %xmm15,0(%r13) + leaq 16(%r13),%r13 + + movdqa 16(%rsp),%xmm6 + +.Lxts_enc_done: + andl $15,%ebx + jz .Lxts_enc_ret + movq %r13,%rdx + +.Lxts_enc_steal: + movzbl (%r12),%eax + movzbl -16(%rdx),%ecx + leaq 1(%r12),%r12 + movb %al,-16(%rdx) + movb %cl,0(%rdx) + leaq 1(%rdx),%rdx + subl $1,%ebx + jnz .Lxts_enc_steal + + movdqu -16(%r13),%xmm15 + leaq 32(%rbp),%rcx + pxor %xmm6,%xmm15 + leaq 32(%rbp),%rdx + movdqa %xmm15,32(%rbp) + leaq (%r15),%r8 + call asm_AES_encrypt + pxor 32(%rbp),%xmm6 + movdqu %xmm6,-16(%r13) + +.Lxts_enc_ret: + leaq (%rsp),%rax + pxor %xmm0,%xmm0 +.Lxts_enc_bzero: + movdqa %xmm0,0(%rax) + movdqa %xmm0,16(%rax) + leaq 32(%rax),%rax + cmpq %rax,%rbp + ja .Lxts_enc_bzero + + leaq (%rbp),%rsp + movaps 64(%rbp),%xmm6 + movaps 80(%rbp),%xmm7 + movaps 96(%rbp),%xmm8 + movaps 112(%rbp),%xmm9 + movaps 128(%rbp),%xmm10 + movaps 144(%rbp),%xmm11 + movaps 160(%rbp),%xmm12 + movaps 176(%rbp),%xmm13 + movaps 192(%rbp),%xmm14 + movaps 208(%rbp),%xmm15 + leaq 160(%rbp),%rsp + movq 72(%rsp),%r15 + movq 80(%rsp),%r14 + movq 88(%rsp),%r13 + movq 96(%rsp),%r12 + movq 104(%rsp),%rbx + movq 112(%rsp),%rax + leaq 120(%rsp),%rsp + movq %rax,%rbp +.Lxts_enc_epilogue: + retq + + +.globl bsaes_xts_decrypt +.def bsaes_xts_decrypt; .scl 2; .type 32; .endef +.p2align 4 +bsaes_xts_decrypt: + movq %rsp,%rax +.Lxts_dec_prologue: + pushq %rbp + pushq %rbx + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + leaq -72(%rsp),%rsp + movq 160(%rsp),%r10 + movq 168(%rsp),%r11 + leaq -160(%rsp),%rsp + movaps %xmm6,64(%rsp) + movaps %xmm7,80(%rsp) + movaps %xmm8,96(%rsp) + movaps %xmm9,112(%rsp) + movaps %xmm10,128(%rsp) + movaps %xmm11,144(%rsp) + movaps %xmm12,160(%rsp) + movaps %xmm13,176(%rsp) + movaps %xmm14,192(%rsp) + movaps %xmm15,208(%rsp) +.Lxts_dec_body: + movq %rsp,%rbp + movq %rcx,%r12 + movq %rdx,%r13 + movq %r8,%r14 + movq %r9,%r15 + + leaq (%r11),%rcx + leaq 32(%rbp),%rdx + leaq (%r10),%r8 + call asm_AES_encrypt + + movl 240(%r15),%eax + movq %r14,%rbx + + movl %eax,%edx + shlq $7,%rax + subq $96,%rax + subq %rax,%rsp + + movq %rsp,%rax + movq %r15,%rcx + movl %edx,%r10d + call _bsaes_key_convert + pxor (%rsp),%xmm7 + movdqa %xmm6,(%rax) + movdqa %xmm7,(%rsp) + + xorl %eax,%eax + andq $-16,%r14 + testl $15,%ebx + setnz %al + shlq $4,%rax + subq %rax,%r14 + + subq $128,%rsp + movdqa 32(%rbp),%xmm6 + + pxor %xmm14,%xmm14 + movdqa .Lxts_magic(%rip),%xmm12 + pcmpgtd %xmm6,%xmm14 + + subq $128,%r14 + jc .Lxts_dec_short + jmp .Lxts_dec_loop + +.p2align 4 +.Lxts_dec_loop: + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm15 + movdqa %xmm6,0(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm0 + movdqa %xmm6,16(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 0(%r12),%xmm7 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm1 + movdqa %xmm6,32(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 16(%r12),%xmm8 + pxor %xmm7,%xmm15 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm2 + movdqa %xmm6,48(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 32(%r12),%xmm9 + pxor %xmm8,%xmm0 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm3 + movdqa %xmm6,64(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 48(%r12),%xmm10 + pxor %xmm9,%xmm1 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm4 + movdqa %xmm6,80(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 64(%r12),%xmm11 + pxor %xmm10,%xmm2 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm5 + movdqa %xmm6,96(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 80(%r12),%xmm12 + pxor %xmm11,%xmm3 + movdqu 96(%r12),%xmm13 + pxor %xmm12,%xmm4 + movdqu 112(%r12),%xmm14 + leaq 128(%r12),%r12 + movdqa %xmm6,112(%rsp) + pxor %xmm13,%xmm5 + leaq 128(%rsp),%rax + pxor %xmm14,%xmm6 + movl %edx,%r10d + + call _bsaes_decrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm5 + movdqu %xmm0,16(%r13) + pxor 48(%rsp),%xmm3 + movdqu %xmm5,32(%r13) + pxor 64(%rsp),%xmm1 + movdqu %xmm3,48(%r13) + pxor 80(%rsp),%xmm6 + movdqu %xmm1,64(%r13) + pxor 96(%rsp),%xmm2 + movdqu %xmm6,80(%r13) + pxor 112(%rsp),%xmm4 + movdqu %xmm2,96(%r13) + movdqu %xmm4,112(%r13) + leaq 128(%r13),%r13 + + movdqa 112(%rsp),%xmm6 + pxor %xmm14,%xmm14 + movdqa .Lxts_magic(%rip),%xmm12 + pcmpgtd %xmm6,%xmm14 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + + subq $128,%r14 + jnc .Lxts_dec_loop + +.Lxts_dec_short: + addq $128,%r14 + jz .Lxts_dec_done + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm15 + movdqa %xmm6,0(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm0 + movdqa %xmm6,16(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 0(%r12),%xmm7 + cmpq $16,%r14 + je .Lxts_dec_1 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm1 + movdqa %xmm6,32(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 16(%r12),%xmm8 + cmpq $32,%r14 + je .Lxts_dec_2 + pxor %xmm7,%xmm15 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm2 + movdqa %xmm6,48(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 32(%r12),%xmm9 + cmpq $48,%r14 + je .Lxts_dec_3 + pxor %xmm8,%xmm0 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm3 + movdqa %xmm6,64(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 48(%r12),%xmm10 + cmpq $64,%r14 + je .Lxts_dec_4 + pxor %xmm9,%xmm1 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm4 + movdqa %xmm6,80(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 64(%r12),%xmm11 + cmpq $80,%r14 + je .Lxts_dec_5 + pxor %xmm10,%xmm2 + pshufd $19,%xmm14,%xmm13 + pxor %xmm14,%xmm14 + movdqa %xmm6,%xmm5 + movdqa %xmm6,96(%rsp) + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + pcmpgtd %xmm6,%xmm14 + pxor %xmm13,%xmm6 + movdqu 80(%r12),%xmm12 + cmpq $96,%r14 + je .Lxts_dec_6 + pxor %xmm11,%xmm3 + movdqu 96(%r12),%xmm13 + pxor %xmm12,%xmm4 + movdqa %xmm6,112(%rsp) + leaq 112(%r12),%r12 + pxor %xmm13,%xmm5 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_decrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm5 + movdqu %xmm0,16(%r13) + pxor 48(%rsp),%xmm3 + movdqu %xmm5,32(%r13) + pxor 64(%rsp),%xmm1 + movdqu %xmm3,48(%r13) + pxor 80(%rsp),%xmm6 + movdqu %xmm1,64(%r13) + pxor 96(%rsp),%xmm2 + movdqu %xmm6,80(%r13) + movdqu %xmm2,96(%r13) + leaq 112(%r13),%r13 + + movdqa 112(%rsp),%xmm6 + jmp .Lxts_dec_done +.p2align 4 +.Lxts_dec_6: + pxor %xmm11,%xmm3 + leaq 96(%r12),%r12 + pxor %xmm12,%xmm4 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_decrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm5 + movdqu %xmm0,16(%r13) + pxor 48(%rsp),%xmm3 + movdqu %xmm5,32(%r13) + pxor 64(%rsp),%xmm1 + movdqu %xmm3,48(%r13) + pxor 80(%rsp),%xmm6 + movdqu %xmm1,64(%r13) + movdqu %xmm6,80(%r13) + leaq 96(%r13),%r13 + + movdqa 96(%rsp),%xmm6 + jmp .Lxts_dec_done +.p2align 4 +.Lxts_dec_5: + pxor %xmm10,%xmm2 + leaq 80(%r12),%r12 + pxor %xmm11,%xmm3 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_decrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm5 + movdqu %xmm0,16(%r13) + pxor 48(%rsp),%xmm3 + movdqu %xmm5,32(%r13) + pxor 64(%rsp),%xmm1 + movdqu %xmm3,48(%r13) + movdqu %xmm1,64(%r13) + leaq 80(%r13),%r13 + + movdqa 80(%rsp),%xmm6 + jmp .Lxts_dec_done +.p2align 4 +.Lxts_dec_4: + pxor %xmm9,%xmm1 + leaq 64(%r12),%r12 + pxor %xmm10,%xmm2 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_decrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm5 + movdqu %xmm0,16(%r13) + pxor 48(%rsp),%xmm3 + movdqu %xmm5,32(%r13) + movdqu %xmm3,48(%r13) + leaq 64(%r13),%r13 + + movdqa 64(%rsp),%xmm6 + jmp .Lxts_dec_done +.p2align 4 +.Lxts_dec_3: + pxor %xmm8,%xmm0 + leaq 48(%r12),%r12 + pxor %xmm9,%xmm1 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_decrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + pxor 32(%rsp),%xmm5 + movdqu %xmm0,16(%r13) + movdqu %xmm5,32(%r13) + leaq 48(%r13),%r13 + + movdqa 48(%rsp),%xmm6 + jmp .Lxts_dec_done +.p2align 4 +.Lxts_dec_2: + pxor %xmm7,%xmm15 + leaq 32(%r12),%r12 + pxor %xmm8,%xmm0 + leaq 128(%rsp),%rax + movl %edx,%r10d + + call _bsaes_decrypt8 + + pxor 0(%rsp),%xmm15 + pxor 16(%rsp),%xmm0 + movdqu %xmm15,0(%r13) + movdqu %xmm0,16(%r13) + leaq 32(%r13),%r13 + + movdqa 32(%rsp),%xmm6 + jmp .Lxts_dec_done +.p2align 4 +.Lxts_dec_1: + pxor %xmm15,%xmm7 + leaq 16(%r12),%r12 + movdqa %xmm7,32(%rbp) + leaq 32(%rbp),%rcx + leaq 32(%rbp),%rdx + leaq (%r15),%r8 + call asm_AES_decrypt + pxor 32(%rbp),%xmm15 + + + + + + movdqu %xmm15,0(%r13) + leaq 16(%r13),%r13 + + movdqa 16(%rsp),%xmm6 + +.Lxts_dec_done: + andl $15,%ebx + jz .Lxts_dec_ret + + pxor %xmm14,%xmm14 + movdqa .Lxts_magic(%rip),%xmm12 + pcmpgtd %xmm6,%xmm14 + pshufd $19,%xmm14,%xmm13 + movdqa %xmm6,%xmm5 + paddq %xmm6,%xmm6 + pand %xmm12,%xmm13 + movdqu (%r12),%xmm15 + pxor %xmm13,%xmm6 + + leaq 32(%rbp),%rcx + pxor %xmm6,%xmm15 + leaq 32(%rbp),%rdx + movdqa %xmm15,32(%rbp) + leaq (%r15),%r8 + call asm_AES_decrypt + pxor 32(%rbp),%xmm6 + movq %r13,%rdx + movdqu %xmm6,(%r13) + +.Lxts_dec_steal: + movzbl 16(%r12),%eax + movzbl (%rdx),%ecx + leaq 1(%r12),%r12 + movb %al,(%rdx) + movb %cl,16(%rdx) + leaq 1(%rdx),%rdx + subl $1,%ebx + jnz .Lxts_dec_steal + + movdqu (%r13),%xmm15 + leaq 32(%rbp),%rcx + pxor %xmm5,%xmm15 + leaq 32(%rbp),%rdx + movdqa %xmm15,32(%rbp) + leaq (%r15),%r8 + call asm_AES_decrypt + pxor 32(%rbp),%xmm5 + movdqu %xmm5,(%r13) + +.Lxts_dec_ret: + leaq (%rsp),%rax + pxor %xmm0,%xmm0 +.Lxts_dec_bzero: + movdqa %xmm0,0(%rax) + movdqa %xmm0,16(%rax) + leaq 32(%rax),%rax + cmpq %rax,%rbp + ja .Lxts_dec_bzero + + leaq (%rbp),%rsp + movaps 64(%rbp),%xmm6 + movaps 80(%rbp),%xmm7 + movaps 96(%rbp),%xmm8 + movaps 112(%rbp),%xmm9 + movaps 128(%rbp),%xmm10 + movaps 144(%rbp),%xmm11 + movaps 160(%rbp),%xmm12 + movaps 176(%rbp),%xmm13 + movaps 192(%rbp),%xmm14 + movaps 208(%rbp),%xmm15 + leaq 160(%rbp),%rsp + movq 72(%rsp),%r15 + movq 80(%rsp),%r14 + movq 88(%rsp),%r13 + movq 96(%rsp),%r12 + movq 104(%rsp),%rbx + movq 112(%rsp),%rax + leaq 120(%rsp),%rsp + movq %rax,%rbp +.Lxts_dec_epilogue: + retq + + +.p2align 6 +_bsaes_const: +.LM0ISR: +.quad 0x0a0e0206070b0f03, 0x0004080c0d010509 +.LISRM0: +.quad 0x01040b0e0205080f, 0x0306090c00070a0d +.LISR: +.quad 0x0504070602010003, 0x0f0e0d0c080b0a09 +.LBS0: +.quad 0x5555555555555555, 0x5555555555555555 +.LBS1: +.quad 0x3333333333333333, 0x3333333333333333 +.LBS2: +.quad 0x0f0f0f0f0f0f0f0f, 0x0f0f0f0f0f0f0f0f +.LSR: +.quad 0x0504070600030201, 0x0f0e0d0c0a09080b +.LSRM0: +.quad 0x0304090e00050a0f, 0x01060b0c0207080d +.LM0SR: +.quad 0x0a0e02060f03070b, 0x0004080c05090d01 +.LSWPUP: +.quad 0x0706050403020100, 0x0c0d0e0f0b0a0908 +.LSWPUPM0SR: +.quad 0x0a0d02060c03070b, 0x0004080f05090e01 +.LADD1: +.quad 0x0000000000000000, 0x0000000100000000 +.LADD2: +.quad 0x0000000000000000, 0x0000000200000000 +.LADD3: +.quad 0x0000000000000000, 0x0000000300000000 +.LADD4: +.quad 0x0000000000000000, 0x0000000400000000 +.LADD5: +.quad 0x0000000000000000, 0x0000000500000000 +.LADD6: +.quad 0x0000000000000000, 0x0000000600000000 +.LADD7: +.quad 0x0000000000000000, 0x0000000700000000 +.LADD8: +.quad 0x0000000000000000, 0x0000000800000000 +.Lxts_magic: +.long 0x87,0,1,0 +.Lmasks: +.quad 0x0101010101010101, 0x0101010101010101 +.quad 0x0202020202020202, 0x0202020202020202 +.quad 0x0404040404040404, 0x0404040404040404 +.quad 0x0808080808080808, 0x0808080808080808 +.LM0: +.quad 0x02060a0e03070b0f, 0x0004080c0105090d +.L63: +.quad 0x6363636363636363, 0x6363636363636363 +.byte 66,105,116,45,115,108,105,99,101,100,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,69,109,105,108,105,97,32,75,195,164,115,112,101,114,44,32,80,101,116,101,114,32,83,99,104,119,97,98,101,44,32,65,110,100,121,32,80,111,108,121,97,107,111,118,0 +.p2align 6 + + +.def se_handler; .scl 3; .type 32; .endef +.p2align 4 +se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + movq 8(%r9),%rsi + movq 56(%r9),%r11 + + movl 0(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jb .Lin_prologue + + movq 152(%r8),%rax + + movl 4(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jae .Lin_prologue + + movq 160(%r8),%rax + + leaq 64(%rax),%rsi + leaq 512(%r8),%rdi + movl $20,%ecx +.long 0xa548f3fc + leaq 160(%rax),%rax + + movq 112(%rax),%rbp + movq 104(%rax),%rbx + movq 96(%rax),%r12 + movq 88(%rax),%r13 + movq 80(%rax),%r14 + movq 72(%rax),%r15 + leaq 120(%rax),%rax + movq %rbx,144(%r8) + movq %rbp,160(%r8) + movq %r12,216(%r8) + movq %r13,224(%r8) + movq %r14,232(%r8) + movq %r15,240(%r8) + +.Lin_prologue: + movq %rax,152(%r8) + + movq 40(%r9),%rdi + movq %r8,%rsi + movl $154,%ecx +.long 0xa548f3fc + + movq %r9,%rsi + xorq %rcx,%rcx + movq 8(%rsi),%rdx + movq 0(%rsi),%r8 + movq 16(%rsi),%r9 + movq 40(%rsi),%r10 + leaq 56(%rsi),%r11 + leaq 24(%rsi),%r12 + movq %r10,32(%rsp) + movq %r11,40(%rsp) + movq %r12,48(%rsp) + movq %rcx,56(%rsp) + call *__imp_RtlVirtualUnwind(%rip) + + movl $1,%eax + addq $64,%rsp + popfq + popq %r15 + popq %r14 + popq %r13 + popq %r12 + popq %rbp + popq %rbx + popq %rdi + popq %rsi + retq + + +.section .pdata +.p2align 2 +.rva .Lcbc_dec_prologue +.rva .Lcbc_dec_epilogue +.rva .Lcbc_dec_info + +.rva .Lctr_enc_prologue +.rva .Lctr_enc_epilogue +.rva .Lctr_enc_info + +.rva .Lxts_enc_prologue +.rva .Lxts_enc_epilogue +.rva .Lxts_enc_info + +.rva .Lxts_dec_prologue +.rva .Lxts_dec_epilogue +.rva .Lxts_dec_info + +.section .xdata +.p2align 3 +.Lcbc_dec_info: +.byte 9,0,0,0 +.rva se_handler +.rva .Lcbc_dec_body,.Lcbc_dec_epilogue +.Lctr_enc_info: +.byte 9,0,0,0 +.rva se_handler +.rva .Lctr_enc_body,.Lctr_enc_epilogue +.Lxts_enc_info: +.byte 9,0,0,0 +.rva se_handler +.rva .Lxts_enc_body,.Lxts_enc_epilogue +.Lxts_dec_info: +.byte 9,0,0,0 +.rva se_handler +.rva .Lxts_dec_body,.Lxts_dec_epilogue diff --git a/crypto/aes/vpaes-elf-x86_64.S b/crypto/aes/vpaes-elf-x86_64.S index 90032ba6..1e1a6e85 100644 --- a/crypto/aes/vpaes-elf-x86_64.S +++ b/crypto/aes/vpaes-elf-x86_64.S @@ -98,7 +98,7 @@ _vpaes_encrypt_core: movdqa 64(%r11,%r10,1),%xmm1 pxor %xmm4,%xmm0 .byte 102,15,56,0,193 - .byte 0xf3,0xc3 + retq .size _vpaes_encrypt_core,.-_vpaes_encrypt_core @@ -205,7 +205,7 @@ _vpaes_decrypt_core: .byte 102,15,56,0,195 pxor %xmm4,%xmm0 .byte 102,15,56,0,194 - .byte 0xf3,0xc3 + retq .size _vpaes_decrypt_core,.-_vpaes_decrypt_core @@ -381,7 +381,7 @@ _vpaes_schedule_core: pxor %xmm5,%xmm5 pxor %xmm6,%xmm6 pxor %xmm7,%xmm7 - .byte 0xf3,0xc3 + retq .size _vpaes_schedule_core,.-_vpaes_schedule_core @@ -408,7 +408,7 @@ _vpaes_schedule_192_smear: movdqa %xmm6,%xmm0 pxor %xmm1,%xmm1 movhlps %xmm1,%xmm6 - .byte 0xf3,0xc3 + retq .size _vpaes_schedule_192_smear,.-_vpaes_schedule_192_smear @@ -484,7 +484,7 @@ _vpaes_schedule_low_round: pxor %xmm7,%xmm0 movdqa %xmm0,%xmm7 - .byte 0xf3,0xc3 + retq .size _vpaes_schedule_round,.-_vpaes_schedule_round @@ -508,7 +508,7 @@ _vpaes_schedule_transform: movdqa 16(%r11),%xmm0 .byte 102,15,56,0,193 pxor %xmm2,%xmm0 - .byte 0xf3,0xc3 + retq .size _vpaes_schedule_transform,.-_vpaes_schedule_transform @@ -600,7 +600,7 @@ _vpaes_schedule_mangle: addq $-16,%r8 andq $48,%r8 movdqu %xmm3,(%rdx) - .byte 0xf3,0xc3 + retq .size _vpaes_schedule_mangle,.-_vpaes_schedule_mangle @@ -619,7 +619,7 @@ vpaes_set_encrypt_key: movl $48,%r8d call _vpaes_schedule_core xorl %eax,%eax - .byte 0xf3,0xc3 + retq .size vpaes_set_encrypt_key,.-vpaes_set_encrypt_key .globl vpaes_set_decrypt_key @@ -640,7 +640,7 @@ vpaes_set_decrypt_key: xorl $32,%r8d call _vpaes_schedule_core xorl %eax,%eax - .byte 0xf3,0xc3 + retq .size vpaes_set_decrypt_key,.-vpaes_set_decrypt_key .globl vpaes_encrypt @@ -651,7 +651,7 @@ vpaes_encrypt: call _vpaes_preheat call _vpaes_encrypt_core movdqu %xmm0,(%rsi) - .byte 0xf3,0xc3 + retq .size vpaes_encrypt,.-vpaes_encrypt .globl vpaes_decrypt @@ -662,7 +662,7 @@ vpaes_decrypt: call _vpaes_preheat call _vpaes_decrypt_core movdqu %xmm0,(%rsi) - .byte 0xf3,0xc3 + retq .size vpaes_decrypt,.-vpaes_decrypt .globl vpaes_cbc_encrypt .type vpaes_cbc_encrypt,@function @@ -702,7 +702,7 @@ vpaes_cbc_encrypt: .Lcbc_done: movdqu %xmm6,(%r8) .Lcbc_abort: - .byte 0xf3,0xc3 + retq .size vpaes_cbc_encrypt,.-vpaes_cbc_encrypt @@ -721,7 +721,7 @@ _vpaes_preheat: movdqa 64(%r10),%xmm12 movdqa 80(%r10),%xmm15 movdqa 96(%r10),%xmm14 - .byte 0xf3,0xc3 + retq .size _vpaes_preheat,.-_vpaes_preheat diff --git a/crypto/aes/vpaes-macosx-x86_64.S b/crypto/aes/vpaes-macosx-x86_64.S index 8b49fc7c..0a892a9d 100644 --- a/crypto/aes/vpaes-macosx-x86_64.S +++ b/crypto/aes/vpaes-macosx-x86_64.S @@ -98,7 +98,7 @@ L$enc_entry: movdqa 64(%r11,%r10,1),%xmm1 pxor %xmm4,%xmm0 .byte 102,15,56,0,193 - .byte 0xf3,0xc3 + retq @@ -205,7 +205,7 @@ L$dec_entry: .byte 102,15,56,0,195 pxor %xmm4,%xmm0 .byte 102,15,56,0,194 - .byte 0xf3,0xc3 + retq @@ -381,7 +381,7 @@ L$schedule_mangle_last_dec: pxor %xmm5,%xmm5 pxor %xmm6,%xmm6 pxor %xmm7,%xmm7 - .byte 0xf3,0xc3 + retq @@ -408,7 +408,7 @@ _vpaes_schedule_192_smear: movdqa %xmm6,%xmm0 pxor %xmm1,%xmm1 movhlps %xmm1,%xmm6 - .byte 0xf3,0xc3 + retq @@ -484,7 +484,7 @@ _vpaes_schedule_low_round: pxor %xmm7,%xmm0 movdqa %xmm0,%xmm7 - .byte 0xf3,0xc3 + retq @@ -508,7 +508,7 @@ _vpaes_schedule_transform: movdqa 16(%r11),%xmm0 .byte 102,15,56,0,193 pxor %xmm2,%xmm0 - .byte 0xf3,0xc3 + retq @@ -600,7 +600,7 @@ L$schedule_mangle_both: addq $-16,%r8 andq $48,%r8 movdqu %xmm3,(%rdx) - .byte 0xf3,0xc3 + retq @@ -619,7 +619,7 @@ _vpaes_set_encrypt_key: movl $48,%r8d call _vpaes_schedule_core xorl %eax,%eax - .byte 0xf3,0xc3 + retq .globl _vpaes_set_decrypt_key @@ -640,7 +640,7 @@ _vpaes_set_decrypt_key: xorl $32,%r8d call _vpaes_schedule_core xorl %eax,%eax - .byte 0xf3,0xc3 + retq .globl _vpaes_encrypt @@ -651,7 +651,7 @@ _vpaes_encrypt: call _vpaes_preheat call _vpaes_encrypt_core movdqu %xmm0,(%rsi) - .byte 0xf3,0xc3 + retq .globl _vpaes_decrypt @@ -662,7 +662,7 @@ _vpaes_decrypt: call _vpaes_preheat call _vpaes_decrypt_core movdqu %xmm0,(%rsi) - .byte 0xf3,0xc3 + retq .globl _vpaes_cbc_encrypt @@ -702,7 +702,7 @@ L$cbc_dec_loop: L$cbc_done: movdqu %xmm6,(%r8) L$cbc_abort: - .byte 0xf3,0xc3 + retq @@ -721,7 +721,7 @@ _vpaes_preheat: movdqa 64(%r10),%xmm12 movdqa 80(%r10),%xmm15 movdqa 96(%r10),%xmm14 - .byte 0xf3,0xc3 + retq diff --git a/crypto/aes/vpaes-masm-x86_64.S b/crypto/aes/vpaes-masm-x86_64.S new file mode 100644 index 00000000..632b1dfa --- /dev/null +++ b/crypto/aes/vpaes-masm-x86_64.S @@ -0,0 +1,1145 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + + + + + + + + + + + + + + + + + +ALIGN 16 +_vpaes_encrypt_core PROC PRIVATE + mov r9,rdx + mov r11,16 + mov eax,DWORD PTR[240+rdx] + movdqa xmm1,xmm9 + movdqa xmm2,XMMWORD PTR[$L$k_ipt] + pandn xmm1,xmm0 + movdqu xmm5,XMMWORD PTR[r9] + psrld xmm1,4 + pand xmm0,xmm9 +DB 102,15,56,0,208 + movdqa xmm0,XMMWORD PTR[(($L$k_ipt+16))] +DB 102,15,56,0,193 + pxor xmm2,xmm5 + pxor xmm0,xmm2 + add r9,16 + lea r10,QWORD PTR[$L$k_mc_backward] + jmp $L$enc_entry + +ALIGN 16 +$L$enc_loop:: + + movdqa xmm4,xmm13 +DB 102,15,56,0,226 + pxor xmm4,xmm5 + movdqa xmm0,xmm12 +DB 102,15,56,0,195 + pxor xmm0,xmm4 + movdqa xmm5,xmm15 +DB 102,15,56,0,234 + movdqa xmm1,XMMWORD PTR[((-64))+r10*1+r11] + movdqa xmm2,xmm14 +DB 102,15,56,0,211 + pxor xmm2,xmm5 + movdqa xmm4,XMMWORD PTR[r10*1+r11] + movdqa xmm3,xmm0 +DB 102,15,56,0,193 + add r9,16 + pxor xmm0,xmm2 +DB 102,15,56,0,220 + add r11,16 + pxor xmm3,xmm0 +DB 102,15,56,0,193 + and r11,030h + pxor xmm0,xmm3 + sub rax,1 + +$L$enc_entry:: + + movdqa xmm1,xmm9 + pandn xmm1,xmm0 + psrld xmm1,4 + pand xmm0,xmm9 + movdqa xmm5,xmm11 +DB 102,15,56,0,232 + pxor xmm0,xmm1 + movdqa xmm3,xmm10 +DB 102,15,56,0,217 + pxor xmm3,xmm5 + movdqa xmm4,xmm10 +DB 102,15,56,0,224 + pxor xmm4,xmm5 + movdqa xmm2,xmm10 +DB 102,15,56,0,211 + pxor xmm2,xmm0 + movdqa xmm3,xmm10 + movdqu xmm5,XMMWORD PTR[r9] +DB 102,15,56,0,220 + pxor xmm3,xmm1 + jnz $L$enc_loop + + + movdqa xmm4,XMMWORD PTR[((-96))+r10] + movdqa xmm0,XMMWORD PTR[((-80))+r10] +DB 102,15,56,0,226 + pxor xmm4,xmm5 +DB 102,15,56,0,195 + movdqa xmm1,XMMWORD PTR[64+r10*1+r11] + pxor xmm0,xmm4 +DB 102,15,56,0,193 + DB 0F3h,0C3h ;repret +_vpaes_encrypt_core ENDP + + + + + + + +ALIGN 16 +_vpaes_decrypt_core PROC PRIVATE + mov r9,rdx + mov eax,DWORD PTR[240+rdx] + movdqa xmm1,xmm9 + movdqa xmm2,XMMWORD PTR[$L$k_dipt] + pandn xmm1,xmm0 + mov r11,rax + psrld xmm1,4 + movdqu xmm5,XMMWORD PTR[r9] + shl r11,4 + pand xmm0,xmm9 +DB 102,15,56,0,208 + movdqa xmm0,XMMWORD PTR[(($L$k_dipt+16))] + xor r11,030h + lea r10,QWORD PTR[$L$k_dsbd] +DB 102,15,56,0,193 + and r11,030h + pxor xmm2,xmm5 + movdqa xmm5,XMMWORD PTR[(($L$k_mc_forward+48))] + pxor xmm0,xmm2 + add r9,16 + add r11,r10 + jmp $L$dec_entry + +ALIGN 16 +$L$dec_loop:: + + + + movdqa xmm4,XMMWORD PTR[((-32))+r10] +DB 102,15,56,0,226 + pxor xmm4,xmm0 + movdqa xmm0,XMMWORD PTR[((-16))+r10] +DB 102,15,56,0,195 + pxor xmm0,xmm4 + add r9,16 + +DB 102,15,56,0,197 + movdqa xmm4,XMMWORD PTR[r10] +DB 102,15,56,0,226 + pxor xmm4,xmm0 + movdqa xmm0,XMMWORD PTR[16+r10] +DB 102,15,56,0,195 + pxor xmm0,xmm4 + sub rax,1 + +DB 102,15,56,0,197 + movdqa xmm4,XMMWORD PTR[32+r10] +DB 102,15,56,0,226 + pxor xmm4,xmm0 + movdqa xmm0,XMMWORD PTR[48+r10] +DB 102,15,56,0,195 + pxor xmm0,xmm4 + +DB 102,15,56,0,197 + movdqa xmm4,XMMWORD PTR[64+r10] +DB 102,15,56,0,226 + pxor xmm4,xmm0 + movdqa xmm0,XMMWORD PTR[80+r10] +DB 102,15,56,0,195 + pxor xmm0,xmm4 + +DB 102,15,58,15,237,12 + +$L$dec_entry:: + + movdqa xmm1,xmm9 + pandn xmm1,xmm0 + psrld xmm1,4 + pand xmm0,xmm9 + movdqa xmm2,xmm11 +DB 102,15,56,0,208 + pxor xmm0,xmm1 + movdqa xmm3,xmm10 +DB 102,15,56,0,217 + pxor xmm3,xmm2 + movdqa xmm4,xmm10 +DB 102,15,56,0,224 + pxor xmm4,xmm2 + movdqa xmm2,xmm10 +DB 102,15,56,0,211 + pxor xmm2,xmm0 + movdqa xmm3,xmm10 +DB 102,15,56,0,220 + pxor xmm3,xmm1 + movdqu xmm0,XMMWORD PTR[r9] + jnz $L$dec_loop + + + movdqa xmm4,XMMWORD PTR[96+r10] +DB 102,15,56,0,226 + pxor xmm4,xmm0 + movdqa xmm0,XMMWORD PTR[112+r10] + movdqa xmm2,XMMWORD PTR[((-352))+r11] +DB 102,15,56,0,195 + pxor xmm0,xmm4 +DB 102,15,56,0,194 + DB 0F3h,0C3h ;repret +_vpaes_decrypt_core ENDP + + + + + + + +ALIGN 16 +_vpaes_schedule_core PROC PRIVATE + + + + + + call _vpaes_preheat + movdqa xmm8,XMMWORD PTR[$L$k_rcon] + movdqu xmm0,XMMWORD PTR[rdi] + + + movdqa xmm3,xmm0 + lea r11,QWORD PTR[$L$k_ipt] + call _vpaes_schedule_transform + movdqa xmm7,xmm0 + + lea r10,QWORD PTR[$L$k_sr] + test rcx,rcx + jnz $L$schedule_am_decrypting + + + movdqu XMMWORD PTR[rdx],xmm0 + jmp $L$schedule_go + +$L$schedule_am_decrypting:: + + movdqa xmm1,XMMWORD PTR[r10*1+r8] +DB 102,15,56,0,217 + movdqu XMMWORD PTR[rdx],xmm3 + xor r8,030h + +$L$schedule_go:: + cmp esi,192 + ja $L$schedule_256 + je $L$schedule_192 + + + + + + + + + + +$L$schedule_128:: + mov esi,10 + +$L$oop_schedule_128:: + call _vpaes_schedule_round + dec rsi + jz $L$schedule_mangle_last + call _vpaes_schedule_mangle + jmp $L$oop_schedule_128 + + + + + + + + + + + + + + + + +ALIGN 16 +$L$schedule_192:: + movdqu xmm0,XMMWORD PTR[8+rdi] + call _vpaes_schedule_transform + movdqa xmm6,xmm0 + pxor xmm4,xmm4 + movhlps xmm6,xmm4 + mov esi,4 + +$L$oop_schedule_192:: + call _vpaes_schedule_round +DB 102,15,58,15,198,8 + call _vpaes_schedule_mangle + call _vpaes_schedule_192_smear + call _vpaes_schedule_mangle + call _vpaes_schedule_round + dec rsi + jz $L$schedule_mangle_last + call _vpaes_schedule_mangle + call _vpaes_schedule_192_smear + jmp $L$oop_schedule_192 + + + + + + + + + + + +ALIGN 16 +$L$schedule_256:: + movdqu xmm0,XMMWORD PTR[16+rdi] + call _vpaes_schedule_transform + mov esi,7 + +$L$oop_schedule_256:: + call _vpaes_schedule_mangle + movdqa xmm6,xmm0 + + + call _vpaes_schedule_round + dec rsi + jz $L$schedule_mangle_last + call _vpaes_schedule_mangle + + + pshufd xmm0,xmm0,0FFh + movdqa xmm5,xmm7 + movdqa xmm7,xmm6 + call _vpaes_schedule_low_round + movdqa xmm7,xmm5 + + jmp $L$oop_schedule_256 + + + + + + + + + + + + +ALIGN 16 +$L$schedule_mangle_last:: + + lea r11,QWORD PTR[$L$k_deskew] + test rcx,rcx + jnz $L$schedule_mangle_last_dec + + + movdqa xmm1,XMMWORD PTR[r10*1+r8] +DB 102,15,56,0,193 + lea r11,QWORD PTR[$L$k_opt] + add rdx,32 + +$L$schedule_mangle_last_dec:: + add rdx,-16 + pxor xmm0,XMMWORD PTR[$L$k_s63] + call _vpaes_schedule_transform + movdqu XMMWORD PTR[rdx],xmm0 + + + pxor xmm0,xmm0 + pxor xmm1,xmm1 + pxor xmm2,xmm2 + pxor xmm3,xmm3 + pxor xmm4,xmm4 + pxor xmm5,xmm5 + pxor xmm6,xmm6 + pxor xmm7,xmm7 + DB 0F3h,0C3h ;repret +_vpaes_schedule_core ENDP + + + + + + + + + + + + + + + + +ALIGN 16 +_vpaes_schedule_192_smear PROC PRIVATE + pshufd xmm0,xmm6,080h + pxor xmm6,xmm0 + pshufd xmm0,xmm7,0FEh + pxor xmm6,xmm0 + movdqa xmm0,xmm6 + pxor xmm1,xmm1 + movhlps xmm6,xmm1 + DB 0F3h,0C3h ;repret +_vpaes_schedule_192_smear ENDP + + + + + + + + + + + + + + + + + + + + +ALIGN 16 +_vpaes_schedule_round PROC PRIVATE + + pxor xmm1,xmm1 +DB 102,65,15,58,15,200,15 +DB 102,69,15,58,15,192,15 + pxor xmm7,xmm1 + + + pshufd xmm0,xmm0,0FFh +DB 102,15,58,15,192,1 + + + + +_vpaes_schedule_low_round:: + + movdqa xmm1,xmm7 + pslldq xmm7,4 + pxor xmm7,xmm1 + movdqa xmm1,xmm7 + pslldq xmm7,8 + pxor xmm7,xmm1 + pxor xmm7,XMMWORD PTR[$L$k_s63] + + + movdqa xmm1,xmm9 + pandn xmm1,xmm0 + psrld xmm1,4 + pand xmm0,xmm9 + movdqa xmm2,xmm11 +DB 102,15,56,0,208 + pxor xmm0,xmm1 + movdqa xmm3,xmm10 +DB 102,15,56,0,217 + pxor xmm3,xmm2 + movdqa xmm4,xmm10 +DB 102,15,56,0,224 + pxor xmm4,xmm2 + movdqa xmm2,xmm10 +DB 102,15,56,0,211 + pxor xmm2,xmm0 + movdqa xmm3,xmm10 +DB 102,15,56,0,220 + pxor xmm3,xmm1 + movdqa xmm4,xmm13 +DB 102,15,56,0,226 + movdqa xmm0,xmm12 +DB 102,15,56,0,195 + pxor xmm0,xmm4 + + + pxor xmm0,xmm7 + movdqa xmm7,xmm0 + DB 0F3h,0C3h ;repret +_vpaes_schedule_round ENDP + + + + + + + + + + + +ALIGN 16 +_vpaes_schedule_transform PROC PRIVATE + movdqa xmm1,xmm9 + pandn xmm1,xmm0 + psrld xmm1,4 + pand xmm0,xmm9 + movdqa xmm2,XMMWORD PTR[r11] +DB 102,15,56,0,208 + movdqa xmm0,XMMWORD PTR[16+r11] +DB 102,15,56,0,193 + pxor xmm0,xmm2 + DB 0F3h,0C3h ;repret +_vpaes_schedule_transform ENDP + + + + + + + + + + + + + + + + + + + + + + + + + +ALIGN 16 +_vpaes_schedule_mangle PROC PRIVATE + movdqa xmm4,xmm0 + movdqa xmm5,XMMWORD PTR[$L$k_mc_forward] + test rcx,rcx + jnz $L$schedule_mangle_dec + + + add rdx,16 + pxor xmm4,XMMWORD PTR[$L$k_s63] +DB 102,15,56,0,229 + movdqa xmm3,xmm4 +DB 102,15,56,0,229 + pxor xmm3,xmm4 +DB 102,15,56,0,229 + pxor xmm3,xmm4 + + jmp $L$schedule_mangle_both +ALIGN 16 +$L$schedule_mangle_dec:: + + lea r11,QWORD PTR[$L$k_dksd] + movdqa xmm1,xmm9 + pandn xmm1,xmm4 + psrld xmm1,4 + pand xmm4,xmm9 + + movdqa xmm2,XMMWORD PTR[r11] +DB 102,15,56,0,212 + movdqa xmm3,XMMWORD PTR[16+r11] +DB 102,15,56,0,217 + pxor xmm3,xmm2 +DB 102,15,56,0,221 + + movdqa xmm2,XMMWORD PTR[32+r11] +DB 102,15,56,0,212 + pxor xmm2,xmm3 + movdqa xmm3,XMMWORD PTR[48+r11] +DB 102,15,56,0,217 + pxor xmm3,xmm2 +DB 102,15,56,0,221 + + movdqa xmm2,XMMWORD PTR[64+r11] +DB 102,15,56,0,212 + pxor xmm2,xmm3 + movdqa xmm3,XMMWORD PTR[80+r11] +DB 102,15,56,0,217 + pxor xmm3,xmm2 +DB 102,15,56,0,221 + + movdqa xmm2,XMMWORD PTR[96+r11] +DB 102,15,56,0,212 + pxor xmm2,xmm3 + movdqa xmm3,XMMWORD PTR[112+r11] +DB 102,15,56,0,217 + pxor xmm3,xmm2 + + add rdx,-16 + +$L$schedule_mangle_both:: + movdqa xmm1,XMMWORD PTR[r10*1+r8] +DB 102,15,56,0,217 + add r8,-16 + and r8,030h + movdqu XMMWORD PTR[rdx],xmm3 + DB 0F3h,0C3h ;repret +_vpaes_schedule_mangle ENDP + + + + +PUBLIC vpaes_set_encrypt_key + +ALIGN 16 +vpaes_set_encrypt_key PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_vpaes_set_encrypt_key:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + lea rsp,QWORD PTR[((-184))+rsp] + movaps XMMWORD PTR[16+rsp],xmm6 + movaps XMMWORD PTR[32+rsp],xmm7 + movaps XMMWORD PTR[48+rsp],xmm8 + movaps XMMWORD PTR[64+rsp],xmm9 + movaps XMMWORD PTR[80+rsp],xmm10 + movaps XMMWORD PTR[96+rsp],xmm11 + movaps XMMWORD PTR[112+rsp],xmm12 + movaps XMMWORD PTR[128+rsp],xmm13 + movaps XMMWORD PTR[144+rsp],xmm14 + movaps XMMWORD PTR[160+rsp],xmm15 +$L$enc_key_body:: + mov eax,esi + shr eax,5 + add eax,5 + mov DWORD PTR[240+rdx],eax + + mov ecx,0 + mov r8d,030h + call _vpaes_schedule_core + movaps xmm6,XMMWORD PTR[16+rsp] + movaps xmm7,XMMWORD PTR[32+rsp] + movaps xmm8,XMMWORD PTR[48+rsp] + movaps xmm9,XMMWORD PTR[64+rsp] + movaps xmm10,XMMWORD PTR[80+rsp] + movaps xmm11,XMMWORD PTR[96+rsp] + movaps xmm12,XMMWORD PTR[112+rsp] + movaps xmm13,XMMWORD PTR[128+rsp] + movaps xmm14,XMMWORD PTR[144+rsp] + movaps xmm15,XMMWORD PTR[160+rsp] + lea rsp,QWORD PTR[184+rsp] +$L$enc_key_epilogue:: + xor eax,eax + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_vpaes_set_encrypt_key:: +vpaes_set_encrypt_key ENDP + +PUBLIC vpaes_set_decrypt_key + +ALIGN 16 +vpaes_set_decrypt_key PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_vpaes_set_decrypt_key:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + lea rsp,QWORD PTR[((-184))+rsp] + movaps XMMWORD PTR[16+rsp],xmm6 + movaps XMMWORD PTR[32+rsp],xmm7 + movaps XMMWORD PTR[48+rsp],xmm8 + movaps XMMWORD PTR[64+rsp],xmm9 + movaps XMMWORD PTR[80+rsp],xmm10 + movaps XMMWORD PTR[96+rsp],xmm11 + movaps XMMWORD PTR[112+rsp],xmm12 + movaps XMMWORD PTR[128+rsp],xmm13 + movaps XMMWORD PTR[144+rsp],xmm14 + movaps XMMWORD PTR[160+rsp],xmm15 +$L$dec_key_body:: + mov eax,esi + shr eax,5 + add eax,5 + mov DWORD PTR[240+rdx],eax + shl eax,4 + lea rdx,QWORD PTR[16+rax*1+rdx] + + mov ecx,1 + mov r8d,esi + shr r8d,1 + and r8d,32 + xor r8d,32 + call _vpaes_schedule_core + movaps xmm6,XMMWORD PTR[16+rsp] + movaps xmm7,XMMWORD PTR[32+rsp] + movaps xmm8,XMMWORD PTR[48+rsp] + movaps xmm9,XMMWORD PTR[64+rsp] + movaps xmm10,XMMWORD PTR[80+rsp] + movaps xmm11,XMMWORD PTR[96+rsp] + movaps xmm12,XMMWORD PTR[112+rsp] + movaps xmm13,XMMWORD PTR[128+rsp] + movaps xmm14,XMMWORD PTR[144+rsp] + movaps xmm15,XMMWORD PTR[160+rsp] + lea rsp,QWORD PTR[184+rsp] +$L$dec_key_epilogue:: + xor eax,eax + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_vpaes_set_decrypt_key:: +vpaes_set_decrypt_key ENDP + +PUBLIC vpaes_encrypt + +ALIGN 16 +vpaes_encrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_vpaes_encrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + lea rsp,QWORD PTR[((-184))+rsp] + movaps XMMWORD PTR[16+rsp],xmm6 + movaps XMMWORD PTR[32+rsp],xmm7 + movaps XMMWORD PTR[48+rsp],xmm8 + movaps XMMWORD PTR[64+rsp],xmm9 + movaps XMMWORD PTR[80+rsp],xmm10 + movaps XMMWORD PTR[96+rsp],xmm11 + movaps XMMWORD PTR[112+rsp],xmm12 + movaps XMMWORD PTR[128+rsp],xmm13 + movaps XMMWORD PTR[144+rsp],xmm14 + movaps XMMWORD PTR[160+rsp],xmm15 +$L$enc_body:: + movdqu xmm0,XMMWORD PTR[rdi] + call _vpaes_preheat + call _vpaes_encrypt_core + movdqu XMMWORD PTR[rsi],xmm0 + movaps xmm6,XMMWORD PTR[16+rsp] + movaps xmm7,XMMWORD PTR[32+rsp] + movaps xmm8,XMMWORD PTR[48+rsp] + movaps xmm9,XMMWORD PTR[64+rsp] + movaps xmm10,XMMWORD PTR[80+rsp] + movaps xmm11,XMMWORD PTR[96+rsp] + movaps xmm12,XMMWORD PTR[112+rsp] + movaps xmm13,XMMWORD PTR[128+rsp] + movaps xmm14,XMMWORD PTR[144+rsp] + movaps xmm15,XMMWORD PTR[160+rsp] + lea rsp,QWORD PTR[184+rsp] +$L$enc_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_vpaes_encrypt:: +vpaes_encrypt ENDP + +PUBLIC vpaes_decrypt + +ALIGN 16 +vpaes_decrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_vpaes_decrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + lea rsp,QWORD PTR[((-184))+rsp] + movaps XMMWORD PTR[16+rsp],xmm6 + movaps XMMWORD PTR[32+rsp],xmm7 + movaps XMMWORD PTR[48+rsp],xmm8 + movaps XMMWORD PTR[64+rsp],xmm9 + movaps XMMWORD PTR[80+rsp],xmm10 + movaps XMMWORD PTR[96+rsp],xmm11 + movaps XMMWORD PTR[112+rsp],xmm12 + movaps XMMWORD PTR[128+rsp],xmm13 + movaps XMMWORD PTR[144+rsp],xmm14 + movaps XMMWORD PTR[160+rsp],xmm15 +$L$dec_body:: + movdqu xmm0,XMMWORD PTR[rdi] + call _vpaes_preheat + call _vpaes_decrypt_core + movdqu XMMWORD PTR[rsi],xmm0 + movaps xmm6,XMMWORD PTR[16+rsp] + movaps xmm7,XMMWORD PTR[32+rsp] + movaps xmm8,XMMWORD PTR[48+rsp] + movaps xmm9,XMMWORD PTR[64+rsp] + movaps xmm10,XMMWORD PTR[80+rsp] + movaps xmm11,XMMWORD PTR[96+rsp] + movaps xmm12,XMMWORD PTR[112+rsp] + movaps xmm13,XMMWORD PTR[128+rsp] + movaps xmm14,XMMWORD PTR[144+rsp] + movaps xmm15,XMMWORD PTR[160+rsp] + lea rsp,QWORD PTR[184+rsp] +$L$dec_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_vpaes_decrypt:: +vpaes_decrypt ENDP +PUBLIC vpaes_cbc_encrypt + +ALIGN 16 +vpaes_cbc_encrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_vpaes_cbc_encrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + xchg rdx,rcx + sub rcx,16 + jc $L$cbc_abort + lea rsp,QWORD PTR[((-184))+rsp] + movaps XMMWORD PTR[16+rsp],xmm6 + movaps XMMWORD PTR[32+rsp],xmm7 + movaps XMMWORD PTR[48+rsp],xmm8 + movaps XMMWORD PTR[64+rsp],xmm9 + movaps XMMWORD PTR[80+rsp],xmm10 + movaps XMMWORD PTR[96+rsp],xmm11 + movaps XMMWORD PTR[112+rsp],xmm12 + movaps XMMWORD PTR[128+rsp],xmm13 + movaps XMMWORD PTR[144+rsp],xmm14 + movaps XMMWORD PTR[160+rsp],xmm15 +$L$cbc_body:: + movdqu xmm6,XMMWORD PTR[r8] + sub rsi,rdi + call _vpaes_preheat + cmp r9d,0 + je $L$cbc_dec_loop + jmp $L$cbc_enc_loop +ALIGN 16 +$L$cbc_enc_loop:: + movdqu xmm0,XMMWORD PTR[rdi] + pxor xmm0,xmm6 + call _vpaes_encrypt_core + movdqa xmm6,xmm0 + movdqu XMMWORD PTR[rdi*1+rsi],xmm0 + lea rdi,QWORD PTR[16+rdi] + sub rcx,16 + jnc $L$cbc_enc_loop + jmp $L$cbc_done +ALIGN 16 +$L$cbc_dec_loop:: + movdqu xmm0,XMMWORD PTR[rdi] + movdqa xmm7,xmm0 + call _vpaes_decrypt_core + pxor xmm0,xmm6 + movdqa xmm6,xmm7 + movdqu XMMWORD PTR[rdi*1+rsi],xmm0 + lea rdi,QWORD PTR[16+rdi] + sub rcx,16 + jnc $L$cbc_dec_loop +$L$cbc_done:: + movdqu XMMWORD PTR[r8],xmm6 + movaps xmm6,XMMWORD PTR[16+rsp] + movaps xmm7,XMMWORD PTR[32+rsp] + movaps xmm8,XMMWORD PTR[48+rsp] + movaps xmm9,XMMWORD PTR[64+rsp] + movaps xmm10,XMMWORD PTR[80+rsp] + movaps xmm11,XMMWORD PTR[96+rsp] + movaps xmm12,XMMWORD PTR[112+rsp] + movaps xmm13,XMMWORD PTR[128+rsp] + movaps xmm14,XMMWORD PTR[144+rsp] + movaps xmm15,XMMWORD PTR[160+rsp] + lea rsp,QWORD PTR[184+rsp] +$L$cbc_epilogue:: +$L$cbc_abort:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_vpaes_cbc_encrypt:: +vpaes_cbc_encrypt ENDP + + + + + + + +ALIGN 16 +_vpaes_preheat PROC PRIVATE + lea r10,QWORD PTR[$L$k_s0F] + movdqa xmm10,XMMWORD PTR[((-32))+r10] + movdqa xmm11,XMMWORD PTR[((-16))+r10] + movdqa xmm9,XMMWORD PTR[r10] + movdqa xmm13,XMMWORD PTR[48+r10] + movdqa xmm12,XMMWORD PTR[64+r10] + movdqa xmm15,XMMWORD PTR[80+r10] + movdqa xmm14,XMMWORD PTR[96+r10] + DB 0F3h,0C3h ;repret +_vpaes_preheat ENDP + + + + + + +ALIGN 64 +_vpaes_consts:: +$L$k_inv:: + DQ 00E05060F0D080180h,0040703090A0B0C02h + DQ 001040A060F0B0780h,0030D0E0C02050809h + +$L$k_s0F:: + DQ 00F0F0F0F0F0F0F0Fh,00F0F0F0F0F0F0F0Fh + +$L$k_ipt:: + DQ 0C2B2E8985A2A7000h,0CABAE09052227808h + DQ 04C01307D317C4D00h,0CD80B1FCB0FDCC81h + +$L$k_sb1:: + DQ 0B19BE18FCB503E00h,0A5DF7A6E142AF544h + DQ 03618D415FAE22300h,03BF7CCC10D2ED9EFh +$L$k_sb2:: + DQ 0E27A93C60B712400h,05EB7E955BC982FCDh + DQ 069EB88400AE12900h,0C2A163C8AB82234Ah +$L$k_sbo:: + DQ 0D0D26D176FBDC700h,015AABF7AC502A878h + DQ 0CFE474A55FBB6A00h,08E1E90D1412B35FAh + +$L$k_mc_forward:: + DQ 00407060500030201h,00C0F0E0D080B0A09h + DQ 0080B0A0904070605h,0000302010C0F0E0Dh + DQ 00C0F0E0D080B0A09h,00407060500030201h + DQ 0000302010C0F0E0Dh,0080B0A0904070605h + +$L$k_mc_backward:: + DQ 00605040702010003h,00E0D0C0F0A09080Bh + DQ 0020100030E0D0C0Fh,00A09080B06050407h + DQ 00E0D0C0F0A09080Bh,00605040702010003h + DQ 00A09080B06050407h,0020100030E0D0C0Fh + +$L$k_sr:: + DQ 00706050403020100h,00F0E0D0C0B0A0908h + DQ 0030E09040F0A0500h,00B06010C07020D08h + DQ 00F060D040B020900h,0070E050C030A0108h + DQ 00B0E0104070A0D00h,00306090C0F020508h + +$L$k_rcon:: + DQ 01F8391B9AF9DEEB6h,0702A98084D7C7D81h + +$L$k_s63:: + DQ 05B5B5B5B5B5B5B5Bh,05B5B5B5B5B5B5B5Bh + +$L$k_opt:: + DQ 0FF9F4929D6B66000h,0F7974121DEBE6808h + DQ 001EDBD5150BCEC00h,0E10D5DB1B05C0CE0h + +$L$k_deskew:: + DQ 007E4A34047A4E300h,01DFEB95A5DBEF91Ah + DQ 05F36B5DC83EA6900h,02841C2ABF49D1E77h + + + + + +$L$k_dksd:: + DQ 0FEB91A5DA3E44700h,00740E3A45A1DBEF9h + DQ 041C277F4B5368300h,05FDC69EAAB289D1Eh +$L$k_dksb:: + DQ 09A4FCA1F8550D500h,003D653861CC94C99h + DQ 0115BEDA7B6FC4A00h,0D993256F7E3482C8h +$L$k_dkse:: + DQ 0D5031CCA1FC9D600h,053859A4C994F5086h + DQ 0A23196054FDC7BE8h,0CD5EF96A20B31487h +$L$k_dks9:: + DQ 0B6116FC87ED9A700h,04AED933482255BFCh + DQ 04576516227143300h,08BB89FACE9DAFDCEh + + + + + +$L$k_dipt:: + DQ 00F505B040B545F00h,0154A411E114E451Ah + DQ 086E383E660056500h,012771772F491F194h + +$L$k_dsb9:: + DQ 0851C03539A86D600h,0CAD51F504F994CC9h + DQ 0C03B1789ECD74900h,0725E2C9EB2FBA565h +$L$k_dsbd:: + DQ 07D57CCDFE6B1A200h,0F56E9B13882A4439h + DQ 03CE2FAF724C6CB00h,02931180D15DEEFD3h +$L$k_dsbb:: + DQ 0D022649296B44200h,0602646F6B0F2D404h + DQ 0C19498A6CD596700h,0F3FF0C3E3255AA6Bh +$L$k_dsbe:: + DQ 046F2929626D4D000h,02242600464B4F6B0h + DQ 00C55A6CDFFAAC100h,09467F36B98593E32h +$L$k_dsbo:: + DQ 01387EA537EF94000h,0C7AA6DB9D4943E2Dh + DQ 012D7560F93441D00h,0CA4B8159D8C58E9Ch +DB 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105 +DB 111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54 +DB 52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97 +DB 109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32 +DB 85,110,105,118,101,114,115,105,116,121,41,0 +ALIGN 64 + +EXTERN __imp_RtlVirtualUnwind:NEAR + +ALIGN 16 +se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + mov rsi,QWORD PTR[8+r9] + mov r11,QWORD PTR[56+r9] + + mov r10d,DWORD PTR[r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$in_prologue + + mov rax,QWORD PTR[152+r8] + + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jae $L$in_prologue + + lea rsi,QWORD PTR[16+rax] + lea rdi,QWORD PTR[512+r8] + mov ecx,20 + DD 0a548f3fch + lea rax,QWORD PTR[184+rax] + +$L$in_prologue:: + mov rdi,QWORD PTR[8+rax] + mov rsi,QWORD PTR[16+rax] + mov QWORD PTR[152+r8],rax + mov QWORD PTR[168+r8],rsi + mov QWORD PTR[176+r8],rdi + + mov rdi,QWORD PTR[40+r9] + mov rsi,r8 + mov ecx,154 + DD 0a548f3fch + + mov rsi,r9 + xor rcx,rcx + mov rdx,QWORD PTR[8+rsi] + mov r8,QWORD PTR[rsi] + mov r9,QWORD PTR[16+rsi] + mov r10,QWORD PTR[40+rsi] + lea r11,QWORD PTR[56+rsi] + lea r12,QWORD PTR[24+rsi] + mov QWORD PTR[32+rsp],r10 + mov QWORD PTR[40+rsp],r11 + mov QWORD PTR[48+rsp],r12 + mov QWORD PTR[56+rsp],rcx + call QWORD PTR[__imp_RtlVirtualUnwind] + + mov eax,1 + add rsp,64 + popfq + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + pop rbx + pop rdi + pop rsi + DB 0F3h,0C3h ;repret +se_handler ENDP + +.text$ ENDS +.pdata SEGMENT READONLY ALIGN(4) +ALIGN 4 + DD imagerel $L$SEH_begin_vpaes_set_encrypt_key + DD imagerel $L$SEH_end_vpaes_set_encrypt_key + DD imagerel $L$SEH_info_vpaes_set_encrypt_key + + DD imagerel $L$SEH_begin_vpaes_set_decrypt_key + DD imagerel $L$SEH_end_vpaes_set_decrypt_key + DD imagerel $L$SEH_info_vpaes_set_decrypt_key + + DD imagerel $L$SEH_begin_vpaes_encrypt + DD imagerel $L$SEH_end_vpaes_encrypt + DD imagerel $L$SEH_info_vpaes_encrypt + + DD imagerel $L$SEH_begin_vpaes_decrypt + DD imagerel $L$SEH_end_vpaes_decrypt + DD imagerel $L$SEH_info_vpaes_decrypt + + DD imagerel $L$SEH_begin_vpaes_cbc_encrypt + DD imagerel $L$SEH_end_vpaes_cbc_encrypt + DD imagerel $L$SEH_info_vpaes_cbc_encrypt + +.pdata ENDS +.xdata SEGMENT READONLY ALIGN(8) +ALIGN 8 +$L$SEH_info_vpaes_set_encrypt_key:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$enc_key_body,imagerel $L$enc_key_epilogue +$L$SEH_info_vpaes_set_decrypt_key:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$dec_key_body,imagerel $L$dec_key_epilogue +$L$SEH_info_vpaes_encrypt:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$enc_body,imagerel $L$enc_epilogue +$L$SEH_info_vpaes_decrypt:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$dec_body,imagerel $L$dec_epilogue +$L$SEH_info_vpaes_cbc_encrypt:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$cbc_body,imagerel $L$cbc_epilogue + +.xdata ENDS +END diff --git a/crypto/aes/vpaes-mingw64-x86_64.S b/crypto/aes/vpaes-mingw64-x86_64.S new file mode 100644 index 00000000..d6cb8605 --- /dev/null +++ b/crypto/aes/vpaes-mingw64-x86_64.S @@ -0,0 +1,1125 @@ +#include "x86_arch.h" +.text + + + + + + + + + + + + + + + + +.def _vpaes_encrypt_core; .scl 3; .type 32; .endef +.p2align 4 +_vpaes_encrypt_core: + movq %rdx,%r9 + movq $16,%r11 + movl 240(%rdx),%eax + movdqa %xmm9,%xmm1 + movdqa .Lk_ipt(%rip),%xmm2 + pandn %xmm0,%xmm1 + movdqu (%r9),%xmm5 + psrld $4,%xmm1 + pand %xmm9,%xmm0 +.byte 102,15,56,0,208 + movdqa .Lk_ipt+16(%rip),%xmm0 +.byte 102,15,56,0,193 + pxor %xmm5,%xmm2 + pxor %xmm2,%xmm0 + addq $16,%r9 + leaq .Lk_mc_backward(%rip),%r10 + jmp .Lenc_entry + +.p2align 4 +.Lenc_loop: + + movdqa %xmm13,%xmm4 +.byte 102,15,56,0,226 + pxor %xmm5,%xmm4 + movdqa %xmm12,%xmm0 +.byte 102,15,56,0,195 + pxor %xmm4,%xmm0 + movdqa %xmm15,%xmm5 +.byte 102,15,56,0,234 + movdqa -64(%r11,%r10,1),%xmm1 + movdqa %xmm14,%xmm2 +.byte 102,15,56,0,211 + pxor %xmm5,%xmm2 + movdqa (%r11,%r10,1),%xmm4 + movdqa %xmm0,%xmm3 +.byte 102,15,56,0,193 + addq $16,%r9 + pxor %xmm2,%xmm0 +.byte 102,15,56,0,220 + addq $16,%r11 + pxor %xmm0,%xmm3 +.byte 102,15,56,0,193 + andq $48,%r11 + pxor %xmm3,%xmm0 + subq $1,%rax + +.Lenc_entry: + + movdqa %xmm9,%xmm1 + pandn %xmm0,%xmm1 + psrld $4,%xmm1 + pand %xmm9,%xmm0 + movdqa %xmm11,%xmm5 +.byte 102,15,56,0,232 + pxor %xmm1,%xmm0 + movdqa %xmm10,%xmm3 +.byte 102,15,56,0,217 + pxor %xmm5,%xmm3 + movdqa %xmm10,%xmm4 +.byte 102,15,56,0,224 + pxor %xmm5,%xmm4 + movdqa %xmm10,%xmm2 +.byte 102,15,56,0,211 + pxor %xmm0,%xmm2 + movdqa %xmm10,%xmm3 + movdqu (%r9),%xmm5 +.byte 102,15,56,0,220 + pxor %xmm1,%xmm3 + jnz .Lenc_loop + + + movdqa -96(%r10),%xmm4 + movdqa -80(%r10),%xmm0 +.byte 102,15,56,0,226 + pxor %xmm5,%xmm4 +.byte 102,15,56,0,195 + movdqa 64(%r11,%r10,1),%xmm1 + pxor %xmm4,%xmm0 +.byte 102,15,56,0,193 + retq + + + + + + + +.def _vpaes_decrypt_core; .scl 3; .type 32; .endef +.p2align 4 +_vpaes_decrypt_core: + movq %rdx,%r9 + movl 240(%rdx),%eax + movdqa %xmm9,%xmm1 + movdqa .Lk_dipt(%rip),%xmm2 + pandn %xmm0,%xmm1 + movq %rax,%r11 + psrld $4,%xmm1 + movdqu (%r9),%xmm5 + shlq $4,%r11 + pand %xmm9,%xmm0 +.byte 102,15,56,0,208 + movdqa .Lk_dipt+16(%rip),%xmm0 + xorq $48,%r11 + leaq .Lk_dsbd(%rip),%r10 +.byte 102,15,56,0,193 + andq $48,%r11 + pxor %xmm5,%xmm2 + movdqa .Lk_mc_forward+48(%rip),%xmm5 + pxor %xmm2,%xmm0 + addq $16,%r9 + addq %r10,%r11 + jmp .Ldec_entry + +.p2align 4 +.Ldec_loop: + + + + movdqa -32(%r10),%xmm4 +.byte 102,15,56,0,226 + pxor %xmm0,%xmm4 + movdqa -16(%r10),%xmm0 +.byte 102,15,56,0,195 + pxor %xmm4,%xmm0 + addq $16,%r9 + +.byte 102,15,56,0,197 + movdqa 0(%r10),%xmm4 +.byte 102,15,56,0,226 + pxor %xmm0,%xmm4 + movdqa 16(%r10),%xmm0 +.byte 102,15,56,0,195 + pxor %xmm4,%xmm0 + subq $1,%rax + +.byte 102,15,56,0,197 + movdqa 32(%r10),%xmm4 +.byte 102,15,56,0,226 + pxor %xmm0,%xmm4 + movdqa 48(%r10),%xmm0 +.byte 102,15,56,0,195 + pxor %xmm4,%xmm0 + +.byte 102,15,56,0,197 + movdqa 64(%r10),%xmm4 +.byte 102,15,56,0,226 + pxor %xmm0,%xmm4 + movdqa 80(%r10),%xmm0 +.byte 102,15,56,0,195 + pxor %xmm4,%xmm0 + +.byte 102,15,58,15,237,12 + +.Ldec_entry: + + movdqa %xmm9,%xmm1 + pandn %xmm0,%xmm1 + psrld $4,%xmm1 + pand %xmm9,%xmm0 + movdqa %xmm11,%xmm2 +.byte 102,15,56,0,208 + pxor %xmm1,%xmm0 + movdqa %xmm10,%xmm3 +.byte 102,15,56,0,217 + pxor %xmm2,%xmm3 + movdqa %xmm10,%xmm4 +.byte 102,15,56,0,224 + pxor %xmm2,%xmm4 + movdqa %xmm10,%xmm2 +.byte 102,15,56,0,211 + pxor %xmm0,%xmm2 + movdqa %xmm10,%xmm3 +.byte 102,15,56,0,220 + pxor %xmm1,%xmm3 + movdqu (%r9),%xmm0 + jnz .Ldec_loop + + + movdqa 96(%r10),%xmm4 +.byte 102,15,56,0,226 + pxor %xmm0,%xmm4 + movdqa 112(%r10),%xmm0 + movdqa -352(%r11),%xmm2 +.byte 102,15,56,0,195 + pxor %xmm4,%xmm0 +.byte 102,15,56,0,194 + retq + + + + + + + +.def _vpaes_schedule_core; .scl 3; .type 32; .endef +.p2align 4 +_vpaes_schedule_core: + + + + + + call _vpaes_preheat + movdqa .Lk_rcon(%rip),%xmm8 + movdqu (%rdi),%xmm0 + + + movdqa %xmm0,%xmm3 + leaq .Lk_ipt(%rip),%r11 + call _vpaes_schedule_transform + movdqa %xmm0,%xmm7 + + leaq .Lk_sr(%rip),%r10 + testq %rcx,%rcx + jnz .Lschedule_am_decrypting + + + movdqu %xmm0,(%rdx) + jmp .Lschedule_go + +.Lschedule_am_decrypting: + + movdqa (%r8,%r10,1),%xmm1 +.byte 102,15,56,0,217 + movdqu %xmm3,(%rdx) + xorq $48,%r8 + +.Lschedule_go: + cmpl $192,%esi + ja .Lschedule_256 + je .Lschedule_192 + + + + + + + + + + +.Lschedule_128: + movl $10,%esi + +.Loop_schedule_128: + call _vpaes_schedule_round + decq %rsi + jz .Lschedule_mangle_last + call _vpaes_schedule_mangle + jmp .Loop_schedule_128 + + + + + + + + + + + + + + + + +.p2align 4 +.Lschedule_192: + movdqu 8(%rdi),%xmm0 + call _vpaes_schedule_transform + movdqa %xmm0,%xmm6 + pxor %xmm4,%xmm4 + movhlps %xmm4,%xmm6 + movl $4,%esi + +.Loop_schedule_192: + call _vpaes_schedule_round +.byte 102,15,58,15,198,8 + call _vpaes_schedule_mangle + call _vpaes_schedule_192_smear + call _vpaes_schedule_mangle + call _vpaes_schedule_round + decq %rsi + jz .Lschedule_mangle_last + call _vpaes_schedule_mangle + call _vpaes_schedule_192_smear + jmp .Loop_schedule_192 + + + + + + + + + + + +.p2align 4 +.Lschedule_256: + movdqu 16(%rdi),%xmm0 + call _vpaes_schedule_transform + movl $7,%esi + +.Loop_schedule_256: + call _vpaes_schedule_mangle + movdqa %xmm0,%xmm6 + + + call _vpaes_schedule_round + decq %rsi + jz .Lschedule_mangle_last + call _vpaes_schedule_mangle + + + pshufd $255,%xmm0,%xmm0 + movdqa %xmm7,%xmm5 + movdqa %xmm6,%xmm7 + call _vpaes_schedule_low_round + movdqa %xmm5,%xmm7 + + jmp .Loop_schedule_256 + + + + + + + + + + + + +.p2align 4 +.Lschedule_mangle_last: + + leaq .Lk_deskew(%rip),%r11 + testq %rcx,%rcx + jnz .Lschedule_mangle_last_dec + + + movdqa (%r8,%r10,1),%xmm1 +.byte 102,15,56,0,193 + leaq .Lk_opt(%rip),%r11 + addq $32,%rdx + +.Lschedule_mangle_last_dec: + addq $-16,%rdx + pxor .Lk_s63(%rip),%xmm0 + call _vpaes_schedule_transform + movdqu %xmm0,(%rdx) + + + pxor %xmm0,%xmm0 + pxor %xmm1,%xmm1 + pxor %xmm2,%xmm2 + pxor %xmm3,%xmm3 + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + pxor %xmm6,%xmm6 + pxor %xmm7,%xmm7 + retq + + + + + + + + + + + + + + + + +.def _vpaes_schedule_192_smear; .scl 3; .type 32; .endef +.p2align 4 +_vpaes_schedule_192_smear: + pshufd $128,%xmm6,%xmm0 + pxor %xmm0,%xmm6 + pshufd $254,%xmm7,%xmm0 + pxor %xmm0,%xmm6 + movdqa %xmm6,%xmm0 + pxor %xmm1,%xmm1 + movhlps %xmm1,%xmm6 + retq + + + + + + + + + + + + + + + + + + + + +.def _vpaes_schedule_round; .scl 3; .type 32; .endef +.p2align 4 +_vpaes_schedule_round: + + pxor %xmm1,%xmm1 +.byte 102,65,15,58,15,200,15 +.byte 102,69,15,58,15,192,15 + pxor %xmm1,%xmm7 + + + pshufd $255,%xmm0,%xmm0 +.byte 102,15,58,15,192,1 + + + + +_vpaes_schedule_low_round: + + movdqa %xmm7,%xmm1 + pslldq $4,%xmm7 + pxor %xmm1,%xmm7 + movdqa %xmm7,%xmm1 + pslldq $8,%xmm7 + pxor %xmm1,%xmm7 + pxor .Lk_s63(%rip),%xmm7 + + + movdqa %xmm9,%xmm1 + pandn %xmm0,%xmm1 + psrld $4,%xmm1 + pand %xmm9,%xmm0 + movdqa %xmm11,%xmm2 +.byte 102,15,56,0,208 + pxor %xmm1,%xmm0 + movdqa %xmm10,%xmm3 +.byte 102,15,56,0,217 + pxor %xmm2,%xmm3 + movdqa %xmm10,%xmm4 +.byte 102,15,56,0,224 + pxor %xmm2,%xmm4 + movdqa %xmm10,%xmm2 +.byte 102,15,56,0,211 + pxor %xmm0,%xmm2 + movdqa %xmm10,%xmm3 +.byte 102,15,56,0,220 + pxor %xmm1,%xmm3 + movdqa %xmm13,%xmm4 +.byte 102,15,56,0,226 + movdqa %xmm12,%xmm0 +.byte 102,15,56,0,195 + pxor %xmm4,%xmm0 + + + pxor %xmm7,%xmm0 + movdqa %xmm0,%xmm7 + retq + + + + + + + + + + + +.def _vpaes_schedule_transform; .scl 3; .type 32; .endef +.p2align 4 +_vpaes_schedule_transform: + movdqa %xmm9,%xmm1 + pandn %xmm0,%xmm1 + psrld $4,%xmm1 + pand %xmm9,%xmm0 + movdqa (%r11),%xmm2 +.byte 102,15,56,0,208 + movdqa 16(%r11),%xmm0 +.byte 102,15,56,0,193 + pxor %xmm2,%xmm0 + retq + + + + + + + + + + + + + + + + + + + + + + + + + +.def _vpaes_schedule_mangle; .scl 3; .type 32; .endef +.p2align 4 +_vpaes_schedule_mangle: + movdqa %xmm0,%xmm4 + movdqa .Lk_mc_forward(%rip),%xmm5 + testq %rcx,%rcx + jnz .Lschedule_mangle_dec + + + addq $16,%rdx + pxor .Lk_s63(%rip),%xmm4 +.byte 102,15,56,0,229 + movdqa %xmm4,%xmm3 +.byte 102,15,56,0,229 + pxor %xmm4,%xmm3 +.byte 102,15,56,0,229 + pxor %xmm4,%xmm3 + + jmp .Lschedule_mangle_both +.p2align 4 +.Lschedule_mangle_dec: + + leaq .Lk_dksd(%rip),%r11 + movdqa %xmm9,%xmm1 + pandn %xmm4,%xmm1 + psrld $4,%xmm1 + pand %xmm9,%xmm4 + + movdqa 0(%r11),%xmm2 +.byte 102,15,56,0,212 + movdqa 16(%r11),%xmm3 +.byte 102,15,56,0,217 + pxor %xmm2,%xmm3 +.byte 102,15,56,0,221 + + movdqa 32(%r11),%xmm2 +.byte 102,15,56,0,212 + pxor %xmm3,%xmm2 + movdqa 48(%r11),%xmm3 +.byte 102,15,56,0,217 + pxor %xmm2,%xmm3 +.byte 102,15,56,0,221 + + movdqa 64(%r11),%xmm2 +.byte 102,15,56,0,212 + pxor %xmm3,%xmm2 + movdqa 80(%r11),%xmm3 +.byte 102,15,56,0,217 + pxor %xmm2,%xmm3 +.byte 102,15,56,0,221 + + movdqa 96(%r11),%xmm2 +.byte 102,15,56,0,212 + pxor %xmm3,%xmm2 + movdqa 112(%r11),%xmm3 +.byte 102,15,56,0,217 + pxor %xmm2,%xmm3 + + addq $-16,%rdx + +.Lschedule_mangle_both: + movdqa (%r8,%r10,1),%xmm1 +.byte 102,15,56,0,217 + addq $-16,%r8 + andq $48,%r8 + movdqu %xmm3,(%rdx) + retq + + + + + +.globl vpaes_set_encrypt_key +.def vpaes_set_encrypt_key; .scl 2; .type 32; .endef +.p2align 4 +vpaes_set_encrypt_key: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_vpaes_set_encrypt_key: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + leaq -184(%rsp),%rsp + movaps %xmm6,16(%rsp) + movaps %xmm7,32(%rsp) + movaps %xmm8,48(%rsp) + movaps %xmm9,64(%rsp) + movaps %xmm10,80(%rsp) + movaps %xmm11,96(%rsp) + movaps %xmm12,112(%rsp) + movaps %xmm13,128(%rsp) + movaps %xmm14,144(%rsp) + movaps %xmm15,160(%rsp) +.Lenc_key_body: + movl %esi,%eax + shrl $5,%eax + addl $5,%eax + movl %eax,240(%rdx) + + movl $0,%ecx + movl $48,%r8d + call _vpaes_schedule_core + movaps 16(%rsp),%xmm6 + movaps 32(%rsp),%xmm7 + movaps 48(%rsp),%xmm8 + movaps 64(%rsp),%xmm9 + movaps 80(%rsp),%xmm10 + movaps 96(%rsp),%xmm11 + movaps 112(%rsp),%xmm12 + movaps 128(%rsp),%xmm13 + movaps 144(%rsp),%xmm14 + movaps 160(%rsp),%xmm15 + leaq 184(%rsp),%rsp +.Lenc_key_epilogue: + xorl %eax,%eax + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_vpaes_set_encrypt_key: + +.globl vpaes_set_decrypt_key +.def vpaes_set_decrypt_key; .scl 2; .type 32; .endef +.p2align 4 +vpaes_set_decrypt_key: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_vpaes_set_decrypt_key: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + leaq -184(%rsp),%rsp + movaps %xmm6,16(%rsp) + movaps %xmm7,32(%rsp) + movaps %xmm8,48(%rsp) + movaps %xmm9,64(%rsp) + movaps %xmm10,80(%rsp) + movaps %xmm11,96(%rsp) + movaps %xmm12,112(%rsp) + movaps %xmm13,128(%rsp) + movaps %xmm14,144(%rsp) + movaps %xmm15,160(%rsp) +.Ldec_key_body: + movl %esi,%eax + shrl $5,%eax + addl $5,%eax + movl %eax,240(%rdx) + shll $4,%eax + leaq 16(%rdx,%rax,1),%rdx + + movl $1,%ecx + movl %esi,%r8d + shrl $1,%r8d + andl $32,%r8d + xorl $32,%r8d + call _vpaes_schedule_core + movaps 16(%rsp),%xmm6 + movaps 32(%rsp),%xmm7 + movaps 48(%rsp),%xmm8 + movaps 64(%rsp),%xmm9 + movaps 80(%rsp),%xmm10 + movaps 96(%rsp),%xmm11 + movaps 112(%rsp),%xmm12 + movaps 128(%rsp),%xmm13 + movaps 144(%rsp),%xmm14 + movaps 160(%rsp),%xmm15 + leaq 184(%rsp),%rsp +.Ldec_key_epilogue: + xorl %eax,%eax + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_vpaes_set_decrypt_key: + +.globl vpaes_encrypt +.def vpaes_encrypt; .scl 2; .type 32; .endef +.p2align 4 +vpaes_encrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_vpaes_encrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + leaq -184(%rsp),%rsp + movaps %xmm6,16(%rsp) + movaps %xmm7,32(%rsp) + movaps %xmm8,48(%rsp) + movaps %xmm9,64(%rsp) + movaps %xmm10,80(%rsp) + movaps %xmm11,96(%rsp) + movaps %xmm12,112(%rsp) + movaps %xmm13,128(%rsp) + movaps %xmm14,144(%rsp) + movaps %xmm15,160(%rsp) +.Lenc_body: + movdqu (%rdi),%xmm0 + call _vpaes_preheat + call _vpaes_encrypt_core + movdqu %xmm0,(%rsi) + movaps 16(%rsp),%xmm6 + movaps 32(%rsp),%xmm7 + movaps 48(%rsp),%xmm8 + movaps 64(%rsp),%xmm9 + movaps 80(%rsp),%xmm10 + movaps 96(%rsp),%xmm11 + movaps 112(%rsp),%xmm12 + movaps 128(%rsp),%xmm13 + movaps 144(%rsp),%xmm14 + movaps 160(%rsp),%xmm15 + leaq 184(%rsp),%rsp +.Lenc_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_vpaes_encrypt: + +.globl vpaes_decrypt +.def vpaes_decrypt; .scl 2; .type 32; .endef +.p2align 4 +vpaes_decrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_vpaes_decrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + leaq -184(%rsp),%rsp + movaps %xmm6,16(%rsp) + movaps %xmm7,32(%rsp) + movaps %xmm8,48(%rsp) + movaps %xmm9,64(%rsp) + movaps %xmm10,80(%rsp) + movaps %xmm11,96(%rsp) + movaps %xmm12,112(%rsp) + movaps %xmm13,128(%rsp) + movaps %xmm14,144(%rsp) + movaps %xmm15,160(%rsp) +.Ldec_body: + movdqu (%rdi),%xmm0 + call _vpaes_preheat + call _vpaes_decrypt_core + movdqu %xmm0,(%rsi) + movaps 16(%rsp),%xmm6 + movaps 32(%rsp),%xmm7 + movaps 48(%rsp),%xmm8 + movaps 64(%rsp),%xmm9 + movaps 80(%rsp),%xmm10 + movaps 96(%rsp),%xmm11 + movaps 112(%rsp),%xmm12 + movaps 128(%rsp),%xmm13 + movaps 144(%rsp),%xmm14 + movaps 160(%rsp),%xmm15 + leaq 184(%rsp),%rsp +.Ldec_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_vpaes_decrypt: +.globl vpaes_cbc_encrypt +.def vpaes_cbc_encrypt; .scl 2; .type 32; .endef +.p2align 4 +vpaes_cbc_encrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_vpaes_cbc_encrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + movq 48(%rsp),%r9 + + xchgq %rcx,%rdx + subq $16,%rcx + jc .Lcbc_abort + leaq -184(%rsp),%rsp + movaps %xmm6,16(%rsp) + movaps %xmm7,32(%rsp) + movaps %xmm8,48(%rsp) + movaps %xmm9,64(%rsp) + movaps %xmm10,80(%rsp) + movaps %xmm11,96(%rsp) + movaps %xmm12,112(%rsp) + movaps %xmm13,128(%rsp) + movaps %xmm14,144(%rsp) + movaps %xmm15,160(%rsp) +.Lcbc_body: + movdqu (%r8),%xmm6 + subq %rdi,%rsi + call _vpaes_preheat + cmpl $0,%r9d + je .Lcbc_dec_loop + jmp .Lcbc_enc_loop +.p2align 4 +.Lcbc_enc_loop: + movdqu (%rdi),%xmm0 + pxor %xmm6,%xmm0 + call _vpaes_encrypt_core + movdqa %xmm0,%xmm6 + movdqu %xmm0,(%rsi,%rdi,1) + leaq 16(%rdi),%rdi + subq $16,%rcx + jnc .Lcbc_enc_loop + jmp .Lcbc_done +.p2align 4 +.Lcbc_dec_loop: + movdqu (%rdi),%xmm0 + movdqa %xmm0,%xmm7 + call _vpaes_decrypt_core + pxor %xmm6,%xmm0 + movdqa %xmm7,%xmm6 + movdqu %xmm0,(%rsi,%rdi,1) + leaq 16(%rdi),%rdi + subq $16,%rcx + jnc .Lcbc_dec_loop +.Lcbc_done: + movdqu %xmm6,(%r8) + movaps 16(%rsp),%xmm6 + movaps 32(%rsp),%xmm7 + movaps 48(%rsp),%xmm8 + movaps 64(%rsp),%xmm9 + movaps 80(%rsp),%xmm10 + movaps 96(%rsp),%xmm11 + movaps 112(%rsp),%xmm12 + movaps 128(%rsp),%xmm13 + movaps 144(%rsp),%xmm14 + movaps 160(%rsp),%xmm15 + leaq 184(%rsp),%rsp +.Lcbc_epilogue: +.Lcbc_abort: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_vpaes_cbc_encrypt: + + + + + + +.def _vpaes_preheat; .scl 3; .type 32; .endef +.p2align 4 +_vpaes_preheat: + leaq .Lk_s0F(%rip),%r10 + movdqa -32(%r10),%xmm10 + movdqa -16(%r10),%xmm11 + movdqa 0(%r10),%xmm9 + movdqa 48(%r10),%xmm13 + movdqa 64(%r10),%xmm12 + movdqa 80(%r10),%xmm15 + movdqa 96(%r10),%xmm14 + retq + + + + + + + +.p2align 6 +_vpaes_consts: +.Lk_inv: +.quad 0x0E05060F0D080180, 0x040703090A0B0C02 +.quad 0x01040A060F0B0780, 0x030D0E0C02050809 + +.Lk_s0F: +.quad 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F + +.Lk_ipt: +.quad 0xC2B2E8985A2A7000, 0xCABAE09052227808 +.quad 0x4C01307D317C4D00, 0xCD80B1FCB0FDCC81 + +.Lk_sb1: +.quad 0xB19BE18FCB503E00, 0xA5DF7A6E142AF544 +.quad 0x3618D415FAE22300, 0x3BF7CCC10D2ED9EF +.Lk_sb2: +.quad 0xE27A93C60B712400, 0x5EB7E955BC982FCD +.quad 0x69EB88400AE12900, 0xC2A163C8AB82234A +.Lk_sbo: +.quad 0xD0D26D176FBDC700, 0x15AABF7AC502A878 +.quad 0xCFE474A55FBB6A00, 0x8E1E90D1412B35FA + +.Lk_mc_forward: +.quad 0x0407060500030201, 0x0C0F0E0D080B0A09 +.quad 0x080B0A0904070605, 0x000302010C0F0E0D +.quad 0x0C0F0E0D080B0A09, 0x0407060500030201 +.quad 0x000302010C0F0E0D, 0x080B0A0904070605 + +.Lk_mc_backward: +.quad 0x0605040702010003, 0x0E0D0C0F0A09080B +.quad 0x020100030E0D0C0F, 0x0A09080B06050407 +.quad 0x0E0D0C0F0A09080B, 0x0605040702010003 +.quad 0x0A09080B06050407, 0x020100030E0D0C0F + +.Lk_sr: +.quad 0x0706050403020100, 0x0F0E0D0C0B0A0908 +.quad 0x030E09040F0A0500, 0x0B06010C07020D08 +.quad 0x0F060D040B020900, 0x070E050C030A0108 +.quad 0x0B0E0104070A0D00, 0x0306090C0F020508 + +.Lk_rcon: +.quad 0x1F8391B9AF9DEEB6, 0x702A98084D7C7D81 + +.Lk_s63: +.quad 0x5B5B5B5B5B5B5B5B, 0x5B5B5B5B5B5B5B5B + +.Lk_opt: +.quad 0xFF9F4929D6B66000, 0xF7974121DEBE6808 +.quad 0x01EDBD5150BCEC00, 0xE10D5DB1B05C0CE0 + +.Lk_deskew: +.quad 0x07E4A34047A4E300, 0x1DFEB95A5DBEF91A +.quad 0x5F36B5DC83EA6900, 0x2841C2ABF49D1E77 + + + + + +.Lk_dksd: +.quad 0xFEB91A5DA3E44700, 0x0740E3A45A1DBEF9 +.quad 0x41C277F4B5368300, 0x5FDC69EAAB289D1E +.Lk_dksb: +.quad 0x9A4FCA1F8550D500, 0x03D653861CC94C99 +.quad 0x115BEDA7B6FC4A00, 0xD993256F7E3482C8 +.Lk_dkse: +.quad 0xD5031CCA1FC9D600, 0x53859A4C994F5086 +.quad 0xA23196054FDC7BE8, 0xCD5EF96A20B31487 +.Lk_dks9: +.quad 0xB6116FC87ED9A700, 0x4AED933482255BFC +.quad 0x4576516227143300, 0x8BB89FACE9DAFDCE + + + + + +.Lk_dipt: +.quad 0x0F505B040B545F00, 0x154A411E114E451A +.quad 0x86E383E660056500, 0x12771772F491F194 + +.Lk_dsb9: +.quad 0x851C03539A86D600, 0xCAD51F504F994CC9 +.quad 0xC03B1789ECD74900, 0x725E2C9EB2FBA565 +.Lk_dsbd: +.quad 0x7D57CCDFE6B1A200, 0xF56E9B13882A4439 +.quad 0x3CE2FAF724C6CB00, 0x2931180D15DEEFD3 +.Lk_dsbb: +.quad 0xD022649296B44200, 0x602646F6B0F2D404 +.quad 0xC19498A6CD596700, 0xF3FF0C3E3255AA6B +.Lk_dsbe: +.quad 0x46F2929626D4D000, 0x2242600464B4F6B0 +.quad 0x0C55A6CDFFAAC100, 0x9467F36B98593E32 +.Lk_dsbo: +.quad 0x1387EA537EF94000, 0xC7AA6DB9D4943E2D +.quad 0x12D7560F93441D00, 0xCA4B8159D8C58E9C +.byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0 +.p2align 6 + + +.def se_handler; .scl 3; .type 32; .endef +.p2align 4 +se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + movq 8(%r9),%rsi + movq 56(%r9),%r11 + + movl 0(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jb .Lin_prologue + + movq 152(%r8),%rax + + movl 4(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jae .Lin_prologue + + leaq 16(%rax),%rsi + leaq 512(%r8),%rdi + movl $20,%ecx +.long 0xa548f3fc + leaq 184(%rax),%rax + +.Lin_prologue: + movq 8(%rax),%rdi + movq 16(%rax),%rsi + movq %rax,152(%r8) + movq %rsi,168(%r8) + movq %rdi,176(%r8) + + movq 40(%r9),%rdi + movq %r8,%rsi + movl $154,%ecx +.long 0xa548f3fc + + movq %r9,%rsi + xorq %rcx,%rcx + movq 8(%rsi),%rdx + movq 0(%rsi),%r8 + movq 16(%rsi),%r9 + movq 40(%rsi),%r10 + leaq 56(%rsi),%r11 + leaq 24(%rsi),%r12 + movq %r10,32(%rsp) + movq %r11,40(%rsp) + movq %r12,48(%rsp) + movq %rcx,56(%rsp) + call *__imp_RtlVirtualUnwind(%rip) + + movl $1,%eax + addq $64,%rsp + popfq + popq %r15 + popq %r14 + popq %r13 + popq %r12 + popq %rbp + popq %rbx + popq %rdi + popq %rsi + retq + + +.section .pdata +.p2align 2 +.rva .LSEH_begin_vpaes_set_encrypt_key +.rva .LSEH_end_vpaes_set_encrypt_key +.rva .LSEH_info_vpaes_set_encrypt_key + +.rva .LSEH_begin_vpaes_set_decrypt_key +.rva .LSEH_end_vpaes_set_decrypt_key +.rva .LSEH_info_vpaes_set_decrypt_key + +.rva .LSEH_begin_vpaes_encrypt +.rva .LSEH_end_vpaes_encrypt +.rva .LSEH_info_vpaes_encrypt + +.rva .LSEH_begin_vpaes_decrypt +.rva .LSEH_end_vpaes_decrypt +.rva .LSEH_info_vpaes_decrypt + +.rva .LSEH_begin_vpaes_cbc_encrypt +.rva .LSEH_end_vpaes_cbc_encrypt +.rva .LSEH_info_vpaes_cbc_encrypt + +.section .xdata +.p2align 3 +.LSEH_info_vpaes_set_encrypt_key: +.byte 9,0,0,0 +.rva se_handler +.rva .Lenc_key_body,.Lenc_key_epilogue +.LSEH_info_vpaes_set_decrypt_key: +.byte 9,0,0,0 +.rva se_handler +.rva .Ldec_key_body,.Ldec_key_epilogue +.LSEH_info_vpaes_encrypt: +.byte 9,0,0,0 +.rva se_handler +.rva .Lenc_body,.Lenc_epilogue +.LSEH_info_vpaes_decrypt: +.byte 9,0,0,0 +.rva se_handler +.rva .Ldec_body,.Ldec_epilogue +.LSEH_info_vpaes_cbc_encrypt: +.byte 9,0,0,0 +.rva se_handler +.rva .Lcbc_body,.Lcbc_epilogue diff --git a/crypto/arm_arch.h b/crypto/arm_arch.h new file mode 100644 index 00000000..a64c6da4 --- /dev/null +++ b/crypto/arm_arch.h @@ -0,0 +1,55 @@ +/* $OpenBSD: arm_arch.h,v 1.9 2019/03/13 10:18:30 patrick Exp $ */ +#ifndef __ARM_ARCH_H__ +#define __ARM_ARCH_H__ + +#if !defined(__ARM_ARCH__) +# if defined(__CC_ARM) +# define __ARM_ARCH__ __TARGET_ARCH_ARM +# if defined(__BIG_ENDIAN) +# define __ARMEB__ +# else +# define __ARMEL__ +# endif +# elif defined(__GNUC__) + /* + * Why doesn't gcc define __ARM_ARCH__? Instead it defines + * bunch of below macros. See all_architectures[] table in + * gcc/config/arm/arm.c. On a side note it defines + * __ARMEL__/__ARMEB__ for little-/big-endian. + */ +# if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ + defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) || \ + defined(__ARM_ARCH_7EM__) +# define __ARM_ARCH__ 7 +# elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \ + defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__) || \ + defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__) || \ + defined(__ARM_ARCH_6T2__) +# define __ARM_ARCH__ 6 +# elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \ + defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__) || \ + defined(__ARM_ARCH_5TEJ__) +# define __ARM_ARCH__ 5 +# elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) +# define __ARM_ARCH__ 4 +# else +# error "unsupported ARM architecture" +# endif +# endif +#endif + +#if !defined(__ASSEMBLER__) +extern unsigned int OPENSSL_armcap_P; + +#define ARMV7_NEON (1<<0) +#define ARMV8_AES (1<<1) +#define ARMV8_SHA1 (1<<2) +#define ARMV8_SHA256 (1<<3) +#define ARMV8_PMULL (1<<4) +#endif + +#if defined(__OpenBSD__) +#define __STRICT_ALIGNMENT +#endif + +#endif diff --git a/crypto/armcap.c b/crypto/armcap.c new file mode 100644 index 00000000..8c498328 --- /dev/null +++ b/crypto/armcap.c @@ -0,0 +1,88 @@ +/* $OpenBSD: armcap.c,v 1.8 2019/03/13 10:18:30 patrick Exp $ */ +#include +#include +#include +#include +#include +#include + +#include "arm_arch.h" + +unsigned int OPENSSL_armcap_P; + +#if __ARM_ARCH__ >= 7 +static sigset_t all_masked; + +static sigjmp_buf ill_jmp; + static void ill_handler (int sig) { siglongjmp(ill_jmp, sig); +} + +/* + * Following subroutines could have been inlined, but it's not all + * ARM compilers support inline assembler... + */ +void _armv7_neon_probe(void); +void _armv8_aes_probe(void); +void _armv8_sha1_probe(void); +void _armv8_sha256_probe(void); +void _armv8_pmull_probe(void); +#endif + +#if defined(__GNUC__) && __GNUC__>=2 +void OPENSSL_cpuid_setup(void) __attribute__((constructor)); +#endif + +void +OPENSSL_cpuid_setup(void) +{ +#if __ARM_ARCH__ >= 7 + struct sigaction ill_oact, ill_act; + sigset_t oset; +#endif + static int trigger = 0; + + if (trigger) + return; + trigger = 1; + + OPENSSL_armcap_P = 0; + +#if __ARM_ARCH__ >= 7 + sigfillset(&all_masked); + sigdelset(&all_masked, SIGILL); + sigdelset(&all_masked, SIGTRAP); + sigdelset(&all_masked, SIGFPE); + sigdelset(&all_masked, SIGBUS); + sigdelset(&all_masked, SIGSEGV); + + memset(&ill_act, 0, sizeof(ill_act)); + ill_act.sa_handler = ill_handler; + ill_act.sa_mask = all_masked; + + sigprocmask(SIG_SETMASK, &ill_act.sa_mask, &oset); + sigaction(SIGILL, &ill_act, &ill_oact); + + if (sigsetjmp(ill_jmp, 1) == 0) { + _armv7_neon_probe(); + OPENSSL_armcap_P |= ARMV7_NEON; + if (sigsetjmp(ill_jmp, 1) == 0) { + _armv8_pmull_probe(); + OPENSSL_armcap_P |= ARMV8_PMULL | ARMV8_AES; + } else if (sigsetjmp(ill_jmp, 1) == 0) { + _armv8_aes_probe(); + OPENSSL_armcap_P |= ARMV8_AES; + } + if (sigsetjmp(ill_jmp, 1) == 0) { + _armv8_sha1_probe(); + OPENSSL_armcap_P |= ARMV8_SHA1; + } + if (sigsetjmp(ill_jmp, 1) == 0) { + _armv8_sha256_probe(); + OPENSSL_armcap_P |= ARMV8_SHA256; + } + } + + sigaction (SIGILL, &ill_oact, NULL); + sigprocmask(SIG_SETMASK, &oset, NULL); +#endif +} diff --git a/crypto/armv4cpuid.S b/crypto/armv4cpuid.S new file mode 100644 index 00000000..bb9abafe --- /dev/null +++ b/crypto/armv4cpuid.S @@ -0,0 +1,165 @@ +#include "arm_arch.h" + +.text +#if defined(__thumb2__) && !defined(__APPLE__) +.syntax unified +.thumb +#else +.code 32 +#undef __thumb2__ +#endif + +.align 5 +.globl OPENSSL_atomic_add +.type OPENSSL_atomic_add,%function +OPENSSL_atomic_add: +#if __ARM_ARCH__>=6 +.Ladd: ldrex r2,[r0] + add r3,r2,r1 + strex r2,r3,[r0] + cmp r2,#0 + bne .Ladd + mov r0,r3 + bx lr +#else + stmdb sp!,{r4,r5,r6,lr} + ldr r2,.Lspinlock + adr r3,.Lspinlock + mov r4,r0 + mov r5,r1 + add r6,r3,r2 @ &spinlock + b .+8 +.Lspin: bl sched_yield + mov r0,#-1 + swp r0,r0,[r6] + cmp r0,#0 + bne .Lspin + + ldr r2,[r4] + add r2,r2,r5 + str r2,[r4] + str r0,[r6] @ release spinlock + ldmia sp!,{r4,r5,r6,lr} + tst lr,#1 + moveq pc,lr +.word 0xe12fff1e @ bx lr +#endif +.size OPENSSL_atomic_add,.-OPENSSL_atomic_add + +#if __ARM_ARCH__>=7 +.arch armv7-a +.fpu neon + +.align 5 +.globl _armv7_neon_probe +.type _armv7_neon_probe,%function +_armv7_neon_probe: + vorr q0,q0,q0 + bx lr +.size _armv7_neon_probe,.-_armv7_neon_probe + +.globl _armv8_aes_probe +.type _armv8_aes_probe,%function +_armv8_aes_probe: +#if defined(__thumb2__) && !defined(__APPLE__) +.byte 0xb0,0xff,0x00,0x03 @ aese.8 q0,q0 +#else +.byte 0x00,0x03,0xb0,0xf3 @ aese.8 q0,q0 +#endif + bx lr +.size _armv8_aes_probe,.-_armv8_aes_probe + +.globl _armv8_sha1_probe +.type _armv8_sha1_probe,%function +_armv8_sha1_probe: +#if defined(__thumb2__) && !defined(__APPLE__) +.byte 0x00,0xef,0x40,0x0c @ sha1c.32 q0,q0,q0 +#else +.byte 0x40,0x0c,0x00,0xf2 @ sha1c.32 q0,q0,q0 +#endif + bx lr +.size _armv8_sha1_probe,.-_armv8_sha1_probe + +.globl _armv8_sha256_probe +.type _armv8_sha256_probe,%function +_armv8_sha256_probe: +#if defined(__thumb2__) && !defined(__APPLE__) +.byte 0x00,0xff,0x40,0x0c @ sha256h.32 q0,q0,q0 +#else +.byte 0x40,0x0c,0x00,0xf3 @ sha256h.32 q0,q0,q0 +#endif + bx lr +.size _armv8_sha256_probe,.-_armv8_sha256_probe +.globl _armv8_pmull_probe +.type _armv8_pmull_probe,%function +_armv8_pmull_probe: +#if defined(__thumb2__) && !defined(__APPLE__) +.byte 0xa0,0xef,0x00,0x0e @ vmull.p64 q0,d0,d0 +#else +.byte 0x00,0x0e,0xa0,0xf2 @ vmull.p64 q0,d0,d0 +#endif + bx lr +.size _armv8_pmull_probe,.-_armv8_pmull_probe +#endif + +.globl OPENSSL_wipe_cpu +.type OPENSSL_wipe_cpu,%function +OPENSSL_wipe_cpu: +#if __ARM_ARCH__>=7 + ldr r0,.LOPENSSL_armcap + adr r1,.LOPENSSL_armcap + ldr r0,[r1,r0] +#ifdef __APPLE__ + ldr r0,[r0] +#endif +#endif + eor r2,r2,r2 + eor r3,r3,r3 + eor ip,ip,ip +#if __ARM_ARCH__>=7 + tst r0,#1 + beq .Lwipe_done + veor q0, q0, q0 + veor q1, q1, q1 + veor q2, q2, q2 + veor q3, q3, q3 + veor q8, q8, q8 + veor q9, q9, q9 + veor q10, q10, q10 + veor q11, q11, q11 + veor q12, q12, q12 + veor q13, q13, q13 + veor q14, q14, q14 + veor q15, q15, q15 +.Lwipe_done: +#endif + mov r0,sp +#if __ARM_ARCH__>=5 + bx lr +#else + tst lr,#1 + moveq pc,lr +.word 0xe12fff1e @ bx lr +#endif +.size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu + +.align 5 +#if __ARM_ARCH__>=7 +.LOPENSSL_armcap: +.word OPENSSL_armcap_P-. +#endif +#if __ARM_ARCH__>=6 +.align 5 +#else +.Lspinlock: +.word atomic_add_spinlock-.Lspinlock +.align 5 + +.data +.align 2 +atomic_add_spinlock: +.word 0 +#endif + +.comm OPENSSL_armcap_P,4,4 +.hidden OPENSSL_armcap_P diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index 9ba77d69..7fd40d8a 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_bitstr.c,v 1.24 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: a_bitstr.c,v 1.29 2018/10/20 16:07:09 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -118,10 +118,11 @@ i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) *(p++) = (unsigned char)bits; d = a->data; - memcpy(p, d, len); - p += len; - if (len > 0) - p[-1]&=(0xff << bits); + if (len > 0) { + memcpy(p, d, len); + p += len; + p[-1] &= 0xff << bits; + } *pp = p; return (ret); } @@ -135,29 +136,34 @@ c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len) int i; if (len < 1) { - i = ASN1_R_STRING_TOO_SHORT; + ASN1error(ASN1_R_STRING_TOO_SHORT); goto err; } - if ((a == NULL) || ((*a) == NULL)) { + if (a == NULL || *a == NULL) { if ((ret = ASN1_BIT_STRING_new()) == NULL) return (NULL); } else - ret = (*a); + ret = *a; p = *pp; i = *(p++); - /* We do this to preserve the settings. If we modify - * the settings, via the _set_bit function, we will recalculate - * on output */ - ret->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear */ - ret->flags|=(ASN1_STRING_FLAG_BITS_LEFT|(i&0x07)); /* set */ - - if (len-- > 1) /* using one because of the bits left byte */ - { - s = malloc(len); - if (s == NULL) { - i = ERR_R_MALLOC_FAILURE; + if (i > 7) { + ASN1error(ASN1_R_INVALID_BIT_STRING_BITS_LEFT); + goto err; + } + + /* + * We do this to preserve the settings. If we modify the settings, + * via the _set_bit function, we will recalculate on output. + */ + ret->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); /* clear */ + ret->flags |= (ASN1_STRING_FLAG_BITS_LEFT | i); /* set */ + + /* using one because of the bits left byte */ + if (len-- > 1) { + if ((s = malloc(len)) == NULL) { + ASN1error(ERR_R_MALLOC_FAILURE); goto err; } memcpy(s, p, len); @@ -166,24 +172,25 @@ c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len) } else s = NULL; - ret->length = (int)len; free(ret->data); ret->data = s; + ret->length = (int)len; ret->type = V_ASN1_BIT_STRING; + if (a != NULL) - (*a) = ret; + *a = ret; + *pp = p; + return (ret); -err: - ASN1error(i); - if ((ret != NULL) && ((a == NULL) || (*a != ret))) + err: + if (a == NULL || *a != ret) ASN1_BIT_STRING_free(ret); + return (NULL); } -/* These next 2 functions from Goetz Babin-Ebell - */ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) { @@ -204,8 +211,7 @@ ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) if ((a->length < (w + 1)) || (a->data == NULL)) { if (!value) return(1); /* Don't need to set */ - c = OPENSSL_realloc_clean(a->data, a->length, w + 1); - if (c == NULL) { + if ((c = recallocarray(a->data, a->length, w + 1, 1)) == NULL) { ASN1error(ERR_R_MALLOC_FAILURE); return 0; } @@ -222,7 +228,7 @@ ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) } int -ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n) +ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n) { int w, v; @@ -240,7 +246,8 @@ ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n) * 'len' is the length of 'flags'. */ int -ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, unsigned char *flags, int flags_len) +ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, const unsigned char *flags, + int flags_len) { int i, ok; diff --git a/crypto/asn1/a_bytes.c b/crypto/asn1/a_bytes.c deleted file mode 100644 index f3fe2348..00000000 --- a/crypto/asn1/a_bytes.c +++ /dev/null @@ -1,306 +0,0 @@ -/* $OpenBSD: a_bytes.c,v 1.19 2017/01/29 17:49:22 beck Exp $ */ -/* 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.] - */ - -#include -#include - -#include -#include -#include - -static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c); -/* type is a 'bitmap' of acceptable string types. - */ -ASN1_STRING * -d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp, - long length, int type) -{ - ASN1_STRING *ret = NULL; - const unsigned char *p; - unsigned char *s; - long len; - int inf, tag, xclass; - int i = 0; - - p = *pp; - inf = ASN1_get_object(&p, &len, &tag, &xclass, length); - if (inf & 0x80) - goto err; - - if (tag >= 32) { - i = ASN1_R_TAG_VALUE_TOO_HIGH; - goto err; - } - if (!(ASN1_tag2bit(tag) & type)) { - i = ASN1_R_WRONG_TYPE; - goto err; - } - - /* If a bit-string, exit early */ - if (tag == V_ASN1_BIT_STRING) - return (d2i_ASN1_BIT_STRING(a, pp, length)); - - if ((a == NULL) || ((*a) == NULL)) { - if ((ret = ASN1_STRING_new()) == NULL) - return (NULL); - } else - ret = (*a); - - if (len != 0) { - s = malloc(len + 1); - if (s == NULL) { - i = ERR_R_MALLOC_FAILURE; - goto err; - } - memcpy(s, p, len); - s[len]='\0'; - p += len; - } else - s = NULL; - - free(ret->data); - ret->length = (int)len; - ret->data = s; - ret->type = tag; - if (a != NULL) - (*a) = ret; - *pp = p; - return (ret); - -err: - ASN1error(i); - if (a == NULL || *a != ret) - ASN1_STRING_free(ret); - return (NULL); -} - -int -i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass) -{ - int ret, r, constructed; - unsigned char *p; - - if (a == NULL) - return (0); - - if (tag == V_ASN1_BIT_STRING) - return (i2d_ASN1_BIT_STRING(a, pp)); - - ret = a->length; - r = ASN1_object_size(0, ret, tag); - if (pp == NULL) - return (r); - p = *pp; - - if ((tag == V_ASN1_SEQUENCE) || (tag == V_ASN1_SET)) - constructed = 1; - else - constructed = 0; - ASN1_put_object(&p, constructed, ret, tag, xclass); - memcpy(p, a->data, a->length); - p += a->length; - *pp = p; - return (r); -} - -ASN1_STRING * -d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, - long length, int Ptag, int Pclass) -{ - ASN1_STRING *ret = NULL; - const unsigned char *p; - unsigned char *s; - long len; - int inf, tag, xclass; - int i = 0; - - if ((a == NULL) || ((*a) == NULL)) { - if ((ret = ASN1_STRING_new()) == NULL) - return (NULL); - } else - ret = (*a); - - p= *pp; - inf = ASN1_get_object(&p, &len, &tag, &xclass, length); - if (inf & 0x80) { - i = ASN1_R_BAD_OBJECT_HEADER; - goto err; - } - - if (tag != Ptag) { - i = ASN1_R_WRONG_TAG; - goto err; - } - - if (inf & V_ASN1_CONSTRUCTED) { - ASN1_const_CTX c; - - c.pp = pp; - c.p = p; - c.inf = inf; - c.slen = len; - c.tag = Ptag; - c.xclass = Pclass; - c.max = (length == 0) ? 0 : (p + length); - if (!asn1_collate_primitive(ret, &c)) - goto err; - else { - p = c.p; - } - } else { - if (len != 0) { - if ((ret->length < len) || (ret->data == NULL)) { - free(ret->data); - ret->data = NULL; - s = malloc(len + 1); - if (s == NULL) { - i = ERR_R_MALLOC_FAILURE; - goto err; - } - } else - s = ret->data; - memcpy(s, p, len); - s[len] = '\0'; - p += len; - } else { - s = NULL; - free(ret->data); - } - - ret->length = (int)len; - ret->data = s; - ret->type = Ptag; - } - - if (a != NULL) - (*a) = ret; - *pp = p; - return (ret); - -err: - if (a == NULL || *a != ret) - ASN1_STRING_free(ret); - ASN1error(i); - return (NULL); -} - - -/* We are about to parse 0..n d2i_ASN1_bytes objects, we are to collapse - * them into the one structure that is then returned */ -/* There have been a few bug fixes for this function from - * Paul Keogh , many thanks to him */ -static int -asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c) -{ - ASN1_STRING *os = NULL; - BUF_MEM b; - int num; - - b.length = 0; - b.max = 0; - b.data = NULL; - - if (a == NULL) { - c->error = ERR_R_PASSED_NULL_PARAMETER; - goto err; - } - - num = 0; - for (;;) { - if (c->inf & 1) { - c->eos = ASN1_const_check_infinite_end(&c->p, - (long)(c->max - c->p)); - if (c->eos) - break; - } else { - if (c->slen <= 0) - break; - } - - c->q = c->p; - if (d2i_ASN1_bytes(&os, &c->p, c->max - c->p, c->tag, - c->xclass) == NULL) { - c->error = ERR_R_ASN1_LIB; - goto err; - } - - if (!BUF_MEM_grow_clean(&b, num + os->length)) { - c->error = ERR_R_BUF_LIB; - goto err; - } - memcpy(&(b.data[num]), os->data, os->length); - if (!(c->inf & 1)) - c->slen -= (c->p - c->q); - num += os->length; - } - - if (!asn1_const_Finish(c)) - goto err; - - a->length = num; - free(a->data); - a->data = (unsigned char *)b.data; - ASN1_STRING_free(os); - return (1); - -err: - ASN1error(c->error); - ASN1_STRING_free(os); - free(b.data); - return (0); -} diff --git a/crypto/asn1/a_digest.c b/crypto/asn1/a_digest.c index 085a57d8..5b95adf1 100644 --- a/crypto/asn1/a_digest.c +++ b/crypto/asn1/a_digest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_digest.c,v 1.15 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: a_digest.c,v 1.16 2018/04/06 09:19:36 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -77,8 +77,11 @@ ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, if (!str) return (0); - if (!EVP_Digest(str, i, md, len, type, NULL)) - return 0; + if (!EVP_Digest(str, i, md, len, type, NULL)) { + free(str); + return (0); + } + free(str); return (1); } diff --git a/crypto/asn1/a_enum.c b/crypto/asn1/a_enum.c index 23875958..c7d3a9a0 100644 --- a/crypto/asn1/a_enum.c +++ b/crypto/asn1/a_enum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_enum.c,v 1.18 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: a_enum.c,v 1.19 2018/04/25 11:48:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -104,7 +104,7 @@ ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) } long -ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) +ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a) { int neg = 0, i; long r = 0; @@ -134,7 +134,7 @@ ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) } ASN1_ENUMERATED * -BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai) +BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai) { ASN1_ENUMERATED *ret; int len, j; @@ -177,7 +177,7 @@ BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai) } BIGNUM * -ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn) +ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn) { BIGNUM *ret; diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index 95d0f6db..1b2ebfb3 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_int.c,v 1.31 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: a_int.c,v 1.33 2019/03/26 09:15:07 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include @@ -63,9 +64,18 @@ #include #include +static int +ASN1_INTEGER_valid(const ASN1_INTEGER *a) +{ + return (a != NULL && a->length >= 0); +} + ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x) { + if (!ASN1_INTEGER_valid(x)) + return NULL; + return ASN1_STRING_dup(x); } @@ -123,8 +133,9 @@ i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) int pad = 0, ret, i, neg; unsigned char *p, *n, pb = 0; - if (a == NULL) - return (0); + if (!ASN1_INTEGER_valid(a)) + return 0; + neg = a->type & V_ASN1_NEG; if (a->length == 0) ret = 1; @@ -201,11 +212,24 @@ c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, long len) } else ret = (*a); + if (!ASN1_INTEGER_valid(ret)) { + /* + * XXX using i for an alert is confusing, + * we should call this al + */ + i = ERR_R_ASN1_LENGTH_MISMATCH; + goto err; + } + p = *pp; pend = p + len; /* We must malloc stuff, even for 0 bytes otherwise it * signifies a missing NULL parameter. */ + if (len < 0 || len > INT_MAX) { + i = ERR_R_ASN1_LENGTH_MISMATCH; + goto err; + } s = malloc(len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; @@ -294,6 +318,11 @@ d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length) } else ret = (*a); + if (!ASN1_INTEGER_valid(ret)) { + i = ERR_R_ASN1_LENGTH_MISMATCH; + goto err; + } + p = *pp; inf = ASN1_get_object(&p, &len, &tag, &xclass, length); if (inf & 0x80) { @@ -308,6 +337,10 @@ d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length) /* We must malloc stuff, even for 0 bytes otherwise it * signifies a missing NULL parameter. */ + if (len < 0 || len > INT_MAX) { + i = ERR_R_ASN1_LENGTH_MISMATCH; + goto err; + } s = malloc(len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; @@ -375,6 +408,12 @@ ASN1_INTEGER_set(ASN1_INTEGER *a, long v) return (1); } +/* + * XXX this particular API is a gibbering eidrich horror that makes it + * impossible to determine valid return cases from errors.. "a bit + * ugly" is preserved for posterity, unfortunately this is probably + * unfixable without changing public API + */ long ASN1_INTEGER_get(const ASN1_INTEGER *a) { @@ -389,6 +428,9 @@ ASN1_INTEGER_get(const ASN1_INTEGER *a) else if (i != V_ASN1_INTEGER) return -1; + if (!ASN1_INTEGER_valid(a)) + return -1; /* XXX best effort */ + if (a->length > (int)sizeof(long)) { /* hmm... a bit ugly, return all ones */ return -1; @@ -419,6 +461,10 @@ BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) ASN1error(ERR_R_NESTED_ASN1_ERROR); goto err; } + + if (!ASN1_INTEGER_valid(ret)) + goto err; + if (BN_is_negative(bn)) ret->type = V_ASN1_NEG_INTEGER; else @@ -453,6 +499,9 @@ ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn) { BIGNUM *ret; + if (!ASN1_INTEGER_valid(ai)) + return (NULL); + if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL) ASN1error(ASN1_R_BN_LIB); else if (ai->type == V_ASN1_NEG_INTEGER) diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c index e10af97d..16c3a1c0 100644 --- a/crypto/asn1/a_object.c +++ b/crypto/asn1/a_object.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_object.c,v 1.30 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: a_object.c,v 1.31 2018/04/25 11:48:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -67,7 +67,7 @@ #include int -i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) +i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp) { unsigned char *p; int objsize; @@ -213,13 +213,13 @@ a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num) } int -i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a) +i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a) { return OBJ_obj2txt(buf, buf_len, a, 0); } int -i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a) +i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a) { char *tmp = NULL; size_t tlen = 256; diff --git a/crypto/asn1/a_set.c b/crypto/asn1/a_set.c deleted file mode 100644 index 4d5cae33..00000000 --- a/crypto/asn1/a_set.c +++ /dev/null @@ -1,236 +0,0 @@ -/* $OpenBSD: a_set.c,v 1.18 2017/01/29 17:49:22 beck Exp $ */ -/* 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.] - */ - -#include -#include - -#include -#include - -#ifndef NO_ASN1_OLD - -typedef struct { - unsigned char *pbData; - int cbData; -} MYBLOB; - -/* SetBlobCmp - * This function compares two elements of SET_OF block - */ -static int -SetBlobCmp(const void *elem1, const void *elem2) -{ - const MYBLOB *b1 = (const MYBLOB *)elem1; - const MYBLOB *b2 = (const MYBLOB *)elem2; - int r; - - r = memcmp(b1->pbData, b2->pbData, - b1->cbData < b2->cbData ? b1->cbData : b2->cbData); - if (r != 0) - return r; - return b1->cbData - b2->cbData; -} - -/* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */ -int -i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, i2d_of_void *i2d, - int ex_tag, int ex_class, int is_set) -{ - int ret = 0, r; - int i; - unsigned char *p; - unsigned char *pStart, *pTempMem; - MYBLOB *rgSetBlob; - int totSize; - - if (a == NULL) - return 0; - for (i = sk_OPENSSL_BLOCK_num(a) - 1; i >= 0; i--) - ret += i2d(sk_OPENSSL_BLOCK_value(a, i), NULL); - r = ASN1_object_size(1, ret, ex_tag); - if (pp == NULL) - return r; - - p = *pp; - ASN1_put_object(&p, 1, ret, ex_tag, ex_class); - - /* Modified by gp@nsj.co.jp */ - /* And then again by Ben */ - /* And again by Steve */ - - if (!is_set || (sk_OPENSSL_BLOCK_num(a) < 2)) { - for (i = 0; i < sk_OPENSSL_BLOCK_num(a); i++) - i2d(sk_OPENSSL_BLOCK_value(a, i), &p); - - *pp = p; - return r; - } - - pStart = p; /* Catch the beg of Setblobs*/ - /* In this array we will store the SET blobs */ - rgSetBlob = reallocarray(NULL, sk_OPENSSL_BLOCK_num(a), sizeof(MYBLOB)); - if (rgSetBlob == NULL) { - ASN1error(ERR_R_MALLOC_FAILURE); - return 0; - } - - for (i = 0; i < sk_OPENSSL_BLOCK_num(a); i++) { - rgSetBlob[i].pbData = p; /* catch each set encode blob */ - i2d(sk_OPENSSL_BLOCK_value(a, i), &p); - /* Length of this SetBlob */ - rgSetBlob[i].cbData = p - rgSetBlob[i].pbData; - } - *pp = p; - totSize = p - pStart; /* This is the total size of all set blobs */ - - /* Now we have to sort the blobs. I am using a simple algo. - * Sort ptrs - * Copy to temp-mem - * Copy from temp-mem to user-mem - */ - qsort(rgSetBlob, sk_OPENSSL_BLOCK_num(a), sizeof(MYBLOB), SetBlobCmp); - if ((pTempMem = malloc(totSize)) == NULL) { - free(rgSetBlob); - ASN1error(ERR_R_MALLOC_FAILURE); - return 0; - } - - /* Copy to temp mem */ - p = pTempMem; - for (i = 0; i < sk_OPENSSL_BLOCK_num(a); ++i) { - memcpy(p, rgSetBlob[i].pbData, rgSetBlob[i].cbData); - p += rgSetBlob[i].cbData; - } - - /* Copy back to user mem*/ - memcpy(pStart, pTempMem, totSize); - free(pTempMem); - free(rgSetBlob); - - return r; -} - -STACK_OF(OPENSSL_BLOCK) * -d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, const unsigned char **pp, long length, - d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK), int ex_tag, - int ex_class) -{ - ASN1_const_CTX c; - STACK_OF(OPENSSL_BLOCK) *ret = NULL; - - if (a == NULL || (*a) == NULL) { - if ((ret = sk_OPENSSL_BLOCK_new_null()) == NULL) { - ASN1error(ERR_R_MALLOC_FAILURE); - goto err; - } - } else - ret = *a; - - c.p = *pp; - c.max = (length == 0) ? 0 : (c.p + length); - - c.inf = ASN1_get_object(&c.p, &c.slen, &c.tag, &c.xclass, c.max - c.p); - if (c.inf & 0x80) - goto err; - if (ex_class != c.xclass) { - ASN1error(ASN1_R_BAD_CLASS); - goto err; - } - if (ex_tag != c.tag) { - ASN1error(ASN1_R_BAD_TAG); - goto err; - } - if (c.slen + c.p > c.max) { - ASN1error(ASN1_R_LENGTH_ERROR); - goto err; - } - /* check for infinite constructed - it can be as long - * as the amount of data passed to us */ - if (c.inf == (V_ASN1_CONSTRUCTED + 1)) - c.slen = length + *pp - c.p; - c.max = c.p + c.slen; - - while (c.p < c.max) { - char *s; - - if (M_ASN1_D2I_end_sequence()) - break; - if ((s = d2i(NULL, &c.p, c.slen)) == NULL) { - ASN1error(ASN1_R_ERROR_PARSING_SET_ELEMENT); - asn1_add_error(*pp, (int)(c.p - *pp)); - goto err; - } - if (!sk_OPENSSL_BLOCK_push(ret, s)) - goto err; - } - if (a != NULL) - *a = ret; - *pp = c.p; - return ret; - -err: - if (a == NULL || *a != ret) { - if (free_func != NULL) - sk_OPENSSL_BLOCK_pop_free(ret, free_func); - else - sk_OPENSSL_BLOCK_free(ret); - } - return NULL; -} - -#endif diff --git a/crypto/asn1/a_strex.c b/crypto/asn1/a_strex.c index f60a70d9..4e3deccf 100644 --- a/crypto/asn1/a_strex.c +++ b/crypto/asn1/a_strex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_strex.c,v 1.25 2015/02/07 13:19:15 doug Exp $ */ +/* $OpenBSD: a_strex.c,v 1.28 2018/05/19 10:46:28 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -289,7 +289,7 @@ do_hex_dump(char_io *io_ch, void *arg, unsigned char *buf, int buflen) */ static int -do_dump(unsigned long lflags, char_io *io_ch, void *arg, ASN1_STRING *str) +do_dump(unsigned long lflags, char_io *io_ch, void *arg, const ASN1_STRING *str) { /* Placing the ASN1_STRING in a temp ASN1_TYPE allows * the DER encoding to readily obtained @@ -346,7 +346,8 @@ static const signed char tag2nbyte[] = { */ static int -do_print_ex(char_io *io_ch, void *arg, unsigned long lflags, ASN1_STRING *str) +do_print_ex(char_io *io_ch, void *arg, unsigned long lflags, + const ASN1_STRING *str) { int outlen, len; int type; @@ -439,7 +440,7 @@ do_indent(char_io *io_ch, void *arg, int indent) #define FN_WIDTH_SN 10 static int -do_name_ex(char_io *io_ch, void *arg, X509_NAME *n, int indent, +do_name_ex(char_io *io_ch, void *arg, const X509_NAME *n, int indent, unsigned long flags) { int i, prev = -1, orflags, cnt; @@ -581,7 +582,8 @@ do_name_ex(char_io *io_ch, void *arg, X509_NAME *n, int indent, /* Wrappers round the main functions */ int -X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags) +X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent, + unsigned long flags) { if (flags == XN_FLAG_COMPAT) return X509_NAME_print(out, nm, indent); @@ -589,7 +591,8 @@ X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags) } int -X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags) +X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, + unsigned long flags) { if (flags == XN_FLAG_COMPAT) { BIO *btmp; @@ -605,13 +608,13 @@ X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags) } int -ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags) +ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags) { return do_print_ex(send_bio_chars, out, flags, str); } int -ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags) +ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags) { return do_print_ex(send_fp_chars, fp, flags, str); } @@ -621,7 +624,7 @@ ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags) */ int -ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in) +ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in) { ASN1_STRING stmp, *str = &stmp; int mbflag, type, ret; diff --git a/crypto/asn1/a_time_tm.c b/crypto/asn1/a_time_tm.c index b13f7c76..b6e22cbd 100644 --- a/crypto/asn1/a_time_tm.c +++ b/crypto/asn1/a_time_tm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_time_tm.c,v 1.14 2017/08/28 17:42:47 jsing Exp $ */ +/* $OpenBSD: a_time_tm.c,v 1.15 2018/04/25 11:48:21 tb Exp $ */ /* * Copyright (c) 2015 Bob Beck * @@ -337,7 +337,7 @@ ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec) } int -ASN1_TIME_check(ASN1_TIME *t) +ASN1_TIME_check(const ASN1_TIME *t) { if (t->type != V_ASN1_GENERALIZEDTIME && t->type != V_ASN1_UTCTIME) return (0); @@ -345,7 +345,7 @@ ASN1_TIME_check(ASN1_TIME *t) } ASN1_GENERALIZEDTIME * -ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out) +ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, ASN1_GENERALIZEDTIME **out) { ASN1_GENERALIZEDTIME *tmp = NULL; struct tm tm; @@ -386,7 +386,7 @@ ASN1_TIME_set_string(ASN1_TIME *s, const char *str) */ int -ASN1_UTCTIME_check(ASN1_UTCTIME *d) +ASN1_UTCTIME_check(const ASN1_UTCTIME *d) { if (d->type != V_ASN1_UTCTIME) return (0); @@ -442,7 +442,7 @@ ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t2) */ int -ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) +ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d) { if (d->type != V_ASN1_GENERALIZEDTIME) return (0); diff --git a/crypto/asn1/a_type.c b/crypto/asn1/a_type.c index ed1dec06..11d38300 100644 --- a/crypto/asn1/a_type.c +++ b/crypto/asn1/a_type.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_type.c,v 1.19 2016/05/04 15:00:24 tedu Exp $ */ +/* $OpenBSD: a_type.c,v 1.20 2018/04/25 11:48:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -62,7 +62,7 @@ #include int -ASN1_TYPE_get(ASN1_TYPE *a) +ASN1_TYPE_get(const ASN1_TYPE *a) { if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL)) return (a->type); @@ -108,7 +108,7 @@ ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value) /* Returns 0 if they are equal, != 0 otherwise. */ int -ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b) +ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b) { int result = -1; diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c index b27d72af..505e9869 100644 --- a/crypto/asn1/ameth_lib.c +++ b/crypto/asn1/ameth_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ameth_lib.c,v 1.16 2017/01/21 04:31:25 jsing Exp $ */ +/* $OpenBSD: ameth_lib.c,v 1.19 2018/08/24 20:22:15 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -299,7 +299,7 @@ EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id, int *ppkey_flags, } const EVP_PKEY_ASN1_METHOD* -EVP_PKEY_get0_asn1(EVP_PKEY *pkey) +EVP_PKEY_get0_asn1(const EVP_PKEY *pkey) { return pkey->ameth; } @@ -309,59 +309,26 @@ EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, const char *info) { EVP_PKEY_ASN1_METHOD *ameth; - ameth = calloc(1, sizeof(EVP_PKEY_ASN1_METHOD)); - if (!ameth) + if ((ameth = calloc(1, sizeof(EVP_PKEY_ASN1_METHOD))) == NULL) return NULL; ameth->pkey_id = id; ameth->pkey_base_id = id; ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC; - if (info) { - ameth->info = strdup(info); - if (!ameth->info) + if (info != NULL) { + if ((ameth->info = strdup(info)) == NULL) goto err; - } else - ameth->info = NULL; + } - if (pem_str) { - ameth->pem_str = strdup(pem_str); - if (!ameth->pem_str) + if (pem_str != NULL) { + if ((ameth->pem_str = strdup(pem_str)) == NULL) goto err; - } else - ameth->pem_str = NULL; - - ameth->pub_decode = 0; - ameth->pub_encode = 0; - ameth->pub_cmp = 0; - ameth->pub_print = 0; - - ameth->priv_decode = 0; - ameth->priv_encode = 0; - ameth->priv_print = 0; - - ameth->old_priv_encode = 0; - ameth->old_priv_decode = 0; - - ameth->item_verify = 0; - ameth->item_sign = 0; - - ameth->pkey_size = 0; - ameth->pkey_bits = 0; - - ameth->param_decode = 0; - ameth->param_encode = 0; - ameth->param_missing = 0; - ameth->param_copy = 0; - ameth->param_cmp = 0; - ameth->param_print = 0; - - ameth->pkey_free = 0; - ameth->pkey_ctrl = 0; + } return ameth; -err: + err: EVP_PKEY_asn1_free(ameth); return NULL; } @@ -390,6 +357,7 @@ EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, const EVP_PKEY_ASN1_METHOD *src) dst->param_copy = src->param_copy; dst->param_cmp = src->param_cmp; dst->param_print = src->param_print; + dst->sig_print = src->sig_print; dst->pkey_free = src->pkey_free; dst->pkey_ctrl = src->pkey_ctrl; @@ -428,7 +396,7 @@ EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, - int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf), + int (*priv_decode)(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf), int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk), int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx)) diff --git a/crypto/asn1/asn1_err.c b/crypto/asn1/asn1_err.c index 0c827a92..5cc35508 100644 --- a/crypto/asn1/asn1_err.c +++ b/crypto/asn1/asn1_err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_err.c,v 1.20 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: asn1_err.c,v 1.21 2018/03/29 02:29:24 inoguchi Exp $ */ /* ==================================================================== * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. * @@ -150,6 +150,7 @@ static ERR_STRING_DATA ASN1_str_reasons[] = { {ERR_REASON(ASN1_R_MSTRING_NOT_UNIVERSAL), "mstring not universal"}, {ERR_REASON(ASN1_R_MSTRING_WRONG_TAG) , "mstring wrong tag"}, {ERR_REASON(ASN1_R_NESTED_ASN1_STRING) , "nested asn1 string"}, + {ERR_REASON(ASN1_R_NESTED_TOO_DEEP) , "nested too deep"}, {ERR_REASON(ASN1_R_NON_HEX_CHARACTERS) , "non hex characters"}, {ERR_REASON(ASN1_R_NOT_ASCII_FORMAT) , "not ascii format"}, {ERR_REASON(ASN1_R_NOT_ENOUGH_DATA) , "not enough data"}, diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c index f84cc613..ad7802cb 100644 --- a/crypto/asn1/asn1_gen.c +++ b/crypto/asn1/asn1_gen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_gen.c,v 1.16 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: asn1_gen.c,v 1.17 2018/04/25 11:48:21 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2002. */ @@ -121,7 +121,7 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype); static int asn1_str2tag(const char *tagstr, int len); ASN1_TYPE * -ASN1_generate_nconf(char *str, CONF *nconf) +ASN1_generate_nconf(const char *str, CONF *nconf) { X509V3_CTX cnf; @@ -133,7 +133,7 @@ ASN1_generate_nconf(char *str, CONF *nconf) } ASN1_TYPE * -ASN1_generate_v3(char *str, X509V3_CTX *cnf) +ASN1_generate_v3(const char *str, X509V3_CTX *cnf) { ASN1_TYPE *ret; tag_exp_arg asn1_tags; diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c index 852644a7..5dc520c4 100644 --- a/crypto/asn1/asn1_lib.c +++ b/crypto/asn1/asn1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_lib.c,v 1.39 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: asn1_lib.c,v 1.44 2018/11/17 09:34:11 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -98,7 +98,7 @@ ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, { int i, ret; long l; - const unsigned char *p= *pp; + const unsigned char *p = *pp; int tag, xclass, inf; long max = omax; @@ -106,7 +106,7 @@ ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, goto err; ret = (*p & V_ASN1_CONSTRUCTED); xclass = (*p & V_ASN1_PRIVATE); - i= *p & V_ASN1_PRIMITIVE_TAG; + i = *p & V_ASN1_PRIMITIVE_TAG; if (i == V_ASN1_PRIMITIVE_TAG) { /* high-tag */ p++; if (--max == 0) @@ -156,7 +156,7 @@ ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, int max) { - const unsigned char *p= *pp; + const unsigned char *p = *pp; unsigned long ret = 0; unsigned int i; @@ -168,7 +168,7 @@ asn1_get_length(const unsigned char **pp, int *inf, long *rl, int max) p++; } else { *inf = 0; - i= *p & 0x7f; + i = *p & 0x7f; if (*(p++) & 0x80) { if (max < (int)i) return (0); @@ -199,7 +199,7 @@ void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, int xclass) { - unsigned char *p= *pp; + unsigned char *p = *pp; int i, ttag; i = (constructed) ? V_ASN1_CONSTRUCTED : 0; @@ -240,7 +240,7 @@ ASN1_put_eoc(unsigned char **pp) static void asn1_put_length(unsigned char **pp, int length) { - unsigned char *p= *pp; + unsigned char *p = *pp; int i, l; if (length <= 127) @@ -285,62 +285,6 @@ ASN1_object_size(int constructed, int length, int tag) return (ret); } -static int -_asn1_Finish(ASN1_const_CTX *c) -{ - if ((c->inf == (1|V_ASN1_CONSTRUCTED)) && (!c->eos)) { - if (!ASN1_const_check_infinite_end(&c->p, c->slen)) { - c->error = ERR_R_MISSING_ASN1_EOS; - return (0); - } - } - if (((c->slen != 0) && !(c->inf & 1)) || - ((c->slen < 0) && (c->inf & 1))) { - c->error = ERR_R_ASN1_LENGTH_MISMATCH; - return (0); - } - return (1); -} - -int -asn1_Finish(ASN1_CTX *c) -{ - return _asn1_Finish((ASN1_const_CTX *)c); -} - -int -asn1_const_Finish(ASN1_const_CTX *c) -{ - return _asn1_Finish(c); -} - -int -asn1_GetSequence(ASN1_const_CTX *c, long *length) -{ - const unsigned char *q; - - q = c->p; - c->inf = ASN1_get_object(&(c->p), &(c->slen), &(c->tag), &(c->xclass), - *length); - if (c->inf & 0x80) { - c->error = ERR_R_BAD_GET_ASN1_OBJECT_CALL; - return (0); - } - if (c->tag != V_ASN1_SEQUENCE) { - c->error = ERR_R_EXPECTING_AN_ASN1_SEQUENCE; - return (0); - } - (*length) -= (c->p - q); - if (c->max && (*length < 0)) { - c->error = ERR_R_ASN1_LENGTH_MISMATCH; - return (0); - } - if (c->inf == (1|V_ASN1_CONSTRUCTED)) - c->slen= *length+ *(c->pp) - c->p; - c->eos = 0; - return (1); -} - int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str) { @@ -394,7 +338,7 @@ ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len) if (data != NULL) { memmove(str->data, data, len); } - str->data[str->length]='\0'; + str->data[str->length] = '\0'; return (1); } @@ -474,7 +418,7 @@ ASN1_STRING_length_set(ASN1_STRING *x, int len) } int -ASN1_STRING_type(ASN1_STRING *x) +ASN1_STRING_type(const ASN1_STRING *x) { return (x->type); } @@ -484,3 +428,9 @@ ASN1_STRING_data(ASN1_STRING *x) { return (x->data); } + +const unsigned char * +ASN1_STRING_get0_data(const ASN1_STRING *x) +{ + return (x->data); +} diff --git a/crypto/asn1/asn1_locl.h b/crypto/asn1/asn1_locl.h index aa35f7b8..5ade6c7e 100644 --- a/crypto/asn1/asn1_locl.h +++ b/crypto/asn1/asn1_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_locl.h,v 1.10 2017/08/27 01:39:26 beck Exp $ */ +/* $OpenBSD: asn1_locl.h,v 1.11 2018/08/24 20:22:15 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -86,7 +86,7 @@ struct evp_pkey_asn1_method_st { int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx); - int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf); + int (*priv_decode)(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf); int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk); int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx); diff --git a/crypto/asn1/asn1_par.c b/crypto/asn1/asn1_par.c index 72326a9c..21f92d29 100644 --- a/crypto/asn1/asn1_par.c +++ b/crypto/asn1/asn1_par.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_par.c,v 1.25 2015/09/30 19:01:14 jsing Exp $ */ +/* $OpenBSD: asn1_par.c,v 1.27 2019/03/24 16:07:25 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -130,6 +130,10 @@ asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offset, p = *pp; tot = p + length; op = p - 1; + if (depth > 128) { + BIO_printf(bp, "Max depth exceeded\n"); + goto end; + } while ((p < tot) && (op < p)) { op = p; j = ASN1_get_object(&p, &len, &tag, &xclass, length); @@ -177,12 +181,14 @@ asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offset, ret = 0; goto end; } - if ((r == 2) || (p >= tot)) + if ((r == 2) || (p >= tot)) { + len = (long)(p - ep); break; + } } - } else + } else { while (p < ep) { - r = asn1_parse2(bp, &p, (long)len, + r = asn1_parse2(bp, &p, (long)(ep - p), offset + (p - *pp), depth + 1, indent, dump); if (r == 0) { @@ -190,6 +196,7 @@ asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offset, goto end; } } + } } else if (xclass != 0) { p += len; if (BIO_write(bp, "\n", 1) <= 0) diff --git a/crypto/asn1/asn_pack.c b/crypto/asn1/asn_pack.c index 09d15058..090beff0 100644 --- a/crypto/asn1/asn_pack.c +++ b/crypto/asn1/asn_pack.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn_pack.c,v 1.16 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: asn_pack.c,v 1.18 2018/10/24 17:57:22 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -61,112 +61,7 @@ #include #include -#ifndef NO_ASN1_OLD - -/* ASN1 packing and unpacking functions */ - -/* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */ - -STACK_OF(OPENSSL_BLOCK) * -ASN1_seq_unpack(const unsigned char *buf, int len, d2i_of_void *d2i, - void (*free_func)(OPENSSL_BLOCK)) -{ - STACK_OF(OPENSSL_BLOCK) *sk; - const unsigned char *pbuf; - - pbuf = buf; - if (!(sk = d2i_ASN1_SET(NULL, &pbuf, len, d2i, free_func, - V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL))) - ASN1error(ASN1_R_DECODE_ERROR); - return sk; -} - -/* Turn a STACK structures into an ASN1 encoded SEQUENCE OF structure in a - * OPENSSL_malloc'ed buffer - */ - -unsigned char * -ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, - unsigned char **buf, int *len) -{ - int safelen; - unsigned char *safe, *p; - - if (!(safelen = i2d_ASN1_SET(safes, NULL, i2d, V_ASN1_SEQUENCE, - V_ASN1_UNIVERSAL, IS_SEQUENCE))) { - ASN1error(ASN1_R_ENCODE_ERROR); - return NULL; - } - if (!(safe = malloc(safelen))) { - ASN1error(ERR_R_MALLOC_FAILURE); - return NULL; - } - p = safe; - i2d_ASN1_SET(safes, &p, i2d, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, - IS_SEQUENCE); - if (len) - *len = safelen; - if (buf) - *buf = safe; - return safe; -} - -/* Extract an ASN1 object from an ASN1_STRING */ - -void * -ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i) -{ - const unsigned char *p; - char *ret; - - p = oct->data; - if (!(ret = d2i(NULL, &p, oct->length))) - ASN1error(ASN1_R_DECODE_ERROR); - return ret; -} - -/* Pack an ASN1 object into an ASN1_STRING */ - -ASN1_STRING * -ASN1_pack_string(void *obj, i2d_of_void *i2d, ASN1_STRING **oct) -{ - unsigned char *p; - ASN1_STRING *octmp; - - if (!oct || !*oct) { - if (!(octmp = ASN1_STRING_new())) { - ASN1error(ERR_R_MALLOC_FAILURE); - return NULL; - } - } else - octmp = *oct; - - if (!(octmp->length = i2d(obj, NULL))) { - ASN1error(ASN1_R_ENCODE_ERROR); - goto err; - } - if (!(p = malloc (octmp->length))) { - ASN1error(ERR_R_MALLOC_FAILURE); - goto err; - } - octmp->data = p; - i2d (obj, &p); - if (oct) - *oct = octmp; - return octmp; -err: - if (!oct || octmp != *oct) { - ASN1_STRING_free(octmp); - if (oct) - *oct = NULL; - } - return NULL; -} - -#endif - -/* ASN1_ITEM versions of the above */ - +/* Pack an ASN1 object into an ASN1_STRING. */ ASN1_STRING * ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct) { @@ -200,10 +95,9 @@ ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct) return NULL; } -/* Extract an ASN1 object from an ASN1_STRING */ - +/* Extract an ASN1 object from an ASN1_STRING. */ void * -ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it) +ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it) { const unsigned char *p; void *ret; diff --git a/crypto/asn1/bio_asn1.c b/crypto/asn1/bio_asn1.c index 02ad3106..93bcb338 100644 --- a/crypto/asn1/bio_asn1.c +++ b/crypto/asn1/bio_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_asn1.c,v 1.12 2015/12/23 01:46:33 mmcc Exp $ */ +/* $OpenBSD: bio_asn1.c,v 1.13 2018/05/01 13:29:09 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -125,7 +125,7 @@ static int asn1_bio_setup_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx, asn1_ps_func *setup, asn1_bio_state_t ex_state, asn1_bio_state_t other_state); -static BIO_METHOD methods_asn1 = { +static const BIO_METHOD methods_asn1 = { .type = BIO_TYPE_ASN1, .name = "asn1", .bwrite = asn1_bio_write, @@ -138,7 +138,7 @@ static BIO_METHOD methods_asn1 = { .callback_ctrl = asn1_bio_callback_ctrl }; -BIO_METHOD * +const BIO_METHOD * BIO_f_asn1(void) { return (&methods_asn1); diff --git a/crypto/asn1/d2i_pr.c b/crypto/asn1/d2i_pr.c index 7a5880a8..e450dee1 100644 --- a/crypto/asn1/d2i_pr.c +++ b/crypto/asn1/d2i_pr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d2i_pr.c,v 1.15 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: d2i_pr.c,v 1.17 2019/04/10 16:23:55 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -76,6 +76,7 @@ EVP_PKEY * d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) { + const unsigned char *p = *pp; EVP_PKEY *ret; if ((a == NULL) || (*a == NULL)) { @@ -86,10 +87,8 @@ d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) } else { ret = *a; #ifndef OPENSSL_NO_ENGINE - if (ret->engine) { - ENGINE_finish(ret->engine); - ret->engine = NULL; - } + ENGINE_finish(ret->engine); + ret->engine = NULL; #endif } @@ -102,6 +101,7 @@ d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) !ret->ameth->old_priv_decode(ret, pp, length)) { if (ret->ameth->priv_decode) { PKCS8_PRIV_KEY_INFO *p8 = NULL; + *pp = p; /* XXX */ p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length); if (!p8) goto err; diff --git a/crypto/asn1/evp_asn1.c b/crypto/asn1/evp_asn1.c index 83228bb5..4b7ebbb0 100644 --- a/crypto/asn1/evp_asn1.c +++ b/crypto/asn1/evp_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_asn1.c,v 1.19 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: evp_asn1.c,v 1.23 2018/11/09 04:20:27 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -60,11 +60,11 @@ #include #include -#include +#include #include int -ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len) +ASN1_TYPE_set_octetstring(ASN1_TYPE *a, const unsigned char *data, int len) { ASN1_STRING *os; @@ -78,9 +78,8 @@ ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len) return (1); } -/* int max_len: for returned value */ int -ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len) +ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len) { int ret, num; unsigned char *p; @@ -100,101 +99,95 @@ ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len) return (ret); } +typedef struct { + ASN1_INTEGER *num; + ASN1_OCTET_STRING *value; +} ASN1_int_octetstring; + +static const ASN1_TEMPLATE ASN1_INT_OCTETSTRING_seq_tt[] = { + { + .offset = offsetof(ASN1_int_octetstring, num), + .field_name = "num", + .item = &ASN1_INTEGER_it, + }, + { + .offset = offsetof(ASN1_int_octetstring, value), + .field_name = "value", + .item = &ASN1_OCTET_STRING_it, + }, +}; + +const ASN1_ITEM ASN1_INT_OCTETSTRING_it = { + .itype = ASN1_ITYPE_SEQUENCE, + .utype = V_ASN1_SEQUENCE, + .templates = ASN1_INT_OCTETSTRING_seq_tt, + .tcount = sizeof(ASN1_INT_OCTETSTRING_seq_tt) / sizeof(ASN1_TEMPLATE), + .size = sizeof(ASN1_int_octetstring), + .sname = "ASN1_INT_OCTETSTRING", +}; + int -ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, +ASN1_TYPE_set_int_octetstring(ASN1_TYPE *at, long num, const unsigned char *data, int len) { - int n, size; - ASN1_OCTET_STRING os, *osp; - ASN1_INTEGER in; - unsigned char *p; - unsigned char buf[32]; /* when they have 256bit longs, - * I'll be in trouble */ - in.data = buf; - in.length = 32; - os.data = data; - os.type = V_ASN1_OCTET_STRING; - os.length = len; - ASN1_INTEGER_set(&in, num); - n = i2d_ASN1_INTEGER(&in, NULL); - n += i2d_ASN1_bytes((ASN1_STRING *)&os, NULL, V_ASN1_OCTET_STRING, - V_ASN1_UNIVERSAL); - - size = ASN1_object_size(1, n, V_ASN1_SEQUENCE); - - if ((osp = ASN1_STRING_new()) == NULL) - return (0); - /* Grow the 'string' */ - if (!ASN1_STRING_set(osp, NULL, size)) { - ASN1_STRING_free(osp); - return (0); - } + ASN1_int_octetstring *ios; + ASN1_STRING *sp = NULL; + int ret = 0; + + if ((ios = (ASN1_int_octetstring *)ASN1_item_new( + &ASN1_INT_OCTETSTRING_it)) == NULL) + goto err; + if (!ASN1_INTEGER_set(ios->num, num)) + goto err; + if (!ASN1_OCTET_STRING_set(ios->value, data, len)) + goto err; - ASN1_STRING_length_set(osp, size); - p = ASN1_STRING_data(osp); + if ((sp = ASN1_item_pack(ios, &ASN1_INT_OCTETSTRING_it, NULL)) == NULL) + goto err; - ASN1_put_object(&p, 1,n, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL); - i2d_ASN1_INTEGER(&in, &p); - i2d_ASN1_bytes((ASN1_STRING *)&os, &p, V_ASN1_OCTET_STRING, - V_ASN1_UNIVERSAL); + ASN1_TYPE_set(at, V_ASN1_SEQUENCE, sp); + sp = NULL; - ASN1_TYPE_set(a, V_ASN1_SEQUENCE, osp); - return (1); + ret = 1; + + err: + ASN1_item_free((ASN1_VALUE *)ios, &ASN1_INT_OCTETSTRING_it); + ASN1_STRING_free(sp); + + return ret; } -/* we return the actual length..., num may be missing, in which - * case, set it to zero */ -/* int max_len: for returned value */ int -ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data, +ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *at, long *num, unsigned char *data, int max_len) { - int ret = -1, n; - ASN1_INTEGER *ai = NULL; - ASN1_OCTET_STRING *os = NULL; - const unsigned char *p; - long length; - ASN1_const_CTX c; - - if ((a->type != V_ASN1_SEQUENCE) || (a->value.sequence == NULL)) { - goto err; - } - p = ASN1_STRING_data(a->value.sequence); - length = ASN1_STRING_length(a->value.sequence); + ASN1_STRING *sp = at->value.sequence; + ASN1_int_octetstring *ios = NULL; + int ret = -1; + int len; - c.pp = &p; - c.p = p; - c.max = p + length; - c.error = ASN1_R_DATA_IS_WRONG; - - M_ASN1_D2I_start_sequence(); - c.q = c.p; - if ((ai = d2i_ASN1_INTEGER(NULL, &c.p, c.slen)) == NULL) - goto err; - c.slen -= (c.p - c.q); - c.q = c.p; - if ((os = d2i_ASN1_OCTET_STRING(NULL, &c.p, c.slen)) == NULL) + if (at->type != V_ASN1_SEQUENCE || sp == NULL) goto err; - c.slen -= (c.p - c.q); - if (!M_ASN1_D2I_end_sequence()) + + if ((ios = ASN1_item_unpack(sp, &ASN1_INT_OCTETSTRING_it)) == NULL) goto err; if (num != NULL) - *num = ASN1_INTEGER_get(ai); + *num = ASN1_INTEGER_get(ios->num); + if (data != NULL) { + len = ASN1_STRING_length(ios->value); + if (len > max_len) + len = max_len; + memcpy(data, ASN1_STRING_data(ios->value), len); + } - ret = ASN1_STRING_length(os); - if (max_len > ret) - n = ret; - else - n = max_len; + ret = ASN1_STRING_length(ios->value); + + err: + ASN1_item_free((ASN1_VALUE *)ios, &ASN1_INT_OCTETSTRING_it); - if (data != NULL) - memcpy(data, ASN1_STRING_data(os), n); - if (0) { -err: + if (ret == -1) ASN1error(ASN1_R_DATA_IS_WRONG); - } - ASN1_OCTET_STRING_free(os); - ASN1_INTEGER_free(ai); - return (ret); + + return ret; } diff --git a/crypto/asn1/f_enum.c b/crypto/asn1/f_enum.c index 64feb97d..cc4b7dfc 100644 --- a/crypto/asn1/f_enum.c +++ b/crypto/asn1/f_enum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: f_enum.c,v 1.15 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: f_enum.c,v 1.16 2018/04/25 11:48:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -65,7 +65,7 @@ /* Based on a_int.c: equivalent ENUMERATED functions */ int -i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a) +i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a) { int i, n = 0; static const char h[] = "0123456789ABCDEF"; diff --git a/crypto/asn1/f_int.c b/crypto/asn1/f_int.c index 75168872..d03fafe8 100644 --- a/crypto/asn1/f_int.c +++ b/crypto/asn1/f_int.c @@ -1,4 +1,4 @@ -/* $OpenBSD: f_int.c,v 1.18 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: f_int.c,v 1.20 2018/05/13 13:48:08 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -63,7 +63,7 @@ #include int -i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) +i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a) { int i, n = 0; static const char h[] = "0123456789ABCDEF"; @@ -158,8 +158,7 @@ a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) } i /= 2; if (num + i > slen) { - sp = OPENSSL_realloc_clean(s, slen, num + i); - if (sp == NULL) { + if ((sp = recallocarray(s, slen, num + i, 1)) == NULL) { ASN1error(ERR_R_MALLOC_FAILURE); goto err; } diff --git a/crypto/asn1/f_string.c b/crypto/asn1/f_string.c index 138044e0..af17f43e 100644 --- a/crypto/asn1/f_string.c +++ b/crypto/asn1/f_string.c @@ -1,4 +1,4 @@ -/* $OpenBSD: f_string.c,v 1.17 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: f_string.c,v 1.18 2018/04/25 11:48:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -63,7 +63,7 @@ #include int -i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type) +i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type) { int i, n = 0; static const char h[] = "0123456789ABCDEF"; diff --git a/crypto/asn1/n_pkey.c b/crypto/asn1/n_pkey.c index d2fabf6e..6c703167 100644 --- a/crypto/asn1/n_pkey.c +++ b/crypto/asn1/n_pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_pkey.c,v 1.31 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: n_pkey.c,v 1.32 2018/08/05 13:35:45 bcook Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -273,11 +273,11 @@ i2d_RSA_NET(const RSA *a, unsigned char **pp, goto err; } + enckey->enckey->digest->data = zz; if (!ASN1_STRING_set(enckey->os, "private-key", -1)) { ASN1error(ERR_R_MALLOC_FAILURE); goto err; } - enckey->enckey->digest->data = zz; i2d_NETSCAPE_PKEY(pkey, &zz); /* Wipe the private key encoding */ diff --git a/crypto/asn1/p8_pkey.c b/crypto/asn1/p8_pkey.c index 71d57945..d2f8e6b0 100644 --- a/crypto/asn1/p8_pkey.c +++ b/crypto/asn1/p8_pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p8_pkey.c,v 1.17 2015/09/10 15:56:25 jsing Exp $ */ +/* $OpenBSD: p8_pkey.c,v 1.19 2018/08/24 20:17:33 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -69,11 +69,8 @@ pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) /* Since the structure must still be valid use ASN1_OP_FREE_PRE */ if (operation == ASN1_OP_FREE_PRE) { PKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval; - if (key->pkey != NULL && - key->pkey->type == V_ASN1_OCTET_STRING && - key->pkey->value.octet_string != NULL) - explicit_bzero(key->pkey->value.octet_string->data, - key->pkey->value.octet_string->length); + if (key->pkey != NULL) + explicit_bzero(key->pkey->data, key->pkey->length); } return 1; } @@ -95,7 +92,7 @@ static const ASN1_TEMPLATE PKCS8_PRIV_KEY_INFO_seq_tt[] = { { .offset = offsetof(PKCS8_PRIV_KEY_INFO, pkey), .field_name = "pkey", - .item = &ASN1_ANY_it, + .item = &ASN1_OCTET_STRING_it, }, { .flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_SET_OF | ASN1_TFLG_OPTIONAL, @@ -145,57 +142,45 @@ int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version, int ptype, void *pval, unsigned char *penc, int penclen) { - unsigned char **ppenc = NULL; - if (version >= 0) { if (!ASN1_INTEGER_set(priv->version, version)) return 0; } - if (penc) { - int pmtype; - ASN1_OCTET_STRING *oct; - oct = ASN1_OCTET_STRING_new(); - if (!oct) - return 0; - oct->data = penc; - ppenc = &oct->data; - oct->length = penclen; - if (priv->broken == PKCS8_NO_OCTET) - pmtype = V_ASN1_SEQUENCE; - else - pmtype = V_ASN1_OCTET_STRING; - ASN1_TYPE_set(priv->pkey, pmtype, oct); - } - if (!X509_ALGOR_set0(priv->pkeyalg, aobj, ptype, pval)) { - /* If call fails do not swallow 'enc' */ - if (ppenc) - *ppenc = NULL; + if (!X509_ALGOR_set0(priv->pkeyalg, aobj, ptype, pval)) return 0; - } + if (penc != NULL) + ASN1_STRING_set0(priv->pkey, penc, penclen); return 1; } int -PKCS8_pkey_get0(ASN1_OBJECT **ppkalg, const unsigned char **pk, int *ppklen, - X509_ALGOR **pa, PKCS8_PRIV_KEY_INFO *p8) +PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, const unsigned char **pk, + int *ppklen, const X509_ALGOR **pa, const PKCS8_PRIV_KEY_INFO *p8) { - if (ppkalg) + if (ppkalg != NULL) *ppkalg = p8->pkeyalg->algorithm; - if (p8->pkey->type == V_ASN1_OCTET_STRING) { - p8->broken = PKCS8_OK; - if (pk) { - *pk = p8->pkey->value.octet_string->data; - *ppklen = p8->pkey->value.octet_string->length; - } - } else if (p8->pkey->type == V_ASN1_SEQUENCE) { - p8->broken = PKCS8_NO_OCTET; - if (pk) { - *pk = p8->pkey->value.sequence->data; - *ppklen = p8->pkey->value.sequence->length; - } - } else - return 0; - if (pa) + if (pk != NULL) { + *pk = ASN1_STRING_data(p8->pkey); + *ppklen = ASN1_STRING_length(p8->pkey); + } + if (pa != NULL) *pa = p8->pkeyalg; return 1; } + +const STACK_OF(X509_ATTRIBUTE) * +PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8) +{ + return p8->attributes; +} + +int +PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type, + const unsigned char *bytes, int len) +{ + if (X509at_add1_attr_by_NID(&p8->attributes, nid, type, bytes, + len) != NULL) + return 1; + return 0; +} + diff --git a/crypto/asn1/t_bitst.c b/crypto/asn1/t_bitst.c index ea4138e0..51515b88 100644 --- a/crypto/asn1/t_bitst.c +++ b/crypto/asn1/t_bitst.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t_bitst.c,v 1.7 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: t_bitst.c,v 1.8 2018/04/25 11:48:21 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -83,7 +83,7 @@ ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, } int -ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, +ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value, BIT_STRING_BITNAME *tbl) { int bitnum; @@ -99,7 +99,7 @@ ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, } int -ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl) +ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl) { BIT_STRING_BITNAME *bnam; diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c index 3dfaaa40..e287a6cf 100644 --- a/crypto/asn1/t_x509.c +++ b/crypto/asn1/t_x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t_x509.c,v 1.28 2017/04/03 15:52:59 beck Exp $ */ +/* $OpenBSD: t_x509.c,v 1.31 2018/05/18 18:23:24 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -246,7 +246,8 @@ X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) return (ret); } -int X509_ocspid_print (BIO *bp, X509 *x) +int +X509_ocspid_print(BIO *bp, X509 *x) { unsigned char *der = NULL; unsigned char *dertmp; @@ -320,7 +321,7 @@ X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) } int -X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig) +X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, const ASN1_STRING *sig) { int sig_nid; if (BIO_puts(bp, " Signature Algorithm: ") <= 0) @@ -387,7 +388,7 @@ ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) } static const char *mon[12] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; @@ -489,7 +490,7 @@ ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm) } int -X509_NAME_print(BIO *bp, X509_NAME *name, int obase) +X509_NAME_print(BIO *bp, const X509_NAME *name, int obase) { char *s, *c, *b; int ret = 0, l, i; diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c index 3f680c60..70dc355c 100644 --- a/crypto/asn1/tasn_dec.c +++ b/crypto/asn1/tasn_dec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_dec.c,v 1.34 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: tasn_dec.c,v 1.37 2019/04/01 15:48:04 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -65,6 +65,12 @@ #include #include +/* Constructed types with a recursive definition (such as can be found in PKCS7) + * could eventually exceed the stack given malicious input with excessive + * recursion. Therefore we limit the stack depth. + */ +#define ASN1_MAX_CONSTRUCTED_NEST 30 + static int asn1_check_eoc(const unsigned char **in, long len); static int asn1_find_end(const unsigned char **in, long len, char inf); @@ -78,9 +84,9 @@ static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, int expclass, char opt, ASN1_TLC *ctx); static int asn1_template_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, - long len, const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx); + long len, const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx, int depth); static int asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, - long len, const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx); + long len, const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx, int depth); static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, int tag, int aclass, char opt, ASN1_TLC *ctx); @@ -142,7 +148,7 @@ ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, ASN1_TLC c; asn1_tlc_clear_nc(&c); - return asn1_template_ex_d2i(pval, in, len, tt, 0, &c); + return asn1_template_ex_d2i(pval, in, len, tt, 0, &c, 0); } @@ -150,14 +156,15 @@ ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, * If 'opt' set and tag mismatch return -1 to handle OPTIONAL */ -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) +static 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 depth) { const ASN1_TEMPLATE *tt, *errtt = NULL; const ASN1_EXTERN_FUNCS *ef; const ASN1_AUX *aux = it->funcs; - ASN1_aux_cb *asn1_cb; + ASN1_aux_cb *asn1_cb = NULL; const unsigned char *p = NULL, *q; unsigned char oclass; char seq_eoc, seq_nolen, cst, isopt; @@ -176,8 +183,11 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, if (aux && aux->asn1_cb) asn1_cb = aux->asn1_cb; - else - asn1_cb = 0; + + if (++depth > ASN1_MAX_CONSTRUCTED_NEST) { + ASN1error(ASN1_R_NESTED_TOO_DEEP); + goto err; + } switch (it->itype) { case ASN1_ITYPE_PRIMITIVE: @@ -193,7 +203,7 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, goto err; } return asn1_template_ex_d2i(pval, in, len, - it->templates, opt, ctx); + it->templates, opt, ctx, depth); } return asn1_d2i_ex_primitive(pval, in, len, it, tag, aclass, opt, ctx); @@ -258,7 +268,8 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, /* We mark field as OPTIONAL so its absence * can be recognised. */ - ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx); + ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx, + depth); /* If field not present, try the next one */ if (ret == -1) continue; @@ -376,7 +387,7 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, * OPTIONAL */ ret = asn1_template_ex_d2i(pseqval, &p, len, - seqtt, isopt, ctx); + seqtt, isopt, ctx, depth); if (!ret) { errtt = seqtt; goto err; @@ -448,13 +459,20 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, return 0; } +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) +{ + return asn1_item_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0); +} + /* Templates are handled with two separate functions. * One handles any EXPLICIT tag and the other handles the rest. */ static int asn1_template_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long inlen, - const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx) + const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx, int depth) { int flags, aclass; int ret; @@ -489,7 +507,7 @@ asn1_template_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long inlen, return 0; } /* We've found the field so it can't be OPTIONAL now */ - ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx); + ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth); if (!ret) { ASN1error(ERR_R_NESTED_ASN1_ERROR); return 0; @@ -511,7 +529,8 @@ asn1_template_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long inlen, } } } else - return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx); + return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, + depth); *in = p; return 1; @@ -523,7 +542,7 @@ asn1_template_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long inlen, static int asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, long len, - const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx) + const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx, int depth) { int flags, aclass; int ret; @@ -594,8 +613,8 @@ asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, long len, break; } skfield = NULL; - if (!ASN1_item_ex_d2i(&skfield, &p, len, - tt->item, -1, 0, 0, ctx)) { + if (!asn1_item_ex_d2i(&skfield, &p, len, + tt->item, -1, 0, 0, ctx, depth)) { ASN1error(ERR_R_NESTED_ASN1_ERROR); goto err; } @@ -612,8 +631,8 @@ asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, long len, } } else if (flags & ASN1_TFLG_IMPTAG) { /* IMPLICIT tagging */ - ret = ASN1_item_ex_d2i(val, &p, len, - tt->item, tt->tag, aclass, opt, ctx); + ret = asn1_item_ex_d2i(val, &p, len, + tt->item, tt->tag, aclass, opt, ctx, depth); if (!ret) { ASN1error(ERR_R_NESTED_ASN1_ERROR); goto err; @@ -621,8 +640,8 @@ asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, long len, return -1; } else { /* Nothing special */ - ret = ASN1_item_ex_d2i(val, &p, len, tt->item, - -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx); + ret = asn1_item_ex_d2i(val, &p, len, tt->item, + -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx, depth); if (!ret) { ASN1error(ERR_R_NESTED_ASN1_ERROR); goto err; @@ -774,14 +793,17 @@ asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, ASN1_VALUE **opval = NULL; ASN1_STRING *stmp; ASN1_TYPE *typ = NULL; - int ret = 0; - const ASN1_PRIMITIVE_FUNCS *pf; ASN1_INTEGER **tint; + int ret = 0; - pf = it->funcs; + if (it->funcs != NULL) { + const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; - if (pf && pf->prim_c2i) + if (pf->prim_c2i == NULL) + return 0; return pf->prim_c2i(pval, cont, len, utype, free_cont, it); + } + /* If ANY type clear type and set pointer to internal value */ if (it->utype == V_ASN1_ANY) { if (!*pval) { diff --git a/crypto/asn1/tasn_enc.c b/crypto/asn1/tasn_enc.c index f3341901..d103c4d0 100644 --- a/crypto/asn1/tasn_enc.c +++ b/crypto/asn1/tasn_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_enc.c,v 1.21 2016/12/30 16:04:34 jsing Exp $ */ +/* $OpenBSD: tasn_enc.c,v 1.22 2019/04/01 15:48:04 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -541,11 +541,14 @@ asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, const unsigned char *cont; unsigned char c; int len; - const ASN1_PRIMITIVE_FUNCS *pf; - pf = it->funcs; - if (pf && pf->prim_i2c) + if (it->funcs != NULL) { + const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; + + if (pf->prim_i2c == NULL) + return -1; return pf->prim_i2c(pval, cout, putype, it); + } /* Should type be omitted? */ if ((it->itype != ASN1_ITYPE_PRIMITIVE) || diff --git a/crypto/asn1/tasn_fre.c b/crypto/asn1/tasn_fre.c index 92760348..b621af3b 100644 --- a/crypto/asn1/tasn_fre.c +++ b/crypto/asn1/tasn_fre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_fre.c,v 1.15 2016/12/30 16:04:34 jsing Exp $ */ +/* $OpenBSD: tasn_fre.c,v 1.17 2019/04/01 15:48:04 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -88,7 +88,10 @@ asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) ASN1_aux_cb *asn1_cb = NULL; int i; - if (pval == NULL || *pval == NULL) + if (pval == NULL) + return; + /* For primitive types *pval may be something other than C pointer. */ + if (it->itype != ASN1_ITYPE_PRIMITIVE && *pval == NULL) return; if (aux != NULL && aux->asn1_cb != NULL) @@ -190,14 +193,14 @@ void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) { int utype; - if (it) { - const ASN1_PRIMITIVE_FUNCS *pf; - pf = it->funcs; - if (pf && pf->prim_free) { - pf->prim_free(pval, it); - return; - } + + if (it != NULL && it->funcs != NULL) { + const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; + + pf->prim_free(pval, it); + return; } + /* Special case: if 'it' is NULL free contents of ASN1_TYPE */ if (!it) { ASN1_TYPE *typ = (ASN1_TYPE *)*pval; diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c index e9bbc05e..7c9bb989 100644 --- a/crypto/asn1/tasn_new.c +++ b/crypto/asn1/tasn_new.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_new.c,v 1.17 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: tasn_new.c,v 1.18 2019/04/01 15:48:04 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -306,10 +306,12 @@ ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) ASN1_STRING *str; int utype; - if (it && it->funcs) { + if (it != NULL && it->funcs != NULL) { const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; - if (pf->prim_new) - return pf->prim_new(pval, it); + + if (pf->prim_new == NULL) + return 0; + return pf->prim_new(pval, it); } if (!it || (it->itype == ASN1_ITYPE_MSTRING)) @@ -355,14 +357,17 @@ static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) { int utype; - if (it && it->funcs) { + + if (it != NULL && it->funcs != NULL) { const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; + if (pf->prim_clear) pf->prim_clear(pval, it); else *pval = NULL; return; } + if (!it || (it->itype == ASN1_ITYPE_MSTRING)) utype = V_ASN1_UNDEF; else diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c index 7cccd56a..ab898531 100644 --- a/crypto/asn1/tasn_prn.c +++ b/crypto/asn1/tasn_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_prn.c,v 1.16 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: tasn_prn.c,v 1.20 2019/04/07 16:35:50 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -105,7 +105,7 @@ ASN1_PCTX_free(ASN1_PCTX *p) } unsigned long -ASN1_PCTX_get_flags(ASN1_PCTX *p) +ASN1_PCTX_get_flags(const ASN1_PCTX *p) { return p->flags; } @@ -117,7 +117,7 @@ ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags) } unsigned long -ASN1_PCTX_get_nm_flags(ASN1_PCTX *p) +ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p) { return p->nm_flags; } @@ -129,7 +129,7 @@ ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags) } unsigned long -ASN1_PCTX_get_cert_flags(ASN1_PCTX *p) +ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p) { return p->cert_flags; } @@ -141,7 +141,7 @@ ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags) } unsigned long -ASN1_PCTX_get_oid_flags(ASN1_PCTX *p) +ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p) { return p->oid_flags; } @@ -153,7 +153,7 @@ ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags) } unsigned long -ASN1_PCTX_get_str_flags(ASN1_PCTX *p) +ASN1_PCTX_get_str_flags(const ASN1_PCTX *p) { return p->str_flags; } @@ -500,13 +500,18 @@ asn1_primitive_print(BIO *out, ASN1_VALUE **fld, const ASN1_ITEM *it, ASN1_STRING *str; int ret = 1, needlf = 1; const char *pname; - const ASN1_PRIMITIVE_FUNCS *pf; - pf = it->funcs; if (!asn1_print_fsname(out, indent, fname, sname, pctx)) return 0; - if (pf && pf->prim_print) + + if (it != NULL && it->funcs != NULL) { + const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; + + if (pf->prim_print == NULL) + return 0; + return pf->prim_print(out, fld, it, indent, pctx); + } str = (ASN1_STRING *)*fld; if (it->itype == ASN1_ITYPE_MSTRING) utype = str->type & ~V_ASN1_NEG; diff --git a/crypto/asn1/x_algor.c b/crypto/asn1/x_algor.c index 27405a2b..2013de79 100644 --- a/crypto/asn1/x_algor.c +++ b/crypto/asn1/x_algor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_algor.c,v 1.21 2015/07/24 15:09:52 jsing Exp $ */ +/* $OpenBSD: x_algor.c,v 1.22 2018/05/01 19:01:27 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -176,8 +176,8 @@ X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) } void -X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, - X509_ALGOR *algor) +X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval, + const X509_ALGOR *algor) { if (paobj) *paobj = algor->algorithm; diff --git a/crypto/asn1/x_bignum.c b/crypto/asn1/x_bignum.c index 73f0f73c..fab8fc21 100644 --- a/crypto/asn1/x_bignum.c +++ b/crypto/asn1/x_bignum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_bignum.c,v 1.8 2015/07/25 17:07:17 jsing Exp $ */ +/* $OpenBSD: x_bignum.c,v 1.10 2019/04/01 15:49:22 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -75,15 +75,18 @@ static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); +static int bn_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, + int indent, const ASN1_PCTX *pctx); static ASN1_PRIMITIVE_FUNCS bignum_pf = { - NULL, - 0, - bn_new, - bn_free, - 0, - bn_c2i, - bn_i2c + .app_data = NULL, + .flags = 0, + .prim_new = bn_new, + .prim_free = bn_free, + .prim_clear = NULL, /* XXX */ + .prim_c2i = bn_c2i, + .prim_i2c = bn_i2c, + .prim_print = bn_print, }; const ASN1_ITEM BIGNUM_it = { @@ -165,3 +168,17 @@ bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, } return 1; } + +static int +bn_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent, + const ASN1_PCTX *pctx) +{ + BIGNUM *bn = (BIGNUM *)*pval; + + if (!BN_print(out, bn)) + return 0; + if (BIO_printf(out, "\n") <= 0) + return 0; + + return 1; +} diff --git a/crypto/asn1/x_crl.c b/crypto/asn1/x_crl.c index d8f24ca1..bc1783db 100644 --- a/crypto/asn1/x_crl.c +++ b/crypto/asn1/x_crl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_crl.c,v 1.27 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: x_crl.c,v 1.34 2019/03/13 20:34:00 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -462,6 +462,12 @@ X509_REVOKED_free(X509_REVOKED *a) ASN1_item_free((ASN1_VALUE *)a, &X509_REVOKED_it); } +X509_REVOKED * +X509_REVOKED_dup(X509_REVOKED *a) +{ + return ASN1_item_dup(&X509_REVOKED_it, a); +} + X509_CRL_INFO * d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len) { @@ -521,9 +527,7 @@ X509_CRL_dup(X509_CRL *x) static int X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b) { - return(ASN1_STRING_cmp( - (ASN1_STRING *)(*a)->serialNumber, - (ASN1_STRING *)(*b)->serialNumber)); + return(ASN1_INTEGER_cmp((*a)->serialNumber, (*b)->serialNumber)); } int @@ -669,6 +673,8 @@ X509_CRL_METHOD_new(int (*crl_init)(X509_CRL *crl), void X509_CRL_METHOD_free(X509_CRL_METHOD *m) { + if (m == NULL) + return; if (!(m->flags & X509_CRL_METHOD_DYNAMIC)) return; free(m); @@ -685,3 +691,67 @@ X509_CRL_get_meth_data(X509_CRL *crl) { return crl->meth_data; } + +int +X509_CRL_get_signature_nid(const X509_CRL *crl) +{ + return OBJ_obj2nid(crl->sig_alg->algorithm); +} + +const STACK_OF(X509_EXTENSION) * +X509_CRL_get0_extensions(const X509_CRL *crl) +{ + return crl->crl->extensions; +} + +long +X509_CRL_get_version(const X509_CRL *crl) +{ + return ASN1_INTEGER_get(crl->crl->version); +} + +const ASN1_TIME * +X509_CRL_get0_lastUpdate(const X509_CRL *crl) +{ + return crl->crl->lastUpdate; +} + +ASN1_TIME * +X509_CRL_get_lastUpdate(X509_CRL *crl) +{ + return crl->crl->lastUpdate; +} + +const ASN1_TIME * +X509_CRL_get0_nextUpdate(const X509_CRL *crl) +{ + return crl->crl->nextUpdate; +} + +ASN1_TIME * +X509_CRL_get_nextUpdate(X509_CRL *crl) +{ + return crl->crl->nextUpdate; +} + +X509_NAME * +X509_CRL_get_issuer(const X509_CRL *crl) +{ + return crl->crl->issuer; +} + +STACK_OF(X509_REVOKED) * +X509_CRL_get_REVOKED(X509_CRL *crl) +{ + return crl->crl->revoked; +} + +void +X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg) +{ + if (psig != NULL) + *psig = crl->signature; + if (palg != NULL) + *palg = crl->sig_alg; +} diff --git a/crypto/asn1/x_long.c b/crypto/asn1/x_long.c index 9df3a318..61685c31 100644 --- a/crypto/asn1/x_long.c +++ b/crypto/asn1/x_long.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_long.c,v 1.11 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: x_long.c,v 1.14 2019/04/01 15:48:50 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -63,26 +63,30 @@ #include #include -/* Custom primitive type for long handling. This converts between an ASN1_INTEGER - * and a long directly. +/* + * Custom primitive type for long handling. This converts between an + * ASN1_INTEGER and a long directly. */ - static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it); static void long_free(ASN1_VALUE **pval, const ASN1_ITEM *it); -static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); -static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); -static int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent, const ASN1_PCTX *pctx); +static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, + const ASN1_ITEM *it); +static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, + int utype, char *free_cont, const ASN1_ITEM *it); +static int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, + int indent, const ASN1_PCTX *pctx); static ASN1_PRIMITIVE_FUNCS long_pf = { - NULL, 0, - long_new, - long_free, - long_free, /* Clear should set to initial value */ - long_c2i, - long_i2c, - long_print + .app_data = NULL, + .flags = 0, + .prim_new = long_new, + .prim_free = long_free, + .prim_clear = long_free, /* Clear should set to initial value */ + .prim_c2i = long_c2i, + .prim_i2c = long_i2c, + .prim_print = long_print, }; const ASN1_ITEM LONG_it = { @@ -206,5 +210,8 @@ static int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent, const ASN1_PCTX *pctx) { - return BIO_printf(out, "%ld\n", *(long *)pval); + if (BIO_printf(out, "%ld\n", *(long *)pval) <= 0) + return 0; + + return 1; } diff --git a/crypto/asn1/x_name.c b/crypto/asn1/x_name.c index 30fef39f..4bf18425 100644 --- a/crypto/asn1/x_name.c +++ b/crypto/asn1/x_name.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_name.c,v 1.33 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: x_name.c,v 1.34 2018/02/20 17:09:20 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -640,3 +640,16 @@ X509_NAME_set(X509_NAME **xn, X509_NAME *name) } return (*xn != NULL); } + +int +X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen) +{ + /* Make sure encoding is valid. */ + if (i2d_X509_NAME(nm, NULL) <= 0) + return 0; + if (pder != NULL) + *pder = (unsigned char *)nm->bytes->data; + if (pderlen != NULL) + *pderlen = nm->bytes->length; + return 1; +} diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index 738507bb..ea67419c 100644 --- a/crypto/asn1/x_pubkey.c +++ b/crypto/asn1/x_pubkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_pubkey.c,v 1.26 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: x_pubkey.c,v 1.27 2018/03/17 14:55:39 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -175,17 +175,15 @@ X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) } EVP_PKEY * -X509_PUBKEY_get(X509_PUBKEY *key) +X509_PUBKEY_get0(X509_PUBKEY *key) { EVP_PKEY *ret = NULL; if (key == NULL) goto error; - if (key->pkey != NULL) { - CRYPTO_add(&key->pkey->references, 1, CRYPTO_LOCK_EVP_PKEY); + if (key->pkey != NULL) return key->pkey; - } if (key->public_key == NULL) goto error; @@ -220,7 +218,6 @@ X509_PUBKEY_get(X509_PUBKEY *key) key->pkey = ret; CRYPTO_w_unlock(CRYPTO_LOCK_EVP_PKEY); } - CRYPTO_add(&ret->references, 1, CRYPTO_LOCK_EVP_PKEY); return ret; @@ -229,6 +226,19 @@ X509_PUBKEY_get(X509_PUBKEY *key) return (NULL); } +EVP_PKEY * +X509_PUBKEY_get(X509_PUBKEY *key) +{ + EVP_PKEY *pkey; + + if ((pkey = X509_PUBKEY_get0(key)) == NULL) + return (NULL); + + CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY); + + return pkey; +} + /* Now two pseudo ASN1 routines that take an EVP_PKEY structure * and encode or decode as X509_PUBKEY */ diff --git a/crypto/asn1/x_req.c b/crypto/asn1/x_req.c index 5ffa11e2..eb5210ae 100644 --- a/crypto/asn1/x_req.c +++ b/crypto/asn1/x_req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_req.c,v 1.15 2015/02/11 04:00:39 jsing Exp $ */ +/* $OpenBSD: x_req.c,v 1.17 2018/02/22 16:50:30 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -225,3 +225,19 @@ X509_REQ_dup(X509_REQ *x) { return ASN1_item_dup(&X509_REQ_it, x); } + +int +X509_REQ_get_signature_nid(const X509_REQ *req) +{ + return OBJ_obj2nid(req->sig_alg->algorithm); +} + +void +X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg) +{ + if (psig != NULL) + *psig = req->signature; + if (palg != NULL) + *palg = req->sig_alg; +} diff --git a/crypto/asn1/x_x509.c b/crypto/asn1/x_x509.c index 168c2c0f..6a56a795 100644 --- a/crypto/asn1/x_x509.c +++ b/crypto/asn1/x_x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_x509.c,v 1.24 2015/03/19 14:00:22 tedu Exp $ */ +/* $OpenBSD: x_x509.c,v 1.26 2018/02/17 15:50:42 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -344,3 +344,19 @@ i2d_X509_AUX(X509 *a, unsigned char **pp) length += i2d_X509_CERT_AUX(a->aux, pp); return length; } + +void +X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, + const X509 *x) +{ + if (psig != NULL) + *psig = x->signature; + if (palg != NULL) + *palg = x->sig_alg; +} + +int +X509_get_signature_nid(const X509 *x) +{ + return OBJ_obj2nid(x->sig_alg->algorithm); +} diff --git a/crypto/asn1/x_x509a.c b/crypto/asn1/x_x509a.c index 29817915..b0d7150b 100644 --- a/crypto/asn1/x_x509a.c +++ b/crypto/asn1/x_x509a.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_x509a.c,v 1.14 2015/02/14 15:28:39 miod Exp $ */ +/* $OpenBSD: x_x509a.c,v 1.15 2018/05/01 19:01:27 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -154,7 +154,7 @@ aux_get(X509 *x) } int -X509_alias_set1(X509 *x, unsigned char *name, int len) +X509_alias_set1(X509 *x, const unsigned char *name, int len) { X509_CERT_AUX *aux; if (!name) { @@ -172,7 +172,7 @@ X509_alias_set1(X509 *x, unsigned char *name, int len) } int -X509_keyid_set1(X509 *x, unsigned char *id, int len) +X509_keyid_set1(X509 *x, const unsigned char *id, int len) { X509_CERT_AUX *aux; if (!id) { @@ -210,7 +210,7 @@ X509_keyid_get0(X509 *x, int *len) } int -X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj) +X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj) { X509_CERT_AUX *aux; ASN1_OBJECT *objtmp; @@ -232,7 +232,7 @@ X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj) } int -X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj) +X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj) { X509_CERT_AUX *aux; ASN1_OBJECT *objtmp; diff --git a/crypto/bio/b_posix.c b/crypto/bio/b_posix.c index a850bc6a..aed51bd7 100644 --- a/crypto/bio/b_posix.c +++ b/crypto/bio/b_posix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b_posix.c,v 1.1 2014/12/03 22:14:38 bcook Exp $ */ +/* $OpenBSD: b_posix.c,v 1.2 2018/03/17 16:20:01 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -68,6 +68,8 @@ int BIO_sock_init(void) { + if (!OPENSSL_init_crypto(0, NULL)) /* XXX do we need this? */ + return (0); return (1); } diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index 48f39838..152b0809 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b_sock.c,v 1.67 2017/04/30 17:54:11 beck Exp $ */ +/* $OpenBSD: b_sock.c,v 1.69 2018/02/07 00:52:05 bluhm Exp $ */ /* * Copyright (c) 2017 Bob Beck * @@ -134,16 +134,18 @@ BIO_get_accept_socket(char *host, int bind_mode) p = NULL; h = str; if ((p = strrchr(str, ':')) == NULL) { - BIOerror(BIO_R_NO_PORT_SPECIFIED); - goto err; - } - *p++ = '\0'; - if (*p == '\0') { - BIOerror(BIO_R_NO_PORT_SPECIFIED); - goto err; - } - if (*h == '\0' || strcmp(h, "*") == 0) + /* A string without a colon is treated as a port. */ + p = str; h = NULL; + } else { + *p++ = '\0'; + if (*p == '\0') { + BIOerror(BIO_R_NO_PORT_SPECIFIED); + goto err; + } + if (*h == '\0' || strcmp(h, "*") == 0) + h = NULL; + } if ((error = getaddrinfo(h, p, &hints, &res)) != 0) { ERR_asprintf_error_data("getaddrinfo: '%s:%s': %s'", h, p, @@ -184,7 +186,8 @@ BIO_get_accept_socket(char *host, int bind_mode) err: free(str); - freeaddrinfo(res); + if (res != NULL) + freeaddrinfo(res); if ((ret == 0) && (s != -1)) { close(s); s = -1; diff --git a/crypto/bio/bf_buff.c b/crypto/bio/bf_buff.c index 30765b03..5b9ee35d 100644 --- a/crypto/bio/bf_buff.c +++ b/crypto/bio/bf_buff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bf_buff.c,v 1.24 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: bf_buff.c,v 1.25 2018/05/01 13:29:09 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -73,7 +73,7 @@ static int buffer_free(BIO *data); static long buffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); #define DEFAULT_BUFFER_SIZE 4096 -static BIO_METHOD methods_buffer = { +static const BIO_METHOD methods_buffer = { .type = BIO_TYPE_BUFFER, .name = "buffer", .bwrite = buffer_write, @@ -86,7 +86,7 @@ static BIO_METHOD methods_buffer = { .callback_ctrl = buffer_callback_ctrl }; -BIO_METHOD * +const BIO_METHOD * BIO_f_buffer(void) { return (&methods_buffer); diff --git a/crypto/bio/bf_nbio.c b/crypto/bio/bf_nbio.c index 24e2e7e8..05fa9161 100644 --- a/crypto/bio/bf_nbio.c +++ b/crypto/bio/bf_nbio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bf_nbio.c,v 1.19 2015/02/07 13:19:15 doug Exp $ */ +/* $OpenBSD: bf_nbio.c,v 1.20 2018/05/01 13:29:09 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -80,7 +80,7 @@ typedef struct nbio_test_st { int lwn; } NBIO_TEST; -static BIO_METHOD methods_nbiof = { +static const BIO_METHOD methods_nbiof = { .type = BIO_TYPE_NBIO_TEST, .name = "non-blocking IO test filter", .bwrite = nbiof_write, @@ -93,7 +93,7 @@ static BIO_METHOD methods_nbiof = { .callback_ctrl = nbiof_callback_ctrl }; -BIO_METHOD * +const BIO_METHOD * BIO_f_nbio_test(void) { return (&methods_nbiof); diff --git a/crypto/bio/bf_null.c b/crypto/bio/bf_null.c index 09d54b6b..25abb8a5 100644 --- a/crypto/bio/bf_null.c +++ b/crypto/bio/bf_null.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bf_null.c,v 1.11 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: bf_null.c,v 1.12 2018/05/01 13:29:09 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -73,7 +73,7 @@ static int nullf_new(BIO *h); static int nullf_free(BIO *data); static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); -static BIO_METHOD methods_nullf = { +static const BIO_METHOD methods_nullf = { .type = BIO_TYPE_NULL_FILTER, .name = "NULL filter", .bwrite = nullf_write, @@ -86,7 +86,7 @@ static BIO_METHOD methods_nullf = { .callback_ctrl = nullf_callback_ctrl }; -BIO_METHOD * +const BIO_METHOD * BIO_f_null(void) { return (&methods_nullf); diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c index 86ccbdc2..de039a7f 100644 --- a/crypto/bio/bio_lib.c +++ b/crypto/bio/bio_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_lib.c,v 1.23 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: bio_lib.c,v 1.28 2018/05/01 13:29:09 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -64,8 +64,22 @@ #include #include +int +BIO_get_new_index(void) +{ + static int bio_type_index = BIO_TYPE_START; + int index; + + /* The index will collide with the BIO flag bits if it exceeds 255. */ + index = CRYPTO_add(&bio_type_index, 1, CRYPTO_LOCK_BIO); + if (index > 255) + return -1; + + return index; +} + BIO * -BIO_new(BIO_METHOD *method) +BIO_new(const BIO_METHOD *method) { BIO *ret = NULL; @@ -82,7 +96,7 @@ BIO_new(BIO_METHOD *method) } int -BIO_set(BIO *bio, BIO_METHOD *method) +BIO_set(BIO *bio, const BIO_METHOD *method) { bio->method = method; bio->callback = NULL; @@ -137,6 +151,43 @@ BIO_vfree(BIO *a) BIO_free(a); } +int +BIO_up_ref(BIO *bio) +{ + int refs = CRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO); + return (refs > 1) ? 1 : 0; +} + +void * +BIO_get_data(BIO *a) +{ + return (a->ptr); +} + +void +BIO_set_data(BIO *a, void *ptr) +{ + a->ptr = ptr; +} + +void +BIO_set_init(BIO *a, int init) +{ + a->init = init; +} + +int +BIO_get_shutdown(BIO *a) +{ + return (a->shutdown); +} + +void +BIO_set_shutdown(BIO *a, int shut) +{ + a->shutdown = shut; +} + void BIO_clear_flags(BIO *b, int flags) { diff --git a/crypto/bio/bio_meth.c b/crypto/bio/bio_meth.c new file mode 100644 index 00000000..4327c010 --- /dev/null +++ b/crypto/bio/bio_meth.c @@ -0,0 +1,147 @@ +/* $OpenBSD: bio_meth.c,v 1.6 2018/06/02 04:41:12 tb Exp $ */ +/* + * Copyright (c) 2018 Theo Buehler + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#include + +BIO_METHOD * +BIO_meth_new(int type, const char *name) +{ + BIO_METHOD *biom; + + if ((biom = calloc(1, sizeof(*biom))) == NULL) + return NULL; + + biom->type = type; + biom->name = name; + + return biom; +} + +void +BIO_meth_free(BIO_METHOD *biom) +{ + free(biom); +} + +int +(*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *, int) +{ + return biom->bwrite; +} + +int +BIO_meth_set_write(BIO_METHOD *biom, int (*write)(BIO *, const char *, int)) +{ + biom->bwrite = write; + return 1; +} + +int +(*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int) +{ + return biom->bread; +} + +int +BIO_meth_set_read(BIO_METHOD *biom, int (*read)(BIO *, char *, int)) +{ + biom->bread = read; + return 1; +} + +int +(*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *) +{ + return biom->bputs; +} + +int +BIO_meth_set_puts(BIO_METHOD *biom, int (*puts)(BIO *, const char *)) +{ + biom->bputs = puts; + return 1; +} + +int +(*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int) +{ + return biom->bgets; +} + +int +BIO_meth_set_gets(BIO_METHOD *biom, int (*gets)(BIO *, char *, int)) +{ + biom->bgets = gets; + return 1; +} + +long +(*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int, long, void *) +{ + return biom->ctrl; +} + +int +BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl)(BIO *, int, long, void *)) +{ + biom->ctrl = ctrl; + return 1; +} + +int +(*BIO_meth_get_create(const BIO_METHOD *biom))(BIO *) +{ + return biom->create; +} + +int +BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *)) +{ + biom->create = create; + return 1; +} + +int +(*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *) +{ + return biom->destroy; +} + +int +BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *)) +{ + biom->destroy = destroy; + return 1; +} + +long +(*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, BIO_info_cb *) +{ + return + (long (*)(BIO *, int, BIO_info_cb *))biom->callback_ctrl; /* XXX */ +} + +int +BIO_meth_set_callback_ctrl(BIO_METHOD *biom, + long (*callback_ctrl)(BIO *, int, BIO_info_cb *)) +{ + biom->callback_ctrl = + (long (*)(BIO *, int, bio_info_cb *))callback_ctrl; /* XXX */ + return 1; +} diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 20508a7d..c95ddde7 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_acpt.c,v 1.27 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: bss_acpt.c,v 1.29 2018/05/12 18:51:59 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -100,7 +100,7 @@ static void BIO_ACCEPT_free(BIO_ACCEPT *a); #define ACPT_S_GET_ACCEPT_SOCKET 2 #define ACPT_S_OK 3 -static BIO_METHOD methods_acceptp = { +static const BIO_METHOD methods_acceptp = { .type = BIO_TYPE_ACCEPT, .name = "socket accept", .bwrite = acpt_write, @@ -111,7 +111,7 @@ static BIO_METHOD methods_acceptp = { .destroy = acpt_free }; -BIO_METHOD * +const BIO_METHOD * BIO_s_accept(void) { return (&methods_acceptp); @@ -436,7 +436,7 @@ acpt_puts(BIO *bp, const char *str) } BIO * -BIO_new_accept(char *str) +BIO_new_accept(const char *str) { BIO *ret; diff --git a/crypto/bio/bss_bio.c b/crypto/bio/bss_bio.c index 20eb9a98..74f86a51 100644 --- a/crypto/bio/bss_bio.c +++ b/crypto/bio/bss_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_bio.c,v 1.23 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: bss_bio.c,v 1.24 2018/05/01 13:29:09 tb Exp $ */ /* ==================================================================== * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. * @@ -94,7 +94,7 @@ static int bio_puts(BIO *bio, const char *str); static int bio_make_pair(BIO *bio1, BIO *bio2); static void bio_destroy_pair(BIO *bio); -static BIO_METHOD methods_biop = { +static const BIO_METHOD methods_biop = { .type = BIO_TYPE_BIO, .name = "BIO pair", .bwrite = bio_write, @@ -105,7 +105,7 @@ static BIO_METHOD methods_biop = { .destroy = bio_free }; -BIO_METHOD * +const BIO_METHOD * BIO_s_bio(void) { return &methods_biop; diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index 55527388..46a37b06 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_conn.c,v 1.33 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: bss_conn.c,v 1.35 2018/05/12 18:51:59 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -106,7 +106,7 @@ static void conn_close_socket(BIO *data); BIO_CONNECT *BIO_CONNECT_new(void); void BIO_CONNECT_free(BIO_CONNECT *a); -static BIO_METHOD methods_connectp = { +static const BIO_METHOD methods_connectp = { .type = BIO_TYPE_CONNECT, .name = "socket connect", .bwrite = conn_write, @@ -319,7 +319,7 @@ BIO_CONNECT_free(BIO_CONNECT *a) free(a); } -BIO_METHOD * +const BIO_METHOD * BIO_s_connect(void) { return (&methods_connectp); @@ -583,7 +583,7 @@ conn_puts(BIO *bp, const char *str) } BIO * -BIO_new_connect(char *str) +BIO_new_connect(const char *str) { BIO *ret; diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index a9657402..794b6d1b 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_dgram.c,v 1.41 2015/07/20 23:15:28 doug Exp $ */ +/* $OpenBSD: bss_dgram.c,v 1.42 2018/05/12 17:47:53 tb Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -86,7 +86,7 @@ static int dgram_clear(BIO *bio); static int BIO_dgram_should_retry(int s); -static BIO_METHOD methods_dgramp = { +static const BIO_METHOD methods_dgramp = { .type = BIO_TYPE_DGRAM, .name = "datagram socket", .bwrite = dgram_write, @@ -112,7 +112,7 @@ typedef struct bio_dgram_data_st { } bio_dgram_data; -BIO_METHOD * +const BIO_METHOD * BIO_s_datagram(void) { return (&methods_dgramp); diff --git a/crypto/bio/bss_fd.c b/crypto/bio/bss_fd.c index b21dbd92..bbe08efc 100644 --- a/crypto/bio/bss_fd.c +++ b/crypto/bio/bss_fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_fd.c,v 1.18 2015/02/12 03:54:07 jsing Exp $ */ +/* $OpenBSD: bss_fd.c,v 1.19 2018/05/01 13:29:09 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -74,7 +74,7 @@ static int fd_new(BIO *h); static int fd_free(BIO *data); int BIO_fd_should_retry(int s); -static BIO_METHOD methods_fdp = { +static const BIO_METHOD methods_fdp = { .type = BIO_TYPE_FD, .name = "file descriptor", .bwrite = fd_write, @@ -86,7 +86,7 @@ static BIO_METHOD methods_fdp = { .destroy = fd_free }; -BIO_METHOD * +const BIO_METHOD * BIO_s_fd(void) { return (&methods_fdp); diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index 01f4a3ff..fe937388 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_file.c,v 1.32 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: bss_file.c,v 1.33 2018/05/30 00:23:04 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -98,7 +98,7 @@ static long file_ctrl(BIO *h, int cmd, long arg1, void *arg2); static int file_new(BIO *h); static int file_free(BIO *data); -static BIO_METHOD methods_filep = { +static const BIO_METHOD methods_filep = { .type = BIO_TYPE_FILE, .name = "FILE pointer", .bwrite = file_write, @@ -148,7 +148,7 @@ BIO_new_fp(FILE *stream, int close_flag) return (ret); } -BIO_METHOD * +const BIO_METHOD * BIO_s_file(void) { return (&methods_filep); diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index fcaa985a..7ef1312d 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_log.c,v 1.21 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: bss_log.c,v 1.22 2018/05/01 13:29:10 tb Exp $ */ /* ==================================================================== * Copyright (c) 1999 The OpenSSL Project. All rights reserved. * @@ -81,7 +81,7 @@ static void xopenlog(BIO* bp, char* name, int level); static void xsyslog(BIO* bp, int priority, const char* string); static void xcloselog(BIO* bp); -static BIO_METHOD methods_slg = { +static const BIO_METHOD methods_slg = { .type = BIO_TYPE_MEM, .name = "syslog", .bwrite = slg_write, @@ -91,7 +91,7 @@ static BIO_METHOD methods_slg = { .destroy = slg_free }; -BIO_METHOD * +const BIO_METHOD * BIO_s_log(void) { return (&methods_slg); diff --git a/crypto/bio/bss_mem.c b/crypto/bio/bss_mem.c index be491ca1..e76e1ad2 100644 --- a/crypto/bio/bss_mem.c +++ b/crypto/bio/bss_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_mem.c,v 1.15 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: bss_mem.c,v 1.17 2018/05/12 18:51:59 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -72,7 +72,7 @@ static long mem_ctrl(BIO *h, int cmd, long arg1, void *arg2); static int mem_new(BIO *h); static int mem_free(BIO *data); -static BIO_METHOD mem_method = { +static const BIO_METHOD mem_method = { .type = BIO_TYPE_MEM, .name = "memory buffer", .bwrite = mem_write, @@ -87,14 +87,14 @@ static BIO_METHOD mem_method = { /* bio->num is used to hold the value to return on 'empty', if it is * 0, should_retry is not set */ -BIO_METHOD * +const BIO_METHOD * BIO_s_mem(void) { return (&mem_method); } BIO * -BIO_new_mem_buf(void *buf, int len) +BIO_new_mem_buf(const void *buf, int len) { BIO *ret; BUF_MEM *b; @@ -108,7 +108,7 @@ BIO_new_mem_buf(void *buf, int len) if (!(ret = BIO_new(BIO_s_mem()))) return NULL; b = (BUF_MEM *)ret->ptr; - b->data = buf; + b->data = (void *)buf; /* Trust in the BIO_FLAGS_MEM_RDONLY flag. */ b->length = sz; b->max = sz; ret->flags |= BIO_FLAGS_MEM_RDONLY; diff --git a/crypto/bio/bss_null.c b/crypto/bio/bss_null.c index 42ee626b..c6de844d 100644 --- a/crypto/bio/bss_null.c +++ b/crypto/bio/bss_null.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_null.c,v 1.10 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: bss_null.c,v 1.11 2018/05/01 13:29:10 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -70,7 +70,7 @@ static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2); static int null_new(BIO *h); static int null_free(BIO *data); -static BIO_METHOD null_method = { +static const BIO_METHOD null_method = { .type = BIO_TYPE_NULL, .name = "NULL", .bwrite = null_write, @@ -82,7 +82,7 @@ static BIO_METHOD null_method = { .destroy = null_free }; -BIO_METHOD * +const BIO_METHOD * BIO_s_null(void) { return (&null_method); diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c index dd470eb6..9c650a80 100644 --- a/crypto/bio/bss_sock.c +++ b/crypto/bio/bss_sock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_sock.c,v 1.23 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: bss_sock.c,v 1.24 2018/05/01 13:29:10 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -73,7 +73,7 @@ static int sock_new(BIO *h); static int sock_free(BIO *data); int BIO_sock_should_retry(int s); -static BIO_METHOD methods_sockp = { +static const BIO_METHOD methods_sockp = { .type = BIO_TYPE_SOCKET, .name = "socket", .bwrite = sock_write, @@ -84,7 +84,7 @@ static BIO_METHOD methods_sockp = { .destroy = sock_free }; -BIO_METHOD * +const BIO_METHOD * BIO_s_socket(void) { return (&methods_sockp); diff --git a/crypto/bn/bn_add.c b/crypto/bn/bn_add.c index 334fb4f5..048a136b 100644 --- a/crypto/bn/bn_add.c +++ b/crypto/bn/bn_add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_add.c,v 1.11 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: bn_add.c,v 1.13 2018/07/23 18:07:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -62,61 +62,51 @@ #include "bn_lcl.h" -/* r can == a or b */ int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { - const BIGNUM *tmp; - int a_neg = a->neg, ret; + int ret, r_neg; bn_check_top(a); bn_check_top(b); - /* a + b a+b - * a + -b a-b - * -a + b b-a - * -a + -b -(a+b) - */ - if (a_neg ^ b->neg) { - /* only one is negative */ - if (a_neg) - { tmp = a; - a = b; - b = tmp; - } - - /* we are now a - b */ - - if (BN_ucmp(a, b) < 0) { - if (!BN_usub(r, b, a)) - return (0); - r->neg = 1; + if (a->neg == b->neg) { + r_neg = a->neg; + ret = BN_uadd(r, a, b); + } else { + int cmp = BN_ucmp(a, b); + + if (cmp > 0) { + r_neg = a->neg; + ret = BN_usub(r, a, b); + } else if (cmp < 0) { + r_neg = b->neg; + ret = BN_usub(r, b, a); } else { - if (!BN_usub(r, a, b)) - return (0); - r->neg = 0; + r_neg = 0; + BN_zero(r); + ret = 1; } - return (1); } - ret = BN_uadd(r, a, b); - r->neg = a_neg; + r->neg = r_neg; bn_check_top(r); return ret; } -/* unsigned add of b to a */ int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { int max, min, dif; - BN_ULONG *ap, *bp, *rp, carry, t1, t2; - const BIGNUM *tmp; + const BN_ULONG *ap, *bp; + BN_ULONG *rp, carry, t1, t2; bn_check_top(a); bn_check_top(b); if (a->top < b->top) { + const BIGNUM *tmp; + tmp = a; a = b; b = tmp; @@ -137,41 +127,28 @@ BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) carry = bn_add_words(rp, ap, bp, min); rp += min; ap += min; - bp += min; - - if (carry) { - while (dif) { - dif--; - t1 = *(ap++); - t2 = (t1 + 1) & BN_MASK2; - *(rp++) = t2; - if (t2) { - carry = 0; - break; - } - } - if (carry) { - /* carry != 0 => dif == 0 */ - *rp = 1; - r->top++; - } + + while (dif) { + dif--; + t1 = *(ap++); + t2 = (t1 + carry) & BN_MASK2; + *(rp++) = t2; + carry &= (t2 == 0); } - if (dif && rp != ap) - while (dif--) - /* copy remaining words if ap != rp */ - *(rp++) = *(ap++); + *rp = carry; + r->top += carry; + r->neg = 0; bn_check_top(r); return 1; } -/* unsigned subtraction of b from a, a must be larger than b. */ int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { int max, min, dif; - BN_ULONG t1, t2, *ap, *bp, *rp; - int i, carry; + const BN_ULONG *ap, *bp; + BN_ULONG t1, t2, borrow, *rp; bn_check_top(a); bn_check_top(b); @@ -180,134 +157,67 @@ BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) min = b->top; dif = max - min; - if (dif < 0) /* hmm... should not be happening */ - { + if (dif < 0) { BNerror(BN_R_ARG2_LT_ARG3); - return (0); + return 0; } if (bn_wexpand(r, max) == NULL) - return (0); + return 0; ap = a->d; bp = b->d; rp = r->d; -#if 1 - carry = 0; - for (i = min; i != 0; i--) { - t1= *(ap++); - t2= *(bp++); - if (carry) { - carry = (t1 <= t2); - t1 = (t1 - t2 - 1)&BN_MASK2; - } else { - carry = (t1 < t2); - t1 = (t1 - t2)&BN_MASK2; - } - *(rp++) = t1&BN_MASK2; - } -#else - carry = bn_sub_words(rp, ap, bp, min); + borrow = bn_sub_words(rp, ap, bp, min); ap += min; - bp += min; rp += min; -#endif - if (carry) /* subtracted */ - { - if (!dif) - /* error: a < b */ - return 0; - while (dif) { - dif--; - t1 = *(ap++); - t2 = (t1 - 1)&BN_MASK2; - *(rp++) = t2; - if (t1) - break; - } - } -#if 0 - memcpy(rp, ap, sizeof(*rp)*(max - i)); -#else - if (rp != ap) { - for (;;) { - if (!dif--) - break; - rp[0] = ap[0]; - if (!dif--) - break; - rp[1] = ap[1]; - if (!dif--) - break; - rp[2] = ap[2]; - if (!dif--) - break; - rp[3] = ap[3]; - rp += 4; - ap += 4; - } + + while (dif) { + dif--; + t1 = *(ap++); + t2 = (t1 - borrow) & BN_MASK2; + *(rp++) = t2; + borrow &= (t1 == 0); } -#endif + + while (max > 0 && *--rp == 0) + max--; r->top = max; r->neg = 0; bn_correct_top(r); - return (1); + return 1; } int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { - int max; - int add = 0, neg = 0; - const BIGNUM *tmp; + int ret, r_neg; bn_check_top(a); bn_check_top(b); - /* a - b a-b - * a - -b a+b - * -a - b -(a+b) - * -a - -b b-a - */ - if (a->neg) { - if (b->neg) { - tmp = a; - a = b; - b = tmp; - } else { - add = 1; - neg = 1; - } + if (a->neg != b->neg) { + r_neg = a->neg; + ret = BN_uadd(r, a, b); } else { - if (b->neg) { - add = 1; - neg = 0; + int cmp = BN_ucmp(a, b); + + if (cmp > 0) { + r_neg = a->neg; + ret = BN_usub(r, a, b); + } else if (cmp < 0) { + r_neg = !b->neg; + ret = BN_usub(r, b, a); + } else { + r_neg = 0; + BN_zero(r); + ret = 1; } } - if (add) { - if (!BN_uadd(r, a, b)) - return (0); - r->neg = neg; - return (1); - } - - /* We are actually doing a - b :-) */ - - max = (a->top > b->top) ? a->top : b->top; - if (bn_wexpand(r, max) == NULL) - return (0); - if (BN_ucmp(a, b) < 0) { - if (!BN_usub(r, b, a)) - return (0); - r->neg = 1; - } else { - if (!BN_usub(r, a, b)) - return (0); - r->neg = 0; - } + r->neg = r_neg; bn_check_top(r); - return (1); + return ret; } diff --git a/crypto/bn/bn_const.c b/crypto/bn/bn_const.c index 4be9f4f7..0ceff916 100644 --- a/crypto/bn/bn_const.c +++ b/crypto/bn/bn_const.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_const.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_const.c,v 1.5 2018/02/20 17:02:30 jsing Exp $ */ /* Insert boilerplate */ #include @@ -27,6 +27,12 @@ get_rfc2409_prime_768(BIGNUM *bn) return BN_bin2bn(RFC2409_PRIME_768, sizeof(RFC2409_PRIME_768), bn); } +BIGNUM * +BN_get_rfc2409_prime_768(BIGNUM *bn) +{ + return get_rfc2409_prime_768(bn); +} + /* "Second Oakley Default Group" from RFC2409, section 6.2. * * The prime is: 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }. @@ -54,6 +60,12 @@ get_rfc2409_prime_1024(BIGNUM *bn) return BN_bin2bn(RFC2409_PRIME_1024, sizeof(RFC2409_PRIME_1024), bn); } +BIGNUM * +BN_get_rfc2409_prime_1024(BIGNUM *bn) +{ + return get_rfc2409_prime_1024(bn); +} + /* "1536-bit MODP Group" from RFC3526, Section 2. * * The prime is: 2^1536 - 2^1472 - 1 + 2^64 * { [2^1406 pi] + 741804 } @@ -86,6 +98,12 @@ get_rfc3526_prime_1536(BIGNUM *bn) return BN_bin2bn(RFC3526_PRIME_1536, sizeof(RFC3526_PRIME_1536), bn); } +BIGNUM * +BN_get_rfc3526_prime_1536(BIGNUM *bn) +{ + return get_rfc3526_prime_1536(bn); +} + /* "2048-bit MODP Group" from RFC3526, Section 3. * * The prime is: 2^2048 - 2^1984 - 1 + 2^64 * { [2^1918 pi] + 124476 } @@ -123,6 +141,12 @@ get_rfc3526_prime_2048(BIGNUM *bn) return BN_bin2bn(RFC3526_PRIME_2048, sizeof(RFC3526_PRIME_2048), bn); } +BIGNUM * +BN_get_rfc3526_prime_2048(BIGNUM *bn) +{ + return get_rfc3526_prime_2048(bn); +} + /* "3072-bit MODP Group" from RFC3526, Section 4. * * The prime is: 2^3072 - 2^3008 - 1 + 2^64 * { [2^2942 pi] + 1690314 } @@ -170,6 +194,12 @@ get_rfc3526_prime_3072(BIGNUM *bn) return BN_bin2bn(RFC3526_PRIME_3072, sizeof(RFC3526_PRIME_3072), bn); } +BIGNUM * +BN_get_rfc3526_prime_3072(BIGNUM *bn) +{ + return get_rfc3526_prime_3072(bn); +} + /* "4096-bit MODP Group" from RFC3526, Section 5. * * The prime is: 2^4096 - 2^4032 - 1 + 2^64 * { [2^3966 pi] + 240904 } @@ -228,6 +258,12 @@ get_rfc3526_prime_4096(BIGNUM *bn) return BN_bin2bn(RFC3526_PRIME_4096, sizeof(RFC3526_PRIME_4096), bn); } +BIGNUM * +BN_get_rfc3526_prime_4096(BIGNUM *bn) +{ + return get_rfc3526_prime_4096(bn); +} + /* "6144-bit MODP Group" from RFC3526, Section 6. * * The prime is: 2^6144 - 2^6080 - 1 + 2^64 * { [2^6014 pi] + 929484 } @@ -307,6 +343,12 @@ get_rfc3526_prime_6144(BIGNUM *bn) return BN_bin2bn(RFC3526_PRIME_6144, sizeof(RFC3526_PRIME_6144), bn); } +BIGNUM * +BN_get_rfc3526_prime_6144(BIGNUM *bn) +{ + return get_rfc3526_prime_6144(bn); +} + /* "8192-bit MODP Group" from RFC3526, Section 7. * * The prime is: 2^8192 - 2^8128 - 1 + 2^64 * { [2^8062 pi] + 4743158 } @@ -407,3 +449,9 @@ get_rfc3526_prime_8192(BIGNUM *bn) }; return BN_bin2bn(RFC3526_PRIME_8192, sizeof(RFC3526_PRIME_8192), bn); } + +BIGNUM * +BN_get_rfc3526_prime_8192(BIGNUM *bn) +{ + return get_rfc3526_prime_8192(bn); +} diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c index f3a97bcc..1249a119 100644 --- a/crypto/bn/bn_div.c +++ b/crypto/bn/bn_div.c @@ -89,7 +89,7 @@ q; \ }) # define REMAINDER_IS_ALREADY_CALCULATED -# elif defined(__x86_64) +# elif defined(__x86_64) && defined(_LP64) /* * Same story here, but it's 128-bit by 64-bit division. Wow! * diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h index c010410c..a165d028 100644 --- a/crypto/bn/bn_lcl.h +++ b/crypto/bn/bn_lcl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_lcl.h,v 1.27 2017/01/25 06:15:44 beck Exp $ */ +/* $OpenBSD: bn_lcl.h,v 1.30 2018/11/05 23:52:47 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -239,7 +239,7 @@ __BEGIN_HIDDEN_DECLS : "r"(a), "r"(b)); \ ret; }) # endif /* compiler */ -# elif defined(__x86_64) || defined(__x86_64__) +# elif (defined(__x86_64) || defined(__x86_64__)) && defined(_LP64) # if defined(__GNUC__) && __GNUC__>=2 # define BN_UMULT_HIGH(a,b) ({ \ BN_ULONG ret,discard; \ @@ -583,6 +583,7 @@ BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, int BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, int num); int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom); +int bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc); /* Explicitly const time / non-const time versions for internal use */ int BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, @@ -605,5 +606,8 @@ BIGNUM *BN_mod_inverse_nonct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); int BN_gcd_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); int BN_gcd_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); + +int BN_swap_ct(BN_ULONG swap, BIGNUM *a, BIGNUM *b, size_t nwords); + __END_HIDDEN_DECLS #endif diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index 8aeeb530..0025cf52 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_lib.c,v 1.38 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: bn_lib.c,v 1.46 2019/03/23 18:48:15 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -529,7 +529,7 @@ BN_clear(BIGNUM *a) { bn_check_top(a); if (a->d != NULL) - memset(a->d, 0, a->dmax * sizeof(a->d[0])); + explicit_bzero(a->d, a->dmax * sizeof(a->d[0])); a->top = 0; a->neg = 0; } @@ -578,6 +578,8 @@ BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) BN_ULONG l; BIGNUM *bn = NULL; + if (len < 0) + return (NULL); if (ret == NULL) ret = bn = BN_new(); if (ret == NULL) @@ -837,8 +839,10 @@ bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, int cl, int dl) /* * Constant-time conditional swap of a and b. - * a and b are swapped if condition is not 0. The code assumes that at most one bit of condition is set. - * nwords is the number of words to swap. The code assumes that at least nwords are allocated in both a and b, + * a and b are swapped if condition is not 0. + * The code assumes that at most one bit of condition is set. + * nwords is the number of words to swap. + * The code assumes that at least nwords are allocated in both a and b, * and that no more than nwords are used by either a or b. * a and b cannot be the same number */ @@ -888,3 +892,79 @@ BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords) } #undef BN_CONSTTIME_SWAP } + +/* + * Constant-time conditional swap of a and b. + * a and b are swapped if condition is not 0. + * nwords is the number of words to swap. + */ +int +BN_swap_ct(BN_ULONG condition, BIGNUM *a, BIGNUM *b, size_t nwords) +{ + BN_ULONG t; + int i, words; + + if (a == b) + return 1; + if (nwords > INT_MAX) + return 0; + words = (int)nwords; + if (bn_wexpand(a, words) == NULL || bn_wexpand(b, words) == NULL) + return 0; + if (a->top > words || b->top > words) { + BNerror(BN_R_INVALID_LENGTH); + return 0; + } + + /* Set condition to 0 (if it was zero) or all 1s otherwise. */ + condition = ((~condition & (condition - 1)) >> (BN_BITS2 - 1)) - 1; + + /* swap top field */ + t = (a->top ^ b->top) & condition; + a->top ^= t; + b->top ^= t; + + /* swap neg field */ + t = (a->neg ^ b->neg) & condition; + a->neg ^= t; + b->neg ^= t; + + /* swap BN_FLG_CONSTTIME from flag field */ + t = ((a->flags ^ b->flags) & BN_FLG_CONSTTIME) & condition; + a->flags ^= t; + b->flags ^= t; + + /* swap the data */ + for (i = 0; i < words; i++) { + t = (a->d[i] ^ b->d[i]) & condition; + a->d[i] ^= t; + b->d[i] ^= t; + } + + return 1; +} + +BN_GENCB * +BN_GENCB_new(void) +{ + BN_GENCB *cb; + + if ((cb = calloc(1, sizeof(*cb))) == NULL) + return NULL; + + return cb; +} + +void +BN_GENCB_free(BN_GENCB *cb) +{ + if (cb == NULL) + return; + free(cb); +} + +void * +BN_GENCB_get_arg(BN_GENCB *cb) +{ + return cb->arg; +} diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c index 86257571..df798f41 100644 --- a/crypto/bn/bn_rand.c +++ b/crypto/bn/bn_rand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_rand.c,v 1.20 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: bn_rand.c,v 1.22 2018/11/06 06:49:45 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -279,6 +279,33 @@ BN_rand_range(BIGNUM *r, const BIGNUM *range) return bn_rand_range(0, r, range); } +int +bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc) +{ + BIGNUM *len = NULL; + int ret = 0; + + if (BN_cmp(lower_inc, upper_exc) >= 0) + goto err; + + if ((len = BN_new()) == NULL) + goto err; + + if (!BN_sub(len, upper_exc, lower_inc)) + goto err; + + if (!bn_rand_range(0, rnd, len)) + goto err; + + if (!BN_add(rnd, rnd, lower_inc)) + goto err; + + ret = 1; + err: + BN_free(len); + return ret; +} + int BN_pseudo_rand_range(BIGNUM *r, const BIGNUM *range) { diff --git a/crypto/bn/bn_shift.c b/crypto/bn/bn_shift.c index 56cebf57..0e8211e3 100644 --- a/crypto/bn/bn_shift.c +++ b/crypto/bn/bn_shift.c @@ -167,9 +167,7 @@ BN_lshift(BIGNUM *r, const BIGNUM *a, int n) bn_check_top(r); return (1); } -#ifdef _M_ARM64 -#pragma optimize("", off) -#endif + int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) { @@ -218,6 +216,3 @@ BN_rshift(BIGNUM *r, const BIGNUM *a, int n) bn_check_top(r); return (1); } -#ifdef _M_ARM64 -#pragma optimize("", on) -#endif diff --git a/crypto/bn/bn_x931p.c b/crypto/bn/bn_x931p.c index 45b61c91..55ca21c0 100644 --- a/crypto/bn/bn_x931p.c +++ b/crypto/bn/bn_x931p.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_x931p.c,v 1.10 2017/01/25 06:15:44 beck Exp $ */ +/* $OpenBSD: bn_x931p.c,v 1.11 2019/01/20 01:56:59 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2005. */ @@ -71,7 +71,7 @@ static int bn_x931_derive_pi(BIGNUM *pi, const BIGNUM *Xpi, BN_CTX *ctx, BN_GENCB *cb) { - int i = 0; + int i = 0, is_prime; if (!BN_copy(pi, Xpi)) return 0; @@ -81,7 +81,10 @@ bn_x931_derive_pi(BIGNUM *pi, const BIGNUM *Xpi, BN_CTX *ctx, BN_GENCB *cb) i++; BN_GENCB_call(cb, 0, i); /* NB 27 MR is specificed in X9.31 */ - if (BN_is_prime_fasttest_ex(pi, 27, ctx, 1, cb)) + is_prime = BN_is_prime_fasttest_ex(pi, 27, ctx, 1, cb); + if (is_prime < 0) + return 0; + if (is_prime == 1) break; if (!BN_add_word(pi, 2)) return 0; @@ -173,13 +176,20 @@ BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, const BIGNUM *Xp, goto err; if (!BN_gcd_ct(t, pm1, e, ctx)) goto err; - if (BN_is_one(t) - /* X9.31 specifies 8 MR and 1 Lucas test or any prime test - * offering similar or better guarantees 50 MR is considerably - * better. - */ - && BN_is_prime_fasttest_ex(p, 50, ctx, 1, cb)) - break; + if (BN_is_one(t)) { + int r; + + /* + * X9.31 specifies 8 MR and 1 Lucas test or any prime + * test offering similar or better guarantees 50 MR + * is considerably better. + */ + r = BN_is_prime_fasttest_ex(p, 50, ctx, 1, cb); + if (r < 0) + goto err; + if (r == 1) + break; + } if (!BN_add(p, p, p1p2)) goto err; } diff --git a/crypto/bn/gf2m-elf-armv4.S b/crypto/bn/gf2m-elf-armv4.S new file mode 100644 index 00000000..8e214cc8 --- /dev/null +++ b/crypto/bn/gf2m-elf-armv4.S @@ -0,0 +1,216 @@ +#include "arm_arch.h" + +.text +.code 32 + +#if __ARM_ARCH__>=7 +.fpu neon + +.type mul_1x1_neon,%function +.align 5 +mul_1x1_neon: + vshl.u64 d2,d16,#8 @ q1-q3 are slided + vmull.p8 q0,d16,d17 @ a·bb + vshl.u64 d4,d16,#16 + vmull.p8 q1,d2,d17 @ a<<8·bb + vshl.u64 d6,d16,#24 + vmull.p8 q2,d4,d17 @ a<<16·bb + vshr.u64 d2,#8 + vmull.p8 q3,d6,d17 @ a<<24·bb + vshl.u64 d3,#24 + veor d0,d2 + vshr.u64 d4,#16 + veor d0,d3 + vshl.u64 d5,#16 + veor d0,d4 + vshr.u64 d6,#24 + veor d0,d5 + vshl.u64 d7,#8 + veor d0,d6 + veor d0,d7 + .word 0xe12fff1e +.size mul_1x1_neon,.-mul_1x1_neon +#endif +.type mul_1x1_ialu,%function +.align 5 +mul_1x1_ialu: + mov r4,#0 + bic r5,r1,#3<<30 @ a1=a&0x3fffffff + str r4,[sp,#0] @ tab[0]=0 + add r6,r5,r5 @ a2=a1<<1 + str r5,[sp,#4] @ tab[1]=a1 + eor r7,r5,r6 @ a1^a2 + str r6,[sp,#8] @ tab[2]=a2 + mov r8,r5,lsl#2 @ a4=a1<<2 + str r7,[sp,#12] @ tab[3]=a1^a2 + eor r9,r5,r8 @ a1^a4 + str r8,[sp,#16] @ tab[4]=a4 + eor r4,r6,r8 @ a2^a4 + str r9,[sp,#20] @ tab[5]=a1^a4 + eor r7,r7,r8 @ a1^a2^a4 + str r4,[sp,#24] @ tab[6]=a2^a4 + and r8,r12,r0,lsl#2 + str r7,[sp,#28] @ tab[7]=a1^a2^a4 + + and r9,r12,r0,lsr#1 + ldr r5,[sp,r8] @ tab[b & 0x7] + and r8,r12,r0,lsr#4 + ldr r7,[sp,r9] @ tab[b >> 3 & 0x7] + and r9,r12,r0,lsr#7 + ldr r6,[sp,r8] @ tab[b >> 6 & 0x7] + eor r5,r5,r7,lsl#3 @ stall + mov r4,r7,lsr#29 + ldr r7,[sp,r9] @ tab[b >> 9 & 0x7] + + and r8,r12,r0,lsr#10 + eor r5,r5,r6,lsl#6 + eor r4,r4,r6,lsr#26 + ldr r6,[sp,r8] @ tab[b >> 12 & 0x7] + + and r9,r12,r0,lsr#13 + eor r5,r5,r7,lsl#9 + eor r4,r4,r7,lsr#23 + ldr r7,[sp,r9] @ tab[b >> 15 & 0x7] + + and r8,r12,r0,lsr#16 + eor r5,r5,r6,lsl#12 + eor r4,r4,r6,lsr#20 + ldr r6,[sp,r8] @ tab[b >> 18 & 0x7] + + and r9,r12,r0,lsr#19 + eor r5,r5,r7,lsl#15 + eor r4,r4,r7,lsr#17 + ldr r7,[sp,r9] @ tab[b >> 21 & 0x7] + + and r8,r12,r0,lsr#22 + eor r5,r5,r6,lsl#18 + eor r4,r4,r6,lsr#14 + ldr r6,[sp,r8] @ tab[b >> 24 & 0x7] + + and r9,r12,r0,lsr#25 + eor r5,r5,r7,lsl#21 + eor r4,r4,r7,lsr#11 + ldr r7,[sp,r9] @ tab[b >> 27 & 0x7] + + tst r1,#1<<30 + and r8,r12,r0,lsr#28 + eor r5,r5,r6,lsl#24 + eor r4,r4,r6,lsr#8 + ldr r6,[sp,r8] @ tab[b >> 30 ] + + eorne r5,r5,r0,lsl#30 + eorne r4,r4,r0,lsr#2 + tst r1,#1<<31 + eor r5,r5,r7,lsl#27 + eor r4,r4,r7,lsr#5 + eorne r5,r5,r0,lsl#31 + eorne r4,r4,r0,lsr#1 + eor r5,r5,r6,lsl#30 + eor r4,r4,r6,lsr#2 + + mov pc,lr +.size mul_1x1_ialu,.-mul_1x1_ialu +.global bn_GF2m_mul_2x2 +.type bn_GF2m_mul_2x2,%function +.align 5 +bn_GF2m_mul_2x2: +#if __ARM_ARCH__>=7 + ldr r12,.LOPENSSL_armcap +.Lpic: ldr r12,[pc,r12] + tst r12,#1 + beq .Lialu + + veor d18,d18 + vmov d19,r3,r3 @ two copies of b1 + vmov.32 d18[0],r1 @ a1 + + veor d20,d20 + vld1.32 d21[],[sp,:32] @ two copies of b0 + vmov.32 d20[0],r2 @ a0 + mov r12,lr + + vmov d16,d18 + vmov d17,d19 + bl mul_1x1_neon @ a1·b1 + vmov d22,d0 + + vmov d16,d20 + vmov d17,d21 + bl mul_1x1_neon @ a0·b0 + vmov d23,d0 + + veor d16,d20,d18 + veor d17,d21,d19 + veor d20,d23,d22 + bl mul_1x1_neon @ (a0+a1)·(b0+b1) + + veor d0,d20 @ (a0+a1)·(b0+b1)-a0·b0-a1·b1 + vshl.u64 d1,d0,#32 + vshr.u64 d0,d0,#32 + veor d23,d1 + veor d22,d0 + vst1.32 {d23[0]},[r0,:32]! + vst1.32 {d23[1]},[r0,:32]! + vst1.32 {d22[0]},[r0,:32]! + vst1.32 {d22[1]},[r0,:32] + bx r12 +.align 4 +.Lialu: +#endif + stmdb sp!,{r4-r10,lr} + mov r10,r0 @ reassign 1st argument + mov r0,r3 @ r0=b1 + ldr r3,[sp,#32] @ load b0 + mov r12,#7<<2 + sub sp,sp,#32 @ allocate tab[8] + + bl mul_1x1_ialu @ a1·b1 + str r5,[r10,#8] + str r4,[r10,#12] + + eor r0,r0,r3 @ flip b0 and b1 + eor r1,r1,r2 @ flip a0 and a1 + eor r3,r3,r0 + eor r2,r2,r1 + eor r0,r0,r3 + eor r1,r1,r2 + bl mul_1x1_ialu @ a0·b0 + str r5,[r10] + str r4,[r10,#4] + + eor r1,r1,r2 + eor r0,r0,r3 + bl mul_1x1_ialu @ (a1+a0)·(b1+b0) + ldmia r10,{r6-r9} + eor r5,r5,r4 + eor r4,r4,r7 + eor r5,r5,r6 + eor r4,r4,r8 + eor r5,r5,r9 + eor r4,r4,r9 + str r4,[r10,#8] + eor r5,r5,r4 + add sp,sp,#32 @ destroy tab[8] + str r5,[r10,#4] + +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r10,pc} +#else + ldmia sp!,{r4-r10,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.size bn_GF2m_mul_2x2,.-bn_GF2m_mul_2x2 +#if __ARM_ARCH__>=7 +.align 5 +.LOPENSSL_armcap: +.word OPENSSL_armcap_P-(.Lpic+8) +#endif +.asciz "GF(2^m) Multiplication for ARMv4/NEON, CRYPTOGAMS by " +.align 5 + +.comm OPENSSL_armcap_P,4,4 +#if defined(HAVE_GNU_STACK) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/crypto/bn/gf2m-elf-x86_64.S b/crypto/bn/gf2m-elf-x86_64.S index 018182d6..c53a2c0d 100644 --- a/crypto/bn/gf2m-elf-x86_64.S +++ b/crypto/bn/gf2m-elf-x86_64.S @@ -194,7 +194,7 @@ _mul_1x1: xorq %rdi,%rdx addq $128+8,%rsp - .byte 0xf3,0xc3 + retq .Lend_mul_1x1: .size _mul_1x1,.-_mul_1x1 @@ -227,7 +227,7 @@ bn_GF2m_mul_2x2: pxor %xmm5,%xmm0 movdqu %xmm2,0(%rdi) movdqu %xmm0,16(%rdi) - .byte 0xf3,0xc3 + retq .align 16 .Lvanilla_mul_2x2: @@ -286,7 +286,7 @@ bn_GF2m_mul_2x2: movq 104(%rsp),%rbp movq 112(%rsp),%rbx leaq 136(%rsp),%rsp - .byte 0xf3,0xc3 + retq .Lend_mul_2x2: .size bn_GF2m_mul_2x2,.-bn_GF2m_mul_2x2 .byte 71,70,40,50,94,109,41,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 diff --git a/crypto/bn/gf2m-macosx-x86_64.S b/crypto/bn/gf2m-macosx-x86_64.S index 6e3c44f8..693e1592 100644 --- a/crypto/bn/gf2m-macosx-x86_64.S +++ b/crypto/bn/gf2m-macosx-x86_64.S @@ -194,7 +194,7 @@ _mul_1x1: xorq %rdi,%rdx addq $128+8,%rsp - .byte 0xf3,0xc3 + retq L$end_mul_1x1: @@ -227,7 +227,7 @@ _bn_GF2m_mul_2x2: pxor %xmm5,%xmm0 movdqu %xmm2,0(%rdi) movdqu %xmm0,16(%rdi) - .byte 0xf3,0xc3 + retq .p2align 4 L$vanilla_mul_2x2: @@ -286,7 +286,7 @@ L$body_mul_2x2: movq 104(%rsp),%rbp movq 112(%rsp),%rbx leaq 136(%rsp),%rsp - .byte 0xf3,0xc3 + retq L$end_mul_2x2: .byte 71,70,40,50,94,109,41,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 diff --git a/crypto/bn/gf2m-masm-x86_64.S b/crypto/bn/gf2m-masm-x86_64.S new file mode 100644 index 00000000..ada5fe13 --- /dev/null +++ b/crypto/bn/gf2m-masm-x86_64.S @@ -0,0 +1,401 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + + +ALIGN 16 +_mul_1x1 PROC PRIVATE + sub rsp,128+8 + mov r9,-1 + lea rsi,QWORD PTR[rax*1+rax] + shr r9,3 + lea rdi,QWORD PTR[rax*4] + and r9,rax + lea r12,QWORD PTR[rax*8] + sar rax,63 + lea r10,QWORD PTR[r9*1+r9] + sar rsi,63 + lea r11,QWORD PTR[r9*4] + and rax,rbp + sar rdi,63 + mov rdx,rax + shl rax,63 + and rsi,rbp + shr rdx,1 + mov rcx,rsi + shl rsi,62 + and rdi,rbp + shr rcx,2 + xor rax,rsi + mov rbx,rdi + shl rdi,61 + xor rdx,rcx + shr rbx,3 + xor rax,rdi + xor rdx,rbx + + mov r13,r9 + mov QWORD PTR[rsp],0 + xor r13,r10 + mov QWORD PTR[8+rsp],r9 + mov r14,r11 + mov QWORD PTR[16+rsp],r10 + xor r14,r12 + mov QWORD PTR[24+rsp],r13 + + xor r9,r11 + mov QWORD PTR[32+rsp],r11 + xor r10,r11 + mov QWORD PTR[40+rsp],r9 + xor r13,r11 + mov QWORD PTR[48+rsp],r10 + xor r9,r14 + mov QWORD PTR[56+rsp],r13 + xor r10,r14 + + mov QWORD PTR[64+rsp],r12 + xor r13,r14 + mov QWORD PTR[72+rsp],r9 + xor r9,r11 + mov QWORD PTR[80+rsp],r10 + xor r10,r11 + mov QWORD PTR[88+rsp],r13 + + xor r13,r11 + mov QWORD PTR[96+rsp],r14 + mov rsi,r8 + mov QWORD PTR[104+rsp],r9 + and rsi,rbp + mov QWORD PTR[112+rsp],r10 + shr rbp,4 + mov QWORD PTR[120+rsp],r13 + mov rdi,r8 + and rdi,rbp + shr rbp,4 + + movq xmm0,QWORD PTR[rsi*8+rsp] + mov rsi,r8 + and rsi,rbp + shr rbp,4 + mov rcx,QWORD PTR[rdi*8+rsp] + mov rdi,r8 + mov rbx,rcx + shl rcx,4 + and rdi,rbp + movq xmm1,QWORD PTR[rsi*8+rsp] + shr rbx,60 + xor rax,rcx + pslldq xmm1,1 + mov rsi,r8 + shr rbp,4 + xor rdx,rbx + and rsi,rbp + shr rbp,4 + pxor xmm0,xmm1 + mov rcx,QWORD PTR[rdi*8+rsp] + mov rdi,r8 + mov rbx,rcx + shl rcx,12 + and rdi,rbp + movq xmm1,QWORD PTR[rsi*8+rsp] + shr rbx,52 + xor rax,rcx + pslldq xmm1,2 + mov rsi,r8 + shr rbp,4 + xor rdx,rbx + and rsi,rbp + shr rbp,4 + pxor xmm0,xmm1 + mov rcx,QWORD PTR[rdi*8+rsp] + mov rdi,r8 + mov rbx,rcx + shl rcx,20 + and rdi,rbp + movq xmm1,QWORD PTR[rsi*8+rsp] + shr rbx,44 + xor rax,rcx + pslldq xmm1,3 + mov rsi,r8 + shr rbp,4 + xor rdx,rbx + and rsi,rbp + shr rbp,4 + pxor xmm0,xmm1 + mov rcx,QWORD PTR[rdi*8+rsp] + mov rdi,r8 + mov rbx,rcx + shl rcx,28 + and rdi,rbp + movq xmm1,QWORD PTR[rsi*8+rsp] + shr rbx,36 + xor rax,rcx + pslldq xmm1,4 + mov rsi,r8 + shr rbp,4 + xor rdx,rbx + and rsi,rbp + shr rbp,4 + pxor xmm0,xmm1 + mov rcx,QWORD PTR[rdi*8+rsp] + mov rdi,r8 + mov rbx,rcx + shl rcx,36 + and rdi,rbp + movq xmm1,QWORD PTR[rsi*8+rsp] + shr rbx,28 + xor rax,rcx + pslldq xmm1,5 + mov rsi,r8 + shr rbp,4 + xor rdx,rbx + and rsi,rbp + shr rbp,4 + pxor xmm0,xmm1 + mov rcx,QWORD PTR[rdi*8+rsp] + mov rdi,r8 + mov rbx,rcx + shl rcx,44 + and rdi,rbp + movq xmm1,QWORD PTR[rsi*8+rsp] + shr rbx,20 + xor rax,rcx + pslldq xmm1,6 + mov rsi,r8 + shr rbp,4 + xor rdx,rbx + and rsi,rbp + shr rbp,4 + pxor xmm0,xmm1 + mov rcx,QWORD PTR[rdi*8+rsp] + mov rdi,r8 + mov rbx,rcx + shl rcx,52 + and rdi,rbp + movq xmm1,QWORD PTR[rsi*8+rsp] + shr rbx,12 + xor rax,rcx + pslldq xmm1,7 + mov rsi,r8 + shr rbp,4 + xor rdx,rbx + and rsi,rbp + shr rbp,4 + pxor xmm0,xmm1 + mov rcx,QWORD PTR[rdi*8+rsp] + mov rbx,rcx + shl rcx,60 + movd rsi,xmm0 + shr rbx,4 + xor rax,rcx + psrldq xmm0,8 + xor rdx,rbx + movd rdi,xmm0 + xor rax,rsi + xor rdx,rdi + + add rsp,128+8 + DB 0F3h,0C3h ;repret +$L$end_mul_1x1:: +_mul_1x1 ENDP +EXTERN OPENSSL_ia32cap_P:NEAR + +PUBLIC bn_GF2m_mul_2x2 + +ALIGN 16 +bn_GF2m_mul_2x2 PROC PUBLIC + mov eax,DWORD PTR[((OPENSSL_ia32cap_P+4))] + bt eax,IA32CAP_BIT1_PCLMUL + jnc $L$vanilla_mul_2x2 + + movd xmm0,rdx + movd xmm1,r9 + movd xmm2,r8 + movq xmm3,QWORD PTR[40+rsp] + movdqa xmm4,xmm0 + movdqa xmm5,xmm1 +DB 102,15,58,68,193,0 + pxor xmm4,xmm2 + pxor xmm5,xmm3 +DB 102,15,58,68,211,0 +DB 102,15,58,68,229,0 + xorps xmm4,xmm0 + xorps xmm4,xmm2 + movdqa xmm5,xmm4 + pslldq xmm4,8 + psrldq xmm5,8 + pxor xmm2,xmm4 + pxor xmm0,xmm5 + movdqu XMMWORD PTR[rcx],xmm2 + movdqu XMMWORD PTR[16+rcx],xmm0 + DB 0F3h,0C3h ;repret + +ALIGN 16 +$L$vanilla_mul_2x2:: + lea rsp,QWORD PTR[((-136))+rsp] + mov r10,QWORD PTR[176+rsp] + mov QWORD PTR[120+rsp],rdi + mov QWORD PTR[128+rsp],rsi + mov QWORD PTR[80+rsp],r14 + mov QWORD PTR[88+rsp],r13 + mov QWORD PTR[96+rsp],r12 + mov QWORD PTR[104+rsp],rbp + mov QWORD PTR[112+rsp],rbx +$L$body_mul_2x2:: + mov QWORD PTR[32+rsp],rcx + mov QWORD PTR[40+rsp],rdx + mov QWORD PTR[48+rsp],r8 + mov QWORD PTR[56+rsp],r9 + mov QWORD PTR[64+rsp],r10 + + mov r8,0fh + mov rax,rdx + mov rbp,r9 + call _mul_1x1 + mov QWORD PTR[16+rsp],rax + mov QWORD PTR[24+rsp],rdx + + mov rax,QWORD PTR[48+rsp] + mov rbp,QWORD PTR[64+rsp] + call _mul_1x1 + mov QWORD PTR[rsp],rax + mov QWORD PTR[8+rsp],rdx + + mov rax,QWORD PTR[40+rsp] + mov rbp,QWORD PTR[56+rsp] + xor rax,QWORD PTR[48+rsp] + xor rbp,QWORD PTR[64+rsp] + call _mul_1x1 + mov rbx,QWORD PTR[rsp] + mov rcx,QWORD PTR[8+rsp] + mov rdi,QWORD PTR[16+rsp] + mov rsi,QWORD PTR[24+rsp] + mov rbp,QWORD PTR[32+rsp] + + xor rax,rdx + xor rdx,rcx + xor rax,rbx + mov QWORD PTR[rbp],rbx + xor rdx,rdi + mov QWORD PTR[24+rbp],rsi + xor rax,rsi + xor rdx,rsi + xor rax,rdx + mov QWORD PTR[16+rbp],rdx + mov QWORD PTR[8+rbp],rax + + mov r14,QWORD PTR[80+rsp] + mov r13,QWORD PTR[88+rsp] + mov r12,QWORD PTR[96+rsp] + mov rbp,QWORD PTR[104+rsp] + mov rbx,QWORD PTR[112+rsp] + mov rdi,QWORD PTR[120+rsp] + mov rsi,QWORD PTR[128+rsp] + lea rsp,QWORD PTR[136+rsp] + DB 0F3h,0C3h ;repret +$L$end_mul_2x2:: +bn_GF2m_mul_2x2 ENDP +DB 71,70,40,50,94,109,41,32,77,117,108,116,105,112,108,105 +DB 99,97,116,105,111,110,32,102,111,114,32,120,56,54,95,54 +DB 52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121 +DB 32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46 +DB 111,114,103,62,0 +ALIGN 16 +EXTERN __imp_RtlVirtualUnwind:NEAR + + +ALIGN 16 +se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[152+r8] + mov rbx,QWORD PTR[248+r8] + + lea r10,QWORD PTR[$L$body_mul_2x2] + cmp rbx,r10 + jb $L$in_prologue + + mov r14,QWORD PTR[80+rax] + mov r13,QWORD PTR[88+rax] + mov r12,QWORD PTR[96+rax] + mov rbp,QWORD PTR[104+rax] + mov rbx,QWORD PTR[112+rax] + mov rdi,QWORD PTR[120+rax] + mov rsi,QWORD PTR[128+rax] + + mov QWORD PTR[144+r8],rbx + mov QWORD PTR[160+r8],rbp + mov QWORD PTR[168+r8],rsi + mov QWORD PTR[176+r8],rdi + mov QWORD PTR[216+r8],r12 + mov QWORD PTR[224+r8],r13 + mov QWORD PTR[232+r8],r14 + +$L$in_prologue:: + lea rax,QWORD PTR[136+rax] + mov QWORD PTR[152+r8],rax + + mov rdi,QWORD PTR[40+r9] + mov rsi,r8 + mov ecx,154 + DD 0a548f3fch + + mov rsi,r9 + xor rcx,rcx + mov rdx,QWORD PTR[8+rsi] + mov r8,QWORD PTR[rsi] + mov r9,QWORD PTR[16+rsi] + mov r10,QWORD PTR[40+rsi] + lea r11,QWORD PTR[56+rsi] + lea r12,QWORD PTR[24+rsi] + mov QWORD PTR[32+rsp],r10 + mov QWORD PTR[40+rsp],r11 + mov QWORD PTR[48+rsp],r12 + mov QWORD PTR[56+rsp],rcx + call QWORD PTR[__imp_RtlVirtualUnwind] + + mov eax,1 + add rsp,64 + popfq + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + pop rbx + pop rdi + pop rsi + DB 0F3h,0C3h ;repret +se_handler ENDP + +.text$ ENDS +.pdata SEGMENT READONLY ALIGN(4) +ALIGN 4 + DD imagerel _mul_1x1 + DD imagerel $L$end_mul_1x1 + DD imagerel $L$SEH_info_1x1 + + DD imagerel $L$vanilla_mul_2x2 + DD imagerel $L$end_mul_2x2 + DD imagerel $L$SEH_info_2x2 +.pdata ENDS +.xdata SEGMENT READONLY ALIGN(8) +ALIGN 8 +$L$SEH_info_1x1:: +DB 001h,007h,002h,000h +DB 007h,001h,011h,000h +$L$SEH_info_2x2:: +DB 9,0,0,0 + DD imagerel se_handler + +.xdata ENDS +END diff --git a/crypto/bn/modexp512-elf-x86_64.S b/crypto/bn/modexp512-elf-x86_64.S index d2932a31..76baefed 100644 --- a/crypto/bn/modexp512-elf-x86_64.S +++ b/crypto/bn/modexp512-elf-x86_64.S @@ -129,7 +129,7 @@ MULADD_128x512: addq %rbx,%r8 adcq $0,%rdx movq %rdx,%r9 - .byte 0xf3,0xc3 + retq .size MULADD_128x512,.-MULADD_128x512 .type mont_reduce,@function .align 16 @@ -572,7 +572,7 @@ mont_reduce: movq %r8,48(%rsi) movq %r9,56(%rsi) - .byte 0xf3,0xc3 + retq .size mont_reduce,.-mont_reduce .type mont_mul_a3b,@function .align 16 @@ -1770,7 +1770,7 @@ end_main_loop_a3b: movq 40(%rsi),%rbp leaq 48(%rsi),%rsp .Lepilogue: - .byte 0xf3,0xc3 + retq .size mod_exp_512, . - mod_exp_512 #if defined(HAVE_GNU_STACK) .section .note.GNU-stack,"",%progbits diff --git a/crypto/bn/modexp512-macosx-x86_64.S b/crypto/bn/modexp512-macosx-x86_64.S index df263dca..4d7b0b82 100644 --- a/crypto/bn/modexp512-macosx-x86_64.S +++ b/crypto/bn/modexp512-macosx-x86_64.S @@ -129,7 +129,7 @@ MULADD_128x512: addq %rbx,%r8 adcq $0,%rdx movq %rdx,%r9 - .byte 0xf3,0xc3 + retq .p2align 4 @@ -572,7 +572,7 @@ mont_reduce: movq %r8,48(%rsi) movq %r9,56(%rsi) - .byte 0xf3,0xc3 + retq .p2align 4 @@ -1770,5 +1770,5 @@ end_main_loop_a3b: movq 40(%rsi),%rbp leaq 48(%rsi),%rsp L$epilogue: - .byte 0xf3,0xc3 + retq diff --git a/crypto/bn/modexp512-masm-x86_64.S b/crypto/bn/modexp512-masm-x86_64.S new file mode 100644 index 00000000..3d824aed --- /dev/null +++ b/crypto/bn/modexp512-masm-x86_64.S @@ -0,0 +1,1791 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + + +ALIGN 16 +MULADD_128x512 PROC PRIVATE + mov rax,QWORD PTR[rsi] + mul rbp + add r8,rax + adc rdx,0 + mov QWORD PTR[rcx],r8 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov r8,rdx + mov rbp,QWORD PTR[8+rdi] + mov rax,QWORD PTR[rsi] + mul rbp + add r9,rax + adc rdx,0 + mov QWORD PTR[8+rcx],r9 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r8,rax + adc rdx,0 + add r8,rbx + adc rdx,0 + mov r9,rdx + DB 0F3h,0C3h ;repret +MULADD_128x512 ENDP + +ALIGN 16 +mont_reduce PROC PRIVATE + lea rdi,QWORD PTR[192+rsp] + mov rsi,QWORD PTR[32+rsp] + add rsi,576 + lea rcx,QWORD PTR[520+rsp] + + mov rbp,QWORD PTR[96+rcx] + mov rax,QWORD PTR[rsi] + mul rbp + mov r8,QWORD PTR[rcx] + add r8,rax + adc rdx,0 + mov QWORD PTR[rdi],r8 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + mov r9,QWORD PTR[8+rcx] + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + mov r10,QWORD PTR[16+rcx] + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + mov r11,QWORD PTR[24+rcx] + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + mov r12,QWORD PTR[32+rcx] + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + mov r13,QWORD PTR[40+rcx] + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + mov r14,QWORD PTR[48+rcx] + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + mov r15,QWORD PTR[56+rcx] + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov r8,rdx + mov rbp,QWORD PTR[104+rcx] + mov rax,QWORD PTR[rsi] + mul rbp + add r9,rax + adc rdx,0 + mov QWORD PTR[8+rdi],r9 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r8,rax + adc rdx,0 + add r8,rbx + adc rdx,0 + mov r9,rdx + mov rbp,QWORD PTR[112+rcx] + mov rax,QWORD PTR[rsi] + mul rbp + add r10,rax + adc rdx,0 + mov QWORD PTR[16+rdi],r10 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r8,rax + adc rdx,0 + add r8,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov r10,rdx + mov rbp,QWORD PTR[120+rcx] + mov rax,QWORD PTR[rsi] + mul rbp + add r11,rax + adc rdx,0 + mov QWORD PTR[24+rdi],r11 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r8,rax + adc rdx,0 + add r8,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov r11,rdx + xor rax,rax + + add r8,QWORD PTR[64+rcx] + adc r9,QWORD PTR[72+rcx] + adc r10,QWORD PTR[80+rcx] + adc r11,QWORD PTR[88+rcx] + adc rax,0 + + + + + mov QWORD PTR[64+rdi],r8 + mov QWORD PTR[72+rdi],r9 + mov rbp,r10 + mov QWORD PTR[88+rdi],r11 + + mov QWORD PTR[384+rsp],rax + + mov r8,QWORD PTR[rdi] + mov r9,QWORD PTR[8+rdi] + mov r10,QWORD PTR[16+rdi] + mov r11,QWORD PTR[24+rdi] + + + + + + + + + add rdi,8*10 + + add rsi,64 + lea rcx,QWORD PTR[296+rsp] + + call MULADD_128x512 + + mov rax,QWORD PTR[384+rsp] + + + add r8,QWORD PTR[((-16))+rdi] + adc r9,QWORD PTR[((-8))+rdi] + mov QWORD PTR[64+rcx],r8 + mov QWORD PTR[72+rcx],r9 + + adc rax,rax + mov QWORD PTR[384+rsp],rax + + lea rdi,QWORD PTR[192+rsp] + add rsi,64 + + + + + + mov r8,QWORD PTR[rsi] + mov rbx,QWORD PTR[8+rsi] + + mov rax,QWORD PTR[rcx] + mul r8 + mov rbp,rax + mov r9,rdx + + mov rax,QWORD PTR[8+rcx] + mul r8 + add r9,rax + + mov rax,QWORD PTR[rcx] + mul rbx + add r9,rax + + mov QWORD PTR[8+rdi],r9 + + + sub rsi,192 + + mov r8,QWORD PTR[rcx] + mov r9,QWORD PTR[8+rcx] + + call MULADD_128x512 + + + + + mov rax,QWORD PTR[rsi] + mov rbx,QWORD PTR[8+rsi] + mov rdi,QWORD PTR[16+rsi] + mov rdx,QWORD PTR[24+rsi] + + + mov rbp,QWORD PTR[384+rsp] + + add r8,QWORD PTR[64+rcx] + adc r9,QWORD PTR[72+rcx] + + + adc rbp,rbp + + + + shl rbp,3 + mov rcx,QWORD PTR[32+rsp] + add rbp,rcx + + + xor rsi,rsi + + add r10,QWORD PTR[rbp] + adc r11,QWORD PTR[64+rbp] + adc r12,QWORD PTR[128+rbp] + adc r13,QWORD PTR[192+rbp] + adc r14,QWORD PTR[256+rbp] + adc r15,QWORD PTR[320+rbp] + adc r8,QWORD PTR[384+rbp] + adc r9,QWORD PTR[448+rbp] + + + + sbb rsi,0 + + + and rax,rsi + and rbx,rsi + and rdi,rsi + and rdx,rsi + + mov rbp,1 + sub r10,rax + sbb r11,rbx + sbb r12,rdi + sbb r13,rdx + + + + + sbb rbp,0 + + + + add rcx,512 + mov rax,QWORD PTR[32+rcx] + mov rbx,QWORD PTR[40+rcx] + mov rdi,QWORD PTR[48+rcx] + mov rdx,QWORD PTR[56+rcx] + + + + and rax,rsi + and rbx,rsi + and rdi,rsi + and rdx,rsi + + + + sub rbp,1 + + sbb r14,rax + sbb r15,rbx + sbb r8,rdi + sbb r9,rdx + + + + mov rsi,QWORD PTR[144+rsp] + mov QWORD PTR[rsi],r10 + mov QWORD PTR[8+rsi],r11 + mov QWORD PTR[16+rsi],r12 + mov QWORD PTR[24+rsi],r13 + mov QWORD PTR[32+rsi],r14 + mov QWORD PTR[40+rsi],r15 + mov QWORD PTR[48+rsi],r8 + mov QWORD PTR[56+rsi],r9 + + DB 0F3h,0C3h ;repret +mont_reduce ENDP + +ALIGN 16 +mont_mul_a3b PROC PRIVATE + + + + + mov rbp,QWORD PTR[rdi] + + mov rax,r10 + mul rbp + mov QWORD PTR[520+rsp],rax + mov r10,rdx + mov rax,r11 + mul rbp + add r10,rax + adc rdx,0 + mov r11,rdx + mov rax,r12 + mul rbp + add r11,rax + adc rdx,0 + mov r12,rdx + mov rax,r13 + mul rbp + add r12,rax + adc rdx,0 + mov r13,rdx + mov rax,r14 + mul rbp + add r13,rax + adc rdx,0 + mov r14,rdx + mov rax,r15 + mul rbp + add r14,rax + adc rdx,0 + mov r15,rdx + mov rax,r8 + mul rbp + add r15,rax + adc rdx,0 + mov r8,rdx + mov rax,r9 + mul rbp + add r8,rax + adc rdx,0 + mov r9,rdx + mov rbp,QWORD PTR[8+rdi] + mov rax,QWORD PTR[rsi] + mul rbp + add r10,rax + adc rdx,0 + mov QWORD PTR[528+rsp],r10 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r8,rax + adc rdx,0 + add r8,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov r10,rdx + mov rbp,QWORD PTR[16+rdi] + mov rax,QWORD PTR[rsi] + mul rbp + add r11,rax + adc rdx,0 + mov QWORD PTR[536+rsp],r11 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r8,rax + adc rdx,0 + add r8,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov r11,rdx + mov rbp,QWORD PTR[24+rdi] + mov rax,QWORD PTR[rsi] + mul rbp + add r12,rax + adc rdx,0 + mov QWORD PTR[544+rsp],r12 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r8,rax + adc rdx,0 + add r8,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov r12,rdx + mov rbp,QWORD PTR[32+rdi] + mov rax,QWORD PTR[rsi] + mul rbp + add r13,rax + adc rdx,0 + mov QWORD PTR[552+rsp],r13 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r8,rax + adc rdx,0 + add r8,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov r13,rdx + mov rbp,QWORD PTR[40+rdi] + mov rax,QWORD PTR[rsi] + mul rbp + add r14,rax + adc rdx,0 + mov QWORD PTR[560+rsp],r14 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r8,rax + adc rdx,0 + add r8,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov r14,rdx + mov rbp,QWORD PTR[48+rdi] + mov rax,QWORD PTR[rsi] + mul rbp + add r15,rax + adc rdx,0 + mov QWORD PTR[568+rsp],r15 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r8,rax + adc rdx,0 + add r8,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov r15,rdx + mov rbp,QWORD PTR[56+rdi] + mov rax,QWORD PTR[rsi] + mul rbp + add r8,rax + adc rdx,0 + mov QWORD PTR[576+rsp],r8 + mov rbx,rdx + + mov rax,QWORD PTR[8+rsi] + mul rbp + add r9,rax + adc rdx,0 + add r9,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[16+rsi] + mul rbp + add r10,rax + adc rdx,0 + add r10,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[24+rsi] + mul rbp + add r11,rax + adc rdx,0 + add r11,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[32+rsi] + mul rbp + add r12,rax + adc rdx,0 + add r12,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[40+rsi] + mul rbp + add r13,rax + adc rdx,0 + add r13,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[48+rsi] + mul rbp + add r14,rax + adc rdx,0 + add r14,rbx + adc rdx,0 + mov rbx,rdx + + mov rax,QWORD PTR[56+rsi] + mul rbp + add r15,rax + adc rdx,0 + add r15,rbx + adc rdx,0 + mov r8,rdx + mov QWORD PTR[584+rsp],r9 + mov QWORD PTR[592+rsp],r10 + mov QWORD PTR[600+rsp],r11 + mov QWORD PTR[608+rsp],r12 + mov QWORD PTR[616+rsp],r13 + mov QWORD PTR[624+rsp],r14 + mov QWORD PTR[632+rsp],r15 + mov QWORD PTR[640+rsp],r8 + + + + + + jmp mont_reduce + + +mont_mul_a3b ENDP + +ALIGN 16 +sqr_reduce PROC PRIVATE + mov rcx,QWORD PTR[16+rsp] + + + + mov rbx,r10 + + mov rax,r11 + mul rbx + mov QWORD PTR[528+rsp],rax + mov r10,rdx + mov rax,r12 + mul rbx + add r10,rax + adc rdx,0 + mov r11,rdx + mov rax,r13 + mul rbx + add r11,rax + adc rdx,0 + mov r12,rdx + mov rax,r14 + mul rbx + add r12,rax + adc rdx,0 + mov r13,rdx + mov rax,r15 + mul rbx + add r13,rax + adc rdx,0 + mov r14,rdx + mov rax,r8 + mul rbx + add r14,rax + adc rdx,0 + mov r15,rdx + mov rax,r9 + mul rbx + add r15,rax + adc rdx,0 + mov rsi,rdx + + mov QWORD PTR[536+rsp],r10 + + + + + + mov rbx,QWORD PTR[8+rcx] + + mov rax,QWORD PTR[16+rcx] + mul rbx + add r11,rax + adc rdx,0 + mov QWORD PTR[544+rsp],r11 + + mov r10,rdx + mov rax,QWORD PTR[24+rcx] + mul rbx + add r12,rax + adc rdx,0 + add r12,r10 + adc rdx,0 + mov QWORD PTR[552+rsp],r12 + + mov r10,rdx + mov rax,QWORD PTR[32+rcx] + mul rbx + add r13,rax + adc rdx,0 + add r13,r10 + adc rdx,0 + + mov r10,rdx + mov rax,QWORD PTR[40+rcx] + mul rbx + add r14,rax + adc rdx,0 + add r14,r10 + adc rdx,0 + + mov r10,rdx + mov rax,r8 + mul rbx + add r15,rax + adc rdx,0 + add r15,r10 + adc rdx,0 + + mov r10,rdx + mov rax,r9 + mul rbx + add rsi,rax + adc rdx,0 + add rsi,r10 + adc rdx,0 + + mov r11,rdx + + + + + mov rbx,QWORD PTR[16+rcx] + + mov rax,QWORD PTR[24+rcx] + mul rbx + add r13,rax + adc rdx,0 + mov QWORD PTR[560+rsp],r13 + + mov r10,rdx + mov rax,QWORD PTR[32+rcx] + mul rbx + add r14,rax + adc rdx,0 + add r14,r10 + adc rdx,0 + mov QWORD PTR[568+rsp],r14 + + mov r10,rdx + mov rax,QWORD PTR[40+rcx] + mul rbx + add r15,rax + adc rdx,0 + add r15,r10 + adc rdx,0 + + mov r10,rdx + mov rax,r8 + mul rbx + add rsi,rax + adc rdx,0 + add rsi,r10 + adc rdx,0 + + mov r10,rdx + mov rax,r9 + mul rbx + add r11,rax + adc rdx,0 + add r11,r10 + adc rdx,0 + + mov r12,rdx + + + + + + mov rbx,QWORD PTR[24+rcx] + + mov rax,QWORD PTR[32+rcx] + mul rbx + add r15,rax + adc rdx,0 + mov QWORD PTR[576+rsp],r15 + + mov r10,rdx + mov rax,QWORD PTR[40+rcx] + mul rbx + add rsi,rax + adc rdx,0 + add rsi,r10 + adc rdx,0 + mov QWORD PTR[584+rsp],rsi + + mov r10,rdx + mov rax,r8 + mul rbx + add r11,rax + adc rdx,0 + add r11,r10 + adc rdx,0 + + mov r10,rdx + mov rax,r9 + mul rbx + add r12,rax + adc rdx,0 + add r12,r10 + adc rdx,0 + + mov r15,rdx + + + + + mov rbx,QWORD PTR[32+rcx] + + mov rax,QWORD PTR[40+rcx] + mul rbx + add r11,rax + adc rdx,0 + mov QWORD PTR[592+rsp],r11 + + mov r10,rdx + mov rax,r8 + mul rbx + add r12,rax + adc rdx,0 + add r12,r10 + adc rdx,0 + mov QWORD PTR[600+rsp],r12 + + mov r10,rdx + mov rax,r9 + mul rbx + add r15,rax + adc rdx,0 + add r15,r10 + adc rdx,0 + + mov r11,rdx + + + + + mov rbx,QWORD PTR[40+rcx] + + mov rax,r8 + mul rbx + add r15,rax + adc rdx,0 + mov QWORD PTR[608+rsp],r15 + + mov r10,rdx + mov rax,r9 + mul rbx + add r11,rax + adc rdx,0 + add r11,r10 + adc rdx,0 + mov QWORD PTR[616+rsp],r11 + + mov r12,rdx + + + + + mov rbx,r8 + + mov rax,r9 + mul rbx + add r12,rax + adc rdx,0 + mov QWORD PTR[624+rsp],r12 + + mov QWORD PTR[632+rsp],rdx + + + mov r10,QWORD PTR[528+rsp] + mov r11,QWORD PTR[536+rsp] + mov r12,QWORD PTR[544+rsp] + mov r13,QWORD PTR[552+rsp] + mov r14,QWORD PTR[560+rsp] + mov r15,QWORD PTR[568+rsp] + + mov rax,QWORD PTR[24+rcx] + mul rax + mov rdi,rax + mov r8,rdx + + add r10,r10 + adc r11,r11 + adc r12,r12 + adc r13,r13 + adc r14,r14 + adc r15,r15 + adc r8,0 + + mov rax,QWORD PTR[rcx] + mul rax + mov QWORD PTR[520+rsp],rax + mov rbx,rdx + + mov rax,QWORD PTR[8+rcx] + mul rax + + add r10,rbx + adc r11,rax + adc rdx,0 + + mov rbx,rdx + mov QWORD PTR[528+rsp],r10 + mov QWORD PTR[536+rsp],r11 + + mov rax,QWORD PTR[16+rcx] + mul rax + + add r12,rbx + adc r13,rax + adc rdx,0 + + mov rbx,rdx + + mov QWORD PTR[544+rsp],r12 + mov QWORD PTR[552+rsp],r13 + + xor rbp,rbp + add r14,rbx + adc r15,rdi + adc rbp,0 + + mov QWORD PTR[560+rsp],r14 + mov QWORD PTR[568+rsp],r15 + + + + + mov r10,QWORD PTR[576+rsp] + mov r11,QWORD PTR[584+rsp] + mov r12,QWORD PTR[592+rsp] + mov r13,QWORD PTR[600+rsp] + mov r14,QWORD PTR[608+rsp] + mov r15,QWORD PTR[616+rsp] + mov rdi,QWORD PTR[624+rsp] + mov rsi,QWORD PTR[632+rsp] + + mov rax,r9 + mul rax + mov r9,rax + mov rbx,rdx + + add r10,r10 + adc r11,r11 + adc r12,r12 + adc r13,r13 + adc r14,r14 + adc r15,r15 + adc rdi,rdi + adc rsi,rsi + adc rbx,0 + + add r10,rbp + + mov rax,QWORD PTR[32+rcx] + mul rax + + add r10,r8 + adc r11,rax + adc rdx,0 + + mov rbp,rdx + + mov QWORD PTR[576+rsp],r10 + mov QWORD PTR[584+rsp],r11 + + mov rax,QWORD PTR[40+rcx] + mul rax + + add r12,rbp + adc r13,rax + adc rdx,0 + + mov rbp,rdx + + mov QWORD PTR[592+rsp],r12 + mov QWORD PTR[600+rsp],r13 + + mov rax,QWORD PTR[48+rcx] + mul rax + + add r14,rbp + adc r15,rax + adc rdx,0 + + mov QWORD PTR[608+rsp],r14 + mov QWORD PTR[616+rsp],r15 + + add rdi,rdx + adc rsi,r9 + adc rbx,0 + + mov QWORD PTR[624+rsp],rdi + mov QWORD PTR[632+rsp],rsi + mov QWORD PTR[640+rsp],rbx + + jmp mont_reduce + + +sqr_reduce ENDP +PUBLIC mod_exp_512 + +mod_exp_512 PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_mod_exp_512:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + + + push rbp + push rbx + push r12 + push r13 + push r14 + push r15 + + + mov r8,rsp + sub rsp,2688 + and rsp,-64 + + + mov QWORD PTR[rsp],r8 + mov QWORD PTR[8+rsp],rdi + mov QWORD PTR[16+rsp],rsi + mov QWORD PTR[24+rsp],rcx +$L$body:: + + + + pxor xmm4,xmm4 + movdqu xmm0,XMMWORD PTR[rsi] + movdqu xmm1,XMMWORD PTR[16+rsi] + movdqu xmm2,XMMWORD PTR[32+rsi] + movdqu xmm3,XMMWORD PTR[48+rsi] + movdqa XMMWORD PTR[512+rsp],xmm4 + movdqa XMMWORD PTR[528+rsp],xmm4 + movdqa XMMWORD PTR[608+rsp],xmm4 + movdqa XMMWORD PTR[624+rsp],xmm4 + movdqa XMMWORD PTR[544+rsp],xmm0 + movdqa XMMWORD PTR[560+rsp],xmm1 + movdqa XMMWORD PTR[576+rsp],xmm2 + movdqa XMMWORD PTR[592+rsp],xmm3 + + + movdqu xmm0,XMMWORD PTR[rdx] + movdqu xmm1,XMMWORD PTR[16+rdx] + movdqu xmm2,XMMWORD PTR[32+rdx] + movdqu xmm3,XMMWORD PTR[48+rdx] + + lea rbx,QWORD PTR[384+rsp] + mov QWORD PTR[136+rsp],rbx + call mont_reduce + + + lea rcx,QWORD PTR[448+rsp] + xor rax,rax + mov QWORD PTR[rcx],rax + mov QWORD PTR[8+rcx],rax + mov QWORD PTR[24+rcx],rax + mov QWORD PTR[32+rcx],rax + mov QWORD PTR[40+rcx],rax + mov QWORD PTR[48+rcx],rax + mov QWORD PTR[56+rcx],rax + mov QWORD PTR[128+rsp],rax + mov QWORD PTR[16+rcx],1 + + lea rbp,QWORD PTR[640+rsp] + mov rsi,rcx + mov rdi,rbp + mov rax,8 +loop_0:: + mov rbx,QWORD PTR[rcx] + mov WORD PTR[rdi],bx + shr rbx,16 + mov WORD PTR[64+rdi],bx + shr rbx,16 + mov WORD PTR[128+rdi],bx + shr rbx,16 + mov WORD PTR[192+rdi],bx + lea rcx,QWORD PTR[8+rcx] + lea rdi,QWORD PTR[256+rdi] + dec rax + jnz loop_0 + mov rax,31 + mov QWORD PTR[32+rsp],rax + mov QWORD PTR[40+rsp],rbp + + mov QWORD PTR[136+rsp],rsi + mov r10,QWORD PTR[rsi] + mov r11,QWORD PTR[8+rsi] + mov r12,QWORD PTR[16+rsi] + mov r13,QWORD PTR[24+rsi] + mov r14,QWORD PTR[32+rsi] + mov r15,QWORD PTR[40+rsi] + mov r8,QWORD PTR[48+rsi] + mov r9,QWORD PTR[56+rsi] +init_loop:: + lea rdi,QWORD PTR[384+rsp] + call mont_mul_a3b + lea rsi,QWORD PTR[448+rsp] + mov rbp,QWORD PTR[40+rsp] + add rbp,2 + mov QWORD PTR[40+rsp],rbp + mov rcx,rsi + mov rax,8 +loop_1:: + mov rbx,QWORD PTR[rcx] + mov WORD PTR[rbp],bx + shr rbx,16 + mov WORD PTR[64+rbp],bx + shr rbx,16 + mov WORD PTR[128+rbp],bx + shr rbx,16 + mov WORD PTR[192+rbp],bx + lea rcx,QWORD PTR[8+rcx] + lea rbp,QWORD PTR[256+rbp] + dec rax + jnz loop_1 + mov rax,QWORD PTR[32+rsp] + sub rax,1 + mov QWORD PTR[32+rsp],rax + jne init_loop + + + + movdqa XMMWORD PTR[64+rsp],xmm0 + movdqa XMMWORD PTR[80+rsp],xmm1 + movdqa XMMWORD PTR[96+rsp],xmm2 + movdqa XMMWORD PTR[112+rsp],xmm3 + + + + + + mov eax,DWORD PTR[126+rsp] + mov rdx,rax + shr rax,11 + and edx,007FFh + mov DWORD PTR[126+rsp],edx + lea rsi,QWORD PTR[640+rax*2+rsp] + mov rdx,QWORD PTR[8+rsp] + mov rbp,4 +loop_2:: + movzx rbx,WORD PTR[192+rsi] + movzx rax,WORD PTR[448+rsi] + shl rbx,16 + shl rax,16 + mov bx,WORD PTR[128+rsi] + mov ax,WORD PTR[384+rsi] + shl rbx,16 + shl rax,16 + mov bx,WORD PTR[64+rsi] + mov ax,WORD PTR[320+rsi] + shl rbx,16 + shl rax,16 + mov bx,WORD PTR[rsi] + mov ax,WORD PTR[256+rsi] + mov QWORD PTR[rdx],rbx + mov QWORD PTR[8+rdx],rax + lea rsi,QWORD PTR[512+rsi] + lea rdx,QWORD PTR[16+rdx] + sub rbp,1 + jnz loop_2 + mov QWORD PTR[48+rsp],505 + + mov rcx,QWORD PTR[8+rsp] + mov QWORD PTR[136+rsp],rcx + mov r10,QWORD PTR[rcx] + mov r11,QWORD PTR[8+rcx] + mov r12,QWORD PTR[16+rcx] + mov r13,QWORD PTR[24+rcx] + mov r14,QWORD PTR[32+rcx] + mov r15,QWORD PTR[40+rcx] + mov r8,QWORD PTR[48+rcx] + mov r9,QWORD PTR[56+rcx] + jmp sqr_2 + +main_loop_a3b:: + call sqr_reduce + call sqr_reduce + call sqr_reduce +sqr_2:: + call sqr_reduce + call sqr_reduce + + + + mov rcx,QWORD PTR[48+rsp] + mov rax,rcx + shr rax,4 + mov edx,DWORD PTR[64+rax*2+rsp] + and rcx,15 + shr rdx,cl + and rdx,01Fh + + lea rsi,QWORD PTR[640+rdx*2+rsp] + lea rdx,QWORD PTR[448+rsp] + mov rdi,rdx + mov rbp,4 +loop_3:: + movzx rbx,WORD PTR[192+rsi] + movzx rax,WORD PTR[448+rsi] + shl rbx,16 + shl rax,16 + mov bx,WORD PTR[128+rsi] + mov ax,WORD PTR[384+rsi] + shl rbx,16 + shl rax,16 + mov bx,WORD PTR[64+rsi] + mov ax,WORD PTR[320+rsi] + shl rbx,16 + shl rax,16 + mov bx,WORD PTR[rsi] + mov ax,WORD PTR[256+rsi] + mov QWORD PTR[rdx],rbx + mov QWORD PTR[8+rdx],rax + lea rsi,QWORD PTR[512+rsi] + lea rdx,QWORD PTR[16+rdx] + sub rbp,1 + jnz loop_3 + mov rsi,QWORD PTR[8+rsp] + call mont_mul_a3b + + + + mov rcx,QWORD PTR[48+rsp] + sub rcx,5 + mov QWORD PTR[48+rsp],rcx + jge main_loop_a3b + + + +end_main_loop_a3b:: + + + mov rdx,QWORD PTR[8+rsp] + pxor xmm4,xmm4 + movdqu xmm0,XMMWORD PTR[rdx] + movdqu xmm1,XMMWORD PTR[16+rdx] + movdqu xmm2,XMMWORD PTR[32+rdx] + movdqu xmm3,XMMWORD PTR[48+rdx] + movdqa XMMWORD PTR[576+rsp],xmm4 + movdqa XMMWORD PTR[592+rsp],xmm4 + movdqa XMMWORD PTR[608+rsp],xmm4 + movdqa XMMWORD PTR[624+rsp],xmm4 + movdqa XMMWORD PTR[512+rsp],xmm0 + movdqa XMMWORD PTR[528+rsp],xmm1 + movdqa XMMWORD PTR[544+rsp],xmm2 + movdqa XMMWORD PTR[560+rsp],xmm3 + call mont_reduce + + + + mov rax,QWORD PTR[8+rsp] + mov r8,QWORD PTR[rax] + mov r9,QWORD PTR[8+rax] + mov r10,QWORD PTR[16+rax] + mov r11,QWORD PTR[24+rax] + mov r12,QWORD PTR[32+rax] + mov r13,QWORD PTR[40+rax] + mov r14,QWORD PTR[48+rax] + mov r15,QWORD PTR[56+rax] + + + mov rbx,QWORD PTR[24+rsp] + add rbx,512 + + sub r8,QWORD PTR[rbx] + sbb r9,QWORD PTR[8+rbx] + sbb r10,QWORD PTR[16+rbx] + sbb r11,QWORD PTR[24+rbx] + sbb r12,QWORD PTR[32+rbx] + sbb r13,QWORD PTR[40+rbx] + sbb r14,QWORD PTR[48+rbx] + sbb r15,QWORD PTR[56+rbx] + + + mov rsi,QWORD PTR[rax] + mov rdi,QWORD PTR[8+rax] + mov rcx,QWORD PTR[16+rax] + mov rdx,QWORD PTR[24+rax] + cmovnc rsi,r8 + cmovnc rdi,r9 + cmovnc rcx,r10 + cmovnc rdx,r11 + mov QWORD PTR[rax],rsi + mov QWORD PTR[8+rax],rdi + mov QWORD PTR[16+rax],rcx + mov QWORD PTR[24+rax],rdx + + mov rsi,QWORD PTR[32+rax] + mov rdi,QWORD PTR[40+rax] + mov rcx,QWORD PTR[48+rax] + mov rdx,QWORD PTR[56+rax] + cmovnc rsi,r12 + cmovnc rdi,r13 + cmovnc rcx,r14 + cmovnc rdx,r15 + mov QWORD PTR[32+rax],rsi + mov QWORD PTR[40+rax],rdi + mov QWORD PTR[48+rax],rcx + mov QWORD PTR[56+rax],rdx + + mov rsi,QWORD PTR[rsp] + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbx,QWORD PTR[32+rsi] + mov rbp,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_mod_exp_512:: +mod_exp_512 ENDP + +.text$ ENDS +END diff --git a/crypto/bn/mont-elf-armv4.S b/crypto/bn/mont-elf-armv4.S new file mode 100644 index 00000000..136da628 --- /dev/null +++ b/crypto/bn/mont-elf-armv4.S @@ -0,0 +1,148 @@ +.text + +.global bn_mul_mont +.type bn_mul_mont,%function + +.align 2 +bn_mul_mont: + stmdb sp!,{r0,r2} @ sp points at argument block + ldr r0,[sp,#3*4] @ load num + cmp r0,#2 + movlt r0,#0 + addlt sp,sp,#2*4 + blt .Labrt + + stmdb sp!,{r4-r12,lr} @ save 10 registers + + mov r0,r0,lsl#2 @ rescale r0 for byte count + sub sp,sp,r0 @ alloca(4*num) + sub sp,sp,#4 @ +extra dword + sub r0,r0,#4 @ "num=num-1" + add r4,r2,r0 @ &bp[num-1] + + add r0,sp,r0 @ r0 to point at &tp[num-1] + ldr r8,[r0,#14*4] @ &n0 + ldr r2,[r2] @ bp[0] + ldr r5,[r1],#4 @ ap[0],ap++ + ldr r6,[r3],#4 @ np[0],np++ + ldr r8,[r8] @ *n0 + str r4,[r0,#15*4] @ save &bp[num] + + umull r10,r11,r5,r2 @ ap[0]*bp[0] + str r8,[r0,#14*4] @ save n0 value + mul r8,r10,r8 @ "tp[0]"*n0 + mov r12,#0 + umlal r10,r12,r6,r8 @ np[0]*n0+"t[0]" + mov r4,sp + +.L1st: + ldr r5,[r1],#4 @ ap[j],ap++ + mov r10,r11 + ldr r6,[r3],#4 @ np[j],np++ + mov r11,#0 + umlal r10,r11,r5,r2 @ ap[j]*bp[0] + mov r14,#0 + umlal r12,r14,r6,r8 @ np[j]*n0 + adds r12,r12,r10 + str r12,[r4],#4 @ tp[j-1]=,tp++ + adc r12,r14,#0 + cmp r4,r0 + bne .L1st + + adds r12,r12,r11 + ldr r4,[r0,#13*4] @ restore bp + mov r14,#0 + ldr r8,[r0,#14*4] @ restore n0 + adc r14,r14,#0 + str r12,[r0] @ tp[num-1]= + str r14,[r0,#4] @ tp[num]= + +.Louter: + sub r7,r0,sp @ "original" r0-1 value + sub r1,r1,r7 @ "rewind" ap to &ap[1] + ldr r2,[r4,#4]! @ *(++bp) + sub r3,r3,r7 @ "rewind" np to &np[1] + ldr r5,[r1,#-4] @ ap[0] + ldr r10,[sp] @ tp[0] + ldr r6,[r3,#-4] @ np[0] + ldr r7,[sp,#4] @ tp[1] + + mov r11,#0 + umlal r10,r11,r5,r2 @ ap[0]*bp[i]+tp[0] + str r4,[r0,#13*4] @ save bp + mul r8,r10,r8 + mov r12,#0 + umlal r10,r12,r6,r8 @ np[0]*n0+"tp[0]" + mov r4,sp + +.Linner: + ldr r5,[r1],#4 @ ap[j],ap++ + adds r10,r11,r7 @ +=tp[j] + ldr r6,[r3],#4 @ np[j],np++ + mov r11,#0 + umlal r10,r11,r5,r2 @ ap[j]*bp[i] + mov r14,#0 + umlal r12,r14,r6,r8 @ np[j]*n0 + adc r11,r11,#0 + ldr r7,[r4,#8] @ tp[j+1] + adds r12,r12,r10 + str r12,[r4],#4 @ tp[j-1]=,tp++ + adc r12,r14,#0 + cmp r4,r0 + bne .Linner + + adds r12,r12,r11 + mov r14,#0 + ldr r4,[r0,#13*4] @ restore bp + adc r14,r14,#0 + ldr r8,[r0,#14*4] @ restore n0 + adds r12,r12,r7 + ldr r7,[r0,#15*4] @ restore &bp[num] + adc r14,r14,#0 + str r12,[r0] @ tp[num-1]= + str r14,[r0,#4] @ tp[num]= + + cmp r4,r7 + bne .Louter + + ldr r2,[r0,#12*4] @ pull rp + add r0,r0,#4 @ r0 to point at &tp[num] + sub r5,r0,sp @ "original" num value + mov r4,sp @ "rewind" r4 + mov r1,r4 @ "borrow" r1 + sub r3,r3,r5 @ "rewind" r3 to &np[0] + + subs r7,r7,r7 @ "clear" carry flag +.Lsub: ldr r7,[r4],#4 + ldr r6,[r3],#4 + sbcs r7,r7,r6 @ tp[j]-np[j] + str r7,[r2],#4 @ rp[j]= + teq r4,r0 @ preserve carry + bne .Lsub + sbcs r14,r14,#0 @ upmost carry + mov r4,sp @ "rewind" r4 + sub r2,r2,r5 @ "rewind" r2 + + and r1,r4,r14 + bic r3,r2,r14 + orr r1,r1,r3 @ ap=borrow?tp:rp + +.Lcopy: ldr r7,[r1],#4 @ copy or in-place refresh + str sp,[r4],#4 @ zap tp + str r7,[r2],#4 + cmp r4,r0 + bne .Lcopy + + add sp,r0,#4 @ skip over tp[num+1] + ldmia sp!,{r4-r12,lr} @ restore registers + add sp,sp,#2*4 @ skip over {r0,r2} + mov r0,#1 +.Labrt: tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +.size bn_mul_mont,.-bn_mul_mont +.asciz "Montgomery multiplication for ARMv4, CRYPTOGAMS by " +.align 2 +#if defined(HAVE_GNU_STACK) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/crypto/bn/mont-elf-x86_64.S b/crypto/bn/mont-elf-x86_64.S index 4f6ed108..35765456 100644 --- a/crypto/bn/mont-elf-x86_64.S +++ b/crypto/bn/mont-elf-x86_64.S @@ -206,7 +206,7 @@ bn_mul_mont: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lmul_epilogue: - .byte 0xf3,0xc3 + retq .size bn_mul_mont,.-bn_mul_mont .type bn_mul4x_mont,@function .align 16 @@ -604,7 +604,7 @@ bn_mul4x_mont: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lmul4x_epilogue: - .byte 0xf3,0xc3 + retq .size bn_mul4x_mont,.-bn_mul4x_mont .type bn_sqr4x_mont,@function .align 16 @@ -1369,7 +1369,7 @@ bn_sqr4x_mont: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lsqr4x_epilogue: - .byte 0xf3,0xc3 + retq .size bn_sqr4x_mont,.-bn_sqr4x_mont .byte 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .align 16 diff --git a/crypto/bn/mont-macosx-x86_64.S b/crypto/bn/mont-macosx-x86_64.S index 4352074d..7de69d90 100644 --- a/crypto/bn/mont-macosx-x86_64.S +++ b/crypto/bn/mont-macosx-x86_64.S @@ -206,7 +206,7 @@ L$copy: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$mul_epilogue: - .byte 0xf3,0xc3 + retq .p2align 4 @@ -604,7 +604,7 @@ L$copy4x: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$mul4x_epilogue: - .byte 0xf3,0xc3 + retq .p2align 4 @@ -1369,7 +1369,7 @@ L$sqr4x_copy: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$sqr4x_epilogue: - .byte 0xf3,0xc3 + retq .byte 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .p2align 4 diff --git a/crypto/bn/mont-masm-x86_64.S b/crypto/bn/mont-masm-x86_64.S new file mode 100644 index 00000000..aefb7509 --- /dev/null +++ b/crypto/bn/mont-masm-x86_64.S @@ -0,0 +1,1428 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + +PUBLIC bn_mul_mont + +ALIGN 16 +bn_mul_mont PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_bn_mul_mont:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + test r9d,3 + jnz $L$mul_enter + cmp r9d,8 + jb $L$mul_enter + cmp rdx,rsi + jne $L$mul4x_enter + jmp $L$sqr4x_enter + +ALIGN 16 +$L$mul_enter:: + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + + mov r9d,r9d + lea r10,QWORD PTR[2+r9] + mov r11,rsp + neg r10 + lea rsp,QWORD PTR[r10*8+rsp] + and rsp,-1024 + + mov QWORD PTR[8+r9*8+rsp],r11 +$L$mul_body:: + mov r12,rdx + mov r8,QWORD PTR[r8] + mov rbx,QWORD PTR[r12] + mov rax,QWORD PTR[rsi] + + xor r14,r14 + xor r15,r15 + + mov rbp,r8 + mul rbx + mov r10,rax + mov rax,QWORD PTR[rcx] + + imul rbp,r10 + mov r11,rdx + + mul rbp + add r10,rax + mov rax,QWORD PTR[8+rsi] + adc rdx,0 + mov r13,rdx + + lea r15,QWORD PTR[1+r15] + jmp $L$1st_enter + +ALIGN 16 +$L$1st:: + add r13,rax + mov rax,QWORD PTR[r15*8+rsi] + adc rdx,0 + add r13,r11 + mov r11,r10 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov r13,rdx + +$L$1st_enter:: + mul rbx + add r11,rax + mov rax,QWORD PTR[r15*8+rcx] + adc rdx,0 + lea r15,QWORD PTR[1+r15] + mov r10,rdx + + mul rbp + cmp r15,r9 + jl $L$1st + + add r13,rax + mov rax,QWORD PTR[rsi] + adc rdx,0 + add r13,r11 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov r13,rdx + mov r11,r10 + + xor rdx,rdx + add r13,r11 + adc rdx,0 + mov QWORD PTR[((-8))+r9*8+rsp],r13 + mov QWORD PTR[r9*8+rsp],rdx + + lea r14,QWORD PTR[1+r14] + jmp $L$outer +ALIGN 16 +$L$outer:: + mov rbx,QWORD PTR[r14*8+r12] + xor r15,r15 + mov rbp,r8 + mov r10,QWORD PTR[rsp] + mul rbx + add r10,rax + mov rax,QWORD PTR[rcx] + adc rdx,0 + + imul rbp,r10 + mov r11,rdx + + mul rbp + add r10,rax + mov rax,QWORD PTR[8+rsi] + adc rdx,0 + mov r10,QWORD PTR[8+rsp] + mov r13,rdx + + lea r15,QWORD PTR[1+r15] + jmp $L$inner_enter + +ALIGN 16 +$L$inner:: + add r13,rax + mov rax,QWORD PTR[r15*8+rsi] + adc rdx,0 + add r13,r10 + mov r10,QWORD PTR[r15*8+rsp] + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov r13,rdx + +$L$inner_enter:: + mul rbx + add r11,rax + mov rax,QWORD PTR[r15*8+rcx] + adc rdx,0 + add r10,r11 + mov r11,rdx + adc r11,0 + lea r15,QWORD PTR[1+r15] + + mul rbp + cmp r15,r9 + jl $L$inner + + add r13,rax + mov rax,QWORD PTR[rsi] + adc rdx,0 + add r13,r10 + mov r10,QWORD PTR[r15*8+rsp] + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov r13,rdx + + xor rdx,rdx + add r13,r11 + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-8))+r9*8+rsp],r13 + mov QWORD PTR[r9*8+rsp],rdx + + lea r14,QWORD PTR[1+r14] + cmp r14,r9 + jl $L$outer + + xor r14,r14 + mov rax,QWORD PTR[rsp] + lea rsi,QWORD PTR[rsp] + mov r15,r9 + jmp $L$sub +ALIGN 16 +$L$sub:: sbb rax,QWORD PTR[r14*8+rcx] + mov QWORD PTR[r14*8+rdi],rax + mov rax,QWORD PTR[8+r14*8+rsi] + lea r14,QWORD PTR[1+r14] + dec r15 + jnz $L$sub + + sbb rax,0 + xor r14,r14 + and rsi,rax + not rax + mov rcx,rdi + and rcx,rax + mov r15,r9 + or rsi,rcx +ALIGN 16 +$L$copy:: + mov rax,QWORD PTR[r14*8+rsi] + mov QWORD PTR[r14*8+rsp],r14 + mov QWORD PTR[r14*8+rdi],rax + lea r14,QWORD PTR[1+r14] + sub r15,1 + jnz $L$copy + + mov rsi,QWORD PTR[8+r9*8+rsp] + mov rax,1 + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$mul_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_bn_mul_mont:: +bn_mul_mont ENDP + +ALIGN 16 +bn_mul4x_mont PROC PRIVATE + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_bn_mul4x_mont:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + +$L$mul4x_enter:: + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + + mov r9d,r9d + lea r10,QWORD PTR[4+r9] + mov r11,rsp + neg r10 + lea rsp,QWORD PTR[r10*8+rsp] + and rsp,-1024 + + mov QWORD PTR[8+r9*8+rsp],r11 +$L$mul4x_body:: + mov QWORD PTR[16+r9*8+rsp],rdi + mov r12,rdx + mov r8,QWORD PTR[r8] + mov rbx,QWORD PTR[r12] + mov rax,QWORD PTR[rsi] + + xor r14,r14 + xor r15,r15 + + mov rbp,r8 + mul rbx + mov r10,rax + mov rax,QWORD PTR[rcx] + + imul rbp,r10 + mov r11,rdx + + mul rbp + add r10,rax + mov rax,QWORD PTR[8+rsi] + adc rdx,0 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[8+rcx] + adc rdx,0 + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[16+rsi] + adc rdx,0 + add rdi,r11 + lea r15,QWORD PTR[4+r15] + adc rdx,0 + mov QWORD PTR[rsp],rdi + mov r13,rdx + jmp $L$1st4x +ALIGN 16 +$L$1st4x:: + mul rbx + add r10,rax + mov rax,QWORD PTR[((-16))+r15*8+rcx] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[((-8))+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-24))+r15*8+rsp],r13 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[((-8))+r15*8+rcx] + adc rdx,0 + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[r15*8+rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],rdi + mov r13,rdx + + mul rbx + add r10,rax + mov rax,QWORD PTR[r15*8+rcx] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[8+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-8))+r15*8+rsp],r13 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[8+r15*8+rcx] + adc rdx,0 + lea r15,QWORD PTR[4+r15] + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[((-16))+r15*8+rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-32))+r15*8+rsp],rdi + mov r13,rdx + cmp r15,r9 + jl $L$1st4x + + mul rbx + add r10,rax + mov rax,QWORD PTR[((-16))+r15*8+rcx] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[((-8))+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-24))+r15*8+rsp],r13 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[((-8))+r15*8+rcx] + adc rdx,0 + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],rdi + mov r13,rdx + + xor rdi,rdi + add r13,r10 + adc rdi,0 + mov QWORD PTR[((-8))+r15*8+rsp],r13 + mov QWORD PTR[r15*8+rsp],rdi + + lea r14,QWORD PTR[1+r14] +ALIGN 4 +$L$outer4x:: + mov rbx,QWORD PTR[r14*8+r12] + xor r15,r15 + mov r10,QWORD PTR[rsp] + mov rbp,r8 + mul rbx + add r10,rax + mov rax,QWORD PTR[rcx] + adc rdx,0 + + imul rbp,r10 + mov r11,rdx + + mul rbp + add r10,rax + mov rax,QWORD PTR[8+rsi] + adc rdx,0 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[8+rcx] + adc rdx,0 + add r11,QWORD PTR[8+rsp] + adc rdx,0 + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[16+rsi] + adc rdx,0 + add rdi,r11 + lea r15,QWORD PTR[4+r15] + adc rdx,0 + mov QWORD PTR[rsp],rdi + mov r13,rdx + jmp $L$inner4x +ALIGN 16 +$L$inner4x:: + mul rbx + add r10,rax + mov rax,QWORD PTR[((-16))+r15*8+rcx] + adc rdx,0 + add r10,QWORD PTR[((-16))+r15*8+rsp] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[((-8))+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-24))+r15*8+rsp],r13 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[((-8))+r15*8+rcx] + adc rdx,0 + add r11,QWORD PTR[((-8))+r15*8+rsp] + adc rdx,0 + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[r15*8+rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],rdi + mov r13,rdx + + mul rbx + add r10,rax + mov rax,QWORD PTR[r15*8+rcx] + adc rdx,0 + add r10,QWORD PTR[r15*8+rsp] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[8+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-8))+r15*8+rsp],r13 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[8+r15*8+rcx] + adc rdx,0 + add r11,QWORD PTR[8+r15*8+rsp] + adc rdx,0 + lea r15,QWORD PTR[4+r15] + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[((-16))+r15*8+rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-32))+r15*8+rsp],rdi + mov r13,rdx + cmp r15,r9 + jl $L$inner4x + + mul rbx + add r10,rax + mov rax,QWORD PTR[((-16))+r15*8+rcx] + adc rdx,0 + add r10,QWORD PTR[((-16))+r15*8+rsp] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[((-8))+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-24))+r15*8+rsp],r13 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[((-8))+r15*8+rcx] + adc rdx,0 + add r11,QWORD PTR[((-8))+r15*8+rsp] + adc rdx,0 + lea r14,QWORD PTR[1+r14] + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],rdi + mov r13,rdx + + xor rdi,rdi + add r13,r10 + adc rdi,0 + add r13,QWORD PTR[r9*8+rsp] + adc rdi,0 + mov QWORD PTR[((-8))+r15*8+rsp],r13 + mov QWORD PTR[r15*8+rsp],rdi + + cmp r14,r9 + jl $L$outer4x + mov rdi,QWORD PTR[16+r9*8+rsp] + mov rax,QWORD PTR[rsp] + pxor xmm0,xmm0 + mov rdx,QWORD PTR[8+rsp] + shr r9,2 + lea rsi,QWORD PTR[rsp] + xor r14,r14 + + sub rax,QWORD PTR[rcx] + mov rbx,QWORD PTR[16+rsi] + mov rbp,QWORD PTR[24+rsi] + sbb rdx,QWORD PTR[8+rcx] + lea r15,QWORD PTR[((-1))+r9] + jmp $L$sub4x +ALIGN 16 +$L$sub4x:: + mov QWORD PTR[r14*8+rdi],rax + mov QWORD PTR[8+r14*8+rdi],rdx + sbb rbx,QWORD PTR[16+r14*8+rcx] + mov rax,QWORD PTR[32+r14*8+rsi] + mov rdx,QWORD PTR[40+r14*8+rsi] + sbb rbp,QWORD PTR[24+r14*8+rcx] + mov QWORD PTR[16+r14*8+rdi],rbx + mov QWORD PTR[24+r14*8+rdi],rbp + sbb rax,QWORD PTR[32+r14*8+rcx] + mov rbx,QWORD PTR[48+r14*8+rsi] + mov rbp,QWORD PTR[56+r14*8+rsi] + sbb rdx,QWORD PTR[40+r14*8+rcx] + lea r14,QWORD PTR[4+r14] + dec r15 + jnz $L$sub4x + + mov QWORD PTR[r14*8+rdi],rax + mov rax,QWORD PTR[32+r14*8+rsi] + sbb rbx,QWORD PTR[16+r14*8+rcx] + mov QWORD PTR[8+r14*8+rdi],rdx + sbb rbp,QWORD PTR[24+r14*8+rcx] + mov QWORD PTR[16+r14*8+rdi],rbx + + sbb rax,0 + mov QWORD PTR[24+r14*8+rdi],rbp + xor r14,r14 + and rsi,rax + not rax + mov rcx,rdi + and rcx,rax + lea r15,QWORD PTR[((-1))+r9] + or rsi,rcx + + movdqu xmm1,XMMWORD PTR[rsi] + movdqa XMMWORD PTR[rsp],xmm0 + movdqu XMMWORD PTR[rdi],xmm1 + jmp $L$copy4x +ALIGN 16 +$L$copy4x:: + movdqu xmm2,XMMWORD PTR[16+r14*1+rsi] + movdqu xmm1,XMMWORD PTR[32+r14*1+rsi] + movdqa XMMWORD PTR[16+r14*1+rsp],xmm0 + movdqu XMMWORD PTR[16+r14*1+rdi],xmm2 + movdqa XMMWORD PTR[32+r14*1+rsp],xmm0 + movdqu XMMWORD PTR[32+r14*1+rdi],xmm1 + lea r14,QWORD PTR[32+r14] + dec r15 + jnz $L$copy4x + + shl r9,2 + movdqu xmm2,XMMWORD PTR[16+r14*1+rsi] + movdqa XMMWORD PTR[16+r14*1+rsp],xmm0 + movdqu XMMWORD PTR[16+r14*1+rdi],xmm2 + mov rsi,QWORD PTR[8+r9*8+rsp] + mov rax,1 + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$mul4x_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_bn_mul4x_mont:: +bn_mul4x_mont ENDP + +ALIGN 16 +bn_sqr4x_mont PROC PRIVATE + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_bn_sqr4x_mont:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + +$L$sqr4x_enter:: + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + + shl r9d,3 + xor r10,r10 + mov r11,rsp + sub r10,r9 + mov r8,QWORD PTR[r8] + lea rsp,QWORD PTR[((-72))+r10*2+rsp] + and rsp,-1024 + + + + + + + + + + + + mov QWORD PTR[32+rsp],rdi + mov QWORD PTR[40+rsp],rcx + mov QWORD PTR[48+rsp],r8 + mov QWORD PTR[56+rsp],r11 +$L$sqr4x_body:: + + + + + + + + lea rbp,QWORD PTR[32+r10] + lea rsi,QWORD PTR[r9*1+rsi] + + mov rcx,r9 + + + mov r14,QWORD PTR[((-32))+rbp*1+rsi] + lea rdi,QWORD PTR[64+r9*2+rsp] + mov rax,QWORD PTR[((-24))+rbp*1+rsi] + lea rdi,QWORD PTR[((-32))+rbp*1+rdi] + mov rbx,QWORD PTR[((-16))+rbp*1+rsi] + mov r15,rax + + mul r14 + mov r10,rax + mov rax,rbx + mov r11,rdx + mov QWORD PTR[((-24))+rbp*1+rdi],r10 + + xor r10,r10 + mul r14 + add r11,rax + mov rax,rbx + adc r10,rdx + mov QWORD PTR[((-16))+rbp*1+rdi],r11 + + lea rcx,QWORD PTR[((-16))+rbp] + + + mov rbx,QWORD PTR[8+rcx*1+rsi] + mul r15 + mov r12,rax + mov rax,rbx + mov r13,rdx + + xor r11,r11 + add r10,r12 + lea rcx,QWORD PTR[16+rcx] + adc r11,0 + mul r14 + add r10,rax + mov rax,rbx + adc r11,rdx + mov QWORD PTR[((-8))+rcx*1+rdi],r10 + jmp $L$sqr4x_1st + +ALIGN 16 +$L$sqr4x_1st:: + mov rbx,QWORD PTR[rcx*1+rsi] + xor r12,r12 + mul r15 + add r13,rax + mov rax,rbx + adc r12,rdx + + xor r10,r10 + add r11,r13 + adc r10,0 + mul r14 + add r11,rax + mov rax,rbx + adc r10,rdx + mov QWORD PTR[rcx*1+rdi],r11 + + + mov rbx,QWORD PTR[8+rcx*1+rsi] + xor r13,r13 + mul r15 + add r12,rax + mov rax,rbx + adc r13,rdx + + xor r11,r11 + add r10,r12 + adc r11,0 + mul r14 + add r10,rax + mov rax,rbx + adc r11,rdx + mov QWORD PTR[8+rcx*1+rdi],r10 + + mov rbx,QWORD PTR[16+rcx*1+rsi] + xor r12,r12 + mul r15 + add r13,rax + mov rax,rbx + adc r12,rdx + + xor r10,r10 + add r11,r13 + adc r10,0 + mul r14 + add r11,rax + mov rax,rbx + adc r10,rdx + mov QWORD PTR[16+rcx*1+rdi],r11 + + + mov rbx,QWORD PTR[24+rcx*1+rsi] + xor r13,r13 + mul r15 + add r12,rax + mov rax,rbx + adc r13,rdx + + xor r11,r11 + add r10,r12 + lea rcx,QWORD PTR[32+rcx] + adc r11,0 + mul r14 + add r10,rax + mov rax,rbx + adc r11,rdx + mov QWORD PTR[((-8))+rcx*1+rdi],r10 + + cmp rcx,0 + jne $L$sqr4x_1st + + xor r12,r12 + add r13,r11 + adc r12,0 + mul r15 + add r13,rax + adc r12,rdx + + mov QWORD PTR[rdi],r13 + lea rbp,QWORD PTR[16+rbp] + mov QWORD PTR[8+rdi],r12 + jmp $L$sqr4x_outer + +ALIGN 16 +$L$sqr4x_outer:: + mov r14,QWORD PTR[((-32))+rbp*1+rsi] + lea rdi,QWORD PTR[64+r9*2+rsp] + mov rax,QWORD PTR[((-24))+rbp*1+rsi] + lea rdi,QWORD PTR[((-32))+rbp*1+rdi] + mov rbx,QWORD PTR[((-16))+rbp*1+rsi] + mov r15,rax + + mov r10,QWORD PTR[((-24))+rbp*1+rdi] + xor r11,r11 + mul r14 + add r10,rax + mov rax,rbx + adc r11,rdx + mov QWORD PTR[((-24))+rbp*1+rdi],r10 + + xor r10,r10 + add r11,QWORD PTR[((-16))+rbp*1+rdi] + adc r10,0 + mul r14 + add r11,rax + mov rax,rbx + adc r10,rdx + mov QWORD PTR[((-16))+rbp*1+rdi],r11 + + lea rcx,QWORD PTR[((-16))+rbp] + xor r12,r12 + + + mov rbx,QWORD PTR[8+rcx*1+rsi] + xor r13,r13 + add r12,QWORD PTR[8+rcx*1+rdi] + adc r13,0 + mul r15 + add r12,rax + mov rax,rbx + adc r13,rdx + + xor r11,r11 + add r10,r12 + adc r11,0 + mul r14 + add r10,rax + mov rax,rbx + adc r11,rdx + mov QWORD PTR[8+rcx*1+rdi],r10 + + lea rcx,QWORD PTR[16+rcx] + jmp $L$sqr4x_inner + +ALIGN 16 +$L$sqr4x_inner:: + mov rbx,QWORD PTR[rcx*1+rsi] + xor r12,r12 + add r13,QWORD PTR[rcx*1+rdi] + adc r12,0 + mul r15 + add r13,rax + mov rax,rbx + adc r12,rdx + + xor r10,r10 + add r11,r13 + adc r10,0 + mul r14 + add r11,rax + mov rax,rbx + adc r10,rdx + mov QWORD PTR[rcx*1+rdi],r11 + + mov rbx,QWORD PTR[8+rcx*1+rsi] + xor r13,r13 + add r12,QWORD PTR[8+rcx*1+rdi] + adc r13,0 + mul r15 + add r12,rax + mov rax,rbx + adc r13,rdx + + xor r11,r11 + add r10,r12 + lea rcx,QWORD PTR[16+rcx] + adc r11,0 + mul r14 + add r10,rax + mov rax,rbx + adc r11,rdx + mov QWORD PTR[((-8))+rcx*1+rdi],r10 + + cmp rcx,0 + jne $L$sqr4x_inner + + xor r12,r12 + add r13,r11 + adc r12,0 + mul r15 + add r13,rax + adc r12,rdx + + mov QWORD PTR[rdi],r13 + mov QWORD PTR[8+rdi],r12 + + add rbp,16 + jnz $L$sqr4x_outer + + + mov r14,QWORD PTR[((-32))+rsi] + lea rdi,QWORD PTR[64+r9*2+rsp] + mov rax,QWORD PTR[((-24))+rsi] + lea rdi,QWORD PTR[((-32))+rbp*1+rdi] + mov rbx,QWORD PTR[((-16))+rsi] + mov r15,rax + + xor r11,r11 + mul r14 + add r10,rax + mov rax,rbx + adc r11,rdx + mov QWORD PTR[((-24))+rdi],r10 + + xor r10,r10 + add r11,r13 + adc r10,0 + mul r14 + add r11,rax + mov rax,rbx + adc r10,rdx + mov QWORD PTR[((-16))+rdi],r11 + + mov rbx,QWORD PTR[((-8))+rsi] + mul r15 + add r12,rax + mov rax,rbx + adc rdx,0 + + xor r11,r11 + add r10,r12 + mov r13,rdx + adc r11,0 + mul r14 + add r10,rax + mov rax,rbx + adc r11,rdx + mov QWORD PTR[((-8))+rdi],r10 + + xor r12,r12 + add r13,r11 + adc r12,0 + mul r15 + add r13,rax + mov rax,QWORD PTR[((-16))+rsi] + adc r12,rdx + + mov QWORD PTR[rdi],r13 + mov QWORD PTR[8+rdi],r12 + + mul rbx + add rbp,16 + xor r14,r14 + sub rbp,r9 + xor r15,r15 + + add rax,r12 + adc rdx,0 + mov QWORD PTR[8+rdi],rax + mov QWORD PTR[16+rdi],rdx + mov QWORD PTR[24+rdi],r15 + + mov rax,QWORD PTR[((-16))+rbp*1+rsi] + lea rdi,QWORD PTR[64+r9*2+rsp] + xor r10,r10 + mov r11,QWORD PTR[((-24))+rbp*2+rdi] + + lea r12,QWORD PTR[r10*2+r14] + shr r10,63 + lea r13,QWORD PTR[r11*2+rcx] + shr r11,63 + or r13,r10 + mov r10,QWORD PTR[((-16))+rbp*2+rdi] + mov r14,r11 + mul rax + neg r15 + mov r11,QWORD PTR[((-8))+rbp*2+rdi] + adc r12,rax + mov rax,QWORD PTR[((-8))+rbp*1+rsi] + mov QWORD PTR[((-32))+rbp*2+rdi],r12 + adc r13,rdx + + lea rbx,QWORD PTR[r10*2+r14] + mov QWORD PTR[((-24))+rbp*2+rdi],r13 + sbb r15,r15 + shr r10,63 + lea r8,QWORD PTR[r11*2+rcx] + shr r11,63 + or r8,r10 + mov r10,QWORD PTR[rbp*2+rdi] + mov r14,r11 + mul rax + neg r15 + mov r11,QWORD PTR[8+rbp*2+rdi] + adc rbx,rax + mov rax,QWORD PTR[rbp*1+rsi] + mov QWORD PTR[((-16))+rbp*2+rdi],rbx + adc r8,rdx + lea rbp,QWORD PTR[16+rbp] + mov QWORD PTR[((-40))+rbp*2+rdi],r8 + sbb r15,r15 + jmp $L$sqr4x_shift_n_add + +ALIGN 16 +$L$sqr4x_shift_n_add:: + lea r12,QWORD PTR[r10*2+r14] + shr r10,63 + lea r13,QWORD PTR[r11*2+rcx] + shr r11,63 + or r13,r10 + mov r10,QWORD PTR[((-16))+rbp*2+rdi] + mov r14,r11 + mul rax + neg r15 + mov r11,QWORD PTR[((-8))+rbp*2+rdi] + adc r12,rax + mov rax,QWORD PTR[((-8))+rbp*1+rsi] + mov QWORD PTR[((-32))+rbp*2+rdi],r12 + adc r13,rdx + + lea rbx,QWORD PTR[r10*2+r14] + mov QWORD PTR[((-24))+rbp*2+rdi],r13 + sbb r15,r15 + shr r10,63 + lea r8,QWORD PTR[r11*2+rcx] + shr r11,63 + or r8,r10 + mov r10,QWORD PTR[rbp*2+rdi] + mov r14,r11 + mul rax + neg r15 + mov r11,QWORD PTR[8+rbp*2+rdi] + adc rbx,rax + mov rax,QWORD PTR[rbp*1+rsi] + mov QWORD PTR[((-16))+rbp*2+rdi],rbx + adc r8,rdx + + lea r12,QWORD PTR[r10*2+r14] + mov QWORD PTR[((-8))+rbp*2+rdi],r8 + sbb r15,r15 + shr r10,63 + lea r13,QWORD PTR[r11*2+rcx] + shr r11,63 + or r13,r10 + mov r10,QWORD PTR[16+rbp*2+rdi] + mov r14,r11 + mul rax + neg r15 + mov r11,QWORD PTR[24+rbp*2+rdi] + adc r12,rax + mov rax,QWORD PTR[8+rbp*1+rsi] + mov QWORD PTR[rbp*2+rdi],r12 + adc r13,rdx + + lea rbx,QWORD PTR[r10*2+r14] + mov QWORD PTR[8+rbp*2+rdi],r13 + sbb r15,r15 + shr r10,63 + lea r8,QWORD PTR[r11*2+rcx] + shr r11,63 + or r8,r10 + mov r10,QWORD PTR[32+rbp*2+rdi] + mov r14,r11 + mul rax + neg r15 + mov r11,QWORD PTR[40+rbp*2+rdi] + adc rbx,rax + mov rax,QWORD PTR[16+rbp*1+rsi] + mov QWORD PTR[16+rbp*2+rdi],rbx + adc r8,rdx + mov QWORD PTR[24+rbp*2+rdi],r8 + sbb r15,r15 + add rbp,32 + jnz $L$sqr4x_shift_n_add + + lea r12,QWORD PTR[r10*2+r14] + shr r10,63 + lea r13,QWORD PTR[r11*2+rcx] + shr r11,63 + or r13,r10 + mov r10,QWORD PTR[((-16))+rdi] + mov r14,r11 + mul rax + neg r15 + mov r11,QWORD PTR[((-8))+rdi] + adc r12,rax + mov rax,QWORD PTR[((-8))+rsi] + mov QWORD PTR[((-32))+rdi],r12 + adc r13,rdx + + lea rbx,QWORD PTR[r10*2+r14] + mov QWORD PTR[((-24))+rdi],r13 + sbb r15,r15 + shr r10,63 + lea r8,QWORD PTR[r11*2+rcx] + shr r11,63 + or r8,r10 + mul rax + neg r15 + adc rbx,rax + adc r8,rdx + mov QWORD PTR[((-16))+rdi],rbx + mov QWORD PTR[((-8))+rdi],r8 + mov rsi,QWORD PTR[40+rsp] + mov r8,QWORD PTR[48+rsp] + xor rcx,rcx + mov QWORD PTR[rsp],r9 + sub rcx,r9 + mov r10,QWORD PTR[64+rsp] + mov r14,r8 + lea rax,QWORD PTR[64+r9*2+rsp] + lea rdi,QWORD PTR[64+r9*1+rsp] + mov QWORD PTR[8+rsp],rax + lea rsi,QWORD PTR[r9*1+rsi] + xor rbp,rbp + + mov rax,QWORD PTR[rcx*1+rsi] + mov r9,QWORD PTR[8+rcx*1+rsi] + imul r14,r10 + mov rbx,rax + jmp $L$sqr4x_mont_outer + +ALIGN 16 +$L$sqr4x_mont_outer:: + xor r11,r11 + mul r14 + add r10,rax + mov rax,r9 + adc r11,rdx + mov r15,r8 + + xor r10,r10 + add r11,QWORD PTR[8+rcx*1+rdi] + adc r10,0 + mul r14 + add r11,rax + mov rax,rbx + adc r10,rdx + + imul r15,r11 + + mov rbx,QWORD PTR[16+rcx*1+rsi] + xor r13,r13 + add r12,r11 + adc r13,0 + mul r15 + add r12,rax + mov rax,rbx + adc r13,rdx + mov QWORD PTR[8+rcx*1+rdi],r12 + + xor r11,r11 + add r10,QWORD PTR[16+rcx*1+rdi] + adc r11,0 + mul r14 + add r10,rax + mov rax,r9 + adc r11,rdx + + mov r9,QWORD PTR[24+rcx*1+rsi] + xor r12,r12 + add r13,r10 + adc r12,0 + mul r15 + add r13,rax + mov rax,r9 + adc r12,rdx + mov QWORD PTR[16+rcx*1+rdi],r13 + + xor r10,r10 + add r11,QWORD PTR[24+rcx*1+rdi] + lea rcx,QWORD PTR[32+rcx] + adc r10,0 + mul r14 + add r11,rax + mov rax,rbx + adc r10,rdx + jmp $L$sqr4x_mont_inner + +ALIGN 16 +$L$sqr4x_mont_inner:: + mov rbx,QWORD PTR[rcx*1+rsi] + xor r13,r13 + add r12,r11 + adc r13,0 + mul r15 + add r12,rax + mov rax,rbx + adc r13,rdx + mov QWORD PTR[((-8))+rcx*1+rdi],r12 + + xor r11,r11 + add r10,QWORD PTR[rcx*1+rdi] + adc r11,0 + mul r14 + add r10,rax + mov rax,r9 + adc r11,rdx + + mov r9,QWORD PTR[8+rcx*1+rsi] + xor r12,r12 + add r13,r10 + adc r12,0 + mul r15 + add r13,rax + mov rax,r9 + adc r12,rdx + mov QWORD PTR[rcx*1+rdi],r13 + + xor r10,r10 + add r11,QWORD PTR[8+rcx*1+rdi] + adc r10,0 + mul r14 + add r11,rax + mov rax,rbx + adc r10,rdx + + + mov rbx,QWORD PTR[16+rcx*1+rsi] + xor r13,r13 + add r12,r11 + adc r13,0 + mul r15 + add r12,rax + mov rax,rbx + adc r13,rdx + mov QWORD PTR[8+rcx*1+rdi],r12 + + xor r11,r11 + add r10,QWORD PTR[16+rcx*1+rdi] + adc r11,0 + mul r14 + add r10,rax + mov rax,r9 + adc r11,rdx + + mov r9,QWORD PTR[24+rcx*1+rsi] + xor r12,r12 + add r13,r10 + adc r12,0 + mul r15 + add r13,rax + mov rax,r9 + adc r12,rdx + mov QWORD PTR[16+rcx*1+rdi],r13 + + xor r10,r10 + add r11,QWORD PTR[24+rcx*1+rdi] + lea rcx,QWORD PTR[32+rcx] + adc r10,0 + mul r14 + add r11,rax + mov rax,rbx + adc r10,rdx + cmp rcx,0 + jne $L$sqr4x_mont_inner + + sub rcx,QWORD PTR[rsp] + mov r14,r8 + + xor r13,r13 + add r12,r11 + adc r13,0 + mul r15 + add r12,rax + mov rax,r9 + adc r13,rdx + mov QWORD PTR[((-8))+rdi],r12 + + xor r11,r11 + add r10,QWORD PTR[rdi] + adc r11,0 + mov rbx,QWORD PTR[rcx*1+rsi] + add r10,rbp + adc r11,0 + + imul r14,QWORD PTR[16+rcx*1+rdi] + xor r12,r12 + mov r9,QWORD PTR[8+rcx*1+rsi] + add r13,r10 + mov r10,QWORD PTR[16+rcx*1+rdi] + adc r12,0 + mul r15 + add r13,rax + mov rax,rbx + adc r12,rdx + mov QWORD PTR[rdi],r13 + + xor rbp,rbp + add r12,QWORD PTR[8+rdi] + adc rbp,rbp + add r12,r11 + lea rdi,QWORD PTR[16+rdi] + adc rbp,0 + mov QWORD PTR[((-8))+rdi],r12 + cmp rdi,QWORD PTR[8+rsp] + jb $L$sqr4x_mont_outer + + mov r9,QWORD PTR[rsp] + mov QWORD PTR[rdi],rbp + mov rax,QWORD PTR[64+r9*1+rsp] + lea rbx,QWORD PTR[64+r9*1+rsp] + mov rsi,QWORD PTR[40+rsp] + shr r9,5 + mov rdx,QWORD PTR[8+rbx] + xor rbp,rbp + + mov rdi,QWORD PTR[32+rsp] + sub rax,QWORD PTR[rsi] + mov r10,QWORD PTR[16+rbx] + mov r11,QWORD PTR[24+rbx] + sbb rdx,QWORD PTR[8+rsi] + lea rcx,QWORD PTR[((-1))+r9] + jmp $L$sqr4x_sub +ALIGN 16 +$L$sqr4x_sub:: + mov QWORD PTR[rbp*8+rdi],rax + mov QWORD PTR[8+rbp*8+rdi],rdx + sbb r10,QWORD PTR[16+rbp*8+rsi] + mov rax,QWORD PTR[32+rbp*8+rbx] + mov rdx,QWORD PTR[40+rbp*8+rbx] + sbb r11,QWORD PTR[24+rbp*8+rsi] + mov QWORD PTR[16+rbp*8+rdi],r10 + mov QWORD PTR[24+rbp*8+rdi],r11 + sbb rax,QWORD PTR[32+rbp*8+rsi] + mov r10,QWORD PTR[48+rbp*8+rbx] + mov r11,QWORD PTR[56+rbp*8+rbx] + sbb rdx,QWORD PTR[40+rbp*8+rsi] + lea rbp,QWORD PTR[4+rbp] + dec rcx + jnz $L$sqr4x_sub + + mov QWORD PTR[rbp*8+rdi],rax + mov rax,QWORD PTR[32+rbp*8+rbx] + sbb r10,QWORD PTR[16+rbp*8+rsi] + mov QWORD PTR[8+rbp*8+rdi],rdx + sbb r11,QWORD PTR[24+rbp*8+rsi] + mov QWORD PTR[16+rbp*8+rdi],r10 + + sbb rax,0 + mov QWORD PTR[24+rbp*8+rdi],r11 + xor rbp,rbp + and rbx,rax + not rax + mov rsi,rdi + and rsi,rax + lea rcx,QWORD PTR[((-1))+r9] + or rbx,rsi + + pxor xmm0,xmm0 + lea rsi,QWORD PTR[64+r9*8+rsp] + movdqu xmm1,XMMWORD PTR[rbx] + lea rsi,QWORD PTR[r9*8+rsi] + movdqa XMMWORD PTR[64+rsp],xmm0 + movdqa XMMWORD PTR[rsi],xmm0 + movdqu XMMWORD PTR[rdi],xmm1 + jmp $L$sqr4x_copy +ALIGN 16 +$L$sqr4x_copy:: + movdqu xmm2,XMMWORD PTR[16+rbp*1+rbx] + movdqu xmm1,XMMWORD PTR[32+rbp*1+rbx] + movdqa XMMWORD PTR[80+rbp*1+rsp],xmm0 + movdqa XMMWORD PTR[96+rbp*1+rsp],xmm0 + movdqa XMMWORD PTR[16+rbp*1+rsi],xmm0 + movdqa XMMWORD PTR[32+rbp*1+rsi],xmm0 + movdqu XMMWORD PTR[16+rbp*1+rdi],xmm2 + movdqu XMMWORD PTR[32+rbp*1+rdi],xmm1 + lea rbp,QWORD PTR[32+rbp] + dec rcx + jnz $L$sqr4x_copy + + movdqu xmm2,XMMWORD PTR[16+rbp*1+rbx] + movdqa XMMWORD PTR[80+rbp*1+rsp],xmm0 + movdqa XMMWORD PTR[16+rbp*1+rsi],xmm0 + movdqu XMMWORD PTR[16+rbp*1+rdi],xmm2 + mov rsi,QWORD PTR[56+rsp] + mov rax,1 + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$sqr4x_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_bn_sqr4x_mont:: +bn_sqr4x_mont ENDP +DB 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105 +DB 112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56 +DB 54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83 +DB 32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115 +DB 115,108,46,111,114,103,62,0 +ALIGN 16 + +.text$ ENDS +END diff --git a/crypto/bn/mont5-elf-x86_64.S b/crypto/bn/mont5-elf-x86_64.S index 5b7338e3..48cc771e 100644 --- a/crypto/bn/mont5-elf-x86_64.S +++ b/crypto/bn/mont5-elf-x86_64.S @@ -395,7 +395,7 @@ bn_mul_mont_gather5: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lmul_epilogue: - .byte 0xf3,0xc3 + retq .size bn_mul_mont_gather5,.-bn_mul_mont_gather5 .type bn_mul4x_mont_gather5,@function .align 16 @@ -984,7 +984,7 @@ bn_mul4x_mont_gather5: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lmul4x_epilogue: - .byte 0xf3,0xc3 + retq .size bn_mul4x_mont_gather5,.-bn_mul4x_mont_gather5 .globl bn_scatter5 .type bn_scatter5,@function @@ -1001,7 +1001,7 @@ bn_scatter5: subq $1,%rsi jnz .Lscatter .Lscatter_epilogue: - .byte 0xf3,0xc3 + retq .size bn_scatter5,.-bn_scatter5 .globl bn_gather5 @@ -1164,7 +1164,7 @@ bn_gather5: jnz .Lgather leaq (%r10),%rsp - .byte 0xf3,0xc3 + retq .LSEH_end_bn_gather5: .size bn_gather5,.-bn_gather5 .align 64 diff --git a/crypto/bn/mont5-macosx-x86_64.S b/crypto/bn/mont5-macosx-x86_64.S index 2da6520f..039229fd 100644 --- a/crypto/bn/mont5-macosx-x86_64.S +++ b/crypto/bn/mont5-macosx-x86_64.S @@ -395,7 +395,7 @@ L$copy: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$mul_epilogue: - .byte 0xf3,0xc3 + retq .p2align 4 @@ -984,7 +984,7 @@ L$copy4x: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$mul4x_epilogue: - .byte 0xf3,0xc3 + retq .globl _bn_scatter5 @@ -1001,7 +1001,7 @@ L$scatter: subq $1,%rsi jnz L$scatter L$scatter_epilogue: - .byte 0xf3,0xc3 + retq .globl _bn_gather5 @@ -1164,7 +1164,7 @@ L$gather: jnz L$gather leaq (%r10),%rsp - .byte 0xf3,0xc3 + retq L$SEH_end_bn_gather5: .p2align 6 diff --git a/crypto/bn/mont5-masm-x86_64.S b/crypto/bn/mont5-masm-x86_64.S new file mode 100644 index 00000000..367cb60a --- /dev/null +++ b/crypto/bn/mont5-masm-x86_64.S @@ -0,0 +1,1344 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + +PUBLIC bn_mul_mont_gather5 + +ALIGN 64 +bn_mul_mont_gather5 PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_bn_mul_mont_gather5:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + test r9d,3 + jnz $L$mul_enter + cmp r9d,8 + jb $L$mul_enter + jmp $L$mul4x_enter + +ALIGN 16 +$L$mul_enter:: + mov r9d,r9d + movd xmm5,DWORD PTR[56+rsp] + lea r10,QWORD PTR[$L$inc] + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + +$L$mul_alloca:: + mov rax,rsp + lea r11,QWORD PTR[2+r9] + neg r11 + lea rsp,QWORD PTR[((-264))+r11*8+rsp] + and rsp,-1024 + + mov QWORD PTR[8+r9*8+rsp],rax +$L$mul_body:: + lea r12,QWORD PTR[128+rdx] + movdqa xmm0,XMMWORD PTR[r10] + movdqa xmm1,XMMWORD PTR[16+r10] + lea r10,QWORD PTR[((24-112))+r9*8+rsp] + and r10,-16 + + pshufd xmm5,xmm5,0 + movdqa xmm4,xmm1 + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 +DB 067h + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[112+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[128+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[144+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[160+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[176+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[192+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[208+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[224+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[240+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[256+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[272+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[288+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[304+r10],xmm0 + + paddd xmm3,xmm2 +DB 067h + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[320+r10],xmm1 + + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[336+r10],xmm2 + pand xmm0,XMMWORD PTR[64+r12] + + pand xmm1,XMMWORD PTR[80+r12] + pand xmm2,XMMWORD PTR[96+r12] + movdqa XMMWORD PTR[352+r10],xmm3 + pand xmm3,XMMWORD PTR[112+r12] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-128))+r12] + movdqa xmm5,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + pand xmm4,XMMWORD PTR[112+r10] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm5,XMMWORD PTR[128+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[144+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[160+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-64))+r12] + movdqa xmm5,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + pand xmm4,XMMWORD PTR[176+r10] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm5,XMMWORD PTR[192+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[208+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[224+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[r12] + movdqa xmm5,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + pand xmm4,XMMWORD PTR[240+r10] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm5,XMMWORD PTR[256+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[272+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[288+r10] + por xmm0,xmm2 + por xmm1,xmm3 + por xmm0,xmm1 + pshufd xmm1,xmm0,04eh + por xmm0,xmm1 + lea r12,QWORD PTR[256+r12] + movd rbx,xmm0 + + mov r8,QWORD PTR[r8] + mov rax,QWORD PTR[rsi] + + xor r14,r14 + xor r15,r15 + + mov rbp,r8 + mul rbx + mov r10,rax + mov rax,QWORD PTR[rcx] + + imul rbp,r10 + mov r11,rdx + + mul rbp + add r10,rax + mov rax,QWORD PTR[8+rsi] + adc rdx,0 + mov r13,rdx + + lea r15,QWORD PTR[1+r15] + jmp $L$1st_enter + +ALIGN 16 +$L$1st:: + add r13,rax + mov rax,QWORD PTR[r15*8+rsi] + adc rdx,0 + add r13,r11 + mov r11,r10 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov r13,rdx + +$L$1st_enter:: + mul rbx + add r11,rax + mov rax,QWORD PTR[r15*8+rcx] + adc rdx,0 + lea r15,QWORD PTR[1+r15] + mov r10,rdx + + mul rbp + cmp r15,r9 + jl $L$1st + + add r13,rax + mov rax,QWORD PTR[rsi] + adc rdx,0 + add r13,r11 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov r13,rdx + mov r11,r10 + + xor rdx,rdx + add r13,r11 + adc rdx,0 + mov QWORD PTR[((-8))+r9*8+rsp],r13 + mov QWORD PTR[r9*8+rsp],rdx + + lea r14,QWORD PTR[1+r14] + jmp $L$outer +ALIGN 16 +$L$outer:: + lea rdx,QWORD PTR[((24+128))+r9*8+rsp] + and rdx,-16 + pxor xmm4,xmm4 + pxor xmm5,xmm5 + movdqa xmm0,XMMWORD PTR[((-128))+r12] + movdqa xmm1,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm0,XMMWORD PTR[((-128))+rdx] + pand xmm1,XMMWORD PTR[((-112))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-96))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-80))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[((-64))+r12] + movdqa xmm1,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm0,XMMWORD PTR[((-64))+rdx] + pand xmm1,XMMWORD PTR[((-48))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-32))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-16))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[r12] + movdqa xmm1,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm0,XMMWORD PTR[rdx] + pand xmm1,XMMWORD PTR[16+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[32+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[48+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[64+r12] + movdqa xmm1,XMMWORD PTR[80+r12] + movdqa xmm2,XMMWORD PTR[96+r12] + movdqa xmm3,XMMWORD PTR[112+r12] + pand xmm0,XMMWORD PTR[64+rdx] + pand xmm1,XMMWORD PTR[80+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[96+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[112+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + por xmm4,xmm5 + pshufd xmm0,xmm4,04eh + por xmm0,xmm4 + lea r12,QWORD PTR[256+r12] + movd rbx,xmm0 + + xor r15,r15 + mov rbp,r8 + mov r10,QWORD PTR[rsp] + + mul rbx + add r10,rax + mov rax,QWORD PTR[rcx] + adc rdx,0 + + imul rbp,r10 + mov r11,rdx + + mul rbp + add r10,rax + mov rax,QWORD PTR[8+rsi] + adc rdx,0 + mov r10,QWORD PTR[8+rsp] + mov r13,rdx + + lea r15,QWORD PTR[1+r15] + jmp $L$inner_enter + +ALIGN 16 +$L$inner:: + add r13,rax + mov rax,QWORD PTR[r15*8+rsi] + adc rdx,0 + add r13,r10 + mov r10,QWORD PTR[r15*8+rsp] + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov r13,rdx + +$L$inner_enter:: + mul rbx + add r11,rax + mov rax,QWORD PTR[r15*8+rcx] + adc rdx,0 + add r10,r11 + mov r11,rdx + adc r11,0 + lea r15,QWORD PTR[1+r15] + + mul rbp + cmp r15,r9 + jl $L$inner + + add r13,rax + mov rax,QWORD PTR[rsi] + adc rdx,0 + add r13,r10 + mov r10,QWORD PTR[r15*8+rsp] + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov r13,rdx + + xor rdx,rdx + add r13,r11 + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-8))+r9*8+rsp],r13 + mov QWORD PTR[r9*8+rsp],rdx + + lea r14,QWORD PTR[1+r14] + cmp r14,r9 + jl $L$outer + + xor r14,r14 + mov rax,QWORD PTR[rsp] + lea rsi,QWORD PTR[rsp] + mov r15,r9 + jmp $L$sub +ALIGN 16 +$L$sub:: sbb rax,QWORD PTR[r14*8+rcx] + mov QWORD PTR[r14*8+rdi],rax + mov rax,QWORD PTR[8+r14*8+rsi] + lea r14,QWORD PTR[1+r14] + dec r15 + jnz $L$sub + + sbb rax,0 + xor r14,r14 + and rsi,rax + not rax + mov rcx,rdi + and rcx,rax + mov r15,r9 + or rsi,rcx +ALIGN 16 +$L$copy:: + mov rax,QWORD PTR[r14*8+rsi] + mov QWORD PTR[r14*8+rsp],r14 + mov QWORD PTR[r14*8+rdi],rax + lea r14,QWORD PTR[1+r14] + sub r15,1 + jnz $L$copy + + mov rsi,QWORD PTR[8+r9*8+rsp] + mov rax,1 + + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$mul_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_bn_mul_mont_gather5:: +bn_mul_mont_gather5 ENDP + +ALIGN 16 +bn_mul4x_mont_gather5 PROC PRIVATE + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_bn_mul4x_mont_gather5:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + +$L$mul4x_enter:: + mov r9d,r9d + movd xmm5,DWORD PTR[56+rsp] + lea r10,QWORD PTR[$L$inc] + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + +$L$mul4x_alloca:: + mov rax,rsp + lea r11,QWORD PTR[4+r9] + neg r11 + lea rsp,QWORD PTR[((-256))+r11*8+rsp] + and rsp,-1024 + + mov QWORD PTR[8+r9*8+rsp],rax +$L$mul4x_body:: + mov QWORD PTR[16+r9*8+rsp],rdi + lea r12,QWORD PTR[128+rdx] + movdqa xmm0,XMMWORD PTR[r10] + movdqa xmm1,XMMWORD PTR[16+r10] + lea r10,QWORD PTR[((32-112))+r9*8+rsp] + + pshufd xmm5,xmm5,0 + movdqa xmm4,xmm1 +DB 067h,067h + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 +DB 067h + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[112+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[128+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[144+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[160+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[176+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[192+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[208+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[224+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[240+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[256+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[272+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[288+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[304+r10],xmm0 + + paddd xmm3,xmm2 +DB 067h + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[320+r10],xmm1 + + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[336+r10],xmm2 + pand xmm0,XMMWORD PTR[64+r12] + + pand xmm1,XMMWORD PTR[80+r12] + pand xmm2,XMMWORD PTR[96+r12] + movdqa XMMWORD PTR[352+r10],xmm3 + pand xmm3,XMMWORD PTR[112+r12] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-128))+r12] + movdqa xmm5,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + pand xmm4,XMMWORD PTR[112+r10] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm5,XMMWORD PTR[128+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[144+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[160+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-64))+r12] + movdqa xmm5,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + pand xmm4,XMMWORD PTR[176+r10] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm5,XMMWORD PTR[192+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[208+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[224+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[r12] + movdqa xmm5,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + pand xmm4,XMMWORD PTR[240+r10] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm5,XMMWORD PTR[256+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[272+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[288+r10] + por xmm0,xmm2 + por xmm1,xmm3 + por xmm0,xmm1 + pshufd xmm1,xmm0,04eh + por xmm0,xmm1 + lea r12,QWORD PTR[256+r12] + movd rbx,xmm0 + + mov r8,QWORD PTR[r8] + mov rax,QWORD PTR[rsi] + + xor r14,r14 + xor r15,r15 + + mov rbp,r8 + mul rbx + mov r10,rax + mov rax,QWORD PTR[rcx] + + imul rbp,r10 + mov r11,rdx + + mul rbp + add r10,rax + mov rax,QWORD PTR[8+rsi] + adc rdx,0 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[8+rcx] + adc rdx,0 + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[16+rsi] + adc rdx,0 + add rdi,r11 + lea r15,QWORD PTR[4+r15] + adc rdx,0 + mov QWORD PTR[rsp],rdi + mov r13,rdx + jmp $L$1st4x +ALIGN 16 +$L$1st4x:: + mul rbx + add r10,rax + mov rax,QWORD PTR[((-16))+r15*8+rcx] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[((-8))+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-24))+r15*8+rsp],r13 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[((-8))+r15*8+rcx] + adc rdx,0 + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[r15*8+rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],rdi + mov r13,rdx + + mul rbx + add r10,rax + mov rax,QWORD PTR[r15*8+rcx] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[8+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-8))+r15*8+rsp],r13 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[8+r15*8+rcx] + adc rdx,0 + lea r15,QWORD PTR[4+r15] + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[((-16))+r15*8+rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-32))+r15*8+rsp],rdi + mov r13,rdx + cmp r15,r9 + jl $L$1st4x + + mul rbx + add r10,rax + mov rax,QWORD PTR[((-16))+r15*8+rcx] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[((-8))+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-24))+r15*8+rsp],r13 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[((-8))+r15*8+rcx] + adc rdx,0 + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],rdi + mov r13,rdx + + xor rdi,rdi + add r13,r10 + adc rdi,0 + mov QWORD PTR[((-8))+r15*8+rsp],r13 + mov QWORD PTR[r15*8+rsp],rdi + + lea r14,QWORD PTR[1+r14] +ALIGN 4 +$L$outer4x:: + lea rdx,QWORD PTR[((32+128))+r9*8+rsp] + pxor xmm4,xmm4 + pxor xmm5,xmm5 + movdqa xmm0,XMMWORD PTR[((-128))+r12] + movdqa xmm1,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm0,XMMWORD PTR[((-128))+rdx] + pand xmm1,XMMWORD PTR[((-112))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-96))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-80))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[((-64))+r12] + movdqa xmm1,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm0,XMMWORD PTR[((-64))+rdx] + pand xmm1,XMMWORD PTR[((-48))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-32))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-16))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[r12] + movdqa xmm1,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm0,XMMWORD PTR[rdx] + pand xmm1,XMMWORD PTR[16+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[32+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[48+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[64+r12] + movdqa xmm1,XMMWORD PTR[80+r12] + movdqa xmm2,XMMWORD PTR[96+r12] + movdqa xmm3,XMMWORD PTR[112+r12] + pand xmm0,XMMWORD PTR[64+rdx] + pand xmm1,XMMWORD PTR[80+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[96+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[112+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + por xmm4,xmm5 + pshufd xmm0,xmm4,04eh + por xmm0,xmm4 + lea r12,QWORD PTR[256+r12] + movd rbx,xmm0 + + xor r15,r15 + + mov r10,QWORD PTR[rsp] + mov rbp,r8 + mul rbx + add r10,rax + mov rax,QWORD PTR[rcx] + adc rdx,0 + + imul rbp,r10 + mov r11,rdx + + mul rbp + add r10,rax + mov rax,QWORD PTR[8+rsi] + adc rdx,0 + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[8+rcx] + adc rdx,0 + add r11,QWORD PTR[8+rsp] + adc rdx,0 + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[16+rsi] + adc rdx,0 + add rdi,r11 + lea r15,QWORD PTR[4+r15] + adc rdx,0 + mov r13,rdx + jmp $L$inner4x +ALIGN 16 +$L$inner4x:: + mul rbx + add r10,rax + mov rax,QWORD PTR[((-16))+r15*8+rcx] + adc rdx,0 + add r10,QWORD PTR[((-16))+r15*8+rsp] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[((-8))+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-32))+r15*8+rsp],rdi + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[((-8))+r15*8+rcx] + adc rdx,0 + add r11,QWORD PTR[((-8))+r15*8+rsp] + adc rdx,0 + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[r15*8+rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-24))+r15*8+rsp],r13 + mov r13,rdx + + mul rbx + add r10,rax + mov rax,QWORD PTR[r15*8+rcx] + adc rdx,0 + add r10,QWORD PTR[r15*8+rsp] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[8+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-16))+r15*8+rsp],rdi + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[8+r15*8+rcx] + adc rdx,0 + add r11,QWORD PTR[8+r15*8+rsp] + adc rdx,0 + lea r15,QWORD PTR[4+r15] + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[((-16))+r15*8+rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-40))+r15*8+rsp],r13 + mov r13,rdx + cmp r15,r9 + jl $L$inner4x + + mul rbx + add r10,rax + mov rax,QWORD PTR[((-16))+r15*8+rcx] + adc rdx,0 + add r10,QWORD PTR[((-16))+r15*8+rsp] + adc rdx,0 + mov r11,rdx + + mul rbp + add r13,rax + mov rax,QWORD PTR[((-8))+r15*8+rsi] + adc rdx,0 + add r13,r10 + adc rdx,0 + mov QWORD PTR[((-32))+r15*8+rsp],rdi + mov rdi,rdx + + mul rbx + add r11,rax + mov rax,QWORD PTR[((-8))+r15*8+rcx] + adc rdx,0 + add r11,QWORD PTR[((-8))+r15*8+rsp] + adc rdx,0 + lea r14,QWORD PTR[1+r14] + mov r10,rdx + + mul rbp + add rdi,rax + mov rax,QWORD PTR[rsi] + adc rdx,0 + add rdi,r11 + adc rdx,0 + mov QWORD PTR[((-24))+r15*8+rsp],r13 + mov r13,rdx + + mov QWORD PTR[((-16))+r15*8+rsp],rdi + + xor rdi,rdi + add r13,r10 + adc rdi,0 + add r13,QWORD PTR[r9*8+rsp] + adc rdi,0 + mov QWORD PTR[((-8))+r15*8+rsp],r13 + mov QWORD PTR[r15*8+rsp],rdi + + cmp r14,r9 + jl $L$outer4x + mov rdi,QWORD PTR[16+r9*8+rsp] + mov rax,QWORD PTR[rsp] + pxor xmm0,xmm0 + mov rdx,QWORD PTR[8+rsp] + shr r9,2 + lea rsi,QWORD PTR[rsp] + xor r14,r14 + + sub rax,QWORD PTR[rcx] + mov rbx,QWORD PTR[16+rsi] + mov rbp,QWORD PTR[24+rsi] + sbb rdx,QWORD PTR[8+rcx] + lea r15,QWORD PTR[((-1))+r9] + jmp $L$sub4x +ALIGN 16 +$L$sub4x:: + mov QWORD PTR[r14*8+rdi],rax + mov QWORD PTR[8+r14*8+rdi],rdx + sbb rbx,QWORD PTR[16+r14*8+rcx] + mov rax,QWORD PTR[32+r14*8+rsi] + mov rdx,QWORD PTR[40+r14*8+rsi] + sbb rbp,QWORD PTR[24+r14*8+rcx] + mov QWORD PTR[16+r14*8+rdi],rbx + mov QWORD PTR[24+r14*8+rdi],rbp + sbb rax,QWORD PTR[32+r14*8+rcx] + mov rbx,QWORD PTR[48+r14*8+rsi] + mov rbp,QWORD PTR[56+r14*8+rsi] + sbb rdx,QWORD PTR[40+r14*8+rcx] + lea r14,QWORD PTR[4+r14] + dec r15 + jnz $L$sub4x + + mov QWORD PTR[r14*8+rdi],rax + mov rax,QWORD PTR[32+r14*8+rsi] + sbb rbx,QWORD PTR[16+r14*8+rcx] + mov QWORD PTR[8+r14*8+rdi],rdx + sbb rbp,QWORD PTR[24+r14*8+rcx] + mov QWORD PTR[16+r14*8+rdi],rbx + + sbb rax,0 + mov QWORD PTR[24+r14*8+rdi],rbp + xor r14,r14 + and rsi,rax + not rax + mov rcx,rdi + and rcx,rax + lea r15,QWORD PTR[((-1))+r9] + or rsi,rcx + + movdqu xmm1,XMMWORD PTR[rsi] + movdqa XMMWORD PTR[rsp],xmm0 + movdqu XMMWORD PTR[rdi],xmm1 + jmp $L$copy4x +ALIGN 16 +$L$copy4x:: + movdqu xmm2,XMMWORD PTR[16+r14*1+rsi] + movdqu xmm1,XMMWORD PTR[32+r14*1+rsi] + movdqa XMMWORD PTR[16+r14*1+rsp],xmm0 + movdqu XMMWORD PTR[16+r14*1+rdi],xmm2 + movdqa XMMWORD PTR[32+r14*1+rsp],xmm0 + movdqu XMMWORD PTR[32+r14*1+rdi],xmm1 + lea r14,QWORD PTR[32+r14] + dec r15 + jnz $L$copy4x + + shl r9,2 + movdqu xmm2,XMMWORD PTR[16+r14*1+rsi] + movdqa XMMWORD PTR[16+r14*1+rsp],xmm0 + movdqu XMMWORD PTR[16+r14*1+rdi],xmm2 + mov rsi,QWORD PTR[8+r9*8+rsp] + mov rax,1 + + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$mul4x_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_bn_mul4x_mont_gather5:: +bn_mul4x_mont_gather5 ENDP +PUBLIC bn_scatter5 + +ALIGN 16 +bn_scatter5 PROC PUBLIC + cmp rdx,0 + jz $L$scatter_epilogue + lea r8,QWORD PTR[r9*8+r8] +$L$scatter:: + mov rax,QWORD PTR[rcx] + lea rcx,QWORD PTR[8+rcx] + mov QWORD PTR[r8],rax + lea r8,QWORD PTR[256+r8] + sub rdx,1 + jnz $L$scatter +$L$scatter_epilogue:: + DB 0F3h,0C3h ;repret +bn_scatter5 ENDP + +PUBLIC bn_gather5 + +ALIGN 16 +bn_gather5 PROC PUBLIC +$L$SEH_begin_bn_gather5:: + +DB 04ch,08dh,014h,024h +DB 048h,081h,0ech,008h,001h,000h,000h + lea rax,QWORD PTR[$L$inc] + and rsp,-16 + + movd xmm5,r9d + movdqa xmm0,XMMWORD PTR[rax] + movdqa xmm1,XMMWORD PTR[16+rax] + lea r11,QWORD PTR[128+r8] + lea rax,QWORD PTR[128+rsp] + + pshufd xmm5,xmm5,0 + movdqa xmm4,xmm1 + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[(-128)+rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[(-112)+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[(-96)+rax],xmm2 + movdqa xmm2,xmm4 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[(-80)+rax],xmm3 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[(-64)+rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[(-48)+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[(-32)+rax],xmm2 + movdqa xmm2,xmm4 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[(-16)+rax],xmm3 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[16+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[32+rax],xmm2 + movdqa xmm2,xmm4 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[48+rax],xmm3 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[64+rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[80+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[96+rax],xmm2 + movdqa xmm2,xmm4 + movdqa XMMWORD PTR[112+rax],xmm3 + jmp $L$gather + +ALIGN 32 +$L$gather:: + pxor xmm4,xmm4 + pxor xmm5,xmm5 + movdqa xmm0,XMMWORD PTR[((-128))+r11] + movdqa xmm1,XMMWORD PTR[((-112))+r11] + movdqa xmm2,XMMWORD PTR[((-96))+r11] + pand xmm0,XMMWORD PTR[((-128))+rax] + movdqa xmm3,XMMWORD PTR[((-80))+r11] + pand xmm1,XMMWORD PTR[((-112))+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-96))+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-80))+rax] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[((-64))+r11] + movdqa xmm1,XMMWORD PTR[((-48))+r11] + movdqa xmm2,XMMWORD PTR[((-32))+r11] + pand xmm0,XMMWORD PTR[((-64))+rax] + movdqa xmm3,XMMWORD PTR[((-16))+r11] + pand xmm1,XMMWORD PTR[((-48))+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-32))+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-16))+rax] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[r11] + movdqa xmm1,XMMWORD PTR[16+r11] + movdqa xmm2,XMMWORD PTR[32+r11] + pand xmm0,XMMWORD PTR[rax] + movdqa xmm3,XMMWORD PTR[48+r11] + pand xmm1,XMMWORD PTR[16+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[32+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[48+rax] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[64+r11] + movdqa xmm1,XMMWORD PTR[80+r11] + movdqa xmm2,XMMWORD PTR[96+r11] + pand xmm0,XMMWORD PTR[64+rax] + movdqa xmm3,XMMWORD PTR[112+r11] + pand xmm1,XMMWORD PTR[80+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[96+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[112+rax] + por xmm4,xmm2 + por xmm5,xmm3 + por xmm4,xmm5 + lea r11,QWORD PTR[256+r11] + pshufd xmm0,xmm4,04eh + por xmm0,xmm4 + movq QWORD PTR[rcx],xmm0 + lea rcx,QWORD PTR[8+rcx] + sub rdx,1 + jnz $L$gather + + lea rsp,QWORD PTR[r10] + DB 0F3h,0C3h ;repret +$L$SEH_end_bn_gather5:: +bn_gather5 ENDP +ALIGN 64 +$L$inc:: + DD 0,0,1,1 + DD 2,2,2,2 +DB 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105 +DB 112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115 +DB 99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111 +DB 114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79 +DB 71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111 +DB 112,101,110,115,115,108,46,111,114,103,62,0 +EXTERN __imp_RtlVirtualUnwind:NEAR + +ALIGN 16 +mul_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + mov rsi,QWORD PTR[8+r9] + mov r11,QWORD PTR[56+r9] + + mov r10d,DWORD PTR[r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$common_seh_tail + + lea rax,QWORD PTR[48+rax] + + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$common_seh_tail + + mov rax,QWORD PTR[152+r8] + + mov r10d,DWORD PTR[8+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jae $L$common_seh_tail + + mov r10,QWORD PTR[192+r8] + mov rax,QWORD PTR[8+r10*8+rax] + + lea rax,QWORD PTR[48+rax] + + mov rbx,QWORD PTR[((-8))+rax] + mov rbp,QWORD PTR[((-16))+rax] + mov r12,QWORD PTR[((-24))+rax] + mov r13,QWORD PTR[((-32))+rax] + mov r14,QWORD PTR[((-40))+rax] + mov r15,QWORD PTR[((-48))+rax] + mov QWORD PTR[144+r8],rbx + mov QWORD PTR[160+r8],rbp + mov QWORD PTR[216+r8],r12 + mov QWORD PTR[224+r8],r13 + mov QWORD PTR[232+r8],r14 + mov QWORD PTR[240+r8],r15 + +$L$common_seh_tail:: + mov rdi,QWORD PTR[8+rax] + mov rsi,QWORD PTR[16+rax] + mov QWORD PTR[152+r8],rax + mov QWORD PTR[168+r8],rsi + mov QWORD PTR[176+r8],rdi + + mov rdi,QWORD PTR[40+r9] + mov rsi,r8 + mov ecx,154 + DD 0a548f3fch + + mov rsi,r9 + xor rcx,rcx + mov rdx,QWORD PTR[8+rsi] + mov r8,QWORD PTR[rsi] + mov r9,QWORD PTR[16+rsi] + mov r10,QWORD PTR[40+rsi] + lea r11,QWORD PTR[56+rsi] + lea r12,QWORD PTR[24+rsi] + mov QWORD PTR[32+rsp],r10 + mov QWORD PTR[40+rsp],r11 + mov QWORD PTR[48+rsp],r12 + mov QWORD PTR[56+rsp],rcx + call QWORD PTR[__imp_RtlVirtualUnwind] + + mov eax,1 + add rsp,64 + popfq + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + pop rbx + pop rdi + pop rsi + DB 0F3h,0C3h ;repret +mul_handler ENDP + +.text$ ENDS +.pdata SEGMENT READONLY ALIGN(4) +ALIGN 4 + DD imagerel $L$SEH_begin_bn_mul_mont_gather5 + DD imagerel $L$SEH_end_bn_mul_mont_gather5 + DD imagerel $L$SEH_info_bn_mul_mont_gather5 + + DD imagerel $L$SEH_begin_bn_mul4x_mont_gather5 + DD imagerel $L$SEH_end_bn_mul4x_mont_gather5 + DD imagerel $L$SEH_info_bn_mul4x_mont_gather5 + + DD imagerel $L$SEH_begin_bn_gather5 + DD imagerel $L$SEH_end_bn_gather5 + DD imagerel $L$SEH_info_bn_gather5 + +.pdata ENDS +.xdata SEGMENT READONLY ALIGN(8) +ALIGN 8 +$L$SEH_info_bn_mul_mont_gather5:: +DB 9,0,0,0 + DD imagerel mul_handler + DD imagerel $L$mul_alloca,imagerel $L$mul_body,imagerel $L$mul_epilogue +ALIGN 8 +$L$SEH_info_bn_mul4x_mont_gather5:: +DB 9,0,0,0 + DD imagerel mul_handler + DD imagerel $L$mul4x_alloca,imagerel $L$mul4x_body,imagerel $L$mul4x_epilogue +ALIGN 8 +$L$SEH_info_bn_gather5:: +DB 001h,00bh,003h,00ah +DB 00bh,001h,021h,000h +DB 004h,0a3h,000h,000h +ALIGN 8 + +.xdata ENDS +END diff --git a/crypto/camellia/cmll-elf-x86_64.S b/crypto/camellia/cmll-elf-x86_64.S index 48f4f48a..64a1af05 100644 --- a/crypto/camellia/cmll-elf-x86_64.S +++ b/crypto/camellia/cmll-elf-x86_64.S @@ -60,7 +60,7 @@ Camellia_EncryptBlock_Rounds: movq 32(%rsp),%rbx leaq 40(%rsp),%rsp .Lenc_epilogue: - .byte 0xf3,0xc3 + retq .size Camellia_EncryptBlock_Rounds,.-Camellia_EncryptBlock_Rounds .type _x86_64_Camellia_encrypt,@function @@ -267,7 +267,7 @@ _x86_64_Camellia_encrypt: movl %ecx,%r10d movl %edx,%r11d -.byte 0xf3,0xc3 + retq .size _x86_64_Camellia_encrypt,.-_x86_64_Camellia_encrypt @@ -329,7 +329,7 @@ Camellia_DecryptBlock_Rounds: movq 32(%rsp),%rbx leaq 40(%rsp),%rsp .Ldec_epilogue: - .byte 0xf3,0xc3 + retq .size Camellia_DecryptBlock_Rounds,.-Camellia_DecryptBlock_Rounds .type _x86_64_Camellia_decrypt,@function @@ -537,7 +537,7 @@ _x86_64_Camellia_decrypt: movl %eax,%r10d movl %ebx,%r11d -.byte 0xf3,0xc3 + retq .size _x86_64_Camellia_decrypt,.-_x86_64_Camellia_decrypt .globl Camellia_Ekeygen .type Camellia_Ekeygen,@function @@ -1081,7 +1081,7 @@ Camellia_Ekeygen: movq 32(%rsp),%rbx leaq 40(%rsp),%rsp .Lkey_epilogue: - .byte 0xf3,0xc3 + retq .size Camellia_Ekeygen,.-Camellia_Ekeygen .align 64 .LCamellia_SIGMA: @@ -1833,7 +1833,7 @@ Camellia_cbc_encrypt: movq 40(%rcx),%rbx leaq 48(%rcx),%rsp .Lcbc_abort: - .byte 0xf3,0xc3 + retq .size Camellia_cbc_encrypt,.-Camellia_cbc_encrypt .byte 67,97,109,101,108,108,105,97,32,102,111,114,32,120,56,54,95,54,52,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 diff --git a/crypto/camellia/cmll-macosx-x86_64.S b/crypto/camellia/cmll-macosx-x86_64.S index b4ca0abb..5e7a1b7b 100644 --- a/crypto/camellia/cmll-macosx-x86_64.S +++ b/crypto/camellia/cmll-macosx-x86_64.S @@ -60,7 +60,7 @@ L$enc_prologue: movq 32(%rsp),%rbx leaq 40(%rsp),%rsp L$enc_epilogue: - .byte 0xf3,0xc3 + retq @@ -267,7 +267,7 @@ L$edone: movl %ecx,%r10d movl %edx,%r11d -.byte 0xf3,0xc3 + retq @@ -329,7 +329,7 @@ L$dec_prologue: movq 32(%rsp),%rbx leaq 40(%rsp),%rsp L$dec_epilogue: - .byte 0xf3,0xc3 + retq @@ -537,7 +537,7 @@ L$ddone: movl %eax,%r10d movl %ebx,%r11d -.byte 0xf3,0xc3 + retq .globl _Camellia_Ekeygen @@ -1081,7 +1081,7 @@ L$done: movq 32(%rsp),%rbx leaq 40(%rsp),%rsp L$key_epilogue: - .byte 0xf3,0xc3 + retq .p2align 6 L$Camellia_SIGMA: @@ -1833,7 +1833,7 @@ L$cbc_done: movq 40(%rcx),%rbx leaq 48(%rcx),%rsp L$cbc_abort: - .byte 0xf3,0xc3 + retq .byte 67,97,109,101,108,108,105,97,32,102,111,114,32,120,56,54,95,54,52,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 diff --git a/crypto/camellia/cmll-masm-x86_64.S b/crypto/camellia/cmll-masm-x86_64.S new file mode 100644 index 00000000..db2c817a --- /dev/null +++ b/crypto/camellia/cmll-masm-x86_64.S @@ -0,0 +1,1898 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + + +PUBLIC Camellia_EncryptBlock + +ALIGN 16 +Camellia_EncryptBlock PROC PUBLIC + mov eax,128 + sub eax,edi + mov edi,3 + adc edi,0 + jmp $L$enc_rounds +Camellia_EncryptBlock ENDP + +PUBLIC Camellia_EncryptBlock_Rounds + +ALIGN 16 +$L$enc_rounds:: +Camellia_EncryptBlock_Rounds PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_Camellia_EncryptBlock_Rounds:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + + + push rbx + push rbp + push r13 + push r14 + push r15 +$L$enc_prologue:: + + + mov r13,rcx + mov r14,rdx + + shl edi,6 + lea rbp,QWORD PTR[$L$Camellia_SBOX] + lea r15,QWORD PTR[rdi*1+r14] + + mov r8d,DWORD PTR[rsi] + mov r9d,DWORD PTR[4+rsi] + mov r10d,DWORD PTR[8+rsi] + bswap r8d + mov r11d,DWORD PTR[12+rsi] + bswap r9d + bswap r10d + bswap r11d + + call _x86_64_Camellia_encrypt + + bswap r8d + bswap r9d + bswap r10d + mov DWORD PTR[r13],r8d + bswap r11d + mov DWORD PTR[4+r13],r9d + mov DWORD PTR[8+r13],r10d + mov DWORD PTR[12+r13],r11d + + mov r15,QWORD PTR[rsp] + mov r14,QWORD PTR[8+rsp] + mov r13,QWORD PTR[16+rsp] + mov rbp,QWORD PTR[24+rsp] + mov rbx,QWORD PTR[32+rsp] + lea rsp,QWORD PTR[40+rsp] +$L$enc_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_Camellia_EncryptBlock_Rounds:: +Camellia_EncryptBlock_Rounds ENDP + + +ALIGN 16 +_x86_64_Camellia_encrypt PROC PRIVATE + xor r9d,DWORD PTR[r14] + xor r8d,DWORD PTR[4+r14] + xor r11d,DWORD PTR[8+r14] + xor r10d,DWORD PTR[12+r14] +ALIGN 16 +$L$eloop:: + mov ebx,DWORD PTR[16+r14] + mov eax,DWORD PTR[20+r14] + + xor eax,r8d + xor ebx,r9d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[24+r14] + mov eax,DWORD PTR[28+r14] + xor ecx,edx + ror edx,8 + xor r10d,ecx + xor r11d,ecx + xor r11d,edx + xor eax,r10d + xor ebx,r11d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[32+r14] + mov eax,DWORD PTR[36+r14] + xor ecx,edx + ror edx,8 + xor r8d,ecx + xor r9d,ecx + xor r9d,edx + xor eax,r8d + xor ebx,r9d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[40+r14] + mov eax,DWORD PTR[44+r14] + xor ecx,edx + ror edx,8 + xor r10d,ecx + xor r11d,ecx + xor r11d,edx + xor eax,r10d + xor ebx,r11d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[48+r14] + mov eax,DWORD PTR[52+r14] + xor ecx,edx + ror edx,8 + xor r8d,ecx + xor r9d,ecx + xor r9d,edx + xor eax,r8d + xor ebx,r9d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[56+r14] + mov eax,DWORD PTR[60+r14] + xor ecx,edx + ror edx,8 + xor r10d,ecx + xor r11d,ecx + xor r11d,edx + xor eax,r10d + xor ebx,r11d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[64+r14] + mov eax,DWORD PTR[68+r14] + xor ecx,edx + ror edx,8 + xor r8d,ecx + xor r9d,ecx + xor r9d,edx + lea r14,QWORD PTR[64+r14] + cmp r14,r15 + mov edx,DWORD PTR[8+r14] + mov ecx,DWORD PTR[12+r14] + je $L$edone + + and eax,r8d + or edx,r11d + rol eax,1 + xor r10d,edx + xor r9d,eax + and ecx,r10d + or ebx,r9d + rol ecx,1 + xor r8d,ebx + xor r11d,ecx + jmp $L$eloop + +ALIGN 16 +$L$edone:: + xor eax,r10d + xor ebx,r11d + xor ecx,r8d + xor edx,r9d + + mov r8d,eax + mov r9d,ebx + mov r10d,ecx + mov r11d,edx + + DB 0F3h,0C3h ;repret +_x86_64_Camellia_encrypt ENDP + + +PUBLIC Camellia_DecryptBlock + +ALIGN 16 +Camellia_DecryptBlock PROC PUBLIC + mov eax,128 + sub eax,edi + mov edi,3 + adc edi,0 + jmp $L$dec_rounds +Camellia_DecryptBlock ENDP + +PUBLIC Camellia_DecryptBlock_Rounds + +ALIGN 16 +$L$dec_rounds:: +Camellia_DecryptBlock_Rounds PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_Camellia_DecryptBlock_Rounds:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + + + push rbx + push rbp + push r13 + push r14 + push r15 +$L$dec_prologue:: + + + mov r13,rcx + mov r15,rdx + + shl edi,6 + lea rbp,QWORD PTR[$L$Camellia_SBOX] + lea r14,QWORD PTR[rdi*1+r15] + + mov r8d,DWORD PTR[rsi] + mov r9d,DWORD PTR[4+rsi] + mov r10d,DWORD PTR[8+rsi] + bswap r8d + mov r11d,DWORD PTR[12+rsi] + bswap r9d + bswap r10d + bswap r11d + + call _x86_64_Camellia_decrypt + + bswap r8d + bswap r9d + bswap r10d + mov DWORD PTR[r13],r8d + bswap r11d + mov DWORD PTR[4+r13],r9d + mov DWORD PTR[8+r13],r10d + mov DWORD PTR[12+r13],r11d + + mov r15,QWORD PTR[rsp] + mov r14,QWORD PTR[8+rsp] + mov r13,QWORD PTR[16+rsp] + mov rbp,QWORD PTR[24+rsp] + mov rbx,QWORD PTR[32+rsp] + lea rsp,QWORD PTR[40+rsp] +$L$dec_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_Camellia_DecryptBlock_Rounds:: +Camellia_DecryptBlock_Rounds ENDP + + +ALIGN 16 +_x86_64_Camellia_decrypt PROC PRIVATE + xor r9d,DWORD PTR[r14] + xor r8d,DWORD PTR[4+r14] + xor r11d,DWORD PTR[8+r14] + xor r10d,DWORD PTR[12+r14] +ALIGN 16 +$L$dloop:: + mov ebx,DWORD PTR[((-8))+r14] + mov eax,DWORD PTR[((-4))+r14] + + xor eax,r8d + xor ebx,r9d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[((-16))+r14] + mov eax,DWORD PTR[((-12))+r14] + xor ecx,edx + ror edx,8 + xor r10d,ecx + xor r11d,ecx + xor r11d,edx + xor eax,r10d + xor ebx,r11d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[((-24))+r14] + mov eax,DWORD PTR[((-20))+r14] + xor ecx,edx + ror edx,8 + xor r8d,ecx + xor r9d,ecx + xor r9d,edx + xor eax,r8d + xor ebx,r9d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[((-32))+r14] + mov eax,DWORD PTR[((-28))+r14] + xor ecx,edx + ror edx,8 + xor r10d,ecx + xor r11d,ecx + xor r11d,edx + xor eax,r10d + xor ebx,r11d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[((-40))+r14] + mov eax,DWORD PTR[((-36))+r14] + xor ecx,edx + ror edx,8 + xor r8d,ecx + xor r9d,ecx + xor r9d,edx + xor eax,r8d + xor ebx,r9d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[((-48))+r14] + mov eax,DWORD PTR[((-44))+r14] + xor ecx,edx + ror edx,8 + xor r10d,ecx + xor r11d,ecx + xor r11d,edx + xor eax,r10d + xor ebx,r11d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[((-56))+r14] + mov eax,DWORD PTR[((-52))+r14] + xor ecx,edx + ror edx,8 + xor r8d,ecx + xor r9d,ecx + xor r9d,edx + lea r14,QWORD PTR[((-64))+r14] + cmp r14,r15 + mov edx,DWORD PTR[r14] + mov ecx,DWORD PTR[4+r14] + je $L$ddone + + and eax,r8d + or edx,r11d + rol eax,1 + xor r10d,edx + xor r9d,eax + and ecx,r10d + or ebx,r9d + rol ecx,1 + xor r8d,ebx + xor r11d,ecx + + jmp $L$dloop + +ALIGN 16 +$L$ddone:: + xor ecx,r10d + xor edx,r11d + xor eax,r8d + xor ebx,r9d + + mov r8d,ecx + mov r9d,edx + mov r10d,eax + mov r11d,ebx + + DB 0F3h,0C3h ;repret +_x86_64_Camellia_decrypt ENDP +PUBLIC Camellia_Ekeygen + +ALIGN 16 +Camellia_Ekeygen PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_Camellia_Ekeygen:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + push rbx + push rbp + push r13 + push r14 + push r15 +$L$key_prologue:: + + mov r15,rdi + mov r13,rdx + + mov r8d,DWORD PTR[rsi] + mov r9d,DWORD PTR[4+rsi] + mov r10d,DWORD PTR[8+rsi] + mov r11d,DWORD PTR[12+rsi] + + bswap r8d + bswap r9d + bswap r10d + bswap r11d + mov DWORD PTR[r13],r9d + mov DWORD PTR[4+r13],r8d + mov DWORD PTR[8+r13],r11d + mov DWORD PTR[12+r13],r10d + cmp r15,128 + je $L$1st128 + + mov r8d,DWORD PTR[16+rsi] + mov r9d,DWORD PTR[20+rsi] + cmp r15,192 + je $L$1st192 + mov r10d,DWORD PTR[24+rsi] + mov r11d,DWORD PTR[28+rsi] + jmp $L$1st256 +$L$1st192:: + mov r10d,r8d + mov r11d,r9d + not r10d + not r11d +$L$1st256:: + bswap r8d + bswap r9d + bswap r10d + bswap r11d + mov DWORD PTR[32+r13],r9d + mov DWORD PTR[36+r13],r8d + mov DWORD PTR[40+r13],r11d + mov DWORD PTR[44+r13],r10d + xor r9d,DWORD PTR[r13] + xor r8d,DWORD PTR[4+r13] + xor r11d,DWORD PTR[8+r13] + xor r10d,DWORD PTR[12+r13] + +$L$1st128:: + lea r14,QWORD PTR[$L$Camellia_SIGMA] + lea rbp,QWORD PTR[$L$Camellia_SBOX] + + mov ebx,DWORD PTR[r14] + mov eax,DWORD PTR[4+r14] + xor eax,r8d + xor ebx,r9d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[8+r14] + mov eax,DWORD PTR[12+r14] + xor ecx,edx + ror edx,8 + xor r10d,ecx + xor r11d,ecx + xor r11d,edx + xor eax,r10d + xor ebx,r11d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[16+r14] + mov eax,DWORD PTR[20+r14] + xor ecx,edx + ror edx,8 + xor r8d,ecx + xor r9d,ecx + xor r9d,edx + xor r9d,DWORD PTR[r13] + xor r8d,DWORD PTR[4+r13] + xor r11d,DWORD PTR[8+r13] + xor r10d,DWORD PTR[12+r13] + xor eax,r8d + xor ebx,r9d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[24+r14] + mov eax,DWORD PTR[28+r14] + xor ecx,edx + ror edx,8 + xor r10d,ecx + xor r11d,ecx + xor r11d,edx + xor eax,r10d + xor ebx,r11d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[32+r14] + mov eax,DWORD PTR[36+r14] + xor ecx,edx + ror edx,8 + xor r8d,ecx + xor r9d,ecx + xor r9d,edx + cmp r15,128 + jne $L$2nd256 + + lea r13,QWORD PTR[128+r13] + shl r8,32 + shl r10,32 + or r8,r9 + or r10,r11 + mov rax,QWORD PTR[((-128))+r13] + mov rbx,QWORD PTR[((-120))+r13] + mov QWORD PTR[((-112))+r13],r8 + mov QWORD PTR[((-104))+r13],r10 + mov r11,rax + shl rax,15 + mov r9,rbx + shr r9,49 + shr r11,49 + or rax,r9 + shl rbx,15 + or rbx,r11 + mov QWORD PTR[((-96))+r13],rax + mov QWORD PTR[((-88))+r13],rbx + mov r11,r8 + shl r8,15 + mov r9,r10 + shr r9,49 + shr r11,49 + or r8,r9 + shl r10,15 + or r10,r11 + mov QWORD PTR[((-80))+r13],r8 + mov QWORD PTR[((-72))+r13],r10 + mov r11,r8 + shl r8,15 + mov r9,r10 + shr r9,49 + shr r11,49 + or r8,r9 + shl r10,15 + or r10,r11 + mov QWORD PTR[((-64))+r13],r8 + mov QWORD PTR[((-56))+r13],r10 + mov r11,rax + shl rax,30 + mov r9,rbx + shr r9,34 + shr r11,34 + or rax,r9 + shl rbx,30 + or rbx,r11 + mov QWORD PTR[((-48))+r13],rax + mov QWORD PTR[((-40))+r13],rbx + mov r11,r8 + shl r8,15 + mov r9,r10 + shr r9,49 + shr r11,49 + or r8,r9 + shl r10,15 + or r10,r11 + mov QWORD PTR[((-32))+r13],r8 + mov r11,rax + shl rax,15 + mov r9,rbx + shr r9,49 + shr r11,49 + or rax,r9 + shl rbx,15 + or rbx,r11 + mov QWORD PTR[((-24))+r13],rbx + mov r11,r8 + shl r8,15 + mov r9,r10 + shr r9,49 + shr r11,49 + or r8,r9 + shl r10,15 + or r10,r11 + mov QWORD PTR[((-16))+r13],r8 + mov QWORD PTR[((-8))+r13],r10 + mov r11,rax + shl rax,17 + mov r9,rbx + shr r9,47 + shr r11,47 + or rax,r9 + shl rbx,17 + or rbx,r11 + mov QWORD PTR[r13],rax + mov QWORD PTR[8+r13],rbx + mov r11,rax + shl rax,17 + mov r9,rbx + shr r9,47 + shr r11,47 + or rax,r9 + shl rbx,17 + or rbx,r11 + mov QWORD PTR[16+r13],rax + mov QWORD PTR[24+r13],rbx + mov r11,r8 + shl r8,34 + mov r9,r10 + shr r9,30 + shr r11,30 + or r8,r9 + shl r10,34 + or r10,r11 + mov QWORD PTR[32+r13],r8 + mov QWORD PTR[40+r13],r10 + mov r11,rax + shl rax,17 + mov r9,rbx + shr r9,47 + shr r11,47 + or rax,r9 + shl rbx,17 + or rbx,r11 + mov QWORD PTR[48+r13],rax + mov QWORD PTR[56+r13],rbx + mov r11,r8 + shl r8,17 + mov r9,r10 + shr r9,47 + shr r11,47 + or r8,r9 + shl r10,17 + or r10,r11 + mov QWORD PTR[64+r13],r8 + mov QWORD PTR[72+r13],r10 + mov eax,3 + jmp $L$done +ALIGN 16 +$L$2nd256:: + mov DWORD PTR[48+r13],r9d + mov DWORD PTR[52+r13],r8d + mov DWORD PTR[56+r13],r11d + mov DWORD PTR[60+r13],r10d + xor r9d,DWORD PTR[32+r13] + xor r8d,DWORD PTR[36+r13] + xor r11d,DWORD PTR[40+r13] + xor r10d,DWORD PTR[44+r13] + xor eax,r8d + xor ebx,r9d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[40+r14] + mov eax,DWORD PTR[44+r14] + xor ecx,edx + ror edx,8 + xor r10d,ecx + xor r11d,ecx + xor r11d,edx + xor eax,r10d + xor ebx,r11d + movzx esi,ah + movzx edi,bl + mov edx,DWORD PTR[2052+rsi*8+rbp] + mov ecx,DWORD PTR[rdi*8+rbp] + movzx esi,al + shr eax,16 + movzx edi,bh + xor edx,DWORD PTR[4+rsi*8+rbp] + shr ebx,16 + xor ecx,DWORD PTR[4+rdi*8+rbp] + movzx esi,ah + movzx edi,bl + xor edx,DWORD PTR[rsi*8+rbp] + xor ecx,DWORD PTR[2052+rdi*8+rbp] + movzx esi,al + movzx edi,bh + xor edx,DWORD PTR[2048+rsi*8+rbp] + xor ecx,DWORD PTR[2048+rdi*8+rbp] + mov ebx,DWORD PTR[48+r14] + mov eax,DWORD PTR[52+r14] + xor ecx,edx + ror edx,8 + xor r8d,ecx + xor r9d,ecx + xor r9d,edx + mov rax,QWORD PTR[r13] + mov rbx,QWORD PTR[8+r13] + mov rcx,QWORD PTR[32+r13] + mov rdx,QWORD PTR[40+r13] + mov r14,QWORD PTR[48+r13] + mov r15,QWORD PTR[56+r13] + lea r13,QWORD PTR[128+r13] + shl r8,32 + shl r10,32 + or r8,r9 + or r10,r11 + mov QWORD PTR[((-112))+r13],r8 + mov QWORD PTR[((-104))+r13],r10 + mov r11,rcx + shl rcx,15 + mov r9,rdx + shr r9,49 + shr r11,49 + or rcx,r9 + shl rdx,15 + or rdx,r11 + mov QWORD PTR[((-96))+r13],rcx + mov QWORD PTR[((-88))+r13],rdx + mov r11,r14 + shl r14,15 + mov r9,r15 + shr r9,49 + shr r11,49 + or r14,r9 + shl r15,15 + or r15,r11 + mov QWORD PTR[((-80))+r13],r14 + mov QWORD PTR[((-72))+r13],r15 + mov r11,rcx + shl rcx,15 + mov r9,rdx + shr r9,49 + shr r11,49 + or rcx,r9 + shl rdx,15 + or rdx,r11 + mov QWORD PTR[((-64))+r13],rcx + mov QWORD PTR[((-56))+r13],rdx + mov r11,r8 + shl r8,30 + mov r9,r10 + shr r9,34 + shr r11,34 + or r8,r9 + shl r10,30 + or r10,r11 + mov QWORD PTR[((-48))+r13],r8 + mov QWORD PTR[((-40))+r13],r10 + mov r11,rax + shl rax,45 + mov r9,rbx + shr r9,19 + shr r11,19 + or rax,r9 + shl rbx,45 + or rbx,r11 + mov QWORD PTR[((-32))+r13],rax + mov QWORD PTR[((-24))+r13],rbx + mov r11,r14 + shl r14,30 + mov r9,r15 + shr r9,34 + shr r11,34 + or r14,r9 + shl r15,30 + or r15,r11 + mov QWORD PTR[((-16))+r13],r14 + mov QWORD PTR[((-8))+r13],r15 + mov r11,rax + shl rax,15 + mov r9,rbx + shr r9,49 + shr r11,49 + or rax,r9 + shl rbx,15 + or rbx,r11 + mov QWORD PTR[r13],rax + mov QWORD PTR[8+r13],rbx + mov r11,rcx + shl rcx,30 + mov r9,rdx + shr r9,34 + shr r11,34 + or rcx,r9 + shl rdx,30 + or rdx,r11 + mov QWORD PTR[16+r13],rcx + mov QWORD PTR[24+r13],rdx + mov r11,r8 + shl r8,30 + mov r9,r10 + shr r9,34 + shr r11,34 + or r8,r9 + shl r10,30 + or r10,r11 + mov QWORD PTR[32+r13],r8 + mov QWORD PTR[40+r13],r10 + mov r11,rax + shl rax,17 + mov r9,rbx + shr r9,47 + shr r11,47 + or rax,r9 + shl rbx,17 + or rbx,r11 + mov QWORD PTR[48+r13],rax + mov QWORD PTR[56+r13],rbx + mov r11,r14 + shl r14,32 + mov r9,r15 + shr r9,32 + shr r11,32 + or r14,r9 + shl r15,32 + or r15,r11 + mov QWORD PTR[64+r13],r14 + mov QWORD PTR[72+r13],r15 + mov r11,rcx + shl rcx,34 + mov r9,rdx + shr r9,30 + shr r11,30 + or rcx,r9 + shl rdx,34 + or rdx,r11 + mov QWORD PTR[80+r13],rcx + mov QWORD PTR[88+r13],rdx + mov r11,r14 + shl r14,17 + mov r9,r15 + shr r9,47 + shr r11,47 + or r14,r9 + shl r15,17 + or r15,r11 + mov QWORD PTR[96+r13],r14 + mov QWORD PTR[104+r13],r15 + mov r11,rax + shl rax,34 + mov r9,rbx + shr r9,30 + shr r11,30 + or rax,r9 + shl rbx,34 + or rbx,r11 + mov QWORD PTR[112+r13],rax + mov QWORD PTR[120+r13],rbx + mov r11,r8 + shl r8,51 + mov r9,r10 + shr r9,13 + shr r11,13 + or r8,r9 + shl r10,51 + or r10,r11 + mov QWORD PTR[128+r13],r8 + mov QWORD PTR[136+r13],r10 + mov eax,4 +$L$done:: + mov r15,QWORD PTR[rsp] + mov r14,QWORD PTR[8+rsp] + mov r13,QWORD PTR[16+rsp] + mov rbp,QWORD PTR[24+rsp] + mov rbx,QWORD PTR[32+rsp] + lea rsp,QWORD PTR[40+rsp] +$L$key_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_Camellia_Ekeygen:: +Camellia_Ekeygen ENDP +ALIGN 64 +$L$Camellia_SIGMA:: + DD 03bcc908bh,0a09e667fh,04caa73b2h,0b67ae858h + DD 0e94f82beh,0c6ef372fh,0f1d36f1ch,054ff53a5h + DD 0de682d1dh,010e527fah,0b3e6c1fdh,0b05688c2h + DD 0,0,0,0 +$L$Camellia_SBOX:: + DD 070707000h,070700070h + DD 082828200h,02c2c002ch + DD 02c2c2c00h,0b3b300b3h + DD 0ececec00h,0c0c000c0h + DD 0b3b3b300h,0e4e400e4h + DD 027272700h,057570057h + DD 0c0c0c000h,0eaea00eah + DD 0e5e5e500h,0aeae00aeh + DD 0e4e4e400h,023230023h + DD 085858500h,06b6b006bh + DD 057575700h,045450045h + DD 035353500h,0a5a500a5h + DD 0eaeaea00h,0eded00edh + DD 00c0c0c00h,04f4f004fh + DD 0aeaeae00h,01d1d001dh + DD 041414100h,092920092h + DD 023232300h,086860086h + DD 0efefef00h,0afaf00afh + DD 06b6b6b00h,07c7c007ch + DD 093939300h,01f1f001fh + DD 045454500h,03e3e003eh + DD 019191900h,0dcdc00dch + DD 0a5a5a500h,05e5e005eh + DD 021212100h,00b0b000bh + DD 0ededed00h,0a6a600a6h + DD 00e0e0e00h,039390039h + DD 04f4f4f00h,0d5d500d5h + DD 04e4e4e00h,05d5d005dh + DD 01d1d1d00h,0d9d900d9h + DD 065656500h,05a5a005ah + DD 092929200h,051510051h + DD 0bdbdbd00h,06c6c006ch + DD 086868600h,08b8b008bh + DD 0b8b8b800h,09a9a009ah + DD 0afafaf00h,0fbfb00fbh + DD 08f8f8f00h,0b0b000b0h + DD 07c7c7c00h,074740074h + DD 0ebebeb00h,02b2b002bh + DD 01f1f1f00h,0f0f000f0h + DD 0cecece00h,084840084h + DD 03e3e3e00h,0dfdf00dfh + DD 030303000h,0cbcb00cbh + DD 0dcdcdc00h,034340034h + DD 05f5f5f00h,076760076h + DD 05e5e5e00h,06d6d006dh + DD 0c5c5c500h,0a9a900a9h + DD 00b0b0b00h,0d1d100d1h + DD 01a1a1a00h,004040004h + DD 0a6a6a600h,014140014h + DD 0e1e1e100h,03a3a003ah + DD 039393900h,0dede00deh + DD 0cacaca00h,011110011h + DD 0d5d5d500h,032320032h + DD 047474700h,09c9c009ch + DD 05d5d5d00h,053530053h + DD 03d3d3d00h,0f2f200f2h + DD 0d9d9d900h,0fefe00feh + DD 001010100h,0cfcf00cfh + DD 05a5a5a00h,0c3c300c3h + DD 0d6d6d600h,07a7a007ah + DD 051515100h,024240024h + DD 056565600h,0e8e800e8h + DD 06c6c6c00h,060600060h + DD 04d4d4d00h,069690069h + DD 08b8b8b00h,0aaaa00aah + DD 00d0d0d00h,0a0a000a0h + DD 09a9a9a00h,0a1a100a1h + DD 066666600h,062620062h + DD 0fbfbfb00h,054540054h + DD 0cccccc00h,01e1e001eh + DD 0b0b0b000h,0e0e000e0h + DD 02d2d2d00h,064640064h + DD 074747400h,010100010h + DD 012121200h,000000000h + DD 02b2b2b00h,0a3a300a3h + DD 020202000h,075750075h + DD 0f0f0f000h,08a8a008ah + DD 0b1b1b100h,0e6e600e6h + DD 084848400h,009090009h + DD 099999900h,0dddd00ddh + DD 0dfdfdf00h,087870087h + DD 04c4c4c00h,083830083h + DD 0cbcbcb00h,0cdcd00cdh + DD 0c2c2c200h,090900090h + DD 034343400h,073730073h + DD 07e7e7e00h,0f6f600f6h + DD 076767600h,09d9d009dh + DD 005050500h,0bfbf00bfh + DD 06d6d6d00h,052520052h + DD 0b7b7b700h,0d8d800d8h + DD 0a9a9a900h,0c8c800c8h + DD 031313100h,0c6c600c6h + DD 0d1d1d100h,081810081h + DD 017171700h,06f6f006fh + DD 004040400h,013130013h + DD 0d7d7d700h,063630063h + DD 014141400h,0e9e900e9h + DD 058585800h,0a7a700a7h + DD 03a3a3a00h,09f9f009fh + DD 061616100h,0bcbc00bch + DD 0dedede00h,029290029h + DD 01b1b1b00h,0f9f900f9h + DD 011111100h,02f2f002fh + DD 01c1c1c00h,0b4b400b4h + DD 032323200h,078780078h + DD 00f0f0f00h,006060006h + DD 09c9c9c00h,0e7e700e7h + DD 016161600h,071710071h + DD 053535300h,0d4d400d4h + DD 018181800h,0abab00abh + DD 0f2f2f200h,088880088h + DD 022222200h,08d8d008dh + DD 0fefefe00h,072720072h + DD 044444400h,0b9b900b9h + DD 0cfcfcf00h,0f8f800f8h + DD 0b2b2b200h,0acac00ach + DD 0c3c3c300h,036360036h + DD 0b5b5b500h,02a2a002ah + DD 07a7a7a00h,03c3c003ch + DD 091919100h,0f1f100f1h + DD 024242400h,040400040h + DD 008080800h,0d3d300d3h + DD 0e8e8e800h,0bbbb00bbh + DD 0a8a8a800h,043430043h + DD 060606000h,015150015h + DD 0fcfcfc00h,0adad00adh + DD 069696900h,077770077h + DD 050505000h,080800080h + DD 0aaaaaa00h,082820082h + DD 0d0d0d000h,0ecec00ech + DD 0a0a0a000h,027270027h + DD 07d7d7d00h,0e5e500e5h + DD 0a1a1a100h,085850085h + DD 089898900h,035350035h + DD 062626200h,00c0c000ch + DD 097979700h,041410041h + DD 054545400h,0efef00efh + DD 05b5b5b00h,093930093h + DD 01e1e1e00h,019190019h + DD 095959500h,021210021h + DD 0e0e0e000h,00e0e000eh + DD 0ffffff00h,04e4e004eh + DD 064646400h,065650065h + DD 0d2d2d200h,0bdbd00bdh + DD 010101000h,0b8b800b8h + DD 0c4c4c400h,08f8f008fh + DD 000000000h,0ebeb00ebh + DD 048484800h,0cece00ceh + DD 0a3a3a300h,030300030h + DD 0f7f7f700h,05f5f005fh + DD 075757500h,0c5c500c5h + DD 0dbdbdb00h,01a1a001ah + DD 08a8a8a00h,0e1e100e1h + DD 003030300h,0caca00cah + DD 0e6e6e600h,047470047h + DD 0dadada00h,03d3d003dh + DD 009090900h,001010001h + DD 03f3f3f00h,0d6d600d6h + DD 0dddddd00h,056560056h + DD 094949400h,04d4d004dh + DD 087878700h,00d0d000dh + DD 05c5c5c00h,066660066h + DD 083838300h,0cccc00cch + DD 002020200h,02d2d002dh + DD 0cdcdcd00h,012120012h + DD 04a4a4a00h,020200020h + DD 090909000h,0b1b100b1h + DD 033333300h,099990099h + DD 073737300h,04c4c004ch + DD 067676700h,0c2c200c2h + DD 0f6f6f600h,07e7e007eh + DD 0f3f3f300h,005050005h + DD 09d9d9d00h,0b7b700b7h + DD 07f7f7f00h,031310031h + DD 0bfbfbf00h,017170017h + DD 0e2e2e200h,0d7d700d7h + DD 052525200h,058580058h + DD 09b9b9b00h,061610061h + DD 0d8d8d800h,01b1b001bh + DD 026262600h,01c1c001ch + DD 0c8c8c800h,00f0f000fh + DD 037373700h,016160016h + DD 0c6c6c600h,018180018h + DD 03b3b3b00h,022220022h + DD 081818100h,044440044h + DD 096969600h,0b2b200b2h + DD 06f6f6f00h,0b5b500b5h + DD 04b4b4b00h,091910091h + DD 013131300h,008080008h + DD 0bebebe00h,0a8a800a8h + DD 063636300h,0fcfc00fch + DD 02e2e2e00h,050500050h + DD 0e9e9e900h,0d0d000d0h + DD 079797900h,07d7d007dh + DD 0a7a7a700h,089890089h + DD 08c8c8c00h,097970097h + DD 09f9f9f00h,05b5b005bh + DD 06e6e6e00h,095950095h + DD 0bcbcbc00h,0ffff00ffh + DD 08e8e8e00h,0d2d200d2h + DD 029292900h,0c4c400c4h + DD 0f5f5f500h,048480048h + DD 0f9f9f900h,0f7f700f7h + DD 0b6b6b600h,0dbdb00dbh + DD 02f2f2f00h,003030003h + DD 0fdfdfd00h,0dada00dah + DD 0b4b4b400h,03f3f003fh + DD 059595900h,094940094h + DD 078787800h,05c5c005ch + DD 098989800h,002020002h + DD 006060600h,04a4a004ah + DD 06a6a6a00h,033330033h + DD 0e7e7e700h,067670067h + DD 046464600h,0f3f300f3h + DD 071717100h,07f7f007fh + DD 0bababa00h,0e2e200e2h + DD 0d4d4d400h,09b9b009bh + DD 025252500h,026260026h + DD 0ababab00h,037370037h + DD 042424200h,03b3b003bh + DD 088888800h,096960096h + DD 0a2a2a200h,04b4b004bh + DD 08d8d8d00h,0bebe00beh + DD 0fafafa00h,02e2e002eh + DD 072727200h,079790079h + DD 007070700h,08c8c008ch + DD 0b9b9b900h,06e6e006eh + DD 055555500h,08e8e008eh + DD 0f8f8f800h,0f5f500f5h + DD 0eeeeee00h,0b6b600b6h + DD 0acacac00h,0fdfd00fdh + DD 00a0a0a00h,059590059h + DD 036363600h,098980098h + DD 049494900h,06a6a006ah + DD 02a2a2a00h,046460046h + DD 068686800h,0baba00bah + DD 03c3c3c00h,025250025h + DD 038383800h,042420042h + DD 0f1f1f100h,0a2a200a2h + DD 0a4a4a400h,0fafa00fah + DD 040404000h,007070007h + DD 028282800h,055550055h + DD 0d3d3d300h,0eeee00eeh + DD 07b7b7b00h,00a0a000ah + DD 0bbbbbb00h,049490049h + DD 0c9c9c900h,068680068h + DD 043434300h,038380038h + DD 0c1c1c100h,0a4a400a4h + DD 015151500h,028280028h + DD 0e3e3e300h,07b7b007bh + DD 0adadad00h,0c9c900c9h + DD 0f4f4f400h,0c1c100c1h + DD 077777700h,0e3e300e3h + DD 0c7c7c700h,0f4f400f4h + DD 080808000h,0c7c700c7h + DD 09e9e9e00h,09e9e009eh + DD 000e0e0e0h,038003838h + DD 000050505h,041004141h + DD 000585858h,016001616h + DD 000d9d9d9h,076007676h + DD 000676767h,0d900d9d9h + DD 0004e4e4eh,093009393h + DD 000818181h,060006060h + DD 000cbcbcbh,0f200f2f2h + DD 000c9c9c9h,072007272h + DD 0000b0b0bh,0c200c2c2h + DD 000aeaeaeh,0ab00ababh + DD 0006a6a6ah,09a009a9ah + DD 000d5d5d5h,075007575h + DD 000181818h,006000606h + DD 0005d5d5dh,057005757h + DD 000828282h,0a000a0a0h + DD 000464646h,091009191h + DD 000dfdfdfh,0f700f7f7h + DD 000d6d6d6h,0b500b5b5h + DD 000272727h,0c900c9c9h + DD 0008a8a8ah,0a200a2a2h + DD 000323232h,08c008c8ch + DD 0004b4b4bh,0d200d2d2h + DD 000424242h,090009090h + DD 000dbdbdbh,0f600f6f6h + DD 0001c1c1ch,007000707h + DD 0009e9e9eh,0a700a7a7h + DD 0009c9c9ch,027002727h + DD 0003a3a3ah,08e008e8eh + DD 000cacacah,0b200b2b2h + DD 000252525h,049004949h + DD 0007b7b7bh,0de00dedeh + DD 0000d0d0dh,043004343h + DD 000717171h,05c005c5ch + DD 0005f5f5fh,0d700d7d7h + DD 0001f1f1fh,0c700c7c7h + DD 000f8f8f8h,03e003e3eh + DD 000d7d7d7h,0f500f5f5h + DD 0003e3e3eh,08f008f8fh + DD 0009d9d9dh,067006767h + DD 0007c7c7ch,01f001f1fh + DD 000606060h,018001818h + DD 000b9b9b9h,06e006e6eh + DD 000bebebeh,0af00afafh + DD 000bcbcbch,02f002f2fh + DD 0008b8b8bh,0e200e2e2h + DD 000161616h,085008585h + DD 000343434h,00d000d0dh + DD 0004d4d4dh,053005353h + DD 000c3c3c3h,0f000f0f0h + DD 000727272h,09c009c9ch + DD 000959595h,065006565h + DD 000abababh,0ea00eaeah + DD 0008e8e8eh,0a300a3a3h + DD 000bababah,0ae00aeaeh + DD 0007a7a7ah,09e009e9eh + DD 000b3b3b3h,0ec00ecech + DD 000020202h,080008080h + DD 000b4b4b4h,02d002d2dh + DD 000adadadh,06b006b6bh + DD 000a2a2a2h,0a800a8a8h + DD 000acacach,02b002b2bh + DD 000d8d8d8h,036003636h + DD 0009a9a9ah,0a600a6a6h + DD 000171717h,0c500c5c5h + DD 0001a1a1ah,086008686h + DD 000353535h,04d004d4dh + DD 000cccccch,033003333h + DD 000f7f7f7h,0fd00fdfdh + DD 000999999h,066006666h + DD 000616161h,058005858h + DD 0005a5a5ah,096009696h + DD 000e8e8e8h,03a003a3ah + DD 000242424h,009000909h + DD 000565656h,095009595h + DD 000404040h,010001010h + DD 000e1e1e1h,078007878h + DD 000636363h,0d800d8d8h + DD 000090909h,042004242h + DD 000333333h,0cc00cccch + DD 000bfbfbfh,0ef00efefh + DD 000989898h,026002626h + DD 000979797h,0e500e5e5h + DD 000858585h,061006161h + DD 000686868h,01a001a1ah + DD 000fcfcfch,03f003f3fh + DD 000ececech,03b003b3bh + DD 0000a0a0ah,082008282h + DD 000dadadah,0b600b6b6h + DD 0006f6f6fh,0db00dbdbh + DD 000535353h,0d400d4d4h + DD 000626262h,098009898h + DD 000a3a3a3h,0e800e8e8h + DD 0002e2e2eh,08b008b8bh + DD 000080808h,002000202h + DD 000afafafh,0eb00ebebh + DD 000282828h,00a000a0ah + DD 000b0b0b0h,02c002c2ch + DD 000747474h,01d001d1dh + DD 000c2c2c2h,0b000b0b0h + DD 000bdbdbdh,06f006f6fh + DD 000363636h,08d008d8dh + DD 000222222h,088008888h + DD 000383838h,00e000e0eh + DD 000646464h,019001919h + DD 0001e1e1eh,087008787h + DD 000393939h,04e004e4eh + DD 0002c2c2ch,00b000b0bh + DD 000a6a6a6h,0a900a9a9h + DD 000303030h,00c000c0ch + DD 000e5e5e5h,079007979h + DD 000444444h,011001111h + DD 000fdfdfdh,07f007f7fh + DD 000888888h,022002222h + DD 0009f9f9fh,0e700e7e7h + DD 000656565h,059005959h + DD 000878787h,0e100e1e1h + DD 0006b6b6bh,0da00dadah + DD 000f4f4f4h,03d003d3dh + DD 000232323h,0c800c8c8h + DD 000484848h,012001212h + DD 000101010h,004000404h + DD 000d1d1d1h,074007474h + DD 000515151h,054005454h + DD 000c0c0c0h,030003030h + DD 000f9f9f9h,07e007e7eh + DD 000d2d2d2h,0b400b4b4h + DD 000a0a0a0h,028002828h + DD 000555555h,055005555h + DD 000a1a1a1h,068006868h + DD 000414141h,050005050h + DD 000fafafah,0be00bebeh + DD 000434343h,0d000d0d0h + DD 000131313h,0c400c4c4h + DD 000c4c4c4h,031003131h + DD 0002f2f2fh,0cb00cbcbh + DD 000a8a8a8h,02a002a2ah + DD 000b6b6b6h,0ad00adadh + DD 0003c3c3ch,00f000f0fh + DD 0002b2b2bh,0ca00cacah + DD 000c1c1c1h,070007070h + DD 000ffffffh,0ff00ffffh + DD 000c8c8c8h,032003232h + DD 000a5a5a5h,069006969h + DD 000202020h,008000808h + DD 000898989h,062006262h + DD 000000000h,000000000h + DD 000909090h,024002424h + DD 000474747h,0d100d1d1h + DD 000efefefh,0fb00fbfbh + DD 000eaeaeah,0ba00babah + DD 000b7b7b7h,0ed00ededh + DD 000151515h,045004545h + DD 000060606h,081008181h + DD 000cdcdcdh,073007373h + DD 000b5b5b5h,06d006d6dh + DD 000121212h,084008484h + DD 0007e7e7eh,09f009f9fh + DD 000bbbbbbh,0ee00eeeeh + DD 000292929h,04a004a4ah + DD 0000f0f0fh,0c300c3c3h + DD 000b8b8b8h,02e002e2eh + DD 000070707h,0c100c1c1h + DD 000040404h,001000101h + DD 0009b9b9bh,0e600e6e6h + DD 000949494h,025002525h + DD 000212121h,048004848h + DD 000666666h,099009999h + DD 000e6e6e6h,0b900b9b9h + DD 000cececeh,0b300b3b3h + DD 000edededh,07b007b7bh + DD 000e7e7e7h,0f900f9f9h + DD 0003b3b3bh,0ce00ceceh + DD 000fefefeh,0bf00bfbfh + DD 0007f7f7fh,0df00dfdfh + DD 000c5c5c5h,071007171h + DD 000a4a4a4h,029002929h + DD 000373737h,0cd00cdcdh + DD 000b1b1b1h,06c006c6ch + DD 0004c4c4ch,013001313h + DD 000919191h,064006464h + DD 0006e6e6eh,09b009b9bh + DD 0008d8d8dh,063006363h + DD 000767676h,09d009d9dh + DD 000030303h,0c000c0c0h + DD 0002d2d2dh,04b004b4bh + DD 000dededeh,0b700b7b7h + DD 000969696h,0a500a5a5h + DD 000262626h,089008989h + DD 0007d7d7dh,05f005f5fh + DD 000c6c6c6h,0b100b1b1h + DD 0005c5c5ch,017001717h + DD 000d3d3d3h,0f400f4f4h + DD 000f2f2f2h,0bc00bcbch + DD 0004f4f4fh,0d300d3d3h + DD 000191919h,046004646h + DD 0003f3f3fh,0cf00cfcfh + DD 000dcdcdch,037003737h + DD 000797979h,05e005e5eh + DD 0001d1d1dh,047004747h + DD 000525252h,094009494h + DD 000ebebebh,0fa00fafah + DD 000f3f3f3h,0fc00fcfch + DD 0006d6d6dh,05b005b5bh + DD 0005e5e5eh,097009797h + DD 000fbfbfbh,0fe00fefeh + DD 000696969h,05a005a5ah + DD 000b2b2b2h,0ac00acach + DD 000f0f0f0h,03c003c3ch + DD 000313131h,04c004c4ch + DD 0000c0c0ch,003000303h + DD 000d4d4d4h,035003535h + DD 000cfcfcfh,0f300f3f3h + DD 0008c8c8ch,023002323h + DD 000e2e2e2h,0b800b8b8h + DD 000757575h,05d005d5dh + DD 000a9a9a9h,06a006a6ah + DD 0004a4a4ah,092009292h + DD 000575757h,0d500d5d5h + DD 000848484h,021002121h + DD 000111111h,044004444h + DD 000454545h,051005151h + DD 0001b1b1bh,0c600c6c6h + DD 000f5f5f5h,07d007d7dh + DD 000e4e4e4h,039003939h + DD 0000e0e0eh,083008383h + DD 000737373h,0dc00dcdch + DD 000aaaaaah,0aa00aaaah + DD 000f1f1f1h,07c007c7ch + DD 000ddddddh,077007777h + DD 000595959h,056005656h + DD 000141414h,005000505h + DD 0006c6c6ch,01b001b1bh + DD 000929292h,0a400a4a4h + DD 000545454h,015001515h + DD 000d0d0d0h,034003434h + DD 000787878h,01e001e1eh + DD 000707070h,01c001c1ch + DD 000e3e3e3h,0f800f8f8h + DD 000494949h,052005252h + DD 000808080h,020002020h + DD 000505050h,014001414h + DD 000a7a7a7h,0e900e9e9h + DD 000f6f6f6h,0bd00bdbdh + DD 000777777h,0dd00ddddh + DD 000939393h,0e400e4e4h + DD 000868686h,0a100a1a1h + DD 000838383h,0e000e0e0h + DD 0002a2a2ah,08a008a8ah + DD 000c7c7c7h,0f100f1f1h + DD 0005b5b5bh,0d600d6d6h + DD 000e9e9e9h,07a007a7ah + DD 000eeeeeeh,0bb00bbbbh + DD 0008f8f8fh,0e300e3e3h + DD 000010101h,040004040h + DD 0003d3d3dh,04f004f4fh +PUBLIC Camellia_cbc_encrypt + +ALIGN 16 +Camellia_cbc_encrypt PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_Camellia_cbc_encrypt:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + cmp rdx,0 + je $L$cbc_abort + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 +$L$cbc_prologue:: + + mov rbp,rsp + sub rsp,64 + and rsp,-64 + + + + lea r10,QWORD PTR[((-64-63))+rcx] + sub r10,rsp + neg r10 + and r10,03C0h + sub rsp,r10 + + + mov r12,rdi + mov r13,rsi + mov rbx,r8 + mov r14,rcx + mov r15d,DWORD PTR[272+rcx] + + mov QWORD PTR[40+rsp],r8 + mov QWORD PTR[48+rsp],rbp + +$L$cbc_body:: + lea rbp,QWORD PTR[$L$Camellia_SBOX] + + mov ecx,32 +ALIGN 4 +$L$cbc_prefetch_sbox:: + mov rax,QWORD PTR[rbp] + mov rsi,QWORD PTR[32+rbp] + mov rdi,QWORD PTR[64+rbp] + mov r11,QWORD PTR[96+rbp] + lea rbp,QWORD PTR[128+rbp] + loop $L$cbc_prefetch_sbox + sub rbp,4096 + shl r15,6 + mov rcx,rdx + lea r15,QWORD PTR[r15*1+r14] + + cmp r9d,0 + je $L$CBC_DECRYPT + + and rdx,-16 + and rcx,15 + lea rdx,QWORD PTR[rdx*1+r12] + mov QWORD PTR[rsp],r14 + mov QWORD PTR[8+rsp],rdx + mov QWORD PTR[16+rsp],rcx + + cmp rdx,r12 + mov r8d,DWORD PTR[rbx] + mov r9d,DWORD PTR[4+rbx] + mov r10d,DWORD PTR[8+rbx] + mov r11d,DWORD PTR[12+rbx] + je $L$cbc_enc_tail + jmp $L$cbc_eloop + +ALIGN 16 +$L$cbc_eloop:: + xor r8d,DWORD PTR[r12] + xor r9d,DWORD PTR[4+r12] + xor r10d,DWORD PTR[8+r12] + bswap r8d + xor r11d,DWORD PTR[12+r12] + bswap r9d + bswap r10d + bswap r11d + + call _x86_64_Camellia_encrypt + + mov r14,QWORD PTR[rsp] + bswap r8d + mov rdx,QWORD PTR[8+rsp] + bswap r9d + mov rcx,QWORD PTR[16+rsp] + bswap r10d + mov DWORD PTR[r13],r8d + bswap r11d + mov DWORD PTR[4+r13],r9d + mov DWORD PTR[8+r13],r10d + lea r12,QWORD PTR[16+r12] + mov DWORD PTR[12+r13],r11d + cmp r12,rdx + lea r13,QWORD PTR[16+r13] + jne $L$cbc_eloop + + cmp rcx,0 + jne $L$cbc_enc_tail + + mov r13,QWORD PTR[40+rsp] + mov DWORD PTR[r13],r8d + mov DWORD PTR[4+r13],r9d + mov DWORD PTR[8+r13],r10d + mov DWORD PTR[12+r13],r11d + jmp $L$cbc_done + +ALIGN 16 +$L$cbc_enc_tail:: + xor rax,rax + mov QWORD PTR[((0+24))+rsp],rax + mov QWORD PTR[((8+24))+rsp],rax + mov QWORD PTR[16+rsp],rax + +$L$cbc_enc_pushf:: + pushfq + cld + mov rsi,r12 + lea rdi,QWORD PTR[((8+24))+rsp] + DD 09066A4F3h + popfq +$L$cbc_enc_popf:: + + lea r12,QWORD PTR[24+rsp] + lea rax,QWORD PTR[((16+24))+rsp] + mov QWORD PTR[8+rsp],rax + jmp $L$cbc_eloop + +ALIGN 16 +$L$CBC_DECRYPT:: + xchg r15,r14 + add rdx,15 + and rcx,15 + and rdx,-16 + mov QWORD PTR[rsp],r14 + lea rdx,QWORD PTR[rdx*1+r12] + mov QWORD PTR[8+rsp],rdx + mov QWORD PTR[16+rsp],rcx + + mov rax,QWORD PTR[rbx] + mov rbx,QWORD PTR[8+rbx] + jmp $L$cbc_dloop +ALIGN 16 +$L$cbc_dloop:: + mov r8d,DWORD PTR[r12] + mov r9d,DWORD PTR[4+r12] + mov r10d,DWORD PTR[8+r12] + bswap r8d + mov r11d,DWORD PTR[12+r12] + bswap r9d + mov QWORD PTR[((0+24))+rsp],rax + bswap r10d + mov QWORD PTR[((8+24))+rsp],rbx + bswap r11d + + call _x86_64_Camellia_decrypt + + mov r14,QWORD PTR[rsp] + mov rdx,QWORD PTR[8+rsp] + mov rcx,QWORD PTR[16+rsp] + + bswap r8d + mov rax,QWORD PTR[r12] + bswap r9d + mov rbx,QWORD PTR[8+r12] + bswap r10d + xor r8d,DWORD PTR[((0+24))+rsp] + bswap r11d + xor r9d,DWORD PTR[((4+24))+rsp] + xor r10d,DWORD PTR[((8+24))+rsp] + lea r12,QWORD PTR[16+r12] + xor r11d,DWORD PTR[((12+24))+rsp] + cmp r12,rdx + je $L$cbc_ddone + + mov DWORD PTR[r13],r8d + mov DWORD PTR[4+r13],r9d + mov DWORD PTR[8+r13],r10d + mov DWORD PTR[12+r13],r11d + + lea r13,QWORD PTR[16+r13] + jmp $L$cbc_dloop + +ALIGN 16 +$L$cbc_ddone:: + mov rdx,QWORD PTR[40+rsp] + cmp rcx,0 + jne $L$cbc_dec_tail + + mov DWORD PTR[r13],r8d + mov DWORD PTR[4+r13],r9d + mov DWORD PTR[8+r13],r10d + mov DWORD PTR[12+r13],r11d + + mov QWORD PTR[rdx],rax + mov QWORD PTR[8+rdx],rbx + jmp $L$cbc_done +ALIGN 16 +$L$cbc_dec_tail:: + mov DWORD PTR[((0+24))+rsp],r8d + mov DWORD PTR[((4+24))+rsp],r9d + mov DWORD PTR[((8+24))+rsp],r10d + mov DWORD PTR[((12+24))+rsp],r11d + +$L$cbc_dec_pushf:: + pushfq + cld + lea rsi,QWORD PTR[((8+24))+rsp] + lea rdi,QWORD PTR[r13] + DD 09066A4F3h + popfq +$L$cbc_dec_popf:: + + mov QWORD PTR[rdx],rax + mov QWORD PTR[8+rdx],rbx + jmp $L$cbc_done + +ALIGN 16 +$L$cbc_done:: + mov rcx,QWORD PTR[48+rsp] + mov r15,QWORD PTR[rcx] + mov r14,QWORD PTR[8+rcx] + mov r13,QWORD PTR[16+rcx] + mov r12,QWORD PTR[24+rcx] + mov rbp,QWORD PTR[32+rcx] + mov rbx,QWORD PTR[40+rcx] + lea rsp,QWORD PTR[48+rcx] +$L$cbc_abort:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_Camellia_cbc_encrypt:: +Camellia_cbc_encrypt ENDP + +DB 67,97,109,101,108,108,105,97,32,102,111,114,32,120,56,54 +DB 95,54,52,32,98,121,32,60,97,112,112,114,111,64,111,112 +DB 101,110,115,115,108,46,111,114,103,62,0 + +.text$ ENDS +END diff --git a/crypto/camellia/cmll-mingw64-x86_64.S b/crypto/camellia/cmll-mingw64-x86_64.S new file mode 100644 index 00000000..75966f43 --- /dev/null +++ b/crypto/camellia/cmll-mingw64-x86_64.S @@ -0,0 +1,1884 @@ +#include "x86_arch.h" +.text + + +.globl Camellia_EncryptBlock +.def Camellia_EncryptBlock; .scl 2; .type 32; .endef +.p2align 4 +Camellia_EncryptBlock: + movl $128,%eax + subl %edi,%eax + movl $3,%edi + adcl $0,%edi + jmp .Lenc_rounds + + +.globl Camellia_EncryptBlock_Rounds +.def Camellia_EncryptBlock_Rounds; .scl 2; .type 32; .endef +.p2align 4 +.Lenc_rounds: +Camellia_EncryptBlock_Rounds: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_Camellia_EncryptBlock_Rounds: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + + pushq %rbx + pushq %rbp + pushq %r13 + pushq %r14 + pushq %r15 +.Lenc_prologue: + + + movq %rcx,%r13 + movq %rdx,%r14 + + shll $6,%edi + leaq .LCamellia_SBOX(%rip),%rbp + leaq (%r14,%rdi,1),%r15 + + movl 0(%rsi),%r8d + movl 4(%rsi),%r9d + movl 8(%rsi),%r10d + bswapl %r8d + movl 12(%rsi),%r11d + bswapl %r9d + bswapl %r10d + bswapl %r11d + + call _x86_64_Camellia_encrypt + + bswapl %r8d + bswapl %r9d + bswapl %r10d + movl %r8d,0(%r13) + bswapl %r11d + movl %r9d,4(%r13) + movl %r10d,8(%r13) + movl %r11d,12(%r13) + + movq 0(%rsp),%r15 + movq 8(%rsp),%r14 + movq 16(%rsp),%r13 + movq 24(%rsp),%rbp + movq 32(%rsp),%rbx + leaq 40(%rsp),%rsp +.Lenc_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_Camellia_EncryptBlock_Rounds: + +.def _x86_64_Camellia_encrypt; .scl 3; .type 32; .endef +.p2align 4 +_x86_64_Camellia_encrypt: + xorl 0(%r14),%r9d + xorl 4(%r14),%r8d + xorl 8(%r14),%r11d + xorl 12(%r14),%r10d +.p2align 4 +.Leloop: + movl 16(%r14),%ebx + movl 20(%r14),%eax + + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 24(%r14),%ebx + movl 28(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 32(%r14),%ebx + movl 36(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 40(%r14),%ebx + movl 44(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 48(%r14),%ebx + movl 52(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 56(%r14),%ebx + movl 60(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 64(%r14),%ebx + movl 68(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + leaq 64(%r14),%r14 + cmpq %r15,%r14 + movl 8(%r14),%edx + movl 12(%r14),%ecx + je .Ledone + + andl %r8d,%eax + orl %r11d,%edx + roll $1,%eax + xorl %edx,%r10d + xorl %eax,%r9d + andl %r10d,%ecx + orl %r9d,%ebx + roll $1,%ecx + xorl %ebx,%r8d + xorl %ecx,%r11d + jmp .Leloop + +.p2align 4 +.Ledone: + xorl %r10d,%eax + xorl %r11d,%ebx + xorl %r8d,%ecx + xorl %r9d,%edx + + movl %eax,%r8d + movl %ebx,%r9d + movl %ecx,%r10d + movl %edx,%r11d + + retq + + + +.globl Camellia_DecryptBlock +.def Camellia_DecryptBlock; .scl 2; .type 32; .endef +.p2align 4 +Camellia_DecryptBlock: + movl $128,%eax + subl %edi,%eax + movl $3,%edi + adcl $0,%edi + jmp .Ldec_rounds + + +.globl Camellia_DecryptBlock_Rounds +.def Camellia_DecryptBlock_Rounds; .scl 2; .type 32; .endef +.p2align 4 +.Ldec_rounds: +Camellia_DecryptBlock_Rounds: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_Camellia_DecryptBlock_Rounds: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + + pushq %rbx + pushq %rbp + pushq %r13 + pushq %r14 + pushq %r15 +.Ldec_prologue: + + + movq %rcx,%r13 + movq %rdx,%r15 + + shll $6,%edi + leaq .LCamellia_SBOX(%rip),%rbp + leaq (%r15,%rdi,1),%r14 + + movl 0(%rsi),%r8d + movl 4(%rsi),%r9d + movl 8(%rsi),%r10d + bswapl %r8d + movl 12(%rsi),%r11d + bswapl %r9d + bswapl %r10d + bswapl %r11d + + call _x86_64_Camellia_decrypt + + bswapl %r8d + bswapl %r9d + bswapl %r10d + movl %r8d,0(%r13) + bswapl %r11d + movl %r9d,4(%r13) + movl %r10d,8(%r13) + movl %r11d,12(%r13) + + movq 0(%rsp),%r15 + movq 8(%rsp),%r14 + movq 16(%rsp),%r13 + movq 24(%rsp),%rbp + movq 32(%rsp),%rbx + leaq 40(%rsp),%rsp +.Ldec_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_Camellia_DecryptBlock_Rounds: + +.def _x86_64_Camellia_decrypt; .scl 3; .type 32; .endef +.p2align 4 +_x86_64_Camellia_decrypt: + xorl 0(%r14),%r9d + xorl 4(%r14),%r8d + xorl 8(%r14),%r11d + xorl 12(%r14),%r10d +.p2align 4 +.Ldloop: + movl -8(%r14),%ebx + movl -4(%r14),%eax + + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -16(%r14),%ebx + movl -12(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -24(%r14),%ebx + movl -20(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -32(%r14),%ebx + movl -28(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -40(%r14),%ebx + movl -36(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -48(%r14),%ebx + movl -44(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl -56(%r14),%ebx + movl -52(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + leaq -64(%r14),%r14 + cmpq %r15,%r14 + movl 0(%r14),%edx + movl 4(%r14),%ecx + je .Lddone + + andl %r8d,%eax + orl %r11d,%edx + roll $1,%eax + xorl %edx,%r10d + xorl %eax,%r9d + andl %r10d,%ecx + orl %r9d,%ebx + roll $1,%ecx + xorl %ebx,%r8d + xorl %ecx,%r11d + + jmp .Ldloop + +.p2align 4 +.Lddone: + xorl %r10d,%ecx + xorl %r11d,%edx + xorl %r8d,%eax + xorl %r9d,%ebx + + movl %ecx,%r8d + movl %edx,%r9d + movl %eax,%r10d + movl %ebx,%r11d + + retq + +.globl Camellia_Ekeygen +.def Camellia_Ekeygen; .scl 2; .type 32; .endef +.p2align 4 +Camellia_Ekeygen: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_Camellia_Ekeygen: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + pushq %rbx + pushq %rbp + pushq %r13 + pushq %r14 + pushq %r15 +.Lkey_prologue: + + movq %rdi,%r15 + movq %rdx,%r13 + + movl 0(%rsi),%r8d + movl 4(%rsi),%r9d + movl 8(%rsi),%r10d + movl 12(%rsi),%r11d + + bswapl %r8d + bswapl %r9d + bswapl %r10d + bswapl %r11d + movl %r9d,0(%r13) + movl %r8d,4(%r13) + movl %r11d,8(%r13) + movl %r10d,12(%r13) + cmpq $128,%r15 + je .L1st128 + + movl 16(%rsi),%r8d + movl 20(%rsi),%r9d + cmpq $192,%r15 + je .L1st192 + movl 24(%rsi),%r10d + movl 28(%rsi),%r11d + jmp .L1st256 +.L1st192: + movl %r8d,%r10d + movl %r9d,%r11d + notl %r10d + notl %r11d +.L1st256: + bswapl %r8d + bswapl %r9d + bswapl %r10d + bswapl %r11d + movl %r9d,32(%r13) + movl %r8d,36(%r13) + movl %r11d,40(%r13) + movl %r10d,44(%r13) + xorl 0(%r13),%r9d + xorl 4(%r13),%r8d + xorl 8(%r13),%r11d + xorl 12(%r13),%r10d + +.L1st128: + leaq .LCamellia_SIGMA(%rip),%r14 + leaq .LCamellia_SBOX(%rip),%rbp + + movl 0(%r14),%ebx + movl 4(%r14),%eax + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 8(%r14),%ebx + movl 12(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 16(%r14),%ebx + movl 20(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + xorl 0(%r13),%r9d + xorl 4(%r13),%r8d + xorl 8(%r13),%r11d + xorl 12(%r13),%r10d + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 24(%r14),%ebx + movl 28(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 32(%r14),%ebx + movl 36(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + cmpq $128,%r15 + jne .L2nd256 + + leaq 128(%r13),%r13 + shlq $32,%r8 + shlq $32,%r10 + orq %r9,%r8 + orq %r11,%r10 + movq -128(%r13),%rax + movq -120(%r13),%rbx + movq %r8,-112(%r13) + movq %r10,-104(%r13) + movq %rax,%r11 + shlq $15,%rax + movq %rbx,%r9 + shrq $49,%r9 + shrq $49,%r11 + orq %r9,%rax + shlq $15,%rbx + orq %r11,%rbx + movq %rax,-96(%r13) + movq %rbx,-88(%r13) + movq %r8,%r11 + shlq $15,%r8 + movq %r10,%r9 + shrq $49,%r9 + shrq $49,%r11 + orq %r9,%r8 + shlq $15,%r10 + orq %r11,%r10 + movq %r8,-80(%r13) + movq %r10,-72(%r13) + movq %r8,%r11 + shlq $15,%r8 + movq %r10,%r9 + shrq $49,%r9 + shrq $49,%r11 + orq %r9,%r8 + shlq $15,%r10 + orq %r11,%r10 + movq %r8,-64(%r13) + movq %r10,-56(%r13) + movq %rax,%r11 + shlq $30,%rax + movq %rbx,%r9 + shrq $34,%r9 + shrq $34,%r11 + orq %r9,%rax + shlq $30,%rbx + orq %r11,%rbx + movq %rax,-48(%r13) + movq %rbx,-40(%r13) + movq %r8,%r11 + shlq $15,%r8 + movq %r10,%r9 + shrq $49,%r9 + shrq $49,%r11 + orq %r9,%r8 + shlq $15,%r10 + orq %r11,%r10 + movq %r8,-32(%r13) + movq %rax,%r11 + shlq $15,%rax + movq %rbx,%r9 + shrq $49,%r9 + shrq $49,%r11 + orq %r9,%rax + shlq $15,%rbx + orq %r11,%rbx + movq %rbx,-24(%r13) + movq %r8,%r11 + shlq $15,%r8 + movq %r10,%r9 + shrq $49,%r9 + shrq $49,%r11 + orq %r9,%r8 + shlq $15,%r10 + orq %r11,%r10 + movq %r8,-16(%r13) + movq %r10,-8(%r13) + movq %rax,%r11 + shlq $17,%rax + movq %rbx,%r9 + shrq $47,%r9 + shrq $47,%r11 + orq %r9,%rax + shlq $17,%rbx + orq %r11,%rbx + movq %rax,0(%r13) + movq %rbx,8(%r13) + movq %rax,%r11 + shlq $17,%rax + movq %rbx,%r9 + shrq $47,%r9 + shrq $47,%r11 + orq %r9,%rax + shlq $17,%rbx + orq %r11,%rbx + movq %rax,16(%r13) + movq %rbx,24(%r13) + movq %r8,%r11 + shlq $34,%r8 + movq %r10,%r9 + shrq $30,%r9 + shrq $30,%r11 + orq %r9,%r8 + shlq $34,%r10 + orq %r11,%r10 + movq %r8,32(%r13) + movq %r10,40(%r13) + movq %rax,%r11 + shlq $17,%rax + movq %rbx,%r9 + shrq $47,%r9 + shrq $47,%r11 + orq %r9,%rax + shlq $17,%rbx + orq %r11,%rbx + movq %rax,48(%r13) + movq %rbx,56(%r13) + movq %r8,%r11 + shlq $17,%r8 + movq %r10,%r9 + shrq $47,%r9 + shrq $47,%r11 + orq %r9,%r8 + shlq $17,%r10 + orq %r11,%r10 + movq %r8,64(%r13) + movq %r10,72(%r13) + movl $3,%eax + jmp .Ldone +.p2align 4 +.L2nd256: + movl %r9d,48(%r13) + movl %r8d,52(%r13) + movl %r11d,56(%r13) + movl %r10d,60(%r13) + xorl 32(%r13),%r9d + xorl 36(%r13),%r8d + xorl 40(%r13),%r11d + xorl 44(%r13),%r10d + xorl %r8d,%eax + xorl %r9d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 40(%r14),%ebx + movl 44(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r10d + xorl %ecx,%r11d + xorl %edx,%r11d + xorl %r10d,%eax + xorl %r11d,%ebx + movzbl %ah,%esi + movzbl %bl,%edi + movl 2052(%rbp,%rsi,8),%edx + movl 0(%rbp,%rdi,8),%ecx + movzbl %al,%esi + shrl $16,%eax + movzbl %bh,%edi + xorl 4(%rbp,%rsi,8),%edx + shrl $16,%ebx + xorl 4(%rbp,%rdi,8),%ecx + movzbl %ah,%esi + movzbl %bl,%edi + xorl 0(%rbp,%rsi,8),%edx + xorl 2052(%rbp,%rdi,8),%ecx + movzbl %al,%esi + movzbl %bh,%edi + xorl 2048(%rbp,%rsi,8),%edx + xorl 2048(%rbp,%rdi,8),%ecx + movl 48(%r14),%ebx + movl 52(%r14),%eax + xorl %edx,%ecx + rorl $8,%edx + xorl %ecx,%r8d + xorl %ecx,%r9d + xorl %edx,%r9d + movq 0(%r13),%rax + movq 8(%r13),%rbx + movq 32(%r13),%rcx + movq 40(%r13),%rdx + movq 48(%r13),%r14 + movq 56(%r13),%r15 + leaq 128(%r13),%r13 + shlq $32,%r8 + shlq $32,%r10 + orq %r9,%r8 + orq %r11,%r10 + movq %r8,-112(%r13) + movq %r10,-104(%r13) + movq %rcx,%r11 + shlq $15,%rcx + movq %rdx,%r9 + shrq $49,%r9 + shrq $49,%r11 + orq %r9,%rcx + shlq $15,%rdx + orq %r11,%rdx + movq %rcx,-96(%r13) + movq %rdx,-88(%r13) + movq %r14,%r11 + shlq $15,%r14 + movq %r15,%r9 + shrq $49,%r9 + shrq $49,%r11 + orq %r9,%r14 + shlq $15,%r15 + orq %r11,%r15 + movq %r14,-80(%r13) + movq %r15,-72(%r13) + movq %rcx,%r11 + shlq $15,%rcx + movq %rdx,%r9 + shrq $49,%r9 + shrq $49,%r11 + orq %r9,%rcx + shlq $15,%rdx + orq %r11,%rdx + movq %rcx,-64(%r13) + movq %rdx,-56(%r13) + movq %r8,%r11 + shlq $30,%r8 + movq %r10,%r9 + shrq $34,%r9 + shrq $34,%r11 + orq %r9,%r8 + shlq $30,%r10 + orq %r11,%r10 + movq %r8,-48(%r13) + movq %r10,-40(%r13) + movq %rax,%r11 + shlq $45,%rax + movq %rbx,%r9 + shrq $19,%r9 + shrq $19,%r11 + orq %r9,%rax + shlq $45,%rbx + orq %r11,%rbx + movq %rax,-32(%r13) + movq %rbx,-24(%r13) + movq %r14,%r11 + shlq $30,%r14 + movq %r15,%r9 + shrq $34,%r9 + shrq $34,%r11 + orq %r9,%r14 + shlq $30,%r15 + orq %r11,%r15 + movq %r14,-16(%r13) + movq %r15,-8(%r13) + movq %rax,%r11 + shlq $15,%rax + movq %rbx,%r9 + shrq $49,%r9 + shrq $49,%r11 + orq %r9,%rax + shlq $15,%rbx + orq %r11,%rbx + movq %rax,0(%r13) + movq %rbx,8(%r13) + movq %rcx,%r11 + shlq $30,%rcx + movq %rdx,%r9 + shrq $34,%r9 + shrq $34,%r11 + orq %r9,%rcx + shlq $30,%rdx + orq %r11,%rdx + movq %rcx,16(%r13) + movq %rdx,24(%r13) + movq %r8,%r11 + shlq $30,%r8 + movq %r10,%r9 + shrq $34,%r9 + shrq $34,%r11 + orq %r9,%r8 + shlq $30,%r10 + orq %r11,%r10 + movq %r8,32(%r13) + movq %r10,40(%r13) + movq %rax,%r11 + shlq $17,%rax + movq %rbx,%r9 + shrq $47,%r9 + shrq $47,%r11 + orq %r9,%rax + shlq $17,%rbx + orq %r11,%rbx + movq %rax,48(%r13) + movq %rbx,56(%r13) + movq %r14,%r11 + shlq $32,%r14 + movq %r15,%r9 + shrq $32,%r9 + shrq $32,%r11 + orq %r9,%r14 + shlq $32,%r15 + orq %r11,%r15 + movq %r14,64(%r13) + movq %r15,72(%r13) + movq %rcx,%r11 + shlq $34,%rcx + movq %rdx,%r9 + shrq $30,%r9 + shrq $30,%r11 + orq %r9,%rcx + shlq $34,%rdx + orq %r11,%rdx + movq %rcx,80(%r13) + movq %rdx,88(%r13) + movq %r14,%r11 + shlq $17,%r14 + movq %r15,%r9 + shrq $47,%r9 + shrq $47,%r11 + orq %r9,%r14 + shlq $17,%r15 + orq %r11,%r15 + movq %r14,96(%r13) + movq %r15,104(%r13) + movq %rax,%r11 + shlq $34,%rax + movq %rbx,%r9 + shrq $30,%r9 + shrq $30,%r11 + orq %r9,%rax + shlq $34,%rbx + orq %r11,%rbx + movq %rax,112(%r13) + movq %rbx,120(%r13) + movq %r8,%r11 + shlq $51,%r8 + movq %r10,%r9 + shrq $13,%r9 + shrq $13,%r11 + orq %r9,%r8 + shlq $51,%r10 + orq %r11,%r10 + movq %r8,128(%r13) + movq %r10,136(%r13) + movl $4,%eax +.Ldone: + movq 0(%rsp),%r15 + movq 8(%rsp),%r14 + movq 16(%rsp),%r13 + movq 24(%rsp),%rbp + movq 32(%rsp),%rbx + leaq 40(%rsp),%rsp +.Lkey_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_Camellia_Ekeygen: +.p2align 6 +.LCamellia_SIGMA: +.long 0x3bcc908b, 0xa09e667f, 0x4caa73b2, 0xb67ae858 +.long 0xe94f82be, 0xc6ef372f, 0xf1d36f1c, 0x54ff53a5 +.long 0xde682d1d, 0x10e527fa, 0xb3e6c1fd, 0xb05688c2 +.long 0, 0, 0, 0 +.LCamellia_SBOX: +.long 0x70707000,0x70700070 +.long 0x82828200,0x2c2c002c +.long 0x2c2c2c00,0xb3b300b3 +.long 0xececec00,0xc0c000c0 +.long 0xb3b3b300,0xe4e400e4 +.long 0x27272700,0x57570057 +.long 0xc0c0c000,0xeaea00ea +.long 0xe5e5e500,0xaeae00ae +.long 0xe4e4e400,0x23230023 +.long 0x85858500,0x6b6b006b +.long 0x57575700,0x45450045 +.long 0x35353500,0xa5a500a5 +.long 0xeaeaea00,0xeded00ed +.long 0x0c0c0c00,0x4f4f004f +.long 0xaeaeae00,0x1d1d001d +.long 0x41414100,0x92920092 +.long 0x23232300,0x86860086 +.long 0xefefef00,0xafaf00af +.long 0x6b6b6b00,0x7c7c007c +.long 0x93939300,0x1f1f001f +.long 0x45454500,0x3e3e003e +.long 0x19191900,0xdcdc00dc +.long 0xa5a5a500,0x5e5e005e +.long 0x21212100,0x0b0b000b +.long 0xededed00,0xa6a600a6 +.long 0x0e0e0e00,0x39390039 +.long 0x4f4f4f00,0xd5d500d5 +.long 0x4e4e4e00,0x5d5d005d +.long 0x1d1d1d00,0xd9d900d9 +.long 0x65656500,0x5a5a005a +.long 0x92929200,0x51510051 +.long 0xbdbdbd00,0x6c6c006c +.long 0x86868600,0x8b8b008b +.long 0xb8b8b800,0x9a9a009a +.long 0xafafaf00,0xfbfb00fb +.long 0x8f8f8f00,0xb0b000b0 +.long 0x7c7c7c00,0x74740074 +.long 0xebebeb00,0x2b2b002b +.long 0x1f1f1f00,0xf0f000f0 +.long 0xcecece00,0x84840084 +.long 0x3e3e3e00,0xdfdf00df +.long 0x30303000,0xcbcb00cb +.long 0xdcdcdc00,0x34340034 +.long 0x5f5f5f00,0x76760076 +.long 0x5e5e5e00,0x6d6d006d +.long 0xc5c5c500,0xa9a900a9 +.long 0x0b0b0b00,0xd1d100d1 +.long 0x1a1a1a00,0x04040004 +.long 0xa6a6a600,0x14140014 +.long 0xe1e1e100,0x3a3a003a +.long 0x39393900,0xdede00de +.long 0xcacaca00,0x11110011 +.long 0xd5d5d500,0x32320032 +.long 0x47474700,0x9c9c009c +.long 0x5d5d5d00,0x53530053 +.long 0x3d3d3d00,0xf2f200f2 +.long 0xd9d9d900,0xfefe00fe +.long 0x01010100,0xcfcf00cf +.long 0x5a5a5a00,0xc3c300c3 +.long 0xd6d6d600,0x7a7a007a +.long 0x51515100,0x24240024 +.long 0x56565600,0xe8e800e8 +.long 0x6c6c6c00,0x60600060 +.long 0x4d4d4d00,0x69690069 +.long 0x8b8b8b00,0xaaaa00aa +.long 0x0d0d0d00,0xa0a000a0 +.long 0x9a9a9a00,0xa1a100a1 +.long 0x66666600,0x62620062 +.long 0xfbfbfb00,0x54540054 +.long 0xcccccc00,0x1e1e001e +.long 0xb0b0b000,0xe0e000e0 +.long 0x2d2d2d00,0x64640064 +.long 0x74747400,0x10100010 +.long 0x12121200,0x00000000 +.long 0x2b2b2b00,0xa3a300a3 +.long 0x20202000,0x75750075 +.long 0xf0f0f000,0x8a8a008a +.long 0xb1b1b100,0xe6e600e6 +.long 0x84848400,0x09090009 +.long 0x99999900,0xdddd00dd +.long 0xdfdfdf00,0x87870087 +.long 0x4c4c4c00,0x83830083 +.long 0xcbcbcb00,0xcdcd00cd +.long 0xc2c2c200,0x90900090 +.long 0x34343400,0x73730073 +.long 0x7e7e7e00,0xf6f600f6 +.long 0x76767600,0x9d9d009d +.long 0x05050500,0xbfbf00bf +.long 0x6d6d6d00,0x52520052 +.long 0xb7b7b700,0xd8d800d8 +.long 0xa9a9a900,0xc8c800c8 +.long 0x31313100,0xc6c600c6 +.long 0xd1d1d100,0x81810081 +.long 0x17171700,0x6f6f006f +.long 0x04040400,0x13130013 +.long 0xd7d7d700,0x63630063 +.long 0x14141400,0xe9e900e9 +.long 0x58585800,0xa7a700a7 +.long 0x3a3a3a00,0x9f9f009f +.long 0x61616100,0xbcbc00bc +.long 0xdedede00,0x29290029 +.long 0x1b1b1b00,0xf9f900f9 +.long 0x11111100,0x2f2f002f +.long 0x1c1c1c00,0xb4b400b4 +.long 0x32323200,0x78780078 +.long 0x0f0f0f00,0x06060006 +.long 0x9c9c9c00,0xe7e700e7 +.long 0x16161600,0x71710071 +.long 0x53535300,0xd4d400d4 +.long 0x18181800,0xabab00ab +.long 0xf2f2f200,0x88880088 +.long 0x22222200,0x8d8d008d +.long 0xfefefe00,0x72720072 +.long 0x44444400,0xb9b900b9 +.long 0xcfcfcf00,0xf8f800f8 +.long 0xb2b2b200,0xacac00ac +.long 0xc3c3c300,0x36360036 +.long 0xb5b5b500,0x2a2a002a +.long 0x7a7a7a00,0x3c3c003c +.long 0x91919100,0xf1f100f1 +.long 0x24242400,0x40400040 +.long 0x08080800,0xd3d300d3 +.long 0xe8e8e800,0xbbbb00bb +.long 0xa8a8a800,0x43430043 +.long 0x60606000,0x15150015 +.long 0xfcfcfc00,0xadad00ad +.long 0x69696900,0x77770077 +.long 0x50505000,0x80800080 +.long 0xaaaaaa00,0x82820082 +.long 0xd0d0d000,0xecec00ec +.long 0xa0a0a000,0x27270027 +.long 0x7d7d7d00,0xe5e500e5 +.long 0xa1a1a100,0x85850085 +.long 0x89898900,0x35350035 +.long 0x62626200,0x0c0c000c +.long 0x97979700,0x41410041 +.long 0x54545400,0xefef00ef +.long 0x5b5b5b00,0x93930093 +.long 0x1e1e1e00,0x19190019 +.long 0x95959500,0x21210021 +.long 0xe0e0e000,0x0e0e000e +.long 0xffffff00,0x4e4e004e +.long 0x64646400,0x65650065 +.long 0xd2d2d200,0xbdbd00bd +.long 0x10101000,0xb8b800b8 +.long 0xc4c4c400,0x8f8f008f +.long 0x00000000,0xebeb00eb +.long 0x48484800,0xcece00ce +.long 0xa3a3a300,0x30300030 +.long 0xf7f7f700,0x5f5f005f +.long 0x75757500,0xc5c500c5 +.long 0xdbdbdb00,0x1a1a001a +.long 0x8a8a8a00,0xe1e100e1 +.long 0x03030300,0xcaca00ca +.long 0xe6e6e600,0x47470047 +.long 0xdadada00,0x3d3d003d +.long 0x09090900,0x01010001 +.long 0x3f3f3f00,0xd6d600d6 +.long 0xdddddd00,0x56560056 +.long 0x94949400,0x4d4d004d +.long 0x87878700,0x0d0d000d +.long 0x5c5c5c00,0x66660066 +.long 0x83838300,0xcccc00cc +.long 0x02020200,0x2d2d002d +.long 0xcdcdcd00,0x12120012 +.long 0x4a4a4a00,0x20200020 +.long 0x90909000,0xb1b100b1 +.long 0x33333300,0x99990099 +.long 0x73737300,0x4c4c004c +.long 0x67676700,0xc2c200c2 +.long 0xf6f6f600,0x7e7e007e +.long 0xf3f3f300,0x05050005 +.long 0x9d9d9d00,0xb7b700b7 +.long 0x7f7f7f00,0x31310031 +.long 0xbfbfbf00,0x17170017 +.long 0xe2e2e200,0xd7d700d7 +.long 0x52525200,0x58580058 +.long 0x9b9b9b00,0x61610061 +.long 0xd8d8d800,0x1b1b001b +.long 0x26262600,0x1c1c001c +.long 0xc8c8c800,0x0f0f000f +.long 0x37373700,0x16160016 +.long 0xc6c6c600,0x18180018 +.long 0x3b3b3b00,0x22220022 +.long 0x81818100,0x44440044 +.long 0x96969600,0xb2b200b2 +.long 0x6f6f6f00,0xb5b500b5 +.long 0x4b4b4b00,0x91910091 +.long 0x13131300,0x08080008 +.long 0xbebebe00,0xa8a800a8 +.long 0x63636300,0xfcfc00fc +.long 0x2e2e2e00,0x50500050 +.long 0xe9e9e900,0xd0d000d0 +.long 0x79797900,0x7d7d007d +.long 0xa7a7a700,0x89890089 +.long 0x8c8c8c00,0x97970097 +.long 0x9f9f9f00,0x5b5b005b +.long 0x6e6e6e00,0x95950095 +.long 0xbcbcbc00,0xffff00ff +.long 0x8e8e8e00,0xd2d200d2 +.long 0x29292900,0xc4c400c4 +.long 0xf5f5f500,0x48480048 +.long 0xf9f9f900,0xf7f700f7 +.long 0xb6b6b600,0xdbdb00db +.long 0x2f2f2f00,0x03030003 +.long 0xfdfdfd00,0xdada00da +.long 0xb4b4b400,0x3f3f003f +.long 0x59595900,0x94940094 +.long 0x78787800,0x5c5c005c +.long 0x98989800,0x02020002 +.long 0x06060600,0x4a4a004a +.long 0x6a6a6a00,0x33330033 +.long 0xe7e7e700,0x67670067 +.long 0x46464600,0xf3f300f3 +.long 0x71717100,0x7f7f007f +.long 0xbababa00,0xe2e200e2 +.long 0xd4d4d400,0x9b9b009b +.long 0x25252500,0x26260026 +.long 0xababab00,0x37370037 +.long 0x42424200,0x3b3b003b +.long 0x88888800,0x96960096 +.long 0xa2a2a200,0x4b4b004b +.long 0x8d8d8d00,0xbebe00be +.long 0xfafafa00,0x2e2e002e +.long 0x72727200,0x79790079 +.long 0x07070700,0x8c8c008c +.long 0xb9b9b900,0x6e6e006e +.long 0x55555500,0x8e8e008e +.long 0xf8f8f800,0xf5f500f5 +.long 0xeeeeee00,0xb6b600b6 +.long 0xacacac00,0xfdfd00fd +.long 0x0a0a0a00,0x59590059 +.long 0x36363600,0x98980098 +.long 0x49494900,0x6a6a006a +.long 0x2a2a2a00,0x46460046 +.long 0x68686800,0xbaba00ba +.long 0x3c3c3c00,0x25250025 +.long 0x38383800,0x42420042 +.long 0xf1f1f100,0xa2a200a2 +.long 0xa4a4a400,0xfafa00fa +.long 0x40404000,0x07070007 +.long 0x28282800,0x55550055 +.long 0xd3d3d300,0xeeee00ee +.long 0x7b7b7b00,0x0a0a000a +.long 0xbbbbbb00,0x49490049 +.long 0xc9c9c900,0x68680068 +.long 0x43434300,0x38380038 +.long 0xc1c1c100,0xa4a400a4 +.long 0x15151500,0x28280028 +.long 0xe3e3e300,0x7b7b007b +.long 0xadadad00,0xc9c900c9 +.long 0xf4f4f400,0xc1c100c1 +.long 0x77777700,0xe3e300e3 +.long 0xc7c7c700,0xf4f400f4 +.long 0x80808000,0xc7c700c7 +.long 0x9e9e9e00,0x9e9e009e +.long 0x00e0e0e0,0x38003838 +.long 0x00050505,0x41004141 +.long 0x00585858,0x16001616 +.long 0x00d9d9d9,0x76007676 +.long 0x00676767,0xd900d9d9 +.long 0x004e4e4e,0x93009393 +.long 0x00818181,0x60006060 +.long 0x00cbcbcb,0xf200f2f2 +.long 0x00c9c9c9,0x72007272 +.long 0x000b0b0b,0xc200c2c2 +.long 0x00aeaeae,0xab00abab +.long 0x006a6a6a,0x9a009a9a +.long 0x00d5d5d5,0x75007575 +.long 0x00181818,0x06000606 +.long 0x005d5d5d,0x57005757 +.long 0x00828282,0xa000a0a0 +.long 0x00464646,0x91009191 +.long 0x00dfdfdf,0xf700f7f7 +.long 0x00d6d6d6,0xb500b5b5 +.long 0x00272727,0xc900c9c9 +.long 0x008a8a8a,0xa200a2a2 +.long 0x00323232,0x8c008c8c +.long 0x004b4b4b,0xd200d2d2 +.long 0x00424242,0x90009090 +.long 0x00dbdbdb,0xf600f6f6 +.long 0x001c1c1c,0x07000707 +.long 0x009e9e9e,0xa700a7a7 +.long 0x009c9c9c,0x27002727 +.long 0x003a3a3a,0x8e008e8e +.long 0x00cacaca,0xb200b2b2 +.long 0x00252525,0x49004949 +.long 0x007b7b7b,0xde00dede +.long 0x000d0d0d,0x43004343 +.long 0x00717171,0x5c005c5c +.long 0x005f5f5f,0xd700d7d7 +.long 0x001f1f1f,0xc700c7c7 +.long 0x00f8f8f8,0x3e003e3e +.long 0x00d7d7d7,0xf500f5f5 +.long 0x003e3e3e,0x8f008f8f +.long 0x009d9d9d,0x67006767 +.long 0x007c7c7c,0x1f001f1f +.long 0x00606060,0x18001818 +.long 0x00b9b9b9,0x6e006e6e +.long 0x00bebebe,0xaf00afaf +.long 0x00bcbcbc,0x2f002f2f +.long 0x008b8b8b,0xe200e2e2 +.long 0x00161616,0x85008585 +.long 0x00343434,0x0d000d0d +.long 0x004d4d4d,0x53005353 +.long 0x00c3c3c3,0xf000f0f0 +.long 0x00727272,0x9c009c9c +.long 0x00959595,0x65006565 +.long 0x00ababab,0xea00eaea +.long 0x008e8e8e,0xa300a3a3 +.long 0x00bababa,0xae00aeae +.long 0x007a7a7a,0x9e009e9e +.long 0x00b3b3b3,0xec00ecec +.long 0x00020202,0x80008080 +.long 0x00b4b4b4,0x2d002d2d +.long 0x00adadad,0x6b006b6b +.long 0x00a2a2a2,0xa800a8a8 +.long 0x00acacac,0x2b002b2b +.long 0x00d8d8d8,0x36003636 +.long 0x009a9a9a,0xa600a6a6 +.long 0x00171717,0xc500c5c5 +.long 0x001a1a1a,0x86008686 +.long 0x00353535,0x4d004d4d +.long 0x00cccccc,0x33003333 +.long 0x00f7f7f7,0xfd00fdfd +.long 0x00999999,0x66006666 +.long 0x00616161,0x58005858 +.long 0x005a5a5a,0x96009696 +.long 0x00e8e8e8,0x3a003a3a +.long 0x00242424,0x09000909 +.long 0x00565656,0x95009595 +.long 0x00404040,0x10001010 +.long 0x00e1e1e1,0x78007878 +.long 0x00636363,0xd800d8d8 +.long 0x00090909,0x42004242 +.long 0x00333333,0xcc00cccc +.long 0x00bfbfbf,0xef00efef +.long 0x00989898,0x26002626 +.long 0x00979797,0xe500e5e5 +.long 0x00858585,0x61006161 +.long 0x00686868,0x1a001a1a +.long 0x00fcfcfc,0x3f003f3f +.long 0x00ececec,0x3b003b3b +.long 0x000a0a0a,0x82008282 +.long 0x00dadada,0xb600b6b6 +.long 0x006f6f6f,0xdb00dbdb +.long 0x00535353,0xd400d4d4 +.long 0x00626262,0x98009898 +.long 0x00a3a3a3,0xe800e8e8 +.long 0x002e2e2e,0x8b008b8b +.long 0x00080808,0x02000202 +.long 0x00afafaf,0xeb00ebeb +.long 0x00282828,0x0a000a0a +.long 0x00b0b0b0,0x2c002c2c +.long 0x00747474,0x1d001d1d +.long 0x00c2c2c2,0xb000b0b0 +.long 0x00bdbdbd,0x6f006f6f +.long 0x00363636,0x8d008d8d +.long 0x00222222,0x88008888 +.long 0x00383838,0x0e000e0e +.long 0x00646464,0x19001919 +.long 0x001e1e1e,0x87008787 +.long 0x00393939,0x4e004e4e +.long 0x002c2c2c,0x0b000b0b +.long 0x00a6a6a6,0xa900a9a9 +.long 0x00303030,0x0c000c0c +.long 0x00e5e5e5,0x79007979 +.long 0x00444444,0x11001111 +.long 0x00fdfdfd,0x7f007f7f +.long 0x00888888,0x22002222 +.long 0x009f9f9f,0xe700e7e7 +.long 0x00656565,0x59005959 +.long 0x00878787,0xe100e1e1 +.long 0x006b6b6b,0xda00dada +.long 0x00f4f4f4,0x3d003d3d +.long 0x00232323,0xc800c8c8 +.long 0x00484848,0x12001212 +.long 0x00101010,0x04000404 +.long 0x00d1d1d1,0x74007474 +.long 0x00515151,0x54005454 +.long 0x00c0c0c0,0x30003030 +.long 0x00f9f9f9,0x7e007e7e +.long 0x00d2d2d2,0xb400b4b4 +.long 0x00a0a0a0,0x28002828 +.long 0x00555555,0x55005555 +.long 0x00a1a1a1,0x68006868 +.long 0x00414141,0x50005050 +.long 0x00fafafa,0xbe00bebe +.long 0x00434343,0xd000d0d0 +.long 0x00131313,0xc400c4c4 +.long 0x00c4c4c4,0x31003131 +.long 0x002f2f2f,0xcb00cbcb +.long 0x00a8a8a8,0x2a002a2a +.long 0x00b6b6b6,0xad00adad +.long 0x003c3c3c,0x0f000f0f +.long 0x002b2b2b,0xca00caca +.long 0x00c1c1c1,0x70007070 +.long 0x00ffffff,0xff00ffff +.long 0x00c8c8c8,0x32003232 +.long 0x00a5a5a5,0x69006969 +.long 0x00202020,0x08000808 +.long 0x00898989,0x62006262 +.long 0x00000000,0x00000000 +.long 0x00909090,0x24002424 +.long 0x00474747,0xd100d1d1 +.long 0x00efefef,0xfb00fbfb +.long 0x00eaeaea,0xba00baba +.long 0x00b7b7b7,0xed00eded +.long 0x00151515,0x45004545 +.long 0x00060606,0x81008181 +.long 0x00cdcdcd,0x73007373 +.long 0x00b5b5b5,0x6d006d6d +.long 0x00121212,0x84008484 +.long 0x007e7e7e,0x9f009f9f +.long 0x00bbbbbb,0xee00eeee +.long 0x00292929,0x4a004a4a +.long 0x000f0f0f,0xc300c3c3 +.long 0x00b8b8b8,0x2e002e2e +.long 0x00070707,0xc100c1c1 +.long 0x00040404,0x01000101 +.long 0x009b9b9b,0xe600e6e6 +.long 0x00949494,0x25002525 +.long 0x00212121,0x48004848 +.long 0x00666666,0x99009999 +.long 0x00e6e6e6,0xb900b9b9 +.long 0x00cecece,0xb300b3b3 +.long 0x00ededed,0x7b007b7b +.long 0x00e7e7e7,0xf900f9f9 +.long 0x003b3b3b,0xce00cece +.long 0x00fefefe,0xbf00bfbf +.long 0x007f7f7f,0xdf00dfdf +.long 0x00c5c5c5,0x71007171 +.long 0x00a4a4a4,0x29002929 +.long 0x00373737,0xcd00cdcd +.long 0x00b1b1b1,0x6c006c6c +.long 0x004c4c4c,0x13001313 +.long 0x00919191,0x64006464 +.long 0x006e6e6e,0x9b009b9b +.long 0x008d8d8d,0x63006363 +.long 0x00767676,0x9d009d9d +.long 0x00030303,0xc000c0c0 +.long 0x002d2d2d,0x4b004b4b +.long 0x00dedede,0xb700b7b7 +.long 0x00969696,0xa500a5a5 +.long 0x00262626,0x89008989 +.long 0x007d7d7d,0x5f005f5f +.long 0x00c6c6c6,0xb100b1b1 +.long 0x005c5c5c,0x17001717 +.long 0x00d3d3d3,0xf400f4f4 +.long 0x00f2f2f2,0xbc00bcbc +.long 0x004f4f4f,0xd300d3d3 +.long 0x00191919,0x46004646 +.long 0x003f3f3f,0xcf00cfcf +.long 0x00dcdcdc,0x37003737 +.long 0x00797979,0x5e005e5e +.long 0x001d1d1d,0x47004747 +.long 0x00525252,0x94009494 +.long 0x00ebebeb,0xfa00fafa +.long 0x00f3f3f3,0xfc00fcfc +.long 0x006d6d6d,0x5b005b5b +.long 0x005e5e5e,0x97009797 +.long 0x00fbfbfb,0xfe00fefe +.long 0x00696969,0x5a005a5a +.long 0x00b2b2b2,0xac00acac +.long 0x00f0f0f0,0x3c003c3c +.long 0x00313131,0x4c004c4c +.long 0x000c0c0c,0x03000303 +.long 0x00d4d4d4,0x35003535 +.long 0x00cfcfcf,0xf300f3f3 +.long 0x008c8c8c,0x23002323 +.long 0x00e2e2e2,0xb800b8b8 +.long 0x00757575,0x5d005d5d +.long 0x00a9a9a9,0x6a006a6a +.long 0x004a4a4a,0x92009292 +.long 0x00575757,0xd500d5d5 +.long 0x00848484,0x21002121 +.long 0x00111111,0x44004444 +.long 0x00454545,0x51005151 +.long 0x001b1b1b,0xc600c6c6 +.long 0x00f5f5f5,0x7d007d7d +.long 0x00e4e4e4,0x39003939 +.long 0x000e0e0e,0x83008383 +.long 0x00737373,0xdc00dcdc +.long 0x00aaaaaa,0xaa00aaaa +.long 0x00f1f1f1,0x7c007c7c +.long 0x00dddddd,0x77007777 +.long 0x00595959,0x56005656 +.long 0x00141414,0x05000505 +.long 0x006c6c6c,0x1b001b1b +.long 0x00929292,0xa400a4a4 +.long 0x00545454,0x15001515 +.long 0x00d0d0d0,0x34003434 +.long 0x00787878,0x1e001e1e +.long 0x00707070,0x1c001c1c +.long 0x00e3e3e3,0xf800f8f8 +.long 0x00494949,0x52005252 +.long 0x00808080,0x20002020 +.long 0x00505050,0x14001414 +.long 0x00a7a7a7,0xe900e9e9 +.long 0x00f6f6f6,0xbd00bdbd +.long 0x00777777,0xdd00dddd +.long 0x00939393,0xe400e4e4 +.long 0x00868686,0xa100a1a1 +.long 0x00838383,0xe000e0e0 +.long 0x002a2a2a,0x8a008a8a +.long 0x00c7c7c7,0xf100f1f1 +.long 0x005b5b5b,0xd600d6d6 +.long 0x00e9e9e9,0x7a007a7a +.long 0x00eeeeee,0xbb00bbbb +.long 0x008f8f8f,0xe300e3e3 +.long 0x00010101,0x40004040 +.long 0x003d3d3d,0x4f004f4f +.globl Camellia_cbc_encrypt +.def Camellia_cbc_encrypt; .scl 2; .type 32; .endef +.p2align 4 +Camellia_cbc_encrypt: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_Camellia_cbc_encrypt: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + movq 48(%rsp),%r9 + + cmpq $0,%rdx + je .Lcbc_abort + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 +.Lcbc_prologue: + + movq %rsp,%rbp + subq $64,%rsp + andq $-64,%rsp + + + + leaq -64-63(%rcx),%r10 + subq %rsp,%r10 + negq %r10 + andq $960,%r10 + subq %r10,%rsp + + + movq %rdi,%r12 + movq %rsi,%r13 + movq %r8,%rbx + movq %rcx,%r14 + movl 272(%rcx),%r15d + + movq %r8,40(%rsp) + movq %rbp,48(%rsp) + +.Lcbc_body: + leaq .LCamellia_SBOX(%rip),%rbp + + movl $32,%ecx +.p2align 2 +.Lcbc_prefetch_sbox: + movq 0(%rbp),%rax + movq 32(%rbp),%rsi + movq 64(%rbp),%rdi + movq 96(%rbp),%r11 + leaq 128(%rbp),%rbp + loop .Lcbc_prefetch_sbox + subq $4096,%rbp + shlq $6,%r15 + movq %rdx,%rcx + leaq (%r14,%r15,1),%r15 + + cmpl $0,%r9d + je .LCBC_DECRYPT + + andq $-16,%rdx + andq $15,%rcx + leaq (%r12,%rdx,1),%rdx + movq %r14,0(%rsp) + movq %rdx,8(%rsp) + movq %rcx,16(%rsp) + + cmpq %r12,%rdx + movl 0(%rbx),%r8d + movl 4(%rbx),%r9d + movl 8(%rbx),%r10d + movl 12(%rbx),%r11d + je .Lcbc_enc_tail + jmp .Lcbc_eloop + +.p2align 4 +.Lcbc_eloop: + xorl 0(%r12),%r8d + xorl 4(%r12),%r9d + xorl 8(%r12),%r10d + bswapl %r8d + xorl 12(%r12),%r11d + bswapl %r9d + bswapl %r10d + bswapl %r11d + + call _x86_64_Camellia_encrypt + + movq 0(%rsp),%r14 + bswapl %r8d + movq 8(%rsp),%rdx + bswapl %r9d + movq 16(%rsp),%rcx + bswapl %r10d + movl %r8d,0(%r13) + bswapl %r11d + movl %r9d,4(%r13) + movl %r10d,8(%r13) + leaq 16(%r12),%r12 + movl %r11d,12(%r13) + cmpq %rdx,%r12 + leaq 16(%r13),%r13 + jne .Lcbc_eloop + + cmpq $0,%rcx + jne .Lcbc_enc_tail + + movq 40(%rsp),%r13 + movl %r8d,0(%r13) + movl %r9d,4(%r13) + movl %r10d,8(%r13) + movl %r11d,12(%r13) + jmp .Lcbc_done + +.p2align 4 +.Lcbc_enc_tail: + xorq %rax,%rax + movq %rax,0+24(%rsp) + movq %rax,8+24(%rsp) + movq %rax,16(%rsp) + +.Lcbc_enc_pushf: + pushfq + cld + movq %r12,%rsi + leaq 8+24(%rsp),%rdi +.long 0x9066A4F3 + popfq +.Lcbc_enc_popf: + + leaq 24(%rsp),%r12 + leaq 16+24(%rsp),%rax + movq %rax,8(%rsp) + jmp .Lcbc_eloop + +.p2align 4 +.LCBC_DECRYPT: + xchgq %r14,%r15 + addq $15,%rdx + andq $15,%rcx + andq $-16,%rdx + movq %r14,0(%rsp) + leaq (%r12,%rdx,1),%rdx + movq %rdx,8(%rsp) + movq %rcx,16(%rsp) + + movq (%rbx),%rax + movq 8(%rbx),%rbx + jmp .Lcbc_dloop +.p2align 4 +.Lcbc_dloop: + movl 0(%r12),%r8d + movl 4(%r12),%r9d + movl 8(%r12),%r10d + bswapl %r8d + movl 12(%r12),%r11d + bswapl %r9d + movq %rax,0+24(%rsp) + bswapl %r10d + movq %rbx,8+24(%rsp) + bswapl %r11d + + call _x86_64_Camellia_decrypt + + movq 0(%rsp),%r14 + movq 8(%rsp),%rdx + movq 16(%rsp),%rcx + + bswapl %r8d + movq (%r12),%rax + bswapl %r9d + movq 8(%r12),%rbx + bswapl %r10d + xorl 0+24(%rsp),%r8d + bswapl %r11d + xorl 4+24(%rsp),%r9d + xorl 8+24(%rsp),%r10d + leaq 16(%r12),%r12 + xorl 12+24(%rsp),%r11d + cmpq %rdx,%r12 + je .Lcbc_ddone + + movl %r8d,0(%r13) + movl %r9d,4(%r13) + movl %r10d,8(%r13) + movl %r11d,12(%r13) + + leaq 16(%r13),%r13 + jmp .Lcbc_dloop + +.p2align 4 +.Lcbc_ddone: + movq 40(%rsp),%rdx + cmpq $0,%rcx + jne .Lcbc_dec_tail + + movl %r8d,0(%r13) + movl %r9d,4(%r13) + movl %r10d,8(%r13) + movl %r11d,12(%r13) + + movq %rax,(%rdx) + movq %rbx,8(%rdx) + jmp .Lcbc_done +.p2align 4 +.Lcbc_dec_tail: + movl %r8d,0+24(%rsp) + movl %r9d,4+24(%rsp) + movl %r10d,8+24(%rsp) + movl %r11d,12+24(%rsp) + +.Lcbc_dec_pushf: + pushfq + cld + leaq 8+24(%rsp),%rsi + leaq (%r13),%rdi +.long 0x9066A4F3 + popfq +.Lcbc_dec_popf: + + movq %rax,(%rdx) + movq %rbx,8(%rdx) + jmp .Lcbc_done + +.p2align 4 +.Lcbc_done: + movq 48(%rsp),%rcx + movq 0(%rcx),%r15 + movq 8(%rcx),%r14 + movq 16(%rcx),%r13 + movq 24(%rcx),%r12 + movq 32(%rcx),%rbp + movq 40(%rcx),%rbx + leaq 48(%rcx),%rsp +.Lcbc_abort: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_Camellia_cbc_encrypt: + +.byte 67,97,109,101,108,108,105,97,32,102,111,114,32,120,56,54,95,54,52,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 diff --git a/crypto/chacha/chacha-merged.c b/crypto/chacha/chacha-merged.c index 08511ed2..67508f20 100644 --- a/crypto/chacha/chacha-merged.c +++ b/crypto/chacha/chacha-merged.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chacha-merged.c,v 1.8 2017/08/13 16:55:31 jsing Exp $ */ +/* $OpenBSD: chacha-merged.c,v 1.9 2019/01/22 00:59:21 dlg Exp $ */ /* chacha-merged.c version 20080118 D. J. Bernstein @@ -277,3 +277,49 @@ chacha_encrypt_bytes(chacha_ctx *x, const u8 *m, u8 *c, u32 bytes) m += 64; } } + +void +CRYPTO_hchacha_20(unsigned char subkey[32], const unsigned char key[32], + const unsigned char nonce[16]) +{ + uint32_t x[16]; + int i; + + x[0] = U8TO32_LITTLE(sigma + 0); + x[1] = U8TO32_LITTLE(sigma + 4); + x[2] = U8TO32_LITTLE(sigma + 8); + x[3] = U8TO32_LITTLE(sigma + 12); + x[4] = U8TO32_LITTLE(key + 0); + x[5] = U8TO32_LITTLE(key + 4); + x[6] = U8TO32_LITTLE(key + 8); + x[7] = U8TO32_LITTLE(key + 12); + x[8] = U8TO32_LITTLE(key + 16); + x[9] = U8TO32_LITTLE(key + 20); + x[10] = U8TO32_LITTLE(key + 24); + x[11] = U8TO32_LITTLE(key + 28); + x[12] = U8TO32_LITTLE(nonce + 0); + x[13] = U8TO32_LITTLE(nonce + 4); + x[14] = U8TO32_LITTLE(nonce + 8); + x[15] = U8TO32_LITTLE(nonce + 12); + + for (i = 20; i > 0; i -= 2) { + QUARTERROUND(x[0], x[4], x[8], x[12]) + QUARTERROUND(x[1], x[5], x[9], x[13]) + QUARTERROUND(x[2], x[6], x[10], x[14]) + QUARTERROUND(x[3], x[7], x[11], x[15]) + QUARTERROUND(x[0], x[5], x[10], x[15]) + QUARTERROUND(x[1], x[6], x[11], x[12]) + QUARTERROUND(x[2], x[7], x[8], x[13]) + QUARTERROUND(x[3], x[4], x[9], x[14]) + } + + U32TO8_LITTLE(subkey + 0, x[0]); + U32TO8_LITTLE(subkey + 4, x[1]); + U32TO8_LITTLE(subkey + 8, x[2]); + U32TO8_LITTLE(subkey + 12, x[3]); + + U32TO8_LITTLE(subkey + 16, x[12]); + U32TO8_LITTLE(subkey + 20, x[13]); + U32TO8_LITTLE(subkey + 24, x[14]); + U32TO8_LITTLE(subkey + 28, x[15]); +} diff --git a/crypto/chacha/chacha.c b/crypto/chacha/chacha.c index 0c384ab8..6a2dddf0 100644 --- a/crypto/chacha/chacha.c +++ b/crypto/chacha/chacha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chacha.c,v 1.7 2015/12/09 14:07:55 bcook Exp $ */ +/* $OpenBSD: chacha.c,v 1.8 2019/01/22 00:59:21 dlg Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -75,3 +75,13 @@ CRYPTO_chacha_20(unsigned char *out, const unsigned char *in, size_t len, chacha_encrypt_bytes(&ctx, in, out, (uint32_t)len); } + +void +CRYPTO_xchacha_20(unsigned char *out, const unsigned char *in, size_t len, + const unsigned char key[32], const unsigned char iv[24]) +{ + uint8_t subkey[32]; + + CRYPTO_hchacha_20(subkey, key, iv); + CRYPTO_chacha_20(out, in, len, subkey, iv + 16, 0); +} diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c index 1802cffd..0cdbb205 100644 --- a/crypto/comp/c_zlib.c +++ b/crypto/comp/c_zlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: c_zlib.c,v 1.19 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: c_zlib.c,v 1.20 2018/03/17 16:20:01 beck Exp $ */ #include #include #include @@ -191,6 +191,8 @@ COMP_zlib(void) if (zlib_stateful_ex_idx == -1) goto err; } + if (!OPENSSL_init_crypto(0, NULL)) + goto err; meth = &zlib_stateful_method; } diff --git a/crypto/compat/arc4random.c b/crypto/compat/arc4random.c index b151f4d3..2bb4dbfd 100644 --- a/crypto/compat/arc4random.c +++ b/crypto/compat/arc4random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random.c,v 1.54 2015/09/13 08:31:47 guenther Exp $ */ +/* $OpenBSD: arc4random.c,v 1.55 2019/03/24 17:56:54 deraadt Exp $ */ /* * Copyright (c) 1996, David Mazieres @@ -75,7 +75,7 @@ _rs_init(u_char *buf, size_t n) if (rs == NULL) { if (_rs_allocate(&rs, &rsx) == -1) - abort(); + _exit(1); } chacha_keysetup(&rsx->rs_chacha, buf, KEYSZ * 8, 0); diff --git a/crypto/compat/arc4random_uniform.c b/crypto/compat/arc4random_uniform.c index 2d224345..06cd29c6 100644 --- a/crypto/compat/arc4random_uniform.c +++ b/crypto/compat/arc4random_uniform.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random_uniform.c,v 1.2 2015/09/13 08:31:47 guenther Exp $ */ +/* $OpenBSD: arc4random_uniform.c,v 1.3 2019/01/20 02:59:07 bcook Exp $ */ /* * Copyright (c) 2008, Damien Miller @@ -16,7 +16,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include #include /* diff --git a/crypto/compat/crypto_lock_win.c b/crypto/compat/crypto_lock_win.c new file mode 100644 index 00000000..b3b1858f --- /dev/null +++ b/crypto/compat/crypto_lock_win.c @@ -0,0 +1,56 @@ +/* $OpenBSD: crypto_lock.c,v 1.1 2018/11/11 06:41:28 bcook Exp $ */ +/* + * Copyright (c) 2019 Brent Cook + * Copyright (c) 2019 John Norrbin + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#include + +static volatile LPCRITICAL_SECTION locks[CRYPTO_NUM_LOCKS] = { NULL }; + +void +CRYPTO_lock(int mode, int type, const char *file, int line) +{ + if (type < 0 || type >= CRYPTO_NUM_LOCKS) + return; + + if (locks[type] == NULL) { + LPCRITICAL_SECTION lcs = malloc(sizeof(CRITICAL_SECTION)); + if (lcs == NULL) exit(ENOMEM); + InitializeCriticalSection(lcs); + if (InterlockedCompareExchangePointer((PVOID*)&locks[type], (PVOID)lcs, NULL) != NULL) { + DeleteCriticalSection(lcs); + free(lcs); + } + } + + if (mode & CRYPTO_LOCK) + EnterCriticalSection(locks[type]); + else + LeaveCriticalSection(locks[type]); +} + +int +CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, + int line) +{ + /* + * Windows is LLP64. sizeof(LONG) == sizeof(int) on 32-bit and 64-bit. + */ + int ret = InterlockedExchangeAdd((LONG *)pointer, (LONG)amount); + return ret + amount; +} diff --git a/crypto/compat/getentropy_aix.c b/crypto/compat/getentropy_aix.c index ff48ae70..bd8818f2 100644 --- a/crypto/compat/getentropy_aix.c +++ b/crypto/compat/getentropy_aix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_aix.c,v 1.5 2016/08/07 03:27:21 tb Exp $ */ +/* $OpenBSD: getentropy_aix.c,v 1.6 2018/11/20 08:04:28 deraadt Exp $ */ /* * Copyright (c) 2015 Michael Felt @@ -60,7 +60,6 @@ int getentropy(void *buf, size_t len); -static int gotdata(char *buf, size_t len); static int getentropy_urandom(void *buf, size_t len, const char *path, int devfscheck); static int getentropy_fallback(void *buf, size_t len); @@ -118,22 +117,6 @@ getentropy(void *buf, size_t len) return (ret); } -/* - * Basic sanity checking; wish we could do better. - */ -static int -gotdata(char *buf, size_t len) -{ - char any_set = 0; - size_t i; - - for (i = 0; i < len; ++i) - any_set |= buf[i]; - if (any_set == 0) - return (-1); - return (0); -} - static int getentropy_urandom(void *buf, size_t len, const char *path, int devfscheck) { @@ -179,10 +162,8 @@ getentropy_urandom(void *buf, size_t len, const char *path, int devfscheck) i += ret; } close(fd); - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } + errno = save_errno; + return (0); /* satisfied */ nodevrandom: errno = EIO; return (-1); @@ -416,10 +397,6 @@ getentropy_fallback(void *buf, size_t len) } explicit_bzero(&ctx, sizeof ctx); explicit_bzero(results, sizeof results); - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } - errno = EIO; - return (-1); + errno = save_errno; + return (0); /* satisfied */ } diff --git a/crypto/compat/getentropy_hpux.c b/crypto/compat/getentropy_hpux.c index 3ae6a6aa..7208aa44 100644 --- a/crypto/compat/getentropy_hpux.c +++ b/crypto/compat/getentropy_hpux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_hpux.c,v 1.5 2016/08/07 03:27:21 tb Exp $ */ +/* $OpenBSD: getentropy_hpux.c,v 1.6 2018/11/20 08:04:28 deraadt Exp $ */ /* * Copyright (c) 2014 Theo de Raadt @@ -64,7 +64,6 @@ int getentropy(void *buf, size_t len); -static int gotdata(char *buf, size_t len); static int getentropy_urandom(void *buf, size_t len, const char *path, int devfscheck); static int getentropy_fallback(void *buf, size_t len); @@ -122,22 +121,6 @@ getentropy(void *buf, size_t len) return (ret); } -/* - * Basic sanity checking; wish we could do better. - */ -static int -gotdata(char *buf, size_t len) -{ - char any_set = 0; - size_t i; - - for (i = 0; i < len; ++i) - any_set |= buf[i]; - if (any_set == 0) - return (-1); - return (0); -} - static int getentropy_urandom(void *buf, size_t len, const char *path, int devfscheck) { @@ -183,10 +166,8 @@ getentropy_urandom(void *buf, size_t len, const char *path, int devfscheck) i += ret; } close(fd); - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } + errno = save_errno; + return (0); /* satisfied */ nodevrandom: errno = EIO; return (-1); @@ -410,10 +391,6 @@ getentropy_fallback(void *buf, size_t len) } explicit_bzero(&ctx, sizeof ctx); explicit_bzero(results, sizeof results); - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } - errno = EIO; - return (-1); + errno = save_errno; + return (0); /* satisfied */ } diff --git a/crypto/compat/getentropy_linux.c b/crypto/compat/getentropy_linux.c index a845239e..6b220be3 100644 --- a/crypto/compat/getentropy_linux.c +++ b/crypto/compat/getentropy_linux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_linux.c,v 1.44 2017/04/29 18:43:31 beck Exp $ */ +/* $OpenBSD: getentropy_linux.c,v 1.46 2018/11/20 08:04:28 deraadt Exp $ */ /* * Copyright (c) 2014 Theo de Raadt @@ -73,8 +73,7 @@ int getentropy(void *buf, size_t len); -static int gotdata(char *buf, size_t len); -#ifdef SYS_getrandom +#if defined(SYS_getrandom) && defined(GRND_NONBLOCK) static int getentropy_getrandom(void *buf, size_t len); #endif static int getentropy_urandom(void *buf, size_t len); @@ -94,7 +93,7 @@ getentropy(void *buf, size_t len) return (-1); } -#ifdef SYS_getrandom +#if defined(SYS_getrandom) && defined(GRND_NONBLOCK) /* * Try descriptor-less getrandom(), in non-blocking mode. * @@ -177,23 +176,7 @@ getentropy(void *buf, size_t len) return (ret); } -/* - * Basic sanity checking; wish we could do better. - */ -static int -gotdata(char *buf, size_t len) -{ - char any_set = 0; - size_t i; - - for (i = 0; i < len; ++i) - any_set |= buf[i]; - if (any_set == 0) - return (-1); - return (0); -} - -#ifdef SYS_getrandom +#if defined(SYS_getrandom) && defined(GRND_NONBLOCK) static int getentropy_getrandom(void *buf, size_t len) { @@ -261,10 +244,8 @@ getentropy_urandom(void *buf, size_t len) i += ret; } close(fd); - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } + errno = save_errno; + return (0); /* satisfied */ nodevrandom: errno = EIO; return (-1); @@ -292,10 +273,8 @@ getentropy_sysctl(void *buf, size_t len) goto sysctlfailed; i += chunk; } - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } + errno = save_errno; + return (0); /* satisfied */ sysctlfailed: errno = EIO; return (-1); @@ -541,10 +520,6 @@ getentropy_fallback(void *buf, size_t len) } explicit_bzero(&ctx, sizeof ctx); explicit_bzero(results, sizeof results); - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } - errno = EIO; - return (-1); + errno = save_errno; + return (0); /* satisfied */ } diff --git a/crypto/compat/getentropy_osx.c b/crypto/compat/getentropy_osx.c index 2a5f83f3..26dcc824 100644 --- a/crypto/compat/getentropy_osx.c +++ b/crypto/compat/getentropy_osx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_osx.c,v 1.11 2016/09/03 15:24:09 bcook Exp $ */ +/* $OpenBSD: getentropy_osx.c,v 1.12 2018/11/20 08:04:28 deraadt Exp $ */ /* * Copyright (c) 2014 Theo de Raadt @@ -82,7 +82,6 @@ int getentropy(void *buf, size_t len); -static int gotdata(char *buf, size_t len); static int getentropy_urandom(void *buf, size_t len); static int getentropy_fallback(void *buf, size_t len); @@ -142,22 +141,6 @@ getentropy(void *buf, size_t len) return (ret); } -/* - * Basic sanity checking; wish we could do better. - */ -static int -gotdata(char *buf, size_t len) -{ - char any_set = 0; - size_t i; - - for (i = 0; i < len; ++i) - any_set |= buf[i]; - if (any_set == 0) - return (-1); - return (0); -} - static int getentropy_urandom(void *buf, size_t len) { @@ -203,10 +186,8 @@ getentropy_urandom(void *buf, size_t len) i += ret; } close(fd); - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } + errno = save_errno; + return (0); /* satisfied */ nodevrandom: errno = EIO; return (-1); @@ -431,10 +412,6 @@ getentropy_fallback(void *buf, size_t len) } explicit_bzero(&ctx, sizeof ctx); explicit_bzero(results, sizeof results); - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } - errno = EIO; - return (-1); + errno = save_errno; + return (0); /* satisfied */ } diff --git a/crypto/compat/getentropy_solaris.c b/crypto/compat/getentropy_solaris.c index f0fcdcf2..b80c84de 100644 --- a/crypto/compat/getentropy_solaris.c +++ b/crypto/compat/getentropy_solaris.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_solaris.c,v 1.12 2016/08/07 03:27:21 tb Exp $ */ +/* $OpenBSD: getentropy_solaris.c,v 1.13 2018/11/20 08:04:28 deraadt Exp $ */ /* * Copyright (c) 2014 Theo de Raadt @@ -68,7 +68,6 @@ int getentropy(void *buf, size_t len); -static int gotdata(char *buf, size_t len); static int getentropy_urandom(void *buf, size_t len, const char *path, int devfscheck); static int getentropy_fallback(void *buf, size_t len); @@ -148,22 +147,6 @@ getentropy(void *buf, size_t len) return (ret); } -/* - * Basic sanity checking; wish we could do better. - */ -static int -gotdata(char *buf, size_t len) -{ - char any_set = 0; - size_t i; - - for (i = 0; i < len; ++i) - any_set |= buf[i]; - if (any_set == 0) - return (-1); - return (0); -} - static int getentropy_urandom(void *buf, size_t len, const char *path, int devfscheck) { @@ -210,10 +193,8 @@ getentropy_urandom(void *buf, size_t len, const char *path, int devfscheck) i += ret; } close(fd); - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } + errno = save_errno; + return (0); /* satisfied */ nodevrandom: errno = EIO; return (-1); @@ -436,10 +417,6 @@ getentropy_fallback(void *buf, size_t len) } explicit_bzero(&ctx, sizeof ctx); explicit_bzero(results, sizeof results); - if (gotdata(buf, len) == 0) { - errno = save_errno; - return (0); /* satisfied */ - } - errno = EIO; - return (-1); + errno = save_errno; + return (0); /* satisfied */ } diff --git a/crypto/compat/getpagesize.c b/crypto/compat/getpagesize.c index 098efa99..cbaae92a 100644 --- a/crypto/compat/getpagesize.c +++ b/crypto/compat/getpagesize.c @@ -2,13 +2,13 @@ #include -#ifdef _MSC_VER +#ifdef _WIN32 #include #endif int getpagesize(void) { -#ifdef _MSC_VER +#ifdef _WIN32 SYSTEM_INFO system_info; GetSystemInfo(&system_info); return system_info.dwPageSize; diff --git a/crypto/compat/getprogname_linux.c b/crypto/compat/getprogname_linux.c new file mode 100644 index 00000000..2c897432 --- /dev/null +++ b/crypto/compat/getprogname_linux.c @@ -0,0 +1,34 @@ +#include + +#include + +const char * +getprogname(void) +{ + /* + * Android added getprogname with API 21 [0]. We should not end up here + * with APIs bigger than 21. Still write a precise check. + * + * Since Android is using portions of OpenBSD libc, it should have + * a symbol called __progname [1]. + * + * Regarding program_invocation_short_name, it is a GNU libc ext [2] and + * so make it conditional to __GLIBC__ [3]. + * + * .. [0] https://github.com/aosp-mirror/platform_bionic/blob/1eb6d3/libc/include/stdlib.h#L160 + * + * .. [1] https://github.com/aosp-mirror/platform_bionic/commit/692207 + * + * .. [2] https://linux.die.net/man/3/program_invocation_short_name + * + * .. [3] https://android.googlesource.com/platform/system/core/+/2819c0/base/logging.cpp#65 + */ +#if defined(__ANDROID_API__) && __ANDROID_API__ < 21 + extern const char *__progname; + return __progname; +#elif defined(__GLIBC__) + return program_invocation_short_name; +#else +#error "Cannot emulate getprogname" +#endif +} diff --git a/crypto/compat/getprogname_unimpl.c b/crypto/compat/getprogname_unimpl.c new file mode 100644 index 00000000..339c54ae --- /dev/null +++ b/crypto/compat/getprogname_unimpl.c @@ -0,0 +1,7 @@ +#include + +const char * +getprogname(void) +{ + return "?"; +} diff --git a/crypto/compat/getprogname_windows.c b/crypto/compat/getprogname_windows.c new file mode 100644 index 00000000..eb04ec05 --- /dev/null +++ b/crypto/compat/getprogname_windows.c @@ -0,0 +1,13 @@ +#include + +#include + +const char * +getprogname(void) +{ + static char progname[MAX_PATH + 1]; + DWORD length = GetModuleFileName(NULL, progname, sizeof (progname) - 1); + if (length < 0) + return "?"; + return progname; +} diff --git a/crypto/compat/inet_pton.c b/crypto/compat/inet_pton.c deleted file mode 100644 index c923b38b..00000000 --- a/crypto/compat/inet_pton.c +++ /dev/null @@ -1,212 +0,0 @@ -/* $OpenBSD: inet_pton.c,v 1.10 2015/09/13 21:36:08 guenther Exp $ */ - -/* Copyright (c) 1996 by Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS - * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE - * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -#include -#include -#include -#include -#include -#include -#include - -/* - * WARNING: Don't even consider trying to compile this on a system where - * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. - */ - -static int inet_pton4(const char *src, u_char *dst); -static int inet_pton6(const char *src, u_char *dst); - -/* int - * inet_pton(af, src, dst) - * convert from presentation format (which usually means ASCII printable) - * to network format (which is usually some kind of binary format). - * return: - * 1 if the address was valid for the specified address family - * 0 if the address wasn't valid (`dst' is untouched in this case) - * -1 if some other error occurred (`dst' is untouched in this case, too) - * author: - * Paul Vixie, 1996. - */ -int -inet_pton(int af, const char *src, void *dst) -{ - switch (af) { - case AF_INET: - return (inet_pton4(src, dst)); - case AF_INET6: - return (inet_pton6(src, dst)); - default: - errno = EAFNOSUPPORT; - return (-1); - } - /* NOTREACHED */ -} - -/* int - * inet_pton4(src, dst) - * like inet_aton() but without all the hexadecimal and shorthand. - * return: - * 1 if `src' is a valid dotted quad, else 0. - * notice: - * does not touch `dst' unless it's returning 1. - * author: - * Paul Vixie, 1996. - */ -static int -inet_pton4(const char *src, u_char *dst) -{ - static const char digits[] = "0123456789"; - int saw_digit, octets, ch; - u_char tmp[INADDRSZ], *tp; - - saw_digit = 0; - octets = 0; - *(tp = tmp) = 0; - while ((ch = *src++) != '\0') { - const char *pch; - - if ((pch = strchr(digits, ch)) != NULL) { - u_int new = *tp * 10 + (pch - digits); - - if (new > 255) - return (0); - if (! saw_digit) { - if (++octets > 4) - return (0); - saw_digit = 1; - } - *tp = new; - } else if (ch == '.' && saw_digit) { - if (octets == 4) - return (0); - *++tp = 0; - saw_digit = 0; - } else - return (0); - } - if (octets < 4) - return (0); - - memcpy(dst, tmp, INADDRSZ); - return (1); -} - -/* int - * inet_pton6(src, dst) - * convert presentation level address to network order binary form. - * return: - * 1 if `src' is a valid [RFC1884 2.2] address, else 0. - * notice: - * does not touch `dst' unless it's returning 1. - * credit: - * inspired by Mark Andrews. - * author: - * Paul Vixie, 1996. - */ -static int -inet_pton6(const char *src, u_char *dst) -{ - static const char xdigits_l[] = "0123456789abcdef", - xdigits_u[] = "0123456789ABCDEF"; - u_char tmp[IN6ADDRSZ], *tp, *endp, *colonp; - const char *xdigits, *curtok; - int ch, saw_xdigit, count_xdigit; - u_int val; - - memset((tp = tmp), '\0', IN6ADDRSZ); - endp = tp + IN6ADDRSZ; - colonp = NULL; - /* Leading :: requires some special handling. */ - if (*src == ':') - if (*++src != ':') - return (0); - curtok = src; - saw_xdigit = count_xdigit = 0; - val = 0; - while ((ch = *src++) != '\0') { - const char *pch; - - if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) - pch = strchr((xdigits = xdigits_u), ch); - if (pch != NULL) { - if (count_xdigit >= 4) - return (0); - val <<= 4; - val |= (pch - xdigits); - if (val > 0xffff) - return (0); - saw_xdigit = 1; - count_xdigit++; - continue; - } - if (ch == ':') { - curtok = src; - if (!saw_xdigit) { - if (colonp) - return (0); - colonp = tp; - continue; - } else if (*src == '\0') { - return (0); - } - if (tp + INT16SZ > endp) - return (0); - *tp++ = (u_char) (val >> 8) & 0xff; - *tp++ = (u_char) val & 0xff; - saw_xdigit = 0; - count_xdigit = 0; - val = 0; - continue; - } - if (ch == '.' && ((tp + INADDRSZ) <= endp) && - inet_pton4(curtok, tp) > 0) { - tp += INADDRSZ; - saw_xdigit = 0; - count_xdigit = 0; - break; /* '\0' was seen by inet_pton4(). */ - } - return (0); - } - if (saw_xdigit) { - if (tp + INT16SZ > endp) - return (0); - *tp++ = (u_char) (val >> 8) & 0xff; - *tp++ = (u_char) val & 0xff; - } - if (colonp != NULL) { - /* - * Since some memmove()'s erroneously fail to handle - * overlapping regions, we'll do the shift by hand. - */ - const int n = tp - colonp; - int i; - - if (tp == endp) - return (0); - for (i = 1; i <= n; i++) { - endp[- i] = colonp[n - i]; - colonp[n - i] = 0; - } - tp = endp; - } - if (tp != endp) - return (0); - memcpy(dst, tmp, IN6ADDRSZ); - return (1); -} diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c index d6e2dcbb..b73f0234 100644 --- a/crypto/compat/posix_win.c +++ b/crypto/compat/posix_win.c @@ -4,6 +4,7 @@ * BSD socket emulation code for Winsock2 * File IO compatibility shims * Brent Cook + * Kinichiro Inoguchi */ #define NO_REDEF_POSIX_FUNCTIONS @@ -208,6 +209,12 @@ posix_setsockopt(int sockfd, int level, int optname, return rc == 0 ? 0 : wsa_errno(WSAGetLastError()); } +uid_t getuid(void) +{ + /* Windows fstat sets 0 as st_uid */ + return 0; +} + #ifdef _MSC_VER struct timezone; int gettimeofday(struct timeval * tp, struct timezone * tzp) diff --git a/crypto/compat/strlcat.c b/crypto/compat/strlcat.c index f27dfe01..c94e90de 100644 --- a/crypto/compat/strlcat.c +++ b/crypto/compat/strlcat.c @@ -1,7 +1,7 @@ -/* $OpenBSD: strlcat.c,v 1.18 2016/10/16 17:37:39 dtucker Exp $ */ +/* $OpenBSD: strlcat.c,v 1.19 2019/01/25 00:19:25 millert Exp $ */ /* - * Copyright (c) 1998, 2015 Todd C. Miller + * Copyright (c) 1998, 2015 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/crypto/compat/strlcpy.c b/crypto/compat/strlcpy.c index 241586e7..2fa498c3 100644 --- a/crypto/compat/strlcpy.c +++ b/crypto/compat/strlcpy.c @@ -1,7 +1,7 @@ -/* $OpenBSD: strlcpy.c,v 1.15 2016/10/16 17:37:39 dtucker Exp $ */ +/* $OpenBSD: strlcpy.c,v 1.16 2019/01/25 00:19:25 millert Exp $ */ /* - * Copyright (c) 1998, 2015 Todd C. Miller + * Copyright (c) 1998, 2015 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/crypto/compat/strndup.c b/crypto/compat/strndup.c index f43ba659..0f15e422 100644 --- a/crypto/compat/strndup.c +++ b/crypto/compat/strndup.c @@ -1,7 +1,7 @@ -/* $OpenBSD: strndup.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */ +/* $OpenBSD: strndup.c,v 1.3 2019/01/25 00:19:25 millert Exp $ */ /* - * Copyright (c) 2010 Todd C. Miller + * Copyright (c) 2010 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/crypto/compat/strnlen.c b/crypto/compat/strnlen.c index a2017e19..84f2d22b 100644 --- a/crypto/compat/strnlen.c +++ b/crypto/compat/strnlen.c @@ -1,7 +1,7 @@ -/* $OpenBSD: strnlen.c,v 1.8 2016/10/16 17:37:39 dtucker Exp $ */ +/* $OpenBSD: strnlen.c,v 1.9 2019/01/25 00:19:25 millert Exp $ */ /* - * Copyright (c) 2010 Todd C. Miller + * Copyright (c) 2010 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/crypto/compat/syslog_r.c b/crypto/compat/syslog_r.c new file mode 100644 index 00000000..d68169dd --- /dev/null +++ b/crypto/compat/syslog_r.c @@ -0,0 +1,19 @@ +#include + +void +syslog_r(int pri, struct syslog_data *data, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vsyslog_r(pri, data, fmt, ap); + va_end(ap); +} + +void +vsyslog_r(int pri, struct syslog_data *data, const char *fmt, va_list ap) +{ +#ifdef HAVE_SYSLOG + vsyslog(pri, fmt, ap); +#endif +} diff --git a/crypto/conf/conf_sap.c b/crypto/conf/conf_sap.c index a29acea7..827cf96e 100644 --- a/crypto/conf/conf_sap.c +++ b/crypto/conf/conf_sap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_sap.c,v 1.11 2015/02/11 03:19:37 doug Exp $ */ +/* $OpenBSD: conf_sap.c,v 1.14 2018/03/19 03:56:08 beck Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -56,6 +56,7 @@ * */ +#include #include #include @@ -75,14 +76,13 @@ * unless this is overridden by calling OPENSSL_no_config() */ -static int openssl_configured = 0; +static pthread_once_t openssl_configured = PTHREAD_ONCE_INIT; -void -OPENSSL_config(const char *config_name) -{ - if (openssl_configured) - return; +static const char *openssl_config_name; +static void +OPENSSL_config_internal(void) +{ OPENSSL_load_builtin_modules(); #ifndef OPENSSL_NO_ENGINE /* Need to load ENGINEs */ @@ -91,7 +91,7 @@ OPENSSL_config(const char *config_name) /* Add others here? */ ERR_clear_error(); - if (CONF_modules_load_file(NULL, config_name, + if (CONF_modules_load_file(NULL, openssl_config_name, CONF_MFLAGS_DEFAULT_SECTION|CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0) { BIO *bio_err; ERR_load_crypto_strings(); @@ -106,8 +106,49 @@ OPENSSL_config(const char *config_name) return; } +int +OpenSSL_config(const char *config_name) +{ + /* Don't override if NULL */ + /* + * Note - multiple threads calling this with *different* config names + * is probably not advisable. One thread will win, but you don't know + * if it will be the same thread as wins the pthread_once. + */ + if (config_name != NULL) + openssl_config_name = config_name; + + if (OPENSSL_init_crypto(0, NULL) == 0) + return 0; + + if (pthread_once(&openssl_configured, OPENSSL_config_internal) != 0) + return 0; + + return 1; +} + +void +OPENSSL_config(const char *config_name) +{ + (void) OpenSSL_config(config_name); +} + +static void +OPENSSL_no_config_internal(void) +{ +} + +int +OpenSSL_no_config(void) +{ + if (pthread_once(&openssl_configured, OPENSSL_no_config_internal) != 0) + return 0; + + return 1; +} + void OPENSSL_no_config(void) { - openssl_configured = 1; + (void) OpenSSL_no_config(); } diff --git a/crypto/cpuid-elf-x86_64.S b/crypto/cpuid-elf-x86_64.S index edc2f4d5..c0e13668 100644 --- a/crypto/cpuid-elf-x86_64.S +++ b/crypto/cpuid-elf-x86_64.S @@ -20,7 +20,7 @@ OPENSSL_atomic_add: jne .Lspin movl %r8d,%eax .byte 0x48,0x98 - .byte 0xf3,0xc3 + retq .size OPENSSL_atomic_add,.-OPENSSL_atomic_add .globl OPENSSL_ia32_cpuid @@ -145,7 +145,7 @@ OPENSSL_ia32_cpuid: movl %r10d,%eax movq %r8,%rbx orq %r9,%rax - .byte 0xf3,0xc3 + retq .size OPENSSL_ia32_cpuid,.-OPENSSL_ia32_cpuid .globl OPENSSL_wipe_cpu .type OPENSSL_wipe_cpu,@function @@ -176,7 +176,7 @@ OPENSSL_wipe_cpu: xorq %r10,%r10 xorq %r11,%r11 leaq 8(%rsp),%rax - .byte 0xf3,0xc3 + retq .size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu #if defined(HAVE_GNU_STACK) .section .note.GNU-stack,"",%progbits diff --git a/crypto/cpuid-macosx-x86_64.S b/crypto/cpuid-macosx-x86_64.S index 0337d2df..75317706 100644 --- a/crypto/cpuid-macosx-x86_64.S +++ b/crypto/cpuid-macosx-x86_64.S @@ -21,7 +21,7 @@ L$spin: leaq (%rsi,%rax,1),%r8 jne L$spin movl %r8d,%eax .byte 0x48,0x98 - .byte 0xf3,0xc3 + retq .globl _OPENSSL_ia32_cpuid @@ -146,7 +146,7 @@ L$done: movl %r10d,%eax movq %r8,%rbx orq %r9,%rax - .byte 0xf3,0xc3 + retq .globl _OPENSSL_wipe_cpu @@ -177,5 +177,5 @@ _OPENSSL_wipe_cpu: xorq %r10,%r10 xorq %r11,%r11 leaq 8(%rsp),%rax - .byte 0xf3,0xc3 + retq diff --git a/crypto/cpuid-masm-x86_64.S b/crypto/cpuid-masm-x86_64.S new file mode 100644 index 00000000..425c8946 --- /dev/null +++ b/crypto/cpuid-masm-x86_64.S @@ -0,0 +1,185 @@ +OPTION DOTNAME +#include "x86_arch.h" +EXTERN OPENSSL_cpuid_setup:NEAR + +.CRT$XCU SEGMENT READONLY ALIGN(8) + DQ OPENSSL_cpuid_setup + +EXTERN OPENSSL_ia32cap_P:NEAR + + +.CRT$XCU ENDS +.text$ SEGMENT ALIGN(64) 'CODE' + +PUBLIC OPENSSL_atomic_add + +ALIGN 16 +OPENSSL_atomic_add PROC PUBLIC + mov eax,DWORD PTR[rdi] +$L$spin:: lea r8,QWORD PTR[rax*1+rsi] +DB 0f0h + cmpxchg DWORD PTR[rdi],r8d + jne $L$spin + mov eax,r8d +DB 048h,098h + DB 0F3h,0C3h ;repret +OPENSSL_atomic_add ENDP + +PUBLIC OPENSSL_ia32_cpuid + +ALIGN 16 +OPENSSL_ia32_cpuid PROC PUBLIC + mov r8,rbx + + xor eax,eax + cpuid + mov r11d,eax + + xor eax,eax + cmp ebx,0756e6547h + setne al + mov r9d,eax + cmp edx,049656e69h + setne al + or r9d,eax + cmp ecx,06c65746eh + setne al + or r9d,eax + jz $L$intel + + cmp ebx,068747541h + setne al + mov r10d,eax + cmp edx,069746E65h + setne al + or r10d,eax + cmp ecx,0444D4163h + setne al + or r10d,eax + jnz $L$intel + + + mov eax,080000000h + cpuid + cmp eax,080000001h + jb $L$intel + mov r10d,eax + mov eax,080000001h + cpuid + and r9d,IA32CAP_MASK1_AMD_XOP + or r9d,1 + + cmp r10d,080000008h + jb $L$intel + + mov eax,080000008h + cpuid + movzx r10,cl + inc r10 + + mov eax,1 + cpuid + bt edx,IA32CAP_BIT0_HT + jnc $L$generic + shr ebx,16 + cmp bl,r10b + ja $L$generic + xor edx,IA32CAP_MASK0_HT + jmp $L$generic + +$L$intel:: + cmp r11d,4 + mov r10d,-1 + jb $L$nocacheinfo + + mov eax,4 + mov ecx,0 + cpuid + mov r10d,eax + shr r10d,14 + and r10d,0fffh + +$L$nocacheinfo:: + mov eax,1 + cpuid + + and edx,(~(IA32CAP_MASK0_INTELP4 | IA32CAP_MASK0_INTEL)) + cmp r9d,0 + jne $L$notintel + + or edx,IA32CAP_MASK0_INTEL + and ah,15 + cmp ah,15 + jne $L$notintel + + or edx,IA32CAP_MASK0_INTELP4 +$L$notintel:: + bt edx,IA32CAP_BIT0_HT + jnc $L$generic + xor edx,IA32CAP_MASK0_HT + cmp r10d,0 + je $L$generic + + or edx,IA32CAP_MASK0_HT + shr ebx,16 + cmp bl,1 + ja $L$generic + xor edx,IA32CAP_MASK0_HT + +$L$generic:: + and r9d,IA32CAP_MASK1_AMD_XOP + and ecx,(~IA32CAP_MASK1_AMD_XOP) + or r9d,ecx + + mov r10d,edx + bt r9d,IA32CAP_BIT1_OSXSAVE + jnc $L$clear_avx + xor ecx,ecx +DB 00fh,001h,0d0h + and eax,6 + cmp eax,6 + je $L$done +$L$clear_avx:: + mov eax,(~(IA32CAP_MASK1_AVX | IA32CAP_MASK1_FMA3 | IA32CAP_MASK1_AMD_XOP)) + and r9d,eax +$L$done:: + shl r9,32 + mov eax,r10d + mov rbx,r8 + or rax,r9 + DB 0F3h,0C3h ;repret +OPENSSL_ia32_cpuid ENDP +PUBLIC OPENSSL_wipe_cpu + +ALIGN 16 +OPENSSL_wipe_cpu PROC PUBLIC + pxor xmm0,xmm0 + pxor xmm1,xmm1 + pxor xmm2,xmm2 + pxor xmm3,xmm3 + pxor xmm4,xmm4 + pxor xmm5,xmm5 + pxor xmm6,xmm6 + pxor xmm7,xmm7 + pxor xmm8,xmm8 + pxor xmm9,xmm9 + pxor xmm10,xmm10 + pxor xmm11,xmm11 + pxor xmm12,xmm12 + pxor xmm13,xmm13 + pxor xmm14,xmm14 + pxor xmm15,xmm15 + xor rcx,rcx + xor rdx,rdx + xor rsi,rsi + xor rdi,rdi + xor r8,r8 + xor r9,r9 + xor r10,r10 + xor r11,r11 + lea rax,QWORD PTR[8+rsp] + DB 0F3h,0C3h ;repret +OPENSSL_wipe_cpu ENDP + +.text$ ENDS +END diff --git a/crypto/cpuid-mingw64-x86_64.S b/crypto/cpuid-mingw64-x86_64.S new file mode 100644 index 00000000..db9578c9 --- /dev/null +++ b/crypto/cpuid-mingw64-x86_64.S @@ -0,0 +1,181 @@ +#include "x86_arch.h" + + +.section .ctors + .p2align 3 + .quad OPENSSL_cpuid_setup + + + + +.text + +.globl OPENSSL_atomic_add +.def OPENSSL_atomic_add; .scl 2; .type 32; .endef +.p2align 4 +OPENSSL_atomic_add: + movl (%rdi),%eax +.Lspin: leaq (%rsi,%rax,1),%r8 +.byte 0xf0 + cmpxchgl %r8d,(%rdi) + jne .Lspin + movl %r8d,%eax +.byte 0x48,0x98 + retq + + +.globl OPENSSL_ia32_cpuid +.def OPENSSL_ia32_cpuid; .scl 2; .type 32; .endef +.p2align 4 +OPENSSL_ia32_cpuid: + movq %rbx,%r8 + + xorl %eax,%eax + cpuid + movl %eax,%r11d + + xorl %eax,%eax + cmpl $1970169159,%ebx + setne %al + movl %eax,%r9d + cmpl $1231384169,%edx + setne %al + orl %eax,%r9d + cmpl $1818588270,%ecx + setne %al + orl %eax,%r9d + jz .Lintel + + cmpl $1752462657,%ebx + setne %al + movl %eax,%r10d + cmpl $1769238117,%edx + setne %al + orl %eax,%r10d + cmpl $1145913699,%ecx + setne %al + orl %eax,%r10d + jnz .Lintel + + + movl $2147483648,%eax + cpuid + cmpl $2147483649,%eax + jb .Lintel + movl %eax,%r10d + movl $2147483649,%eax + cpuid + andl $IA32CAP_MASK1_AMD_XOP,%r9d + orl $1,%r9d + + cmpl $2147483656,%r10d + jb .Lintel + + movl $2147483656,%eax + cpuid + movzbq %cl,%r10 + incq %r10 + + movl $1,%eax + cpuid + btl $IA32CAP_BIT0_HT,%edx + jnc .Lgeneric + shrl $16,%ebx + cmpb %r10b,%bl + ja .Lgeneric + xorl $IA32CAP_MASK0_HT,%edx + jmp .Lgeneric + +.Lintel: + cmpl $4,%r11d + movl $-1,%r10d + jb .Lnocacheinfo + + movl $4,%eax + movl $0,%ecx + cpuid + movl %eax,%r10d + shrl $14,%r10d + andl $4095,%r10d + +.Lnocacheinfo: + movl $1,%eax + cpuid + + andl $(~(IA32CAP_MASK0_INTELP4 | IA32CAP_MASK0_INTEL)),%edx + cmpl $0,%r9d + jne .Lnotintel + + orl $IA32CAP_MASK0_INTEL,%edx + andb $15,%ah + cmpb $15,%ah + jne .Lnotintel + + orl $IA32CAP_MASK0_INTELP4,%edx +.Lnotintel: + btl $IA32CAP_BIT0_HT,%edx + jnc .Lgeneric + xorl $IA32CAP_MASK0_HT,%edx + cmpl $0,%r10d + je .Lgeneric + + orl $IA32CAP_MASK0_HT,%edx + shrl $16,%ebx + cmpb $1,%bl + ja .Lgeneric + xorl $IA32CAP_MASK0_HT,%edx + +.Lgeneric: + andl $IA32CAP_MASK1_AMD_XOP,%r9d + andl $(~IA32CAP_MASK1_AMD_XOP),%ecx + orl %ecx,%r9d + + movl %edx,%r10d + btl $IA32CAP_BIT1_OSXSAVE,%r9d + jnc .Lclear_avx + xorl %ecx,%ecx +.byte 0x0f,0x01,0xd0 + andl $6,%eax + cmpl $6,%eax + je .Ldone +.Lclear_avx: + movl $(~(IA32CAP_MASK1_AVX | IA32CAP_MASK1_FMA3 | IA32CAP_MASK1_AMD_XOP)),%eax + andl %eax,%r9d +.Ldone: + shlq $32,%r9 + movl %r10d,%eax + movq %r8,%rbx + orq %r9,%rax + retq + +.globl OPENSSL_wipe_cpu +.def OPENSSL_wipe_cpu; .scl 2; .type 32; .endef +.p2align 4 +OPENSSL_wipe_cpu: + pxor %xmm0,%xmm0 + pxor %xmm1,%xmm1 + pxor %xmm2,%xmm2 + pxor %xmm3,%xmm3 + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + pxor %xmm6,%xmm6 + pxor %xmm7,%xmm7 + pxor %xmm8,%xmm8 + pxor %xmm9,%xmm9 + pxor %xmm10,%xmm10 + pxor %xmm11,%xmm11 + pxor %xmm12,%xmm12 + pxor %xmm13,%xmm13 + pxor %xmm14,%xmm14 + pxor %xmm15,%xmm15 + xorq %rcx,%rcx + xorq %rdx,%rdx + xorq %rsi,%rsi + xorq %rdi,%rdi + xorq %r8,%r8 + xorq %r9,%r9 + xorq %r10,%r10 + xorq %r11,%r11 + leaq 8(%rsp),%rax + retq + diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index f7b783a0..38d31e7a 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptlib.c,v 1.41 2017/04/29 21:48:43 jsing Exp $ */ +/* $OpenBSD: cryptlib.c,v 1.45 2019/01/26 11:30:32 deraadt Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -114,508 +114,190 @@ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. */ -#include +#include #include -#include +#include #include +#include #include #include - #include -#include -#include -#include -#include - -DECLARE_STACK_OF(CRYPTO_dynlock) - -/* real #defines in crypto.h, keep these upto date */ -static const char* const lock_names[CRYPTO_NUM_LOCKS] = { - "<>", - "err", - "ex_data", - "x509", - "x509_info", - "x509_pkey", - "x509_crl", - "x509_req", - "dsa", - "rsa", - "evp_pkey", - "x509_store", - "ssl_ctx", - "ssl_cert", - "ssl_session", - "ssl_sess_cert", - "ssl", - "ssl_method", - "rand", - "rand2", - "debug_malloc", - "BIO", - "gethostbyname", - "getservbyname", - "readdir", - "RSA_blinding", - "dh", - "debug_malloc2", - "dso", - "dynlock", - "engine", - "ui", - "ecdsa", - "ec", - "ecdh", - "bn", - "ec_pre_comp", - "store", - "comp", - "fips", - "fips2", -#if CRYPTO_NUM_LOCKS != 41 -# error "Inconsistency between crypto.h and cryptlib.c" -#endif -}; - -/* This is for applications to allocate new type names in the non-dynamic - array of lock names. These are numbered with positive numbers. */ -static STACK_OF(OPENSSL_STRING) *app_locks = NULL; - -/* For applications that want a more dynamic way of handling threads, the - following stack is used. These are externally numbered with negative - numbers. */ -static STACK_OF(CRYPTO_dynlock) *dyn_locks = NULL; static void (*locking_callback)(int mode, int type, - const char *file, int line) = 0; + const char *file, int line) = NULL; static int (*add_lock_callback)(int *pointer, int amount, - int type, const char *file, int line) = 0; -#ifndef OPENSSL_NO_DEPRECATED -static unsigned long (*id_callback)(void) = 0; -#endif -static void (*threadid_callback)(CRYPTO_THREADID *) = 0; -static struct CRYPTO_dynlock_value *(*dynlock_create_callback)( - const char *file, int line) = 0; -static void (*dynlock_lock_callback)(int mode, - struct CRYPTO_dynlock_value *l, const char *file, int line) = 0; -static void (*dynlock_destroy_callback)(struct CRYPTO_dynlock_value *l, - const char *file, int line) = 0; - -int -CRYPTO_get_new_lockid(char *name) -{ - char *str; - int i; - - if ((app_locks == NULL) && - ((app_locks = sk_OPENSSL_STRING_new_null()) == NULL)) { - CRYPTOerror(ERR_R_MALLOC_FAILURE); - return (0); - } - if (name == NULL || (str = strdup(name)) == NULL) { - CRYPTOerror(ERR_R_MALLOC_FAILURE); - return (0); - } - i = sk_OPENSSL_STRING_push(app_locks, str); - if (!i) - free(str); - else - i += CRYPTO_NUM_LOCKS; /* gap of one :-) */ - return (i); -} + int type, const char *file, int line) = NULL; int CRYPTO_num_locks(void) { - return CRYPTO_NUM_LOCKS; + return 1; } -int -CRYPTO_get_new_dynlockid(void) -{ - int i = 0; - CRYPTO_dynlock *pointer = NULL; - - if (dynlock_create_callback == NULL) { - CRYPTOerror(CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK); - return (0); - } - CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK); - if ((dyn_locks == NULL) && - ((dyn_locks = sk_CRYPTO_dynlock_new_null()) == NULL)) { - CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); - CRYPTOerror(ERR_R_MALLOC_FAILURE); - return (0); - } - CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); - - pointer = malloc(sizeof(CRYPTO_dynlock)); - if (pointer == NULL) { - CRYPTOerror(ERR_R_MALLOC_FAILURE); - return (0); - } - pointer->references = 1; - pointer->data = dynlock_create_callback(__FILE__, __LINE__); - if (pointer->data == NULL) { - free(pointer); - CRYPTOerror(ERR_R_MALLOC_FAILURE); - return (0); - } - - CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK); - /* First, try to find an existing empty slot */ - i = sk_CRYPTO_dynlock_find(dyn_locks, NULL); - /* If there was none, push, thereby creating a new one */ - if (i == -1) - /* Since sk_push() returns the number of items on the - stack, not the location of the pushed item, we need - to transform the returned number into a position, - by decreasing it. */ - i = sk_CRYPTO_dynlock_push(dyn_locks, pointer) - 1; - else - /* If we found a place with a NULL pointer, put our pointer - in it. */ - (void)sk_CRYPTO_dynlock_set(dyn_locks, i, pointer); - CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); - - if (i == -1) { - dynlock_destroy_callback(pointer->data, __FILE__, __LINE__); - free(pointer); - } else - i += 1; /* to avoid 0 */ - return -i; +unsigned long +(*CRYPTO_get_id_callback(void))(void) +{ + return NULL; } void -CRYPTO_destroy_dynlockid(int i) +CRYPTO_set_id_callback(unsigned long (*func)(void)) { - CRYPTO_dynlock *pointer = NULL; - - if (i) - i = -i - 1; - if (dynlock_destroy_callback == NULL) - return; - - CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK); - - if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks)) { - CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); - return; - } - pointer = sk_CRYPTO_dynlock_value(dyn_locks, i); - if (pointer != NULL) { - --pointer->references; - if (pointer->references <= 0) { - (void)sk_CRYPTO_dynlock_set(dyn_locks, i, NULL); - } else - pointer = NULL; - } - CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); - - if (pointer) { - dynlock_destroy_callback(pointer->data, __FILE__, __LINE__); - free(pointer); - } + return; } -struct CRYPTO_dynlock_value * -CRYPTO_get_dynlock_value(int i) +unsigned long +CRYPTO_thread_id(void) { - CRYPTO_dynlock *pointer = NULL; - - if (i) - i = -i - 1; - - CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK); - - if (dyn_locks != NULL && i < sk_CRYPTO_dynlock_num(dyn_locks)) - pointer = sk_CRYPTO_dynlock_value(dyn_locks, i); - if (pointer) - pointer->references++; - - CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); - - if (pointer) - return pointer->data; - return NULL; + return (unsigned long)pthread_self(); } -struct CRYPTO_dynlock_value * -(*CRYPTO_get_dynlock_create_callback(void))(const char *file, int line) +void +CRYPTO_set_locking_callback(void (*func)(int mode, int lock_num, + const char *file, int line)) { - return (dynlock_create_callback); + locking_callback = func; } void -(*CRYPTO_get_dynlock_lock_callback(void))(int mode, - struct CRYPTO_dynlock_value *l, const char *file, int line) +(*CRYPTO_get_locking_callback(void))(int mode, int lock_num, + const char *file, int line) { - return (dynlock_lock_callback); + return locking_callback; } void -(*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l, +CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int lock_num, + const char *file, int line)) +{ + add_lock_callback = func; +} + +int +(*CRYPTO_get_add_lock_callback(void))(int *num, int mount, int type, const char *file, int line) { - return (dynlock_destroy_callback); + return add_lock_callback; } -void -CRYPTO_set_dynlock_create_callback( - struct CRYPTO_dynlock_value *(*func)(const char *file, int line)) +const char * +CRYPTO_get_lock_name(int lock_num) { - dynlock_create_callback = func; + return ""; } -void -CRYPTO_set_dynlock_lock_callback(void (*func)(int mode, - struct CRYPTO_dynlock_value *l, const char *file, int line)) +struct CRYPTO_dynlock_value * +CRYPTO_get_dynlock_value(int i) { - dynlock_lock_callback = func; + return NULL; } -void -CRYPTO_set_dynlock_destroy_callback( - void (*func)(struct CRYPTO_dynlock_value *l, const char *file, int line)) +int CRYPTO_get_new_dynlockid(void) { - dynlock_destroy_callback = func; + return 0; } void -(*CRYPTO_get_locking_callback(void))(int mode, int type, const char *file, - int line) +CRYPTO_destroy_dynlockid(int i) { - return (locking_callback); + return; } -int -(*CRYPTO_get_add_lock_callback(void))(int *num, int mount, int type, - const char *file, int line) +int CRYPTO_get_new_lockid(char *name) { - return (add_lock_callback); + return 0; } -void -CRYPTO_set_locking_callback(void (*func)(int mode, int type, - const char *file, int line)) +int +CRYPTO_THREADID_set_callback(void (*func)(CRYPTO_THREADID *)) { - /* Calling this here ensures initialisation before any threads - * are started. - */ - locking_callback = func; + return 1; } void -CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int type, - const char *file, int line)) +(*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *) { - add_lock_callback = func; + return NULL; } -/* the memset() here and in set_pointer() seem overkill, but for the sake of - * CRYPTO_THREADID_cmp() this avoids any platform silliness that might cause two - * "equal" THREADID structs to not be memcmp()-identical. */ void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val) { - memset(id, 0, sizeof(*id)); - id->val = val; + return; } void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) { - memset(id, 0, sizeof(*id)); - id->ptr = ptr; -#if ULONG_MAX >= UINTPTR_MAX - /*s u 'ptr' can be embedded in 'val' without loss of uniqueness */ - id->val = (uintptr_t)id->ptr; -#else - { - SHA256_CTX ctx; - uint8_t results[SHA256_DIGEST_LENGTH]; - - SHA256_Init(&ctx); - SHA256_Update(&ctx, (char *)(&id->ptr), sizeof(id->ptr)); - SHA256_Final(results, &ctx); - memcpy(&id->val, results, sizeof(id->val)); - } -#endif + return; } -int -CRYPTO_THREADID_set_callback(void (*func)(CRYPTO_THREADID *)) +void +CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *( + *dyn_create_function)(const char *file, int line)) { - if (threadid_callback) - return 0; - threadid_callback = func; - return 1; + return; } -void (*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *) +void +CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)( + int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)) { - return threadid_callback; + return; } void -CRYPTO_THREADID_current(CRYPTO_THREADID *id) +CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)( + struct CRYPTO_dynlock_value *l, const char *file, int line)) { - if (threadid_callback) { - threadid_callback(id); - return; - } -#ifndef OPENSSL_NO_DEPRECATED - /* If the deprecated callback was set, fall back to that */ - if (id_callback) { - CRYPTO_THREADID_set_numeric(id, id_callback()); - return; - } -#endif - /* Else pick a backup */ - /* For everything else, default to using the address of 'errno' */ - CRYPTO_THREADID_set_pointer(id, (void*)&errno); + return; } -int -CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b) +struct CRYPTO_dynlock_value * +(*CRYPTO_get_dynlock_create_callback(void))( + const char *file, int line) { - return memcmp(a, b, sizeof(*a)); + return NULL; } void -CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src) -{ - memcpy(dest, src, sizeof(*src)); -} - -unsigned long -CRYPTO_THREADID_hash(const CRYPTO_THREADID *id) +(*CRYPTO_get_dynlock_lock_callback(void))(int mode, + struct CRYPTO_dynlock_value *l, const char *file, int line) { - return id->val; + return NULL; } -#ifndef OPENSSL_NO_DEPRECATED -unsigned long (*CRYPTO_get_id_callback(void))(void) +void +(*CRYPTO_get_dynlock_destroy_callback(void))( + struct CRYPTO_dynlock_value *l, const char *file, int line) { - return (id_callback); + return NULL; } void -CRYPTO_set_id_callback(unsigned long (*func)(void)) +CRYPTO_THREADID_current(CRYPTO_THREADID *id) { - id_callback = func; + memset(id, 0, sizeof(*id)); + id->val = (unsigned long)pthread_self(); } -unsigned long -CRYPTO_thread_id(void) +int +CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b) { - unsigned long ret = 0; - - if (id_callback == NULL) { - ret = (unsigned long)getpid(); - } else - ret = id_callback(); - return (ret); + return memcmp(a, b, sizeof(*a)); } -#endif void -CRYPTO_lock(int mode, int type, const char *file, int line) -{ -#ifdef LOCK_DEBUG - { - CRYPTO_THREADID id; - char *rw_text, *operation_text; - - if (mode & CRYPTO_LOCK) - operation_text = "lock "; - else if (mode & CRYPTO_UNLOCK) - operation_text = "unlock"; - else - operation_text = "ERROR "; - - if (mode & CRYPTO_READ) - rw_text = "r"; - else if (mode & CRYPTO_WRITE) - rw_text = "w"; - else - rw_text = "ERROR"; - - CRYPTO_THREADID_current(&id); - fprintf(stderr, "lock:%08lx:(%s)%s %-18s %s:%d\n", - CRYPTO_THREADID_hash(&id), rw_text, operation_text, - CRYPTO_get_lock_name(type), file, line); - } -#endif - if (type < 0) { - if (dynlock_lock_callback != NULL) { - struct CRYPTO_dynlock_value *pointer = - CRYPTO_get_dynlock_value(type); - - OPENSSL_assert(pointer != NULL); - - dynlock_lock_callback(mode, pointer, file, line); - - CRYPTO_destroy_dynlockid(type); - } - } else if (locking_callback != NULL) - locking_callback(mode, type, file, line); -} - -int -CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, - int line) +CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src) { - int ret = 0; - - if (add_lock_callback != NULL) { -#ifdef LOCK_DEBUG - int before= *pointer; -#endif - - ret = add_lock_callback(pointer, amount, type, file, line); -#ifdef LOCK_DEBUG - { - CRYPTO_THREADID id; - CRYPTO_THREADID_current(&id); - fprintf(stderr, "ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\n", - CRYPTO_THREADID_hash(&id), before, amount, ret, - CRYPTO_get_lock_name(type), - file, line); - } -#endif - } else { - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE, type, file, line); - - ret= *pointer + amount; -#ifdef LOCK_DEBUG - { - CRYPTO_THREADID id; - CRYPTO_THREADID_current(&id); - fprintf(stderr, "ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\n", - CRYPTO_THREADID_hash(&id), *pointer, amount, ret, - CRYPTO_get_lock_name(type), file, line); - } -#endif - *pointer = ret; - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE, type, file, line); - } - return (ret); + memcpy(dest, src, sizeof(*src)); } -const char * -CRYPTO_get_lock_name(int type) +unsigned long +CRYPTO_THREADID_hash(const CRYPTO_THREADID *id) { - if (type < 0) - return("dynamic"); - else if (type < CRYPTO_NUM_LOCKS) - return (lock_names[type]); - else if (type - CRYPTO_NUM_LOCKS > sk_OPENSSL_STRING_num(app_locks)) - return("ERROR"); - else - return (sk_OPENSSL_STRING_value(app_locks, - type - CRYPTO_NUM_LOCKS)); + return id->val; } #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ @@ -663,10 +345,11 @@ OPENSSL_cpuid_setup(void) static void OPENSSL_showfatal(const char *fmta, ...) { + struct syslog_data sdata = SYSLOG_DATA_INIT; va_list ap; va_start(ap, fmta); - vfprintf(stderr, fmta, ap); + vsyslog_r(LOG_INFO|LOG_LOCAL2, &sdata, fmta, ap); va_end(ap); } @@ -674,9 +357,9 @@ void OpenSSLDie(const char *file, int line, const char *assertion) { OPENSSL_showfatal( - "%s(%d): OpenSSL internal error, assertion failed: %s\n", - file, line, assertion); - abort(); + "uid %u cmd %s %s(%d): OpenSSL internal error, assertion failed: %s\n", + getuid(), getprogname(), file, line, assertion); + _exit(1); } int diff --git a/crypto/crypto.sym b/crypto/crypto.sym index b8ea33bf..5f11f330 100644 --- a/crypto/crypto.sym +++ b/crypto/crypto.sym @@ -104,6 +104,7 @@ ASN1_STRING_copy ASN1_STRING_data ASN1_STRING_dup ASN1_STRING_free +ASN1_STRING_get0_data ASN1_STRING_get_default_mask ASN1_STRING_length ASN1_STRING_length_set @@ -198,15 +199,12 @@ ASN1_item_verify ASN1_mbstring_copy ASN1_mbstring_ncopy ASN1_object_size -ASN1_pack_string ASN1_parse ASN1_parse_dump ASN1_primitive_free ASN1_primitive_new ASN1_put_eoc ASN1_put_object -ASN1_seq_pack -ASN1_seq_unpack ASN1_tag2bit ASN1_tag2str ASN1_template_d2i @@ -216,7 +214,6 @@ ASN1_template_new ASN1_time_parse ASN1_time_tm_clamp_notafter ASN1_time_tm_cmp -ASN1_unpack_string AUTHORITY_INFO_ACCESS_free AUTHORITY_INFO_ACCESS_it AUTHORITY_INFO_ACCESS_new @@ -275,16 +272,37 @@ BIO_free_all BIO_get_accept_socket BIO_get_callback BIO_get_callback_arg +BIO_get_data BIO_get_ex_data BIO_get_ex_new_index BIO_get_host_ip +BIO_get_new_index BIO_get_port BIO_get_retry_BIO BIO_get_retry_reason +BIO_get_shutdown BIO_gethostbyname BIO_gets BIO_indent BIO_int_ctrl +BIO_meth_free +BIO_meth_get_callback_ctrl +BIO_meth_get_create +BIO_meth_get_ctrl +BIO_meth_get_destroy +BIO_meth_get_gets +BIO_meth_get_puts +BIO_meth_get_read +BIO_meth_get_write +BIO_meth_new +BIO_meth_set_callback_ctrl +BIO_meth_set_create +BIO_meth_set_ctrl +BIO_meth_set_destroy +BIO_meth_set_gets +BIO_meth_set_puts +BIO_meth_set_read +BIO_meth_set_write BIO_method_name BIO_method_type BIO_new @@ -326,8 +344,11 @@ BIO_set BIO_set_callback BIO_set_callback_arg BIO_set_cipher +BIO_set_data BIO_set_ex_data BIO_set_flags +BIO_set_init +BIO_set_shutdown BIO_set_tcp_ndelay BIO_snprintf BIO_sock_cleanup @@ -338,6 +359,7 @@ BIO_sock_should_retry BIO_socket_ioctl BIO_socket_nbio BIO_test_flags +BIO_up_ref BIO_vfree BIO_vprintf BIO_vsnprintf @@ -362,6 +384,9 @@ BN_CTX_init BN_CTX_new BN_CTX_start BN_GENCB_call +BN_GENCB_free +BN_GENCB_get_arg +BN_GENCB_new BN_GF2m_add BN_GF2m_arr2poly BN_GF2m_mod @@ -425,6 +450,14 @@ BN_get0_nist_prime_256 BN_get0_nist_prime_384 BN_get0_nist_prime_521 BN_get_params +BN_get_rfc2409_prime_1024 +BN_get_rfc2409_prime_768 +BN_get_rfc3526_prime_1536 +BN_get_rfc3526_prime_2048 +BN_get_rfc3526_prime_3072 +BN_get_rfc3526_prime_4096 +BN_get_rfc3526_prime_6144 +BN_get_rfc3526_prime_8192 BN_get_word BN_hex2bn BN_init @@ -634,6 +667,7 @@ CRYPTO_get_mem_ex_functions CRYPTO_get_mem_functions CRYPTO_get_new_dynlockid CRYPTO_get_new_lockid +CRYPTO_hchacha_20 CRYPTO_is_mem_check_on CRYPTO_lock CRYPTO_malloc @@ -675,6 +709,7 @@ CRYPTO_set_mem_ex_functions CRYPTO_set_mem_functions CRYPTO_strdup CRYPTO_thread_id +CRYPTO_xchacha_20 CRYPTO_xts128_encrypt Camellia_cbc_encrypt Camellia_cfb128_encrypt @@ -728,22 +763,32 @@ DES_string_to_2keys DES_string_to_key DES_xcbc_encrypt DH_OpenSSL +DH_bits DH_check DH_check_pub_key +DH_clear_flags DH_compute_key DH_free DH_generate_key DH_generate_parameters DH_generate_parameters_ex +DH_get0_engine +DH_get0_key +DH_get0_pqg DH_get_default_method DH_get_ex_data DH_get_ex_new_index DH_new DH_new_method +DH_set0_key +DH_set0_pqg DH_set_default_method DH_set_ex_data +DH_set_flags +DH_set_length DH_set_method DH_size +DH_test_flags DH_up_ref DHparams_dup DHparams_it @@ -766,8 +811,11 @@ DSAPrivateKey_it DSAPublicKey_it DSA_OpenSSL DSA_SIG_free +DSA_SIG_get0 DSA_SIG_it DSA_SIG_new +DSA_SIG_set0 +DSA_clear_flags DSA_do_sign DSA_do_verify DSA_dup_DH @@ -775,19 +823,31 @@ DSA_free DSA_generate_key DSA_generate_parameters DSA_generate_parameters_ex +DSA_get0_engine +DSA_get0_key +DSA_get0_pqg DSA_get_default_method DSA_get_ex_data DSA_get_ex_new_index +DSA_meth_dup +DSA_meth_free +DSA_meth_new +DSA_meth_set_finish +DSA_meth_set_sign DSA_new DSA_new_method DSA_print DSA_print_fp +DSA_set0_key +DSA_set0_pqg DSA_set_default_method DSA_set_ex_data +DSA_set_flags DSA_set_method DSA_sign DSA_sign_setup DSA_size +DSA_test_flags DSA_up_ref DSA_verify DSAparams_dup @@ -829,8 +889,10 @@ ECDH_set_method ECDH_size ECDSA_OpenSSL ECDSA_SIG_free +ECDSA_SIG_get0 ECDSA_SIG_it ECDSA_SIG_new +ECDSA_SIG_set0 ECDSA_do_sign ECDSA_do_sign_ex ECDSA_do_verify @@ -895,6 +957,19 @@ EC_GROUP_set_curve_name EC_GROUP_set_generator EC_GROUP_set_point_conversion_form EC_GROUP_set_seed +EC_KEY_METHOD_free +EC_KEY_METHOD_get_compute_key +EC_KEY_METHOD_get_init +EC_KEY_METHOD_get_keygen +EC_KEY_METHOD_get_sign +EC_KEY_METHOD_get_verify +EC_KEY_METHOD_new +EC_KEY_METHOD_set_compute_key +EC_KEY_METHOD_set_init +EC_KEY_METHOD_set_keygen +EC_KEY_METHOD_set_sign +EC_KEY_METHOD_set_verify +EC_KEY_OpenSSL EC_KEY_check_key EC_KEY_clear_flags EC_KEY_copy @@ -905,20 +980,27 @@ EC_KEY_get0_group EC_KEY_get0_private_key EC_KEY_get0_public_key EC_KEY_get_conv_form +EC_KEY_get_default_method EC_KEY_get_enc_flags +EC_KEY_get_ex_data EC_KEY_get_flags EC_KEY_get_key_method_data +EC_KEY_get_method EC_KEY_insert_key_method_data EC_KEY_new EC_KEY_new_by_curve_name +EC_KEY_new_method EC_KEY_precompute_mult EC_KEY_print EC_KEY_print_fp EC_KEY_set_asn1_flag EC_KEY_set_conv_form +EC_KEY_set_default_method EC_KEY_set_enc_flags +EC_KEY_set_ex_data EC_KEY_set_flags EC_KEY_set_group +EC_KEY_set_method EC_KEY_set_private_key EC_KEY_set_public_key EC_KEY_set_public_key_affine_coordinates @@ -976,6 +1058,7 @@ ENGINE_finish ENGINE_free ENGINE_get_DH ENGINE_get_DSA +ENGINE_get_EC ENGINE_get_ECDH ENGINE_get_ECDSA ENGINE_get_RAND @@ -988,6 +1071,7 @@ ENGINE_get_cmd_defns ENGINE_get_ctrl_function ENGINE_get_default_DH ENGINE_get_default_DSA +ENGINE_get_default_EC ENGINE_get_default_ECDH ENGINE_get_default_ECDSA ENGINE_get_default_RAND @@ -1030,6 +1114,7 @@ ENGINE_new ENGINE_pkey_asn1_find_str ENGINE_register_DH ENGINE_register_DSA +ENGINE_register_EC ENGINE_register_ECDH ENGINE_register_ECDSA ENGINE_register_RAND @@ -1037,6 +1122,7 @@ ENGINE_register_RSA ENGINE_register_STORE ENGINE_register_all_DH ENGINE_register_all_DSA +ENGINE_register_all_EC ENGINE_register_all_ECDH ENGINE_register_all_ECDSA ENGINE_register_all_RAND @@ -1055,6 +1141,7 @@ ENGINE_register_pkey_meths ENGINE_remove ENGINE_set_DH ENGINE_set_DSA +ENGINE_set_EC ENGINE_set_ECDH ENGINE_set_ECDSA ENGINE_set_RAND @@ -1066,6 +1153,7 @@ ENGINE_set_ctrl_function ENGINE_set_default ENGINE_set_default_DH ENGINE_set_default_DSA +ENGINE_set_default_EC ENGINE_set_default_ECDH ENGINE_set_default_ECDSA ENGINE_set_default_RAND @@ -1091,6 +1179,7 @@ ENGINE_set_pkey_meths ENGINE_set_table_flags ENGINE_unregister_DH ENGINE_unregister_DSA +ENGINE_unregister_EC ENGINE_unregister_ECDH ENGINE_unregister_ECDSA ENGINE_unregister_RAND @@ -1194,17 +1283,21 @@ EVP_CIPHER_CTX_cleanup EVP_CIPHER_CTX_clear_flags EVP_CIPHER_CTX_copy EVP_CIPHER_CTX_ctrl +EVP_CIPHER_CTX_encrypting EVP_CIPHER_CTX_flags EVP_CIPHER_CTX_free EVP_CIPHER_CTX_get_app_data +EVP_CIPHER_CTX_get_iv EVP_CIPHER_CTX_init EVP_CIPHER_CTX_iv_length EVP_CIPHER_CTX_key_length EVP_CIPHER_CTX_new EVP_CIPHER_CTX_nid EVP_CIPHER_CTX_rand_key +EVP_CIPHER_CTX_reset EVP_CIPHER_CTX_set_app_data EVP_CIPHER_CTX_set_flags +EVP_CIPHER_CTX_set_iv EVP_CIPHER_CTX_set_key_length EVP_CIPHER_CTX_set_padding EVP_CIPHER_CTX_test_flags @@ -1245,6 +1338,8 @@ EVP_DigestSignInit EVP_DigestUpdate EVP_DigestVerifyFinal EVP_DigestVerifyInit +EVP_ENCODE_CTX_free +EVP_ENCODE_CTX_new EVP_EncodeBlock EVP_EncodeFinal EVP_EncodeInit @@ -1261,8 +1356,11 @@ EVP_MD_CTX_copy_ex EVP_MD_CTX_create EVP_MD_CTX_ctrl EVP_MD_CTX_destroy +EVP_MD_CTX_free EVP_MD_CTX_init EVP_MD_CTX_md +EVP_MD_CTX_new +EVP_MD_CTX_reset EVP_MD_CTX_set_flags EVP_MD_CTX_test_flags EVP_MD_block_size @@ -1281,7 +1379,6 @@ EVP_PBE_cleanup EVP_PBE_find EVP_PKCS82PKEY EVP_PKEY2PKCS8 -EVP_PKEY2PKCS8_broken EVP_PKEY_CTX_ctrl EVP_PKEY_CTX_ctrl_str EVP_PKEY_CTX_dup @@ -1336,7 +1433,12 @@ EVP_PKEY_encrypt_init EVP_PKEY_encrypt_old EVP_PKEY_free EVP_PKEY_get0 +EVP_PKEY_get0_DH +EVP_PKEY_get0_DSA +EVP_PKEY_get0_EC_KEY +EVP_PKEY_get0_RSA EVP_PKEY_get0_asn1 +EVP_PKEY_get0_hmac EVP_PKEY_get1_DH EVP_PKEY_get1_DSA EVP_PKEY_get1_EC_KEY @@ -1388,6 +1490,7 @@ EVP_PKEY_sign EVP_PKEY_sign_init EVP_PKEY_size EVP_PKEY_type +EVP_PKEY_up_ref EVP_PKEY_verify EVP_PKEY_verify_init EVP_PKEY_verify_recover @@ -1401,6 +1504,7 @@ EVP_add_digest EVP_aead_aes_128_gcm EVP_aead_aes_256_gcm EVP_aead_chacha20_poly1305 +EVP_aead_xchacha20_poly1305 EVP_aes_128_cbc EVP_aes_128_cbc_hmac_sha1 EVP_aes_128_ccm @@ -1412,6 +1516,7 @@ EVP_aes_128_ctr EVP_aes_128_ecb EVP_aes_128_gcm EVP_aes_128_ofb +EVP_aes_128_wrap EVP_aes_128_xts EVP_aes_192_cbc EVP_aes_192_ccm @@ -1423,6 +1528,7 @@ EVP_aes_192_ctr EVP_aes_192_ecb EVP_aes_192_gcm EVP_aes_192_ofb +EVP_aes_192_wrap EVP_aes_256_cbc EVP_aes_256_cbc_hmac_sha1 EVP_aes_256_ccm @@ -1434,6 +1540,7 @@ EVP_aes_256_ctr EVP_aes_256_ecb EVP_aes_256_gcm EVP_aes_256_ofb +EVP_aes_256_wrap EVP_aes_256_xts EVP_bf_cbc EVP_bf_cfb @@ -1527,6 +1634,12 @@ EVP_sha224 EVP_sha256 EVP_sha384 EVP_sha512 +EVP_sm3 +EVP_sm4_cbc +EVP_sm4_cfb128 +EVP_sm4_ctr +EVP_sm4_ecb +EVP_sm4_ofb EVP_streebog256 EVP_streebog512 EVP_whirlpool @@ -1580,14 +1693,17 @@ Gost2814789_cnt_encrypt Gost2814789_ecb_encrypt Gost2814789_set_key Gost2814789_set_sbox -Gost28147_TestParamSet HKDF HKDF_expand HKDF_extract HMAC HMAC_CTX_cleanup HMAC_CTX_copy +HMAC_CTX_free +HMAC_CTX_get_md HMAC_CTX_init +HMAC_CTX_new +HMAC_CTX_reset HMAC_CTX_set_flags HMAC_Final HMAC_Init @@ -1761,6 +1877,7 @@ OCSP_SINGLERESP_add1_ext_i2d OCSP_SINGLERESP_add_ext OCSP_SINGLERESP_delete_ext OCSP_SINGLERESP_free +OCSP_SINGLERESP_get0_id OCSP_SINGLERESP_get1_ext_d2i OCSP_SINGLERESP_get_ext OCSP_SINGLERESP_get_ext_by_NID @@ -1819,6 +1936,7 @@ OPENSSL_config OPENSSL_cpu_caps OPENSSL_cpuid_setup OPENSSL_init +OPENSSL_init_crypto OPENSSL_load_builtin_modules OPENSSL_no_config OPENSSL_strcasecmp @@ -1831,6 +1949,8 @@ OTHERNAME_new OpenSSLDie OpenSSL_add_all_ciphers OpenSSL_add_all_digests +OpenSSL_version +OpenSSL_version_num PBE2PARAM_free PBE2PARAM_it PBE2PARAM_new @@ -2110,9 +2230,10 @@ PKCS8_PRIV_KEY_INFO_new PKCS8_add_keyusage PKCS8_decrypt PKCS8_encrypt +PKCS8_pkey_add1_attr_by_NID PKCS8_pkey_get0 +PKCS8_pkey_get0_attrs PKCS8_pkey_set0 -PKCS8_set_broken PKEY_USAGE_PERIOD_free PKEY_USAGE_PERIOD_it PKEY_USAGE_PERIOD_new @@ -2173,17 +2294,30 @@ RSA_PSS_PARAMS_free RSA_PSS_PARAMS_it RSA_PSS_PARAMS_new RSA_X931_hash_id +RSA_bits RSA_blinding_off RSA_blinding_on RSA_check_key +RSA_clear_flags RSA_flags RSA_free RSA_generate_key RSA_generate_key_ex +RSA_get0_crt_params +RSA_get0_factors +RSA_get0_key RSA_get_default_method RSA_get_ex_data RSA_get_ex_new_index RSA_get_method +RSA_meth_dup +RSA_meth_free +RSA_meth_get_finish +RSA_meth_new +RSA_meth_set1_name +RSA_meth_set_finish +RSA_meth_set_priv_dec +RSA_meth_set_priv_enc RSA_new RSA_new_method RSA_padding_add_PKCS1_OAEP @@ -2204,13 +2338,18 @@ RSA_private_decrypt RSA_private_encrypt RSA_public_decrypt RSA_public_encrypt +RSA_set0_crt_params +RSA_set0_factors +RSA_set0_key RSA_set_default_method RSA_set_ex_data +RSA_set_flags RSA_set_method RSA_setup_blinding RSA_sign RSA_sign_ASN1_OCTET_STRING RSA_size +RSA_test_flags RSA_up_ref RSA_verify RSA_verify_ASN1_OCTET_STRING @@ -2239,6 +2378,12 @@ SHA512_Final SHA512_Init SHA512_Transform SHA512_Update +SM3_Final +SM3_Init +SM3_Update +SM4_decrypt +SM4_encrypt +SM4_set_key SMIME_crlf_copy SMIME_read_ASN1 SMIME_read_PKCS7 @@ -2569,18 +2714,30 @@ X509_CRL_dup X509_CRL_free X509_CRL_get0_by_cert X509_CRL_get0_by_serial +X509_CRL_get0_extensions +X509_CRL_get0_lastUpdate +X509_CRL_get0_nextUpdate +X509_CRL_get0_signature +X509_CRL_get_REVOKED X509_CRL_get_ext X509_CRL_get_ext_by_NID X509_CRL_get_ext_by_OBJ X509_CRL_get_ext_by_critical X509_CRL_get_ext_count X509_CRL_get_ext_d2i +X509_CRL_get_issuer +X509_CRL_get_lastUpdate X509_CRL_get_meth_data +X509_CRL_get_nextUpdate +X509_CRL_get_signature_nid +X509_CRL_get_version X509_CRL_it X509_CRL_match X509_CRL_new X509_CRL_print X509_CRL_print_fp +X509_CRL_set1_lastUpdate +X509_CRL_set1_nextUpdate X509_CRL_set_default_method X509_CRL_set_issuer_name X509_CRL_set_lastUpdate @@ -2590,6 +2747,7 @@ X509_CRL_set_version X509_CRL_sign X509_CRL_sign_ctx X509_CRL_sort +X509_CRL_up_ref X509_CRL_verify X509_EXTENSIONS_it X509_EXTENSION_create_by_NID @@ -2628,6 +2786,7 @@ X509_NAME_ENTRY_get_data X509_NAME_ENTRY_get_object X509_NAME_ENTRY_it X509_NAME_ENTRY_new +X509_NAME_ENTRY_set X509_NAME_ENTRY_set_data X509_NAME_ENTRY_set_object X509_NAME_INTERNAL_it @@ -2641,6 +2800,7 @@ X509_NAME_digest X509_NAME_dup X509_NAME_entry_count X509_NAME_free +X509_NAME_get0_der X509_NAME_get_entry X509_NAME_get_index_by_NID X509_NAME_get_index_by_OBJ @@ -2656,6 +2816,9 @@ X509_NAME_print_ex X509_NAME_print_ex_fp X509_NAME_set X509_OBJECT_free_contents +X509_OBJECT_get0_X509 +X509_OBJECT_get0_X509_CRL +X509_OBJECT_get_type X509_OBJECT_idx_by_subject X509_OBJECT_retrieve_by_subject X509_OBJECT_retrieve_match @@ -2665,6 +2828,7 @@ X509_PKEY_new X509_POLICY_NODE_print X509_PUBKEY_free X509_PUBKEY_get +X509_PUBKEY_get0 X509_PUBKEY_get0_param X509_PUBKEY_it X509_PUBKEY_new @@ -2696,6 +2860,7 @@ X509_REQ_digest X509_REQ_dup X509_REQ_extension_nid X509_REQ_free +X509_REQ_get0_signature X509_REQ_get1_email X509_REQ_get_attr X509_REQ_get_attr_by_NID @@ -2704,6 +2869,9 @@ X509_REQ_get_attr_count X509_REQ_get_extension_nids X509_REQ_get_extensions X509_REQ_get_pubkey +X509_REQ_get_signature_nid +X509_REQ_get_subject_name +X509_REQ_get_version X509_REQ_it X509_REQ_new X509_REQ_print @@ -2720,7 +2888,11 @@ X509_REQ_verify X509_REVOKED_add1_ext_i2d X509_REVOKED_add_ext X509_REVOKED_delete_ext +X509_REVOKED_dup X509_REVOKED_free +X509_REVOKED_get0_extensions +X509_REVOKED_get0_revocationDate +X509_REVOKED_get0_serialNumber X509_REVOKED_get_ext X509_REVOKED_get_ext_by_NID X509_REVOKED_get_ext_by_OBJ @@ -2736,11 +2908,15 @@ X509_SIG_it X509_SIG_new X509_STORE_CTX_cleanup X509_STORE_CTX_free +X509_STORE_CTX_get0_cert +X509_STORE_CTX_get0_chain X509_STORE_CTX_get0_current_crl X509_STORE_CTX_get0_current_issuer X509_STORE_CTX_get0_param X509_STORE_CTX_get0_parent_ctx X509_STORE_CTX_get0_policy_tree +X509_STORE_CTX_get0_store +X509_STORE_CTX_get0_untrusted X509_STORE_CTX_get1_chain X509_STORE_CTX_get1_issuer X509_STORE_CTX_get_chain @@ -2755,6 +2931,8 @@ X509_STORE_CTX_new X509_STORE_CTX_purpose_inherit X509_STORE_CTX_set0_crls X509_STORE_CTX_set0_param +X509_STORE_CTX_set0_trusted_stack +X509_STORE_CTX_set0_untrusted X509_STORE_CTX_set_cert X509_STORE_CTX_set_chain X509_STORE_CTX_set_default @@ -2771,19 +2949,24 @@ X509_STORE_add_cert X509_STORE_add_crl X509_STORE_add_lookup X509_STORE_free +X509_STORE_get0_objects +X509_STORE_get0_param X509_STORE_get1_certs X509_STORE_get1_crls X509_STORE_get_by_subject +X509_STORE_get_ex_data X509_STORE_load_locations X509_STORE_load_mem X509_STORE_new X509_STORE_set1_param X509_STORE_set_default_paths X509_STORE_set_depth +X509_STORE_set_ex_data X509_STORE_set_flags X509_STORE_set_purpose X509_STORE_set_trust X509_STORE_set_verify_cb +X509_STORE_up_ref X509_TRUST_add X509_TRUST_cleanup X509_TRUST_get0 @@ -2799,18 +2982,28 @@ X509_VAL_it X509_VAL_new X509_VERIFY_PARAM_add0_policy X509_VERIFY_PARAM_add0_table +X509_VERIFY_PARAM_add1_host X509_VERIFY_PARAM_clear_flags X509_VERIFY_PARAM_free +X509_VERIFY_PARAM_get0 +X509_VERIFY_PARAM_get0_name +X509_VERIFY_PARAM_get0_peername +X509_VERIFY_PARAM_get_count X509_VERIFY_PARAM_get_depth X509_VERIFY_PARAM_get_flags X509_VERIFY_PARAM_inherit X509_VERIFY_PARAM_lookup X509_VERIFY_PARAM_new X509_VERIFY_PARAM_set1 +X509_VERIFY_PARAM_set1_email +X509_VERIFY_PARAM_set1_host +X509_VERIFY_PARAM_set1_ip +X509_VERIFY_PARAM_set1_ip_asc X509_VERIFY_PARAM_set1_name X509_VERIFY_PARAM_set1_policies X509_VERIFY_PARAM_set_depth X509_VERIFY_PARAM_set_flags +X509_VERIFY_PARAM_set_hostflags X509_VERIFY_PARAM_set_purpose X509_VERIFY_PARAM_set_time X509_VERIFY_PARAM_set_trust @@ -2822,6 +3015,7 @@ X509_add_ext X509_alias_get0 X509_alias_set1 X509_certificate_type +X509_chain_up_ref X509_check_akid X509_check_ca X509_check_email @@ -2842,7 +3036,14 @@ X509_email_free X509_find_by_issuer_and_serial X509_find_by_subject X509_free +X509_get0_extensions +X509_get0_notAfter +X509_get0_notBefore +X509_get0_pubkey X509_get0_pubkey_bitstr +X509_get0_serialNumber +X509_get0_signature +X509_get0_tbs_sigalg X509_get1_email X509_get1_ocsp X509_get_default_cert_area @@ -2863,7 +3064,12 @@ X509_get_issuer_name X509_get_pubkey X509_get_pubkey_parameters X509_get_serialNumber +X509_get_signature_nid +X509_get_signature_type X509_get_subject_name +X509_get_version +X509_getm_notAfter +X509_getm_notBefore X509_gmtime_adj X509_issuer_and_serial_cmp X509_issuer_and_serial_hash @@ -2895,6 +3101,8 @@ X509_print_ex_fp X509_print_fp X509_pubkey_digest X509_reject_clear +X509_set1_notAfter +X509_set1_notBefore X509_set_ex_data X509_set_issuer_name X509_set_notAfter @@ -2945,6 +3153,13 @@ X9_62_PENTANOMIAL_free X9_62_PENTANOMIAL_it X9_62_PENTANOMIAL_new ZLONG_it +_CONF_add_string +_CONF_free_data +_CONF_get_section +_CONF_get_section_values +_CONF_get_string +_CONF_new_data +_CONF_new_section a2d_ASN1_OBJECT a2i_ASN1_ENUMERATED a2i_ASN1_INTEGER @@ -2953,10 +3168,6 @@ a2i_GENERAL_NAME a2i_IPADDRESS a2i_IPADDRESS_NC a2i_ipadd -asn1_Finish -asn1_GetSequence -asn1_add_error -asn1_const_Finish asn1_do_adb asn1_do_lock asn1_enc_free @@ -2991,7 +3202,6 @@ d2i_ASN1_OCTET_STRING d2i_ASN1_PRINTABLE d2i_ASN1_PRINTABLESTRING d2i_ASN1_SEQUENCE_ANY -d2i_ASN1_SET d2i_ASN1_SET_ANY d2i_ASN1_T61STRING d2i_ASN1_TIME @@ -3001,8 +3211,6 @@ d2i_ASN1_UNIVERSALSTRING d2i_ASN1_UTCTIME d2i_ASN1_UTF8STRING d2i_ASN1_VISIBLESTRING -d2i_ASN1_bytes -d2i_ASN1_type_bytes d2i_AUTHORITY_INFO_ACCESS d2i_AUTHORITY_KEYID d2i_AutoPrivateKey @@ -3201,7 +3409,6 @@ i2d_ASN1_OCTET_STRING i2d_ASN1_PRINTABLE i2d_ASN1_PRINTABLESTRING i2d_ASN1_SEQUENCE_ANY -i2d_ASN1_SET i2d_ASN1_SET_ANY i2d_ASN1_T61STRING i2d_ASN1_TIME @@ -3211,7 +3418,6 @@ i2d_ASN1_UTCTIME i2d_ASN1_UTF8STRING i2d_ASN1_VISIBLESTRING i2d_ASN1_bio_stream -i2d_ASN1_bytes i2d_AUTHORITY_INFO_ACCESS i2d_AUTHORITY_KEYID i2d_BASIC_CONSTRAINTS diff --git a/crypto/crypto_init.c b/crypto/crypto_init.c new file mode 100644 index 00000000..67e79208 --- /dev/null +++ b/crypto/crypto_init.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018 Bob Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* OpenSSL style init */ + +#include +#include + +#include +#include +#include +#include + +#include "cryptlib.h" + +int OpenSSL_config(const char *); +int OpenSSL_no_config(void); + +static pthread_t crypto_init_thread; + +static void +OPENSSL_init_crypto_internal(void) +{ + crypto_init_thread = pthread_self(); + + OPENSSL_cpuid_setup(); + ERR_load_crypto_strings(); + OpenSSL_add_all_ciphers(); + OpenSSL_add_all_digests(); +} + +int +OPENSSL_init_crypto(uint64_t opts, const void *settings) +{ + static pthread_once_t once = PTHREAD_ONCE_INIT; + + if (pthread_equal(pthread_self(), crypto_init_thread)) + return 1; /* don't recurse */ + + if (pthread_once(&once, OPENSSL_init_crypto_internal) != 0) + return 0; + + if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG) && + (OpenSSL_no_config() == 0)) + return 0; + + if ((opts & OPENSSL_INIT_LOAD_CONFIG) && + (OpenSSL_config(NULL) == 0)) + return 0; + + return 1; +} diff --git a/crypto/crypto_lock.c b/crypto/crypto_lock.c new file mode 100644 index 00000000..5d317a81 --- /dev/null +++ b/crypto/crypto_lock.c @@ -0,0 +1,95 @@ +/* $OpenBSD: crypto_lock.c,v 1.2 2018/11/28 15:51:32 jsing Exp $ */ +/* + * Copyright (c) 2018 Brent Cook + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#include + +static pthread_mutex_t locks[] = { + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, +}; + +#define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \ + __attribute__((__unused__)) + +CTASSERT((sizeof(locks) / sizeof(*locks)) == CRYPTO_NUM_LOCKS); + +void +CRYPTO_lock(int mode, int type, const char *file, int line) +{ + if (type < 0 || type >= CRYPTO_NUM_LOCKS) + return; + + if (mode & CRYPTO_LOCK) + (void) pthread_mutex_lock(&locks[type]); + else if (mode & CRYPTO_UNLOCK) + (void) pthread_mutex_unlock(&locks[type]); +} + +int +CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, + int line) +{ + int ret; + + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE, type, file, line); + ret = *pointer + amount; + *pointer = ret; + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE, type, file, line); + + return (ret); +} diff --git a/crypto/cversion.c b/crypto/cversion.c index 7ffa80ec..2d4460d1 100644 --- a/crypto/cversion.c +++ b/crypto/cversion.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cversion.c,v 1.15 2014/07/11 11:42:28 jsing Exp $ */ +/* $OpenBSD: cversion.c,v 1.17 2018/02/17 06:56:12 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -84,3 +84,29 @@ SSLeay(void) { return (SSLEAY_VERSION_NUMBER); } + +const char * +OpenSSL_version(int t) +{ + switch (t) { + case OPENSSL_VERSION: + return OPENSSL_VERSION_TEXT; + case OPENSSL_BUILT_ON: + return("built on: date not available"); + case OPENSSL_CFLAGS: + return("compiler: information not available"); + case OPENSSL_PLATFORM: + return("platform: information not available"); + case OPENSSL_DIR: + return "OPENSSLDIR: \"" OPENSSLDIR "\""; + case OPENSSL_ENGINES_DIR: + return "ENGINESDIR: N/A"; + } + return("not available"); +} + +unsigned long +OpenSSL_version_num(void) +{ + return SSLeay(); +} diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c index 0402092a..5054d17a 100644 --- a/crypto/dh/dh_ameth.c +++ b/crypto/dh/dh_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_ameth.c,v 1.14 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: dh_ameth.c,v 1.17 2018/08/24 20:22:15 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -78,8 +78,8 @@ dh_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey) const unsigned char *p, *pm; int pklen, pmlen; int ptype; - void *pval; - ASN1_STRING *pstr; + const void *pval; + const ASN1_STRING *pstr; X509_ALGOR *palg; ASN1_INTEGER *public_key = NULL; DH *dh = NULL; @@ -180,14 +180,14 @@ dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) */ static int -dh_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) +dh_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8) { const unsigned char *p, *pm; int pklen, pmlen; int ptype; - void *pval; - ASN1_STRING *pstr; - X509_ALGOR *palg; + const void *pval; + const ASN1_STRING *pstr; + const X509_ALGOR *palg; ASN1_INTEGER *privkey = NULL; DH *dh = NULL; diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c index a6010f0a..a8227d31 100644 --- a/crypto/dh/dh_check.c +++ b/crypto/dh/dh_check.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_check.c,v 1.16 2016/07/05 02:54:35 bcook Exp $ */ +/* $OpenBSD: dh_check.c,v 1.17 2019/01/20 01:56:59 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -74,7 +74,7 @@ int DH_check(const DH *dh, int *ret) { - int ok = 0; + int is_prime, ok = 0; BN_CTX *ctx = NULL; BN_ULONG l; BIGNUM *q = NULL; @@ -102,16 +102,23 @@ DH_check(const DH *dh, int *ret) } else *ret |= DH_UNABLE_TO_CHECK_GENERATOR; - if (!BN_is_prime_ex(dh->p, BN_prime_checks, ctx, NULL)) + is_prime = BN_is_prime_ex(dh->p, BN_prime_checks, ctx, NULL); + if (is_prime < 0) + goto err; + if (is_prime == 0) *ret |= DH_CHECK_P_NOT_PRIME; else { if (!BN_rshift1(q, dh->p)) goto err; - if (!BN_is_prime_ex(q, BN_prime_checks, ctx, NULL)) + is_prime = BN_is_prime_ex(q, BN_prime_checks, ctx, NULL); + if (is_prime < 0) + goto err; + if (is_prime == 0) *ret |= DH_CHECK_P_NOT_SAFE_PRIME; } ok = 1; -err: + + err: BN_CTX_free(ctx); BN_free(q); return ok; diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c index 1a2c591e..a77e7956 100644 --- a/crypto/dh/dh_key.c +++ b/crypto/dh/dh_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_key.c,v 1.27.6.1 2018/06/13 15:12:39 jsing Exp $ */ +/* $OpenBSD: dh_key.c,v 1.36 2018/11/12 17:39:17 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -102,11 +102,10 @@ static int generate_key(DH *dh) { int ok = 0; - int generate_new_key = 0; unsigned l; BN_CTX *ctx; BN_MONT_CTX *mont = NULL; - BIGNUM *pub_key = NULL, *priv_key = NULL; + BIGNUM *pub_key = NULL, *priv_key = NULL, *two = NULL; if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) { DHerror(DH_R_MODULUS_TOO_LARGE); @@ -117,20 +116,15 @@ generate_key(DH *dh) if (ctx == NULL) goto err; - if (dh->priv_key == NULL) { - priv_key = BN_new(); - if (priv_key == NULL) + if ((priv_key = dh->priv_key) == NULL) { + if ((priv_key = BN_new()) == NULL) goto err; - generate_new_key = 1; - } else - priv_key = dh->priv_key; + } - if (dh->pub_key == NULL) { - pub_key = BN_new(); - if (pub_key == NULL) + if ((pub_key = dh->pub_key) == NULL) { + if ((pub_key = BN_new()) == NULL) goto err; - } else - pub_key = dh->pub_key; + } if (dh->flags & DH_FLAG_CACHE_MONT_P) { mont = BN_MONT_CTX_set_locked(&dh->method_mont_p, @@ -139,12 +133,14 @@ generate_key(DH *dh) goto err; } - if (generate_new_key) { + if (dh->priv_key == NULL) { if (dh->q) { - do { - if (!BN_rand_range(priv_key, dh->q)) - goto err; - } while (BN_is_zero(priv_key) || BN_is_one(priv_key)); + if ((two = BN_new()) == NULL) + goto err; + if (!BN_add(two, BN_value_one(), BN_value_one())) + goto err; + if (!bn_rand_interval(priv_key, two, dh->q)) + goto err; } else { /* secret exponent length */ l = dh->length ? dh->length : BN_num_bits(dh->p) - 1; @@ -153,30 +149,23 @@ generate_key(DH *dh) } } - { - BIGNUM prk; - - BN_init(&prk); - BN_with_flags(&prk, priv_key, BN_FLG_CONSTTIME); - - if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, &prk, dh->p, ctx, - mont)) { - goto err; - } - } + if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, priv_key, dh->p, ctx, + mont)) + goto err; dh->pub_key = pub_key; dh->priv_key = priv_key; ok = 1; -err: + err: if (ok != 1) DHerror(ERR_R_BN_LIB); - if (pub_key != NULL && dh->pub_key == NULL) + if (dh->pub_key == NULL) BN_free(pub_key); - if (priv_key != NULL && dh->priv_key == NULL) + if (dh->priv_key == NULL) BN_free(priv_key); BN_CTX_free(ctx); + BN_free(two); return ok; } @@ -200,7 +189,7 @@ compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) BN_CTX_start(ctx); if ((tmp = BN_CTX_get(ctx)) == NULL) goto err; - + if (dh->priv_key == NULL) { DHerror(DH_R_NO_PRIVATE_VALUE); goto err; @@ -228,7 +217,7 @@ compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) } ret = BN_bn2bin(tmp, key); -err: + err: if (ctx != NULL) { BN_CTX_end(ctx); BN_CTX_free(ctx); diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c index d45dc171..446bc65a 100644 --- a/crypto/dh/dh_lib.c +++ b/crypto/dh/dh_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_lib.c,v 1.22 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: dh_lib.c,v 1.32 2018/05/02 15:48:38 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include @@ -97,10 +98,8 @@ DH_set_method(DH *dh, const DH_METHOD *meth) if (mtmp->finish) mtmp->finish(dh); #ifndef OPENSSL_NO_ENGINE - if (dh->engine) { - ENGINE_finish(dh->engine); - dh->engine = NULL; - } + ENGINE_finish(dh->engine); + dh->engine = NULL; #endif dh->meth = meth; if (meth->init) @@ -138,7 +137,7 @@ DH_new_method(ENGINE *engine) ret->engine = ENGINE_get_default_DH(); if(ret->engine) { ret->meth = ENGINE_get_DH(ret->engine); - if (!ret->meth) { + if (ret->meth == NULL) { DHerror(ERR_R_ENGINE_LIB); ENGINE_finish(ret->engine); free(ret); @@ -165,8 +164,7 @@ DH_new_method(ENGINE *engine) CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data); if (ret->meth->init != NULL && !ret->meth->init(ret)) { #ifndef OPENSSL_NO_ENGINE - if (ret->engine) - ENGINE_finish(ret->engine); + ENGINE_finish(ret->engine); #endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data); free(ret); @@ -189,8 +187,7 @@ DH_free(DH *r) if (r->meth->finish) r->meth->finish(r); #ifndef OPENSSL_NO_ENGINE - if (r->engine) - ENGINE_finish(r->engine); + ENGINE_finish(r->engine); #endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data); @@ -239,3 +236,100 @@ DH_size(const DH *dh) { return BN_num_bytes(dh->p); } + +int +DH_bits(const DH *dh) +{ + return BN_num_bits(dh->p); +} + +ENGINE * +DH_get0_engine(DH *dh) +{ + return dh->engine; +} + +void +DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) +{ + if (p != NULL) + *p = dh->p; + if (q != NULL) + *q = dh->q; + if (g != NULL) + *g = dh->g; +} + +int +DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) +{ + if ((dh->p == NULL && p == NULL) || (dh->g == NULL && g == NULL)) + return 0; + + if (p != NULL) { + BN_free(dh->p); + dh->p = p; + } + if (q != NULL) { + BN_free(dh->q); + dh->q = q; + } + if (g != NULL) { + BN_free(dh->g); + dh->g = g; + } + + return 1; +} + +void +DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) +{ + if (pub_key != NULL) + *pub_key = dh->pub_key; + if (priv_key != NULL) + *priv_key = dh->priv_key; +} + +int +DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) +{ + if (pub_key != NULL) { + BN_free(dh->pub_key); + dh->pub_key = pub_key; + } + if (priv_key != NULL) { + BN_free(dh->priv_key); + dh->priv_key = priv_key; + } + + return 1; +} + +void +DH_clear_flags(DH *dh, int flags) +{ + dh->flags &= ~flags; +} + +int +DH_test_flags(const DH *dh, int flags) +{ + return dh->flags & flags; +} + +void +DH_set_flags(DH *dh, int flags) +{ + dh->flags |= flags; +} + +int +DH_set_length(DH *dh, long length) +{ + if (length < 0 || length > INT_MAX) + return 0; + + dh->length = length; + return 1; +} diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c index 92f543de..85ef234b 100644 --- a/crypto/dsa/dsa_ameth.c +++ b/crypto/dsa/dsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_ameth.c,v 1.23 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: dsa_ameth.c,v 1.27 2019/01/20 01:56:59 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -75,8 +75,8 @@ dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey) const unsigned char *p, *pm; int pklen, pmlen; int ptype; - void *pval; - ASN1_STRING *pstr; + const void *pval; + const ASN1_STRING *pstr; X509_ALGOR *palg; ASN1_INTEGER *public_key = NULL; @@ -179,14 +179,14 @@ dsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) * AlgorithmIdentifier the pubkey must be recalculated. */ static int -dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) +dsa_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8) { const unsigned char *p, *pm; int pklen, pmlen; int ptype; - void *pval; - ASN1_STRING *pstr; - X509_ALGOR *palg; + const void *pval; + const ASN1_STRING *pstr; + const X509_ALGOR *palg; ASN1_INTEGER *privkey = NULL; BN_CTX *ctx = NULL; DSA *dsa = NULL; @@ -515,7 +515,7 @@ old_dsa_priv_decode(EVP_PKEY *pkey, const unsigned char **pder, int derlen) * Check that q is not a composite number. */ - if (BN_is_prime_ex(dsa->q, BN_prime_checks, ctx, NULL) == 0) { + if (BN_is_prime_ex(dsa->q, BN_prime_checks, ctx, NULL) <= 0) { DSAerror(DSA_R_BAD_Q_VALUE); goto err; } @@ -525,7 +525,7 @@ old_dsa_priv_decode(EVP_PKEY *pkey, const unsigned char **pder, int derlen) EVP_PKEY_assign_DSA(pkey, dsa); return 1; -err: + err: BN_CTX_free(ctx); DSA_free(dsa); return 0; diff --git a/crypto/dsa/dsa_asn1.c b/crypto/dsa/dsa_asn1.c index f7dfaf1d..23f08bb1 100644 --- a/crypto/dsa/dsa_asn1.c +++ b/crypto/dsa/dsa_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_asn1.c,v 1.20 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: dsa_asn1.c,v 1.22 2018/06/14 17:03:19 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -71,13 +71,10 @@ sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) if (operation == ASN1_OP_NEW_PRE) { DSA_SIG *sig; - sig = malloc(sizeof(DSA_SIG)); - if (!sig) { + if ((sig = DSA_SIG_new()) == NULL) { DSAerror(ERR_R_MALLOC_FAILURE); return 0; } - sig->r = NULL; - sig->s = NULL; *pval = (ASN1_VALUE *)sig; return 2; } @@ -133,6 +130,29 @@ i2d_DSA_SIG(const DSA_SIG *a, unsigned char **out) return ASN1_item_i2d((ASN1_VALUE *)a, out, &DSA_SIG_it); } +void +DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) +{ + if (pr != NULL) + *pr = sig->r; + if (ps != NULL) + *ps = sig->s; +} + +int +DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s) +{ + if (r == NULL || s == NULL) + return 0; + + BN_clear_free(sig->r); + sig->r = r; + BN_clear_free(sig->s); + sig->s = s; + + return 1; +} + /* Override the default free and new methods */ static int dsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) diff --git a/crypto/dsa/dsa_key.c b/crypto/dsa/dsa_key.c index cb95e136..a0487e98 100644 --- a/crypto/dsa/dsa_key.c +++ b/crypto/dsa/dsa_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_key.c,v 1.23 2017/01/21 09:38:59 beck Exp $ */ +/* $OpenBSD: dsa_key.c,v 1.29 2018/11/09 23:45:19 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -87,40 +87,30 @@ dsa_builtin_keygen(DSA *dsa) if ((ctx = BN_CTX_new()) == NULL) goto err; - if (dsa->priv_key == NULL) { + if ((priv_key = dsa->priv_key) == NULL) { if ((priv_key = BN_new()) == NULL) goto err; - } else - priv_key=dsa->priv_key; + } - do { - if (!BN_rand_range(priv_key, dsa->q)) - goto err; - } while (BN_is_zero(priv_key)); + if (!bn_rand_interval(priv_key, BN_value_one(), dsa->q)) + goto err; - if (dsa->pub_key == NULL) { + if ((pub_key = dsa->pub_key) == NULL) { if ((pub_key = BN_new()) == NULL) goto err; - } else - pub_key=dsa->pub_key; - - { - BIGNUM prk; - - BN_with_flags(&prk, priv_key, BN_FLG_CONSTTIME); - - if (!BN_mod_exp_ct(pub_key, dsa->g, &prk, dsa->p, ctx)) - goto err; } + + if (!BN_mod_exp_ct(pub_key, dsa->g, priv_key, dsa->p, ctx)) + goto err; dsa->priv_key = priv_key; dsa->pub_key = pub_key; ok = 1; -err: - if (pub_key != NULL && dsa->pub_key == NULL) + err: + if (dsa->pub_key == NULL) BN_free(pub_key); - if (priv_key != NULL && dsa->priv_key == NULL) + if (dsa->priv_key == NULL) BN_free(priv_key); BN_CTX_free(ctx); return ok; diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c index 58af7488..d5fdd6e7 100644 --- a/crypto/dsa/dsa_lib.c +++ b/crypto/dsa/dsa_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_lib.c,v 1.23 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: dsa_lib.c,v 1.29 2018/04/14 07:09:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -108,10 +108,8 @@ DSA_set_method(DSA *dsa, const DSA_METHOD *meth) if (mtmp->finish) mtmp->finish(dsa); #ifndef OPENSSL_NO_ENGINE - if (dsa->engine) { - ENGINE_finish(dsa->engine); - dsa->engine = NULL; - } + ENGINE_finish(dsa->engine); + dsa->engine = NULL; #endif dsa->meth = meth; if (meth->init) @@ -142,7 +140,7 @@ DSA_new_method(ENGINE *engine) ret->engine = ENGINE_get_default_DSA(); if (ret->engine) { ret->meth = ENGINE_get_DSA(ret->engine); - if (!ret->meth) { + if (ret->meth == NULL) { DSAerror(ERR_R_ENGINE_LIB); ENGINE_finish(ret->engine); free(ret); @@ -170,8 +168,7 @@ DSA_new_method(ENGINE *engine) CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); if (ret->meth->init != NULL && !ret->meth->init(ret)) { #ifndef OPENSSL_NO_ENGINE - if (ret->engine) - ENGINE_finish(ret->engine); + ENGINE_finish(ret->engine); #endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); free(ret); @@ -196,8 +193,7 @@ DSA_free(DSA *r) if (r->meth->finish) r->meth->finish(r); #ifndef OPENSSL_NO_ENGINE - if (r->engine) - ENGINE_finish(r->engine); + ENGINE_finish(r->engine); #endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data); @@ -303,3 +299,88 @@ DSA_dup_DH(const DSA *r) return NULL; } #endif + +void +DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) +{ + if (p != NULL) + *p = d->p; + if (q != NULL) + *q = d->q; + if (g != NULL) + *g = d->g; +} + +int +DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) +{ + if ((d->p == NULL && p == NULL) || (d->q == NULL && q == NULL) || + (d->g == NULL && g == NULL)) + return 0; + + if (p != NULL) { + BN_free(d->p); + d->p = p; + } + if (q != NULL) { + BN_free(d->q); + d->q = q; + } + if (g != NULL) { + BN_free(d->g); + d->g = g; + } + + return 1; +} + +void +DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) +{ + if (pub_key != NULL) + *pub_key = d->pub_key; + if (priv_key != NULL) + *priv_key = d->priv_key; +} + +int +DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) +{ + if (d->pub_key == NULL && pub_key == NULL) + return 0; + + if (pub_key != NULL) { + BN_free(d->pub_key); + d->pub_key = pub_key; + } + if (priv_key != NULL) { + BN_free(d->priv_key); + d->priv_key = priv_key; + } + + return 1; +} + +void +DSA_clear_flags(DSA *d, int flags) +{ + d->flags &= ~flags; +} + +int +DSA_test_flags(const DSA *d, int flags) +{ + return d->flags & flags; +} + +void +DSA_set_flags(DSA *d, int flags) +{ + d->flags |= flags; +} + +ENGINE * +DSA_get0_engine(DSA *d) +{ + return d->engine; +} diff --git a/crypto/dsa/dsa_meth.c b/crypto/dsa/dsa_meth.c new file mode 100644 index 00000000..e6f043f8 --- /dev/null +++ b/crypto/dsa/dsa_meth.c @@ -0,0 +1,78 @@ +/* $OpenBSD: dsa_meth.c,v 1.1 2018/03/17 15:19:12 tb Exp $ */ +/* + * Copyright (c) 2018 Theo Buehler + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include +#include + +DSA_METHOD * +DSA_meth_new(const char *name, int flags) +{ + DSA_METHOD *meth; + + if ((meth = calloc(1, sizeof(*meth))) == NULL) + return NULL; + if ((meth->name = strdup(name)) == NULL) { + free(meth); + return NULL; + } + meth->flags = flags; + + return meth; +} + +void +DSA_meth_free(DSA_METHOD *meth) +{ + if (meth != NULL) { + free((char *)meth->name); + free(meth); + } +} + +DSA_METHOD * +DSA_meth_dup(const DSA_METHOD *meth) +{ + DSA_METHOD *copy; + + if ((copy = calloc(1, sizeof(*copy))) == NULL) + return NULL; + memcpy(copy, meth, sizeof(*copy)); + if ((copy->name = strdup(meth->name)) == NULL) { + free(copy); + return NULL; + } + + return copy; +} + +int +DSA_meth_set_sign(DSA_METHOD *meth, + DSA_SIG *(*sign)(const unsigned char *, int, DSA *)) +{ + meth->dsa_do_sign = sign; + return 1; +} + +int +DSA_meth_set_finish(DSA_METHOD *meth, int (*finish)(DSA *)) +{ + meth->finish = finish; + return 1; +} diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c index 78b10a5b..fd56e8fe 100644 --- a/crypto/dsa/dsa_ossl.c +++ b/crypto/dsa/dsa_ossl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_ossl.c,v 1.30.6.1 2018/06/13 15:07:19 jsing Exp $ */ +/* $OpenBSD: dsa_ossl.c,v 1.40 2018/11/06 07:02:33 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -70,9 +70,9 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, - BIGNUM **rp); + BIGNUM **rp); static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, - DSA *dsa); + DSA *dsa); static int dsa_init(DSA *dsa); static int dsa_finish(DSA *dsa); @@ -82,7 +82,7 @@ static DSA_METHOD openssl_dsa_meth = { .dsa_sign_setup = dsa_sign_setup, .dsa_do_verify = dsa_do_verify, .init = dsa_init, - .finish = dsa_finish + .finish = dsa_finish, }; const DSA_METHOD * @@ -94,16 +94,17 @@ DSA_OpenSSL(void) static DSA_SIG * dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) { - BIGNUM *kinv = NULL, *r = NULL, *s = NULL; - BIGNUM m; - BIGNUM xr; + BIGNUM b, bm, bxr, binv, m, *kinv = NULL, *r = NULL, *s = NULL; BN_CTX *ctx = NULL; int reason = ERR_R_BN_LIB; DSA_SIG *ret = NULL; int noredo = 0; + BN_init(&b); + BN_init(&binv); + BN_init(&bm); + BN_init(&bxr); BN_init(&m); - BN_init(&xr); if (!dsa->p || !dsa->q || !dsa->g) { reason = DSA_R_MISSING_PARAMETERS; @@ -116,7 +117,18 @@ dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) ctx = BN_CTX_new(); if (ctx == NULL) goto err; -redo: + + /* + * If the digest length is greater than N (the bit length of q), the + * leftmost N bits of the digest shall be used, see FIPS 186-3, 4.2. + * In this case the digest length is given in bytes. + */ + if (dlen > BN_num_bytes(dsa->q)) + dlen = BN_num_bytes(dsa->q); + if (BN_bin2bn(dgst, dlen, &m) == NULL) + goto err; + + redo: if (dsa->kinv == NULL || dsa->r == NULL) { if (!DSA_sign_setup(dsa, ctx, &kinv, &r)) goto err; @@ -128,31 +140,39 @@ dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) noredo = 1; } - /* - * If the digest length is greater than the size of q use the - * BN_num_bits(dsa->q) leftmost bits of the digest, see - * fips 186-3, 4.2 + * Compute: + * + * s = inv(k)(m + xr) mod q + * + * In order to reduce the possibility of a side-channel attack, the + * following is calculated using a blinding value: + * + * s = inv(k)inv(b)(bm + bxr) mod q + * + * Where b is a random value in the range [1, q). */ - if (dlen > BN_num_bytes(dsa->q)) - dlen = BN_num_bytes(dsa->q); - if (BN_bin2bn(dgst,dlen,&m) == NULL) + if (!bn_rand_interval(&b, BN_value_one(), dsa->q)) + goto err; + if (BN_mod_inverse_ct(&binv, &b, dsa->q, ctx) == NULL) goto err; - /* Compute s = inv(k) (m + xr) mod q */ - if (!BN_mod_mul(&xr, dsa->priv_key, r, dsa->q, ctx)) /* s = xr */ + if (!BN_mod_mul(&bxr, &b, dsa->priv_key, dsa->q, ctx)) /* bx */ + goto err; + if (!BN_mod_mul(&bxr, &bxr, r, dsa->q, ctx)) /* bxr */ + goto err; + if (!BN_mod_mul(&bm, &b, &m, dsa->q, ctx)) /* bm */ goto err; - if (!BN_mod_add(s, &xr, &m, dsa->q, ctx)) /* s = m + xr */ + if (!BN_mod_add(s, &bxr, &bm, dsa->q, ctx)) /* s = bm + bxr */ + goto err; + if (!BN_mod_mul(s, s, &binv, dsa->q, ctx)) /* s = m + xr */ goto err; if (!BN_mod_mul(s, s, kinv, dsa->q, ctx)) goto err; - ret = DSA_SIG_new(); - if (ret == NULL) - goto err; /* - * Redo if r or s is zero as required by FIPS 186-3: this is - * very unlikely. + * Redo if r or s is zero as required by FIPS 186-3: this is very + * unlikely. */ if (BN_is_zero(r) || BN_is_zero(s)) { if (noredo) { @@ -161,19 +181,28 @@ dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) } goto redo; } + + if ((ret = DSA_SIG_new()) == NULL) { + reason = ERR_R_MALLOC_FAILURE; + goto err; + } ret->r = r; ret->s = s; -err: + err: if (!ret) { DSAerror(reason); BN_free(r); BN_free(s); } BN_CTX_free(ctx); + BN_clear_free(&b); + BN_clear_free(&bm); + BN_clear_free(&bxr); + BN_clear_free(&binv); BN_clear_free(&m); - BN_clear_free(&xr); BN_clear_free(kinv); + return ret; } @@ -181,8 +210,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) { BN_CTX *ctx; - BIGNUM k, *kinv = NULL, *r = NULL; - int ret = 0; + BIGNUM k, l, m, *kinv = NULL, *r = NULL; + int q_bits, ret = 0; if (!dsa->p || !dsa->q || !dsa->g) { DSAerror(DSA_R_MISSING_PARAMETERS); @@ -190,6 +219,8 @@ dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) } BN_init(&k); + BN_init(&l); + BN_init(&m); if (ctx_in == NULL) { if ((ctx = BN_CTX_new()) == NULL) @@ -200,11 +231,15 @@ dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) if ((r = BN_new()) == NULL) goto err; - /* Get random k */ - do { - if (!BN_rand_range(&k, dsa->q)) - goto err; - } while (BN_is_zero(&k)); + /* Preallocate space */ + q_bits = BN_num_bits(dsa->q); + if (!BN_set_bit(&k, q_bits) || + !BN_set_bit(&l, q_bits) || + !BN_set_bit(&m, q_bits)) + goto err; + + if (!bn_rand_interval(&k, BN_value_one(), dsa->q)) + goto err; BN_set_flags(&k, BN_FLG_CONSTTIME); @@ -218,30 +253,33 @@ dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) /* * We do not want timing information to leak the length of k, - * so we compute g^k using an equivalent exponent of fixed - * length. + * so we compute G^k using an equivalent exponent of fixed + * bit-length. + * + * We unconditionally perform both of these additions to prevent a + * small timing information leakage. We then choose the sum that is + * one bit longer than the modulus. * - * (This is a kludge that we need because the BN_mod_exp_mont() - * does not let us specify the desired timing behaviour.) + * TODO: revisit the BN_copy aiming for a memory access agnostic + * conditional copy. */ - if (!BN_add(&k, &k, dsa->q)) + if (!BN_add(&l, &k, dsa->q) || + !BN_add(&m, &l, dsa->q) || + !BN_copy(&k, BN_num_bits(&l) > q_bits ? &l : &m)) goto err; - if (BN_num_bits(&k) <= BN_num_bits(dsa->q)) { - if (!BN_add(&k, &k, dsa->q)) - goto err; - } if (dsa->meth->bn_mod_exp != NULL) { if (!dsa->meth->bn_mod_exp(dsa, r, dsa->g, &k, dsa->p, ctx, - dsa->method_mont_p)) + dsa->method_mont_p)) goto err; } else { - if (!BN_mod_exp_mont_ct(r, dsa->g, &k, dsa->p, ctx, dsa->method_mont_p)) + if (!BN_mod_exp_mont_ct(r, dsa->g, &k, dsa->p, ctx, + dsa->method_mont_p)) goto err; } - if (!BN_mod_ct(r,r,dsa->q,ctx)) + if (!BN_mod_ct(r, r, dsa->q, ctx)) goto err; /* Compute part of 's = inv(k) (m + xr) mod q' */ @@ -253,8 +291,10 @@ dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) kinv = NULL; BN_clear_free(*rp); *rp = r; + ret = 1; -err: + + err: if (!ret) { DSAerror(ERR_R_BN_LIB); BN_clear_free(r); @@ -262,6 +302,9 @@ dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) if (ctx_in == NULL) BN_CTX_free(ctx); BN_clear_free(&k); + BN_clear_free(&l); + BN_clear_free(&m); + return ret; } @@ -279,7 +322,7 @@ dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa) } i = BN_num_bits(dsa->q); - /* fips 186-3 allows only different sizes for q */ + /* FIPS 186-3 allows only three different sizes for q. */ if (i != 160 && i != 224 && i != 256) { DSAerror(DSA_R_BAD_Q_VALUE); return -1; @@ -307,23 +350,22 @@ dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa) goto err; } - /* Calculate W = inv(S) mod Q - * save W in u2 */ + /* Calculate w = inv(s) mod q, saving w in u2. */ if ((BN_mod_inverse_ct(&u2, sig->s, dsa->q, ctx)) == NULL) goto err; - /* save M in u1 */ /* * If the digest length is greater than the size of q use the - * BN_num_bits(dsa->q) leftmost bits of the digest, see - * fips 186-3, 4.2 + * BN_num_bits(dsa->q) leftmost bits of the digest, see FIPS 186-3, 4.2. */ if (dgst_len > (i >> 3)) dgst_len = (i >> 3); + + /* Save m in u1. */ if (BN_bin2bn(dgst, dgst_len, &u1) == NULL) goto err; - /* u1 = M * w mod q */ + /* u1 = m * w mod q */ if (!BN_mod_mul(&u1, &u1, &u2, dsa->q, ctx)) goto err; @@ -331,7 +373,6 @@ dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa) if (!BN_mod_mul(&u2, sig->r, &u2, dsa->q, ctx)) goto err; - if (dsa->flags & DSA_FLAG_CACHE_MONT_P) { mont = BN_MONT_CTX_set_locked(&dsa->method_mont_p, CRYPTO_LOCK_DSA, dsa->p, ctx); @@ -340,12 +381,12 @@ dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa) } if (dsa->meth->dsa_mod_exp != NULL) { - if (!dsa->meth->dsa_mod_exp(dsa, &t1, dsa->g, &u1, dsa->pub_key, &u2, - dsa->p, ctx, mont)) + if (!dsa->meth->dsa_mod_exp(dsa, &t1, dsa->g, &u1, dsa->pub_key, + &u2, dsa->p, ctx, mont)) goto err; } else { - if (!BN_mod_exp2_mont(&t1, dsa->g, &u1, dsa->pub_key, &u2, dsa->p, ctx, - mont)) + if (!BN_mod_exp2_mont(&t1, dsa->g, &u1, dsa->pub_key, &u2, + dsa->p, ctx, mont)) goto err; } @@ -354,17 +395,17 @@ dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa) if (!BN_mod_ct(&u1, &t1, dsa->q, ctx)) goto err; - /* V is now in u1. If the signature is correct, it will be - * equal to R. */ + /* v is in u1 - if the signature is correct, it will be equal to r. */ ret = BN_ucmp(&u1, sig->r) == 0; -err: + err: if (ret < 0) DSAerror(ERR_R_BN_LIB); BN_CTX_free(ctx); BN_free(&u1); BN_free(&u2); BN_free(&t1); + return ret; } diff --git a/crypto/dsa/dsa_sign.c b/crypto/dsa/dsa_sign.c index 355bdd20..0f55ea18 100644 --- a/crypto/dsa/dsa_sign.c +++ b/crypto/dsa/dsa_sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_sign.c,v 1.19 2014/10/18 17:20:40 jsing Exp $ */ +/* $OpenBSD: dsa_sign.c,v 1.20 2018/06/14 17:01:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -76,20 +76,13 @@ DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) DSA_SIG * DSA_SIG_new(void) { - DSA_SIG *sig; - - sig = malloc(sizeof(DSA_SIG)); - if (!sig) - return NULL; - sig->r = NULL; - sig->s = NULL; - return sig; + return calloc(1, sizeof(DSA_SIG)); } void DSA_SIG_free(DSA_SIG *sig) { - if (sig) { + if (sig != NULL) { BN_free(sig->r); BN_free(sig->s); free(sig); diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c index 7902fbcc..6dc98803 100644 --- a/crypto/dso/dso_lib.c +++ b/crypto/dso/dso_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dso_lib.c,v 1.19 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: dso_lib.c,v 1.20 2018/08/24 19:27:01 tb Exp $ */ /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL * project 2000. */ @@ -174,13 +174,15 @@ DSO_flags(DSO *dso) int DSO_up_ref(DSO *dso) { + int refs; + if (dso == NULL) { DSOerror(ERR_R_PASSED_NULL_PARAMETER); return (0); } - CRYPTO_add(&dso->references, 1, CRYPTO_LOCK_DSO); - return (1); + refs = CRYPTO_add(&dso->references, 1, CRYPTO_LOCK_DSO); + return ((refs > 1) ? 1 : 0); } DSO * diff --git a/crypto/ec/ec2_mult.c b/crypto/ec/ec2_mult.c index 1c8bb180..3e5d1dca 100644 --- a/crypto/ec/ec2_mult.c +++ b/crypto/ec/ec2_mult.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec2_mult.c,v 1.9 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ec2_mult.c,v 1.13 2018/07/23 18:24:22 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -71,6 +71,7 @@ #include +#include "bn_lcl.h" #include "ec_lcl.h" #ifndef OPENSSL_NO_EC2M @@ -111,7 +112,7 @@ gf2m_Mdouble(const EC_GROUP *group, BIGNUM *x, BIGNUM *z, BN_CTX *ctx) ret = 1; -err: + err: BN_CTX_end(ctx); return ret; } @@ -155,7 +156,7 @@ gf2m_Madd(const EC_GROUP *group, const BIGNUM *x, BIGNUM *x1, BIGNUM *z1, ret = 1; -err: + err: BN_CTX_end(ctx); return ret; } @@ -243,7 +244,7 @@ gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, BIGNUM *x1, ret = 2; -err: + err: BN_CTX_end(ctx); return ret; } @@ -324,14 +325,18 @@ ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, for (; i >= 0; i--) { word = scalar->d[i]; while (mask) { - BN_consttime_swap(word & mask, x1, x2, group->field.top); - BN_consttime_swap(word & mask, z1, z2, group->field.top); + if (!BN_swap_ct(word & mask, x1, x2, group->field.top)) + goto err; + if (!BN_swap_ct(word & mask, z1, z2, group->field.top)) + goto err; if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err; if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err; - BN_consttime_swap(word & mask, x1, x2, group->field.top); - BN_consttime_swap(word & mask, z1, z2, group->field.top); + if (!BN_swap_ct(word & mask, x1, x2, group->field.top)) + goto err; + if (!BN_swap_ct(word & mask, z1, z2, group->field.top)) + goto err; mask >>= 1; } mask = BN_TBIT; @@ -356,7 +361,7 @@ ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, ret = 1; -err: + err: BN_CTX_end(ctx); return ret; } @@ -424,7 +429,7 @@ ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, ret = 1; -err: + err: EC_POINT_free(p); EC_POINT_free(acc); BN_CTX_free(new_ctx); diff --git a/crypto/ec/ec2_oct.c b/crypto/ec/ec2_oct.c index f434d726..268eccf4 100644 --- a/crypto/ec/ec2_oct.c +++ b/crypto/ec/ec2_oct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec2_oct.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ec2_oct.c,v 1.11 2018/07/15 16:27:39 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -157,7 +157,7 @@ ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point ret = 1; -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; @@ -272,7 +272,7 @@ ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, BN_CTX_free(new_ctx); return ret; -err: + err: if (used_ctx) BN_CTX_end(ctx); BN_CTX_free(new_ctx); @@ -374,7 +374,7 @@ ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point, } ret = 1; -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c index 61575999..936cee48 100644 --- a/crypto/ec/ec2_smpl.c +++ b/crypto/ec/ec2_smpl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec2_smpl.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ec2_smpl.c,v 1.21 2018/11/05 20:18:21 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -107,18 +107,15 @@ EC_GF2m_simple_method(void) .point_cmp = ec_GF2m_simple_cmp, .make_affine = ec_GF2m_simple_make_affine, .points_make_affine = ec_GF2m_simple_points_make_affine, - - /* - * the following three method functions are defined in - * ec2_mult.c - */ - .mul = ec_GF2m_simple_mul, + .mul_generator_ct = ec_GFp_simple_mul_generator_ct, + .mul_single_ct = ec_GFp_simple_mul_single_ct, + .mul_double_nonct = ec_GFp_simple_mul_double_nonct, .precompute_mult = ec_GF2m_precompute_mult, .have_precompute_mult = ec_GF2m_have_precompute_mult, - .field_mul = ec_GF2m_simple_field_mul, .field_sqr = ec_GF2m_simple_field_sqr, .field_div = ec_GF2m_simple_field_div, + .blind_coordinates = NULL, }; return &ret; @@ -232,7 +229,7 @@ ec_GF2m_simple_group_set_curve(EC_GROUP * group, group->b.d[i] = 0; ret = 1; -err: + err: return ret; } @@ -260,7 +257,7 @@ ec_GF2m_simple_group_get_curve(const EC_GROUP *group, } ret = 1; -err: + err: return ret; } @@ -306,7 +303,7 @@ ec_GF2m_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) ret = 1; -err: + err: if (ctx != NULL) BN_CTX_end(ctx); BN_CTX_free(new_ctx); @@ -398,7 +395,7 @@ ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * p point->Z_is_one = 1; ret = 1; -err: + err: return ret; } @@ -432,7 +429,7 @@ ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group, } ret = 1; -err: + err: return ret; } @@ -549,7 +546,7 @@ ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, ret = 1; -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; @@ -641,7 +638,7 @@ ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX if (!BN_GF2m_add(lh, lh, y2)) goto err; ret = BN_is_zero(lh); -err: + err: if (ctx) BN_CTX_end(ctx); BN_CTX_free(new_ctx); @@ -693,7 +690,7 @@ ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a, goto err; ret = ((BN_cmp(aX, bX) == 0) && BN_cmp(aY, bY) == 0) ? 0 : 1; -err: + err: if (ctx) BN_CTX_end(ctx); BN_CTX_free(new_ctx); @@ -734,7 +731,7 @@ ec_GF2m_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ct ret = 1; -err: + err: if (ctx) BN_CTX_end(ctx); BN_CTX_free(new_ctx); diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c index 8d0cdb73..04c06820 100644 --- a/crypto/ec/ec_ameth.c +++ b/crypto/ec/ec_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_ameth.c,v 1.18 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ec_ameth.c,v 1.25 2018/08/24 20:22:15 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -126,7 +126,7 @@ eckey_pub_encode(X509_PUBKEY * pk, const EVP_PKEY * pkey) if (X509_PUBKEY_set0_param(pk, OBJ_nid2obj(EVP_PKEY_EC), ptype, pval, penc, penclen)) return 1; -err: + err: if (ptype == V_ASN1_OBJECT) ASN1_OBJECT_free(pval); else @@ -136,12 +136,12 @@ eckey_pub_encode(X509_PUBKEY * pk, const EVP_PKEY * pkey) } static EC_KEY * -eckey_type2param(int ptype, void *pval) +eckey_type2param(int ptype, const void *pval) { EC_KEY *eckey = NULL; if (ptype == V_ASN1_SEQUENCE) { - ASN1_STRING *pstr = pval; + const ASN1_STRING *pstr = pval; const unsigned char *pm = NULL; int pmlen; @@ -152,7 +152,7 @@ eckey_type2param(int ptype, void *pval) goto ecerr; } } else if (ptype == V_ASN1_OBJECT) { - ASN1_OBJECT *poid = pval; + const ASN1_OBJECT *poid = pval; EC_GROUP *group; /* @@ -177,7 +177,7 @@ eckey_type2param(int ptype, void *pval) return eckey; -ecerr: + ecerr: if (eckey) EC_KEY_free(eckey); return NULL; @@ -187,7 +187,7 @@ static int eckey_pub_decode(EVP_PKEY * pkey, X509_PUBKEY * pubkey) { const unsigned char *p = NULL; - void *pval; + const void *pval; int ptype, pklen; EC_KEY *eckey = NULL; X509_ALGOR *palg; @@ -210,7 +210,7 @@ eckey_pub_decode(EVP_PKEY * pkey, X509_PUBKEY * pubkey) EVP_PKEY_assign_EC_KEY(pkey, eckey); return 1; -ecerr: + ecerr: if (eckey) EC_KEY_free(eckey); return 0; @@ -232,13 +232,13 @@ eckey_pub_cmp(const EVP_PKEY * a, const EVP_PKEY * b) } static int -eckey_priv_decode(EVP_PKEY * pkey, PKCS8_PRIV_KEY_INFO * p8) +eckey_priv_decode(EVP_PKEY * pkey, const PKCS8_PRIV_KEY_INFO * p8) { const unsigned char *p = NULL; - void *pval; + const void *pval; int ptype, pklen; EC_KEY *eckey = NULL; - X509_ALGOR *palg; + const X509_ALGOR *palg; if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8)) return 0; @@ -290,9 +290,9 @@ eckey_priv_decode(EVP_PKEY * pkey, PKCS8_PRIV_KEY_INFO * p8) EVP_PKEY_assign_EC_KEY(pkey, eckey); return 1; -ecliberr: + ecliberr: ECerror(ERR_R_EC_LIB); -ecerr: + ecerr: if (eckey) EC_KEY_free(eckey); return 0; @@ -433,13 +433,15 @@ do_EC_KEY_print(BIO * bp, const EC_KEY * x, int off, int ktype) } if (ktype > 0) { public_key = EC_KEY_get0_public_key(x); - if ((pub_key = EC_POINT_point2bn(group, public_key, + if (public_key != NULL) { + if ((pub_key = EC_POINT_point2bn(group, public_key, EC_KEY_get_conv_form(x), NULL, ctx)) == NULL) { - reason = ERR_R_EC_LIB; - goto err; + reason = ERR_R_EC_LIB; + goto err; + } + if (pub_key) + buf_len = (size_t) BN_num_bytes(pub_key); } - if (pub_key) - buf_len = (size_t) BN_num_bytes(pub_key); } if (ktype == 2) { priv_key = EC_KEY_get0_private_key(x); @@ -481,7 +483,7 @@ do_EC_KEY_print(BIO * bp, const EC_KEY * x, int off, int ktype) if (!ECPKParameters_print(bp, group, off)) goto err; ret = 1; -err: + err: if (!ret) ECerror(reason); BN_free(pub_key); diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c index b64b7e14..f69dd023 100644 --- a/crypto/ec/ec_asn1.c +++ b/crypto/ec/ec_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_asn1.c,v 1.24 2017/05/26 16:32:14 jsing Exp $ */ +/* $OpenBSD: ec_asn1.c,v 1.31 2018/09/01 16:23:15 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -86,6 +86,7 @@ EC_GROUP_get_basis_type(const EC_GROUP * group) /* everything else is currently not supported */ return 0; } + #ifndef OPENSSL_NO_EC2M int EC_GROUP_get_trinomial_basis(const EC_GROUP * group, unsigned int *k) @@ -104,6 +105,7 @@ EC_GROUP_get_trinomial_basis(const EC_GROUP * group, unsigned int *k) return 1; } + int EC_GROUP_get_pentanomial_basis(const EC_GROUP * group, unsigned int *k1, unsigned int *k2, unsigned int *k3) @@ -128,7 +130,6 @@ EC_GROUP_get_pentanomial_basis(const EC_GROUP * group, unsigned int *k1, } #endif - /* some structures needed for the asn1 encoding */ typedef struct x9_62_pentanomial_st { long k1; @@ -334,6 +335,7 @@ const ASN1_ITEM X9_62_CHARACTERISTIC_TWO_it = { .size = sizeof(X9_62_CHARACTERISTIC_TWO), .sname = "X9_62_CHARACTERISTIC_TWO", }; + X9_62_CHARACTERISTIC_TWO *X9_62_CHARACTERISTIC_TWO_new(void); void X9_62_CHARACTERISTIC_TWO_free(X9_62_CHARACTERISTIC_TWO *a); @@ -348,6 +350,7 @@ X9_62_CHARACTERISTIC_TWO_free(X9_62_CHARACTERISTIC_TWO *a) { ASN1_item_free((ASN1_VALUE *)a, &X9_62_CHARACTERISTIC_TWO_it); } + static const ASN1_TEMPLATE fieldID_def_tt = { .flags = 0, .tag = 0, @@ -506,6 +509,7 @@ const ASN1_ITEM ECPARAMETERS_it = { .size = sizeof(ECPARAMETERS), .sname = "ECPARAMETERS", }; + ECPARAMETERS *ECPARAMETERS_new(void); void ECPARAMETERS_free(ECPARAMETERS *a); @@ -655,6 +659,7 @@ EC_PRIVATEKEY_free(EC_PRIVATEKEY *a) { ASN1_item_free((ASN1_VALUE *)a, &EC_PRIVATEKEY_it); } + /* some declarations of internal function */ /* ec_asn1_group2field() sets the values in a X9_62_FIELDID object */ @@ -675,7 +680,6 @@ static EC_GROUP *ec_asn1_pkparameters2group(const ECPKPARAMETERS *); static ECPKPARAMETERS *ec_asn1_group2pkparameters(const EC_GROUP *, ECPKPARAMETERS *); - /* the function definitions */ static int @@ -789,7 +793,7 @@ ec_asn1_group2fieldid(const EC_GROUP * group, X9_62_FIELDID * field) ok = 1; -err: + err: BN_free(tmp); return (ok); } @@ -892,7 +896,7 @@ ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve) ok = 1; -err: + err: free(buffer_1); free(buffer_2); BN_free(tmp_1); @@ -984,7 +988,8 @@ ec_asn1_group2parameters(const EC_GROUP * group, ECPARAMETERS * param) } ok = 1; -err: if (!ok) { + err: + if (!ok) { if (ret && !param) ECPARAMETERS_free(ret); ret = NULL; @@ -1240,7 +1245,8 @@ ec_asn1_parameters2group(const ECPARAMETERS * params) } ok = 1; -err: if (!ok) { + err: + if (!ok) { EC_GROUP_clear_free(ret); ret = NULL; } @@ -1308,7 +1314,7 @@ d2i_ECPKParameters(EC_GROUP ** a, const unsigned char **in, long len) *a = group; } -err: + err: ECPKPARAMETERS_free(params); return (group); } @@ -1380,17 +1386,18 @@ d2i_ECPrivateKey(EC_KEY ** a, const unsigned char **in, long len) goto err; } + if (ret->pub_key) + EC_POINT_clear_free(ret->pub_key); + ret->pub_key = EC_POINT_new(ret->group); + if (ret->pub_key == NULL) { + ECerror(ERR_R_EC_LIB); + goto err; + } + if (priv_key->publicKey) { const unsigned char *pub_oct; size_t pub_oct_len; - EC_POINT_clear_free(ret->pub_key); - ret->pub_key = EC_POINT_new(ret->group); - if (ret->pub_key == NULL) { - ECerror(ERR_R_EC_LIB); - goto err; - } - pub_oct = ASN1_STRING_data(priv_key->publicKey); pub_oct_len = ASN1_STRING_length(priv_key->publicKey); if (pub_oct == NULL || pub_oct_len <= 0) { @@ -1405,6 +1412,14 @@ d2i_ECPrivateKey(EC_KEY ** a, const unsigned char **in, long len) ECerror(ERR_R_EC_LIB); goto err; } + } else { + if (!EC_POINT_mul(ret->group, ret->pub_key, ret->priv_key, + NULL, NULL, NULL)) { + ECerror(ERR_R_EC_LIB); + goto err; + } + /* Remember the original private-key-only encoding. */ + ret->enc_flag |= EC_PKEY_NO_PUBKEY; } EC_PRIVATEKEY_free(priv_key); @@ -1412,7 +1427,7 @@ d2i_ECPrivateKey(EC_KEY ** a, const unsigned char **in, long len) *a = ret; return (ret); -err: + err: if (a == NULL || *a != ret) EC_KEY_free(ret); if (priv_key) @@ -1429,7 +1444,8 @@ i2d_ECPrivateKey(EC_KEY * a, unsigned char **out) size_t buf_len = 0, tmp_len; EC_PRIVATEKEY *priv_key = NULL; - if (a == NULL || a->group == NULL || a->priv_key == NULL) { + if (a == NULL || a->group == NULL || a->priv_key == NULL || + (!(a->enc_flag & EC_PKEY_NO_PUBKEY) && a->pub_key == NULL)) { ECerror(ERR_R_PASSED_NULL_PARAMETER); goto err; } @@ -1496,7 +1512,7 @@ i2d_ECPrivateKey(EC_KEY * a, unsigned char **out) goto err; } ok = 1; -err: + err: free(buffer); if (priv_key) EC_PRIVATEKEY_free(priv_key); @@ -1548,10 +1564,7 @@ o2i_ECPublicKey(EC_KEY ** a, const unsigned char **in, long len) EC_KEY *ret = NULL; if (a == NULL || (*a) == NULL || (*a)->group == NULL) { - /* - * sorry, but a EC_GROUP-structur is necessary to set the - * public key - */ + /* An EC_GROUP structure is necessary to set the public key. */ ECerror(ERR_R_PASSED_NULL_PARAMETER); return 0; } @@ -1572,7 +1585,7 @@ o2i_ECPublicKey(EC_KEY ** a, const unsigned char **in, long len) } int -i2o_ECPublicKey(EC_KEY * a, unsigned char **out) +i2o_ECPublicKey(const EC_KEY * a, unsigned char **out) { size_t buf_len = 0; int new_buffer = 0; diff --git a/crypto/ec/ec_check.c b/crypto/ec/ec_check.c index bbb03498..dcca6616 100644 --- a/crypto/ec/ec_check.c +++ b/crypto/ec/ec_check.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_check.c,v 1.6 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ec_check.c,v 1.9 2018/07/15 16:27:39 tb Exp $ */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * @@ -106,7 +106,7 @@ EC_GROUP_check(const EC_GROUP * group, BN_CTX * ctx) } ret = 1; -err: + err: if (ctx != NULL) BN_CTX_end(ctx); BN_CTX_free(new_ctx); diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c index 1ee2a7c8..e075b1ed 100644 --- a/crypto/ec/ec_curve.c +++ b/crypto/ec/ec_curve.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_curve.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ec_curve.c,v 1.19 2018/07/15 16:27:39 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -2135,7 +2135,7 @@ static const struct { } }; -/* IPSec curves */ +/* IPsec curves */ /* NOTE: The of curves over a extension field of non prime degree * is not recommended (Weil-descent). * As the group order is not a prime this curve is not suitable @@ -3235,7 +3235,7 @@ ec_group_new_from_data(const ec_list_element curve) } } ok = 1; -err: + err: if (!ok) { EC_GROUP_free(group); group = NULL; diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 595b88ce..1d0a03ac 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_key.c,v 1.14 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: ec_key.c,v 1.24 2019/01/19 01:12:48 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -65,29 +65,18 @@ #include -#include "ec_lcl.h" +#ifndef OPENSSL_NO_ENGINE +#include +#endif #include +#include "bn_lcl.h" +#include "ec_lcl.h" + EC_KEY * EC_KEY_new(void) { - EC_KEY *ret; - - ret = malloc(sizeof(EC_KEY)); - if (ret == NULL) { - ECerror(ERR_R_MALLOC_FAILURE); - return (NULL); - } - ret->version = 1; - ret->flags = 0; - ret->group = NULL; - ret->pub_key = NULL; - ret->priv_key = NULL; - ret->enc_flag = 0; - ret->conv_form = POINT_CONVERSION_UNCOMPRESSED; - ret->references = 1; - ret->method_data = NULL; - return (ret); + return EC_KEY_new_method(NULL); } EC_KEY * @@ -101,6 +90,11 @@ EC_KEY_new_by_curve_name(int nid) EC_KEY_free(ret); return NULL; } + if (ret->meth->set_group != NULL && + ret->meth->set_group(ret, ret->group) == 0) { + EC_KEY_free(ret); + return NULL; + } return ret; } @@ -116,6 +110,14 @@ EC_KEY_free(EC_KEY * r) if (i > 0) return; + if (r->meth != NULL && r->meth->finish != NULL) + r->meth->finish(r); + +#ifndef OPENSSL_NO_ENGINE + ENGINE_finish(r->engine); +#endif + CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EC_KEY, r, &r->ex_data); + EC_GROUP_free(r->group); EC_POINT_free(r->pub_key); BN_clear_free(r->priv_key); @@ -134,6 +136,15 @@ EC_KEY_copy(EC_KEY * dest, const EC_KEY * src) ECerror(ERR_R_PASSED_NULL_PARAMETER); return NULL; } + if (src->meth != dest->meth) { + if (dest->meth != NULL && dest->meth->finish != NULL) + dest->meth->finish(dest); +#ifndef OPENSSL_NO_ENGINE + if (ENGINE_finish(dest->engine) == 0) + return 0; + dest->engine = NULL; +#endif + } /* copy the parameters */ if (src->group) { const EC_METHOD *meth = EC_GROUP_method_of(src->group); @@ -183,14 +194,32 @@ EC_KEY_copy(EC_KEY * dest, const EC_KEY * src) dest->version = src->version; dest->flags = src->flags; + if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_EC_KEY, &dest->ex_data, + &((EC_KEY *)src)->ex_data)) /* XXX const */ + return NULL; + + if (src->meth != dest->meth) { +#ifndef OPENSSL_NO_ENGINE + if (src->engine != NULL && ENGINE_init(src->engine) == 0) + return 0; + dest->engine = src->engine; +#endif + dest->meth = src->meth; + } + + if (src->meth != NULL && src->meth->copy != NULL && + src->meth->copy(dest, src) == 0) + return 0; + return dest; } EC_KEY * EC_KEY_dup(const EC_KEY * ec_key) { - EC_KEY *ret = EC_KEY_new(); - if (ret == NULL) + EC_KEY *ret; + + if ((ret = EC_KEY_new_method(ec_key->engine)) == NULL) return NULL; if (EC_KEY_copy(ret, ec_key) == NULL) { EC_KEY_free(ret); @@ -206,8 +235,29 @@ EC_KEY_up_ref(EC_KEY * r) return ((i > 1) ? 1 : 0); } -int -EC_KEY_generate_key(EC_KEY * eckey) +int +EC_KEY_set_ex_data(EC_KEY *r, int idx, void *arg) +{ + return CRYPTO_set_ex_data(&r->ex_data, idx, arg); +} + +void * +EC_KEY_get_ex_data(const EC_KEY *r, int idx) +{ + return CRYPTO_get_ex_data(&r->ex_data, idx); +} + +int +EC_KEY_generate_key(EC_KEY *eckey) +{ + if (eckey->meth->keygen != NULL) + return eckey->meth->keygen(eckey); + ECerror(EC_R_NOT_IMPLEMENTED); + return 0; +} + +int +ossl_ec_key_gen(EC_KEY *eckey) { int ok = 0; BN_CTX *ctx = NULL; @@ -218,32 +268,27 @@ EC_KEY_generate_key(EC_KEY * eckey) ECerror(ERR_R_PASSED_NULL_PARAMETER); return 0; } + if ((order = BN_new()) == NULL) goto err; if ((ctx = BN_CTX_new()) == NULL) goto err; - if (eckey->priv_key == NULL) { - priv_key = BN_new(); - if (priv_key == NULL) + if ((priv_key = eckey->priv_key) == NULL) { + if ((priv_key = BN_new()) == NULL) goto err; - } else - priv_key = eckey->priv_key; + } if (!EC_GROUP_get_order(eckey->group, order, ctx)) goto err; - do - if (!BN_rand_range(priv_key, order)) - goto err; - while (BN_is_zero(priv_key)); + if (!bn_rand_interval(priv_key, BN_value_one(), order)) + goto err; - if (eckey->pub_key == NULL) { - pub_key = EC_POINT_new(eckey->group); - if (pub_key == NULL) + if ((pub_key = eckey->pub_key) == NULL) { + if ((pub_key = EC_POINT_new(eckey->group)) == NULL) goto err; - } else - pub_key = eckey->pub_key; + } if (!EC_POINT_mul(eckey->group, pub_key, priv_key, NULL, NULL, ctx)) goto err; @@ -253,11 +298,11 @@ EC_KEY_generate_key(EC_KEY * eckey) ok = 1; -err: + err: BN_free(order); - if (pub_key != NULL && eckey->pub_key == NULL) + if (eckey->pub_key == NULL) EC_POINT_free(pub_key); - if (priv_key != NULL && eckey->priv_key == NULL) + if (eckey->priv_key == NULL) BN_free(priv_key); BN_CTX_free(ctx); return (ok); @@ -324,7 +369,7 @@ EC_KEY_check_key(const EC_KEY * eckey) } } ok = 1; -err: + err: BN_CTX_free(ctx); EC_POINT_free(point); return (ok); @@ -395,7 +440,7 @@ EC_KEY_set_public_key_affine_coordinates(EC_KEY * key, BIGNUM * x, BIGNUM * y) ok = 1; -err: + err: BN_CTX_free(ctx); EC_POINT_free(point); return ok; @@ -411,6 +456,9 @@ EC_KEY_get0_group(const EC_KEY * key) int EC_KEY_set_group(EC_KEY * key, const EC_GROUP * group) { + if (key->meth->set_group != NULL && + key->meth->set_group(key, group) == 0) + return 0; EC_GROUP_free(key->group); key->group = EC_GROUP_dup(group); return (key->group == NULL) ? 0 : 1; @@ -425,6 +473,9 @@ EC_KEY_get0_private_key(const EC_KEY * key) int EC_KEY_set_private_key(EC_KEY * key, const BIGNUM * priv_key) { + if (key->meth->set_private != NULL && + key->meth->set_private(key, priv_key) == 0) + return 0; BN_clear_free(key->priv_key); key->priv_key = BN_dup(priv_key); return (key->priv_key == NULL) ? 0 : 1; @@ -439,6 +490,9 @@ EC_KEY_get0_public_key(const EC_KEY * key) int EC_KEY_set_public_key(EC_KEY * key, const EC_POINT * pub_key) { + if (key->meth->set_public != NULL && + key->meth->set_public(key, pub_key) == 0) + return 0; EC_POINT_free(key->pub_key); key->pub_key = EC_POINT_dup(pub_key, key->group); return (key->pub_key == NULL) ? 0 : 1; diff --git a/crypto/ec/ec_kmeth.c b/crypto/ec/ec_kmeth.c new file mode 100644 index 00000000..664c412c --- /dev/null +++ b/crypto/ec/ec_kmeth.c @@ -0,0 +1,335 @@ +/* $OpenBSD: ec_kmeth.c,v 1.4 2019/01/19 01:18:56 tb Exp $ */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 2015 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. + * ==================================================================== + */ + +#include +#ifndef OPENSSL_NO_ENGINE +#include +#endif +#include + +#include "ec_lcl.h" +#include "ecs_locl.h" + +static const EC_KEY_METHOD openssl_ec_key_method = { + .name = "OpenSSL EC_KEY method", + .flags = 0, + + .init = NULL, + .finish = NULL, + .copy = NULL, + + .set_group = NULL, + .set_private = NULL, + .set_public = NULL, + + .keygen = ossl_ec_key_gen, + .compute_key = ossl_ecdh_compute_key, + + .sign = ossl_ecdsa_sign, + .sign_setup = ossl_ecdsa_sign_setup, + .sign_sig = ossl_ecdsa_sign_sig, + + .verify = ossl_ecdsa_verify, + .verify_sig = ossl_ecdsa_verify_sig, +}; + +const EC_KEY_METHOD *default_ec_key_meth = &openssl_ec_key_method; + +const EC_KEY_METHOD * +EC_KEY_OpenSSL(void) +{ + return &openssl_ec_key_method; +} + +const EC_KEY_METHOD * +EC_KEY_get_default_method(void) +{ + return default_ec_key_meth; +} + +void +EC_KEY_set_default_method(const EC_KEY_METHOD *meth) +{ + if (meth == NULL) + default_ec_key_meth = &openssl_ec_key_method; + else + default_ec_key_meth = meth; +} + +const EC_KEY_METHOD * +EC_KEY_get_method(const EC_KEY *key) +{ + return key->meth; +} + +int +EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth) +{ + void (*finish)(EC_KEY *key) = key->meth->finish; + + if (finish != NULL) + finish(key); + +#ifndef OPENSSL_NO_ENGINE + ENGINE_finish(key->engine); + key->engine = NULL; +#endif + + key->meth = meth; + if (meth->init != NULL) + return meth->init(key); + return 1; +} + +EC_KEY * +EC_KEY_new_method(ENGINE *engine) +{ + EC_KEY *ret; + + if ((ret = calloc(1, sizeof(EC_KEY))) == NULL) { + ECerror(ERR_R_MALLOC_FAILURE); + return NULL; + } + ret->meth = EC_KEY_get_default_method(); +#ifndef OPENSSL_NO_ENGINE + if (engine != NULL) { + if (!ENGINE_init(engine)) { + ECerror(ERR_R_ENGINE_LIB); + goto err; + } + ret->engine = engine; + } else + ret->engine = ENGINE_get_default_EC(); + if (ret->engine) { + ret->meth = ENGINE_get_EC(ret->engine); + if (ret->meth == NULL) { + ECerror(ERR_R_ENGINE_LIB); + goto err; + } + } +#endif + ret->version = 1; + ret->flags = 0; + ret->group = NULL; + ret->pub_key = NULL; + ret->priv_key = NULL; + ret->enc_flag = 0; + ret->conv_form = POINT_CONVERSION_UNCOMPRESSED; + ret->references = 1; + ret->method_data = NULL; + + if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) + goto err; + if (ret->meth->init != NULL && ret->meth->init(ret) == 0) + goto err; + + return ret; + + err: + EC_KEY_free(ret); + return NULL; +} + +EC_KEY_METHOD * +EC_KEY_METHOD_new(const EC_KEY_METHOD *meth) +{ + EC_KEY_METHOD *ret; + + if ((ret = malloc(sizeof(*meth))) == NULL) + return NULL; + if (meth != NULL) + *ret = *meth; + ret->flags |= EC_KEY_METHOD_DYNAMIC; + return ret; +} + +void +EC_KEY_METHOD_free(EC_KEY_METHOD *meth) +{ + if (meth == NULL) + return; + if (meth->flags & EC_KEY_METHOD_DYNAMIC) + free(meth); +} + +void +EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth, + int (*init)(EC_KEY *key), + void (*finish)(EC_KEY *key), + int (*copy)(EC_KEY *dest, const EC_KEY *src), + int (*set_group)(EC_KEY *key, const EC_GROUP *grp), + int (*set_private)(EC_KEY *key, const BIGNUM *priv_key), + int (*set_public)(EC_KEY *key, const EC_POINT *pub_key)) +{ + meth->init = init; + meth->finish = finish; + meth->copy = copy; + meth->set_group = set_group; + meth->set_private = set_private; + meth->set_public = set_public; +} + +void +EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth, int (*keygen)(EC_KEY *key)) +{ + meth->keygen = keygen; +} + +void +EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth, + int (*ckey)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, + void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))) +{ + meth->compute_key = ckey; +} + +void +EC_KEY_METHOD_set_sign(EC_KEY_METHOD *meth, + int (*sign)(int type, const unsigned char *dgst, + int dlen, unsigned char *sig, unsigned int *siglen, + const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey), + int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, + BIGNUM **kinvp, BIGNUM **rp), + ECDSA_SIG *(*sign_sig)(const unsigned char *dgst, + int dgst_len, const BIGNUM *in_kinv, + const BIGNUM *in_r, EC_KEY *eckey)) +{ + meth->sign = sign; + meth->sign_setup = sign_setup; + meth->sign_sig = sign_sig; +} + +void +EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth, + int (*verify)(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, int sig_len, EC_KEY *eckey), + int (*verify_sig)(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey)) +{ + meth->verify = verify; + meth->verify_sig = verify_sig; +} + + +void +EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth, + int (**pinit)(EC_KEY *key), + void (**pfinish)(EC_KEY *key), + int (**pcopy)(EC_KEY *dest, const EC_KEY *src), + int (**pset_group)(EC_KEY *key, const EC_GROUP *grp), + int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key), + int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)) +{ + if (pinit != NULL) + *pinit = meth->init; + if (pfinish != NULL) + *pfinish = meth->finish; + if (pcopy != NULL) + *pcopy = meth->copy; + if (pset_group != NULL) + *pset_group = meth->set_group; + if (pset_private != NULL) + *pset_private = meth->set_private; + if (pset_public != NULL) + *pset_public = meth->set_public; +} + +void +EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, + int (**pkeygen)(EC_KEY *key)) +{ + if (pkeygen != NULL) + *pkeygen = meth->keygen; +} + +void +EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, + int (**pck)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, + void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))) +{ + if (pck != NULL) + *pck = meth->compute_key; +} + +void +EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth, + int (**psign)(int type, const unsigned char *dgst, + int dlen, unsigned char *sig, unsigned int *siglen, + const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey), + int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, + BIGNUM **kinvp, BIGNUM **rp), + ECDSA_SIG *(**psign_sig)(const unsigned char *dgst, + int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, + EC_KEY *eckey)) +{ + if (psign != NULL) + *psign = meth->sign; + if (psign_setup != NULL) + *psign_setup = meth->sign_setup; + if (psign_sig != NULL) + *psign_sig = meth->sign_sig; +} + +void +EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth, + int (**pverify)(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, int sig_len, EC_KEY *eckey), + int (**pverify_sig)(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey)) +{ + if (pverify != NULL) + *pverify = meth->verify; + if (pverify_sig != NULL) + *pverify_sig = meth->verify_sig; +} diff --git a/crypto/ec/ec_lcl.h b/crypto/ec/ec_lcl.h index e1c91e67..8948e51d 100644 --- a/crypto/ec/ec_lcl.h +++ b/crypto/ec/ec_lcl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lcl.h,v 1.7 2016/12/21 15:49:29 jsing Exp $ */ +/* $OpenBSD: ec_lcl.h,v 1.13 2019/01/19 01:12:48 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -73,6 +73,7 @@ #include #include +#include #include __BEGIN_HIDDEN_DECLS @@ -160,10 +161,12 @@ struct ec_method_st { int (*make_affine)(const EC_GROUP *, EC_POINT *, BN_CTX *); int (*points_make_affine)(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); - /* used by EC_POINTs_mul, EC_POINT_mul, EC_POINT_precompute_mult, EC_POINT_have_precompute_mult - * (default implementations are used if the 'mul' pointer is 0): */ - int (*mul)(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, - size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); + /* used by EC_POINTs_mul, EC_POINT_mul, EC_POINT_precompute_mult, EC_POINT_have_precompute_mult */ + int (*mul_generator_ct)(const EC_GROUP *, EC_POINT *r, const BIGNUM *scalar, BN_CTX *); + int (*mul_single_ct)(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, + const EC_POINT *point, BN_CTX *); + int (*mul_double_nonct)(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, + const BIGNUM *p_scalar, const EC_POINT *point, BN_CTX *); int (*precompute_mult)(EC_GROUP *group, BN_CTX *); int (*have_precompute_mult)(const EC_GROUP *group); @@ -180,6 +183,7 @@ struct ec_method_st { int (*field_encode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); /* e.g. to Montgomery */ int (*field_decode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); /* e.g. from Montgomery */ int (*field_set_to_one)(const EC_GROUP *, BIGNUM *r, BN_CTX *); + int (*blind_coordinates)(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx); } /* EC_METHOD */; typedef struct ec_extra_data_st { @@ -242,6 +246,9 @@ struct ec_group_st { } /* EC_GROUP */; struct ec_key_st { + const EC_KEY_METHOD *meth; + ENGINE *engine; + int version; EC_GROUP *group; @@ -256,6 +263,7 @@ struct ec_key_st { int flags; EC_EXTRA_DATA *method_data; + CRYPTO_EX_DATA ex_data; } /* EC_KEY */; /* Basically a 'mixin' for extra data, but available for EC_GROUPs/EC_KEYs only @@ -337,6 +345,12 @@ int ec_GFp_simple_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); int ec_GFp_simple_points_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); int ec_GFp_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *); int ec_GFp_simple_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); +int ec_GFp_simple_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx); +int ec_GFp_simple_mul_generator_ct(const EC_GROUP *, EC_POINT *r, const BIGNUM *scalar, BN_CTX *); +int ec_GFp_simple_mul_single_ct(const EC_GROUP *, EC_POINT *r, const BIGNUM *scalar, + const EC_POINT *point, BN_CTX *); +int ec_GFp_simple_mul_double_nonct(const EC_GROUP *, EC_POINT *r, const BIGNUM *g_scalar, + const BIGNUM *p_scalar, const EC_POINT *point, BN_CTX *); /* method functions in ecp_mont.c */ @@ -351,6 +365,7 @@ int ec_GFp_mont_field_encode(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CT int ec_GFp_mont_field_decode(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); int ec_GFp_mont_field_set_to_one(const EC_GROUP *, BIGNUM *r, BN_CTX *); +int ec_point_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx); /* method functions in ecp_nist.c */ int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src); @@ -431,6 +446,44 @@ int ec_GFp_nistp256_have_precompute_mult(const EC_GROUP *group); const EC_METHOD *EC_GFp_nistz256_method(void); #endif +/* EC_METHOD definitions */ + +struct ec_key_method_st { + const char *name; + int32_t flags; + int (*init)(EC_KEY *key); + void (*finish)(EC_KEY *key); + int (*copy)(EC_KEY *dest, const EC_KEY *src); + int (*set_group)(EC_KEY *key, const EC_GROUP *grp); + int (*set_private)(EC_KEY *key, const BIGNUM *priv_key); + int (*set_public)(EC_KEY *key, const EC_POINT *pub_key); + int (*keygen)(EC_KEY *key); + int (*compute_key)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, + void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen)); + int (*sign)(int type, const unsigned char *dgst, int dlen, unsigned char + *sig, unsigned int *siglen, const BIGNUM *kinv, + const BIGNUM *r, EC_KEY *eckey); + int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, + BIGNUM **rp); + ECDSA_SIG *(*sign_sig)(const unsigned char *dgst, int dgst_len, + const BIGNUM *in_kinv, const BIGNUM *in_r, + EC_KEY *eckey); + int (*verify)(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, int sig_len, EC_KEY *eckey); + int (*verify_sig)(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey); +} /* EC_KEY_METHOD */; + +#define EC_KEY_METHOD_DYNAMIC 1 + +int ossl_ec_key_gen(EC_KEY *eckey); +int ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, + void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen)); +int ossl_ecdsa_verify(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, int sig_len, EC_KEY *eckey); +int ossl_ecdsa_verify_sig(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey); + /* method functions in ecp_nistp521.c */ int ec_GFp_nistp521_group_init(EC_GROUP *group); int ec_GFp_nistp521_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *n, BN_CTX *); diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c index 0d062111..e5d9620a 100644 --- a/crypto/ec/ec_lib.c +++ b/crypto/ec/ec_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lib.c,v 1.24 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.31 2018/11/06 07:02:33 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -526,13 +526,30 @@ EC_GROUP_cmp(const EC_GROUP * a, const EC_GROUP * b, BN_CTX * ctx) return r; -err: + err: BN_CTX_end(ctx); if (ctx_new) BN_CTX_free(ctx); return -1; } +/* + * Coordinate blinding for EC_POINT. + * + * The underlying EC_METHOD can optionally implement this function: + * underlying implementations should return 0 on errors, or 1 on success. + * + * This wrapper returns 1 in case the underlying EC_METHOD does not support + * coordinate blinding. + */ +int +ec_point_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx) +{ + if (group->meth->blind_coordinates == NULL) + return 1; + + return group->meth->blind_coordinates(group, p, ctx); +} /* this has 'package' visibility */ int @@ -1026,47 +1043,88 @@ EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], } -/* Functions for point multiplication. - * - * If group->meth->mul is 0, we use the wNAF-based implementations in ec_mult.c; - * otherwise we dispatch through methods. - */ - +/* Functions for point multiplication */ int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx) { - if (group->meth->mul == 0) - /* use default */ - return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx); - - return group->meth->mul(group, r, scalar, num, points, scalars, ctx); + /* + * The function pointers must be set, and only support num == 0 and + * num == 1. + */ + if (group->meth->mul_generator_ct == NULL || + group->meth->mul_single_ct == NULL || + group->meth->mul_double_nonct == NULL || + num > 1) { + ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + /* Either bP or aG + bP, this is sane. */ + if (num == 1 && points != NULL && scalars != NULL) + return EC_POINT_mul(group, r, scalar, points[0], scalars[0], + ctx); + + /* aG, this is sane */ + if (scalar != NULL && points == NULL && scalars == NULL) + return EC_POINT_mul(group, r, scalar, NULL, NULL, ctx); + + /* anything else is an error */ + ECerror(ERR_R_EC_LIB); + return 0; } int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx) { - /* just a convenient interface to EC_POINTs_mul() */ - - const EC_POINT *points[1]; - const BIGNUM *scalars[1]; - - points[0] = point; - scalars[0] = p_scalar; - - return EC_POINTs_mul(group, r, g_scalar, - (point != NULL && p_scalar != NULL), - points, scalars, ctx); + if (group->meth->mul_generator_ct == NULL || + group->meth->mul_single_ct == NULL || + group->meth->mul_double_nonct == NULL) { + ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + if (g_scalar != NULL && point == NULL && p_scalar == NULL) { + /* + * In this case we want to compute g_scalar * GeneratorPoint: + * this codepath is reached most prominently by (ephemeral) key + * generation of EC cryptosystems (i.e. ECDSA keygen and sign + * setup, ECDH keygen/first half), where the scalar is always + * secret. This is why we ignore if BN_FLG_CONSTTIME is actually + * set and we always call the constant time version. + */ + return group->meth->mul_generator_ct(group, r, g_scalar, ctx); + } + if (g_scalar == NULL && point != NULL && p_scalar != NULL) { + /* In this case we want to compute p_scalar * GenericPoint: + * this codepath is reached most prominently by the second half + * of ECDH, where the secret scalar is multiplied by the peer's + * public point. To protect the secret scalar, we ignore if + * BN_FLG_CONSTTIME is actually set and we always call the + * constant time version. + */ + return group->meth->mul_single_ct(group, r, p_scalar, point, + ctx); + } + if (g_scalar != NULL && point != NULL && p_scalar != NULL) { + /* + * In this case we want to compute + * g_scalar * GeneratorPoint + p_scalar * GenericPoint: + * this codepath is reached most prominently by ECDSA signature + * verification. So we call the non-ct version. + */ + return group->meth->mul_double_nonct(group, r, g_scalar, + p_scalar, point, ctx); + } + + /* Anything else is an error. */ + ECerror(ERR_R_EC_LIB); + return 0; } int EC_GROUP_precompute_mult(EC_GROUP * group, BN_CTX * ctx) { - if (group->meth->mul == 0) - /* use default */ - return ec_wNAF_precompute_mult(group, ctx); - if (group->meth->precompute_mult != 0) return group->meth->precompute_mult(group, ctx); else @@ -1076,10 +1134,6 @@ EC_GROUP_precompute_mult(EC_GROUP * group, BN_CTX * ctx) int EC_GROUP_have_precompute_mult(const EC_GROUP * group) { - if (group->meth->mul == 0) - /* use default */ - return ec_wNAF_have_precompute_mult(group); - if (group->meth->have_precompute_mult != 0) return group->meth->have_precompute_mult(group); else diff --git a/crypto/ec/ec_mult.c b/crypto/ec/ec_mult.c index a565263b..05f89a57 100644 --- a/crypto/ec/ec_mult.c +++ b/crypto/ec/ec_mult.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_mult.c,v 1.21 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: ec_mult.c,v 1.24 2018/07/15 16:27:39 tb Exp $ */ /* * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. */ @@ -301,7 +301,7 @@ compute_wNAF(const BIGNUM * scalar, int w, size_t * ret_len) len = j; ok = 1; -err: + err: if (!ok) { free(r); r = NULL; @@ -678,7 +678,7 @@ ec_wNAF_mul(const EC_GROUP * group, EC_POINT * r, const BIGNUM * scalar, ret = 1; -err: + err: BN_CTX_free(new_ctx); EC_POINT_free(tmp); free(wsize); @@ -857,7 +857,7 @@ ec_wNAF_precompute_mult(EC_GROUP * group, BN_CTX * ctx) pre_comp = NULL; ret = 1; -err: + err: if (ctx != NULL) BN_CTX_end(ctx); BN_CTX_free(new_ctx); diff --git a/crypto/ec/eck_prn.c b/crypto/ec/eck_prn.c index 653d78e5..be57d875 100644 --- a/crypto/ec/eck_prn.c +++ b/crypto/ec/eck_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eck_prn.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: eck_prn.c,v 1.15 2018/07/15 16:27:39 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -321,7 +321,7 @@ ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off) goto err; } ret = 1; -err: + err: if (!ret) ECerror(reason); BN_free(p); diff --git a/crypto/ec/ecp_mont.c b/crypto/ec/ecp_mont.c index 68fc26de..f4dff9aa 100644 --- a/crypto/ec/ecp_mont.c +++ b/crypto/ec/ecp_mont.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_mont.c,v 1.11 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ecp_mont.c,v 1.17 2018/11/05 20:18:21 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -102,11 +102,15 @@ EC_GFp_mont_method(void) .point_cmp = ec_GFp_simple_cmp, .make_affine = ec_GFp_simple_make_affine, .points_make_affine = ec_GFp_simple_points_make_affine, + .mul_generator_ct = ec_GFp_simple_mul_generator_ct, + .mul_single_ct = ec_GFp_simple_mul_single_ct, + .mul_double_nonct = ec_GFp_simple_mul_double_nonct, .field_mul = ec_GFp_mont_field_mul, .field_sqr = ec_GFp_mont_field_sqr, .field_encode = ec_GFp_mont_field_encode, .field_decode = ec_GFp_mont_field_decode, - .field_set_to_one = ec_GFp_mont_field_set_to_one + .field_set_to_one = ec_GFp_mont_field_set_to_one, + .blind_coordinates = ec_GFp_simple_blind_coordinates, }; return &ret; @@ -172,7 +176,7 @@ ec_GFp_mont_group_copy(EC_GROUP * dest, const EC_GROUP * src) } return 1; -err: + err: if (dest->field_data1 != NULL) { BN_MONT_CTX_free(dest->field_data1); dest->field_data1 = NULL; @@ -225,7 +229,7 @@ ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, BN_free(group->field_data2); group->field_data2 = NULL; } -err: + err: BN_CTX_free(new_ctx); BN_MONT_CTX_free(mont); BN_free(one); diff --git a/crypto/ec/ecp_nist.c b/crypto/ec/ecp_nist.c index 24cba64d..073c0419 100644 --- a/crypto/ec/ecp_nist.c +++ b/crypto/ec/ecp_nist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_nist.c,v 1.10 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ecp_nist.c,v 1.15 2018/11/05 20:18:21 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -103,8 +103,12 @@ EC_GFp_nist_method(void) .point_cmp = ec_GFp_simple_cmp, .make_affine = ec_GFp_simple_make_affine, .points_make_affine = ec_GFp_simple_points_make_affine, + .mul_generator_ct = ec_GFp_simple_mul_generator_ct, + .mul_single_ct = ec_GFp_simple_mul_single_ct, + .mul_double_nonct = ec_GFp_simple_mul_double_nonct, .field_mul = ec_GFp_nist_field_mul, - .field_sqr = ec_GFp_nist_field_sqr + .field_sqr = ec_GFp_nist_field_sqr, + .blind_coordinates = ec_GFp_simple_blind_coordinates, }; return &ret; @@ -151,7 +155,7 @@ ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p, ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; @@ -179,7 +183,7 @@ ec_GFp_nist_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, goto err; ret = 1; -err: + err: BN_CTX_free(ctx_new); return ret; } @@ -206,7 +210,7 @@ ec_GFp_nist_field_sqr(const EC_GROUP * group, BIGNUM * r, const BIGNUM * a, goto err; ret = 1; -err: + err: BN_CTX_free(ctx_new); return ret; } diff --git a/crypto/ec/ecp_oct.c b/crypto/ec/ecp_oct.c index b93b5169..90c5ca2e 100644 --- a/crypto/ec/ecp_oct.c +++ b/crypto/ec/ecp_oct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_oct.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ecp_oct.c,v 1.11 2018/07/15 16:27:39 tb Exp $ */ /* Includes code written by Lenka Fibikova * for the OpenSSL project. * Includes code written by Bodo Moeller for the OpenSSL project. @@ -190,7 +190,7 @@ ec_GFp_simple_set_compressed_coordinates(const EC_GROUP * group, ret = 1; -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; @@ -294,7 +294,7 @@ ec_GFp_simple_point2oct(const EC_GROUP * group, const EC_POINT * point, point_co BN_CTX_free(new_ctx); return ret; -err: + err: if (used_ctx) BN_CTX_end(ctx); BN_CTX_free(new_ctx); @@ -388,7 +388,7 @@ ec_GFp_simple_oct2point(const EC_GROUP * group, EC_POINT * point, } ret = 1; -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; diff --git a/crypto/ec/ecp_smpl.c b/crypto/ec/ecp_smpl.c index ddba49c6..3957bd15 100644 --- a/crypto/ec/ecp_smpl.c +++ b/crypto/ec/ecp_smpl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_smpl.c,v 1.17 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ecp_smpl.c,v 1.29 2018/11/15 05:53:31 tb Exp $ */ /* Includes code written by Lenka Fibikova * for the OpenSSL project. * Includes code written by Bodo Moeller for the OpenSSL project. @@ -103,8 +103,12 @@ EC_GFp_simple_method(void) .point_cmp = ec_GFp_simple_cmp, .make_affine = ec_GFp_simple_make_affine, .points_make_affine = ec_GFp_simple_points_make_affine, + .mul_generator_ct = ec_GFp_simple_mul_generator_ct, + .mul_single_ct = ec_GFp_simple_mul_single_ct, + .mul_double_nonct = ec_GFp_simple_mul_double_nonct, .field_mul = ec_GFp_simple_field_mul, - .field_sqr = ec_GFp_simple_field_sqr + .field_sqr = ec_GFp_simple_field_sqr, + .blind_coordinates = ec_GFp_simple_blind_coordinates, }; return &ret; @@ -220,7 +224,7 @@ ec_GFp_simple_group_set_curve(EC_GROUP * group, ret = 1; -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; @@ -265,7 +269,7 @@ ec_GFp_simple_group_get_curve(const EC_GROUP * group, BIGNUM * p, BIGNUM * a, BI } ret = 1; -err: + err: BN_CTX_free(new_ctx); return ret; } @@ -346,7 +350,7 @@ ec_GFp_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx) } ret = 1; -err: + err: if (ctx != NULL) BN_CTX_end(ctx); BN_CTX_free(new_ctx); @@ -456,7 +460,7 @@ ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP * group, EC_POINT * } ret = 1; -err: + err: BN_CTX_free(new_ctx); return ret; } @@ -504,7 +508,7 @@ ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP * group, const EC_P ret = 1; -err: + err: BN_CTX_free(new_ctx); return ret; } @@ -624,7 +628,7 @@ ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP * group, const EC_POIN ret = 1; -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; @@ -811,7 +815,7 @@ ec_GFp_simple_add(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, cons ret = 1; -end: + end: if (ctx) /* otherwise we already called BN_CTX_end */ BN_CTX_end(ctx); BN_CTX_free(new_ctx); @@ -954,7 +958,7 @@ ec_GFp_simple_dbl(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, BN_C ret = 1; -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; @@ -1075,7 +1079,7 @@ ec_GFp_simple_is_on_curve(const EC_GROUP * group, const EC_POINT * point, BN_CTX ret = (0 == BN_ucmp(tmp, rh)); -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; @@ -1177,7 +1181,7 @@ ec_GFp_simple_cmp(const EC_GROUP * group, const EC_POINT * a, const EC_POINT * b /* points are equal */ ret = 0; -end: + end: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; @@ -1215,7 +1219,7 @@ ec_GFp_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx } ret = 1; -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; @@ -1380,7 +1384,7 @@ ec_GFp_simple_points_make_affine(const EC_GROUP * group, size_t num, EC_POINT * ret = 1; -err: + err: BN_CTX_end(ctx); BN_CTX_free(new_ctx); if (heap != NULL) { @@ -1403,9 +1407,319 @@ ec_GFp_simple_field_mul(const EC_GROUP * group, BIGNUM * r, const BIGNUM * a, co return BN_mod_mul(r, a, b, &group->field, ctx); } - int ec_GFp_simple_field_sqr(const EC_GROUP * group, BIGNUM * r, const BIGNUM * a, BN_CTX * ctx) { return BN_mod_sqr(r, a, &group->field, ctx); } + +/* + * Apply randomization of EC point projective coordinates: + * + * (X, Y, Z) = (lambda^2 * X, lambda^3 * Y, lambda * Z) + * + * where lambda is in the interval [1, group->field). + */ +int +ec_GFp_simple_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CTX *ctx) +{ + BIGNUM *lambda = NULL; + BIGNUM *tmp = NULL; + int ret = 0; + + BN_CTX_start(ctx); + if ((lambda = BN_CTX_get(ctx)) == NULL) + goto err; + if ((tmp = BN_CTX_get(ctx)) == NULL) + goto err; + + /* Generate lambda in [1, group->field - 1] */ + if (!bn_rand_interval(lambda, BN_value_one(), &group->field)) + goto err; + + if (group->meth->field_encode != NULL && + !group->meth->field_encode(group, lambda, lambda, ctx)) + goto err; + + /* Z = lambda * Z */ + if (!group->meth->field_mul(group, &p->Z, lambda, &p->Z, ctx)) + goto err; + + /* tmp = lambda^2 */ + if (!group->meth->field_sqr(group, tmp, lambda, ctx)) + goto err; + + /* X = lambda^2 * X */ + if (!group->meth->field_mul(group, &p->X, tmp, &p->X, ctx)) + goto err; + + /* tmp = lambda^3 */ + if (!group->meth->field_mul(group, tmp, tmp, lambda, ctx)) + goto err; + + /* Y = lambda^3 * Y */ + if (!group->meth->field_mul(group, &p->Y, tmp, &p->Y, ctx)) + goto err; + + /* Disable optimized arithmetics after replacing Z by lambda * Z. */ + p->Z_is_one = 0; + + ret = 1; + + err: + BN_CTX_end(ctx); + return ret; +} + + +#define EC_POINT_BN_set_flags(P, flags) do { \ + BN_set_flags(&(P)->X, (flags)); \ + BN_set_flags(&(P)->Y, (flags)); \ + BN_set_flags(&(P)->Z, (flags)); \ +} while(0) + +#define EC_POINT_CSWAP(c, a, b, w, t) do { \ + if (!BN_swap_ct(c, &(a)->X, &(b)->X, w) || \ + !BN_swap_ct(c, &(a)->Y, &(b)->Y, w) || \ + !BN_swap_ct(c, &(a)->Z, &(b)->Z, w)) \ + goto err; \ + t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \ + (a)->Z_is_one ^= (t); \ + (b)->Z_is_one ^= (t); \ +} while(0) + +/* + * This function computes (in constant time) a point multiplication over the + * EC group. + * + * At a high level, it is Montgomery ladder with conditional swaps. + * + * It performs either a fixed point multiplication + * (scalar * generator) + * when point is NULL, or a variable point multiplication + * (scalar * point) + * when point is not NULL. + * + * scalar should be in the range [0,n) otherwise all constant time bets are off. + * + * NB: This says nothing about EC_POINT_add and EC_POINT_dbl, + * which of course are not constant time themselves. + * + * The product is stored in r. + * + * Returns 1 on success, 0 otherwise. + */ +static int +ec_GFp_simple_mul_ct(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, + const EC_POINT *point, BN_CTX *ctx) +{ + int i, cardinality_bits, group_top, kbit, pbit, Z_is_one; + EC_POINT *s = NULL; + BIGNUM *k = NULL; + BIGNUM *lambda = NULL; + BIGNUM *cardinality = NULL; + BN_CTX *new_ctx = NULL; + int ret = 0; + + if (ctx == NULL && (ctx = new_ctx = BN_CTX_new()) == NULL) + return 0; + + BN_CTX_start(ctx); + + if ((s = EC_POINT_new(group)) == NULL) + goto err; + + if (point == NULL) { + if (!EC_POINT_copy(s, group->generator)) + goto err; + } else { + if (!EC_POINT_copy(s, point)) + goto err; + } + + EC_POINT_BN_set_flags(s, BN_FLG_CONSTTIME); + + if ((cardinality = BN_CTX_get(ctx)) == NULL) + goto err; + if ((lambda = BN_CTX_get(ctx)) == NULL) + goto err; + if ((k = BN_CTX_get(ctx)) == NULL) + goto err; + if (!BN_mul(cardinality, &group->order, &group->cofactor, ctx)) + goto err; + + /* + * Group cardinalities are often on a word boundary. + * So when we pad the scalar, some timing diff might + * pop if it needs to be expanded due to carries. + * So expand ahead of time. + */ + cardinality_bits = BN_num_bits(cardinality); + group_top = cardinality->top; + if ((bn_wexpand(k, group_top + 2) == NULL) || + (bn_wexpand(lambda, group_top + 2) == NULL)) + goto err; + + if (!BN_copy(k, scalar)) + goto err; + + BN_set_flags(k, BN_FLG_CONSTTIME); + + if (BN_num_bits(k) > cardinality_bits || BN_is_negative(k)) { + /* + * This is an unusual input, and we don't guarantee + * constant-timeness + */ + if (!BN_nnmod(k, k, cardinality, ctx)) + goto err; + } + + if (!BN_add(lambda, k, cardinality)) + goto err; + BN_set_flags(lambda, BN_FLG_CONSTTIME); + if (!BN_add(k, lambda, cardinality)) + goto err; + /* + * lambda := scalar + cardinality + * k := scalar + 2*cardinality + */ + kbit = BN_is_bit_set(lambda, cardinality_bits); + if (!BN_swap_ct(kbit, k, lambda, group_top + 2)) + goto err; + + group_top = group->field.top; + if ((bn_wexpand(&s->X, group_top) == NULL) || + (bn_wexpand(&s->Y, group_top) == NULL) || + (bn_wexpand(&s->Z, group_top) == NULL) || + (bn_wexpand(&r->X, group_top) == NULL) || + (bn_wexpand(&r->Y, group_top) == NULL) || + (bn_wexpand(&r->Z, group_top) == NULL)) + goto err; + + /* + * Apply coordinate blinding for EC_POINT if the underlying EC_METHOD + * implements it. + */ + if (!ec_point_blind_coordinates(group, s, ctx)) + goto err; + + /* top bit is a 1, in a fixed pos */ + if (!EC_POINT_copy(r, s)) + goto err; + + EC_POINT_BN_set_flags(r, BN_FLG_CONSTTIME); + + if (!EC_POINT_dbl(group, s, s, ctx)) + goto err; + + pbit = 0; + + /* + * The ladder step, with branches, is + * + * k[i] == 0: S = add(R, S), R = dbl(R) + * k[i] == 1: R = add(S, R), S = dbl(S) + * + * Swapping R, S conditionally on k[i] leaves you with state + * + * k[i] == 0: T, U = R, S + * k[i] == 1: T, U = S, R + * + * Then perform the ECC ops. + * + * U = add(T, U) + * T = dbl(T) + * + * Which leaves you with state + * + * k[i] == 0: U = add(R, S), T = dbl(R) + * k[i] == 1: U = add(S, R), T = dbl(S) + * + * Swapping T, U conditionally on k[i] leaves you with state + * + * k[i] == 0: R, S = T, U + * k[i] == 1: R, S = U, T + * + * Which leaves you with state + * + * k[i] == 0: S = add(R, S), R = dbl(R) + * k[i] == 1: R = add(S, R), S = dbl(S) + * + * So we get the same logic, but instead of a branch it's a + * conditional swap, followed by ECC ops, then another conditional swap. + * + * Optimization: The end of iteration i and start of i-1 looks like + * + * ... + * CSWAP(k[i], R, S) + * ECC + * CSWAP(k[i], R, S) + * (next iteration) + * CSWAP(k[i-1], R, S) + * ECC + * CSWAP(k[i-1], R, S) + * ... + * + * So instead of two contiguous swaps, you can merge the condition + * bits and do a single swap. + * + * k[i] k[i-1] Outcome + * 0 0 No Swap + * 0 1 Swap + * 1 0 Swap + * 1 1 No Swap + * + * This is XOR. pbit tracks the previous bit of k. + */ + + for (i = cardinality_bits - 1; i >= 0; i--) { + kbit = BN_is_bit_set(k, i) ^ pbit; + EC_POINT_CSWAP(kbit, r, s, group_top, Z_is_one); + if (!EC_POINT_add(group, s, r, s, ctx)) + goto err; + if (!EC_POINT_dbl(group, r, r, ctx)) + goto err; + /* + * pbit logic merges this cswap with that of the + * next iteration + */ + pbit ^= kbit; + } + /* one final cswap to move the right value into r */ + EC_POINT_CSWAP(pbit, r, s, group_top, Z_is_one); + + ret = 1; + + err: + EC_POINT_free(s); + if (ctx != NULL) + BN_CTX_end(ctx); + BN_CTX_free(new_ctx); + + return ret; +} + +#undef EC_POINT_BN_set_flags +#undef EC_POINT_CSWAP + +int +ec_GFp_simple_mul_generator_ct(const EC_GROUP *group, EC_POINT *r, + const BIGNUM *scalar, BN_CTX *ctx) +{ + return ec_GFp_simple_mul_ct(group, r, scalar, NULL, ctx); +} + +int +ec_GFp_simple_mul_single_ct(const EC_GROUP *group, EC_POINT *r, + const BIGNUM *scalar, const EC_POINT *point, BN_CTX *ctx) +{ + return ec_GFp_simple_mul_ct(group, r, scalar, point, ctx); +} + +int +ec_GFp_simple_mul_double_nonct(const EC_GROUP *group, EC_POINT *r, + const BIGNUM *g_scalar, const BIGNUM *p_scalar, const EC_POINT *point, + BN_CTX *ctx) +{ + return ec_wNAF_mul(group, r, g_scalar, 1, &point, &p_scalar, ctx); +} diff --git a/crypto/ecdh/ech_key.c b/crypto/ecdh/ech_key.c index 5c2dc70b..378912ca 100644 --- a/crypto/ecdh/ech_key.c +++ b/crypto/ecdh/ech_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ech_key.c,v 1.7 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ech_key.c,v 1.9 2019/01/19 01:12:48 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -78,6 +78,7 @@ #include #include "ech_locl.h" +#include "ec_lcl.h" static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key, EC_KEY *ecdh, @@ -125,6 +126,10 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, } group = EC_KEY_get0_group(ecdh); + + if (!EC_POINT_is_on_curve(group, pub_key, ctx)) + goto err; + if ((tmp = EC_POINT_new(group)) == NULL) { ECDHerror(ERR_R_MALLOC_FAILURE); goto err; @@ -211,13 +216,26 @@ ECDH_OpenSSL(void) return &openssl_ecdh_meth; } +/* replace w/ ecdh_compute_key() when ECDH_METHOD gets removed */ int -ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, +ossl_ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *eckey, void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)) { - ECDH_DATA *ecdh = ecdh_check(eckey); - if (ecdh == NULL) + ECDH_DATA *ecdh; + + if ((ecdh = ecdh_check(eckey)) == NULL) return 0; return ecdh->meth->compute_key(out, outlen, pub_key, eckey, KDF); } + +int +ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, + EC_KEY *eckey, + void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)) +{ + if (eckey->meth->compute_key != NULL) + return eckey->meth->compute_key(out, outlen, pub_key, eckey, KDF); + ECerror(EC_R_NOT_IMPLEMENTED); + return 0; +} diff --git a/crypto/ecdh/ech_lib.c b/crypto/ecdh/ech_lib.c index 2846a886..cc8edafa 100644 --- a/crypto/ecdh/ech_lib.c +++ b/crypto/ecdh/ech_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ech_lib.c,v 1.13 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: ech_lib.c,v 1.14 2018/04/14 07:09:21 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -109,10 +109,8 @@ ECDH_set_method(EC_KEY *eckey, const ECDH_METHOD *meth) return 0; #ifndef OPENSSL_NO_ENGINE - if (ecdh->engine) { - ENGINE_finish(ecdh->engine); - ecdh->engine = NULL; - } + ENGINE_finish(ecdh->engine); + ecdh->engine = NULL; #endif ecdh->meth = meth; return 1; @@ -138,7 +136,7 @@ ECDH_DATA_new_method(ENGINE *engine) ret->engine = ENGINE_get_default_ECDH(); if (ret->engine) { ret->meth = ENGINE_get_ECDH(ret->engine); - if (!ret->meth) { + if (ret->meth == NULL) { ECDHerror(ERR_R_ENGINE_LIB); ENGINE_finish(ret->engine); free(ret); @@ -176,8 +174,7 @@ ecdh_data_free(void *data) ECDH_DATA *r = (ECDH_DATA *)data; #ifndef OPENSSL_NO_ENGINE - if (r->engine) - ENGINE_finish(r->engine); + ENGINE_finish(r->engine); #endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDH, r, &r->ex_data); diff --git a/crypto/ecdsa/ecs_asn1.c b/crypto/ecdsa/ecs_asn1.c index 725fe44a..e4638586 100644 --- a/crypto/ecdsa/ecs_asn1.c +++ b/crypto/ecdsa/ecs_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecs_asn1.c,v 1.8 2015/10/16 15:15:39 jsing Exp $ */ +/* $OpenBSD: ecs_asn1.c,v 1.9 2018/03/17 15:24:44 tb Exp $ */ /* ==================================================================== * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. * @@ -113,3 +113,25 @@ ECDSA_SIG_free(ECDSA_SIG *a) { ASN1_item_free((ASN1_VALUE *)a, &ECDSA_SIG_it); } + +void +ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) +{ + if (pr != NULL) + *pr = sig->r; + if (ps != NULL) + *ps = sig->s; +} + +int +ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) +{ + if (r == NULL || s == NULL) + return 0; + + BN_clear_free(sig->r); + BN_clear_free(sig->s); + sig->r = r; + sig->s = s; + return 1; +} diff --git a/crypto/ecdsa/ecs_lib.c b/crypto/ecdsa/ecs_lib.c index 4fbe1e06..c688a95f 100644 --- a/crypto/ecdsa/ecs_lib.c +++ b/crypto/ecdsa/ecs_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecs_lib.c,v 1.12 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: ecs_lib.c,v 1.13 2018/04/14 07:09:21 tb Exp $ */ /* ==================================================================== * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. * @@ -96,10 +96,8 @@ ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth) return 0; #ifndef OPENSSL_NO_ENGINE - if (ecdsa->engine) { - ENGINE_finish(ecdsa->engine); - ecdsa->engine = NULL; - } + ENGINE_finish(ecdsa->engine); + ecdsa->engine = NULL; #endif ecdsa->meth = meth; @@ -126,7 +124,7 @@ ECDSA_DATA_new_method(ENGINE *engine) ret->engine = ENGINE_get_default_ECDSA(); if (ret->engine) { ret->meth = ENGINE_get_ECDSA(ret->engine); - if (!ret->meth) { + if (ret->meth == NULL) { ECDSAerror(ERR_R_ENGINE_LIB); ENGINE_finish(ret->engine); free(ret); @@ -164,8 +162,7 @@ ecdsa_data_free(void *data) ECDSA_DATA *r = (ECDSA_DATA *)data; #ifndef OPENSSL_NO_ENGINE - if (r->engine) - ENGINE_finish(r->engine); + ENGINE_finish(r->engine); #endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDSA, r, &r->ex_data); diff --git a/crypto/ecdsa/ecs_locl.h b/crypto/ecdsa/ecs_locl.h index 94e88743..0a9f1790 100644 --- a/crypto/ecdsa/ecs_locl.h +++ b/crypto/ecdsa/ecs_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ecs_locl.h,v 1.5 2016/12/21 15:49:29 jsing Exp $ */ +/* $OpenBSD: ecs_locl.h,v 1.6 2019/01/19 01:07:00 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -81,6 +81,14 @@ typedef struct ecdsa_data_st { */ ECDSA_DATA *ecdsa_check(EC_KEY *eckey); +int ossl_ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, + BIGNUM **rp); +int ossl_ecdsa_sign(int type, const unsigned char *dgst, int dlen, + unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, + const BIGNUM *r, EC_KEY *eckey); +ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len, + const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey); + __END_HIDDEN_DECLS #endif /* HEADER_ECS_LOCL_H */ diff --git a/crypto/ecdsa/ecs_ossl.c b/crypto/ecdsa/ecs_ossl.c index e6745b11..791a5c48 100644 --- a/crypto/ecdsa/ecs_ossl.c +++ b/crypto/ecdsa/ecs_ossl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecs_ossl.c,v 1.9.6.1 2018/06/13 15:07:19 jsing Exp $ */ +/* $OpenBSD: ecs_ossl.c,v 1.18 2019/01/19 01:12:48 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -56,6 +56,8 @@ * */ +#include + #include #include @@ -65,7 +67,9 @@ #include "bn_lcl.h" #include "ecs_locl.h" -static ECDSA_SIG *ecdsa_do_sign(const unsigned char *dgst, int dlen, +static int ecdsa_prepare_digest(const unsigned char *dgst, int dgst_len, + BIGNUM *order, BIGNUM *ret); +static ECDSA_SIG *ecdsa_do_sign(const unsigned char *dgst, int dgst_len, const BIGNUM *, const BIGNUM *, EC_KEY *eckey); static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp); @@ -85,37 +89,72 @@ ECDSA_OpenSSL(void) return &openssl_ecdsa_meth; } +static int +ecdsa_prepare_digest(const unsigned char *dgst, int dgst_len, BIGNUM *order, + BIGNUM *ret) +{ + int dgst_bits, order_bits; + + if (!BN_bin2bn(dgst, dgst_len, ret)) { + ECDSAerror(ERR_R_BN_LIB); + return 0; + } + + /* FIPS 186-3 6.4: Use order_bits leftmost bits if digest is too long */ + dgst_bits = 8 * dgst_len; + order_bits = BN_num_bits(order); + if (dgst_bits > order_bits) { + if (!BN_rshift(ret, ret, dgst_bits - order_bits)) { + ECDSAerror(ERR_R_BN_LIB); + return 0; + } + } + + return 1; +} + +int +ossl_ecdsa_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig, + unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey) +{ + ECDSA_SIG *s; + + if ((s = ECDSA_do_sign_ex(dgst, dlen, kinv, r, eckey)) == NULL) { + *siglen = 0; + return 0; + } + *siglen = i2d_ECDSA_SIG(s, &sig); + ECDSA_SIG_free(s); + return 1; +} + static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) { - BN_CTX *ctx = NULL; - BIGNUM *k = NULL, *r = NULL, *order = NULL, *X = NULL; - EC_POINT *tmp_point = NULL; + BN_CTX *ctx = ctx_in; + BIGNUM *k = NULL, *r = NULL, *order = NULL, *X = NULL; + EC_POINT *point = NULL; const EC_GROUP *group; - int ret = 0; + int order_bits, ret = 0; if (eckey == NULL || (group = EC_KEY_get0_group(eckey)) == NULL) { ECDSAerror(ERR_R_PASSED_NULL_PARAMETER); return 0; } - if (ctx_in == NULL) { + if (ctx == NULL) { if ((ctx = BN_CTX_new()) == NULL) { ECDSAerror(ERR_R_MALLOC_FAILURE); return 0; } - } else - ctx = ctx_in; - - k = BN_new(); /* this value is later returned in *kinvp */ - r = BN_new(); /* this value is later returned in *rp */ - order = BN_new(); - X = BN_new(); - if (!k || !r || !order || !X) { + } + + if ((k = BN_new()) == NULL || (r = BN_new()) == NULL || + (order = BN_new()) == NULL || (X = BN_new()) == NULL) { ECDSAerror(ERR_R_MALLOC_FAILURE); goto err; } - if ((tmp_point = EC_POINT_new(group)) == NULL) { + if ((point = EC_POINT_new(group)) == NULL) { ECDSAerror(ERR_R_EC_LIB); goto err; } @@ -124,44 +163,60 @@ ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) goto err; } + /* Preallocate space. */ + order_bits = BN_num_bits(order); + if (!BN_set_bit(k, order_bits) || + !BN_set_bit(r, order_bits) || + !BN_set_bit(X, order_bits)) + goto err; + do { - /* get random k */ - do + do { if (!BN_rand_range(k, order)) { - ECDSAerror(ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED); + ECDSAerror( + ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED); goto err; } - while (BN_is_zero(k)); - - /* We do not want timing information to leak the length of k, - * so we compute G*k using an equivalent scalar of fixed - * bit-length. */ - if (!BN_add(k, k, order)) + } while (BN_is_zero(k)); + + /* + * We do not want timing information to leak the length of k, + * so we compute G * k using an equivalent scalar of fixed + * bit-length. + * + * We unconditionally perform both of these additions to prevent + * a small timing information leakage. We then choose the sum + * that is one bit longer than the order. This guarantees the + * code path used in the constant time implementations + * elsewhere. + * + * TODO: revisit the BN_copy aiming for a memory access agnostic + * conditional copy. + */ + if (!BN_add(r, k, order) || + !BN_add(X, r, order) || + !BN_copy(k, BN_num_bits(r) > order_bits ? r : X)) goto err; - if (BN_num_bits(k) <= BN_num_bits(order)) - if (!BN_add(k, k, order)) - goto err; BN_set_flags(k, BN_FLG_CONSTTIME); - /* compute r the x-coordinate of generator * k */ - if (!EC_POINT_mul(group, tmp_point, k, NULL, NULL, ctx)) { + /* Compute r, the x-coordinate of G * k. */ + if (!EC_POINT_mul(group, point, k, NULL, NULL, ctx)) { ECDSAerror(ERR_R_EC_LIB); goto err; } if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) { - if (!EC_POINT_get_affine_coordinates_GFp(group, - tmp_point, X, NULL, ctx)) { + if (!EC_POINT_get_affine_coordinates_GFp(group, point, + X, NULL, ctx)) { ECDSAerror(ERR_R_EC_LIB); goto err; } } #ifndef OPENSSL_NO_EC2M - else /* NID_X9_62_characteristic_two_field */ - { - if (!EC_POINT_get_affine_coordinates_GF2m(group, - tmp_point, X, NULL, ctx)) { + else { /* NID_X9_62_characteristic_two_field */ + if (!EC_POINT_get_affine_coordinates_GF2m(group, point, + X, NULL, ctx)) { ECDSAerror(ERR_R_EC_LIB); goto err; } @@ -173,45 +228,52 @@ ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) } } while (BN_is_zero(r)); - /* compute the inverse of k */ if (!BN_mod_inverse_ct(k, k, order, ctx)) { ECDSAerror(ERR_R_BN_LIB); goto err; } - /* clear old values if necessary */ BN_clear_free(*rp); BN_clear_free(*kinvp); - /* save the pre-computed values */ *rp = r; *kinvp = k; ret = 1; -err: - if (!ret) { + err: + if (ret == 0) { BN_clear_free(k); BN_clear_free(r); } if (ctx_in == NULL) BN_CTX_free(ctx); BN_free(order); - EC_POINT_free(tmp_point); + EC_POINT_free(point); BN_clear_free(X); return (ret); } +/* replace w/ ecdsa_sign_setup() when ECDSA_METHOD gets removed */ +int +ossl_ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) +{ + ECDSA_DATA *ecdsa; + + if ((ecdsa = ecdsa_check(eckey)) == NULL) + return 0; + return ecdsa->meth->ecdsa_sign_setup(eckey, ctx_in, kinvp, rp); +} static ECDSA_SIG * ecdsa_do_sign(const unsigned char *dgst, int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey) { - int ok = 0, i; - BIGNUM *kinv = NULL, *s, *m = NULL, *tmp = NULL, *order = NULL; - const BIGNUM *ckinv; - BN_CTX *ctx = NULL; - const EC_GROUP *group; + BIGNUM *b = NULL, *binv = NULL, *bm = NULL, *bxr = NULL; + BIGNUM *kinv = NULL, *m = NULL, *order = NULL, *range = NULL, *s; + const BIGNUM *ckinv, *priv_key; + BN_CTX *ctx = NULL; + const EC_GROUP *group; ECDSA_SIG *ret; ECDSA_DATA *ecdsa; - const BIGNUM *priv_key; + int ok = 0; ecdsa = ecdsa_check(eckey); group = EC_KEY_get0_group(eckey); @@ -222,15 +284,16 @@ ecdsa_do_sign(const unsigned char *dgst, int dgst_len, return NULL; } - ret = ECDSA_SIG_new(); - if (!ret) { + if ((ret = ECDSA_SIG_new()) == NULL) { ECDSAerror(ERR_R_MALLOC_FAILURE); return NULL; } s = ret->s; if ((ctx = BN_CTX_new()) == NULL || (order = BN_new()) == NULL || - (tmp = BN_new()) == NULL || (m = BN_new()) == NULL) { + (range = BN_new()) == NULL || (b = BN_new()) == NULL || + (binv = BN_new()) == NULL || (bm = BN_new()) == NULL || + (bxr = BN_new()) == NULL || (m = BN_new()) == NULL) { ECDSAerror(ERR_R_MALLOC_FAILURE); goto err; } @@ -239,21 +302,10 @@ ecdsa_do_sign(const unsigned char *dgst, int dgst_len, ECDSAerror(ERR_R_EC_LIB); goto err; } - i = BN_num_bits(order); - /* Need to truncate digest if it is too long: first truncate whole - * bytes. - */ - if (8 * dgst_len > i) - dgst_len = (i + 7)/8; - if (!BN_bin2bn(dgst, dgst_len, m)) { - ECDSAerror(ERR_R_BN_LIB); - goto err; - } - /* If still too long truncate remaining bits with a shift */ - if ((8 * dgst_len > i) && !BN_rshift(m, m, 8 - (i & 0x7))) { - ECDSAerror(ERR_R_BN_LIB); + + if (!ecdsa_prepare_digest(dgst, dgst_len, order, m)) goto err; - } + do { if (in_kinv == NULL || in_r == NULL) { if (!ECDSA_sign_setup(eckey, ctx, &kinv, &ret->r)) { @@ -269,11 +321,55 @@ ecdsa_do_sign(const unsigned char *dgst, int dgst_len, } } - if (!BN_mod_mul(tmp, priv_key, ret->r, order, ctx)) { + /* + * Compute: + * + * s = inv(k)(m + xr) mod order + * + * In order to reduce the possibility of a side-channel attack, + * the following is calculated using a blinding value: + * + * s = inv(k)inv(b)(bm + bxr) mod order + * + * where b is a random value in the range [1, order-1]. + */ + + /* Generate b in range [1, order-1]. */ + if (!BN_sub(range, order, BN_value_one())) { ECDSAerror(ERR_R_BN_LIB); goto err; } - if (!BN_mod_add(s, tmp, m, order, ctx)) { + if (!BN_rand_range(b, range)) { + ECDSAerror(ERR_R_BN_LIB); + goto err; + } + if (!BN_add(b, b, BN_value_one())) { + ECDSAerror(ERR_R_BN_LIB); + goto err; + } + + if (BN_mod_inverse_ct(binv, b, order, ctx) == NULL) { + ECDSAerror(ERR_R_BN_LIB); + goto err; + } + + if (!BN_mod_mul(bxr, b, priv_key, order, ctx)) { /* bx */ + ECDSAerror(ERR_R_BN_LIB); + goto err; + } + if (!BN_mod_mul(bxr, bxr, ret->r, order, ctx)) { /* bxr */ + ECDSAerror(ERR_R_BN_LIB); + goto err; + } + if (!BN_mod_mul(bm, b, m, order, ctx)) { /* bm */ + ECDSAerror(ERR_R_BN_LIB); + goto err; + } + if (!BN_mod_add(s, bm, bxr, order, ctx)) { /* s = bm + bxr */ + ECDSAerror(ERR_R_BN_LIB); + goto err; + } + if (!BN_mod_mul(s, s, binv, order, ctx)) { /* s = m + xr */ ECDSAerror(ERR_R_BN_LIB); goto err; } @@ -281,9 +377,12 @@ ecdsa_do_sign(const unsigned char *dgst, int dgst_len, ECDSAerror(ERR_R_BN_LIB); goto err; } + if (BN_is_zero(s)) { - /* if kinv and r have been supplied by the caller - * don't to generate new kinv and r values */ + /* + * If kinv and r have been supplied by the caller, + * don't generate new kinv and r values + */ if (in_kinv != NULL && in_r != NULL) { ECDSAerror(ECDSA_R_NEED_NEW_SETUP_VALUES); goto err; @@ -295,39 +394,79 @@ ecdsa_do_sign(const unsigned char *dgst, int dgst_len, ok = 1; -err: - if (!ok) { + err: + if (ok == 0) { ECDSA_SIG_free(ret); ret = NULL; } BN_CTX_free(ctx); + BN_clear_free(b); + BN_clear_free(binv); + BN_clear_free(bm); + BN_clear_free(bxr); + BN_clear_free(kinv); BN_clear_free(m); - BN_clear_free(tmp); BN_free(order); - BN_clear_free(kinv); + BN_free(range); return ret; } +/* replace w/ ecdsa_do_sign() when ECDSA_METHOD gets removed */ +ECDSA_SIG * +ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len, + const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey) +{ + ECDSA_DATA *ecdsa; + + if ((ecdsa = ecdsa_check(eckey)) == NULL) + return NULL; + return ecdsa->meth->ecdsa_do_sign(dgst, dgst_len, in_kinv, in_r, eckey); +} + +int +ossl_ecdsa_verify(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, int sig_len, EC_KEY *eckey) +{ + ECDSA_SIG *s; + unsigned char *der = NULL; + const unsigned char *p = sigbuf; + int derlen = -1; + int ret = -1; + + if ((s = ECDSA_SIG_new()) == NULL) + return (ret); + if (d2i_ECDSA_SIG(&s, &p, sig_len) == NULL) + goto err; + /* Ensure signature uses DER and doesn't have trailing garbage */ + derlen = i2d_ECDSA_SIG(s, &der); + if (derlen != sig_len || memcmp(sigbuf, der, derlen)) + goto err; + ret = ECDSA_do_verify(dgst, dgst_len, s, eckey); + + err: + freezero(der, derlen); + ECDSA_SIG_free(s); + return (ret); +} + static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY *eckey) { - int ret = -1, i; - BN_CTX *ctx; - BIGNUM *order, *u1, *u2, *m, *X; + BN_CTX *ctx; + BIGNUM *order, *u1, *u2, *m, *X; EC_POINT *point = NULL; const EC_GROUP *group; const EC_POINT *pub_key; + int ret = -1; - /* check input values */ if (eckey == NULL || (group = EC_KEY_get0_group(eckey)) == NULL || (pub_key = EC_KEY_get0_public_key(eckey)) == NULL || sig == NULL) { ECDSAerror(ECDSA_R_MISSING_PARAMETERS); return -1; } - ctx = BN_CTX_new(); - if (!ctx) { + if ((ctx = BN_CTX_new()) == NULL) { ECDSAerror(ERR_R_MALLOC_FAILURE); return -1; } @@ -337,7 +476,7 @@ ecdsa_do_verify(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, u2 = BN_CTX_get(ctx); m = BN_CTX_get(ctx); X = BN_CTX_get(ctx); - if (!X) { + if (X == NULL) { ECDSAerror(ERR_R_BN_LIB); goto err; } @@ -347,45 +486,33 @@ ecdsa_do_verify(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, goto err; } - if (BN_is_zero(sig->r) || BN_is_negative(sig->r) || - BN_ucmp(sig->r, order) >= 0 || BN_is_zero(sig->s) || - BN_is_negative(sig->s) || BN_ucmp(sig->s, order) >= 0) { + /* Verify that r and s are in the range [1, order-1]. */ + if (BN_is_zero(sig->r) || BN_is_negative(sig->r) || + BN_ucmp(sig->r, order) >= 0 || + BN_is_zero(sig->s) || BN_is_negative(sig->s) || + BN_ucmp(sig->s, order) >= 0) { ECDSAerror(ECDSA_R_BAD_SIGNATURE); - ret = 0; /* signature is invalid */ - goto err; - } - /* calculate tmp1 = inv(S) mod order */ - if (!BN_mod_inverse_ct(u2, sig->s, order, ctx)) { - ECDSAerror(ERR_R_BN_LIB); + ret = 0; goto err; } - /* digest -> m */ - i = BN_num_bits(order); - /* Need to truncate digest if it is too long: first truncate whole - * bytes. - */ - if (8 * dgst_len > i) - dgst_len = (i + 7)/8; - if (!BN_bin2bn(dgst, dgst_len, m)) { - ECDSAerror(ERR_R_BN_LIB); + + if (!ecdsa_prepare_digest(dgst, dgst_len, order, m)) goto err; - } - /* If still too long truncate remaining bits with a shift */ - if ((8 * dgst_len > i) && !BN_rshift(m, m, 8 - (i & 0x7))) { + + if (!BN_mod_inverse_ct(u2, sig->s, order, ctx)) { /* w = inv(s) */ ECDSAerror(ERR_R_BN_LIB); goto err; } - /* u1 = m * tmp mod order */ - if (!BN_mod_mul(u1, m, u2, order, ctx)) { + if (!BN_mod_mul(u1, m, u2, order, ctx)) { /* u1 = mw */ ECDSAerror(ERR_R_BN_LIB); goto err; } - /* u2 = r * w mod q */ - if (!BN_mod_mul(u2, sig->r, u2, order, ctx)) { + if (!BN_mod_mul(u2, sig->r, u2, order, ctx)) { /* u2 = rw */ ECDSAerror(ERR_R_BN_LIB); goto err; } + /* Compute the x-coordinate of G * u1 + pub_key * u2. */ if ((point = EC_POINT_new(group)) == NULL) { ECDSAerror(ERR_R_MALLOC_FAILURE); goto err; @@ -396,17 +523,16 @@ ecdsa_do_verify(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, } if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) { - if (!EC_POINT_get_affine_coordinates_GFp(group, - point, X, NULL, ctx)) { + if (!EC_POINT_get_affine_coordinates_GFp(group, point, X, NULL, + ctx)) { ECDSAerror(ERR_R_EC_LIB); goto err; } } #ifndef OPENSSL_NO_EC2M - else /* NID_X9_62_characteristic_two_field */ - { - if (!EC_POINT_get_affine_coordinates_GF2m(group, - point, X, NULL, ctx)) { + else { /* NID_X9_62_characteristic_two_field */ + if (!EC_POINT_get_affine_coordinates_GF2m(group, point, X, NULL, + ctx)) { ECDSAerror(ERR_R_EC_LIB); goto err; } @@ -416,12 +542,25 @@ ecdsa_do_verify(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, ECDSAerror(ERR_R_BN_LIB); goto err; } - /* if the signature is correct u1 is equal to sig->r */ + + /* If the signature is correct, the x-coordinate is equal to sig->r. */ ret = (BN_ucmp(u1, sig->r) == 0); -err: + err: BN_CTX_end(ctx); BN_CTX_free(ctx); EC_POINT_free(point); return ret; } + +/* replace w/ ecdsa_do_verify() when ECDSA_METHOD gets removed */ +int +ossl_ecdsa_verify_sig(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey) +{ + ECDSA_DATA *ecdsa; + + if ((ecdsa = ecdsa_check(eckey)) == NULL) + return 0; + return ecdsa->meth->ecdsa_do_verify(dgst, dgst_len, sig, eckey); +} diff --git a/crypto/ecdsa/ecs_sign.c b/crypto/ecdsa/ecs_sign.c index 029a0cb5..5beb853b 100644 --- a/crypto/ecdsa/ecs_sign.c +++ b/crypto/ecdsa/ecs_sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecs_sign.c,v 1.6 2015/02/08 13:35:07 jsing Exp $ */ +/* $OpenBSD: ecs_sign.c,v 1.7 2019/01/19 01:07:00 tb Exp $ */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * @@ -55,11 +55,13 @@ #include -#include "ecs_locl.h" #ifndef OPENSSL_NO_ENGINE #include #endif +#include "ecs_locl.h" +#include "ec_lcl.h" + ECDSA_SIG * ECDSA_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey) { @@ -70,11 +72,10 @@ ECDSA_SIG * ECDSA_do_sign_ex(const unsigned char *dgst, int dlen, const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey) { - ECDSA_DATA *ecdsa = ecdsa_check(eckey); - - if (ecdsa == NULL) - return NULL; - return ecdsa->meth->ecdsa_do_sign(dgst, dlen, kinv, rp, eckey); + if (eckey->meth->sign_sig != NULL) + return eckey->meth->sign_sig(dgst, dlen, kinv, rp, eckey); + ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED); + return 0; } int @@ -88,24 +89,17 @@ int ECDSA_sign_ex(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey) { - ECDSA_SIG *s; - - s = ECDSA_do_sign_ex(dgst, dlen, kinv, r, eckey); - if (s == NULL) { - *siglen = 0; - return 0; - } - *siglen = i2d_ECDSA_SIG(s, &sig); - ECDSA_SIG_free(s); - return 1; + if (eckey->meth->sign != NULL) + return eckey->meth->sign(type, dgst, dlen, sig, siglen, kinv, r, eckey); + ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED); + return 0; } int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) { - ECDSA_DATA *ecdsa = ecdsa_check(eckey); - - if (ecdsa == NULL) - return 0; - return ecdsa->meth->ecdsa_sign_setup(eckey, ctx_in, kinvp, rp); + if (eckey->meth->sign_setup != NULL) + return eckey->meth->sign_setup(eckey, ctx_in, kinvp, rp); + ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED); + return 0; } diff --git a/crypto/ecdsa/ecs_vrf.c b/crypto/ecdsa/ecs_vrf.c index 270af94c..4c1bc85e 100644 --- a/crypto/ecdsa/ecs_vrf.c +++ b/crypto/ecdsa/ecs_vrf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecs_vrf.c,v 1.6 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: ecs_vrf.c,v 1.7 2019/01/19 01:12:48 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -56,10 +56,10 @@ * */ -#include #include #include "ecs_locl.h" +#include "ec_lcl.h" #ifndef OPENSSL_NO_ENGINE #include #endif @@ -73,11 +73,10 @@ int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY *eckey) { - ECDSA_DATA *ecdsa = ecdsa_check(eckey); - - if (ecdsa == NULL) - return 0; - return ecdsa->meth->ecdsa_do_verify(dgst, dgst_len, sig, eckey); + if (eckey->meth->verify_sig != NULL) + return eckey->meth->verify_sig(dgst, dgst_len, sig, eckey); + ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED); + return 0; } /* returns @@ -89,25 +88,9 @@ int ECDSA_verify(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int sig_len, EC_KEY *eckey) { - ECDSA_SIG *s; - unsigned char *der = NULL; - const unsigned char *p = sigbuf; - int derlen = -1; - int ret = -1; - - s = ECDSA_SIG_new(); - if (s == NULL) - return (ret); - if (d2i_ECDSA_SIG(&s, &p, sig_len) == NULL) - goto err; - /* Ensure signature uses DER and doesn't have trailing garbage */ - derlen = i2d_ECDSA_SIG(s, &der); - if (derlen != sig_len || memcmp(sigbuf, der, derlen)) - goto err; - ret = ECDSA_do_verify(dgst, dgst_len, s, eckey); - -err: - freezero(der, derlen); - ECDSA_SIG_free(s); - return (ret); + if (eckey->meth->verify != NULL) + return eckey->meth->verify(type, dgst, dgst_len, + sigbuf, sig_len, eckey); + ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED); + return 0; } diff --git a/crypto/engine/eng_all.c b/crypto/engine/eng_all.c index 7640cf7f..403ca686 100644 --- a/crypto/engine/eng_all.c +++ b/crypto/engine/eng_all.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eng_all.c,v 1.29 2015/07/19 22:34:27 doug Exp $ */ +/* $OpenBSD: eng_all.c,v 1.30 2018/03/17 16:20:01 beck Exp $ */ /* Written by Richard Levitte for the OpenSSL * project 2000. */ @@ -56,17 +56,16 @@ * */ +#include + #include #include "cryptlib.h" #include "eng_int.h" void -ENGINE_load_builtin_engines(void) +ENGINE_load_builtin_engines_internal(void) { - /* Some ENGINEs need this */ - OPENSSL_cpuid_setup(); - #ifndef OPENSSL_NO_STATIC_ENGINE #ifndef OPENSSL_NO_HW #ifndef OPENSSL_NO_HW_PADLOCK @@ -76,3 +75,14 @@ ENGINE_load_builtin_engines(void) #endif ENGINE_register_all_complete(); } + +void +ENGINE_load_builtin_engines(void) +{ + static pthread_once_t once = PTHREAD_ONCE_INIT; + + /* Prayer and clean living lets you ignore errors, OpenSSL style */ + (void) OPENSSL_init_crypto(0, NULL); + + (void) pthread_once(&once, ENGINE_load_builtin_engines_internal); +} diff --git a/crypto/engine/eng_cnf.c b/crypto/engine/eng_cnf.c index 2ac077d4..24358af8 100644 --- a/crypto/engine/eng_cnf.c +++ b/crypto/engine/eng_cnf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eng_cnf.c,v 1.14 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: eng_cnf.c,v 1.15 2018/04/14 07:18:37 tb Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -200,8 +200,7 @@ int_engine_configure(char *name, char *value, const CONF *cnf) "section=%s, name=%s, value=%s", ecmd->section, ecmd->name, ecmd->value); } - if (e) - ENGINE_free(e); + ENGINE_free(e); return ret; } diff --git a/crypto/engine/eng_fat.c b/crypto/engine/eng_fat.c index c97695a7..baf1a548 100644 --- a/crypto/engine/eng_fat.c +++ b/crypto/engine/eng_fat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eng_fat.c,v 1.16 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: eng_fat.c,v 1.17 2019/01/19 01:07:00 tb Exp $ */ /* ==================================================================== * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. * @@ -92,6 +92,10 @@ ENGINE_set_default(ENGINE *e, unsigned int flags) #ifndef OPENSSL_NO_ECDSA if ((flags & ENGINE_METHOD_ECDSA) && !ENGINE_set_default_ECDSA(e)) return 0; +#endif +#ifndef OPENSSL_NO_EC + if ((flags & ENGINE_METHOD_EC) && !ENGINE_set_default_EC(e)) + return 0; #endif if ((flags & ENGINE_METHOD_RAND) && !ENGINE_set_default_RAND(e)) return 0; @@ -123,6 +127,8 @@ int_def_cb(const char *alg, int len, void *arg) *pflags |= ENGINE_METHOD_ECDSA; else if (!strncmp(alg, "DH", len)) *pflags |= ENGINE_METHOD_DH; + else if (strncmp(alg, "EC", len) == 0) + *pflags |= ENGINE_METHOD_EC; else if (!strncmp(alg, "RAND", len)) *pflags |= ENGINE_METHOD_RAND; else if (!strncmp(alg, "CIPHERS", len)) @@ -173,6 +179,9 @@ ENGINE_register_complete(ENGINE *e) #endif #ifndef OPENSSL_NO_ECDSA ENGINE_register_ECDSA(e); +#endif +#ifndef OPENSSL_NO_EC + ENGINE_register_EC(e); #endif ENGINE_register_RAND(e); ENGINE_register_pkey_meths(e); diff --git a/crypto/engine/eng_init.c b/crypto/engine/eng_init.c index 75d6698c..793adba8 100644 --- a/crypto/engine/eng_init.c +++ b/crypto/engine/eng_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eng_init.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: eng_init.c,v 1.9 2018/04/14 07:09:21 tb Exp $ */ /* ==================================================================== * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. * @@ -134,10 +134,8 @@ ENGINE_finish(ENGINE *e) { int to_return = 1; - if (e == NULL) { - ENGINEerror(ERR_R_PASSED_NULL_PARAMETER); - return 0; - } + if (e == NULL) + return 1; CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); to_return = engine_unlocked_finish(e, 1); CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); diff --git a/crypto/engine/eng_int.h b/crypto/engine/eng_int.h index dbb63994..298c0e32 100644 --- a/crypto/engine/eng_int.h +++ b/crypto/engine/eng_int.h @@ -1,4 +1,4 @@ -/* $OpenBSD: eng_int.h,v 1.9 2016/12/21 15:49:29 jsing Exp $ */ +/* $OpenBSD: eng_int.h,v 1.10 2019/01/19 01:07:00 tb Exp $ */ /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL * project 2000. */ @@ -159,6 +159,7 @@ struct engine_st { const DH_METHOD *dh_meth; const ECDH_METHOD *ecdh_meth; const ECDSA_METHOD *ecdsa_meth; + const EC_KEY_METHOD *ec_meth; const RAND_METHOD *rand_meth; const STORE_METHOD *store_meth; /* Cipher handling is via this callback */ diff --git a/crypto/engine/eng_lib.c b/crypto/engine/eng_lib.c index d2da29fe..1aedcb18 100644 --- a/crypto/engine/eng_lib.c +++ b/crypto/engine/eng_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eng_lib.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: eng_lib.c,v 1.14 2018/04/14 07:18:37 tb Exp $ */ /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL * project 2000. */ @@ -70,6 +70,9 @@ ENGINE_new(void) { ENGINE *ret; + if (!OPENSSL_init_crypto(0, NULL)) + return NULL; + ret = malloc(sizeof(ENGINE)); if (ret == NULL) { ENGINEerror(ERR_R_MALLOC_FAILURE); @@ -112,10 +115,8 @@ engine_free_util(ENGINE *e, int locked) { int i; - if (e == NULL) { - ENGINEerror(ERR_R_PASSED_NULL_PARAMETER); - return 0; - } + if (e == NULL) + return 1; if (locked) i = CRYPTO_add(&e->struct_ref, -1, CRYPTO_LOCK_ENGINE); else diff --git a/crypto/engine/eng_list.c b/crypto/engine/eng_list.c index 8bb1bc58..b29b4102 100644 --- a/crypto/engine/eng_list.c +++ b/crypto/engine/eng_list.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eng_list.c,v 1.22 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: eng_list.c,v 1.24 2019/01/19 01:07:00 tb Exp $ */ /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL * project 2000. */ @@ -315,6 +315,9 @@ engine_cpy(ENGINE *dest, const ENGINE *src) #endif #ifndef OPENSSL_NO_ECDSA dest->ecdsa_meth = src->ecdsa_meth; +#endif +#ifndef OPENSSL_NO_EC + dest->ec_meth = src->ec_meth; #endif dest->rand_meth = src->rand_meth; dest->store_meth = src->store_meth; @@ -373,10 +376,12 @@ ENGINE_by_id(const char *id) int ENGINE_up_ref(ENGINE *e) { + int refs; + if (e == NULL) { ENGINEerror(ERR_R_PASSED_NULL_PARAMETER); return 0; } - CRYPTO_add(&e->struct_ref, 1, CRYPTO_LOCK_ENGINE); - return 1; + refs = CRYPTO_add(&e->struct_ref, 1, CRYPTO_LOCK_ENGINE); + return refs > 1 ? 1 : 0; } diff --git a/crypto/engine/eng_openssl.c b/crypto/engine/eng_openssl.c index 6154aebd..f8f6c8f5 100644 --- a/crypto/engine/eng_openssl.c +++ b/crypto/engine/eng_openssl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eng_openssl.c,v 1.12 2015/12/07 03:30:09 bcook Exp $ */ +/* $OpenBSD: eng_openssl.c,v 1.13 2018/04/14 07:18:37 tb Exp $ */ /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL * project 2000. */ @@ -177,7 +177,7 @@ engine_openssl(void) { ENGINE *ret = ENGINE_new(); - if (!ret) + if (ret == NULL) return NULL; if (!bind_helper(ret)) { ENGINE_free(ret); @@ -191,7 +191,7 @@ ENGINE_load_openssl(void) { ENGINE *toadd = engine_openssl(); - if (!toadd) + if (toadd == NULL) return; (void) ENGINE_add(toadd); /* If the "add" worked, it gets a structural reference. So either way, diff --git a/ssl/d1_meth.c b/crypto/engine/tb_eckey.c similarity index 60% rename from ssl/d1_meth.c rename to crypto/engine/tb_eckey.c index fcd8906c..464156ae 100644 --- a/ssl/d1_meth.c +++ b/crypto/engine/tb_eckey.c @@ -1,10 +1,6 @@ -/* $OpenBSD: d1_meth.c,v 1.13 2017/01/23 13:36:13 jsing Exp $ */ -/* - * DTLS implementation written by Nagendra Modadugu - * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. - */ +/* $OpenBSD: tb_eckey.c,v 1.2 2019/01/19 01:18:56 tb Exp $ */ /* ==================================================================== - * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. + * Copyright (c) 2000 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 @@ -26,7 +22,7 @@ * 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. + * licensing@OpenSSL.org. * * 5. Products derived from this software may not be called "OpenSSL" * nor may "OpenSSL" appear in their names without prior written @@ -57,58 +53,72 @@ * */ -#include +#include "eng_int.h" + +static ENGINE_TABLE *ec_table = NULL; +static const int dummy_nid = 1; -#include +void +ENGINE_unregister_EC(ENGINE *e) +{ + engine_table_unregister(&ec_table, e); +} -#include "ssl_locl.h" +static void +engine_unregister_all_EC(void) +{ + engine_table_cleanup(&ec_table); +} -static const SSL_METHOD *dtls1_get_method(int ver); +int +ENGINE_register_EC(ENGINE *e) +{ + if (e->ec_meth) + return engine_table_register(&ec_table, + engine_unregister_all_EC, e, &dummy_nid, 1, 0); + return 1; +} -static const SSL_METHOD_INTERNAL DTLSv1_method_internal_data = { - .version = DTLS1_VERSION, - .min_version = DTLS1_VERSION, - .max_version = DTLS1_VERSION, - .ssl_new = dtls1_new, - .ssl_clear = dtls1_clear, - .ssl_free = dtls1_free, - .ssl_accept = dtls1_accept, - .ssl_connect = dtls1_connect, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = dtls1_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = dtls1_get_method, - .get_timeout = dtls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = dtls1_get_message, - .ssl_read_bytes = dtls1_read_bytes, - .ssl_write_bytes = dtls1_write_app_data_bytes, - .ssl3_enc = &DTLSv1_enc_data, -}; +void +ENGINE_register_all_EC(void) +{ + ENGINE *e; -static const SSL_METHOD DTLSv1_method_data = { - .ssl_dispatch_alert = dtls1_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = dtls1_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &DTLSv1_method_internal_data, -}; + for (e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e)) + ENGINE_register_EC(e); +} + +int +ENGINE_set_default_EC(ENGINE *e) +{ + if (e->ec_meth != NULL) + return engine_table_register(&ec_table, + engine_unregister_all_EC, e, &dummy_nid, 1, 1); + return 1; +} + +/* + * Exposed API function to get a functional reference from the implementation + * table (ie. try to get a functional reference from the tabled structural + * references). + */ +ENGINE * +ENGINE_get_default_EC(void) +{ + return engine_table_select(&ec_table, dummy_nid); +} -const SSL_METHOD * -DTLSv1_method(void) +/* Obtains an EC_KEY implementation from an ENGINE functional reference */ +const EC_KEY_METHOD * +ENGINE_get_EC(const ENGINE *e) { - return &DTLSv1_method_data; + return e->ec_meth; } -static const SSL_METHOD * -dtls1_get_method(int ver) +/* Sets an EC_KEY implementation in an ENGINE structure */ +int +ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ec_meth) { - if (ver == DTLS1_VERSION) - return (DTLSv1_method()); - return (NULL); + e->ec_meth = ec_meth; + return 1; } diff --git a/crypto/err/err.c b/crypto/err/err.c index ffe25bf4..caabfe01 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.45 2017/02/20 23:21:19 beck Exp $ */ +/* $OpenBSD: err.c,v 1.47 2018/04/03 21:59:37 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -109,6 +109,7 @@ * */ +#include #include #include #include @@ -282,6 +283,8 @@ static LHASH_OF(ERR_STATE) *int_thread_hash = NULL; static int int_thread_hash_references = 0; static int int_err_library_number = ERR_LIB_USER; +static pthread_t err_init_thread; + /* Internal function that checks whether "err_fns" is set and if not, sets it to * the defaults. */ static void @@ -650,8 +653,9 @@ ERR_STATE_free(ERR_STATE *s) } void -ERR_load_ERR_strings(void) +ERR_load_ERR_strings_internal(void) { + err_init_thread = pthread_self(); err_fns_check(); #ifndef OPENSSL_NO_ERR err_load_strings(0, ERR_str_libraries); @@ -662,6 +666,21 @@ ERR_load_ERR_strings(void) #endif } + +void +ERR_load_ERR_strings(void) +{ + static pthread_once_t once = PTHREAD_ONCE_INIT; + + if (pthread_equal(pthread_self(), err_init_thread)) + return; /* don't recurse */ + + /* Prayer and clean living lets you ignore errors, OpenSSL style */ + (void) OPENSSL_init_crypto(0, NULL); + + (void) pthread_once(&once, ERR_load_ERR_strings_internal); +} + static void err_load_strings(int lib, ERR_STRING_DATA *str) { @@ -683,6 +702,9 @@ ERR_load_strings(int lib, ERR_STRING_DATA *str) void ERR_unload_strings(int lib, ERR_STRING_DATA *str) { + /* Prayer and clean living lets you ignore errors, OpenSSL style */ + (void) OPENSSL_init_crypto(0, NULL); + while (str->error) { if (lib) str->error |= ERR_PACK(lib, 0, 0); @@ -694,6 +716,9 @@ ERR_unload_strings(int lib, ERR_STRING_DATA *str) void ERR_free_strings(void) { + /* Prayer and clean living lets you ignore errors, OpenSSL style */ + (void) OPENSSL_init_crypto(0, NULL); + err_fns_check(); ERRFN(err_del)(); } @@ -953,6 +978,9 @@ ERR_lib_error_string(unsigned long e) ERR_STRING_DATA d, *p; unsigned long l; + if (!OPENSSL_init_crypto(0, NULL)) + return NULL; + err_fns_check(); l = ERR_GET_LIB(e); d.error = ERR_PACK(l, 0, 0); @@ -1079,7 +1107,8 @@ ERR_set_error_data(char *data, int flags) } void -ERR_asprintf_error_data(char * format, ...) { +ERR_asprintf_error_data(char * format, ...) +{ char *errbuf = NULL; va_list ap; int r; diff --git a/crypto/err/err_all.c b/crypto/err/err_all.c index 40009cbe..24de3c9c 100644 --- a/crypto/err/err_all.c +++ b/crypto/err/err_all.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err_all.c,v 1.23 2016/10/19 16:49:11 jsing Exp $ */ +/* $OpenBSD: err_all.c,v 1.24 2018/03/17 16:20:01 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include @@ -103,11 +104,13 @@ #include #endif -void -ERR_load_crypto_strings(void) +void ERR_load_ERR_strings_internal(void); + +static void +ERR_load_crypto_strings_internal(void) { #ifndef OPENSSL_NO_ERR - ERR_load_ERR_strings(); /* include error strings for SYSerr */ + ERR_load_ERR_strings_internal(); /* include error strings for SYSerr */ ERR_load_BN_strings(); #ifndef OPENSSL_NO_RSA ERR_load_RSA_strings(); @@ -153,3 +156,10 @@ ERR_load_crypto_strings(void) #endif #endif } + +void +ERR_load_crypto_strings(void) +{ + static pthread_once_t loaded = PTHREAD_ONCE_INIT; + (void) pthread_once(&loaded, ERR_load_crypto_strings_internal); +} diff --git a/crypto/evp/bio_b64.c b/crypto/evp/bio_b64.c index b54e8793..82aaa8bf 100644 --- a/crypto/evp/bio_b64.c +++ b/crypto/evp/bio_b64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_b64.c,v 1.20 2015/02/07 13:19:15 doug Exp $ */ +/* $OpenBSD: bio_b64.c,v 1.22 2018/08/24 19:47:25 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -91,7 +91,7 @@ typedef struct b64_struct { char tmp[B64_BLOCK_SIZE]; } BIO_B64_CTX; -static BIO_METHOD methods_b64 = { +static const BIO_METHOD methods_b64 = { .type = BIO_TYPE_BASE64, .name = "base64 encoding", .bwrite = b64_write, @@ -103,7 +103,7 @@ static BIO_METHOD methods_b64 = { .callback_ctrl = b64_callback_ctrl }; -BIO_METHOD * +const BIO_METHOD * BIO_f_base64(void) { return (&methods_b64); @@ -430,9 +430,10 @@ b64_write(BIO *b, const char *in, int inl) ret += n; } } else { - EVP_EncodeUpdate(&(ctx->base64), + if (!EVP_EncodeUpdate(&(ctx->base64), (unsigned char *)ctx->buf, &ctx->buf_len, - (unsigned char *)in, n); + (unsigned char *)in, n)) + return ((ret == 0) ? -1 : ret); OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf)); OPENSSL_assert(ctx->buf_len >= ctx->buf_off); ret += n; diff --git a/crypto/evp/bio_enc.c b/crypto/evp/bio_enc.c index 7c7cf9a8..7b559989 100644 --- a/crypto/evp/bio_enc.c +++ b/crypto/evp/bio_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_enc.c,v 1.20 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: bio_enc.c,v 1.22 2018/08/24 19:30:24 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -87,7 +87,7 @@ typedef struct enc_struct { char buf[ENC_BLOCK_SIZE + BUF_OFFSET + 2]; } BIO_ENC_CTX; -static BIO_METHOD methods_enc = { +static const BIO_METHOD methods_enc = { .type = BIO_TYPE_CIPHER, .name = "cipher", .bwrite = enc_write, @@ -98,7 +98,7 @@ static BIO_METHOD methods_enc = { .callback_ctrl = enc_callback_ctrl }; -BIO_METHOD * +const BIO_METHOD * BIO_f_cipher(void) { return (&methods_enc); @@ -404,23 +404,32 @@ EVP_CIPHER_ctx *c; } */ -void +int BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, const unsigned char *i, int e) { BIO_ENC_CTX *ctx; + long (*cb)(BIO *, int, const char *, int, long, long); if (b == NULL) - return; + return 0; - if ((b->callback != NULL) && - (b->callback(b, BIO_CB_CTRL, (const char *)c, BIO_CTRL_SET, e, 0L) <= 0)) - return; + if ((ctx = BIO_get_data(b)) == NULL) + return 0; - b->init = 1; - ctx = (BIO_ENC_CTX *)b->ptr; - EVP_CipherInit_ex(&(ctx->cipher), c, NULL, k, i, e); + if ((cb = BIO_get_callback(b)) != NULL) { + if (cb(b, BIO_CB_CTRL, (const char *)c, BIO_CTRL_SET, e, 0L) + <= 0) + return 0; + } - if (b->callback != NULL) - b->callback(b, BIO_CB_CTRL, (const char *)c, BIO_CTRL_SET, e, 1L); + BIO_set_init(b, 1); + + if (!EVP_CipherInit_ex(&(ctx->cipher), c, NULL, k, i, e)) + return 0; + + if (cb != NULL) + return cb(b, BIO_CB_CTRL, (const char *)c, BIO_CTRL_SET, e, 1L); + + return 1; } diff --git a/crypto/evp/bio_md.c b/crypto/evp/bio_md.c index b1973746..44f72185 100644 --- a/crypto/evp/bio_md.c +++ b/crypto/evp/bio_md.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_md.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */ +/* $OpenBSD: bio_md.c,v 1.15 2018/05/02 15:51:41 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -74,7 +74,7 @@ static int md_new(BIO *h); static int md_free(BIO *data); static long md_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); -static BIO_METHOD methods_md = { +static const BIO_METHOD methods_md = { .type = BIO_TYPE_MD, .name = "message digest", .bwrite = md_write, @@ -86,7 +86,7 @@ static BIO_METHOD methods_md = { .callback_ctrl = md_callback_ctrl }; -BIO_METHOD * +const BIO_METHOD * BIO_f_md(void) { return (&methods_md); diff --git a/crypto/evp/c_all.c b/crypto/evp/c_all.c index 8ab93fec..9e9d39d5 100644 --- a/crypto/evp/c_all.c +++ b/crypto/evp/c_all.c @@ -1,4 +1,4 @@ -/* $OpenBSD: c_all.c,v 1.21 2017/03/01 13:53:58 jsing Exp $ */ +/* $OpenBSD: c_all.c,v 1.26 2019/03/17 18:07:41 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,6 +57,7 @@ */ #include +#include #include @@ -66,8 +67,8 @@ #include "cryptlib.h" -void -OpenSSL_add_all_ciphers(void) +static void +OpenSSL_add_all_ciphers_internal(void) { #ifndef OPENSSL_NO_DES EVP_add_cipher(EVP_des_cfb()); @@ -151,33 +152,39 @@ OpenSSL_add_all_ciphers(void) #ifndef OPENSSL_NO_AES EVP_add_cipher(EVP_aes_128_ecb()); EVP_add_cipher(EVP_aes_128_cbc()); + EVP_add_cipher(EVP_aes_128_ccm()); EVP_add_cipher(EVP_aes_128_cfb()); EVP_add_cipher(EVP_aes_128_cfb1()); EVP_add_cipher(EVP_aes_128_cfb8()); EVP_add_cipher(EVP_aes_128_ofb()); EVP_add_cipher(EVP_aes_128_ctr()); EVP_add_cipher(EVP_aes_128_gcm()); + EVP_add_cipher(EVP_aes_128_wrap()); EVP_add_cipher(EVP_aes_128_xts()); EVP_add_cipher_alias(SN_aes_128_cbc, "AES128"); EVP_add_cipher_alias(SN_aes_128_cbc, "aes128"); EVP_add_cipher(EVP_aes_192_ecb()); EVP_add_cipher(EVP_aes_192_cbc()); + EVP_add_cipher(EVP_aes_192_ccm()); EVP_add_cipher(EVP_aes_192_cfb()); EVP_add_cipher(EVP_aes_192_cfb1()); EVP_add_cipher(EVP_aes_192_cfb8()); EVP_add_cipher(EVP_aes_192_ofb()); EVP_add_cipher(EVP_aes_192_ctr()); EVP_add_cipher(EVP_aes_192_gcm()); + EVP_add_cipher(EVP_aes_192_wrap()); EVP_add_cipher_alias(SN_aes_192_cbc, "AES192"); EVP_add_cipher_alias(SN_aes_192_cbc, "aes192"); EVP_add_cipher(EVP_aes_256_ecb()); EVP_add_cipher(EVP_aes_256_cbc()); + EVP_add_cipher(EVP_aes_256_ccm()); EVP_add_cipher(EVP_aes_256_cfb()); EVP_add_cipher(EVP_aes_256_cfb1()); EVP_add_cipher(EVP_aes_256_cfb8()); EVP_add_cipher(EVP_aes_256_ofb()); EVP_add_cipher(EVP_aes_256_ctr()); EVP_add_cipher(EVP_aes_256_gcm()); + EVP_add_cipher(EVP_aes_256_wrap()); EVP_add_cipher(EVP_aes_256_xts()); EVP_add_cipher_alias(SN_aes_256_cbc, "AES256"); EVP_add_cipher_alias(SN_aes_256_cbc, "aes256"); @@ -223,10 +230,27 @@ OpenSSL_add_all_ciphers(void) EVP_add_cipher(EVP_gost2814789_cfb64()); EVP_add_cipher(EVP_gost2814789_cnt()); #endif + +#ifndef OPENSSL_NO_SM4 + EVP_add_cipher(EVP_sm4_ecb()); + EVP_add_cipher(EVP_sm4_cbc()); + EVP_add_cipher(EVP_sm4_cfb()); + EVP_add_cipher(EVP_sm4_ofb()); + EVP_add_cipher(EVP_sm4_ctr()); + EVP_add_cipher_alias(SN_sm4_cbc, "SM4"); + EVP_add_cipher_alias(SN_sm4_cbc, "sm4"); +#endif } void -OpenSSL_add_all_digests(void) +OpenSSL_add_all_ciphers(void) +{ + static pthread_once_t add_all_ciphers_once = PTHREAD_ONCE_INIT; + (void) pthread_once(&add_all_ciphers_once, OpenSSL_add_all_ciphers_internal); +} + +static void +OpenSSL_add_all_digests_internal(void) { #ifndef OPENSSL_NO_MD4 EVP_add_digest(EVP_md4()); @@ -278,11 +302,21 @@ OpenSSL_add_all_digests(void) EVP_add_digest(EVP_sha384()); EVP_add_digest(EVP_sha512()); #endif +#ifndef OPENSSL_NO_SM3 + EVP_add_digest(EVP_sm3()); +#endif #ifndef OPENSSL_NO_WHIRLPOOL EVP_add_digest(EVP_whirlpool()); #endif } +void +OpenSSL_add_all_digests(void) +{ + static pthread_once_t add_all_digests_once = PTHREAD_ONCE_INIT; + (void) pthread_once(&add_all_digests_once, OpenSSL_add_all_digests_internal); +} + void OPENSSL_add_all_algorithms_noconf(void) { diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c index 7471c1e8..6a7d86d7 100644 --- a/crypto/evp/digest.c +++ b/crypto/evp/digest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: digest.c,v 1.28 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: digest.c,v 1.30 2018/04/14 07:09:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -122,18 +122,6 @@ #include #endif -void -EVP_MD_CTX_init(EVP_MD_CTX *ctx) -{ - memset(ctx, 0, sizeof *ctx); -} - -EVP_MD_CTX * -EVP_MD_CTX_create(void) -{ - return calloc(1, sizeof(EVP_MD_CTX)); -} - int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) { @@ -158,9 +146,8 @@ EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) /* Ensure an ENGINE left lying around from last time is cleared * (the previous check attempted to avoid this if the same * ENGINE and EVP_MD could be used). */ - if (ctx->engine) - ENGINE_finish(ctx->engine); - if (impl) { + ENGINE_finish(ctx->engine); + if (impl != NULL) { if (!ENGINE_init(impl)) { EVPerror(EVP_R_INITIALIZATION_ERROR); return 0; @@ -168,10 +155,10 @@ EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) } else /* Ask if an ENGINE is reserved for this job */ impl = ENGINE_get_digest_engine(type->type); - if (impl) { + if (impl != NULL) { /* There's an ENGINE for this job ... (apparently) */ const EVP_MD *d = ENGINE_get_digest(impl, type->type); - if (!d) { + if (d == NULL) { /* Same comment from evp_enc.c */ EVPerror(EVP_R_INITIALIZATION_ERROR); ENGINE_finish(impl); @@ -339,20 +326,53 @@ EVP_Digest(const void *data, size_t count, return ret; } +EVP_MD_CTX * +EVP_MD_CTX_new(void) +{ + return calloc(1, sizeof(EVP_MD_CTX)); +} + +void +EVP_MD_CTX_free(EVP_MD_CTX *ctx) +{ + if (ctx == NULL) + return; + + EVP_MD_CTX_cleanup(ctx); + + free(ctx); +} + +void +EVP_MD_CTX_init(EVP_MD_CTX *ctx) +{ + memset(ctx, 0, sizeof(*ctx)); +} + +int +EVP_MD_CTX_reset(EVP_MD_CTX *ctx) +{ + return EVP_MD_CTX_cleanup(ctx); +} + +EVP_MD_CTX * +EVP_MD_CTX_create(void) +{ + return EVP_MD_CTX_new(); +} + void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) { - if (ctx) { - EVP_MD_CTX_cleanup(ctx); - free(ctx); - } + EVP_MD_CTX_free(ctx); } /* This call frees resources associated with the context */ int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) { - /* Don't assume ctx->md_data was cleaned in EVP_Digest_Final, + /* + * Don't assume ctx->md_data was cleaned in EVP_Digest_Final, * because sometimes only copies of the context are ever finalised. */ if (ctx->digest && ctx->digest->cleanup && @@ -363,12 +383,9 @@ EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) freezero(ctx->md_data, ctx->digest->ctx_size); EVP_PKEY_CTX_free(ctx->pctx); #ifndef OPENSSL_NO_ENGINE - if (ctx->engine) - /* The EVP_MD we used belongs to an ENGINE, release the - * functional reference we held for this reason. */ - ENGINE_finish(ctx->engine); + ENGINE_finish(ctx->engine); #endif - memset(ctx, 0, sizeof *ctx); + memset(ctx, 0, sizeof(*ctx)); return 1; } diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index 7c713db0..6b455dc5 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_aes.c,v 1.34 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: e_aes.c,v 1.35 2019/03/17 18:07:41 tb Exp $ */ /* ==================================================================== * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. * @@ -49,6 +49,7 @@ * */ +#include #include #include @@ -1549,4 +1550,147 @@ EVP_aead_aes_256_gcm(void) return &aead_aes_256_gcm; } +typedef struct { + union { + double align; + AES_KEY ks; + } ks; + unsigned char *iv; +} EVP_AES_WRAP_CTX; + +static int +aes_wrap_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, + const unsigned char *iv, int enc) +{ + EVP_AES_WRAP_CTX *wctx = (EVP_AES_WRAP_CTX *)ctx->cipher_data; + + if (iv == NULL && key == NULL) + return 1; + + if (key != NULL) { + if (ctx->encrypt) + AES_set_encrypt_key(key, 8 * ctx->key_len, + &wctx->ks.ks); + else + AES_set_decrypt_key(key, 8 * ctx->key_len, + &wctx->ks.ks); + + if (iv == NULL) + wctx->iv = NULL; + } + + if (iv != NULL) { + memcpy(ctx->iv, iv, EVP_CIPHER_CTX_iv_length(ctx)); + wctx->iv = ctx->iv; + } + + return 1; +} + +static int +aes_wrap_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + const unsigned char *in, size_t inlen) +{ + EVP_AES_WRAP_CTX *wctx = ctx->cipher_data; + int ret; + + if (in == NULL) + return 0; + + if (inlen % 8 != 0) + return -1; + if (ctx->encrypt && inlen < 8) + return -1; + if (!ctx->encrypt && inlen < 16) + return -1; + if (inlen > INT_MAX) + return -1; + + if (out == NULL) { + if (ctx->encrypt) + return inlen + 8; + else + return inlen - 8; + } + + if (ctx->encrypt) + ret = AES_wrap_key(&wctx->ks.ks, wctx->iv, out, in, + (unsigned int)inlen); + else + ret = AES_unwrap_key(&wctx->ks.ks, wctx->iv, out, in, + (unsigned int)inlen); + + return ret != 0 ? ret : -1; +} + +#define WRAP_FLAGS \ + ( EVP_CIPH_WRAP_MODE | EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER | \ + EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_FLAG_DEFAULT_ASN1 ) + +static const EVP_CIPHER aes_128_wrap = { + .nid = NID_id_aes128_wrap, + .block_size = 8, + .key_len = 16, + .iv_len = 8, + .flags = WRAP_FLAGS, + .init = aes_wrap_init_key, + .do_cipher = aes_wrap_cipher, + .cleanup = NULL, + .ctx_size = sizeof(EVP_AES_WRAP_CTX), + .set_asn1_parameters = NULL, + .get_asn1_parameters = NULL, + .ctrl = NULL, + .app_data = NULL, +}; + +const EVP_CIPHER * +EVP_aes_128_wrap(void) +{ + return &aes_128_wrap; +} + +static const EVP_CIPHER aes_192_wrap = { + .nid = NID_id_aes192_wrap, + .block_size = 8, + .key_len = 24, + .iv_len = 8, + .flags = WRAP_FLAGS, + .init = aes_wrap_init_key, + .do_cipher = aes_wrap_cipher, + .cleanup = NULL, + .ctx_size = sizeof(EVP_AES_WRAP_CTX), + .set_asn1_parameters = NULL, + .get_asn1_parameters = NULL, + .ctrl = NULL, + .app_data = NULL, +}; + +const EVP_CIPHER * +EVP_aes_192_wrap(void) +{ + return &aes_192_wrap; +} + +static const EVP_CIPHER aes_256_wrap = { + .nid = NID_id_aes256_wrap, + .block_size = 8, + .key_len = 32, + .iv_len = 8, + .flags = WRAP_FLAGS, + .init = aes_wrap_init_key, + .do_cipher = aes_wrap_cipher, + .cleanup = NULL, + .ctx_size = sizeof(EVP_AES_WRAP_CTX), + .set_asn1_parameters = NULL, + .get_asn1_parameters = NULL, + .ctrl = NULL, + .app_data = NULL, +}; + +const EVP_CIPHER * +EVP_aes_256_wrap(void) +{ + return &aes_256_wrap; +} + #endif diff --git a/crypto/evp/e_aes_cbc_hmac_sha1.c b/crypto/evp/e_aes_cbc_hmac_sha1.c index f25b927a..9be17e36 100644 --- a/crypto/evp/e_aes_cbc_hmac_sha1.c +++ b/crypto/evp/e_aes_cbc_hmac_sha1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_aes_cbc_hmac_sha1.c,v 1.14 2016/11/05 10:47:57 miod Exp $ */ +/* $OpenBSD: e_aes_cbc_hmac_sha1.c,v 1.15 2019/04/03 15:33:37 tb Exp $ */ /* ==================================================================== * Copyright (c) 2011-2013 The OpenSSL Project. All rights reserved. * @@ -249,7 +249,11 @@ aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, /* decrypt HMAC|padding at once */ aesni_cbc_encrypt(in, out, len, &key->ks, ctx->iv, 0); - if (plen) { /* "TLS" mode of operation */ + if (plen == 0 || plen == NO_PAYLOAD_LENGTH) { + SHA1_Update(&key->md, out, len); + } else if (plen < 4) { + return 0; + } else { /* "TLS" mode of operation */ size_t inp_len, mask, j, i; unsigned int res, maxpad, pad, bitlen; int ret = 1; @@ -459,8 +463,6 @@ aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, ret &= (int)~res; #endif return ret; - } else { - SHA1_Update(&key->md, out, len); } } @@ -505,7 +507,13 @@ aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) case EVP_CTRL_AEAD_TLS1_AAD: { unsigned char *p = ptr; - unsigned int len = p[arg - 2] << 8 | p[arg - 1]; + unsigned int len; + + /* RFC 5246, 6.2.3.3: additional data has length 13 */ + if (arg != 13) + return -1; + + len = p[arg - 2] << 8 | p[arg - 1]; if (ctx->encrypt) { key->payload_length = len; @@ -521,8 +529,6 @@ aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) return (int)(((len + SHA_DIGEST_LENGTH + AES_BLOCK_SIZE) & -AES_BLOCK_SIZE) - len); } else { - if (arg > 13) - arg = 13; memcpy(key->aux.tls_aad, ptr, arg); key->payload_length = arg; diff --git a/crypto/evp/e_chacha20poly1305.c b/crypto/evp/e_chacha20poly1305.c index 089ef12f..4fd92eb0 100644 --- a/crypto/evp/e_chacha20poly1305.c +++ b/crypto/evp/e_chacha20poly1305.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_chacha20poly1305.c,v 1.18 2017/08/28 17:48:02 jsing Exp $ */ +/* $OpenBSD: e_chacha20poly1305.c,v 1.21 2019/03/27 15:34:01 jsing Exp $ */ /* * Copyright (c) 2015 Reyk Floter @@ -36,6 +36,7 @@ #define CHACHA20_CONSTANT_LEN 4 #define CHACHA20_IV_LEN 8 #define CHACHA20_NONCE_LEN (CHACHA20_CONSTANT_LEN + CHACHA20_IV_LEN) +#define XCHACHA20_NONCE_LEN 24 struct aead_chacha20_poly1305_ctx { unsigned char key[32]; @@ -148,8 +149,8 @@ aead_chacha20_poly1305_seal(const EVP_AEAD_CTX *ctx, unsigned char *out, return 0; } - ctr = (uint64_t)(nonce[0] | nonce[1] << 8 | - nonce[2] << 16 | nonce[3] << 24) << 32; + ctr = (uint64_t)((uint32_t)(nonce[0]) | (uint32_t)(nonce[1]) << 8 | + (uint32_t)(nonce[2]) << 16 | (uint32_t)(nonce[3]) << 24) << 32; iv = nonce + CHACHA20_CONSTANT_LEN; memset(poly1305_key, 0, sizeof(poly1305_key)); @@ -220,8 +221,8 @@ aead_chacha20_poly1305_open(const EVP_AEAD_CTX *ctx, unsigned char *out, return 0; } - ctr = (uint64_t)(nonce[0] | nonce[1] << 8 | - nonce[2] << 16 | nonce[3] << 24) << 32; + ctr = (uint64_t)((uint32_t)(nonce[0]) | (uint32_t)(nonce[1]) << 8 | + (uint32_t)(nonce[2]) << 16 | (uint32_t)(nonce[3]) << 24) << 32; iv = nonce + CHACHA20_CONSTANT_LEN; memset(poly1305_key, 0, sizeof(poly1305_key)); @@ -246,6 +247,108 @@ aead_chacha20_poly1305_open(const EVP_AEAD_CTX *ctx, unsigned char *out, return 1; } +static int +aead_xchacha20_poly1305_seal(const EVP_AEAD_CTX *ctx, unsigned char *out, + size_t *out_len, size_t max_out_len, const unsigned char *nonce, + size_t nonce_len, const unsigned char *in, size_t in_len, + const unsigned char *ad, size_t ad_len) +{ + const struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state; + unsigned char poly1305_key[32]; + unsigned char subkey[32]; + poly1305_state poly1305; + + if (max_out_len < in_len + c20_ctx->tag_len) { + EVPerror(EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (nonce_len != ctx->aead->nonce_len) { + EVPerror(EVP_R_IV_TOO_LARGE); + return 0; + } + + CRYPTO_hchacha_20(subkey, c20_ctx->key, nonce); + + CRYPTO_chacha_20(out, in, in_len, subkey, nonce + 16, 1); + + memset(poly1305_key, 0, sizeof(poly1305_key)); + CRYPTO_chacha_20(poly1305_key, poly1305_key, sizeof(poly1305_key), + subkey, nonce + 16, 0); + + CRYPTO_poly1305_init(&poly1305, poly1305_key); + poly1305_update_with_pad16(&poly1305, ad, ad_len); + poly1305_update_with_pad16(&poly1305, out, in_len); + poly1305_update_with_length(&poly1305, NULL, ad_len); + poly1305_update_with_length(&poly1305, NULL, in_len); + + if (c20_ctx->tag_len != POLY1305_TAG_LEN) { + unsigned char tag[POLY1305_TAG_LEN]; + CRYPTO_poly1305_finish(&poly1305, tag); + memcpy(out + in_len, tag, c20_ctx->tag_len); + *out_len = in_len + c20_ctx->tag_len; + return 1; + } + + CRYPTO_poly1305_finish(&poly1305, out + in_len); + *out_len = in_len + POLY1305_TAG_LEN; + return 1; +} + +static int +aead_xchacha20_poly1305_open(const EVP_AEAD_CTX *ctx, unsigned char *out, + size_t *out_len, size_t max_out_len, const unsigned char *nonce, + size_t nonce_len, const unsigned char *in, size_t in_len, + const unsigned char *ad, size_t ad_len) +{ + const struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state; + unsigned char mac[POLY1305_TAG_LEN]; + unsigned char poly1305_key[32]; + unsigned char subkey[32]; + poly1305_state poly1305; + size_t plaintext_len; + + if (in_len < c20_ctx->tag_len) { + EVPerror(EVP_R_BAD_DECRYPT); + return 0; + } + + if (nonce_len != ctx->aead->nonce_len) { + EVPerror(EVP_R_IV_TOO_LARGE); + return 0; + } + + plaintext_len = in_len - c20_ctx->tag_len; + + if (max_out_len < plaintext_len) { + EVPerror(EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + CRYPTO_hchacha_20(subkey, c20_ctx->key, nonce); + + memset(poly1305_key, 0, sizeof(poly1305_key)); + CRYPTO_chacha_20(poly1305_key, poly1305_key, sizeof(poly1305_key), + subkey, nonce + 16, 0); + + CRYPTO_poly1305_init(&poly1305, poly1305_key); + poly1305_update_with_pad16(&poly1305, ad, ad_len); + poly1305_update_with_pad16(&poly1305, in, plaintext_len); + poly1305_update_with_length(&poly1305, NULL, ad_len); + poly1305_update_with_length(&poly1305, NULL, plaintext_len); + + CRYPTO_poly1305_finish(&poly1305, mac); + if (timingsafe_memcmp(mac, in + plaintext_len, c20_ctx->tag_len) != 0) { + EVPerror(EVP_R_BAD_DECRYPT); + return 0; + } + + CRYPTO_chacha_20(out, in, plaintext_len, subkey, nonce + 16, 1); + + *out_len = plaintext_len; + return 1; +} + /* RFC 7539 */ static const EVP_AEAD aead_chacha20_poly1305 = { .key_len = 32, @@ -265,4 +368,22 @@ EVP_aead_chacha20_poly1305() return &aead_chacha20_poly1305; } +static const EVP_AEAD aead_xchacha20_poly1305 = { + .key_len = 32, + .nonce_len = XCHACHA20_NONCE_LEN, + .overhead = POLY1305_TAG_LEN, + .max_tag_len = POLY1305_TAG_LEN, + + .init = aead_chacha20_poly1305_init, + .cleanup = aead_chacha20_poly1305_cleanup, + .seal = aead_xchacha20_poly1305_seal, + .open = aead_xchacha20_poly1305_open, +}; + +const EVP_AEAD * +EVP_aead_xchacha20_poly1305() +{ + return &aead_xchacha20_poly1305; +} + #endif /* !OPENSSL_NO_CHACHA && !OPENSSL_NO_POLY1305 */ diff --git a/crypto/evp/e_sm4.c b/crypto/evp/e_sm4.c new file mode 100644 index 00000000..554915b2 --- /dev/null +++ b/crypto/evp/e_sm4.c @@ -0,0 +1,113 @@ +/* $OpenBSD: e_sm4.c,v 1.1 2019/03/17 17:42:37 tb Exp $ */ +/* + * Copyright (c) 2017, 2019 Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#ifndef OPENSSL_NO_SM4 +#include +#include +#include + +#include "evp_locl.h" + +typedef struct { + SM4_KEY ks; +} EVP_SM4_KEY; + +static int +sm4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, + const unsigned char *iv, int enc) +{ + SM4_set_key(key, ctx->cipher_data); + return 1; +} + +static void +sm4_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len, + const SM4_KEY *key, unsigned char *ivec, const int enc) +{ + if (enc) + CRYPTO_cbc128_encrypt(in, out, len, key, ivec, + (block128_f)SM4_encrypt); + else + CRYPTO_cbc128_decrypt(in, out, len, key, ivec, + (block128_f)SM4_decrypt); +} + +static void +sm4_cfb128_encrypt(const unsigned char *in, unsigned char *out, size_t length, + const SM4_KEY *key, unsigned char *ivec, int *num, const int enc) +{ + CRYPTO_cfb128_encrypt(in, out, length, key, ivec, num, enc, + (block128_f)SM4_encrypt); +} + +static void +sm4_ecb_encrypt(const unsigned char *in, unsigned char *out, const SM4_KEY *key, + const int enc) +{ + if (enc) + SM4_encrypt(in, out, key); + else + SM4_decrypt(in, out, key); +} + +static void +sm4_ofb128_encrypt(const unsigned char *in, unsigned char *out, size_t length, + const SM4_KEY *key, unsigned char *ivec, int *num) +{ + CRYPTO_ofb128_encrypt(in, out, length, key, ivec, num, + (block128_f)SM4_encrypt); +} + +IMPLEMENT_BLOCK_CIPHER(sm4, ks, sm4, EVP_SM4_KEY, NID_sm4, 16, 16, 16, 128, + EVP_CIPH_FLAG_DEFAULT_ASN1, sm4_init_key, NULL, 0, 0, 0) + +static int +sm4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, + size_t len) +{ + EVP_SM4_KEY *key = EVP_C_DATA(EVP_SM4_KEY, ctx); + + CRYPTO_ctr128_encrypt(in, out, len, &key->ks, ctx->iv, ctx->buf, + &ctx->num, (block128_f)SM4_encrypt); + return 1; +} + +static const EVP_CIPHER sm4_ctr_mode = { + .nid = NID_sm4_ctr, + .block_size = 1, + .key_len = 16, + .iv_len = 16, + .flags = EVP_CIPH_CTR_MODE, + .init = sm4_init_key, + .do_cipher = sm4_ctr_cipher, + .cleanup = NULL, + .ctx_size = sizeof(EVP_SM4_KEY), + .set_asn1_parameters = NULL, + .get_asn1_parameters = NULL, + .ctrl = NULL, + .app_data = NULL, +}; + +const EVP_CIPHER * +EVP_sm4_ctr(void) +{ + return &sm4_ctr_mode; +} + +#endif diff --git a/crypto/evp/encode.c b/crypto/evp/encode.c index 1097a7c9..ae107abb 100644 --- a/crypto/evp/encode.c +++ b/crypto/evp/encode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: encode.c,v 1.24 2016/05/04 15:05:13 tedu Exp $ */ +/* $OpenBSD: encode.c,v 1.26 2019/01/19 01:24:18 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -112,6 +112,18 @@ static const unsigned char data_ascii2bin[128] = { 0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; +EVP_ENCODE_CTX * +EVP_ENCODE_CTX_new(void) +{ + return calloc(1, sizeof(EVP_ENCODE_CTX)); +} + +void +EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx) +{ + free(ctx); +} + void EVP_EncodeInit(EVP_ENCODE_CTX *ctx) { @@ -120,7 +132,7 @@ EVP_EncodeInit(EVP_ENCODE_CTX *ctx) ctx->line_num = 0; } -void +int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl) { @@ -128,13 +140,13 @@ EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, size_t total = 0; *outl = 0; - if (inl == 0) - return; + if (inl <= 0) + return 0; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); if (ctx->length - ctx->num > inl) { memcpy(&(ctx->enc_data[ctx->num]), in, inl); ctx->num += inl; - return; + return 1; } if (ctx->num != 0) { i = ctx->length - ctx->num; @@ -160,12 +172,14 @@ EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, if (total > INT_MAX) { /* Too much output data! */ *outl = 0; - return; + return 0; } if (inl != 0) memcpy(&(ctx->enc_data[0]), in, inl); ctx->num = inl; *outl = total; + + return 1; } void diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index d0a5eb2d..a2299019 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_enc.c,v 1.36 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: evp_enc.c,v 1.40 2019/03/17 18:07:41 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -75,18 +75,6 @@ #define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl) -void -EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) -{ - memset(ctx, 0, sizeof(EVP_CIPHER_CTX)); -} - -EVP_CIPHER_CTX * -EVP_CIPHER_CTX_new(void) -{ - return calloc(1, sizeof(EVP_CIPHER_CTX)); -} - int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, const unsigned char *key, const unsigned char *iv, int enc) @@ -165,7 +153,7 @@ EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, ctx->cipher_data = NULL; } ctx->key_len = cipher->key_len; - ctx->flags = 0; + ctx->flags &= EVP_CIPHER_CTX_FLAG_WRAP_ALLOW; if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) { if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL)) { EVPerror(EVP_R_INITIALIZATION_ERROR); @@ -187,6 +175,12 @@ EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, return 0; } + if (!(ctx->flags & EVP_CIPHER_CTX_FLAG_WRAP_ALLOW) && + EVP_CIPHER_CTX_mode(ctx) == EVP_CIPH_WRAP_MODE) { + EVPerror(EVP_R_WRAP_MODE_NOT_ALLOWED); + return 0; + } + if (!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) { switch (EVP_CIPHER_CTX_mode(ctx)) { @@ -258,7 +252,7 @@ EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) } __warn_references(EVP_CipherFinal, - "warning: EVP_CipherFinal is often misused, please use EVP_CipherFinal_ex and EVP_CIPHER_CTX_cleanup"); + "EVP_CipherFinal is often misused, please use EVP_CipherFinal_ex and EVP_CIPHER_CTX_cleanup"); int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) @@ -368,7 +362,7 @@ EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, } __warn_references(EVP_EncryptFinal, - "warning: EVP_EncryptFinal is often misused, please use EVP_EncryptFinal_ex and EVP_CIPHER_CTX_cleanup"); + "EVP_EncryptFinal is often misused, please use EVP_EncryptFinal_ex and EVP_CIPHER_CTX_cleanup"); int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) @@ -483,7 +477,7 @@ EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, } __warn_references(EVP_DecryptFinal, - "warning: EVP_DecryptFinal is often misused, please use EVP_DecryptFinal_ex and EVP_CIPHER_CTX_cleanup"); + "EVP_DecryptFinal is often misused, please use EVP_DecryptFinal_ex and EVP_CIPHER_CTX_cleanup"); int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) @@ -548,13 +542,33 @@ EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) return (1); } +EVP_CIPHER_CTX * +EVP_CIPHER_CTX_new(void) +{ + return calloc(1, sizeof(EVP_CIPHER_CTX)); +} + void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) { - if (ctx) { - EVP_CIPHER_CTX_cleanup(ctx); - free(ctx); - } + if (ctx == NULL) + return; + + EVP_CIPHER_CTX_cleanup(ctx); + + free(ctx); +} + +void +EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) +{ + memset(ctx, 0, sizeof(EVP_CIPHER_CTX)); +} + +int +EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *a) +{ + return EVP_CIPHER_CTX_cleanup(a); } int @@ -569,10 +583,7 @@ EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) } free(c->cipher_data); #ifndef OPENSSL_NO_ENGINE - if (c->engine) - /* The EVP_CIPHER we used belongs to an ENGINE, release the - * functional reference we held for this reason. */ - ENGINE_finish(c->engine); + ENGINE_finish(c->engine); #endif explicit_bzero(c, sizeof(EVP_CIPHER_CTX)); return 1; diff --git a/crypto/evp/evp_err.c b/crypto/evp/evp_err.c index 1e1cc835..89f980b7 100644 --- a/crypto/evp/evp_err.c +++ b/crypto/evp/evp_err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_err.c,v 1.22 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: evp_err.c,v 1.25 2019/03/18 05:34:29 tb Exp $ */ /* ==================================================================== * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. * @@ -100,6 +100,7 @@ static ERR_STRING_DATA EVP_str_reasons[] = { {ERR_REASON(EVP_R_ERROR_LOADING_SECTION) , "error loading section"}, {ERR_REASON(EVP_R_ERROR_SETTING_FIPS_MODE), "error setting fips mode"}, {ERR_REASON(EVP_R_EVP_PBE_CIPHERINIT_ERROR), "evp pbe cipherinit error"}, + {ERR_REASON(EVP_R_EXPECTING_AN_HMAC_KEY), "expecting an hmac key"}, {ERR_REASON(EVP_R_EXPECTING_AN_RSA_KEY) , "expecting an rsa key"}, {ERR_REASON(EVP_R_EXPECTING_A_DH_KEY) , "expecting a dh key"}, {ERR_REASON(EVP_R_EXPECTING_A_DSA_KEY) , "expecting a dsa key"}, @@ -147,6 +148,7 @@ static ERR_STRING_DATA EVP_str_reasons[] = { {ERR_REASON(EVP_R_UNSUPPORTED_PRF) , "unsupported prf"}, {ERR_REASON(EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM), "unsupported private key algorithm"}, {ERR_REASON(EVP_R_UNSUPPORTED_SALT_TYPE) , "unsupported salt type"}, + {ERR_REASON(EVP_R_WRAP_MODE_NOT_ALLOWED), "wrap mode not allowed"}, {ERR_REASON(EVP_R_WRONG_FINAL_BLOCK_LENGTH), "wrong final block length"}, {ERR_REASON(EVP_R_WRONG_PUBLIC_KEY_TYPE) , "wrong public key type"}, {0, NULL} diff --git a/crypto/evp/evp_key.c b/crypto/evp/evp_key.c index 33de513e..91d0fc0d 100644 --- a/crypto/evp/evp_key.c +++ b/crypto/evp/evp_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_key.c,v 1.24 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: evp_key.c,v 1.26 2018/08/14 17:59:26 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -101,17 +101,21 @@ EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, char buff[BUFSIZ]; UI *ui; + if (len > BUFSIZ) + len = BUFSIZ; + /* Ensure that 0 <= min <= len - 1. In particular, 1 <= len. */ + if (min < 0 || len - 1 < min) + return -1; if ((prompt == NULL) && (prompt_string[0] != '\0')) prompt = prompt_string; ui = UI_new(); if (ui == NULL) return -1; - if (UI_add_input_string(ui, prompt, 0, buf, min, - (len >= BUFSIZ) ? BUFSIZ - 1 : len) < 0) + if (UI_add_input_string(ui, prompt, 0, buf, min, len - 1) < 0) return -1; if (verify) { - if (UI_add_verify_string(ui, prompt, 0, buff, min, - (len >= BUFSIZ) ? BUFSIZ - 1 : len, buf) < 0) + if (UI_add_verify_string(ui, prompt, 0, buff, min, len - 1, buf) + < 0) return -1; } ret = UI_process(ui); diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index ad97a3b7..90107739 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_lib.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: evp_lib.c,v 1.17 2018/09/12 06:35:38 djm Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -207,6 +207,12 @@ EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx) return ctx->cipher; } +int +EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx) +{ + return ctx->encrypt; +} + unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher) { @@ -267,6 +273,44 @@ EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx) return ctx->cipher->nid; } +int +EVP_CIPHER_CTX_get_iv(const EVP_CIPHER_CTX *ctx, unsigned char *iv, size_t len) +{ + if (ctx == NULL || len != EVP_CIPHER_CTX_iv_length(ctx)) + return 0; + if (len > EVP_MAX_IV_LENGTH) + return 0; /* sanity check; shouldn't happen */ + /* + * Skip the memcpy entirely when the requested IV length is zero, + * since the iv pointer may be NULL or invalid. + */ + if (len != 0) { + if (iv == NULL) + return 0; + memcpy(iv, ctx->iv, len); + } + return 1; +} + +int +EVP_CIPHER_CTX_set_iv(EVP_CIPHER_CTX *ctx, const unsigned char *iv, size_t len) +{ + if (ctx == NULL || len != EVP_CIPHER_CTX_iv_length(ctx)) + return 0; + if (len > EVP_MAX_IV_LENGTH) + return 0; /* sanity check; shouldn't happen */ + /* + * Skip the memcpy entirely when the requested IV length is zero, + * since the iv pointer may be NULL or invalid. + */ + if (len != 0) { + if (iv == NULL) + return 0; + memcpy(ctx->iv, iv, len); + } + return 1; +} + int EVP_MD_block_size(const EVP_MD *md) { diff --git a/crypto/evp/evp_locl.h b/crypto/evp/evp_locl.h index e264f9c9..0b1bea95 100644 --- a/crypto/evp/evp_locl.h +++ b/crypto/evp/evp_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_locl.h,v 1.14 2016/12/21 15:49:29 jsing Exp $ */ +/* $OpenBSD: evp_locl.h,v 1.15 2018/11/24 11:16:44 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -265,7 +265,7 @@ const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; } EVP_CIPHER_get_asn1_iv, \ NULL) - struct evp_pkey_ctx_st { +struct evp_pkey_ctx_st { /* Method associated with this operation */ const EVP_PKEY_METHOD *pmeth; /* Engine that implements this method or NULL if builtin */ diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c index 4dcd2a15..9ff544b8 100644 --- a/crypto/evp/evp_pkey.c +++ b/crypto/evp/evp_pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_pkey.c,v 1.19 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: evp_pkey.c,v 1.23 2018/08/24 20:26:03 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -67,10 +67,10 @@ /* Extract a private key from a PKCS8 structure */ EVP_PKEY * -EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8) +EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8) { EVP_PKEY *pkey = NULL; - ASN1_OBJECT *algoid; + const ASN1_OBJECT *algoid; char obj_tmp[80]; if (!PKCS8_pkey_get0(&algoid, NULL, NULL, NULL, p8)) @@ -105,16 +105,10 @@ EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8) return NULL; } -PKCS8_PRIV_KEY_INFO * -EVP_PKEY2PKCS8(EVP_PKEY *pkey) -{ - return EVP_PKEY2PKCS8_broken(pkey, PKCS8_OK); -} - /* Turn a private key into a PKCS8 structure */ PKCS8_PRIV_KEY_INFO * -EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken) +EVP_PKEY2PKCS8(EVP_PKEY *pkey) { PKCS8_PRIV_KEY_INFO *p8; @@ -122,7 +116,6 @@ EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken) EVPerror(ERR_R_MALLOC_FAILURE); return NULL; } - p8->broken = broken; if (pkey->ameth) { if (pkey->ameth->priv_encode) { @@ -145,27 +138,6 @@ EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken) return NULL; } -PKCS8_PRIV_KEY_INFO * -PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken) -{ - switch (broken) { - case PKCS8_OK: - p8->broken = PKCS8_OK; - return p8; - break; - - case PKCS8_NO_OCTET: - p8->broken = PKCS8_NO_OCTET; - p8->pkey->type = V_ASN1_SEQUENCE; - return p8; - break; - - default: - EVPerror(EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE); - return NULL; - } -} - /* EVP_PKEY attribute functions */ int @@ -181,7 +153,8 @@ EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos) } int -EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj, int lastpos) +EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj, + int lastpos) { return X509at_get_attr_by_OBJ(key->attributes, obj, lastpos); } diff --git a/crypto/evp/m_md5_sha1.c b/crypto/evp/m_md5_sha1.c index 272cdee9..4e8a0c32 100644 --- a/crypto/evp/m_md5_sha1.c +++ b/crypto/evp/m_md5_sha1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_md5_sha1.c,v 1.1 2017/02/28 14:15:37 jsing Exp $ */ +/* $OpenBSD: m_md5_sha1.c,v 1.2 2018/08/10 17:30:29 jsing Exp $ */ /* * Copyright (c) 2017 Joel Sing * @@ -20,6 +20,10 @@ #include #include +#ifndef OPENSSL_NO_RSA +#include +#endif + struct md5_sha1_ctx { MD5_CTX md5; SHA_CTX sha1; @@ -74,6 +78,13 @@ static const EVP_MD md5_sha1_md = { .final = md5_sha1_final, .block_size = MD5_CBLOCK, /* MD5_CBLOCK == SHA_CBLOCK */ .ctx_size = sizeof(EVP_MD *) + sizeof(struct md5_sha1_ctx), +#ifndef OPENSSL_NO_RSA + .sign = (evp_sign_method *)RSA_sign, + .verify = (evp_verify_method *)RSA_verify, + .required_pkey_type = { + EVP_PKEY_RSA, EVP_PKEY_RSA2, 0, 0, + }, +#endif }; const EVP_MD * diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c index 6e955d94..9e313c36 100644 --- a/crypto/evp/m_sigver.c +++ b/crypto/evp/m_sigver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_sigver.c,v 1.6 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: m_sigver.c,v 1.7 2018/05/13 06:35:10 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -166,7 +166,7 @@ EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen) } int -EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen) +EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, size_t siglen) { EVP_MD_CTX tmp_ctx; unsigned char md[EVP_MAX_MD_SIZE]; diff --git a/crypto/evp/m_sm3.c b/crypto/evp/m_sm3.c new file mode 100644 index 00000000..66582b8e --- /dev/null +++ b/crypto/evp/m_sm3.c @@ -0,0 +1,73 @@ +/* $OpenBSD: m_sm3.c,v 1.1 2018/11/11 06:53:31 tb Exp $ */ +/* + * Copyright (c) 2018, Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#ifndef OPENSSL_NO_SM3 +#include +#include + +#ifndef OPENSSL_NO_RSA +#include +#endif + +static int +sm3_init(EVP_MD_CTX *ctx) +{ + return SM3_Init(ctx->md_data); +} + +static int +sm3_update(EVP_MD_CTX *ctx, const void *data, size_t count) +{ + return SM3_Update(ctx->md_data, data, count); +} + +static int +sm3_final(EVP_MD_CTX *ctx, unsigned char *md) +{ + return SM3_Final(md, ctx->md_data); +} + +static const EVP_MD sm3_md = { + .type = NID_sm3, + .pkey_type = NID_sm3WithRSAEncryption, + .md_size = SM3_DIGEST_LENGTH, + .flags = EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT, + .init = sm3_init, + .update = sm3_update, + .final = sm3_final, + .copy = NULL, + .cleanup = NULL, +#ifndef OPENSSL_NO_RSA + .sign = (evp_sign_method *)RSA_sign, + .verify = (evp_verify_method *)RSA_verify, + .required_pkey_type = { + EVP_PKEY_RSA, EVP_PKEY_RSA2, 0, 0, + }, +#endif + .block_size = SM3_CBLOCK, + .ctx_size = sizeof(EVP_MD *) + sizeof(SM3_CTX), +}; + +const EVP_MD * +EVP_sm3(void) +{ + return &sm3_md; +} + +#endif /* OPENSSL_NO_SM3 */ diff --git a/crypto/evp/names.c b/crypto/evp/names.c index ebaa3a2f..dfcf9ee2 100644 --- a/crypto/evp/names.c +++ b/crypto/evp/names.c @@ -1,4 +1,4 @@ -/* $OpenBSD: names.c,v 1.13 2017/04/29 21:48:44 jsing Exp $ */ +/* $OpenBSD: names.c,v 1.14 2018/03/17 16:20:01 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -113,6 +113,9 @@ EVP_get_cipherbyname(const char *name) { const EVP_CIPHER *cp; + if (!OPENSSL_init_crypto(0, NULL)) + return NULL; + cp = (const EVP_CIPHER *)OBJ_NAME_get(name, OBJ_NAME_TYPE_CIPHER_METH); return (cp); } @@ -122,6 +125,9 @@ EVP_get_digestbyname(const char *name) { const EVP_MD *cp; + if (!OPENSSL_init_crypto(0, NULL)) + return NULL; + cp = (const EVP_MD *)OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH); return (cp); } @@ -167,6 +173,9 @@ EVP_CIPHER_do_all(void (*fn)(const EVP_CIPHER *ciph, const char *from, { struct doall_cipher dc; + /* Prayer and clean living lets you ignore errors, OpenSSL style */ + (void) OPENSSL_init_crypto(0, NULL); + dc.fn = fn; dc.arg = arg; OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH, do_all_cipher_fn, &dc); @@ -178,6 +187,9 @@ EVP_CIPHER_do_all_sorted(void (*fn)(const EVP_CIPHER *ciph, const char *from, { struct doall_cipher dc; + /* Prayer and clean living lets you ignore errors, OpenSSL style */ + (void) OPENSSL_init_crypto(0, NULL); + dc.fn = fn; dc.arg = arg; OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, @@ -207,6 +219,9 @@ EVP_MD_do_all(void (*fn)(const EVP_MD *md, const char *from, const char *to, { struct doall_md dc; + /* Prayer and clean living lets you ignore errors, OpenSSL style */ + (void) OPENSSL_init_crypto(0, NULL); + dc.fn = fn; dc.arg = arg; OBJ_NAME_do_all(OBJ_NAME_TYPE_MD_METH, do_all_md_fn, &dc); @@ -218,6 +233,9 @@ EVP_MD_do_all_sorted(void (*fn)(const EVP_MD *md, { struct doall_md dc; + /* Prayer and clean living lets you ignore errors, OpenSSL style */ + (void) OPENSSL_init_crypto(0, NULL); + dc.fn = fn; dc.arg = arg; OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_MD_METH, do_all_md_fn, &dc); diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 0d4cd26d..13a9d65f 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_lib.c,v 1.17 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: p_lib.c,v 1.25 2019/03/17 18:17:45 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -85,7 +85,7 @@ static void EVP_PKEY_free_it(EVP_PKEY *x); int -EVP_PKEY_bits(EVP_PKEY *pkey) +EVP_PKEY_bits(const EVP_PKEY *pkey) { if (pkey && pkey->ameth && pkey->ameth->pkey_bits) return pkey->ameth->pkey_bits(pkey); @@ -93,7 +93,7 @@ EVP_PKEY_bits(EVP_PKEY *pkey) } int -EVP_PKEY_size(EVP_PKEY *pkey) +EVP_PKEY_size(const EVP_PKEY *pkey) { if (pkey && pkey->ameth && pkey->ameth->pkey_size) return pkey->ameth->pkey_size(pkey); @@ -204,6 +204,13 @@ EVP_PKEY_new(void) return (ret); } +int +EVP_PKEY_up_ref(EVP_PKEY *pkey) +{ + int refs = CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY); + return ((refs > 1) ? 1 : 0); +} + /* Setup a public key ASN1 method and ENGINE from a NID or a string. * If pkey is NULL just return 1 or 0 if the algorithm exists. */ @@ -222,11 +229,8 @@ pkey_set_type(EVP_PKEY *pkey, int type, const char *str, int len) if ((type == pkey->save_type) && pkey->ameth) return 1; #ifndef OPENSSL_NO_ENGINE - /* If we have an ENGINE release it */ - if (pkey->engine) { - ENGINE_finish(pkey->engine); - pkey->engine = NULL; - } + ENGINE_finish(pkey->engine); + pkey->engine = NULL; #endif } if (str) @@ -234,7 +238,7 @@ pkey_set_type(EVP_PKEY *pkey, int type, const char *str, int len) else ameth = EVP_PKEY_asn1_find(&e, type); #ifndef OPENSSL_NO_ENGINE - if (!pkey && e) + if (pkey == NULL) ENGINE_finish(e); #endif if (!ameth) { @@ -273,19 +277,36 @@ EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) } void * -EVP_PKEY_get0(EVP_PKEY *pkey) +EVP_PKEY_get0(const EVP_PKEY *pkey) { return pkey->pkey.ptr; } +const unsigned char * +EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len) +{ + ASN1_OCTET_STRING *os; + + if (pkey->type != EVP_PKEY_HMAC) { + EVPerror(EVP_R_EXPECTING_AN_HMAC_KEY); + return NULL; + } + + os = EVP_PKEY_get0(pkey); + *len = os->length; + + return os->data; +} + #ifndef OPENSSL_NO_RSA -int -EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) +RSA * +EVP_PKEY_get0_RSA(EVP_PKEY *pkey) { - int ret = EVP_PKEY_assign_RSA(pkey, key); - if (ret) - RSA_up_ref(key); - return ret; + if (pkey->type != EVP_PKEY_RSA) { + EVPerror(EVP_R_EXPECTING_AN_RSA_KEY); + return NULL; + } + return pkey->pkey.rsa; } RSA * @@ -298,17 +319,27 @@ EVP_PKEY_get1_RSA(EVP_PKEY *pkey) RSA_up_ref(pkey->pkey.rsa); return pkey->pkey.rsa; } -#endif -#ifndef OPENSSL_NO_DSA int -EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) +EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) { - int ret = EVP_PKEY_assign_DSA(pkey, key); - if (ret) - DSA_up_ref(key); + int ret = EVP_PKEY_assign_RSA(pkey, key); + if (ret != 0) + RSA_up_ref(key); return ret; } +#endif + +#ifndef OPENSSL_NO_DSA +DSA * +EVP_PKEY_get0_DSA(EVP_PKEY *pkey) +{ + if (pkey->type != EVP_PKEY_DSA) { + EVPerror(EVP_R_EXPECTING_A_DSA_KEY); + return NULL; + } + return pkey->pkey.dsa; +} DSA * EVP_PKEY_get1_DSA(EVP_PKEY *pkey) @@ -320,18 +351,27 @@ EVP_PKEY_get1_DSA(EVP_PKEY *pkey) DSA_up_ref(pkey->pkey.dsa); return pkey->pkey.dsa; } -#endif - -#ifndef OPENSSL_NO_EC int -EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) +EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) { - int ret = EVP_PKEY_assign_EC_KEY(pkey, key); - if (ret) - EC_KEY_up_ref(key); + int ret = EVP_PKEY_assign_DSA(pkey, key); + if (ret != 0) + DSA_up_ref(key); return ret; } +#endif + +#ifndef OPENSSL_NO_EC +EC_KEY * +EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) +{ + if (pkey->type != EVP_PKEY_EC) { + EVPerror(EVP_R_EXPECTING_A_EC_KEY); + return NULL; + } + return pkey->pkey.ec; +} EC_KEY * EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) @@ -343,18 +383,27 @@ EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) EC_KEY_up_ref(pkey->pkey.ec); return pkey->pkey.ec; } + +int +EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) +{ + int ret = EVP_PKEY_assign_EC_KEY(pkey, key); + if (ret != 0) + EC_KEY_up_ref(key); + return ret; +} #endif #ifndef OPENSSL_NO_DH - -int -EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key) +DH * +EVP_PKEY_get0_DH(EVP_PKEY *pkey) { - int ret = EVP_PKEY_assign_DH(pkey, key); - if (ret) - DH_up_ref(key); - return ret; + if (pkey->type != EVP_PKEY_DH) { + EVPerror(EVP_R_EXPECTING_A_DH_KEY); + return NULL; + } + return pkey->pkey.dh; } DH * @@ -367,6 +416,15 @@ EVP_PKEY_get1_DH(EVP_PKEY *pkey) DH_up_ref(pkey->pkey.dh); return pkey->pkey.dh; } + +int +EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key) +{ + int ret = EVP_PKEY_assign_DH(pkey, key); + if (ret != 0) + DH_up_ref(key); + return ret; +} #endif int @@ -381,8 +439,7 @@ EVP_PKEY_type(int type) else ret = NID_undef; #ifndef OPENSSL_NO_ENGINE - if (e) - ENGINE_finish(e); + ENGINE_finish(e); #endif return ret; } @@ -425,10 +482,8 @@ EVP_PKEY_free_it(EVP_PKEY *x) x->pkey.ptr = NULL; } #ifndef OPENSSL_NO_ENGINE - if (x->engine) { - ENGINE_finish(x->engine); - x->engine = NULL; - } + ENGINE_finish(x->engine); + x->engine = NULL; #endif } diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index fc5f4ef9..6b86a0ec 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmeth_lib.c,v 1.13 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: pmeth_lib.c,v 1.14 2018/04/14 07:09:21 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -188,10 +188,9 @@ int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id) } ret = malloc(sizeof(EVP_PKEY_CTX)); - if (!ret) { + if (ret == NULL) { #ifndef OPENSSL_NO_ENGINE - if (e) - ENGINE_finish(e); + ENGINE_finish(e); #endif EVPerror(ERR_R_MALLOC_FAILURE); return NULL; @@ -394,10 +393,7 @@ EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) EVP_PKEY_free(ctx->pkey); EVP_PKEY_free(ctx->peerkey); #ifndef OPENSSL_NO_ENGINE - if (ctx->engine) - /* The EVP_PKEY_CTX we used belongs to an ENGINE, release the - * functional reference we held for this reason. */ - ENGINE_finish(ctx->engine); + ENGINE_finish(ctx->engine); #endif free(ctx); } diff --git a/crypto/ex_data.c b/crypto/ex_data.c index 63885af3..b1e39136 100644 --- a/crypto/ex_data.c +++ b/crypto/ex_data.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_data.c,v 1.19 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: ex_data.c,v 1.20 2018/03/17 16:20:01 beck Exp $ */ /* * Overhaul notes; @@ -312,6 +312,8 @@ def_get_class(int class_index) EX_CLASS_ITEM d, *p, *gen; EX_DATA_CHECK(return NULL;) d.class_index = class_index; + if (!OPENSSL_init_crypto(0, NULL)) + return NULL; CRYPTO_w_lock(CRYPTO_LOCK_EX_DATA); p = lh_EX_CLASS_ITEM_retrieve(ex_data, &d); if (!p) { @@ -500,6 +502,7 @@ int_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad) EX_CLASS_ITEM *item; void *ptr; CRYPTO_EX_DATA_FUNCS **storage = NULL; + if ((item = def_get_class(class_index)) == NULL) return; CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA); diff --git a/crypto/gost/gostr341001_ameth.c b/crypto/gost/gostr341001_ameth.c index b6958c77..16295996 100644 --- a/crypto/gost/gostr341001_ameth.c +++ b/crypto/gost/gostr341001_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gostr341001_ameth.c,v 1.11 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: gostr341001_ameth.c,v 1.15 2018/08/24 20:22:15 tb Exp $ */ /* * Copyright (c) 2014 Dmitry Eremin-Solenikov * Copyright (c) 2005-2006 Cryptocom LTD @@ -201,7 +201,7 @@ pub_decode_gost01(EVP_PKEY *pk, X509_PUBKEY *pub) == 0) return 0; (void)EVP_PKEY_assign_GOST(pk, NULL); - X509_ALGOR_get0(NULL, &ptype, (void **)&pval, palg); + X509_ALGOR_get0(NULL, &ptype, (const void **)&pval, palg); if (ptype != V_ASN1_SEQUENCE) { GOSTerror(GOST_R_BAD_KEY_PARAMETERS_FORMAT); return 0; @@ -394,14 +394,14 @@ priv_print_gost01(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx) } static int -priv_decode_gost01(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf) +priv_decode_gost01(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf) { const unsigned char *pkey_buf = NULL, *p = NULL; int priv_len = 0; BIGNUM *pk_num = NULL; int ret = 0; - X509_ALGOR *palg = NULL; - ASN1_OBJECT *palg_obj = NULL; + const X509_ALGOR *palg = NULL; + const ASN1_OBJECT *palg_obj = NULL; ASN1_INTEGER *priv_key = NULL; GOST_KEY *ec; int ptype = V_ASN1_UNDEF; @@ -410,7 +410,7 @@ priv_decode_gost01(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf) if (PKCS8_pkey_get0(&palg_obj, &pkey_buf, &priv_len, &palg, p8inf) == 0) return 0; (void)EVP_PKEY_assign_GOST(pk, NULL); - X509_ALGOR_get0(NULL, &ptype, (void **)&pval, palg); + X509_ALGOR_get0(NULL, &ptype, (const void **)&pval, palg); if (ptype != V_ASN1_SEQUENCE) { GOSTerror(GOST_R_BAD_KEY_PARAMETERS_FORMAT); return 0; @@ -421,21 +421,17 @@ priv_decode_gost01(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf) p = pkey_buf; if (V_ASN1_OCTET_STRING == *p) { /* New format - Little endian octet string */ - unsigned char rev_buf[32]; - int i; ASN1_OCTET_STRING *s = d2i_ASN1_OCTET_STRING(NULL, &p, priv_len); - if (s == NULL || s->length != 32) { + if (s == NULL) { GOSTerror(EVP_R_DECODE_ERROR); ASN1_STRING_free(s); return 0; } - for (i = 0; i < 32; i++) { - rev_buf[31 - i] = s->data[i]; - } + + pk_num = GOST_le2bn(s->data, s->length, NULL); ASN1_STRING_free(s); - pk_num = BN_bin2bn(rev_buf, 32, NULL); } else { priv_key = d2i_ASN1_INTEGER(NULL, &p, priv_len); if (priv_key == NULL) diff --git a/crypto/hkdf/hkdf.c b/crypto/hkdf/hkdf.c index 9fe587de..fa1dfeb0 100644 --- a/crypto/hkdf/hkdf.c +++ b/crypto/hkdf/hkdf.c @@ -1,3 +1,4 @@ +/* $OpenBSD: hkdf.c,v 1.2 2018/04/03 13:33:53 tb Exp $ */ /* Copyright (c) 2014, Google Inc. * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index 84917662..7bf17eed 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hmac.c,v 1.24 2017/03/03 10:39:07 inoguchi Exp $ */ +/* $OpenBSD: hmac.c,v 1.25 2018/02/17 14:53:58 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -171,6 +171,38 @@ HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len) return 0; } +HMAC_CTX * +HMAC_CTX_new(void) +{ + HMAC_CTX *ctx; + + if ((ctx = calloc(1, sizeof(*ctx))) == NULL) + return NULL; + + HMAC_CTX_init(ctx); + + return ctx; +} + +void +HMAC_CTX_free(HMAC_CTX *ctx) +{ + if (ctx == NULL) + return; + + HMAC_CTX_cleanup(ctx); + + free(ctx); +} + +int +HMAC_CTX_reset(HMAC_CTX *ctx) +{ + HMAC_CTX_cleanup(ctx); + HMAC_CTX_init(ctx); + return 1; +} + void HMAC_CTX_init(HMAC_CTX *ctx) { @@ -206,6 +238,20 @@ HMAC_CTX_cleanup(HMAC_CTX *ctx) explicit_bzero(ctx, sizeof(*ctx)); } +void +HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags) +{ + EVP_MD_CTX_set_flags(&ctx->i_ctx, flags); + EVP_MD_CTX_set_flags(&ctx->o_ctx, flags); + EVP_MD_CTX_set_flags(&ctx->md_ctx, flags); +} + +const EVP_MD * +HMAC_CTX_get_md(const HMAC_CTX *ctx) +{ + return ctx->md; +} + unsigned char * HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, size_t n, unsigned char *md, unsigned int *md_len) @@ -228,11 +274,3 @@ HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, HMAC_CTX_cleanup(&c); return NULL; } - -void -HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags) -{ - EVP_MD_CTX_set_flags(&ctx->i_ctx, flags); - EVP_MD_CTX_set_flags(&ctx->o_ctx, flags); - EVP_MD_CTX_set_flags(&ctx->md_ctx, flags); -} diff --git a/crypto/malloc-wrapper.c b/crypto/malloc-wrapper.c index 12867387..cb9a3118 100644 --- a/crypto/malloc-wrapper.c +++ b/crypto/malloc-wrapper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc-wrapper.c,v 1.6 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: malloc-wrapper.c,v 1.7 2018/05/13 13:49:04 jsing Exp $ */ /* * Copyright (c) 2014 Bob Beck * @@ -148,7 +148,6 @@ CRYPTO_realloc(void *ptr, int num, const char *file, int line) { if (num <= 0) return NULL; - return realloc(ptr, num); } @@ -156,18 +155,12 @@ void * CRYPTO_realloc_clean(void *ptr, int old_len, int num, const char *file, int line) { - void *ret = NULL; - if (num <= 0) return NULL; + /* Original does not support shrinking. */ if (num < old_len) - return NULL; /* original does not support shrinking */ - ret = malloc(num); - if (ret && ptr && old_len > 0) { - memcpy(ret, ptr, old_len); - freezero(ptr, old_len); - } - return ret; + return NULL; + return recallocarray(ptr, old_len, num, 1); } void diff --git a/crypto/md5/md5-elf-x86_64.S b/crypto/md5/md5-elf-x86_64.S index 5c16d837..2b73d720 100644 --- a/crypto/md5/md5-elf-x86_64.S +++ b/crypto/md5/md5-elf-x86_64.S @@ -665,7 +665,7 @@ md5_block_asm_data_order: movq 32(%rsp),%rbp addq $40,%rsp .Lepilogue: - .byte 0xf3,0xc3 + retq .size md5_block_asm_data_order,.-md5_block_asm_data_order #if defined(HAVE_GNU_STACK) .section .note.GNU-stack,"",%progbits diff --git a/crypto/md5/md5-macosx-x86_64.S b/crypto/md5/md5-macosx-x86_64.S index d50d90bc..b4fcd181 100644 --- a/crypto/md5/md5-macosx-x86_64.S +++ b/crypto/md5/md5-macosx-x86_64.S @@ -665,5 +665,5 @@ L$end: movq 32(%rsp),%rbp addq $40,%rsp L$epilogue: - .byte 0xf3,0xc3 + retq diff --git a/crypto/md5/md5-masm-x86_64.S b/crypto/md5/md5-masm-x86_64.S new file mode 100644 index 00000000..135f2378 --- /dev/null +++ b/crypto/md5/md5-masm-x86_64.S @@ -0,0 +1,685 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' +ALIGN 16 + +PUBLIC md5_block_asm_data_order + +md5_block_asm_data_order PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_md5_block_asm_data_order:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + push rbp + push rbx + push r12 + push r14 + push r15 +$L$prologue:: + + + + + mov rbp,rdi + shl rdx,6 + lea rdi,QWORD PTR[rdx*1+rsi] + mov eax,DWORD PTR[rbp] + mov ebx,DWORD PTR[4+rbp] + mov ecx,DWORD PTR[8+rbp] + mov edx,DWORD PTR[12+rbp] + + + + + + + + cmp rsi,rdi + je $L$end + + +$L$loop:: + mov r8d,eax + mov r9d,ebx + mov r14d,ecx + mov r15d,edx + mov r10d,DWORD PTR[rsi] + mov r11d,edx + xor r11d,ecx + lea eax,DWORD PTR[((-680876936))+r10*1+rax] + and r11d,ebx + xor r11d,edx + mov r10d,DWORD PTR[4+rsi] + add eax,r11d + rol eax,7 + mov r11d,ecx + add eax,ebx + xor r11d,ebx + lea edx,DWORD PTR[((-389564586))+r10*1+rdx] + and r11d,eax + xor r11d,ecx + mov r10d,DWORD PTR[8+rsi] + add edx,r11d + rol edx,12 + mov r11d,ebx + add edx,eax + xor r11d,eax + lea ecx,DWORD PTR[606105819+r10*1+rcx] + and r11d,edx + xor r11d,ebx + mov r10d,DWORD PTR[12+rsi] + add ecx,r11d + rol ecx,17 + mov r11d,eax + add ecx,edx + xor r11d,edx + lea ebx,DWORD PTR[((-1044525330))+r10*1+rbx] + and r11d,ecx + xor r11d,eax + mov r10d,DWORD PTR[16+rsi] + add ebx,r11d + rol ebx,22 + mov r11d,edx + add ebx,ecx + xor r11d,ecx + lea eax,DWORD PTR[((-176418897))+r10*1+rax] + and r11d,ebx + xor r11d,edx + mov r10d,DWORD PTR[20+rsi] + add eax,r11d + rol eax,7 + mov r11d,ecx + add eax,ebx + xor r11d,ebx + lea edx,DWORD PTR[1200080426+r10*1+rdx] + and r11d,eax + xor r11d,ecx + mov r10d,DWORD PTR[24+rsi] + add edx,r11d + rol edx,12 + mov r11d,ebx + add edx,eax + xor r11d,eax + lea ecx,DWORD PTR[((-1473231341))+r10*1+rcx] + and r11d,edx + xor r11d,ebx + mov r10d,DWORD PTR[28+rsi] + add ecx,r11d + rol ecx,17 + mov r11d,eax + add ecx,edx + xor r11d,edx + lea ebx,DWORD PTR[((-45705983))+r10*1+rbx] + and r11d,ecx + xor r11d,eax + mov r10d,DWORD PTR[32+rsi] + add ebx,r11d + rol ebx,22 + mov r11d,edx + add ebx,ecx + xor r11d,ecx + lea eax,DWORD PTR[1770035416+r10*1+rax] + and r11d,ebx + xor r11d,edx + mov r10d,DWORD PTR[36+rsi] + add eax,r11d + rol eax,7 + mov r11d,ecx + add eax,ebx + xor r11d,ebx + lea edx,DWORD PTR[((-1958414417))+r10*1+rdx] + and r11d,eax + xor r11d,ecx + mov r10d,DWORD PTR[40+rsi] + add edx,r11d + rol edx,12 + mov r11d,ebx + add edx,eax + xor r11d,eax + lea ecx,DWORD PTR[((-42063))+r10*1+rcx] + and r11d,edx + xor r11d,ebx + mov r10d,DWORD PTR[44+rsi] + add ecx,r11d + rol ecx,17 + mov r11d,eax + add ecx,edx + xor r11d,edx + lea ebx,DWORD PTR[((-1990404162))+r10*1+rbx] + and r11d,ecx + xor r11d,eax + mov r10d,DWORD PTR[48+rsi] + add ebx,r11d + rol ebx,22 + mov r11d,edx + add ebx,ecx + xor r11d,ecx + lea eax,DWORD PTR[1804603682+r10*1+rax] + and r11d,ebx + xor r11d,edx + mov r10d,DWORD PTR[52+rsi] + add eax,r11d + rol eax,7 + mov r11d,ecx + add eax,ebx + xor r11d,ebx + lea edx,DWORD PTR[((-40341101))+r10*1+rdx] + and r11d,eax + xor r11d,ecx + mov r10d,DWORD PTR[56+rsi] + add edx,r11d + rol edx,12 + mov r11d,ebx + add edx,eax + xor r11d,eax + lea ecx,DWORD PTR[((-1502002290))+r10*1+rcx] + and r11d,edx + xor r11d,ebx + mov r10d,DWORD PTR[60+rsi] + add ecx,r11d + rol ecx,17 + mov r11d,eax + add ecx,edx + xor r11d,edx + lea ebx,DWORD PTR[1236535329+r10*1+rbx] + and r11d,ecx + xor r11d,eax + mov r10d,DWORD PTR[rsi] + add ebx,r11d + rol ebx,22 + mov r11d,edx + add ebx,ecx + mov r10d,DWORD PTR[4+rsi] + mov r11d,edx + mov r12d,edx + not r11d + lea eax,DWORD PTR[((-165796510))+r10*1+rax] + and r12d,ebx + and r11d,ecx + mov r10d,DWORD PTR[24+rsi] + or r12d,r11d + mov r11d,ecx + add eax,r12d + mov r12d,ecx + rol eax,5 + add eax,ebx + not r11d + lea edx,DWORD PTR[((-1069501632))+r10*1+rdx] + and r12d,eax + and r11d,ebx + mov r10d,DWORD PTR[44+rsi] + or r12d,r11d + mov r11d,ebx + add edx,r12d + mov r12d,ebx + rol edx,9 + add edx,eax + not r11d + lea ecx,DWORD PTR[643717713+r10*1+rcx] + and r12d,edx + and r11d,eax + mov r10d,DWORD PTR[rsi] + or r12d,r11d + mov r11d,eax + add ecx,r12d + mov r12d,eax + rol ecx,14 + add ecx,edx + not r11d + lea ebx,DWORD PTR[((-373897302))+r10*1+rbx] + and r12d,ecx + and r11d,edx + mov r10d,DWORD PTR[20+rsi] + or r12d,r11d + mov r11d,edx + add ebx,r12d + mov r12d,edx + rol ebx,20 + add ebx,ecx + not r11d + lea eax,DWORD PTR[((-701558691))+r10*1+rax] + and r12d,ebx + and r11d,ecx + mov r10d,DWORD PTR[40+rsi] + or r12d,r11d + mov r11d,ecx + add eax,r12d + mov r12d,ecx + rol eax,5 + add eax,ebx + not r11d + lea edx,DWORD PTR[38016083+r10*1+rdx] + and r12d,eax + and r11d,ebx + mov r10d,DWORD PTR[60+rsi] + or r12d,r11d + mov r11d,ebx + add edx,r12d + mov r12d,ebx + rol edx,9 + add edx,eax + not r11d + lea ecx,DWORD PTR[((-660478335))+r10*1+rcx] + and r12d,edx + and r11d,eax + mov r10d,DWORD PTR[16+rsi] + or r12d,r11d + mov r11d,eax + add ecx,r12d + mov r12d,eax + rol ecx,14 + add ecx,edx + not r11d + lea ebx,DWORD PTR[((-405537848))+r10*1+rbx] + and r12d,ecx + and r11d,edx + mov r10d,DWORD PTR[36+rsi] + or r12d,r11d + mov r11d,edx + add ebx,r12d + mov r12d,edx + rol ebx,20 + add ebx,ecx + not r11d + lea eax,DWORD PTR[568446438+r10*1+rax] + and r12d,ebx + and r11d,ecx + mov r10d,DWORD PTR[56+rsi] + or r12d,r11d + mov r11d,ecx + add eax,r12d + mov r12d,ecx + rol eax,5 + add eax,ebx + not r11d + lea edx,DWORD PTR[((-1019803690))+r10*1+rdx] + and r12d,eax + and r11d,ebx + mov r10d,DWORD PTR[12+rsi] + or r12d,r11d + mov r11d,ebx + add edx,r12d + mov r12d,ebx + rol edx,9 + add edx,eax + not r11d + lea ecx,DWORD PTR[((-187363961))+r10*1+rcx] + and r12d,edx + and r11d,eax + mov r10d,DWORD PTR[32+rsi] + or r12d,r11d + mov r11d,eax + add ecx,r12d + mov r12d,eax + rol ecx,14 + add ecx,edx + not r11d + lea ebx,DWORD PTR[1163531501+r10*1+rbx] + and r12d,ecx + and r11d,edx + mov r10d,DWORD PTR[52+rsi] + or r12d,r11d + mov r11d,edx + add ebx,r12d + mov r12d,edx + rol ebx,20 + add ebx,ecx + not r11d + lea eax,DWORD PTR[((-1444681467))+r10*1+rax] + and r12d,ebx + and r11d,ecx + mov r10d,DWORD PTR[8+rsi] + or r12d,r11d + mov r11d,ecx + add eax,r12d + mov r12d,ecx + rol eax,5 + add eax,ebx + not r11d + lea edx,DWORD PTR[((-51403784))+r10*1+rdx] + and r12d,eax + and r11d,ebx + mov r10d,DWORD PTR[28+rsi] + or r12d,r11d + mov r11d,ebx + add edx,r12d + mov r12d,ebx + rol edx,9 + add edx,eax + not r11d + lea ecx,DWORD PTR[1735328473+r10*1+rcx] + and r12d,edx + and r11d,eax + mov r10d,DWORD PTR[48+rsi] + or r12d,r11d + mov r11d,eax + add ecx,r12d + mov r12d,eax + rol ecx,14 + add ecx,edx + not r11d + lea ebx,DWORD PTR[((-1926607734))+r10*1+rbx] + and r12d,ecx + and r11d,edx + mov r10d,DWORD PTR[rsi] + or r12d,r11d + mov r11d,edx + add ebx,r12d + mov r12d,edx + rol ebx,20 + add ebx,ecx + mov r10d,DWORD PTR[20+rsi] + mov r11d,ecx + lea eax,DWORD PTR[((-378558))+r10*1+rax] + mov r10d,DWORD PTR[32+rsi] + xor r11d,edx + xor r11d,ebx + add eax,r11d + rol eax,4 + mov r11d,ebx + add eax,ebx + lea edx,DWORD PTR[((-2022574463))+r10*1+rdx] + mov r10d,DWORD PTR[44+rsi] + xor r11d,ecx + xor r11d,eax + add edx,r11d + rol edx,11 + mov r11d,eax + add edx,eax + lea ecx,DWORD PTR[1839030562+r10*1+rcx] + mov r10d,DWORD PTR[56+rsi] + xor r11d,ebx + xor r11d,edx + add ecx,r11d + rol ecx,16 + mov r11d,edx + add ecx,edx + lea ebx,DWORD PTR[((-35309556))+r10*1+rbx] + mov r10d,DWORD PTR[4+rsi] + xor r11d,eax + xor r11d,ecx + add ebx,r11d + rol ebx,23 + mov r11d,ecx + add ebx,ecx + lea eax,DWORD PTR[((-1530992060))+r10*1+rax] + mov r10d,DWORD PTR[16+rsi] + xor r11d,edx + xor r11d,ebx + add eax,r11d + rol eax,4 + mov r11d,ebx + add eax,ebx + lea edx,DWORD PTR[1272893353+r10*1+rdx] + mov r10d,DWORD PTR[28+rsi] + xor r11d,ecx + xor r11d,eax + add edx,r11d + rol edx,11 + mov r11d,eax + add edx,eax + lea ecx,DWORD PTR[((-155497632))+r10*1+rcx] + mov r10d,DWORD PTR[40+rsi] + xor r11d,ebx + xor r11d,edx + add ecx,r11d + rol ecx,16 + mov r11d,edx + add ecx,edx + lea ebx,DWORD PTR[((-1094730640))+r10*1+rbx] + mov r10d,DWORD PTR[52+rsi] + xor r11d,eax + xor r11d,ecx + add ebx,r11d + rol ebx,23 + mov r11d,ecx + add ebx,ecx + lea eax,DWORD PTR[681279174+r10*1+rax] + mov r10d,DWORD PTR[rsi] + xor r11d,edx + xor r11d,ebx + add eax,r11d + rol eax,4 + mov r11d,ebx + add eax,ebx + lea edx,DWORD PTR[((-358537222))+r10*1+rdx] + mov r10d,DWORD PTR[12+rsi] + xor r11d,ecx + xor r11d,eax + add edx,r11d + rol edx,11 + mov r11d,eax + add edx,eax + lea ecx,DWORD PTR[((-722521979))+r10*1+rcx] + mov r10d,DWORD PTR[24+rsi] + xor r11d,ebx + xor r11d,edx + add ecx,r11d + rol ecx,16 + mov r11d,edx + add ecx,edx + lea ebx,DWORD PTR[76029189+r10*1+rbx] + mov r10d,DWORD PTR[36+rsi] + xor r11d,eax + xor r11d,ecx + add ebx,r11d + rol ebx,23 + mov r11d,ecx + add ebx,ecx + lea eax,DWORD PTR[((-640364487))+r10*1+rax] + mov r10d,DWORD PTR[48+rsi] + xor r11d,edx + xor r11d,ebx + add eax,r11d + rol eax,4 + mov r11d,ebx + add eax,ebx + lea edx,DWORD PTR[((-421815835))+r10*1+rdx] + mov r10d,DWORD PTR[60+rsi] + xor r11d,ecx + xor r11d,eax + add edx,r11d + rol edx,11 + mov r11d,eax + add edx,eax + lea ecx,DWORD PTR[530742520+r10*1+rcx] + mov r10d,DWORD PTR[8+rsi] + xor r11d,ebx + xor r11d,edx + add ecx,r11d + rol ecx,16 + mov r11d,edx + add ecx,edx + lea ebx,DWORD PTR[((-995338651))+r10*1+rbx] + mov r10d,DWORD PTR[rsi] + xor r11d,eax + xor r11d,ecx + add ebx,r11d + rol ebx,23 + mov r11d,ecx + add ebx,ecx + mov r10d,DWORD PTR[rsi] + mov r11d,0ffffffffh + xor r11d,edx + lea eax,DWORD PTR[((-198630844))+r10*1+rax] + or r11d,ebx + xor r11d,ecx + add eax,r11d + mov r10d,DWORD PTR[28+rsi] + mov r11d,0ffffffffh + rol eax,6 + xor r11d,ecx + add eax,ebx + lea edx,DWORD PTR[1126891415+r10*1+rdx] + or r11d,eax + xor r11d,ebx + add edx,r11d + mov r10d,DWORD PTR[56+rsi] + mov r11d,0ffffffffh + rol edx,10 + xor r11d,ebx + add edx,eax + lea ecx,DWORD PTR[((-1416354905))+r10*1+rcx] + or r11d,edx + xor r11d,eax + add ecx,r11d + mov r10d,DWORD PTR[20+rsi] + mov r11d,0ffffffffh + rol ecx,15 + xor r11d,eax + add ecx,edx + lea ebx,DWORD PTR[((-57434055))+r10*1+rbx] + or r11d,ecx + xor r11d,edx + add ebx,r11d + mov r10d,DWORD PTR[48+rsi] + mov r11d,0ffffffffh + rol ebx,21 + xor r11d,edx + add ebx,ecx + lea eax,DWORD PTR[1700485571+r10*1+rax] + or r11d,ebx + xor r11d,ecx + add eax,r11d + mov r10d,DWORD PTR[12+rsi] + mov r11d,0ffffffffh + rol eax,6 + xor r11d,ecx + add eax,ebx + lea edx,DWORD PTR[((-1894986606))+r10*1+rdx] + or r11d,eax + xor r11d,ebx + add edx,r11d + mov r10d,DWORD PTR[40+rsi] + mov r11d,0ffffffffh + rol edx,10 + xor r11d,ebx + add edx,eax + lea ecx,DWORD PTR[((-1051523))+r10*1+rcx] + or r11d,edx + xor r11d,eax + add ecx,r11d + mov r10d,DWORD PTR[4+rsi] + mov r11d,0ffffffffh + rol ecx,15 + xor r11d,eax + add ecx,edx + lea ebx,DWORD PTR[((-2054922799))+r10*1+rbx] + or r11d,ecx + xor r11d,edx + add ebx,r11d + mov r10d,DWORD PTR[32+rsi] + mov r11d,0ffffffffh + rol ebx,21 + xor r11d,edx + add ebx,ecx + lea eax,DWORD PTR[1873313359+r10*1+rax] + or r11d,ebx + xor r11d,ecx + add eax,r11d + mov r10d,DWORD PTR[60+rsi] + mov r11d,0ffffffffh + rol eax,6 + xor r11d,ecx + add eax,ebx + lea edx,DWORD PTR[((-30611744))+r10*1+rdx] + or r11d,eax + xor r11d,ebx + add edx,r11d + mov r10d,DWORD PTR[24+rsi] + mov r11d,0ffffffffh + rol edx,10 + xor r11d,ebx + add edx,eax + lea ecx,DWORD PTR[((-1560198380))+r10*1+rcx] + or r11d,edx + xor r11d,eax + add ecx,r11d + mov r10d,DWORD PTR[52+rsi] + mov r11d,0ffffffffh + rol ecx,15 + xor r11d,eax + add ecx,edx + lea ebx,DWORD PTR[1309151649+r10*1+rbx] + or r11d,ecx + xor r11d,edx + add ebx,r11d + mov r10d,DWORD PTR[16+rsi] + mov r11d,0ffffffffh + rol ebx,21 + xor r11d,edx + add ebx,ecx + lea eax,DWORD PTR[((-145523070))+r10*1+rax] + or r11d,ebx + xor r11d,ecx + add eax,r11d + mov r10d,DWORD PTR[44+rsi] + mov r11d,0ffffffffh + rol eax,6 + xor r11d,ecx + add eax,ebx + lea edx,DWORD PTR[((-1120210379))+r10*1+rdx] + or r11d,eax + xor r11d,ebx + add edx,r11d + mov r10d,DWORD PTR[8+rsi] + mov r11d,0ffffffffh + rol edx,10 + xor r11d,ebx + add edx,eax + lea ecx,DWORD PTR[718787259+r10*1+rcx] + or r11d,edx + xor r11d,eax + add ecx,r11d + mov r10d,DWORD PTR[36+rsi] + mov r11d,0ffffffffh + rol ecx,15 + xor r11d,eax + add ecx,edx + lea ebx,DWORD PTR[((-343485551))+r10*1+rbx] + or r11d,ecx + xor r11d,edx + add ebx,r11d + mov r10d,DWORD PTR[rsi] + mov r11d,0ffffffffh + rol ebx,21 + xor r11d,edx + add ebx,ecx + + add eax,r8d + add ebx,r9d + add ecx,r14d + add edx,r15d + + + add rsi,64 + cmp rsi,rdi + jb $L$loop + + +$L$end:: + mov DWORD PTR[rbp],eax + mov DWORD PTR[4+rbp],ebx + mov DWORD PTR[8+rbp],ecx + mov DWORD PTR[12+rbp],edx + + mov r15,QWORD PTR[rsp] + mov r14,QWORD PTR[8+rsp] + mov r12,QWORD PTR[16+rsp] + mov rbx,QWORD PTR[24+rsp] + mov rbp,QWORD PTR[32+rsp] + add rsp,40 +$L$epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_md5_block_asm_data_order:: +md5_block_asm_data_order ENDP + +.text$ ENDS +END diff --git a/crypto/md5/md5-mingw64-x86_64.S b/crypto/md5/md5-mingw64-x86_64.S new file mode 100644 index 00000000..5a611f52 --- /dev/null +++ b/crypto/md5/md5-mingw64-x86_64.S @@ -0,0 +1,679 @@ +#include "x86_arch.h" +.text +.p2align 4 + +.globl md5_block_asm_data_order +.def md5_block_asm_data_order; .scl 2; .type 32; .endef +md5_block_asm_data_order: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_md5_block_asm_data_order: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + pushq %rbp + pushq %rbx + pushq %r12 + pushq %r14 + pushq %r15 +.Lprologue: + + + + + movq %rdi,%rbp + shlq $6,%rdx + leaq (%rsi,%rdx,1),%rdi + movl 0(%rbp),%eax + movl 4(%rbp),%ebx + movl 8(%rbp),%ecx + movl 12(%rbp),%edx + + + + + + + + cmpq %rdi,%rsi + je .Lend + + +.Lloop: + movl %eax,%r8d + movl %ebx,%r9d + movl %ecx,%r14d + movl %edx,%r15d + movl 0(%rsi),%r10d + movl %edx,%r11d + xorl %ecx,%r11d + leal -680876936(%rax,%r10,1),%eax + andl %ebx,%r11d + xorl %edx,%r11d + movl 4(%rsi),%r10d + addl %r11d,%eax + roll $7,%eax + movl %ecx,%r11d + addl %ebx,%eax + xorl %ebx,%r11d + leal -389564586(%rdx,%r10,1),%edx + andl %eax,%r11d + xorl %ecx,%r11d + movl 8(%rsi),%r10d + addl %r11d,%edx + roll $12,%edx + movl %ebx,%r11d + addl %eax,%edx + xorl %eax,%r11d + leal 606105819(%rcx,%r10,1),%ecx + andl %edx,%r11d + xorl %ebx,%r11d + movl 12(%rsi),%r10d + addl %r11d,%ecx + roll $17,%ecx + movl %eax,%r11d + addl %edx,%ecx + xorl %edx,%r11d + leal -1044525330(%rbx,%r10,1),%ebx + andl %ecx,%r11d + xorl %eax,%r11d + movl 16(%rsi),%r10d + addl %r11d,%ebx + roll $22,%ebx + movl %edx,%r11d + addl %ecx,%ebx + xorl %ecx,%r11d + leal -176418897(%rax,%r10,1),%eax + andl %ebx,%r11d + xorl %edx,%r11d + movl 20(%rsi),%r10d + addl %r11d,%eax + roll $7,%eax + movl %ecx,%r11d + addl %ebx,%eax + xorl %ebx,%r11d + leal 1200080426(%rdx,%r10,1),%edx + andl %eax,%r11d + xorl %ecx,%r11d + movl 24(%rsi),%r10d + addl %r11d,%edx + roll $12,%edx + movl %ebx,%r11d + addl %eax,%edx + xorl %eax,%r11d + leal -1473231341(%rcx,%r10,1),%ecx + andl %edx,%r11d + xorl %ebx,%r11d + movl 28(%rsi),%r10d + addl %r11d,%ecx + roll $17,%ecx + movl %eax,%r11d + addl %edx,%ecx + xorl %edx,%r11d + leal -45705983(%rbx,%r10,1),%ebx + andl %ecx,%r11d + xorl %eax,%r11d + movl 32(%rsi),%r10d + addl %r11d,%ebx + roll $22,%ebx + movl %edx,%r11d + addl %ecx,%ebx + xorl %ecx,%r11d + leal 1770035416(%rax,%r10,1),%eax + andl %ebx,%r11d + xorl %edx,%r11d + movl 36(%rsi),%r10d + addl %r11d,%eax + roll $7,%eax + movl %ecx,%r11d + addl %ebx,%eax + xorl %ebx,%r11d + leal -1958414417(%rdx,%r10,1),%edx + andl %eax,%r11d + xorl %ecx,%r11d + movl 40(%rsi),%r10d + addl %r11d,%edx + roll $12,%edx + movl %ebx,%r11d + addl %eax,%edx + xorl %eax,%r11d + leal -42063(%rcx,%r10,1),%ecx + andl %edx,%r11d + xorl %ebx,%r11d + movl 44(%rsi),%r10d + addl %r11d,%ecx + roll $17,%ecx + movl %eax,%r11d + addl %edx,%ecx + xorl %edx,%r11d + leal -1990404162(%rbx,%r10,1),%ebx + andl %ecx,%r11d + xorl %eax,%r11d + movl 48(%rsi),%r10d + addl %r11d,%ebx + roll $22,%ebx + movl %edx,%r11d + addl %ecx,%ebx + xorl %ecx,%r11d + leal 1804603682(%rax,%r10,1),%eax + andl %ebx,%r11d + xorl %edx,%r11d + movl 52(%rsi),%r10d + addl %r11d,%eax + roll $7,%eax + movl %ecx,%r11d + addl %ebx,%eax + xorl %ebx,%r11d + leal -40341101(%rdx,%r10,1),%edx + andl %eax,%r11d + xorl %ecx,%r11d + movl 56(%rsi),%r10d + addl %r11d,%edx + roll $12,%edx + movl %ebx,%r11d + addl %eax,%edx + xorl %eax,%r11d + leal -1502002290(%rcx,%r10,1),%ecx + andl %edx,%r11d + xorl %ebx,%r11d + movl 60(%rsi),%r10d + addl %r11d,%ecx + roll $17,%ecx + movl %eax,%r11d + addl %edx,%ecx + xorl %edx,%r11d + leal 1236535329(%rbx,%r10,1),%ebx + andl %ecx,%r11d + xorl %eax,%r11d + movl 0(%rsi),%r10d + addl %r11d,%ebx + roll $22,%ebx + movl %edx,%r11d + addl %ecx,%ebx + movl 4(%rsi),%r10d + movl %edx,%r11d + movl %edx,%r12d + notl %r11d + leal -165796510(%rax,%r10,1),%eax + andl %ebx,%r12d + andl %ecx,%r11d + movl 24(%rsi),%r10d + orl %r11d,%r12d + movl %ecx,%r11d + addl %r12d,%eax + movl %ecx,%r12d + roll $5,%eax + addl %ebx,%eax + notl %r11d + leal -1069501632(%rdx,%r10,1),%edx + andl %eax,%r12d + andl %ebx,%r11d + movl 44(%rsi),%r10d + orl %r11d,%r12d + movl %ebx,%r11d + addl %r12d,%edx + movl %ebx,%r12d + roll $9,%edx + addl %eax,%edx + notl %r11d + leal 643717713(%rcx,%r10,1),%ecx + andl %edx,%r12d + andl %eax,%r11d + movl 0(%rsi),%r10d + orl %r11d,%r12d + movl %eax,%r11d + addl %r12d,%ecx + movl %eax,%r12d + roll $14,%ecx + addl %edx,%ecx + notl %r11d + leal -373897302(%rbx,%r10,1),%ebx + andl %ecx,%r12d + andl %edx,%r11d + movl 20(%rsi),%r10d + orl %r11d,%r12d + movl %edx,%r11d + addl %r12d,%ebx + movl %edx,%r12d + roll $20,%ebx + addl %ecx,%ebx + notl %r11d + leal -701558691(%rax,%r10,1),%eax + andl %ebx,%r12d + andl %ecx,%r11d + movl 40(%rsi),%r10d + orl %r11d,%r12d + movl %ecx,%r11d + addl %r12d,%eax + movl %ecx,%r12d + roll $5,%eax + addl %ebx,%eax + notl %r11d + leal 38016083(%rdx,%r10,1),%edx + andl %eax,%r12d + andl %ebx,%r11d + movl 60(%rsi),%r10d + orl %r11d,%r12d + movl %ebx,%r11d + addl %r12d,%edx + movl %ebx,%r12d + roll $9,%edx + addl %eax,%edx + notl %r11d + leal -660478335(%rcx,%r10,1),%ecx + andl %edx,%r12d + andl %eax,%r11d + movl 16(%rsi),%r10d + orl %r11d,%r12d + movl %eax,%r11d + addl %r12d,%ecx + movl %eax,%r12d + roll $14,%ecx + addl %edx,%ecx + notl %r11d + leal -405537848(%rbx,%r10,1),%ebx + andl %ecx,%r12d + andl %edx,%r11d + movl 36(%rsi),%r10d + orl %r11d,%r12d + movl %edx,%r11d + addl %r12d,%ebx + movl %edx,%r12d + roll $20,%ebx + addl %ecx,%ebx + notl %r11d + leal 568446438(%rax,%r10,1),%eax + andl %ebx,%r12d + andl %ecx,%r11d + movl 56(%rsi),%r10d + orl %r11d,%r12d + movl %ecx,%r11d + addl %r12d,%eax + movl %ecx,%r12d + roll $5,%eax + addl %ebx,%eax + notl %r11d + leal -1019803690(%rdx,%r10,1),%edx + andl %eax,%r12d + andl %ebx,%r11d + movl 12(%rsi),%r10d + orl %r11d,%r12d + movl %ebx,%r11d + addl %r12d,%edx + movl %ebx,%r12d + roll $9,%edx + addl %eax,%edx + notl %r11d + leal -187363961(%rcx,%r10,1),%ecx + andl %edx,%r12d + andl %eax,%r11d + movl 32(%rsi),%r10d + orl %r11d,%r12d + movl %eax,%r11d + addl %r12d,%ecx + movl %eax,%r12d + roll $14,%ecx + addl %edx,%ecx + notl %r11d + leal 1163531501(%rbx,%r10,1),%ebx + andl %ecx,%r12d + andl %edx,%r11d + movl 52(%rsi),%r10d + orl %r11d,%r12d + movl %edx,%r11d + addl %r12d,%ebx + movl %edx,%r12d + roll $20,%ebx + addl %ecx,%ebx + notl %r11d + leal -1444681467(%rax,%r10,1),%eax + andl %ebx,%r12d + andl %ecx,%r11d + movl 8(%rsi),%r10d + orl %r11d,%r12d + movl %ecx,%r11d + addl %r12d,%eax + movl %ecx,%r12d + roll $5,%eax + addl %ebx,%eax + notl %r11d + leal -51403784(%rdx,%r10,1),%edx + andl %eax,%r12d + andl %ebx,%r11d + movl 28(%rsi),%r10d + orl %r11d,%r12d + movl %ebx,%r11d + addl %r12d,%edx + movl %ebx,%r12d + roll $9,%edx + addl %eax,%edx + notl %r11d + leal 1735328473(%rcx,%r10,1),%ecx + andl %edx,%r12d + andl %eax,%r11d + movl 48(%rsi),%r10d + orl %r11d,%r12d + movl %eax,%r11d + addl %r12d,%ecx + movl %eax,%r12d + roll $14,%ecx + addl %edx,%ecx + notl %r11d + leal -1926607734(%rbx,%r10,1),%ebx + andl %ecx,%r12d + andl %edx,%r11d + movl 0(%rsi),%r10d + orl %r11d,%r12d + movl %edx,%r11d + addl %r12d,%ebx + movl %edx,%r12d + roll $20,%ebx + addl %ecx,%ebx + movl 20(%rsi),%r10d + movl %ecx,%r11d + leal -378558(%rax,%r10,1),%eax + movl 32(%rsi),%r10d + xorl %edx,%r11d + xorl %ebx,%r11d + addl %r11d,%eax + roll $4,%eax + movl %ebx,%r11d + addl %ebx,%eax + leal -2022574463(%rdx,%r10,1),%edx + movl 44(%rsi),%r10d + xorl %ecx,%r11d + xorl %eax,%r11d + addl %r11d,%edx + roll $11,%edx + movl %eax,%r11d + addl %eax,%edx + leal 1839030562(%rcx,%r10,1),%ecx + movl 56(%rsi),%r10d + xorl %ebx,%r11d + xorl %edx,%r11d + addl %r11d,%ecx + roll $16,%ecx + movl %edx,%r11d + addl %edx,%ecx + leal -35309556(%rbx,%r10,1),%ebx + movl 4(%rsi),%r10d + xorl %eax,%r11d + xorl %ecx,%r11d + addl %r11d,%ebx + roll $23,%ebx + movl %ecx,%r11d + addl %ecx,%ebx + leal -1530992060(%rax,%r10,1),%eax + movl 16(%rsi),%r10d + xorl %edx,%r11d + xorl %ebx,%r11d + addl %r11d,%eax + roll $4,%eax + movl %ebx,%r11d + addl %ebx,%eax + leal 1272893353(%rdx,%r10,1),%edx + movl 28(%rsi),%r10d + xorl %ecx,%r11d + xorl %eax,%r11d + addl %r11d,%edx + roll $11,%edx + movl %eax,%r11d + addl %eax,%edx + leal -155497632(%rcx,%r10,1),%ecx + movl 40(%rsi),%r10d + xorl %ebx,%r11d + xorl %edx,%r11d + addl %r11d,%ecx + roll $16,%ecx + movl %edx,%r11d + addl %edx,%ecx + leal -1094730640(%rbx,%r10,1),%ebx + movl 52(%rsi),%r10d + xorl %eax,%r11d + xorl %ecx,%r11d + addl %r11d,%ebx + roll $23,%ebx + movl %ecx,%r11d + addl %ecx,%ebx + leal 681279174(%rax,%r10,1),%eax + movl 0(%rsi),%r10d + xorl %edx,%r11d + xorl %ebx,%r11d + addl %r11d,%eax + roll $4,%eax + movl %ebx,%r11d + addl %ebx,%eax + leal -358537222(%rdx,%r10,1),%edx + movl 12(%rsi),%r10d + xorl %ecx,%r11d + xorl %eax,%r11d + addl %r11d,%edx + roll $11,%edx + movl %eax,%r11d + addl %eax,%edx + leal -722521979(%rcx,%r10,1),%ecx + movl 24(%rsi),%r10d + xorl %ebx,%r11d + xorl %edx,%r11d + addl %r11d,%ecx + roll $16,%ecx + movl %edx,%r11d + addl %edx,%ecx + leal 76029189(%rbx,%r10,1),%ebx + movl 36(%rsi),%r10d + xorl %eax,%r11d + xorl %ecx,%r11d + addl %r11d,%ebx + roll $23,%ebx + movl %ecx,%r11d + addl %ecx,%ebx + leal -640364487(%rax,%r10,1),%eax + movl 48(%rsi),%r10d + xorl %edx,%r11d + xorl %ebx,%r11d + addl %r11d,%eax + roll $4,%eax + movl %ebx,%r11d + addl %ebx,%eax + leal -421815835(%rdx,%r10,1),%edx + movl 60(%rsi),%r10d + xorl %ecx,%r11d + xorl %eax,%r11d + addl %r11d,%edx + roll $11,%edx + movl %eax,%r11d + addl %eax,%edx + leal 530742520(%rcx,%r10,1),%ecx + movl 8(%rsi),%r10d + xorl %ebx,%r11d + xorl %edx,%r11d + addl %r11d,%ecx + roll $16,%ecx + movl %edx,%r11d + addl %edx,%ecx + leal -995338651(%rbx,%r10,1),%ebx + movl 0(%rsi),%r10d + xorl %eax,%r11d + xorl %ecx,%r11d + addl %r11d,%ebx + roll $23,%ebx + movl %ecx,%r11d + addl %ecx,%ebx + movl 0(%rsi),%r10d + movl $4294967295,%r11d + xorl %edx,%r11d + leal -198630844(%rax,%r10,1),%eax + orl %ebx,%r11d + xorl %ecx,%r11d + addl %r11d,%eax + movl 28(%rsi),%r10d + movl $4294967295,%r11d + roll $6,%eax + xorl %ecx,%r11d + addl %ebx,%eax + leal 1126891415(%rdx,%r10,1),%edx + orl %eax,%r11d + xorl %ebx,%r11d + addl %r11d,%edx + movl 56(%rsi),%r10d + movl $4294967295,%r11d + roll $10,%edx + xorl %ebx,%r11d + addl %eax,%edx + leal -1416354905(%rcx,%r10,1),%ecx + orl %edx,%r11d + xorl %eax,%r11d + addl %r11d,%ecx + movl 20(%rsi),%r10d + movl $4294967295,%r11d + roll $15,%ecx + xorl %eax,%r11d + addl %edx,%ecx + leal -57434055(%rbx,%r10,1),%ebx + orl %ecx,%r11d + xorl %edx,%r11d + addl %r11d,%ebx + movl 48(%rsi),%r10d + movl $4294967295,%r11d + roll $21,%ebx + xorl %edx,%r11d + addl %ecx,%ebx + leal 1700485571(%rax,%r10,1),%eax + orl %ebx,%r11d + xorl %ecx,%r11d + addl %r11d,%eax + movl 12(%rsi),%r10d + movl $4294967295,%r11d + roll $6,%eax + xorl %ecx,%r11d + addl %ebx,%eax + leal -1894986606(%rdx,%r10,1),%edx + orl %eax,%r11d + xorl %ebx,%r11d + addl %r11d,%edx + movl 40(%rsi),%r10d + movl $4294967295,%r11d + roll $10,%edx + xorl %ebx,%r11d + addl %eax,%edx + leal -1051523(%rcx,%r10,1),%ecx + orl %edx,%r11d + xorl %eax,%r11d + addl %r11d,%ecx + movl 4(%rsi),%r10d + movl $4294967295,%r11d + roll $15,%ecx + xorl %eax,%r11d + addl %edx,%ecx + leal -2054922799(%rbx,%r10,1),%ebx + orl %ecx,%r11d + xorl %edx,%r11d + addl %r11d,%ebx + movl 32(%rsi),%r10d + movl $4294967295,%r11d + roll $21,%ebx + xorl %edx,%r11d + addl %ecx,%ebx + leal 1873313359(%rax,%r10,1),%eax + orl %ebx,%r11d + xorl %ecx,%r11d + addl %r11d,%eax + movl 60(%rsi),%r10d + movl $4294967295,%r11d + roll $6,%eax + xorl %ecx,%r11d + addl %ebx,%eax + leal -30611744(%rdx,%r10,1),%edx + orl %eax,%r11d + xorl %ebx,%r11d + addl %r11d,%edx + movl 24(%rsi),%r10d + movl $4294967295,%r11d + roll $10,%edx + xorl %ebx,%r11d + addl %eax,%edx + leal -1560198380(%rcx,%r10,1),%ecx + orl %edx,%r11d + xorl %eax,%r11d + addl %r11d,%ecx + movl 52(%rsi),%r10d + movl $4294967295,%r11d + roll $15,%ecx + xorl %eax,%r11d + addl %edx,%ecx + leal 1309151649(%rbx,%r10,1),%ebx + orl %ecx,%r11d + xorl %edx,%r11d + addl %r11d,%ebx + movl 16(%rsi),%r10d + movl $4294967295,%r11d + roll $21,%ebx + xorl %edx,%r11d + addl %ecx,%ebx + leal -145523070(%rax,%r10,1),%eax + orl %ebx,%r11d + xorl %ecx,%r11d + addl %r11d,%eax + movl 44(%rsi),%r10d + movl $4294967295,%r11d + roll $6,%eax + xorl %ecx,%r11d + addl %ebx,%eax + leal -1120210379(%rdx,%r10,1),%edx + orl %eax,%r11d + xorl %ebx,%r11d + addl %r11d,%edx + movl 8(%rsi),%r10d + movl $4294967295,%r11d + roll $10,%edx + xorl %ebx,%r11d + addl %eax,%edx + leal 718787259(%rcx,%r10,1),%ecx + orl %edx,%r11d + xorl %eax,%r11d + addl %r11d,%ecx + movl 36(%rsi),%r10d + movl $4294967295,%r11d + roll $15,%ecx + xorl %eax,%r11d + addl %edx,%ecx + leal -343485551(%rbx,%r10,1),%ebx + orl %ecx,%r11d + xorl %edx,%r11d + addl %r11d,%ebx + movl 0(%rsi),%r10d + movl $4294967295,%r11d + roll $21,%ebx + xorl %edx,%r11d + addl %ecx,%ebx + + addl %r8d,%eax + addl %r9d,%ebx + addl %r14d,%ecx + addl %r15d,%edx + + + addq $64,%rsi + cmpq %rdi,%rsi + jb .Lloop + + +.Lend: + movl %eax,0(%rbp) + movl %ebx,4(%rbp) + movl %ecx,8(%rbp) + movl %edx,12(%rbp) + + movq (%rsp),%r15 + movq 8(%rsp),%r14 + movq 16(%rsp),%r12 + movq 24(%rsp),%rbx + movq 32(%rsp),%rbp + addq $40,%rsp +.Lepilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_md5_block_asm_data_order: diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c index cae02a6f..602b139d 100644 --- a/crypto/mem_dbg.c +++ b/crypto/mem_dbg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem_dbg.c,v 1.22 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: mem_dbg.c,v 1.24 2019/01/29 14:40:54 deraadt Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -162,40 +162,37 @@ void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line, int before_p) { - /* CRYPTO_dbg_malloc is no longer permitted */ - abort(); + OPENSSL_assert("CRYPTO_dbg_malloc is no longer permitted"); } void CRYPTO_dbg_free(void *addr, int before_p) { - /* CRYPTO_dbg_free is no longer permitted */ - abort(); + OPENSSL_assert("CRYPTO_dbg_free is no longer permitted"); } void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, const char *file, int line, int before_p) { - /* CRYPTO_dbg_realloc is no longer permitted */ - abort(); + OPENSSL_assert("CRYPTO_dbg_realloc is no longer permitted"); } -void +int CRYPTO_mem_leaks(BIO *b) { - return; + return -1; } -void +int CRYPTO_mem_leaks_fp(FILE *fp) { - return; + return -1; } -void +int CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb) { - return; + return -1; } diff --git a/crypto/modes/gcm128.c b/crypto/modes/gcm128.c index 69b1dd4f..74362e6a 100644 --- a/crypto/modes/gcm128.c +++ b/crypto/modes/gcm128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gcm128.c,v 1.20 2017/09/03 13:07:34 inoguchi Exp $ */ +/* $OpenBSD: gcm128.c,v 1.22 2018/01/24 23:03:37 kettenis Exp $ */ /* ==================================================================== * Copyright (c) 2010 The OpenSSL Project. All rights reserved. * @@ -661,7 +661,7 @@ void gcm_ghash_4bit_x86(u64 Xi[2],const u128 Htable[16],const u8 *inp,size_t len # endif # elif defined(__arm__) || defined(__arm) # include "arm_arch.h" -# if __ARM_ARCH__>=7 +# if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) # define GHASH_ASM_ARM # define GCM_FUNCREF_4BIT void gcm_gmult_neon(u64 Xi[2],const u128 Htable[16]); @@ -1515,13 +1515,15 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag, alen = BSWAP8(alen); clen = BSWAP8(clen); #else - u8 *p = ctx->len.c; + { + u8 *p = ctx->len.c; - ctx->len.u[0] = alen; - ctx->len.u[1] = clen; + ctx->len.u[0] = alen; + ctx->len.u[1] = clen; - alen = (u64)GETU32(p) <<32|GETU32(p+4); - clen = (u64)GETU32(p+8)<<32|GETU32(p+12); + alen = (u64)GETU32(p) <<32|GETU32(p+4); + clen = (u64)GETU32(p+8)<<32|GETU32(p+12); + } #endif #endif diff --git a/crypto/modes/ghash-elf-armv4.S b/crypto/modes/ghash-elf-armv4.S new file mode 100644 index 00000000..af42593d --- /dev/null +++ b/crypto/modes/ghash-elf-armv4.S @@ -0,0 +1,412 @@ +#include "arm_arch.h" + +.text +.syntax unified +.code 32 + +.type rem_4bit,%object +.align 5 +rem_4bit: +.short 0x0000,0x1C20,0x3840,0x2460 +.short 0x7080,0x6CA0,0x48C0,0x54E0 +.short 0xE100,0xFD20,0xD940,0xC560 +.short 0x9180,0x8DA0,0xA9C0,0xB5E0 +.size rem_4bit,.-rem_4bit + +.type rem_4bit_get,%function +rem_4bit_get: + sub r2,pc,#8 + sub r2,r2,#32 @ &rem_4bit + b .Lrem_4bit_got + nop +.size rem_4bit_get,.-rem_4bit_get + +.global gcm_ghash_4bit +.type gcm_ghash_4bit,%function +gcm_ghash_4bit: + sub r12,pc,#8 + add r3,r2,r3 @ r3 to point at the end + stmdb sp!,{r3-r11,lr} @ save r3/end too + sub r12,r12,#48 @ &rem_4bit + + ldmia r12,{r4-r11} @ copy rem_4bit ... + stmdb sp!,{r4-r11} @ ... to stack + + ldrb r12,[r2,#15] + ldrb r14,[r0,#15] +.Louter: + eor r12,r12,r14 + and r14,r12,#0xf0 + and r12,r12,#0x0f + mov r3,#14 + + add r7,r1,r12,lsl#4 + ldmia r7,{r4-r7} @ load Htbl[nlo] + add r11,r1,r14 + ldrb r12,[r2,#14] + + and r14,r4,#0xf @ rem + ldmia r11,{r8-r11} @ load Htbl[nhi] + add r14,r14,r14 + eor r4,r8,r4,lsr#4 + ldrh r8,[sp,r14] @ rem_4bit[rem] + eor r4,r4,r5,lsl#28 + ldrb r14,[r0,#14] + eor r5,r9,r5,lsr#4 + eor r5,r5,r6,lsl#28 + eor r6,r10,r6,lsr#4 + eor r6,r6,r7,lsl#28 + eor r7,r11,r7,lsr#4 + eor r12,r12,r14 + and r14,r12,#0xf0 + and r12,r12,#0x0f + eor r7,r7,r8,lsl#16 + +.Linner: + add r11,r1,r12,lsl#4 + and r12,r4,#0xf @ rem + subs r3,r3,#1 + add r12,r12,r12 + ldmia r11,{r8-r11} @ load Htbl[nlo] + eor r4,r8,r4,lsr#4 + eor r4,r4,r5,lsl#28 + eor r5,r9,r5,lsr#4 + eor r5,r5,r6,lsl#28 + ldrh r8,[sp,r12] @ rem_4bit[rem] + eor r6,r10,r6,lsr#4 + ldrbpl r12,[r2,r3] + eor r6,r6,r7,lsl#28 + eor r7,r11,r7,lsr#4 + + add r11,r1,r14 + and r14,r4,#0xf @ rem + eor r7,r7,r8,lsl#16 @ ^= rem_4bit[rem] + add r14,r14,r14 + ldmia r11,{r8-r11} @ load Htbl[nhi] + eor r4,r8,r4,lsr#4 + ldrbpl r8,[r0,r3] + eor r4,r4,r5,lsl#28 + eor r5,r9,r5,lsr#4 + ldrh r9,[sp,r14] + eor r5,r5,r6,lsl#28 + eor r6,r10,r6,lsr#4 + eor r6,r6,r7,lsl#28 + eorpl r12,r12,r8 + eor r7,r11,r7,lsr#4 + andpl r14,r12,#0xf0 + andpl r12,r12,#0x0f + eor r7,r7,r9,lsl#16 @ ^= rem_4bit[rem] + bpl .Linner + + ldr r3,[sp,#32] @ re-load r3/end + add r2,r2,#16 + mov r14,r4 +#if __ARM_ARCH__>=7 && defined(__ARMEL__) + rev r4,r4 + str r4,[r0,#12] +#elif defined(__ARMEB__) + str r4,[r0,#12] +#else + mov r9,r4,lsr#8 + strb r4,[r0,#12+3] + mov r10,r4,lsr#16 + strb r9,[r0,#12+2] + mov r11,r4,lsr#24 + strb r10,[r0,#12+1] + strb r11,[r0,#12] +#endif + cmp r2,r3 +#if __ARM_ARCH__>=7 && defined(__ARMEL__) + rev r5,r5 + str r5,[r0,#8] +#elif defined(__ARMEB__) + str r5,[r0,#8] +#else + mov r9,r5,lsr#8 + strb r5,[r0,#8+3] + mov r10,r5,lsr#16 + strb r9,[r0,#8+2] + mov r11,r5,lsr#24 + strb r10,[r0,#8+1] + strb r11,[r0,#8] +#endif + ldrbne r12,[r2,#15] +#if __ARM_ARCH__>=7 && defined(__ARMEL__) + rev r6,r6 + str r6,[r0,#4] +#elif defined(__ARMEB__) + str r6,[r0,#4] +#else + mov r9,r6,lsr#8 + strb r6,[r0,#4+3] + mov r10,r6,lsr#16 + strb r9,[r0,#4+2] + mov r11,r6,lsr#24 + strb r10,[r0,#4+1] + strb r11,[r0,#4] +#endif + +#if __ARM_ARCH__>=7 && defined(__ARMEL__) + rev r7,r7 + str r7,[r0,#0] +#elif defined(__ARMEB__) + str r7,[r0,#0] +#else + mov r9,r7,lsr#8 + strb r7,[r0,#0+3] + mov r10,r7,lsr#16 + strb r9,[r0,#0+2] + mov r11,r7,lsr#24 + strb r10,[r0,#0+1] + strb r11,[r0,#0] +#endif + + bne .Louter + + add sp,sp,#36 +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r11,pc} +#else + ldmia sp!,{r4-r11,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.size gcm_ghash_4bit,.-gcm_ghash_4bit + +.global gcm_gmult_4bit +.type gcm_gmult_4bit,%function +gcm_gmult_4bit: + stmdb sp!,{r4-r11,lr} + ldrb r12,[r0,#15] + b rem_4bit_get +.Lrem_4bit_got: + and r14,r12,#0xf0 + and r12,r12,#0x0f + mov r3,#14 + + add r7,r1,r12,lsl#4 + ldmia r7,{r4-r7} @ load Htbl[nlo] + ldrb r12,[r0,#14] + + add r11,r1,r14 + and r14,r4,#0xf @ rem + ldmia r11,{r8-r11} @ load Htbl[nhi] + add r14,r14,r14 + eor r4,r8,r4,lsr#4 + ldrh r8,[r2,r14] @ rem_4bit[rem] + eor r4,r4,r5,lsl#28 + eor r5,r9,r5,lsr#4 + eor r5,r5,r6,lsl#28 + eor r6,r10,r6,lsr#4 + eor r6,r6,r7,lsl#28 + eor r7,r11,r7,lsr#4 + and r14,r12,#0xf0 + eor r7,r7,r8,lsl#16 + and r12,r12,#0x0f + +.Loop: + add r11,r1,r12,lsl#4 + and r12,r4,#0xf @ rem + subs r3,r3,#1 + add r12,r12,r12 + ldmia r11,{r8-r11} @ load Htbl[nlo] + eor r4,r8,r4,lsr#4 + eor r4,r4,r5,lsl#28 + eor r5,r9,r5,lsr#4 + eor r5,r5,r6,lsl#28 + ldrh r8,[r2,r12] @ rem_4bit[rem] + eor r6,r10,r6,lsr#4 + ldrbpl r12,[r0,r3] + eor r6,r6,r7,lsl#28 + eor r7,r11,r7,lsr#4 + + add r11,r1,r14 + and r14,r4,#0xf @ rem + eor r7,r7,r8,lsl#16 @ ^= rem_4bit[rem] + add r14,r14,r14 + ldmia r11,{r8-r11} @ load Htbl[nhi] + eor r4,r8,r4,lsr#4 + eor r4,r4,r5,lsl#28 + eor r5,r9,r5,lsr#4 + ldrh r8,[r2,r14] @ rem_4bit[rem] + eor r5,r5,r6,lsl#28 + eor r6,r10,r6,lsr#4 + eor r6,r6,r7,lsl#28 + eor r7,r11,r7,lsr#4 + andpl r14,r12,#0xf0 + andpl r12,r12,#0x0f + eor r7,r7,r8,lsl#16 @ ^= rem_4bit[rem] + bpl .Loop +#if __ARM_ARCH__>=7 && defined(__ARMEL__) + rev r4,r4 + str r4,[r0,#12] +#elif defined(__ARMEB__) + str r4,[r0,#12] +#else + mov r9,r4,lsr#8 + strb r4,[r0,#12+3] + mov r10,r4,lsr#16 + strb r9,[r0,#12+2] + mov r11,r4,lsr#24 + strb r10,[r0,#12+1] + strb r11,[r0,#12] +#endif + +#if __ARM_ARCH__>=7 && defined(__ARMEL__) + rev r5,r5 + str r5,[r0,#8] +#elif defined(__ARMEB__) + str r5,[r0,#8] +#else + mov r9,r5,lsr#8 + strb r5,[r0,#8+3] + mov r10,r5,lsr#16 + strb r9,[r0,#8+2] + mov r11,r5,lsr#24 + strb r10,[r0,#8+1] + strb r11,[r0,#8] +#endif + +#if __ARM_ARCH__>=7 && defined(__ARMEL__) + rev r6,r6 + str r6,[r0,#4] +#elif defined(__ARMEB__) + str r6,[r0,#4] +#else + mov r9,r6,lsr#8 + strb r6,[r0,#4+3] + mov r10,r6,lsr#16 + strb r9,[r0,#4+2] + mov r11,r6,lsr#24 + strb r10,[r0,#4+1] + strb r11,[r0,#4] +#endif + +#if __ARM_ARCH__>=7 && defined(__ARMEL__) + rev r7,r7 + str r7,[r0,#0] +#elif defined(__ARMEB__) + str r7,[r0,#0] +#else + mov r9,r7,lsr#8 + strb r7,[r0,#0+3] + mov r10,r7,lsr#16 + strb r9,[r0,#0+2] + mov r11,r7,lsr#24 + strb r10,[r0,#0+1] + strb r11,[r0,#0] +#endif + +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r11,pc} +#else + ldmia sp!,{r4-r11,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.size gcm_gmult_4bit,.-gcm_gmult_4bit +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) +.fpu neon + +.global gcm_gmult_neon +.type gcm_gmult_neon,%function +.align 4 +gcm_gmult_neon: + sub r1,#16 @ point at H in GCM128_CTX + vld1.64 d29,[r0,:64]!@ load Xi + vmov.i32 d5,#0xe1 @ our irreducible polynomial + vld1.64 d28,[r0,:64]! + vshr.u64 d5,#32 + vldmia r1,{d0-d1} @ load H + veor q12,q12 +#ifdef __ARMEL__ + vrev64.8 q14,q14 +#endif + veor q13,q13 + veor q11,q11 + mov r1,#16 + veor q10,q10 + mov r3,#16 + veor d2,d2 + vdup.8 d4,d28[0] @ broadcast lowest byte + b .Linner_neon +.size gcm_gmult_neon,.-gcm_gmult_neon + +.global gcm_ghash_neon +.type gcm_ghash_neon,%function +.align 4 +gcm_ghash_neon: + vld1.64 d21,[r0,:64]! @ load Xi + vmov.i32 d5,#0xe1 @ our irreducible polynomial + vld1.64 d20,[r0,:64]! + vshr.u64 d5,#32 + vldmia r0,{d0-d1} @ load H + veor q12,q12 + nop +#ifdef __ARMEL__ + vrev64.8 q10,q10 +#endif +.Louter_neon: + vld1.64 d29,[r2]! @ load inp + veor q13,q13 + vld1.64 d28,[r2]! + veor q11,q11 + mov r1,#16 +#ifdef __ARMEL__ + vrev64.8 q14,q14 +#endif + veor d2,d2 + veor q14,q10 @ inp^=Xi + veor q10,q10 + vdup.8 d4,d28[0] @ broadcast lowest byte +.Linner_neon: + subs r1,r1,#1 + vmull.p8 q9,d1,d4 @ H.lo·Xi[i] + vmull.p8 q8,d0,d4 @ H.hi·Xi[i] + vext.8 q14,q12,#1 @ IN>>=8 + + veor q10,q13 @ modulo-scheduled part + vshl.i64 d22,#48 + vdup.8 d4,d28[0] @ broadcast lowest byte + veor d3,d18,d20 + + veor d21,d22 + vuzp.8 q9,q8 + vsli.8 d2,d3,#1 @ compose the "carry" byte + vext.8 q10,q12,#1 @ Z>>=8 + + vmull.p8 q11,d2,d5 @ "carry"·0xe1 + vshr.u8 d2,d3,#7 @ save Z's bottom bit + vext.8 q13,q9,q12,#1 @ Qlo>>=8 + veor q10,q8 + bne .Linner_neon + + veor q10,q13 @ modulo-scheduled artefact + vshl.i64 d22,#48 + veor d21,d22 + + @ finalization, normalize Z:Zo + vand d2,d5 @ suffices to mask the bit + vshr.u64 d3,d20,#63 + vshl.i64 q10,#1 + subs r3,#16 + vorr q10,q1 @ Z=Z:Zo<<1 + bne .Louter_neon + +#ifdef __ARMEL__ + vrev64.8 q10,q10 +#endif + sub r0,#16 + vst1.64 d21,[r0,:64]! @ write out Xi + vst1.64 d20,[r0,:64] + + .word 0xe12fff1e +.size gcm_ghash_neon,.-gcm_ghash_neon +#endif +.asciz "GHASH for ARMv4/NEON, CRYPTOGAMS by " +.align 2 +#if defined(HAVE_GNU_STACK) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/crypto/modes/ghash-elf-x86_64.S b/crypto/modes/ghash-elf-x86_64.S index 1ca097ea..5f316261 100644 --- a/crypto/modes/ghash-elf-x86_64.S +++ b/crypto/modes/ghash-elf-x86_64.S @@ -87,7 +87,7 @@ gcm_gmult_4bit: movq 16(%rsp),%rbx leaq 24(%rsp),%rsp .Lgmult_epilogue: - .byte 0xf3,0xc3 + retq .size gcm_gmult_4bit,.-gcm_gmult_4bit .globl gcm_ghash_4bit .type gcm_ghash_4bit,@function @@ -653,7 +653,7 @@ gcm_ghash_4bit: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lghash_epilogue: - .byte 0xf3,0xc3 + retq .size gcm_ghash_4bit,.-gcm_ghash_4bit .globl gcm_init_clmul .type gcm_init_clmul,@function @@ -718,7 +718,7 @@ gcm_init_clmul: pxor %xmm4,%xmm0 movdqu %xmm2,(%rdi) movdqu %xmm0,16(%rdi) - .byte 0xf3,0xc3 + retq .size gcm_init_clmul,.-gcm_init_clmul .globl gcm_gmult_clmul .type gcm_gmult_clmul,@function @@ -768,7 +768,7 @@ gcm_gmult_clmul: pxor %xmm4,%xmm0 .byte 102,15,56,0,197 movdqu %xmm0,(%rdi) - .byte 0xf3,0xc3 + retq .size gcm_gmult_clmul,.-gcm_gmult_clmul .globl gcm_ghash_clmul .type gcm_ghash_clmul,@function @@ -973,7 +973,7 @@ gcm_ghash_clmul: .Ldone: .byte 102,15,56,0,197 movdqu %xmm0,(%rdi) - .byte 0xf3,0xc3 + retq .LSEH_end_gcm_ghash_clmul: .size gcm_ghash_clmul,.-gcm_ghash_clmul .align 64 diff --git a/crypto/modes/ghash-macosx-x86_64.S b/crypto/modes/ghash-macosx-x86_64.S index 16cc8286..e6840a78 100644 --- a/crypto/modes/ghash-macosx-x86_64.S +++ b/crypto/modes/ghash-macosx-x86_64.S @@ -87,7 +87,7 @@ L$break1: movq 16(%rsp),%rbx leaq 24(%rsp),%rsp L$gmult_epilogue: - .byte 0xf3,0xc3 + retq .globl _gcm_ghash_4bit @@ -653,7 +653,7 @@ L$outer_loop: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$ghash_epilogue: - .byte 0xf3,0xc3 + retq .globl _gcm_init_clmul @@ -718,7 +718,7 @@ _gcm_init_clmul: pxor %xmm4,%xmm0 movdqu %xmm2,(%rdi) movdqu %xmm0,16(%rdi) - .byte 0xf3,0xc3 + retq .globl _gcm_gmult_clmul @@ -768,7 +768,7 @@ _gcm_gmult_clmul: pxor %xmm4,%xmm0 .byte 102,15,56,0,197 movdqu %xmm0,(%rdi) - .byte 0xf3,0xc3 + retq .globl _gcm_ghash_clmul @@ -973,7 +973,7 @@ L$odd_tail: L$done: .byte 102,15,56,0,197 movdqu %xmm0,(%rdi) - .byte 0xf3,0xc3 + retq L$SEH_end_gcm_ghash_clmul: .p2align 6 diff --git a/crypto/modes/ghash-masm-x86_64.S b/crypto/modes/ghash-masm-x86_64.S new file mode 100644 index 00000000..3affa3d4 --- /dev/null +++ b/crypto/modes/ghash-masm-x86_64.S @@ -0,0 +1,1188 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + +PUBLIC gcm_gmult_4bit + +ALIGN 16 +gcm_gmult_4bit PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_gcm_gmult_4bit:: + mov rdi,rcx + mov rsi,rdx + + + push rbx + push rbp + push r12 +$L$gmult_prologue:: + + movzx r8,BYTE PTR[15+rdi] + lea r11,QWORD PTR[$L$rem_4bit] + xor rax,rax + xor rbx,rbx + mov al,r8b + mov bl,r8b + shl al,4 + mov rcx,14 + mov r8,QWORD PTR[8+rax*1+rsi] + mov r9,QWORD PTR[rax*1+rsi] + and bl,0f0h + mov rdx,r8 + jmp $L$oop1 + +ALIGN 16 +$L$oop1:: + shr r8,4 + and rdx,0fh + mov r10,r9 + mov al,BYTE PTR[rcx*1+rdi] + shr r9,4 + xor r8,QWORD PTR[8+rbx*1+rsi] + shl r10,60 + xor r9,QWORD PTR[rbx*1+rsi] + mov bl,al + xor r9,QWORD PTR[rdx*8+r11] + mov rdx,r8 + shl al,4 + xor r8,r10 + dec rcx + js $L$break1 + + shr r8,4 + and rdx,0fh + mov r10,r9 + shr r9,4 + xor r8,QWORD PTR[8+rax*1+rsi] + shl r10,60 + xor r9,QWORD PTR[rax*1+rsi] + and bl,0f0h + xor r9,QWORD PTR[rdx*8+r11] + mov rdx,r8 + xor r8,r10 + jmp $L$oop1 + +ALIGN 16 +$L$break1:: + shr r8,4 + and rdx,0fh + mov r10,r9 + shr r9,4 + xor r8,QWORD PTR[8+rax*1+rsi] + shl r10,60 + xor r9,QWORD PTR[rax*1+rsi] + and bl,0f0h + xor r9,QWORD PTR[rdx*8+r11] + mov rdx,r8 + xor r8,r10 + + shr r8,4 + and rdx,0fh + mov r10,r9 + shr r9,4 + xor r8,QWORD PTR[8+rbx*1+rsi] + shl r10,60 + xor r9,QWORD PTR[rbx*1+rsi] + xor r8,r10 + xor r9,QWORD PTR[rdx*8+r11] + + bswap r8 + bswap r9 + mov QWORD PTR[8+rdi],r8 + mov QWORD PTR[rdi],r9 + + mov rbx,QWORD PTR[16+rsp] + lea rsp,QWORD PTR[24+rsp] +$L$gmult_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_gcm_gmult_4bit:: +gcm_gmult_4bit ENDP +PUBLIC gcm_ghash_4bit + +ALIGN 16 +gcm_ghash_4bit PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_gcm_ghash_4bit:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + + + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + sub rsp,280 +$L$ghash_prologue:: + mov r14,rdx + mov r15,rcx + sub rsi,-128 + lea rbp,QWORD PTR[((16+128))+rsp] + xor edx,edx + mov r8,QWORD PTR[((0+0-128))+rsi] + mov rax,QWORD PTR[((0+8-128))+rsi] + mov dl,al + shr rax,4 + mov r10,r8 + shr r8,4 + mov r9,QWORD PTR[((16+0-128))+rsi] + shl dl,4 + mov rbx,QWORD PTR[((16+8-128))+rsi] + shl r10,60 + mov BYTE PTR[rsp],dl + or rax,r10 + mov dl,bl + shr rbx,4 + mov r10,r9 + shr r9,4 + mov QWORD PTR[rbp],r8 + mov r8,QWORD PTR[((32+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((0-128))+rbp],rax + mov rax,QWORD PTR[((32+8-128))+rsi] + shl r10,60 + mov BYTE PTR[1+rsp],dl + or rbx,r10 + mov dl,al + shr rax,4 + mov r10,r8 + shr r8,4 + mov QWORD PTR[8+rbp],r9 + mov r9,QWORD PTR[((48+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((8-128))+rbp],rbx + mov rbx,QWORD PTR[((48+8-128))+rsi] + shl r10,60 + mov BYTE PTR[2+rsp],dl + or rax,r10 + mov dl,bl + shr rbx,4 + mov r10,r9 + shr r9,4 + mov QWORD PTR[16+rbp],r8 + mov r8,QWORD PTR[((64+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((16-128))+rbp],rax + mov rax,QWORD PTR[((64+8-128))+rsi] + shl r10,60 + mov BYTE PTR[3+rsp],dl + or rbx,r10 + mov dl,al + shr rax,4 + mov r10,r8 + shr r8,4 + mov QWORD PTR[24+rbp],r9 + mov r9,QWORD PTR[((80+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((24-128))+rbp],rbx + mov rbx,QWORD PTR[((80+8-128))+rsi] + shl r10,60 + mov BYTE PTR[4+rsp],dl + or rax,r10 + mov dl,bl + shr rbx,4 + mov r10,r9 + shr r9,4 + mov QWORD PTR[32+rbp],r8 + mov r8,QWORD PTR[((96+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((32-128))+rbp],rax + mov rax,QWORD PTR[((96+8-128))+rsi] + shl r10,60 + mov BYTE PTR[5+rsp],dl + or rbx,r10 + mov dl,al + shr rax,4 + mov r10,r8 + shr r8,4 + mov QWORD PTR[40+rbp],r9 + mov r9,QWORD PTR[((112+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((40-128))+rbp],rbx + mov rbx,QWORD PTR[((112+8-128))+rsi] + shl r10,60 + mov BYTE PTR[6+rsp],dl + or rax,r10 + mov dl,bl + shr rbx,4 + mov r10,r9 + shr r9,4 + mov QWORD PTR[48+rbp],r8 + mov r8,QWORD PTR[((128+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((48-128))+rbp],rax + mov rax,QWORD PTR[((128+8-128))+rsi] + shl r10,60 + mov BYTE PTR[7+rsp],dl + or rbx,r10 + mov dl,al + shr rax,4 + mov r10,r8 + shr r8,4 + mov QWORD PTR[56+rbp],r9 + mov r9,QWORD PTR[((144+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((56-128))+rbp],rbx + mov rbx,QWORD PTR[((144+8-128))+rsi] + shl r10,60 + mov BYTE PTR[8+rsp],dl + or rax,r10 + mov dl,bl + shr rbx,4 + mov r10,r9 + shr r9,4 + mov QWORD PTR[64+rbp],r8 + mov r8,QWORD PTR[((160+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((64-128))+rbp],rax + mov rax,QWORD PTR[((160+8-128))+rsi] + shl r10,60 + mov BYTE PTR[9+rsp],dl + or rbx,r10 + mov dl,al + shr rax,4 + mov r10,r8 + shr r8,4 + mov QWORD PTR[72+rbp],r9 + mov r9,QWORD PTR[((176+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((72-128))+rbp],rbx + mov rbx,QWORD PTR[((176+8-128))+rsi] + shl r10,60 + mov BYTE PTR[10+rsp],dl + or rax,r10 + mov dl,bl + shr rbx,4 + mov r10,r9 + shr r9,4 + mov QWORD PTR[80+rbp],r8 + mov r8,QWORD PTR[((192+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((80-128))+rbp],rax + mov rax,QWORD PTR[((192+8-128))+rsi] + shl r10,60 + mov BYTE PTR[11+rsp],dl + or rbx,r10 + mov dl,al + shr rax,4 + mov r10,r8 + shr r8,4 + mov QWORD PTR[88+rbp],r9 + mov r9,QWORD PTR[((208+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((88-128))+rbp],rbx + mov rbx,QWORD PTR[((208+8-128))+rsi] + shl r10,60 + mov BYTE PTR[12+rsp],dl + or rax,r10 + mov dl,bl + shr rbx,4 + mov r10,r9 + shr r9,4 + mov QWORD PTR[96+rbp],r8 + mov r8,QWORD PTR[((224+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((96-128))+rbp],rax + mov rax,QWORD PTR[((224+8-128))+rsi] + shl r10,60 + mov BYTE PTR[13+rsp],dl + or rbx,r10 + mov dl,al + shr rax,4 + mov r10,r8 + shr r8,4 + mov QWORD PTR[104+rbp],r9 + mov r9,QWORD PTR[((240+0-128))+rsi] + shl dl,4 + mov QWORD PTR[((104-128))+rbp],rbx + mov rbx,QWORD PTR[((240+8-128))+rsi] + shl r10,60 + mov BYTE PTR[14+rsp],dl + or rax,r10 + mov dl,bl + shr rbx,4 + mov r10,r9 + shr r9,4 + mov QWORD PTR[112+rbp],r8 + shl dl,4 + mov QWORD PTR[((112-128))+rbp],rax + shl r10,60 + mov BYTE PTR[15+rsp],dl + or rbx,r10 + mov QWORD PTR[120+rbp],r9 + mov QWORD PTR[((120-128))+rbp],rbx + add rsi,-128 + mov r8,QWORD PTR[8+rdi] + mov r9,QWORD PTR[rdi] + add r15,r14 + lea r11,QWORD PTR[$L$rem_8bit] + jmp $L$outer_loop +ALIGN 16 +$L$outer_loop:: + xor r9,QWORD PTR[r14] + mov rdx,QWORD PTR[8+r14] + lea r14,QWORD PTR[16+r14] + xor rdx,r8 + mov QWORD PTR[rdi],r9 + mov QWORD PTR[8+rdi],rdx + shr rdx,32 + xor rax,rax + rol edx,8 + mov al,dl + movzx ebx,dl + shl al,4 + shr ebx,4 + rol edx,8 + mov r8,QWORD PTR[8+rax*1+rsi] + mov r9,QWORD PTR[rax*1+rsi] + mov al,dl + movzx ecx,dl + shl al,4 + movzx r12,BYTE PTR[rbx*1+rsp] + shr ecx,4 + xor r12,r8 + mov r10,r9 + shr r8,8 + movzx r12,r12b + shr r9,8 + xor r8,QWORD PTR[((-128))+rbx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rbx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r12,WORD PTR[r12*2+r11] + movzx ebx,dl + shl al,4 + movzx r13,BYTE PTR[rcx*1+rsp] + shr ebx,4 + shl r12,48 + xor r13,r8 + mov r10,r9 + xor r9,r12 + shr r8,8 + movzx r13,r13b + shr r9,8 + xor r8,QWORD PTR[((-128))+rcx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rcx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r13,WORD PTR[r13*2+r11] + movzx ecx,dl + shl al,4 + movzx r12,BYTE PTR[rbx*1+rsp] + shr ecx,4 + shl r13,48 + xor r12,r8 + mov r10,r9 + xor r9,r13 + shr r8,8 + movzx r12,r12b + mov edx,DWORD PTR[8+rdi] + shr r9,8 + xor r8,QWORD PTR[((-128))+rbx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rbx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r12,WORD PTR[r12*2+r11] + movzx ebx,dl + shl al,4 + movzx r13,BYTE PTR[rcx*1+rsp] + shr ebx,4 + shl r12,48 + xor r13,r8 + mov r10,r9 + xor r9,r12 + shr r8,8 + movzx r13,r13b + shr r9,8 + xor r8,QWORD PTR[((-128))+rcx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rcx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r13,WORD PTR[r13*2+r11] + movzx ecx,dl + shl al,4 + movzx r12,BYTE PTR[rbx*1+rsp] + shr ecx,4 + shl r13,48 + xor r12,r8 + mov r10,r9 + xor r9,r13 + shr r8,8 + movzx r12,r12b + shr r9,8 + xor r8,QWORD PTR[((-128))+rbx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rbx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r12,WORD PTR[r12*2+r11] + movzx ebx,dl + shl al,4 + movzx r13,BYTE PTR[rcx*1+rsp] + shr ebx,4 + shl r12,48 + xor r13,r8 + mov r10,r9 + xor r9,r12 + shr r8,8 + movzx r13,r13b + shr r9,8 + xor r8,QWORD PTR[((-128))+rcx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rcx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r13,WORD PTR[r13*2+r11] + movzx ecx,dl + shl al,4 + movzx r12,BYTE PTR[rbx*1+rsp] + shr ecx,4 + shl r13,48 + xor r12,r8 + mov r10,r9 + xor r9,r13 + shr r8,8 + movzx r12,r12b + mov edx,DWORD PTR[4+rdi] + shr r9,8 + xor r8,QWORD PTR[((-128))+rbx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rbx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r12,WORD PTR[r12*2+r11] + movzx ebx,dl + shl al,4 + movzx r13,BYTE PTR[rcx*1+rsp] + shr ebx,4 + shl r12,48 + xor r13,r8 + mov r10,r9 + xor r9,r12 + shr r8,8 + movzx r13,r13b + shr r9,8 + xor r8,QWORD PTR[((-128))+rcx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rcx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r13,WORD PTR[r13*2+r11] + movzx ecx,dl + shl al,4 + movzx r12,BYTE PTR[rbx*1+rsp] + shr ecx,4 + shl r13,48 + xor r12,r8 + mov r10,r9 + xor r9,r13 + shr r8,8 + movzx r12,r12b + shr r9,8 + xor r8,QWORD PTR[((-128))+rbx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rbx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r12,WORD PTR[r12*2+r11] + movzx ebx,dl + shl al,4 + movzx r13,BYTE PTR[rcx*1+rsp] + shr ebx,4 + shl r12,48 + xor r13,r8 + mov r10,r9 + xor r9,r12 + shr r8,8 + movzx r13,r13b + shr r9,8 + xor r8,QWORD PTR[((-128))+rcx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rcx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r13,WORD PTR[r13*2+r11] + movzx ecx,dl + shl al,4 + movzx r12,BYTE PTR[rbx*1+rsp] + shr ecx,4 + shl r13,48 + xor r12,r8 + mov r10,r9 + xor r9,r13 + shr r8,8 + movzx r12,r12b + mov edx,DWORD PTR[rdi] + shr r9,8 + xor r8,QWORD PTR[((-128))+rbx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rbx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r12,WORD PTR[r12*2+r11] + movzx ebx,dl + shl al,4 + movzx r13,BYTE PTR[rcx*1+rsp] + shr ebx,4 + shl r12,48 + xor r13,r8 + mov r10,r9 + xor r9,r12 + shr r8,8 + movzx r13,r13b + shr r9,8 + xor r8,QWORD PTR[((-128))+rcx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rcx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r13,WORD PTR[r13*2+r11] + movzx ecx,dl + shl al,4 + movzx r12,BYTE PTR[rbx*1+rsp] + shr ecx,4 + shl r13,48 + xor r12,r8 + mov r10,r9 + xor r9,r13 + shr r8,8 + movzx r12,r12b + shr r9,8 + xor r8,QWORD PTR[((-128))+rbx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rbx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r12,WORD PTR[r12*2+r11] + movzx ebx,dl + shl al,4 + movzx r13,BYTE PTR[rcx*1+rsp] + shr ebx,4 + shl r12,48 + xor r13,r8 + mov r10,r9 + xor r9,r12 + shr r8,8 + movzx r13,r13b + shr r9,8 + xor r8,QWORD PTR[((-128))+rcx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rcx*8+rbp] + rol edx,8 + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + mov al,dl + xor r8,r10 + movzx r13,WORD PTR[r13*2+r11] + movzx ecx,dl + shl al,4 + movzx r12,BYTE PTR[rbx*1+rsp] + and ecx,240 + shl r13,48 + xor r12,r8 + mov r10,r9 + xor r9,r13 + shr r8,8 + movzx r12,r12b + mov edx,DWORD PTR[((-4))+rdi] + shr r9,8 + xor r8,QWORD PTR[((-128))+rbx*8+rbp] + shl r10,56 + xor r9,QWORD PTR[rbx*8+rbp] + movzx r12,WORD PTR[r12*2+r11] + xor r8,QWORD PTR[8+rax*1+rsi] + xor r9,QWORD PTR[rax*1+rsi] + shl r12,48 + xor r8,r10 + xor r9,r12 + movzx r13,r8b + shr r8,4 + mov r10,r9 + shl r13b,4 + shr r9,4 + xor r8,QWORD PTR[8+rcx*1+rsi] + movzx r13,WORD PTR[r13*2+r11] + shl r10,60 + xor r9,QWORD PTR[rcx*1+rsi] + xor r8,r10 + shl r13,48 + bswap r8 + xor r9,r13 + bswap r9 + cmp r14,r15 + jb $L$outer_loop + mov QWORD PTR[8+rdi],r8 + mov QWORD PTR[rdi],r9 + + lea rsi,QWORD PTR[280+rsp] + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$ghash_epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_gcm_ghash_4bit:: +gcm_ghash_4bit ENDP +PUBLIC gcm_init_clmul + +ALIGN 16 +gcm_init_clmul PROC PUBLIC + movdqu xmm2,XMMWORD PTR[rdx] + pshufd xmm2,xmm2,78 + + + pshufd xmm4,xmm2,255 + movdqa xmm3,xmm2 + psllq xmm2,1 + pxor xmm5,xmm5 + psrlq xmm3,63 + pcmpgtd xmm5,xmm4 + pslldq xmm3,8 + por xmm2,xmm3 + + + pand xmm5,XMMWORD PTR[$L$0x1c2_polynomial] + pxor xmm2,xmm5 + + + movdqa xmm0,xmm2 + movdqa xmm1,xmm0 + pshufd xmm3,xmm0,78 + pshufd xmm4,xmm2,78 + pxor xmm3,xmm0 + pxor xmm4,xmm2 +DB 102,15,58,68,194,0 +DB 102,15,58,68,202,17 +DB 102,15,58,68,220,0 + pxor xmm3,xmm0 + pxor xmm3,xmm1 + + movdqa xmm4,xmm3 + psrldq xmm3,8 + pslldq xmm4,8 + pxor xmm1,xmm3 + pxor xmm0,xmm4 + + movdqa xmm3,xmm0 + psllq xmm0,1 + pxor xmm0,xmm3 + psllq xmm0,5 + pxor xmm0,xmm3 + psllq xmm0,57 + movdqa xmm4,xmm0 + pslldq xmm0,8 + psrldq xmm4,8 + pxor xmm0,xmm3 + pxor xmm1,xmm4 + + + movdqa xmm4,xmm0 + psrlq xmm0,5 + pxor xmm0,xmm4 + psrlq xmm0,1 + pxor xmm0,xmm4 + pxor xmm4,xmm1 + psrlq xmm0,1 + pxor xmm0,xmm4 + movdqu XMMWORD PTR[rcx],xmm2 + movdqu XMMWORD PTR[16+rcx],xmm0 + DB 0F3h,0C3h ;repret +gcm_init_clmul ENDP +PUBLIC gcm_gmult_clmul + +ALIGN 16 +gcm_gmult_clmul PROC PUBLIC + movdqu xmm0,XMMWORD PTR[rcx] + movdqa xmm5,XMMWORD PTR[$L$bswap_mask] + movdqu xmm2,XMMWORD PTR[rdx] +DB 102,15,56,0,197 + movdqa xmm1,xmm0 + pshufd xmm3,xmm0,78 + pshufd xmm4,xmm2,78 + pxor xmm3,xmm0 + pxor xmm4,xmm2 +DB 102,15,58,68,194,0 +DB 102,15,58,68,202,17 +DB 102,15,58,68,220,0 + pxor xmm3,xmm0 + pxor xmm3,xmm1 + + movdqa xmm4,xmm3 + psrldq xmm3,8 + pslldq xmm4,8 + pxor xmm1,xmm3 + pxor xmm0,xmm4 + + movdqa xmm3,xmm0 + psllq xmm0,1 + pxor xmm0,xmm3 + psllq xmm0,5 + pxor xmm0,xmm3 + psllq xmm0,57 + movdqa xmm4,xmm0 + pslldq xmm0,8 + psrldq xmm4,8 + pxor xmm0,xmm3 + pxor xmm1,xmm4 + + + movdqa xmm4,xmm0 + psrlq xmm0,5 + pxor xmm0,xmm4 + psrlq xmm0,1 + pxor xmm0,xmm4 + pxor xmm4,xmm1 + psrlq xmm0,1 + pxor xmm0,xmm4 +DB 102,15,56,0,197 + movdqu XMMWORD PTR[rcx],xmm0 + DB 0F3h,0C3h ;repret +gcm_gmult_clmul ENDP +PUBLIC gcm_ghash_clmul + +ALIGN 16 +gcm_ghash_clmul PROC PUBLIC +$L$SEH_begin_gcm_ghash_clmul:: + +DB 048h,083h,0ech,058h +DB 00fh,029h,034h,024h +DB 00fh,029h,07ch,024h,010h +DB 044h,00fh,029h,044h,024h,020h +DB 044h,00fh,029h,04ch,024h,030h +DB 044h,00fh,029h,054h,024h,040h + movdqa xmm5,XMMWORD PTR[$L$bswap_mask] + + movdqu xmm0,XMMWORD PTR[rcx] + movdqu xmm2,XMMWORD PTR[rdx] +DB 102,15,56,0,197 + + sub r9,010h + jz $L$odd_tail + + movdqu xmm8,XMMWORD PTR[16+rdx] + + + + + + movdqu xmm3,XMMWORD PTR[r8] + movdqu xmm6,XMMWORD PTR[16+r8] +DB 102,15,56,0,221 +DB 102,15,56,0,245 + pxor xmm0,xmm3 + movdqa xmm7,xmm6 + pshufd xmm3,xmm6,78 + pshufd xmm4,xmm2,78 + pxor xmm3,xmm6 + pxor xmm4,xmm2 +DB 102,15,58,68,242,0 +DB 102,15,58,68,250,17 +DB 102,15,58,68,220,0 + pxor xmm3,xmm6 + pxor xmm3,xmm7 + + movdqa xmm4,xmm3 + psrldq xmm3,8 + pslldq xmm4,8 + pxor xmm7,xmm3 + pxor xmm6,xmm4 + movdqa xmm1,xmm0 + pshufd xmm3,xmm0,78 + pshufd xmm4,xmm8,78 + pxor xmm3,xmm0 + pxor xmm4,xmm8 + + lea r8,QWORD PTR[32+r8] + sub r9,020h + jbe $L$even_tail + +$L$mod_loop:: +DB 102,65,15,58,68,192,0 +DB 102,65,15,58,68,200,17 +DB 102,15,58,68,220,0 + pxor xmm3,xmm0 + pxor xmm3,xmm1 + + movdqa xmm4,xmm3 + psrldq xmm3,8 + pslldq xmm4,8 + pxor xmm1,xmm3 + pxor xmm0,xmm4 + movdqu xmm3,XMMWORD PTR[r8] + pxor xmm0,xmm6 + pxor xmm1,xmm7 + + movdqu xmm6,XMMWORD PTR[16+r8] +DB 102,15,56,0,221 +DB 102,15,56,0,245 + + movdqa xmm7,xmm6 + pshufd xmm9,xmm6,78 + pshufd xmm10,xmm2,78 + pxor xmm9,xmm6 + pxor xmm10,xmm2 + pxor xmm1,xmm3 + + movdqa xmm3,xmm0 + psllq xmm0,1 + pxor xmm0,xmm3 + psllq xmm0,5 + pxor xmm0,xmm3 +DB 102,15,58,68,242,0 + psllq xmm0,57 + movdqa xmm4,xmm0 + pslldq xmm0,8 + psrldq xmm4,8 + pxor xmm0,xmm3 + pxor xmm1,xmm4 + +DB 102,15,58,68,250,17 + movdqa xmm4,xmm0 + psrlq xmm0,5 + pxor xmm0,xmm4 + psrlq xmm0,1 + pxor xmm0,xmm4 + pxor xmm4,xmm1 + psrlq xmm0,1 + pxor xmm0,xmm4 + +DB 102,69,15,58,68,202,0 + movdqa xmm1,xmm0 + pshufd xmm3,xmm0,78 + pshufd xmm4,xmm8,78 + pxor xmm3,xmm0 + pxor xmm4,xmm8 + + pxor xmm9,xmm6 + pxor xmm9,xmm7 + movdqa xmm10,xmm9 + psrldq xmm9,8 + pslldq xmm10,8 + pxor xmm7,xmm9 + pxor xmm6,xmm10 + + lea r8,QWORD PTR[32+r8] + sub r9,020h + ja $L$mod_loop + +$L$even_tail:: +DB 102,65,15,58,68,192,0 +DB 102,65,15,58,68,200,17 +DB 102,15,58,68,220,0 + pxor xmm3,xmm0 + pxor xmm3,xmm1 + + movdqa xmm4,xmm3 + psrldq xmm3,8 + pslldq xmm4,8 + pxor xmm1,xmm3 + pxor xmm0,xmm4 + pxor xmm0,xmm6 + pxor xmm1,xmm7 + + movdqa xmm3,xmm0 + psllq xmm0,1 + pxor xmm0,xmm3 + psllq xmm0,5 + pxor xmm0,xmm3 + psllq xmm0,57 + movdqa xmm4,xmm0 + pslldq xmm0,8 + psrldq xmm4,8 + pxor xmm0,xmm3 + pxor xmm1,xmm4 + + + movdqa xmm4,xmm0 + psrlq xmm0,5 + pxor xmm0,xmm4 + psrlq xmm0,1 + pxor xmm0,xmm4 + pxor xmm4,xmm1 + psrlq xmm0,1 + pxor xmm0,xmm4 + test r9,r9 + jnz $L$done + +$L$odd_tail:: + movdqu xmm3,XMMWORD PTR[r8] +DB 102,15,56,0,221 + pxor xmm0,xmm3 + movdqa xmm1,xmm0 + pshufd xmm3,xmm0,78 + pshufd xmm4,xmm2,78 + pxor xmm3,xmm0 + pxor xmm4,xmm2 +DB 102,15,58,68,194,0 +DB 102,15,58,68,202,17 +DB 102,15,58,68,220,0 + pxor xmm3,xmm0 + pxor xmm3,xmm1 + + movdqa xmm4,xmm3 + psrldq xmm3,8 + pslldq xmm4,8 + pxor xmm1,xmm3 + pxor xmm0,xmm4 + + movdqa xmm3,xmm0 + psllq xmm0,1 + pxor xmm0,xmm3 + psllq xmm0,5 + pxor xmm0,xmm3 + psllq xmm0,57 + movdqa xmm4,xmm0 + pslldq xmm0,8 + psrldq xmm4,8 + pxor xmm0,xmm3 + pxor xmm1,xmm4 + + + movdqa xmm4,xmm0 + psrlq xmm0,5 + pxor xmm0,xmm4 + psrlq xmm0,1 + pxor xmm0,xmm4 + pxor xmm4,xmm1 + psrlq xmm0,1 + pxor xmm0,xmm4 +$L$done:: +DB 102,15,56,0,197 + movdqu XMMWORD PTR[rcx],xmm0 + movaps xmm6,XMMWORD PTR[rsp] + movaps xmm7,XMMWORD PTR[16+rsp] + movaps xmm8,XMMWORD PTR[32+rsp] + movaps xmm9,XMMWORD PTR[48+rsp] + movaps xmm10,XMMWORD PTR[64+rsp] + add rsp,058h + DB 0F3h,0C3h ;repret +$L$SEH_end_gcm_ghash_clmul:: +gcm_ghash_clmul ENDP +ALIGN 64 +$L$bswap_mask:: +DB 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 +$L$0x1c2_polynomial:: +DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0c2h +ALIGN 64 + +$L$rem_4bit:: + DD 0,0,0,471859200,0,943718400,0,610271232 + DD 0,1887436800,0,1822425088,0,1220542464,0,1423966208 + DD 0,3774873600,0,4246732800,0,3644850176,0,3311403008 + DD 0,2441084928,0,2376073216,0,2847932416,0,3051356160 + +$L$rem_8bit:: + DW 00000h,001C2h,00384h,00246h,00708h,006CAh,0048Ch,0054Eh + DW 00E10h,00FD2h,00D94h,00C56h,00918h,008DAh,00A9Ch,00B5Eh + DW 01C20h,01DE2h,01FA4h,01E66h,01B28h,01AEAh,018ACh,0196Eh + DW 01230h,013F2h,011B4h,01076h,01538h,014FAh,016BCh,0177Eh + DW 03840h,03982h,03BC4h,03A06h,03F48h,03E8Ah,03CCCh,03D0Eh + DW 03650h,03792h,035D4h,03416h,03158h,0309Ah,032DCh,0331Eh + DW 02460h,025A2h,027E4h,02626h,02368h,022AAh,020ECh,0212Eh + DW 02A70h,02BB2h,029F4h,02836h,02D78h,02CBAh,02EFCh,02F3Eh + DW 07080h,07142h,07304h,072C6h,07788h,0764Ah,0740Ch,075CEh + DW 07E90h,07F52h,07D14h,07CD6h,07998h,0785Ah,07A1Ch,07BDEh + DW 06CA0h,06D62h,06F24h,06EE6h,06BA8h,06A6Ah,0682Ch,069EEh + DW 062B0h,06372h,06134h,060F6h,065B8h,0647Ah,0663Ch,067FEh + DW 048C0h,04902h,04B44h,04A86h,04FC8h,04E0Ah,04C4Ch,04D8Eh + DW 046D0h,04712h,04554h,04496h,041D8h,0401Ah,0425Ch,0439Eh + DW 054E0h,05522h,05764h,056A6h,053E8h,0522Ah,0506Ch,051AEh + DW 05AF0h,05B32h,05974h,058B6h,05DF8h,05C3Ah,05E7Ch,05FBEh + DW 0E100h,0E0C2h,0E284h,0E346h,0E608h,0E7CAh,0E58Ch,0E44Eh + DW 0EF10h,0EED2h,0EC94h,0ED56h,0E818h,0E9DAh,0EB9Ch,0EA5Eh + DW 0FD20h,0FCE2h,0FEA4h,0FF66h,0FA28h,0FBEAh,0F9ACh,0F86Eh + DW 0F330h,0F2F2h,0F0B4h,0F176h,0F438h,0F5FAh,0F7BCh,0F67Eh + DW 0D940h,0D882h,0DAC4h,0DB06h,0DE48h,0DF8Ah,0DDCCh,0DC0Eh + DW 0D750h,0D692h,0D4D4h,0D516h,0D058h,0D19Ah,0D3DCh,0D21Eh + DW 0C560h,0C4A2h,0C6E4h,0C726h,0C268h,0C3AAh,0C1ECh,0C02Eh + DW 0CB70h,0CAB2h,0C8F4h,0C936h,0CC78h,0CDBAh,0CFFCh,0CE3Eh + DW 09180h,09042h,09204h,093C6h,09688h,0974Ah,0950Ch,094CEh + DW 09F90h,09E52h,09C14h,09DD6h,09898h,0995Ah,09B1Ch,09ADEh + DW 08DA0h,08C62h,08E24h,08FE6h,08AA8h,08B6Ah,0892Ch,088EEh + DW 083B0h,08272h,08034h,081F6h,084B8h,0857Ah,0873Ch,086FEh + DW 0A9C0h,0A802h,0AA44h,0AB86h,0AEC8h,0AF0Ah,0AD4Ch,0AC8Eh + DW 0A7D0h,0A612h,0A454h,0A596h,0A0D8h,0A11Ah,0A35Ch,0A29Eh + DW 0B5E0h,0B422h,0B664h,0B7A6h,0B2E8h,0B32Ah,0B16Ch,0B0AEh + DW 0BBF0h,0BA32h,0B874h,0B9B6h,0BCF8h,0BD3Ah,0BF7Ch,0BEBEh + +DB 71,72,65,83,72,32,102,111,114,32,120,56,54,95,54,52 +DB 44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32 +DB 60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111 +DB 114,103,62,0 +ALIGN 64 +EXTERN __imp_RtlVirtualUnwind:NEAR + +ALIGN 16 +se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + mov rsi,QWORD PTR[8+r9] + mov r11,QWORD PTR[56+r9] + + mov r10d,DWORD PTR[r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$in_prologue + + mov rax,QWORD PTR[152+r8] + + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jae $L$in_prologue + + lea rax,QWORD PTR[24+rax] + + mov rbx,QWORD PTR[((-8))+rax] + mov rbp,QWORD PTR[((-16))+rax] + mov r12,QWORD PTR[((-24))+rax] + mov QWORD PTR[144+r8],rbx + mov QWORD PTR[160+r8],rbp + mov QWORD PTR[216+r8],r12 + +$L$in_prologue:: + mov rdi,QWORD PTR[8+rax] + mov rsi,QWORD PTR[16+rax] + mov QWORD PTR[152+r8],rax + mov QWORD PTR[168+r8],rsi + mov QWORD PTR[176+r8],rdi + + mov rdi,QWORD PTR[40+r9] + mov rsi,r8 + mov ecx,154 + DD 0a548f3fch + + mov rsi,r9 + xor rcx,rcx + mov rdx,QWORD PTR[8+rsi] + mov r8,QWORD PTR[rsi] + mov r9,QWORD PTR[16+rsi] + mov r10,QWORD PTR[40+rsi] + lea r11,QWORD PTR[56+rsi] + lea r12,QWORD PTR[24+rsi] + mov QWORD PTR[32+rsp],r10 + mov QWORD PTR[40+rsp],r11 + mov QWORD PTR[48+rsp],r12 + mov QWORD PTR[56+rsp],rcx + call QWORD PTR[__imp_RtlVirtualUnwind] + + mov eax,1 + add rsp,64 + popfq + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + pop rbx + pop rdi + pop rsi + DB 0F3h,0C3h ;repret +se_handler ENDP + +.text$ ENDS +.pdata SEGMENT READONLY ALIGN(4) +ALIGN 4 + DD imagerel $L$SEH_begin_gcm_gmult_4bit + DD imagerel $L$SEH_end_gcm_gmult_4bit + DD imagerel $L$SEH_info_gcm_gmult_4bit + + DD imagerel $L$SEH_begin_gcm_ghash_4bit + DD imagerel $L$SEH_end_gcm_ghash_4bit + DD imagerel $L$SEH_info_gcm_ghash_4bit + + DD imagerel $L$SEH_begin_gcm_ghash_clmul + DD imagerel $L$SEH_end_gcm_ghash_clmul + DD imagerel $L$SEH_info_gcm_ghash_clmul + +.pdata ENDS +.xdata SEGMENT READONLY ALIGN(8) +ALIGN 8 +$L$SEH_info_gcm_gmult_4bit:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$gmult_prologue,imagerel $L$gmult_epilogue +$L$SEH_info_gcm_ghash_4bit:: +DB 9,0,0,0 + DD imagerel se_handler + DD imagerel $L$ghash_prologue,imagerel $L$ghash_epilogue +$L$SEH_info_gcm_ghash_clmul:: +DB 001h,01fh,00bh,000h +DB 01fh,0a8h,004h,000h +DB 019h,098h,003h,000h +DB 013h,088h,002h,000h +DB 00dh,078h,001h,000h +DB 008h,068h,000h,000h +DB 004h,0a2h,000h,000h + +.xdata ENDS +END diff --git a/crypto/modes/ghash-mingw64-x86_64.S b/crypto/modes/ghash-mingw64-x86_64.S new file mode 100644 index 00000000..cd0823b4 --- /dev/null +++ b/crypto/modes/ghash-mingw64-x86_64.S @@ -0,0 +1,1175 @@ +#include "x86_arch.h" +.text + +.globl gcm_gmult_4bit +.def gcm_gmult_4bit; .scl 2; .type 32; .endef +.p2align 4 +gcm_gmult_4bit: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_gcm_gmult_4bit: + movq %rcx,%rdi + movq %rdx,%rsi + + pushq %rbx + pushq %rbp + pushq %r12 +.Lgmult_prologue: + + movzbq 15(%rdi),%r8 + leaq .Lrem_4bit(%rip),%r11 + xorq %rax,%rax + xorq %rbx,%rbx + movb %r8b,%al + movb %r8b,%bl + shlb $4,%al + movq $14,%rcx + movq 8(%rsi,%rax,1),%r8 + movq (%rsi,%rax,1),%r9 + andb $240,%bl + movq %r8,%rdx + jmp .Loop1 + +.p2align 4 +.Loop1: + shrq $4,%r8 + andq $15,%rdx + movq %r9,%r10 + movb (%rdi,%rcx,1),%al + shrq $4,%r9 + xorq 8(%rsi,%rbx,1),%r8 + shlq $60,%r10 + xorq (%rsi,%rbx,1),%r9 + movb %al,%bl + xorq (%r11,%rdx,8),%r9 + movq %r8,%rdx + shlb $4,%al + xorq %r10,%r8 + decq %rcx + js .Lbreak1 + + shrq $4,%r8 + andq $15,%rdx + movq %r9,%r10 + shrq $4,%r9 + xorq 8(%rsi,%rax,1),%r8 + shlq $60,%r10 + xorq (%rsi,%rax,1),%r9 + andb $240,%bl + xorq (%r11,%rdx,8),%r9 + movq %r8,%rdx + xorq %r10,%r8 + jmp .Loop1 + +.p2align 4 +.Lbreak1: + shrq $4,%r8 + andq $15,%rdx + movq %r9,%r10 + shrq $4,%r9 + xorq 8(%rsi,%rax,1),%r8 + shlq $60,%r10 + xorq (%rsi,%rax,1),%r9 + andb $240,%bl + xorq (%r11,%rdx,8),%r9 + movq %r8,%rdx + xorq %r10,%r8 + + shrq $4,%r8 + andq $15,%rdx + movq %r9,%r10 + shrq $4,%r9 + xorq 8(%rsi,%rbx,1),%r8 + shlq $60,%r10 + xorq (%rsi,%rbx,1),%r9 + xorq %r10,%r8 + xorq (%r11,%rdx,8),%r9 + + bswapq %r8 + bswapq %r9 + movq %r8,8(%rdi) + movq %r9,(%rdi) + + movq 16(%rsp),%rbx + leaq 24(%rsp),%rsp +.Lgmult_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_gcm_gmult_4bit: +.globl gcm_ghash_4bit +.def gcm_ghash_4bit; .scl 2; .type 32; .endef +.p2align 4 +gcm_ghash_4bit: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_gcm_ghash_4bit: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + subq $280,%rsp +.Lghash_prologue: + movq %rdx,%r14 + movq %rcx,%r15 + subq $-128,%rsi + leaq 16+128(%rsp),%rbp + xorl %edx,%edx + movq 0+0-128(%rsi),%r8 + movq 0+8-128(%rsi),%rax + movb %al,%dl + shrq $4,%rax + movq %r8,%r10 + shrq $4,%r8 + movq 16+0-128(%rsi),%r9 + shlb $4,%dl + movq 16+8-128(%rsi),%rbx + shlq $60,%r10 + movb %dl,0(%rsp) + orq %r10,%rax + movb %bl,%dl + shrq $4,%rbx + movq %r9,%r10 + shrq $4,%r9 + movq %r8,0(%rbp) + movq 32+0-128(%rsi),%r8 + shlb $4,%dl + movq %rax,0-128(%rbp) + movq 32+8-128(%rsi),%rax + shlq $60,%r10 + movb %dl,1(%rsp) + orq %r10,%rbx + movb %al,%dl + shrq $4,%rax + movq %r8,%r10 + shrq $4,%r8 + movq %r9,8(%rbp) + movq 48+0-128(%rsi),%r9 + shlb $4,%dl + movq %rbx,8-128(%rbp) + movq 48+8-128(%rsi),%rbx + shlq $60,%r10 + movb %dl,2(%rsp) + orq %r10,%rax + movb %bl,%dl + shrq $4,%rbx + movq %r9,%r10 + shrq $4,%r9 + movq %r8,16(%rbp) + movq 64+0-128(%rsi),%r8 + shlb $4,%dl + movq %rax,16-128(%rbp) + movq 64+8-128(%rsi),%rax + shlq $60,%r10 + movb %dl,3(%rsp) + orq %r10,%rbx + movb %al,%dl + shrq $4,%rax + movq %r8,%r10 + shrq $4,%r8 + movq %r9,24(%rbp) + movq 80+0-128(%rsi),%r9 + shlb $4,%dl + movq %rbx,24-128(%rbp) + movq 80+8-128(%rsi),%rbx + shlq $60,%r10 + movb %dl,4(%rsp) + orq %r10,%rax + movb %bl,%dl + shrq $4,%rbx + movq %r9,%r10 + shrq $4,%r9 + movq %r8,32(%rbp) + movq 96+0-128(%rsi),%r8 + shlb $4,%dl + movq %rax,32-128(%rbp) + movq 96+8-128(%rsi),%rax + shlq $60,%r10 + movb %dl,5(%rsp) + orq %r10,%rbx + movb %al,%dl + shrq $4,%rax + movq %r8,%r10 + shrq $4,%r8 + movq %r9,40(%rbp) + movq 112+0-128(%rsi),%r9 + shlb $4,%dl + movq %rbx,40-128(%rbp) + movq 112+8-128(%rsi),%rbx + shlq $60,%r10 + movb %dl,6(%rsp) + orq %r10,%rax + movb %bl,%dl + shrq $4,%rbx + movq %r9,%r10 + shrq $4,%r9 + movq %r8,48(%rbp) + movq 128+0-128(%rsi),%r8 + shlb $4,%dl + movq %rax,48-128(%rbp) + movq 128+8-128(%rsi),%rax + shlq $60,%r10 + movb %dl,7(%rsp) + orq %r10,%rbx + movb %al,%dl + shrq $4,%rax + movq %r8,%r10 + shrq $4,%r8 + movq %r9,56(%rbp) + movq 144+0-128(%rsi),%r9 + shlb $4,%dl + movq %rbx,56-128(%rbp) + movq 144+8-128(%rsi),%rbx + shlq $60,%r10 + movb %dl,8(%rsp) + orq %r10,%rax + movb %bl,%dl + shrq $4,%rbx + movq %r9,%r10 + shrq $4,%r9 + movq %r8,64(%rbp) + movq 160+0-128(%rsi),%r8 + shlb $4,%dl + movq %rax,64-128(%rbp) + movq 160+8-128(%rsi),%rax + shlq $60,%r10 + movb %dl,9(%rsp) + orq %r10,%rbx + movb %al,%dl + shrq $4,%rax + movq %r8,%r10 + shrq $4,%r8 + movq %r9,72(%rbp) + movq 176+0-128(%rsi),%r9 + shlb $4,%dl + movq %rbx,72-128(%rbp) + movq 176+8-128(%rsi),%rbx + shlq $60,%r10 + movb %dl,10(%rsp) + orq %r10,%rax + movb %bl,%dl + shrq $4,%rbx + movq %r9,%r10 + shrq $4,%r9 + movq %r8,80(%rbp) + movq 192+0-128(%rsi),%r8 + shlb $4,%dl + movq %rax,80-128(%rbp) + movq 192+8-128(%rsi),%rax + shlq $60,%r10 + movb %dl,11(%rsp) + orq %r10,%rbx + movb %al,%dl + shrq $4,%rax + movq %r8,%r10 + shrq $4,%r8 + movq %r9,88(%rbp) + movq 208+0-128(%rsi),%r9 + shlb $4,%dl + movq %rbx,88-128(%rbp) + movq 208+8-128(%rsi),%rbx + shlq $60,%r10 + movb %dl,12(%rsp) + orq %r10,%rax + movb %bl,%dl + shrq $4,%rbx + movq %r9,%r10 + shrq $4,%r9 + movq %r8,96(%rbp) + movq 224+0-128(%rsi),%r8 + shlb $4,%dl + movq %rax,96-128(%rbp) + movq 224+8-128(%rsi),%rax + shlq $60,%r10 + movb %dl,13(%rsp) + orq %r10,%rbx + movb %al,%dl + shrq $4,%rax + movq %r8,%r10 + shrq $4,%r8 + movq %r9,104(%rbp) + movq 240+0-128(%rsi),%r9 + shlb $4,%dl + movq %rbx,104-128(%rbp) + movq 240+8-128(%rsi),%rbx + shlq $60,%r10 + movb %dl,14(%rsp) + orq %r10,%rax + movb %bl,%dl + shrq $4,%rbx + movq %r9,%r10 + shrq $4,%r9 + movq %r8,112(%rbp) + shlb $4,%dl + movq %rax,112-128(%rbp) + shlq $60,%r10 + movb %dl,15(%rsp) + orq %r10,%rbx + movq %r9,120(%rbp) + movq %rbx,120-128(%rbp) + addq $-128,%rsi + movq 8(%rdi),%r8 + movq 0(%rdi),%r9 + addq %r14,%r15 + leaq .Lrem_8bit(%rip),%r11 + jmp .Louter_loop +.p2align 4 +.Louter_loop: + xorq (%r14),%r9 + movq 8(%r14),%rdx + leaq 16(%r14),%r14 + xorq %r8,%rdx + movq %r9,(%rdi) + movq %rdx,8(%rdi) + shrq $32,%rdx + xorq %rax,%rax + roll $8,%edx + movb %dl,%al + movzbl %dl,%ebx + shlb $4,%al + shrl $4,%ebx + roll $8,%edx + movq 8(%rsi,%rax,1),%r8 + movq (%rsi,%rax,1),%r9 + movb %dl,%al + movzbl %dl,%ecx + shlb $4,%al + movzbq (%rsp,%rbx,1),%r12 + shrl $4,%ecx + xorq %r8,%r12 + movq %r9,%r10 + shrq $8,%r8 + movzbq %r12b,%r12 + shrq $8,%r9 + xorq -128(%rbp,%rbx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rbx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r12,2),%r12 + movzbl %dl,%ebx + shlb $4,%al + movzbq (%rsp,%rcx,1),%r13 + shrl $4,%ebx + shlq $48,%r12 + xorq %r8,%r13 + movq %r9,%r10 + xorq %r12,%r9 + shrq $8,%r8 + movzbq %r13b,%r13 + shrq $8,%r9 + xorq -128(%rbp,%rcx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rcx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r13,2),%r13 + movzbl %dl,%ecx + shlb $4,%al + movzbq (%rsp,%rbx,1),%r12 + shrl $4,%ecx + shlq $48,%r13 + xorq %r8,%r12 + movq %r9,%r10 + xorq %r13,%r9 + shrq $8,%r8 + movzbq %r12b,%r12 + movl 8(%rdi),%edx + shrq $8,%r9 + xorq -128(%rbp,%rbx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rbx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r12,2),%r12 + movzbl %dl,%ebx + shlb $4,%al + movzbq (%rsp,%rcx,1),%r13 + shrl $4,%ebx + shlq $48,%r12 + xorq %r8,%r13 + movq %r9,%r10 + xorq %r12,%r9 + shrq $8,%r8 + movzbq %r13b,%r13 + shrq $8,%r9 + xorq -128(%rbp,%rcx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rcx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r13,2),%r13 + movzbl %dl,%ecx + shlb $4,%al + movzbq (%rsp,%rbx,1),%r12 + shrl $4,%ecx + shlq $48,%r13 + xorq %r8,%r12 + movq %r9,%r10 + xorq %r13,%r9 + shrq $8,%r8 + movzbq %r12b,%r12 + shrq $8,%r9 + xorq -128(%rbp,%rbx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rbx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r12,2),%r12 + movzbl %dl,%ebx + shlb $4,%al + movzbq (%rsp,%rcx,1),%r13 + shrl $4,%ebx + shlq $48,%r12 + xorq %r8,%r13 + movq %r9,%r10 + xorq %r12,%r9 + shrq $8,%r8 + movzbq %r13b,%r13 + shrq $8,%r9 + xorq -128(%rbp,%rcx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rcx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r13,2),%r13 + movzbl %dl,%ecx + shlb $4,%al + movzbq (%rsp,%rbx,1),%r12 + shrl $4,%ecx + shlq $48,%r13 + xorq %r8,%r12 + movq %r9,%r10 + xorq %r13,%r9 + shrq $8,%r8 + movzbq %r12b,%r12 + movl 4(%rdi),%edx + shrq $8,%r9 + xorq -128(%rbp,%rbx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rbx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r12,2),%r12 + movzbl %dl,%ebx + shlb $4,%al + movzbq (%rsp,%rcx,1),%r13 + shrl $4,%ebx + shlq $48,%r12 + xorq %r8,%r13 + movq %r9,%r10 + xorq %r12,%r9 + shrq $8,%r8 + movzbq %r13b,%r13 + shrq $8,%r9 + xorq -128(%rbp,%rcx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rcx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r13,2),%r13 + movzbl %dl,%ecx + shlb $4,%al + movzbq (%rsp,%rbx,1),%r12 + shrl $4,%ecx + shlq $48,%r13 + xorq %r8,%r12 + movq %r9,%r10 + xorq %r13,%r9 + shrq $8,%r8 + movzbq %r12b,%r12 + shrq $8,%r9 + xorq -128(%rbp,%rbx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rbx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r12,2),%r12 + movzbl %dl,%ebx + shlb $4,%al + movzbq (%rsp,%rcx,1),%r13 + shrl $4,%ebx + shlq $48,%r12 + xorq %r8,%r13 + movq %r9,%r10 + xorq %r12,%r9 + shrq $8,%r8 + movzbq %r13b,%r13 + shrq $8,%r9 + xorq -128(%rbp,%rcx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rcx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r13,2),%r13 + movzbl %dl,%ecx + shlb $4,%al + movzbq (%rsp,%rbx,1),%r12 + shrl $4,%ecx + shlq $48,%r13 + xorq %r8,%r12 + movq %r9,%r10 + xorq %r13,%r9 + shrq $8,%r8 + movzbq %r12b,%r12 + movl 0(%rdi),%edx + shrq $8,%r9 + xorq -128(%rbp,%rbx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rbx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r12,2),%r12 + movzbl %dl,%ebx + shlb $4,%al + movzbq (%rsp,%rcx,1),%r13 + shrl $4,%ebx + shlq $48,%r12 + xorq %r8,%r13 + movq %r9,%r10 + xorq %r12,%r9 + shrq $8,%r8 + movzbq %r13b,%r13 + shrq $8,%r9 + xorq -128(%rbp,%rcx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rcx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r13,2),%r13 + movzbl %dl,%ecx + shlb $4,%al + movzbq (%rsp,%rbx,1),%r12 + shrl $4,%ecx + shlq $48,%r13 + xorq %r8,%r12 + movq %r9,%r10 + xorq %r13,%r9 + shrq $8,%r8 + movzbq %r12b,%r12 + shrq $8,%r9 + xorq -128(%rbp,%rbx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rbx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r12,2),%r12 + movzbl %dl,%ebx + shlb $4,%al + movzbq (%rsp,%rcx,1),%r13 + shrl $4,%ebx + shlq $48,%r12 + xorq %r8,%r13 + movq %r9,%r10 + xorq %r12,%r9 + shrq $8,%r8 + movzbq %r13b,%r13 + shrq $8,%r9 + xorq -128(%rbp,%rcx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rcx,8),%r9 + roll $8,%edx + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + movb %dl,%al + xorq %r10,%r8 + movzwq (%r11,%r13,2),%r13 + movzbl %dl,%ecx + shlb $4,%al + movzbq (%rsp,%rbx,1),%r12 + andl $240,%ecx + shlq $48,%r13 + xorq %r8,%r12 + movq %r9,%r10 + xorq %r13,%r9 + shrq $8,%r8 + movzbq %r12b,%r12 + movl -4(%rdi),%edx + shrq $8,%r9 + xorq -128(%rbp,%rbx,8),%r8 + shlq $56,%r10 + xorq (%rbp,%rbx,8),%r9 + movzwq (%r11,%r12,2),%r12 + xorq 8(%rsi,%rax,1),%r8 + xorq (%rsi,%rax,1),%r9 + shlq $48,%r12 + xorq %r10,%r8 + xorq %r12,%r9 + movzbq %r8b,%r13 + shrq $4,%r8 + movq %r9,%r10 + shlb $4,%r13b + shrq $4,%r9 + xorq 8(%rsi,%rcx,1),%r8 + movzwq (%r11,%r13,2),%r13 + shlq $60,%r10 + xorq (%rsi,%rcx,1),%r9 + xorq %r10,%r8 + shlq $48,%r13 + bswapq %r8 + xorq %r13,%r9 + bswapq %r9 + cmpq %r15,%r14 + jb .Louter_loop + movq %r8,8(%rdi) + movq %r9,(%rdi) + + leaq 280(%rsp),%rsi + movq 0(%rsi),%r15 + movq 8(%rsi),%r14 + movq 16(%rsi),%r13 + movq 24(%rsi),%r12 + movq 32(%rsi),%rbp + movq 40(%rsi),%rbx + leaq 48(%rsi),%rsp +.Lghash_epilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_gcm_ghash_4bit: +.globl gcm_init_clmul +.def gcm_init_clmul; .scl 2; .type 32; .endef +.p2align 4 +gcm_init_clmul: + movdqu (%rdx),%xmm2 + pshufd $78,%xmm2,%xmm2 + + + pshufd $255,%xmm2,%xmm4 + movdqa %xmm2,%xmm3 + psllq $1,%xmm2 + pxor %xmm5,%xmm5 + psrlq $63,%xmm3 + pcmpgtd %xmm4,%xmm5 + pslldq $8,%xmm3 + por %xmm3,%xmm2 + + + pand .L0x1c2_polynomial(%rip),%xmm5 + pxor %xmm5,%xmm2 + + + movdqa %xmm2,%xmm0 + movdqa %xmm0,%xmm1 + pshufd $78,%xmm0,%xmm3 + pshufd $78,%xmm2,%xmm4 + pxor %xmm0,%xmm3 + pxor %xmm2,%xmm4 +.byte 102,15,58,68,194,0 +.byte 102,15,58,68,202,17 +.byte 102,15,58,68,220,0 + pxor %xmm0,%xmm3 + pxor %xmm1,%xmm3 + + movdqa %xmm3,%xmm4 + psrldq $8,%xmm3 + pslldq $8,%xmm4 + pxor %xmm3,%xmm1 + pxor %xmm4,%xmm0 + + movdqa %xmm0,%xmm3 + psllq $1,%xmm0 + pxor %xmm3,%xmm0 + psllq $5,%xmm0 + pxor %xmm3,%xmm0 + psllq $57,%xmm0 + movdqa %xmm0,%xmm4 + pslldq $8,%xmm0 + psrldq $8,%xmm4 + pxor %xmm3,%xmm0 + pxor %xmm4,%xmm1 + + + movdqa %xmm0,%xmm4 + psrlq $5,%xmm0 + pxor %xmm4,%xmm0 + psrlq $1,%xmm0 + pxor %xmm4,%xmm0 + pxor %xmm1,%xmm4 + psrlq $1,%xmm0 + pxor %xmm4,%xmm0 + movdqu %xmm2,(%rcx) + movdqu %xmm0,16(%rcx) + retq + +.globl gcm_gmult_clmul +.def gcm_gmult_clmul; .scl 2; .type 32; .endef +.p2align 4 +gcm_gmult_clmul: + movdqu (%rcx),%xmm0 + movdqa .Lbswap_mask(%rip),%xmm5 + movdqu (%rdx),%xmm2 +.byte 102,15,56,0,197 + movdqa %xmm0,%xmm1 + pshufd $78,%xmm0,%xmm3 + pshufd $78,%xmm2,%xmm4 + pxor %xmm0,%xmm3 + pxor %xmm2,%xmm4 +.byte 102,15,58,68,194,0 +.byte 102,15,58,68,202,17 +.byte 102,15,58,68,220,0 + pxor %xmm0,%xmm3 + pxor %xmm1,%xmm3 + + movdqa %xmm3,%xmm4 + psrldq $8,%xmm3 + pslldq $8,%xmm4 + pxor %xmm3,%xmm1 + pxor %xmm4,%xmm0 + + movdqa %xmm0,%xmm3 + psllq $1,%xmm0 + pxor %xmm3,%xmm0 + psllq $5,%xmm0 + pxor %xmm3,%xmm0 + psllq $57,%xmm0 + movdqa %xmm0,%xmm4 + pslldq $8,%xmm0 + psrldq $8,%xmm4 + pxor %xmm3,%xmm0 + pxor %xmm4,%xmm1 + + + movdqa %xmm0,%xmm4 + psrlq $5,%xmm0 + pxor %xmm4,%xmm0 + psrlq $1,%xmm0 + pxor %xmm4,%xmm0 + pxor %xmm1,%xmm4 + psrlq $1,%xmm0 + pxor %xmm4,%xmm0 +.byte 102,15,56,0,197 + movdqu %xmm0,(%rcx) + retq + +.globl gcm_ghash_clmul +.def gcm_ghash_clmul; .scl 2; .type 32; .endef +.p2align 4 +gcm_ghash_clmul: +.LSEH_begin_gcm_ghash_clmul: + +.byte 0x48,0x83,0xec,0x58 +.byte 0x0f,0x29,0x34,0x24 +.byte 0x0f,0x29,0x7c,0x24,0x10 +.byte 0x44,0x0f,0x29,0x44,0x24,0x20 +.byte 0x44,0x0f,0x29,0x4c,0x24,0x30 +.byte 0x44,0x0f,0x29,0x54,0x24,0x40 + movdqa .Lbswap_mask(%rip),%xmm5 + + movdqu (%rcx),%xmm0 + movdqu (%rdx),%xmm2 +.byte 102,15,56,0,197 + + subq $16,%r9 + jz .Lodd_tail + + movdqu 16(%rdx),%xmm8 + + + + + + movdqu (%r8),%xmm3 + movdqu 16(%r8),%xmm6 +.byte 102,15,56,0,221 +.byte 102,15,56,0,245 + pxor %xmm3,%xmm0 + movdqa %xmm6,%xmm7 + pshufd $78,%xmm6,%xmm3 + pshufd $78,%xmm2,%xmm4 + pxor %xmm6,%xmm3 + pxor %xmm2,%xmm4 +.byte 102,15,58,68,242,0 +.byte 102,15,58,68,250,17 +.byte 102,15,58,68,220,0 + pxor %xmm6,%xmm3 + pxor %xmm7,%xmm3 + + movdqa %xmm3,%xmm4 + psrldq $8,%xmm3 + pslldq $8,%xmm4 + pxor %xmm3,%xmm7 + pxor %xmm4,%xmm6 + movdqa %xmm0,%xmm1 + pshufd $78,%xmm0,%xmm3 + pshufd $78,%xmm8,%xmm4 + pxor %xmm0,%xmm3 + pxor %xmm8,%xmm4 + + leaq 32(%r8),%r8 + subq $32,%r9 + jbe .Leven_tail + +.Lmod_loop: +.byte 102,65,15,58,68,192,0 +.byte 102,65,15,58,68,200,17 +.byte 102,15,58,68,220,0 + pxor %xmm0,%xmm3 + pxor %xmm1,%xmm3 + + movdqa %xmm3,%xmm4 + psrldq $8,%xmm3 + pslldq $8,%xmm4 + pxor %xmm3,%xmm1 + pxor %xmm4,%xmm0 + movdqu (%r8),%xmm3 + pxor %xmm6,%xmm0 + pxor %xmm7,%xmm1 + + movdqu 16(%r8),%xmm6 +.byte 102,15,56,0,221 +.byte 102,15,56,0,245 + + movdqa %xmm6,%xmm7 + pshufd $78,%xmm6,%xmm9 + pshufd $78,%xmm2,%xmm10 + pxor %xmm6,%xmm9 + pxor %xmm2,%xmm10 + pxor %xmm3,%xmm1 + + movdqa %xmm0,%xmm3 + psllq $1,%xmm0 + pxor %xmm3,%xmm0 + psllq $5,%xmm0 + pxor %xmm3,%xmm0 +.byte 102,15,58,68,242,0 + psllq $57,%xmm0 + movdqa %xmm0,%xmm4 + pslldq $8,%xmm0 + psrldq $8,%xmm4 + pxor %xmm3,%xmm0 + pxor %xmm4,%xmm1 + +.byte 102,15,58,68,250,17 + movdqa %xmm0,%xmm4 + psrlq $5,%xmm0 + pxor %xmm4,%xmm0 + psrlq $1,%xmm0 + pxor %xmm4,%xmm0 + pxor %xmm1,%xmm4 + psrlq $1,%xmm0 + pxor %xmm4,%xmm0 + +.byte 102,69,15,58,68,202,0 + movdqa %xmm0,%xmm1 + pshufd $78,%xmm0,%xmm3 + pshufd $78,%xmm8,%xmm4 + pxor %xmm0,%xmm3 + pxor %xmm8,%xmm4 + + pxor %xmm6,%xmm9 + pxor %xmm7,%xmm9 + movdqa %xmm9,%xmm10 + psrldq $8,%xmm9 + pslldq $8,%xmm10 + pxor %xmm9,%xmm7 + pxor %xmm10,%xmm6 + + leaq 32(%r8),%r8 + subq $32,%r9 + ja .Lmod_loop + +.Leven_tail: +.byte 102,65,15,58,68,192,0 +.byte 102,65,15,58,68,200,17 +.byte 102,15,58,68,220,0 + pxor %xmm0,%xmm3 + pxor %xmm1,%xmm3 + + movdqa %xmm3,%xmm4 + psrldq $8,%xmm3 + pslldq $8,%xmm4 + pxor %xmm3,%xmm1 + pxor %xmm4,%xmm0 + pxor %xmm6,%xmm0 + pxor %xmm7,%xmm1 + + movdqa %xmm0,%xmm3 + psllq $1,%xmm0 + pxor %xmm3,%xmm0 + psllq $5,%xmm0 + pxor %xmm3,%xmm0 + psllq $57,%xmm0 + movdqa %xmm0,%xmm4 + pslldq $8,%xmm0 + psrldq $8,%xmm4 + pxor %xmm3,%xmm0 + pxor %xmm4,%xmm1 + + + movdqa %xmm0,%xmm4 + psrlq $5,%xmm0 + pxor %xmm4,%xmm0 + psrlq $1,%xmm0 + pxor %xmm4,%xmm0 + pxor %xmm1,%xmm4 + psrlq $1,%xmm0 + pxor %xmm4,%xmm0 + testq %r9,%r9 + jnz .Ldone + +.Lodd_tail: + movdqu (%r8),%xmm3 +.byte 102,15,56,0,221 + pxor %xmm3,%xmm0 + movdqa %xmm0,%xmm1 + pshufd $78,%xmm0,%xmm3 + pshufd $78,%xmm2,%xmm4 + pxor %xmm0,%xmm3 + pxor %xmm2,%xmm4 +.byte 102,15,58,68,194,0 +.byte 102,15,58,68,202,17 +.byte 102,15,58,68,220,0 + pxor %xmm0,%xmm3 + pxor %xmm1,%xmm3 + + movdqa %xmm3,%xmm4 + psrldq $8,%xmm3 + pslldq $8,%xmm4 + pxor %xmm3,%xmm1 + pxor %xmm4,%xmm0 + + movdqa %xmm0,%xmm3 + psllq $1,%xmm0 + pxor %xmm3,%xmm0 + psllq $5,%xmm0 + pxor %xmm3,%xmm0 + psllq $57,%xmm0 + movdqa %xmm0,%xmm4 + pslldq $8,%xmm0 + psrldq $8,%xmm4 + pxor %xmm3,%xmm0 + pxor %xmm4,%xmm1 + + + movdqa %xmm0,%xmm4 + psrlq $5,%xmm0 + pxor %xmm4,%xmm0 + psrlq $1,%xmm0 + pxor %xmm4,%xmm0 + pxor %xmm1,%xmm4 + psrlq $1,%xmm0 + pxor %xmm4,%xmm0 +.Ldone: +.byte 102,15,56,0,197 + movdqu %xmm0,(%rcx) + movaps (%rsp),%xmm6 + movaps 16(%rsp),%xmm7 + movaps 32(%rsp),%xmm8 + movaps 48(%rsp),%xmm9 + movaps 64(%rsp),%xmm10 + addq $88,%rsp + retq +.LSEH_end_gcm_ghash_clmul: + +.p2align 6 +.Lbswap_mask: +.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 +.L0x1c2_polynomial: +.byte 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xc2 +.p2align 6 + +.Lrem_4bit: +.long 0,0,0,471859200,0,943718400,0,610271232 +.long 0,1887436800,0,1822425088,0,1220542464,0,1423966208 +.long 0,3774873600,0,4246732800,0,3644850176,0,3311403008 +.long 0,2441084928,0,2376073216,0,2847932416,0,3051356160 + +.Lrem_8bit: +.value 0x0000,0x01C2,0x0384,0x0246,0x0708,0x06CA,0x048C,0x054E +.value 0x0E10,0x0FD2,0x0D94,0x0C56,0x0918,0x08DA,0x0A9C,0x0B5E +.value 0x1C20,0x1DE2,0x1FA4,0x1E66,0x1B28,0x1AEA,0x18AC,0x196E +.value 0x1230,0x13F2,0x11B4,0x1076,0x1538,0x14FA,0x16BC,0x177E +.value 0x3840,0x3982,0x3BC4,0x3A06,0x3F48,0x3E8A,0x3CCC,0x3D0E +.value 0x3650,0x3792,0x35D4,0x3416,0x3158,0x309A,0x32DC,0x331E +.value 0x2460,0x25A2,0x27E4,0x2626,0x2368,0x22AA,0x20EC,0x212E +.value 0x2A70,0x2BB2,0x29F4,0x2836,0x2D78,0x2CBA,0x2EFC,0x2F3E +.value 0x7080,0x7142,0x7304,0x72C6,0x7788,0x764A,0x740C,0x75CE +.value 0x7E90,0x7F52,0x7D14,0x7CD6,0x7998,0x785A,0x7A1C,0x7BDE +.value 0x6CA0,0x6D62,0x6F24,0x6EE6,0x6BA8,0x6A6A,0x682C,0x69EE +.value 0x62B0,0x6372,0x6134,0x60F6,0x65B8,0x647A,0x663C,0x67FE +.value 0x48C0,0x4902,0x4B44,0x4A86,0x4FC8,0x4E0A,0x4C4C,0x4D8E +.value 0x46D0,0x4712,0x4554,0x4496,0x41D8,0x401A,0x425C,0x439E +.value 0x54E0,0x5522,0x5764,0x56A6,0x53E8,0x522A,0x506C,0x51AE +.value 0x5AF0,0x5B32,0x5974,0x58B6,0x5DF8,0x5C3A,0x5E7C,0x5FBE +.value 0xE100,0xE0C2,0xE284,0xE346,0xE608,0xE7CA,0xE58C,0xE44E +.value 0xEF10,0xEED2,0xEC94,0xED56,0xE818,0xE9DA,0xEB9C,0xEA5E +.value 0xFD20,0xFCE2,0xFEA4,0xFF66,0xFA28,0xFBEA,0xF9AC,0xF86E +.value 0xF330,0xF2F2,0xF0B4,0xF176,0xF438,0xF5FA,0xF7BC,0xF67E +.value 0xD940,0xD882,0xDAC4,0xDB06,0xDE48,0xDF8A,0xDDCC,0xDC0E +.value 0xD750,0xD692,0xD4D4,0xD516,0xD058,0xD19A,0xD3DC,0xD21E +.value 0xC560,0xC4A2,0xC6E4,0xC726,0xC268,0xC3AA,0xC1EC,0xC02E +.value 0xCB70,0xCAB2,0xC8F4,0xC936,0xCC78,0xCDBA,0xCFFC,0xCE3E +.value 0x9180,0x9042,0x9204,0x93C6,0x9688,0x974A,0x950C,0x94CE +.value 0x9F90,0x9E52,0x9C14,0x9DD6,0x9898,0x995A,0x9B1C,0x9ADE +.value 0x8DA0,0x8C62,0x8E24,0x8FE6,0x8AA8,0x8B6A,0x892C,0x88EE +.value 0x83B0,0x8272,0x8034,0x81F6,0x84B8,0x857A,0x873C,0x86FE +.value 0xA9C0,0xA802,0xAA44,0xAB86,0xAEC8,0xAF0A,0xAD4C,0xAC8E +.value 0xA7D0,0xA612,0xA454,0xA596,0xA0D8,0xA11A,0xA35C,0xA29E +.value 0xB5E0,0xB422,0xB664,0xB7A6,0xB2E8,0xB32A,0xB16C,0xB0AE +.value 0xBBF0,0xBA32,0xB874,0xB9B6,0xBCF8,0xBD3A,0xBF7C,0xBEBE + +.byte 71,72,65,83,72,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 +.p2align 6 + +.def se_handler; .scl 3; .type 32; .endef +.p2align 4 +se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + movq 8(%r9),%rsi + movq 56(%r9),%r11 + + movl 0(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jb .Lin_prologue + + movq 152(%r8),%rax + + movl 4(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jae .Lin_prologue + + leaq 24(%rax),%rax + + movq -8(%rax),%rbx + movq -16(%rax),%rbp + movq -24(%rax),%r12 + movq %rbx,144(%r8) + movq %rbp,160(%r8) + movq %r12,216(%r8) + +.Lin_prologue: + movq 8(%rax),%rdi + movq 16(%rax),%rsi + movq %rax,152(%r8) + movq %rsi,168(%r8) + movq %rdi,176(%r8) + + movq 40(%r9),%rdi + movq %r8,%rsi + movl $154,%ecx +.long 0xa548f3fc + + movq %r9,%rsi + xorq %rcx,%rcx + movq 8(%rsi),%rdx + movq 0(%rsi),%r8 + movq 16(%rsi),%r9 + movq 40(%rsi),%r10 + leaq 56(%rsi),%r11 + leaq 24(%rsi),%r12 + movq %r10,32(%rsp) + movq %r11,40(%rsp) + movq %r12,48(%rsp) + movq %rcx,56(%rsp) + call *__imp_RtlVirtualUnwind(%rip) + + movl $1,%eax + addq $64,%rsp + popfq + popq %r15 + popq %r14 + popq %r13 + popq %r12 + popq %rbp + popq %rbx + popq %rdi + popq %rsi + retq + + +.section .pdata +.p2align 2 +.rva .LSEH_begin_gcm_gmult_4bit +.rva .LSEH_end_gcm_gmult_4bit +.rva .LSEH_info_gcm_gmult_4bit + +.rva .LSEH_begin_gcm_ghash_4bit +.rva .LSEH_end_gcm_ghash_4bit +.rva .LSEH_info_gcm_ghash_4bit + +.rva .LSEH_begin_gcm_ghash_clmul +.rva .LSEH_end_gcm_ghash_clmul +.rva .LSEH_info_gcm_ghash_clmul + +.section .xdata +.p2align 3 +.LSEH_info_gcm_gmult_4bit: +.byte 9,0,0,0 +.rva se_handler +.rva .Lgmult_prologue,.Lgmult_epilogue +.LSEH_info_gcm_ghash_4bit: +.byte 9,0,0,0 +.rva se_handler +.rva .Lghash_prologue,.Lghash_epilogue +.LSEH_info_gcm_ghash_clmul: +.byte 0x01,0x1f,0x0b,0x00 +.byte 0x1f,0xa8,0x04,0x00 +.byte 0x19,0x98,0x03,0x00 +.byte 0x13,0x88,0x02,0x00 +.byte 0x0d,0x78,0x01,0x00 +.byte 0x08,0x68,0x00,0x00 +.byte 0x04,0xa2,0x00,0x00 diff --git a/crypto/modes/modes_lcl.h b/crypto/modes/modes_lcl.h index f8830e4d..bfea1894 100644 --- a/crypto/modes/modes_lcl.h +++ b/crypto/modes/modes_lcl.h @@ -45,14 +45,16 @@ typedef unsigned char u8; asm ("bswapl %0" \ : "+r"(ret)); ret; }) # elif (defined(__arm__) || defined(__arm)) && !defined(__STRICT_ALIGNMENT) -# define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ +# if (__ARM_ARCH >= 6) +# define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ asm ("rev %0,%0; rev %1,%1" \ : "+r"(hi),"+r"(lo)); \ (u64)hi<<32|lo; }) -# define BSWAP4(x) ({ u32 ret; \ +# define BSWAP4(x) ({ u32 ret; \ asm ("rev %0,%1" \ : "=r"(ret) : "r"((u32)(x))); \ ret; }) +# endif # endif #endif #endif diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index 5b7fac05..6c50aa98 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: obj_dat.c,v 1.39 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: obj_dat.c,v 1.41 2018/09/08 13:49:26 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -328,12 +328,12 @@ OBJ_add_object(const ASN1_OBJECT *obj) return (o->nid); -err2: + err2: OBJerror(ERR_R_MALLOC_FAILURE); -err: + err: for (i = ADDED_DATA; i <= ADDED_NID; i++) free(ao[i]); - free(o); + ASN1_OBJECT_free(o); return (NID_undef); } @@ -632,11 +632,11 @@ OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name) } } -out: + out: BN_free(bl); return ret; -err: + err: ret = 0; goto out; } @@ -810,7 +810,7 @@ OBJ_create(const char *oid, const char *sn, const char *ln) goto err; ok = OBJ_add_object(op); -err: + err: ASN1_OBJECT_free(op); free(buf); return (ok); diff --git a/crypto/objects/obj_dat.h b/crypto/objects/obj_dat.h index 605952f4..8b34beb3 100644 --- a/crypto/objects/obj_dat.h +++ b/crypto/objects/obj_dat.h @@ -62,12 +62,12 @@ * [including the GNU Public Licence.] */ -#define NUM_NID 959 -#define NUM_SN 952 -#define NUM_LN 952 -#define NUM_OBJ 893 +#define NUM_NID 980 +#define NUM_SN 973 +#define NUM_LN 973 +#define NUM_OBJ 905 -static const unsigned char lvalues[6250]={ +static const unsigned char lvalues[6336]={ 0x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 0] OBJ_rsadsi */ 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 6] OBJ_pkcs */ 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x02, /* [ 13] OBJ_md2 */ @@ -955,6 +955,18 @@ static const unsigned char lvalues[6250]={ 0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,0x01,/* [6216] OBJ_jurisdictionLocalityName */ 0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,0x02,/* [6227] OBJ_jurisdictionStateOrProvinceName */ 0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x3C,0x02,0x01,0x03,/* [6238] OBJ_jurisdictionCountryName */ +0x2A,0x81,0x1C,0xCF,0x55,0x01,0x83,0x11, /* [6249] OBJ_sm3 */ +0x2A,0x81,0x1C,0xCF,0x55,0x01,0x83,0x78, /* [6257] OBJ_sm3WithRSAEncryption */ +0x2A,0x81,0x1C, /* [6265] OBJ_ISO_CN */ +0x2A,0x81,0x1C,0xCF,0x55, /* [6268] OBJ_oscca */ +0x2A,0x81,0x1C,0xCF,0x55,0x01, /* [6273] OBJ_sm_scheme */ +0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x01, /* [6279] OBJ_sm4_ecb */ +0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x02, /* [6287] OBJ_sm4_cbc */ +0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x03, /* [6295] OBJ_sm4_ofb128 */ +0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x04, /* [6303] OBJ_sm4_cfb128 */ +0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x05, /* [6311] OBJ_sm4_cfb1 */ +0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x06, /* [6319] OBJ_sm4_cfb8 */ +0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x07, /* [6327] OBJ_sm4_ctr */ }; static const ASN1_OBJECT nid_objs[NUM_NID]={ @@ -2504,6 +2516,28 @@ static const ASN1_OBJECT nid_objs[NUM_NID]={ NID_jurisdictionStateOrProvinceName,11,&(lvalues[6227]),0}, {"jurisdictionCountryName","jurisdictionCountryName", NID_jurisdictionCountryName,11,&(lvalues[6238]),0}, +{"KxRSA","kx-rsa",NID_kx_rsa,0,NULL,0}, +{"KxECDHE","kx-ecdhe",NID_kx_ecdhe,0,NULL,0}, +{"KxDHE","kx-dhe",NID_kx_dhe,0,NULL,0}, +{"KxGOST","kx-gost",NID_kx_gost,0,NULL,0}, +{"AuthRSA","auth-rsa",NID_auth_rsa,0,NULL,0}, +{"AuthECDSA","auth-ecdsa",NID_auth_ecdsa,0,NULL,0}, +{"AuthGOST01","auth-gost01",NID_auth_gost01,0,NULL,0}, +{"AuthNULL","auth-null",NID_auth_null,0,NULL,0}, +{"ChaCha20-Poly1305","chacha20-poly1305",NID_chacha20_poly1305,0,NULL,0}, +{"SM3","sm3",NID_sm3,8,&(lvalues[6249]),0}, +{"RSA-SM3","sm3WithRSAEncryption",NID_sm3WithRSAEncryption,8, + &(lvalues[6257]),0}, +{"ISO-CN","ISO CN Member Body",NID_ISO_CN,3,&(lvalues[6265]),0}, +{"oscca","oscca",NID_oscca,5,&(lvalues[6268]),0}, +{"sm-scheme","sm-scheme",NID_sm_scheme,6,&(lvalues[6273]),0}, +{"SM4-ECB","sm4-ecb",NID_sm4_ecb,8,&(lvalues[6279]),0}, +{"SM4-CBC","sm4-cbc",NID_sm4_cbc,8,&(lvalues[6287]),0}, +{"SM4-OFB","sm4-ofb",NID_sm4_ofb128,8,&(lvalues[6295]),0}, +{"SM4-CFB","sm4-cfb",NID_sm4_cfb128,8,&(lvalues[6303]),0}, +{"SM4-CFB1","sm4-cfb1",NID_sm4_cfb1,8,&(lvalues[6311]),0}, +{"SM4-CFB8","sm4-cfb8",NID_sm4_cfb8,8,&(lvalues[6319]),0}, +{"SM4-CTR","sm4-ctr",NID_sm4_ctr,8,&(lvalues[6327]),0}, }; static const unsigned int sn_objs[NUM_SN]={ @@ -2534,6 +2568,10 @@ static const unsigned int sn_objs[NUM_SN]={ 426, /* "AES-256-ECB" */ 428, /* "AES-256-OFB" */ 914, /* "AES-256-XTS" */ +964, /* "AuthECDSA" */ +965, /* "AuthGOST01" */ +966, /* "AuthNULL" */ +963, /* "AuthRSA" */ 91, /* "BF-CBC" */ 93, /* "BF-CFB" */ 92, /* "BF-ECB" */ @@ -2566,6 +2604,7 @@ static const unsigned int sn_objs[NUM_SN]={ 141, /* "CRLReason" */ 417, /* "CSPName" */ 937, /* "ChaCha" */ +967, /* "ChaCha20-Poly1305" */ 367, /* "CrlID" */ 391, /* "DC" */ 31, /* "DES-CBC" */ @@ -2608,10 +2647,15 @@ static const unsigned int sn_objs[NUM_SN]={ 36, /* "IDEA-ECB" */ 46, /* "IDEA-OFB" */ 181, /* "ISO" */ +970, /* "ISO-CN" */ 183, /* "ISO-US" */ 645, /* "ITU-T" */ 646, /* "JOINT-ISO-ITU-T" */ 773, /* "KISA" */ +961, /* "KxDHE" */ +960, /* "KxECDHE" */ +962, /* "KxGOST" */ +959, /* "KxRSA" */ 15, /* "L" */ 856, /* "LocalKeySet" */ 3, /* "MD2" */ @@ -2677,6 +2721,7 @@ static const unsigned int sn_objs[NUM_SN]={ 668, /* "RSA-SHA256" */ 669, /* "RSA-SHA384" */ 670, /* "RSA-SHA512" */ +969, /* "RSA-SM3" */ 919, /* "RSAES-OAEP" */ 912, /* "RSASSA-PSS" */ 777, /* "SEED-CBC" */ @@ -2689,6 +2734,14 @@ static const unsigned int sn_objs[NUM_SN]={ 672, /* "SHA256" */ 673, /* "SHA384" */ 674, /* "SHA512" */ +968, /* "SM3" */ +974, /* "SM4-CBC" */ +976, /* "SM4-CFB" */ +977, /* "SM4-CFB1" */ +978, /* "SM4-CFB8" */ +979, /* "SM4-CTR" */ +973, /* "SM4-ECB" */ +975, /* "SM4-OFB" */ 188, /* "SMIME" */ 167, /* "SMIME-CAPS" */ 100, /* "SN" */ @@ -3163,6 +3216,7 @@ static const unsigned int sn_objs[NUM_SN]={ 77, /* "nsSslServerName" */ 681, /* "onBasis" */ 491, /* "organizationalStatus" */ +971, /* "oscca" */ 475, /* "otherMailbox" */ 876, /* "owner" */ 489, /* "pagerTelephoneNumber" */ @@ -3409,6 +3463,7 @@ static const unsigned int sn_objs[NUM_SN]={ 52, /* "signingTime" */ 454, /* "simpleSecurityObject" */ 496, /* "singleLevelQuality" */ +972, /* "sm-scheme" */ 387, /* "snmpv2" */ 941, /* "streebog256" */ 942, /* "streebog512" */ @@ -3517,6 +3572,7 @@ static const unsigned int ln_objs[NUM_LN]={ 294, /* "IPSec End System" */ 295, /* "IPSec Tunnel" */ 296, /* "IPSec User" */ +970, /* "ISO CN Member Body" */ 182, /* "ISO Member Body" */ 183, /* "ISO US Member Body" */ 667, /* "Independent" */ @@ -3654,6 +3710,10 @@ static const unsigned int ln_objs[NUM_LN]={ 484, /* "associatedDomain" */ 485, /* "associatedName" */ 501, /* "audio" */ +964, /* "auth-ecdsa" */ +965, /* "auth-gost01" */ +966, /* "auth-null" */ +963, /* "auth-rsa" */ 882, /* "authorityRevocationList" */ 91, /* "bf-cbc" */ 93, /* "bf-cfb" */ @@ -3726,6 +3786,7 @@ static const unsigned int ln_objs[NUM_LN]={ 517, /* "certificate extensions" */ 883, /* "certificateRevocationList" */ 937, /* "chacha" */ +967, /* "chacha20-poly1305" */ 54, /* "challengePassword" */ 407, /* "characteristic-two-field" */ 395, /* "clearance" */ @@ -4064,6 +4125,10 @@ static const unsigned int ln_objs[NUM_LN]={ 957, /* "jurisdictionStateOrProvinceName" */ 150, /* "keyBag" */ 773, /* "kisa" */ +961, /* "kx-dhe" */ +960, /* "kx-ecdhe" */ +962, /* "kx-gost" */ +959, /* "kx-rsa" */ 477, /* "lastModifiedBy" */ 476, /* "lastModifiedTime" */ 157, /* "localKeyID" */ @@ -4096,6 +4161,7 @@ static const unsigned int ln_objs[NUM_LN]={ 17, /* "organizationName" */ 491, /* "organizationalStatus" */ 18, /* "organizationalUnitName" */ +971, /* "oscca" */ 475, /* "otherMailbox" */ 876, /* "owner" */ 489, /* "pagerTelephoneNumber" */ @@ -4369,6 +4435,16 @@ static const unsigned int ln_objs[NUM_LN]={ 52, /* "signingTime" */ 454, /* "simpleSecurityObject" */ 496, /* "singleLevelQuality" */ +972, /* "sm-scheme" */ +968, /* "sm3" */ +969, /* "sm3WithRSAEncryption" */ +974, /* "sm4-cbc" */ +976, /* "sm4-cfb" */ +977, /* "sm4-cfb1" */ +978, /* "sm4-cfb8" */ +979, /* "sm4-ctr" */ +973, /* "sm4-ecb" */ +975, /* "sm4-ofb" */ 16, /* "stateOrProvinceName" */ 660, /* "streetAddress" */ 498, /* "subtreeMaximumQuality" */ @@ -4437,6 +4513,7 @@ static const unsigned int obj_objs[NUM_OBJ]={ 512, /* OBJ_id_set 2 23 42 */ 678, /* OBJ_wap 2 23 43 */ 435, /* OBJ_pss 0 9 2342 */ +970, /* OBJ_ISO_CN 1 2 156 */ 183, /* OBJ_ISO_US 1 2 840 */ 381, /* OBJ_iana 1 3 6 1 */ 950, /* OBJ_X25519 1 3 101 110 */ @@ -4658,6 +4735,7 @@ static const unsigned int obj_objs[NUM_OBJ]={ 637, /* OBJ_set_brand_Diners 2 23 42 8 30 */ 638, /* OBJ_set_brand_AmericanExpress 2 23 42 8 34 */ 639, /* OBJ_set_brand_JCB 2 23 42 8 35 */ +971, /* OBJ_oscca 1 2 156 10197 */ 805, /* OBJ_cryptopro 1 2 643 2 2 */ 806, /* OBJ_cryptocom 1 2 643 2 9 */ 940, /* OBJ_tc26 1 2 643 7 1 */ @@ -4733,6 +4811,7 @@ static const unsigned int obj_objs[NUM_OBJ]={ 745, /* OBJ_wap_wsg_idm_ecid_wtls12 2 23 43 1 4 12 */ 804, /* OBJ_whirlpool 1 0 10118 3 0 55 */ 124, /* OBJ_rle_compression 1 1 1 1 666 1 */ +972, /* OBJ_sm_scheme 1 2 156 10197 1 */ 773, /* OBJ_kisa 1 2 410 200004 */ 807, /* OBJ_id_GostR3411_94_with_GostR3410_2001 1 2 643 2 2 3 */ 808, /* OBJ_id_GostR3411_94_with_GostR3410_94 1 2 643 2 2 4 */ @@ -4828,6 +4907,15 @@ static const unsigned int obj_objs[NUM_OBJ]={ 768, /* OBJ_camellia_256_ofb128 0 3 4401 5 3 1 9 43 */ 759, /* OBJ_camellia_256_cfb128 0 3 4401 5 3 1 9 44 */ 437, /* OBJ_pilot 0 9 2342 19200300 100 */ +973, /* OBJ_sm4_ecb 1 2 156 10197 1 104 1 */ +974, /* OBJ_sm4_cbc 1 2 156 10197 1 104 2 */ +975, /* OBJ_sm4_ofb128 1 2 156 10197 1 104 3 */ +976, /* OBJ_sm4_cfb128 1 2 156 10197 1 104 4 */ +977, /* OBJ_sm4_cfb1 1 2 156 10197 1 104 5 */ +978, /* OBJ_sm4_cfb8 1 2 156 10197 1 104 6 */ +979, /* OBJ_sm4_ctr 1 2 156 10197 1 104 7 */ +968, /* OBJ_sm3 1 2 156 10197 1 401 */ +969, /* OBJ_sm3WithRSAEncryption 1 2 156 10197 1 504 */ 776, /* OBJ_seed_ecb 1 2 410 200004 1 3 */ 777, /* OBJ_seed_cbc 1 2 410 200004 1 4 */ 779, /* OBJ_seed_cfb128 1 2 410 200004 1 5 */ diff --git a/crypto/objects/obj_lib.c b/crypto/objects/obj_lib.c index 53f3bb9e..5327a0cb 100644 --- a/crypto/objects/obj_lib.c +++ b/crypto/objects/obj_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: obj_lib.c,v 1.14 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: obj_lib.c,v 1.15 2018/09/08 10:31:24 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -109,7 +109,7 @@ OBJ_dup(const ASN1_OBJECT *o) ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | ASN1_OBJECT_FLAG_DYNAMIC_DATA); return (r); -err: + err: OBJerror(ERR_R_MALLOC_FAILURE); free(ln); free(sn); diff --git a/crypto/ocsp/ocsp_cl.c b/crypto/ocsp/ocsp_cl.c index 04ea6866..0ed816cd 100644 --- a/crypto/ocsp/ocsp_cl.c +++ b/crypto/ocsp/ocsp_cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp_cl.c,v 1.14 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ocsp_cl.c,v 1.16 2018/11/25 19:48:43 jmc Exp $ */ /* Written by Tom Titchener for the OpenSSL * project. */ @@ -139,7 +139,7 @@ OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert) return 1; } -/* Sign an OCSP request set the requestorName to the subjec +/* Sign an OCSP request set the requestorName to the subject * name of an optional signers certificate and include one * or more optional certificates in the request. Behaves * like PKCS7_sign(). @@ -390,3 +390,9 @@ OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, return 1; } + +const OCSP_CERTID * +OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *single) +{ + return single->certId; +} diff --git a/crypto/ocsp/ocsp_ext.c b/crypto/ocsp/ocsp_ext.c index 1f2563ca..eb51cfbf 100644 --- a/crypto/ocsp/ocsp_ext.c +++ b/crypto/ocsp/ocsp_ext.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp_ext.c,v 1.15 2016/12/27 16:01:19 jsing Exp $ */ +/* $OpenBSD: ocsp_ext.c,v 1.18 2018/05/14 23:47:10 tb Exp $ */ /* Written by Tom Titchener for the OpenSSL * project. */ @@ -88,7 +88,8 @@ OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos) } int -OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos) +OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj, + int lastpos) { return X509v3_get_ext_by_OBJ(x->tbsRequest->requestExtensions, obj, lastpos); @@ -149,7 +150,7 @@ OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos) } int -OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos) +OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj, int lastpos) { return X509v3_get_ext_by_OBJ(x->singleRequestExtensions, obj, lastpos); } @@ -209,7 +210,8 @@ OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos) } int -OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos) +OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj, + int lastpos) { return X509v3_get_ext_by_OBJ(x->tbsResponseData->responseExtensions, obj, lastpos); @@ -271,7 +273,7 @@ OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos) } int -OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj, +OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, const ASN1_OBJECT *obj, int lastpos) { return X509v3_get_ext_by_OBJ(x->singleExtensions, obj, lastpos); @@ -435,7 +437,7 @@ OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req) } X509_EXTENSION * -OCSP_crlID_new(char *url, long *n, char *tim) +OCSP_crlID_new(const char *url, long *n, char *tim) { X509_EXTENSION *x = NULL; OCSP_CRLID *cid = NULL; @@ -517,7 +519,7 @@ OCSP_archive_cutoff_new(char* tim) * method forces NID_ad_ocsp and uniformResourceLocator [6] IA5String. */ X509_EXTENSION * -OCSP_url_svcloc_new(X509_NAME* issuer, char **urls) +OCSP_url_svcloc_new(X509_NAME* issuer, const char **urls) { X509_EXTENSION *x = NULL; ASN1_IA5STRING *ia5 = NULL; diff --git a/crypto/ocsp/ocsp_ht.c b/crypto/ocsp/ocsp_ht.c index b9c96992..255f8903 100644 --- a/crypto/ocsp/ocsp_ht.c +++ b/crypto/ocsp/ocsp_ht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp_ht.c,v 1.24 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ocsp_ht.c,v 1.25 2018/05/13 10:42:03 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -149,7 +149,7 @@ OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, const char *name, } OCSP_REQ_CTX * -OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline) +OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req, int maxline) { OCSP_REQ_CTX *rctx; @@ -440,7 +440,7 @@ OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx) /* Blocking OCSP request handler: now a special case of non-blocking I/O */ OCSP_RESPONSE * -OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req) +OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req) { OCSP_RESPONSE *resp = NULL; OCSP_REQ_CTX *ctx; diff --git a/crypto/ocsp/ocsp_lib.c b/crypto/ocsp/ocsp_lib.c index d56a0020..53d51602 100644 --- a/crypto/ocsp/ocsp_lib.c +++ b/crypto/ocsp/ocsp_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp_lib.c,v 1.20 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ocsp_lib.c,v 1.23 2018/08/24 20:03:21 tb Exp $ */ /* Written by Tom Titchener for the OpenSSL * project. */ @@ -77,10 +77,10 @@ /* Convert a certificate and its issuer to an OCSP_CERTID */ OCSP_CERTID * -OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer) +OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject, const X509 *issuer) { X509_NAME *iname; - ASN1_INTEGER *serial; + const ASN1_INTEGER *serial; ASN1_BIT_STRING *ikey; #ifndef OPENSSL_NO_SHA1 @@ -89,7 +89,7 @@ OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer) #endif if (subject) { iname = X509_get_issuer_name(subject); - serial = X509_get_serialNumber(subject); + serial = X509_get0_serialNumber(subject); } else { iname = X509_get_subject_name(issuer); serial = NULL; @@ -99,8 +99,8 @@ OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer) } OCSP_CERTID * -OCSP_cert_id_new(const EVP_MD *dgst, X509_NAME *issuerName, - ASN1_BIT_STRING* issuerKey, ASN1_INTEGER *serialNumber) +OCSP_cert_id_new(const EVP_MD *dgst, const X509_NAME *issuerName, + const ASN1_BIT_STRING *issuerKey, const ASN1_INTEGER *serialNumber) { int nid; unsigned int i; @@ -180,7 +180,8 @@ OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b) * it is SSL. */ int -OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl) +OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath, + int *pssl) { char *host, *path, *port, *tmp; diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 0f7c36d2..6661a222 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pem_lib.c,v 1.45 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: pem_lib.c,v 1.48 2018/08/24 19:48:39 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -227,8 +227,7 @@ check_pem(const char *nm, const char *name) else r = 0; #ifndef OPENSSL_NO_ENGINE - if (e) - ENGINE_finish(e); + ENGINE_finish(e); #endif return r; } @@ -565,7 +564,8 @@ load_iv(char **fromp, unsigned char *to, int num) } int -PEM_write(FILE *fp, char *name, char *header, unsigned char *data, long len) +PEM_write(FILE *fp, const char *name, const char *header, + const unsigned char *data, long len) { BIO *b; int ret; @@ -581,8 +581,8 @@ PEM_write(FILE *fp, char *name, char *header, unsigned char *data, long len) } int -PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data, - long len) +PEM_write_bio(BIO *bp, const char *name, const char *header, + const unsigned char *data, long len) { int nlen, n, i, j, outl; unsigned char *buf = NULL; @@ -613,7 +613,8 @@ PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data, i = j = 0; while (len > 0) { n = (int)((len > (PEM_BUFSIZE * 5)) ? (PEM_BUFSIZE * 5) : len); - EVP_EncodeUpdate(&ctx, buf, &outl, &(data[j]), n); + if (!EVP_EncodeUpdate(&ctx, buf, &outl, &(data[j]), n)) + goto err; if ((outl) && (BIO_write(bp, (char *)buf, outl) != outl)) goto err; i += outl; diff --git a/crypto/pem/pem_sign.c b/crypto/pem/pem_sign.c index a225e897..fddeec79 100644 --- a/crypto/pem/pem_sign.c +++ b/crypto/pem/pem_sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pem_sign.c,v 1.13 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: pem_sign.c,v 1.14 2018/08/24 19:51:31 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -64,17 +64,17 @@ #include #include -void +int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) { - EVP_DigestInit_ex(ctx, type, NULL); + return EVP_DigestInit_ex(ctx, type, NULL); } -void +int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data, unsigned int count) { - EVP_DigestUpdate(ctx, data, count); + return EVP_DigestUpdate(ctx, data, count); } int diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c index 18de5d52..76cc6fef 100644 --- a/crypto/pem/pvkfmt.c +++ b/crypto/pem/pvkfmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pvkfmt.c,v 1.19 2017/05/02 03:59:44 deraadt Exp $ */ +/* $OpenBSD: pvkfmt.c,v 1.20 2018/08/05 11:19:25 bcook Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2005. */ @@ -847,17 +847,10 @@ i2b_PVK(unsigned char **out, EVP_PKEY*pk, int enclevel, pem_password_cb *cb, if (pklen < 0) return -1; outlen += pklen; - if (!out) - return outlen; - if (*out) - p = *out; - else { - p = malloc(outlen); - if (!p) { - PEMerror(ERR_R_MALLOC_FAILURE); - return -1; - } - *out = p; + p = malloc(outlen); + if (!p) { + PEMerror(ERR_R_MALLOC_FAILURE); + return -1; } write_ledword(&p, MS_PVKMAGIC); @@ -875,9 +868,10 @@ i2b_PVK(unsigned char **out, EVP_PKEY*pk, int enclevel, pem_password_cb *cb, p += PVK_SALTLEN; } do_i2b(&p, pk, 0); - if (enclevel == 0) + if (enclevel == 0) { + *out = p; return outlen; - else { + } else { char psbuf[PEM_BUFSIZE]; unsigned char keybuf[20]; int enctmplen, inlen; @@ -904,10 +898,12 @@ i2b_PVK(unsigned char **out, EVP_PKEY*pk, int enclevel, pem_password_cb *cb, goto error; } EVP_CIPHER_CTX_cleanup(&cctx); + *out = p; return outlen; error: EVP_CIPHER_CTX_cleanup(&cctx); + free(p); return -1; } diff --git a/crypto/pkcs12/p12_add.c b/crypto/pkcs12/p12_add.c index 5642a141..08bb75d3 100644 --- a/crypto/pkcs12/p12_add.c +++ b/crypto/pkcs12/p12_add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_add.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: p12_add.c,v 1.17 2018/05/13 14:24:07 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -232,7 +232,7 @@ PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen) } PKCS8_PRIV_KEY_INFO * -PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, const char *pass, int passlen) +PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag, const char *pass, int passlen) { return PKCS8_decrypt(bag->value.shkeybag, pass, passlen); } @@ -247,7 +247,7 @@ PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes) } STACK_OF(PKCS7) * -PKCS12_unpack_authsafes(PKCS12 *p12) +PKCS12_unpack_authsafes(const PKCS12 *p12) { if (!PKCS7_type_is_data(p12->authsafes)) { PKCS12error(PKCS12_R_CONTENT_TYPE_NOT_DATA); diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c index 7552cf0a..65bfaa03 100644 --- a/crypto/pkcs12/p12_attr.c +++ b/crypto/pkcs12/p12_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_attr.c,v 1.10 2014/07/11 08:44:49 jsing Exp $ */ +/* $OpenBSD: p12_attr.c,v 1.12 2018/08/24 20:07:41 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -77,14 +77,10 @@ PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen) int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage) { - unsigned char us_val; + unsigned char us_val = (unsigned char)usage; - us_val = (unsigned char) usage; - if (X509at_add1_attr_by_NID(&p8->attributes, NID_key_usage, - V_ASN1_BIT_STRING, &us_val, 1)) - return 1; - else - return 0; + return PKCS8_pkey_add1_attr_by_NID(p8, NID_key_usage, V_ASN1_BIT_STRING, + &us_val, 1); } /* Add a friendlyname to a safebag */ @@ -122,7 +118,7 @@ PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, int namelen) } ASN1_TYPE * -PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid) +PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid) { X509_ATTRIBUTE *attrib; int i; diff --git a/crypto/pkcs12/p12_crt.c b/crypto/pkcs12/p12_crt.c index af2c6afc..f8ba3357 100644 --- a/crypto/pkcs12/p12_crt.c +++ b/crypto/pkcs12/p12_crt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_crt.c,v 1.17 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: p12_crt.c,v 1.18 2018/05/13 13:46:55 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -80,7 +80,7 @@ copy_bag_attr(PKCS12_SAFEBAG *bag, EVP_PKEY *pkey, int nid) } PKCS12 * -PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, +PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, int mac_iter, int keytype) { @@ -221,7 +221,7 @@ PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert) PKCS12_SAFEBAG * PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, int key_usage, - int iter, int nid_key, char *pass) + int iter, int nid_key, const char *pass) { PKCS12_SAFEBAG *bag = NULL; PKCS8_PRIV_KEY_INFO *p8 = NULL; @@ -261,7 +261,7 @@ PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, int key_usage, int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, - int nid_safe, int iter, char *pass) + int nid_safe, int iter, const char *pass) { PKCS7 *p7 = NULL; int free_safes = 0; diff --git a/crypto/pkcs12/p12_decr.c b/crypto/pkcs12/p12_decr.c index ca08ee55..1ef5c4a8 100644 --- a/crypto/pkcs12/p12_decr.c +++ b/crypto/pkcs12/p12_decr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_decr.c,v 1.18 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: p12_decr.c,v 1.19 2018/05/13 14:22:34 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -67,8 +67,9 @@ */ unsigned char * -PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, int passlen, - unsigned char *in, int inlen, unsigned char **data, int *datalen, int en_de) +PKCS12_pbe_crypt(const X509_ALGOR *algor, const char *pass, int passlen, + const unsigned char *in, int inlen, unsigned char **data, int *datalen, + int en_de) { unsigned char *out; int outlen, i; @@ -119,8 +120,8 @@ PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, int passlen, */ void * -PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, - const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf) +PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it, + const char *pass, int passlen, const ASN1_OCTET_STRING *oct, int zbuf) { unsigned char *out; const unsigned char *p; diff --git a/crypto/pkcs12/p12_npas.c b/crypto/pkcs12/p12_npas.c index 63b3df17..d6b12eda 100644 --- a/crypto/pkcs12/p12_npas.c +++ b/crypto/pkcs12/p12_npas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_npas.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: p12_npas.c,v 1.13 2018/05/13 14:22:34 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -65,10 +65,11 @@ /* PKCS#12 password change routine */ -static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass); -static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, - char *newpass); -static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass); +static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass); +static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *oldpass, + const char *newpass); +static int newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass, + const char *newpass); static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen); /* @@ -76,7 +77,7 @@ static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen); */ int -PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass) +PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass) { /* Check for NULL PKCS12 structure */ @@ -103,7 +104,7 @@ PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass) /* Parse the outer PKCS#12 structure */ static int -newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) +newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass) { STACK_OF(PKCS7) *asafes, *newsafes; STACK_OF(PKCS12_SAFEBAG) *bags; @@ -189,7 +190,8 @@ newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) static int -newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, char *newpass) +newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *oldpass, + const char *newpass) { int i; @@ -204,7 +206,7 @@ newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, char *newpass) /* Change password of safebag: only needs handle shrouded keybags */ static int -newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass) +newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass, const char *newpass) { PKCS8_PRIV_KEY_INFO *p8; X509_SIG *p8new; diff --git a/crypto/pkcs12/p12_p8d.c b/crypto/pkcs12/p12_p8d.c index 68af6bf5..0286d4ac 100644 --- a/crypto/pkcs12/p12_p8d.c +++ b/crypto/pkcs12/p12_p8d.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_p8d.c,v 1.6 2016/12/30 15:34:35 jsing Exp $ */ +/* $OpenBSD: p12_p8d.c,v 1.7 2018/05/13 14:28:14 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -61,7 +61,7 @@ #include PKCS8_PRIV_KEY_INFO * -PKCS8_decrypt(X509_SIG *p8, const char *pass, int passlen) +PKCS8_decrypt(const X509_SIG *p8, const char *pass, int passlen) { return PKCS12_item_decrypt_d2i(p8->algor, &PKCS8_PRIV_KEY_INFO_it, pass, passlen, p8->digest, 1); diff --git a/crypto/pkcs12/p12_utl.c b/crypto/pkcs12/p12_utl.c index eb95417d..ff3a035d 100644 --- a/crypto/pkcs12/p12_utl.c +++ b/crypto/pkcs12/p12_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_utl.c,v 1.15 2016/12/30 15:34:35 jsing Exp $ */ +/* $OpenBSD: p12_utl.c,v 1.16 2018/05/30 15:32:11 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -100,7 +100,7 @@ OPENSSL_asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen) } char * -OPENSSL_uni2asc(unsigned char *uni, int unilen) +OPENSSL_uni2asc(const unsigned char *uni, int unilen) { size_t asclen, u16len, i; char *asctmp; diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index 24ab957b..d0c27e98 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pk7_doit.c,v 1.42 2017/05/02 03:59:45 deraadt Exp $ */ +/* $OpenBSD: pk7_doit.c,v 1.43 2019/03/13 20:34:00 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -410,7 +410,7 @@ pkcs7_cmp_ri(PKCS7_RECIP_INFO *ri, X509 *pcert) pcert->cert_info->issuer); if (ret) return ret; - return ASN1_STRING_cmp(pcert->cert_info->serialNumber, + return ASN1_INTEGER_cmp(pcert->cert_info->serialNumber, ri->issuer_and_serial->serial); } diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c index dc407dad..28f812a8 100644 --- a/crypto/pkcs7/pk7_lib.c +++ b/crypto/pkcs7/pk7_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pk7_lib.c,v 1.19 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: pk7_lib.c,v 1.20 2019/03/13 20:34:00 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -374,7 +374,7 @@ PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, * things the ugly way. */ ASN1_INTEGER_free(p7i->issuer_and_serial->serial); if (!(p7i->issuer_and_serial->serial = - ASN1_STRING_dup(X509_get_serialNumber(x509)))) + ASN1_INTEGER_dup(X509_get_serialNumber(x509)))) goto err; /* lets keep the pkey around for a while */ @@ -534,7 +534,7 @@ PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509) ASN1_INTEGER_free(p7i->issuer_and_serial->serial); if (!(p7i->issuer_and_serial->serial = - ASN1_STRING_dup(X509_get_serialNumber(x509)))) + ASN1_INTEGER_dup(X509_get_serialNumber(x509)))) return 0; pkey = X509_get_pubkey(x509); diff --git a/crypto/rc4/rc4-elf-x86_64.S b/crypto/rc4/rc4-elf-x86_64.S index 3062b3a8..4f90dd5f 100644 --- a/crypto/rc4/rc4-elf-x86_64.S +++ b/crypto/rc4/rc4-elf-x86_64.S @@ -8,7 +8,7 @@ .align 16 RC4: orq %rsi,%rsi jne .Lentry - .byte 0xf3,0xc3 + retq .Lentry: pushq %rbx pushq %r12 @@ -517,7 +517,7 @@ RC4: orq %rsi,%rsi movq 16(%rsp),%rbx addq $24,%rsp .Lepilogue: - .byte 0xf3,0xc3 + retq .size RC4,.-RC4 .globl RC4_set_key .type RC4_set_key,@function @@ -588,7 +588,7 @@ RC4_set_key: xorl %eax,%eax movl %eax,-8(%rdi) movl %eax,-4(%rdi) - .byte 0xf3,0xc3 + retq .size RC4_set_key,.-RC4_set_key .globl RC4_options @@ -602,11 +602,11 @@ RC4_options: btl $IA32CAP_BIT0_INTEL,%edx jnc .Ldone addq $25,%rax - .byte 0xf3,0xc3 + retq .L8xchar: addq $12,%rax .Ldone: - .byte 0xf3,0xc3 + retq .align 64 .Lopts: .byte 114,99,52,40,56,120,44,105,110,116,41,0 diff --git a/crypto/rc4/rc4-macosx-x86_64.S b/crypto/rc4/rc4-macosx-x86_64.S index c060a12f..ce58e4ab 100644 --- a/crypto/rc4/rc4-macosx-x86_64.S +++ b/crypto/rc4/rc4-macosx-x86_64.S @@ -8,7 +8,7 @@ .p2align 4 _RC4: orq %rsi,%rsi jne L$entry - .byte 0xf3,0xc3 + retq L$entry: pushq %rbx pushq %r12 @@ -517,7 +517,7 @@ L$exit: movq 16(%rsp),%rbx addq $24,%rsp L$epilogue: - .byte 0xf3,0xc3 + retq .globl _RC4_set_key @@ -588,7 +588,7 @@ L$exit_key: xorl %eax,%eax movl %eax,-8(%rdi) movl %eax,-4(%rdi) - .byte 0xf3,0xc3 + retq .globl _RC4_options @@ -602,11 +602,11 @@ _RC4_options: btl $IA32CAP_BIT0_INTEL,%edx jnc L$done addq $25,%rax - .byte 0xf3,0xc3 + retq L$8xchar: addq $12,%rax L$done: - .byte 0xf3,0xc3 + retq .p2align 6 L$opts: .byte 114,99,52,40,56,120,44,105,110,116,41,0 diff --git a/crypto/rc4/rc4-masm-x86_64.S b/crypto/rc4/rc4-masm-x86_64.S new file mode 100644 index 00000000..8dd68e2d --- /dev/null +++ b/crypto/rc4/rc4-masm-x86_64.S @@ -0,0 +1,651 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' +EXTERN OPENSSL_ia32cap_P:NEAR + + +PUBLIC RC4 + +ALIGN 16 +RC4 PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_RC4:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + + or rsi,rsi + jne $L$entry + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$entry:: + push rbx + push r12 + push r13 +$L$prologue:: + mov r11,rsi + mov r12,rdx + mov r13,rcx + xor r10,r10 + xor rcx,rcx + + lea rdi,QWORD PTR[8+rdi] + mov r10b,BYTE PTR[((-8))+rdi] + mov cl,BYTE PTR[((-4))+rdi] + cmp DWORD PTR[256+rdi],-1 + je $L$RC4_CHAR + mov r8d,DWORD PTR[OPENSSL_ia32cap_P] + xor rbx,rbx + inc r10b + sub rbx,r10 + sub r13,r12 + mov eax,DWORD PTR[r10*4+rdi] + test r11,-16 + jz $L$loop1 + bt r8d,IA32CAP_BIT0_INTEL + jc $L$intel + and rbx,7 + lea rsi,QWORD PTR[1+r10] + jz $L$oop8 + sub r11,rbx +$L$oop8_warmup:: + add cl,al + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + mov DWORD PTR[r10*4+rdi],edx + add al,dl + inc r10b + mov edx,DWORD PTR[rax*4+rdi] + mov eax,DWORD PTR[r10*4+rdi] + xor dl,BYTE PTR[r12] + mov BYTE PTR[r12*1+r13],dl + lea r12,QWORD PTR[1+r12] + dec rbx + jnz $L$oop8_warmup + + lea rsi,QWORD PTR[1+r10] + jmp $L$oop8 +ALIGN 16 +$L$oop8:: + add cl,al + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + mov ebx,DWORD PTR[rsi*4+rdi] + ror r8,8 + mov DWORD PTR[r10*4+rdi],edx + add dl,al + mov r8b,BYTE PTR[rdx*4+rdi] + add cl,bl + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + mov eax,DWORD PTR[4+rsi*4+rdi] + ror r8,8 + mov DWORD PTR[4+r10*4+rdi],edx + add dl,bl + mov r8b,BYTE PTR[rdx*4+rdi] + add cl,al + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + mov ebx,DWORD PTR[8+rsi*4+rdi] + ror r8,8 + mov DWORD PTR[8+r10*4+rdi],edx + add dl,al + mov r8b,BYTE PTR[rdx*4+rdi] + add cl,bl + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + mov eax,DWORD PTR[12+rsi*4+rdi] + ror r8,8 + mov DWORD PTR[12+r10*4+rdi],edx + add dl,bl + mov r8b,BYTE PTR[rdx*4+rdi] + add cl,al + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + mov ebx,DWORD PTR[16+rsi*4+rdi] + ror r8,8 + mov DWORD PTR[16+r10*4+rdi],edx + add dl,al + mov r8b,BYTE PTR[rdx*4+rdi] + add cl,bl + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + mov eax,DWORD PTR[20+rsi*4+rdi] + ror r8,8 + mov DWORD PTR[20+r10*4+rdi],edx + add dl,bl + mov r8b,BYTE PTR[rdx*4+rdi] + add cl,al + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + mov ebx,DWORD PTR[24+rsi*4+rdi] + ror r8,8 + mov DWORD PTR[24+r10*4+rdi],edx + add dl,al + mov r8b,BYTE PTR[rdx*4+rdi] + add sil,8 + add cl,bl + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + mov eax,DWORD PTR[((-4))+rsi*4+rdi] + ror r8,8 + mov DWORD PTR[28+r10*4+rdi],edx + add dl,bl + mov r8b,BYTE PTR[rdx*4+rdi] + add r10b,8 + ror r8,8 + sub r11,8 + + xor r8,QWORD PTR[r12] + mov QWORD PTR[r12*1+r13],r8 + lea r12,QWORD PTR[8+r12] + + test r11,-8 + jnz $L$oop8 + cmp r11,0 + jne $L$loop1 + jmp $L$exit + +ALIGN 16 +$L$intel:: + test r11,-32 + jz $L$loop1 + and rbx,15 + jz $L$oop16_is_hot + sub r11,rbx +$L$oop16_warmup:: + add cl,al + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + mov DWORD PTR[r10*4+rdi],edx + add al,dl + inc r10b + mov edx,DWORD PTR[rax*4+rdi] + mov eax,DWORD PTR[r10*4+rdi] + xor dl,BYTE PTR[r12] + mov BYTE PTR[r12*1+r13],dl + lea r12,QWORD PTR[1+r12] + dec rbx + jnz $L$oop16_warmup + + mov rbx,rcx + xor rcx,rcx + mov cl,bl + +$L$oop16_is_hot:: + lea rsi,QWORD PTR[r10*4+rdi] + add cl,al + mov edx,DWORD PTR[rcx*4+rdi] + pxor xmm0,xmm0 + mov DWORD PTR[rcx*4+rdi],eax + add al,dl + mov ebx,DWORD PTR[4+rsi] + movzx eax,al + mov DWORD PTR[rsi],edx + add cl,bl + pinsrw xmm0,WORD PTR[rax*4+rdi],0 + jmp $L$oop16_enter +ALIGN 16 +$L$oop16:: + add cl,al + mov edx,DWORD PTR[rcx*4+rdi] + pxor xmm2,xmm0 + psllq xmm1,8 + pxor xmm0,xmm0 + mov DWORD PTR[rcx*4+rdi],eax + add al,dl + mov ebx,DWORD PTR[4+rsi] + movzx eax,al + mov DWORD PTR[rsi],edx + pxor xmm2,xmm1 + add cl,bl + pinsrw xmm0,WORD PTR[rax*4+rdi],0 + movdqu XMMWORD PTR[r12*1+r13],xmm2 + lea r12,QWORD PTR[16+r12] +$L$oop16_enter:: + mov edx,DWORD PTR[rcx*4+rdi] + pxor xmm1,xmm1 + mov DWORD PTR[rcx*4+rdi],ebx + add bl,dl + mov eax,DWORD PTR[8+rsi] + movzx ebx,bl + mov DWORD PTR[4+rsi],edx + add cl,al + pinsrw xmm1,WORD PTR[rbx*4+rdi],0 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + add al,dl + mov ebx,DWORD PTR[12+rsi] + movzx eax,al + mov DWORD PTR[8+rsi],edx + add cl,bl + pinsrw xmm0,WORD PTR[rax*4+rdi],1 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + add bl,dl + mov eax,DWORD PTR[16+rsi] + movzx ebx,bl + mov DWORD PTR[12+rsi],edx + add cl,al + pinsrw xmm1,WORD PTR[rbx*4+rdi],1 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + add al,dl + mov ebx,DWORD PTR[20+rsi] + movzx eax,al + mov DWORD PTR[16+rsi],edx + add cl,bl + pinsrw xmm0,WORD PTR[rax*4+rdi],2 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + add bl,dl + mov eax,DWORD PTR[24+rsi] + movzx ebx,bl + mov DWORD PTR[20+rsi],edx + add cl,al + pinsrw xmm1,WORD PTR[rbx*4+rdi],2 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + add al,dl + mov ebx,DWORD PTR[28+rsi] + movzx eax,al + mov DWORD PTR[24+rsi],edx + add cl,bl + pinsrw xmm0,WORD PTR[rax*4+rdi],3 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + add bl,dl + mov eax,DWORD PTR[32+rsi] + movzx ebx,bl + mov DWORD PTR[28+rsi],edx + add cl,al + pinsrw xmm1,WORD PTR[rbx*4+rdi],3 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + add al,dl + mov ebx,DWORD PTR[36+rsi] + movzx eax,al + mov DWORD PTR[32+rsi],edx + add cl,bl + pinsrw xmm0,WORD PTR[rax*4+rdi],4 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + add bl,dl + mov eax,DWORD PTR[40+rsi] + movzx ebx,bl + mov DWORD PTR[36+rsi],edx + add cl,al + pinsrw xmm1,WORD PTR[rbx*4+rdi],4 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + add al,dl + mov ebx,DWORD PTR[44+rsi] + movzx eax,al + mov DWORD PTR[40+rsi],edx + add cl,bl + pinsrw xmm0,WORD PTR[rax*4+rdi],5 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + add bl,dl + mov eax,DWORD PTR[48+rsi] + movzx ebx,bl + mov DWORD PTR[44+rsi],edx + add cl,al + pinsrw xmm1,WORD PTR[rbx*4+rdi],5 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + add al,dl + mov ebx,DWORD PTR[52+rsi] + movzx eax,al + mov DWORD PTR[48+rsi],edx + add cl,bl + pinsrw xmm0,WORD PTR[rax*4+rdi],6 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + add bl,dl + mov eax,DWORD PTR[56+rsi] + movzx ebx,bl + mov DWORD PTR[52+rsi],edx + add cl,al + pinsrw xmm1,WORD PTR[rbx*4+rdi],6 + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + add al,dl + mov ebx,DWORD PTR[60+rsi] + movzx eax,al + mov DWORD PTR[56+rsi],edx + add cl,bl + pinsrw xmm0,WORD PTR[rax*4+rdi],7 + add r10b,16 + movdqu xmm2,XMMWORD PTR[r12] + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],ebx + add bl,dl + movzx ebx,bl + mov DWORD PTR[60+rsi],edx + lea rsi,QWORD PTR[r10*4+rdi] + pinsrw xmm1,WORD PTR[rbx*4+rdi],7 + mov eax,DWORD PTR[rsi] + mov rbx,rcx + xor rcx,rcx + sub r11,16 + mov cl,bl + test r11,-16 + jnz $L$oop16 + + psllq xmm1,8 + pxor xmm2,xmm0 + pxor xmm2,xmm1 + movdqu XMMWORD PTR[r12*1+r13],xmm2 + lea r12,QWORD PTR[16+r12] + + cmp r11,0 + jne $L$loop1 + jmp $L$exit + +ALIGN 16 +$L$loop1:: + add cl,al + mov edx,DWORD PTR[rcx*4+rdi] + mov DWORD PTR[rcx*4+rdi],eax + mov DWORD PTR[r10*4+rdi],edx + add al,dl + inc r10b + mov edx,DWORD PTR[rax*4+rdi] + mov eax,DWORD PTR[r10*4+rdi] + xor dl,BYTE PTR[r12] + mov BYTE PTR[r12*1+r13],dl + lea r12,QWORD PTR[1+r12] + dec r11 + jnz $L$loop1 + jmp $L$exit + +ALIGN 16 +$L$RC4_CHAR:: + add r10b,1 + movzx eax,BYTE PTR[r10*1+rdi] + test r11,-8 + jz $L$cloop1 + jmp $L$cloop8 +ALIGN 16 +$L$cloop8:: + mov r8d,DWORD PTR[r12] + mov r9d,DWORD PTR[4+r12] + add cl,al + lea rsi,QWORD PTR[1+r10] + movzx edx,BYTE PTR[rcx*1+rdi] + movzx esi,sil + movzx ebx,BYTE PTR[rsi*1+rdi] + mov BYTE PTR[rcx*1+rdi],al + cmp rcx,rsi + mov BYTE PTR[r10*1+rdi],dl + jne $L$cmov0 + mov rbx,rax +$L$cmov0:: + add dl,al + xor r8b,BYTE PTR[rdx*1+rdi] + ror r8d,8 + add cl,bl + lea r10,QWORD PTR[1+rsi] + movzx edx,BYTE PTR[rcx*1+rdi] + movzx r10d,r10b + movzx eax,BYTE PTR[r10*1+rdi] + mov BYTE PTR[rcx*1+rdi],bl + cmp rcx,r10 + mov BYTE PTR[rsi*1+rdi],dl + jne $L$cmov1 + mov rax,rbx +$L$cmov1:: + add dl,bl + xor r8b,BYTE PTR[rdx*1+rdi] + ror r8d,8 + add cl,al + lea rsi,QWORD PTR[1+r10] + movzx edx,BYTE PTR[rcx*1+rdi] + movzx esi,sil + movzx ebx,BYTE PTR[rsi*1+rdi] + mov BYTE PTR[rcx*1+rdi],al + cmp rcx,rsi + mov BYTE PTR[r10*1+rdi],dl + jne $L$cmov2 + mov rbx,rax +$L$cmov2:: + add dl,al + xor r8b,BYTE PTR[rdx*1+rdi] + ror r8d,8 + add cl,bl + lea r10,QWORD PTR[1+rsi] + movzx edx,BYTE PTR[rcx*1+rdi] + movzx r10d,r10b + movzx eax,BYTE PTR[r10*1+rdi] + mov BYTE PTR[rcx*1+rdi],bl + cmp rcx,r10 + mov BYTE PTR[rsi*1+rdi],dl + jne $L$cmov3 + mov rax,rbx +$L$cmov3:: + add dl,bl + xor r8b,BYTE PTR[rdx*1+rdi] + ror r8d,8 + add cl,al + lea rsi,QWORD PTR[1+r10] + movzx edx,BYTE PTR[rcx*1+rdi] + movzx esi,sil + movzx ebx,BYTE PTR[rsi*1+rdi] + mov BYTE PTR[rcx*1+rdi],al + cmp rcx,rsi + mov BYTE PTR[r10*1+rdi],dl + jne $L$cmov4 + mov rbx,rax +$L$cmov4:: + add dl,al + xor r9b,BYTE PTR[rdx*1+rdi] + ror r9d,8 + add cl,bl + lea r10,QWORD PTR[1+rsi] + movzx edx,BYTE PTR[rcx*1+rdi] + movzx r10d,r10b + movzx eax,BYTE PTR[r10*1+rdi] + mov BYTE PTR[rcx*1+rdi],bl + cmp rcx,r10 + mov BYTE PTR[rsi*1+rdi],dl + jne $L$cmov5 + mov rax,rbx +$L$cmov5:: + add dl,bl + xor r9b,BYTE PTR[rdx*1+rdi] + ror r9d,8 + add cl,al + lea rsi,QWORD PTR[1+r10] + movzx edx,BYTE PTR[rcx*1+rdi] + movzx esi,sil + movzx ebx,BYTE PTR[rsi*1+rdi] + mov BYTE PTR[rcx*1+rdi],al + cmp rcx,rsi + mov BYTE PTR[r10*1+rdi],dl + jne $L$cmov6 + mov rbx,rax +$L$cmov6:: + add dl,al + xor r9b,BYTE PTR[rdx*1+rdi] + ror r9d,8 + add cl,bl + lea r10,QWORD PTR[1+rsi] + movzx edx,BYTE PTR[rcx*1+rdi] + movzx r10d,r10b + movzx eax,BYTE PTR[r10*1+rdi] + mov BYTE PTR[rcx*1+rdi],bl + cmp rcx,r10 + mov BYTE PTR[rsi*1+rdi],dl + jne $L$cmov7 + mov rax,rbx +$L$cmov7:: + add dl,bl + xor r9b,BYTE PTR[rdx*1+rdi] + ror r9d,8 + lea r11,QWORD PTR[((-8))+r11] + mov DWORD PTR[r13],r8d + lea r12,QWORD PTR[8+r12] + mov DWORD PTR[4+r13],r9d + lea r13,QWORD PTR[8+r13] + + test r11,-8 + jnz $L$cloop8 + cmp r11,0 + jne $L$cloop1 + jmp $L$exit +ALIGN 16 +$L$cloop1:: + add cl,al + movzx ecx,cl + movzx edx,BYTE PTR[rcx*1+rdi] + mov BYTE PTR[rcx*1+rdi],al + mov BYTE PTR[r10*1+rdi],dl + add dl,al + add r10b,1 + movzx edx,dl + movzx r10d,r10b + movzx edx,BYTE PTR[rdx*1+rdi] + movzx eax,BYTE PTR[r10*1+rdi] + xor dl,BYTE PTR[r12] + lea r12,QWORD PTR[1+r12] + mov BYTE PTR[r13],dl + lea r13,QWORD PTR[1+r13] + sub r11,1 + jnz $L$cloop1 + jmp $L$exit + +ALIGN 16 +$L$exit:: + sub r10b,1 + mov DWORD PTR[((-8))+rdi],r10d + mov DWORD PTR[((-4))+rdi],ecx + + mov r13,QWORD PTR[rsp] + mov r12,QWORD PTR[8+rsp] + mov rbx,QWORD PTR[16+rsp] + add rsp,24 +$L$epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_RC4:: +RC4 ENDP +PUBLIC RC4_set_key + +ALIGN 16 +RC4_set_key PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_RC4_set_key:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + lea rdi,QWORD PTR[8+rdi] + lea rdx,QWORD PTR[rsi*1+rdx] + neg rsi + mov rcx,rsi + xor eax,eax + xor r9,r9 + xor r10,r10 + xor r11,r11 + + mov r8d,DWORD PTR[OPENSSL_ia32cap_P] + bt r8d,IA32CAP_BIT0_INTELP4 + jc $L$c1stloop + jmp $L$w1stloop + +ALIGN 16 +$L$w1stloop:: + mov DWORD PTR[rax*4+rdi],eax + add al,1 + jnc $L$w1stloop + + xor r9,r9 + xor r8,r8 +ALIGN 16 +$L$w2ndloop:: + mov r10d,DWORD PTR[r9*4+rdi] + add r8b,BYTE PTR[rsi*1+rdx] + add r8b,r10b + add rsi,1 + mov r11d,DWORD PTR[r8*4+rdi] + cmovz rsi,rcx + mov DWORD PTR[r8*4+rdi],r10d + mov DWORD PTR[r9*4+rdi],r11d + add r9b,1 + jnc $L$w2ndloop + jmp $L$exit_key + +ALIGN 16 +$L$c1stloop:: + mov BYTE PTR[rax*1+rdi],al + add al,1 + jnc $L$c1stloop + + xor r9,r9 + xor r8,r8 +ALIGN 16 +$L$c2ndloop:: + mov r10b,BYTE PTR[r9*1+rdi] + add r8b,BYTE PTR[rsi*1+rdx] + add r8b,r10b + add rsi,1 + mov r11b,BYTE PTR[r8*1+rdi] + jnz $L$cnowrap + mov rsi,rcx +$L$cnowrap:: + mov BYTE PTR[r8*1+rdi],r10b + mov BYTE PTR[r9*1+rdi],r11b + add r9b,1 + jnc $L$c2ndloop + mov DWORD PTR[256+rdi],-1 + +ALIGN 16 +$L$exit_key:: + xor eax,eax + mov DWORD PTR[((-8))+rdi],eax + mov DWORD PTR[((-4))+rdi],eax + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_RC4_set_key:: +RC4_set_key ENDP + +PUBLIC RC4_options + +ALIGN 16 +RC4_options PROC PUBLIC + lea rax,QWORD PTR[$L$opts] + mov edx,DWORD PTR[OPENSSL_ia32cap_P] + bt edx,IA32CAP_BIT0_INTELP4 + jc $L$8xchar + bt edx,IA32CAP_BIT0_INTEL + jnc $L$done + add rax,25 + DB 0F3h,0C3h ;repret +$L$8xchar:: + add rax,12 +$L$done:: + DB 0F3h,0C3h ;repret +ALIGN 64 +$L$opts:: +DB 114,99,52,40,56,120,44,105,110,116,41,0 +DB 114,99,52,40,56,120,44,99,104,97,114,41,0 +DB 114,99,52,40,49,54,120,44,105,110,116,41,0 +DB 82,67,52,32,102,111,114,32,120,56,54,95,54,52,44,32 +DB 67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97 +DB 112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103 +DB 62,0 +ALIGN 64 +RC4_options ENDP + +.text$ ENDS +END diff --git a/crypto/rc4/rc4-md5-elf-x86_64.S b/crypto/rc4/rc4-md5-elf-x86_64.S index c4fbfdc4..52b50fe6 100644 --- a/crypto/rc4/rc4-md5-elf-x86_64.S +++ b/crypto/rc4/rc4-md5-elf-x86_64.S @@ -1256,7 +1256,7 @@ rc4_md5_enc: leaq 88(%rsp),%rsp .Lepilogue: .Labort: - .byte 0xf3,0xc3 + retq .size rc4_md5_enc,.-rc4_md5_enc #if defined(HAVE_GNU_STACK) .section .note.GNU-stack,"",%progbits diff --git a/crypto/rc4/rc4-md5-macosx-x86_64.S b/crypto/rc4/rc4-md5-macosx-x86_64.S index 4903918b..a8f6955f 100644 --- a/crypto/rc4/rc4-md5-macosx-x86_64.S +++ b/crypto/rc4/rc4-md5-macosx-x86_64.S @@ -1256,5 +1256,5 @@ L$oop: leaq 88(%rsp),%rsp L$epilogue: L$abort: - .byte 0xf3,0xc3 + retq diff --git a/crypto/rc4/rc4-md5-masm-x86_64.S b/crypto/rc4/rc4-md5-masm-x86_64.S new file mode 100644 index 00000000..a98b2060 --- /dev/null +++ b/crypto/rc4/rc4-md5-masm-x86_64.S @@ -0,0 +1,1279 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' +ALIGN 16 + +PUBLIC rc4_md5_enc + +rc4_md5_enc PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_rc4_md5_enc:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + mov r8,QWORD PTR[40+rsp] + mov r9,QWORD PTR[48+rsp] + + + cmp r9,0 + je $L$abort + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + sub rsp,40 +$L$body:: + mov r11,rcx + mov r12,r9 + mov r13,rsi + mov r14,rdx + mov r15,r8 + xor rbp,rbp + xor rcx,rcx + + lea rdi,QWORD PTR[8+rdi] + mov bpl,BYTE PTR[((-8))+rdi] + mov cl,BYTE PTR[((-4))+rdi] + + inc bpl + sub r14,r13 + mov eax,DWORD PTR[rbp*4+rdi] + add cl,al + lea rsi,QWORD PTR[rbp*4+rdi] + shl r12,6 + add r12,r15 + mov QWORD PTR[16+rsp],r12 + + mov QWORD PTR[24+rsp],r11 + mov r8d,DWORD PTR[r11] + mov r9d,DWORD PTR[4+r11] + mov r10d,DWORD PTR[8+r11] + mov r11d,DWORD PTR[12+r11] + jmp $L$oop + +ALIGN 16 +$L$oop:: + mov DWORD PTR[rsp],r8d + mov DWORD PTR[4+rsp],r9d + mov DWORD PTR[8+rsp],r10d + mov r12d,r11d + mov DWORD PTR[12+rsp],r11d + pxor xmm0,xmm0 + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r9d + add r8d,DWORD PTR[r15] + add al,dl + mov ebx,DWORD PTR[4+rsi] + add r8d,3614090360 + xor r12d,r11d + movzx eax,al + mov DWORD PTR[rsi],edx + add r8d,r12d + add cl,bl + rol r8d,7 + mov r12d,r10d + movd xmm0,DWORD PTR[rax*4+rdi] + + add r8d,r9d + pxor xmm1,xmm1 + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r8d + add r11d,DWORD PTR[4+r15] + add bl,dl + mov eax,DWORD PTR[8+rsi] + add r11d,3905402710 + xor r12d,r10d + movzx ebx,bl + mov DWORD PTR[4+rsi],edx + add r11d,r12d + add cl,al + rol r11d,12 + mov r12d,r9d + movd xmm1,DWORD PTR[rbx*4+rdi] + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r11d + add r10d,DWORD PTR[8+r15] + add al,dl + mov ebx,DWORD PTR[12+rsi] + add r10d,606105819 + xor r12d,r9d + movzx eax,al + mov DWORD PTR[8+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,17 + mov r12d,r8d + pinsrw xmm0,WORD PTR[rax*4+rdi],1 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r10d + add r9d,DWORD PTR[12+r15] + add bl,dl + mov eax,DWORD PTR[16+rsi] + add r9d,3250441966 + xor r12d,r8d + movzx ebx,bl + mov DWORD PTR[12+rsi],edx + add r9d,r12d + add cl,al + rol r9d,22 + mov r12d,r11d + pinsrw xmm1,WORD PTR[rbx*4+rdi],1 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r9d + add r8d,DWORD PTR[16+r15] + add al,dl + mov ebx,DWORD PTR[20+rsi] + add r8d,4118548399 + xor r12d,r11d + movzx eax,al + mov DWORD PTR[16+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,7 + mov r12d,r10d + pinsrw xmm0,WORD PTR[rax*4+rdi],2 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r8d + add r11d,DWORD PTR[20+r15] + add bl,dl + mov eax,DWORD PTR[24+rsi] + add r11d,1200080426 + xor r12d,r10d + movzx ebx,bl + mov DWORD PTR[20+rsi],edx + add r11d,r12d + add cl,al + rol r11d,12 + mov r12d,r9d + pinsrw xmm1,WORD PTR[rbx*4+rdi],2 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r11d + add r10d,DWORD PTR[24+r15] + add al,dl + mov ebx,DWORD PTR[28+rsi] + add r10d,2821735955 + xor r12d,r9d + movzx eax,al + mov DWORD PTR[24+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,17 + mov r12d,r8d + pinsrw xmm0,WORD PTR[rax*4+rdi],3 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r10d + add r9d,DWORD PTR[28+r15] + add bl,dl + mov eax,DWORD PTR[32+rsi] + add r9d,4249261313 + xor r12d,r8d + movzx ebx,bl + mov DWORD PTR[28+rsi],edx + add r9d,r12d + add cl,al + rol r9d,22 + mov r12d,r11d + pinsrw xmm1,WORD PTR[rbx*4+rdi],3 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r9d + add r8d,DWORD PTR[32+r15] + add al,dl + mov ebx,DWORD PTR[36+rsi] + add r8d,1770035416 + xor r12d,r11d + movzx eax,al + mov DWORD PTR[32+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,7 + mov r12d,r10d + pinsrw xmm0,WORD PTR[rax*4+rdi],4 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r8d + add r11d,DWORD PTR[36+r15] + add bl,dl + mov eax,DWORD PTR[40+rsi] + add r11d,2336552879 + xor r12d,r10d + movzx ebx,bl + mov DWORD PTR[36+rsi],edx + add r11d,r12d + add cl,al + rol r11d,12 + mov r12d,r9d + pinsrw xmm1,WORD PTR[rbx*4+rdi],4 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r11d + add r10d,DWORD PTR[40+r15] + add al,dl + mov ebx,DWORD PTR[44+rsi] + add r10d,4294925233 + xor r12d,r9d + movzx eax,al + mov DWORD PTR[40+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,17 + mov r12d,r8d + pinsrw xmm0,WORD PTR[rax*4+rdi],5 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r10d + add r9d,DWORD PTR[44+r15] + add bl,dl + mov eax,DWORD PTR[48+rsi] + add r9d,2304563134 + xor r12d,r8d + movzx ebx,bl + mov DWORD PTR[44+rsi],edx + add r9d,r12d + add cl,al + rol r9d,22 + mov r12d,r11d + pinsrw xmm1,WORD PTR[rbx*4+rdi],5 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r9d + add r8d,DWORD PTR[48+r15] + add al,dl + mov ebx,DWORD PTR[52+rsi] + add r8d,1804603682 + xor r12d,r11d + movzx eax,al + mov DWORD PTR[48+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,7 + mov r12d,r10d + pinsrw xmm0,WORD PTR[rax*4+rdi],6 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r8d + add r11d,DWORD PTR[52+r15] + add bl,dl + mov eax,DWORD PTR[56+rsi] + add r11d,4254626195 + xor r12d,r10d + movzx ebx,bl + mov DWORD PTR[52+rsi],edx + add r11d,r12d + add cl,al + rol r11d,12 + mov r12d,r9d + pinsrw xmm1,WORD PTR[rbx*4+rdi],6 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r11d + add r10d,DWORD PTR[56+r15] + add al,dl + mov ebx,DWORD PTR[60+rsi] + add r10d,2792965006 + xor r12d,r9d + movzx eax,al + mov DWORD PTR[56+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,17 + mov r12d,r8d + pinsrw xmm0,WORD PTR[rax*4+rdi],7 + + add r10d,r11d + movdqu xmm2,XMMWORD PTR[r13] + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r10d + add r9d,DWORD PTR[60+r15] + add bl,dl + mov eax,DWORD PTR[64+rsi] + add r9d,1236535329 + xor r12d,r8d + movzx ebx,bl + mov DWORD PTR[60+rsi],edx + add r9d,r12d + add cl,al + rol r9d,22 + mov r12d,r10d + pinsrw xmm1,WORD PTR[rbx*4+rdi],7 + + add r9d,r10d + psllq xmm1,8 + pxor xmm2,xmm0 + pxor xmm2,xmm1 + pxor xmm0,xmm0 + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r11d + add r8d,DWORD PTR[4+r15] + add al,dl + mov ebx,DWORD PTR[68+rsi] + add r8d,4129170786 + xor r12d,r10d + movzx eax,al + mov DWORD PTR[64+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,5 + mov r12d,r9d + movd xmm0,DWORD PTR[rax*4+rdi] + + add r8d,r9d + pxor xmm1,xmm1 + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r10d + add r11d,DWORD PTR[24+r15] + add bl,dl + mov eax,DWORD PTR[72+rsi] + add r11d,3225465664 + xor r12d,r9d + movzx ebx,bl + mov DWORD PTR[68+rsi],edx + add r11d,r12d + add cl,al + rol r11d,9 + mov r12d,r8d + movd xmm1,DWORD PTR[rbx*4+rdi] + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r9d + add r10d,DWORD PTR[44+r15] + add al,dl + mov ebx,DWORD PTR[76+rsi] + add r10d,643717713 + xor r12d,r8d + movzx eax,al + mov DWORD PTR[72+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,14 + mov r12d,r11d + pinsrw xmm0,WORD PTR[rax*4+rdi],1 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r8d + add r9d,DWORD PTR[r15] + add bl,dl + mov eax,DWORD PTR[80+rsi] + add r9d,3921069994 + xor r12d,r11d + movzx ebx,bl + mov DWORD PTR[76+rsi],edx + add r9d,r12d + add cl,al + rol r9d,20 + mov r12d,r10d + pinsrw xmm1,WORD PTR[rbx*4+rdi],1 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r11d + add r8d,DWORD PTR[20+r15] + add al,dl + mov ebx,DWORD PTR[84+rsi] + add r8d,3593408605 + xor r12d,r10d + movzx eax,al + mov DWORD PTR[80+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,5 + mov r12d,r9d + pinsrw xmm0,WORD PTR[rax*4+rdi],2 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r10d + add r11d,DWORD PTR[40+r15] + add bl,dl + mov eax,DWORD PTR[88+rsi] + add r11d,38016083 + xor r12d,r9d + movzx ebx,bl + mov DWORD PTR[84+rsi],edx + add r11d,r12d + add cl,al + rol r11d,9 + mov r12d,r8d + pinsrw xmm1,WORD PTR[rbx*4+rdi],2 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r9d + add r10d,DWORD PTR[60+r15] + add al,dl + mov ebx,DWORD PTR[92+rsi] + add r10d,3634488961 + xor r12d,r8d + movzx eax,al + mov DWORD PTR[88+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,14 + mov r12d,r11d + pinsrw xmm0,WORD PTR[rax*4+rdi],3 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r8d + add r9d,DWORD PTR[16+r15] + add bl,dl + mov eax,DWORD PTR[96+rsi] + add r9d,3889429448 + xor r12d,r11d + movzx ebx,bl + mov DWORD PTR[92+rsi],edx + add r9d,r12d + add cl,al + rol r9d,20 + mov r12d,r10d + pinsrw xmm1,WORD PTR[rbx*4+rdi],3 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r11d + add r8d,DWORD PTR[36+r15] + add al,dl + mov ebx,DWORD PTR[100+rsi] + add r8d,568446438 + xor r12d,r10d + movzx eax,al + mov DWORD PTR[96+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,5 + mov r12d,r9d + pinsrw xmm0,WORD PTR[rax*4+rdi],4 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r10d + add r11d,DWORD PTR[56+r15] + add bl,dl + mov eax,DWORD PTR[104+rsi] + add r11d,3275163606 + xor r12d,r9d + movzx ebx,bl + mov DWORD PTR[100+rsi],edx + add r11d,r12d + add cl,al + rol r11d,9 + mov r12d,r8d + pinsrw xmm1,WORD PTR[rbx*4+rdi],4 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r9d + add r10d,DWORD PTR[12+r15] + add al,dl + mov ebx,DWORD PTR[108+rsi] + add r10d,4107603335 + xor r12d,r8d + movzx eax,al + mov DWORD PTR[104+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,14 + mov r12d,r11d + pinsrw xmm0,WORD PTR[rax*4+rdi],5 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r8d + add r9d,DWORD PTR[32+r15] + add bl,dl + mov eax,DWORD PTR[112+rsi] + add r9d,1163531501 + xor r12d,r11d + movzx ebx,bl + mov DWORD PTR[108+rsi],edx + add r9d,r12d + add cl,al + rol r9d,20 + mov r12d,r10d + pinsrw xmm1,WORD PTR[rbx*4+rdi],5 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r11d + add r8d,DWORD PTR[52+r15] + add al,dl + mov ebx,DWORD PTR[116+rsi] + add r8d,2850285829 + xor r12d,r10d + movzx eax,al + mov DWORD PTR[112+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,5 + mov r12d,r9d + pinsrw xmm0,WORD PTR[rax*4+rdi],6 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r10d + add r11d,DWORD PTR[8+r15] + add bl,dl + mov eax,DWORD PTR[120+rsi] + add r11d,4243563512 + xor r12d,r9d + movzx ebx,bl + mov DWORD PTR[116+rsi],edx + add r11d,r12d + add cl,al + rol r11d,9 + mov r12d,r8d + pinsrw xmm1,WORD PTR[rbx*4+rdi],6 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],eax + and r12d,r9d + add r10d,DWORD PTR[28+r15] + add al,dl + mov ebx,DWORD PTR[124+rsi] + add r10d,1735328473 + xor r12d,r8d + movzx eax,al + mov DWORD PTR[120+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,14 + mov r12d,r11d + pinsrw xmm0,WORD PTR[rax*4+rdi],7 + + add r10d,r11d + movdqu xmm3,XMMWORD PTR[16+r13] + add bpl,32 + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],ebx + and r12d,r8d + add r9d,DWORD PTR[48+r15] + add bl,dl + mov eax,DWORD PTR[rbp*4+rdi] + add r9d,2368359562 + xor r12d,r11d + movzx ebx,bl + mov DWORD PTR[124+rsi],edx + add r9d,r12d + add cl,al + rol r9d,20 + mov r12d,r11d + pinsrw xmm1,WORD PTR[rbx*4+rdi],7 + + add r9d,r10d + mov rsi,rcx + xor rcx,rcx + mov cl,sil + lea rsi,QWORD PTR[rbp*4+rdi] + psllq xmm1,8 + pxor xmm3,xmm0 + pxor xmm3,xmm1 + pxor xmm0,xmm0 + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],eax + xor r12d,r9d + add r8d,DWORD PTR[20+r15] + add al,dl + mov ebx,DWORD PTR[4+rsi] + add r8d,4294588738 + movzx eax,al + add r8d,r12d + mov DWORD PTR[rsi],edx + add cl,bl + rol r8d,4 + mov r12d,r10d + movd xmm0,DWORD PTR[rax*4+rdi] + + add r8d,r9d + pxor xmm1,xmm1 + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],ebx + xor r12d,r8d + add r11d,DWORD PTR[32+r15] + add bl,dl + mov eax,DWORD PTR[8+rsi] + add r11d,2272392833 + movzx ebx,bl + add r11d,r12d + mov DWORD PTR[4+rsi],edx + add cl,al + rol r11d,11 + mov r12d,r9d + movd xmm1,DWORD PTR[rbx*4+rdi] + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],eax + xor r12d,r11d + add r10d,DWORD PTR[44+r15] + add al,dl + mov ebx,DWORD PTR[12+rsi] + add r10d,1839030562 + movzx eax,al + add r10d,r12d + mov DWORD PTR[8+rsi],edx + add cl,bl + rol r10d,16 + mov r12d,r8d + pinsrw xmm0,WORD PTR[rax*4+rdi],1 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],ebx + xor r12d,r10d + add r9d,DWORD PTR[56+r15] + add bl,dl + mov eax,DWORD PTR[16+rsi] + add r9d,4259657740 + movzx ebx,bl + add r9d,r12d + mov DWORD PTR[12+rsi],edx + add cl,al + rol r9d,23 + mov r12d,r11d + pinsrw xmm1,WORD PTR[rbx*4+rdi],1 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],eax + xor r12d,r9d + add r8d,DWORD PTR[4+r15] + add al,dl + mov ebx,DWORD PTR[20+rsi] + add r8d,2763975236 + movzx eax,al + add r8d,r12d + mov DWORD PTR[16+rsi],edx + add cl,bl + rol r8d,4 + mov r12d,r10d + pinsrw xmm0,WORD PTR[rax*4+rdi],2 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],ebx + xor r12d,r8d + add r11d,DWORD PTR[16+r15] + add bl,dl + mov eax,DWORD PTR[24+rsi] + add r11d,1272893353 + movzx ebx,bl + add r11d,r12d + mov DWORD PTR[20+rsi],edx + add cl,al + rol r11d,11 + mov r12d,r9d + pinsrw xmm1,WORD PTR[rbx*4+rdi],2 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],eax + xor r12d,r11d + add r10d,DWORD PTR[28+r15] + add al,dl + mov ebx,DWORD PTR[28+rsi] + add r10d,4139469664 + movzx eax,al + add r10d,r12d + mov DWORD PTR[24+rsi],edx + add cl,bl + rol r10d,16 + mov r12d,r8d + pinsrw xmm0,WORD PTR[rax*4+rdi],3 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],ebx + xor r12d,r10d + add r9d,DWORD PTR[40+r15] + add bl,dl + mov eax,DWORD PTR[32+rsi] + add r9d,3200236656 + movzx ebx,bl + add r9d,r12d + mov DWORD PTR[28+rsi],edx + add cl,al + rol r9d,23 + mov r12d,r11d + pinsrw xmm1,WORD PTR[rbx*4+rdi],3 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],eax + xor r12d,r9d + add r8d,DWORD PTR[52+r15] + add al,dl + mov ebx,DWORD PTR[36+rsi] + add r8d,681279174 + movzx eax,al + add r8d,r12d + mov DWORD PTR[32+rsi],edx + add cl,bl + rol r8d,4 + mov r12d,r10d + pinsrw xmm0,WORD PTR[rax*4+rdi],4 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],ebx + xor r12d,r8d + add r11d,DWORD PTR[r15] + add bl,dl + mov eax,DWORD PTR[40+rsi] + add r11d,3936430074 + movzx ebx,bl + add r11d,r12d + mov DWORD PTR[36+rsi],edx + add cl,al + rol r11d,11 + mov r12d,r9d + pinsrw xmm1,WORD PTR[rbx*4+rdi],4 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],eax + xor r12d,r11d + add r10d,DWORD PTR[12+r15] + add al,dl + mov ebx,DWORD PTR[44+rsi] + add r10d,3572445317 + movzx eax,al + add r10d,r12d + mov DWORD PTR[40+rsi],edx + add cl,bl + rol r10d,16 + mov r12d,r8d + pinsrw xmm0,WORD PTR[rax*4+rdi],5 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],ebx + xor r12d,r10d + add r9d,DWORD PTR[24+r15] + add bl,dl + mov eax,DWORD PTR[48+rsi] + add r9d,76029189 + movzx ebx,bl + add r9d,r12d + mov DWORD PTR[44+rsi],edx + add cl,al + rol r9d,23 + mov r12d,r11d + pinsrw xmm1,WORD PTR[rbx*4+rdi],5 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],eax + xor r12d,r9d + add r8d,DWORD PTR[36+r15] + add al,dl + mov ebx,DWORD PTR[52+rsi] + add r8d,3654602809 + movzx eax,al + add r8d,r12d + mov DWORD PTR[48+rsi],edx + add cl,bl + rol r8d,4 + mov r12d,r10d + pinsrw xmm0,WORD PTR[rax*4+rdi],6 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],ebx + xor r12d,r8d + add r11d,DWORD PTR[48+r15] + add bl,dl + mov eax,DWORD PTR[56+rsi] + add r11d,3873151461 + movzx ebx,bl + add r11d,r12d + mov DWORD PTR[52+rsi],edx + add cl,al + rol r11d,11 + mov r12d,r9d + pinsrw xmm1,WORD PTR[rbx*4+rdi],6 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],eax + xor r12d,r11d + add r10d,DWORD PTR[60+r15] + add al,dl + mov ebx,DWORD PTR[60+rsi] + add r10d,530742520 + movzx eax,al + add r10d,r12d + mov DWORD PTR[56+rsi],edx + add cl,bl + rol r10d,16 + mov r12d,r8d + pinsrw xmm0,WORD PTR[rax*4+rdi],7 + + add r10d,r11d + movdqu xmm4,XMMWORD PTR[32+r13] + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],ebx + xor r12d,r10d + add r9d,DWORD PTR[8+r15] + add bl,dl + mov eax,DWORD PTR[64+rsi] + add r9d,3299628645 + movzx ebx,bl + add r9d,r12d + mov DWORD PTR[60+rsi],edx + add cl,al + rol r9d,23 + mov r12d,-1 + pinsrw xmm1,WORD PTR[rbx*4+rdi],7 + + add r9d,r10d + psllq xmm1,8 + pxor xmm4,xmm0 + pxor xmm4,xmm1 + pxor xmm0,xmm0 + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],eax + or r12d,r9d + add r8d,DWORD PTR[r15] + add al,dl + mov ebx,DWORD PTR[68+rsi] + add r8d,4096336452 + movzx eax,al + xor r12d,r10d + mov DWORD PTR[64+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,6 + mov r12d,-1 + movd xmm0,DWORD PTR[rax*4+rdi] + + add r8d,r9d + pxor xmm1,xmm1 + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],ebx + or r12d,r8d + add r11d,DWORD PTR[28+r15] + add bl,dl + mov eax,DWORD PTR[72+rsi] + add r11d,1126891415 + movzx ebx,bl + xor r12d,r9d + mov DWORD PTR[68+rsi],edx + add r11d,r12d + add cl,al + rol r11d,10 + mov r12d,-1 + movd xmm1,DWORD PTR[rbx*4+rdi] + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],eax + or r12d,r11d + add r10d,DWORD PTR[56+r15] + add al,dl + mov ebx,DWORD PTR[76+rsi] + add r10d,2878612391 + movzx eax,al + xor r12d,r8d + mov DWORD PTR[72+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,15 + mov r12d,-1 + pinsrw xmm0,WORD PTR[rax*4+rdi],1 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],ebx + or r12d,r10d + add r9d,DWORD PTR[20+r15] + add bl,dl + mov eax,DWORD PTR[80+rsi] + add r9d,4237533241 + movzx ebx,bl + xor r12d,r11d + mov DWORD PTR[76+rsi],edx + add r9d,r12d + add cl,al + rol r9d,21 + mov r12d,-1 + pinsrw xmm1,WORD PTR[rbx*4+rdi],1 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],eax + or r12d,r9d + add r8d,DWORD PTR[48+r15] + add al,dl + mov ebx,DWORD PTR[84+rsi] + add r8d,1700485571 + movzx eax,al + xor r12d,r10d + mov DWORD PTR[80+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,6 + mov r12d,-1 + pinsrw xmm0,WORD PTR[rax*4+rdi],2 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],ebx + or r12d,r8d + add r11d,DWORD PTR[12+r15] + add bl,dl + mov eax,DWORD PTR[88+rsi] + add r11d,2399980690 + movzx ebx,bl + xor r12d,r9d + mov DWORD PTR[84+rsi],edx + add r11d,r12d + add cl,al + rol r11d,10 + mov r12d,-1 + pinsrw xmm1,WORD PTR[rbx*4+rdi],2 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],eax + or r12d,r11d + add r10d,DWORD PTR[40+r15] + add al,dl + mov ebx,DWORD PTR[92+rsi] + add r10d,4293915773 + movzx eax,al + xor r12d,r8d + mov DWORD PTR[88+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,15 + mov r12d,-1 + pinsrw xmm0,WORD PTR[rax*4+rdi],3 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],ebx + or r12d,r10d + add r9d,DWORD PTR[4+r15] + add bl,dl + mov eax,DWORD PTR[96+rsi] + add r9d,2240044497 + movzx ebx,bl + xor r12d,r11d + mov DWORD PTR[92+rsi],edx + add r9d,r12d + add cl,al + rol r9d,21 + mov r12d,-1 + pinsrw xmm1,WORD PTR[rbx*4+rdi],3 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],eax + or r12d,r9d + add r8d,DWORD PTR[32+r15] + add al,dl + mov ebx,DWORD PTR[100+rsi] + add r8d,1873313359 + movzx eax,al + xor r12d,r10d + mov DWORD PTR[96+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,6 + mov r12d,-1 + pinsrw xmm0,WORD PTR[rax*4+rdi],4 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],ebx + or r12d,r8d + add r11d,DWORD PTR[60+r15] + add bl,dl + mov eax,DWORD PTR[104+rsi] + add r11d,4264355552 + movzx ebx,bl + xor r12d,r9d + mov DWORD PTR[100+rsi],edx + add r11d,r12d + add cl,al + rol r11d,10 + mov r12d,-1 + pinsrw xmm1,WORD PTR[rbx*4+rdi],4 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],eax + or r12d,r11d + add r10d,DWORD PTR[24+r15] + add al,dl + mov ebx,DWORD PTR[108+rsi] + add r10d,2734768916 + movzx eax,al + xor r12d,r8d + mov DWORD PTR[104+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,15 + mov r12d,-1 + pinsrw xmm0,WORD PTR[rax*4+rdi],5 + + add r10d,r11d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],ebx + or r12d,r10d + add r9d,DWORD PTR[52+r15] + add bl,dl + mov eax,DWORD PTR[112+rsi] + add r9d,1309151649 + movzx ebx,bl + xor r12d,r11d + mov DWORD PTR[108+rsi],edx + add r9d,r12d + add cl,al + rol r9d,21 + mov r12d,-1 + pinsrw xmm1,WORD PTR[rbx*4+rdi],5 + + add r9d,r10d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r11d + mov DWORD PTR[rcx*4+rdi],eax + or r12d,r9d + add r8d,DWORD PTR[16+r15] + add al,dl + mov ebx,DWORD PTR[116+rsi] + add r8d,4149444226 + movzx eax,al + xor r12d,r10d + mov DWORD PTR[112+rsi],edx + add r8d,r12d + add cl,bl + rol r8d,6 + mov r12d,-1 + pinsrw xmm0,WORD PTR[rax*4+rdi],6 + + add r8d,r9d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r10d + mov DWORD PTR[rcx*4+rdi],ebx + or r12d,r8d + add r11d,DWORD PTR[44+r15] + add bl,dl + mov eax,DWORD PTR[120+rsi] + add r11d,3174756917 + movzx ebx,bl + xor r12d,r9d + mov DWORD PTR[116+rsi],edx + add r11d,r12d + add cl,al + rol r11d,10 + mov r12d,-1 + pinsrw xmm1,WORD PTR[rbx*4+rdi],6 + + add r11d,r8d + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r9d + mov DWORD PTR[rcx*4+rdi],eax + or r12d,r11d + add r10d,DWORD PTR[8+r15] + add al,dl + mov ebx,DWORD PTR[124+rsi] + add r10d,718787259 + movzx eax,al + xor r12d,r8d + mov DWORD PTR[120+rsi],edx + add r10d,r12d + add cl,bl + rol r10d,15 + mov r12d,-1 + pinsrw xmm0,WORD PTR[rax*4+rdi],7 + + add r10d,r11d + movdqu xmm5,XMMWORD PTR[48+r13] + add bpl,32 + mov edx,DWORD PTR[rcx*4+rdi] + xor r12d,r8d + mov DWORD PTR[rcx*4+rdi],ebx + or r12d,r10d + add r9d,DWORD PTR[36+r15] + add bl,dl + mov eax,DWORD PTR[rbp*4+rdi] + add r9d,3951481745 + movzx ebx,bl + xor r12d,r11d + mov DWORD PTR[124+rsi],edx + add r9d,r12d + add cl,al + rol r9d,21 + mov r12d,-1 + pinsrw xmm1,WORD PTR[rbx*4+rdi],7 + + add r9d,r10d + mov rsi,rbp + xor rbp,rbp + mov bpl,sil + mov rsi,rcx + xor rcx,rcx + mov cl,sil + lea rsi,QWORD PTR[rbp*4+rdi] + psllq xmm1,8 + pxor xmm5,xmm0 + pxor xmm5,xmm1 + add r8d,DWORD PTR[rsp] + add r9d,DWORD PTR[4+rsp] + add r10d,DWORD PTR[8+rsp] + add r11d,DWORD PTR[12+rsp] + + movdqu XMMWORD PTR[r13*1+r14],xmm2 + movdqu XMMWORD PTR[16+r13*1+r14],xmm3 + movdqu XMMWORD PTR[32+r13*1+r14],xmm4 + movdqu XMMWORD PTR[48+r13*1+r14],xmm5 + lea r15,QWORD PTR[64+r15] + lea r13,QWORD PTR[64+r13] + cmp r15,QWORD PTR[16+rsp] + jb $L$oop + + mov r12,QWORD PTR[24+rsp] + sub cl,al + mov DWORD PTR[r12],r8d + mov DWORD PTR[4+r12],r9d + mov DWORD PTR[8+r12],r10d + mov DWORD PTR[12+r12],r11d + sub bpl,1 + mov DWORD PTR[((-8))+rdi],ebp + mov DWORD PTR[((-4))+rdi],ecx + + mov r15,QWORD PTR[40+rsp] + mov r14,QWORD PTR[48+rsp] + mov r13,QWORD PTR[56+rsp] + mov r12,QWORD PTR[64+rsp] + mov rbp,QWORD PTR[72+rsp] + mov rbx,QWORD PTR[80+rsp] + lea rsp,QWORD PTR[88+rsp] +$L$epilogue:: +$L$abort:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_rc4_md5_enc:: +rc4_md5_enc ENDP + +.text$ ENDS +END diff --git a/crypto/rc4/rc4-md5-mingw64-x86_64.S b/crypto/rc4/rc4-md5-mingw64-x86_64.S new file mode 100644 index 00000000..e11d3148 --- /dev/null +++ b/crypto/rc4/rc4-md5-mingw64-x86_64.S @@ -0,0 +1,1273 @@ +#include "x86_arch.h" +.text +.p2align 4 + +.globl rc4_md5_enc +.def rc4_md5_enc; .scl 2; .type 32; .endef +rc4_md5_enc: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_rc4_md5_enc: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + movq 40(%rsp),%r8 + movq 48(%rsp),%r9 + + cmpq $0,%r9 + je .Labort + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + subq $40,%rsp +.Lbody: + movq %rcx,%r11 + movq %r9,%r12 + movq %rsi,%r13 + movq %rdx,%r14 + movq %r8,%r15 + xorq %rbp,%rbp + xorq %rcx,%rcx + + leaq 8(%rdi),%rdi + movb -8(%rdi),%bpl + movb -4(%rdi),%cl + + incb %bpl + subq %r13,%r14 + movl (%rdi,%rbp,4),%eax + addb %al,%cl + leaq (%rdi,%rbp,4),%rsi + shlq $6,%r12 + addq %r15,%r12 + movq %r12,16(%rsp) + + movq %r11,24(%rsp) + movl 0(%r11),%r8d + movl 4(%r11),%r9d + movl 8(%r11),%r10d + movl 12(%r11),%r11d + jmp .Loop + +.p2align 4 +.Loop: + movl %r8d,0(%rsp) + movl %r9d,4(%rsp) + movl %r10d,8(%rsp) + movl %r11d,%r12d + movl %r11d,12(%rsp) + pxor %xmm0,%xmm0 + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r9d,%r12d + addl 0(%r15),%r8d + addb %dl,%al + movl 4(%rsi),%ebx + addl $3614090360,%r8d + xorl %r11d,%r12d + movzbl %al,%eax + movl %edx,0(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $7,%r8d + movl %r10d,%r12d + movd (%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + pxor %xmm1,%xmm1 + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r8d,%r12d + addl 4(%r15),%r11d + addb %dl,%bl + movl 8(%rsi),%eax + addl $3905402710,%r11d + xorl %r10d,%r12d + movzbl %bl,%ebx + movl %edx,4(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $12,%r11d + movl %r9d,%r12d + movd (%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r11d,%r12d + addl 8(%r15),%r10d + addb %dl,%al + movl 12(%rsi),%ebx + addl $606105819,%r10d + xorl %r9d,%r12d + movzbl %al,%eax + movl %edx,8(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $17,%r10d + movl %r8d,%r12d + pinsrw $1,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r10d,%r12d + addl 12(%r15),%r9d + addb %dl,%bl + movl 16(%rsi),%eax + addl $3250441966,%r9d + xorl %r8d,%r12d + movzbl %bl,%ebx + movl %edx,12(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $22,%r9d + movl %r11d,%r12d + pinsrw $1,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r9d,%r12d + addl 16(%r15),%r8d + addb %dl,%al + movl 20(%rsi),%ebx + addl $4118548399,%r8d + xorl %r11d,%r12d + movzbl %al,%eax + movl %edx,16(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $7,%r8d + movl %r10d,%r12d + pinsrw $2,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r8d,%r12d + addl 20(%r15),%r11d + addb %dl,%bl + movl 24(%rsi),%eax + addl $1200080426,%r11d + xorl %r10d,%r12d + movzbl %bl,%ebx + movl %edx,20(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $12,%r11d + movl %r9d,%r12d + pinsrw $2,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r11d,%r12d + addl 24(%r15),%r10d + addb %dl,%al + movl 28(%rsi),%ebx + addl $2821735955,%r10d + xorl %r9d,%r12d + movzbl %al,%eax + movl %edx,24(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $17,%r10d + movl %r8d,%r12d + pinsrw $3,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r10d,%r12d + addl 28(%r15),%r9d + addb %dl,%bl + movl 32(%rsi),%eax + addl $4249261313,%r9d + xorl %r8d,%r12d + movzbl %bl,%ebx + movl %edx,28(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $22,%r9d + movl %r11d,%r12d + pinsrw $3,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r9d,%r12d + addl 32(%r15),%r8d + addb %dl,%al + movl 36(%rsi),%ebx + addl $1770035416,%r8d + xorl %r11d,%r12d + movzbl %al,%eax + movl %edx,32(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $7,%r8d + movl %r10d,%r12d + pinsrw $4,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r8d,%r12d + addl 36(%r15),%r11d + addb %dl,%bl + movl 40(%rsi),%eax + addl $2336552879,%r11d + xorl %r10d,%r12d + movzbl %bl,%ebx + movl %edx,36(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $12,%r11d + movl %r9d,%r12d + pinsrw $4,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r11d,%r12d + addl 40(%r15),%r10d + addb %dl,%al + movl 44(%rsi),%ebx + addl $4294925233,%r10d + xorl %r9d,%r12d + movzbl %al,%eax + movl %edx,40(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $17,%r10d + movl %r8d,%r12d + pinsrw $5,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r10d,%r12d + addl 44(%r15),%r9d + addb %dl,%bl + movl 48(%rsi),%eax + addl $2304563134,%r9d + xorl %r8d,%r12d + movzbl %bl,%ebx + movl %edx,44(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $22,%r9d + movl %r11d,%r12d + pinsrw $5,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r9d,%r12d + addl 48(%r15),%r8d + addb %dl,%al + movl 52(%rsi),%ebx + addl $1804603682,%r8d + xorl %r11d,%r12d + movzbl %al,%eax + movl %edx,48(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $7,%r8d + movl %r10d,%r12d + pinsrw $6,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r8d,%r12d + addl 52(%r15),%r11d + addb %dl,%bl + movl 56(%rsi),%eax + addl $4254626195,%r11d + xorl %r10d,%r12d + movzbl %bl,%ebx + movl %edx,52(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $12,%r11d + movl %r9d,%r12d + pinsrw $6,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r11d,%r12d + addl 56(%r15),%r10d + addb %dl,%al + movl 60(%rsi),%ebx + addl $2792965006,%r10d + xorl %r9d,%r12d + movzbl %al,%eax + movl %edx,56(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $17,%r10d + movl %r8d,%r12d + pinsrw $7,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movdqu (%r13),%xmm2 + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r10d,%r12d + addl 60(%r15),%r9d + addb %dl,%bl + movl 64(%rsi),%eax + addl $1236535329,%r9d + xorl %r8d,%r12d + movzbl %bl,%ebx + movl %edx,60(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $22,%r9d + movl %r10d,%r12d + pinsrw $7,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + psllq $8,%xmm1 + pxor %xmm0,%xmm2 + pxor %xmm1,%xmm2 + pxor %xmm0,%xmm0 + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r11d,%r12d + addl 4(%r15),%r8d + addb %dl,%al + movl 68(%rsi),%ebx + addl $4129170786,%r8d + xorl %r10d,%r12d + movzbl %al,%eax + movl %edx,64(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $5,%r8d + movl %r9d,%r12d + movd (%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + pxor %xmm1,%xmm1 + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r10d,%r12d + addl 24(%r15),%r11d + addb %dl,%bl + movl 72(%rsi),%eax + addl $3225465664,%r11d + xorl %r9d,%r12d + movzbl %bl,%ebx + movl %edx,68(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $9,%r11d + movl %r8d,%r12d + movd (%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r9d,%r12d + addl 44(%r15),%r10d + addb %dl,%al + movl 76(%rsi),%ebx + addl $643717713,%r10d + xorl %r8d,%r12d + movzbl %al,%eax + movl %edx,72(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $14,%r10d + movl %r11d,%r12d + pinsrw $1,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r8d,%r12d + addl 0(%r15),%r9d + addb %dl,%bl + movl 80(%rsi),%eax + addl $3921069994,%r9d + xorl %r11d,%r12d + movzbl %bl,%ebx + movl %edx,76(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $20,%r9d + movl %r10d,%r12d + pinsrw $1,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r11d,%r12d + addl 20(%r15),%r8d + addb %dl,%al + movl 84(%rsi),%ebx + addl $3593408605,%r8d + xorl %r10d,%r12d + movzbl %al,%eax + movl %edx,80(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $5,%r8d + movl %r9d,%r12d + pinsrw $2,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r10d,%r12d + addl 40(%r15),%r11d + addb %dl,%bl + movl 88(%rsi),%eax + addl $38016083,%r11d + xorl %r9d,%r12d + movzbl %bl,%ebx + movl %edx,84(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $9,%r11d + movl %r8d,%r12d + pinsrw $2,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r9d,%r12d + addl 60(%r15),%r10d + addb %dl,%al + movl 92(%rsi),%ebx + addl $3634488961,%r10d + xorl %r8d,%r12d + movzbl %al,%eax + movl %edx,88(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $14,%r10d + movl %r11d,%r12d + pinsrw $3,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r8d,%r12d + addl 16(%r15),%r9d + addb %dl,%bl + movl 96(%rsi),%eax + addl $3889429448,%r9d + xorl %r11d,%r12d + movzbl %bl,%ebx + movl %edx,92(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $20,%r9d + movl %r10d,%r12d + pinsrw $3,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r11d,%r12d + addl 36(%r15),%r8d + addb %dl,%al + movl 100(%rsi),%ebx + addl $568446438,%r8d + xorl %r10d,%r12d + movzbl %al,%eax + movl %edx,96(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $5,%r8d + movl %r9d,%r12d + pinsrw $4,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r10d,%r12d + addl 56(%r15),%r11d + addb %dl,%bl + movl 104(%rsi),%eax + addl $3275163606,%r11d + xorl %r9d,%r12d + movzbl %bl,%ebx + movl %edx,100(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $9,%r11d + movl %r8d,%r12d + pinsrw $4,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r9d,%r12d + addl 12(%r15),%r10d + addb %dl,%al + movl 108(%rsi),%ebx + addl $4107603335,%r10d + xorl %r8d,%r12d + movzbl %al,%eax + movl %edx,104(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $14,%r10d + movl %r11d,%r12d + pinsrw $5,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r8d,%r12d + addl 32(%r15),%r9d + addb %dl,%bl + movl 112(%rsi),%eax + addl $1163531501,%r9d + xorl %r11d,%r12d + movzbl %bl,%ebx + movl %edx,108(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $20,%r9d + movl %r10d,%r12d + pinsrw $5,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r11d,%r12d + addl 52(%r15),%r8d + addb %dl,%al + movl 116(%rsi),%ebx + addl $2850285829,%r8d + xorl %r10d,%r12d + movzbl %al,%eax + movl %edx,112(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $5,%r8d + movl %r9d,%r12d + pinsrw $6,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r10d,%r12d + addl 8(%r15),%r11d + addb %dl,%bl + movl 120(%rsi),%eax + addl $4243563512,%r11d + xorl %r9d,%r12d + movzbl %bl,%ebx + movl %edx,116(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $9,%r11d + movl %r8d,%r12d + pinsrw $6,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %eax,(%rdi,%rcx,4) + andl %r9d,%r12d + addl 28(%r15),%r10d + addb %dl,%al + movl 124(%rsi),%ebx + addl $1735328473,%r10d + xorl %r8d,%r12d + movzbl %al,%eax + movl %edx,120(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $14,%r10d + movl %r11d,%r12d + pinsrw $7,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movdqu 16(%r13),%xmm3 + addb $32,%bpl + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %ebx,(%rdi,%rcx,4) + andl %r8d,%r12d + addl 48(%r15),%r9d + addb %dl,%bl + movl 0(%rdi,%rbp,4),%eax + addl $2368359562,%r9d + xorl %r11d,%r12d + movzbl %bl,%ebx + movl %edx,124(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $20,%r9d + movl %r11d,%r12d + pinsrw $7,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movq %rcx,%rsi + xorq %rcx,%rcx + movb %sil,%cl + leaq (%rdi,%rbp,4),%rsi + psllq $8,%xmm1 + pxor %xmm0,%xmm3 + pxor %xmm1,%xmm3 + pxor %xmm0,%xmm0 + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %eax,(%rdi,%rcx,4) + xorl %r9d,%r12d + addl 20(%r15),%r8d + addb %dl,%al + movl 4(%rsi),%ebx + addl $4294588738,%r8d + movzbl %al,%eax + addl %r12d,%r8d + movl %edx,0(%rsi) + addb %bl,%cl + roll $4,%r8d + movl %r10d,%r12d + movd (%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + pxor %xmm1,%xmm1 + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %ebx,(%rdi,%rcx,4) + xorl %r8d,%r12d + addl 32(%r15),%r11d + addb %dl,%bl + movl 8(%rsi),%eax + addl $2272392833,%r11d + movzbl %bl,%ebx + addl %r12d,%r11d + movl %edx,4(%rsi) + addb %al,%cl + roll $11,%r11d + movl %r9d,%r12d + movd (%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %eax,(%rdi,%rcx,4) + xorl %r11d,%r12d + addl 44(%r15),%r10d + addb %dl,%al + movl 12(%rsi),%ebx + addl $1839030562,%r10d + movzbl %al,%eax + addl %r12d,%r10d + movl %edx,8(%rsi) + addb %bl,%cl + roll $16,%r10d + movl %r8d,%r12d + pinsrw $1,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %ebx,(%rdi,%rcx,4) + xorl %r10d,%r12d + addl 56(%r15),%r9d + addb %dl,%bl + movl 16(%rsi),%eax + addl $4259657740,%r9d + movzbl %bl,%ebx + addl %r12d,%r9d + movl %edx,12(%rsi) + addb %al,%cl + roll $23,%r9d + movl %r11d,%r12d + pinsrw $1,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %eax,(%rdi,%rcx,4) + xorl %r9d,%r12d + addl 4(%r15),%r8d + addb %dl,%al + movl 20(%rsi),%ebx + addl $2763975236,%r8d + movzbl %al,%eax + addl %r12d,%r8d + movl %edx,16(%rsi) + addb %bl,%cl + roll $4,%r8d + movl %r10d,%r12d + pinsrw $2,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %ebx,(%rdi,%rcx,4) + xorl %r8d,%r12d + addl 16(%r15),%r11d + addb %dl,%bl + movl 24(%rsi),%eax + addl $1272893353,%r11d + movzbl %bl,%ebx + addl %r12d,%r11d + movl %edx,20(%rsi) + addb %al,%cl + roll $11,%r11d + movl %r9d,%r12d + pinsrw $2,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %eax,(%rdi,%rcx,4) + xorl %r11d,%r12d + addl 28(%r15),%r10d + addb %dl,%al + movl 28(%rsi),%ebx + addl $4139469664,%r10d + movzbl %al,%eax + addl %r12d,%r10d + movl %edx,24(%rsi) + addb %bl,%cl + roll $16,%r10d + movl %r8d,%r12d + pinsrw $3,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %ebx,(%rdi,%rcx,4) + xorl %r10d,%r12d + addl 40(%r15),%r9d + addb %dl,%bl + movl 32(%rsi),%eax + addl $3200236656,%r9d + movzbl %bl,%ebx + addl %r12d,%r9d + movl %edx,28(%rsi) + addb %al,%cl + roll $23,%r9d + movl %r11d,%r12d + pinsrw $3,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %eax,(%rdi,%rcx,4) + xorl %r9d,%r12d + addl 52(%r15),%r8d + addb %dl,%al + movl 36(%rsi),%ebx + addl $681279174,%r8d + movzbl %al,%eax + addl %r12d,%r8d + movl %edx,32(%rsi) + addb %bl,%cl + roll $4,%r8d + movl %r10d,%r12d + pinsrw $4,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %ebx,(%rdi,%rcx,4) + xorl %r8d,%r12d + addl 0(%r15),%r11d + addb %dl,%bl + movl 40(%rsi),%eax + addl $3936430074,%r11d + movzbl %bl,%ebx + addl %r12d,%r11d + movl %edx,36(%rsi) + addb %al,%cl + roll $11,%r11d + movl %r9d,%r12d + pinsrw $4,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %eax,(%rdi,%rcx,4) + xorl %r11d,%r12d + addl 12(%r15),%r10d + addb %dl,%al + movl 44(%rsi),%ebx + addl $3572445317,%r10d + movzbl %al,%eax + addl %r12d,%r10d + movl %edx,40(%rsi) + addb %bl,%cl + roll $16,%r10d + movl %r8d,%r12d + pinsrw $5,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %ebx,(%rdi,%rcx,4) + xorl %r10d,%r12d + addl 24(%r15),%r9d + addb %dl,%bl + movl 48(%rsi),%eax + addl $76029189,%r9d + movzbl %bl,%ebx + addl %r12d,%r9d + movl %edx,44(%rsi) + addb %al,%cl + roll $23,%r9d + movl %r11d,%r12d + pinsrw $5,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %eax,(%rdi,%rcx,4) + xorl %r9d,%r12d + addl 36(%r15),%r8d + addb %dl,%al + movl 52(%rsi),%ebx + addl $3654602809,%r8d + movzbl %al,%eax + addl %r12d,%r8d + movl %edx,48(%rsi) + addb %bl,%cl + roll $4,%r8d + movl %r10d,%r12d + pinsrw $6,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %ebx,(%rdi,%rcx,4) + xorl %r8d,%r12d + addl 48(%r15),%r11d + addb %dl,%bl + movl 56(%rsi),%eax + addl $3873151461,%r11d + movzbl %bl,%ebx + addl %r12d,%r11d + movl %edx,52(%rsi) + addb %al,%cl + roll $11,%r11d + movl %r9d,%r12d + pinsrw $6,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %eax,(%rdi,%rcx,4) + xorl %r11d,%r12d + addl 60(%r15),%r10d + addb %dl,%al + movl 60(%rsi),%ebx + addl $530742520,%r10d + movzbl %al,%eax + addl %r12d,%r10d + movl %edx,56(%rsi) + addb %bl,%cl + roll $16,%r10d + movl %r8d,%r12d + pinsrw $7,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movdqu 32(%r13),%xmm4 + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %ebx,(%rdi,%rcx,4) + xorl %r10d,%r12d + addl 8(%r15),%r9d + addb %dl,%bl + movl 64(%rsi),%eax + addl $3299628645,%r9d + movzbl %bl,%ebx + addl %r12d,%r9d + movl %edx,60(%rsi) + addb %al,%cl + roll $23,%r9d + movl $-1,%r12d + pinsrw $7,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + psllq $8,%xmm1 + pxor %xmm0,%xmm4 + pxor %xmm1,%xmm4 + pxor %xmm0,%xmm0 + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %eax,(%rdi,%rcx,4) + orl %r9d,%r12d + addl 0(%r15),%r8d + addb %dl,%al + movl 68(%rsi),%ebx + addl $4096336452,%r8d + movzbl %al,%eax + xorl %r10d,%r12d + movl %edx,64(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $6,%r8d + movl $-1,%r12d + movd (%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + pxor %xmm1,%xmm1 + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %ebx,(%rdi,%rcx,4) + orl %r8d,%r12d + addl 28(%r15),%r11d + addb %dl,%bl + movl 72(%rsi),%eax + addl $1126891415,%r11d + movzbl %bl,%ebx + xorl %r9d,%r12d + movl %edx,68(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $10,%r11d + movl $-1,%r12d + movd (%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %eax,(%rdi,%rcx,4) + orl %r11d,%r12d + addl 56(%r15),%r10d + addb %dl,%al + movl 76(%rsi),%ebx + addl $2878612391,%r10d + movzbl %al,%eax + xorl %r8d,%r12d + movl %edx,72(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $15,%r10d + movl $-1,%r12d + pinsrw $1,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %ebx,(%rdi,%rcx,4) + orl %r10d,%r12d + addl 20(%r15),%r9d + addb %dl,%bl + movl 80(%rsi),%eax + addl $4237533241,%r9d + movzbl %bl,%ebx + xorl %r11d,%r12d + movl %edx,76(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $21,%r9d + movl $-1,%r12d + pinsrw $1,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %eax,(%rdi,%rcx,4) + orl %r9d,%r12d + addl 48(%r15),%r8d + addb %dl,%al + movl 84(%rsi),%ebx + addl $1700485571,%r8d + movzbl %al,%eax + xorl %r10d,%r12d + movl %edx,80(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $6,%r8d + movl $-1,%r12d + pinsrw $2,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %ebx,(%rdi,%rcx,4) + orl %r8d,%r12d + addl 12(%r15),%r11d + addb %dl,%bl + movl 88(%rsi),%eax + addl $2399980690,%r11d + movzbl %bl,%ebx + xorl %r9d,%r12d + movl %edx,84(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $10,%r11d + movl $-1,%r12d + pinsrw $2,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %eax,(%rdi,%rcx,4) + orl %r11d,%r12d + addl 40(%r15),%r10d + addb %dl,%al + movl 92(%rsi),%ebx + addl $4293915773,%r10d + movzbl %al,%eax + xorl %r8d,%r12d + movl %edx,88(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $15,%r10d + movl $-1,%r12d + pinsrw $3,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %ebx,(%rdi,%rcx,4) + orl %r10d,%r12d + addl 4(%r15),%r9d + addb %dl,%bl + movl 96(%rsi),%eax + addl $2240044497,%r9d + movzbl %bl,%ebx + xorl %r11d,%r12d + movl %edx,92(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $21,%r9d + movl $-1,%r12d + pinsrw $3,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %eax,(%rdi,%rcx,4) + orl %r9d,%r12d + addl 32(%r15),%r8d + addb %dl,%al + movl 100(%rsi),%ebx + addl $1873313359,%r8d + movzbl %al,%eax + xorl %r10d,%r12d + movl %edx,96(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $6,%r8d + movl $-1,%r12d + pinsrw $4,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %ebx,(%rdi,%rcx,4) + orl %r8d,%r12d + addl 60(%r15),%r11d + addb %dl,%bl + movl 104(%rsi),%eax + addl $4264355552,%r11d + movzbl %bl,%ebx + xorl %r9d,%r12d + movl %edx,100(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $10,%r11d + movl $-1,%r12d + pinsrw $4,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %eax,(%rdi,%rcx,4) + orl %r11d,%r12d + addl 24(%r15),%r10d + addb %dl,%al + movl 108(%rsi),%ebx + addl $2734768916,%r10d + movzbl %al,%eax + xorl %r8d,%r12d + movl %edx,104(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $15,%r10d + movl $-1,%r12d + pinsrw $5,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %ebx,(%rdi,%rcx,4) + orl %r10d,%r12d + addl 52(%r15),%r9d + addb %dl,%bl + movl 112(%rsi),%eax + addl $1309151649,%r9d + movzbl %bl,%ebx + xorl %r11d,%r12d + movl %edx,108(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $21,%r9d + movl $-1,%r12d + pinsrw $5,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movl (%rdi,%rcx,4),%edx + xorl %r11d,%r12d + movl %eax,(%rdi,%rcx,4) + orl %r9d,%r12d + addl 16(%r15),%r8d + addb %dl,%al + movl 116(%rsi),%ebx + addl $4149444226,%r8d + movzbl %al,%eax + xorl %r10d,%r12d + movl %edx,112(%rsi) + addl %r12d,%r8d + addb %bl,%cl + roll $6,%r8d + movl $-1,%r12d + pinsrw $6,(%rdi,%rax,4),%xmm0 + + addl %r9d,%r8d + movl (%rdi,%rcx,4),%edx + xorl %r10d,%r12d + movl %ebx,(%rdi,%rcx,4) + orl %r8d,%r12d + addl 44(%r15),%r11d + addb %dl,%bl + movl 120(%rsi),%eax + addl $3174756917,%r11d + movzbl %bl,%ebx + xorl %r9d,%r12d + movl %edx,116(%rsi) + addl %r12d,%r11d + addb %al,%cl + roll $10,%r11d + movl $-1,%r12d + pinsrw $6,(%rdi,%rbx,4),%xmm1 + + addl %r8d,%r11d + movl (%rdi,%rcx,4),%edx + xorl %r9d,%r12d + movl %eax,(%rdi,%rcx,4) + orl %r11d,%r12d + addl 8(%r15),%r10d + addb %dl,%al + movl 124(%rsi),%ebx + addl $718787259,%r10d + movzbl %al,%eax + xorl %r8d,%r12d + movl %edx,120(%rsi) + addl %r12d,%r10d + addb %bl,%cl + roll $15,%r10d + movl $-1,%r12d + pinsrw $7,(%rdi,%rax,4),%xmm0 + + addl %r11d,%r10d + movdqu 48(%r13),%xmm5 + addb $32,%bpl + movl (%rdi,%rcx,4),%edx + xorl %r8d,%r12d + movl %ebx,(%rdi,%rcx,4) + orl %r10d,%r12d + addl 36(%r15),%r9d + addb %dl,%bl + movl 0(%rdi,%rbp,4),%eax + addl $3951481745,%r9d + movzbl %bl,%ebx + xorl %r11d,%r12d + movl %edx,124(%rsi) + addl %r12d,%r9d + addb %al,%cl + roll $21,%r9d + movl $-1,%r12d + pinsrw $7,(%rdi,%rbx,4),%xmm1 + + addl %r10d,%r9d + movq %rbp,%rsi + xorq %rbp,%rbp + movb %sil,%bpl + movq %rcx,%rsi + xorq %rcx,%rcx + movb %sil,%cl + leaq (%rdi,%rbp,4),%rsi + psllq $8,%xmm1 + pxor %xmm0,%xmm5 + pxor %xmm1,%xmm5 + addl 0(%rsp),%r8d + addl 4(%rsp),%r9d + addl 8(%rsp),%r10d + addl 12(%rsp),%r11d + + movdqu %xmm2,(%r14,%r13,1) + movdqu %xmm3,16(%r14,%r13,1) + movdqu %xmm4,32(%r14,%r13,1) + movdqu %xmm5,48(%r14,%r13,1) + leaq 64(%r15),%r15 + leaq 64(%r13),%r13 + cmpq 16(%rsp),%r15 + jb .Loop + + movq 24(%rsp),%r12 + subb %al,%cl + movl %r8d,0(%r12) + movl %r9d,4(%r12) + movl %r10d,8(%r12) + movl %r11d,12(%r12) + subb $1,%bpl + movl %ebp,-8(%rdi) + movl %ecx,-4(%rdi) + + movq 40(%rsp),%r15 + movq 48(%rsp),%r14 + movq 56(%rsp),%r13 + movq 64(%rsp),%r12 + movq 72(%rsp),%rbp + movq 80(%rsp),%rbx + leaq 88(%rsp),%rsp +.Lepilogue: +.Labort: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_rc4_md5_enc: diff --git a/crypto/rc4/rc4-mingw64-x86_64.S b/crypto/rc4/rc4-mingw64-x86_64.S new file mode 100644 index 00000000..c149d7eb --- /dev/null +++ b/crypto/rc4/rc4-mingw64-x86_64.S @@ -0,0 +1,640 @@ +#include "x86_arch.h" +.text + + + +.globl RC4 +.def RC4; .scl 2; .type 32; .endef +.p2align 4 +RC4: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_RC4: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + orq %rsi,%rsi + jne .Lentry + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.Lentry: + pushq %rbx + pushq %r12 + pushq %r13 +.Lprologue: + movq %rsi,%r11 + movq %rdx,%r12 + movq %rcx,%r13 + xorq %r10,%r10 + xorq %rcx,%rcx + + leaq 8(%rdi),%rdi + movb -8(%rdi),%r10b + movb -4(%rdi),%cl + cmpl $-1,256(%rdi) + je .LRC4_CHAR + movl OPENSSL_ia32cap_P(%rip),%r8d + xorq %rbx,%rbx + incb %r10b + subq %r10,%rbx + subq %r12,%r13 + movl (%rdi,%r10,4),%eax + testq $-16,%r11 + jz .Lloop1 + btl $IA32CAP_BIT0_INTEL,%r8d + jc .Lintel + andq $7,%rbx + leaq 1(%r10),%rsi + jz .Loop8 + subq %rbx,%r11 +.Loop8_warmup: + addb %al,%cl + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + movl %edx,(%rdi,%r10,4) + addb %dl,%al + incb %r10b + movl (%rdi,%rax,4),%edx + movl (%rdi,%r10,4),%eax + xorb (%r12),%dl + movb %dl,(%r13,%r12,1) + leaq 1(%r12),%r12 + decq %rbx + jnz .Loop8_warmup + + leaq 1(%r10),%rsi + jmp .Loop8 +.p2align 4 +.Loop8: + addb %al,%cl + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + movl 0(%rdi,%rsi,4),%ebx + rorq $8,%r8 + movl %edx,0(%rdi,%r10,4) + addb %al,%dl + movb (%rdi,%rdx,4),%r8b + addb %bl,%cl + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + movl 4(%rdi,%rsi,4),%eax + rorq $8,%r8 + movl %edx,4(%rdi,%r10,4) + addb %bl,%dl + movb (%rdi,%rdx,4),%r8b + addb %al,%cl + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + movl 8(%rdi,%rsi,4),%ebx + rorq $8,%r8 + movl %edx,8(%rdi,%r10,4) + addb %al,%dl + movb (%rdi,%rdx,4),%r8b + addb %bl,%cl + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + movl 12(%rdi,%rsi,4),%eax + rorq $8,%r8 + movl %edx,12(%rdi,%r10,4) + addb %bl,%dl + movb (%rdi,%rdx,4),%r8b + addb %al,%cl + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + movl 16(%rdi,%rsi,4),%ebx + rorq $8,%r8 + movl %edx,16(%rdi,%r10,4) + addb %al,%dl + movb (%rdi,%rdx,4),%r8b + addb %bl,%cl + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + movl 20(%rdi,%rsi,4),%eax + rorq $8,%r8 + movl %edx,20(%rdi,%r10,4) + addb %bl,%dl + movb (%rdi,%rdx,4),%r8b + addb %al,%cl + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + movl 24(%rdi,%rsi,4),%ebx + rorq $8,%r8 + movl %edx,24(%rdi,%r10,4) + addb %al,%dl + movb (%rdi,%rdx,4),%r8b + addb $8,%sil + addb %bl,%cl + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + movl -4(%rdi,%rsi,4),%eax + rorq $8,%r8 + movl %edx,28(%rdi,%r10,4) + addb %bl,%dl + movb (%rdi,%rdx,4),%r8b + addb $8,%r10b + rorq $8,%r8 + subq $8,%r11 + + xorq (%r12),%r8 + movq %r8,(%r13,%r12,1) + leaq 8(%r12),%r12 + + testq $-8,%r11 + jnz .Loop8 + cmpq $0,%r11 + jne .Lloop1 + jmp .Lexit + +.p2align 4 +.Lintel: + testq $-32,%r11 + jz .Lloop1 + andq $15,%rbx + jz .Loop16_is_hot + subq %rbx,%r11 +.Loop16_warmup: + addb %al,%cl + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + movl %edx,(%rdi,%r10,4) + addb %dl,%al + incb %r10b + movl (%rdi,%rax,4),%edx + movl (%rdi,%r10,4),%eax + xorb (%r12),%dl + movb %dl,(%r13,%r12,1) + leaq 1(%r12),%r12 + decq %rbx + jnz .Loop16_warmup + + movq %rcx,%rbx + xorq %rcx,%rcx + movb %bl,%cl + +.Loop16_is_hot: + leaq (%rdi,%r10,4),%rsi + addb %al,%cl + movl (%rdi,%rcx,4),%edx + pxor %xmm0,%xmm0 + movl %eax,(%rdi,%rcx,4) + addb %dl,%al + movl 4(%rsi),%ebx + movzbl %al,%eax + movl %edx,0(%rsi) + addb %bl,%cl + pinsrw $0,(%rdi,%rax,4),%xmm0 + jmp .Loop16_enter +.p2align 4 +.Loop16: + addb %al,%cl + movl (%rdi,%rcx,4),%edx + pxor %xmm0,%xmm2 + psllq $8,%xmm1 + pxor %xmm0,%xmm0 + movl %eax,(%rdi,%rcx,4) + addb %dl,%al + movl 4(%rsi),%ebx + movzbl %al,%eax + movl %edx,0(%rsi) + pxor %xmm1,%xmm2 + addb %bl,%cl + pinsrw $0,(%rdi,%rax,4),%xmm0 + movdqu %xmm2,(%r13,%r12,1) + leaq 16(%r12),%r12 +.Loop16_enter: + movl (%rdi,%rcx,4),%edx + pxor %xmm1,%xmm1 + movl %ebx,(%rdi,%rcx,4) + addb %dl,%bl + movl 8(%rsi),%eax + movzbl %bl,%ebx + movl %edx,4(%rsi) + addb %al,%cl + pinsrw $0,(%rdi,%rbx,4),%xmm1 + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + addb %dl,%al + movl 12(%rsi),%ebx + movzbl %al,%eax + movl %edx,8(%rsi) + addb %bl,%cl + pinsrw $1,(%rdi,%rax,4),%xmm0 + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + addb %dl,%bl + movl 16(%rsi),%eax + movzbl %bl,%ebx + movl %edx,12(%rsi) + addb %al,%cl + pinsrw $1,(%rdi,%rbx,4),%xmm1 + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + addb %dl,%al + movl 20(%rsi),%ebx + movzbl %al,%eax + movl %edx,16(%rsi) + addb %bl,%cl + pinsrw $2,(%rdi,%rax,4),%xmm0 + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + addb %dl,%bl + movl 24(%rsi),%eax + movzbl %bl,%ebx + movl %edx,20(%rsi) + addb %al,%cl + pinsrw $2,(%rdi,%rbx,4),%xmm1 + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + addb %dl,%al + movl 28(%rsi),%ebx + movzbl %al,%eax + movl %edx,24(%rsi) + addb %bl,%cl + pinsrw $3,(%rdi,%rax,4),%xmm0 + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + addb %dl,%bl + movl 32(%rsi),%eax + movzbl %bl,%ebx + movl %edx,28(%rsi) + addb %al,%cl + pinsrw $3,(%rdi,%rbx,4),%xmm1 + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + addb %dl,%al + movl 36(%rsi),%ebx + movzbl %al,%eax + movl %edx,32(%rsi) + addb %bl,%cl + pinsrw $4,(%rdi,%rax,4),%xmm0 + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + addb %dl,%bl + movl 40(%rsi),%eax + movzbl %bl,%ebx + movl %edx,36(%rsi) + addb %al,%cl + pinsrw $4,(%rdi,%rbx,4),%xmm1 + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + addb %dl,%al + movl 44(%rsi),%ebx + movzbl %al,%eax + movl %edx,40(%rsi) + addb %bl,%cl + pinsrw $5,(%rdi,%rax,4),%xmm0 + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + addb %dl,%bl + movl 48(%rsi),%eax + movzbl %bl,%ebx + movl %edx,44(%rsi) + addb %al,%cl + pinsrw $5,(%rdi,%rbx,4),%xmm1 + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + addb %dl,%al + movl 52(%rsi),%ebx + movzbl %al,%eax + movl %edx,48(%rsi) + addb %bl,%cl + pinsrw $6,(%rdi,%rax,4),%xmm0 + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + addb %dl,%bl + movl 56(%rsi),%eax + movzbl %bl,%ebx + movl %edx,52(%rsi) + addb %al,%cl + pinsrw $6,(%rdi,%rbx,4),%xmm1 + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + addb %dl,%al + movl 60(%rsi),%ebx + movzbl %al,%eax + movl %edx,56(%rsi) + addb %bl,%cl + pinsrw $7,(%rdi,%rax,4),%xmm0 + addb $16,%r10b + movdqu (%r12),%xmm2 + movl (%rdi,%rcx,4),%edx + movl %ebx,(%rdi,%rcx,4) + addb %dl,%bl + movzbl %bl,%ebx + movl %edx,60(%rsi) + leaq (%rdi,%r10,4),%rsi + pinsrw $7,(%rdi,%rbx,4),%xmm1 + movl (%rsi),%eax + movq %rcx,%rbx + xorq %rcx,%rcx + subq $16,%r11 + movb %bl,%cl + testq $-16,%r11 + jnz .Loop16 + + psllq $8,%xmm1 + pxor %xmm0,%xmm2 + pxor %xmm1,%xmm2 + movdqu %xmm2,(%r13,%r12,1) + leaq 16(%r12),%r12 + + cmpq $0,%r11 + jne .Lloop1 + jmp .Lexit + +.p2align 4 +.Lloop1: + addb %al,%cl + movl (%rdi,%rcx,4),%edx + movl %eax,(%rdi,%rcx,4) + movl %edx,(%rdi,%r10,4) + addb %dl,%al + incb %r10b + movl (%rdi,%rax,4),%edx + movl (%rdi,%r10,4),%eax + xorb (%r12),%dl + movb %dl,(%r13,%r12,1) + leaq 1(%r12),%r12 + decq %r11 + jnz .Lloop1 + jmp .Lexit + +.p2align 4 +.LRC4_CHAR: + addb $1,%r10b + movzbl (%rdi,%r10,1),%eax + testq $-8,%r11 + jz .Lcloop1 + jmp .Lcloop8 +.p2align 4 +.Lcloop8: + movl (%r12),%r8d + movl 4(%r12),%r9d + addb %al,%cl + leaq 1(%r10),%rsi + movzbl (%rdi,%rcx,1),%edx + movzbl %sil,%esi + movzbl (%rdi,%rsi,1),%ebx + movb %al,(%rdi,%rcx,1) + cmpq %rsi,%rcx + movb %dl,(%rdi,%r10,1) + jne .Lcmov0 + movq %rax,%rbx +.Lcmov0: + addb %al,%dl + xorb (%rdi,%rdx,1),%r8b + rorl $8,%r8d + addb %bl,%cl + leaq 1(%rsi),%r10 + movzbl (%rdi,%rcx,1),%edx + movzbl %r10b,%r10d + movzbl (%rdi,%r10,1),%eax + movb %bl,(%rdi,%rcx,1) + cmpq %r10,%rcx + movb %dl,(%rdi,%rsi,1) + jne .Lcmov1 + movq %rbx,%rax +.Lcmov1: + addb %bl,%dl + xorb (%rdi,%rdx,1),%r8b + rorl $8,%r8d + addb %al,%cl + leaq 1(%r10),%rsi + movzbl (%rdi,%rcx,1),%edx + movzbl %sil,%esi + movzbl (%rdi,%rsi,1),%ebx + movb %al,(%rdi,%rcx,1) + cmpq %rsi,%rcx + movb %dl,(%rdi,%r10,1) + jne .Lcmov2 + movq %rax,%rbx +.Lcmov2: + addb %al,%dl + xorb (%rdi,%rdx,1),%r8b + rorl $8,%r8d + addb %bl,%cl + leaq 1(%rsi),%r10 + movzbl (%rdi,%rcx,1),%edx + movzbl %r10b,%r10d + movzbl (%rdi,%r10,1),%eax + movb %bl,(%rdi,%rcx,1) + cmpq %r10,%rcx + movb %dl,(%rdi,%rsi,1) + jne .Lcmov3 + movq %rbx,%rax +.Lcmov3: + addb %bl,%dl + xorb (%rdi,%rdx,1),%r8b + rorl $8,%r8d + addb %al,%cl + leaq 1(%r10),%rsi + movzbl (%rdi,%rcx,1),%edx + movzbl %sil,%esi + movzbl (%rdi,%rsi,1),%ebx + movb %al,(%rdi,%rcx,1) + cmpq %rsi,%rcx + movb %dl,(%rdi,%r10,1) + jne .Lcmov4 + movq %rax,%rbx +.Lcmov4: + addb %al,%dl + xorb (%rdi,%rdx,1),%r9b + rorl $8,%r9d + addb %bl,%cl + leaq 1(%rsi),%r10 + movzbl (%rdi,%rcx,1),%edx + movzbl %r10b,%r10d + movzbl (%rdi,%r10,1),%eax + movb %bl,(%rdi,%rcx,1) + cmpq %r10,%rcx + movb %dl,(%rdi,%rsi,1) + jne .Lcmov5 + movq %rbx,%rax +.Lcmov5: + addb %bl,%dl + xorb (%rdi,%rdx,1),%r9b + rorl $8,%r9d + addb %al,%cl + leaq 1(%r10),%rsi + movzbl (%rdi,%rcx,1),%edx + movzbl %sil,%esi + movzbl (%rdi,%rsi,1),%ebx + movb %al,(%rdi,%rcx,1) + cmpq %rsi,%rcx + movb %dl,(%rdi,%r10,1) + jne .Lcmov6 + movq %rax,%rbx +.Lcmov6: + addb %al,%dl + xorb (%rdi,%rdx,1),%r9b + rorl $8,%r9d + addb %bl,%cl + leaq 1(%rsi),%r10 + movzbl (%rdi,%rcx,1),%edx + movzbl %r10b,%r10d + movzbl (%rdi,%r10,1),%eax + movb %bl,(%rdi,%rcx,1) + cmpq %r10,%rcx + movb %dl,(%rdi,%rsi,1) + jne .Lcmov7 + movq %rbx,%rax +.Lcmov7: + addb %bl,%dl + xorb (%rdi,%rdx,1),%r9b + rorl $8,%r9d + leaq -8(%r11),%r11 + movl %r8d,(%r13) + leaq 8(%r12),%r12 + movl %r9d,4(%r13) + leaq 8(%r13),%r13 + + testq $-8,%r11 + jnz .Lcloop8 + cmpq $0,%r11 + jne .Lcloop1 + jmp .Lexit +.p2align 4 +.Lcloop1: + addb %al,%cl + movzbl %cl,%ecx + movzbl (%rdi,%rcx,1),%edx + movb %al,(%rdi,%rcx,1) + movb %dl,(%rdi,%r10,1) + addb %al,%dl + addb $1,%r10b + movzbl %dl,%edx + movzbl %r10b,%r10d + movzbl (%rdi,%rdx,1),%edx + movzbl (%rdi,%r10,1),%eax + xorb (%r12),%dl + leaq 1(%r12),%r12 + movb %dl,(%r13) + leaq 1(%r13),%r13 + subq $1,%r11 + jnz .Lcloop1 + jmp .Lexit + +.p2align 4 +.Lexit: + subb $1,%r10b + movl %r10d,-8(%rdi) + movl %ecx,-4(%rdi) + + movq (%rsp),%r13 + movq 8(%rsp),%r12 + movq 16(%rsp),%rbx + addq $24,%rsp +.Lepilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_RC4: +.globl RC4_set_key +.def RC4_set_key; .scl 2; .type 32; .endef +.p2align 4 +RC4_set_key: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_RC4_set_key: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + leaq 8(%rdi),%rdi + leaq (%rdx,%rsi,1),%rdx + negq %rsi + movq %rsi,%rcx + xorl %eax,%eax + xorq %r9,%r9 + xorq %r10,%r10 + xorq %r11,%r11 + + movl OPENSSL_ia32cap_P(%rip),%r8d + btl $IA32CAP_BIT0_INTELP4,%r8d + jc .Lc1stloop + jmp .Lw1stloop + +.p2align 4 +.Lw1stloop: + movl %eax,(%rdi,%rax,4) + addb $1,%al + jnc .Lw1stloop + + xorq %r9,%r9 + xorq %r8,%r8 +.p2align 4 +.Lw2ndloop: + movl (%rdi,%r9,4),%r10d + addb (%rdx,%rsi,1),%r8b + addb %r10b,%r8b + addq $1,%rsi + movl (%rdi,%r8,4),%r11d + cmovzq %rcx,%rsi + movl %r10d,(%rdi,%r8,4) + movl %r11d,(%rdi,%r9,4) + addb $1,%r9b + jnc .Lw2ndloop + jmp .Lexit_key + +.p2align 4 +.Lc1stloop: + movb %al,(%rdi,%rax,1) + addb $1,%al + jnc .Lc1stloop + + xorq %r9,%r9 + xorq %r8,%r8 +.p2align 4 +.Lc2ndloop: + movb (%rdi,%r9,1),%r10b + addb (%rdx,%rsi,1),%r8b + addb %r10b,%r8b + addq $1,%rsi + movb (%rdi,%r8,1),%r11b + jnz .Lcnowrap + movq %rcx,%rsi +.Lcnowrap: + movb %r10b,(%rdi,%r8,1) + movb %r11b,(%rdi,%r9,1) + addb $1,%r9b + jnc .Lc2ndloop + movl $-1,256(%rdi) + +.p2align 4 +.Lexit_key: + xorl %eax,%eax + movl %eax,-8(%rdi) + movl %eax,-4(%rdi) + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_RC4_set_key: + +.globl RC4_options +.def RC4_options; .scl 2; .type 32; .endef +.p2align 4 +RC4_options: + leaq .Lopts(%rip),%rax + movl OPENSSL_ia32cap_P(%rip),%edx + btl $IA32CAP_BIT0_INTELP4,%edx + jc .L8xchar + btl $IA32CAP_BIT0_INTEL,%edx + jnc .Ldone + addq $25,%rax + retq +.L8xchar: + addq $12,%rax +.Ldone: + retq +.p2align 6 +.Lopts: +.byte 114,99,52,40,56,120,44,105,110,116,41,0 +.byte 114,99,52,40,56,120,44,99,104,97,114,41,0 +.byte 114,99,52,40,49,54,120,44,105,110,116,41,0 +.byte 82,67,52,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 +.p2align 6 + diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c index ec8a71b7..ce3e9b35 100644 --- a/crypto/rsa/rsa_ameth.c +++ b/crypto/rsa/rsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_ameth.c,v 1.18 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: rsa_ameth.c,v 1.19 2018/08/24 20:22:15 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -154,7 +154,7 @@ rsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) } static int -rsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) +rsa_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8) { const unsigned char *p; int pklen; diff --git a/crypto/rsa/rsa_crpt.c b/crypto/rsa/rsa_crpt.c index f0c92560..a646ded4 100644 --- a/crypto/rsa/rsa_crpt.c +++ b/crypto/rsa/rsa_crpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_crpt.c,v 1.18 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: rsa_crpt.c,v 1.19 2018/02/18 12:52:13 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -72,6 +72,12 @@ #include #endif +int +RSA_bits(const RSA *r) +{ + return BN_num_bits(r->n); +} + int RSA_size(const RSA *r) { diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c index 31ea4184..84e1dc7e 100644 --- a/crypto/rsa/rsa_lib.c +++ b/crypto/rsa/rsa_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_lib.c,v 1.31 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: rsa_lib.c,v 1.37 2018/04/14 07:09:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -114,10 +114,8 @@ RSA_set_method(RSA *rsa, const RSA_METHOD *meth) if (mtmp->finish) mtmp->finish(rsa); #ifndef OPENSSL_NO_ENGINE - if (rsa->engine) { - ENGINE_finish(rsa->engine); - rsa->engine = NULL; - } + ENGINE_finish(rsa->engine); + rsa->engine = NULL; #endif rsa->meth = meth; if (meth->init) @@ -149,7 +147,7 @@ RSA_new_method(ENGINE *engine) ret->engine = ENGINE_get_default_RSA(); if (ret->engine) { ret->meth = ENGINE_get_RSA(ret->engine); - if (!ret->meth) { + if (ret->meth == NULL) { RSAerror(ERR_R_ENGINE_LIB); ENGINE_finish(ret->engine); free(ret); @@ -177,8 +175,7 @@ RSA_new_method(ENGINE *engine) ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW; if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) { #ifndef OPENSSL_NO_ENGINE - if (ret->engine) - ENGINE_finish(ret->engine); + ENGINE_finish(ret->engine); #endif free(ret); return NULL; @@ -186,8 +183,7 @@ RSA_new_method(ENGINE *engine) if (ret->meth->init != NULL && !ret->meth->init(ret)) { #ifndef OPENSSL_NO_ENGINE - if (ret->engine) - ENGINE_finish(ret->engine); + ENGINE_finish(ret->engine); #endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data); free(ret); @@ -211,8 +207,7 @@ RSA_free(RSA *r) if (r->meth->finish) r->meth->finish(r); #ifndef OPENSSL_NO_ENGINE - if (r->engine) - ENGINE_finish(r->engine); + ENGINE_finish(r->engine); #endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data); @@ -256,3 +251,117 @@ RSA_get_ex_data(const RSA *r, int idx) { return CRYPTO_get_ex_data(&r->ex_data, idx); } + +void +RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) +{ + if (n != NULL) + *n = r->n; + if (e != NULL) + *e = r->e; + if (d != NULL) + *d = r->d; +} + +int +RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) +{ + if ((r->n == NULL && n == NULL) || (r->e == NULL && e == NULL)) + return 0; + + if (n != NULL) { + BN_free(r->n); + r->n = n; + } + if (e != NULL) { + BN_free(r->e); + r->e = e; + } + if (d != NULL) { + BN_free(r->d); + r->d = d; + } + + return 1; +} + +void +RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, + const BIGNUM **iqmp) +{ + if (dmp1 != NULL) + *dmp1 = r->dmp1; + if (dmq1 != NULL) + *dmq1 = r->dmq1; + if (iqmp != NULL) + *iqmp = r->iqmp; +} + +int +RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) +{ + if ((r->dmp1 == NULL && dmp1 == NULL) || + (r->dmq1 == NULL && dmq1 == NULL) || + (r->iqmp == NULL && iqmp == NULL)) + return 0; + + if (dmp1 != NULL) { + BN_free(r->dmp1); + r->dmp1 = dmp1; + } + if (dmq1 != NULL) { + BN_free(r->dmq1); + r->dmq1 = dmq1; + } + if (iqmp != NULL) { + BN_free(r->iqmp); + r->iqmp = iqmp; + } + + return 1; +} + +void +RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) +{ + if (p != NULL) + *p = r->p; + if (q != NULL) + *q = r->q; +} + +int +RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) +{ + if ((r->p == NULL && p == NULL) || (r->q == NULL && q == NULL)) + return 0; + + if (p != NULL) { + BN_free(r->p); + r->p = p; + } + if (q != NULL) { + BN_free(r->q); + r->q = q; + } + + return 1; +} + +void +RSA_clear_flags(RSA *r, int flags) +{ + r->flags &= ~flags; +} + +int +RSA_test_flags(const RSA *r, int flags) +{ + return r->flags & flags; +} + +void +RSA_set_flags(RSA *r, int flags) +{ + r->flags |= flags; +} diff --git a/crypto/rsa/rsa_meth.c b/crypto/rsa/rsa_meth.c new file mode 100644 index 00000000..ae613cc6 --- /dev/null +++ b/crypto/rsa/rsa_meth.c @@ -0,0 +1,104 @@ +/* $OpenBSD: rsa_meth.c,v 1.2 2018/09/12 06:35:38 djm Exp $ */ +/* + * Copyright (c) 2018 Theo Buehler + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include +#include + +RSA_METHOD * +RSA_meth_new(const char *name, int flags) +{ + RSA_METHOD *meth; + + if ((meth = calloc(1, sizeof(*meth))) == NULL) + return NULL; + if ((meth->name = strdup(name)) == NULL) { + free(meth); + return NULL; + } + meth->flags = flags; + + return meth; +} + +void +RSA_meth_free(RSA_METHOD *meth) +{ + if (meth != NULL) { + free((char *)meth->name); + free(meth); + } +} + +RSA_METHOD * +RSA_meth_dup(const RSA_METHOD *meth) +{ + RSA_METHOD *copy; + + if ((copy = calloc(1, sizeof(*copy))) == NULL) + return NULL; + memcpy(copy, meth, sizeof(*copy)); + if ((copy->name = strdup(meth->name)) == NULL) { + free(copy); + return NULL; + } + + return copy; +} + +int +RSA_meth_set1_name(RSA_METHOD *meth, const char *name) +{ + char *copy; + + if ((copy = strdup(name)) == NULL) + return 0; + free((char *)meth->name); + meth->name = copy; + return 1; +} + +int +(*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa) +{ + return meth->finish; +} + +int +RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)) +{ + meth->rsa_priv_enc = priv_enc; + return 1; +} + +int +RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)) +{ + meth->rsa_priv_dec = priv_dec; + return 1; +} + +int +RSA_meth_set_finish(RSA_METHOD *meth, int (*finish)(RSA *rsa)) +{ + meth->finish = finish; + return 1; +} diff --git a/crypto/rsa/rsa_oaep.c b/crypto/rsa/rsa_oaep.c index cd7af203..c463a885 100644 --- a/crypto/rsa/rsa_oaep.c +++ b/crypto/rsa/rsa_oaep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_oaep.c,v 1.26 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: rsa_oaep.c,v 1.29 2018/08/19 20:17:20 tb Exp $ */ /* Written by Ulf Moeller. This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */ @@ -72,14 +72,18 @@ RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, } if (MGF1(dbmask, emlen - SHA_DIGEST_LENGTH, seed, - SHA_DIGEST_LENGTH) < 0) + SHA_DIGEST_LENGTH) < 0) { + free(dbmask); return 0; + } for (i = 0; i < emlen - SHA_DIGEST_LENGTH; i++) db[i] ^= dbmask[i]; if (MGF1(seedmask, SHA_DIGEST_LENGTH, db, - emlen - SHA_DIGEST_LENGTH) < 0) + emlen - SHA_DIGEST_LENGTH) < 0) { + free(dbmask); return 0; + } for (i = 0; i < SHA_DIGEST_LENGTH; i++) seed[i] ^= seedmask[i]; @@ -122,8 +126,7 @@ RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, } dblen = num - SHA_DIGEST_LENGTH; - db = malloc(dblen + num); - if (db == NULL) { + if ((db = malloc(dblen + num)) == NULL) { RSAerror(ERR_R_MALLOC_FAILURE); return -1; } @@ -139,17 +142,17 @@ RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, maskeddb = padded_from + SHA_DIGEST_LENGTH; if (MGF1(seed, SHA_DIGEST_LENGTH, maskeddb, dblen)) - return -1; + goto err; for (i = 0; i < SHA_DIGEST_LENGTH; i++) seed[i] ^= padded_from[i]; if (MGF1(db, dblen, seed, SHA_DIGEST_LENGTH)) - return -1; + goto err; for (i = 0; i < dblen; i++) db[i] ^= maskeddb[i]; if (!EVP_Digest((void *)param, plen, phash, NULL, EVP_sha1(), NULL)) - return -1; + goto err; if (timingsafe_memcmp(db, phash, SHA_DIGEST_LENGTH) != 0 || bad) goto decoding_err; @@ -173,12 +176,13 @@ RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, free(db); return mlen; -decoding_err: + decoding_err: /* * To avoid chosen ciphertext attacks, the error message should not * reveal which kind of decoding error happened */ RSAerror(RSA_R_OAEP_DECODING_ERROR); + err: free(db); return -1; } @@ -219,7 +223,7 @@ PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed, } } rv = 0; -err: + err: EVP_MD_CTX_cleanup(&c); return rv; } diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c index b4a4e730..ea6401b3 100644 --- a/crypto/rsa/rsa_pmeth.c +++ b/crypto/rsa/rsa_pmeth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_pmeth.c,v 1.20 2017/08/28 17:41:59 jsing Exp $ */ +/* $OpenBSD: rsa_pmeth.c,v 1.21 2018/09/05 00:55:33 djm Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -296,7 +296,7 @@ pkey_rsa_verify(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen, return 0; } - if (rslen != tbslen || memcmp(tbs, rctx->tbuf, rslen)) + if (rslen != tbslen || timingsafe_bcmp(tbs, rctx->tbuf, rslen)) return 0; return 1; diff --git a/crypto/rsa/rsa_pss.c b/crypto/rsa/rsa_pss.c index 870f634b..562f7b25 100644 --- a/crypto/rsa/rsa_pss.c +++ b/crypto/rsa/rsa_pss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_pss.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: rsa_pss.c,v 1.13 2018/09/05 00:55:33 djm Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2005. */ @@ -163,7 +163,7 @@ RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash, } if (!EVP_DigestFinal_ex(&ctx, H_, NULL)) goto err; - if (memcmp(H_, H, hLen)) { + if (timingsafe_bcmp(H_, H, hLen)) { RSAerror(RSA_R_BAD_SIGNATURE); ret = 0; } else diff --git a/crypto/rsa/rsa_saos.c b/crypto/rsa/rsa_saos.c index e1fbdcb5..93492ac5 100644 --- a/crypto/rsa/rsa_saos.c +++ b/crypto/rsa/rsa_saos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_saos.c,v 1.23 2017/05/02 03:59:45 deraadt Exp $ */ +/* $OpenBSD: rsa_saos.c,v 1.24 2018/09/05 00:55:33 djm Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -130,7 +130,7 @@ RSA_verify_ASN1_OCTET_STRING(int dtype, const unsigned char *m, goto err; if ((unsigned int)sig->length != m_len || - memcmp(m, sig->data, m_len) != 0) { + timingsafe_bcmp(m, sig->data, m_len) != 0) { RSAerror(RSA_R_BAD_SIGNATURE); } else ret = 1; diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c index 6e9e869f..50e07f4f 100644 --- a/crypto/rsa/rsa_sign.c +++ b/crypto/rsa/rsa_sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_sign.c,v 1.29 2017/05/02 03:59:45 deraadt Exp $ */ +/* $OpenBSD: rsa_sign.c,v 1.31 2018/09/05 00:55:33 djm Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -70,168 +70,197 @@ /* Size of an SSL signature: MD5+SHA1 */ #define SSL_SIG_LENGTH 36 -int -RSA_sign(int type, const unsigned char *m, unsigned int m_len, - unsigned char *sigret, unsigned int *siglen, RSA *rsa) +static int encode_pkcs1(unsigned char **, int *, int , const unsigned char *, + unsigned int); + +/* + * encode_pkcs1 encodes a DigestInfo prefix of hash `type' and digest `m', as + * described in EMSA-PKCS-v1_5-ENCODE, RFC 8017 section 9. step 2. This + * encodes the DigestInfo (T and tLen) but does not add the padding. + * + * On success, it returns one and sets `*out' to a newly allocated buffer + * containing the result and `*out_len' to its length. Freeing `*out' is + * the caller's responsibility. Failure is indicated by zero. + */ +static int +encode_pkcs1(unsigned char **out, int *out_len, int type, + const unsigned char *m, unsigned int m_len) { X509_SIG sig; - ASN1_TYPE parameter; - int i, j, ret = 1; - unsigned char *p, *tmps = NULL; - const unsigned char *s = NULL; X509_ALGOR algor; + ASN1_TYPE parameter; ASN1_OCTET_STRING digest; + uint8_t *der = NULL; + int len; + + sig.algor = &algor; + if ((sig.algor->algorithm = OBJ_nid2obj(type)) == NULL) { + RSAerror(RSA_R_UNKNOWN_ALGORITHM_TYPE); + return 0; + } + if (sig.algor->algorithm->length == 0) { + RSAerror( + RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD); + return 0; + } + parameter.type = V_ASN1_NULL; + parameter.value.ptr = NULL; + sig.algor->parameter = ¶meter; + + sig.digest = &digest; + sig.digest->data = (unsigned char*)m; /* TMP UGLY CAST */ + sig.digest->length = m_len; - if ((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_sign) + if ((len = i2d_X509_SIG(&sig, &der)) < 0) + return 0; + + *out = der; + *out_len = len; + + return 1; +} + +int +RSA_sign(int type, const unsigned char *m, unsigned int m_len, + unsigned char *sigret, unsigned int *siglen, RSA *rsa) +{ + const unsigned char *encoded = NULL; + unsigned char *tmps = NULL; + int encrypt_len, encoded_len = 0, ret = 0; + + if ((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_sign != NULL) return rsa->meth->rsa_sign(type, m, m_len, sigret, siglen, rsa); - /* Special case: SSL signature, just check the length */ + /* Compute the encoded digest. */ if (type == NID_md5_sha1) { + /* + * NID_md5_sha1 corresponds to the MD5/SHA1 combination in + * TLS 1.1 and earlier. It has no DigestInfo wrapper but + * otherwise is RSASSA-PKCS-v1.5. + */ if (m_len != SSL_SIG_LENGTH) { - RSAerror(RSA_R_INVALID_MESSAGE_LENGTH); + RSAerror(RSA_R_INVALID_DIGEST_LENGTH); return 0; } - i = SSL_SIG_LENGTH; - s = m; + encoded_len = SSL_SIG_LENGTH; + encoded = m; } else { - sig.algor = &algor; - sig.algor->algorithm = OBJ_nid2obj(type); - if (sig.algor->algorithm == NULL) { - RSAerror(RSA_R_UNKNOWN_ALGORITHM_TYPE); - return 0; - } - if (sig.algor->algorithm->length == 0) { - RSAerror(RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD); - return 0; - } - parameter.type = V_ASN1_NULL; - parameter.value.ptr = NULL; - sig.algor->parameter = ¶meter; - - sig.digest = &digest; - sig.digest->data = (unsigned char *)m; /* TMP UGLY CAST */ - sig.digest->length = m_len; - - i = i2d_X509_SIG(&sig, NULL); + if (!encode_pkcs1(&tmps, &encoded_len, type, m, m_len)) + goto err; + encoded = tmps; } - j = RSA_size(rsa); - if (i > j - RSA_PKCS1_PADDING_SIZE) { + if (encoded_len > RSA_size(rsa) - RSA_PKCS1_PADDING_SIZE) { RSAerror(RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY); - return 0; - } - if (type != NID_md5_sha1) { - tmps = malloc(j + 1); - if (tmps == NULL) { - RSAerror(ERR_R_MALLOC_FAILURE); - return 0; - } - p = tmps; - i2d_X509_SIG(&sig, &p); - s = tmps; + goto err; } - i = RSA_private_encrypt(i, s, sigret, rsa, RSA_PKCS1_PADDING); - if (i <= 0) - ret = 0; - else - *siglen = i; - - if (type != NID_md5_sha1) - freezero(tmps, (unsigned int)j + 1); + if ((encrypt_len = RSA_private_encrypt(encoded_len, encoded, sigret, + rsa, RSA_PKCS1_PADDING)) <= 0) + goto err; + + *siglen = encrypt_len; + ret = 1; + + err: + freezero(tmps, (size_t)encoded_len); return (ret); } +/* + * int_rsa_verify verifies an RSA signature in `sigbuf' using `rsa'. It may be + * called in two modes. If `rm' is NULL, it verifies the signature for the + * digest `m'. Otherwise, it recovers the digest from the signature, writing the + * digest to `rm' and the length to `*prm_len'. `type' is the NID of the digest + * algorithm to use. It returns one on successful verification and zero + * otherwise. + */ int -int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, +int_rsa_verify(int type, const unsigned char *m, unsigned int m_len, unsigned char *rm, size_t *prm_len, const unsigned char *sigbuf, size_t siglen, RSA *rsa) { - int i, ret = 0, sigtype; - unsigned char *s; - X509_SIG *sig = NULL; + unsigned char *decrypt_buf, *encoded = NULL; + int decrypt_len, encoded_len = 0, ret = 0; - if (siglen != (unsigned int)RSA_size(rsa)) { + if (siglen != (size_t)RSA_size(rsa)) { RSAerror(RSA_R_WRONG_SIGNATURE_LENGTH); return 0; } - if ((dtype == NID_md5_sha1) && rm) { - i = RSA_public_decrypt((int)siglen, sigbuf, rm, rsa, - RSA_PKCS1_PADDING); - if (i <= 0) - return 0; - *prm_len = i; - return 1; - } - - s = malloc(siglen); - if (s == NULL) { + /* Recover the encoded digest. */ + if ((decrypt_buf = malloc(siglen)) == NULL) { RSAerror(ERR_R_MALLOC_FAILURE); goto err; } - if (dtype == NID_md5_sha1 && m_len != SSL_SIG_LENGTH) { - RSAerror(RSA_R_INVALID_MESSAGE_LENGTH); - goto err; - } - i = RSA_public_decrypt((int)siglen, sigbuf, s, rsa, RSA_PKCS1_PADDING); - - if (i <= 0) + if ((decrypt_len = RSA_public_decrypt((int)siglen, sigbuf, decrypt_buf, + rsa, RSA_PKCS1_PADDING)) <= 0) goto err; + + if (type == NID_md5_sha1) { + /* + * NID_md5_sha1 corresponds to the MD5/SHA1 combination in + * TLS 1.1 and earlier. It has no DigestInfo wrapper but + * otherwise is RSASSA-PKCS1-v1_5. + */ + if (decrypt_len != SSL_SIG_LENGTH) { + RSAerror(RSA_R_INVALID_DIGEST_LENGTH); + goto err; + } - /* Special case: SSL signature */ - if (dtype == NID_md5_sha1) { - if (i != SSL_SIG_LENGTH || memcmp(s, m, SSL_SIG_LENGTH)) - RSAerror(RSA_R_BAD_SIGNATURE); - else - ret = 1; + if (rm != NULL) { + memcpy(rm, decrypt_buf, SSL_SIG_LENGTH); + *prm_len = SSL_SIG_LENGTH; + } else { + if (m_len != SSL_SIG_LENGTH) { + RSAerror(RSA_R_INVALID_MESSAGE_LENGTH); + goto err; + } + if (timingsafe_bcmp(decrypt_buf, + m, SSL_SIG_LENGTH) != 0) { + RSAerror(RSA_R_BAD_SIGNATURE); + goto err; + } + } } else { - const unsigned char *p = s; + /* + * If recovering the digest, extract a digest-sized output from + * the end of `decrypt_buf' for `encode_pkcs1', then compare the + * decryption output as in a standard verification. + */ + if (rm != NULL) { + const EVP_MD *md; - sig = d2i_X509_SIG(NULL, &p, (long)i); + if ((md = EVP_get_digestbynid(type)) == NULL) { + RSAerror(RSA_R_UNKNOWN_ALGORITHM_TYPE); + goto err; + } + if ((m_len = EVP_MD_size(md)) > (size_t)decrypt_len) { + RSAerror(RSA_R_INVALID_DIGEST_LENGTH); + goto err; + } + m = decrypt_buf + decrypt_len - m_len; + } - if (sig == NULL) + /* Construct the encoded digest and ensure it matches */ + if (!encode_pkcs1(&encoded, &encoded_len, type, m, m_len)) goto err; - /* Excess data can be used to create forgeries */ - if (p != s + i) { + if (encoded_len != decrypt_len || + timingsafe_bcmp(encoded, decrypt_buf, encoded_len) != 0) { RSAerror(RSA_R_BAD_SIGNATURE); goto err; } - /* Parameters to the signature algorithm can also be used to - create forgeries */ - if (sig->algor->parameter && - ASN1_TYPE_get(sig->algor->parameter) != V_ASN1_NULL) { - RSAerror(RSA_R_BAD_SIGNATURE); - goto err; + /* Output the recovered digest. */ + if (rm != NULL) { + memcpy(rm, m, m_len); + *prm_len = m_len; } - - sigtype = OBJ_obj2nid(sig->algor->algorithm); - - if (sigtype != dtype) { - RSAerror(RSA_R_ALGORITHM_MISMATCH); - goto err; - } - if (rm) { - const EVP_MD *md; - - md = EVP_get_digestbynid(dtype); - if (md && (EVP_MD_size(md) != sig->digest->length)) - RSAerror(RSA_R_INVALID_DIGEST_LENGTH); - else { - memcpy(rm, sig->digest->data, - sig->digest->length); - *prm_len = sig->digest->length; - ret = 1; - } - } else if ((unsigned int)sig->digest->length != m_len || - memcmp(m, sig->digest->data, m_len) != 0) { - RSAerror(RSA_R_BAD_SIGNATURE); - } else - ret = 1; } -err: - X509_SIG_free(sig); - freezero(s, (unsigned int)siglen); + + ret = 1; + err: + freezero(encoded, (size_t)encoded_len); + freezero(decrypt_buf, siglen); return ret; } diff --git a/crypto/sha/sha1-elf-armv4.S b/crypto/sha/sha1-elf-armv4.S new file mode 100644 index 00000000..5aeaf7c6 --- /dev/null +++ b/crypto/sha/sha1-elf-armv4.S @@ -0,0 +1,455 @@ +#include "arm_arch.h" + +.text + +.global sha1_block_data_order +.type sha1_block_data_order,%function + +.align 2 +sha1_block_data_order: + stmdb sp!,{r4-r12,lr} + add r2,r1,r2,lsl#6 @ r2 to point at the end of r1 + ldmia r0,{r3,r4,r5,r6,r7} +.Lloop: + ldr r8,.LK_00_19 + mov r14,sp + sub sp,sp,#15*4 + mov r5,r5,ror#30 + mov r6,r6,ror#30 + mov r7,r7,ror#30 @ [6] +.L_00_15: +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r10,[r1,#2] + ldrb r9,[r1,#3] + ldrb r11,[r1,#1] + add r7,r8,r7,ror#2 @ E+=K_00_19 + ldrb r12,[r1],#4 + orr r9,r9,r10,lsl#8 + eor r10,r5,r6 @ F_xx_xx + orr r9,r9,r11,lsl#16 + add r7,r7,r3,ror#27 @ E+=ROR(A,27) + orr r9,r9,r12,lsl#24 +#else + ldr r9,[r1],#4 @ handles unaligned + add r7,r8,r7,ror#2 @ E+=K_00_19 + eor r10,r5,r6 @ F_xx_xx + add r7,r7,r3,ror#27 @ E+=ROR(A,27) +#ifdef __ARMEL__ + rev r9,r9 @ byte swap +#endif +#endif + and r10,r4,r10,ror#2 + add r7,r7,r9 @ E+=X[i] + eor r10,r10,r6,ror#2 @ F_00_19(B,C,D) + str r9,[r14,#-4]! + add r7,r7,r10 @ E+=F_00_19(B,C,D) +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r10,[r1,#2] + ldrb r9,[r1,#3] + ldrb r11,[r1,#1] + add r6,r8,r6,ror#2 @ E+=K_00_19 + ldrb r12,[r1],#4 + orr r9,r9,r10,lsl#8 + eor r10,r4,r5 @ F_xx_xx + orr r9,r9,r11,lsl#16 + add r6,r6,r7,ror#27 @ E+=ROR(A,27) + orr r9,r9,r12,lsl#24 +#else + ldr r9,[r1],#4 @ handles unaligned + add r6,r8,r6,ror#2 @ E+=K_00_19 + eor r10,r4,r5 @ F_xx_xx + add r6,r6,r7,ror#27 @ E+=ROR(A,27) +#ifdef __ARMEL__ + rev r9,r9 @ byte swap +#endif +#endif + and r10,r3,r10,ror#2 + add r6,r6,r9 @ E+=X[i] + eor r10,r10,r5,ror#2 @ F_00_19(B,C,D) + str r9,[r14,#-4]! + add r6,r6,r10 @ E+=F_00_19(B,C,D) +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r10,[r1,#2] + ldrb r9,[r1,#3] + ldrb r11,[r1,#1] + add r5,r8,r5,ror#2 @ E+=K_00_19 + ldrb r12,[r1],#4 + orr r9,r9,r10,lsl#8 + eor r10,r3,r4 @ F_xx_xx + orr r9,r9,r11,lsl#16 + add r5,r5,r6,ror#27 @ E+=ROR(A,27) + orr r9,r9,r12,lsl#24 +#else + ldr r9,[r1],#4 @ handles unaligned + add r5,r8,r5,ror#2 @ E+=K_00_19 + eor r10,r3,r4 @ F_xx_xx + add r5,r5,r6,ror#27 @ E+=ROR(A,27) +#ifdef __ARMEL__ + rev r9,r9 @ byte swap +#endif +#endif + and r10,r7,r10,ror#2 + add r5,r5,r9 @ E+=X[i] + eor r10,r10,r4,ror#2 @ F_00_19(B,C,D) + str r9,[r14,#-4]! + add r5,r5,r10 @ E+=F_00_19(B,C,D) +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r10,[r1,#2] + ldrb r9,[r1,#3] + ldrb r11,[r1,#1] + add r4,r8,r4,ror#2 @ E+=K_00_19 + ldrb r12,[r1],#4 + orr r9,r9,r10,lsl#8 + eor r10,r7,r3 @ F_xx_xx + orr r9,r9,r11,lsl#16 + add r4,r4,r5,ror#27 @ E+=ROR(A,27) + orr r9,r9,r12,lsl#24 +#else + ldr r9,[r1],#4 @ handles unaligned + add r4,r8,r4,ror#2 @ E+=K_00_19 + eor r10,r7,r3 @ F_xx_xx + add r4,r4,r5,ror#27 @ E+=ROR(A,27) +#ifdef __ARMEL__ + rev r9,r9 @ byte swap +#endif +#endif + and r10,r6,r10,ror#2 + add r4,r4,r9 @ E+=X[i] + eor r10,r10,r3,ror#2 @ F_00_19(B,C,D) + str r9,[r14,#-4]! + add r4,r4,r10 @ E+=F_00_19(B,C,D) +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r10,[r1,#2] + ldrb r9,[r1,#3] + ldrb r11,[r1,#1] + add r3,r8,r3,ror#2 @ E+=K_00_19 + ldrb r12,[r1],#4 + orr r9,r9,r10,lsl#8 + eor r10,r6,r7 @ F_xx_xx + orr r9,r9,r11,lsl#16 + add r3,r3,r4,ror#27 @ E+=ROR(A,27) + orr r9,r9,r12,lsl#24 +#else + ldr r9,[r1],#4 @ handles unaligned + add r3,r8,r3,ror#2 @ E+=K_00_19 + eor r10,r6,r7 @ F_xx_xx + add r3,r3,r4,ror#27 @ E+=ROR(A,27) +#ifdef __ARMEL__ + rev r9,r9 @ byte swap +#endif +#endif + and r10,r5,r10,ror#2 + add r3,r3,r9 @ E+=X[i] + eor r10,r10,r7,ror#2 @ F_00_19(B,C,D) + str r9,[r14,#-4]! + add r3,r3,r10 @ E+=F_00_19(B,C,D) + teq r14,sp + bne .L_00_15 @ [((11+4)*5+2)*3] + sub sp,sp,#25*4 +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r10,[r1,#2] + ldrb r9,[r1,#3] + ldrb r11,[r1,#1] + add r7,r8,r7,ror#2 @ E+=K_00_19 + ldrb r12,[r1],#4 + orr r9,r9,r10,lsl#8 + eor r10,r5,r6 @ F_xx_xx + orr r9,r9,r11,lsl#16 + add r7,r7,r3,ror#27 @ E+=ROR(A,27) + orr r9,r9,r12,lsl#24 +#else + ldr r9,[r1],#4 @ handles unaligned + add r7,r8,r7,ror#2 @ E+=K_00_19 + eor r10,r5,r6 @ F_xx_xx + add r7,r7,r3,ror#27 @ E+=ROR(A,27) +#ifdef __ARMEL__ + rev r9,r9 @ byte swap +#endif +#endif + and r10,r4,r10,ror#2 + add r7,r7,r9 @ E+=X[i] + eor r10,r10,r6,ror#2 @ F_00_19(B,C,D) + str r9,[r14,#-4]! + add r7,r7,r10 @ E+=F_00_19(B,C,D) + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r6,r8,r6,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r4,r5 @ F_xx_xx + mov r9,r9,ror#31 + add r6,r6,r7,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + and r10,r3,r10,ror#2 @ F_xx_xx + @ F_xx_xx + add r6,r6,r9 @ E+=X[i] + eor r10,r10,r5,ror#2 @ F_00_19(B,C,D) + add r6,r6,r10 @ E+=F_00_19(B,C,D) + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r5,r8,r5,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r3,r4 @ F_xx_xx + mov r9,r9,ror#31 + add r5,r5,r6,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + and r10,r7,r10,ror#2 @ F_xx_xx + @ F_xx_xx + add r5,r5,r9 @ E+=X[i] + eor r10,r10,r4,ror#2 @ F_00_19(B,C,D) + add r5,r5,r10 @ E+=F_00_19(B,C,D) + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r4,r8,r4,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r7,r3 @ F_xx_xx + mov r9,r9,ror#31 + add r4,r4,r5,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + and r10,r6,r10,ror#2 @ F_xx_xx + @ F_xx_xx + add r4,r4,r9 @ E+=X[i] + eor r10,r10,r3,ror#2 @ F_00_19(B,C,D) + add r4,r4,r10 @ E+=F_00_19(B,C,D) + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r3,r8,r3,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r6,r7 @ F_xx_xx + mov r9,r9,ror#31 + add r3,r3,r4,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + and r10,r5,r10,ror#2 @ F_xx_xx + @ F_xx_xx + add r3,r3,r9 @ E+=X[i] + eor r10,r10,r7,ror#2 @ F_00_19(B,C,D) + add r3,r3,r10 @ E+=F_00_19(B,C,D) + + ldr r8,.LK_20_39 @ [+15+16*4] + cmn sp,#0 @ [+3], clear carry to denote 20_39 +.L_20_39_or_60_79: + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r7,r8,r7,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r5,r6 @ F_xx_xx + mov r9,r9,ror#31 + add r7,r7,r3,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + eor r10,r4,r10,ror#2 @ F_xx_xx + @ F_xx_xx + add r7,r7,r9 @ E+=X[i] + add r7,r7,r10 @ E+=F_20_39(B,C,D) + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r6,r8,r6,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r4,r5 @ F_xx_xx + mov r9,r9,ror#31 + add r6,r6,r7,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + eor r10,r3,r10,ror#2 @ F_xx_xx + @ F_xx_xx + add r6,r6,r9 @ E+=X[i] + add r6,r6,r10 @ E+=F_20_39(B,C,D) + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r5,r8,r5,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r3,r4 @ F_xx_xx + mov r9,r9,ror#31 + add r5,r5,r6,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + eor r10,r7,r10,ror#2 @ F_xx_xx + @ F_xx_xx + add r5,r5,r9 @ E+=X[i] + add r5,r5,r10 @ E+=F_20_39(B,C,D) + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r4,r8,r4,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r7,r3 @ F_xx_xx + mov r9,r9,ror#31 + add r4,r4,r5,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + eor r10,r6,r10,ror#2 @ F_xx_xx + @ F_xx_xx + add r4,r4,r9 @ E+=X[i] + add r4,r4,r10 @ E+=F_20_39(B,C,D) + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r3,r8,r3,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r6,r7 @ F_xx_xx + mov r9,r9,ror#31 + add r3,r3,r4,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + eor r10,r5,r10,ror#2 @ F_xx_xx + @ F_xx_xx + add r3,r3,r9 @ E+=X[i] + add r3,r3,r10 @ E+=F_20_39(B,C,D) + teq r14,sp @ preserve carry + bne .L_20_39_or_60_79 @ [+((12+3)*5+2)*4] + bcs .L_done @ [+((12+3)*5+2)*4], spare 300 bytes + + ldr r8,.LK_40_59 + sub sp,sp,#20*4 @ [+2] +.L_40_59: + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r7,r8,r7,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r5,r6 @ F_xx_xx + mov r9,r9,ror#31 + add r7,r7,r3,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + and r10,r4,r10,ror#2 @ F_xx_xx + and r11,r5,r6 @ F_xx_xx + add r7,r7,r9 @ E+=X[i] + add r7,r7,r10 @ E+=F_40_59(B,C,D) + add r7,r7,r11,ror#2 + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r6,r8,r6,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r4,r5 @ F_xx_xx + mov r9,r9,ror#31 + add r6,r6,r7,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + and r10,r3,r10,ror#2 @ F_xx_xx + and r11,r4,r5 @ F_xx_xx + add r6,r6,r9 @ E+=X[i] + add r6,r6,r10 @ E+=F_40_59(B,C,D) + add r6,r6,r11,ror#2 + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r5,r8,r5,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r3,r4 @ F_xx_xx + mov r9,r9,ror#31 + add r5,r5,r6,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + and r10,r7,r10,ror#2 @ F_xx_xx + and r11,r3,r4 @ F_xx_xx + add r5,r5,r9 @ E+=X[i] + add r5,r5,r10 @ E+=F_40_59(B,C,D) + add r5,r5,r11,ror#2 + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r4,r8,r4,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r7,r3 @ F_xx_xx + mov r9,r9,ror#31 + add r4,r4,r5,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + and r10,r6,r10,ror#2 @ F_xx_xx + and r11,r7,r3 @ F_xx_xx + add r4,r4,r9 @ E+=X[i] + add r4,r4,r10 @ E+=F_40_59(B,C,D) + add r4,r4,r11,ror#2 + ldr r9,[r14,#15*4] + ldr r10,[r14,#13*4] + ldr r11,[r14,#7*4] + add r3,r8,r3,ror#2 @ E+=K_xx_xx + ldr r12,[r14,#2*4] + eor r9,r9,r10 + eor r11,r11,r12 @ 1 cycle stall + eor r10,r6,r7 @ F_xx_xx + mov r9,r9,ror#31 + add r3,r3,r4,ror#27 @ E+=ROR(A,27) + eor r9,r9,r11,ror#31 + str r9,[r14,#-4]! + and r10,r5,r10,ror#2 @ F_xx_xx + and r11,r6,r7 @ F_xx_xx + add r3,r3,r9 @ E+=X[i] + add r3,r3,r10 @ E+=F_40_59(B,C,D) + add r3,r3,r11,ror#2 + teq r14,sp + bne .L_40_59 @ [+((12+5)*5+2)*4] + + ldr r8,.LK_60_79 + sub sp,sp,#20*4 + cmp sp,#0 @ set carry to denote 60_79 + b .L_20_39_or_60_79 @ [+4], spare 300 bytes +.L_done: + add sp,sp,#80*4 @ "deallocate" stack frame + ldmia r0,{r8,r9,r10,r11,r12} + add r3,r8,r3 + add r4,r9,r4 + add r5,r10,r5,ror#2 + add r6,r11,r6,ror#2 + add r7,r12,r7,ror#2 + stmia r0,{r3,r4,r5,r6,r7} + teq r1,r2 + bne .Lloop @ [+18], total 1307 + +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r12,pc} +#else + ldmia sp!,{r4-r12,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.align 2 +.LK_00_19: .word 0x5a827999 +.LK_20_39: .word 0x6ed9eba1 +.LK_40_59: .word 0x8f1bbcdc +.LK_60_79: .word 0xca62c1d6 +.size sha1_block_data_order,.-sha1_block_data_order +.asciz "SHA1 block transform for ARMv4, CRYPTOGAMS by " +.align 2 +#if defined(HAVE_GNU_STACK) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/crypto/sha/sha1-elf-x86_64.S b/crypto/sha/sha1-elf-x86_64.S index d7ef2bfe..5a37019a 100644 --- a/crypto/sha/sha1-elf-x86_64.S +++ b/crypto/sha/sha1-elf-x86_64.S @@ -1288,7 +1288,7 @@ sha1_block_data_order: movq 24(%rsi),%rbx leaq 32(%rsi),%rsp .Lepilogue: - .byte 0xf3,0xc3 + retq .size sha1_block_data_order,.-sha1_block_data_order .type sha1_block_data_order_ssse3,@function .align 16 @@ -2475,7 +2475,7 @@ _ssse3_shortcut: movq 16(%rsi),%rbx leaq 24(%rsi),%rsp .Lepilogue_ssse3: - .byte 0xf3,0xc3 + retq .size sha1_block_data_order_ssse3,.-sha1_block_data_order_ssse3 .align 64 K_XX_XX: diff --git a/crypto/sha/sha1-macosx-x86_64.S b/crypto/sha/sha1-macosx-x86_64.S index f5c2c36e..04a8affb 100644 --- a/crypto/sha/sha1-macosx-x86_64.S +++ b/crypto/sha/sha1-macosx-x86_64.S @@ -1288,7 +1288,7 @@ L$loop: movq 24(%rsi),%rbx leaq 32(%rsi),%rsp L$epilogue: - .byte 0xf3,0xc3 + retq .p2align 4 @@ -2475,7 +2475,7 @@ L$done_ssse3: movq 16(%rsi),%rbx leaq 24(%rsi),%rsp L$epilogue_ssse3: - .byte 0xf3,0xc3 + retq .p2align 6 K_XX_XX: diff --git a/crypto/sha/sha1-masm-x86_64.S b/crypto/sha/sha1-masm-x86_64.S new file mode 100644 index 00000000..23b26d9d --- /dev/null +++ b/crypto/sha/sha1-masm-x86_64.S @@ -0,0 +1,2678 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' +EXTERN OPENSSL_ia32cap_P:NEAR + + +PUBLIC sha1_block_data_order + +ALIGN 16 +sha1_block_data_order PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_sha1_block_data_order:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + mov r9d,DWORD PTR[((OPENSSL_ia32cap_P+0))] + mov r8d,DWORD PTR[((OPENSSL_ia32cap_P+4))] + test r8d,IA32CAP_MASK1_SSSE3 + jz $L$ialu + jmp _ssse3_shortcut + +ALIGN 16 +$L$ialu:: + push rbx + push rbp + push r12 + push r13 + mov r11,rsp + mov r8,rdi + sub rsp,72 + mov r9,rsi + and rsp,-64 + mov r10,rdx + mov QWORD PTR[64+rsp],r11 +$L$prologue:: + + mov esi,DWORD PTR[r8] + mov edi,DWORD PTR[4+r8] + mov r11d,DWORD PTR[8+r8] + mov r12d,DWORD PTR[12+r8] + mov r13d,DWORD PTR[16+r8] + jmp $L$loop + +ALIGN 16 +$L$loop:: + mov edx,DWORD PTR[r9] + bswap edx + mov DWORD PTR[rsp],edx + mov eax,r11d + mov ebp,DWORD PTR[4+r9] + mov ecx,esi + xor eax,r12d + bswap ebp + rol ecx,5 + lea r13d,DWORD PTR[1518500249+r13*1+rdx] + and eax,edi + mov DWORD PTR[4+rsp],ebp + add r13d,ecx + xor eax,r12d + rol edi,30 + add r13d,eax + mov eax,edi + mov edx,DWORD PTR[8+r9] + mov ecx,r13d + xor eax,r11d + bswap edx + rol ecx,5 + lea r12d,DWORD PTR[1518500249+r12*1+rbp] + and eax,esi + mov DWORD PTR[8+rsp],edx + add r12d,ecx + xor eax,r11d + rol esi,30 + add r12d,eax + mov eax,esi + mov ebp,DWORD PTR[12+r9] + mov ecx,r12d + xor eax,edi + bswap ebp + rol ecx,5 + lea r11d,DWORD PTR[1518500249+r11*1+rdx] + and eax,r13d + mov DWORD PTR[12+rsp],ebp + add r11d,ecx + xor eax,edi + rol r13d,30 + add r11d,eax + mov eax,r13d + mov edx,DWORD PTR[16+r9] + mov ecx,r11d + xor eax,esi + bswap edx + rol ecx,5 + lea edi,DWORD PTR[1518500249+rdi*1+rbp] + and eax,r12d + mov DWORD PTR[16+rsp],edx + add edi,ecx + xor eax,esi + rol r12d,30 + add edi,eax + mov eax,r12d + mov ebp,DWORD PTR[20+r9] + mov ecx,edi + xor eax,r13d + bswap ebp + rol ecx,5 + lea esi,DWORD PTR[1518500249+rsi*1+rdx] + and eax,r11d + mov DWORD PTR[20+rsp],ebp + add esi,ecx + xor eax,r13d + rol r11d,30 + add esi,eax + mov eax,r11d + mov edx,DWORD PTR[24+r9] + mov ecx,esi + xor eax,r12d + bswap edx + rol ecx,5 + lea r13d,DWORD PTR[1518500249+r13*1+rbp] + and eax,edi + mov DWORD PTR[24+rsp],edx + add r13d,ecx + xor eax,r12d + rol edi,30 + add r13d,eax + mov eax,edi + mov ebp,DWORD PTR[28+r9] + mov ecx,r13d + xor eax,r11d + bswap ebp + rol ecx,5 + lea r12d,DWORD PTR[1518500249+r12*1+rdx] + and eax,esi + mov DWORD PTR[28+rsp],ebp + add r12d,ecx + xor eax,r11d + rol esi,30 + add r12d,eax + mov eax,esi + mov edx,DWORD PTR[32+r9] + mov ecx,r12d + xor eax,edi + bswap edx + rol ecx,5 + lea r11d,DWORD PTR[1518500249+r11*1+rbp] + and eax,r13d + mov DWORD PTR[32+rsp],edx + add r11d,ecx + xor eax,edi + rol r13d,30 + add r11d,eax + mov eax,r13d + mov ebp,DWORD PTR[36+r9] + mov ecx,r11d + xor eax,esi + bswap ebp + rol ecx,5 + lea edi,DWORD PTR[1518500249+rdi*1+rdx] + and eax,r12d + mov DWORD PTR[36+rsp],ebp + add edi,ecx + xor eax,esi + rol r12d,30 + add edi,eax + mov eax,r12d + mov edx,DWORD PTR[40+r9] + mov ecx,edi + xor eax,r13d + bswap edx + rol ecx,5 + lea esi,DWORD PTR[1518500249+rsi*1+rbp] + and eax,r11d + mov DWORD PTR[40+rsp],edx + add esi,ecx + xor eax,r13d + rol r11d,30 + add esi,eax + mov eax,r11d + mov ebp,DWORD PTR[44+r9] + mov ecx,esi + xor eax,r12d + bswap ebp + rol ecx,5 + lea r13d,DWORD PTR[1518500249+r13*1+rdx] + and eax,edi + mov DWORD PTR[44+rsp],ebp + add r13d,ecx + xor eax,r12d + rol edi,30 + add r13d,eax + mov eax,edi + mov edx,DWORD PTR[48+r9] + mov ecx,r13d + xor eax,r11d + bswap edx + rol ecx,5 + lea r12d,DWORD PTR[1518500249+r12*1+rbp] + and eax,esi + mov DWORD PTR[48+rsp],edx + add r12d,ecx + xor eax,r11d + rol esi,30 + add r12d,eax + mov eax,esi + mov ebp,DWORD PTR[52+r9] + mov ecx,r12d + xor eax,edi + bswap ebp + rol ecx,5 + lea r11d,DWORD PTR[1518500249+r11*1+rdx] + and eax,r13d + mov DWORD PTR[52+rsp],ebp + add r11d,ecx + xor eax,edi + rol r13d,30 + add r11d,eax + mov eax,r13d + mov edx,DWORD PTR[56+r9] + mov ecx,r11d + xor eax,esi + bswap edx + rol ecx,5 + lea edi,DWORD PTR[1518500249+rdi*1+rbp] + and eax,r12d + mov DWORD PTR[56+rsp],edx + add edi,ecx + xor eax,esi + rol r12d,30 + add edi,eax + mov eax,r12d + mov ebp,DWORD PTR[60+r9] + mov ecx,edi + xor eax,r13d + bswap ebp + rol ecx,5 + lea esi,DWORD PTR[1518500249+rsi*1+rdx] + and eax,r11d + mov DWORD PTR[60+rsp],ebp + add esi,ecx + xor eax,r13d + rol r11d,30 + add esi,eax + mov edx,DWORD PTR[rsp] + mov eax,r11d + mov ecx,esi + xor edx,DWORD PTR[8+rsp] + xor eax,r12d + rol ecx,5 + xor edx,DWORD PTR[32+rsp] + and eax,edi + lea r13d,DWORD PTR[1518500249+r13*1+rbp] + xor edx,DWORD PTR[52+rsp] + xor eax,r12d + rol edx,1 + add r13d,ecx + rol edi,30 + mov DWORD PTR[rsp],edx + add r13d,eax + mov ebp,DWORD PTR[4+rsp] + mov eax,edi + mov ecx,r13d + xor ebp,DWORD PTR[12+rsp] + xor eax,r11d + rol ecx,5 + xor ebp,DWORD PTR[36+rsp] + and eax,esi + lea r12d,DWORD PTR[1518500249+r12*1+rdx] + xor ebp,DWORD PTR[56+rsp] + xor eax,r11d + rol ebp,1 + add r12d,ecx + rol esi,30 + mov DWORD PTR[4+rsp],ebp + add r12d,eax + mov edx,DWORD PTR[8+rsp] + mov eax,esi + mov ecx,r12d + xor edx,DWORD PTR[16+rsp] + xor eax,edi + rol ecx,5 + xor edx,DWORD PTR[40+rsp] + and eax,r13d + lea r11d,DWORD PTR[1518500249+r11*1+rbp] + xor edx,DWORD PTR[60+rsp] + xor eax,edi + rol edx,1 + add r11d,ecx + rol r13d,30 + mov DWORD PTR[8+rsp],edx + add r11d,eax + mov ebp,DWORD PTR[12+rsp] + mov eax,r13d + mov ecx,r11d + xor ebp,DWORD PTR[20+rsp] + xor eax,esi + rol ecx,5 + xor ebp,DWORD PTR[44+rsp] + and eax,r12d + lea edi,DWORD PTR[1518500249+rdi*1+rdx] + xor ebp,DWORD PTR[rsp] + xor eax,esi + rol ebp,1 + add edi,ecx + rol r12d,30 + mov DWORD PTR[12+rsp],ebp + add edi,eax + mov edx,DWORD PTR[16+rsp] + mov eax,r12d + mov ecx,edi + xor edx,DWORD PTR[24+rsp] + xor eax,r13d + rol ecx,5 + xor edx,DWORD PTR[48+rsp] + and eax,r11d + lea esi,DWORD PTR[1518500249+rsi*1+rbp] + xor edx,DWORD PTR[4+rsp] + xor eax,r13d + rol edx,1 + add esi,ecx + rol r11d,30 + mov DWORD PTR[16+rsp],edx + add esi,eax + mov ebp,DWORD PTR[20+rsp] + mov eax,r11d + mov ecx,esi + xor ebp,DWORD PTR[28+rsp] + xor eax,edi + rol ecx,5 + lea r13d,DWORD PTR[1859775393+r13*1+rdx] + xor ebp,DWORD PTR[52+rsp] + xor eax,r12d + add r13d,ecx + xor ebp,DWORD PTR[8+rsp] + rol edi,30 + add r13d,eax + rol ebp,1 + mov DWORD PTR[20+rsp],ebp + mov edx,DWORD PTR[24+rsp] + mov eax,edi + mov ecx,r13d + xor edx,DWORD PTR[32+rsp] + xor eax,esi + rol ecx,5 + lea r12d,DWORD PTR[1859775393+r12*1+rbp] + xor edx,DWORD PTR[56+rsp] + xor eax,r11d + add r12d,ecx + xor edx,DWORD PTR[12+rsp] + rol esi,30 + add r12d,eax + rol edx,1 + mov DWORD PTR[24+rsp],edx + mov ebp,DWORD PTR[28+rsp] + mov eax,esi + mov ecx,r12d + xor ebp,DWORD PTR[36+rsp] + xor eax,r13d + rol ecx,5 + lea r11d,DWORD PTR[1859775393+r11*1+rdx] + xor ebp,DWORD PTR[60+rsp] + xor eax,edi + add r11d,ecx + xor ebp,DWORD PTR[16+rsp] + rol r13d,30 + add r11d,eax + rol ebp,1 + mov DWORD PTR[28+rsp],ebp + mov edx,DWORD PTR[32+rsp] + mov eax,r13d + mov ecx,r11d + xor edx,DWORD PTR[40+rsp] + xor eax,r12d + rol ecx,5 + lea edi,DWORD PTR[1859775393+rdi*1+rbp] + xor edx,DWORD PTR[rsp] + xor eax,esi + add edi,ecx + xor edx,DWORD PTR[20+rsp] + rol r12d,30 + add edi,eax + rol edx,1 + mov DWORD PTR[32+rsp],edx + mov ebp,DWORD PTR[36+rsp] + mov eax,r12d + mov ecx,edi + xor ebp,DWORD PTR[44+rsp] + xor eax,r11d + rol ecx,5 + lea esi,DWORD PTR[1859775393+rsi*1+rdx] + xor ebp,DWORD PTR[4+rsp] + xor eax,r13d + add esi,ecx + xor ebp,DWORD PTR[24+rsp] + rol r11d,30 + add esi,eax + rol ebp,1 + mov DWORD PTR[36+rsp],ebp + mov edx,DWORD PTR[40+rsp] + mov eax,r11d + mov ecx,esi + xor edx,DWORD PTR[48+rsp] + xor eax,edi + rol ecx,5 + lea r13d,DWORD PTR[1859775393+r13*1+rbp] + xor edx,DWORD PTR[8+rsp] + xor eax,r12d + add r13d,ecx + xor edx,DWORD PTR[28+rsp] + rol edi,30 + add r13d,eax + rol edx,1 + mov DWORD PTR[40+rsp],edx + mov ebp,DWORD PTR[44+rsp] + mov eax,edi + mov ecx,r13d + xor ebp,DWORD PTR[52+rsp] + xor eax,esi + rol ecx,5 + lea r12d,DWORD PTR[1859775393+r12*1+rdx] + xor ebp,DWORD PTR[12+rsp] + xor eax,r11d + add r12d,ecx + xor ebp,DWORD PTR[32+rsp] + rol esi,30 + add r12d,eax + rol ebp,1 + mov DWORD PTR[44+rsp],ebp + mov edx,DWORD PTR[48+rsp] + mov eax,esi + mov ecx,r12d + xor edx,DWORD PTR[56+rsp] + xor eax,r13d + rol ecx,5 + lea r11d,DWORD PTR[1859775393+r11*1+rbp] + xor edx,DWORD PTR[16+rsp] + xor eax,edi + add r11d,ecx + xor edx,DWORD PTR[36+rsp] + rol r13d,30 + add r11d,eax + rol edx,1 + mov DWORD PTR[48+rsp],edx + mov ebp,DWORD PTR[52+rsp] + mov eax,r13d + mov ecx,r11d + xor ebp,DWORD PTR[60+rsp] + xor eax,r12d + rol ecx,5 + lea edi,DWORD PTR[1859775393+rdi*1+rdx] + xor ebp,DWORD PTR[20+rsp] + xor eax,esi + add edi,ecx + xor ebp,DWORD PTR[40+rsp] + rol r12d,30 + add edi,eax + rol ebp,1 + mov DWORD PTR[52+rsp],ebp + mov edx,DWORD PTR[56+rsp] + mov eax,r12d + mov ecx,edi + xor edx,DWORD PTR[rsp] + xor eax,r11d + rol ecx,5 + lea esi,DWORD PTR[1859775393+rsi*1+rbp] + xor edx,DWORD PTR[24+rsp] + xor eax,r13d + add esi,ecx + xor edx,DWORD PTR[44+rsp] + rol r11d,30 + add esi,eax + rol edx,1 + mov DWORD PTR[56+rsp],edx + mov ebp,DWORD PTR[60+rsp] + mov eax,r11d + mov ecx,esi + xor ebp,DWORD PTR[4+rsp] + xor eax,edi + rol ecx,5 + lea r13d,DWORD PTR[1859775393+r13*1+rdx] + xor ebp,DWORD PTR[28+rsp] + xor eax,r12d + add r13d,ecx + xor ebp,DWORD PTR[48+rsp] + rol edi,30 + add r13d,eax + rol ebp,1 + mov DWORD PTR[60+rsp],ebp + mov edx,DWORD PTR[rsp] + mov eax,edi + mov ecx,r13d + xor edx,DWORD PTR[8+rsp] + xor eax,esi + rol ecx,5 + lea r12d,DWORD PTR[1859775393+r12*1+rbp] + xor edx,DWORD PTR[32+rsp] + xor eax,r11d + add r12d,ecx + xor edx,DWORD PTR[52+rsp] + rol esi,30 + add r12d,eax + rol edx,1 + mov DWORD PTR[rsp],edx + mov ebp,DWORD PTR[4+rsp] + mov eax,esi + mov ecx,r12d + xor ebp,DWORD PTR[12+rsp] + xor eax,r13d + rol ecx,5 + lea r11d,DWORD PTR[1859775393+r11*1+rdx] + xor ebp,DWORD PTR[36+rsp] + xor eax,edi + add r11d,ecx + xor ebp,DWORD PTR[56+rsp] + rol r13d,30 + add r11d,eax + rol ebp,1 + mov DWORD PTR[4+rsp],ebp + mov edx,DWORD PTR[8+rsp] + mov eax,r13d + mov ecx,r11d + xor edx,DWORD PTR[16+rsp] + xor eax,r12d + rol ecx,5 + lea edi,DWORD PTR[1859775393+rdi*1+rbp] + xor edx,DWORD PTR[40+rsp] + xor eax,esi + add edi,ecx + xor edx,DWORD PTR[60+rsp] + rol r12d,30 + add edi,eax + rol edx,1 + mov DWORD PTR[8+rsp],edx + mov ebp,DWORD PTR[12+rsp] + mov eax,r12d + mov ecx,edi + xor ebp,DWORD PTR[20+rsp] + xor eax,r11d + rol ecx,5 + lea esi,DWORD PTR[1859775393+rsi*1+rdx] + xor ebp,DWORD PTR[44+rsp] + xor eax,r13d + add esi,ecx + xor ebp,DWORD PTR[rsp] + rol r11d,30 + add esi,eax + rol ebp,1 + mov DWORD PTR[12+rsp],ebp + mov edx,DWORD PTR[16+rsp] + mov eax,r11d + mov ecx,esi + xor edx,DWORD PTR[24+rsp] + xor eax,edi + rol ecx,5 + lea r13d,DWORD PTR[1859775393+r13*1+rbp] + xor edx,DWORD PTR[48+rsp] + xor eax,r12d + add r13d,ecx + xor edx,DWORD PTR[4+rsp] + rol edi,30 + add r13d,eax + rol edx,1 + mov DWORD PTR[16+rsp],edx + mov ebp,DWORD PTR[20+rsp] + mov eax,edi + mov ecx,r13d + xor ebp,DWORD PTR[28+rsp] + xor eax,esi + rol ecx,5 + lea r12d,DWORD PTR[1859775393+r12*1+rdx] + xor ebp,DWORD PTR[52+rsp] + xor eax,r11d + add r12d,ecx + xor ebp,DWORD PTR[8+rsp] + rol esi,30 + add r12d,eax + rol ebp,1 + mov DWORD PTR[20+rsp],ebp + mov edx,DWORD PTR[24+rsp] + mov eax,esi + mov ecx,r12d + xor edx,DWORD PTR[32+rsp] + xor eax,r13d + rol ecx,5 + lea r11d,DWORD PTR[1859775393+r11*1+rbp] + xor edx,DWORD PTR[56+rsp] + xor eax,edi + add r11d,ecx + xor edx,DWORD PTR[12+rsp] + rol r13d,30 + add r11d,eax + rol edx,1 + mov DWORD PTR[24+rsp],edx + mov ebp,DWORD PTR[28+rsp] + mov eax,r13d + mov ecx,r11d + xor ebp,DWORD PTR[36+rsp] + xor eax,r12d + rol ecx,5 + lea edi,DWORD PTR[1859775393+rdi*1+rdx] + xor ebp,DWORD PTR[60+rsp] + xor eax,esi + add edi,ecx + xor ebp,DWORD PTR[16+rsp] + rol r12d,30 + add edi,eax + rol ebp,1 + mov DWORD PTR[28+rsp],ebp + mov edx,DWORD PTR[32+rsp] + mov eax,r12d + mov ecx,edi + xor edx,DWORD PTR[40+rsp] + xor eax,r11d + rol ecx,5 + lea esi,DWORD PTR[1859775393+rsi*1+rbp] + xor edx,DWORD PTR[rsp] + xor eax,r13d + add esi,ecx + xor edx,DWORD PTR[20+rsp] + rol r11d,30 + add esi,eax + rol edx,1 + mov DWORD PTR[32+rsp],edx + mov ebp,DWORD PTR[36+rsp] + mov eax,r11d + mov ebx,r11d + xor ebp,DWORD PTR[44+rsp] + and eax,r12d + mov ecx,esi + xor ebp,DWORD PTR[4+rsp] + xor ebx,r12d + lea r13d,DWORD PTR[((-1894007588))+r13*1+rdx] + rol ecx,5 + xor ebp,DWORD PTR[24+rsp] + add r13d,eax + and ebx,edi + rol ebp,1 + add r13d,ebx + rol edi,30 + mov DWORD PTR[36+rsp],ebp + add r13d,ecx + mov edx,DWORD PTR[40+rsp] + mov eax,edi + mov ebx,edi + xor edx,DWORD PTR[48+rsp] + and eax,r11d + mov ecx,r13d + xor edx,DWORD PTR[8+rsp] + xor ebx,r11d + lea r12d,DWORD PTR[((-1894007588))+r12*1+rbp] + rol ecx,5 + xor edx,DWORD PTR[28+rsp] + add r12d,eax + and ebx,esi + rol edx,1 + add r12d,ebx + rol esi,30 + mov DWORD PTR[40+rsp],edx + add r12d,ecx + mov ebp,DWORD PTR[44+rsp] + mov eax,esi + mov ebx,esi + xor ebp,DWORD PTR[52+rsp] + and eax,edi + mov ecx,r12d + xor ebp,DWORD PTR[12+rsp] + xor ebx,edi + lea r11d,DWORD PTR[((-1894007588))+r11*1+rdx] + rol ecx,5 + xor ebp,DWORD PTR[32+rsp] + add r11d,eax + and ebx,r13d + rol ebp,1 + add r11d,ebx + rol r13d,30 + mov DWORD PTR[44+rsp],ebp + add r11d,ecx + mov edx,DWORD PTR[48+rsp] + mov eax,r13d + mov ebx,r13d + xor edx,DWORD PTR[56+rsp] + and eax,esi + mov ecx,r11d + xor edx,DWORD PTR[16+rsp] + xor ebx,esi + lea edi,DWORD PTR[((-1894007588))+rdi*1+rbp] + rol ecx,5 + xor edx,DWORD PTR[36+rsp] + add edi,eax + and ebx,r12d + rol edx,1 + add edi,ebx + rol r12d,30 + mov DWORD PTR[48+rsp],edx + add edi,ecx + mov ebp,DWORD PTR[52+rsp] + mov eax,r12d + mov ebx,r12d + xor ebp,DWORD PTR[60+rsp] + and eax,r13d + mov ecx,edi + xor ebp,DWORD PTR[20+rsp] + xor ebx,r13d + lea esi,DWORD PTR[((-1894007588))+rsi*1+rdx] + rol ecx,5 + xor ebp,DWORD PTR[40+rsp] + add esi,eax + and ebx,r11d + rol ebp,1 + add esi,ebx + rol r11d,30 + mov DWORD PTR[52+rsp],ebp + add esi,ecx + mov edx,DWORD PTR[56+rsp] + mov eax,r11d + mov ebx,r11d + xor edx,DWORD PTR[rsp] + and eax,r12d + mov ecx,esi + xor edx,DWORD PTR[24+rsp] + xor ebx,r12d + lea r13d,DWORD PTR[((-1894007588))+r13*1+rbp] + rol ecx,5 + xor edx,DWORD PTR[44+rsp] + add r13d,eax + and ebx,edi + rol edx,1 + add r13d,ebx + rol edi,30 + mov DWORD PTR[56+rsp],edx + add r13d,ecx + mov ebp,DWORD PTR[60+rsp] + mov eax,edi + mov ebx,edi + xor ebp,DWORD PTR[4+rsp] + and eax,r11d + mov ecx,r13d + xor ebp,DWORD PTR[28+rsp] + xor ebx,r11d + lea r12d,DWORD PTR[((-1894007588))+r12*1+rdx] + rol ecx,5 + xor ebp,DWORD PTR[48+rsp] + add r12d,eax + and ebx,esi + rol ebp,1 + add r12d,ebx + rol esi,30 + mov DWORD PTR[60+rsp],ebp + add r12d,ecx + mov edx,DWORD PTR[rsp] + mov eax,esi + mov ebx,esi + xor edx,DWORD PTR[8+rsp] + and eax,edi + mov ecx,r12d + xor edx,DWORD PTR[32+rsp] + xor ebx,edi + lea r11d,DWORD PTR[((-1894007588))+r11*1+rbp] + rol ecx,5 + xor edx,DWORD PTR[52+rsp] + add r11d,eax + and ebx,r13d + rol edx,1 + add r11d,ebx + rol r13d,30 + mov DWORD PTR[rsp],edx + add r11d,ecx + mov ebp,DWORD PTR[4+rsp] + mov eax,r13d + mov ebx,r13d + xor ebp,DWORD PTR[12+rsp] + and eax,esi + mov ecx,r11d + xor ebp,DWORD PTR[36+rsp] + xor ebx,esi + lea edi,DWORD PTR[((-1894007588))+rdi*1+rdx] + rol ecx,5 + xor ebp,DWORD PTR[56+rsp] + add edi,eax + and ebx,r12d + rol ebp,1 + add edi,ebx + rol r12d,30 + mov DWORD PTR[4+rsp],ebp + add edi,ecx + mov edx,DWORD PTR[8+rsp] + mov eax,r12d + mov ebx,r12d + xor edx,DWORD PTR[16+rsp] + and eax,r13d + mov ecx,edi + xor edx,DWORD PTR[40+rsp] + xor ebx,r13d + lea esi,DWORD PTR[((-1894007588))+rsi*1+rbp] + rol ecx,5 + xor edx,DWORD PTR[60+rsp] + add esi,eax + and ebx,r11d + rol edx,1 + add esi,ebx + rol r11d,30 + mov DWORD PTR[8+rsp],edx + add esi,ecx + mov ebp,DWORD PTR[12+rsp] + mov eax,r11d + mov ebx,r11d + xor ebp,DWORD PTR[20+rsp] + and eax,r12d + mov ecx,esi + xor ebp,DWORD PTR[44+rsp] + xor ebx,r12d + lea r13d,DWORD PTR[((-1894007588))+r13*1+rdx] + rol ecx,5 + xor ebp,DWORD PTR[rsp] + add r13d,eax + and ebx,edi + rol ebp,1 + add r13d,ebx + rol edi,30 + mov DWORD PTR[12+rsp],ebp + add r13d,ecx + mov edx,DWORD PTR[16+rsp] + mov eax,edi + mov ebx,edi + xor edx,DWORD PTR[24+rsp] + and eax,r11d + mov ecx,r13d + xor edx,DWORD PTR[48+rsp] + xor ebx,r11d + lea r12d,DWORD PTR[((-1894007588))+r12*1+rbp] + rol ecx,5 + xor edx,DWORD PTR[4+rsp] + add r12d,eax + and ebx,esi + rol edx,1 + add r12d,ebx + rol esi,30 + mov DWORD PTR[16+rsp],edx + add r12d,ecx + mov ebp,DWORD PTR[20+rsp] + mov eax,esi + mov ebx,esi + xor ebp,DWORD PTR[28+rsp] + and eax,edi + mov ecx,r12d + xor ebp,DWORD PTR[52+rsp] + xor ebx,edi + lea r11d,DWORD PTR[((-1894007588))+r11*1+rdx] + rol ecx,5 + xor ebp,DWORD PTR[8+rsp] + add r11d,eax + and ebx,r13d + rol ebp,1 + add r11d,ebx + rol r13d,30 + mov DWORD PTR[20+rsp],ebp + add r11d,ecx + mov edx,DWORD PTR[24+rsp] + mov eax,r13d + mov ebx,r13d + xor edx,DWORD PTR[32+rsp] + and eax,esi + mov ecx,r11d + xor edx,DWORD PTR[56+rsp] + xor ebx,esi + lea edi,DWORD PTR[((-1894007588))+rdi*1+rbp] + rol ecx,5 + xor edx,DWORD PTR[12+rsp] + add edi,eax + and ebx,r12d + rol edx,1 + add edi,ebx + rol r12d,30 + mov DWORD PTR[24+rsp],edx + add edi,ecx + mov ebp,DWORD PTR[28+rsp] + mov eax,r12d + mov ebx,r12d + xor ebp,DWORD PTR[36+rsp] + and eax,r13d + mov ecx,edi + xor ebp,DWORD PTR[60+rsp] + xor ebx,r13d + lea esi,DWORD PTR[((-1894007588))+rsi*1+rdx] + rol ecx,5 + xor ebp,DWORD PTR[16+rsp] + add esi,eax + and ebx,r11d + rol ebp,1 + add esi,ebx + rol r11d,30 + mov DWORD PTR[28+rsp],ebp + add esi,ecx + mov edx,DWORD PTR[32+rsp] + mov eax,r11d + mov ebx,r11d + xor edx,DWORD PTR[40+rsp] + and eax,r12d + mov ecx,esi + xor edx,DWORD PTR[rsp] + xor ebx,r12d + lea r13d,DWORD PTR[((-1894007588))+r13*1+rbp] + rol ecx,5 + xor edx,DWORD PTR[20+rsp] + add r13d,eax + and ebx,edi + rol edx,1 + add r13d,ebx + rol edi,30 + mov DWORD PTR[32+rsp],edx + add r13d,ecx + mov ebp,DWORD PTR[36+rsp] + mov eax,edi + mov ebx,edi + xor ebp,DWORD PTR[44+rsp] + and eax,r11d + mov ecx,r13d + xor ebp,DWORD PTR[4+rsp] + xor ebx,r11d + lea r12d,DWORD PTR[((-1894007588))+r12*1+rdx] + rol ecx,5 + xor ebp,DWORD PTR[24+rsp] + add r12d,eax + and ebx,esi + rol ebp,1 + add r12d,ebx + rol esi,30 + mov DWORD PTR[36+rsp],ebp + add r12d,ecx + mov edx,DWORD PTR[40+rsp] + mov eax,esi + mov ebx,esi + xor edx,DWORD PTR[48+rsp] + and eax,edi + mov ecx,r12d + xor edx,DWORD PTR[8+rsp] + xor ebx,edi + lea r11d,DWORD PTR[((-1894007588))+r11*1+rbp] + rol ecx,5 + xor edx,DWORD PTR[28+rsp] + add r11d,eax + and ebx,r13d + rol edx,1 + add r11d,ebx + rol r13d,30 + mov DWORD PTR[40+rsp],edx + add r11d,ecx + mov ebp,DWORD PTR[44+rsp] + mov eax,r13d + mov ebx,r13d + xor ebp,DWORD PTR[52+rsp] + and eax,esi + mov ecx,r11d + xor ebp,DWORD PTR[12+rsp] + xor ebx,esi + lea edi,DWORD PTR[((-1894007588))+rdi*1+rdx] + rol ecx,5 + xor ebp,DWORD PTR[32+rsp] + add edi,eax + and ebx,r12d + rol ebp,1 + add edi,ebx + rol r12d,30 + mov DWORD PTR[44+rsp],ebp + add edi,ecx + mov edx,DWORD PTR[48+rsp] + mov eax,r12d + mov ebx,r12d + xor edx,DWORD PTR[56+rsp] + and eax,r13d + mov ecx,edi + xor edx,DWORD PTR[16+rsp] + xor ebx,r13d + lea esi,DWORD PTR[((-1894007588))+rsi*1+rbp] + rol ecx,5 + xor edx,DWORD PTR[36+rsp] + add esi,eax + and ebx,r11d + rol edx,1 + add esi,ebx + rol r11d,30 + mov DWORD PTR[48+rsp],edx + add esi,ecx + mov ebp,DWORD PTR[52+rsp] + mov eax,r11d + mov ecx,esi + xor ebp,DWORD PTR[60+rsp] + xor eax,edi + rol ecx,5 + lea r13d,DWORD PTR[((-899497514))+r13*1+rdx] + xor ebp,DWORD PTR[20+rsp] + xor eax,r12d + add r13d,ecx + xor ebp,DWORD PTR[40+rsp] + rol edi,30 + add r13d,eax + rol ebp,1 + mov DWORD PTR[52+rsp],ebp + mov edx,DWORD PTR[56+rsp] + mov eax,edi + mov ecx,r13d + xor edx,DWORD PTR[rsp] + xor eax,esi + rol ecx,5 + lea r12d,DWORD PTR[((-899497514))+r12*1+rbp] + xor edx,DWORD PTR[24+rsp] + xor eax,r11d + add r12d,ecx + xor edx,DWORD PTR[44+rsp] + rol esi,30 + add r12d,eax + rol edx,1 + mov DWORD PTR[56+rsp],edx + mov ebp,DWORD PTR[60+rsp] + mov eax,esi + mov ecx,r12d + xor ebp,DWORD PTR[4+rsp] + xor eax,r13d + rol ecx,5 + lea r11d,DWORD PTR[((-899497514))+r11*1+rdx] + xor ebp,DWORD PTR[28+rsp] + xor eax,edi + add r11d,ecx + xor ebp,DWORD PTR[48+rsp] + rol r13d,30 + add r11d,eax + rol ebp,1 + mov DWORD PTR[60+rsp],ebp + mov edx,DWORD PTR[rsp] + mov eax,r13d + mov ecx,r11d + xor edx,DWORD PTR[8+rsp] + xor eax,r12d + rol ecx,5 + lea edi,DWORD PTR[((-899497514))+rdi*1+rbp] + xor edx,DWORD PTR[32+rsp] + xor eax,esi + add edi,ecx + xor edx,DWORD PTR[52+rsp] + rol r12d,30 + add edi,eax + rol edx,1 + mov DWORD PTR[rsp],edx + mov ebp,DWORD PTR[4+rsp] + mov eax,r12d + mov ecx,edi + xor ebp,DWORD PTR[12+rsp] + xor eax,r11d + rol ecx,5 + lea esi,DWORD PTR[((-899497514))+rsi*1+rdx] + xor ebp,DWORD PTR[36+rsp] + xor eax,r13d + add esi,ecx + xor ebp,DWORD PTR[56+rsp] + rol r11d,30 + add esi,eax + rol ebp,1 + mov DWORD PTR[4+rsp],ebp + mov edx,DWORD PTR[8+rsp] + mov eax,r11d + mov ecx,esi + xor edx,DWORD PTR[16+rsp] + xor eax,edi + rol ecx,5 + lea r13d,DWORD PTR[((-899497514))+r13*1+rbp] + xor edx,DWORD PTR[40+rsp] + xor eax,r12d + add r13d,ecx + xor edx,DWORD PTR[60+rsp] + rol edi,30 + add r13d,eax + rol edx,1 + mov DWORD PTR[8+rsp],edx + mov ebp,DWORD PTR[12+rsp] + mov eax,edi + mov ecx,r13d + xor ebp,DWORD PTR[20+rsp] + xor eax,esi + rol ecx,5 + lea r12d,DWORD PTR[((-899497514))+r12*1+rdx] + xor ebp,DWORD PTR[44+rsp] + xor eax,r11d + add r12d,ecx + xor ebp,DWORD PTR[rsp] + rol esi,30 + add r12d,eax + rol ebp,1 + mov DWORD PTR[12+rsp],ebp + mov edx,DWORD PTR[16+rsp] + mov eax,esi + mov ecx,r12d + xor edx,DWORD PTR[24+rsp] + xor eax,r13d + rol ecx,5 + lea r11d,DWORD PTR[((-899497514))+r11*1+rbp] + xor edx,DWORD PTR[48+rsp] + xor eax,edi + add r11d,ecx + xor edx,DWORD PTR[4+rsp] + rol r13d,30 + add r11d,eax + rol edx,1 + mov DWORD PTR[16+rsp],edx + mov ebp,DWORD PTR[20+rsp] + mov eax,r13d + mov ecx,r11d + xor ebp,DWORD PTR[28+rsp] + xor eax,r12d + rol ecx,5 + lea edi,DWORD PTR[((-899497514))+rdi*1+rdx] + xor ebp,DWORD PTR[52+rsp] + xor eax,esi + add edi,ecx + xor ebp,DWORD PTR[8+rsp] + rol r12d,30 + add edi,eax + rol ebp,1 + mov DWORD PTR[20+rsp],ebp + mov edx,DWORD PTR[24+rsp] + mov eax,r12d + mov ecx,edi + xor edx,DWORD PTR[32+rsp] + xor eax,r11d + rol ecx,5 + lea esi,DWORD PTR[((-899497514))+rsi*1+rbp] + xor edx,DWORD PTR[56+rsp] + xor eax,r13d + add esi,ecx + xor edx,DWORD PTR[12+rsp] + rol r11d,30 + add esi,eax + rol edx,1 + mov DWORD PTR[24+rsp],edx + mov ebp,DWORD PTR[28+rsp] + mov eax,r11d + mov ecx,esi + xor ebp,DWORD PTR[36+rsp] + xor eax,edi + rol ecx,5 + lea r13d,DWORD PTR[((-899497514))+r13*1+rdx] + xor ebp,DWORD PTR[60+rsp] + xor eax,r12d + add r13d,ecx + xor ebp,DWORD PTR[16+rsp] + rol edi,30 + add r13d,eax + rol ebp,1 + mov DWORD PTR[28+rsp],ebp + mov edx,DWORD PTR[32+rsp] + mov eax,edi + mov ecx,r13d + xor edx,DWORD PTR[40+rsp] + xor eax,esi + rol ecx,5 + lea r12d,DWORD PTR[((-899497514))+r12*1+rbp] + xor edx,DWORD PTR[rsp] + xor eax,r11d + add r12d,ecx + xor edx,DWORD PTR[20+rsp] + rol esi,30 + add r12d,eax + rol edx,1 + mov DWORD PTR[32+rsp],edx + mov ebp,DWORD PTR[36+rsp] + mov eax,esi + mov ecx,r12d + xor ebp,DWORD PTR[44+rsp] + xor eax,r13d + rol ecx,5 + lea r11d,DWORD PTR[((-899497514))+r11*1+rdx] + xor ebp,DWORD PTR[4+rsp] + xor eax,edi + add r11d,ecx + xor ebp,DWORD PTR[24+rsp] + rol r13d,30 + add r11d,eax + rol ebp,1 + mov DWORD PTR[36+rsp],ebp + mov edx,DWORD PTR[40+rsp] + mov eax,r13d + mov ecx,r11d + xor edx,DWORD PTR[48+rsp] + xor eax,r12d + rol ecx,5 + lea edi,DWORD PTR[((-899497514))+rdi*1+rbp] + xor edx,DWORD PTR[8+rsp] + xor eax,esi + add edi,ecx + xor edx,DWORD PTR[28+rsp] + rol r12d,30 + add edi,eax + rol edx,1 + mov DWORD PTR[40+rsp],edx + mov ebp,DWORD PTR[44+rsp] + mov eax,r12d + mov ecx,edi + xor ebp,DWORD PTR[52+rsp] + xor eax,r11d + rol ecx,5 + lea esi,DWORD PTR[((-899497514))+rsi*1+rdx] + xor ebp,DWORD PTR[12+rsp] + xor eax,r13d + add esi,ecx + xor ebp,DWORD PTR[32+rsp] + rol r11d,30 + add esi,eax + rol ebp,1 + mov DWORD PTR[44+rsp],ebp + mov edx,DWORD PTR[48+rsp] + mov eax,r11d + mov ecx,esi + xor edx,DWORD PTR[56+rsp] + xor eax,edi + rol ecx,5 + lea r13d,DWORD PTR[((-899497514))+r13*1+rbp] + xor edx,DWORD PTR[16+rsp] + xor eax,r12d + add r13d,ecx + xor edx,DWORD PTR[36+rsp] + rol edi,30 + add r13d,eax + rol edx,1 + mov DWORD PTR[48+rsp],edx + mov ebp,DWORD PTR[52+rsp] + mov eax,edi + mov ecx,r13d + xor ebp,DWORD PTR[60+rsp] + xor eax,esi + rol ecx,5 + lea r12d,DWORD PTR[((-899497514))+r12*1+rdx] + xor ebp,DWORD PTR[20+rsp] + xor eax,r11d + add r12d,ecx + xor ebp,DWORD PTR[40+rsp] + rol esi,30 + add r12d,eax + rol ebp,1 + mov edx,DWORD PTR[56+rsp] + mov eax,esi + mov ecx,r12d + xor edx,DWORD PTR[rsp] + xor eax,r13d + rol ecx,5 + lea r11d,DWORD PTR[((-899497514))+r11*1+rbp] + xor edx,DWORD PTR[24+rsp] + xor eax,edi + add r11d,ecx + xor edx,DWORD PTR[44+rsp] + rol r13d,30 + add r11d,eax + rol edx,1 + mov ebp,DWORD PTR[60+rsp] + mov eax,r13d + mov ecx,r11d + xor ebp,DWORD PTR[4+rsp] + xor eax,r12d + rol ecx,5 + lea edi,DWORD PTR[((-899497514))+rdi*1+rdx] + xor ebp,DWORD PTR[28+rsp] + xor eax,esi + add edi,ecx + xor ebp,DWORD PTR[48+rsp] + rol r12d,30 + add edi,eax + rol ebp,1 + mov eax,r12d + mov ecx,edi + xor eax,r11d + lea esi,DWORD PTR[((-899497514))+rsi*1+rbp] + rol ecx,5 + xor eax,r13d + add esi,ecx + rol r11d,30 + add esi,eax + add esi,DWORD PTR[r8] + add edi,DWORD PTR[4+r8] + add r11d,DWORD PTR[8+r8] + add r12d,DWORD PTR[12+r8] + add r13d,DWORD PTR[16+r8] + mov DWORD PTR[r8],esi + mov DWORD PTR[4+r8],edi + mov DWORD PTR[8+r8],r11d + mov DWORD PTR[12+r8],r12d + mov DWORD PTR[16+r8],r13d + + sub r10,1 + lea r9,QWORD PTR[64+r9] + jnz $L$loop + + mov rsi,QWORD PTR[64+rsp] + mov r13,QWORD PTR[rsi] + mov r12,QWORD PTR[8+rsi] + mov rbp,QWORD PTR[16+rsi] + mov rbx,QWORD PTR[24+rsi] + lea rsp,QWORD PTR[32+rsi] +$L$epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_sha1_block_data_order:: +sha1_block_data_order ENDP + +ALIGN 16 +sha1_block_data_order_ssse3 PROC PRIVATE + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_sha1_block_data_order_ssse3:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + +_ssse3_shortcut:: + push rbx + push rbp + push r12 + lea rsp,QWORD PTR[((-144))+rsp] + movaps XMMWORD PTR[(64+0)+rsp],xmm6 + movaps XMMWORD PTR[(64+16)+rsp],xmm7 + movaps XMMWORD PTR[(64+32)+rsp],xmm8 + movaps XMMWORD PTR[(64+48)+rsp],xmm9 + movaps XMMWORD PTR[(64+64)+rsp],xmm10 +$L$prologue_ssse3:: + mov r8,rdi + mov r9,rsi + mov r10,rdx + + shl r10,6 + add r10,r9 + lea r11,QWORD PTR[K_XX_XX] + + mov eax,DWORD PTR[r8] + mov ebx,DWORD PTR[4+r8] + mov ecx,DWORD PTR[8+r8] + mov edx,DWORD PTR[12+r8] + mov esi,ebx + mov ebp,DWORD PTR[16+r8] + + movdqa xmm6,XMMWORD PTR[64+r11] + movdqa xmm9,XMMWORD PTR[r11] + movdqu xmm0,XMMWORD PTR[r9] + movdqu xmm1,XMMWORD PTR[16+r9] + movdqu xmm2,XMMWORD PTR[32+r9] + movdqu xmm3,XMMWORD PTR[48+r9] +DB 102,15,56,0,198 + add r9,64 +DB 102,15,56,0,206 +DB 102,15,56,0,214 +DB 102,15,56,0,222 + paddd xmm0,xmm9 + paddd xmm1,xmm9 + paddd xmm2,xmm9 + movdqa XMMWORD PTR[rsp],xmm0 + psubd xmm0,xmm9 + movdqa XMMWORD PTR[16+rsp],xmm1 + psubd xmm1,xmm9 + movdqa XMMWORD PTR[32+rsp],xmm2 + psubd xmm2,xmm9 + jmp $L$oop_ssse3 +ALIGN 16 +$L$oop_ssse3:: + movdqa xmm4,xmm1 + add ebp,DWORD PTR[rsp] + xor ecx,edx + movdqa xmm8,xmm3 +DB 102,15,58,15,224,8 + mov edi,eax + rol eax,5 + paddd xmm9,xmm3 + and esi,ecx + xor ecx,edx + psrldq xmm8,4 + xor esi,edx + add ebp,eax + pxor xmm4,xmm0 + ror ebx,2 + add ebp,esi + pxor xmm8,xmm2 + add edx,DWORD PTR[4+rsp] + xor ebx,ecx + mov esi,ebp + rol ebp,5 + pxor xmm4,xmm8 + and edi,ebx + xor ebx,ecx + movdqa XMMWORD PTR[48+rsp],xmm9 + xor edi,ecx + add edx,ebp + movdqa xmm10,xmm4 + movdqa xmm8,xmm4 + ror eax,7 + add edx,edi + add ecx,DWORD PTR[8+rsp] + xor eax,ebx + pslldq xmm10,12 + paddd xmm4,xmm4 + mov edi,edx + rol edx,5 + and esi,eax + xor eax,ebx + psrld xmm8,31 + xor esi,ebx + add ecx,edx + movdqa xmm9,xmm10 + ror ebp,7 + add ecx,esi + psrld xmm10,30 + por xmm4,xmm8 + add ebx,DWORD PTR[12+rsp] + xor ebp,eax + mov esi,ecx + rol ecx,5 + pslld xmm9,2 + pxor xmm4,xmm10 + and edi,ebp + xor ebp,eax + movdqa xmm10,XMMWORD PTR[r11] + xor edi,eax + add ebx,ecx + pxor xmm4,xmm9 + ror edx,7 + add ebx,edi + movdqa xmm5,xmm2 + add eax,DWORD PTR[16+rsp] + xor edx,ebp + movdqa xmm9,xmm4 +DB 102,15,58,15,233,8 + mov edi,ebx + rol ebx,5 + paddd xmm10,xmm4 + and esi,edx + xor edx,ebp + psrldq xmm9,4 + xor esi,ebp + add eax,ebx + pxor xmm5,xmm1 + ror ecx,7 + add eax,esi + pxor xmm9,xmm3 + add ebp,DWORD PTR[20+rsp] + xor ecx,edx + mov esi,eax + rol eax,5 + pxor xmm5,xmm9 + and edi,ecx + xor ecx,edx + movdqa XMMWORD PTR[rsp],xmm10 + xor edi,edx + add ebp,eax + movdqa xmm8,xmm5 + movdqa xmm9,xmm5 + ror ebx,7 + add ebp,edi + add edx,DWORD PTR[24+rsp] + xor ebx,ecx + pslldq xmm8,12 + paddd xmm5,xmm5 + mov edi,ebp + rol ebp,5 + and esi,ebx + xor ebx,ecx + psrld xmm9,31 + xor esi,ecx + add edx,ebp + movdqa xmm10,xmm8 + ror eax,7 + add edx,esi + psrld xmm8,30 + por xmm5,xmm9 + add ecx,DWORD PTR[28+rsp] + xor eax,ebx + mov esi,edx + rol edx,5 + pslld xmm10,2 + pxor xmm5,xmm8 + and edi,eax + xor eax,ebx + movdqa xmm8,XMMWORD PTR[16+r11] + xor edi,ebx + add ecx,edx + pxor xmm5,xmm10 + ror ebp,7 + add ecx,edi + movdqa xmm6,xmm3 + add ebx,DWORD PTR[32+rsp] + xor ebp,eax + movdqa xmm10,xmm5 +DB 102,15,58,15,242,8 + mov edi,ecx + rol ecx,5 + paddd xmm8,xmm5 + and esi,ebp + xor ebp,eax + psrldq xmm10,4 + xor esi,eax + add ebx,ecx + pxor xmm6,xmm2 + ror edx,7 + add ebx,esi + pxor xmm10,xmm4 + add eax,DWORD PTR[36+rsp] + xor edx,ebp + mov esi,ebx + rol ebx,5 + pxor xmm6,xmm10 + and edi,edx + xor edx,ebp + movdqa XMMWORD PTR[16+rsp],xmm8 + xor edi,ebp + add eax,ebx + movdqa xmm9,xmm6 + movdqa xmm10,xmm6 + ror ecx,7 + add eax,edi + add ebp,DWORD PTR[40+rsp] + xor ecx,edx + pslldq xmm9,12 + paddd xmm6,xmm6 + mov edi,eax + rol eax,5 + and esi,ecx + xor ecx,edx + psrld xmm10,31 + xor esi,edx + add ebp,eax + movdqa xmm8,xmm9 + ror ebx,7 + add ebp,esi + psrld xmm9,30 + por xmm6,xmm10 + add edx,DWORD PTR[44+rsp] + xor ebx,ecx + mov esi,ebp + rol ebp,5 + pslld xmm8,2 + pxor xmm6,xmm9 + and edi,ebx + xor ebx,ecx + movdqa xmm9,XMMWORD PTR[16+r11] + xor edi,ecx + add edx,ebp + pxor xmm6,xmm8 + ror eax,7 + add edx,edi + movdqa xmm7,xmm4 + add ecx,DWORD PTR[48+rsp] + xor eax,ebx + movdqa xmm8,xmm6 +DB 102,15,58,15,251,8 + mov edi,edx + rol edx,5 + paddd xmm9,xmm6 + and esi,eax + xor eax,ebx + psrldq xmm8,4 + xor esi,ebx + add ecx,edx + pxor xmm7,xmm3 + ror ebp,7 + add ecx,esi + pxor xmm8,xmm5 + add ebx,DWORD PTR[52+rsp] + xor ebp,eax + mov esi,ecx + rol ecx,5 + pxor xmm7,xmm8 + and edi,ebp + xor ebp,eax + movdqa XMMWORD PTR[32+rsp],xmm9 + xor edi,eax + add ebx,ecx + movdqa xmm10,xmm7 + movdqa xmm8,xmm7 + ror edx,7 + add ebx,edi + add eax,DWORD PTR[56+rsp] + xor edx,ebp + pslldq xmm10,12 + paddd xmm7,xmm7 + mov edi,ebx + rol ebx,5 + and esi,edx + xor edx,ebp + psrld xmm8,31 + xor esi,ebp + add eax,ebx + movdqa xmm9,xmm10 + ror ecx,7 + add eax,esi + psrld xmm10,30 + por xmm7,xmm8 + add ebp,DWORD PTR[60+rsp] + xor ecx,edx + mov esi,eax + rol eax,5 + pslld xmm9,2 + pxor xmm7,xmm10 + and edi,ecx + xor ecx,edx + movdqa xmm10,XMMWORD PTR[16+r11] + xor edi,edx + add ebp,eax + pxor xmm7,xmm9 + ror ebx,7 + add ebp,edi + movdqa xmm9,xmm7 + add edx,DWORD PTR[rsp] + pxor xmm0,xmm4 +DB 102,68,15,58,15,206,8 + xor ebx,ecx + mov edi,ebp + rol ebp,5 + pxor xmm0,xmm1 + and esi,ebx + xor ebx,ecx + movdqa xmm8,xmm10 + paddd xmm10,xmm7 + xor esi,ecx + add edx,ebp + pxor xmm0,xmm9 + ror eax,7 + add edx,esi + add ecx,DWORD PTR[4+rsp] + xor eax,ebx + movdqa xmm9,xmm0 + movdqa XMMWORD PTR[48+rsp],xmm10 + mov esi,edx + rol edx,5 + and edi,eax + xor eax,ebx + pslld xmm0,2 + xor edi,ebx + add ecx,edx + psrld xmm9,30 + ror ebp,7 + add ecx,edi + add ebx,DWORD PTR[8+rsp] + xor ebp,eax + mov edi,ecx + rol ecx,5 + por xmm0,xmm9 + and esi,ebp + xor ebp,eax + movdqa xmm10,xmm0 + xor esi,eax + add ebx,ecx + ror edx,7 + add ebx,esi + add eax,DWORD PTR[12+rsp] + xor edx,ebp + mov esi,ebx + rol ebx,5 + and edi,edx + xor edx,ebp + xor edi,ebp + add eax,ebx + ror ecx,7 + add eax,edi + add ebp,DWORD PTR[16+rsp] + pxor xmm1,xmm5 +DB 102,68,15,58,15,215,8 + xor esi,edx + mov edi,eax + rol eax,5 + pxor xmm1,xmm2 + xor esi,ecx + add ebp,eax + movdqa xmm9,xmm8 + paddd xmm8,xmm0 + ror ebx,7 + add ebp,esi + pxor xmm1,xmm10 + add edx,DWORD PTR[20+rsp] + xor edi,ecx + mov esi,ebp + rol ebp,5 + movdqa xmm10,xmm1 + movdqa XMMWORD PTR[rsp],xmm8 + xor edi,ebx + add edx,ebp + ror eax,7 + add edx,edi + pslld xmm1,2 + add ecx,DWORD PTR[24+rsp] + xor esi,ebx + psrld xmm10,30 + mov edi,edx + rol edx,5 + xor esi,eax + add ecx,edx + ror ebp,7 + add ecx,esi + por xmm1,xmm10 + add ebx,DWORD PTR[28+rsp] + xor edi,eax + movdqa xmm8,xmm1 + mov esi,ecx + rol ecx,5 + xor edi,ebp + add ebx,ecx + ror edx,7 + add ebx,edi + add eax,DWORD PTR[32+rsp] + pxor xmm2,xmm6 +DB 102,68,15,58,15,192,8 + xor esi,ebp + mov edi,ebx + rol ebx,5 + pxor xmm2,xmm3 + xor esi,edx + add eax,ebx + movdqa xmm10,XMMWORD PTR[32+r11] + paddd xmm9,xmm1 + ror ecx,7 + add eax,esi + pxor xmm2,xmm8 + add ebp,DWORD PTR[36+rsp] + xor edi,edx + mov esi,eax + rol eax,5 + movdqa xmm8,xmm2 + movdqa XMMWORD PTR[16+rsp],xmm9 + xor edi,ecx + add ebp,eax + ror ebx,7 + add ebp,edi + pslld xmm2,2 + add edx,DWORD PTR[40+rsp] + xor esi,ecx + psrld xmm8,30 + mov edi,ebp + rol ebp,5 + xor esi,ebx + add edx,ebp + ror eax,7 + add edx,esi + por xmm2,xmm8 + add ecx,DWORD PTR[44+rsp] + xor edi,ebx + movdqa xmm9,xmm2 + mov esi,edx + rol edx,5 + xor edi,eax + add ecx,edx + ror ebp,7 + add ecx,edi + add ebx,DWORD PTR[48+rsp] + pxor xmm3,xmm7 +DB 102,68,15,58,15,201,8 + xor esi,eax + mov edi,ecx + rol ecx,5 + pxor xmm3,xmm4 + xor esi,ebp + add ebx,ecx + movdqa xmm8,xmm10 + paddd xmm10,xmm2 + ror edx,7 + add ebx,esi + pxor xmm3,xmm9 + add eax,DWORD PTR[52+rsp] + xor edi,ebp + mov esi,ebx + rol ebx,5 + movdqa xmm9,xmm3 + movdqa XMMWORD PTR[32+rsp],xmm10 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + pslld xmm3,2 + add ebp,DWORD PTR[56+rsp] + xor esi,edx + psrld xmm9,30 + mov edi,eax + rol eax,5 + xor esi,ecx + add ebp,eax + ror ebx,7 + add ebp,esi + por xmm3,xmm9 + add edx,DWORD PTR[60+rsp] + xor edi,ecx + movdqa xmm10,xmm3 + mov esi,ebp + rol ebp,5 + xor edi,ebx + add edx,ebp + ror eax,7 + add edx,edi + add ecx,DWORD PTR[rsp] + pxor xmm4,xmm0 +DB 102,68,15,58,15,210,8 + xor esi,ebx + mov edi,edx + rol edx,5 + pxor xmm4,xmm5 + xor esi,eax + add ecx,edx + movdqa xmm9,xmm8 + paddd xmm8,xmm3 + ror ebp,7 + add ecx,esi + pxor xmm4,xmm10 + add ebx,DWORD PTR[4+rsp] + xor edi,eax + mov esi,ecx + rol ecx,5 + movdqa xmm10,xmm4 + movdqa XMMWORD PTR[48+rsp],xmm8 + xor edi,ebp + add ebx,ecx + ror edx,7 + add ebx,edi + pslld xmm4,2 + add eax,DWORD PTR[8+rsp] + xor esi,ebp + psrld xmm10,30 + mov edi,ebx + rol ebx,5 + xor esi,edx + add eax,ebx + ror ecx,7 + add eax,esi + por xmm4,xmm10 + add ebp,DWORD PTR[12+rsp] + xor edi,edx + movdqa xmm8,xmm4 + mov esi,eax + rol eax,5 + xor edi,ecx + add ebp,eax + ror ebx,7 + add ebp,edi + add edx,DWORD PTR[16+rsp] + pxor xmm5,xmm1 +DB 102,68,15,58,15,195,8 + xor esi,ecx + mov edi,ebp + rol ebp,5 + pxor xmm5,xmm6 + xor esi,ebx + add edx,ebp + movdqa xmm10,xmm9 + paddd xmm9,xmm4 + ror eax,7 + add edx,esi + pxor xmm5,xmm8 + add ecx,DWORD PTR[20+rsp] + xor edi,ebx + mov esi,edx + rol edx,5 + movdqa xmm8,xmm5 + movdqa XMMWORD PTR[rsp],xmm9 + xor edi,eax + add ecx,edx + ror ebp,7 + add ecx,edi + pslld xmm5,2 + add ebx,DWORD PTR[24+rsp] + xor esi,eax + psrld xmm8,30 + mov edi,ecx + rol ecx,5 + xor esi,ebp + add ebx,ecx + ror edx,7 + add ebx,esi + por xmm5,xmm8 + add eax,DWORD PTR[28+rsp] + xor edi,ebp + movdqa xmm9,xmm5 + mov esi,ebx + rol ebx,5 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + mov edi,ecx + pxor xmm6,xmm2 +DB 102,68,15,58,15,204,8 + xor ecx,edx + add ebp,DWORD PTR[32+rsp] + and edi,edx + pxor xmm6,xmm7 + and esi,ecx + ror ebx,7 + movdqa xmm8,xmm10 + paddd xmm10,xmm5 + add ebp,edi + mov edi,eax + pxor xmm6,xmm9 + rol eax,5 + add ebp,esi + xor ecx,edx + add ebp,eax + movdqa xmm9,xmm6 + movdqa XMMWORD PTR[16+rsp],xmm10 + mov esi,ebx + xor ebx,ecx + add edx,DWORD PTR[36+rsp] + and esi,ecx + pslld xmm6,2 + and edi,ebx + ror eax,7 + psrld xmm9,30 + add edx,esi + mov esi,ebp + rol ebp,5 + add edx,edi + xor ebx,ecx + add edx,ebp + por xmm6,xmm9 + mov edi,eax + xor eax,ebx + movdqa xmm10,xmm6 + add ecx,DWORD PTR[40+rsp] + and edi,ebx + and esi,eax + ror ebp,7 + add ecx,edi + mov edi,edx + rol edx,5 + add ecx,esi + xor eax,ebx + add ecx,edx + mov esi,ebp + xor ebp,eax + add ebx,DWORD PTR[44+rsp] + and esi,eax + and edi,ebp + ror edx,7 + add ebx,esi + mov esi,ecx + rol ecx,5 + add ebx,edi + xor ebp,eax + add ebx,ecx + mov edi,edx + pxor xmm7,xmm3 +DB 102,68,15,58,15,213,8 + xor edx,ebp + add eax,DWORD PTR[48+rsp] + and edi,ebp + pxor xmm7,xmm0 + and esi,edx + ror ecx,7 + movdqa xmm9,XMMWORD PTR[48+r11] + paddd xmm8,xmm6 + add eax,edi + mov edi,ebx + pxor xmm7,xmm10 + rol ebx,5 + add eax,esi + xor edx,ebp + add eax,ebx + movdqa xmm10,xmm7 + movdqa XMMWORD PTR[32+rsp],xmm8 + mov esi,ecx + xor ecx,edx + add ebp,DWORD PTR[52+rsp] + and esi,edx + pslld xmm7,2 + and edi,ecx + ror ebx,7 + psrld xmm10,30 + add ebp,esi + mov esi,eax + rol eax,5 + add ebp,edi + xor ecx,edx + add ebp,eax + por xmm7,xmm10 + mov edi,ebx + xor ebx,ecx + movdqa xmm8,xmm7 + add edx,DWORD PTR[56+rsp] + and edi,ecx + and esi,ebx + ror eax,7 + add edx,edi + mov edi,ebp + rol ebp,5 + add edx,esi + xor ebx,ecx + add edx,ebp + mov esi,eax + xor eax,ebx + add ecx,DWORD PTR[60+rsp] + and esi,ebx + and edi,eax + ror ebp,7 + add ecx,esi + mov esi,edx + rol edx,5 + add ecx,edi + xor eax,ebx + add ecx,edx + mov edi,ebp + pxor xmm0,xmm4 +DB 102,68,15,58,15,198,8 + xor ebp,eax + add ebx,DWORD PTR[rsp] + and edi,eax + pxor xmm0,xmm1 + and esi,ebp + ror edx,7 + movdqa xmm10,xmm9 + paddd xmm9,xmm7 + add ebx,edi + mov edi,ecx + pxor xmm0,xmm8 + rol ecx,5 + add ebx,esi + xor ebp,eax + add ebx,ecx + movdqa xmm8,xmm0 + movdqa XMMWORD PTR[48+rsp],xmm9 + mov esi,edx + xor edx,ebp + add eax,DWORD PTR[4+rsp] + and esi,ebp + pslld xmm0,2 + and edi,edx + ror ecx,7 + psrld xmm8,30 + add eax,esi + mov esi,ebx + rol ebx,5 + add eax,edi + xor edx,ebp + add eax,ebx + por xmm0,xmm8 + mov edi,ecx + xor ecx,edx + movdqa xmm9,xmm0 + add ebp,DWORD PTR[8+rsp] + and edi,edx + and esi,ecx + ror ebx,7 + add ebp,edi + mov edi,eax + rol eax,5 + add ebp,esi + xor ecx,edx + add ebp,eax + mov esi,ebx + xor ebx,ecx + add edx,DWORD PTR[12+rsp] + and esi,ecx + and edi,ebx + ror eax,7 + add edx,esi + mov esi,ebp + rol ebp,5 + add edx,edi + xor ebx,ecx + add edx,ebp + mov edi,eax + pxor xmm1,xmm5 +DB 102,68,15,58,15,207,8 + xor eax,ebx + add ecx,DWORD PTR[16+rsp] + and edi,ebx + pxor xmm1,xmm2 + and esi,eax + ror ebp,7 + movdqa xmm8,xmm10 + paddd xmm10,xmm0 + add ecx,edi + mov edi,edx + pxor xmm1,xmm9 + rol edx,5 + add ecx,esi + xor eax,ebx + add ecx,edx + movdqa xmm9,xmm1 + movdqa XMMWORD PTR[rsp],xmm10 + mov esi,ebp + xor ebp,eax + add ebx,DWORD PTR[20+rsp] + and esi,eax + pslld xmm1,2 + and edi,ebp + ror edx,7 + psrld xmm9,30 + add ebx,esi + mov esi,ecx + rol ecx,5 + add ebx,edi + xor ebp,eax + add ebx,ecx + por xmm1,xmm9 + mov edi,edx + xor edx,ebp + movdqa xmm10,xmm1 + add eax,DWORD PTR[24+rsp] + and edi,ebp + and esi,edx + ror ecx,7 + add eax,edi + mov edi,ebx + rol ebx,5 + add eax,esi + xor edx,ebp + add eax,ebx + mov esi,ecx + xor ecx,edx + add ebp,DWORD PTR[28+rsp] + and esi,edx + and edi,ecx + ror ebx,7 + add ebp,esi + mov esi,eax + rol eax,5 + add ebp,edi + xor ecx,edx + add ebp,eax + mov edi,ebx + pxor xmm2,xmm6 +DB 102,68,15,58,15,208,8 + xor ebx,ecx + add edx,DWORD PTR[32+rsp] + and edi,ecx + pxor xmm2,xmm3 + and esi,ebx + ror eax,7 + movdqa xmm9,xmm8 + paddd xmm8,xmm1 + add edx,edi + mov edi,ebp + pxor xmm2,xmm10 + rol ebp,5 + add edx,esi + xor ebx,ecx + add edx,ebp + movdqa xmm10,xmm2 + movdqa XMMWORD PTR[16+rsp],xmm8 + mov esi,eax + xor eax,ebx + add ecx,DWORD PTR[36+rsp] + and esi,ebx + pslld xmm2,2 + and edi,eax + ror ebp,7 + psrld xmm10,30 + add ecx,esi + mov esi,edx + rol edx,5 + add ecx,edi + xor eax,ebx + add ecx,edx + por xmm2,xmm10 + mov edi,ebp + xor ebp,eax + movdqa xmm8,xmm2 + add ebx,DWORD PTR[40+rsp] + and edi,eax + and esi,ebp + ror edx,7 + add ebx,edi + mov edi,ecx + rol ecx,5 + add ebx,esi + xor ebp,eax + add ebx,ecx + mov esi,edx + xor edx,ebp + add eax,DWORD PTR[44+rsp] + and esi,ebp + and edi,edx + ror ecx,7 + add eax,esi + mov esi,ebx + rol ebx,5 + add eax,edi + xor edx,ebp + add eax,ebx + add ebp,DWORD PTR[48+rsp] + pxor xmm3,xmm7 +DB 102,68,15,58,15,193,8 + xor esi,edx + mov edi,eax + rol eax,5 + pxor xmm3,xmm4 + xor esi,ecx + add ebp,eax + movdqa xmm10,xmm9 + paddd xmm9,xmm2 + ror ebx,7 + add ebp,esi + pxor xmm3,xmm8 + add edx,DWORD PTR[52+rsp] + xor edi,ecx + mov esi,ebp + rol ebp,5 + movdqa xmm8,xmm3 + movdqa XMMWORD PTR[32+rsp],xmm9 + xor edi,ebx + add edx,ebp + ror eax,7 + add edx,edi + pslld xmm3,2 + add ecx,DWORD PTR[56+rsp] + xor esi,ebx + psrld xmm8,30 + mov edi,edx + rol edx,5 + xor esi,eax + add ecx,edx + ror ebp,7 + add ecx,esi + por xmm3,xmm8 + add ebx,DWORD PTR[60+rsp] + xor edi,eax + mov esi,ecx + rol ecx,5 + xor edi,ebp + add ebx,ecx + ror edx,7 + add ebx,edi + add eax,DWORD PTR[rsp] + paddd xmm10,xmm3 + xor esi,ebp + mov edi,ebx + rol ebx,5 + xor esi,edx + movdqa XMMWORD PTR[48+rsp],xmm10 + add eax,ebx + ror ecx,7 + add eax,esi + add ebp,DWORD PTR[4+rsp] + xor edi,edx + mov esi,eax + rol eax,5 + xor edi,ecx + add ebp,eax + ror ebx,7 + add ebp,edi + add edx,DWORD PTR[8+rsp] + xor esi,ecx + mov edi,ebp + rol ebp,5 + xor esi,ebx + add edx,ebp + ror eax,7 + add edx,esi + add ecx,DWORD PTR[12+rsp] + xor edi,ebx + mov esi,edx + rol edx,5 + xor edi,eax + add ecx,edx + ror ebp,7 + add ecx,edi + cmp r9,r10 + je $L$done_ssse3 + movdqa xmm6,XMMWORD PTR[64+r11] + movdqa xmm9,XMMWORD PTR[r11] + movdqu xmm0,XMMWORD PTR[r9] + movdqu xmm1,XMMWORD PTR[16+r9] + movdqu xmm2,XMMWORD PTR[32+r9] + movdqu xmm3,XMMWORD PTR[48+r9] +DB 102,15,56,0,198 + add r9,64 + add ebx,DWORD PTR[16+rsp] + xor esi,eax +DB 102,15,56,0,206 + mov edi,ecx + rol ecx,5 + paddd xmm0,xmm9 + xor esi,ebp + add ebx,ecx + ror edx,7 + add ebx,esi + movdqa XMMWORD PTR[rsp],xmm0 + add eax,DWORD PTR[20+rsp] + xor edi,ebp + psubd xmm0,xmm9 + mov esi,ebx + rol ebx,5 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + add ebp,DWORD PTR[24+rsp] + xor esi,edx + mov edi,eax + rol eax,5 + xor esi,ecx + add ebp,eax + ror ebx,7 + add ebp,esi + add edx,DWORD PTR[28+rsp] + xor edi,ecx + mov esi,ebp + rol ebp,5 + xor edi,ebx + add edx,ebp + ror eax,7 + add edx,edi + add ecx,DWORD PTR[32+rsp] + xor esi,ebx +DB 102,15,56,0,214 + mov edi,edx + rol edx,5 + paddd xmm1,xmm9 + xor esi,eax + add ecx,edx + ror ebp,7 + add ecx,esi + movdqa XMMWORD PTR[16+rsp],xmm1 + add ebx,DWORD PTR[36+rsp] + xor edi,eax + psubd xmm1,xmm9 + mov esi,ecx + rol ecx,5 + xor edi,ebp + add ebx,ecx + ror edx,7 + add ebx,edi + add eax,DWORD PTR[40+rsp] + xor esi,ebp + mov edi,ebx + rol ebx,5 + xor esi,edx + add eax,ebx + ror ecx,7 + add eax,esi + add ebp,DWORD PTR[44+rsp] + xor edi,edx + mov esi,eax + rol eax,5 + xor edi,ecx + add ebp,eax + ror ebx,7 + add ebp,edi + add edx,DWORD PTR[48+rsp] + xor esi,ecx +DB 102,15,56,0,222 + mov edi,ebp + rol ebp,5 + paddd xmm2,xmm9 + xor esi,ebx + add edx,ebp + ror eax,7 + add edx,esi + movdqa XMMWORD PTR[32+rsp],xmm2 + add ecx,DWORD PTR[52+rsp] + xor edi,ebx + psubd xmm2,xmm9 + mov esi,edx + rol edx,5 + xor edi,eax + add ecx,edx + ror ebp,7 + add ecx,edi + add ebx,DWORD PTR[56+rsp] + xor esi,eax + mov edi,ecx + rol ecx,5 + xor esi,ebp + add ebx,ecx + ror edx,7 + add ebx,esi + add eax,DWORD PTR[60+rsp] + xor edi,ebp + mov esi,ebx + rol ebx,5 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + add eax,DWORD PTR[r8] + add esi,DWORD PTR[4+r8] + add ecx,DWORD PTR[8+r8] + add edx,DWORD PTR[12+r8] + mov DWORD PTR[r8],eax + add ebp,DWORD PTR[16+r8] + mov DWORD PTR[4+r8],esi + mov ebx,esi + mov DWORD PTR[8+r8],ecx + mov DWORD PTR[12+r8],edx + mov DWORD PTR[16+r8],ebp + jmp $L$oop_ssse3 + +ALIGN 16 +$L$done_ssse3:: + add ebx,DWORD PTR[16+rsp] + xor esi,eax + mov edi,ecx + rol ecx,5 + xor esi,ebp + add ebx,ecx + ror edx,7 + add ebx,esi + add eax,DWORD PTR[20+rsp] + xor edi,ebp + mov esi,ebx + rol ebx,5 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + add ebp,DWORD PTR[24+rsp] + xor esi,edx + mov edi,eax + rol eax,5 + xor esi,ecx + add ebp,eax + ror ebx,7 + add ebp,esi + add edx,DWORD PTR[28+rsp] + xor edi,ecx + mov esi,ebp + rol ebp,5 + xor edi,ebx + add edx,ebp + ror eax,7 + add edx,edi + add ecx,DWORD PTR[32+rsp] + xor esi,ebx + mov edi,edx + rol edx,5 + xor esi,eax + add ecx,edx + ror ebp,7 + add ecx,esi + add ebx,DWORD PTR[36+rsp] + xor edi,eax + mov esi,ecx + rol ecx,5 + xor edi,ebp + add ebx,ecx + ror edx,7 + add ebx,edi + add eax,DWORD PTR[40+rsp] + xor esi,ebp + mov edi,ebx + rol ebx,5 + xor esi,edx + add eax,ebx + ror ecx,7 + add eax,esi + add ebp,DWORD PTR[44+rsp] + xor edi,edx + mov esi,eax + rol eax,5 + xor edi,ecx + add ebp,eax + ror ebx,7 + add ebp,edi + add edx,DWORD PTR[48+rsp] + xor esi,ecx + mov edi,ebp + rol ebp,5 + xor esi,ebx + add edx,ebp + ror eax,7 + add edx,esi + add ecx,DWORD PTR[52+rsp] + xor edi,ebx + mov esi,edx + rol edx,5 + xor edi,eax + add ecx,edx + ror ebp,7 + add ecx,edi + add ebx,DWORD PTR[56+rsp] + xor esi,eax + mov edi,ecx + rol ecx,5 + xor esi,ebp + add ebx,ecx + ror edx,7 + add ebx,esi + add eax,DWORD PTR[60+rsp] + xor edi,ebp + mov esi,ebx + rol ebx,5 + xor edi,edx + add eax,ebx + ror ecx,7 + add eax,edi + add eax,DWORD PTR[r8] + add esi,DWORD PTR[4+r8] + add ecx,DWORD PTR[8+r8] + mov DWORD PTR[r8],eax + add edx,DWORD PTR[12+r8] + mov DWORD PTR[4+r8],esi + add ebp,DWORD PTR[16+r8] + mov DWORD PTR[8+r8],ecx + mov DWORD PTR[12+r8],edx + mov DWORD PTR[16+r8],ebp + movaps xmm6,XMMWORD PTR[((64+0))+rsp] + movaps xmm7,XMMWORD PTR[((64+16))+rsp] + movaps xmm8,XMMWORD PTR[((64+32))+rsp] + movaps xmm9,XMMWORD PTR[((64+48))+rsp] + movaps xmm10,XMMWORD PTR[((64+64))+rsp] + lea rsi,QWORD PTR[144+rsp] + mov r12,QWORD PTR[rsi] + mov rbp,QWORD PTR[8+rsi] + mov rbx,QWORD PTR[16+rsi] + lea rsp,QWORD PTR[24+rsi] +$L$epilogue_ssse3:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_sha1_block_data_order_ssse3:: +sha1_block_data_order_ssse3 ENDP +ALIGN 64 +K_XX_XX:: + DD 05a827999h,05a827999h,05a827999h,05a827999h + DD 06ed9eba1h,06ed9eba1h,06ed9eba1h,06ed9eba1h + DD 08f1bbcdch,08f1bbcdch,08f1bbcdch,08f1bbcdch + DD 0ca62c1d6h,0ca62c1d6h,0ca62c1d6h,0ca62c1d6h + DD 000010203h,004050607h,008090a0bh,00c0d0e0fh +DB 83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115 +DB 102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44 +DB 32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60 +DB 97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114 +DB 103,62,0 +ALIGN 64 +EXTERN __imp_RtlVirtualUnwind:NEAR + +ALIGN 16 +se_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + lea r10,QWORD PTR[$L$prologue] + cmp rbx,r10 + jb $L$common_seh_tail + + mov rax,QWORD PTR[152+r8] + + lea r10,QWORD PTR[$L$epilogue] + cmp rbx,r10 + jae $L$common_seh_tail + + mov rax,QWORD PTR[64+rax] + lea rax,QWORD PTR[32+rax] + + mov rbx,QWORD PTR[((-8))+rax] + mov rbp,QWORD PTR[((-16))+rax] + mov r12,QWORD PTR[((-24))+rax] + mov r13,QWORD PTR[((-32))+rax] + mov QWORD PTR[144+r8],rbx + mov QWORD PTR[160+r8],rbp + mov QWORD PTR[216+r8],r12 + mov QWORD PTR[224+r8],r13 + + jmp $L$common_seh_tail +se_handler ENDP + + +ALIGN 16 +ssse3_handler PROC PRIVATE + push rsi + push rdi + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + pushfq + sub rsp,64 + + mov rax,QWORD PTR[120+r8] + mov rbx,QWORD PTR[248+r8] + + mov rsi,QWORD PTR[8+r9] + mov r11,QWORD PTR[56+r9] + + mov r10d,DWORD PTR[r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$common_seh_tail + + mov rax,QWORD PTR[152+r8] + + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jae $L$common_seh_tail + + lea rsi,QWORD PTR[64+rax] + lea rdi,QWORD PTR[512+r8] + mov ecx,10 + DD 0a548f3fch + lea rax,QWORD PTR[168+rax] + + mov rbx,QWORD PTR[((-8))+rax] + mov rbp,QWORD PTR[((-16))+rax] + mov r12,QWORD PTR[((-24))+rax] + mov QWORD PTR[144+r8],rbx + mov QWORD PTR[160+r8],rbp + mov QWORD PTR[216+r8],r12 + +$L$common_seh_tail:: + mov rdi,QWORD PTR[8+rax] + mov rsi,QWORD PTR[16+rax] + mov QWORD PTR[152+r8],rax + mov QWORD PTR[168+r8],rsi + mov QWORD PTR[176+r8],rdi + + mov rdi,QWORD PTR[40+r9] + mov rsi,r8 + mov ecx,154 + DD 0a548f3fch + + mov rsi,r9 + xor rcx,rcx + mov rdx,QWORD PTR[8+rsi] + mov r8,QWORD PTR[rsi] + mov r9,QWORD PTR[16+rsi] + mov r10,QWORD PTR[40+rsi] + lea r11,QWORD PTR[56+rsi] + lea r12,QWORD PTR[24+rsi] + mov QWORD PTR[32+rsp],r10 + mov QWORD PTR[40+rsp],r11 + mov QWORD PTR[48+rsp],r12 + mov QWORD PTR[56+rsp],rcx + call QWORD PTR[__imp_RtlVirtualUnwind] + + mov eax,1 + add rsp,64 + popfq + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + pop rbx + pop rdi + pop rsi + DB 0F3h,0C3h ;repret +ssse3_handler ENDP + +.text$ ENDS +.pdata SEGMENT READONLY ALIGN(4) +ALIGN 4 + DD imagerel $L$SEH_begin_sha1_block_data_order + DD imagerel $L$SEH_end_sha1_block_data_order + DD imagerel $L$SEH_info_sha1_block_data_order + DD imagerel $L$SEH_begin_sha1_block_data_order_ssse3 + DD imagerel $L$SEH_end_sha1_block_data_order_ssse3 + DD imagerel $L$SEH_info_sha1_block_data_order_ssse3 +.pdata ENDS +.xdata SEGMENT READONLY ALIGN(8) +ALIGN 8 +$L$SEH_info_sha1_block_data_order:: +DB 9,0,0,0 + DD imagerel se_handler +$L$SEH_info_sha1_block_data_order_ssse3:: +DB 9,0,0,0 + DD imagerel ssse3_handler + DD imagerel $L$prologue_ssse3,imagerel $L$epilogue_ssse3 + +.xdata ENDS +END diff --git a/crypto/sha/sha1-mingw64-x86_64.S b/crypto/sha/sha1-mingw64-x86_64.S new file mode 100644 index 00000000..3ce9fc9b --- /dev/null +++ b/crypto/sha/sha1-mingw64-x86_64.S @@ -0,0 +1,2664 @@ +#include "x86_arch.h" +.text + + + +.globl sha1_block_data_order +.def sha1_block_data_order; .scl 2; .type 32; .endef +.p2align 4 +sha1_block_data_order: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_sha1_block_data_order: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + movl OPENSSL_ia32cap_P+0(%rip),%r9d + movl OPENSSL_ia32cap_P+4(%rip),%r8d + testl $IA32CAP_MASK1_SSSE3,%r8d + jz .Lialu + jmp _ssse3_shortcut + +.p2align 4 +.Lialu: + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + movq %rsp,%r11 + movq %rdi,%r8 + subq $72,%rsp + movq %rsi,%r9 + andq $-64,%rsp + movq %rdx,%r10 + movq %r11,64(%rsp) +.Lprologue: + + movl 0(%r8),%esi + movl 4(%r8),%edi + movl 8(%r8),%r11d + movl 12(%r8),%r12d + movl 16(%r8),%r13d + jmp .Lloop + +.p2align 4 +.Lloop: + movl 0(%r9),%edx + bswapl %edx + movl %edx,0(%rsp) + movl %r11d,%eax + movl 4(%r9),%ebp + movl %esi,%ecx + xorl %r12d,%eax + bswapl %ebp + roll $5,%ecx + leal 1518500249(%rdx,%r13,1),%r13d + andl %edi,%eax + movl %ebp,4(%rsp) + addl %ecx,%r13d + xorl %r12d,%eax + roll $30,%edi + addl %eax,%r13d + movl %edi,%eax + movl 8(%r9),%edx + movl %r13d,%ecx + xorl %r11d,%eax + bswapl %edx + roll $5,%ecx + leal 1518500249(%rbp,%r12,1),%r12d + andl %esi,%eax + movl %edx,8(%rsp) + addl %ecx,%r12d + xorl %r11d,%eax + roll $30,%esi + addl %eax,%r12d + movl %esi,%eax + movl 12(%r9),%ebp + movl %r12d,%ecx + xorl %edi,%eax + bswapl %ebp + roll $5,%ecx + leal 1518500249(%rdx,%r11,1),%r11d + andl %r13d,%eax + movl %ebp,12(%rsp) + addl %ecx,%r11d + xorl %edi,%eax + roll $30,%r13d + addl %eax,%r11d + movl %r13d,%eax + movl 16(%r9),%edx + movl %r11d,%ecx + xorl %esi,%eax + bswapl %edx + roll $5,%ecx + leal 1518500249(%rbp,%rdi,1),%edi + andl %r12d,%eax + movl %edx,16(%rsp) + addl %ecx,%edi + xorl %esi,%eax + roll $30,%r12d + addl %eax,%edi + movl %r12d,%eax + movl 20(%r9),%ebp + movl %edi,%ecx + xorl %r13d,%eax + bswapl %ebp + roll $5,%ecx + leal 1518500249(%rdx,%rsi,1),%esi + andl %r11d,%eax + movl %ebp,20(%rsp) + addl %ecx,%esi + xorl %r13d,%eax + roll $30,%r11d + addl %eax,%esi + movl %r11d,%eax + movl 24(%r9),%edx + movl %esi,%ecx + xorl %r12d,%eax + bswapl %edx + roll $5,%ecx + leal 1518500249(%rbp,%r13,1),%r13d + andl %edi,%eax + movl %edx,24(%rsp) + addl %ecx,%r13d + xorl %r12d,%eax + roll $30,%edi + addl %eax,%r13d + movl %edi,%eax + movl 28(%r9),%ebp + movl %r13d,%ecx + xorl %r11d,%eax + bswapl %ebp + roll $5,%ecx + leal 1518500249(%rdx,%r12,1),%r12d + andl %esi,%eax + movl %ebp,28(%rsp) + addl %ecx,%r12d + xorl %r11d,%eax + roll $30,%esi + addl %eax,%r12d + movl %esi,%eax + movl 32(%r9),%edx + movl %r12d,%ecx + xorl %edi,%eax + bswapl %edx + roll $5,%ecx + leal 1518500249(%rbp,%r11,1),%r11d + andl %r13d,%eax + movl %edx,32(%rsp) + addl %ecx,%r11d + xorl %edi,%eax + roll $30,%r13d + addl %eax,%r11d + movl %r13d,%eax + movl 36(%r9),%ebp + movl %r11d,%ecx + xorl %esi,%eax + bswapl %ebp + roll $5,%ecx + leal 1518500249(%rdx,%rdi,1),%edi + andl %r12d,%eax + movl %ebp,36(%rsp) + addl %ecx,%edi + xorl %esi,%eax + roll $30,%r12d + addl %eax,%edi + movl %r12d,%eax + movl 40(%r9),%edx + movl %edi,%ecx + xorl %r13d,%eax + bswapl %edx + roll $5,%ecx + leal 1518500249(%rbp,%rsi,1),%esi + andl %r11d,%eax + movl %edx,40(%rsp) + addl %ecx,%esi + xorl %r13d,%eax + roll $30,%r11d + addl %eax,%esi + movl %r11d,%eax + movl 44(%r9),%ebp + movl %esi,%ecx + xorl %r12d,%eax + bswapl %ebp + roll $5,%ecx + leal 1518500249(%rdx,%r13,1),%r13d + andl %edi,%eax + movl %ebp,44(%rsp) + addl %ecx,%r13d + xorl %r12d,%eax + roll $30,%edi + addl %eax,%r13d + movl %edi,%eax + movl 48(%r9),%edx + movl %r13d,%ecx + xorl %r11d,%eax + bswapl %edx + roll $5,%ecx + leal 1518500249(%rbp,%r12,1),%r12d + andl %esi,%eax + movl %edx,48(%rsp) + addl %ecx,%r12d + xorl %r11d,%eax + roll $30,%esi + addl %eax,%r12d + movl %esi,%eax + movl 52(%r9),%ebp + movl %r12d,%ecx + xorl %edi,%eax + bswapl %ebp + roll $5,%ecx + leal 1518500249(%rdx,%r11,1),%r11d + andl %r13d,%eax + movl %ebp,52(%rsp) + addl %ecx,%r11d + xorl %edi,%eax + roll $30,%r13d + addl %eax,%r11d + movl %r13d,%eax + movl 56(%r9),%edx + movl %r11d,%ecx + xorl %esi,%eax + bswapl %edx + roll $5,%ecx + leal 1518500249(%rbp,%rdi,1),%edi + andl %r12d,%eax + movl %edx,56(%rsp) + addl %ecx,%edi + xorl %esi,%eax + roll $30,%r12d + addl %eax,%edi + movl %r12d,%eax + movl 60(%r9),%ebp + movl %edi,%ecx + xorl %r13d,%eax + bswapl %ebp + roll $5,%ecx + leal 1518500249(%rdx,%rsi,1),%esi + andl %r11d,%eax + movl %ebp,60(%rsp) + addl %ecx,%esi + xorl %r13d,%eax + roll $30,%r11d + addl %eax,%esi + movl 0(%rsp),%edx + movl %r11d,%eax + movl %esi,%ecx + xorl 8(%rsp),%edx + xorl %r12d,%eax + roll $5,%ecx + xorl 32(%rsp),%edx + andl %edi,%eax + leal 1518500249(%rbp,%r13,1),%r13d + xorl 52(%rsp),%edx + xorl %r12d,%eax + roll $1,%edx + addl %ecx,%r13d + roll $30,%edi + movl %edx,0(%rsp) + addl %eax,%r13d + movl 4(%rsp),%ebp + movl %edi,%eax + movl %r13d,%ecx + xorl 12(%rsp),%ebp + xorl %r11d,%eax + roll $5,%ecx + xorl 36(%rsp),%ebp + andl %esi,%eax + leal 1518500249(%rdx,%r12,1),%r12d + xorl 56(%rsp),%ebp + xorl %r11d,%eax + roll $1,%ebp + addl %ecx,%r12d + roll $30,%esi + movl %ebp,4(%rsp) + addl %eax,%r12d + movl 8(%rsp),%edx + movl %esi,%eax + movl %r12d,%ecx + xorl 16(%rsp),%edx + xorl %edi,%eax + roll $5,%ecx + xorl 40(%rsp),%edx + andl %r13d,%eax + leal 1518500249(%rbp,%r11,1),%r11d + xorl 60(%rsp),%edx + xorl %edi,%eax + roll $1,%edx + addl %ecx,%r11d + roll $30,%r13d + movl %edx,8(%rsp) + addl %eax,%r11d + movl 12(%rsp),%ebp + movl %r13d,%eax + movl %r11d,%ecx + xorl 20(%rsp),%ebp + xorl %esi,%eax + roll $5,%ecx + xorl 44(%rsp),%ebp + andl %r12d,%eax + leal 1518500249(%rdx,%rdi,1),%edi + xorl 0(%rsp),%ebp + xorl %esi,%eax + roll $1,%ebp + addl %ecx,%edi + roll $30,%r12d + movl %ebp,12(%rsp) + addl %eax,%edi + movl 16(%rsp),%edx + movl %r12d,%eax + movl %edi,%ecx + xorl 24(%rsp),%edx + xorl %r13d,%eax + roll $5,%ecx + xorl 48(%rsp),%edx + andl %r11d,%eax + leal 1518500249(%rbp,%rsi,1),%esi + xorl 4(%rsp),%edx + xorl %r13d,%eax + roll $1,%edx + addl %ecx,%esi + roll $30,%r11d + movl %edx,16(%rsp) + addl %eax,%esi + movl 20(%rsp),%ebp + movl %r11d,%eax + movl %esi,%ecx + xorl 28(%rsp),%ebp + xorl %edi,%eax + roll $5,%ecx + leal 1859775393(%rdx,%r13,1),%r13d + xorl 52(%rsp),%ebp + xorl %r12d,%eax + addl %ecx,%r13d + xorl 8(%rsp),%ebp + roll $30,%edi + addl %eax,%r13d + roll $1,%ebp + movl %ebp,20(%rsp) + movl 24(%rsp),%edx + movl %edi,%eax + movl %r13d,%ecx + xorl 32(%rsp),%edx + xorl %esi,%eax + roll $5,%ecx + leal 1859775393(%rbp,%r12,1),%r12d + xorl 56(%rsp),%edx + xorl %r11d,%eax + addl %ecx,%r12d + xorl 12(%rsp),%edx + roll $30,%esi + addl %eax,%r12d + roll $1,%edx + movl %edx,24(%rsp) + movl 28(%rsp),%ebp + movl %esi,%eax + movl %r12d,%ecx + xorl 36(%rsp),%ebp + xorl %r13d,%eax + roll $5,%ecx + leal 1859775393(%rdx,%r11,1),%r11d + xorl 60(%rsp),%ebp + xorl %edi,%eax + addl %ecx,%r11d + xorl 16(%rsp),%ebp + roll $30,%r13d + addl %eax,%r11d + roll $1,%ebp + movl %ebp,28(%rsp) + movl 32(%rsp),%edx + movl %r13d,%eax + movl %r11d,%ecx + xorl 40(%rsp),%edx + xorl %r12d,%eax + roll $5,%ecx + leal 1859775393(%rbp,%rdi,1),%edi + xorl 0(%rsp),%edx + xorl %esi,%eax + addl %ecx,%edi + xorl 20(%rsp),%edx + roll $30,%r12d + addl %eax,%edi + roll $1,%edx + movl %edx,32(%rsp) + movl 36(%rsp),%ebp + movl %r12d,%eax + movl %edi,%ecx + xorl 44(%rsp),%ebp + xorl %r11d,%eax + roll $5,%ecx + leal 1859775393(%rdx,%rsi,1),%esi + xorl 4(%rsp),%ebp + xorl %r13d,%eax + addl %ecx,%esi + xorl 24(%rsp),%ebp + roll $30,%r11d + addl %eax,%esi + roll $1,%ebp + movl %ebp,36(%rsp) + movl 40(%rsp),%edx + movl %r11d,%eax + movl %esi,%ecx + xorl 48(%rsp),%edx + xorl %edi,%eax + roll $5,%ecx + leal 1859775393(%rbp,%r13,1),%r13d + xorl 8(%rsp),%edx + xorl %r12d,%eax + addl %ecx,%r13d + xorl 28(%rsp),%edx + roll $30,%edi + addl %eax,%r13d + roll $1,%edx + movl %edx,40(%rsp) + movl 44(%rsp),%ebp + movl %edi,%eax + movl %r13d,%ecx + xorl 52(%rsp),%ebp + xorl %esi,%eax + roll $5,%ecx + leal 1859775393(%rdx,%r12,1),%r12d + xorl 12(%rsp),%ebp + xorl %r11d,%eax + addl %ecx,%r12d + xorl 32(%rsp),%ebp + roll $30,%esi + addl %eax,%r12d + roll $1,%ebp + movl %ebp,44(%rsp) + movl 48(%rsp),%edx + movl %esi,%eax + movl %r12d,%ecx + xorl 56(%rsp),%edx + xorl %r13d,%eax + roll $5,%ecx + leal 1859775393(%rbp,%r11,1),%r11d + xorl 16(%rsp),%edx + xorl %edi,%eax + addl %ecx,%r11d + xorl 36(%rsp),%edx + roll $30,%r13d + addl %eax,%r11d + roll $1,%edx + movl %edx,48(%rsp) + movl 52(%rsp),%ebp + movl %r13d,%eax + movl %r11d,%ecx + xorl 60(%rsp),%ebp + xorl %r12d,%eax + roll $5,%ecx + leal 1859775393(%rdx,%rdi,1),%edi + xorl 20(%rsp),%ebp + xorl %esi,%eax + addl %ecx,%edi + xorl 40(%rsp),%ebp + roll $30,%r12d + addl %eax,%edi + roll $1,%ebp + movl %ebp,52(%rsp) + movl 56(%rsp),%edx + movl %r12d,%eax + movl %edi,%ecx + xorl 0(%rsp),%edx + xorl %r11d,%eax + roll $5,%ecx + leal 1859775393(%rbp,%rsi,1),%esi + xorl 24(%rsp),%edx + xorl %r13d,%eax + addl %ecx,%esi + xorl 44(%rsp),%edx + roll $30,%r11d + addl %eax,%esi + roll $1,%edx + movl %edx,56(%rsp) + movl 60(%rsp),%ebp + movl %r11d,%eax + movl %esi,%ecx + xorl 4(%rsp),%ebp + xorl %edi,%eax + roll $5,%ecx + leal 1859775393(%rdx,%r13,1),%r13d + xorl 28(%rsp),%ebp + xorl %r12d,%eax + addl %ecx,%r13d + xorl 48(%rsp),%ebp + roll $30,%edi + addl %eax,%r13d + roll $1,%ebp + movl %ebp,60(%rsp) + movl 0(%rsp),%edx + movl %edi,%eax + movl %r13d,%ecx + xorl 8(%rsp),%edx + xorl %esi,%eax + roll $5,%ecx + leal 1859775393(%rbp,%r12,1),%r12d + xorl 32(%rsp),%edx + xorl %r11d,%eax + addl %ecx,%r12d + xorl 52(%rsp),%edx + roll $30,%esi + addl %eax,%r12d + roll $1,%edx + movl %edx,0(%rsp) + movl 4(%rsp),%ebp + movl %esi,%eax + movl %r12d,%ecx + xorl 12(%rsp),%ebp + xorl %r13d,%eax + roll $5,%ecx + leal 1859775393(%rdx,%r11,1),%r11d + xorl 36(%rsp),%ebp + xorl %edi,%eax + addl %ecx,%r11d + xorl 56(%rsp),%ebp + roll $30,%r13d + addl %eax,%r11d + roll $1,%ebp + movl %ebp,4(%rsp) + movl 8(%rsp),%edx + movl %r13d,%eax + movl %r11d,%ecx + xorl 16(%rsp),%edx + xorl %r12d,%eax + roll $5,%ecx + leal 1859775393(%rbp,%rdi,1),%edi + xorl 40(%rsp),%edx + xorl %esi,%eax + addl %ecx,%edi + xorl 60(%rsp),%edx + roll $30,%r12d + addl %eax,%edi + roll $1,%edx + movl %edx,8(%rsp) + movl 12(%rsp),%ebp + movl %r12d,%eax + movl %edi,%ecx + xorl 20(%rsp),%ebp + xorl %r11d,%eax + roll $5,%ecx + leal 1859775393(%rdx,%rsi,1),%esi + xorl 44(%rsp),%ebp + xorl %r13d,%eax + addl %ecx,%esi + xorl 0(%rsp),%ebp + roll $30,%r11d + addl %eax,%esi + roll $1,%ebp + movl %ebp,12(%rsp) + movl 16(%rsp),%edx + movl %r11d,%eax + movl %esi,%ecx + xorl 24(%rsp),%edx + xorl %edi,%eax + roll $5,%ecx + leal 1859775393(%rbp,%r13,1),%r13d + xorl 48(%rsp),%edx + xorl %r12d,%eax + addl %ecx,%r13d + xorl 4(%rsp),%edx + roll $30,%edi + addl %eax,%r13d + roll $1,%edx + movl %edx,16(%rsp) + movl 20(%rsp),%ebp + movl %edi,%eax + movl %r13d,%ecx + xorl 28(%rsp),%ebp + xorl %esi,%eax + roll $5,%ecx + leal 1859775393(%rdx,%r12,1),%r12d + xorl 52(%rsp),%ebp + xorl %r11d,%eax + addl %ecx,%r12d + xorl 8(%rsp),%ebp + roll $30,%esi + addl %eax,%r12d + roll $1,%ebp + movl %ebp,20(%rsp) + movl 24(%rsp),%edx + movl %esi,%eax + movl %r12d,%ecx + xorl 32(%rsp),%edx + xorl %r13d,%eax + roll $5,%ecx + leal 1859775393(%rbp,%r11,1),%r11d + xorl 56(%rsp),%edx + xorl %edi,%eax + addl %ecx,%r11d + xorl 12(%rsp),%edx + roll $30,%r13d + addl %eax,%r11d + roll $1,%edx + movl %edx,24(%rsp) + movl 28(%rsp),%ebp + movl %r13d,%eax + movl %r11d,%ecx + xorl 36(%rsp),%ebp + xorl %r12d,%eax + roll $5,%ecx + leal 1859775393(%rdx,%rdi,1),%edi + xorl 60(%rsp),%ebp + xorl %esi,%eax + addl %ecx,%edi + xorl 16(%rsp),%ebp + roll $30,%r12d + addl %eax,%edi + roll $1,%ebp + movl %ebp,28(%rsp) + movl 32(%rsp),%edx + movl %r12d,%eax + movl %edi,%ecx + xorl 40(%rsp),%edx + xorl %r11d,%eax + roll $5,%ecx + leal 1859775393(%rbp,%rsi,1),%esi + xorl 0(%rsp),%edx + xorl %r13d,%eax + addl %ecx,%esi + xorl 20(%rsp),%edx + roll $30,%r11d + addl %eax,%esi + roll $1,%edx + movl %edx,32(%rsp) + movl 36(%rsp),%ebp + movl %r11d,%eax + movl %r11d,%ebx + xorl 44(%rsp),%ebp + andl %r12d,%eax + movl %esi,%ecx + xorl 4(%rsp),%ebp + xorl %r12d,%ebx + leal -1894007588(%rdx,%r13,1),%r13d + roll $5,%ecx + xorl 24(%rsp),%ebp + addl %eax,%r13d + andl %edi,%ebx + roll $1,%ebp + addl %ebx,%r13d + roll $30,%edi + movl %ebp,36(%rsp) + addl %ecx,%r13d + movl 40(%rsp),%edx + movl %edi,%eax + movl %edi,%ebx + xorl 48(%rsp),%edx + andl %r11d,%eax + movl %r13d,%ecx + xorl 8(%rsp),%edx + xorl %r11d,%ebx + leal -1894007588(%rbp,%r12,1),%r12d + roll $5,%ecx + xorl 28(%rsp),%edx + addl %eax,%r12d + andl %esi,%ebx + roll $1,%edx + addl %ebx,%r12d + roll $30,%esi + movl %edx,40(%rsp) + addl %ecx,%r12d + movl 44(%rsp),%ebp + movl %esi,%eax + movl %esi,%ebx + xorl 52(%rsp),%ebp + andl %edi,%eax + movl %r12d,%ecx + xorl 12(%rsp),%ebp + xorl %edi,%ebx + leal -1894007588(%rdx,%r11,1),%r11d + roll $5,%ecx + xorl 32(%rsp),%ebp + addl %eax,%r11d + andl %r13d,%ebx + roll $1,%ebp + addl %ebx,%r11d + roll $30,%r13d + movl %ebp,44(%rsp) + addl %ecx,%r11d + movl 48(%rsp),%edx + movl %r13d,%eax + movl %r13d,%ebx + xorl 56(%rsp),%edx + andl %esi,%eax + movl %r11d,%ecx + xorl 16(%rsp),%edx + xorl %esi,%ebx + leal -1894007588(%rbp,%rdi,1),%edi + roll $5,%ecx + xorl 36(%rsp),%edx + addl %eax,%edi + andl %r12d,%ebx + roll $1,%edx + addl %ebx,%edi + roll $30,%r12d + movl %edx,48(%rsp) + addl %ecx,%edi + movl 52(%rsp),%ebp + movl %r12d,%eax + movl %r12d,%ebx + xorl 60(%rsp),%ebp + andl %r13d,%eax + movl %edi,%ecx + xorl 20(%rsp),%ebp + xorl %r13d,%ebx + leal -1894007588(%rdx,%rsi,1),%esi + roll $5,%ecx + xorl 40(%rsp),%ebp + addl %eax,%esi + andl %r11d,%ebx + roll $1,%ebp + addl %ebx,%esi + roll $30,%r11d + movl %ebp,52(%rsp) + addl %ecx,%esi + movl 56(%rsp),%edx + movl %r11d,%eax + movl %r11d,%ebx + xorl 0(%rsp),%edx + andl %r12d,%eax + movl %esi,%ecx + xorl 24(%rsp),%edx + xorl %r12d,%ebx + leal -1894007588(%rbp,%r13,1),%r13d + roll $5,%ecx + xorl 44(%rsp),%edx + addl %eax,%r13d + andl %edi,%ebx + roll $1,%edx + addl %ebx,%r13d + roll $30,%edi + movl %edx,56(%rsp) + addl %ecx,%r13d + movl 60(%rsp),%ebp + movl %edi,%eax + movl %edi,%ebx + xorl 4(%rsp),%ebp + andl %r11d,%eax + movl %r13d,%ecx + xorl 28(%rsp),%ebp + xorl %r11d,%ebx + leal -1894007588(%rdx,%r12,1),%r12d + roll $5,%ecx + xorl 48(%rsp),%ebp + addl %eax,%r12d + andl %esi,%ebx + roll $1,%ebp + addl %ebx,%r12d + roll $30,%esi + movl %ebp,60(%rsp) + addl %ecx,%r12d + movl 0(%rsp),%edx + movl %esi,%eax + movl %esi,%ebx + xorl 8(%rsp),%edx + andl %edi,%eax + movl %r12d,%ecx + xorl 32(%rsp),%edx + xorl %edi,%ebx + leal -1894007588(%rbp,%r11,1),%r11d + roll $5,%ecx + xorl 52(%rsp),%edx + addl %eax,%r11d + andl %r13d,%ebx + roll $1,%edx + addl %ebx,%r11d + roll $30,%r13d + movl %edx,0(%rsp) + addl %ecx,%r11d + movl 4(%rsp),%ebp + movl %r13d,%eax + movl %r13d,%ebx + xorl 12(%rsp),%ebp + andl %esi,%eax + movl %r11d,%ecx + xorl 36(%rsp),%ebp + xorl %esi,%ebx + leal -1894007588(%rdx,%rdi,1),%edi + roll $5,%ecx + xorl 56(%rsp),%ebp + addl %eax,%edi + andl %r12d,%ebx + roll $1,%ebp + addl %ebx,%edi + roll $30,%r12d + movl %ebp,4(%rsp) + addl %ecx,%edi + movl 8(%rsp),%edx + movl %r12d,%eax + movl %r12d,%ebx + xorl 16(%rsp),%edx + andl %r13d,%eax + movl %edi,%ecx + xorl 40(%rsp),%edx + xorl %r13d,%ebx + leal -1894007588(%rbp,%rsi,1),%esi + roll $5,%ecx + xorl 60(%rsp),%edx + addl %eax,%esi + andl %r11d,%ebx + roll $1,%edx + addl %ebx,%esi + roll $30,%r11d + movl %edx,8(%rsp) + addl %ecx,%esi + movl 12(%rsp),%ebp + movl %r11d,%eax + movl %r11d,%ebx + xorl 20(%rsp),%ebp + andl %r12d,%eax + movl %esi,%ecx + xorl 44(%rsp),%ebp + xorl %r12d,%ebx + leal -1894007588(%rdx,%r13,1),%r13d + roll $5,%ecx + xorl 0(%rsp),%ebp + addl %eax,%r13d + andl %edi,%ebx + roll $1,%ebp + addl %ebx,%r13d + roll $30,%edi + movl %ebp,12(%rsp) + addl %ecx,%r13d + movl 16(%rsp),%edx + movl %edi,%eax + movl %edi,%ebx + xorl 24(%rsp),%edx + andl %r11d,%eax + movl %r13d,%ecx + xorl 48(%rsp),%edx + xorl %r11d,%ebx + leal -1894007588(%rbp,%r12,1),%r12d + roll $5,%ecx + xorl 4(%rsp),%edx + addl %eax,%r12d + andl %esi,%ebx + roll $1,%edx + addl %ebx,%r12d + roll $30,%esi + movl %edx,16(%rsp) + addl %ecx,%r12d + movl 20(%rsp),%ebp + movl %esi,%eax + movl %esi,%ebx + xorl 28(%rsp),%ebp + andl %edi,%eax + movl %r12d,%ecx + xorl 52(%rsp),%ebp + xorl %edi,%ebx + leal -1894007588(%rdx,%r11,1),%r11d + roll $5,%ecx + xorl 8(%rsp),%ebp + addl %eax,%r11d + andl %r13d,%ebx + roll $1,%ebp + addl %ebx,%r11d + roll $30,%r13d + movl %ebp,20(%rsp) + addl %ecx,%r11d + movl 24(%rsp),%edx + movl %r13d,%eax + movl %r13d,%ebx + xorl 32(%rsp),%edx + andl %esi,%eax + movl %r11d,%ecx + xorl 56(%rsp),%edx + xorl %esi,%ebx + leal -1894007588(%rbp,%rdi,1),%edi + roll $5,%ecx + xorl 12(%rsp),%edx + addl %eax,%edi + andl %r12d,%ebx + roll $1,%edx + addl %ebx,%edi + roll $30,%r12d + movl %edx,24(%rsp) + addl %ecx,%edi + movl 28(%rsp),%ebp + movl %r12d,%eax + movl %r12d,%ebx + xorl 36(%rsp),%ebp + andl %r13d,%eax + movl %edi,%ecx + xorl 60(%rsp),%ebp + xorl %r13d,%ebx + leal -1894007588(%rdx,%rsi,1),%esi + roll $5,%ecx + xorl 16(%rsp),%ebp + addl %eax,%esi + andl %r11d,%ebx + roll $1,%ebp + addl %ebx,%esi + roll $30,%r11d + movl %ebp,28(%rsp) + addl %ecx,%esi + movl 32(%rsp),%edx + movl %r11d,%eax + movl %r11d,%ebx + xorl 40(%rsp),%edx + andl %r12d,%eax + movl %esi,%ecx + xorl 0(%rsp),%edx + xorl %r12d,%ebx + leal -1894007588(%rbp,%r13,1),%r13d + roll $5,%ecx + xorl 20(%rsp),%edx + addl %eax,%r13d + andl %edi,%ebx + roll $1,%edx + addl %ebx,%r13d + roll $30,%edi + movl %edx,32(%rsp) + addl %ecx,%r13d + movl 36(%rsp),%ebp + movl %edi,%eax + movl %edi,%ebx + xorl 44(%rsp),%ebp + andl %r11d,%eax + movl %r13d,%ecx + xorl 4(%rsp),%ebp + xorl %r11d,%ebx + leal -1894007588(%rdx,%r12,1),%r12d + roll $5,%ecx + xorl 24(%rsp),%ebp + addl %eax,%r12d + andl %esi,%ebx + roll $1,%ebp + addl %ebx,%r12d + roll $30,%esi + movl %ebp,36(%rsp) + addl %ecx,%r12d + movl 40(%rsp),%edx + movl %esi,%eax + movl %esi,%ebx + xorl 48(%rsp),%edx + andl %edi,%eax + movl %r12d,%ecx + xorl 8(%rsp),%edx + xorl %edi,%ebx + leal -1894007588(%rbp,%r11,1),%r11d + roll $5,%ecx + xorl 28(%rsp),%edx + addl %eax,%r11d + andl %r13d,%ebx + roll $1,%edx + addl %ebx,%r11d + roll $30,%r13d + movl %edx,40(%rsp) + addl %ecx,%r11d + movl 44(%rsp),%ebp + movl %r13d,%eax + movl %r13d,%ebx + xorl 52(%rsp),%ebp + andl %esi,%eax + movl %r11d,%ecx + xorl 12(%rsp),%ebp + xorl %esi,%ebx + leal -1894007588(%rdx,%rdi,1),%edi + roll $5,%ecx + xorl 32(%rsp),%ebp + addl %eax,%edi + andl %r12d,%ebx + roll $1,%ebp + addl %ebx,%edi + roll $30,%r12d + movl %ebp,44(%rsp) + addl %ecx,%edi + movl 48(%rsp),%edx + movl %r12d,%eax + movl %r12d,%ebx + xorl 56(%rsp),%edx + andl %r13d,%eax + movl %edi,%ecx + xorl 16(%rsp),%edx + xorl %r13d,%ebx + leal -1894007588(%rbp,%rsi,1),%esi + roll $5,%ecx + xorl 36(%rsp),%edx + addl %eax,%esi + andl %r11d,%ebx + roll $1,%edx + addl %ebx,%esi + roll $30,%r11d + movl %edx,48(%rsp) + addl %ecx,%esi + movl 52(%rsp),%ebp + movl %r11d,%eax + movl %esi,%ecx + xorl 60(%rsp),%ebp + xorl %edi,%eax + roll $5,%ecx + leal -899497514(%rdx,%r13,1),%r13d + xorl 20(%rsp),%ebp + xorl %r12d,%eax + addl %ecx,%r13d + xorl 40(%rsp),%ebp + roll $30,%edi + addl %eax,%r13d + roll $1,%ebp + movl %ebp,52(%rsp) + movl 56(%rsp),%edx + movl %edi,%eax + movl %r13d,%ecx + xorl 0(%rsp),%edx + xorl %esi,%eax + roll $5,%ecx + leal -899497514(%rbp,%r12,1),%r12d + xorl 24(%rsp),%edx + xorl %r11d,%eax + addl %ecx,%r12d + xorl 44(%rsp),%edx + roll $30,%esi + addl %eax,%r12d + roll $1,%edx + movl %edx,56(%rsp) + movl 60(%rsp),%ebp + movl %esi,%eax + movl %r12d,%ecx + xorl 4(%rsp),%ebp + xorl %r13d,%eax + roll $5,%ecx + leal -899497514(%rdx,%r11,1),%r11d + xorl 28(%rsp),%ebp + xorl %edi,%eax + addl %ecx,%r11d + xorl 48(%rsp),%ebp + roll $30,%r13d + addl %eax,%r11d + roll $1,%ebp + movl %ebp,60(%rsp) + movl 0(%rsp),%edx + movl %r13d,%eax + movl %r11d,%ecx + xorl 8(%rsp),%edx + xorl %r12d,%eax + roll $5,%ecx + leal -899497514(%rbp,%rdi,1),%edi + xorl 32(%rsp),%edx + xorl %esi,%eax + addl %ecx,%edi + xorl 52(%rsp),%edx + roll $30,%r12d + addl %eax,%edi + roll $1,%edx + movl %edx,0(%rsp) + movl 4(%rsp),%ebp + movl %r12d,%eax + movl %edi,%ecx + xorl 12(%rsp),%ebp + xorl %r11d,%eax + roll $5,%ecx + leal -899497514(%rdx,%rsi,1),%esi + xorl 36(%rsp),%ebp + xorl %r13d,%eax + addl %ecx,%esi + xorl 56(%rsp),%ebp + roll $30,%r11d + addl %eax,%esi + roll $1,%ebp + movl %ebp,4(%rsp) + movl 8(%rsp),%edx + movl %r11d,%eax + movl %esi,%ecx + xorl 16(%rsp),%edx + xorl %edi,%eax + roll $5,%ecx + leal -899497514(%rbp,%r13,1),%r13d + xorl 40(%rsp),%edx + xorl %r12d,%eax + addl %ecx,%r13d + xorl 60(%rsp),%edx + roll $30,%edi + addl %eax,%r13d + roll $1,%edx + movl %edx,8(%rsp) + movl 12(%rsp),%ebp + movl %edi,%eax + movl %r13d,%ecx + xorl 20(%rsp),%ebp + xorl %esi,%eax + roll $5,%ecx + leal -899497514(%rdx,%r12,1),%r12d + xorl 44(%rsp),%ebp + xorl %r11d,%eax + addl %ecx,%r12d + xorl 0(%rsp),%ebp + roll $30,%esi + addl %eax,%r12d + roll $1,%ebp + movl %ebp,12(%rsp) + movl 16(%rsp),%edx + movl %esi,%eax + movl %r12d,%ecx + xorl 24(%rsp),%edx + xorl %r13d,%eax + roll $5,%ecx + leal -899497514(%rbp,%r11,1),%r11d + xorl 48(%rsp),%edx + xorl %edi,%eax + addl %ecx,%r11d + xorl 4(%rsp),%edx + roll $30,%r13d + addl %eax,%r11d + roll $1,%edx + movl %edx,16(%rsp) + movl 20(%rsp),%ebp + movl %r13d,%eax + movl %r11d,%ecx + xorl 28(%rsp),%ebp + xorl %r12d,%eax + roll $5,%ecx + leal -899497514(%rdx,%rdi,1),%edi + xorl 52(%rsp),%ebp + xorl %esi,%eax + addl %ecx,%edi + xorl 8(%rsp),%ebp + roll $30,%r12d + addl %eax,%edi + roll $1,%ebp + movl %ebp,20(%rsp) + movl 24(%rsp),%edx + movl %r12d,%eax + movl %edi,%ecx + xorl 32(%rsp),%edx + xorl %r11d,%eax + roll $5,%ecx + leal -899497514(%rbp,%rsi,1),%esi + xorl 56(%rsp),%edx + xorl %r13d,%eax + addl %ecx,%esi + xorl 12(%rsp),%edx + roll $30,%r11d + addl %eax,%esi + roll $1,%edx + movl %edx,24(%rsp) + movl 28(%rsp),%ebp + movl %r11d,%eax + movl %esi,%ecx + xorl 36(%rsp),%ebp + xorl %edi,%eax + roll $5,%ecx + leal -899497514(%rdx,%r13,1),%r13d + xorl 60(%rsp),%ebp + xorl %r12d,%eax + addl %ecx,%r13d + xorl 16(%rsp),%ebp + roll $30,%edi + addl %eax,%r13d + roll $1,%ebp + movl %ebp,28(%rsp) + movl 32(%rsp),%edx + movl %edi,%eax + movl %r13d,%ecx + xorl 40(%rsp),%edx + xorl %esi,%eax + roll $5,%ecx + leal -899497514(%rbp,%r12,1),%r12d + xorl 0(%rsp),%edx + xorl %r11d,%eax + addl %ecx,%r12d + xorl 20(%rsp),%edx + roll $30,%esi + addl %eax,%r12d + roll $1,%edx + movl %edx,32(%rsp) + movl 36(%rsp),%ebp + movl %esi,%eax + movl %r12d,%ecx + xorl 44(%rsp),%ebp + xorl %r13d,%eax + roll $5,%ecx + leal -899497514(%rdx,%r11,1),%r11d + xorl 4(%rsp),%ebp + xorl %edi,%eax + addl %ecx,%r11d + xorl 24(%rsp),%ebp + roll $30,%r13d + addl %eax,%r11d + roll $1,%ebp + movl %ebp,36(%rsp) + movl 40(%rsp),%edx + movl %r13d,%eax + movl %r11d,%ecx + xorl 48(%rsp),%edx + xorl %r12d,%eax + roll $5,%ecx + leal -899497514(%rbp,%rdi,1),%edi + xorl 8(%rsp),%edx + xorl %esi,%eax + addl %ecx,%edi + xorl 28(%rsp),%edx + roll $30,%r12d + addl %eax,%edi + roll $1,%edx + movl %edx,40(%rsp) + movl 44(%rsp),%ebp + movl %r12d,%eax + movl %edi,%ecx + xorl 52(%rsp),%ebp + xorl %r11d,%eax + roll $5,%ecx + leal -899497514(%rdx,%rsi,1),%esi + xorl 12(%rsp),%ebp + xorl %r13d,%eax + addl %ecx,%esi + xorl 32(%rsp),%ebp + roll $30,%r11d + addl %eax,%esi + roll $1,%ebp + movl %ebp,44(%rsp) + movl 48(%rsp),%edx + movl %r11d,%eax + movl %esi,%ecx + xorl 56(%rsp),%edx + xorl %edi,%eax + roll $5,%ecx + leal -899497514(%rbp,%r13,1),%r13d + xorl 16(%rsp),%edx + xorl %r12d,%eax + addl %ecx,%r13d + xorl 36(%rsp),%edx + roll $30,%edi + addl %eax,%r13d + roll $1,%edx + movl %edx,48(%rsp) + movl 52(%rsp),%ebp + movl %edi,%eax + movl %r13d,%ecx + xorl 60(%rsp),%ebp + xorl %esi,%eax + roll $5,%ecx + leal -899497514(%rdx,%r12,1),%r12d + xorl 20(%rsp),%ebp + xorl %r11d,%eax + addl %ecx,%r12d + xorl 40(%rsp),%ebp + roll $30,%esi + addl %eax,%r12d + roll $1,%ebp + movl 56(%rsp),%edx + movl %esi,%eax + movl %r12d,%ecx + xorl 0(%rsp),%edx + xorl %r13d,%eax + roll $5,%ecx + leal -899497514(%rbp,%r11,1),%r11d + xorl 24(%rsp),%edx + xorl %edi,%eax + addl %ecx,%r11d + xorl 44(%rsp),%edx + roll $30,%r13d + addl %eax,%r11d + roll $1,%edx + movl 60(%rsp),%ebp + movl %r13d,%eax + movl %r11d,%ecx + xorl 4(%rsp),%ebp + xorl %r12d,%eax + roll $5,%ecx + leal -899497514(%rdx,%rdi,1),%edi + xorl 28(%rsp),%ebp + xorl %esi,%eax + addl %ecx,%edi + xorl 48(%rsp),%ebp + roll $30,%r12d + addl %eax,%edi + roll $1,%ebp + movl %r12d,%eax + movl %edi,%ecx + xorl %r11d,%eax + leal -899497514(%rbp,%rsi,1),%esi + roll $5,%ecx + xorl %r13d,%eax + addl %ecx,%esi + roll $30,%r11d + addl %eax,%esi + addl 0(%r8),%esi + addl 4(%r8),%edi + addl 8(%r8),%r11d + addl 12(%r8),%r12d + addl 16(%r8),%r13d + movl %esi,0(%r8) + movl %edi,4(%r8) + movl %r11d,8(%r8) + movl %r12d,12(%r8) + movl %r13d,16(%r8) + + subq $1,%r10 + leaq 64(%r9),%r9 + jnz .Lloop + + movq 64(%rsp),%rsi + movq (%rsi),%r13 + movq 8(%rsi),%r12 + movq 16(%rsi),%rbp + movq 24(%rsi),%rbx + leaq 32(%rsi),%rsp +.Lepilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_sha1_block_data_order: +.def sha1_block_data_order_ssse3; .scl 3; .type 32; .endef +.p2align 4 +sha1_block_data_order_ssse3: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_sha1_block_data_order_ssse3: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + +_ssse3_shortcut: + pushq %rbx + pushq %rbp + pushq %r12 + leaq -144(%rsp),%rsp + movaps %xmm6,64+0(%rsp) + movaps %xmm7,64+16(%rsp) + movaps %xmm8,64+32(%rsp) + movaps %xmm9,64+48(%rsp) + movaps %xmm10,64+64(%rsp) +.Lprologue_ssse3: + movq %rdi,%r8 + movq %rsi,%r9 + movq %rdx,%r10 + + shlq $6,%r10 + addq %r9,%r10 + leaq K_XX_XX(%rip),%r11 + + movl 0(%r8),%eax + movl 4(%r8),%ebx + movl 8(%r8),%ecx + movl 12(%r8),%edx + movl %ebx,%esi + movl 16(%r8),%ebp + + movdqa 64(%r11),%xmm6 + movdqa 0(%r11),%xmm9 + movdqu 0(%r9),%xmm0 + movdqu 16(%r9),%xmm1 + movdqu 32(%r9),%xmm2 + movdqu 48(%r9),%xmm3 +.byte 102,15,56,0,198 + addq $64,%r9 +.byte 102,15,56,0,206 +.byte 102,15,56,0,214 +.byte 102,15,56,0,222 + paddd %xmm9,%xmm0 + paddd %xmm9,%xmm1 + paddd %xmm9,%xmm2 + movdqa %xmm0,0(%rsp) + psubd %xmm9,%xmm0 + movdqa %xmm1,16(%rsp) + psubd %xmm9,%xmm1 + movdqa %xmm2,32(%rsp) + psubd %xmm9,%xmm2 + jmp .Loop_ssse3 +.p2align 4 +.Loop_ssse3: + movdqa %xmm1,%xmm4 + addl 0(%rsp),%ebp + xorl %edx,%ecx + movdqa %xmm3,%xmm8 +.byte 102,15,58,15,224,8 + movl %eax,%edi + roll $5,%eax + paddd %xmm3,%xmm9 + andl %ecx,%esi + xorl %edx,%ecx + psrldq $4,%xmm8 + xorl %edx,%esi + addl %eax,%ebp + pxor %xmm0,%xmm4 + rorl $2,%ebx + addl %esi,%ebp + pxor %xmm2,%xmm8 + addl 4(%rsp),%edx + xorl %ecx,%ebx + movl %ebp,%esi + roll $5,%ebp + pxor %xmm8,%xmm4 + andl %ebx,%edi + xorl %ecx,%ebx + movdqa %xmm9,48(%rsp) + xorl %ecx,%edi + addl %ebp,%edx + movdqa %xmm4,%xmm10 + movdqa %xmm4,%xmm8 + rorl $7,%eax + addl %edi,%edx + addl 8(%rsp),%ecx + xorl %ebx,%eax + pslldq $12,%xmm10 + paddd %xmm4,%xmm4 + movl %edx,%edi + roll $5,%edx + andl %eax,%esi + xorl %ebx,%eax + psrld $31,%xmm8 + xorl %ebx,%esi + addl %edx,%ecx + movdqa %xmm10,%xmm9 + rorl $7,%ebp + addl %esi,%ecx + psrld $30,%xmm10 + por %xmm8,%xmm4 + addl 12(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%esi + roll $5,%ecx + pslld $2,%xmm9 + pxor %xmm10,%xmm4 + andl %ebp,%edi + xorl %eax,%ebp + movdqa 0(%r11),%xmm10 + xorl %eax,%edi + addl %ecx,%ebx + pxor %xmm9,%xmm4 + rorl $7,%edx + addl %edi,%ebx + movdqa %xmm2,%xmm5 + addl 16(%rsp),%eax + xorl %ebp,%edx + movdqa %xmm4,%xmm9 +.byte 102,15,58,15,233,8 + movl %ebx,%edi + roll $5,%ebx + paddd %xmm4,%xmm10 + andl %edx,%esi + xorl %ebp,%edx + psrldq $4,%xmm9 + xorl %ebp,%esi + addl %ebx,%eax + pxor %xmm1,%xmm5 + rorl $7,%ecx + addl %esi,%eax + pxor %xmm3,%xmm9 + addl 20(%rsp),%ebp + xorl %edx,%ecx + movl %eax,%esi + roll $5,%eax + pxor %xmm9,%xmm5 + andl %ecx,%edi + xorl %edx,%ecx + movdqa %xmm10,0(%rsp) + xorl %edx,%edi + addl %eax,%ebp + movdqa %xmm5,%xmm8 + movdqa %xmm5,%xmm9 + rorl $7,%ebx + addl %edi,%ebp + addl 24(%rsp),%edx + xorl %ecx,%ebx + pslldq $12,%xmm8 + paddd %xmm5,%xmm5 + movl %ebp,%edi + roll $5,%ebp + andl %ebx,%esi + xorl %ecx,%ebx + psrld $31,%xmm9 + xorl %ecx,%esi + addl %ebp,%edx + movdqa %xmm8,%xmm10 + rorl $7,%eax + addl %esi,%edx + psrld $30,%xmm8 + por %xmm9,%xmm5 + addl 28(%rsp),%ecx + xorl %ebx,%eax + movl %edx,%esi + roll $5,%edx + pslld $2,%xmm10 + pxor %xmm8,%xmm5 + andl %eax,%edi + xorl %ebx,%eax + movdqa 16(%r11),%xmm8 + xorl %ebx,%edi + addl %edx,%ecx + pxor %xmm10,%xmm5 + rorl $7,%ebp + addl %edi,%ecx + movdqa %xmm3,%xmm6 + addl 32(%rsp),%ebx + xorl %eax,%ebp + movdqa %xmm5,%xmm10 +.byte 102,15,58,15,242,8 + movl %ecx,%edi + roll $5,%ecx + paddd %xmm5,%xmm8 + andl %ebp,%esi + xorl %eax,%ebp + psrldq $4,%xmm10 + xorl %eax,%esi + addl %ecx,%ebx + pxor %xmm2,%xmm6 + rorl $7,%edx + addl %esi,%ebx + pxor %xmm4,%xmm10 + addl 36(%rsp),%eax + xorl %ebp,%edx + movl %ebx,%esi + roll $5,%ebx + pxor %xmm10,%xmm6 + andl %edx,%edi + xorl %ebp,%edx + movdqa %xmm8,16(%rsp) + xorl %ebp,%edi + addl %ebx,%eax + movdqa %xmm6,%xmm9 + movdqa %xmm6,%xmm10 + rorl $7,%ecx + addl %edi,%eax + addl 40(%rsp),%ebp + xorl %edx,%ecx + pslldq $12,%xmm9 + paddd %xmm6,%xmm6 + movl %eax,%edi + roll $5,%eax + andl %ecx,%esi + xorl %edx,%ecx + psrld $31,%xmm10 + xorl %edx,%esi + addl %eax,%ebp + movdqa %xmm9,%xmm8 + rorl $7,%ebx + addl %esi,%ebp + psrld $30,%xmm9 + por %xmm10,%xmm6 + addl 44(%rsp),%edx + xorl %ecx,%ebx + movl %ebp,%esi + roll $5,%ebp + pslld $2,%xmm8 + pxor %xmm9,%xmm6 + andl %ebx,%edi + xorl %ecx,%ebx + movdqa 16(%r11),%xmm9 + xorl %ecx,%edi + addl %ebp,%edx + pxor %xmm8,%xmm6 + rorl $7,%eax + addl %edi,%edx + movdqa %xmm4,%xmm7 + addl 48(%rsp),%ecx + xorl %ebx,%eax + movdqa %xmm6,%xmm8 +.byte 102,15,58,15,251,8 + movl %edx,%edi + roll $5,%edx + paddd %xmm6,%xmm9 + andl %eax,%esi + xorl %ebx,%eax + psrldq $4,%xmm8 + xorl %ebx,%esi + addl %edx,%ecx + pxor %xmm3,%xmm7 + rorl $7,%ebp + addl %esi,%ecx + pxor %xmm5,%xmm8 + addl 52(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%esi + roll $5,%ecx + pxor %xmm8,%xmm7 + andl %ebp,%edi + xorl %eax,%ebp + movdqa %xmm9,32(%rsp) + xorl %eax,%edi + addl %ecx,%ebx + movdqa %xmm7,%xmm10 + movdqa %xmm7,%xmm8 + rorl $7,%edx + addl %edi,%ebx + addl 56(%rsp),%eax + xorl %ebp,%edx + pslldq $12,%xmm10 + paddd %xmm7,%xmm7 + movl %ebx,%edi + roll $5,%ebx + andl %edx,%esi + xorl %ebp,%edx + psrld $31,%xmm8 + xorl %ebp,%esi + addl %ebx,%eax + movdqa %xmm10,%xmm9 + rorl $7,%ecx + addl %esi,%eax + psrld $30,%xmm10 + por %xmm8,%xmm7 + addl 60(%rsp),%ebp + xorl %edx,%ecx + movl %eax,%esi + roll $5,%eax + pslld $2,%xmm9 + pxor %xmm10,%xmm7 + andl %ecx,%edi + xorl %edx,%ecx + movdqa 16(%r11),%xmm10 + xorl %edx,%edi + addl %eax,%ebp + pxor %xmm9,%xmm7 + rorl $7,%ebx + addl %edi,%ebp + movdqa %xmm7,%xmm9 + addl 0(%rsp),%edx + pxor %xmm4,%xmm0 +.byte 102,68,15,58,15,206,8 + xorl %ecx,%ebx + movl %ebp,%edi + roll $5,%ebp + pxor %xmm1,%xmm0 + andl %ebx,%esi + xorl %ecx,%ebx + movdqa %xmm10,%xmm8 + paddd %xmm7,%xmm10 + xorl %ecx,%esi + addl %ebp,%edx + pxor %xmm9,%xmm0 + rorl $7,%eax + addl %esi,%edx + addl 4(%rsp),%ecx + xorl %ebx,%eax + movdqa %xmm0,%xmm9 + movdqa %xmm10,48(%rsp) + movl %edx,%esi + roll $5,%edx + andl %eax,%edi + xorl %ebx,%eax + pslld $2,%xmm0 + xorl %ebx,%edi + addl %edx,%ecx + psrld $30,%xmm9 + rorl $7,%ebp + addl %edi,%ecx + addl 8(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%edi + roll $5,%ecx + por %xmm9,%xmm0 + andl %ebp,%esi + xorl %eax,%ebp + movdqa %xmm0,%xmm10 + xorl %eax,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + addl 12(%rsp),%eax + xorl %ebp,%edx + movl %ebx,%esi + roll $5,%ebx + andl %edx,%edi + xorl %ebp,%edx + xorl %ebp,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + addl 16(%rsp),%ebp + pxor %xmm5,%xmm1 +.byte 102,68,15,58,15,215,8 + xorl %edx,%esi + movl %eax,%edi + roll $5,%eax + pxor %xmm2,%xmm1 + xorl %ecx,%esi + addl %eax,%ebp + movdqa %xmm8,%xmm9 + paddd %xmm0,%xmm8 + rorl $7,%ebx + addl %esi,%ebp + pxor %xmm10,%xmm1 + addl 20(%rsp),%edx + xorl %ecx,%edi + movl %ebp,%esi + roll $5,%ebp + movdqa %xmm1,%xmm10 + movdqa %xmm8,0(%rsp) + xorl %ebx,%edi + addl %ebp,%edx + rorl $7,%eax + addl %edi,%edx + pslld $2,%xmm1 + addl 24(%rsp),%ecx + xorl %ebx,%esi + psrld $30,%xmm10 + movl %edx,%edi + roll $5,%edx + xorl %eax,%esi + addl %edx,%ecx + rorl $7,%ebp + addl %esi,%ecx + por %xmm10,%xmm1 + addl 28(%rsp),%ebx + xorl %eax,%edi + movdqa %xmm1,%xmm8 + movl %ecx,%esi + roll $5,%ecx + xorl %ebp,%edi + addl %ecx,%ebx + rorl $7,%edx + addl %edi,%ebx + addl 32(%rsp),%eax + pxor %xmm6,%xmm2 +.byte 102,68,15,58,15,192,8 + xorl %ebp,%esi + movl %ebx,%edi + roll $5,%ebx + pxor %xmm3,%xmm2 + xorl %edx,%esi + addl %ebx,%eax + movdqa 32(%r11),%xmm10 + paddd %xmm1,%xmm9 + rorl $7,%ecx + addl %esi,%eax + pxor %xmm8,%xmm2 + addl 36(%rsp),%ebp + xorl %edx,%edi + movl %eax,%esi + roll $5,%eax + movdqa %xmm2,%xmm8 + movdqa %xmm9,16(%rsp) + xorl %ecx,%edi + addl %eax,%ebp + rorl $7,%ebx + addl %edi,%ebp + pslld $2,%xmm2 + addl 40(%rsp),%edx + xorl %ecx,%esi + psrld $30,%xmm8 + movl %ebp,%edi + roll $5,%ebp + xorl %ebx,%esi + addl %ebp,%edx + rorl $7,%eax + addl %esi,%edx + por %xmm8,%xmm2 + addl 44(%rsp),%ecx + xorl %ebx,%edi + movdqa %xmm2,%xmm9 + movl %edx,%esi + roll $5,%edx + xorl %eax,%edi + addl %edx,%ecx + rorl $7,%ebp + addl %edi,%ecx + addl 48(%rsp),%ebx + pxor %xmm7,%xmm3 +.byte 102,68,15,58,15,201,8 + xorl %eax,%esi + movl %ecx,%edi + roll $5,%ecx + pxor %xmm4,%xmm3 + xorl %ebp,%esi + addl %ecx,%ebx + movdqa %xmm10,%xmm8 + paddd %xmm2,%xmm10 + rorl $7,%edx + addl %esi,%ebx + pxor %xmm9,%xmm3 + addl 52(%rsp),%eax + xorl %ebp,%edi + movl %ebx,%esi + roll $5,%ebx + movdqa %xmm3,%xmm9 + movdqa %xmm10,32(%rsp) + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + pslld $2,%xmm3 + addl 56(%rsp),%ebp + xorl %edx,%esi + psrld $30,%xmm9 + movl %eax,%edi + roll $5,%eax + xorl %ecx,%esi + addl %eax,%ebp + rorl $7,%ebx + addl %esi,%ebp + por %xmm9,%xmm3 + addl 60(%rsp),%edx + xorl %ecx,%edi + movdqa %xmm3,%xmm10 + movl %ebp,%esi + roll $5,%ebp + xorl %ebx,%edi + addl %ebp,%edx + rorl $7,%eax + addl %edi,%edx + addl 0(%rsp),%ecx + pxor %xmm0,%xmm4 +.byte 102,68,15,58,15,210,8 + xorl %ebx,%esi + movl %edx,%edi + roll $5,%edx + pxor %xmm5,%xmm4 + xorl %eax,%esi + addl %edx,%ecx + movdqa %xmm8,%xmm9 + paddd %xmm3,%xmm8 + rorl $7,%ebp + addl %esi,%ecx + pxor %xmm10,%xmm4 + addl 4(%rsp),%ebx + xorl %eax,%edi + movl %ecx,%esi + roll $5,%ecx + movdqa %xmm4,%xmm10 + movdqa %xmm8,48(%rsp) + xorl %ebp,%edi + addl %ecx,%ebx + rorl $7,%edx + addl %edi,%ebx + pslld $2,%xmm4 + addl 8(%rsp),%eax + xorl %ebp,%esi + psrld $30,%xmm10 + movl %ebx,%edi + roll $5,%ebx + xorl %edx,%esi + addl %ebx,%eax + rorl $7,%ecx + addl %esi,%eax + por %xmm10,%xmm4 + addl 12(%rsp),%ebp + xorl %edx,%edi + movdqa %xmm4,%xmm8 + movl %eax,%esi + roll $5,%eax + xorl %ecx,%edi + addl %eax,%ebp + rorl $7,%ebx + addl %edi,%ebp + addl 16(%rsp),%edx + pxor %xmm1,%xmm5 +.byte 102,68,15,58,15,195,8 + xorl %ecx,%esi + movl %ebp,%edi + roll $5,%ebp + pxor %xmm6,%xmm5 + xorl %ebx,%esi + addl %ebp,%edx + movdqa %xmm9,%xmm10 + paddd %xmm4,%xmm9 + rorl $7,%eax + addl %esi,%edx + pxor %xmm8,%xmm5 + addl 20(%rsp),%ecx + xorl %ebx,%edi + movl %edx,%esi + roll $5,%edx + movdqa %xmm5,%xmm8 + movdqa %xmm9,0(%rsp) + xorl %eax,%edi + addl %edx,%ecx + rorl $7,%ebp + addl %edi,%ecx + pslld $2,%xmm5 + addl 24(%rsp),%ebx + xorl %eax,%esi + psrld $30,%xmm8 + movl %ecx,%edi + roll $5,%ecx + xorl %ebp,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + por %xmm8,%xmm5 + addl 28(%rsp),%eax + xorl %ebp,%edi + movdqa %xmm5,%xmm9 + movl %ebx,%esi + roll $5,%ebx + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + movl %ecx,%edi + pxor %xmm2,%xmm6 +.byte 102,68,15,58,15,204,8 + xorl %edx,%ecx + addl 32(%rsp),%ebp + andl %edx,%edi + pxor %xmm7,%xmm6 + andl %ecx,%esi + rorl $7,%ebx + movdqa %xmm10,%xmm8 + paddd %xmm5,%xmm10 + addl %edi,%ebp + movl %eax,%edi + pxor %xmm9,%xmm6 + roll $5,%eax + addl %esi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + movdqa %xmm6,%xmm9 + movdqa %xmm10,16(%rsp) + movl %ebx,%esi + xorl %ecx,%ebx + addl 36(%rsp),%edx + andl %ecx,%esi + pslld $2,%xmm6 + andl %ebx,%edi + rorl $7,%eax + psrld $30,%xmm9 + addl %esi,%edx + movl %ebp,%esi + roll $5,%ebp + addl %edi,%edx + xorl %ecx,%ebx + addl %ebp,%edx + por %xmm9,%xmm6 + movl %eax,%edi + xorl %ebx,%eax + movdqa %xmm6,%xmm10 + addl 40(%rsp),%ecx + andl %ebx,%edi + andl %eax,%esi + rorl $7,%ebp + addl %edi,%ecx + movl %edx,%edi + roll $5,%edx + addl %esi,%ecx + xorl %ebx,%eax + addl %edx,%ecx + movl %ebp,%esi + xorl %eax,%ebp + addl 44(%rsp),%ebx + andl %eax,%esi + andl %ebp,%edi + rorl $7,%edx + addl %esi,%ebx + movl %ecx,%esi + roll $5,%ecx + addl %edi,%ebx + xorl %eax,%ebp + addl %ecx,%ebx + movl %edx,%edi + pxor %xmm3,%xmm7 +.byte 102,68,15,58,15,213,8 + xorl %ebp,%edx + addl 48(%rsp),%eax + andl %ebp,%edi + pxor %xmm0,%xmm7 + andl %edx,%esi + rorl $7,%ecx + movdqa 48(%r11),%xmm9 + paddd %xmm6,%xmm8 + addl %edi,%eax + movl %ebx,%edi + pxor %xmm10,%xmm7 + roll $5,%ebx + addl %esi,%eax + xorl %ebp,%edx + addl %ebx,%eax + movdqa %xmm7,%xmm10 + movdqa %xmm8,32(%rsp) + movl %ecx,%esi + xorl %edx,%ecx + addl 52(%rsp),%ebp + andl %edx,%esi + pslld $2,%xmm7 + andl %ecx,%edi + rorl $7,%ebx + psrld $30,%xmm10 + addl %esi,%ebp + movl %eax,%esi + roll $5,%eax + addl %edi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + por %xmm10,%xmm7 + movl %ebx,%edi + xorl %ecx,%ebx + movdqa %xmm7,%xmm8 + addl 56(%rsp),%edx + andl %ecx,%edi + andl %ebx,%esi + rorl $7,%eax + addl %edi,%edx + movl %ebp,%edi + roll $5,%ebp + addl %esi,%edx + xorl %ecx,%ebx + addl %ebp,%edx + movl %eax,%esi + xorl %ebx,%eax + addl 60(%rsp),%ecx + andl %ebx,%esi + andl %eax,%edi + rorl $7,%ebp + addl %esi,%ecx + movl %edx,%esi + roll $5,%edx + addl %edi,%ecx + xorl %ebx,%eax + addl %edx,%ecx + movl %ebp,%edi + pxor %xmm4,%xmm0 +.byte 102,68,15,58,15,198,8 + xorl %eax,%ebp + addl 0(%rsp),%ebx + andl %eax,%edi + pxor %xmm1,%xmm0 + andl %ebp,%esi + rorl $7,%edx + movdqa %xmm9,%xmm10 + paddd %xmm7,%xmm9 + addl %edi,%ebx + movl %ecx,%edi + pxor %xmm8,%xmm0 + roll $5,%ecx + addl %esi,%ebx + xorl %eax,%ebp + addl %ecx,%ebx + movdqa %xmm0,%xmm8 + movdqa %xmm9,48(%rsp) + movl %edx,%esi + xorl %ebp,%edx + addl 4(%rsp),%eax + andl %ebp,%esi + pslld $2,%xmm0 + andl %edx,%edi + rorl $7,%ecx + psrld $30,%xmm8 + addl %esi,%eax + movl %ebx,%esi + roll $5,%ebx + addl %edi,%eax + xorl %ebp,%edx + addl %ebx,%eax + por %xmm8,%xmm0 + movl %ecx,%edi + xorl %edx,%ecx + movdqa %xmm0,%xmm9 + addl 8(%rsp),%ebp + andl %edx,%edi + andl %ecx,%esi + rorl $7,%ebx + addl %edi,%ebp + movl %eax,%edi + roll $5,%eax + addl %esi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + movl %ebx,%esi + xorl %ecx,%ebx + addl 12(%rsp),%edx + andl %ecx,%esi + andl %ebx,%edi + rorl $7,%eax + addl %esi,%edx + movl %ebp,%esi + roll $5,%ebp + addl %edi,%edx + xorl %ecx,%ebx + addl %ebp,%edx + movl %eax,%edi + pxor %xmm5,%xmm1 +.byte 102,68,15,58,15,207,8 + xorl %ebx,%eax + addl 16(%rsp),%ecx + andl %ebx,%edi + pxor %xmm2,%xmm1 + andl %eax,%esi + rorl $7,%ebp + movdqa %xmm10,%xmm8 + paddd %xmm0,%xmm10 + addl %edi,%ecx + movl %edx,%edi + pxor %xmm9,%xmm1 + roll $5,%edx + addl %esi,%ecx + xorl %ebx,%eax + addl %edx,%ecx + movdqa %xmm1,%xmm9 + movdqa %xmm10,0(%rsp) + movl %ebp,%esi + xorl %eax,%ebp + addl 20(%rsp),%ebx + andl %eax,%esi + pslld $2,%xmm1 + andl %ebp,%edi + rorl $7,%edx + psrld $30,%xmm9 + addl %esi,%ebx + movl %ecx,%esi + roll $5,%ecx + addl %edi,%ebx + xorl %eax,%ebp + addl %ecx,%ebx + por %xmm9,%xmm1 + movl %edx,%edi + xorl %ebp,%edx + movdqa %xmm1,%xmm10 + addl 24(%rsp),%eax + andl %ebp,%edi + andl %edx,%esi + rorl $7,%ecx + addl %edi,%eax + movl %ebx,%edi + roll $5,%ebx + addl %esi,%eax + xorl %ebp,%edx + addl %ebx,%eax + movl %ecx,%esi + xorl %edx,%ecx + addl 28(%rsp),%ebp + andl %edx,%esi + andl %ecx,%edi + rorl $7,%ebx + addl %esi,%ebp + movl %eax,%esi + roll $5,%eax + addl %edi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + movl %ebx,%edi + pxor %xmm6,%xmm2 +.byte 102,68,15,58,15,208,8 + xorl %ecx,%ebx + addl 32(%rsp),%edx + andl %ecx,%edi + pxor %xmm3,%xmm2 + andl %ebx,%esi + rorl $7,%eax + movdqa %xmm8,%xmm9 + paddd %xmm1,%xmm8 + addl %edi,%edx + movl %ebp,%edi + pxor %xmm10,%xmm2 + roll $5,%ebp + addl %esi,%edx + xorl %ecx,%ebx + addl %ebp,%edx + movdqa %xmm2,%xmm10 + movdqa %xmm8,16(%rsp) + movl %eax,%esi + xorl %ebx,%eax + addl 36(%rsp),%ecx + andl %ebx,%esi + pslld $2,%xmm2 + andl %eax,%edi + rorl $7,%ebp + psrld $30,%xmm10 + addl %esi,%ecx + movl %edx,%esi + roll $5,%edx + addl %edi,%ecx + xorl %ebx,%eax + addl %edx,%ecx + por %xmm10,%xmm2 + movl %ebp,%edi + xorl %eax,%ebp + movdqa %xmm2,%xmm8 + addl 40(%rsp),%ebx + andl %eax,%edi + andl %ebp,%esi + rorl $7,%edx + addl %edi,%ebx + movl %ecx,%edi + roll $5,%ecx + addl %esi,%ebx + xorl %eax,%ebp + addl %ecx,%ebx + movl %edx,%esi + xorl %ebp,%edx + addl 44(%rsp),%eax + andl %ebp,%esi + andl %edx,%edi + rorl $7,%ecx + addl %esi,%eax + movl %ebx,%esi + roll $5,%ebx + addl %edi,%eax + xorl %ebp,%edx + addl %ebx,%eax + addl 48(%rsp),%ebp + pxor %xmm7,%xmm3 +.byte 102,68,15,58,15,193,8 + xorl %edx,%esi + movl %eax,%edi + roll $5,%eax + pxor %xmm4,%xmm3 + xorl %ecx,%esi + addl %eax,%ebp + movdqa %xmm9,%xmm10 + paddd %xmm2,%xmm9 + rorl $7,%ebx + addl %esi,%ebp + pxor %xmm8,%xmm3 + addl 52(%rsp),%edx + xorl %ecx,%edi + movl %ebp,%esi + roll $5,%ebp + movdqa %xmm3,%xmm8 + movdqa %xmm9,32(%rsp) + xorl %ebx,%edi + addl %ebp,%edx + rorl $7,%eax + addl %edi,%edx + pslld $2,%xmm3 + addl 56(%rsp),%ecx + xorl %ebx,%esi + psrld $30,%xmm8 + movl %edx,%edi + roll $5,%edx + xorl %eax,%esi + addl %edx,%ecx + rorl $7,%ebp + addl %esi,%ecx + por %xmm8,%xmm3 + addl 60(%rsp),%ebx + xorl %eax,%edi + movl %ecx,%esi + roll $5,%ecx + xorl %ebp,%edi + addl %ecx,%ebx + rorl $7,%edx + addl %edi,%ebx + addl 0(%rsp),%eax + paddd %xmm3,%xmm10 + xorl %ebp,%esi + movl %ebx,%edi + roll $5,%ebx + xorl %edx,%esi + movdqa %xmm10,48(%rsp) + addl %ebx,%eax + rorl $7,%ecx + addl %esi,%eax + addl 4(%rsp),%ebp + xorl %edx,%edi + movl %eax,%esi + roll $5,%eax + xorl %ecx,%edi + addl %eax,%ebp + rorl $7,%ebx + addl %edi,%ebp + addl 8(%rsp),%edx + xorl %ecx,%esi + movl %ebp,%edi + roll $5,%ebp + xorl %ebx,%esi + addl %ebp,%edx + rorl $7,%eax + addl %esi,%edx + addl 12(%rsp),%ecx + xorl %ebx,%edi + movl %edx,%esi + roll $5,%edx + xorl %eax,%edi + addl %edx,%ecx + rorl $7,%ebp + addl %edi,%ecx + cmpq %r10,%r9 + je .Ldone_ssse3 + movdqa 64(%r11),%xmm6 + movdqa 0(%r11),%xmm9 + movdqu 0(%r9),%xmm0 + movdqu 16(%r9),%xmm1 + movdqu 32(%r9),%xmm2 + movdqu 48(%r9),%xmm3 +.byte 102,15,56,0,198 + addq $64,%r9 + addl 16(%rsp),%ebx + xorl %eax,%esi +.byte 102,15,56,0,206 + movl %ecx,%edi + roll $5,%ecx + paddd %xmm9,%xmm0 + xorl %ebp,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + movdqa %xmm0,0(%rsp) + addl 20(%rsp),%eax + xorl %ebp,%edi + psubd %xmm9,%xmm0 + movl %ebx,%esi + roll $5,%ebx + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + addl 24(%rsp),%ebp + xorl %edx,%esi + movl %eax,%edi + roll $5,%eax + xorl %ecx,%esi + addl %eax,%ebp + rorl $7,%ebx + addl %esi,%ebp + addl 28(%rsp),%edx + xorl %ecx,%edi + movl %ebp,%esi + roll $5,%ebp + xorl %ebx,%edi + addl %ebp,%edx + rorl $7,%eax + addl %edi,%edx + addl 32(%rsp),%ecx + xorl %ebx,%esi +.byte 102,15,56,0,214 + movl %edx,%edi + roll $5,%edx + paddd %xmm9,%xmm1 + xorl %eax,%esi + addl %edx,%ecx + rorl $7,%ebp + addl %esi,%ecx + movdqa %xmm1,16(%rsp) + addl 36(%rsp),%ebx + xorl %eax,%edi + psubd %xmm9,%xmm1 + movl %ecx,%esi + roll $5,%ecx + xorl %ebp,%edi + addl %ecx,%ebx + rorl $7,%edx + addl %edi,%ebx + addl 40(%rsp),%eax + xorl %ebp,%esi + movl %ebx,%edi + roll $5,%ebx + xorl %edx,%esi + addl %ebx,%eax + rorl $7,%ecx + addl %esi,%eax + addl 44(%rsp),%ebp + xorl %edx,%edi + movl %eax,%esi + roll $5,%eax + xorl %ecx,%edi + addl %eax,%ebp + rorl $7,%ebx + addl %edi,%ebp + addl 48(%rsp),%edx + xorl %ecx,%esi +.byte 102,15,56,0,222 + movl %ebp,%edi + roll $5,%ebp + paddd %xmm9,%xmm2 + xorl %ebx,%esi + addl %ebp,%edx + rorl $7,%eax + addl %esi,%edx + movdqa %xmm2,32(%rsp) + addl 52(%rsp),%ecx + xorl %ebx,%edi + psubd %xmm9,%xmm2 + movl %edx,%esi + roll $5,%edx + xorl %eax,%edi + addl %edx,%ecx + rorl $7,%ebp + addl %edi,%ecx + addl 56(%rsp),%ebx + xorl %eax,%esi + movl %ecx,%edi + roll $5,%ecx + xorl %ebp,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + addl 60(%rsp),%eax + xorl %ebp,%edi + movl %ebx,%esi + roll $5,%ebx + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + addl 0(%r8),%eax + addl 4(%r8),%esi + addl 8(%r8),%ecx + addl 12(%r8),%edx + movl %eax,0(%r8) + addl 16(%r8),%ebp + movl %esi,4(%r8) + movl %esi,%ebx + movl %ecx,8(%r8) + movl %edx,12(%r8) + movl %ebp,16(%r8) + jmp .Loop_ssse3 + +.p2align 4 +.Ldone_ssse3: + addl 16(%rsp),%ebx + xorl %eax,%esi + movl %ecx,%edi + roll $5,%ecx + xorl %ebp,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + addl 20(%rsp),%eax + xorl %ebp,%edi + movl %ebx,%esi + roll $5,%ebx + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + addl 24(%rsp),%ebp + xorl %edx,%esi + movl %eax,%edi + roll $5,%eax + xorl %ecx,%esi + addl %eax,%ebp + rorl $7,%ebx + addl %esi,%ebp + addl 28(%rsp),%edx + xorl %ecx,%edi + movl %ebp,%esi + roll $5,%ebp + xorl %ebx,%edi + addl %ebp,%edx + rorl $7,%eax + addl %edi,%edx + addl 32(%rsp),%ecx + xorl %ebx,%esi + movl %edx,%edi + roll $5,%edx + xorl %eax,%esi + addl %edx,%ecx + rorl $7,%ebp + addl %esi,%ecx + addl 36(%rsp),%ebx + xorl %eax,%edi + movl %ecx,%esi + roll $5,%ecx + xorl %ebp,%edi + addl %ecx,%ebx + rorl $7,%edx + addl %edi,%ebx + addl 40(%rsp),%eax + xorl %ebp,%esi + movl %ebx,%edi + roll $5,%ebx + xorl %edx,%esi + addl %ebx,%eax + rorl $7,%ecx + addl %esi,%eax + addl 44(%rsp),%ebp + xorl %edx,%edi + movl %eax,%esi + roll $5,%eax + xorl %ecx,%edi + addl %eax,%ebp + rorl $7,%ebx + addl %edi,%ebp + addl 48(%rsp),%edx + xorl %ecx,%esi + movl %ebp,%edi + roll $5,%ebp + xorl %ebx,%esi + addl %ebp,%edx + rorl $7,%eax + addl %esi,%edx + addl 52(%rsp),%ecx + xorl %ebx,%edi + movl %edx,%esi + roll $5,%edx + xorl %eax,%edi + addl %edx,%ecx + rorl $7,%ebp + addl %edi,%ecx + addl 56(%rsp),%ebx + xorl %eax,%esi + movl %ecx,%edi + roll $5,%ecx + xorl %ebp,%esi + addl %ecx,%ebx + rorl $7,%edx + addl %esi,%ebx + addl 60(%rsp),%eax + xorl %ebp,%edi + movl %ebx,%esi + roll $5,%ebx + xorl %edx,%edi + addl %ebx,%eax + rorl $7,%ecx + addl %edi,%eax + addl 0(%r8),%eax + addl 4(%r8),%esi + addl 8(%r8),%ecx + movl %eax,0(%r8) + addl 12(%r8),%edx + movl %esi,4(%r8) + addl 16(%r8),%ebp + movl %ecx,8(%r8) + movl %edx,12(%r8) + movl %ebp,16(%r8) + movaps 64+0(%rsp),%xmm6 + movaps 64+16(%rsp),%xmm7 + movaps 64+32(%rsp),%xmm8 + movaps 64+48(%rsp),%xmm9 + movaps 64+64(%rsp),%xmm10 + leaq 144(%rsp),%rsi + movq 0(%rsi),%r12 + movq 8(%rsi),%rbp + movq 16(%rsi),%rbx + leaq 24(%rsi),%rsp +.Lepilogue_ssse3: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_sha1_block_data_order_ssse3: +.p2align 6 +K_XX_XX: +.long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 +.long 0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1 +.long 0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc +.long 0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6 +.long 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f +.byte 83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 +.p2align 6 + +.def se_handler; .scl 3; .type 32; .endef +.p2align 4 +se_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + leaq .Lprologue(%rip),%r10 + cmpq %r10,%rbx + jb .Lcommon_seh_tail + + movq 152(%r8),%rax + + leaq .Lepilogue(%rip),%r10 + cmpq %r10,%rbx + jae .Lcommon_seh_tail + + movq 64(%rax),%rax + leaq 32(%rax),%rax + + movq -8(%rax),%rbx + movq -16(%rax),%rbp + movq -24(%rax),%r12 + movq -32(%rax),%r13 + movq %rbx,144(%r8) + movq %rbp,160(%r8) + movq %r12,216(%r8) + movq %r13,224(%r8) + + jmp .Lcommon_seh_tail + + +.def ssse3_handler; .scl 3; .type 32; .endef +.p2align 4 +ssse3_handler: + pushq %rsi + pushq %rdi + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + pushfq + subq $64,%rsp + + movq 120(%r8),%rax + movq 248(%r8),%rbx + + movq 8(%r9),%rsi + movq 56(%r9),%r11 + + movl 0(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jb .Lcommon_seh_tail + + movq 152(%r8),%rax + + movl 4(%r11),%r10d + leaq (%rsi,%r10,1),%r10 + cmpq %r10,%rbx + jae .Lcommon_seh_tail + + leaq 64(%rax),%rsi + leaq 512(%r8),%rdi + movl $10,%ecx +.long 0xa548f3fc + leaq 168(%rax),%rax + + movq -8(%rax),%rbx + movq -16(%rax),%rbp + movq -24(%rax),%r12 + movq %rbx,144(%r8) + movq %rbp,160(%r8) + movq %r12,216(%r8) + +.Lcommon_seh_tail: + movq 8(%rax),%rdi + movq 16(%rax),%rsi + movq %rax,152(%r8) + movq %rsi,168(%r8) + movq %rdi,176(%r8) + + movq 40(%r9),%rdi + movq %r8,%rsi + movl $154,%ecx +.long 0xa548f3fc + + movq %r9,%rsi + xorq %rcx,%rcx + movq 8(%rsi),%rdx + movq 0(%rsi),%r8 + movq 16(%rsi),%r9 + movq 40(%rsi),%r10 + leaq 56(%rsi),%r11 + leaq 24(%rsi),%r12 + movq %r10,32(%rsp) + movq %r11,40(%rsp) + movq %r12,48(%rsp) + movq %rcx,56(%rsp) + call *__imp_RtlVirtualUnwind(%rip) + + movl $1,%eax + addq $64,%rsp + popfq + popq %r15 + popq %r14 + popq %r13 + popq %r12 + popq %rbp + popq %rbx + popq %rdi + popq %rsi + retq + + +.section .pdata +.p2align 2 +.rva .LSEH_begin_sha1_block_data_order +.rva .LSEH_end_sha1_block_data_order +.rva .LSEH_info_sha1_block_data_order +.rva .LSEH_begin_sha1_block_data_order_ssse3 +.rva .LSEH_end_sha1_block_data_order_ssse3 +.rva .LSEH_info_sha1_block_data_order_ssse3 +.section .xdata +.p2align 3 +.LSEH_info_sha1_block_data_order: +.byte 9,0,0,0 +.rva se_handler +.LSEH_info_sha1_block_data_order_ssse3: +.byte 9,0,0,0 +.rva ssse3_handler +.rva .Lprologue_ssse3,.Lepilogue_ssse3 diff --git a/crypto/sha/sha256-elf-armv4.S b/crypto/sha/sha256-elf-armv4.S new file mode 100644 index 00000000..9b155c7d --- /dev/null +++ b/crypto/sha/sha256-elf-armv4.S @@ -0,0 +1,1520 @@ +#include "arm_arch.h" + +.text +.code 32 + +.type K256,%object +.align 5 +K256: +.word 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5 +.word 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5 +.word 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3 +.word 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174 +.word 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc +.word 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da +.word 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7 +.word 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967 +.word 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13 +.word 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85 +.word 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3 +.word 0xd192e819,0xd6990624,0xf40e3585,0x106aa070 +.word 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5 +.word 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3 +.word 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208 +.word 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 +.size K256,.-K256 + +.global sha256_block_data_order +.type sha256_block_data_order,%function +sha256_block_data_order: + sub r3,pc,#8 @ sha256_block_data_order + add r2,r1,r2,lsl#6 @ len to point at the end of inp + stmdb sp!,{r0,r1,r2,r4-r11,lr} + ldmia r0,{r4,r5,r6,r7,r8,r9,r10,r11} + sub r14,r3,#256 @ K256 + sub sp,sp,#16*4 @ alloca(X[16]) +.Loop: +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 0 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r8,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r8,ror#11 + eor r2,r9,r10 +#if 0>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 0==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r8,ror#25 @ Sigma1(e) + and r2,r2,r8 + str r3,[sp,#0*4] + add r3,r3,r0 + eor r2,r2,r10 @ Ch(e,f,g) + add r3,r3,r11 + mov r11,r4,ror#2 + add r3,r3,r2 + eor r11,r11,r4,ror#13 + add r3,r3,r12 + eor r11,r11,r4,ror#22 @ Sigma0(a) +#if 0>=15 + ldr r1,[sp,#2*4] @ from BODY_16_xx +#endif + orr r0,r4,r5 + and r2,r4,r5 + and r0,r0,r6 + add r11,r11,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r7,r7,r3 + add r11,r11,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 1 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r7,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r7,ror#11 + eor r2,r8,r9 +#if 1>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 1==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r7,ror#25 @ Sigma1(e) + and r2,r2,r7 + str r3,[sp,#1*4] + add r3,r3,r0 + eor r2,r2,r9 @ Ch(e,f,g) + add r3,r3,r10 + mov r10,r11,ror#2 + add r3,r3,r2 + eor r10,r10,r11,ror#13 + add r3,r3,r12 + eor r10,r10,r11,ror#22 @ Sigma0(a) +#if 1>=15 + ldr r1,[sp,#3*4] @ from BODY_16_xx +#endif + orr r0,r11,r4 + and r2,r11,r4 + and r0,r0,r5 + add r10,r10,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r6,r6,r3 + add r10,r10,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 2 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r6,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r6,ror#11 + eor r2,r7,r8 +#if 2>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 2==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r6,ror#25 @ Sigma1(e) + and r2,r2,r6 + str r3,[sp,#2*4] + add r3,r3,r0 + eor r2,r2,r8 @ Ch(e,f,g) + add r3,r3,r9 + mov r9,r10,ror#2 + add r3,r3,r2 + eor r9,r9,r10,ror#13 + add r3,r3,r12 + eor r9,r9,r10,ror#22 @ Sigma0(a) +#if 2>=15 + ldr r1,[sp,#4*4] @ from BODY_16_xx +#endif + orr r0,r10,r11 + and r2,r10,r11 + and r0,r0,r4 + add r9,r9,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r5,r5,r3 + add r9,r9,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 3 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r5,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r5,ror#11 + eor r2,r6,r7 +#if 3>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 3==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r5,ror#25 @ Sigma1(e) + and r2,r2,r5 + str r3,[sp,#3*4] + add r3,r3,r0 + eor r2,r2,r7 @ Ch(e,f,g) + add r3,r3,r8 + mov r8,r9,ror#2 + add r3,r3,r2 + eor r8,r8,r9,ror#13 + add r3,r3,r12 + eor r8,r8,r9,ror#22 @ Sigma0(a) +#if 3>=15 + ldr r1,[sp,#5*4] @ from BODY_16_xx +#endif + orr r0,r9,r10 + and r2,r9,r10 + and r0,r0,r11 + add r8,r8,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r4,r4,r3 + add r8,r8,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 4 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r4,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r4,ror#11 + eor r2,r5,r6 +#if 4>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 4==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r4,ror#25 @ Sigma1(e) + and r2,r2,r4 + str r3,[sp,#4*4] + add r3,r3,r0 + eor r2,r2,r6 @ Ch(e,f,g) + add r3,r3,r7 + mov r7,r8,ror#2 + add r3,r3,r2 + eor r7,r7,r8,ror#13 + add r3,r3,r12 + eor r7,r7,r8,ror#22 @ Sigma0(a) +#if 4>=15 + ldr r1,[sp,#6*4] @ from BODY_16_xx +#endif + orr r0,r8,r9 + and r2,r8,r9 + and r0,r0,r10 + add r7,r7,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r11,r11,r3 + add r7,r7,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 5 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r11,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r11,ror#11 + eor r2,r4,r5 +#if 5>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 5==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r11,ror#25 @ Sigma1(e) + and r2,r2,r11 + str r3,[sp,#5*4] + add r3,r3,r0 + eor r2,r2,r5 @ Ch(e,f,g) + add r3,r3,r6 + mov r6,r7,ror#2 + add r3,r3,r2 + eor r6,r6,r7,ror#13 + add r3,r3,r12 + eor r6,r6,r7,ror#22 @ Sigma0(a) +#if 5>=15 + ldr r1,[sp,#7*4] @ from BODY_16_xx +#endif + orr r0,r7,r8 + and r2,r7,r8 + and r0,r0,r9 + add r6,r6,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r10,r10,r3 + add r6,r6,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 6 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r10,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r10,ror#11 + eor r2,r11,r4 +#if 6>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 6==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r10,ror#25 @ Sigma1(e) + and r2,r2,r10 + str r3,[sp,#6*4] + add r3,r3,r0 + eor r2,r2,r4 @ Ch(e,f,g) + add r3,r3,r5 + mov r5,r6,ror#2 + add r3,r3,r2 + eor r5,r5,r6,ror#13 + add r3,r3,r12 + eor r5,r5,r6,ror#22 @ Sigma0(a) +#if 6>=15 + ldr r1,[sp,#8*4] @ from BODY_16_xx +#endif + orr r0,r6,r7 + and r2,r6,r7 + and r0,r0,r8 + add r5,r5,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r9,r9,r3 + add r5,r5,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 7 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r9,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r9,ror#11 + eor r2,r10,r11 +#if 7>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 7==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r9,ror#25 @ Sigma1(e) + and r2,r2,r9 + str r3,[sp,#7*4] + add r3,r3,r0 + eor r2,r2,r11 @ Ch(e,f,g) + add r3,r3,r4 + mov r4,r5,ror#2 + add r3,r3,r2 + eor r4,r4,r5,ror#13 + add r3,r3,r12 + eor r4,r4,r5,ror#22 @ Sigma0(a) +#if 7>=15 + ldr r1,[sp,#9*4] @ from BODY_16_xx +#endif + orr r0,r5,r6 + and r2,r5,r6 + and r0,r0,r7 + add r4,r4,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r8,r8,r3 + add r4,r4,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 8 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r8,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r8,ror#11 + eor r2,r9,r10 +#if 8>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 8==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r8,ror#25 @ Sigma1(e) + and r2,r2,r8 + str r3,[sp,#8*4] + add r3,r3,r0 + eor r2,r2,r10 @ Ch(e,f,g) + add r3,r3,r11 + mov r11,r4,ror#2 + add r3,r3,r2 + eor r11,r11,r4,ror#13 + add r3,r3,r12 + eor r11,r11,r4,ror#22 @ Sigma0(a) +#if 8>=15 + ldr r1,[sp,#10*4] @ from BODY_16_xx +#endif + orr r0,r4,r5 + and r2,r4,r5 + and r0,r0,r6 + add r11,r11,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r7,r7,r3 + add r11,r11,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 9 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r7,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r7,ror#11 + eor r2,r8,r9 +#if 9>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 9==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r7,ror#25 @ Sigma1(e) + and r2,r2,r7 + str r3,[sp,#9*4] + add r3,r3,r0 + eor r2,r2,r9 @ Ch(e,f,g) + add r3,r3,r10 + mov r10,r11,ror#2 + add r3,r3,r2 + eor r10,r10,r11,ror#13 + add r3,r3,r12 + eor r10,r10,r11,ror#22 @ Sigma0(a) +#if 9>=15 + ldr r1,[sp,#11*4] @ from BODY_16_xx +#endif + orr r0,r11,r4 + and r2,r11,r4 + and r0,r0,r5 + add r10,r10,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r6,r6,r3 + add r10,r10,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 10 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r6,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r6,ror#11 + eor r2,r7,r8 +#if 10>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 10==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r6,ror#25 @ Sigma1(e) + and r2,r2,r6 + str r3,[sp,#10*4] + add r3,r3,r0 + eor r2,r2,r8 @ Ch(e,f,g) + add r3,r3,r9 + mov r9,r10,ror#2 + add r3,r3,r2 + eor r9,r9,r10,ror#13 + add r3,r3,r12 + eor r9,r9,r10,ror#22 @ Sigma0(a) +#if 10>=15 + ldr r1,[sp,#12*4] @ from BODY_16_xx +#endif + orr r0,r10,r11 + and r2,r10,r11 + and r0,r0,r4 + add r9,r9,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r5,r5,r3 + add r9,r9,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 11 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r5,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r5,ror#11 + eor r2,r6,r7 +#if 11>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 11==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r5,ror#25 @ Sigma1(e) + and r2,r2,r5 + str r3,[sp,#11*4] + add r3,r3,r0 + eor r2,r2,r7 @ Ch(e,f,g) + add r3,r3,r8 + mov r8,r9,ror#2 + add r3,r3,r2 + eor r8,r8,r9,ror#13 + add r3,r3,r12 + eor r8,r8,r9,ror#22 @ Sigma0(a) +#if 11>=15 + ldr r1,[sp,#13*4] @ from BODY_16_xx +#endif + orr r0,r9,r10 + and r2,r9,r10 + and r0,r0,r11 + add r8,r8,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r4,r4,r3 + add r8,r8,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 12 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r4,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r4,ror#11 + eor r2,r5,r6 +#if 12>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 12==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r4,ror#25 @ Sigma1(e) + and r2,r2,r4 + str r3,[sp,#12*4] + add r3,r3,r0 + eor r2,r2,r6 @ Ch(e,f,g) + add r3,r3,r7 + mov r7,r8,ror#2 + add r3,r3,r2 + eor r7,r7,r8,ror#13 + add r3,r3,r12 + eor r7,r7,r8,ror#22 @ Sigma0(a) +#if 12>=15 + ldr r1,[sp,#14*4] @ from BODY_16_xx +#endif + orr r0,r8,r9 + and r2,r8,r9 + and r0,r0,r10 + add r7,r7,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r11,r11,r3 + add r7,r7,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 13 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r11,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r11,ror#11 + eor r2,r4,r5 +#if 13>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 13==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r11,ror#25 @ Sigma1(e) + and r2,r2,r11 + str r3,[sp,#13*4] + add r3,r3,r0 + eor r2,r2,r5 @ Ch(e,f,g) + add r3,r3,r6 + mov r6,r7,ror#2 + add r3,r3,r2 + eor r6,r6,r7,ror#13 + add r3,r3,r12 + eor r6,r6,r7,ror#22 @ Sigma0(a) +#if 13>=15 + ldr r1,[sp,#15*4] @ from BODY_16_xx +#endif + orr r0,r7,r8 + and r2,r7,r8 + and r0,r0,r9 + add r6,r6,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r10,r10,r3 + add r6,r6,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 14 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r10,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r10,ror#11 + eor r2,r11,r4 +#if 14>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 14==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r10,ror#25 @ Sigma1(e) + and r2,r2,r10 + str r3,[sp,#14*4] + add r3,r3,r0 + eor r2,r2,r4 @ Ch(e,f,g) + add r3,r3,r5 + mov r5,r6,ror#2 + add r3,r3,r2 + eor r5,r5,r6,ror#13 + add r3,r3,r12 + eor r5,r5,r6,ror#22 @ Sigma0(a) +#if 14>=15 + ldr r1,[sp,#0*4] @ from BODY_16_xx +#endif + orr r0,r6,r7 + and r2,r6,r7 + and r0,r0,r8 + add r5,r5,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r9,r9,r3 + add r5,r5,r0 +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r3,[r1],#4 +#else + ldrb r3,[r1,#3] @ 15 + ldrb r12,[r1,#2] + ldrb r2,[r1,#1] + ldrb r0,[r1],#4 + orr r3,r3,r12,lsl#8 + orr r3,r3,r2,lsl#16 + orr r3,r3,r0,lsl#24 +#endif + mov r0,r9,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r9,ror#11 + eor r2,r10,r11 +#if 15>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 15==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r9,ror#25 @ Sigma1(e) + and r2,r2,r9 + str r3,[sp,#15*4] + add r3,r3,r0 + eor r2,r2,r11 @ Ch(e,f,g) + add r3,r3,r4 + mov r4,r5,ror#2 + add r3,r3,r2 + eor r4,r4,r5,ror#13 + add r3,r3,r12 + eor r4,r4,r5,ror#22 @ Sigma0(a) +#if 15>=15 + ldr r1,[sp,#1*4] @ from BODY_16_xx +#endif + orr r0,r5,r6 + and r2,r5,r6 + and r0,r0,r7 + add r4,r4,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r8,r8,r3 + add r4,r4,r0 +.Lrounds_16_xx: + @ ldr r1,[sp,#1*4] @ 16 + ldr r12,[sp,#14*4] + mov r0,r1,ror#7 + ldr r3,[sp,#0*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#9*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r8,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r8,ror#11 + eor r2,r9,r10 +#if 16>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 16==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r8,ror#25 @ Sigma1(e) + and r2,r2,r8 + str r3,[sp,#0*4] + add r3,r3,r0 + eor r2,r2,r10 @ Ch(e,f,g) + add r3,r3,r11 + mov r11,r4,ror#2 + add r3,r3,r2 + eor r11,r11,r4,ror#13 + add r3,r3,r12 + eor r11,r11,r4,ror#22 @ Sigma0(a) +#if 16>=15 + ldr r1,[sp,#2*4] @ from BODY_16_xx +#endif + orr r0,r4,r5 + and r2,r4,r5 + and r0,r0,r6 + add r11,r11,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r7,r7,r3 + add r11,r11,r0 + @ ldr r1,[sp,#2*4] @ 17 + ldr r12,[sp,#15*4] + mov r0,r1,ror#7 + ldr r3,[sp,#1*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#10*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r7,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r7,ror#11 + eor r2,r8,r9 +#if 17>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 17==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r7,ror#25 @ Sigma1(e) + and r2,r2,r7 + str r3,[sp,#1*4] + add r3,r3,r0 + eor r2,r2,r9 @ Ch(e,f,g) + add r3,r3,r10 + mov r10,r11,ror#2 + add r3,r3,r2 + eor r10,r10,r11,ror#13 + add r3,r3,r12 + eor r10,r10,r11,ror#22 @ Sigma0(a) +#if 17>=15 + ldr r1,[sp,#3*4] @ from BODY_16_xx +#endif + orr r0,r11,r4 + and r2,r11,r4 + and r0,r0,r5 + add r10,r10,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r6,r6,r3 + add r10,r10,r0 + @ ldr r1,[sp,#3*4] @ 18 + ldr r12,[sp,#0*4] + mov r0,r1,ror#7 + ldr r3,[sp,#2*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#11*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r6,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r6,ror#11 + eor r2,r7,r8 +#if 18>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 18==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r6,ror#25 @ Sigma1(e) + and r2,r2,r6 + str r3,[sp,#2*4] + add r3,r3,r0 + eor r2,r2,r8 @ Ch(e,f,g) + add r3,r3,r9 + mov r9,r10,ror#2 + add r3,r3,r2 + eor r9,r9,r10,ror#13 + add r3,r3,r12 + eor r9,r9,r10,ror#22 @ Sigma0(a) +#if 18>=15 + ldr r1,[sp,#4*4] @ from BODY_16_xx +#endif + orr r0,r10,r11 + and r2,r10,r11 + and r0,r0,r4 + add r9,r9,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r5,r5,r3 + add r9,r9,r0 + @ ldr r1,[sp,#4*4] @ 19 + ldr r12,[sp,#1*4] + mov r0,r1,ror#7 + ldr r3,[sp,#3*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#12*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r5,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r5,ror#11 + eor r2,r6,r7 +#if 19>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 19==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r5,ror#25 @ Sigma1(e) + and r2,r2,r5 + str r3,[sp,#3*4] + add r3,r3,r0 + eor r2,r2,r7 @ Ch(e,f,g) + add r3,r3,r8 + mov r8,r9,ror#2 + add r3,r3,r2 + eor r8,r8,r9,ror#13 + add r3,r3,r12 + eor r8,r8,r9,ror#22 @ Sigma0(a) +#if 19>=15 + ldr r1,[sp,#5*4] @ from BODY_16_xx +#endif + orr r0,r9,r10 + and r2,r9,r10 + and r0,r0,r11 + add r8,r8,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r4,r4,r3 + add r8,r8,r0 + @ ldr r1,[sp,#5*4] @ 20 + ldr r12,[sp,#2*4] + mov r0,r1,ror#7 + ldr r3,[sp,#4*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#13*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r4,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r4,ror#11 + eor r2,r5,r6 +#if 20>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 20==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r4,ror#25 @ Sigma1(e) + and r2,r2,r4 + str r3,[sp,#4*4] + add r3,r3,r0 + eor r2,r2,r6 @ Ch(e,f,g) + add r3,r3,r7 + mov r7,r8,ror#2 + add r3,r3,r2 + eor r7,r7,r8,ror#13 + add r3,r3,r12 + eor r7,r7,r8,ror#22 @ Sigma0(a) +#if 20>=15 + ldr r1,[sp,#6*4] @ from BODY_16_xx +#endif + orr r0,r8,r9 + and r2,r8,r9 + and r0,r0,r10 + add r7,r7,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r11,r11,r3 + add r7,r7,r0 + @ ldr r1,[sp,#6*4] @ 21 + ldr r12,[sp,#3*4] + mov r0,r1,ror#7 + ldr r3,[sp,#5*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#14*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r11,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r11,ror#11 + eor r2,r4,r5 +#if 21>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 21==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r11,ror#25 @ Sigma1(e) + and r2,r2,r11 + str r3,[sp,#5*4] + add r3,r3,r0 + eor r2,r2,r5 @ Ch(e,f,g) + add r3,r3,r6 + mov r6,r7,ror#2 + add r3,r3,r2 + eor r6,r6,r7,ror#13 + add r3,r3,r12 + eor r6,r6,r7,ror#22 @ Sigma0(a) +#if 21>=15 + ldr r1,[sp,#7*4] @ from BODY_16_xx +#endif + orr r0,r7,r8 + and r2,r7,r8 + and r0,r0,r9 + add r6,r6,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r10,r10,r3 + add r6,r6,r0 + @ ldr r1,[sp,#7*4] @ 22 + ldr r12,[sp,#4*4] + mov r0,r1,ror#7 + ldr r3,[sp,#6*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#15*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r10,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r10,ror#11 + eor r2,r11,r4 +#if 22>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 22==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r10,ror#25 @ Sigma1(e) + and r2,r2,r10 + str r3,[sp,#6*4] + add r3,r3,r0 + eor r2,r2,r4 @ Ch(e,f,g) + add r3,r3,r5 + mov r5,r6,ror#2 + add r3,r3,r2 + eor r5,r5,r6,ror#13 + add r3,r3,r12 + eor r5,r5,r6,ror#22 @ Sigma0(a) +#if 22>=15 + ldr r1,[sp,#8*4] @ from BODY_16_xx +#endif + orr r0,r6,r7 + and r2,r6,r7 + and r0,r0,r8 + add r5,r5,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r9,r9,r3 + add r5,r5,r0 + @ ldr r1,[sp,#8*4] @ 23 + ldr r12,[sp,#5*4] + mov r0,r1,ror#7 + ldr r3,[sp,#7*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#0*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r9,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r9,ror#11 + eor r2,r10,r11 +#if 23>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 23==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r9,ror#25 @ Sigma1(e) + and r2,r2,r9 + str r3,[sp,#7*4] + add r3,r3,r0 + eor r2,r2,r11 @ Ch(e,f,g) + add r3,r3,r4 + mov r4,r5,ror#2 + add r3,r3,r2 + eor r4,r4,r5,ror#13 + add r3,r3,r12 + eor r4,r4,r5,ror#22 @ Sigma0(a) +#if 23>=15 + ldr r1,[sp,#9*4] @ from BODY_16_xx +#endif + orr r0,r5,r6 + and r2,r5,r6 + and r0,r0,r7 + add r4,r4,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r8,r8,r3 + add r4,r4,r0 + @ ldr r1,[sp,#9*4] @ 24 + ldr r12,[sp,#6*4] + mov r0,r1,ror#7 + ldr r3,[sp,#8*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#1*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r8,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r8,ror#11 + eor r2,r9,r10 +#if 24>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 24==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r8,ror#25 @ Sigma1(e) + and r2,r2,r8 + str r3,[sp,#8*4] + add r3,r3,r0 + eor r2,r2,r10 @ Ch(e,f,g) + add r3,r3,r11 + mov r11,r4,ror#2 + add r3,r3,r2 + eor r11,r11,r4,ror#13 + add r3,r3,r12 + eor r11,r11,r4,ror#22 @ Sigma0(a) +#if 24>=15 + ldr r1,[sp,#10*4] @ from BODY_16_xx +#endif + orr r0,r4,r5 + and r2,r4,r5 + and r0,r0,r6 + add r11,r11,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r7,r7,r3 + add r11,r11,r0 + @ ldr r1,[sp,#10*4] @ 25 + ldr r12,[sp,#7*4] + mov r0,r1,ror#7 + ldr r3,[sp,#9*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#2*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r7,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r7,ror#11 + eor r2,r8,r9 +#if 25>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 25==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r7,ror#25 @ Sigma1(e) + and r2,r2,r7 + str r3,[sp,#9*4] + add r3,r3,r0 + eor r2,r2,r9 @ Ch(e,f,g) + add r3,r3,r10 + mov r10,r11,ror#2 + add r3,r3,r2 + eor r10,r10,r11,ror#13 + add r3,r3,r12 + eor r10,r10,r11,ror#22 @ Sigma0(a) +#if 25>=15 + ldr r1,[sp,#11*4] @ from BODY_16_xx +#endif + orr r0,r11,r4 + and r2,r11,r4 + and r0,r0,r5 + add r10,r10,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r6,r6,r3 + add r10,r10,r0 + @ ldr r1,[sp,#11*4] @ 26 + ldr r12,[sp,#8*4] + mov r0,r1,ror#7 + ldr r3,[sp,#10*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#3*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r6,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r6,ror#11 + eor r2,r7,r8 +#if 26>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 26==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r6,ror#25 @ Sigma1(e) + and r2,r2,r6 + str r3,[sp,#10*4] + add r3,r3,r0 + eor r2,r2,r8 @ Ch(e,f,g) + add r3,r3,r9 + mov r9,r10,ror#2 + add r3,r3,r2 + eor r9,r9,r10,ror#13 + add r3,r3,r12 + eor r9,r9,r10,ror#22 @ Sigma0(a) +#if 26>=15 + ldr r1,[sp,#12*4] @ from BODY_16_xx +#endif + orr r0,r10,r11 + and r2,r10,r11 + and r0,r0,r4 + add r9,r9,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r5,r5,r3 + add r9,r9,r0 + @ ldr r1,[sp,#12*4] @ 27 + ldr r12,[sp,#9*4] + mov r0,r1,ror#7 + ldr r3,[sp,#11*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#4*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r5,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r5,ror#11 + eor r2,r6,r7 +#if 27>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 27==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r5,ror#25 @ Sigma1(e) + and r2,r2,r5 + str r3,[sp,#11*4] + add r3,r3,r0 + eor r2,r2,r7 @ Ch(e,f,g) + add r3,r3,r8 + mov r8,r9,ror#2 + add r3,r3,r2 + eor r8,r8,r9,ror#13 + add r3,r3,r12 + eor r8,r8,r9,ror#22 @ Sigma0(a) +#if 27>=15 + ldr r1,[sp,#13*4] @ from BODY_16_xx +#endif + orr r0,r9,r10 + and r2,r9,r10 + and r0,r0,r11 + add r8,r8,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r4,r4,r3 + add r8,r8,r0 + @ ldr r1,[sp,#13*4] @ 28 + ldr r12,[sp,#10*4] + mov r0,r1,ror#7 + ldr r3,[sp,#12*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#5*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r4,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r4,ror#11 + eor r2,r5,r6 +#if 28>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 28==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r4,ror#25 @ Sigma1(e) + and r2,r2,r4 + str r3,[sp,#12*4] + add r3,r3,r0 + eor r2,r2,r6 @ Ch(e,f,g) + add r3,r3,r7 + mov r7,r8,ror#2 + add r3,r3,r2 + eor r7,r7,r8,ror#13 + add r3,r3,r12 + eor r7,r7,r8,ror#22 @ Sigma0(a) +#if 28>=15 + ldr r1,[sp,#14*4] @ from BODY_16_xx +#endif + orr r0,r8,r9 + and r2,r8,r9 + and r0,r0,r10 + add r7,r7,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r11,r11,r3 + add r7,r7,r0 + @ ldr r1,[sp,#14*4] @ 29 + ldr r12,[sp,#11*4] + mov r0,r1,ror#7 + ldr r3,[sp,#13*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#6*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r11,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r11,ror#11 + eor r2,r4,r5 +#if 29>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 29==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r11,ror#25 @ Sigma1(e) + and r2,r2,r11 + str r3,[sp,#13*4] + add r3,r3,r0 + eor r2,r2,r5 @ Ch(e,f,g) + add r3,r3,r6 + mov r6,r7,ror#2 + add r3,r3,r2 + eor r6,r6,r7,ror#13 + add r3,r3,r12 + eor r6,r6,r7,ror#22 @ Sigma0(a) +#if 29>=15 + ldr r1,[sp,#15*4] @ from BODY_16_xx +#endif + orr r0,r7,r8 + and r2,r7,r8 + and r0,r0,r9 + add r6,r6,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r10,r10,r3 + add r6,r6,r0 + @ ldr r1,[sp,#15*4] @ 30 + ldr r12,[sp,#12*4] + mov r0,r1,ror#7 + ldr r3,[sp,#14*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#7*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r10,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r10,ror#11 + eor r2,r11,r4 +#if 30>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 30==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r10,ror#25 @ Sigma1(e) + and r2,r2,r10 + str r3,[sp,#14*4] + add r3,r3,r0 + eor r2,r2,r4 @ Ch(e,f,g) + add r3,r3,r5 + mov r5,r6,ror#2 + add r3,r3,r2 + eor r5,r5,r6,ror#13 + add r3,r3,r12 + eor r5,r5,r6,ror#22 @ Sigma0(a) +#if 30>=15 + ldr r1,[sp,#0*4] @ from BODY_16_xx +#endif + orr r0,r6,r7 + and r2,r6,r7 + and r0,r0,r8 + add r5,r5,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r9,r9,r3 + add r5,r5,r0 + @ ldr r1,[sp,#0*4] @ 31 + ldr r12,[sp,#13*4] + mov r0,r1,ror#7 + ldr r3,[sp,#15*4] + eor r0,r0,r1,ror#18 + ldr r2,[sp,#8*4] + eor r0,r0,r1,lsr#3 @ sigma0(X[i+1]) + mov r1,r12,ror#17 + add r3,r3,r0 + eor r1,r1,r12,ror#19 + add r3,r3,r2 + eor r1,r1,r12,lsr#10 @ sigma1(X[i+14]) + @ add r3,r3,r1 + mov r0,r9,ror#6 + ldr r12,[r14],#4 @ *K256++ + eor r0,r0,r9,ror#11 + eor r2,r10,r11 +#if 31>=16 + add r3,r3,r1 @ from BODY_16_xx +#elif __ARM_ARCH__>=7 && defined(__ARMEL__) && !defined(__STRICT_ALIGNMENT) + rev r3,r3 +#endif +#if 31==15 + str r1,[sp,#17*4] @ leave room for r1 +#endif + eor r0,r0,r9,ror#25 @ Sigma1(e) + and r2,r2,r9 + str r3,[sp,#15*4] + add r3,r3,r0 + eor r2,r2,r11 @ Ch(e,f,g) + add r3,r3,r4 + mov r4,r5,ror#2 + add r3,r3,r2 + eor r4,r4,r5,ror#13 + add r3,r3,r12 + eor r4,r4,r5,ror#22 @ Sigma0(a) +#if 31>=15 + ldr r1,[sp,#1*4] @ from BODY_16_xx +#endif + orr r0,r5,r6 + and r2,r5,r6 + and r0,r0,r7 + add r4,r4,r3 + orr r0,r0,r2 @ Maj(a,b,c) + add r8,r8,r3 + add r4,r4,r0 + and r12,r12,#0xff + cmp r12,#0xf2 + bne .Lrounds_16_xx + + ldr r3,[sp,#16*4] @ pull ctx + ldr r0,[r3,#0] + ldr r2,[r3,#4] + ldr r12,[r3,#8] + add r4,r4,r0 + ldr r0,[r3,#12] + add r5,r5,r2 + ldr r2,[r3,#16] + add r6,r6,r12 + ldr r12,[r3,#20] + add r7,r7,r0 + ldr r0,[r3,#24] + add r8,r8,r2 + ldr r2,[r3,#28] + add r9,r9,r12 + ldr r1,[sp,#17*4] @ pull inp + ldr r12,[sp,#18*4] @ pull inp+len + add r10,r10,r0 + add r11,r11,r2 + stmia r3,{r4,r5,r6,r7,r8,r9,r10,r11} + cmp r1,r12 + sub r14,r14,#256 @ rewind Ktbl + bne .Loop + + add sp,sp,#19*4 @ destroy frame +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r11,pc} +#else + ldmia sp!,{r4-r11,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.size sha256_block_data_order,.-sha256_block_data_order +.asciz "SHA256 block transform for ARMv4, CRYPTOGAMS by " +.align 2 +#if defined(HAVE_GNU_STACK) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/crypto/sha/sha256-elf-x86_64.S b/crypto/sha/sha256-elf-x86_64.S index 599a5cb8..9eea6a7c 100644 --- a/crypto/sha/sha256-elf-x86_64.S +++ b/crypto/sha/sha256-elf-x86_64.S @@ -1756,7 +1756,7 @@ sha256_block_data_order: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lepilogue: - .byte 0xf3,0xc3 + retq .size sha256_block_data_order,.-sha256_block_data_order .align 64 .type K256,@object diff --git a/crypto/sha/sha256-macosx-x86_64.S b/crypto/sha/sha256-macosx-x86_64.S index 3ecafca5..4b468b7f 100644 --- a/crypto/sha/sha256-macosx-x86_64.S +++ b/crypto/sha/sha256-macosx-x86_64.S @@ -1756,7 +1756,7 @@ L$rounds_16_xx: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$epilogue: - .byte 0xf3,0xc3 + retq .p2align 6 diff --git a/crypto/sha/sha256-masm-x86_64.S b/crypto/sha/sha256-masm-x86_64.S new file mode 100644 index 00000000..5048d71a --- /dev/null +++ b/crypto/sha/sha256-masm-x86_64.S @@ -0,0 +1,1796 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + +PUBLIC sha256_block_data_order + +ALIGN 16 +sha256_block_data_order PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_sha256_block_data_order:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + + + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + mov r11,rsp + shl rdx,4 + sub rsp,16*4+4*8 + lea rdx,QWORD PTR[rdx*4+rsi] + and rsp,-64 + mov QWORD PTR[((64+0))+rsp],rdi + mov QWORD PTR[((64+8))+rsp],rsi + mov QWORD PTR[((64+16))+rsp],rdx + mov QWORD PTR[((64+24))+rsp],r11 +$L$prologue:: + + lea rbp,QWORD PTR[K256] + + mov eax,DWORD PTR[rdi] + mov ebx,DWORD PTR[4+rdi] + mov ecx,DWORD PTR[8+rdi] + mov edx,DWORD PTR[12+rdi] + mov r8d,DWORD PTR[16+rdi] + mov r9d,DWORD PTR[20+rdi] + mov r10d,DWORD PTR[24+rdi] + mov r11d,DWORD PTR[28+rdi] + jmp $L$loop + +ALIGN 16 +$L$loop:: + xor rdi,rdi + mov r12d,DWORD PTR[rsi] + mov r13d,r8d + mov r14d,eax + bswap r12d + ror r13d,14 + mov r15d,r9d + mov DWORD PTR[rsp],r12d + + ror r14d,9 + xor r13d,r8d + xor r15d,r10d + + ror r13d,5 + add r12d,r11d + xor r14d,eax + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r8d + mov r11d,ebx + + ror r14d,11 + xor r13d,r8d + xor r15d,r10d + + xor r11d,ecx + xor r14d,eax + add r12d,r15d + mov r15d,ebx + + ror r13d,6 + and r11d,eax + and r15d,ecx + + ror r14d,2 + add r12d,r13d + add r11d,r15d + + add edx,r12d + add r11d,r12d + lea rdi,QWORD PTR[1+rdi] + add r11d,r14d + + mov r12d,DWORD PTR[4+rsi] + mov r13d,edx + mov r14d,r11d + bswap r12d + ror r13d,14 + mov r15d,r8d + mov DWORD PTR[4+rsp],r12d + + ror r14d,9 + xor r13d,edx + xor r15d,r9d + + ror r13d,5 + add r12d,r10d + xor r14d,r11d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,edx + mov r10d,eax + + ror r14d,11 + xor r13d,edx + xor r15d,r9d + + xor r10d,ebx + xor r14d,r11d + add r12d,r15d + mov r15d,eax + + ror r13d,6 + and r10d,r11d + and r15d,ebx + + ror r14d,2 + add r12d,r13d + add r10d,r15d + + add ecx,r12d + add r10d,r12d + lea rdi,QWORD PTR[1+rdi] + add r10d,r14d + + mov r12d,DWORD PTR[8+rsi] + mov r13d,ecx + mov r14d,r10d + bswap r12d + ror r13d,14 + mov r15d,edx + mov DWORD PTR[8+rsp],r12d + + ror r14d,9 + xor r13d,ecx + xor r15d,r8d + + ror r13d,5 + add r12d,r9d + xor r14d,r10d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,ecx + mov r9d,r11d + + ror r14d,11 + xor r13d,ecx + xor r15d,r8d + + xor r9d,eax + xor r14d,r10d + add r12d,r15d + mov r15d,r11d + + ror r13d,6 + and r9d,r10d + and r15d,eax + + ror r14d,2 + add r12d,r13d + add r9d,r15d + + add ebx,r12d + add r9d,r12d + lea rdi,QWORD PTR[1+rdi] + add r9d,r14d + + mov r12d,DWORD PTR[12+rsi] + mov r13d,ebx + mov r14d,r9d + bswap r12d + ror r13d,14 + mov r15d,ecx + mov DWORD PTR[12+rsp],r12d + + ror r14d,9 + xor r13d,ebx + xor r15d,edx + + ror r13d,5 + add r12d,r8d + xor r14d,r9d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,ebx + mov r8d,r10d + + ror r14d,11 + xor r13d,ebx + xor r15d,edx + + xor r8d,r11d + xor r14d,r9d + add r12d,r15d + mov r15d,r10d + + ror r13d,6 + and r8d,r9d + and r15d,r11d + + ror r14d,2 + add r12d,r13d + add r8d,r15d + + add eax,r12d + add r8d,r12d + lea rdi,QWORD PTR[1+rdi] + add r8d,r14d + + mov r12d,DWORD PTR[16+rsi] + mov r13d,eax + mov r14d,r8d + bswap r12d + ror r13d,14 + mov r15d,ebx + mov DWORD PTR[16+rsp],r12d + + ror r14d,9 + xor r13d,eax + xor r15d,ecx + + ror r13d,5 + add r12d,edx + xor r14d,r8d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,eax + mov edx,r9d + + ror r14d,11 + xor r13d,eax + xor r15d,ecx + + xor edx,r10d + xor r14d,r8d + add r12d,r15d + mov r15d,r9d + + ror r13d,6 + and edx,r8d + and r15d,r10d + + ror r14d,2 + add r12d,r13d + add edx,r15d + + add r11d,r12d + add edx,r12d + lea rdi,QWORD PTR[1+rdi] + add edx,r14d + + mov r12d,DWORD PTR[20+rsi] + mov r13d,r11d + mov r14d,edx + bswap r12d + ror r13d,14 + mov r15d,eax + mov DWORD PTR[20+rsp],r12d + + ror r14d,9 + xor r13d,r11d + xor r15d,ebx + + ror r13d,5 + add r12d,ecx + xor r14d,edx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r11d + mov ecx,r8d + + ror r14d,11 + xor r13d,r11d + xor r15d,ebx + + xor ecx,r9d + xor r14d,edx + add r12d,r15d + mov r15d,r8d + + ror r13d,6 + and ecx,edx + and r15d,r9d + + ror r14d,2 + add r12d,r13d + add ecx,r15d + + add r10d,r12d + add ecx,r12d + lea rdi,QWORD PTR[1+rdi] + add ecx,r14d + + mov r12d,DWORD PTR[24+rsi] + mov r13d,r10d + mov r14d,ecx + bswap r12d + ror r13d,14 + mov r15d,r11d + mov DWORD PTR[24+rsp],r12d + + ror r14d,9 + xor r13d,r10d + xor r15d,eax + + ror r13d,5 + add r12d,ebx + xor r14d,ecx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r10d + mov ebx,edx + + ror r14d,11 + xor r13d,r10d + xor r15d,eax + + xor ebx,r8d + xor r14d,ecx + add r12d,r15d + mov r15d,edx + + ror r13d,6 + and ebx,ecx + and r15d,r8d + + ror r14d,2 + add r12d,r13d + add ebx,r15d + + add r9d,r12d + add ebx,r12d + lea rdi,QWORD PTR[1+rdi] + add ebx,r14d + + mov r12d,DWORD PTR[28+rsi] + mov r13d,r9d + mov r14d,ebx + bswap r12d + ror r13d,14 + mov r15d,r10d + mov DWORD PTR[28+rsp],r12d + + ror r14d,9 + xor r13d,r9d + xor r15d,r11d + + ror r13d,5 + add r12d,eax + xor r14d,ebx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r9d + mov eax,ecx + + ror r14d,11 + xor r13d,r9d + xor r15d,r11d + + xor eax,edx + xor r14d,ebx + add r12d,r15d + mov r15d,ecx + + ror r13d,6 + and eax,ebx + and r15d,edx + + ror r14d,2 + add r12d,r13d + add eax,r15d + + add r8d,r12d + add eax,r12d + lea rdi,QWORD PTR[1+rdi] + add eax,r14d + + mov r12d,DWORD PTR[32+rsi] + mov r13d,r8d + mov r14d,eax + bswap r12d + ror r13d,14 + mov r15d,r9d + mov DWORD PTR[32+rsp],r12d + + ror r14d,9 + xor r13d,r8d + xor r15d,r10d + + ror r13d,5 + add r12d,r11d + xor r14d,eax + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r8d + mov r11d,ebx + + ror r14d,11 + xor r13d,r8d + xor r15d,r10d + + xor r11d,ecx + xor r14d,eax + add r12d,r15d + mov r15d,ebx + + ror r13d,6 + and r11d,eax + and r15d,ecx + + ror r14d,2 + add r12d,r13d + add r11d,r15d + + add edx,r12d + add r11d,r12d + lea rdi,QWORD PTR[1+rdi] + add r11d,r14d + + mov r12d,DWORD PTR[36+rsi] + mov r13d,edx + mov r14d,r11d + bswap r12d + ror r13d,14 + mov r15d,r8d + mov DWORD PTR[36+rsp],r12d + + ror r14d,9 + xor r13d,edx + xor r15d,r9d + + ror r13d,5 + add r12d,r10d + xor r14d,r11d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,edx + mov r10d,eax + + ror r14d,11 + xor r13d,edx + xor r15d,r9d + + xor r10d,ebx + xor r14d,r11d + add r12d,r15d + mov r15d,eax + + ror r13d,6 + and r10d,r11d + and r15d,ebx + + ror r14d,2 + add r12d,r13d + add r10d,r15d + + add ecx,r12d + add r10d,r12d + lea rdi,QWORD PTR[1+rdi] + add r10d,r14d + + mov r12d,DWORD PTR[40+rsi] + mov r13d,ecx + mov r14d,r10d + bswap r12d + ror r13d,14 + mov r15d,edx + mov DWORD PTR[40+rsp],r12d + + ror r14d,9 + xor r13d,ecx + xor r15d,r8d + + ror r13d,5 + add r12d,r9d + xor r14d,r10d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,ecx + mov r9d,r11d + + ror r14d,11 + xor r13d,ecx + xor r15d,r8d + + xor r9d,eax + xor r14d,r10d + add r12d,r15d + mov r15d,r11d + + ror r13d,6 + and r9d,r10d + and r15d,eax + + ror r14d,2 + add r12d,r13d + add r9d,r15d + + add ebx,r12d + add r9d,r12d + lea rdi,QWORD PTR[1+rdi] + add r9d,r14d + + mov r12d,DWORD PTR[44+rsi] + mov r13d,ebx + mov r14d,r9d + bswap r12d + ror r13d,14 + mov r15d,ecx + mov DWORD PTR[44+rsp],r12d + + ror r14d,9 + xor r13d,ebx + xor r15d,edx + + ror r13d,5 + add r12d,r8d + xor r14d,r9d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,ebx + mov r8d,r10d + + ror r14d,11 + xor r13d,ebx + xor r15d,edx + + xor r8d,r11d + xor r14d,r9d + add r12d,r15d + mov r15d,r10d + + ror r13d,6 + and r8d,r9d + and r15d,r11d + + ror r14d,2 + add r12d,r13d + add r8d,r15d + + add eax,r12d + add r8d,r12d + lea rdi,QWORD PTR[1+rdi] + add r8d,r14d + + mov r12d,DWORD PTR[48+rsi] + mov r13d,eax + mov r14d,r8d + bswap r12d + ror r13d,14 + mov r15d,ebx + mov DWORD PTR[48+rsp],r12d + + ror r14d,9 + xor r13d,eax + xor r15d,ecx + + ror r13d,5 + add r12d,edx + xor r14d,r8d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,eax + mov edx,r9d + + ror r14d,11 + xor r13d,eax + xor r15d,ecx + + xor edx,r10d + xor r14d,r8d + add r12d,r15d + mov r15d,r9d + + ror r13d,6 + and edx,r8d + and r15d,r10d + + ror r14d,2 + add r12d,r13d + add edx,r15d + + add r11d,r12d + add edx,r12d + lea rdi,QWORD PTR[1+rdi] + add edx,r14d + + mov r12d,DWORD PTR[52+rsi] + mov r13d,r11d + mov r14d,edx + bswap r12d + ror r13d,14 + mov r15d,eax + mov DWORD PTR[52+rsp],r12d + + ror r14d,9 + xor r13d,r11d + xor r15d,ebx + + ror r13d,5 + add r12d,ecx + xor r14d,edx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r11d + mov ecx,r8d + + ror r14d,11 + xor r13d,r11d + xor r15d,ebx + + xor ecx,r9d + xor r14d,edx + add r12d,r15d + mov r15d,r8d + + ror r13d,6 + and ecx,edx + and r15d,r9d + + ror r14d,2 + add r12d,r13d + add ecx,r15d + + add r10d,r12d + add ecx,r12d + lea rdi,QWORD PTR[1+rdi] + add ecx,r14d + + mov r12d,DWORD PTR[56+rsi] + mov r13d,r10d + mov r14d,ecx + bswap r12d + ror r13d,14 + mov r15d,r11d + mov DWORD PTR[56+rsp],r12d + + ror r14d,9 + xor r13d,r10d + xor r15d,eax + + ror r13d,5 + add r12d,ebx + xor r14d,ecx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r10d + mov ebx,edx + + ror r14d,11 + xor r13d,r10d + xor r15d,eax + + xor ebx,r8d + xor r14d,ecx + add r12d,r15d + mov r15d,edx + + ror r13d,6 + and ebx,ecx + and r15d,r8d + + ror r14d,2 + add r12d,r13d + add ebx,r15d + + add r9d,r12d + add ebx,r12d + lea rdi,QWORD PTR[1+rdi] + add ebx,r14d + + mov r12d,DWORD PTR[60+rsi] + mov r13d,r9d + mov r14d,ebx + bswap r12d + ror r13d,14 + mov r15d,r10d + mov DWORD PTR[60+rsp],r12d + + ror r14d,9 + xor r13d,r9d + xor r15d,r11d + + ror r13d,5 + add r12d,eax + xor r14d,ebx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r9d + mov eax,ecx + + ror r14d,11 + xor r13d,r9d + xor r15d,r11d + + xor eax,edx + xor r14d,ebx + add r12d,r15d + mov r15d,ecx + + ror r13d,6 + and eax,ebx + and r15d,edx + + ror r14d,2 + add r12d,r13d + add eax,r15d + + add r8d,r12d + add eax,r12d + lea rdi,QWORD PTR[1+rdi] + add eax,r14d + + jmp $L$rounds_16_xx +ALIGN 16 +$L$rounds_16_xx:: + mov r13d,DWORD PTR[4+rsp] + mov r14d,DWORD PTR[56+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[36+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[rsp] + mov r13d,r8d + add r12d,r14d + mov r14d,eax + ror r13d,14 + mov r15d,r9d + mov DWORD PTR[rsp],r12d + + ror r14d,9 + xor r13d,r8d + xor r15d,r10d + + ror r13d,5 + add r12d,r11d + xor r14d,eax + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r8d + mov r11d,ebx + + ror r14d,11 + xor r13d,r8d + xor r15d,r10d + + xor r11d,ecx + xor r14d,eax + add r12d,r15d + mov r15d,ebx + + ror r13d,6 + and r11d,eax + and r15d,ecx + + ror r14d,2 + add r12d,r13d + add r11d,r15d + + add edx,r12d + add r11d,r12d + lea rdi,QWORD PTR[1+rdi] + add r11d,r14d + + mov r13d,DWORD PTR[8+rsp] + mov r14d,DWORD PTR[60+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[40+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[4+rsp] + mov r13d,edx + add r12d,r14d + mov r14d,r11d + ror r13d,14 + mov r15d,r8d + mov DWORD PTR[4+rsp],r12d + + ror r14d,9 + xor r13d,edx + xor r15d,r9d + + ror r13d,5 + add r12d,r10d + xor r14d,r11d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,edx + mov r10d,eax + + ror r14d,11 + xor r13d,edx + xor r15d,r9d + + xor r10d,ebx + xor r14d,r11d + add r12d,r15d + mov r15d,eax + + ror r13d,6 + and r10d,r11d + and r15d,ebx + + ror r14d,2 + add r12d,r13d + add r10d,r15d + + add ecx,r12d + add r10d,r12d + lea rdi,QWORD PTR[1+rdi] + add r10d,r14d + + mov r13d,DWORD PTR[12+rsp] + mov r14d,DWORD PTR[rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[44+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[8+rsp] + mov r13d,ecx + add r12d,r14d + mov r14d,r10d + ror r13d,14 + mov r15d,edx + mov DWORD PTR[8+rsp],r12d + + ror r14d,9 + xor r13d,ecx + xor r15d,r8d + + ror r13d,5 + add r12d,r9d + xor r14d,r10d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,ecx + mov r9d,r11d + + ror r14d,11 + xor r13d,ecx + xor r15d,r8d + + xor r9d,eax + xor r14d,r10d + add r12d,r15d + mov r15d,r11d + + ror r13d,6 + and r9d,r10d + and r15d,eax + + ror r14d,2 + add r12d,r13d + add r9d,r15d + + add ebx,r12d + add r9d,r12d + lea rdi,QWORD PTR[1+rdi] + add r9d,r14d + + mov r13d,DWORD PTR[16+rsp] + mov r14d,DWORD PTR[4+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[48+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[12+rsp] + mov r13d,ebx + add r12d,r14d + mov r14d,r9d + ror r13d,14 + mov r15d,ecx + mov DWORD PTR[12+rsp],r12d + + ror r14d,9 + xor r13d,ebx + xor r15d,edx + + ror r13d,5 + add r12d,r8d + xor r14d,r9d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,ebx + mov r8d,r10d + + ror r14d,11 + xor r13d,ebx + xor r15d,edx + + xor r8d,r11d + xor r14d,r9d + add r12d,r15d + mov r15d,r10d + + ror r13d,6 + and r8d,r9d + and r15d,r11d + + ror r14d,2 + add r12d,r13d + add r8d,r15d + + add eax,r12d + add r8d,r12d + lea rdi,QWORD PTR[1+rdi] + add r8d,r14d + + mov r13d,DWORD PTR[20+rsp] + mov r14d,DWORD PTR[8+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[52+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[16+rsp] + mov r13d,eax + add r12d,r14d + mov r14d,r8d + ror r13d,14 + mov r15d,ebx + mov DWORD PTR[16+rsp],r12d + + ror r14d,9 + xor r13d,eax + xor r15d,ecx + + ror r13d,5 + add r12d,edx + xor r14d,r8d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,eax + mov edx,r9d + + ror r14d,11 + xor r13d,eax + xor r15d,ecx + + xor edx,r10d + xor r14d,r8d + add r12d,r15d + mov r15d,r9d + + ror r13d,6 + and edx,r8d + and r15d,r10d + + ror r14d,2 + add r12d,r13d + add edx,r15d + + add r11d,r12d + add edx,r12d + lea rdi,QWORD PTR[1+rdi] + add edx,r14d + + mov r13d,DWORD PTR[24+rsp] + mov r14d,DWORD PTR[12+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[56+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[20+rsp] + mov r13d,r11d + add r12d,r14d + mov r14d,edx + ror r13d,14 + mov r15d,eax + mov DWORD PTR[20+rsp],r12d + + ror r14d,9 + xor r13d,r11d + xor r15d,ebx + + ror r13d,5 + add r12d,ecx + xor r14d,edx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r11d + mov ecx,r8d + + ror r14d,11 + xor r13d,r11d + xor r15d,ebx + + xor ecx,r9d + xor r14d,edx + add r12d,r15d + mov r15d,r8d + + ror r13d,6 + and ecx,edx + and r15d,r9d + + ror r14d,2 + add r12d,r13d + add ecx,r15d + + add r10d,r12d + add ecx,r12d + lea rdi,QWORD PTR[1+rdi] + add ecx,r14d + + mov r13d,DWORD PTR[28+rsp] + mov r14d,DWORD PTR[16+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[60+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[24+rsp] + mov r13d,r10d + add r12d,r14d + mov r14d,ecx + ror r13d,14 + mov r15d,r11d + mov DWORD PTR[24+rsp],r12d + + ror r14d,9 + xor r13d,r10d + xor r15d,eax + + ror r13d,5 + add r12d,ebx + xor r14d,ecx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r10d + mov ebx,edx + + ror r14d,11 + xor r13d,r10d + xor r15d,eax + + xor ebx,r8d + xor r14d,ecx + add r12d,r15d + mov r15d,edx + + ror r13d,6 + and ebx,ecx + and r15d,r8d + + ror r14d,2 + add r12d,r13d + add ebx,r15d + + add r9d,r12d + add ebx,r12d + lea rdi,QWORD PTR[1+rdi] + add ebx,r14d + + mov r13d,DWORD PTR[32+rsp] + mov r14d,DWORD PTR[20+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[28+rsp] + mov r13d,r9d + add r12d,r14d + mov r14d,ebx + ror r13d,14 + mov r15d,r10d + mov DWORD PTR[28+rsp],r12d + + ror r14d,9 + xor r13d,r9d + xor r15d,r11d + + ror r13d,5 + add r12d,eax + xor r14d,ebx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r9d + mov eax,ecx + + ror r14d,11 + xor r13d,r9d + xor r15d,r11d + + xor eax,edx + xor r14d,ebx + add r12d,r15d + mov r15d,ecx + + ror r13d,6 + and eax,ebx + and r15d,edx + + ror r14d,2 + add r12d,r13d + add eax,r15d + + add r8d,r12d + add eax,r12d + lea rdi,QWORD PTR[1+rdi] + add eax,r14d + + mov r13d,DWORD PTR[36+rsp] + mov r14d,DWORD PTR[24+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[4+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[32+rsp] + mov r13d,r8d + add r12d,r14d + mov r14d,eax + ror r13d,14 + mov r15d,r9d + mov DWORD PTR[32+rsp],r12d + + ror r14d,9 + xor r13d,r8d + xor r15d,r10d + + ror r13d,5 + add r12d,r11d + xor r14d,eax + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r8d + mov r11d,ebx + + ror r14d,11 + xor r13d,r8d + xor r15d,r10d + + xor r11d,ecx + xor r14d,eax + add r12d,r15d + mov r15d,ebx + + ror r13d,6 + and r11d,eax + and r15d,ecx + + ror r14d,2 + add r12d,r13d + add r11d,r15d + + add edx,r12d + add r11d,r12d + lea rdi,QWORD PTR[1+rdi] + add r11d,r14d + + mov r13d,DWORD PTR[40+rsp] + mov r14d,DWORD PTR[28+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[8+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[36+rsp] + mov r13d,edx + add r12d,r14d + mov r14d,r11d + ror r13d,14 + mov r15d,r8d + mov DWORD PTR[36+rsp],r12d + + ror r14d,9 + xor r13d,edx + xor r15d,r9d + + ror r13d,5 + add r12d,r10d + xor r14d,r11d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,edx + mov r10d,eax + + ror r14d,11 + xor r13d,edx + xor r15d,r9d + + xor r10d,ebx + xor r14d,r11d + add r12d,r15d + mov r15d,eax + + ror r13d,6 + and r10d,r11d + and r15d,ebx + + ror r14d,2 + add r12d,r13d + add r10d,r15d + + add ecx,r12d + add r10d,r12d + lea rdi,QWORD PTR[1+rdi] + add r10d,r14d + + mov r13d,DWORD PTR[44+rsp] + mov r14d,DWORD PTR[32+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[12+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[40+rsp] + mov r13d,ecx + add r12d,r14d + mov r14d,r10d + ror r13d,14 + mov r15d,edx + mov DWORD PTR[40+rsp],r12d + + ror r14d,9 + xor r13d,ecx + xor r15d,r8d + + ror r13d,5 + add r12d,r9d + xor r14d,r10d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,ecx + mov r9d,r11d + + ror r14d,11 + xor r13d,ecx + xor r15d,r8d + + xor r9d,eax + xor r14d,r10d + add r12d,r15d + mov r15d,r11d + + ror r13d,6 + and r9d,r10d + and r15d,eax + + ror r14d,2 + add r12d,r13d + add r9d,r15d + + add ebx,r12d + add r9d,r12d + lea rdi,QWORD PTR[1+rdi] + add r9d,r14d + + mov r13d,DWORD PTR[48+rsp] + mov r14d,DWORD PTR[36+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[16+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[44+rsp] + mov r13d,ebx + add r12d,r14d + mov r14d,r9d + ror r13d,14 + mov r15d,ecx + mov DWORD PTR[44+rsp],r12d + + ror r14d,9 + xor r13d,ebx + xor r15d,edx + + ror r13d,5 + add r12d,r8d + xor r14d,r9d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,ebx + mov r8d,r10d + + ror r14d,11 + xor r13d,ebx + xor r15d,edx + + xor r8d,r11d + xor r14d,r9d + add r12d,r15d + mov r15d,r10d + + ror r13d,6 + and r8d,r9d + and r15d,r11d + + ror r14d,2 + add r12d,r13d + add r8d,r15d + + add eax,r12d + add r8d,r12d + lea rdi,QWORD PTR[1+rdi] + add r8d,r14d + + mov r13d,DWORD PTR[52+rsp] + mov r14d,DWORD PTR[40+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[20+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[48+rsp] + mov r13d,eax + add r12d,r14d + mov r14d,r8d + ror r13d,14 + mov r15d,ebx + mov DWORD PTR[48+rsp],r12d + + ror r14d,9 + xor r13d,eax + xor r15d,ecx + + ror r13d,5 + add r12d,edx + xor r14d,r8d + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,eax + mov edx,r9d + + ror r14d,11 + xor r13d,eax + xor r15d,ecx + + xor edx,r10d + xor r14d,r8d + add r12d,r15d + mov r15d,r9d + + ror r13d,6 + and edx,r8d + and r15d,r10d + + ror r14d,2 + add r12d,r13d + add edx,r15d + + add r11d,r12d + add edx,r12d + lea rdi,QWORD PTR[1+rdi] + add edx,r14d + + mov r13d,DWORD PTR[56+rsp] + mov r14d,DWORD PTR[44+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[24+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[52+rsp] + mov r13d,r11d + add r12d,r14d + mov r14d,edx + ror r13d,14 + mov r15d,eax + mov DWORD PTR[52+rsp],r12d + + ror r14d,9 + xor r13d,r11d + xor r15d,ebx + + ror r13d,5 + add r12d,ecx + xor r14d,edx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r11d + mov ecx,r8d + + ror r14d,11 + xor r13d,r11d + xor r15d,ebx + + xor ecx,r9d + xor r14d,edx + add r12d,r15d + mov r15d,r8d + + ror r13d,6 + and ecx,edx + and r15d,r9d + + ror r14d,2 + add r12d,r13d + add ecx,r15d + + add r10d,r12d + add ecx,r12d + lea rdi,QWORD PTR[1+rdi] + add ecx,r14d + + mov r13d,DWORD PTR[60+rsp] + mov r14d,DWORD PTR[48+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[28+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[56+rsp] + mov r13d,r10d + add r12d,r14d + mov r14d,ecx + ror r13d,14 + mov r15d,r11d + mov DWORD PTR[56+rsp],r12d + + ror r14d,9 + xor r13d,r10d + xor r15d,eax + + ror r13d,5 + add r12d,ebx + xor r14d,ecx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r10d + mov ebx,edx + + ror r14d,11 + xor r13d,r10d + xor r15d,eax + + xor ebx,r8d + xor r14d,ecx + add r12d,r15d + mov r15d,edx + + ror r13d,6 + and ebx,ecx + and r15d,r8d + + ror r14d,2 + add r12d,r13d + add ebx,r15d + + add r9d,r12d + add ebx,r12d + lea rdi,QWORD PTR[1+rdi] + add ebx,r14d + + mov r13d,DWORD PTR[rsp] + mov r14d,DWORD PTR[52+rsp] + mov r12d,r13d + mov r15d,r14d + + ror r12d,11 + xor r12d,r13d + shr r13d,3 + + ror r12d,7 + xor r13d,r12d + mov r12d,DWORD PTR[32+rsp] + + ror r15d,2 + xor r15d,r14d + shr r14d,10 + + ror r15d,17 + add r12d,r13d + xor r14d,r15d + + add r12d,DWORD PTR[60+rsp] + mov r13d,r9d + add r12d,r14d + mov r14d,ebx + ror r13d,14 + mov r15d,r10d + mov DWORD PTR[60+rsp],r12d + + ror r14d,9 + xor r13d,r9d + xor r15d,r11d + + ror r13d,5 + add r12d,eax + xor r14d,ebx + + add r12d,DWORD PTR[rdi*4+rbp] + and r15d,r9d + mov eax,ecx + + ror r14d,11 + xor r13d,r9d + xor r15d,r11d + + xor eax,edx + xor r14d,ebx + add r12d,r15d + mov r15d,ecx + + ror r13d,6 + and eax,ebx + and r15d,edx + + ror r14d,2 + add r12d,r13d + add eax,r15d + + add r8d,r12d + add eax,r12d + lea rdi,QWORD PTR[1+rdi] + add eax,r14d + + cmp rdi,64 + jb $L$rounds_16_xx + + mov rdi,QWORD PTR[((64+0))+rsp] + lea rsi,QWORD PTR[64+rsi] + + add eax,DWORD PTR[rdi] + add ebx,DWORD PTR[4+rdi] + add ecx,DWORD PTR[8+rdi] + add edx,DWORD PTR[12+rdi] + add r8d,DWORD PTR[16+rdi] + add r9d,DWORD PTR[20+rdi] + add r10d,DWORD PTR[24+rdi] + add r11d,DWORD PTR[28+rdi] + + cmp rsi,QWORD PTR[((64+16))+rsp] + + mov DWORD PTR[rdi],eax + mov DWORD PTR[4+rdi],ebx + mov DWORD PTR[8+rdi],ecx + mov DWORD PTR[12+rdi],edx + mov DWORD PTR[16+rdi],r8d + mov DWORD PTR[20+rdi],r9d + mov DWORD PTR[24+rdi],r10d + mov DWORD PTR[28+rdi],r11d + jb $L$loop + + mov rsi,QWORD PTR[((64+24))+rsp] + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_sha256_block_data_order:: +sha256_block_data_order ENDP +ALIGN 64 + +K256:: + DD 0428a2f98h,071374491h,0b5c0fbcfh,0e9b5dba5h + DD 03956c25bh,059f111f1h,0923f82a4h,0ab1c5ed5h + DD 0d807aa98h,012835b01h,0243185beh,0550c7dc3h + DD 072be5d74h,080deb1feh,09bdc06a7h,0c19bf174h + DD 0e49b69c1h,0efbe4786h,00fc19dc6h,0240ca1cch + DD 02de92c6fh,04a7484aah,05cb0a9dch,076f988dah + DD 0983e5152h,0a831c66dh,0b00327c8h,0bf597fc7h + DD 0c6e00bf3h,0d5a79147h,006ca6351h,014292967h + DD 027b70a85h,02e1b2138h,04d2c6dfch,053380d13h + DD 0650a7354h,0766a0abbh,081c2c92eh,092722c85h + DD 0a2bfe8a1h,0a81a664bh,0c24b8b70h,0c76c51a3h + DD 0d192e819h,0d6990624h,0f40e3585h,0106aa070h + DD 019a4c116h,01e376c08h,02748774ch,034b0bcb5h + DD 0391c0cb3h,04ed8aa4ah,05b9cca4fh,0682e6ff3h + DD 0748f82eeh,078a5636fh,084c87814h,08cc70208h + DD 090befffah,0a4506cebh,0bef9a3f7h,0c67178f2h + +.text$ ENDS +END diff --git a/crypto/sha/sha256-mingw64-x86_64.S b/crypto/sha/sha256-mingw64-x86_64.S new file mode 100644 index 00000000..3de981b8 --- /dev/null +++ b/crypto/sha/sha256-mingw64-x86_64.S @@ -0,0 +1,1790 @@ +#include "x86_arch.h" +.text + +.globl sha256_block_data_order +.def sha256_block_data_order; .scl 2; .type 32; .endef +.p2align 4 +sha256_block_data_order: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_sha256_block_data_order: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + movq %rsp,%r11 + shlq $4,%rdx + subq $64+32,%rsp + leaq (%rsi,%rdx,4),%rdx + andq $-64,%rsp + movq %rdi,64+0(%rsp) + movq %rsi,64+8(%rsp) + movq %rdx,64+16(%rsp) + movq %r11,64+24(%rsp) +.Lprologue: + + leaq K256(%rip),%rbp + + movl 0(%rdi),%eax + movl 4(%rdi),%ebx + movl 8(%rdi),%ecx + movl 12(%rdi),%edx + movl 16(%rdi),%r8d + movl 20(%rdi),%r9d + movl 24(%rdi),%r10d + movl 28(%rdi),%r11d + jmp .Lloop + +.p2align 4 +.Lloop: + xorq %rdi,%rdi + movl 0(%rsi),%r12d + movl %r8d,%r13d + movl %eax,%r14d + bswapl %r12d + rorl $14,%r13d + movl %r9d,%r15d + movl %r12d,0(%rsp) + + rorl $9,%r14d + xorl %r8d,%r13d + xorl %r10d,%r15d + + rorl $5,%r13d + addl %r11d,%r12d + xorl %eax,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r8d,%r15d + movl %ebx,%r11d + + rorl $11,%r14d + xorl %r8d,%r13d + xorl %r10d,%r15d + + xorl %ecx,%r11d + xorl %eax,%r14d + addl %r15d,%r12d + movl %ebx,%r15d + + rorl $6,%r13d + andl %eax,%r11d + andl %ecx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r11d + + addl %r12d,%edx + addl %r12d,%r11d + leaq 1(%rdi),%rdi + addl %r14d,%r11d + + movl 4(%rsi),%r12d + movl %edx,%r13d + movl %r11d,%r14d + bswapl %r12d + rorl $14,%r13d + movl %r8d,%r15d + movl %r12d,4(%rsp) + + rorl $9,%r14d + xorl %edx,%r13d + xorl %r9d,%r15d + + rorl $5,%r13d + addl %r10d,%r12d + xorl %r11d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %edx,%r15d + movl %eax,%r10d + + rorl $11,%r14d + xorl %edx,%r13d + xorl %r9d,%r15d + + xorl %ebx,%r10d + xorl %r11d,%r14d + addl %r15d,%r12d + movl %eax,%r15d + + rorl $6,%r13d + andl %r11d,%r10d + andl %ebx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r10d + + addl %r12d,%ecx + addl %r12d,%r10d + leaq 1(%rdi),%rdi + addl %r14d,%r10d + + movl 8(%rsi),%r12d + movl %ecx,%r13d + movl %r10d,%r14d + bswapl %r12d + rorl $14,%r13d + movl %edx,%r15d + movl %r12d,8(%rsp) + + rorl $9,%r14d + xorl %ecx,%r13d + xorl %r8d,%r15d + + rorl $5,%r13d + addl %r9d,%r12d + xorl %r10d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %ecx,%r15d + movl %r11d,%r9d + + rorl $11,%r14d + xorl %ecx,%r13d + xorl %r8d,%r15d + + xorl %eax,%r9d + xorl %r10d,%r14d + addl %r15d,%r12d + movl %r11d,%r15d + + rorl $6,%r13d + andl %r10d,%r9d + andl %eax,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r9d + + addl %r12d,%ebx + addl %r12d,%r9d + leaq 1(%rdi),%rdi + addl %r14d,%r9d + + movl 12(%rsi),%r12d + movl %ebx,%r13d + movl %r9d,%r14d + bswapl %r12d + rorl $14,%r13d + movl %ecx,%r15d + movl %r12d,12(%rsp) + + rorl $9,%r14d + xorl %ebx,%r13d + xorl %edx,%r15d + + rorl $5,%r13d + addl %r8d,%r12d + xorl %r9d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %ebx,%r15d + movl %r10d,%r8d + + rorl $11,%r14d + xorl %ebx,%r13d + xorl %edx,%r15d + + xorl %r11d,%r8d + xorl %r9d,%r14d + addl %r15d,%r12d + movl %r10d,%r15d + + rorl $6,%r13d + andl %r9d,%r8d + andl %r11d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r8d + + addl %r12d,%eax + addl %r12d,%r8d + leaq 1(%rdi),%rdi + addl %r14d,%r8d + + movl 16(%rsi),%r12d + movl %eax,%r13d + movl %r8d,%r14d + bswapl %r12d + rorl $14,%r13d + movl %ebx,%r15d + movl %r12d,16(%rsp) + + rorl $9,%r14d + xorl %eax,%r13d + xorl %ecx,%r15d + + rorl $5,%r13d + addl %edx,%r12d + xorl %r8d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %eax,%r15d + movl %r9d,%edx + + rorl $11,%r14d + xorl %eax,%r13d + xorl %ecx,%r15d + + xorl %r10d,%edx + xorl %r8d,%r14d + addl %r15d,%r12d + movl %r9d,%r15d + + rorl $6,%r13d + andl %r8d,%edx + andl %r10d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%edx + + addl %r12d,%r11d + addl %r12d,%edx + leaq 1(%rdi),%rdi + addl %r14d,%edx + + movl 20(%rsi),%r12d + movl %r11d,%r13d + movl %edx,%r14d + bswapl %r12d + rorl $14,%r13d + movl %eax,%r15d + movl %r12d,20(%rsp) + + rorl $9,%r14d + xorl %r11d,%r13d + xorl %ebx,%r15d + + rorl $5,%r13d + addl %ecx,%r12d + xorl %edx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r11d,%r15d + movl %r8d,%ecx + + rorl $11,%r14d + xorl %r11d,%r13d + xorl %ebx,%r15d + + xorl %r9d,%ecx + xorl %edx,%r14d + addl %r15d,%r12d + movl %r8d,%r15d + + rorl $6,%r13d + andl %edx,%ecx + andl %r9d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%ecx + + addl %r12d,%r10d + addl %r12d,%ecx + leaq 1(%rdi),%rdi + addl %r14d,%ecx + + movl 24(%rsi),%r12d + movl %r10d,%r13d + movl %ecx,%r14d + bswapl %r12d + rorl $14,%r13d + movl %r11d,%r15d + movl %r12d,24(%rsp) + + rorl $9,%r14d + xorl %r10d,%r13d + xorl %eax,%r15d + + rorl $5,%r13d + addl %ebx,%r12d + xorl %ecx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r10d,%r15d + movl %edx,%ebx + + rorl $11,%r14d + xorl %r10d,%r13d + xorl %eax,%r15d + + xorl %r8d,%ebx + xorl %ecx,%r14d + addl %r15d,%r12d + movl %edx,%r15d + + rorl $6,%r13d + andl %ecx,%ebx + andl %r8d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%ebx + + addl %r12d,%r9d + addl %r12d,%ebx + leaq 1(%rdi),%rdi + addl %r14d,%ebx + + movl 28(%rsi),%r12d + movl %r9d,%r13d + movl %ebx,%r14d + bswapl %r12d + rorl $14,%r13d + movl %r10d,%r15d + movl %r12d,28(%rsp) + + rorl $9,%r14d + xorl %r9d,%r13d + xorl %r11d,%r15d + + rorl $5,%r13d + addl %eax,%r12d + xorl %ebx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r9d,%r15d + movl %ecx,%eax + + rorl $11,%r14d + xorl %r9d,%r13d + xorl %r11d,%r15d + + xorl %edx,%eax + xorl %ebx,%r14d + addl %r15d,%r12d + movl %ecx,%r15d + + rorl $6,%r13d + andl %ebx,%eax + andl %edx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%eax + + addl %r12d,%r8d + addl %r12d,%eax + leaq 1(%rdi),%rdi + addl %r14d,%eax + + movl 32(%rsi),%r12d + movl %r8d,%r13d + movl %eax,%r14d + bswapl %r12d + rorl $14,%r13d + movl %r9d,%r15d + movl %r12d,32(%rsp) + + rorl $9,%r14d + xorl %r8d,%r13d + xorl %r10d,%r15d + + rorl $5,%r13d + addl %r11d,%r12d + xorl %eax,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r8d,%r15d + movl %ebx,%r11d + + rorl $11,%r14d + xorl %r8d,%r13d + xorl %r10d,%r15d + + xorl %ecx,%r11d + xorl %eax,%r14d + addl %r15d,%r12d + movl %ebx,%r15d + + rorl $6,%r13d + andl %eax,%r11d + andl %ecx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r11d + + addl %r12d,%edx + addl %r12d,%r11d + leaq 1(%rdi),%rdi + addl %r14d,%r11d + + movl 36(%rsi),%r12d + movl %edx,%r13d + movl %r11d,%r14d + bswapl %r12d + rorl $14,%r13d + movl %r8d,%r15d + movl %r12d,36(%rsp) + + rorl $9,%r14d + xorl %edx,%r13d + xorl %r9d,%r15d + + rorl $5,%r13d + addl %r10d,%r12d + xorl %r11d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %edx,%r15d + movl %eax,%r10d + + rorl $11,%r14d + xorl %edx,%r13d + xorl %r9d,%r15d + + xorl %ebx,%r10d + xorl %r11d,%r14d + addl %r15d,%r12d + movl %eax,%r15d + + rorl $6,%r13d + andl %r11d,%r10d + andl %ebx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r10d + + addl %r12d,%ecx + addl %r12d,%r10d + leaq 1(%rdi),%rdi + addl %r14d,%r10d + + movl 40(%rsi),%r12d + movl %ecx,%r13d + movl %r10d,%r14d + bswapl %r12d + rorl $14,%r13d + movl %edx,%r15d + movl %r12d,40(%rsp) + + rorl $9,%r14d + xorl %ecx,%r13d + xorl %r8d,%r15d + + rorl $5,%r13d + addl %r9d,%r12d + xorl %r10d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %ecx,%r15d + movl %r11d,%r9d + + rorl $11,%r14d + xorl %ecx,%r13d + xorl %r8d,%r15d + + xorl %eax,%r9d + xorl %r10d,%r14d + addl %r15d,%r12d + movl %r11d,%r15d + + rorl $6,%r13d + andl %r10d,%r9d + andl %eax,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r9d + + addl %r12d,%ebx + addl %r12d,%r9d + leaq 1(%rdi),%rdi + addl %r14d,%r9d + + movl 44(%rsi),%r12d + movl %ebx,%r13d + movl %r9d,%r14d + bswapl %r12d + rorl $14,%r13d + movl %ecx,%r15d + movl %r12d,44(%rsp) + + rorl $9,%r14d + xorl %ebx,%r13d + xorl %edx,%r15d + + rorl $5,%r13d + addl %r8d,%r12d + xorl %r9d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %ebx,%r15d + movl %r10d,%r8d + + rorl $11,%r14d + xorl %ebx,%r13d + xorl %edx,%r15d + + xorl %r11d,%r8d + xorl %r9d,%r14d + addl %r15d,%r12d + movl %r10d,%r15d + + rorl $6,%r13d + andl %r9d,%r8d + andl %r11d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r8d + + addl %r12d,%eax + addl %r12d,%r8d + leaq 1(%rdi),%rdi + addl %r14d,%r8d + + movl 48(%rsi),%r12d + movl %eax,%r13d + movl %r8d,%r14d + bswapl %r12d + rorl $14,%r13d + movl %ebx,%r15d + movl %r12d,48(%rsp) + + rorl $9,%r14d + xorl %eax,%r13d + xorl %ecx,%r15d + + rorl $5,%r13d + addl %edx,%r12d + xorl %r8d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %eax,%r15d + movl %r9d,%edx + + rorl $11,%r14d + xorl %eax,%r13d + xorl %ecx,%r15d + + xorl %r10d,%edx + xorl %r8d,%r14d + addl %r15d,%r12d + movl %r9d,%r15d + + rorl $6,%r13d + andl %r8d,%edx + andl %r10d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%edx + + addl %r12d,%r11d + addl %r12d,%edx + leaq 1(%rdi),%rdi + addl %r14d,%edx + + movl 52(%rsi),%r12d + movl %r11d,%r13d + movl %edx,%r14d + bswapl %r12d + rorl $14,%r13d + movl %eax,%r15d + movl %r12d,52(%rsp) + + rorl $9,%r14d + xorl %r11d,%r13d + xorl %ebx,%r15d + + rorl $5,%r13d + addl %ecx,%r12d + xorl %edx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r11d,%r15d + movl %r8d,%ecx + + rorl $11,%r14d + xorl %r11d,%r13d + xorl %ebx,%r15d + + xorl %r9d,%ecx + xorl %edx,%r14d + addl %r15d,%r12d + movl %r8d,%r15d + + rorl $6,%r13d + andl %edx,%ecx + andl %r9d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%ecx + + addl %r12d,%r10d + addl %r12d,%ecx + leaq 1(%rdi),%rdi + addl %r14d,%ecx + + movl 56(%rsi),%r12d + movl %r10d,%r13d + movl %ecx,%r14d + bswapl %r12d + rorl $14,%r13d + movl %r11d,%r15d + movl %r12d,56(%rsp) + + rorl $9,%r14d + xorl %r10d,%r13d + xorl %eax,%r15d + + rorl $5,%r13d + addl %ebx,%r12d + xorl %ecx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r10d,%r15d + movl %edx,%ebx + + rorl $11,%r14d + xorl %r10d,%r13d + xorl %eax,%r15d + + xorl %r8d,%ebx + xorl %ecx,%r14d + addl %r15d,%r12d + movl %edx,%r15d + + rorl $6,%r13d + andl %ecx,%ebx + andl %r8d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%ebx + + addl %r12d,%r9d + addl %r12d,%ebx + leaq 1(%rdi),%rdi + addl %r14d,%ebx + + movl 60(%rsi),%r12d + movl %r9d,%r13d + movl %ebx,%r14d + bswapl %r12d + rorl $14,%r13d + movl %r10d,%r15d + movl %r12d,60(%rsp) + + rorl $9,%r14d + xorl %r9d,%r13d + xorl %r11d,%r15d + + rorl $5,%r13d + addl %eax,%r12d + xorl %ebx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r9d,%r15d + movl %ecx,%eax + + rorl $11,%r14d + xorl %r9d,%r13d + xorl %r11d,%r15d + + xorl %edx,%eax + xorl %ebx,%r14d + addl %r15d,%r12d + movl %ecx,%r15d + + rorl $6,%r13d + andl %ebx,%eax + andl %edx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%eax + + addl %r12d,%r8d + addl %r12d,%eax + leaq 1(%rdi),%rdi + addl %r14d,%eax + + jmp .Lrounds_16_xx +.p2align 4 +.Lrounds_16_xx: + movl 4(%rsp),%r13d + movl 56(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 36(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 0(%rsp),%r12d + movl %r8d,%r13d + addl %r14d,%r12d + movl %eax,%r14d + rorl $14,%r13d + movl %r9d,%r15d + movl %r12d,0(%rsp) + + rorl $9,%r14d + xorl %r8d,%r13d + xorl %r10d,%r15d + + rorl $5,%r13d + addl %r11d,%r12d + xorl %eax,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r8d,%r15d + movl %ebx,%r11d + + rorl $11,%r14d + xorl %r8d,%r13d + xorl %r10d,%r15d + + xorl %ecx,%r11d + xorl %eax,%r14d + addl %r15d,%r12d + movl %ebx,%r15d + + rorl $6,%r13d + andl %eax,%r11d + andl %ecx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r11d + + addl %r12d,%edx + addl %r12d,%r11d + leaq 1(%rdi),%rdi + addl %r14d,%r11d + + movl 8(%rsp),%r13d + movl 60(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 40(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 4(%rsp),%r12d + movl %edx,%r13d + addl %r14d,%r12d + movl %r11d,%r14d + rorl $14,%r13d + movl %r8d,%r15d + movl %r12d,4(%rsp) + + rorl $9,%r14d + xorl %edx,%r13d + xorl %r9d,%r15d + + rorl $5,%r13d + addl %r10d,%r12d + xorl %r11d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %edx,%r15d + movl %eax,%r10d + + rorl $11,%r14d + xorl %edx,%r13d + xorl %r9d,%r15d + + xorl %ebx,%r10d + xorl %r11d,%r14d + addl %r15d,%r12d + movl %eax,%r15d + + rorl $6,%r13d + andl %r11d,%r10d + andl %ebx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r10d + + addl %r12d,%ecx + addl %r12d,%r10d + leaq 1(%rdi),%rdi + addl %r14d,%r10d + + movl 12(%rsp),%r13d + movl 0(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 44(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 8(%rsp),%r12d + movl %ecx,%r13d + addl %r14d,%r12d + movl %r10d,%r14d + rorl $14,%r13d + movl %edx,%r15d + movl %r12d,8(%rsp) + + rorl $9,%r14d + xorl %ecx,%r13d + xorl %r8d,%r15d + + rorl $5,%r13d + addl %r9d,%r12d + xorl %r10d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %ecx,%r15d + movl %r11d,%r9d + + rorl $11,%r14d + xorl %ecx,%r13d + xorl %r8d,%r15d + + xorl %eax,%r9d + xorl %r10d,%r14d + addl %r15d,%r12d + movl %r11d,%r15d + + rorl $6,%r13d + andl %r10d,%r9d + andl %eax,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r9d + + addl %r12d,%ebx + addl %r12d,%r9d + leaq 1(%rdi),%rdi + addl %r14d,%r9d + + movl 16(%rsp),%r13d + movl 4(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 48(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 12(%rsp),%r12d + movl %ebx,%r13d + addl %r14d,%r12d + movl %r9d,%r14d + rorl $14,%r13d + movl %ecx,%r15d + movl %r12d,12(%rsp) + + rorl $9,%r14d + xorl %ebx,%r13d + xorl %edx,%r15d + + rorl $5,%r13d + addl %r8d,%r12d + xorl %r9d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %ebx,%r15d + movl %r10d,%r8d + + rorl $11,%r14d + xorl %ebx,%r13d + xorl %edx,%r15d + + xorl %r11d,%r8d + xorl %r9d,%r14d + addl %r15d,%r12d + movl %r10d,%r15d + + rorl $6,%r13d + andl %r9d,%r8d + andl %r11d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r8d + + addl %r12d,%eax + addl %r12d,%r8d + leaq 1(%rdi),%rdi + addl %r14d,%r8d + + movl 20(%rsp),%r13d + movl 8(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 52(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 16(%rsp),%r12d + movl %eax,%r13d + addl %r14d,%r12d + movl %r8d,%r14d + rorl $14,%r13d + movl %ebx,%r15d + movl %r12d,16(%rsp) + + rorl $9,%r14d + xorl %eax,%r13d + xorl %ecx,%r15d + + rorl $5,%r13d + addl %edx,%r12d + xorl %r8d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %eax,%r15d + movl %r9d,%edx + + rorl $11,%r14d + xorl %eax,%r13d + xorl %ecx,%r15d + + xorl %r10d,%edx + xorl %r8d,%r14d + addl %r15d,%r12d + movl %r9d,%r15d + + rorl $6,%r13d + andl %r8d,%edx + andl %r10d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%edx + + addl %r12d,%r11d + addl %r12d,%edx + leaq 1(%rdi),%rdi + addl %r14d,%edx + + movl 24(%rsp),%r13d + movl 12(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 56(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 20(%rsp),%r12d + movl %r11d,%r13d + addl %r14d,%r12d + movl %edx,%r14d + rorl $14,%r13d + movl %eax,%r15d + movl %r12d,20(%rsp) + + rorl $9,%r14d + xorl %r11d,%r13d + xorl %ebx,%r15d + + rorl $5,%r13d + addl %ecx,%r12d + xorl %edx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r11d,%r15d + movl %r8d,%ecx + + rorl $11,%r14d + xorl %r11d,%r13d + xorl %ebx,%r15d + + xorl %r9d,%ecx + xorl %edx,%r14d + addl %r15d,%r12d + movl %r8d,%r15d + + rorl $6,%r13d + andl %edx,%ecx + andl %r9d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%ecx + + addl %r12d,%r10d + addl %r12d,%ecx + leaq 1(%rdi),%rdi + addl %r14d,%ecx + + movl 28(%rsp),%r13d + movl 16(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 60(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 24(%rsp),%r12d + movl %r10d,%r13d + addl %r14d,%r12d + movl %ecx,%r14d + rorl $14,%r13d + movl %r11d,%r15d + movl %r12d,24(%rsp) + + rorl $9,%r14d + xorl %r10d,%r13d + xorl %eax,%r15d + + rorl $5,%r13d + addl %ebx,%r12d + xorl %ecx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r10d,%r15d + movl %edx,%ebx + + rorl $11,%r14d + xorl %r10d,%r13d + xorl %eax,%r15d + + xorl %r8d,%ebx + xorl %ecx,%r14d + addl %r15d,%r12d + movl %edx,%r15d + + rorl $6,%r13d + andl %ecx,%ebx + andl %r8d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%ebx + + addl %r12d,%r9d + addl %r12d,%ebx + leaq 1(%rdi),%rdi + addl %r14d,%ebx + + movl 32(%rsp),%r13d + movl 20(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 0(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 28(%rsp),%r12d + movl %r9d,%r13d + addl %r14d,%r12d + movl %ebx,%r14d + rorl $14,%r13d + movl %r10d,%r15d + movl %r12d,28(%rsp) + + rorl $9,%r14d + xorl %r9d,%r13d + xorl %r11d,%r15d + + rorl $5,%r13d + addl %eax,%r12d + xorl %ebx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r9d,%r15d + movl %ecx,%eax + + rorl $11,%r14d + xorl %r9d,%r13d + xorl %r11d,%r15d + + xorl %edx,%eax + xorl %ebx,%r14d + addl %r15d,%r12d + movl %ecx,%r15d + + rorl $6,%r13d + andl %ebx,%eax + andl %edx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%eax + + addl %r12d,%r8d + addl %r12d,%eax + leaq 1(%rdi),%rdi + addl %r14d,%eax + + movl 36(%rsp),%r13d + movl 24(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 4(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 32(%rsp),%r12d + movl %r8d,%r13d + addl %r14d,%r12d + movl %eax,%r14d + rorl $14,%r13d + movl %r9d,%r15d + movl %r12d,32(%rsp) + + rorl $9,%r14d + xorl %r8d,%r13d + xorl %r10d,%r15d + + rorl $5,%r13d + addl %r11d,%r12d + xorl %eax,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r8d,%r15d + movl %ebx,%r11d + + rorl $11,%r14d + xorl %r8d,%r13d + xorl %r10d,%r15d + + xorl %ecx,%r11d + xorl %eax,%r14d + addl %r15d,%r12d + movl %ebx,%r15d + + rorl $6,%r13d + andl %eax,%r11d + andl %ecx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r11d + + addl %r12d,%edx + addl %r12d,%r11d + leaq 1(%rdi),%rdi + addl %r14d,%r11d + + movl 40(%rsp),%r13d + movl 28(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 8(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 36(%rsp),%r12d + movl %edx,%r13d + addl %r14d,%r12d + movl %r11d,%r14d + rorl $14,%r13d + movl %r8d,%r15d + movl %r12d,36(%rsp) + + rorl $9,%r14d + xorl %edx,%r13d + xorl %r9d,%r15d + + rorl $5,%r13d + addl %r10d,%r12d + xorl %r11d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %edx,%r15d + movl %eax,%r10d + + rorl $11,%r14d + xorl %edx,%r13d + xorl %r9d,%r15d + + xorl %ebx,%r10d + xorl %r11d,%r14d + addl %r15d,%r12d + movl %eax,%r15d + + rorl $6,%r13d + andl %r11d,%r10d + andl %ebx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r10d + + addl %r12d,%ecx + addl %r12d,%r10d + leaq 1(%rdi),%rdi + addl %r14d,%r10d + + movl 44(%rsp),%r13d + movl 32(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 12(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 40(%rsp),%r12d + movl %ecx,%r13d + addl %r14d,%r12d + movl %r10d,%r14d + rorl $14,%r13d + movl %edx,%r15d + movl %r12d,40(%rsp) + + rorl $9,%r14d + xorl %ecx,%r13d + xorl %r8d,%r15d + + rorl $5,%r13d + addl %r9d,%r12d + xorl %r10d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %ecx,%r15d + movl %r11d,%r9d + + rorl $11,%r14d + xorl %ecx,%r13d + xorl %r8d,%r15d + + xorl %eax,%r9d + xorl %r10d,%r14d + addl %r15d,%r12d + movl %r11d,%r15d + + rorl $6,%r13d + andl %r10d,%r9d + andl %eax,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r9d + + addl %r12d,%ebx + addl %r12d,%r9d + leaq 1(%rdi),%rdi + addl %r14d,%r9d + + movl 48(%rsp),%r13d + movl 36(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 16(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 44(%rsp),%r12d + movl %ebx,%r13d + addl %r14d,%r12d + movl %r9d,%r14d + rorl $14,%r13d + movl %ecx,%r15d + movl %r12d,44(%rsp) + + rorl $9,%r14d + xorl %ebx,%r13d + xorl %edx,%r15d + + rorl $5,%r13d + addl %r8d,%r12d + xorl %r9d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %ebx,%r15d + movl %r10d,%r8d + + rorl $11,%r14d + xorl %ebx,%r13d + xorl %edx,%r15d + + xorl %r11d,%r8d + xorl %r9d,%r14d + addl %r15d,%r12d + movl %r10d,%r15d + + rorl $6,%r13d + andl %r9d,%r8d + andl %r11d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%r8d + + addl %r12d,%eax + addl %r12d,%r8d + leaq 1(%rdi),%rdi + addl %r14d,%r8d + + movl 52(%rsp),%r13d + movl 40(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 20(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 48(%rsp),%r12d + movl %eax,%r13d + addl %r14d,%r12d + movl %r8d,%r14d + rorl $14,%r13d + movl %ebx,%r15d + movl %r12d,48(%rsp) + + rorl $9,%r14d + xorl %eax,%r13d + xorl %ecx,%r15d + + rorl $5,%r13d + addl %edx,%r12d + xorl %r8d,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %eax,%r15d + movl %r9d,%edx + + rorl $11,%r14d + xorl %eax,%r13d + xorl %ecx,%r15d + + xorl %r10d,%edx + xorl %r8d,%r14d + addl %r15d,%r12d + movl %r9d,%r15d + + rorl $6,%r13d + andl %r8d,%edx + andl %r10d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%edx + + addl %r12d,%r11d + addl %r12d,%edx + leaq 1(%rdi),%rdi + addl %r14d,%edx + + movl 56(%rsp),%r13d + movl 44(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 24(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 52(%rsp),%r12d + movl %r11d,%r13d + addl %r14d,%r12d + movl %edx,%r14d + rorl $14,%r13d + movl %eax,%r15d + movl %r12d,52(%rsp) + + rorl $9,%r14d + xorl %r11d,%r13d + xorl %ebx,%r15d + + rorl $5,%r13d + addl %ecx,%r12d + xorl %edx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r11d,%r15d + movl %r8d,%ecx + + rorl $11,%r14d + xorl %r11d,%r13d + xorl %ebx,%r15d + + xorl %r9d,%ecx + xorl %edx,%r14d + addl %r15d,%r12d + movl %r8d,%r15d + + rorl $6,%r13d + andl %edx,%ecx + andl %r9d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%ecx + + addl %r12d,%r10d + addl %r12d,%ecx + leaq 1(%rdi),%rdi + addl %r14d,%ecx + + movl 60(%rsp),%r13d + movl 48(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 28(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 56(%rsp),%r12d + movl %r10d,%r13d + addl %r14d,%r12d + movl %ecx,%r14d + rorl $14,%r13d + movl %r11d,%r15d + movl %r12d,56(%rsp) + + rorl $9,%r14d + xorl %r10d,%r13d + xorl %eax,%r15d + + rorl $5,%r13d + addl %ebx,%r12d + xorl %ecx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r10d,%r15d + movl %edx,%ebx + + rorl $11,%r14d + xorl %r10d,%r13d + xorl %eax,%r15d + + xorl %r8d,%ebx + xorl %ecx,%r14d + addl %r15d,%r12d + movl %edx,%r15d + + rorl $6,%r13d + andl %ecx,%ebx + andl %r8d,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%ebx + + addl %r12d,%r9d + addl %r12d,%ebx + leaq 1(%rdi),%rdi + addl %r14d,%ebx + + movl 0(%rsp),%r13d + movl 52(%rsp),%r14d + movl %r13d,%r12d + movl %r14d,%r15d + + rorl $11,%r12d + xorl %r13d,%r12d + shrl $3,%r13d + + rorl $7,%r12d + xorl %r12d,%r13d + movl 32(%rsp),%r12d + + rorl $2,%r15d + xorl %r14d,%r15d + shrl $10,%r14d + + rorl $17,%r15d + addl %r13d,%r12d + xorl %r15d,%r14d + + addl 60(%rsp),%r12d + movl %r9d,%r13d + addl %r14d,%r12d + movl %ebx,%r14d + rorl $14,%r13d + movl %r10d,%r15d + movl %r12d,60(%rsp) + + rorl $9,%r14d + xorl %r9d,%r13d + xorl %r11d,%r15d + + rorl $5,%r13d + addl %eax,%r12d + xorl %ebx,%r14d + + addl (%rbp,%rdi,4),%r12d + andl %r9d,%r15d + movl %ecx,%eax + + rorl $11,%r14d + xorl %r9d,%r13d + xorl %r11d,%r15d + + xorl %edx,%eax + xorl %ebx,%r14d + addl %r15d,%r12d + movl %ecx,%r15d + + rorl $6,%r13d + andl %ebx,%eax + andl %edx,%r15d + + rorl $2,%r14d + addl %r13d,%r12d + addl %r15d,%eax + + addl %r12d,%r8d + addl %r12d,%eax + leaq 1(%rdi),%rdi + addl %r14d,%eax + + cmpq $64,%rdi + jb .Lrounds_16_xx + + movq 64+0(%rsp),%rdi + leaq 64(%rsi),%rsi + + addl 0(%rdi),%eax + addl 4(%rdi),%ebx + addl 8(%rdi),%ecx + addl 12(%rdi),%edx + addl 16(%rdi),%r8d + addl 20(%rdi),%r9d + addl 24(%rdi),%r10d + addl 28(%rdi),%r11d + + cmpq 64+16(%rsp),%rsi + + movl %eax,0(%rdi) + movl %ebx,4(%rdi) + movl %ecx,8(%rdi) + movl %edx,12(%rdi) + movl %r8d,16(%rdi) + movl %r9d,20(%rdi) + movl %r10d,24(%rdi) + movl %r11d,28(%rdi) + jb .Lloop + + movq 64+24(%rsp),%rsi + movq (%rsi),%r15 + movq 8(%rsi),%r14 + movq 16(%rsi),%r13 + movq 24(%rsi),%r12 + movq 32(%rsi),%rbp + movq 40(%rsi),%rbx + leaq 48(%rsi),%rsp +.Lepilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_sha256_block_data_order: +.p2align 6 + +K256: +.long 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5 +.long 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5 +.long 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3 +.long 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174 +.long 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc +.long 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da +.long 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7 +.long 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967 +.long 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13 +.long 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85 +.long 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3 +.long 0xd192e819,0xd6990624,0xf40e3585,0x106aa070 +.long 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5 +.long 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3 +.long 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208 +.long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 diff --git a/crypto/sha/sha256.c b/crypto/sha/sha256.c index d5846603..9c05d3b0 100644 --- a/crypto/sha/sha256.c +++ b/crypto/sha/sha256.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha256.c,v 1.9 2015/09/10 15:56:26 jsing Exp $ */ +/* $OpenBSD: sha256.c,v 1.10 2019/01/21 23:20:31 jsg Exp $ */ /* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved * according to the OpenSSL license [found in ../../LICENSE]. @@ -81,7 +81,7 @@ int SHA224_Final (unsigned char *md, SHA256_CTX *c) * default: case below covers for it. It's not clear however if it's * permitted to truncate to amount of bytes not divisible by 4. I bet not, * but if it is, then default: case shall be extended. For reference. - * Idea behind separate cases for pre-defined lenghts is to let the + * Idea behind separate cases for pre-defined lengths is to let the * compiler decide if it's appropriate to unroll small loops. */ #define HASH_MAKE_STRING(c,s) do { \ diff --git a/crypto/sha/sha512-elf-armv4.S b/crypto/sha/sha512-elf-armv4.S new file mode 100644 index 00000000..8abf8d56 --- /dev/null +++ b/crypto/sha/sha512-elf-armv4.S @@ -0,0 +1,1786 @@ +#include "arm_arch.h" +#ifdef __ARMEL__ +# define LO 0 +# define HI 4 +# define WORD64(hi0,lo0,hi1,lo1) .word lo0,hi0, lo1,hi1 +#else +# define HI 0 +# define LO 4 +# define WORD64(hi0,lo0,hi1,lo1) .word hi0,lo0, hi1,lo1 +#endif + +.text +.code 32 +.type K512,%object +.align 5 +K512: +WORD64(0x428a2f98,0xd728ae22, 0x71374491,0x23ef65cd) +WORD64(0xb5c0fbcf,0xec4d3b2f, 0xe9b5dba5,0x8189dbbc) +WORD64(0x3956c25b,0xf348b538, 0x59f111f1,0xb605d019) +WORD64(0x923f82a4,0xaf194f9b, 0xab1c5ed5,0xda6d8118) +WORD64(0xd807aa98,0xa3030242, 0x12835b01,0x45706fbe) +WORD64(0x243185be,0x4ee4b28c, 0x550c7dc3,0xd5ffb4e2) +WORD64(0x72be5d74,0xf27b896f, 0x80deb1fe,0x3b1696b1) +WORD64(0x9bdc06a7,0x25c71235, 0xc19bf174,0xcf692694) +WORD64(0xe49b69c1,0x9ef14ad2, 0xefbe4786,0x384f25e3) +WORD64(0x0fc19dc6,0x8b8cd5b5, 0x240ca1cc,0x77ac9c65) +WORD64(0x2de92c6f,0x592b0275, 0x4a7484aa,0x6ea6e483) +WORD64(0x5cb0a9dc,0xbd41fbd4, 0x76f988da,0x831153b5) +WORD64(0x983e5152,0xee66dfab, 0xa831c66d,0x2db43210) +WORD64(0xb00327c8,0x98fb213f, 0xbf597fc7,0xbeef0ee4) +WORD64(0xc6e00bf3,0x3da88fc2, 0xd5a79147,0x930aa725) +WORD64(0x06ca6351,0xe003826f, 0x14292967,0x0a0e6e70) +WORD64(0x27b70a85,0x46d22ffc, 0x2e1b2138,0x5c26c926) +WORD64(0x4d2c6dfc,0x5ac42aed, 0x53380d13,0x9d95b3df) +WORD64(0x650a7354,0x8baf63de, 0x766a0abb,0x3c77b2a8) +WORD64(0x81c2c92e,0x47edaee6, 0x92722c85,0x1482353b) +WORD64(0xa2bfe8a1,0x4cf10364, 0xa81a664b,0xbc423001) +WORD64(0xc24b8b70,0xd0f89791, 0xc76c51a3,0x0654be30) +WORD64(0xd192e819,0xd6ef5218, 0xd6990624,0x5565a910) +WORD64(0xf40e3585,0x5771202a, 0x106aa070,0x32bbd1b8) +WORD64(0x19a4c116,0xb8d2d0c8, 0x1e376c08,0x5141ab53) +WORD64(0x2748774c,0xdf8eeb99, 0x34b0bcb5,0xe19b48a8) +WORD64(0x391c0cb3,0xc5c95a63, 0x4ed8aa4a,0xe3418acb) +WORD64(0x5b9cca4f,0x7763e373, 0x682e6ff3,0xd6b2b8a3) +WORD64(0x748f82ee,0x5defb2fc, 0x78a5636f,0x43172f60) +WORD64(0x84c87814,0xa1f0ab72, 0x8cc70208,0x1a6439ec) +WORD64(0x90befffa,0x23631e28, 0xa4506ceb,0xde82bde9) +WORD64(0xbef9a3f7,0xb2c67915, 0xc67178f2,0xe372532b) +WORD64(0xca273ece,0xea26619c, 0xd186b8c7,0x21c0c207) +WORD64(0xeada7dd6,0xcde0eb1e, 0xf57d4f7f,0xee6ed178) +WORD64(0x06f067aa,0x72176fba, 0x0a637dc5,0xa2c898a6) +WORD64(0x113f9804,0xbef90dae, 0x1b710b35,0x131c471b) +WORD64(0x28db77f5,0x23047d84, 0x32caab7b,0x40c72493) +WORD64(0x3c9ebe0a,0x15c9bebc, 0x431d67c4,0x9c100d4c) +WORD64(0x4cc5d4be,0xcb3e42b6, 0x597f299c,0xfc657e2a) +WORD64(0x5fcb6fab,0x3ad6faec, 0x6c44198c,0x4a475817) +.size K512,.-K512 +.LOPENSSL_armcap: +.word OPENSSL_armcap_P-sha512_block_data_order +.skip 32-4 + +.global sha512_block_data_order +.type sha512_block_data_order,%function +sha512_block_data_order: + sub r3,pc,#8 @ sha512_block_data_order + add r2,r1,r2,lsl#7 @ len to point at the end of inp +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) + ldr r12,.LOPENSSL_armcap + ldr r12,[r3,r12] @ OPENSSL_armcap_P + tst r12,#1 + bne .LNEON +#endif + stmdb sp!,{r4-r12,lr} + sub r14,r3,#672 @ K512 + sub sp,sp,#9*8 + + ldr r7,[r0,#32+LO] + ldr r8,[r0,#32+HI] + ldr r9, [r0,#48+LO] + ldr r10, [r0,#48+HI] + ldr r11, [r0,#56+LO] + ldr r12, [r0,#56+HI] +.Loop: + str r9, [sp,#48+0] + str r10, [sp,#48+4] + str r11, [sp,#56+0] + str r12, [sp,#56+4] + ldr r5,[r0,#0+LO] + ldr r6,[r0,#0+HI] + ldr r3,[r0,#8+LO] + ldr r4,[r0,#8+HI] + ldr r9, [r0,#16+LO] + ldr r10, [r0,#16+HI] + ldr r11, [r0,#24+LO] + ldr r12, [r0,#24+HI] + str r3,[sp,#8+0] + str r4,[sp,#8+4] + str r9, [sp,#16+0] + str r10, [sp,#16+4] + str r11, [sp,#24+0] + str r12, [sp,#24+4] + ldr r3,[r0,#40+LO] + ldr r4,[r0,#40+HI] + str r3,[sp,#40+0] + str r4,[sp,#40+4] + +.L00_15: +#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT) + ldrb r3,[r1,#7] + ldrb r9, [r1,#6] + ldrb r10, [r1,#5] + ldrb r11, [r1,#4] + ldrb r4,[r1,#3] + ldrb r12, [r1,#2] + orr r3,r3,r9,lsl#8 + ldrb r9, [r1,#1] + orr r3,r3,r10,lsl#16 + ldrb r10, [r1],#8 + orr r3,r3,r11,lsl#24 + orr r4,r4,r12,lsl#8 + orr r4,r4,r9,lsl#16 + orr r4,r4,r10,lsl#24 +#else + ldr r3,[r1,#4] + ldr r4,[r1],#8 +#ifdef __ARMEL__ + rev r3,r3 + rev r4,r4 +#endif +#endif + @ Sigma1(x) (ROTR((x),14) ^ ROTR((x),18) ^ ROTR((x),41)) + @ LO lo>>14^hi<<18 ^ lo>>18^hi<<14 ^ hi>>9^lo<<23 + @ HI hi>>14^lo<<18 ^ hi>>18^lo<<14 ^ lo>>9^hi<<23 + mov r9,r7,lsr#14 + str r3,[sp,#64+0] + mov r10,r8,lsr#14 + str r4,[sp,#64+4] + eor r9,r9,r8,lsl#18 + ldr r11,[sp,#56+0] @ h.lo + eor r10,r10,r7,lsl#18 + ldr r12,[sp,#56+4] @ h.hi + eor r9,r9,r7,lsr#18 + eor r10,r10,r8,lsr#18 + eor r9,r9,r8,lsl#14 + eor r10,r10,r7,lsl#14 + eor r9,r9,r8,lsr#9 + eor r10,r10,r7,lsr#9 + eor r9,r9,r7,lsl#23 + eor r10,r10,r8,lsl#23 @ Sigma1(e) + adds r3,r3,r9 + ldr r9,[sp,#40+0] @ f.lo + adc r4,r4,r10 @ T += Sigma1(e) + ldr r10,[sp,#40+4] @ f.hi + adds r3,r3,r11 + ldr r11,[sp,#48+0] @ g.lo + adc r4,r4,r12 @ T += h + ldr r12,[sp,#48+4] @ g.hi + + eor r9,r9,r11 + str r7,[sp,#32+0] + eor r10,r10,r12 + str r8,[sp,#32+4] + and r9,r9,r7 + str r5,[sp,#0+0] + and r10,r10,r8 + str r6,[sp,#0+4] + eor r9,r9,r11 + ldr r11,[r14,#LO] @ K[i].lo + eor r10,r10,r12 @ Ch(e,f,g) + ldr r12,[r14,#HI] @ K[i].hi + + adds r3,r3,r9 + ldr r7,[sp,#24+0] @ d.lo + adc r4,r4,r10 @ T += Ch(e,f,g) + ldr r8,[sp,#24+4] @ d.hi + adds r3,r3,r11 + and r9,r11,#0xff + adc r4,r4,r12 @ T += K[i] + adds r7,r7,r3 + ldr r11,[sp,#8+0] @ b.lo + adc r8,r8,r4 @ d += T + teq r9,#148 + + ldr r12,[sp,#16+0] @ c.lo + orreq r14,r14,#1 + @ Sigma0(x) (ROTR((x),28) ^ ROTR((x),34) ^ ROTR((x),39)) + @ LO lo>>28^hi<<4 ^ hi>>2^lo<<30 ^ hi>>7^lo<<25 + @ HI hi>>28^lo<<4 ^ lo>>2^hi<<30 ^ lo>>7^hi<<25 + mov r9,r5,lsr#28 + mov r10,r6,lsr#28 + eor r9,r9,r6,lsl#4 + eor r10,r10,r5,lsl#4 + eor r9,r9,r6,lsr#2 + eor r10,r10,r5,lsr#2 + eor r9,r9,r5,lsl#30 + eor r10,r10,r6,lsl#30 + eor r9,r9,r6,lsr#7 + eor r10,r10,r5,lsr#7 + eor r9,r9,r5,lsl#25 + eor r10,r10,r6,lsl#25 @ Sigma0(a) + adds r3,r3,r9 + and r9,r5,r11 + adc r4,r4,r10 @ T += Sigma0(a) + + ldr r10,[sp,#8+4] @ b.hi + orr r5,r5,r11 + ldr r11,[sp,#16+4] @ c.hi + and r5,r5,r12 + and r12,r6,r10 + orr r6,r6,r10 + orr r5,r5,r9 @ Maj(a,b,c).lo + and r6,r6,r11 + adds r5,r5,r3 + orr r6,r6,r12 @ Maj(a,b,c).hi + sub sp,sp,#8 + adc r6,r6,r4 @ h += T + tst r14,#1 + add r14,r14,#8 + tst r14,#1 + beq .L00_15 + ldr r9,[sp,#184+0] + ldr r10,[sp,#184+4] + bic r14,r14,#1 +.L16_79: + @ sigma0(x) (ROTR((x),1) ^ ROTR((x),8) ^ ((x)>>7)) + @ LO lo>>1^hi<<31 ^ lo>>8^hi<<24 ^ lo>>7^hi<<25 + @ HI hi>>1^lo<<31 ^ hi>>8^lo<<24 ^ hi>>7 + mov r3,r9,lsr#1 + ldr r11,[sp,#80+0] + mov r4,r10,lsr#1 + ldr r12,[sp,#80+4] + eor r3,r3,r10,lsl#31 + eor r4,r4,r9,lsl#31 + eor r3,r3,r9,lsr#8 + eor r4,r4,r10,lsr#8 + eor r3,r3,r10,lsl#24 + eor r4,r4,r9,lsl#24 + eor r3,r3,r9,lsr#7 + eor r4,r4,r10,lsr#7 + eor r3,r3,r10,lsl#25 + + @ sigma1(x) (ROTR((x),19) ^ ROTR((x),61) ^ ((x)>>6)) + @ LO lo>>19^hi<<13 ^ hi>>29^lo<<3 ^ lo>>6^hi<<26 + @ HI hi>>19^lo<<13 ^ lo>>29^hi<<3 ^ hi>>6 + mov r9,r11,lsr#19 + mov r10,r12,lsr#19 + eor r9,r9,r12,lsl#13 + eor r10,r10,r11,lsl#13 + eor r9,r9,r12,lsr#29 + eor r10,r10,r11,lsr#29 + eor r9,r9,r11,lsl#3 + eor r10,r10,r12,lsl#3 + eor r9,r9,r11,lsr#6 + eor r10,r10,r12,lsr#6 + ldr r11,[sp,#120+0] + eor r9,r9,r12,lsl#26 + + ldr r12,[sp,#120+4] + adds r3,r3,r9 + ldr r9,[sp,#192+0] + adc r4,r4,r10 + + ldr r10,[sp,#192+4] + adds r3,r3,r11 + adc r4,r4,r12 + adds r3,r3,r9 + adc r4,r4,r10 + @ Sigma1(x) (ROTR((x),14) ^ ROTR((x),18) ^ ROTR((x),41)) + @ LO lo>>14^hi<<18 ^ lo>>18^hi<<14 ^ hi>>9^lo<<23 + @ HI hi>>14^lo<<18 ^ hi>>18^lo<<14 ^ lo>>9^hi<<23 + mov r9,r7,lsr#14 + str r3,[sp,#64+0] + mov r10,r8,lsr#14 + str r4,[sp,#64+4] + eor r9,r9,r8,lsl#18 + ldr r11,[sp,#56+0] @ h.lo + eor r10,r10,r7,lsl#18 + ldr r12,[sp,#56+4] @ h.hi + eor r9,r9,r7,lsr#18 + eor r10,r10,r8,lsr#18 + eor r9,r9,r8,lsl#14 + eor r10,r10,r7,lsl#14 + eor r9,r9,r8,lsr#9 + eor r10,r10,r7,lsr#9 + eor r9,r9,r7,lsl#23 + eor r10,r10,r8,lsl#23 @ Sigma1(e) + adds r3,r3,r9 + ldr r9,[sp,#40+0] @ f.lo + adc r4,r4,r10 @ T += Sigma1(e) + ldr r10,[sp,#40+4] @ f.hi + adds r3,r3,r11 + ldr r11,[sp,#48+0] @ g.lo + adc r4,r4,r12 @ T += h + ldr r12,[sp,#48+4] @ g.hi + + eor r9,r9,r11 + str r7,[sp,#32+0] + eor r10,r10,r12 + str r8,[sp,#32+4] + and r9,r9,r7 + str r5,[sp,#0+0] + and r10,r10,r8 + str r6,[sp,#0+4] + eor r9,r9,r11 + ldr r11,[r14,#LO] @ K[i].lo + eor r10,r10,r12 @ Ch(e,f,g) + ldr r12,[r14,#HI] @ K[i].hi + + adds r3,r3,r9 + ldr r7,[sp,#24+0] @ d.lo + adc r4,r4,r10 @ T += Ch(e,f,g) + ldr r8,[sp,#24+4] @ d.hi + adds r3,r3,r11 + and r9,r11,#0xff + adc r4,r4,r12 @ T += K[i] + adds r7,r7,r3 + ldr r11,[sp,#8+0] @ b.lo + adc r8,r8,r4 @ d += T + teq r9,#23 + + ldr r12,[sp,#16+0] @ c.lo + orreq r14,r14,#1 + @ Sigma0(x) (ROTR((x),28) ^ ROTR((x),34) ^ ROTR((x),39)) + @ LO lo>>28^hi<<4 ^ hi>>2^lo<<30 ^ hi>>7^lo<<25 + @ HI hi>>28^lo<<4 ^ lo>>2^hi<<30 ^ lo>>7^hi<<25 + mov r9,r5,lsr#28 + mov r10,r6,lsr#28 + eor r9,r9,r6,lsl#4 + eor r10,r10,r5,lsl#4 + eor r9,r9,r6,lsr#2 + eor r10,r10,r5,lsr#2 + eor r9,r9,r5,lsl#30 + eor r10,r10,r6,lsl#30 + eor r9,r9,r6,lsr#7 + eor r10,r10,r5,lsr#7 + eor r9,r9,r5,lsl#25 + eor r10,r10,r6,lsl#25 @ Sigma0(a) + adds r3,r3,r9 + and r9,r5,r11 + adc r4,r4,r10 @ T += Sigma0(a) + + ldr r10,[sp,#8+4] @ b.hi + orr r5,r5,r11 + ldr r11,[sp,#16+4] @ c.hi + and r5,r5,r12 + and r12,r6,r10 + orr r6,r6,r10 + orr r5,r5,r9 @ Maj(a,b,c).lo + and r6,r6,r11 + adds r5,r5,r3 + orr r6,r6,r12 @ Maj(a,b,c).hi + sub sp,sp,#8 + adc r6,r6,r4 @ h += T + tst r14,#1 + add r14,r14,#8 + ldreq r9,[sp,#184+0] + ldreq r10,[sp,#184+4] + beq .L16_79 + bic r14,r14,#1 + + ldr r3,[sp,#8+0] + ldr r4,[sp,#8+4] + ldr r9, [r0,#0+LO] + ldr r10, [r0,#0+HI] + ldr r11, [r0,#8+LO] + ldr r12, [r0,#8+HI] + adds r9,r5,r9 + str r9, [r0,#0+LO] + adc r10,r6,r10 + str r10, [r0,#0+HI] + adds r11,r3,r11 + str r11, [r0,#8+LO] + adc r12,r4,r12 + str r12, [r0,#8+HI] + + ldr r5,[sp,#16+0] + ldr r6,[sp,#16+4] + ldr r3,[sp,#24+0] + ldr r4,[sp,#24+4] + ldr r9, [r0,#16+LO] + ldr r10, [r0,#16+HI] + ldr r11, [r0,#24+LO] + ldr r12, [r0,#24+HI] + adds r9,r5,r9 + str r9, [r0,#16+LO] + adc r10,r6,r10 + str r10, [r0,#16+HI] + adds r11,r3,r11 + str r11, [r0,#24+LO] + adc r12,r4,r12 + str r12, [r0,#24+HI] + + ldr r3,[sp,#40+0] + ldr r4,[sp,#40+4] + ldr r9, [r0,#32+LO] + ldr r10, [r0,#32+HI] + ldr r11, [r0,#40+LO] + ldr r12, [r0,#40+HI] + adds r7,r7,r9 + str r7,[r0,#32+LO] + adc r8,r8,r10 + str r8,[r0,#32+HI] + adds r11,r3,r11 + str r11, [r0,#40+LO] + adc r12,r4,r12 + str r12, [r0,#40+HI] + + ldr r5,[sp,#48+0] + ldr r6,[sp,#48+4] + ldr r3,[sp,#56+0] + ldr r4,[sp,#56+4] + ldr r9, [r0,#48+LO] + ldr r10, [r0,#48+HI] + ldr r11, [r0,#56+LO] + ldr r12, [r0,#56+HI] + adds r9,r5,r9 + str r9, [r0,#48+LO] + adc r10,r6,r10 + str r10, [r0,#48+HI] + adds r11,r3,r11 + str r11, [r0,#56+LO] + adc r12,r4,r12 + str r12, [r0,#56+HI] + + add sp,sp,#640 + sub r14,r14,#640 + + teq r1,r2 + bne .Loop + + add sp,sp,#8*9 @ destroy frame +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r12,pc} +#else + ldmia sp!,{r4-r12,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT) +.fpu neon + +.align 4 +.LNEON: + dmb @ errata #451034 on early Cortex A8 + vstmdb sp!,{d8-d15} @ ABI specification says so + sub r3,r3,#672 @ K512 + vldmia r0,{d16-d23} @ load context +.Loop_neon: + vshr.u64 d24,d20,#14 @ 0 +#if 0<16 + vld1.64 {d0},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d20,#18 + vshr.u64 d26,d20,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d20,#50 + vsli.64 d25,d20,#46 + vsli.64 d26,d20,#23 +#if 0<16 && defined(__ARMEL__) + vrev64.8 d0,d0 +#endif + vadd.i64 d27,d28,d23 + veor d29,d21,d22 + veor d24,d25 + vand d29,d20 + veor d24,d26 @ Sigma1(e) + veor d29,d22 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d16,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d16,#34 + vshr.u64 d26,d16,#39 + vsli.64 d24,d16,#36 + vsli.64 d25,d16,#30 + vsli.64 d26,d16,#25 + vadd.i64 d27,d0 + vorr d30,d16,d18 + vand d29,d16,d18 + veor d23,d24,d25 + vand d30,d17 + veor d23,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d23,d27 + vadd.i64 d19,d27 + vadd.i64 d23,d30 + vshr.u64 d24,d19,#14 @ 1 +#if 1<16 + vld1.64 {d1},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d19,#18 + vshr.u64 d26,d19,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d19,#50 + vsli.64 d25,d19,#46 + vsli.64 d26,d19,#23 +#if 1<16 && defined(__ARMEL__) + vrev64.8 d1,d1 +#endif + vadd.i64 d27,d28,d22 + veor d29,d20,d21 + veor d24,d25 + vand d29,d19 + veor d24,d26 @ Sigma1(e) + veor d29,d21 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d23,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d23,#34 + vshr.u64 d26,d23,#39 + vsli.64 d24,d23,#36 + vsli.64 d25,d23,#30 + vsli.64 d26,d23,#25 + vadd.i64 d27,d1 + vorr d30,d23,d17 + vand d29,d23,d17 + veor d22,d24,d25 + vand d30,d16 + veor d22,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d22,d27 + vadd.i64 d18,d27 + vadd.i64 d22,d30 + vshr.u64 d24,d18,#14 @ 2 +#if 2<16 + vld1.64 {d2},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d18,#18 + vshr.u64 d26,d18,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d18,#50 + vsli.64 d25,d18,#46 + vsli.64 d26,d18,#23 +#if 2<16 && defined(__ARMEL__) + vrev64.8 d2,d2 +#endif + vadd.i64 d27,d28,d21 + veor d29,d19,d20 + veor d24,d25 + vand d29,d18 + veor d24,d26 @ Sigma1(e) + veor d29,d20 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d22,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d22,#34 + vshr.u64 d26,d22,#39 + vsli.64 d24,d22,#36 + vsli.64 d25,d22,#30 + vsli.64 d26,d22,#25 + vadd.i64 d27,d2 + vorr d30,d22,d16 + vand d29,d22,d16 + veor d21,d24,d25 + vand d30,d23 + veor d21,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d21,d27 + vadd.i64 d17,d27 + vadd.i64 d21,d30 + vshr.u64 d24,d17,#14 @ 3 +#if 3<16 + vld1.64 {d3},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d17,#18 + vshr.u64 d26,d17,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d17,#50 + vsli.64 d25,d17,#46 + vsli.64 d26,d17,#23 +#if 3<16 && defined(__ARMEL__) + vrev64.8 d3,d3 +#endif + vadd.i64 d27,d28,d20 + veor d29,d18,d19 + veor d24,d25 + vand d29,d17 + veor d24,d26 @ Sigma1(e) + veor d29,d19 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d21,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d21,#34 + vshr.u64 d26,d21,#39 + vsli.64 d24,d21,#36 + vsli.64 d25,d21,#30 + vsli.64 d26,d21,#25 + vadd.i64 d27,d3 + vorr d30,d21,d23 + vand d29,d21,d23 + veor d20,d24,d25 + vand d30,d22 + veor d20,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d20,d27 + vadd.i64 d16,d27 + vadd.i64 d20,d30 + vshr.u64 d24,d16,#14 @ 4 +#if 4<16 + vld1.64 {d4},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d16,#18 + vshr.u64 d26,d16,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d16,#50 + vsli.64 d25,d16,#46 + vsli.64 d26,d16,#23 +#if 4<16 && defined(__ARMEL__) + vrev64.8 d4,d4 +#endif + vadd.i64 d27,d28,d19 + veor d29,d17,d18 + veor d24,d25 + vand d29,d16 + veor d24,d26 @ Sigma1(e) + veor d29,d18 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d20,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d20,#34 + vshr.u64 d26,d20,#39 + vsli.64 d24,d20,#36 + vsli.64 d25,d20,#30 + vsli.64 d26,d20,#25 + vadd.i64 d27,d4 + vorr d30,d20,d22 + vand d29,d20,d22 + veor d19,d24,d25 + vand d30,d21 + veor d19,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d19,d27 + vadd.i64 d23,d27 + vadd.i64 d19,d30 + vshr.u64 d24,d23,#14 @ 5 +#if 5<16 + vld1.64 {d5},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d23,#18 + vshr.u64 d26,d23,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d23,#50 + vsli.64 d25,d23,#46 + vsli.64 d26,d23,#23 +#if 5<16 && defined(__ARMEL__) + vrev64.8 d5,d5 +#endif + vadd.i64 d27,d28,d18 + veor d29,d16,d17 + veor d24,d25 + vand d29,d23 + veor d24,d26 @ Sigma1(e) + veor d29,d17 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d19,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d19,#34 + vshr.u64 d26,d19,#39 + vsli.64 d24,d19,#36 + vsli.64 d25,d19,#30 + vsli.64 d26,d19,#25 + vadd.i64 d27,d5 + vorr d30,d19,d21 + vand d29,d19,d21 + veor d18,d24,d25 + vand d30,d20 + veor d18,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d18,d27 + vadd.i64 d22,d27 + vadd.i64 d18,d30 + vshr.u64 d24,d22,#14 @ 6 +#if 6<16 + vld1.64 {d6},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d22,#18 + vshr.u64 d26,d22,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d22,#50 + vsli.64 d25,d22,#46 + vsli.64 d26,d22,#23 +#if 6<16 && defined(__ARMEL__) + vrev64.8 d6,d6 +#endif + vadd.i64 d27,d28,d17 + veor d29,d23,d16 + veor d24,d25 + vand d29,d22 + veor d24,d26 @ Sigma1(e) + veor d29,d16 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d18,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d18,#34 + vshr.u64 d26,d18,#39 + vsli.64 d24,d18,#36 + vsli.64 d25,d18,#30 + vsli.64 d26,d18,#25 + vadd.i64 d27,d6 + vorr d30,d18,d20 + vand d29,d18,d20 + veor d17,d24,d25 + vand d30,d19 + veor d17,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d17,d27 + vadd.i64 d21,d27 + vadd.i64 d17,d30 + vshr.u64 d24,d21,#14 @ 7 +#if 7<16 + vld1.64 {d7},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d21,#18 + vshr.u64 d26,d21,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d21,#50 + vsli.64 d25,d21,#46 + vsli.64 d26,d21,#23 +#if 7<16 && defined(__ARMEL__) + vrev64.8 d7,d7 +#endif + vadd.i64 d27,d28,d16 + veor d29,d22,d23 + veor d24,d25 + vand d29,d21 + veor d24,d26 @ Sigma1(e) + veor d29,d23 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d17,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d17,#34 + vshr.u64 d26,d17,#39 + vsli.64 d24,d17,#36 + vsli.64 d25,d17,#30 + vsli.64 d26,d17,#25 + vadd.i64 d27,d7 + vorr d30,d17,d19 + vand d29,d17,d19 + veor d16,d24,d25 + vand d30,d18 + veor d16,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d16,d27 + vadd.i64 d20,d27 + vadd.i64 d16,d30 + vshr.u64 d24,d20,#14 @ 8 +#if 8<16 + vld1.64 {d8},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d20,#18 + vshr.u64 d26,d20,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d20,#50 + vsli.64 d25,d20,#46 + vsli.64 d26,d20,#23 +#if 8<16 && defined(__ARMEL__) + vrev64.8 d8,d8 +#endif + vadd.i64 d27,d28,d23 + veor d29,d21,d22 + veor d24,d25 + vand d29,d20 + veor d24,d26 @ Sigma1(e) + veor d29,d22 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d16,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d16,#34 + vshr.u64 d26,d16,#39 + vsli.64 d24,d16,#36 + vsli.64 d25,d16,#30 + vsli.64 d26,d16,#25 + vadd.i64 d27,d8 + vorr d30,d16,d18 + vand d29,d16,d18 + veor d23,d24,d25 + vand d30,d17 + veor d23,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d23,d27 + vadd.i64 d19,d27 + vadd.i64 d23,d30 + vshr.u64 d24,d19,#14 @ 9 +#if 9<16 + vld1.64 {d9},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d19,#18 + vshr.u64 d26,d19,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d19,#50 + vsli.64 d25,d19,#46 + vsli.64 d26,d19,#23 +#if 9<16 && defined(__ARMEL__) + vrev64.8 d9,d9 +#endif + vadd.i64 d27,d28,d22 + veor d29,d20,d21 + veor d24,d25 + vand d29,d19 + veor d24,d26 @ Sigma1(e) + veor d29,d21 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d23,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d23,#34 + vshr.u64 d26,d23,#39 + vsli.64 d24,d23,#36 + vsli.64 d25,d23,#30 + vsli.64 d26,d23,#25 + vadd.i64 d27,d9 + vorr d30,d23,d17 + vand d29,d23,d17 + veor d22,d24,d25 + vand d30,d16 + veor d22,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d22,d27 + vadd.i64 d18,d27 + vadd.i64 d22,d30 + vshr.u64 d24,d18,#14 @ 10 +#if 10<16 + vld1.64 {d10},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d18,#18 + vshr.u64 d26,d18,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d18,#50 + vsli.64 d25,d18,#46 + vsli.64 d26,d18,#23 +#if 10<16 && defined(__ARMEL__) + vrev64.8 d10,d10 +#endif + vadd.i64 d27,d28,d21 + veor d29,d19,d20 + veor d24,d25 + vand d29,d18 + veor d24,d26 @ Sigma1(e) + veor d29,d20 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d22,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d22,#34 + vshr.u64 d26,d22,#39 + vsli.64 d24,d22,#36 + vsli.64 d25,d22,#30 + vsli.64 d26,d22,#25 + vadd.i64 d27,d10 + vorr d30,d22,d16 + vand d29,d22,d16 + veor d21,d24,d25 + vand d30,d23 + veor d21,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d21,d27 + vadd.i64 d17,d27 + vadd.i64 d21,d30 + vshr.u64 d24,d17,#14 @ 11 +#if 11<16 + vld1.64 {d11},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d17,#18 + vshr.u64 d26,d17,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d17,#50 + vsli.64 d25,d17,#46 + vsli.64 d26,d17,#23 +#if 11<16 && defined(__ARMEL__) + vrev64.8 d11,d11 +#endif + vadd.i64 d27,d28,d20 + veor d29,d18,d19 + veor d24,d25 + vand d29,d17 + veor d24,d26 @ Sigma1(e) + veor d29,d19 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d21,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d21,#34 + vshr.u64 d26,d21,#39 + vsli.64 d24,d21,#36 + vsli.64 d25,d21,#30 + vsli.64 d26,d21,#25 + vadd.i64 d27,d11 + vorr d30,d21,d23 + vand d29,d21,d23 + veor d20,d24,d25 + vand d30,d22 + veor d20,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d20,d27 + vadd.i64 d16,d27 + vadd.i64 d20,d30 + vshr.u64 d24,d16,#14 @ 12 +#if 12<16 + vld1.64 {d12},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d16,#18 + vshr.u64 d26,d16,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d16,#50 + vsli.64 d25,d16,#46 + vsli.64 d26,d16,#23 +#if 12<16 && defined(__ARMEL__) + vrev64.8 d12,d12 +#endif + vadd.i64 d27,d28,d19 + veor d29,d17,d18 + veor d24,d25 + vand d29,d16 + veor d24,d26 @ Sigma1(e) + veor d29,d18 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d20,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d20,#34 + vshr.u64 d26,d20,#39 + vsli.64 d24,d20,#36 + vsli.64 d25,d20,#30 + vsli.64 d26,d20,#25 + vadd.i64 d27,d12 + vorr d30,d20,d22 + vand d29,d20,d22 + veor d19,d24,d25 + vand d30,d21 + veor d19,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d19,d27 + vadd.i64 d23,d27 + vadd.i64 d19,d30 + vshr.u64 d24,d23,#14 @ 13 +#if 13<16 + vld1.64 {d13},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d23,#18 + vshr.u64 d26,d23,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d23,#50 + vsli.64 d25,d23,#46 + vsli.64 d26,d23,#23 +#if 13<16 && defined(__ARMEL__) + vrev64.8 d13,d13 +#endif + vadd.i64 d27,d28,d18 + veor d29,d16,d17 + veor d24,d25 + vand d29,d23 + veor d24,d26 @ Sigma1(e) + veor d29,d17 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d19,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d19,#34 + vshr.u64 d26,d19,#39 + vsli.64 d24,d19,#36 + vsli.64 d25,d19,#30 + vsli.64 d26,d19,#25 + vadd.i64 d27,d13 + vorr d30,d19,d21 + vand d29,d19,d21 + veor d18,d24,d25 + vand d30,d20 + veor d18,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d18,d27 + vadd.i64 d22,d27 + vadd.i64 d18,d30 + vshr.u64 d24,d22,#14 @ 14 +#if 14<16 + vld1.64 {d14},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d22,#18 + vshr.u64 d26,d22,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d22,#50 + vsli.64 d25,d22,#46 + vsli.64 d26,d22,#23 +#if 14<16 && defined(__ARMEL__) + vrev64.8 d14,d14 +#endif + vadd.i64 d27,d28,d17 + veor d29,d23,d16 + veor d24,d25 + vand d29,d22 + veor d24,d26 @ Sigma1(e) + veor d29,d16 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d18,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d18,#34 + vshr.u64 d26,d18,#39 + vsli.64 d24,d18,#36 + vsli.64 d25,d18,#30 + vsli.64 d26,d18,#25 + vadd.i64 d27,d14 + vorr d30,d18,d20 + vand d29,d18,d20 + veor d17,d24,d25 + vand d30,d19 + veor d17,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d17,d27 + vadd.i64 d21,d27 + vadd.i64 d17,d30 + vshr.u64 d24,d21,#14 @ 15 +#if 15<16 + vld1.64 {d15},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d21,#18 + vshr.u64 d26,d21,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d21,#50 + vsli.64 d25,d21,#46 + vsli.64 d26,d21,#23 +#if 15<16 && defined(__ARMEL__) + vrev64.8 d15,d15 +#endif + vadd.i64 d27,d28,d16 + veor d29,d22,d23 + veor d24,d25 + vand d29,d21 + veor d24,d26 @ Sigma1(e) + veor d29,d23 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d17,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d17,#34 + vshr.u64 d26,d17,#39 + vsli.64 d24,d17,#36 + vsli.64 d25,d17,#30 + vsli.64 d26,d17,#25 + vadd.i64 d27,d15 + vorr d30,d17,d19 + vand d29,d17,d19 + veor d16,d24,d25 + vand d30,d18 + veor d16,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d16,d27 + vadd.i64 d20,d27 + vadd.i64 d16,d30 + mov r12,#4 +.L16_79_neon: + subs r12,#1 + vshr.u64 q12,q7,#19 + vshr.u64 q13,q7,#61 + vshr.u64 q15,q7,#6 + vsli.64 q12,q7,#45 + vext.8 q14,q0,q1,#8 @ X[i+1] + vsli.64 q13,q7,#3 + veor q15,q12 + vshr.u64 q12,q14,#1 + veor q15,q13 @ sigma1(X[i+14]) + vshr.u64 q13,q14,#8 + vadd.i64 q0,q15 + vshr.u64 q15,q14,#7 + vsli.64 q12,q14,#63 + vsli.64 q13,q14,#56 + vext.8 q14,q4,q5,#8 @ X[i+9] + veor q15,q12 + vshr.u64 d24,d20,#14 @ from NEON_00_15 + vadd.i64 q0,q14 + vshr.u64 d25,d20,#18 @ from NEON_00_15 + veor q15,q13 @ sigma0(X[i+1]) + vshr.u64 d26,d20,#41 @ from NEON_00_15 + vadd.i64 q0,q15 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d20,#50 + vsli.64 d25,d20,#46 + vsli.64 d26,d20,#23 +#if 16<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d23 + veor d29,d21,d22 + veor d24,d25 + vand d29,d20 + veor d24,d26 @ Sigma1(e) + veor d29,d22 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d16,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d16,#34 + vshr.u64 d26,d16,#39 + vsli.64 d24,d16,#36 + vsli.64 d25,d16,#30 + vsli.64 d26,d16,#25 + vadd.i64 d27,d0 + vorr d30,d16,d18 + vand d29,d16,d18 + veor d23,d24,d25 + vand d30,d17 + veor d23,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d23,d27 + vadd.i64 d19,d27 + vadd.i64 d23,d30 + vshr.u64 d24,d19,#14 @ 17 +#if 17<16 + vld1.64 {d1},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d19,#18 + vshr.u64 d26,d19,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d19,#50 + vsli.64 d25,d19,#46 + vsli.64 d26,d19,#23 +#if 17<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d22 + veor d29,d20,d21 + veor d24,d25 + vand d29,d19 + veor d24,d26 @ Sigma1(e) + veor d29,d21 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d23,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d23,#34 + vshr.u64 d26,d23,#39 + vsli.64 d24,d23,#36 + vsli.64 d25,d23,#30 + vsli.64 d26,d23,#25 + vadd.i64 d27,d1 + vorr d30,d23,d17 + vand d29,d23,d17 + veor d22,d24,d25 + vand d30,d16 + veor d22,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d22,d27 + vadd.i64 d18,d27 + vadd.i64 d22,d30 + vshr.u64 q12,q0,#19 + vshr.u64 q13,q0,#61 + vshr.u64 q15,q0,#6 + vsli.64 q12,q0,#45 + vext.8 q14,q1,q2,#8 @ X[i+1] + vsli.64 q13,q0,#3 + veor q15,q12 + vshr.u64 q12,q14,#1 + veor q15,q13 @ sigma1(X[i+14]) + vshr.u64 q13,q14,#8 + vadd.i64 q1,q15 + vshr.u64 q15,q14,#7 + vsli.64 q12,q14,#63 + vsli.64 q13,q14,#56 + vext.8 q14,q5,q6,#8 @ X[i+9] + veor q15,q12 + vshr.u64 d24,d18,#14 @ from NEON_00_15 + vadd.i64 q1,q14 + vshr.u64 d25,d18,#18 @ from NEON_00_15 + veor q15,q13 @ sigma0(X[i+1]) + vshr.u64 d26,d18,#41 @ from NEON_00_15 + vadd.i64 q1,q15 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d18,#50 + vsli.64 d25,d18,#46 + vsli.64 d26,d18,#23 +#if 18<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d21 + veor d29,d19,d20 + veor d24,d25 + vand d29,d18 + veor d24,d26 @ Sigma1(e) + veor d29,d20 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d22,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d22,#34 + vshr.u64 d26,d22,#39 + vsli.64 d24,d22,#36 + vsli.64 d25,d22,#30 + vsli.64 d26,d22,#25 + vadd.i64 d27,d2 + vorr d30,d22,d16 + vand d29,d22,d16 + veor d21,d24,d25 + vand d30,d23 + veor d21,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d21,d27 + vadd.i64 d17,d27 + vadd.i64 d21,d30 + vshr.u64 d24,d17,#14 @ 19 +#if 19<16 + vld1.64 {d3},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d17,#18 + vshr.u64 d26,d17,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d17,#50 + vsli.64 d25,d17,#46 + vsli.64 d26,d17,#23 +#if 19<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d20 + veor d29,d18,d19 + veor d24,d25 + vand d29,d17 + veor d24,d26 @ Sigma1(e) + veor d29,d19 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d21,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d21,#34 + vshr.u64 d26,d21,#39 + vsli.64 d24,d21,#36 + vsli.64 d25,d21,#30 + vsli.64 d26,d21,#25 + vadd.i64 d27,d3 + vorr d30,d21,d23 + vand d29,d21,d23 + veor d20,d24,d25 + vand d30,d22 + veor d20,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d20,d27 + vadd.i64 d16,d27 + vadd.i64 d20,d30 + vshr.u64 q12,q1,#19 + vshr.u64 q13,q1,#61 + vshr.u64 q15,q1,#6 + vsli.64 q12,q1,#45 + vext.8 q14,q2,q3,#8 @ X[i+1] + vsli.64 q13,q1,#3 + veor q15,q12 + vshr.u64 q12,q14,#1 + veor q15,q13 @ sigma1(X[i+14]) + vshr.u64 q13,q14,#8 + vadd.i64 q2,q15 + vshr.u64 q15,q14,#7 + vsli.64 q12,q14,#63 + vsli.64 q13,q14,#56 + vext.8 q14,q6,q7,#8 @ X[i+9] + veor q15,q12 + vshr.u64 d24,d16,#14 @ from NEON_00_15 + vadd.i64 q2,q14 + vshr.u64 d25,d16,#18 @ from NEON_00_15 + veor q15,q13 @ sigma0(X[i+1]) + vshr.u64 d26,d16,#41 @ from NEON_00_15 + vadd.i64 q2,q15 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d16,#50 + vsli.64 d25,d16,#46 + vsli.64 d26,d16,#23 +#if 20<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d19 + veor d29,d17,d18 + veor d24,d25 + vand d29,d16 + veor d24,d26 @ Sigma1(e) + veor d29,d18 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d20,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d20,#34 + vshr.u64 d26,d20,#39 + vsli.64 d24,d20,#36 + vsli.64 d25,d20,#30 + vsli.64 d26,d20,#25 + vadd.i64 d27,d4 + vorr d30,d20,d22 + vand d29,d20,d22 + veor d19,d24,d25 + vand d30,d21 + veor d19,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d19,d27 + vadd.i64 d23,d27 + vadd.i64 d19,d30 + vshr.u64 d24,d23,#14 @ 21 +#if 21<16 + vld1.64 {d5},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d23,#18 + vshr.u64 d26,d23,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d23,#50 + vsli.64 d25,d23,#46 + vsli.64 d26,d23,#23 +#if 21<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d18 + veor d29,d16,d17 + veor d24,d25 + vand d29,d23 + veor d24,d26 @ Sigma1(e) + veor d29,d17 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d19,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d19,#34 + vshr.u64 d26,d19,#39 + vsli.64 d24,d19,#36 + vsli.64 d25,d19,#30 + vsli.64 d26,d19,#25 + vadd.i64 d27,d5 + vorr d30,d19,d21 + vand d29,d19,d21 + veor d18,d24,d25 + vand d30,d20 + veor d18,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d18,d27 + vadd.i64 d22,d27 + vadd.i64 d18,d30 + vshr.u64 q12,q2,#19 + vshr.u64 q13,q2,#61 + vshr.u64 q15,q2,#6 + vsli.64 q12,q2,#45 + vext.8 q14,q3,q4,#8 @ X[i+1] + vsli.64 q13,q2,#3 + veor q15,q12 + vshr.u64 q12,q14,#1 + veor q15,q13 @ sigma1(X[i+14]) + vshr.u64 q13,q14,#8 + vadd.i64 q3,q15 + vshr.u64 q15,q14,#7 + vsli.64 q12,q14,#63 + vsli.64 q13,q14,#56 + vext.8 q14,q7,q0,#8 @ X[i+9] + veor q15,q12 + vshr.u64 d24,d22,#14 @ from NEON_00_15 + vadd.i64 q3,q14 + vshr.u64 d25,d22,#18 @ from NEON_00_15 + veor q15,q13 @ sigma0(X[i+1]) + vshr.u64 d26,d22,#41 @ from NEON_00_15 + vadd.i64 q3,q15 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d22,#50 + vsli.64 d25,d22,#46 + vsli.64 d26,d22,#23 +#if 22<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d17 + veor d29,d23,d16 + veor d24,d25 + vand d29,d22 + veor d24,d26 @ Sigma1(e) + veor d29,d16 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d18,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d18,#34 + vshr.u64 d26,d18,#39 + vsli.64 d24,d18,#36 + vsli.64 d25,d18,#30 + vsli.64 d26,d18,#25 + vadd.i64 d27,d6 + vorr d30,d18,d20 + vand d29,d18,d20 + veor d17,d24,d25 + vand d30,d19 + veor d17,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d17,d27 + vadd.i64 d21,d27 + vadd.i64 d17,d30 + vshr.u64 d24,d21,#14 @ 23 +#if 23<16 + vld1.64 {d7},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d21,#18 + vshr.u64 d26,d21,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d21,#50 + vsli.64 d25,d21,#46 + vsli.64 d26,d21,#23 +#if 23<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d16 + veor d29,d22,d23 + veor d24,d25 + vand d29,d21 + veor d24,d26 @ Sigma1(e) + veor d29,d23 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d17,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d17,#34 + vshr.u64 d26,d17,#39 + vsli.64 d24,d17,#36 + vsli.64 d25,d17,#30 + vsli.64 d26,d17,#25 + vadd.i64 d27,d7 + vorr d30,d17,d19 + vand d29,d17,d19 + veor d16,d24,d25 + vand d30,d18 + veor d16,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d16,d27 + vadd.i64 d20,d27 + vadd.i64 d16,d30 + vshr.u64 q12,q3,#19 + vshr.u64 q13,q3,#61 + vshr.u64 q15,q3,#6 + vsli.64 q12,q3,#45 + vext.8 q14,q4,q5,#8 @ X[i+1] + vsli.64 q13,q3,#3 + veor q15,q12 + vshr.u64 q12,q14,#1 + veor q15,q13 @ sigma1(X[i+14]) + vshr.u64 q13,q14,#8 + vadd.i64 q4,q15 + vshr.u64 q15,q14,#7 + vsli.64 q12,q14,#63 + vsli.64 q13,q14,#56 + vext.8 q14,q0,q1,#8 @ X[i+9] + veor q15,q12 + vshr.u64 d24,d20,#14 @ from NEON_00_15 + vadd.i64 q4,q14 + vshr.u64 d25,d20,#18 @ from NEON_00_15 + veor q15,q13 @ sigma0(X[i+1]) + vshr.u64 d26,d20,#41 @ from NEON_00_15 + vadd.i64 q4,q15 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d20,#50 + vsli.64 d25,d20,#46 + vsli.64 d26,d20,#23 +#if 24<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d23 + veor d29,d21,d22 + veor d24,d25 + vand d29,d20 + veor d24,d26 @ Sigma1(e) + veor d29,d22 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d16,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d16,#34 + vshr.u64 d26,d16,#39 + vsli.64 d24,d16,#36 + vsli.64 d25,d16,#30 + vsli.64 d26,d16,#25 + vadd.i64 d27,d8 + vorr d30,d16,d18 + vand d29,d16,d18 + veor d23,d24,d25 + vand d30,d17 + veor d23,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d23,d27 + vadd.i64 d19,d27 + vadd.i64 d23,d30 + vshr.u64 d24,d19,#14 @ 25 +#if 25<16 + vld1.64 {d9},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d19,#18 + vshr.u64 d26,d19,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d19,#50 + vsli.64 d25,d19,#46 + vsli.64 d26,d19,#23 +#if 25<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d22 + veor d29,d20,d21 + veor d24,d25 + vand d29,d19 + veor d24,d26 @ Sigma1(e) + veor d29,d21 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d23,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d23,#34 + vshr.u64 d26,d23,#39 + vsli.64 d24,d23,#36 + vsli.64 d25,d23,#30 + vsli.64 d26,d23,#25 + vadd.i64 d27,d9 + vorr d30,d23,d17 + vand d29,d23,d17 + veor d22,d24,d25 + vand d30,d16 + veor d22,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d22,d27 + vadd.i64 d18,d27 + vadd.i64 d22,d30 + vshr.u64 q12,q4,#19 + vshr.u64 q13,q4,#61 + vshr.u64 q15,q4,#6 + vsli.64 q12,q4,#45 + vext.8 q14,q5,q6,#8 @ X[i+1] + vsli.64 q13,q4,#3 + veor q15,q12 + vshr.u64 q12,q14,#1 + veor q15,q13 @ sigma1(X[i+14]) + vshr.u64 q13,q14,#8 + vadd.i64 q5,q15 + vshr.u64 q15,q14,#7 + vsli.64 q12,q14,#63 + vsli.64 q13,q14,#56 + vext.8 q14,q1,q2,#8 @ X[i+9] + veor q15,q12 + vshr.u64 d24,d18,#14 @ from NEON_00_15 + vadd.i64 q5,q14 + vshr.u64 d25,d18,#18 @ from NEON_00_15 + veor q15,q13 @ sigma0(X[i+1]) + vshr.u64 d26,d18,#41 @ from NEON_00_15 + vadd.i64 q5,q15 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d18,#50 + vsli.64 d25,d18,#46 + vsli.64 d26,d18,#23 +#if 26<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d21 + veor d29,d19,d20 + veor d24,d25 + vand d29,d18 + veor d24,d26 @ Sigma1(e) + veor d29,d20 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d22,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d22,#34 + vshr.u64 d26,d22,#39 + vsli.64 d24,d22,#36 + vsli.64 d25,d22,#30 + vsli.64 d26,d22,#25 + vadd.i64 d27,d10 + vorr d30,d22,d16 + vand d29,d22,d16 + veor d21,d24,d25 + vand d30,d23 + veor d21,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d21,d27 + vadd.i64 d17,d27 + vadd.i64 d21,d30 + vshr.u64 d24,d17,#14 @ 27 +#if 27<16 + vld1.64 {d11},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d17,#18 + vshr.u64 d26,d17,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d17,#50 + vsli.64 d25,d17,#46 + vsli.64 d26,d17,#23 +#if 27<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d20 + veor d29,d18,d19 + veor d24,d25 + vand d29,d17 + veor d24,d26 @ Sigma1(e) + veor d29,d19 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d21,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d21,#34 + vshr.u64 d26,d21,#39 + vsli.64 d24,d21,#36 + vsli.64 d25,d21,#30 + vsli.64 d26,d21,#25 + vadd.i64 d27,d11 + vorr d30,d21,d23 + vand d29,d21,d23 + veor d20,d24,d25 + vand d30,d22 + veor d20,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d20,d27 + vadd.i64 d16,d27 + vadd.i64 d20,d30 + vshr.u64 q12,q5,#19 + vshr.u64 q13,q5,#61 + vshr.u64 q15,q5,#6 + vsli.64 q12,q5,#45 + vext.8 q14,q6,q7,#8 @ X[i+1] + vsli.64 q13,q5,#3 + veor q15,q12 + vshr.u64 q12,q14,#1 + veor q15,q13 @ sigma1(X[i+14]) + vshr.u64 q13,q14,#8 + vadd.i64 q6,q15 + vshr.u64 q15,q14,#7 + vsli.64 q12,q14,#63 + vsli.64 q13,q14,#56 + vext.8 q14,q2,q3,#8 @ X[i+9] + veor q15,q12 + vshr.u64 d24,d16,#14 @ from NEON_00_15 + vadd.i64 q6,q14 + vshr.u64 d25,d16,#18 @ from NEON_00_15 + veor q15,q13 @ sigma0(X[i+1]) + vshr.u64 d26,d16,#41 @ from NEON_00_15 + vadd.i64 q6,q15 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d16,#50 + vsli.64 d25,d16,#46 + vsli.64 d26,d16,#23 +#if 28<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d19 + veor d29,d17,d18 + veor d24,d25 + vand d29,d16 + veor d24,d26 @ Sigma1(e) + veor d29,d18 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d20,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d20,#34 + vshr.u64 d26,d20,#39 + vsli.64 d24,d20,#36 + vsli.64 d25,d20,#30 + vsli.64 d26,d20,#25 + vadd.i64 d27,d12 + vorr d30,d20,d22 + vand d29,d20,d22 + veor d19,d24,d25 + vand d30,d21 + veor d19,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d19,d27 + vadd.i64 d23,d27 + vadd.i64 d19,d30 + vshr.u64 d24,d23,#14 @ 29 +#if 29<16 + vld1.64 {d13},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d23,#18 + vshr.u64 d26,d23,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d23,#50 + vsli.64 d25,d23,#46 + vsli.64 d26,d23,#23 +#if 29<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d18 + veor d29,d16,d17 + veor d24,d25 + vand d29,d23 + veor d24,d26 @ Sigma1(e) + veor d29,d17 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d19,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d19,#34 + vshr.u64 d26,d19,#39 + vsli.64 d24,d19,#36 + vsli.64 d25,d19,#30 + vsli.64 d26,d19,#25 + vadd.i64 d27,d13 + vorr d30,d19,d21 + vand d29,d19,d21 + veor d18,d24,d25 + vand d30,d20 + veor d18,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d18,d27 + vadd.i64 d22,d27 + vadd.i64 d18,d30 + vshr.u64 q12,q6,#19 + vshr.u64 q13,q6,#61 + vshr.u64 q15,q6,#6 + vsli.64 q12,q6,#45 + vext.8 q14,q7,q0,#8 @ X[i+1] + vsli.64 q13,q6,#3 + veor q15,q12 + vshr.u64 q12,q14,#1 + veor q15,q13 @ sigma1(X[i+14]) + vshr.u64 q13,q14,#8 + vadd.i64 q7,q15 + vshr.u64 q15,q14,#7 + vsli.64 q12,q14,#63 + vsli.64 q13,q14,#56 + vext.8 q14,q3,q4,#8 @ X[i+9] + veor q15,q12 + vshr.u64 d24,d22,#14 @ from NEON_00_15 + vadd.i64 q7,q14 + vshr.u64 d25,d22,#18 @ from NEON_00_15 + veor q15,q13 @ sigma0(X[i+1]) + vshr.u64 d26,d22,#41 @ from NEON_00_15 + vadd.i64 q7,q15 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d22,#50 + vsli.64 d25,d22,#46 + vsli.64 d26,d22,#23 +#if 30<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d17 + veor d29,d23,d16 + veor d24,d25 + vand d29,d22 + veor d24,d26 @ Sigma1(e) + veor d29,d16 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d18,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d18,#34 + vshr.u64 d26,d18,#39 + vsli.64 d24,d18,#36 + vsli.64 d25,d18,#30 + vsli.64 d26,d18,#25 + vadd.i64 d27,d14 + vorr d30,d18,d20 + vand d29,d18,d20 + veor d17,d24,d25 + vand d30,d19 + veor d17,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d17,d27 + vadd.i64 d21,d27 + vadd.i64 d17,d30 + vshr.u64 d24,d21,#14 @ 31 +#if 31<16 + vld1.64 {d15},[r1]! @ handles unaligned +#endif + vshr.u64 d25,d21,#18 + vshr.u64 d26,d21,#41 + vld1.64 {d28},[r3,:64]! @ K[i++] + vsli.64 d24,d21,#50 + vsli.64 d25,d21,#46 + vsli.64 d26,d21,#23 +#if 31<16 && defined(__ARMEL__) + vrev64.8 , +#endif + vadd.i64 d27,d28,d16 + veor d29,d22,d23 + veor d24,d25 + vand d29,d21 + veor d24,d26 @ Sigma1(e) + veor d29,d23 @ Ch(e,f,g) + vadd.i64 d27,d24 + vshr.u64 d24,d17,#28 + vadd.i64 d27,d29 + vshr.u64 d25,d17,#34 + vshr.u64 d26,d17,#39 + vsli.64 d24,d17,#36 + vsli.64 d25,d17,#30 + vsli.64 d26,d17,#25 + vadd.i64 d27,d15 + vorr d30,d17,d19 + vand d29,d17,d19 + veor d16,d24,d25 + vand d30,d18 + veor d16,d26 @ Sigma0(a) + vorr d30,d29 @ Maj(a,b,c) + vadd.i64 d16,d27 + vadd.i64 d20,d27 + vadd.i64 d16,d30 + bne .L16_79_neon + + vldmia r0,{d24-d31} @ load context to temp + vadd.i64 q8,q12 @ vectorized accumulate + vadd.i64 q9,q13 + vadd.i64 q10,q14 + vadd.i64 q11,q15 + vstmia r0,{d16-d23} @ save context + teq r1,r2 + sub r3,#640 @ rewind K512 + bne .Loop_neon + + vldmia sp!,{d8-d15} @ epilogue + .word 0xe12fff1e +#endif +.size sha512_block_data_order,.-sha512_block_data_order +.asciz "SHA512 block transform for ARMv4/NEON, CRYPTOGAMS by " +.align 2 +.comm OPENSSL_armcap_P,4,4 +#if defined(HAVE_GNU_STACK) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/crypto/sha/sha512-elf-x86_64.S b/crypto/sha/sha512-elf-x86_64.S index d218304f..11734072 100644 --- a/crypto/sha/sha512-elf-x86_64.S +++ b/crypto/sha/sha512-elf-x86_64.S @@ -1756,7 +1756,7 @@ sha512_block_data_order: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lepilogue: - .byte 0xf3,0xc3 + retq .size sha512_block_data_order,.-sha512_block_data_order .align 64 .type K512,@object diff --git a/crypto/sha/sha512-macosx-x86_64.S b/crypto/sha/sha512-macosx-x86_64.S index 4a51d14f..7581da47 100644 --- a/crypto/sha/sha512-macosx-x86_64.S +++ b/crypto/sha/sha512-macosx-x86_64.S @@ -1756,7 +1756,7 @@ L$rounds_16_xx: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$epilogue: - .byte 0xf3,0xc3 + retq .p2align 6 diff --git a/crypto/sha/sha512-masm-x86_64.S b/crypto/sha/sha512-masm-x86_64.S new file mode 100644 index 00000000..f7c495e6 --- /dev/null +++ b/crypto/sha/sha512-masm-x86_64.S @@ -0,0 +1,1820 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + +PUBLIC sha512_block_data_order + +ALIGN 16 +sha512_block_data_order PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_sha512_block_data_order:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + mov rcx,r9 + + + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + mov r11,rsp + shl rdx,4 + sub rsp,16*8+4*8 + lea rdx,QWORD PTR[rdx*8+rsi] + and rsp,-64 + mov QWORD PTR[((128+0))+rsp],rdi + mov QWORD PTR[((128+8))+rsp],rsi + mov QWORD PTR[((128+16))+rsp],rdx + mov QWORD PTR[((128+24))+rsp],r11 +$L$prologue:: + + lea rbp,QWORD PTR[K512] + + mov rax,QWORD PTR[rdi] + mov rbx,QWORD PTR[8+rdi] + mov rcx,QWORD PTR[16+rdi] + mov rdx,QWORD PTR[24+rdi] + mov r8,QWORD PTR[32+rdi] + mov r9,QWORD PTR[40+rdi] + mov r10,QWORD PTR[48+rdi] + mov r11,QWORD PTR[56+rdi] + jmp $L$loop + +ALIGN 16 +$L$loop:: + xor rdi,rdi + mov r12,QWORD PTR[rsi] + mov r13,r8 + mov r14,rax + bswap r12 + ror r13,23 + mov r15,r9 + mov QWORD PTR[rsp],r12 + + ror r14,5 + xor r13,r8 + xor r15,r10 + + ror r13,4 + add r12,r11 + xor r14,rax + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r8 + mov r11,rbx + + ror r14,6 + xor r13,r8 + xor r15,r10 + + xor r11,rcx + xor r14,rax + add r12,r15 + mov r15,rbx + + ror r13,14 + and r11,rax + and r15,rcx + + ror r14,28 + add r12,r13 + add r11,r15 + + add rdx,r12 + add r11,r12 + lea rdi,QWORD PTR[1+rdi] + add r11,r14 + + mov r12,QWORD PTR[8+rsi] + mov r13,rdx + mov r14,r11 + bswap r12 + ror r13,23 + mov r15,r8 + mov QWORD PTR[8+rsp],r12 + + ror r14,5 + xor r13,rdx + xor r15,r9 + + ror r13,4 + add r12,r10 + xor r14,r11 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rdx + mov r10,rax + + ror r14,6 + xor r13,rdx + xor r15,r9 + + xor r10,rbx + xor r14,r11 + add r12,r15 + mov r15,rax + + ror r13,14 + and r10,r11 + and r15,rbx + + ror r14,28 + add r12,r13 + add r10,r15 + + add rcx,r12 + add r10,r12 + lea rdi,QWORD PTR[1+rdi] + add r10,r14 + + mov r12,QWORD PTR[16+rsi] + mov r13,rcx + mov r14,r10 + bswap r12 + ror r13,23 + mov r15,rdx + mov QWORD PTR[16+rsp],r12 + + ror r14,5 + xor r13,rcx + xor r15,r8 + + ror r13,4 + add r12,r9 + xor r14,r10 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rcx + mov r9,r11 + + ror r14,6 + xor r13,rcx + xor r15,r8 + + xor r9,rax + xor r14,r10 + add r12,r15 + mov r15,r11 + + ror r13,14 + and r9,r10 + and r15,rax + + ror r14,28 + add r12,r13 + add r9,r15 + + add rbx,r12 + add r9,r12 + lea rdi,QWORD PTR[1+rdi] + add r9,r14 + + mov r12,QWORD PTR[24+rsi] + mov r13,rbx + mov r14,r9 + bswap r12 + ror r13,23 + mov r15,rcx + mov QWORD PTR[24+rsp],r12 + + ror r14,5 + xor r13,rbx + xor r15,rdx + + ror r13,4 + add r12,r8 + xor r14,r9 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rbx + mov r8,r10 + + ror r14,6 + xor r13,rbx + xor r15,rdx + + xor r8,r11 + xor r14,r9 + add r12,r15 + mov r15,r10 + + ror r13,14 + and r8,r9 + and r15,r11 + + ror r14,28 + add r12,r13 + add r8,r15 + + add rax,r12 + add r8,r12 + lea rdi,QWORD PTR[1+rdi] + add r8,r14 + + mov r12,QWORD PTR[32+rsi] + mov r13,rax + mov r14,r8 + bswap r12 + ror r13,23 + mov r15,rbx + mov QWORD PTR[32+rsp],r12 + + ror r14,5 + xor r13,rax + xor r15,rcx + + ror r13,4 + add r12,rdx + xor r14,r8 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rax + mov rdx,r9 + + ror r14,6 + xor r13,rax + xor r15,rcx + + xor rdx,r10 + xor r14,r8 + add r12,r15 + mov r15,r9 + + ror r13,14 + and rdx,r8 + and r15,r10 + + ror r14,28 + add r12,r13 + add rdx,r15 + + add r11,r12 + add rdx,r12 + lea rdi,QWORD PTR[1+rdi] + add rdx,r14 + + mov r12,QWORD PTR[40+rsi] + mov r13,r11 + mov r14,rdx + bswap r12 + ror r13,23 + mov r15,rax + mov QWORD PTR[40+rsp],r12 + + ror r14,5 + xor r13,r11 + xor r15,rbx + + ror r13,4 + add r12,rcx + xor r14,rdx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r11 + mov rcx,r8 + + ror r14,6 + xor r13,r11 + xor r15,rbx + + xor rcx,r9 + xor r14,rdx + add r12,r15 + mov r15,r8 + + ror r13,14 + and rcx,rdx + and r15,r9 + + ror r14,28 + add r12,r13 + add rcx,r15 + + add r10,r12 + add rcx,r12 + lea rdi,QWORD PTR[1+rdi] + add rcx,r14 + + mov r12,QWORD PTR[48+rsi] + mov r13,r10 + mov r14,rcx + bswap r12 + ror r13,23 + mov r15,r11 + mov QWORD PTR[48+rsp],r12 + + ror r14,5 + xor r13,r10 + xor r15,rax + + ror r13,4 + add r12,rbx + xor r14,rcx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r10 + mov rbx,rdx + + ror r14,6 + xor r13,r10 + xor r15,rax + + xor rbx,r8 + xor r14,rcx + add r12,r15 + mov r15,rdx + + ror r13,14 + and rbx,rcx + and r15,r8 + + ror r14,28 + add r12,r13 + add rbx,r15 + + add r9,r12 + add rbx,r12 + lea rdi,QWORD PTR[1+rdi] + add rbx,r14 + + mov r12,QWORD PTR[56+rsi] + mov r13,r9 + mov r14,rbx + bswap r12 + ror r13,23 + mov r15,r10 + mov QWORD PTR[56+rsp],r12 + + ror r14,5 + xor r13,r9 + xor r15,r11 + + ror r13,4 + add r12,rax + xor r14,rbx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r9 + mov rax,rcx + + ror r14,6 + xor r13,r9 + xor r15,r11 + + xor rax,rdx + xor r14,rbx + add r12,r15 + mov r15,rcx + + ror r13,14 + and rax,rbx + and r15,rdx + + ror r14,28 + add r12,r13 + add rax,r15 + + add r8,r12 + add rax,r12 + lea rdi,QWORD PTR[1+rdi] + add rax,r14 + + mov r12,QWORD PTR[64+rsi] + mov r13,r8 + mov r14,rax + bswap r12 + ror r13,23 + mov r15,r9 + mov QWORD PTR[64+rsp],r12 + + ror r14,5 + xor r13,r8 + xor r15,r10 + + ror r13,4 + add r12,r11 + xor r14,rax + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r8 + mov r11,rbx + + ror r14,6 + xor r13,r8 + xor r15,r10 + + xor r11,rcx + xor r14,rax + add r12,r15 + mov r15,rbx + + ror r13,14 + and r11,rax + and r15,rcx + + ror r14,28 + add r12,r13 + add r11,r15 + + add rdx,r12 + add r11,r12 + lea rdi,QWORD PTR[1+rdi] + add r11,r14 + + mov r12,QWORD PTR[72+rsi] + mov r13,rdx + mov r14,r11 + bswap r12 + ror r13,23 + mov r15,r8 + mov QWORD PTR[72+rsp],r12 + + ror r14,5 + xor r13,rdx + xor r15,r9 + + ror r13,4 + add r12,r10 + xor r14,r11 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rdx + mov r10,rax + + ror r14,6 + xor r13,rdx + xor r15,r9 + + xor r10,rbx + xor r14,r11 + add r12,r15 + mov r15,rax + + ror r13,14 + and r10,r11 + and r15,rbx + + ror r14,28 + add r12,r13 + add r10,r15 + + add rcx,r12 + add r10,r12 + lea rdi,QWORD PTR[1+rdi] + add r10,r14 + + mov r12,QWORD PTR[80+rsi] + mov r13,rcx + mov r14,r10 + bswap r12 + ror r13,23 + mov r15,rdx + mov QWORD PTR[80+rsp],r12 + + ror r14,5 + xor r13,rcx + xor r15,r8 + + ror r13,4 + add r12,r9 + xor r14,r10 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rcx + mov r9,r11 + + ror r14,6 + xor r13,rcx + xor r15,r8 + + xor r9,rax + xor r14,r10 + add r12,r15 + mov r15,r11 + + ror r13,14 + and r9,r10 + and r15,rax + + ror r14,28 + add r12,r13 + add r9,r15 + + add rbx,r12 + add r9,r12 + lea rdi,QWORD PTR[1+rdi] + add r9,r14 + + mov r12,QWORD PTR[88+rsi] + mov r13,rbx + mov r14,r9 + bswap r12 + ror r13,23 + mov r15,rcx + mov QWORD PTR[88+rsp],r12 + + ror r14,5 + xor r13,rbx + xor r15,rdx + + ror r13,4 + add r12,r8 + xor r14,r9 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rbx + mov r8,r10 + + ror r14,6 + xor r13,rbx + xor r15,rdx + + xor r8,r11 + xor r14,r9 + add r12,r15 + mov r15,r10 + + ror r13,14 + and r8,r9 + and r15,r11 + + ror r14,28 + add r12,r13 + add r8,r15 + + add rax,r12 + add r8,r12 + lea rdi,QWORD PTR[1+rdi] + add r8,r14 + + mov r12,QWORD PTR[96+rsi] + mov r13,rax + mov r14,r8 + bswap r12 + ror r13,23 + mov r15,rbx + mov QWORD PTR[96+rsp],r12 + + ror r14,5 + xor r13,rax + xor r15,rcx + + ror r13,4 + add r12,rdx + xor r14,r8 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rax + mov rdx,r9 + + ror r14,6 + xor r13,rax + xor r15,rcx + + xor rdx,r10 + xor r14,r8 + add r12,r15 + mov r15,r9 + + ror r13,14 + and rdx,r8 + and r15,r10 + + ror r14,28 + add r12,r13 + add rdx,r15 + + add r11,r12 + add rdx,r12 + lea rdi,QWORD PTR[1+rdi] + add rdx,r14 + + mov r12,QWORD PTR[104+rsi] + mov r13,r11 + mov r14,rdx + bswap r12 + ror r13,23 + mov r15,rax + mov QWORD PTR[104+rsp],r12 + + ror r14,5 + xor r13,r11 + xor r15,rbx + + ror r13,4 + add r12,rcx + xor r14,rdx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r11 + mov rcx,r8 + + ror r14,6 + xor r13,r11 + xor r15,rbx + + xor rcx,r9 + xor r14,rdx + add r12,r15 + mov r15,r8 + + ror r13,14 + and rcx,rdx + and r15,r9 + + ror r14,28 + add r12,r13 + add rcx,r15 + + add r10,r12 + add rcx,r12 + lea rdi,QWORD PTR[1+rdi] + add rcx,r14 + + mov r12,QWORD PTR[112+rsi] + mov r13,r10 + mov r14,rcx + bswap r12 + ror r13,23 + mov r15,r11 + mov QWORD PTR[112+rsp],r12 + + ror r14,5 + xor r13,r10 + xor r15,rax + + ror r13,4 + add r12,rbx + xor r14,rcx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r10 + mov rbx,rdx + + ror r14,6 + xor r13,r10 + xor r15,rax + + xor rbx,r8 + xor r14,rcx + add r12,r15 + mov r15,rdx + + ror r13,14 + and rbx,rcx + and r15,r8 + + ror r14,28 + add r12,r13 + add rbx,r15 + + add r9,r12 + add rbx,r12 + lea rdi,QWORD PTR[1+rdi] + add rbx,r14 + + mov r12,QWORD PTR[120+rsi] + mov r13,r9 + mov r14,rbx + bswap r12 + ror r13,23 + mov r15,r10 + mov QWORD PTR[120+rsp],r12 + + ror r14,5 + xor r13,r9 + xor r15,r11 + + ror r13,4 + add r12,rax + xor r14,rbx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r9 + mov rax,rcx + + ror r14,6 + xor r13,r9 + xor r15,r11 + + xor rax,rdx + xor r14,rbx + add r12,r15 + mov r15,rcx + + ror r13,14 + and rax,rbx + and r15,rdx + + ror r14,28 + add r12,r13 + add rax,r15 + + add r8,r12 + add rax,r12 + lea rdi,QWORD PTR[1+rdi] + add rax,r14 + + jmp $L$rounds_16_xx +ALIGN 16 +$L$rounds_16_xx:: + mov r13,QWORD PTR[8+rsp] + mov r14,QWORD PTR[112+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[72+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[rsp] + mov r13,r8 + add r12,r14 + mov r14,rax + ror r13,23 + mov r15,r9 + mov QWORD PTR[rsp],r12 + + ror r14,5 + xor r13,r8 + xor r15,r10 + + ror r13,4 + add r12,r11 + xor r14,rax + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r8 + mov r11,rbx + + ror r14,6 + xor r13,r8 + xor r15,r10 + + xor r11,rcx + xor r14,rax + add r12,r15 + mov r15,rbx + + ror r13,14 + and r11,rax + and r15,rcx + + ror r14,28 + add r12,r13 + add r11,r15 + + add rdx,r12 + add r11,r12 + lea rdi,QWORD PTR[1+rdi] + add r11,r14 + + mov r13,QWORD PTR[16+rsp] + mov r14,QWORD PTR[120+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[80+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[8+rsp] + mov r13,rdx + add r12,r14 + mov r14,r11 + ror r13,23 + mov r15,r8 + mov QWORD PTR[8+rsp],r12 + + ror r14,5 + xor r13,rdx + xor r15,r9 + + ror r13,4 + add r12,r10 + xor r14,r11 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rdx + mov r10,rax + + ror r14,6 + xor r13,rdx + xor r15,r9 + + xor r10,rbx + xor r14,r11 + add r12,r15 + mov r15,rax + + ror r13,14 + and r10,r11 + and r15,rbx + + ror r14,28 + add r12,r13 + add r10,r15 + + add rcx,r12 + add r10,r12 + lea rdi,QWORD PTR[1+rdi] + add r10,r14 + + mov r13,QWORD PTR[24+rsp] + mov r14,QWORD PTR[rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[88+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[16+rsp] + mov r13,rcx + add r12,r14 + mov r14,r10 + ror r13,23 + mov r15,rdx + mov QWORD PTR[16+rsp],r12 + + ror r14,5 + xor r13,rcx + xor r15,r8 + + ror r13,4 + add r12,r9 + xor r14,r10 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rcx + mov r9,r11 + + ror r14,6 + xor r13,rcx + xor r15,r8 + + xor r9,rax + xor r14,r10 + add r12,r15 + mov r15,r11 + + ror r13,14 + and r9,r10 + and r15,rax + + ror r14,28 + add r12,r13 + add r9,r15 + + add rbx,r12 + add r9,r12 + lea rdi,QWORD PTR[1+rdi] + add r9,r14 + + mov r13,QWORD PTR[32+rsp] + mov r14,QWORD PTR[8+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[96+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[24+rsp] + mov r13,rbx + add r12,r14 + mov r14,r9 + ror r13,23 + mov r15,rcx + mov QWORD PTR[24+rsp],r12 + + ror r14,5 + xor r13,rbx + xor r15,rdx + + ror r13,4 + add r12,r8 + xor r14,r9 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rbx + mov r8,r10 + + ror r14,6 + xor r13,rbx + xor r15,rdx + + xor r8,r11 + xor r14,r9 + add r12,r15 + mov r15,r10 + + ror r13,14 + and r8,r9 + and r15,r11 + + ror r14,28 + add r12,r13 + add r8,r15 + + add rax,r12 + add r8,r12 + lea rdi,QWORD PTR[1+rdi] + add r8,r14 + + mov r13,QWORD PTR[40+rsp] + mov r14,QWORD PTR[16+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[104+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[32+rsp] + mov r13,rax + add r12,r14 + mov r14,r8 + ror r13,23 + mov r15,rbx + mov QWORD PTR[32+rsp],r12 + + ror r14,5 + xor r13,rax + xor r15,rcx + + ror r13,4 + add r12,rdx + xor r14,r8 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rax + mov rdx,r9 + + ror r14,6 + xor r13,rax + xor r15,rcx + + xor rdx,r10 + xor r14,r8 + add r12,r15 + mov r15,r9 + + ror r13,14 + and rdx,r8 + and r15,r10 + + ror r14,28 + add r12,r13 + add rdx,r15 + + add r11,r12 + add rdx,r12 + lea rdi,QWORD PTR[1+rdi] + add rdx,r14 + + mov r13,QWORD PTR[48+rsp] + mov r14,QWORD PTR[24+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[112+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[40+rsp] + mov r13,r11 + add r12,r14 + mov r14,rdx + ror r13,23 + mov r15,rax + mov QWORD PTR[40+rsp],r12 + + ror r14,5 + xor r13,r11 + xor r15,rbx + + ror r13,4 + add r12,rcx + xor r14,rdx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r11 + mov rcx,r8 + + ror r14,6 + xor r13,r11 + xor r15,rbx + + xor rcx,r9 + xor r14,rdx + add r12,r15 + mov r15,r8 + + ror r13,14 + and rcx,rdx + and r15,r9 + + ror r14,28 + add r12,r13 + add rcx,r15 + + add r10,r12 + add rcx,r12 + lea rdi,QWORD PTR[1+rdi] + add rcx,r14 + + mov r13,QWORD PTR[56+rsp] + mov r14,QWORD PTR[32+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[120+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[48+rsp] + mov r13,r10 + add r12,r14 + mov r14,rcx + ror r13,23 + mov r15,r11 + mov QWORD PTR[48+rsp],r12 + + ror r14,5 + xor r13,r10 + xor r15,rax + + ror r13,4 + add r12,rbx + xor r14,rcx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r10 + mov rbx,rdx + + ror r14,6 + xor r13,r10 + xor r15,rax + + xor rbx,r8 + xor r14,rcx + add r12,r15 + mov r15,rdx + + ror r13,14 + and rbx,rcx + and r15,r8 + + ror r14,28 + add r12,r13 + add rbx,r15 + + add r9,r12 + add rbx,r12 + lea rdi,QWORD PTR[1+rdi] + add rbx,r14 + + mov r13,QWORD PTR[64+rsp] + mov r14,QWORD PTR[40+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[56+rsp] + mov r13,r9 + add r12,r14 + mov r14,rbx + ror r13,23 + mov r15,r10 + mov QWORD PTR[56+rsp],r12 + + ror r14,5 + xor r13,r9 + xor r15,r11 + + ror r13,4 + add r12,rax + xor r14,rbx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r9 + mov rax,rcx + + ror r14,6 + xor r13,r9 + xor r15,r11 + + xor rax,rdx + xor r14,rbx + add r12,r15 + mov r15,rcx + + ror r13,14 + and rax,rbx + and r15,rdx + + ror r14,28 + add r12,r13 + add rax,r15 + + add r8,r12 + add rax,r12 + lea rdi,QWORD PTR[1+rdi] + add rax,r14 + + mov r13,QWORD PTR[72+rsp] + mov r14,QWORD PTR[48+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[8+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[64+rsp] + mov r13,r8 + add r12,r14 + mov r14,rax + ror r13,23 + mov r15,r9 + mov QWORD PTR[64+rsp],r12 + + ror r14,5 + xor r13,r8 + xor r15,r10 + + ror r13,4 + add r12,r11 + xor r14,rax + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r8 + mov r11,rbx + + ror r14,6 + xor r13,r8 + xor r15,r10 + + xor r11,rcx + xor r14,rax + add r12,r15 + mov r15,rbx + + ror r13,14 + and r11,rax + and r15,rcx + + ror r14,28 + add r12,r13 + add r11,r15 + + add rdx,r12 + add r11,r12 + lea rdi,QWORD PTR[1+rdi] + add r11,r14 + + mov r13,QWORD PTR[80+rsp] + mov r14,QWORD PTR[56+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[16+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[72+rsp] + mov r13,rdx + add r12,r14 + mov r14,r11 + ror r13,23 + mov r15,r8 + mov QWORD PTR[72+rsp],r12 + + ror r14,5 + xor r13,rdx + xor r15,r9 + + ror r13,4 + add r12,r10 + xor r14,r11 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rdx + mov r10,rax + + ror r14,6 + xor r13,rdx + xor r15,r9 + + xor r10,rbx + xor r14,r11 + add r12,r15 + mov r15,rax + + ror r13,14 + and r10,r11 + and r15,rbx + + ror r14,28 + add r12,r13 + add r10,r15 + + add rcx,r12 + add r10,r12 + lea rdi,QWORD PTR[1+rdi] + add r10,r14 + + mov r13,QWORD PTR[88+rsp] + mov r14,QWORD PTR[64+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[24+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[80+rsp] + mov r13,rcx + add r12,r14 + mov r14,r10 + ror r13,23 + mov r15,rdx + mov QWORD PTR[80+rsp],r12 + + ror r14,5 + xor r13,rcx + xor r15,r8 + + ror r13,4 + add r12,r9 + xor r14,r10 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rcx + mov r9,r11 + + ror r14,6 + xor r13,rcx + xor r15,r8 + + xor r9,rax + xor r14,r10 + add r12,r15 + mov r15,r11 + + ror r13,14 + and r9,r10 + and r15,rax + + ror r14,28 + add r12,r13 + add r9,r15 + + add rbx,r12 + add r9,r12 + lea rdi,QWORD PTR[1+rdi] + add r9,r14 + + mov r13,QWORD PTR[96+rsp] + mov r14,QWORD PTR[72+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[32+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[88+rsp] + mov r13,rbx + add r12,r14 + mov r14,r9 + ror r13,23 + mov r15,rcx + mov QWORD PTR[88+rsp],r12 + + ror r14,5 + xor r13,rbx + xor r15,rdx + + ror r13,4 + add r12,r8 + xor r14,r9 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rbx + mov r8,r10 + + ror r14,6 + xor r13,rbx + xor r15,rdx + + xor r8,r11 + xor r14,r9 + add r12,r15 + mov r15,r10 + + ror r13,14 + and r8,r9 + and r15,r11 + + ror r14,28 + add r12,r13 + add r8,r15 + + add rax,r12 + add r8,r12 + lea rdi,QWORD PTR[1+rdi] + add r8,r14 + + mov r13,QWORD PTR[104+rsp] + mov r14,QWORD PTR[80+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[40+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[96+rsp] + mov r13,rax + add r12,r14 + mov r14,r8 + ror r13,23 + mov r15,rbx + mov QWORD PTR[96+rsp],r12 + + ror r14,5 + xor r13,rax + xor r15,rcx + + ror r13,4 + add r12,rdx + xor r14,r8 + + add r12,QWORD PTR[rdi*8+rbp] + and r15,rax + mov rdx,r9 + + ror r14,6 + xor r13,rax + xor r15,rcx + + xor rdx,r10 + xor r14,r8 + add r12,r15 + mov r15,r9 + + ror r13,14 + and rdx,r8 + and r15,r10 + + ror r14,28 + add r12,r13 + add rdx,r15 + + add r11,r12 + add rdx,r12 + lea rdi,QWORD PTR[1+rdi] + add rdx,r14 + + mov r13,QWORD PTR[112+rsp] + mov r14,QWORD PTR[88+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[48+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[104+rsp] + mov r13,r11 + add r12,r14 + mov r14,rdx + ror r13,23 + mov r15,rax + mov QWORD PTR[104+rsp],r12 + + ror r14,5 + xor r13,r11 + xor r15,rbx + + ror r13,4 + add r12,rcx + xor r14,rdx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r11 + mov rcx,r8 + + ror r14,6 + xor r13,r11 + xor r15,rbx + + xor rcx,r9 + xor r14,rdx + add r12,r15 + mov r15,r8 + + ror r13,14 + and rcx,rdx + and r15,r9 + + ror r14,28 + add r12,r13 + add rcx,r15 + + add r10,r12 + add rcx,r12 + lea rdi,QWORD PTR[1+rdi] + add rcx,r14 + + mov r13,QWORD PTR[120+rsp] + mov r14,QWORD PTR[96+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[56+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[112+rsp] + mov r13,r10 + add r12,r14 + mov r14,rcx + ror r13,23 + mov r15,r11 + mov QWORD PTR[112+rsp],r12 + + ror r14,5 + xor r13,r10 + xor r15,rax + + ror r13,4 + add r12,rbx + xor r14,rcx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r10 + mov rbx,rdx + + ror r14,6 + xor r13,r10 + xor r15,rax + + xor rbx,r8 + xor r14,rcx + add r12,r15 + mov r15,rdx + + ror r13,14 + and rbx,rcx + and r15,r8 + + ror r14,28 + add r12,r13 + add rbx,r15 + + add r9,r12 + add rbx,r12 + lea rdi,QWORD PTR[1+rdi] + add rbx,r14 + + mov r13,QWORD PTR[rsp] + mov r14,QWORD PTR[104+rsp] + mov r12,r13 + mov r15,r14 + + ror r12,7 + xor r12,r13 + shr r13,7 + + ror r12,1 + xor r13,r12 + mov r12,QWORD PTR[64+rsp] + + ror r15,42 + xor r15,r14 + shr r14,6 + + ror r15,19 + add r12,r13 + xor r14,r15 + + add r12,QWORD PTR[120+rsp] + mov r13,r9 + add r12,r14 + mov r14,rbx + ror r13,23 + mov r15,r10 + mov QWORD PTR[120+rsp],r12 + + ror r14,5 + xor r13,r9 + xor r15,r11 + + ror r13,4 + add r12,rax + xor r14,rbx + + add r12,QWORD PTR[rdi*8+rbp] + and r15,r9 + mov rax,rcx + + ror r14,6 + xor r13,r9 + xor r15,r11 + + xor rax,rdx + xor r14,rbx + add r12,r15 + mov r15,rcx + + ror r13,14 + and rax,rbx + and r15,rdx + + ror r14,28 + add r12,r13 + add rax,r15 + + add r8,r12 + add rax,r12 + lea rdi,QWORD PTR[1+rdi] + add rax,r14 + + cmp rdi,80 + jb $L$rounds_16_xx + + mov rdi,QWORD PTR[((128+0))+rsp] + lea rsi,QWORD PTR[128+rsi] + + add rax,QWORD PTR[rdi] + add rbx,QWORD PTR[8+rdi] + add rcx,QWORD PTR[16+rdi] + add rdx,QWORD PTR[24+rdi] + add r8,QWORD PTR[32+rdi] + add r9,QWORD PTR[40+rdi] + add r10,QWORD PTR[48+rdi] + add r11,QWORD PTR[56+rdi] + + cmp rsi,QWORD PTR[((128+16))+rsp] + + mov QWORD PTR[rdi],rax + mov QWORD PTR[8+rdi],rbx + mov QWORD PTR[16+rdi],rcx + mov QWORD PTR[24+rdi],rdx + mov QWORD PTR[32+rdi],r8 + mov QWORD PTR[40+rdi],r9 + mov QWORD PTR[48+rdi],r10 + mov QWORD PTR[56+rdi],r11 + jb $L$loop + + mov rsi,QWORD PTR[((128+24))+rsp] + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_sha512_block_data_order:: +sha512_block_data_order ENDP +ALIGN 64 + +K512:: + DQ 0428a2f98d728ae22h,07137449123ef65cdh + DQ 0b5c0fbcfec4d3b2fh,0e9b5dba58189dbbch + DQ 03956c25bf348b538h,059f111f1b605d019h + DQ 0923f82a4af194f9bh,0ab1c5ed5da6d8118h + DQ 0d807aa98a3030242h,012835b0145706fbeh + DQ 0243185be4ee4b28ch,0550c7dc3d5ffb4e2h + DQ 072be5d74f27b896fh,080deb1fe3b1696b1h + DQ 09bdc06a725c71235h,0c19bf174cf692694h + DQ 0e49b69c19ef14ad2h,0efbe4786384f25e3h + DQ 00fc19dc68b8cd5b5h,0240ca1cc77ac9c65h + DQ 02de92c6f592b0275h,04a7484aa6ea6e483h + DQ 05cb0a9dcbd41fbd4h,076f988da831153b5h + DQ 0983e5152ee66dfabh,0a831c66d2db43210h + DQ 0b00327c898fb213fh,0bf597fc7beef0ee4h + DQ 0c6e00bf33da88fc2h,0d5a79147930aa725h + DQ 006ca6351e003826fh,0142929670a0e6e70h + DQ 027b70a8546d22ffch,02e1b21385c26c926h + DQ 04d2c6dfc5ac42aedh,053380d139d95b3dfh + DQ 0650a73548baf63deh,0766a0abb3c77b2a8h + DQ 081c2c92e47edaee6h,092722c851482353bh + DQ 0a2bfe8a14cf10364h,0a81a664bbc423001h + DQ 0c24b8b70d0f89791h,0c76c51a30654be30h + DQ 0d192e819d6ef5218h,0d69906245565a910h + DQ 0f40e35855771202ah,0106aa07032bbd1b8h + DQ 019a4c116b8d2d0c8h,01e376c085141ab53h + DQ 02748774cdf8eeb99h,034b0bcb5e19b48a8h + DQ 0391c0cb3c5c95a63h,04ed8aa4ae3418acbh + DQ 05b9cca4f7763e373h,0682e6ff3d6b2b8a3h + DQ 0748f82ee5defb2fch,078a5636f43172f60h + DQ 084c87814a1f0ab72h,08cc702081a6439ech + DQ 090befffa23631e28h,0a4506cebde82bde9h + DQ 0bef9a3f7b2c67915h,0c67178f2e372532bh + DQ 0ca273eceea26619ch,0d186b8c721c0c207h + DQ 0eada7dd6cde0eb1eh,0f57d4f7fee6ed178h + DQ 006f067aa72176fbah,00a637dc5a2c898a6h + DQ 0113f9804bef90daeh,01b710b35131c471bh + DQ 028db77f523047d84h,032caab7b40c72493h + DQ 03c9ebe0a15c9bebch,0431d67c49c100d4ch + DQ 04cc5d4becb3e42b6h,0597f299cfc657e2ah + DQ 05fcb6fab3ad6faech,06c44198c4a475817h + +.text$ ENDS +END diff --git a/crypto/sha/sha512-mingw64-x86_64.S b/crypto/sha/sha512-mingw64-x86_64.S new file mode 100644 index 00000000..51539524 --- /dev/null +++ b/crypto/sha/sha512-mingw64-x86_64.S @@ -0,0 +1,1814 @@ +#include "x86_arch.h" +.text + +.globl sha512_block_data_order +.def sha512_block_data_order; .scl 2; .type 32; .endef +.p2align 4 +sha512_block_data_order: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_sha512_block_data_order: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + movq %r9,%rcx + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + movq %rsp,%r11 + shlq $4,%rdx + subq $128+32,%rsp + leaq (%rsi,%rdx,8),%rdx + andq $-64,%rsp + movq %rdi,128+0(%rsp) + movq %rsi,128+8(%rsp) + movq %rdx,128+16(%rsp) + movq %r11,128+24(%rsp) +.Lprologue: + + leaq K512(%rip),%rbp + + movq 0(%rdi),%rax + movq 8(%rdi),%rbx + movq 16(%rdi),%rcx + movq 24(%rdi),%rdx + movq 32(%rdi),%r8 + movq 40(%rdi),%r9 + movq 48(%rdi),%r10 + movq 56(%rdi),%r11 + jmp .Lloop + +.p2align 4 +.Lloop: + xorq %rdi,%rdi + movq 0(%rsi),%r12 + movq %r8,%r13 + movq %rax,%r14 + bswapq %r12 + rorq $23,%r13 + movq %r9,%r15 + movq %r12,0(%rsp) + + rorq $5,%r14 + xorq %r8,%r13 + xorq %r10,%r15 + + rorq $4,%r13 + addq %r11,%r12 + xorq %rax,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r8,%r15 + movq %rbx,%r11 + + rorq $6,%r14 + xorq %r8,%r13 + xorq %r10,%r15 + + xorq %rcx,%r11 + xorq %rax,%r14 + addq %r15,%r12 + movq %rbx,%r15 + + rorq $14,%r13 + andq %rax,%r11 + andq %rcx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r11 + + addq %r12,%rdx + addq %r12,%r11 + leaq 1(%rdi),%rdi + addq %r14,%r11 + + movq 8(%rsi),%r12 + movq %rdx,%r13 + movq %r11,%r14 + bswapq %r12 + rorq $23,%r13 + movq %r8,%r15 + movq %r12,8(%rsp) + + rorq $5,%r14 + xorq %rdx,%r13 + xorq %r9,%r15 + + rorq $4,%r13 + addq %r10,%r12 + xorq %r11,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rdx,%r15 + movq %rax,%r10 + + rorq $6,%r14 + xorq %rdx,%r13 + xorq %r9,%r15 + + xorq %rbx,%r10 + xorq %r11,%r14 + addq %r15,%r12 + movq %rax,%r15 + + rorq $14,%r13 + andq %r11,%r10 + andq %rbx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r10 + + addq %r12,%rcx + addq %r12,%r10 + leaq 1(%rdi),%rdi + addq %r14,%r10 + + movq 16(%rsi),%r12 + movq %rcx,%r13 + movq %r10,%r14 + bswapq %r12 + rorq $23,%r13 + movq %rdx,%r15 + movq %r12,16(%rsp) + + rorq $5,%r14 + xorq %rcx,%r13 + xorq %r8,%r15 + + rorq $4,%r13 + addq %r9,%r12 + xorq %r10,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rcx,%r15 + movq %r11,%r9 + + rorq $6,%r14 + xorq %rcx,%r13 + xorq %r8,%r15 + + xorq %rax,%r9 + xorq %r10,%r14 + addq %r15,%r12 + movq %r11,%r15 + + rorq $14,%r13 + andq %r10,%r9 + andq %rax,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r9 + + addq %r12,%rbx + addq %r12,%r9 + leaq 1(%rdi),%rdi + addq %r14,%r9 + + movq 24(%rsi),%r12 + movq %rbx,%r13 + movq %r9,%r14 + bswapq %r12 + rorq $23,%r13 + movq %rcx,%r15 + movq %r12,24(%rsp) + + rorq $5,%r14 + xorq %rbx,%r13 + xorq %rdx,%r15 + + rorq $4,%r13 + addq %r8,%r12 + xorq %r9,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rbx,%r15 + movq %r10,%r8 + + rorq $6,%r14 + xorq %rbx,%r13 + xorq %rdx,%r15 + + xorq %r11,%r8 + xorq %r9,%r14 + addq %r15,%r12 + movq %r10,%r15 + + rorq $14,%r13 + andq %r9,%r8 + andq %r11,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r8 + + addq %r12,%rax + addq %r12,%r8 + leaq 1(%rdi),%rdi + addq %r14,%r8 + + movq 32(%rsi),%r12 + movq %rax,%r13 + movq %r8,%r14 + bswapq %r12 + rorq $23,%r13 + movq %rbx,%r15 + movq %r12,32(%rsp) + + rorq $5,%r14 + xorq %rax,%r13 + xorq %rcx,%r15 + + rorq $4,%r13 + addq %rdx,%r12 + xorq %r8,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rax,%r15 + movq %r9,%rdx + + rorq $6,%r14 + xorq %rax,%r13 + xorq %rcx,%r15 + + xorq %r10,%rdx + xorq %r8,%r14 + addq %r15,%r12 + movq %r9,%r15 + + rorq $14,%r13 + andq %r8,%rdx + andq %r10,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rdx + + addq %r12,%r11 + addq %r12,%rdx + leaq 1(%rdi),%rdi + addq %r14,%rdx + + movq 40(%rsi),%r12 + movq %r11,%r13 + movq %rdx,%r14 + bswapq %r12 + rorq $23,%r13 + movq %rax,%r15 + movq %r12,40(%rsp) + + rorq $5,%r14 + xorq %r11,%r13 + xorq %rbx,%r15 + + rorq $4,%r13 + addq %rcx,%r12 + xorq %rdx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r11,%r15 + movq %r8,%rcx + + rorq $6,%r14 + xorq %r11,%r13 + xorq %rbx,%r15 + + xorq %r9,%rcx + xorq %rdx,%r14 + addq %r15,%r12 + movq %r8,%r15 + + rorq $14,%r13 + andq %rdx,%rcx + andq %r9,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rcx + + addq %r12,%r10 + addq %r12,%rcx + leaq 1(%rdi),%rdi + addq %r14,%rcx + + movq 48(%rsi),%r12 + movq %r10,%r13 + movq %rcx,%r14 + bswapq %r12 + rorq $23,%r13 + movq %r11,%r15 + movq %r12,48(%rsp) + + rorq $5,%r14 + xorq %r10,%r13 + xorq %rax,%r15 + + rorq $4,%r13 + addq %rbx,%r12 + xorq %rcx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r10,%r15 + movq %rdx,%rbx + + rorq $6,%r14 + xorq %r10,%r13 + xorq %rax,%r15 + + xorq %r8,%rbx + xorq %rcx,%r14 + addq %r15,%r12 + movq %rdx,%r15 + + rorq $14,%r13 + andq %rcx,%rbx + andq %r8,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rbx + + addq %r12,%r9 + addq %r12,%rbx + leaq 1(%rdi),%rdi + addq %r14,%rbx + + movq 56(%rsi),%r12 + movq %r9,%r13 + movq %rbx,%r14 + bswapq %r12 + rorq $23,%r13 + movq %r10,%r15 + movq %r12,56(%rsp) + + rorq $5,%r14 + xorq %r9,%r13 + xorq %r11,%r15 + + rorq $4,%r13 + addq %rax,%r12 + xorq %rbx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r9,%r15 + movq %rcx,%rax + + rorq $6,%r14 + xorq %r9,%r13 + xorq %r11,%r15 + + xorq %rdx,%rax + xorq %rbx,%r14 + addq %r15,%r12 + movq %rcx,%r15 + + rorq $14,%r13 + andq %rbx,%rax + andq %rdx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rax + + addq %r12,%r8 + addq %r12,%rax + leaq 1(%rdi),%rdi + addq %r14,%rax + + movq 64(%rsi),%r12 + movq %r8,%r13 + movq %rax,%r14 + bswapq %r12 + rorq $23,%r13 + movq %r9,%r15 + movq %r12,64(%rsp) + + rorq $5,%r14 + xorq %r8,%r13 + xorq %r10,%r15 + + rorq $4,%r13 + addq %r11,%r12 + xorq %rax,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r8,%r15 + movq %rbx,%r11 + + rorq $6,%r14 + xorq %r8,%r13 + xorq %r10,%r15 + + xorq %rcx,%r11 + xorq %rax,%r14 + addq %r15,%r12 + movq %rbx,%r15 + + rorq $14,%r13 + andq %rax,%r11 + andq %rcx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r11 + + addq %r12,%rdx + addq %r12,%r11 + leaq 1(%rdi),%rdi + addq %r14,%r11 + + movq 72(%rsi),%r12 + movq %rdx,%r13 + movq %r11,%r14 + bswapq %r12 + rorq $23,%r13 + movq %r8,%r15 + movq %r12,72(%rsp) + + rorq $5,%r14 + xorq %rdx,%r13 + xorq %r9,%r15 + + rorq $4,%r13 + addq %r10,%r12 + xorq %r11,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rdx,%r15 + movq %rax,%r10 + + rorq $6,%r14 + xorq %rdx,%r13 + xorq %r9,%r15 + + xorq %rbx,%r10 + xorq %r11,%r14 + addq %r15,%r12 + movq %rax,%r15 + + rorq $14,%r13 + andq %r11,%r10 + andq %rbx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r10 + + addq %r12,%rcx + addq %r12,%r10 + leaq 1(%rdi),%rdi + addq %r14,%r10 + + movq 80(%rsi),%r12 + movq %rcx,%r13 + movq %r10,%r14 + bswapq %r12 + rorq $23,%r13 + movq %rdx,%r15 + movq %r12,80(%rsp) + + rorq $5,%r14 + xorq %rcx,%r13 + xorq %r8,%r15 + + rorq $4,%r13 + addq %r9,%r12 + xorq %r10,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rcx,%r15 + movq %r11,%r9 + + rorq $6,%r14 + xorq %rcx,%r13 + xorq %r8,%r15 + + xorq %rax,%r9 + xorq %r10,%r14 + addq %r15,%r12 + movq %r11,%r15 + + rorq $14,%r13 + andq %r10,%r9 + andq %rax,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r9 + + addq %r12,%rbx + addq %r12,%r9 + leaq 1(%rdi),%rdi + addq %r14,%r9 + + movq 88(%rsi),%r12 + movq %rbx,%r13 + movq %r9,%r14 + bswapq %r12 + rorq $23,%r13 + movq %rcx,%r15 + movq %r12,88(%rsp) + + rorq $5,%r14 + xorq %rbx,%r13 + xorq %rdx,%r15 + + rorq $4,%r13 + addq %r8,%r12 + xorq %r9,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rbx,%r15 + movq %r10,%r8 + + rorq $6,%r14 + xorq %rbx,%r13 + xorq %rdx,%r15 + + xorq %r11,%r8 + xorq %r9,%r14 + addq %r15,%r12 + movq %r10,%r15 + + rorq $14,%r13 + andq %r9,%r8 + andq %r11,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r8 + + addq %r12,%rax + addq %r12,%r8 + leaq 1(%rdi),%rdi + addq %r14,%r8 + + movq 96(%rsi),%r12 + movq %rax,%r13 + movq %r8,%r14 + bswapq %r12 + rorq $23,%r13 + movq %rbx,%r15 + movq %r12,96(%rsp) + + rorq $5,%r14 + xorq %rax,%r13 + xorq %rcx,%r15 + + rorq $4,%r13 + addq %rdx,%r12 + xorq %r8,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rax,%r15 + movq %r9,%rdx + + rorq $6,%r14 + xorq %rax,%r13 + xorq %rcx,%r15 + + xorq %r10,%rdx + xorq %r8,%r14 + addq %r15,%r12 + movq %r9,%r15 + + rorq $14,%r13 + andq %r8,%rdx + andq %r10,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rdx + + addq %r12,%r11 + addq %r12,%rdx + leaq 1(%rdi),%rdi + addq %r14,%rdx + + movq 104(%rsi),%r12 + movq %r11,%r13 + movq %rdx,%r14 + bswapq %r12 + rorq $23,%r13 + movq %rax,%r15 + movq %r12,104(%rsp) + + rorq $5,%r14 + xorq %r11,%r13 + xorq %rbx,%r15 + + rorq $4,%r13 + addq %rcx,%r12 + xorq %rdx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r11,%r15 + movq %r8,%rcx + + rorq $6,%r14 + xorq %r11,%r13 + xorq %rbx,%r15 + + xorq %r9,%rcx + xorq %rdx,%r14 + addq %r15,%r12 + movq %r8,%r15 + + rorq $14,%r13 + andq %rdx,%rcx + andq %r9,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rcx + + addq %r12,%r10 + addq %r12,%rcx + leaq 1(%rdi),%rdi + addq %r14,%rcx + + movq 112(%rsi),%r12 + movq %r10,%r13 + movq %rcx,%r14 + bswapq %r12 + rorq $23,%r13 + movq %r11,%r15 + movq %r12,112(%rsp) + + rorq $5,%r14 + xorq %r10,%r13 + xorq %rax,%r15 + + rorq $4,%r13 + addq %rbx,%r12 + xorq %rcx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r10,%r15 + movq %rdx,%rbx + + rorq $6,%r14 + xorq %r10,%r13 + xorq %rax,%r15 + + xorq %r8,%rbx + xorq %rcx,%r14 + addq %r15,%r12 + movq %rdx,%r15 + + rorq $14,%r13 + andq %rcx,%rbx + andq %r8,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rbx + + addq %r12,%r9 + addq %r12,%rbx + leaq 1(%rdi),%rdi + addq %r14,%rbx + + movq 120(%rsi),%r12 + movq %r9,%r13 + movq %rbx,%r14 + bswapq %r12 + rorq $23,%r13 + movq %r10,%r15 + movq %r12,120(%rsp) + + rorq $5,%r14 + xorq %r9,%r13 + xorq %r11,%r15 + + rorq $4,%r13 + addq %rax,%r12 + xorq %rbx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r9,%r15 + movq %rcx,%rax + + rorq $6,%r14 + xorq %r9,%r13 + xorq %r11,%r15 + + xorq %rdx,%rax + xorq %rbx,%r14 + addq %r15,%r12 + movq %rcx,%r15 + + rorq $14,%r13 + andq %rbx,%rax + andq %rdx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rax + + addq %r12,%r8 + addq %r12,%rax + leaq 1(%rdi),%rdi + addq %r14,%rax + + jmp .Lrounds_16_xx +.p2align 4 +.Lrounds_16_xx: + movq 8(%rsp),%r13 + movq 112(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 72(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 0(%rsp),%r12 + movq %r8,%r13 + addq %r14,%r12 + movq %rax,%r14 + rorq $23,%r13 + movq %r9,%r15 + movq %r12,0(%rsp) + + rorq $5,%r14 + xorq %r8,%r13 + xorq %r10,%r15 + + rorq $4,%r13 + addq %r11,%r12 + xorq %rax,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r8,%r15 + movq %rbx,%r11 + + rorq $6,%r14 + xorq %r8,%r13 + xorq %r10,%r15 + + xorq %rcx,%r11 + xorq %rax,%r14 + addq %r15,%r12 + movq %rbx,%r15 + + rorq $14,%r13 + andq %rax,%r11 + andq %rcx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r11 + + addq %r12,%rdx + addq %r12,%r11 + leaq 1(%rdi),%rdi + addq %r14,%r11 + + movq 16(%rsp),%r13 + movq 120(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 80(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 8(%rsp),%r12 + movq %rdx,%r13 + addq %r14,%r12 + movq %r11,%r14 + rorq $23,%r13 + movq %r8,%r15 + movq %r12,8(%rsp) + + rorq $5,%r14 + xorq %rdx,%r13 + xorq %r9,%r15 + + rorq $4,%r13 + addq %r10,%r12 + xorq %r11,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rdx,%r15 + movq %rax,%r10 + + rorq $6,%r14 + xorq %rdx,%r13 + xorq %r9,%r15 + + xorq %rbx,%r10 + xorq %r11,%r14 + addq %r15,%r12 + movq %rax,%r15 + + rorq $14,%r13 + andq %r11,%r10 + andq %rbx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r10 + + addq %r12,%rcx + addq %r12,%r10 + leaq 1(%rdi),%rdi + addq %r14,%r10 + + movq 24(%rsp),%r13 + movq 0(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 88(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 16(%rsp),%r12 + movq %rcx,%r13 + addq %r14,%r12 + movq %r10,%r14 + rorq $23,%r13 + movq %rdx,%r15 + movq %r12,16(%rsp) + + rorq $5,%r14 + xorq %rcx,%r13 + xorq %r8,%r15 + + rorq $4,%r13 + addq %r9,%r12 + xorq %r10,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rcx,%r15 + movq %r11,%r9 + + rorq $6,%r14 + xorq %rcx,%r13 + xorq %r8,%r15 + + xorq %rax,%r9 + xorq %r10,%r14 + addq %r15,%r12 + movq %r11,%r15 + + rorq $14,%r13 + andq %r10,%r9 + andq %rax,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r9 + + addq %r12,%rbx + addq %r12,%r9 + leaq 1(%rdi),%rdi + addq %r14,%r9 + + movq 32(%rsp),%r13 + movq 8(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 96(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 24(%rsp),%r12 + movq %rbx,%r13 + addq %r14,%r12 + movq %r9,%r14 + rorq $23,%r13 + movq %rcx,%r15 + movq %r12,24(%rsp) + + rorq $5,%r14 + xorq %rbx,%r13 + xorq %rdx,%r15 + + rorq $4,%r13 + addq %r8,%r12 + xorq %r9,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rbx,%r15 + movq %r10,%r8 + + rorq $6,%r14 + xorq %rbx,%r13 + xorq %rdx,%r15 + + xorq %r11,%r8 + xorq %r9,%r14 + addq %r15,%r12 + movq %r10,%r15 + + rorq $14,%r13 + andq %r9,%r8 + andq %r11,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r8 + + addq %r12,%rax + addq %r12,%r8 + leaq 1(%rdi),%rdi + addq %r14,%r8 + + movq 40(%rsp),%r13 + movq 16(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 104(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 32(%rsp),%r12 + movq %rax,%r13 + addq %r14,%r12 + movq %r8,%r14 + rorq $23,%r13 + movq %rbx,%r15 + movq %r12,32(%rsp) + + rorq $5,%r14 + xorq %rax,%r13 + xorq %rcx,%r15 + + rorq $4,%r13 + addq %rdx,%r12 + xorq %r8,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rax,%r15 + movq %r9,%rdx + + rorq $6,%r14 + xorq %rax,%r13 + xorq %rcx,%r15 + + xorq %r10,%rdx + xorq %r8,%r14 + addq %r15,%r12 + movq %r9,%r15 + + rorq $14,%r13 + andq %r8,%rdx + andq %r10,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rdx + + addq %r12,%r11 + addq %r12,%rdx + leaq 1(%rdi),%rdi + addq %r14,%rdx + + movq 48(%rsp),%r13 + movq 24(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 112(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 40(%rsp),%r12 + movq %r11,%r13 + addq %r14,%r12 + movq %rdx,%r14 + rorq $23,%r13 + movq %rax,%r15 + movq %r12,40(%rsp) + + rorq $5,%r14 + xorq %r11,%r13 + xorq %rbx,%r15 + + rorq $4,%r13 + addq %rcx,%r12 + xorq %rdx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r11,%r15 + movq %r8,%rcx + + rorq $6,%r14 + xorq %r11,%r13 + xorq %rbx,%r15 + + xorq %r9,%rcx + xorq %rdx,%r14 + addq %r15,%r12 + movq %r8,%r15 + + rorq $14,%r13 + andq %rdx,%rcx + andq %r9,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rcx + + addq %r12,%r10 + addq %r12,%rcx + leaq 1(%rdi),%rdi + addq %r14,%rcx + + movq 56(%rsp),%r13 + movq 32(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 120(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 48(%rsp),%r12 + movq %r10,%r13 + addq %r14,%r12 + movq %rcx,%r14 + rorq $23,%r13 + movq %r11,%r15 + movq %r12,48(%rsp) + + rorq $5,%r14 + xorq %r10,%r13 + xorq %rax,%r15 + + rorq $4,%r13 + addq %rbx,%r12 + xorq %rcx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r10,%r15 + movq %rdx,%rbx + + rorq $6,%r14 + xorq %r10,%r13 + xorq %rax,%r15 + + xorq %r8,%rbx + xorq %rcx,%r14 + addq %r15,%r12 + movq %rdx,%r15 + + rorq $14,%r13 + andq %rcx,%rbx + andq %r8,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rbx + + addq %r12,%r9 + addq %r12,%rbx + leaq 1(%rdi),%rdi + addq %r14,%rbx + + movq 64(%rsp),%r13 + movq 40(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 0(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 56(%rsp),%r12 + movq %r9,%r13 + addq %r14,%r12 + movq %rbx,%r14 + rorq $23,%r13 + movq %r10,%r15 + movq %r12,56(%rsp) + + rorq $5,%r14 + xorq %r9,%r13 + xorq %r11,%r15 + + rorq $4,%r13 + addq %rax,%r12 + xorq %rbx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r9,%r15 + movq %rcx,%rax + + rorq $6,%r14 + xorq %r9,%r13 + xorq %r11,%r15 + + xorq %rdx,%rax + xorq %rbx,%r14 + addq %r15,%r12 + movq %rcx,%r15 + + rorq $14,%r13 + andq %rbx,%rax + andq %rdx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rax + + addq %r12,%r8 + addq %r12,%rax + leaq 1(%rdi),%rdi + addq %r14,%rax + + movq 72(%rsp),%r13 + movq 48(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 8(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 64(%rsp),%r12 + movq %r8,%r13 + addq %r14,%r12 + movq %rax,%r14 + rorq $23,%r13 + movq %r9,%r15 + movq %r12,64(%rsp) + + rorq $5,%r14 + xorq %r8,%r13 + xorq %r10,%r15 + + rorq $4,%r13 + addq %r11,%r12 + xorq %rax,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r8,%r15 + movq %rbx,%r11 + + rorq $6,%r14 + xorq %r8,%r13 + xorq %r10,%r15 + + xorq %rcx,%r11 + xorq %rax,%r14 + addq %r15,%r12 + movq %rbx,%r15 + + rorq $14,%r13 + andq %rax,%r11 + andq %rcx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r11 + + addq %r12,%rdx + addq %r12,%r11 + leaq 1(%rdi),%rdi + addq %r14,%r11 + + movq 80(%rsp),%r13 + movq 56(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 16(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 72(%rsp),%r12 + movq %rdx,%r13 + addq %r14,%r12 + movq %r11,%r14 + rorq $23,%r13 + movq %r8,%r15 + movq %r12,72(%rsp) + + rorq $5,%r14 + xorq %rdx,%r13 + xorq %r9,%r15 + + rorq $4,%r13 + addq %r10,%r12 + xorq %r11,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rdx,%r15 + movq %rax,%r10 + + rorq $6,%r14 + xorq %rdx,%r13 + xorq %r9,%r15 + + xorq %rbx,%r10 + xorq %r11,%r14 + addq %r15,%r12 + movq %rax,%r15 + + rorq $14,%r13 + andq %r11,%r10 + andq %rbx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r10 + + addq %r12,%rcx + addq %r12,%r10 + leaq 1(%rdi),%rdi + addq %r14,%r10 + + movq 88(%rsp),%r13 + movq 64(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 24(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 80(%rsp),%r12 + movq %rcx,%r13 + addq %r14,%r12 + movq %r10,%r14 + rorq $23,%r13 + movq %rdx,%r15 + movq %r12,80(%rsp) + + rorq $5,%r14 + xorq %rcx,%r13 + xorq %r8,%r15 + + rorq $4,%r13 + addq %r9,%r12 + xorq %r10,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rcx,%r15 + movq %r11,%r9 + + rorq $6,%r14 + xorq %rcx,%r13 + xorq %r8,%r15 + + xorq %rax,%r9 + xorq %r10,%r14 + addq %r15,%r12 + movq %r11,%r15 + + rorq $14,%r13 + andq %r10,%r9 + andq %rax,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r9 + + addq %r12,%rbx + addq %r12,%r9 + leaq 1(%rdi),%rdi + addq %r14,%r9 + + movq 96(%rsp),%r13 + movq 72(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 32(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 88(%rsp),%r12 + movq %rbx,%r13 + addq %r14,%r12 + movq %r9,%r14 + rorq $23,%r13 + movq %rcx,%r15 + movq %r12,88(%rsp) + + rorq $5,%r14 + xorq %rbx,%r13 + xorq %rdx,%r15 + + rorq $4,%r13 + addq %r8,%r12 + xorq %r9,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rbx,%r15 + movq %r10,%r8 + + rorq $6,%r14 + xorq %rbx,%r13 + xorq %rdx,%r15 + + xorq %r11,%r8 + xorq %r9,%r14 + addq %r15,%r12 + movq %r10,%r15 + + rorq $14,%r13 + andq %r9,%r8 + andq %r11,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%r8 + + addq %r12,%rax + addq %r12,%r8 + leaq 1(%rdi),%rdi + addq %r14,%r8 + + movq 104(%rsp),%r13 + movq 80(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 40(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 96(%rsp),%r12 + movq %rax,%r13 + addq %r14,%r12 + movq %r8,%r14 + rorq $23,%r13 + movq %rbx,%r15 + movq %r12,96(%rsp) + + rorq $5,%r14 + xorq %rax,%r13 + xorq %rcx,%r15 + + rorq $4,%r13 + addq %rdx,%r12 + xorq %r8,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %rax,%r15 + movq %r9,%rdx + + rorq $6,%r14 + xorq %rax,%r13 + xorq %rcx,%r15 + + xorq %r10,%rdx + xorq %r8,%r14 + addq %r15,%r12 + movq %r9,%r15 + + rorq $14,%r13 + andq %r8,%rdx + andq %r10,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rdx + + addq %r12,%r11 + addq %r12,%rdx + leaq 1(%rdi),%rdi + addq %r14,%rdx + + movq 112(%rsp),%r13 + movq 88(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 48(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 104(%rsp),%r12 + movq %r11,%r13 + addq %r14,%r12 + movq %rdx,%r14 + rorq $23,%r13 + movq %rax,%r15 + movq %r12,104(%rsp) + + rorq $5,%r14 + xorq %r11,%r13 + xorq %rbx,%r15 + + rorq $4,%r13 + addq %rcx,%r12 + xorq %rdx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r11,%r15 + movq %r8,%rcx + + rorq $6,%r14 + xorq %r11,%r13 + xorq %rbx,%r15 + + xorq %r9,%rcx + xorq %rdx,%r14 + addq %r15,%r12 + movq %r8,%r15 + + rorq $14,%r13 + andq %rdx,%rcx + andq %r9,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rcx + + addq %r12,%r10 + addq %r12,%rcx + leaq 1(%rdi),%rdi + addq %r14,%rcx + + movq 120(%rsp),%r13 + movq 96(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 56(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 112(%rsp),%r12 + movq %r10,%r13 + addq %r14,%r12 + movq %rcx,%r14 + rorq $23,%r13 + movq %r11,%r15 + movq %r12,112(%rsp) + + rorq $5,%r14 + xorq %r10,%r13 + xorq %rax,%r15 + + rorq $4,%r13 + addq %rbx,%r12 + xorq %rcx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r10,%r15 + movq %rdx,%rbx + + rorq $6,%r14 + xorq %r10,%r13 + xorq %rax,%r15 + + xorq %r8,%rbx + xorq %rcx,%r14 + addq %r15,%r12 + movq %rdx,%r15 + + rorq $14,%r13 + andq %rcx,%rbx + andq %r8,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rbx + + addq %r12,%r9 + addq %r12,%rbx + leaq 1(%rdi),%rdi + addq %r14,%rbx + + movq 0(%rsp),%r13 + movq 104(%rsp),%r14 + movq %r13,%r12 + movq %r14,%r15 + + rorq $7,%r12 + xorq %r13,%r12 + shrq $7,%r13 + + rorq $1,%r12 + xorq %r12,%r13 + movq 64(%rsp),%r12 + + rorq $42,%r15 + xorq %r14,%r15 + shrq $6,%r14 + + rorq $19,%r15 + addq %r13,%r12 + xorq %r15,%r14 + + addq 120(%rsp),%r12 + movq %r9,%r13 + addq %r14,%r12 + movq %rbx,%r14 + rorq $23,%r13 + movq %r10,%r15 + movq %r12,120(%rsp) + + rorq $5,%r14 + xorq %r9,%r13 + xorq %r11,%r15 + + rorq $4,%r13 + addq %rax,%r12 + xorq %rbx,%r14 + + addq (%rbp,%rdi,8),%r12 + andq %r9,%r15 + movq %rcx,%rax + + rorq $6,%r14 + xorq %r9,%r13 + xorq %r11,%r15 + + xorq %rdx,%rax + xorq %rbx,%r14 + addq %r15,%r12 + movq %rcx,%r15 + + rorq $14,%r13 + andq %rbx,%rax + andq %rdx,%r15 + + rorq $28,%r14 + addq %r13,%r12 + addq %r15,%rax + + addq %r12,%r8 + addq %r12,%rax + leaq 1(%rdi),%rdi + addq %r14,%rax + + cmpq $80,%rdi + jb .Lrounds_16_xx + + movq 128+0(%rsp),%rdi + leaq 128(%rsi),%rsi + + addq 0(%rdi),%rax + addq 8(%rdi),%rbx + addq 16(%rdi),%rcx + addq 24(%rdi),%rdx + addq 32(%rdi),%r8 + addq 40(%rdi),%r9 + addq 48(%rdi),%r10 + addq 56(%rdi),%r11 + + cmpq 128+16(%rsp),%rsi + + movq %rax,0(%rdi) + movq %rbx,8(%rdi) + movq %rcx,16(%rdi) + movq %rdx,24(%rdi) + movq %r8,32(%rdi) + movq %r9,40(%rdi) + movq %r10,48(%rdi) + movq %r11,56(%rdi) + jb .Lloop + + movq 128+24(%rsp),%rsi + movq (%rsi),%r15 + movq 8(%rsi),%r14 + movq 16(%rsi),%r13 + movq 24(%rsi),%r12 + movq 32(%rsi),%rbp + movq 40(%rsi),%rbx + leaq 48(%rsi),%rsp +.Lepilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_sha512_block_data_order: +.p2align 6 + +K512: +.quad 0x428a2f98d728ae22,0x7137449123ef65cd +.quad 0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc +.quad 0x3956c25bf348b538,0x59f111f1b605d019 +.quad 0x923f82a4af194f9b,0xab1c5ed5da6d8118 +.quad 0xd807aa98a3030242,0x12835b0145706fbe +.quad 0x243185be4ee4b28c,0x550c7dc3d5ffb4e2 +.quad 0x72be5d74f27b896f,0x80deb1fe3b1696b1 +.quad 0x9bdc06a725c71235,0xc19bf174cf692694 +.quad 0xe49b69c19ef14ad2,0xefbe4786384f25e3 +.quad 0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65 +.quad 0x2de92c6f592b0275,0x4a7484aa6ea6e483 +.quad 0x5cb0a9dcbd41fbd4,0x76f988da831153b5 +.quad 0x983e5152ee66dfab,0xa831c66d2db43210 +.quad 0xb00327c898fb213f,0xbf597fc7beef0ee4 +.quad 0xc6e00bf33da88fc2,0xd5a79147930aa725 +.quad 0x06ca6351e003826f,0x142929670a0e6e70 +.quad 0x27b70a8546d22ffc,0x2e1b21385c26c926 +.quad 0x4d2c6dfc5ac42aed,0x53380d139d95b3df +.quad 0x650a73548baf63de,0x766a0abb3c77b2a8 +.quad 0x81c2c92e47edaee6,0x92722c851482353b +.quad 0xa2bfe8a14cf10364,0xa81a664bbc423001 +.quad 0xc24b8b70d0f89791,0xc76c51a30654be30 +.quad 0xd192e819d6ef5218,0xd69906245565a910 +.quad 0xf40e35855771202a,0x106aa07032bbd1b8 +.quad 0x19a4c116b8d2d0c8,0x1e376c085141ab53 +.quad 0x2748774cdf8eeb99,0x34b0bcb5e19b48a8 +.quad 0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb +.quad 0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3 +.quad 0x748f82ee5defb2fc,0x78a5636f43172f60 +.quad 0x84c87814a1f0ab72,0x8cc702081a6439ec +.quad 0x90befffa23631e28,0xa4506cebde82bde9 +.quad 0xbef9a3f7b2c67915,0xc67178f2e372532b +.quad 0xca273eceea26619c,0xd186b8c721c0c207 +.quad 0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178 +.quad 0x06f067aa72176fba,0x0a637dc5a2c898a6 +.quad 0x113f9804bef90dae,0x1b710b35131c471b +.quad 0x28db77f523047d84,0x32caab7b40c72493 +.quad 0x3c9ebe0a15c9bebc,0x431d67c49c100d4c +.quad 0x4cc5d4becb3e42b6,0x597f299cfc657e2a +.quad 0x5fcb6fab3ad6faec,0x6c44198c4a475817 diff --git a/crypto/sm3/sm3.c b/crypto/sm3/sm3.c new file mode 100644 index 00000000..ff6240a0 --- /dev/null +++ b/crypto/sm3/sm3.c @@ -0,0 +1,206 @@ +/* $OpenBSD: sm3.c,v 1.1 2018/11/11 06:53:31 tb Exp $ */ +/* + * Copyright (c) 2018, Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef OPENSSL_NO_SM3 + +#include + +#include "sm3_locl.h" + +int +SM3_Init(SM3_CTX *c) +{ + memset(c, 0, sizeof(*c)); + c->A = SM3_A; + c->B = SM3_B; + c->C = SM3_C; + c->D = SM3_D; + c->E = SM3_E; + c->F = SM3_F; + c->G = SM3_G; + c->H = SM3_H; + return 1; +} + +void +SM3_block_data_order(SM3_CTX *ctx, const void *p, size_t num) +{ + const unsigned char *data = p; + SM3_WORD A, B, C, D, E, F, G, H; + SM3_WORD W00, W01, W02, W03, W04, W05, W06, W07; + SM3_WORD W08, W09, W10, W11, W12, W13, W14, W15; + + while (num-- != 0) { + A = ctx->A; + B = ctx->B; + C = ctx->C; + D = ctx->D; + E = ctx->E; + F = ctx->F; + G = ctx->G; + H = ctx->H; + + /* + * We have to load all message bytes immediately since SM3 reads + * them slightly out of order. + */ + HOST_c2l(data, W00); + HOST_c2l(data, W01); + HOST_c2l(data, W02); + HOST_c2l(data, W03); + HOST_c2l(data, W04); + HOST_c2l(data, W05); + HOST_c2l(data, W06); + HOST_c2l(data, W07); + HOST_c2l(data, W08); + HOST_c2l(data, W09); + HOST_c2l(data, W10); + HOST_c2l(data, W11); + HOST_c2l(data, W12); + HOST_c2l(data, W13); + HOST_c2l(data, W14); + HOST_c2l(data, W15); + + R1(A, B, C, D, E, F, G, H, 0x79cc4519, W00, W00 ^ W04); + W00 = EXPAND(W00, W07, W13, W03, W10); + R1(D, A, B, C, H, E, F, G, 0xf3988a32, W01, W01 ^ W05); + W01 = EXPAND(W01, W08, W14, W04, W11); + R1(C, D, A, B, G, H, E, F, 0xe7311465, W02, W02 ^ W06); + W02 = EXPAND(W02, W09, W15, W05, W12); + R1(B, C, D, A, F, G, H, E, 0xce6228cb, W03, W03 ^ W07); + W03 = EXPAND(W03, W10, W00, W06, W13); + R1(A, B, C, D, E, F, G, H, 0x9cc45197, W04, W04 ^ W08); + W04 = EXPAND(W04, W11, W01, W07, W14); + R1(D, A, B, C, H, E, F, G, 0x3988a32f, W05, W05 ^ W09); + W05 = EXPAND(W05, W12, W02, W08, W15); + R1(C, D, A, B, G, H, E, F, 0x7311465e, W06, W06 ^ W10); + W06 = EXPAND(W06, W13, W03, W09, W00); + R1(B, C, D, A, F, G, H, E, 0xe6228cbc, W07, W07 ^ W11); + W07 = EXPAND(W07, W14, W04, W10, W01); + R1(A, B, C, D, E, F, G, H, 0xcc451979, W08, W08 ^ W12); + W08 = EXPAND(W08, W15, W05, W11, W02); + R1(D, A, B, C, H, E, F, G, 0x988a32f3, W09, W09 ^ W13); + W09 = EXPAND(W09, W00, W06, W12, W03); + R1(C, D, A, B, G, H, E, F, 0x311465e7, W10, W10 ^ W14); + W10 = EXPAND(W10, W01, W07, W13, W04); + R1(B, C, D, A, F, G, H, E, 0x6228cbce, W11, W11 ^ W15); + W11 = EXPAND(W11, W02, W08, W14, W05); + R1(A, B, C, D, E, F, G, H, 0xc451979c, W12, W12 ^ W00); + W12 = EXPAND(W12, W03, W09, W15, W06); + R1(D, A, B, C, H, E, F, G, 0x88a32f39, W13, W13 ^ W01); + W13 = EXPAND(W13, W04, W10, W00, W07); + R1(C, D, A, B, G, H, E, F, 0x11465e73, W14, W14 ^ W02); + W14 = EXPAND(W14, W05, W11, W01, W08); + R1(B, C, D, A, F, G, H, E, 0x228cbce6, W15, W15 ^ W03); + W15 = EXPAND(W15, W06, W12, W02, W09); + R2(A, B, C, D, E, F, G, H, 0x9d8a7a87, W00, W00 ^ W04); + W00 = EXPAND(W00, W07, W13, W03, W10); + R2(D, A, B, C, H, E, F, G, 0x3b14f50f, W01, W01 ^ W05); + W01 = EXPAND(W01, W08, W14, W04, W11); + R2(C, D, A, B, G, H, E, F, 0x7629ea1e, W02, W02 ^ W06); + W02 = EXPAND(W02, W09, W15, W05, W12); + R2(B, C, D, A, F, G, H, E, 0xec53d43c, W03, W03 ^ W07); + W03 = EXPAND(W03, W10, W00, W06, W13); + R2(A, B, C, D, E, F, G, H, 0xd8a7a879, W04, W04 ^ W08); + W04 = EXPAND(W04, W11, W01, W07, W14); + R2(D, A, B, C, H, E, F, G, 0xb14f50f3, W05, W05 ^ W09); + W05 = EXPAND(W05, W12, W02, W08, W15); + R2(C, D, A, B, G, H, E, F, 0x629ea1e7, W06, W06 ^ W10); + W06 = EXPAND(W06, W13, W03, W09, W00); + R2(B, C, D, A, F, G, H, E, 0xc53d43ce, W07, W07 ^ W11); + W07 = EXPAND(W07, W14, W04, W10, W01); + R2(A, B, C, D, E, F, G, H, 0x8a7a879d, W08, W08 ^ W12); + W08 = EXPAND(W08, W15, W05, W11, W02); + R2(D, A, B, C, H, E, F, G, 0x14f50f3b, W09, W09 ^ W13); + W09 = EXPAND(W09, W00, W06, W12, W03); + R2(C, D, A, B, G, H, E, F, 0x29ea1e76, W10, W10 ^ W14); + W10 = EXPAND(W10, W01, W07, W13, W04); + R2(B, C, D, A, F, G, H, E, 0x53d43cec, W11, W11 ^ W15); + W11 = EXPAND(W11, W02, W08, W14, W05); + R2(A, B, C, D, E, F, G, H, 0xa7a879d8, W12, W12 ^ W00); + W12 = EXPAND(W12, W03, W09, W15, W06); + R2(D, A, B, C, H, E, F, G, 0x4f50f3b1, W13, W13 ^ W01); + W13 = EXPAND(W13, W04, W10, W00, W07); + R2(C, D, A, B, G, H, E, F, 0x9ea1e762, W14, W14 ^ W02); + W14 = EXPAND(W14, W05, W11, W01, W08); + R2(B, C, D, A, F, G, H, E, 0x3d43cec5, W15, W15 ^ W03); + W15 = EXPAND(W15, W06, W12, W02, W09); + R2(A, B, C, D, E, F, G, H, 0x7a879d8a, W00, W00 ^ W04); + W00 = EXPAND(W00, W07, W13, W03, W10); + R2(D, A, B, C, H, E, F, G, 0xf50f3b14, W01, W01 ^ W05); + W01 = EXPAND(W01, W08, W14, W04, W11); + R2(C, D, A, B, G, H, E, F, 0xea1e7629, W02, W02 ^ W06); + W02 = EXPAND(W02, W09, W15, W05, W12); + R2(B, C, D, A, F, G, H, E, 0xd43cec53, W03, W03 ^ W07); + W03 = EXPAND(W03, W10, W00, W06, W13); + R2(A, B, C, D, E, F, G, H, 0xa879d8a7, W04, W04 ^ W08); + W04 = EXPAND(W04, W11, W01, W07, W14); + R2(D, A, B, C, H, E, F, G, 0x50f3b14f, W05, W05 ^ W09); + W05 = EXPAND(W05, W12, W02, W08, W15); + R2(C, D, A, B, G, H, E, F, 0xa1e7629e, W06, W06 ^ W10); + W06 = EXPAND(W06, W13, W03, W09, W00); + R2(B, C, D, A, F, G, H, E, 0x43cec53d, W07, W07 ^ W11); + W07 = EXPAND(W07, W14, W04, W10, W01); + R2(A, B, C, D, E, F, G, H, 0x879d8a7a, W08, W08 ^ W12); + W08 = EXPAND(W08, W15, W05, W11, W02); + R2(D, A, B, C, H, E, F, G, 0x0f3b14f5, W09, W09 ^ W13); + W09 = EXPAND(W09, W00, W06, W12, W03); + R2(C, D, A, B, G, H, E, F, 0x1e7629ea, W10, W10 ^ W14); + W10 = EXPAND(W10, W01, W07, W13, W04); + R2(B, C, D, A, F, G, H, E, 0x3cec53d4, W11, W11 ^ W15); + W11 = EXPAND(W11, W02, W08, W14, W05); + R2(A, B, C, D, E, F, G, H, 0x79d8a7a8, W12, W12 ^ W00); + W12 = EXPAND(W12, W03, W09, W15, W06); + R2(D, A, B, C, H, E, F, G, 0xf3b14f50, W13, W13 ^ W01); + W13 = EXPAND(W13, W04, W10, W00, W07); + R2(C, D, A, B, G, H, E, F, 0xe7629ea1, W14, W14 ^ W02); + W14 = EXPAND(W14, W05, W11, W01, W08); + R2(B, C, D, A, F, G, H, E, 0xcec53d43, W15, W15 ^ W03); + W15 = EXPAND(W15, W06, W12, W02, W09); + R2(A, B, C, D, E, F, G, H, 0x9d8a7a87, W00, W00 ^ W04); + W00 = EXPAND(W00, W07, W13, W03, W10); + R2(D, A, B, C, H, E, F, G, 0x3b14f50f, W01, W01 ^ W05); + W01 = EXPAND(W01, W08, W14, W04, W11); + R2(C, D, A, B, G, H, E, F, 0x7629ea1e, W02, W02 ^ W06); + W02 = EXPAND(W02, W09, W15, W05, W12); + R2(B, C, D, A, F, G, H, E, 0xec53d43c, W03, W03 ^ W07); + W03 = EXPAND(W03, W10, W00, W06, W13); + R2(A, B, C, D, E, F, G, H, 0xd8a7a879, W04, W04 ^ W08); + R2(D, A, B, C, H, E, F, G, 0xb14f50f3, W05, W05 ^ W09); + R2(C, D, A, B, G, H, E, F, 0x629ea1e7, W06, W06 ^ W10); + R2(B, C, D, A, F, G, H, E, 0xc53d43ce, W07, W07 ^ W11); + R2(A, B, C, D, E, F, G, H, 0x8a7a879d, W08, W08 ^ W12); + R2(D, A, B, C, H, E, F, G, 0x14f50f3b, W09, W09 ^ W13); + R2(C, D, A, B, G, H, E, F, 0x29ea1e76, W10, W10 ^ W14); + R2(B, C, D, A, F, G, H, E, 0x53d43cec, W11, W11 ^ W15); + R2(A, B, C, D, E, F, G, H, 0xa7a879d8, W12, W12 ^ W00); + R2(D, A, B, C, H, E, F, G, 0x4f50f3b1, W13, W13 ^ W01); + R2(C, D, A, B, G, H, E, F, 0x9ea1e762, W14, W14 ^ W02); + R2(B, C, D, A, F, G, H, E, 0x3d43cec5, W15, W15 ^ W03); + + ctx->A ^= A; + ctx->B ^= B; + ctx->C ^= C; + ctx->D ^= D; + ctx->E ^= E; + ctx->F ^= F; + ctx->G ^= G; + ctx->H ^= H; + } +} + +#endif /* !OPENSSL_NO_SM3 */ diff --git a/crypto/sm3/sm3_locl.h b/crypto/sm3/sm3_locl.h new file mode 100644 index 00000000..6ecf8094 --- /dev/null +++ b/crypto/sm3/sm3_locl.h @@ -0,0 +1,85 @@ +/* $OpenBSD: sm3_locl.h,v 1.1 2018/11/11 06:53:31 tb Exp $ */ +/* + * Copyright (c) 2018, Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#include + +#define DATA_ORDER_IS_BIG_ENDIAN + +#define HASH_LONG SM3_WORD +#define HASH_CTX SM3_CTX +#define HASH_CBLOCK SM3_CBLOCK +#define HASH_UPDATE SM3_Update +#define HASH_TRANSFORM SM3_Transform +#define HASH_FINAL SM3_Final +#define HASH_MAKE_STRING(c, s) do { \ + unsigned long ll; \ + ll = (c)->A; HOST_l2c(ll, (s)); \ + ll = (c)->B; HOST_l2c(ll, (s)); \ + ll = (c)->C; HOST_l2c(ll, (s)); \ + ll = (c)->D; HOST_l2c(ll, (s)); \ + ll = (c)->E; HOST_l2c(ll, (s)); \ + ll = (c)->F; HOST_l2c(ll, (s)); \ + ll = (c)->G; HOST_l2c(ll, (s)); \ + ll = (c)->H; HOST_l2c(ll, (s)); \ +} while (0) +#define HASH_BLOCK_DATA_ORDER SM3_block_data_order + +void SM3_block_data_order(SM3_CTX *c, const void *p, size_t num); +void SM3_transform(SM3_CTX *c, const unsigned char *data); + +#include "md32_common.h" + +#define P0(X) (X ^ ROTATE(X, 9) ^ ROTATE(X, 17)) +#define P1(X) (X ^ ROTATE(X, 15) ^ ROTATE(X, 23)) + +#define FF0(X, Y, Z) (X ^ Y ^ Z) +#define GG0(X, Y, Z) (X ^ Y ^ Z) + +#define FF1(X, Y, Z) ((X & Y) | ((X | Y) & Z)) +#define GG1(X, Y, Z) ((Z ^ (X & (Y ^ Z)))) + +#define EXPAND(W0, W7, W13, W3, W10) \ + (P1(W0 ^ W7 ^ ROTATE(W13, 15)) ^ ROTATE(W3, 7) ^ W10) + +#define ROUND(A, B, C, D, E, F, G, H, TJ, Wi, Wj, FF, GG) do { \ + const SM3_WORD A12 = ROTATE(A, 12); \ + const SM3_WORD A12_SM = A12 + E + TJ; \ + const SM3_WORD SS1 = ROTATE(A12_SM, 7); \ + const SM3_WORD TT1 = FF(A, B, C) + D + (SS1 ^ A12) + (Wj); \ + const SM3_WORD TT2 = GG(E, F, G) + H + SS1 + Wi; \ + B = ROTATE(B, 9); \ + D = TT1; \ + F = ROTATE(F, 19); \ + H = P0(TT2); \ +} while(0) + +#define R1(A, B, C, D, E, F, G, H, TJ, Wi, Wj) \ + ROUND(A, B, C, D, E, F, G, H, TJ, Wi, Wj, FF0, GG0) + +#define R2(A, B, C, D, E, F, G, H, TJ, Wi, Wj) \ + ROUND(A, B, C, D, E, F, G, H, TJ, Wi, Wj, FF1, GG1) + +#define SM3_A 0x7380166fUL +#define SM3_B 0x4914b2b9UL +#define SM3_C 0x172442d7UL +#define SM3_D 0xda8a0600UL +#define SM3_E 0xa96f30bcUL +#define SM3_F 0x163138aaUL +#define SM3_G 0xe38dee4dUL +#define SM3_H 0xb0fb0e4eUL diff --git a/crypto/sm4/sm4.c b/crypto/sm4/sm4.c new file mode 100644 index 00000000..009c780f --- /dev/null +++ b/crypto/sm4/sm4.c @@ -0,0 +1,263 @@ +/* $OpenBSD: sm4.c,v 1.1 2019/03/17 17:42:37 tb Exp $ */ +/* + * Copyright (c) 2017, 2019 Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#ifndef OPENSSL_NO_SM4 +#include + +struct sm4_key { + uint32_t rk[SM4_KEY_SCHEDULE]; +}; + +static const uint8_t SM4_S[256] = { + 0xD6, 0x90, 0xE9, 0xFE, 0xCC, 0xE1, 0x3D, 0xB7, 0x16, 0xB6, 0x14, 0xC2, + 0x28, 0xFB, 0x2C, 0x05, 0x2B, 0x67, 0x9A, 0x76, 0x2A, 0xBE, 0x04, 0xC3, + 0xAA, 0x44, 0x13, 0x26, 0x49, 0x86, 0x06, 0x99, 0x9C, 0x42, 0x50, 0xF4, + 0x91, 0xEF, 0x98, 0x7A, 0x33, 0x54, 0x0B, 0x43, 0xED, 0xCF, 0xAC, 0x62, + 0xE4, 0xB3, 0x1C, 0xA9, 0xC9, 0x08, 0xE8, 0x95, 0x80, 0xDF, 0x94, 0xFA, + 0x75, 0x8F, 0x3F, 0xA6, 0x47, 0x07, 0xA7, 0xFC, 0xF3, 0x73, 0x17, 0xBA, + 0x83, 0x59, 0x3C, 0x19, 0xE6, 0x85, 0x4F, 0xA8, 0x68, 0x6B, 0x81, 0xB2, + 0x71, 0x64, 0xDA, 0x8B, 0xF8, 0xEB, 0x0F, 0x4B, 0x70, 0x56, 0x9D, 0x35, + 0x1E, 0x24, 0x0E, 0x5E, 0x63, 0x58, 0xD1, 0xA2, 0x25, 0x22, 0x7C, 0x3B, + 0x01, 0x21, 0x78, 0x87, 0xD4, 0x00, 0x46, 0x57, 0x9F, 0xD3, 0x27, 0x52, + 0x4C, 0x36, 0x02, 0xE7, 0xA0, 0xC4, 0xC8, 0x9E, 0xEA, 0xBF, 0x8A, 0xD2, + 0x40, 0xC7, 0x38, 0xB5, 0xA3, 0xF7, 0xF2, 0xCE, 0xF9, 0x61, 0x15, 0xA1, + 0xE0, 0xAE, 0x5D, 0xA4, 0x9B, 0x34, 0x1A, 0x55, 0xAD, 0x93, 0x32, 0x30, + 0xF5, 0x8C, 0xB1, 0xE3, 0x1D, 0xF6, 0xE2, 0x2E, 0x82, 0x66, 0xCA, 0x60, + 0xC0, 0x29, 0x23, 0xAB, 0x0D, 0x53, 0x4E, 0x6F, 0xD5, 0xDB, 0x37, 0x45, + 0xDE, 0xFD, 0x8E, 0x2F, 0x03, 0xFF, 0x6A, 0x72, 0x6D, 0x6C, 0x5B, 0x51, + 0x8D, 0x1B, 0xAF, 0x92, 0xBB, 0xDD, 0xBC, 0x7F, 0x11, 0xD9, 0x5C, 0x41, + 0x1F, 0x10, 0x5A, 0xD8, 0x0A, 0xC1, 0x31, 0x88, 0xA5, 0xCD, 0x7B, 0xBD, + 0x2D, 0x74, 0xD0, 0x12, 0xB8, 0xE5, 0xB4, 0xB0, 0x89, 0x69, 0x97, 0x4A, + 0x0C, 0x96, 0x77, 0x7E, 0x65, 0xB9, 0xF1, 0x09, 0xC5, 0x6E, 0xC6, 0x84, + 0x18, 0xF0, 0x7D, 0xEC, 0x3A, 0xDC, 0x4D, 0x20, 0x79, 0xEE, 0x5F, 0x3E, + 0xD7, 0xCB, 0x39, 0x48, +}; + +/* + * SM4_SBOX_T[j] == L(SM4_SBOX[j]). + */ +static const uint32_t SM4_SBOX_T[256] = { + 0x8ED55B5B, 0xD0924242, 0x4DEAA7A7, 0x06FDFBFB, 0xFCCF3333, 0x65E28787, + 0xC93DF4F4, 0x6BB5DEDE, 0x4E165858, 0x6EB4DADA, 0x44145050, 0xCAC10B0B, + 0x8828A0A0, 0x17F8EFEF, 0x9C2CB0B0, 0x11051414, 0x872BACAC, 0xFB669D9D, + 0xF2986A6A, 0xAE77D9D9, 0x822AA8A8, 0x46BCFAFA, 0x14041010, 0xCFC00F0F, + 0x02A8AAAA, 0x54451111, 0x5F134C4C, 0xBE269898, 0x6D482525, 0x9E841A1A, + 0x1E061818, 0xFD9B6666, 0xEC9E7272, 0x4A430909, 0x10514141, 0x24F7D3D3, + 0xD5934646, 0x53ECBFBF, 0xF89A6262, 0x927BE9E9, 0xFF33CCCC, 0x04555151, + 0x270B2C2C, 0x4F420D0D, 0x59EEB7B7, 0xF3CC3F3F, 0x1CAEB2B2, 0xEA638989, + 0x74E79393, 0x7FB1CECE, 0x6C1C7070, 0x0DABA6A6, 0xEDCA2727, 0x28082020, + 0x48EBA3A3, 0xC1975656, 0x80820202, 0xA3DC7F7F, 0xC4965252, 0x12F9EBEB, + 0xA174D5D5, 0xB38D3E3E, 0xC33FFCFC, 0x3EA49A9A, 0x5B461D1D, 0x1B071C1C, + 0x3BA59E9E, 0x0CFFF3F3, 0x3FF0CFCF, 0xBF72CDCD, 0x4B175C5C, 0x52B8EAEA, + 0x8F810E0E, 0x3D586565, 0xCC3CF0F0, 0x7D196464, 0x7EE59B9B, 0x91871616, + 0x734E3D3D, 0x08AAA2A2, 0xC869A1A1, 0xC76AADAD, 0x85830606, 0x7AB0CACA, + 0xB570C5C5, 0xF4659191, 0xB2D96B6B, 0xA7892E2E, 0x18FBE3E3, 0x47E8AFAF, + 0x330F3C3C, 0x674A2D2D, 0xB071C1C1, 0x0E575959, 0xE99F7676, 0xE135D4D4, + 0x661E7878, 0xB4249090, 0x360E3838, 0x265F7979, 0xEF628D8D, 0x38596161, + 0x95D24747, 0x2AA08A8A, 0xB1259494, 0xAA228888, 0x8C7DF1F1, 0xD73BECEC, + 0x05010404, 0xA5218484, 0x9879E1E1, 0x9B851E1E, 0x84D75353, 0x00000000, + 0x5E471919, 0x0B565D5D, 0xE39D7E7E, 0x9FD04F4F, 0xBB279C9C, 0x1A534949, + 0x7C4D3131, 0xEE36D8D8, 0x0A020808, 0x7BE49F9F, 0x20A28282, 0xD4C71313, + 0xE8CB2323, 0xE69C7A7A, 0x42E9ABAB, 0x43BDFEFE, 0xA2882A2A, 0x9AD14B4B, + 0x40410101, 0xDBC41F1F, 0xD838E0E0, 0x61B7D6D6, 0x2FA18E8E, 0x2BF4DFDF, + 0x3AF1CBCB, 0xF6CD3B3B, 0x1DFAE7E7, 0xE5608585, 0x41155454, 0x25A38686, + 0x60E38383, 0x16ACBABA, 0x295C7575, 0x34A69292, 0xF7996E6E, 0xE434D0D0, + 0x721A6868, 0x01545555, 0x19AFB6B6, 0xDF914E4E, 0xFA32C8C8, 0xF030C0C0, + 0x21F6D7D7, 0xBC8E3232, 0x75B3C6C6, 0x6FE08F8F, 0x691D7474, 0x2EF5DBDB, + 0x6AE18B8B, 0x962EB8B8, 0x8A800A0A, 0xFE679999, 0xE2C92B2B, 0xE0618181, + 0xC0C30303, 0x8D29A4A4, 0xAF238C8C, 0x07A9AEAE, 0x390D3434, 0x1F524D4D, + 0x764F3939, 0xD36EBDBD, 0x81D65757, 0xB7D86F6F, 0xEB37DCDC, 0x51441515, + 0xA6DD7B7B, 0x09FEF7F7, 0xB68C3A3A, 0x932FBCBC, 0x0F030C0C, 0x03FCFFFF, + 0xC26BA9A9, 0xBA73C9C9, 0xD96CB5B5, 0xDC6DB1B1, 0x375A6D6D, 0x15504545, + 0xB98F3636, 0x771B6C6C, 0x13ADBEBE, 0xDA904A4A, 0x57B9EEEE, 0xA9DE7777, + 0x4CBEF2F2, 0x837EFDFD, 0x55114444, 0xBDDA6767, 0x2C5D7171, 0x45400505, + 0x631F7C7C, 0x50104040, 0x325B6969, 0xB8DB6363, 0x220A2828, 0xC5C20707, + 0xF531C4C4, 0xA88A2222, 0x31A79696, 0xF9CE3737, 0x977AEDED, 0x49BFF6F6, + 0x992DB4B4, 0xA475D1D1, 0x90D34343, 0x5A124848, 0x58BAE2E2, 0x71E69797, + 0x64B6D2D2, 0x70B2C2C2, 0xAD8B2626, 0xCD68A5A5, 0xCB955E5E, 0x624B2929, + 0x3C0C3030, 0xCE945A5A, 0xAB76DDDD, 0x867FF9F9, 0xF1649595, 0x5DBBE6E6, + 0x35F2C7C7, 0x2D092424, 0xD1C61717, 0xD66FB9B9, 0xDEC51B1B, 0x94861212, + 0x78186060, 0x30F3C3C3, 0x897CF5F5, 0x5CEFB3B3, 0xD23AE8E8, 0xACDF7373, + 0x794C3535, 0xA0208080, 0x9D78E5E5, 0x56EDBBBB, 0x235E7D7D, 0xC63EF8F8, + 0x8BD45F5F, 0xE7C82F2F, 0xDD39E4E4, 0x68492121, +}; + +static inline uint32_t +rotl(uint32_t a, uint8_t n) +{ + return (a << n) | (a >> (32 - n)); +} + +static inline uint32_t +load_u32_be(const uint8_t *b, uint32_t n) +{ + return ((uint32_t)b[4 * n] << 24) | + ((uint32_t)b[4 * n + 1] << 16) | + ((uint32_t)b[4 * n + 2] << 8) | + ((uint32_t)b[4 * n + 3]); +} + +static inline void +store_u32_be(uint32_t v, uint8_t *b) +{ + b[0] = (uint8_t)(v >> 24); + b[1] = (uint8_t)(v >> 16); + b[2] = (uint8_t)(v >> 8); + b[3] = (uint8_t)(v); +} + +static inline uint32_t +SM4_T_slow(uint32_t X) +{ + uint32_t t = 0; + + t |= ((uint32_t)SM4_S[(uint8_t)(X >> 24)]) << 24; + t |= ((uint32_t)SM4_S[(uint8_t)(X >> 16)]) << 16; + t |= ((uint32_t)SM4_S[(uint8_t)(X >> 8)]) << 8; + t |= SM4_S[(uint8_t)X]; + + /* + * L linear transform + */ + return t ^ rotl(t, 2) ^ rotl(t, 10) ^ rotl(t, 18) ^ rotl(t, 24); +} + +static inline uint32_t +SM4_T(uint32_t X) +{ + return SM4_SBOX_T[(uint8_t)(X >> 24)] ^ + rotl(SM4_SBOX_T[(uint8_t)(X >> 16)], 24) ^ + rotl(SM4_SBOX_T[(uint8_t)(X >> 8)], 16) ^ + rotl(SM4_SBOX_T[(uint8_t)X], 8); +} + +int +SM4_set_key(const uint8_t *key, SM4_KEY *k) +{ + struct sm4_key *ks = (struct sm4_key *)k; + + /* + * Family Key + */ + static const uint32_t FK[4] = { + 0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc, + }; + + /* + * Constant Key + */ + static const uint32_t CK[32] = { + 0x00070E15, 0x1C232A31, 0x383F464D, 0x545B6269, + 0x70777E85, 0x8C939AA1, 0xA8AFB6BD, 0xC4CBD2D9, + 0xE0E7EEF5, 0xFC030A11, 0x181F262D, 0x343B4249, + 0x50575E65, 0x6C737A81, 0x888F969D, 0xA4ABB2B9, + 0xC0C7CED5, 0xDCE3EAF1, 0xF8FF060D, 0x141B2229, + 0x30373E45, 0x4C535A61, 0x686F767D, 0x848B9299, + 0xA0A7AEB5, 0xBCC3CAD1, 0xD8DFE6ED, 0xF4FB0209, + 0x10171E25, 0x2C333A41, 0x484F565D, 0x646B7279, + }; + + uint32_t K[4]; + int i; + + K[0] = load_u32_be(key, 0) ^ FK[0]; + K[1] = load_u32_be(key, 1) ^ FK[1]; + K[2] = load_u32_be(key, 2) ^ FK[2]; + K[3] = load_u32_be(key, 3) ^ FK[3]; + + for (i = 0; i < SM4_KEY_SCHEDULE; i++) { + uint32_t X; + uint32_t t = 0; + + X = K[(i + 1) % 4] ^ K[(i + 2) % 4] ^ K[(i + 3) % 4] ^ CK[i]; + + t |= ((uint32_t)SM4_S[(uint8_t)(X >> 24)]) << 24; + t |= ((uint32_t)SM4_S[(uint8_t)(X >> 16)]) << 16; + t |= ((uint32_t)SM4_S[(uint8_t)(X >> 8)]) << 8; + t |= SM4_S[(uint8_t)X]; + + t = t ^ rotl(t, 13) ^ rotl(t, 23); + K[i % 4] ^= t; + ks->rk[i] = K[i % 4]; + } + + return 1; +} + +#define SM4_ROUNDS(k0, k1, k2, k3, F) \ + do { \ + B0 ^= F(B1 ^ B2 ^ B3 ^ ks->rk[k0]); \ + B1 ^= F(B0 ^ B2 ^ B3 ^ ks->rk[k1]); \ + B2 ^= F(B0 ^ B1 ^ B3 ^ ks->rk[k2]); \ + B3 ^= F(B0 ^ B1 ^ B2 ^ ks->rk[k3]); \ + } while(0) + +void +SM4_encrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *k) +{ + struct sm4_key *ks = (struct sm4_key *)k; + uint32_t B0 = load_u32_be(in, 0); + uint32_t B1 = load_u32_be(in, 1); + uint32_t B2 = load_u32_be(in, 2); + uint32_t B3 = load_u32_be(in, 3); + + /* + * Uses byte-wise sbox in the first and last rounds to provide some + * protection from cache based side channels. + */ + SM4_ROUNDS( 0, 1, 2, 3, SM4_T_slow); + SM4_ROUNDS( 4, 5, 6, 7, SM4_T); + SM4_ROUNDS( 8, 9, 10, 11, SM4_T); + SM4_ROUNDS(12, 13, 14, 15, SM4_T); + SM4_ROUNDS(16, 17, 18, 19, SM4_T); + SM4_ROUNDS(20, 21, 22, 23, SM4_T); + SM4_ROUNDS(24, 25, 26, 27, SM4_T); + SM4_ROUNDS(28, 29, 30, 31, SM4_T_slow); + + store_u32_be(B3, out); + store_u32_be(B2, out + 4); + store_u32_be(B1, out + 8); + store_u32_be(B0, out + 12); +} + +void +SM4_decrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *k) +{ + struct sm4_key *ks = (struct sm4_key *)k; + uint32_t B0 = load_u32_be(in, 0); + uint32_t B1 = load_u32_be(in, 1); + uint32_t B2 = load_u32_be(in, 2); + uint32_t B3 = load_u32_be(in, 3); + + SM4_ROUNDS(31, 30, 29, 28, SM4_T_slow); + SM4_ROUNDS(27, 26, 25, 24, SM4_T); + SM4_ROUNDS(23, 22, 21, 20, SM4_T); + SM4_ROUNDS(19, 18, 17, 16, SM4_T); + SM4_ROUNDS(15, 14, 13, 12, SM4_T); + SM4_ROUNDS(11, 10, 9, 8, SM4_T); + SM4_ROUNDS( 7, 6, 5, 4, SM4_T); + SM4_ROUNDS( 3, 2, 1, 0, SM4_T_slow); + + store_u32_be(B3, out); + store_u32_be(B2, out + 4); + store_u32_be(B1, out + 8); + store_u32_be(B0, out + 12); +} + +#endif /* OPENSSL_NO_SM4 */ diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c index d941f9e6..b76a0d72 100644 --- a/crypto/stack/stack.c +++ b/crypto/stack/stack.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stack.c,v 1.19 2015/02/07 13:19:15 doug Exp $ */ +/* $OpenBSD: stack.c,v 1.20 2018/04/01 00:36:28 schwarze Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -312,6 +312,7 @@ sk_set(_STACK *st, int i, void *value) { if (!st || (i < 0) || (i >= st->num)) return NULL; + st->sorted = 0; return (st->data[i] = value); } diff --git a/crypto/ts/ts_conf.c b/crypto/ts/ts_conf.c index c223aa3d..41d185ee 100644 --- a/crypto/ts/ts_conf.c +++ b/crypto/ts/ts_conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts_conf.c,v 1.10 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ts_conf.c,v 1.11 2018/04/14 07:18:37 tb Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ @@ -248,8 +248,7 @@ TS_CONF_set_default_engine(const char *name) TSerror(TS_R_COULD_NOT_SET_ENGINE); ERR_asprintf_error_data("engine:%s", name); } - if (e) - ENGINE_free(e); + ENGINE_free(e); return ret; } diff --git a/crypto/ts/ts_req_utils.c b/crypto/ts/ts_req_utils.c index bd707c22..6b9c13f3 100644 --- a/crypto/ts/ts_req_utils.c +++ b/crypto/ts/ts_req_utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts_req_utils.c,v 1.5 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ts_req_utils.c,v 1.6 2018/05/13 15:04:05 tb Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ @@ -134,7 +134,7 @@ TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a) } int -TS_REQ_set_policy_id(TS_REQ *a, ASN1_OBJECT *policy) +TS_REQ_set_policy_id(TS_REQ *a, const ASN1_OBJECT *policy) { ASN1_OBJECT *new_policy; @@ -219,7 +219,7 @@ TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos) } int -TS_REQ_get_ext_by_OBJ(TS_REQ *a, ASN1_OBJECT *obj, int lastpos) +TS_REQ_get_ext_by_OBJ(TS_REQ *a, const ASN1_OBJECT *obj, int lastpos) { return X509v3_get_ext_by_OBJ(a->extensions, obj, lastpos); } diff --git a/crypto/ts/ts_rsp_sign.c b/crypto/ts/ts_rsp_sign.c index 57e2d7f3..9ab80160 100644 --- a/crypto/ts/ts_rsp_sign.c +++ b/crypto/ts/ts_rsp_sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts_rsp_sign.c,v 1.21 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ts_rsp_sign.c,v 1.22 2018/05/13 15:04:05 tb Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ @@ -201,7 +201,7 @@ TS_RESP_CTX_set_signer_key(TS_RESP_CTX *ctx, EVP_PKEY *key) } int -TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *def_policy) +TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *def_policy) { if (ctx->default_policy) ASN1_OBJECT_free(ctx->default_policy); @@ -238,7 +238,7 @@ TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs) } int -TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *policy) +TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *policy) { ASN1_OBJECT *copy = NULL; diff --git a/crypto/ts/ts_rsp_utils.c b/crypto/ts/ts_rsp_utils.c index 5638331d..233df867 100644 --- a/crypto/ts/ts_rsp_utils.c +++ b/crypto/ts/ts_rsp_utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts_rsp_utils.c,v 1.6 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ts_rsp_utils.c,v 1.7 2018/05/13 15:35:46 tb Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ @@ -398,7 +398,7 @@ TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos) } int -TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, ASN1_OBJECT *obj, int lastpos) +TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, const ASN1_OBJECT *obj, int lastpos) { return X509v3_get_ext_by_OBJ(a->extensions, obj, lastpos); } diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c index e5510307..06b29b8c 100644 --- a/crypto/ui/ui_lib.c +++ b/crypto/ui/ui_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ui_lib.c,v 1.32 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ui_lib.c,v 1.34 2018/06/02 04:45:21 tb Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2001. */ @@ -582,7 +582,7 @@ UI_set_method(UI *ui, const UI_METHOD *meth) UI_METHOD * -UI_create_method(char *name) +UI_create_method(const char *name) { UI_METHOD *ui_method = calloc(1, sizeof(UI_METHOD)); @@ -666,7 +666,7 @@ UI_method_set_prompt_constructor(UI_METHOD *method, } int -(*UI_method_get_opener(UI_METHOD * method))(UI *) +(*UI_method_get_opener(const UI_METHOD * method))(UI *) { if (method) return method->ui_open_session; @@ -675,7 +675,7 @@ int } int -(*UI_method_get_writer(UI_METHOD *method))(UI *, UI_STRING *) +(*UI_method_get_writer(const UI_METHOD *method))(UI *, UI_STRING *) { if (method) return method->ui_write_string; @@ -684,7 +684,7 @@ int } int -(*UI_method_get_flusher(UI_METHOD *method)) (UI *) +(*UI_method_get_flusher(const UI_METHOD *method)) (UI *) { if (method) return method->ui_flush; @@ -693,7 +693,7 @@ int } int -(*UI_method_get_reader(UI_METHOD *method))(UI *, UI_STRING *) +(*UI_method_get_reader(const UI_METHOD *method))(UI *, UI_STRING *) { if (method) return method->ui_read_string; @@ -702,7 +702,7 @@ int } int -(*UI_method_get_closer(UI_METHOD *method))(UI *) +(*UI_method_get_closer(const UI_METHOD *method))(UI *) { if (method) return method->ui_close_session; @@ -711,7 +711,7 @@ int } char * -(*UI_method_get_prompt_constructor(UI_METHOD *method))(UI *, const char *, +(*UI_method_get_prompt_constructor(const UI_METHOD *method))(UI *, const char *, const char *) { if (method) diff --git a/crypto/whrlpool/wp-elf-x86_64.S b/crypto/whrlpool/wp-elf-x86_64.S index 5c1ad955..2b37a988 100644 --- a/crypto/whrlpool/wp-elf-x86_64.S +++ b/crypto/whrlpool/wp-elf-x86_64.S @@ -585,7 +585,7 @@ whirlpool_block: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp .Lepilogue: - .byte 0xf3,0xc3 + retq .size whirlpool_block,.-whirlpool_block .align 64 diff --git a/crypto/whrlpool/wp-macosx-x86_64.S b/crypto/whrlpool/wp-macosx-x86_64.S index f0025d41..6df325ad 100644 --- a/crypto/whrlpool/wp-macosx-x86_64.S +++ b/crypto/whrlpool/wp-macosx-x86_64.S @@ -585,7 +585,7 @@ L$alldone: movq 40(%rsi),%rbx leaq 48(%rsi),%rsp L$epilogue: - .byte 0xf3,0xc3 + retq .p2align 6 diff --git a/crypto/whrlpool/wp-masm-x86_64.S b/crypto/whrlpool/wp-masm-x86_64.S new file mode 100644 index 00000000..5f1028e3 --- /dev/null +++ b/crypto/whrlpool/wp-masm-x86_64.S @@ -0,0 +1,875 @@ +OPTION DOTNAME +#include "x86_arch.h" +.text$ SEGMENT ALIGN(64) 'CODE' + +PUBLIC whirlpool_block + +ALIGN 16 +whirlpool_block PROC PUBLIC + mov QWORD PTR[8+rsp],rdi ;WIN64 prologue + mov QWORD PTR[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_whirlpool_block:: + mov rdi,rcx + mov rsi,rdx + mov rdx,r8 + + + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + + mov r11,rsp + sub rsp,128+40 + and rsp,-64 + + lea r10,QWORD PTR[128+rsp] + mov QWORD PTR[r10],rdi + mov QWORD PTR[8+r10],rsi + mov QWORD PTR[16+r10],rdx + mov QWORD PTR[32+r10],r11 +$L$prologue:: + + mov rbx,r10 + lea rbp,QWORD PTR[$L$table] + + xor rcx,rcx + xor rdx,rdx + mov r8,QWORD PTR[rdi] + mov r9,QWORD PTR[8+rdi] + mov r10,QWORD PTR[16+rdi] + mov r11,QWORD PTR[24+rdi] + mov r12,QWORD PTR[32+rdi] + mov r13,QWORD PTR[40+rdi] + mov r14,QWORD PTR[48+rdi] + mov r15,QWORD PTR[56+rdi] +$L$outerloop:: + mov QWORD PTR[rsp],r8 + mov QWORD PTR[8+rsp],r9 + mov QWORD PTR[16+rsp],r10 + mov QWORD PTR[24+rsp],r11 + mov QWORD PTR[32+rsp],r12 + mov QWORD PTR[40+rsp],r13 + mov QWORD PTR[48+rsp],r14 + mov QWORD PTR[56+rsp],r15 + xor r8,QWORD PTR[rsi] + xor r9,QWORD PTR[8+rsi] + xor r10,QWORD PTR[16+rsi] + xor r11,QWORD PTR[24+rsi] + xor r12,QWORD PTR[32+rsi] + xor r13,QWORD PTR[40+rsi] + xor r14,QWORD PTR[48+rsi] + xor r15,QWORD PTR[56+rsi] + mov QWORD PTR[((64+0))+rsp],r8 + mov QWORD PTR[((64+8))+rsp],r9 + mov QWORD PTR[((64+16))+rsp],r10 + mov QWORD PTR[((64+24))+rsp],r11 + mov QWORD PTR[((64+32))+rsp],r12 + mov QWORD PTR[((64+40))+rsp],r13 + mov QWORD PTR[((64+48))+rsp],r14 + mov QWORD PTR[((64+56))+rsp],r15 + xor rsi,rsi + mov QWORD PTR[24+rbx],rsi +ALIGN 16 +$L$round:: + mov r8,QWORD PTR[4096+rsi*8+rbp] + mov eax,DWORD PTR[rsp] + mov ebx,DWORD PTR[4+rsp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r8,QWORD PTR[rsi*8+rbp] + mov r9,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((0+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + mov r10,QWORD PTR[6+rsi*8+rbp] + mov r11,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + mov r12,QWORD PTR[4+rsi*8+rbp] + mov r13,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((0+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + mov r14,QWORD PTR[2+rsi*8+rbp] + mov r15,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r9,QWORD PTR[rsi*8+rbp] + xor r10,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((8+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r11,QWORD PTR[6+rsi*8+rbp] + xor r12,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r13,QWORD PTR[4+rsi*8+rbp] + xor r14,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((8+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r15,QWORD PTR[2+rsi*8+rbp] + xor r8,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r10,QWORD PTR[rsi*8+rbp] + xor r11,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((16+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r12,QWORD PTR[6+rsi*8+rbp] + xor r13,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r14,QWORD PTR[4+rsi*8+rbp] + xor r15,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((16+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r8,QWORD PTR[2+rsi*8+rbp] + xor r9,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r11,QWORD PTR[rsi*8+rbp] + xor r12,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((24+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r13,QWORD PTR[6+rsi*8+rbp] + xor r14,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r15,QWORD PTR[4+rsi*8+rbp] + xor r8,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((24+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r9,QWORD PTR[2+rsi*8+rbp] + xor r10,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r12,QWORD PTR[rsi*8+rbp] + xor r13,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((32+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r14,QWORD PTR[6+rsi*8+rbp] + xor r15,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r8,QWORD PTR[4+rsi*8+rbp] + xor r9,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((32+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r10,QWORD PTR[2+rsi*8+rbp] + xor r11,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r13,QWORD PTR[rsi*8+rbp] + xor r14,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((40+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r15,QWORD PTR[6+rsi*8+rbp] + xor r8,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r9,QWORD PTR[4+rsi*8+rbp] + xor r10,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((40+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r11,QWORD PTR[2+rsi*8+rbp] + xor r12,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r14,QWORD PTR[rsi*8+rbp] + xor r15,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((48+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r8,QWORD PTR[6+rsi*8+rbp] + xor r9,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r10,QWORD PTR[4+rsi*8+rbp] + xor r11,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((48+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r12,QWORD PTR[2+rsi*8+rbp] + xor r13,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r15,QWORD PTR[rsi*8+rbp] + xor r8,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((56+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r9,QWORD PTR[6+rsi*8+rbp] + xor r10,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r11,QWORD PTR[4+rsi*8+rbp] + xor r12,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((56+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r13,QWORD PTR[2+rsi*8+rbp] + xor r14,QWORD PTR[1+rdi*8+rbp] + mov QWORD PTR[rsp],r8 + mov QWORD PTR[8+rsp],r9 + mov QWORD PTR[16+rsp],r10 + mov QWORD PTR[24+rsp],r11 + mov QWORD PTR[32+rsp],r12 + mov QWORD PTR[40+rsp],r13 + mov QWORD PTR[48+rsp],r14 + mov QWORD PTR[56+rsp],r15 + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r8,QWORD PTR[rsi*8+rbp] + xor r9,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((64+0+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r10,QWORD PTR[6+rsi*8+rbp] + xor r11,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r12,QWORD PTR[4+rsi*8+rbp] + xor r13,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((64+0+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r14,QWORD PTR[2+rsi*8+rbp] + xor r15,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r9,QWORD PTR[rsi*8+rbp] + xor r10,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((64+8+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r11,QWORD PTR[6+rsi*8+rbp] + xor r12,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r13,QWORD PTR[4+rsi*8+rbp] + xor r14,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((64+8+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r15,QWORD PTR[2+rsi*8+rbp] + xor r8,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r10,QWORD PTR[rsi*8+rbp] + xor r11,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((64+16+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r12,QWORD PTR[6+rsi*8+rbp] + xor r13,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r14,QWORD PTR[4+rsi*8+rbp] + xor r15,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((64+16+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r8,QWORD PTR[2+rsi*8+rbp] + xor r9,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r11,QWORD PTR[rsi*8+rbp] + xor r12,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((64+24+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r13,QWORD PTR[6+rsi*8+rbp] + xor r14,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r15,QWORD PTR[4+rsi*8+rbp] + xor r8,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((64+24+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r9,QWORD PTR[2+rsi*8+rbp] + xor r10,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r12,QWORD PTR[rsi*8+rbp] + xor r13,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((64+32+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r14,QWORD PTR[6+rsi*8+rbp] + xor r15,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r8,QWORD PTR[4+rsi*8+rbp] + xor r9,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((64+32+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r10,QWORD PTR[2+rsi*8+rbp] + xor r11,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r13,QWORD PTR[rsi*8+rbp] + xor r14,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((64+40+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r15,QWORD PTR[6+rsi*8+rbp] + xor r8,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r9,QWORD PTR[4+rsi*8+rbp] + xor r10,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((64+40+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r11,QWORD PTR[2+rsi*8+rbp] + xor r12,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r14,QWORD PTR[rsi*8+rbp] + xor r15,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + mov eax,DWORD PTR[((64+48+8))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r8,QWORD PTR[6+rsi*8+rbp] + xor r9,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r10,QWORD PTR[4+rsi*8+rbp] + xor r11,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + mov ebx,DWORD PTR[((64+48+8+4))+rsp] + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r12,QWORD PTR[2+rsi*8+rbp] + xor r13,QWORD PTR[1+rdi*8+rbp] + mov cl,al + mov dl,ah + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr eax,16 + xor r15,QWORD PTR[rsi*8+rbp] + xor r8,QWORD PTR[7+rdi*8+rbp] + mov cl,al + mov dl,ah + + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r9,QWORD PTR[6+rsi*8+rbp] + xor r10,QWORD PTR[5+rdi*8+rbp] + mov cl,bl + mov dl,bh + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + shr ebx,16 + xor r11,QWORD PTR[4+rsi*8+rbp] + xor r12,QWORD PTR[3+rdi*8+rbp] + mov cl,bl + mov dl,bh + + lea rsi,QWORD PTR[rcx*1+rcx] + lea rdi,QWORD PTR[rdx*1+rdx] + xor r13,QWORD PTR[2+rsi*8+rbp] + xor r14,QWORD PTR[1+rdi*8+rbp] + lea rbx,QWORD PTR[128+rsp] + mov rsi,QWORD PTR[24+rbx] + add rsi,1 + cmp rsi,10 + je $L$roundsdone + + mov QWORD PTR[24+rbx],rsi + mov QWORD PTR[((64+0))+rsp],r8 + mov QWORD PTR[((64+8))+rsp],r9 + mov QWORD PTR[((64+16))+rsp],r10 + mov QWORD PTR[((64+24))+rsp],r11 + mov QWORD PTR[((64+32))+rsp],r12 + mov QWORD PTR[((64+40))+rsp],r13 + mov QWORD PTR[((64+48))+rsp],r14 + mov QWORD PTR[((64+56))+rsp],r15 + jmp $L$round +ALIGN 16 +$L$roundsdone:: + mov rdi,QWORD PTR[rbx] + mov rsi,QWORD PTR[8+rbx] + mov rax,QWORD PTR[16+rbx] + xor r8,QWORD PTR[rsi] + xor r9,QWORD PTR[8+rsi] + xor r10,QWORD PTR[16+rsi] + xor r11,QWORD PTR[24+rsi] + xor r12,QWORD PTR[32+rsi] + xor r13,QWORD PTR[40+rsi] + xor r14,QWORD PTR[48+rsi] + xor r15,QWORD PTR[56+rsi] + xor r8,QWORD PTR[rdi] + xor r9,QWORD PTR[8+rdi] + xor r10,QWORD PTR[16+rdi] + xor r11,QWORD PTR[24+rdi] + xor r12,QWORD PTR[32+rdi] + xor r13,QWORD PTR[40+rdi] + xor r14,QWORD PTR[48+rdi] + xor r15,QWORD PTR[56+rdi] + mov QWORD PTR[rdi],r8 + mov QWORD PTR[8+rdi],r9 + mov QWORD PTR[16+rdi],r10 + mov QWORD PTR[24+rdi],r11 + mov QWORD PTR[32+rdi],r12 + mov QWORD PTR[40+rdi],r13 + mov QWORD PTR[48+rdi],r14 + mov QWORD PTR[56+rdi],r15 + lea rsi,QWORD PTR[64+rsi] + sub rax,1 + jz $L$alldone + mov QWORD PTR[8+rbx],rsi + mov QWORD PTR[16+rbx],rax + jmp $L$outerloop +$L$alldone:: + mov rsi,QWORD PTR[32+rbx] + mov r15,QWORD PTR[rsi] + mov r14,QWORD PTR[8+rsi] + mov r13,QWORD PTR[16+rsi] + mov r12,QWORD PTR[24+rsi] + mov rbp,QWORD PTR[32+rsi] + mov rbx,QWORD PTR[40+rsi] + lea rsp,QWORD PTR[48+rsi] +$L$epilogue:: + mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue + mov rsi,QWORD PTR[16+rsp] + DB 0F3h,0C3h ;repret +$L$SEH_end_whirlpool_block:: +whirlpool_block ENDP + +ALIGN 64 + +$L$table:: +DB 24,24,96,24,192,120,48,216,24,24,96,24,192,120,48,216 +DB 35,35,140,35,5,175,70,38,35,35,140,35,5,175,70,38 +DB 198,198,63,198,126,249,145,184,198,198,63,198,126,249,145,184 +DB 232,232,135,232,19,111,205,251,232,232,135,232,19,111,205,251 +DB 135,135,38,135,76,161,19,203,135,135,38,135,76,161,19,203 +DB 184,184,218,184,169,98,109,17,184,184,218,184,169,98,109,17 +DB 1,1,4,1,8,5,2,9,1,1,4,1,8,5,2,9 +DB 79,79,33,79,66,110,158,13,79,79,33,79,66,110,158,13 +DB 54,54,216,54,173,238,108,155,54,54,216,54,173,238,108,155 +DB 166,166,162,166,89,4,81,255,166,166,162,166,89,4,81,255 +DB 210,210,111,210,222,189,185,12,210,210,111,210,222,189,185,12 +DB 245,245,243,245,251,6,247,14,245,245,243,245,251,6,247,14 +DB 121,121,249,121,239,128,242,150,121,121,249,121,239,128,242,150 +DB 111,111,161,111,95,206,222,48,111,111,161,111,95,206,222,48 +DB 145,145,126,145,252,239,63,109,145,145,126,145,252,239,63,109 +DB 82,82,85,82,170,7,164,248,82,82,85,82,170,7,164,248 +DB 96,96,157,96,39,253,192,71,96,96,157,96,39,253,192,71 +DB 188,188,202,188,137,118,101,53,188,188,202,188,137,118,101,53 +DB 155,155,86,155,172,205,43,55,155,155,86,155,172,205,43,55 +DB 142,142,2,142,4,140,1,138,142,142,2,142,4,140,1,138 +DB 163,163,182,163,113,21,91,210,163,163,182,163,113,21,91,210 +DB 12,12,48,12,96,60,24,108,12,12,48,12,96,60,24,108 +DB 123,123,241,123,255,138,246,132,123,123,241,123,255,138,246,132 +DB 53,53,212,53,181,225,106,128,53,53,212,53,181,225,106,128 +DB 29,29,116,29,232,105,58,245,29,29,116,29,232,105,58,245 +DB 224,224,167,224,83,71,221,179,224,224,167,224,83,71,221,179 +DB 215,215,123,215,246,172,179,33,215,215,123,215,246,172,179,33 +DB 194,194,47,194,94,237,153,156,194,194,47,194,94,237,153,156 +DB 46,46,184,46,109,150,92,67,46,46,184,46,109,150,92,67 +DB 75,75,49,75,98,122,150,41,75,75,49,75,98,122,150,41 +DB 254,254,223,254,163,33,225,93,254,254,223,254,163,33,225,93 +DB 87,87,65,87,130,22,174,213,87,87,65,87,130,22,174,213 +DB 21,21,84,21,168,65,42,189,21,21,84,21,168,65,42,189 +DB 119,119,193,119,159,182,238,232,119,119,193,119,159,182,238,232 +DB 55,55,220,55,165,235,110,146,55,55,220,55,165,235,110,146 +DB 229,229,179,229,123,86,215,158,229,229,179,229,123,86,215,158 +DB 159,159,70,159,140,217,35,19,159,159,70,159,140,217,35,19 +DB 240,240,231,240,211,23,253,35,240,240,231,240,211,23,253,35 +DB 74,74,53,74,106,127,148,32,74,74,53,74,106,127,148,32 +DB 218,218,79,218,158,149,169,68,218,218,79,218,158,149,169,68 +DB 88,88,125,88,250,37,176,162,88,88,125,88,250,37,176,162 +DB 201,201,3,201,6,202,143,207,201,201,3,201,6,202,143,207 +DB 41,41,164,41,85,141,82,124,41,41,164,41,85,141,82,124 +DB 10,10,40,10,80,34,20,90,10,10,40,10,80,34,20,90 +DB 177,177,254,177,225,79,127,80,177,177,254,177,225,79,127,80 +DB 160,160,186,160,105,26,93,201,160,160,186,160,105,26,93,201 +DB 107,107,177,107,127,218,214,20,107,107,177,107,127,218,214,20 +DB 133,133,46,133,92,171,23,217,133,133,46,133,92,171,23,217 +DB 189,189,206,189,129,115,103,60,189,189,206,189,129,115,103,60 +DB 93,93,105,93,210,52,186,143,93,93,105,93,210,52,186,143 +DB 16,16,64,16,128,80,32,144,16,16,64,16,128,80,32,144 +DB 244,244,247,244,243,3,245,7,244,244,247,244,243,3,245,7 +DB 203,203,11,203,22,192,139,221,203,203,11,203,22,192,139,221 +DB 62,62,248,62,237,198,124,211,62,62,248,62,237,198,124,211 +DB 5,5,20,5,40,17,10,45,5,5,20,5,40,17,10,45 +DB 103,103,129,103,31,230,206,120,103,103,129,103,31,230,206,120 +DB 228,228,183,228,115,83,213,151,228,228,183,228,115,83,213,151 +DB 39,39,156,39,37,187,78,2,39,39,156,39,37,187,78,2 +DB 65,65,25,65,50,88,130,115,65,65,25,65,50,88,130,115 +DB 139,139,22,139,44,157,11,167,139,139,22,139,44,157,11,167 +DB 167,167,166,167,81,1,83,246,167,167,166,167,81,1,83,246 +DB 125,125,233,125,207,148,250,178,125,125,233,125,207,148,250,178 +DB 149,149,110,149,220,251,55,73,149,149,110,149,220,251,55,73 +DB 216,216,71,216,142,159,173,86,216,216,71,216,142,159,173,86 +DB 251,251,203,251,139,48,235,112,251,251,203,251,139,48,235,112 +DB 238,238,159,238,35,113,193,205,238,238,159,238,35,113,193,205 +DB 124,124,237,124,199,145,248,187,124,124,237,124,199,145,248,187 +DB 102,102,133,102,23,227,204,113,102,102,133,102,23,227,204,113 +DB 221,221,83,221,166,142,167,123,221,221,83,221,166,142,167,123 +DB 23,23,92,23,184,75,46,175,23,23,92,23,184,75,46,175 +DB 71,71,1,71,2,70,142,69,71,71,1,71,2,70,142,69 +DB 158,158,66,158,132,220,33,26,158,158,66,158,132,220,33,26 +DB 202,202,15,202,30,197,137,212,202,202,15,202,30,197,137,212 +DB 45,45,180,45,117,153,90,88,45,45,180,45,117,153,90,88 +DB 191,191,198,191,145,121,99,46,191,191,198,191,145,121,99,46 +DB 7,7,28,7,56,27,14,63,7,7,28,7,56,27,14,63 +DB 173,173,142,173,1,35,71,172,173,173,142,173,1,35,71,172 +DB 90,90,117,90,234,47,180,176,90,90,117,90,234,47,180,176 +DB 131,131,54,131,108,181,27,239,131,131,54,131,108,181,27,239 +DB 51,51,204,51,133,255,102,182,51,51,204,51,133,255,102,182 +DB 99,99,145,99,63,242,198,92,99,99,145,99,63,242,198,92 +DB 2,2,8,2,16,10,4,18,2,2,8,2,16,10,4,18 +DB 170,170,146,170,57,56,73,147,170,170,146,170,57,56,73,147 +DB 113,113,217,113,175,168,226,222,113,113,217,113,175,168,226,222 +DB 200,200,7,200,14,207,141,198,200,200,7,200,14,207,141,198 +DB 25,25,100,25,200,125,50,209,25,25,100,25,200,125,50,209 +DB 73,73,57,73,114,112,146,59,73,73,57,73,114,112,146,59 +DB 217,217,67,217,134,154,175,95,217,217,67,217,134,154,175,95 +DB 242,242,239,242,195,29,249,49,242,242,239,242,195,29,249,49 +DB 227,227,171,227,75,72,219,168,227,227,171,227,75,72,219,168 +DB 91,91,113,91,226,42,182,185,91,91,113,91,226,42,182,185 +DB 136,136,26,136,52,146,13,188,136,136,26,136,52,146,13,188 +DB 154,154,82,154,164,200,41,62,154,154,82,154,164,200,41,62 +DB 38,38,152,38,45,190,76,11,38,38,152,38,45,190,76,11 +DB 50,50,200,50,141,250,100,191,50,50,200,50,141,250,100,191 +DB 176,176,250,176,233,74,125,89,176,176,250,176,233,74,125,89 +DB 233,233,131,233,27,106,207,242,233,233,131,233,27,106,207,242 +DB 15,15,60,15,120,51,30,119,15,15,60,15,120,51,30,119 +DB 213,213,115,213,230,166,183,51,213,213,115,213,230,166,183,51 +DB 128,128,58,128,116,186,29,244,128,128,58,128,116,186,29,244 +DB 190,190,194,190,153,124,97,39,190,190,194,190,153,124,97,39 +DB 205,205,19,205,38,222,135,235,205,205,19,205,38,222,135,235 +DB 52,52,208,52,189,228,104,137,52,52,208,52,189,228,104,137 +DB 72,72,61,72,122,117,144,50,72,72,61,72,122,117,144,50 +DB 255,255,219,255,171,36,227,84,255,255,219,255,171,36,227,84 +DB 122,122,245,122,247,143,244,141,122,122,245,122,247,143,244,141 +DB 144,144,122,144,244,234,61,100,144,144,122,144,244,234,61,100 +DB 95,95,97,95,194,62,190,157,95,95,97,95,194,62,190,157 +DB 32,32,128,32,29,160,64,61,32,32,128,32,29,160,64,61 +DB 104,104,189,104,103,213,208,15,104,104,189,104,103,213,208,15 +DB 26,26,104,26,208,114,52,202,26,26,104,26,208,114,52,202 +DB 174,174,130,174,25,44,65,183,174,174,130,174,25,44,65,183 +DB 180,180,234,180,201,94,117,125,180,180,234,180,201,94,117,125 +DB 84,84,77,84,154,25,168,206,84,84,77,84,154,25,168,206 +DB 147,147,118,147,236,229,59,127,147,147,118,147,236,229,59,127 +DB 34,34,136,34,13,170,68,47,34,34,136,34,13,170,68,47 +DB 100,100,141,100,7,233,200,99,100,100,141,100,7,233,200,99 +DB 241,241,227,241,219,18,255,42,241,241,227,241,219,18,255,42 +DB 115,115,209,115,191,162,230,204,115,115,209,115,191,162,230,204 +DB 18,18,72,18,144,90,36,130,18,18,72,18,144,90,36,130 +DB 64,64,29,64,58,93,128,122,64,64,29,64,58,93,128,122 +DB 8,8,32,8,64,40,16,72,8,8,32,8,64,40,16,72 +DB 195,195,43,195,86,232,155,149,195,195,43,195,86,232,155,149 +DB 236,236,151,236,51,123,197,223,236,236,151,236,51,123,197,223 +DB 219,219,75,219,150,144,171,77,219,219,75,219,150,144,171,77 +DB 161,161,190,161,97,31,95,192,161,161,190,161,97,31,95,192 +DB 141,141,14,141,28,131,7,145,141,141,14,141,28,131,7,145 +DB 61,61,244,61,245,201,122,200,61,61,244,61,245,201,122,200 +DB 151,151,102,151,204,241,51,91,151,151,102,151,204,241,51,91 +DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +DB 207,207,27,207,54,212,131,249,207,207,27,207,54,212,131,249 +DB 43,43,172,43,69,135,86,110,43,43,172,43,69,135,86,110 +DB 118,118,197,118,151,179,236,225,118,118,197,118,151,179,236,225 +DB 130,130,50,130,100,176,25,230,130,130,50,130,100,176,25,230 +DB 214,214,127,214,254,169,177,40,214,214,127,214,254,169,177,40 +DB 27,27,108,27,216,119,54,195,27,27,108,27,216,119,54,195 +DB 181,181,238,181,193,91,119,116,181,181,238,181,193,91,119,116 +DB 175,175,134,175,17,41,67,190,175,175,134,175,17,41,67,190 +DB 106,106,181,106,119,223,212,29,106,106,181,106,119,223,212,29 +DB 80,80,93,80,186,13,160,234,80,80,93,80,186,13,160,234 +DB 69,69,9,69,18,76,138,87,69,69,9,69,18,76,138,87 +DB 243,243,235,243,203,24,251,56,243,243,235,243,203,24,251,56 +DB 48,48,192,48,157,240,96,173,48,48,192,48,157,240,96,173 +DB 239,239,155,239,43,116,195,196,239,239,155,239,43,116,195,196 +DB 63,63,252,63,229,195,126,218,63,63,252,63,229,195,126,218 +DB 85,85,73,85,146,28,170,199,85,85,73,85,146,28,170,199 +DB 162,162,178,162,121,16,89,219,162,162,178,162,121,16,89,219 +DB 234,234,143,234,3,101,201,233,234,234,143,234,3,101,201,233 +DB 101,101,137,101,15,236,202,106,101,101,137,101,15,236,202,106 +DB 186,186,210,186,185,104,105,3,186,186,210,186,185,104,105,3 +DB 47,47,188,47,101,147,94,74,47,47,188,47,101,147,94,74 +DB 192,192,39,192,78,231,157,142,192,192,39,192,78,231,157,142 +DB 222,222,95,222,190,129,161,96,222,222,95,222,190,129,161,96 +DB 28,28,112,28,224,108,56,252,28,28,112,28,224,108,56,252 +DB 253,253,211,253,187,46,231,70,253,253,211,253,187,46,231,70 +DB 77,77,41,77,82,100,154,31,77,77,41,77,82,100,154,31 +DB 146,146,114,146,228,224,57,118,146,146,114,146,228,224,57,118 +DB 117,117,201,117,143,188,234,250,117,117,201,117,143,188,234,250 +DB 6,6,24,6,48,30,12,54,6,6,24,6,48,30,12,54 +DB 138,138,18,138,36,152,9,174,138,138,18,138,36,152,9,174 +DB 178,178,242,178,249,64,121,75,178,178,242,178,249,64,121,75 +DB 230,230,191,230,99,89,209,133,230,230,191,230,99,89,209,133 +DB 14,14,56,14,112,54,28,126,14,14,56,14,112,54,28,126 +DB 31,31,124,31,248,99,62,231,31,31,124,31,248,99,62,231 +DB 98,98,149,98,55,247,196,85,98,98,149,98,55,247,196,85 +DB 212,212,119,212,238,163,181,58,212,212,119,212,238,163,181,58 +DB 168,168,154,168,41,50,77,129,168,168,154,168,41,50,77,129 +DB 150,150,98,150,196,244,49,82,150,150,98,150,196,244,49,82 +DB 249,249,195,249,155,58,239,98,249,249,195,249,155,58,239,98 +DB 197,197,51,197,102,246,151,163,197,197,51,197,102,246,151,163 +DB 37,37,148,37,53,177,74,16,37,37,148,37,53,177,74,16 +DB 89,89,121,89,242,32,178,171,89,89,121,89,242,32,178,171 +DB 132,132,42,132,84,174,21,208,132,132,42,132,84,174,21,208 +DB 114,114,213,114,183,167,228,197,114,114,213,114,183,167,228,197 +DB 57,57,228,57,213,221,114,236,57,57,228,57,213,221,114,236 +DB 76,76,45,76,90,97,152,22,76,76,45,76,90,97,152,22 +DB 94,94,101,94,202,59,188,148,94,94,101,94,202,59,188,148 +DB 120,120,253,120,231,133,240,159,120,120,253,120,231,133,240,159 +DB 56,56,224,56,221,216,112,229,56,56,224,56,221,216,112,229 +DB 140,140,10,140,20,134,5,152,140,140,10,140,20,134,5,152 +DB 209,209,99,209,198,178,191,23,209,209,99,209,198,178,191,23 +DB 165,165,174,165,65,11,87,228,165,165,174,165,65,11,87,228 +DB 226,226,175,226,67,77,217,161,226,226,175,226,67,77,217,161 +DB 97,97,153,97,47,248,194,78,97,97,153,97,47,248,194,78 +DB 179,179,246,179,241,69,123,66,179,179,246,179,241,69,123,66 +DB 33,33,132,33,21,165,66,52,33,33,132,33,21,165,66,52 +DB 156,156,74,156,148,214,37,8,156,156,74,156,148,214,37,8 +DB 30,30,120,30,240,102,60,238,30,30,120,30,240,102,60,238 +DB 67,67,17,67,34,82,134,97,67,67,17,67,34,82,134,97 +DB 199,199,59,199,118,252,147,177,199,199,59,199,118,252,147,177 +DB 252,252,215,252,179,43,229,79,252,252,215,252,179,43,229,79 +DB 4,4,16,4,32,20,8,36,4,4,16,4,32,20,8,36 +DB 81,81,89,81,178,8,162,227,81,81,89,81,178,8,162,227 +DB 153,153,94,153,188,199,47,37,153,153,94,153,188,199,47,37 +DB 109,109,169,109,79,196,218,34,109,109,169,109,79,196,218,34 +DB 13,13,52,13,104,57,26,101,13,13,52,13,104,57,26,101 +DB 250,250,207,250,131,53,233,121,250,250,207,250,131,53,233,121 +DB 223,223,91,223,182,132,163,105,223,223,91,223,182,132,163,105 +DB 126,126,229,126,215,155,252,169,126,126,229,126,215,155,252,169 +DB 36,36,144,36,61,180,72,25,36,36,144,36,61,180,72,25 +DB 59,59,236,59,197,215,118,254,59,59,236,59,197,215,118,254 +DB 171,171,150,171,49,61,75,154,171,171,150,171,49,61,75,154 +DB 206,206,31,206,62,209,129,240,206,206,31,206,62,209,129,240 +DB 17,17,68,17,136,85,34,153,17,17,68,17,136,85,34,153 +DB 143,143,6,143,12,137,3,131,143,143,6,143,12,137,3,131 +DB 78,78,37,78,74,107,156,4,78,78,37,78,74,107,156,4 +DB 183,183,230,183,209,81,115,102,183,183,230,183,209,81,115,102 +DB 235,235,139,235,11,96,203,224,235,235,139,235,11,96,203,224 +DB 60,60,240,60,253,204,120,193,60,60,240,60,253,204,120,193 +DB 129,129,62,129,124,191,31,253,129,129,62,129,124,191,31,253 +DB 148,148,106,148,212,254,53,64,148,148,106,148,212,254,53,64 +DB 247,247,251,247,235,12,243,28,247,247,251,247,235,12,243,28 +DB 185,185,222,185,161,103,111,24,185,185,222,185,161,103,111,24 +DB 19,19,76,19,152,95,38,139,19,19,76,19,152,95,38,139 +DB 44,44,176,44,125,156,88,81,44,44,176,44,125,156,88,81 +DB 211,211,107,211,214,184,187,5,211,211,107,211,214,184,187,5 +DB 231,231,187,231,107,92,211,140,231,231,187,231,107,92,211,140 +DB 110,110,165,110,87,203,220,57,110,110,165,110,87,203,220,57 +DB 196,196,55,196,110,243,149,170,196,196,55,196,110,243,149,170 +DB 3,3,12,3,24,15,6,27,3,3,12,3,24,15,6,27 +DB 86,86,69,86,138,19,172,220,86,86,69,86,138,19,172,220 +DB 68,68,13,68,26,73,136,94,68,68,13,68,26,73,136,94 +DB 127,127,225,127,223,158,254,160,127,127,225,127,223,158,254,160 +DB 169,169,158,169,33,55,79,136,169,169,158,169,33,55,79,136 +DB 42,42,168,42,77,130,84,103,42,42,168,42,77,130,84,103 +DB 187,187,214,187,177,109,107,10,187,187,214,187,177,109,107,10 +DB 193,193,35,193,70,226,159,135,193,193,35,193,70,226,159,135 +DB 83,83,81,83,162,2,166,241,83,83,81,83,162,2,166,241 +DB 220,220,87,220,174,139,165,114,220,220,87,220,174,139,165,114 +DB 11,11,44,11,88,39,22,83,11,11,44,11,88,39,22,83 +DB 157,157,78,157,156,211,39,1,157,157,78,157,156,211,39,1 +DB 108,108,173,108,71,193,216,43,108,108,173,108,71,193,216,43 +DB 49,49,196,49,149,245,98,164,49,49,196,49,149,245,98,164 +DB 116,116,205,116,135,185,232,243,116,116,205,116,135,185,232,243 +DB 246,246,255,246,227,9,241,21,246,246,255,246,227,9,241,21 +DB 70,70,5,70,10,67,140,76,70,70,5,70,10,67,140,76 +DB 172,172,138,172,9,38,69,165,172,172,138,172,9,38,69,165 +DB 137,137,30,137,60,151,15,181,137,137,30,137,60,151,15,181 +DB 20,20,80,20,160,68,40,180,20,20,80,20,160,68,40,180 +DB 225,225,163,225,91,66,223,186,225,225,163,225,91,66,223,186 +DB 22,22,88,22,176,78,44,166,22,22,88,22,176,78,44,166 +DB 58,58,232,58,205,210,116,247,58,58,232,58,205,210,116,247 +DB 105,105,185,105,111,208,210,6,105,105,185,105,111,208,210,6 +DB 9,9,36,9,72,45,18,65,9,9,36,9,72,45,18,65 +DB 112,112,221,112,167,173,224,215,112,112,221,112,167,173,224,215 +DB 182,182,226,182,217,84,113,111,182,182,226,182,217,84,113,111 +DB 208,208,103,208,206,183,189,30,208,208,103,208,206,183,189,30 +DB 237,237,147,237,59,126,199,214,237,237,147,237,59,126,199,214 +DB 204,204,23,204,46,219,133,226,204,204,23,204,46,219,133,226 +DB 66,66,21,66,42,87,132,104,66,66,21,66,42,87,132,104 +DB 152,152,90,152,180,194,45,44,152,152,90,152,180,194,45,44 +DB 164,164,170,164,73,14,85,237,164,164,170,164,73,14,85,237 +DB 40,40,160,40,93,136,80,117,40,40,160,40,93,136,80,117 +DB 92,92,109,92,218,49,184,134,92,92,109,92,218,49,184,134 +DB 248,248,199,248,147,63,237,107,248,248,199,248,147,63,237,107 +DB 134,134,34,134,68,164,17,194,134,134,34,134,68,164,17,194 +DB 24,35,198,232,135,184,1,79 +DB 54,166,210,245,121,111,145,82 +DB 96,188,155,142,163,12,123,53 +DB 29,224,215,194,46,75,254,87 +DB 21,119,55,229,159,240,74,218 +DB 88,201,41,10,177,160,107,133 +DB 189,93,16,244,203,62,5,103 +DB 228,39,65,139,167,125,149,216 +DB 251,238,124,102,221,23,71,158 +DB 202,45,191,7,173,90,131,51 + +.text$ ENDS +END diff --git a/crypto/whrlpool/wp-mingw64-x86_64.S b/crypto/whrlpool/wp-mingw64-x86_64.S new file mode 100644 index 00000000..ea9f6cf9 --- /dev/null +++ b/crypto/whrlpool/wp-mingw64-x86_64.S @@ -0,0 +1,869 @@ +#include "x86_arch.h" +.text + +.globl whirlpool_block +.def whirlpool_block; .scl 2; .type 32; .endef +.p2align 4 +whirlpool_block: + movq %rdi,8(%rsp) + movq %rsi,16(%rsp) + movq %rsp,%rax +.LSEH_begin_whirlpool_block: + movq %rcx,%rdi + movq %rdx,%rsi + movq %r8,%rdx + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + + movq %rsp,%r11 + subq $128+40,%rsp + andq $-64,%rsp + + leaq 128(%rsp),%r10 + movq %rdi,0(%r10) + movq %rsi,8(%r10) + movq %rdx,16(%r10) + movq %r11,32(%r10) +.Lprologue: + + movq %r10,%rbx + leaq .Ltable(%rip),%rbp + + xorq %rcx,%rcx + xorq %rdx,%rdx + movq 0(%rdi),%r8 + movq 8(%rdi),%r9 + movq 16(%rdi),%r10 + movq 24(%rdi),%r11 + movq 32(%rdi),%r12 + movq 40(%rdi),%r13 + movq 48(%rdi),%r14 + movq 56(%rdi),%r15 +.Louterloop: + movq %r8,0(%rsp) + movq %r9,8(%rsp) + movq %r10,16(%rsp) + movq %r11,24(%rsp) + movq %r12,32(%rsp) + movq %r13,40(%rsp) + movq %r14,48(%rsp) + movq %r15,56(%rsp) + xorq 0(%rsi),%r8 + xorq 8(%rsi),%r9 + xorq 16(%rsi),%r10 + xorq 24(%rsi),%r11 + xorq 32(%rsi),%r12 + xorq 40(%rsi),%r13 + xorq 48(%rsi),%r14 + xorq 56(%rsi),%r15 + movq %r8,64+0(%rsp) + movq %r9,64+8(%rsp) + movq %r10,64+16(%rsp) + movq %r11,64+24(%rsp) + movq %r12,64+32(%rsp) + movq %r13,64+40(%rsp) + movq %r14,64+48(%rsp) + movq %r15,64+56(%rsp) + xorq %rsi,%rsi + movq %rsi,24(%rbx) +.p2align 4 +.Lround: + movq 4096(%rbp,%rsi,8),%r8 + movl 0(%rsp),%eax + movl 4(%rsp),%ebx + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r8 + movq 7(%rbp,%rdi,8),%r9 + movb %al,%cl + movb %ah,%dl + movl 0+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + movq 6(%rbp,%rsi,8),%r10 + movq 5(%rbp,%rdi,8),%r11 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + movq 4(%rbp,%rsi,8),%r12 + movq 3(%rbp,%rdi,8),%r13 + movb %bl,%cl + movb %bh,%dl + movl 0+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + movq 2(%rbp,%rsi,8),%r14 + movq 1(%rbp,%rdi,8),%r15 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r9 + xorq 7(%rbp,%rdi,8),%r10 + movb %al,%cl + movb %ah,%dl + movl 8+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r11 + xorq 5(%rbp,%rdi,8),%r12 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r13 + xorq 3(%rbp,%rdi,8),%r14 + movb %bl,%cl + movb %bh,%dl + movl 8+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r15 + xorq 1(%rbp,%rdi,8),%r8 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r10 + xorq 7(%rbp,%rdi,8),%r11 + movb %al,%cl + movb %ah,%dl + movl 16+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r12 + xorq 5(%rbp,%rdi,8),%r13 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r14 + xorq 3(%rbp,%rdi,8),%r15 + movb %bl,%cl + movb %bh,%dl + movl 16+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r8 + xorq 1(%rbp,%rdi,8),%r9 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r11 + xorq 7(%rbp,%rdi,8),%r12 + movb %al,%cl + movb %ah,%dl + movl 24+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r13 + xorq 5(%rbp,%rdi,8),%r14 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r15 + xorq 3(%rbp,%rdi,8),%r8 + movb %bl,%cl + movb %bh,%dl + movl 24+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r9 + xorq 1(%rbp,%rdi,8),%r10 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r12 + xorq 7(%rbp,%rdi,8),%r13 + movb %al,%cl + movb %ah,%dl + movl 32+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r14 + xorq 5(%rbp,%rdi,8),%r15 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r8 + xorq 3(%rbp,%rdi,8),%r9 + movb %bl,%cl + movb %bh,%dl + movl 32+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r10 + xorq 1(%rbp,%rdi,8),%r11 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r13 + xorq 7(%rbp,%rdi,8),%r14 + movb %al,%cl + movb %ah,%dl + movl 40+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r15 + xorq 5(%rbp,%rdi,8),%r8 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r9 + xorq 3(%rbp,%rdi,8),%r10 + movb %bl,%cl + movb %bh,%dl + movl 40+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r11 + xorq 1(%rbp,%rdi,8),%r12 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r14 + xorq 7(%rbp,%rdi,8),%r15 + movb %al,%cl + movb %ah,%dl + movl 48+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r8 + xorq 5(%rbp,%rdi,8),%r9 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r10 + xorq 3(%rbp,%rdi,8),%r11 + movb %bl,%cl + movb %bh,%dl + movl 48+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r12 + xorq 1(%rbp,%rdi,8),%r13 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r15 + xorq 7(%rbp,%rdi,8),%r8 + movb %al,%cl + movb %ah,%dl + movl 56+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r9 + xorq 5(%rbp,%rdi,8),%r10 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r11 + xorq 3(%rbp,%rdi,8),%r12 + movb %bl,%cl + movb %bh,%dl + movl 56+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r13 + xorq 1(%rbp,%rdi,8),%r14 + movq %r8,0(%rsp) + movq %r9,8(%rsp) + movq %r10,16(%rsp) + movq %r11,24(%rsp) + movq %r12,32(%rsp) + movq %r13,40(%rsp) + movq %r14,48(%rsp) + movq %r15,56(%rsp) + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r8 + xorq 7(%rbp,%rdi,8),%r9 + movb %al,%cl + movb %ah,%dl + movl 64+0+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r10 + xorq 5(%rbp,%rdi,8),%r11 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r12 + xorq 3(%rbp,%rdi,8),%r13 + movb %bl,%cl + movb %bh,%dl + movl 64+0+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r14 + xorq 1(%rbp,%rdi,8),%r15 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r9 + xorq 7(%rbp,%rdi,8),%r10 + movb %al,%cl + movb %ah,%dl + movl 64+8+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r11 + xorq 5(%rbp,%rdi,8),%r12 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r13 + xorq 3(%rbp,%rdi,8),%r14 + movb %bl,%cl + movb %bh,%dl + movl 64+8+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r15 + xorq 1(%rbp,%rdi,8),%r8 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r10 + xorq 7(%rbp,%rdi,8),%r11 + movb %al,%cl + movb %ah,%dl + movl 64+16+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r12 + xorq 5(%rbp,%rdi,8),%r13 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r14 + xorq 3(%rbp,%rdi,8),%r15 + movb %bl,%cl + movb %bh,%dl + movl 64+16+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r8 + xorq 1(%rbp,%rdi,8),%r9 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r11 + xorq 7(%rbp,%rdi,8),%r12 + movb %al,%cl + movb %ah,%dl + movl 64+24+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r13 + xorq 5(%rbp,%rdi,8),%r14 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r15 + xorq 3(%rbp,%rdi,8),%r8 + movb %bl,%cl + movb %bh,%dl + movl 64+24+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r9 + xorq 1(%rbp,%rdi,8),%r10 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r12 + xorq 7(%rbp,%rdi,8),%r13 + movb %al,%cl + movb %ah,%dl + movl 64+32+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r14 + xorq 5(%rbp,%rdi,8),%r15 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r8 + xorq 3(%rbp,%rdi,8),%r9 + movb %bl,%cl + movb %bh,%dl + movl 64+32+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r10 + xorq 1(%rbp,%rdi,8),%r11 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r13 + xorq 7(%rbp,%rdi,8),%r14 + movb %al,%cl + movb %ah,%dl + movl 64+40+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r15 + xorq 5(%rbp,%rdi,8),%r8 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r9 + xorq 3(%rbp,%rdi,8),%r10 + movb %bl,%cl + movb %bh,%dl + movl 64+40+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r11 + xorq 1(%rbp,%rdi,8),%r12 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r14 + xorq 7(%rbp,%rdi,8),%r15 + movb %al,%cl + movb %ah,%dl + movl 64+48+8(%rsp),%eax + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r8 + xorq 5(%rbp,%rdi,8),%r9 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r10 + xorq 3(%rbp,%rdi,8),%r11 + movb %bl,%cl + movb %bh,%dl + movl 64+48+8+4(%rsp),%ebx + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r12 + xorq 1(%rbp,%rdi,8),%r13 + movb %al,%cl + movb %ah,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%eax + xorq 0(%rbp,%rsi,8),%r15 + xorq 7(%rbp,%rdi,8),%r8 + movb %al,%cl + movb %ah,%dl + + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 6(%rbp,%rsi,8),%r9 + xorq 5(%rbp,%rdi,8),%r10 + movb %bl,%cl + movb %bh,%dl + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + shrl $16,%ebx + xorq 4(%rbp,%rsi,8),%r11 + xorq 3(%rbp,%rdi,8),%r12 + movb %bl,%cl + movb %bh,%dl + + leaq (%rcx,%rcx,1),%rsi + leaq (%rdx,%rdx,1),%rdi + xorq 2(%rbp,%rsi,8),%r13 + xorq 1(%rbp,%rdi,8),%r14 + leaq 128(%rsp),%rbx + movq 24(%rbx),%rsi + addq $1,%rsi + cmpq $10,%rsi + je .Lroundsdone + + movq %rsi,24(%rbx) + movq %r8,64+0(%rsp) + movq %r9,64+8(%rsp) + movq %r10,64+16(%rsp) + movq %r11,64+24(%rsp) + movq %r12,64+32(%rsp) + movq %r13,64+40(%rsp) + movq %r14,64+48(%rsp) + movq %r15,64+56(%rsp) + jmp .Lround +.p2align 4 +.Lroundsdone: + movq 0(%rbx),%rdi + movq 8(%rbx),%rsi + movq 16(%rbx),%rax + xorq 0(%rsi),%r8 + xorq 8(%rsi),%r9 + xorq 16(%rsi),%r10 + xorq 24(%rsi),%r11 + xorq 32(%rsi),%r12 + xorq 40(%rsi),%r13 + xorq 48(%rsi),%r14 + xorq 56(%rsi),%r15 + xorq 0(%rdi),%r8 + xorq 8(%rdi),%r9 + xorq 16(%rdi),%r10 + xorq 24(%rdi),%r11 + xorq 32(%rdi),%r12 + xorq 40(%rdi),%r13 + xorq 48(%rdi),%r14 + xorq 56(%rdi),%r15 + movq %r8,0(%rdi) + movq %r9,8(%rdi) + movq %r10,16(%rdi) + movq %r11,24(%rdi) + movq %r12,32(%rdi) + movq %r13,40(%rdi) + movq %r14,48(%rdi) + movq %r15,56(%rdi) + leaq 64(%rsi),%rsi + subq $1,%rax + jz .Lalldone + movq %rsi,8(%rbx) + movq %rax,16(%rbx) + jmp .Louterloop +.Lalldone: + movq 32(%rbx),%rsi + movq (%rsi),%r15 + movq 8(%rsi),%r14 + movq 16(%rsi),%r13 + movq 24(%rsi),%r12 + movq 32(%rsi),%rbp + movq 40(%rsi),%rbx + leaq 48(%rsi),%rsp +.Lepilogue: + movq 8(%rsp),%rdi + movq 16(%rsp),%rsi + retq +.LSEH_end_whirlpool_block: + +.p2align 6 + +.Ltable: +.byte 24,24,96,24,192,120,48,216,24,24,96,24,192,120,48,216 +.byte 35,35,140,35,5,175,70,38,35,35,140,35,5,175,70,38 +.byte 198,198,63,198,126,249,145,184,198,198,63,198,126,249,145,184 +.byte 232,232,135,232,19,111,205,251,232,232,135,232,19,111,205,251 +.byte 135,135,38,135,76,161,19,203,135,135,38,135,76,161,19,203 +.byte 184,184,218,184,169,98,109,17,184,184,218,184,169,98,109,17 +.byte 1,1,4,1,8,5,2,9,1,1,4,1,8,5,2,9 +.byte 79,79,33,79,66,110,158,13,79,79,33,79,66,110,158,13 +.byte 54,54,216,54,173,238,108,155,54,54,216,54,173,238,108,155 +.byte 166,166,162,166,89,4,81,255,166,166,162,166,89,4,81,255 +.byte 210,210,111,210,222,189,185,12,210,210,111,210,222,189,185,12 +.byte 245,245,243,245,251,6,247,14,245,245,243,245,251,6,247,14 +.byte 121,121,249,121,239,128,242,150,121,121,249,121,239,128,242,150 +.byte 111,111,161,111,95,206,222,48,111,111,161,111,95,206,222,48 +.byte 145,145,126,145,252,239,63,109,145,145,126,145,252,239,63,109 +.byte 82,82,85,82,170,7,164,248,82,82,85,82,170,7,164,248 +.byte 96,96,157,96,39,253,192,71,96,96,157,96,39,253,192,71 +.byte 188,188,202,188,137,118,101,53,188,188,202,188,137,118,101,53 +.byte 155,155,86,155,172,205,43,55,155,155,86,155,172,205,43,55 +.byte 142,142,2,142,4,140,1,138,142,142,2,142,4,140,1,138 +.byte 163,163,182,163,113,21,91,210,163,163,182,163,113,21,91,210 +.byte 12,12,48,12,96,60,24,108,12,12,48,12,96,60,24,108 +.byte 123,123,241,123,255,138,246,132,123,123,241,123,255,138,246,132 +.byte 53,53,212,53,181,225,106,128,53,53,212,53,181,225,106,128 +.byte 29,29,116,29,232,105,58,245,29,29,116,29,232,105,58,245 +.byte 224,224,167,224,83,71,221,179,224,224,167,224,83,71,221,179 +.byte 215,215,123,215,246,172,179,33,215,215,123,215,246,172,179,33 +.byte 194,194,47,194,94,237,153,156,194,194,47,194,94,237,153,156 +.byte 46,46,184,46,109,150,92,67,46,46,184,46,109,150,92,67 +.byte 75,75,49,75,98,122,150,41,75,75,49,75,98,122,150,41 +.byte 254,254,223,254,163,33,225,93,254,254,223,254,163,33,225,93 +.byte 87,87,65,87,130,22,174,213,87,87,65,87,130,22,174,213 +.byte 21,21,84,21,168,65,42,189,21,21,84,21,168,65,42,189 +.byte 119,119,193,119,159,182,238,232,119,119,193,119,159,182,238,232 +.byte 55,55,220,55,165,235,110,146,55,55,220,55,165,235,110,146 +.byte 229,229,179,229,123,86,215,158,229,229,179,229,123,86,215,158 +.byte 159,159,70,159,140,217,35,19,159,159,70,159,140,217,35,19 +.byte 240,240,231,240,211,23,253,35,240,240,231,240,211,23,253,35 +.byte 74,74,53,74,106,127,148,32,74,74,53,74,106,127,148,32 +.byte 218,218,79,218,158,149,169,68,218,218,79,218,158,149,169,68 +.byte 88,88,125,88,250,37,176,162,88,88,125,88,250,37,176,162 +.byte 201,201,3,201,6,202,143,207,201,201,3,201,6,202,143,207 +.byte 41,41,164,41,85,141,82,124,41,41,164,41,85,141,82,124 +.byte 10,10,40,10,80,34,20,90,10,10,40,10,80,34,20,90 +.byte 177,177,254,177,225,79,127,80,177,177,254,177,225,79,127,80 +.byte 160,160,186,160,105,26,93,201,160,160,186,160,105,26,93,201 +.byte 107,107,177,107,127,218,214,20,107,107,177,107,127,218,214,20 +.byte 133,133,46,133,92,171,23,217,133,133,46,133,92,171,23,217 +.byte 189,189,206,189,129,115,103,60,189,189,206,189,129,115,103,60 +.byte 93,93,105,93,210,52,186,143,93,93,105,93,210,52,186,143 +.byte 16,16,64,16,128,80,32,144,16,16,64,16,128,80,32,144 +.byte 244,244,247,244,243,3,245,7,244,244,247,244,243,3,245,7 +.byte 203,203,11,203,22,192,139,221,203,203,11,203,22,192,139,221 +.byte 62,62,248,62,237,198,124,211,62,62,248,62,237,198,124,211 +.byte 5,5,20,5,40,17,10,45,5,5,20,5,40,17,10,45 +.byte 103,103,129,103,31,230,206,120,103,103,129,103,31,230,206,120 +.byte 228,228,183,228,115,83,213,151,228,228,183,228,115,83,213,151 +.byte 39,39,156,39,37,187,78,2,39,39,156,39,37,187,78,2 +.byte 65,65,25,65,50,88,130,115,65,65,25,65,50,88,130,115 +.byte 139,139,22,139,44,157,11,167,139,139,22,139,44,157,11,167 +.byte 167,167,166,167,81,1,83,246,167,167,166,167,81,1,83,246 +.byte 125,125,233,125,207,148,250,178,125,125,233,125,207,148,250,178 +.byte 149,149,110,149,220,251,55,73,149,149,110,149,220,251,55,73 +.byte 216,216,71,216,142,159,173,86,216,216,71,216,142,159,173,86 +.byte 251,251,203,251,139,48,235,112,251,251,203,251,139,48,235,112 +.byte 238,238,159,238,35,113,193,205,238,238,159,238,35,113,193,205 +.byte 124,124,237,124,199,145,248,187,124,124,237,124,199,145,248,187 +.byte 102,102,133,102,23,227,204,113,102,102,133,102,23,227,204,113 +.byte 221,221,83,221,166,142,167,123,221,221,83,221,166,142,167,123 +.byte 23,23,92,23,184,75,46,175,23,23,92,23,184,75,46,175 +.byte 71,71,1,71,2,70,142,69,71,71,1,71,2,70,142,69 +.byte 158,158,66,158,132,220,33,26,158,158,66,158,132,220,33,26 +.byte 202,202,15,202,30,197,137,212,202,202,15,202,30,197,137,212 +.byte 45,45,180,45,117,153,90,88,45,45,180,45,117,153,90,88 +.byte 191,191,198,191,145,121,99,46,191,191,198,191,145,121,99,46 +.byte 7,7,28,7,56,27,14,63,7,7,28,7,56,27,14,63 +.byte 173,173,142,173,1,35,71,172,173,173,142,173,1,35,71,172 +.byte 90,90,117,90,234,47,180,176,90,90,117,90,234,47,180,176 +.byte 131,131,54,131,108,181,27,239,131,131,54,131,108,181,27,239 +.byte 51,51,204,51,133,255,102,182,51,51,204,51,133,255,102,182 +.byte 99,99,145,99,63,242,198,92,99,99,145,99,63,242,198,92 +.byte 2,2,8,2,16,10,4,18,2,2,8,2,16,10,4,18 +.byte 170,170,146,170,57,56,73,147,170,170,146,170,57,56,73,147 +.byte 113,113,217,113,175,168,226,222,113,113,217,113,175,168,226,222 +.byte 200,200,7,200,14,207,141,198,200,200,7,200,14,207,141,198 +.byte 25,25,100,25,200,125,50,209,25,25,100,25,200,125,50,209 +.byte 73,73,57,73,114,112,146,59,73,73,57,73,114,112,146,59 +.byte 217,217,67,217,134,154,175,95,217,217,67,217,134,154,175,95 +.byte 242,242,239,242,195,29,249,49,242,242,239,242,195,29,249,49 +.byte 227,227,171,227,75,72,219,168,227,227,171,227,75,72,219,168 +.byte 91,91,113,91,226,42,182,185,91,91,113,91,226,42,182,185 +.byte 136,136,26,136,52,146,13,188,136,136,26,136,52,146,13,188 +.byte 154,154,82,154,164,200,41,62,154,154,82,154,164,200,41,62 +.byte 38,38,152,38,45,190,76,11,38,38,152,38,45,190,76,11 +.byte 50,50,200,50,141,250,100,191,50,50,200,50,141,250,100,191 +.byte 176,176,250,176,233,74,125,89,176,176,250,176,233,74,125,89 +.byte 233,233,131,233,27,106,207,242,233,233,131,233,27,106,207,242 +.byte 15,15,60,15,120,51,30,119,15,15,60,15,120,51,30,119 +.byte 213,213,115,213,230,166,183,51,213,213,115,213,230,166,183,51 +.byte 128,128,58,128,116,186,29,244,128,128,58,128,116,186,29,244 +.byte 190,190,194,190,153,124,97,39,190,190,194,190,153,124,97,39 +.byte 205,205,19,205,38,222,135,235,205,205,19,205,38,222,135,235 +.byte 52,52,208,52,189,228,104,137,52,52,208,52,189,228,104,137 +.byte 72,72,61,72,122,117,144,50,72,72,61,72,122,117,144,50 +.byte 255,255,219,255,171,36,227,84,255,255,219,255,171,36,227,84 +.byte 122,122,245,122,247,143,244,141,122,122,245,122,247,143,244,141 +.byte 144,144,122,144,244,234,61,100,144,144,122,144,244,234,61,100 +.byte 95,95,97,95,194,62,190,157,95,95,97,95,194,62,190,157 +.byte 32,32,128,32,29,160,64,61,32,32,128,32,29,160,64,61 +.byte 104,104,189,104,103,213,208,15,104,104,189,104,103,213,208,15 +.byte 26,26,104,26,208,114,52,202,26,26,104,26,208,114,52,202 +.byte 174,174,130,174,25,44,65,183,174,174,130,174,25,44,65,183 +.byte 180,180,234,180,201,94,117,125,180,180,234,180,201,94,117,125 +.byte 84,84,77,84,154,25,168,206,84,84,77,84,154,25,168,206 +.byte 147,147,118,147,236,229,59,127,147,147,118,147,236,229,59,127 +.byte 34,34,136,34,13,170,68,47,34,34,136,34,13,170,68,47 +.byte 100,100,141,100,7,233,200,99,100,100,141,100,7,233,200,99 +.byte 241,241,227,241,219,18,255,42,241,241,227,241,219,18,255,42 +.byte 115,115,209,115,191,162,230,204,115,115,209,115,191,162,230,204 +.byte 18,18,72,18,144,90,36,130,18,18,72,18,144,90,36,130 +.byte 64,64,29,64,58,93,128,122,64,64,29,64,58,93,128,122 +.byte 8,8,32,8,64,40,16,72,8,8,32,8,64,40,16,72 +.byte 195,195,43,195,86,232,155,149,195,195,43,195,86,232,155,149 +.byte 236,236,151,236,51,123,197,223,236,236,151,236,51,123,197,223 +.byte 219,219,75,219,150,144,171,77,219,219,75,219,150,144,171,77 +.byte 161,161,190,161,97,31,95,192,161,161,190,161,97,31,95,192 +.byte 141,141,14,141,28,131,7,145,141,141,14,141,28,131,7,145 +.byte 61,61,244,61,245,201,122,200,61,61,244,61,245,201,122,200 +.byte 151,151,102,151,204,241,51,91,151,151,102,151,204,241,51,91 +.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +.byte 207,207,27,207,54,212,131,249,207,207,27,207,54,212,131,249 +.byte 43,43,172,43,69,135,86,110,43,43,172,43,69,135,86,110 +.byte 118,118,197,118,151,179,236,225,118,118,197,118,151,179,236,225 +.byte 130,130,50,130,100,176,25,230,130,130,50,130,100,176,25,230 +.byte 214,214,127,214,254,169,177,40,214,214,127,214,254,169,177,40 +.byte 27,27,108,27,216,119,54,195,27,27,108,27,216,119,54,195 +.byte 181,181,238,181,193,91,119,116,181,181,238,181,193,91,119,116 +.byte 175,175,134,175,17,41,67,190,175,175,134,175,17,41,67,190 +.byte 106,106,181,106,119,223,212,29,106,106,181,106,119,223,212,29 +.byte 80,80,93,80,186,13,160,234,80,80,93,80,186,13,160,234 +.byte 69,69,9,69,18,76,138,87,69,69,9,69,18,76,138,87 +.byte 243,243,235,243,203,24,251,56,243,243,235,243,203,24,251,56 +.byte 48,48,192,48,157,240,96,173,48,48,192,48,157,240,96,173 +.byte 239,239,155,239,43,116,195,196,239,239,155,239,43,116,195,196 +.byte 63,63,252,63,229,195,126,218,63,63,252,63,229,195,126,218 +.byte 85,85,73,85,146,28,170,199,85,85,73,85,146,28,170,199 +.byte 162,162,178,162,121,16,89,219,162,162,178,162,121,16,89,219 +.byte 234,234,143,234,3,101,201,233,234,234,143,234,3,101,201,233 +.byte 101,101,137,101,15,236,202,106,101,101,137,101,15,236,202,106 +.byte 186,186,210,186,185,104,105,3,186,186,210,186,185,104,105,3 +.byte 47,47,188,47,101,147,94,74,47,47,188,47,101,147,94,74 +.byte 192,192,39,192,78,231,157,142,192,192,39,192,78,231,157,142 +.byte 222,222,95,222,190,129,161,96,222,222,95,222,190,129,161,96 +.byte 28,28,112,28,224,108,56,252,28,28,112,28,224,108,56,252 +.byte 253,253,211,253,187,46,231,70,253,253,211,253,187,46,231,70 +.byte 77,77,41,77,82,100,154,31,77,77,41,77,82,100,154,31 +.byte 146,146,114,146,228,224,57,118,146,146,114,146,228,224,57,118 +.byte 117,117,201,117,143,188,234,250,117,117,201,117,143,188,234,250 +.byte 6,6,24,6,48,30,12,54,6,6,24,6,48,30,12,54 +.byte 138,138,18,138,36,152,9,174,138,138,18,138,36,152,9,174 +.byte 178,178,242,178,249,64,121,75,178,178,242,178,249,64,121,75 +.byte 230,230,191,230,99,89,209,133,230,230,191,230,99,89,209,133 +.byte 14,14,56,14,112,54,28,126,14,14,56,14,112,54,28,126 +.byte 31,31,124,31,248,99,62,231,31,31,124,31,248,99,62,231 +.byte 98,98,149,98,55,247,196,85,98,98,149,98,55,247,196,85 +.byte 212,212,119,212,238,163,181,58,212,212,119,212,238,163,181,58 +.byte 168,168,154,168,41,50,77,129,168,168,154,168,41,50,77,129 +.byte 150,150,98,150,196,244,49,82,150,150,98,150,196,244,49,82 +.byte 249,249,195,249,155,58,239,98,249,249,195,249,155,58,239,98 +.byte 197,197,51,197,102,246,151,163,197,197,51,197,102,246,151,163 +.byte 37,37,148,37,53,177,74,16,37,37,148,37,53,177,74,16 +.byte 89,89,121,89,242,32,178,171,89,89,121,89,242,32,178,171 +.byte 132,132,42,132,84,174,21,208,132,132,42,132,84,174,21,208 +.byte 114,114,213,114,183,167,228,197,114,114,213,114,183,167,228,197 +.byte 57,57,228,57,213,221,114,236,57,57,228,57,213,221,114,236 +.byte 76,76,45,76,90,97,152,22,76,76,45,76,90,97,152,22 +.byte 94,94,101,94,202,59,188,148,94,94,101,94,202,59,188,148 +.byte 120,120,253,120,231,133,240,159,120,120,253,120,231,133,240,159 +.byte 56,56,224,56,221,216,112,229,56,56,224,56,221,216,112,229 +.byte 140,140,10,140,20,134,5,152,140,140,10,140,20,134,5,152 +.byte 209,209,99,209,198,178,191,23,209,209,99,209,198,178,191,23 +.byte 165,165,174,165,65,11,87,228,165,165,174,165,65,11,87,228 +.byte 226,226,175,226,67,77,217,161,226,226,175,226,67,77,217,161 +.byte 97,97,153,97,47,248,194,78,97,97,153,97,47,248,194,78 +.byte 179,179,246,179,241,69,123,66,179,179,246,179,241,69,123,66 +.byte 33,33,132,33,21,165,66,52,33,33,132,33,21,165,66,52 +.byte 156,156,74,156,148,214,37,8,156,156,74,156,148,214,37,8 +.byte 30,30,120,30,240,102,60,238,30,30,120,30,240,102,60,238 +.byte 67,67,17,67,34,82,134,97,67,67,17,67,34,82,134,97 +.byte 199,199,59,199,118,252,147,177,199,199,59,199,118,252,147,177 +.byte 252,252,215,252,179,43,229,79,252,252,215,252,179,43,229,79 +.byte 4,4,16,4,32,20,8,36,4,4,16,4,32,20,8,36 +.byte 81,81,89,81,178,8,162,227,81,81,89,81,178,8,162,227 +.byte 153,153,94,153,188,199,47,37,153,153,94,153,188,199,47,37 +.byte 109,109,169,109,79,196,218,34,109,109,169,109,79,196,218,34 +.byte 13,13,52,13,104,57,26,101,13,13,52,13,104,57,26,101 +.byte 250,250,207,250,131,53,233,121,250,250,207,250,131,53,233,121 +.byte 223,223,91,223,182,132,163,105,223,223,91,223,182,132,163,105 +.byte 126,126,229,126,215,155,252,169,126,126,229,126,215,155,252,169 +.byte 36,36,144,36,61,180,72,25,36,36,144,36,61,180,72,25 +.byte 59,59,236,59,197,215,118,254,59,59,236,59,197,215,118,254 +.byte 171,171,150,171,49,61,75,154,171,171,150,171,49,61,75,154 +.byte 206,206,31,206,62,209,129,240,206,206,31,206,62,209,129,240 +.byte 17,17,68,17,136,85,34,153,17,17,68,17,136,85,34,153 +.byte 143,143,6,143,12,137,3,131,143,143,6,143,12,137,3,131 +.byte 78,78,37,78,74,107,156,4,78,78,37,78,74,107,156,4 +.byte 183,183,230,183,209,81,115,102,183,183,230,183,209,81,115,102 +.byte 235,235,139,235,11,96,203,224,235,235,139,235,11,96,203,224 +.byte 60,60,240,60,253,204,120,193,60,60,240,60,253,204,120,193 +.byte 129,129,62,129,124,191,31,253,129,129,62,129,124,191,31,253 +.byte 148,148,106,148,212,254,53,64,148,148,106,148,212,254,53,64 +.byte 247,247,251,247,235,12,243,28,247,247,251,247,235,12,243,28 +.byte 185,185,222,185,161,103,111,24,185,185,222,185,161,103,111,24 +.byte 19,19,76,19,152,95,38,139,19,19,76,19,152,95,38,139 +.byte 44,44,176,44,125,156,88,81,44,44,176,44,125,156,88,81 +.byte 211,211,107,211,214,184,187,5,211,211,107,211,214,184,187,5 +.byte 231,231,187,231,107,92,211,140,231,231,187,231,107,92,211,140 +.byte 110,110,165,110,87,203,220,57,110,110,165,110,87,203,220,57 +.byte 196,196,55,196,110,243,149,170,196,196,55,196,110,243,149,170 +.byte 3,3,12,3,24,15,6,27,3,3,12,3,24,15,6,27 +.byte 86,86,69,86,138,19,172,220,86,86,69,86,138,19,172,220 +.byte 68,68,13,68,26,73,136,94,68,68,13,68,26,73,136,94 +.byte 127,127,225,127,223,158,254,160,127,127,225,127,223,158,254,160 +.byte 169,169,158,169,33,55,79,136,169,169,158,169,33,55,79,136 +.byte 42,42,168,42,77,130,84,103,42,42,168,42,77,130,84,103 +.byte 187,187,214,187,177,109,107,10,187,187,214,187,177,109,107,10 +.byte 193,193,35,193,70,226,159,135,193,193,35,193,70,226,159,135 +.byte 83,83,81,83,162,2,166,241,83,83,81,83,162,2,166,241 +.byte 220,220,87,220,174,139,165,114,220,220,87,220,174,139,165,114 +.byte 11,11,44,11,88,39,22,83,11,11,44,11,88,39,22,83 +.byte 157,157,78,157,156,211,39,1,157,157,78,157,156,211,39,1 +.byte 108,108,173,108,71,193,216,43,108,108,173,108,71,193,216,43 +.byte 49,49,196,49,149,245,98,164,49,49,196,49,149,245,98,164 +.byte 116,116,205,116,135,185,232,243,116,116,205,116,135,185,232,243 +.byte 246,246,255,246,227,9,241,21,246,246,255,246,227,9,241,21 +.byte 70,70,5,70,10,67,140,76,70,70,5,70,10,67,140,76 +.byte 172,172,138,172,9,38,69,165,172,172,138,172,9,38,69,165 +.byte 137,137,30,137,60,151,15,181,137,137,30,137,60,151,15,181 +.byte 20,20,80,20,160,68,40,180,20,20,80,20,160,68,40,180 +.byte 225,225,163,225,91,66,223,186,225,225,163,225,91,66,223,186 +.byte 22,22,88,22,176,78,44,166,22,22,88,22,176,78,44,166 +.byte 58,58,232,58,205,210,116,247,58,58,232,58,205,210,116,247 +.byte 105,105,185,105,111,208,210,6,105,105,185,105,111,208,210,6 +.byte 9,9,36,9,72,45,18,65,9,9,36,9,72,45,18,65 +.byte 112,112,221,112,167,173,224,215,112,112,221,112,167,173,224,215 +.byte 182,182,226,182,217,84,113,111,182,182,226,182,217,84,113,111 +.byte 208,208,103,208,206,183,189,30,208,208,103,208,206,183,189,30 +.byte 237,237,147,237,59,126,199,214,237,237,147,237,59,126,199,214 +.byte 204,204,23,204,46,219,133,226,204,204,23,204,46,219,133,226 +.byte 66,66,21,66,42,87,132,104,66,66,21,66,42,87,132,104 +.byte 152,152,90,152,180,194,45,44,152,152,90,152,180,194,45,44 +.byte 164,164,170,164,73,14,85,237,164,164,170,164,73,14,85,237 +.byte 40,40,160,40,93,136,80,117,40,40,160,40,93,136,80,117 +.byte 92,92,109,92,218,49,184,134,92,92,109,92,218,49,184,134 +.byte 248,248,199,248,147,63,237,107,248,248,199,248,147,63,237,107 +.byte 134,134,34,134,68,164,17,194,134,134,34,134,68,164,17,194 +.byte 24,35,198,232,135,184,1,79 +.byte 54,166,210,245,121,111,145,82 +.byte 96,188,155,142,163,12,123,53 +.byte 29,224,215,194,46,75,254,87 +.byte 21,119,55,229,159,240,74,218 +.byte 88,201,41,10,177,160,107,133 +.byte 189,93,16,244,203,62,5,103 +.byte 228,39,65,139,167,125,149,216 +.byte 251,238,124,102,221,23,71,158 +.byte 202,45,191,7,173,90,131,51 diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c index 01a302b5..04eada8a 100644 --- a/crypto/x509/by_dir.c +++ b/crypto/x509/by_dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: by_dir.c,v 1.38 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: by_dir.c,v 1.39 2018/08/05 14:17:12 bcook Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -103,7 +103,7 @@ static X509_LOOKUP_METHOD x509_dir_lookup = { .name = "Load certs from files in a directory", .new_item = new_dir, .free = free_dir, - .init = NULL, + .init = NULL, .shutdown = NULL, .ctrl = dir_ctrl, .get_by_subject = get_cert_by_subject, @@ -316,7 +316,7 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, X509error(ERR_R_MALLOC_FAILURE); goto finish; } - if (type == X509_LU_CRL && ent->hashes) { + if (type == X509_LU_CRL) { htmp.hash = h; CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE); idx = sk_BY_DIR_HASH_find(ent->hashes, &htmp); diff --git a/crypto/x509/vpm_int.h b/crypto/x509/vpm_int.h index 6c8061c8..7fc9fef7 100644 --- a/crypto/x509/vpm_int.h +++ b/crypto/x509/vpm_int.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vpm_int.h,v 1.3 2016/12/21 15:49:29 jsing Exp $ */ +/* $OpenBSD: vpm_int.h,v 1.4 2018/04/06 07:08:20 beck Exp $ */ /* * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project * 2013. @@ -69,6 +69,7 @@ struct X509_VERIFY_PARAM_ID_st { size_t emaillen; unsigned char *ip; /* If not NULL IP address to match */ size_t iplen; /* Length of IP address */ + int poisoned; }; __END_HIDDEN_DECLS diff --git a/crypto/x509/x509_att.c b/crypto/x509/x509_att.c index 7304118e..1479b918 100644 --- a/crypto/x509/x509_att.c +++ b/crypto/x509/x509_att.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_att.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: x509_att.c,v 1.17 2018/05/18 19:21:33 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -84,8 +84,8 @@ X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, int lastpos) } int -X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj, - int lastpos) +X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, + const ASN1_OBJECT *obj, int lastpos) { int n; X509_ATTRIBUTE *ex; @@ -205,7 +205,7 @@ X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, const char *attrname, } void * -X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, ASN1_OBJECT *obj, +X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, const ASN1_OBJECT *obj, int lastpos, int type) { int i; @@ -353,7 +353,7 @@ X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, } int -X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr) +X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr) { if (!attr->single) return sk_ASN1_TYPE_num(attr->value.set); diff --git a/crypto/x509/x509_cmp.c b/crypto/x509/x509_cmp.c index 72fbef15..6d6e8408 100644 --- a/crypto/x509/x509_cmp.c +++ b/crypto/x509/x509_cmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_cmp.c,v 1.27 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: x509_cmp.c,v 1.35 2019/03/13 20:34:00 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -76,7 +76,7 @@ X509_issuer_and_serial_cmp(const X509 *a, const X509 *b) ai = a->cert_info; bi = b->cert_info; - i = ASN1_STRING_cmp(ai->serialNumber, bi->serialNumber); + i = ASN1_INTEGER_cmp(ai->serialNumber, bi->serialNumber); if (i) return (i); return (X509_NAME_cmp(ai->issuer, bi->issuer)); @@ -145,7 +145,7 @@ X509_CRL_match(const X509_CRL *a, const X509_CRL *b) #endif X509_NAME * -X509_get_issuer_name(X509 *a) +X509_get_issuer_name(const X509 *a) { return (a->cert_info->issuer); } @@ -165,7 +165,7 @@ X509_issuer_name_hash_old(X509 *x) #endif X509_NAME * -X509_get_subject_name(X509 *a) +X509_get_subject_name(const X509 *a) { return (a->cert_info->subject); } @@ -176,6 +176,12 @@ X509_get_serialNumber(X509 *a) return (a->cert_info->serialNumber); } +const ASN1_INTEGER * +X509_get0_serialNumber(const X509 *a) +{ + return (a->cert_info->serialNumber); +} + unsigned long X509_subject_name_hash(X509 *x) { @@ -321,11 +327,19 @@ X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name) EVP_PKEY * X509_get_pubkey(X509 *x) { - if ((x == NULL) || (x->cert_info == NULL)) + if (x == NULL || x->cert_info == NULL) return (NULL); return (X509_PUBKEY_get(x->cert_info->key)); } +EVP_PKEY * +X509_get0_pubkey(const X509 *x) +{ + if (x == NULL || x->cert_info == NULL) + return (NULL); + return (X509_PUBKEY_get0(x->cert_info->key)); +} + ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x) { @@ -335,12 +349,12 @@ X509_get0_pubkey_bitstr(const X509 *x) } int -X509_check_private_key(X509 *x, EVP_PKEY *k) +X509_check_private_key(const X509 *x, const EVP_PKEY *k) { - EVP_PKEY *xk; + const EVP_PKEY *xk; int ret; - xk = X509_get_pubkey(x); + xk = X509_get0_pubkey(x); if (xk) ret = EVP_PKEY_cmp(xk, k); @@ -359,8 +373,25 @@ X509_check_private_key(X509 *x, EVP_PKEY *k) case -2: X509error(X509_R_UNKNOWN_KEY_TYPE); } - EVP_PKEY_free(xk); if (ret > 0) return 1; return 0; } + +/* + * Not strictly speaking an "up_ref" as a STACK doesn't have a reference + * count but it has the same effect by duping the STACK and upping the ref of + * each X509 structure. + */ +STACK_OF(X509) * +X509_chain_up_ref(STACK_OF(X509) *chain) +{ + STACK_OF(X509) *ret; + size_t i; + + ret = sk_X509_dup(chain); + for (i = 0; i < sk_X509_num(ret); i++) + X509_up_ref(sk_X509_value(ret, i)); + + return ret; +} diff --git a/crypto/x509/x509_ext.c b/crypto/x509/x509_ext.c index e90befab..21374a26 100644 --- a/crypto/x509/x509_ext.c +++ b/crypto/x509/x509_ext.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_ext.c,v 1.9 2015/02/10 08:33:10 jsing Exp $ */ +/* $OpenBSD: x509_ext.c,v 1.12 2018/05/18 19:28:27 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -66,31 +66,31 @@ #include int -X509_CRL_get_ext_count(X509_CRL *x) +X509_CRL_get_ext_count(const X509_CRL *x) { return (X509v3_get_ext_count(x->crl->extensions)); } int -X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos) +X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos) { return (X509v3_get_ext_by_NID(x->crl->extensions, nid, lastpos)); } int -X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos) +X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj, int lastpos) { return (X509v3_get_ext_by_OBJ(x->crl->extensions, obj, lastpos)); } int -X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos) +X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos) { return (X509v3_get_ext_by_critical(x->crl->extensions, crit, lastpos)); } X509_EXTENSION * -X509_CRL_get_ext(X509_CRL *x, int loc) +X509_CRL_get_ext(const X509_CRL *x, int loc) { return (X509v3_get_ext(x->crl->extensions, loc)); } @@ -102,7 +102,7 @@ X509_CRL_delete_ext(X509_CRL *x, int loc) } void * -X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx) +X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); } @@ -121,32 +121,32 @@ X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc) } int -X509_get_ext_count(X509 *x) +X509_get_ext_count(const X509 *x) { return (X509v3_get_ext_count(x->cert_info->extensions)); } int -X509_get_ext_by_NID(X509 *x, int nid, int lastpos) +X509_get_ext_by_NID(const X509 *x, int nid, int lastpos) { return (X509v3_get_ext_by_NID(x->cert_info->extensions, nid, lastpos)); } int -X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos) +X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos) { return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos)); } int -X509_get_ext_by_critical(X509 *x, int crit, int lastpos) +X509_get_ext_by_critical(const X509 *x, int crit, int lastpos) { return (X509v3_get_ext_by_critical(x->cert_info->extensions, crit, lastpos)); } X509_EXTENSION * -X509_get_ext(X509 *x, int loc) +X509_get_ext(const X509 *x, int loc) { return (X509v3_get_ext(x->cert_info->extensions, loc)); } @@ -164,7 +164,7 @@ X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc) } void * -X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx) +X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); } @@ -177,31 +177,32 @@ X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, unsigned long flags) } int -X509_REVOKED_get_ext_count(X509_REVOKED *x) +X509_REVOKED_get_ext_count(const X509_REVOKED *x) { return (X509v3_get_ext_count(x->extensions)); } int -X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos) +X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, int lastpos) { return (X509v3_get_ext_by_NID(x->extensions, nid, lastpos)); } int -X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj, int lastpos) +X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj, + int lastpos) { return (X509v3_get_ext_by_OBJ(x->extensions, obj, lastpos)); } int -X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos) +X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit, int lastpos) { return (X509v3_get_ext_by_critical(x->extensions, crit, lastpos)); } X509_EXTENSION * -X509_REVOKED_get_ext(X509_REVOKED *x, int loc) +X509_REVOKED_get_ext(const X509_REVOKED *x, int loc) { return (X509v3_get_ext(x->extensions, loc)); } @@ -219,7 +220,7 @@ X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc) } void * -X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx) +X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->extensions, nid, crit, idx); } diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c index 6cde29fe..f21103c7 100644 --- a/crypto/x509/x509_lu.c +++ b/crypto/x509/x509_lu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_lu.c,v 1.23 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: x509_lu.c,v 1.30 2018/08/24 19:21:09 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -65,7 +65,6 @@ #include "x509_lcl.h" static void X509_OBJECT_dec_ref_count(X509_OBJECT *a); -/* static void X509_OBJECT_up_ref_count(X509_OBJECT *a); */ X509_LOOKUP * X509_LOOKUP_new(X509_LOOKUP_METHOD *method) @@ -154,8 +153,8 @@ X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, } int -X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, unsigned char *bytes, - int len, X509_OBJECT *ret) +X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, + const unsigned char *bytes, int len, X509_OBJECT *ret) { if ((ctx->method == NULL) || (ctx->method->get_by_fingerprint == NULL)) return X509_LU_FAIL; @@ -163,7 +162,7 @@ X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, unsigned char *bytes, } int -X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len, +X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, const char *str, int len, X509_OBJECT *ret) { if ((ctx->method == NULL) || (ctx->method->get_by_alias == NULL)) @@ -268,6 +267,13 @@ X509_STORE_free(X509_STORE *vfy) free(vfy); } +int +X509_STORE_up_ref(X509_STORE *x) +{ + int refs = CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509_STORE); + return (refs > 1) ? 1 : 0; +} + X509_LOOKUP * X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) { @@ -438,17 +444,22 @@ X509_OBJECT_dec_ref_count(X509_OBJECT *a) } } -/*static*/ void +int X509_OBJECT_up_ref_count(X509_OBJECT *a) { switch (a->type) { case X509_LU_X509: - CRYPTO_add(&a->data.x509->references, 1, CRYPTO_LOCK_X509); - break; + return X509_up_ref(a->data.x509); case X509_LU_CRL: - CRYPTO_add(&a->data.crl->references, 1, CRYPTO_LOCK_X509_CRL); - break; + return X509_CRL_up_ref(a->data.crl); } + return 1; +} + +int +X509_OBJECT_get_type(const X509_OBJECT *a) +{ + return a->type; } void @@ -526,6 +537,22 @@ X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, int type, return sk_X509_OBJECT_value(h, idx); } +X509 * +X509_OBJECT_get0_X509(const X509_OBJECT *xo) +{ + if (xo != NULL && xo->type == X509_LU_X509) + return xo->data.x509; + return NULL; +} + +X509_CRL * +X509_OBJECT_get0_X509_CRL(X509_OBJECT *xo) +{ + if (xo != NULL && xo->type == X509_LU_CRL) + return xo->data.crl; + return NULL; +} + STACK_OF(X509) * X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm) { @@ -649,7 +676,6 @@ X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x) return NULL; } - /* Try to get issuer certificate from store. Due to limitations * of the API this can only retrieve a single certificate matching * a given subject name. However it will fill the cache with all @@ -726,6 +752,24 @@ X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) return ret; } +STACK_OF(X509_OBJECT) * +X509_STORE_get0_objects(X509_STORE *xs) +{ + return xs->objs; +} + +void * +X509_STORE_get_ex_data(X509_STORE *xs, int idx) +{ + return CRYPTO_get_ex_data(&xs->ex_data, idx); +} + +int +X509_STORE_set_ex_data(X509_STORE *xs, int idx, void *data) +{ + return CRYPTO_set_ex_data(&xs->ex_data, idx, data); +} + int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags) { @@ -757,6 +801,12 @@ X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *param) return X509_VERIFY_PARAM_set1(ctx->param, param); } +X509_VERIFY_PARAM * +X509_STORE_get0_param(X509_STORE *ctx) +{ + return ctx->param; +} + void X509_STORE_set_verify_cb(X509_STORE *ctx, int (*verify_cb)(int, X509_STORE_CTX *)) diff --git a/crypto/x509/x509_obj.c b/crypto/x509/x509_obj.c index b34f25b0..5c537990 100644 --- a/crypto/x509/x509_obj.c +++ b/crypto/x509/x509_obj.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_obj.c,v 1.17 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: x509_obj.c,v 1.18 2018/05/18 18:19:31 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -66,7 +66,7 @@ #include char * -X509_NAME_oneline(X509_NAME *a, char *buf, int len) +X509_NAME_oneline(const X509_NAME *a, char *buf, int len) { X509_NAME_ENTRY *ne; int i; diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c index f87b35c7..b44306b0 100644 --- a/crypto/x509/x509_req.c +++ b/crypto/x509/x509_req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_req.c,v 1.20 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: x509_req.c,v 1.21 2018/05/13 06:48:00 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -286,7 +286,8 @@ X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos) } int -X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, int lastpos) +X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, + int lastpos) { return X509at_get_attr_by_OBJ(req->req_info->attributes, obj, lastpos); } diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c index aeaf1610..1a4b583a 100644 --- a/crypto/x509/x509_set.c +++ b/crypto/x509/x509_set.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_set.c,v 1.12 2015/09/30 17:49:59 jsing Exp $ */ +/* $OpenBSD: x509_set.c,v 1.17 2018/08/24 19:55:58 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -63,6 +63,18 @@ #include #include +const STACK_OF(X509_EXTENSION) * +X509_get0_extensions(const X509 *x) +{ + return x->cert_info->extensions; +} + +const X509_ALGOR * +X509_get0_tbs_sigalg(const X509 *x) +{ + return x->cert_info->signature; +} + int X509_set_version(X509 *x, long version) { @@ -75,6 +87,12 @@ X509_set_version(X509 *x, long version) return (ASN1_INTEGER_set(x->cert_info->version, version)); } +long +X509_get_version(const X509 *x) +{ + return ASN1_INTEGER_get(x->cert_info->version); +} + int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) { @@ -104,17 +122,31 @@ X509_set_issuer_name(X509 *x, X509_NAME *name) int X509_set_subject_name(X509 *x, X509_NAME *name) { - if ((x == NULL) || (x->cert_info == NULL)) + if (x == NULL || x->cert_info == NULL) return (0); return (X509_NAME_set(&x->cert_info->subject, name)); } +const ASN1_TIME * +X509_get0_notBefore(const X509 *x) +{ + return X509_getm_notBefore(x); +} + +ASN1_TIME * +X509_getm_notBefore(const X509 *x) +{ + if (x == NULL || x->cert_info == NULL || x->cert_info->validity == NULL) + return (NULL); + return x->cert_info->validity->notBefore; +} + int X509_set_notBefore(X509 *x, const ASN1_TIME *tm) { ASN1_TIME *in; - if ((x == NULL) || (x->cert_info->validity == NULL)) + if (x == NULL || x->cert_info->validity == NULL) return (0); in = x->cert_info->validity->notBefore; if (in != tm) { @@ -127,12 +159,32 @@ X509_set_notBefore(X509 *x, const ASN1_TIME *tm) return (in != NULL); } +int +X509_set1_notBefore(X509 *x, const ASN1_TIME *tm) +{ + return X509_set_notBefore(x, tm); +} + +const ASN1_TIME * +X509_get0_notAfter(const X509 *x) +{ + return X509_getm_notAfter(x); +} + +ASN1_TIME * +X509_getm_notAfter(const X509 *x) +{ + if (x == NULL || x->cert_info == NULL || x->cert_info->validity == NULL) + return (NULL); + return x->cert_info->validity->notAfter; +} + int X509_set_notAfter(X509 *x, const ASN1_TIME *tm) { ASN1_TIME *in; - if ((x == NULL) || (x->cert_info->validity == NULL)) + if (x == NULL || x->cert_info->validity == NULL) return (0); in = x->cert_info->validity->notAfter; if (in != tm) { @@ -145,6 +197,12 @@ X509_set_notAfter(X509 *x, const ASN1_TIME *tm) return (in != NULL); } +int +X509_set1_notAfter(X509 *x, const ASN1_TIME *tm) +{ + return X509_set_notAfter(x, tm); +} + int X509_set_pubkey(X509 *x, EVP_PKEY *pkey) { @@ -152,3 +210,9 @@ X509_set_pubkey(X509 *x, EVP_PKEY *pkey) return (0); return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); } + +int +X509_get_signature_type(const X509 *x) +{ + return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg->algorithm)); +} diff --git a/crypto/x509/x509_trs.c b/crypto/x509/x509_trs.c index 9af74de1..651dc82a 100644 --- a/crypto/x509/x509_trs.c +++ b/crypto/x509/x509_trs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_trs.c,v 1.22 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: x509_trs.c,v 1.23 2018/05/18 18:40:38 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -187,7 +187,7 @@ X509_TRUST_set(int *t, int trust) int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), - char *name, int arg1, void *arg2) + const char *name, int arg1, void *arg2) { int idx; X509_TRUST *trtmp; @@ -274,19 +274,19 @@ X509_TRUST_cleanup(void) } int -X509_TRUST_get_flags(X509_TRUST *xp) +X509_TRUST_get_flags(const X509_TRUST *xp) { return xp->flags; } char * -X509_TRUST_get0_name(X509_TRUST *xp) +X509_TRUST_get0_name(const X509_TRUST *xp) { return xp->name; } int -X509_TRUST_get_trust(X509_TRUST *xp) +X509_TRUST_get_trust(const X509_TRUST *xp) { return xp->trust; } diff --git a/crypto/x509/x509_v3.c b/crypto/x509/x509_v3.c index 446ef319..524d5511 100644 --- a/crypto/x509/x509_v3.c +++ b/crypto/x509/x509_v3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_v3.c,v 1.14 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: x509_v3.c,v 1.17 2018/05/19 10:54:40 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -86,8 +86,8 @@ X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid, int lastpos) } int -X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, ASN1_OBJECT *obj, - int lastpos) +X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, + const ASN1_OBJECT *obj, int lastpos) { int n; X509_EXTENSION *ex; @@ -209,8 +209,8 @@ X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit, } X509_EXTENSION * -X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, ASN1_OBJECT *obj, int crit, - ASN1_OCTET_STRING *data) +X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, const ASN1_OBJECT *obj, + int crit, ASN1_OCTET_STRING *data) { X509_EXTENSION *ret; @@ -240,7 +240,7 @@ X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, ASN1_OBJECT *obj, int crit, } int -X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj) +X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj) { if ((ex == NULL) || (obj == NULL)) return (0); @@ -288,7 +288,7 @@ X509_EXTENSION_get_data(X509_EXTENSION *ex) } int -X509_EXTENSION_get_critical(X509_EXTENSION *ex) +X509_EXTENSION_get_critical(const X509_EXTENSION *ex) { if (ex == NULL) return (0); diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index 8efff680..ea35ce79 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vfy.c,v 1.66 2017/08/27 01:39:26 beck Exp $ */ +/* $OpenBSD: x509_vfy.c,v 1.72 2019/03/06 05:06:58 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -159,7 +159,7 @@ x509_subject_cmp(X509 **a, X509 **b) } #endif -/* Return 1 is a certificate is self signed */ +/* Return 1 if a certificate is self signed */ static int cert_self_signed(X509 *x) { @@ -182,10 +182,10 @@ check_id_error(X509_STORE_CTX *ctx, int errcode) static int check_hosts(X509 *x, X509_VERIFY_PARAM_ID *id) { - size_t i; - size_t n = sk_OPENSSL_STRING_num(id->hosts); + size_t i, n; char *name; + n = sk_OPENSSL_STRING_num(id->hosts); free(id->peername); id->peername = NULL; @@ -246,6 +246,15 @@ X509_verify_cert(X509_STORE_CTX *ctx) ctx->error = X509_V_ERR_INVALID_CALL; return -1; } + if (ctx->param->id->poisoned) { + /* + * This X509_STORE_CTX had failures setting + * up verify parameters. We can not use it. + */ + X509error(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + ctx->error = X509_V_ERR_INVALID_CALL; + return -1; + } if (ctx->error != X509_V_ERR_INVALID_CALL) { /* * This X509_STORE_CTX has not been properly initialized. @@ -487,9 +496,10 @@ X509_verify_cert(X509_STORE_CTX *ctx) ctx->current_cert = x; } else { if (!sk_X509_push(ctx->chain, chain_ss)) { - X509_free(chain_ss); X509error(ERR_R_MALLOC_FAILURE); - return 0; + ctx->error = X509_V_ERR_OUT_OF_MEM; + ok = 0; + goto end; } num++; ctx->last_untrusted = num; @@ -539,8 +549,7 @@ X509_verify_cert(X509_STORE_CTX *ctx) ok = ctx->check_policy(ctx); end: - if (sktmp != NULL) - sk_X509_free(sktmp); + sk_X509_free(sktmp); X509_free(chain_ss); /* Safety net, error returns must set ctx->error */ @@ -2023,12 +2032,20 @@ X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx) return ctx->current_cert; } -STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) +STACK_OF(X509) * +X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) { return ctx->chain; } -STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx) +STACK_OF(X509) * +X509_STORE_CTX_get0_chain(X509_STORE_CTX *xs) +{ + return xs->chain; +} + +STACK_OF(X509) * +X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx) { int i; X509 *x; @@ -2061,6 +2078,12 @@ X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx) return ctx->parent; } +X509_STORE * +X509_STORE_CTX_get0_store(X509_STORE_CTX *xs) +{ + return xs->ctx; +} + void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *x) { @@ -2301,6 +2324,12 @@ X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) ctx->get_issuer = get_issuer_sk; } +void +X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) +{ + X509_STORE_CTX_trusted_stack(ctx, sk); +} + void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx) { @@ -2349,6 +2378,24 @@ X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, ctx->verify_cb = verify_cb; } +X509 * +X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx) +{ + return ctx->cert; +} + +STACK_OF(X509) * +X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx) +{ + return ctx->untrusted; +} + +void +X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) +{ + ctx->untrusted = sk; +} + X509_POLICY_TREE * X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx) { diff --git a/crypto/x509/x509_vpm.c b/crypto/x509/x509_vpm.c index 34822274..baebcf7b 100644 --- a/crypto/x509/x509_vpm.c +++ b/crypto/x509/x509_vpm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vpm.c,v 1.15 2016/12/21 15:15:45 jsing Exp $ */ +/* $OpenBSD: x509_vpm.c,v 1.18 2018/04/06 07:08:20 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2004. */ @@ -101,11 +101,11 @@ sk_deep_copy(void *sk_void, void *copy_func_void, void *free_func_void) void *(*copy_func)(void *) = copy_func_void; void (*free_func)(void *) = free_func_void; _STACK *ret = sk_dup(sk); + size_t i; if (ret == NULL) return NULL; - size_t i; for (i = 0; i < ret->num; i++) { if (ret->data[i] == NULL) continue; @@ -125,14 +125,15 @@ sk_deep_copy(void *sk_void, void *copy_func_void, void *free_func_void) } static int -int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, +x509_param_set_hosts_internal(X509_VERIFY_PARAM_ID *id, int mode, const char *name, size_t namelen) { char *copy; + if (name != NULL && namelen == 0) + namelen = strlen(name); /* * Refuse names with embedded NUL bytes. - * XXX: Do we need to push an error onto the error stack? */ if (name && memchr(name, '\0', namelen)) return 0; @@ -195,6 +196,7 @@ x509_verify_param_zero(X509_VERIFY_PARAM *param) free(paramid->ip); paramid->ip = NULL; paramid->iplen = 0; + paramid->poisoned = 0; } X509_VERIFY_PARAM * @@ -365,24 +367,28 @@ X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, const X509_VERIFY_PARAM *from) } static int -int_x509_param_set1(char **pdest, size_t *pdestlen, const char *src, - size_t srclen) +x509_param_set1_internal(char **pdest, size_t *pdestlen, const char *src, + size_t srclen, int nonul) { char *tmp; - if (src) { - if (srclen == 0) { - if ((tmp = strdup(src)) == NULL) - return 0; - srclen = strlen(src); - } else { - if ((tmp = malloc(srclen)) == NULL) - return 0; - memcpy(tmp, src, srclen); - } + + if (src == NULL) + return 0; + + if (srclen == 0) { + srclen = strlen(src); + if (srclen == 0) + return 0; + if ((tmp = strdup(src)) == NULL) + return 0; } else { - tmp = NULL; - srclen = 0; + if (nonul && memchr(src, '\0', srclen)) + return 0; + if ((tmp = malloc(srclen)) == NULL) + return 0; + memcpy(tmp, src, srclen); } + if (*pdest) free(*pdest); *pdest = tmp; @@ -503,14 +509,20 @@ int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen) { - return int_x509_param_set_hosts(param->id, SET_HOST, name, namelen); + if (x509_param_set_hosts_internal(param->id, SET_HOST, name, namelen)) + return 1; + param->id->poisoned = 1; + return 0; } int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen) { - return int_x509_param_set_hosts(param->id, ADD_HOST, name, namelen); + if (x509_param_set_hosts_internal(param->id, ADD_HOST, name, namelen)) + return 1; + param->id->poisoned = 1; + return 0; } void @@ -529,18 +541,25 @@ int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, const char *email, size_t emaillen) { - return int_x509_param_set1(¶m->id->email, ¶m->id->emaillen, - email, emaillen); + if (x509_param_set1_internal(¶m->id->email, ¶m->id->emaillen, + email, emaillen, 1)) + return 1; + param->id->poisoned = 1; + return 0; } int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, const unsigned char *ip, size_t iplen) { - if (iplen != 0 && iplen != 4 && iplen != 16) - return 0; - return int_x509_param_set1((char **)¶m->id->ip, ¶m->id->iplen, - (char *)ip, iplen); + if (iplen != 4 && iplen != 16) + goto err; + if (x509_param_set1_internal((char **)¶m->id->ip, ¶m->id->iplen, + (char *)ip, iplen, 0)) + return 1; + err: + param->id->poisoned = 1; + return 0; } int @@ -550,8 +569,6 @@ X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc) size_t iplen; iplen = (size_t)a2i_ipadd(ipout, ipasc); - if (iplen == 0) - return 0; return X509_VERIFY_PARAM_set1_ip(param, ipout, iplen); } diff --git a/crypto/x509/x509cset.c b/crypto/x509/x509cset.c index afc1f0f2..182dd8a9 100644 --- a/crypto/x509/x509cset.c +++ b/crypto/x509/x509cset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509cset.c,v 1.11 2015/09/30 17:49:59 jsing Exp $ */ +/* $OpenBSD: x509cset.c,v 1.14 2018/02/22 17:01:44 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -63,6 +63,13 @@ #include #include +int +X509_CRL_up_ref(X509_CRL *x) +{ + int refs = CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509_CRL); + return (refs > 1) ? 1 : 0; +} + int X509_CRL_set_version(X509_CRL *x, long version) { @@ -101,6 +108,12 @@ X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm) return (in != NULL); } +int +X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm) +{ + return X509_CRL_set_lastUpdate(x, tm); +} + int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm) { @@ -119,6 +132,12 @@ X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm) return (in != NULL); } +int +X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm) +{ + return X509_CRL_set_nextUpdate(x, tm); +} + int X509_CRL_sort(X509_CRL *c) { @@ -136,6 +155,24 @@ X509_CRL_sort(X509_CRL *c) return 1; } +const STACK_OF(X509_EXTENSION) * +X509_REVOKED_get0_extensions(const X509_REVOKED *x) +{ + return x->extensions; +} + +const ASN1_TIME * +X509_REVOKED_get0_revocationDate(const X509_REVOKED *x) +{ + return x->revocationDate; +} + +const ASN1_INTEGER * +X509_REVOKED_get0_serialNumber(const X509_REVOKED *x) +{ + return x->serialNumber; +} + int X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm) { diff --git a/crypto/x509/x509name.c b/crypto/x509/x509name.c index ef242ce0..3649d6ab 100644 --- a/crypto/x509/x509name.c +++ b/crypto/x509/x509name.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509name.c,v 1.14 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: x509name.c,v 1.26 2018/05/30 15:35:45 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -78,7 +78,7 @@ X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len) } int -X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, char *buf, +X509_NAME_get_text_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, char *buf, int len) { int i; @@ -99,7 +99,7 @@ X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, char *buf, } int -X509_NAME_entry_count(X509_NAME *name) +X509_NAME_entry_count(const X509_NAME *name) { if (name == NULL) return (0); @@ -107,7 +107,7 @@ X509_NAME_entry_count(X509_NAME *name) } int -X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos) +X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos) { ASN1_OBJECT *obj; @@ -119,7 +119,8 @@ X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos) /* NOTE: you should be passsing -1, not 0 as lastpos */ int -X509_NAME_get_index_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int lastpos) +X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj, + int lastpos) { int n; X509_NAME_ENTRY *ne; @@ -140,7 +141,7 @@ X509_NAME_get_index_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int lastpos) } X509_NAME_ENTRY * -X509_NAME_get_entry(X509_NAME *name, int loc) +X509_NAME_get_entry(const X509_NAME *name, int loc) { if (name == NULL || sk_X509_NAME_ENTRY_num(name->entries) <= loc || loc < 0) @@ -188,8 +189,8 @@ X509_NAME_delete_entry(X509_NAME *name, int loc) } int -X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, - unsigned char *bytes, int len, int loc, int set) +X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len, int loc, int set) { X509_NAME_ENTRY *ne; int ret; @@ -204,7 +205,7 @@ X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, - unsigned char *bytes, int len, int loc, int set) + const unsigned char *bytes, int len, int loc, int set) { X509_NAME_ENTRY *ne; int ret; @@ -235,7 +236,8 @@ X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, /* if set is -1, append to previous set, 0 'a new one', and 1, * prepend to the guy we are about to stomp on. */ int -X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, int set) +X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, + int set) { X509_NAME_ENTRY *new_name = NULL; int n, i, inc; @@ -249,17 +251,15 @@ X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, int set) loc = n; else if (loc < 0) loc = n; - + inc = (set == 0); name->modified = 1; if (set == -1) { if (loc == 0) { set = 0; inc = 1; - } else { + } else set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set; - inc = 0; - } } else /* if (set >= 0) */ { if (loc >= n) { if (loc != 0) @@ -268,10 +268,10 @@ X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, int set) set = 0; } else set = sk_X509_NAME_ENTRY_value(sk, loc)->set; - inc = (set == 0) ? 1 : 0; } - if ((new_name = X509_NAME_ENTRY_dup(ne)) == NULL) + /* OpenSSL has ASN1-generated X509_NAME_ENTRY_dup() without const. */ + if ((new_name = X509_NAME_ENTRY_dup((X509_NAME_ENTRY *)ne)) == NULL) goto err; new_name->set = set; if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) { @@ -281,7 +281,7 @@ X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, int set) if (inc) { n = sk_X509_NAME_ENTRY_num(sk); for (i = loc + 1; i < n; i++) - sk_X509_NAME_ENTRY_value(sk, i - 1)->set += 1; + sk_X509_NAME_ENTRY_value(sk, i)->set += 1; } return (1); @@ -311,7 +311,7 @@ X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, X509_NAME_ENTRY * X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type, - unsigned char *bytes, int len) + const unsigned char *bytes, int len) { ASN1_OBJECT *obj; X509_NAME_ENTRY *nentry; @@ -327,8 +327,8 @@ X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type, } X509_NAME_ENTRY * -X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, ASN1_OBJECT *obj, int type, - const unsigned char *bytes, int len) +X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, const ASN1_OBJECT *obj, + int type, const unsigned char *bytes, int len) { X509_NAME_ENTRY *ret; @@ -354,7 +354,7 @@ X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, ASN1_OBJECT *obj, int type, } int -X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj) +X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj) { if ((ne == NULL) || (obj == NULL)) { X509error(ERR_R_PASSED_NULL_PARAMETER); @@ -391,7 +391,7 @@ X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, } ASN1_OBJECT * -X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne) +X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne) { if (ne == NULL) return (NULL); @@ -399,9 +399,15 @@ X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne) } ASN1_STRING * -X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne) +X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne) { if (ne == NULL) return (NULL); return (ne->value); } + +int +X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne) +{ + return (ne->set); +} diff --git a/crypto/x509/x509rset.c b/crypto/x509/x509rset.c index cfac9776..de02a400 100644 --- a/crypto/x509/x509rset.c +++ b/crypto/x509/x509rset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509rset.c,v 1.6 2014/07/11 08:44:49 jsing Exp $ */ +/* $OpenBSD: x509rset.c,v 1.7 2018/08/24 19:55:58 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -71,6 +71,12 @@ X509_REQ_set_version(X509_REQ *x, long version) return (ASN1_INTEGER_set(x->req_info->version, version)); } +long +X509_REQ_get_version(const X509_REQ *x) +{ + return ASN1_INTEGER_get(x->req_info->version); +} + int X509_REQ_set_subject_name(X509_REQ *x, X509_NAME *name) { @@ -79,6 +85,12 @@ X509_REQ_set_subject_name(X509_REQ *x, X509_NAME *name) return (X509_NAME_set(&x->req_info->subject, name)); } +X509_NAME * +X509_REQ_get_subject_name(const X509_REQ *x) +{ + return x->req_info->subject; +} + int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey) { diff --git a/crypto/x509/x509type.c b/crypto/x509/x509type.c index d0dcffb2..315a5c23 100644 --- a/crypto/x509/x509type.c +++ b/crypto/x509/x509type.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509type.c,v 1.12 2015/06/13 08:38:10 doug Exp $ */ +/* $OpenBSD: x509type.c,v 1.13 2018/05/30 15:59:33 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -63,27 +63,22 @@ #include int -X509_certificate_type(X509 *x, EVP_PKEY *pkey) +X509_certificate_type(const X509 *x, const EVP_PKEY *pkey) { - EVP_PKEY *pk; + const EVP_PKEY *pk = pkey; int ret = 0, i; if (x == NULL) return (0); - if (pkey == NULL) - pk = X509_get_pubkey(x); - else - pk = pkey; - - if (pk == NULL) - return (0); + if (pk == NULL) { + if ((pk = X509_get0_pubkey(x)) == NULL) + return (0); + } switch (pk->type) { case EVP_PKEY_RSA: - ret = EVP_PK_RSA|EVP_PKT_SIGN; -/* if (!sign only extension) */ - ret |= EVP_PKT_ENC; + ret = EVP_PK_RSA|EVP_PKT_SIGN|EVP_PKT_ENC; break; case EVP_PKEY_DSA: ret = EVP_PK_DSA|EVP_PKT_SIGN; @@ -124,7 +119,5 @@ X509_certificate_type(X509 *x, EVP_PKEY *pkey) /* /8 because it's 1024 bits we look for, not bytes */ if (EVP_PKEY_size(pk) <= 1024 / 8) ret |= EVP_PKT_EXP; - if (pkey == NULL) - EVP_PKEY_free(pk); return (ret); } diff --git a/crypto/x509v3/v3_alt.c b/crypto/x509v3/v3_alt.c index 746339be..08063d19 100644 --- a/crypto/x509v3/v3_alt.c +++ b/crypto/x509v3/v3_alt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_alt.c,v 1.27 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: v3_alt.c,v 1.28 2018/05/18 19:34:37 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -69,8 +69,8 @@ static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p); static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens); -static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx); -static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx); +static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx); +static int do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx); const X509V3_EXT_METHOD v3_alt[] = { { @@ -481,7 +481,7 @@ v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, GENERAL_NAME * a2i_GENERAL_NAME(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, int gen_type, char *value, int is_nc) + X509V3_CTX *ctx, int gen_type, const char *value, int is_nc) { char is_string = 0; GENERAL_NAME *gen = NULL; @@ -553,8 +553,7 @@ a2i_GENERAL_NAME(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, if (is_string) { if (!(gen->d.ia5 = ASN1_IA5STRING_new()) || - !ASN1_STRING_set(gen->d.ia5, (unsigned char*)value, - strlen(value))) { + !ASN1_STRING_set(gen->d.ia5, value, strlen(value))) { X509V3error(ERR_R_MALLOC_FAILURE); goto err; } @@ -609,7 +608,7 @@ v2i_GENERAL_NAME_ex(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, } static int -do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) +do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx) { char *objtmp = NULL, *p; int objlen; @@ -638,7 +637,7 @@ do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) } static int -do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) +do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx) { int ret; STACK_OF(CONF_VALUE) *sk; diff --git a/crypto/x509v3/v3_conf.c b/crypto/x509v3/v3_conf.c index 27e1bc9f..78ff1980 100644 --- a/crypto/x509v3/v3_conf.c +++ b/crypto/x509v3/v3_conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_conf.c,v 1.21 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: v3_conf.c,v 1.23 2018/05/18 19:34:37 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -66,23 +66,27 @@ #include #include -static int v3_check_critical(char **value); -static int v3_check_generic(char **value); +static int v3_check_critical(const char **value); +static int v3_check_generic(const char **value); static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, - int crit, char *value); -static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, + int crit, const char *value); +static X509_EXTENSION *v3_generic_extension(const char *ext, const char *value, int crit, int type, X509V3_CTX *ctx); -static char *conf_lhash_get_string(void *db, char *section, char *value); -static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, char *section); +static char *conf_lhash_get_string(void *db, const char *section, + const char *value); +static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, + const char *section); static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit, void *ext_struc); -static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len); +static unsigned char *generic_asn1(const char *value, X509V3_CTX *ctx, + long *ext_len); /* CONF *conf: Config file */ /* char *name: Name */ /* char *value: Value */ X509_EXTENSION * -X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value) +X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, const char *name, + const char *value) { int crit; int ext_type; @@ -102,7 +106,8 @@ X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value) /* CONF *conf: Config file */ /* char *value: Value */ X509_EXTENSION * -X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value) +X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, + const char *value) { int crit; int ext_type; @@ -117,7 +122,8 @@ X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value) /* CONF *conf: Config file */ /* char *value: Value */ static X509_EXTENSION * -do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, int crit, char *value) +do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, int crit, + const char *value) { const X509V3_EXT_METHOD *method; X509_EXTENSION *ext; @@ -233,9 +239,9 @@ X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc) /* Check the extension string for critical flag */ static int -v3_check_critical(char **value) +v3_check_critical(const char **value) { - char *p = *value; + const char *p = *value; if ((strlen(p) < 9) || strncmp(p, "critical,", 9)) return 0; @@ -247,10 +253,10 @@ v3_check_critical(char **value) /* Check extension string for generic extension and return the type */ static int -v3_check_generic(char **value) +v3_check_generic(const char **value) { int gen_type = 0; - char *p = *value; + const char *p = *value; if ((strlen(p) >= 4) && !strncmp(p, "DER:", 4)) { p += 4; @@ -269,7 +275,7 @@ v3_check_generic(char **value) /* Create a generic extension: for now just handle DER type */ static X509_EXTENSION * -v3_generic_extension(const char *ext, char *value, int crit, int gen_type, +v3_generic_extension(const char *ext, const char *value, int crit, int gen_type, X509V3_CTX *ctx) { unsigned char *ext_der = NULL; @@ -318,7 +324,7 @@ v3_generic_extension(const char *ext, char *value, int crit, int gen_type, } static unsigned char * -generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len) +generic_asn1(const char *value, X509V3_CTX *ctx, long *ext_len) { ASN1_TYPE *typ; unsigned char *ext_der = NULL; @@ -336,7 +342,7 @@ generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len) */ int -X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, +X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, const char *section, STACK_OF(X509_EXTENSION) **sk) { X509_EXTENSION *ext; @@ -360,7 +366,8 @@ X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, /* Convenience functions to add extensions to a certificate, CRL and request */ int -X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509 *cert) +X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, + X509 *cert) { STACK_OF(X509_EXTENSION) **sk = NULL; @@ -372,7 +379,7 @@ X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509 *cert) /* Same as above but for a CRL */ int -X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, +X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, X509_CRL *crl) { STACK_OF(X509_EXTENSION) **sk = NULL; @@ -385,7 +392,7 @@ X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, /* Add extensions to certificate request */ int -X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, +X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, X509_REQ *req) { STACK_OF(X509_EXTENSION) *extlist = NULL, **sk = NULL; @@ -404,27 +411,23 @@ X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, /* Config database functions */ char * -X509V3_get_string(X509V3_CTX *ctx, char *name, char *section) +X509V3_get_string(X509V3_CTX *ctx, const char *name, const char *section) { if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_string) { X509V3error(X509V3_R_OPERATION_NOT_DEFINED); return NULL; } - if (ctx->db_meth->get_string) - return ctx->db_meth->get_string(ctx->db, name, section); - return NULL; + return ctx->db_meth->get_string(ctx->db, name, section); } STACK_OF(CONF_VALUE) * -X509V3_get_section(X509V3_CTX *ctx, char *section) +X509V3_get_section(X509V3_CTX *ctx, const char *section) { if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_section) { X509V3error(X509V3_R_OPERATION_NOT_DEFINED); return NULL; } - if (ctx->db_meth->get_section) - return ctx->db_meth->get_section(ctx->db, section); - return NULL; + return ctx->db_meth->get_section(ctx->db, section); } void @@ -446,13 +449,13 @@ X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section) } static char * -nconf_get_string(void *db, char *section, char *value) +nconf_get_string(void *db, const char *section, const char *value) { return NCONF_get_string(db, section, value); } -static -STACK_OF(CONF_VALUE) *nconf_get_section(void *db, char *section) +static STACK_OF(CONF_VALUE) * +nconf_get_section(void *db, const char *section) { return NCONF_get_section(db, section); } @@ -485,8 +488,8 @@ X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, /* Old conf compatibility functions */ X509_EXTENSION * -X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, char *name, - char *value) +X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, const char *name, + const char *value) { CONF ctmp; @@ -498,7 +501,7 @@ X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, char *name, /* char *value: Value */ X509_EXTENSION * X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, int ext_nid, - char *value) + const char *value) { CONF ctmp; @@ -507,13 +510,13 @@ X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, int ext_nid, } static char * -conf_lhash_get_string(void *db, char *section, char *value) +conf_lhash_get_string(void *db, const char *section, const char *value) { return CONF_get_string(db, section, value); } static STACK_OF(CONF_VALUE) * -conf_lhash_get_section(void *db, char *section) +conf_lhash_get_section(void *db, const char *section) { return CONF_get_section(db, section); } @@ -533,8 +536,8 @@ X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash) } int -X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, char *section, - X509 *cert) +X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, + const char *section, X509 *cert) { CONF ctmp; @@ -546,7 +549,7 @@ X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, char *section, int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *section, X509_CRL *crl) + const char *section, X509_CRL *crl) { CONF ctmp; @@ -558,7 +561,7 @@ X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *section, X509_REQ *req) + const char *section, X509_REQ *req) { CONF ctmp; diff --git a/crypto/x509v3/v3_enum.c b/crypto/x509v3/v3_enum.c index af6cebce..2ef3ea3e 100644 --- a/crypto/x509v3/v3_enum.c +++ b/crypto/x509v3/v3_enum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_enum.c,v 1.12 2016/12/30 15:54:49 jsing Exp $ */ +/* $OpenBSD: v3_enum.c,v 1.13 2018/05/19 10:37:02 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -93,7 +93,7 @@ const X509V3_EXT_METHOD v3_crl_reason = { }; char * -i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *e) +i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *e) { ENUMERATED_NAMES *enam; long strval; diff --git a/crypto/x509v3/v3_info.c b/crypto/x509v3/v3_info.c index 27b5415b..ebacbf5b 100644 --- a/crypto/x509v3/v3_info.c +++ b/crypto/x509v3/v3_info.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_info.c,v 1.25 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: v3_info.c,v 1.26 2018/05/19 10:37:02 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -293,7 +293,7 @@ v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, } int -i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION* a) +i2a_ACCESS_DESCRIPTION(BIO *bp, const ACCESS_DESCRIPTION* a) { i2a_ASN1_OBJECT(bp, a->method); return 2; diff --git a/crypto/x509v3/v3_lib.c b/crypto/x509v3/v3_lib.c index f0cc93bd..94f3e4b7 100644 --- a/crypto/x509v3/v3_lib.c +++ b/crypto/x509v3/v3_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_lib.c,v 1.17 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: v3_lib.c,v 1.18 2018/05/19 10:41:53 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -227,7 +227,7 @@ X509V3_EXT_d2i(X509_EXTENSION *ext) */ void * -X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx) +X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx) { int lastpos, i; X509_EXTENSION *ex, *found_ex = NULL; diff --git a/crypto/x509v3/v3_prn.c b/crypto/x509v3/v3_prn.c index f65c7aaa..f294c36b 100644 --- a/crypto/x509v3/v3_prn.c +++ b/crypto/x509v3/v3_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_prn.c,v 1.19 2016/12/30 15:54:49 jsing Exp $ */ +/* $OpenBSD: v3_prn.c,v 1.20 2018/05/19 10:41:53 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -152,8 +152,8 @@ X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent) } int -X509V3_extensions_print(BIO *bp, char *title, STACK_OF(X509_EXTENSION) *exts, - unsigned long flag, int indent) +X509V3_extensions_print(BIO *bp, const char *title, + const STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent) { int i, j; diff --git a/crypto/x509v3/v3_purp.c b/crypto/x509v3/v3_purp.c index d692a19c..0fdec224 100644 --- a/crypto/x509v3/v3_purp.c +++ b/crypto/x509v3/v3_purp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_purp.c,v 1.30 2017/06/22 17:28:00 jsing Exp $ */ +/* $OpenBSD: v3_purp.c,v 1.31 2018/05/18 18:30:03 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -172,7 +172,7 @@ X509_PURPOSE_get0(int idx) } int -X509_PURPOSE_get_by_sname(char *sname) +X509_PURPOSE_get_by_sname(const char *sname) { int i; X509_PURPOSE *xptmp; @@ -204,8 +204,8 @@ X509_PURPOSE_get_by_id(int purpose) int X509_PURPOSE_add(int id, int trust, int flags, - int (*ck)(const X509_PURPOSE *, const X509 *, int), char *name, - char *sname, void *arg) + int (*ck)(const X509_PURPOSE *, const X509 *, int), const char *name, + const char *sname, void *arg) { int idx; X509_PURPOSE *ptmp; @@ -302,25 +302,25 @@ X509_PURPOSE_cleanup(void) } int -X509_PURPOSE_get_id(X509_PURPOSE *xp) +X509_PURPOSE_get_id(const X509_PURPOSE *xp) { return xp->purpose; } char * -X509_PURPOSE_get0_name(X509_PURPOSE *xp) +X509_PURPOSE_get0_name(const X509_PURPOSE *xp) { return xp->name; } char * -X509_PURPOSE_get0_sname(X509_PURPOSE *xp) +X509_PURPOSE_get0_sname(const X509_PURPOSE *xp) { return xp->sname; } int -X509_PURPOSE_get_trust(X509_PURPOSE *xp) +X509_PURPOSE_get_trust(const X509_PURPOSE *xp) { return xp->trust; } diff --git a/crypto/x509v3/v3_skey.c b/crypto/x509v3/v3_skey.c index 9dc17417..aec2d5b7 100644 --- a/crypto/x509v3/v3_skey.c +++ b/crypto/x509v3/v3_skey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_skey.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: v3_skey.c,v 1.16 2018/05/19 10:37:02 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -83,13 +83,14 @@ const X509V3_EXT_METHOD v3_skey_id = { }; char * -i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *oct) +i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, const ASN1_OCTET_STRING *oct) { return hex_to_string(oct->data, oct->length); } ASN1_OCTET_STRING * -s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str) +s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + const char *str) { ASN1_OCTET_STRING *oct; long length; diff --git a/crypto/x509v3/v3_sxnet.c b/crypto/x509v3/v3_sxnet.c index 14c6e5c0..400bc263 100644 --- a/crypto/x509v3/v3_sxnet.c +++ b/crypto/x509v3/v3_sxnet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_sxnet.c,v 1.19 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: v3_sxnet.c,v 1.22 2019/03/13 20:34:00 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -253,7 +253,7 @@ sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, /* Add an id given the zone as an ASCII number */ int -SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen) +SXNET_add_id_asc(SXNET **psx, const char *zone, const char *user, int userlen) { ASN1_INTEGER *izone = NULL; @@ -267,7 +267,8 @@ SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen) /* Add an id given the zone as an unsigned long */ int -SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen) +SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, const char *user, + int userlen) { ASN1_INTEGER *izone = NULL; @@ -286,7 +287,8 @@ SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen) */ int -SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, char *user, int userlen) +SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, const char *user, + int userlen) { SXNET *sx = NULL; SXNETID *id = NULL; @@ -335,7 +337,7 @@ SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, char *user, int userlen) } ASN1_OCTET_STRING * -SXNET_get_id_asc(SXNET *sx, char *zone) +SXNET_get_id_asc(SXNET *sx, const char *zone) { ASN1_INTEGER *izone = NULL; ASN1_OCTET_STRING *oct; @@ -374,7 +376,7 @@ SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone) for (i = 0; i < sk_SXNETID_num(sx->ids); i++) { id = sk_SXNETID_value(sx->ids, i); - if (!ASN1_STRING_cmp(id->zone, zone)) + if (!ASN1_INTEGER_cmp(id->zone, zone)) return id->user; } return NULL; diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c index 04c78992..4f8d16fd 100644 --- a/crypto/x509v3/v3_utl.c +++ b/crypto/x509v3/v3_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_utl.c,v 1.26 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: v3_utl.c,v 1.31 2018/05/19 10:50:08 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -140,7 +140,7 @@ X509V3_add_value_bool(const char *name, int asn1_bool, } int -X509V3_add_value_bool_nf(char *name, int asn1_bool, +X509V3_add_value_bool_nf(const char *name, int asn1_bool, STACK_OF(CONF_VALUE) **extlist) { if (asn1_bool) @@ -150,7 +150,7 @@ X509V3_add_value_bool_nf(char *name, int asn1_bool, char * -i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *a) +i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *a) { BIGNUM *bntmp = NULL; char *strtmp = NULL; @@ -165,7 +165,7 @@ i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *a) } char * -i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, ASN1_INTEGER *a) +i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, const ASN1_INTEGER *a) { BIGNUM *bntmp = NULL; char *strtmp = NULL; @@ -180,7 +180,7 @@ i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, ASN1_INTEGER *a) } ASN1_INTEGER * -s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value) +s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value) { BIGNUM *bn = NULL; ASN1_INTEGER *aint; @@ -230,7 +230,7 @@ s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value) } int -X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, +X509V3_add_value_int(const char *name, const ASN1_INTEGER *aint, STACK_OF(CONF_VALUE) **extlist) { char *strtmp; @@ -246,7 +246,7 @@ X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, } int -X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool) +X509V3_get_value_bool(const CONF_VALUE *value, int *asn1_bool) { char *btmp; @@ -271,7 +271,7 @@ X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool) } int -X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint) +X509V3_get_value_int(const CONF_VALUE *value, ASN1_INTEGER **aint) { ASN1_INTEGER *itmp; @@ -1015,7 +1015,9 @@ int X509_check_host(X509 *x, const char *chk, size_t chklen, { if (chk == NULL) return -2; - if (memchr(chk, '\0', chklen)) + if (chklen == 0) + chklen = strlen(chk); + else if (memchr(chk, '\0', chklen)) return -2; return do_x509_check(x, chk, chklen, flags, GEN_DNS, peername); } @@ -1025,7 +1027,9 @@ int X509_check_email(X509 *x, const char *chk, size_t chklen, { if (chk == NULL) return -2; - if (memchr(chk, '\0', chklen)) + if (chklen == 0) + chklen = strlen(chk); + else if (memchr(chk, '\0', chklen)) return -2; return do_x509_check(x, chk, chklen, flags, GEN_EMAIL, NULL); } diff --git a/depcomp b/depcomp index b39f98f9..65cbf709 100644 --- a/depcomp +++ b/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # 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 @@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC # 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 . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -783,7 +783,7 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/include/Makefile.am b/include/Makefile.am index 728d9216..6d808cc9 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -12,11 +12,13 @@ noinst_HEADERS += compat/fcntl.h noinst_HEADERS += compat/limits.h noinst_HEADERS += compat/netdb.h noinst_HEADERS += compat/poll.h +noinst_HEADERS += compat/pthread.h noinst_HEADERS += compat/readpassphrase.h noinst_HEADERS += compat/resolv.h noinst_HEADERS += compat/stdio.h noinst_HEADERS += compat/stdlib.h noinst_HEADERS += compat/string.h +noinst_HEADERS += compat/syslog.h noinst_HEADERS += compat/time.h noinst_HEADERS += compat/unistd.h noinst_HEADERS += compat/win32netcompat.h diff --git a/include/Makefile.in b/include/Makefile.in index bac88b1b..5ae873c1 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -167,7 +167,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -347,9 +347,10 @@ EXTRA_DIST = CMakeLists.txt SUBDIRS = openssl noinst_HEADERS = pqueue.h compat/dirent.h compat/dirent_msvc.h \ compat/err.h compat/fcntl.h compat/limits.h compat/netdb.h \ - compat/poll.h compat/readpassphrase.h compat/resolv.h \ - compat/stdio.h compat/stdlib.h compat/string.h compat/time.h \ - compat/unistd.h compat/win32netcompat.h compat/arpa/inet.h \ + compat/poll.h compat/pthread.h compat/readpassphrase.h \ + compat/resolv.h compat/stdio.h compat/stdlib.h compat/string.h \ + compat/syslog.h compat/time.h compat/unistd.h \ + compat/win32netcompat.h compat/arpa/inet.h \ compat/arpa/nameser.h compat/machine/endian.h \ compat/netinet/in.h compat/netinet/ip.h compat/netinet/tcp.h \ compat/sys/ioctl.h compat/sys/mman.h compat/sys/param.h \ @@ -376,8 +377,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/Makefile.am.common $(am__empty): @@ -516,7 +517,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/include/compat/arpa/inet.h b/include/compat/arpa/inet.h index f14ffde0..4422f418 100644 --- a/include/compat/arpa/inet.h +++ b/include/compat/arpa/inet.h @@ -13,11 +13,3 @@ #endif #endif - -#ifndef HAVE_INET_NTOP -const char * inet_ntop(int af, const void *src, char *dst, socklen_t size); -#endif - -#ifndef HAVE_INET_PTON -int inet_pton(int af, const char * src, void * dst); -#endif diff --git a/include/compat/netinet/in.h b/include/compat/netinet/in.h index 20e57b82..d1afb27d 100644 --- a/include/compat/netinet/in.h +++ b/include/compat/netinet/in.h @@ -8,3 +8,12 @@ #else #include #endif + +#ifndef LIBCRYPTOCOMPAT_NETINET_IN_H +#define LIBCRYPTOCOMPAT_NETINET_IN_H + +#ifdef __ANDROID__ +typedef uint16_t in_port_t; +#endif + +#endif diff --git a/include/compat/pthread.h b/include/compat/pthread.h new file mode 100644 index 00000000..8b8c3c67 --- /dev/null +++ b/include/compat/pthread.h @@ -0,0 +1,86 @@ +/* + * Public domain + * pthread.h compatibility shim + */ + +#ifndef LIBCRYPTOCOMPAT_PTHREAD_H +#define LIBCRYPTOCOMPAT_PTHREAD_H + +#ifdef _WIN32 + +#include + +/* + * Static once initialization values. + */ +#define PTHREAD_ONCE_INIT { INIT_ONCE_STATIC_INIT } + +/* + * Once definitions. + */ +struct pthread_once { + INIT_ONCE once; +}; +typedef struct pthread_once pthread_once_t; + +static inline BOOL CALLBACK +_pthread_once_win32_cb(PINIT_ONCE once, PVOID param, PVOID *context) +{ + void (*cb) (void) = param; + cb(); + return TRUE; +} + +static inline int +pthread_once(pthread_once_t *once, void (*cb) (void)) +{ + BOOL rc = InitOnceExecuteOnce(&once->once, _pthread_once_win32_cb, cb, NULL); + if (rc == 0) + return -1; + else + return 0; +} + +typedef DWORD pthread_t; + +static inline pthread_t +pthread_self(void) +{ + return GetCurrentThreadId(); +} + +static inline int +pthread_equal(pthread_t t1, pthread_t t2) +{ + return t1 == t2; +} + +typedef CRITICAL_SECTION pthread_mutex_t; +typedef void pthread_mutexattr_t; + +static inline int +pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) +{ + InitializeCriticalSection(mutex); + return 0; +} + +static inline int +pthread_mutex_lock(pthread_mutex_t *mutex) +{ + EnterCriticalSection(mutex); + return 0; +} + +static inline int +pthread_mutex_unlock(pthread_mutex_t *mutex) +{ + LeaveCriticalSection(mutex); + return 0; +} + +#else +#include_next +#endif + +#endif diff --git a/include/compat/stdlib.h b/include/compat/stdlib.h index cc04856f..e6298846 100644 --- a/include/compat/stdlib.h +++ b/include/compat/stdlib.h @@ -29,6 +29,10 @@ uint32_t arc4random_uniform(uint32_t upper_bound); void freezero(void *ptr, size_t sz); #endif +#ifndef HAVE_GETPROGNAME +const char * getprogname(void); +#endif + #ifndef HAVE_REALLOCARRAY void *reallocarray(void *, size_t, size_t); #endif diff --git a/include/compat/sys/stat.h b/include/compat/sys/stat.h index 629c7fef..b88da1d5 100644 --- a/include/compat/sys/stat.h +++ b/include/compat/sys/stat.h @@ -10,9 +10,18 @@ #include_next /* for old MinGW */ +#ifndef S_IRWXU +#define S_IRWXU 0 +#endif +#ifndef S_IRWXG +#define S_IRWXG 0 +#endif #ifndef S_IRGRP #define S_IRGRP 0 #endif +#ifndef S_IRWXO +#define S_IRWXO 0 +#endif #ifndef S_IROTH #define S_IROTH 0 #endif @@ -65,12 +74,15 @@ #endif #if defined(_MSC_VER) +# define S_IRWXU 0 /* RWX user */ # define S_IRUSR S_IREAD /* Read user */ # define S_IWUSR S_IWRITE /* Write user */ # define S_IXUSR 0 /* Execute user */ +# define S_IRWXG 0 /* RWX group */ # define S_IRGRP 0 /* Read group */ # define S_IWGRP 0 /* Write group */ # define S_IXGRP 0 /* Execute group */ +# define S_IRWXO 0 /* RWX others */ # define S_IROTH 0 /* Read others */ # define S_IWOTH 0 /* Write others */ # define S_IXOTH 0 /* Execute others */ diff --git a/include/compat/sys/time.h b/include/compat/sys/time.h index 235bc6ee..76428c19 100644 --- a/include/compat/sys/time.h +++ b/include/compat/sys/time.h @@ -13,4 +13,16 @@ int gettimeofday(struct timeval *tp, void *tzp); #include_next #endif +#ifndef timersub +#define timersub(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ + if ((vvp)->tv_usec < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_usec += 1000000; \ + } \ + } while (0) +#endif + #endif diff --git a/include/compat/sys/types.h b/include/compat/sys/types.h index 701b77ae..49678439 100644 --- a/include/compat/sys/types.h +++ b/include/compat/sys/types.h @@ -21,6 +21,7 @@ #ifdef __MINGW32__ #include <_bsd_types.h> typedef uint32_t in_addr_t; +typedef uint32_t uid_t; #endif #ifdef _MSC_VER @@ -28,6 +29,8 @@ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef uint32_t in_addr_t; +typedef uint32_t mode_t; +typedef uint32_t uid_t; #include typedef SSIZE_T ssize_t; @@ -46,6 +49,14 @@ typedef SSIZE_T ssize_t; # define __bounded__(x, y, z) #endif +#if !defined(HAVE_ATTRIBUTE__DEAD) && !defined(__dead) +#ifdef _MSC_VER +#define __dead __declspec(noreturn) +#else +#define __dead __attribute__((__noreturn__)) +#endif +#endif + #ifdef _WIN32 #define __warn_references(sym,msg) #else @@ -59,7 +70,7 @@ typedef SSIZE_T ssize_t; #if defined(__GNUC__) && defined (HAS_GNU_WARNING_LONG) #define __warn_references(sym,msg) \ __asm__(".section .gnu.warning." __STRING(sym) \ - " ; .ascii \"" msg "\" ; .text"); + "\n\t.ascii \"" msg "\"\n\t.text"); #else #define __warn_references(sym,msg) #endif diff --git a/include/compat/syslog.h b/include/compat/syslog.h new file mode 100644 index 00000000..f400ff66 --- /dev/null +++ b/include/compat/syslog.h @@ -0,0 +1,37 @@ +/* + * Public domain + * syslog.h compatibility shim + */ + +#ifndef _WIN32 +#include_next +#endif + +#ifndef LIBCRYPTOCOMPAT_SYSLOG_H +#define LIBCRYPTOCOMPAT_SYSLOG_H + +#ifndef HAVE_SYSLOG_R + +#include + +#ifdef _WIN32 +#define LOG_INFO 6 /* informational */ +#define LOG_USER (1<<3) /* random user-level messages */ +#define LOG_LOCAL2 (18<<3) /* reserved for local use */ +#endif + +struct syslog_data { + int log_stat; + const char *log_tag; + int log_fac; + int log_mask; +}; + +#define SYSLOG_DATA_INIT {0, (const char *)0, LOG_USER, 0xff} + +void syslog_r(int, struct syslog_data *, const char *, ...); +void vsyslog_r(int, struct syslog_data *, const char *, va_list); + +#endif + +#endif diff --git a/include/compat/time.h b/include/compat/time.h index 99a2001f..540807dd 100644 --- a/include/compat/time.h +++ b/include/compat/time.h @@ -13,6 +13,9 @@ #include_next #endif +#ifndef LIBCRYPTOCOMPAT_TIME_H +#define LIBCRYPTOCOMPAT_TIME_H + #ifdef _WIN32 struct tm *__gmtime_r(const time_t * t, struct tm * tm); #define gmtime_r(tp, tm) __gmtime_r(tp, tm) @@ -21,3 +24,37 @@ struct tm *__gmtime_r(const time_t * t, struct tm * tm); #ifndef HAVE_TIMEGM time_t timegm(struct tm *tm); #endif + +#ifndef CLOCK_MONOTONIC +#define CLOCK_MONOTONIC CLOCK_REALTIME +#endif + +#ifndef CLOCK_REALTIME +#define CLOCK_REALTIME 0 +#endif + +#ifndef _WIN32 +#ifndef HAVE_CLOCK_GETTIME +typedef int clockid_t; +int clock_gettime(clockid_t clock_id, struct timespec *tp); +#endif + +#ifdef timespecsub +#define HAVE_TIMESPECSUB +#endif + +#ifndef HAVE_TIMESPECSUB +#define timespecsub(tsp, usp, vsp) \ + do { \ + (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ + (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ + if ((vsp)->tv_nsec < 0) { \ + (vsp)->tv_sec--; \ + (vsp)->tv_nsec += 1000000000L; \ + } \ + } while (0) +#endif + +#endif + +#endif diff --git a/include/compat/unistd.h b/include/compat/unistd.h index d5960433..f521b943 100644 --- a/include/compat/unistd.h +++ b/include/compat/unistd.h @@ -7,7 +7,16 @@ #define LIBCRYPTOCOMPAT_UNISTD_H #ifndef _MSC_VER + #include_next + +#ifdef __MINGW32__ +int ftruncate(int fd, off_t length); +uid_t getuid(void); +ssize_t pread(int d, void *buf, size_t nbytes, off_t offset); +ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset); +#endif + #else #include @@ -22,10 +31,19 @@ #define X_OK 0 #define F_OK 0 +#define SEEK_SET 0 +#define SEEK_CUR 1 +#define SEEK_END 2 + #define access _access unsigned int sleep(unsigned int seconds); +int ftruncate(int fd, off_t length); +uid_t getuid(void); +ssize_t pread(int d, void *buf, size_t nbytes, off_t offset); +ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset); + #endif #ifndef HAVE_GETENTROPY @@ -44,6 +62,7 @@ int getpagesize(void); #endif #define pledge(request, paths) 0 +#define unveil(path, permissions) 0 #ifndef HAVE_PIPE2 int pipe2(int fildes[2], int flags); diff --git a/include/openssl/Makefile.am b/include/openssl/Makefile.am index 9abcc0ba..1e95eb92 100644 --- a/include/openssl/Makefile.am +++ b/include/openssl/Makefile.am @@ -5,7 +5,6 @@ opensslincludedir=$(includedir)/openssl opensslinclude_HEADERS = opensslinclude_HEADERS += aes.h opensslinclude_HEADERS += asn1.h -opensslinclude_HEADERS += asn1_mac.h opensslinclude_HEADERS += asn1t.h opensslinclude_HEADERS += bio.h opensslinclude_HEADERS += blowfish.h @@ -58,6 +57,8 @@ opensslinclude_HEADERS += ripemd.h opensslinclude_HEADERS += rsa.h opensslinclude_HEADERS += safestack.h opensslinclude_HEADERS += sha.h +opensslinclude_HEADERS += sm3.h +opensslinclude_HEADERS += sm4.h opensslinclude_HEADERS += srtp.h opensslinclude_HEADERS += ssl.h opensslinclude_HEADERS += ssl2.h diff --git a/include/openssl/Makefile.in b/include/openssl/Makefile.in index b4621d26..6e555433 100644 --- a/include/openssl/Makefile.in +++ b/include/openssl/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -302,15 +302,15 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/compat \ -DLIBRESSL_INTERNAL -D__BEGIN_HIDDEN_DECLS= \ -D__END_HIDDEN_DECLS= opensslincludedir = $(includedir)/openssl -opensslinclude_HEADERS = aes.h asn1.h asn1_mac.h asn1t.h bio.h \ - blowfish.h bn.h buffer.h camellia.h cast.h chacha.h cmac.h \ - comp.h conf.h conf_api.h crypto.h curve25519.h des.h dh.h \ - dsa.h dso.h dtls1.h ec.h ecdh.h ecdsa.h engine.h err.h evp.h \ - gost.h hkdf.h hmac.h idea.h lhash.h md4.h md5.h modes.h \ - obj_mac.h objects.h ocsp.h opensslconf.h opensslfeatures.h \ - opensslv.h ossl_typ.h pem.h pem2.h pkcs12.h pkcs7.h poly1305.h \ - rand.h rc2.h rc4.h ripemd.h rsa.h safestack.h sha.h srtp.h \ - ssl.h ssl2.h ssl23.h ssl3.h stack.h tls1.h ts.h txt_db.h ui.h \ +opensslinclude_HEADERS = aes.h asn1.h asn1t.h bio.h blowfish.h bn.h \ + buffer.h camellia.h cast.h chacha.h cmac.h comp.h conf.h \ + conf_api.h crypto.h curve25519.h des.h dh.h dsa.h dso.h \ + dtls1.h ec.h ecdh.h ecdsa.h engine.h err.h evp.h gost.h hkdf.h \ + hmac.h idea.h lhash.h md4.h md5.h modes.h obj_mac.h objects.h \ + ocsp.h opensslconf.h opensslfeatures.h opensslv.h ossl_typ.h \ + pem.h pem2.h pkcs12.h pkcs7.h poly1305.h rand.h rc2.h rc4.h \ + ripemd.h rsa.h safestack.h sha.h sm3.h sm4.h srtp.h ssl.h \ + ssl2.h ssl23.h ssl3.h stack.h tls1.h ts.h txt_db.h ui.h \ ui_compat.h whrlpool.h x509.h x509_vfy.h x509v3.h all: all-am @@ -332,8 +332,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/Makefile.am.common $(am__empty): @@ -425,7 +425,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index da16d5c5..0a8da415 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.43 2017/05/06 17:12:59 beck Exp $ */ +/* $OpenBSD: asn1.h,v 1.53 2018/11/30 04:51:19 jeremy Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -125,7 +125,6 @@ extern "C" { #define V_ASN1_UNIVERSALSTRING 28 /**/ #define V_ASN1_BMPSTRING 30 -/* For use with d2i_ASN1_type_bytes() */ #define B_ASN1_NUMERICSTRING 0x0001 #define B_ASN1_PRINTABLESTRING 0x0002 #define B_ASN1_T61STRING 0x0004 @@ -543,178 +542,6 @@ typedef struct BIT_STRING_BITNAME_st { const char *sname; } BIT_STRING_BITNAME; -#ifndef LIBRESSL_INTERNAL - -#define M_ASN1_STRING_length(x) ((x)->length) -#define M_ASN1_STRING_length_set(x, n) ((x)->length = (n)) -#define M_ASN1_STRING_type(x) ((x)->type) -#define M_ASN1_STRING_data(x) ((x)->data) - -/* Macros for string operations */ -#define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\ - ASN1_STRING_type_new(V_ASN1_BIT_STRING) -#define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) -#define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\ - (const ASN1_STRING *)a,(const ASN1_STRING *)b) -#define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c) - -#define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\ - ASN1_STRING_type_new(V_ASN1_INTEGER) -#define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) -#define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\ - (const ASN1_STRING *)a,(const ASN1_STRING *)b) - -#define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\ - ASN1_STRING_type_new(V_ASN1_ENUMERATED) -#define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) -#define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\ - (const ASN1_STRING *)a,(const ASN1_STRING *)b) - -#define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\ - ASN1_STRING_type_new(V_ASN1_OCTET_STRING) -#define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) -#define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\ - (const ASN1_STRING *)a,(const ASN1_STRING *)b) -#define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c) -#define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b) -#define M_i2d_ASN1_OCTET_STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\ - V_ASN1_UNIVERSAL) - -#define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING) -#define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ - pp,a->type,V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_PRINTABLE(a,pp,l) \ - d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ - B_ASN1_PRINTABLE) - -#define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) -#define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ - pp,a->type,V_ASN1_UNIVERSAL) -#define M_d2i_DIRECTORYSTRING(a,pp,l) \ - d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ - B_ASN1_DIRECTORYSTRING) - -#define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) -#define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ - pp,a->type,V_ASN1_UNIVERSAL) -#define M_d2i_DISPLAYTEXT(a,pp,l) \ - d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ - B_ASN1_DISPLAYTEXT) - -#define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\ - ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) -#define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_PRINTABLESTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \ - (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING) - -#define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\ - ASN1_STRING_type_new(V_ASN1_T61STRING) -#define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_T61STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_T61STRING(a,pp,l) \ - (ASN1_T61STRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING) - -#define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\ - ASN1_STRING_type_new(V_ASN1_IA5STRING) -#define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_IA5STRING_dup(a) \ - (ASN1_IA5STRING *)ASN1_STRING_dup((const ASN1_STRING *)a) -#define M_i2d_ASN1_IA5STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_IA5STRING(a,pp,l) \ - (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\ - B_ASN1_IA5STRING) - -#define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\ - ASN1_STRING_type_new(V_ASN1_UTCTIME) -#define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) - -#define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\ - ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME) -#define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\ - (const ASN1_STRING *)a) - -#define M_ASN1_TIME_new() (ASN1_TIME *)\ - ASN1_STRING_type_new(V_ASN1_UTCTIME) -#define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_ASN1_TIME_dup(a) (ASN1_TIME *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) - -#define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\ - ASN1_STRING_type_new(V_ASN1_GENERALSTRING) -#define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_GENERALSTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_GENERALSTRING(a,pp,l) \ - (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING) - -#define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\ - ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING) -#define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \ - (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING) - -#define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\ - ASN1_STRING_type_new(V_ASN1_BMPSTRING) -#define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_BMPSTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_BMPSTRING(a,pp,l) \ - (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING) - -#define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\ - ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) -#define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_VISIBLESTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \ - (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING) - -#define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\ - ASN1_STRING_type_new(V_ASN1_UTF8STRING) -#define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -#define M_i2d_ASN1_UTF8STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\ - V_ASN1_UNIVERSAL) -#define M_d2i_ASN1_UTF8STRING(a,pp,l) \ - (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) - -#endif /* !LIBRESSL_INTERNAL */ - #define B_ASN1_TIME \ B_ASN1_UTCTIME | \ B_ASN1_GENERALIZEDTIME @@ -744,9 +571,18 @@ typedef struct BIT_STRING_BITNAME_st { B_ASN1_BMPSTRING|\ B_ASN1_UTF8STRING -/* for the is_set parameter to i2d_ASN1_SET */ -#define IS_SEQUENCE 0 -#define IS_SET 1 +#ifndef LIBRESSL_INTERNAL +#define M_ASN1_IA5STRING_new ASN1_IA5STRING_new + +#define M_ASN1_INTEGER_free ASN1_INTEGER_free +#define M_ASN1_ENUMERATED_free ASN1_ENUMERATED_free +#define M_ASN1_OCTET_STRING_free ASN1_OCTET_STRING_free + +#define M_ASN1_OCTET_STRING_print ASN1_STRING_print + +#define M_ASN1_STRING_data ASN1_STRING_data +#define M_ASN1_STRING_length ASN1_STRING_length +#endif ASN1_TYPE *ASN1_TYPE_new(void); void ASN1_TYPE_free(ASN1_TYPE *a); @@ -754,14 +590,14 @@ ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, const unsigned char **in, long len); int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **out); extern const ASN1_ITEM ASN1_ANY_it; -int ASN1_TYPE_get(ASN1_TYPE *a); +int ASN1_TYPE_get(const ASN1_TYPE *a); void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); -int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b); +int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); -ASN1_OBJECT *ASN1_OBJECT_new(void ); +ASN1_OBJECT *ASN1_OBJECT_new(void); void ASN1_OBJECT_free(ASN1_OBJECT *a); -int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp); +int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp); ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, long length); ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, @@ -775,7 +611,7 @@ ASN1_STRING *ASN1_STRING_new(void); void ASN1_STRING_free(ASN1_STRING *a); int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str); ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a); -ASN1_STRING *ASN1_STRING_type_new(int type ); +ASN1_STRING *ASN1_STRING_type_new(int type); int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); /* Since this is used to store all sorts of things, via macros, for now, make its data void * */ @@ -783,8 +619,9 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); int ASN1_STRING_length(const ASN1_STRING *x); void ASN1_STRING_length_set(ASN1_STRING *x, int n); -int ASN1_STRING_type(ASN1_STRING *x); -unsigned char * ASN1_STRING_data(ASN1_STRING *x); +int ASN1_STRING_type(const ASN1_STRING *x); +unsigned char *ASN1_STRING_data(ASN1_STRING *x); +const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x); ASN1_BIT_STRING *ASN1_BIT_STRING_new(void); void ASN1_BIT_STRING_free(ASN1_BIT_STRING *a); @@ -794,18 +631,18 @@ extern const ASN1_ITEM ASN1_BIT_STRING_it; int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp); ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long length); -int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length ); +int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length); int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); -int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); -int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, - unsigned char *flags, int flags_len); +int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n); +int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, + const unsigned char *flags, int flags_len); #ifndef OPENSSL_NO_BIO int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, BIT_STRING_BITNAME *tbl, int indent); #endif -int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); -int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, +int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl); +int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value, BIT_STRING_BITNAME *tbl); int i2d_ASN1_BOOLEAN(int a, unsigned char **pp); @@ -830,7 +667,7 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char ** int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out); extern const ASN1_ITEM ASN1_ENUMERATED_it; -int ASN1_UTCTIME_check(ASN1_UTCTIME *a); +int ASN1_UTCTIME_check(const ASN1_UTCTIME *a); ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, int offset_day, long offset_sec); @@ -840,7 +677,7 @@ int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); #endif /* !LIBRESSL_INTERNAL */ -int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); +int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a); ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, time_t t); ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, @@ -942,27 +779,21 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm); ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec); -int ASN1_TIME_check(ASN1_TIME *t); -ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, +int ASN1_TIME_check(const ASN1_TIME *t); +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); -int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, - i2d_of_void *i2d, int ex_tag, int ex_class, int is_set); -STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, - const unsigned char **pp, long length, d2i_of_void *d2i, - void (*free_func)(OPENSSL_BLOCK), int ex_tag, int ex_class); - #ifndef OPENSSL_NO_BIO -int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); +int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a); int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); -int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); +int i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a); int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); -int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a); +int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a); int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); -int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); +int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type); #endif -int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a); +int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a); int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, @@ -974,26 +805,14 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); -long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); -ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); -BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn); +long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a); +ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai); +BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn); /* General */ /* given a string, return the correct type, max is the maximum length */ int ASN1_PRINTABLE_type(const unsigned char *s, int max); -int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); -ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, - long length, int Ptag, int Pclass); -unsigned long ASN1_tag2bit(int tag); -/* type is one or more of the B_ASN1_ values. */ -ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp, - long length, int type); - -/* PARSING */ -int asn1_Finish(ASN1_CTX *c); -int asn1_const_Finish(ASN1_const_CTX *c); - /* SPECIALS */ int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, int *pclass, long omax); @@ -1008,25 +827,8 @@ void *ASN1_item_dup(const ASN1_ITEM *it, void *x); #ifndef LIBRESSL_INTERNAL -/* Used to implement other functions */ void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x); -#define ASN1_dup_of(type,i2d,d2i,x) \ - ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ - CHECKED_D2I_OF(type, d2i), \ - CHECKED_PTR_OF(type, x))) - -#define ASN1_dup_of_const(type,i2d,d2i,x) \ - ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ - CHECKED_D2I_OF(type, d2i), \ - CHECKED_PTR_OF(const type, x))) - -/* ASN1 alloc/free macros for when a type is only used internally */ - -#define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) -#define M_ASN1_free_of(x, type) \ - ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) - #endif /* !LIBRESSL_INTERNAL */ void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); @@ -1051,9 +853,10 @@ int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x); CHECKED_PTR_OF(const type, x))) int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); -int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); +int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, + unsigned long flags); -int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); +int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in); #ifndef OPENSSL_NO_BIO void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); @@ -1082,12 +885,14 @@ int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a); int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a); int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); -int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); +int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags); int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, unsigned char *buf, int off); int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, int dump); #endif + +unsigned long ASN1_tag2bit(int tag); const char *ASN1_tag2str(int tag); /* Used to load and write netscape format cert */ @@ -1100,24 +905,17 @@ extern const ASN1_ITEM NETSCAPE_X509_it; int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); -int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len); -int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len); -int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, - int len); -int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data, +int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, const unsigned char *data, int len); +int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len); - -STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, - d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)); -unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, - unsigned char **buf, int *len ); -void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); -void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); -ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, - ASN1_OCTET_STRING **oct); +int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, const unsigned char *data, + int len); +int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num, + unsigned char *data, int max_len); ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); +void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it); void ASN1_STRING_set_default_mask(unsigned long mask); int ASN1_STRING_set_default_mask_asc(const char *p); @@ -1138,15 +936,15 @@ void ASN1_STRING_TABLE_cleanup(void); /* Old API compatible functions */ ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); -ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, +ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it); int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); void ASN1_add_oid_module(void); -ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); -ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); +ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf); +ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf); /* ASN1 Print flags */ @@ -1173,18 +971,18 @@ int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent, const ASN1_ITEM *it, const ASN1_PCTX *pctx); ASN1_PCTX *ASN1_PCTX_new(void); void ASN1_PCTX_free(ASN1_PCTX *p); -unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p); +unsigned long ASN1_PCTX_get_flags(const ASN1_PCTX *p); void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_nm_flags(ASN1_PCTX *p); +unsigned long ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p); void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_cert_flags(ASN1_PCTX *p); +unsigned long ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p); void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_oid_flags(ASN1_PCTX *p); +unsigned long ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p); void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_str_flags(ASN1_PCTX *p); +unsigned long ASN1_PCTX_get_str_flags(const ASN1_PCTX *p); void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags); -BIO_METHOD *BIO_f_asn1(void); +const BIO_METHOD *BIO_f_asn1(void); BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it); @@ -1404,6 +1202,7 @@ void ERR_load_ASN1_strings(void); #define ASN1_R_MSTRING_NOT_UNIVERSAL 139 #define ASN1_R_MSTRING_WRONG_TAG 140 #define ASN1_R_NESTED_ASN1_STRING 197 +#define ASN1_R_NESTED_TOO_DEEP 219 #define ASN1_R_NON_HEX_CHARACTERS 141 #define ASN1_R_NOT_ASCII_FORMAT 190 #define ASN1_R_NOT_ENOUGH_DATA 142 diff --git a/include/openssl/asn1_mac.h b/include/openssl/asn1_mac.h deleted file mode 100644 index fd524dc2..00000000 --- a/include/openssl/asn1_mac.h +++ /dev/null @@ -1,426 +0,0 @@ -/* $OpenBSD: asn1_mac.h,v 1.14 2014/06/27 04:41:09 miod Exp $ */ -/* 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 - -#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_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_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_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_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_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_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_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_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); \ - } - -/* 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_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_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_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_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_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_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_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_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_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_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_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_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 diff --git a/include/openssl/bio.h b/include/openssl/bio.h index b753596d..9fbf3bce 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bio.h,v 1.30 2017/04/06 18:25:38 deraadt Exp $ */ +/* $OpenBSD: bio.h,v 1.45 2018/06/02 04:41:12 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -103,6 +103,12 @@ extern "C" { #define BIO_TYPE_FILTER 0x0200 #define BIO_TYPE_SOURCE_SINK 0x0400 +/* + * BIO_TYPE_START is the first user-allocated BIO type. No pre-defined type, + * flag bits aside, may exceed this value. + */ +#define BIO_TYPE_START 128 + /* BIO_FILENAME_READ|BIO_CLOSE to open or close on free. * BIO_set_fp(in,stdin,BIO_NOCLOSE); */ #define BIO_NOCLOSE 0x00 @@ -264,6 +270,7 @@ 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 int BIO_info_cb(BIO *, int, int); typedef struct bio_method_st { int type; @@ -279,7 +286,7 @@ typedef struct bio_method_st { } BIO_METHOD; struct bio_st { - BIO_METHOD *method; + const 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 */ @@ -327,6 +334,27 @@ typedef struct bio_f_buffer_ctx_struct { /* Prefix and suffix callback in ASN1 BIO */ typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg); +/* BIO_METHOD accessors */ +BIO_METHOD *BIO_meth_new(int type, const char *name); +void BIO_meth_free(BIO_METHOD *biom); +int (*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *, int); +int BIO_meth_set_write(BIO_METHOD *biom, + int (*write)(BIO *, const char *, int)); +int (*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int); +int BIO_meth_set_read(BIO_METHOD *biom, int (*read)(BIO *, char *, int)); +int (*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *); +int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts)(BIO *, const char *)); +int (*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int); +int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets)(BIO *, char *, int)); +long (*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int, long, void *); +int BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl)(BIO *, int, long, void *)); +int (*BIO_meth_get_create(const BIO_METHOD *biom))(BIO *); +int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *)); +int (*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *); +int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *)); +long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, BIO_info_cb *); +int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, + long (*callback_ctrl)(BIO *, int, BIO_info_cb *)); /* connect BIO stuff */ #define BIO_CONN_S_BEFORE 1 @@ -568,13 +596,20 @@ int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix, asn1_ps_func **psuffix_free); -BIO_METHOD *BIO_s_file(void ); +int BIO_get_new_index(void); +const 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 -BIO * BIO_new(BIO_METHOD *type); -int BIO_set(BIO *a, BIO_METHOD *type); +BIO *BIO_new(const BIO_METHOD *type); +int BIO_set(BIO *a, const BIO_METHOD *type); int BIO_free(BIO *a); +int BIO_up_ref(BIO *bio); +void *BIO_get_data(BIO *a); +void BIO_set_data(BIO *a, void *ptr); +void BIO_set_init(BIO *a, int init); +int BIO_get_shutdown(BIO *a); +void BIO_set_shutdown(BIO *a, int shut); void BIO_vfree(BIO *a); int BIO_read(BIO *b, void *data, int len) __attribute__((__bounded__(__buffer__,2,3))); @@ -606,20 +641,20 @@ 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(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); -BIO_METHOD *BIO_s_log(void); -BIO_METHOD *BIO_s_bio(void); -BIO_METHOD *BIO_s_null(void); -BIO_METHOD *BIO_f_null(void); -BIO_METHOD *BIO_f_buffer(void); -BIO_METHOD *BIO_f_nbio_test(void); +const BIO_METHOD *BIO_s_mem(void); +BIO *BIO_new_mem_buf(const void *buf, int len); +const BIO_METHOD *BIO_s_socket(void); +const BIO_METHOD *BIO_s_connect(void); +const BIO_METHOD *BIO_s_accept(void); +const BIO_METHOD *BIO_s_fd(void); +const BIO_METHOD *BIO_s_log(void); +const BIO_METHOD *BIO_s_bio(void); +const BIO_METHOD *BIO_s_null(void); +const BIO_METHOD *BIO_f_null(void); +const BIO_METHOD *BIO_f_buffer(void); +const BIO_METHOD *BIO_f_nbio_test(void); #ifndef OPENSSL_NO_DGRAM -BIO_METHOD *BIO_s_datagram(void); +const BIO_METHOD *BIO_s_datagram(void); #endif /* BIO_METHOD *BIO_f_ber(void); */ @@ -663,8 +698,8 @@ 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); BIO *BIO_new_fd(int fd, int close_flag); -BIO *BIO_new_connect(char *host_port); -BIO *BIO_new_accept(char *host_port); +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, diff --git a/include/openssl/bn.h b/include/openssl/bn.h index 0dde08a3..cd94e393 100644 --- a/include/openssl/bn.h +++ b/include/openssl/bn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn.h,v 1.36 2017/01/25 06:15:44 beck Exp $ */ +/* $OpenBSD: bn.h,v 1.38 2018/02/20 17:13:14 jsing Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -285,6 +285,11 @@ struct bn_gencb_st { int (*cb_2)(int, int, BN_GENCB *); } cb; }; + +BN_GENCB *BN_GENCB_new(void); +void BN_GENCB_free(BN_GENCB *cb); +void *BN_GENCB_get_arg(BN_GENCB *cb); + /* Wrapper function to make using BN_GENCB easier, */ int BN_GENCB_call(BN_GENCB *cb, int a, int b); /* Macro to populate a BN_GENCB structure with an "old"-style callback */ @@ -628,6 +633,8 @@ const BIGNUM *BN_get0_nist_prime_521(void); /* Primes from RFC 2409 */ BIGNUM *get_rfc2409_prime_768(BIGNUM *bn); BIGNUM *get_rfc2409_prime_1024(BIGNUM *bn); +BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn); +BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn); /* Primes from RFC 3526 */ BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn); @@ -636,6 +643,12 @@ BIGNUM *get_rfc3526_prime_3072(BIGNUM *bn); BIGNUM *get_rfc3526_prime_4096(BIGNUM *bn); BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn); BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn); /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes diff --git a/include/openssl/chacha.h b/include/openssl/chacha.h index 8d94e626..e2345b21 100644 --- a/include/openssl/chacha.h +++ b/include/openssl/chacha.h @@ -1,4 +1,4 @@ -/* $OpenBSD: chacha.h,v 1.7 2015/12/09 14:07:55 bcook Exp $ */ +/* $OpenBSD: chacha.h,v 1.8 2019/01/22 00:59:21 dlg Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -46,6 +46,10 @@ void ChaCha(ChaCha_ctx *ctx, unsigned char *out, const unsigned char *in, void CRYPTO_chacha_20(unsigned char *out, const unsigned char *in, size_t len, const unsigned char key[32], const unsigned char iv[8], uint64_t counter); +void CRYPTO_xchacha_20(unsigned char *out, const unsigned char *in, size_t len, + const unsigned char key[32], const unsigned char iv[24]); +void CRYPTO_hchacha_20(unsigned char out[32], + const unsigned char key[32], const unsigned char iv[16]); #ifdef __cplusplus } diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index 068415f6..7de8abb4 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.h,v 1.41 2017/04/29 21:48:43 jsing Exp $ */ +/* $OpenBSD: crypto.h,v 1.50 2019/01/19 01:07:00 tb Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -203,7 +203,6 @@ typedef struct openssl_item_st { #define CRYPTO_READ 4 #define CRYPTO_WRITE 8 -#ifndef OPENSSL_NO_LOCKING #ifndef CRYPTO_w_lock #define CRYPTO_w_lock(type) \ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) @@ -216,13 +215,6 @@ typedef struct openssl_item_st { #define CRYPTO_add(addr,amount,type) \ CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) #endif -#else -#define CRYPTO_w_lock(a) -#define CRYPTO_w_unlock(a) -#define CRYPTO_r_lock(a) -#define CRYPTO_r_unlock(a) -#define CRYPTO_add(a,b,c) ((*(a))+=(b)) -#endif /* Some applications as well as some parts of OpenSSL need to allocate and deallocate locks in a dynamic fashion. The following typedef @@ -294,11 +286,13 @@ DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) #define CRYPTO_EX_INDEX_ECDH 13 #define CRYPTO_EX_INDEX_COMP 14 #define CRYPTO_EX_INDEX_STORE 15 +#define CRYPTO_EX_INDEX_EC_KEY 16 /* Dynamically assigned indexes start from this value (don't use directly, use * via CRYPTO_ex_data_new_class). */ #define CRYPTO_EX_INDEX_USER 100 +#ifndef LIBRESSL_INTERNAL #define CRYPTO_malloc_init() (0) #define CRYPTO_malloc_debug_init() (0) @@ -329,7 +323,16 @@ int CRYPTO_is_mem_check_on(void); #define OPENSSL_malloc_locked(num) \ CRYPTO_malloc_locked((int)num,__FILE__,__LINE__) #define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr) +#endif +const char *OpenSSL_version(int type); +#define OPENSSL_VERSION 0 +#define OPENSSL_CFLAGS 1 +#define OPENSSL_BUILT_ON 2 +#define OPENSSL_PLATFORM 3 +#define OPENSSL_DIR 4 +#define OPENSSL_ENGINES_DIR 5 +unsigned long OpenSSL_version_num(void); const char *SSLeay_version(int type); unsigned long SSLeay(void); @@ -360,42 +363,43 @@ void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx); * potential race-conditions. */ void CRYPTO_cleanup_all_ex_data(void); -int CRYPTO_get_new_lockid(char *name); - -int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */ void CRYPTO_lock(int mode, int type, const char *file, int line); -void CRYPTO_set_locking_callback(void (*func)(int mode, int type, - const char *file, int line)); -void (*CRYPTO_get_locking_callback(void))(int mode, int type, - const char *file, int line); -void CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int type, - const char *file, int line)); -int (*CRYPTO_get_add_lock_callback(void))(int *num, int mount, int type, - const char *file, int line); +int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, + int line); /* Don't use this structure directly. */ typedef struct crypto_threadid_st { void *ptr; unsigned long val; } CRYPTO_THREADID; -/* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ -void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val); -void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr); -int CRYPTO_THREADID_set_callback(void (*threadid_func)(CRYPTO_THREADID *)); -void (*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *); void CRYPTO_THREADID_current(CRYPTO_THREADID *id); int CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b); void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src); unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id); -#ifndef OPENSSL_NO_DEPRECATED + +#ifndef LIBRESSL_INTERNAL +/* These functions are deprecated no-op stubs */ void CRYPTO_set_id_callback(unsigned long (*func)(void)); unsigned long (*CRYPTO_get_id_callback(void))(void); unsigned long CRYPTO_thread_id(void); -#endif +int CRYPTO_get_new_lockid(char *name); const char *CRYPTO_get_lock_name(int type); -int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, - int line); + +int CRYPTO_num_locks(void); +void CRYPTO_set_locking_callback(void (*func)(int mode, int type, + const char *file, int line)); +void (*CRYPTO_get_locking_callback(void))(int mode, int type, + const char *file, int line); +void CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int type, + const char *file, int line)); +int (*CRYPTO_get_add_lock_callback(void))(int *num, int mount, int type, + const char *file, int line); + +void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val); +void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr); +int CRYPTO_THREADID_set_callback(void (*threadid_func)(CRYPTO_THREADID *)); +void (*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *); int CRYPTO_get_new_dynlockid(void); void CRYPTO_destroy_dynlockid(int i); @@ -406,6 +410,7 @@ void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)(struct CRY struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))(const char *file, int line); void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line); void (*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l, const char *file, int line); +#endif /* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- * call the latter last if you need different functions */ @@ -485,11 +490,11 @@ long CRYPTO_dbg_get_options(void) __attribute__ ((deprecated)); -void CRYPTO_mem_leaks_fp(FILE *); -void CRYPTO_mem_leaks(struct bio_st *bio); +int CRYPTO_mem_leaks_fp(FILE *); +int CRYPTO_mem_leaks(struct bio_st *bio); /* unsigned long order, char *file, int line, int num_bytes, char *addr */ -typedef void *CRYPTO_MEM_LEAK_CB(unsigned long, const char *, int, int, void *); -void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb); +typedef int *CRYPTO_MEM_LEAK_CB(unsigned long, const char *, int, int, void *); +int CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb); /* die if we have to */ void OpenSSLDie(const char *file, int line, const char *assertion); @@ -534,6 +539,40 @@ void ERR_load_CRYPTO_strings(void); #define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101 #define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100 +/* + * OpenSSL compatible OPENSSL_INIT options. + */ + +#define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000001L +#define OPENSSL_INIT_LOAD_CONFIG 0x00000002L + +/* LibreSSL specific */ +#define _OPENSSL_INIT_FLAG_NOOP 0x80000000L + +/* + * These are provided for compatibiliy, but have no effect + * on how LibreSSL is initialized. + */ +#define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ADD_ALL_CIPHERS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ADD_ALL_DIGESTS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_NO_ADD_ALL_CIPHERS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_NO_ADD_ALL_DIGESTS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ASYNC _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_RDRAND _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_DYNAMIC _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_OPENSSL _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_CRYPTODEV _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_CAPI _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_PADLOCK _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_AFALG _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_reserved_internal _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ATFORK _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_ALL_BUILTIN _OPENSSL_INIT_FLAG_NOOP + +int OPENSSL_init_crypto(uint64_t opts, const void *settings); + #ifdef __cplusplus } #endif diff --git a/include/openssl/dh.h b/include/openssl/dh.h index 920af3b9..082b5025 100644 --- a/include/openssl/dh.h +++ b/include/openssl/dh.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dh.h,v 1.18 2016/11/04 18:35:30 jsing Exp $ */ +/* $OpenBSD: dh.h,v 1.25 2018/02/22 16:41:04 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -183,11 +183,23 @@ DH * DH_new(void); void DH_free(DH *dh); int DH_up_ref(DH *dh); int DH_size(const DH *dh); +int DH_bits(const DH *dh); int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); int DH_set_ex_data(DH *d, int idx, void *arg); void *DH_get_ex_data(DH *d, int idx); +ENGINE *DH_get0_engine(DH *d); +void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, + const BIGNUM **g); +int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g); +void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key); +int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); +void DH_clear_flags(DH *dh, int flags); +int DH_test_flags(const DH *dh, int flags); +void DH_set_flags(DH *dh, int flags); +int DH_set_length(DH *dh, long length); + /* Deprecated version */ #ifndef OPENSSL_NO_DEPRECATED DH * DH_generate_parameters(int prime_len,int generator, diff --git a/include/openssl/dsa.h b/include/openssl/dsa.h index 6ddd4c35..61bfc2b4 100644 --- a/include/openssl/dsa.h +++ b/include/openssl/dsa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa.h,v 1.22 2016/11/04 18:35:30 jsing Exp $ */ +/* $OpenBSD: dsa.h,v 1.30 2018/03/17 15:19:12 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -183,6 +183,8 @@ DSA_SIG * DSA_SIG_new(void); void DSA_SIG_free(DSA_SIG *a); int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp); DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length); +void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); +int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s); DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa); int DSA_do_verify(const unsigned char *dgst,int dgst_len, @@ -257,6 +259,23 @@ int DSA_print_fp(FILE *bp, const DSA *x, int off); DH *DSA_dup_DH(const DSA *r); #endif +void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, + const BIGNUM **g); +int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g); +void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key); +int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key); +void DSA_clear_flags(DSA *d, int flags); +int DSA_test_flags(const DSA *d, int flags); +void DSA_set_flags(DSA *d, int flags); +ENGINE *DSA_get0_engine(DSA *d); + +DSA_METHOD *DSA_meth_new(const char *name, int flags); +void DSA_meth_free(DSA_METHOD *meth); +DSA_METHOD *DSA_meth_dup(const DSA_METHOD *meth); +int DSA_meth_set_sign(DSA_METHOD *meth, + DSA_SIG *(*sign)(const unsigned char *, int, DSA *)); +int DSA_meth_set_finish(DSA_METHOD *meth, int (*finish)(DSA *)); + #define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL) diff --git a/include/openssl/dtls1.h b/include/openssl/dtls1.h index 31ba0653..a0018f2a 100644 --- a/include/openssl/dtls1.h +++ b/include/openssl/dtls1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dtls1.h,v 1.21 2017/01/22 07:16:39 beck Exp $ */ +/* $OpenBSD: dtls1.h,v 1.22 2018/08/24 19:35:05 jsing Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -91,11 +91,7 @@ extern "C" { #define DTLS1_CCS_HEADER_LENGTH 1 -#ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE -#define DTLS1_AL_HEADER_LENGTH 7 -#else #define DTLS1_AL_HEADER_LENGTH 2 -#endif #ifndef OPENSSL_NO_SSL_INTERN diff --git a/include/openssl/ec.h b/include/openssl/ec.h index dc70cfa6..1c5641ec 100644 --- a/include/openssl/ec.h +++ b/include/openssl/ec.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ec.h,v 1.12 2016/11/04 17:33:19 miod Exp $ */ +/* $OpenBSD: ec.h,v 1.16 2019/01/19 01:17:41 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -705,6 +705,7 @@ int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off); /********************************************************************/ typedef struct ec_key_st EC_KEY; +typedef struct ec_key_method_st EC_KEY_METHOD; /* some values for the encoding_flag */ #define EC_PKEY_NO_PARAMETERS 0x001 @@ -911,7 +912,7 @@ EC_KEY *o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len); * of bytes needed). * \return 1 on success and 0 if an error occurred */ -int i2o_ECPublicKey(EC_KEY *key, unsigned char **out); +int i2o_ECPublicKey(const EC_KEY *key, unsigned char **out); #ifndef OPENSSL_NO_BIO /** Prints out the ec parameters on human readable form. @@ -945,6 +946,44 @@ int ECParameters_print_fp(FILE *fp, const EC_KEY *key); */ int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off); +#define EC_KEY_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef) +int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg); +void *EC_KEY_get_ex_data(const EC_KEY *key, int idx); + +const EC_KEY_METHOD *EC_KEY_OpenSSL(void); +const EC_KEY_METHOD *EC_KEY_get_default_method(void); +void EC_KEY_set_default_method(const EC_KEY_METHOD *meth); +const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key); +int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth); +EC_KEY *EC_KEY_new_method(ENGINE *engine); +EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth); +void EC_KEY_METHOD_free(EC_KEY_METHOD *meth); +void EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth, + int (*init)(EC_KEY *key), + void (*finish)(EC_KEY *key), + int (*copy)(EC_KEY *dest, const EC_KEY *src), + int (*set_group)(EC_KEY *key, const EC_GROUP *grp), + int (*set_private)(EC_KEY *key, const BIGNUM *priv_key), + int (*set_public)(EC_KEY *key, const EC_POINT *pub_key)); +void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth, + int (*keygen)(EC_KEY *key)); +void EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth, + int (*ckey)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, + void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))); +void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth, + int (**pinit)(EC_KEY *key), + void (**pfinish)(EC_KEY *key), + int (**pcopy)(EC_KEY *dest, const EC_KEY *src), + int (**pset_group)(EC_KEY *key, const EC_GROUP *grp), + int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key), + int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)); +void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, + int (**pkeygen)(EC_KEY *key)); +void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, + int (**pck)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, + void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))); + EC_KEY *ECParameters_dup(EC_KEY *key); #ifndef __cplusplus diff --git a/include/openssl/ecdsa.h b/include/openssl/ecdsa.h index 530ab265..c4e107ee 100644 --- a/include/openssl/ecdsa.h +++ b/include/openssl/ecdsa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ecdsa.h,v 1.4 2015/02/08 13:35:06 jsing Exp $ */ +/* $OpenBSD: ecdsa.h,v 1.8 2019/01/19 01:17:41 tb Exp $ */ /** * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions * \author Written by Nils Larsch for the OpenSSL project @@ -133,6 +133,20 @@ int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp); */ ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len); +/** Accessor for r and s fields of ECDSA_SIG + * \param sig pointer to ECDSA_SIG pointer + * \param pr pointer to BIGNUM pointer for r (may be NULL) + * \param ps pointer to BIGNUM pointer for s (may be NULL) + */ +void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); + +/** Setter for r and s fields of ECDSA_SIG + * \param sig pointer to ECDSA_SIG pointer + * \param r pointer to BIGNUM for r (may be NULL) + * \param s pointer to BIGNUM for s (may be NULL) + */ +int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s); + /** Computes the ECDSA signature of the given hash value using * the supplied private key and returns the created signature. * \param dgst pointer to the hash value @@ -255,6 +269,37 @@ int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg); void *ECDSA_get_ex_data(EC_KEY *d, int idx); +/* XXX should be in ec.h, but needs ECDSA_SIG */ +void EC_KEY_METHOD_set_sign(EC_KEY_METHOD *meth, + int (*sign)(int type, const unsigned char *dgst, + int dlen, unsigned char *sig, unsigned int *siglen, + const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey), + int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, + BIGNUM **kinvp, BIGNUM **rp), + ECDSA_SIG *(*sign_sig)(const unsigned char *dgst, + int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, + EC_KEY *eckey)); +void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth, + int (*verify)(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, int sig_len, EC_KEY *eckey), + int (*verify_sig)(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey)); +void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth, + int (**psign)(int type, const unsigned char *dgst, + int dlen, unsigned char *sig, unsigned int *siglen, + const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey), + int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, + BIGNUM **kinvp, BIGNUM **rp), + ECDSA_SIG *(**psign_sig)(const unsigned char *dgst, + int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, + EC_KEY *eckey)); +void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth, + int (**pverify)(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, int sig_len, EC_KEY *eckey), + int (**pverify_sig)(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey)); + + /* 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. diff --git a/include/openssl/engine.h b/include/openssl/engine.h index 30d1bde4..dc14be8e 100644 --- a/include/openssl/engine.h +++ b/include/openssl/engine.h @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.h,v 1.31 2015/07/19 22:34:27 doug Exp $ */ +/* $OpenBSD: engine.h,v 1.33 2019/01/19 01:07:00 tb Exp $ */ /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL * project 2000. */ @@ -87,6 +87,9 @@ #ifndef OPENSSL_NO_ECDSA #include #endif +#ifndef OPENSSL_NO_EC +#include +#endif #include #include #endif @@ -112,6 +115,7 @@ extern "C" { #define ENGINE_METHOD_STORE (unsigned int)0x0100 #define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200 #define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400 +#define ENGINE_METHOD_EC (unsigned int)0x0800 /* Obvious all-or-nothing cases. */ #define ENGINE_METHOD_ALL (unsigned int)0xFFFF #define ENGINE_METHOD_NONE (unsigned int)0x0000 @@ -353,6 +357,10 @@ int ENGINE_register_ECDSA(ENGINE *e); void ENGINE_unregister_ECDSA(ENGINE *e); void ENGINE_register_all_ECDSA(void); +int ENGINE_register_EC(ENGINE *e); +void ENGINE_unregister_EC(ENGINE *e); +void ENGINE_register_all_EC(void); + int ENGINE_register_DH(ENGINE *e); void ENGINE_unregister_DH(ENGINE *e); void ENGINE_register_all_DH(void); @@ -447,6 +455,7 @@ int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth); int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth); int ENGINE_set_ECDH(ENGINE *e, const ECDH_METHOD *ecdh_meth); int ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth); +int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ec_meth); int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth); int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth); int ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth); @@ -486,6 +495,7 @@ const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e); const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e); const ECDH_METHOD *ENGINE_get_ECDH(const ENGINE *e); const ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e); +const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e); const DH_METHOD *ENGINE_get_DH(const ENGINE *e); const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e); const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e); @@ -553,6 +563,7 @@ ENGINE *ENGINE_get_default_RSA(void); ENGINE *ENGINE_get_default_DSA(void); ENGINE *ENGINE_get_default_ECDH(void); ENGINE *ENGINE_get_default_ECDSA(void); +ENGINE *ENGINE_get_default_EC(void); ENGINE *ENGINE_get_default_DH(void); ENGINE *ENGINE_get_default_RAND(void); /* These functions can be used to get a functional reference to perform @@ -572,6 +583,7 @@ int ENGINE_set_default_string(ENGINE *e, const char *def_list); int ENGINE_set_default_DSA(ENGINE *e); int ENGINE_set_default_ECDH(ENGINE *e); int ENGINE_set_default_ECDSA(ENGINE *e); +int ENGINE_set_default_EC(ENGINE *e); int ENGINE_set_default_DH(ENGINE *e); int ENGINE_set_default_RAND(ENGINE *e); int ENGINE_set_default_ciphers(ENGINE *e); @@ -686,11 +698,6 @@ typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \ return 0; \ - CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \ - CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \ - CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \ - CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \ - CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \ if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \ return 0; \ if(!ERR_set_implementation(fns->err_fns)) return 0; \ diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 853abe6b..e8ab3669 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp.h,v 1.53 2017/08/28 17:48:02 jsing Exp $ */ +/* $OpenBSD: evp.h,v 1.75 2019/03/17 18:17:44 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -325,6 +325,7 @@ struct evp_cipher_st { #define EVP_CIPH_GCM_MODE 0x6 #define EVP_CIPH_CCM_MODE 0x7 #define EVP_CIPH_XTS_MODE 0x10001 +#define EVP_CIPH_WRAP_MODE 0x10002 #define EVP_CIPH_MODE 0xF0007 /* Set if variable length cipher */ #define EVP_CIPH_VARIABLE_LENGTH 0x8 @@ -356,6 +357,12 @@ struct evp_cipher_st { #define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000 #define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 +/* + * Cipher context flag to indicate that we can handle wrap mode: if allowed in + * older applications, it could overflow buffers. + */ +#define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1 + /* ctrl() values */ #define EVP_CTRL_INIT 0x0 @@ -491,10 +498,15 @@ unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher); #define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx); int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_get_iv(const EVP_CIPHER_CTX *ctx, + unsigned char *iv, size_t len); +int EVP_CIPHER_CTX_set_iv(EVP_CIPHER_CTX *ctx, + const unsigned char *iv, size_t len); int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in); void * EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); @@ -535,15 +547,19 @@ int EVP_Cipher(EVP_CIPHER_CTX *c, unsigned char *out, const unsigned char *in, #define EVP_delete_digest_alias(alias) \ OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); +EVP_MD_CTX *EVP_MD_CTX_new(void); +void EVP_MD_CTX_free(EVP_MD_CTX *ctx); void EVP_MD_CTX_init(EVP_MD_CTX *ctx); -int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); +int EVP_MD_CTX_reset(EVP_MD_CTX *ctx); EVP_MD_CTX *EVP_MD_CTX_create(void); void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); +int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr); int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags); + int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt); int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s); @@ -613,7 +629,8 @@ int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen); int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); -int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen); +int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, + size_t siglen); int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, const unsigned char *ek, int ekl, const unsigned char *iv, EVP_PKEY *priv); @@ -624,8 +641,10 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, int npubk); int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); +EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void); +void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx); void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); -void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, +int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl); void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); @@ -640,16 +659,17 @@ void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a); +int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *a); int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); #ifndef OPENSSL_NO_BIO -BIO_METHOD *BIO_f_md(void); -BIO_METHOD *BIO_f_base64(void); -BIO_METHOD *BIO_f_cipher(void); -void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, +const BIO_METHOD *BIO_f_md(void); +const BIO_METHOD *BIO_f_base64(void); +const BIO_METHOD *BIO_f_cipher(void); +int BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, const unsigned char *i, int enc); #endif @@ -675,6 +695,9 @@ const EVP_MD *EVP_sha256(void); const EVP_MD *EVP_sha384(void); const EVP_MD *EVP_sha512(void); #endif +#ifndef OPENSSL_NO_SM3 +const EVP_MD *EVP_sm3(void); +#endif #ifndef OPENSSL_NO_RIPEMD const EVP_MD *EVP_ripemd160(void); #endif @@ -760,6 +783,7 @@ const EVP_CIPHER *EVP_aes_128_ofb(void); const EVP_CIPHER *EVP_aes_128_ctr(void); const EVP_CIPHER *EVP_aes_128_ccm(void); const EVP_CIPHER *EVP_aes_128_gcm(void); +const EVP_CIPHER *EVP_aes_128_wrap(void); const EVP_CIPHER *EVP_aes_128_xts(void); const EVP_CIPHER *EVP_aes_192_ecb(void); const EVP_CIPHER *EVP_aes_192_cbc(void); @@ -771,6 +795,7 @@ const EVP_CIPHER *EVP_aes_192_ofb(void); const EVP_CIPHER *EVP_aes_192_ctr(void); const EVP_CIPHER *EVP_aes_192_ccm(void); const EVP_CIPHER *EVP_aes_192_gcm(void); +const EVP_CIPHER *EVP_aes_192_wrap(void); const EVP_CIPHER *EVP_aes_256_ecb(void); const EVP_CIPHER *EVP_aes_256_cbc(void); const EVP_CIPHER *EVP_aes_256_cfb1(void); @@ -781,6 +806,7 @@ const EVP_CIPHER *EVP_aes_256_ofb(void); const EVP_CIPHER *EVP_aes_256_ctr(void); const EVP_CIPHER *EVP_aes_256_ccm(void); const EVP_CIPHER *EVP_aes_256_gcm(void); +const EVP_CIPHER *EVP_aes_256_wrap(void); const EVP_CIPHER *EVP_aes_256_xts(void); #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void); @@ -821,6 +847,15 @@ const EVP_CIPHER *EVP_gost2814789_cfb64(void); const EVP_CIPHER *EVP_gost2814789_cnt(void); #endif +#ifndef OPENSSL_NO_SM4 +const EVP_CIPHER *EVP_sm4_ecb(void); +const EVP_CIPHER *EVP_sm4_cbc(void); +const EVP_CIPHER *EVP_sm4_cfb128(void); +#define EVP_sm4_cfb EVP_sm4_cfb128 +const EVP_CIPHER *EVP_sm4_ofb(void); +const EVP_CIPHER *EVP_sm4_ctr(void); +#endif + void OPENSSL_add_all_algorithms_noconf(void); void OPENSSL_add_all_algorithms_conf(void); @@ -861,32 +896,37 @@ int EVP_PKEY_encrypt_old(unsigned char *enc_key, const unsigned char *key, int EVP_PKEY_type(int type); int EVP_PKEY_id(const EVP_PKEY *pkey); int EVP_PKEY_base_id(const EVP_PKEY *pkey); -int EVP_PKEY_bits(EVP_PKEY *pkey); -int EVP_PKEY_size(EVP_PKEY *pkey); +int EVP_PKEY_bits(const EVP_PKEY *pkey); +int EVP_PKEY_size(const EVP_PKEY *pkey); int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); -void *EVP_PKEY_get0(EVP_PKEY *pkey); +void *EVP_PKEY_get0(const EVP_PKEY *pkey); +const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len); #ifndef OPENSSL_NO_RSA struct rsa_st; -int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key); +struct rsa_st *EVP_PKEY_get0_RSA(EVP_PKEY *pkey); struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); +int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key); #endif #ifndef OPENSSL_NO_DSA struct dsa_st; -int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key); +struct dsa_st *EVP_PKEY_get0_DSA(EVP_PKEY *pkey); struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); +int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key); #endif #ifndef OPENSSL_NO_DH struct dh_st; -int EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key); +struct dh_st *EVP_PKEY_get0_DH(EVP_PKEY *pkey); struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey); +int EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key); #endif #ifndef OPENSSL_NO_EC struct ec_key_st; -int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key); +struct ec_key_st *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey); struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); +int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key); #endif #ifndef OPENSSL_NO_GOST struct gost_key_st; @@ -894,6 +934,7 @@ struct gost_key_st; EVP_PKEY *EVP_PKEY_new(void); void EVP_PKEY_free(EVP_PKEY *pkey); +int EVP_PKEY_up_ref(EVP_PKEY *pkey); EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length); @@ -985,7 +1026,7 @@ int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, int *ppkey_flags, const char **pinfo, const char **ppem_str, const EVP_PKEY_ASN1_METHOD *ameth); -const EVP_PKEY_ASN1_METHOD* EVP_PKEY_get0_asn1(EVP_PKEY *pkey); +const EVP_PKEY_ASN1_METHOD* EVP_PKEY_get0_asn1(const EVP_PKEY *pkey); EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, const char *info); void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, @@ -1000,7 +1041,7 @@ void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, int (*pkey_size)(const EVP_PKEY *pk), int (*pkey_bits)(const EVP_PKEY *pk)); void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, - int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf), + int (*priv_decode)(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf), int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk), int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx)); @@ -1222,6 +1263,8 @@ const EVP_AEAD *EVP_aead_aes_256_gcm(void); #if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305) /* EVP_aead_chacha20_poly1305 is ChaCha20 with a Poly1305 authenticator. */ const EVP_AEAD *EVP_aead_chacha20_poly1305(void); +/* EVP_aead_xchacha20_poly1305 is XChaCha20 with a Poly1305 authenticator. */ +const EVP_AEAD *EVP_aead_xchacha20_poly1305(void); #endif /* EVP_AEAD_key_length returns the length of the keys used. */ @@ -1445,6 +1488,7 @@ void ERR_load_EVP_strings(void); #define EVP_R_ERROR_LOADING_SECTION 165 #define EVP_R_ERROR_SETTING_FIPS_MODE 166 #define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 +#define EVP_R_EXPECTING_AN_HMAC_KEY 174 #define EVP_R_EXPECTING_AN_RSA_KEY 127 #define EVP_R_EXPECTING_A_DH_KEY 128 #define EVP_R_EXPECTING_A_DSA_KEY 129 @@ -1491,6 +1535,7 @@ void ERR_load_EVP_strings(void); #define EVP_R_UNSUPPORTED_KEY_SIZE 108 #define EVP_R_UNSUPPORTED_PRF 125 #define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 +#define EVP_R_WRAP_MODE_NOT_ALLOWED 170 #define EVP_R_UNSUPPORTED_SALT_TYPE 126 #define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109 #define EVP_R_WRONG_PUBLIC_KEY_TYPE 110 diff --git a/include/openssl/hkdf.h b/include/openssl/hkdf.h index fb0fac37..34450f9d 100644 --- a/include/openssl/hkdf.h +++ b/include/openssl/hkdf.h @@ -1,3 +1,4 @@ +/* $OpenBSD: hkdf.h,v 1.2 2018/04/03 13:33:53 tb Exp $ */ /* Copyright (c) 2014, Google Inc. * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/include/openssl/hmac.h b/include/openssl/hmac.h index f3418b3c..e787c62a 100644 --- a/include/openssl/hmac.h +++ b/include/openssl/hmac.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hmac.h,v 1.12 2014/06/21 13:39:46 jsing Exp $ */ +/* $OpenBSD: hmac.h,v 1.13 2018/02/17 14:53:59 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -83,8 +83,10 @@ typedef struct hmac_ctx_st { #define HMAC_size(e) (EVP_MD_size((e)->md)) - +HMAC_CTX *HMAC_CTX_new(void); +void HMAC_CTX_free(HMAC_CTX *ctx); void HMAC_CTX_init(HMAC_CTX *ctx); +int HMAC_CTX_reset(HMAC_CTX *ctx); void HMAC_CTX_cleanup(HMAC_CTX *ctx); #define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */ @@ -100,6 +102,7 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); +const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx); #ifdef __cplusplus } diff --git a/include/openssl/modes.h b/include/openssl/modes.h index a532cb3f..67ec7518 100644 --- a/include/openssl/modes.h +++ b/include/openssl/modes.h @@ -1,4 +1,4 @@ -/* $OpenBSD: modes.h,v 1.2 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: modes.h,v 1.3 2018/07/24 10:47:19 bcook Exp $ */ /* ==================================================================== * Copyright (c) 2008 The OpenSSL Project. All rights reserved. * @@ -8,6 +8,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*block128_f)(const unsigned char in[16], unsigned char out[16], const void *key); @@ -134,3 +138,7 @@ typedef struct xts128_context XTS128_CONTEXT; int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], const unsigned char *inp, unsigned char *out, size_t len, int enc); + +#ifdef __cplusplus +} +#endif diff --git a/include/openssl/obj_mac.h b/include/openssl/obj_mac.h index 753ef109..2a690b37 100644 --- a/include/openssl/obj_mac.h +++ b/include/openssl/obj_mac.h @@ -3895,6 +3895,16 @@ #define NID_id_GostR3410_2001_ParamSet_cc 854 #define OBJ_id_GostR3410_2001_ParamSet_cc OBJ_cryptocom,1L,8L,1L +#define SN_sm3 "SM3" +#define LN_sm3 "sm3" +#define NID_sm3 968 +#define OBJ_sm3 1L,2L,156L,10197L,1L,401L + +#define SN_sm3WithRSAEncryption "RSA-SM3" +#define LN_sm3WithRSAEncryption "sm3WithRSAEncryption" +#define NID_sm3WithRSAEncryption 969 +#define OBJ_sm3WithRSAEncryption 1L,2L,156L,10197L,1L,504L + #define SN_camellia_128_cbc "CAMELLIA-128-CBC" #define LN_camellia_128_cbc "camellia-128-cbc" #define NID_camellia_128_cbc 751 @@ -4020,6 +4030,54 @@ #define NID_seed_ofb128 778 #define OBJ_seed_ofb128 OBJ_kisa,1L,6L +#define SN_ISO_CN "ISO-CN" +#define LN_ISO_CN "ISO CN Member Body" +#define NID_ISO_CN 970 +#define OBJ_ISO_CN OBJ_member_body,156L + +#define SN_oscca "oscca" +#define NID_oscca 971 +#define OBJ_oscca OBJ_ISO_CN,10197L + +#define SN_sm_scheme "sm-scheme" +#define NID_sm_scheme 972 +#define OBJ_sm_scheme OBJ_oscca,1L + +#define SN_sm4_ecb "SM4-ECB" +#define LN_sm4_ecb "sm4-ecb" +#define NID_sm4_ecb 973 +#define OBJ_sm4_ecb OBJ_sm_scheme,104L,1L + +#define SN_sm4_cbc "SM4-CBC" +#define LN_sm4_cbc "sm4-cbc" +#define NID_sm4_cbc 974 +#define OBJ_sm4_cbc OBJ_sm_scheme,104L,2L + +#define SN_sm4_ofb128 "SM4-OFB" +#define LN_sm4_ofb128 "sm4-ofb" +#define NID_sm4_ofb128 975 +#define OBJ_sm4_ofb128 OBJ_sm_scheme,104L,3L + +#define SN_sm4_cfb128 "SM4-CFB" +#define LN_sm4_cfb128 "sm4-cfb" +#define NID_sm4_cfb128 976 +#define OBJ_sm4_cfb128 OBJ_sm_scheme,104L,4L + +#define SN_sm4_cfb1 "SM4-CFB1" +#define LN_sm4_cfb1 "sm4-cfb1" +#define NID_sm4_cfb1 977 +#define OBJ_sm4_cfb1 OBJ_sm_scheme,104L,5L + +#define SN_sm4_cfb8 "SM4-CFB8" +#define LN_sm4_cfb8 "sm4-cfb8" +#define NID_sm4_cfb8 978 +#define OBJ_sm4_cfb8 OBJ_sm_scheme,104L,6L + +#define SN_sm4_ctr "SM4-CTR" +#define LN_sm4_ctr "sm4-ctr" +#define NID_sm4_ctr 979 +#define OBJ_sm4_ctr OBJ_sm_scheme,104L,7L + #define SN_hmac "HMAC" #define LN_hmac "hmac" #define NID_hmac 855 @@ -4116,6 +4174,10 @@ #define LN_chacha20 "chacha" #define NID_chacha20 937 +#define SN_chacha20_poly1305 "ChaCha20-Poly1305" +#define LN_chacha20_poly1305 "chacha20-poly1305" +#define NID_chacha20_poly1305 967 + #define SN_gost89_ecb "gost89-ecb" #define NID_gost89_ecb 938 @@ -4192,3 +4254,35 @@ #define NID_Ed448ph 955 #define OBJ_Ed448ph 1L,3L,101L,115L +#define SN_kx_rsa "KxRSA" +#define LN_kx_rsa "kx-rsa" +#define NID_kx_rsa 959 + +#define SN_kx_ecdhe "KxECDHE" +#define LN_kx_ecdhe "kx-ecdhe" +#define NID_kx_ecdhe 960 + +#define SN_kx_dhe "KxDHE" +#define LN_kx_dhe "kx-dhe" +#define NID_kx_dhe 961 + +#define SN_kx_gost "KxGOST" +#define LN_kx_gost "kx-gost" +#define NID_kx_gost 962 + +#define SN_auth_rsa "AuthRSA" +#define LN_auth_rsa "auth-rsa" +#define NID_auth_rsa 963 + +#define SN_auth_ecdsa "AuthECDSA" +#define LN_auth_ecdsa "auth-ecdsa" +#define NID_auth_ecdsa 964 + +#define SN_auth_gost01 "AuthGOST01" +#define LN_auth_gost01 "auth-gost01" +#define NID_auth_gost01 965 + +#define SN_auth_null "AuthNULL" +#define LN_auth_null "auth-null" +#define NID_auth_null 966 + diff --git a/include/openssl/ocsp.h b/include/openssl/ocsp.h index e3fa6f5a..316fb8ed 100644 --- a/include/openssl/ocsp.h +++ b/include/openssl/ocsp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp.h,v 1.11 2016/12/30 16:19:04 jsing Exp $ */ +/* $OpenBSD: ocsp.h,v 1.16 2018/08/24 20:03:21 tb Exp $ */ /* Written by Tom Titchener for the OpenSSL * project. */ @@ -383,8 +383,8 @@ typedef struct ocsp_service_locator_st { OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id); -OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req); -OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, +OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req); +OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req, int maxline); int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx); void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx); @@ -392,10 +392,11 @@ int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req); int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, const char *name, const char *value); -OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer); +OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject, + const X509 *issuer); -OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, X509_NAME *issuerName, - ASN1_BIT_STRING* issuerKey, ASN1_INTEGER *serialNumber); +OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, const X509_NAME *issuerName, + const ASN1_BIT_STRING *issuerKey, const ASN1_INTEGER *serialNumber); OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid); @@ -428,8 +429,8 @@ int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, unsigned long flags); -int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, - int *pssl); +int OCSP_parse_url(const char *url, char **phost, char **pport, + char **ppath, int *pssl); int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b); int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b); @@ -449,17 +450,17 @@ int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert); int OCSP_basic_sign(OCSP_BASICRESP *brsp, X509 *signer, EVP_PKEY *key, const EVP_MD *dgst, STACK_OF(X509) *certs, unsigned long flags); -X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim); +X509_EXTENSION *OCSP_crlID_new(const char *url, long *n, char *tim); X509_EXTENSION *OCSP_accept_responses_new(char **oids); X509_EXTENSION *OCSP_archive_cutoff_new(char* tim); -X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, char **urls); +X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, const char **urls); int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x); int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos); -int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, +int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj, int lastpos); int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos); @@ -472,7 +473,7 @@ int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc); int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x); int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos); -int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, +int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj, int lastpos); int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos); X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc); @@ -484,7 +485,7 @@ int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc); int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x); int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos); -int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, +int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj, int lastpos); int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, int lastpos); @@ -499,8 +500,8 @@ int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc); int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x); int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos); -int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj, - int lastpos); +int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, + const ASN1_OBJECT *obj, int lastpos); int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, int lastpos); X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc); @@ -511,6 +512,7 @@ int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, int crit, unsigned long flags); int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc); +const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x); OCSP_SINGLERESP *OCSP_SINGLERESP_new(void); void OCSP_SINGLERESP_free(OCSP_SINGLERESP *a); diff --git a/include/openssl/opensslfeatures.h b/include/openssl/opensslfeatures.h index ba4dbba9..688d478d 100644 --- a/include/openssl/opensslfeatures.h +++ b/include/openssl/opensslfeatures.h @@ -1,26 +1,111 @@ -# define OPENSSL_NO_EC_NISTP_64_GCC_128 -# define OPENSSL_NO_CMS -# define OPENSSL_NO_COMP -# define OPENSSL_NO_EGD -# define OPENSSL_NO_GMP -# define OPENSSL_NO_JPAKE -# define OPENSSL_NO_KRB5 -# define OPENSSL_NO_MD2 -# define OPENSSL_NO_MDC2 -# define OPENSSL_NO_PSK -# define OPENSSL_NO_RC5 -# define OPENSSL_NO_RFC3779 -# define OPENSSL_NO_RSAX -# define OPENSSL_NO_SCTP -# define OPENSSL_NO_SEED -# define OPENSSL_NO_SHA0 -# define OPENSSL_NO_SRP -# define OPENSSL_NO_SSL2 -# define OPENSSL_NO_SSL3 -# define OPENSSL_NO_SSL3_METHOD -# define OPENSSL_NO_STORE -# define OPENSSL_NO_BUF_FREELISTS -# define OPENSSL_NO_HEARTBEATS -# define OPENSSL_NO_DYNAMIC_ENGINE +/* + * Feature flags for LibreSSL... so you can actually tell when things + * are enabled, rather than not being able to tell when things are + * enabled (or possibly not yet not implemented, or removed!). + */ +/* #define LIBRESSL_HAS_TLS1_3 */ -# define OPENSSL_THREADS +#define OPENSSL_THREADS + +#define OPENSSL_NO_BUF_FREELISTS +#define OPENSSL_NO_GMP +#define OPENSSL_NO_JPAKE +#define OPENSSL_NO_KRB5 +#define OPENSSL_NO_RSAX +#define OPENSSL_NO_SHA0 +#define OPENSSL_NO_SSL2 +#define OPENSSL_NO_STORE + +/* + * OPENSSL_NO_* flags that currently appear in OpenSSL. + */ + +/* #define OPENSSL_NO_AFALGENG */ +/* #define OPENSSL_NO_ALGORITHMS */ +/* #define OPENSSL_NO_ARIA */ +/* #define OPENSSL_NO_ASM */ +#define OPENSSL_NO_ASYNC +/* #define OPENSSL_NO_AUTOALGINIT */ +/* #define OPENSSL_NO_AUTOERRINIT */ +/* #define OPENSSL_NO_AUTOLOAD_CONFIG */ +/* #define OPENSSL_NO_BF */ +/* #define OPENSSL_NO_BLAKE2 */ +/* #define OPENSSL_NO_CAMELLIA */ +/* #define OPENSSL_NO_CAST */ +/* #define OPENSSL_NO_CHACHA */ +/* #define OPENSSL_NO_CMAC */ +#define OPENSSL_NO_CMS +#define OPENSSL_NO_COMP /* XXX */ +/* #define OPENSSL_NO_CRYPTO_MDEBUG */ +/* #define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE */ +/* #define OPENSSL_NO_CT */ +/* #define OPENSSL_NO_DECC_INIT */ +/* #define OPENSSL_NO_DES */ +/* #define OPENSSL_NO_DGRAM */ +/* #define OPENSSL_NO_DH */ +/* #define OPENSSL_NO_DSA */ +/* #define OPENSSL_NO_DSO */ +/* #define OPENSSL_NO_DTLS */ +/* #define OPENSSL_NO_DTLS1 */ +/* #define OPENSSL_NO_DTLS1_2 */ +/* #define OPENSSL_NO_DTLS1_2_METHOD */ +/* #define OPENSSL_NO_DTLS1_METHOD */ +#define OPENSSL_NO_DYNAMIC_ENGINE +/* #define OPENSSL_NO_EC */ +/* #define OPENSSL_NO_EC2M */ +#define OPENSSL_NO_EC_NISTP_64_GCC_128 +#define OPENSSL_NO_EGD +/* #define OPENSSL_NO_ENGINE */ +/* #define OPENSSL_NO_ERR */ +/* #define OPENSSL_NO_FUZZ_LIBFUZZER */ +/* #define OPENSSL_NO_GOST */ +#define OPENSSL_NO_HEARTBEATS +/* #define OPENSSL_NO_HW */ +/* #define OPENSSL_NO_HW_PADLOCK */ +/* #define OPENSSL_NO_IDEA */ +#define OPENSSL_NO_MD2 +/* #define OPENSSL_NO_MD4 */ +/* #define OPENSSL_NO_MD5 */ +#define OPENSSL_NO_MDC2 +/* #define OPENSSL_NO_MULTIBLOCK */ +/* #define OPENSSL_NO_NEXTPROTONEG */ +/* #define OPENSSL_NO_OCB */ +/* #define OPENSSL_NO_OCSP */ +/* #define OPENSSL_NO_POLY1305 */ +/* #define OPENSSL_NO_POSIX_IO */ +#define OPENSSL_NO_PSK +/* #define OPENSSL_NO_RC2 */ +/* #define OPENSSL_NO_RC4 */ +#define OPENSSL_NO_RC5 +#define OPENSSL_NO_RFC3779 +/* #define OPENSSL_NO_RMD160 */ +/* #define OPENSSL_NO_RSA */ +/* #define OPENSSL_NO_SCRYPT */ +#define OPENSSL_NO_SCTP +#define OPENSSL_NO_SEED +/* #define OPENSSL_NO_SIPHASH */ +/* #define OPENSSL_NO_SM2 */ +/* #define OPENSSL_NO_SM3 */ +/* #define OPENSSL_NO_SM4 */ +/* #define OPENSSL_NO_SOCK */ +#define OPENSSL_NO_SRP +/* #define OPENSSL_NO_SRTP */ +#define OPENSSL_NO_SSL3 +#define OPENSSL_NO_SSL3_METHOD +/* #define OPENSSL_NO_SSL_TRACE */ +/* #define OPENSSL_NO_STDIO */ +/* #define OPENSSL_NO_TLS */ +/* #define OPENSSL_NO_TLS1 */ +/* #define OPENSSL_NO_TLS1_1 */ +/* #define OPENSSL_NO_TLS1_1_METHOD */ +/* #define OPENSSL_NO_TLS1_2 */ +/* #define OPENSSL_NO_TLS1_2_METHOD */ +#ifndef LIBRESSL_HAS_TLS1_3 +#define OPENSSL_NO_TLS1_3 +#endif +/* #define OPENSSL_NO_TLS1_METHOD */ +/* #define OPENSSL_NO_TS */ +/* #define OPENSSL_NO_UI_CONSOLE */ +/* #define OPENSSL_NO_UNIT_TEST */ +/* #define OPENSSL_NO_WEAK_SSL_CIPHERS */ +/* #define OPENSSL_NO_WHIRLPOOL */ diff --git a/include/openssl/opensslv.h b/include/openssl/opensslv.h index af1939fc..4c222dee 100644 --- a/include/openssl/opensslv.h +++ b/include/openssl/opensslv.h @@ -1,10 +1,11 @@ -/* $OpenBSD: opensslv.h,v 1.43.4.2 2018/06/13 14:55:24 bcook Exp $ */ +/* $OpenBSD: opensslv.h,v 1.51.2.1 2019/05/13 12:05:04 bcook Exp $ */ #ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H /* These will change with each release of LibreSSL-portable */ -#define LIBRESSL_VERSION_NUMBER 0x2060500fL -#define LIBRESSL_VERSION_TEXT "LibreSSL 2.6.5" +#define LIBRESSL_VERSION_NUMBER 0x2090200fL +/* ^ Patch starts here */ +#define LIBRESSL_VERSION_TEXT "LibreSSL 2.9.2" /* These will never change */ #define OPENSSL_VERSION_NUMBER 0x20000000L diff --git a/include/openssl/pem.h b/include/openssl/pem.h index d1916a18..adc85226 100644 --- a/include/openssl/pem.h +++ b/include/openssl/pem.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pem.h,v 1.17 2016/09/04 16:22:54 jsing Exp $ */ +/* $OpenBSD: pem.h,v 1.19 2018/08/24 19:51:31 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -385,8 +385,8 @@ int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data, long *len, #ifndef OPENSSL_NO_BIO int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data, long *len); -int PEM_write_bio(BIO *bp, const char *name, char *hdr, unsigned char *data, - long len); +int PEM_write_bio(BIO *bp, const char *name, const char *hdr, + const unsigned char *data, long len); int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, pem_password_cb *cb, void *u); void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, @@ -403,8 +403,8 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, int PEM_read(FILE *fp, char **name, char **header, unsigned char **data, long *len); -int PEM_write(FILE *fp, char *name, char *hdr, unsigned char *data, - long len); +int PEM_write(FILE *fp, const char *name, const char *hdr, + const unsigned char *data, long len); void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, pem_password_cb *cb, void *u); int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp, @@ -421,8 +421,8 @@ void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl, unsigned char *out, int *outl, EVP_PKEY *priv); -void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type); -void PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt); +int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type); +int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt); int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey); diff --git a/include/openssl/pkcs12.h b/include/openssl/pkcs12.h index e30f9ac7..56635f9d 100644 --- a/include/openssl/pkcs12.h +++ b/include/openssl/pkcs12.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs12.h,v 1.17 2016/12/30 15:08:58 jsing Exp $ */ +/* $OpenBSD: pkcs12.h,v 1.24 2018/05/30 15:32:11 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -178,9 +178,10 @@ X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag); PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, int nid1, int nid2); PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8); -PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, int passlen); -PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, const char *pass, +PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(const X509_SIG *p8, const char *pass, int passlen); +PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag, + const char *pass, int passlen); X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, const char *pass, int passlen, unsigned char *salt, int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8); @@ -195,7 +196,7 @@ STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen); int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); -STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12); +STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12); int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen); @@ -206,13 +207,14 @@ int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, const unsigned char *name, int namelen); int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); -ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid); +ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs, + int attr_nid); char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); -unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, - int passlen, unsigned char *in, int inlen, unsigned char **data, +unsigned char *PKCS12_pbe_crypt(const X509_ALGOR *algor, const char *pass, + int passlen, const unsigned char *in, int inlen, unsigned char **data, int *datalen, int en_de); -void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, - const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf); +void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it, + const char *pass, int passlen, const ASN1_OCTET_STRING *oct, int zbuf); ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it, const char *pass, int passlen, void *obj, int zbuf); PKCS12 *PKCS12_init(int mode); @@ -235,7 +237,7 @@ int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, const EVP_MD *md_type); unsigned char *OPENSSL_asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen); -char *OPENSSL_uni2asc(unsigned char *uni, int unilen); +char *OPENSSL_uni2asc(const unsigned char *uni, int unilen); PKCS12 *PKCS12_new(void); void PKCS12_free(PKCS12 *a); @@ -264,22 +266,22 @@ extern const ASN1_ITEM PKCS12_AUTHSAFES_it; void PKCS12_PBE_add(void); int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca); -PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, - STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, +PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, + X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, int mac_iter, int keytype); PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert); PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, - int key_usage, int iter, int key_nid, char *pass); + int key_usage, int iter, int key_nid, const char *pass); int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, - int safe_nid, int iter, char *pass); + int safe_nid, int iter, const char *pass); PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid); int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12); PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); -int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass); +int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass); /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h index 7476a116..d2df1a92 100644 --- a/include/openssl/rsa.h +++ b/include/openssl/rsa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa.h,v 1.31 2017/08/30 16:07:35 jsing Exp $ */ +/* $OpenBSD: rsa.h,v 1.39 2018/09/12 06:35:38 djm Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -256,6 +256,7 @@ struct rsa_st { RSA *RSA_new(void); RSA *RSA_new_method(ENGINE *engine); +int RSA_bits(const RSA *rsa); int RSA_size(const RSA *rsa); /* Deprecated version */ @@ -395,6 +396,18 @@ int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, int RSA_set_ex_data(RSA *r, int idx, void *arg); void *RSA_get_ex_data(const RSA *r, int idx); +void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, + const BIGNUM **d); +int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d); +void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, + const BIGNUM **iqmp); +int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp); +void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q); +int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q); +void RSA_clear_flags(RSA *r, int flags); +int RSA_test_flags(const RSA *r, int flags); +void RSA_set_flags(RSA *r, int flags); + RSA *RSAPublicKey_dup(RSA *rsa); RSA *RSAPrivateKey_dup(RSA *rsa); @@ -417,6 +430,17 @@ RSA *RSAPrivateKey_dup(RSA *rsa); */ #define RSA_FLAG_CHECKED 0x0800 +RSA_METHOD *RSA_meth_new(const char *name, int flags); +void RSA_meth_free(RSA_METHOD *meth); +RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); +int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); +int RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); +int RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); +int (*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa); +int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish)(RSA *rsa)); + /* 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. diff --git a/include/openssl/safestack.h b/include/openssl/safestack.h index 6540174d..ace2e95c 100644 --- a/include/openssl/safestack.h +++ b/include/openssl/safestack.h @@ -1,4 +1,4 @@ -/* $OpenBSD: safestack.h,v 1.15 2016/12/27 16:02:40 jsing Exp $ */ +/* $OpenBSD: safestack.h,v 1.17 2018/10/24 17:57:22 jsing Exp $ */ /* ==================================================================== * Copyright (c) 1999 The OpenSSL Project. All rights reserved. * @@ -179,35 +179,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) #define SKM_sk_is_sorted(type, st) \ sk_is_sorted(CHECKED_STACK_OF(type, st)) -#ifndef LIBRESSL_INTERNAL -#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - (STACK_OF(type) *)d2i_ASN1_SET( \ - (STACK_OF(OPENSSL_BLOCK) **)CHECKED_PTR_OF(STACK_OF(type)*, st), \ - pp, length, \ - CHECKED_D2I_OF(type, d2i_func), \ - CHECKED_SK_FREE_FUNC(type, free_func), \ - ex_tag, ex_class) - -#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \ - i2d_ASN1_SET((STACK_OF(OPENSSL_BLOCK) *)CHECKED_STACK_OF(type, st), pp, \ - CHECKED_I2D_OF(type, i2d_func), \ - ex_tag, ex_class, is_set) - -#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \ - ASN1_seq_pack(CHECKED_PTR_OF(STACK_OF(type), st), \ - CHECKED_I2D_OF(type, i2d_func), buf, len) - -#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \ - (STACK_OF(type) *)ASN1_seq_unpack(buf, len, CHECKED_D2I_OF(type, d2i_func), CHECKED_SK_FREE_FUNC(type, free_func)) - -#define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \ - (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \ - CHECKED_D2I_OF(type, d2i_func), \ - CHECKED_SK_FREE_FUNC(type, free_func), \ - pass, passlen, oct, seq) -#endif - -/* This block of defines is updated by util/mkstack.pl, please do not touch! */ #define sk_ACCESS_DESCRIPTION_new(cmp) SKM_sk_new(ACCESS_DESCRIPTION, (cmp)) #define sk_ACCESS_DESCRIPTION_new_null() SKM_sk_new_null(ACCESS_DESCRIPTION) #define sk_ACCESS_DESCRIPTION_free(st) SKM_sk_free(ACCESS_DESCRIPTION, (st)) @@ -472,94 +443,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) #define sk_BY_DIR_HASH_sort(st) SKM_sk_sort(BY_DIR_HASH, (st)) #define sk_BY_DIR_HASH_is_sorted(st) SKM_sk_is_sorted(BY_DIR_HASH, (st)) -#define sk_CMS_CertificateChoices_new(cmp) SKM_sk_new(CMS_CertificateChoices, (cmp)) -#define sk_CMS_CertificateChoices_new_null() SKM_sk_new_null(CMS_CertificateChoices) -#define sk_CMS_CertificateChoices_free(st) SKM_sk_free(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_num(st) SKM_sk_num(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_value(st, i) SKM_sk_value(CMS_CertificateChoices, (st), (i)) -#define sk_CMS_CertificateChoices_set(st, i, val) SKM_sk_set(CMS_CertificateChoices, (st), (i), (val)) -#define sk_CMS_CertificateChoices_zero(st) SKM_sk_zero(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_push(st, val) SKM_sk_push(CMS_CertificateChoices, (st), (val)) -#define sk_CMS_CertificateChoices_unshift(st, val) SKM_sk_unshift(CMS_CertificateChoices, (st), (val)) -#define sk_CMS_CertificateChoices_find(st, val) SKM_sk_find(CMS_CertificateChoices, (st), (val)) -#define sk_CMS_CertificateChoices_find_ex(st, val) SKM_sk_find_ex(CMS_CertificateChoices, (st), (val)) -#define sk_CMS_CertificateChoices_delete(st, i) SKM_sk_delete(CMS_CertificateChoices, (st), (i)) -#define sk_CMS_CertificateChoices_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_CertificateChoices, (st), (ptr)) -#define sk_CMS_CertificateChoices_insert(st, val, i) SKM_sk_insert(CMS_CertificateChoices, (st), (val), (i)) -#define sk_CMS_CertificateChoices_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_CertificateChoices, (st), (cmp)) -#define sk_CMS_CertificateChoices_dup(st) SKM_sk_dup(CMS_CertificateChoices, st) -#define sk_CMS_CertificateChoices_pop_free(st, free_func) SKM_sk_pop_free(CMS_CertificateChoices, (st), (free_func)) -#define sk_CMS_CertificateChoices_shift(st) SKM_sk_shift(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_pop(st) SKM_sk_pop(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_sort(st) SKM_sk_sort(CMS_CertificateChoices, (st)) -#define sk_CMS_CertificateChoices_is_sorted(st) SKM_sk_is_sorted(CMS_CertificateChoices, (st)) - -#define sk_CMS_RecipientInfo_new(cmp) SKM_sk_new(CMS_RecipientInfo, (cmp)) -#define sk_CMS_RecipientInfo_new_null() SKM_sk_new_null(CMS_RecipientInfo) -#define sk_CMS_RecipientInfo_free(st) SKM_sk_free(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_num(st) SKM_sk_num(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_value(st, i) SKM_sk_value(CMS_RecipientInfo, (st), (i)) -#define sk_CMS_RecipientInfo_set(st, i, val) SKM_sk_set(CMS_RecipientInfo, (st), (i), (val)) -#define sk_CMS_RecipientInfo_zero(st) SKM_sk_zero(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_push(st, val) SKM_sk_push(CMS_RecipientInfo, (st), (val)) -#define sk_CMS_RecipientInfo_unshift(st, val) SKM_sk_unshift(CMS_RecipientInfo, (st), (val)) -#define sk_CMS_RecipientInfo_find(st, val) SKM_sk_find(CMS_RecipientInfo, (st), (val)) -#define sk_CMS_RecipientInfo_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientInfo, (st), (val)) -#define sk_CMS_RecipientInfo_delete(st, i) SKM_sk_delete(CMS_RecipientInfo, (st), (i)) -#define sk_CMS_RecipientInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientInfo, (st), (ptr)) -#define sk_CMS_RecipientInfo_insert(st, val, i) SKM_sk_insert(CMS_RecipientInfo, (st), (val), (i)) -#define sk_CMS_RecipientInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientInfo, (st), (cmp)) -#define sk_CMS_RecipientInfo_dup(st) SKM_sk_dup(CMS_RecipientInfo, st) -#define sk_CMS_RecipientInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientInfo, (st), (free_func)) -#define sk_CMS_RecipientInfo_shift(st) SKM_sk_shift(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_pop(st) SKM_sk_pop(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_sort(st) SKM_sk_sort(CMS_RecipientInfo, (st)) -#define sk_CMS_RecipientInfo_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientInfo, (st)) - -#define sk_CMS_RevocationInfoChoice_new(cmp) SKM_sk_new(CMS_RevocationInfoChoice, (cmp)) -#define sk_CMS_RevocationInfoChoice_new_null() SKM_sk_new_null(CMS_RevocationInfoChoice) -#define sk_CMS_RevocationInfoChoice_free(st) SKM_sk_free(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_num(st) SKM_sk_num(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_value(st, i) SKM_sk_value(CMS_RevocationInfoChoice, (st), (i)) -#define sk_CMS_RevocationInfoChoice_set(st, i, val) SKM_sk_set(CMS_RevocationInfoChoice, (st), (i), (val)) -#define sk_CMS_RevocationInfoChoice_zero(st) SKM_sk_zero(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_push(st, val) SKM_sk_push(CMS_RevocationInfoChoice, (st), (val)) -#define sk_CMS_RevocationInfoChoice_unshift(st, val) SKM_sk_unshift(CMS_RevocationInfoChoice, (st), (val)) -#define sk_CMS_RevocationInfoChoice_find(st, val) SKM_sk_find(CMS_RevocationInfoChoice, (st), (val)) -#define sk_CMS_RevocationInfoChoice_find_ex(st, val) SKM_sk_find_ex(CMS_RevocationInfoChoice, (st), (val)) -#define sk_CMS_RevocationInfoChoice_delete(st, i) SKM_sk_delete(CMS_RevocationInfoChoice, (st), (i)) -#define sk_CMS_RevocationInfoChoice_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RevocationInfoChoice, (st), (ptr)) -#define sk_CMS_RevocationInfoChoice_insert(st, val, i) SKM_sk_insert(CMS_RevocationInfoChoice, (st), (val), (i)) -#define sk_CMS_RevocationInfoChoice_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RevocationInfoChoice, (st), (cmp)) -#define sk_CMS_RevocationInfoChoice_dup(st) SKM_sk_dup(CMS_RevocationInfoChoice, st) -#define sk_CMS_RevocationInfoChoice_pop_free(st, free_func) SKM_sk_pop_free(CMS_RevocationInfoChoice, (st), (free_func)) -#define sk_CMS_RevocationInfoChoice_shift(st) SKM_sk_shift(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_pop(st) SKM_sk_pop(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_sort(st) SKM_sk_sort(CMS_RevocationInfoChoice, (st)) -#define sk_CMS_RevocationInfoChoice_is_sorted(st) SKM_sk_is_sorted(CMS_RevocationInfoChoice, (st)) - -#define sk_CMS_SignerInfo_new(cmp) SKM_sk_new(CMS_SignerInfo, (cmp)) -#define sk_CMS_SignerInfo_new_null() SKM_sk_new_null(CMS_SignerInfo) -#define sk_CMS_SignerInfo_free(st) SKM_sk_free(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_num(st) SKM_sk_num(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_value(st, i) SKM_sk_value(CMS_SignerInfo, (st), (i)) -#define sk_CMS_SignerInfo_set(st, i, val) SKM_sk_set(CMS_SignerInfo, (st), (i), (val)) -#define sk_CMS_SignerInfo_zero(st) SKM_sk_zero(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_push(st, val) SKM_sk_push(CMS_SignerInfo, (st), (val)) -#define sk_CMS_SignerInfo_unshift(st, val) SKM_sk_unshift(CMS_SignerInfo, (st), (val)) -#define sk_CMS_SignerInfo_find(st, val) SKM_sk_find(CMS_SignerInfo, (st), (val)) -#define sk_CMS_SignerInfo_find_ex(st, val) SKM_sk_find_ex(CMS_SignerInfo, (st), (val)) -#define sk_CMS_SignerInfo_delete(st, i) SKM_sk_delete(CMS_SignerInfo, (st), (i)) -#define sk_CMS_SignerInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_SignerInfo, (st), (ptr)) -#define sk_CMS_SignerInfo_insert(st, val, i) SKM_sk_insert(CMS_SignerInfo, (st), (val), (i)) -#define sk_CMS_SignerInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_SignerInfo, (st), (cmp)) -#define sk_CMS_SignerInfo_dup(st) SKM_sk_dup(CMS_SignerInfo, st) -#define sk_CMS_SignerInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_SignerInfo, (st), (free_func)) -#define sk_CMS_SignerInfo_shift(st) SKM_sk_shift(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_pop(st) SKM_sk_pop(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_sort(st) SKM_sk_sort(CMS_SignerInfo, (st)) -#define sk_CMS_SignerInfo_is_sorted(st) SKM_sk_is_sorted(CMS_SignerInfo, (st)) - #define sk_CONF_IMODULE_new(cmp) SKM_sk_new(CONF_IMODULE, (cmp)) #define sk_CONF_IMODULE_new_null() SKM_sk_new_null(CONF_IMODULE) #define sk_CONF_IMODULE_free(st) SKM_sk_free(CONF_IMODULE, (st)) @@ -956,182 +839,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) #define sk_IPAddressOrRange_sort(st) SKM_sk_sort(IPAddressOrRange, (st)) #define sk_IPAddressOrRange_is_sorted(st) SKM_sk_is_sorted(IPAddressOrRange, (st)) -#define sk_KRB5_APREQBODY_new(cmp) SKM_sk_new(KRB5_APREQBODY, (cmp)) -#define sk_KRB5_APREQBODY_new_null() SKM_sk_new_null(KRB5_APREQBODY) -#define sk_KRB5_APREQBODY_free(st) SKM_sk_free(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_num(st) SKM_sk_num(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_value(st, i) SKM_sk_value(KRB5_APREQBODY, (st), (i)) -#define sk_KRB5_APREQBODY_set(st, i, val) SKM_sk_set(KRB5_APREQBODY, (st), (i), (val)) -#define sk_KRB5_APREQBODY_zero(st) SKM_sk_zero(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_push(st, val) SKM_sk_push(KRB5_APREQBODY, (st), (val)) -#define sk_KRB5_APREQBODY_unshift(st, val) SKM_sk_unshift(KRB5_APREQBODY, (st), (val)) -#define sk_KRB5_APREQBODY_find(st, val) SKM_sk_find(KRB5_APREQBODY, (st), (val)) -#define sk_KRB5_APREQBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_APREQBODY, (st), (val)) -#define sk_KRB5_APREQBODY_delete(st, i) SKM_sk_delete(KRB5_APREQBODY, (st), (i)) -#define sk_KRB5_APREQBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_APREQBODY, (st), (ptr)) -#define sk_KRB5_APREQBODY_insert(st, val, i) SKM_sk_insert(KRB5_APREQBODY, (st), (val), (i)) -#define sk_KRB5_APREQBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_APREQBODY, (st), (cmp)) -#define sk_KRB5_APREQBODY_dup(st) SKM_sk_dup(KRB5_APREQBODY, st) -#define sk_KRB5_APREQBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_APREQBODY, (st), (free_func)) -#define sk_KRB5_APREQBODY_shift(st) SKM_sk_shift(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_pop(st) SKM_sk_pop(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_sort(st) SKM_sk_sort(KRB5_APREQBODY, (st)) -#define sk_KRB5_APREQBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_APREQBODY, (st)) - -#define sk_KRB5_AUTHDATA_new(cmp) SKM_sk_new(KRB5_AUTHDATA, (cmp)) -#define sk_KRB5_AUTHDATA_new_null() SKM_sk_new_null(KRB5_AUTHDATA) -#define sk_KRB5_AUTHDATA_free(st) SKM_sk_free(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_num(st) SKM_sk_num(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_value(st, i) SKM_sk_value(KRB5_AUTHDATA, (st), (i)) -#define sk_KRB5_AUTHDATA_set(st, i, val) SKM_sk_set(KRB5_AUTHDATA, (st), (i), (val)) -#define sk_KRB5_AUTHDATA_zero(st) SKM_sk_zero(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_push(st, val) SKM_sk_push(KRB5_AUTHDATA, (st), (val)) -#define sk_KRB5_AUTHDATA_unshift(st, val) SKM_sk_unshift(KRB5_AUTHDATA, (st), (val)) -#define sk_KRB5_AUTHDATA_find(st, val) SKM_sk_find(KRB5_AUTHDATA, (st), (val)) -#define sk_KRB5_AUTHDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHDATA, (st), (val)) -#define sk_KRB5_AUTHDATA_delete(st, i) SKM_sk_delete(KRB5_AUTHDATA, (st), (i)) -#define sk_KRB5_AUTHDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHDATA, (st), (ptr)) -#define sk_KRB5_AUTHDATA_insert(st, val, i) SKM_sk_insert(KRB5_AUTHDATA, (st), (val), (i)) -#define sk_KRB5_AUTHDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHDATA, (st), (cmp)) -#define sk_KRB5_AUTHDATA_dup(st) SKM_sk_dup(KRB5_AUTHDATA, st) -#define sk_KRB5_AUTHDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHDATA, (st), (free_func)) -#define sk_KRB5_AUTHDATA_shift(st) SKM_sk_shift(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_pop(st) SKM_sk_pop(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_sort(st) SKM_sk_sort(KRB5_AUTHDATA, (st)) -#define sk_KRB5_AUTHDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHDATA, (st)) - -#define sk_KRB5_AUTHENTBODY_new(cmp) SKM_sk_new(KRB5_AUTHENTBODY, (cmp)) -#define sk_KRB5_AUTHENTBODY_new_null() SKM_sk_new_null(KRB5_AUTHENTBODY) -#define sk_KRB5_AUTHENTBODY_free(st) SKM_sk_free(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_num(st) SKM_sk_num(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_value(st, i) SKM_sk_value(KRB5_AUTHENTBODY, (st), (i)) -#define sk_KRB5_AUTHENTBODY_set(st, i, val) SKM_sk_set(KRB5_AUTHENTBODY, (st), (i), (val)) -#define sk_KRB5_AUTHENTBODY_zero(st) SKM_sk_zero(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_push(st, val) SKM_sk_push(KRB5_AUTHENTBODY, (st), (val)) -#define sk_KRB5_AUTHENTBODY_unshift(st, val) SKM_sk_unshift(KRB5_AUTHENTBODY, (st), (val)) -#define sk_KRB5_AUTHENTBODY_find(st, val) SKM_sk_find(KRB5_AUTHENTBODY, (st), (val)) -#define sk_KRB5_AUTHENTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHENTBODY, (st), (val)) -#define sk_KRB5_AUTHENTBODY_delete(st, i) SKM_sk_delete(KRB5_AUTHENTBODY, (st), (i)) -#define sk_KRB5_AUTHENTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHENTBODY, (st), (ptr)) -#define sk_KRB5_AUTHENTBODY_insert(st, val, i) SKM_sk_insert(KRB5_AUTHENTBODY, (st), (val), (i)) -#define sk_KRB5_AUTHENTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHENTBODY, (st), (cmp)) -#define sk_KRB5_AUTHENTBODY_dup(st) SKM_sk_dup(KRB5_AUTHENTBODY, st) -#define sk_KRB5_AUTHENTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHENTBODY, (st), (free_func)) -#define sk_KRB5_AUTHENTBODY_shift(st) SKM_sk_shift(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_pop(st) SKM_sk_pop(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_sort(st) SKM_sk_sort(KRB5_AUTHENTBODY, (st)) -#define sk_KRB5_AUTHENTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHENTBODY, (st)) - -#define sk_KRB5_CHECKSUM_new(cmp) SKM_sk_new(KRB5_CHECKSUM, (cmp)) -#define sk_KRB5_CHECKSUM_new_null() SKM_sk_new_null(KRB5_CHECKSUM) -#define sk_KRB5_CHECKSUM_free(st) SKM_sk_free(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_num(st) SKM_sk_num(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_value(st, i) SKM_sk_value(KRB5_CHECKSUM, (st), (i)) -#define sk_KRB5_CHECKSUM_set(st, i, val) SKM_sk_set(KRB5_CHECKSUM, (st), (i), (val)) -#define sk_KRB5_CHECKSUM_zero(st) SKM_sk_zero(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_push(st, val) SKM_sk_push(KRB5_CHECKSUM, (st), (val)) -#define sk_KRB5_CHECKSUM_unshift(st, val) SKM_sk_unshift(KRB5_CHECKSUM, (st), (val)) -#define sk_KRB5_CHECKSUM_find(st, val) SKM_sk_find(KRB5_CHECKSUM, (st), (val)) -#define sk_KRB5_CHECKSUM_find_ex(st, val) SKM_sk_find_ex(KRB5_CHECKSUM, (st), (val)) -#define sk_KRB5_CHECKSUM_delete(st, i) SKM_sk_delete(KRB5_CHECKSUM, (st), (i)) -#define sk_KRB5_CHECKSUM_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_CHECKSUM, (st), (ptr)) -#define sk_KRB5_CHECKSUM_insert(st, val, i) SKM_sk_insert(KRB5_CHECKSUM, (st), (val), (i)) -#define sk_KRB5_CHECKSUM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_CHECKSUM, (st), (cmp)) -#define sk_KRB5_CHECKSUM_dup(st) SKM_sk_dup(KRB5_CHECKSUM, st) -#define sk_KRB5_CHECKSUM_pop_free(st, free_func) SKM_sk_pop_free(KRB5_CHECKSUM, (st), (free_func)) -#define sk_KRB5_CHECKSUM_shift(st) SKM_sk_shift(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_pop(st) SKM_sk_pop(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_sort(st) SKM_sk_sort(KRB5_CHECKSUM, (st)) -#define sk_KRB5_CHECKSUM_is_sorted(st) SKM_sk_is_sorted(KRB5_CHECKSUM, (st)) - -#define sk_KRB5_ENCDATA_new(cmp) SKM_sk_new(KRB5_ENCDATA, (cmp)) -#define sk_KRB5_ENCDATA_new_null() SKM_sk_new_null(KRB5_ENCDATA) -#define sk_KRB5_ENCDATA_free(st) SKM_sk_free(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_num(st) SKM_sk_num(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_value(st, i) SKM_sk_value(KRB5_ENCDATA, (st), (i)) -#define sk_KRB5_ENCDATA_set(st, i, val) SKM_sk_set(KRB5_ENCDATA, (st), (i), (val)) -#define sk_KRB5_ENCDATA_zero(st) SKM_sk_zero(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_push(st, val) SKM_sk_push(KRB5_ENCDATA, (st), (val)) -#define sk_KRB5_ENCDATA_unshift(st, val) SKM_sk_unshift(KRB5_ENCDATA, (st), (val)) -#define sk_KRB5_ENCDATA_find(st, val) SKM_sk_find(KRB5_ENCDATA, (st), (val)) -#define sk_KRB5_ENCDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCDATA, (st), (val)) -#define sk_KRB5_ENCDATA_delete(st, i) SKM_sk_delete(KRB5_ENCDATA, (st), (i)) -#define sk_KRB5_ENCDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCDATA, (st), (ptr)) -#define sk_KRB5_ENCDATA_insert(st, val, i) SKM_sk_insert(KRB5_ENCDATA, (st), (val), (i)) -#define sk_KRB5_ENCDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCDATA, (st), (cmp)) -#define sk_KRB5_ENCDATA_dup(st) SKM_sk_dup(KRB5_ENCDATA, st) -#define sk_KRB5_ENCDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCDATA, (st), (free_func)) -#define sk_KRB5_ENCDATA_shift(st) SKM_sk_shift(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_pop(st) SKM_sk_pop(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_sort(st) SKM_sk_sort(KRB5_ENCDATA, (st)) -#define sk_KRB5_ENCDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCDATA, (st)) - -#define sk_KRB5_ENCKEY_new(cmp) SKM_sk_new(KRB5_ENCKEY, (cmp)) -#define sk_KRB5_ENCKEY_new_null() SKM_sk_new_null(KRB5_ENCKEY) -#define sk_KRB5_ENCKEY_free(st) SKM_sk_free(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_num(st) SKM_sk_num(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_value(st, i) SKM_sk_value(KRB5_ENCKEY, (st), (i)) -#define sk_KRB5_ENCKEY_set(st, i, val) SKM_sk_set(KRB5_ENCKEY, (st), (i), (val)) -#define sk_KRB5_ENCKEY_zero(st) SKM_sk_zero(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_push(st, val) SKM_sk_push(KRB5_ENCKEY, (st), (val)) -#define sk_KRB5_ENCKEY_unshift(st, val) SKM_sk_unshift(KRB5_ENCKEY, (st), (val)) -#define sk_KRB5_ENCKEY_find(st, val) SKM_sk_find(KRB5_ENCKEY, (st), (val)) -#define sk_KRB5_ENCKEY_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCKEY, (st), (val)) -#define sk_KRB5_ENCKEY_delete(st, i) SKM_sk_delete(KRB5_ENCKEY, (st), (i)) -#define sk_KRB5_ENCKEY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCKEY, (st), (ptr)) -#define sk_KRB5_ENCKEY_insert(st, val, i) SKM_sk_insert(KRB5_ENCKEY, (st), (val), (i)) -#define sk_KRB5_ENCKEY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCKEY, (st), (cmp)) -#define sk_KRB5_ENCKEY_dup(st) SKM_sk_dup(KRB5_ENCKEY, st) -#define sk_KRB5_ENCKEY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCKEY, (st), (free_func)) -#define sk_KRB5_ENCKEY_shift(st) SKM_sk_shift(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_pop(st) SKM_sk_pop(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_sort(st) SKM_sk_sort(KRB5_ENCKEY, (st)) -#define sk_KRB5_ENCKEY_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCKEY, (st)) - -#define sk_KRB5_PRINCNAME_new(cmp) SKM_sk_new(KRB5_PRINCNAME, (cmp)) -#define sk_KRB5_PRINCNAME_new_null() SKM_sk_new_null(KRB5_PRINCNAME) -#define sk_KRB5_PRINCNAME_free(st) SKM_sk_free(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_num(st) SKM_sk_num(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_value(st, i) SKM_sk_value(KRB5_PRINCNAME, (st), (i)) -#define sk_KRB5_PRINCNAME_set(st, i, val) SKM_sk_set(KRB5_PRINCNAME, (st), (i), (val)) -#define sk_KRB5_PRINCNAME_zero(st) SKM_sk_zero(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_push(st, val) SKM_sk_push(KRB5_PRINCNAME, (st), (val)) -#define sk_KRB5_PRINCNAME_unshift(st, val) SKM_sk_unshift(KRB5_PRINCNAME, (st), (val)) -#define sk_KRB5_PRINCNAME_find(st, val) SKM_sk_find(KRB5_PRINCNAME, (st), (val)) -#define sk_KRB5_PRINCNAME_find_ex(st, val) SKM_sk_find_ex(KRB5_PRINCNAME, (st), (val)) -#define sk_KRB5_PRINCNAME_delete(st, i) SKM_sk_delete(KRB5_PRINCNAME, (st), (i)) -#define sk_KRB5_PRINCNAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_PRINCNAME, (st), (ptr)) -#define sk_KRB5_PRINCNAME_insert(st, val, i) SKM_sk_insert(KRB5_PRINCNAME, (st), (val), (i)) -#define sk_KRB5_PRINCNAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_PRINCNAME, (st), (cmp)) -#define sk_KRB5_PRINCNAME_dup(st) SKM_sk_dup(KRB5_PRINCNAME, st) -#define sk_KRB5_PRINCNAME_pop_free(st, free_func) SKM_sk_pop_free(KRB5_PRINCNAME, (st), (free_func)) -#define sk_KRB5_PRINCNAME_shift(st) SKM_sk_shift(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_pop(st) SKM_sk_pop(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_sort(st) SKM_sk_sort(KRB5_PRINCNAME, (st)) -#define sk_KRB5_PRINCNAME_is_sorted(st) SKM_sk_is_sorted(KRB5_PRINCNAME, (st)) - -#define sk_KRB5_TKTBODY_new(cmp) SKM_sk_new(KRB5_TKTBODY, (cmp)) -#define sk_KRB5_TKTBODY_new_null() SKM_sk_new_null(KRB5_TKTBODY) -#define sk_KRB5_TKTBODY_free(st) SKM_sk_free(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_num(st) SKM_sk_num(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_value(st, i) SKM_sk_value(KRB5_TKTBODY, (st), (i)) -#define sk_KRB5_TKTBODY_set(st, i, val) SKM_sk_set(KRB5_TKTBODY, (st), (i), (val)) -#define sk_KRB5_TKTBODY_zero(st) SKM_sk_zero(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_push(st, val) SKM_sk_push(KRB5_TKTBODY, (st), (val)) -#define sk_KRB5_TKTBODY_unshift(st, val) SKM_sk_unshift(KRB5_TKTBODY, (st), (val)) -#define sk_KRB5_TKTBODY_find(st, val) SKM_sk_find(KRB5_TKTBODY, (st), (val)) -#define sk_KRB5_TKTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_TKTBODY, (st), (val)) -#define sk_KRB5_TKTBODY_delete(st, i) SKM_sk_delete(KRB5_TKTBODY, (st), (i)) -#define sk_KRB5_TKTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_TKTBODY, (st), (ptr)) -#define sk_KRB5_TKTBODY_insert(st, val, i) SKM_sk_insert(KRB5_TKTBODY, (st), (val), (i)) -#define sk_KRB5_TKTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_TKTBODY, (st), (cmp)) -#define sk_KRB5_TKTBODY_dup(st) SKM_sk_dup(KRB5_TKTBODY, st) -#define sk_KRB5_TKTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_TKTBODY, (st), (free_func)) -#define sk_KRB5_TKTBODY_shift(st) SKM_sk_shift(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_pop(st) SKM_sk_pop(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_sort(st) SKM_sk_sort(KRB5_TKTBODY, (st)) -#define sk_KRB5_TKTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_TKTBODY, (st)) - #define sk_MEM_OBJECT_DATA_new(cmp) SKM_sk_new(MEM_OBJECT_DATA, (cmp)) #define sk_MEM_OBJECT_DATA_new_null() SKM_sk_new_null(MEM_OBJECT_DATA) #define sk_MEM_OBJECT_DATA_free(st) SKM_sk_free(MEM_OBJECT_DATA, (st)) @@ -1462,72 +1169,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) #define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st)) #define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st)) -#define sk_SRP_gN_new(cmp) SKM_sk_new(SRP_gN, (cmp)) -#define sk_SRP_gN_new_null() SKM_sk_new_null(SRP_gN) -#define sk_SRP_gN_free(st) SKM_sk_free(SRP_gN, (st)) -#define sk_SRP_gN_num(st) SKM_sk_num(SRP_gN, (st)) -#define sk_SRP_gN_value(st, i) SKM_sk_value(SRP_gN, (st), (i)) -#define sk_SRP_gN_set(st, i, val) SKM_sk_set(SRP_gN, (st), (i), (val)) -#define sk_SRP_gN_zero(st) SKM_sk_zero(SRP_gN, (st)) -#define sk_SRP_gN_push(st, val) SKM_sk_push(SRP_gN, (st), (val)) -#define sk_SRP_gN_unshift(st, val) SKM_sk_unshift(SRP_gN, (st), (val)) -#define sk_SRP_gN_find(st, val) SKM_sk_find(SRP_gN, (st), (val)) -#define sk_SRP_gN_find_ex(st, val) SKM_sk_find_ex(SRP_gN, (st), (val)) -#define sk_SRP_gN_delete(st, i) SKM_sk_delete(SRP_gN, (st), (i)) -#define sk_SRP_gN_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN, (st), (ptr)) -#define sk_SRP_gN_insert(st, val, i) SKM_sk_insert(SRP_gN, (st), (val), (i)) -#define sk_SRP_gN_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN, (st), (cmp)) -#define sk_SRP_gN_dup(st) SKM_sk_dup(SRP_gN, st) -#define sk_SRP_gN_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN, (st), (free_func)) -#define sk_SRP_gN_shift(st) SKM_sk_shift(SRP_gN, (st)) -#define sk_SRP_gN_pop(st) SKM_sk_pop(SRP_gN, (st)) -#define sk_SRP_gN_sort(st) SKM_sk_sort(SRP_gN, (st)) -#define sk_SRP_gN_is_sorted(st) SKM_sk_is_sorted(SRP_gN, (st)) - -#define sk_SRP_gN_cache_new(cmp) SKM_sk_new(SRP_gN_cache, (cmp)) -#define sk_SRP_gN_cache_new_null() SKM_sk_new_null(SRP_gN_cache) -#define sk_SRP_gN_cache_free(st) SKM_sk_free(SRP_gN_cache, (st)) -#define sk_SRP_gN_cache_num(st) SKM_sk_num(SRP_gN_cache, (st)) -#define sk_SRP_gN_cache_value(st, i) SKM_sk_value(SRP_gN_cache, (st), (i)) -#define sk_SRP_gN_cache_set(st, i, val) SKM_sk_set(SRP_gN_cache, (st), (i), (val)) -#define sk_SRP_gN_cache_zero(st) SKM_sk_zero(SRP_gN_cache, (st)) -#define sk_SRP_gN_cache_push(st, val) SKM_sk_push(SRP_gN_cache, (st), (val)) -#define sk_SRP_gN_cache_unshift(st, val) SKM_sk_unshift(SRP_gN_cache, (st), (val)) -#define sk_SRP_gN_cache_find(st, val) SKM_sk_find(SRP_gN_cache, (st), (val)) -#define sk_SRP_gN_cache_find_ex(st, val) SKM_sk_find_ex(SRP_gN_cache, (st), (val)) -#define sk_SRP_gN_cache_delete(st, i) SKM_sk_delete(SRP_gN_cache, (st), (i)) -#define sk_SRP_gN_cache_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN_cache, (st), (ptr)) -#define sk_SRP_gN_cache_insert(st, val, i) SKM_sk_insert(SRP_gN_cache, (st), (val), (i)) -#define sk_SRP_gN_cache_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN_cache, (st), (cmp)) -#define sk_SRP_gN_cache_dup(st) SKM_sk_dup(SRP_gN_cache, st) -#define sk_SRP_gN_cache_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN_cache, (st), (free_func)) -#define sk_SRP_gN_cache_shift(st) SKM_sk_shift(SRP_gN_cache, (st)) -#define sk_SRP_gN_cache_pop(st) SKM_sk_pop(SRP_gN_cache, (st)) -#define sk_SRP_gN_cache_sort(st) SKM_sk_sort(SRP_gN_cache, (st)) -#define sk_SRP_gN_cache_is_sorted(st) SKM_sk_is_sorted(SRP_gN_cache, (st)) - -#define sk_SRP_user_pwd_new(cmp) SKM_sk_new(SRP_user_pwd, (cmp)) -#define sk_SRP_user_pwd_new_null() SKM_sk_new_null(SRP_user_pwd) -#define sk_SRP_user_pwd_free(st) SKM_sk_free(SRP_user_pwd, (st)) -#define sk_SRP_user_pwd_num(st) SKM_sk_num(SRP_user_pwd, (st)) -#define sk_SRP_user_pwd_value(st, i) SKM_sk_value(SRP_user_pwd, (st), (i)) -#define sk_SRP_user_pwd_set(st, i, val) SKM_sk_set(SRP_user_pwd, (st), (i), (val)) -#define sk_SRP_user_pwd_zero(st) SKM_sk_zero(SRP_user_pwd, (st)) -#define sk_SRP_user_pwd_push(st, val) SKM_sk_push(SRP_user_pwd, (st), (val)) -#define sk_SRP_user_pwd_unshift(st, val) SKM_sk_unshift(SRP_user_pwd, (st), (val)) -#define sk_SRP_user_pwd_find(st, val) SKM_sk_find(SRP_user_pwd, (st), (val)) -#define sk_SRP_user_pwd_find_ex(st, val) SKM_sk_find_ex(SRP_user_pwd, (st), (val)) -#define sk_SRP_user_pwd_delete(st, i) SKM_sk_delete(SRP_user_pwd, (st), (i)) -#define sk_SRP_user_pwd_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_user_pwd, (st), (ptr)) -#define sk_SRP_user_pwd_insert(st, val, i) SKM_sk_insert(SRP_user_pwd, (st), (val), (i)) -#define sk_SRP_user_pwd_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_user_pwd, (st), (cmp)) -#define sk_SRP_user_pwd_dup(st) SKM_sk_dup(SRP_user_pwd, st) -#define sk_SRP_user_pwd_pop_free(st, free_func) SKM_sk_pop_free(SRP_user_pwd, (st), (free_func)) -#define sk_SRP_user_pwd_shift(st) SKM_sk_shift(SRP_user_pwd, (st)) -#define sk_SRP_user_pwd_pop(st) SKM_sk_pop(SRP_user_pwd, (st)) -#define sk_SRP_user_pwd_sort(st) SKM_sk_sort(SRP_user_pwd, (st)) -#define sk_SRP_user_pwd_is_sorted(st) SKM_sk_is_sorted(SRP_user_pwd, (st)) - #define sk_SRTP_PROTECTION_PROFILE_new(cmp) SKM_sk_new(SRTP_PROTECTION_PROFILE, (cmp)) #define sk_SRTP_PROTECTION_PROFILE_new_null() SKM_sk_new_null(SRTP_PROTECTION_PROFILE) #define sk_SRTP_PROTECTION_PROFILE_free(st) SKM_sk_free(SRTP_PROTECTION_PROFILE, (st)) @@ -2146,7 +1787,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) #define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st)) #define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st)) - #define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) #define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null()) #define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) @@ -2171,7 +1811,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) #define sk_OPENSSL_BLOCK_sort(st) SKM_sk_sort(OPENSSL_BLOCK, (st)) #define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st)) - #define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) #define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null()) #define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) @@ -2196,239 +1835,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) #define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st)) #define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st)) -#ifndef LIBRESSL_INTERNAL -#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_UTF8STRING, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_UTF8STRING, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_ASN1_UTF8STRING(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_UTF8STRING, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_ASN1_UTF8STRING(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_UTF8STRING, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_ESS_CERT_ID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ESS_CERT_ID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_ESS_CERT_ID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ESS_CERT_ID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_ESS_CERT_ID(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ESS_CERT_ID, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_ESS_CERT_ID(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ESS_CERT_ID, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_EVP_MD(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(EVP_MD, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_EVP_MD(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(EVP_MD, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_EVP_MD(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(EVP_MD, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_EVP_MD(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(EVP_MD, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_OCSP_ONEREQ(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_OCSP_ONEREQ(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_OCSP_SINGLERESP(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_OCSP_SINGLERESP(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func)) - -#define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func)) - -#define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \ - SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) - -#define PKCS12_decrypt_d2i_PKCS7(algor, d2i_func, free_func, pass, passlen, oct, seq) \ - SKM_PKCS12_decrypt_d2i(PKCS7, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) -#endif /* !LIBRESSL_INTERNAL */ - #define lh_ADDED_OBJ_new() LHM_lh_new(ADDED_OBJ,added_obj) #define lh_ADDED_OBJ_insert(lh,inst) LHM_lh_insert(ADDED_OBJ,lh,inst) #define lh_ADDED_OBJ_retrieve(lh,inst) LHM_lh_retrieve(ADDED_OBJ,lh,inst) @@ -2662,6 +2068,5 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) #define lh_SSL_SESSION_stats_bio(lh,out) \ LHM_lh_stats_bio(SSL_SESSION,lh,out) #define lh_SSL_SESSION_free(lh) LHM_lh_free(SSL_SESSION,lh) -/* End of util/mkstack.pl block, you may now edit :-) */ #endif /* !defined HEADER_SAFESTACK_H */ diff --git a/include/openssl/sm3.h b/include/openssl/sm3.h new file mode 100644 index 00000000..553c64dc --- /dev/null +++ b/include/openssl/sm3.h @@ -0,0 +1,53 @@ +/* $OpenBSD: sm3.h,v 1.1 2018/11/11 06:53:31 tb Exp $ */ +/* + * Copyright (c) 2018, Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_SM3_H +#define HEADER_SM3_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_SM3 +#error SM3 is disabled. +#endif + +#define SM3_DIGEST_LENGTH 32 +#define SM3_WORD unsigned int + +#define SM3_CBLOCK 64 +#define SM3_LBLOCK (SM3_CBLOCK / 4) + +typedef struct SM3state_st { + SM3_WORD A, B, C, D, E, F, G, H; + SM3_WORD Nl, Nh; + SM3_WORD data[SM3_LBLOCK]; + unsigned int num; +} SM3_CTX; + +int SM3_Init(SM3_CTX *c); +int SM3_Update(SM3_CTX *c, const void *data, size_t len); +int SM3_Final(unsigned char *md, SM3_CTX *c); + +#ifdef __cplusplus +} +#endif + +#endif /* HEADER_SM3_H */ diff --git a/include/openssl/sm4.h b/include/openssl/sm4.h new file mode 100644 index 00000000..5931ac71 --- /dev/null +++ b/include/openssl/sm4.h @@ -0,0 +1,51 @@ +/* $OpenBSD: sm4.h,v 1.1 2019/03/17 17:42:37 tb Exp $ */ +/* + * Copyright (c) 2017, 2019 Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_SM4_H +#define HEADER_SM4_H + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_SM4 +#error SM4 is disabled. +#endif + +#define SM4_DECRYPT 0 +#define SM4_ENCRYPT 1 + +#define SM4_BLOCK_SIZE 16 +#define SM4_KEY_SCHEDULE 32 + +typedef struct sm4_key_st { + unsigned char opaque[128]; +} SM4_KEY; + +int SM4_set_key(const uint8_t *key, SM4_KEY *ks); +void SM4_decrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks); +void SM4_encrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks); + +#ifdef __cplusplus +} +#endif + +#endif /* HEADER_SM4_H */ diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index d431b175..fc89b0ef 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl.h,v 1.134 2017/08/30 16:24:21 jsing Exp $ */ +/* $OpenBSD: ssl.h,v 1.166 2019/04/04 15:03:21 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -146,6 +146,7 @@ #include #include + #include #include #include @@ -305,6 +306,9 @@ extern "C" { #define SSL_TXT_TLSV1 "TLSv1" #define SSL_TXT_TLSV1_1 "TLSv1.1" #define SSL_TXT_TLSV1_2 "TLSv1.2" +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define SSL_TXT_TLSV1_3 "TLSv1.3" +#endif #define SSL_TXT_EXP "EXP" #define SSL_TXT_EXPORT "EXPORT" @@ -507,16 +511,15 @@ struct ssl_session_st { /* Set on servers to choose the cipher according to the server's * preferences */ #define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L -/* If set, a server will allow a client to issue a SSLv3.0 version number - * as latest version supported in the premaster secret, even when TLSv1.0 - * (version 3.1) was announced in the client hello. Normally this is - * forbidden to prevent version rollback attacks. */ -#define SSL_OP_TLS_ROLLBACK_BUG 0x00800000L #define SSL_OP_NO_TLSv1 0x04000000L #define SSL_OP_NO_TLSv1_2 0x08000000L #define SSL_OP_NO_TLSv1_1 0x10000000L +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define SSL_OP_NO_TLSv1_3 0x20000000L +#endif + /* SSL_OP_ALL: various bug workarounds that should be rather harmless. */ #define SSL_OP_ALL \ (SSL_OP_LEGACY_SERVER_CONNECT) @@ -545,6 +548,7 @@ struct ssl_session_st { #define SSL_OP_TLSEXT_PADDING 0x0 #define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0 #define SSL_OP_TLS_D5_BUG 0x0 +#define SSL_OP_TLS_ROLLBACK_BUG 0x0 /* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success * when just a single record has been written): */ @@ -731,10 +735,10 @@ void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx, void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(struct ssl_ctx_st *ctx, SSL_SESSION *sess); void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, - SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, unsigned char *data, - int len, int *copy)); + SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, + const unsigned char *data, int len, int *copy)); SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(struct ssl_st *ssl, - unsigned char *Data, int len, int *copy); + const unsigned char *data, int len, int *copy); void SSL_CTX_set_info_callback(SSL_CTX *ctx, void (*cb)(const SSL *ssl, int type, int val)); void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl, int type, @@ -750,7 +754,7 @@ void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)); void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, - int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, + int (*app_verify_cookie_cb)(SSL *ssl, const unsigned char *cookie, unsigned int cookie_len)); void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s, int (*cb)(SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg), void *arg); @@ -1080,7 +1084,9 @@ int PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x); #define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57 #define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58 #define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64 #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65 #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66 @@ -1112,6 +1118,9 @@ int PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x); #define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82 #define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83 +#define SSL_CTRL_CHAIN 88 +#define SSL_CTRL_CHAIN_CERT 89 + #define SSL_CTRL_SET_GROUPS 91 #define SSL_CTRL_SET_GROUPS_LIST 92 @@ -1119,10 +1128,14 @@ int PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x); #define SSL_CTRL_GET_SERVER_TMP_KEY 109 +#define SSL_CTRL_GET_CHAIN_CERTS 115 + #define SSL_CTRL_SET_DH_AUTO 118 #define SSL_CTRL_SET_MIN_PROTO_VERSION 123 #define SSL_CTRL_SET_MAX_PROTO_VERSION 124 +#define SSL_CTRL_GET_MIN_PROTO_VERSION 130 +#define SSL_CTRL_GET_MAX_PROTO_VERSION 131 #define DTLSv1_get_timeout(ssl, arg) \ SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg) @@ -1166,15 +1179,33 @@ int PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x); #define SSL_set_ecdh_auto(s, onoff) \ SSL_ctrl(s,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL) +int SSL_CTX_set0_chain(SSL_CTX *ctx, STACK_OF(X509) *chain); +int SSL_CTX_set1_chain(SSL_CTX *ctx, STACK_OF(X509) *chain); +int SSL_CTX_add0_chain_cert(SSL_CTX *ctx, X509 *x509); +int SSL_CTX_add1_chain_cert(SSL_CTX *ctx, X509 *x509); +int SSL_CTX_get0_chain_certs(const SSL_CTX *ctx, STACK_OF(X509) **out_chain); +int SSL_CTX_clear_chain_certs(SSL_CTX *ctx); + +int SSL_set0_chain(SSL *ssl, STACK_OF(X509) *chain); +int SSL_set1_chain(SSL *ssl, STACK_OF(X509) *chain); +int SSL_add0_chain_cert(SSL *ssl, X509 *x509); +int SSL_add1_chain_cert(SSL *ssl, X509 *x509); +int SSL_get0_chain_certs(const SSL *ssl, STACK_OF(X509) **out_chain); +int SSL_clear_chain_certs(SSL *ssl); + int SSL_CTX_set1_groups(SSL_CTX *ctx, const int *groups, size_t groups_len); int SSL_CTX_set1_groups_list(SSL_CTX *ctx, const char *groups); int SSL_set1_groups(SSL *ssl, const int *groups, size_t groups_len); int SSL_set1_groups_list(SSL *ssl, const char *groups); +int SSL_CTX_get_min_proto_version(SSL_CTX *ctx); +int SSL_CTX_get_max_proto_version(SSL_CTX *ctx); int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version); int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version); +int SSL_get_min_proto_version(SSL *ssl); +int SSL_get_max_proto_version(SSL *ssl); int SSL_set_min_proto_version(SSL *ssl, uint16_t version); int SSL_set_max_proto_version(SSL *ssl, uint16_t version); @@ -1198,20 +1229,58 @@ int SSL_set_max_proto_version(SSL *ssl, uint16_t version); #define SSL_get_server_tmp_key(s, pk) \ SSL_ctrl(s,SSL_CTRL_GET_SERVER_TMP_KEY,0,pk) -BIO_METHOD *BIO_f_ssl(void); +#ifndef LIBRESSL_INTERNAL +/* + * Also provide those functions as macros for compatibility with + * existing users. + */ +#define SSL_CTX_set0_chain SSL_CTX_set0_chain +#define SSL_CTX_set1_chain SSL_CTX_set1_chain +#define SSL_CTX_add0_chain_cert SSL_CTX_add0_chain_cert +#define SSL_CTX_add1_chain_cert SSL_CTX_add1_chain_cert +#define SSL_CTX_get0_chain_certs SSL_CTX_get0_chain_certs +#define SSL_CTX_clear_chain_certs SSL_CTX_clear_chain_certs + +#define SSL_add0_chain_cert SSL_add0_chain_cert +#define SSL_add1_chain_cert SSL_add1_chain_cert +#define SSL_set0_chain SSL_set0_chain +#define SSL_set1_chain SSL_set1_chain +#define SSL_get0_chain_certs SSL_get0_chain_certs +#define SSL_clear_chain_certs SSL_clear_chain_certs + +#define SSL_CTX_set1_groups SSL_CTX_set1_groups +#define SSL_CTX_set1_groups_list SSL_CTX_set1_groups_list +#define SSL_set1_groups SSL_set1_groups +#define SSL_set1_groups_list SSL_set1_groups_list + +#define SSL_CTX_get_min_proto_version SSL_CTX_get_min_proto_version +#define SSL_CTX_get_max_proto_version SSL_CTX_get_max_proto_version +#define SSL_CTX_set_min_proto_version SSL_CTX_set_min_proto_version +#define SSL_CTX_set_max_proto_version SSL_CTX_set_max_proto_version + +#define SSL_get_min_proto_version SSL_get_min_proto_version +#define SSL_get_max_proto_version SSL_get_max_proto_version +#define SSL_set_min_proto_version SSL_set_min_proto_version +#define SSL_set_max_proto_version SSL_set_max_proto_version +#endif + +const BIO_METHOD *BIO_f_ssl(void); BIO *BIO_new_ssl(SSL_CTX *ctx, int client); BIO *BIO_new_ssl_connect(SSL_CTX *ctx); BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx); int BIO_ssl_copy_session_id(BIO *to, BIO *from); void BIO_ssl_shutdown(BIO *ssl_bio); +STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx); int SSL_CTX_set_cipher_list(SSL_CTX *, const char *str); SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth); void SSL_CTX_free(SSL_CTX *); +int SSL_CTX_up_ref(SSL_CTX *ctx); long SSL_CTX_set_timeout(SSL_CTX *ctx, long t); long SSL_CTX_get_timeout(const SSL_CTX *ctx); X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *); void SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *); +X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); int SSL_want(const SSL *s); int SSL_clear(SSL *s); @@ -1221,10 +1290,15 @@ const SSL_CIPHER *SSL_get_current_cipher(const SSL *s); const SSL_CIPHER *SSL_CIPHER_get_by_id(unsigned int id); const SSL_CIPHER *SSL_CIPHER_get_by_value(uint16_t value); int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits); -char * SSL_CIPHER_get_version(const SSL_CIPHER *c); +const char * SSL_CIPHER_get_version(const SSL_CIPHER *c); const char * SSL_CIPHER_get_name(const SSL_CIPHER *c); unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c); uint16_t SSL_CIPHER_get_value(const SSL_CIPHER *c); +int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *c); +int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *c); +int SSL_CIPHER_get_kx_nid(const SSL_CIPHER *c); +int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *c); +int SSL_CIPHER_is_aead(const SSL_CIPHER *c); int SSL_get_fd(const SSL *s); int SSL_get_rfd(const SSL *s); @@ -1248,7 +1322,7 @@ void SSL_set_verify(SSL *s, int mode, int (*callback)(int ok, X509_STORE_CTX *ctx)); void SSL_set_verify_depth(SSL *s, int depth); int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); -int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len); +int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const unsigned char *d, long len); int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); int SSL_use_PrivateKey_ASN1(int pk, SSL *ssl, const unsigned char *d, long len); int SSL_use_certificate(SSL *ssl, X509 *x); @@ -1273,22 +1347,32 @@ const char *SSL_state_string(const SSL *s); const char *SSL_rstate_string(const SSL *s); const char *SSL_state_string_long(const SSL *s); const char *SSL_rstate_string_long(const SSL *s); +size_t SSL_SESSION_get_master_key(const SSL_SESSION *ss, + unsigned char *out, size_t max_out); +int SSL_SESSION_get_protocol_version(const SSL_SESSION *s); long SSL_SESSION_get_time(const SSL_SESSION *s); long SSL_SESSION_set_time(SSL_SESSION *s, long t); long SSL_SESSION_get_timeout(const SSL_SESSION *s); long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); -void SSL_copy_session_id(SSL *to, const SSL *from); +int SSL_copy_session_id(SSL *to, const SSL *from); X509 *SSL_SESSION_get0_peer(SSL_SESSION *s); +int SSL_SESSION_set1_id(SSL_SESSION *s, const unsigned char *sid, + unsigned int sid_len); int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx, unsigned int sid_ctx_len); SSL_SESSION *SSL_SESSION_new(void); -const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, +void SSL_SESSION_free(SSL_SESSION *ses); +int SSL_SESSION_up_ref(SSL_SESSION *ss); +const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *ss, unsigned int *len); -unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s); +const unsigned char *SSL_SESSION_get0_id_context(const SSL_SESSION *ss, + unsigned int *len); +unsigned long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s); +int SSL_SESSION_has_ticket(const SSL_SESSION *s); +unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *ss); int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *ses); int SSL_SESSION_print(BIO *fp, const SSL_SESSION *ses); -void SSL_SESSION_free(SSL_SESSION *ses); int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); int SSL_set_session(SSL *to, SSL_SESSION *session); int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); @@ -1320,7 +1404,9 @@ int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx, const unsigned char *d, lo int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d); +pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx); void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb); +void *SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx); void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u); int SSL_CTX_check_private_key(const SSL_CTX *ctx); @@ -1328,21 +1414,25 @@ int SSL_check_private_key(const SSL *ctx); int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx, unsigned int sid_ctx_len); -SSL *SSL_new(SSL_CTX *ctx); int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx, unsigned int sid_ctx_len); int SSL_CTX_set_purpose(SSL_CTX *s, int purpose); int SSL_set_purpose(SSL *s, int purpose); int SSL_CTX_set_trust(SSL_CTX *s, int trust); int SSL_set_trust(SSL *s, int trust); +int SSL_set1_host(SSL *s, const char *hostname); +X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx); int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm); +X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl); int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm); - +SSL *SSL_new(SSL_CTX *ctx); void SSL_free(SSL *ssl); +int SSL_up_ref(SSL *ssl); int SSL_accept(SSL *ssl); int SSL_connect(SSL *ssl); +int SSL_is_server(const SSL *s); int SSL_read(SSL *ssl, void *buf, int num); int SSL_peek(SSL *ssl, void *buf, int num); int SSL_write(SSL *ssl, const void *buf, int num); @@ -1381,7 +1471,13 @@ const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */ const SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */ const SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */ +const SSL_METHOD *DTLS_method(void); /* DTLS v1.0 or later */ +const SSL_METHOD *DTLS_server_method(void); /* DTLS v1.0 or later */ +const SSL_METHOD *DTLS_client_method(void); /* DTLS v1.0 or later */ + STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s); +STACK_OF(SSL_CIPHER) *SSL_get_client_ciphers(const SSL *s); +STACK_OF(SSL_CIPHER) *SSL_get1_supported_ciphers(SSL *s); int SSL_do_handshake(SSL *s); int SSL_renegotiate(SSL *s); @@ -1411,12 +1507,12 @@ long SSL_get_default_timeout(const SSL *s); int SSL_library_init(void ); char *SSL_CIPHER_description(const SSL_CIPHER *, char *buf, int size); -STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk); +STACK_OF(X509_NAME) *SSL_dup_CA_list(const STACK_OF(X509_NAME) *sk); SSL *SSL_dup(SSL *ssl); X509 *SSL_get_certificate(const SSL *ssl); -/* EVP_PKEY */ struct evp_pkey_st *SSL_get_privatekey(SSL *ssl); +/* EVP_PKEY */ struct evp_pkey_st *SSL_get_privatekey(const SSL *ssl); void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx,int mode); int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); @@ -1505,6 +1601,9 @@ void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx, void SSL_set_tmp_ecdh_callback(SSL *ssl, EC_KEY *(*ecdh)(SSL *ssl, int is_export, int keylength)); +size_t SSL_get_client_random(const SSL *s, unsigned char *out, size_t max_out); +size_t SSL_get_server_random(const SSL *s, unsigned char *out, size_t max_out); + const void *SSL_get_current_compression(SSL *s); const void *SSL_get_current_expansion(SSL *s); @@ -1988,6 +2087,7 @@ void ERR_load_SSL_strings(void); #define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273 #define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303 #define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231 +#define SSL_R_SSL_SESSION_ID_TOO_LONG 408 #define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 #define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 #define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 @@ -2061,6 +2161,19 @@ void ERR_load_SSL_strings(void); #define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269 #define SSL_R_PEER_BEHAVING_BADLY 666 +/* + * OpenSSL compatible OPENSSL_INIT options + */ + +/* + * These are provided for compatibiliy, but have no effect + * on how LibreSSL is initialized. + */ +#define OPENSSL_INIT_LOAD_SSL_STRINGS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_SSL_DEFAULT _OPENSSL_INIT_FLAG_NOOP + +int OPENSSL_init_ssl(uint64_t opts, const void *settings); + #ifdef __cplusplus } #endif diff --git a/include/openssl/ssl3.h b/include/openssl/ssl3.h index 12ef56b5..cadf7fd3 100644 --- a/include/openssl/ssl3.h +++ b/include/openssl/ssl3.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl3.h,v 1.46 2017/08/28 17:36:58 jsing Exp $ */ +/* $OpenBSD: ssl3.h,v 1.49 2018/11/08 22:28:52 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -348,13 +348,9 @@ typedef struct ssl3_buffer_st { */ #define SSL3_CT_NUMBER 11 - #define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 -#define SSL3_FLAGS_DELAY_CLIENT_FINISHED 0x0002 -#define SSL3_FLAGS_POP_BUFFER 0x0004 -#define TLS1_FLAGS_TLS_PADDING_BUG 0x0 #define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 -#define TLS1_FLAGS_KEEP_HANDSHAKE 0x0020 +#define TLS1_FLAGS_FREEZE_TRANSCRIPT 0x0020 #define SSL3_FLAGS_CCS_OK 0x0080 #ifndef OPENSSL_NO_SSL_INTERN @@ -367,18 +363,6 @@ typedef struct ssl3_state_st { unsigned char server_random[SSL3_RANDOM_SIZE]; unsigned char client_random[SSL3_RANDOM_SIZE]; - SSL3_BUFFER rbuf; /* read IO goes into here */ - SSL3_BUFFER wbuf; /* write IO goes into here */ - - /* we allow one fatal and one warning alert to be outstanding, - * send close alert via the warning alert */ - int alert_dispatch; - unsigned char send_alert[2]; - - struct { - int new_mac_secret_size; - } tmp; - struct ssl3_state_internal_st *internal; } SSL3_STATE; diff --git a/include/openssl/tls1.h b/include/openssl/tls1.h index 8e369c7b..cb68bbb5 100644 --- a/include/openssl/tls1.h +++ b/include/openssl/tls1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tls1.h,v 1.31 2017/08/28 17:36:58 jsing Exp $ */ +/* $OpenBSD: tls1.h,v 1.39 2019/03/19 16:53:03 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -151,6 +151,8 @@ #ifndef HEADER_TLS1_H #define HEADER_TLS1_H +#include + #include #ifdef __cplusplus @@ -159,6 +161,10 @@ extern "C" { #define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0 +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define TLS1_3_VERSION 0x0304 +#endif + #define TLS1_2_VERSION 0x0303 #define TLS1_2_VERSION_MAJOR 0x03 #define TLS1_2_VERSION_MINOR 0x03 @@ -230,14 +236,19 @@ extern "C" { /* ExtensionType values from RFC 6091. */ #define TLSEXT_TYPE_cert_type 9 +/* ExtensionType values from RFC 7919. */ +#define TLSEXT_TYPE_supported_groups 10 + /* ExtensionType values from RFC 4492. */ -#define TLSEXT_TYPE_elliptic_curves 10 +#ifndef LIBRESSL_INTERNAL +#define TLSEXT_TYPE_elliptic_curves TLSEXT_TYPE_supported_groups +#endif #define TLSEXT_TYPE_ec_point_formats 11 /* ExtensionType value from RFC 5054. */ #define TLSEXT_TYPE_srp 12 -/* ExtensionType values from RFC 5246. */ +/* ExtensionType value from RFC 5246/RFC 8446. */ #define TLSEXT_TYPE_signature_algorithms 13 /* ExtensionType value from RFC 5764. */ @@ -255,6 +266,20 @@ extern "C" { /* ExtensionType value from RFC 4507. */ #define TLSEXT_TYPE_session_ticket 35 +/* ExtensionType values from RFC 8446 section 4.2 */ +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define TLSEXT_TYPE_pre_shared_key 41 +#define TLSEXT_TYPE_early_data 42 +#define TLSEXT_TYPE_supported_versions 43 +#define TLSEXT_TYPE_cookie 44 +#define TLSEXT_TYPE_psk_key_exchange_modes 45 +#define TLSEXT_TYPE_certificate_authorities 47 +#define TLSEXT_TYPE_oid_filters 48 +#define TLSEXT_TYPE_post_handshake_auth 49 +#define TLSEXT_TYPE_signature_algorithms_cert 50 +#define TLSEXT_TYPE_key_share 51 +#endif + /* Temporary extension type */ #define TLSEXT_TYPE_renegotiate 0xff01 @@ -270,29 +295,6 @@ extern "C" { #define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2 #define TLSEXT_ECPOINTFORMAT_last 2 -/* Signature and hash algorithms from RFC 5246. */ - -#define TLSEXT_signature_anonymous 0 -#define TLSEXT_signature_rsa 1 -#define TLSEXT_signature_dsa 2 -#define TLSEXT_signature_ecdsa 3 -/* FIXME IANA */ -#define TLSEXT_signature_gostr01 237 -#define TLSEXT_signature_gostr12_256 238 -#define TLSEXT_signature_gostr12_512 239 - -#define TLSEXT_hash_none 0 -#define TLSEXT_hash_md5 1 -#define TLSEXT_hash_sha1 2 -#define TLSEXT_hash_sha224 3 -#define TLSEXT_hash_sha256 4 -#define TLSEXT_hash_sha384 5 -#define TLSEXT_hash_sha512 6 -/* FIXME IANA */ -#define TLSEXT_hash_gost94 237 -#define TLSEXT_hash_streebog_256 238 -#define TLSEXT_hash_streebog_512 239 - #define TLSEXT_MAXLEN_host_name 255 const char *SSL_get_servername(const SSL *s, const int type); @@ -354,11 +356,15 @@ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg) #define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLSEXT_TICKET_KEYS,(keylen),(keys)) +#define SSL_CTX_get_tlsext_status_cb(ssl, cb) \ +SSL_CTX_callback_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) #define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) +#define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ +SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0,(void *)arg) #define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) +SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0,(void *)arg) #define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) @@ -468,6 +474,15 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) #define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0x030000C4 #define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256 0x030000C5 +/* TLS 1.3 cipher suites from RFC 8446 appendix B.4. */ +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define TLS1_3_CK_AES_128_GCM_SHA256 0x03001301 +#define TLS1_3_CK_AES_256_GCM_SHA384 0x03001302 +#define TLS1_3_CK_CHACHA20_POLY1305_SHA256 0x03001303 +#define TLS1_3_CK_AES_128_CCM_SHA256 0x03001304 +#define TLS1_3_CK_AES_128_CCM_8_SHA256 0x03001305 +#endif + /* ECC ciphersuites from RFC 4492. */ #define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001 #define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002 @@ -674,7 +689,6 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) #define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 "ADH-AES256-GCM-SHA384" /* ECDH HMAC based ciphersuites from RFC 5289. */ - #define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 "ECDHE-ECDSA-AES128-SHA256" #define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 "ECDHE-ECDSA-AES256-SHA384" #define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 "ECDH-ECDSA-AES128-SHA256" @@ -699,6 +713,15 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) #define TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 "ECDHE-ECDSA-CHACHA20-POLY1305" #define TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305 "DHE-RSA-CHACHA20-POLY1305" +/* TLS 1.3 cipher suites from RFC 8446 appendix B.4. */ +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define TLS1_3_TXT_AES_128_GCM_SHA256 "AEAD-AES128-GCM-SHA256" +#define TLS1_3_TXT_AES_256_GCM_SHA384 "AEAD-AES256-GCM-SHA384" +#define TLS1_3_TXT_CHACHA20_POLY1305_SHA256 "AEAD-CHACHA20-POLY1305-SHA256" +#define TLS1_3_TXT_AES_128_CCM_SHA256 "AEAD-AES128-CCM-SHA256" +#define TLS1_3_TXT_AES_128_CCM_8_SHA256 "AEAD-AES128-CCM-8-SHA256" +#endif + #define TLS_CT_RSA_SIGN 1 #define TLS_CT_DSS_SIGN 2 #define TLS_CT_RSA_FIXED_DH 3 diff --git a/include/openssl/ts.h b/include/openssl/ts.h index a8d2281b..fa8eb949 100644 --- a/include/openssl/ts.h +++ b/include/openssl/ts.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ts.h,v 1.8 2016/12/27 16:05:57 jsing Exp $ */ +/* $OpenBSD: ts.h,v 1.10 2018/05/13 15:35:46 tb Exp $ */ /* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL * project 2002, 2003, 2004. */ @@ -365,7 +365,7 @@ X509_ALGOR *TS_MSG_IMPRINT_get_algo(TS_MSG_IMPRINT *a); int TS_MSG_IMPRINT_set_msg(TS_MSG_IMPRINT *a, unsigned char *d, int len); ASN1_OCTET_STRING *TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a); -int TS_REQ_set_policy_id(TS_REQ *a, ASN1_OBJECT *policy); +int TS_REQ_set_policy_id(TS_REQ *a, const ASN1_OBJECT *policy); ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a); int TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce); @@ -378,7 +378,7 @@ STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a); void TS_REQ_ext_free(TS_REQ *a); int TS_REQ_get_ext_count(TS_REQ *a); int TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos); -int TS_REQ_get_ext_by_OBJ(TS_REQ *a, ASN1_OBJECT *obj, int lastpos); +int TS_REQ_get_ext_by_OBJ(TS_REQ *a, const ASN1_OBJECT *obj, int lastpos); int TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos); X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc); X509_EXTENSION *TS_REQ_delete_ext(TS_REQ *a, int loc); @@ -439,7 +439,8 @@ STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a); void TS_TST_INFO_ext_free(TS_TST_INFO *a); int TS_TST_INFO_get_ext_count(TS_TST_INFO *a); int TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos); -int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, ASN1_OBJECT *obj, int lastpos); +int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, const ASN1_OBJECT *obj, + int lastpos); int TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos); X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc); X509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc); @@ -524,14 +525,14 @@ int TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer); int TS_RESP_CTX_set_signer_key(TS_RESP_CTX *ctx, EVP_PKEY *key); /* This parameter must be set. */ -int TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *def_policy); +int TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *def_policy); /* No additional certs are included in the response by default. */ int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs); /* Adds a new acceptable policy, only the default policy is accepted by default. */ -int TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *policy); +int TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *policy); /* Adds a new acceptable message digest. Note that no message digests are accepted by default. The md argument is shared with the caller. */ diff --git a/include/openssl/ui.h b/include/openssl/ui.h index b6b0075e..8035fc2b 100644 --- a/include/openssl/ui.h +++ b/include/openssl/ui.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ui.h,v 1.9 2014/07/10 22:45:58 jsing Exp $ */ +/* $OpenBSD: ui.h,v 1.11 2018/06/02 04:45:21 tb Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2001. */ @@ -304,7 +304,7 @@ enum UI_string_types { }; /* Create and manipulate methods */ -UI_METHOD *UI_create_method(char *name); +UI_METHOD *UI_create_method(const char *name); void UI_destroy_method(UI_METHOD *ui_method); int UI_method_set_opener(UI_METHOD *method, int (*opener)(UI *ui)); int UI_method_set_writer(UI_METHOD *method, int (*writer)(UI *ui, UI_STRING *uis)); @@ -312,12 +312,12 @@ int UI_method_set_flusher(UI_METHOD *method, int (*flusher)(UI *ui)); int UI_method_set_reader(UI_METHOD *method, int (*reader)(UI *ui, UI_STRING *uis)); int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui)); int UI_method_set_prompt_constructor(UI_METHOD *method, char *(*prompt_constructor)(UI* ui, const char* object_desc, const char* object_name)); -int (*UI_method_get_opener(UI_METHOD *method))(UI*); -int (*UI_method_get_writer(UI_METHOD *method))(UI*, UI_STRING*); -int (*UI_method_get_flusher(UI_METHOD *method))(UI*); -int (*UI_method_get_reader(UI_METHOD *method))(UI*, UI_STRING*); -int (*UI_method_get_closer(UI_METHOD *method))(UI*); -char * (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*); +int (*UI_method_get_opener(const UI_METHOD *method))(UI*); +int (*UI_method_get_writer(const UI_METHOD *method))(UI*, UI_STRING*); +int (*UI_method_get_flusher(const UI_METHOD *method))(UI*); +int (*UI_method_get_reader(const UI_METHOD *method))(UI*, UI_STRING*); +int (*UI_method_get_closer(const UI_METHOD *method))(UI*); +char * (*UI_method_get_prompt_constructor(const UI_METHOD *method))(UI*, const char*, const char*); /* The following functions are helpers for method writers to access relevant data from a UI_STRING. */ diff --git a/include/openssl/x509.h b/include/openssl/x509.h index 29493258..e30cbc0f 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.26 2016/12/27 16:05:57 jsing Exp $ */ +/* $OpenBSD: x509.h,v 1.74 2018/08/24 20:26:03 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -112,7 +112,7 @@ extern "C" { #endif -#if defined(_WIN32) +#if defined(_WIN32) && defined(__WINCRYPT_H__) #ifndef LIBRESSL_INTERNAL #ifdef _MSC_VER #pragma message("Warning, overriding WinCrypt defines") @@ -574,19 +574,12 @@ X509_ALGOR *prf; /* PKCS#8 private key info structure */ -struct pkcs8_priv_key_info_st - { - int broken; /* Flag for various broken formats */ -#define PKCS8_OK 0 -#define PKCS8_NO_OCTET 1 -#define PKCS8_EMBEDDED_PARAM 2 -#define PKCS8_NS_DB 3 -#define PKCS8_NEG_PRIVKEY 4 +struct pkcs8_priv_key_info_st { ASN1_INTEGER *version; X509_ALGOR *pkeyalg; - ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */ + ASN1_OCTET_STRING *pkey; STACK_OF(X509_ATTRIBUTE) *attributes; - }; +}; #ifdef __cplusplus } @@ -602,22 +595,28 @@ extern "C" { #define X509_EXT_PACK_UNKNOWN 1 #define X509_EXT_PACK_STRING 2 -#define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version) -/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */ -#define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore) -#define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter) #define X509_extract_key(x) X509_get_pubkey(x) /*****/ -#define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version) -#define X509_REQ_get_subject_name(x) ((x)->req_info->subject) #define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) #define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) -#define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) -#define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) -#define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) -#define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) -#define X509_CRL_get_issuer(x) ((x)->crl->issuer) -#define X509_CRL_get_REVOKED(x) ((x)->crl->revoked) +int X509_CRL_up_ref(X509_CRL *x); +int X509_CRL_get_signature_nid(const X509_CRL *crl); + +const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); +long X509_CRL_get_version(const X509_CRL *crl); +const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl); +const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl); +ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl); +ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl); +X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl); +STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl); +void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); + +int X509_REQ_get_signature_nid(const X509_REQ *req); + +void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); void X509_CRL_set_default_method(const X509_CRL_METHOD *meth); X509_CRL_METHOD *X509_CRL_METHOD_new( @@ -652,8 +651,9 @@ int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); -int X509_signature_dump(BIO *bp,const ASN1_STRING *sig, int indent); -int X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig); +int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent); +int X509_signature_print(BIO *bp, const X509_ALGOR *alg, + const ASN1_STRING *sig); int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx); @@ -757,12 +757,13 @@ X509_CRL *X509_CRL_dup(X509_CRL *crl); X509_REQ *X509_REQ_dup(X509_REQ *req); X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval); -void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, - X509_ALGOR *algor); +void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval, + const X509_ALGOR *algor); void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md); int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b); X509_NAME *X509_NAME_dup(X509_NAME *xn); +int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen); X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); int X509_cmp_time(const ASN1_TIME *s, time_t *t); @@ -804,6 +805,7 @@ extern const ASN1_ITEM X509_PUBKEY_it; int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); +EVP_PKEY * X509_PUBKEY_get0(X509_PUBKEY *key); int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain); int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); @@ -900,28 +902,34 @@ int X509_set_ex_data(X509 *r, int idx, void *arg); void *X509_get_ex_data(X509 *r, int idx); int i2d_X509_AUX(X509 *a,unsigned char **pp); X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); - -int X509_alias_set1(X509 *x, unsigned char *name, int len); -int X509_keyid_set1(X509 *x, unsigned char *id, int len); -unsigned char * X509_alias_get0(X509 *x, int *len); -unsigned char * X509_keyid_get0(X509 *x, int *len); +void X509_get0_signature(const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg, const X509 *x); +int X509_get_signature_nid(const X509 *x); + +int X509_alias_set1(X509 *x, const unsigned char *name, int len); +int X509_keyid_set1(X509 *x, const unsigned char *id, int len); +unsigned char *X509_alias_get0(X509 *x, int *len); +unsigned char *X509_keyid_get0(X509 *x, int *len); int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); int X509_TRUST_set(int *t, int trust); -int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); -int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj); +int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj); +int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj); void X509_trust_clear(X509 *x); void X509_reject_clear(X509 *x); X509_REVOKED *X509_REVOKED_new(void); void X509_REVOKED_free(X509_REVOKED *a); +X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *a); X509_REVOKED *d2i_X509_REVOKED(X509_REVOKED **a, const unsigned char **in, long len); int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **out); extern const ASN1_ITEM X509_REVOKED_it; + X509_CRL_INFO *X509_CRL_INFO_new(void); void X509_CRL_INFO_free(X509_CRL_INFO *a); X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len); int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **out); extern const ASN1_ITEM X509_CRL_INFO_it; + X509_CRL *X509_CRL_new(void); void X509_CRL_free(X509_CRL *a); X509_CRL *d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len); @@ -955,7 +963,7 @@ extern const ASN1_ITEM NETSCAPE_CERT_SEQUENCE_it; #ifndef OPENSSL_NO_EVP X509_INFO * X509_INFO_new(void); void X509_INFO_free(X509_INFO *a); -char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); +char * X509_NAME_oneline(const X509_NAME *a, char *buf, int size); int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data, unsigned char *md,unsigned int *len); @@ -971,22 +979,39 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx); #endif -int X509_set_version(X509 *x,long version); +const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); +const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); +int X509_set_version(X509 *x, long version); +long X509_get_version(const X509 *x); int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); ASN1_INTEGER * X509_get_serialNumber(X509 *x); +const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x); int X509_set_issuer_name(X509 *x, X509_NAME *name); -X509_NAME * X509_get_issuer_name(X509 *a); +X509_NAME * X509_get_issuer_name(const X509 *a); int X509_set_subject_name(X509 *x, X509_NAME *name); -X509_NAME * X509_get_subject_name(X509 *a); +X509_NAME * X509_get_subject_name(const X509 *a); int X509_set_notBefore(X509 *x, const ASN1_TIME *tm); +int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm); int X509_set_notAfter(X509 *x, const ASN1_TIME *tm); +int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm); +const ASN1_TIME *X509_get0_notBefore(const X509 *x); +ASN1_TIME *X509_getm_notBefore(const X509 *x); +const ASN1_TIME *X509_get0_notAfter(const X509 *x); +ASN1_TIME *X509_getm_notAfter(const X509 *x); int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); EVP_PKEY * X509_get_pubkey(X509 *x); -ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x); -int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); +EVP_PKEY * X509_get0_pubkey(const X509 *x); +ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x); +int X509_certificate_type(const X509 *x, const EVP_PKEY *pubkey); +int X509_get_signature_type(const X509 *x); + +#define X509_get_notBefore X509_getm_notBefore +#define X509_get_notAfter X509_getm_notAfter int X509_REQ_set_version(X509_REQ *x,long version); -int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); +long X509_REQ_get_version(const X509_REQ *x); +int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name); +X509_NAME *X509_REQ_get_subject_name(const X509_REQ *x); int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); int X509_REQ_extension_nid(int nid); @@ -999,7 +1024,7 @@ int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); int X509_REQ_get_attr_count(const X509_REQ *req); int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos); -int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, +int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, int lastpos); X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); @@ -1017,15 +1042,20 @@ int X509_REQ_add1_attr_by_txt(X509_REQ *req, int X509_CRL_set_version(X509_CRL *x, long version); int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name); int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm); +int X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm); int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); +int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); int X509_CRL_sort(X509_CRL *crl); -int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); +const STACK_OF(X509_EXTENSION) *X509_REVOKED_get0_extensions(const X509_REVOKED *x); +const ASN1_TIME *X509_REVOKED_get0_revocationDate(const X509_REVOKED *x); +const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(const X509_REVOKED *x); int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); +int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); int X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey); -int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); +int X509_check_private_key(const X509 *x509, const EVP_PKEY *pkey); int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); unsigned long X509_issuer_and_serial_hash(X509 *a); @@ -1052,11 +1082,13 @@ int X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cfla int X509_print_fp(FILE *bp,X509 *x); int X509_CRL_print_fp(FILE *bp,X509_CRL *x); int X509_REQ_print_fp(FILE *bp,X509_REQ *req); -int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); +int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, + unsigned long flags); #ifndef OPENSSL_NO_BIO -int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); -int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags); +int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase); +int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent, + unsigned long flags); int X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag); int X509_print(BIO *bp,X509 *x); int X509_ocspid_print(BIO *bp,X509 *x); @@ -1066,46 +1098,48 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long int X509_REQ_print(BIO *bp,X509_REQ *req); #endif -int X509_NAME_entry_count(X509_NAME *name); +int X509_NAME_entry_count(const X509_NAME *name); int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf,int len); -int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, - char *buf,int len); +int X509_NAME_get_text_by_OBJ(X509_NAME *name, + const ASN1_OBJECT *obj, char *buf,int len); /* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use * lastpos, search after that position on. */ -int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); -int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, +int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos); -X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); +int X509_NAME_get_index_by_OBJ(const X509_NAME *name, + const ASN1_OBJECT *obj, int lastpos); +X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc); X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); -int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, +int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, int set); -int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, - unsigned char *bytes, int len, int loc, int set); +int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, + int type, const unsigned char *bytes, int len, int loc, int set); int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, - unsigned char *bytes, int len, int loc, int set); + const unsigned char *bytes, int len, int loc, int set); X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, const char *field, int type, const unsigned char *bytes, int len); X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, - int type,unsigned char *bytes, int len); + int type, const unsigned char *bytes, int len); int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, const unsigned char *bytes, int len, int loc, int set); X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, - ASN1_OBJECT *obj, int type,const unsigned char *bytes, - int len); + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, - ASN1_OBJECT *obj); + const ASN1_OBJECT *obj); int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, const unsigned char *bytes, int len); -ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); -ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); +ASN1_OBJECT * X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne); +ASN1_STRING * X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne); +int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne); int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid, int lastpos); int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, - ASN1_OBJECT *obj,int lastpos); + const ASN1_OBJECT *obj, int lastpos); int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, int crit, int lastpos); X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); @@ -1113,56 +1147,67 @@ X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, X509_EXTENSION *ex, int loc); -int X509_get_ext_count(X509 *x); -int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); -int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos); -int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); -X509_EXTENSION *X509_get_ext(X509 *x, int loc); +int X509_get_ext_count(const X509 *x); +int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos); +int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, + int lastpos); +int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos); +X509_EXTENSION *X509_get_ext(const X509 *x, int loc); X509_EXTENSION *X509_delete_ext(X509 *x, int loc); int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); -void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); +void * X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx); int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, unsigned long flags); -int X509_CRL_get_ext_count(X509_CRL *x); -int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); -int X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos); -int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); -X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); +int X509_CRL_get_ext_count(const X509_CRL *x); +int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, + int lastpos); +int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, + const ASN1_OBJECT *obj, int lastpos); +int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, + int lastpos); +X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc); X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); -void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); -int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, - unsigned long flags); - -int X509_REVOKED_get_ext_count(X509_REVOKED *x); -int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); -int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x,ASN1_OBJECT *obj,int lastpos); -int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos); -X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); +void * X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, + int *idx); +int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, + int crit, unsigned long flags); + +int X509_REVOKED_get_ext_count(const X509_REVOKED *x); +int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, + int lastpos); +int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, + const ASN1_OBJECT *obj, int lastpos); +int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, + int crit, int lastpos); +X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc); X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); -int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); -void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); -int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, - unsigned long flags); +int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, + int loc); +void * X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, + int *crit, int *idx); +int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, + int crit, unsigned long flags); X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit, ASN1_OCTET_STRING *data); X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, - ASN1_OBJECT *obj,int crit,ASN1_OCTET_STRING *data); -int X509_EXTENSION_set_object(X509_EXTENSION *ex,ASN1_OBJECT *obj); + const ASN1_OBJECT *obj, int crit, ASN1_OCTET_STRING *data); +int X509_EXTENSION_set_object(X509_EXTENSION *ex, + const ASN1_OBJECT *obj); int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit); int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data); ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); -int X509_EXTENSION_get_critical(X509_EXTENSION *ex); +int X509_EXTENSION_get_critical(const X509_EXTENSION *ex); int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, int lastpos); -int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj, - int lastpos); +int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, + const ASN1_OBJECT *obj, int lastpos); X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, @@ -1177,7 +1222,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, const char *attrname, int type, const unsigned char *bytes, int len); void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, - ASN1_OBJECT *obj, int lastpos, int type); + const ASN1_OBJECT *obj, int lastpos, int type); X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, int atrtype, const void *data, int len); X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, @@ -1188,14 +1233,14 @@ int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj); int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len); void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype, void *data); -int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr); +int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr); ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr); ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); int EVP_PKEY_get_attr_count(const EVP_PKEY *key); int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos); -int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj, +int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj, int lastpos); X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc); X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc); @@ -1255,18 +1300,17 @@ PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, const unsi int i2d_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO *a, unsigned char **out); extern const ASN1_ITEM PKCS8_PRIV_KEY_INFO_it; -EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); +EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8); PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); -PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken); -PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken); -int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, - int version, int ptype, void *pval, - unsigned char *penc, int penclen); -int PKCS8_pkey_get0(ASN1_OBJECT **ppkalg, - const unsigned char **pk, int *ppklen, - X509_ALGOR **pa, - PKCS8_PRIV_KEY_INFO *p8); +int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version, + int ptype, void *pval, unsigned char *penc, int penclen); +int PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, const unsigned char **pk, + int *ppklen, const X509_ALGOR **pa, const PKCS8_PRIV_KEY_INFO *p8); + +const STACK_OF(X509_ATTRIBUTE) *PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8); +int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type, + const unsigned char *bytes, int len); int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj, int ptype, void *pval, @@ -1281,13 +1325,14 @@ int X509_TRUST_get_count(void); X509_TRUST * X509_TRUST_get0(int idx); int X509_TRUST_get_by_id(int id); int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), - char *name, int arg1, void *arg2); + const char *name, int arg1, void *arg2); void X509_TRUST_cleanup(void); -int X509_TRUST_get_flags(X509_TRUST *xp); -char *X509_TRUST_get0_name(X509_TRUST *xp); -int X509_TRUST_get_trust(X509_TRUST *xp); +int X509_TRUST_get_flags(const X509_TRUST *xp); +char *X509_TRUST_get0_name(const X509_TRUST *xp); +int X509_TRUST_get_trust(const X509_TRUST *xp); int X509_up_ref(X509 *x); +STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain); /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes diff --git a/include/openssl/x509_vfy.h b/include/openssl/x509_vfy.h index b58d49d2..c5eae9d3 100644 --- a/include/openssl/x509_vfy.h +++ b/include/openssl/x509_vfy.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vfy.h,v 1.18 2016/12/21 15:15:45 jsing Exp $ */ +/* $OpenBSD: x509_vfy.h,v 1.30 2018/08/24 19:21:09 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -134,17 +134,16 @@ typedef struct x509_lookup_method_st void (*free)(X509_LOOKUP *ctx); int (*init)(X509_LOOKUP *ctx); int (*shutdown)(X509_LOOKUP *ctx); - int (*ctrl)(X509_LOOKUP *ctx,int cmd,const char *argc,long argl, - char **ret); - int (*get_by_subject)(X509_LOOKUP *ctx,int type,X509_NAME *name, - X509_OBJECT *ret); - int (*get_by_issuer_serial)(X509_LOOKUP *ctx,int type,X509_NAME *name, - ASN1_INTEGER *serial,X509_OBJECT *ret); - int (*get_by_fingerprint)(X509_LOOKUP *ctx,int type, - unsigned char *bytes,int len, - X509_OBJECT *ret); - int (*get_by_alias)(X509_LOOKUP *ctx,int type,char *str,int len, - X509_OBJECT *ret); + int (*ctrl)(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, + char **ret); + int (*get_by_subject)(X509_LOOKUP *ctx, int type, X509_NAME *name, + X509_OBJECT *ret); + int (*get_by_issuer_serial)(X509_LOOKUP *ctx, int type, X509_NAME *name, + ASN1_INTEGER *serial,X509_OBJECT *ret); + int (*get_by_fingerprint)(X509_LOOKUP *ctx, int type, + const unsigned char *bytes, int len, X509_OBJECT *ret); + int (*get_by_alias)(X509_LOOKUP *ctx, int type, const char *str, + int len, X509_OBJECT *ret); } X509_LOOKUP_METHOD; typedef struct X509_VERIFY_PARAM_ID_st X509_VERIFY_PARAM_ID; @@ -424,17 +423,30 @@ int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type, X509_NAME *name); X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,int type,X509_NAME *name); X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x); -void X509_OBJECT_up_ref_count(X509_OBJECT *a); +int X509_OBJECT_up_ref_count(X509_OBJECT *a); +int X509_OBJECT_get_type(const X509_OBJECT *a); void X509_OBJECT_free_contents(X509_OBJECT *a); -X509_STORE *X509_STORE_new(void ); -void X509_STORE_free(X509_STORE *v); +X509 *X509_OBJECT_get0_X509(const X509_OBJECT *xo); +X509_CRL *X509_OBJECT_get0_X509_CRL(X509_OBJECT *xo); +X509_STORE *X509_STORE_new(void); +void X509_STORE_free(X509_STORE *v); +int X509_STORE_up_ref(X509_STORE *x); STACK_OF(X509)* X509_STORE_get1_certs(X509_STORE_CTX *st, X509_NAME *nm); STACK_OF(X509_CRL)* X509_STORE_get1_crls(X509_STORE_CTX *st, X509_NAME *nm); +STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *xs); +void *X509_STORE_get_ex_data(X509_STORE *xs, int idx); +int X509_STORE_set_ex_data(X509_STORE *xs, int idx, void *data); + +#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, (l), (p), \ + (newf), (dupf), (freef)) + int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags); int X509_STORE_set_purpose(X509_STORE *ctx, int purpose); int X509_STORE_set_trust(X509_STORE *ctx, int trust); int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm); +X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx); void X509_STORE_set_verify_cb(X509_STORE *ctx, int (*verify_cb)(int, X509_STORE_CTX *)); @@ -446,7 +458,13 @@ int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); void X509_STORE_CTX_free(X509_STORE_CTX *ctx); int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, STACK_OF(X509) *chain); +X509 *X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get0_chain(X509_STORE_CTX *xs); +X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *xs); +STACK_OF(X509) *X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx); +void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); +void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); @@ -477,8 +495,8 @@ int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, ASN1_INTEGER *serial, X509_OBJECT *ret); int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, - unsigned char *bytes, int len, X509_OBJECT *ret); -int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, + const unsigned char *bytes, int len, X509_OBJECT *ret); +int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, const char *str, int len, X509_OBJECT *ret); int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); @@ -512,7 +530,7 @@ void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, time_t t); void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, int (*verify_cb)(int, X509_STORE_CTX *)); - + X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx); int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx); @@ -542,6 +560,21 @@ int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, STACK_OF(ASN1_OBJECT) *policies); int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, const char *name, + size_t namelen); +int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name, + size_t namelen); +void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, + unsigned int flags); +char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, const char *email, + size_t emaillen); +int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, const unsigned char *ip, + size_t iplen); +int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc); +const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param); +const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id); +int X509_VERIFY_PARAM_get_count(void); int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param); const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name); diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h index fbafd694..5d6c5887 100644 --- a/include/openssl/x509v3.h +++ b/include/openssl/x509v3.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509v3.h,v 1.22 2017/06/22 17:28:00 jsing Exp $ */ +/* $OpenBSD: x509v3.h,v 1.30 2018/05/19 10:50:08 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -121,9 +121,9 @@ void *usr_data; /* Any extension specific data */ }; typedef struct X509V3_CONF_METHOD_st { -char * (*get_string)(void *db, char *section, char *value); -STACK_OF(CONF_VALUE) * (*get_section)(void *db, char *section); -void (*free_string)(void *db, char * string); +char *(*get_string)(void *db, const char *section, const char *value); +STACK_OF(CONF_VALUE) *(*get_section)(void *db, const char *section); +void (*free_string)(void *db, char *string); void (*free_section)(void *db, STACK_OF(CONF_VALUE) *section); } X509V3_CONF_METHOD; @@ -524,11 +524,14 @@ SXNETID *d2i_SXNETID(SXNETID **a, const unsigned char **in, long len); int i2d_SXNETID(SXNETID *a, unsigned char **out); extern const ASN1_ITEM SXNETID_it; -int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen); -int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen); -int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen); +int SXNET_add_id_asc(SXNET **psx, const char *zone, const char *user, + int userlen); +int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, const char *user, + int userlen); +int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, const char *user, + int userlen); -ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone); +ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, const char *zone); ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone); @@ -592,15 +595,17 @@ int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen, ASN1_OBJECT **poid, ASN1_TYPE **pvalue); -char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5); -ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); +char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, + const ASN1_OCTET_STRING *ia5); +ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, const char *str); EXTENDED_KEY_USAGE *EXTENDED_KEY_USAGE_new(void); void EXTENDED_KEY_USAGE_free(EXTENDED_KEY_USAGE *a); EXTENDED_KEY_USAGE *d2i_EXTENDED_KEY_USAGE(EXTENDED_KEY_USAGE **a, const unsigned char **in, long len); int i2d_EXTENDED_KEY_USAGE(EXTENDED_KEY_USAGE *a, unsigned char **out); extern const ASN1_ITEM EXTENDED_KEY_USAGE_it; -int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION* a); +int i2a_ACCESS_DESCRIPTION(BIO *bp, const ACCESS_DESCRIPTION* a); CERTIFICATEPOLICIES *CERTIFICATEPOLICIES_new(void); void CERTIFICATEPOLICIES_free(CERTIFICATEPOLICIES *a); @@ -683,7 +688,7 @@ extern const ASN1_ITEM POLICY_CONSTRAINTS_it; GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, - int gen_type, char *value, int is_nc); + int gen_type, const char *value, int is_nc); #ifdef HEADER_CONF_H GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, @@ -693,34 +698,41 @@ GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc); void X509V3_conf_free(CONF_VALUE *val); -X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value); -X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value); -int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, STACK_OF(X509_EXTENSION) **sk); -int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509 *cert); -int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); -int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); +X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, + const char *value); +X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, const char *name, + const char *value); +int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, const char *section, + STACK_OF(X509_EXTENSION) **sk); +int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, + X509 *cert); +int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, + X509_REQ *req); +int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, + X509_CRL *crl); X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - int ext_nid, char *value); + int ext_nid, const char *value); X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *name, char *value); + const char *name, const char *value); int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *section, X509 *cert); + const char *section, X509 *cert); int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *section, X509_REQ *req); + const char *section, X509_REQ *req); int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *section, X509_CRL *crl); + const char *section, X509_CRL *crl); -int X509V3_add_value_bool_nf(char *name, int asn1_bool, +int X509V3_add_value_bool_nf(const char *name, int asn1_bool, STACK_OF(CONF_VALUE) **extlist); -int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); -int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint); +int X509V3_get_value_bool(const CONF_VALUE *value, int *asn1_bool); +int X509V3_get_value_int(const CONF_VALUE *value, ASN1_INTEGER **aint); void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf); void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash); #endif -char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section); -STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section); +char *X509V3_get_string(X509V3_CTX *ctx, const char *name, + const char *section); +STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, const char *section); void X509V3_string_free(X509V3_CTX *ctx, char *str); void X509V3_section_free( X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section); void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject, @@ -732,12 +744,13 @@ int X509V3_add_value_uchar(const char *name, const unsigned char *value, STACK_OF(CONF_VALUE) **extlist); int X509V3_add_value_bool(const char *name, int asn1_bool, STACK_OF(CONF_VALUE) **extlist); -int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, +int X509V3_add_value_int(const char *name, const ASN1_INTEGER *aint, STACK_OF(CONF_VALUE) **extlist); -char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); -ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value); -char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); -char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); +char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const ASN1_INTEGER *aint); +ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const char *value); +char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, const ASN1_ENUMERATED *aint); +char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, + const ASN1_ENUMERATED *aint); int X509V3_EXT_add(X509V3_EXT_METHOD *ext); int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist); int X509V3_EXT_add_alias(int nid_to, int nid_from); @@ -748,7 +761,8 @@ const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); int X509V3_add_standard_extensions(void); STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); void *X509V3_EXT_d2i(X509_EXTENSION *ext); -void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); +void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit, + int *idx); X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); @@ -763,7 +777,8 @@ void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent); int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent); -int X509V3_extensions_print(BIO *out, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent); +int X509V3_extensions_print(BIO *out, const char *title, + const STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent); int X509_check_ca(X509 *x); int X509_check_purpose(X509 *x, int id, int ca); @@ -773,16 +788,16 @@ int X509_check_issued(X509 *issuer, X509 *subject); int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); int X509_PURPOSE_get_count(void); X509_PURPOSE * X509_PURPOSE_get0(int idx); -int X509_PURPOSE_get_by_sname(char *sname); +int X509_PURPOSE_get_by_sname(const char *sname); int X509_PURPOSE_get_by_id(int id); int X509_PURPOSE_add(int id, int trust, int flags, int (*ck)(const X509_PURPOSE *, const X509 *, int), - char *name, char *sname, void *arg); -char *X509_PURPOSE_get0_name(X509_PURPOSE *xp); -char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp); -int X509_PURPOSE_get_trust(X509_PURPOSE *xp); + const char *name, const char *sname, void *arg); +char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp); +char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp); +int X509_PURPOSE_get_trust(const X509_PURPOSE *xp); void X509_PURPOSE_cleanup(void); -int X509_PURPOSE_get_id(X509_PURPOSE *); +int X509_PURPOSE_get_id(const X509_PURPOSE *); STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); diff --git a/include/tls.h b/include/tls.h index 3c83acdc..e4829699 100644 --- a/include/tls.h +++ b/include/tls.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tls.h,v 1.51 2017/08/10 18:18:30 jsing Exp $ */ +/* $OpenBSD: tls.h,v 1.55 2018/11/29 14:24:23 tedu Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -34,7 +34,7 @@ typedef SSIZE_T ssize_t; #include #include -#define TLS_API 20170126 +#define TLS_API 20180210 #define TLS_PROTOCOL_TLSv1_0 (1 << 1) #define TLS_PROTOCOL_TLSv1_1 (1 << 2) @@ -92,6 +92,8 @@ const char *tls_error(struct tls *_ctx); struct tls_config *tls_config_new(void); void tls_config_free(struct tls_config *_config); +const char *tls_default_ca_cert_file(void); + int tls_config_add_keypair_file(struct tls_config *_config, const char *_cert_file, const char *_key_file); int tls_config_add_keypair_mem(struct tls_config *_config, const uint8_t *_cert, @@ -135,6 +137,7 @@ int tls_config_set_ocsp_staple_mem(struct tls_config *_config, int tls_config_set_ocsp_staple_file(struct tls_config *_config, const char *_staple_file); int tls_config_set_protocols(struct tls_config *_config, uint32_t _protocols); +int tls_config_set_session_fd(struct tls_config *_config, int _session_fd); int tls_config_set_verify_depth(struct tls_config *_config, int _verify_depth); void tls_config_prefer_ciphers_client(struct tls_config *_config); @@ -195,6 +198,7 @@ const uint8_t *tls_peer_cert_chain_pem(struct tls *_ctx, size_t *_len); const char *tls_conn_alpn_selected(struct tls *_ctx); const char *tls_conn_cipher(struct tls *_ctx); const char *tls_conn_servername(struct tls *_ctx); +int tls_conn_session_resumed(struct tls *_ctx); const char *tls_conn_version(struct tls *_ctx); uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password); diff --git a/install-sh b/install-sh index 0360b79e..8175c640 100644 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -271,15 +271,18 @@ do fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else dstdir=`dirname "$dst"` @@ -288,6 +291,11 @@ do fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then @@ -324,34 +332,43 @@ do # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi - rmdir "$tmpdir/d" "$tmpdir" + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; @@ -427,8 +444,8 @@ do else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 @@ -493,7 +510,7 @@ do done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/m4/check-libc.m4 b/m4/check-libc.m4 index 5bb42879..e511f6d0 100644 --- a/m4/check-libc.m4 +++ b/m4/check-libc.m4 @@ -2,10 +2,11 @@ AC_DEFUN([CHECK_LIBC_COMPAT], [ # Check for libc headers AC_CHECK_HEADERS([err.h readpassphrase.h]) # Check for general libc functions -AC_CHECK_FUNCS([asprintf freezero inet_ntop inet_pton memmem]) +AC_CHECK_FUNCS([asprintf freezero memmem]) AC_CHECK_FUNCS([readpassphrase reallocarray recallocarray]) AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum]) -AC_CHECK_FUNCS([timegm _mkgmtime]) +AC_CHECK_FUNCS([timegm _mkgmtime timespecsub]) +AC_CHECK_FUNCS([getprogname syslog syslog_r]) AC_CACHE_CHECK([for getpagesize], ac_cv_func_getpagesize, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ // Since Android NDK v16 getpagesize is defined as inline inside unistd.h @@ -22,8 +23,6 @@ AC_CACHE_CHECK([for getpagesize], ac_cv_func_getpagesize, [ AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes]) AM_CONDITIONAL([HAVE_FREEZERO], [test "x$ac_cv_func_freezero" = xyes]) AM_CONDITIONAL([HAVE_GETPAGESIZE], [test "x$ac_cv_func_getpagesize" = xyes]) -AM_CONDITIONAL([HAVE_INET_NTOP], [test "x$ac_cv_func_inet_ntop" = xyes]) -AM_CONDITIONAL([HAVE_INET_PTON], [test "x$ac_cv_func_inet_pton" = xyes]) AM_CONDITIONAL([HAVE_MEMMEM], [test "x$ac_cv_func_memmem" = xyes]) AM_CONDITIONAL([HAVE_READPASSPHRASE], [test "x$ac_cv_func_readpassphrase" = xyes]) AM_CONDITIONAL([HAVE_REALLOCARRAY], [test "x$ac_cv_func_reallocarray" = xyes]) @@ -35,6 +34,9 @@ AM_CONDITIONAL([HAVE_STRNLEN], [test "x$ac_cv_func_strnlen" = xyes]) AM_CONDITIONAL([HAVE_STRSEP], [test "x$ac_cv_func_strsep" = xyes]) AM_CONDITIONAL([HAVE_STRTONUM], [test "x$ac_cv_func_strtonum" = xyes]) AM_CONDITIONAL([HAVE_TIMEGM], [test "x$ac_cv_func_timegm" = xyes]) +AM_CONDITIONAL([HAVE_GETPROGNAME], [test "x$ac_cv_func_getprogname" = xyes]) +AM_CONDITIONAL([HAVE_SYSLOG], [test "x$ac_cv_func_syslog" = xyes]) +AM_CONDITIONAL([HAVE_SYSLOG_R], [test "x$ac_cv_func_syslog_r" = xyes]) ]) AC_DEFUN([CHECK_SYSCALL_COMPAT], [ @@ -128,11 +130,15 @@ AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF], -a "x$ac_cv_func_arc4random_buf" = xyes]) # Check for getentropy fallback dependencies -AC_CHECK_FUNC([getauxval]) -AC_SEARCH_LIBS([clock_gettime],[rt posix4]) -AC_CHECK_FUNC([clock_gettime]) +AC_CHECK_FUNCS([getauxval]) AC_SEARCH_LIBS([dl_iterate_phdr],[dl]) -AC_CHECK_FUNC([dl_iterate_phdr]) +AC_CHECK_FUNCS([dl_iterate_phdr]) + +AC_SEARCH_LIBS([pthread_once],[pthread]) +AC_SEARCH_LIBS([pthread_mutex_lock],[pthread]) +AC_SEARCH_LIBS([clock_gettime],[rt posix4]) +AC_CHECK_FUNCS([clock_gettime]) +AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "x$ac_cv_func_clock_gettime" = xyes]) ]) AC_DEFUN([CHECK_VA_COPY], [ diff --git a/m4/check-os-options.m4 b/m4/check-os-options.m4 index 4f56a8d5..c88c259e 100644 --- a/m4/check-os-options.m4 +++ b/m4/check-os-options.m4 @@ -9,7 +9,7 @@ case $host_os in if test "`echo $CC | cut -d ' ' -f 1`" != "gcc" ; then CFLAGS="-qnoansialias $USER_CFLAGS" fi - AC_SUBST([PLATFORM_LDADD], ['-lperfstat -lpthread']) + AC_SUBST([PLATFORM_LDADD], ['-lperfstat']) ;; *cygwin*) HOST_OS=cygwin @@ -74,7 +74,6 @@ char buf[1]; getentropy(buf, 1); CFLAGS="-g -O2 +DD64 +Otype_safety=off $USER_CFLAGS" fi CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT" - AC_SUBST([PLATFORM_LDADD], ['-lpthread']) ;; *linux*) HOST_OS=linux @@ -99,22 +98,23 @@ char buf[1]; getentropy(buf, 1); HOST_OS=openbsd HOST_ABI=elf AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded]) + AC_DEFINE([HAVE_ATTRIBUTE__DEAD], [1], [OpenBSD gcc has __dead]) ;; *mingw*) HOST_OS=win + HOST_ABI=mingw64 BUILD_NC=no CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_POSIX -D_POSIX_SOURCE -D__USE_MINGW_ANSI_STDIO" CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS" - CPPFLAGS="$CPPFLAGS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0501" + CPPFLAGS="$CPPFLAGS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600" CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SPEED" AC_SUBST([PLATFORM_LDADD], ['-lws2_32']) ;; *solaris*) HOST_OS=solaris HOST_ABI=elf - CFLAGS="$CFLAGS -m64" CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP" - AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket']) + AC_SUBST([PLATFORM_LDADD], ['-ldl -lnsl -lsocket']) ;; *) ;; esac diff --git a/man/ACCESS_DESCRIPTION_new.3 b/man/ACCESS_DESCRIPTION_new.3 index a7d894ae..2c0a6713 100644 --- a/man/ACCESS_DESCRIPTION_new.3 +++ b/man/ACCESS_DESCRIPTION_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ACCESS_DESCRIPTION_new.3,v 1.3 2016/12/28 18:31:33 jmc Exp $ +.\" $OpenBSD: ACCESS_DESCRIPTION_new.3,v 1.4 2018/03/22 16:06:33 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt ACCESS_DESCRIPTION_NEW 3 .Os .Sh NAME @@ -140,3 +140,11 @@ RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol .Pp RFC 3161: Internet X.509 Public Key Infrastructure Time-Stamp Protocol +.Sh HISTORY +.Fn ACCESS_DESCRIPTION_new , +.Fn ACCESS_DESCRIPTION_free , +.Fn AUTHORITY_INFO_ACCESS_new , +and +.Fn AUTHORITY_INFO_ACCESS_free +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/ASN1_INTEGER_get.3 b/man/ASN1_INTEGER_get.3 new file mode 100644 index 00000000..e3585b40 --- /dev/null +++ b/man/ASN1_INTEGER_get.3 @@ -0,0 +1,238 @@ +.\" $OpenBSD: ASN1_INTEGER_get.3,v 1.1 2018/07/08 23:00:17 schwarze Exp $ +.\" selective merge up to: +.\" OpenSSL man3/ASN1_INTEGER_get_int64 eaf39a9f Jun 23 10:24:00 2018 +0200 +.\" +.\" This file was written by Dr. Stephen Henson . +.\" Copyright (c) 2015 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. +.\" +.Dd $Mdocdate: July 8 2018 $ +.Dt ASN1_INTEGER_GET 3 +.Os +.Sh NAME +.Nm ASN1_INTEGER_get , +.Nm ASN1_INTEGER_set , +.Nm BN_to_ASN1_INTEGER , +.Nm ASN1_INTEGER_to_BN , +.Nm ASN1_ENUMERATED_get , +.Nm ASN1_ENUMERATED_set , +.Nm BN_to_ASN1_ENUMERATED , +.Nm ASN1_ENUMERATED_to_BN +.Nd ASN.1 INTEGER and ENUMERATED utilities +.Sh SYNOPSIS +.In openssl/asn1.h +.Ft long +.Fo ASN1_INTEGER_get +.Fa "const ASN1_INTEGER *a" +.Fc +.Ft int +.Fo ASN1_INTEGER_set +.Fa "ASN1_INTEGER *a" +.Fa "long v" +.Fc +.Ft ASN1_INTEGER * +.Fo BN_to_ASN1_INTEGER +.Fa "const BIGNUM *bn" +.Fa "ASN1_INTEGER *ai" +.Fc +.Ft BIGNUM * +.Fo ASN1_INTEGER_to_BN +.Fa "const ASN1_INTEGER *ai" +.Fa "BIGNUM *bn" +.Fc +.Ft long +.Fo ASN1_ENUMERATED_get +.Fa "const ASN1_ENUMERATED *a" +.Fc +.Ft int +.Fo ASN1_ENUMERATED_set +.Fa "ASN1_ENUMERATED *a" +.Fa "long v" +.Fc +.Ft ASN1_ENUMERATED * +.Fo BN_to_ASN1_ENUMERATED +.Fa "const BIGNUM *bn" +.Fa "ASN1_ENUMERATED *ai" +.Fc +.Ft BIGNUM * +.Fo ASN1_ENUMERATED_to_BN +.Fa "const ASN1_ENUMERATED *ai" +.Fa "BIGNUM *bn" +.Fc +.Sh DESCRIPTION +These functions convert to and from +.Vt ASN1_INTEGER +and +.Vt ASN1_ENUMERATED +objects. +.Pp +.Fn ASN1_INTEGER_get +converts +.Fa a +to the +.Vt long +type. +.Pp +.Fn ASN1_INTEGER_set +sets the value of +.Fa a +to +.Fa v . +.Pp +.Fn BN_to_ASN1_INTEGER +converts +.Fa bn +to an +.Vt ASN1_INTEGER . +If +.Fa ai +is +.Dv NULL , +a new +.Vt ASN1_INTEGER +object is returned. +Otherwise, the existing object +.Fa ai +is used instead. +.Pp +.Fn ASN1_INTEGER_to_BN +converts +.Fa ai +into a +.Vt BIGNUM . +If +.Fa bn +is +.Dv NULL , +a new +.Vt BIGNUM +object is returned. +Otherwise, the existing object +.Fa bn +is used instead. +.Pp +.Fn ASN1_ENUMERATED_get , +.Fn ASN1_ENUMERATED_set , +.Fn BN_to_ASN1_ENUMERATED , +and +.Fn ASN1_ENUMERATED_to_BN +behave like their +.Vt ASN1_INTEGER +counterparts except that they operate on an +.Vt ASN1_ENUMERATED +object. +.Sh RETURN VALUES +.Fn ASN1_INTEGER_get +and +.Fn ASN1_ENUMERATED_get +return the converted value, 0 if +.Fa a +is +.Dv NULL , +or \-1 on error, which is ambiguous because \-1 is a legitimate +value for an +.Vt ASN1_INTEGER . +.Pp +.Fn ASN1_INTEGER_set +and +.Fn ASN1_ENUMERATED_set +return 1 for success or 0 for failure. +They only fail if a memory allocation error occurs. +.Pp +.Fn BN_to_ASN1_INTEGER +and +.Fn BN_to_ASN1_ENUMERATED +return an +.Vt ASN1_INTEGER +or +.Vt ASN1_ENUMERATED +object, respectively, or +.Dv NULL +if an error occurs. +They only fail due to memory allocation errors. +.Pp +.Fn ASN1_INTEGER_to_BN +and +.Fn ASN1_ENUMERATED_to_BN +return a +.Vt BIGNUM +object of +.Dv NULL +if an error occurs. +They can fail if the passed type is incorrect (due to a programming error) +or due to memory allocation failures. +.Sh HISTORY +.Fn ASN1_INTEGER_set +first appeared in SSLeay 0.5.1. +.Fn ASN1_INTEGER_get , +.Fn BN_to_ASN1_INTEGER , +and +.Fn ASN1_INTEGER_to_BN +first appeared in SSLeay 0.6.0. +These functions have been available since +.Ox 2.3 . +.Pp +.Fn ASN1_ENUMERATED_get , +.Fn ASN1_ENUMERATED_set , +.Fn BN_to_ASN1_ENUMERATED , +and +.Fn ASN1_ENUMERATED_to_BN +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . +.Sh CAVEATS +In general an +.Vt ASN1_INTEGER +or +.Vt ASN1_ENUMERATED +type can contain an integer of almost arbitrary size +and so cannot always be represented by a C +.Vt long +type. +The ambiguous return values of +.Fn ASN1_INTEGER_get +and +.Fn ASN1_ENUMERATED_get +imply that these functions should be avoided if possible. diff --git a/man/ASN1_OBJECT_new.3 b/man/ASN1_OBJECT_new.3 index e7c3540b..b661337c 100644 --- a/man/ASN1_OBJECT_new.3 +++ b/man/ASN1_OBJECT_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ASN1_OBJECT_new.3,v 1.8 2017/01/04 05:14:51 schwarze Exp $ +.\" $OpenBSD: ASN1_OBJECT_new.3,v 1.10 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d4 Mar 19 12:28:58 2016 -0400 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 4 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ASN1_OBJECT_NEW 3 .Os .Sh NAME @@ -137,4 +137,5 @@ Otherwise it returns a pointer to the new object. .Fn ASN1_OBJECT_new and .Fn ASN1_OBJECT_free -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . diff --git a/man/ASN1_STRING_TABLE_add.3 b/man/ASN1_STRING_TABLE_add.3 index 964f7204..cf5741e9 100644 --- a/man/ASN1_STRING_TABLE_add.3 +++ b/man/ASN1_STRING_TABLE_add.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ASN1_STRING_TABLE_add.3,v 1.2 2017/08/20 18:06:42 jmc Exp $ +.\" $OpenBSD: ASN1_STRING_TABLE_add.3,v 1.3 2018/03/22 16:06:33 schwarze Exp $ .\" OpenSSL ASN1_STRING_TABLE_add.pod 7b608d08 Jul 27 01:18:50 2017 +0800 .\" .\" Copyright (c) 2017 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt ASN1_STRING_TABLE_ADD 3 .Os .Sh NAME @@ -88,5 +88,12 @@ if nothing is found. .Xr ASN1_OBJECT_new 3 , .Xr ERR_get_error 3 , .Xr OBJ_nid2obj 3 +.Sh HISTORY +.Fn ASN1_STRING_TABLE_add , +.Fn ASN1_STRING_TABLE_get , +and +.Fn ASN1_STRING_TABLE_cleanup +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . .Sh BUGS Most aspects of the semantics considerably differ from OpenSSL. diff --git a/man/ASN1_STRING_length.3 b/man/ASN1_STRING_length.3 index 2c797481..65501acf 100644 --- a/man/ASN1_STRING_length.3 +++ b/man/ASN1_STRING_length.3 @@ -1,8 +1,25 @@ -.\" $OpenBSD: ASN1_STRING_length.3,v 1.6 2016/12/25 22:15:10 schwarze Exp $ -.\" OpenSSL 99d63d46 Tue Jun 21 07:03:34 2016 -0400 +.\" $OpenBSD: ASN1_STRING_length.3,v 1.17 2018/05/19 22:55:17 schwarze Exp $ +.\" full merge up to: OpenSSL 4a56d2a3 Feb 25 16:49:27 2018 +0300 .\" -.\" This file was written by Dr. Stephen Henson. -.\" Copyright (c) 2002, 2006, 2013, 2015, 2016 The OpenSSL Project. +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Dr. Stephen Henson. +.\" Copyright (c) 2002, 2006, 2013, 2015, 2016, 2017 The OpenSSL Project. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -49,13 +66,14 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: May 19 2018 $ .Dt ASN1_STRING_LENGTH 3 .Os .Sh NAME .Nm ASN1_STRING_cmp , .Nm ASN1_STRING_data , .Nm ASN1_STRING_dup , +.Nm ASN1_STRING_get0_data , .Nm ASN1_STRING_length , .Nm ASN1_STRING_length_set , .Nm ASN1_STRING_set , @@ -66,8 +84,8 @@ .In openssl/asn1.h .Ft int .Fo ASN1_STRING_cmp -.Fa "ASN1_STRING *a" -.Fa "ASN1_STRING *b" +.Fa "const ASN1_STRING *a" +.Fa "const ASN1_STRING *b" .Fc .Ft unsigned char * .Fo ASN1_STRING_data @@ -75,11 +93,15 @@ .Fc .Ft ASN1_STRING * .Fo ASN1_STRING_dup -.Fa "ASN1_STRING *a" +.Fa "const ASN1_STRING *a" +.Fc +.Ft const unsigned char * +.Fo ASN1_STRING_get0_data +.Fa "const ASN1_STRING *x" .Fc .Ft int .Fo ASN1_STRING_length -.Fa "ASN1_STRING *x" +.Fa "const ASN1_STRING *x" .Fc .Ft void .Fo ASN1_STRING_length_set @@ -95,11 +117,11 @@ .Ft int .Fo ASN1_STRING_to_UTF8 .Fa "unsigned char **out" -.Fa "ASN1_STRING *in" +.Fa "const ASN1_STRING *in" .Fc .Ft int .Fo ASN1_STRING_type -.Fa "ASN1_STRING *x" +.Fa "const ASN1_STRING *x" .Fc .Sh DESCRIPTION These functions manipulate @@ -107,27 +129,33 @@ These functions manipulate structures. .Pp .Fn ASN1_STRING_cmp -compares +compares the type, the length, and the content of .Fa a and -.Fa b -and returns 0 if the two are identical. -The string types and the content are compared. +.Fa b . .Pp .Fn ASN1_STRING_data -returns an internal pointer to the data of -.Fa x . -Since this is an internal pointer, it should -.Em not -be freed or modified in any way. +is similar to +.Fn ASN1_STRING_get0_data +except that the returned value is not constant. +This function is deprecated. +Applications should use +.Fn ASN1_STRING_get0_data +instead. .Pp .Fn ASN1_STRING_dup -returns a copy of the structure +copies .Fa a . .Pp -.Fn ASN1_STRING_length -returns the length of the content of +.Fn ASN1_STRING_get0_data +returns an internal pointer to the data of .Fa x . +It should not be freed or modified in any way. +.Pp +.Fn ASN1_STRING_length +returns the length attribute of +.Fa x , +measured in bytes. .Pp .Fn ASN1_STRING_length_set sets the length attribute of @@ -139,39 +167,46 @@ It may put into an inconsistent internal state. .Pp .Fn ASN1_STRING_set -sets the data of the string +sets the length attribute of .Fa str -to the buffer +to +.Fa len +and copies that number of bytes from .Fa data -of length +into +.Fa str . +If +.Fa len +is -1, then +.Fn strlen data +is used instead of .Fa len . -The supplied data is copied. If +.Fa data +is +.Dv NULL , +the content of +.Fa str +remains uninitialized; that is not considered an error unless .Fa len -is -1 then the length is determined by -.Fn strlen data . +is negative. .Pp .Fn ASN1_STRING_to_UTF8 converts the string .Fa in -to UTF8 format. +to UTF-8 format. The converted data is copied into a newly allocated buffer -.Fa out . -The length of -.Fa out -is returned or a negative error code. +.Pf * Fa out . The buffer -.Fa out +.Pf * Fa out should be freed using .Xr free 3 . .Pp .Fn ASN1_STRING_type returns the type of -.Fa x , -using standard constants such as -.Dv V_ASN1_OCTET_STRING . +.Fa x . .Pp -Almost all ASN.1 types in OpenSSL are represented as +Almost all ASN.1 types are represented as .Vt ASN1_STRING structures. Other types such as @@ -198,19 +233,85 @@ types: the relevant INTEGER or ENUMERATED utility functions should be used instead. .Pp In general it cannot be assumed that the data returned by +.Fn ASN1_STRING_get0_data +and .Fn ASN1_STRING_data is NUL terminated, and it may contain embedded NUL characters. -The actual format of the data will depend on the actual string type itself: +The format of the data depends on the string type: for example for an .Vt IA5String -the data will be ASCII, for a +the data contains ASCII characters, for a .Vt BMPString -two bytes per character in big endian format, and a +two bytes per character in big endian format, and for a .Vt UTF8String -will be in UTF8 format. +UTF-8 characters. .Pp -Similar care should be take to ensure the data is in the correct format +Similar care should be taken to ensure the data is in the correct format when calling .Fn ASN1_STRING_set . +.Sh RETURN VALUES +.Fn ASN1_STRING_cmp +returns 0 if the type, the length, and the content of +.Fa a +and +.Fa b +agree, or a non-zero value otherwise. +In contrast to +.Xr strcmp 3 , +the sign of the return value does not indicate lexicographical ordering. +.Pp +.Fn ASN1_STRING_data +and +.Fn ASN1_STRING_get0_data +return an internal pointer to the data of +.Fa x . +.Pp +.Fn ASN1_STRING_dup +returns a pointer to a newly allocated +.Vt ASN1_STRING +structure or +.Dv NULL +if an error occurred. +.Pp +.Fn ASN1_STRING_length +returns a number of bytes. +.Pp +.Fn ASN1_STRING_set +returns 1 on success or 0 on failure. +.Pp +.Fn ASN1_STRING_to_UTF8 +returns the number of bytes in the output buffer +.Pf * Fa out , +or a negative number if an error occurred. +.Pp +.Fn ASN1_STRING_type +returns an integer constant, for example +.Dv V_ASN1_OCTET_STRING . .Sh SEE ALSO .Xr ERR_get_error 3 +.Sh HISTORY +.Fn ASN1_STRING_cmp , +.Fn ASN1_STRING_dup , +and +.Fn ASN1_STRING_set +first appeared in SSLeay 0.6.5. +.Fn ASN1_STRING_data +and +.Fn ASN1_STRING_type +first appeared in SSLeay 0.8.0. +.Fn ASN1_STRING_length +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn ASN1_STRING_length_set +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . +.Pp +.Fn ASN1_STRING_to_UTF8 +first appeared in OpenSSL 0.9.6 and has been available since +.Ox 2.9 . +.Pp +.Fn ASN1_STRING_get0_data +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/ASN1_STRING_new.3 b/man/ASN1_STRING_new.3 index 589fbb12..07093eee 100644 --- a/man/ASN1_STRING_new.3 +++ b/man/ASN1_STRING_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ASN1_STRING_new.3,v 1.10 2017/01/07 23:15:37 schwarze Exp $ +.\" $OpenBSD: ASN1_STRING_new.3,v 1.15 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Tue Mar 24 07:52:24 2015 -0400 .\" .\" Copyright (c) 2017 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 7 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ASN1_STRING_NEW 3 .Os .Sh NAME @@ -206,6 +206,63 @@ if an error occurs. .Xr ASN1_TIME_set 3 , .Xr d2i_ASN1_OCTET_STRING 3 , .Xr ERR_get_error 3 +.Sh HISTORY +.Fn ASN1_OCTET_STRING_new , +.Fn ASN1_OCTET_STRING_free , +.Fn ASN1_BIT_STRING_new , +.Fn ASN1_BIT_STRING_free , +.Fn ASN1_INTEGER_new , +.Fn ASN1_INTEGER_free , +.Fn ASN1_IA5STRING_new , +.Fn ASN1_IA5STRING_free , +.Fn ASN1_T61STRING_new , +.Fn ASN1_T61STRING_free , +.Fn ASN1_PRINTABLESTRING_new , +.Fn ASN1_PRINTABLESTRING_free , +.Fn ASN1_PRINTABLE_new , +.Fn ASN1_PRINTABLE_free , +.Fn ASN1_UTCTIME_new , +and +.Fn ASN1_UTCTIME_free +first appeared in SSLeay 0.5.1. +.Fn ASN1_STRING_new , +.Fn ASN1_STRING_type_new , +and +.Fn ASN1_STRING_free +first appeared in SSLeay 0.6.5. +.Fn ASN1_UNIVERSALSTRING_new , +.Fn ASN1_UNIVERSALSTRING_free , +.Fn ASN1_GENERALSTRING_new , +and +.Fn ASN1_GENERALSTRING_free +first appeared in SSLeay 0.8.0. +.Fn ASN1_BMPSTRING_new , +.Fn ASN1_BMPSTRING_free , +.Fn ASN1_GENERALIZEDTIME_new , +and +.Fn ASN1_GENERALIZEDTIME_free +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn ASN1_ENUMERATED_new , +.Fn ASN1_ENUMERATED_free , +.Fn ASN1_TIME_new , +and +.Fn ASN1_TIME_free +first appeared in OpenSSL 0.9.2b. +.Fn ASN1_UTF8STRING_new , +.Fn ASN1_UTF8STRING_free , +.Fn ASN1_VISIBLESTRING_new , +.Fn ASN1_VISIBLESTRING_free , +.Fn DIRECTORYSTRING_new , +.Fn DIRECTORYSTRING_free , +.Fn DISPLAYTEXT_new , +and +.Fn DISPLAYTEXT_free +first appeared in OpenSSL 0.9.3. +These functions have been available since +.Ox 2.6 . .Sh BUGS .Vt ASN1_OCTET_STRING , .Vt ASN1_BIT_STRING , diff --git a/man/ASN1_STRING_print_ex.3 b/man/ASN1_STRING_print_ex.3 index 74ddc970..03d21008 100644 --- a/man/ASN1_STRING_print_ex.3 +++ b/man/ASN1_STRING_print_ex.3 @@ -1,6 +1,6 @@ -.\" $OpenBSD: ASN1_STRING_print_ex.3,v 1.8 2017/08/20 15:44:22 schwarze Exp $ -.\" OpenSSL ASN1_STRING_print_ex.pod a95d7574 Jul 2 12:16:38 2017 -0400 -.\" OpenSSL ASN1_STRING_print_ex.pod bb9ad09e Jun 6 00:43:05 2016 -0400 +.\" $OpenBSD: ASN1_STRING_print_ex.3,v 1.14 2018/04/25 15:17:52 schwarze Exp $ +.\" full merge up to: OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file was written by Dr. Stephen Henson. .\" Copyright (c) 2002, 2004, 2007, 2013, 2016, 2017 The OpenSSL Project. @@ -50,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: April 25 2018 $ .Dt ASN1_STRING_PRINT_EX 3 .Os .Sh NAME @@ -64,19 +64,19 @@ .Ft int .Fo ASN1_STRING_print_ex .Fa "BIO *out" -.Fa "ASN1_STRING *str" +.Fa "const ASN1_STRING *str" .Fa "unsigned long flags" .Fc .Ft int .Fo ASN1_STRING_print_ex_fp .Fa "FILE *fp" -.Fa "ASN1_STRING *str" +.Fa "const ASN1_STRING *str" .Fa "unsigned long flags" .Fc .Ft int .Fo ASN1_STRING_print .Fa "BIO *out" -.Fa "ASN1_STRING *str" +.Fa "const ASN1_STRING *str" .Fc .Ft const char * .Fo ASN1_tag2str @@ -208,5 +208,30 @@ It is equivalent to .Dv ASN1_STRFLGS_UTF8_CONVERT | .Dv ASN1_STRFLGS_DUMP_UNKNOWN | .Dv ASN1_STRFLGS_DUMP_DER . +.Sh RETURN VALUES +.Fn ASN1_STRING_print_ex +and +.Fn ASN1_STRING_print_ex_fp +return the number of characters written or \-1 if an error occurred. +.Pp +.Fn ASN1_STRING_print +returns 1 on success or 0 on error. +.Pp +.Fn ASN1_tag2str +returns a static string. .Sh SEE ALSO .Xr X509_NAME_print_ex 3 +.Sh HISTORY +.Fn ASN1_STRING_print +first appeared in SSLeay 0.6.5 and has been available since +.Ox 2.4 . +.Pp +.Fn ASN1_tag2str +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . +.Pp +.Fn ASN1_STRING_print_ex +and +.Fn ASN1_STRING_print_ex_fp +first appeared in OpenSSL 0.9.6 and have been available since +.Ox 2.9 . diff --git a/man/ASN1_TIME_set.3 b/man/ASN1_TIME_set.3 index 5fc6edb3..7437224c 100644 --- a/man/ASN1_TIME_set.3 +++ b/man/ASN1_TIME_set.3 @@ -1,6 +1,6 @@ -.\" $OpenBSD: ASN1_TIME_set.3,v 1.3 2017/08/20 17:16:40 schwarze Exp $ -.\" OpenSSL ASN1_TIME_set.pod cf37aaa3 Aug 4 11:24:03 2017 +1000 -.\" OpenSSL ASN1_TIME_set.pod e9b77246 Jan 20 19:58:49 2017 +0100 +.\" $OpenBSD: ASN1_TIME_set.3,v 1.13 2018/04/25 15:17:52 schwarze Exp $ +.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 +.\" selective merge up to: OpenSSL b0edda11 Mar 20 13:00:17 2018 +0000 .\" .\" This file was written by Dr. Stephen Henson .\" and Todd Short . @@ -50,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: April 25 2018 $ .Dt ASN1_TIME_SET 3 .Os .Sh NAME @@ -158,7 +158,7 @@ .Fc .Ft ASN1_GENERALIZEDTIME * .Fo ASN1_TIME_to_generalizedtime -.Fa "ASN1_TIME *t" +.Fa "const ASN1_TIME *t" .Fa "ASN1_GENERALIZEDTIME **out" .Fc .Sh DESCRIPTION @@ -214,7 +214,7 @@ may change the type from .Vt ASN1_GENERALIZEDTIME to .Vt ASN1_UTCTIME -or vise-versa depending on the resulting year. +or vice versa depending on the resulting year. The functions .Fn ASN1_UTCTIME_adj and @@ -396,8 +396,44 @@ ASN1_STRING_free(tm); BIO_free(b); .Ed .Sh HISTORY -.Fn ASN1_TIME_cmp_time_t -first appeared in OpenSSL 1.1.1. +.Fn ASN1_UTCTIME_check +and +.Fn ASN1_UTCTIME_print +first appeared in SSLeay 0.5.1. +.Fn ASN1_UTCTIME_set +first appeared in SSLeay 0.6.0. +.Fn ASN1_UTCTIME_set_string +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn ASN1_TIME_set , +.Fn ASN1_GENERALIZEDTIME_set , +.Fn ASN1_GENERALIZEDTIME_set_string , +.Fn ASN1_GENERALIZEDTIME_check , +.Fn ASN1_TIME_print , +and +.Fn ASN1_GENERALIZEDTIME_print +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . +.Pp +.Fn ASN1_UTCTIME_cmp_time_t +first appeared in OpenSSL 0.9.6 and has been available since +.Ox 2.9 . +.Pp +.Fn ASN1_TIME_check +and +.Fn ASN1_TIME_to_generalizedtime +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn ASN1_TIME_adj , +.Fn ASN1_UTCTIME_adj , +.Fn ASN1_GENERALIZEDTIME_adj , +and +.Fn ASN1_TIME_set_string +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . .Sh CAVEATS Some applications add offset times directly to a .Vt time_t diff --git a/man/ASN1_TYPE_get.3 b/man/ASN1_TYPE_get.3 index 47ea1cdf..b02c9158 100644 --- a/man/ASN1_TYPE_get.3 +++ b/man/ASN1_TYPE_get.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ASN1_TYPE_get.3,v 1.3 2017/01/03 20:15:47 schwarze Exp $ +.\" $OpenBSD: ASN1_TYPE_get.3,v 1.8 2018/04/25 15:17:52 schwarze Exp $ .\" OpenSSL 99d63d46 Mon Jun 6 00:43:05 2016 -0400 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 3 2017 $ +.Dd $Mdocdate: April 25 2018 $ .Dt ASN1_TYPE_GET 3 .Os .Sh NAME @@ -84,7 +84,7 @@ .Fn ASN1_TYPE_free "ASN1_TYPE *a" .Ft int .Fo ASN1_TYPE_get -.Fa "ASN1_TYPE *a" +.Fa "const ASN1_TYPE *a" .Fc .Ft void .Fo ASN1_TYPE_set @@ -100,8 +100,8 @@ .Fc .Ft int .Fo ASN1_TYPE_cmp -.Fa "ASN1_TYPE *a" -.Fa "ASN1_TYPE *b" +.Fa "const ASN1_TYPE *a" +.Fa "const ASN1_TYPE *b" .Fc .Sh DESCRIPTION .Vt ASN1_TYPE @@ -278,3 +278,23 @@ returns 0 for a match or non-zero for a mismatch. .Xr ASN1_STRING_dup 3 , .Xr d2i_ASN1_TYPE 3 , .Xr OBJ_dup 3 +.Sh HISTORY +.Fn ASN1_TYPE_new +and +.Fn ASN1_TYPE_free +first appeared in SSLeay 0.5.1. +.Fn ASN1_TYPE_get +and +.Fn ASN1_TYPE_set +first appeared in SSLeay 0.8.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn ASN1_TYPE_set1 +first appeared in OpenSSL 0.9.8h and has been available since +.Ox 4.5 . +.Pp +.Fn ASN1_TYPE_cmp +first appeared in OpenSSL 0.9.8zd, 1.0.0p, and 1.0.1k +and has been available since +.Ox 4.9 . diff --git a/man/ASN1_generate_nconf.3 b/man/ASN1_generate_nconf.3 index 5e1ba0a8..87ff769f 100644 --- a/man/ASN1_generate_nconf.3 +++ b/man/ASN1_generate_nconf.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ASN1_generate_nconf.3,v 1.9 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: ASN1_generate_nconf.3,v 1.11 2018/04/25 15:17:52 schwarze Exp $ .\" OpenSSL 05ea606a Fri May 20 20:52:46 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson. @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: April 25 2018 $ .Dt ASN1_GENERATE_NCONF 3 .Os .Sh NAME @@ -60,12 +60,12 @@ .In openssl/asn1.h .Ft ASN1_TYPE * .Fo ASN1_generate_nconf -.Fa "char *str" +.Fa "const char *str" .Fa "CONF *nconf" .Fc .Ft ASN1_TYPE * .Fo ASN1_generate_v3 -.Fa "char *str" +.Fa "const char *str" .Fa "X509V3_CTX *cnf" .Fc .Sh DESCRIPTION @@ -389,4 +389,5 @@ e=INTEGER:0x010001 .Fn ASN1_generate_nconf and .Fn ASN1_generate_v3 -were added to OpenSSL 0.9.8. +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/ASN1_item_d2i.3 b/man/ASN1_item_d2i.3 index 4bdaf4ba..705deedd 100644 --- a/man/ASN1_item_d2i.3 +++ b/man/ASN1_item_d2i.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ASN1_item_d2i.3,v 1.4 2017/01/03 23:56:50 schwarze Exp $ +.\" $OpenBSD: ASN1_item_d2i.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL doc/man3/d2i_X509.pod b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 3 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ASN1_ITEM_D2I 3 .Os .Sh NAME @@ -363,6 +363,27 @@ if (d2i_X509(&x, &p, len) == NULL) .Sh SEE ALSO .Xr ASN1_item_new 3 , .Xr ASN1_TYPE_new 3 +.Sh HISTORY +.Fn d2i_ASN1_TYPE +and +.Fn i2d_ASN1_TYPE +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp +.Fn ASN1_item_d2i , +.Fn ASN1_item_d2i_bio , +.Fn ASN1_item_d2i_fp , +.Fn ASN1_item_i2d , +.Fn ASN1_item_i2d_bio , +.Fn ASN1_item_i2d_fp , +and +.Fn ASN1_item_dup +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn ASN1_item_print +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . .Sh CAVEATS If the type described by .Fa it diff --git a/man/ASN1_item_new.3 b/man/ASN1_item_new.3 index e6798157..259deaca 100644 --- a/man/ASN1_item_new.3 +++ b/man/ASN1_item_new.3 @@ -1,6 +1,6 @@ -.\" $OpenBSD: ASN1_item_new.3,v 1.2 2017/01/03 20:15:47 schwarze Exp $ +.\" $OpenBSD: ASN1_item_new.3,v 1.4 2018/03/22 21:08:22 schwarze Exp $ .\" -.\" Copyright (c) 2016 Ingo Schwarze +.\" Copyright (c) 2016, 2018 Ingo Schwarze .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 3 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt ASN1_ITEM_NEW 3 .Os .Sh NAME @@ -38,8 +38,17 @@ allocates and initializes an empty ASN.1 value of the type described by the global static object .Fa it . .Pp +If the item type described by +.Fa it +is reference counted, +.Fn ASN1_item_free +decrements the reference count of +.Fa val_in . +Otherwise, or if the reference count reaches 0, .Fn ASN1_item_free -frees an ASN.1 value of the type described by +frees +.Fa val_in , +assuming that it is of the type described by .Fa it . If the true type of .Fa val_in @@ -98,6 +107,12 @@ if an error occurs. .Xr ASN1_TYPE_new 3 , .Xr d2i_ASN1_NULL 3 , .Xr OBJ_nid2obj 3 +.Sh HISTORY +.Fn ASN1_item_new +and +.Fn ASN1_item_free +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . .Sh BUGS The .Vt ASN1_VALUE diff --git a/man/ASN1_time_parse.3 b/man/ASN1_time_parse.3 index 9109cbd7..8604e181 100644 --- a/man/ASN1_time_parse.3 +++ b/man/ASN1_time_parse.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ASN1_time_parse.3,v 1.5 2017/05/06 18:07:46 jmc Exp $ +.\" $OpenBSD: ASN1_time_parse.3,v 1.7 2018/03/23 23:18:17 schwarze Exp $ .\" .\" Copyright (c) 2016 Bob Beck .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 6 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt ASN1_TIME_PARSE 3 .Os .Sh NAME @@ -73,7 +73,7 @@ sets the structure .Fa s to the time represented by the -.Vt strict tm +.Vt struct tm value pointed to by .Fa tm . If @@ -125,3 +125,13 @@ returns a pointer to an structure or .Dv NULL if an error occurred. +.Sh HISTORY +.Fn ASN1_time_parse +and +.Fn ASN1_time_tm_cmp +first appeared in +.Ox 6.1 +and +.Fn ASN1_TIME_set_tm +in +.Ox 6.2 . diff --git a/man/AUTHORITY_KEYID_new.3 b/man/AUTHORITY_KEYID_new.3 index 94d6e14a..846be074 100644 --- a/man/AUTHORITY_KEYID_new.3 +++ b/man/AUTHORITY_KEYID_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: AUTHORITY_KEYID_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: AUTHORITY_KEYID_new.3,v 1.3 2018/03/21 16:09:51 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt AUTHORITY_KEYID_NEW 3 .Os .Sh NAME @@ -64,3 +64,9 @@ section 4.2.1.1: Certificate Extensions: Authority Key Identifier .It section 5.2.1: CRL Extensions: Authority Key Identifier .El +.Sh HISTORY +.Fn AUTHORITY_KEYID_new +and +.Fn AUTHORITY_KEYID_free +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . diff --git a/man/BASIC_CONSTRAINTS_new.3 b/man/BASIC_CONSTRAINTS_new.3 index c133bb1c..edc3f544 100644 --- a/man/BASIC_CONSTRAINTS_new.3 +++ b/man/BASIC_CONSTRAINTS_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BASIC_CONSTRAINTS_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: BASIC_CONSTRAINTS_new.3,v 1.3 2018/03/21 16:09:51 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt BASIC_CONSTRAINTS_NEW 3 .Os .Sh NAME @@ -78,3 +78,9 @@ section 4.2.1.9: Basic Constraints .It section 6.1: Basic Path Validation .El +.Sh HISTORY +.Fn BASIC_CONSTRAINTS_new +and +.Fn BASIC_CONSTRAINTS_free +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . diff --git a/man/BF_set_key.3 b/man/BF_set_key.3 index ef5c7764..b2c5fdc9 100644 --- a/man/BF_set_key.3 +++ b/man/BF_set_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BF_set_key.3,v 1.5 2016/11/11 01:20:53 schwarze Exp $ +.\" $OpenBSD: BF_set_key.3,v 1.9 2019/01/02 07:42:21 jmc Exp $ .\" OpenSSL 99d63d46 Jul 19 09:27:53 2016 -0400 .\" .\" This file was written by Richard Levitte . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 11 2016 $ +.Dd $Mdocdate: January 2 2019 $ .Dt BF_SET_KEY 3 .Os .Sh NAME @@ -188,7 +188,7 @@ operates on data that is a multiple of 8 bytes long, while .Fn BF_cfb64_encrypt and .Fn BF_ofb64_encrypt -are used to encrypt an variable number of bytes (the amount +are used to encrypt a variable number of bytes (the amount does not have to be an exact multiple of 8). The purpose of the latter two is to simulate stream ciphers and, therefore, they need the parameter @@ -258,4 +258,16 @@ Be aware that these functions take each 32-bit chunk in host-byte order, which is little-endian on little-endian platforms and big-endian on big-endian ones. .Sh HISTORY -The Blowfish functions are available in all versions of SSLeay and OpenSSL. +.Fn BF_set_key , +.Fn BF_encrypt , +.Fn BF_ecb_encrypt , +.Fn BF_cbc_encrypt , +.Fn BF_cfb64_encrypt , +.Fn BF_ofb64_encrypt , +and +.Fn BF_options +first appeared in SSLeay 0.6.6. +.Fn BF_decrypt +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/BIO_ctrl.3 b/man/BIO_ctrl.3 index 7d1c5da6..98c78be1 100644 --- a/man/BIO_ctrl.3 +++ b/man/BIO_ctrl.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_ctrl.3,v 1.7 2017/08/01 14:57:03 schwarze Exp $ +.\" $OpenBSD: BIO_ctrl.3,v 1.14 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b055fceb Thu Oct 20 09:56:18 2016 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 1 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BIO_CTRL 3 .Os .Sh NAME @@ -308,7 +308,43 @@ Source/sink BIOs return an 0 if they do not recognize the .Fn BIO_ctrl operation. .Sh SEE ALSO +.Xr BIO_meth_new 3 , .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_ctrl , +.Fn BIO_reset , +.Fn BIO_flush , +.Fn BIO_eof , +.Fn BIO_set_close , +.Fn BIO_get_close , +and +.Fn BIO_pending +first appeared in SSLeay 0.6.0. +.Fn BIO_wpending +first appeared in SSLeay 0.8.1. +.Fn BIO_ptr_ctrl , +.Fn BIO_int_ctrl , +.Fn BIO_get_info_callback +and +.Fn BIO_set_info_callback +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn BIO_seek +and +.Fn BIO_tell +first appeared in SSLeay 0.9.1. +.Fn BIO_ctrl_pending +and +.Fn BIO_ctrl_wpending +first appeared in OpenSSL 0.9.4. +These functions have been available since +.Ox 2.6 . +.Pp +.Fn BIO_callback_ctrl +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . .Sh BUGS Some of the return values are ambiguous and care should be taken. In particular a return value of 0 can be returned if an operation diff --git a/man/BIO_f_base64.3 b/man/BIO_f_base64.3 index a3bf74c4..291cabc5 100644 --- a/man/BIO_f_base64.3 +++ b/man/BIO_f_base64.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_f_base64.3,v 1.7 2017/01/06 03:45:57 schwarze Exp $ +.\" $OpenBSD: BIO_f_base64.3,v 1.10 2018/05/02 16:04:35 schwarze Exp $ .\" OpenSSL fc1d88f0 Wed Jul 2 22:42:40 2014 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: May 2 2018 $ .Dt BIO_F_BASE64 3 .Os .Sh NAME @@ -58,7 +58,7 @@ .Sh SYNOPSIS .In openssl/bio.h .In openssl/evp.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_f_base64 .Fa void .Fc @@ -122,6 +122,10 @@ BIO_free_all(b64); .Ed .Sh SEE ALSO .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_f_base64 +first appeared in SSLeay 0.6.5 and has been available since +.Ox 2.4 . .Sh BUGS The ambiguity of EOF in base64-encoded data can cause additional data following the base64-encoded block to be misinterpreted. diff --git a/man/BIO_f_buffer.3 b/man/BIO_f_buffer.3 index a51aafd8..21a6e9a5 100644 --- a/man/BIO_f_buffer.3 +++ b/man/BIO_f_buffer.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_f_buffer.3,v 1.6 2016/12/06 12:24:33 schwarze Exp $ +.\" $OpenBSD: BIO_f_buffer.3,v 1.10 2018/05/01 17:05:05 schwarze Exp $ .\" OpenSSL 9b86974e Mar 19 12:32:14 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: May 1 2018 $ .Dt BIO_F_BUFFER 3 .Os .Sh NAME @@ -62,7 +62,7 @@ .Nd buffering BIO .Sh SYNOPSIS .In openssl/bio.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_f_buffer .Fa void .Fc @@ -180,3 +180,18 @@ returns 1 if the data was set correctly or 0 if there was an error. .Xr BIO_new 3 , .Xr BIO_pop 3 , .Xr BIO_reset 3 +.Sh HISTORY +.Fn BIO_f_buffer +first appeared in SSLeay 0.6.0. +.Fn BIO_get_buffer_num_lines +and +.Fn BIO_set_buffer_size +first appeared in SSLeay 0.6.5. +.Fn BIO_set_read_buffer_size +and +.Fn BIO_set_write_buffer_size +first appeared in SSLeay 0.8.0. +.Fn BIO_set_buffer_read_data +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/BIO_f_cipher.3 b/man/BIO_f_cipher.3 index c2f39728..ccd37468 100644 --- a/man/BIO_f_cipher.3 +++ b/man/BIO_f_cipher.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_f_cipher.3,v 1.6 2016/12/06 14:45:08 schwarze Exp $ +.\" $OpenBSD: BIO_f_cipher.3,v 1.11 2018/08/24 19:32:26 tb Exp $ .\" OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: August 24 2018 $ .Dt BIO_F_CIPHER 3 .Os .Sh NAME @@ -61,11 +61,11 @@ .Sh SYNOPSIS .In openssl/bio.h .In openssl/evp.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_f_cipher .Fa void .Fc -.Ft void +.Ft int .Fo BIO_set_cipher .Fa "BIO *b" .Fa "const EVP_CIPHER *cipher" @@ -154,6 +154,8 @@ by preceding the cipher BIO with a buffering BIO. .Sh RETURN VALUES .Fn BIO_f_cipher returns the cipher BIO method. +.Fn BIO_set_cipher +returns 1 on success and 0 on error. .Pp .Fn BIO_get_cipher_status returns 1 for a successful decrypt and 0 for failure. @@ -162,3 +164,14 @@ returns 1 for a successful decrypt and 0 for failure. currently always returns 1. .Sh SEE ALSO .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_f_cipher , +.Fn BIO_set_cipher , +and +.Fn BIO_get_cipher_status +first appeared in SSLeay 0.6.5 and have been available since +.Ox 2.4 . +.Pp +.Fn BIO_get_cipher_ctx +first appeared in SSLeay 0.9.1 and has been available since +.Ox 2.6 . diff --git a/man/BIO_f_md.3 b/man/BIO_f_md.3 index e5223818..792d64ab 100644 --- a/man/BIO_f_md.3 +++ b/man/BIO_f_md.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_f_md.3,v 1.7 2017/01/07 08:46:13 jmc Exp $ +.\" $OpenBSD: BIO_f_md.3,v 1.10 2018/05/02 16:04:35 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 7 2017 $ +.Dd $Mdocdate: May 2 2018 $ .Dt BIO_F_MD 3 .Os .Sh NAME @@ -61,7 +61,7 @@ .Sh SYNOPSIS .In openssl/bio.h .In openssl/evp.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_f_md .Fa void .Fc @@ -246,6 +246,16 @@ BIO_free_all(bio); .Sh SEE ALSO .Xr BIO_new 3 .Sh HISTORY +.Fn BIO_f_md , +.Fn BIO_set_md , +and +.Fn BIO_get_md +first appeared in SSLeay 0.6.0. +.Fn BIO_get_md_ctx +first appeared in SSLeay 0.8.1. +These functions have been available since +.Ox 2.4 . +.Pp Before OpenSSL 1.0.0, the call to .Fn BIO_get_md_ctx would only work if the diff --git a/man/BIO_f_null.3 b/man/BIO_f_null.3 index f66e2acc..755f37da 100644 --- a/man/BIO_f_null.3 +++ b/man/BIO_f_null.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_f_null.3,v 1.6 2016/12/06 14:45:08 schwarze Exp $ +.\" $OpenBSD: BIO_f_null.3,v 1.9 2018/05/01 17:05:05 schwarze Exp $ .\" OpenSSL e117a890 Sep 14 12:14:41 2000 +0000 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: May 1 2018 $ .Dt BIO_F_NULL 3 .Os .Sh NAME @@ -56,7 +56,7 @@ .Nd null filter .Sh SYNOPSIS .In openssl/bio.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_f_null .Fa void .Fc @@ -74,3 +74,7 @@ behaves just as though the BIO was not there. returns the null filter BIO method. .Sh SEE ALSO .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_f_null +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . diff --git a/man/BIO_f_ssl.3 b/man/BIO_f_ssl.3 index 5404b9c7..ef579c73 100644 --- a/man/BIO_f_ssl.3 +++ b/man/BIO_f_ssl.3 @@ -1,6 +1,6 @@ -.\" $OpenBSD: BIO_f_ssl.3,v 1.5 2017/08/20 17:35:18 schwarze Exp $ -.\" OpenSSL BIO_f_ssl.pod e90fc053 Jul 15 09:39:45 2017 -0400 -.\" OpenSSL BIO_f_ssl.pod f672aee4 Feb 9 11:52:40 2016 -0500 +.\" $OpenBSD: BIO_f_ssl.3,v 1.10 2018/05/01 16:45:38 schwarze Exp $ +.\" full merge up to: OpenSSL f672aee4 Feb 9 11:52:40 2016 -0500 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2000, 2003, 2009, 2014-2016 The OpenSSL Project. @@ -50,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: May 1 2018 $ .Dt BIO_F_SSL 3 .Os .Sh NAME @@ -71,7 +71,7 @@ .Sh SYNOPSIS .In openssl/bio.h .In openssl/ssl.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fn BIO_f_ssl void .Ft long .Fo BIO_set_ssl @@ -353,8 +353,37 @@ and .Fn BIO_do_handshake are implemented as macros. .Sh RETURN VALUES -.\" XXX -This section is incomplete. +.Fn BIO_f_ssl +returns a pointer to a static +.Vt BIO_METHOD +structure. +.Pp +.Fn BIO_set_ssl , +.Fn BIO_get_ssl , +.Fn BIO_set_ssl_mode , +.Fn BIO_set_ssl_renegotiate_bytes , +.Fn BIO_set_ssl_renegotiate_timeout , +and +.Fn BIO_get_num_renegotiates +return 1 on success or a value less than or equal to 0 +if an error occurred. +.Pp +.Fn BIO_new_ssl , +.Fn BIO_new_ssl_connect , +and +.Fn BIO_new_buffer_ssl_connect +returns a pointer to a newly allocated +.Vt BIO +chain or +.Dv NULL +if an error occurred. +.Pp +.Fn BIO_ssl_copy_session_id +returns 1 on success or 0 on error. +.Pp +.Fn BIO_do_handshake +returns 1 if the connection was established successfully +or a value less than or equal to 0 otherwise. .Sh EXAMPLES This SSL/TLS client example attempts to retrieve a page from an SSL/TLS web server. @@ -537,6 +566,30 @@ BIO_flush(sbio); BIO_free_all(sbio); .Ed .Sh HISTORY +.Fn BIO_f_ssl , +.Fn BIO_set_ssl , +and +.Fn BIO_get_ssl +first appeared in SSLeay 0.6.0. +.Fn BIO_set_ssl_mode , +.Fn BIO_new_ssl , +and +.Fn BIO_ssl_copy_session_id +first appeared in SSLeay 0.8.0. +.Fn BIO_ssl_shutdown +and +.Fn BIO_do_handshake +first appeared in SSLeay 0.8.1. +.Fn BIO_set_ssl_renegotiate_bytes , +.Fn BIO_get_num_renegotiates , +.Fn BIO_set_ssl_renegotiate_timeout , +.Fn BIO_new_ssl_connect , +and +.Fn BIO_new_buffer_ssl_connect +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp In OpenSSL versions before 1.0.0 the .Xr BIO_pop 3 call was handled incorrectly: diff --git a/man/BIO_find_type.3 b/man/BIO_find_type.3 index ba1abc6b..99e93167 100644 --- a/man/BIO_find_type.3 +++ b/man/BIO_find_type.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_find_type.3,v 1.6 2016/12/06 14:45:08 schwarze Exp $ +.\" $OpenBSD: BIO_find_type.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BIO_FIND_TYPE 3 .Os .Sh NAME @@ -155,6 +155,17 @@ do { .Ed .Sh SEE ALSO .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_method_type +first appeared in SSLeay 0.6.0. +.Fn BIO_find_type +first appeared in SSLeay 0.6.6. +Both functions have been available since +.Ox 2.4 . +.Pp +.Fn BIO_next +first appeared in OpenSSL 0.9.6 and has been available since +.Ox 2.9 . .Sh BUGS .Fn BIO_find_type in OpenSSL 0.9.5a and earlier could not be safely passed a diff --git a/man/BIO_get_data.3 b/man/BIO_get_data.3 new file mode 100644 index 00000000..70944255 --- /dev/null +++ b/man/BIO_get_data.3 @@ -0,0 +1,176 @@ +.\" $OpenBSD: BIO_get_data.3,v 1.3 2018/03/23 23:18:17 schwarze Exp $ +.\" selective merge up to: OpenSSL e90fc053 Jul 15 09:39:45 2017 -0400 +.\" +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Matt Caswell . +.\" Copyright (c) 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. +.\" +.Dd $Mdocdate: March 23 2018 $ +.Dt BIO_GET_DATA 3 +.Os +.Sh NAME +.Nm BIO_set_data , +.Nm BIO_get_data , +.Nm BIO_set_init , +.Nm BIO_set_shutdown , +.Nm BIO_get_shutdown +.Nd manage BIO state information +.Sh SYNOPSIS +.In openssl/bio.h +.Ft void +.Fo BIO_set_data +.Fa "BIO *a" +.Fa "void *ptr" +.Fc +.Ft void * +.Fo BIO_get_data +.Fa "BIO *a" +.Fc +.Ft void +.Fo BIO_set_init +.Fa "BIO *a" +.Fa "int init" +.Fc +.Ft void +.Fo BIO_set_shutdown +.Fa "BIO *a" +.Fa "int shutdown" +.Fc +.Ft int +.Fo BIO_get_shutdown +.Fa "BIO *a" +.Fc +.Sh DESCRIPTION +These functions are mainly useful when implementing a custom BIO. +.Pp +The +.Fn BIO_set_data +function associates the custom data pointed to by +.Fa ptr +with the +.Fa "BIO a" . +This data can subsequently be retrieved via a call to +.Fn BIO_get_data . +This can be used by custom BIOs for storing implementation specific +information. +.Pp +The +.Fn BIO_set_init +function sets the +.Fa init +flag in +.Fa a +to the specified value. +A non-zero value indicates that initialisation is complete, +whilst zero indicates that it is not. +Often initialisation will complete +during initial construction of the BIO. +For some BIOs however, initialisation may not be complete until +additional steps have been taken, for example through calling custom +ctrls. +.Pp +The +.Fn BIO_set_shutdown +and +.Fn BIO_get_shutdown +functions are low-level interfaces to forcefully set and get the +.Fa shutdown +flag of +.Fa a , +circumventing type-dependent sanity checks, +exclusively intended for implementing a new BIO type. +The +.Fa shutdown +argument must be either +.Dv BIO_CLOSE +or +.Dv BIO_NOCLOSE . +When merely using a +.Vt BIO +object, call +.Xr BIO_set_close 3 +and +.Xr BIO_get_close 3 +instead. +.Sh RETURN VALUES +.Fn BIO_get_data +returns a pointer to the implementation specific custom data associated +with +.Fa a , +or +.Dv NULL +if none is set. +.Pp +.Fn BIO_get_shutdown +returns the value previously set with +.Fn BIO_set_shutdown +or with +.Xr BIO_set_close 3 . +.Sh SEE ALSO +.Xr BIO_meth_new 3 , +.Xr BIO_new 3 , +.Xr BIO_set_close 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0 +and have been available since +.Ox 6.3 . diff --git a/man/BIO_get_ex_new_index.3 b/man/BIO_get_ex_new_index.3 index b4b9fa08..bf16e1c7 100644 --- a/man/BIO_get_ex_new_index.3 +++ b/man/BIO_get_ex_new_index.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: BIO_get_ex_new_index.3,v 1.3 2017/01/06 20:35:23 schwarze Exp $ -.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" $OpenBSD: BIO_get_ex_new_index.3,v 1.9 2018/04/18 03:39:22 schwarze Exp $ +.\" full merge up to: OpenSSL a970b14f Jul 31 18:58:40 2017 -0400 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file was written by Rich Salz . .\" Copyright (c) 2015, 2016 The OpenSSL Project. All rights reserved. @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: April 18 2018 $ .Dt BIO_GET_EX_NEW_INDEX 3 .Os .Sh NAME @@ -119,6 +120,51 @@ is a function that calls with an offset into the opaque exdata part of the .Vt TYPE object. +.Sh RETURN VALUES +.Fn TYPE_get_new_ex_index +returns a new index on success or \-1 on error. +.Pp +.Fn TYPE_set_ex_data +returns 1 on success or 0 on error. +.Pp +.Fn TYPE_get_ex_data +returns the application data or +.Dv NULL +if an error occurred. .Sh SEE ALSO .Xr CRYPTO_get_ex_new_index 3 , .Xr RSA_get_ex_new_index 3 +.Sh HISTORY +.Fn BIO_get_ex_new_index , +.Fn BIO_set_ex_data , +and +.Fn BIO_get_ex_data +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . +.Pp +.Fn X509_get_ex_new_index , +.Fn X509_set_ex_data , +and +.Fn X509_get_ex_data +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn ENGINE_get_ex_new_index , +.Fn ENGINE_set_ex_data , +.Fn ENGINE_get_ex_data , +.Fn UI_get_ex_new_index , +.Fn UI_set_ex_data , +and +.Fn UI_get_ex_data +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn ECDH_get_ex_new_index , +.Fn ECDH_set_ex_data , +.Fn ECDH_get_ex_data , +.Fn ECDSA_get_ex_new_index , +.Fn ECDSA_set_ex_data , +and +.Fn ECDSA_get_ex_data +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/BIO_meth_new.3 b/man/BIO_meth_new.3 new file mode 100644 index 00000000..21595605 --- /dev/null +++ b/man/BIO_meth_new.3 @@ -0,0 +1,367 @@ +.\" $OpenBSD: BIO_meth_new.3,v 1.5 2018/07/09 09:52:18 tb Exp $ +.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 +.\" +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Matt Caswell +.\" Copyright (c) 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. +.\" +.Dd $Mdocdate: July 9 2018 $ +.Dt BIO_METH_NEW 3 +.Os +.Sh NAME +.Nm BIO_get_new_index , +.Nm BIO_meth_new , +.Nm BIO_meth_free , +.Nm BIO_meth_get_write , +.Nm BIO_meth_set_write , +.Nm BIO_meth_get_read , +.Nm BIO_meth_set_read , +.Nm BIO_meth_get_puts , +.Nm BIO_meth_set_puts , +.Nm BIO_meth_get_gets , +.Nm BIO_meth_set_gets , +.Nm BIO_meth_get_ctrl , +.Nm BIO_meth_set_ctrl , +.Nm BIO_meth_get_create , +.Nm BIO_meth_set_create , +.Nm BIO_meth_get_destroy , +.Nm BIO_meth_set_destroy , +.Nm BIO_meth_get_callback_ctrl , +.Nm BIO_meth_set_callback_ctrl +.Nd manipulate BIO_METHOD structures +.Sh SYNOPSIS +.In openssl/bio.h +.Ft int +.Fn BIO_get_new_index void +.Ft BIO_METHOD * +.Fo BIO_meth_new +.Fa "int type" +.Fa "const char *name" +.Fc +.Ft void +.Fo BIO_meth_free +.Fa "BIO_METHOD *biom" +.Fc +.Ft int +.Fn "(*BIO_meth_get_write(const BIO_METHOD *biom))" "BIO *" "const char *" int +.Ft int +.Fo BIO_meth_set_write +.Fa "BIO_METHOD *biom" +.Fa "int (*write)(BIO *, const char *, int)" +.Fc +.Ft int +.Fn "(*BIO_meth_get_read(const BIO_METHOD *biom))" "BIO *" "char *" int +.Ft int +.Fo BIO_meth_set_read +.Fa "BIO_METHOD *biom" +.Fa "int (*read)(BIO *, char *, int)" +.Fc +.Ft int +.Fn "(*BIO_meth_get_puts(const BIO_METHOD *biom))" "BIO *" "const char *" +.Ft int +.Fo BIO_meth_set_puts +.Fa "BIO_METHOD *biom" +.Fa "int (*puts)(BIO *, const char *)" +.Fc +.Ft int +.Fn "(*BIO_meth_get_gets(const BIO_METHOD *biom))" "BIO *" "char *" int +.Ft int +.Fo BIO_meth_set_gets +.Fa "BIO_METHOD *biom" +.Fa "int (*gets)(BIO *, char *, int)" +.Fc +.Ft long +.Fn "(*BIO_meth_get_ctrl(const BIO_METHOD *biom))" "BIO *" int long "void *" +.Ft int +.Fo BIO_meth_set_ctrl +.Fa "BIO_METHOD *biom" +.Fa "long (*ctrl)(BIO *, int, long, void *)" +.Fc +.Ft int +.Fn "(*BIO_meth_get_create(const BIO_METHOD *biom))" "BIO *" +.Ft int +.Fo BIO_meth_set_create +.Fa "BIO_METHOD *biom" +.Fa "int (*create)(BIO *)" +.Fc +.Ft int +.Fn "(*BIO_meth_get_destroy(const BIO_METHOD *biom))" "BIO *" +.Ft int +.Fo BIO_meth_set_destroy +.Fa "BIO_METHOD *biom" +.Fa "int (*destroy)(BIO *)" +.Fc +.Ft long +.Fo "(*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))" +.Fa "BIO *" +.Fa int +.Fa "BIO_info_cb *" +.Fc +.Ft int +.Fo BIO_meth_set_callback_ctrl +.Fa "BIO_METHOD *biom" +.Fa "long (*callback_ctrl)(BIO *, int, BIO_info_cb *)" +.Fc +.Sh DESCRIPTION +The +.Vt BIO_METHOD +structure stores function pointers implementing a +.Vt BIO +type. +See +.Xr BIO_new 3 +for more information about +.Vt BIO +objects. +.Pp +.Fn BIO_meth_new +creates a new +.Vt BIO_METHOD +structure. +It requires a unique integer +.Fa type ; +use +.Fn BIO_get_new_index +to get the value for +.Fa type . +Currently, the user can only create up to 127 different BIO types, and +.Fa type +is limited to the range 129\(en255. +The +.Fa name +pointer is stored in the structure and will not be freed by +.Fn BIO_meth_free . +.Pp +The standard BIO types are listed in +.In openssl/bio.h . +Some examples include +.Dv BIO_TYPE_BUFFER +and +.Dv BIO_TYPE_CIPHER . +The +.Fa type +of filter BIOs should have the +.Dv BIO_TYPE_FILTER +bit set. +Source/sink BIOs should have the +.Dv BIO_TYPE_SOURCE_SINK +bit set. +File descriptor based BIOs (e.g. socket, fd, connect, accept etc.\&) +should additionally have the +.Dv BIO_TYPE_DESCRIPTOR +bit set. +See +.Xr BIO_find_type 3 +for more information. +.Pp +.Fn BIO_meth_free +is an alias for +.Xr free 3 . +.Pp +.Fn BIO_meth_get_write , +.Fn BIO_meth_set_write , +.Fn BIO_meth_get_read , +and +.Fn BIO_meth_set_read +get and set the functions +.Fa write +and +.Fa read +used for writing and reading arbitrary length data to and from the +.Vt BIO . +These functions are called from +.Xr BIO_write 3 +and +.Xr BIO_read 3 , +respectively. +The parameters and return values of +.Fa write +and +.Fa read +have the same meaning as for +.Xr BIO_write 3 +and +.Xr BIO_read 3 . +.Pp +.Fn BIO_meth_get_puts +and +.Fn BIO_meth_set_puts +get and set the function +.Fa puts +used for writing a NUL-terminated string to the +.Vt BIO . +This function is called from +.Xr BIO_puts 3 . +The parameters and the return value of +.Fa puts +have the same meaning as for +.Xr BIO_puts 3 . +.Pp +.Fn BIO_meth_get_gets +and +.Fn BIO_meth_set_gets +get and set the function +.Fa gets +used for reading a line of data from the +.Vt BIO . +This function is called from +.Xr BIO_gets 3 . +The parameters and the return value of +.Fa gets +have the same meaning as for +.Xr BIO_gets 3 . +.Pp +.Fn BIO_meth_get_ctrl +and +.Fn BIO_meth_set_ctrl +get and set the function +.Fa ctrl +used for processing control messages in the +.Vt BIO . +This function is called from +.Xr BIO_ctrl 3 . +The parameters and return value of +.Fa ctrl +have the same meaning as for +.Xr BIO_ctrl 3 . +.Pp +.Fn BIO_meth_get_create +and +.Fn BIO_meth_set_create +get and set a function +.Fa create +used while initializing a new instance of the +.Vt BIO . +This function is called from +.Xr BIO_new 3 . +The +.Xr BIO_new 3 +function allocates the memory for the new +.Vt BIO , +and a pointer to this newly allocated structure is passed +as the parameter to +.Fa create . +.Pp +.Fn BIO_meth_get_destroy +and +.Fn BIO_meth_set_destroy +get and set a function +.Fa destroy +used while destroying an instance of a +.Vt BIO . +This function is called from +.Xr BIO_free 3 . +A pointer to the +.Vt BIO +to be destroyed is passed as the parameter. +The +.Fa destroy +function is intended to perform clean-up specific to the +.Vt BIO +.Fa type . +The memory for the +.Vt BIO +itself must not be freed by this function. +.Pp +.Fn BIO_meth_get_callback_ctrl +and +.Fn BIO_meth_set_callback_ctrl +get and set the function +.Fa callback_ctrl +used for processing callback control messages in the +.Vt BIO . +This function is called from +.Xr BIO_callback_ctrl 3 . +The parameters and return value of +.Fa callback_ctrl +have the same meaning as for +.Xr BIO_callback_ctrl 3 . +.Sh RETURN VALUES +.Fn BIO_get_new_index +returns the new BIO type value or \-1 if an error occurs. +.Pp +.Fn BIO_meth_new +returns the new +.Vt BIO_METHOD +structure or +.Dv NULL +if an error occurs. +.Pp +The +.Fn BIO_meth_set_* +functions return 1 on success or 0 on error. +Currently, they cannot fail. +.Pp +The +.Fn BIO_meth_get_* +functions return function pointers. +.Sh SEE ALSO +.Xr BIO_ctrl 3 , +.Xr BIO_find_type 3 , +.Xr BIO_new 3 , +.Xr BIO_read 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0 +and have been available since +.Ox 6.3 . diff --git a/man/BIO_new.3 b/man/BIO_new.3 index 356986d7..2f8cf37e 100644 --- a/man/BIO_new.3 +++ b/man/BIO_new.3 @@ -1,6 +1,9 @@ -.\" $OpenBSD: BIO_new.3,v 1.8 2017/03/25 17:15:59 schwarze Exp $ -.\" OpenSSL doc/man3/BIO_new.pod ca3a82c3 Mar 25 11:31:18 2015 -0400 -.\" OpenSSL doc/man7/bio.pod a9c85cea Nov 11 09:33:55 2016 +0100 +.\" $OpenBSD: BIO_new.3,v 1.16 2018/05/01 17:05:05 schwarze Exp $ +.\" full merge up to: +.\" OpenSSL man3/BIO_new.pod fb46be03 Feb 26 11:51:31 2016 +0000 +.\" OpenSSL man7/bio.pod 631c37be Dec 12 16:56:50 2017 +0100 +.\" partial merge up to: +.\" OpenSSL man3/BIO_new.pod e9b77246 Jan 20 19:58:49 2017 +0100 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2000, 2015, 2016 The OpenSSL Project. All rights reserved. @@ -49,11 +52,12 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 25 2017 $ +.Dd $Mdocdate: May 1 2018 $ .Dt BIO_NEW 3 .Os .Sh NAME .Nm BIO_new , +.Nm BIO_up_ref , .Nm BIO_set , .Nm BIO_free , .Nm BIO_vfree , @@ -63,12 +67,16 @@ .In openssl/bio.h .Ft BIO * .Fo BIO_new -.Fa "BIO_METHOD *type" +.Fa "const BIO_METHOD *type" +.Fc +.Ft int +.Fo BIO_up_ref +.Fa "BIO *a" .Fc .Ft int .Fo BIO_set .Fa "BIO *a" -.Fa "BIO_METHOD *type" +.Fa "const BIO_METHOD *type" .Fc .Ft int .Fo BIO_free @@ -95,7 +103,8 @@ The function constructs a new .Vt BIO using the method -.Fa type . +.Fa type +and sets its reference count to 1. There are two groups of BIO types, source/sink BIOs and filter BIOs. .Pp Source/sink BIOs provide input or consume output. @@ -106,8 +115,8 @@ or to the application, forming a chain of BIOs. The data may be left unmodified (for example by a message digest BIO) or translated (for example by an encryption BIO). The effect of a filter BIO may change according to the I/O operation -it is performing: for example an encryption BIO will encrypt data -if it is written to and decrypt data if it is read from. +it is performing: for example an encryption BIO encrypts data +if it is written to and decrypts data if it is read from. .Pp Some BIOs (such as memory BIOs) can be used immediately after calling .Fn BIO_new . @@ -124,13 +133,33 @@ the methods for source/sink BIOs are called and those for filter BIOs .Fn BIO_f_* . .Pp +.Fn BIO_up_ref +increments the reference count of +.Fa a +by 1. +.Pp .Fn BIO_set -sets the method of an already existing BIO. +is a deprecated function to initialize an unused +.Vt BIO +structure located in static memory or on the stack, +to set its method to +.Fa type , +and to set its reference count to 1. +It must not be called on +.Vt BIO +objects created with +.Fn BIO_new , +nor on objects that were already used. .Pp .Fn BIO_free and .Fn BIO_vfree -destruct a single BIO, which may also have some effect on the +decrement the reference count of +.Fa a +by 1, and if the refenece count reaches 0, they destruct the single +.Vt BIO +.Fa a , +which may also have some effect on the underlying I/O structure, for example it may close the file being referred to under certain circumstances. If @@ -140,11 +169,26 @@ is a pointer, no action occurs. If .Fn BIO_free -is called on a BIO chain, it will only destruct one BIO, +is called on a BIO chain, it destructs at most one BIO, resulting in a memory leak. .Pp .Fn BIO_free_all -destructs an entire BIO chain. +calls +.Fn BIO_free +on +.Fa a +and on all following +.Vt BIO +objects in the chain. +As soon as the reference count of a +.Vt BIO +is still non-zero after calling +.Fn BIO_free +on it, the function +.Fn BIO_free_all +returns right away and refrains from freeing the remaining +.Vt BIO +objects in the chain. It does not halt if an error occurs destructing an individual BIO in the chain. If @@ -174,7 +218,8 @@ object or .Dv NULL on failure. .Pp -.Fn BIO_set +.Fn BIO_up_ref , +.Fn BIO_set , and .Fn BIO_free return 1 for success or 0 for failure. @@ -192,6 +237,7 @@ Create a memory BIO: .Xr BIO_f_ssl 3 , .Xr BIO_find_type 3 , .Xr BIO_get_ex_new_index 3 , +.Xr BIO_meth_new 3 , .Xr BIO_printf 3 , .Xr BIO_push 3 , .Xr BIO_read 3 , @@ -205,3 +251,21 @@ Create a memory BIO: .Xr BIO_s_socket 3 , .Xr BIO_set_callback 3 , .Xr BIO_should_retry 3 +.Sh HISTORY +.Fn BIO_new , +.Fn BIO_set , +and +.Fn BIO_free +first appeared in SSLeay 0.6.0. +.Fn BIO_free_all +first appeared in SSLeay 0.6.6. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn BIO_vfree +first appeared in OpenSSL 0.9.6 and has been available since +.Ox 2.9 . +.Pp +.Fn BIO_up_ref +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/BIO_printf.3 b/man/BIO_printf.3 index ebc1cc72..838b771b 100644 --- a/man/BIO_printf.3 +++ b/man/BIO_printf.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_printf.3,v 1.1 2017/03/25 17:15:59 schwarze Exp $ +.\" $OpenBSD: BIO_printf.3,v 1.3 2018/03/22 17:11:04 schwarze Exp $ .\" OpenSSL 2ca2e917 Mon Mar 20 16:25:22 2017 -0400 .\" .\" Copyright (c) 2017 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 25 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt BIO_PRINTF 3 .Os .Sh NAME @@ -84,3 +84,14 @@ also return -1 if is too small to hold the complete output. .Sh SEE ALSO .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_printf +first appeared in SSLeay 0.6.5 and has been available since +.Ox 2.4 . +.Pp +.Fn BIO_vprintf , +.Fn BIO_snprintf , +and +.Fn BIO_vsnprintf +first appeared in OpenSSL 0.9.6 and have been available since +.Ox 2.9 . diff --git a/man/BIO_push.3 b/man/BIO_push.3 index 5b9e9412..768f4d85 100644 --- a/man/BIO_push.3 +++ b/man/BIO_push.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_push.3,v 1.5 2016/12/06 12:54:19 schwarze Exp $ +.\" $OpenBSD: BIO_push.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL doc/man3/BIO_push.pod 76ed5a42 Jun 29 13:38:55 2014 +0100 .\" OpenSSL doc/man7/bio.pod a9c85cea Nov 11 09:33:55 2016 +0100 .\" @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BIO_PUSH 3 .Os .Sh NAME @@ -176,3 +176,10 @@ as before. .Xr BIO_find_type 3 , .Xr BIO_new 3 , .Xr BIO_read 3 +.Sh HISTORY +.Fn BIO_push +first appeared in SSLeay 0.6.0. +.Fn BIO_pop +first appeared in SSLeay 0.6.4. +Both functions have been available since +.Ox 2.4 . diff --git a/man/BIO_read.3 b/man/BIO_read.3 index 2da37282..97514a61 100644 --- a/man/BIO_read.3 +++ b/man/BIO_read.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_read.3,v 1.5 2016/12/06 14:45:08 schwarze Exp $ +.\" $OpenBSD: BIO_read.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BIO_READ 3 .Os .Sh NAME @@ -165,5 +165,14 @@ In particular when the source/sink is non-blocking or of a certain type it may merely be an indication that no data is currently available and that the application should retry the operation later. .Sh SEE ALSO +.Xr BIO_meth_new 3 , .Xr BIO_new 3 , .Xr BIO_should_retry 3 +.Sh HISTORY +.Fn BIO_read , +.Fn BIO_gets , +.Fn BIO_write , +and +.Fn BIO_puts +first appeared in SSLeay 0.6.0 and have been available since +.Ox 2.4 . diff --git a/man/BIO_s_accept.3 b/man/BIO_s_accept.3 index e3193f6f..4ead28b6 100644 --- a/man/BIO_s_accept.3 +++ b/man/BIO_s_accept.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_s_accept.3,v 1.5 2016/12/06 14:45:08 schwarze Exp $ +.\" $OpenBSD: BIO_s_accept.3,v 1.11 2018/05/12 20:12:17 schwarze Exp $ .\" OpenSSL c03726ca Thu Aug 27 12:28:08 2015 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: May 12 2018 $ .Dt BIO_S_ACCEPT 3 .Os .Sh NAME @@ -64,7 +64,7 @@ .Nd accept BIO .Sh SYNOPSIS .In openssl/bio.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_s_accept .Fa void .Fc @@ -79,7 +79,7 @@ .Fc .Ft BIO * .Fo BIO_new_accept -.Fa "char *host_port" +.Fa "const char *host_port" .Fc .Ft long .Fo BIO_set_nbio_accept @@ -354,3 +354,23 @@ BIO_free(cbio2); .Ed .Sh SEE ALSO .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_s_accept , +.Fn BIO_set_accept_port , +.Fn BIO_new_accept , +.Fn BIO_set_accept_bios , +and +.Fn BIO_do_accept +first appeared in SSLeay 0.8.0. +.Fn BIO_set_nbio_accept +and +.Fn BIO_get_accept_port +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn BIO_set_bind_mode +and +.Fn BIO_get_bind_mode +first appeared in SSLeay 0.9.1 and have been available since +.Ox 2.6 . diff --git a/man/BIO_s_bio.3 b/man/BIO_s_bio.3 index 065a8bae..171207df 100644 --- a/man/BIO_s_bio.3 +++ b/man/BIO_s_bio.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_s_bio.3,v 1.9 2017/01/06 02:29:18 schwarze Exp $ +.\" $OpenBSD: BIO_s_bio.3,v 1.13 2018/05/01 17:05:05 schwarze Exp $ .\" OpenSSL c03726ca Aug 27 12:28:08 2015 -0400 .\" .\" This file was written by @@ -53,7 +53,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: May 1 2018 $ .Dt BIO_S_BIO 3 .Os .Sh NAME @@ -72,7 +72,7 @@ .Nd BIO pair BIO .Sh SYNOPSIS .In openssl/bio.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_s_bio .Fa void .Fc @@ -360,6 +360,28 @@ SSL operations can successfully be continued. .Xr BIO_should_retry 3 , .Xr ssl 3 , .Xr SSL_set_bio 3 +.Sh HISTORY +.Fn BIO_s_bio , +.Fn BIO_make_bio_pair , +.Fn BIO_destroy_bio_pair , +.Fn BIO_set_write_buf_size , +.Fn BIO_get_write_buf_size , +.Fn BIO_new_bio_pair , +.Fn BIO_get_write_guarantee , +.Fn BIO_ctrl_get_write_guarantee , +.Fn BIO_get_read_request , +and +.Fn BIO_ctrl_reset_read_request +first appeared in OpenSSL 0.9.4 and have been available since +.Ox 2.6 . +.Pp +.Fn BIO_ctrl_reset_read_request +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . +.Pp +.Fn BIO_shutdown_wr +first appeared in OpenSSL 0.9.6 and has been available since +.Ox 2.9 . .Sh CAVEATS As the data is buffered, SSL operations may return with an .Dv ERROR_SSL_WANT_READ diff --git a/man/BIO_s_connect.3 b/man/BIO_s_connect.3 index bde10e4b..7ddde85f 100644 --- a/man/BIO_s_connect.3 +++ b/man/BIO_s_connect.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_s_connect.3,v 1.6 2016/12/20 23:14:37 beck Exp $ +.\" $OpenBSD: BIO_s_connect.3,v 1.11 2018/05/12 20:12:17 schwarze Exp $ .\" OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 20 2016 $ +.Dd $Mdocdate: May 12 2018 $ .Dt BIO_S_CONNECT 3 .Os .Sh NAME @@ -67,13 +67,13 @@ .Nd connect BIO .Sh SYNOPSIS .In openssl/bio.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_s_connect .Fa void .Fc .Ft BIO * .Fo BIO_new_connect -.Fa "char *name" +.Fa "const char *name" .Fc .Ft long .Fo BIO_set_conn_hostname @@ -369,3 +369,22 @@ BIO_free(out); .Ed .Sh SEE ALSO .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_s_connect , +.Fn BIO_new_connect , +.Fn BIO_set_nbio , +and +.Fn BIO_do_connect +first appeared in SSLeay 0.8.0. +.Fn BIO_set_conn_hostname , +.Fn BIO_set_conn_port , +.Fn BIO_set_conn_ip , +.Fn BIO_set_conn_int_port , +.Fn BIO_get_conn_hostname , +.Fn BIO_get_conn_port , +.Fn BIO_get_conn_ip , +and +.Fn BIO_get_conn_int_port +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/BIO_s_fd.3 b/man/BIO_s_fd.3 index 20b460ba..5ac33e77 100644 --- a/man/BIO_s_fd.3 +++ b/man/BIO_s_fd.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_s_fd.3,v 1.6 2016/12/06 14:45:08 schwarze Exp $ +.\" $OpenBSD: BIO_s_fd.3,v 1.9 2018/05/01 17:05:05 schwarze Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: May 1 2018 $ .Dt BIO_S_FD 3 .Os .Sh NAME @@ -59,7 +59,7 @@ .Nd file descriptor BIO .Sh SYNOPSIS .In openssl/bio.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_s_fd .Fa "void" .Fc @@ -194,3 +194,13 @@ BIO_free(out); .Xr BIO_read 3 , .Xr BIO_s_socket 3 , .Xr BIO_seek 3 +.Sh HISTORY +.Fn BIO_s_fd , +.Fn BIO_set_fd , +and +.Fn BIO_get_fd +first appeared in SSLeay 0.6.0. +.Fn BIO_new_fd +first appeared in SSLeay 0.8.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/BIO_s_file.3 b/man/BIO_s_file.3 index 323763d8..3b256dbc 100644 --- a/man/BIO_s_file.3 +++ b/man/BIO_s_file.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: BIO_s_file.3,v 1.5 2016/12/06 14:45:08 schwarze Exp $ -.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" $OpenBSD: BIO_s_file.3,v 1.11 2018/12/19 20:30:09 schwarze Exp $ +.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" selective merge up to: OpenSSL 1212818e Sep 11 13:22:14 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2000, 2010 The OpenSSL Project. All rights reserved. @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: December 19 2018 $ .Dt BIO_S_FILE 3 .Os .Sh NAME @@ -64,7 +65,7 @@ .Nd FILE BIO .Sh SYNOPSIS .In openssl/bio.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_s_file .Fa void .Fc @@ -172,7 +173,7 @@ Flags can be: this only has any effect under Win32). .Pp .Fn BIO_set_fp -set the file pointer of a file BIO to +sets the file pointer of a file BIO to .Fa fp . .Fa flags has the same meaning as in @@ -285,6 +286,25 @@ BIO_free(out); .Xr BIO_new 3 , .Xr BIO_read 3 , .Xr BIO_seek 3 +.Sh HISTORY +.Fn BIO_s_file , +.Fn BIO_set_fp , +.Fn BIO_get_fp , +.Fn BIO_read_filename , +.Fn BIO_write_filename , +and +.Fn BIO_append_filename +first appeared in SSLeay 0.6.0. +.Fn BIO_new_file +and +.Fn BIO_new_fp +first appeared in SSLeay 0.8.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn BIO_rw_filename +first appeared in SSLeay 0.9.1 and has been available since +.Ox 2.6 . .Sh BUGS .Xr BIO_reset 3 and diff --git a/man/BIO_s_mem.3 b/man/BIO_s_mem.3 index bdbedc0f..c27d38c4 100644 --- a/man/BIO_s_mem.3 +++ b/man/BIO_s_mem.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: BIO_s_mem.3,v 1.5 2016/12/06 14:45:08 schwarze Exp $ -.\" OpenSSL 8711efb4 Mon Apr 20 11:33:12 2009 +0000 +.\" $OpenBSD: BIO_s_mem.3,v 1.13 2018/05/12 20:12:17 schwarze Exp $ +.\" full merge up to: OpenSSL 8711efb4 Mon Apr 20 11:33:12 2009 +0000 +.\" selective merge up to: OpenSSL 36359cec Mar 7 14:37:23 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2000 The OpenSSL Project. All rights reserved. @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: May 12 2018 $ .Dt BIO_S_MEM 3 .Os .Sh NAME @@ -61,7 +62,7 @@ .Nd memory BIO .Sh SYNOPSIS .In openssl/bio.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_s_mem .Fa "void" .Fc @@ -88,7 +89,7 @@ .Fc .Ft BIO * .Fo BIO_new_mem_buf -.Fa "void *buf" +.Fa "const void *buf" .Fa "int len" .Fc .Sh DESCRIPTION @@ -150,7 +151,7 @@ should be set to a negative value, typically -1. .Pp .Fn BIO_get_mem_data sets -.Fa pp +.Pf * Fa pp to a pointer to the start of the memory BIO's data and returns the total amount of data available. It is implemented as a macro. @@ -173,7 +174,7 @@ is a macro. places the underlying .Vt BUF_MEM structure in -.Fa pp . +.Pf * Fa pp . It is a macro. .Pp .Fn BIO_new_mem_buf @@ -206,6 +207,23 @@ the operation can be very slow. The use of a read only memory BIO avoids this problem. If the BIO must be read/write then adding a buffering BIO to the chain will speed up the process. +.Sh RETURN VALUES +.Fn BIO_s_mem +returns a pointer to a static object. +.Pp +.Fn BIO_set_mem_eof_return , +.Fn BIO_get_mem_data , +.Fn BIO_set_mem_buf , +and +.Fn BIO_get_mem_ptr +return 1 on success or a value less than or equal to 0 if an error occurred. +.Pp +.Fn BIO_new_mem_buf +returns a newly allocated +.Vt BIO +object on success or +.Dv NULL +on error. .Sh EXAMPLES Create a memory BIO and write some data to it: .Bd -literal -offset indent @@ -232,6 +250,25 @@ BIO_free(mem); .Ed .Sh SEE ALSO .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_s_mem +first appeared in SSLeay 0.6.0. +.Fn BIO_set_mem_buf +and +.Fn BIO_get_mem_ptr +first appeared in SSLeay 0.6.5. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn BIO_set_mem_eof_return +and +.Fn BIO_get_mem_data +first appeared in SSLeay 0.9.1 and have been available since +.Ox 2.6 . +.Pp +.Fn BIO_new_mem_buf +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . .Sh BUGS There should be an option to set the maximum size of a memory BIO. .Pp diff --git a/man/BIO_s_null.3 b/man/BIO_s_null.3 index 7e68b594..c991bd73 100644 --- a/man/BIO_s_null.3 +++ b/man/BIO_s_null.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_s_null.3,v 1.5 2016/12/06 14:45:08 schwarze Exp $ +.\" $OpenBSD: BIO_s_null.3,v 1.8 2018/05/01 17:05:05 schwarze Exp $ .\" OpenSSL e117a890 Sep 14 12:14:41 2000 +0000 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: May 1 2018 $ .Dt BIO_S_NULL 3 .Os .Sh NAME @@ -56,7 +56,7 @@ .Nd null data sink .Sh SYNOPSIS .In openssl/bio.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_s_null .Fa void .Fc @@ -82,3 +82,7 @@ this can be achieved by adding a null sink BIO to the end of the chain. returns the null sink BIO method. .Sh SEE ALSO .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_s_null +first appeared in SSLeay 0.6.0 and has been available since +.Ox 2.4 . diff --git a/man/BIO_s_socket.3 b/man/BIO_s_socket.3 index 1fc7ce3d..63ab1deb 100644 --- a/man/BIO_s_socket.3 +++ b/man/BIO_s_socket.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_s_socket.3,v 1.6 2016/12/06 14:45:08 schwarze Exp $ +.\" $OpenBSD: BIO_s_socket.3,v 1.9 2018/05/01 17:05:05 schwarze Exp $ .\" OpenSSL bbdc9c98 Oct 19 22:02:21 2000 +0000 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: May 1 2018 $ .Dt BIO_S_SOCKET 3 .Os .Sh NAME @@ -57,7 +57,7 @@ .Nd socket BIO .Sh SYNOPSIS .In openssl/bio.h -.Ft BIO_METHOD * +.Ft const BIO_METHOD * .Fo BIO_s_socket .Fa void .Fc @@ -107,3 +107,10 @@ if an error occurred. .Sh SEE ALSO .Xr BIO_get_fd 3 , .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_s_socket +first appeared in SSLeay 0.6.0. +.Fn BIO_new_socket +first appeared in SSLeay 0.8.0. +Both functions have been available since +.Ox 2.4 . diff --git a/man/BIO_set_callback.3 b/man/BIO_set_callback.3 index 4209c081..34b7c07a 100644 --- a/man/BIO_set_callback.3 +++ b/man/BIO_set_callback.3 @@ -1,8 +1,26 @@ -.\" $OpenBSD: BIO_set_callback.3,v 1.5 2016/12/06 14:45:08 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: BIO_set_callback.3,v 1.9 2018/03/29 20:42:17 schwarze Exp $ +.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" -.\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2000, 2016 The OpenSSL Project. All rights reserved. +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Dr. Stephen Henson . +.\" Copyright (c) 2000, 2016, 2017 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 @@ -48,7 +66,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 29 2018 $ .Dt BIO_SET_CALLBACK 3 .Os .Sh NAME @@ -141,20 +159,37 @@ depends on the value of .Fa oper (i.e. the operation being performed). .Pp +When +.Fa oper +does not include +.Dv BIO_CB_RETURN , +i.e. when the callback is invoked before an operation, +the value passed into the callback via .Fa ret -is the return value that would be returned to the application +is always 1. +In this case, if the callback returns a negative value, the library +aborts the requested operation and instead returns the negative +return value from the callback to the application. +If the callback returns a non-negative value, that return value is +ignored by the library, and the operation is performed normally. +.Pp +When +.Fa oper +includes +.Dv BIO_CB_RETURN , +i.e. when the callback is invoked after an operation, +the value passed into the callback via +.Fa ret +is the return value that the operation would return to the application if no callback were present. -The actual value returned is the return value of the callback itself. -In the case of callbacks called before the actual BIO operation, -1 is placed in -.Fa ret . -If the return value is not positive, it will be immediately returned to -the application and the BIO operation will not be performed. +When a callback is present, the operation only passes this value +to the callback and instead of it returns the return value of the +callback to the application. .Pp The callback should normally simply return .Fa ret -when it has finished processing, unless it specifically wishes -to modify the value returned to the application. +when it has finished processing, unless it specifically wishes to +abort the operation or to modify the value returned to the application. .Ss Callback operations .Bl -tag -width Ds .It Fn BIO_free b @@ -176,9 +211,9 @@ is called before the operation and .Fn callback b BIO_CB_GETS|BIO_CB_RETURN out outl 0L ret after. .It Fn BIO_puts b in -.Fn callback b BIO_CB_WRITE in 0 0L 1L +.Fn callback b BIO_CB_PUTS in 0 0L 1L is called before the operation and -.Fn callback b BIO_CB_WRITE|BIO_CB_RETURN in 0 0L ret +.Fn callback b BIO_CB_PUTS|BIO_CB_RETURN in 0 0L ret after. .It Fn BIO_ctrl b oper larg parg .Fn callback b BIO_CB_CTRL parg oper larg 1L @@ -186,6 +221,33 @@ is called before the call and .Fn callback b BIO_CB_CTRL|BIO_CB_RETURN parg oper larg ret after. .El +.Sh RETURN VALUES +.Fn BIO_get_callback +returns a pointer to the function +.Fa cb +previously installed with +.Fn BIO_set_callback , +or +.Dv NULL +if no callback was installed. +.Pp +.Fn BIO_get_callback_arg +returns a pointer to the +.Fa arg +previously set with +.Fn BIO_set_callback_arg , +or +.Dv NULL +if no such argument was set. +.Pp +.Fn BIO_debug_callback +returns +.Fa ret +if the bit +.Dv BIO_CB_RETURN +is set in +.Fa cmd , +or 1 otherwise. .Sh EXAMPLES The .Fn BIO_debug_callback @@ -194,3 +256,14 @@ Its source is in the file .Pa crypto/bio/bio_cb.c . .Sh SEE ALSO .Xr BIO_new 3 +.Sh HISTORY +.Fn BIO_set_callback , +.Fn BIO_get_callback , +.Fn BIO_set_callback_arg , +and +.Fn BIO_debug_callback +first appeared in SSLeay 0.6.0. +.Fn BIO_get_callback_arg +first appeared in SSLeay 0.8.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/BIO_should_retry.3 b/man/BIO_should_retry.3 index 601bb997..43b19b89 100644 --- a/man/BIO_should_retry.3 +++ b/man/BIO_should_retry.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: BIO_should_retry.3,v 1.5 2016/12/06 14:45:08 schwarze Exp $ -.\" OpenSSL 60e24554 Apr 6 14:45:18 2010 +0000 +.\" $OpenBSD: BIO_should_retry.3,v 1.9 2018/12/19 21:12:58 schwarze Exp $ +.\" full merge up to: OpenSSL 60e24554 Apr 6 14:45:18 2010 +0000 +.\" selective merge up to: OpenSSL 57fd5170 May 13 11:24:11 2018 +0200 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2000, 2010, 2016 The OpenSSL Project. All rights reserved. @@ -48,11 +49,10 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: December 19 2018 $ .Dt BIO_SHOULD_RETRY 3 .Os .Sh NAME -.Nm BIO_should_retry , .Nm BIO_should_read , .Nm BIO_should_write , .Nm BIO_should_io_special , @@ -107,29 +107,30 @@ or call. .Pp .Fn BIO_should_retry -is true if the call that produced this condition -should be retried at a later time. -.Pp -If -.Fn BIO_should_retry -is false, the cause is an error condition. +returns 1 if the call that produced this condition should be retried +at a later time, or 0 if an error occurred. .Pp .Fn BIO_should_read -is true if the cause of the condition is that a BIO needs to read data. +returns 1 if the cause of the retry condition is that a BIO needs +to read data, or 0 otherwise. .Pp .Fn BIO_should_write -is true if the cause of the condition is that a BIO needs to write data. +returns 1 if the cause of the retry condition is that a BIO needs +to write data, or 0 otherwise. .Pp .Fn BIO_should_io_special -is true if some "special" condition -(i.e. a reason other than reading or writing) is the cause of the condition. +returns 1 if some special condition (i.e. a reason other than reading +or writing) is the cause of the retry condition, or 0 otherwise. .Pp .Fn BIO_retry_type -returns a mask of the cause of a retry condition consisting of the values +returns the bitwise OR of one or more of the flags .Dv BIO_FLAGS_READ , .Dv BIO_FLAGS_WRITE , +and .Dv BIO_FLAGS_IO_SPECIAL -though current BIO types will only set one of these. +representing the cause of the current retry condition, +or 0 if there is no retry condition. +Current BIO types only set one of the flags at a time. .Pp .Fn BIO_get_retry_BIO determines the precise reason for the special condition. @@ -214,6 +215,20 @@ and use a timeout on the .Sh SEE ALSO .Xr BIO_new 3 , .Xr BIO_read 3 +.Sh HISTORY +.Fn BIO_should_read , +.Fn BIO_should_write , +.Fn BIO_retry_type , +and +.Fn BIO_should_retry +first appeared in SSLeay 0.6.0. +.Fn BIO_should_io_special , +.Fn BIO_get_retry_BIO , +and +.Fn BIO_get_retry_reason +first appeared in SSLeay 0.8.0. +All these functions have been available since +.Ox 2.4 . .Sh BUGS The OpenSSL ASN.1 functions cannot gracefully deal with non-blocking I/O: they cannot retry after a partial read or write. diff --git a/man/BN_BLINDING_new.3 b/man/BN_BLINDING_new.3 index 00b55f54..04c5cfa3 100644 --- a/man/BN_BLINDING_new.3 +++ b/man/BN_BLINDING_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_BLINDING_new.3,v 1.6 2016/12/10 21:13:25 schwarze Exp $ +.\" $OpenBSD: BN_BLINDING_new.3,v 1.10 2018/03/23 23:18:17 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file was written by Nils Larsch . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt BN_BLINDING_NEW 3 .Os .Sh NAME @@ -304,20 +304,28 @@ on error. .Sh SEE ALSO .Xr BN_new 3 .Sh HISTORY -.Fn BN_BLINDING_thread_id -was first introduced in OpenSSL 1.0.0, and it deprecates -.Fn BN_BLINDING_set_thread_id +.Fn BN_BLINDING_new , +.Fn BN_BLINDING_free , +.Fn BN_BLINDING_update , +.Fn BN_BLINDING_convert , and -.Fn BN_BLINDING_get_thread_id . +.Fn BN_BLINDING_invert +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . .Pp .Fn BN_BLINDING_convert_ex , .Fn BN_BLINDIND_invert_ex , .Fn BN_BLINDING_get_thread_id , .Fn BN_BLINDING_set_thread_id , +.Fn BN_BLINDING_get_flags , .Fn BN_BLINDING_set_flags , -.Fn BN_BLINDING_get_flags and .Fn BN_BLINDING_create_param -were first introduced in OpenSSL 0.9.8. +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Pp +.Fn BN_BLINDING_thread_id +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . .Sh AUTHORS .An Nils Larsch Aq Mt nils@openssl.org diff --git a/man/BN_CTX_new.3 b/man/BN_CTX_new.3 index c4508486..1d5fb0a3 100644 --- a/man/BN_CTX_new.3 +++ b/man/BN_CTX_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_CTX_new.3,v 1.5 2016/12/10 21:13:25 schwarze Exp $ +.\" $OpenBSD: BN_CTX_new.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL aafbe1cc Jun 12 23:42:08 2013 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BN_CTX_NEW 3 .Os .Sh NAME @@ -136,6 +136,9 @@ and sets an error code that can be obtained by .Fn BN_CTX_new and .Fn BN_CTX_free -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp .Fn BN_CTX_init -was added in SSLeay 0.9.1b. +first appeared in SSLeay 0.9.1 and has been available since +.Ox 2.6 . diff --git a/man/BN_CTX_start.3 b/man/BN_CTX_start.3 index 2b48d892..f4f10b8b 100644 --- a/man/BN_CTX_start.3 +++ b/man/BN_CTX_start.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_CTX_start.3,v 1.6 2016/12/10 21:13:25 schwarze Exp $ +.\" $OpenBSD: BN_CTX_start.3,v 1.7 2018/03/22 16:06:33 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt BN_CTX_START 3 .Os .Sh NAME @@ -128,4 +128,5 @@ In case of an error, an error code is set which can be obtained by .Fn BN_CTX_get , and .Fn BN_CTX_end -were added in OpenSSL 0.9.5. +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/BN_add.3 b/man/BN_add.3 index a275dbfe..8a11d7c0 100644 --- a/man/BN_add.3 +++ b/man/BN_add.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_add.3,v 1.7 2017/01/30 01:29:31 schwarze Exp $ +.\" $OpenBSD: BN_add.3,v 1.13 2018/04/29 15:58:21 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 30 2017 $ +.Dd $Mdocdate: April 29 2018 $ .Dt BN_ADD 3 .Os .Sh NAME @@ -66,6 +66,13 @@ .Nm BN_mod_sqr , .Nm BN_exp , .Nm BN_mod_exp , +.\" The following are public, but intentionally undocumented for now: +.\" .Nm BN_mod_exp_mont_consttime , +.\" .Nm BN_mod_exp_mont , +.\" .Nm BN_mod_exp_mont_word , +.\" .Nm BN_mod_exp_recp , +.\" .Nm BN_mod_exp_simple , +.\" Maybe they should be deleted from . .Nm BN_gcd .Nd arithmetic operations on BIGNUMs .Sh SYNOPSIS @@ -245,6 +252,13 @@ and places the result in and the remainder in .Fa rem .Pq Li dv=a/d , rem=a%d . +If the flag +.Dv BN_FLG_CONSTTIME +is set on +.Fa a +or +.Fa d , +it operates in constant time. Either of .Fa dv and @@ -343,6 +357,11 @@ to the power modulo .Fa m .Pq Li r=(a^p)%m . +If the flag +.Dv BN_FLG_CONSTTIME +is set on +.Fa p , +it operates in constant time. This function uses less time and space than .Fn BN_exp . .Pp @@ -389,6 +408,7 @@ The error codes can be obtained by .Sh HISTORY .Fn BN_add , .Fn BN_sub , +.Fn BN_mul , .Fn BN_sqr , .Fn BN_div , .Fn BN_mod , @@ -396,17 +416,51 @@ The error codes can be obtained by .Fn BN_mod_exp , and .Fn BN_gcd -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1. +.Fn BN_exp +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp The .Fa ctx argument to .Fn BN_mul -was added in SSLeay 0.9.1b. -.Fn BN_exp -appeared in SSLeay 0.9.0. +was added in SSLeay 0.9.1 and +.Ox 2.6 . +.Pp .Fn BN_nnmod , .Fn BN_mod_add , .Fn BN_mod_sub , and .Fn BN_mod_sqr -were added in OpenSSL 0.9.7. +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Sh BUGS +Even if the +.Dv BN_FLG_CONSTTIME +flag is set on +.Fa a +or +.Fa b , +.Fn BN_gcd +neither fails nor operates in constant time, potentially allowing +timing side-channel attacks. +.Pp +Even if the +.Dv BN_FLG_CONSTTIME +flag is set on +.Fa p , +if the modulus +.Fa m +is even, +.Fn BN_mod_exp +does not operate in constant time, potentially allowing +timing side-channel attacks. +.Pp +If +.Dv BN_FLG_CONSTTIME +is set on +.Fa p , +.Fn BN_exp +fails instead of operating in constant time. diff --git a/man/BN_add_word.3 b/man/BN_add_word.3 index e0a4b301..cc5c682a 100644 --- a/man/BN_add_word.3 +++ b/man/BN_add_word.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_add_word.3,v 1.5 2016/12/10 21:13:25 schwarze Exp $ +.\" $OpenBSD: BN_add_word.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BN_ADD_WORD 3 .Os .Sh NAME @@ -155,16 +155,17 @@ if an error occurred. .Xr BN_new 3 , .Xr ERR_get_error 3 .Sh HISTORY -.Fn BN_add_word +.Fn BN_add_word , +.Fn BN_div_word , and .Fn BN_mod_word -are available in all versions of SSLeay and OpenSSL. -.Fn BN_div_word -was added in SSLeay 0.8, and +first appeared in SSLeay 0.5.1. .Fn BN_sub_word and .Fn BN_mul_word -in SSLeay 0.9.0. +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . .Pp Before 0.9.8a, the return value for .Fn BN_div_word diff --git a/man/BN_bn2bin.3 b/man/BN_bn2bin.3 index 2ff597a5..ee05b052 100644 --- a/man/BN_bn2bin.3 +++ b/man/BN_bn2bin.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: BN_bn2bin.3,v 1.6 2017/01/25 16:12:45 schwarze Exp $ -.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 +.\" $OpenBSD: BN_bn2bin.3,v 1.12 2018/12/19 21:53:53 schwarze Exp $ +.\" full merge up to: OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 +.\" selective merge up to: OpenSSL 1212818e Sep 11 13:22:14 2018 +0100 .\" .\" This file was written by Ulf Moeller . .\" Copyright (c) 2000, 2002, 2016 The OpenSSL Project. All rights reserved. @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 25 2017 $ +.Dd $Mdocdate: December 19 2018 $ .Dt BN_BN2BIN 3 .Os .Sh NAME @@ -181,7 +182,8 @@ If .Fa a is .Dv NULL , -it only computes the number's length in hexadecimal digits. +it only computes the number's length in hexadecimal digits, +also counting the leading minus sign if there is one. A "negative zero" is converted to zero. .Fn BN_dec2bn is the same using the decimal system. @@ -268,7 +270,8 @@ on error. .Fn BN_hex2bn and .Fn BN_dec2bn -return the number's length in hexadecimal or decimal digits +return the number's length in hexadecimal or decimal digits, +also counting the leading minus sign if there is one, or 0 on error, in which case no new .Vt BIGNUM is created. @@ -301,11 +304,11 @@ The error codes can be obtained by .Sh HISTORY .Fn BN_bn2bin , .Fn BN_bin2bn , -.Fn BN_print_fp , and .Fn BN_print -are available in all versions of SSLeay and OpenSSL. -.Pp +first appeared in SSLeay 0.5.1. +.Fn BN_print_fp +first appeared in SSLeay 0.6.0. .Fn BN_bn2hex , .Fn BN_bn2dec , .Fn BN_hex2bn , @@ -313,4 +316,10 @@ are available in all versions of SSLeay and OpenSSL. .Fn BN_bn2mpi , and .Fn BN_mpi2bn -were added in SSLeay 0.9.0. +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn BN_asc2bin +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . diff --git a/man/BN_cmp.3 b/man/BN_cmp.3 index bd79c905..9e2baa24 100644 --- a/man/BN_cmp.3 +++ b/man/BN_cmp.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_cmp.3,v 1.4 2016/12/10 21:13:25 schwarze Exp $ +.\" $OpenBSD: BN_cmp.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BN_CMP 3 .Os .Sh NAME @@ -141,9 +141,11 @@ return 1 if the condition is true, 0 otherwise. .Fn BN_cmp , .Fn BN_ucmp , .Fn BN_is_zero , -.Fn BN_is_one +.Fn BN_is_one , and .Fn BN_is_word -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1. .Fn BN_is_odd -was added in SSLeay 0.8. +first appeared in SSLeay 0.8.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/BN_copy.3 b/man/BN_copy.3 index 398cf1f8..956b368d 100644 --- a/man/BN_copy.3 +++ b/man/BN_copy.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_copy.3,v 1.6 2017/01/30 01:29:31 schwarze Exp $ +.\" $OpenBSD: BN_copy.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 30 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BN_COPY 3 .Os .Sh NAME @@ -156,4 +156,10 @@ The error codes can be obtained by .Fn BN_copy and .Fn BN_dup -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp +.Fn BN_with_flags +first appeared in OpenSSL 0.9.7h and 0.9.8a +and has been available since +.Ox 4.0 . diff --git a/man/BN_generate_prime.3 b/man/BN_generate_prime.3 index 5d4f931a..c767a864 100644 --- a/man/BN_generate_prime.3 +++ b/man/BN_generate_prime.3 @@ -1,9 +1,10 @@ -.\" $OpenBSD: BN_generate_prime.3,v 1.6 2017/01/07 05:06:22 schwarze Exp $ -.\" OpenSSL 2afb29b4 Aug 14 16:47:13 2014 -0400 +.\" $OpenBSD: BN_generate_prime.3,v 1.15 2018/12/21 19:30:19 schwarze Exp $ +.\" full merge up to: OpenSSL b3696a55 Sep 2 09:35:50 2017 -0400 +.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 .\" .\" This file was written by Ulf Moeller .\" Bodo Moeller , and Matt Caswell . -.\" Copyright (c) 2000, 2003, 2013, 2014 The OpenSSL Project. +.\" Copyright (c) 2000, 2003, 2013, 2014, 2018 The OpenSSL Project. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -50,7 +51,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 7 2017 $ +.Dd $Mdocdate: December 21 2018 $ .Dt BN_GENERATE_PRIME 3 .Os .Sh NAME @@ -58,8 +59,11 @@ .Nm BN_is_prime_ex , .Nm BN_is_prime_fasttest_ex , .Nm BN_GENCB_call , +.Nm BN_GENCB_new , +.Nm BN_GENCB_free , .Nm BN_GENCB_set_old , .Nm BN_GENCB_set , +.Nm BN_GENCB_get_arg , .Nm BN_generate_prime , .Nm BN_is_prime , .Nm BN_is_prime_fasttest @@ -96,6 +100,12 @@ .Fa "int a" .Fa "int b" .Fc +.Ft BN_GENCB * +.Fn BN_GENCB_new void +.Ft void +.Fo BN_GENCB_free +.Fa "BN_GENCB *cb" +.Fc .Ft void .Fo BN_GENCB_set_old .Fa "BN_GENCB *gencb" @@ -108,6 +118,10 @@ .Fa "int (*callback)(int, int, BN_GENCB *)" .Fa "void *cb_arg" .Fc +.Ft void * +.Fo BN_GENCB_get_arg +.Fa "BN_GENCB *cb" +.Fc .Pp Deprecated: .Pp @@ -165,6 +179,13 @@ is called as described below. When a prime has been found, .Fn BN_GENCB_call cb 2 i is called. +.It +The callers of +.Fn BN_generate_prime_ex +may call +.Fn BN_GENCB_call +with other values as described in their respective manual pages; see +.Sx SEE ALSO . .El .Pp The prime may have to fulfill additional requirements for use in @@ -260,9 +281,16 @@ structures that are supported: "new" style and "old" style. New programs should prefer the "new" style, whilst the "old" style is provided for backwards compatibility purposes. .Pp +A +.Vt BN_GENCB +structure should be created through a call to +.Fn BN_GENCB_new +and freed through a call to +.Fn BN_GENCB_free . +.Pp For "new" style callbacks a .Vt BN_GENCB -structure should be initialised with a call to the macro +structure should be initialised with a call to .Fn BN_GENCB_set , where .Fa gencb @@ -276,7 +304,7 @@ and is a .Vt void * . "Old" style callbacks are the same except they are initialised with a -call to the macro +call to .Fn BN_GENCB_set_old and .Fa callback @@ -291,6 +319,15 @@ for new style callbacks or .Fn callback a b cb_arg for old style. .Pp +It is possible to obtain the argument associated with a +.Vt BN_GENCB +structure (set via a call to +.Fn BN_GENCB_set +or +.Fn BN_GENCB_set_old ) +using +.Fn BN_GENCB_get_arg . +.Pp .Fn BN_generate_prime (deprecated) works in the same way as .Fn BN_generate_prime_ex @@ -326,26 +363,63 @@ returns the prime number on success, .Dv NULL otherwise. .Pp +.Fn BN_GENCB_new +returns a pointer to a +.Vt BN_GENCB +structure on success, or +.Dv NULL +otherwise. +.Pp +.Fn BN_GENCB_get_arg +returns the argument previously associated with a +.Vt BN_GENCB +structure. +.Pp Callback functions should return 1 on success or 0 on error. .Pp The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr BN_new 3 , +.Xr DH_generate_parameters 3 , +.Xr DSA_generate_parameters 3 , .Xr ERR_get_error 3 , -.Xr RAND_bytes 3 +.Xr RAND_bytes 3 , +.Xr RSA_generate_key 3 .Sh HISTORY -The -.Fa cb_arg -arguments to .Fn BN_generate_prime -and to +and .Fn BN_is_prime -were added in SSLeay 0.9.0. +first appeared in SSLeay 0.5.1 and had their +.Fa cb_arg +argument added in SSLeay 0.9.0. +These two functions have been available since +.Ox 2.4 . +.Pp The .Fa ret argument to .Fn BN_generate_prime -was added in SSLeay 0.9.1. +was added in SSLeay 0.9.1 and +.Ox 2.6 . +.Pp .Fn BN_is_prime_fasttest -was added in OpenSSL 0.9.5. +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . +.Pp +.Fn BN_generate_prime_ex , +.Fn BN_is_prime_ex , +.Fn BN_is_prime_fasttest_ex , +.Fn BN_GENCB_call , +.Fn BN_GENCB_set_old , +and +.Fn BN_GENCB_set +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Pp +.Fn BN_GENCB_new , +.Fn BN_GENCB_free , +and +.Fn BN_GENCB_get_arg +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . diff --git a/man/BN_get0_nist_prime_521.3 b/man/BN_get0_nist_prime_521.3 index 74edc77a..eb95c422 100644 --- a/man/BN_get0_nist_prime_521.3 +++ b/man/BN_get0_nist_prime_521.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_get0_nist_prime_521.3,v 1.4 2016/12/11 10:00:30 jmc Exp $ +.\" $OpenBSD: BN_get0_nist_prime_521.3,v 1.5 2018/03/23 00:09:11 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Rich Salz . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt BN_GET0_NIST_PRIME_521 3 .Os .Sh NAME @@ -83,3 +83,7 @@ functions return a for the specific NIST prime curve (e.g. P-256). .Sh SEE ALSO .Xr BN_new 3 +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.8 +and have been available since +.Ox 4.5 . diff --git a/man/BN_mod_inverse.3 b/man/BN_mod_inverse.3 index f407fa71..aa509b1a 100644 --- a/man/BN_mod_inverse.3 +++ b/man/BN_mod_inverse.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_mod_inverse.3,v 1.6 2017/01/30 01:29:31 schwarze Exp $ +.\" $OpenBSD: BN_mod_inverse.3,v 1.10 2018/04/29 15:58:21 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 30 2017 $ +.Dd $Mdocdate: April 29 2018 $ .Dt BN_MOD_INVERSE 3 .Os .Sh NAME @@ -80,6 +80,14 @@ a new .Vt BIGNUM is created. .Pp +If the flag +.Dv BN_FLG_CONSTTIME +is set on +.Fa a +or +.Fa n , +it operates in constant time. +.Pp .Fa ctx is a previously allocated .Vt BN_CTX @@ -106,4 +114,10 @@ The error codes can be obtained by .Xr BN_set_flags 3 .Sh HISTORY .Fn BN_mod_inverse -is available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and has been available since +.Ox 2.4 . +.Pp +The +.Fa r +argument was added in SSLeay 0.9.1 and +.Ox 2.6 . diff --git a/man/BN_mod_mul_montgomery.3 b/man/BN_mod_mul_montgomery.3 index 60791d4b..8feed711 100644 --- a/man/BN_mod_mul_montgomery.3 +++ b/man/BN_mod_mul_montgomery.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_mod_mul_montgomery.3,v 1.7 2017/01/30 07:51:27 jmc Exp $ +.\" $OpenBSD: BN_mod_mul_montgomery.3,v 1.11 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 30 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BN_MOD_MUL_MONTGOMERY 3 .Os .Sh NAME @@ -222,15 +222,17 @@ The error codes can be obtained by .Fn BN_MONT_CTX_free , .Fn BN_MONT_CTX_set , .Fn BN_mod_mul_montgomery , -.Fn BN_from_montgomery +.Fn BN_from_montgomery , and .Fn BN_to_montgomery -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.6.1 and have been available since +.Ox 2.4 . .Pp .Fn BN_MONT_CTX_init and .Fn BN_MONT_CTX_copy -were added in SSLeay 0.9.1b. +first appeared in SSLeay 0.9.1 and have been available since +.Ox 2.6 . .Sh CAVEATS .Fn BN_MONT_CTX_init must not be called on a context that was used previously, or diff --git a/man/BN_mod_mul_reciprocal.3 b/man/BN_mod_mul_reciprocal.3 index f2e2ac29..9ace3576 100644 --- a/man/BN_mod_mul_reciprocal.3 +++ b/man/BN_mod_mul_reciprocal.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_mod_mul_reciprocal.3,v 1.7 2017/01/30 07:51:27 jmc Exp $ +.\" $OpenBSD: BN_mod_mul_reciprocal.3,v 1.10 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 30 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BN_MOD_MUL_RECIPROCAL 3 .Os .Sh NAME @@ -190,6 +190,10 @@ The error codes can be obtained by .Xr BN_CTX_new 3 , .Xr BN_new 3 .Sh HISTORY +.Fn BN_mod_mul_reciprocal +first appeared in SSLeay 0.5.1 and has been available since +.Ox 2.4 . +.Pp .Vt BN_RECP_CTX was added in SSLeay 0.9.0. Before that, a function @@ -197,6 +201,15 @@ Before that, a function was used instead, and the .Fn BN_mod_mul_reciprocal arguments were different. +.Pp +.Fn BN_RECP_CTX_new , +.Fn BN_RECP_CTX_init , +.Fn BN_RECP_CTX_free , +.Fn BN_RECP_CTX_set , +and +.Fn BN_div_recp +first appeared in SSLeay 0.9.1 and have been available since +.Ox 2.6 . .Sh CAVEATS .Fn BN_RECP_CTX_init must not be called on a context that was used previously, or diff --git a/man/BN_new.3 b/man/BN_new.3 index 8122e32f..ed2910e6 100644 --- a/man/BN_new.3 +++ b/man/BN_new.3 @@ -1,6 +1,7 @@ -.\" $OpenBSD: BN_new.3,v 1.9 2017/01/30 07:51:27 jmc Exp $ -.\" OpenSSL doc/man3/BN_new.pod 2457c19d Mar 6 08:43:36 2004 +0000 -.\" OpenSSL doc/man7/bn.pod 05ea606a May 20 20:52:46 2016 -0400 +.\" $OpenBSD: BN_new.3,v 1.14 2018/04/29 15:58:21 schwarze Exp $ +.\" full merge up to: OpenSSL man3/BN_new 2457c19d Mar 6 08:43:36 2004 +0000 +.\" selective merge up to: man3/BN_new 681acb31 Sep 29 13:10:34 2017 +0200 +.\" full merge up to: OpenSSL man7/bn 05ea606a May 20 20:52:46 2016 -0400 .\" .\" This file was written by Ulf Moeller . .\" Copyright (c) 2000, 2004 The OpenSSL Project. All rights reserved. @@ -49,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 30 2017 $ +.Dd $Mdocdate: April 29 2018 $ .Dt BN_NEW 3 .Os .Sh NAME @@ -101,7 +102,11 @@ or accessed directly. .Fn BN_new allocates and initializes a .Vt BIGNUM -structure. +structure, in particular setting the value to zero and the flags to +.Dv BN_FLG_MALLOCED . +The security-relevant flag +.Dv BN_FLG_CONSTTIME +is not set by default. .Pp .Fn BN_init initializes an existing uninitialized @@ -165,9 +170,12 @@ and sets an error code that can be obtained by .Fn BN_free , and .Fn BN_clear_free -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp .Fn BN_init -was added in SSLeay 0.9.1b. +first appeared in SSLeay 0.9.1 and has been available since +.Ox 2.6 . .Sh CAVEATS .Fn BN_init must not be called on a diff --git a/man/BN_num_bytes.3 b/man/BN_num_bytes.3 index 96538950..ae32a8d8 100644 --- a/man/BN_num_bytes.3 +++ b/man/BN_num_bytes.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_num_bytes.3,v 1.5 2016/12/10 21:13:25 schwarze Exp $ +.\" $OpenBSD: BN_num_bytes.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BN_NUM_BYTES 3 .Os .Sh NAME @@ -120,8 +120,11 @@ The size. .Xr DSA_size 3 , .Xr RSA_size 3 .Sh HISTORY -.Fn BN_num_bytes , -.Fn BN_num_bits , +.Fn BN_num_bytes and +.Fn BN_num_bits +first appeared in SSLeay 0.5.1. .Fn BN_num_bits_word -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.2. +These functions have been available since +.Ox 2.4 . diff --git a/man/BN_rand.3 b/man/BN_rand.3 index b2cb3154..b5966bcf 100644 --- a/man/BN_rand.3 +++ b/man/BN_rand.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: BN_rand.3,v 1.6 2016/12/10 21:13:25 schwarze Exp $ -.\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 +.\" $OpenBSD: BN_rand.3,v 1.14 2018/12/24 10:07:22 schwarze Exp $ +.\" full merge up to: OpenSSL 05ea606a May 20 20:52:46 2016 -0400 +.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 .\" .\" This file was written by Ulf Moeller . .\" Copyright (c) 2000, 2001, 2002, 2013, 2015 The OpenSSL Project. @@ -49,13 +50,13 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: December 24 2018 $ .Dt BN_RAND 3 .Os .Sh NAME .Nm BN_rand , -.Nm BN_pseudo_rand , .Nm BN_rand_range , +.Nm BN_pseudo_rand , .Nm BN_pseudo_rand_range .Nd generate pseudo-random number .Sh SYNOPSIS @@ -68,22 +69,10 @@ .Fa "int bottom" .Fc .Ft int -.Fo BN_pseudo_rand -.Fa "BIGNUM *rnd" -.Fa "int bits" -.Fa "int top" -.Fa "int bottom" -.Fc -.Ft int .Fo BN_rand_range .Fa "BIGNUM *rnd" .Fa "BIGNUM *range" .Fc -.Ft int -.Fo BN_pseudo_rand_range -.Fa "BIGNUM *rnd" -.Fa "BIGNUM *range" -.Fc .Sh DESCRIPTION .Fn BN_rand generates a cryptographically strong pseudo-random number of @@ -113,21 +102,19 @@ is +1 then .Fa top cannot also be 1. .Pp -.Fn BN_pseudo_rand -does the same, but pseudo-random numbers generated by this function are -not necessarily unpredictable. -They can be used for non-cryptographic purposes and for certain purposes -in cryptographic protocols, but usually not for key generation etc. -.Pp .Fn BN_rand_range generates a cryptographically strong pseudo-random number .Fa rnd in the range 0 <= .Fa rnd No < Fa range . +.Pp +.Fn BN_pseudo_rand +is a deprecated alias for +.Fn BN_rand , +and .Fn BN_pseudo_rand_range -does the same, but is based on -.Fn BN_pseudo_rand , -and hence numbers generated by it are not necessarily unpredictable. +for +.Fn BN_rand_range . .Sh RETURN VALUES The functions return 1 on success, 0 on error. The error codes can be obtained by @@ -139,13 +126,12 @@ The error codes can be obtained by .Xr RAND_bytes 3 .Sh HISTORY .Fn BN_rand -is available in all versions of SSLeay and OpenSSL. -.Fn BN_pseudo_rand -was added in OpenSSL 0.9.5. +first appeared in SSLeay 0.5.1 and has been available since +.Ox 2.4 . +.Pp The .Fa top == -1 case and the function .Fn BN_rand_range -were added in OpenSSL 0.9.6a. -.Fn BN_pseudo_rand_range -was added in OpenSSL 0.9.6c. +first appeared in OpenSSL 0.9.6a and have been available since +.Ox 3.0 . diff --git a/man/BN_set_bit.3 b/man/BN_set_bit.3 index 077ca69c..93bfda67 100644 --- a/man/BN_set_bit.3 +++ b/man/BN_set_bit.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_set_bit.3,v 1.5 2016/12/10 21:13:25 schwarze Exp $ +.\" $OpenBSD: BN_set_bit.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BN_SET_BIT 3 .Os .Sh NAME @@ -212,4 +212,5 @@ The error codes can be obtained by .Fn BN_rshift , and .Fn BN_rshift1 -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . diff --git a/man/BN_set_flags.3 b/man/BN_set_flags.3 index 27649fd0..9b1647cd 100644 --- a/man/BN_set_flags.3 +++ b/man/BN_set_flags.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_set_flags.3,v 1.1 2017/01/30 01:29:31 schwarze Exp $ +.\" $OpenBSD: BN_set_flags.3,v 1.3 2018/04/29 15:58:21 schwarze Exp $ .\" .\" Copyright (c) 2017 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 30 2017 $ +.Dd $Mdocdate: April 29 2018 $ .Dt BN_SET_FLAGS 3 .Os .Sh NAME @@ -47,6 +47,8 @@ together: .It Dv BN_FLG_CONSTTIME If this flag is set on the divident .Fa a +or the divisor +.Fa d in .Xr BN_div 3 , on the exponent @@ -59,27 +61,14 @@ or the modulus .Fa n in .Xr BN_mod_inverse 3 , -these functions prefer algorithms with an execution time independent +these functions select algorithms with an execution time independent of the respective numbers, to avoid exposing sensitive information -to timing attacks. +to timing side-channel attacks. .Pp -If this flag is set on the exponent -.Fa p -in -.Xr BN_exp 3 -or if the modulus -.Fa m -is even for -.Xr BN_mod_exp 3 , -an error occurs. -.Pp -Various functions automatically set this flag on sensitive data. -For example, the default implementations of -.Xr DH_generate_key 3 , -.Xr DSA_generate_key 3 , -and -.Xr RSA_generate_key_ex 3 -set it on the generated private key. +This flag is off by default for +.Vt BIGNUM +objects created with +.Xr BN_new 3 . .It Dv BN_FLG_MALLOCED If this flag is set, .Xr BN_free 3 @@ -138,7 +127,41 @@ returns zero or more of the above constants, OR'ed together. .Xr BN_mod_inverse 3 , .Xr BN_new 3 , .Xr BN_with_flags 3 +.Sh HISTORY +.Fn BN_set_flags +and +.Fn BN_get_flags +first appeared in SSLeay 0.9.1 and have been available since +.Ox 2.6 . .Sh CAVEATS No public interface exists to clear a flag once it is set. So think twice before using .Fn BN_set_flags . +.Sh BUGS +Even if the +.Dv BN_FLG_CONSTTIME +flag is set on +.Fa a +or +.Fa b , +.Fn BN_gcd +neither fails nor operates in constant time, potentially allowing +timing side-channel attacks. +.Pp +Even if the +.Dv BN_FLG_CONSTTIME +flag is set on +.Fa p , +if the modulus +.Fa m +is even, +.Xr BN_mod_exp 3 +does not operate in constant time, potentially allowing +timing side-channel attacks. +.Pp +If +.Dv BN_FLG_CONSTTIME +is set on +.Fa p , +.Fn BN_exp +fails instead of operating in constant time. diff --git a/man/BN_set_negative.3 b/man/BN_set_negative.3 index 29cb2d95..69927c1b 100644 --- a/man/BN_set_negative.3 +++ b/man/BN_set_negative.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_set_negative.3,v 1.3 2016/12/10 21:13:25 schwarze Exp $ +.\" $OpenBSD: BN_set_negative.3,v 1.4 2018/03/23 00:09:11 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt BN_SET_NEGATIVE 3 .Os .Sh NAME @@ -55,3 +55,9 @@ is negative or 0 otherwise. .Xr BN_new 3 , .Xr BN_set_bit 3 , .Xr BN_zero 3 +.Sh HISTORY +.Fn BN_set_negative +and +.Fn BN_is_negative +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/BN_swap.3 b/man/BN_swap.3 index 087ca490..db9082d7 100644 --- a/man/BN_swap.3 +++ b/man/BN_swap.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BN_swap.3,v 1.4 2016/12/10 21:13:25 schwarze Exp $ +.\" $OpenBSD: BN_swap.3,v 1.5 2018/03/22 21:08:22 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Bodo Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt BN_SWAP 3 .Os .Sh NAME @@ -70,4 +70,6 @@ and .Sh SEE ALSO .Xr BN_new 3 .Sh HISTORY -BN_swap was added in OpenSSL 0.9.7. +.Fn BN_swap +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . diff --git a/man/BN_zero.3 b/man/BN_zero.3 index 49d08717..f3ca4cdf 100644 --- a/man/BN_zero.3 +++ b/man/BN_zero.3 @@ -1,8 +1,10 @@ -.\" $OpenBSD: BN_zero.3,v 1.6 2016/12/10 21:13:25 schwarze Exp $ -.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 +.\" $OpenBSD: BN_zero.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 +.\" selective merge up to: OpenSSL b713c4ff Jan 22 14:41:09 2018 -0500 .\" .\" This file was written by Ulf Moeller . -.\" Copyright (c) 2000, 2001, 2002 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2000, 2001, 2002, 2018 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 @@ -48,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BN_ZERO 3 .Os .Sh NAME @@ -75,13 +77,17 @@ .Ft int .Fo BN_set_word .Fa "BIGNUM *a" -.Fa "unsigned long w" +.Fa "BN_ULONG w" .Fc -.Ft unsigned long +.Ft BN_ULONG .Fo BN_get_word .Fa "BIGNUM *a" .Fc .Sh DESCRIPTION +.Vt BN_ULONG +is a macro that expands to an unsigned integral type optimized +for the most efficient implementation on the local platform. +.Pp .Fn BN_zero , .Fn BN_one , and @@ -100,21 +106,15 @@ are macros. returns a .Vt BIGNUM constant of value 1. -This constant is useful for use in comparisons and assignment. -.Pp -.Fn BN_get_word -returns -.Fa a -if it can be represented as an -.Vt unsigned long . +This constant is useful for comparisons and assignments. .Sh RETURN VALUES .Fn BN_get_word returns the value .Fa a , -or 0xffffffffL if +or a number with all bits set if .Fa a -cannot be represented as an -.Vt unsigned long . +cannot be represented as a +.Vt BN_ULONG . .Pp .Fn BN_zero , .Fn BN_one , @@ -131,23 +131,24 @@ returns the constant. .Sh HISTORY .Fn BN_zero , .Fn BN_one , +.Fn BN_value_one , and .Fn BN_set_word -are available in all versions of SSLeay and OpenSSL. -.Fn BN_value_one -and +first appeared in SSLeay 0.5.1. .Fn BN_get_word -were added in SSLeay 0.8. -.Pp -.Fn BN_value_one -was changed to return a true -.Vt const BIGNUM * -in OpenSSL 0.9.7. +first appeared in SSLeay 0.6.0. +All these functions have been available since +.Ox 2.4 . .Sh BUGS Someone might change the constant. .Pp -If a +If the value of a .Vt BIGNUM -is equal to 0xffffffffL; it can be represented as an -.Vt unsigned long -but this value is also returned on error. +is equal to a +.Vt BN_ULONG +with all bits set, the return value of +.Fn BN_get_word +collides with return value used to indicate errors. +.Pp +.Vt BN_ULONG +should probably be a typedef rather than a macro. diff --git a/man/BUF_MEM_new.3 b/man/BUF_MEM_new.3 index 70d2fe09..60e12c53 100644 --- a/man/BUF_MEM_new.3 +++ b/man/BUF_MEM_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BUF_MEM_new.3,v 1.11 2017/05/08 04:16:05 jsing Exp $ +.\" $OpenBSD: BUF_MEM_new.3,v 1.15 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL doc/crypto/buffer.pod 18edda0f Sep 20 03:28:54 2000 +0000 .\" not merged: 74924dcb, 58e3457a, 21b0fa91, 7644a9ae .\" OpenSSL doc/crypto/BUF_MEM_new.pod 53934822 Jun 9 16:39:19 2016 -0400 @@ -52,7 +52,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: May 8 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt BUF_MEM_NEW 3 .Os .Sh NAME @@ -187,9 +187,19 @@ return zero on error or the new size (i.e.\& .Xr BIO_new 3 .Sh HISTORY .Fn BUF_MEM_new , -.Fn BUF_MEM_free +.Fn BUF_MEM_free , and .Fn BUF_MEM_grow -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.6.0. .Fn BUF_strdup -was added in SSLeay 0.8. +first appeared in SSLeay 0.8.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn BUF_MEM_grow_clean +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . +.Pp +.Fn BUF_reverse +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . diff --git a/man/CONF_modules_free.3 b/man/CONF_modules_free.3 index 465cc055..be5f64d1 100644 --- a/man/CONF_modules_free.3 +++ b/man/CONF_modules_free.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: CONF_modules_free.3,v 1.4 2016/11/20 19:45:17 schwarze Exp $ +.\" $OpenBSD: CONF_modules_free.3,v 1.5 2018/03/22 21:08:22 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 20 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt CONF_MODULES_FREE 3 .Os .Sh NAME @@ -96,7 +96,8 @@ is 1, all modules, including builtin modules, will be unloaded. .Xr OPENSSL_config 3 .Sh HISTORY .Fn CONF_modules_free , -.Fn CONF_modules_unload , +.Fn CONF_modules_finish , and -.Fn CONF_modules_finish -first appeared in OpenSSL 0.9.7. +.Fn CONF_modules_unload +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/CONF_modules_load_file.3 b/man/CONF_modules_load_file.3 index 620787b4..d0401d52 100644 --- a/man/CONF_modules_load_file.3 +++ b/man/CONF_modules_load_file.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: CONF_modules_load_file.3,v 1.5 2016/12/11 18:06:09 schwarze Exp $ +.\" $OpenBSD: CONF_modules_load_file.3,v 1.8 2019/03/20 04:02:07 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 20 2019 $ .Dt CONF_MODULES_LOAD_FILE 3 .Os .Sh NAME @@ -163,7 +163,7 @@ Load a configuration file and print out any errors and exit (missing file considered fatal): .Bd -literal if (CONF_modules_load_file(NULL, NULL, 0) <= 0) { - fprintf(stderr, "FATAL: error loading configuration file\n"); + fprintf(stderr, "FATAL: error loading configuration file\en"); ERR_print_errors_fp(stderr); exit(1); } @@ -174,7 +174,7 @@ by "myapp", tolerate missing files, but exit on other errors: .Bd -literal if (CONF_modules_load_file(NULL, "myapp", CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0) { - fprintf(stderr, "FATAL: error loading configuration file\n"); + fprintf(stderr, "FATAL: error loading configuration file\en"); ERR_print_errors_fp(stderr); exit(1); } @@ -185,7 +185,7 @@ error, missing configuration file ignored: .Bd -literal if (CONF_modules_load_file("/something/app.cnf", "myapp", CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0) { - fprintf(stderr, "WARNING: error loading configuration file\n"); + fprintf(stderr, "WARNING: error loading configuration file\en"); ERR_print_errors_fp(stderr); } .Ed @@ -198,17 +198,17 @@ long eline; fp = fopen("/somepath/app.cnf", "r"); if (fp == NULL) { - fprintf(stderr, "Error opening configuration file\n"); + fprintf(stderr, "Error opening configuration file\en"); /* Other missing configuration file behaviour */ } else { cnf = NCONF_new(NULL); if (NCONF_load_fp(cnf, fp, &eline) == 0) { - fprintf(stderr, "Error on line %ld of configuration file\n", + fprintf(stderr, "Error on line %ld of configuration file\en", eline); ERR_print_errors_fp(stderr); /* Other malformed configuration file behaviour */ } else if (CONF_modules_load(cnf, "appname", 0) <= 0) { - fprintf(stderr, "Error configuring application\n"); + fprintf(stderr, "Error configuring application\en"); ERR_print_errors_fp(stderr); /* Other configuration error behaviour */ } @@ -219,9 +219,11 @@ if (fp == NULL) { .Sh SEE ALSO .Xr CONF_modules_free 3 , .Xr ERR 3 , -.Xr OPENSSL_config 3 +.Xr OPENSSL_config 3 , +.Xr OPENSSL_init_crypto 3 .Sh HISTORY .Fn CONF_modules_load_file and .Fn CONF_modules_load -first appeared in OpenSSL 0.9.7. +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/CRYPTO_get_mem_functions.3 b/man/CRYPTO_get_mem_functions.3 index 04c0ffad..f02ec8fb 100644 --- a/man/CRYPTO_get_mem_functions.3 +++ b/man/CRYPTO_get_mem_functions.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: CRYPTO_get_mem_functions.3,v 1.3 2017/08/20 19:45:19 schwarze Exp $ +.\" $OpenBSD: CRYPTO_get_mem_functions.3,v 1.6 2018/08/24 19:17:38 tb Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: August 24 2018 $ .Dt CRYPTO_GET_MEM_FUNCTIONS 3 .Os .Sh NAME @@ -43,15 +43,15 @@ .Fo CRYPTO_mem_ctrl .Fa "int mode" .Fc -.Ft void +.Ft int .Fo CRYPTO_mem_leaks .Fa "BIO *b" .Fc -.Ft void +.Ft int .Fo CRYPTO_mem_leaks_fp .Fa "FILE *fp" .Fc -.Ft typedef void * +.Ft typedef int * .Fo CRYPTO_MEM_LEAK_CB .Fa "unsigned long" .Fa "const char *" @@ -59,7 +59,7 @@ .Fa int .Fa "void *" .Fc -.Ft void +.Ft int .Fo CRYPTO_mem_leaks_cb .Fa "CRYPTO_MEM_LEAK_CB *cb" .Fc @@ -90,3 +90,23 @@ always returns 0. .Fn CRYPTO_mem_ctrl always returns .Dv CRYPTO_MEM_CHECK_OFF . +.Pp +.Fn CRYPTO_mem_leaks , +.Fn CRYPTO_mem_leaks_fp , +and +.Fn CRYPTO_mem_leaks_cb +always return -1. +.Sh HISTORY +.Fn CRYPTO_mem_ctrl , +.Fn CRYPTO_mem_leaks , +and +.Fn CRYPTO_mem_leaks_fp +first appeared in SSLeay 0.6.4. +.Fn CRYPTO_get_mem_functions +and +.Fn CRYPTO_set_mem_functions +first appeared in SSLeay 0.6.5. +.Fn CRYPTO_mem_leaks_cb +first appeared in SSLeay 0.6.6. +All these functions have all been available since +.Ox 2.4 . diff --git a/man/CRYPTO_lock.3 b/man/CRYPTO_lock.3 new file mode 100644 index 00000000..cb6224a7 --- /dev/null +++ b/man/CRYPTO_lock.3 @@ -0,0 +1,176 @@ +.\" $OpenBSD: CRYPTO_lock.3,v 1.1 2019/03/10 15:00:34 schwarze Exp $ +.\" OpenSSL doc/crypto/threads.pod fb552ac6 Sep 30 23:43:01 2009 +0000 +.\" +.\" Copyright (c) 2019 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: March 10 2019 $ +.Dt CRYPTO_LOCK 3 +.Os +.Sh NAME +.Nm CRYPTO_THREADID_current , +.Nm CRYPTO_THREADID_cmp , +.Nm CRYPTO_THREADID_cpy , +.Nm CRYPTO_THREADID_hash , +.Nm CRYPTO_lock , +.Nm CRYPTO_w_lock , +.Nm CRYPTO_w_unlock , +.Nm CRYPTO_r_lock , +.Nm CRYPTO_r_unlock , +.Nm CRYPTO_add +.Nd thread support +.Sh SYNOPSIS +.In openssl/crypto.h +.Ft void +.Fo CRYPTO_THREADID_current +.Fa "CRYPTO_THREADID *id" +.Fc +.Ft int +.Fo CRYPTO_THREADID_cmp +.Fa "const CRYPTO_THREADID *a" +.Fa "const CRYPTO_THREADID *b" +.Fc +.Ft void +.Fo CRYPTO_THREADID_cpy +.Fa "CRYPTO_THREADID *dest" +.Fa "const CRYPTO_THREADID *src" +.Fc +.Ft unsigned long +.Fo CRYPTO_THREADID_hash +.Fa "const CRYPTO_THREADID *id" +.Fc +.Ft void +.Fo CRYPTO_lock +.Fa "int mode" +.Fa "int type" +.Fa "const char *file" +.Fa "int line" +.Fc +.Ft int +.Fo CRYPTO_add +.Fa "int *p" +.Fa "int amount" +.Fa "int type" +.Fc +.Bd -literal +#define CRYPTO_w_lock(type) \e + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE, type, __FILE__, __LINE__) +#define CRYPTO_w_unlock(type) \e + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE, type, __FILE__, __LINE__) +#define CRYPTO_r_lock(type) \e + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ, type, __FILE__, __LINE__) +#define CRYPTO_r_unlock(type) \e + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ, type, __FILE__, __LINE__) +.Ed +.Sh DESCRIPTION +These functions are obsolete. +.Pp +.Fn CRYPTO_THREADID_current +stores a unique identifier of the currently executing thread +into the opaque object +.Fa id . +.Pp +.Fn CRYPTO_THREADID_cpy +copies the contents of +.Fa src +to +.Fa dest . +.Pp +.Fn CRYPTO_lock +locks or unlocks a mutex lock. +.Pp +.Fa mode +is a bitfield describing what should be done with the lock. +For each call, either +.Dv CRYPTO_LOCK +or +.Dv CRYPTO_UNLOCK +must be included. +In the LibreSSL implementation, +.Dv CRYPTO_READ +and +.Dv CRYPTO_WRITE +are ignored. +.Pp +.Fa type +is a number in the range 0 <= +.Fa type No < Dv CRYPTO_NUM_LOCKS +identifying a particular lock. +Currently, the value of +.Dv CRYPTO_NUM_LOCKS +is 41. +.Pp +The +.Ar file +and +.Ar line +arguments are ignored. +.Pp +In the LibreSSL implementation, +.Fn CRYPTO_lock +is a wrapper around +.Xr pthread_mutex_lock 3 +and +.Xr pthread_mutex_unlock 3 . +.Pp +.Fn CRYPTO_add +locks the lock number +.Fa type , +adds +.Fa amount +to +.Pf * Fa p , +and unlocks the lock number +.Fa type +again. +.Sh RETURN VALUES +.Fn CRYPTO_THREADID_cmp +returns 0 if +.Fa a +and +.Fa b +refer to the same thread or a non-zero value otherwise. +.Pp +.Fn CRYPTO_THREADID_hash +returns a numeric value usable as a hash-table key. +In the LibreSSL implementation, it is the value returned from +.Xr pthread_self 3 +for the thread +.Fa id . +.Pp +.Fn CRYPTO_add +returns the new value of +.Pf * Fa p . +.Sh SEE ALSO +.Xr crypto 3 +.Sh HISTORY +.Fn CRYPTO_lock , +.Fn CRYPTO_w_lock , +.Fn CRYPTO_w_unlock , +.Fn CRYPTO_r_lock , +and +.Fn CRYPTO_r_unlock +first appeared in SSLeay 0.6.0. +.Fn CRYPTO_add +first appeared in SSLeay 0.6.2. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn CRYPTO_THREADID_current , +.Fn CRYPTO_THREADID_cmp , +.Fn CRYPTO_THREADID_cpy , +and +.Fn CRYPTO_THREADID_hash +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/CRYPTO_set_ex_data.3 b/man/CRYPTO_set_ex_data.3 index 0e96e22e..ca5080df 100644 --- a/man/CRYPTO_set_ex_data.3 +++ b/man/CRYPTO_set_ex_data.3 @@ -1,53 +1,7 @@ -.\" $OpenBSD: CRYPTO_set_ex_data.3,v 1.7 2017/01/06 20:35:23 schwarze Exp $ -.\" OpenSSL CRYPTO_get_ex_new_index.pod 35cb565a Nov 19 15:49:30 2015 -0500 -.\" -.\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2000, 2006 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. -.\" OpenSSL +.\" $OpenBSD: CRYPTO_set_ex_data.3,v 1.10 2018/04/08 01:00:15 schwarze Exp $ +.\" full merge up to: +.\" OpenSSL CRYPTO_get_ex_new_index 9e183d22 Mar 11 08:56:44 2017 -0500 +.\" selective merge up to: a73d990e Feb 27 19:02:24 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson .\" and by Rich Salz . @@ -98,7 +52,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: April 8 2018 $ .Dt CRYPTO_SET_EX_DATA 3 .Os .Sh NAME @@ -177,18 +131,20 @@ Several OpenSSL structures can have application specific data attached to them, known as "exdata". The specific structures are: .Bd -literal + BIO + DH + DSA + ECDH + ECDSA + ENGINE + RSA SSL SSL_CTX SSL_SESSION + UI X509 X509_STORE X509_STORE_CTX - DH - DSA - RSA - ENGINE - UI - BIO .Ed .Pp Each is identified by a @@ -391,7 +347,18 @@ On failure an error code can be obtained from .Xr RSA_get_ex_new_index 3 , .Xr X509_STORE_CTX_get_ex_new_index 3 .Sh HISTORY -.Fn CRYPTO_set_ex_data +.Fn CRYPTO_get_ex_new_index , +.Fn CRYPTO_set_ex_data , +.Fn CRYPTO_get_ex_data , +.Fn CRYPTO_free_ex_data , and -.Fn CRYPTO_get_ex_data -have been available since SSLeay 0.9.0. +.Fn CRYPTO_new_ex_data +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . +.Pp +.Fn CRYPTO_EX_new , +.Fn CRYPTO_EX_free , +and +.Fn CRYPTO_EX_dup +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/CRYPTO_set_locking_callback.3 b/man/CRYPTO_set_locking_callback.3 deleted file mode 100644 index 70518c74..00000000 --- a/man/CRYPTO_set_locking_callback.3 +++ /dev/null @@ -1,380 +0,0 @@ -.\" $OpenBSD: CRYPTO_set_locking_callback.3,v 1.5 2016/11/23 16:28:23 schwarze Exp $ -.\" OpenSSL doc/crypto/threads.pod fb552ac6 Sep 30 23:43:01 2009 +0000 -.\" -.\" This file was written by Ulf Moeller , -.\" Richard Levitte , Bodo Moeller , -.\" and Geoff Thorpe . -.\" Copyright (c) 2000, 2001, 2005, 2006, 2008, 2009 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. -.\" -.Dd $Mdocdate: November 23 2016 $ -.Dt CRYPTO_SET_LOCKING_CALLBACK 3 -.Os -.Sh NAME -.Nm CRYPTO_THREADID_set_numeric , -.Nm CRYPTO_THREADID_set_pointer , -.Nm CRYPTO_THREADID_set_callback , -.Nm CRYPTO_THREADID_get_callback , -.Nm CRYPTO_THREADID_current , -.Nm CRYPTO_THREADID_cmp , -.Nm CRYPTO_THREADID_cpy , -.Nm CRYPTO_THREADID_hash , -.Nm CRYPTO_num_locks , -.Nm CRYPTO_set_dynlock_create_callback , -.Nm CRYPTO_set_dynlock_lock_callback , -.Nm CRYPTO_set_dynlock_destroy_callback , -.Nm CRYPTO_get_new_dynlockid , -.Nm CRYPTO_destroy_dynlockid , -.Nm CRYPTO_lock , -.Nm CRYPTO_w_lock , -.Nm CRYPTO_w_unlock , -.Nm CRYPTO_r_lock , -.Nm CRYPTO_r_unlock , -.Nm CRYPTO_add -.Nd OpenSSL thread support -.Sh SYNOPSIS -.In openssl/crypto.h -.Bd -literal -/* Don't use this structure directly. */ -typedef struct crypto_threadid_st { - void *ptr; - unsigned long val; -} CRYPTO_THREADID; -/* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ -.Ed -.Pp -.Ft void -.Fo CRYPTO_THREADID_set_numeric -.Fa "CRYPTO_THREADID *id" -.Fa "unsigned long val" -.Fc -.Ft void -.Fo CRYPTO_THREADID_set_pointer -.Fa "CRYPTO_THREADID *id" -.Fa "void *ptr" -.Fc -.Ft int -.Fo CRYPTO_THREADID_set_callback -.Fa "void (*threadid_func)(CRYPTO_THREADID *)" -.Fc -.Ft void -.Fo "(*CRYPTO_THREADID_get_callback(void))" -.Fa "CRYPTO_THREADID *" -.Fc -.Ft void -.Fo CRYPTO_THREADID_current -.Fa "CRYPTO_THREADID *id" -.Fc -.Ft int -.Fo CRYPTO_THREADID_cmp -.Fa "const CRYPTO_THREADID *a" -.Fa "const CRYPTO_THREADID *b" -.Fc -.Ft void -.Fo CRYPTO_THREADID_cpy -.Fa "CRYPTO_THREADID *dest" -.Fa "const CRYPTO_THREADID *src" -.Fc -.Ft unsigned long -.Fo CRYPTO_THREADID_hash -.Fa "const CRYPTO_THREADID *id" -.Fc -.Ft int -.Fo CRYPTO_num_locks -.Fa void -.Fc -.Bd -literal -/* struct CRYPTO_dynlock_value needs to be defined by the user */ -struct CRYPTO_dynlock_value; -.Ed -.Pp -.Ft void -.Fo CRYPTO_set_dynlock_create_callback -.Fa "struct CRYPTO_dynlock_value *" -.Fa "(*dyn_create_function)(char *file, int line)" -.Fc -.Ft void -.Fo CRYPTO_set_dynlock_lock_callback -.Fa "void (*dyn_lock_function)(int mode, struct CRYPTO_dynlock_value *l,\ - const char *file, int line)" -.Fc -.Ft void -.Fo CRYPTO_set_dynlock_destroy_callback -.Fa "void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l,\ - const char *file, int line)" -.Fc -.Ft int -.Fo CRYPTO_get_new_dynlockid -.Fa void -.Fc -.Ft void -.Fo CRYPTO_destroy_dynlockid -.Fa "int i" -.Fc -.Ft void -.Fo CRYPTO_lock -.Fa "int mode" -.Fa "int n" -.Fa "const char *file" -.Fa "int line" -.Fc -.Bd -literal -#define CRYPTO_w_lock(type) \e - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE, type, __FILE__, __LINE__) -#define CRYPTO_w_unlock(type) \e - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE, type, __FILE__, __LINE__) -#define CRYPTO_r_lock(type) \e - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ, type, __FILE__, __LINE__) -#define CRYPTO_r_unlock(type) \e - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ, type, __FILE__, __LINE__) -#define CRYPTO_add(addr,amount,type) \e - CRYPTO_add_lock(addr, amount, type, __FILE__, __LINE__) -.Ed -.Sh DESCRIPTION -OpenSSL can safely be used in multi-threaded applications provided that -at least two callback functions are set, -.Fn locking_function -and -.Fn threadid_func . -.Pp -.Fo locking_function -.Fa "int mode" -.Fa "int n" -.Fa "const char *file" -.Fa "int line" -.Fc -is needed to perform locking on shared data structures. -Note that OpenSSL uses a number of global data structures that will be -implicitly shared whenever multiple threads use OpenSSL. -Multi-threaded applications will crash at random if it is not set. -.Pp -.Fn locking_function -must be able to handle up to -.Fn CRYPTO_num_locks -different mutex locks. -It sets the -.Fa n Ns -th -lock if -.Fa mode -includes -.Dv CRYPTO_LOCK , -and releases it otherwise. -.Pp -.Fa file -and -.Fa line -are the file number of the function setting the lock. -They can be useful for debugging. -.Pp -.Fo threadid_func -.Fa "CRYPTO_THREADID *id" -.Fc -is needed to record the currently-executing thread's identifier into -.Fa id . -The implementation of this callback should not fill in -.Fa id -directly, but should use -.Fn CRYPTO_THREADID_set_numeric -if thread IDs are numeric, or -.Fn CRYPTO_THREADID_set_pointer -if they are pointer-based. -If the application does not register such a callback using -.Fn CRYPTO_THREADID_set_callback , -then a default implementation is used - on Windows and BeOS this uses -the system's default thread identifying APIs, and on all other platforms -it uses the address of -.Va errno . -The latter is satisfactory for thread-safety if and only if the platform -has a thread-local error number facility. -.Pp -Once -.Fn threadid_func -is registered, or if the built-in default implementation is to be used, -.Bl -bullet -.It -.Fn CRYPTO_THREADID_current -records the currently-executing thread ID into the given -.Fa id -object. -.It -.Fn CRYPTO_THREADID_cmp -compares two thread IDs (returning zero for equality, i.e. the same -semantics as -.Xr memcmp 3 ) . -.It -.Fn CRYPTO_THREADID_cpy -duplicates a thread ID value. -.It -.Fn CRYPTO_THREADID_hash -returns a numeric value usable as a hash-table key. -This is usually the exact numeric or pointer-based thread ID used -internally, however this also handles the unusual case where pointers -are larger than -.Vt long -variables and the platform's thread IDs are pointer-based \(em in -this case, mixing is done to attempt to produce a unique numeric -value even though it is not as wide as the platform's true thread -IDs. -.El -.Pp -Additionally, OpenSSL supports dynamic locks and, sometimes, some parts -of OpenSSL need it for better performance. -To enable this, the following is required: -.Bl -bullet -.It -Three additional callback functions, -.Fn dyn_create_function , -.Fn dyn_lock_function , -and -.Fn dyn_destroy_function . -.It -A structure defined with the data that each lock needs to handle. -.El -.Pp -.Vt struct CRYPTO_dynlock_value -has to be defined to contain whatever structure is needed to handle locks. -.Pp -.Fo dyn_create_function -.Fa "const char *file" -.Fa "int line" -.Fc -is needed to create a lock. -Multi-threaded applications might crash at random if it is not set. -.Pp -.Fo dyn_lock_function -.Fa "int mode" -.Fa "CRYPTO_dynlock *l" -.Fa "const char *file" -.Fa "int line" -.Fc -is needed to perform locking off dynamic lock numbered n. -Multi-threaded applications might crash at random if it is not set. -.Pp -.Fo dyn_destroy_function -.Fa "CRYPTO_dynlock *l" -.Fa "const char *file" -.Fa "int line" -.Fc -is needed to destroy the lock -.Fa l . -Multi-threaded applications might crash at random if it is not set. -.Pp -.Fn CRYPTO_get_new_dynlockid -is used to create locks. -It will call -.Fn dyn_create_function -for the actual creation. -.Pp -.Fn CRYPTO_destroy_dynlockid -is used to destroy locks. -It will call -.Fn dyn_destroy_function -for the actual destruction. -.Pp -.Fn CRYPTO_lock -is used to lock and unlock the locks. -.Fa mode -is a bitfield describing what should be done with the lock. -.Fa n -is the number of the lock as returned from -.Fn CRYPTO_get_new_dynlockid . -.Fa mode -can be combined from the following values. -These values are pairwise exclusive, with undefined behaviour if misused -(for example, -.Dv CRYPTO_READ -and -.Dv CRYPTO_WRITE -should not be used together): -.Bd -literal -offset indent -CRYPTO_LOCK 0x01 -CRYPTO_UNLOCK 0x02 -CRYPTO_READ 0x04 -CRYPTO_WRITE 0x08 -.Ed -.Pp -You can find out if OpenSSL was configured with thread support: -.Bd -literal -offset indent -#define OPENSSL_THREAD_DEFINES -#include -#if defined(OPENSSL_THREADS) - /* thread support enabled */ -#else - /* no thread support */ -#endif -.Ed -.Pp -Also, dynamic locks are currently not used internally by OpenSSL, but -may do so in the future. -.Sh RETURN VALUES -.Fn CRYPTO_num_locks -returns the required number of locks. -.Pp -.Fn CRYPTO_get_new_dynlockid -returns the index to the newly created lock. -.Pp -The other functions return no values. -.Sh EXAMPLES -.Pa crypto/threads/mttest.c -shows examples of the callback functions on Solaris, Irix and Win32. -.Sh SEE ALSO -.Xr crypto 3 -.Sh HISTORY -.Fn CRYPTO_set_locking_callback -is available in all versions of SSLeay and OpenSSL. -.Fn CRYPTO_num_locks -was added in OpenSSL 0.9.4. -All functions dealing with dynamic locks were added in OpenSSL 0.9.5b-dev. -.Vt CRYPTO_THREADID -and associated functions were introduced in OpenSSL 1.0.0 to replace -(actually, deprecate) the previous -.Fn CRYPTO_set_id_callback , -.Fn CRYPTO_get_id_callback , -and -.Fn CRYPTO_thread_id -functions which assumed thread IDs to always be represented by -.Vt unsigned long . diff --git a/man/DES_set_key.3 b/man/DES_set_key.3 index 0a9e7381..700b39a9 100644 --- a/man/DES_set_key.3 +++ b/man/DES_set_key.3 @@ -1,12 +1,13 @@ -.\" $OpenBSD: DES_set_key.3,v 1.7 2017/02/09 03:43:05 dtucker Exp $ -.\" OpenSSL c7497f34 Aug 14 10:50:26 2014 -0400 +.\" $OpenBSD: DES_set_key.3,v 1.13 2018/12/21 21:36:21 schwarze Exp $ +.\" full merge up to: +.\" OpenSSL man3/DES_random_key 521738e9 Oct 5 14:58:30 2018 -0400 .\" .\" -------------------------------------------------------------------------- .\" Major patches to this file were contributed by .\" Ulf Moeller , Ben Laurie , .\" and Richard Levitte . .\" -------------------------------------------------------------------------- -.\" Copyright (c) 2000, 2001 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2000, 2001, 2017 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 @@ -114,7 +115,7 @@ .\" copied and put under another distribution licence .\" [including the GNU Public Licence.] .\" -.Dd $Mdocdate: February 9 2017 $ +.Dd $Mdocdate: December 21 2018 $ .Dt DES_SET_KEY 3 .Os .Sh NAME @@ -456,9 +457,6 @@ sets the parity of the passed .Fa key to odd. .Pp -.Fn DES_is_weak_key -returns 1 if the passed key is a weak key or 0 if it is ok. -.Pp The following routines mostly operate on an input and output stream of .Vt DES_cblock Ns s . .Pp @@ -559,7 +557,7 @@ This is much better than CBC DES. .Pp .Fn DES_ede3_cbc_encrypt implements outer triple CBC DES encryption with three keys. -This means that each DES operation inside the CBC mode is really an +This means that each DES operation inside the CBC mode is .Qq Li C=E(ks3,D(ks2,E(ks1,M))) . This mode is used by SSL. .Pp @@ -572,13 +570,13 @@ for the final encryption. This form of Triple-DES is used by the RSAREF library. .Pp .Fn DES_pcbc_encrypt -encrypt/decrypts using the propagating cipher block chaining mode used +encrypts/decrypts using the propagating cipher block chaining mode used by Kerberos v4. Its parameters are the same as .Fn DES_ncbc_encrypt . .Pp .Fn DES_cfb_encrypt -encrypt/decrypts using cipher feedback mode. +encrypts/decrypts using cipher feedback mode. This method takes an array of characters as input and outputs an array of characters. It does not require any padding to 8 character groups. @@ -588,18 +586,18 @@ variable is changed and the new changed value needs to be passed to the next call to this function. Since this function runs a complete DES ECB encryption per .Fa numbits , -this function is only suggested for use when sending small numbers of +this function is only suggested for use when sending a small number of characters. .Pp .Fn DES_cfb64_encrypt -implements CFB mode of DES with 64bit feedback. +implements CFB mode of DES with 64-bit feedback. Why is this useful you ask? Because this routine will allow you to encrypt an arbitrary number of -bytes, no 8 byte padding. +bytes, without 8 byte padding. Each call to this routine will encrypt the input bytes to output and then update ivec and num. num contains "how far" we are though ivec. -If this does not make much sense, read more about cfb mode of DES :-). +If this does not make much sense, read more about CFB mode of DES. .Pp .Fn DES_ede3_cfb64_encrypt and @@ -617,9 +615,10 @@ Note: the .Fa ivec variable is changed and the new changed value needs to be passed to the next call to this function. -Since this function runs a complete DES ECB encryption per numbits, this -function is only suggested for use when sending small numbers of -characters. +Since this function runs a complete DES ECB encryption per +.Fa numbits , +this function is only suggested for use when sending a small number +of characters. .Pp .Fn DES_ofb64_encrypt is the same as @@ -666,12 +665,16 @@ The following are DES-based transformations: is a fast version of the Unix .Xr crypt 3 function. +The +.Fa salt +must be two ASCII characters. +This version is different from the normal crypt in that the third +parameter is the buffer that the return value is written into. +It needs to be at least 14 bytes long. +The fourteenth byte is set to NUL. This version takes only a small amount of space relative to other fast crypt implementations. -This is different to the normal crypt in that the third parameter is the -buffer that the return value is written into. -It needs to be at least 14 bytes long. -This function is thread safe, unlike the normal crypt. +It is thread safe, unlike the normal crypt. .Pp .Fn DES_crypt is a faster replacement for the normal system @@ -746,6 +749,31 @@ If set to If set to .Dv DES_CBC_MODE DES_cbc_encrypt is used. +.Sh RETURN VALUES +.Fn DES_set_key , +.Fn DES_key_sched , +and +.Fn DES_set_key_checked +return 0 on success or a negative value on error. +.Pp +.Fn DES_is_weak_key +returns 1 if the passed key is a weak key or 0 if it is ok. +.Pp +.Fn DES_cbc_cksum +and +.Fn DES_quad_cksum +return a 4-byte integer representing the last 4 bytes of the checksum +of the input. +.Pp +.Fn DES_fcrypt +returns a pointer to the caller-provided buffer +.Fa ret , +and +.Fn DES_crypt +returns a pointer to a static buffer. +Both are allowed to return +.Dv NULL +to indicate failure, but currently, they cannot fail. .Sh SEE ALSO .Xr crypt 3 , .Xr RAND_bytes 3 @@ -759,26 +787,59 @@ ANSI X3.106 The DES library was initially written to be source code compatible with the MIT Kerberos library. .Sh HISTORY -In OpenSSL 0.9.7, all des_ functions were renamed to DES_ to avoid -clashes with older versions of libdes. +.Fn DES_random_key , +.Fn DES_set_key , +.Fn DES_key_sched , +.Fn DES_set_odd_parity , +.Fn DES_is_weak_key , +.Fn DES_ecb_encrypt , +.Fn DES_cfb_encrypt , +.Fn DES_ofb_encrypt , +.Fn DES_pcbc_encrypt , +.Fn DES_cfb64_encrypt , +.Fn DES_ofb64_encrypt , +.Fn DES_ede3_cbc_encrypt , +.Fn DES_cbc_cksum , +.Fn DES_quad_cksum , +.Fn DES_string_to_key , +.Fn DES_string_to_2keys , +.Fn DES_crypt , +.Fn DES_enc_read , +and +.Fn DES_enc_write +appeared in SSLeay 0.4 or earlier. +.Fn DES_ncbc_encrypt +first appeared in SSLeay 0.4.2. +.Fn DES_ede2_cbc_encrypt +first appeared in SSLeay 0.4.4. +.Fn DES_ecb2_encrypt , +.Fn DES_ecb3_encrypt , +.Fn DES_ede2_cfb64_encrypt , +.Fn DES_ede2_ofb64_encrypt , +.Fn DES_ede3_cfb64_encrypt , +and +.Fn DES_ede3_ofb64_encrypt +first appeared in SSLeay 0.5.1. +.Fn DES_xcbc_encrypt +first appeared in SSLeay 0.6.2. +.Fn DES_fcrypt +first appeared in SSLeay 0.6.5. +These functions have been available since +.Ox 2.4 . .Pp .Fn DES_set_key_checked and .Fn DES_set_key_unchecked -were added in OpenSSL 0.9.5. -.Pp -.Fn des_generate_random_block , -.Fn des_init_random_number_generator , -.Fn des_new_random_key , -.Fn des_set_random_generator_seed , -.Fn des_set_sequence_number , -and -.Fn des_rand_data 3 -are used in newer versions of Kerberos but are not implemented here. -.Pp -.Fn DES_random_key -generated cryptographically weak random data in SSLeay and in OpenSSL -prior version 0.9.5, as well as in the original MIT library. +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +In OpenSSL 0.9.7 and +.Ox 3.2 , +all +.Sy des_ +functions were renamed to +.Sy DES_ +to avoid clashes with older versions of libdes. .Sh AUTHORS .An Eric Young Aq Mt eay@cryptsoft.com .Sh CAVEATS diff --git a/man/DH_generate_key.3 b/man/DH_generate_key.3 index 870cfdef..2c44cf98 100644 --- a/man/DH_generate_key.3 +++ b/man/DH_generate_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DH_generate_key.3,v 1.6 2016/12/10 22:22:59 schwarze Exp $ +.\" $OpenBSD: DH_generate_key.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt DH_GENERATE_KEY 3 .Os .Sh NAME @@ -110,6 +110,7 @@ returns the size of the shared secret on success, or -1 on error. The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO +.Xr DH_get0_key 3 , .Xr DH_new 3 , .Xr DH_size 3 , .Xr ERR_get_error 3 , @@ -118,4 +119,5 @@ The error codes can be obtained by .Fn DH_generate_key and .Fn DH_compute_key -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . diff --git a/man/DH_generate_parameters.3 b/man/DH_generate_parameters.3 index a13699d0..190ff098 100644 --- a/man/DH_generate_parameters.3 +++ b/man/DH_generate_parameters.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DH_generate_parameters.3,v 1.7 2017/06/10 13:10:52 schwarze Exp $ +.\" $OpenBSD: DH_generate_parameters.3,v 1.11 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: June 10 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt DH_GENERATE_PARAMETERS 3 .Os .Sh NAME @@ -146,12 +146,17 @@ if the parameter generation fails. The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO +.Xr DH_get0_pqg 3 , .Xr DH_new 3 , .Xr ERR_get_error 3 , .Xr RAND_bytes 3 .Sh HISTORY .Fn DH_check -is available in all versions of SSLeay and OpenSSL. +and +.Fn DH_generate_parameters +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp The .Fa cb_arg argument to @@ -162,6 +167,10 @@ In versions before OpenSSL 0.9.5, .Dv DH_CHECK_P_NOT_STRONG_PRIME is used instead of .Dv DH_CHECK_P_NOT_SAFE_PRIME . +.Pp +.Fn DH_generate_parameters_ex +first appeared in OpenSSL 0.9.8 and has been available since +.Ox 4.5 . .Sh CAVEATS .Fn DH_generate_parameters_ex and diff --git a/man/DH_get0_pqg.3 b/man/DH_get0_pqg.3 new file mode 100644 index 00000000..5a115b71 --- /dev/null +++ b/man/DH_get0_pqg.3 @@ -0,0 +1,273 @@ +.\" $OpenBSD: DH_get0_pqg.3,v 1.5 2018/12/21 21:54:48 schwarze Exp $ +.\" selective merge up to: OpenSSL 83cf7abf May 29 13:07:08 2018 +0100 +.\" +.\" This file was written by Matt Caswell . +.\" Copyright (c) 2016, 2018 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. +.\" +.Dd $Mdocdate: December 21 2018 $ +.Dt DH_GET0_PQG 3 +.Os +.Sh NAME +.Nm DH_get0_pqg , +.Nm DH_set0_pqg , +.Nm DH_get0_key , +.Nm DH_set0_key , +.Nm DH_clear_flags , +.Nm DH_test_flags , +.Nm DH_set_flags , +.Nm DH_get0_engine , +.Nm DH_set_length +.Nd get data from and set data in a DH object +.Sh SYNOPSIS +.In openssl/dh.h +.Ft void +.Fo DH_get0_pqg +.Fa "const DH *dh" +.Fa "const BIGNUM **p" +.Fa "const BIGNUM **q" +.Fa "const BIGNUM **g" +.Fc +.Ft int +.Fo DH_set0_pqg +.Fa "DH *dh" +.Fa "BIGNUM *p" +.Fa "BIGNUM *q" +.Fa "BIGNUM *g" +.Fc +.Ft void +.Fo DH_get0_key +.Fa "const DH *dh" +.Fa "const BIGNUM **pub_key" +.Fa "const BIGNUM **priv_key" +.Fc +.Ft int +.Fo DH_set0_key +.Fa "DH *dh" +.Fa "BIGNUM *pub_key" +.Fa "BIGNUM *priv_key" +.Fc +.Ft void +.Fo DH_clear_flags +.Fa "DH *dh" +.Fa "int flags" +.Fc +.Ft int +.Fo DH_test_flags +.Fa "const DH *dh" +.Fa "int flags" +.Fc +.Ft void +.Fo DH_set_flags +.Fa "DH *dh" +.Fa "int flags" +.Fc +.Ft ENGINE * +.Fo DH_get0_engine +.Fa "DH *d" +.Fc +.Ft int +.Fo DH_set_length +.Fa "DH *dh" +.Fa "long length" +.Fc +.Sh DESCRIPTION +A +.Vt DH +object contains the parameters +.Fa p , +.Fa g , +and optionally +.Fa q . +It also contains a public key +.Fa pub_key +and an optional private key +.Fa priv_key . +.Pp +The +.Fa p , +.Fa q , +and +.Fa g +parameters can be obtained by calling +.Fn DH_get0_pqg . +If the parameters have not yet been set, then +.Pf * Fa p , +.Pf * Fa q , +and +.Pf * Fa g +are set to +.Dv NULL . +Otherwise, they are set to pointers to the internal representations +of the values that should not be freed by the application. +Any of the out parameters +.Fa p , +.Fa q , +and +.Fa g +can be +.Dv NULL , +in which case no value is returned for that parameter. +.Pp +The +.Fa p , +.Fa q , +and +.Fa g +values can be set by calling +.Fn DH_set0_pqg . +Calling this function transfers the memory management of the values to +.Fa dh , +and therefore they should not be freed by the caller. +The +.Fa q +argument may be +.Dv NULL . +.Pp +The +.Fn DH_get0_key +function stores pointers to the internal representations +of the public key in +.Pf * Fa pub_key +and to the private key in +.Pf * Fa priv_key . +Either may be +.Dv NULL +if it has not yet been set. +If the private key has been set, then the public key must be. +Any of the out parameters +.Fa pub_key +and +.Fa priv_key +can be +.Dv NULL , +in which case no value is returned for that parameter. +.Pp +The public and private key values can be set using +.Fn DH_set0_key . +Either parameter may be +.Dv NULL , +which means the corresponding +.Vt DH +field is left untouched. +This function transfers the memory management of the key values to +.Fa dh , +and therefore they should not be freed by the caller. +.Pp +Values retrieved with +.Fn DH_get0_pqg +and +.Fn DH_get0_key +are owned by the +.Vt DH +object and may therefore not be passed to +.Fn DH_set0_pqg +or +.Fn DH_set0_key . +If needed, duplicate the received values using +.Xr BN_dup 3 +and pass the duplicates. +.Pp +.Fn DH_clear_flags +clears the specified +.Fa flags +in +.Fa dh . +.Fn DH_test_flags +tests the +.Fa flags +in +.Fa dh . +.Fn DH_set_flags +sets the +.Fa flags +in +.Fa dh ; +any flags already set remain set. +For all three functions, multiple flags can be passed in one call, +OR'ed together bitwise. +.Pp +.Fn DH_set_length +sets the optional length attribute of +.Fa dh , +indicating the length of the secret exponent (private key) in bits. +If the length attribute is non-zero, it is used, otherwise it is ignored. +.Sh RETURN VALUES +.Fn DH_set0_pqg , +.Fn DH_set0_key , +and +.Fn DH_set_length +return 1 on success or 0 on failure. +.Pp +.Fn DH_test_flags +return those of the given +.Fa flags +currently set in +.Fa dh +or 0 if none of the given +.Fa flags +are set. +.Pp +.Fn DH_get0_engine +returns a pointer to the +.Vt ENGINE +used by the +.Vt DH +object +.Fa dh , +or +.Dv NULL +if no engine was set for this object. +.Sh SEE ALSO +.Xr DH_generate_key 3 , +.Xr DH_generate_parameters 3 , +.Xr DH_new 3 , +.Xr DH_size 3 , +.Xr DHparams_print 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0 +and have been available since +.Ox 6.3 . diff --git a/man/DH_get_ex_new_index.3 b/man/DH_get_ex_new_index.3 index 7f3f0e77..81a0aff8 100644 --- a/man/DH_get_ex_new_index.3 +++ b/man/DH_get_ex_new_index.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DH_get_ex_new_index.3,v 1.4 2016/12/10 22:22:59 schwarze Exp $ +.\" $OpenBSD: DH_get_ex_new_index.3,v 1.5 2018/03/23 23:18:17 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt DH_GET_EX_NEW_INDEX 3 .Os .Sh NAME @@ -94,4 +94,6 @@ and .Fn DH_set_ex_data , and .Fn DH_get_ex_data -are available since OpenSSL 0.9.5. +first appeared in OpenSSL 0.9.5 +and have been available since +.Ox 2.7 . diff --git a/man/DH_new.3 b/man/DH_new.3 index 28f1888c..3208e767 100644 --- a/man/DH_new.3 +++ b/man/DH_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DH_new.3,v 1.4 2016/12/10 22:30:54 schwarze Exp $ +.\" $OpenBSD: DH_new.3,v 1.8 2018/04/18 01:11:45 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,17 +48,22 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: April 18 2018 $ .Dt DH_NEW 3 .Os .Sh NAME .Nm DH_new , +.Nm DH_up_ref , .Nm DH_free .Nd allocate and free DH objects .Sh SYNOPSIS .In openssl/dh.h .Ft DH* .Fn DH_new void +.Ft int +.Fo DH_up_ref +.Fa "DH *dh" +.Fc .Ft void .Fo DH_free .Fa "DH *dh" @@ -69,10 +74,19 @@ The DH functions implement the Diffie-Hellman key agreement protocol. .Fn DH_new allocates and initializes a .Vt DH -structure. +structure, setting the reference count to 1. +It is equivalent to +.Xr DH_new_method 3 +with a +.Dv NULL +argument. +.Pp +.Fn DH_up_ref +increments the reference count by 1. .Pp .Fn DH_free -frees the +decrements the reference count by 1. +If it reaches 0, it frees the .Vt DH structure and its components. The values are erased before the memory is returned to the system. @@ -89,19 +103,29 @@ returns and sets an error code that can be obtained by .Xr ERR_get_error 3 . Otherwise it returns a pointer to the newly allocated structure. +.Pp +.Fn DH_up_ref +returns 1 for success or 0 for failure. .Sh SEE ALSO .Xr BN_new 3 , .Xr d2i_DHparams 3 , .Xr DH_generate_key 3 , .Xr DH_generate_parameters 3 , +.Xr DH_get0_pqg 3 , .Xr DH_get_ex_new_index 3 , .Xr DH_set_method 3 , .Xr DH_size 3 , .Xr DHparams_print 3 , .Xr DSA_dup_DH 3 , -.Xr ERR_get_error 3 +.Xr ERR_get_error 3 , +.Xr EVP_PKEY_set1_DH 3 .Sh HISTORY .Fn DH_new and .Fn DH_free -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp +.Fn DH_up_ref +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . diff --git a/man/DH_set_method.3 b/man/DH_set_method.3 index 31d9b54c..9863cbac 100644 --- a/man/DH_set_method.3 +++ b/man/DH_set_method.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DH_set_method.3,v 1.5 2016/12/10 22:22:59 schwarze Exp $ +.\" $OpenBSD: DH_set_method.3,v 1.7 2018/04/18 01:09:01 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: April 18 2018 $ .Dt DH_SET_METHOD 3 .Os .Sh NAME @@ -84,53 +84,44 @@ .Sh DESCRIPTION A .Vt DH_METHOD -specifies the functions that OpenSSL uses for Diffie-Hellman operations. -By modifying the method, alternative implementations such as hardware -accelerators may be used. -See the -.Sx CAVEATS -section for how these DH API functions are affected by the use of -.Xr engine 3 -API calls. -.Pp -Initially, the default -.Vt DH_METHOD -is the OpenSSL internal implementation as returned by -.Fn DH_OpenSSL . +object contains pointers to the functions +used for Diffie-Hellman operations. +By default, the internal implementation returned by +.Fn DH_OpenSSL +is used. +By selecting another method, alternative implementations +such as hardware accelerators may be used. .Pp .Fn DH_set_default_method -makes +selects .Fa meth -the default method for all +as the default method for all .Vt DH structures created later. -.Sy NB : -This is true only whilst no +If any .Vt ENGINE -has been set as a default for DH, so this function is no longer -recommended. +was registered with +.Xr ENGINE_register_DH 3 +that can be successfully initialized, it overrides the default. .Pp .Fn DH_get_default_method -returns a pointer to the current default -.Vt DH_METHOD . -However, the meaningfulness of this result is dependent on whether the -.Xr engine 3 -API is being used, so this function is no longer recommended. +returns a pointer to the current default method, +even if it is actually overridded by an +.Vt ENGINE . .Pp .Fn DH_set_method selects .Fa meth to perform all operations using the key .Fa dh . -This will replace the +This replaces the .Vt DH_METHOD used by the .Fa dh key and if the previous method was supplied by an .Vt ENGINE , -the handle to that -.Vt ENGINE -will be released during the change. +.Xr ENGINE_finish 3 +is called on it. It is possible to have .Vt DH keys that only work with certain @@ -147,18 +138,16 @@ allocates and initializes a .Vt DH structure so that .Fa engine -will be used for the DH operations. +is used for the DH operations. If .Fa engine is .Dv NULL , -the default -.Vt ENGINE -for DH operations is used and, if no default -.Vt ENGINE -is set, the -.Vt DH_METHOD -controlled by +.Xr ENGINE_get_default_DH 3 +is used. +If that returns +.Dv NULL , +the default method controlled by .Fn DH_set_default_method is used. .Pp @@ -199,17 +188,11 @@ typedef struct dh_meth_st and .Fn DH_get_default_method return pointers to the respective -.Sy DH_METHOD Ns s. +.Vt DH_METHOD . .Pp .Fn DH_set_method -returns non-zero if the provided -.Fa meth -was successfully set as the method for -.Fa dh -(including unloading the -.Vt ENGINE -handle if the previous method was supplied by an -.Vt ENGINE ) . +returns 1 on success or 0 on failure. +Currently, it cannot fail. .Pp .Fn DH_new_method returns @@ -219,7 +202,10 @@ and sets an error code that can be obtained by if the allocation fails. Otherwise it returns a pointer to the newly allocated structure. .Sh SEE ALSO -.Xr DH_new 3 +.Xr DH_new 3 , +.Xr ENGINE_get_default_DH 3 , +.Xr ENGINE_register_DH 3 , +.Xr ENGINE_set_default_DH 3 .Sh HISTORY .Fn DH_set_default_method , .Fn DH_get_default_method , @@ -227,21 +213,5 @@ Otherwise it returns a pointer to the newly allocated structure. .Fn DH_new_method and .Fn DH_OpenSSL -were added in OpenSSL 0.9.4. -.Sh CAVEATS -As of version 0.9.7, -.Vt DH_METHOD -implementations are grouped together with other algorithmic APIs -(e.g. RSA_METHOD, EVP_CIPHER) in -.Vt ENGINE -modules. -If a default -.Vt ENGINE -is specified for DH functionality using an -.Xr engine 3 -API function, that will override any DH defaults set using the DH API -.Pq i.e. Fn DH_set_default_method . -For this reason, the -.Xr engine 3 -API is the recommended way to control default implementations -for use in DH and other cryptographic algorithms. +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/DH_size.3 b/man/DH_size.3 index ea590357..be1f5099 100644 --- a/man/DH_size.3 +++ b/man/DH_size.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: DH_size.3,v 1.4 2016/12/10 22:22:59 schwarze Exp $ -.\" OpenSSL 4d524e10 Feb 24 11:55:57 2000 +0000 +.\" $OpenBSD: DH_size.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" -.\" This file was written by Ulf Moeller . -.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved. +.\" This file was written by Ulf Moeller +.\" and Kurt Roeckx . +.\" Copyright (c) 2000, 2015 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 @@ -48,35 +49,48 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt DH_SIZE 3 .Os .Sh NAME -.Nm DH_size +.Nm DH_size , +.Nm DH_bits .Nd get Diffie-Hellman prime size .Sh SYNOPSIS .In openssl/dh.h .Ft int .Fo DH_size -.Fa "DH *dh" +.Fa "const DH *dh" +.Fc +.Ft int +.Fo DH_bits +.Fa "const DH *dh" .Fc .Sh DESCRIPTION -This function returns the Diffie-Hellman size in bytes. +.Fn DH_size +returns the Diffie-Hellman prime size in bytes. It can be used to determine how much memory must be allocated for the shared secret computed by .Xr DH_compute_key 3 . .Pp +.Fn DH_bits +returns the number of significant bits in the key. +.Pp .Fa dh and .Fa dh->p must not be .Dv NULL . -.Sh RETURN VALUES -The size in bytes. .Sh SEE ALSO .Xr BN_num_bytes 3 , .Xr DH_generate_key 3 , +.Xr DH_get0_key 3 , .Xr DH_new 3 .Sh HISTORY .Fn DH_size -is available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and has been available since +.Ox 2.4 . +.Pp +.Fn DH_bits +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/DIST_POINT_new.3 b/man/DIST_POINT_new.3 index bbd4855e..f97b6d5b 100644 --- a/man/DIST_POINT_new.3 +++ b/man/DIST_POINT_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DIST_POINT_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: DIST_POINT_new.3,v 1.4 2018/03/23 04:34:23 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt DIST_POINT_NEW 3 .Os .Sh NAME @@ -135,3 +135,19 @@ section 4.2.1.13: CRL Distribution Points .It section 5.2.5: Issuing Distribution Point .El +.Sh HISTORY +.Fn DIST_POINT_new , +.Fn DIST_POINT_free , +.Fn CRL_DIST_POINTS_new , +.Fn CRL_DIST_POINTS_free , +.Fn DIST_POINT_NAME_new , +and +.Fn DIST_POINT_NAME_free +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . +.Pp +.Fn ISSUING_DIST_POINT_new +and +.Fn ISSUING_DIST_POINT_free +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/DSA_SIG_new.3 b/man/DSA_SIG_new.3 index 4b114f4a..33f2586b 100644 --- a/man/DSA_SIG_new.3 +++ b/man/DSA_SIG_new.3 @@ -1,8 +1,10 @@ -.\" $OpenBSD: DSA_SIG_new.3,v 1.4 2016/12/10 22:47:49 schwarze Exp $ -.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 +.\" $OpenBSD: DSA_SIG_new.3,v 1.7 2018/03/23 23:18:17 schwarze Exp $ +.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" -.\" This file was written by Ulf Moeller . -.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved. +.\" This file was written by Ulf Moeller , +.\" Dr. Stephen Henson , and +.\" TJ Saunders . +.\" Copyright (c) 2000, 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 @@ -48,24 +50,38 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt DSA_SIG_NEW 3 .Os .Sh NAME .Nm DSA_SIG_new , -.Nm DSA_SIG_free -.Nd allocate and free DSA signature objects +.Nm DSA_SIG_free , +.Nm DSA_SIG_get0 , +.Nm DSA_SIG_set0 +.Nd manipulate DSA signature objects .Sh SYNOPSIS .In openssl/dsa.h .Ft DSA_SIG * .Fn DSA_SIG_new void .Ft void .Fo DSA_SIG_free -.Fa "DSA_SIG *a" +.Fa "DSA_SIG *sig" +.Fc +.Ft void +.Fo DSA_SIG_get0 +.Fa "const DSA_SIG *sig" +.Fa "const BIGNUM **r" +.Fa "const BIGNUM **s" +.Fc +.Ft int +.Fo DSA_SIG_set0 +.Fa "DSA_SIG *sig" +.Fa "BIGNUM *r" +.Fa "BIGNUM *s" .Fc .Sh DESCRIPTION .Fn DSA_SIG_new -allocates and initializes a +allocates an empty .Vt DSA_SIG structure. .Pp @@ -75,10 +91,28 @@ frees the structure and its components. The values are erased before the memory is returned to the system. If -.Fa a +.Fa sig is a .Dv NULL pointer, no action occurs. +.Pp +.Fn DSA_SIG_get0 +retrieves internal pointers to the +.Fa r +and +.Fa s +values contained in +.Fa sig . +.Pp +The +.Fa r +and +.Fa s +values can be set by calling +.Fn DSA_SIG_set0 . +Calling this function transfers the memory management of the values to +.Fa sig , +and therefore they should not be freed by the caller. .Sh RETURN VALUES If the allocation fails, .Fn DSA_SIG_new @@ -87,6 +121,9 @@ returns and sets an error code that can be obtained by .Xr ERR_get_error 3 . Otherwise it returns a pointer to the newly allocated structure. +.Pp +.Fn DSA_SIG_set0 +returns 1 on success or 0 on failure. .Sh SEE ALSO .Xr DSA_do_sign 3 , .Xr DSA_new 3 , @@ -95,4 +132,11 @@ Otherwise it returns a pointer to the newly allocated structure. .Fn DSA_SIG_new and .Fn DSA_SIG_free -were added in OpenSSL 0.9.3. +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . +.Pp +.Fn DSA_SIG_get0 +and +.Fn DSA_SIG_set0 +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . diff --git a/man/DSA_do_sign.3 b/man/DSA_do_sign.3 index c229c2b6..454cb444 100644 --- a/man/DSA_do_sign.3 +++ b/man/DSA_do_sign.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_do_sign.3,v 1.5 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_do_sign.3,v 1.8 2018/03/21 17:57:48 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt DSA_DO_SIGN 3 .Os .Sh NAME @@ -106,6 +106,8 @@ and -1 on error. The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO +.Xr DSA_get0_key 3 , +.Xr DSA_meth_set_sign 3 , .Xr DSA_new 3 , .Xr DSA_SIG_new 3 , .Xr DSA_sign 3 , @@ -115,4 +117,5 @@ The error codes can be obtained by .Fn DSA_do_sign and .Fn DSA_do_verify -were added in OpenSSL 0.9.3. +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . diff --git a/man/DSA_dup_DH.3 b/man/DSA_dup_DH.3 index a1a67640..a7b4f3ec 100644 --- a/man/DSA_dup_DH.3 +++ b/man/DSA_dup_DH.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_dup_DH.3,v 1.5 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_dup_DH.3,v 1.7 2018/03/21 21:18:08 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt DSA_DUP_DH 3 .Os .Sh NAME @@ -82,10 +82,12 @@ The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr DH_new 3 , +.Xr DSA_get0_pqg 3 , .Xr DSA_new 3 , .Xr ERR_get_error 3 .Sh HISTORY .Fn DSA_dup_DH -was added in OpenSSL 0.9.4. +first appeared in OpenSSL 0.9.4 and has been available since +.Ox 2.6 . .Sh CAVEATS Be careful to avoid small subgroup attacks when using this. diff --git a/man/DSA_generate_key.3 b/man/DSA_generate_key.3 index f9a1681c..9e565e05 100644 --- a/man/DSA_generate_key.3 +++ b/man/DSA_generate_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_generate_key.3,v 1.5 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_generate_key.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt DSA_GENERATE_KEY 3 .Os .Sh NAME @@ -76,9 +76,11 @@ The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr DSA_generate_parameters 3 , +.Xr DSA_get0_key 3 , .Xr DSA_new 3 , .Xr ERR_get_error 3 , .Xr RAND_bytes 3 .Sh HISTORY .Fn DSA_generate_key -is available since SSLeay 0.8. +first appeared in SSLeay 0.6.0 and has been available since +.Ox 2.4 . diff --git a/man/DSA_generate_parameters.3 b/man/DSA_generate_parameters.3 index e6e6d90d..d942f7b3 100644 --- a/man/DSA_generate_parameters.3 +++ b/man/DSA_generate_parameters.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_generate_parameters.3,v 1.5 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_generate_parameters.3,v 1.10 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 9b86974e Aug 7 22:14:47 2015 -0400 .\" .\" This file was written by Ulf Moeller , @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt DSA_GENERATE_PARAMETERS 3 .Os .Sh NAME @@ -198,15 +198,18 @@ The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr BN_generate_prime 3 , +.Xr DSA_get0_pqg 3 , .Xr DSA_new 3 , .Xr ERR_get_error 3 , .Xr RAND_bytes 3 .Sh HISTORY .Fn DSA_generate_parameters -appeared in SSLeay 0.8. -The +first appeared in SSLeay 0.8.0 and had its .Fa cb_arg -argument was added in SSLeay 0.9.0. +argument added in SSLeay 0.9.0. +It has been available since +.Ox 2.4 . +.Pp In versions up to OpenSSL 0.9.4, .Fn callback 1 ...\& was called in the inner loop of the Miller-Rabin test whenever it @@ -217,5 +220,9 @@ did not reveal how many witnesses had been tested); since OpenSSL 0.9.5, is called as in .Xr BN_is_prime 3 , i.e. once for each witness. +.Pp +.Fn DSA_generate_parameters_ex +first appeared in OpenSSL 0.9.8 and has been available since +.Ox 4.5 . .Sh BUGS Seed lengths > 20 are not supported. diff --git a/man/DSA_get0_pqg.3 b/man/DSA_get0_pqg.3 new file mode 100644 index 00000000..56d57066 --- /dev/null +++ b/man/DSA_get0_pqg.3 @@ -0,0 +1,252 @@ +.\" $OpenBSD: DSA_get0_pqg.3,v 1.4 2018/03/23 23:18:17 schwarze Exp $ +.\" full merge up to: OpenSSL e90fc053 Jul 15 09:39:45 2017 -0400 +.\" +.\" This file was written by Matt Caswell . +.\" Copyright (c) 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. +.\" +.Dd $Mdocdate: March 23 2018 $ +.Dt DSA_GET0_PQG 3 +.Os +.Sh NAME +.Nm DSA_get0_pqg , +.Nm DSA_set0_pqg , +.Nm DSA_get0_key , +.Nm DSA_set0_key , +.Nm DSA_clear_flags , +.Nm DSA_test_flags , +.Nm DSA_set_flags , +.Nm DSA_get0_engine +.Nd get data from and set data in a DSA object +.Sh SYNOPSIS +.In openssl/dsa.h +.Ft void +.Fo DSA_get0_pqg +.Fa "const DSA *d" +.Fa "const BIGNUM **p" +.Fa "const BIGNUM **q" +.Fa "const BIGNUM **g" +.Fc +.Ft int +.Fo DSA_set0_pqg +.Fa "DSA *d" +.Fa "BIGNUM *p" +.Fa "BIGNUM *q" +.Fa "BIGNUM *g" +.Fc +.Ft void +.Fo DSA_get0_key +.Fa "const DSA *d" +.Fa "const BIGNUM **pub_key" +.Fa "const BIGNUM **priv_key" +.Fc +.Ft int +.Fo DSA_set0_key +.Fa "DSA *d" +.Fa "BIGNUM *pub_key" +.Fa "BIGNUM *priv_key" +.Fc +.Ft void +.Fo DSA_clear_flags +.Fa "DSA *d" +.Fa "int flags" +.Fc +.Ft int +.Fo DSA_test_flags +.Fa "const DSA *d" +.Fa "int flags" +.Fc +.Ft void +.Fo DSA_set_flags +.Fa "DSA *d" +.Fa "int flags" +.Fc +.Ft ENGINE * +.Fo DSA_get0_engine +.Fa "DSA *d" +.Fc +.Sh DESCRIPTION +A +.Vt DSA +object contains the parameters +.Fa p , +.Fa q , +and +.Fa g . +It also contains a public key +.Fa pub_key +and an optional private key +.Fa priv_key . +.Pp +The +.Fa p , +.Fa q , +and +.Fa g +parameters can be obtained by calling +.Fn DSA_get0_pqg . +If the parameters have not yet been set, then +.Pf * Fa p , +.Pf * Fa q , +and +.Pf * Fa g +are set to +.Dv NULL . +Otherwise, they are set to pointers to the internal representations +of the values that should not be freed by the application. +.Pp +The +.Fa p , +.Fa q , +and +.Fa g +values can be set by calling +.Fn DSA_set0_pqg . +Calling this function transfers the memory management of the values to +.Fa d , +and therefore they should not be freed by the caller. +.Pp +The +.Fn DSA_get0_key +function stores pointers to the internal representations +of the public key in +.Pf * Fa pub_key +and to the private key in +.Pf * Fa priv_key . +Either may be +.Dv NULL +if it has not yet been set. +If the private key has been set, then the public key must be. +.Pp +The public and private key values can be set using +.Fn DSA_set0_key . +The public key must be +.Pf non- Dv NULL +the first time this function is called on a given +.Vt DSA +object. +The private key may be +.Dv NULL . +On subsequent calls, either may be +.Dv NULL , +which means the corresponding +.Vt DSA +field is left untouched. +.Fn DSA_set0_key +transfers the memory management of the key values to +.Fa d , +and therefore they should not be freed by the caller. +.Pp +Values retrieved with +.Fn DSA_get0_pqg +and +.Fn DSA_get0_key +are owned by the +.Vt DSA +object and may therefore not be passed to +.Fn DSA_set0_pqg +or +.Fn DSA_set0_key . +If needed, duplicate the received values using +.Xr BN_dup 3 +and pass the duplicates. +.Pp +.Fn DSA_clear_flags +clears the specified +.Fa flags +in +.Fa d . +.Fn DSA_test_flags +tests the +.Fa flags +in +.Fa d . +.Fn DSA_set_flags +sets the +.Fa flags +in +.Fa d ; +any flags already set remain set. +For all three functions, multiple flags can be passed in one call, +OR'ed together bitwise. +.Sh RETURN VALUES +.Fn DSA_set0_pqg +and +.Fn DSA_set0_key +return 1 on success or 0 on failure. +.Pp +.Fn DSA_test_flags +returns those of the given +.Fa flags +currently set in +.Fa d +or 0 if none of the given +.Fa flags +are set. +.Pp +.Fn DSA_get0_engine +returns a pointer to the +.Vt ENGINE +used by the +.Vt DSA +object +Fa d , +or +.Dv NULL +if no engine was set for this object. +.Sh SEE ALSO +.Xr DSA_do_sign 3 , +.Xr DSA_dup_DH 3 , +.Xr DSA_generate_key 3 , +.Xr DSA_generate_parameters 3 , +.Xr DSA_new 3 , +.Xr DSA_print 3 , +.Xr DSA_sign 3 , +.Xr DSA_size 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0 +and have been available since +.Ox 6.3 . diff --git a/man/DSA_get_ex_new_index.3 b/man/DSA_get_ex_new_index.3 index 70235184..8fe055f3 100644 --- a/man/DSA_get_ex_new_index.3 +++ b/man/DSA_get_ex_new_index.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_get_ex_new_index.3,v 1.4 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_get_ex_new_index.3,v 1.5 2018/03/22 16:06:33 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt DSA_GET_EX_NEW_INDEX 3 .Os .Sh NAME @@ -94,4 +94,5 @@ and .Fn DSA_set_ex_data , and .Fn DSA_get_ex_data -are available since OpenSSL 0.9.5. +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/DSA_meth_new.3 b/man/DSA_meth_new.3 new file mode 100644 index 00000000..41f43824 --- /dev/null +++ b/man/DSA_meth_new.3 @@ -0,0 +1,183 @@ +.\" $OpenBSD: DSA_meth_new.3,v 1.1 2018/03/18 13:06:36 schwarze Exp $ +.\" selective merge up to: OpenSSL a970b14f Jul 31 18:58:40 2017 -0400 +.\" +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Matt Caswell . +.\" Copyright (c) 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. +.\" +.Dd $Mdocdate: March 18 2018 $ +.Dt DSA_METH_NEW 3 +.Os +.Sh NAME +.Nm DSA_meth_new , +.Nm DSA_meth_free , +.Nm DSA_meth_dup , +.Nm DSA_meth_set_sign , +.Nm DSA_meth_set_finish +.Nd build up DSA methods +.Sh SYNOPSIS +.In openssl/dsa.h +.Ft DSA_METHOD * +.Fo DSA_meth_new +.Fa "const char *name" +.Fa "int flags" +.Fc +.Ft void +.Fo DSA_meth_free +.Fa "DSA_METHOD *meth" +.Fc +.Ft DSA_METHOD * +.Fo DSA_meth_dup +.Fa "const DSA_METHOD *meth" +.Fc +.Ft int +.Fo DSA_meth_set_sign +.Fa "DSA_METHOD *meth" +.Fa "DSA_SIG *(*sign)(const unsigned char *, int, DSA *)" +.Fc +.Ft int +.Fo DSA_meth_set_finish +.Fa "DSA_METHOD *meth" +.Fa "int (*finish)(DSA *)" +.Fc +.Sh DESCRIPTION +The +.Vt DSA_METHOD +structure holds function pinters for custom DSA implementations. +.Pp +.Fn DSA_meth_new +creates a new +.Vt DSA_METHOD +structure. +A copy of the NUL-terminated +.Fa name +is stored in the new +.Vt DSA_METHOD +object. +Any new +.Vt DSA +object constructed from this +.Vt DSA_METHOD +will have the given +.Fa flags +set by default. +.Pp +.Fn DSA_meth_dup +creates a deep copy of +.Fa meth . +This might be useful for creating a new +.Vt DSA_METHOD +based on an existing one, but with some differences. +.Pp +.Fn DSA_meth_free +destroys +.Fa meth +and frees any memory associated with it. +.Pp +.Fn DSA_meth_set_sign +sets the function used for creating a DSA signature. +This function will be called from +.Xr DSA_do_sign 3 +and indirectly from +.Xr DSA_sign 3 . +The parameters of +.Fa sign +have the same meaning as for +.Xr DSA_do_sign 3 . +.Pp +.Fn DSA_meth_set_finish +sets an optional function for destroying a +.Vt DSA +object. +Unless +.Fa finish +is +.Dv NULL , +it will be called from +.Xr DSA_free 3 . +It takes the same argument +and is intended to do DSA implementation specific cleanup. +The memory used by the +.Vt DSA +object itself should not be freed by the +.Fa finish +function. +.Sh RETURN VALUES +.Fn DSA_meth_new +and +.Fn DSA_meth_dup +return the newly allocated DSA_METHOD object or NULL on failure. +.Pp +All +.Fn DSA_meth_set_* +functions return 1 on success or 0 on failure. +.Sh SEE ALSO +.Xr DSA_do_sign 3 , +.Xr DSA_new 3 , +.Xr DSA_set_method 3 , +.Xr DSA_SIG_new 3 , +.Xr DSA_sign 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0 +and have been available since +.Ox 6.3 . diff --git a/man/DSA_new.3 b/man/DSA_new.3 index c7339cef..357b113b 100644 --- a/man/DSA_new.3 +++ b/man/DSA_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_new.3,v 1.5 2016/12/11 09:57:57 jmc Exp $ +.\" $OpenBSD: DSA_new.3,v 1.10 2018/04/18 01:11:45 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,17 +48,22 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: April 18 2018 $ .Dt DSA_NEW 3 .Os .Sh NAME .Nm DSA_new , +.Nm DSA_up_ref , .Nm DSA_free .Nd allocate and free DSA objects .Sh SYNOPSIS .In openssl/dsa.h .Ft DSA* .Fn DSA_new void +.Ft int +.Fo DSA_up_ref +.Fa "DSA *dsa" +.Fc .Ft void .Fo DSA_free .Fa "DSA *dsa" @@ -69,12 +74,19 @@ The DSA functions implement the Digital Signature Algorithm. .Fn DSA_new allocates and initializes a .Vt DSA -structure. +structure, setting the reference count to 1. It is equivalent to calling -.Fn DSA_new_method NULL . +.Xr DSA_new_method 3 +with a +.Dv NULL +argument. +.Pp +.Fn DSA_up_ref +increments the reference count by 1. .Pp .Fn DSA_free -frees the +decrements the reference count by 1. +If it reaches 0, it frees the .Vt DSA structure and its components. The values are erased before the memory is returned to the system. @@ -91,6 +103,9 @@ returns and sets an error code that can be obtained by .Xr ERR_get_error 3 . Otherwise it returns a pointer to the newly allocated structure. +.Pp +.Fn DSA_up_ref +returns 1 for success or 0 for failure. .Sh SEE ALSO .Xr BN_new 3 , .Xr d2i_DSAPublicKey 3 , @@ -99,14 +114,16 @@ Otherwise it returns a pointer to the newly allocated structure. .Xr DSA_dup_DH 3 , .Xr DSA_generate_key 3 , .Xr DSA_generate_parameters 3 , +.Xr DSA_get0_pqg 3 , .Xr DSA_get_ex_new_index 3 , +.Xr DSA_meth_new 3 , .Xr DSA_print 3 , .Xr DSA_set_method 3 , .Xr DSA_SIG_new 3 , .Xr DSA_sign 3 , .Xr DSA_size 3 , -.Xr engine 3 , .Xr ERR_get_error 3 , +.Xr EVP_PKEY_set1_DSA 3 , .Xr RSA_new 3 .Sh STANDARDS US Federal Information Processing Standard FIPS 186 (Digital Signature @@ -115,4 +132,9 @@ Standard, DSS), ANSI X9.30 .Fn DSA_new and .Fn DSA_free -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.6.0 and have been available since +.Ox 2.4 . +.Pp +.Fn DSA_up_ref +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . diff --git a/man/DSA_set_method.3 b/man/DSA_set_method.3 index 344ec7c9..8221f856 100644 --- a/man/DSA_set_method.3 +++ b/man/DSA_set_method.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_set_method.3,v 1.6 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_set_method.3,v 1.9 2018/04/18 01:09:01 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: April 18 2018 $ .Dt DSA_SET_METHOD 3 .Os .Sh NAME @@ -60,7 +60,6 @@ .Nd select DSA method .Sh SYNOPSIS .In openssl/dsa.h -.In openssl/engine.h .Ft void .Fo DSA_set_default_method .Fa "const DSA_METHOD *meth" @@ -81,51 +80,41 @@ .Sh DESCRIPTION A .Vt DSA_METHOD -specifies the functions that OpenSSL uses for DSA operations. -By modifying the method, alternative implementations such as hardware -accelerators may be used. -See the -.Sx CAVEATS -section for how these DSA API functions are affected by the use of -.Xr engine 3 -API calls. -.Pp -Initially, the default -.Vt DSA_METHOD -is the OpenSSL internal implementation, as returned by -.Fn DSA_OpenSSL . +object contains pointers to the functions used for DSA operations. +By default, the internal implementation returned by +.Fn DSA_OpenSSL +is used. +By selecting another method, alternative implementations +such as hardware accelerators may be used. .Pp .Fn DSA_set_default_method -makes +selects .Fa meth -the default method for all +as the default method for all .Vt DSA structures created later. -.Sy Note : -this is true only whilst no +If any .Vt ENGINE -has been set as a default for DSA, so this function is no longer -recommended. +was registered with +.Xr ENGINE_register_DSA 3 +that can be successfully initialized, it overrides the default. .Pp .Fn DSA_get_default_method -returns a pointer to the current default -.Vt DSA_METHOD . -However, the meaningfulness of this result is dependent on whether the -.Xr engine 3 -API is being used, so this function is no longer recommended. +returns a pointer to the current default method, +even if it is actually overridded by an +.Vt ENGINE . .Pp .Fn DSA_set_method selects .Fa meth to perform all operations using the key .Fa dsa . -This will replace the +This replaces the .Vt DSA_METHOD used by the DSA key and if the previous method was supplied by an .Vt ENGINE , -the handle to that -.Vt ENGINE -will be released during the change. +.Xr ENGINE_finish 3 +is called on it. It is possible to have DSA keys that only work with certain .Vt DSA_METHOD implementations (e.g. from an @@ -140,17 +129,16 @@ allocates and initializes a .Vt DSA structure so that .Fa engine -will be used for the DSA operations. +is used for the DSA operations. If .Fa engine is .Dv NULL , -the default engine for DSA operations is used and, if no -default -.Vt ENGINE -is set, the -.Vt DSA_METHOD -controlled by +.Xr ENGINE_get_default_DSA 3 +is used. +If that returns +.Dv NULL , +the default method controlled by .Fn DSA_set_default_method is used. .Pp @@ -203,17 +191,11 @@ struct and .Fn DSA_get_default_method return pointers to the respective -.Vt DSA_METHOD Ns s . +.Vt DSA_METHOD . .Pp .Fn DSA_set_method -returns non-zero if the provided -.Fa meth -was successfully set as the method for -.Fa dsa -(including unloading the -.Vt ENGINE -handle if the previous method was supplied by an -.Vt ENGINE ) . +returns 1 on success or 0 on failure. +Currently, it cannot fail. .Pp .Fn DSA_new_method returns @@ -223,7 +205,11 @@ and sets an error code that can be obtained by if the allocation fails. Otherwise it returns a pointer to the newly allocated structure. .Sh SEE ALSO -.Xr DSA_new 3 +.Xr DSA_meth_new 3 , +.Xr DSA_new 3 , +.Xr ENGINE_get_default_DSA 3 , +.Xr ENGINE_register_DSA 3 , +.Xr ENGINE_set_default_DSA 3 .Sh HISTORY .Fn DSA_set_default_method , .Fn DSA_get_default_method , @@ -231,19 +217,5 @@ Otherwise it returns a pointer to the newly allocated structure. .Fn DSA_new_method , and .Fn DSA_OpenSSL -were added in OpenSSL 0.9.4. -.Sh CAVEATS -As of version 0.9.7, DSA_METHOD implementations are grouped together -with other algorithmic APIs (e.g. RSA_METHOD, EVP_CIPHER) in -.Vt ENGINE -modules. -If a default -.Vt ENGINE -is specified for DSA functionality using an -.Xr engine 3 -API function, that will override any DSA defaults set using the DSA API -.Pq i.e. DSA_set_default_method . -For this reason, the -.Xr engine 3 -API is the recommended way to control default implementations for -use in DSA and other cryptographic algorithms. +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/DSA_sign.3 b/man/DSA_sign.3 index 8c851276..460fb595 100644 --- a/man/DSA_sign.3 +++ b/man/DSA_sign.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_sign.3,v 1.5 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_sign.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt DSA_SIGN 3 .Os .Sh NAME @@ -157,6 +157,7 @@ The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr DSA_do_sign 3 , +.Xr DSA_get0_key 3 , .Xr DSA_new 3 , .Xr ERR_get_error 3 , .Xr RAND_bytes 3 @@ -167,6 +168,8 @@ Standard, DSS), ANSI X9.30 .Fn DSA_sign and .Fn DSA_verify -are available in all versions of SSLeay. +first appeared in SSLeay 0.6.0. .Fn DSA_sign_setup -was added in SSLeay 0.8. +first appeared in SSLeay 0.8.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/DSA_size.3 b/man/DSA_size.3 index 373b142c..7e935e3a 100644 --- a/man/DSA_size.3 +++ b/man/DSA_size.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_size.3,v 1.4 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_size.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt DSA_SIZE 3 .Os .Sh NAME @@ -72,8 +72,10 @@ must not be .Sh RETURN VALUES The size in bytes. .Sh SEE ALSO +.Xr DSA_get0_pqg 3 , .Xr DSA_new 3 , .Xr DSA_sign 3 .Sh HISTORY .Fn DSA_size -is available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.6.0 and has been available since +.Ox 2.4 . diff --git a/man/DTLSv1_listen.3 b/man/DTLSv1_listen.3 index 457ac1ad..047ec0a7 100644 --- a/man/DTLSv1_listen.3 +++ b/man/DTLSv1_listen.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DTLSv1_listen.3,v 1.2 2016/12/06 12:24:33 schwarze Exp $ +.\" $OpenBSD: DTLSv1_listen.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 7795475f Dec 18 13:18:31 2015 -0500 .\" .\" This file was written by Matt Caswell . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt DTLSV1_LISTEN 3 .Os .Sh NAME @@ -183,4 +183,5 @@ non-fatal), whilst return codes >0 indicate success. .Xr SSL_get_error 3 .Sh HISTORY .Fn DTLSv1_listen -was added in OpenSSL 0.9.8. +first appeared in OpenSSL 0.9.8m and has been available since +.Ox 4.9 . diff --git a/man/ECDSA_SIG_new.3 b/man/ECDSA_SIG_new.3 index da3d3fe0..9a9d5ed1 100644 --- a/man/ECDSA_SIG_new.3 +++ b/man/ECDSA_SIG_new.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: ECDSA_SIG_new.3,v 1.8 2017/01/06 20:35:23 schwarze Exp $ -.\" OpenSSL e6390aca Jul 21 10:06:03 2015 -0400 +.\" $OpenBSD: ECDSA_SIG_new.3,v 1.12 2018/12/21 22:13:28 schwarze Exp $ +.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 +.\" selective merge up to: OpenSSL 6da34cfb Jun 2 16:17:32 2018 -0400 .\" .\" This file was written by Nils Larsch . -.\" Copyright (c) 2004, 2005, 2012, 2013 The OpenSSL Project. +.\" Copyright (c) 2004, 2005, 2013, 2016 The OpenSSL Project. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -49,12 +50,14 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: December 21 2018 $ .Dt ECDSA_SIG_NEW 3 .Os .Sh NAME .Nm ECDSA_SIG_new , .Nm ECDSA_SIG_free , +.Nm ECDSA_SIG_get0 , +.Nm ECDSA_SIG_set0 , .Nm i2d_ECDSA_SIG , .Nm d2i_ECDSA_SIG , .Nm ECDSA_size , @@ -80,6 +83,18 @@ .Fo ECDSA_SIG_free .Fa "ECDSA_SIG *sig" .Fc +.Ft void +.Fo ECDSA_SIG_get0 +.Fa "const ECDSA_SIG *sig" +.Fa "const BIGNUM **r" +.Fa "const BIGNUM **s" +.Fc +.Ft int +.Fo ECDSA_SIG_set0 +.Fa "ECDSA_SIG *sig" +.Fa "BIGNUM *r" +.Fa "BIGNUM *s" +.Fc .Ft int .Fo i2d_ECDSA_SIG .Fa "const ECDSA_SIG *sig" @@ -210,6 +225,26 @@ frees the structure .Fa sig . .Pp +.Fn ECDSA_SIG_get0 +retrieves internal pointers the +.Fa r +and +.Fa s +values contained in +.Fa sig . +.Pp +.Fn ECDSA_SIG_set0 +sets the +.Fa r +and +.Fa s +values in +.Fa sig . +Calling this function transfers the memory management of the values to +.Fa sig . +Therefore, the values that have been passed in +should not be freed by the caller. +.Pp .Fn i2d_ECDSA_SIG creates the DER encoding of the ECDSA signature .Fa sig @@ -342,9 +377,17 @@ of size using the public key .Fa eckey . .Sh RETURN VALUES +.Fn ECDSA_SIG_new +returns the new +.Vt ECDSA_SIG +object or +.Dv NULL +if an error occurs. +.Pp .Fn ECDSA_size returns the maximum length signature or 0 on error. .Pp +.Fn ECDSA_SIG_set0 , .Fn ECDSA_sign , .Fn ECDSA_sign_ex , and @@ -448,7 +491,31 @@ if (ret == -1) { ANSI X9.62, US Federal Information Processing Standard FIPS 186-2 (Digital Signature Standard, DSS) .Sh HISTORY -The ECDSA implementation was first introduced in OpenSSL 0.9.8. +.Fn ECDSA_SIG_new , +.Fn ECDSA_SIG_free , +.Fn i2d_ECDSA_SIG , +.Fn d2i_ECDSA_SIG , +.Fn ECDSA_size , +.Fn ECDSA_sign_setup , +.Fn ECDSA_sign , +.Fn ECDSA_sign_ex , +.Fn ECDSA_verify , +.Fn ECDSA_do_sign , +.Fn ECDSA_do_sign_ex , +.Fn ECDSA_do_verify , +.Fn ECDSA_OpenSSL , +.Fn ECDSA_get_default_method , +.Fn ECDSA_set_default_method , +and +.Fn ECDSA_set_method +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Pp +.Fn ECDSA_SIG_get0 +and +.Fn ECDSA_SIG_set0 +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . .Sh AUTHORS .An Nils Larsch for the OpenSSL project. diff --git a/man/EC_GFp_simple_method.3 b/man/EC_GFp_simple_method.3 index 7f08e707..ad5268fa 100644 --- a/man/EC_GFp_simple_method.3 +++ b/man/EC_GFp_simple_method.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EC_GFp_simple_method.3,v 1.6 2016/12/11 14:22:43 schwarze Exp $ +.\" $OpenBSD: EC_GFp_simple_method.3,v 1.9 2018/03/23 05:48:56 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Matt Caswell . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EC_GFP_SIMPLE_METHOD 3 .Os .Sh NAME @@ -159,3 +159,23 @@ structure supports. .Xr EC_KEY_new 3 , .Xr EC_POINT_add 3 , .Xr EC_POINT_new 3 +.Sh HISTORY +.Fn EC_GFp_simple_method +and +.Fn EC_GFp_mont_method +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn EC_GFp_nist_method , +.Fn EC_GF2m_simple_method , +and +.Fn EC_METHOD_get_field_type +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Pp +.Fn EC_GFp_nistp224_method , +.Fn EC_GFp_nistp256_method , +and +.Fn EC_GFp_nistp521_method +first appeared in OpenSSL 1.0.1 and have been available since +.Ox 5.3 . diff --git a/man/EC_GROUP_copy.3 b/man/EC_GROUP_copy.3 index d857a219..bdbd72c2 100644 --- a/man/EC_GROUP_copy.3 +++ b/man/EC_GROUP_copy.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EC_GROUP_copy.3,v 1.7 2016/12/11 14:22:43 schwarze Exp $ +.\" $OpenBSD: EC_GROUP_copy.3,v 1.10 2018/03/23 23:18:17 schwarze Exp $ .\" OpenSSL aafbe1cc Jun 12 23:42:08 2013 +0100 .\" .\" This file was written by Matt Caswell . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EC_GROUP_COPY 3 .Os .Sh NAME @@ -485,3 +485,34 @@ Alternatively in the event of an error a 0 is returned. .Xr EC_KEY_new 3 , .Xr EC_POINT_add 3 , .Xr EC_POINT_new 3 +.Sh HISTORY +.Fn EC_GROUP_copy , +.Fn EC_GROUP_method_of , +.Fn EC_GROUP_set_generator , +.Fn EC_GROUP_get0_generator , +.Fn EC_GROUP_get_order , +and +.Fn EC_GROUP_get_cofactor +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn EC_GROUP_dup , +.Fn EC_GROUP_set_curve_name , +.Fn EC_GROUP_get_curve_name , +.Fn EC_GROUP_set_asn1_flag , +.Fn EC_GROUP_get_asn1_flag , +.Fn EC_GROUP_set_point_conversion_form , +.Fn EC_GROUP_get_point_conversion_form , +.Fn EC_GROUP_get0_seed , +.Fn EC_GROUP_get_seed_len , +.Fn EC_GROUP_set_seed , +.Fn EC_GROUP_get_degree , +.Fn EC_GROUP_check , +.Fn EC_GROUP_check_discriminant , +.Fn EC_GROUP_cmp , +.Fn EC_GROUP_get_basis_type , +.Fn EC_GROUP_get_trinomial_basis , +and +.Fn EC_GROUP_get_pentanomial_basis +first appeared in OpenSSL 0.9.8 and has been available since +.Ox 4.5 . diff --git a/man/EC_GROUP_new.3 b/man/EC_GROUP_new.3 index f1227da7..c5fcafd7 100644 --- a/man/EC_GROUP_new.3 +++ b/man/EC_GROUP_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EC_GROUP_new.3,v 1.6 2016/12/11 14:22:43 schwarze Exp $ +.\" $OpenBSD: EC_GROUP_new.3,v 1.9 2019/03/29 20:21:54 tb Exp $ .\" OpenSSL 9b86974e Mon Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Matt Caswell . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 29 2019 $ .Dt EC_GROUP_NEW 3 .Os .Sh NAME @@ -185,7 +185,7 @@ and .Fa b for a curve over Fp stored in .Fa group . -.Fn EC_group_get_curve_GFp +.Fn EC_GROUP_get_curve_GFp obtains the previously set curve parameters. .Pp .Fn EC_GROUP_set_curve_GF2m @@ -196,7 +196,7 @@ represents the irreducible polynomial - each bit represents a term in the polynomial. Therefore there will either be three or five bits set dependent on whether the polynomial is a trinomial or a pentanomial. -.Fn EC_group_get_curve_GF2m +.Fn EC_GROUP_get_curve_GF2m obtains the previously set curve parameters. .Pp The functions @@ -306,3 +306,22 @@ return 1 on success or 0 on error. .Xr EC_POINT_add 3 , .Xr EC_POINT_new 3 , .Xr ECDSA_SIG_new 3 +.Sh HISTORY +.Fn EC_GROUP_new , +.Fn EC_GROUP_free , +.Fn EC_GROUP_clear_free , +.Fn EC_GROUP_new_curve_GFp , +.Fn EC_GROUP_set_curve_GFp , +and +.Fn EC_GROUP_get_curve_GFp +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn EC_GROUP_new_curve_GF2m , +.Fn EC_GROUP_new_by_curve_name , +.Fn EC_GROUP_set_curve_GF2m , +.Fn EC_GROUP_get_curve_GF2m , +and +.Fn EC_get_builtin_curves +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/EC_KEY_new.3 b/man/EC_KEY_new.3 index 742be773..c77233b4 100644 --- a/man/EC_KEY_new.3 +++ b/man/EC_KEY_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EC_KEY_new.3,v 1.8 2016/12/11 14:22:43 schwarze Exp $ +.\" $OpenBSD: EC_KEY_new.3,v 1.13 2018/03/23 23:18:17 schwarze Exp $ .\" OpenSSL d900a015 Oct 8 14:40:42 2015 +0200 .\" .\" This file was written by Matt Caswell . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EC_KEY_NEW 3 .Os .Sh NAME @@ -524,4 +524,41 @@ returns the point_conversion_form for the .Xr EC_GROUP_new 3 , .Xr EC_POINT_add 3 , .Xr EC_POINT_new 3 , -.Xr ECDSA_SIG_new 3 +.Xr ECDSA_SIG_new 3 , +.Xr EVP_PKEY_set1_EC_KEY 3 +.Sh HISTORY +.Fn EC_KEY_new , +.Fn EC_KEY_new_by_curve_name , +.Fn EC_KEY_free , +.Fn EC_KEY_copy , +.Fn EC_KEY_dup , +.Fn EC_KEY_up_ref , +.Fn EC_KEY_get0_group , +.Fn EC_KEY_set_group , +.Fn EC_KEY_get0_private_key , +.Fn EC_KEY_set_private_key , +.Fn EC_KEY_get0_public_key , +.Fn EC_KEY_set_public_key , +.Fn EC_KEY_get_enc_flags , +.Fn EC_KEY_set_enc_flags , +.Fn EC_KEY_get_conv_form , +.Fn EC_KEY_set_conv_form , +.Fn EC_KEY_get_key_method_data , +.Fn EC_KEY_insert_key_method_data , +.Fn EC_KEY_set_asn1_flag , +.Fn EC_KEY_precompute_mult , +.Fn EC_KEY_generate_key , +.Fn EC_KEY_check_key , +.Fn EC_KEY_print , +and +.Fn EC_KEY_print_fp +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Pp +.Fn EC_KEY_get_flags , +.Fn EC_KEY_set_flags , +.Fn EC_KEY_clear_flags , +and +.Fn EC_KEY_set_public_key_affine_coordinates +first appeared in OpenSSL 1.0.1 and have been available since +.Ox 5.3 . diff --git a/man/EC_POINT_add.3 b/man/EC_POINT_add.3 index dd3d5805..7c3ecbb1 100644 --- a/man/EC_POINT_add.3 +++ b/man/EC_POINT_add.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EC_POINT_add.3,v 1.6 2016/12/11 14:22:43 schwarze Exp $ +.\" $OpenBSD: EC_POINT_add.3,v 1.11 2018/07/16 17:37:25 tb Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Matt Caswell . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: July 16 2018 $ .Dt EC_POINT_ADD 3 .Os .Sh NAME @@ -217,12 +217,30 @@ The value .Fa n may be .Dv NULL , -in which case the result is just q * m. +in which case the result is just .Pp +.Dl q * m. +.Pp +.Fn EC_POINTs_mul +only supports the values 0 and 1 for +.Fa num . +If it is 1, then .Fn EC_POINTs_mul calculates the value .Pp -.Dl generator * n + q[0] * m[0] + ... + q[num-1] * m[num-1] +.Dl generator * n + q[0] * m[0]. +.Pp +If +.Fa num +is 0 then +.Fa q +and +.Fa m +must be +.Dv NULL , +and the result is just +.Pp +.Dl generator * n . .Pp As for .Fn EC_POINT_mul , @@ -271,3 +289,22 @@ returns 1 if a precomputation has been done or 0 if not. .Xr EC_GROUP_new 3 , .Xr EC_KEY_new 3 , .Xr EC_POINT_new 3 +.Sh HISTORY +.Fn EC_POINT_add , +.Fn EC_POINT_dbl , +.Fn EC_POINT_invert , +.Fn EC_POINT_is_at_infinity , +.Fn EC_POINT_is_on_curve , +.Fn EC_POINT_cmp , +.Fn EC_POINT_make_affine , +.Fn EC_POINTs_make_affine , +.Fn EC_POINTs_mul , +.Fn EC_POINT_mul , +and +.Fn EC_GROUP_precompute_mult +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn EC_GROUP_have_precompute_mult +first appeared in OpenSSL 0.9.8 and has been available since +.Ox 4.5 . diff --git a/man/EC_POINT_new.3 b/man/EC_POINT_new.3 index 1e09208f..06a15fb6 100644 --- a/man/EC_POINT_new.3 +++ b/man/EC_POINT_new.3 @@ -1,5 +1,5 @@ -.\" $OpenBSD: EC_POINT_new.3,v 1.6 2016/12/11 14:22:43 schwarze Exp $ -.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" $OpenBSD: EC_POINT_new.3,v 1.10 2019/03/18 12:58:00 schwarze Exp $ +.\" full merge up to: OpenSSL ddc1caac Mar 6 14:00:24 2018 -0500 .\" .\" This file was written by Matt Caswell . .\" Copyright (c) 2013, 2016 The OpenSSL Project. All rights reserved. @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 18 2019 $ .Dt EC_POINT_NEW 3 .Os .Sh NAME @@ -302,6 +302,18 @@ coordinates for the point .Fa p defined over the curve given in .Fa group . +The functions +.Fn EC_POINT_get_affine_coordinates_GFp +and +.Fn EC_POINT_get_affine_coordinates_GF2m +set +.Fa x +and +.Fa y , +either of which may be +.Dv NULL , +to the corresponding coordinates of +.Fa p . .Pp As well as the affine coordinates, a point can alternatively be described in terms of its Jacobian projective coordinates (for Fp @@ -443,7 +455,7 @@ returns the length of the required buffer, or 0 on error. returns the pointer to the .Vt BIGNUM supplied or -.Vt NULL +.Dv NULL on error. .Pp .Fn EC_POINT_bn2point @@ -460,7 +472,8 @@ on error. .Pp .Fn EC_POINT_hex2point returns the pointer to the -.Vt EC_POINT supplied or +.Vt EC_POINT +supplied or .Dv NULL on error. .Sh SEE ALSO @@ -470,3 +483,32 @@ on error. .Xr EC_GROUP_new 3 , .Xr EC_KEY_new 3 , .Xr EC_POINT_add 3 +.Sh HISTORY +.Fn EC_POINT_new , +.Fn EC_POINT_free , +.Fn EC_POINT_clear_free , +.Fn EC_POINT_copy , +.Fn EC_POINT_method_of , +.Fn EC_POINT_set_to_infinity , +.Fn EC_POINT_set_affine_coordinates_GFp , +.Fn EC_POINT_get_affine_coordinates_GFp , +.Fn EC_POINT_set_Jprojective_coordinates_GFp , +.Fn EC_POINT_get_Jprojective_coordinates_GFp , +.Fn EC_POINT_set_compressed_coordinates_GFp , +.Fn EC_POINT_point2oct , +and +.Fn EC_POINT_oct2point +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn EC_POINT_dup , +.Fn EC_POINT_set_affine_coordinates_GF2m , +.Fn EC_POINT_get_affine_coordinates_GF2m , +.Fn EC_POINT_set_compressed_coordinates_GF2m , +.Fn EC_POINT_point2bn , +.Fn EC_POINT_bn2point , +.Fn EC_POINT_point2hex , +and +.Fn EC_POINT_hex2point +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/ENGINE_add.3 b/man/ENGINE_add.3 new file mode 100644 index 00000000..4ae878b4 --- /dev/null +++ b/man/ENGINE_add.3 @@ -0,0 +1,243 @@ +.\" $OpenBSD: ENGINE_add.3,v 1.3 2018/04/18 03:39:22 schwarze Exp $ +.\" content checked up to: OpenSSL 1f13ad31 Dec 25 17:50:39 2017 +0800 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 18 2018 $ +.Dt ENGINE_ADD 3 +.Os +.Sh NAME +.Nm ENGINE_add , +.Nm ENGINE_set_id , +.Nm ENGINE_get_id , +.Nm ENGINE_set_name , +.Nm ENGINE_get_name , +.Nm ENGINE_remove , +.Nm ENGINE_cleanup , +.Nm ENGINE_get_first , +.Nm ENGINE_get_last , +.Nm ENGINE_get_next , +.Nm ENGINE_get_prev , +.Nm ENGINE_by_id +.Nd maintain a global list of ENGINE objects +.Sh SYNOPSIS +.In openssl/engine.h +.Ft int +.Fo ENGINE_add +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_id +.Fa "ENGINE *e" +.Fa "const char *id" +.Fc +.Ft const char * +.Fo ENGINE_get_id +.Fa "const ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_name +.Fa "ENGINE *e" +.Fa "const char *name" +.Fc +.Ft const char * +.Fo ENGINE_get_name +.Fa "const ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_remove +.Fa "ENGINE *e" +.Fc +.Ft void +.Fn ENGINE_cleanup void +.Ft ENGINE * +.Fn ENGINE_get_first void +.Ft ENGINE * +.Fn ENGINE_get_last void +.Ft ENGINE * +.Fo ENGINE_get_next +.Fa "ENGINE *e" +.Fc +.Ft ENGINE * +.Fo ENGINE_get_prev +.Fa "ENGINE *e" +.Fc +.Ft ENGINE * +.Fo ENGINE_by_id +.Fa "const char *id" +.Fc +.Sh DESCRIPTION +The crypto library maintains a global list of +.Vt ENGINE +objects. +.Pp +.Fn ENGINE_add +appends +.Fa e +to the end of the list +and increments its structural reference count by 1. +A unique identifier and a name of +.Fa e +have to be set with +.Fn ENGINE_set_id +and +.Fn ENGINE_set_name +before calling this function. +.Fn ENGINE_add +fails if the list already contains an +.Vt ENGINE +with the same identifier. +.Pp +.Fn ENGINE_remove +removes +.Fa e +from the list. +If successful, it calls +.Xr ENGINE_free 3 +on +.Fa e . +.Pp +.Fn ENGINE_cleanup +calls +.Xr ENGINE_finish 3 +on all +.Vt ENGINE +objects that were selected as default engines, for example using the +functions documented in the +.Xr ENGINE_set_default 3 +and +.Xr ENGINE_get_default_RSA 3 +manual pages, and it calls +.Fn ENGINE_remove +on all +.Vt ENGINE +objects that were added to the global list with +.Fn ENGINE_add . +Calling this function is required at the end of each program using +.Fn ENGINE_add , +even if no engines are explicitly registered or used. +.Pp +.Fn ENGINE_get_first +and +.Fn ENGINE_get_last +provide access to the first and last +.Vt ENGINE +object on the list, respectively. +Unless the list is empty, they increment the structural reference +count of the retrieved object by 1. +.Pp +.Fn ENGINE_get_next +and +.Fn ENGINE_get_prev +support iteration of the list. +They always call +.Xr ENGINE_free 3 +on +.Fa e . +Unless the end of the list is reached, they increment the structural +reference count of the retrieved object by 1. +.Pp +.Fn ENGINE_by_id +searches the list for an +.Vt ENGINE +object with a matching +.Fa id . +If found, it increments the structural reference count of the +retrieved object by 1. +If +.Dv ENGINE_FLAGS_BY_ID_COPY +was set on +.Fa e +with +.Xr ENGINE_set_flags 3 , +it returns a shallow copy of the object rather than incrementing +the reference count and returning a pointer to the original. +.Sh RETURN VALUES +.Fn ENGINE_add , +.Fn ENGINE_set_id , +.Fn ENGINE_set_name , +and +.Fn ENGINE_remove +return 1 on success or 0 on error. +.Fn ENGINE_set_id +and +.Fn ENGINE_set_name +can only fail if the supplied +.Fa id +or +.Fa name +is +.Dv NULL . +.Pp +.Fn ENGINE_get_id +and +.Fn ENGINE_get_name +return a pointer to an internal string +representing the identifier and the name of +.Fa e , +respectively. +.Pp +.Fn ENGINE_get_first +and +.Fn ENGINE_get_last +return an +.Vt ENGINE +object or +.Dv NULL +if the list is empty. +.Pp +.Fn ENGINE_get_next +and +.Fn ENGINE_get_prev +return an +.Vt ENGINE +object or +.Dv NULL +when the end of the list is reached. +.Pp +.Fn ENGINE_by_id +returns an +.Vt ENGINE +object or +.Dv NULL +if no matching object is found. +.Sh SEE ALSO +.Xr ENGINE_get_default_RSA 3 , +.Xr ENGINE_init 3 , +.Xr ENGINE_new 3 , +.Xr ENGINE_register_all_RSA 3 , +.Xr ENGINE_register_RSA 3 , +.Xr ENGINE_set_default 3 , +.Xr ENGINE_set_flags 3 , +.Xr ENGINE_unregister_RSA 3 +.Sh HISTORY +.Fn ENGINE_add , +.Fn ENGINE_set_id , +.Fn ENGINE_get_id , +.Fn ENGINE_set_name , +.Fn ENGINE_get_name , +.Fn ENGINE_remove , +.Fn ENGINE_get_first , +.Fn ENGINE_get_last , +.Fn ENGINE_get_next , +.Fn ENGINE_get_prev , +and +.Fn ENGINE_by_id +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 2.9 . +.Pp +.Fn ENGINE_cleanup +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . diff --git a/man/ENGINE_ctrl.3 b/man/ENGINE_ctrl.3 new file mode 100644 index 00000000..c02e9b5a --- /dev/null +++ b/man/ENGINE_ctrl.3 @@ -0,0 +1,470 @@ +.\" $OpenBSD: ENGINE_ctrl.3,v 1.4 2018/04/19 18:43:58 schwarze Exp $ +.\" content checked up to: +.\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 19 2018 $ +.Dt ENGINE_CTRL 3 +.Os +.Sh NAME +.Nm ENGINE_ctrl , +.Nm ENGINE_cmd_is_executable , +.Nm ENGINE_ctrl_cmd , +.Nm ENGINE_ctrl_cmd_string , +.Nm ENGINE_set_ctrl_function , +.Nm ENGINE_get_ctrl_function , +.Nm ENGINE_set_cmd_defns , +.Nm ENGINE_get_cmd_defns +.Nd control commands for ENGINE objects +.Sh SYNOPSIS +.In openssl/engine.h +.Ft int +.Fo ENGINE_ctrl +.Fa "ENGINE *e" +.Fa "int cmd" +.Fa "long i" +.Fa "void *p" +.Fa "void (*f)(void)" +.Fc +.Ft int +.Fo ENGINE_cmd_is_executable +.Fa "ENGINE *e" +.Fa "int cmd" +.Fc +.Ft int +.Fo ENGINE_ctrl_cmd +.Fa "ENGINE *e" +.Fa "const char *cmd_name" +.Fa "long i" +.Fa "void *p" +.Fa "void (*f)(void)" +.Fa "int cmd_optional" +.Fc +.Ft int +.Fo ENGINE_ctrl_cmd_string +.Fa "ENGINE *e" +.Fa "const char *cmd_name" +.Fa "const char *arg" +.Fa "int cmd_optional" +.Fc +.Ft typedef int +.Fo (*ENGINE_CTRL_FUNC_PTR) +.Fa "ENGINE *e" +.Fa "int cmd" +.Fa "long i" +.Fa "void *p" +.Fa "void (*f)(void)" +.Fc +.Ft int +.Fo ENGINE_set_ctrl_function +.Fa "ENGINE *e" +.Fa "ENGINE_CTRL_FUNC_PTR ctrl_f" +.Fc +.Ft ENGINE_CTRL_FUNC_PTR +.Fo ENGINE_get_ctrl_function +.Fa "const ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_cmd_defns +.Fa "ENGINE *e" +.Fa "const ENGINE_CMD_DEFN *defns" +.Fc +.Ft const ENGINE_CMD_DEFN * +.Fo ENGINE_get_cmd_defns +.Fa "const ENGINE *e" +.Fc +.Sh DESCRIPTION +.Fn ENGINE_ctrl +calls the built-in or user-defined +.Fa cmd +for the engine +.Fa e , +passing the arguments +.Fa i +and +.Fa p . +.Pp +User-defined commands can be used before +.Xr ENGINE_init 3 +to provide data required for initialization +or at any time to modify the behaviour of an engine. +.Pp +Most built-in commands operate on user-defined commands installed with +.Fn ENGINE_set_cmd_defns , +either using the +.Fa p +argument to indicate the user-defined command with the command name +.Fa cmd_name +or using the +.Fa i +argument to indicate the user-defined command with the command number +.Fa cmd_num . +The +.Fa cmd +arguments to call the built-in commands are as follows: +.Bl -tag -width Ds +.It Dv ENGINE_CTRL_GET_CMD_FLAGS +Return the +.Fa cmd_flags +of the user-defined command with the number +.Fa i , +or a number less than or equal to 0 if an error occurs or +the command number does not exist. +A return value of 0 indicates failure if +.Fa e +is +.Dv NULL +or has a reference count of 0, or success if +.Fa e +is valid. +.It Dv ENGINE_CTRL_GET_CMD_FROM_NAME +Return the positive command number +of the user-defined command with the name +.Fa p , +or a number less than or equal to 0 if an error occurs or no +matching name is found. +.It Dv ENGINE_CTRL_GET_DESC_FROM_CMD +Copy the description of the user-defined command with the number +.Fa i +into the buffer +.Fa p +and NUL-terminate it. +It is the reponsability of the caller to make sure that the buffer +.Fa p +is large enough, either by calling +.Dv ENGINE_CTRL_GET_DESC_LEN_FROM_CMD +first or using knowledge about the array passed to +.Fn ENGINE_set_cmd_defns . +The return value is the number of bytes written +.Em including +the terminating NUL byte, or a number less than or equal to 0 +if an error occurs. +.It Dv ENGINE_CTRL_GET_DESC_LEN_FROM_CMD +Return the length in bytes +.Em excluding +the terminating NUL byte +of the description of the user-defined command with the number +.Fa i , +or a number less than or equal to 0 if an error occurs. +A return value of 0 indicates failure if +.Fa e +is +.Dv NULL +or has a reference count of 0, or success if +.Fa e +is valid. +.It Dv ENGINE_CTRL_GET_FIRST_CMD_TYPE +Return the positive command number +of the first user-defined command installed with +.Fn ENGINE_set_cmd_defns +or a number less than or equal to 0 if an error occurs or no +user-defined command has been installed. +.It Dv ENGINE_CTRL_GET_NAME_FROM_CMD +Copy the name of the user-defined command with the number +.Fa i +into the buffer +.Fa p +and NUL-terminate it. +It is the reponsability of the caller to make sure that the buffer +.Fa p +is large enough, either by calling +.Dv ENGINE_CTRL_GET_NAME_LEN_FROM_CMD +first or using knowledge about the array passed to +.Fn ENGINE_set_cmd_defns . +The return value is the number of bytes written +.Em including +the terminating NUL byte, or a number less than or equal to 0 +if an error occurs. +.It Dv ENGINE_CTRL_GET_NAME_LEN_FROM_CMD +Return the length in bytes +.Em excluding +the terminating NULL byte +of the name of the user-defined command with the number +.Fa i , +or a number less than or equal to 0 if an error occurs. +A return value of 0 indicates failure if +.Fa e +is +.Dv NULL +or has a reference count of 0, or success if +.Fa e +is valid. +.It Dv ENGINE_CTRL_GET_NEXT_CMD_TYPE +Return the positive command number of the next user-defined command +after the user-defined command with the number +.Fa i , +or a number less than or equal to 0 if an error occurs or if +.Fa i +is the last user-defined command. +Together with +.Dv ENGINE_CTRL_GET_FIRST_CMD_TYPE , +this can be used to iterate the user-defined commands installed with +.Fn ENGINE_set_cmd_defns . +.It Dv ENGINE_CTRL_HAS_CTRL_FUNCTION +Return 1 if +.Fa e +has its own +.Fa ctrl_f +installed with +.Fn ENGINE_set_ctrl_function +or 0 otherwise. +.El +.Pp +.Fn ENGINE_ctrl_cmd +translates the +.Fa cmd_name +of a user-defined command to a +.Fa cmd +number and calls +.Fn ENGINE_ctrl +on it. +If +.Fa cmd_optional +is non-zero, lack of a +.Fa ctrl_f +in +.Fa e +and translation failure with +.Dv ENGINE_CTRL_GET_CMD_FROM_NAME +are considered success, and the command has no effect. +Otherwise, these problems cause +.Fn ENGINE_ctrl_cmd +to fail. +.Pp +Neither +.Fn ENGINE_ctrl +nor +.Fn ENGINE_ctrl_cmd +ever call the +.Fa f +callback, but merely pass it on as an argument to the engine-specific +.Fa ctrl_f +control function. +It is up to +.Fa ctrl_f +how to use it, or alternatively to ignore it as well. +.Pp +.Fn ENGINE_ctrl_cmd_string +translates the +.Fa cmd_name +of a user-defined command to a +.Fa cmd +number. +If that command has the +.Dv ENGINE_CMD_FLAG_NO_INPUT +flag set, +.Fa arg +must be +.Dv NULL +and +.Fn ENGINE_ctrl +is called with +.Fa i +set to 0 and +.Fa p +set to +.Dv NULL . +Otherwise, +.Fa arg +must not be +.Dv NULL . +If the command accepts string input, +.Fa i +is set to 0 and +.Fa arg +is passed as the +.Fa p +argument to +.Fn ENGINE_ctrl . +Otherwise, +.Fa arg +is converted with +.Xr strtol 3 +and passed as the +.Fa i +argument to +.Fn ENGINE_ctrl , +setting +.Fa p +to +.Dv NULL . +.Pp +.Fn ENGINE_set_ctrl_function +installs +.Fa ctrl_f +as the engine-specific control function for +.Fa e . +Future calls to +.Fn ENGINE_ctrl +will call that function, passing on their arguments unchanged, if the +.Fa cmd +is not built-in to the library or if the +.Dv ENGINE_FLAGS_MANUAL_CMD_CTRL +flag is set in +.Fa e . +Let the +.Fa ctrl_f +return positive values on success or negative values on failure. +Avoid return values of 0 because they cause dangerous ambiguity. +In particular, +.Fn ENGINE_ctrl_cmd +and +.Fn ENGINE_ctrl_cmd_string +cannot be used with user-defined commands +that may return 0 on success. +.Pp +.Fn ENGINE_set_cmd_defns +install an array of command definitions in +.Fa e . +.Pp +The structure +.Vt ENGINE_CMD_DEFN +has the following fields: +.Bl -tag -width Ds +.It Fa "unsigned int cmd_num" +A positive, unique, monotonically increasing command number. +Avoid using numbers below +.Dv ENGINE_CMD_BASE . +.It Fa "const char *cmd_name" +The unique name of the command. +.It Fa "const char *cmd_desc" +A short description of the command. +.It Fa "unsigned int cmd_flags" +The bitwise OR of zero or more of the following flags: +.Bl -tag -width Ds +.It Dv ENGINE_CMD_FLAG_NUMERIC +The command uses +.Fa i . +.It Dv ENGINE_CMD_FLAG_STRING +The command uses +.Fa p . +.It Dv ENGINE_CMD_FLAG_NO_INPUT +The command neither uses +.Fa i +nor +.Fa p . +.It Dv ENGINE_CMD_FLAG_INTERNAL +This flag has no effect and is only provided for compatibility. +.El +.El +.Pp +The last element of +.Fa defns +does not specify a command, but must have a +.Fa cmd_num +of 0 and a +.Fa cmd_name +of +.Dv NULL +to indicate the end of the array. +.Sh RETURN VALUES +For +.Fn ENGINE_ctrl , +positive return values indicate success and negative return values +indicate failure. +The meaning of a zero return value depends on the particular +.Fa cmd +and may indicate both success and failure, which is pathetic. +.Pp +Regardless of the +.Fa cmd , +.Fn ENGINE_ctrl +returns 0 if +.Fa e +is +.Dv NULL +or has a reference count of 0. +This is quite unfortunate for commands like +.Dv ENGINE_CTRL_GET_CMD_FLAGS +where 0 may indicate success, so make sure +.Fa e +is valid before issuing a control command. +.Pp +For built-in commands except +.Dv ENGINE_CTRL_HAS_CTRL_FUNCTION , +.Fn ENGINE_ctrl +returns \-1 if +.Dv ENGINE_FLAGS_MANUAL_CMD_CTRL +is set but no +.Fa ctrl_f +has been installed with +.Fn ENGINE_set_ctrl_function . +.Pp +For commands that are not built in, +.Fn ENGINE_ctrl +returns 0 if no +.Fa ctrl_f +has been installed with +.Fn ENGINE_set_ctrl_function . +.Pp +.Fn ENGINE_cmd_is_executable +returns 1 if the user-defined +.Fa cmd +is executable and has at least one of the flags +.Dv ENGINE_CMD_FLAG_NUMERIC , +.Dv ENGINE_CMD_FLAG_STRING , +and +.Dv ENGINE_CMD_FLAG_NO_INPUT +set, or 0 otherwise. +.Pp +.Fn ENGINE_ctrl_cmd +and +.Fn ENGINE_ctrl_cmd_string +return 1 on success or 0 on error. +.Pp +.Fn ENGINE_set_ctrl_function +and +.Fn ENGINE_set_cmd_defns +always return 1. +.Pp +.Fn ENGINE_get_ctrl_function +returns a pointer to the function +.Fa ctrl_f +installed with +.Fn ENGINE_set_ctrl_function , +or +.Dv NULL +if none has been installed. +.Pp +.Fn ENGINE_get_cmd_defns +returns the array of command definitions installed in +.Fa e +or +.Dv NULL +if none is installed. +.Sh SEE ALSO +.Xr ENGINE_add 3 , +.Xr ENGINE_init 3 , +.Xr ENGINE_new 3 , +.Xr ENGINE_register_RSA 3 , +.Xr ENGINE_set_flags 3 , +.Xr ENGINE_set_RSA 3 +.Sh HISTORY +.Fn ENGINE_ctrl , +.Fn ENGINE_set_ctrl_function , +and +.Fn ENGINE_get_ctrl_function +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 2.9 . +.Pp +.Fn ENGINE_cmd_is_executable , +.Fn ENGINE_ctrl_cmd , +.Fn ENGINE_ctrl_cmd_string , +.Fn ENGINE_set_cmd_defns , +and +.Fn ENGINE_get_cmd_defns +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/ENGINE_get_default_RSA.3 b/man/ENGINE_get_default_RSA.3 new file mode 100644 index 00000000..b04d42c1 --- /dev/null +++ b/man/ENGINE_get_default_RSA.3 @@ -0,0 +1,160 @@ +.\" $OpenBSD: ENGINE_get_default_RSA.3,v 1.2 2018/04/18 03:39:22 schwarze Exp $ +.\" content checked up to: +.\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 18 2018 $ +.Dt ENGINE_GET_DEFAULT_RSA 3 +.Os +.Sh NAME +.Nm ENGINE_get_default_RSA , +.Nm ENGINE_get_default_DSA , +.Nm ENGINE_get_default_ECDH , +.Nm ENGINE_get_default_ECDSA , +.Nm ENGINE_get_default_DH , +.Nm ENGINE_get_default_RAND , +.Nm ENGINE_get_cipher_engine , +.Nm ENGINE_get_digest_engine , +.Nm ENGINE_set_table_flags , +.Nm ENGINE_get_table_flags +.Nd retrieve the default ENGINE for an algorithm +.Sh SYNOPSIS +.In openssl/engine.h +.Ft ENGINE * +.Fn ENGINE_get_default_RSA void +.Ft ENGINE * +.Fn ENGINE_get_default_DSA void +.Ft ENGINE * +.Fn ENGINE_get_default_ECDH void +.Ft ENGINE * +.Fn ENGINE_get_default_ECDSA void +.Ft ENGINE * +.Fn ENGINE_get_default_DH void +.Ft ENGINE * +.Fn ENGINE_get_default_RAND void +.Ft ENGINE * +.Fo ENGINE_get_cipher_engine +.Fa "int nid" +.Fc +.Ft ENGINE * +.Fo ENGINE_get_digest_engine +.Fa "int nid" +.Fc +.Ft void +.Fo ENGINE_set_table_flags +.Fa "unsigned int flags" +.Fc +.Ft unsigned int +.Fn ENGINE_get_table_flags void +.Sh DESCRIPTION +These functions retrieve the current default +.Vt ENGINE +implementing the respective algorithm. +.Pp +If a default engine was previously selected, +.Xr ENGINE_init 3 +is called on it again and it is used. +Otherwise, these functions inspect the engines registered +with the functions documented in +.Xr ENGINE_register_RSA 3 +in the order of the table for the respective algorithm. +If an inspected engine is already successfully initialized, +.Xr ENGINE_init 3 +is called on it again and it is used as the new default. +Otherwise, unless the global flag +.Dv ENGINE_TABLE_FLAG_NOINIT +is set, +.Xr ENGINE_init 3 +is tried on it. +If it succeeds, that engine is used as the new default. +If it fails or if +.Dv ENGINE_TABLE_FLAG_NOINIT +is set, inspection continues with the next engine. +.Pp +The global flag can be set by calling +.Fn ENGINE_set_table_flags +with an argument of +.Dv ENGINE_TABLE_FLAG_NOINIT +or cleared by calling it with an argument of 0. +By default, the flag is not set. +.Pp +While all the other functions operate on exactly one algorithm, +.Fn ENGINE_get_cipher_engine +and +.Fn ENGINE_get_digest_engine +are special in so far as they can handle multiple algorithms, +identified by the given +.Fa nid . +The default engine is remembered separately for each algorithm. +.Pp +Application programs rarely need to call these functions because +they are called automatically when needed, in particular from +.Xr RSA_new 3 , +.Xr DSA_new 3 , +.Fn ECDH_set_method , +.Fn ECDH_compute_key , +.Xr ECDSA_set_method 3 , +.Xr ECDSA_do_sign_ex 3 , +.Xr ECDSA_do_verify 3 , +.Xr DH_new 3 , +.Xr EVP_CipherInit_ex 3 , +and +.Xr EVP_DigestInit_ex 3 . +.Sh RETURN VALUES +These functions return a functional reference to an +.Vt ENGINE +object or +.Dv NULL +on failure, in particular when no engine implementing the algorithm +is available, when +.Xr ENGINE_init 3 +fails for all implementations, +or when insufficient memory is available. +Even when these functions fail, the application may still be able +to use the algorithm in question because the built-in implementation +is used in that case, if one is available. +.Pp +.Fn ENGINE_get_table_flags +returns +.Dv ENGINE_TABLE_FLAG_NOINIT +if the global flag is set or 0 otherwise. +.Sh SEE ALSO +.Xr ENGINE_init 3 , +.Xr ENGINE_new 3 , +.Xr ENGINE_register_RSA 3 , +.Xr ENGINE_set_default 3 +.Sh HISTORY +.Fn ENGINE_get_default_RSA , +.Fn ENGINE_get_default_DSA , +.Fn ENGINE_get_default_DH , +and +.Fn ENGINE_get_default_RAND +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 2.9 . +.Pp +.Fn ENGINE_get_cipher_engine , +.Fn ENGINE_get_digest_engine , +.Fn ENGINE_set_table_flags , +and +.Fn ENGINE_get_table_flags +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn ENGINE_get_default_ECDH +and +.Fn ENGINE_get_default_ECDSA +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/ENGINE_init.3 b/man/ENGINE_init.3 new file mode 100644 index 00000000..d41d98a2 --- /dev/null +++ b/man/ENGINE_init.3 @@ -0,0 +1,134 @@ +.\" $OpenBSD: ENGINE_init.3,v 1.2 2018/04/18 03:39:22 schwarze Exp $ +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 18 2018 $ +.Dt ENGINE_INIT 3 +.Os +.Sh NAME +.Nm ENGINE_init , +.Nm ENGINE_finish , +.Nm ENGINE_set_init_function , +.Nm ENGINE_set_finish_function , +.Nm ENGINE_get_init_function , +.Nm ENGINE_get_finish_function +.Nd initialize ENGINE objects +.Sh SYNOPSIS +.In openssl/engine.h +.Ft int +.Fo ENGINE_init +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_finish +.Fa "ENGINE *e" +.Fc +.Ft typedef int +.Fo (*ENGINE_GEN_INT_FUNC_PTR) +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_init_function +.Fa "ENGINE *e" +.Fa "ENGINE_GEN_INT_FUNC_PTR init_f" +.Fc +.Ft int +.Fo ENGINE_set_finish_function +.Fa "ENGINE *e" +.Fa "ENGINE_GEN_INT_FUNC_PTR finish_f" +.Fc +.Ft ENGINE_GEN_INT_FUNC_PTR +.Fo ENGINE_get_init_function +.Fa "const ENGINE *e" +.Fc +.Ft ENGINE_GEN_INT_FUNC_PTR +.Fo ENGINE_get_finish_function +.Fa "const ENGINE *e" +.Fc +.Sh DESCRIPTION +.Fn ENGINE_init +initializes +.Fa e +by calling the +.Fa init_f +previously installed with +.Fn ENGINE_set_init_function , +if any. +In case of success, it also increments both the structural +and the functional reference count by 1. +If no +.Fa init_f +was installed, +.Fn ENGINE_init +always succeeds. +Calling +.Fn ENGINE_init +again after it already succeeded always succeeds, but has no effect +except that it increments both the structural and the functional +reference count by 1. +.Pp +.Fn ENGINE_finish +decrements the functional reference count by 1. +When it reaches 0, it calls the +.Fa finish_f +previously installed with +.Fn ENGINE_set_finish_function , +if any. +If no +.Fa finish_f +was installed, +.Fn ENGINE_finish +always succeeds. +Unless +.Fa finish_f +fails, +.Fn ENGINE_finish +also calls +.Xr ENGINE_free 3 . +.Pp +.Fn ENGINE_init +is internally called by the functions documented in the +.Xr ENGINE_get_default_RSA 3 +manual page. +.Sh RETURN VALUES +.Fn ENGINE_init +and +.Fn ENGINE_finish +return 1 on success or 0 on error. +.Pp +.Fn ENGINE_set_init_function +and +.Fn ENGINE_set_finish_function +always return 1. +.Pp +.Fn ENGINE_get_init_function +and +.Fn ENGINE_get_finish_function +return a function pointer to the respective callback, or +.Dv NULL +if none is installed. +.Sh SEE ALSO +.Xr ENGINE_add 3 , +.Xr ENGINE_ctrl 3 , +.Xr ENGINE_get_default_RSA 3 , +.Xr ENGINE_new 3 , +.Xr ENGINE_register_RSA 3 , +.Xr ENGINE_set_default 3 , +.Xr ENGINE_set_flags 3 , +.Xr ENGINE_set_RSA 3 , +.Xr ENGINE_unregister_RSA 3 +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 2.9 . diff --git a/man/ENGINE_new.3 b/man/ENGINE_new.3 new file mode 100644 index 00000000..f1218b17 --- /dev/null +++ b/man/ENGINE_new.3 @@ -0,0 +1,189 @@ +.\" $OpenBSD: ENGINE_new.3,v 1.3 2018/04/18 03:39:22 schwarze Exp $ +.\" content checked up to: +.\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 18 2018 $ +.Dt ENGINE_NEW 3 +.Os +.Sh NAME +.Nm ENGINE_new , +.Nm ENGINE_up_ref , +.Nm ENGINE_free , +.Nm ENGINE_set_destroy_function , +.Nm ENGINE_get_destroy_function +.Nd create and destroy ENGINE objects +.Sh SYNOPSIS +.In openssl/engine.h +.Ft ENGINE * +.Fn ENGINE_new void +.Ft int +.Fo ENGINE_up_ref +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_free +.Fa "ENGINE *e" +.Fc +.Ft typedef int +.Fo (*ENGINE_GEN_INT_FUNC_PTR) +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_destroy_function +.Fa "ENGINE *e" +.Fa "ENGINE_GEN_INT_FUNC_PTR destroy_f" +.Fc +.Ft ENGINE_GEN_INT_FUNC_PTR +.Fo ENGINE_get_destroy_function +.Fa "const ENGINE *e" +.Fc +.Sh DESCRIPTION +.Vt ENGINE +objects can be used to provide alternative implementations of +cryptographic algorithms, to support additional algorithms, to +support cryptographic hardware, and to switch among alternative +implementations of algorithms at run time. +LibreSSL generally avoids engines and prefers providing +cryptographic functionality in the crypto library itself. +.Pp +.Fn ENGINE_new +allocates and initializes an empty +.Vt ENGINE +object and sets its structural reference count to 1 +and its functional reference count to 0. +For more information about the functional reference count, see the +.Xr ENGINE_init 3 +manual page. +.Pp +Many functions increment the structural reference count by 1 +when successful. +Some of them, including +.Xr ENGINE_get_first 3 , +.Xr ENGINE_get_last 3 , +.Xr ENGINE_get_next 3 , +.Xr ENGINE_get_prev 3 , +and +.Xr ENGINE_by_id 3 , +do so because they return a structural reference to the user. +Other functions, including +.Xr ENGINE_add 3 , +.Xr ENGINE_init 3 , +.Xr ENGINE_get_cipher_engine 3 , +.Xr ENGINE_get_digest_engine 3 , +and the +.Xr ENGINE_get_default_RSA 3 +and +.Xr ENGINE_set_default 3 +families of functions +do so when they store a structural refence internally. +.Pp +.Fn ENGINE_up_ref +explicitly increment the structural reference count by 1. +.Pp +.Fn ENGINE_free +decrements the structural reference count by 1, +and if it reaches 0, the optional +.Fa destroy_f +previously installed with +.Fn ENGINE_set_destroy_function +is called, if one is installed, and both the memory used internally by +.Fa e +and +.Fa e +itself are freed. +If +.Fa e +is a +.Dv NULL +pointer, no action occurs. +.Pp +Many functions internally call the equivalent of +.Fn ENGINE_free . +Some of them, including +.Xr ENGINE_get_next 3 +and +.Xr ENGINE_get_prev 3 , +thus invalidate the structural reference passed in by the user. +Other functions, including +.Xr ENGINE_finish 3 , +.Xr ENGINE_remove 3 , +and the +.Xr ENGINE_set_default 3 +family of functions +do so when an internally stored structural reference is no longer needed. +.Pp +.Fn ENGINE_set_destroy_function +installs a callback function that will be called by +.Fn ENGINE_free , +but only when +.Fa e +actually gets destroyed, +not when only its reference count gets decremented. +The value returned from the +.Fa destroy_f +will be ignored. +.Sh RETURN VALUES +.Fn ENGINE_new +returns a structural reference to the new +.Vt ENGINE +object or +.Dv NULL +if an error occurs. +.Pp +.Fn ENGINE_up_ref +returns 0 if +.Fa e +is +.Dv NULL +and 1 otherwise. +.Pp +.Fn ENGINE_free +and +.Fn ENGINE_set_destroy_function +always return 1. +.Pp +.Fn ENGINE_get_destroy_function +returns a function pointer to the callback, or +.Dv NULL +if none is installed. +.Sh SEE ALSO +.Xr ENGINE_add 3 , +.Xr ENGINE_ctrl 3 , +.Xr ENGINE_get_default_RSA 3 , +.Xr ENGINE_init 3 , +.Xr ENGINE_register_all_RSA 3 , +.Xr ENGINE_register_RSA 3 , +.Xr ENGINE_set_default 3 , +.Xr ENGINE_set_flags 3 , +.Xr ENGINE_set_RSA 3 , +.Xr ENGINE_unregister_RSA 3 +.Sh HISTORY +.Fn ENGINE_new +and +.Fn ENGINE_free +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 2.9 . +.Pp +.Fn ENGINE_set_destroy_function +and +.Fn ENGINE_get_destroy_function +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn ENGINE_up_ref +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.4 . diff --git a/man/ENGINE_register_RSA.3 b/man/ENGINE_register_RSA.3 new file mode 100644 index 00000000..5c63729c --- /dev/null +++ b/man/ENGINE_register_RSA.3 @@ -0,0 +1,142 @@ +.\" $OpenBSD: ENGINE_register_RSA.3,v 1.2 2018/04/18 03:39:22 schwarze Exp $ +.\" content checked up to: +.\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 18 2018 $ +.Dt ENGINE_REGISTER_RSA 3 +.Os +.Sh NAME +.Nm ENGINE_register_RSA , +.Nm ENGINE_register_DSA , +.Nm ENGINE_register_ECDH , +.Nm ENGINE_register_ECDSA , +.Nm ENGINE_register_DH , +.Nm ENGINE_register_RAND , +.Nm ENGINE_register_STORE , +.Nm ENGINE_register_ciphers , +.Nm ENGINE_register_digests , +.Nm ENGINE_register_complete +.Nd register an ENGINE as implementing an algorithm +.Sh SYNOPSIS +.In openssl/engine.h +.Ft int +.Fo ENGINE_register_RSA +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_register_DSA +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_register_ECDH +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_register_ECDSA +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_register_DH +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_register_RAND +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_register_STORE +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_register_ciphers +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_register_digests +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_register_complete +.Fa "ENGINE *e" +.Fc +.Sh DESCRIPTION +In addition to the global table described in +.Xr ENGINE_add 3 , +the crypto library maintains several tables containing references to +.Vt ENGINE +objects implementing one specific cryptographic algorithm. +.Pp +The functions listed in the present manual page append +.Fa e +to the end of the table for the respective algorithm. +.Pp +If +.Fa e +does not contain a method for the requested algorithm, +these functions succeed without having any effect. +.Pp +If +.Fa e +is already registered for the given algorithm, +they move it to the end of the respective table. +.Pp +.Fn ENGINE_register_ciphers +and +.Fn ENGINE_register_digests +are special in so far as an engine may implement +more than one cipher or more than one digest. +In that case, +.Fa e +is registered for all the ciphers or digests it implements. +.Pp +.Fn ENGINE_register_complete +registers +.Fa e +for all algorithms it implements by calling all the other functions. +.Sh RETURN VALUES +These functions return 1 on success or 0 on error. +They only fail if insufficient memory is available. +.Sh SEE ALSO +.Xr ENGINE_add 3 , +.Xr ENGINE_get_default_RSA 3 , +.Xr ENGINE_init 3 , +.Xr ENGINE_new 3 , +.Xr ENGINE_register_all_RSA 3 , +.Xr ENGINE_set_default 3 , +.Xr ENGINE_set_RSA 3 , +.Xr ENGINE_unregister_RSA 3 +.Sh HISTORY +.Fn ENGINE_register_RSA , +.Fn ENGINE_register_DSA , +.Fn ENGINE_register_DH , +.Fn ENGINE_register_RAND , +.Fn ENGINE_register_ciphers , +.Fn ENGINE_register_digests , +and +.Fn ENGINE_register_complete +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn ENGINE_register_ECDH , +.Fn ENGINE_register_ECDSA , +and +.Fn ENGINE_register_STORE +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Sh BUGS +.Fn ENGINE_register_complete +ignores all errors, even memory allocation failure, and always returns 1. diff --git a/man/ENGINE_register_all_RSA.3 b/man/ENGINE_register_all_RSA.3 new file mode 100644 index 00000000..3016eec3 --- /dev/null +++ b/man/ENGINE_register_all_RSA.3 @@ -0,0 +1,123 @@ +.\" $OpenBSD: ENGINE_register_all_RSA.3,v 1.3 2018/04/18 03:39:22 schwarze Exp $ +.\" content checked up to: +.\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 18 2018 $ +.Dt ENGINE_REGISTER_ALL_RSA 3 +.Os +.Sh NAME +.Nm ENGINE_register_all_RSA , +.Nm ENGINE_register_all_DSA , +.Nm ENGINE_register_all_ECDH , +.Nm ENGINE_register_all_ECDSA , +.Nm ENGINE_register_all_DH , +.Nm ENGINE_register_all_RAND , +.Nm ENGINE_register_all_STORE , +.Nm ENGINE_register_all_ciphers , +.Nm ENGINE_register_all_digests , +.Nm ENGINE_register_all_complete , +.Nm ENGINE_load_builtin_engines , +.Nm ENGINE_load_dynamic +.Nd register all engines as implementing an algorithm +.Sh SYNOPSIS +.In openssl/engine.h +.Ft void +.Fn ENGINE_register_all_RSA void +.Ft void +.Fn ENGINE_register_all_DSA void +.Ft void +.Fn ENGINE_register_all_ECDH void +.Ft void +.Fn ENGINE_register_all_ECDSA void +.Ft void +.Fn ENGINE_register_all_DH void +.Ft void +.Fn ENGINE_register_all_RAND void +.Ft void +.Fn ENGINE_register_all_STORE void +.Ft void +.Fn ENGINE_register_all_ciphers void +.Ft void +.Fn ENGINE_register_all_digests void +.Ft int +.Fn ENGINE_register_all_complete void +.Ft void +.Fn ENGINE_load_builtin_engines void +.Ft void +.Fn ENGINE_load_dynamic void +.Sh DESCRIPTION +These functions loop over all the +.Vt ENGINE +objects contained in the global table described in the +.Xr ENGINE_add 3 +manual page. +They register each object for the respective algorithm +by calling the corresponding function described in +.Xr ENGINE_register_RSA 3 . +.Pp +.Fn ENGINE_register_all_complete +calls +.Fn ENGINE_register_complete +in this way, except that it skips those +.Vt ENGINE +objects that have the +.Dv ENGINE_FLAGS_NO_REGISTER_ALL +flag set with +.Xr ENGINE_set_flags 3 . +.Pp +.Fn ENGINE_load_builtin_engines +calls +.Xr OPENSSL_init_crypto 3 +with no options, loads any built-in engines +that are enabled by default, and calls +.Fn ENGINE_register_all_complete . +Currently, LibreSSL does not provide any engines. +.Sy GOST +and +.Sy aesni +support is provided by the crypto library itself +and does not require any engines, not even built-in ones. +.Pp +.Fn ENGINE_load_dynamic +has no effect and is only provided for compatibility. +.Sh SEE ALSO +.Xr ENGINE_add 3 , +.Xr ENGINE_new 3 , +.Xr ENGINE_register_RSA 3 , +.Xr ENGINE_set_flags 3 , +.Xr OPENSSL_config 3 , +.Xr OPENSSL_init_crypto 3 +.Sh HISTORY +.Fn ENGINE_register_all_RSA , +.Fn ENGINE_register_all_DSA , +.Fn ENGINE_register_all_DH , +.Fn ENGINE_register_all_RAND , +.Fn ENGINE_register_all_ciphers , +.Fn ENGINE_register_all_digests , +.Fn ENGINE_register_all_complete , +.Fn ENGINE_load_builtin_engines , +and +.Fn ENGINE_load_dynamic +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn ENGINE_register_all_ECDH , +.Fn ENGINE_register_all_ECDSA , +and +.Fn ENGINE_register_all_STORE +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/ENGINE_set_RSA.3 b/man/ENGINE_set_RSA.3 new file mode 100644 index 00000000..acf4285e --- /dev/null +++ b/man/ENGINE_set_RSA.3 @@ -0,0 +1,325 @@ +.\" $OpenBSD: ENGINE_set_RSA.3,v 1.3 2018/05/17 07:21:32 jmc Exp $ +.\" content checked up to: +.\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: May 17 2018 $ +.Dt ENGINE_SET_RSA 3 +.Os +.Sh NAME +.Nm ENGINE_set_RSA , +.Nm ENGINE_get_RSA , +.Nm ENGINE_set_DSA , +.Nm ENGINE_get_DSA , +.Nm ENGINE_set_ECDH , +.Nm ENGINE_get_ECDH , +.Nm ENGINE_set_ECDSA , +.Nm ENGINE_get_ECDSA , +.Nm ENGINE_set_DH , +.Nm ENGINE_get_DH , +.Nm ENGINE_set_RAND , +.Nm ENGINE_get_RAND , +.Nm ENGINE_set_STORE , +.Nm ENGINE_get_STORE , +.Nm ENGINE_set_ciphers , +.Nm ENGINE_get_ciphers , +.Nm ENGINE_get_cipher , +.Nm ENGINE_set_digests , +.Nm ENGINE_get_digests , +.Nm ENGINE_get_digest +.Nd install and retrieve function tables of crypto engines +.Sh SYNOPSIS +.In openssl/engine.h +.Ft int +.Fo ENGINE_set_RSA +.Fa "ENGINE *e" +.Fa "const RSA_METHOD *rsa_meth" +.Fc +.Ft const RSA_METHOD * +.Fo ENGINE_get_RSA +.Fa "const ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_DSA +.Fa "ENGINE *e" +.Fa "const DSA_METHOD *dsa_meth" +.Fc +.Ft const DSA_METHOD * +.Fo ENGINE_get_DSA +.Fa "const ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_ECDH +.Fa "ENGINE *e" +.Fa "const ECDH_METHOD *dh_meth" +.Fc +.Ft const ECDH_METHOD * +.Fo ENGINE_get_ECDH +.Fa "const ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_ECDSA +.Fa "ENGINE *e" +.Fa "const ECDSA_METHOD *dh_meth" +.Fc +.Ft const ECDSA_METHOD * +.Fo ENGINE_get_ECDSA +.Fa "const ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_DH +.Fa "ENGINE *e" +.Fa "const DH_METHOD *dh_meth" +.Fc +.Ft const DH_METHOD * +.Fo ENGINE_get_DH +.Fa "const ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_RAND +.Fa "ENGINE *e" +.Fa "const RAND_METHOD *rand_meth" +.Fc +.Ft const RAND_METHOD * +.Fo ENGINE_get_RAND +.Fa "const ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_STORE +.Fa "ENGINE *e" +.Fa "const STORE_METHOD *rand_meth" +.Fc +.Ft const STORE_METHOD * +.Fo ENGINE_get_STORE +.Fa "const ENGINE *e" +.Fc +.Ft typedef int +.Fo (*ENGINE_CIPHERS_PTR) +.Fa "ENGINE *e" +.Fa "const EVP_CIPHER **impl" +.Fa "const int **nids" +.Fa "int nid" +.Fc +.Ft int +.Fo ENGINE_set_ciphers +.Fa "ENGINE *e" +.Fa "ENGINE_CIPHERS_PTR f" +.Fc +.Ft ENGINE_CIPHERS_PTR +.Fo ENGINE_get_ciphers +.Fa "const ENGINE *e" +.Fc +.Ft const EVP_CIPHER * +.Fo ENGINE_get_cipher +.Fa "ENGINE *e" +.Fa "int nid" +.Fc +.Ft typedef int +.Fo (*ENGINE_DIGESTS_PTR) +.Fa "ENGINE *e" +.Fa "const EVP_MD **impl" +.Fa "const int **nids" +.Fa "int nid" +.Fc +.Ft int +.Fo ENGINE_set_digests +.Fa "ENGINE *e" +.Fa "ENGINE_DIGESTS_PTR f" +.Fc +.Ft ENGINE_DIGESTS_PTR +.Fo ENGINE_get_digests +.Fa "const ENGINE *e" +.Fc +.Ft const EVP_MD * +.Fo ENGINE_get_digest +.Fa "ENGINE *e" +.Fa "int nid" +.Fc +.Sh DESCRIPTION +The +.Fn ENGINE_set_* +functions install a table of function pointers +implementing the respective algorithm in +.Fa e . +Partial information about the various method objects is available from +.Xr RSA_meth_new 3 , +.Xr RSA_get_default_method 3 , +.Xr DSA_meth_new 3 , +.Xr DSA_get_default_method 3 , +.Fn ECDH_get_default_method , +.Xr ECDSA_get_default_method 3 , +.Xr DH_get_default_method 3 , +.Xr RAND_get_rand_method 3 , +.Xr EVP_get_cipherbynid 3 , +and +.Xr EVP_get_digestbynid 3 . +.Vt STORE_METHOD +is an incomplete type, and the pointers to it are not used for anything. +For complete descriptions of these types, +refer to the respective header files. +.Pp +The functions described in the +.Xr ENGINE_register_RSA 3 +and +.Xr ENGINE_set_default 3 +manual pages only have an effect after function pointers +were installed using the functions described here. +.Pp +.Fn ENGINE_set_ciphers +and +.Fn ENGINE_set_digests +are special in so far as the +.Vt ENGINE +structure does not provide fields to store function pointers +implementing ciphers or digests. +Instead, these two functions only install a callback to +retrieve implementations. +Where the pointers to the implementations are stored internally, +how they get initialized, and how the +.Vt ENGINE_CIPHERS_PTR +and +.Vt ENGINE_DIGESTS_PTR +callbacks retrieve them +is up to the implementation of each individual engine. +.Pp +If the +.Vt ENGINE_CIPHERS_PTR +and +.Vt ENGINE_DIGESTS_PTR +callbacks are called with a non-zero +.Fa nid , +they retrieve the implementation of that cipher or digest, +respectively. +In this case, a +.Dv NULL +pointer can be passed as the +.Fa nids +argument. +.Fn ENGINE_get_cipher +and +.Fn ENGINE_get_digest +call the callbacks installed in +.Fa e +in this way. +.Pp +If 0 is passed as the +.Fa nid +argument, an internal pointer +to the array of implementations available in +.Fa e +is returned in +.Pf * Fa impl , +and an internal pointer +to the array of corresponding identifiers in +.Pf * Fa nids . +The return value of the callback indicates +the number of implementations returned. +.Pp +The +.Fn ENGINE_get_* +functions retrieve the previously installed function tables. +They are used when constructing basic cryptographic objects +as shown in the following table: +.Bl -column "ENGINE_get_digestMM" +.It Accessor: Ta Called by: +.It Fn ENGINE_get_RSA Ta Xr RSA_new_method 3 , Xr RSA_new 3 +.It Fn ENGINE_get_DSA Ta Xr DSA_new_method 3 , Xr DSA_new 3 +.It Fn ENGINE_get_ECDH Ta Fn ECDH_set_method , Fn ECDH_compute_key +.It Fn ENGINE_get_ECDSA Ta Xr ECDSA_set_method 3 , Xr ECDSA_sign_setup 3 , +.Xr ECDSA_do_sign_ex 3 , Xr ECDSA_do_verify 3 +.It Fn ENGINE_get_DH Ta Xr DH_new_method 3 , Xr DH_new 3 +.It Fn ENGINE_get_RAND Ta unused +.It Fn ENGINE_get_STORE Ta unused +.It Fn ENGINE_get_cipher Ta Xr EVP_CipherInit_ex 3 +.It Fn ENGINE_get_digest Ta Xr EVP_DigestInit_ex 3 +.El +.Sh RETURN VALUES +The +.Fn ENGINE_set_* +functions return 1 on success or 0 on error. +Currently, they cannot fail. +.Pp +The +.Fn ENGINE_get_* +functions return a method object for the respective algorithm, or +.Dv NULL +if none is installed. +.Pp +.Fn ENGINE_get_ciphers +and +.Fn ENGINE_get_digests +return a function pointer to the respective callback, or +.Dv NULL +if none is installed. +.Pp +.Fn ENGINE_get_cipher +returns an +.Vt EVP_CIPHER +object implementing the cipher +.Fa nid +or +.Dv NULL +if +.Fa e +does not implement that cipher. +.Pp +.Fn ENGINE_get_digest +returns an +.Vt EVP_MD +object implementing the digest +.Fa nid +or +.Dv NULL +if +.Fa e +does not implement that digest. +.Sh SEE ALSO +.Xr ENGINE_ctrl 3 , +.Xr ENGINE_new 3 , +.Xr ENGINE_register_RSA 3 , +.Xr ENGINE_set_default 3 , +.Xr ENGINE_set_flags 3 +.Sh HISTORY +.Fn ENGINE_set_RSA , +.Fn ENGINE_get_RSA , +.Fn ENGINE_set_DSA , +.Fn ENGINE_get_DSA , +.Fn ENGINE_set_DH , +.Fn ENGINE_get_DH , +.Fn ENGINE_set_RAND , +.Fn ENGINE_get_RAND , +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 2.9 . +.Pp +.Fn ENGINE_set_ciphers , +.Fn ENGINE_get_ciphers , +.Fn ENGINE_get_cipher , +.Fn ENGINE_set_digests , +.Fn ENGINE_get_digests , +and +.Fn ENGINE_get_digest +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn ENGINE_set_ECDH , +.Fn ENGINE_get_ECDH , +.Fn ENGINE_set_ECDSA , +.Fn ENGINE_get_ECDSA , +.Fn ENGINE_set_STORE , +and +.Fn ENGINE_get_STORE +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/ENGINE_set_default.3 b/man/ENGINE_set_default.3 new file mode 100644 index 00000000..d63dc2f3 --- /dev/null +++ b/man/ENGINE_set_default.3 @@ -0,0 +1,185 @@ +.\" $OpenBSD: ENGINE_set_default.3,v 1.3 2018/04/18 12:56:50 jmc Exp $ +.\" content checked up to: +.\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 18 2018 $ +.Dt ENGINE 3 +.Os +.Sh NAME +.Nm ENGINE_set_default , +.Nm ENGINE_set_default_string , +.Nm ENGINE_set_default_RSA , +.Nm ENGINE_set_default_DSA , +.Nm ENGINE_set_default_ECDH , +.Nm ENGINE_set_default_ECDSA , +.Nm ENGINE_set_default_DH , +.Nm ENGINE_set_default_RAND , +.Nm ENGINE_set_default_ciphers , +.Nm ENGINE_set_default_digests +.Nd register an ENGINE as the default for an algorithm +.Sh SYNOPSIS +.Ft int +.Fo ENGINE_set_default_RSA +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_default_DSA +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_default_ECDH +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_default_ECDSA +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_default_DH +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_default_RAND +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_default_ciphers +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_default_digests +.Fa "ENGINE *e" +.Fc +.Ft int +.Fo ENGINE_set_default +.Fa "ENGINE *e" +.Fa "unsigned int flags" +.Fc +.Ft int +.Fo ENGINE_set_default_string +.Fa "ENGINE *e" +.Fa "const char *list" +.Fc +.Sh DESCRIPTION +These functions register +.Fa e +as implementing the respective algorithm +like the functions described in the +.Xr ENGINE_register_RSA 3 +manual page do it. +In addition, they call +.Xr ENGINE_init 3 +on +.Fa e +and select +.Fa e +as the default implementation of the respective algorithm to be +returned by the functions described in +.Xr ENGINE_get_default_RSA 3 +in the future. +If another engine was previously selected +as the default implementation of the respective algorithm, +.Xr ENGINE_finish 3 +is called on that previous engine. +.Pp +If +.Fa e +implements more than one cipher or digest, +.Fn ENGINE_set_default_ciphers +and +.Fn ENGINE_set_default_digests +register and select it for all these ciphers and digests, respectively. +.Pp +.Fn ENGINE_set_default +registers +.Fa e +as the default implementation of all algorithms specified by the +.Fa flags +by calling the appropriate ones among the other functions. +Algorithms can be selected by combining any number of the +following constants with bitwise OR: +.Dv ENGINE_METHOD_ALL , +.Dv ENGINE_METHOD_RSA , +.Dv ENGINE_METHOD_DSA , +.Dv ENGINE_METHOD_ECDH , +.Dv ENGINE_METHOD_ECDSA , +.Dv ENGINE_METHOD_DH , +.Dv ENGINE_METHOD_RAND , +.Dv ENGINE_METHOD_CIPHERS , +.Dv ENGINE_METHOD_DIGESTS , +.Dv ENGINE_METHOD_PKEY_METHS , +and +.Dv ENGINE_METHOD_PKEY_ASN1_METHS . +.Pp +.Fn ENGINE_set_default_string +is similar except that it selects the algorithms according to the string +.Fa def_list , +which contains an arbitrary number of comma-separated keywords from +the following list: ALL, RSA, DSA, ECDH, ECDSA, DH, RAND, CIPHERS, +DIGESTS, PKEY_CRYPTO, PKEY_ASN1, and PKEY. +PKEY_CRYPTO corresponds to +.Dv ENGINE_METHOD_PKEY_METHS , +PKEY_ASN1 to +.Dv ENGINE_METHOD_PKEY_ASN1_METHS , +and PKEY selects both. +.Sh RETURN VALUES +These functions return 1 on success or 0 on error. +They fail if +.Xr ENGINE_init 3 +fails or if insufficient memory is available. +.Sh SEE ALSO +.Xr ENGINE_get_default_RSA 3 , +.Xr ENGINE_init 3 , +.Xr ENGINE_new 3 , +.Xr ENGINE_register_RSA 3 , +.Xr ENGINE_set_RSA 3 , +.Xr ENGINE_unregister_RSA 3 +.Sh HISTORY +.Fn ENGINE_set_default , +.Fn ENGINE_set_default_RSA , +.Fn ENGINE_set_default_DSA , +.Fn ENGINE_set_default_DH , +and +.Fn ENGINE_set_default_RAND +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 2.9 . +.Pp +.Fn ENGINE_set_default_string , +.Fn ENGINE_set_default_ciphers , +and +.Fn ENGINE_set_default_digests +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn ENGINE_set_default_ECDH +and +.Fn ENGINE_set_default_ECDSA +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Sh CAVEATS +Failure of +.Xr ENGINE_finish 3 +is ignored. +.Sh BUGS +Even when +.Fn ENGINE_set_default +or +.Fn ENGINE_set_default_string +fail, they typically still register +.Fa e +for some algorithms, but usually not for all it could be registered +for by calling the individual functions. diff --git a/man/ENGINE_set_flags.3 b/man/ENGINE_set_flags.3 new file mode 100644 index 00000000..33e8f333 --- /dev/null +++ b/man/ENGINE_set_flags.3 @@ -0,0 +1,92 @@ +.\" $OpenBSD: ENGINE_set_flags.3,v 1.2 2018/04/18 03:39:22 schwarze Exp $ +.\" content checked up to: +.\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 18 2018 $ +.Dt ENGINE_SET_FLAGS 3 +.Os +.Sh NAME +.Nm ENGINE_set_flags , +.Nm ENGINE_get_flags +.Nd modify the behaviour of an ENGINE object +.Sh SYNOPSIS +.In openssl/engine.h +.Ft int +.Fo ENGINE_set_flags +.Fa "ENGINE *e" +.Fa "int flags" +.Fc +.Ft int +.Fo ENGINE_get_flags +.Fa "const ENGINE *e" +.Fc +.Sh DESCRIPTION +.Fn ENGINE_set_flags +sets the flags attribute of +.Fa e +to the new +.Fa flags . +The previous state of the flags attribute is overwritten. +Flags that were previously set are cleared +unless they are also present in the new +.Fa flags . +.Pp +The +.Fa flags +argument can be the bitwise OR of zero or more +of the following constants: +.Bl -tag -width Ds +.It Dv ENGINE_FLAGS_BY_ID_COPY +.Xr ENGINE_by_id 3 +returns a shallow copy of the +.Vt ENGINE +object it found rather than incrementing the reference count +and returning a pointer to the original. +.It Dv ENGINE_FLAGS_MANUAL_CMD_CTRL +.Xr ENGINE_ctrl 3 +lets the function installed with +.Xr ENGINE_set_ctrl_function 3 +handle all commands except +.Dv ENGINE_CTRL_HAS_CTRL_FUNCTION , +even the builtin commands. +.It Dv ENGINE_FLAGS_NO_REGISTER_ALL +.Xr ENGINE_register_all_complete 3 +skips +.Fa e . +.El +.Sh RETURN VALUES +.Fn ENGINE_set_flags +always returns 1. +.Pp +.Fn ENGINE_get_flags +returns the +.Fa flags +attribute of +.Fa e . +.Sh SEE ALSO +.Xr ENGINE_by_id 3 , +.Xr ENGINE_ctrl 3 , +.Xr ENGINE_init 3 , +.Xr ENGINE_new 3 , +.Xr ENGINE_register_all_complete 3 , +.Xr ENGINE_set_RSA 3 +.Sh HISTORY +.Fn ENGINE_set_flags +and +.Fn ENGINE_get_flags +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/ENGINE_unregister_RSA.3 b/man/ENGINE_unregister_RSA.3 new file mode 100644 index 00000000..d0373063 --- /dev/null +++ b/man/ENGINE_unregister_RSA.3 @@ -0,0 +1,119 @@ +.\" $OpenBSD: ENGINE_unregister_RSA.3,v 1.3 2018/04/18 03:39:22 schwarze Exp $ +.\" content checked up to: +.\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 18 2018 $ +.Dt ENGINE_UNREGISTER_RSA 3 +.Os +.Sh NAME +.Nm ENGINE_unregister_RSA , +.Nm ENGINE_unregister_DSA , +.Nm ENGINE_unregister_ECDH , +.Nm ENGINE_unregister_ECDSA , +.Nm ENGINE_unregister_DH , +.Nm ENGINE_unregister_RAND , +.Nm ENGINE_unregister_STORE , +.Nm ENGINE_unregister_ciphers , +.Nm ENGINE_unregister_digests +.Nd revoke the registration of an ENGINE object +.Sh SYNOPSIS +.In openssl/engine.h +.Ft void +.Fo ENGINE_unregister_RSA +.Fa "ENGINE *e" +.Fc +.Ft void +.Fo ENGINE_unregister_DSA +.Fa "ENGINE *e" +.Fc +.Ft void +.Fo ENGINE_unregister_ECDH +.Fa "ENGINE *e" +.Fc +.Ft void +.Fo ENGINE_unregister_ECDSA +.Fa "ENGINE *e" +.Fc +.Ft void +.Fo ENGINE_unregister_DH +.Fa "ENGINE *e" +.Fc +.Ft void +.Fo ENGINE_unregister_RAND +.Fa "ENGINE *e" +.Fc +.Ft void +.Fo ENGINE_unregister_STORE +.Fa "ENGINE *e" +.Fc +.Ft void +.Fo ENGINE_unregister_ciphers +.Fa "ENGINE *e" +.Fc +.Ft void +.Fo ENGINE_unregister_digests +.Fa "ENGINE *e" +.Fc +.Sh DESCRIPTION +These functions remove +.Fa e +from the list of +.Vt ENGINE +objects that were previously registered for the respective algorithm +with the functions described in +.Xr ENGINE_register_RSA 3 . +.Pp +If +.Fa e +is currently used as the default engine for the algorithm +as described in the +.Fn ENGINE_set_default 3 +and +.Fn ENGINE_get_default_RSA 3 +manual pages, +.Xr ENGINE_finish 3 +is also called. +.Pp +.Fn ENGINE_unregister_ciphers +and +.Fn ENGINE_unregister_digests +unregister +.Fa e +for all ciphers or digests, respectively. +.Sh SEE ALSO +.Xr ENGINE_cleanup 3 , +.Xr ENGINE_finish 3 , +.Xr ENGINE_new 3 , +.Xr ENGINE_register_RSA 3 , +.Xr ENGINE_set_default 3 +.Sh HISTORY +.Fn ENGINE_unregister_RSA , +.Fn ENGINE_unregister_DSA , +.Fn ENGINE_unregister_DH , +.Fn ENGINE_unregister_RAND , +.Fn ENGINE_unregister_ciphers , +and +.Fn ENGINE_unregister_digests +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn ENGINE_unregister_ECDH , +.Fn ENGINE_unregister_ECDSA , +and +.Fn ENGINE_unregister_STORE +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/ERR.3 b/man/ERR.3 index 973ba271..63787f1f 100644 --- a/man/ERR.3 +++ b/man/ERR.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR.3,v 1.5 2016/11/23 17:54:15 schwarze Exp $ +.\" $OpenBSD: ERR.3,v 1.6 2019/03/10 14:50:05 schwarze Exp $ .\" OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700 .\" .\" This file was written by Ulf Moeller and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 23 2016 $ +.Dd $Mdocdate: March 10 2019 $ .Dt ERR 3 .Os .Sh NAME @@ -200,7 +200,6 @@ The hash tables can be obtained by calling and .Fn ERR_get_string_table . .Sh SEE ALSO -.Xr CRYPTO_set_locking_callback 3 , .Xr ERR_clear_error 3 , .Xr ERR_error_string 3 , .Xr ERR_get_error 3 , diff --git a/man/ERR_GET_LIB.3 b/man/ERR_GET_LIB.3 index 03f56c09..bc14f0e2 100644 --- a/man/ERR_GET_LIB.3 +++ b/man/ERR_GET_LIB.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR_GET_LIB.3,v 1.5 2016/12/16 08:53:30 schwarze Exp $ +.\" $OpenBSD: ERR_GET_LIB.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL doc/man3/ERR_GET_LIB.pod 3dfda1a6 Dec 12 11:14:40 2016 -0500 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 16 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ERR_GET_LIB 3 .Os .Sh NAME @@ -119,6 +119,8 @@ returns non-zero if the error is fatal or 0 otherwise. .Sh HISTORY .Fn ERR_GET_LIB , .Fn ERR_GET_FUNC , +.Fn ERR_GET_REASON , and -.Fn ERR_GET_REASON -are available in all versions of SSLeay and OpenSSL. +.Fn ERR_FATAL_ERROR +first appeared in SSLeay 0.4.4 and have been available since +.Ox 2.4 . diff --git a/man/ERR_clear_error.3 b/man/ERR_clear_error.3 index 7ad4a4ed..54f563e1 100644 --- a/man/ERR_clear_error.3 +++ b/man/ERR_clear_error.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR_clear_error.3,v 1.3 2016/11/23 17:58:42 schwarze Exp $ +.\" $OpenBSD: ERR_clear_error.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 23 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ERR_CLEAR_ERROR 3 .Os .Sh NAME @@ -66,4 +66,5 @@ empties the current thread's error queue. .Xr ERR_get_error 3 .Sh HISTORY .Fn ERR_clear_error -is available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.4.4 and has been available since +.Ox 2.4 . diff --git a/man/ERR_error_string.3 b/man/ERR_error_string.3 index 48f32302..60f91328 100644 --- a/man/ERR_error_string.3 +++ b/man/ERR_error_string.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR_error_string.3,v 1.4 2016/11/23 17:55:31 schwarze Exp $ +.\" $OpenBSD: ERR_error_string.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 23 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ERR_ERROR_STRING 3 .Os .Sh NAME @@ -163,7 +163,14 @@ if none is registered for the error code. .Xr ERR_print_errors 3 , .Xr SSL_load_error_strings 3 .Sh HISTORY -.Fn ERR_error_string -is available in all versions of SSLeay and OpenSSL. +.Fn ERR_error_string , +.Fn ERR_lib_error_string , +.Fn ERR_func_error_string , +and +.Fn ERR_reason_error_string +first appeared in SSLeay 0.4.4 and have been available since +.Ox 2.4 . +.Pp .Fn ERR_error_string_n -was added in OpenSSL 0.9.6. +first appeared in OpenSSL 0.9.6 and has been available since +.Ox 2.9 . diff --git a/man/ERR_get_error.3 b/man/ERR_get_error.3 index 361d7ab7..f3bcc09c 100644 --- a/man/ERR_get_error.3 +++ b/man/ERR_get_error.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR_get_error.3,v 1.4 2016/11/23 17:59:29 schwarze Exp $ +.\" $OpenBSD: ERR_get_error.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 23 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ERR_GET_ERROR 3 .Os .Sh NAME @@ -168,18 +168,24 @@ The error code, or 0 if there is no error in the queue. .Xr ERR_error_string 3 , .Xr ERR_GET_LIB 3 .Sh HISTORY -.Fn ERR_get_error , -.Fn ERR_peek_error , -.Fn ERR_get_error_line , +.Fn ERR_get_error +and +.Fn ERR_peek_error +first appeared in SSLeay 0.4.4. +.Fn ERR_get_error_line and .Fn ERR_peek_error_line -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.6.0. .Fn ERR_get_error_line_data and .Fn ERR_peek_error_line_data -were added in SSLeay 0.9.0. +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp .Fn ERR_peek_last_error , .Fn ERR_peek_last_error_line , and .Fn ERR_peek_last_error_line_data -were added in OpenSSL 0.9.7. +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/ERR_load_crypto_strings.3 b/man/ERR_load_crypto_strings.3 index 812258f6..5421781b 100644 --- a/man/ERR_load_crypto_strings.3 +++ b/man/ERR_load_crypto_strings.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR_load_crypto_strings.3,v 1.5 2017/01/26 04:37:08 schwarze Exp $ +.\" $OpenBSD: ERR_load_crypto_strings.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 26 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ERR_LOAD_CRYPTO_STRINGS 3 .Os .Sh NAME @@ -119,11 +119,16 @@ frees all previously loaded error strings. .Xr ERR 3 , .Xr ERR_error_string 3 .Sh HISTORY -.Fn ERR_load_crypto_strings , -.Fn SSL_load_error_strings , +.Fn ERR_load_crypto_strings and +.Fn SSL_load_error_strings +first appeared in SSLeay 0.4.4. .Fn ERR_free_strings -are available in all versions of SSLeay and OpenSSL. +and +.Fn ERR_load_BN_strings +first appeared in SSLeay 0.5.1. +These functions been available since +.Ox 2.4 . .Sh BUGS Even though the error strings are already compiled into the object code of the library as static strings, these functions store them diff --git a/man/ERR_load_strings.3 b/man/ERR_load_strings.3 index 74fd989b..44fde08c 100644 --- a/man/ERR_load_strings.3 +++ b/man/ERR_load_strings.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR_load_strings.3,v 1.4 2016/11/23 17:59:29 schwarze Exp $ +.\" $OpenBSD: ERR_load_strings.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 23 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ERR_LOAD_STRINGS 3 .Os .Sh NAME @@ -107,9 +107,11 @@ returns a new library number. .Sh SEE ALSO .Xr ERR 3 .Sh HISTORY -.Fn ERR_load_error_strings +.Fn ERR_load_strings and .Fn ERR_PACK -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.4.4. .Fn ERR_get_next_error_library -was added in SSLeay 0.9.0. +first appeared in SSLeay 0.9.0. +These functions have been available since +.Ox 2.4 . diff --git a/man/ERR_print_errors.3 b/man/ERR_print_errors.3 index aedc65d6..a6fdbc0c 100644 --- a/man/ERR_print_errors.3 +++ b/man/ERR_print_errors.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR_print_errors.3,v 1.4 2016/11/23 17:56:36 schwarze Exp $ +.\" $OpenBSD: ERR_print_errors.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller , @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 23 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ERR_PRINT_ERRORS 3 .Os .Sh NAME @@ -116,6 +116,12 @@ return no values. .Xr SSL_load_error_strings 3 .Sh HISTORY .Fn ERR_print_errors -and +first appeared in SSLeay 0.4.5. .Fn ERR_print_errors_fp -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.6.0. +Both functions have been available since +.Ox 2.4 . +.Pp +.Fn ERR_print_errors_cb +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . diff --git a/man/ERR_put_error.3 b/man/ERR_put_error.3 index 3011e16d..142d2eb2 100644 --- a/man/ERR_put_error.3 +++ b/man/ERR_put_error.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR_put_error.3,v 1.5 2017/02/20 23:21:19 beck Exp $ +.\" $OpenBSD: ERR_put_error.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: February 20 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ERR_PUT_ERROR 3 .Os .Sh NAME @@ -147,6 +147,12 @@ macro. .Xr ERR_load_strings 3 .Sh HISTORY .Fn ERR_put_error -is available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.4.4. .Fn ERR_add_error_data -was added in SSLeay 0.9.0. +first appeared in SSLeay 0.9.0. +Both functions have been available since +.Ox 2.4 . +.Pp +.Fn ERR_add_error_vdata +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . diff --git a/man/ERR_remove_state.3 b/man/ERR_remove_state.3 index 7fd63aa0..0a879782 100644 --- a/man/ERR_remove_state.3 +++ b/man/ERR_remove_state.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR_remove_state.3,v 1.3 2016/11/23 17:59:29 schwarze Exp $ +.\" $OpenBSD: ERR_remove_state.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Ulf Moeller and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 23 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt ERR_REMOVE_STATE 3 .Os .Sh NAME @@ -101,8 +101,12 @@ return no value. .Xr ERR 3 .Sh HISTORY .Fn ERR_remove_state -is available in all versions of SSLeay and OpenSSL. -It was deprecated in OpenSSL 1.0.0 when +first appeared in SSLeay 0.6.1 and has been available since +.Ox 2.4 . +.Pp +It was deprecated in OpenSSL 1.0.0 and +.Ox 4.9 +when .Fn ERR_remove_thread_state was introduced and thread IDs were introduced to identify threads instead of diff --git a/man/ERR_set_mark.3 b/man/ERR_set_mark.3 index bc8e115f..2f3486d8 100644 --- a/man/ERR_set_mark.3 +++ b/man/ERR_set_mark.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ERR_set_mark.3,v 1.3 2016/11/23 17:59:29 schwarze Exp $ +.\" $OpenBSD: ERR_set_mark.3,v 1.4 2018/03/23 00:09:11 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Richard Levitte . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 23 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt ERR_SET_MARK 3 .Os .Sh NAME @@ -82,4 +82,5 @@ the stack became empty, otherwise 1. .Fn ERR_set_mark and .Fn ERR_pop_to_mark -were added in OpenSSL 0.9.8. +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/ESS_SIGNING_CERT_new.3 b/man/ESS_SIGNING_CERT_new.3 index ae23b46c..6b5199dc 100644 --- a/man/ESS_SIGNING_CERT_new.3 +++ b/man/ESS_SIGNING_CERT_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ESS_SIGNING_CERT_new.3,v 1.3 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: ESS_SIGNING_CERT_new.3,v 1.4 2018/03/23 04:34:23 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt ESS_SIGNING_CERT_NEW 3 .Os .Sh NAME @@ -109,3 +109,7 @@ Signing Certificate Attribute Definition Version 1 according to RFC 2634, not the Signing Certificate Attribute Definition Version 2 according to RFC 5035. +.Sh HISTORY +These functions first appeared in OpenSSL 1.0.0 +and have been available since +.Ox 4.9 . diff --git a/man/EVP_AEAD_CTX_init.3 b/man/EVP_AEAD_CTX_init.3 index debcc773..33103d39 100644 --- a/man/EVP_AEAD_CTX_init.3 +++ b/man/EVP_AEAD_CTX_init.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_AEAD_CTX_init.3,v 1.6 2017/08/28 17:43:43 jsing Exp $ +.\" $OpenBSD: EVP_AEAD_CTX_init.3,v 1.8 2019/03/21 14:12:48 jmc Exp $ .\" .\" Copyright (c) 2014, Google Inc. .\" Parts of the text were written by Adam Langley and David Benjamin. @@ -16,7 +16,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 28 2017 $ +.Dd $Mdocdate: March 21 2019 $ .Dt EVP_AEAD_CTX_INIT 3 .Os .Sh NAME @@ -30,7 +30,8 @@ .Nm EVP_AEAD_nonce_length , .Nm EVP_aead_aes_128_gcm , .Nm EVP_aead_aes_256_gcm , -.Nm EVP_aead_chacha20_poly1305 +.Nm EVP_aead_chacha20_poly1305 , +.Nm EVP_aead_xchacha20_poly1305 .Nd authenticated encryption with additional data .Sh SYNOPSIS .In openssl/evp.h @@ -101,6 +102,10 @@ .Fo EVP_aead_chacha20_poly1305 .Fa void .Fc +.Ft const EVP_AEAD * +.Fo EVP_aead_xchacha20_poly1305 +.Fa void +.Fc .Sh DESCRIPTION AEAD (Authenticated Encryption with Additional Data) couples confidentiality and integrity in a single primitive. @@ -219,6 +224,8 @@ AES-128 in Galois Counter Mode. AES-256 in Galois Counter Mode. .It Fn EVP_aead_chacha20_poly1305 ChaCha20 with a Poly1305 authenticator. +.It Fn EVP_aead_xchacha20_poly1305 +XChaCha20 with a Poly1305 authenticator. .El .Pp Where possible the @@ -285,6 +292,13 @@ EVP_AEAD_CTX_cleanup(&ctx); .%R RFC 7539 .%T ChaCha20 and Poly1305 for IETF Protocols .Re +.Pp +.Rs +.%A S. Arciszewski +.%D October 2018 +.%R draft-arciszewski-xchacha-02 +.%T XChaCha: eXtended-nonce ChaCha and AEAD_XChaCha20_Poly1305 +.Re .Sh HISTORY AEAD is based on the implementation by .An Adam Langley diff --git a/man/EVP_BytesToKey.3 b/man/EVP_BytesToKey.3 index b7656481..1178c77a 100644 --- a/man/EVP_BytesToKey.3 +++ b/man/EVP_BytesToKey.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_BytesToKey.3,v 1.5 2016/11/24 00:20:36 schwarze Exp $ +.\" $OpenBSD: EVP_BytesToKey.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 24 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt EVP_BYTESTOKEY 3 .Os .Sh NAME @@ -138,3 +138,7 @@ returns the size of the derived key in bytes or 0 on error. .Xr EVP_EncryptInit 3 , .Xr PKCS5_PBKDF2_HMAC 3 , .Xr RAND_bytes 3 +.Sh HISTORY +.Fn EVP_BytesToKey +first appeared in SSLeay 0.5.1 and has been available since +.Ox 2.4 . diff --git a/man/EVP_DigestInit.3 b/man/EVP_DigestInit.3 index c327164b..5ed639e5 100644 --- a/man/EVP_DigestInit.3 +++ b/man/EVP_DigestInit.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: EVP_DigestInit.3,v 1.6 2017/03/25 17:54:04 schwarze Exp $ -.\" OpenSSL d2a56999 Sep 24 13:37:16 2016 +0200 -.\" OpenSSL 7f572e95 Dec 2 13:57:04 2015 +0000 +.\" $OpenBSD: EVP_DigestInit.3,v 1.15 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL 7f572e95 Dec 2 13:57:04 2015 +0000 +.\" selective merge up to: OpenSSL a95d7574 Jul 2 12:16:38 2017 -0400 .\" -.\" This file was written by Dr. Stephen Henson . +.\" This file was written by Dr. Stephen Henson +.\" and Richard Levitte . .\" Copyright (c) 2000-2004, 2009, 2012-2016 The OpenSSL Project. .\" All rights reserved. .\" @@ -50,18 +51,21 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 25 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt EVP_DIGESTINIT 3 .Os .Sh NAME +.Nm EVP_MD_CTX_new , +.Nm EVP_MD_CTX_reset , +.Nm EVP_MD_CTX_free , .Nm EVP_MD_CTX_init , .Nm EVP_MD_CTX_create , +.Nm EVP_MD_CTX_cleanup , +.Nm EVP_MD_CTX_destroy , .Nm EVP_MD_CTX_ctrl , .Nm EVP_DigestInit_ex , .Nm EVP_DigestUpdate , .Nm EVP_DigestFinal_ex , -.Nm EVP_MD_CTX_cleanup , -.Nm EVP_MD_CTX_destroy , .Nm EVP_MD_CTX_copy_ex , .Nm EVP_DigestInit , .Nm EVP_DigestFinal , @@ -76,7 +80,6 @@ .Nm EVP_MD_CTX_block_size , .Nm EVP_MD_CTX_type , .Nm EVP_md_null , -.Nm EVP_md2 , .Nm EVP_md5 , .Nm EVP_md5_sha1 , .Nm EVP_sha1 , @@ -93,13 +96,31 @@ .Nd EVP digest routines .Sh SYNOPSIS .In openssl/evp.h +.Ft EVP_MD_CTX * +.Fn EVP_MD_CTX_new void +.Ft int +.Fo EVP_MD_CTX_reset +.Fa "EVP_MD_CTX *ctx" +.Fc +.Ft void +.Fo EVP_MD_CTX_free +.Fa "EVP_MD_CTX *ctx" +.Fc .Ft void .Fo EVP_MD_CTX_init .Fa "EVP_MD_CTX *ctx" .Fc .Ft EVP_MD_CTX * .Fn EVP_MD_CTX_create void +.Ft int +.Fo EVP_MD_CTX_cleanup +.Fa "EVP_MD_CTX *ctx" +.Fc .Ft void +.Fo EVP_MD_CTX_destroy +.Fa "EVP_MD_CTX *ctx" +.Fc +.Ft int .Fo EVP_MD_CTX_ctrl .Fa "EVP_MD_CTX *ctx" .Fa "int cmd" @@ -125,14 +146,6 @@ .Fa "unsigned int *s" .Fc .Ft int -.Fo EVP_MD_CTX_cleanup -.Fa "EVP_MD_CTX *ctx" -.Fc -.Ft void -.Fo EVP_MD_CTX_destroy -.Fa "EVP_MD_CTX *ctx" -.Fc -.Ft int .Fo EVP_MD_CTX_copy_ex .Fa "EVP_MD_CTX *out" .Fa "const EVP_MD_CTX *in" @@ -189,8 +202,6 @@ .Ft const EVP_MD * .Fn EVP_md_null void .Ft const EVP_MD * -.Fn EVP_md2 void -.Ft const EVP_MD * .Fn EVP_md5 void .Ft const EVP_MD * .Fn EVP_md5_sha1 void @@ -223,29 +234,57 @@ .Fa "const ASN1_OBJECT *o" .Fc .Sh DESCRIPTION -The EVP digest routines are a high level interface to message digests. +The EVP digest routines are a high level interface to message digests +and should be used instead of the cipher-specific functions. +.Pp +.Fn EVP_MD_CTX_new +allocates a new, empty digest context. +.Pp +.Fn EVP_MD_CTX_reset +cleans up +.Fa ctx +and resets it to the state it had after +.Fn EVP_MD_CTX_new , +such that it can be reused. +It is also suitable for digest contexts on the stack that were +used and are no longer needed. +.Pp +.Fn EVP_MD_CTX_free +cleans up +.Fa ctx +and frees the space allocated to it. .Pp .Fn EVP_MD_CTX_init -initializes the digest context -.Fa ctx . +is a deprecated function to clear a digest context on the stack +before use. +Do not use it on a digest context returned from +.Fn EVP_MD_CTX_new +or one one that was already used. .Pp -.Fn EVP_MD_CTX_create -allocates, initializes, and returns a digest context. +.Fn EVP_MD_CTX_create , +.Fn EVP_MD_CTX_cleanup , +and +.Fn EVP_MD_CTX_destroy +are deprecated aliases for +.Fn EVP_MD_CTX_new , +.Fn EVP_MD_CTX_reset , +and +.Fn EVP_MD_CTX_free , +respectively. .Pp .Fn EVP_MD_CTX_ctrl performs digest-specific control actions on the context .Fa ctx . .Pp .Fn EVP_DigestInit_ex -sets up digest context +sets up the digest context .Fa ctx to use a digest .Fa type from .Vt ENGINE .Fa impl . -.Fa ctx -must be initialized before calling this function. +The .Fa type will typically be supplied by a function such as .Fn EVP_sha1 . @@ -256,6 +295,11 @@ is then the default implementation of digest .Fa type is used. +If +.Fa ctx +points to an unused object on the stack, it must be initialized with +.Fn EVP_MD_CTX_init +before calling this function. .Pp .Fn EVP_DigestUpdate hashes @@ -291,18 +335,6 @@ can be made, but .Fn EVP_DigestInit_ex can be called to initialize a new digest operation. .Pp -.Fn EVP_MD_CTX_cleanup -cleans up the digest context -.Fa ctx . -It should be called after a digest context is no longer needed. -.Pp -.Fn EVP_MD_CTX_destroy -cleans up the digest context -.Fa ctx -and frees up the space allocated to it. -It should be called only on a context created using -.Fn EVP_MD_CTX_create . -.Pp .Fn EVP_MD_CTX_copy_ex can be used to copy the message digest state from .Fa in @@ -310,30 +342,36 @@ to .Fa out . This is useful if large amounts of data are to be hashed which only differ in the last few bytes. +If .Fa out -must be initialized before calling this function. +points to an unused object on the stack, it must be initialized with +.Fn EVP_MD_CTX_init +before calling this function. .Pp .Fn EVP_DigestInit -behaves in the same way as +is a deprecated function behaving like .Fn EVP_DigestInit_ex -except the passed context -.Fa ctx -does not have to be initialized, and it always uses the default digest -implementation. +except that it always uses the default digest implementation +and that it requires +.Fn EVP_MD_CTX_reset +before it can be used on a context that was already used. .Pp .Fn EVP_DigestFinal -is similar to +is a deprecated function behaving like .Fn EVP_DigestFinal_ex -except the digest context +except that the digest context .Fa ctx -is automatically cleaned up. +is automatically cleaned up after use by calling +.Fn EVP_MD_CTX_reset +internally. .Pp .Fn EVP_MD_CTX_copy -is similar to +is a deprecated function behaving like .Fn EVP_MD_CTX_copy_ex -except the destination -.Fa out -does not have to be initialized. +except that it requires +.Fn EVP_MD_CTX_reset +before a context that was already used can be passed as +.Fa out . .Pp .Fn EVP_MD_size and @@ -366,12 +404,6 @@ returns .Dv NID_sha1 . This function is normally used when setting ASN.1 OIDs. .Pp -.Fn EVP_MD_CTX_md -returns the -.Vt EVP_MD -structure corresponding to the passed -.Vt EVP_MD_CTX . -.Pp .Fn EVP_MD_pkey_type returns the NID of the public key signing algorithm associated with this digest. @@ -382,7 +414,6 @@ is associated with RSA so this will return Since digests and signature algorithms are no longer linked this function is only retained for compatibility reasons. .Pp -.Fn EVP_md2 , .Fn EVP_md5 , .Fn EVP_sha1 , .Fn EVP_sha224 , @@ -393,7 +424,7 @@ and .Fn EVP_ripemd160 return .Vt EVP_MD -structures for the MD2, MD5, SHA1, SHA224, SHA256, SHA384, SHA512 and +structures for the MD5, SHA1, SHA224, SHA256, SHA384, SHA512 and RIPEMD160 digest algorithms respectively. .Pp .Fn EVP_md5_sha1 @@ -465,40 +496,37 @@ because they can efficiently reuse a digest context instead of initializing and cleaning it up on each call and allow non-default implementations of digests to be specified. .Pp -In OpenSSL 0.9.7 and later if digest contexts are not cleaned up after -use memory leaks will occur. -.Pp -Stack allocation of +If digest contexts are not cleaned up after use, memory leaks will occur. +.Sh RETURN VALUES +.Fn EVP_MD_CTX_new +and +.Fn EVP_MD_CTX_create +return the new .Vt EVP_MD_CTX -structures is common, for example: -.Bd -literal -offset indent -EVP_MD_CTX mctx; -EVP_MD_CTX_init(&mctx); -.Ed +object or +.Dv NULL +for failure. +.Pp +.Fn EVP_MD_CTX_reset +and +.Fn EVP_MD_CTX_cleanup +always return 1. .Pp -This will cause binary compatibility issues if the size of -.Vt EVP_MD_CTX -structure changes (this will only happen with a major release of OpenSSL). -Applications wishing to avoid this should use -.Fn EVP_MD_CTX_create -instead: -.Bd -literal -offset indent -EVP_MD_CTX *mctx; -mctx = EVP_MD_CTX_create(); -.Ed -.Sh RETURN VALUES .Fn EVP_MD_CTX_ctrl , .Fn EVP_DigestInit_ex , .Fn EVP_DigestUpdate , .Fn EVP_DigestFinal_ex , +.Fn EVP_MD_CTX_copy_ex , +.Fn EVP_DigestInit , +.Fn EVP_DigestFinal , and -.Fn EVP_MD_CTX_copy_ex +.Fn EVP_MD_CTX_copy return 1 for success or 0 for failure. .Pp .Fn EVP_MD_type , .Fn EVP_MD_pkey_type , and -.Fn EVP_MD_type +.Fn EVP_MD_CTX_type return the NID of the corresponding OBJECT IDENTIFIER or .Dv NID_undef if none exists. @@ -510,8 +538,19 @@ and .Fn EVP_MD_CTX_block_size return the digest or block size in bytes. .Pp +.Fn EVP_MD_CTX_md +returns the +.Vt EVP_MD +object used by +.Fa ctx , +or +.Dv NULL +if +.Fa ctx +is +.Dv NULL . +.Pp .Fn EVP_md_null , -.Fn EVP_md2 , .Fn EVP_md5 , .Fn EVP_md5_sha1 , .Fn EVP_sha1 , @@ -562,17 +601,19 @@ main(int argc, char *argv[]) exit(1); } - mdctx = EVP_MD_CTX_create(); + mdctx = EVP_MD_CTX_new(); EVP_DigestInit_ex(mdctx, md, NULL); EVP_DigestUpdate(mdctx, mess1, strlen(mess1)); EVP_DigestUpdate(mdctx, mess2, strlen(mess2)); EVP_DigestFinal_ex(mdctx, md_value, &md_len); - EVP_MD_CTX_destroy(mdctx); + EVP_MD_CTX_free(mdctx); printf("Digest is: "); for(i = 0; i < md_len; i++) printf("%02x", md_value[i]); printf("\en"); + + return 0; } .Ed .Sh SEE ALSO @@ -580,31 +621,80 @@ main(int argc, char *argv[]) .Sh HISTORY .Fn EVP_DigestInit , .Fn EVP_DigestUpdate , +.Fn EVP_DigestFinal , +.Dv EVP_MAX_MD_SIZE , +.Fn EVP_md5 , and -.Fn EVP_DigestFinal -are available in all versions of SSLeay and OpenSSL. +.Fn EVP_sha1 +first appeared in SSLeay 0.5.1. +.Fn EVP_dss +and +.Fn EVP_dss1 +first appeared in SSLeay 0.6.0. +.Fn EVP_MD_size +first appeared in SSLeay 0.6.6. +.Fn EVP_MD_CTX_size , +.Fn EVP_MD_CTX_type , +.Fn EVP_md_null , +and +.Fn EVP_get_digestbyname +first appeared in SSLeay 0.8.0. +.Fn EVP_MD_type , +.Fn EVP_MD_pkey_type , +.Fn EVP_get_digestbynid , +and +.Fn EVP_get_digestbyobj +first appeared in SSLeay 0.8.1. +.Fn EVP_MD_block_size , +.Fn EVP_MD_CTX_size , +.Fn EVP_MD_CTX_block_size , +.Fn EVP_rc4_40 , +.Fn EVP_rc2_40_cbc , +and +.Fn EVP_ripemd160 +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn EVP_MD_CTX_copy +first appeared in OpenSSL 0.9.2b and has been available since +.Ox 2.6 . +.Pp +.Fn EVP_MD_CTX_md +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . .Pp .Fn EVP_MD_CTX_init , .Fn EVP_MD_CTX_create , -.Fn EVP_MD_CTX_copy_ex , .Fn EVP_MD_CTX_cleanup , .Fn EVP_MD_CTX_destroy , .Fn EVP_DigestInit_ex , +.Fn EVP_DigestFinal_ex , and -.Fn EVP_DigestFinal_ex -were added in OpenSSL 0.9.7. +.Fn EVP_MD_CTX_copy_ex +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . .Pp -.Fn EVP_md_null , -.Fn EVP_md2 , -.Fn EVP_md5 , -.Fn EVP_sha1 , -.Fn EVP_dss , -.Fn EVP_dss1 , +.Fn EVP_sha224 , +.Fn EVP_sha256 , +.Fn EVP_sha384 , and -.Fn EVP_ripemd160 -were changed to return truly const -.Vt EVP_MD -pointers in OpenSSL 0.9.7. +.Fn EVP_sha512 +first appeared in OpenSSL 0.9.7h and 0.9.8a +and have been available since +.Ox 4.0 . +.Pp +.Fn EVP_MD_CTX_ctrl +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 5.7 . +.Pp +.Fn EVP_MD_CTX_new , +.Fn EVP_MD_CTX_reset , +.Fn EVP_MD_CTX_free , +and +.Fn EVP_md5_sha1 +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . .Pp The link between digests and signing algorithms was fixed in OpenSSL 1.0 and later, so now @@ -612,6 +702,3 @@ and later, so now can be used with RSA and DSA; there is no need to use .Fn EVP_dss1 any more. -.Pp -OpenSSL 1.0 and later does not include the MD2 digest algorithm in the -default configuration due to its security weaknesses. diff --git a/man/EVP_DigestSignInit.3 b/man/EVP_DigestSignInit.3 index 26a56cad..c8988971 100644 --- a/man/EVP_DigestSignInit.3 +++ b/man/EVP_DigestSignInit.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_DigestSignInit.3,v 1.3 2016/11/26 17:38:55 schwarze Exp $ +.\" $OpenBSD: EVP_DigestSignInit.3,v 1.6 2018/12/23 08:35:14 tb Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 26 2016 $ +.Dd $Mdocdate: December 23 2018 $ .Dt EVP_DIGESTSIGNINIT 3 .Os .Sh NAME @@ -168,7 +168,7 @@ can be called later to digest and sign additional data. .Pp Since only a copy of the digest context is ever finalized, the context must be cleaned up after use by calling -.Xr EVP_MD_CTX_cleanup 3 , +.Xr EVP_MD_CTX_free 3 , or a memory leak will occur. .Pp The use of @@ -194,10 +194,12 @@ The error codes can be obtained from .Xr ERR 3 , .Xr evp 3 , .Xr EVP_DigestInit 3 , -.Xr EVP_DigestVerifyInit 3 +.Xr EVP_DigestVerifyInit 3 , +.Xr EVP_PKEY_meth_set_signctx 3 .Sh HISTORY .Fn EVP_DigestSignInit , .Fn EVP_DigestSignUpdate , and .Fn EVP_DigestSignFinal -were first added to OpenSSL 1.0.0. +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/EVP_DigestVerifyInit.3 b/man/EVP_DigestVerifyInit.3 index e92b21fd..3904e20a 100644 --- a/man/EVP_DigestVerifyInit.3 +++ b/man/EVP_DigestVerifyInit.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_DigestVerifyInit.3,v 1.3 2016/11/26 17:40:58 schwarze Exp $ +.\" $OpenBSD: EVP_DigestVerifyInit.3,v 1.7 2018/12/23 08:35:14 tb Exp $ .\" OpenSSL fb552ac6 Sep 30 23:43:01 2009 +0000 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 26 2016 $ +.Dd $Mdocdate: December 23 2018 $ .Dt EVP_DIGESTVERIFYINIT 3 .Os .Sh NAME @@ -76,7 +76,7 @@ .Ft int .Fo EVP_DigestVerifyFinal .Fa "EVP_MD_CTX *ctx" -.Fa "unsigned char *sig" +.Fa "const unsigned char *sig" .Fa "size_t siglen" .Fc .Sh DESCRIPTION @@ -151,7 +151,7 @@ can be called later to digest and verify additional data. .Pp Since only a copy of the digest context is ever finalized, the context must be cleaned up after use by calling -.Xr EVP_MD_CTX_cleanup 3 +.Xr EVP_MD_CTX_free 3 or a memory leak will occur. .Sh RETURN VALUES .Fn EVP_DigestVerifyInit @@ -175,10 +175,12 @@ The error codes can be obtained from .Xr ERR 3 , .Xr evp 3 , .Xr EVP_DigestInit 3 , -.Xr EVP_DigestSignInit 3 +.Xr EVP_DigestSignInit 3 , +.Xr EVP_PKEY_meth_set_verifyctx 3 .Sh HISTORY .Fn EVP_DigestVerifyInit , .Fn EVP_DigestVerifyUpdate , and .Fn EVP_DigestVerifyFinal -were first added to OpenSSL 1.0.0. +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/EVP_EncodeInit.3 b/man/EVP_EncodeInit.3 index 66bdcc1c..c38ed95e 100644 --- a/man/EVP_EncodeInit.3 +++ b/man/EVP_EncodeInit.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: EVP_EncodeInit.3,v 1.2 2016/11/26 19:16:58 jmc Exp $ -.\" OpenSSL f430ba31 Jun 19 19:39:01 2016 +0200 +.\" $OpenBSD: EVP_EncodeInit.3,v 1.6 2019/01/19 19:09:22 jmc Exp $ +.\" full merge up to: OpenSSL f430ba31 Jun 19 19:39:01 2016 +0200 +.\" selective merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 .\" .\" This file was written by Matt Caswell . .\" Copyright (c) 2016 The OpenSSL Project. All rights reserved. @@ -48,10 +49,12 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 26 2016 $ +.Dd $Mdocdate: January 19 2019 $ .Dt EVP_ENCODEINIT 3 .Os .Sh NAME +.Nm EVP_ENCODE_CTX_new , +.Nm EVP_ENCODE_CTX_free , .Nm EVP_EncodeInit , .Nm EVP_EncodeUpdate , .Nm EVP_EncodeFinal , @@ -63,6 +66,12 @@ .Nd EVP base64 encode/decode routines .Sh SYNOPSIS .In openssl/evp.h +.Ft EVP_ENCODE_CTX * +.Fn EVP_ENCODE_CTX_new void +.Ft void +.Fo EVP_ENCODE_CTX_free +.Fa "EVP_ENCODE_CTX *ctx" +.Fc .Ft void .Fo EVP_EncodeInit .Fa "EVP_ENCODE_CTX *ctx" @@ -121,6 +130,14 @@ data will be produced, plus some occasional newlines. If the input data length is not a multiple of 3, then the output data will be padded at the end using the "=" character. .Pp +.Fn EVP_ENCODE_CTX_new +allocates, initializes and returns a context to be used for the encode +and decode functions. +.Pp +.Fn EVP_ENCODE_CTX_free +frees +.Fa ctx . +.Pp Encoding of binary data is performed in blocks of 48 input bytes (or less for the final block). For each 48-byte input block encoded, 64 bytes of base64 data is output, @@ -275,6 +292,13 @@ The output will be padded with 0 bits if necessary to ensure that the output is always 3 bytes for every 4 input bytes. This function will return the length of the data decoded or -1 on error. .Sh RETURN VALUES +.Fn EVP_ENCODE_CTX_new +returns a pointer to the newly allocated +.Vt EVP_ENCODE_CTX +object or +.Dv NULL +on error. +.Pp .Fn EVP_EncodeUpdate returns 0 on error or 1 on success. .Pp @@ -293,3 +317,17 @@ returns -1 on error or 1 on success. returns the length of the data decoded or -1 on error. .Sh SEE ALSO .Xr evp 3 +.Sh HISTORY +The +.Fn EVP_Encode* +and +.Fn EVP_Decode* +functions first appeared in SSLeay 0.5.1 +and have been available since +.Ox 2.4 . +.Pp +.Fn EVP_ENCODE_CTX_new +and +.Fn EVP_ENCODE_CTX_free +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.5 . diff --git a/man/EVP_EncryptInit.3 b/man/EVP_EncryptInit.3 index 478e8083..5109e2e5 100644 --- a/man/EVP_EncryptInit.3 +++ b/man/EVP_EncryptInit.3 @@ -1,8 +1,12 @@ -.\" $OpenBSD: EVP_EncryptInit.3,v 1.6 2017/08/20 18:41:39 schwarze Exp $ -.\" OpenSSL EVP_EncryptInit.pod 519a5d1e Jun 27 17:38:25 2017 -0700 -.\" OpenSSL EVP_EncryptInit.pod 5211e094 Nov 11 14:39:11 2014 -0800 +.\" $OpenBSD: EVP_EncryptInit.3,v 1.34 2019/03/21 14:15:13 schwarze Exp $ +.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800 +.\" EVP_bf_cbc.pod EVP_cast5_cbc.pod EVP_idea_cbc.pod EVP_rc2_cbc.pod +.\" 7c6d372a Nov 20 13:20:01 2018 +0000 +.\" selective merge up to: OpenSSL 16cfc2c9 Mar 8 22:30:28 2018 +0100 +.\" EVP_chacha20.pod 8fa4d95e Oct 21 11:59:09 2017 +0900 .\" -.\" This file was written by Dr. Stephen Henson . +.\" This file was written by Dr. Stephen Henson +.\" and Richard Levitte . .\" Copyright (c) 2000-2002, 2005, 2012-2016 The OpenSSL Project. .\" All rights reserved. .\" @@ -50,11 +54,13 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: March 21 2019 $ .Dt EVP_ENCRYPTINIT 3 .Os .Sh NAME .Nm EVP_CIPHER_CTX_new , +.Nm EVP_CIPHER_CTX_reset , +.Nm EVP_CIPHER_CTX_cleanup , .Nm EVP_CIPHER_CTX_init , .Nm EVP_CIPHER_CTX_free , .Nm EVP_EncryptInit_ex , @@ -72,10 +78,13 @@ .Nm EVP_DecryptFinal , .Nm EVP_CipherInit , .Nm EVP_CipherFinal , +.Nm EVP_CIPHER_CTX_set_flags , +.Nm EVP_CIPHER_CTX_clear_flags , +.Nm EVP_CIPHER_CTX_test_flags , .Nm EVP_CIPHER_CTX_set_padding , .Nm EVP_CIPHER_CTX_set_key_length , .Nm EVP_CIPHER_CTX_ctrl , -.Nm EVP_CIPHER_CTX_cleanup , +.Nm EVP_CIPHER_CTX_rand_key , .Nm EVP_get_cipherbyname , .Nm EVP_get_cipherbynid , .Nm EVP_get_cipherbyobj , @@ -91,6 +100,8 @@ .Nm EVP_CIPHER_CTX_block_size , .Nm EVP_CIPHER_CTX_key_length , .Nm EVP_CIPHER_CTX_iv_length , +.Nm EVP_CIPHER_CTX_get_iv , +.Nm EVP_CIPHER_CTX_set_iv , .Nm EVP_CIPHER_CTX_get_app_data , .Nm EVP_CIPHER_CTX_set_app_data , .Nm EVP_CIPHER_CTX_type , @@ -99,70 +110,42 @@ .Nm EVP_CIPHER_param_to_asn1 , .Nm EVP_CIPHER_asn1_to_param , .Nm EVP_enc_null , -.Nm EVP_des_cbc , -.Nm EVP_des_ecb , -.Nm EVP_des_cfb , -.Nm EVP_des_ofb , -.Nm EVP_des_ede_cbc , -.Nm EVP_des_ede , -.Nm EVP_des_ede_ofb , -.Nm EVP_des_ede_cfb , -.Nm EVP_des_ede3_cbc , -.Nm EVP_des_ede3 , -.Nm EVP_des_ede3_ofb , -.Nm EVP_des_ede3_cfb , -.Nm EVP_desx_cbc , -.Nm EVP_rc4 , -.Nm EVP_rc4_40 , -.Nm EVP_rc4_hmac_md5 , .Nm EVP_idea_cbc , .Nm EVP_idea_ecb , +.Nm EVP_idea_cfb64 , .Nm EVP_idea_cfb , .Nm EVP_idea_ofb , .Nm EVP_rc2_cbc , .Nm EVP_rc2_ecb , +.Nm EVP_rc2_cfb64 , .Nm EVP_rc2_cfb , .Nm EVP_rc2_ofb , .Nm EVP_rc2_40_cbc , .Nm EVP_rc2_64_cbc , .Nm EVP_bf_cbc , .Nm EVP_bf_ecb , +.Nm EVP_bf_cfb64 , .Nm EVP_bf_cfb , .Nm EVP_bf_ofb , .Nm EVP_cast5_cbc , .Nm EVP_cast5_ecb , +.Nm EVP_cast5_cfb64 , .Nm EVP_cast5_cfb , .Nm EVP_cast5_ofb , -.Nm EVP_aes_128_cbc , -.Nm EVP_aes_128_ecb , -.Nm EVP_aes_128_cfb , -.Nm EVP_aes_128_ofb , -.Nm EVP_aes_192_cbc , -.Nm EVP_aes_192_ecb , -.Nm EVP_aes_192_cfb , -.Nm EVP_aes_192_ofb , -.Nm EVP_aes_256_cbc , -.Nm EVP_aes_256_ecb , -.Nm EVP_aes_256_cfb , -.Nm EVP_aes_256_ofb , -.Nm EVP_aes_128_gcm , -.Nm EVP_aes_192_gcm , -.Nm EVP_aes_256_gcm , -.Nm EVP_aes_128_ccm , -.Nm EVP_aes_192_ccm , -.Nm EVP_aes_256_ccm , -.Nm EVP_aes_128_cbc_hmac_sha1 , -.Nm EVP_aes_256_cbc_hmac_sha1 , -.Nm EVP_rc5_32_12_16_cbc , -.Nm EVP_rc5_32_12_16_cfb , -.Nm EVP_rc5_32_12_16_ecb , -.Nm EVP_rc5_32_12_16_ofb , .Nm EVP_chacha20 .Nd EVP cipher routines .Sh SYNOPSIS .In openssl/evp.h .Ft EVP_CIPHER_CTX * .Fn EVP_CIPHER_CTX_new void +.Ft int +.Fo EVP_CIPHER_CTX_reset +.Fa "EVP_CIPHER_CTX *ctx" +.Fc +.Ft int +.Fo EVP_CIPHER_CTX_cleanup +.Fa "EVP_CIPHER_CTX *ctx" +.Fc .Ft void .Fo EVP_CIPHER_CTX_init .Fa "EVP_CIPHER_CTX *ctx" @@ -176,15 +159,15 @@ .Fa "EVP_CIPHER_CTX *ctx" .Fa "const EVP_CIPHER *type" .Fa "ENGINE *impl" -.Fa "unsigned char *key" -.Fa "unsigned char *iv" +.Fa "const unsigned char *key" +.Fa "const unsigned char *iv" .Fc .Ft int .Fo EVP_EncryptUpdate .Fa "EVP_CIPHER_CTX *ctx" .Fa "unsigned char *out" .Fa "int *outl" -.Fa "unsigned char *in" +.Fa "const unsigned char *in" .Fa "int inl" .Fc .Ft int @@ -198,15 +181,15 @@ .Fa "EVP_CIPHER_CTX *ctx" .Fa "const EVP_CIPHER *type" .Fa "ENGINE *impl" -.Fa "unsigned char *key" -.Fa "unsigned char *iv" +.Fa "const unsigned char *key" +.Fa "const unsigned char *iv" .Fc .Ft int .Fo EVP_DecryptUpdate .Fa "EVP_CIPHER_CTX *ctx" .Fa "unsigned char *out" .Fa "int *outl" -.Fa "unsigned char *in" +.Fa "const unsigned char *in" .Fa "int inl" .Fc .Ft int @@ -220,8 +203,8 @@ .Fa "EVP_CIPHER_CTX *ctx" .Fa "const EVP_CIPHER *type" .Fa "ENGINE *impl" -.Fa "unsigned char *key" -.Fa "unsigned char *iv" +.Fa "const unsigned char *key" +.Fa "const unsigned char *iv" .Fa "int enc" .Fc .Ft int @@ -229,7 +212,7 @@ .Fa "EVP_CIPHER_CTX *ctx" .Fa "unsigned char *out" .Fa "int *outl" -.Fa "unsigned char *in" +.Fa "const unsigned char *in" .Fa "int inl" .Fc .Ft int @@ -242,8 +225,8 @@ .Fo EVP_EncryptInit .Fa "EVP_CIPHER_CTX *ctx" .Fa "const EVP_CIPHER *type" -.Fa "unsigned char *key" -.Fa "unsigned char *iv" +.Fa "const unsigned char *key" +.Fa "const unsigned char *iv" .Fc .Ft int .Fo EVP_EncryptFinal @@ -255,8 +238,8 @@ .Fo EVP_DecryptInit .Fa "EVP_CIPHER_CTX *ctx" .Fa "const EVP_CIPHER *type" -.Fa "unsigned char *key" -.Fa "unsigned char *iv" +.Fa "const unsigned char *key" +.Fa "const unsigned char *iv" .Fc .Ft int .Fo EVP_DecryptFinal @@ -268,8 +251,8 @@ .Fo EVP_CipherInit .Fa "EVP_CIPHER_CTX *ctx" .Fa "const EVP_CIPHER *type" -.Fa "unsigned char *key" -.Fa "unsigned char *iv" +.Fa "const unsigned char *key" +.Fa "const unsigned char *iv" .Fa "int enc" .Fc .Ft int @@ -278,6 +261,21 @@ .Fa "unsigned char *outm" .Fa "int *outl" .Fc +.Ft void +.Fo EVP_CIPHER_CTX_set_flags +.Fa "EVP_CIPHER_CTX *ctx" +.Fa "int flags" +.Fc +.Ft void +.Fo EVP_CIPHER_CTX_clear_flags +.Fa "EVP_CIPHER_CTX *ctx" +.Fa "int flags" +.Fc +.Ft int +.Fo EVP_CIPHER_CTX_test_flags +.Fa "EVP_CIPHER_CTX *ctx" +.Fa "int flags" +.Fc .Ft int .Fo EVP_CIPHER_CTX_set_padding .Fa "EVP_CIPHER_CTX *x" @@ -296,8 +294,9 @@ .Fa "void *ptr" .Fc .Ft int -.Fo EVP_CIPHER_CTX_cleanup +.Fo EVP_CIPHER_CTX_rand_key .Fa "EVP_CIPHER_CTX *ctx" +.Fa "unsigned char *key" .Fc .Ft const EVP_CIPHER * .Fo EVP_get_cipherbyname @@ -359,6 +358,18 @@ .Fo EVP_CIPHER_CTX_iv_length .Fa "const EVP_CIPHER_CTX *ctx" .Fc +.Ft int +.Fo EVP_CIPHER_CTX_get_iv +.Fa "const EVP_CIPHER_CTX *ctx" +.Fa "u_char *iv" +.Fa "size_t len" +.Fc +.Ft int +.Fo EVP_CIPHER_CTX_set_iv +.Fa "EVP_CIPHER_CTX *ctx" +.Fa "const u_char *iv" +.Fa "size_t len" +.Fc .Ft void * .Fo EVP_CIPHER_CTX_get_app_data .Fa "const EVP_CIPHER_CTX *ctx" @@ -395,15 +406,35 @@ The EVP cipher routines are a high level interface to certain symmetric ciphers. .Pp .Fn EVP_CIPHER_CTX_new -creates a cipher context. +creates a new, empty cipher context. +.Pp +.Fn EVP_CIPHER_CTX_reset +clears all information from +.Fa ctx +and frees all allocated memory associated with it, except the +.Fa ctx +object itself, such that it can be reused for another series of calls to +.Fn EVP_CipherInit , +.Fn EVP_CipherUpdate , +and +.Fn EVP_CipherFinal . +It is also suitable for cipher contexts on the stack that were used +and are no longer needed. +.Fn EVP_CIPHER_CTX_cleanup +is a deprecated alias for +.Fn EVP_CIPHER_CTX_reset . .Pp .Fn EVP_CIPHER_CTX_init -initializes the cipher context -.Fa ctx . +is a deprecated function to clear a cipher context on the stack +before use. +Do not use it on a cipher context returned from +.Fn EVP_CIPHER_CTX_new +or one one that was already used. .Pp .Fn EVP_CIPHER_CTX_free -clears all information from a cipher context and frees up any -allocated memory associate with it, including +clears all information from +.Fa ctx +and frees all allocated memory associated with it, including .Fa ctx itself. This function should be called after all operations using a cipher @@ -422,11 +453,14 @@ for encryption with cipher from .Vt ENGINE .Fa impl . +If .Fa ctx -must be initialized before calling this function. +points to an unused object on the stack, it must be initialized with +.Fn EVP_MD_CTX_init +before calling this function. .Fa type is normally supplied by a function such as -.Fn EVP_aes_256_cbc . +.Xr EVP_aes_256_cbc 3 . If .Fa impl is @@ -518,25 +552,19 @@ the value unchanged (the actual value of .Fa enc being supplied in a previous call). .Pp -.Fn EVP_CIPHER_CTX_cleanup -clears all information from a cipher context and free up any allocated -memory associated with it. -It should be called after all operations using a cipher are complete so -sensitive information does not remain in memory. -.Pp .Fn EVP_EncryptInit , .Fn EVP_DecryptInit , and .Fn EVP_CipherInit -behave in a similar way to +are deprecated functions behaving like .Fn EVP_EncryptInit_ex , .Fn EVP_DecryptInit_ex , and .Fn EVP_CipherInit_ex -except the -.Fa ctx -parameter does not need to be initialized and they always use the -default cipher implementation. +except that they always use the default cipher implementation +and that they require +.Fn EVP_CIPHER_CTX_reset +before they can be used on a context that was already used. .Pp .Fn EVP_EncryptFinal , .Fn EVP_DecryptFinal , @@ -550,7 +578,9 @@ and In previous releases of OpenSSL, they also used to clean up the .Fa ctx , but this is no longer done and -.Fn EVP_CIPHER_CTX_cleanup +.Fn EVP_CIPHER_CTX_reset +or +.Fn EVP_CIPHER_CTX_free must be called to free any context resources. .Pp .Fn EVP_get_cipherbyname , @@ -574,6 +604,30 @@ structure. The actual NID value is an internal value which may not have a corresponding OBJECT IDENTIFIER. .Pp +.Fn EVP_CIPHER_CTX_set_flags +enables the given +.Fa flags +in +.Fa ctx . +.Fn EVP_CIPHER_CTX_clear_flags +disables the given +.Fa flags +in +.Fa ctx . +.Fn EVP_CIPHER_CTX_test_flags +checks whether any of the given +.Fa flags +are currently set in +.Fa ctx , +returning the subset of the +.Fa flags +that are set, or 0 if none of them are set. +Currently, the only supported cipher context flag is +.Dv EVP_CIPHER_CTX_FLAG_WRAP_ALLOW ; +see +.Xr EVP_aes_128_wrap 3 +for details. +.Pp .Fn EVP_CIPHER_CTX_set_padding enables or disables padding. This function should be called after the context is set up for @@ -581,7 +635,7 @@ encryption or decryption with .Fn EVP_EncryptInit_ex , .Fn EVP_DecryptInit_ex , or -EVP_CipherInit_ex . +.Fn EVP_CipherInit_ex . By default encryption operations are padded using standard block padding and the padding is checked and removed when decrypting. If the @@ -624,6 +678,15 @@ The constant .Dv EVP_MAX_IV_LENGTH is the maximum IV length for all ciphers. .Pp +.Fn EVP_CIPHER_CTX_get_iv +and +.Fn EVP_CIPHER_CTX_set_iv +will respectively retrieve and set the IV for an +.Vt EVP_CIPHER_CTX . +In both cases, the specified IV length must exactly equal the expected +IV length for the context as returned by +.Fn EVP_CIPHER_CTX_iv_length . +.Pp .Fn EVP_CIPHER_block_size and .Fn EVP_CIPHER_CTX_block_size @@ -661,8 +724,10 @@ return the block cipher mode: .Dv EVP_CIPH_ECB_MODE , .Dv EVP_CIPH_CBC_MODE , .Dv EVP_CIPH_CFB_MODE , +.Dv EVP_CIPH_OFB_MODE , +.Dv EVP_CIPH_CTR_MODE , or -.Dv EVP_CIPH_OFB_MODE . +.Dv EVP_CIPH_XTS_MODE . If the cipher is a stream cipher then .Dv EVP_CIPH_STREAM_CIPHER is returned. @@ -704,8 +769,19 @@ the RC2 effective key length is not supported). .Pp .Fn EVP_CIPHER_CTX_ctrl allows various cipher specific parameters to be determined and set. -Currently only the RC2 effective key length and the number of rounds of -RC5 can be set. +Currently only the RC2 effective key length can be set. +.Pp +.Fn EVP_CIPHER_CTX_rand_key +generates a random key of the appropriate length based on the cipher +context. +The +.Vt EVP_CIPHER +can provide its own random key generation routine to support keys +of a specific form. +The +.Fa key +argument must point to a buffer at least as big as the value returned by +.Fn EVP_CIPHER_CTX_key_length . .Pp Where possible the EVP interface to symmetric ciphers should be used in preference to the low level interfaces. @@ -762,28 +838,32 @@ for success or .Dv NULL for failure. .Pp +.Fn EVP_CIPHER_CTX_reset , +.Fn EVP_CIPHER_CTX_cleanup , +.Fn EVP_CIPHER_CTX_get_iv , +.Fn EVP_CIPHER_CTX_set_iv , .Fn EVP_EncryptInit_ex , .Fn EVP_EncryptUpdate , +.Fn EVP_EncryptFinal_ex , +.Fn EVP_DecryptInit_ex , +.Fn EVP_DecryptUpdate , +.Fn EVP_DecryptFinal_ex , +.Fn EVP_CipherInit_ex , +.Fn EVP_CipherUpdate , +.Fn EVP_CipherFinal_ex , +.Fn EVP_EncryptInit , +.Fn EVP_EncryptFinal , +.Fn EVP_DecryptInit , +.Fn EVP_DecryptFinal , +.Fn EVP_CipherInit , +.Fn EVP_CipherFinal , +.Fn EVP_CIPHER_CTX_set_key_length , and -.Fn EVP_EncryptFinal_ex -return 1 for success and 0 for failure. -.Pp -.Fn EVP_DecryptInit_ex -and -.Fn EVP_DecryptUpdate -return 1 for success and 0 for failure. -.Fn EVP_DecryptFinal_ex -returns 0 if the decrypt failed or 1 for success. -.Pp -.Fn EVP_CipherInit_ex -and -.Fn EVP_CipherUpdate -return 1 for success and 0 for failure. -.Fn EVP_CipherFinal_ex -returns 0 for a decryption failure or 1 for success. +.Fn EVP_CIPHER_CTX_rand_key +return 1 for success or 0 for failure. .Pp -.Fn EVP_CIPHER_CTX_cleanup -returns 1 for success and 0 for failure. +.Fn EVP_CIPHER_CTX_set_padding +always returns 1. .Pp .Fn EVP_get_cipherbyname , .Fn EVP_get_cipherbynid , @@ -810,9 +890,6 @@ and .Fn EVP_CIPHER_CTX_key_length return the key length. .Pp -.Fn EVP_CIPHER_CTX_set_padding -always returns 1. -.Pp .Fn EVP_CIPHER_iv_length and .Fn EVP_CIPHER_CTX_iv_length @@ -841,76 +918,30 @@ All algorithms have a fixed key length unless otherwise stated. .It Fn EVP_enc_null Null cipher: does nothing. .It Xo -.Fn EVP_aes_128_cbc , -.Fn EVP_aes_128_ecb , -.Fn EVP_aes_128_cfb , -.Fn EVP_aes_128_ofb -.Xc -AES with a 128-bit key in CBC, ECB, CFB and OFB modes respectively. -.It Xo -.Fn EVP_aes_192_cbc , -.Fn EVP_aes_192_ecb , -.Fn EVP_aes_192_cfb , -.Fn EVP_aes_192_ofb -.Xc -AES with a 192-bit key in CBC, ECB, CFB and OFB modes respectively. -.It Xo -.Fn EVP_aes_256_cbc , -.Fn EVP_aes_256_ecb , -.Fn EVP_aes_256_cfb , -.Fn EVP_aes_256_ofb -.Xc -AES with a 256-bit key in CBC, ECB, CFB and OFB modes respectively. -.It Xo -.Fn EVP_des_cbc , -.Fn EVP_des_ecb , -.Fn EVP_des_cfb , -.Fn EVP_des_ofb -.Xc -DES in CBC, ECB, CFB and OFB modes respectively. -.It Xo -.Fn EVP_des_ede_cbc , -.Fn EVP_des_ede , -.Fn EVP_des_ede_ofb , -.Fn EVP_des_ede_cfb -.Xc -Two key triple DES in CBC, ECB, CFB and OFB modes respectively. -.It Xo -.Fn EVP_des_ede3_cbc , -.Fn EVP_des_ede3 , -.Fn EVP_des_ede3_ofb , -.Fn EVP_des_ede3_cfb -.Xc -Three key triple DES in CBC, ECB, CFB and OFB modes respectively. -.It Fn EVP_desx_cbc -DESX algorithm in CBC mode. -.It Fn EVP_rc4 -RC4 stream cipher. -This is a variable key length cipher with default key length 128 bits. -.It Fn EVP_rc4_40 -RC4 stream cipher with 40-bit key length. -This is obsolete and new code should use -.Fn EVP_rc4 -and the -.Fn EVP_CIPHER_CTX_set_key_length -function. -.It Xo .Fn EVP_idea_cbc , .Fn EVP_idea_ecb , -.Fn EVP_idea_cfb , +.Fn EVP_idea_cfb64 , .Fn EVP_idea_ofb .Xc IDEA encryption algorithm in CBC, ECB, CFB and OFB modes respectively. +.Fn EVP_idea_cfb +is an alias for +.Fn EVP_idea_cfb64 , +implemented as a macro. .It Xo .Fn EVP_rc2_cbc , .Fn EVP_rc2_ecb , -.Fn EVP_rc2_cfb , +.Fn EVP_rc2_cfb64 , .Fn EVP_rc2_ofb .Xc RC2 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key length cipher with an additional parameter called "effective key bits" or "effective key length". By default both are set to 128 bits. +.Fn EVP_rc2_cfb +is an alias for +.Fn EVP_rc2_cfb64 , +implemented as a macro. .It Xo .Fn EVP_rc2_40_cbc , .Fn EVP_rc2_64_cbc @@ -926,51 +957,40 @@ to set the key length and effective key length. .It Xo .Fn EVP_bf_cbc , .Fn EVP_bf_ecb , -.Fn EVP_bf_cfb , +.Fn EVP_bf_cfb64 , .Fn EVP_bf_ofb .Xc Blowfish encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key length cipher. +.Fn EVP_bf_cfb +is an alias for +.Fn EVP_bf_cfb64 , +implemented as a macro. .It Xo .Fn EVP_cast5_cbc , .Fn EVP_cast5_ecb , -.Fn EVP_cast5_cfb , +.Fn EVP_cast5_cfb64 , .Fn EVP_cast5_ofb .Xc CAST encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key length cipher. -.It Xo -.Fn EVP_rc5_32_12_16_cbc , -.Fn EVP_rc5_32_12_16_ecb , -.Fn EVP_rc5_32_12_16_cfb , -.Fn EVP_rc5_32_12_16_ofb -.Xc -RC5 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. -This is a variable key length cipher with an additional "number of -rounds" parameter. -By default the key length is set to 128 bits and 12 rounds. -.It Xo -.Fn EVP_aes_128_gcm , -.Fn EVP_aes_192_gcm , -.Fn EVP_aes_256_gcm -.Xc -AES Galois Counter Mode (GCM) for 128, 192 and 256 bit keys respectively. -These ciphers require additional control operations to function -correctly: see the GCM mode section below for details. -.It Xo -.Fn EVP_aes_128_ccm , -.Fn EVP_aes_192_ccm , -.Fn EVP_aes_256_ccm -.Xc -AES Counter with CBC-MAC Mode (CCM) for 128, 192 and 256 bit keys -respectively. -These ciphers require additional control operations to function -correctly: see CCM mode section below for details. +.Fn EVP_cast5_cfb +is an alias for +.Fn EVP_cast5_cfb64 , +implemented as a macro. .It Fn EVP_chacha20 The ChaCha20 stream cipher. The key length is 256 bits, the IV is 96 bits long. .El +.Pp +See also +.Xr EVP_aes_128_cbc 3 , +.Xr EVP_camellia_128_cbc 3 , +.Xr EVP_des_cbc 3 , +.Xr EVP_rc4 3 , +and +.Xr EVP_sm4_cbc 3 . .Ss GCM mode For GCM mode ciphers, the behaviour of the EVP interface is subtly altered and several additional ctrl operations are @@ -1060,7 +1080,7 @@ Sets the CCM L value. If not set, a default is used (8 for AES). .It Fn EVP_CIPHER_CTX_ctrl ctx EVP_CTRL_CCM_SET_IVLEN ivlen NULL Sets the CCM nonce (IV) length: this call can only be made before -specifying an nonce value. +specifying a nonce value. The nonce length is given by 15 - L so it is 7 by default for AES. .El .Sh EXAMPLES @@ -1080,10 +1100,11 @@ do_crypt(char *outfile) const char intext[] = "Some Crypto Text"; EVP_CIPHER_CTX *ctx; FILE *out; - EVP_CIPHER_CTX_init(&ctx); - EVP_EncryptInit_ex(&ctx, EVP_bf_cbc(), NULL, key, iv); - if (!EVP_EncryptUpdate(&ctx, outbuf, &outlen, intext, + ctx = EVP_CIPHER_CTX_new(); + EVP_EncryptInit_ex(ctx, EVP_bf_cbc(), NULL, key, iv); + + if (!EVP_EncryptUpdate(ctx, outbuf, &outlen, intext, strlen(intext))) { /* Error */ EVP_CIPHER_CTX_free(ctx); @@ -1093,13 +1114,13 @@ do_crypt(char *outfile) * Buffer passed to EVP_EncryptFinal() must be after data just * encrypted to avoid overwriting it. */ - if (!EVP_EncryptFinal_ex(&ctx, outbuf + outlen, &tmplen)) { + if (!EVP_EncryptFinal_ex(ctx, outbuf + outlen, &tmplen)) { /* Error */ EVP_CIPHER_CTX_free(ctx); return 0; } outlen += tmplen; - EVP_CIPHER_CTX_cleanup(&ctx); + EVP_CIPHER_CTX_free(ctx); /* * Need binary mode for fopen because encrypted data is * binary data. Also cannot use strlen() on it because @@ -1125,56 +1146,137 @@ openssl bf -in cipher.bin -K 000102030405060708090A0B0C0D0E0F \e -iv 0102030405060708 -d .Ed .Pp -General encryption, decryption function example using FILE I/O and RC2 -with an 80-bit key: +General encryption, decryption function example using FILE I/O and AES128 +with an 128-bit key: .Bd -literal int do_crypt(FILE *in, FILE *out, int do_encrypt) { /* Allow enough space in output buffer for additional block */ - inbuf[1024], outbuf[1024 + EVP_MAX_BLOCK_LENGTH]; + unsigned char inbuf[1024], outbuf[1024 + EVP_MAX_BLOCK_LENGTH]; int inlen, outlen; + EVP_CIPHER_CTX *ctx; + /* * Bogus key and IV: we'd normally set these from * another source. */ - unsigned char key[] = "0123456789"; - unsigned char iv[] = "12345678"; + unsigned char key[] = "0123456789abcdeF"; + unsigned char iv[] = "1234567887654321"; - /* Don't set key or IV because we will modify the parameters */ - EVP_CIPHER_CTX_init(&ctx); - EVP_CipherInit_ex(&ctx, EVP_rc2(), NULL, NULL, NULL, do_encrypt); - EVP_CIPHER_CTX_set_key_length(&ctx, 10); - /* We finished modifying parameters so now we can set key and IV */ - EVP_CipherInit_ex(&ctx, NULL, NULL, key, iv, do_encrypt); + ctx = EVP_CIPHER_CTX_new(); + EVP_CipherInit_ex(ctx, EVP_aes_128_cbc(), NULL, NULL, NULL, + do_encrypt); + EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, do_encrypt); - for(;;) { + for (;;) { inlen = fread(inbuf, 1, 1024, in); if (inlen <= 0) break; - if (!EVP_CipherUpdate(&ctx, outbuf, &outlen, inbuf, + if (!EVP_CipherUpdate(ctx, outbuf, &outlen, inbuf, inlen)) { /* Error */ - EVP_CIPHER_CTX_cleanup(&ctx); + EVP_CIPHER_CTX_free(ctx); return 0; } fwrite(outbuf, 1, outlen, out); } - if (!EVP_CipherFinal_ex(&ctx, outbuf, &outlen)) { + if (!EVP_CipherFinal_ex(ctx, outbuf, &outlen)) { /* Error */ - EVP_CIPHER_CTX_cleanup(&ctx); + EVP_CIPHER_CTX_free(ctx); return 0; } fwrite(outbuf, 1, outlen, out); - EVP_CIPHER_CTX_cleanup(&ctx); + EVP_CIPHER_CTX_free(ctx); return 1; } .Ed .Sh SEE ALSO -.Xr evp 3 +.Xr evp 3 , +.Xr EVP_aes_128_cbc 3 , +.Xr EVP_camellia_128_cbc 3 , +.Xr EVP_des_cbc 3 , +.Xr EVP_rc4 3 , +.Xr EVP_sm4_cbc 3 .Sh HISTORY +.Fn EVP_EncryptInit , +.Fn EVP_EncryptUpdate , +.Fn EVP_EncryptFinal , +.Fn EVP_DecryptInit , +.Fn EVP_DecryptUpdate , +.Fn EVP_DecryptFinal , +.Fn EVP_CipherInit , +.Fn EVP_CipherUpdate , +.Fn EVP_CipherFinal , +.Fn EVP_get_cipherbyname , +.Fn EVP_idea_cbc , +.Fn EVP_idea_ecb , +.Fn EVP_idea_cfb , +and +.Fn EVP_idea_ofb +first appeared in SSLeay 0.5.1. +.Fn EVP_rc2_cbc , +.Fn EVP_rc2_ecb , +.Fn EVP_rc2_cfb , +and +.Fn EVP_rc2_ofb +first appeared in SSLeay 0.5.2. +.Fn EVP_CIPHER_block_size , +.Fn EVP_CIPHER_key_length , +.Fn EVP_CIPHER_iv_length , +.Fn EVP_CIPHER_type , +.Fn EVP_CIPHER_CTX_block_size , +.Fn EVP_CIPHER_CTX_key_length , +.Fn EVP_CIPHER_CTX_iv_length , +and +.Fn EVP_CIPHER_CTX_type +first appeared in SSLeay 0.6.5. +.Fn EVP_bf_cbc , +.Fn EVP_bf_ecb , +.Fn EVP_bf_cfb , +and +.Fn EVP_bf_ofb +first appeared in SSLeay 0.6.6. +.Fn EVP_CIPHER_CTX_cleanup , +.Fn EVP_get_cipherbyobj , +.Fn EVP_CIPHER_nid , +.Fn EVP_CIPHER_CTX_cipher , +.Fn EVP_CIPHER_CTX_nid , +.Fn EVP_CIPHER_CTX_get_app_data , +.Fn EVP_CIPHER_CTX_set_app_data , +and +.Fn EVP_enc_null +first appeared in SSLeay 0.8.0. +.Fn EVP_get_cipherbynid +first appeared in SSLeay 0.8.1. .Fn EVP_CIPHER_CTX_init , +.Fn EVP_CIPHER_param_to_asn1 , +and +.Fn EVP_CIPHER_asn1_to_param +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn EVP_rc2_40_cbc +and +.Fn EVP_rc2_64_cbc +first appeared in SSL_eay 0.9.1. +.Fn EVP_CIPHER_CTX_type +first appeared in OpenSSL 0.9.3. +These functions have been available since +.Ox 2.6 . +.Pp +.Fn EVP_CIPHER_CTX_set_key_length , +.Fn EVP_CIPHER_CTX_ctrl , +.Fn EVP_CIPHER_flags , +.Fn EVP_CIPHER_mode , +.Fn EVP_CIPHER_CTX_flags , +and +.Fn EVP_CIPHER_CTX_mode +first appeared in OpenSSL 0.9.6 and have been available since +.Ox 2.9 . +.Pp .Fn EVP_EncryptInit_ex , .Fn EVP_EncryptFinal_ex , .Fn EVP_DecryptInit_ex , @@ -1183,12 +1285,36 @@ do_crypt(FILE *in, FILE *out, int do_encrypt) .Fn EVP_CipherFinal_ex , and .Fn EVP_CIPHER_CTX_set_padding -appeared in OpenSSL 0.9.7. -.Sh BUGS -For RC5 the number of rounds can currently only be set to 8, 12 or 16. -This is a limitation of the current RC5 code rather than the EVP -interface. +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn EVP_bf_cfb64 , +.Fn EVP_cast5_cfb64 , +.Fn EVP_idea_cfb64 , +and +.Fn EVP_rc2_cfb64 +first appeared in OpenSSL 0.9.7e and have been available since +.Ox 3.8 . +.Pp +.Fn EVP_CIPHER_CTX_rand_key +first appeared in OpenSSL 0.9.8. +.Fn EVP_CIPHER_CTX_new +and +.Fn EVP_CIPHER_CTX_free +first appeared in OpenSSL 0.9.8b. +These functions have been available since +.Ox 4.5 . +.Pp +.Fn EVP_CIPHER_CTX_reset +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . .Pp +.Fn EVP_CIPHER_CTX_get_iv +and +.Fn EVP_CIPHER_CTX_set_iv +first appeared in LibreSSL 2.8.1 and has been available since +.Ox 6.4 . +.Sh BUGS .Dv EVP_MAX_KEY_LENGTH and .Dv EVP_MAX_IV_LENGTH diff --git a/man/EVP_OpenInit.3 b/man/EVP_OpenInit.3 index f442bd5c..d2a723ab 100644 --- a/man/EVP_OpenInit.3 +++ b/man/EVP_OpenInit.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_OpenInit.3,v 1.5 2016/11/26 20:55:26 schwarze Exp $ +.\" $OpenBSD: EVP_OpenInit.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 26 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt EVP_OPENINIT 3 .Os .Sh NAME @@ -146,3 +146,10 @@ returns 0 if the decrypt failed or 1 for success. .Xr EVP_EncryptInit 3 , .Xr EVP_SealInit 3 , .Xr RAND_bytes 3 +.Sh HISTORY +.Fn EVP_OpenInit , +.Fn EVP_OpenUpdate , +and +.Fn EVP_OpenFinal +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . diff --git a/man/EVP_PKEY_CTX_ctrl.3 b/man/EVP_PKEY_CTX_ctrl.3 index b65ea0d5..a49c31cd 100644 --- a/man/EVP_PKEY_CTX_ctrl.3 +++ b/man/EVP_PKEY_CTX_ctrl.3 @@ -1,9 +1,9 @@ -.\" $OpenBSD: EVP_PKEY_CTX_ctrl.3,v 1.8 2017/08/28 17:41:59 jsing Exp $ -.\" OpenSSL EVP_PKEY_CTX_ctrl.pod 1722496f Jun 8 15:18:38 2017 -0400 -.\" OpenSSL EVP_PKEY_CTX_ctrl.pod e03af178 Dec 11 17:05:57 2014 -0500 +.\" $OpenBSD: EVP_PKEY_CTX_ctrl.3,v 1.12 2018/12/21 23:51:42 schwarze Exp $ +.\" full merge up to: OpenSSL e03af178 Dec 11 17:05:57 2014 -0500 +.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2006, 2009, 2013, 2014, 2015 The OpenSSL Project. +.\" Copyright (c) 2006, 2009, 2013, 2014, 2015, 2018 The OpenSSL Project. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 28 2017 $ +.Dd $Mdocdate: December 21 2018 $ .Dt EVP_PKEY_CTX_CTRL 3 .Os .Sh NAME @@ -58,9 +58,13 @@ .Nm EVP_PKEY_CTX_ctrl_str , .Nm EVP_PKEY_CTX_set_signature_md , .Nm EVP_PKEY_CTX_set_rsa_padding , +.Nm EVP_PKEY_CTX_get_rsa_padding , .Nm EVP_PKEY_CTX_set_rsa_pss_saltlen , +.Nm EVP_PKEY_CTX_get_rsa_pss_saltlen , .Nm EVP_PKEY_CTX_set_rsa_keygen_bits , .Nm EVP_PKEY_CTX_set_rsa_keygen_pubexp , +.Nm EVP_PKEY_CTX_set_rsa_mgf1_md , +.Nm EVP_PKEY_CTX_get_rsa_mgf1_md , .Nm EVP_PKEY_CTX_set_dsa_paramgen_bits , .Nm EVP_PKEY_CTX_set_dh_paramgen_prime_len , .Nm EVP_PKEY_CTX_set_dh_paramgen_generator , @@ -83,23 +87,33 @@ .Fa "const char *type" .Fa "const char *value" .Fc -.In openssl/rsa.h .Ft int .Fo EVP_PKEY_CTX_set_signature_md .Fa "EVP_PKEY_CTX *ctx" .Fa "const EVP_MD *md" .Fc +.In openssl/rsa.h .Ft int .Fo EVP_PKEY_CTX_set_rsa_padding .Fa "EVP_PKEY_CTX *ctx" .Fa "int pad" .Fc .Ft int +.Fo EVP_PKEY_CTX_get_rsa_padding +.Fa "EVP_PKEY_CTX *ctx" +.Fa "int *ppad" +.Fc +.Ft int .Fo EVP_PKEY_CTX_set_rsa_pss_saltlen .Fa "EVP_PKEY_CTX *ctx" .Fa "int len" .Fc .Ft int +.Fo EVP_PKEY_CTX_get_rsa_pss_saltlen +.Fa "EVP_PKEY_CTX *ctx" +.Fa "int *plen" +.Fc +.Ft int .Fo EVP_PKEY_CTX_set_rsa_keygen_bits .Fa "EVP_PKEY_CTX *ctx" .Fa "int mbits" @@ -109,6 +123,16 @@ .Fa "EVP_PKEY_CTX *ctx" .Fa "BIGNUM *pubexp" .Fc +.Ft int +.Fo EVP_PKEY_CTX_set_rsa_mgf1_md +.Fa "EVP_PKEY_CTX *ctx" +.Fa "const EVP_MD *md" +.Fc +.Ft int +.Fo EVP_PKEY_CTX_get_rsa_mgf1_md +.Fa "EVP_PKEY_CTX *ctx" +.Fa "const EVP_MD **pmd" +.Fc .In openssl/dsa.h .Ft int .Fo EVP_PKEY_CTX_set_dsa_paramgen_bits @@ -179,12 +203,11 @@ All the remaining "functions" are implemented as macros. The .Fn EVP_PKEY_CTX_set_signature_md macro sets the message digest type used in a signature. -It can be used with any public key algorithm supporting signature -operations. -.Pp -The macro +It can be used with the RSA, DSA, and ECDSA algorithms. +.Ss RSA parameters +The .Fn EVP_PKEY_CTX_set_rsa_padding -sets the RSA padding mode for +macro sets the RSA padding mode for .Fa ctx . The .Fa pad @@ -216,6 +239,11 @@ If it is not called then the first byte of the plaintext buffer is expected to be the algorithm identifier byte. .Pp The +.Fn EVP_PKEY_CTX_get_rsa_padding +macro retrieves the RSA padding mode for +.Fa ctx . +.Pp +The .Fn EVP_PKEY_CTX_set_rsa_pss_saltlen macro sets the RSA PSS salt length to .Fa len . @@ -229,6 +257,13 @@ If this macro is not called a salt length value of -2 is used by default. .Pp The +.Fn EVP_PKEY_CTX_get_rsa_pss_saltlen +macro retrieves the RSA PSS salt length for +.Fa ctx . +The padding mode must have been set to +.Dv RSA_PKCS1_PSS_PADDING . +.Pp +The .Fn EVP_PKEY_CTX_set_rsa_keygen_bits macro sets the RSA key length for RSA key generation to .Fa mbits . @@ -245,17 +280,38 @@ pointer is used internally by this function, so it should not be modified or freed after the call. If this macro is not called, then 65537 is used. .Pp +The +.Fn EVP_PKEY_CTX_set_rsa_mgf1_md +macro sets the MGF1 digest for RSA padding schemes to +.Fa md . +Unless explicitly specified, the signing digest is used. +The padding mode must have been set to +.Dv RSA_PKCS1_OAEP_PADDING +or +.Dv RSA_PKCS1_PSS_PADDING . +.Pp +The +.Fn EVP_PKEY_CTX_get_rsa_mgf1_md +macro retrieves the MGF1 digest for +.Fa ctx . +Unless explicitly specified, the signing digest is used. +The padding mode must have been set to +.Dv RSA_PKCS1_OAEP_PADDING +or +.Dv RSA_PKCS1_PSS_PADDING . +.Ss DSA parameters The macro .Fn EVP_PKEY_CTX_set_dsa_paramgen_bits sets the number of bits used for DSA parameter generation to .Fa nbits . If not specified, 1024 is used. -.Pp +.Ss DH parameters The macro .Fn EVP_PKEY_CTX_set_dh_paramgen_prime_len sets the length of the DH prime parameter .Fa len for DH parameter generation. +It only accepts lengths greater than or equal to 256. If this macro is not called, then 1024 is used. .Pp The @@ -264,7 +320,7 @@ macro sets DH generator to .Fa gen for DH parameter generation. If not specified, 2 is used. -.Pp +.Ss EC parameters The .Fn EVP_PKEY_CTX_set_ec_paramgen_curve_nid sets the EC curve for EC parameter generation to @@ -284,8 +340,11 @@ supported by the public key algorithm. .Xr EVP_PKEY_encrypt 3 , .Xr EVP_PKEY_get_default_digest_nid 3 , .Xr EVP_PKEY_keygen 3 , +.Xr EVP_PKEY_meth_set_ctrl 3 , .Xr EVP_PKEY_sign 3 , .Xr EVP_PKEY_verify 3 , .Xr EVP_PKEY_verify_recover 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.0. +These functions first appeared in OpenSSL 1.0.0 +and have been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_CTX_new.3 b/man/EVP_PKEY_CTX_new.3 index 72c0e36d..1cb72420 100644 --- a/man/EVP_PKEY_CTX_new.3 +++ b/man/EVP_PKEY_CTX_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_PKEY_CTX_new.3,v 1.5 2017/04/10 17:45:06 schwarze Exp $ +.\" $OpenBSD: EVP_PKEY_CTX_new.3,v 1.7 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_CTX_NEW 3 .Os .Sh NAME @@ -123,10 +123,13 @@ structure or .Dv NULL if an error occurred. .Sh SEE ALSO +.Xr EVP_PKEY_meth_set_init 3 , .Xr EVP_PKEY_new 3 , .Xr X25519 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.0. +These functions first appeared in OpenSSL 1.0.0 +and have been available since +.Ox 4.9 . .Sh CAVEATS The .Vt EVP_PKEY_CTX diff --git a/man/EVP_PKEY_asn1_get_count.3 b/man/EVP_PKEY_asn1_get_count.3 new file mode 100644 index 00000000..576a2935 --- /dev/null +++ b/man/EVP_PKEY_asn1_get_count.3 @@ -0,0 +1,172 @@ +.\" $OpenBSD: EVP_PKEY_asn1_get_count.3,v 1.3 2018/05/13 16:42:21 schwarze Exp $ +.\" full merge up to: OpenSSL 751148e2 Oct 27 00:11:11 2017 +0200 +.\" +.\" This file was written by Richard Levitte . +.\" Copyright (c) 2017 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. +.\" +.Dd $Mdocdate: May 13 2018 $ +.Dt EVP_PKEY_ASN1_GET_COUNT 3 +.Os +.Sh NAME +.Nm EVP_PKEY_asn1_get_count , +.Nm EVP_PKEY_asn1_get0 , +.Nm EVP_PKEY_get0_asn1 , +.Nm EVP_PKEY_asn1_find , +.Nm EVP_PKEY_asn1_find_str , +.Nm EVP_PKEY_asn1_get0_info +.Nd enumerate public key ASN.1 methods +.Sh SYNOPSIS +.In openssl/evp.h +.Ft int +.Fn EVP_PKEY_asn1_get_count void +.Ft const EVP_PKEY_ASN1_METHOD * +.Fo EVP_PKEY_asn1_get0 +.Fa "int idx" +.Fc +.Ft const EVP_PKEY_ASN1_METHOD * +.Fo EVP_PKEY_get0_asn1 +.Fa "const EVP_PKEY *pkey" +.Fc +.Ft const EVP_PKEY_ASN1_METHOD * +.Fo EVP_PKEY_asn1_find +.Fa "ENGINE **pe" +.Fa "int type" +.Fc +.Ft const EVP_PKEY_ASN1_METHOD * +.Fo EVP_PKEY_asn1_find_str +.Fa "ENGINE **pe" +.Fa "const char *str" +.Fa "int len" +.Fc +.Ft int +.Fo EVP_PKEY_asn1_get0_info +.Fa "int *ppkey_id" +.Fa "int *pkey_base_id" +.Fa "int *ppkey_flags" +.Fa "const char **pinfo" +.Fa "const char **ppem_str" +.Fa "const EVP_PKEY_ASN1_METHOD *ameth" +.Fc +.Sh DESCRIPTION +.Fn EVP_PKEY_asn1_get_count +returns a count of the number of public key ASN.1 methods available. +It includes standard methods and any methods added by the application. +.Pp +.Fn EVP_PKEY_asn1_get0 +returns the public key ASN.1 method +.Fa idx . +The value of +.Fa idx +must be in the range from zero to +.Fn EVP_PKEY_asn1_get_count +\- 1. +.Pp +.Fn EVP_PKEY_asn1_find +looks up the method with NID +.Fa type . +If +.Fa pe +is not +.Dv NULL , +it first looks for an engine implementing a method for the NID +.Fa type . +If one is found, +.Pf * Fa pe +is set to that engine and the method from that engine is returned instead. +.Pp +.Fn EVP_PKEY_asn1_find_str +looks up the method with PEM type string +.Fa str . +Just like +.Fn EVP_PKEY_asn1_find , +if +.Fa pe +is not +.Dv NULL , +methods from engines are preferred. +.Pp +.Fn EVP_PKEY_asn1_get0_info +retrieves the public key ID, the base public key ID (both NIDs), any flags, +the method description and the PEM type string associated with the public +key ASN.1 method +.Sy *ameth . +.Pp +.Fn EVP_PKEY_asn1_get_count , +.Fn EVP_PKEY_asn1_get0 , +.Fn EVP_PKEY_asn1_find +and +.Fn EVP_PKEY_asn1_find_str +are not thread safe, but as long as all +.Vt EVP_PKEY_ASN1_METHOD +objects are added before the application gets threaded, using them is +safe. +See +.Xr EVP_PKEY_asn1_add0 3 . +.Sh RETURN VALUES +.Fn EVP_PKEY_asn1_get_count +returns the number of available public key methods. +.Pp +.Fn EVP_PKEY_asn1_get0 +returns a public key method or +.Dv NULL +if +.Fa idx +is out of range. +.Pp +.Fn EVP_PKEY_get0_asn1 +returns the public key method used by +.Fa pkey . +.Pp +.Fn EVP_PKEY_asn1_get0_info +returns 1 on success or 0 on failure. +.Sh SEE ALSO +.Xr EVP_PKEY_asn1_new 3 , +.Xr EVP_PKEY_base_id 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.0.0 +and have been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_asn1_new.3 b/man/EVP_PKEY_asn1_new.3 new file mode 100644 index 00000000..2af7a824 --- /dev/null +++ b/man/EVP_PKEY_asn1_new.3 @@ -0,0 +1,459 @@ +.\" $OpenBSD: EVP_PKEY_asn1_new.3,v 1.3 2018/05/13 15:53:30 schwarze Exp $ +.\" selective merge up to: +.\" OpenSSL man3/EVP_PKEY_ASN1_METHOD b0004708 Nov 1 00:45:24 2017 +0800 +.\" +.\" This file was written by Richard Levitte +.\" Copyright (c) 2017 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. +.\" +.Dd $Mdocdate: May 13 2018 $ +.Dt EVP_PKEY_ASN1_METHOD 3 +.Os +.Sh NAME +.Nm EVP_PKEY_asn1_new , +.Nm EVP_PKEY_asn1_copy , +.Nm EVP_PKEY_asn1_free , +.Nm EVP_PKEY_asn1_add0 , +.Nm EVP_PKEY_asn1_add_alias , +.Nm EVP_PKEY_asn1_set_public , +.Nm EVP_PKEY_asn1_set_private , +.Nm EVP_PKEY_asn1_set_param , +.Nm EVP_PKEY_asn1_set_free , +.Nm EVP_PKEY_asn1_set_ctrl +.Nd manipulating and registering an EVP_PKEY_ASN1_METHOD structure +.Sh SYNOPSIS +.In openssl/evp.h +.Ft EVP_PKEY_ASN1_METHOD * +.Fo EVP_PKEY_asn1_new +.Fa "int id" +.Fa "int flags" +.Fa "const char *pem_str" +.Fa "const char *info" +.Fc +.Ft void +.Fo EVP_PKEY_asn1_copy +.Fa "EVP_PKEY_ASN1_METHOD *dst" +.Fa "const EVP_PKEY_ASN1_METHOD *src" +.Fc +.Ft void +.Fo EVP_PKEY_asn1_free +.Fa "EVP_PKEY_ASN1_METHOD *ameth" +.Fc +.Ft int +.Fo EVP_PKEY_asn1_add0 +.Fa "const EVP_PKEY_ASN1_METHOD *ameth" +.Fc +.Ft int +.Fo EVP_PKEY_asn1_add_alias +.Fa "int to" +.Fa "int from" +.Fc +.Ft void +.Fo EVP_PKEY_asn1_set_public +.Fa "EVP_PKEY_ASN1_METHOD *ameth" +.Fa "int (*pub_decode)(EVP_PKEY *pk, X509_PUBKEY *pub)" +.Fa "int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk)" +.Fa "int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b)" +.Fa "int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent,\ + ASN1_PCTX *pctx)" +.Fa "int (*pkey_size)(const EVP_PKEY *pk)" +.Fa "int (*pkey_bits)(const EVP_PKEY *pk)" +.Fc +.Ft void +.Fo EVP_PKEY_asn1_set_private +.Fa "EVP_PKEY_ASN1_METHOD *ameth" +.Fa "int (*priv_decode)(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf)" +.Fa "int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk)" +.Fa "int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent,\ + ASN1_PCTX *pctx)" +.Fc +.Ft void +.Fo EVP_PKEY_asn1_set_param +.Fa "EVP_PKEY_ASN1_METHOD *ameth" +.Fa "int (*param_decode)(EVP_PKEY *pkey, const unsigned char **pder,\ + int derlen)" +.Fa "int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder)" +.Fa "int (*param_missing)(const EVP_PKEY *pk)" +.Fa "int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from)" +.Fa "int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b)" +.Fa "int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent,\ + ASN1_PCTX *pctx)" +.Fc +.Ft void +.Fo EVP_PKEY_asn1_set_free +.Fa "EVP_PKEY_ASN1_METHOD *ameth" +.Fa "void (*pkey_free)(EVP_PKEY *pkey)" +.Fc +.Ft void +.Fo EVP_PKEY_asn1_set_ctrl +.Fa "EVP_PKEY_ASN1_METHOD *ameth" +.Fa "int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2)" +.Fc +.Sh DESCRIPTION +.Vt EVP_PKEY_ASN1_METHOD +is a structure which holds a set of ASN.1 conversion, printing and +information methods for a specific public key algorithm. +.Pp +There are two places where the +.Vt EVP_PKEY_ASN1_METHOD +objects are stored: one is a built-in array representing the standard +methods for different algorithms, and the other one is a stack of +user-defined application-specific methods, which can be manipulated by +using +.Fn EVP_PKEY_asn1_add0 . +.Ss Methods +The methods are the underlying implementations of a particular public +key algorithm present by the +.Vt EVP_PKEY +object. +.Bd -unfilled +.Ft int Fo (*pub_decode) +.Fa "EVP_PKEY *pk" +.Fa "X509_PUBKEY *pub" +.Fc +.Ft int Fo (*pub_encode) +.Fa "X509_PUBKEY *pub" +.Fa "const EVP_PKEY *pk" +.Fc +.Ft int Fo (*pub_cmp) +.Fa "const EVP_PKEY *a" +.Fa "const EVP_PKEY *b" +.Fc +.Ft int Fo (*pub_print) +.Fa "BIO *out" +.Fa "const EVP_PKEY *pkey" +.Fa "int indent" +.Fa "ASN1_PCTX *pctx" +.Fc +.Ed +.Pp +The +.Fn pub_decode +and +.Fn pub_encode +methods are called to decode and encode +.Vt X509_PUBKEY +ASN.1 parameters to and from +.Fa pk . +They must return 0 on error and 1 on success. +They are called by +.Xr X509_PUBKEY_get 3 +and +.Xr X509_PUBKEY_set 3 . +.Pp +The +.Fn pub_cmp +method is called when two public keys are compared. +It must return 1 when the keys are equal and 0 otherwise. +It is called by +.Xr EVP_PKEY_cmp 3 . +.Pp +The +.Fn pub_print +method is called to print a public key in humanly readable text to +.Fa out , +indented +.Fa indent +spaces. +It must return 0 on error and 1 on success. +It is called by +.Xr EVP_PKEY_print_public 3 . +.Bd -unfilled +.Ft int Fo (*priv_decode) +.Fa "EVP_PKEY *pk" +.Fa "const PKCS8_PRIV_KEY_INFO *p8inf" +.Fc +.Ft int Fo (*priv_encode) +.Fa "PKCS8_PRIV_KEY_INFO *p8" +.Fa "const EVP_PKEY *pk" +.Fc +.Ft int Fo (*priv_print) +.Fa "BIO *out" +.Fa "const EVP_PKEY *pkey" +.Fa "int indent" +.Fa "ASN1_PCTX *pctx" +.Fc +.Ed +.Pp +The +.Fn priv_decode +and +.Fn priv_encode +methods are called to decode and encode +.Vt PKCS8_PRIV_KEY_INFO +form private key to and from +.Fa pk . +They must return 0 on error, 1 on success. +They are called by +.Fn EVP_PKCS82PKEY +and +.Fn EVP_PKEY2PKCS8 . +.Pp +The +.Fn priv_print +method is called to print a private key in humanly readable text to +.Fa out , +indented +.Fa indent +spaces. +It must return 0 on error and 1 on success. +It is called by +.Xr EVP_PKEY_print_private 3 . +.Bd -unfilled +.Ft int Fn (*pkey_size) "const EVP_PKEY *pk" +.Ft int Fn (*pkey_bits) "const EVP_PKEY *pk"; +.Ed +.Pp +The +.Fn pkey_size +method returns the key size in bytes. +It is called by +.Xr EVP_PKEY_size 3 . +.Pp +The +.Fn pkey_bits +method returns the key size in bits. +It is called by +.Xr EVP_PKEY_bits 3 . +.Bd -unfilled +.Ft int Fo (*param_decode) +.Fa "EVP_PKEY *pkey" +.Fa "const unsigned char **pder" +.Fa "int derlen" +.Fc +.Ft int Fo (*param_encode) +.Fa "const EVP_PKEY *pkey" +.Fa "unsigned char **pder" +.Fc +.Ft int Fo (*param_missing) +.Fa "const EVP_PKEY *pk" +.Fc +.Ft int Fo (*param_copy) +.Fa "EVP_PKEY *to" +.Fa "const EVP_PKEY *from" +.Fc +.Ft int Fo (*param_cmp) +.Fa "const EVP_PKEY *a" +.Fa "const EVP_PKEY *b" +.Fc +.Ft int Fo (*param_print) +.Fa "BIO *out" +.Fa "const EVP_PKEY *pkey" +.Fa "int indent" +.Fa "ASN1_PCTX *pctx" +.Fc +.Ed +.Pp +The +.Fn param_decode +and +.Fn param_encode +methods are called to decode and encode DER formatted parameters to and from +.Fa pk . +They must return 0 on error and 1 on success. +They are called by +.Fn PEM_read_bio_Parameters . +.Pp +The +.Fn param_missing +method returns 0 if a key parameter is missing or otherwise 1. +It is called by +.Xr EVP_PKEY_missing_parameters 3 . +.Pp +The +.Fn param_copy +method copies key parameters from +.Fa from +to +.Fa to . +It must return 0 on error and 1 on success. +It is called by +.Xr EVP_PKEY_copy_parameters 3 . +.Pp +The +.Fn param_cmp +method compares the parameters of the keys +.Fa a +and +.Fa b . +It must return 1 when the keys are equal, 0 when not equal, and a +negative number on error. +It is called by +.Xr EVP_PKEY_cmp_parameters 3 . +.Pp +The +.Fn param_print +method prints the private key parameters in humanly readable text to +.Fa out , +indented +.Fa indent +spaces. +It must return 0 on error and 1 on success. +It is called by +.Xr EVP_PKEY_print_params 3 . +.Bd -unfilled +.Ft void Fn (*pkey_free) "EVP_PKEY *pkey" +.Ed +.Pp +The +.Fn pkey_free +method helps freeing the internals of +.Fa pkey . +It is called by +.Xr EVP_PKEY_free 3 , +.Fn EVP_PKEY_set_type , +.Fn EVP_PKEY_set_type_str , +and +.Fn EVP_PKEY_assign . +.Bd -unfilled +.Ft int Fo (*pkey_ctrl) +.Fa "EVP_PKEY *pkey" +.Fa "int op" +.Fa "long arg1" +.Fa "void *arg2" +.Fc +.Ed +.Pp +The +.Fn pkey_ctrl +method adds extra algorithm specific control. +It is called by +.Xr EVP_PKEY_get_default_digest_nid 3 , +.Fn PKCS7_SIGNER_INFO_set , +.Fn PKCS7_RECIP_INFO_set , +and other functions. +.Ss Functions +.Fn EVP_PKEY_asn1_new +creates and returns a new +.Vt EVP_PKEY_ASN1_METHOD +object, and associates the given +.Fa id , +.Fa flags , +.Fa pem_str +and +.Fa info . +.Fa id +is a NID, +.Fa pem_str +is the PEM type string, +.Fa info +is a descriptive string. +If +.Dv ASN1_PKEY_SIGPARAM_NULL +is set in +.Fa flags , +the signature algorithm parameters are given the type +.Dv V_ASN1_NULL +by default, otherwise they will be given the type +.Dv V_ASN1_UNDEF +(i.e. the parameter is omitted). +See +.Xr X509_ALGOR_set0 3 +for more information. +.Pp +.Fn EVP_PKEY_asn1_copy +copies an +.Vt EVP_PKEY_ASN1_METHOD +object from +.Fa src +to +.Fa dst . +This function is not thread safe, it is recommended to only use this when +initializing the application. +.Pp +.Fn EVP_PKEY_asn1_free +frees an existing +.Vt EVP_PKEY_ASN1_METHOD +pointed by +.Fa ameth . +.Pp +.Fn EVP_PKEY_asn1_add0 +adds +.Fa ameth +to the user defined stack of methods unless another +.Vt EVP_PKEY_ASN1_METHOD +with the same NID is already there. +This function is not thread safe, it is recommended to only use this when +initializing the application. +.Pp +.Fn EVP_PKEY_asn1_add_alias +creates an alias with the NID +.Fa to +for the +.Vt EVP_PKEY_ASN1_METHOD +with NID +.Fa from +unless another +.Vt EVP_PKEY_ASN1_METHOD +with the same NID is already added. +This function is not thread safe, it's recommended to only use this when +initializing the application. +.Pp +.Fn EVP_PKEY_asn1_set_public , +.Fn EVP_PKEY_asn1_set_private , +.Fn EVP_PKEY_asn1_set_param , +.Fn EVP_PKEY_asn1_set_free , +and +.Fn EVP_PKEY_asn1_set_ctrl +set the diverse methods of the given +.Vt EVP_PKEY_ASN1_METHOD +object. +.Sh RETURN VALUES +.Fn EVP_PKEY_asn1_new +returns a pointer to an +.Vt EVP_PKEY_ASN1_METHOD +object or +.Dv NULL +on error. +.Pp +.Fn EVP_PKEY_asn1_add0 +and +.Fn EVP_PKEY_asn1_add_alias +return 0 on error or 1 on success. +.Sh HISTORY +These functions first appeared in OpenSSL 1.0.0 +and have been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_cmp.3 b/man/EVP_PKEY_cmp.3 index c583cecf..f4a7d8ea 100644 --- a/man/EVP_PKEY_cmp.3 +++ b/man/EVP_PKEY_cmp.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_PKEY_cmp.3,v 1.4 2016/11/27 15:22:39 schwarze Exp $ +.\" $OpenBSD: EVP_PKEY_cmp.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 27 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt EVP_PKEY_CMP 3 .Os .Sh NAME @@ -141,5 +141,19 @@ and return 1 if the keys match, 0 if they don't match, -1 if the key types are different and -2 if the operation is not supported. .Sh SEE ALSO +.Xr EVP_PKEY_asn1_set_public 3 , .Xr EVP_PKEY_CTX_new 3 , .Xr EVP_PKEY_keygen 3 +.Sh HISTORY +.Fn EVP_PKEY_missing_parameters +and +.Fn EVP_PKEY_copy_parameters +first appeared in SSLeay 0.8.0. +.Fn EVP_PKEY_cmp_parameters +first appeared in SSLeay 0.9.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn EVP_PKEY_cmp +first appeared in OpenSSL 0.9.8 and has been available since +.Ox 4.5 . diff --git a/man/EVP_PKEY_decrypt.3 b/man/EVP_PKEY_decrypt.3 index 485fafb5..cdae726c 100644 --- a/man/EVP_PKEY_decrypt.3 +++ b/man/EVP_PKEY_decrypt.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: EVP_PKEY_decrypt.3,v 1.4 2016/11/27 15:27:19 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: EVP_PKEY_decrypt.3,v 1.7 2018/03/23 04:34:23 schwarze Exp $ +.\" full merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2006, 2009, 2013 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2006, 2009, 2013, 2018 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 @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 27 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_DECRYPT 3 .Os .Sh NAME @@ -129,13 +130,16 @@ Decrypt data using OAEP (for RSA keys): #include EVP_PKEY_CTX *ctx; +ENGINE *eng; unsigned char *out, *in; size_t outlen, inlen; EVP_PKEY *key; -/* NB: assumes key in, inlen are already set up - * and that key is an RSA private key + +/* + * Assumes that key, eng, in, and inlen are already set up + * and that key is an RSA private key. */ -ctx = EVP_PKEY_CTX_new(key); +ctx = EVP_PKEY_CTX_new(key, eng); if (!ctx) /* Error occurred */ if (EVP_PKEY_decrypt_init(ctx) <= 0) @@ -161,8 +165,13 @@ if (EVP_PKEY_decrypt(ctx, out, &outlen, in, inlen) <= 0) .Xr EVP_PKEY_CTX_new 3 , .Xr EVP_PKEY_derive 3 , .Xr EVP_PKEY_encrypt 3 , +.Xr EVP_PKEY_meth_set_decrypt 3 , .Xr EVP_PKEY_sign 3 , .Xr EVP_PKEY_verify 3 , .Xr EVP_PKEY_verify_recover 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.0. +.Fn EVP_PKEY_decrypt_init +and +.Fn EVP_PKEY_decrypt +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_derive.3 b/man/EVP_PKEY_derive.3 index b8c4c4d6..574b6b9b 100644 --- a/man/EVP_PKEY_derive.3 +++ b/man/EVP_PKEY_derive.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: EVP_PKEY_derive.3,v 1.5 2017/04/10 17:45:06 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: EVP_PKEY_derive.3,v 1.8 2018/03/23 04:34:23 schwarze Exp $ +.\" full merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2006, 2009, 2013 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2006, 2009, 2013, 2018 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 @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_DERIVE 3 .Os .Sh NAME @@ -132,12 +133,13 @@ Derive shared secret (for example DH or EC keys): #include EVP_PKEY_CTX *ctx; +ENGINE *eng; unsigned char *skey; size_t skeylen; EVP_PKEY *pkey, *peerkey; -/* NB: assumes pkey, peerkey have been already set up */ -ctx = EVP_PKEY_CTX_new(pkey); +/* Assumes that pkey, eng, and peerkey have already been set up. */ +ctx = EVP_PKEY_CTX_new(pkey, eng); if (!ctx) /* Error occurred */ if (EVP_PKEY_derive_init(ctx) <= 0) @@ -163,9 +165,15 @@ if (EVP_PKEY_derive(ctx, skey, &skeylen) <= 0) .Xr EVP_PKEY_CTX_new 3 , .Xr EVP_PKEY_decrypt 3 , .Xr EVP_PKEY_encrypt 3 , +.Xr EVP_PKEY_meth_set_derive 3 , .Xr EVP_PKEY_sign 3 , .Xr EVP_PKEY_verify 3 , .Xr EVP_PKEY_verify_recover 3 , .Xr X25519 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.0. +.Fn EVP_PKEY_derive_init , +.Fn EVP_PKEY_derive_set_peer , +and +.Fn EVP_PKEY_derive +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_encrypt.3 b/man/EVP_PKEY_encrypt.3 index 7309c347..a627c2ab 100644 --- a/man/EVP_PKEY_encrypt.3 +++ b/man/EVP_PKEY_encrypt.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_PKEY_encrypt.3,v 1.4 2016/11/27 15:23:29 schwarze Exp $ +.\" $OpenBSD: EVP_PKEY_encrypt.3,v 1.6 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 27 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_ENCRYPT 3 .Os .Sh NAME @@ -172,8 +172,13 @@ if (EVP_PKEY_encrypt(ctx, out, &outlen, in, inlen) <= 0) .Xr EVP_PKEY_CTX_new 3 , .Xr EVP_PKEY_decrypt 3 , .Xr EVP_PKEY_derive 3 , +.Xr EVP_PKEY_meth_set_encrypt 3 , .Xr EVP_PKEY_sign 3 , .Xr EVP_PKEY_verify 3 , .Xr EVP_PKEY_verify_recover 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.0. +.Fn EVP_PKEY_encrypt_init +and +.Fn EVP_PKEY_encrypt +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_get_default_digest_nid.3 b/man/EVP_PKEY_get_default_digest_nid.3 index 906cdb70..9b0c3010 100644 --- a/man/EVP_PKEY_get_default_digest_nid.3 +++ b/man/EVP_PKEY_get_default_digest_nid.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_PKEY_get_default_digest_nid.3,v 1.2 2016/11/27 15:27:19 schwarze Exp $ +.\" $OpenBSD: EVP_PKEY_get_default_digest_nid.3,v 1.4 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 27 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_GET_DEFAULT_DIGEST_NID 3 .Os .Sh NAME @@ -81,10 +81,13 @@ It returns 0 or a negative value for failure. In particular, a return value of -2 indicates the operation is not supported by the public key algorithm. .Sh SEE ALSO +.Xr EVP_PKEY_asn1_set_ctrl 3 , .Xr EVP_PKEY_CTX_ctrl 3 , .Xr EVP_PKEY_CTX_new 3 , .Xr EVP_PKEY_sign 3 , .Xr EVP_PKEY_verify 3 , .Xr EVP_PKEY_verify_recover 3 .Sh HISTORY -This function was first added to OpenSSL 1.0.0. +.Fn EVP_PKEY_get_default_digest_nid +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_keygen.3 b/man/EVP_PKEY_keygen.3 index a05e19f8..6173a1c4 100644 --- a/man/EVP_PKEY_keygen.3 +++ b/man/EVP_PKEY_keygen.3 @@ -1,8 +1,10 @@ -.\" $OpenBSD: EVP_PKEY_keygen.3,v 1.6 2017/08/01 14:57:03 schwarze Exp $ -.\" OpenSSL 99d63d466 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: EVP_PKEY_keygen.3,v 1.9 2018/03/23 04:34:23 schwarze Exp $ +.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 +.\" selective merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2006, 2009, 2013, 2015, 2016 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2006, 2009, 2013, 2015, 2016, 2018 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 @@ -48,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 1 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_KEYGEN 3 .Os .Sh NAME @@ -215,6 +217,7 @@ Generate a 2048-bit RSA key: EVP_PKEY_CTX *ctx; EVP_PKEY *pkey = NULL; + ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL); if (!ctx) /* Error occurred */ @@ -234,9 +237,11 @@ Generate a key from a set of parameters: #include EVP_PKEY_CTX *ctx; +ENGINE *eng; EVP_PKEY *pkey = NULL, *param; -/* Assumed param is set up already */ -ctx = EVP_PKEY_CTX_new(param); + +/* Assumes that param and eng are already set up. */ +ctx = EVP_PKEY_CTX_new(param, eng); if (!ctx) /* Error occurred */ if (EVP_PKEY_keygen_init(ctx) <= 0) @@ -279,9 +284,12 @@ genpkey_cb(EVP_PKEY_CTX *ctx) .Xr EVP_PKEY_decrypt 3 , .Xr EVP_PKEY_derive 3 , .Xr EVP_PKEY_encrypt 3 , +.Xr EVP_PKEY_meth_set_keygen 3 , .Xr EVP_PKEY_sign 3 , .Xr EVP_PKEY_verify 3 , .Xr EVP_PKEY_verify_recover 3 , .Xr X25519 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.0. +These functions first appeared in OpenSSL 1.0.0 +and have been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_meth_get0_info.3 b/man/EVP_PKEY_meth_get0_info.3 index a5d8ad92..eef35fad 100644 --- a/man/EVP_PKEY_meth_get0_info.3 +++ b/man/EVP_PKEY_meth_get0_info.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_PKEY_meth_get0_info.3,v 1.1 2017/08/20 19:21:20 schwarze Exp $ +.\" $OpenBSD: EVP_PKEY_meth_get0_info.3,v 1.2 2018/03/23 05:48:56 schwarze Exp $ .\" OpenSSL EVP_PKEY_meth_get_count.pod 6a2da303 Aug 9 11:25:19 2017 -0400 .\" OpenSSL EVP_PKEY_meth_get_count.pod 48ed9c23 Jul 25 17:48:26 2017 +0100 .\" @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_METH_GET0_INFO 3 .Os .Sh NAME @@ -71,3 +71,7 @@ public key method .Pf * Fa meth . .Sh SEE ALSO .Xr EVP_PKEY_new 3 +.Sh HISTORY +.Fn EVP_PKEY_meth_get0_info +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . diff --git a/man/EVP_PKEY_meth_new.3 b/man/EVP_PKEY_meth_new.3 new file mode 100644 index 00000000..a3c58844 --- /dev/null +++ b/man/EVP_PKEY_meth_new.3 @@ -0,0 +1,551 @@ +.\" $OpenBSD: EVP_PKEY_meth_new.3,v 1.3 2018/03/23 05:48:56 schwarze Exp $ +.\" selective merge up to: OpenSSL 43f985fd Aug 21 11:47:17 2017 -0400 +.\" +.\" This file was written by Paul Yang +.\" Copyright (c) 2017 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. +.\" +.Dd $Mdocdate: March 23 2018 $ +.Dt EVP_PKEY_METH_NEW 3 +.Os +.Sh NAME +.Nm EVP_PKEY_meth_new , +.Nm EVP_PKEY_meth_free , +.Nm EVP_PKEY_meth_copy , +.Nm EVP_PKEY_meth_find , +.Nm EVP_PKEY_meth_add0 , +.Nm EVP_PKEY_meth_set_init , +.Nm EVP_PKEY_meth_set_copy , +.Nm EVP_PKEY_meth_set_cleanup , +.Nm EVP_PKEY_meth_set_paramgen , +.Nm EVP_PKEY_meth_set_keygen , +.Nm EVP_PKEY_meth_set_sign , +.Nm EVP_PKEY_meth_set_verify , +.Nm EVP_PKEY_meth_set_verify_recover , +.Nm EVP_PKEY_meth_set_signctx , +.Nm EVP_PKEY_meth_set_verifyctx , +.Nm EVP_PKEY_meth_set_encrypt , +.Nm EVP_PKEY_meth_set_decrypt , +.Nm EVP_PKEY_meth_set_derive , +.Nm EVP_PKEY_meth_set_ctrl +.Nd manipulate an EVP_PKEY_METHOD structure +.Sh SYNOPSIS +.In openssl/evp.h +.Ft EVP_PKEY_METHOD * +.Fo EVP_PKEY_meth_new +.Fa "int id" +.Fa "int flags" +.Fc +.Ft void +.Fo EVP_PKEY_meth_free +.Fa "EVP_PKEY_METHOD *pmeth" +.Fc +.Ft void +.Fo EVP_PKEY_meth_copy +.Fa "EVP_PKEY_METHOD *dst" +.Fa "const EVP_PKEY_METHOD *src" +.Fc +.Ft const EVP_PKEY_METHOD * +.Fo EVP_PKEY_meth_find +.Fa "int type" +.Fc +.Ft int +.Fo EVP_PKEY_meth_add0 +.Fa "const EVP_PKEY_METHOD *pmeth" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_init +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*init)(EVP_PKEY_CTX *ctx)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_copy +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*copy)(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_cleanup +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "void (*cleanup)(EVP_PKEY_CTX *ctx)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_paramgen +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*paramgen_init)(EVP_PKEY_CTX *ctx)" +.Fa "int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_keygen +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*keygen_init)(EVP_PKEY_CTX *ctx)" +.Fa "int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_sign +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*sign_init)(EVP_PKEY_CTX *ctx)" +.Fa "int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,\ + const unsigned char *tbs, size_t tbslen)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_verify +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*verify_init)(EVP_PKEY_CTX *ctx)" +.Fa "int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig,\ + size_t siglen, const unsigned char *tbs, size_t tbslen)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_verify_recover +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*verify_recover_init)(EVP_PKEY_CTX *ctx)" +.Fa "int (*verify_recover)(EVP_PKEY_CTX *ctx, unsigned char *sig,\ + size_t *siglen, const unsigned char *tbs, size_t tbslen)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_signctx +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)" +.Fa "int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig,\ + size_t *siglen, EVP_MD_CTX *mctx)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_verifyctx +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)" +.Fa "int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig,\ + int siglen, EVP_MD_CTX *mctx)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_encrypt +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*encrypt_init)(EVP_PKEY_CTX *ctx)" +.Fa "int (*encryptfn)(EVP_PKEY_CTX *ctx, unsigned char *out,\ + size_t *outlen, const unsigned char *in, size_t inlen)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_decrypt +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*decrypt_init)(EVP_PKEY_CTX *ctx)" +.Fa "int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out,\ + size_t *outlen, const unsigned char *in, size_t inlen)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_derive +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*derive_init)(EVP_PKEY_CTX *ctx)" +.Fa "int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)" +.Fc +.Ft void +.Fo EVP_PKEY_meth_set_ctrl +.Fa "EVP_PKEY_METHOD *pmeth" +.Fa "int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)" +.Fa "int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value)" +.Fc +.Sh DESCRIPTION +The +.Vt EVP_PKEY_METHOD +structure holds a set of methods +for a specific public key cryptographic algorithm. +Those methods perform tasks such as generating keys, signing, verifying, +encrypting, decrypting, and so on. +.Pp +There are two places where the +.Vt EVP_PKEY_METHOD +objects are stored: one is a built-in static array representing the +standard methods for different algorithms, and the other one is a stack +of user-defined application-specific methods, which can be manipulated +with +.Fn EVP_PKEY_meth_add0 . +.Pp +The +.Vt EVP_PKEY_METHOD +objects are usually referenced by +.Vt EVP_PKEY_CTX +objects. +.Ss Methods +The methods implement the particular public key algorithm represented by the +.Vt EVP_PKEY_CTX +object. +.Bd -unfilled +.Ft int Fn (*init) "EVP_PKEY_CTX *ctx" +.Ft int Fn (*copy) "EVP_PKEY_CTX *dst" "EVP_PKEY_CTX *src" +.Ft void Fn (*cleanup) "EVP_PKEY_CTX *ctx" +.Ed +.Pp +The +.Fn init +method is called by +.Xr EVP_PKEY_CTX_new 3 +and +.Xr EVP_PKEY_CTX_new_id 3 +to initialize the algorithm-specific data when a new +.Vt EVP_PKEY_CTX +is created. +The +.Fn cleanup +method is called by +.Xr EVP_PKEY_CTX_free 3 +when an +.Vt EVP_PKEY_CTX +is freed. +The +.Fn copy +method is called by +.Xr EVP_PKEY_CTX_dup 3 +when an +.Vt EVP_PKEY_CTX +is duplicated. +.Bd -unfilled +.Ft int Fn (*paramgen_init) "EVP_PKEY_CTX *ctx" +.Ft int Fn (*paramgen) "EVP_PKEY_CTX *ctx" "EVP_PKEY *pkey" +.Ed +.Pp +The +.Fn paramgen_init +and +.Fn paramgen +methods deal with key parameter generation. +They are called by +.Xr EVP_PKEY_paramgen_init 3 +and +.Xr EVP_PKEY_paramgen 3 +to handle the parameter generation process. +.Bd -unfilled +.Ft int Fn (*keygen_init) "EVP_PKEY_CTX *ctx" +.Ft int Fn (*keygen) "EVP_PKEY_CTX *ctx" "EVP_PKEY *pkey" +.Ed +.Pp +The +.Fn keygen_init +and +.Fn keygen +methods are used to generate a key for the specified algorithm. +They are called by +.Xr EVP_PKEY_keygen_init 3 +and +.Xr EVP_PKEY_keygen 3 . +.Bd -unfilled +.Ft int Fn (*sign_init) "EVP_PKEY_CTX *ctx" +.Ft int Fo (*sign) +.Fa "EVP_PKEY_CTX *ctx" +.Fa "unsigned char *sig" +.Fa "size_t *siglen" +.Fa "const unsigned char *tbs" +.Fa "size_t tbslen" +.Fc +.Ed +.Pp +The +.Fn sign_init +and +.Fn sign +methods are used to generate the signature of a piece of data using a +private key. +They are called by +.Xr EVP_PKEY_sign_init 3 +and +.Xr EVP_PKEY_sign 3 . +.Bd -unfilled +.Ft int Fn (*verify_init) "EVP_PKEY_CTX *ctx" +.Ft int Fo (*verify) +.Fa "EVP_PKEY_CTX *ctx" +.Fa "const unsigned char *sig" +.Fa "size_t siglen" +.Fa "const unsigned char *tbs" +.Fa "size_t tbslen" +.Fc +.Ed +.Pp +The +.Fn verify_init +and +.Fn verify +methods are used to verify whether a signature is valid. +They are called by +.Xr EVP_PKEY_verify_init 3 +and +.Xr EVP_PKEY_verify 3 . +.Bd -unfilled +.Ft int Fn (*verify_recover_init) "EVP_PKEY_CTX *ctx" +.Ft int Fo (*verify_recover) +.Fa "EVP_PKEY_CTX *ctx" +.Fa "unsigned char *rout" +.Fa "size_t *routlen" +.Fa "const unsigned char *sig" +.Fa "size_t siglen" +.Fc +.Ed +.Pp +The +.Fn verify_recover_init +and +.Fn verify_recover +methods are used to verify a signature and then recover the digest from +the signature (for instance, a signature that was generated by the RSA +signing algorithm). +They are called by +.Xr EVP_PKEY_verify_recover_init 3 +and +.Xr EVP_PKEY_verify_recover 3 . +.Bd -unfilled +.Ft int Fn (*signctx_init) "EVP_PKEY_CTX *ctx" "EVP_MD_CTX *mctx" +.Ft int Fo (*signctx) +.Fa "EVP_PKEY_CTX *ctx" +.Fa "unsigned char *sig" +.Fa "size_t *siglen" +.Fa "EVP_MD_CTX *mctx" +.Fc +.Ed +.Pp +The +.Fn signctx_init +and +.Fn signctx +methods are used to sign a digest represented by an +.Vt EVP_MD_CTX +object. +They are called by the +.Xr EVP_DigestSignInit 3 +functions. +.Bd -unfilled +.Ft int Fn (*verifyctx_init) "EVP_PKEY_CTX *ctx" "EVP_MD_CTX *mctx" +.Ft int Fo (*verifyctx) +.Fa "EVP_PKEY_CTX *ctx" +.Fa "const unsigned char *sig" +.Fa "int siglen" +.Fa "EVP_MD_CTX *mctx" +.Fc +.Ed +.Pp +The +.Fn verifyctx_init +and +.Fn verifyctx +methods are used to verify a signature against the data in an +.Vt EVP_MD_CTX +object. +They are called by the +.Xr EVP_DigestVerifyInit 3 +functions. +.Bd -unfilled +.Ft int Fn (*encrypt_init) "EVP_PKEY_CTX *ctx" +.Ft int Fo (*encrypt) +.Fa "EVP_PKEY_CTX *ctx" +.Fa "unsigned char *out" +.Fa "size_t *outlen" +.Fa "const unsigned char *in" +.Fa "size_t inlen" +.Fc +.Ed +.Pp +The +.Fn encrypt_init +and +.Fn encrypt +methods are used to encrypt a piece of data. +They are called by +.Xr EVP_PKEY_encrypt_init 3 +and +.Xr EVP_PKEY_encrypt 3 . +.Bd -unfilled +.Ft int Fn (*decrypt_init) "EVP_PKEY_CTX *ctx" +.Ft int Fo (*decrypt) +.Fa "EVP_PKEY_CTX *ctx" +.Fa "unsigned char *out" +.Fa "size_t *outlen" +.Fa "const unsigned char *in" +.Fa "size_t inlen" +.Fc +.Ed +.Pp +The +.Fn decrypt_init +and +.Fn decrypt +methods are used to decrypt a piece of data. +They are called by +.Xr EVP_PKEY_decrypt_init 3 +and +.Xr EVP_PKEY_decrypt 3 . +.Bd -unfilled +.Ft int Fn (*derive_init) "EVP_PKEY_CTX *ctx" +.Ft int Fo (*derive) +.Fa "EVP_PKEY_CTX *ctx" +.Fa "unsigned char *key" +.Fa "size_t *keylen" +.Fc +.Ed +.Pp +The +.Fn derive_init +and +.Fn derive +methods are used to derive the shared secret from a public key algorithm +(for instance, the DH algorithm). +They are called by +.Xr EVP_PKEY_derive_init 3 +and +.Xr EVP_PKEY_derive 3 . +.Bd -unfilled +.Ft int Fo (*ctrl) +.Fa "EVP_PKEY_CTX *ctx" +.Fa "int type" +.Fa "int p1" +.Fa "void *p2" +.Fc +.Ft int Fo (*ctrl_str) +.Fa "EVP_PKEY_CTX *ctx" +.Fa "const char *type" +.Fa "const char *value" +.Fc +.Ed +.Pp +The +.Fn ctrl +and +.Fn ctrl_str +methods are used to adjust algorithm-specific settings. +See +.Xr EVP_PKEY_CTX_ctrl 3 +for details. +.Ss Functions +.Fn EVP_PKEY_meth_new +creates a new +.Vt EVP_PKEY_METHOD +object with the given +.Fa id +and +.Fa flags . +The following flags are supported: +.Bl -tag -width Ds +.It Dv EVP_PKEY_FLAG_AUTOARGLEN +Automatically calculate the maximum size of the output buffer +in corresponding EVP methods by the EVP framework. +Thus the implementations of these methods don't need to care about +handling the case of returning output buffer size by themselves. +For details on the output buffer size, refer to +.Xr EVP_PKEY_sign 3 . +.It Dv EVP_PKEY_FLAG_SIGCTX_CUSTOM +Indicate that the +.Fn signctx +method of an +.Vt EVP_PKEY_METHOD +is always called by the EVP framework while doing a digest signing +operation by calling +.Xr EVP_DigestSignFinal 3 . +.El +.Pp +.Fn EVP_PKEY_meth_free +frees +.Fa pmeth . +.Pp +.Fn EVP_PKEY_meth_copy +copies +.Fa src +to +.Fa dst . +.Pp +.Fn EVP_PKEY_meth_find +finds an +.Vt EVP_PKEY_METHOD +object with the given +.Fa id . +This function first searches through the user-defined method objects and +then through the built-in objects. +.Pp +.Fn EVP_PKEY_meth_add0 +adds +.Fa pmeth +to the stack of user defined methods. +.Pp +The +.Fn EVP_PKEY_meth_set_* +functions set the corresponding fields of +.Fa pmeth +to the arguments passed. +.Sh RETURN VALUES +.Fn EVP_PKEY_meth_new +returns a pointer to a new +.Vt EVP_PKEY_METHOD +object or +.Dv NULL +on error. +.Pp +.Fn EVP_PKEY_meth_find +returns a pointer to the found +.Vt EVP_PKEY_METHOD +object or +.Dv NULL +if no matching object is found. +.Pp +.Fn EVP_PKEY_meth_add0 +returns 1 if the method is added successfully or 0 if an error occurred. +.Sh HISTORY +.Fn EVP_PKEY_meth_new , +.Fn EVP_PKEY_meth_free , +.Fn EVP_PKEY_meth_find , +.Fn EVP_PKEY_meth_add0 , +.Fn EVP_PKEY_meth_set_init , +.Fn EVP_PKEY_meth_set_copy , +.Fn EVP_PKEY_meth_set_cleanup , +.Fn EVP_PKEY_meth_set_paramgen , +.Fn EVP_PKEY_meth_set_keygen , +.Fn EVP_PKEY_meth_set_sign , +.Fn EVP_PKEY_meth_set_verify , +.Fn EVP_PKEY_meth_set_verify_recover , +.Fn EVP_PKEY_meth_set_signctx , +.Fn EVP_PKEY_meth_set_verifyctx , +.Fn EVP_PKEY_meth_set_encrypt , +.Fn EVP_PKEY_meth_set_decrypt , +.Fn EVP_PKEY_meth_set_derive , +and +.Fn EVP_PKEY_meth_set_ctrl +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . +.Pp +.Fn EVP_PKEY_meth_copy +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . diff --git a/man/EVP_PKEY_new.3 b/man/EVP_PKEY_new.3 index 636df7df..777c108d 100644 --- a/man/EVP_PKEY_new.3 +++ b/man/EVP_PKEY_new.3 @@ -1,8 +1,10 @@ -.\" $OpenBSD: EVP_PKEY_new.3,v 1.3 2016/11/27 15:24:27 schwarze Exp $ -.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" $OpenBSD: EVP_PKEY_new.3,v 1.9 2018/12/22 23:19:53 schwarze Exp $ +.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 .\" -.\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2002 The OpenSSL Project. All rights reserved. +.\" This file was written by Dr. Stephen Henson +.\" and Matt Caswell . +.\" Copyright (c) 2002, 2018 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 @@ -48,21 +50,34 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 27 2016 $ +.Dd $Mdocdate: December 22 2018 $ .Dt EVP_PKEY_NEW 3 .Os .Sh NAME .Nm EVP_PKEY_new , -.Nm EVP_PKEY_free +.Nm EVP_PKEY_up_ref , +.Nm EVP_PKEY_free , +.Nm EVP_PKEY_new_mac_key .Nd private key allocation functions .Sh SYNOPSIS .In openssl/evp.h .Ft EVP_PKEY * .Fn EVP_PKEY_new void +.Ft int +.Fo EVP_PKEY_up_ref +.Fa "EVP_PKEY *key" +.Fc .Ft void .Fo EVP_PKEY_free .Fa "EVP_PKEY *key" .Fc +.Ft EVP_PKEY * +.Fo EVP_PKEY_new_mac_key +.Fa "int type" +.Fa "ENGINE *e" +.Fa "const unsigned char *key" +.Fa "int keylen" +.Fc .Sh DESCRIPTION The .Vt EVP_PKEY @@ -74,28 +89,76 @@ The function allocates an empty .Vt EVP_PKEY structure. -To add a private key to it, use the functions described in +The reference count is set to 1. +To add a private or public key to it, use the functions described in .Xr EVP_PKEY_set1_RSA 3 . .Pp +.Fn EVP_PKEY_up_ref +increments the reference count of +.Fa key +by 1. +.Pp .Fn EVP_PKEY_free -frees up the private key -.Fa key . +decrements the reference count of +.Fa key +by 1, and if the reference count reaches zero, frees it up. If .Fa key is a .Dv NULL pointer, no action occurs. +.Pp +.Fn EVP_PKEY_new_mac_key +allocates a new +.Vt EVP_PKEY . +If +.Fa e +is +.Pf non- Dv NULL , +then the new +.Vt EVP_PKEY +structure is associated with the engine +.Fa e . +The +.Fa type +argument indicates what kind of key this is. +The value should be a NID for a public key algorithm that supports +raw private keys, for example +.Dv EVP_PKEY_HMAC . +.Fa key +points to the raw private key data for this +.Vt EVP_PKEY +which should be of length +.Fa keylen . +The length should be appropriate for the type of the key. +The public key data will be automatically derived from the given +private key data (if appropriate for the algorithm type). .Sh RETURN VALUES .Fn EVP_PKEY_new -returns either the newly allocated +and +.Fn EVP_PKEY_new_mac_key +return either the newly allocated .Vt EVP_PKEY structure or .Dv NULL if an error occurred. +.Pp +.Fn EVP_PKEY_up_ref +returns 1 for success or 0 for failure. .Sh SEE ALSO +.Xr EVP_PKEY_asn1_set_free 3 , .Xr EVP_PKEY_set1_RSA 3 .Sh HISTORY .Fn EVP_PKEY_new and .Fn EVP_PKEY_free -exist in all versions of OpenSSL. +first appeared in SSLeay 0.6.0 and have been available since +.Ox 2.4 . +.Pp +.Fn EVP_PKEY_new_mac_key +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . +.Pp +.Fn EVP_PKEY_up_ref +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/EVP_PKEY_print_private.3 b/man/EVP_PKEY_print_private.3 index a5e4879f..48e0c55e 100644 --- a/man/EVP_PKEY_print_private.3 +++ b/man/EVP_PKEY_print_private.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_PKEY_print_private.3,v 1.4 2016/11/27 15:27:19 schwarze Exp $ +.\" $OpenBSD: EVP_PKEY_print_private.3,v 1.6 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 27 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_PRINT_PRIVATE 3 .Os .Sh NAME @@ -120,7 +120,10 @@ failure. In particular, a return value of -2 indicates the operation is not supported by the public key algorithm. .Sh SEE ALSO +.Xr EVP_PKEY_asn1_set_public 3 , .Xr EVP_PKEY_CTX_new 3 , .Xr EVP_PKEY_keygen 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.0. +These functions first appeared in OpenSSL 1.0.0 +and have been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_set1_RSA.3 b/man/EVP_PKEY_set1_RSA.3 index 851184ae..948bec4f 100644 --- a/man/EVP_PKEY_set1_RSA.3 +++ b/man/EVP_PKEY_set1_RSA.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.5 2016/12/11 12:21:48 schwarze Exp $ -.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.15 2019/03/18 04:01:53 schwarze Exp $ +.\" full merge up to: OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 +.\" selective merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2002, 2014, 2016 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2002, 2015, 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 @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 18 2019 $ .Dt EVP_PKEY_SET1_RSA 3 .Os .Sh NAME @@ -60,12 +61,17 @@ .Nm EVP_PKEY_get1_DSA , .Nm EVP_PKEY_get1_DH , .Nm EVP_PKEY_get1_EC_KEY , +.Nm EVP_PKEY_get0_RSA , +.Nm EVP_PKEY_get0_DSA , +.Nm EVP_PKEY_get0_DH , +.Nm EVP_PKEY_get0_EC_KEY , +.Nm EVP_PKEY_get0_hmac , .Nm EVP_PKEY_assign_RSA , .Nm EVP_PKEY_assign_DSA , .Nm EVP_PKEY_assign_DH , .Nm EVP_PKEY_assign_EC_KEY , -.Nm EVP_PKEY_id , .Nm EVP_PKEY_base_id , +.Nm EVP_PKEY_id , .Nm EVP_PKEY_type .Nd EVP_PKEY assignment functions .Sh SYNOPSIS @@ -106,6 +112,27 @@ .Fo EVP_PKEY_get1_EC_KEY .Fa "EVP_PKEY *pkey" .Fc +.Ft RSA * +.Fo EVP_PKEY_get0_RSA +.Fa "EVP_PKEY *pkey" +.Fc +.Ft DSA * +.Fo EVP_PKEY_get0_DSA +.Fa "EVP_PKEY *pkey" +.Fc +.Ft DH * +.Fo EVP_PKEY_get0_DH +.Fa "EVP_PKEY *pkey" +.Fc +.Ft EC_KEY * +.Fo EVP_PKEY_get0_EC_KEY +.Fa "EVP_PKEY *pkey" +.Fc +.Ft const unsigned char * +.Fo EVP_PKEY_get0_hmac +.Fa "const EVP_PKEY *pkey" +.Fa "size_t *len" +.Fc .Ft int .Fo EVP_PKEY_assign_RSA .Fa "EVP_PKEY *pkey" @@ -127,11 +154,11 @@ .Fa "EC_KEY *key" .Fc .Ft int -.Fo EVP_PKEY_id +.Fo EVP_PKEY_base_id .Fa "EVP_PKEY *pkey" .Fc .Ft int -.Fo EVP_PKEY_base_id +.Fo EVP_PKEY_id .Fa "EVP_PKEY *pkey" .Fc .Ft int @@ -155,11 +182,34 @@ to and .Fn EVP_PKEY_get1_EC_KEY return the key referenced in -.Fa pkey -or +.Fa pkey , +incrementing its reference count by 1, or .Dv NULL if the key is not of the correct type. .Pp +.Fn EVP_PKEY_get0_RSA , +.Fn EVP_PKEY_get0_DSA , +.Fn EVP_PKEY_get0_DH , +and +.Fn EVP_PKEY_get0_EC_KEY +are identical except that they do not increment the reference count. +Consequently, the returned key must not be freed by the caller. +.Pp +.Fn EVP_PKEY_get0_hmac +returns an internal pointer to the key referenced in +.Fa pkey +and sets +.Pf * Fa len +to its length in bytes. +The returned pointer must not be freed by the caller. +If +.Fa pkey +is not of the correct type, +.Dv NULL +is returned and the content of +.Pf * Fa len +becomes unspecified. +.Pp .Fn EVP_PKEY_assign_RSA , .Fn EVP_PKEY_assign_DSA , .Fn EVP_PKEY_assign_DH , @@ -235,8 +285,13 @@ return 1 for success or 0 for failure. .Fn EVP_PKEY_get1_RSA , .Fn EVP_PKEY_get1_DSA , .Fn EVP_PKEY_get1_DH , +.Fn EVP_PKEY_get1_EC_KEY , +.Fn EVP_PKEY_get0_RSA , +.Fn EVP_PKEY_get0_DSA , +.Fn EVP_PKEY_get0_DH , +.Fn EVP_PKEY_get0_EC_KEY , and -.Fn EVP_PKEY_get1_EC_KEY +.Fn EVP_PKEY_get0_hmac return the referenced key or .Dv NULL if an error occurred. @@ -258,5 +313,52 @@ return a key type or .Dv EVP_PKEY_NONE ) on error. .Sh SEE ALSO +.Xr DH_new 3 , +.Xr DSA_new 3 , +.Xr EC_KEY_new 3 , +.Xr EVP_PKEY_get0_asn1 3 , .Xr EVP_PKEY_new 3 , .Xr RSA_new 3 +.Sh HISTORY +.Fn EVP_PKEY_assign_RSA , +.Fn EVP_PKEY_assign_DSA , +.Fn EVP_PKEY_assign_DH , +and +.Fn EVP_PKEY_type +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn EVP_PKEY_set1_RSA , +.Fn EVP_PKEY_set1_DSA , +.Fn EVP_PKEY_set1_DH , +.Fn EVP_PKEY_get1_RSA , +.Fn EVP_PKEY_get1_DSA , +and +.Fn EVP_PKEY_get1_DH +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn EVP_PKEY_set1_EC_KEY , +.Fn EVP_PKEY_get1_EC_KEY , +and +.Fn EVP_PKEY_assign_EC_KEY +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Pp +.Fn EVP_PKEY_id +and +.Fn EVP_PKEY_base_id +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . +.Pp +.Fn EVP_PKEY_get0_RSA , +.Fn EVP_PKEY_get0_DSA , +.Fn EVP_PKEY_get0_DH , +and +.Fn EVP_PKEY_get0_EC_KEY +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . +.Pp +.Fn EVP_PKEY_get0_hmac +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.5 . diff --git a/man/EVP_PKEY_sign.3 b/man/EVP_PKEY_sign.3 index d7812186..efbea950 100644 --- a/man/EVP_PKEY_sign.3 +++ b/man/EVP_PKEY_sign.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_PKEY_sign.3,v 1.5 2017/01/06 02:43:14 schwarze Exp $ +.\" $OpenBSD: EVP_PKEY_sign.3,v 1.7 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_SIGN 3 .Os .Sh NAME @@ -180,7 +180,12 @@ if (EVP_PKEY_sign(ctx, sig, &siglen, md, mdlen) <= 0) .Xr EVP_PKEY_decrypt 3 , .Xr EVP_PKEY_derive 3 , .Xr EVP_PKEY_encrypt 3 , +.Xr EVP_PKEY_meth_set_sign 3 , .Xr EVP_PKEY_verify 3 , .Xr EVP_PKEY_verify_recover 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.0. +.Fn EVP_PKEY_sign_init +and +.Fn EVP_PKEY_sign +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_verify.3 b/man/EVP_PKEY_verify.3 index b1739b2f..c4d98332 100644 --- a/man/EVP_PKEY_verify.3 +++ b/man/EVP_PKEY_verify.3 @@ -1,8 +1,8 @@ -.\" $OpenBSD: EVP_PKEY_verify.3,v 1.4 2016/11/27 15:27:19 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: EVP_PKEY_verify.3,v 1.7 2018/03/23 04:34:23 schwarze Exp $ +.\" full merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2006, 2009, 2010, 2013 The OpenSSL Project. +.\" Copyright (c) 2006, 2009, 2010, 2013, 2018 The OpenSSL Project. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 27 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_VERIFY 3 .Os .Sh NAME @@ -129,10 +129,12 @@ EVP_PKEY_CTX *ctx; unsigned char *md, *sig; size_t mdlen, siglen; EVP_PKEY *verify_key; -/* NB: assumes verify_key, sig, siglen md and mdlen are already set up - * and that verify_key is an RSA public key + +/* + * Assumes that verify_key, sig, siglen, md, and mdlen are already set up + * and that verify_key is an RSA public key. */ -ctx = EVP_PKEY_CTX_new(verify_key); +ctx = EVP_PKEY_CTX_new(verify_key, NULL); if (!ctx) /* Error occurred */ if (EVP_PKEY_verify_init(ctx) <= 0) @@ -145,8 +147,9 @@ if (EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()) <= 0) /* Perform operation */ ret = EVP_PKEY_verify(ctx, sig, siglen, md, mdlen); -/* ret == 1 indicates success, 0 verify failure and < 0 for some - * other error. +/* + * ret == 1 indicates success, 0 verify failure, + * and < 0 some other error. */ .Ed .Sh SEE ALSO @@ -154,7 +157,12 @@ ret = EVP_PKEY_verify(ctx, sig, siglen, md, mdlen); .Xr EVP_PKEY_decrypt 3 , .Xr EVP_PKEY_derive 3 , .Xr EVP_PKEY_encrypt 3 , +.Xr EVP_PKEY_meth_set_verify 3 , .Xr EVP_PKEY_sign 3 , .Xr EVP_PKEY_verify_recover 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.0. +.Fn EVP_PKEY_verify_init +and +.Fn EVP_PKEY_verify +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/EVP_PKEY_verify_recover.3 b/man/EVP_PKEY_verify_recover.3 index ae3eb0ef..3a55facc 100644 --- a/man/EVP_PKEY_verify_recover.3 +++ b/man/EVP_PKEY_verify_recover.3 @@ -1,8 +1,8 @@ -.\" $OpenBSD: EVP_PKEY_verify_recover.3,v 1.6 2017/01/06 02:43:14 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: EVP_PKEY_verify_recover.3,v 1.9 2018/03/23 04:34:23 schwarze Exp $ +.\" full merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2006, 2009, 2010, 2013 The OpenSSL Project. +.\" Copyright (c) 2006, 2009, 2010, 2013, 2018 The OpenSSL Project. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt EVP_PKEY_VERIFY_RECOVER 3 .Os .Sh NAME @@ -144,10 +144,12 @@ EVP_PKEY_CTX *ctx; unsigned char *rout, *sig; size_t routlen, siglen; EVP_PKEY *verify_key; -/* NB: assumes verify_key, sig and siglen are already set up - * and that verify_key is an RSA public key + +/* + * Assumes that verify_key, sig, and siglen are already set up + * and that verify_key is an RSA public key. */ -ctx = EVP_PKEY_CTX_new(verify_key); +ctx = EVP_PKEY_CTX_new(verify_key, NULL); if (!ctx) /* Error occurred */ if (EVP_PKEY_verify_recover_init(ctx) <= 0) @@ -176,7 +178,12 @@ if (EVP_PKEY_verify_recover(ctx, rout, &routlen, sig, siglen) <= 0) .Xr EVP_PKEY_decrypt 3 , .Xr EVP_PKEY_derive 3 , .Xr EVP_PKEY_encrypt 3 , +.Xr EVP_PKEY_meth_set_verify_recover 3 , .Xr EVP_PKEY_sign 3 , .Xr EVP_PKEY_verify 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.0. +.Fn EVP_PKEY_verify_recover_init +and +.Fn EVP_PKEY_verify_recover +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/EVP_SealInit.3 b/man/EVP_SealInit.3 index bbd1add7..11db2294 100644 --- a/man/EVP_SealInit.3 +++ b/man/EVP_SealInit.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_SealInit.3,v 1.5 2016/11/26 20:55:26 schwarze Exp $ +.\" $OpenBSD: EVP_SealInit.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 26 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt EVP_SEALINIT 3 .Os .Sh NAME @@ -178,5 +178,12 @@ return 1 for success and 0 for failure. .Xr EVP_OpenInit 3 , .Xr RAND_bytes 3 .Sh HISTORY +.Fn EVP_SealInit , +.Fn EVP_SealUpdate , +and +.Fn EVP_SealFinal +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp .Fn EVP_SealFinal did not return a value before OpenSSL 0.9.7. diff --git a/man/EVP_SignInit.3 b/man/EVP_SignInit.3 index 1751ca59..d9e62972 100644 --- a/man/EVP_SignInit.3 +++ b/man/EVP_SignInit.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: EVP_SignInit.3,v 1.4 2016/11/26 20:55:26 schwarze Exp $ -.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" $OpenBSD: EVP_SignInit.3,v 1.12 2018/12/23 08:35:14 tb Exp $ +.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" selective merge up to: OpenSSL 79b49fb0 Mar 20 10:03:10 2018 +1000 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2000-2002, 2005, 2006, 2014-2016 The OpenSSL Project. @@ -49,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 26 2016 $ +.Dd $Mdocdate: December 23 2018 $ .Dt EVP_SIGNINIT 3 .Os .Sh NAME @@ -57,7 +58,8 @@ .Nm EVP_SignUpdate , .Nm EVP_SignFinal , .Nm EVP_SignInit , -.Nm EVP_PKEY_size +.Nm EVP_PKEY_size , +.Nm EVP_PKEY_bits .Nd EVP signing functions .Sh SYNOPSIS .In openssl/evp.h @@ -87,7 +89,11 @@ .Fc .Ft int .Fo EVP_PKEY_size -.Fa "EVP_PKEY *pkey" +.Fa "const EVP_PKEY *pkey" +.Fc +.Ft int +.Fo EVP_PKEY_bits +.Fa "const EVP_PKEY *pkey" .Fc .Sh DESCRIPTION The EVP signature routines are a high level interface to digital @@ -154,11 +160,6 @@ used in preference to the low level interfaces. This is because the code then becomes transparent to the algorithm used and much more flexible. .Pp -Due to the link between message digests and public key algorithms the -correct digest algorithm must be used with the correct public key type. -A list of algorithms and associated public key algorithms appears in -.Xr EVP_DigestInit 3 . -.Pp The call to .Fn EVP_SignFinal internally finalizes a copy of the digest context. @@ -170,7 +171,7 @@ can be called later to digest and sign additional data. .Pp Since only a copy of the digest context is ever finalized, the context must be cleaned up after use by calling -.Xr EVP_MD_CTX_cleanup 3 +.Xr EVP_MD_CTX_free 3 or a memory leak will occur. .Sh RETURN VALUES .Fn EVP_SignInit_ex , @@ -182,22 +183,34 @@ return 1 for success and 0 for failure. .Fn EVP_PKEY_size returns the maximum size of a signature in bytes. .Pp +.Fn EVP_PKEY_bits +returns the number of significant bits in the key +or 0 if an error occurs. +.Pp The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr ERR 3 , .Xr evp 3 , .Xr EVP_DigestInit 3 , +.Xr EVP_PKEY_asn1_set_public 3 , .Xr EVP_VerifyInit 3 .Sh HISTORY .Fn EVP_SignInit , .Fn EVP_SignUpdate , and .Fn EVP_SignFinal -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1. +.Fn EVP_PKEY_size +first appeared in SSLeay 0.6.0. +.Fn EVP_PKEY_bits +first appeared in SSLeay 0.9.0. +These functions have been available since +.Ox 2.4 . .Pp .Fn EVP_SignInit_ex -was added in OpenSSL 0.9.7. +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . .Sh BUGS Older versions of this documentation wrongly stated that calls to .Fn EVP_SignUpdate diff --git a/man/EVP_VerifyInit.3 b/man/EVP_VerifyInit.3 index 2f8a7a1b..899bbc04 100644 --- a/man/EVP_VerifyInit.3 +++ b/man/EVP_VerifyInit.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: EVP_VerifyInit.3,v 1.4 2016/11/26 20:55:26 schwarze Exp $ -.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" $OpenBSD: EVP_VerifyInit.3,v 1.9 2018/12/23 08:35:14 tb Exp $ +.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" selective merge up to: OpenSSL 79b49fb0 Mar 20 10:03:10 2018 +1000 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2000, 2001, 2006, 2016 The OpenSSL Project. @@ -49,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 26 2016 $ +.Dd $Mdocdate: December 23 2018 $ .Dt EVP_VERIFYINIT 3 .Os .Sh NAME @@ -133,11 +134,6 @@ used in preference to the low level interfaces. This is because the code then becomes transparent to the algorithm used and much more flexible. .Pp -Due to the link between message digests and public key algorithms, the -correct digest algorithm must be used with the correct public key type. -A list of algorithms and associated public key algorithms appears in -.Xr EVP_DigestInit 3 . -.Pp The call to .Fn EVP_VerifyFinal internally finalizes a copy of the digest context. @@ -149,7 +145,7 @@ can be called later to digest and verify additional data. .Pp Since only a copy of the digest context is ever finalized, the context must be cleaned up after use by calling -.Xr EVP_MD_CTX_cleanup 3 , +.Xr EVP_MD_CTX_free 3 , or a memory leak will occur. .Sh RETURN VALUES .Fn EVP_VerifyInit_ex @@ -173,10 +169,12 @@ The error codes can be obtained by .Fn EVP_VerifyUpdate , and .Fn EVP_VerifyFinal -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . .Pp .Fn EVP_VerifyInit_ex -was added in OpenSSL 0.9.7. +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . .Sh BUGS Older versions of this documentation wrongly stated that calls to .Fn EVP_VerifyUpdate diff --git a/man/EVP_aes_128_cbc.3 b/man/EVP_aes_128_cbc.3 new file mode 100644 index 00000000..be8e5ff7 --- /dev/null +++ b/man/EVP_aes_128_cbc.3 @@ -0,0 +1,336 @@ +.\" $OpenBSD: EVP_aes_128_cbc.3,v 1.2 2019/03/19 19:50:03 schwarze Exp $ +.\" selective merge up to: OpenSSL 7c6d372a Nov 20 13:20:01 2018 +0000 +.\" +.\" This file was written by Ronald Tse +.\" Copyright (c) 2017 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. +.\" +.Dd $Mdocdate: March 19 2019 $ +.Dt EVP_AES_128_CBC 3 +.Os +.Sh NAME +.Nm EVP_aes_128_cbc , +.Nm EVP_aes_192_cbc , +.Nm EVP_aes_256_cbc , +.Nm EVP_aes_128_cfb1 , +.Nm EVP_aes_192_cfb1 , +.Nm EVP_aes_256_cfb1 , +.Nm EVP_aes_128_cfb8 , +.Nm EVP_aes_192_cfb8 , +.Nm EVP_aes_256_cfb8 , +.Nm EVP_aes_128_cfb128 , +.Nm EVP_aes_192_cfb128 , +.Nm EVP_aes_256_cfb128 , +.Nm EVP_aes_128_cfb , +.Nm EVP_aes_192_cfb , +.Nm EVP_aes_256_cfb , +.Nm EVP_aes_128_ctr , +.Nm EVP_aes_192_ctr , +.Nm EVP_aes_256_ctr , +.Nm EVP_aes_128_ecb , +.Nm EVP_aes_192_ecb , +.Nm EVP_aes_256_ecb , +.Nm EVP_aes_128_ofb , +.Nm EVP_aes_192_ofb , +.Nm EVP_aes_256_ofb , +.Nm EVP_aes_128_cbc_hmac_sha1 , +.Nm EVP_aes_256_cbc_hmac_sha1 , +.Nm EVP_aes_128_ccm , +.Nm EVP_aes_192_ccm , +.Nm EVP_aes_256_ccm , +.Nm EVP_aes_128_gcm , +.Nm EVP_aes_192_gcm , +.Nm EVP_aes_256_gcm , +.Nm EVP_aes_128_wrap , +.Nm EVP_aes_192_wrap , +.Nm EVP_aes_256_wrap , +.Nm EVP_aes_128_xts , +.Nm EVP_aes_256_xts +.Nd EVP AES cipher +.Sh SYNOPSIS +.In openssl/evp.h +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_cbc void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_cbc void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_cbc void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_cfb1 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_cfb1 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_cfb1 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_cfb8 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_cfb8 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_cfb8 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_cfb128 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_cfb128 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_cfb128 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_cfb void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_cfb void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_cfb void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_ctr void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_ctr void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_ctr void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_ecb void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_ecb void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_ecb void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_ofb void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_ofb void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_ofb void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_cbc_hmac_sha1 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_cbc_hmac_sha1 void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_ccm void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_ccm void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_ccm void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_gcm void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_gcm void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_gcm void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_wrap void +.Ft const EVP_CIPHER * +.Fn EVP_aes_192_wrap void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_wrap void +.Ft const EVP_CIPHER * +.Fn EVP_aes_128_xts void +.Ft const EVP_CIPHER * +.Fn EVP_aes_256_xts void +.Sh DESCRIPTION +These functions provide the AES encryption algorithm in the +.Xr evp 3 +framework. +.Pp +.Fn EVP_aes_128_cbc , +.Fn EVP_aes_192_cbc , +.Fn EVP_aes_256_cbc , +.Fn EVP_aes_128_cfb1 , +.Fn EVP_aes_192_cfb1 , +.Fn EVP_aes_256_cfb1 , +.Fn EVP_aes_128_cfb8 , +.Fn EVP_aes_192_cfb8 , +.Fn EVP_aes_256_cfb8 , +.Fn EVP_aes_128_cfb128 , +.Fn EVP_aes_192_cfb128 , +.Fn EVP_aes_256_cfb128 , +.Fn EVP_aes_128_ctr , +.Fn EVP_aes_192_ctr , +.Fn EVP_aes_256_ctr , +.Fn EVP_aes_128_ecb , +.Fn EVP_aes_192_ecb , +.Fn EVP_aes_256_ecb , +.Fn EVP_aes_128_ofb , +.Fn EVP_aes_192_ofb , +and +.Fn EVP_aes_256_ofb +provide AES for 128, 192, and 256 bit keys in the following modes: +CBC, CFB with 1-bit shift, CFB with 8-bit shift, CFB with 128-bit shift, +CTR, ECB, and OFB. +.Pp +.Fn EVP_aes_128_cfb , +.Fn EVP_aes_192_cfb , +and +.Fn EVP_aes_256_cfb +are aliases for +.Fn EVP_aes_128_cfb128 , +.Fn EVP_aes_192_cfb128 , +and +.Fn EVP_aes_256_cfb128 . +.Pp +.Fn EVP_aes_128_cbc_hmac_sha1 +and +.Fn EVP_aes_256_cbc_hmac_sha1 +provide authenticated encryption with AES in CBC mode using SHA-1 as HMAC, +with keys of 128 and 256 bits length respectively. +The authentication tag is 160 bits long. +This is not intended for usage outside of TLS and requires +calling of some undocumented control functions. +These ciphers do not conform to the EVP AEAD interface. +.Pp +.Fn EVP_aes_128_ccm , +.Fn EVP_aes_192_ccm , +.Fn EVP_aes_256_ccm , +.Fn EVP_aes_128_gcm , +.Fn EVP_aes_192_gcm , +and +.Fn EVP_aes_256_gcm +provide AES for 128, 192 and 256 bit keys in CBC-MAC Mode (CCM) +and Galois Counter Mode (GCM), respectively. +These ciphers require additional control operations to function +correctly; see +.Xr EVP_EncryptInit 3 +for details. +.Pp +.Fn EVP_aes_128_wrap , +.Fn EVP_aes_192_wrap , +and +.Fn EVP_aes_256_wrap +provide AES key wrap with 128, 192 and 256 bit keys +according to RFC 3394 section 2.2.1 ("wrap"). +When the returned +.Vt EVP_CIPHER +object is later passed to +.Xr EVP_CipherInit_ex 3 , +.Xr EVP_EncryptInit_ex 3 , +or +.Xr EVP_DecryptInit_ex 3 +together with an +.Vt EVP_CIPHER_CTX +object, the flag +.Dv EVP_CIPHER_CTX_FLAG_WRAP_ALLOW +must have been set in the +.Vt EVP_CIPHER_CTX +using +.Xr EVP_CIPHER_CTX_set_flags 3 . +Otherwise, or when passing the returned +.Vt EVP_CIPHER +object to +.Xr EVP_CipherInit 3 , +.Xr EVP_EncryptInit 3 , +or +.Xr EVP_DecryptInit 3 , +initialization fails with a +.Dq wrap not allowed +error. +.Pp +.Fn EVP_aes_128_xts +and +.Fn EVP_aes_256_xts +provide XEX-based tweaked-codebook mode with ciphertext stealing (XTS-AES) +as specified in IEEE Std. 1619-2007 and described in NIST SP 800-38E. +It was designed for encrypting data on a storage device, +provides confidentiality but not authentication of data, +and requires a key of double length for protection of a certain key size. +In particular, XTS-AES-128 takes input of a 256-bit key to achieve +AES 128-bit security, and XTS-AES-256 takes input of a 512-bit key +to achieve AES 256-bit security. +.Sh RETURN VALUES +These functions return an +.Vt EVP_CIPHER +structure that provides the implementation of the symmetric cipher. +.Sh SEE ALSO +.Xr evp 3 , +.Xr EVP_EncryptInit 3 +.Sh HISTORY +.Fn EVP_aes_128_cbc , +.Fn EVP_aes_192_cbc , +.Fn EVP_aes_256_cbc , +.Fn EVP_aes_128_cfb , +.Fn EVP_aes_192_cfb , +.Fn EVP_aes_256_cfb , +.Fn EVP_aes_128_ebc , +.Fn EVP_aes_192_ebc , +.Fn EVP_aes_256_ebc , +.Fn EVP_aes_128_ofb , +.Fn EVP_aes_192_ofb , +and +.Fn EVP_aes_256_ofb +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn EVP_aes_128_cfb1 , +.Fn EVP_aes_192_cfb1 , +.Fn EVP_aes_256_cfb1 , +.Fn EVP_aes_128_cfb8 , +.Fn EVP_aes_192_cfb8 , +.Fn EVP_aes_256_cfb8 , +.Fn EVP_aes_128_cfb128 , +.Fn EVP_aes_192_cfb128 , +and +.Fn EVP_aes_256_cfb128 +first appeared in OpenSSL 0.9.7e and have been available since +.Ox 3.8 . +.Pp +.Fn EVP_aes_128_ctr , +.Fn EVP_aes_192_ctr , +.Fn EVP_aes_256_ctr , +.Fn EVP_aes_128_cbc_hmac_sha1 , +.Fn EVP_aes_256_cbc_hmac_sha1 , +.Fn EVP_aes_128_ccm , +.Fn EVP_aes_192_ccm , +.Fn EVP_aes_256_ccm , +.Fn EVP_aes_128_gcm , +.Fn EVP_aes_192_gcm , +.Fn EVP_aes_256_gcm , +.Fn EVP_aes_128_xts , +and +.Fn EVP_aes_256_xts +first appeared in OpenSSL 1.0.1 and have been available since +.Ox 5.3 . +.Pp +.Fn EVP_aes_128_wrap , +.Fn EVP_aes_192_wrap , +and +.Fn EVP_aes_256_wrap +first appeared in OpenSSL 1.0.2 and have been available since +.Ox 6.5 . diff --git a/man/EVP_camellia_128_cbc.3 b/man/EVP_camellia_128_cbc.3 new file mode 100644 index 00000000..dd7f15d8 --- /dev/null +++ b/man/EVP_camellia_128_cbc.3 @@ -0,0 +1,149 @@ +.\" $OpenBSD: EVP_camellia_128_cbc.3,v 1.1 2019/03/21 14:15:13 schwarze Exp $ +.\" selective merge up to: OpenSSL 7c6d372a Nov 20 13:20:01 2018 +0000 +.\" +.\" This file was written by Ronald Tse +.\" Copyright (c) 2017 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. +.\" +.Dd $Mdocdate: March 21 2019 $ +.Dt EVP_CAMELLIA_128_CBC 3 +.Os +.Sh NAME +.Nm EVP_camellia_128_cbc , +.Nm EVP_camellia_192_cbc , +.Nm EVP_camellia_256_cbc , +.Nm EVP_camellia_128_cfb , +.Nm EVP_camellia_192_cfb , +.Nm EVP_camellia_256_cfb , +.Nm EVP_camellia_128_cfb1 , +.Nm EVP_camellia_192_cfb1 , +.Nm EVP_camellia_256_cfb1 , +.Nm EVP_camellia_128_cfb8 , +.Nm EVP_camellia_192_cfb8 , +.Nm EVP_camellia_256_cfb8 , +.Nm EVP_camellia_128_cfb128 , +.Nm EVP_camellia_192_cfb128 , +.Nm EVP_camellia_256_cfb128 , +.Nm EVP_camellia_128_ecb , +.Nm EVP_camellia_192_ecb , +.Nm EVP_camellia_256_ecb , +.Nm EVP_camellia_128_ofb , +.Nm EVP_camellia_192_ofb , +.Nm EVP_camellia_256_ofb +.Nd EVP Camellia cipher +.Sh SYNOPSIS +.In openssl/evp.h +.Ft const EVP_CIPHER * +.Fn EVP_camellia_128_cbc void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_192_cbc void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_256_cbc void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_128_cfb void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_192_cfb void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_256_cfb void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_128_cfb1 void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_192_cfb1 void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_256_cfb1 void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_128_cfb8 void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_192_cfb8 void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_256_cfb8 void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_128_cfb128 void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_192_cfb128 void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_256_cfb128 void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_128_ecb void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_192_ecb void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_256_ecb void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_128_ofb void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_192_ofb void +.Ft const EVP_CIPHER * +.Fn EVP_camellia_256_ofb void +.Sh DESCRIPTION +These functions provide the Camellia encryption algorithm in the +.Xr evp 3 +framework. +They use 128, 192, and 256 bit keys in the following modes, respectively: +CBC, CFB with 1-bit shift, CFB with 8-bit shift, CFB with 128-bit shift, +ECB, and OFB. +.Pp +.Fn EVP_camellia_128_cfb , +.Fn EVP_camellia_192_cfb , +and +.Fn EVP_camellia_256_cfb +are aliases for +.Fn EVP_camellia_128_cfb128 , +.Fn EVP_camellia_192_cfb128 , +and +.Fn EVP_camellia_256_cfb128 , +implemented as macros. +.Sh RETURN VALUES +These functions return an +.Vt EVP_CIPHER +structure that provides the implementation of the symmetric cipher. +.Sh SEE ALSO +.Xr evp 3 , +.Xr EVP_EncryptInit 3 +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.8c +and have been available since +.Ox 4.5 . diff --git a/man/EVP_des_cbc.3 b/man/EVP_des_cbc.3 new file mode 100644 index 00000000..759e03fa --- /dev/null +++ b/man/EVP_des_cbc.3 @@ -0,0 +1,221 @@ +.\" $OpenBSD: EVP_des_cbc.3,v 1.1 2019/03/21 12:54:37 schwarze Exp $ +.\" full merge up to: +.\" OpenSSL EVP_desx_cbc.pod 8fa4d95e Oct 21 11:59:09 2017 +0900 +.\" selective merge up to: +.\" OpenSSL EVP_des.pod 7c6d372a Nov 20 13:20:01 2018 +0000 +.\" +.\" This file was written by Ronald Tse +.\" Copyright (c) 2017 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. +.\" +.Dd $Mdocdate: March 21 2019 $ +.Dt EVP_DES_CBC 3 +.Os +.Sh NAME +.Nm EVP_des_cbc , +.Nm EVP_des_cfb , +.Nm EVP_des_cfb1 , +.Nm EVP_des_cfb8 , +.Nm EVP_des_cfb64 , +.Nm EVP_des_ecb , +.Nm EVP_des_ofb , +.Nm EVP_des_ede , +.Nm EVP_des_ede_cbc , +.Nm EVP_des_ede_cfb , +.Nm EVP_des_ede_cfb64 , +.Nm EVP_des_ede_ecb , +.Nm EVP_des_ede_ofb , +.Nm EVP_des_ede3 , +.Nm EVP_des_ede3_cbc , +.Nm EVP_des_ede3_cfb , +.Nm EVP_des_ede3_cfb1 , +.Nm EVP_des_ede3_cfb8 , +.Nm EVP_des_ede3_cfb64 , +.Nm EVP_des_ede3_ecb , +.Nm EVP_des_ede3_ofb , +.Nm EVP_desx_cbc +.Nd EVP DES cipher +.Sh SYNOPSIS +.In openssl/evp.h +.Ft const EVP_CIPHER * +.Fn EVP_des_cbc void +.Ft const EVP_CIPHER * +.Fn EVP_des_cfb void +.Ft const EVP_CIPHER * +.Fn EVP_des_cfb1 void +.Ft const EVP_CIPHER * +.Fn EVP_des_cfb8 void +.Ft const EVP_CIPHER * +.Fn EVP_des_cfb64 void +.Ft const EVP_CIPHER * +.Fn EVP_des_ecb void +.Ft const EVP_CIPHER * +.Fn EVP_des_ofb void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede_cbc void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede_cfb void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede_cfb64 void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede_ecb void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede_ofb void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede3 void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede3_cbc void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede3_cfb void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede3_cfb1 void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede3_cfb8 void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede3_cfb64 void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede3_ecb void +.Ft const EVP_CIPHER * +.Fn EVP_des_ede3_ofb void +.Ft const EVP_CIPHER * +.Fn EVP_desx_cbc void +.Sh DESCRIPTION +These functions provide the DES encryption algorithm in the +.Xr evp 3 +framework. +.Pp +.Fn EVP_des_cbc , +.Fn EVP_des_cfb1 , +.Fn EVP_des_cfb8 , +.Fn EVP_des_cfb64 , +.Fn EVP_des_ecb , +and +.Fn EVP_des_ofb +provide DES in CBC, CFB with 1-bit shift, CFB with 8-bit shift, +CFB with 64-bit shift, ECB, and OFB modes. +.Fn EVP_des_cfb +is an alias for +.Fn EVP_des_cfb64 , +implemented as a macro. +.Pp +.Fn EVP_des_ede_cbc , +.Fn EVP_des_ede_cfb64 , +.Fn EVP_des_ede_ecb , +and +.Fn EVP_des_ede_ofb +provide two key triple DES in CBC, CFB with 64-bit shift, ECB, and OFB modes. +.Fn EVP_des_ede_cfb +is an alias for +.Fn EVP_des_ede_cfb64 , +implemented as a macro. +.Fn EVP_des_ede +is an alias for +.Fn EVP_des_ede_ecb . +.Pp +.Fn EVP_des_ede3_cbc , +.Fn EVP_des_ede3_cfb1 , +.Fn EVP_des_ede3_cfb8 , +.Fn EVP_des_ede3_cfb64 , +.Fn EVP_des_ede3_ecb , +.Fn EVP_des_ede3_ofb +provide three key triple DES in CBC, CFB with 1-bit shift, CFB with 8-bit +shift, CFB with 64-bit shift, ECB, and OFB modes. +.Fn EVP_des_ede3_cfb +is an alias for +.Fn EVP_des_ede3_cfb64 , +implemented as a macro. +.Fn EVP_des_ede3 +is an alias for +.Fn EVP_des_ede3_ecb . +.Pp +.Fn EVP_desx_cbc +provides the DES-X encryption algorithm in CBC mode. +It uses a key length of 128 bits and acts on blocks of 128 bits. +.Sh RETURN VALUES +These functions return an +.Vt EVP_CIPHER +structure that provides the implementation of the symmetric cipher. +.Sh SEE ALSO +.Xr evp 3 , +.Xr EVP_EncryptInit 3 +.Sh HISTORY +.Fn EVP_des_cbc , +.Fn EVP_des_cfb , +.Fn EVP_des_ecb , +.Fn EVP_des_ofb , +.Fn EVP_des_ede , +.Fn EVP_des_ede_cbc , +.Fn EVP_des_ede_cfb , +.Fn EVP_des_ede_ofb , +.Fn EVP_des_ede3 , +.Fn EVP_des_ede3_cbc , +.Fn EVP_des_ede3_cfb , +and +.Fn EVP_des_ede3_ofb +first appeared in SSLeay 0.5.1. +.Fn EVP_desx_cbc +first appeared in SSLeay 0.6.2. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn EVP_des_ede_ecb +and +.Fn EVP_des_ede3_ecb +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn EVP_des_cfb1 , +.Fn EVP_des_cfb8 , +.Fn EVP_des_cfb64 , +.Fn EVP_des_ede_cfb64 , +.Fn EVP_des_ede3_cfb1 , +.Fn EVP_des_ede3_cfb8 , +and +.Fn EVP_des_ede3_cfb64 +first appeared in OpenSSL 0.9.7e and have been available since +.Ox 3.8 . diff --git a/man/EVP_rc4.3 b/man/EVP_rc4.3 new file mode 100644 index 00000000..fda04111 --- /dev/null +++ b/man/EVP_rc4.3 @@ -0,0 +1,109 @@ +.\" $OpenBSD: EVP_rc4.3,v 1.1 2019/03/21 13:37:25 schwarze Exp $ +.\" full merge up to: OpenSSL 8fa4d95e Oct 21 11:59:09 2017 +0900 +.\" +.\" This file was written by Ronald Tse +.\" Copyright (c) 2017 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. +.\" +.Dd $Mdocdate: March 21 2019 $ +.Dt EVP_RC4 3 +.Os +.Sh NAME +.Nm EVP_rc4 , +.Nm EVP_rc4_40 , +.Nm EVP_rc4_hmac_md5 +.Nd EVP RC4 stream cipher +.Sh SYNOPSIS +.In openssl/evp.h +.Ft const EVP_CIPHER * +.Fn EVP_rc4 void +.Ft const EVP_CIPHER * +.Fn EVP_rc4_40 void +.Ft const EVP_CIPHER * +.Fn EVP_rc4_hmac_md5 void +.Sh DESCRIPTION +These functions provide the RC4 stream cipher in the +.Xr evp 3 +framework. +It is a variable key length cipher. +.Pp +.Fn EVP_rc4 +uses a default key length of 128 bits. +.Pp +.Fn EVP_rc4_40 +uses a key length of 40 bits instead. +This function is deprecated. +Use +.Fn EVP_rc4 +and +.Xr EVP_CIPHER_CTX_set_key_length 3 +instead. +.Pp +.Fn EVP_rc4_hmac_md5 +provides authenticated encryption with the RC4 stream cipher +with MD5 as HMAC. +This function is not intended for usage outside of TLS +and requires calling of some undocumented control functions. +It does not conform to the EVP AEAD interface. +.Sh RETURN VALUES +These functions return an +.Vt EVP_CIPHER +structure that provides the implementation of the symmetric cipher. +.Sh SEE ALSO +.Xr evp 3 , +.Xr EVP_EncryptInit 3 +.Sh HISTORY +.Fn EVP_rc4 +first appeared in SSLeay 0.5.1 +and +.Fn EVP_rc4_40 +in OpenSSL 0.9.1. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn EVP_rc4_hmac_md5 +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . diff --git a/man/EVP_sm4_cbc.3 b/man/EVP_sm4_cbc.3 new file mode 100644 index 00000000..85ff88f5 --- /dev/null +++ b/man/EVP_sm4_cbc.3 @@ -0,0 +1,81 @@ +.\" $OpenBSD: EVP_sm4_cbc.3,v 1.1 2019/03/18 05:56:24 schwarze Exp $ +.\" full merge up to: OpenSSL 87103969 Oct 1 14:11:57 2018 -0700 +.\" +.\" Copyright (c) 2017 Ribose Inc +.\" Copyright (c) 2019 Ingo Schwarze +.\" The original version of this file +.\" was written by Ronald Tse . +.\" +.\" Permission to use, copy, modify, and/or distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: March 18 2019 $ +.Dt EVP_SM4_CBC 3 +.Os +.Sh NAME +.Nm EVP_sm4_cbc , +.Nm EVP_sm4_ecb , +.Nm EVP_sm4_cfb , +.Nm EVP_sm4_cfb128 , +.Nm EVP_sm4_ofb , +.Nm EVP_sm4_ctr +.Nd EVP SM4 cipher +.Sh SYNOPSIS +.In openssl/evp.h +.Ft const EVP_CIPHER * +.Fn EVP_sm4_cbc void +.Ft const EVP_CIPHER * +.Fn EVP_sm4_ecb void +.Ft const EVP_CIPHER * +.Fn EVP_sm4_cfb void +.Ft const EVP_CIPHER * +.Fn EVP_sm4_cfb128 void +.Ft const EVP_CIPHER * +.Fn EVP_sm4_ofb void +.Ft const EVP_CIPHER * +.Fn EVP_sm4_ctr void +.Sh DESCRIPTION +These functions provide the SM4 blockcipher in the +.Xr evp 3 +framework. +.Pp +All modes use a key length of 128 bits and act on blocks of 128 +bits. +.Pp +.Fn EVP_sm4_cfb +is an alias for +.Fn EVP_sm4_cfb128 . +.Pp +With an argument of +.Qq sm4 +or +.Qq SM4 , +.Xr EVP_get_cipherbyname 3 +returns +.Fn EVP_sm4_cbc . +.Sh RETURN VALUES +These functions return an +.Vt EVP_CIPHER +structure that provides the implementation of the symmetric cipher. +.Sh SEE ALSO +.Xr evp 3 , +.Xr EVP_EncryptInit 3 +.Sh STANDARDS +.Rs +.%T Information security technology - SM4 block cipher algorithm +.%I National Standards of People's Republic of China +.%N GB/T 32907-2016 +.%D August 29, 2016 +.Re +.Sh HISTORY +These functions appeared in OpenSSL 1.1.1 and have been available since +.Ox 6.5 . diff --git a/man/EXTENDED_KEY_USAGE_new.3 b/man/EXTENDED_KEY_USAGE_new.3 index 8910fb58..d06c76c5 100644 --- a/man/EXTENDED_KEY_USAGE_new.3 +++ b/man/EXTENDED_KEY_USAGE_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EXTENDED_KEY_USAGE_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: EXTENDED_KEY_USAGE_new.3,v 1.3 2018/03/22 21:08:22 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt EXTENDED_KEY_USAGE_NEW 3 .Os .Sh NAME @@ -73,3 +73,9 @@ section 4.2.1.3: Key Usage .It section 4.2.1.12: Extended Key Usage .El +.Sh HISTORY +.Fn EXTENDED_KEY_USAGE_new +and +.Fn EXTENDED_KEY_USAGE_free +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/GENERAL_NAME_new.3 b/man/GENERAL_NAME_new.3 index a5537323..671b5440 100644 --- a/man/GENERAL_NAME_new.3 +++ b/man/GENERAL_NAME_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: GENERAL_NAME_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: GENERAL_NAME_new.3,v 1.5 2018/03/22 21:08:22 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt GENERAL_NAME_NEW 3 .Os .Sh NAME @@ -142,3 +142,23 @@ if an error occurs. RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.2: Certificate Extensions +.Sh HISTORY +.Fn GENERAL_NAME_new , +.Fn GENERAL_NAME_free , +.Fn GENERAL_NAMES_new , +and +.Fn GENERAL_NAMES_free +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . +.Pp +.Fn OTHERNAME_new +and +.Fn OTHERNAME_free +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn EDIPARTYNAME_new +and +.Fn EDIPARTYNAME_free +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/HMAC.3 b/man/HMAC.3 index 595d5ed5..1f855dc1 100644 --- a/man/HMAC.3 +++ b/man/HMAC.3 @@ -1,9 +1,12 @@ -.\" $OpenBSD: HMAC.3,v 1.7 2017/08/01 14:57:03 schwarze Exp $ -.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 +.\" $OpenBSD: HMAC.3,v 1.13 2018/03/23 23:18:17 schwarze Exp $ +.\" full merge up to: OpenSSL crypto/hmac a528d4f0 Oct 27 13:40:11 2015 -0400 +.\" selective merge up to: OpenSSL man3/HMAC b3696a55 Sep 2 09:35:50 2017 -0400 .\" -.\" This file was written by Ulf Moeller . -.\" Copyright (c) 2000-2002, 2006, 2008, 2009, 2013, 2016 The OpenSSL Project. -.\" All rights reserved. +.\" This file was written by Ulf Moeller , +.\" Richard Levitte , and +.\" Matt Caswell . +.\" Copyright (c) 2000-2002, 2006, 2008, 2009, 2013, 2015, 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 @@ -49,20 +52,24 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 1 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt HMAC 3 .Os .Sh NAME .Nm HMAC , +.Nm HMAC_CTX_new , +.Nm HMAC_CTX_reset , +.Nm HMAC_CTX_free , .Nm HMAC_CTX_init , -.Nm HMAC_Init , +.Nm HMAC_CTX_cleanup , +.Nm HMAC_cleanup , .Nm HMAC_Init_ex , +.Nm HMAC_Init , .Nm HMAC_Update , .Nm HMAC_Final , -.Nm HMAC_CTX_cleanup , -.Nm HMAC_cleanup , .Nm HMAC_CTX_copy , .Nm HMAC_CTX_set_flags , +.Nm HMAC_CTX_get_md , .Nm HMAC_size .Nd HMAC message authentication code .Sh SYNOPSIS @@ -77,24 +84,42 @@ .Fa "unsigned char *md" .Fa "unsigned int *md_len" .Fc +.Ft HMAC_CTX * +.Fn HMAC_CTX_new void +.Ft int +.Fo HMAC_CTX_reset +.Fa "HMAC_CTX *ctx" +.Fc +.Ft void +.Fo HMAC_CTX_free +.Fa "HMAC_CTX *ctx" +.Fc .Ft void .Fo HMAC_CTX_init .Fa "HMAC_CTX *ctx" .Fc +.Ft void +.Fo HMAC_CTX_cleanup +.Fa "HMAC_CTX *ctx" +.Fc +.Ft void +.Fo HMAC_cleanup +.Fa "HMAC_CTX *ctx" +.Fc .Ft int -.Fo HMAC_Init +.Fo HMAC_Init_ex .Fa "HMAC_CTX *ctx" .Fa "const void *key" .Fa "int key_len" .Fa "const EVP_MD *md" +.Fa "ENGINE *impl" .Fc .Ft int -.Fo HMAC_Init_ex +.Fo HMAC_Init .Fa "HMAC_CTX *ctx" .Fa "const void *key" .Fa "int key_len" .Fa "const EVP_MD *md" -.Fa "ENGINE *impl" .Fc .Ft int .Fo HMAC_Update @@ -108,14 +133,6 @@ .Fa "unsigned char *md" .Fa "unsigned int *len" .Fc -.Ft void -.Fo HMAC_CTX_cleanup -.Fa "HMAC_CTX *ctx" -.Fc -.Ft void -.Fo HMAC_cleanup -.Fa "HMAC_CTX *ctx" -.Fc .Ft int .Fo HMAC_CTX_copy .Fa "HMAC_CTX *dctx" @@ -126,6 +143,10 @@ .Fa "HMAC_CTX *ctx" .Fa "unsigned long flags" .Fc +.Ft const EVP_MD * +.Fo HMAC_CTX_get_md +.Fa "const HMAC_CTX *ctx" +.Fc .Ft size_t .Fo HMAC_size .Fa "const HMAC_CTX *e" @@ -158,7 +179,7 @@ If .Fa md is .Dv NULL , -the digest is placed in a static array. +the digest is placed in a static array, which is not thread safe. The size of the output is placed in .Fa md_len , unless it is @@ -170,19 +191,48 @@ can be .Xr EVP_ripemd160 3 , etc. .Pp +.Fn HMAC_CTX_new +allocates and initializes a new +.Vt HMAC_CTX +object. +.Pp +.Fn HMAC_CTX_reset +zeroes and re-initializes +.Fa ctx +and associated resources, making it suitable for new computations +as if it was deleted with +.Fn HMAC_CTX_free +and newly created with +.Fn HMAC_CTX_new . +.Pp +.Fn HMAC_CTX_free +erases the key and other data from +.Fa ctx , +releases any associated resources, and finally frees +.Fa ctx +itself. +.Pp .Fn HMAC_CTX_init -initialises a +is a deprecated function to initialize an empty .Vt HMAC_CTX -before first use. -It must be called. +object, similar to +.Fn CTX_new +but without the allocation. +Calling it is required for static objects and objects on the stack +before using them. .Pp .Fn HMAC_CTX_cleanup -erases the key and other data from the -.Vt HMAC_CTX -and releases any associated resources. -It must be called when an -.Vt HMAC_CTX -is no longer required. +is a deprecated function to erase the key and other data from +.Fa ctx +and release any associated resources, similar to +.Fn HMAC_CTX_free +but without freeing +.Fa ctx +itself. +Calling it is required for static objects and objects on the stack +that were initialized with +.Fn HMAC_CTX_init +and are no longer needed. .Pp .Fn HMAC_cleanup is an alias for @@ -193,39 +243,66 @@ It is deprecated and implemented as a macro. The following functions may be used if the message is not completely stored in memory: .Pp -.Fn HMAC_Init -initializes a -.Vt HMAC_CTX -structure to use the hash function -.Fa evp_md -and the key -.Fa key -which is -.Fa key_len -bytes long. -It is deprecated and only included for backward compatibility with -OpenSSL 0.9.6b. -.Pp .Fn HMAC_Init_ex -initializes or reuses a -.Vt HMAC_CTX -structure to use the function +sets up or reuses +.Fa ctx +to use the hash function .Fa evp_md -and key +and the key .Fa key . Either can be .Dv NULL , -in which case the existing one will be reused. +in which case the existing one is reused. +The +.Fa ctx +must have been created with +.Fn HMAC_CTX_new +or initialized with .Fn HMAC_CTX_init -must have been called before the first use of an -.Vt HMAC_CTX -in this function. -.Sy N.B. -.Fn HMAC_Init -had this undocumented behaviour in previous versions of OpenSSL - -failure to switch to +before the first use in this function. +If .Fn HMAC_Init_ex -in programs that expect it will cause them to stop working. +is called with a +.Dv NULL +.Fa key +but +.Fa evp_md +is neither +.Dv NULL +nor the same as the previous digest used by +.Fa ctx , +then an error is returned because reuse of an existing key with a +different digest is not supported. +.Pp +.Fn HMAC_Init +is a deprecated wrapper around +.Fn HMAC_Init_ex . +If called with both +.Fa key +and +.Fa md , +it calls +.Fn HMAC_CTX_init +first, which only makes sense for an empty, uninitialized +.Fa ctx , +but not for one already initialized with +.Fn HMAC_CTX_new +or +.Fn HMAC_CTX_init . +If +.Fa key +or +.Fa md +is +.Dv NULL , +it does not call +.Fn HMAC_CTX_init ; +so in this case, +.Fa ctx +already needs to be initialized with +.Fn HMAC_CTX_new +or +.Fn HMAC_CTX_init . .Pp .Fn HMAC_Update can be called repeatedly with chunks of the message to be authenticated @@ -260,6 +337,14 @@ returns a pointer to the message authentication code or .Dv NULL if an error occurred. .Pp +.Fn HMAC_CTX_new +returns a pointer to the new +.Vt HMAC_CTX +object or +.Dv NULL +if an error occurred. +.Pp +.Fn HMAC_CTX_reset , .Fn HMAC_Init_ex , .Fn HMAC_Update , .Fn HMAC_Final , @@ -267,6 +352,15 @@ and .Fn HMAC_CTX_copy return 1 for success or 0 if an error occurred. .Pp +.Fn HMAC_CTX_get_md +returns the message digest that was previously set for +.Fa ctx +with +.Fn HMAC_Init_ex , +or +.Dv NULL +if none was set. +.Pp .Fn HMAC_size returns the length in bytes of the underlying hash function output or 0 on error. @@ -276,21 +370,34 @@ or 0 on error. RFC 2104 .Sh HISTORY .Fn HMAC , +.Fn HMAC_cleanup , .Fn HMAC_Init , .Fn HMAC_Update , .Fn HMAC_Final , and -.Fn HMAC_cleanup -are available since SSLeay 0.9.0. +.Fn HMAC_size +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . .Pp .Fn HMAC_CTX_init , -.Fn HMAC_Init_ex , +.Fn HMAC_CTX_cleanup , and -.Fn HMAC_CTX_cleanup -are available since OpenSSL 0.9.7. +.Fn HMAC_Init_ex +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . .Pp -.Fn HMAC_Init_ex , -.Fn HMAC_Update , +.Fn HMAC_CTX_set_flags +first appeared in OpenSSL 0.9.7f and have been available since +.Ox 3.8 . +.Pp +.Fn HMAC_CTX_copy +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . +.Pp +.Fn HMAC_CTX_new , +.Fn HMAC_CTX_reset , +.Fn HMAC_CTX_free , and -.Fn HMAC_Final -did not return values in versions of OpenSSL before 1.0.0. +.Fn HMAC_CTX_get_md +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . diff --git a/man/MD5.3 b/man/MD5.3 index 1f5fe37e..1e4a6285 100644 --- a/man/MD5.3 +++ b/man/MD5.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: MD5.3,v 1.4 2016/11/27 16:20:15 schwarze Exp $ +.\" $OpenBSD: MD5.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Ulf Moeller and @@ -49,46 +49,20 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 27 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt MD5 3 .Os .Sh NAME -.Nm MD2 , .Nm MD4 , .Nm MD5 , -.Nm MD2_Init , -.Nm MD2_Update , -.Nm MD2_Final , .Nm MD4_Init , .Nm MD4_Update , .Nm MD4_Final , .Nm MD5_Init , .Nm MD5_Update , .Nm MD5_Final -.Nd MD2, MD4, and MD5 hash functions +.Nd MD4 and MD5 hash functions .Sh SYNOPSIS -.In openssl/md2.h -.Ft unsigned char * -.Fo MD2 -.Fa "const unsigned char *d" -.Fa "unsigned long n" -.Fa "unsigned char *md" -.Fc -.Ft int -.Fo MD2_Init -.Fa "MD2_CTX *c" -.Fc -.Ft int -.Fo MD2_Update -.Fa "MD2_CTX *c" -.Fa "const unsigned char *data" -.Fa "unsigned long len" -.Fc -.Ft int -.Fo MD2_Final -.Fa "unsigned char *md" -.Fa "MD2_CTX *c" -.Fc .In openssl/md4.h .Ft unsigned char * .Fo MD4 @@ -134,23 +108,20 @@ .Fa "MD5_CTX *c" .Fc .Sh DESCRIPTION -MD2, MD4, and MD5 are cryptographic hash functions with a 128-bit +MD4 and MD5 are cryptographic hash functions with a 128-bit output. .Pp -.Fn MD2 , -.Fn MD4 , +.Fn MD4 and .Fn MD5 -compute the MD2, MD4, and MD5 message digest of the +compute the MD4 and MD5 message digest of the .Fa n bytes at .Fa d and place it in .Fa md , which must have space for -.Dv MD2_DIGEST_LENGTH No == -.Dv MD4_DIGEST_LENGTH No == -.Dv MD5_DIGEST_LENGTH No == 16 +.Dv MD4_DIGEST_LENGTH No == Dv MD5_DIGEST_LENGTH No == 16 bytes of output. If .Fa md @@ -161,49 +132,40 @@ the digest is placed in a static array. The following functions may be used if the message is not completely stored in memory: .Pp -.Fn MD2_Init +.Fn MD5_Init initializes a -.Vt MD2_CTX +.Vt MD5_CTX structure. .Pp -.Fn MD2_Update +.Fn MD5_Update can be called repeatedly with chunks of the message to be hashed .Pq Fa len No bytes at Fa data . .Pp -.Fn MD2_Final +.Fn MD5_Final places the message digest in .Fa md , which must have space for -.Dv MD2_DIGEST_LENGTH No == 16 +.Dv MD5_DIGEST_LENGTH No == 16 bytes of output, and erases the -.Vt MD2_CTX . +.Vt MD5_CTX . .Pp .Fn MD4_Init , .Fn MD4_Update , -.Fn MD4_Final , -.Fn MD5_Init , -.Fn MD5_Update , and -.Fn MD5_Final +.Fn MD4_Final are analogous using an .Vt MD4_CTX -and -.Vt MD5_CTX structure. .Pp Applications should use the higher level functions .Xr EVP_DigestInit 3 etc. instead of calling these hash functions directly. .Sh RETURN VALUES -.Fn MD2 , -.Fn MD4 , +.Fn MD4 and .Fn MD5 return pointers to the hash value. .Pp -.Fn MD2_Init , -.Fn MD2_Update , -.Fn MD2_Final , .Fn MD4_Init , .Fn MD4_Update , .Fn MD4_Final , @@ -215,21 +177,20 @@ return 1 for success or 0 otherwise. .Sh SEE ALSO .Xr EVP_DigestInit 3 .Sh STANDARDS -RFC 1319, RFC 1320, RFC 1321 +RFC 1320, RFC 1321 .Sh HISTORY -.Fn MD2 , -.Fn MD2_Init , -.Fn MD2_Update , -.Fn MD2_Final , .Fn MD5 , .Fn MD5_Init , .Fn MD5_Update , and .Fn MD5_Final -are available in all versions of SSLeay and OpenSSL. +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . .Pp .Fn MD4 , .Fn MD4_Init , +.Fn MD4_Update , and -.Fn MD4_Update -are available in OpenSSL 0.9.6 and above. +.Fn MD4_Final +first appeared in OpenSSL 0.9.6 and have been available since +.Ox 2.9 . diff --git a/man/Makefile.am b/man/Makefile.am index 2716d185..87480337 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -3,14 +3,17 @@ dist_man3_MANS = dist_man5_MANS = dist_man3_MANS += BIO_f_ssl.3 dist_man3_MANS += DTLSv1_listen.3 +dist_man3_MANS += OPENSSL_init_ssl.3 dist_man3_MANS += PEM_read_SSL_SESSION.3 dist_man3_MANS += SSL_CIPHER_get_name.3 dist_man3_MANS += SSL_COMP_add_compression_method.3 +dist_man3_MANS += SSL_CTX_add1_chain_cert.3 dist_man3_MANS += SSL_CTX_add_extra_chain_cert.3 dist_man3_MANS += SSL_CTX_add_session.3 dist_man3_MANS += SSL_CTX_ctrl.3 dist_man3_MANS += SSL_CTX_flush_sessions.3 dist_man3_MANS += SSL_CTX_free.3 +dist_man3_MANS += SSL_CTX_get0_certificate.3 dist_man3_MANS += SSL_CTX_get_ex_new_index.3 dist_man3_MANS += SSL_CTX_get_verify_mode.3 dist_man3_MANS += SSL_CTX_load_verify_locations.3 @@ -43,6 +46,7 @@ dist_man3_MANS += SSL_CTX_set_timeout.3 dist_man3_MANS += SSL_CTX_set_tlsext_servername_callback.3 dist_man3_MANS += SSL_CTX_set_tlsext_status_cb.3 dist_man3_MANS += SSL_CTX_set_tlsext_ticket_key_cb.3 +dist_man3_MANS += SSL_CTX_set_tlsext_use_srtp.3 dist_man3_MANS += SSL_CTX_set_tmp_dh_callback.3 dist_man3_MANS += SSL_CTX_set_tmp_rsa_callback.3 dist_man3_MANS += SSL_CTX_set_verify.3 @@ -52,7 +56,9 @@ dist_man3_MANS += SSL_SESSION_get0_peer.3 dist_man3_MANS += SSL_SESSION_get_compress_id.3 dist_man3_MANS += SSL_SESSION_get_ex_new_index.3 dist_man3_MANS += SSL_SESSION_get_id.3 +dist_man3_MANS += SSL_SESSION_get_protocol_version.3 dist_man3_MANS += SSL_SESSION_get_time.3 +dist_man3_MANS += SSL_SESSION_has_ticket.3 dist_man3_MANS += SSL_SESSION_new.3 dist_man3_MANS += SSL_SESSION_print.3 dist_man3_MANS += SSL_SESSION_set1_id_context.3 @@ -70,6 +76,7 @@ dist_man3_MANS += SSL_get_SSL_CTX.3 dist_man3_MANS += SSL_get_certificate.3 dist_man3_MANS += SSL_get_ciphers.3 dist_man3_MANS += SSL_get_client_CA_list.3 +dist_man3_MANS += SSL_get_client_random.3 dist_man3_MANS += SSL_get_current_cipher.3 dist_man3_MANS += SSL_get_default_timeout.3 dist_man3_MANS += SSL_get_error.3 @@ -110,6 +117,7 @@ dist_man3_MANS += SSL_write.3 dist_man3_MANS += d2i_SSL_SESSION.3 dist_man3_MANS += ssl.3 dist_man3_MANS += ACCESS_DESCRIPTION_new.3 +dist_man3_MANS += ASN1_INTEGER_get.3 dist_man3_MANS += ASN1_OBJECT_new.3 dist_man3_MANS += ASN1_STRING_TABLE_add.3 dist_man3_MANS += ASN1_STRING_length.3 @@ -131,7 +139,9 @@ dist_man3_MANS += BIO_f_cipher.3 dist_man3_MANS += BIO_f_md.3 dist_man3_MANS += BIO_f_null.3 dist_man3_MANS += BIO_find_type.3 +dist_man3_MANS += BIO_get_data.3 dist_man3_MANS += BIO_get_ex_new_index.3 +dist_man3_MANS += BIO_meth_new.3 dist_man3_MANS += BIO_new.3 dist_man3_MANS += BIO_printf.3 dist_man3_MANS += BIO_push.3 @@ -171,11 +181,12 @@ dist_man3_MANS += BUF_MEM_new.3 dist_man3_MANS += CONF_modules_free.3 dist_man3_MANS += CONF_modules_load_file.3 dist_man3_MANS += CRYPTO_get_mem_functions.3 +dist_man3_MANS += CRYPTO_lock.3 dist_man3_MANS += CRYPTO_set_ex_data.3 -dist_man3_MANS += CRYPTO_set_locking_callback.3 dist_man3_MANS += DES_set_key.3 dist_man3_MANS += DH_generate_key.3 dist_man3_MANS += DH_generate_parameters.3 +dist_man3_MANS += DH_get0_pqg.3 dist_man3_MANS += DH_get_ex_new_index.3 dist_man3_MANS += DH_new.3 dist_man3_MANS += DH_set_method.3 @@ -186,7 +197,9 @@ dist_man3_MANS += DSA_do_sign.3 dist_man3_MANS += DSA_dup_DH.3 dist_man3_MANS += DSA_generate_key.3 dist_man3_MANS += DSA_generate_parameters.3 +dist_man3_MANS += DSA_get0_pqg.3 dist_man3_MANS += DSA_get_ex_new_index.3 +dist_man3_MANS += DSA_meth_new.3 dist_man3_MANS += DSA_new.3 dist_man3_MANS += DSA_set_method.3 dist_man3_MANS += DSA_sign.3 @@ -198,6 +211,17 @@ dist_man3_MANS += EC_GROUP_new.3 dist_man3_MANS += EC_KEY_new.3 dist_man3_MANS += EC_POINT_add.3 dist_man3_MANS += EC_POINT_new.3 +dist_man3_MANS += ENGINE_add.3 +dist_man3_MANS += ENGINE_ctrl.3 +dist_man3_MANS += ENGINE_get_default_RSA.3 +dist_man3_MANS += ENGINE_init.3 +dist_man3_MANS += ENGINE_new.3 +dist_man3_MANS += ENGINE_register_RSA.3 +dist_man3_MANS += ENGINE_register_all_RSA.3 +dist_man3_MANS += ENGINE_set_RSA.3 +dist_man3_MANS += ENGINE_set_default.3 +dist_man3_MANS += ENGINE_set_flags.3 +dist_man3_MANS += ENGINE_unregister_RSA.3 dist_man3_MANS += ERR.3 dist_man3_MANS += ERR_GET_LIB.3 dist_man3_MANS += ERR_asprintf_error_data.3 @@ -221,6 +245,8 @@ dist_man3_MANS += EVP_EncryptInit.3 dist_man3_MANS += EVP_OpenInit.3 dist_man3_MANS += EVP_PKEY_CTX_ctrl.3 dist_man3_MANS += EVP_PKEY_CTX_new.3 +dist_man3_MANS += EVP_PKEY_asn1_get_count.3 +dist_man3_MANS += EVP_PKEY_asn1_new.3 dist_man3_MANS += EVP_PKEY_cmp.3 dist_man3_MANS += EVP_PKEY_decrypt.3 dist_man3_MANS += EVP_PKEY_derive.3 @@ -228,6 +254,7 @@ dist_man3_MANS += EVP_PKEY_encrypt.3 dist_man3_MANS += EVP_PKEY_get_default_digest_nid.3 dist_man3_MANS += EVP_PKEY_keygen.3 dist_man3_MANS += EVP_PKEY_meth_get0_info.3 +dist_man3_MANS += EVP_PKEY_meth_new.3 dist_man3_MANS += EVP_PKEY_new.3 dist_man3_MANS += EVP_PKEY_print_private.3 dist_man3_MANS += EVP_PKEY_set1_RSA.3 @@ -237,6 +264,11 @@ dist_man3_MANS += EVP_PKEY_verify_recover.3 dist_man3_MANS += EVP_SealInit.3 dist_man3_MANS += EVP_SignInit.3 dist_man3_MANS += EVP_VerifyInit.3 +dist_man3_MANS += EVP_aes_128_cbc.3 +dist_man3_MANS += EVP_camellia_128_cbc.3 +dist_man3_MANS += EVP_des_cbc.3 +dist_man3_MANS += EVP_rc4.3 +dist_man3_MANS += EVP_sm4_cbc.3 dist_man3_MANS += EXTENDED_KEY_USAGE_new.3 dist_man3_MANS += GENERAL_NAME_new.3 dist_man3_MANS += HMAC.3 @@ -254,8 +286,10 @@ dist_man3_MANS += OCSP_sendreq_new.3 dist_man3_MANS += OPENSSL_VERSION_NUMBER.3 dist_man3_MANS += OPENSSL_cleanse.3 dist_man3_MANS += OPENSSL_config.3 +dist_man3_MANS += OPENSSL_init_crypto.3 dist_man3_MANS += OPENSSL_load_builtin_modules.3 dist_man3_MANS += OPENSSL_malloc.3 +dist_man3_MANS += OPENSSL_sk_new.3 dist_man3_MANS += OpenSSL_add_all_algorithms.3 dist_man3_MANS += PEM_bytes_read_bio.3 dist_man3_MANS += PEM_read.3 @@ -287,7 +321,9 @@ dist_man3_MANS += RSA_PSS_PARAMS_new.3 dist_man3_MANS += RSA_blinding_on.3 dist_man3_MANS += RSA_check_key.3 dist_man3_MANS += RSA_generate_key.3 +dist_man3_MANS += RSA_get0_key.3 dist_man3_MANS += RSA_get_ex_new_index.3 +dist_man3_MANS += RSA_meth_new.3 dist_man3_MANS += RSA_new.3 dist_man3_MANS += RSA_padding_add_PKCS1_type_1.3 dist_man3_MANS += RSA_print.3 @@ -300,6 +336,7 @@ dist_man3_MANS += RSA_size.3 dist_man3_MANS += SHA1.3 dist_man3_MANS += SMIME_read_PKCS7.3 dist_man3_MANS += SMIME_write_PKCS7.3 +dist_man3_MANS += STACK_OF.3 dist_man3_MANS += SXNET_new.3 dist_man3_MANS += TS_REQ_new.3 dist_man3_MANS += UI_UTIL_read_pw.3 @@ -320,6 +357,7 @@ dist_man3_MANS += X509_NAME_add_entry_by_txt.3 dist_man3_MANS += X509_NAME_get_index_by_NID.3 dist_man3_MANS += X509_NAME_new.3 dist_man3_MANS += X509_NAME_print_ex.3 +dist_man3_MANS += X509_OBJECT_get0_X509.3 dist_man3_MANS += X509_PUBKEY_new.3 dist_man3_MANS += X509_REQ_new.3 dist_man3_MANS += X509_REVOKED_new.3 @@ -329,6 +367,7 @@ dist_man3_MANS += X509_STORE_CTX_get_ex_new_index.3 dist_man3_MANS += X509_STORE_CTX_new.3 dist_man3_MANS += X509_STORE_CTX_set_verify_cb.3 dist_man3_MANS += X509_STORE_load_locations.3 +dist_man3_MANS += X509_STORE_new.3 dist_man3_MANS += X509_STORE_set1_param.3 dist_man3_MANS += X509_STORE_set_verify_cb_func.3 dist_man3_MANS += X509_VERIFY_PARAM_set_flags.3 @@ -338,6 +377,8 @@ dist_man3_MANS += X509_check_issued.3 dist_man3_MANS += X509_check_private_key.3 dist_man3_MANS += X509_cmp_time.3 dist_man3_MANS += X509_digest.3 +dist_man3_MANS += X509_get0_notBefore.3 +dist_man3_MANS += X509_get0_signature.3 dist_man3_MANS += X509_get_pubkey.3 dist_man3_MANS += X509_get_serialNumber.3 dist_man3_MANS += X509_get_subject_name.3 @@ -381,7 +422,6 @@ dist_man3_MANS += d2i_X509_NAME.3 dist_man3_MANS += d2i_X509_REQ.3 dist_man3_MANS += d2i_X509_SIG.3 dist_man3_MANS += des_read_pw.3 -dist_man3_MANS += engine.3 dist_man3_MANS += evp.3 dist_man3_MANS += get_rfc3526_prime_8192.3 dist_man3_MANS += i2d_PKCS7_bio_stream.3 @@ -405,12 +445,20 @@ install-data-hook: ln -sf "ACCESS_DESCRIPTION_new.3" "$(DESTDIR)$(mandir)/man3/ACCESS_DESCRIPTION_free.3" ln -sf "ACCESS_DESCRIPTION_new.3" "$(DESTDIR)$(mandir)/man3/AUTHORITY_INFO_ACCESS_free.3" ln -sf "ACCESS_DESCRIPTION_new.3" "$(DESTDIR)$(mandir)/man3/AUTHORITY_INFO_ACCESS_new.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_get.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_set.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_to_BN.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/ASN1_INTEGER_set.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/ASN1_INTEGER_to_BN.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/BN_to_ASN1_ENUMERATED.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/BN_to_ASN1_INTEGER.3" ln -sf "ASN1_OBJECT_new.3" "$(DESTDIR)$(mandir)/man3/ASN1_OBJECT_free.3" ln -sf "ASN1_STRING_TABLE_add.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_TABLE_cleanup.3" ln -sf "ASN1_STRING_TABLE_add.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_TABLE_get.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_cmp.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_data.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_dup.3" + ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_get0_data.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_length_set.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_set.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_to_UTF8.3" @@ -541,6 +589,10 @@ install-data-hook: ln -sf "BIO_f_ssl.3" "$(DESTDIR)$(mandir)/man3/BIO_ssl_shutdown.3" ln -sf "BIO_find_type.3" "$(DESTDIR)$(mandir)/man3/BIO_method_type.3" ln -sf "BIO_find_type.3" "$(DESTDIR)$(mandir)/man3/BIO_next.3" + ln -sf "BIO_get_data.3" "$(DESTDIR)$(mandir)/man3/BIO_get_shutdown.3" + ln -sf "BIO_get_data.3" "$(DESTDIR)$(mandir)/man3/BIO_set_data.3" + ln -sf "BIO_get_data.3" "$(DESTDIR)$(mandir)/man3/BIO_set_init.3" + ln -sf "BIO_get_data.3" "$(DESTDIR)$(mandir)/man3/BIO_set_shutdown.3" ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/BIO_get_ex_data.3" ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/BIO_set_ex_data.3" ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/ECDH_get_ex_data.3" @@ -561,9 +613,28 @@ install-data-hook: ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/X509_get_ex_data.3" ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/X509_get_ex_new_index.3" ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/X509_set_ex_data.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_get_new_index.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_free.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_callback_ctrl.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_create.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_ctrl.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_destroy.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_gets.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_puts.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_read.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_write.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_callback_ctrl.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_create.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_ctrl.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_destroy.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_gets.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_puts.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_read.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_write.3" ln -sf "BIO_new.3" "$(DESTDIR)$(mandir)/man3/BIO_free.3" ln -sf "BIO_new.3" "$(DESTDIR)$(mandir)/man3/BIO_free_all.3" ln -sf "BIO_new.3" "$(DESTDIR)$(mandir)/man3/BIO_set.3" + ln -sf "BIO_new.3" "$(DESTDIR)$(mandir)/man3/BIO_up_ref.3" ln -sf "BIO_new.3" "$(DESTDIR)$(mandir)/man3/BIO_vfree.3" ln -sf "BIO_printf.3" "$(DESTDIR)$(mandir)/man3/BIO_snprintf.3" ln -sf "BIO_printf.3" "$(DESTDIR)$(mandir)/man3/BIO_vprintf.3" @@ -681,6 +752,9 @@ install-data-hook: ln -sf "BN_copy.3" "$(DESTDIR)$(mandir)/man3/BN_dup.3" ln -sf "BN_copy.3" "$(DESTDIR)$(mandir)/man3/BN_with_flags.3" ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_call.3" + ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_free.3" + ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_get_arg.3" + ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_new.3" ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_set.3" ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_set_old.3" ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_generate_prime_ex.3" @@ -740,6 +814,15 @@ install-data-hook: ln -sf "CRYPTO_get_mem_functions.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_mem_leaks_cb.3" ln -sf "CRYPTO_get_mem_functions.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_mem_leaks_fp.3" ln -sf "CRYPTO_get_mem_functions.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_set_mem_functions.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_cmp.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_cpy.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_current.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_hash.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_add.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_r_lock.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_r_unlock.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_w_lock.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_w_unlock.3" ln -sf "CRYPTO_set_ex_data.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_dup.3" ln -sf "CRYPTO_set_ex_data.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_free.3" ln -sf "CRYPTO_set_ex_data.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_new.3" @@ -801,13 +884,23 @@ install-data-hook: ln -sf "DH_generate_key.3" "$(DESTDIR)$(mandir)/man3/DH_compute_key.3" ln -sf "DH_generate_parameters.3" "$(DESTDIR)$(mandir)/man3/DH_check.3" ln -sf "DH_generate_parameters.3" "$(DESTDIR)$(mandir)/man3/DH_generate_parameters_ex.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_clear_flags.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_get0_engine.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_get0_key.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_set0_key.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_set0_pqg.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_set_flags.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_set_length.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_test_flags.3" ln -sf "DH_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/DH_get_ex_data.3" ln -sf "DH_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/DH_set_ex_data.3" ln -sf "DH_new.3" "$(DESTDIR)$(mandir)/man3/DH_free.3" + ln -sf "DH_new.3" "$(DESTDIR)$(mandir)/man3/DH_up_ref.3" ln -sf "DH_set_method.3" "$(DESTDIR)$(mandir)/man3/DH_OpenSSL.3" ln -sf "DH_set_method.3" "$(DESTDIR)$(mandir)/man3/DH_get_default_method.3" ln -sf "DH_set_method.3" "$(DESTDIR)$(mandir)/man3/DH_new_method.3" ln -sf "DH_set_method.3" "$(DESTDIR)$(mandir)/man3/DH_set_default_method.3" + ln -sf "DH_size.3" "$(DESTDIR)$(mandir)/man3/DH_bits.3" ln -sf "DIST_POINT_new.3" "$(DESTDIR)$(mandir)/man3/CRL_DIST_POINTS_free.3" ln -sf "DIST_POINT_new.3" "$(DESTDIR)$(mandir)/man3/CRL_DIST_POINTS_new.3" ln -sf "DIST_POINT_new.3" "$(DESTDIR)$(mandir)/man3/DIST_POINT_NAME_free.3" @@ -816,11 +909,25 @@ install-data-hook: ln -sf "DIST_POINT_new.3" "$(DESTDIR)$(mandir)/man3/ISSUING_DIST_POINT_free.3" ln -sf "DIST_POINT_new.3" "$(DESTDIR)$(mandir)/man3/ISSUING_DIST_POINT_new.3" ln -sf "DSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/DSA_SIG_free.3" + ln -sf "DSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/DSA_SIG_get0.3" + ln -sf "DSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/DSA_SIG_set0.3" ln -sf "DSA_do_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_do_verify.3" ln -sf "DSA_generate_parameters.3" "$(DESTDIR)$(mandir)/man3/DSA_generate_parameters_ex.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_clear_flags.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_get0_engine.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_get0_key.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_set0_key.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_set0_pqg.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_set_flags.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_test_flags.3" ln -sf "DSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/DSA_get_ex_data.3" ln -sf "DSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/DSA_set_ex_data.3" + ln -sf "DSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/DSA_meth_dup.3" + ln -sf "DSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/DSA_meth_free.3" + ln -sf "DSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/DSA_meth_set_finish.3" + ln -sf "DSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/DSA_meth_set_sign.3" ln -sf "DSA_new.3" "$(DESTDIR)$(mandir)/man3/DSA_free.3" + ln -sf "DSA_new.3" "$(DESTDIR)$(mandir)/man3/DSA_up_ref.3" ln -sf "DSA_set_method.3" "$(DESTDIR)$(mandir)/man3/DSA_OpenSSL.3" ln -sf "DSA_set_method.3" "$(DESTDIR)$(mandir)/man3/DSA_get_default_method.3" ln -sf "DSA_set_method.3" "$(DESTDIR)$(mandir)/man3/DSA_new_method.3" @@ -829,6 +936,8 @@ install-data-hook: ln -sf "DSA_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_verify.3" ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3" ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_free.3" + ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_get0.3" + ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_set0.3" ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_do_sign.3" ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_do_sign_ex.3" ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_do_verify.3" @@ -939,6 +1048,104 @@ install-data-hook: ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_compressed_coordinates_GF2m.3" ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_compressed_coordinates_GFp.3" ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_to_infinity.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_by_id.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_cleanup.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_first.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_id.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_last.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_name.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_next.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_prev.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_remove.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_id.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_name.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_CTRL_FUNC_PTR.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_cmd_is_executable.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd_string.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cmd_defns.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ctrl_function.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_cmd_defns.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ctrl_function.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher_engine.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DH.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DSA.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDH.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDSA.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RAND.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest_engine.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_table_flags.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_table_flags.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_GEN_INT_FUNC_PTR.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_finish.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_finish_function.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_init_function.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_finish_function.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_init_function.3" + ln -sf "ENGINE_new.3" "$(DESTDIR)$(mandir)/man3/ENGINE_GEN_INT_FUNC_PTR.3" + ln -sf "ENGINE_new.3" "$(DESTDIR)$(mandir)/man3/ENGINE_free.3" + ln -sf "ENGINE_new.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_destroy_function.3" + ln -sf "ENGINE_new.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_destroy_function.3" + ln -sf "ENGINE_new.3" "$(DESTDIR)$(mandir)/man3/ENGINE_up_ref.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_DH.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_DSA.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDH.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDSA.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_RAND.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_STORE.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ciphers.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_complete.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_digests.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_builtin_engines.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_dynamic.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DH.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DSA.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDH.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDSA.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RAND.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_STORE.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ciphers.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_complete.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_digests.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_CIPHERS_PTR.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_DIGESTS_PTR.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_DH.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_DSA.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDH.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDSA.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_RAND.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_RSA.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_STORE.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ciphers.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digests.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_DH.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_DSA.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDH.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDSA.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_RAND.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_STORE.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ciphers.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_digests.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DH.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DSA.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDH.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDSA.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RAND.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RSA.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ciphers.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_digests.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_string.3" + ln -sf "ENGINE_set_flags.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_flags.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DH.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DSA.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDH.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDSA.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RAND.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_STORE.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ciphers.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_digests.3" ln -sf "ERR_GET_LIB.3" "$(DESTDIR)$(mandir)/man3/ERR_FATAL_ERROR.3" ln -sf "ERR_GET_LIB.3" "$(DESTDIR)$(mandir)/man3/ERR_GET_FUNC.3" ln -sf "ERR_GET_LIB.3" "$(DESTDIR)$(mandir)/man3/ERR_GET_REASON.3" @@ -979,7 +1186,9 @@ install-data-hook: ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_AEAD_nonce_length.3" ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_aead_aes_128_gcm.3" ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_aead_aes_256_gcm.3" + ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_aead_chacha20_poly1305" ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_aead_chacha20_poly1305.3" + ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_aead_xchacha20_poly1305.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DigestFinal.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DigestFinal_ex.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DigestInit_ex.3" @@ -992,8 +1201,11 @@ install-data-hook: ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_create.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_ctrl.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_destroy.3" + ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_free.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_init.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_md.3" + ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_new.3" + ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_reset.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_size.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_type.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_block_size.3" @@ -1005,7 +1217,6 @@ install-data-hook: ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_get_digestbyname.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_get_digestbynid.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_get_digestbyobj.3" - ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_md2.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_md5.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_md5_sha1.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_md_null.3" @@ -1023,25 +1234,34 @@ install-data-hook: ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DecodeFinal.3" ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DecodeInit.3" ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DecodeUpdate.3" + ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_ENCODE_CTX_free.3" + ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_ENCODE_CTX_new.3" ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncodeBlock.3" ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncodeFinal.3" ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncodeUpdate.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_block_size.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_cipher.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_cleanup.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_clear_flags.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_ctrl.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_flags.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_free.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_get_app_data.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_get_iv.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_init.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_iv_length.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_key_length.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_mode.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_new.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_nid.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_rand_key.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_reset.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_app_data.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_flags.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_iv.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_key_length.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_padding.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_test_flags.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_type.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_asn1_to_param.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_block_size.3" @@ -1066,26 +1286,6 @@ install-data-hook: ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncryptFinal_ex.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncryptInit_ex.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncryptUpdate.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc_hmac_sha1.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ccm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ecb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_gcm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ofb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cbc.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ccm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ecb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_gcm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ofb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc_hmac_sha1.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ccm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ecb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_gcm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ofb.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_bf_cbc.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_bf_cfb.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_bf_ecb.3" @@ -1125,25 +1325,39 @@ install-data-hook: ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc4.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc4_40.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc4_hmac_md5.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_cbc.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_cfb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_ecb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_ofb.3" ln -sf "EVP_OpenInit.3" "$(DESTDIR)$(mandir)/man3/EVP_OpenFinal.3" ln -sf "EVP_OpenInit.3" "$(DESTDIR)$(mandir)/man3/EVP_OpenUpdate.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_ctrl_str.3" + ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_mgf1_md.3" + ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_padding.3" + ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_pss_saltlen.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dh_paramgen_generator.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dh_paramgen_prime_len.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dsa_paramgen_bits.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_ec_paramgen_curve_nid.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_keygen_bits.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_keygen_pubexp.3" + ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_mgf1_md.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_padding.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_pss_saltlen.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_signature_md.3" ln -sf "EVP_PKEY_CTX_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_dup.3" ln -sf "EVP_PKEY_CTX_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_free.3" ln -sf "EVP_PKEY_CTX_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_new_id.3" + ln -sf "EVP_PKEY_asn1_get_count.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_find.3" + ln -sf "EVP_PKEY_asn1_get_count.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_find_str.3" + ln -sf "EVP_PKEY_asn1_get_count.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_get0.3" + ln -sf "EVP_PKEY_asn1_get_count.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_get0_info.3" + ln -sf "EVP_PKEY_asn1_get_count.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_asn1.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_add0.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_add_alias.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_copy.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_free.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_ctrl.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_free.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_param.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_private.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_public.3" ln -sf "EVP_PKEY_cmp.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_cmp_parameters.3" ln -sf "EVP_PKEY_cmp.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_copy_parameters.3" ln -sf "EVP_PKEY_cmp.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_missing_parameters.3" @@ -1160,7 +1374,27 @@ install-data-hook: ln -sf "EVP_PKEY_keygen.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_keygen_init.3" ln -sf "EVP_PKEY_keygen.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_paramgen.3" ln -sf "EVP_PKEY_keygen.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_paramgen_init.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_add0.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_copy.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_find.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_free.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_cleanup.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_copy.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_ctrl.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_decrypt.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_derive.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_encrypt.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_init.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_keygen.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_paramgen.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_sign.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_signctx.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verify.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verify_recover.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verifyctx.3" ln -sf "EVP_PKEY_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_free.3" + ln -sf "EVP_PKEY_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_new_mac_key.3" + ln -sf "EVP_PKEY_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_up_ref.3" ln -sf "EVP_PKEY_print_private.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_print_params.3" ln -sf "EVP_PKEY_print_private.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_print_public.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_DH.3" @@ -1168,6 +1402,11 @@ install-data-hook: ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_EC_KEY.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_RSA.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_base_id.3" + ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_DH.3" + ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_DSA.3" + ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_EC_KEY.3" + ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_RSA.3" + ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_hmac.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_DH.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_DSA.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_EC_KEY.3" @@ -1182,6 +1421,7 @@ install-data-hook: ln -sf "EVP_PKEY_verify_recover.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_recover_init.3" ln -sf "EVP_SealInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SealFinal.3" ln -sf "EVP_SealInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SealUpdate.3" + ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_bits.3" ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_size.3" ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SignFinal.3" ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SignInit_ex.3" @@ -1189,6 +1429,47 @@ install-data-hook: ln -sf "EVP_VerifyInit.3" "$(DESTDIR)$(mandir)/man3/EVP_VerifyFinal.3" ln -sf "EVP_VerifyInit.3" "$(DESTDIR)$(mandir)/man3/EVP_VerifyInit_ex.3" ln -sf "EVP_VerifyInit.3" "$(DESTDIR)$(mandir)/man3/EVP_VerifyUpdate.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc_hmac_sha1.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ccm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb1.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb128.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb8.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ctr.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ecb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_gcm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ofb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_wrap.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_xts.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cbc.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ccm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb1.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb128.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb8.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ctr.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ecb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_gcm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ofb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_wrap.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc_hmac_sha1.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ccm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb1.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb128.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb8.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ctr.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ecb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_gcm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ofb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_wrap.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_xts.3" + ln -sf "EVP_sm4_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_sm4_cfb.3" + ln -sf "EVP_sm4_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_sm4_cfb128.3" + ln -sf "EVP_sm4_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_sm4_ctr.3" + ln -sf "EVP_sm4_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_sm4_ecb.3" + ln -sf "EVP_sm4_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_sm4_ofb.3" ln -sf "EXTENDED_KEY_USAGE_new.3" "$(DESTDIR)$(mandir)/man3/EXTENDED_KEY_USAGE_free.3" ln -sf "GENERAL_NAME_new.3" "$(DESTDIR)$(mandir)/man3/EDIPARTYNAME_free.3" ln -sf "GENERAL_NAME_new.3" "$(DESTDIR)$(mandir)/man3/EDIPARTYNAME_new.3" @@ -1199,7 +1480,11 @@ install-data-hook: ln -sf "GENERAL_NAME_new.3" "$(DESTDIR)$(mandir)/man3/OTHERNAME_new.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_cleanup.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_copy.3" + ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_free.3" + ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_get_md.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_init.3" + ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_new.3" + ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_reset.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_set_flags.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_Final.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_Init.3" @@ -1207,10 +1492,6 @@ install-data-hook: ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_Update.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_cleanup.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_size.3" - ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD2.3" - ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD2_Final.3" - ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD2_Init.3" - ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD2_Update.3" ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD4.3" ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD4_Final.3" ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD4_Init.3" @@ -1235,7 +1516,6 @@ install-data-hook: ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_txt2obj.3" ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/i2t_ASN1_OBJECT.3" ln -sf "OCSP_CRLID_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_CRLID_free.3" - ln -sf "OCSP_CRLID_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_crlID_new.3" ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_ONEREQ_free.3" ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_ONEREQ_new.3" ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_free.3" @@ -1264,7 +1544,9 @@ install-data-hook: ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_REVOKEDINFO_free.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_REVOKEDINFO_new.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_free.3" + ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_get0_id.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_new.3" + ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_basic_verify.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_check_validity.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_resp_count.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_resp_find.3" @@ -1280,6 +1562,7 @@ install-data-hook: ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_RESPID_new.3" ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_RESPONSE_free.3" ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_RESPONSE_new.3" + ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_basic_sign.3" ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_response_create.3" ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_response_get1_basic.3" ln -sf "OCSP_sendreq_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQ_CTX_add1_header.3" @@ -1287,6 +1570,11 @@ install-data-hook: ln -sf "OCSP_sendreq_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQ_CTX_set1_req.3" ln -sf "OCSP_sendreq_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_sendreq_bio.3" ln -sf "OCSP_sendreq_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_sendreq_nbio.3" + ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/LIBRESSL_VERSION_NUMBER.3" + ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/LIBRESSL_VERSION_TEXT.3" + ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/OPENSSL_VERSION_TEXT.3" + ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/OpenSSL_version.3" + ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/OpenSSL_version_num.3" ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/SSLeay.3" ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/SSLeay_version.3" ln -sf "OPENSSL_config.3" "$(DESTDIR)$(mandir)/man3/OPENSSL_no_config.3" @@ -1299,6 +1587,27 @@ install-data-hook: ln -sf "OPENSSL_malloc.3" "$(DESTDIR)$(mandir)/man3/OPENSSL_free.3" ln -sf "OPENSSL_malloc.3" "$(DESTDIR)$(mandir)/man3/OPENSSL_realloc.3" ln -sf "OPENSSL_malloc.3" "$(DESTDIR)$(mandir)/man3/OPENSSL_strdup.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_delete.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_delete_ptr.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_dup.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_find.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_find_ex.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_free.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_insert.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_is_sorted.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_new.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_new_null.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_num.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_pop.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_pop_free.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_push.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_set.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_set_cmp_func.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_shift.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_sort.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_unshift.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_value.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_zero.3" ln -sf "OpenSSL_add_all_algorithms.3" "$(DESTDIR)$(mandir)/man3/EVP_cleanup.3" ln -sf "OpenSSL_add_all_algorithms.3" "$(DESTDIR)$(mandir)/man3/OpenSSL_add_all_ciphers.3" ln -sf "OpenSSL_add_all_algorithms.3" "$(DESTDIR)$(mandir)/man3/OpenSSL_add_all_digests.3" @@ -1441,6 +1750,7 @@ install-data-hook: ln -sf "PROXY_POLICY_new.3" "$(DESTDIR)$(mandir)/man3/PROXY_CERT_INFO_EXTENSION_new.3" ln -sf "PROXY_POLICY_new.3" "$(DESTDIR)$(mandir)/man3/PROXY_POLICY_free.3" ln -sf "RAND_add.3" "$(DESTDIR)$(mandir)/man3/RAND_cleanup.3" + ln -sf "RAND_add.3" "$(DESTDIR)$(mandir)/man3/RAND_poll.3" ln -sf "RAND_add.3" "$(DESTDIR)$(mandir)/man3/RAND_seed.3" ln -sf "RAND_add.3" "$(DESTDIR)$(mandir)/man3/RAND_status.3" ln -sf "RAND_bytes.3" "$(DESTDIR)$(mandir)/man3/RAND_pseudo_bytes.3" @@ -1455,12 +1765,28 @@ install-data-hook: ln -sf "RSA_PSS_PARAMS_new.3" "$(DESTDIR)$(mandir)/man3/RSA_PSS_PARAMS_free.3" ln -sf "RSA_blinding_on.3" "$(DESTDIR)$(mandir)/man3/RSA_blinding_off.3" ln -sf "RSA_generate_key.3" "$(DESTDIR)$(mandir)/man3/RSA_generate_key_ex.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_clear_flags.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_get0_crt_params.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_get0_factors.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_set0_crt_params.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_set0_factors.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_set0_key.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_set_flags.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_test_flags.3" ln -sf "RSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_dup.3" ln -sf "RSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_free.3" ln -sf "RSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_new.3" ln -sf "RSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/RSA_get_ex_data.3" ln -sf "RSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/RSA_set_ex_data.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_dup.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_free.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_get_finish.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_set1_name.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_set_finish.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_set_priv_dec.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_set_priv_enc.3" ln -sf "RSA_new.3" "$(DESTDIR)$(mandir)/man3/RSA_free.3" + ln -sf "RSA_new.3" "$(DESTDIR)$(mandir)/man3/RSA_up_ref.3" ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_add_PKCS1_OAEP.3" ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_add_PKCS1_type_2.3" ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_add_none.3" @@ -1480,14 +1806,12 @@ install-data-hook: ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_PKCS1_SSLeay.3" ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_flags.3" ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_get_default_method.3" - ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_get_default_openssl_method.3" ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_get_method.3" ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_new_method.3" - ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_null_method.3" ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_set_default_method.3" - ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_set_default_openssl_method.3" ln -sf "RSA_sign.3" "$(DESTDIR)$(mandir)/man3/RSA_verify.3" ln -sf "RSA_sign_ASN1_OCTET_STRING.3" "$(DESTDIR)$(mandir)/man3/RSA_verify_ASN1_OCTET_STRING.3" + ln -sf "RSA_size.3" "$(DESTDIR)$(mandir)/man3/RSA_bits.3" ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA1_Final.3" ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA1_Init.3" ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA1_Update.3" @@ -1508,8 +1832,14 @@ install-data-hook: ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA512_Init.3" ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA512_Update.3" ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_description.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_auth_nid.3" ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_bits.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_cipher_nid.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_digest_nid.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_id.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_kx_nid.3" ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_version.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_is_aead.3" ln -sf "SSL_COMP_add_compression_method.3" "$(DESTDIR)$(mandir)/man3/SSL_COMP_get_compression_methods.3" ln -sf "SSL_CTX_add_extra_chain_cert.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_clear_extra_chain_certs.3" ln -sf "SSL_CTX_add_session.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_remove_session.3" @@ -1524,9 +1854,13 @@ install-data-hook: ln -sf "SSL_CTX_get_verify_mode.3" "$(DESTDIR)$(mandir)/man3/SSL_get_verify_depth.3" ln -sf "SSL_CTX_get_verify_mode.3" "$(DESTDIR)$(mandir)/man3/SSL_get_verify_mode.3" ln -sf "SSL_CTX_load_verify_locations.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_default_verify_paths.3" + ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLS_client_method.3" + ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLS_method.3" + ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLS_server_method.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLSv1_client_method.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLSv1_method.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLSv1_server_method.3" + ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_up_ref.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/SSLv23_client_method.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/SSLv23_method.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/SSLv23_server_method.3" @@ -1580,6 +1914,8 @@ install-data-hook: ln -sf "SSL_CTX_set_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_set_client_CA_list.3" ln -sf "SSL_CTX_set_client_cert_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_client_cert_cb.3" ln -sf "SSL_CTX_set_client_cert_cb.3" "$(DESTDIR)$(mandir)/man3/client_cert_cb.3" + ln -sf "SSL_CTX_set_default_passwd_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_default_passwd_cb.3" + ln -sf "SSL_CTX_set_default_passwd_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_default_passwd_cb_userdata.3" ln -sf "SSL_CTX_set_default_passwd_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_default_passwd_cb_userdata.3" ln -sf "SSL_CTX_set_default_passwd_cb.3" "$(DESTDIR)$(mandir)/man3/pem_password_cb.3" ln -sf "SSL_CTX_set_generate_session_id.3" "$(DESTDIR)$(mandir)/man3/GEN_SESSION_CB.3" @@ -1591,7 +1927,11 @@ install-data-hook: ln -sf "SSL_CTX_set_max_cert_list.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_max_cert_list.3" ln -sf "SSL_CTX_set_max_cert_list.3" "$(DESTDIR)$(mandir)/man3/SSL_get_max_cert_list.3" ln -sf "SSL_CTX_set_max_cert_list.3" "$(DESTDIR)$(mandir)/man3/SSL_set_max_cert_list.3" + ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_max_proto_version.3" + ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_min_proto_version.3" ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_max_proto_version.3" + ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_get_max_proto_version.3" + ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_get_min_proto_version.3" ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_set_max_proto_version.3" ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_set_min_proto_version.3" ln -sf "SSL_CTX_set_mode.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_mode.3" @@ -1622,16 +1962,21 @@ install-data-hook: ln -sf "SSL_CTX_set_tlsext_servername_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_get_servername.3" ln -sf "SSL_CTX_set_tlsext_servername_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_get_servername_type.3" ln -sf "SSL_CTX_set_tlsext_servername_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_host_name.3" + ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_tlsext_status_arg.3" + ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_tlsext_status_cb.3" ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tlsext_status_arg.3" ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_get_tlsext_status_ocsp_resp.3" ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_status_ocsp_resp.3" ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_status_type.3" + ln -sf "SSL_CTX_set_tlsext_use_srtp.3" "$(DESTDIR)$(mandir)/man3/SSL_get_selected_srtp_profile.3" + ln -sf "SSL_CTX_set_tlsext_use_srtp.3" "$(DESTDIR)$(mandir)/man3/SSL_get_srtp_profiles.3" + ln -sf "SSL_CTX_set_tlsext_use_srtp.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_use_srtp.3" ln -sf "SSL_CTX_set_tmp_dh_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tmp_dh.3" ln -sf "SSL_CTX_set_tmp_dh_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_dh.3" ln -sf "SSL_CTX_set_tmp_dh_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_dh_callback.3" ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_need_tmp_RSA.3" ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tmp_rsa.3" - ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_need_tmp_rsa.3" + ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_need_tmp_RSA.3" ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_rsa.3" ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_rsa_callback.3" ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_verify_depth.3" @@ -1659,8 +2004,10 @@ install-data-hook: ln -sf "SSL_CTX_use_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_use_certificate.3" ln -sf "SSL_CTX_use_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_use_certificate_ASN1.3" ln -sf "SSL_CTX_use_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_use_certificate_file.3" + ln -sf "SSL_SESSION_free.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_up_ref.3" ln -sf "SSL_SESSION_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_ex_data.3" ln -sf "SSL_SESSION_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_ex_data.3" + ln -sf "SSL_SESSION_get_id.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set1_id.3" ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_timeout.3" ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_time.3" ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_timeout.3" @@ -1668,13 +2015,20 @@ install-data-hook: ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_get_timeout.3" ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_set_time.3" ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_set_timeout.3" + ln -sf "SSL_SESSION_has_ticket.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_ticket_lifetime_hint.3" ln -sf "SSL_SESSION_print.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_print_fp.3" + ln -sf "SSL_SESSION_set1_id_context.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get0_id_context.3" ln -sf "SSL_alert_type_string.3" "$(DESTDIR)$(mandir)/man3/SSL_alert_desc_string.3" ln -sf "SSL_alert_type_string.3" "$(DESTDIR)$(mandir)/man3/SSL_alert_desc_string_long.3" ln -sf "SSL_alert_type_string.3" "$(DESTDIR)$(mandir)/man3/SSL_alert_type_string_long.3" ln -sf "SSL_get_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_get_privatekey.3" + ln -sf "SSL_get_ciphers.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_ciphers.3" + ln -sf "SSL_get_ciphers.3" "$(DESTDIR)$(mandir)/man3/SSL_get1_supported_ciphers.3" ln -sf "SSL_get_ciphers.3" "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_list.3" + ln -sf "SSL_get_ciphers.3" "$(DESTDIR)$(mandir)/man3/SSL_get_client_ciphers.3" ln -sf "SSL_get_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_client_CA_list.3" + ln -sf "SSL_get_client_random.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_master_key.3" + ln -sf "SSL_get_client_random.3" "$(DESTDIR)$(mandir)/man3/SSL_get_server_random.3" ln -sf "SSL_get_current_cipher.3" "$(DESTDIR)$(mandir)/man3/SSL_get_cipher.3" ln -sf "SSL_get_current_cipher.3" "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_bits.3" ln -sf "SSL_get_current_cipher.3" "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_name.3" @@ -1697,13 +2051,17 @@ install-data-hook: ln -sf "SSL_library_init.3" "$(DESTDIR)$(mandir)/man3/SSLeay_add_ssl_algorithms.3" ln -sf "SSL_load_client_CA_file.3" "$(DESTDIR)$(mandir)/man3/SSL_add_dir_cert_subjects_to_stack.3" ln -sf "SSL_load_client_CA_file.3" "$(DESTDIR)$(mandir)/man3/SSL_add_file_cert_subjects_to_stack.3" + ln -sf "SSL_new.3" "$(DESTDIR)$(mandir)/man3/SSL_up_ref.3" ln -sf "SSL_num_renegotiations.3" "$(DESTDIR)$(mandir)/man3/SSL_clear_num_renegotiations.3" ln -sf "SSL_num_renegotiations.3" "$(DESTDIR)$(mandir)/man3/SSL_total_renegotiations.3" ln -sf "SSL_read.3" "$(DESTDIR)$(mandir)/man3/SSL_peek.3" ln -sf "SSL_renegotiate.3" "$(DESTDIR)$(mandir)/man3/SSL_renegotiate_abbreviated.3" ln -sf "SSL_renegotiate.3" "$(DESTDIR)$(mandir)/man3/SSL_renegotiate_pending.3" ln -sf "SSL_rstate_string.3" "$(DESTDIR)$(mandir)/man3/SSL_rstate_string_long.3" + ln -sf "SSL_set1_param.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get0_param.3" ln -sf "SSL_set1_param.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set1_param.3" + ln -sf "SSL_set1_param.3" "$(DESTDIR)$(mandir)/man3/SSL_get0_param.3" + ln -sf "SSL_set_connect_state.3" "$(DESTDIR)$(mandir)/man3/SSL_is_server.3" ln -sf "SSL_set_connect_state.3" "$(DESTDIR)$(mandir)/man3/SSL_set_accept_state.3" ln -sf "SSL_set_fd.3" "$(DESTDIR)$(mandir)/man3/SSL_set_rfd.3" ln -sf "SSL_set_fd.3" "$(DESTDIR)$(mandir)/man3/SSL_set_wfd.3" @@ -1782,14 +2140,18 @@ install-data-hook: ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_process.3" ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_set_default_method.3" ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_set_method.3" + ln -sf "X25519.3" "$(DESTDIR)$(mandir)/man3/X25519_keypair.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509V3_EXT_d2i.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509V3_EXT_i2d.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509V3_add1_i2d.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_add1_ext_i2d.3" + ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_extensions.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get_ext_d2i.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_add1_ext_i2d.3" + ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_extensions.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get_ext_d2i.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_add1_ext_i2d.3" + ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_get0_extensions.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_get_ext_d2i.3" ln -sf "X509_ALGOR_dup.3" "$(DESTDIR)$(mandir)/man3/X509_ALGOR_cmp.3" ln -sf "X509_ALGOR_dup.3" "$(DESTDIR)$(mandir)/man3/X509_ALGOR_free.3" @@ -1809,7 +2171,9 @@ install-data-hook: ln -sf "X509_CRL_get0_by_serial.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_sort.3" ln -sf "X509_CRL_new.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_INFO_free.3" ln -sf "X509_CRL_new.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_INFO_new.3" + ln -sf "X509_CRL_new.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_dup.3" ln -sf "X509_CRL_new.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_free.3" + ln -sf "X509_CRL_new.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_up_ref.3" ln -sf "X509_EXTENSION_set_object.3" "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_create_by_NID.3" ln -sf "X509_EXTENSION_set_object.3" "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_create_by_OBJ.3" ln -sf "X509_EXTENSION_set_object.3" "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_free.3" @@ -1844,8 +2208,16 @@ install-data-hook: ln -sf "X509_NAME_print_ex.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_oneline.3" ln -sf "X509_NAME_print_ex.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_print.3" ln -sf "X509_NAME_print_ex.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_print_ex_fp.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_free_contents.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_get0_X509_CRL.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_get_type.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_idx_by_subject.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_retrieve_by_subject.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_retrieve_match.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_up_ref_count.3" ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_free.3" ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get.3" + ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get0.3" ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get0_param.3" ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_set.3" ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_set0_param.3" @@ -1858,10 +2230,15 @@ install-data-hook: ln -sf "X509_REQ_new.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_INFO_free.3" ln -sf "X509_REQ_new.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_INFO_new.3" ln -sf "X509_REQ_new.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_free.3" + ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_dup.3" ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_free.3" + ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_revocationDate.3" + ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_serialNumber.3" ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_set_revocationDate.3" ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_set_serialNumber.3" ln -sf "X509_SIG_new.3" "$(DESTDIR)$(mandir)/man3/X509_SIG_free.3" + ln -sf "X509_STORE_CTX_get_error.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_cert.3" + ln -sf "X509_STORE_CTX_get_error.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_chain.3" ln -sf "X509_STORE_CTX_get_error.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get1_chain.3" ln -sf "X509_STORE_CTX_get_error.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get_current_cert.3" ln -sf "X509_STORE_CTX_get_error.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get_error_depth.3" @@ -1872,24 +2249,57 @@ install-data-hook: ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_cleanup.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_free.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_param.3" + ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_store.3" + ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_untrusted.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_init.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_crls.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_param.3" + ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_trusted_stack.3" + ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_untrusted.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_cert.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_chain.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_default.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_trusted_stack.3" ln -sf "X509_STORE_load_locations.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_default_paths.3" + ln -sf "X509_STORE_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_free.3" + ln -sf "X509_STORE_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_up_ref.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_add_cert.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_add_crl.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_get0_objects.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_get0_param.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_get_ex_data.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_get_ex_new_index.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_depth.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_ex_data.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_flags.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_purpose.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_trust.3" ln -sf "X509_STORE_set_verify_cb_func.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_verify_cb.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add0_policy.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add0_table.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add1_host.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_clear_flags.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_free.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0_name.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0_peername.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_count.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_depth.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_flags.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_lookup.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_new.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_email.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_host.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_ip.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_ip_asc.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_name.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_policies.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_depth.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_hostflags.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_purpose.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_time.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_trust.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_table_cleanup.3" ln -sf "X509_check_host.3" "$(DESTDIR)$(mandir)/man3/X509_check_email.3" ln -sf "X509_check_host.3" "$(DESTDIR)$(mandir)/man3/X509_check_ip.3" ln -sf "X509_check_host.3" "$(DESTDIR)$(mandir)/man3/X509_check_ip_asc.3" @@ -1902,8 +2312,24 @@ install-data-hook: ln -sf "X509_digest.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_digest.3" ln -sf "X509_digest.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_digest.3" ln -sf "X509_digest.3" "$(DESTDIR)$(mandir)/man3/X509_pubkey_digest.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_lastUpdate.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_nextUpdate.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_set1_lastUpdate.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_set1_nextUpdate.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_get0_notAfter.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_getm_notAfter.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_getm_notBefore.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_set1_notAfter.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_set1_notBefore.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_signature.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get_signature_nid.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_get0_signature.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_get_signature_nid.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_get0_tbs_sigalg.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_get_signature_nid.3" ln -sf "X509_get_pubkey.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_get_pubkey.3" ln -sf "X509_get_pubkey.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_set_pubkey.3" + ln -sf "X509_get_pubkey.3" "$(DESTDIR)$(mandir)/man3/X509_get0_pubkey.3" ln -sf "X509_get_pubkey.3" "$(DESTDIR)$(mandir)/man3/X509_get_X509_PUBKEY.3" ln -sf "X509_get_pubkey.3" "$(DESTDIR)$(mandir)/man3/X509_set_pubkey.3" ln -sf "X509_get_serialNumber.3" "$(DESTDIR)$(mandir)/man3/X509_set_serialNumber.3" @@ -1919,6 +2345,7 @@ install-data-hook: ln -sf "X509_get_version.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_get_version.3" ln -sf "X509_get_version.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_set_version.3" ln -sf "X509_get_version.3" "$(DESTDIR)$(mandir)/man3/X509_set_version.3" + ln -sf "X509_new.3" "$(DESTDIR)$(mandir)/man3/X509_chain_up_ref.3" ln -sf "X509_new.3" "$(DESTDIR)$(mandir)/man3/X509_free.3" ln -sf "X509_new.3" "$(DESTDIR)$(mandir)/man3/X509_up_ref.3" ln -sf "X509_sign.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_sign.3" @@ -1973,7 +2400,6 @@ install-data-hook: ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_part_recursive.3" ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_recursive.3" ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_words.3" - ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_print.3" ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_set_high.3" ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_set_low.3" ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_set_max.3" @@ -2053,6 +2479,8 @@ install-data-hook: ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_fp.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_SIG.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAparams.3" + ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAparams_bio.3" + ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAparams_fp.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_bio.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_fp.3" @@ -2062,6 +2490,8 @@ install-data-hook: ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_fp.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_SIG.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAparams.3" + ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAparams_bio.3" + ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAparams_fp.3" ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECPKParameters_print.3" ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECPKParameters_print_fp.3" ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECParameters_dup.3" @@ -2272,6 +2702,7 @@ install-data-hook: ln -sf "d2i_X509_EXTENSION.3" "$(DESTDIR)$(mandir)/man3/i2d_X509_EXTENSIONS.3" ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_ENTRY_dup.3" ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_dup.3" + ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_get0_der.3" ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_hash.3" ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/d2i_X509_NAME_ENTRY.3" ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/i2d_X509_NAME.3" @@ -2290,118 +2721,14 @@ install-data-hook: ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/i2d_X509_SIG.3" ln -sf "des_read_pw.3" "$(DESTDIR)$(mandir)/man3/EVP_read_pw_string.3" ln -sf "des_read_pw.3" "$(DESTDIR)$(mandir)/man3/des_read_pw_string.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_add.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_by_id.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_cleanup.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_cmd_is_executable.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd_string.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_finish.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_free.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_STORE.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher_engine.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cmd_defns.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ctrl_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_destroy_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest_engine.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_finish_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_first.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_flags.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_id.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_init_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_last.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_load_privkey_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_load_pubkey_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_name.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_next.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_prev.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_table_flags.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_init.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_builtin_engines.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_cryptodev.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_dynamic.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_openssl.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_private_key.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_public_key.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_new.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_STORE.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_STORE.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_complete.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_complete.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_remove.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_STORE.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_cmd_defns.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ctrl_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_string.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_destroy_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_finish_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_flags.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_id.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_init_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_load_privkey_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_load_pubkey_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_name.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_table_flags.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_STORE.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_up_ref.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc2409_prime_1024.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc2409_prime_768.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_1536.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_2048.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_3072.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_4096.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_6144.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_8192.3" ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/get_rfc2409_prime_1024.3" ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/get_rfc2409_prime_768.3" ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/get_rfc3526_prime_1536.3" @@ -2448,6 +2775,7 @@ install-data-hook: ln -sf "tls_config_set_protocols.3" "$(DESTDIR)$(mandir)/man3/tls_config_set_dheparams.3" ln -sf "tls_config_set_protocols.3" "$(DESTDIR)$(mandir)/man3/tls_config_set_ecdhecurves.3" ln -sf "tls_config_set_session_id.3" "$(DESTDIR)$(mandir)/man3/tls_config_add_ticket_key.3" + ln -sf "tls_config_set_session_id.3" "$(DESTDIR)$(mandir)/man3/tls_config_set_session_fd.3" ln -sf "tls_config_set_session_id.3" "$(DESTDIR)$(mandir)/man3/tls_config_set_session_lifetime.3" ln -sf "tls_config_verify.3" "$(DESTDIR)$(mandir)/man3/tls_config_insecure_noverifycert.3" ln -sf "tls_config_verify.3" "$(DESTDIR)$(mandir)/man3/tls_config_insecure_noverifyname.3" @@ -2455,6 +2783,8 @@ install-data-hook: ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_conn_alpn_selected.3" ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_conn_cipher.3" ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_conn_servername.3" + ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_conn_session_resumed.3" + ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_peer_cert_chain_pem.3" ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_peer_cert_contains_name.3" ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_peer_cert_hash.3" ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_peer_cert_issuer.3" @@ -2492,12 +2822,13 @@ install-data-hook: ln -sf "tls_load_file.3" "$(DESTDIR)$(mandir)/man3/tls_config_set_verify_depth.3" ln -sf "tls_load_file.3" "$(DESTDIR)$(mandir)/man3/tls_config_verify_client.3" ln -sf "tls_load_file.3" "$(DESTDIR)$(mandir)/man3/tls_config_verify_client_optional.3" + ln -sf "tls_load_file.3" "$(DESTDIR)$(mandir)/man3/tls_default_ca_cert_file.3" ln -sf "tls_load_file.3" "$(DESTDIR)$(mandir)/man3/tls_unload_file.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_cert_status.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_crl_reason.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_next_update.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_response_status.3" - ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_result_msg.3" + ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_result.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_revocation_time.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_this_update.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_url.3" @@ -2511,12 +2842,20 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/ACCESS_DESCRIPTION_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/AUTHORITY_INFO_ACCESS_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/AUTHORITY_INFO_ACCESS_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_get.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_set.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_to_BN.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_INTEGER_set.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_INTEGER_to_BN.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_to_ASN1_ENUMERATED.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_to_ASN1_INTEGER.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_OBJECT_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_TABLE_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_TABLE_get.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_cmp.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_dup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_get0_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_length_set.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_set.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_to_UTF8.3" @@ -2647,6 +2986,10 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/BIO_ssl_shutdown.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_method_type.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_next.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_get_shutdown.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_set_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_set_init.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_set_shutdown.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_set_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDH_get_ex_data.3" @@ -2667,9 +3010,28 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_get_ex_new_index.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_set_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_get_new_index.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_callback_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_create.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_destroy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_gets.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_puts.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_read.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_write.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_callback_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_create.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_destroy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_gets.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_puts.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_read.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_write.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_free_all.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_set.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_vfree.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_snprintf.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_vprintf.3" @@ -2787,6 +3149,9 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/BN_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/BN_with_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_call.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_get_arg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_set.3" -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_set_old.3" -rm -f "$(DESTDIR)$(mandir)/man3/BN_generate_prime_ex.3" @@ -2846,6 +3211,15 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_mem_leaks_cb.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_mem_leaks_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_set_mem_functions.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_cmp.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_cpy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_current.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_hash.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_add.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_r_lock.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_r_unlock.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_w_lock.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_w_unlock.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_new.3" @@ -2907,13 +3281,23 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/DH_compute_key.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_check.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_generate_parameters_ex.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_clear_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_get0_engine.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_get0_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_set0_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_set0_pqg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_set_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_set_length.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_test_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_set_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_OpenSSL.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_get_default_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_new_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_set_default_method.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRL_DIST_POINTS_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRL_DIST_POINTS_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/DIST_POINT_NAME_free.3" @@ -2922,11 +3306,25 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/ISSUING_DIST_POINT_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/ISSUING_DIST_POINT_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_SIG_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_SIG_get0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_SIG_set0.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_do_verify.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_generate_parameters_ex.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_clear_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_get0_engine.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_get0_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_set0_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_set0_pqg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_set_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_test_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_set_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_meth_dup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_meth_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_meth_set_finish.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_meth_set_sign.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_OpenSSL.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_get_default_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_new_method.3" @@ -2935,6 +3333,8 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/DSA_verify.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_get0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_set0.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_do_sign.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_do_sign_ex.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_do_verify.3" @@ -3045,6 +3445,104 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_compressed_coordinates_GF2m.3" -rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_compressed_coordinates_GFp.3" -rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_to_infinity.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_by_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_cleanup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_first.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_last.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_name.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_next.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_prev.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_remove.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_name.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_CTRL_FUNC_PTR.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_cmd_is_executable.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd_string.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cmd_defns.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ctrl_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_cmd_defns.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ctrl_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher_engine.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest_engine.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_table_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_table_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_GEN_INT_FUNC_PTR.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_finish.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_finish_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_init_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_finish_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_init_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_GEN_INT_FUNC_PTR.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_destroy_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_destroy_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_up_ref.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_STORE.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_complete.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_digests.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_builtin_engines.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_dynamic.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_STORE.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_complete.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_digests.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_CIPHERS_PTR.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_DIGESTS_PTR.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_RSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_STORE.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digests.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_STORE.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_digests.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_digests.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_string.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_STORE.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_digests.3" -rm -f "$(DESTDIR)$(mandir)/man3/ERR_FATAL_ERROR.3" -rm -f "$(DESTDIR)$(mandir)/man3/ERR_GET_FUNC.3" -rm -f "$(DESTDIR)$(mandir)/man3/ERR_GET_REASON.3" @@ -3085,7 +3583,9 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_AEAD_nonce_length.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aead_aes_128_gcm.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aead_aes_256_gcm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aead_chacha20_poly1305" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aead_chacha20_poly1305.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aead_xchacha20_poly1305.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DigestFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DigestFinal_ex.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DigestInit_ex.3" @@ -3098,8 +3598,11 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_create.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_ctrl.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_destroy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_init.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_md.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_reset.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_size.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_type.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_block_size.3" @@ -3111,7 +3614,6 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_get_digestbyname.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_get_digestbynid.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_get_digestbyobj.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_md2.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_md5.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_md5_sha1.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_md_null.3" @@ -3129,25 +3631,34 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DecodeFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DecodeInit.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DecodeUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_ENCODE_CTX_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_ENCODE_CTX_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncodeBlock.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncodeFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncodeUpdate.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_block_size.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_cipher.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_cleanup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_clear_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_ctrl.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_get_app_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_get_iv.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_init.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_iv_length.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_key_length.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_mode.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_nid.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_rand_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_reset.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_app_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_iv.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_key_length.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_padding.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_test_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_type.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_asn1_to_param.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_block_size.3" @@ -3172,26 +3683,6 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncryptFinal_ex.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncryptInit_ex.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncryptUpdate.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc_hmac_sha1.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ccm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ecb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_gcm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ofb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cbc.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ccm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ecb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_gcm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ofb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc_hmac_sha1.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ccm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ecb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_gcm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ofb.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_bf_cbc.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_bf_cfb.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_bf_ecb.3" @@ -3231,25 +3722,39 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc4.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc4_40.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc4_hmac_md5.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_cbc.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_cfb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_ecb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_ofb.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_OpenFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_OpenUpdate.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_ctrl_str.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_mgf1_md.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_padding.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_pss_saltlen.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dh_paramgen_generator.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dh_paramgen_prime_len.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dsa_paramgen_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_ec_paramgen_curve_nid.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_keygen_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_keygen_pubexp.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_mgf1_md.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_padding.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_pss_saltlen.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_signature_md.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_new_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_find.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_find_str.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_get0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_get0_info.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_asn1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_add0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_add_alias.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_copy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_private.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_public.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_cmp_parameters.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_copy_parameters.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_missing_parameters.3" @@ -3266,7 +3771,27 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_keygen_init.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_paramgen.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_paramgen_init.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_add0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_copy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_find.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_cleanup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_copy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_decrypt.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_derive.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_encrypt.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_init.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_keygen.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_paramgen.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_sign.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_signctx.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verify.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verify_recover.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verifyctx.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_new_mac_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_print_params.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_print_public.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_DH.3" @@ -3274,6 +3799,11 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_EC_KEY.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_RSA.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_base_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_EC_KEY.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_RSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_hmac.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_DH.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_DSA.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_EC_KEY.3" @@ -3288,6 +3818,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_recover_init.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_SealFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_SealUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_size.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignInit_ex.3" @@ -3295,6 +3826,47 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_VerifyFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_VerifyInit_ex.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_VerifyUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc_hmac_sha1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ccm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb128.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb8.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ctr.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ecb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_gcm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ofb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_wrap.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_xts.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cbc.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ccm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb128.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb8.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ctr.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ecb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_gcm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ofb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_wrap.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc_hmac_sha1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ccm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb128.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb8.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ctr.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ecb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_gcm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ofb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_wrap.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_xts.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_sm4_cfb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_sm4_cfb128.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_sm4_ctr.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_sm4_ecb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_sm4_ofb.3" -rm -f "$(DESTDIR)$(mandir)/man3/EXTENDED_KEY_USAGE_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/EDIPARTYNAME_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/EDIPARTYNAME_new.3" @@ -3305,7 +3877,11 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OTHERNAME_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_copy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_get_md.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_init.3" + -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_reset.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_set_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_Final.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_Init.3" @@ -3313,10 +3889,6 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_Update.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_size.3" - -rm -f "$(DESTDIR)$(mandir)/man3/MD2.3" - -rm -f "$(DESTDIR)$(mandir)/man3/MD2_Final.3" - -rm -f "$(DESTDIR)$(mandir)/man3/MD2_Init.3" - -rm -f "$(DESTDIR)$(mandir)/man3/MD2_Update.3" -rm -f "$(DESTDIR)$(mandir)/man3/MD4.3" -rm -f "$(DESTDIR)$(mandir)/man3/MD4_Final.3" -rm -f "$(DESTDIR)$(mandir)/man3/MD4_Init.3" @@ -3341,7 +3913,6 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OBJ_txt2obj.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2t_ASN1_OBJECT.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_CRLID_free.3" - -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_crlID_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_ONEREQ_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_ONEREQ_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_free.3" @@ -3370,7 +3941,9 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REVOKEDINFO_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REVOKEDINFO_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_get0_id.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_basic_verify.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_check_validity.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_resp_count.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_resp_find.3" @@ -3386,6 +3959,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_RESPID_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_RESPONSE_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_RESPONSE_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_basic_sign.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_response_create.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_response_get1_basic.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQ_CTX_add1_header.3" @@ -3393,6 +3967,11 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQ_CTX_set1_req.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_sendreq_bio.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_sendreq_nbio.3" + -rm -f "$(DESTDIR)$(mandir)/man3/LIBRESSL_VERSION_NUMBER.3" + -rm -f "$(DESTDIR)$(mandir)/man3/LIBRESSL_VERSION_TEXT.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OPENSSL_VERSION_TEXT.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OpenSSL_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OpenSSL_version_num.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSLeay.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSLeay_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/OPENSSL_no_config.3" @@ -3405,6 +3984,27 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OPENSSL_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/OPENSSL_realloc.3" -rm -f "$(DESTDIR)$(mandir)/man3/OPENSSL_strdup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_delete.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_delete_ptr.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_dup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_find.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_find_ex.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_insert.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_is_sorted.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_new_null.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_num.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_pop.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_pop_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_push.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_set.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_set_cmp_func.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_shift.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_sort.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_unshift.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_value.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_zero.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/OpenSSL_add_all_ciphers.3" -rm -f "$(DESTDIR)$(mandir)/man3/OpenSSL_add_all_digests.3" @@ -3547,6 +4147,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/PROXY_CERT_INFO_EXTENSION_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/PROXY_POLICY_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/RAND_cleanup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RAND_poll.3" -rm -f "$(DESTDIR)$(mandir)/man3/RAND_seed.3" -rm -f "$(DESTDIR)$(mandir)/man3/RAND_status.3" -rm -f "$(DESTDIR)$(mandir)/man3/RAND_pseudo_bytes.3" @@ -3561,12 +4162,28 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/RSA_PSS_PARAMS_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_blinding_off.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_generate_key_ex.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_clear_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get0_crt_params.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get0_factors.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set0_crt_params.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set0_factors.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set0_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_test_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_dup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_get_finish.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_set1_name.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_set_finish.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_set_priv_dec.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_set_priv_enc.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_add_PKCS1_OAEP.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_add_PKCS1_type_2.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_add_none.3" @@ -3586,14 +4203,12 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/RSA_PKCS1_SSLeay.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get_default_method.3" - -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get_default_openssl_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_new_method.3" - -rm -f "$(DESTDIR)$(mandir)/man3/RSA_null_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set_default_method.3" - -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set_default_openssl_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_verify.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_verify_ASN1_OCTET_STRING.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/SHA1_Final.3" -rm -f "$(DESTDIR)$(mandir)/man3/SHA1_Init.3" -rm -f "$(DESTDIR)$(mandir)/man3/SHA1_Update.3" @@ -3614,8 +4229,14 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SHA512_Init.3" -rm -f "$(DESTDIR)$(mandir)/man3/SHA512_Update.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_description.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_auth_nid.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_bits.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_cipher_nid.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_digest_nid.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_kx_nid.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_is_aead.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_COMP_get_compression_methods.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_clear_extra_chain_certs.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_remove_session.3" @@ -3630,9 +4251,13 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_verify_depth.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_verify_mode.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_default_verify_paths.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DTLS_client_method.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DTLS_method.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DTLS_server_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DTLSv1_client_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DTLSv1_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DTLSv1_server_method.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSLv23_client_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSLv23_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSLv23_server_method.3" @@ -3686,6 +4311,8 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_client_CA_list.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_client_cert_cb.3" -rm -f "$(DESTDIR)$(mandir)/man3/client_cert_cb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_default_passwd_cb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_default_passwd_cb_userdata.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_default_passwd_cb_userdata.3" -rm -f "$(DESTDIR)$(mandir)/man3/pem_password_cb.3" -rm -f "$(DESTDIR)$(mandir)/man3/GEN_SESSION_CB.3" @@ -3697,7 +4324,11 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_max_cert_list.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_max_cert_list.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_max_cert_list.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_max_proto_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_min_proto_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_max_proto_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_max_proto_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_min_proto_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_max_proto_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_min_proto_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_mode.3" @@ -3728,16 +4359,21 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_servername.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_servername_type.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_host_name.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_tlsext_status_arg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_tlsext_status_cb.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tlsext_status_arg.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_tlsext_status_ocsp_resp.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_status_ocsp_resp.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_status_type.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_selected_srtp_profile.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_srtp_profiles.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_use_srtp.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tmp_dh.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_dh.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_dh_callback.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_need_tmp_RSA.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tmp_rsa.3" - -rm -f "$(DESTDIR)$(mandir)/man3/SSL_need_tmp_rsa.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_need_tmp_RSA.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_rsa.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_rsa_callback.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_verify_depth.3" @@ -3765,8 +4401,10 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_use_certificate.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_use_certificate_ASN1.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_use_certificate_file.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set1_id.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_timeout.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_time.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_timeout.3" @@ -3774,13 +4412,20 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_timeout.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_time.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_timeout.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_ticket_lifetime_hint.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_print_fp.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get0_id_context.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_alert_desc_string.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_alert_desc_string_long.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_alert_type_string_long.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_privatekey.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get1_supported_ciphers.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_list.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_client_ciphers.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_client_CA_list.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_master_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_server_random.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_cipher.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_name.3" @@ -3803,13 +4448,17 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSLeay_add_ssl_algorithms.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_add_dir_cert_subjects_to_stack.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_add_file_cert_subjects_to_stack.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_clear_num_renegotiations.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_total_renegotiations.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_peek.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_renegotiate_abbreviated.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_renegotiate_pending.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_rstate_string_long.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get0_param.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set1_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get0_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_is_server.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_accept_state.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_rfd.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_wfd.3" @@ -3888,14 +4537,18 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/UI_process.3" -rm -f "$(DESTDIR)$(mandir)/man3/UI_set_default_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/UI_set_method.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X25519_keypair.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509V3_EXT_d2i.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509V3_EXT_i2d.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509V3_add1_i2d.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_add1_ext_i2d.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_extensions.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get_ext_d2i.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_add1_ext_i2d.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_extensions.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get_ext_d2i.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_add1_ext_i2d.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_get0_extensions.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_get_ext_d2i.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_ALGOR_cmp.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_ALGOR_free.3" @@ -3915,7 +4568,9 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_sort.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_INFO_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_INFO_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_create_by_NID.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_create_by_OBJ.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_free.3" @@ -3950,8 +4605,16 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_oneline.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_print.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_print_ex_fp.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_free_contents.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_get0_X509_CRL.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_get_type.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_idx_by_subject.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_retrieve_by_subject.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_retrieve_match.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_up_ref_count.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get0.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get0_param.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_set.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_set0_param.3" @@ -3964,10 +4627,15 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_INFO_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_INFO_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_revocationDate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_serialNumber.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_set_revocationDate.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_set_serialNumber.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_SIG_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_cert.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_chain.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get1_chain.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get_current_cert.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get_error_depth.3" @@ -3978,24 +4646,57 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_store.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_untrusted.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_init.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_crls.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_trusted_stack.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_untrusted.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_cert.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_chain.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_default.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_trusted_stack.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_default_paths.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_up_ref.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_add_cert.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_add_crl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_get0_objects.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_get0_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_get_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_get_ex_new_index.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_depth.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_purpose.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_trust.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_verify_cb.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add0_policy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add0_table.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add1_host.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_clear_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0_name.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0_peername.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_count.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_depth.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_lookup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_email.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_host.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_ip.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_ip_asc.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_name.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_policies.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_depth.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_hostflags.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_purpose.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_time.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_trust.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_table_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_check_email.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_check_ip.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_check_ip_asc.3" @@ -4008,8 +4709,24 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_digest.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_digest.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_pubkey_digest.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_lastUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_nextUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_set1_lastUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_set1_nextUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_get0_notAfter.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_getm_notAfter.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_getm_notBefore.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_set1_notAfter.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_set1_notBefore.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_signature.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get_signature_nid.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_get0_signature.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_get_signature_nid.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_get0_tbs_sigalg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_get_signature_nid.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_get_pubkey.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_set_pubkey.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_get0_pubkey.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_get_X509_PUBKEY.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_set_pubkey.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_set_serialNumber.3" @@ -4025,6 +4742,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_get_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_set_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_set_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_chain_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_sign.3" @@ -4079,7 +4797,6 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_part_recursive.3" -rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_recursive.3" -rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_words.3" - -rm -f "$(DESTDIR)$(mandir)/man3/bn_print.3" -rm -f "$(DESTDIR)$(mandir)/man3/bn_set_high.3" -rm -f "$(DESTDIR)$(mandir)/man3/bn_set_low.3" -rm -f "$(DESTDIR)$(mandir)/man3/bn_set_max.3" @@ -4159,6 +4876,8 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_SIG.3" -rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAparams.3" + -rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAparams_bio.3" + -rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAparams_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_bio.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_fp.3" @@ -4168,6 +4887,8 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_SIG.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAparams.3" + -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAparams_bio.3" + -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAparams_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECPKParameters_print.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECPKParameters_print_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_dup.3" @@ -4378,6 +5099,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/i2d_X509_EXTENSIONS.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_ENTRY_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_dup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_get0_der.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_hash.3" -rm -f "$(DESTDIR)$(mandir)/man3/d2i_X509_NAME_ENTRY.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_X509_NAME.3" @@ -4396,118 +5118,14 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/i2d_X509_SIG.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_read_pw_string.3" -rm -f "$(DESTDIR)$(mandir)/man3/des_read_pw_string.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_add.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_by_id.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_cleanup.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_cmd_is_executable.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd_string.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_finish.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_free.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_STORE.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher_engine.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cmd_defns.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ctrl_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_destroy_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest_engine.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_finish_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_first.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_flags.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_id.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_init_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_last.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_load_privkey_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_load_pubkey_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_name.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_next.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_prev.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_table_flags.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_init.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_builtin_engines.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_cryptodev.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_dynamic.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_openssl.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_private_key.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_public_key.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_new.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_STORE.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_STORE.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_complete.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_complete.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_remove.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_STORE.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_cmd_defns.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ctrl_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_string.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_destroy_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_finish_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_flags.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_id.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_init_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_load_privkey_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_load_pubkey_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_name.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_table_flags.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_STORE.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_up_ref.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc2409_prime_1024.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc2409_prime_768.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_1536.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_2048.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_3072.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_4096.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_6144.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_8192.3" -rm -f "$(DESTDIR)$(mandir)/man3/get_rfc2409_prime_1024.3" -rm -f "$(DESTDIR)$(mandir)/man3/get_rfc2409_prime_768.3" -rm -f "$(DESTDIR)$(mandir)/man3/get_rfc3526_prime_1536.3" @@ -4554,6 +5172,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_set_dheparams.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_set_ecdhecurves.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_add_ticket_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_set_session_fd.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_set_session_lifetime.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_insecure_noverifycert.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_insecure_noverifyname.3" @@ -4561,6 +5180,8 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/tls_conn_alpn_selected.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_conn_cipher.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_conn_servername.3" + -rm -f "$(DESTDIR)$(mandir)/man3/tls_conn_session_resumed.3" + -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_cert_chain_pem.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_cert_contains_name.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_cert_hash.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_cert_issuer.3" @@ -4598,12 +5219,13 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_set_verify_depth.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_verify_client.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_verify_client_optional.3" + -rm -f "$(DESTDIR)$(mandir)/man3/tls_default_ca_cert_file.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_unload_file.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_cert_status.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_crl_reason.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_next_update.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_response_status.3" - -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_result_msg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_result.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_revocation_time.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_this_update.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_url.3" diff --git a/man/Makefile.in b/man/Makefile.in index 9caef9e4..ab509e52 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -281,18 +281,20 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = CMakeLists.txt -dist_man3_MANS = BIO_f_ssl.3 DTLSv1_listen.3 PEM_read_SSL_SESSION.3 \ - SSL_CIPHER_get_name.3 SSL_COMP_add_compression_method.3 \ +dist_man3_MANS = BIO_f_ssl.3 DTLSv1_listen.3 OPENSSL_init_ssl.3 \ + PEM_read_SSL_SESSION.3 SSL_CIPHER_get_name.3 \ + SSL_COMP_add_compression_method.3 SSL_CTX_add1_chain_cert.3 \ SSL_CTX_add_extra_chain_cert.3 SSL_CTX_add_session.3 \ SSL_CTX_ctrl.3 SSL_CTX_flush_sessions.3 SSL_CTX_free.3 \ - SSL_CTX_get_ex_new_index.3 SSL_CTX_get_verify_mode.3 \ - SSL_CTX_load_verify_locations.3 SSL_CTX_new.3 \ - SSL_CTX_sess_number.3 SSL_CTX_sess_set_cache_size.3 \ - SSL_CTX_sess_set_get_cb.3 SSL_CTX_sessions.3 \ - SSL_CTX_set1_groups.3 SSL_CTX_set_alpn_select_cb.3 \ - SSL_CTX_set_cert_store.3 SSL_CTX_set_cert_verify_callback.3 \ - SSL_CTX_set_cipher_list.3 SSL_CTX_set_client_CA_list.3 \ - SSL_CTX_set_client_cert_cb.3 SSL_CTX_set_default_passwd_cb.3 \ + SSL_CTX_get0_certificate.3 SSL_CTX_get_ex_new_index.3 \ + SSL_CTX_get_verify_mode.3 SSL_CTX_load_verify_locations.3 \ + SSL_CTX_new.3 SSL_CTX_sess_number.3 \ + SSL_CTX_sess_set_cache_size.3 SSL_CTX_sess_set_get_cb.3 \ + SSL_CTX_sessions.3 SSL_CTX_set1_groups.3 \ + SSL_CTX_set_alpn_select_cb.3 SSL_CTX_set_cert_store.3 \ + SSL_CTX_set_cert_verify_callback.3 SSL_CTX_set_cipher_list.3 \ + SSL_CTX_set_client_CA_list.3 SSL_CTX_set_client_cert_cb.3 \ + SSL_CTX_set_default_passwd_cb.3 \ SSL_CTX_set_generate_session_id.3 SSL_CTX_set_info_callback.3 \ SSL_CTX_set_max_cert_list.3 SSL_CTX_set_min_proto_version.3 \ SSL_CTX_set_mode.3 SSL_CTX_set_msg_callback.3 \ @@ -302,20 +304,22 @@ dist_man3_MANS = BIO_f_ssl.3 DTLSv1_listen.3 PEM_read_SSL_SESSION.3 \ SSL_CTX_set_timeout.3 SSL_CTX_set_tlsext_servername_callback.3 \ SSL_CTX_set_tlsext_status_cb.3 \ SSL_CTX_set_tlsext_ticket_key_cb.3 \ - SSL_CTX_set_tmp_dh_callback.3 SSL_CTX_set_tmp_rsa_callback.3 \ - SSL_CTX_set_verify.3 SSL_CTX_use_certificate.3 \ - SSL_SESSION_free.3 SSL_SESSION_get0_peer.3 \ - SSL_SESSION_get_compress_id.3 SSL_SESSION_get_ex_new_index.3 \ - SSL_SESSION_get_id.3 SSL_SESSION_get_time.3 SSL_SESSION_new.3 \ - SSL_SESSION_print.3 SSL_SESSION_set1_id_context.3 SSL_accept.3 \ + SSL_CTX_set_tlsext_use_srtp.3 SSL_CTX_set_tmp_dh_callback.3 \ + SSL_CTX_set_tmp_rsa_callback.3 SSL_CTX_set_verify.3 \ + SSL_CTX_use_certificate.3 SSL_SESSION_free.3 \ + SSL_SESSION_get0_peer.3 SSL_SESSION_get_compress_id.3 \ + SSL_SESSION_get_ex_new_index.3 SSL_SESSION_get_id.3 \ + SSL_SESSION_get_protocol_version.3 SSL_SESSION_get_time.3 \ + SSL_SESSION_has_ticket.3 SSL_SESSION_new.3 SSL_SESSION_print.3 \ + SSL_SESSION_set1_id_context.3 SSL_accept.3 \ SSL_alert_type_string.3 SSL_clear.3 SSL_connect.3 \ SSL_copy_session_id.3 SSL_do_handshake.3 SSL_dup.3 \ SSL_dup_CA_list.3 SSL_export_keying_material.3 SSL_free.3 \ SSL_get_SSL_CTX.3 SSL_get_certificate.3 SSL_get_ciphers.3 \ - SSL_get_client_CA_list.3 SSL_get_current_cipher.3 \ - SSL_get_default_timeout.3 SSL_get_error.3 \ - SSL_get_ex_data_X509_STORE_CTX_idx.3 SSL_get_ex_new_index.3 \ - SSL_get_fd.3 SSL_get_peer_cert_chain.3 \ + SSL_get_client_CA_list.3 SSL_get_client_random.3 \ + SSL_get_current_cipher.3 SSL_get_default_timeout.3 \ + SSL_get_error.3 SSL_get_ex_data_X509_STORE_CTX_idx.3 \ + SSL_get_ex_new_index.3 SSL_get_fd.3 SSL_get_peer_cert_chain.3 \ SSL_get_peer_certificate.3 SSL_get_rbio.3 \ SSL_get_server_tmp_key.3 SSL_get_session.3 \ SSL_get_shared_ciphers.3 SSL_get_state.3 \ @@ -328,13 +332,14 @@ dist_man3_MANS = BIO_f_ssl.3 DTLSv1_listen.3 PEM_read_SSL_SESSION.3 \ SSL_set_shutdown.3 SSL_set_tmp_ecdh.3 SSL_set_verify_result.3 \ SSL_shutdown.3 SSL_state_string.3 SSL_want.3 SSL_write.3 \ d2i_SSL_SESSION.3 ssl.3 ACCESS_DESCRIPTION_new.3 \ - ASN1_OBJECT_new.3 ASN1_STRING_TABLE_add.3 ASN1_STRING_length.3 \ - ASN1_STRING_new.3 ASN1_STRING_print_ex.3 ASN1_TIME_set.3 \ - ASN1_TYPE_get.3 ASN1_generate_nconf.3 ASN1_item_d2i.3 \ - ASN1_item_new.3 ASN1_time_parse.3 AUTHORITY_KEYID_new.3 \ - BASIC_CONSTRAINTS_new.3 BF_set_key.3 BIO_ctrl.3 BIO_f_base64.3 \ - BIO_f_buffer.3 BIO_f_cipher.3 BIO_f_md.3 BIO_f_null.3 \ - BIO_find_type.3 BIO_get_ex_new_index.3 BIO_new.3 BIO_printf.3 \ + ASN1_INTEGER_get.3 ASN1_OBJECT_new.3 ASN1_STRING_TABLE_add.3 \ + ASN1_STRING_length.3 ASN1_STRING_new.3 ASN1_STRING_print_ex.3 \ + ASN1_TIME_set.3 ASN1_TYPE_get.3 ASN1_generate_nconf.3 \ + ASN1_item_d2i.3 ASN1_item_new.3 ASN1_time_parse.3 \ + AUTHORITY_KEYID_new.3 BASIC_CONSTRAINTS_new.3 BF_set_key.3 \ + BIO_ctrl.3 BIO_f_base64.3 BIO_f_buffer.3 BIO_f_cipher.3 \ + BIO_f_md.3 BIO_f_null.3 BIO_find_type.3 BIO_get_data.3 \ + BIO_get_ex_new_index.3 BIO_meth_new.3 BIO_new.3 BIO_printf.3 \ BIO_push.3 BIO_read.3 BIO_s_accept.3 BIO_s_bio.3 \ BIO_s_connect.3 BIO_s_fd.3 BIO_s_file.3 BIO_s_mem.3 \ BIO_s_null.3 BIO_s_socket.3 BIO_set_callback.3 \ @@ -346,50 +351,57 @@ dist_man3_MANS = BIO_f_ssl.3 DTLSv1_listen.3 PEM_read_SSL_SESSION.3 \ BN_set_bit.3 BN_set_flags.3 BN_set_negative.3 BN_swap.3 \ BN_zero.3 BUF_MEM_new.3 CONF_modules_free.3 \ CONF_modules_load_file.3 CRYPTO_get_mem_functions.3 \ - CRYPTO_set_ex_data.3 CRYPTO_set_locking_callback.3 \ - DES_set_key.3 DH_generate_key.3 DH_generate_parameters.3 \ + CRYPTO_lock.3 CRYPTO_set_ex_data.3 DES_set_key.3 \ + DH_generate_key.3 DH_generate_parameters.3 DH_get0_pqg.3 \ DH_get_ex_new_index.3 DH_new.3 DH_set_method.3 DH_size.3 \ DIST_POINT_new.3 DSA_SIG_new.3 DSA_do_sign.3 DSA_dup_DH.3 \ - DSA_generate_key.3 DSA_generate_parameters.3 \ - DSA_get_ex_new_index.3 DSA_new.3 DSA_set_method.3 DSA_sign.3 \ - DSA_size.3 ECDSA_SIG_new.3 EC_GFp_simple_method.3 \ - EC_GROUP_copy.3 EC_GROUP_new.3 EC_KEY_new.3 EC_POINT_add.3 \ - EC_POINT_new.3 ERR.3 ERR_GET_LIB.3 ERR_asprintf_error_data.3 \ - ERR_clear_error.3 ERR_error_string.3 ERR_get_error.3 \ - ERR_load_crypto_strings.3 ERR_load_strings.3 \ + DSA_generate_key.3 DSA_generate_parameters.3 DSA_get0_pqg.3 \ + DSA_get_ex_new_index.3 DSA_meth_new.3 DSA_new.3 \ + DSA_set_method.3 DSA_sign.3 DSA_size.3 ECDSA_SIG_new.3 \ + EC_GFp_simple_method.3 EC_GROUP_copy.3 EC_GROUP_new.3 \ + EC_KEY_new.3 EC_POINT_add.3 EC_POINT_new.3 ENGINE_add.3 \ + ENGINE_ctrl.3 ENGINE_get_default_RSA.3 ENGINE_init.3 \ + ENGINE_new.3 ENGINE_register_RSA.3 ENGINE_register_all_RSA.3 \ + ENGINE_set_RSA.3 ENGINE_set_default.3 ENGINE_set_flags.3 \ + ENGINE_unregister_RSA.3 ERR.3 ERR_GET_LIB.3 \ + ERR_asprintf_error_data.3 ERR_clear_error.3 ERR_error_string.3 \ + ERR_get_error.3 ERR_load_crypto_strings.3 ERR_load_strings.3 \ ERR_print_errors.3 ERR_put_error.3 ERR_remove_state.3 \ ERR_set_mark.3 ESS_SIGNING_CERT_new.3 EVP_AEAD_CTX_init.3 \ EVP_BytesToKey.3 EVP_DigestInit.3 EVP_DigestSignInit.3 \ EVP_DigestVerifyInit.3 EVP_EncodeInit.3 EVP_EncryptInit.3 \ EVP_OpenInit.3 EVP_PKEY_CTX_ctrl.3 EVP_PKEY_CTX_new.3 \ - EVP_PKEY_cmp.3 EVP_PKEY_decrypt.3 EVP_PKEY_derive.3 \ - EVP_PKEY_encrypt.3 EVP_PKEY_get_default_digest_nid.3 \ - EVP_PKEY_keygen.3 EVP_PKEY_meth_get0_info.3 EVP_PKEY_new.3 \ + EVP_PKEY_asn1_get_count.3 EVP_PKEY_asn1_new.3 EVP_PKEY_cmp.3 \ + EVP_PKEY_decrypt.3 EVP_PKEY_derive.3 EVP_PKEY_encrypt.3 \ + EVP_PKEY_get_default_digest_nid.3 EVP_PKEY_keygen.3 \ + EVP_PKEY_meth_get0_info.3 EVP_PKEY_meth_new.3 EVP_PKEY_new.3 \ EVP_PKEY_print_private.3 EVP_PKEY_set1_RSA.3 EVP_PKEY_sign.3 \ EVP_PKEY_verify.3 EVP_PKEY_verify_recover.3 EVP_SealInit.3 \ - EVP_SignInit.3 EVP_VerifyInit.3 EXTENDED_KEY_USAGE_new.3 \ - GENERAL_NAME_new.3 HMAC.3 MD5.3 NAME_CONSTRAINTS_new.3 \ - OBJ_nid2obj.3 OCSP_CRLID_new.3 OCSP_REQUEST_new.3 \ - OCSP_SERVICELOC_new.3 OCSP_cert_to_id.3 \ + EVP_SignInit.3 EVP_VerifyInit.3 EVP_aes_128_cbc.3 \ + EVP_camellia_128_cbc.3 EVP_des_cbc.3 EVP_rc4.3 EVP_sm4_cbc.3 \ + EXTENDED_KEY_USAGE_new.3 GENERAL_NAME_new.3 HMAC.3 MD5.3 \ + NAME_CONSTRAINTS_new.3 OBJ_nid2obj.3 OCSP_CRLID_new.3 \ + OCSP_REQUEST_new.3 OCSP_SERVICELOC_new.3 OCSP_cert_to_id.3 \ OCSP_request_add1_nonce.3 OCSP_resp_find_status.3 \ OCSP_response_status.3 OCSP_sendreq_new.3 \ OPENSSL_VERSION_NUMBER.3 OPENSSL_cleanse.3 OPENSSL_config.3 \ - OPENSSL_load_builtin_modules.3 OPENSSL_malloc.3 \ - OpenSSL_add_all_algorithms.3 PEM_bytes_read_bio.3 PEM_read.3 \ - PEM_read_bio_PrivateKey.3 PEM_write_bio_PKCS7_stream.3 \ - PKCS12_SAFEBAG_new.3 PKCS12_create.3 PKCS12_new.3 \ - PKCS12_newpass.3 PKCS12_parse.3 PKCS5_PBKDF2_HMAC.3 \ - PKCS7_decrypt.3 PKCS7_encrypt.3 PKCS7_new.3 PKCS7_sign.3 \ - PKCS7_sign_add_signer.3 PKCS7_verify.3 \ - PKCS8_PRIV_KEY_INFO_new.3 PKEY_USAGE_PERIOD_new.3 \ - POLICYINFO_new.3 PROXY_POLICY_new.3 RAND_add.3 RAND_bytes.3 \ - RAND_load_file.3 RAND_set_rand_method.3 RC4.3 RIPEMD160.3 \ - RSA_PSS_PARAMS_new.3 RSA_blinding_on.3 RSA_check_key.3 \ - RSA_generate_key.3 RSA_get_ex_new_index.3 RSA_new.3 \ + OPENSSL_init_crypto.3 OPENSSL_load_builtin_modules.3 \ + OPENSSL_malloc.3 OPENSSL_sk_new.3 OpenSSL_add_all_algorithms.3 \ + PEM_bytes_read_bio.3 PEM_read.3 PEM_read_bio_PrivateKey.3 \ + PEM_write_bio_PKCS7_stream.3 PKCS12_SAFEBAG_new.3 \ + PKCS12_create.3 PKCS12_new.3 PKCS12_newpass.3 PKCS12_parse.3 \ + PKCS5_PBKDF2_HMAC.3 PKCS7_decrypt.3 PKCS7_encrypt.3 \ + PKCS7_new.3 PKCS7_sign.3 PKCS7_sign_add_signer.3 \ + PKCS7_verify.3 PKCS8_PRIV_KEY_INFO_new.3 \ + PKEY_USAGE_PERIOD_new.3 POLICYINFO_new.3 PROXY_POLICY_new.3 \ + RAND_add.3 RAND_bytes.3 RAND_load_file.3 \ + RAND_set_rand_method.3 RC4.3 RIPEMD160.3 RSA_PSS_PARAMS_new.3 \ + RSA_blinding_on.3 RSA_check_key.3 RSA_generate_key.3 \ + RSA_get0_key.3 RSA_get_ex_new_index.3 RSA_meth_new.3 RSA_new.3 \ RSA_padding_add_PKCS1_type_1.3 RSA_print.3 \ RSA_private_encrypt.3 RSA_public_encrypt.3 RSA_set_method.3 \ RSA_sign.3 RSA_sign_ASN1_OCTET_STRING.3 RSA_size.3 SHA1.3 \ - SMIME_read_PKCS7.3 SMIME_write_PKCS7.3 SXNET_new.3 \ + SMIME_read_PKCS7.3 SMIME_write_PKCS7.3 STACK_OF.3 SXNET_new.3 \ TS_REQ_new.3 UI_UTIL_read_pw.3 UI_create_method.3 \ UI_get_string_type.3 UI_new.3 X25519.3 X509V3_get_d2i.3 \ X509_ALGOR_dup.3 X509_ATTRIBUTE_new.3 X509_CINF_new.3 \ @@ -397,14 +409,16 @@ dist_man3_MANS = BIO_f_ssl.3 DTLSv1_listen.3 PEM_read_SSL_SESSION.3 \ X509_EXTENSION_set_object.3 X509_LOOKUP_hash_dir.3 \ X509_NAME_ENTRY_get_object.3 X509_NAME_add_entry_by_txt.3 \ X509_NAME_get_index_by_NID.3 X509_NAME_new.3 \ - X509_NAME_print_ex.3 X509_PUBKEY_new.3 X509_REQ_new.3 \ - X509_REVOKED_new.3 X509_SIG_new.3 X509_STORE_CTX_get_error.3 \ - X509_STORE_CTX_get_ex_new_index.3 X509_STORE_CTX_new.3 \ - X509_STORE_CTX_set_verify_cb.3 X509_STORE_load_locations.3 \ + X509_NAME_print_ex.3 X509_OBJECT_get0_X509.3 X509_PUBKEY_new.3 \ + X509_REQ_new.3 X509_REVOKED_new.3 X509_SIG_new.3 \ + X509_STORE_CTX_get_error.3 X509_STORE_CTX_get_ex_new_index.3 \ + X509_STORE_CTX_new.3 X509_STORE_CTX_set_verify_cb.3 \ + X509_STORE_load_locations.3 X509_STORE_new.3 \ X509_STORE_set1_param.3 X509_STORE_set_verify_cb_func.3 \ X509_VERIFY_PARAM_set_flags.3 X509_check_ca.3 \ X509_check_host.3 X509_check_issued.3 X509_check_private_key.3 \ - X509_cmp_time.3 X509_digest.3 X509_get_pubkey.3 \ + X509_cmp_time.3 X509_digest.3 X509_get0_notBefore.3 \ + X509_get0_signature.3 X509_get_pubkey.3 \ X509_get_serialNumber.3 X509_get_subject_name.3 \ X509_get_version.3 X509_new.3 X509_sign.3 X509_verify_cert.3 \ X509v3_get_ext_by_NID.3 bn_dump.3 crypto.3 d2i_ASN1_NULL.3 \ @@ -419,8 +433,8 @@ dist_man3_MANS = BIO_f_ssl.3 DTLSv1_listen.3 PEM_read_SSL_SESSION.3 \ d2i_RSAPublicKey.3 d2i_TS_REQ.3 d2i_X509.3 d2i_X509_ALGOR.3 \ d2i_X509_ATTRIBUTE.3 d2i_X509_CRL.3 d2i_X509_EXTENSION.3 \ d2i_X509_NAME.3 d2i_X509_REQ.3 d2i_X509_SIG.3 des_read_pw.3 \ - engine.3 evp.3 get_rfc3526_prime_8192.3 i2d_PKCS7_bio_stream.3 \ - lh_new.3 lh_stats.3 tls_accept_socket.3 tls_client.3 \ + evp.3 get_rfc3526_prime_8192.3 i2d_PKCS7_bio_stream.3 lh_new.3 \ + lh_stats.3 tls_accept_socket.3 tls_client.3 \ tls_config_ocsp_require_stapling.3 tls_config_set_protocols.3 \ tls_config_set_session_id.3 tls_config_verify.3 \ tls_conn_version.3 tls_connect.3 tls_init.3 tls_load_file.3 \ @@ -446,8 +460,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -553,7 +567,10 @@ ctags CTAGS: cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -711,12 +728,20 @@ install-data-hook: ln -sf "ACCESS_DESCRIPTION_new.3" "$(DESTDIR)$(mandir)/man3/ACCESS_DESCRIPTION_free.3" ln -sf "ACCESS_DESCRIPTION_new.3" "$(DESTDIR)$(mandir)/man3/AUTHORITY_INFO_ACCESS_free.3" ln -sf "ACCESS_DESCRIPTION_new.3" "$(DESTDIR)$(mandir)/man3/AUTHORITY_INFO_ACCESS_new.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_get.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_set.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_to_BN.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/ASN1_INTEGER_set.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/ASN1_INTEGER_to_BN.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/BN_to_ASN1_ENUMERATED.3" + ln -sf "ASN1_INTEGER_get.3" "$(DESTDIR)$(mandir)/man3/BN_to_ASN1_INTEGER.3" ln -sf "ASN1_OBJECT_new.3" "$(DESTDIR)$(mandir)/man3/ASN1_OBJECT_free.3" ln -sf "ASN1_STRING_TABLE_add.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_TABLE_cleanup.3" ln -sf "ASN1_STRING_TABLE_add.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_TABLE_get.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_cmp.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_data.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_dup.3" + ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_get0_data.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_length_set.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_set.3" ln -sf "ASN1_STRING_length.3" "$(DESTDIR)$(mandir)/man3/ASN1_STRING_to_UTF8.3" @@ -847,6 +872,10 @@ install-data-hook: ln -sf "BIO_f_ssl.3" "$(DESTDIR)$(mandir)/man3/BIO_ssl_shutdown.3" ln -sf "BIO_find_type.3" "$(DESTDIR)$(mandir)/man3/BIO_method_type.3" ln -sf "BIO_find_type.3" "$(DESTDIR)$(mandir)/man3/BIO_next.3" + ln -sf "BIO_get_data.3" "$(DESTDIR)$(mandir)/man3/BIO_get_shutdown.3" + ln -sf "BIO_get_data.3" "$(DESTDIR)$(mandir)/man3/BIO_set_data.3" + ln -sf "BIO_get_data.3" "$(DESTDIR)$(mandir)/man3/BIO_set_init.3" + ln -sf "BIO_get_data.3" "$(DESTDIR)$(mandir)/man3/BIO_set_shutdown.3" ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/BIO_get_ex_data.3" ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/BIO_set_ex_data.3" ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/ECDH_get_ex_data.3" @@ -867,9 +896,28 @@ install-data-hook: ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/X509_get_ex_data.3" ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/X509_get_ex_new_index.3" ln -sf "BIO_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/X509_set_ex_data.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_get_new_index.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_free.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_callback_ctrl.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_create.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_ctrl.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_destroy.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_gets.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_puts.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_read.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_get_write.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_callback_ctrl.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_create.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_ctrl.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_destroy.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_gets.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_puts.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_read.3" + ln -sf "BIO_meth_new.3" "$(DESTDIR)$(mandir)/man3/BIO_meth_set_write.3" ln -sf "BIO_new.3" "$(DESTDIR)$(mandir)/man3/BIO_free.3" ln -sf "BIO_new.3" "$(DESTDIR)$(mandir)/man3/BIO_free_all.3" ln -sf "BIO_new.3" "$(DESTDIR)$(mandir)/man3/BIO_set.3" + ln -sf "BIO_new.3" "$(DESTDIR)$(mandir)/man3/BIO_up_ref.3" ln -sf "BIO_new.3" "$(DESTDIR)$(mandir)/man3/BIO_vfree.3" ln -sf "BIO_printf.3" "$(DESTDIR)$(mandir)/man3/BIO_snprintf.3" ln -sf "BIO_printf.3" "$(DESTDIR)$(mandir)/man3/BIO_vprintf.3" @@ -987,6 +1035,9 @@ install-data-hook: ln -sf "BN_copy.3" "$(DESTDIR)$(mandir)/man3/BN_dup.3" ln -sf "BN_copy.3" "$(DESTDIR)$(mandir)/man3/BN_with_flags.3" ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_call.3" + ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_free.3" + ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_get_arg.3" + ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_new.3" ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_set.3" ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_GENCB_set_old.3" ln -sf "BN_generate_prime.3" "$(DESTDIR)$(mandir)/man3/BN_generate_prime_ex.3" @@ -1046,6 +1097,15 @@ install-data-hook: ln -sf "CRYPTO_get_mem_functions.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_mem_leaks_cb.3" ln -sf "CRYPTO_get_mem_functions.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_mem_leaks_fp.3" ln -sf "CRYPTO_get_mem_functions.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_set_mem_functions.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_cmp.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_cpy.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_current.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_hash.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_add.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_r_lock.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_r_unlock.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_w_lock.3" + ln -sf "CRYPTO_lock.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_w_unlock.3" ln -sf "CRYPTO_set_ex_data.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_dup.3" ln -sf "CRYPTO_set_ex_data.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_free.3" ln -sf "CRYPTO_set_ex_data.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_new.3" @@ -1107,13 +1167,23 @@ install-data-hook: ln -sf "DH_generate_key.3" "$(DESTDIR)$(mandir)/man3/DH_compute_key.3" ln -sf "DH_generate_parameters.3" "$(DESTDIR)$(mandir)/man3/DH_check.3" ln -sf "DH_generate_parameters.3" "$(DESTDIR)$(mandir)/man3/DH_generate_parameters_ex.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_clear_flags.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_get0_engine.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_get0_key.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_set0_key.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_set0_pqg.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_set_flags.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_set_length.3" + ln -sf "DH_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DH_test_flags.3" ln -sf "DH_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/DH_get_ex_data.3" ln -sf "DH_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/DH_set_ex_data.3" ln -sf "DH_new.3" "$(DESTDIR)$(mandir)/man3/DH_free.3" + ln -sf "DH_new.3" "$(DESTDIR)$(mandir)/man3/DH_up_ref.3" ln -sf "DH_set_method.3" "$(DESTDIR)$(mandir)/man3/DH_OpenSSL.3" ln -sf "DH_set_method.3" "$(DESTDIR)$(mandir)/man3/DH_get_default_method.3" ln -sf "DH_set_method.3" "$(DESTDIR)$(mandir)/man3/DH_new_method.3" ln -sf "DH_set_method.3" "$(DESTDIR)$(mandir)/man3/DH_set_default_method.3" + ln -sf "DH_size.3" "$(DESTDIR)$(mandir)/man3/DH_bits.3" ln -sf "DIST_POINT_new.3" "$(DESTDIR)$(mandir)/man3/CRL_DIST_POINTS_free.3" ln -sf "DIST_POINT_new.3" "$(DESTDIR)$(mandir)/man3/CRL_DIST_POINTS_new.3" ln -sf "DIST_POINT_new.3" "$(DESTDIR)$(mandir)/man3/DIST_POINT_NAME_free.3" @@ -1122,11 +1192,25 @@ install-data-hook: ln -sf "DIST_POINT_new.3" "$(DESTDIR)$(mandir)/man3/ISSUING_DIST_POINT_free.3" ln -sf "DIST_POINT_new.3" "$(DESTDIR)$(mandir)/man3/ISSUING_DIST_POINT_new.3" ln -sf "DSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/DSA_SIG_free.3" + ln -sf "DSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/DSA_SIG_get0.3" + ln -sf "DSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/DSA_SIG_set0.3" ln -sf "DSA_do_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_do_verify.3" ln -sf "DSA_generate_parameters.3" "$(DESTDIR)$(mandir)/man3/DSA_generate_parameters_ex.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_clear_flags.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_get0_engine.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_get0_key.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_set0_key.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_set0_pqg.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_set_flags.3" + ln -sf "DSA_get0_pqg.3" "$(DESTDIR)$(mandir)/man3/DSA_test_flags.3" ln -sf "DSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/DSA_get_ex_data.3" ln -sf "DSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/DSA_set_ex_data.3" + ln -sf "DSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/DSA_meth_dup.3" + ln -sf "DSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/DSA_meth_free.3" + ln -sf "DSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/DSA_meth_set_finish.3" + ln -sf "DSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/DSA_meth_set_sign.3" ln -sf "DSA_new.3" "$(DESTDIR)$(mandir)/man3/DSA_free.3" + ln -sf "DSA_new.3" "$(DESTDIR)$(mandir)/man3/DSA_up_ref.3" ln -sf "DSA_set_method.3" "$(DESTDIR)$(mandir)/man3/DSA_OpenSSL.3" ln -sf "DSA_set_method.3" "$(DESTDIR)$(mandir)/man3/DSA_get_default_method.3" ln -sf "DSA_set_method.3" "$(DESTDIR)$(mandir)/man3/DSA_new_method.3" @@ -1135,6 +1219,8 @@ install-data-hook: ln -sf "DSA_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_verify.3" ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3" ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_free.3" + ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_get0.3" + ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_set0.3" ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_do_sign.3" ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_do_sign_ex.3" ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_do_verify.3" @@ -1245,6 +1331,104 @@ install-data-hook: ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_compressed_coordinates_GF2m.3" ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_compressed_coordinates_GFp.3" ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_to_infinity.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_by_id.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_cleanup.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_first.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_id.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_last.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_name.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_next.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_prev.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_remove.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_id.3" + ln -sf "ENGINE_add.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_name.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_CTRL_FUNC_PTR.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_cmd_is_executable.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd_string.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cmd_defns.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ctrl_function.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_cmd_defns.3" + ln -sf "ENGINE_ctrl.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ctrl_function.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher_engine.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DH.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DSA.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDH.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDSA.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RAND.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest_engine.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_table_flags.3" + ln -sf "ENGINE_get_default_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_table_flags.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_GEN_INT_FUNC_PTR.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_finish.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_finish_function.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_init_function.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_finish_function.3" + ln -sf "ENGINE_init.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_init_function.3" + ln -sf "ENGINE_new.3" "$(DESTDIR)$(mandir)/man3/ENGINE_GEN_INT_FUNC_PTR.3" + ln -sf "ENGINE_new.3" "$(DESTDIR)$(mandir)/man3/ENGINE_free.3" + ln -sf "ENGINE_new.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_destroy_function.3" + ln -sf "ENGINE_new.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_destroy_function.3" + ln -sf "ENGINE_new.3" "$(DESTDIR)$(mandir)/man3/ENGINE_up_ref.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_DH.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_DSA.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDH.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDSA.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_RAND.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_STORE.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ciphers.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_complete.3" + ln -sf "ENGINE_register_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_digests.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_builtin_engines.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_dynamic.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DH.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DSA.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDH.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDSA.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RAND.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_STORE.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ciphers.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_complete.3" + ln -sf "ENGINE_register_all_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_digests.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_CIPHERS_PTR.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_DIGESTS_PTR.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_DH.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_DSA.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDH.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDSA.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_RAND.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_RSA.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_STORE.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ciphers.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digests.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_DH.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_DSA.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDH.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDSA.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_RAND.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_STORE.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ciphers.3" + ln -sf "ENGINE_set_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_digests.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DH.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DSA.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDH.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDSA.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RAND.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RSA.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ciphers.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_digests.3" + ln -sf "ENGINE_set_default.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_string.3" + ln -sf "ENGINE_set_flags.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_flags.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DH.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DSA.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDH.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDSA.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RAND.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_STORE.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ciphers.3" + ln -sf "ENGINE_unregister_RSA.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_digests.3" ln -sf "ERR_GET_LIB.3" "$(DESTDIR)$(mandir)/man3/ERR_FATAL_ERROR.3" ln -sf "ERR_GET_LIB.3" "$(DESTDIR)$(mandir)/man3/ERR_GET_FUNC.3" ln -sf "ERR_GET_LIB.3" "$(DESTDIR)$(mandir)/man3/ERR_GET_REASON.3" @@ -1285,7 +1469,9 @@ install-data-hook: ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_AEAD_nonce_length.3" ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_aead_aes_128_gcm.3" ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_aead_aes_256_gcm.3" + ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_aead_chacha20_poly1305" ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_aead_chacha20_poly1305.3" + ln -sf "EVP_AEAD_CTX_init.3" "$(DESTDIR)$(mandir)/man3/EVP_aead_xchacha20_poly1305.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DigestFinal.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DigestFinal_ex.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DigestInit_ex.3" @@ -1298,8 +1484,11 @@ install-data-hook: ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_create.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_ctrl.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_destroy.3" + ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_free.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_init.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_md.3" + ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_new.3" + ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_reset.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_size.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_type.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_MD_block_size.3" @@ -1311,7 +1500,6 @@ install-data-hook: ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_get_digestbyname.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_get_digestbynid.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_get_digestbyobj.3" - ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_md2.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_md5.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_md5_sha1.3" ln -sf "EVP_DigestInit.3" "$(DESTDIR)$(mandir)/man3/EVP_md_null.3" @@ -1329,25 +1517,34 @@ install-data-hook: ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DecodeFinal.3" ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DecodeInit.3" ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_DecodeUpdate.3" + ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_ENCODE_CTX_free.3" + ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_ENCODE_CTX_new.3" ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncodeBlock.3" ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncodeFinal.3" ln -sf "EVP_EncodeInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncodeUpdate.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_block_size.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_cipher.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_cleanup.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_clear_flags.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_ctrl.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_flags.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_free.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_get_app_data.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_get_iv.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_init.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_iv_length.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_key_length.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_mode.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_new.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_nid.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_rand_key.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_reset.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_app_data.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_flags.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_iv.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_key_length.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_padding.3" + ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_test_flags.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_type.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_asn1_to_param.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_block_size.3" @@ -1372,26 +1569,6 @@ install-data-hook: ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncryptFinal_ex.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncryptInit_ex.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_EncryptUpdate.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc_hmac_sha1.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ccm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ecb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_gcm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ofb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cbc.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ccm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ecb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_gcm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ofb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc_hmac_sha1.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ccm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ecb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_gcm.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ofb.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_bf_cbc.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_bf_cfb.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_bf_ecb.3" @@ -1431,25 +1608,39 @@ install-data-hook: ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc4.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc4_40.3" ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc4_hmac_md5.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_cbc.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_cfb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_ecb.3" - ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_ofb.3" ln -sf "EVP_OpenInit.3" "$(DESTDIR)$(mandir)/man3/EVP_OpenFinal.3" ln -sf "EVP_OpenInit.3" "$(DESTDIR)$(mandir)/man3/EVP_OpenUpdate.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_ctrl_str.3" + ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_mgf1_md.3" + ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_padding.3" + ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_pss_saltlen.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dh_paramgen_generator.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dh_paramgen_prime_len.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dsa_paramgen_bits.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_ec_paramgen_curve_nid.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_keygen_bits.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_keygen_pubexp.3" + ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_mgf1_md.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_padding.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_pss_saltlen.3" ln -sf "EVP_PKEY_CTX_ctrl.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_signature_md.3" ln -sf "EVP_PKEY_CTX_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_dup.3" ln -sf "EVP_PKEY_CTX_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_free.3" ln -sf "EVP_PKEY_CTX_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_new_id.3" + ln -sf "EVP_PKEY_asn1_get_count.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_find.3" + ln -sf "EVP_PKEY_asn1_get_count.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_find_str.3" + ln -sf "EVP_PKEY_asn1_get_count.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_get0.3" + ln -sf "EVP_PKEY_asn1_get_count.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_get0_info.3" + ln -sf "EVP_PKEY_asn1_get_count.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_asn1.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_add0.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_add_alias.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_copy.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_free.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_ctrl.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_free.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_param.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_private.3" + ln -sf "EVP_PKEY_asn1_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_public.3" ln -sf "EVP_PKEY_cmp.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_cmp_parameters.3" ln -sf "EVP_PKEY_cmp.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_copy_parameters.3" ln -sf "EVP_PKEY_cmp.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_missing_parameters.3" @@ -1466,7 +1657,27 @@ install-data-hook: ln -sf "EVP_PKEY_keygen.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_keygen_init.3" ln -sf "EVP_PKEY_keygen.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_paramgen.3" ln -sf "EVP_PKEY_keygen.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_paramgen_init.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_add0.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_copy.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_find.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_free.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_cleanup.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_copy.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_ctrl.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_decrypt.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_derive.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_encrypt.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_init.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_keygen.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_paramgen.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_sign.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_signctx.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verify.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verify_recover.3" + ln -sf "EVP_PKEY_meth_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verifyctx.3" ln -sf "EVP_PKEY_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_free.3" + ln -sf "EVP_PKEY_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_new_mac_key.3" + ln -sf "EVP_PKEY_new.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_up_ref.3" ln -sf "EVP_PKEY_print_private.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_print_params.3" ln -sf "EVP_PKEY_print_private.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_print_public.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_DH.3" @@ -1474,6 +1685,11 @@ install-data-hook: ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_EC_KEY.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_RSA.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_base_id.3" + ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_DH.3" + ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_DSA.3" + ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_EC_KEY.3" + ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_RSA.3" + ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_hmac.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_DH.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_DSA.3" ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_EC_KEY.3" @@ -1488,6 +1704,7 @@ install-data-hook: ln -sf "EVP_PKEY_verify_recover.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_recover_init.3" ln -sf "EVP_SealInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SealFinal.3" ln -sf "EVP_SealInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SealUpdate.3" + ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_bits.3" ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_size.3" ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SignFinal.3" ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SignInit_ex.3" @@ -1495,6 +1712,47 @@ install-data-hook: ln -sf "EVP_VerifyInit.3" "$(DESTDIR)$(mandir)/man3/EVP_VerifyFinal.3" ln -sf "EVP_VerifyInit.3" "$(DESTDIR)$(mandir)/man3/EVP_VerifyInit_ex.3" ln -sf "EVP_VerifyInit.3" "$(DESTDIR)$(mandir)/man3/EVP_VerifyUpdate.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc_hmac_sha1.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ccm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb1.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb128.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb8.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ctr.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ecb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_gcm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ofb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_wrap.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_128_xts.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cbc.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ccm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb1.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb128.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb8.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ctr.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ecb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_gcm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ofb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_192_wrap.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc_hmac_sha1.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ccm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb1.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb128.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb8.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ctr.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ecb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_gcm.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ofb.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_wrap.3" + ln -sf "EVP_aes_128_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_aes_256_xts.3" + ln -sf "EVP_sm4_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_sm4_cfb.3" + ln -sf "EVP_sm4_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_sm4_cfb128.3" + ln -sf "EVP_sm4_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_sm4_ctr.3" + ln -sf "EVP_sm4_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_sm4_ecb.3" + ln -sf "EVP_sm4_cbc.3" "$(DESTDIR)$(mandir)/man3/EVP_sm4_ofb.3" ln -sf "EXTENDED_KEY_USAGE_new.3" "$(DESTDIR)$(mandir)/man3/EXTENDED_KEY_USAGE_free.3" ln -sf "GENERAL_NAME_new.3" "$(DESTDIR)$(mandir)/man3/EDIPARTYNAME_free.3" ln -sf "GENERAL_NAME_new.3" "$(DESTDIR)$(mandir)/man3/EDIPARTYNAME_new.3" @@ -1505,7 +1763,11 @@ install-data-hook: ln -sf "GENERAL_NAME_new.3" "$(DESTDIR)$(mandir)/man3/OTHERNAME_new.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_cleanup.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_copy.3" + ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_free.3" + ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_get_md.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_init.3" + ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_new.3" + ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_reset.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_CTX_set_flags.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_Final.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_Init.3" @@ -1513,10 +1775,6 @@ install-data-hook: ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_Update.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_cleanup.3" ln -sf "HMAC.3" "$(DESTDIR)$(mandir)/man3/HMAC_size.3" - ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD2.3" - ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD2_Final.3" - ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD2_Init.3" - ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD2_Update.3" ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD4.3" ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD4_Final.3" ln -sf "MD5.3" "$(DESTDIR)$(mandir)/man3/MD4_Init.3" @@ -1541,7 +1799,6 @@ install-data-hook: ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_txt2obj.3" ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/i2t_ASN1_OBJECT.3" ln -sf "OCSP_CRLID_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_CRLID_free.3" - ln -sf "OCSP_CRLID_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_crlID_new.3" ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_ONEREQ_free.3" ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_ONEREQ_new.3" ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_free.3" @@ -1570,7 +1827,9 @@ install-data-hook: ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_REVOKEDINFO_free.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_REVOKEDINFO_new.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_free.3" + ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_get0_id.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_new.3" + ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_basic_verify.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_check_validity.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_resp_count.3" ln -sf "OCSP_resp_find_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_resp_find.3" @@ -1586,6 +1845,7 @@ install-data-hook: ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_RESPID_new.3" ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_RESPONSE_free.3" ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_RESPONSE_new.3" + ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_basic_sign.3" ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_response_create.3" ln -sf "OCSP_response_status.3" "$(DESTDIR)$(mandir)/man3/OCSP_response_get1_basic.3" ln -sf "OCSP_sendreq_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQ_CTX_add1_header.3" @@ -1593,6 +1853,11 @@ install-data-hook: ln -sf "OCSP_sendreq_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQ_CTX_set1_req.3" ln -sf "OCSP_sendreq_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_sendreq_bio.3" ln -sf "OCSP_sendreq_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_sendreq_nbio.3" + ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/LIBRESSL_VERSION_NUMBER.3" + ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/LIBRESSL_VERSION_TEXT.3" + ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/OPENSSL_VERSION_TEXT.3" + ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/OpenSSL_version.3" + ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/OpenSSL_version_num.3" ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/SSLeay.3" ln -sf "OPENSSL_VERSION_NUMBER.3" "$(DESTDIR)$(mandir)/man3/SSLeay_version.3" ln -sf "OPENSSL_config.3" "$(DESTDIR)$(mandir)/man3/OPENSSL_no_config.3" @@ -1605,6 +1870,27 @@ install-data-hook: ln -sf "OPENSSL_malloc.3" "$(DESTDIR)$(mandir)/man3/OPENSSL_free.3" ln -sf "OPENSSL_malloc.3" "$(DESTDIR)$(mandir)/man3/OPENSSL_realloc.3" ln -sf "OPENSSL_malloc.3" "$(DESTDIR)$(mandir)/man3/OPENSSL_strdup.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_delete.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_delete_ptr.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_dup.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_find.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_find_ex.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_free.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_insert.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_is_sorted.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_new.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_new_null.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_num.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_pop.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_pop_free.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_push.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_set.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_set_cmp_func.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_shift.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_sort.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_unshift.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_value.3" + ln -sf "OPENSSL_sk_new.3" "$(DESTDIR)$(mandir)/man3/sk_zero.3" ln -sf "OpenSSL_add_all_algorithms.3" "$(DESTDIR)$(mandir)/man3/EVP_cleanup.3" ln -sf "OpenSSL_add_all_algorithms.3" "$(DESTDIR)$(mandir)/man3/OpenSSL_add_all_ciphers.3" ln -sf "OpenSSL_add_all_algorithms.3" "$(DESTDIR)$(mandir)/man3/OpenSSL_add_all_digests.3" @@ -1747,6 +2033,7 @@ install-data-hook: ln -sf "PROXY_POLICY_new.3" "$(DESTDIR)$(mandir)/man3/PROXY_CERT_INFO_EXTENSION_new.3" ln -sf "PROXY_POLICY_new.3" "$(DESTDIR)$(mandir)/man3/PROXY_POLICY_free.3" ln -sf "RAND_add.3" "$(DESTDIR)$(mandir)/man3/RAND_cleanup.3" + ln -sf "RAND_add.3" "$(DESTDIR)$(mandir)/man3/RAND_poll.3" ln -sf "RAND_add.3" "$(DESTDIR)$(mandir)/man3/RAND_seed.3" ln -sf "RAND_add.3" "$(DESTDIR)$(mandir)/man3/RAND_status.3" ln -sf "RAND_bytes.3" "$(DESTDIR)$(mandir)/man3/RAND_pseudo_bytes.3" @@ -1761,12 +2048,28 @@ install-data-hook: ln -sf "RSA_PSS_PARAMS_new.3" "$(DESTDIR)$(mandir)/man3/RSA_PSS_PARAMS_free.3" ln -sf "RSA_blinding_on.3" "$(DESTDIR)$(mandir)/man3/RSA_blinding_off.3" ln -sf "RSA_generate_key.3" "$(DESTDIR)$(mandir)/man3/RSA_generate_key_ex.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_clear_flags.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_get0_crt_params.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_get0_factors.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_set0_crt_params.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_set0_factors.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_set0_key.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_set_flags.3" + ln -sf "RSA_get0_key.3" "$(DESTDIR)$(mandir)/man3/RSA_test_flags.3" ln -sf "RSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_dup.3" ln -sf "RSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_free.3" ln -sf "RSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_new.3" ln -sf "RSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/RSA_get_ex_data.3" ln -sf "RSA_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/RSA_set_ex_data.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_dup.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_free.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_get_finish.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_set1_name.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_set_finish.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_set_priv_dec.3" + ln -sf "RSA_meth_new.3" "$(DESTDIR)$(mandir)/man3/RSA_meth_set_priv_enc.3" ln -sf "RSA_new.3" "$(DESTDIR)$(mandir)/man3/RSA_free.3" + ln -sf "RSA_new.3" "$(DESTDIR)$(mandir)/man3/RSA_up_ref.3" ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_add_PKCS1_OAEP.3" ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_add_PKCS1_type_2.3" ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_add_none.3" @@ -1786,14 +2089,12 @@ install-data-hook: ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_PKCS1_SSLeay.3" ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_flags.3" ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_get_default_method.3" - ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_get_default_openssl_method.3" ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_get_method.3" ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_new_method.3" - ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_null_method.3" ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_set_default_method.3" - ln -sf "RSA_set_method.3" "$(DESTDIR)$(mandir)/man3/RSA_set_default_openssl_method.3" ln -sf "RSA_sign.3" "$(DESTDIR)$(mandir)/man3/RSA_verify.3" ln -sf "RSA_sign_ASN1_OCTET_STRING.3" "$(DESTDIR)$(mandir)/man3/RSA_verify_ASN1_OCTET_STRING.3" + ln -sf "RSA_size.3" "$(DESTDIR)$(mandir)/man3/RSA_bits.3" ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA1_Final.3" ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA1_Init.3" ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA1_Update.3" @@ -1814,8 +2115,14 @@ install-data-hook: ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA512_Init.3" ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA512_Update.3" ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_description.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_auth_nid.3" ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_bits.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_cipher_nid.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_digest_nid.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_id.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_kx_nid.3" ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_version.3" + ln -sf "SSL_CIPHER_get_name.3" "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_is_aead.3" ln -sf "SSL_COMP_add_compression_method.3" "$(DESTDIR)$(mandir)/man3/SSL_COMP_get_compression_methods.3" ln -sf "SSL_CTX_add_extra_chain_cert.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_clear_extra_chain_certs.3" ln -sf "SSL_CTX_add_session.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_remove_session.3" @@ -1830,9 +2137,13 @@ install-data-hook: ln -sf "SSL_CTX_get_verify_mode.3" "$(DESTDIR)$(mandir)/man3/SSL_get_verify_depth.3" ln -sf "SSL_CTX_get_verify_mode.3" "$(DESTDIR)$(mandir)/man3/SSL_get_verify_mode.3" ln -sf "SSL_CTX_load_verify_locations.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_default_verify_paths.3" + ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLS_client_method.3" + ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLS_method.3" + ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLS_server_method.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLSv1_client_method.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLSv1_method.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/DTLSv1_server_method.3" + ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_up_ref.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/SSLv23_client_method.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/SSLv23_method.3" ln -sf "SSL_CTX_new.3" "$(DESTDIR)$(mandir)/man3/SSLv23_server_method.3" @@ -1886,6 +2197,8 @@ install-data-hook: ln -sf "SSL_CTX_set_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_set_client_CA_list.3" ln -sf "SSL_CTX_set_client_cert_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_client_cert_cb.3" ln -sf "SSL_CTX_set_client_cert_cb.3" "$(DESTDIR)$(mandir)/man3/client_cert_cb.3" + ln -sf "SSL_CTX_set_default_passwd_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_default_passwd_cb.3" + ln -sf "SSL_CTX_set_default_passwd_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_default_passwd_cb_userdata.3" ln -sf "SSL_CTX_set_default_passwd_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_default_passwd_cb_userdata.3" ln -sf "SSL_CTX_set_default_passwd_cb.3" "$(DESTDIR)$(mandir)/man3/pem_password_cb.3" ln -sf "SSL_CTX_set_generate_session_id.3" "$(DESTDIR)$(mandir)/man3/GEN_SESSION_CB.3" @@ -1897,7 +2210,11 @@ install-data-hook: ln -sf "SSL_CTX_set_max_cert_list.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_max_cert_list.3" ln -sf "SSL_CTX_set_max_cert_list.3" "$(DESTDIR)$(mandir)/man3/SSL_get_max_cert_list.3" ln -sf "SSL_CTX_set_max_cert_list.3" "$(DESTDIR)$(mandir)/man3/SSL_set_max_cert_list.3" + ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_max_proto_version.3" + ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_min_proto_version.3" ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_max_proto_version.3" + ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_get_max_proto_version.3" + ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_get_min_proto_version.3" ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_set_max_proto_version.3" ln -sf "SSL_CTX_set_min_proto_version.3" "$(DESTDIR)$(mandir)/man3/SSL_set_min_proto_version.3" ln -sf "SSL_CTX_set_mode.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_mode.3" @@ -1928,16 +2245,21 @@ install-data-hook: ln -sf "SSL_CTX_set_tlsext_servername_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_get_servername.3" ln -sf "SSL_CTX_set_tlsext_servername_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_get_servername_type.3" ln -sf "SSL_CTX_set_tlsext_servername_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_host_name.3" + ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_tlsext_status_arg.3" + ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_tlsext_status_cb.3" ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tlsext_status_arg.3" ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_get_tlsext_status_ocsp_resp.3" ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_status_ocsp_resp.3" ln -sf "SSL_CTX_set_tlsext_status_cb.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_status_type.3" + ln -sf "SSL_CTX_set_tlsext_use_srtp.3" "$(DESTDIR)$(mandir)/man3/SSL_get_selected_srtp_profile.3" + ln -sf "SSL_CTX_set_tlsext_use_srtp.3" "$(DESTDIR)$(mandir)/man3/SSL_get_srtp_profiles.3" + ln -sf "SSL_CTX_set_tlsext_use_srtp.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_use_srtp.3" ln -sf "SSL_CTX_set_tmp_dh_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tmp_dh.3" ln -sf "SSL_CTX_set_tmp_dh_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_dh.3" ln -sf "SSL_CTX_set_tmp_dh_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_dh_callback.3" ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_need_tmp_RSA.3" ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tmp_rsa.3" - ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_need_tmp_rsa.3" + ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_need_tmp_RSA.3" ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_rsa.3" ln -sf "SSL_CTX_set_tmp_rsa_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_rsa_callback.3" ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_verify_depth.3" @@ -1965,8 +2287,10 @@ install-data-hook: ln -sf "SSL_CTX_use_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_use_certificate.3" ln -sf "SSL_CTX_use_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_use_certificate_ASN1.3" ln -sf "SSL_CTX_use_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_use_certificate_file.3" + ln -sf "SSL_SESSION_free.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_up_ref.3" ln -sf "SSL_SESSION_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_ex_data.3" ln -sf "SSL_SESSION_get_ex_new_index.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_ex_data.3" + ln -sf "SSL_SESSION_get_id.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set1_id.3" ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_timeout.3" ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_time.3" ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_timeout.3" @@ -1974,13 +2298,20 @@ install-data-hook: ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_get_timeout.3" ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_set_time.3" ln -sf "SSL_SESSION_get_time.3" "$(DESTDIR)$(mandir)/man3/SSL_set_timeout.3" + ln -sf "SSL_SESSION_has_ticket.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_ticket_lifetime_hint.3" ln -sf "SSL_SESSION_print.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_print_fp.3" + ln -sf "SSL_SESSION_set1_id_context.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get0_id_context.3" ln -sf "SSL_alert_type_string.3" "$(DESTDIR)$(mandir)/man3/SSL_alert_desc_string.3" ln -sf "SSL_alert_type_string.3" "$(DESTDIR)$(mandir)/man3/SSL_alert_desc_string_long.3" ln -sf "SSL_alert_type_string.3" "$(DESTDIR)$(mandir)/man3/SSL_alert_type_string_long.3" ln -sf "SSL_get_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_get_privatekey.3" + ln -sf "SSL_get_ciphers.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_ciphers.3" + ln -sf "SSL_get_ciphers.3" "$(DESTDIR)$(mandir)/man3/SSL_get1_supported_ciphers.3" ln -sf "SSL_get_ciphers.3" "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_list.3" + ln -sf "SSL_get_ciphers.3" "$(DESTDIR)$(mandir)/man3/SSL_get_client_ciphers.3" ln -sf "SSL_get_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_client_CA_list.3" + ln -sf "SSL_get_client_random.3" "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_master_key.3" + ln -sf "SSL_get_client_random.3" "$(DESTDIR)$(mandir)/man3/SSL_get_server_random.3" ln -sf "SSL_get_current_cipher.3" "$(DESTDIR)$(mandir)/man3/SSL_get_cipher.3" ln -sf "SSL_get_current_cipher.3" "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_bits.3" ln -sf "SSL_get_current_cipher.3" "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_name.3" @@ -2003,13 +2334,17 @@ install-data-hook: ln -sf "SSL_library_init.3" "$(DESTDIR)$(mandir)/man3/SSLeay_add_ssl_algorithms.3" ln -sf "SSL_load_client_CA_file.3" "$(DESTDIR)$(mandir)/man3/SSL_add_dir_cert_subjects_to_stack.3" ln -sf "SSL_load_client_CA_file.3" "$(DESTDIR)$(mandir)/man3/SSL_add_file_cert_subjects_to_stack.3" + ln -sf "SSL_new.3" "$(DESTDIR)$(mandir)/man3/SSL_up_ref.3" ln -sf "SSL_num_renegotiations.3" "$(DESTDIR)$(mandir)/man3/SSL_clear_num_renegotiations.3" ln -sf "SSL_num_renegotiations.3" "$(DESTDIR)$(mandir)/man3/SSL_total_renegotiations.3" ln -sf "SSL_read.3" "$(DESTDIR)$(mandir)/man3/SSL_peek.3" ln -sf "SSL_renegotiate.3" "$(DESTDIR)$(mandir)/man3/SSL_renegotiate_abbreviated.3" ln -sf "SSL_renegotiate.3" "$(DESTDIR)$(mandir)/man3/SSL_renegotiate_pending.3" ln -sf "SSL_rstate_string.3" "$(DESTDIR)$(mandir)/man3/SSL_rstate_string_long.3" + ln -sf "SSL_set1_param.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get0_param.3" ln -sf "SSL_set1_param.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_set1_param.3" + ln -sf "SSL_set1_param.3" "$(DESTDIR)$(mandir)/man3/SSL_get0_param.3" + ln -sf "SSL_set_connect_state.3" "$(DESTDIR)$(mandir)/man3/SSL_is_server.3" ln -sf "SSL_set_connect_state.3" "$(DESTDIR)$(mandir)/man3/SSL_set_accept_state.3" ln -sf "SSL_set_fd.3" "$(DESTDIR)$(mandir)/man3/SSL_set_rfd.3" ln -sf "SSL_set_fd.3" "$(DESTDIR)$(mandir)/man3/SSL_set_wfd.3" @@ -2088,14 +2423,18 @@ install-data-hook: ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_process.3" ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_set_default_method.3" ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_set_method.3" + ln -sf "X25519.3" "$(DESTDIR)$(mandir)/man3/X25519_keypair.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509V3_EXT_d2i.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509V3_EXT_i2d.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509V3_add1_i2d.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_add1_ext_i2d.3" + ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_extensions.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get_ext_d2i.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_add1_ext_i2d.3" + ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_extensions.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get_ext_d2i.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_add1_ext_i2d.3" + ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_get0_extensions.3" ln -sf "X509V3_get_d2i.3" "$(DESTDIR)$(mandir)/man3/X509_get_ext_d2i.3" ln -sf "X509_ALGOR_dup.3" "$(DESTDIR)$(mandir)/man3/X509_ALGOR_cmp.3" ln -sf "X509_ALGOR_dup.3" "$(DESTDIR)$(mandir)/man3/X509_ALGOR_free.3" @@ -2115,7 +2454,9 @@ install-data-hook: ln -sf "X509_CRL_get0_by_serial.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_sort.3" ln -sf "X509_CRL_new.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_INFO_free.3" ln -sf "X509_CRL_new.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_INFO_new.3" + ln -sf "X509_CRL_new.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_dup.3" ln -sf "X509_CRL_new.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_free.3" + ln -sf "X509_CRL_new.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_up_ref.3" ln -sf "X509_EXTENSION_set_object.3" "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_create_by_NID.3" ln -sf "X509_EXTENSION_set_object.3" "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_create_by_OBJ.3" ln -sf "X509_EXTENSION_set_object.3" "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_free.3" @@ -2150,8 +2491,16 @@ install-data-hook: ln -sf "X509_NAME_print_ex.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_oneline.3" ln -sf "X509_NAME_print_ex.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_print.3" ln -sf "X509_NAME_print_ex.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_print_ex_fp.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_free_contents.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_get0_X509_CRL.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_get_type.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_idx_by_subject.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_retrieve_by_subject.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_retrieve_match.3" + ln -sf "X509_OBJECT_get0_X509.3" "$(DESTDIR)$(mandir)/man3/X509_OBJECT_up_ref_count.3" ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_free.3" ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get.3" + ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get0.3" ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get0_param.3" ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_set.3" ln -sf "X509_PUBKEY_new.3" "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_set0_param.3" @@ -2164,10 +2513,15 @@ install-data-hook: ln -sf "X509_REQ_new.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_INFO_free.3" ln -sf "X509_REQ_new.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_INFO_new.3" ln -sf "X509_REQ_new.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_free.3" + ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_dup.3" ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_free.3" + ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_revocationDate.3" + ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_serialNumber.3" ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_set_revocationDate.3" ln -sf "X509_REVOKED_new.3" "$(DESTDIR)$(mandir)/man3/X509_REVOKED_set_serialNumber.3" ln -sf "X509_SIG_new.3" "$(DESTDIR)$(mandir)/man3/X509_SIG_free.3" + ln -sf "X509_STORE_CTX_get_error.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_cert.3" + ln -sf "X509_STORE_CTX_get_error.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_chain.3" ln -sf "X509_STORE_CTX_get_error.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get1_chain.3" ln -sf "X509_STORE_CTX_get_error.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get_current_cert.3" ln -sf "X509_STORE_CTX_get_error.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get_error_depth.3" @@ -2178,24 +2532,57 @@ install-data-hook: ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_cleanup.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_free.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_param.3" + ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_store.3" + ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_untrusted.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_init.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_crls.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_param.3" + ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_trusted_stack.3" + ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_untrusted.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_cert.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_chain.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_default.3" ln -sf "X509_STORE_CTX_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_trusted_stack.3" ln -sf "X509_STORE_load_locations.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_default_paths.3" + ln -sf "X509_STORE_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_free.3" + ln -sf "X509_STORE_new.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_up_ref.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_add_cert.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_add_crl.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_get0_objects.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_get0_param.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_get_ex_data.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_get_ex_new_index.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_depth.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_ex_data.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_flags.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_purpose.3" + ln -sf "X509_STORE_set1_param.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_trust.3" ln -sf "X509_STORE_set_verify_cb_func.3" "$(DESTDIR)$(mandir)/man3/X509_STORE_set_verify_cb.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add0_policy.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add0_table.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add1_host.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_clear_flags.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_free.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0_name.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0_peername.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_count.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_depth.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_flags.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_lookup.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_new.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_email.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_host.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_ip.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_ip_asc.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_name.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_policies.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_depth.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_hostflags.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_purpose.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_time.3" ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_trust.3" + ln -sf "X509_VERIFY_PARAM_set_flags.3" "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_table_cleanup.3" ln -sf "X509_check_host.3" "$(DESTDIR)$(mandir)/man3/X509_check_email.3" ln -sf "X509_check_host.3" "$(DESTDIR)$(mandir)/man3/X509_check_ip.3" ln -sf "X509_check_host.3" "$(DESTDIR)$(mandir)/man3/X509_check_ip_asc.3" @@ -2208,8 +2595,24 @@ install-data-hook: ln -sf "X509_digest.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_digest.3" ln -sf "X509_digest.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_digest.3" ln -sf "X509_digest.3" "$(DESTDIR)$(mandir)/man3/X509_pubkey_digest.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_lastUpdate.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_nextUpdate.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_set1_lastUpdate.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_set1_nextUpdate.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_get0_notAfter.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_getm_notAfter.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_getm_notBefore.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_set1_notAfter.3" + ln -sf "X509_get0_notBefore.3" "$(DESTDIR)$(mandir)/man3/X509_set1_notBefore.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_signature.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_get_signature_nid.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_get0_signature.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_get_signature_nid.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_get0_tbs_sigalg.3" + ln -sf "X509_get0_signature.3" "$(DESTDIR)$(mandir)/man3/X509_get_signature_nid.3" ln -sf "X509_get_pubkey.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_get_pubkey.3" ln -sf "X509_get_pubkey.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_set_pubkey.3" + ln -sf "X509_get_pubkey.3" "$(DESTDIR)$(mandir)/man3/X509_get0_pubkey.3" ln -sf "X509_get_pubkey.3" "$(DESTDIR)$(mandir)/man3/X509_get_X509_PUBKEY.3" ln -sf "X509_get_pubkey.3" "$(DESTDIR)$(mandir)/man3/X509_set_pubkey.3" ln -sf "X509_get_serialNumber.3" "$(DESTDIR)$(mandir)/man3/X509_set_serialNumber.3" @@ -2225,6 +2628,7 @@ install-data-hook: ln -sf "X509_get_version.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_get_version.3" ln -sf "X509_get_version.3" "$(DESTDIR)$(mandir)/man3/X509_REQ_set_version.3" ln -sf "X509_get_version.3" "$(DESTDIR)$(mandir)/man3/X509_set_version.3" + ln -sf "X509_new.3" "$(DESTDIR)$(mandir)/man3/X509_chain_up_ref.3" ln -sf "X509_new.3" "$(DESTDIR)$(mandir)/man3/X509_free.3" ln -sf "X509_new.3" "$(DESTDIR)$(mandir)/man3/X509_up_ref.3" ln -sf "X509_sign.3" "$(DESTDIR)$(mandir)/man3/X509_CRL_sign.3" @@ -2279,7 +2683,6 @@ install-data-hook: ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_part_recursive.3" ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_recursive.3" ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_words.3" - ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_print.3" ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_set_high.3" ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_set_low.3" ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_set_max.3" @@ -2359,6 +2762,8 @@ install-data-hook: ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_fp.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_SIG.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAparams.3" + ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAparams_bio.3" + ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAparams_fp.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_bio.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_fp.3" @@ -2368,6 +2773,8 @@ install-data-hook: ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_fp.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_SIG.3" ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAparams.3" + ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAparams_bio.3" + ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAparams_fp.3" ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECPKParameters_print.3" ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECPKParameters_print_fp.3" ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECParameters_dup.3" @@ -2578,6 +2985,7 @@ install-data-hook: ln -sf "d2i_X509_EXTENSION.3" "$(DESTDIR)$(mandir)/man3/i2d_X509_EXTENSIONS.3" ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_ENTRY_dup.3" ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_dup.3" + ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_get0_der.3" ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_hash.3" ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/d2i_X509_NAME_ENTRY.3" ln -sf "d2i_X509_NAME.3" "$(DESTDIR)$(mandir)/man3/i2d_X509_NAME.3" @@ -2596,118 +3004,14 @@ install-data-hook: ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/i2d_X509_SIG.3" ln -sf "des_read_pw.3" "$(DESTDIR)$(mandir)/man3/EVP_read_pw_string.3" ln -sf "des_read_pw.3" "$(DESTDIR)$(mandir)/man3/des_read_pw_string.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_add.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_by_id.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_cleanup.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_cmd_is_executable.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd_string.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_finish.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_free.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_STORE.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher_engine.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_cmd_defns.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_ctrl_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_destroy_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest_engine.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_finish_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_first.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_flags.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_id.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_init_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_last.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_load_privkey_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_load_pubkey_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_name.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_next.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_prev.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_get_table_flags.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_init.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_builtin_engines.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_cryptodev.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_dynamic.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_openssl.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_private_key.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_load_public_key.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_new.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_STORE.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_STORE.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_complete.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_complete.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_register_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_remove.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_STORE.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_cmd_defns.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_ctrl_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_string.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_destroy_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_finish_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_flags.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_id.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_init_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_load_privkey_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_load_pubkey_function.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_name.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_set_table_flags.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDH.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RAND.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RSA.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_STORE.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ciphers.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_digests.3" - ln -sf "engine.3" "$(DESTDIR)$(mandir)/man3/ENGINE_up_ref.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc2409_prime_1024.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc2409_prime_768.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_1536.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_2048.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_3072.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_4096.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_6144.3" + ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_8192.3" ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/get_rfc2409_prime_1024.3" ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/get_rfc2409_prime_768.3" ln -sf "get_rfc3526_prime_8192.3" "$(DESTDIR)$(mandir)/man3/get_rfc3526_prime_1536.3" @@ -2754,6 +3058,7 @@ install-data-hook: ln -sf "tls_config_set_protocols.3" "$(DESTDIR)$(mandir)/man3/tls_config_set_dheparams.3" ln -sf "tls_config_set_protocols.3" "$(DESTDIR)$(mandir)/man3/tls_config_set_ecdhecurves.3" ln -sf "tls_config_set_session_id.3" "$(DESTDIR)$(mandir)/man3/tls_config_add_ticket_key.3" + ln -sf "tls_config_set_session_id.3" "$(DESTDIR)$(mandir)/man3/tls_config_set_session_fd.3" ln -sf "tls_config_set_session_id.3" "$(DESTDIR)$(mandir)/man3/tls_config_set_session_lifetime.3" ln -sf "tls_config_verify.3" "$(DESTDIR)$(mandir)/man3/tls_config_insecure_noverifycert.3" ln -sf "tls_config_verify.3" "$(DESTDIR)$(mandir)/man3/tls_config_insecure_noverifyname.3" @@ -2761,6 +3066,8 @@ install-data-hook: ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_conn_alpn_selected.3" ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_conn_cipher.3" ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_conn_servername.3" + ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_conn_session_resumed.3" + ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_peer_cert_chain_pem.3" ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_peer_cert_contains_name.3" ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_peer_cert_hash.3" ln -sf "tls_conn_version.3" "$(DESTDIR)$(mandir)/man3/tls_peer_cert_issuer.3" @@ -2798,12 +3105,13 @@ install-data-hook: ln -sf "tls_load_file.3" "$(DESTDIR)$(mandir)/man3/tls_config_set_verify_depth.3" ln -sf "tls_load_file.3" "$(DESTDIR)$(mandir)/man3/tls_config_verify_client.3" ln -sf "tls_load_file.3" "$(DESTDIR)$(mandir)/man3/tls_config_verify_client_optional.3" + ln -sf "tls_load_file.3" "$(DESTDIR)$(mandir)/man3/tls_default_ca_cert_file.3" ln -sf "tls_load_file.3" "$(DESTDIR)$(mandir)/man3/tls_unload_file.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_cert_status.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_crl_reason.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_next_update.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_response_status.3" - ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_result_msg.3" + ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_result.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_revocation_time.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_this_update.3" ln -sf "tls_ocsp_process_response.3" "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_url.3" @@ -2817,12 +3125,20 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/ACCESS_DESCRIPTION_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/AUTHORITY_INFO_ACCESS_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/AUTHORITY_INFO_ACCESS_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_get.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_set.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_ENUMERATED_to_BN.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_INTEGER_set.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_INTEGER_to_BN.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_to_ASN1_ENUMERATED.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_to_ASN1_INTEGER.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_OBJECT_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_TABLE_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_TABLE_get.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_cmp.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_dup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_get0_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_length_set.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_set.3" -rm -f "$(DESTDIR)$(mandir)/man3/ASN1_STRING_to_UTF8.3" @@ -2953,6 +3269,10 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/BIO_ssl_shutdown.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_method_type.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_next.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_get_shutdown.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_set_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_set_init.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_set_shutdown.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_set_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDH_get_ex_data.3" @@ -2973,9 +3293,28 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_get_ex_new_index.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_set_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_get_new_index.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_callback_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_create.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_destroy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_gets.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_puts.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_read.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_get_write.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_callback_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_create.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_destroy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_gets.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_puts.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_read.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_meth_set_write.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_free_all.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_set.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BIO_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_vfree.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_snprintf.3" -rm -f "$(DESTDIR)$(mandir)/man3/BIO_vprintf.3" @@ -3093,6 +3432,9 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/BN_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/BN_with_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_call.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_get_arg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_set.3" -rm -f "$(DESTDIR)$(mandir)/man3/BN_GENCB_set_old.3" -rm -f "$(DESTDIR)$(mandir)/man3/BN_generate_prime_ex.3" @@ -3152,6 +3494,15 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_mem_leaks_cb.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_mem_leaks_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_set_mem_functions.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_cmp.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_cpy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_current.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_THREADID_hash.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_add.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_r_lock.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_r_unlock.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_w_lock.3" + -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_w_unlock.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_new.3" @@ -3213,13 +3564,23 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/DH_compute_key.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_check.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_generate_parameters_ex.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_clear_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_get0_engine.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_get0_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_set0_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_set0_pqg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_set_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_set_length.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_test_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_set_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_OpenSSL.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_get_default_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_new_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DH_set_default_method.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DH_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRL_DIST_POINTS_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRL_DIST_POINTS_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/DIST_POINT_NAME_free.3" @@ -3228,11 +3589,25 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/ISSUING_DIST_POINT_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/ISSUING_DIST_POINT_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_SIG_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_SIG_get0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_SIG_set0.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_do_verify.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_generate_parameters_ex.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_clear_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_get0_engine.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_get0_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_set0_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_set0_pqg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_set_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_test_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_set_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_meth_dup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_meth_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_meth_set_finish.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_meth_set_sign.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DSA_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_OpenSSL.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_get_default_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DSA_new_method.3" @@ -3241,6 +3616,8 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/DSA_verify.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_get0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_SIG_set0.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_do_sign.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_do_sign_ex.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_do_verify.3" @@ -3351,6 +3728,104 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_compressed_coordinates_GF2m.3" -rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_compressed_coordinates_GFp.3" -rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_to_infinity.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_by_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_cleanup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_first.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_last.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_name.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_next.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_prev.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_remove.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_name.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_CTRL_FUNC_PTR.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_cmd_is_executable.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd_string.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cmd_defns.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ctrl_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_cmd_defns.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ctrl_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher_engine.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest_engine.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_table_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_table_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_GEN_INT_FUNC_PTR.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_finish.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_finish_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_init_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_finish_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_init_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_GEN_INT_FUNC_PTR.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_destroy_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_destroy_function.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_up_ref.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_STORE.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_complete.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_digests.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_builtin_engines.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_dynamic.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_STORE.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_complete.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_digests.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_CIPHERS_PTR.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_DIGESTS_PTR.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_RSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_STORE.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digests.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_STORE.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_digests.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_digests.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_string.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RAND.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_STORE.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_digests.3" -rm -f "$(DESTDIR)$(mandir)/man3/ERR_FATAL_ERROR.3" -rm -f "$(DESTDIR)$(mandir)/man3/ERR_GET_FUNC.3" -rm -f "$(DESTDIR)$(mandir)/man3/ERR_GET_REASON.3" @@ -3391,7 +3866,9 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_AEAD_nonce_length.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aead_aes_128_gcm.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aead_aes_256_gcm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aead_chacha20_poly1305" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aead_chacha20_poly1305.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aead_xchacha20_poly1305.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DigestFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DigestFinal_ex.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DigestInit_ex.3" @@ -3404,8 +3881,11 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_create.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_ctrl.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_destroy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_init.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_md.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_reset.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_size.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_CTX_type.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_MD_block_size.3" @@ -3417,7 +3897,6 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_get_digestbyname.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_get_digestbynid.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_get_digestbyobj.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_md2.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_md5.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_md5_sha1.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_md_null.3" @@ -3435,25 +3914,34 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DecodeFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DecodeInit.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_DecodeUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_ENCODE_CTX_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_ENCODE_CTX_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncodeBlock.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncodeFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncodeUpdate.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_block_size.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_cipher.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_cleanup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_clear_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_ctrl.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_get_app_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_get_iv.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_init.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_iv_length.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_key_length.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_mode.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_nid.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_rand_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_reset.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_app_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_iv.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_key_length.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_padding.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_test_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_type.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_asn1_to_param.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_block_size.3" @@ -3478,26 +3966,6 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncryptFinal_ex.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncryptInit_ex.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_EncryptUpdate.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc_hmac_sha1.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ccm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ecb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_gcm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ofb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cbc.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ccm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ecb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_gcm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ofb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc_hmac_sha1.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ccm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ecb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_gcm.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ofb.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_bf_cbc.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_bf_cfb.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_bf_ecb.3" @@ -3537,25 +4005,39 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc4.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc4_40.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc4_hmac_md5.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_cbc.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_cfb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_ecb.3" - -rm -f "$(DESTDIR)$(mandir)/man3/EVP_rc5_32_12_16_ofb.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_OpenFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_OpenUpdate.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_ctrl_str.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_mgf1_md.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_padding.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_get_rsa_pss_saltlen.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dh_paramgen_generator.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dh_paramgen_prime_len.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_dsa_paramgen_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_ec_paramgen_curve_nid.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_keygen_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_keygen_pubexp.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_mgf1_md.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_padding.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_rsa_pss_saltlen.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_set_signature_md.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_CTX_new_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_find.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_find_str.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_get0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_get0_info.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_asn1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_add0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_add_alias.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_copy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_private.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_asn1_set_public.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_cmp_parameters.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_copy_parameters.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_missing_parameters.3" @@ -3572,7 +4054,27 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_keygen_init.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_paramgen.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_paramgen_init.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_add0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_copy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_find.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_cleanup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_copy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_ctrl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_decrypt.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_derive.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_encrypt.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_init.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_keygen.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_paramgen.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_sign.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_signctx.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verify.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verify_recover.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_meth_set_verifyctx.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_new_mac_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_print_params.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_print_public.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_DH.3" @@ -3580,6 +4082,11 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_EC_KEY.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_assign_RSA.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_base_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_DH.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_DSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_EC_KEY.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_RSA.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get0_hmac.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_DH.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_DSA.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_get1_EC_KEY.3" @@ -3594,6 +4101,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_recover_init.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_SealFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_SealUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_size.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignInit_ex.3" @@ -3601,6 +4109,47 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/EVP_VerifyFinal.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_VerifyInit_ex.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_VerifyUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cbc_hmac_sha1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ccm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb128.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_cfb8.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ctr.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ecb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_gcm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_ofb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_wrap.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_128_xts.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cbc.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ccm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb128.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_cfb8.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ctr.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ecb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_gcm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_ofb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_192_wrap.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cbc_hmac_sha1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ccm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb1.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb128.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_cfb8.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ctr.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ecb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_gcm.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_ofb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_wrap.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_aes_256_xts.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_sm4_cfb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_sm4_cfb128.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_sm4_ctr.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_sm4_ecb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/EVP_sm4_ofb.3" -rm -f "$(DESTDIR)$(mandir)/man3/EXTENDED_KEY_USAGE_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/EDIPARTYNAME_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/EDIPARTYNAME_new.3" @@ -3611,7 +4160,11 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OTHERNAME_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_copy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_get_md.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_init.3" + -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_reset.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_CTX_set_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_Final.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_Init.3" @@ -3619,10 +4172,6 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_Update.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/HMAC_size.3" - -rm -f "$(DESTDIR)$(mandir)/man3/MD2.3" - -rm -f "$(DESTDIR)$(mandir)/man3/MD2_Final.3" - -rm -f "$(DESTDIR)$(mandir)/man3/MD2_Init.3" - -rm -f "$(DESTDIR)$(mandir)/man3/MD2_Update.3" -rm -f "$(DESTDIR)$(mandir)/man3/MD4.3" -rm -f "$(DESTDIR)$(mandir)/man3/MD4_Final.3" -rm -f "$(DESTDIR)$(mandir)/man3/MD4_Init.3" @@ -3647,7 +4196,6 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OBJ_txt2obj.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2t_ASN1_OBJECT.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_CRLID_free.3" - -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_crlID_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_ONEREQ_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_ONEREQ_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_free.3" @@ -3676,7 +4224,9 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REVOKEDINFO_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REVOKEDINFO_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_get0_id.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SINGLERESP_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_basic_verify.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_check_validity.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_resp_count.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_resp_find.3" @@ -3692,6 +4242,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_RESPID_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_RESPONSE_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_RESPONSE_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_basic_sign.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_response_create.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_response_get1_basic.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQ_CTX_add1_header.3" @@ -3699,6 +4250,11 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQ_CTX_set1_req.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_sendreq_bio.3" -rm -f "$(DESTDIR)$(mandir)/man3/OCSP_sendreq_nbio.3" + -rm -f "$(DESTDIR)$(mandir)/man3/LIBRESSL_VERSION_NUMBER.3" + -rm -f "$(DESTDIR)$(mandir)/man3/LIBRESSL_VERSION_TEXT.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OPENSSL_VERSION_TEXT.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OpenSSL_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/OpenSSL_version_num.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSLeay.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSLeay_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/OPENSSL_no_config.3" @@ -3711,6 +4267,27 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/OPENSSL_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/OPENSSL_realloc.3" -rm -f "$(DESTDIR)$(mandir)/man3/OPENSSL_strdup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_delete.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_delete_ptr.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_dup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_find.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_find_ex.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_insert.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_is_sorted.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_new_null.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_num.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_pop.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_pop_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_push.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_set.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_set_cmp_func.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_shift.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_sort.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_unshift.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_value.3" + -rm -f "$(DESTDIR)$(mandir)/man3/sk_zero.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/OpenSSL_add_all_ciphers.3" -rm -f "$(DESTDIR)$(mandir)/man3/OpenSSL_add_all_digests.3" @@ -3853,6 +4430,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/PROXY_CERT_INFO_EXTENSION_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/PROXY_POLICY_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/RAND_cleanup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RAND_poll.3" -rm -f "$(DESTDIR)$(mandir)/man3/RAND_seed.3" -rm -f "$(DESTDIR)$(mandir)/man3/RAND_status.3" -rm -f "$(DESTDIR)$(mandir)/man3/RAND_pseudo_bytes.3" @@ -3867,12 +4445,28 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/RSA_PSS_PARAMS_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_blinding_off.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_generate_key_ex.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_clear_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get0_crt_params.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get0_factors.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set0_crt_params.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set0_factors.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set0_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_test_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/CRYPTO_EX_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_dup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_get_finish.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_set1_name.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_set_finish.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_set_priv_dec.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_meth_set_priv_enc.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_add_PKCS1_OAEP.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_add_PKCS1_type_2.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_add_none.3" @@ -3892,14 +4486,12 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/RSA_PKCS1_SSLeay.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_flags.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get_default_method.3" - -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get_default_openssl_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_get_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_new_method.3" - -rm -f "$(DESTDIR)$(mandir)/man3/RSA_null_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set_default_method.3" - -rm -f "$(DESTDIR)$(mandir)/man3/RSA_set_default_openssl_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_verify.3" -rm -f "$(DESTDIR)$(mandir)/man3/RSA_verify_ASN1_OCTET_STRING.3" + -rm -f "$(DESTDIR)$(mandir)/man3/RSA_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/SHA1_Final.3" -rm -f "$(DESTDIR)$(mandir)/man3/SHA1_Init.3" -rm -f "$(DESTDIR)$(mandir)/man3/SHA1_Update.3" @@ -3920,8 +4512,14 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SHA512_Init.3" -rm -f "$(DESTDIR)$(mandir)/man3/SHA512_Update.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_description.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_auth_nid.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_bits.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_cipher_nid.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_digest_nid.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_id.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_kx_nid.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_get_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CIPHER_is_aead.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_COMP_get_compression_methods.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_clear_extra_chain_certs.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_remove_session.3" @@ -3936,9 +4534,13 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_verify_depth.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_verify_mode.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_default_verify_paths.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DTLS_client_method.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DTLS_method.3" + -rm -f "$(DESTDIR)$(mandir)/man3/DTLS_server_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DTLSv1_client_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DTLSv1_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/DTLSv1_server_method.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSLv23_client_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSLv23_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSLv23_server_method.3" @@ -3992,6 +4594,8 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_client_CA_list.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_client_cert_cb.3" -rm -f "$(DESTDIR)$(mandir)/man3/client_cert_cb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_default_passwd_cb.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_default_passwd_cb_userdata.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_default_passwd_cb_userdata.3" -rm -f "$(DESTDIR)$(mandir)/man3/pem_password_cb.3" -rm -f "$(DESTDIR)$(mandir)/man3/GEN_SESSION_CB.3" @@ -4003,7 +4607,11 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_max_cert_list.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_max_cert_list.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_max_cert_list.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_max_proto_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_min_proto_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_max_proto_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_max_proto_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_min_proto_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_max_proto_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_min_proto_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_mode.3" @@ -4034,16 +4642,21 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_servername.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_servername_type.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_host_name.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_tlsext_status_arg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_tlsext_status_cb.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tlsext_status_arg.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_tlsext_status_ocsp_resp.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_status_ocsp_resp.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_status_type.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_selected_srtp_profile.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_srtp_profiles.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tlsext_use_srtp.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tmp_dh.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_dh.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_dh_callback.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_need_tmp_RSA.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_tmp_rsa.3" - -rm -f "$(DESTDIR)$(mandir)/man3/SSL_need_tmp_rsa.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_need_tmp_RSA.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_rsa.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_tmp_rsa_callback.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set_verify_depth.3" @@ -4071,8 +4684,10 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_use_certificate.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_use_certificate_ASN1.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_use_certificate_file.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_ex_data.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set1_id.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_timeout.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_time.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_set_timeout.3" @@ -4080,13 +4695,20 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_timeout.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_time.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_timeout.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_ticket_lifetime_hint.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_print_fp.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get0_id_context.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_alert_desc_string.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_alert_desc_string_long.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_alert_type_string_long.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_privatekey.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_ciphers.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get1_supported_ciphers.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_list.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_client_ciphers.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_client_CA_list.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_SESSION_get_master_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_server_random.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_cipher.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_bits.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_cipher_name.3" @@ -4109,13 +4731,17 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/SSLeay_add_ssl_algorithms.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_add_dir_cert_subjects_to_stack.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_add_file_cert_subjects_to_stack.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_clear_num_renegotiations.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_total_renegotiations.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_peek.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_renegotiate_abbreviated.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_renegotiate_pending.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_rstate_string_long.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get0_param.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_set1_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_get0_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/SSL_is_server.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_accept_state.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_rfd.3" -rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_wfd.3" @@ -4194,14 +4820,18 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/UI_process.3" -rm -f "$(DESTDIR)$(mandir)/man3/UI_set_default_method.3" -rm -f "$(DESTDIR)$(mandir)/man3/UI_set_method.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X25519_keypair.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509V3_EXT_d2i.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509V3_EXT_i2d.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509V3_add1_i2d.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_add1_ext_i2d.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_extensions.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get_ext_d2i.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_add1_ext_i2d.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_extensions.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get_ext_d2i.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_add1_ext_i2d.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_get0_extensions.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_get_ext_d2i.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_ALGOR_cmp.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_ALGOR_free.3" @@ -4221,7 +4851,9 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_sort.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_INFO_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_INFO_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_create_by_NID.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_create_by_OBJ.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_EXTENSION_free.3" @@ -4256,8 +4888,16 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_oneline.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_print.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_print_ex_fp.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_free_contents.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_get0_X509_CRL.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_get_type.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_idx_by_subject.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_retrieve_by_subject.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_retrieve_match.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_OBJECT_up_ref_count.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get0.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_get0_param.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_set.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_PUBKEY_set0_param.3" @@ -4270,10 +4910,15 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_INFO_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_INFO_new.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_revocationDate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_get0_serialNumber.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_set_revocationDate.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REVOKED_set_serialNumber.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_SIG_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_cert.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_chain.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get1_chain.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get_current_cert.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get_error_depth.3" @@ -4284,24 +4929,57 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_store.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_get0_untrusted.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_init.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_crls.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_trusted_stack.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set0_untrusted.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_cert.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_chain.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_set_default.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_CTX_trusted_stack.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_default_paths.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_up_ref.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_add_cert.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_add_crl.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_get0_objects.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_get0_param.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_get_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_get_ex_new_index.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_depth.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_ex_data.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_purpose.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_trust.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_STORE_set_verify_cb.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add0_policy.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add0_table.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_add1_host.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_clear_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_free.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0_name.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get0_peername.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_count.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_depth.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_get_flags.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_lookup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_new.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_email.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_host.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_ip.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_ip_asc.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_name.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set1_policies.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_depth.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_hostflags.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_purpose.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_time.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_set_trust.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_VERIFY_PARAM_table_cleanup.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_check_email.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_check_ip.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_check_ip_asc.3" @@ -4314,8 +4992,24 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_digest.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_digest.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_pubkey_digest.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_lastUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_nextUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_set1_lastUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_set1_nextUpdate.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_get0_notAfter.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_getm_notAfter.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_getm_notBefore.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_set1_notAfter.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_set1_notBefore.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get0_signature.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_get_signature_nid.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_get0_signature.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_get_signature_nid.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_get0_tbs_sigalg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_get_signature_nid.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_get_pubkey.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_set_pubkey.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_get0_pubkey.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_get_X509_PUBKEY.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_set_pubkey.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_set_serialNumber.3" @@ -4331,6 +5025,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_get_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_REQ_set_version.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_set_version.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_chain_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_free.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_up_ref.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_CRL_sign.3" @@ -4385,7 +5080,6 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_part_recursive.3" -rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_recursive.3" -rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_words.3" - -rm -f "$(DESTDIR)$(mandir)/man3/bn_print.3" -rm -f "$(DESTDIR)$(mandir)/man3/bn_set_high.3" -rm -f "$(DESTDIR)$(mandir)/man3/bn_set_low.3" -rm -f "$(DESTDIR)$(mandir)/man3/bn_set_max.3" @@ -4465,6 +5159,8 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_SIG.3" -rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAparams.3" + -rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAparams_bio.3" + -rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAparams_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_bio.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_fp.3" @@ -4474,6 +5170,8 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_SIG.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAparams.3" + -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAparams_bio.3" + -rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAparams_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECPKParameters_print.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECPKParameters_print_fp.3" -rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_dup.3" @@ -4684,6 +5382,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/i2d_X509_EXTENSIONS.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_ENTRY_dup.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_dup.3" + -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_get0_der.3" -rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_hash.3" -rm -f "$(DESTDIR)$(mandir)/man3/d2i_X509_NAME_ENTRY.3" -rm -f "$(DESTDIR)$(mandir)/man3/i2d_X509_NAME.3" @@ -4702,118 +5401,14 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/i2d_X509_SIG.3" -rm -f "$(DESTDIR)$(mandir)/man3/EVP_read_pw_string.3" -rm -f "$(DESTDIR)$(mandir)/man3/des_read_pw_string.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_add.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_by_id.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_cleanup.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_cmd_is_executable.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_ctrl_cmd_string.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_finish.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_free.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_STORE.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cipher_engine.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_cmd_defns.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_ctrl_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_default_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_destroy_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digest_engine.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_finish_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_first.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_flags.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_id.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_init_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_last.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_load_privkey_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_load_pubkey_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_name.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_next.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_prev.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_get_table_flags.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_init.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_builtin_engines.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_cryptodev.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_dynamic.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_openssl.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_private_key.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_load_public_key.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_new.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_STORE.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_STORE.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_complete.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_all_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_complete.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_register_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_remove.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_STORE.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_cmd_defns.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_ctrl_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_default_string.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_destroy_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_finish_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_flags.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_id.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_init_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_load_privkey_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_load_pubkey_function.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_name.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_set_table_flags.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_DSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDH.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ECDSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RAND.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_RSA.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_STORE.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_ciphers.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_unregister_digests.3" - -rm -f "$(DESTDIR)$(mandir)/man3/ENGINE_up_ref.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc2409_prime_1024.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc2409_prime_768.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_1536.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_2048.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_3072.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_4096.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_6144.3" + -rm -f "$(DESTDIR)$(mandir)/man3/BN_get_rfc3526_prime_8192.3" -rm -f "$(DESTDIR)$(mandir)/man3/get_rfc2409_prime_1024.3" -rm -f "$(DESTDIR)$(mandir)/man3/get_rfc2409_prime_768.3" -rm -f "$(DESTDIR)$(mandir)/man3/get_rfc3526_prime_1536.3" @@ -4860,6 +5455,7 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_set_dheparams.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_set_ecdhecurves.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_add_ticket_key.3" + -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_set_session_fd.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_set_session_lifetime.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_insecure_noverifycert.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_insecure_noverifyname.3" @@ -4867,6 +5463,8 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/tls_conn_alpn_selected.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_conn_cipher.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_conn_servername.3" + -rm -f "$(DESTDIR)$(mandir)/man3/tls_conn_session_resumed.3" + -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_cert_chain_pem.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_cert_contains_name.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_cert_hash.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_cert_issuer.3" @@ -4904,12 +5502,13 @@ uninstall-local: -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_set_verify_depth.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_verify_client.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_config_verify_client_optional.3" + -rm -f "$(DESTDIR)$(mandir)/man3/tls_default_ca_cert_file.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_unload_file.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_cert_status.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_crl_reason.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_next_update.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_response_status.3" - -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_result_msg.3" + -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_result.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_revocation_time.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_this_update.3" -rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_url.3" diff --git a/man/NAME_CONSTRAINTS_new.3 b/man/NAME_CONSTRAINTS_new.3 index 5ef737cb..db64e14c 100644 --- a/man/NAME_CONSTRAINTS_new.3 +++ b/man/NAME_CONSTRAINTS_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: NAME_CONSTRAINTS_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: NAME_CONSTRAINTS_new.3,v 1.3 2018/03/23 00:09:11 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt NAME_CONSTRAINTS_NEW 3 .Os .Sh NAME @@ -87,3 +87,11 @@ if an error occurs. RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.2.1.10: Name Constraints +.Sh HISTORY +.Fn NAME_CONSTRAINTS_new , +.Fn NAME_CONSTRAINTS_free , +.Fn GENERAL_SUBTREE_new , +and +.Fn GENERAL_SUBTREE_free +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/OBJ_nid2obj.3 b/man/OBJ_nid2obj.3 index 5fa3e6fa..f8c395ba 100644 --- a/man/OBJ_nid2obj.3 +++ b/man/OBJ_nid2obj.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OBJ_nid2obj.3,v 1.5 2017/01/04 05:14:51 schwarze Exp $ +.\" $OpenBSD: OBJ_nid2obj.3,v 1.12 2018/04/25 15:17:52 schwarze Exp $ .\" OpenSSL c264592d May 14 11:28:00 2006 +0000 .\" .\" This file is a derived work. @@ -66,7 +66,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 4 2017 $ +.Dd $Mdocdate: April 25 2018 $ .Dt OBJ_NID2OBJ 3 .Os .Sh NAME @@ -149,7 +149,7 @@ .Fo i2t_ASN1_OBJECT .Fa "char *buf" .Fa "int buf_len" -.Fa "ASN1_OBJECT *a" +.Fa "const ASN1_OBJECT *a" .Fc .Sh DESCRIPTION The ASN.1 object utility functions process @@ -369,6 +369,33 @@ obj = OBJ_txt2obj("1.2.3.4", 1); .Ed .Sh SEE ALSO .Xr ERR_get_error 3 +.Sh HISTORY +.Fn OBJ_nid2obj , +.Fn OBJ_nid2ln , +.Fn OBJ_nid2sn , +.Fn OBJ_obj2nid , +.Fn OBJ_ln2nid , +.Fn OBJ_sn2nid , +.Fn OBJ_txt2nid , +.Fn OBJ_cmp , +and +.Fn OBJ_dup +first appeared in SSLeay 0.5.1. +.Fn OBJ_cleanup +first appeared in SSLeay 0.8.0. +.Fn OBJ_create +and +.Fn i2t_ASN1_OBJECT +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn OBJ_txt2obj +first appeared in OpenSSL 0.9.2b. +.Fn OBJ_obj2txt +first appeared in OpenSSL 0.9.4. +Both functions have been available since +.Ox 2.6 . .Sh BUGS .Fn OBJ_obj2txt is awkward and messy to use: it doesn't follow the convention of other diff --git a/man/OCSP_CRLID_new.3 b/man/OCSP_CRLID_new.3 index 450b57c9..ff081916 100644 --- a/man/OCSP_CRLID_new.3 +++ b/man/OCSP_CRLID_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OCSP_CRLID_new.3,v 1.3 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: OCSP_CRLID_new.3,v 1.6 2018/05/13 14:36:05 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: May 13 2018 $ .Dt OCSP_CRLID_NEW 3 .Os .Sh NAME @@ -30,7 +30,7 @@ .Fn OCSP_CRLID_free "OCSP_CRLID *crlid" .Ft X509_EXTENSION * .Fo OCSP_crlID_new -.Fa "char *url" +.Fa "const char *url" .Fa "long *number" .Fa "char *time" .Fc @@ -97,6 +97,13 @@ if an error occurred. .Sh STANDARDS RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.4.2: CRL References +.Sh HISTORY +.Fn OCSP_CRLID_new , +.Fn OCSP_CRLID_free , +and +.Fn OCSP_crlID_new +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . .Sh CAVEATS The function names .Fn OCSP_CRLID_new diff --git a/man/OCSP_REQUEST_new.3 b/man/OCSP_REQUEST_new.3 index 664a7506..8f3f56b6 100644 --- a/man/OCSP_REQUEST_new.3 +++ b/man/OCSP_REQUEST_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OCSP_REQUEST_new.3,v 1.7 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: OCSP_REQUEST_new.3,v 1.8 2018/03/22 21:08:22 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt OCSP_REQUEST_NEW 3 .Os .Sh NAME @@ -317,3 +317,7 @@ OCSP_REQUEST_free(req); .Sh STANDARDS RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.1: Request Syntax +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 3.2 . diff --git a/man/OCSP_SERVICELOC_new.3 b/man/OCSP_SERVICELOC_new.3 index 5f42c781..febd7169 100644 --- a/man/OCSP_SERVICELOC_new.3 +++ b/man/OCSP_SERVICELOC_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OCSP_SERVICELOC_new.3,v 1.5 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: OCSP_SERVICELOC_new.3,v 1.7 2018/05/13 14:36:05 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: May 13 2018 $ .Dt OCSP_SERVICELOC_NEW 3 .Os .Sh NAME @@ -31,7 +31,7 @@ .Ft X509_EXTENSION * .Fo OCSP_url_svcloc_new .Fa "X509_NAME *issuer" -.Fa "char **urls" +.Fa "const char **urls" .Fc .Sh DESCRIPTION Due to restrictions of network routing, a client may be unable to @@ -99,3 +99,10 @@ if an error occurred. .Sh STANDARDS RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.4.6: Service Locator +.Sh HISTORY +.Fn OCSP_SERVICELOC_new , +.Fn OCSP_SERVICELOC_free , +and +.Fn OCSP_url_svcloc_new +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/OCSP_cert_to_id.3 b/man/OCSP_cert_to_id.3 index 77559ba4..2b8c2371 100644 --- a/man/OCSP_cert_to_id.3 +++ b/man/OCSP_cert_to_id.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OCSP_cert_to_id.3,v 1.6 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: OCSP_cert_to_id.3,v 1.9 2018/08/24 20:04:10 tb Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: August 24 2018 $ .Dt OCSP_CERT_TO_ID 3 .Os .Sh NAME @@ -86,15 +86,15 @@ .Ft OCSP_CERTID * .Fo OCSP_cert_to_id .Fa "const EVP_MD *dgst" -.Fa "X509 *subject" -.Fa "X509 *issuer" +.Fa "const X509 *subject" +.Fa "const X509 *issuer" .Fc .Ft OCSP_CERTID * .Fo OCSP_cert_id_new .Fa "const EVP_MD *dgst" -.Fa "X509_NAME *issuerName" -.Fa "ASN1_BIT_STRING *issuerKey" -.Fa "ASN1_INTEGER *serialNumber" +.Fa "const X509_NAME *issuerName" +.Fa "const ASN1_BIT_STRING *issuerKey" +.Fa "const ASN1_INTEGER *serialNumber" .Fc .Ft int .Fo OCSP_id_issuer_cmp @@ -224,3 +224,7 @@ returns 1 for success or 0 for failure. .Sh STANDARDS RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4: Details of the Protocol +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 3.2 . diff --git a/man/OCSP_request_add1_nonce.3 b/man/OCSP_request_add1_nonce.3 index 9b7f999c..036c937c 100644 --- a/man/OCSP_request_add1_nonce.3 +++ b/man/OCSP_request_add1_nonce.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OCSP_request_add1_nonce.3,v 1.3 2016/12/06 14:54:55 schwarze Exp $ +.\" $OpenBSD: OCSP_request_add1_nonce.3,v 1.4 2018/03/22 21:08:22 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt OCSP_REQUEST_ADD1_NONCE 3 .Os .Sh NAME @@ -157,3 +157,7 @@ only: this will happen if the responder doesn't support nonces. .Xr OCSP_resp_find_status 3 , .Xr OCSP_response_status 3 , .Xr OCSP_sendreq_new 3 +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 3.2 . diff --git a/man/OCSP_resp_find_status.3 b/man/OCSP_resp_find_status.3 index d06540d7..a32019c4 100644 --- a/man/OCSP_resp_find_status.3 +++ b/man/OCSP_resp_find_status.3 @@ -1,10 +1,11 @@ -.\" $OpenBSD: OCSP_resp_find_status.3,v 1.5 2016/12/25 22:15:10 schwarze Exp $ -.\" OpenSSL c952780c Jun 21 07:03:34 2016 -0400 +.\" $OpenBSD: OCSP_resp_find_status.3,v 1.9 2019/03/15 11:15:33 schwarze Exp $ +.\" full merge up to: OpenSSL c952780c Jun 21 07:03:34 2016 -0400 +.\" selective merge up to: OpenSSL 1212818e Sep 11 13:22:14 2018 +0100 .\" .\" This file is a derived work. .\" The changes are covered by the following Copyright and license: .\" -.\" Copyright (c) 2016 Ingo Schwarze +.\" Copyright (c) 2016, 2018 Ingo Schwarze .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -18,8 +19,9 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.\" The original file was written by Dr. Stephen Henson . -.\" Copyright (c) 2014 The OpenSSL Project. All rights reserved. +.\" The original file was written by Dr. Stephen Henson +.\" and David von Oheimb . +.\" Copyright (c) 2014, 2018 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 @@ -65,7 +67,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 15 2019 $ .Dt OCSP_RESP_FIND_STATUS 3 .Os .Sh NAME @@ -79,8 +81,10 @@ .Nm OCSP_resp_count , .Nm OCSP_resp_get0 , .Nm OCSP_resp_find , +.Nm OCSP_SINGLERESP_get0_id , .Nm OCSP_single_get0_status , -.Nm OCSP_check_validity +.Nm OCSP_check_validity , +.Nm OCSP_basic_verify .Nd OCSP response utility functions .Sh SYNOPSIS .In openssl/ocsp.h @@ -121,6 +125,10 @@ .Fa "OCSP_CERTID *id" .Fa "int last" .Fc +.Ft const OCSP_CERTID * +.Fo OCSP_SINGLERESP_get0_id +.Fa "const OCSP_SINGLERESP *single" +.Fc .Ft int .Fo OCSP_single_get0_status .Fa "OCSP_SINGLERESP *single" @@ -136,6 +144,13 @@ .Fa "long sec" .Fa "long maxsec" .Fc +.Ft int +.Fo OCSP_basic_verify +.Fa "OCSP_BASICRESP *bs" +.Fa "STACK_OF(X509) *certs" +.Fa "X509_STORE *st" +.Fa "unsigned long flags" +.Fc .Sh DESCRIPTION .Fn OCSP_SINGLERESP_new allocates and initializes an empty @@ -317,6 +332,63 @@ application. Any or all of these parameters can be set to .Dv NULL if their value is not required. +.Pp +.Fn OCSP_basic_verify +checks that the basic response message +.Fa bs +is correctly signed and that the signer certificate can be validated. +It takes +.Fa st +as the trusted store and +.Fa certs +as a set of untrusted intermediate certificates. +The function first tries to find the signer certificate of the response in +.Fa certs . +It also searches the certificates the responder may have included in +.Fa bs +unless the +.Fa flags +contain +.Dv OCSP_NOINTERN . +It fails if the signer certificate cannot be found. +Next, the function checks the signature of +.Fa bs +and fails on error unless the +.Fa flags +contain +.Dv OCSP_NOSIGS . +Then the function already returns +success if the +.Fa flags +contain +.Dv OCSP_NOVERIFY +or if the signer certificate was found in +.Fa certs +and the +.Fa flags +contain +.Dv OCSP_TRUSTOTHER . +Otherwise the function continues by validating the signer certificate. +To this end, all certificates in +.Fa certs +and in +.Fa bs +are considered as untrusted certificates for the construction of +the validation path for the signer certificate unless the +.Dv OCSP_NOCHAIN +flag is set. +After successful path +validation, the function returns success if the +.Dv OCSP_NOCHECKS +flag is set. +Otherwise it verifies that the signer certificate meets the OCSP issuer +criteria including potential delegation. +If this does not succeed and the +.Fa flags +do not contain +.Dv OCSP_NOEXPLICIT , +the function checks for explicit trust for OCSP signing +in the root CA certificate. .Sh RETURN VALUES .Fn OCSP_SINGLERESP_new , .Fn OCSP_CERTSTATUS_new , @@ -362,10 +434,18 @@ in .Fa id was not found. .Pp +.Fn OCSP_SINGLERESP_get0_id +returns an internal pointer to the certificate ID object used by +.Fa single ; +the returned pointer should not be freed by the caller. +.Pp .Fn OCSP_single_get0_status returns the status of .Fa single or -1 if an error occurred. +.Pp +.Fn OCSP_basic_verify +returns 1 on success, 0 on error, or -1 on fatal error such as malloc failure. .Sh SEE ALSO .Xr OCSP_cert_to_id 3 , .Xr OCSP_CRLID_new 3 , @@ -376,3 +456,23 @@ or -1 if an error occurred. .Sh STANDARDS RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.2: Response Syntax +.Sh HISTORY +.Fn OCSP_SINGLERESP_new , +.Fn OCSP_SINGLERESP_free , +.Fn OCSP_CERTSTATUS_new , +.Fn OCSP_CERTSTATUS_free , +.Fn OCSP_REVOKEDINFO_new , +.Fn OCSP_REVOKEDINFO_free , +.Fn OCSP_resp_find_status , +.Fn OCSP_resp_count , +.Fn OCSP_resp_get0 , +.Fn OCSP_resp_find , +.Fn OCSP_single_get0_status , +and +.Fn OCSP_check_validity +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn OCSP_SINGLERESP_get0_id +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/OCSP_response_status.3 b/man/OCSP_response_status.3 index 1ffa8a72..d720500f 100644 --- a/man/OCSP_response_status.3 +++ b/man/OCSP_response_status.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: OCSP_response_status.3,v 1.4 2016/12/25 22:15:10 schwarze Exp $ -.\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 +.\" $OpenBSD: OCSP_response_status.3,v 1.6 2018/03/22 21:08:22 schwarze Exp $ +.\" full merge up to: OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 +.\" selective merge up to: OpenSSL e23ac625 Jan 24 12:27:19 2018 -0500 .\" .\" This file is a derived work. .\" The changes are covered by the following Copyright and license: @@ -19,7 +20,7 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" The original file was written by Dr. Stephen Henson . -.\" Copyright (c) 2014, 2016 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2014, 2016, 2018 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 @@ -65,7 +66,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt OCSP_RESPONSE_STATUS 3 .Os .Sh NAME @@ -81,7 +82,8 @@ .Nm OCSP_RESPID_free , .Nm OCSP_response_create , .Nm OCSP_response_status , -.Nm OCSP_response_get1_basic +.Nm OCSP_response_get1_basic , +.Nm OCSP_basic_sign .Nd OCSP response functions .Sh SYNOPSIS .In openssl/ocsp.h @@ -118,6 +120,15 @@ .Fo OCSP_response_get1_basic .Fa "OCSP_RESPONSE *resp" .Fc +.Ft int +.Fo OCSP_basic_sign +.Fa "OCSP_BASICRESP *bs" +.Fa "X509 *signer" +.Fa "EVP_PKEY *key" +.Fa "const EVP_MD *dgst" +.Fa "STACK_OF(X509) *certs" +.Fa "unsigned long flags" +.Fc .Sh DESCRIPTION .Fn OCSP_RESPONSE_new allocates and initializes an empty @@ -206,6 +217,29 @@ object contained in .Fa resp . It is only called if the status of a response is .Dv OCSP_RESPONSE_STATUS_SUCCESSFUL . +.Pp +.Fn OCSP_basic_sign +signs the OCSP response +.Fa bs +using the certificate +.Fa signer , +the private key +.Fa key , +the digest +.Fa dgst , +and the additional certificates +.Fa certs . +If the +.Fa flags +option +.Dv OCSP_NOCERTS +is set, then no certificates will be included in the request. +If the +.Fa flags +option +.Dv OCSP_RESPID_KEY +is set, then the responder is identified by key ID +rather than by name. .Sh RETURN VALUES .Fn OCSP_RESPONSE_new and @@ -240,6 +274,9 @@ if an error occurred. .Pp .Fn OCSP_response_status returns a status value. +.Pp +.Fn OCSP_basic_sign +return 1 on success or 0 on failure. .Sh SEE ALSO .Xr OCSP_cert_to_id 3 , .Xr OCSP_request_add1_nonce 3 , @@ -249,3 +286,7 @@ returns a status value. .Sh STANDARDS RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.2: Response Syntax +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 3.2 . diff --git a/man/OCSP_sendreq_new.3 b/man/OCSP_sendreq_new.3 index 5900ac04..42cb4159 100644 --- a/man/OCSP_sendreq_new.3 +++ b/man/OCSP_sendreq_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OCSP_sendreq_new.3,v 1.4 2017/07/06 15:42:04 schwarze Exp $ +.\" $OpenBSD: OCSP_sendreq_new.3,v 1.7 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 6 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt OCSP_SENDREQ_NEW 3 .Os .Sh NAME @@ -228,6 +228,23 @@ Add a Host header for .Xr OCSP_REQUEST_new 3 , .Xr OCSP_resp_find_status 3 , .Xr OCSP_response_status 3 +.Sh HISTORY +.Fn OCSP_sendreq_bio +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . +.Pp +.Fn OCSP_sendreq_new , +.Fn OCSP_sendreq_nbio , +and +.Fn OCSP_REQ_CTX_free +first appeared in OpenSSL 0.9.8h and have been available since +.Ox 4.5 . +.Pp +.Fn OCSP_REQ_CTX_add1_header +and +.Fn OCSP_REQ_CTX_set1_req +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . .Sh CAVEATS These functions only perform a minimal HTTP query to a responder. If an application wishes to support more advanced features, it diff --git a/man/OPENSSL_VERSION_NUMBER.3 b/man/OPENSSL_VERSION_NUMBER.3 index 7c792f74..4f37962c 100644 --- a/man/OPENSSL_VERSION_NUMBER.3 +++ b/man/OPENSSL_VERSION_NUMBER.3 @@ -1,9 +1,28 @@ -.\" $OpenBSD: OPENSSL_VERSION_NUMBER.3,v 1.3 2016/11/28 14:51:03 schwarze Exp $ -.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" $OpenBSD: OPENSSL_VERSION_NUMBER.3,v 1.11 2019/03/15 12:32:15 schwarze Exp $ +.\" full merge up to: OpenSSL 1f13ad31 Dec 25 17:50:39 2017 +0800 .\" -.\" This file was written by Ulf Moeller and -.\" Richard Levitte . -.\" Copyright (c) 2000, 2002, 2014 The OpenSSL Project. All rights reserved. +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2017, 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Ulf Moeller , +.\" Richard Levitte , and +.\" Bodo Moeller . +.\" Copyright (c) 2000, 2002, 2015, 2016, 2017 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 @@ -49,18 +68,32 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 28 2016 $ +.Dd $Mdocdate: March 15 2019 $ .Dt OPENSSL_VERSION_NUMBER 3 .Os .Sh NAME .Nm OPENSSL_VERSION_NUMBER , +.Nm LIBRESSL_VERSION_NUMBER , +.Nm LIBRESSL_VERSION_TEXT , +.Nm OPENSSL_VERSION_TEXT , +.Nm OpenSSL_version_num , +.Nm OpenSSL_version , .Nm SSLeay , .Nm SSLeay_version .Nd get OpenSSL version number .Sh SYNOPSIS .In openssl/opensslv.h -.Fd #define OPENSSL_VERSION_NUMBER 0xnnnnnnnnnL +.Fd #define OPENSSL_VERSION_NUMBER 0x020000000L +.Fd #define LIBRESSL_VERSION_NUMBER 0x02nnnn00fL +.Fd #define LIBRESSL_VERSION_TEXT \(dqLibreSSL 2.n.n\(dq +.Fd #define OPENSSL_VERSION_TEXT LIBRESSL_VERSION_TEXT .In openssl/crypto.h +.Ft unsigned long +.Fn OpenSSL_version_num void +.Ft const char * +.Fo OpenSSL_version +.Fa "int t" +.Fc .Ft long .Fn SSLeay void .Ft const char * @@ -69,22 +102,35 @@ .Fc .Sh DESCRIPTION .Dv OPENSSL_VERSION_NUMBER -is a numeric release version identifier. +and +.Dv LIBRESSL_VERSION_NUMBER +are numeric release version identifiers. The first two digits contain the major release number, the third and fourth digits the minor release number, -the fifth and sixth digits the fix release number, -the seventh and eight digits the patch release number. -The final digit is 0 for development, 1 to e for betas 1 to 14, or f +and the fifth and sixth digits the fix release number. +For OpenSSL, the seventh and eight digits contain the patch release number +and the final digit is 0 for development, 1 to e for betas 1 to 14, or f for release. +For LibreSSL, +.Dv OPENSSL_VERSION_NUMBER +is always 0x020000000, +and +.Dv LIBRESSL_VERSION_NUMBER +always ends with 00f. .Pp For example: .Bd -literal -offset indent +OPENSSL_VERSION_NUMBER: 0x000906000 == 0.9.6 dev 0x000906023 == 0.9.6b beta 3 0x00090605f == 0.9.6e release +0x020000000 == 2.0.0 for any version of LibreSSL + +LIBRESSL_VERSION_NUMBER: +0x02070000f == LibreSSL 2.7.0 .Ed .Pp -Versions prior to 0.9.3 had identifiers < 0x0930. +OpenSSL versions prior to 0.9.3 had identifiers < 0x0930. For versions between 0.9.3 and 0.9.5, the seventh digit was 1 for release and 0 otherwise, and the eighth and ninth digits were the patch release number. @@ -95,53 +141,140 @@ For example: 0x000905000 == 0.9.5 dev .Ed .Pp -Version 0.9.5a had an interim interpretation that is like the current +OpenSSL version 0.9.5a had an interim interpretation that is like the current one, except the patch level got the highest bit set, to keep continuity. The number was therefore 0x0090581f. .Pp -For backward compatibility, SSLEAY_VERSION_NUMBER is also defined. -.Pp -.Fn SSLeay -returns this number. -The return value can be compared to the macro to make sure that the -correct version of the library has been loaded, especially when using -DLLs on Windows systems. +.Fn OpenSSL_version_num +returns +.Dv OPENSSL_VERSION_NUMBER . .Pp -.Fn SSLeay_version +.Fn OpenSSL_version returns different strings depending on .Fa t : .Bl -tag -width Ds -.It Dv SSLEAY_VERSION -The text variant of the version number and the release date. -For example, "OpenSSL 0.9.5a 1 Apr 2000". -.It Dv SSLEAY_CFLAGS +.It Dv OPENSSL_VERSION +The text variant of the version number, +.Dv OPENSSL_VERSION_TEXT . +For OpenSSL, it includes the release date, for example +.Qq OpenSSL 0.9.5a 1 Apr 2000 . +For LibreSSL, +.Dv LIBRESSL_VERSION_TEXT +is returned. +.It Dv OPENSSL_CFLAGS The compiler flags set for the compilation process in the form -"compiler: ..." if available or "compiler: information not available" +.Qq compiler: ... +if available or +.Qq compiler: information not available +otherwise. +LibreSSL never provides compiler information. +.It Dv OPENSSL_BUILT_ON +The date of the build process in the form +.Qq built on: ... +if available or +.Qq built on: date not available otherwise. -.It Dv SSLEAY_BUILT_ON -The date of the build process in the form "built on: ..." if available -or "built on: date not available" otherwise. -.It Dv SSLEAY_PLATFORM -The "Configure" target of the library build in the form "platform: ..." -if available or "platform: information not available" otherwise. -.It Dv SSLEAY_DIR -The "OPENSSLDIR" setting of the library build in the form "OPENSSLDIR: -"..."" if available or "OPENSSLDIR: N/A" otherwise. +LibreSSL never provides information on the build date. +.It Dv OPENSSL_PLATFORM +The Configure target of the library build in the form +.Qq platform: ... +if available or +.Qq platform: information not available +otherwise. +LibreSSL never provides platform information. +.It Dv OPENSSL_DIR +The +.Dv OPENSSLDIR +setting of the library build in the form +.Qq OPENSSLDIR: Qq ... +if available or +.Qq OPENSSLDIR: N/A +otherwise. +For LibreSSL, the default is +.Qq OPENSSLDIR: Qq /etc/ssl . +.It Dv OPENSSL_ENGINES_DIR +The +.Dv ENGINESDIR +setting of the library build in the form +.Qq ENGINESDIR: Qq ... +if available or +.Qq ENGINESDIR: N/A +otherwise. +LibreSSL never provides or uses an +.Dv ENGINESDIR . .El .Pp For an unknown .Fa t , -the text "not available" is returned. +the text +.Qq not available +is returned. +.Pp +For backward compatibility, +.Dv SSLEAY_VERSION_NUMBER +is an alias for +.Dv OPENSSL_VERSION_NUMBER +and +.Fn SSLeay +for +.Dv OpenSSL_version_num . +The legacy function +.Fn SSLeay_version +is similar to +.Fn OpenSSL_version +except that it takes arguments +.Dv SSLEAY_VERSION , +.Dv SSLEAY_CFLAGS , +.Dv SSLEAY_BUILT_ON , +.Dv SSLEAY_PLATFORM , +and +.Dv SSLEAY_DIR +which expand to +.Em other +numerical values than the corresponding +.Dv OPENSSL_* +macros. .Sh RETURN VALUES -The version number. +.Fn OpenSSL_version_num +and +.Fn SSLeay +return a constant version number. +.Pp +.Fn OpenSSL_version +and +.Fn SSLeay_version +return pointers to static strings. .Sh SEE ALSO .Xr crypto 3 .Sh HISTORY -.Fn SSLeay +.Fn SSLeay , +.Fn SSLeay_version , and .Dv SSLEAY_VERSION_NUMBER -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.6.0 and have been available since +.Ox 2.4 . +.Pp .Dv OPENSSL_VERSION_NUMBER -is available in all versions of OpenSSL. +first appeared in the first OpenSSL release, OpenSSL 0.9.1c, +and has been available since +.Ox 2.6 . +.Pp .Dv SSLEAY_DIR -was added in OpenSSL 0.9.7. +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Dv LIBRESSL_VERSION_NUMBER +first appeared in LibreSSL 2.0.0 and +.Ox 5.6 +and got its final format in LibreSSL 2.3.2 and +.Ox 5.9 . +.Dv LIBRESSL_VERSION_TEXT +first appeared in LibreSSL 2.2.2 and +.Ox 5.8 . +.Pp +.Fn OpenSSL_version_num +and +.Fn OpenSSL_version +first appeared in OpenSSL 1.1.0 +and have been available since LibreSSL 2.7.1 and +.Ox 6.3 . diff --git a/man/OPENSSL_cleanse.3 b/man/OPENSSL_cleanse.3 index ec84e83b..87da3fb9 100644 --- a/man/OPENSSL_cleanse.3 +++ b/man/OPENSSL_cleanse.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OPENSSL_cleanse.3,v 1.2 2016/11/29 21:29:19 jmc Exp $ +.\" $OpenBSD: OPENSSL_cleanse.3,v 1.3 2018/03/22 18:05:00 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 29 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt OPENSSL_CLEANSE 3 .Os .Sh NAME @@ -34,3 +34,7 @@ It is provided purely for compatibility with legacy application code. .Fn OPENSSL_cleanse has the same semantics as, and is a wrapper around, .Xr explicit_bzero 3 . +.Sh HISTORY +.Fn OPENSSL_cleanse +first appeared in OpenSSL 0.9.6h and has been available since +.Ox 3.4 . diff --git a/man/OPENSSL_config.3 b/man/OPENSSL_config.3 index a5fd5a8d..c2b5b38e 100644 --- a/man/OPENSSL_config.3 +++ b/man/OPENSSL_config.3 @@ -1,8 +1,25 @@ -.\" $OpenBSD: OPENSSL_config.3,v 1.6 2017/07/06 15:42:04 schwarze Exp $ -.\" OpenSSL ab6577a4 May 14 21:07:51 2014 +0100 +.\" $OpenBSD: OPENSSL_config.3,v 1.12 2018/04/07 20:47:40 jmc Exp $ +.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" -.\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2000, 2004, 2005 The OpenSSL Project. All rights reserved. +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Dr. Stephen Henson . +.\" Copyright (c) 2004 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 @@ -48,97 +65,67 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 6 2017 $ +.Dd $Mdocdate: April 7 2018 $ .Dt OPENSSL_CONFIG 3 .Os .Sh NAME .Nm OPENSSL_config , .Nm OPENSSL_no_config -.Nd simple OpenSSL configuration functions +.Nd simple crypto and ssl library configuration .Sh SYNOPSIS .In openssl/conf.h .Ft void .Fo OPENSSL_config -.Fa "const char *config_name" +.Fa "const char *appname" .Fc .Ft void .Fn OPENSSL_no_config void .Sh DESCRIPTION .Fn OPENSSL_config -configures OpenSSL using the standard -.Xr openssl.cnf 5 -configuration file name using -.Fa config_name . +initializes the crypto library with +.Xr OPENSSL_init_crypto 3 +and then calls +.Xr OPENSSL_load_builtin_modules 3 , +.Xr ENGINE_load_builtin_engines 3 , +and +.Xr CONF_modules_load_file 3 +with the standard configuration file and the given +.Fa appname . If -.Fa config_name +.Fa appname is -.Dv NULL +.Dv NULL , then the default name .Sy openssl_conf -will be used. +is used. Any errors are ignored. Further calls to .Fn OPENSSL_config -will have no effect. +have no effect. .Pp .Fn OPENSSL_no_config -disables configuration. -If called before -.Fn OPENSSL_config , -no configuration takes place. -.Pp -It is -.Sy strongly -recommended that -.Sy all -new applications call +suppresses the loading of any configuration file, so that any +future calls to .Fn OPENSSL_config -or the more sophisticated functions such as -.Xr CONF_modules_load 3 -during initialization (that is before starting any threads). -By doing this, an application does not need to keep track of all -configuration options and some new functionality can be supported -automatically. +or to +.Xr OPENSSL_init_crypto 3 +will ensure the library is initialized but no configuration +file will be loaded. .Pp -It is also possible to automatically call -.Fn OPENSSL_config -when an application calls -.Xr OpenSSL_add_all_algorithms 3 -by compiling an application with the preprocessor symbol -.Dv OPENSSL_LOAD_CONF -#define'd. -In this way configuration can be added without source changes. +Calling these functions is optional. +All required initialization of the crypto libraries happens +automatically when needed. .Pp -The environment variable -.Ev OPENSSL_CONF -can be set to specify the location of the configuration file. -.Pp -Currently ASN.1 OBJECT and ENGINE configuration can be performed. -.Pp -There are several reasons why calling the OpenSSL configuration routines -is advisable. -For example new ENGINE functionality was added to OpenSSL 0.9.7. -In OpenSSL 0.9.7 control functions can be supported by ENGINEs which can be -used (among other things) to load dynamic ENGINEs from shared libraries -(DSOs). -However very few applications currently support the control interface -and so very few can load and use dynamic ENGINEs. -Equally in future more sophisticated ENGINEs will require certain -control operations to customize them. -If an application calls -.Fn OPENSSL_config -it doesn't need to know or care about ENGINE control operations because -they can be performed by editing a configuration file. +If an application is compiled with the preprocessor symbol +.Dv OPENSSL_LOAD_CONF +#define'd, +.Xr OpenSSL_add_all_algorithms 3 +automatically calls +.Fn OPENSSL_config . .Pp Applications should free up configuration at application closedown by calling .Xr CONF_modules_free 3 . -.Sh RETURN VALUES -Neither -.Fn OPENSSL_config -nor -.Fn OPENSSL_no_config -return a value. .Sh FILES .Bl -tag -width /etc/ssl/openssl.cnf -compact .It Pa /etc/ssl/openssl.cnf @@ -146,26 +133,13 @@ standard configuration file .El .Sh SEE ALSO .Xr CONF_modules_free 3 , -.Xr CONF_modules_load 3 , +.Xr CONF_modules_load_file 3 , +.Xr OPENSSL_init_crypto 3 , +.Xr OPENSSL_load_builtin_modules 3 , .Xr openssl.cnf 5 .Sh HISTORY .Fn OPENSSL_config and .Fn OPENSSL_no_config -first appeared in OpenSSL 0.9.7. -.Sh CAVEATS -The -.Fn OPENSSL_config -function is designed to be a very simple "call it and forget it" -function. -As a result its behaviour is somewhat limited. -It ignores all errors silently and it can only load from the standard -configuration file location for example. -.Pp -It is however -.Sy much -better than nothing. -Applications which need finer control over their configuration -functionality should use the configuration functions such as -.Xr CONF_modules_load 3 -directly. +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/OPENSSL_init_crypto.3 b/man/OPENSSL_init_crypto.3 new file mode 100644 index 00000000..3a532550 --- /dev/null +++ b/man/OPENSSL_init_crypto.3 @@ -0,0 +1,87 @@ +.\" $OpenBSD: OPENSSL_init_crypto.3,v 1.3 2018/03/23 23:18:17 schwarze Exp $ +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: March 23 2018 $ +.Dt OPENSSL_INIT_CRYPTO 3 +.Os +.Sh NAME +.Nm OPENSSL_init_crypto +.Nd initialise the crypto library +.Sh SYNOPSIS +.In openssl/crypto.h +.Ft int +.Fo OPENSSL_init_crypto +.Fa "uint64_t options" +.Fa "const void *dummy" +.Fc +.Sh DESCRIPTION +If +.Fn OPENSSL_init_crypto +is called before any other crypto or ssl functions, the crypto +library is initialised by allocating various internal resources. +.Pp +The following +.Fa options +are supported: +.Bl -tag -width Ds +.It Dv OPENSSL_INIT_LOAD_CONFIG +At the end of the initialization, call +.Xr OPENSSL_config 3 +with a +.Dv NULL +argument, loading the default configuration file. +.It Dv OPENSSL_INIT_NO_LOAD_CONFIG +Ignore any later calls to +.Xr OPENSSL_config 3 . +.El +.Pp +The other +.Fa options +flags defined by OpenSSL are all ignored by LibreSSL. +The +.Fa dummy +argument has no effect. +.Pp +Calling this function is almost never useful because it is internally +called with an +.Fa options +argument of 0 by those functions in the crypto and ssl libraries +that require it. +It is safest to assume that any function may do so. +.Pp +If this function is called more than once, none of the calls except +the first one have any effect. +.Sh RETURN VALUES +.Fn OPENSSL_init_crypto +is intended to return 1 on success or 0 on error. +.Sh SEE ALSO +.Xr CONF_modules_load_file 3 , +.Xr OPENSSL_config 3 , +.Xr OPENSSL_init_ssl 3 , +.Xr OPENSSL_load_builtin_modules 3 , +.Xr openssl.cnf 5 +.Sh HISTORY +.Fn OPENSSL_init_crypto +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . +.Sh BUGS +.Fn OPENSSL_init_crypto +silently ignores almost all kinds of errors. +In particular, if memory allocation fails, initialisation is likely +to remain incomplete, the library may be in an inconsistent internal +state, but the return value will usually indicate success anyway. +There is no way for the application program to find out whether +library initialisation is actually complete, nor to get back to a +consistent state if it isn't. diff --git a/man/OPENSSL_init_ssl.3 b/man/OPENSSL_init_ssl.3 new file mode 100644 index 00000000..7530dbe4 --- /dev/null +++ b/man/OPENSSL_init_ssl.3 @@ -0,0 +1,61 @@ +.\" $OpenBSD: OPENSSL_init_ssl.3,v 1.2 2018/03/24 00:55:37 schwarze Exp $ +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: March 24 2018 $ +.Dt OPENSSL_INIT_SSL 3 +.Os +.Sh NAME +.Nm OPENSSL_init_ssl +.Nd initialise the crypto and ssl libraries +.Sh SYNOPSIS +.In openssl/ssl.h +.Ft int +.Fo OPENSSL_init_ssl +.Fa "uint64_t options" +.Fa "const void *dummy" +.Fc +.Sh DESCRIPTION +.Fn OPENSSL_init_ssl +calls +.Xr OPENSSL_init_crypto 3 +and also allocates various resources used internally by the ssl library. +.Pp +Calling it is never useful because it is automatically called +internally when needed. +.Pp +The +.Fa options +argument is passed on to +.Xr OPENSSL_init_crypto 3 +and the +.Fa dummy +argument is ignored. +.Pp +If this function is called more than once, +none of the calls except the first one have any effect. +.Sh RETURN VALUES +.Fn OPENSSL_init_ssl +is intended to return 1 on success or 0 on error. +.Sh SEE ALSO +.Xr CONF_modules_load_file 3 , +.Xr OPENSSL_init_crypto 3 +.Sh HISTORY +.Fn OPENSSL_init_ssl +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . +.Sh BUGS +.Fn OPENSSL_init_ssl +silently ignores even more configuration failures than +.Xr OPENSSL_init_crypto 3 . diff --git a/man/OPENSSL_load_builtin_modules.3 b/man/OPENSSL_load_builtin_modules.3 index d853bce0..fd9e656b 100644 --- a/man/OPENSSL_load_builtin_modules.3 +++ b/man/OPENSSL_load_builtin_modules.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OPENSSL_load_builtin_modules.3,v 1.4 2016/11/28 15:08:58 schwarze Exp $ +.\" $OpenBSD: OPENSSL_load_builtin_modules.3,v 1.5 2018/03/22 21:08:22 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 28 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt OPENSSL_LOAD_BUILTIN_MODULES 3 .Os .Sh NAME @@ -98,4 +98,6 @@ new modules are added. .Sh SEE ALSO .Xr OPENSSL_config 3 .Sh HISTORY -These functions first appeared in OpenSSL 0.9.7. +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 3.2 . diff --git a/man/OPENSSL_malloc.3 b/man/OPENSSL_malloc.3 index 5b841f1a..1b2ec55c 100644 --- a/man/OPENSSL_malloc.3 +++ b/man/OPENSSL_malloc.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OPENSSL_malloc.3,v 1.4 2016/11/29 21:29:19 jmc Exp $ +.\" $OpenBSD: OPENSSL_malloc.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 29 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt OPENSSL_MALLOC 3 .Os .Sh NAME @@ -86,3 +86,23 @@ functions. .Sh RETURN VALUES These functions return the same type and value as the corresponding standard functions. +.Sh HISTORY +.Fn CRYPTO_malloc , +.Fn CRYPTO_realloc , +and +.Fn CRYPTO_free +first appeared in SSLeay 0.6.4 and have been available since +.Ox 2.4 . +.Pp +.Fn OPENSSL_malloc , +.Fn OPENSSL_realloc , +and +.Fn OPENSSL_free +first appeared in OpenSSL 0.9.6 and have been available since +.Ox 2.9 . +.Pp +.Fn CRYPTO_strdup +and +.Fn OPENSSL_strdup +first appeared in OpenSSL 0.9.8j and have been available since +.Ox 4.5 . diff --git a/man/OPENSSL_sk_new.3 b/man/OPENSSL_sk_new.3 new file mode 100644 index 00000000..ff199d4a --- /dev/null +++ b/man/OPENSSL_sk_new.3 @@ -0,0 +1,595 @@ +.\" $OpenBSD: OPENSSL_sk_new.3,v 1.10 2018/08/08 18:21:02 tb Exp $ +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: August 8 2018 $ +.Dt OPENSSL_SK_NEW 3 +.Os +.Sh NAME +.Nm sk_new_null , +.Nm sk_new , +.Nm sk_set_cmp_func , +.Nm sk_dup , +.Nm sk_free , +.Nm sk_pop_free , +.Nm sk_num , +.Nm sk_value , +.Nm sk_find , +.Nm sk_find_ex , +.Nm sk_sort , +.Nm sk_is_sorted , +.Nm sk_push , +.Nm sk_unshift , +.Nm sk_insert , +.Nm sk_set , +.Nm sk_pop , +.Nm sk_shift , +.Nm sk_delete , +.Nm sk_delete_ptr , +.Nm sk_zero +.Nd variable-sized arrays of void pointers, called OpenSSL stacks +.Sh SYNOPSIS +.In openssl/stack.h +.Ft _STACK * +.Fn sk_new_null void +.Ft _STACK * +.Fo sk_new +.Fa "int (*compfunc)(const void *, const void *)" +.Fc +.Ft old_function_pointer +.Fo sk_set_cmp_func +.Fa "_STACK *stack" +.Fa "int (*compfunc)(const void *, const void *)" +.Fc +.Ft _STACK * +.Fo sk_dup +.Fa "_STACK *stack" +.Fc +.Ft void +.Fo sk_free +.Fa "_STACK *stack" +.Fc +.Ft void +.Fo sk_pop_free +.Fa "_STACK *stack" +.Fa "void (*freefunc)(void *)" +.Fc +.Ft int +.Fo sk_num +.Fa "const _STACK *stack" +.Fc +.Ft void * +.Fo sk_value +.Fa "const _STACK *stack" +.Fa "int index" +.Fc +.Ft int +.Fo sk_find +.Fa "_STACK *stack" +.Fa "void *wanted" +.Fc +.Ft int +.Fo sk_find_ex +.Fa "_STACK *stack" +.Fa "void *wanted" +.Fc +.Ft void +.Fo sk_sort +.Fa "_STACK *stack" +.Fc +.Ft int +.Fo sk_is_sorted +.Fa "const _STACK *stack" +.Fc +.Ft int +.Fo sk_push +.Fa "_STACK *stack" +.Fa "void *new_item" +.Fc +.Ft int +.Fo sk_unshift +.Fa "_STACK *stack" +.Fa "void *new_item" +.Fc +.Ft int +.Fo sk_insert +.Fa "_STACK *stack" +.Fa "void *new_item" +.Fa "int index" +.Fc +.Ft void * +.Fo sk_set +.Fa "_STACK *stack" +.Fa "int index" +.Fa "void *new_item" +.Fc +.Ft void * +.Fo sk_pop +.Fa "_STACK *stack" +.Fc +.Ft void * +.Fo sk_shift +.Fa "_STACK *stack" +.Fc +.Ft void * +.Fo sk_delete +.Fa "_STACK *stack" +.Fa "int index" +.Fc +.Ft void * +.Fo sk_delete_ptr +.Fa "_STACK *stack" +.Fa "void *wanted" +.Fc +.Ft void +.Fo sk_zero +.Fa "_STACK *stack" +.Fc +.Sh DESCRIPTION +OpenSSL introduced an idiosyncratic concept of variable sized arrays +of pointers and somewhat misleadingly called such an array a +.Dq stack . +Intrinsically, and as documented in this manual page, OpenSSL stacks +are not type safe but only handle +.Vt void * +function arguments and return values. +.Pp +OpenSSL also provides a fragile, unusually complicated system of +macro-generated wrappers that offers superficial type safety at the +expense of extensive obfuscation, implemented using large amounts +of autogenerated code involving exceedingly ugly, nested +.Xr cpp 1 +macros; see the +.Xr STACK_OF 3 +manual page for details. +.Pp +The fundamental data type is the +.Vt _STACK +structure. +It stores a variable number of void pointers +and remembers the number of pointers currently stored. +It can optionally hold a pointer to a comparison function. +As long as no comparison function is installed, the order of pointers +is meaningful; as soon as a comparison function is installed, it +becomes ill-defined. +.Pp +.Fn sk_new_null +allocates and initializes a new, empty stack. +.Fn sk_new +is identical except that it also installs +.Fa compfunc +as the comparison function for the new stack object. +.Fn sk_set_cmp_func +installs +.Fa compfunc +for the existing +.Fa stack . +The +.Fa compfunc +is allowed to be +.Dv NULL , +but the +.Fa stack +is not. +.Pp +.Fn sk_dup +creates a shallow copy of the given +.Fa stack , +which must not be a +.Dv NULL +pointer. +It neither copies the objects pointed to from the stack nor +increases their reference counts, but merely copies the pointers. +Extreme care must be taken in order to avoid freeing the memory twice, +for example by calling +.Fn sk_free +on one copy and only calling +.Fn sk_pop_free +on the other. +.Pp +.Fn sk_free +frees the given +.Fa stack . +It does not free any of the pointers stored on the stack. +Unless these pointers are merely copies of pointers owned by +other objects, they must be freed before calling +.Fn sk_free , +in order to avoid leaking memory. +If +.Fa stack +is a +.Dv NULL +pointer, no action occurs. +.Pp +.Fn sk_pop_free +is severely misnamed. +It does not at all do what one would expect from a function called +.Dq pop . +Instead, it does the same as +.Fn sk_free , +except that it also calls the function +.Fa freefunc +on each of the pointers contained in the +.Fa stack . +If the calls to +.Fa freefunc +are intended to free the memory in use by the objects on the stack, +ensure that no other pointers to the same objects remain elsewhere. +.Pp +.Fn sk_find +searches the +.Fa stack +for the +.Fa wanted +pointer. +If the +.Fa stack +contains more than one copy of the +.Fa wanted +pointer, only the first match is found. +If a comparison function is installed for the stack, the stack is +first sorted with +.Fn sk_sort , +and instead of comparing pointers, two pointers are considered to match +if the comparison function returns 0. +.Pp +.Fn sk_find_ex +is identical to +.Fn sk_find +except that if the +.Fa stack +is not empty but no match is found, +the index of some pointer considered closest to +.Fa wanted +is returned. +.Pp +.Fn sk_sort +sorts the +.Fa stack +using +.Xr qsort 3 +and the installed comparison function. +If +.Fa stack +is a +.Dv NULL +pointer or already considered sorted, no action occurs. +This function can only be called if a comparison function is installed. +.Pp +.Fn sk_is_sorted +reports whether the +.Fa stack +is considered sorted. +Calling +.Fn sk_new_null +or +.Fn sk_new , +successfuly calling +.Fn sk_push , +.Fn sk_unshift , +.Fn sk_insert , +or +.Fn sk_set , +or changing the comparison function sets the state to unsorted. +If a comparison function is installed, calling +.Fn sk_sort , +.Fn sk_find , +or +.Fn sk_find_ex +sets the state to sorted. +.Pp +.Fn sk_push +pushes +.Fa new_item +onto the end of the +.Fa stack , +increasing the number of pointers by 1. +If +.Fa stack +is a +.Dv NULL +pointer, no action occurs. +.Pp +.Fn sk_unshift +inserts +.Fa new_item +at the beginning of the +.Fa stack , +such that it gets the index 0. +The number of pointers increases by 1. +If +.Fa stack +is a +.Dv NULL +pointer, no action occurs. +.Pp +.Fn sk_insert +inserts the +.Fa new_item +into the +.Fa stack +such that it gets the given +.Fa index . +If +.Fa index +is less than 0 or greater than or equal to +.Fn sk_num stack , +the effect is the same as for +.Fn sk_push . +If +.Fa stack +is a +.Dv NULL +pointer, no action occurs. +.Pp +.Fn sk_set +replaces the pointer with the given +.Fa index +on the +.Fa stack +with the +.Fa new_item . +The old pointer is not freed, +which may leak memory if no copy of it exists elsewhere. +If +.Fa stack +is a +.Dv NULL +pointer or if +.Fa index +is less than 0 or greater than or equal to +.Fn sk_num stack , +no action occurs. +.Pp +.Fn sk_pop +and +.Fn sk_shift +remove the pointer with the highest or lowest index from the +.Fa stack , +respectively, reducing the number of pointers by 1. +If +.Fa stack +is a +.Dv NULL +pointer or if it is empty, no action occurs. +.Pp +.Fn sk_delete +removes the pointer with the given +.Fa index +from the +.Fa stack , +reducing the number of pointers by 1. +If +.Fa stack +is a +.Dv NULL +pointer or the +.Fa index +is less than 0 or greater than or equal to +.Fn sk_num stack , +no action occurs. +.Pp +.Fn sk_delete_ptr +removes the +.Fa wanted +pointer from the +.Fa stack , +reducing the number of pointers by 1 if it is found. +It never uses a comparison function +but only compares pointers themselves. +The +.Fa stack +pointer must not be +.Dv NULL . +.Pp +.Fn sk_zero +removes all pointers from the +.Fa stack . +It does not free any of the pointers. +Unless these pointers are merely copies of pointers owned by other +objects, they must be freed before calling +.Fn sk_zero , +in order to avoid leaking memory. +If +.Fa stack +is a +.Dv NULL +pointer, no action occurs. +.Sh RETURN VALUES +.Fn sk_new_null , +.Fn sk_new , +and +.Fn sk_dup +return a pointer to the newly allocated stack object or +.Dv NULL +if insufficient memory is available. +.Pp +.Fn sk_set_cmp_func +returns a pointer to the comparison function +that was previously installed for the +.Fa stack +or +.Dv NULL +if none was installed. +.Pp +.Fn sk_num +returns the number of pointers currently stored on the +.Fa stack , +or \-1 if +.Fa stack +is a +.Dv NULL +pointer. +.Pp +.Fn sk_value +returns the pointer with the given +.Fa index +from the +.Fa stack , +or +.Dv NULL +if +.Fa stack +is a +.Dv NULL +pointer or if the +.Fa index +is less than 0 or greater than or equal to +.Fn sk_num stack . +.Pp +.Fn sk_find +returns the lowest index considered to match or \-1 if +.Fa stack +is a +.Dv NULL +pointer or if no match is found. +.Pp +.Fn sk_find_ex +returns some index or \-1 if +.Fa stack +is a +.Dv NULL +pointer or empty. +.Pp +.Fn sk_is_sorted +returns 1 if the +.Fa stack +is considered sorted or if it is a +.Dv NULL +pointer, or 0 otherwise. +.Pp +.Fn sk_push , +.Fn sk_unshift , +and +.Fn sk_insert +return the new number of pointers on the +.Fa stack +or 0 if +.Fa stack +is a +.Dv NULL +pointer or if memory allocation fails. +.Pp +.Fn sk_set +returns +.Fa new_item +or +.Dv NULL +if +.Fa stack +is a +.Dv NULL +pointer or if the +.Fa index +is less than 0 or greater than or equal to +.Fn sk_num stack . +.Pp +.Fn sk_pop +and +.Fn sk_shift +return the deleted pointer or +.Dv NULL +if +.Fa stack +is a +.Dv NULL +pointer or if it is empty. +.Pp +.Fn sk_delete +returns the deleted pointer or +.Dv NULL +if +.Fa stack +is a +.Dv NULL +pointer or if the +.Fa index +is less than 0 or greater than or equal to +.Fn sk_num stack . +.Pp +.Fn sk_delete_ptr +returns +.Fa wanted +or +.Dv NULL +if it is not found. +.Sh HISTORY +.Fn sk_new_null , +.Fn sk_new , +.Fn sk_free , +.Fn sk_pop_free , +.Fn sk_num , +.Fn sk_value , +.Fn sk_find , +.Fn sk_push , +.Fn sk_unshift , +.Fn sk_insert , +.Fn sk_pop , +.Fn sk_shift , +.Fn sk_delete , +and +.Fn sk_delete_ptr +first appeared in SSLeay 0.5.1. +.Fn sk_set_cmp_func , +.Fn sk_dup , +and +.Fn sk_zero +first appeared in SSLeay 0.8.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn sk_set +first appeared in OpenSSL 0.9.3. +.Fn sk_sort +first appeared in OpenSSL 0.9.4. +Both functions have been available since +.Ox 2.6 . +.Pp +.Fn sk_is_sorted +first appeared in OpenSSL 0.9.7e and has been available since +.Ox 3.8 . +.Pp +.Fn sk_find_ex +first appeared in OpenSSL 0.9.8 and has been available since +.Ox 4.5 . +.Sh BUGS +Even if a comparison function is installed, empty stacks and +stacks containing a single pointer are sometimes considered +sorted and sometimes considered unsorted. +.Pp +If a comparison function is installed, the concept of +.Dq first match +in +.Fn sk_find +and +.Fn sk_find_ex +is ill-defined because +.Xr qsort 3 +is not a stable sorting function. +It is probably best to only assume that they return an arbitrary match. +.Pp +The concept of +.Dq closest +for +.Fn sk_find_ex +is even less clearly defined. +The match may sometimes be smaller and sometimes larger than +.Fa wanted , +even if both smaller and larger pointers exist in the +.Fa stack . +Besides, it is again ill-defined +which of several pointers that compare equal is selected. +It is probably best to not assume anything about the selection +for cases where there is no match. diff --git a/man/OpenSSL_add_all_algorithms.3 b/man/OpenSSL_add_all_algorithms.3 index 270298cb..aa884d8e 100644 --- a/man/OpenSSL_add_all_algorithms.3 +++ b/man/OpenSSL_add_all_algorithms.3 @@ -1,5 +1,5 @@ -.\" $OpenBSD: OpenSSL_add_all_algorithms.3,v 1.4 2016/11/28 16:40:27 schwarze Exp $ -.\" OpenSSL f672aee4 Feb 9 11:52:40 2016 -0500 +.\" $OpenBSD: OpenSSL_add_all_algorithms.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL b3696a55 Sep 2 09:35:50 2017 -0400 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2000, 2003, 2013 The OpenSSL Project. All rights reserved. @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt OPENSSL_ADD_ALL_ALGORITHMS 3 .Os .Sh NAME @@ -68,6 +68,11 @@ .Ft void .Fn EVP_cleanup void .Sh DESCRIPTION +These functions are deprecated. +It is never useful for any application program +to call any of them explicitly. +The library automatically calls them internally whenever needed. +.Pp OpenSSL keeps an internal table of digest algorithms and ciphers. It uses this table to look up ciphers via functions such as .Xr EVP_get_cipherbyname 3 . @@ -82,38 +87,33 @@ adds all digest algorithms to the table. adds all encryption algorithms to the table including password based encryption algorithms. .Pp -.Fn EVP_cleanup -removes all ciphers and digests from the table. +If any of the above functions is called more than once, +only the first call has an effect. .Pp -A typical application will call -.Fn OpenSSL_add_all_algorithms -initially and .Fn EVP_cleanup -before exiting. -.Pp -An application does not need to add algorithms to use them explicitly, -for example by -.Xr EVP_sha1 3 . -It just needs to add them if it (or any of the functions it calls) needs -to look up algorithms. -.Pp -The cipher and digest lookup functions are used in many parts of the -library. -If the table is not initialized, several functions will misbehave and -complain they cannot find algorithms. -This includes the PEM, PKCS#12, SSL and S/MIME libraries. -This is a common query in the OpenSSL mailing lists. -.Pp -Calling -.Fn OpenSSL_add_all_algorithms -links in all algorithms: as a result a statically linked executable can -be quite large. -If this is important, it is possible to just add the required ciphers and -digests. +removes all ciphers and digests from the table. .Sh SEE ALSO .Xr evp 3 , .Xr EVP_DigestInit 3 , -.Xr EVP_EncryptInit 3 +.Xr EVP_EncryptInit 3 , +.Xr OPENSSL_config 3 , +.Xr OPENSSL_init_crypto 3 +.Sh HISTORY +.Fn EVP_cleanup +and precursor functions +.Fn SSLeay_add_all_algorithms , +.Fn SSLeay_add_all_ciphers , +and +.Fn SSLeay_add_all_digests +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn OpenSSL_add_all_algorithms , +.Fn OpenSSL_add_all_ciphers , +and +.Fn OpenSSL_add_all_digests +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . .Sh BUGS Although the functions do not return error codes, it is possible for them to fail. diff --git a/man/PEM_bytes_read_bio.3 b/man/PEM_bytes_read_bio.3 index d706a8ad..b3cb143c 100644 --- a/man/PEM_bytes_read_bio.3 +++ b/man/PEM_bytes_read_bio.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PEM_bytes_read_bio.3,v 1.1 2017/08/20 20:15:13 schwarze Exp $ +.\" $OpenBSD: PEM_bytes_read_bio.3,v 1.2 2018/03/22 21:08:22 schwarze Exp $ .\" OpenSSL PEM_bytes_read_bio.pod 7671342e Feb 29 15:47:12 2016 -0600 .\" .\" This file was written by Benjamin Kaduk . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt PEM_BYTES_READ_BIO 3 .Os .Sh NAME @@ -110,3 +110,7 @@ returns 1 for success or 0 for failure. .Sh SEE ALSO .Xr PEM_read 3 , .Xr PEM_read_bio_PrivateKey 3 +.Sh HISTORY +.Fn PEM_bytes_read_bio +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . diff --git a/man/PEM_read.3 b/man/PEM_read.3 index 6fe41bd7..48ff4157 100644 --- a/man/PEM_read.3 +++ b/man/PEM_read.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PEM_read.3,v 1.3 2017/08/20 20:15:13 schwarze Exp $ +.\" $OpenBSD: PEM_read.3,v 1.6 2018/05/13 14:44:14 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Viktor Dukhovni @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: May 13 2018 $ .Dt PEM_READ 3 .Os .Sh NAME @@ -65,17 +65,17 @@ .Ft int .Fo PEM_write .Fa "FILE *fp" -.Fa "char *name" -.Fa "char *header" -.Fa "unsigned char *data" +.Fa "const char *name" +.Fa "const char *header" +.Fa "const unsigned char *data" .Fa "long len" .Fc .Ft int .Fo PEM_write_bio .Fa "BIO *bp" .Fa "const char *name" -.Fa "char *header" -.Fa "unsigned char *data" +.Fa "const char *header" +.Fa "ocnst unsigned char *data" .Fa "long len" .Fc .Ft int @@ -282,3 +282,17 @@ is likely meaningless if these functions fail. .Xr ERR_peek_last_error 3 , .Xr PEM_bytes_read_bio 3 , .Xr PEM_read_bio_PrivateKey 3 +.Sh HISTORY +.Fn PEM_write , +.Fn PEM_read , +and +.Fn PEM_do_header +appeared in SSLeay 0.4 or earlier. +.Fn PEM_get_EVP_CIPHER_INFO +first appeared in SSLeay 0.5.1. +.Fn PEM_write_bio +and +.Fn PEM_read_bio +first appeared in SSLeay 0.6.0. +These functions have been available since +.Ox 2.4 . diff --git a/man/PEM_read_SSL_SESSION.3 b/man/PEM_read_SSL_SESSION.3 index 23b811db..b9987ebf 100644 --- a/man/PEM_read_SSL_SESSION.3 +++ b/man/PEM_read_SSL_SESSION.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PEM_read_SSL_SESSION.3,v 1.1 2016/11/28 21:05:21 schwarze Exp $ +.\" $OpenBSD: PEM_read_SSL_SESSION.3,v 1.3 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL doc/man3/PEM_read_CMS.pod b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Rich Salz . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt PEM_READ_SSL_SESSION 3 .Os .Sh NAME @@ -133,3 +133,14 @@ and return the number of bytes written or 0 on error. .Sh SEE ALSO .Xr PEM_read 3 +.Sh HISTORY +.Fn PEM_read_SSL_SESSION +and +.Fn PEM_write_SSL_SESSION +first appeared in SSLeay 0.5.2. +.Fn PEM_read_bio_SSL_SESSION +and +.Fn PEM_write_bio_SSL_SESSION +first appeared in SSLeay 0.6.0. +These functions have been available since +.Ox 2.4 . diff --git a/man/PEM_read_bio_PrivateKey.3 b/man/PEM_read_bio_PrivateKey.3 index ec8f81c4..1fa4d75e 100644 --- a/man/PEM_read_bio_PrivateKey.3 +++ b/man/PEM_read_bio_PrivateKey.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PEM_read_bio_PrivateKey.3,v 1.8 2017/08/20 20:15:13 schwarze Exp $ +.\" $OpenBSD: PEM_read_bio_PrivateKey.3,v 1.13 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt PEM_READ_BIO_PRIVATEKEY 3 .Os .Sh NAME @@ -1216,6 +1216,119 @@ pass_cb(char *buf, int size, int rwflag, void *u) .Xr BIO_new 3 , .Xr PEM_bytes_read_bio 3 , .Xr PEM_read 3 +.Sh HISTORY +.Fn PEM_read_X509 +and +.Fn PEM_write_X509 +appeared in SSLeay 0.4 or earlier. +.Fn PEM_read_X509_REQ , +.Fn PEM_write_X509_REQ , +.Fn PEM_read_X509_CRL , +and +.Fn PEM_write_X509_CRL +first appeared in SSLeay 0.4.4. +.Fn PEM_read_RSAPrivateKey , +.Fn PEM_write_RSAPrivateKey , +.Fn PEM_read_DHparams , +.Fn PEM_write_DHparams , +.Fn PEM_read_PKCS7 , +and +.Fn PEM_write_PKCS7 +first appeared in SSLeay 0.5.1. +.Fn PEM_read_bio_PrivateKey , +.Fn PEM_read_PrivateKey , +.Fn PEM_read_bio_RSAPrivateKey , +.Fn PEM_write_bio_RSAPrivateKey , +.Fn PEM_read_bio_DSAPrivateKey , +.Fn PEM_read_DSAPrivateKey , +.Fn PEM_write_bio_DSAPrivateKey , +.Fn PEM_write_DSAPrivateKey , +.Fn PEM_read_bio_DHparams , +.Fn PEM_write_bio_DHparams , +.Fn PEM_read_bio_X509 , +.Fn PEM_write_bio_X509 , +.Fn PEM_read_bio_X509_REQ , +.Fn PEM_write_bio_X509_REQ , +.Fn PEM_read_bio_X509_CRL , +.Fn PEM_write_bio_X509_CRL , +.Fn PEM_read_bio_PKCS7 , +and +.Fn PEM_write_bio_PKCS7 +first appeared in SSLeay 0.6.0. +.Fn PEM_write_bio_PrivateKey , +.Fn PEM_write_PrivateKey , +.Fn PEM_read_bio_DSAparams , +.Fn PEM_read_DSAparams , +.Fn PEM_write_bio_DSAparams , +and +.Fn PEM_write_DSAparams +first appeared in SSLeay 0.8.0. +.Fn PEM_read_bio_RSAPublicKey , +.Fn PEM_read_RSAPublicKey , +.Fn PEM_write_bio_RSAPublicKey , +and +.Fn PEM_write_RSAPublicKey +first appeared in SSLeay 0.8.1. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn PEM_write_bio_PKCS8PrivateKey , +.Fn PEM_write_PKCS8PrivateKey , +.Fn PEM_read_bio_PKCS8 , +.Fn PEM_read_PKCS8 , +.Fn PEM_write_bio_PKCS8 , +.Fn PEM_write_PKCS8 , +.Fn PEM_read_bio_PKCS8_PRIV_KEY_INFO , +.Fn PEM_read_PKCS8_PRIV_KEY_INFO , +.Fn PEM_write_bio_PKCS8_PRIV_KEY_INFO , +.Fn PEM_write_PKCS8_PRIV_KEY_INFO , +.Fn PEM_read_bio_NETSCAPE_CERT_SEQUENCE , +.Fn PEM_read_NETSCAPE_CERT_SEQUENCE , +.Fn PEM_write_bio_NETSCAPE_CERT_SEQUENCE , +and +.Fn PEM_write_NETSCAPE_CERT_SEQUENCE +first appeared in OpenSSL 0.9.4 and have been available since +.Ox 2.6 . +.Pp +.Fn PEM_write_bio_PKCS8PrivateKey_nid , +.Fn PEM_write_PKCS8PrivateKey_nid , +.Fn PEM_read_bio_PUBKEY , +.Fn PEM_read_PUBKEY , +.Fn PEM_write_bio_PUBKEY , +.Fn PEM_write_PUBKEY , +.Fn PEM_read_bio_RSA_PUBKEY , +.Fn PEM_read_RSA_PUBKEY , +.Fn PEM_write_bio_RSA_PUBKEY , +.Fn PEM_write_RSA_PUBKEY , +.Fn PEM_read_bio_DSA_PUBKEY , +.Fn PEM_read_DSA_PUBKEY , +.Fn PEM_write_bio_DSA_PUBKEY , +.Fn PEM_write_DSA_PUBKEY , +.Fn PEM_write_bio_X509_REQ_NEW , +.Fn PEM_write_X509_REQ_NEW , +.Fn PEM_read_bio_X509_AUX , +.Fn PEM_read_X509_AUX , +.Fn PEM_write_bio_X509_AUX , +and +.Fn PEM_write_X509_AUX +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn PEM_read_bio_ECPKParameters , +.Fn PEM_read_ECPKParameters , +.Fn PEM_write_bio_ECPKParameters , +.Fn PEM_write_ECPKParameters , +.Fn PEM_read_bio_ECPrivateKey , +.Fn PEM_read_ECPrivateKey , +.Fn PEM_write_bio_ECPrivateKey , +.Fn PEM_write_ECPrivateKey , +.Fn PEM_read_bio_EC_PUBKEY , +.Fn PEM_read_EC_PUBKEY , +.Fn PEM_write_bio_EC_PUBKEY , +and +.Fn PEM_write_EC_PUBKEY +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . .Sh CAVEATS A frequent cause of problems is attempting to use the PEM routines like this: diff --git a/man/PEM_write_bio_PKCS7_stream.3 b/man/PEM_write_bio_PKCS7_stream.3 index e90ed552..30bab9f0 100644 --- a/man/PEM_write_bio_PKCS7_stream.3 +++ b/man/PEM_write_bio_PKCS7_stream.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PEM_write_bio_PKCS7_stream.3,v 1.7 2016/12/14 21:22:06 jmc Exp $ +.\" $OpenBSD: PEM_write_bio_PKCS7_stream.3,v 1.8 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 14 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt PEM_WRITE_BIO_PKCS7_STREAM 3 .Os .Sh NAME @@ -85,4 +85,5 @@ returns 1 for success or 0 for failure. .Xr SMIME_write_PKCS7 3 .Sh HISTORY .Fn PEM_write_bio_PKCS7_stream -was added to OpenSSL 1.0.0. +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . diff --git a/man/PKCS12_SAFEBAG_new.3 b/man/PKCS12_SAFEBAG_new.3 index 603c27be..d174babd 100644 --- a/man/PKCS12_SAFEBAG_new.3 +++ b/man/PKCS12_SAFEBAG_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS12_SAFEBAG_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: PKCS12_SAFEBAG_new.3,v 1.3 2018/03/21 17:57:48 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt PKCS12_SAFEBAG_NEW 3 .Os .Sh NAME @@ -93,3 +93,11 @@ if an error occurs. .Sh STANDARDS RFC 7292: PKCS #12: Personal Information Exchange Syntax, section 4.2: The SafeBag Type +.Sh HISTORY +.Fn PKCS12_SAFEBAG_new , +.Fn PKCS12_SAFEBAG_free , +.Fn PKCS12_BAGS_new , +and +.Fn PKCS12_BAGS_free +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . diff --git a/man/PKCS12_create.3 b/man/PKCS12_create.3 index 162ff7cf..67c81418 100644 --- a/man/PKCS12_create.3 +++ b/man/PKCS12_create.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: PKCS12_create.3,v 1.4 2016/11/28 22:41:38 schwarze Exp $ -.\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 +.\" $OpenBSD: PKCS12_create.3,v 1.7 2018/05/13 14:52:23 schwarze Exp $ +.\" full merge up to: OpenSSL 05ea606a May 20 20:52:46 2016 -0400 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2002, 2015 The OpenSSL Project. All rights reserved. @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 28 2016 $ +.Dd $Mdocdate: May 13 2018 $ .Dt PKCS12_CREATE 3 .Os .Sh NAME @@ -58,8 +59,8 @@ .In openssl/pkcs12.h .Ft PKCS12 * .Fo PKCS12_create -.Fa "char *pass" -.Fa "char *name" +.Fa "const char *pass" +.Fa "const char *name" .Fa "EVP_PKEY *pkey" .Fa "X509 *cert" .Fa "STACK_OF(X509) *ca" @@ -154,10 +155,19 @@ then this will be used for the corresponding or .Sy localKeyID in the PKCS12 structure. +.Sh RETURN VALUES +.Fn PKCS12_create +returns a valid +.Vt PKCS12 +structure or +.Dv NULL +if an error occurred. .Sh SEE ALSO .Xr d2i_PKCS12 3 .Sh HISTORY -PKCS12_create was added in OpenSSL 0.9.3. +.Fn PKCS12_create +first appeared in OpenSSL 0.9.3 and has been available since +.Ox 2.6 . .Pp Before OpenSSL 0.9.8, neither .Fa pkey diff --git a/man/PKCS12_new.3 b/man/PKCS12_new.3 index 0f540487..29080b67 100644 --- a/man/PKCS12_new.3 +++ b/man/PKCS12_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS12_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: PKCS12_new.3,v 1.3 2018/03/21 17:57:48 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt PKCS12_NEW 3 .Os .Sh NAME @@ -88,3 +88,11 @@ if an error occurs. .Xr X509_SIG_new 3 .Sh STANDARDS RFC 7292: PKCS #12: Personal Information Exchange Syntax +.Sh HISTORY +.Fn PKCS12_new , +.Fn PKCS12_free , +.Fn PKCS12_MAC_DATA_new , +and +.Fn PKCS12_MAC_DATA_free +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . diff --git a/man/PKCS12_newpass.3 b/man/PKCS12_newpass.3 index b651a575..48e4060c 100644 --- a/man/PKCS12_newpass.3 +++ b/man/PKCS12_newpass.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS12_newpass.3,v 1.1 2016/11/28 23:02:16 schwarze Exp $ +.\" $OpenBSD: PKCS12_newpass.3,v 1.2 2018/03/22 16:06:33 schwarze Exp $ .\" OpenSSL c95a8b4e May 5 14:26:26 2016 +0100 .\" .\" This file was written by Jeffrey Walton . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 28 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt PKCS12_NEWPASS 3 .Os .Sh NAME @@ -149,6 +149,10 @@ int main(int argc, char **argv) .Sh SEE ALSO .Xr ERR_get_error 3 , .Xr PKCS12_create 3 +.Sh HISTORY +.Fn PKCS12_newpass +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . .Sh BUGS The password format is a NUL terminated ASCII string which is converted to Unicode form internally. diff --git a/man/PKCS12_parse.3 b/man/PKCS12_parse.3 index 1caa1a7f..51e78d94 100644 --- a/man/PKCS12_parse.3 +++ b/man/PKCS12_parse.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS12_parse.3,v 1.4 2016/11/28 22:41:38 schwarze Exp $ +.\" $OpenBSD: PKCS12_parse.3,v 1.5 2018/03/21 17:57:48 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 28 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt PKCS12_PARSE 3 .Os .Sh NAME @@ -121,7 +121,9 @@ The error can be obtained from .Sh SEE ALSO .Xr d2i_PKCS12 3 .Sh HISTORY -PKCS12_parse was added in OpenSSL 0.9.3. +.Fn PKCS12_parse +first appeared in OpenSSL 0.9.3 and has been available since +.Ox 2.6 . .Sh BUGS Only a single private key and corresponding certificate is returned by this function. diff --git a/man/PKCS5_PBKDF2_HMAC.3 b/man/PKCS5_PBKDF2_HMAC.3 index 5b79d7b2..b6dc6396 100644 --- a/man/PKCS5_PBKDF2_HMAC.3 +++ b/man/PKCS5_PBKDF2_HMAC.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS5_PBKDF2_HMAC.3,v 1.4 2016/11/28 23:27:55 schwarze Exp $ +.\" $OpenBSD: PKCS5_PBKDF2_HMAC.3,v 1.6 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Jeffrey Walton . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 28 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt PKCS5_PBKDF2_HMAC 3 .Os .Sh NAME @@ -154,3 +154,11 @@ return 1 on success or 0 on error. .Xr evp 3 , .Xr EVP_BytesToKey 3 , .Xr RAND_bytes 3 +.Sh HISTORY +.Fn PKCS5_PBKDF2_HMAC_SHA1 +first appeared in OpenSSL 0.9.4 and has been available since +.Ox 2.6 . +.Pp +.Fn PKCS5_PBKDF2_HMAC +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . diff --git a/man/PKCS7_decrypt.3 b/man/PKCS7_decrypt.3 index 234d7635..1a3ba7c6 100644 --- a/man/PKCS7_decrypt.3 +++ b/man/PKCS7_decrypt.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS7_decrypt.3,v 1.6 2016/12/13 15:00:22 schwarze Exp $ +.\" $OpenBSD: PKCS7_decrypt.3,v 1.7 2018/03/22 16:06:33 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 13 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt PKCS7_DECRYPT 3 .Os .Sh NAME @@ -107,7 +107,8 @@ The error can be obtained from .Xr PKCS7_new 3 .Sh HISTORY .Fn PKCS7_decrypt -was added to OpenSSL 0.9.5. +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . .Sh BUGS .Fn PKCS7_decrypt must be passed the correct recipient key and certificate. diff --git a/man/PKCS7_encrypt.3 b/man/PKCS7_encrypt.3 index 8934191a..a8717d31 100644 --- a/man/PKCS7_encrypt.3 +++ b/man/PKCS7_encrypt.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS7_encrypt.3,v 1.6 2017/01/12 16:13:51 jmc Exp $ +.\" $OpenBSD: PKCS7_encrypt.3,v 1.8 2018/03/23 23:18:17 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 12 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt PKCS7_ENCRYPT 3 .Os .Sh NAME @@ -158,8 +158,10 @@ The error can be obtained from .Xr PKCS7_decrypt 3 , .Xr PKCS7_new 3 .Sh HISTORY -.Xr PKCS7_decrypt 3 -was added to OpenSSL 0.9.5. +.Fn PKCS7_encrypt +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . +.Pp The .Dv PKCS7_STREAM flag was first supported in OpenSSL 1.0.0. diff --git a/man/PKCS7_new.3 b/man/PKCS7_new.3 index 7f8cffd8..8d1c01ed 100644 --- a/man/PKCS7_new.3 +++ b/man/PKCS7_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS7_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: PKCS7_new.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt PKCS7_NEW 3 .Os .Sh NAME @@ -253,3 +253,7 @@ frees .Xr SMIME_write_PKCS7 3 .Sh STANDARDS RFC 2315: PKCS #7: Cryptographic Message Syntax Version 1.5 +.Sh HISTORY +These functions first appeared in SSLeay 0.5.1 +and have been available since +.Ox 2.4 . diff --git a/man/PKCS7_sign.3 b/man/PKCS7_sign.3 index fc836d5d..aea1a265 100644 --- a/man/PKCS7_sign.3 +++ b/man/PKCS7_sign.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS7_sign.3,v 1.7 2017/01/12 16:13:51 jmc Exp $ +.\" $OpenBSD: PKCS7_sign.3,v 1.8 2018/03/22 16:06:33 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 12 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt PKCS7_SIGN 3 .Os .Sh NAME @@ -232,7 +232,8 @@ The error can be obtained from .Xr PKCS7_verify 3 .Sh HISTORY .Fn PKCS7_sign -was added to OpenSSL 0.9.5. +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . .Pp The .Dv PKCS7_PARTIAL diff --git a/man/PKCS7_sign_add_signer.3 b/man/PKCS7_sign_add_signer.3 index d4863210..72c82c8a 100644 --- a/man/PKCS7_sign_add_signer.3 +++ b/man/PKCS7_sign_add_signer.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS7_sign_add_signer.3,v 1.7 2017/01/06 18:21:55 schwarze Exp $ +.\" $OpenBSD: PKCS7_sign_add_signer.3,v 1.8 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt PKCS7_SIGN_ADD_SIGNER 3 .Os .Sh NAME @@ -176,4 +176,5 @@ if an error occurs. .Xr PKCS7_sign 3 .Sh HISTORY .Fn PKCS7_sign_add_signer -was added to OpenSSL 1.0.0. +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . diff --git a/man/PKCS7_verify.3 b/man/PKCS7_verify.3 index f046a0b8..e800c90c 100644 --- a/man/PKCS7_verify.3 +++ b/man/PKCS7_verify.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS7_verify.3,v 1.5 2016/12/13 15:00:22 schwarze Exp $ +.\" $OpenBSD: PKCS7_verify.3,v 1.7 2018/03/22 16:06:33 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 13 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt PKCS7_VERIFY 3 .Os .Sh NAME @@ -226,10 +226,14 @@ The error can be obtained from .Sh SEE ALSO .Xr ERR_get_error 3 , .Xr PKCS7_new 3 , -.Xr PKCS7_sign 3 +.Xr PKCS7_sign 3 , +.Xr X509_STORE_new 3 .Sh HISTORY .Fn PKCS7_verify -was added to OpenSSL 0.9.5 . +and +.Fn PKCS7_get0_signers +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . .Sh BUGS The trusted certificate store is not searched for the signer's certificate. diff --git a/man/PKCS8_PRIV_KEY_INFO_new.3 b/man/PKCS8_PRIV_KEY_INFO_new.3 index 8c6dba35..03079927 100644 --- a/man/PKCS8_PRIV_KEY_INFO_new.3 +++ b/man/PKCS8_PRIV_KEY_INFO_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKCS8_PRIV_KEY_INFO_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: PKCS8_PRIV_KEY_INFO_new.3,v 1.3 2018/03/21 17:57:48 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt PKCS8_PRIV_KEY_INFO_NEW 3 .Os .Sh NAME @@ -54,3 +54,9 @@ if an error occurs. .Xr X509_ATTRIBUTE_new 3 .Sh STANDARDS RFC 5208: PKCS#8: Private-Key Information Syntax Specification +.Sh HISTORY +.Fn PKCS8_PRIV_KEY_INFO_new +and +.Fn PKCS8_PRIV_KEY_INFO_free +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . diff --git a/man/PKEY_USAGE_PERIOD_new.3 b/man/PKEY_USAGE_PERIOD_new.3 index 888859b1..2c32bdae 100644 --- a/man/PKEY_USAGE_PERIOD_new.3 +++ b/man/PKEY_USAGE_PERIOD_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PKEY_USAGE_PERIOD_new.3,v 1.3 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: PKEY_USAGE_PERIOD_new.3,v 1.4 2018/03/21 16:09:51 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt PKEY_USAGE_PERIOD_NEW 3 .Os .Sh NAME @@ -65,3 +65,9 @@ in RFC 3280, which specified the certificate extension but deprecated its use, was removed. Use of this ISO standard extension is neither deprecated nor recommended for use in the Internet PKI." +.Sh HISTORY +.Fn PKEY_USAGE_PERIOD_new +and +.Fn PKEY_USAGE_PERIOD_free +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . diff --git a/man/POLICYINFO_new.3 b/man/POLICYINFO_new.3 index e746759a..7dab0a56 100644 --- a/man/POLICYINFO_new.3 +++ b/man/POLICYINFO_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: POLICYINFO_new.3,v 1.3 2016/12/28 20:29:15 schwarze Exp $ +.\" $OpenBSD: POLICYINFO_new.3,v 1.5 2018/03/23 00:09:11 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt POLICYINFO_NEW 3 .Os .Sh NAME @@ -189,6 +189,28 @@ section 4.2.1.5: Policy Mappings .It section 4.2.1.11: Policy Constraints .El +.Sh HISTORY +.Fn POLICYINFO_new , +.Fn POLICYINFO_free , +.Fn CERTIFICATEPOLICIES_new , +.Fn CERTIFICATEPOLICIES_free , +.Fn POLICYQUALINFO_new , +.Fn POLICYQUALINFO_free , +.Fn USERNOTICE_new , +.Fn USERNOTICE_free , +.Fn NOTICEREF_new , +and +.Fn NOTICEREF_free +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . +.Pp +.Fn POLICY_MAPPING_new , +.Fn POLICY_MAPPING_free , +.Fn POLICY_CONSTRAINTS_new , +and +.Fn POLICY_CONSTRAINTS_free +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . .Sh BUGS This is a lot of nested data structures, but most of them are designed to have almost no effect. diff --git a/man/PROXY_POLICY_new.3 b/man/PROXY_POLICY_new.3 index 387ee3fb..c3553716 100644 --- a/man/PROXY_POLICY_new.3 +++ b/man/PROXY_POLICY_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: PROXY_POLICY_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: PROXY_POLICY_new.3,v 1.3 2018/03/22 22:07:12 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt PROXY_POLICY_NEW 3 .Os .Sh NAME @@ -89,3 +89,7 @@ if an error occurs. .Sh STANDARDS RFC 3820: Internet X.509 Public Key Infrastructure (PKI) Proxy Certificate Profile +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.7g +and have been available since +.Ox 3.8 . diff --git a/man/RAND_add.3 b/man/RAND_add.3 index 10ab0965..5404f696 100644 --- a/man/RAND_add.3 +++ b/man/RAND_add.3 @@ -1,4 +1,5 @@ -.\" $OpenBSD: RAND_add.3,v 1.5 2016/12/15 06:52:02 jmc Exp $ +.\" $OpenBSD: RAND_add.3,v 1.10 2018/03/27 17:35:50 schwarze Exp $ +.\" content checked up to: OpenSSL c16de9d8 Aug 31 23:16:22 2017 +0200 .\" .\" Copyright (c) 2014 Miod Vallat .\" @@ -14,12 +15,13 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 15 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RAND_ADD 3 .Os .Sh NAME .Nm RAND_add , .Nm RAND_cleanup , +.Nm RAND_poll , .Nm RAND_seed , .Nm RAND_status .Nd manipulate the PRNG state @@ -33,6 +35,8 @@ .Fc .Ft void .Fn RAND_cleanup void +.Ft int +.Fn RAND_poll void .Ft void .Fo RAND_seed .Fa "const void *buf" @@ -47,5 +51,23 @@ generator to be controlled by external sources. They are kept for ABI compatibility but are no longer functional, and should not be used in new programs. .Sh RETURN VALUES +.Fn RAND_poll +and +.Fn RAND_status +always return 1. +.Sh HISTORY +.Fn RAND_cleanup +and +.Fn RAND_seed +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp +.Fn RAND_add +and .Fn RAND_status -always returns 1. +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn RAND_poll +first appeared in OpenSSL 0.9.6 and has been available since +.Ox 2.9 . diff --git a/man/RAND_bytes.3 b/man/RAND_bytes.3 index 78847369..19427a82 100644 --- a/man/RAND_bytes.3 +++ b/man/RAND_bytes.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RAND_bytes.3,v 1.3 2016/11/29 00:26:23 schwarze Exp $ +.\" $OpenBSD: RAND_bytes.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 29 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RAND_BYTES 3 .Os .Sh NAME @@ -98,8 +98,11 @@ returns 1. returns 1. .Sh HISTORY .Fn RAND_bytes -is available in all versions of SSLeay and OpenSSL. -It has a return -value since OpenSSL 0.9.5. +first appeared in SSLeay 0.5.1 and has been available since +.Ox 2.4 . +It has a return value since OpenSSL 0.9.5 and +.Ox 2.7 . +.Pp .Fn RAND_pseudo_bytes -was added in OpenSSL 0.9.5. +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . diff --git a/man/RAND_load_file.3 b/man/RAND_load_file.3 index 96724730..9227e272 100644 --- a/man/RAND_load_file.3 +++ b/man/RAND_load_file.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RAND_load_file.3,v 1.4 2016/11/29 00:45:36 schwarze Exp $ +.\" $OpenBSD: RAND_load_file.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 29 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RAND_LOAD_FILE 3 .Os .Sh NAME @@ -115,4 +115,5 @@ on error. .Fn RAND_write_file , and .Fn RAND_file_name -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . diff --git a/man/RAND_set_rand_method.3 b/man/RAND_set_rand_method.3 index 6f993351..d94d794d 100644 --- a/man/RAND_set_rand_method.3 +++ b/man/RAND_set_rand_method.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RAND_set_rand_method.3,v 1.3 2016/11/29 00:07:45 schwarze Exp $ +.\" $OpenBSD: RAND_set_rand_method.3,v 1.4 2018/03/21 09:03:49 schwarze Exp $ .\" .\" Copyright (c) 2014 Miod Vallat .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 29 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt RAND_SET_RAND_METHOD 3 .Os .Sh NAME @@ -51,4 +51,5 @@ always return .Fn RAND_get_rand_method , and .Fn RAND_SSLeay -are available in all versions of OpenSSL. +first appeared in SSLeay 0.9.1 and have been available since +.Ox 2.6 . diff --git a/man/RC4.3 b/man/RC4.3 index 5bd10435..b8a5cc21 100644 --- a/man/RC4.3 +++ b/man/RC4.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RC4.3,v 1.4 2016/11/29 14:51:09 schwarze Exp $ +.\" $OpenBSD: RC4.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 29 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RC4 3 .Os .Sh NAME @@ -124,6 +124,7 @@ do not return values. .Fn RC4_set_key and .Fn RC4 -are available in all versions of SSLeay and OpenSSL. +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . .Sh BUGS This cipher is broken and should no longer be used. diff --git a/man/RIPEMD160.3 b/man/RIPEMD160.3 index 51787b0c..46c84e59 100644 --- a/man/RIPEMD160.3 +++ b/man/RIPEMD160.3 @@ -1,5 +1,5 @@ -.\" $OpenBSD: RIPEMD160.3,v 1.4 2016/11/29 14:51:09 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: RIPEMD160.3,v 1.6 2018/03/21 07:16:31 schwarze Exp $ +.\" full merge up to: OpenSSL bbda8ce9 Oct 31 15:43:01 2017 +0800 .\" .\" This file was written by Ulf Moeller . .\" Copyright (c) 2000, 2006, 2014 The OpenSSL Project. All rights reserved. @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 29 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt RIPEMD160 3 .Os .Sh NAME @@ -136,11 +136,16 @@ return 1 for success or 0 otherwise. .Xr EVP_DigestInit 3 , .Xr HMAC 3 .Sh STANDARDS -ISO/IEC 10118-3 (draft) (??) +.Bd -unfilled +ISO/IEC 10118-3:2004/Cor 1:2011 +Hash-functions \(em Part 3: Dedicated hash-functions +Clause 7: RIPEMD-160 +.Ed .Sh HISTORY .Fn RIPEMD160 , .Fn RIPEMD160_Init , .Fn RIPEMD160_Update , and .Fn RIPEMD160_Final -are available since SSLeay 0.9.0. +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . diff --git a/man/RSA_PSS_PARAMS_new.3 b/man/RSA_PSS_PARAMS_new.3 index 25a1c25e..c0a88dd2 100644 --- a/man/RSA_PSS_PARAMS_new.3 +++ b/man/RSA_PSS_PARAMS_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_PSS_PARAMS_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: RSA_PSS_PARAMS_new.3,v 1.3 2018/03/23 05:48:56 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt RSA_PSS_PARAMS_NEW 3 .Os .Sh NAME @@ -51,3 +51,9 @@ if an error occurs. .Xr X509_sign 3 .Sh STANDARDS RFC 8017: PKCS#1: RSA Cryptography Specifications Version 2.2 +.Sh HISTORY +.Fn RSA_PSS_PARAMS_new +and +.Fn RSA_PSS_PARAMS_free +first appeared in OpenSSL 1.0.1 and have been available since +.Ox 5.3 . diff --git a/man/RSA_blinding_on.3 b/man/RSA_blinding_on.3 index 456b09a7..75b5cace 100644 --- a/man/RSA_blinding_on.3 +++ b/man/RSA_blinding_on.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_blinding_on.3,v 1.4 2016/12/11 12:21:48 schwarze Exp $ +.\" $OpenBSD: RSA_blinding_on.3,v 1.5 2018/03/21 07:25:59 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt RSA_BLINDING_ON 3 .Os .Sh NAME @@ -93,4 +93,5 @@ returns 1 on success, and 0 if an error occurred. .Fn RSA_blinding_on and .Fn RSA_blinding_off -appeared in SSLeay 0.9.0. +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . diff --git a/man/RSA_check_key.3 b/man/RSA_check_key.3 index cfce0bbb..8426b6f3 100644 --- a/man/RSA_check_key.3 +++ b/man/RSA_check_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_check_key.3,v 1.4 2016/12/11 12:21:48 schwarze Exp $ +.\" $OpenBSD: RSA_check_key.3,v 1.6 2018/03/21 21:18:08 schwarze Exp $ .\" OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000 .\" .\" This file was written by Ulf Moeller and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt RSA_CHECK_KEY 3 .Os .Sh NAME @@ -126,10 +126,12 @@ obtained using .Sh SEE ALSO .Xr BN_is_prime_ex 3 , .Xr ERR_get_error 3 , +.Xr RSA_get0_key 3 , .Xr RSA_new 3 .Sh HISTORY .Fn RSA_check_key -appeared in OpenSSL 0.9.4. +first appeared in OpenSSL 0.9.4 and has been available since +.Ox 2.6 . .Sh BUGS A method of verifying the RSA key using opaque RSA API functions might need to be considered. diff --git a/man/RSA_generate_key.3 b/man/RSA_generate_key.3 index 838b10e2..3ac3885f 100644 --- a/man/RSA_generate_key.3 +++ b/man/RSA_generate_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_generate_key.3,v 1.6 2017/03/25 18:08:48 schwarze Exp $ +.\" $OpenBSD: RSA_generate_key.3,v 1.11 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL RSA_generate_key.pod bb6c5e7f Feb 5 10:29:22 2017 -0500 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 25 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RSA_GENERATE_KEY 3 .Os .Sh NAME @@ -143,11 +143,19 @@ The error codes can be obtained by .Sh SEE ALSO .Xr BN_generate_prime 3 , .Xr ERR_get_error 3 , +.Xr RSA_get0_key 3 , .Xr RSA_new 3 .Sh HISTORY -The +.Fn RSA_generate_key +appeared in SSLeay 0.4 or earlier and had its .Fa cb_arg -argument was added in SSLeay 0.9.0. +argument added in SSLeay 0.9.0. +It has been available since +.Ox 2.4 . +.Pp +.Fn RSA_generate_key_ex +first appeared in OpenSSL 0.9.8 and has been available since +.Ox 4.5 . .Sh BUGS .Fn BN_GENCB_call cb 2 x is used with two different meanings. diff --git a/man/RSA_get0_key.3 b/man/RSA_get0_key.3 new file mode 100644 index 00000000..3e6f75a9 --- /dev/null +++ b/man/RSA_get0_key.3 @@ -0,0 +1,290 @@ +.\" $OpenBSD: RSA_get0_key.3,v 1.4 2018/03/23 23:18:17 schwarze Exp $ +.\" selective merge up to: OpenSSL 665d899f Aug 2 02:19:43 2017 +0800 +.\" +.\" This file was written by Richard Levitte +.\" Copyright (c) 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. +.\" +.Dd $Mdocdate: March 23 2018 $ +.Dt RSA_GET0_KEY 3 +.Os +.Sh NAME +.Nm RSA_get0_key , +.Nm RSA_set0_key , +.Nm RSA_get0_factors , +.Nm RSA_set0_factors , +.Nm RSA_get0_crt_params , +.Nm RSA_set0_crt_params , +.Nm RSA_clear_flags , +.Nm RSA_test_flags , +.Nm RSA_set_flags +.Nd get and set data in an RSA object +.Sh SYNOPSIS +.In openssl/rsa.h +.Ft void +.Fo RSA_get0_key +.Fa "const RSA *r" +.Fa "const BIGNUM **n" +.Fa "const BIGNUM **e" +.Fa "const BIGNUM **d" +.Fc +.Ft int +.Fo RSA_set0_key +.Fa "RSA *r" +.Fa "BIGNUM *n" +.Fa "BIGNUM *e" +.Fa "BIGNUM *d" +.Fc +.Ft void +.Fo RSA_get0_factors +.Fa "const RSA *r" +.Fa "const BIGNUM **p" +.Fa "const BIGNUM **q" +.Fc +.Ft int +.Fo RSA_set0_factors +.Fa "RSA *r" +.Fa "BIGNUM *p" +.Fa "BIGNUM *q" +.Fc +.Ft void +.Fo RSA_get0_crt_params +.Fa "const RSA *r" +.Fa "const BIGNUM **dmp1" +.Fa "const BIGNUM **dmq1" +.Fa "const BIGNUM **iqmp" +.Fc +.Ft int +.Fo RSA_set0_crt_params +.Fa "RSA *r" +.Fa "BIGNUM *dmp1" +.Fa "BIGNUM *dmq1" +.Fa "BIGNUM *iqmp" +.Fc +.Ft void +.Fo RSA_clear_flags +.Fa "RSA *r" +.Fa "int flags" +.Fc +.Ft int +.Fo RSA_test_flags +.Fa "const RSA *r" +.Fa "int flags" +.Fc +.Ft void +.Fo RSA_set_flags +.Fa "RSA *r" +.Fa "int flags" +.Fc +.Sh DESCRIPTION +An +.Vt RSA +object contains the components for the public and private key. +.Fa n +is the modulus common to both public and private key, +.Fa e +is the public exponent and +.Fa d +is the private exponent. +.Fa p , +.Fa q , +.Fa dmp1 , +.Fa dmq1 , +and +.Fa iqmp +are the factors for the second representation of a private key +(see PKCS#1 section 3 Key Types), where +.Fa p +and +.Fa q +are the first and second factor of +.Fa n . +.Fa dmp1 , +.Fa dmq1 , +and +.Fa iqmp +are the exponents and coefficient for CRT calculations. +.Pp +The +.Fa n , +.Fa e , +and +.Fa d +parameters can be obtained by calling +.Fn RSA_get0_key . +If they have not been set yet, then +.Pf * Fa n , +.Pf * Fa e , +and +.Pf * Fa d +are set to +.Dv NULL . +Otherwise, they are set to pointers to the internal representations +of the values that should not be freed by the caller. +.Pp +The +.Fa n , +.Fa e , +and +.Fa d +parameter values can be set by calling +.Fn RSA_set0_key . +The values +.Fa n +and +.Fa e +must be +.Pf non- Dv NULL +the first time this function is called on a given +.Vt RSA +object. +The value +.Fa d +may be +.Dv NULL . +On subsequent calls, any of these values may be +.Dv NULL , +which means that the corresponding field is left untouched. +Calling this function transfers the memory management of the values to +the RSA object. +Therefore, the values that have been passed in +should not be freed by the caller. +.Pp +In a similar fashion, the +.Fa p +and +.Fa q +parameters can be obtained and set with +.Fn RSA_get0_factors +and +.Fn RSA_set0_factors , +and the +.Fa dmp1 , +.Fa dmq1 , +and +.Fa iqmp +parameters can be obtained and set with +.Fn RSA_get0_crt_params +and +.Fn RSA_set0_crt_params . +.Pp +For +.Fn RSA_get0_key , +.Fn RSA_get0_factors , +and +.Fn RSA_get0_crt_params , +.Dv NULL +value +.Vt BIGNUM ** +output arguments are permitted. +The functions +ignore +.Dv NULL +arguments but return values for other, +.Pf non- Dv NULL , +arguments. +.Pp +Values retrieved with +.Fn RSA_get0_key , +.Fn RSA_get0_factors , +and +.Fn RSA_get0_crt_params +are owned by the +.Vt RSA +object used in the call and may therefore +.Em not +be passed to +.Fn RSA_set0_key , +.Fn RSA_set0_factors , +or +.Fn RSA_set0_crt_params . +If needed, duplicate the received value using +.Xr BN_dup 3 +and pass the duplicate. +.Pp +.Fn RSA_clear_flags +clears the specified +.Fa flags +in +.Fa r . +.Fn RSA_test_flags +tests the +.Fa flags +in +.Fa r . +.Fn RSA_set_flags +sets the +.Fa flags +in +.Fa r ; +any flags already set remain set. +For all three functions, multiple flags can be passed in one call, +OR'ed together bitwise. +.Sh RETURN VALUES +.Fn RSA_set0_key , +.Fn RSA_set0_factors , +and +.Fn RSA_set0_crt_params +return 1 on success or 0 on failure. +.Pp +.Fn RSA_test_flags +returns those of the given +.Fa flags +currently set in +.Fa r +or 0 if none of the given +.Fa flags +are set. +.Sh SEE ALSO +.Xr RSA_check_key 3 , +.Xr RSA_generate_key 3 , +.Xr RSA_new 3 , +.Xr RSA_print 3 , +.Xr RSA_size 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0 +and have been available since +.Ox 6.3 . diff --git a/man/RSA_get_ex_new_index.3 b/man/RSA_get_ex_new_index.3 index a5331e6a..cf3d3f6f 100644 --- a/man/RSA_get_ex_new_index.3 +++ b/man/RSA_get_ex_new_index.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_get_ex_new_index.3,v 1.7 2017/08/01 14:57:03 schwarze Exp $ +.\" $OpenBSD: RSA_get_ex_new_index.3,v 1.10 2018/03/23 23:18:17 schwarze Exp $ .\" OpenSSL 35cb565a Nov 19 15:49:30 2015 -0500 .\" .\" This file was written by Ulf Moeller and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 1 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt RSA_GET_EX_NEW_INDEX 3 .Os .Sh NAME @@ -81,6 +81,7 @@ .Fa "RSA *r" .Fa "int idx" .Fc +.In openssl/crypto.h .Ft typedef int .Fo CRYPTO_EX_new .Fa "void *parent" @@ -265,13 +266,15 @@ On failure an error code can be obtained from .Xr DH_set_ex_data 3 , .Xr DSA_set_ex_data 3 , .Xr RSA_new 3 , -.Xr X509_STORE_CTX_set_ex_data 3 +.Xr SSL_CTX_set_ex_data 3 , +.Xr SSL_SESSION_set_ex_data 3 , +.Xr SSL_set_ex_data 3 , +.Xr X509_STORE_CTX_set_ex_data 3 , +.Xr X509_STORE_set_ex_data 3 .Sh HISTORY -.Fn RSA_get_ex_new_index , -.Fn RSA_set_ex_data , -and -.Fn RSA_get_ex_data -are available since SSLeay 0.9.0. +These functions first appeared in SSLeay 0.9.0 +and have been available since +.Ox 2.4 . .Sh BUGS .Fa dup_func is currently never called. diff --git a/man/RSA_meth_new.3 b/man/RSA_meth_new.3 new file mode 100644 index 00000000..137e0cad --- /dev/null +++ b/man/RSA_meth_new.3 @@ -0,0 +1,217 @@ +.\" $OpenBSD: RSA_meth_new.3,v 1.3 2018/09/12 15:09:22 jmc Exp $ +.\" selective merge up to: OpenSSL a970b14f Jul 31 18:58:40 2017 -0400 +.\" +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Richard Levitte . +.\" Copyright (c) 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. +.\" +.Dd $Mdocdate: September 12 2018 $ +.Dt RSA_METH_NEW 3 +.Os +.Sh NAME +.Nm RSA_meth_new , +.Nm RSA_meth_dup , +.Nm RSA_meth_free , +.Nm RSA_meth_get_finish , +.Nm RSA_meth_set1_name , +.Nm RSA_meth_set_finish , +.Nm RSA_meth_set_priv_enc , +.Nm RSA_meth_set_priv_dec +.Nd build up RSA methods +.Sh SYNOPSIS +.In openssl/rsa.h +.Ft RSA_METHOD * +.Fo RSA_meth_new +.Fa "const char *name" +.Fa "int flags" +.Fc +.Ft RSA_METHOD * +.Fo RSA_meth_dup +.Fa "const RSA_METHOD *meth" +.Fc +.Ft void +.Fo RSA_meth_free +.Fa "RSA_METHOD *meth" +.Fc +.Ft int +.Fo RSA_meth_set1_name +.Fa "RSA_METHOD *meth" +.Fa "const char *name" +.Fc +.Ft int +.Fn "(*RSA_meth_get_finish(const RSA_METHOD *meth))" "RSA *rsa" +.Ft int +.Fo RSA_meth_set_finish +.Fa "RSA_METHOD *meth" +.Fa "int (*finish)(RSA *rsa)" +.Fc +.Ft int +.Fo RSA_meth_set_priv_enc +.Fa "RSA_METHOD *meth" +.Fa "int (*priv_enc)(int flen, const unsigned char *from,\ + unsigned char *to, RSA *rsa, int padding)" +.Fc +.Ft int +.Fo RSA_meth_set_priv_dec +.Fa "RSA_METHOD *meth" +.Fa "int (*priv_dec)(int flen, const unsigned char *from,\ + unsigned char *to, RSA *rsa, int padding)" +.Fc +.Sh DESCRIPTION +The +.Vt RSA_METHOD +structure holds function pointers for custom RSA implementations. +.Pp +.Fn RSA_meth_new +creates a new +.Vt RSA_METHOD +structure. +A copy of the NUL-terminated +.Fa name +is stored in the new +.Vt RSA_METHOD +object. +Any new +.Vt RSA +object constructed from this +.Vt RSA_METHOD +will have the given +.Fa flags +set by default. +.Pp +.Fn RSA_meth_dup +creates a deep copy of +.Fa meth . +This might be useful for creating a new +.Vt RSA_METHOD +based on an existing one, but with some differences. +.Pp +.Fn RSA_meth_free +destroys +.Fa meth +and frees any memory associated with it. +.Pp +.Fn RSA_meth_set1_name +Stores a copy of the NUL-terminated +.Fa name +in the +.Vt RSA_METHOD +object after freeing the previously stored +.Fa name . +.Pp +.Fn RSA_meth_get_finish +and +.Fn RSA_meth_set_finish +get and set an optional function for destroying an +.Vt RSA +object. +Unless +.Fa finish +is +.Dv NULL , +it will be called from +.Xr RSA_free 3 . +It takes the same argument +and is intended to do RSA implementation specific cleanup. +The memory used by the +.Vt RSA +object itself should not be freed by the +.Fa finish +function. +.Pp +.Fn RSA_meth_set_priv_enc +and +.Fn RSA_meth_set_priv_dec +set the functions used for private key encryption and decryption. +These functions will be called from +.Xr RSA_private_decrypt 3 +and +.Xr RSA_private_encrypt 3 +and take the same parameters as those. +.Sh RETURN VALUES +.Fn RSA_meth_new +and +.Fn RSA_meth_dup +return the newly allocated +.Vt RSA_METHOD +object or +.Dv NULL +on failure. +.Pp +All +.Fn RSA_meth_set* +functions return 1 on success or 0 on failure. +.Sh SEE ALSO +.Xr RSA_new 3 , +.Xr RSA_private_decrypt 3 , +.Xr RSA_private_encrypt 3 , +.Xr RSA_set_method 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0. +.Fn RSA_meth_get_finish +and +.Fn RSA_meth_set1_name +have been available since +.Ox 6.4 , +all the other functions since +.Ox 6.3 . diff --git a/man/RSA_new.3 b/man/RSA_new.3 index 9e43f03f..0b6bcf97 100644 --- a/man/RSA_new.3 +++ b/man/RSA_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_new.3,v 1.4 2016/12/11 12:52:28 schwarze Exp $ +.\" $OpenBSD: RSA_new.3,v 1.10 2018/04/18 01:11:45 schwarze Exp $ .\" OpenSSL doc/man3/RSA_new.pod 99d63d46 Oct 26 13:56:48 2016 -0400 .\" OpenSSL doc/crypto/rsa.pod 35d2e327 Jun 3 16:19:49 2016 -0400 .\" @@ -49,17 +49,22 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: April 18 2018 $ .Dt RSA_NEW 3 .Os .Sh NAME .Nm RSA_new , +.Nm RSA_up_ref , .Nm RSA_free .Nd allocate and free RSA objects .Sh SYNOPSIS .In openssl/rsa.h .Ft RSA * .Fn RSA_new void +.Ft int +.Fo RSA_up_ref +.Fa "RSA *rsa" +.Fc .Ft void .Fo RSA_free .Fa "RSA *rsa" @@ -71,12 +76,19 @@ as defined in PKCS #1 v2.0 (RFC 2437). .Fn RSA_new allocates and initializes an .Vt RSA -structure. +structure, setting the reference count to 1. It is equivalent to calling -.Fn RSA_new_method NULL . +.Xr RSA_new_method 3 +with a +.Dv NULL +argument. +.Pp +.Fn RSA_up_ref +increments the reference count by 1. .Pp .Fn RSA_free -frees the +decrements the reference count by 1. +If it reaches 0, it frees the .Vt RSA structure and its components. The key is erased before the memory is returned to the system. @@ -93,7 +105,7 @@ structure consists of several components. It can contain public as well as private RSA keys: .Bd -literal -typdef struct { +typedef struct { BIGNUM *n; // public modulus BIGNUM *e; // public exponent BIGNUM *d; // private exponent @@ -149,18 +161,22 @@ returns and sets an error code that can be obtained by .Xr ERR_get_error 3 . Otherwise it returns a pointer to the newly allocated structure. +.Pp +.Fn RSA_up_ref +returns 1 for success or 0 for failure. .Sh SEE ALSO .Xr BN_new 3 , .Xr d2i_RSAPublicKey 3 , .Xr DH_new 3 , .Xr DSA_new 3 , -.Xr engine 3 , .Xr ERR_get_error 3 , .Xr EVP_PKEY_set1_RSA 3 , .Xr RSA_blinding_on 3 , .Xr RSA_check_key 3 , .Xr RSA_generate_key 3 , +.Xr RSA_get0_key 3 , .Xr RSA_get_ex_new_index 3 , +.Xr RSA_meth_new 3 , .Xr RSA_padding_add_PKCS1_type_1 3 , .Xr RSA_print 3 , .Xr RSA_private_encrypt 3 , @@ -177,4 +193,9 @@ RSA was covered by a US patent which expired in September 2000. .Fn RSA_new and .Fn RSA_free -are available in all versions of SSLeay and OpenSSL. +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . +.Pp +.Fn RSA_up_ref +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . diff --git a/man/RSA_padding_add_PKCS1_type_1.3 b/man/RSA_padding_add_PKCS1_type_1.3 index 2d674403..e7c3a2a6 100644 --- a/man/RSA_padding_add_PKCS1_type_1.3 +++ b/man/RSA_padding_add_PKCS1_type_1.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_padding_add_PKCS1_type_1.3,v 1.6 2017/08/28 17:41:59 jsing Exp $ +.\" $OpenBSD: RSA_padding_add_PKCS1_type_1.3,v 1.8 2018/03/21 16:09:51 schwarze Exp $ .\" OpenSSL 1e3f62a3 Jul 17 16:47:13 2017 +0200 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 28 2017 $ +.Dd $Mdocdate: March 21 2018 $ .Dt RSA_PADDING_ADD_PKCS1_TYPE_1 3 .Os .Sh NAME @@ -219,12 +219,14 @@ Error codes can be obtained by calling .Fn RSA_padding_add_none , and .Fn RSA_padding_check_none -appeared in SSLeay 0.9.0. +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . .Pp .Fn RSA_padding_add_PKCS1_OAEP and .Fn RSA_padding_check_PKCS1_OAEP -were added in OpenSSL 0.9.2b. +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . .Sh BUGS The .Fn RSA_padding_check_PKCS1_type_2 diff --git a/man/RSA_print.3 b/man/RSA_print.3 index de53af64..1a8dc86f 100644 --- a/man/RSA_print.3 +++ b/man/RSA_print.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_print.3,v 1.5 2016/12/11 12:21:48 schwarze Exp $ +.\" $OpenBSD: RSA_print.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RSA_PRINT 3 .Os .Sh NAME @@ -123,17 +123,21 @@ spaces. These functions return 1 on success or 0 on error. .Sh SEE ALSO .Xr BN_bn2bin 3 , +.Xr DH_get0_pqg 3 , +.Xr DSA_get0_pqg 3 , +.Xr RSA_get0_key 3 , .Xr RSA_new 3 .Sh HISTORY -.Fn RSA_print , +.Fn RSA_print +and +.Fn DHparams_print +first appeared in SSLeay 0.5.1. .Fn RSA_print_fp , .Fn DSA_print , -.Fn DSA_print_fp , -.Fn DHparams_print , and .Fn DHparams_print_fp -are available in all versions of SSLeay and OpenSSL. -.Fn DSAparams_print -and -.Fn DSAparams_print_fp -were added in SSLeay 0.8. +first appeared in SSLeay 0.6.0. +.Fn DSA_print_fp +first appeared in SSLeay 0.8.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/RSA_private_encrypt.3 b/man/RSA_private_encrypt.3 index 385c1169..524986b0 100644 --- a/man/RSA_private_encrypt.3 +++ b/man/RSA_private_encrypt.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_private_encrypt.3,v 1.6 2017/03/25 18:14:17 schwarze Exp $ +.\" $OpenBSD: RSA_private_encrypt.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL RSA_private_encrypt.pod b41f6b64 Mar 10 15:49:04 2017 +0000 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 25 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RSA_PRIVATE_ENCRYPT 3 .Os .Sh NAME @@ -136,12 +136,16 @@ On error, -1 is returned; the error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr ERR_get_error 3 , +.Xr RSA_meth_set_priv_enc 3 , .Xr RSA_new 3 , .Xr RSA_sign 3 , .Xr RSA_verify 3 .Sh HISTORY -The -.Fa padding -argument was added in SSLeay 0.8. +.Fn RSA_private_encrypt +and +.Fn RSA_public_decrypt +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . +.Pp .Dv RSA_NO_PADDING is available since SSLeay 0.9.0. diff --git a/man/RSA_public_encrypt.3 b/man/RSA_public_encrypt.3 index be90fb12..97d325ff 100644 --- a/man/RSA_public_encrypt.3 +++ b/man/RSA_public_encrypt.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_public_encrypt.3,v 1.8 2017/08/28 17:41:59 jsing Exp $ +.\" $OpenBSD: RSA_public_encrypt.3,v 1.11 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL RSA_public_encrypt.pod 1e3f62a3 Jul 17 16:47:13 2017 +0200 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 28 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RSA_PUBLIC_ENCRYPT 3 .Os .Sh NAME @@ -143,14 +143,18 @@ On error, -1 is returned; the error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr ERR_get_error 3 , +.Xr RSA_meth_set_priv_dec 3 , .Xr RSA_new 3 , .Xr RSA_size 3 .Sh STANDARDS SSL, PKCS #1 v2.0 .Sh HISTORY -The -.Fa padding -argument was added in SSLeay 0.8. +.Fn RSA_public_encrypt +and +.Fn RSA_private_decrypt +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . +.Pp .Dv RSA_NO_PADDING is available since SSLeay 0.9.0. OAEP was added in OpenSSL 0.9.2b. diff --git a/man/RSA_set_method.3 b/man/RSA_set_method.3 index f9ec19f9..b4724e3e 100644 --- a/man/RSA_set_method.3 +++ b/man/RSA_set_method.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_set_method.3,v 1.5 2016/12/11 12:21:48 schwarze Exp $ +.\" $OpenBSD: RSA_set_method.3,v 1.12 2018/04/18 01:07:38 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Ulf Moeller @@ -50,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: April 18 2018 $ .Dt RSA_SET_METHOD 3 .Os .Sh NAME @@ -59,11 +59,8 @@ .Nm RSA_set_method , .Nm RSA_get_method , .Nm RSA_PKCS1_SSLeay , -.Nm RSA_null_method , .Nm RSA_flags , -.Nm RSA_new_method , -.Nm RSA_get_default_openssl_method , -.Nm RSA_set_default_openssl_method +.Nm RSA_new_method .Nd select RSA method .Sh SYNOPSIS .In openssl/rsa.h @@ -71,78 +68,65 @@ .Fo RSA_set_default_method .Fa "const RSA_METHOD *meth" .Fc -.Ft RSA_METHOD * +.Ft const RSA_METHOD * .Fn RSA_get_default_method void .Ft int .Fo RSA_set_method .Fa "RSA *rsa" .Fa "const RSA_METHOD *meth" .Fc -.Ft RSA_METHOD * +.Ft const RSA_METHOD * .Fo RSA_get_method .Fa "const RSA *rsa" .Fc -.Ft RSA_METHOD * +.Ft const RSA_METHOD * .Fn RSA_PKCS1_SSLeay void -.Ft RSA_METHOD * -.Fn RSA_null_method void .Ft int .Fo RSA_flags .Fa "const RSA *rsa" .Fc .Ft RSA * .Fo RSA_new_method -.Fa "RSA_METHOD *meth" +.Fa "ENGINE *engine" .Fc .Sh DESCRIPTION An .Vt RSA_METHOD -specifies the functions that OpenSSL uses for RSA operations. -By modifying the method, alternative implementations such as hardware -accelerators may be used. -See the -.Sx CAVEATS -section for how these RSA API functions are affected by the use of -.Xr engine 3 -API calls. -.Pp -Initially, the default -.Vt RSA_METHOD -is the OpenSSL internal implementation, as returned by -.Fn RSA_PKCS1_SSLeay . +object contains pointers to the functions used for RSA operations. +By default, the internal implementation returned by +.Fn RSA_PKCS1_SSLeay +is used. +By selecting another method, alternative implementations +such as hardware accelerators may be used. .Pp .Fn RSA_set_default_method -makes +selects .Fa meth -the default method for all +as the default method for all .Vt RSA structures created later. -.Sy NB : -This is true only whilst no +If any .Vt ENGINE -has been set as a default for RSA, so this function is no longer -recommended. +was registered with +.Xr ENGINE_register_RSA 3 +that can be successfully initialized, it overrides the default. .Pp .Fn RSA_get_default_method -returns a pointer to the current default -.Vt RSA_METHOD . -However, the meaningfulness of this result is dependent on whether -the -.Xr engine 3 -API is being used, so this function is no longer recommended. +returns a pointer to the current default method, +even if it is actually overridded by an +.Vt ENGINE . .Pp .Fn RSA_set_method selects .Fa meth to perform all operations using the key .Fa rsa . -This will replace the +This replaces the .Vt RSA_METHOD used by the RSA key, and if the previous method was supplied by an .Vt ENGINE , -the handle to that -.Vt ENGINE -will be released during the change. +.Xr ENGINE_finish 3 +is called on it. It is possible to have RSA keys that only work with certain .Vt RSA_METHOD implementations (e.g. from an @@ -177,34 +161,23 @@ section. allocates and initializes an .Vt RSA structure so that -.Fa meth -will be used for the RSA operations. +.Fa engine +is used for the RSA operations. If -.Sy engine -is NULL, the default ENGINE for RSA operations is used and, if no -default ENGINE is set, the RSA_METHOD controlled by +.Fa engine +is +.Dv NULL , +.Xr ENGINE_get_default_RSA 3 +is used. +If that returns +.Dv NULL , +the default method controlled by .Fn RSA_set_default_method is used. .Pp -.Fn RSA_flags -returns the -.Sy flags -that are set for -.Fa rsa Ns 's -current method. -.Pp -.Fn RSA_new_method -allocates and initializes an -.Vt RSA -structure so that -.Fa meth -will be used for the RSA operations. -If -.Fa meth -is -.Dv NULL , -the default method is used. -.Sh THE RSA_METHOD STRUCTURE +The +.Dv RSA_METHOD +structure is defined as follows: .Bd -literal typedef struct rsa_meth_st { @@ -267,30 +240,15 @@ typedef struct rsa_meth_st .Ed .Sh RETURN VALUES .Fn RSA_PKCS1_SSLeay , -.Fn RSA_null_method , -.Fn RSA_get_default_method +.Fn RSA_get_default_method , and .Fn RSA_get_method return pointers to the respective .Vt RSA_METHOD . .Pp .Fn RSA_set_method -returns a pointer to the old -.Vt RSA_METHOD -implementation that was replaced. -However, this return value should probably be ignored because if it was -supplied by an -.Vt ENGINE , -the pointer could be invalidated at any time if the -.Vt ENGINE -is unloaded. -In fact, it could be unloaded as a result of the -.Fn RSA_set_method -function releasing its handle to the -.Vt ENGINE . -For this reason, the return type may be replaced with a -.Vt void -declaration in a future release. +returns 1 on success or 0 on failure. +Currently, it cannot fail. .Pp .Fn RSA_new_method returns @@ -300,12 +258,22 @@ and sets an error code that can be obtained by if the allocation fails. Otherwise it returns a pointer to the newly allocated structure. .Sh SEE ALSO +.Xr ENGINE_get_default_RSA 3 , +.Xr ENGINE_register_RSA 3 , +.Xr ENGINE_set_default_RSA 3 , +.Xr RSA_meth_new 3 , .Xr RSA_new 3 .Sh HISTORY -.Fn RSA_new_method +.Fn RSA_set_default_method , +.Fn RSA_PKCS1_SSLeay , and -.Fn RSA_set_default_method -appeared in SSLeay 0.8. +.Fn RSA_new_method +first appeared in SSLeay 0.8.0. +.Fn RSA_flags +first appeared in SSLeay 0.9.0. +These functions have been available since +.Ox 2.4 . +.Pp .Fn RSA_get_default_method , .Fn RSA_set_method , and @@ -316,55 +284,8 @@ and .Fa rsa_verify components of .Vt RSA_METHOD -were added in OpenSSL 0.9.4. -.Pp -.Fn RSA_set_default_openssl_method -and -.Fn RSA_get_default_openssl_method -replaced -.Fn RSA_set_default_method -and -.Fn RSA_get_default_method -respectively, and -.Fn RSA_set_method -and -.Fn RSA_new_method -were altered to use -.Vt ENGINE Ns s -rather than -.Vt RSA_METHOD Ns s -during development of the -.Xr engine 3 -version of OpenSSL 0.9.6. -For 0.9.7, the handling of defaults in the -.Xr engine 3 -API was restructured so that this change was reversed, and behaviour -of the other functions resembled more closely the previous behaviour. -The behaviour of defaults in the -.Xr engine 3 -API now transparently overrides the behaviour of defaults in the -RSA API without requiring changing these function prototypes. -.Sh CAVEATS -As of version 0.9.7, -.Vt RSA_METHOD -implementations are grouped together with other algorithmic APIs (e.g.\& -.Vt DSA_METHOD -or -.Vt EVP_CIPHER ) -into -.Vt ENGINE -modules. -If a default -.Vt ENGINE -is specified for RSA functionality using an -.Xr engine 3 -API function, that will override any RSA defaults set using the RSA -API, i.e.\& -.Fn RSA_set_default_method . -For this reason, the -.Xr engine 3 -API is the recommended way to control default implementations for -use in RSA and other cryptographic algorithms. +first appeared in OpenSSL 0.9.4 and have been available since +.Ox 2.6 . .Sh BUGS The behaviour of .Fn RSA_flags diff --git a/man/RSA_sign.3 b/man/RSA_sign.3 index c523f275..80e0b0e9 100644 --- a/man/RSA_sign.3 +++ b/man/RSA_sign.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_sign.3,v 1.4 2016/12/11 12:21:48 schwarze Exp $ +.\" $OpenBSD: RSA_sign.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL aa90ca11 Aug 20 15:48:56 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RSA_SIGN 3 .Os .Sh NAME @@ -140,6 +140,8 @@ The error codes can be obtained by SSL, PKCS #1 v2.0 .Sh HISTORY .Fn RSA_sign -and +first appeared in SSLeay 0.4.4. .Fn RSA_verify -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.6.0. +Both functions have been available since +.Ox 2.4 . diff --git a/man/RSA_sign_ASN1_OCTET_STRING.3 b/man/RSA_sign_ASN1_OCTET_STRING.3 index 22dfe96c..215bb954 100644 --- a/man/RSA_sign_ASN1_OCTET_STRING.3 +++ b/man/RSA_sign_ASN1_OCTET_STRING.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_sign_ASN1_OCTET_STRING.3,v 1.4 2016/12/11 12:21:48 schwarze Exp $ +.\" $OpenBSD: RSA_sign_ASN1_OCTET_STRING.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RSA_SIGN_ASN1_OCTET_STRING 3 .Os .Sh NAME @@ -126,6 +126,7 @@ The error codes can be obtained by .Fn RSA_sign_ASN1_OCTET_STRING and .Fn RSA_verify_ASN1_OCTET_STRING -were added in SSLeay 0.8. +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . .Sh BUGS These functions serve no recognizable purpose. diff --git a/man/RSA_size.3 b/man/RSA_size.3 index fdd10515..7218c2e1 100644 --- a/man/RSA_size.3 +++ b/man/RSA_size.3 @@ -1,7 +1,8 @@ -.\" $OpenBSD: RSA_size.3,v 1.4 2016/12/11 12:21:48 schwarze Exp $ -.\" OpenSSL 5bf73873 Aug 5 16:27:01 2002 +0000 +.\" $OpenBSD: RSA_size.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" -.\" This file was written by Ulf Moeller . +.\" This file was written by Ulf Moeller and +.\" Kurt Roeckx . .\" Copyright (c) 2000, 2002, 2015 The OpenSSL Project. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -48,22 +49,31 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt RSA_SIZE 3 .Os .Sh NAME -.Nm RSA_size -.Nd get RSA modulus size +.Nm RSA_size , +.Nm RSA_bits +.Nd get the RSA modulus size .Sh SYNOPSIS .In openssl/rsa.h .Ft int .Fo RSA_size .Fa "const RSA *rsa" .Fc +.Ft int +.Fo RSA_bits +.Fa "const RSA *rsa" +.Fc .Sh DESCRIPTION -This function returns the RSA modulus size in bytes. -It can be used to determine how much memory must be allocated for an RSA -encrypted value. +.Fn RSA_size +returns the RSA modulus size in bytes. +It can be used to determine how much memory must be allocated for +an RSA encrypted value. +.Pp +.Fn RSA_bits +returns the number of significant bits. .Pp .Fa rsa and @@ -71,9 +81,16 @@ and must not be .Dv NULL . .Sh RETURN VALUES -The size in bytes. +The size. .Sh SEE ALSO +.Xr BN_num_bits 3 , +.Xr RSA_get0_key 3 , .Xr RSA_new 3 .Sh HISTORY .Fn RSA_size -is available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.4.4 and has been available since +.Ox 2.4 . +.Pp +.Fn RSA_bits +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/SHA1.3 b/man/SHA1.3 index 48676aa8..f5061e56 100644 --- a/man/SHA1.3 +++ b/man/SHA1.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SHA1.3,v 1.4 2016/12/02 19:28:41 jmc Exp $ +.\" $OpenBSD: SHA1.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Ulf Moeller and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 2 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SHA1 3 .Os .Sh NAME @@ -268,4 +268,9 @@ PUB 180-1 (Secure Hash Standard), ANSI X9.30 .Fn SHA1_Update , and .Fn SHA1_Final -are available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp +The other functions first appeared in OpenSSL 0.9.8 +and have been available since +.Ox 4.5 . diff --git a/man/SMIME_read_PKCS7.3 b/man/SMIME_read_PKCS7.3 index a7cfc873..417d97be 100644 --- a/man/SMIME_read_PKCS7.3 +++ b/man/SMIME_read_PKCS7.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SMIME_read_PKCS7.3,v 1.5 2017/01/06 02:37:05 schwarze Exp $ +.\" $OpenBSD: SMIME_read_PKCS7.3,v 1.6 2018/03/22 16:06:33 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt SMIME_READ_PKCS7 3 .Os .Sh NAME @@ -129,7 +129,8 @@ The error can be obtained from .Xr SMIME_write_PKCS7 3 .Sh HISTORY .Fn SMIME_read_PKCS7 -was added to OpenSSL 0.9.5. +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . .Sh BUGS The MIME parser used by .Fn SMIME_read_PKCS7 diff --git a/man/SMIME_write_PKCS7.3 b/man/SMIME_write_PKCS7.3 index a6cff4e7..a0a15763 100644 --- a/man/SMIME_write_PKCS7.3 +++ b/man/SMIME_write_PKCS7.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SMIME_write_PKCS7.3,v 1.4 2016/12/13 15:00:22 schwarze Exp $ +.\" $OpenBSD: SMIME_write_PKCS7.3,v 1.5 2018/03/22 16:06:33 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 13 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt SMIME_WRITE_PKCS7 3 .Os .Sh NAME @@ -137,7 +137,8 @@ returns 1 for success or 0 for failure. .Xr SMIME_read_PKCS7 3 .Sh HISTORY .Fn SMIME_write_PKCS7 -was added to OpenSSL 0.9.5. +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . .Sh BUGS .Fn SMIME_write_PKCS7 always base64 encodes PKCS#7 structures. diff --git a/man/SSL_CIPHER_get_name.3 b/man/SSL_CIPHER_get_name.3 index b85fdffe..37707566 100644 --- a/man/SSL_CIPHER_get_name.3 +++ b/man/SSL_CIPHER_get_name.3 @@ -1,9 +1,12 @@ -.\" $OpenBSD: SSL_CIPHER_get_name.3,v 1.3 2017/07/05 11:43:09 schwarze Exp $ -.\" OpenSSL 45f55f6a Nov 30 15:35:22 2014 +0100 +.\" $OpenBSD: SSL_CIPHER_get_name.3,v 1.10 2018/04/25 13:51:34 schwarze Exp $ +.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" -.\" This file was written by Lutz Jaenicke . -.\" Copyright (c) 2000, 2001, 2005, 2009, 2013, 2014 The OpenSSL Project. -.\" All rights reserved. +.\" This file was written by Lutz Jaenicke , +.\" Dr. Stephen Henson , Todd Short , +.\" and Paul Yang . +.\" Copyright (c) 2000, 2005, 2009, 2013, 2014, 2015, 2016, 2017 +.\" 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 @@ -49,13 +52,19 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 5 2017 $ +.Dd $Mdocdate: April 25 2018 $ .Dt SSL_CIPHER_GET_NAME 3 .Os .Sh NAME .Nm SSL_CIPHER_get_name , .Nm SSL_CIPHER_get_bits , .Nm SSL_CIPHER_get_version , +.Nm SSL_CIPHER_get_cipher_nid , +.Nm SSL_CIPHER_get_digest_nid , +.Nm SSL_CIPHER_get_kx_nid , +.Nm SSL_CIPHER_get_auth_nid , +.Nm SSL_CIPHER_is_aead , +.Nm SSL_CIPHER_get_id , .Nm SSL_CIPHER_description .Nd get SSL_CIPHER properties .Sh SYNOPSIS @@ -64,20 +73,26 @@ .Fn SSL_CIPHER_get_name "const SSL_CIPHER *cipher" .Ft int .Fn SSL_CIPHER_get_bits "const SSL_CIPHER *cipher" "int *alg_bits" -.Ft char * +.Ft const char * .Fn SSL_CIPHER_get_version "const SSL_CIPHER *cipher" +.Ft int +.Fn SSL_CIPHER_get_cipher_nid "const SSL_CIPHER *cipher" +.Ft int +.Fn SSL_CIPHER_get_digest_nid "const SSL_CIPHER *cipher" +.Ft int +.Fn SSL_CIPHER_get_kx_nid "const SSL_CIPHER *cipher" +.Ft int +.Fn SSL_CIPHER_get_auth_nid "const SSL_CIPHER *cipher" +.Ft int +.Fn SSL_CIPHER_is_aead "const SSL_CIPHER *cipher" +.Ft unsigned long +.Fn SSL_CIPHER_get_id "const SSL_CIPHER *cipher" .Ft char * .Fn SSL_CIPHER_description "const SSL_CIPHER *cipher" "char *buf" "int size" .Sh DESCRIPTION .Fn SSL_CIPHER_get_name returns a pointer to the name of .Fa cipher . -If the -.Fa cipher -is -.Dv NULL , -it returns -.Qq (NONE) . .Pp .Fn SSL_CIPHER_get_bits returns the number of secret bits used for @@ -86,13 +101,7 @@ If .Fa alg_bits is not .Dv NULL , -it contains the number of bits processed by the -chosen algorithm. -If -.Fa cipher -is -.Dv NULL , -0 is returned. +the number of bits processed by the chosen algorithm is stored into it. .Pp .Fn SSL_CIPHER_get_version returns a string which indicates the SSL/TLS protocol version that first @@ -104,19 +113,75 @@ In some cases it should possibly return but the function does not; use .Fn SSL_CIPHER_description instead. -If +.Pp +.Fn SSL_CIPHER_get_cipher_nid +returns the cipher NID corresponding to the +.Fa cipher . +If there is no cipher (e.g. for cipher suites with no encryption), then +.Dv NID_undef +is returned. +.Pp +.Fn SSL_CIPHER_get_digest_nid +returns the digest NID corresponding to the MAC used by the .Fa cipher -is -.Dv NULL , -.Qq (NONE) +during record encryption/decryption. +If there is no digest (e.g. for AEAD cipher suites), then +.Dv NID_undef +is returned. +.Pp +.Fn SSL_CIPHER_get_kx_nid +returns the key exchange NID corresponding to the method used by the +.Fa cipher . +If there is no key exchange, then +.Dv NID_undef is returned. +Examples of possible return values include +.Dv NID_kx_rsa , +.Dv NID_kx_dhe , +and +.Dv NID_kx_ecdhe . +.Pp +.Fn SSL_CIPHER_get_auth_nid +returns the authentication NID corresponding to the method used by the +.Fa cipher . +If there is no authentication, +.Dv NID_undef +is returned. +Examples of possible return values include +.Dv NID_auth_rsa +and +.Dv NID_auth_ecdsa . +.Pp +.Fn SSL_CIPHER_is_aead +returns 1 if the +.Fa cipher +is AEAD (e.g. GCM or ChaCha20/Poly1305), or 0 if it is not AEAD. +.Pp +.Fn SSL_CIPHER_get_id +returns the ID of the given +.Fa cipher , +which must not be +.Dv NULL . +The ID here is an OpenSSL-specific concept, which stores a prefix +of 0x0300 in the higher two bytes and the IANA-specified chipher +suite ID in the lower two bytes. +For instance, TLS_RSA_WITH_NULL_MD5 has IANA ID "0x00, 0x01", so +.Fn SSL_CIPHER_get_id +returns 0x03000001. .Pp .Fn SSL_CIPHER_description -returns a textual description of the cipher used into the buffer -.Fa buf -of length -.Fa len -provided. +copies a textual description of +.Fa cipher +into the buffer +.Fa buf , +which must be at least +.Fa size +bytes long. +The +.Fa cipher +argument must not be a +.Dv NULL +pointer. If .Fa buf is @@ -128,13 +193,16 @@ that buffer should be freed using the function. If .Fa len -is too small, or if -.Fa buf -is -.Dv NULL -and the allocation fails, a pointer to the string +is too small to hold the description, a pointer to the static string .Qq Buffer too small is returned. +If memory allocation fails, which can happen even if a +.Fa buf +of sufficient size is provided, a pointer to the static string +.Qq OPENSSL_malloc Error +is returned and the content of +.Fa buf +remains unchanged. .Pp The string returned by .Fn SSL_CIPHER_description @@ -196,6 +264,48 @@ Message digest: .Sy STREEBOG256 , .Sy STREEBOG512 . .El +.Sh RETURN VALUES +.Fn SSL_CIPHER_get_name +returns an internal pointer to a NUL-terminated string. +.Fn SSL_CIPHER_get_version +returns a pointer to a static NUL-terminated string. +If +.Fa cipher +is a +.Dv NULL +pointer, both functions return a pointer to the static string +.Qq Pq NONE . +.Pp +.Fn SSL_CIPHER_get_bits +returns a positive integer representing the number of secret bits +or 0 if +.Fa cipher +is a +.Dv NULL +pointer. +.Pp +.Fn SSL_CIPHER_get_cipher_nid , +.Fn SSL_CIPHER_get_digest_nid , +.Fn SSL_CIPHER_get_kx_nid , +and +.Fn SSL_CIPHER_get_auth_nid +return an NID constant or +.Dv NID_undef +if an error occurred. +.Pp +.Fn SSL_CIPHER_is_aead +returns 1 if the +.Fa cipher +is AEAD or 0 otherwise. +.Pp +.Fn SSL_CIPHER_get_id +returns a 32-bit unsigned integer. +.Pp +.Fn SSL_CIPHER_description +returns +.Fa buf +or a newly allocated string on success or a pointer to a static +string on error. .Sh EXAMPLES An example for the output of .Fn SSL_CIPHER_description : @@ -211,15 +321,30 @@ A complete list can be retrieved by invoking the following command: .Xr ssl 3 , .Xr SSL_get_ciphers 3 , .Xr SSL_get_current_cipher 3 -.Sh BUGS -If +.Sh HISTORY .Fn SSL_CIPHER_description -is called with -.Fa cipher -being -.Dv NULL , -the library crashes. +first appeared in SSLeay 0.8.0. +.Fn SSL_CIPHER_get_name , +.Fn SSL_CIPHER_get_bits , +and +.Fn SSL_CIPHER_get_version +first appeared in SSLeay 0.8.1. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn SSL_CIPHER_get_id +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . .Pp +.Fn SSL_CIPHER_get_cipher_nid , +.Fn SSL_CIPHER_get_digest_nid , +.Fn SSL_CIPHER_get_kx_nid , +.Fn SSL_CIPHER_get_auth_nid , +and +.Fn SSL_CIPHER_is_aead +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . +.Sh BUGS If .Fn SSL_CIPHER_description cannot handle a built-in cipher, diff --git a/man/SSL_COMP_add_compression_method.3 b/man/SSL_COMP_add_compression_method.3 index dc47f4e1..e5421852 100644 --- a/man/SSL_COMP_add_compression_method.3 +++ b/man/SSL_COMP_add_compression_method.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_COMP_add_compression_method.3,v 1.2 2016/11/29 19:52:17 schwarze Exp $ +.\" $OpenBSD: SSL_COMP_add_compression_method.3,v 1.4 2018/03/23 00:10:28 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 29 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt SSL_COMP_ADD_COMPRESSION_METHOD 3 .Os .Sh NAME @@ -46,3 +46,11 @@ always returns 1. .Fn SSL_COMP_get_compression_methods always returns .Dv NULL . +.Sh HISTORY +.Fn SSL_COMP_add_compression_method +first appeared in OpenSSL 0.9.2b and has been available since +.Ox 2.6 . +.Pp +.Fn SSL_COMP_get_compression_methods +first appeared in OpenSSL 0.9.8 and has been available since +.Ox 4.5 . diff --git a/man/SSL_CTX_add1_chain_cert.3 b/man/SSL_CTX_add1_chain_cert.3 new file mode 100644 index 00000000..1f60bad1 --- /dev/null +++ b/man/SSL_CTX_add1_chain_cert.3 @@ -0,0 +1,222 @@ +.\" $OpenBSD: SSL_CTX_add1_chain_cert.3,v 1.1 2019/04/05 18:29:43 schwarze Exp $ +.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 +.\" +.\" This file was written by Dr. Stephen Henson +.\" and Rob Stradling . +.\" Copyright (c) 2013 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. +.\" +.Dd $Mdocdate: April 5 2019 $ +.Dt SSL_CTX_ADD1_CHAIN_CERT 3 +.Os +.Sh NAME +.Nm SSL_CTX_set0_chain , +.Nm SSL_CTX_set1_chain , +.Nm SSL_CTX_add0_chain_cert , +.Nm SSL_CTX_add1_chain_cert , +.Nm SSL_CTX_get0_chain_certs , +.Nm SSL_CTX_clear_chain_certs , +.Nm SSL_set0_chain , +.Nm SSL_set1_chain , +.Nm SSL_add0_chain_cert , +.Nm SSL_add1_chain_cert , +.Nm SSL_get0_chain_certs , +.Nm SSL_clear_chain_certs +.Nd extra chain certificate processing +.Sh SYNOPSIS +.In openssl/ssl.h +.Ft int +.Fo SSL_CTX_set0_chain +.Fa "SSL_CTX *ctx" +.Fa "STACK_OF(X509) *chain" +.Fc +.Ft int +.Fo SSL_CTX_set1_chain +.Fa "SSL_CTX *ctx" +.Fa "STACK_OF(X509) *chain" +.Fc +.Ft int +.Fo SSL_CTX_add0_chain_cert +.Fa "SSL_CTX *ctx" +.Fa "X509 *cert" +.Fc +.Ft int +.Fo SSL_CTX_add1_chain_cert +.Fa "SSL_CTX *ctx" +.Fa "X509 *cert" +.Fc +.Ft int +.Fo SSL_CTX_get0_chain_certs +.Fa "SSL_CTX *ctx" +.Fa "STACK_OF(X509) **chain" +.Fc +.Ft int +.Fo SSL_CTX_clear_chain_certs +.Fa "SSL_CTX *ctx" +.Fc +.Ft int +.Fo SSL_set0_chain +.Fa "SSL *ssl" +.Fa "STACK_OF(X509) *chain" +.Fc +.Ft int +.Fo SSL_set1_chain +.Fa "SSL *ssl" +.Fa "STACK_OF(X509) *chain" +.Fc +.Ft int +.Fo SSL_add0_chain_cert +.Fa "SSL *ssl" +.Fa "X509 *cert" +.Fc +.Ft int +.Fo SSL_add1_chain_cert +.Fa "SSL *ssl" +.Fa "X509 *cert" +.Fc +.Ft int +.Fo SSL_get0_chain_certs +.Fa "SSL *ssl" +.Fa "STACK_OF(X509) **chain" +.Fc +.Ft int +.Fo SSL_clear_chain_certs +.Fa "SSL *ssl" +.Fc +.Sh DESCRIPTION +.Fn SSL_CTX_set0_chain +and +.Fn SSL_CTX_set1_chain +set the certificate chain associated with the current certificate of +.Fa ctx +to +.Fa chain . +The +.Fa chain +is not supposed to include the current certificate itself. +.Pp +.Fn SSL_CTX_add0_chain_cert +and +.Fn SSL_CTX_add1_chain_cert +append the single certificate +.Fa cert +to the chain associated with the current certificate of +.Fa ctx . +.Pp +.Fn SSL_CTX_get0_chain_certs +retrieves the chain associated with the current certificate of +.Fa ctx . +.Pp +.Fn SSL_CTX_clear_chain_certs +clears the existing chain associated with the current certificate of +.Fa ctx , +if any. +This is equivalent to calling +.Fn SSL_CTX_set0_chain +with +.Fa chain +set to +.Dv NULL . +.Pp +Each of these functions operates on the +.Em current +end entity (i.e. server or client) certificate. +This is the last certificate loaded or selected on the corresponding +.Fa ctx +structure, for example using +.Xr SSL_CTX_use_certificate 3 . +.Pp +.Fn SSL_set0_chain , +.Fn SSL_set1_chain , +.Fn SSL_add0_chain_cert , +.Fn SSL_add1_chain_cert , +.Fn SSL_get0_chain_certs , +and +.Fn SSL_clear_chain_certs +are similar except that they operate on the +.Fa ssl +connection. +.Pp +The functions containing a +.Sy 1 +in their name increment the reference count of the supplied certificate +or chain, so it must be freed at some point after the operation. +Those containing a +.Sy 0 +do not increment reference counts and the supplied certificate or chain +must not be freed after the operation. +.Pp +The chains associated with an +.Vt SSL_CTX +structure are copied to the new +.Vt SSL +structure when +.Xr SSL_new 3 +is called. +Existing +.Vt SSL +structures are not affected by any chains subsequently changed +in the parent +.Vt SSL_CTX . +.Pp +One chain can be set for each key type supported by a server. +So, for example, an RSA and a DSA certificate can (and often will) have +different chains. +.Pp +If any certificates are added using these functions, no certificates +added using +.Xr SSL_CTX_add_extra_chain_cert 3 +will be used. +.Sh RETURN VALUES +These functions return 1 for success or 0 for failure. +.Sh SEE ALSO +.Xr ssl 3 , +.Xr SSL_CTX_add_extra_chain_cert 3 , +.Xr SSL_CTX_use_certificate 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.0.2 +and have been available since +.Ox 6.5 . diff --git a/man/SSL_CTX_add_extra_chain_cert.3 b/man/SSL_CTX_add_extra_chain_cert.3 index b81382f3..a6d869b3 100644 --- a/man/SSL_CTX_add_extra_chain_cert.3 +++ b/man/SSL_CTX_add_extra_chain_cert.3 @@ -1,5 +1,5 @@ -.\" $OpenBSD: SSL_CTX_add_extra_chain_cert.3,v 1.3 2017/04/10 14:00:51 schwarze Exp $ -.\" OpenSSL f0d6ee6be Feb 15 07:41:42 2002 +0000 +.\" $OpenBSD: SSL_CTX_add_extra_chain_cert.3,v 1.6 2019/04/05 18:29:43 schwarze Exp $ +.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke and .\" Dr. Stephen Henson . @@ -50,18 +50,21 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: April 5 2019 $ .Dt SSL_CTX_ADD_EXTRA_CHAIN_CERT 3 .Os .Sh NAME .Nm SSL_CTX_add_extra_chain_cert , +.Nm SSL_CTX_get_extra_chain_certs , .Nm SSL_CTX_clear_extra_chain_certs -.Nd add or clear extra chain certificates +.Nd add, retrieve, and clear extra chain certificates .Sh SYNOPSIS .In openssl/ssl.h .Ft long .Fn SSL_CTX_add_extra_chain_cert "SSL_CTX *ctx" "X509 *x509" .Ft long +.Fn SSL_CTX_get_extra_chain_certs "SSL_CTX *ctx" "STACK_OF(X509) **certs" +.Ft long .Fn SSL_CTX_clear_extra_chain_certs "SSL_CTX *ctx" .Sh DESCRIPTION .Fn SSL_CTX_add_extra_chain_cert @@ -71,6 +74,11 @@ to the extra chain certificates associated with .Fa ctx . Several certificates can be added one after another. .Pp +.Fn SSL_CTX_get_extra_chain_certs +retrieves an internal pointer to the stack of extra chain certificates +associated with +.Fa ctx . +.Pp .Fn SSL_CTX_clear_extra_chain_certs clears all extra chain certificates associated with .Fa ctx . @@ -91,24 +99,45 @@ will be freed by the library when the is destroyed. An application should not free the .Fa x509 -object. +object, nor the +.Pf * Fa certs +object retrieved by +.Fn SSL_CTX_get_extra_chain_certs . .Sh RETURN VALUES -.Fn SSL_CTX_add_extra_chain_cert -and -.Fn SSL_CTX_clear_extra_chain_certs -return 1 on success or 0 for failure. +These functions return 1 on success or 0 for failure. Check out the error stack to find out the reason for failure. .Sh SEE ALSO +.Xr ssl 3 , +.Xr SSL_CTX_add1_chain_cert 3 , .Xr SSL_CTX_ctrl 3 , .Xr SSL_CTX_load_verify_locations 3 , .Xr SSL_CTX_set_client_cert_cb 3 , .Xr SSL_CTX_use_certificate 3 +.Sh HISTORY +.Fn SSL_CTX_add_extra_chain_cert +first appeared in SSLeay 0.9.1 and has been available since +.Ox 2.6 . +.Pp +.Fn SSL_CTX_get_extra_chain_certs +and +.Fn SSL_CTX_clear_extra_chain_certs +first appeared in OpenSSL 1.0.1 and have been available since +.Ox 5.3 . .Sh CAVEATS +Certificates added with +.Fn SSL_CTX_add_extra_chain_cert +are ignored when certificates are also available that have been +added using the functions documented in +.Xr SSL_CTX_set1_chain 3 . +.Pp Only one set of extra chain certificates can be specified per .Vt SSL_CTX -structure. +structure using +.Fn SSL_CTX_add_extra_chain_cert . Different chains for different certificates (for example if both RSA and DSA certificates are specified by the same server) or different SSL structures with the same parent .Vt SSL_CTX -cannot be specified using this function. +require using the functions documented in +.Xr SSL_CTX_set1_chain 3 +instead. diff --git a/man/SSL_CTX_add_session.3 b/man/SSL_CTX_add_session.3 index b99639a8..443bdb54 100644 --- a/man/SSL_CTX_add_session.3 +++ b/man/SSL_CTX_add_session.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_add_session.3,v 1.3 2017/08/21 07:35:30 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_add_session.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL SSL_CTX_add_session.pod 1722496f Jun 8 15:18:38 2017 -0400 .\" .\" This file was written by Lutz Jaenicke and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 21 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_ADD_SESSION 3 .Os .Sh NAME @@ -124,3 +124,9 @@ The operation succeeded. .Xr ssl 3 , .Xr SSL_CTX_set_session_cache_mode 3 , .Xr SSL_SESSION_free 3 +.Sh HISTORY +.Fn SSL_CTX_add_session +and +.Fn SSL_CTX_remove_session +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_ctrl.3 b/man/SSL_CTX_ctrl.3 index 901a8309..c91ddff3 100644 --- a/man/SSL_CTX_ctrl.3 +++ b/man/SSL_CTX_ctrl.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_ctrl.3,v 1.4 2017/04/10 15:54:46 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_ctrl.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_CTRL 3 .Os .Sh NAME @@ -108,3 +108,15 @@ parameter. .Xr SSL_num_renegotiations 3 , .Xr SSL_session_reused 3 , .Xr SSL_set_max_send_fragment 3 +.Sh HISTORY +.Fn SSL_CTX_ctrl +and +.Fn SSL_ctrl +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn SSL_CTX_callback_ctrl +and +.Fn SSL_callback_ctrl +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/SSL_CTX_flush_sessions.3 b/man/SSL_CTX_flush_sessions.3 index 8926731a..2ef781cb 100644 --- a/man/SSL_CTX_flush_sessions.3 +++ b/man/SSL_CTX_flush_sessions.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_flush_sessions.3,v 1.3 2017/08/21 07:45:09 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_flush_sessions.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL SSL_CTX_flush_sessions.pod 1722496f Jun 8 15:18:38 2017 -0400 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 21 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_FLUSH_SESSIONS 3 .Os .Sh NAME @@ -94,3 +94,7 @@ is however called to synchronize with the external cache (see .Xr SSL_CTX_sess_set_get_cb 3 , .Xr SSL_CTX_set_session_cache_mode 3 , .Xr SSL_CTX_set_timeout 3 +.Sh HISTORY +.Fn SSL_CTX_flush_sessions +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_free.3 b/man/SSL_CTX_free.3 index c823a13a..47f24763 100644 --- a/man/SSL_CTX_free.3 +++ b/man/SSL_CTX_free.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_free.3,v 1.2 2016/11/30 13:20:45 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_free.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 30 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_FREE 3 .Os .Sh NAME @@ -95,3 +95,7 @@ prior to calling .Xr ssl 3 , .Xr SSL_CTX_new 3 , .Xr SSL_CTX_sess_set_get_cb 3 +.Sh HISTORY +.Fn SSL_CTX_free +first appeared in SSLeay 0.5.1 and has been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_get0_certificate.3 b/man/SSL_CTX_get0_certificate.3 new file mode 100644 index 00000000..d63ad572 --- /dev/null +++ b/man/SSL_CTX_get0_certificate.3 @@ -0,0 +1,50 @@ +.\" $OpenBSD: SSL_CTX_get0_certificate.3,v 1.2 2018/03/23 14:28:16 schwarze Exp $ +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: March 23 2018 $ +.Dt SSL_CTX_GET0_CERTIFICATE 3 +.Os +.Sh NAME +.Nm SSL_CTX_get0_certificate +.Nd get the active certificate from an SSL context +.Sh SYNOPSIS +.Ft X509 * +.Fo SSL_CTX_get0_certificate +.Fa "const SSL_CTX *ctx" +.Fc +.Sh DESCRIPTION +The +.Fn SSL_CTX_get0_certificate +function returns an internal pointer +to the ASN.1 certificate currently active in +.Fa ctx +or +.Dv NULL +if none was installed with +.Xr SSL_CTX_use_certificate 3 +or similar functions. +.Pp +The returned pointer must not be freed by the caller. +.Sh SEE ALSO +.Xr SSL_CTX_new 3 , +.Xr SSL_CTX_use_certificate 3 , +.Xr X509_get_pubkey 3 , +.Xr X509_get_subject_name 3 , +.Xr X509_new 3 +.Sh HISTORY +.Fn SSL_CTX_get0_certificate +first appeared in OpenSSL 1.0.2 and have been available since +.Ox 6.3 . diff --git a/man/SSL_CTX_get_ex_new_index.3 b/man/SSL_CTX_get_ex_new_index.3 index cd2c0dc8..3dbaf2e9 100644 --- a/man/SSL_CTX_get_ex_new_index.3 +++ b/man/SSL_CTX_get_ex_new_index.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_get_ex_new_index.3,v 1.2 2016/12/06 22:41:16 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_get_ex_new_index.3,v 1.3 2018/03/21 08:06:34 schwarze Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt SSL_CTX_GET_EX_NEW_INDEX 3 .Os .Sh NAME @@ -115,3 +115,10 @@ functionality is described in .Xr CRYPTO_set_ex_data 3 , .Xr RSA_get_ex_new_index 3 , .Xr ssl 3 +.Sh HISTORY +.Fn SSL_CTX_get_ex_new_index , +.Fn SSL_CTX_set_ex_data , +and +.Fn SSL_CTX_get_ex_data +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_get_verify_mode.3 b/man/SSL_CTX_get_verify_mode.3 index 0810b107..7c877750 100644 --- a/man/SSL_CTX_get_verify_mode.3 +++ b/man/SSL_CTX_get_verify_mode.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_get_verify_mode.3,v 1.2 2016/11/30 13:46:26 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_get_verify_mode.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 30 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_GET_VERIFY_MODE 3 .Os .Sh NAME @@ -115,3 +115,17 @@ pointer is returned and the default callback will be used. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_CTX_set_verify 3 +.Sh HISTORY +.Fn SSL_CTX_get_verify_mode , +.Fn SSL_get_verify_mode , +.Fn SSL_get_verify_callback , +and +.Fn SSL_CTX_get_verify_callback +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn SSL_CTX_get_verify_depth +and +.Fn SSL_get_verify_depth +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . diff --git a/man/SSL_CTX_load_verify_locations.3 b/man/SSL_CTX_load_verify_locations.3 index 5433a8d4..373df240 100644 --- a/man/SSL_CTX_load_verify_locations.3 +++ b/man/SSL_CTX_load_verify_locations.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_load_verify_locations.3,v 1.2 2016/11/30 14:16:38 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_load_verify_locations.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Lutz Jaenicke . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 30 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_LOAD_VERIFY_LOCATIONS 3 .Os .Sh NAME @@ -221,6 +221,12 @@ $ for c in *.pem; do .Xr SSL_CTX_set_client_CA_list 3 , .Xr SSL_CTX_use_certificate 3 , .Xr SSL_get_client_CA_list 3 +.Sh HISTORY +.Fn SSL_CTX_load_verify_locations +and +.Fn SSL_CTX_set_default_verify_paths +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . .Sh CAVEATS If several CA certificates matching the name, key identifier, and serial number condition are available, only the first one will be examined. diff --git a/man/SSL_CTX_new.3 b/man/SSL_CTX_new.3 index 0c846cea..35fe702f 100644 --- a/man/SSL_CTX_new.3 +++ b/man/SSL_CTX_new.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: SSL_CTX_new.3,v 1.3 2017/08/19 23:45:10 schwarze Exp $ -.\" OpenSSL 21cd6e00 Aug 17 15:21:33 2015 -0400 +.\" $OpenBSD: SSL_CTX_new.3,v 1.11 2019/03/18 06:23:38 schwarze Exp $ +.\" full merge up to: OpenSSL 21cd6e00 Oct 21 14:40:15 2015 +0100 +.\" selective merge up to: OpenSSL 1212818e Sep 11 13:22:14 2018 +0100 .\" .\" This file was written by Lutz Jaenicke . .\" Copyright (c) 2000, 2005, 2012, 2013, 2015, 2016 The OpenSSL Project. @@ -49,11 +50,12 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 19 2017 $ +.Dd $Mdocdate: March 18 2019 $ .Dt SSL_CTX_NEW 3 .Os .Sh NAME .Nm SSL_CTX_new , +.Nm SSL_CTX_up_ref , .Nm TLS_method , .Nm TLS_server_method , .Nm TLS_client_method , @@ -69,6 +71,9 @@ .Nm TLSv1_2_method , .Nm TLSv1_2_server_method , .Nm TLSv1_2_client_method , +.Nm DTLS_method , +.Nm DTLS_server_method , +.Nm DTLS_client_method , .Nm DTLSv1_method , .Nm DTLSv1_server_method , .Nm DTLSv1_client_method @@ -77,6 +82,8 @@ .In openssl/ssl.h .Ft SSL_CTX * .Fn SSL_CTX_new "const SSL_METHOD *method" +.Ft int +.Fn SSL_CTX_up_ref "SSL_CTX *ctx" .Ft const SSL_METHOD * .Fn TLS_method void .Ft const SSL_METHOD * @@ -108,6 +115,12 @@ .Ft const SSL_METHOD * .Fn TLSv1_2_client_method void .Ft const SSL_METHOD * +.Fn DTLS_method void +.Ft const SSL_METHOD * +.Fn DTLS_server_method void +.Ft const SSL_METHOD * +.Fn DTLS_client_method void +.Ft const SSL_METHOD * .Fn DTLSv1_method void .Ft const SSL_METHOD * .Fn DTLSv1_server_method void @@ -122,6 +135,23 @@ It initializes the list of ciphers, the session cache setting, the callbacks, the keys and certificates, and the options to its default values. .Pp +An +.Vt SSL_CTX +object is reference counted. +Creating a new +.Vt SSL_CTX +object sets its reference count to 1. +Calling +.Fn SSL_CTX_up_ref +on it increments the reference count by 1. +Calling +.Xr SSL_CTX_free 3 +on it decrements the reference count by 1. +When the reference count drops to zero, +any memory or resources allocated to the +.Vt SSL_CTX +object are freed. +.Pp The .Vt SSL_CTX object uses @@ -178,6 +208,13 @@ understand the TLSv1.1 protocol. A TLS/SSL connection established with these methods will only understand the TLSv1.2 protocol. .It Xo +.Fn DTLS_method , +.Fn DTLS_server_method , +.Fn DTLS_client_method +.Xc +These are the version-flexible DTLS methods. +The currently supported protocol is DTLS 1.0. +.It Xo .Fn DTLSv1_method , .Fn DTLSv1_server_method , .Fn DTLSv1_client_method @@ -202,18 +239,14 @@ In clients, when a protocol version is disabled without disabling all previous protocol versions, the effect is to also disable all subsequent protocol versions. .Sh RETURN VALUES -The following return values can occur: -.Bl -tag -width Ds -.It Dv NULL -The creation of a new -.Vt SSL_CTX -object failed. -Check the error stack to find out the reason. -.It Pointer to an SSL_CTX object -The return value points to an allocated -.Vt SSL_CTX -object. -.El +.Fn SSL_CTX_new +returns a pointer to the newly allocated object or +.Dv NULL +on failure. +Check the error stack to find out the reason for failure. +.Pp +.Fn SSL_CTX_up_ref +returns 1 for success or 0 for failure. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_accept 3 , @@ -221,3 +254,53 @@ object. .Xr SSL_CTX_set_min_proto_version 3 , .Xr SSL_CTX_set_options 3 , .Xr SSL_set_connect_state 3 +.Sh HISTORY +.Fn SSL_CTX_new +first appeared in SSLeay 0.5.1. +.Fn SSLv23_method , +.Fn SSLv23_server_method , +and +.Fn SSLv23_client_method +first appeared in SSLeay 0.8.0. +.Fn TLSv1_method , +.Fn TLSv1_server_method , +and +.Fn TLSv1_client_method +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn DTLSv1_method , +.Fn DTLSv1_server_method , +and +.Fn DTLSv1_client_method +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Pp +.Fn TLSv1_1_method , +.Fn TLSv1_1_server_method , +.Fn TLSv1_1_client_method , +.Fn TLSv1_2_method , +.Fn TLSv1_2_server_method , +and +.Fn TLSv1_2_client_method +first appeared in OpenSSL 1.0.1 and have been available since +.Ox 5.3 . +.Pp +.Fn DTLS_method , +.Fn DTLS_server_method , +and +.Fn DTLS_client_method +first appeared in OpenSSL 1.0.2 and have been available since +.Ox 6.5 . +.Pp +.Fn TLS_method , +.Fn TLS_server_method , +and +.Fn TLS_client_method +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 5.8 . +.Pp +.Fn SSL_CTX_up_ref +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/SSL_CTX_sess_number.3 b/man/SSL_CTX_sess_number.3 index c40cdbc6..4c0e0c37 100644 --- a/man/SSL_CTX_sess_number.3 +++ b/man/SSL_CTX_sess_number.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_sess_number.3,v 1.4 2017/04/10 14:00:51 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_sess_number.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL SSL_CTX_sess_number.pod 7bd27895 Mar 29 11:45:29 2017 +1000 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SESS_NUMBER 3 .Os .Sh NAME @@ -145,3 +145,23 @@ cache size was exceeded. .Xr SSL_CTX_sess_set_cache_size 3 , .Xr SSL_CTX_set_session_cache_mode 3 , .Xr SSL_set_session 3 +.Sh HISTORY +.Fn SSL_CTX_sess_number , +.Fn SSL_CTX_sess_connect , +.Fn SSL_CTX_sess_connect_good , +.Fn SSL_CTX_sess_accept , +.Fn SSL_CTX_sess_accept_good , +.Fn SSL_CTX_sess_hits , +.Fn SSL_CTX_sess_misses , +and +.Fn SSL_CTX_sess_timeouts +first appeared in SSLeay 0.5.2. +.Fn SSL_CTX_sess_cb_hits +first appeared in SSLeay 0.6.0. +.Fn SSL_CTX_sess_connect_renegotiate , +.Fn SSL_CTX_sess_accept_renegotiate , +and +.Fn SSL_CTX_sess_cache_full +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_sess_set_cache_size.3 b/man/SSL_CTX_sess_set_cache_size.3 index 0533a547..0b9e69a6 100644 --- a/man/SSL_CTX_sess_set_cache_size.3 +++ b/man/SSL_CTX_sess_set_cache_size.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_sess_set_cache_size.3,v 1.3 2017/04/10 14:00:51 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_sess_set_cache_size.3,v 1.4 2018/03/21 08:06:34 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 21 2018 $ .Dt SSL_CTX_SESS_SET_CACHE_SIZE 3 .Os .Sh NAME @@ -100,3 +100,9 @@ returns the currently valid size. .Xr SSL_CTX_flush_sessions 3 , .Xr SSL_CTX_sess_number 3 , .Xr SSL_CTX_set_session_cache_mode 3 +.Sh HISTORY +.Fn SSL_CTX_sess_set_cache_size +and +.Fn SSL_CTX_sess_get_cache_size +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_sess_set_get_cb.3 b/man/SSL_CTX_sess_set_get_cb.3 index 5448c97e..5b2b4ba9 100644 --- a/man/SSL_CTX_sess_set_get_cb.3 +++ b/man/SSL_CTX_sess_set_get_cb.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_sess_set_get_cb.3,v 1.2 2016/11/30 16:25:29 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_sess_set_get_cb.3,v 1.6 2018/04/25 14:07:57 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 30 2016 $ +.Dd $Mdocdate: April 25 2018 $ .Dt SSL_CTX_SESS_SET_GET_CB 3 .Os .Sh NAME @@ -75,38 +75,38 @@ .Ft void .Fo SSL_CTX_sess_set_get_cb .Fa "SSL_CTX *ctx" -.Fa "SSL_SESSION (*get_session_cb)(SSL *, unsigned char *, int, int *)" +.Fa "SSL_SESSION (*get_session_cb)(SSL *, const unsigned char *, int, int *)" .Fc .Ft int .Fo "(*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))" -.Fa "struct ssl_st *ssl" +.Fa "SSL *ssl" .Fa "SSL_SESSION *sess" .Fc .Ft void .Fo "(*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))" -.Fa "struct ssl_ctx_st *ctx" +.Fa "SSL_CTX *ctx" .Fa "SSL_SESSION *sess" .Fc .Ft SSL_SESSION * .Fo "(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))" -.Fa "struct ssl_st *ssl" -.Fa "unsigned char *data" +.Fa "SSL *ssl" +.Fa "const unsigned char *data" .Fa "int len" .Fa "int *copy" .Fc .Ft int .Fo "(*new_session_cb)" -.Fa "struct ssl_st *ssl" +.Fa "SSL *ssl" .Fa "SSL_SESSION *sess" .Fc .Ft void .Fo "(*remove_session_cb)" -.Fa "struct ssl_ctx_st *ctx" +.Fa "SSL_CTX *ctx" .Fa "SSL_SESSION *sess" .Fc .Ft SSL_SESSION * .Fo "(*get_session_cb)" -.Fa "struct ssl_st *ssl" +.Fa "SSL *ssl" .Fa "unsigned char *data" .Fa "int len" .Fa "int *copy" @@ -205,3 +205,16 @@ not be explicitly freed with .Xr SSL_CTX_free 3 , .Xr SSL_CTX_set_session_cache_mode 3 , .Xr SSL_SESSION_free 3 +.Sh HISTORY +.Fn SSL_CTX_sess_set_new_cb , +.Fn SSL_CTX_sess_set_get_cb , +.Fn SSL_CTX_sess_get_new_cb , +and +.Fn SSL_CTX_sess_get_get_cb +first appeared in SSLeay 0.6.0. +.Fn SSL_CTX_sess_set_remove_cb +and +.Fn SSL_CTX_sess_get_remove_cb +first appeared in SSLeay 0.8.0. +These functions have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_sessions.3 b/man/SSL_CTX_sessions.3 index 835808ef..964d1a73 100644 --- a/man/SSL_CTX_sessions.3 +++ b/man/SSL_CTX_sessions.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_sessions.3,v 1.2 2016/11/30 16:25:29 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_sessions.3,v 1.5 2018/04/25 14:19:39 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 30 2016 $ +.Dd $Mdocdate: April 25 2018 $ .Dt SSL_CTX_SESSIONS 3 .Os .Sh NAME @@ -56,7 +56,7 @@ .Nd access internal session cache .Sh SYNOPSIS .In openssl/ssl.h -.Ft struct lhash_st * +.Ft LHASH_OF(SSL_SESSION) * .Fn SSL_CTX_sessions "SSL_CTX *ctx" .Sh DESCRIPTION .Fn SSL_CTX_sessions @@ -80,3 +80,7 @@ family of functions. .Xr ssl 3 , .Xr SSL_CTX_add_session 3 , .Xr SSL_CTX_set_session_cache_mode 3 +.Sh HISTORY +.Fn SSL_CTX_sessions +first appeared in SSLeay 0.5.2 and has been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_set_alpn_select_cb.3 b/man/SSL_CTX_set_alpn_select_cb.3 index 2c090512..540fd011 100644 --- a/man/SSL_CTX_set_alpn_select_cb.3 +++ b/man/SSL_CTX_set_alpn_select_cb.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_alpn_select_cb.3,v 1.5 2017/08/28 17:36:58 jsing Exp $ +.\" $OpenBSD: SSL_CTX_set_alpn_select_cb.3,v 1.7 2018/03/23 14:28:16 schwarze Exp $ .\" OpenSSL 87b81496 Apr 19 12:38:27 2017 -0400 .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 28 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt SSL_CTX_SET_ALPN_SELECT_CB 3 .Os .Sh NAME @@ -259,3 +259,15 @@ ALPN protocol not selected. .Xr ssl 3 , .Xr SSL_CTX_set_tlsext_servername_arg 3 , .Xr SSL_CTX_set_tlsext_servername_callback 3 +.Sh HISTORY +.Fn SSL_select_next_proto +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . +.Pp +.Fn SSL_CTX_set_alpn_protos , +.Fn SSL_set_alpn_protos , +.Fn SSL_CTX_set_alpn_select_cb , +and +.Fn SSL_get0_alpn_selected +first appeared in OpenSSL 1.0.2 and have been available since +.Ox 5.7 . diff --git a/man/SSL_CTX_set_cert_store.3 b/man/SSL_CTX_set_cert_store.3 index 4fd6fa77..b23e3c4a 100644 --- a/man/SSL_CTX_set_cert_store.3 +++ b/man/SSL_CTX_set_cert_store.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_cert_store.3,v 1.4 2017/04/10 16:11:50 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_cert_store.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_CERT_STORE 3 .Os .Sh NAME @@ -120,4 +120,11 @@ returns the current setting. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_CTX_load_verify_locations 3 , -.Xr SSL_CTX_set_verify 3 +.Xr SSL_CTX_set_verify 3 , +.Xr X509_STORE_new 3 +.Sh HISTORY +.Fn SSL_CTX_set_cert_store +and +.Fn SSL_CTX_get_cert_store +first appeared in SSLeay 0.8.1 and have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_set_cert_verify_callback.3 b/man/SSL_CTX_set_cert_verify_callback.3 index f782807a..e3ca5ff4 100644 --- a/man/SSL_CTX_set_cert_verify_callback.3 +++ b/man/SSL_CTX_set_cert_verify_callback.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_cert_verify_callback.3,v 1.2 2016/11/30 17:23:53 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_cert_verify_callback.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 30 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_CERT_VERIFY_CALLBACK 3 .Os .Sh NAME @@ -127,6 +127,10 @@ function set using .Xr SSL_CTX_set_verify 3 , .Xr SSL_get_verify_result 3 .Sh HISTORY +.Fn SSL_CTX_set_cert_verify_callback +first appeared in SSLeay 0.6.1 and has been available since +.Ox 2.4 . +.Pp Previous to OpenSSL 0.9.7, the .Fa arg argument to diff --git a/man/SSL_CTX_set_cipher_list.3 b/man/SSL_CTX_set_cipher_list.3 index 0f24cc1c..a64826e5 100644 --- a/man/SSL_CTX_set_cipher_list.3 +++ b/man/SSL_CTX_set_cipher_list.3 @@ -1,7 +1,24 @@ -.\" $OpenBSD: SSL_CTX_set_cipher_list.3,v 1.4 2017/08/19 23:47:33 schwarze Exp $ -.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" $OpenBSD: SSL_CTX_set_cipher_list.3,v 1.7 2018/04/10 21:37:20 schwarze Exp $ +.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" -.\" This file was written by Lutz Jaenicke . +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Lutz Jaenicke . .\" Copyright (c) 2000, 2001, 2013 The OpenSSL Project. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -48,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 19 2017 $ +.Dd $Mdocdate: April 10 2018 $ .Dt SSL_CTX_SET_CIPHER_LIST 3 .Os .Sh NAME @@ -58,43 +75,268 @@ .Sh SYNOPSIS .In openssl/ssl.h .Ft int -.Fn SSL_CTX_set_cipher_list "SSL_CTX *ctx" "const char *str" +.Fn SSL_CTX_set_cipher_list "SSL_CTX *ctx" "const char *control" .Ft int -.Fn SSL_set_cipher_list "SSL *ssl" "const char *str" +.Fn SSL_set_cipher_list "SSL *ssl" "const char *control" .Sh DESCRIPTION .Fn SSL_CTX_set_cipher_list -sets the list of available ciphers for +sets the list of available cipher suites for .Fa ctx -using the control string -.Fa str . -The format of the string is described -in -.Xr openssl 1 . -The list of ciphers is inherited by all +using the +.Fa control +string. +The list of cipher suites is inherited by all .Fa ssl objects created from .Fa ctx . .Pp .Fn SSL_set_cipher_list -sets the list of ciphers only for +sets the list of cipher suites only for .Fa ssl . .Pp -The control string -.Fa str -should be universally usable and not depend on details of the library -configuration (ciphers compiled in). -Thus no syntax checking takes place. -Items that are not recognized, because the corresponding ciphers are not -compiled in or because they are mistyped, are simply ignored. -Failure is only flagged if no ciphers could be collected at all. +The control string consists of one or more control words +separated by colon characters +.Pq Ql \&: . +Space +.Pq Ql \ \& , +semicolon +.Pq Ql \&; , +and comma +.Pq Ql \&, +characters can also be used as separators. +Each control words selects a set of cipher suites +and can take one of the following optional prefix characters: +.Bl -tag -width Ds +.It \&No prefix: +Those of the selected cipher suites that have not been made available +yet are added to the end of the list of available cipher suites, +preserving their order. +.It Prefixed minus sign Pq Ql \- : +Those of the selected cipher suites that have been made available +earlier are moved back from the list of available cipher suites to +the beginning of the list of unavailable cipher suites, +also preserving their order. +.It Prefixed plus sign Pq Ql + : +Those of the selected cipher suites have been made available earlier +are moved to end of the list of available cipher suites, reducing +their priority, but preserving the order among themselves. +.It Prefixed exclamation mark Pq Ql \&! : +The selected cipher suites are permanently deleted, no matter whether +they had earlier been made available or not, and can no longer +be added or re-added by later words. +.El +.Pp +The following special words can only be used without a prefix: +.Bl -tag -width Ds +.It Cm DEFAULT +An alias for +.Sm off +.Cm ALL No :! Cm aNULL No :! Cm eNULL . +.Sm on +It can only be used as the first word. +.It Cm @STRENGTH +Sort the list by decreasing encryption strength, +preserving the order of cipher suites that have the same strength. +It is usally given as the last word. +.El +.Pp +The following words can be used to select groups of cipher suites, +with or without a prefix character. +If two or more of these words are joined with plus signs +.Pq Ql + +to form a longer word, only the intersection of the specified sets +is selected. +.Bl -tag -width Ds +.It Cm ADH +Cipher suites using ephemeral DH for key exchange +without doing any server authentication. +Equivalent to +.Cm kEDH Ns + Ns Cm aNULL . +.It Cm aDSS +Cipher suites using DSS server authentication. +LibreSSL does not provide any such cipher suites. +.It Cm AEAD +Cipher suites using Authenticated Encryption with Additional Data. +.It Cm AECDH +Cipher suites using ephemeral ECDH for key exchange +without doing any server authentication. +Equivalent to +.Cm kEECDH Ns + Ns Cm aNULL . +.It Cm aECDSA +Cipher suites using ECDSA server authentication. +.It Cm AES +Cipher suites using AES or AESGCM for symmetric encryption. +.It Cm AES128 +Cipher suites using AES(128) or AESGCM(128) for symmetric encryption. +.It Cm AES256 +Cipher suites using AES(256) or AESGCM(256) for symmetric encryption. +.It Cm AESGCM +Cipher suites using AESGCM for symmetric encryption. +.It Cm aGOST +An alias for +.Cm aGOST01 . +.It Cm aGOST01 +Cipher suites using GOST R 34.10-2001 server authentication. +.It Cm ALL +All cipher suites except those selected by +.Cm eNULL . +.It Cm aNULL +Cipher suites that don't do any server authentication. +Not enabled by +.Cm DEFAULT . +Beware of man-in-the-middle attacks. +.It Cm aRSA +Cipher suites using RSA server authentication. +.It Cm CAMELLIA +Cipher suites using Camellia for symmetric encryption. +.It Cm CAMELLIA128 +Cipher suites using Camellia(128) for symmetric encryption. +.It Cm CAMELLIA256 +Cipher suites using Camellia(256) for symmetric encryption. +.It Cm CHACHA20 +Cipher suites using ChaCha20-Poly1305 for symmetric encryption. +.It Cm COMPLEMENTOFALL +Cipher suites that are not included in +.Cm ALL . +Currently an alias for +.Cm eNULL . +.It Cm COMPLEMENTOFDEFAULT +Cipher suites that are included in +.Cm ALL , +but not included in +.Cm DEFAULT . +Currently similar to +.Cm aNULL Ns :! Ns Cm eNULL +except for the order of the cipher suites which are +.Em not +selected. +.It Cm DES +Cipher suites using single DES for symmetric encryption. +.It Cm 3DES +Cipher suites using triple DES for symmetric encryption. +.It Cm DH +An alias for +.Cm kEDH . +.It Cm DHE +Cipher suites using ephemeral DH for key exchange, +but excluding those that don't do any server authentication. +Similar to +.Cm kEDH Ns :! Ns Cm aNULL +except for the order of the cipher suites which are +.Em not +selected. +.It Cm DSS +An alias for +.Cm aDSS . +.It Cm ECDH +An alias for +.Cm kEECHD . +.It Cm ECDHE +Cipher suites using ephemeral ECDH for key exchange, +but excluding those that don't do any server authentication. +Similar to +.Cm kEECDH Ns :! Ns Cm aNULL +except for the order of the cipher suites which are +.Em not +selected. +.It Cm ECDSA +An alias for +.Cm aECDSA . +.It Cm EDH +An alias for +.Cm DHE . +.It Cm EECHD +An alias for +.Cm ECDHE . +.It Cm eNULL +Cipher suites that do not use any encryption. +Not enabled by +.Cm DEFAULT , +and not even included in +.Cm ALL . +.It Cm GOST89MAC +Cipher suites using GOST 28147-89 for message authentication +instead of HMAC. +.It Cm GOST94 +Cipher suites using HMAC based on GOST R 34.11-94 +for message authentication. +.It Cm HIGH +Cipher suites of high strength. +Currently, these are cipher suites using +.Cm CHACHA20 , +.Cm AES , +.Cm CAMELLIA , +or GOST-28178-89-CNT symmetric encryption. +.It Cm IDEA +Cipher suites using IDEA for symmetric encryption. +LibreSSL does not provide any such cipher suites. +.It Cm kEDH +Cipher suites using ephemeral DH for key exchange. +.It Cm kEECDH +Cipher suites using ephemeral ECDH for key exchange. +.It Cm kGOST +Cipher suites using VKO 34.10 key exchange, specified in RFC 4357. +.It Cm kRSA +Cipher suites using RSA key exchange. +.It Cm LOW +Cipher suites of low strength. +Currently, these are cipher suites using +.Cm DES +or +.Cm RC4 +symmetric encryption. +.It Cm MD5 +Cipher suites using MD5 for message authentication. +.It Cm MEDIUM +Cipher suites of medium strength. +Currently, these are cipher suites using +.Cm 3DES +symmetric encryption. +.It Cm NULL +An alias for +.Cm eNULL . +.It Cm RC4 +Cipher suites using RC4 for symmetric encryption. +.It Cm RSA +Cipher suites using RSA for both key exchange and server authentication. +Equivalent to +.Cm kRSA Ns + Ns Cm aRSA . +.It Cm SHA +An alias for +.Cm SHA1 . +.It Cm SHA1 +Cipher suites using SHA1 for message authentication. +.It Cm SHA256 +Cipher suites using SHA256 for message authentication. +.It Cm SHA384 +Cipher suites using SHA384 for message authentication. +.It Cm SSLv3 +An alias for +.Cm TLSv1 . +.It Cm STREEBOG256 +Cipher suites using STREEBOG256 for message authentication. +.It Cm TLSv1 +Cipher suites usable with any TLS protocol. +.It Cm TLSv1.2 +Cipher suites for the TLSv1.2 protocol. +.El .Pp -It should be noted that inclusion of a cipher to be used into the list is a -necessary condition. -On the client side, the inclusion into the list is also sufficient. -On the server side, additional restrictions apply. -All ciphers have additional requirements. +The full words returned by the +.Xr openssl 1 +.Cm ciphers +command can be used to select individual cipher suites. +.Pp +Unknown words are silently ignored, selecting no cipher suites. +Failure is only flagged if the +.Fa control +string contains invalid bytes +or if no matching cipher suites are available at all. +.Pp +On the client side, including a cipher suite into the list of +available cipher suites is sufficient for using it. +On the server side, all cipher suites have additional requirements. ADH ciphers don't need a certificate, but DH-parameters must have been set. -All other ciphers need a corresponding certificate and key. +All other cipher suites need a corresponding certificate and key. .Pp A RSA cipher can only be chosen when a RSA certificate is available. RSA ciphers using DHE need a certificate and key and additional DH-parameters @@ -105,7 +347,8 @@ A DSA cipher can only be chosen when a DSA certificate is available. DSA ciphers always use DH key exchange and therefore need DH-parameters (see .Xr SSL_CTX_set_tmp_dh_callback 3 ) . .Pp -When these conditions are not met for any cipher in the list (for example, a +When these conditions are not met +for any cipher suite in the list (for example, a client only supports export RSA ciphers with an asymmetric key length of 512 bits and the server is not configured to use temporary RSA keys), the .Dq no shared cipher @@ -115,10 +358,16 @@ error is generated and the handshake will fail. .Fn SSL_CTX_set_cipher_list and .Fn SSL_set_cipher_list -return 1 if any cipher could be selected and 0 on complete failure. +return 1 if any cipher suite could be selected and 0 on complete failure. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_CTX_set1_groups 3 , .Xr SSL_CTX_set_tmp_dh_callback 3 , .Xr SSL_CTX_use_certificate 3 , .Xr SSL_get_ciphers 3 +.Sh HISTORY +.Fn SSL_CTX_set_cipher_list +and +.Fn SSL_set_cipher_list +first appeared in SSLeay 0.5.2 and have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_set_client_CA_list.3 b/man/SSL_CTX_set_client_CA_list.3 index 73924b08..274a673b 100644 --- a/man/SSL_CTX_set_client_CA_list.3 +++ b/man/SSL_CTX_set_client_CA_list.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_client_CA_list.3,v 1.3 2016/12/14 16:20:28 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_client_CA_list.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 14 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_CLIENT_CA_LIST 3 .Os .Sh NAME @@ -178,3 +178,11 @@ SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(CAfile)); .Xr SSL_get_client_CA_list 3 , .Xr SSL_load_client_CA_file 3 , .Xr X509_NAME_new 3 +.Sh HISTORY +.Fn SSL_CTX_set_client_CA_list , +.Fn SSL_set_client_CA_list , +.Fn SSL_CTX_add_client_CA , +and +.Fn SSL_add_client_CA +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_set_client_cert_cb.3 b/man/SSL_CTX_set_client_cert_cb.3 index 28002c1e..a2433b5e 100644 --- a/man/SSL_CTX_set_client_cert_cb.3 +++ b/man/SSL_CTX_set_client_cert_cb.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_client_cert_cb.3,v 1.2 2016/11/30 17:26:09 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_client_cert_cb.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 30 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_CLIENT_CERT_CB 3 .Os .Sh NAME @@ -146,6 +146,12 @@ certificate. .Xr SSL_CTX_use_certificate 3 , .Xr SSL_free 3 , .Xr SSL_get_client_CA_list 3 +.Sh HISTORY +.Fn SSL_CTX_set_client_cert_cb +and +.Fn SSL_CTX_get_client_cert_cb +first appeared in SSLeay 0.6.6 and have been available since +.Ox 2.4 . .Sh BUGS The .Fa client_cert_cb() diff --git a/man/SSL_CTX_set_default_passwd_cb.3 b/man/SSL_CTX_set_default_passwd_cb.3 index 0bc35106..7ab9633f 100644 --- a/man/SSL_CTX_set_default_passwd_cb.3 +++ b/man/SSL_CTX_set_default_passwd_cb.3 @@ -1,8 +1,10 @@ -.\" $OpenBSD: SSL_CTX_set_default_passwd_cb.3,v 1.3 2017/08/01 14:57:03 schwarze Exp $ -.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" $OpenBSD: SSL_CTX_set_default_passwd_cb.3,v 1.7 2018/04/02 02:06:14 schwarze Exp $ +.\" full merge up to: OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" selective merge up to: OpenSSL 2947af32 Nov 19 00:10:05 2016 +0100 .\" -.\" This file was written by Lutz Jaenicke . -.\" Copyright (c) 2000, 2001 The OpenSSL Project. All rights reserved. +.\" This file was written by Lutz Jaenicke +.\" and Christian Heimes . +.\" Copyright (c) 2000, 2001, 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 @@ -48,20 +50,26 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 1 2017 $ +.Dd $Mdocdate: April 2 2018 $ .Dt SSL_CTX_SET_DEFAULT_PASSWD_CB 3 .Os .Sh NAME .Nm SSL_CTX_set_default_passwd_cb , .Nm SSL_CTX_set_default_passwd_cb_userdata , +.Nm SSL_CTX_get_default_passwd_cb , +.Nm SSL_CTX_get_default_passwd_cb_userdata , .Nm pem_password_cb -.Nd set passwd callback for encrypted PEM file handling +.Nd set or get passwd callback for encrypted PEM file handling .Sh SYNOPSIS .In openssl/ssl.h .Ft void .Fn SSL_CTX_set_default_passwd_cb "SSL_CTX *ctx" "pem_password_cb *cb" .Ft void .Fn SSL_CTX_set_default_passwd_cb_userdata "SSL_CTX *ctx" "void *u" +.Ft pem_password_cb * +.Fn SSL_CTX_get_default_passwd_cb "SSL_CTX *ctx" +.Ft void * +.Fn SSL_CTX_get_default_passwd_cb_userdata "SSL_CTX *ctx" .In openssl/pem.h .Ft typedef int .Fn pem_password_cb "char *buf" "int size" "int rwflag" "void *userdata" @@ -114,6 +122,20 @@ comparison in order to catch typos which would make decryption impossible. .Pp Other items in PEM formatting (certificates) can also be encrypted; it is however atypical, as certificate information is considered public. +.Sh RETURN VALUES +.Fn SSL_CTX_get_default_passwd_cb +returns a function pointer to the password callback currently set in +.Fa ctx , +or +.Dv NULL +if none is set. +.Pp +.Fn SSL_CTX_get_default_passwd_cb_userdata +returns a pointer to the userdata currently set in +.Fa ctx , +or +.Dv NULL +if none is set. .Sh EXAMPLES The following example returns the password provided as .Fa userdata @@ -133,3 +155,17 @@ int pem_passwd_cb(char *buf, int size, int rwflag, void *password) .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_CTX_use_certificate 3 +.Sh HISTORY +.Fn SSL_CTX_set_default_passwd_cb +first appeared in SSLeay 0.6.2 and has been available since +.Ox 2.4 . +.Pp +.Fn SSL_CTX_set_default_passwd_cb_userdata +first appeared in OpenSSL 0.9.4 and has been available since +.Ox 2.6 . +.Pp +.Fn SSL_CTX_get_default_passwd_cb +and +.Fn SSL_CTX_get_default_passwd_cb_userdata +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . diff --git a/man/SSL_CTX_set_generate_session_id.3 b/man/SSL_CTX_set_generate_session_id.3 index be487ec8..d85383d7 100644 --- a/man/SSL_CTX_set_generate_session_id.3 +++ b/man/SSL_CTX_set_generate_session_id.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_generate_session_id.3,v 1.4 2017/08/01 14:57:03 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_generate_session_id.3,v 1.5 2018/03/22 21:09:18 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 1 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt SSL_CTX_SET_GENERATE_SESSION_ID 3 .Os .Sh NAME @@ -217,4 +217,5 @@ generate_session_id(const SSL *ssl, unsigned char *id, .Fn SSL_set_generate_session_id and .Fn SSL_has_matching_session_id -were introduced in OpenSSL 0.9.7. +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/SSL_CTX_set_info_callback.3 b/man/SSL_CTX_set_info_callback.3 index 2c385860..76eb8bee 100644 --- a/man/SSL_CTX_set_info_callback.3 +++ b/man/SSL_CTX_set_info_callback.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_info_callback.3,v 1.2 2016/11/30 18:29:14 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_info_callback.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 30 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_INFO_CALLBACK 3 .Os .Sh NAME @@ -227,3 +227,7 @@ apps_ssl_info_callback(SSL *s, int where, int ret) .Xr ssl 3 , .Xr SSL_alert_type_string 3 , .Xr SSL_state_string 3 +.Sh HISTORY +These functions first appeared in SSLeay 0.6.0 +and have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_set_max_cert_list.3 b/man/SSL_CTX_set_max_cert_list.3 index 51805c6b..7714e1d1 100644 --- a/man/SSL_CTX_set_max_cert_list.3 +++ b/man/SSL_CTX_set_max_cert_list.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_max_cert_list.3,v 1.3 2017/04/10 14:00:51 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_max_cert_list.3,v 1.4 2018/03/22 21:09:18 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt SSL_CTX_SET_MAX_CERT_LIST 3 .Os .Sh NAME @@ -148,5 +148,6 @@ return the currently set value. .Xr SSL_CTX_set_verify 3 , .Xr SSL_new 3 .Sh HISTORY -.Fn SSL*_set/get_max_cert_list -were introduced in OpenSSL 0.9.7. +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 3.2 . diff --git a/man/SSL_CTX_set_min_proto_version.3 b/man/SSL_CTX_set_min_proto_version.3 index ff057cad..b1b313ff 100644 --- a/man/SSL_CTX_set_min_proto_version.3 +++ b/man/SSL_CTX_set_min_proto_version.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: SSL_CTX_set_min_proto_version.3,v 1.1 2017/08/19 23:45:10 schwarze Exp $ -.\" OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 +.\" $OpenBSD: SSL_CTX_set_min_proto_version.3,v 1.3 2018/03/24 00:55:37 schwarze Exp $ +.\" full merge up to: OpenSSL 3edabd3c Sep 14 09:28:39 2017 +0200 .\" -.\" This file was written by Kurt Roeckx . -.\" Copyright (c) 2015 The OpenSSL Project. All rights reserved. +.\" This file was written by Kurt Roeckx and +.\" Christian Heimes . +.\" Copyright (c) 2015, 2017 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 @@ -48,15 +49,19 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 19 2017 $ +.Dd $Mdocdate: March 24 2018 $ .Dt SSL_CTX_SET_MIN_PROTO_VERSION 3 .Os .Sh NAME .Nm SSL_CTX_set_min_proto_version , .Nm SSL_CTX_set_max_proto_version , +.Nm SSL_CTX_get_min_proto_version , +.Nm SSL_CTX_get_max_proto_version , .Nm SSL_set_min_proto_version , -.Nm SSL_set_max_proto_version -.Nd set minimum and maximum supported protocol version +.Nm SSL_set_max_proto_version , +.Nm SSL_get_min_proto_version , +.Nm SSL_get_max_proto_version +.Nd get and set minimum and maximum supported protocol version .Sh SYNOPSIS .In openssl/ssl.h .Ft int @@ -70,6 +75,14 @@ .Fa "uint16_t version" .Fc .Ft int +.Fo SSL_CTX_get_min_proto_version +.Fa "SSL_CTX *ctx" +.Fc +.Ft int +.Fo SSL_CTX_get_max_proto_version +.Fa "SSL_CTX *ctx" +.Fc +.Ft int .Fo SSL_set_min_proto_version .Fa "SSL *ssl" .Fa "uint16_t version" @@ -79,8 +92,16 @@ .Fa "SSL *ssl" .Fa "uint16_t version" .Fc +.Ft int +.Fo SSL_get_min_proto_version +.Fa "SSL *ssl" +.Fc +.Ft int +.Fo SSL_get_max_proto_version +.Fa "SSL *ssl" +.Fc .Sh DESCRIPTION -These functions set the minimum and maximum supported protocol +These functions get or set the minimum and maximum supported protocol versions for .Fa ctx or @@ -102,13 +123,32 @@ and for TLS and .Sy DTLS1_VERSION for DTLS. +.Pp +In other implementations, these functions may be implemented as macros. .Sh RETURN VALUES -These functions return 1 on success or 0 on failure. +The setter functions return 1 on success or 0 on failure. +.Pp +The getter functions return the configured version or 0 if +.Fa ctx +or +.Fa ssl +has been configured to automatically use the lowest or highest +version supported by the library. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_CTX_new 3 , .Xr SSL_CTX_set_options 3 .Sh HISTORY -These functions first appeared in OpenSSL 1.1.0 -and have been available since +The setter functions first appeared in BoringSSL in December 2014, +with shorter names without the +.Sy proto_ +part. +Two years later, OpenSSL included them in their 1.1.0 release, +gratuitiously changing the names; Google shrugged and adopted +the longer names one month later. +They have been available since .Ox 6.2 . +.Pp +The getter functions first appeared in OpenSSL 1.1.0g +and have been available since +.Ox 6.3 . diff --git a/man/SSL_CTX_set_mode.3 b/man/SSL_CTX_set_mode.3 index 25a11175..08826ff7 100644 --- a/man/SSL_CTX_set_mode.3 +++ b/man/SSL_CTX_set_mode.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: SSL_CTX_set_mode.3,v 1.3 2017/04/10 14:00:51 schwarze Exp $ -.\" OpenSSL 8671b898 Jun 3 02:48:34 2008 +0000 +.\" $OpenBSD: SSL_CTX_set_mode.3,v 1.5 2019/04/09 21:06:31 schwarze Exp $ +.\" full merge up to: OpenSSL 8671b898 Jun 3 02:48:34 2008 +0000 +.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 .\" .\" This file was written by Lutz Jaenicke and .\" Ben Laurie . @@ -49,12 +50,14 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: April 9 2019 $ .Dt SSL_CTX_SET_MODE 3 .Os .Sh NAME .Nm SSL_CTX_set_mode , .Nm SSL_set_mode , +.Nm SSL_CTX_clear_mode , +.Nm SSL_clear_mode , .Nm SSL_CTX_get_mode , .Nm SSL_get_mode .Nd manipulate SSL engine mode @@ -65,33 +68,48 @@ .Ft long .Fn SSL_set_mode "SSL *ssl" "long mode" .Ft long +.Fn SSL_CTX_clear_mode "SSL_CTX *ctx" "long mode" +.Ft long +.Fn SSL_clear_mode "SSL *ssl" "long mode" +.Ft long .Fn SSL_CTX_get_mode "SSL_CTX *ctx" .Ft long .Fn SSL_get_mode "SSL *ssl" .Sh DESCRIPTION .Fn SSL_CTX_set_mode -adds the mode set via bitmask in +and +.Fn SSL_set_mode +enable the options contained in the bitmask .Fa mode -to -.Fa ctx . -Options already set before are not cleared. +for the +.Fa ctx +or +.Fa ssl +object, respectively. +Options that were already enabled before the call are not disabled. .Pp -.Fn SSL_set_mode -adds the mode set via bitmask in +.Fn SSL_CTX_clear_mode +and +.Fn SSL_clear_mode +disable the options contained in the bitmask .Fa mode -to -.Fa ssl . -Options already set before are not cleared. +for the +.Fa ctx +or +.Fa ssl +object. .Pp .Fn SSL_CTX_get_mode -returns the mode set for -.Fa ctx . -.Pp +and .Fn SSL_get_mode -returns the mode set for -.Fa ssl . -.Sh NOTES -The following mode changes are available: +return a bitmask representing the options +that are currently enabled for the +.Fa ctx +or +.Fa ssl +object. +.Pp +The following options are available: .Bl -tag -width Ds .It Dv SSL_MODE_ENABLE_PARTIAL_WRITE Allow @@ -150,10 +168,12 @@ Using this flag can save around 34k per idle SSL connection. This flag has no effect on SSL v2 connections, or on DTLS connections. .El .Sh RETURN VALUES -.Fn SSL_CTX_set_mode +.Fn SSL_CTX_set_mode , +.Fn SSL_set_mode , +.Fn SSL_CTX_clear_mode , and -.Fn SSL_set_mode -return the new mode bitmask after adding +.Fn SSL_clear_mode +return the new mode bitmask after adding or clearing .Fa mode . .Pp .Fn SSL_CTX_get_mode @@ -165,5 +185,19 @@ return the current bitmask. .Xr SSL_read 3 , .Xr SSL_write 3 .Sh HISTORY +.Fn SSL_CTX_set_mode , +.Fn SSL_set_mode , +.Fn SSL_CTX_get_mode , +and +.Fn SSL_get_mode +first appeared in OpenSSL 0.9.4 and have been available since +.Ox 2.6 . +.Pp +.Fn SSL_CTX_clear_mode +and +.Fn SSL_clear_mode +first appeared in OpenSSL 0.9.8m and have been available since +.Ox 4.9 . +.Pp .Dv SSL_MODE_AUTO_RETRY was added in OpenSSL 0.9.6. diff --git a/man/SSL_CTX_set_msg_callback.3 b/man/SSL_CTX_set_msg_callback.3 index 65d81fe4..a8af1a34 100644 --- a/man/SSL_CTX_set_msg_callback.3 +++ b/man/SSL_CTX_set_msg_callback.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_msg_callback.3,v 1.3 2017/08/21 09:07:08 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_msg_callback.3,v 1.4 2018/03/22 21:09:18 schwarze Exp $ .\" OpenSSL SSL_CTX_set_msg_callback.pod e9b77246 Jan 20 19:58:49 2017 +0100 .\" OpenSSL SSL_CTX_set_msg_callback.pod b97fdb57 Nov 11 09:33:09 2016 +0100 .\" @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 21 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt SSL_CTX_SET_MSG_CALLBACK 3 .Os .Sh NAME @@ -178,4 +178,5 @@ will be .Fn SSL_set_msg_callback and .Fn SSL_set_msg_callback_arg -were added in OpenSSL 0.9.7. +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/SSL_CTX_set_options.3 b/man/SSL_CTX_set_options.3 index 98c1a6d3..4535eee5 100644 --- a/man/SSL_CTX_set_options.3 +++ b/man/SSL_CTX_set_options.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: SSL_CTX_set_options.3,v 1.4 2017/08/19 23:45:10 schwarze Exp $ -.\" OpenSSL 361a1191 Dec 6 17:56:41 2015 +0100 +.\" $OpenBSD: SSL_CTX_set_options.3,v 1.12 2018/04/11 18:05:49 schwarze Exp $ +.\" full merge up to: OpenSSL 7946ab33 Dec 6 17:56:41 2015 +0100 +.\" selective merge up to: OpenSSL edb79c3a Mar 29 10:07:14 2017 +1000 .\" .\" This file was written by Lutz Jaenicke , .\" Bodo Moeller , and @@ -51,7 +52,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 19 2017 $ +.Dd $Mdocdate: April 11 2018 $ .Dt SSL_CTX_SET_OPTIONS 3 .Os .Sh NAME @@ -154,12 +155,9 @@ Disables a countermeasure against a TLS 1.0 protocol vulnerability affecting CBC ciphers, which cannot be handled by some broken SSL implementations. This option has no effect for connections using other ciphers. -.It Dv SSL_OP_TLSEXT_PADDING -Adds a padding extension to ensure the ClientHello size is never between 256 -and 511 bytes in length. -This is needed as a workaround for some implementations. .It Dv SSL_OP_ALL -All of the above bug workarounds. +This is currently an alias for +.Dv SSL_OP_LEGACY_SERVER_CONNECT . .El .Pp It is usually safe to use @@ -171,22 +169,34 @@ The following .Em modifying options are available: .Bl -tag -width Ds -.It Dv SSL_OP_TLS_ROLLBACK_BUG -Disable version rollback attack detection. -.Pp -During the client key exchange, the client must send the same information -about acceptable SSL/TLS protocol levels as during the first hello. -Some clients violate this rule by adapting to the server's answer. -(Example: the client sends a SSLv2 hello and accepts up to SSLv3.1=TLSv1, -the server only understands up to SSLv3. -In this case the client must still use the same SSLv3.1=TLSv1 announcement. -Some clients step down to SSLv3 with respect to the server's answer and violate -the version rollback protection.) .It Dv SSL_OP_CIPHER_SERVER_PREFERENCE When choosing a cipher, use the server's preferences instead of the client preferences. When not set, the server will always follow the client's preferences. When set, the server will choose following its own preferences. +.It Dv SSL_OP_COOKIE_EXCHANGE +Turn on Cookie Exchange as described in RFC4347 Section 4.2.1. +Only affects DTLS connections. +.It Dv SSL_OP_LEGACY_SERVER_CONNECT +Allow legacy insecure renegotiation between OpenSSL and unpatched servers +.Em only : +this option is currently set by default. +See the +.Sx SECURE RENEGOTIATION +section for more details. +.It Dv SSL_OP_NO_QUERY_MTU +Do not query the MTU. +Only affects DTLS connections. +.It Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION +When performing renegotiation as a server, always start a new session (i.e., +session resumption requests are only accepted in the initial handshake). +This option is not needed for clients. +.It Dv SSL_OP_NO_TICKET +Normally clients and servers will, where possible, transparently make use of +RFC4507bis tickets for stateless session resumption. +.Pp +If this option is set this functionality is disabled and tickets will not be +used by clients or servers. .It Dv SSL_OP_NO_TLSv1 Do not use the TLSv1.0 protocol. Deprecated; use @@ -199,23 +209,6 @@ Do not use the TLSv1.2 protocol. Deprecated; use .Xr SSL_CTX_set_max_proto_version 3 instead. -.It Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION -When performing renegotiation as a server, always start a new session (i.e., -session resumption requests are only accepted in the initial handshake). -This option is not needed for clients. -.It Dv SSL_OP_NO_TICKET -Normally clients and servers will, where possible, transparently make use of -RFC4507bis tickets for stateless session resumption. -.Pp -If this option is set this functionality is disabled and tickets will not be -used by clients or servers. -.It Dv SSL_OP_LEGACY_SERVER_CONNECT -Allow legacy insecure renegotiation between OpenSSL and unpatched servers -.Em only : -this option is currently set by default. -See the -.Sx SECURE RENEGOTIATION -section for more details. .El .Pp The following options used to be supported at some point in the past @@ -228,16 +221,20 @@ and no longer have any effect: .Dv SSL_OP_NETSCAPE_CHALLENGE_BUG , .Dv SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG , .Dv SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG , +.Dv SSL_OP_NO_COMPRESSION , .Dv SSL_OP_NO_SSLv2 , .Dv SSL_OP_NO_SSLv3 , .Dv SSL_OP_PKCS1_CHECK_1 , .Dv SSL_OP_PKCS1_CHECK_2 , .Dv SSL_OP_SAFARI_ECDHE_ECDSA_BUG , .Dv SSL_OP_SINGLE_DH_USE , +.Dv SSL_OP_SINGLE_ECDH_USE , .Dv SSL_OP_SSLEAY_080_CLIENT_DH_BUG , .Dv SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG , .Dv SSL_OP_TLS_BLOCK_PADDING_BUG , -.Dv SSL_OP_TLS_D5_BUG . +.Dv SSL_OP_TLS_D5_BUG , +.Dv SSL_OP_TLS_ROLLBACK_BUG , +.Dv SSL_OP_TLSEXT_PADDING . .Sh SECURE RENEGOTIATION OpenSSL 0.9.8m and later always attempts to use secure renegotiation as described in RFC5746. @@ -268,9 +265,8 @@ alert is sent. This is because the server code may be unaware of the unpatched nature of the client. .Pp -.Em N.B.: -a bug in OpenSSL clients earlier than 0.9.8m (all of which are unpatched) will -result in the connection hanging if it receives a +Note that a bug in OpenSSL clients earlier than 0.9.8m (all of which +are unpatched) will result in the connection hanging if it receives a .Em no_renegotiation alert. OpenSSL versions 0.9.8m and later will regard a @@ -344,7 +340,21 @@ returns 1 is the peer supports secure renegotiation and 0 if it does not. .Xr SSL_CTX_set_min_proto_version 3 , .Xr SSL_new 3 .Sh HISTORY -.Fn SSL_CTX_clear_options +.Fn SSL_CTX_set_options and -.Fn SSL_clear_options -were first added in OpenSSL 0.9.8m. +.Fn SSL_set_options +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . +.Pp +.Fn SSL_CTX_get_options +and +.Fn SSL_get_options +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . +.Pp +.Fn SSL_CTX_clear_options , +.Fn SSL_clear_options , +and +.Fn SSL_get_secure_renegotiation_support +first appeared in OpenSSL 0.9.8m and have been available since +.Ox 4.9 . diff --git a/man/SSL_CTX_set_quiet_shutdown.3 b/man/SSL_CTX_set_quiet_shutdown.3 index 9939c7d4..feea399b 100644 --- a/man/SSL_CTX_set_quiet_shutdown.3 +++ b/man/SSL_CTX_set_quiet_shutdown.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_quiet_shutdown.3,v 1.2 2016/12/01 16:46:59 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_quiet_shutdown.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 1 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_QUIET_SHUTDOWN 3 .Os .Sh NAME @@ -160,3 +160,7 @@ return the current setting. .Xr SSL_new 3 , .Xr SSL_set_shutdown 3 , .Xr SSL_shutdown 3 +.Sh HISTORY +These functions first appeared in SSLeay 0.8.1 +and have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_set_read_ahead.3 b/man/SSL_CTX_set_read_ahead.3 index 4b6f6d7f..eae76eb4 100644 --- a/man/SSL_CTX_set_read_ahead.3 +++ b/man/SSL_CTX_set_read_ahead.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_read_ahead.3,v 1.1 2016/12/01 16:48:36 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_read_ahead.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Matt Caswell . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 1 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_READ_AHEAD 3 .Os .Sh NAME @@ -125,6 +125,19 @@ except that the return values are undefined for DTLS. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_pending 3 +.Sh HISTORY +.Fn SSL_set_read_ahead +and +.Fn SSL_get_read_ahead +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . +.Pp +.Fn SSL_CTX_set_read_ahead , +.Fn SSL_CTX_get_read_ahead , +and +.Fn SSL_CTX_get_default_read_ahead +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . .Sh CAVEATS Switching read ahead on can impact the behaviour of the .Xr SSL_pending 3 diff --git a/man/SSL_CTX_set_session_cache_mode.3 b/man/SSL_CTX_set_session_cache_mode.3 index 4a69b84c..0f8ee90b 100644 --- a/man/SSL_CTX_set_session_cache_mode.3 +++ b/man/SSL_CTX_set_session_cache_mode.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_session_cache_mode.3,v 1.4 2017/04/10 14:00:51 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_session_cache_mode.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 67adf0a7 Dec 25 19:58:38 2016 +0100 .\" .\" This file was written by Lutz Jaenicke and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_SESSION_CACHE_MODE 3 .Os .Sh NAME @@ -185,6 +185,12 @@ returns the currently set cache mode. .Xr SSL_session_reused 3 , .Xr SSL_set_session 3 .Sh HISTORY +.Fn SSL_CTX_set_session_cache_mode +and +.Fn SSL_CTX_get_session_cache_mode +first appeared in SSLeay 0.6.1 and have been available since +.Ox 2.4 . +.Pp .Dv SSL_SESS_CACHE_NO_INTERNAL_STORE and .Dv SSL_SESS_CACHE_NO_INTERNAL diff --git a/man/SSL_CTX_set_session_id_context.3 b/man/SSL_CTX_set_session_id_context.3 index 99fa4ae8..bbc0102a 100644 --- a/man/SSL_CTX_set_session_id_context.3 +++ b/man/SSL_CTX_set_session_id_context.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_session_id_context.3,v 1.3 2017/04/10 15:37:55 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_session_id_context.3,v 1.5 2018/03/21 17:58:58 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 21 2018 $ .Dt SSL_CTX_SET_SESSION_ID_CONTEXT 3 .Os .Sh NAME @@ -151,3 +151,10 @@ The operation succeeded. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_SESSION_set1_id_context 3 +.Sh HISTORY +.Fn SSL_set_session_id_context +first appeared in OpenSSL 0.9.2b. +.Fn SSL_CTX_set_session_id_context +first appeared in OpenSSL 0.9.3. +Both functions have been available since +.Ox 2.6 . diff --git a/man/SSL_CTX_set_ssl_version.3 b/man/SSL_CTX_set_ssl_version.3 index 381343f7..eb29af62 100644 --- a/man/SSL_CTX_set_ssl_version.3 +++ b/man/SSL_CTX_set_ssl_version.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_ssl_version.3,v 1.2 2016/12/01 19:50:12 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_ssl_version.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 1 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_SSL_VERSION 3 .Os .Sh NAME @@ -126,3 +126,10 @@ The operation succeeded. .Xr SSL_CTX_new 3 , .Xr SSL_new 3 , .Xr SSL_set_connect_state 3 +.Sh HISTORY +.Fn SSL_CTX_set_ssl_version , +.Fn SSL_set_ssl_method , +and +.Fn SSL_get_ssl_method +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_set_timeout.3 b/man/SSL_CTX_set_timeout.3 index 683c4007..ab99e201 100644 --- a/man/SSL_CTX_set_timeout.3 +++ b/man/SSL_CTX_set_timeout.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_timeout.3,v 1.2 2016/12/01 19:50:12 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_timeout.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 1 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_TIMEOUT 3 .Os .Sh NAME @@ -110,3 +110,9 @@ returns the currently set timeout value. .Xr SSL_CTX_set_session_cache_mode 3 , .Xr SSL_get_default_timeout 3 , .Xr SSL_SESSION_get_time 3 +.Sh HISTORY +.Fn SSL_CTX_set_timeout +and +.Fn SSL_CTX_get_timeout +first appeared in SSLeay 0.6.1 and have been available since +.Ox 2.4 . diff --git a/man/SSL_CTX_set_tlsext_servername_callback.3 b/man/SSL_CTX_set_tlsext_servername_callback.3 index 79095426..71449bd0 100644 --- a/man/SSL_CTX_set_tlsext_servername_callback.3 +++ b/man/SSL_CTX_set_tlsext_servername_callback.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_tlsext_servername_callback.3,v 1.2 2017/08/21 09:41:15 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_tlsext_servername_callback.3,v 1.3 2018/03/23 01:06:56 schwarze Exp $ .\" OpenSSL 190b9a03 Jun 28 15:46:13 2017 +0800 .\" OpenSSL 8c55c461 Mar 29 08:34:37 2017 +1000 .\" @@ -50,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 21 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt SSL_CTX_SET_TLSEXT_SERVERNAME_CALLBACK 3 .Os .Sh NAME @@ -146,3 +146,7 @@ returns 1 on success or 0 in case of an error. .Sh SEE ALSO .Xr SSL_CTX_callback_ctrl 3 , .Xr SSL_CTX_set_alpn_select_cb 3 +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.8f +and have been available since +.Ox 4.5 . diff --git a/man/SSL_CTX_set_tlsext_status_cb.3 b/man/SSL_CTX_set_tlsext_status_cb.3 index b195e168..b57c28b5 100644 --- a/man/SSL_CTX_set_tlsext_status_cb.3 +++ b/man/SSL_CTX_set_tlsext_status_cb.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: SSL_CTX_set_tlsext_status_cb.3,v 1.2 2017/04/10 14:00:51 schwarze Exp $ -.\" OpenSSL 43c34894 Nov 30 16:04:51 2015 +0000 +.\" $OpenBSD: SSL_CTX_set_tlsext_status_cb.3,v 1.6 2018/03/24 00:11:37 schwarze Exp $ +.\" full merge up to: OpenSSL 43c34894 Nov 30 16:04:51 2015 +0000 +.\" selective merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 .\" .\" This file was written by Matt Caswell . -.\" Copyright (c) 2015 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2015, 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 @@ -48,12 +49,14 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 24 2018 $ .Dt SSL_CTX_SET_TLSEXT_STATUS_CB 3 .Os .Sh NAME .Nm SSL_CTX_set_tlsext_status_cb , +.Nm SSL_CTX_get_tlsext_status_cb , .Nm SSL_CTX_set_tlsext_status_arg , +.Nm SSL_CTX_get_tlsext_status_arg , .Nm SSL_set_tlsext_status_type , .Nm SSL_get_tlsext_status_ocsp_resp , .Nm SSL_set_tlsext_status_ocsp_resp @@ -66,11 +69,21 @@ .Fa "int (*callback)(SSL *, void *)" .Fc .Ft long +.Fo SSL_CTX_get_tlsext_status_cb +.Fa "SSL_CTX *ctx" +.Fa "int (*callback)(SSL *, void *)" +.Fc +.Ft long .Fo SSL_CTX_set_tlsext_status_arg .Fa "SSL_CTX *ctx" .Fa "void *arg" .Fc .Ft long +.Fo SSL_CTX_get_tlsext_status_arg +.Fa "SSL_CTX *ctx" +.Fa "void **arg" +.Fc +.Ft long .Fo SSL_set_tlsext_status_type .Fa "SSL *s" .Fa "int type" @@ -112,6 +125,13 @@ Note that the callback will not be called in the event of a handshake where session resumption occurs (because there are no Certificates exchanged in such a handshake). .Pp +The callback previously set via +.Fn SSL_CTX_set_tlsext_status_cb +can be retrieved by calling +.Fn SSL_CTX_get_tlsext_status_cb , +and the argument by calling +.Fn SSL_CTX_get_tlsext_status_arg . +.Pp The response returned by the server can be obtained via a call to .Fn SSL_get_tlsext_status_ocsp_resp . The value @@ -155,14 +175,31 @@ The callback when used on the server side should return with either (meaning that a fatal error has occurred). .Pp .Fn SSL_CTX_set_tlsext_status_cb , +.Fn SSL_CTX_get_tlsext_status_cb , .Fn SSL_CTX_set_tlsext_status_arg , +.Fn SSL_CTX_get_tlsext_status_arg , .Fn SSL_set_tlsext_status_type , and .Fn SSL_set_tlsext_status_ocsp_resp -return 0 on error or 1 on success. +always return 1, indicating success. .Pp .Fn SSL_get_tlsext_status_ocsp_resp -returns the length of the OCSP response data or -1 if there is no OCSP -response data. +returns the length of the OCSP response data +or \-1 if there is no OCSP response data. .Sh SEE ALSO .Xr SSL_CTX_callback_ctrl 3 +.Sh HISTORY +.Fn SSL_CTX_set_tlsext_status_cb , +.Fn SSL_CTX_set_tlsext_status_arg , +.Fn SSL_set_tlsext_status_type , +.Fn SSL_get_tlsext_status_ocsp_resp , +and +.Fn SSL_set_tlsext_status_ocsp_resp +first appeared in OpenSSL 0.9.8h and have been available since +.Ox 4.5 . +.Pp +.Fn SSL_CTX_get_tlsext_status_cb +and +.Fn SSL_CTX_get_tlsext_status_arg +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . diff --git a/man/SSL_CTX_set_tlsext_ticket_key_cb.3 b/man/SSL_CTX_set_tlsext_ticket_key_cb.3 index 04f4c687..80aeaeb4 100644 --- a/man/SSL_CTX_set_tlsext_ticket_key_cb.3 +++ b/man/SSL_CTX_set_tlsext_ticket_key_cb.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_tlsext_ticket_key_cb.3,v 1.3 2017/04/10 14:00:51 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_tlsext_ticket_key_cb.3,v 1.4 2018/03/23 01:06:56 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Rich Salz @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt SSL_CTX_SET_TLSEXT_TICKET_KEY_CB 3 .Os .Sh NAME @@ -293,3 +293,7 @@ static int ssl_tlsext_ticket_key_cb(SSL *s, unsigned char key_name[16], .Xr SSL_CTX_set_session_id_context 3 , .Xr SSL_session_reused 3 , .Xr SSL_set_session 3 +.Sh HISTORY +.Fn SSL_CTX_set_tlsext_ticket_key_cb +first appeared in OpenSSL 0.9.8h and has been available since +.Ox 4.5 . diff --git a/man/SSL_CTX_set_tlsext_use_srtp.3 b/man/SSL_CTX_set_tlsext_use_srtp.3 new file mode 100644 index 00000000..23786f76 --- /dev/null +++ b/man/SSL_CTX_set_tlsext_use_srtp.3 @@ -0,0 +1,192 @@ +.\" $OpenBSD: SSL_CTX_set_tlsext_use_srtp.3,v 1.3 2018/03/30 19:31:11 schwarze Exp $ +.\" full merge up to: OpenSSL b0edda11 Mar 20 13:00:17 2018 +0000 +.\" +.\" This file was written by Matt Caswell . +.\" Copyright (c) 2017 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. +.\" +.Dd $Mdocdate: March 30 2018 $ +.Dt SSL_CTX_SET_TLSEXT_USE_SRTP 3 +.Os +.Sh NAME +.Nm SSL_CTX_set_tlsext_use_srtp , +.Nm SSL_set_tlsext_use_srtp , +.Nm SSL_get_srtp_profiles , +.Nm SSL_get_selected_srtp_profile +.Nd Configure and query SRTP support +.Sh SYNOPSIS +.In openssl/srtp.h +.Ft int +.Fo SSL_CTX_set_tlsext_use_srtp +.Fa "SSL_CTX *ctx" +.Fa "const char *profiles" +.Fc +.Ft int +.Fo SSL_set_tlsext_use_srtp +.Fa "SSL *ssl" +.Fa "const char *profiles" +.Fc +.Ft STACK_OF(SRTP_PROTECTION_PROFILE) * +.Fo SSL_get_srtp_profiles +.Fa "SSL *ssl" +.Fc +.Ft SRTP_PROTECTION_PROFILE * +.Fo SSL_get_selected_srtp_profile +.Fa "SSL *ssl" +.Fc +.Sh DESCRIPTION +SRTP is the Secure Real-Time Transport Protocol. +OpenSSL implements support for the "use_srtp" DTLS extension +defined in RFC5764. +This provides a mechanism for establishing SRTP keying material, +algorithms and parameters using DTLS. +This capability may be used as part of an implementation that +conforms to RFC5763. +OpenSSL does not implement SRTP itself or RFC5763. +Note that OpenSSL does not support the use of SRTP Master Key +Identifiers (MKIs). +Also note that this extension is only supported in DTLS. +Any SRTP configuration is ignored if a TLS connection is attempted. +.Pp +An OpenSSL client wishing to send the "use_srtp" extension should call +.Fn SSL_CTX_set_tlsext_use_srtp +to set its use for all +.Vt SSL +objects subsequently created from +.Fa ctx . +Alternatively a client may call +.Fn SSL_set_tlsext_use_srtp +to set its use for an individual +.Vt SSL +object. +The +.Fa profiles +parameter should point to a NUL-terminated, colon delimited list of +SRTP protection profile names. +.Pp +The currently supported protection profile names are: +.Bl -tag -width Ds +.It Dv SRTP_AES128_CM_SHA1_80 +This corresponds to SRTP_AES128_CM_HMAC_SHA1_80 defined in RFC5764. +.It Dv SRTP_AES128_CM_SHA1_32 +This corresponds to SRTP_AES128_CM_HMAC_SHA1_32 defined in RFC5764. +.El +.Pp +Supplying an unrecognised protection profile name results in an error. +.Pp +An OpenSSL server wishing to support the "use_srtp" extension should +also call +.Fn SSL_CTX_set_tlsext_use_srtp +or +.Fn SSL_set_tlsext_use_srtp +to indicate the protection profiles that it is willing to negotiate. +.Pp +The currently configured list of protection profiles for either a client +or a server can be obtained by calling +.Fn SSL_get_srtp_profiles . +This returns a stack of +.Vt SRTP_PROTECTION_PROFILE +objects. +The memory pointed to in the return value of this function should not be +freed by the caller. +.Pp +After a handshake has been completed, the negotiated SRTP protection +profile (if any) can be obtained (on the client or the server) by +calling +.Fn SSL_get_selected_srtp_profile . +This function returns +.Dv NULL +if no SRTP protection profile was negotiated. +The memory returned from this function should not be freed by the +caller. +.Pp +If an SRTP protection profile has been successfully negotiated, +then the SRTP keying material (on both the client and server) +should be obtained by calling +.Xr SSL_export_keying_material 3 +with a +.Fa label +of +.Qq EXTRACTOR-dtls_srtp , +a +.Fa context +of +.Dv NULL , +and a +.Fa use_context +argument of 0. +The total length of keying material obtained should be equal to two +times the sum of the master key length and the salt length as defined +for the protection profile in use. +This provides the client write master key, the server write master key, +the client write master salt and the server write master salt in that +order. +.Sh RETURN VALUES +Contrary to OpenSSL conventions, +.Fn SSL_CTX_set_tlsext_use_srtp +and +.Fn SSL_set_tlsext_use_srtp +return 0 on success or 1 on error. +.Pp +.Fn SSL_get_srtp_profiles +returns a stack of +.Vt SRTP_PROTECTION_PROFILE +objects on success or +.Dv NULL +on error or if no protection profiles have been configured. +.Pp +.Fn SSL_get_selected_srtp_profile +returns a pointer to an +.Vt SRTP_PROTECTION_PROFILE +object if one has been negotiated or +.Dv NULL +otherwise. +.Sh SEE ALSO +.Xr SSL_export_keying_material 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.0.1 +and have been available since +.Ox 5.3 . diff --git a/man/SSL_CTX_set_tmp_dh_callback.3 b/man/SSL_CTX_set_tmp_dh_callback.3 index 3cfb060a..b4f54eab 100644 --- a/man/SSL_CTX_set_tmp_dh_callback.3 +++ b/man/SSL_CTX_set_tmp_dh_callback.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_tmp_dh_callback.3,v 1.4 2017/08/12 12:31:30 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_tmp_dh_callback.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 12 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_TMP_DH_CALLBACK 3 .Os .Sh NAME @@ -221,3 +221,15 @@ if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1) { .Xr SSL_CTX_set_cipher_list 3 , .Xr SSL_CTX_set_options 3 , .Xr SSL_set_tmp_ecdh 3 +.Sh HISTORY +.Fn SSL_CTX_set_tmp_dh_callback +and +.Fn SSL_CTX_set_tmp_dh +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn SSL_set_tmp_dh_callback +and +.Fn SSL_set_tmp_dh +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . diff --git a/man/SSL_CTX_set_tmp_rsa_callback.3 b/man/SSL_CTX_set_tmp_rsa_callback.3 index 8a3c5fa4..0181634f 100644 --- a/man/SSL_CTX_set_tmp_rsa_callback.3 +++ b/man/SSL_CTX_set_tmp_rsa_callback.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_CTX_set_tmp_rsa_callback.3,v 1.4 2017/08/12 12:21:55 schwarze Exp $ +.\" $OpenBSD: SSL_CTX_set_tmp_rsa_callback.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 0b30fc90 Dec 19 15:23:05 2013 -0500 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 12 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_TMP_RSA_CALLBACK 3 .Os .Sh NAME @@ -57,7 +57,7 @@ .Nm SSL_CTX_need_tmp_RSA , .Nm SSL_set_tmp_rsa_callback , .Nm SSL_set_tmp_rsa , -.Nm SSL_need_tmp_rsa +.Nm SSL_need_tmp_RSA .Nd handle RSA keys for ephemeral key exchange .Sh SYNOPSIS .In openssl/ssl.h @@ -78,7 +78,7 @@ .Ft long .Fn SSL_set_tmp_rsa "SSL *ssl" "RSA *rsa" .Ft long -.Fn SSL_need_tmp_rsa "SSL *ssl" +.Fn SSL_need_tmp_RSA "SSL *ssl" .Sh DESCRIPTION Since they mattered only for deliberately insecure RSA authentication mandated by historical U.S. export restrictions, these functions @@ -98,3 +98,17 @@ These functions always return 0, indicating failure. .Xr SSL_CTX_set_tmp_dh_callback 3 , .Xr SSL_new 3 , .Xr SSL_set_tmp_ecdh 3 +.Sh HISTORY +.Fn SSL_CTX_set_tmp_rsa_callback , +.Fn SSL_CTX_set_tmp_rsa , +and +.Fn SSL_CTX_need_tmp_RSA +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn SSL_set_tmp_rsa_callback +.Fn SSL_set_tmp_rsa , +and +.Fn SSL_need_tmp_RSA +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . diff --git a/man/SSL_CTX_set_verify.3 b/man/SSL_CTX_set_verify.3 index 911c26ed..40a09de9 100644 --- a/man/SSL_CTX_set_verify.3 +++ b/man/SSL_CTX_set_verify.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: SSL_CTX_set_verify.3,v 1.3 2016/12/16 15:39:08 jmc Exp $ -.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" $OpenBSD: SSL_CTX_set_verify.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" selective merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . .\" Copyright (c) 2000, 2001, 2002, 2003, 2014 The OpenSSL Project. @@ -49,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 16 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CTX_SET_VERIFY 3 .Os .Sh NAME @@ -116,6 +117,11 @@ is used, that was valid at the time .Fa ssl was created with .Xr SSL_new 3 . +Within the callback function, +.Xr SSL_get_ex_data_X509_STORE_CTX_idx 3 +can be called to get the data index of the current +.Vt SSL +object that is doing the verification. .Pp .Fn SSL_CTX_set_verify_depth sets the maximum @@ -438,6 +444,19 @@ if (peer = SSL_get_peer_certificate(ssl)) { .Xr SSL_get_peer_certificate 3 , .Xr SSL_get_verify_result 3 , .Xr SSL_new 3 +.Sh HISTORY +.Fn SSL_set_verify +appeared in SSLeay 0.4 or earlier. +.Fn SSL_CTX_set_verify +first appeared in SSLeay 0.6.4. +Both functions have been available since +.Ox 2.4 . +.Pp +.Fn SSL_CTX_set_verify_depth +and +.Fn SSL_set_verify_depth +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . .Sh BUGS In client mode, it is not checked whether the .Dv SSL_VERIFY_PEER diff --git a/man/SSL_CTX_use_certificate.3 b/man/SSL_CTX_use_certificate.3 index bc7d03cc..99593302 100644 --- a/man/SSL_CTX_use_certificate.3 +++ b/man/SSL_CTX_use_certificate.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: SSL_CTX_use_certificate.3,v 1.5 2017/08/20 23:18:53 schwarze Exp $ -.\" OpenSSL e248596b Apr 8 22:49:57 2005 +0000 +.\" $OpenBSD: SSL_CTX_use_certificate.3,v 1.11 2019/04/09 22:01:50 schwarze Exp $ +.\" full merge up to: OpenSSL 3aaa1bd0 Mar 28 16:35:25 2017 +1000 +.\" selective merge up to: OpenSSL d1f7a1e6 Apr 26 14:05:40 2018 +0100 .\" .\" This file was written by Lutz Jaenicke . .\" Copyright (c) 2000, 2001, 2002, 2003, 2005 The OpenSSL Project. @@ -49,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: April 9 2019 $ .Dt SSL_CTX_USE_CERTIFICATE 3 .Os .Sh NAME @@ -117,7 +118,7 @@ .Ft int .Fn SSL_use_RSAPrivateKey "SSL *ssl" "RSA *rsa" .Ft int -.Fn SSL_use_RSAPrivateKey_ASN1 "SSL *ssl" "unsigned char *d" "long len" +.Fn SSL_use_RSAPrivateKey_ASN1 "SSL *ssl" "const unsigned char *d" "long len" .Ft int .Fn SSL_use_RSAPrivateKey_file "SSL *ssl" "const char *file" "int type" .Ft int @@ -334,10 +335,10 @@ They merely compare the public materials (e.g. exponent and modulus of an RSA key) and/or key parameters (e.g. EC params of an EC key) of a key pair. .Sh NOTES -The internal certificate store of OpenSSL can hold two private key/certificate -pairs at a time: -one key/certificate of type RSA and one key/certificate of type DSA. -The certificate used depends on the cipher select, see also +The internal certificate store of OpenSSL can hold several private +key/certificate pairs at a time. +The certificate used depends on the cipher selected. +See also .Xr SSL_CTX_set_cipher_list 3 . .Pp When reading certificates and private keys from file, files of type @@ -354,11 +355,8 @@ can contain more than one item. .Fn SSL_CTX_use_certificate_chain_file adds the first certificate found in the file to the certificate store. The other certificates are added to the store of chain certificates using -.Xr SSL_CTX_add_extra_chain_cert 3 . -There exists only one extra chain store, so that the same chain is appended -to both types of certificates, RSA and DSA! -If it is not intended to use both type of certificate at the same time, -it is recommended to use the +.Xr SSL_CTX_add1_chain_cert 3 . +It is recommended to use the .Fn SSL_CTX_use_certificate_chain_file instead of the .Fn SSL_CTX_use_certificate_file @@ -384,14 +382,53 @@ Otherwise check out the error stack to find out the reason. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_clear 3 , +.Xr SSL_CTX_add1_chain_cert 3 , .Xr SSL_CTX_add_extra_chain_cert 3 , .Xr SSL_CTX_load_verify_locations 3 , .Xr SSL_CTX_set_cipher_list 3 , +.Xr SSL_CTX_set_client_CA_list 3 , .Xr SSL_CTX_set_client_cert_cb 3 , .Xr SSL_CTX_set_default_passwd_cb 3 , .Xr SSL_new 3 , .Xr X509_check_private_key 3 .Sh HISTORY +.Fn SSL_use_certificate , +.Fn SSL_use_certificate_file , +.Fn SSL_use_RSAPrivateKey , +and +.Fn SSL_use_RSAPrivateKey_file +appeared in SSLeay 0.4 or earlier. +.Fn SSL_use_certificate_ASN1 +and +.Fn SSL_use_RSAPrivateKey_ASN1 +first appeared in SSLeay 0.5.1. +.Fn SSL_use_PrivateKey_file , +.Fn SSL_use_PrivateKey_ASN1 , +and +.Fn SSL_use_PrivateKey +first appeared in SSLeay 0.6.0. +.Fn SSL_CTX_use_certificate , +.Fn SSL_CTX_use_certificate_ASN1 , +.Fn SSL_CTX_use_certificate_file , +.Fn SSL_CTX_use_PrivateKey , +.Fn SSL_CTX_use_PrivateKey_ASN1 , +.Fn SSL_CTX_use_PrivateKey_file , +.Fn SSL_CTX_use_RSAPrivateKey , +.Fn SSL_CTX_use_RSAPrivateKey_ASN1 , +and +.Fn SSL_CTX_use_RSAPrivateKey_file +first appeared in SSLeay 0.6.1. +.Fn SSL_CTX_check_private_key +and +.Fn SSL_check_private_key +first appeared in SSLeay 0.6.5. +All these functions have been available since +.Ox 2.4 . +.Pp +.Fn SSL_CTX_use_certificate_chain_file +first appeared in OpenSSL 0.9.4 and has been available since +.Ox 2.6 . +.Pp Support for DER encoded private keys .Pq Dv SSL_FILETYPE_ASN1 in @@ -399,3 +436,7 @@ in and .Fn SSL_use_PrivateKey_file was added in 0.9.8. +.Pp +.Fn SSL_CTX_use_certificate_chain_mem +first appeared in +.Ox 5.7 . diff --git a/man/SSL_SESSION_free.3 b/man/SSL_SESSION_free.3 index 1a37af27..14c6b3c4 100644 --- a/man/SSL_SESSION_free.3 +++ b/man/SSL_SESSION_free.3 @@ -1,8 +1,10 @@ -.\" $OpenBSD: SSL_SESSION_free.3,v 1.2 2016/12/06 18:53:55 schwarze Exp $ -.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" $OpenBSD: SSL_SESSION_free.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL b31db505 Mar 24 16:01:50 2017 +0000 .\" -.\" This file was written by Lutz Jaenicke . -.\" Copyright (c) 2000, 2001, 2009 The OpenSSL Project. All rights reserved. +.\" This file was written by Lutz Jaenicke +.\" and Matt Caswell . +.\" Copyright (c) 2000, 2001, 2009, 2017 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 @@ -48,25 +50,31 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SESSION_FREE 3 .Os .Sh NAME +.Nm SSL_SESSION_up_ref , .Nm SSL_SESSION_free -.Nd free an allocated SSL_SESSION structure +.Nd SSL_SESSION reference counting .Sh SYNOPSIS .In openssl/ssl.h +.Ft int +.Fn SSL_SESSION_up_ref "SSL_SESSION *session" .Ft void .Fn SSL_SESSION_free "SSL_SESSION *session" .Sh DESCRIPTION -.Fn SSL_SESSION_free -decrements the reference count of +.Fn SSL_SESSION_up_ref +increments the reference count of the given .Fa session -and removes the -.Vt SSL_SESSION -structure pointed to by +by 1. +.Pp +.Fn SSL_SESSION_free +decrements the reference count of the given .Fa session -and frees up the allocated memory, if the reference count has reached 0. +by 1. +If the reference count reaches 0, it frees the memory used by the +.Fa session . If .Fa session is a @@ -120,9 +128,20 @@ It must not be called on other .Vt SSL_SESSION objects, as this would cause incorrect reference counts and therefore program failures. +.Sh RETURN VALUES +.Fn SSL_SESSION_up_ref +returns 1 on success or 0 on error. .Sh SEE ALSO .Xr d2i_SSL_SESSION 3 , .Xr SSL_CTX_flush_sessions 3 , .Xr SSL_CTX_set_session_cache_mode 3 , .Xr SSL_get_session 3 , .Xr SSL_SESSION_new 3 +.Sh HISTORY +.Fn SSL_SESSION_free +first appeared in SSLeay 0.5.2 and has been available since +.Ox 2.4 . +.Pp +.Fn SSL_SESSION_up_ref +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/SSL_SESSION_get0_peer.3 b/man/SSL_SESSION_get0_peer.3 index 2c5e6ce7..6b1ef668 100644 --- a/man/SSL_SESSION_get0_peer.3 +++ b/man/SSL_SESSION_get0_peer.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_SESSION_get0_peer.3,v 1.1 2017/04/10 15:37:55 schwarze Exp $ +.\" $OpenBSD: SSL_SESSION_get0_peer.3,v 1.2 2018/03/23 05:50:30 schwarze Exp $ .\" OpenSSL SSL_SESSION_get0_peer.pod b31db505 Mar 24 16:01:50 2017 +0000 .\" .\" This file was written by Matt Caswell @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt SSL_SESSION_GET0_PEER 3 .Os .Sh NAME @@ -74,3 +74,7 @@ has also been called. .Xr ssl 3 , .Xr SSL_get_session 3 , .Xr SSL_SESSION_new 3 +.Sh HISTORY +.Fn SSL_SESSION_get0_peer +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . diff --git a/man/SSL_SESSION_get_compress_id.3 b/man/SSL_SESSION_get_compress_id.3 index 0287f371..aedc216a 100644 --- a/man/SSL_SESSION_get_compress_id.3 +++ b/man/SSL_SESSION_get_compress_id.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_SESSION_get_compress_id.3,v 1.1 2017/04/10 15:37:55 schwarze Exp $ +.\" $OpenBSD: SSL_SESSION_get_compress_id.3,v 1.3 2018/03/23 05:50:30 schwarze Exp $ .\" OpenSSL SSL_SESSION_get_compress_id.pod b31db505 Mar 24 16:01:50 2017 .\" .\" This file was written by Matt Caswell @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt SSL_SESSION_GET_COMPRESS_ID 3 .Os .Sh NAME @@ -69,4 +69,10 @@ which has an id of 1. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_get_session 3 , +.Xr SSL_SESSION_get_id 3 , +.Xr SSL_SESSION_get_protocol_version 3 , .Xr SSL_SESSION_new 3 +.Sh HISTORY +.Fn SSL_SESSION_get_compress_id +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . diff --git a/man/SSL_SESSION_get_ex_new_index.3 b/man/SSL_SESSION_get_ex_new_index.3 index 51cfc505..9fd6949b 100644 --- a/man/SSL_SESSION_get_ex_new_index.3 +++ b/man/SSL_SESSION_get_ex_new_index.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_SESSION_get_ex_new_index.3,v 1.2 2016/12/06 22:41:16 schwarze Exp $ +.\" $OpenBSD: SSL_SESSION_get_ex_new_index.3,v 1.3 2018/03/21 08:06:34 schwarze Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt SSL_SESSION_GET_EX_NEW_INDEX 3 .Os .Sh NAME @@ -125,3 +125,10 @@ and can therefore not be restored. .Xr CRYPTO_set_ex_data 3 , .Xr RSA_get_ex_new_index 3 , .Xr ssl 3 +.Sh HISTORY +.Fn SSL_SESSION_get_ex_new_index , +.Fn SSL_SESSION_set_ex_data , +and +.Fn SSL_SESSION_get_ex_data +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_SESSION_get_id.3 b/man/SSL_SESSION_get_id.3 index 05b1fe53..6d0de1e5 100644 --- a/man/SSL_SESSION_get_id.3 +++ b/man/SSL_SESSION_get_id.3 @@ -1,8 +1,10 @@ -.\" $OpenBSD: SSL_SESSION_get_id.3,v 1.1 2017/04/10 15:37:55 schwarze Exp $ -.\" OpenSSL SSL_SESSION_set1_id.pod b31db505 Mar 24 16:01:50 2017 +0000 +.\" $OpenBSD: SSL_SESSION_get_id.3,v 1.6 2018/03/24 00:55:37 schwarze Exp $ +.\" full merge up to: +.\" OpenSSL SSL_SESSION_set1_id 17b60280 Dec 21 09:08:25 2017 +0100 .\" -.\" This file was written by Matt Caswell -.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved. +.\" This file was written by Remi Gacogne +.\" and Matt Caswell . +.\" Copyright (c) 2016, 2017 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 @@ -48,12 +50,13 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 24 2018 $ .Dt SSL_SESSION_GET_ID 3 .Os .Sh NAME -.Nm SSL_SESSION_get_id -.Nd get the SSL session ID +.Nm SSL_SESSION_get_id , +.Nm SSL_SESSION_set1_id +.Nd get and set the SSL session ID .Sh SYNOPSIS .In openssl/ssl.h .Ft const unsigned char * @@ -61,16 +64,49 @@ .Fa "const SSL_SESSION *s" .Fa "unsigned int *len" .Fc +.Ft int +.Fo SSL_SESSION_set1_id +.Fa "SSL_SESSION *s" +.Fa "const unsigned char *sid" +.Fa "unsigned int sid_len" +.Fc .Sh DESCRIPTION .Fn SSL_SESSION_get_id -returns a pointer to the internal session id value for the session +returns a pointer to the internal session ID value for the session .Fa s . -The length of the id in bytes is stored in +The length of the ID in bytes is stored in .Pf * Fa len . The length may be 0. The caller should not free the returned pointer directly. +.Pp +.Fn SSL_SESSION_set1_id +sets the session ID for +.Fa s +to a copy of the +.Fa sid +of length +.Fa sid_len . +.Sh RETURN VALUES +.Fn SSL_SESSION_get_id +returns a pointer to the session ID value. +.Pp +.Fn SSL_SESSION_set1_id +returns 1 for success and 0 for failure, +for example if the supplied session ID length exceeds +.Dv SSL_MAX_SSL_SESSION_ID_LENGTH . .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_copy_session_id 3 , .Xr SSL_get_session 3 , +.Xr SSL_SESSION_get_compress_id 3 , +.Xr SSL_SESSION_get_protocol_version 3 , +.Xr SSL_SESSION_has_ticket 3 , .Xr SSL_SESSION_new 3 +.Sh HISTORY +.Fn SSL_SESSION_get_id +first appeared in OpenSSL 0.9.8 and has been available since +.Ox 4.5 . +.Pp +.Fn SSL_SESSION_set1_id +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/SSL_SESSION_get_protocol_version.3 b/man/SSL_SESSION_get_protocol_version.3 new file mode 100644 index 00000000..f14c0490 --- /dev/null +++ b/man/SSL_SESSION_get_protocol_version.3 @@ -0,0 +1,84 @@ +.\" $OpenBSD: SSL_SESSION_get_protocol_version.3,v 1.2 2018/03/24 00:55:37 schwarze Exp $ +.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" +.\" This file was written by TJ Saunders +.\" Copyright (c) 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. +.\" +.Dd $Mdocdate: March 24 2018 $ +.Dt SSL_SESSION_GET_PROTOCOL_VERSION 3 +.Os +.Sh NAME +.Nm SSL_SESSION_get_protocol_version +.Nd get the session protocol version +.Sh SYNOPSIS +.In openssl/ssl.h +.Ft int +.Fo SSL_SESSION_get_protocol_version +.Fa "const SSL_SESSION *s" +.Fc +.Sh DESCRIPTION +.Fn SSL_SESSION_get_protocol_version +returns the protocol version number used by the session +.Fa s . +.Sh RETURN VALUES +.Fn SSL_SESSION_get_protocol_version +returns a constant like +.Dv TLS1_VERSION +or +.Dv TLS1_2_VERSION . +.Sh SEE ALSO +.Xr ssl 3 , +.Xr SSL_get_session 3 , +.Xr SSL_SESSION_get0_peer 3 , +.Xr SSL_SESSION_get_compress_id 3 , +.Xr SSL_SESSION_get_id 3 , +.Xr SSL_SESSION_get_time 3 , +.Xr SSL_SESSION_new 3 +.Sh HISTORY +.Fn SSL_SESSION_get_protocol_version +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/SSL_SESSION_get_time.3 b/man/SSL_SESSION_get_time.3 index 387a45f5..fe6f0858 100644 --- a/man/SSL_SESSION_get_time.3 +++ b/man/SSL_SESSION_get_time.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_SESSION_get_time.3,v 1.3 2017/04/10 15:37:55 schwarze Exp $ +.\" $OpenBSD: SSL_SESSION_get_time.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SESSION_GET_TIME 3 .Os .Sh NAME @@ -145,4 +145,21 @@ pointer for the session .Xr SSL_CTX_set_timeout 3 , .Xr SSL_get_default_timeout 3 , .Xr SSL_get_session 3 , +.Xr SSL_SESSION_has_ticket 3 , .Xr SSL_SESSION_new 3 +.Sh HISTORY +.Fn SSL_get_time , +.Fn SSL_get_timeout , +and +.Fn SSL_set_timeout +appeared in SSLeay 0.4 or earlier. +.Fn SSL_set_time +first appeared in SSLeay 0.5.2. +.Fn SSL_SESSION_get_time , +.Fn SSL_SESSION_set_time , +.Fn SSL_SESSION_get_timeout , +and +.Fn SSL_SESSION_set_timeout +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/SSL_SESSION_has_ticket.3 b/man/SSL_SESSION_has_ticket.3 new file mode 100644 index 00000000..322b49fe --- /dev/null +++ b/man/SSL_SESSION_has_ticket.3 @@ -0,0 +1,85 @@ +.\" $OpenBSD: SSL_SESSION_has_ticket.3,v 1.2 2018/03/24 00:55:37 schwarze Exp $ +.\" full merge up to: OpenSSL f2baac27 Feb 8 15:43:16 2015 +0000 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 +.\" +.\" This file was written by Matt Caswell . +.\" Copyright (c) 2015 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. +.\" +.Dd $Mdocdate: March 24 2018 $ +.Dt SSL_SESSION_HAS_TICKET 3 +.Os +.Sh NAME +.Nm SSL_SESSION_has_ticket , +.Nm SSL_SESSION_get_ticket_lifetime_hint +.Nd get details about the ticket associated with a session +.Sh SYNOPSIS +.In openssl/ssl.h +.Ft int +.Fo SSL_SESSION_has_ticket +.Fa "const SSL_SESSION *s" +.Fc +.Ft unsigned long +.Fo SSL_SESSION_get_ticket_lifetime_hint +.Fa "const SSL_SESSION *s" +.Fc +.Sh DESCRIPTION +.Fn SSL_SESSION_has_ticket +returns 1 if there is a Session Ticket associated with +.Fa s +or 0 otherwise. +.Pp +.Fn SSL_SESSION_get_ticket_lifetime_hint +returns the lifetime hint in seconds associated with the session ticket. +.Sh SEE ALSO +.Xr ssl 3 , +.Xr SSL_SESSION_get_id 3 , +.Xr SSL_SESSION_get_time 3 , +.Xr SSL_SESSION_new 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0 +and have been available since +.Ox 6.3 . diff --git a/man/SSL_SESSION_new.3 b/man/SSL_SESSION_new.3 index 54d22b8e..ca269214 100644 --- a/man/SSL_SESSION_new.3 +++ b/man/SSL_SESSION_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_SESSION_new.3,v 1.2 2017/04/10 15:37:55 schwarze Exp $ +.\" $OpenBSD: SSL_SESSION_new.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SESSION_NEW 3 .Os .Sh NAME @@ -63,7 +63,14 @@ returns .Xr SSL_SESSION_get_compress_id 3 , .Xr SSL_SESSION_get_ex_new_index 3 , .Xr SSL_SESSION_get_id 3 , +.Xr SSL_SESSION_get_master_key 3 , +.Xr SSL_SESSION_get_protocol_version 3 , .Xr SSL_SESSION_get_time 3 , +.Xr SSL_SESSION_has_ticket 3 , .Xr SSL_SESSION_print 3 , .Xr SSL_SESSION_set1_id_context 3 , .Xr SSL_set_session 3 +.Sh HISTORY +.Fn SSL_SESSION_new +first appeared in SSLeay 0.5.2 and has been available since +.Ox 2.4 . diff --git a/man/SSL_SESSION_print.3 b/man/SSL_SESSION_print.3 index 015cd02a..f9f22814 100644 --- a/man/SSL_SESSION_print.3 +++ b/man/SSL_SESSION_print.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_SESSION_print.3,v 1.1 2016/12/06 23:45:34 schwarze Exp $ +.\" $OpenBSD: SSL_SESSION_print.3,v 1.3 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SESSION_PRINT 3 .Os .Sh NAME @@ -64,3 +64,10 @@ In some cases, the reason for failure can be determined with .Xr SSL_SESSION_get_ex_new_index 3 , .Xr SSL_SESSION_get_time 3 , .Xr SSL_SESSION_new 3 +.Sh HISTORY +.Fn SSL_SESSION_print +first appeared in SSLeay 0.5.2. +.Fn SSL_SESSION_print_fp +first appeared in SSLeay 0.6.0. +Both functions have been available since +.Ox 2.4 . diff --git a/man/SSL_SESSION_set1_id_context.3 b/man/SSL_SESSION_set1_id_context.3 index f7fa13eb..dd7595ba 100644 --- a/man/SSL_SESSION_set1_id_context.3 +++ b/man/SSL_SESSION_set1_id_context.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: SSL_SESSION_set1_id_context.3,v 1.1 2017/04/10 15:37:55 schwarze Exp $ -.\" OpenSSL SSL_SESSION_get0_id_context.pod b31db505 Mar 24 16:01:50 2017 +.\" $OpenBSD: SSL_SESSION_set1_id_context.3,v 1.4 2018/03/24 00:55:37 schwarze Exp $ +.\" full merge up to: +.\" OpenSSL SSL_SESSION_get0_id_context b31db505 Mar 24 16:01:50 2017 .\" .\" This file was written by Matt Caswell .\" Copyright (c) 2017 The OpenSSL Project. All rights reserved. @@ -48,14 +49,20 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 24 2018 $ .Dt SSL_SESSION_SET1_ID_CONTEXT 3 .Os .Sh NAME +.Nm SSL_SESSION_get0_id_context , .Nm SSL_SESSION_set1_id_context -.Nd set the SSL ID context associated with a session +.Nd get and set the SSL ID context associated with a session .Sh SYNOPSIS .In openssl/ssl.h +.Ft const unsigned char * +.Fo SSL_SESSION_get0_id_context +.Fa "const SSL_SESSION *s" +.Fa "unsigned int *len" +.Fc .Ft int .Fo SSL_SESSION_set1_id_context .Fa "SSL_SESSION *s" @@ -63,6 +70,16 @@ .Fa "unsigned int sid_ctx_len" .Fc .Sh DESCRIPTION +.Fn SSL_SESSION_get0_id_context +returns the ID context associated with +.Fa s . +The length of the ID context in bytes is written to +.Pf * Fa len +if +.Fa len +is not +.Dv NULL . +.Pp .Fn SSL_SESSION_set1_id_context takes a copy of the provided ID context given in .Fa sid_ctx @@ -74,6 +91,11 @@ which must not exceed .Dv SSL_MAX_SID_CTX_LENGTH bytes. .Sh RETURN VALUES +.Fn SSL_SESSION_get0_id_context +returns an internal pointer to an object maintained within +.Fa s +that should not be freed by the caller. +.Pp .Fn SSL_SESSION_set1_id_context returns 1 on success or 0 on error. .Sh SEE ALSO @@ -81,3 +103,11 @@ returns 1 on success or 0 on error. .Xr SSL_CTX_set_session_id_context 3 , .Xr SSL_get_session 3 , .Xr SSL_SESSION_new 3 +.Sh HISTORY +.Fn SSL_SESSION_set1_id_context +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . +.Pp +.Fn SSL_SESSION_get0_id_context +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/SSL_accept.3 b/man/SSL_accept.3 index 98b76458..4d36e536 100644 --- a/man/SSL_accept.3 +++ b/man/SSL_accept.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_accept.3,v 1.3 2016/12/06 12:24:33 schwarze Exp $ +.\" $OpenBSD: SSL_accept.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_ACCEPT 3 .Os .Sh NAME @@ -149,3 +149,7 @@ to find out the reason. .Xr SSL_get_error 3 , .Xr SSL_set_connect_state 3 , .Xr SSL_shutdown 3 +.Sh HISTORY +.Fn SSL_accept +appeared in SSLeay 0.4 or earlier and has been available since +.Ox 2.4 . diff --git a/man/SSL_alert_type_string.3 b/man/SSL_alert_type_string.3 index 0af6bbcb..79cbdaa9 100644 --- a/man/SSL_alert_type_string.3 +++ b/man/SSL_alert_type_string.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_alert_type_string.3,v 1.3 2017/08/11 22:12:40 schwarze Exp $ +.\" $OpenBSD: SSL_alert_type_string.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 11 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_ALERT_TYPE_STRING 3 .Os .Sh NAME @@ -238,3 +238,7 @@ does not contain a correct alert message. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_CTX_set_info_callback 3 +.Sh HISTORY +These functions first appeared in SSLeay 0.8.0 +and have been available since +.Ox 2.4 . diff --git a/man/SSL_clear.3 b/man/SSL_clear.3 index 38194154..1f2f0a5e 100644 --- a/man/SSL_clear.3 +++ b/man/SSL_clear.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_clear.3,v 1.2 2016/12/01 22:45:28 schwarze Exp $ +.\" $OpenBSD: SSL_clear.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 1 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CLEAR 3 .Os .Sh NAME @@ -119,6 +119,10 @@ operation was successful. .Xr SSL_new 3 , .Xr SSL_set_shutdown 3 , .Xr SSL_shutdown 3 +.Sh HISTORY +.Fn SSL_clear +first appeared in SSLeay 0.4.5b and has been available since +.Ox 2.4 . .Sh CAVEATS .Fn SSL_clear resets the diff --git a/man/SSL_connect.3 b/man/SSL_connect.3 index 7fe167dd..d5b962a4 100644 --- a/man/SSL_connect.3 +++ b/man/SSL_connect.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_connect.3,v 1.4 2016/12/16 15:39:08 jmc Exp $ +.\" $OpenBSD: SSL_connect.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 16 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_CONNECT 3 .Os .Sh NAME @@ -148,3 +148,7 @@ to find out the reason. .Xr SSL_get_error 3 , .Xr SSL_set_connect_state 3 , .Xr SSL_shutdown 3 +.Sh HISTORY +.Fn SSL_connect +appeared in SSLeay 0.4 or earlier and has been available since +.Ox 2.4 . diff --git a/man/SSL_copy_session_id.3 b/man/SSL_copy_session_id.3 index 52a5aea3..65483799 100644 --- a/man/SSL_copy_session_id.3 +++ b/man/SSL_copy_session_id.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_copy_session_id.3,v 1.2 2017/04/10 15:37:55 schwarze Exp $ +.\" $OpenBSD: SSL_copy_session_id.3,v 1.6 2018/08/24 21:29:51 jmc Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: August 24 2018 $ .Dt SSL_COPY_SESSION_ID 3 .Os .Sh NAME @@ -22,7 +22,7 @@ .Nd copy session details between SSL objects .Sh SYNOPSIS .In openssl/ssl.h -.Ft void +.Ft int .Fo SSL_copy_session_id .Fa "SSL *to" .Fa "const SSL *from" @@ -55,6 +55,9 @@ This function is used internally by .Xr SSL_dup 3 and by .Xr BIO_ssl_copy_session_id 3 . +.Sh RETURN VALUES +.Fn SSL_copy_session_id +returns 1 on success and 0 on error. .Sh SEE ALSO .Xr BIO_ssl_copy_session_id 3 , .Xr SSL_dup 3 , @@ -65,14 +68,11 @@ and by .Xr SSL_set_session_id_context 3 .Sh HISTORY .Fn SSL_copy_session_id -is available in all versions of OpenSSL. +appeared in SSLeay 0.4 or earlier and has been available since +.Ox 2.4 . .Sh BUGS Failures of -.Xr SSL_set_session 3 , -.Xr SSL_set_session_id_context 3 , -.Xr CRYPTO_add 3 , -and reinitialization of protocol-specific data are silently ignored -and may leave +.Xr CRYPTO_add 3 +are silently ignored and may leave .Fa to in an invalid or inconsistent state. -An improved version reporting failure is available in OpenSSL 1.1.0. diff --git a/man/SSL_do_handshake.3 b/man/SSL_do_handshake.3 index df220595..e9327b42 100644 --- a/man/SSL_do_handshake.3 +++ b/man/SSL_do_handshake.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_do_handshake.3,v 1.4 2016/12/16 15:39:08 jmc Exp $ +.\" $OpenBSD: SSL_do_handshake.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Martin Sjoegren . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 16 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_DO_HANDSHAKE 3 .Os .Sh NAME @@ -146,3 +146,7 @@ to find out the reason. .Xr SSL_connect 3 , .Xr SSL_get_error 3 , .Xr SSL_set_connect_state 3 +.Sh HISTORY +.Fn SSL_do_handshake +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . diff --git a/man/SSL_dup.3 b/man/SSL_dup.3 index 47ec2e39..a752af13 100644 --- a/man/SSL_dup.3 +++ b/man/SSL_dup.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_dup.3,v 1.1 2016/12/07 17:09:07 schwarze Exp $ +.\" $OpenBSD: SSL_dup.3,v 1.3 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 7 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_DUP 3 .Os .Sh NAME @@ -56,4 +56,5 @@ on failure. .Xr SSL_new 3 .Sh HISTORY .Fn SSL_dup -is available in all versions of OpenSSL. +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . diff --git a/man/SSL_dup_CA_list.3 b/man/SSL_dup_CA_list.3 index d6f1add6..2c325084 100644 --- a/man/SSL_dup_CA_list.3 +++ b/man/SSL_dup_CA_list.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_dup_CA_list.3,v 1.2 2016/12/14 16:20:28 schwarze Exp $ +.\" $OpenBSD: SSL_dup_CA_list.3,v 1.5 2018/04/25 13:51:34 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 14 2016 $ +.Dd $Mdocdate: April 25 2018 $ .Dt SSL_DUP_CA_LIST 3 .Os .Sh NAME @@ -24,7 +24,7 @@ .Sh SYNOPSIS .Ft STACK_OF(X509_NAME) * .Fo SSL_dup_CA_list -.Fa "STACK_OF(X509_NAME) *sk" +.Fa "const STACK_OF(X509_NAME) *sk" .Fc .Sh DESCRIPTION .Fn SSL_dup_CA_list @@ -49,4 +49,5 @@ on failure. .Xr X509_NAME_new 3 .Sh HISTORY .Fn SSL_dup_CA_list -is available in all versions of OpenSSL. +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . diff --git a/man/SSL_export_keying_material.3 b/man/SSL_export_keying_material.3 index 613446a2..fe1ed748 100644 --- a/man/SSL_export_keying_material.3 +++ b/man/SSL_export_keying_material.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_export_keying_material.3,v 1.1 2017/08/21 10:10:25 schwarze Exp $ +.\" $OpenBSD: SSL_export_keying_material.3,v 1.2 2018/03/23 05:50:30 schwarze Exp $ .\" OpenSSL a599574b Jun 28 17:18:27 2017 +0100 .\" OpenSSL 23cec1f4 Jun 21 13:55:02 2017 +0100 .\" @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 21 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt SSL_EXPORT_KEYING_MATERIAL 3 .Os .Sh NAME @@ -125,3 +125,7 @@ standard to be used without registration. .Sh RETURN VALUES .Fn SSL_export_keying_material returns 1 on success or 0 or -1 on failure. +.Sh HISTORY +.Fn SSL_export_keying_material +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . diff --git a/man/SSL_free.3 b/man/SSL_free.3 index 96e0acb6..38694a06 100644 --- a/man/SSL_free.3 +++ b/man/SSL_free.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_free.3,v 1.2 2016/12/01 22:46:21 schwarze Exp $ +.\" $OpenBSD: SSL_free.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 1 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_FREE 3 .Os .Sh NAME @@ -112,3 +112,7 @@ does not provide diagnostic information. .Xr SSL_new 3 , .Xr SSL_set_shutdown 3 , .Xr SSL_shutdown 3 +.Sh HISTORY +.Fn SSL_free +appeared in SSLeay 0.4 or earlier and has been available since +.Ox 2.4 . diff --git a/man/SSL_get_SSL_CTX.3 b/man/SSL_get_SSL_CTX.3 index 7f68128f..60fda555 100644 --- a/man/SSL_get_SSL_CTX.3 +++ b/man/SSL_get_SSL_CTX.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_SSL_CTX.3,v 1.2 2016/12/03 08:54:21 schwarze Exp $ +.\" $OpenBSD: SSL_get_SSL_CTX.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 3 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_SSL_CTX 3 .Os .Sh NAME @@ -73,3 +73,7 @@ object is returned. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_new 3 +.Sh HISTORY +.Fn SSL_get_SSL_CTX +first appeared in SSLeay 0.5.1 and has been available since +.Ox 2.4 . diff --git a/man/SSL_get_certificate.3 b/man/SSL_get_certificate.3 index 35650c75..e3730c21 100644 --- a/man/SSL_get_certificate.3 +++ b/man/SSL_get_certificate.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_certificate.3,v 1.1 2016/12/10 13:54:32 schwarze Exp $ +.\" $OpenBSD: SSL_get_certificate.3,v 1.4 2018/04/25 13:51:34 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: April 25 2018 $ .Dt SSL_GET_CERTIFICATE 3 .Os .Sh NAME @@ -29,7 +29,7 @@ .Fc .Ft EVP_PKEY * .Fo SSL_get_privatekey -.Fa "SSL *ssl" +.Fa "const SSL *ssl" .Fc .Sh DESCRIPTION These functions retrieve certificate and key data from an @@ -56,6 +56,8 @@ if none is active. .Xr SSL_use_certificate 3 .Sh HISTORY .Fn SSL_get_certificate -and +first appeared in SSLeay 0.5.2a. .Fn SSL_get_privatekey -are available in all versions of OpenSSL. +first appeared in SSLeay 0.8.0. +Both functions have been available since +.Ox 2.4 . diff --git a/man/SSL_get_ciphers.3 b/man/SSL_get_ciphers.3 index 4c3bbc45..07361da4 100644 --- a/man/SSL_get_ciphers.3 +++ b/man/SSL_get_ciphers.3 @@ -1,8 +1,11 @@ -.\" $OpenBSD: SSL_get_ciphers.3,v 1.2 2016/12/03 09:00:46 schwarze Exp $ -.\" OpenSSL c3e64028 Mar 30 11:50:14 2005 +0000 +.\" $OpenBSD: SSL_get_ciphers.3,v 1.7 2019/01/22 01:18:24 tb Exp $ +.\" full merge up to: OpenSSL c3e64028 Mar 30 11:50:14 2005 +0000 +.\" selective merge up to: OpenSSL 83cf7abf May 29 13:07:08 2018 +0100 .\" -.\" This file was written by Lutz Jaenicke . -.\" Copyright (c) 2000, 2005, 2015 The OpenSSL Project. All rights reserved. +.\" This file was written by Lutz Jaenicke , +.\" Nick Mathewson , and Kazuki Yamaguchi . +.\" Copyright (c) 2000, 2005, 2015, 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 @@ -48,17 +51,26 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 3 2016 $ +.Dd $Mdocdate: January 22 2019 $ .Dt SSL_GET_CIPHERS 3 .Os .Sh NAME .Nm SSL_get_ciphers , +.Nm SSL_CTX_get_ciphers , +.Nm SSL_get1_supported_ciphers , +.Nm SSL_get_client_ciphers , .Nm SSL_get_cipher_list .Nd get list of available SSL_CIPHERs .Sh SYNOPSIS .In openssl/ssl.h .Ft STACK_OF(SSL_CIPHER) * .Fn SSL_get_ciphers "const SSL *ssl" +.Ft STACK_OF(SSL_CIPHER) * +.Fn SSL_CTX_get_ciphers "const SSL_CTX *ctx" +.Ft STACK_OF(SSL_CIPHER) * +.Fn SSL_get1_supported_ciphers "SSL *ssl" +.Ft STACK_OF(SSL_CIPHER) * +.Fn SSL_get_client_ciphers "const SSL *ssl" .Ft const char * .Fn SSL_get_cipher_list "const SSL *ssl" "int priority" .Sh DESCRIPTION @@ -76,15 +88,69 @@ or no ciphers are available, .Dv NULL is returned. .Pp -.Fn SSL_get_ciphers -returns a pointer to an internal cipher stack, which will be freed +.Fn SSL_CTX_get_ciphers +returns the stack of available +.Vt SSL_CIPHER Ns s +for +.Fa ctx . +.Pp +.Fn SSL_get1_supported_ciphers +returns the stack of enabled +.Vt SSL_CIPHER Ns s +for +.Fa ssl +as it would be sent in a ClientHello, sorted by preference. +The list depends on settings like the cipher list, the supported +protocol versions, the security level, and the enabled signature +algorithms. +The list of ciphers that would be sent in a ClientHello can differ +from the list of ciphers that would be acceptable when acting as a +server. +For example, +additional ciphers may be usable by a server if there is a gap in the +list of supported protocols, and some ciphers may not be usable by a +server if there is not a suitable certificate configured. +If +.Fa ssl +is +.Dv NULL +or no ciphers are available, +.Dv NULL +is returned. +.Pp +.Fn SSL_get_client_ciphers +returns the stack of available +.Vt SSL_CIPHER Ns s +matching the list received from the client on +.Fa ssl . +If +.Fa ssl +is +.Dv NULL , +no ciphers are available, or +.Fa ssl +is not operating in server mode, +.Dv NULL +is returned. +.Pp +.Fn SSL_get_ciphers , +.Fn SSL_CTX_get_ciphers , +and +.Fn SSL_get_client_ciphers +return pointers to internal cipher stacks, which will be freed later on when the .Vt SSL +or +.Vt SSL_CTX object is freed. Therefore, the calling code must not free the return value itself. .Pp The details of the ciphers obtained by -.Fn SSL_get_ciphers +.Fn SSL_get_ciphers , +.Fn SSL_CTX_get_ciphers , +.Fn SSL_get1_supported_ciphers , +and +.Fn SSL_get_client_ciphers can be obtained using the .Xr SSL_CIPHER_get_name 3 family of functions. @@ -117,3 +183,20 @@ is returned. .Xr ssl 3 , .Xr SSL_CIPHER_get_name 3 , .Xr SSL_CTX_set_cipher_list 3 +.Sh HISTORY +.Fn SSL_get_cipher_list +first appeared in SSLeay 0.5.2. +.Fn SSL_get_ciphers +first appeared in SSLeay 0.8.0. +Both functions have been available since +.Ox 2.4 . +.Pp +.Fn SSL_CTX_get_ciphers +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . +.Pp +.Fn SSL_get1_supported_ciphers +and +.Fn SSL_get_client_ciphers +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.5 . diff --git a/man/SSL_get_client_CA_list.3 b/man/SSL_get_client_CA_list.3 index 66d6cf59..e80e5cb6 100644 --- a/man/SSL_get_client_CA_list.3 +++ b/man/SSL_get_client_CA_list.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_client_CA_list.3,v 1.3 2016/12/14 16:20:28 schwarze Exp $ +.\" $OpenBSD: SSL_get_client_CA_list.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 14 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_CLIENT_CA_LIST 3 .Os .Sh NAME @@ -88,3 +88,9 @@ returns the list of client CAs sent from the server, if any. .Xr SSL_CTX_set_client_CA_list 3 , .Xr SSL_CTX_set_client_cert_cb 3 , .Xr X509_NAME_new 3 +.Sh HISTORY +.Fn SSL_get_client_CA_list +and +.Fn SSL_CTX_get_client_CA_list +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_get_client_random.3 b/man/SSL_get_client_random.3 new file mode 100644 index 00000000..eda74db3 --- /dev/null +++ b/man/SSL_get_client_random.3 @@ -0,0 +1,150 @@ +.\" $OpenBSD: SSL_get_client_random.3,v 1.2 2018/03/24 00:55:37 schwarze Exp $ +.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 +.\" +.\" This file was written by Nick Mathewson +.\" Copyright (c) 2015 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. +.\" +.Dd $Mdocdate: March 24 2018 $ +.Dt SSL_GET_CLIENT_RANDOM 3 +.Os +.Sh NAME +.Nm SSL_get_client_random , +.Nm SSL_get_server_random , +.Nm SSL_SESSION_get_master_key +.Nd get internal TLS handshake random values and master key +.Sh SYNOPSIS +.In openssl/ssl.h +.Ft size_t +.Fo SSL_get_client_random +.Fa "const SSL *ssl" +.Fa "unsigned char *out" +.Fa "size_t outlen" +.Fc +.Ft size_t +.Fo SSL_get_server_random +.Fa "const SSL *ssl" +.Fa "unsigned char *out" +.Fa "size_t outlen" +.Fc +.Ft size_t +.Fo SSL_SESSION_get_master_key +.Fa "const SSL_SESSION *session" +.Fa "unsigned char *out" +.Fa "size_t outlen" +.Fc +.Sh DESCRIPTION +.Fn SSL_get_client_random +extracts the random value that was sent from the client to the server +during the initial TLS handshake. +It copies at most +.Fa outlen +bytes of this value into the buffer +.Fa out . +If +.Fa outlen +is zero, nothing is copied. +.Pp +.Fn SSL_get_server_random +behaves the same, but extracts the random value that was sent +from the server to the client during the initial TLS handshake. +.Pp +.Fn SSL_SESSION_get_master_key +behaves the same, but extracts the master secret used to guarantee the +security of the TLS session. +The security of the TLS session depends on keeping the master key +secret: do not expose it, or any information about it, to anybody. +To calculate another secret value that depends on the master secret, +use +.Xr SSL_export_keying_material 3 +instead. +.Pp +All these functions expose internal values from the TLS handshake, +for use in low-level protocols. +Avoid using them unless implementing a feature +that requires access to the internal protocol details. +.Pp +Despite the names of +.Fn SSL_get_client_random +and +.Fn SSL_get_server_random , +they are not random number generators. +Instead, they return the mostly-random values that were already +generated and used in the TLS protocol. +.Pp +In current versions of the TLS protocols, +the length of client_random and server_random is always +.Dv SSL3_RANDOM_SIZE +bytes. +Support for other +.Fa outlen +arguments is provided for the unlikely event that a future +version or variant of TLS uses some other length. +.Pp +Finally, though the client_random and server_random values are called +.Dq random , +many TLS implementations generate four bytes of those values +based on their view of the current time. +.Sh RETURN VALUES +If +.Fa outlen +is greater than 0, these functions return the number of bytes +actually copied, which is less than or equal to +.Fa outlen . +If +.Fa outlen +is 0, these functions return the maximum number of bytes they would +copy \(em that is, the length of the underlying field. +.Sh SEE ALSO +.Xr ssl 3 , +.Xr SSL_export_keying_material 3 , +.Xr SSL_SESSION_get_id 3 , +.Xr SSL_SESSION_get_time 3 , +.Xr SSL_SESSION_new 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0 +and have been available since +.Ox 6.3 . diff --git a/man/SSL_get_current_cipher.3 b/man/SSL_get_current_cipher.3 index e61ea228..6b951d03 100644 --- a/man/SSL_get_current_cipher.3 +++ b/man/SSL_get_current_cipher.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_current_cipher.3,v 1.2 2016/12/03 09:07:56 schwarze Exp $ +.\" $OpenBSD: SSL_get_current_cipher.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 3 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_CURRENT_CIPHER 3 .Os .Sh NAME @@ -107,3 +107,16 @@ if no session has been established. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_CIPHER_get_name 3 +.Sh HISTORY +.Fn SSL_get_cipher +appeared in SSLeay 0.4 or earlier. +.Fn SSL_get_cipher_bits +first appeared in SSLeay 0.6.4. +.Fn SSL_get_cipher_name +and +.Fn SSL_get_cipher_version +first appeared in SSLeay 0.8.0. +.Fn SSL_get_current_cipher +first appeared in SSLeay 0.8.1. +These functions have been available since +.Ox 2.4 . diff --git a/man/SSL_get_default_timeout.3 b/man/SSL_get_default_timeout.3 index f9ce7f33..47737d8e 100644 --- a/man/SSL_get_default_timeout.3 +++ b/man/SSL_get_default_timeout.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_default_timeout.3,v 1.2 2016/12/03 09:10:29 schwarze Exp $ +.\" $OpenBSD: SSL_get_default_timeout.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 3 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_DEFAULT_TIMEOUT 3 .Os .Sh NAME @@ -79,3 +79,7 @@ protocols (SSLv2, SSLv3, and TLSv1). .Xr SSL_CTX_flush_sessions 3 , .Xr SSL_CTX_set_session_cache_mode 3 , .Xr SSL_SESSION_get_time 3 +.Sh HISTORY +.Fn SSL_get_default_timeout +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . diff --git a/man/SSL_get_error.3 b/man/SSL_get_error.3 index 49967440..5d325b3f 100644 --- a/man/SSL_get_error.3 +++ b/man/SSL_get_error.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_error.3,v 1.2 2016/12/03 08:54:21 schwarze Exp $ +.\" $OpenBSD: SSL_get_error.3,v 1.5 2018/04/29 07:37:01 guenther Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file was written by Bodo Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 3 2016 $ +.Dd $Mdocdate: April 29 2018 $ .Dt SSL_GET_ERROR 3 .Os .Sh NAME @@ -98,7 +98,7 @@ The following return values can currently occur: The TLS/SSL I/O operation completed. This result code is returned if and only if .Fa ret -< 0. +> 0. .It Dv SSL_ERROR_ZERO_RETURN The TLS/SSL connection has been closed. If the protocol version is SSL 3.0 or TLS 1.0, this result code is returned @@ -213,4 +213,5 @@ The OpenSSL error queue contains more information on the error. .Xr ssl 3 .Sh HISTORY .Fn SSL_get_error -was added in SSLeay 0.8. +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 b/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 index fce58442..632ee01c 100644 --- a/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 +++ b/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_ex_data_X509_STORE_CTX_idx.3,v 1.2 2016/12/06 22:41:16 schwarze Exp $ +.\" $OpenBSD: SSL_get_ex_data_X509_STORE_CTX_idx.3,v 1.3 2018/03/21 09:05:04 schwarze Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt SSL_GET_EX_DATA_X509_STORE_CTX_IDX 3 .Os .Sh NAME @@ -110,3 +110,7 @@ Please check the example in .Xr CRYPTO_set_ex_data 3 , .Xr ssl 3 , .Xr SSL_CTX_set_verify 3 +.Sh HISTORY +.Fn SSL_get_ex_data_X509_STORE_CTX_idx +first appeared in SSLeay 0.9.1 and has been available since +.Ox 2.6 . diff --git a/man/SSL_get_ex_new_index.3 b/man/SSL_get_ex_new_index.3 index 070baa5a..cecd25fa 100644 --- a/man/SSL_get_ex_new_index.3 +++ b/man/SSL_get_ex_new_index.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_ex_new_index.3,v 1.2 2016/12/06 22:41:16 schwarze Exp $ +.\" $OpenBSD: SSL_get_ex_new_index.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_EX_NEW_INDEX 3 .Os .Sh NAME @@ -121,3 +121,16 @@ in .Xr RSA_get_ex_new_index 3 , .Xr ssl 3 , .Xr SSL_CTX_set_verify 3 +.Sh HISTORY +Precursor functions +.Fn SSL_set_app_data +and +.Fn SSL_get_app_data +first appeared in SSLeay 0.6.1. +.Pp +.Fn SSL_get_ex_new_index , +.Fn SSL_set_ex_data , +and +.Fn SSL_get_ex_data +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_get_fd.3 b/man/SSL_get_fd.3 index c5596c28..1e093424 100644 --- a/man/SSL_get_fd.3 +++ b/man/SSL_get_fd.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_fd.3,v 1.3 2016/12/06 12:24:33 schwarze Exp $ +.\" $OpenBSD: SSL_get_fd.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_FD 3 .Os .Sh NAME @@ -91,3 +91,13 @@ The file descriptor linked to .Xr BIO_new 3 , .Xr ssl 3 , .Xr SSL_set_fd 3 +.Sh HISTORY +.Fn SSL_get_fd +appeared in SSLeay 0.4 or earlier and has been available since +.Ox 2.4 . +.Pp +.Fn SSL_get_rfd +and +.Fn SSL_get_wfd +first appeared in OpenSSL 0.9.6c and have been available since +.Ox 3.2 . diff --git a/man/SSL_get_peer_cert_chain.3 b/man/SSL_get_peer_cert_chain.3 index b438f45d..eb2ae53d 100644 --- a/man/SSL_get_peer_cert_chain.3 +++ b/man/SSL_get_peer_cert_chain.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_peer_cert_chain.3,v 1.3 2017/03/28 18:21:55 schwarze Exp $ +.\" $OpenBSD: SSL_get_peer_cert_chain.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL SSL_get_peer_cert_chain.pod 1f164c6f Jan 18 01:40:36 2017 +0100 .\" OpenSSL SSL_get_peer_cert_chain.pod 9b86974e Aug 17 15:21:33 2015 -0400 .\" @@ -50,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 28 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_PEER_CERT_CHAIN 3 .Os .Sh NAME @@ -101,3 +101,7 @@ The return value points to the certificate chain presented by the peer. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_get_peer_certificate 3 +.Sh HISTORY +.Fn SSL_get_peer_cert_chain +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . diff --git a/man/SSL_get_peer_certificate.3 b/man/SSL_get_peer_certificate.3 index 8a6e32ec..5e7247f4 100644 --- a/man/SSL_get_peer_certificate.3 +++ b/man/SSL_get_peer_certificate.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_peer_certificate.3,v 1.2 2016/12/03 08:54:21 schwarze Exp $ +.\" $OpenBSD: SSL_get_peer_certificate.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 3 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_PEER_CERTIFICATE 3 .Os .Sh NAME @@ -98,3 +98,7 @@ The return value points to the certificate presented by the peer. .Xr ssl 3 , .Xr SSL_CTX_set_verify 3 , .Xr SSL_get_verify_result 3 +.Sh HISTORY +.Fn SSL_get_peer_certificate +appeared in SSLeay 0.4 or earlier and has been available since +.Ox 2.4 . diff --git a/man/SSL_get_rbio.3 b/man/SSL_get_rbio.3 index 9c8cd972..38096fbe 100644 --- a/man/SSL_get_rbio.3 +++ b/man/SSL_get_rbio.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_rbio.3,v 1.3 2016/12/06 12:24:33 schwarze Exp $ +.\" $OpenBSD: SSL_get_rbio.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_RBIO 3 .Os .Sh NAME @@ -90,3 +90,9 @@ linked to .Xr BIO_new 3 , .Xr ssl 3 , .Xr SSL_set_bio 3 +.Sh HISTORY +.Fn SSL_get_rbio +and +.Fn SSL_get_wbio +first appeared in SSLeay 0.6.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_get_server_tmp_key.3 b/man/SSL_get_server_tmp_key.3 index 66e362f6..6bd102e8 100644 --- a/man/SSL_get_server_tmp_key.3 +++ b/man/SSL_get_server_tmp_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_server_tmp_key.3,v 1.1 2017/04/10 15:54:46 schwarze Exp $ +.\" $OpenBSD: SSL_get_server_tmp_key.3,v 1.3 2018/03/24 00:55:37 schwarze Exp $ .\" OpenSSL SSL_get_server_tmp_key.pod 508fafd8 Apr 3 15:41:21 2017 +0100 .\" .\" This file was written by Matt Caswell @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 24 2018 $ .Dt SSL_GET_SERVER_TMP_KEY 3 .Os .Sh NAME @@ -82,3 +82,7 @@ returns 1 on success or 0 on failure. .Sh SEE ALSO .Xr EVP_PKEY_free 3 , .Xr SSL_ctrl 3 +.Sh HISTORY +.Fn SSL_get_server_tmp_key +first appeared in OpenSSL 1.0.2 and has been available since +.Ox 6.1 . diff --git a/man/SSL_get_session.3 b/man/SSL_get_session.3 index 8a1efa67..4cde129b 100644 --- a/man/SSL_get_session.3 +++ b/man/SSL_get_session.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_session.3,v 1.3 2017/04/10 15:37:55 schwarze Exp $ +.\" $OpenBSD: SSL_get_session.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_SESSION 3 .Os .Sh NAME @@ -146,6 +146,18 @@ session. .Xr SSL_SESSION_get0_peer 3 , .Xr SSL_SESSION_get_compress_id 3 , .Xr SSL_SESSION_get_id 3 , +.Xr SSL_SESSION_get_protocol_version 3 , .Xr SSL_SESSION_get_time 3 , .Xr SSL_SESSION_new 3 , -.Xr SSL_SESSION_print 3 +.Xr SSL_SESSION_print 3 , +.Xr SSL_set_session 3 +.Sh HISTORY +.Fn SSL_get_session +first appeared in SSLeay 0.5.2 and has been available since +.Ox 2.4 . +.Pp +.Fn SSL_get0_session +and +.Fn SSL_get1_session +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/SSL_get_shared_ciphers.3 b/man/SSL_get_shared_ciphers.3 index 915ad682..45228921 100644 --- a/man/SSL_get_shared_ciphers.3 +++ b/man/SSL_get_shared_ciphers.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_shared_ciphers.3,v 1.1 2016/12/10 14:56:56 schwarze Exp $ +.\" $OpenBSD: SSL_get_shared_ciphers.3,v 1.3 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_SHARED_CIPHERS 3 .Os .Sh NAME @@ -55,7 +55,8 @@ Otherwise, it returns .Fa buf . .Sh HISTORY .Fn SSL_get_shared_ciphers -is available in all versions of OpenSSL. +first appeared in SSLeay 0.4.5b and has been available since +.Ox 2.4 . .Sh BUGS If the list is too long to fit into .Fa len diff --git a/man/SSL_get_state.3 b/man/SSL_get_state.3 index d835b522..d284691a 100644 --- a/man/SSL_get_state.3 +++ b/man/SSL_get_state.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_state.3,v 1.1 2016/12/10 13:54:32 schwarze Exp $ +.\" $OpenBSD: SSL_get_state.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_STATE 3 .Os .Sh NAME @@ -143,4 +143,18 @@ All these functions may be implemented as macros. .Xr SSL_renegotiate 3 , .Xr SSL_set_connect_state 3 .Sh HISTORY -These functions are available in all versions of OpenSSL. +.Fn SSL_is_init_finished +first appeared in SSLeay 0.4.5b. +.Fn SSL_state +first appeared in SSLeay 0.5.2. +.Fn SSL_in_accept_init , +.Fn SSL_in_connect_init , +and +.Fn SSL_in_init +first appeared in SSLeay 0.6.0. +.Fn SSL_in_before +first appeared in SSLeay 0.8.0. +.Fn SSL_get_state +first appeared in SSLeay 0.9.0. +All these functions have been available since +.Ox 2.4 . diff --git a/man/SSL_get_verify_result.3 b/man/SSL_get_verify_result.3 index 78bf636a..ec4df2d3 100644 --- a/man/SSL_get_verify_result.3 +++ b/man/SSL_get_verify_result.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_get_verify_result.3,v 1.2 2016/12/03 08:54:21 schwarze Exp $ +.\" $OpenBSD: SSL_get_verify_result.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 3 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_GET_VERIFY_RESULT 3 .Os .Sh NAME @@ -86,6 +86,10 @@ Documented in .Xr ssl 3 , .Xr SSL_get_peer_certificate 3 , .Xr SSL_set_verify_result 3 +.Sh HISTORY +.Fn SSL_get_verify_result +first appeared in SSLeay 0.6.1 and has been available since +.Ox 2.4 . .Sh BUGS If no peer certificate was presented, the returned result code is .Dv X509_V_OK . diff --git a/man/SSL_get_version.3 b/man/SSL_get_version.3 index fe18fbf6..cc4297c5 100644 --- a/man/SSL_get_version.3 +++ b/man/SSL_get_version.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: SSL_get_version.3,v 1.3 2016/12/10 13:12:08 schwarze Exp $ -.\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 +.\" $OpenBSD: SSL_get_version.3,v 1.7 2019/03/18 18:31:15 schwarze Exp $ +.\" full merge up to: OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 +.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 .\" .\" This file was written by Lutz Jaenicke . .\" Copyright (c) 2001, 2005, 2014 The OpenSSL Project. All rights reserved. @@ -48,12 +49,18 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 18 2019 $ .Dt SSL_GET_VERSION 3 .Os .Sh NAME .Nm SSL_get_version , .Nm SSL_version +.\" The following are intentionally undocumented because +.\" - the longer term plan is to remove them +.\" - nothing appears to be using them in the wild +.\" - and they have the wrong namespace prefix +.\" Nm TLS1_get_version +.\" Nm TLS1_get_client_version .Nd get the protocol version of a connection .Sh SYNOPSIS .In openssl/ssl.h @@ -68,6 +75,9 @@ returns the name of the protocol used for the connection .Pp .Fn SSL_version returns an integer constant representing that protocol. +.Pp +These functions only return reliable results +after the initial handshake has been completed. .Sh RETURN VALUES The following strings or integers can be returned: .Bl -tag -width Ds @@ -77,10 +87,13 @@ The connection uses the TLSv1.0 protocol. The connection uses the TLSv1.1 protocol. .It Qo TLSv1.2 Qc No or Dv TLS1_2_VERSION The connection uses the TLSv1.2 protocol. +.It Qo TLSv1.3 Qc No or Dv TLS1_3_VERSION +The connection uses the TLSv1.3 protocol. .It Qo DTLSv1 Qc No or Dv DTLS1_VERSION The connection uses the Datagram Transport Layer Security 1.0 protocol. .It Qq unknown -This indicates that no version has been set (no connection established). +This indicates an unknown protocol version; +it cannot currently happen with LibreSSL. .El .Sh SEE ALSO .Xr ssl 3 @@ -88,4 +101,5 @@ This indicates that no version has been set (no connection established). .Fn SSL_get_version and .Fn SSL_version -are available in all versions of OpenSSL. +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_library_init.3 b/man/SSL_library_init.3 index 397c19ac..42f19adc 100644 --- a/man/SSL_library_init.3 +++ b/man/SSL_library_init.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_library_init.3,v 1.2 2016/12/04 12:13:43 schwarze Exp $ +.\" $OpenBSD: SSL_library_init.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 4 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_LIBRARY_INIT 3 .Os .Sh NAME @@ -96,3 +96,15 @@ SSL_library_init(); /* initialize library */ .Xr RAND_add 3 , .Xr ssl 3 , .Xr SSL_load_error_strings 3 +.Sh HISTORY +.Fn SSLeay_add_ssl_algorithms +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . +.Pp +.Fn SSL_library_init +first appeared in OpenSSL 0.9.2b and has been available since +.Ox 2.6 . +.Pp +.Fn OpenSSL_add_ssl_algorithms +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . diff --git a/man/SSL_load_client_CA_file.3 b/man/SSL_load_client_CA_file.3 index ed4a21ef..e893d63e 100644 --- a/man/SSL_load_client_CA_file.3 +++ b/man/SSL_load_client_CA_file.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_load_client_CA_file.3,v 1.5 2016/12/16 15:39:08 jmc Exp $ +.\" $OpenBSD: SSL_load_client_CA_file.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 16 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_LOAD_CLIENT_CA_FILE 3 .Os .Sh NAME @@ -145,10 +145,15 @@ else .Xr X509_get_subject_name 3 , .Xr X509_NAME_new 3 .Sh HISTORY +.Fn SSL_load_client_CA_file +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . +.Pp .Fn SSL_add_file_cert_subjects_to_stack and .Fn SSL_add_dir_cert_subjects_to_stack -first appeared in OpenSSL 0.9.2b. +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . .Sh AUTHORS .Fn SSL_add_file_cert_subjects_to_stack and diff --git a/man/SSL_new.3 b/man/SSL_new.3 index cfe8b336..f84eed7d 100644 --- a/man/SSL_new.3 +++ b/man/SSL_new.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: SSL_new.3,v 1.2 2016/12/04 12:22:48 schwarze Exp $ -.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" $OpenBSD: SSL_new.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL 1c7ae3dd Mar 29 19:17:55 2017 +1000 .\" -.\" This file was written by Lutz Jaenicke . -.\" Copyright (c) 2000, 2001 The OpenSSL Project. All rights reserved. +.\" This file was written by Richard Levitte +.\" and Matt Caswell . +.\" Copyright (c) 2000, 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 @@ -48,16 +49,19 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 4 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_NEW 3 .Os .Sh NAME -.Nm SSL_new +.Nm SSL_new , +.Nm SSL_up_ref .Nd create a new SSL structure for a connection .Sh SYNOPSIS .In openssl/ssl.h .Ft SSL * .Fn SSL_new "SSL_CTX *ctx" +.Ft int +.Fn SSL_up_ref "SSL *ssl" .Sh DESCRIPTION .Fn SSL_new creates a new @@ -67,6 +71,12 @@ The new structure inherits the settings of the underlying context .Fa ctx : connection method, options, verification settings, timeout settings. +The reference count of the new structure is set to 1. +.Pp +.Fn SSL_up_ref +increments the reference count of +.Fa ssl +by 1. .Sh RETURN VALUES The following return values can occur: .Bl -tag -width Ds @@ -80,9 +90,20 @@ The return value points to an allocated .Vt SSL structure. .El +.Pp +.Fn SSL_up_ref +returns 1 for success or 0 for failure. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_clear 3 , .Xr SSL_CTX_set_options 3 , .Xr SSL_free 3 , .Xr SSL_get_SSL_CTX 3 +.Sh HISTORY +.Fn SSL_new +appeared in SSLeay 0.4 or earlier and has been available since +.Ox 2.4 . +.Pp +.Fn SSL_up_ref +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/SSL_num_renegotiations.3 b/man/SSL_num_renegotiations.3 index 7b380d93..7a864187 100644 --- a/man/SSL_num_renegotiations.3 +++ b/man/SSL_num_renegotiations.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_num_renegotiations.3,v 1.3 2017/07/05 11:43:09 schwarze Exp $ +.\" $OpenBSD: SSL_num_renegotiations.3,v 1.4 2018/03/21 08:06:34 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 5 2017 $ +.Dd $Mdocdate: March 21 2018 $ .Dt SSL_NUM_RENEGOTIATIONS 3 .Os .Sh NAME @@ -69,4 +69,6 @@ All these functions return a number of renegotiations. .Xr SSL_renegotiate 3 , .Xr SSL_write 3 .Sh HISTORY -These functions are available in all versions of OpenSSL. +These functions first appeared in SSLeay 0.9.0 +and have been available since +.Ox 2.4 . diff --git a/man/SSL_pending.3 b/man/SSL_pending.3 index 1f8493b8..b3efa426 100644 --- a/man/SSL_pending.3 +++ b/man/SSL_pending.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_pending.3,v 1.2 2016/12/04 12:26:05 schwarze Exp $ +.\" $OpenBSD: SSL_pending.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file was written by Lutz Jaenicke , @@ -50,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 4 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_PENDING 3 .Os .Sh NAME @@ -99,6 +99,10 @@ bytes that are pending and are available for immediate read. .Xr ssl 3 , .Xr SSL_CTX_set_read_ahead 3 , .Xr SSL_read 3 +.Sh HISTORY +.Fn SSL_pending +appeared in SSLeay 0.4 or earlier and has been available since +.Ox 2.4 . .Sh BUGS Up to OpenSSL 0.9.6, .Fn SSL_pending diff --git a/man/SSL_read.3 b/man/SSL_read.3 index 14e48538..d773065a 100644 --- a/man/SSL_read.3 +++ b/man/SSL_read.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_read.3,v 1.4 2016/12/07 18:47:23 schwarze Exp $ +.\" $OpenBSD: SSL_read.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Lutz Jaenicke and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 7 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_READ 3 .Os .Sh NAME @@ -223,3 +223,10 @@ with the return value to find out the reason. .Xr SSL_set_shutdown 3 , .Xr SSL_shutdown 3 , .Xr SSL_write 3 +.Sh HISTORY +.Fn SSL_read +appeared in SSLeay 0.4 or earlier. +.Fn SSL_peek +first appeared in SSLeay 0.6.6. +Both functions have been available since +.Ox 2.4 . diff --git a/man/SSL_renegotiate.3 b/man/SSL_renegotiate.3 index b28bd6e9..cf6308f2 100644 --- a/man/SSL_renegotiate.3 +++ b/man/SSL_renegotiate.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_renegotiate.3,v 1.4 2017/03/29 00:24:42 jmc Exp $ +.\" $OpenBSD: SSL_renegotiate.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL SSL_key_update.pod 4fbfe86a Feb 16 17:04:40 2017 +0000 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 29 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_RENEGOTIATE 3 .Os .Sh NAME @@ -153,4 +153,13 @@ scheduled but not yet acted on, or 0 otherwise. .Xr SSL_write 3 .Sh HISTORY .Fn SSL_renegotiate -is available in all versions of OpenSSL. +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . +.Pp +.Fn SSL_renegotiate_pending +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . +.Pp +.Fn SSL_renegotiate_abbreviated +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . diff --git a/man/SSL_rstate_string.3 b/man/SSL_rstate_string.3 index 3a315030..99613ba3 100644 --- a/man/SSL_rstate_string.3 +++ b/man/SSL_rstate_string.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_rstate_string.3,v 1.2 2016/12/04 12:20:54 schwarze Exp $ +.\" $OpenBSD: SSL_rstate_string.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 4 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_RSTATE_STRING 3 .Os .Sh NAME @@ -100,3 +100,9 @@ This should never happen. .El .Sh SEE ALSO .Xr ssl 3 +.Sh HISTORY +.Fn SSL_rstate_string +and +.Fn SSL_rstate_string_long +first appeared in SSLeay 0.6.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_session_reused.3 b/man/SSL_session_reused.3 index 56c89260..0fdf776f 100644 --- a/man/SSL_session_reused.3 +++ b/man/SSL_session_reused.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_session_reused.3,v 1.3 2017/04/10 14:00:51 schwarze Exp $ +.\" $OpenBSD: SSL_session_reused.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SESSION_REUSED 3 .Os .Sh NAME @@ -77,3 +77,7 @@ A session was reused. .Xr SSL_ctrl 3 , .Xr SSL_CTX_set_session_cache_mode 3 , .Xr SSL_set_session 3 +.Sh HISTORY +.Fn SSL_session_reused +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . diff --git a/man/SSL_set1_param.3 b/man/SSL_set1_param.3 index ae67d479..5697ac64 100644 --- a/man/SSL_set1_param.3 +++ b/man/SSL_set1_param.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: SSL_set1_param.3,v 1.1 2016/11/30 13:39:38 schwarze Exp $ -.\" OpenSSL SSL_CTX_get0_param.pod 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: SSL_set1_param.3,v 1.4 2018/03/23 14:28:16 schwarze Exp $ +.\" full merge up to: +.\" OpenSSL man3/SSL_CTX_get0_param 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2015 The OpenSSL Project. All rights reserved. @@ -48,15 +49,25 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 30 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt SSL_SET1_PARAM 3 .Os .Sh NAME +.Nm SSL_CTX_get0_param , +.Nm SSL_get0_param , .Nm SSL_CTX_set1_param , .Nm SSL_set1_param -.Nd set verification parameters +.Nd get and set verification parameters .Sh SYNOPSIS .In openssl/ssl.h +.Ft X509_VERIFY_PARAM * +.Fo SSL_CTX_get0_param +.Fa "SSL_CTX *ctx" +.Fc +.Ft X509_VERIFY_PARAM * +.Fo SSL_get0_param +.Fa "SSL *ssl" +.Fc .Ft int .Fo SSL_CTX_set1_param .Fa "SSL_CTX *ctx" @@ -68,6 +79,18 @@ .Fa "X509_VERIFY_PARAM *vpm" .Fc .Sh DESCRIPTION +.Fn SSL_CTX_get0_param +and +.Fn SSL_get0_param +retrieve an internal pointer to the verification parameters for +.Fa ctx +or +.Fa ssl , +respectively. +The returned pointer must not be freed by the calling application, +but the application can modify the parameters pointed to +to suit its needs: for example to add a hostname check. +.Pp .Fn SSL_CTX_set1_param and .Fn SSL_set1_param @@ -78,11 +101,36 @@ for or .Fa ssl . .Sh RETURN VALUES +.Fn SSL_CTX_get0_param +and +.Fn SSL_get0_param +return a pointer to an +.Vt X509_VERIFY_PARAM +structure. +.Pp .Fn SSL_CTX_set1_param and .Fn SSL_set1_param return 1 for success or 0 for failure. +.Sh EXAMPLES +Check that the hostname matches +.Pa www.foo.com +in the peer certificate: +.Bd -literal -offset indent +X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl); +X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0); +.Ed .Sh SEE ALSO .Xr X509_VERIFY_PARAM_set_flags 3 .Sh HISTORY -These functions were first added to OpenSSL 1.0.2. +.Fn SSL_CTX_set1_param +and +.Fn SSL_set1_param +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . +.Pp +.Fn SSL_CTX_get0_param +and +.Fn SSL_get0_param +first appeared in OpenSSL 1.0.2 and have been available since +.Ox 6.3 . diff --git a/man/SSL_set_bio.3 b/man/SSL_set_bio.3 index 391dfecc..f3ea507d 100644 --- a/man/SSL_set_bio.3 +++ b/man/SSL_set_bio.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_set_bio.3,v 1.3 2016/12/06 12:24:33 schwarze Exp $ +.\" $OpenBSD: SSL_set_bio.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL acb5b343 Sep 16 16:00:38 2000 +0000 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SET_BIO 3 .Os .Sh NAME @@ -96,3 +96,7 @@ cannot fail. .Xr SSL_connect 3 , .Xr SSL_get_rbio 3 , .Xr SSL_shutdown 3 +.Sh HISTORY +.Fn SSL_set_bio +first appeared in SSLeay 0.6.0 and has been available since +.Ox 2.4 . diff --git a/man/SSL_set_connect_state.3 b/man/SSL_set_connect_state.3 index 67e2545c..c2072c43 100644 --- a/man/SSL_set_connect_state.3 +++ b/man/SSL_set_connect_state.3 @@ -1,8 +1,10 @@ -.\" $OpenBSD: SSL_set_connect_state.3,v 1.2 2016/12/04 12:20:54 schwarze Exp $ -.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" $OpenBSD: SSL_set_connect_state.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" selective merge up to: OpenSSL dbd007d7 Jul 28 13:31:27 2017 +0800 .\" -.\" This file was written by Lutz Jaenicke . -.\" Copyright (c) 2001, 2002 The OpenSSL Project. All rights reserved. +.\" This file was written by Lutz Jaenicke +.\" and Paul Yang . +.\" Copyright (c) 2001, 2017 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 @@ -48,12 +50,13 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 4 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SET_CONNECT_STATE 3 .Os .Sh NAME .Nm SSL_set_connect_state , -.Nm SSL_set_accept_state +.Nm SSL_set_accept_state , +.Nm SSL_is_server .Nd prepare SSL object to work in client or server mode .Sh SYNOPSIS .In openssl/ssl.h @@ -61,6 +64,8 @@ .Fn SSL_set_connect_state "SSL *ssl" .Ft void .Fn SSL_set_accept_state "SSL *ssl" +.Ft int +.Fn SSL_is_server "const SSL *ssl" .Sh DESCRIPTION .Fn SSL_set_connect_state sets @@ -72,6 +77,11 @@ sets .Fa ssl to work in server mode. .Pp +.Fn SSL_is_server +checks whether +.Fa ssl +is set to server mode. +.Pp When the .Vt SSL_CTX object was created with @@ -101,11 +111,26 @@ the handshake routines must be explicitly set in advance using either .Fn SSL_set_connect_state or .Fn SSL_set_accept_state . -.Sh RETURN VALUES +.Pp +If +.Fn SSL_is_server +is called before .Fn SSL_set_connect_state -and +or .Fn SSL_set_accept_state -do not return diagnostic information. +was called either automatically or explicitly, +the result depends on what method was used when the +.Fa SSL_CTX +was created. +If a generic method or a dedicated server method was passed to +.Xr SSL_CTX_new 3 , +.Fn SSL_is_server +returns 1; otherwise, it returns 0. +.Sh RETURN VALUES +.Fn SSL_is_server +returns 1 if +.Fa ssl +is set to server mode or 0 if it is set to client mode. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_accept 3 , @@ -116,3 +141,13 @@ do not return diagnostic information. .Xr SSL_new 3 , .Xr SSL_read 3 , .Xr SSL_write 3 +.Sh HISTORY +.Fn SSL_set_connect_state +and +.Fn SSL_set_accept_state +first appeared in SSLeay 0.6.0 and have been available since +.Ox 2.4 . +.Pp +.Fn SSL_is_server +first appeared in OpenSSL 1.0.2 and has been available since +.Ox 6.3 . diff --git a/man/SSL_set_fd.3 b/man/SSL_set_fd.3 index e319c3b9..7b9727e9 100644 --- a/man/SSL_set_fd.3 +++ b/man/SSL_set_fd.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_set_fd.3,v 1.3 2016/12/06 12:24:33 schwarze Exp $ +.\" $OpenBSD: SSL_set_fd.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SET_FD 3 .Os .Sh NAME @@ -118,3 +118,12 @@ The operation succeeded. .Xr SSL_get_fd 3 , .Xr SSL_set_bio 3 , .Xr SSL_shutdown 3 +.Sh HISTORY +.Fn SSL_set_fd +appeared in SSLeay 0.4 or earlier. +.Fn SSL_set_rfd +and +.Fn SSL_set_wfd +first appeared in SSLeay 0.6.0. +These functions have been available since +.Ox 2.4 . diff --git a/man/SSL_set_max_send_fragment.3 b/man/SSL_set_max_send_fragment.3 index 1aa5589c..5a628405 100644 --- a/man/SSL_set_max_send_fragment.3 +++ b/man/SSL_set_max_send_fragment.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_set_max_send_fragment.3,v 1.3 2017/04/10 14:00:51 schwarze Exp $ +.\" $OpenBSD: SSL_set_max_send_fragment.3,v 1.4 2018/03/23 04:35:09 schwarze Exp $ .\" OpenSSL doc/man3/SSL_CTX_set_split_send_fragment.pod .\" OpenSSL 6782e5fd Oct 21 16:16:20 2016 +0100 .\" @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt SSL_SET_MAX_SEND_FRAGMENT 3 .Os .Sh NAME @@ -88,3 +88,9 @@ These functions return 1 on success or 0 on failure. .Xr SSL_ctrl 3 , .Xr SSL_CTX_set_read_ahead 3 , .Xr SSL_pending 3 +.Sh HISTORY +.Fn SSL_CTX_set_max_send_fragment +and +.Fn SSL_set_max_send_fragment +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/SSL_set_session.3 b/man/SSL_set_session.3 index 9ebd446b..7d85f5ad 100644 --- a/man/SSL_set_session.3 +++ b/man/SSL_set_session.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_set_session.3,v 1.2 2016/12/04 12:20:54 schwarze Exp $ +.\" $OpenBSD: SSL_set_session.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 4 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SET_SESSION 3 .Os .Sh NAME @@ -113,3 +113,7 @@ The operation succeeded. .Xr SSL_get_session 3 , .Xr SSL_SESSION_free 3 , .Xr SSL_session_reused 3 +.Sh HISTORY +.Fn SSL_set_session +first appeared in SSLeay 0.5.2 and has been available since +.Ox 2.4 . diff --git a/man/SSL_set_shutdown.3 b/man/SSL_set_shutdown.3 index 1c9fadca..1a4d9de4 100644 --- a/man/SSL_set_shutdown.3 +++ b/man/SSL_set_shutdown.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_set_shutdown.3,v 1.2 2016/12/04 12:20:54 schwarze Exp $ +.\" $OpenBSD: SSL_set_shutdown.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 4 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SET_SHUTDOWN 3 .Os .Sh NAME @@ -133,3 +133,9 @@ returns the current setting. .Xr SSL_CTX_set_quiet_shutdown 3 , .Xr SSL_free 3 , .Xr SSL_shutdown 3 +.Sh HISTORY +.Fn SSL_set_shutdown +and +.Fn SSL_get_shutdown +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_set_tmp_ecdh.3 b/man/SSL_set_tmp_ecdh.3 index 634bbf3c..e906bfdd 100644 --- a/man/SSL_set_tmp_ecdh.3 +++ b/man/SSL_set_tmp_ecdh.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_set_tmp_ecdh.3,v 1.3 2017/08/19 23:47:33 schwarze Exp $ +.\" $OpenBSD: SSL_set_tmp_ecdh.3,v 1.5 2018/03/23 14:28:16 schwarze Exp $ .\" .\" Copyright (c) 2017 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 19 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt SSL_SET_TMP_ECDH 3 .Os .Sh NAME @@ -103,3 +103,17 @@ always return 1. .Xr SSL_CTX_set_options 3 , .Xr SSL_CTX_set_tmp_dh_callback 3 , .Xr SSL_new 3 +.Sh HISTORY +.Fn SSL_set_tmp_ecdh , +.Fn SSL_CTX_set_tmp_ecdh , +.Fn SSL_set_tmp_ecdh_callback , +and +.Fn SSL_CTX_set_tmp_ecdh_callback +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Pp +.Fn SSL_CTX_set_ecdh_auto +and +.Fn SSL_set_ecdh_auto +first appeared in OpenSSL 1.0.2 and have been available since +.Ox 5.7 . diff --git a/man/SSL_set_verify_result.3 b/man/SSL_set_verify_result.3 index 48565d49..1ff8101f 100644 --- a/man/SSL_set_verify_result.3 +++ b/man/SSL_set_verify_result.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_set_verify_result.3,v 1.2 2016/12/04 12:20:54 schwarze Exp $ +.\" $OpenBSD: SSL_set_verify_result.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 4 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SET_VERIFY_RESULT 3 .Os .Sh NAME @@ -87,3 +87,7 @@ does not provide a return value. .Xr ssl 3 , .Xr SSL_get_peer_certificate 3 , .Xr SSL_get_verify_result 3 +.Sh HISTORY +.Fn SSL_set_verify_result +first appeared in SSLeay 0.6.1 and has been available since +.Ox 2.4 . diff --git a/man/SSL_shutdown.3 b/man/SSL_shutdown.3 index 11745076..bfb1e91e 100644 --- a/man/SSL_shutdown.3 +++ b/man/SSL_shutdown.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_shutdown.3,v 1.3 2016/12/06 12:24:33 schwarze Exp $ +.\" $OpenBSD: SSL_shutdown.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_SHUTDOWN 3 .Os .Sh NAME @@ -247,3 +247,7 @@ to find out the reason. .Xr SSL_free 3 , .Xr SSL_get_error 3 , .Xr SSL_set_shutdown 3 +.Sh HISTORY +.Fn SSL_shutdown +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . diff --git a/man/SSL_state_string.3 b/man/SSL_state_string.3 index 69a698c5..10703354 100644 --- a/man/SSL_state_string.3 +++ b/man/SSL_state_string.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_state_string.3,v 1.2 2016/12/04 12:20:54 schwarze Exp $ +.\" $OpenBSD: SSL_state_string.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 4 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_STATE_STRING 3 .Os .Sh NAME @@ -102,3 +102,9 @@ Detailed description of possible states to be included later. .Sh SEE ALSO .Xr ssl 3 , .Xr SSL_CTX_set_info_callback 3 +.Sh HISTORY +.Fn SSL_state_string +and +.Fn SSL_state_string_long +first appeared in SSLeay 0.6.0 and have been available since +.Ox 2.4 . diff --git a/man/SSL_want.3 b/man/SSL_want.3 index 4736d62c..24e8645b 100644 --- a/man/SSL_want.3 +++ b/man/SSL_want.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_want.3,v 1.3 2016/12/16 15:39:08 jmc Exp $ +.\" $OpenBSD: SSL_want.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 16 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_WANT 3 .Os .Sh NAME @@ -148,3 +148,14 @@ return 1 when the corresponding condition is true or 0 otherwise. .Xr err 3 , .Xr ssl 3 , .Xr SSL_get_error 3 +.Sh HISTORY +.Fn SSL_want , +.Fn SSL_want_nothing , +.Fn SSL_want_read , +and +.Fn SSL_want_write +first appeared in SSLeay 0.5.2. +.Fn SSL_want_x509_lookup +first appeared in SSLeay 0.6.0. +These functions have been available since +.Ox 2.4 . diff --git a/man/SSL_write.3 b/man/SSL_write.3 index 0580b6f2..d5e985e4 100644 --- a/man/SSL_write.3 +++ b/man/SSL_write.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_write.3,v 1.3 2016/12/06 12:24:33 schwarze Exp $ +.\" $OpenBSD: SSL_write.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt SSL_WRITE 3 .Os .Sh NAME @@ -218,3 +218,7 @@ with the return value to find out the reason. .Xr SSL_get_error 3 , .Xr SSL_read 3 , .Xr SSL_set_connect_state 3 +.Sh HISTORY +.Fn SSL_write +appeared in SSLeay 0.4 or earlier and has been available since +.Ox 2.4 . diff --git a/man/STACK_OF.3 b/man/STACK_OF.3 new file mode 100644 index 00000000..4cea8248 --- /dev/null +++ b/man/STACK_OF.3 @@ -0,0 +1,188 @@ +.\" $OpenBSD: STACK_OF.3,v 1.2 2018/03/21 17:57:48 schwarze Exp $ +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: March 21 2018 $ +.Dt STACK_OF 3 +.Os +.Sh NAME +.Nm STACK_OF +.Nd variable-sized arrays of pointers, called OpenSSL stacks +.Sh SYNOPSIS +.In openssl/safestack.h +.Fn STACK_OF type +.Sh DESCRIPTION +The +.In openssl/safestack.h +header provides a fragile, unusually complicated system of +macro-generated wrappers around the functions described in the +.Xr OPENSSL_sk_new 3 +manual page. +It is intended to implement superficially type-safe variable-sized +arrays of pointers, somewhat misleadingly called +.Dq stacks +by OpenSSL. +Due to the excessive number of API functions, it is impossible to +properly document this system. +In particular, calling +.Xr man 1 +for any of the functions operating on stacks cannot yield any result. +.Pp +Unfortunately, application programs can hardly avoid using the concept +because several important OpenSSL APIs rely on it; see the +.Sx SEE ALSO +section for examples. +Even though both pages are more complicated than any manual page +ought to be, using the concept safely requires a complete understanding +of all the details in both this manual page and in +.Xr OPENSSL_sk_new 3 . +.Pp +The +.Fn STACK_OF +macro takes a +.Fa type +name as its argument, typically the name of a type +that has been defined as an alias for a specific +.Vt struct +type using a +.Sy typedef +declaration. +It expands to an incomplete +.Vt struct +type which is intended to represent a +.Dq stack +of objects of the given +.Fa type . +That type does not actually exist, so it is not possible to define, +for example, an automatic variable +.Ql STACK_OF(X509) my_certificates ; +it is only possible to define pointers to stacks, for example +.Ql STACK_OF(X509) *my_certificates . +The only way such pointers can ever be used is by wrapper functions +casting them to the type +.Vt _STACK * +described in +.Xr OPENSSL_sk_new 3 . +.Pp +For a considerable number of types, OpenSSL provides one wrapper +function for each function described in +.Xr OPENSSL_sk_new 3 . +The names of these wrapper functions are usually constructed by +inserting the name of the type and an underscore after the +.Sq sk_ +prefix of the function name. +Usually, where the real functions take +.Vt void * +arguments, the wrappers take pointers to the +.Fa type +in questions, and where the real functions take +.Vt _STACK * +arguments, the wrappers take pointers to +.Fn STACK_OF type . +The same applies to return values. +Various exceptions to all this exist, but the above applies to +all the types listed below. +.Pp +Using the above may make sense for the following types because +public API functions exist that take stacks of these types as +arguments or return them: +.Vt ACCESS_DESCRIPTION , +.Vt ASN1_INTEGER , +.Vt ASN1_OBJECT , +.Vt ASN1_TYPE , +.Vt ASN1_UTF8STRING , +.Vt CONF_VALUE , +.Vt DIST_POINT , +.Vt GENERAL_NAME , +.Vt GENERAL_SUBTREE , +.Vt PKCS12_SAFEBAG , +.Vt PKCS7 , +.Vt PKCS7_RECIP_INFO , +.Vt PKCS7_SIGNER_INFO , +.Vt POLICY_MAPPING , +.Vt POLICYINFO , +.Vt POLICYQUALINFO , +.Vt X509 , +.Vt X509_ALGOR , +.Vt X509_ATTRIBUTE , +.Vt X509_CRL , +.Vt X509_EXTENSION , +.Vt X509_INFO , +.Vt X509_OBJECT , +.Vt X509_POLICY_NODE , +.Vt X509_PURPOSE , +.Vt X509_REVOKED . +.Pp +Even though the OpenSSL headers declare wrapper functions for many +more types and even though the OpenSSL documentation says that users +can declare their own stack types, using +.Fn STACK_OF +with any type not listed here is strongly discouraged. +For other types, there may be subtle, undocumented differences +in syntax and semantics, and attempting to declare custom stack +types is very error prone; using plain C arrays of pointers to +the desired type is much simpler and less dangerous. +.Sh EXAMPLES +The following program creates a certificate object, puts two +pointers to it on a stack, and uses +.Xr X509_free 3 +to clean up properly: +.Bd -literal +#include +#include +#include + +int +main(void) +{ + STACK_OF(X509) *stack; + X509 *x; + + if ((stack = sk_X509_new_null()) == NULL) + err(1, NULL); + if ((x = X509_new()) == NULL) + err(1, NULL); + if (sk_X509_push(stack, x) == 0) + err(1, NULL); + if (X509_up_ref(x) == 0) + errx(1, "X509_up_ref failed"); + if (sk_X509_push(stack, x) == 0) + err(1, NULL); + printf("%d pointers: %p, %p\en", sk_X509_num(stack), + sk_X509_value(stack, 0), sk_X509_value(stack, 1)); + sk_X509_pop_free(stack, X509_free); + + return 0; +} +.Ed +.Pp +The output looks similar to: +.Pp +.Dl 2 pointers: 0x4693ff24c00, 0x4693ff24c00 +.Sh SEE ALSO +.Xr OCSP_request_sign 3 , +.Xr PKCS12_parse 3 , +.Xr PKCS7_encrypt 3 , +.Xr SSL_CTX_set_client_CA_list 3 , +.Xr SSL_get_ciphers 3 , +.Xr SSL_get_peer_cert_chain 3 , +.Xr SSL_load_client_CA_file 3 , +.Xr X509_CRL_get_REVOKED 3 , +.Xr X509_STORE_CTX_get0_chain 3 +.Sh HISTORY +The +.Fn STACK_OF +macro first appeared in OpenSSL 0.9.3 and has been available since +.Ox 2.6 . diff --git a/man/SXNET_new.3 b/man/SXNET_new.3 index cf6f6927..9a723be2 100644 --- a/man/SXNET_new.3 +++ b/man/SXNET_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SXNET_new.3,v 1.2 2016/12/28 20:36:33 schwarze Exp $ +.\" $OpenBSD: SXNET_new.3,v 1.3 2018/03/21 17:57:48 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt SXNET_NEW 3 .Os .Sh NAME @@ -117,6 +117,10 @@ if an error occurs. .%C South Africa .%D 1998 .Re +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.3 +and have been available since +.Ox 2.6 . .Sh BUGS This manual page does not explain what the extension actually does because no authoritative information was found online so far. diff --git a/man/TS_REQ_new.3 b/man/TS_REQ_new.3 index 35da9484..0bd1c4ed 100644 --- a/man/TS_REQ_new.3 +++ b/man/TS_REQ_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: TS_REQ_new.3,v 1.4 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: TS_REQ_new.3,v 1.5 2018/03/23 04:34:23 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt TS_REQ_NEW 3 .Os .Sh NAME @@ -175,3 +175,7 @@ Version 2 according to RFC 5035, but the current implementation only supports the Signing Certificate Attribute Definition Version 1 according to RFC 2634, and hence only supports RFC 3161, but not RFC 5816 functionality. +.Sh HISTORY +These functions first appeared in OpenSSL 1.0.0 +and have been available since +.Ox 4.9 . diff --git a/man/UI_UTIL_read_pw.3 b/man/UI_UTIL_read_pw.3 index b2d69c45..aa3cefe8 100644 --- a/man/UI_UTIL_read_pw.3 +++ b/man/UI_UTIL_read_pw.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: UI_UTIL_read_pw.3,v 1.1 2017/03/26 00:06:10 schwarze Exp $ -.\" OpenSSL UI_UTIL_read_pw.pod 23103a52 Jan 12 15:17:42 2017 +0100 +.\" $OpenBSD: UI_UTIL_read_pw.3,v 1.3 2018/03/22 21:08:22 schwarze Exp $ +.\" full merge up to: OpenSSL 23103a52 Jan 12 15:17:42 2017 +0100 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file was written by Richard Levitte . .\" Copyright (c) 2017 The OpenSSL Project. All rights reserved. @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 26 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt UI_UTIL_READ_PW 3 .Os .Sh NAME @@ -91,5 +92,16 @@ does the same as but takes an external buffer .Fa buff for the verification passphrase. +.Sh RETURN VALUES +.Fn UI_UTIL_read_pw_string +and +.Fn UI_UTIL_read_pw +return 0 on success or a negative value on error. .Sh SEE ALSO .Xr UI_new 3 +.Sh HISTORY +.Fn UI_UTIL_read_pw +and +.Fn UI_UTIL_read_pw_string +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/UI_create_method.3 b/man/UI_create_method.3 index 2ce3a998..0c23e24e 100644 --- a/man/UI_create_method.3 +++ b/man/UI_create_method.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: UI_create_method.3,v 1.2 2017/03/26 12:31:27 jmc Exp $ +.\" $OpenBSD: UI_create_method.3,v 1.5 2018/05/19 23:06:33 schwarze Exp $ .\" OpenSSL UI_create_method.pod 8e3d46e5 Mar 11 10:51:04 2017 +0100 .\" .\" This file was written by Richard Levitte . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 26 2017 $ +.Dd $Mdocdate: May 19 2018 $ .Dt UI_CREATE_METHOD 3 .Os .Sh NAME @@ -71,7 +71,7 @@ .In openssl/ui.h .Ft UI_METHOD * .Fo UI_create_method -.Fa "char *name" +.Fa "const char *name" .Fc .Ft void .Fo UI_destroy_method @@ -260,3 +260,25 @@ or otherwise .Sh SEE ALSO .Xr UI_get_string_type 3 , .Xr UI_new 3 +.Sh HISTORY +.Fn UI_create_method , +.Fn UI_destroy_method , +.Fn UI_method_set_opener , +.Fn UI_method_set_writer , +.Fn UI_method_set_flusher , +.Fn UI_method_set_reader , +.Fn UI_method_set_closer , +.Fn UI_method_get_opener , +.Fn UI_method_get_writer , +.Fn UI_method_get_flusher , +.Fn UI_method_get_reader , +and +.Fn UI_method_get_closer +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn UI_method_set_prompt_constructor +and +.Fn UI_method_get_prompt_constructor +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/UI_get_string_type.3 b/man/UI_get_string_type.3 index 05bc8227..bc0449a9 100644 --- a/man/UI_get_string_type.3 +++ b/man/UI_get_string_type.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: UI_get_string_type.3,v 1.3 2017/08/20 22:24:30 schwarze Exp $ +.\" $OpenBSD: UI_get_string_type.3,v 1.4 2018/03/22 21:08:22 schwarze Exp $ .\" OpenSSL UI_STRING.pod e9c9971b Jul 1 18:28:50 2017 +0200 .\" .\" This file was written by Richard Levitte @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt UI_GET_STRING_TYPE 3 .Os .Sh NAME @@ -275,3 +275,7 @@ or or -1 on error. .Sh SEE ALSO .Xr UI_new 3 +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 3.2 . diff --git a/man/UI_new.3 b/man/UI_new.3 index 2b0ce5b5..86a2581c 100644 --- a/man/UI_new.3 +++ b/man/UI_new.3 @@ -1,6 +1,6 @@ -.\" $OpenBSD: UI_new.3,v 1.6 2017/03/26 00:06:10 schwarze Exp $ -.\" OpenSSL UI_new.pod 5469600e Mar 11 00:51:53 2017 +0100 -.\" OpenSSL UI_new.pod 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: UI_new.3,v 1.8 2018/03/22 21:08:22 schwarze Exp $ +.\" full merge up to: OpenSSL 78b19e90 Jan 11 00:12:01 2017 +0100 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file was written by Richard Levitte . .\" Copyright (c) 2001, 2016, 2017 The OpenSSL Project. All rights reserved. @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 26 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt UI_NEW 3 .Os .Sh NAME @@ -292,8 +292,8 @@ When done with this UI, it should be freed using .Fn UI_free . .Pp .Fn UI_OpenSSL -returns the built-in UI method (note: not the default one, since -the default can be changed. +returns the built-in UI method (note: not necessarily the default one, +since the default can be changed. See further on). This method is the most machine/OS dependent part of OpenSSL and normally generates the most problems when porting. @@ -381,7 +381,7 @@ whatever string and may include encodings that will be processed by the other method functions. .Pp .Fn UI_add_user_data -adds a piece of memory for the method to use at any time. +adds a user data pointer for the method to use at any time. The builtin UI method doesn't care about this info. Note that several calls to this function doesn't add data - the previous blob is replaced with the one given as argument. @@ -418,6 +418,8 @@ can be used again or not. .Pp .Fn UI_set_default_method changes the default UI method to the one given. +This function is not thread-safe and should not be called at the +same time as other OpenSSL functions. .Pp .Fn UI_get_default_method returns a pointer to the current default UI method. @@ -429,13 +431,84 @@ returns the UI method associated with a given .Fn UI_set_method changes the UI method associated with a given .Fa ui . +.Sh RETURN VALUES +.Fn UI_new +and +.Fn UI_new_method +return a valid +.Vt UI +structure or +.Dv NULL +if an error occurred. +.Pp +.Fn UI_add_input_string , +.Fn UI_dup_input_string , +.Fn UI_add_verify_string , +.Fn UI_dup_verify_string , +.Fn UI_add_input_boolean , +.Fn UI_dup_input_boolean , +.Fn UI_add_info_string , +.Fn UI_dup_info_string , +.Fn UI_add_error_string , +and +.Fn UI_dup_error_string +return a positive number on success or a number +less than or equal to zero otherwise. +.Pp +.Fn UI_construct_prompt +and +.Fn UI_get0_result +return a string or +.Dv NULL +if an error occurred. +.Pp +.Fn UI_add_user_data +and +.Fn UI_get0_user_data +return a pointer to the user data that was contained in +.Fa ui +before the call. +In particular, +.Dv NULL +is a valid return value. +.Pp +.Fn UI_process +returns 0 on success or a negative value on error. +.Pp +.Fn UI_ctrl +returns a mask on success or \-1 on error. +.Pp +.Fn UI_get_default_method +and +.Fn UI_OpenSSL +always return a pointer to a valid +.Vt UI_METHOD +structure. +.Pp +.Fn UI_get_method +and +.Fn UI_set_method +return a pointer to the +.Vt UI_METHOD +structure that is installed in +.Fa ui +after the call. +The OpenSSL documentation says that they can fail and return +.Dv NULL , +but currently, this can only happen when and after +.Fn UI_set_method +is called with an explicit +.Dv NULL +argument. .Sh SEE ALSO .Xr des_read_pw 3 , .Xr UI_create_method 3 , .Xr UI_get_string_type 3 , .Xr UI_UTIL_read_pw 3 .Sh HISTORY -The UI section was first introduced in OpenSSL 0.9.7. +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 3.2 . .Sh AUTHORS .An Richard Levitte Aq Mt richard@levitte.org for the OpenSSL project. diff --git a/man/X25519.3 b/man/X25519.3 index 3d8ccb8f..13f013e8 100644 --- a/man/X25519.3 +++ b/man/X25519.3 @@ -1,99 +1,100 @@ -.\" $OpenBSD: X25519.3,v 1.1 2017/04/10 17:45:06 schwarze Exp $ -.\" OpenSSL X25519.pod 69687aa8 Mar 28 23:57:28 2017 +0200 +.\" $OpenBSD: X25519.3,v 1.4 2018/08/10 17:28:48 jsing Exp $ +.\" contains some text from: BoringSSL curve25519.h, curve25519.c +.\" content also checked up to: OpenSSL f929439f Mar 15 12:19:16 2018 +0000 .\" -.\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2015 Google Inc. +.\" Copyright (c) 2018 Ingo Schwarze .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: +.\" Permission to use, copy, modify, and/or distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.\" 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. -.\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: August 10 2018 $ .Dt X25519 3 .Os .Sh NAME -.Nm X25519 -.Nd EVP_PKEY X25519 support +.Nm X25519 , +.Nm X25519_keypair +.Nd Elliptic Curve Diffie-Hellman primitive based on Curve25519 +.Sh SYNOPSIS +.In openssl/curve25519.h +.Ft int +.Fo X25519 +.Fa "uint8_t out_shared_key[X25519_KEY_LENGTH]" +.Fa "const uint8_t private_key[X25519_KEY_LENGTH]" +.Fa "const uint8_t peer_public_value[X25519_KEY_LENGTH]" +.Fc +.Ft void +.Fo X25519_keypair +.Fa "uint8_t out_public_value[X25519_KEY_LENGTH]" +.Fa "uint8_t out_private_key[X25519_KEY_LENGTH]" +.Fc .Sh DESCRIPTION -The -.Nm -.Vt EVP_PKEY -implementation supports key generation and key derivation using X25519. -It has associated private and public key formats compatible with -draft-ietf-curdle-pkix-03. -.Pp -No additional parameters can be set during key generation. +Curve25519 is an elliptic curve over a prime field specified in RFC 7748. +The prime field is defined by the prime number 2^255 - 19. .Pp -The peer public key must be set using -.Xr EVP_PKEY_derive_set_peer 3 -when performing key derivation. +.Fn X25519 +is the Diffie-Hellman primitive built from Curve25519 as described +in RFC 7748 section 5. +Section 6.1 describes the intended use in an Elliptic Curve Diffie-Hellman +(ECDH) protocol. .Pp -A context for the -.Nm -algorithm can be obtained by calling: +.Fn X25519 +writes a shared key to +.Fa out_shared_key +that is calculated from the given +.Fa private_key +and the +.Fa peer_public_value +by scalar multiplication. +Do not use the shared key directly, rather use a key derivation +function and also include the two public values as inputs. .Pp -.Dl EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(NID_X25519, NULL); -.Sh EXAMPLES -Generate an -.Nm -private key and write it to standard output in PEM format: -.Bd -literal -#include -#include - -EVP_PKEY *pkey = NULL; -EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(NID_X25519, NULL); -EVP_PKEY_keygen_init(pctx); -EVP_PKEY_keygen(pctx, &pkey); -EVP_PKEY_CTX_free(pctx); -PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL); -.Ed +.Fn X25519_keypair +sets +.Fa out_public_value +and +.Fa out_private_key +to a freshly generated public/private key pair. +First, the +.Fa out_private_key +is generated with +.Xr arc4random_buf 3 . +Then, the opposite of the masking described in RFC 7748 section 5 +is applied to it to make sure that the generated private key is never +correctly masked. +The purpose is to cause incorrect implementations on the peer side +to consistently fail. +Correct implementations will decode the key correctly even when it is +not correctly masked. +Finally, the +.Fa out_public_value +is calculated from the +.Fa out_private_key +by multiplying it with the Montgomery base point +.Vt uint8_t u[32] No = Brq 9 . .Pp -The key derivation example in -.Xr EVP_PKEY_derive 3 -can be used with -.Nm . +The size of a public and private key is +.Dv X25519_KEY_LENGTH No = 32 +bytes each. +.Sh RETURN VALUES +.Fn X25519 +returns 1 on success or 0 on error. +Failure can occur when the input is a point of small order. .Sh SEE ALSO -.Xr EVP_PKEY_CTX_new 3 , -.Xr EVP_PKEY_derive 3 , -.Xr EVP_PKEY_keygen 3 +.Rs +.%A D. J. Bernstein +.%R A state-of-the-art Diffie-Hellman function:\ + How do I use Curve25519 in my own software? +.%U http://cr.yp.to/ecdh.html +.Re +.Sh STANDARDS +RFC 7748: Elliptic Curves for Security diff --git a/man/X509V3_get_d2i.3 b/man/X509V3_get_d2i.3 index 9ba4572a..91883669 100644 --- a/man/X509V3_get_d2i.3 +++ b/man/X509V3_get_d2i.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: X509V3_get_d2i.3,v 1.6 2017/07/05 11:43:09 schwarze Exp $ -.\" OpenSSL 047dd81e Jul 4 23:03:17 2014 +0100 +.\" $OpenBSD: X509V3_get_d2i.3,v 1.14 2018/03/23 23:18:17 schwarze Exp $ +.\" full merge up to: OpenSSL ff7fbfd5 Nov 2 11:52:01 2015 +0000 +.\" selective merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2014, 2016 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2014, 2015, 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 @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 5 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt X509V3_GET_D2I 3 .Os .Sh NAME @@ -61,7 +62,10 @@ .Nm X509_CRL_get_ext_d2i , .Nm X509_CRL_add1_ext_i2d , .Nm X509_REVOKED_get_ext_d2i , -.Nm X509_REVOKED_add1_ext_i2d +.Nm X509_REVOKED_add1_ext_i2d , +.Nm X509_get0_extensions , +.Nm X509_CRL_get0_extensions , +.Nm X509_REVOKED_get0_extensions .Nd X509 extension decode and encode functions .Sh SYNOPSIS .In openssl/x509v3.h @@ -135,6 +139,18 @@ .Fa "int crit" .Fa "unsigned long flags" .Fc +.Ft const STACK_OF(X509_EXTENSION) * +.Fo X509_get0_extensions +.Fa "const X509 *x" +.Fc +.Ft const STACK_OF(X509_EXTENSION) * +.Fo X509_CRL_get0_extensions +.Fa "const X509_CRL *crl" +.Fc +.Ft const STACK_OF(X509_EXTENSION) * +.Fo X509_REVOKED_get0_extensions +.Fa "const X509_REVOKED *r" +.Fc .Sh DESCRIPTION .Fn X509V3_get_d2i looks for an extension with OID @@ -204,7 +220,7 @@ operate on the extensions of certificate and are otherwise identical to .Fn X509V3_get_d2i and -.Fn X509V3_add1_i2d 3 . +.Fn X509V3_add1_i2d . .Pp .Fn X509_CRL_get_ext_d2i and @@ -214,7 +230,7 @@ operate on the extensions of CRL and are otherwise identical to .Fn X509V3_get_d2i and -.Fn X509V3_add1_i2d 3 . +.Fn X509V3_add1_i2d . .Pp .Fn X509_REVOKED_get_ext_d2i and @@ -226,7 +242,14 @@ structure (i.e. for CRL entry extensions), and are otherwise identical to .Fn X509V3_get_d2i and -.Fn X509V3_add1_i2d 3 . +.Fn X509V3_add1_i2d . +.Pp +.Fn X509_get0_extensions , +.Fn X509_CRL_get0_extensions , +and +.Fn X509_REVOKED_get0_extensions +return a stack of all the extensions of a certificate, a CRL, +or a CRL entry, respectively. .Pp In almost all cases an extension can occur at most once and multiple occurrences is an error. @@ -363,6 +386,14 @@ if an error occurs. returns 1 if the operation is successful, 0 if it fails due to a non-fatal error (extension not found, already exists, cannot be encoded), or -1 due to a fatal error such as a memory allocation failure. +.Pp +.Fn X509_get0_extensions , +.Fn X509_CRL_get0_extensions , +and +.Fn X509_REVOKED_get0_extensions +return a stack of extensions, or +.Dv NULL +if no extensions are present. .Sh SEE ALSO .Xr d2i_X509 3 , .Xr d2i_X509_EXTENSION 3 , @@ -372,4 +403,35 @@ or -1 due to a fatal error such as a memory allocation failure. .Xr X509_get_pubkey 3 , .Xr X509_get_subject_name 3 , .Xr X509_get_version 3 , -.Xr X509_new 3 +.Xr X509_new 3 , +.Xr X509_REVOKED_new 3 +.Sh HISTORY +.Fn X509V3_EXT_d2i +first appeared in OpenSSL 0.9.2b. +.Fn X509V3_EXT_i2d +first appeared in OpenSSL 0.9.3. +Both functions have been available since +.Ox 2.6 . +.Pp +.Fn X509V3_get_d2i , +.Fn X509_get_ext_d2i , +.Fn X509_CRL_get_ext_d2i , +and +.Fn X509_REVOKED_get_ext_d2i +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn X509V3_add1_i2d , +.Fn X509_add1_ext_i2d , +.Fn X509_CRL_add1_ext_i2d , +and +.Fn X509_REVOKED_add1_ext_i2d +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn X509_get0_extensions , +.Fn X509_CRL_get0_extensions , +and +.Fn X509_REVOKED_get0_extensions +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . diff --git a/man/X509_ALGOR_dup.3 b/man/X509_ALGOR_dup.3 index b1a28e11..5a2b7a46 100644 --- a/man/X509_ALGOR_dup.3 +++ b/man/X509_ALGOR_dup.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_ALGOR_dup.3,v 1.5 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: X509_ALGOR_dup.3,v 1.13 2018/05/01 19:42:58 schwarze Exp $ .\" OpenSSL 4692340e Jun 7 15:49:08 2016 -0400 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: May 1 2018 $ .Dt X509_ALGOR_DUP 3 .Os .Sh NAME @@ -96,7 +96,7 @@ .Fc .Ft void .Fo X509_ALGOR_get0 -.Fa "ASN1_OBJECT **paobj" +.Fa "const ASN1_OBJECT **paobj" .Fa "int *pptype" .Fa "const void **ppval" .Fa "const X509_ALGOR *alg" @@ -207,7 +207,33 @@ have identical encodings or non-zero otherwise. .Sh SEE ALSO .Xr ASN1_TYPE_set 3 , .Xr d2i_X509_ALGOR 3 , +.Xr X509_get0_signature 3 , .Xr X509_PUBKEY_get0_param 3 .Sh STANDARDS RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile +.Sh HISTORY +.Fn X509_ALGOR_new +and +.Fn X509_ALGOR_free +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . +.Pp +.Fn X509_ALGOR_dup +first appeared in SSLeay 0.9.1 and has been avialable since +.Ox 2.6 . +.Pp +.Fn X509_ALGOR_set0 +and +.Fn X509_ALGOR_get0 +first appeared in OpenSSL 0.9.8h and have been available since +.Ox 4.5 . +.Pp +.Fn X509_ALGOR_cmp +first appeared in OpenSSL 0.9.8zd, 1.0.0p, and 1.0.1k +and has been available since +.Ox 4.9 . +.Pp +.Fn X509_ALGOR_set_md +first appeared in OpenSSL 1.0.1 and has been available since +.Ox 5.3 . diff --git a/man/X509_ATTRIBUTE_new.3 b/man/X509_ATTRIBUTE_new.3 index 776c4b17..cf978867 100644 --- a/man/X509_ATTRIBUTE_new.3 +++ b/man/X509_ATTRIBUTE_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.4 2016/12/28 20:29:15 schwarze Exp $ +.\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_ATTRIBUTE_NEW 3 .Os .Sh NAME @@ -88,6 +88,12 @@ Private-Key Information Syntax Specification RFC 7292: PKCS #12: Personal Information Exchange Syntax, section 4.2: The SafeBag Type .El +.Sh HISTORY +.Fn X509_ATTRIBUTE_new +and +.Fn X509_ATTRIBUTE_free +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . .Sh BUGS A data type designed to hold arbitrary data is an oxymoron. .Pp diff --git a/man/X509_CINF_new.3 b/man/X509_CINF_new.3 index 7ac86b6d..29d2371f 100644 --- a/man/X509_CINF_new.3 +++ b/man/X509_CINF_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_CINF_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: X509_CINF_new.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_CINF_NEW 3 .Os .Sh NAME @@ -97,3 +97,17 @@ if an error occurs. .Sh STANDARDS RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile +.Sh HISTORY +.Fn X509_CINF_new , +.Fn X509_CINF_free , +.Fn X509_VAL_new , +and +.Fn X509_VAL_free +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . +.Pp +.Fn X509_CERT_AUX_new +and +.Fn X509_CERT_AUX_free +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/X509_CRL_get0_by_serial.3 b/man/X509_CRL_get0_by_serial.3 index b5d8c8d9..d1580e1d 100644 --- a/man/X509_CRL_get0_by_serial.3 +++ b/man/X509_CRL_get0_by_serial.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_CRL_get0_by_serial.3,v 1.5 2017/03/25 18:35:33 schwarze Exp $ +.\" $OpenBSD: X509_CRL_get0_by_serial.3,v 1.8 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL X509_CRL_get0_by_serial.pod cdd6c8c5 Mar 20 12:29:37 2017 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 25 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt X509_CRL_GET0_BY_SERIAL 3 .Os .Sh NAME @@ -157,3 +157,19 @@ returns a STACK of revoked entries. .Xr X509_CRL_get_version 3 , .Xr X509_REVOKED_new 3 , .Xr X509V3_get_d2i 3 +.Sh HISTORY +.Fn X509_CRL_get_REVOKED +first appeared in OpenSSL 0.9.2b and has been available since +.Ox 2.6 . +.Pp +.Fn X509_CRL_add0_revoked +and +.Fn X509_CRL_sort +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn X509_CRL_get0_by_serial +and +.Fn X509_CRL_get0_by_cert +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/X509_CRL_new.3 b/man/X509_CRL_new.3 index 2f35b100..47b3d549 100644 --- a/man/X509_CRL_new.3 +++ b/man/X509_CRL_new.3 @@ -1,6 +1,6 @@ -.\" $OpenBSD: X509_CRL_new.3,v 1.3 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: X509_CRL_new.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" -.\" Copyright (c) 2016 Ingo Schwarze +.\" Copyright (c) 2016, 2018 Ingo Schwarze .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -14,11 +14,13 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_CRL_NEW 3 .Os .Sh NAME .Nm X509_CRL_new , +.Nm X509_CRL_dup , +.Nm X509_CRL_up_ref , .Nm X509_CRL_free , .Nm X509_CRL_INFO_new , .Nm X509_CRL_INFO_free @@ -27,6 +29,10 @@ .In openssl/x509.h .Ft X509_CRL * .Fn X509_CRL_new void +.Ft X509_CRL * +.Fn X509_CRL_dup "X509_CRL *crl" +.Ft int +.Fn X509_CRL_up_ref "X509_CRL *crl" .Ft void .Fn X509_CRL_free "X509_CRL *crl" .Ft X509_CRL_INFO * @@ -44,8 +50,22 @@ It can hold a pointer to an .Vt X509_CRL_INFO object discussed below together with a cryptographic signature and information about the signature algorithm used. +The reference count is set to 1. +.Pp +.Fn X509_CRL_dup +creates a deep copy of +.Fa crl . +.Pp +.Fn X509_CRL_up_ref +increments the reference count of +.Fa crl +by 1. +.Pp .Fn X509_CRL_free -frees +decrements the reference count of +.Fa crl +by 1. +If the reference count reaches 0, it frees .Fa crl . .Pp .Fn X509_CRL_INFO_new @@ -63,7 +83,8 @@ list is due, and optional extensions. frees .Fa crl_info . .Sh RETURN VALUES -.Fn X509_CRL_new +.Fn X509_CRL_new , +.Fn X509_CRL_dup , and .Fn X509_CRL_INFO_new return the new @@ -73,6 +94,9 @@ or object, respectively, or .Dv NULL if an error occurs. +.Pp +.Fn X509_CRL_up_ref +returns 1 on success or 0 on error. .Sh SEE ALSO .Xr ACCESS_DESCRIPTION_new 3 , .Xr AUTHORITY_KEYID_new 3 , @@ -94,3 +118,18 @@ if an error occurs. RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 5: CRL and CRL Extensions Profile +.Sh HISTORY +.Fn X509_CRL_new , +.Fn X509_CRL_free , +.Fn X509_CRL_INFO_new , +and +.Fn X509_CRL_INFO_free +first appeared in SSLeay 0.4.4. +.Fn X509_CRL_dup +first appeared in SSLeay 0.5.1. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn X509_CRL_up_ref +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/X509_EXTENSION_set_object.3 b/man/X509_EXTENSION_set_object.3 index f0df3392..414dfe6a 100644 --- a/man/X509_EXTENSION_set_object.3 +++ b/man/X509_EXTENSION_set_object.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_EXTENSION_set_object.3,v 1.6 2016/12/28 13:45:30 schwarze Exp $ +.\" $OpenBSD: X509_EXTENSION_set_object.3,v 1.9 2018/05/19 21:09:19 schwarze Exp $ .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: May 19 2018 $ .Dt X509_EXTENSION_SET_OBJECT 3 .Os .Sh NAME @@ -105,7 +105,7 @@ .Ft int .Fo X509_EXTENSION_set_object .Fa "X509_EXTENSION *ex" -.Fa "ASN1_OBJECT *obj" +.Fa "const ASN1_OBJECT *obj" .Fc .Ft int .Fo X509_EXTENSION_set_critical @@ -123,7 +123,7 @@ .Fc .Ft int .Fo X509_EXTENSION_get_critical -.Fa "X509_EXTENSION *ex" +.Fa "const X509_EXTENSION *ex" .Fc .Ft ASN1_OCTET_STRING * .Fo X509_EXTENSION_get_data @@ -286,3 +286,20 @@ pointer. .Sh STANDARDS RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile +.Sh HISTORY +.Fn X509_EXTENSION_new +and +.Fn X509_EXTENSION_free +first appeared in SSLeay 0.6.2. +.Fn X509_EXTENSION_create_by_NID , +.Fn X509_EXTENSION_create_by_OBJ , +.Fn X509_EXTENSION_set_object , +.Fn X509_EXTENSION_set_critical , +.Fn X509_EXTENSION_set_data , +.Fn X509_EXTENSION_get_object , +.Fn X509_EXTENSION_get_critical , +and +.Fn X509_EXTENSION_get_data +first appeared in SSLeay 0.8.0. +These functions have been available since +.Ox 2.4 . diff --git a/man/X509_LOOKUP_hash_dir.3 b/man/X509_LOOKUP_hash_dir.3 index cfa8f0dc..1f8520ce 100644 --- a/man/X509_LOOKUP_hash_dir.3 +++ b/man/X509_LOOKUP_hash_dir.3 @@ -1,9 +1,9 @@ -.\" $OpenBSD: X509_LOOKUP_hash_dir.3,v 1.3 2017/01/06 22:46:06 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: X509_LOOKUP_hash_dir.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file was written by Victor B. Wagner .\" and Claus Assmann. -.\" Copyright (c) 2015, 2016 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2015, 2016, 2017 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 @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_LOOKUP_HASH_DIR 3 .Os .Sh NAME @@ -141,9 +141,6 @@ filename causes these functions to load the default certificate store file (see .Xr X509_STORE_set_default_paths 3 ) . .Pp -These functions return the number of objects loaded from file or 0 -in case of error. -.Pp Both methods support adding several certificate locations into one .Sy X509_STORE . .Pp @@ -211,8 +208,37 @@ sequence number greater than that of the already cached CRL. Note that the hash algorithm used for subject name hashing changed in OpenSSL 1.0.0, and all certificate stores have to be rehashed when moving from OpenSSL 0.9.8 to 1.0.0. +.Sh RETURN VALUES +.Fn X509_LOOKUP_hash_dir +and +.Fn X509_LOOKUP_file +always return a pointer to a static +.Vt X509_LOOKUP_METHOD +structure. +.Pp +.Fn X509_load_cert_file , +.Fn X509_load_crl_file , +and +.Fn X509_load_cert_crl_file +return the number of objects loaded from the +.Fa file +or 0 on error. .Sh SEE ALSO .Xr d2i_X509_bio 3 , .Xr PEM_read_PrivateKey 3 , .Xr SSL_CTX_load_verify_locations 3 , .Xr X509_STORE_load_locations 3 +.Sh HISTORY +.Fn X509_LOOKUP_hash_dir , +.Fn X509_LOOKUP_file , +and +.Fn X509_load_cert_file +first appeared in SSLeay 0.8.0. +.Fn X509_load_crl_file +first appeared in SSLeay 0.9.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn X509_load_cert_crl_file +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . diff --git a/man/X509_NAME_ENTRY_get_object.3 b/man/X509_NAME_ENTRY_get_object.3 index e11a4b77..d2cb9baa 100644 --- a/man/X509_NAME_ENTRY_get_object.3 +++ b/man/X509_NAME_ENTRY_get_object.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: X509_NAME_ENTRY_get_object.3,v 1.6 2016/12/25 22:15:10 schwarze Exp $ -.\" OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400 +.\" $OpenBSD: X509_NAME_ENTRY_get_object.3,v 1.12 2018/05/19 21:25:51 schwarze Exp $ +.\" full merge up to: OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file is a derived work. .\" The changes are covered by the following Copyright and license: @@ -19,7 +20,8 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" The original file was written by Dr. Stephen Henson . -.\" Copyright (c) 2002, 2005, 2006 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2002, 2005, 2006, 2017 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 @@ -65,7 +67,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: May 19 2018 $ .Dt X509_NAME_ENTRY_GET_OBJECT 3 .Os .Sh NAME @@ -91,16 +93,16 @@ .Fc .Ft ASN1_OBJECT * .Fo X509_NAME_ENTRY_get_object -.Fa "X509_NAME_ENTRY *ne" +.Fa "const X509_NAME_ENTRY *ne" .Fc .Ft ASN1_STRING * .Fo X509_NAME_ENTRY_get_data -.Fa "X509_NAME_ENTRY *ne" +.Fa "const X509_NAME_ENTRY *ne" .Fc .Ft int .Fo X509_NAME_ENTRY_set_object .Fa "X509_NAME_ENTRY *ne" -.Fa "ASN1_OBJECT *obj" +.Fa "const ASN1_OBJECT *obj" .Fc .Ft int .Fo X509_NAME_ENTRY_set_data @@ -122,13 +124,13 @@ .Fa "X509_NAME_ENTRY **ne" .Fa "int nid" .Fa "int type" -.Fa "unsigned char *bytes" +.Fa "const unsigned char *bytes" .Fa "int len" .Fc .Ft X509_NAME_ENTRY * .Fo X509_NAME_ENTRY_create_by_OBJ .Fa "X509_NAME_ENTRY **ne" -.Fa "ASN1_OBJECT *obj" +.Fa "const ASN1_OBJECT *obj" .Fa "int type" .Fa "const unsigned char *bytes" .Fa "int len" @@ -220,6 +222,36 @@ but in the case of .Fn X509_NAME_ENTRY_set_data the field type must be set first so the relevant field information can be looked up internally. +.Sh RETURN VALUES +.Fn X509_NAME_ENTRY_new , +.Fn X509_NAME_ENTRY_create_by_txt , +.Fn X509_NAME_ENTRY_create_by_NID , +and +.Fn X509_NAME_ENTRY_create_by_OBJ +return a valid +.Vt X509_NAME_ENTRY +structure on success or +.Dv NULL +if an error occurred. +.Pp +.Fn X509_NAME_ENTRY_get_object +returns a valid +.Vt ASN1_OBJECT +structure if it is set or +.Dv NULL +if an error occurred. +.Pp +.Fn X509_NAME_ENTRY_get_data +returns a valid +.Vt ASN1_STRING +structure if it is set or +.Dv NULL +if an error occurred. +.Pp +.Fn X509_NAME_ENTRY_set_object +and +.Fn X509_NAME_ENTRY_set_data +return 1 on success or 0 on error. .Sh SEE ALSO .Xr ERR_get_error 3 , .Xr OBJ_nid2obj 3 , @@ -233,3 +265,22 @@ Certificate Revocation List (CRL) Profile ITU-T Recommendation X.501, also known as ISO/IEC 9594-2: Information Technology Open Systems Interconnection The Directory: Models, section 9.3: Relative distinguished name +.Sh HISTORY +.Fn X509_NAME_ENTRY_new +and +.Fn X509_NAME_ENTRY_free +first appeared in SSLeay 0.5.1. +.Fn X509_NAME_ENTRY_get_object , +.Fn X509_NAME_ENTRY_get_data , +.Fn X509_NAME_ENTRY_set_object , +.Fn X509_NAME_ENTRY_set_data , +.Fn X509_NAME_ENTRY_create_by_NID , +and +.Fn X509_NAME_ENTRY_create_by_OBJ +first appeared in SSLeay 0.8.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn X509_NAME_ENTRY_create_by_txt +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . diff --git a/man/X509_NAME_add_entry_by_txt.3 b/man/X509_NAME_add_entry_by_txt.3 index a2a9314c..1f094140 100644 --- a/man/X509_NAME_add_entry_by_txt.3 +++ b/man/X509_NAME_add_entry_by_txt.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_NAME_add_entry_by_txt.3,v 1.7 2017/01/06 03:00:56 schwarze Exp $ +.\" $OpenBSD: X509_NAME_add_entry_by_txt.3,v 1.12 2018/05/19 23:02:00 schwarze Exp $ .\" OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: May 19 2018 $ .Dt X509_NAME_ADD_ENTRY_BY_TXT 3 .Os .Sh NAME @@ -74,9 +74,9 @@ .Ft int .Fo X509_NAME_add_entry_by_OBJ .Fa "X509_NAME *name" -.Fa "ASN1_OBJECT *obj" +.Fa "const ASN1_OBJECT *obj" .Fa "int type" -.Fa "unsigned char *bytes" +.Fa "const unsigned char *bytes" .Fa "int len" .Fa "int loc" .Fa "int set" @@ -86,7 +86,7 @@ .Fa "X509_NAME *name" .Fa "int nid" .Fa "int type" -.Fa "unsigned char *bytes" +.Fa "const unsigned char *bytes" .Fa "int len" .Fa "int loc" .Fa "int set" @@ -94,7 +94,7 @@ .Ft int .Fo X509_NAME_add_entry .Fa "X509_NAME *name" -.Fa "X509_NAME_ENTRY *ne" +.Fa "const X509_NAME_ENTRY *ne" .Fa "int loc" .Fa "int set" .Fc @@ -255,6 +255,19 @@ if (!X509_NAME_add_entry_by_txt(nm, "CN", MBSTRING_ASC, .Xr ERR_get_error 3 , .Xr X509_NAME_get_index_by_NID 3 , .Xr X509_NAME_new 3 +.Sh HISTORY +.Fn X509_NAME_add_entry +and +.Fn X509_NAME_delete_entry +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn X509_NAME_add_entry_by_txt , +.Fn X509_NAME_add_entry_by_OBJ , +and +.Fn X509_NAME_add_entry_by_NID +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . .Sh BUGS .Fa type can still be set to diff --git a/man/X509_NAME_get_index_by_NID.3 b/man/X509_NAME_get_index_by_NID.3 index b6571ccc..70202fed 100644 --- a/man/X509_NAME_get_index_by_NID.3 +++ b/man/X509_NAME_get_index_by_NID.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_NAME_get_index_by_NID.3,v 1.6 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: X509_NAME_get_index_by_NID.3,v 1.10 2018/07/09 09:57:41 tb Exp $ .\" OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: July 9 2018 $ .Dt X509_NAME_GET_INDEX_BY_NID 3 .Os .Sh NAME @@ -64,23 +64,23 @@ .In openssl/x509.h .Ft int .Fo X509_NAME_get_index_by_NID -.Fa "X509_NAME *name" +.Fa "const X509_NAME *name" .Fa "int nid" .Fa "int lastpos" .Fc .Ft int .Fo X509_NAME_get_index_by_OBJ -.Fa "X509_NAME *name" -.Fa "ASN1_OBJECT *obj" +.Fa "const X509_NAME *name" +.Fa "const ASN1_OBJECT *obj" .Fa "int lastpos" .Fc .Ft int .Fo X509_NAME_entry_count -.Fa "X509_NAME *name" +.Fa "const X509_NAME *name" .Fc .Ft X509_NAME_ENTRY * .Fo X509_NAME_get_entry -.Fa "X509_NAME *name" +.Fa "const X509_NAME *name" .Fa "int loc" .Fc .Ft int @@ -93,7 +93,7 @@ .Ft int .Fo X509_NAME_get_text_by_OBJ .Fa "X509_NAME *name" -.Fa "ASN1_OBJECT *obj" +.Fa "const ASN1_OBJECT *obj" .Fa "char *buf" .Fa "int len" .Fc @@ -227,6 +227,10 @@ for (;;) { .Xr d2i_X509_NAME 3 , .Xr ERR_get_error 3 , .Xr X509_NAME_new 3 +.Sh HISTORY +These functions first appeared in SSLeay 0.8.0 +and have been available since +.Ox 2.4 . .Sh CAVEATS .Fn X509_NAME_get_text_by_NID and diff --git a/man/X509_NAME_new.3 b/man/X509_NAME_new.3 index c4efab77..527e2227 100644 --- a/man/X509_NAME_new.3 +++ b/man/X509_NAME_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_NAME_new.3,v 1.3 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: X509_NAME_new.3,v 1.6 2018/07/29 20:29:32 tb Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: July 29 2018 $ .Dt X509_NAME_NEW 3 .Os .Sh NAME @@ -62,6 +62,11 @@ frees and all the .Vt X509_NAME_ENTRY objects contained in it. +If +.Fa name +is a +.Dv NULL +pointer, no action occurs. .Sh RETURN VALUES .Fn X509_NAME_new returns a new @@ -86,3 +91,9 @@ Certificate Revocation List (CRL) Profile ITU-T Recommendation X.501, also known as ISO/IEC 9594-2: Information Technology \(en Open Systems Interconnection \(en The Directory: Models, section 9: Names +.Sh HISTORY +.Fn X509_NAME_new +and +.Fn X509_NAME_free +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . diff --git a/man/X509_NAME_print_ex.3 b/man/X509_NAME_print_ex.3 index 1342a200..494066ff 100644 --- a/man/X509_NAME_print_ex.3 +++ b/man/X509_NAME_print_ex.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: X509_NAME_print_ex.3,v 1.6 2016/12/25 22:15:10 schwarze Exp $ -.\" OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400 +.\" $OpenBSD: X509_NAME_print_ex.3,v 1.11 2018/05/19 22:05:58 schwarze Exp $ +.\" full merge up to: OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400 +.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2002, 2004, 2007, 2016 The OpenSSL Project. +.\" Copyright (c) 2002, 2004, 2007, 2016, 2017 The OpenSSL Project. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -49,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: May 19 2018 $ .Dt X509_NAME_PRINT_EX 3 .Os .Sh NAME @@ -63,27 +64,27 @@ .Ft int .Fo X509_NAME_print_ex .Fa "BIO *out" -.Fa "X509_NAME *nm" +.Fa "const X509_NAME *nm" .Fa "int indent" .Fa "unsigned long flags" .Fc .Ft int .Fo X509_NAME_print_ex_fp .Fa "FILE *fp" -.Fa "X509_NAME *nm" +.Fa "const X509_NAME *nm" .Fa "int indent" .Fa "unsigned long flags" .Fc .Ft char * .Fo X509_NAME_oneline -.Fa "X509_NAME *a" +.Fa "const X509_NAME *a" .Fa "char *buf" .Fa "int size" .Fc .Ft int .Fo X509_NAME_print .Fa "BIO *bp" -.Fa "X509_NAME *name" +.Fa "const X509_NAME *name" .Fa "int obase" .Fc .Sh DESCRIPTION @@ -248,8 +249,38 @@ uses a format identical to in fact it calls .Fn X509_NAME_print internally. +.Sh RETURN VALUES +.Fn X509_NAME_print_ex +and +.Fn X509_NAME_print_ex_fp +return 1 on success or 0 on error if +.Dv XN_FLAG_COMPAT +is set in +.Fa flags . +Otherwise, they return the number of printed bytes including the +indentation or \-1 on error. +.Pp +.Fn X509_NAME_oneline +returns a valid string on success or +.Dv NULL +on error. +.Pp +.Fn X509_NAME_print +returns 1 on success or 0 on error. .Sh SEE ALSO .Xr ASN1_STRING_print_ex 3 , .Xr d2i_X509_NAME 3 , .Xr X509_NAME_get_index_by_NID 3 , .Xr X509_NAME_new 3 +.Sh HISTORY +.Fn X509_NAME_oneline +and +.Fn X509_NAME_print +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp +.Fn X509_NAME_print_ex +and +.Fn X509_NAME_print_ex_fp +first appeared in OpenSSL 0.9.6 and have been available since +.Ox 2.9 . diff --git a/man/X509_OBJECT_get0_X509.3 b/man/X509_OBJECT_get0_X509.3 new file mode 100644 index 00000000..905146b3 --- /dev/null +++ b/man/X509_OBJECT_get0_X509.3 @@ -0,0 +1,256 @@ +.\" $OpenBSD: X509_OBJECT_get0_X509.3,v 1.8 2018/08/24 19:23:07 tb Exp $ +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: August 24 2018 $ +.Dt X509_OBJECT_GET0_X509 3 +.Os +.Sh NAME +.Nm X509_OBJECT_get_type , +.Nm X509_OBJECT_up_ref_count , +.Nm X509_OBJECT_free_contents , +.Nm X509_OBJECT_get0_X509 , +.Nm X509_OBJECT_get0_X509_CRL , +.Nm X509_OBJECT_idx_by_subject , +.Nm X509_OBJECT_retrieve_by_subject , +.Nm X509_OBJECT_retrieve_match +.Nd certificate, CRL, private key, and string wrapper for certificate stores +.Sh SYNOPSIS +.In openssl/x509_vfy.h +.Ft int +.Fo X509_OBJECT_get_type +.Fa "const X509_OBJECT *obj" +.Fc +.Ft int +.Fo X509_OBJECT_up_ref_count +.Fa "X509_OBJECT *obj" +.Fc +.Ft void +.Fo X509_OBJECT_free_contents +.Fa "X509_OBJECT *obj" +.Fc +.Ft X509 * +.Fo X509_OBJECT_get0_X509 +.Fa "const X509_OBJECT *obj" +.Fc +.Ft X509_CRL * +.Fo X509_OBJECT_get0_X509_CRL +.Fa "X509_OBJECT *obj" +.Fc +.Ft int +.Fo X509_OBJECT_idx_by_subject +.Fa "STACK_OF(X509_OBJECT) *stack" +.Fa "int type" +.Fa "X509_NAME *name" +.Fc +.Ft X509_OBJECT * +.Fo X509_OBJECT_retrieve_by_subject +.Fa "STACK_OF(X509_OBJECT) *stack" +.Fa "int type" +.Fa "X509_NAME *name" +.Fc +.Ft X509_OBJECT * +.Fo X509_OBJECT_retrieve_match +.Fa "STACK_OF(X509_OBJECT) *stack" +.Fa "X509_OBJECT *obj" +.Fc +.Sh DESCRIPTION +The +.Vt X509_OBJECT +structure is a shallow wrapper around one +.Vt X509 +certificate object, one +.Vt X509_CRL +certificate revocation list object, one +.Vt EVP_PKEY +private key object, or one +.Vt char * +string. +The type of object stored at any given time can be inspected with +.Fn X509_OBJECT_get_type . +.Pp +Each +.Vt X509_STORE +object uses one stack of +.Vt X509_OBJECT +structures as its main storage area. +.Pp +If +.Fa obj +contains an +.Vt X509 +certificate or an +.Vt X509_CRL +certificate revocation list, +.Fn X509_OBJECT_up_ref_count +increments the reference count of that inner object by 1. +Otherwise, no action occurs. +.Pp +If +.Fa obj +contains an +.Vt X509 +certificate, +.Fn X509_OBJECT_free_contents +calls +.Xr X509_free 3 +on that inner object. +If +.Fa obj +contains an +.Vt X509_CRL +certificate revocation list, it calls +.Xr X509_CRL_free 3 +on that inner list. +Otherwise, no action occurs. +.Fn X509_OBJECT_free_contents +does not free +.Fa obj +itself. +.Pp +If +.Fa type +is +.Dv X509_LU_X509 , +.Fn X509_OBJECT_idx_by_subject +and +.Fn X509_OBJECT_retrieve_by_subject +search the given +.Fa stack +for a certificate with the subject +.Fa name . +If +.Fa type +is +.Dv X509_LU_CRL , +they search for a certificate revocation list with the issuer +.Fa name +instead. +.Pp +If +.Fa obj +contains a certificate, +.Fn X509_OBJECT_retrieve_match +searches the given +.Fa stack +for a certificate with a matching subject name; +if it contains a certificate revocation list, it searches for a +certificate revocation list with a matching issuer name instead; +otherwise, it searches for an +.Vt X509_OBJECT +with a matching type. +.Sh RETURN VALUES +.Fn X509_OBJECT_get_type +returns +.Dv X509_LU_X509 +if +.Fa obj +contains a certificate, +.Dv X509_LU_CRL +if it contains a certificate revocation list, +or 0 if an error occurs. +.Pp +.Fn X509_OBJECT_up_ref_count +returns 1 on success and 0 on failure. +.Pp +.Fn X509_OBJECT_get0_X509 +returns an internal pointer to the certificate contained in +.Fa obj +or +.Dv NULL +if +.Fa obj +is +.Dv NULL +or contains no certificate. +.Pp +.Fn X509_OBJECT_get0_X509_CRL +returns an internal pointer to the certificate revocation list contained in +.Fa obj +or +.Dv NULL +if +.Fa obj +is +.Dv NULL +or contains no certificate revocation list. +.Pp +.Fn X509_OBJECT_idx_by_subject +returns the zero-based index of the first matching certificate +or revocation list in the +.Fa stack +or \-1 if +.Fa type +is neither +.Dv X509_LU_X509 +nor +.Dv X509_LU_CRL +or if no match is found. +.Pp +.Fn X509_OBJECT_retrieve_by_subject +returns the first matching certificate or revocation list in the +.Fa stack +or +.Dv NULL +if +.Fa type +is neither +.Dv X509_LU_X509 +nor +.Dv X509_LU_CRL +or if no match is found. +.Pp +.Fn X509_OBJECT_retrieve_match +returns the first mathching +.Vt X509_OBJECT +or +.Dv NULL +if +.Fa stack +or +.Fa obj +is +.Dv NULL +or no match is found. +.Sh SEE ALSO +.Xr X509_STORE_get0_objects 3 , +.Xr X509_STORE_load_locations 3 , +.Xr X509_STORE_new 3 +.\" The type X509_OBJECT is also used +.\" by the following undocumented public functions: +.\" X509_STORE_get_by_subject +.\" X509_LOOKUP_by_subject +.\" X509_LOOKUP_by_issuer_serial +.\" X509_LOOKUP_by_fingerprint +.\" X509_LOOKUP_by_alias +.Sh HISTORY +.Fn X509_OBJECT_up_ref_count +and +.Fn X509_OBJECT_free_contents +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn X509_OBJECT_idx_by_subject , +.Fn X509_OBJECT_retrieve_by_subject , +and +.Fn X509_OBJECT_retrieve_match +first appeared in OpenSSL 0.9.6 and have been available since +.Ox 2.9 . +.Pp +.Fn X509_OBJECT_get_type , +.Fn X509_OBJECT_get0_X509 , +and +.Fn X509_OBJECT_get0_X509_CRL +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . diff --git a/man/X509_PUBKEY_new.3 b/man/X509_PUBKEY_new.3 index 7ed3e68b..d5af722e 100644 --- a/man/X509_PUBKEY_new.3 +++ b/man/X509_PUBKEY_new.3 @@ -1,5 +1,5 @@ -.\" $OpenBSD: X509_PUBKEY_new.3,v 1.5 2016/12/28 14:06:06 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: X509_PUBKEY_new.3,v 1.13 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2016 The OpenSSL Project. All rights reserved. @@ -48,13 +48,14 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_PUBKEY_NEW 3 .Os .Sh NAME .Nm X509_PUBKEY_new , .Nm X509_PUBKEY_free , .Nm X509_PUBKEY_set , +.Nm X509_PUBKEY_get0 , .Nm X509_PUBKEY_get , .Nm d2i_PUBKEY , .Nm i2d_PUBKEY , @@ -79,6 +80,10 @@ .Fa "EVP_PKEY *pkey" .Fc .Ft EVP_PKEY * +.Fo X509_PUBKEY_get0 +.Fa "X509_PUBKEY *key" +.Fc +.Ft EVP_PKEY * .Fo X509_PUBKEY_get .Fa "X509_PUBKEY *key" .Fc @@ -167,10 +172,15 @@ is not .Dv NULL , any existing public key structure will be freed. .Pp -.Fn X509_PUBKEY_get +.Fn X509_PUBKEY_get0 returns the public key contained in .Fa key . -The reference +The returned value is an internal pointer which must not be freed after use. +.Pp +.Fn X509_PUBKEY_get +is similar to +.Fn X509_PUBKEY_get0 +except that the reference count on the returned key is incremented so it must be freed using .Xr EVP_PKEY_free 3 after use. @@ -240,6 +250,7 @@ and sets an error code that can be obtained by .Xr ERR_get_error 3 . Otherwise it returns a pointer to the newly allocated structure. .Pp +.Fn X509_PUBKEY_get0 , .Fn X509_PUBKEY_get , .Fn d2i_PUBKEY , .Fn d2i_PUBKEY_bio , @@ -265,8 +276,44 @@ return 1 for success and 0 if an error occurred. .Sh SEE ALSO .Xr d2i_X509 3 , .Xr ERR_get_error 3 , +.Xr EVP_PKEY_asn1_set_public 3 , .Xr X509_ALGOR_new 3 , .Xr X509_get_pubkey 3 .Sh STANDARDS RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile +.Sh HISTORY +.Fn X509_PUBKEY_new +and +.Fn X509_PUBKEY_free +appeared in SSLeay 0.4 or earlier. +.Fn X509_PUBKEY_set +and +.Fn X509_PUBKEY_get +first appeared in SSLeay 0.8.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn d2i_PUBKEY +and +.Fn i2d_PUBKEY +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn d2i_PUBKEY_bio , +.Fn d2i_PUBKEY_fp , +.Fn i2d_PUBKEY_fp , +and +.Fn i2d_PUBKEY_bio +first appeared in OpenSSL 0.9.6 and have been available since +.Ox 2.9 . +.Pp +.Fn X509_PUBKEY_set0_param +and +.Fn X509_PUBKEY_get0_param +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . +.Pp +.Fn X509_PUBKEY_get0 +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/X509_REQ_new.3 b/man/X509_REQ_new.3 index 76da1258..8d000328 100644 --- a/man/X509_REQ_new.3 +++ b/man/X509_REQ_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_REQ_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: X509_REQ_new.3,v 1.5 2018/07/29 20:29:32 tb Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: July 29 2018 $ .Dt X509_REQ_NEW 3 .Os .Sh NAME @@ -47,6 +47,11 @@ information about the signature algorithm used. .Fn X509_REQ_free frees .Fa req . +If +.Fa req +is a +.Dv NULL +pointer, no action occurs. .Pp .Fn X509_REQ_INFO_new allocates and initializes an empty @@ -61,6 +66,11 @@ certificate and additional attributes. .Fn X509_REQ_INFO_free frees .Fa req_info . +If +.Fa req_info +is a +.Dv NULL +pointer, no action occurs. .Sh RETURN VALUES .Fn X509_REQ_new and @@ -82,3 +92,11 @@ if an error occurs. .Xr X509_REQ_sign 3 .Sh STANDARDS RFC 2986: PKCS #10: Certification Request Syntax Specification +.Sh HISTORY +.Fn X509_REQ_new , +.Fn X509_REQ_free , +.Fn X509_REQ_INFO_new , +and +.Fn X509_REQ_INFO_free +first appeared in SSLeay 0.4.4 and have been available since +.Ox 2.4 . diff --git a/man/X509_REVOKED_new.3 b/man/X509_REVOKED_new.3 index f06075fc..03f45b16 100644 --- a/man/X509_REVOKED_new.3 +++ b/man/X509_REVOKED_new.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: X509_REVOKED_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ -.\" OpenSSL X509_CRL_get0_by_serial.pod 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: X509_REVOKED_new.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: +.\" OpenSSL man3/X509_CRL_get0_by_serial cdd6c8c5 Mar 20 12:29:37 2017 +0100 .\" .\" This file is a derived work. .\" The changes are covered by the following Copyright and license: @@ -65,21 +66,36 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_REVOKED_NEW 3 .Os .Sh NAME .Nm X509_REVOKED_new , +.Nm X509_REVOKED_dup , .Nm X509_REVOKED_free , +.Nm X509_REVOKED_get0_serialNumber , +.Nm X509_REVOKED_get0_revocationDate , .Nm X509_REVOKED_set_serialNumber , .Nm X509_REVOKED_set_revocationDate -.Nd create and change an X.509 CRL revoked entry +.Nd create, change, and inspect an X.509 CRL revoked entry .Sh SYNOPSIS .In openssl/x509.h .Ft X509_REVOKED * .Fn X509_REVOKED_new void +.Ft X509_REVOKED * +.Fo X509_REVOKED_dup +.Fa "X509_REVOKED *r" +.Fc .Ft void .Fn X509_REVOKED_free "X509_REVOKED *r" +.Ft const ASN1_INTEGER * +.Fo X509_REVOKED_get0_serialNumber +.Fa "const X509_REVOKED *r" +.Fc +.Ft const ASN1_TIME * +.Fo X509_REVOKED_get0_revocationDate +.Fa "const X509_REVOKED *r" +.Fc .Ft int .Fo X509_REVOKED_set_serialNumber .Fa "X509_REVOKED *r" @@ -104,6 +120,10 @@ objects and can hold information about one revoked certificate including issuer names, serial number, revocation date, and revocation reason. .Pp +.Fn X509_REVOKED_dup +creates a deep copy of +.Fa r . +.Pp .Fn X509_REVOKED_free frees .Fa r . @@ -127,12 +147,22 @@ The supplied pointer is not used internally so it should be freed up after use. .Sh RETURN VALUES .Fn X509_REVOKED_new -returns the new +and +.Fn X509_REVOKED_dup +return the new .Vt X509_REVOKED object or .Dv NULL if an error occurs. .Pp +.Fn X509_REVOKED_get0_serialNumber +returns an internal pointer to the serial number of +.Fa r . +.Pp +.Fn X509_REVOKED_get0_revocationDate +returns an internal pointer to the revocation date of +.Fa r . +.Pp .Fn X509_REVOKED_set_serialNumber and .Fn X509_REVOKED_set_revocationDate @@ -141,7 +171,31 @@ return 1 for success or 0 for failure. .Xr d2i_X509_CRL 3 , .Xr ERR_get_error 3 , .Xr PEM_read_X509_CRL 3 , -.Xr X509_CRL_get0_by_serial 3 +.Xr X509_CRL_get0_by_serial 3 , +.Xr X509_EXTENSION_new 3 , +.Xr X509_REVOKED_get_ext 3 , +.Xr X509_REVOKED_get_ext_d2i 3 .Sh STANDARDS RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 5.1: CRL Fields +.Sh HISTORY +.Fn X509_REVOKED_new +and +.Fn X509_REVOKED_free +first appeared in SSLeay 0.4.4 and have been available since +.Ox 2.4 . +.Pp +.Fn X509_REVOKED_set_serialNumber +and +.Fn X509_REVOKED_set_revocationDate +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp +.Fn X509_REVOKED_dup +first appeared in OpenSSL 1.0.2. +.Fn X509_REVOKED_get0_serialNumber +and +.Fn X509_REVOKED_get0_revocationDate +first appeared in OpenSSL 1.1.0. +These functions have been available since +.Ox 6.3 . diff --git a/man/X509_SIG_new.3 b/man/X509_SIG_new.3 index 6d41abab..79a71252 100644 --- a/man/X509_SIG_new.3 +++ b/man/X509_SIG_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_SIG_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $ +.\" $OpenBSD: X509_SIG_new.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_SIG_NEW 3 .Os .Sh NAME @@ -59,3 +59,9 @@ section 9: Signed-data content type .Pp RFC 8017: PKCS #1: RSA Cryptography Specifications, section 9: Encoding Methods for Signatures +.Sh HISTORY +.Fn X509_SIG_new +and +.Fn X509_SIG_free +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . diff --git a/man/X509_STORE_CTX_get_error.3 b/man/X509_STORE_CTX_get_error.3 index 3a871ef3..06021bb5 100644 --- a/man/X509_STORE_CTX_get_error.3 +++ b/man/X509_STORE_CTX_get_error.3 @@ -1,5 +1,9 @@ -.\" $OpenBSD: X509_STORE_CTX_get_error.3,v 1.5 2016/12/25 22:15:10 schwarze Exp $ -.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" $OpenBSD: X509_STORE_CTX_get_error.3,v 1.11 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: +.\" OpenSSL crypto/X509_STORE_CTX_get_error f0e0fd51 Apr 14 23:59:26 2016 -0400 +.\" selective merge up to: +.\" OpenSSL man3/X509_STORE_CTX_get_error 2947af32 Nov 19 00:10:05 2016 +0100 +.\" OpenSSL man3/X509_STORE_CTX_new 7643a172 Apr 21 13:35:51 2017 +0200 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2009, 2013, 2015, 2016 The OpenSSL Project. @@ -49,7 +53,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_STORE_CTX_GET_ERROR 3 .Os .Sh NAME @@ -57,6 +61,8 @@ .Nm X509_STORE_CTX_set_error , .Nm X509_STORE_CTX_get_error_depth , .Nm X509_STORE_CTX_get_current_cert , +.Nm X509_STORE_CTX_get0_cert , +.Nm X509_STORE_CTX_get0_chain , .Nm X509_STORE_CTX_get1_chain , .Nm X509_verify_cert_error_string .Nd get or set certificate verification status information @@ -79,6 +85,14 @@ .Fo X509_STORE_CTX_get_current_cert .Fa "X509_STORE_CTX *ctx" .Fc +.Ft X509 * +.Fo X509_STORE_CTX_get0_cert +.Fa "X509_STORE_CTX *ctx" +.Fc +.Ft STACK_OF(X509) * +.Fo X509_STORE_CTX_get0_chain +.Fa "X509_STORE_CTX *ctx" +.Fc .Ft STACK_OF(X509) * .Fo X509_STORE_CTX_get1_chain .Fa "X509_STORE_CTX *ctx" @@ -122,19 +136,19 @@ which caused the error or .Dv NULL if no certificate is relevant. .Pp -.Fn X509_STORE_CTX_get1_chain -returns a complete validate chain if a previous call to +.Fn X509_STORE_CTX_get0_chain +returns an internal pointer to a complete validate chain +if a previous call to .Xr X509_verify_cert 3 -is successful. +was successful. If the call to .Xr X509_verify_cert 3 -is -.Sy not -successful, the returned chain may be incomplete or invalid. -The returned chain persists after the +was not successful, the returned chain may be incomplete or invalid. +.Fn X509_STORE_CTX_get1_chain +returns a deep copy of the same chain which persists even after the .Fa ctx structure is freed. -When it is no longer needed, it should be freed up using +When it is no longer needed, it should be freed using .Fn sk_X509_pop_free chain X509_free . .Pp .Fn X509_verify_cert_error_string @@ -172,6 +186,17 @@ returns the certificate which caused the error or .Dv NULL if no certificate is relevant to the error. .Pp +.Fn X509_STORE_CTX_get0_cert +retrieves an internal pointer to the certificate being verified by +.Fa ctx . +.Pp +.Fn X509_STORE_CTX_get0_chain +and +.Fn X509_STORE_CTX_get1_chain +return a pointer to a stack of certificates or +.Dv NULL +if an error occurs. +.Pp .Fn X509_verify_cert_error_string returns a human readable error string for verification error .Fa n . @@ -346,4 +371,25 @@ An application specific error. This will never be returned unless explicitly set by an application. .El .Sh SEE ALSO +.Xr X509_STORE_CTX_new 3 , +.Xr X509_up_ref 3 , .Xr X509_verify_cert 3 +.Sh HISTORY +.Fn X509_STORE_CTX_get_error , +.Fn X509_STORE_CTX_set_error , +.Fn X509_STORE_CTX_get_error_depth , +.Fn X509_STORE_CTX_get_current_cert , +and +.Fn X509_verify_cert_error_string +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn X509_STORE_CTX_get1_chain +first appeared in OpenSSL 0.9.5 and has been available since +.Ox 2.7 . +.Pp +.Fn X509_STORE_CTX_get0_cert +and +.Fn X509_STORE_CTX_get0_chain +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . diff --git a/man/X509_STORE_CTX_get_ex_new_index.3 b/man/X509_STORE_CTX_get_ex_new_index.3 index a900b8e7..658bc970 100644 --- a/man/X509_STORE_CTX_get_ex_new_index.3 +++ b/man/X509_STORE_CTX_get_ex_new_index.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_STORE_CTX_get_ex_new_index.3,v 1.3 2016/12/10 20:13:59 schwarze Exp $ +.\" $OpenBSD: X509_STORE_CTX_get_ex_new_index.3,v 1.4 2018/03/21 07:41:44 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt X509_STORE_CTX_GET_EX_NEW_INDEX 3 .Os .Sh NAME @@ -101,4 +101,5 @@ structure. .Fn X509_STORE_CTX_set_ex_data , and .Fn X509_STORE_CTX_get_ex_data -are available since OpenSSL 0.9.5. +first appeared in SSLeay 0.9.0 and have been available since +.Ox 2.4 . diff --git a/man/X509_STORE_CTX_new.3 b/man/X509_STORE_CTX_new.3 index 50e50fd5..581c6b2f 100644 --- a/man/X509_STORE_CTX_new.3 +++ b/man/X509_STORE_CTX_new.3 @@ -1,8 +1,10 @@ -.\" $OpenBSD: X509_STORE_CTX_new.3,v 1.5 2017/01/07 03:01:44 schwarze Exp $ -.\" OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700 +.\" $OpenBSD: X509_STORE_CTX_new.3,v 1.18 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700 +.\" selective merge up to: OpenSSL 7643a172 Apr 21 13:35:51 2017 +0200 .\" -.\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2009, 2015 The OpenSSL Project. All rights reserved. +.\" This file was written by Dr. Stephen Henson +.\" and Rich Salz . +.\" Copyright (c) 2009, 2015, 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 @@ -48,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 7 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_STORE_CTX_NEW 3 .Os .Sh NAME @@ -56,12 +58,17 @@ .Nm X509_STORE_CTX_cleanup , .Nm X509_STORE_CTX_free , .Nm X509_STORE_CTX_init , +.Nm X509_STORE_CTX_get0_store , +.Nm X509_STORE_CTX_set0_trusted_stack , .Nm X509_STORE_CTX_trusted_stack , .Nm X509_STORE_CTX_set_cert , +.\" X509_STORE_CTX_get0_chain moved to X509_STORE_CTX_get_error(3) .Nm X509_STORE_CTX_set_chain , .Nm X509_STORE_CTX_set0_crls , .Nm X509_STORE_CTX_get0_param , .Nm X509_STORE_CTX_set0_param , +.Nm X509_STORE_CTX_get0_untrusted , +.Nm X509_STORE_CTX_set0_untrusted , .Nm X509_STORE_CTX_set_default .Nd X509_STORE_CTX initialisation .Sh SYNOPSIS @@ -83,6 +90,15 @@ .Fa "X509 *x509" .Fa "STACK_OF(X509) *chain" .Fc +.Ft X509_STORE * +.Fo X509_STORE_CTX_get0_store +.Fa "X509_STORE_CTX *ctx" +.Fc +.Ft void +.Fo X509_STORE_CTX_set0_trusted_stack +.Fa "X509_STORE_CTX *ctx" +.Fa "STACK_OF(X509) *sk" +.Fc .Ft void .Fo X509_STORE_CTX_trusted_stack .Fa "X509_STORE_CTX *ctx" @@ -117,6 +133,15 @@ .Fa "X509_STORE_CTX *ctx" .Fa "const char *name" .Fc +.Ft STACK_OF(X509)* +.Fo X509_STORE_CTX_get0_untrusted +.Fa "X509_STORE_CTX *ctx" +.Fc +.Ft void +.Fo X509_STORE_CTX_set0_untrusted +.Fa "X509_STORE_CTX *ctx" +.Fa "STACK_OF(X509) *sk" +.Fc .Sh DESCRIPTION These functions initialise an .Vt X509_STORE_CTX @@ -166,7 +191,13 @@ and parameters can be .Dv NULL . .Pp -.Fn X509_STORE_CTX_trusted_stack +.Fn X509_STORE_CTX_get0_store +returns an internal pointer to the trusted certificate +.Fa store +that was set with +.Fn X509_STORE_CTX_init . +.Pp +.Fn X509_STORE_CTX_set0_trusted_stack sets the set of trusted certificates of .Fa ctx to @@ -174,6 +205,9 @@ to This is an alternative way of specifying trusted certificates instead of using an .Vt X509_STORE . +.Fn X509_STORE_CTX_trusted_stack +is a deprecated alias for +.Fn X509_STORE_CTX_set0_trusted_stack . .Pp .Fn X509_STORE_CTX_set_cert sets the certificate to be verified in @@ -213,10 +247,22 @@ should not be used. looks up and sets the default verification method to .Fa name . This uses the function -.Fn X509_VERIFY_PARAM_lookup +.Xr X509_VERIFY_PARAM_lookup 3 to find an appropriate set of parameters from .Fa name . .Pp +.Fn X509_STORE_CTX_get0_untrusted +retrieves an internal pointer +to the stack of untrusted certificates associated with +.Fa ctx . +.Pp +.Fn X509_STORE_CTX_set0_untrusted +sets the internal pointer +to the stack of untrusted certificates associated with +.Fa ctx +to +.Fa sk . +.Pp The certificates and CRLs in a store are used internally and should .Sy not be freed up until after the associated @@ -250,6 +296,13 @@ if an error occurred. .Fn X509_STORE_CTX_init returns 1 for success or 0 if an error occurred. .Pp +.Fn X509_STORE_CTX_get0_store +returns a pointer to the trusted certificate store or +.Dv NULL +if +.Fa ctx +was not initialised. +.Pp .Fn X509_STORE_CTX_get0_param returns a pointer to an .Vt X509_VERIFY_PARAM @@ -257,24 +310,53 @@ structure or .Dv NULL if an error occurred. .Pp -.Fn X509_STORE_CTX_cleanup , -.Fn X509_STORE_CTX_free , -.Fn X509_STORE_CTX_trusted_stack , -.Fn X509_STORE_CTX_set_cert , -.Fn X509_STORE_CTX_set_chain , -.Fn X509_STORE_CTX_set0_crls , -and -.Fn X509_STORE_CTX_set0_param -do not return values. -.Pp .Fn X509_STORE_CTX_set_default returns 1 for success or 0 if an error occurred. +.Pp +.Fn X509_STORE_CTX_get0_untrusted +returns an internal pointer. .Sh SEE ALSO +.Xr X509_STORE_CTX_get_error 3 , +.Xr X509_STORE_new 3 , +.Xr X509_STORE_set1_param 3 , .Xr X509_verify_cert 3 , .Xr X509_VERIFY_PARAM_set_flags 3 .Sh HISTORY -.Fn X509_STORE_CTX_set0_crls -was first added to OpenSSL 1.0.0. +.Fn X509_STORE_CTX_cleanup , +.Fn X509_STORE_CTX_init , +.Fn X509_STORE_CTX_set_cert , +and +.Fn X509_STORE_CTX_set_chain +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn X509_STORE_CTX_new +and +.Fn X509_STORE_CTX_free +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn X509_STORE_CTX_trusted_stack +first appeared in OpenSSL 0.9.6 and has been available since +.Ox 2.9 . +.Pp +.Fn X509_STORE_CTX_set0_crls , +.Fn X509_STORE_CTX_get0_param , +.Fn X509_STORE_CTX_set0_param , +and +.Fn X509_STORE_CTX_set_default +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Pp +.Fn X509_STORE_CTX_get0_store +first appeared in OpenSSL 1.0.2. +.Fn X509_STORE_CTX_set0_trusted_stack , +.Fn X509_STORE_CTX_get0_untrusted , +and +.Fn X509_STORE_CTX_set0_untrusted +first appeared in OpenSSL 1.1.0. +These functions have been available since +.Ox 6.3 . .Sh BUGS The certificates and CRLs in a context are used internally and should .Sy not diff --git a/man/X509_STORE_CTX_set_verify_cb.3 b/man/X509_STORE_CTX_set_verify_cb.3 index e6cdb324..0af222fb 100644 --- a/man/X509_STORE_CTX_set_verify_cb.3 +++ b/man/X509_STORE_CTX_set_verify_cb.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_STORE_CTX_set_verify_cb.3,v 1.3 2016/12/05 13:39:33 schwarze Exp $ +.\" $OpenBSD: X509_STORE_CTX_set_verify_cb.3,v 1.4 2018/03/22 17:38:08 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 5 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt X509_STORE_CTX_SET_VERIFY_CB 3 .Os .Sh NAME @@ -224,7 +224,8 @@ verify_callback(int ok, X509_STORE_CTX *ctx) .Xr X509_STORE_set_verify_cb_func 3 .Sh HISTORY .Fn X509_STORE_CTX_set_verify_cb -is available in all versions of SSLeay and OpenSSL. +first appeared in OpenSSL 0.9.6c and has been available since +.Ox 3.2 . .Sh CAVEATS In general a verification callback should .Sy NOT diff --git a/man/X509_STORE_load_locations.3 b/man/X509_STORE_load_locations.3 index 8f1f41fe..ad64bd03 100644 --- a/man/X509_STORE_load_locations.3 +++ b/man/X509_STORE_load_locations.3 @@ -1,4 +1,6 @@ -.\" $OpenBSD: X509_STORE_load_locations.3,v 1.2 2017/01/07 08:46:13 jmc Exp $ +.\" $OpenBSD: X509_STORE_load_locations.3,v 1.6 2018/03/30 00:44:24 schwarze Exp $ +.\" full merge up to: +.\" OpenSSL X509_STORE_add_cert b0edda11 Mar 20 13:00:17 2018 +0000 .\" .\" Copyright (c) 2017 Ingo Schwarze .\" @@ -14,7 +16,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 7 2017 $ +.Dd $Mdocdate: March 30 2018 $ .Dt X509_STORE_LOAD_LOCATIONS 3 .Os .Sh NAME @@ -44,6 +46,8 @@ contained in the colon-separated list .Fa dirs for looking up certificates, in addition to files and directories that are already configured. +The certificates in the directores must be in hashed form, as documented in +.Xr X509_LOOKUP_hash_dir 3 . Directories already in use are not added again. If .Dv NULL @@ -105,8 +109,15 @@ default directory for .Sh SEE ALSO .Xr SSL_CTX_load_verify_locations 3 , .Xr X509_LOOKUP_hash_dir 3 , +.Xr X509_STORE_new 3 , .Xr X509_STORE_set1_param 3 , .Xr X509_STORE_set_verify_cb 3 +.Sh HISTORY +.Fn X509_STORE_load_locations +and +.Fn X509_STORE_set_default_paths +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . .Sh BUGS By the time that adding a directory is found to have failed, the file and some other directories may already have been successfully loaded, diff --git a/man/X509_STORE_new.3 b/man/X509_STORE_new.3 new file mode 100644 index 00000000..814e5cfc --- /dev/null +++ b/man/X509_STORE_new.3 @@ -0,0 +1,140 @@ +.\" $OpenBSD: X509_STORE_new.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL 05ea606a May 20 20:52:46 2016 -0400 +.\" selective merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by +.\" Alessandro Ghedini . +.\" Copyright (c) 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. +.\" +.Dd $Mdocdate: March 27 2018 $ +.Dt X509_STORE_NEW 3 +.Os +.Sh NAME +.Nm X509_STORE_new , +.Nm X509_STORE_up_ref , +.Nm X509_STORE_free +.Nd allocate and free X.509 certificate stores +.Sh SYNOPSIS +.In openssl/x509_vfy.h +.Ft X509_STORE * +.Fn X509_STORE_new void +.Ft int +.Fo X509_STORE_up_ref +.Fa "X509_STORE *store" +.Fc +.Ft void +.Fo X509_STORE_free +.Fa "X509_STORE *store" +.Fc +.Sh DESCRIPTION +.Fn X509_STORE_new +allocates and initializes an empty X.509 certificate store +and sets its reference count to 1. +.Pp +.Fn X509_STORE_up_ref +increments the reference count of +.Fa store +by 1. +.Pp +.Fn X509_STORE_free +decrements the reference count of +.Fa store +by 1. +If the reference count reaches 0, +all resources used by the store, including all certificates +contained in it, are released and +.Fa store +itself is freed. +If +.Fa store +is a +.Dv NULL +pointer, no action occurs. +.Sh RETURN VALUES +.Fn X509_STORE_new +returns a newly created +.Vt X509_STORE +object or +.Dv NULL +if an error occurs. +.Pp +.Fn X509_STORE_up_ref +returns 1 for success and 0 for failure. +.Sh SEE ALSO +.Xr PKCS7_verify 3 , +.Xr SSL_CTX_set_cert_store 3 , +.Xr X509_STORE_CTX_new 3 , +.Xr X509_STORE_load_locations 3 , +.Xr X509_STORE_set1_param 3 , +.Xr X509_STORE_set_verify_cb 3 +.Sh HISTORY +.Fn X509_STORE_new +and +.Fn X509_STORE_free +first appeared in SSLeay 0.8.0 and have been available since +.Ox 2.4 . +.Pp +.Fn X509_STORE_up_ref +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/X509_STORE_set1_param.3 b/man/X509_STORE_set1_param.3 index 00005851..ea6e399e 100644 --- a/man/X509_STORE_set1_param.3 +++ b/man/X509_STORE_set1_param.3 @@ -1,72 +1,227 @@ -.\" $OpenBSD: X509_STORE_set1_param.3,v 1.3 2017/01/06 22:46:06 schwarze Exp $ -.\" OpenSSL 99d63d46 +.\" $OpenBSD: X509_STORE_set1_param.3,v 1.15 2018/04/02 01:35:37 schwarze Exp $ +.\" content checked up to: +.\" OpenSSL man3/X509_STORE_add_cert b0edda11 Mar 20 13:00:17 2018 +0000 +.\" OpenSSL man3/X509_STORE_get0_param e90fc053 Jul 15 09:39:45 2017 -0400 .\" -.\" This file was written by Christian Heimes . -.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2018 Ingo Schwarze .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.\" 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. -.\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: April 2 2018 $ .Dt X509_STORE_SET1_PARAM 3 .Os .Sh NAME -.Nm X509_STORE_set1_param -.Nd set X509_STORE verification parameters +.Nm X509_STORE_set1_param , +.Nm X509_STORE_set_flags , +.Nm X509_STORE_set_purpose , +.Nm X509_STORE_set_trust , +.Nm X509_STORE_set_depth , +.Nm X509_STORE_add_cert , +.Nm X509_STORE_add_crl , +.Nm X509_STORE_get0_param , +.Nm X509_STORE_get0_objects , +.Nm X509_STORE_get_ex_new_index , +.Nm X509_STORE_set_ex_data , +.Nm X509_STORE_get_ex_data +.Nd get and set X509_STORE data .Sh SYNOPSIS .In openssl/x509_vfy.h .Ft int .Fo X509_STORE_set1_param -.Fa "X509_STORE *ctx" +.Fa "X509_STORE *store" .Fa "X509_VERIFY_PARAM *pm" .Fc +.Ft int +.Fo X509_STORE_set_flags +.Fa "X509_STORE *store" +.Fa "unsigned long flags" +.Fc +.Ft int +.Fo X509_STORE_set_purpose +.Fa "X509_STORE *store" +.Fa "int purpose" +.Fc +.Ft int +.Fo X509_STORE_set_trust +.Fa "X509_STORE *store" +.Fa "int trust" +.Fc +.Ft int +.Fo X509_STORE_set_depth +.Fa "X509_STORE *store" +.Fa "int depth" +.Fc +.Ft int +.Fo X509_STORE_add_cert +.Fa "X509_STORE *store" +.Fa "X509 *x" +.Fc +.Ft int +.Fo X509_STORE_add_crl +.Fa "X509_STORE *store" +.Fa "X509_CRL *crl" +.Fc +.Ft X509_VERIFY_PARAM * +.Fo X509_STORE_get0_param +.Fa "X509_STORE *store" +.Fc +.Ft STACK_OF(X509_OBJECT) * +.Fo X509_STORE_get0_objects +.Fa "X509_STORE *store" +.Fc +.Ft int +.Fo X509_STORE_get_ex_new_index +.Fa "long argl" +.Fa "void *argp" +.Fa "CRYPTO_EX_new *new_func" +.Fa "CRYPTO_EX_dup *dup_func" +.Fa "CRYPTO_EX_free *free_func" +.Fc +.Ft int +.Fo X509_STORE_set_ex_data +.Fa "X509_STORE *store" +.Fa "int idx" +.Fa "void *arg" +.Fc +.Ft void * +.Fo X509_STORE_get_ex_data +.Fa "X509_STORE *store" +.Fa "int idx" +.Fc .Sh DESCRIPTION .Fn X509_STORE_set1_param -sets the verification parameters to +copies the verification parameters from .Fa pm -for -.Fa ctx . +into the verification parameter object contained in the +.Fa store . +.Pp +.Fn X509_VERIFY_PARAM_set_flags , +.Fn X509_STORE_set_purpose , +.Fn X509_STORE_set_trust , +and +.Fn X509_STORE_set_depth +call +.Fn X509_VERIFY_PARAM_set_flags , +.Fn X509_VERIFY_PARAM_set_purpose , +.Fn X509_VERIFY_PARAM_set_trust , +and +.Fn X509_VERIFY_PARAM_set_depth +on the verification parameter object contained in the +.Fa store . +.Pp +.Fn X509_STORE_add_cert +and +.Fn X509_STORE_add_crl +add the certificate +.Fa x +or the certificate revocation list +.Fa crl +to the +.Fa store , +increasing its reference count by 1 in case of success. +Untrusted objects should not be added in this way. +.Pp +.Fn X509_STORE_get_ex_new_index , +.Fn X509_STORE_set_ex_data , +and +.Fn X509_STORE_get_ex_data +handle application specific data in +.Vt X509_STORE +objects. +Their usage is identical to that of +.Xr RSA_get_ex_new_index 3 , +.Xr RSA_set_ex_data 3 , +and +.Xr RSA_get_ex_data 3 . .Sh RETURN VALUES +.Fn X509_STORE_set1_param , +.Fn X509_STORE_set_purpose , +.Fn X509_STORE_set_trust , +and +.Fn X509_STORE_set_ex_data +return 1 for success or 0 for failure. +.Pp +.Fn X509_STORE_set_flags +and +.Fn X509_STORE_set_depth +always return 1, indicating success. +.Pp +.Fn X509_STORE_add_cert +and +.Fn X509_STORE_add_crl +return 1 for success or 0 for failure. +For example, they fail if +.Fa x +or +.Fa crl +is a +.Dv NULL +pointer, if a certificate with the same subject name as +.Fa x +or a revocation list with the same issuer name as +.Fa crl +are already contained in the +.Fa store , +or if memory allocation fails. +.Pp +.Fn X509_STORE_get0_param +returns an internal pointer to the verification parameter object +contained in the +.Fa store , +.Fn X509_STORE_get0_objects +to the stack of certificates, revocation lists, and private keys. +The returned pointers must not be freed by the calling application. +.Pp +.Fn X509_STORE_get_ex_new_index +returns a new index or \-1 on failure. +.Pp +.Fn X509_STORE_get_ex_data +returns the application data or +.Dv NULL +on failure. +.Sh SEE ALSO +.Xr SSL_set1_param 3 , +.Xr X509_OBJECT_get0_X509 3 , +.Xr X509_STORE_CTX_set0_param 3 , +.Xr X509_STORE_load_locations 3 , +.Xr X509_STORE_new 3 , +.Xr X509_VERIFY_PARAM_set_flags 3 +.Sh HISTORY +.Fn X509_STORE_add_cert +first appeared in SSLeay 0.8.0. +.Fn X509_STORE_add_crl +first appeared in SSLeay 0.9.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn X509_STORE_set_flags , +.Fn X509_STORE_set_purpose , +and +.Fn X509_STORE_set_trust +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . +.Pp .Fn X509_STORE_set1_param -returns 1 for success and 0 for failure. +and +.Fn X509_STORE_set_depth +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . +.Pp +.Fn X509_STORE_get0_param , +.Fn X509_STORE_get0_objects , +.Fn X509_STORE_get_ex_new_index , +.Fn X509_STORE_set_ex_data , +and +.Fn X509_STORE_get_ex_data +first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . diff --git a/man/X509_STORE_set_verify_cb_func.3 b/man/X509_STORE_set_verify_cb_func.3 index 3baccfba..16f1fac2 100644 --- a/man/X509_STORE_set_verify_cb_func.3 +++ b/man/X509_STORE_set_verify_cb_func.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_STORE_set_verify_cb_func.3,v 1.4 2016/12/10 20:34:57 schwarze Exp $ +.\" $OpenBSD: X509_STORE_set_verify_cb_func.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_STORE_SET_VERIFY_CB_FUNC 3 .Os .Sh NAME @@ -92,13 +92,16 @@ and .Fn X509_STORE_set_verify_cb_func do not return a value. .Sh SEE ALSO -.Xr X509_STORE_CTX_set_verify_cb 3 +.Xr X509_STORE_CTX_set_verify_cb 3 , +.Xr X509_STORE_new 3 .Sh HISTORY .Fn X509_STORE_set_verify_cb_func -is available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . .Pp .Fn X509_STORE_set_verify_cb -was added to OpenSSL 1.0.0. +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . .Sh BUGS The macro version of this function was the only one available before OpenSSL 1.0.0. diff --git a/man/X509_VERIFY_PARAM_set_flags.3 b/man/X509_VERIFY_PARAM_set_flags.3 index bb9b0e12..5e452786 100644 --- a/man/X509_VERIFY_PARAM_set_flags.3 +++ b/man/X509_VERIFY_PARAM_set_flags.3 @@ -1,8 +1,28 @@ -.\" $OpenBSD: X509_VERIFY_PARAM_set_flags.3,v 1.5 2017/01/06 21:30:27 schwarze Exp $ -.\" OpenSSL 2b4ffc65 Dec 23 19:28:30 2013 +0100 +.\" $OpenBSD: X509_VERIFY_PARAM_set_flags.3,v 1.14 2018/04/07 13:57:43 jmc Exp $ +.\" full merge up to: OpenSSL d33def66 Feb 9 14:17:13 2016 -0500 +.\" selective merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100 .\" -.\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2009, 2013 The OpenSSL Project. All rights reserved. +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Dr. Stephen Henson +.\" and Viktor Dukhovni . +.\" Copyright (c) 2009, 2013, 2014, 2015, 2016, 2017 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 @@ -48,10 +68,14 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: April 7 2018 $ .Dt X509_VERIFY_PARAM_SET_FLAGS 3 .Os .Sh NAME +.Nm X509_VERIFY_PARAM_new , +.Nm X509_VERIFY_PARAM_free , +.Nm X509_VERIFY_PARAM_get0_name , +.Nm X509_VERIFY_PARAM_set1_name , .Nm X509_VERIFY_PARAM_set_flags , .Nm X509_VERIFY_PARAM_clear_flags , .Nm X509_VERIFY_PARAM_get_flags , @@ -61,10 +85,39 @@ .Nm X509_VERIFY_PARAM_add0_policy , .Nm X509_VERIFY_PARAM_set1_policies , .Nm X509_VERIFY_PARAM_set_depth , -.Nm X509_VERIFY_PARAM_get_depth +.Nm X509_VERIFY_PARAM_get_depth , +.Nm X509_VERIFY_PARAM_set1_host , +.Nm X509_VERIFY_PARAM_add1_host , +.Nm X509_VERIFY_PARAM_set_hostflags , +.Nm X509_VERIFY_PARAM_get0_peername , +.Nm X509_VERIFY_PARAM_set1_email , +.Nm X509_VERIFY_PARAM_set1_ip , +.Nm X509_VERIFY_PARAM_set1_ip_asc , +.Nm X509_VERIFY_PARAM_add0_table , +.Nm X509_VERIFY_PARAM_lookup , +.Nm X509_VERIFY_PARAM_get_count , +.Nm X509_VERIFY_PARAM_get0 , +.Nm X509_VERIFY_PARAM_table_cleanup .Nd X509 verification parameters .Sh SYNOPSIS .In openssl/x509_vfy.h +.Ft X509_VERIFY_PARAM * +.Fo X509_VERIFY_PARAM_new +.Fa void +.Fc +.Ft void +.Fo X509_VERIFY_PARAM_free +.Fa "X509_VERIFY_PARAM *param" +.Fc +.Ft const char * +.Fo X509_VERIFY_PARAM_get0_name +.Fa "const X509_VERIFY_PARAM *param" +.Fc +.Ft int +.Fo X509_VERIFY_PARAM_set1_name +.Fa "X509_VERIFY_PARAM *param" +.Fa "const char *name" +.Fc .Ft int .Fo X509_VERIFY_PARAM_set_flags .Fa "X509_VERIFY_PARAM *param" @@ -113,14 +166,112 @@ .Fo X509_VERIFY_PARAM_get_depth .Fa "const X509_VERIFY_PARAM *param" .Fc +.Ft int +.Fo X509_VERIFY_PARAM_set1_host +.Fa "X509_VERIFY_PARAM *param" +.Fa "const char *name" +.Fa "size_t namelen" +.Fc +.Ft int +.Fo X509_VERIFY_PARAM_add1_host +.Fa "X509_VERIFY_PARAM *param" +.Fa "const char *name" +.Fa "size_t namelen" +.Fc +.Ft void +.Fo X509_VERIFY_PARAM_set_hostflags +.Fa "X509_VERIFY_PARAM *param" +.Fa "unsigned int flags" +.Fc +.Ft char * +.Fo X509_VERIFY_PARAM_get0_peername +.Fa "X509_VERIFY_PARAM *param" +.Fc +.Ft int +.Fo X509_VERIFY_PARAM_set1_email +.Fa "X509_VERIFY_PARAM *param" +.Fa "const char *email" +.Fa "size_t emaillen" +.Fc +.Ft int +.Fo X509_VERIFY_PARAM_set1_ip +.Fa "X509_VERIFY_PARAM *param" +.Fa "const unsigned char *ip" +.Fa "size_t iplen" +.Fc +.Ft int +.Fo X509_VERIFY_PARAM_set1_ip_asc +.Fa "X509_VERIFY_PARAM *param" +.Fa "const char *ipasc" +.Fc +.Ft int +.Fo X509_VERIFY_PARAM_add0_table +.Fa "X509_VERIFY_PARAM *param" +.Fc +.Ft const X509_VERIFY_PARAM * +.Fo X509_VERIFY_PARAM_lookup +.Fa "const char *name" +.Fc +.Ft int +.Fo X509_VERIFY_PARAM_get_count +.Fa void +.Fc +.Ft const X509_VERIFY_PARAM * +.Fo X509_VERIFY_PARAM_get0 +.Fa "int id" +.Fc +.Ft void +.Fo X509_VERIFY_PARAM_table_cleanup +.Fa void +.Fc .Sh DESCRIPTION -These functions manipulate the +These functions manipulate an .Vt X509_VERIFY_PARAM -structure associated with a certificate verification operation. +object associated with a certificate verification operation. +.Pp +.Fn X509_VERIFY_PARAM_new +allocates and initializes an empty +.Vt X509_VERIFY_PARAM +object. +.Pp +.Fn X509_VERIFY_PARAM_free +clears all data contained in +.Fa param +and releases all memory used by it. +If +.Fa param +is a +.Dv NULL +pointer, no action occurs. +.Pp +.Fn X509_VERIFY_PARAM_get0_name +returns the name of the given +.Fa param +object, usually describing its purpose, for example +.Qq default , +.Qq pkcs7 , +.Qq smime_sign , +.Qq ssl_client , +or +.Qq ssl_server . +For user-defined objects, the returned pointer may be +.Dv NULL +even if the object is otherwise valid. +.Pp +.Fn X509_VERIFY_PARAM_set1_name +sets the name of +.Fa param +to a copy of +.Fa name , +or to +.Dv NULL +if +.Fa name +is +.Dv NULL . .Pp -The .Fn X509_VERIFY_PARAM_set_flags -function sets the flags in +sets the flags in .Fa param by OR'ing it with .Fa flags . @@ -182,26 +333,225 @@ sets the maximum verification depth to .Fa depth . That is the maximum number of untrusted CA certificates that can appear in a chain. +.Pp +.Fn X509_VERIFY_PARAM_set1_host +sets the expected DNS hostname to +.Fa name +clearing any previously specified host name or names. +If +.Fa name +is +.Dv NULL +or empty, the list of hostnames is cleared, and name checks are not +performed on the peer certificate. +.Fa namelen +should be set to the length of +.Fa name . +For historical compatibility, if +.Fa name +is NUL-terminated, +.Fa namelen +may be specified as zero. +When a hostname is specified, certificate verification automatically +invokes +.Xr X509_check_host 3 +with flags equal to the +.Fa flags +argument given to +.Fn X509_VERIFY_PARAM_set_hostflags +(default zero). +.Fn X509_VERIFY_PARAM_set1_host +will fail if +.Fa name +contains any embedded 0 bytes. +.Pp +.Fn X509_VERIFY_PARAM_add1_host +adds +.Fa name +as an additional reference identifier that can match the peer's +certificate. +Any previous names set via +.Fn X509_VERIFY_PARAM_set1_host +and +.Fn X509_VERIFY_PARAM_add1_host +are retained. +No change is made if +.Fa name +is +.Dv NULL +or empty. +.Fa namelen +should be set to the length of +.Fa name . +For historical compatibility, if +.Fa name +is NUL-terminated, +.Fa namelen +may be specified as zero. +.Fn X509_VERIFY_PARAM_add1_host +will fail if +.Fa name +contains any embedded 0 bytes. +When multiple names are configured, the peer is considered verified when +any name matches. +.Pp +.Fn X509_VERIFY_PARAM_get0_peername +returns the DNS hostname or subject CommonName from the peer certificate +that matched one of the reference identifiers. +When wildcard matching is not disabled, or when a reference identifier +specifies a parent domain (starts with ".") rather than a hostname, the +peer name may be a wildcard name or a sub-domain of the reference +identifier respectively. +.Pp +.Fn X509_VERIFY_PARAM_set1_email +sets the expected RFC822 email address to +.Fa email . +.Fa emaillen +should be set to the length of +.Fa email . +For historical compatibility, if +.Fa email +is NUL-terminated, +.Fa emaillen +may be specified as zero, +.Fn X509_VERIFY_PARAM_set1_email +will fail if +.Fa email +is NULL, an empty string, or contains embedded 0 bytes. +When an email address is specified, certificate verification +automatically invokes +.Xr X509_check_email 3 . +.Pp +.Fn X509_VERIFY_PARAM_set1_ip +sets the expected IP address to +.Fa ip . +The +.Fa ip +argument is in binary format, in network byte-order, and +.Fa iplen +must be set to 4 for IPv4 and 16 for IPv6. +.Fn X509_VERIFY_PARAM_set1_ip +will fail if +.Fa ip +is NULL or if +.Fa iplen +is not 4 or 16. +When an IP address is specified, +certificate verification automatically invokes +.Xr X509_check_ip 3 . +.Pp +.Fn X509_VERIFY_PARAM_set1_ip_asc +sets the expected IP address to +.Fa ipasc . +The +.Fa ipasc +argument is a NUL-terminal ASCII string: +dotted decimal quad for IPv4 and colon-separated hexadecimal for IPv6. +The condensed "::" notation is supported for IPv6 addresses. +.Fn X509_VERIFY_PARAM_set1_ip_asc +will fail if +.Fa ipasc +is unparsable. +.Pp +.Fn X509_VERIFY_PARAM_add0_table +adds +.Fa param +to a static list of +.Vt X509_VERIFY_PARAM +objects maintained by the library. +This function is extremely dangerous because contrary to the name +of the function, if the list already contains an object that happens +to have the same name, that old object is not only silently removed +from the list, but also silently freed, which may silently invalidate +various pointers existing elsewhere in the program. +.Pp +.Fn X509_VERIFY_PARAM_lookup +searches this list for an object of the given +.Fa name . +If no match is found, the predefined objects built-in to the library +are also inspected. +.Pp +.Fn X509_VERIFY_PARAM_get_count +returns the sum of the number of objects on this list and the number +of predefined objects built-in to the library. +Note that this is not necessarily the total number of +.Vt X509_VERIFY_PARAM +objects existing in the program because there may be additional such +objects that were never added to the list. +.Pp +.Fn X509_VERIFY_PARAM_get0 +accesses predefined and user-defined objects using +.Fa id +as an index, useful for looping over objects without knowing their names. +An argument less than the number of predefined objects selects +one of the predefined objects; a higher argument selects an object +from the list. +.Pp +.Fn X509_VERIFY_PARAM_table_cleanup +deletes all objects from this list. +It is extremely dangerous because it also invalidates all data that +was contained in all objects that were on the list and because it +frees all these objects, which may invalidate various pointers +existing elsewhere in the program. .Sh RETURN VALUES +.Fn X509_VERIFY_PARAM_new +returns a pointer to the new object, or +.Dv NULL +on allocation failure. +.Pp +.Fn X509_VERIFY_PARAM_set1_name , .Fn X509_VERIFY_PARAM_set_flags , .Fn X509_VERIFY_PARAM_clear_flags , .Fn X509_VERIFY_PARAM_set_purpose , .Fn X509_VERIFY_PARAM_set_trust , .Fn X509_VERIFY_PARAM_add0_policy , +.Fn X509_VERIFY_PARAM_set1_policies , and -.Fn X509_VERIFY_PARAM_set1_policies +.Fn X509_VERIFY_PARAM_add0_table return 1 for success or 0 for failure. .Pp +.Fn X509_VERIFY_PARAM_set1_host , +.Fn X509_VERIFY_PARAM_add1_host , +.Fn X509_VERIFY_PARAM_set1_email , +.Fn X509_VERIFY_PARAM_set1_ip , +and +.Fn X509_VERIFY_PARAM_set1_ip_asc , +return 1 for success or 0 for failure. +A failure from these routines will poison +the +.Vt X509_VERIFY_PARAM +object so that future calls to +.Xr X509_verify_cert 3 +using the poisoned object will fail. +.Pp .Fn X509_VERIFY_PARAM_get_flags returns the current verification flags. .Pp -.Fn X509_VERIFY_PARAM_set_time -and -.Fn X509_VERIFY_PARAM_set_depth -do not return values. -.Pp .Fn X509_VERIFY_PARAM_get_depth returns the current verification depth. +.Pp +.Fn X509_VERIFY_PARAM_get0_name +and +.Fn X509_VERIFY_PARAM_get0_peername +return pointers to strings that are only valid +during the lifetime of the given +.Fa param +object and that must not be freed by the application program. +.Pp +.Fn X509_VERIFY_PARAM_lookup +and +.Fn X509_VERIFY_PARAM_get0 +return a pointer to an existing built-in or user-defined object, or +.Dv NULL +if no object with the given +.Fa name +is found, or if +.Fa id +is at least +.Fn X509_VERIFY_PARAM_get_count . +.Pp +.Fn X509_VERIFY_PARAM_get_count +returns a number of objects. .Sh VERIFICATION FLAGS The verification flags consists of zero or more of the following flags OR'ed together. @@ -288,6 +638,46 @@ If this flag is set then additional status codes will be sent to the verification callback and it .Sy must be prepared to handle such cases without assuming they are hard errors. +.Pp +When +.Dv X509_V_FLAG_TRUSTED_FIRST +is set, construction of the certificate chain in +.Xr X509_verify_cert 3 +will search the trust store for issuer certificates before searching the +provided untrusted certificates. +Local issuer certificates are often more likely to satisfy local +security requirements and lead to a locally trusted root. +This is especially important when some certificates in the trust store +have explicit trust settings; see the trust settings options of the +.Cm x509 +command in +.Xr openssl 1 . +.Pp +The +.Dv X509_V_FLAG_NO_ALT_CHAINS +flag suppresses checking for alternative chains. +By default, unless +.Dv X509_V_FLAG_TRUSTED_FIRST +is set, when building a certificate chain, if the first certificate +chain found is not trusted, then OpenSSL will attempt to replace +untrusted certificates supplied by the peer with certificates from the +trust store to see if an alternative chain can be found that is trusted. +.Pp +The +.Dv X509_V_FLAG_PARTIAL_CHAIN +flag causes intermediate certificates in the trust store to be treated +as trust-anchors, in the same way as the self-signed root CA +certificates. +This makes it possible to trust certificates issued by an intermediate +CA without having to trust its ancestor root CA. +.Pp +The +.Dv X509_V_FLAG_NO_CHECK_TIME +flag suppresses checking the validity period of certificates and CRLs +against the current time. +If +.Fn X509_VERIFY_PARAM_set_time +is used to specify a verification time, the check is not suppressed. .Sh EXAMPLES Enable CRL checking when performing certificate verification during SSL connections associated with an @@ -296,13 +686,55 @@ structure .Fa ctx : .Bd -literal -offset indent X509_VERIFY_PARAM *param; + param = X509_VERIFY_PARAM_new(); X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK); SSL_CTX_set1_param(ctx, param); X509_VERIFY_PARAM_free(param); .Ed .Sh SEE ALSO +.Xr SSL_set1_param 3 , +.Xr X509_check_host 3 , +.Xr X509_STORE_CTX_set0_param 3 , +.Xr X509_STORE_set1_param 3 , .Xr X509_verify_cert 3 +.Sh HISTORY +.Fn X509_VERIFY_PARAM_new , +.Fn X509_VERIFY_PARAM_free , +.Fn X509_VERIFY_PARAM_set1_name , +.Fn X509_VERIFY_PARAM_set_flags , +.Fn X509_VERIFY_PARAM_set_purpose , +.Fn X509_VERIFY_PARAM_set_trust , +.Fn X509_VERIFY_PARAM_set_time , +.Fn X509_VERIFY_PARAM_add0_policy , +.Fn X509_VERIFY_PARAM_set1_policies , +.Fn X509_VERIFY_PARAM_set_depth , +.Fn X509_VERIFY_PARAM_get_depth , +.Fn X509_VERIFY_PARAM_add0_table , +.Fn X509_VERIFY_PARAM_lookup , +and +.Fn X509_VERIFY_PARAM_table_cleanup +first appeared in OpenSSL 0.9.8. +.Fn X509_VERIFY_PARAM_clear_flags +and +.Fn X509_VERIFY_PARAM_get_flags +first appeared in OpenSSL 0.9.8a. +All these functions have been available since +.Ox 4.5 . +.Pp +.Fn X509_VERIFY_PARAM_get0_name +.Fn X509_VERIFY_PARAM_set1_host , +.Fn X509_VERIFY_PARAM_add1_host , +.Fn X509_VERIFY_PARAM_set_hostflags , +.Fn X509_VERIFY_PARAM_get0_peername , +.Fn X509_VERIFY_PARAM_set1_email , +.Fn X509_VERIFY_PARAM_set1_ip , +.Fn X509_VERIFY_PARAM_set1_ip_asc , +.Fn X509_VERIFY_PARAM_get_count , +and +.Fn X509_VERIFY_PARAM_get0 +first appeared in OpenSSL 1.0.2 and have been available since +.Ox 6.3 . .Sh BUGS Delta CRL checking is currently primitive. Only a single delta can be used and (partly due to limitations of diff --git a/man/X509_check_ca.3 b/man/X509_check_ca.3 index ee894ac4..0e7b7662 100644 --- a/man/X509_check_ca.3 +++ b/man/X509_check_ca.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_check_ca.3,v 1.3 2017/01/06 19:19:54 schwarze Exp $ +.\" $OpenBSD: X509_check_ca.3,v 1.4 2018/03/22 22:07:12 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Victor B. Wagner . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt X509_CHECK_CA 3 .Os .Sh NAME @@ -90,3 +90,7 @@ that it is a CA certificate .Sh SEE ALSO .Xr X509_check_issued 3 , .Xr X509_verify_cert 3 +.Sh HISTORY +.Fn X509_check_ca +first appeared in OpenSSL 0.9.7f and has been available since +.Ox 3.8 . diff --git a/man/X509_check_host.3 b/man/X509_check_host.3 index 5990670a..f811f218 100644 --- a/man/X509_check_host.3 +++ b/man/X509_check_host.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_check_host.3,v 1.2 2016/12/05 16:38:24 jmc Exp $ +.\" $OpenBSD: X509_check_host.3,v 1.3 2018/03/23 14:26:40 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Florian Weimer and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 5 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt X509_CHECK_HOST 3 .Os .Sh NAME @@ -233,4 +233,6 @@ returns -2 if the provided .Fa name contains embedded NUL bytes. .Sh HISTORY -These functions were added in OpenSSL 1.0.2. +These functions first appeared in OpenSSL 1.0.2 +and have been available since +.Ox 6.1 . diff --git a/man/X509_check_issued.3 b/man/X509_check_issued.3 index a6696123..393f3949 100644 --- a/man/X509_check_issued.3 +++ b/man/X509_check_issued.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_check_issued.3,v 1.2 2016/12/05 16:38:24 jmc Exp $ +.\" $OpenBSD: X509_check_issued.3,v 1.3 2018/03/22 17:11:04 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Victor B. Wagner . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 5 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt X509_CHECK_ISSUED 3 .Os .Sh NAME @@ -102,3 +102,7 @@ constant to indicate an error. .Sh SEE ALSO .Xr X509_check_ca 3 , .Xr X509_verify_cert 3 +.Sh HISTORY +.Fn X509_check_issued +first appeared in OpenSSL 0.9.6 and has been available since +.Ox 2.9 . diff --git a/man/X509_check_private_key.3 b/man/X509_check_private_key.3 index 76192fec..38e297d5 100644 --- a/man/X509_check_private_key.3 +++ b/man/X509_check_private_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_check_private_key.3,v 1.1 2017/08/20 23:18:53 schwarze Exp $ +.\" $OpenBSD: X509_check_private_key.3,v 1.5 2018/05/19 22:40:34 schwarze Exp $ .\" OpenSSL X509_check_private_key.pod 09ddb878 Jun 5 03:56:07 2017 +0800 .\" .\" Copyright (c) 2017 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 20 2017 $ +.Dd $Mdocdate: May 19 2018 $ .Dt X509_CHECK_PRIVATE_KEY 3 .Os .Sh NAME @@ -26,8 +26,8 @@ .In openssl/x509.h .Ft int .Fo X509_check_private_key -.Fa "X509 *x" -.Fa "EVP_PKEY *k" +.Fa "const X509 *x" +.Fa "const EVP_PKEY *k" .Fc .Ft int .Fo X509_REQ_check_private_key @@ -61,3 +61,11 @@ On error or mismatch, a reason code can be obtained using .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr SSL_check_private_key 3 +.Sh HISTORY +.Fn X509_check_private_key +first appeared in SSLeay 0.6.5 and has been available since +.Ox 2.4 . +.Pp +.Fn X509_REQ_check_private_key +first appeared in OpenSSL 0.9.8 and has been available since +.Ox 4.5 . diff --git a/man/X509_cmp_time.3 b/man/X509_cmp_time.3 index 53ed1228..d7a55653 100644 --- a/man/X509_cmp_time.3 +++ b/man/X509_cmp_time.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_cmp_time.3,v 1.4 2017/04/10 17:14:44 schwarze Exp $ +.\" $OpenBSD: X509_cmp_time.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL X509_cmp_time.pod 24053693 Mar 28 14:27:37 2017 +0200 .\" .\" This file was written by Emilia Kasper @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_CMP_TIME 3 .Os .Sh NAME @@ -137,3 +137,17 @@ on error. .Sh SEE ALSO .Xr ASN1_time_parse 3 , .Xr time 3 +.Sh HISTORY +.Fn X509_cmp_current_time +first appeared in SSLeay 0.6.0 and has been available since +.Ox 2.4 . +.Pp +.Fn X509_cmp_time +and +.Fn X509_time_adj +first appeared in OpenSSL 0.9.6 and have been available since +.Ox 2.9 . +.Pp +.Fn X509_time_adj_ex +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . diff --git a/man/X509_digest.3 b/man/X509_digest.3 index eae69ea7..e29160d5 100644 --- a/man/X509_digest.3 +++ b/man/X509_digest.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_digest.3,v 1.1 2017/03/25 22:21:21 schwarze Exp $ +.\" $OpenBSD: X509_digest.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL X509_digest.pod 3ba4dac6 Mar 23 13:04:52 2017 -0400 .\" .\" This file was written by Rich Salz @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 25 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_DIGEST 3 .Os .Sh NAME @@ -131,3 +131,20 @@ points to a place where the digest size will be stored. These functions return 1 for success or 0 for failure. .Sh SEE ALSO .Xr EVP_get_digestbyname 3 +.Sh HISTORY +.Fn X509_digest , +.Fn X509_NAME_digest , +and +.Fn PKCS7_ISSUER_AND_SERIAL_digest +first appeared in SSLeay 0.6.5 and have been available since +.Ox 2.4 . +.Pp +.Fn X509_CRL_digest +and +.Fn X509_REQ_digest +first appeared in OpenSSL 0.9.6 and have been available since +.Ox 2.9 . +.Pp +.Fn X509_pubkey_digest +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . diff --git a/man/X509_get0_notBefore.3 b/man/X509_get0_notBefore.3 new file mode 100644 index 00000000..334f70e5 --- /dev/null +++ b/man/X509_get0_notBefore.3 @@ -0,0 +1,158 @@ +.\" $OpenBSD: X509_get0_notBefore.3,v 1.4 2018/03/23 23:18:17 schwarze Exp $ +.\" content checked up to: OpenSSL 27b138e9 May 19 00:16:38 2017 +0000 +.\" +.\" Copyright (c) 2018 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: March 23 2018 $ +.Dt X509_GET0_NOTBEFORE 3 +.Os +.Sh NAME +.Nm X509_get0_notBefore , +.Nm X509_get0_notAfter , +.Nm X509_getm_notBefore , +.Nm X509_getm_notAfter , +.Nm X509_CRL_get0_lastUpdate , +.Nm X509_CRL_get0_nextUpdate , +.Nm X509_set1_notBefore , +.Nm X509_set1_notAfter , +.Nm X509_CRL_set1_lastUpdate , +.Nm X509_CRL_set1_nextUpdate +.Nd get and set certificate and CRL validity dates +.Sh SYNOPSIS +.In openssl/x509.h +.Ft const ASN1_TIME * +.Fo X509_get0_notBefore +.Fa "const X509 *x" +.Fc +.Ft const ASN1_TIME * +.Fo X509_get0_notAfter +.Fa "const X509 *x" +.Fc +.Ft ASN1_TIME * +.Fo X509_getm_notBefore +.Fa "const X509 *x" +.Fc +.Ft ASN1_TIME * +.Fo X509_getm_notAfter +.Fa "const X509 *x" +.Fc +.Ft ASN1_TIME * +.Fo X509_CRL_get0_lastUpdate +.Fa "const X509_CRL *crl" +.Fc +.Ft ASN1_TIME * +.Fo X509_CRL_get0_nextUpdate +.Fa "const X509_CRL *crl" +.Fc +.Ft int +.Fo X509_set1_notBefore +.Fa "X509 *x" +.Fa "const ASN1_TIME *tm" +.Fc +.Ft int +.Fo X509_set1_notAfter +.Fa "X509 *x" +.Fa "const ASN1_TIME *tm" +.Fc +.Ft int +.Fo X509_CRL_set1_lastUpdate +.Fa "X509_CRL *crl" +.Fa "const ASN1_TIME *tm" +.Fc +.Ft int +.Fo X509_CRL_set1_nextUpdate +.Fa "X509_CRL *crl" +.Fa "const ASN1_TIME *tm" +.Fc +.Sh DESCRIPTION +.Fn X509_getm_notBefore +and +.Fn X509_getm_notAfter +return pointers to the +.Fa notBefore +and +.Fa notAfter +fields of the validity period of the certificate +.Fa x , +respectively. +.Pp +.Fn X509_get0_notBefore +and +.Fn X509_get0_notAfter +are identical except for the const qualifier on the return type. +.Pp +.Fn X509_CRL_get0_lastUpdate +and +.Fn X509_CRL_get0_nextUpdate +return pointers to the +.Fa lastUpdate +and +.Fa nextUpdate +fields of +.Fa crl . +.Pp +.Fn X509_set1_notBefore , +.Fn X509_set1_notAfter , +.Fn X509_CRL_set1_lastUpdate , +and +.Fn X509_CRL_set1_nextUpdate +set the +.Fa notBefore , +.Fa notAfter , +.Fa lastUpdate , +or +.Fa nextUpdate +field of +.Fa x +or +.Fa crl , +respectively, to a deep copy of +.Fa tm +and free the +.Vt ASN1_TIME +value that they replace. +.Sh RETURN VALUES +.Fn X509_get0_notBefore , +.Fn X509_get0_notAfter , +.Fn X509_getm_notBefore , +.Fn X509_getm_notAfter , +.Fn X509_CRL_get0_lastUpdate , +and +.Fn X509_CRL_get0_nextUpdate +return internal pointers which must not be freed by the application, or +.Dv NULL +if the requested fields are not available. +.Pp +.Fn X509_set1_notBefore , +.Fn X509_set1_notAfter , +.Fn X509_CRL_set1_lastUpdate , +and +.Fn X509_CRL_set1_nextUpdate +return 1 on success or 0 on failure. +.Sh SEE ALSO +.Xr ASN1_TIME_set 3 , +.Xr ASN1_TIME_set_tm 3 , +.Xr X509_cmp_time 3 , +.Xr X509_CRL_get0_by_serial 3 , +.Xr X509_CRL_new 3 , +.Xr X509_get_subject_name 3 , +.Xr X509_new 3 , +.Xr X509_sign 3 , +.Xr X509_VAL_new 3 , +.Xr X509_verify_cert 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0 +and have been available since +.Ox 6.3 . diff --git a/man/X509_get0_signature.3 b/man/X509_get0_signature.3 new file mode 100644 index 00000000..a0982f21 --- /dev/null +++ b/man/X509_get0_signature.3 @@ -0,0 +1,162 @@ +.\" $OpenBSD: X509_get0_signature.3,v 1.5 2018/03/23 23:18:17 schwarze Exp $ +.\" selective merge up to: +.\" OpenSSL man3/X509_get0_signature 2f7a2520 Apr 25 17:28:08 2017 +0100 +.\" +.\" This file was written by Dr. Stephen Henson . +.\" Copyright (c) 2015 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. +.\" +.Dd $Mdocdate: March 23 2018 $ +.Dt X509_GET0_SIGNATURE 3 +.Os +.Sh NAME +.Nm X509_get0_signature , +.Nm X509_REQ_get0_signature , +.Nm X509_CRL_get0_signature , +.Nm X509_get0_tbs_sigalg , +.Nm X509_get_signature_nid , +.Nm X509_REQ_get_signature_nid , +.Nm X509_CRL_get_signature_nid +.Nd signature information +.Sh SYNOPSIS +.In openssl/x509.h +.Ft void +.Fo X509_get0_signature +.Fa "const ASN1_BIT_STRING **psig" +.Fa "const X509_ALGOR **palg" +.Fa "const X509 *x" +.Fc +.Ft void +.Fo X509_REQ_get0_signature +.Fa "const X509_REQ *req" +.Fa "const ASN1_BIT_STRING **psig" +.Fa "const X509_ALGOR **palg" +.Fc +.Ft void +.Fo X509_CRL_get0_signature +.Fa "const X509_CRL *crl" +.Fa "const ASN1_BIT_STRING **psig" +.Fa "const X509_ALGOR **palg" +.Fc +.Ft const X509_ALGOR * +.Fo X509_get0_tbs_sigalg +.Fa "const X509 *x" +.Fc +.Ft int +.Fo X509_get_signature_nid +.Fa "const X509 *x" +.Fc +.Ft int +.Fo X509_REQ_get_signature_nid +.Fa "const X509_REQ *req" +.Fc +.Ft int +.Fo X509_CRL_get_signature_nid +.Fa "const X509_CRL *crl" +.Fc +.Sh DESCRIPTION +.Fn X509_get0_signature , +.Fn X509_REQ_get0_signature , +and +.Fn X509_CRL_get0_signature +set +.Pf * Fa psig +to the signature and +.Pf * Fa palg +to the signature algorithm of +.Fa x , +.Fa req , +or +.Fa crl , +respectively. +.Fn X509_get0_tbs_sigalg +returns the signature algorithm in the signed portion of +.Fa x . +The values returned are internal pointers +that must not be freed by the caller. +.Pp +.Fn X509_get_signature_nid , +.Fn X509_REQ_get_signature_nid , +and +.Fn X509_CRL_get_signature_nid +return the NID corresponding to the signature algorithm of +.Fa x , +.Fa req , +or +.Fa crl , +respectively. +.Pp +These functions provide lower level access to the signature +for cases where an application wishes to analyse or generate a +signature in a form where +.Xr X509_sign 3 +is not appropriate, for example in a non-standard or unsupported format. +.Sh SEE ALSO +.Xr OBJ_obj2nid 3 , +.Xr X509_ALGOR_new 3 , +.Xr X509_CRL_get0_by_serial 3 , +.Xr X509_CRL_new 3 , +.Xr X509_get_pubkey 3 , +.Xr X509_get_subject_name 3 , +.Xr X509_get_version 3 , +.Xr X509_new 3 , +.Xr X509_REQ_new 3 , +.Xr X509_sign 3 , +.Xr X509_verify_cert 3 +.Sh HISTORY +.Fn X509_get0_signature +and +.Fn X509_get_signature_nid +first appeared in OpenSSL 1.0.2. +.Fn X509_REQ_get0_signature , +.Fn X509_CRL_get0_signature , +.Fn X509_get0_tbs_sigalg , +.Fn X509_REQ_get_signature_nid , +and +.Fn X509_CRL_get_signature_nid +first appeared in OpenSSL 1.1.0. +All these functions have been available since +.Ox 6.3 . diff --git a/man/X509_get_pubkey.3 b/man/X509_get_pubkey.3 index 8948f5cf..49a57447 100644 --- a/man/X509_get_pubkey.3 +++ b/man/X509_get_pubkey.3 @@ -1,5 +1,5 @@ -.\" $OpenBSD: X509_get_pubkey.3,v 1.1 2016/12/05 18:24:08 schwarze Exp $ -.\" OpenSSL e7fabc5e Sep 7 13:41:20 2015 +0100 +.\" $OpenBSD: X509_get_pubkey.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ +.\" selective merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2015 The OpenSSL Project. All rights reserved. @@ -48,11 +48,12 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 5 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_GET_PUBKEY 3 .Os .Sh NAME .Nm X509_get_pubkey , +.Nm X509_get0_pubkey , .Nm X509_set_pubkey , .Nm X509_get_X509_PUBKEY , .Nm X509_REQ_get_pubkey , @@ -64,6 +65,10 @@ .Fo X509_get_pubkey .Fa "X509 *x" .Fc +.Ft EVP_PKEY * +.Fo X509_get0_pubkey +.Fa "const X509 *x" +.Fc .Ft int .Fo X509_set_pubkey .Fa "X509 *x" @@ -90,6 +95,11 @@ If successful it returns the public key as an .Vt EVP_PKEY pointer with its reference count incremented: this means the returned key must be freed up after use. +.Fn X509_get0_pubkey +is similar except that it does not increment the reference count +of the returned +.Vt EVP_PKEY , +so it must not be freed up after use. .Pp .Fn X509_get_X509_PUBKEY returns an internal pointer to the @@ -122,6 +132,7 @@ Subsequent calls return the cached structure with its reference count incremented to improve performance. .Sh RETURN VALUES .Fn X509_get_pubkey , +.Fn X509_get0_pubkey , .Fn X509_get_X509_PUBKEY , and .Fn X509_REQ_get_pubkey @@ -145,3 +156,18 @@ return 1 for success or 0 for failure. .Xr X509_sign 3 , .Xr X509_verify_cert 3 , .Xr X509V3_get_d2i 3 +.Sh HISTORY +.Fn X509_get_pubkey , +.Fn X509_set_pubkey , +.Fn X509_REQ_get_pubkey , +and +.Fn X509_REQ_set_pubkey +first appeared in SSLeay 0.6.5. +.Fn X509_get_X509_PUBKEY +first appeared in SSLeay 0.8.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn X509_get0_pubkey +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/X509_get_serialNumber.3 b/man/X509_get_serialNumber.3 index 9f2b14ec..b8d540dc 100644 --- a/man/X509_get_serialNumber.3 +++ b/man/X509_get_serialNumber.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_get_serialNumber.3,v 1.1 2016/12/05 18:24:08 schwarze Exp $ +.\" $OpenBSD: X509_get_serialNumber.3,v 1.3 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 5 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_GET_SERIALNUMBER 3 .Os .Sh NAME @@ -109,4 +109,5 @@ returns 1 for success and 0 for failure. .Fn X509_get_serialNumber and .Fn X509_set_serialNumber -are available in all versions of OpenSSL. +first appeared in SSLeay 0.6.5 and have been available since +.Ox 2.4 . diff --git a/man/X509_get_subject_name.3 b/man/X509_get_subject_name.3 index 0fb2624f..06b554ef 100644 --- a/man/X509_get_subject_name.3 +++ b/man/X509_get_subject_name.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_get_subject_name.3,v 1.2 2016/12/14 16:20:28 schwarze Exp $ +.\" $OpenBSD: X509_get_subject_name.3,v 1.7 2018/05/13 14:25:40 schwarze Exp $ .\" OpenSSL 0ad69cd6 Jun 14 23:02:16 2016 +0200 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 14 2016 $ +.Dd $Mdocdate: May 13 2018 $ .Dt X509_GET_SUBJECT_NAME 3 .Os .Sh NAME @@ -65,7 +65,7 @@ .In openssl/x509.h .Ft X509_NAME * .Fo X509_get_subject_name -.Fa "X509 *x" +.Fa "const X509 *x" .Fc .Ft int .Fo X509_set_subject_name @@ -74,7 +74,7 @@ .Fc .Ft X509_NAME * .Fo X509_get_issuer_name -.Fa "X509 *x" +.Fa "const X509 *x" .Fc .Ft int .Fo X509_set_issuer_name @@ -168,3 +168,24 @@ return 1 for success or 0 for failure. .Xr X509_sign 3 , .Xr X509_verify_cert 3 , .Xr X509V3_get_d2i 3 +.Sh HISTORY +.Fn X509_get_subject_name +and +.Fn X509_get_issuer_name +appeared in SSLeay 0.4 or earlier. +.Fn X509_set_subject_name , +.Fn X509_set_issuer_name , +.Fn X509_REQ_get_subject_name , +and +.Fn X509_REQ_set_subject_name +first appeared in SSLeay 0.6.5. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn X509_CRL_get_issuer +first appeared in OpenSSL 0.9.2b and has been available since +.Ox 2.6 . +.Pp +.Fn X509_CRL_set_issuer_name +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . diff --git a/man/X509_get_version.3 b/man/X509_get_version.3 index 6e35f3df..395502fa 100644 --- a/man/X509_get_version.3 +++ b/man/X509_get_version.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_get_version.3,v 1.1 2016/12/05 18:24:08 schwarze Exp $ +.\" $OpenBSD: X509_get_version.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 5 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_GET_VERSION 3 .Os .Sh NAME @@ -147,3 +147,19 @@ return 1 for success or 0 for failure. .Xr X509_sign 3 , .Xr X509_verify_cert 3 , .Xr X509V3_get_d2i 3 +.Sh HISTORY +.Fn X509_get_version , +.Fn X509_set_version , +.Fn X509_REQ_get_version , +and +.Fn X509_REQ_set_version +first appeared in SSLeay 0.6.5 and have been available since +.Ox 2.4 . +.Pp +.Fn X509_CRL_get_version +first appeared in OpenSSL 0.9.2b and has been available since +.Ox 2.6 . +.Pp +.Fn X509_CRL_set_version +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . diff --git a/man/X509_new.3 b/man/X509_new.3 index dbf82bc9..1d0f6023 100644 --- a/man/X509_new.3 +++ b/man/X509_new.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: X509_new.3,v 1.10 2016/12/25 22:15:10 schwarze Exp $ -.\" OpenSSL 3a59ad98 Dec 11 00:36:06 2015 +0000 +.\" $OpenBSD: X509_new.3,v 1.15 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2002, 2006, 2015 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2002, 2006, 2015, 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 @@ -48,13 +49,14 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_NEW 3 .Os .Sh NAME .Nm X509_new , .Nm X509_free , -.Nm X509_up_ref +.Nm X509_up_ref , +.Nm X509_chain_up_ref .Nd X.509 certificate object .Sh SYNOPSIS .In openssl/x509.h @@ -68,6 +70,10 @@ .Fo X509_up_ref .Fa "X509 *a" .Fc +.Ft STACK_OF(X509) * +.Fo X509_chain_up_ref +.Fa "STACK_OF(X509) *chain" +.Fc .Sh DESCRIPTION .Fn X509_new allocates and initializes an empty @@ -93,12 +99,24 @@ pointer, no action occurs. .Pp .Fn X509_up_ref increments the reference count of -.Fa a . +.Fa a +by 1. This function is useful if a certificate structure is being used by several different operations each of which will free it up after use: this avoids the need to duplicate the entire certificate structure. .Pp +.Fn X509_chain_up_ref +performs a shallow copy of the given +.Fa chain +using +.Fn sk_X509_dup +and increments the reference count of each contained certificate +by 1. +Its purpose is similar to +.Fn X509_up_ref : +The returned chain persists after the original is freed. +.Pp The object .Vt X509_INFO , which can hold a certificate, the corresponding private key, @@ -114,6 +132,13 @@ Otherwise it returns a pointer to the newly allocated structure. .Pp .Fn X509_up_ref returns 1 for success or 0 for failure. +.Pp +.Fn X509_chain_up_ref +returns the copy of the +.Fa chain +or +.Dv NULL +if an error occurs. .Sh SEE ALSO .Xr AUTHORITY_KEYID_new 3 , .Xr BASIC_CONSTRAINTS_new 3 , @@ -133,7 +158,16 @@ Certificate Revocation List (CRL) Profile .Fn X509_new and .Fn X509_free -are available in all versions of SSLeay and OpenSSL. +appeared in SSLeay 0.4 or earlier and have been available since +.Ox 2.4 . +.Pp +.Fn X509_up_ref +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.1 . +.Pp +.Fn X509_chain_up_ref +first appeared in OpenSSL 1.0.2 and has been available since +.Ox 6.3 . .Sh BUGS The X.509 public key infrastructure and its data types contain too many design bugs to list them. diff --git a/man/X509_sign.3 b/man/X509_sign.3 index 2680f0b0..cc3c7ab8 100644 --- a/man/X509_sign.3 +++ b/man/X509_sign.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_sign.3,v 1.1 2016/12/05 18:24:08 schwarze Exp $ +.\" $OpenBSD: X509_sign.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 5 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_SIGN 3 .Os .Sh NAME @@ -189,14 +189,24 @@ some other error occurred, then -1 is returned. .Xr X509_verify_cert 3 , .Xr X509V3_get_d2i 3 .Sh HISTORY -.Fn X509_sign , -.Fn X509_REQ_sign , +.Fn X509_verify +appeared in SSLeay 0.4 or earlier. +.Fn X509_sign +and +.Fn X509_REQ_sign +first appeared in SSLeay 0.4.4. +.Fn X509_REQ_verify and +.Fn X509_CRL_verify +first appeared in SSLeay 0.4.5b. .Fn X509_CRL_sign -are available in all versions of OpenSSL. +first appeared in SSLeay 0.5.1. +These functions have been available since +.Ox 2.4 . .Pp .Fn X509_sign_ctx , .Fn X509_REQ_sign_ctx , and .Fn X509_CRL_sign_ctx -were first added to OpenSSL 1.0.1. +first appeared in OpenSSL 1.0.1 and have been available since +.Ox 5.3 . diff --git a/man/X509_verify_cert.3 b/man/X509_verify_cert.3 index a930910e..604d3bd5 100644 --- a/man/X509_verify_cert.3 +++ b/man/X509_verify_cert.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509_verify_cert.3,v 1.5 2017/01/03 06:29:04 beck Exp $ +.\" $OpenBSD: X509_verify_cert.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 3 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt X509_VERIFY_CERT 3 .Os .Sh NAME @@ -83,7 +83,8 @@ using .Xr X509_STORE_CTX_get_error 3 .Sh HISTORY .Fn X509_verify_cert -is available in all versions of SSLeay and OpenSSL. +first appeared in SSLeay 0.8.0 and has been available since +.Ox 2.4 . .Sh BUGS This function uses the header .In openssl/x509.h diff --git a/man/X509v3_get_ext_by_NID.3 b/man/X509v3_get_ext_by_NID.3 index b5e19817..d82a2973 100644 --- a/man/X509v3_get_ext_by_NID.3 +++ b/man/X509v3_get_ext_by_NID.3 @@ -1,5 +1,5 @@ -.\" $OpenBSD: X509v3_get_ext_by_NID.3,v 1.4 2017/07/05 11:43:09 schwarze Exp $ -.\" OpenSSL c952780c Jun 21 07:03:34 2016 -0400 +.\" $OpenBSD: X509v3_get_ext_by_NID.3,v 1.10 2019/03/15 13:33:30 schwarze Exp $ +.\" full merge up to: OpenSSL fd38836b Jun 20 15:25:43 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2015 The OpenSSL Project. All rights reserved. @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 5 2017 $ +.Dd $Mdocdate: March 15 2019 $ .Dt X509V3_GET_EXT_BY_NID 3 .Os .Sh NAME @@ -101,7 +101,7 @@ .Ft int .Fo X509v3_get_ext_by_OBJ .Fa "const STACK_OF(X509_EXTENSION) *x" -.Fa "ASN1_OBJECT *obj" +.Fa "const ASN1_OBJECT *obj" .Fa "int lastpos" .Fc .Ft int @@ -123,28 +123,28 @@ .Fc .Ft int .Fo X509_get_ext_count -.Fa "X509 *x" +.Fa "const X509 *x" .Fc .Ft X509_EXTENSION * .Fo X509_get_ext -.Fa "X509 *x" +.Fa "const X509 *x" .Fa "int loc" .Fc .Ft int .Fo X509_get_ext_by_NID -.Fa "X509 *x" +.Fa "const X509 *x" .Fa "int nid" .Fa "int lastpos" .Fc .Ft int .Fo X509_get_ext_by_OBJ -.Fa "X509 *x" -.Fa "ASN1_OBJECT *obj" +.Fa "const X509 *x" +.Fa "const ASN1_OBJECT *obj" .Fa "int lastpos" .Fc .Ft int .Fo X509_get_ext_by_critical -.Fa "X509 *x" +.Fa "const X509 *x" .Fa "int crit" .Fa "int lastpos" .Fc @@ -161,28 +161,28 @@ .Fc .Ft int .Fo X509_CRL_get_ext_count -.Fa "X509_CRL *x" +.Fa "const X509_CRL *x" .Fc .Ft X509_EXTENSION * .Fo X509_CRL_get_ext -.Fa "X509_CRL *x" +.Fa "const X509_CRL *x" .Fa "int loc" .Fc .Ft int .Fo X509_CRL_get_ext_by_NID -.Fa "X509_CRL *x" +.Fa "const X509_CRL *x" .Fa "int nid" .Fa "int lastpos" .Fc .Ft int .Fo X509_CRL_get_ext_by_OBJ -.Fa "X509_CRL *x" -.Fa "ASN1_OBJECT *obj" +.Fa "const X509_CRL *x" +.Fa "const ASN1_OBJECT *obj" .Fa "int lastpos" .Fc .Ft int .Fo X509_CRL_get_ext_by_critical -.Fa "X509_CRL *x" +.Fa "const X509_CRL *x" .Fa "int crit" .Fa "int lastpos" .Fc @@ -199,28 +199,28 @@ .Fc .Ft int .Fo X509_REVOKED_get_ext_count -.Fa "X509_REVOKED *x" +.Fa "const X509_REVOKED *x" .Fc .Ft X509_EXTENSION * .Fo X509_REVOKED_get_ext -.Fa "X509_REVOKED *x" +.Fa "const X509_REVOKED *x" .Fa "int loc" .Fc .Ft int .Fo X509_REVOKED_get_ext_by_NID -.Fa "X509_REVOKED *x" +.Fa "const X509_REVOKED *x" .Fa "int nid" .Fa "int lastpos" .Fc .Ft int .Fo X509_REVOKED_get_ext_by_OBJ -.Fa "X509_REVOKED *x" -.Fa "ASN1_OBJECT *obj" +.Fa "const X509_REVOKED *x" +.Fa "const ASN1_OBJECT *obj" .Fa "int lastpos" .Fc .Ft int .Fo X509_REVOKED_get_ext_by_critical -.Fa "X509_REVOKED *x" +.Fa "const X509_REVOKED *x" .Fa "int crit" .Fa "int lastpos" .Fc @@ -364,9 +364,10 @@ If it is set to 0, the initial extension will not be checked. .Fn X509v3_get_ext_count returns the extension count. .Pp -.Fn X509v3_get_ext +.Fn X509v3_get_ext , +.Fn X509v3_delete_ext , and -.Fn X509v3_delete_ext +.Fn X509_delete_ext return an .Vt X509_EXTENSION pointer or @@ -383,6 +384,14 @@ return the extension index or -1 if an error occurs. returns a stack of extensions or .Dv NULL on error. +.Pp +.Fn X509_add_ext +returns 1 on success or 0 on error. .Sh SEE ALSO .Xr X509_EXTENSION_new 3 , +.Xr X509_REVOKED_new 3 , .Xr X509V3_get_d2i 3 +.Sh HISTORY +These functions first appeared in SSLeay 0.8.0 +and have been available since +.Ox 2.4 . diff --git a/man/crypto.3 b/man/crypto.3 index 2bba237a..3a009ed3 100644 --- a/man/crypto.3 +++ b/man/crypto.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: crypto.3,v 1.16 2017/01/07 08:46:13 jmc Exp $ +.\" $OpenBSD: crypto.3,v 1.19 2019/03/10 14:50:05 schwarze Exp $ .\" OpenSSL a9c85cea Nov 11 09:33:55 2016 +0100 .\" .\" This file was written by Ulf Moeller and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 7 2017 $ +.Dd $Mdocdate: March 10 2019 $ .Dt CRYPTO 3 .Os .Sh NAME @@ -63,8 +63,8 @@ implementations of TLS and S/MIME, and they have also been used to implement SSH, OpenPGP, and other cryptographic standards. .Pp .Sy Symmetric ciphers -including AES, Blowfish, CAST, Chacha20, IDEA, DES, RC2, RC4, and -RC5 are provided by the generic interface +including AES, Blowfish, CAST, Chacha20, IDEA, DES, RC2, and RC4 +are provided by the generic interface .Xr EVP_EncryptInit 3 . Low-level stand-alone interfaces include .Xr BF_set_key 3 , @@ -89,7 +89,6 @@ and .Sy Authentication codes and hash functions offered include .Xr HMAC 3 , -.Xr MD2 3 , .Xr MD4 3 , .Xr MD5 3 , .Xr RIPEMD160 3 , @@ -117,9 +116,6 @@ configuration file handling: see error reporting: see .Xr ERR 3 .It -thread support: see -.Xr CRYPTO_set_locking_callback 3 -.It .Xr OCSP_REQUEST_new 3 .El .Pp diff --git a/man/d2i_ASN1_NULL.3 b/man/d2i_ASN1_NULL.3 index 8efcee69..498f191a 100644 --- a/man/d2i_ASN1_NULL.3 +++ b/man/d2i_ASN1_NULL.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_ASN1_NULL.3,v 1.1 2016/12/29 17:42:54 schwarze Exp $ +.\" $OpenBSD: d2i_ASN1_NULL.3,v 1.2 2018/03/22 16:06:33 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 29 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt D2I_ASN1_NULL 3 .Os .Sh NAME @@ -82,3 +82,9 @@ Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER), section 8.8: Encoding of null value +.Sh HISTORY +.Fn d2i_ASN1_NULL +and +.Fn i2d_ASN1_NULL +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/d2i_ASN1_OBJECT.3 b/man/d2i_ASN1_OBJECT.3 index 33cc93c0..09a17ced 100644 --- a/man/d2i_ASN1_OBJECT.3 +++ b/man/d2i_ASN1_OBJECT.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_ASN1_OBJECT.3,v 1.6 2017/01/05 08:24:38 jmc Exp $ +.\" $OpenBSD: d2i_ASN1_OBJECT.3,v 1.9 2018/04/25 15:17:52 schwarze Exp $ .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 .\" .\" Copyright (c) 2017 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 5 2017 $ +.Dd $Mdocdate: April 25 2018 $ .Dt D2I_ASN1_OBJECT 3 .Os .Sh NAME @@ -32,7 +32,7 @@ .Fc .Ft int .Fo i2d_ASN1_OBJECT -.Fa "ASN1_OBJECT *val_in" +.Fa "const ASN1_OBJECT *val_in" .Fa "unsigned char **der_out" .Fc .Sh DESCRIPTION @@ -74,6 +74,12 @@ or a value <= 0 if an error occurs. .Xr ASN1_item_d2i 3 , .Xr ASN1_OBJECT_new 3 , .Xr OBJ_nid2obj 3 +.Sh HISTORY +.Fn d2i_ASN1_OBJECT +and +.Fn i2d_ASN1_OBJECT +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . .Sh CAVEATS .Fn d2i_ASN1_OBJECT never sets the long and short names of the object, not even if the diff --git a/man/d2i_ASN1_OCTET_STRING.3 b/man/d2i_ASN1_OCTET_STRING.3 index 86ab27b3..c985bc8b 100644 --- a/man/d2i_ASN1_OCTET_STRING.3 +++ b/man/d2i_ASN1_OCTET_STRING.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_ASN1_OCTET_STRING.3,v 1.5 2017/08/01 14:57:03 schwarze Exp $ +.\" $OpenBSD: d2i_ASN1_OCTET_STRING.3,v 1.12 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2017 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 1 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_ASN1_OCTET_STRING 3 .Os .Sh NAME @@ -384,3 +384,57 @@ Specification of basic notation .Pp RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile +.Sh HISTORY +.Fn d2i_ASN1_OCTET_STRING , +.Fn i2d_ASN1_OCTET_STRING , +.Fn d2i_ASN1_BIT_STRING , +.Fn i2d_ASN1_BIT_STRING , +.Fn d2i_ASN1_INTEGER , +.Fn i2d_ASN1_INTEGER , +.Fn d2i_ASN1_IA5STRING , +.Fn i2d_ASN1_IA5STRING , +.Fn d2i_ASN1_T61STRING , +.Fn i2d_ASN1_T61STRING , +.Fn d2i_ASN1_PRINTABLESTRING , +.Fn i2d_ASN1_PRINTABLESTRING +.Fn d2i_ASN1_PRINTABLE , +.Fn i2d_ASN1_PRINTABLE , +.Fn d2i_ASN1_UTCTIME , +and +.Fn i2d_ASN1_UTCTIME +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp +.Fn d2i_ASN1_BMPSTRING +and +.Fn i2d_ASN1_BMPSTRING +first appeared in SSLeay 0.9.1. +.Fn d2i_ASN1_ENUMERATED , +.Fn i2d_ASN1_ENUMERATED , +.Fn d2i_ASN1_GENERALIZEDTIME , +.Fn i2d_ASN1_GENERALIZEDTIME , +.Fn d2i_ASN1_TIME , +and +.Fn i2d_ASN1_TIME +first appeared in OpenSSL 0.9.2b. +.Fn d2i_ASN1_UINTEGER , +.Fn d2i_ASN1_UTF8STRING , +.Fn i2d_ASN1_UTF8STRING , +.Fn d2i_ASN1_VISIBLESTRING , +.Fn i2d_ASN1_VISIBLESTRING , +.Fn d2i_DIRECTORYSTRING , +.Fn i2d_DIRECTORYSTRING , +.Fn d2i_DISPLAYTEXT +and +.Fn i2d_DISPLAYTEXT +first appeared in OpenSSL 0.9.3. +These functions have been available since +.Ox 2.6 . +.Pp +.Fn d2i_ASN1_UNIVERSALSTRING , +.Fn i2d_ASN1_UNIVERSALSTRING , +.Fn d2i_ASN1_GENERALSTRING , +and +.Fn i2d_ASN1_GENERALSTRING +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/d2i_ASN1_SEQUENCE_ANY.3 b/man/d2i_ASN1_SEQUENCE_ANY.3 index f3ab6d98..0c4b6d72 100644 --- a/man/d2i_ASN1_SEQUENCE_ANY.3 +++ b/man/d2i_ASN1_SEQUENCE_ANY.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_ASN1_SEQUENCE_ANY.3,v 1.1 2017/01/04 21:14:26 schwarze Exp $ +.\" $OpenBSD: d2i_ASN1_SEQUENCE_ANY.3,v 1.2 2018/03/23 04:34:23 schwarze Exp $ .\" .\" Copyright (c) 2017 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 4 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt D2I_ASN1_SEQUENCE_ANY 3 .Os .Sh NAME @@ -83,3 +83,11 @@ occurs. .Sh SEE ALSO .Xr ASN1_item_d2i 3 , .Xr ASN1_TYPE_new 3 +.Sh HISTORY +.Fn d2i_ASN1_SEQUENCE_ANY , +.Fn i2d_ASN1_SEQUENCE_ANY , +.Fn d2i_ASN1_SET_ANY , +and +.Fn i2d_ASN1_SET_ANY +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/d2i_AUTHORITY_KEYID.3 b/man/d2i_AUTHORITY_KEYID.3 index 2f46454d..413f41e1 100644 --- a/man/d2i_AUTHORITY_KEYID.3 +++ b/man/d2i_AUTHORITY_KEYID.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_AUTHORITY_KEYID.3,v 1.1 2016/12/28 20:36:33 schwarze Exp $ +.\" $OpenBSD: d2i_AUTHORITY_KEYID.3,v 1.2 2018/03/21 16:09:51 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt D2I_AUTHORITY_KEYID 3 .Os .Sh NAME @@ -67,3 +67,9 @@ section 4.2.1.1: Certificate Extensions: Authority Key Identifier .It section 5.2.1: CRL Extensions: Authority Key Identifier .El +.Sh HISTORY +.Fn d2i_AUTHORITY_KEYID +and +.Fn i2d_AUTHORITY_KEYID +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . diff --git a/man/d2i_BASIC_CONSTRAINTS.3 b/man/d2i_BASIC_CONSTRAINTS.3 index 96854162..2964a1f9 100644 --- a/man/d2i_BASIC_CONSTRAINTS.3 +++ b/man/d2i_BASIC_CONSTRAINTS.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_BASIC_CONSTRAINTS.3,v 1.1 2016/12/28 20:36:33 schwarze Exp $ +.\" $OpenBSD: d2i_BASIC_CONSTRAINTS.3,v 1.3 2018/03/22 21:08:22 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt D2I_BASIC_CONSTRAINTS 3 .Os .Sh NAME @@ -92,3 +92,15 @@ if an error occurs. .Sh STANDARDS RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile +.Sh HISTORY +.Fn d2i_BASIC_CONSTRAINTS +and +.Fn i2d_BASIC_CONSTRAINTS +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . +.Pp +.Fn d2i_EXTENDED_KEY_USAGE +and +.Fn i2d_EXTENDED_KEY_USAGE +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/d2i_DHparams.3 b/man/d2i_DHparams.3 index b345af68..7fd9878d 100644 --- a/man/d2i_DHparams.3 +++ b/man/d2i_DHparams.3 @@ -1,9 +1,10 @@ -.\" $OpenBSD: d2i_DHparams.3,v 1.5 2016/12/10 22:22:59 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: d2i_DHparams.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ +.\" full merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file was written by Ulf Moeller and .\" Dr. Stephen Henson . -.\" Copyright (c) 2000, 2002, 2015 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2000, 2002, 2015, 2017 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 @@ -49,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_DHPARAMS 3 .Os .Sh NAME @@ -76,6 +77,23 @@ They otherwise behave in a way similar to .Xr d2i_X509 3 and .Xr i2d_X509 3 . +.Sh RETURN VALUES +.Fn d2i_DHparams +returns a +.Vt DH +object or +.Dv NULL +if an error occurs. +.Pp +.Fn i2d_DHparams +returns the number of bytes successfully encoded or a value <= 0 +if an error occurs. .Sh SEE ALSO .Xr d2i_X509 3 , .Xr DH_new 3 +.Sh HISTORY +.Fn d2i_DHparams +and +.Fn i2d_DHparams +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . diff --git a/man/d2i_DIST_POINT.3 b/man/d2i_DIST_POINT.3 index 8862d336..34bdb26f 100644 --- a/man/d2i_DIST_POINT.3 +++ b/man/d2i_DIST_POINT.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_DIST_POINT.3,v 1.1 2016/12/28 20:36:33 schwarze Exp $ +.\" $OpenBSD: d2i_DIST_POINT.3,v 1.4 2018/03/23 04:34:23 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt D2I_DIST_POINT 3 .Os .Sh NAME @@ -175,3 +175,27 @@ if an error occurs. .Sh STANDARDS RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile +.Sh HISTORY +.Fn d2i_DIST_POINT , +.Fn i2d_DIST_POINT , +.Fn d2i_CRL_DIST_POINTS , +.Fn i2d_CRL_DIST_POINTS , +.Fn d2i_DIST_POINT_NAME , +and +.Fn i2d_DIST_POINT_NAME +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . +.Pp +.Fn d2i_ACCESS_DESCRIPTION , +.Fn i2d_ACCESS_DESCRIPTION , +.Fn d2i_AUTHORITY_INFO_ACCESS , +and +.Fn i2d_AUTHORITY_INFO_ACCESS +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn d2i_ISSUING_DIST_POINT +and +.Fn i2d_ISSUING_DIST_POINT +first appeared in OpenSSL 1.0.0 and have been available since +.Ox 4.9 . diff --git a/man/d2i_DSAPublicKey.3 b/man/d2i_DSAPublicKey.3 index 660159b3..37ef22e1 100644 --- a/man/d2i_DSAPublicKey.3 +++ b/man/d2i_DSAPublicKey.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_DSAPublicKey.3,v 1.8 2016/12/25 14:38:55 schwarze Exp $ +.\" $OpenBSD: d2i_DSAPublicKey.3,v 1.14 2018/08/26 17:03:32 tb Exp $ .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: August 26 2018 $ .Dt D2I_DSAPUBLICKEY 3 .Os .Sh NAME @@ -69,6 +69,10 @@ .Nm i2d_DSAPrivateKey_fp , .Nm d2i_DSAparams , .Nm i2d_DSAparams , +.Nm d2i_DSAparams_bio , +.Nm i2d_DSAparams_bio , +.Nm d2i_DSAparams_fp , +.Nm i2d_DSAparams_fp , .Nm DSAparams_dup , .Nm d2i_DSA_SIG , .Nm i2d_DSA_SIG @@ -86,6 +90,7 @@ .Fa "const DSA *val_in" .Fa "unsigned char **der_out" .Fc +.In openssl/x509.h .Ft DSA * .Fo d2i_DSA_PUBKEY .Fa "DSA **val_out" @@ -117,6 +122,7 @@ .Fa "FILE *out_fp" .Fa "DSA *val_in" .Fc +.In openssl/dsa.h .Ft DSA * .Fo d2i_DSAPrivateKey .Fa "DSA **val_out" @@ -128,6 +134,7 @@ .Fa "const DSA *val_in" .Fa "unsigned char **der_out" .Fc +.In openssl/x509.h .Ft DSA * .Fo d2i_DSAPrivateKey_bio .Fa "BIO *in_bio" @@ -148,6 +155,7 @@ .Fa "FILE *out_fp" .Fa "DSA *val_in" .Fc +.In openssl/dsa.h .Ft DSA * .Fo d2i_DSAparams .Fa "DSA **val_out" @@ -160,6 +168,26 @@ .Fa "unsigned char **der_out" .Fc .Ft DSA * +.Fo d2i_DSAparams_bio +.Fa "BIO *in_bio" +.Fa "DSA **val_out" +.Fc +.Ft int +.Fo i2d_DSAparams_bio +.Fa "BIO *out_bio" +.Fa "DSA *val_in" +.Fc +.Ft DSA * +.Fo d2i_DSAparams_fp +.Fa "FILE *in_fp" +.Fa "DSA **val_out" +.Fc +.Ft int +.Fo i2d_DSAparams_fp +.Fa FILE *out_fp +.Fa "DSA *val_in" +.Fc +.Ft DSA * .Fo DSAparams_dup .Fa "DSA *val_in" .Fc @@ -246,7 +274,6 @@ For private key security when writing private keys to files, consider using .Xr PEM_write_DSAPrivateKey 3 instead. -The .Fn d2i_DSAPrivateKey_bio , .Fn d2i_DSAPrivateKey_fp , .Fn i2d_DSAPrivateKey_bio , @@ -267,6 +294,15 @@ structure defined in RFC 3279 section 2.3.2 and used for the parameters field of the ASN.1 .Vt AlgorithmIdentifier structure defined in RFC 5280 section 4.1.1.2. +.Fn d2i_DSAparams_bio , +.Fn i2d_DSAparams_bio , +.Fn d2i_DSAparams_fp , +.Fn i2d_DSAparams_fp +are similar except that they decode or encode using a +.Vt BIO +or +.Vt FILE +pointer. .Pp .Fn DSAparams_dup allocates and initializes an empty @@ -299,6 +335,8 @@ structure described in RFC 5280 sections 4.1.1.3 and 5.1.1.3. .Fn d2i_DSAPrivateKey_bio , .Fn d2i_DSAPrivateKey_fp , .Fn d2i_DSAparams , +.Fn d2i_DSAparams_bio , +.Fn d2i_DSAparams_fp , and .Fn DSAparams_dup return a valid @@ -334,3 +372,41 @@ section 2.2.2: DSA Signature Algorithm .It section 2.3.2: DSA Signature Keys .El +.Sh HISTORY +.Fn d2i_DSAPublicKey , +.Fn i2d_DSAPublicKey , +.Fn d2i_DSAPrivateKey , +and +.Fn i2d_DSAPrivateKey +first appeared in SSLeay 0.6.0. +.Fn d2i_DSAPrivateKey_bio , +.Fn d2i_DSAPrivateKey_fp , +.Fn i2d_DSAPrivateKey_bio , +.Fn i2d_DSAPrivateKey_fp , +.Fn d2i_DSAparams , +.Fn i2d_DSAparams , +.Fn d2i_DSAparams_bio , +.Fn i2d_DSAparams_bio , +.Fn d2i_DSAparams_fp , +.Fn i2d_DSAparams_fp , +and +.Fn DSAparams_dup +first appeared in SSLeay 0.8.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn d2i_DSA_SIG +and +.Fn i2d_DSA_SIG +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . +.Pp +.Fn d2i_DSA_PUBKEY , +.Fn i2d_DSA_PUBKEY , +.Fn d2i_DSA_PUBKEY_bio , +.Fn d2i_DSA_PUBKEY_fp , +.Fn i2d_DSA_PUBKEY_bio , +and +.Fn i2d_DSA_PUBKEY_fp +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/d2i_ECPKParameters.3 b/man/d2i_ECPKParameters.3 index 6557d75d..e82e7911 100644 --- a/man/d2i_ECPKParameters.3 +++ b/man/d2i_ECPKParameters.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_ECPKParameters.3,v 1.10 2017/08/01 14:57:03 schwarze Exp $ +.\" $OpenBSD: d2i_ECPKParameters.3,v 1.12 2018/05/19 22:51:40 schwarze Exp $ .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 1 2017 $ +.Dd $Mdocdate: May 19 2018 $ .Dt D2I_ECPKPARAMETERS 3 .Os .Sh NAME @@ -184,7 +184,7 @@ .Fc .Ft int .Fo i2o_ECPublicKey -.Fa "EC_KEY *val_in" +.Fa "const EC_KEY *val_in" .Fa "unsigned char **des_out" .Fc .Ft int @@ -434,3 +434,34 @@ Private-Key Information Syntax Specification RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.1: Basic Certificate Fields +.Sh HISTORY +.Fn d2i_ECPKParameters , +.Fn i2d_ECPKParameters , +.Fn d2i_ECPKParameters_bio , +.Fn i2d_ECPKParameters_bio , +.Fn d2i_ECPKParameters_fP , +.Fn i2d_ECPKParameters_fp , +.Fn d2i_ECParameters , +.Fn i2d_ECParameters , +.Fn ECParameters_dup , +.Fn d2i_ECPrivateKey , +.Fn i2d_ECPrivateKey , +.Fn d2i_ECPrivateKey_bio , +.Fn i2d_ECPrivateKey_bio , +.Fn d2i_ECPrivateKey_fp , +.Fn i2d_ECPrivateKey_fp , +.Fn o2i_ECPublicKey , +.Fn i2o_ECPublicKey , +.Fn ECPKParameters_print , +.Fn ECPKParameters_print_fp , +.Fn ECParameters_print , +.Fn ECParameters_print_fp , +.Fn d2i_EC_PUBKEY , +.Fn i2d_EC_PUBKEY , +.Fn d2i_EC_PUBKEY_bio , +.Fn i2d_EC_PUBKEY_bio , +.Fn d2i_EC_PUBKEY_fp , +and +.Fn i2d_EC_PUBKEY_fp +first appeared in OpenSSL 0.9.8 and have been available since +.Ox 4.5 . diff --git a/man/d2i_ESS_SIGNING_CERT.3 b/man/d2i_ESS_SIGNING_CERT.3 index 31c3cc8e..c1d61d3b 100644 --- a/man/d2i_ESS_SIGNING_CERT.3 +++ b/man/d2i_ESS_SIGNING_CERT.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_ESS_SIGNING_CERT.3,v 1.1 2016/12/27 20:56:18 schwarze Exp $ +.\" $OpenBSD: d2i_ESS_SIGNING_CERT.3,v 1.2 2018/03/23 04:34:23 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 27 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt D2I_ESS_SIGNING_CERT 3 .Os .Sh NAME @@ -112,3 +112,7 @@ if an error occurs. .Sh STANDARDS RFC 2634: Enhanced Security Services for S/MIME, section 5: Signing Certificate Attribute +.Sh HISTORY +These functions first appeared in OpenSSL 1.0.0 +and have been available since +.Ox 4.9 . diff --git a/man/d2i_GENERAL_NAME.3 b/man/d2i_GENERAL_NAME.3 index 0340d1e5..bfdcc6c6 100644 --- a/man/d2i_GENERAL_NAME.3 +++ b/man/d2i_GENERAL_NAME.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_GENERAL_NAME.3,v 1.1 2016/12/28 20:36:33 schwarze Exp $ +.\" $OpenBSD: d2i_GENERAL_NAME.3,v 1.4 2018/03/22 21:08:22 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt D2I_GENERAL_NAME 3 .Os .Sh NAME @@ -138,3 +138,23 @@ if an error occurs. RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.2: Certificate Extensions +.Sh HISTORY +.Fn d2i_GENERAL_NAME , +.Fn i2d_GENERAL_NAME , +.Fn d2i_GENERAL_NAMES , +and +.Fn i2d_GENERAL_NAMES +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . +.Pp +.Fn d2i_OTHERNAME +and +.Fn i2d_OTHERNAME +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn d2i_EDIPARTYNAME +and +.Fn i2d_EDIPARTYNAME +first appeared in OpenSSL 0.9.7 and have been available since +.Ox 3.2 . diff --git a/man/d2i_OCSP_REQUEST.3 b/man/d2i_OCSP_REQUEST.3 index 3f6320a1..cc07bd7d 100644 --- a/man/d2i_OCSP_REQUEST.3 +++ b/man/d2i_OCSP_REQUEST.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_OCSP_REQUEST.3,v 1.1 2016/12/27 22:06:55 schwarze Exp $ +.\" $OpenBSD: d2i_OCSP_REQUEST.3,v 1.2 2018/03/22 21:08:22 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 27 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt D2I_OCSP_REQUEST 3 .Os .Sh NAME @@ -175,3 +175,7 @@ if an error occurs. .Sh STANDARDS RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.1: Request Syntax +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 3.2 . diff --git a/man/d2i_OCSP_RESPONSE.3 b/man/d2i_OCSP_RESPONSE.3 index bdc54913..72db8ab0 100644 --- a/man/d2i_OCSP_RESPONSE.3 +++ b/man/d2i_OCSP_RESPONSE.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_OCSP_RESPONSE.3,v 1.1 2016/12/27 22:06:55 schwarze Exp $ +.\" $OpenBSD: d2i_OCSP_RESPONSE.3,v 1.2 2018/03/22 21:08:22 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 27 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt D2I_OCSP_RESPONSE 3 .Os .Sh NAME @@ -241,3 +241,7 @@ if an error occurs. .Sh STANDARDS RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.2: Response Syntax +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.7 +and have been available since +.Ox 3.2 . diff --git a/man/d2i_PKCS12.3 b/man/d2i_PKCS12.3 index 5b151300..55272d1f 100644 --- a/man/d2i_PKCS12.3 +++ b/man/d2i_PKCS12.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_PKCS12.3,v 1.1 2016/12/26 18:04:45 schwarze Exp $ +.\" $OpenBSD: d2i_PKCS12.3,v 1.2 2018/03/21 17:57:48 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 26 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt D2I_PKCS12 3 .Os .Sh NAME @@ -184,3 +184,19 @@ return 1 for success or 0 if an error occurs. .Xr PKCS12_SAFEBAG_new 3 .Sh STANDARDS RFC 7292: PKCS #12: Personal Information Exchange Syntax +.Sh HISTORY +.Fn d2i_PKCS12 , +.Fn i2d_PKCS12 , +.Fn d2i_PKCS12_bio , +.Fn i2d_PKCS12_bio , +.Fn d2i_PKCS12_fp , +.Fn i2d_PKCS12_fp , +.Fn d2i_PKCS12_MAC_DATA , +.Fn i2d_PKCS12_MAC_DATA , +.Fn d2i_PKCS12_SAFEBAG , +.Fn i2d_PKCS12_SAFEBAG , +.Fn d2i_PKCS12_BAGS , +and +.Fn i2d_PKCS12_BAGS +first appeared in OpenSSL 0.9.3 and have been available since +.Ox 2.6 . diff --git a/man/d2i_PKCS7.3 b/man/d2i_PKCS7.3 index f728ba0b..0581583f 100644 --- a/man/d2i_PKCS7.3 +++ b/man/d2i_PKCS7.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_PKCS7.3,v 1.4 2016/12/27 13:10:26 schwarze Exp $ +.\" $OpenBSD: d2i_PKCS7.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 27 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_PKCS7 3 .Os .Sh NAME @@ -324,3 +324,31 @@ return 1 for success or 0 if an error occurs. .Xr SMIME_write_PKCS7 3 .Sh STANDARDS RFC 2315: PKCS #7: Cryptographic Message Syntax Version 1.5 +.Sh HISTORY +.Fn d2i_PKCS7 , +.Fn i2d_PKCS7 , +.Fn d2i_PKCS7_bio , +.Fn i2d_PKCS7_bio , +.Fn d2i_PKCS7_fp , +.Fn i2d_PKCS7_fp , +.Fn d2i_PKCS7_DIGEST , +.Fn i2d_PKCS7_DIGEST , +.Fn d2i_PKCS7_ENCRYPT , +.Fn i2d_PKCS7_ENCRYPT , +.Fn d2i_PKCS7_ENC_CONTENT , +.Fn i2d_PKCS7_ENC_CONTENT , +.Fn d2i_PKCS7_ENVELOPE , +.Fn i2d_PKCS7_ENVELOPE , +.Fn d2i_PKCS7_ISSUER_AND_SERIAL , +.Fn i2d_PKCS7_ISSUER_AND_SERIAL , +.Fn d2i_PKCS7_RECIP_INFO , +.Fn i2d_PKCS7_RECIP_INFO , +.Fn d2i_PKCS7_SIGNED , +.Fn i2d_PKCS7_SIGNED , +.Fn d2i_PKCS7_SIGNER_INFO , +.Fn i2d_PKCS7_SIGNER_INFO , +.Fn d2i_PKCS7_SIGN_ENVELOPE , +and +.Fn i2d_PKCS7_SIGN_ENVELOPE +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . diff --git a/man/d2i_PKCS8PrivateKey_bio.3 b/man/d2i_PKCS8PrivateKey_bio.3 index 1fe85038..9ac275e2 100644 --- a/man/d2i_PKCS8PrivateKey_bio.3 +++ b/man/d2i_PKCS8PrivateKey_bio.3 @@ -1,8 +1,8 @@ -.\" $OpenBSD: d2i_PKCS8PrivateKey_bio.3,v 1.8 2017/01/07 17:27:15 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: d2i_PKCS8PrivateKey_bio.3,v 1.10 2018/03/22 16:06:33 schwarze Exp $ +.\" full merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 2002, 2016 The OpenSSL Project. All rights reserved. +.\" Copyright (c) 2002, 2016, 2017 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 @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 7 2017 $ +.Dd $Mdocdate: March 22 2018 $ .Dt D2I_PKCS8PRIVATEKEY_BIO 3 .Os .Sh NAME @@ -144,10 +144,30 @@ by converting the buffers to memory BIOs; see .Xr BIO_s_mem 3 for details. +.Sh RETURN VALUES +.Fn d2i_PKCS8PrivateKey_bio +and +.Fn d2i_PKCS8PrivateKey_fp +return a +.Vt EVP_PKEY +object or +.Dv NULL +if an error occurs. +.Pp +.Fn i2d_PKCS8PrivateKey_bio , +.Fn i2d_PKCS8PrivateKey_fp , +.Fn i2d_PKCS8PrivateKey_nid_bio , +and +.Fn i2d_PKCS8PrivateKey_nid_fp +return 1 on success or 0 on error. .Sh SEE ALSO .Xr d2i_X509_SIG 3 , .Xr PEM_write_PKCS8PrivateKey 3 , .Xr PKCS8_PRIV_KEY_INFO_new 3 +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.5 +and have been available since +.Ox 2.7 . .Sh CAVEATS Do not confuse these functions with .Xr i2d_PKCS8PrivateKeyInfo_bio 3 diff --git a/man/d2i_PKCS8_PRIV_KEY_INFO.3 b/man/d2i_PKCS8_PRIV_KEY_INFO.3 index 2ee7d807..1ac0f2c3 100644 --- a/man/d2i_PKCS8_PRIV_KEY_INFO.3 +++ b/man/d2i_PKCS8_PRIV_KEY_INFO.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_PKCS8_PRIV_KEY_INFO.3,v 1.1 2016/12/28 00:55:05 schwarze Exp $ +.\" $OpenBSD: d2i_PKCS8_PRIV_KEY_INFO.3,v 1.3 2018/03/21 21:18:08 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt D2I_PKCS8_PRIV_KEY_INFO 3 .Os .Sh NAME @@ -112,3 +112,16 @@ return 1 for success or 0 if an error occurs. .Xr PKCS8_PRIV_KEY_INFO_new 3 .Sh STANDARDS RFC 5208: PKCS#8: Private-Key Information Syntax Specification +.Sh HISTORY +.Fn d2i_PKCS8_PRIV_KEY_INFO +and +.Fn i2d_PKCS8_PRIV_KEY_INFO +first appeared in OpenSSL 0.9.3. +.Fn d2i_PKCS8_PRIV_KEY_INFO_bio , +.Fn i2d_PKCS8_PRIV_KEY_INFO_bio , +.Fn d2i_PKCS8_PRIV_KEY_INFO_fp , +and +.Fn i2d_PKCS8_PRIV_KEY_INFO_fp +first appeared in OpenSSL 0.9.4. +All these functions have been available since +.Ox 2.6 . diff --git a/man/d2i_PKEY_USAGE_PERIOD.3 b/man/d2i_PKEY_USAGE_PERIOD.3 index 547b7797..df863926 100644 --- a/man/d2i_PKEY_USAGE_PERIOD.3 +++ b/man/d2i_PKEY_USAGE_PERIOD.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_PKEY_USAGE_PERIOD.3,v 1.1 2016/12/28 20:36:33 schwarze Exp $ +.\" $OpenBSD: d2i_PKEY_USAGE_PERIOD.3,v 1.2 2018/03/21 16:09:51 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt D2I_PKEY_USAGE_PERIOD 3 .Os .Sh NAME @@ -66,3 +66,9 @@ section 4.2.1.4: Private Key Usage Period RFC 3280 was obsoleted by RFC 5280; see .Xr PKEY_USAGE_PERIOD_new 3 for details. +.Sh HISTORY +.Fn d2i_PKEY_USAGE_PERIOD +and +.Fn i2d_PKEY_USAGE_PERIOD +first appeared in OpenSSL 0.9.2b and have been available since +.Ox 2.6 . diff --git a/man/d2i_POLICYINFO.3 b/man/d2i_POLICYINFO.3 index 6a93059b..bae78b17 100644 --- a/man/d2i_POLICYINFO.3 +++ b/man/d2i_POLICYINFO.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_POLICYINFO.3,v 1.1 2016/12/28 20:36:33 schwarze Exp $ +.\" $OpenBSD: d2i_POLICYINFO.3,v 1.2 2018/03/21 17:57:48 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 21 2018 $ .Dt D2I_POLICYINFO 3 .Os .Sh NAME @@ -159,3 +159,7 @@ if an error occurs. RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.2.1.4: Certificate Policies +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.3 +and have been available since +.Ox 2.6 . diff --git a/man/d2i_PROXY_POLICY.3 b/man/d2i_PROXY_POLICY.3 index 0c447b10..794c6edc 100644 --- a/man/d2i_PROXY_POLICY.3 +++ b/man/d2i_PROXY_POLICY.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_PROXY_POLICY.3,v 1.1 2016/12/28 20:36:33 schwarze Exp $ +.\" $OpenBSD: d2i_PROXY_POLICY.3,v 1.2 2018/03/22 22:07:12 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 22 2018 $ .Dt D2I_PROXY_POLICY 3 .Os .Sh NAME @@ -91,3 +91,7 @@ if an error occurs. .Sh STANDARDS RFC 3820: Internet X.509 Public Key Infrastructure (PKI) Proxy Certificate Profile +.Sh HISTORY +These functions first appeared in OpenSSL 0.9.7g +and have been available since +.Ox 3.8 . diff --git a/man/d2i_PrivateKey.3 b/man/d2i_PrivateKey.3 index caf74792..85b46d44 100644 --- a/man/d2i_PrivateKey.3 +++ b/man/d2i_PrivateKey.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_PrivateKey.3,v 1.5 2016/12/28 01:38:16 schwarze Exp $ +.\" $OpenBSD: d2i_PrivateKey.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file is a derived work. @@ -65,7 +65,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_PRIVATEKEY 3 .Os .Sh NAME @@ -265,3 +265,22 @@ For all functions, the error code can be obtained by calling .Sh STANDARDS RFC 5208: Public-Key Cryptography Standards (PKCS) #8: Private-Key Information Syntax Specification +.Sh HISTORY +.Fn d2i_PrivateKey , +.Fn i2d_PrivateKey , +.Fn d2i_PublicKey , +and +.Fn i2d_PublicKey +first appeared in SSLeay 0.6.0 and have been available since +.Ox 2.4 . +.Pp +.Fn d2i_AutoPrivateKey , +.Fn d2i_PrivateKey_bio , +.Fn i2d_PrivateKey_bio , +.Fn d2i_PrivateKey_fp , +.Fn i2d_PrivateKey_fp , +.Fn i2d_PKCS8PrivateKeyInfo_bio , +and +.Fn i2d_PKCS8PrivateKeyInfo_fp +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/d2i_RSAPublicKey.3 b/man/d2i_RSAPublicKey.3 index c5264a61..d6c376d8 100644 --- a/man/d2i_RSAPublicKey.3 +++ b/man/d2i_RSAPublicKey.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_RSAPublicKey.3,v 1.9 2016/12/26 17:19:23 schwarze Exp $ +.\" $OpenBSD: d2i_RSAPublicKey.3,v 1.13 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 .\" .\" This file is a derived work. @@ -67,7 +67,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 26 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_RSAPUBLICKEY 3 .Os .Sh NAME @@ -348,3 +348,42 @@ RFC 8017: PKCS #1: RSA Cryptography Specifications RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.1: Basic Certificate Fields +.Sh HISTORY +.Fn d2i_RSAPublicKey , +.Fn i2d_RSAPublicKey , +.Fn d2i_RSAPrivateKey , +.Fn i2d_RSAPrivateKey , +.Fn d2i_RSAPrivateKey_fp , +.Fn i2d_RSAPrivateKey_fp , +.Fn d2i_Netscape_RSA , +and +.Fn i2d_Netscape_RSA +first appeared in SSLeay 0.5.1. +.Fn d2i_RSAPrivateKey_bio +and +.Fn i2d_RSAPrivateKey_bio +first appeared in SSLeay 0.6.0. +.Fn d2i_RSAPublicKey_bio , +.Fn d2i_RSAPublicKey_fp , +.Fn i2d_RSAPublicKey_bio , +and +.Fn i2d_RSAPublicKey_fp +first appeared in SSLeay 0.8.1. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn d2i_RSA_PUBKEY , +.Fn i2d_RSA_PUBKEY , +.Fn d2i_RSA_PUBKEY_bio , +.Fn d2i_RSA_PUBKEY_fp , +.Fn i2d_RSA_PUBKEY_bio , +and +.Fn i2d_RSA_PUBKEY_fp +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . +.Pp +.Fn d2i_RSA_PSS_PARAMS +and +.Fn i2d_RSA_PSS_PARAMS +first appeared in OpenSSL 1.0.1 and have been available since +.Ox 5.3 . diff --git a/man/d2i_SSL_SESSION.3 b/man/d2i_SSL_SESSION.3 index 57f140ab..9c5c2285 100644 --- a/man/d2i_SSL_SESSION.3 +++ b/man/d2i_SSL_SESSION.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_SSL_SESSION.3,v 1.3 2017/04/10 16:11:50 schwarze Exp $ +.\" $OpenBSD: d2i_SSL_SESSION.3,v 1.6 2018/08/27 15:42:39 jsing Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Lutz Jaenicke . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 10 2017 $ +.Dd $Mdocdate: August 27 2018 $ .Dt D2I_SSL_SESSION 3 .Os .Sh NAME @@ -131,31 +131,29 @@ the memory location pointed to by .Fa pp must be large enough to hold the binary representation of the session. There is no known limit on the size of the created ASN1 representation, -so the necessary amount of space should be obtained by first calling +so call .Fn i2d_SSL_SESSION -with -.Fa pp Ns -= Ns -.Dv NULL , -and obtain the size needed, then allocate the memory and call +first with +.Fa pp Ns = Ns Dv NULL +to obtain the encoded size, before allocating the required amount of memory and +calling .Fn i2d_SSL_SESSION again. Note that this will advance the value contained in .Fa *pp so it is necessary to save a copy of the original allocation. For example: -.Bd -literal -int i, j; +.Bd -literal -offset indent +char *p, *pp; +int elen, len; -char *p, *temp; - - i = i2d_SSL_SESSION(sess, NULL); - p = temp = malloc(i); - if (temp != NULL) { - j = i2d_SSL_SESSION(sess, &temp); - assert(i == j); - assert(p + i == temp); - } +elen = i2d_SSL_SESSION(sess, NULL); +p = pp = malloc(elen); +if (p != NULL) { + len = i2d_SSL_SESSION(sess, &pp); + assert(elen == len); + assert(p + len == pp); +} .Ed .Sh RETURN VALUES .Fn d2i_SSL_SESSION @@ -175,3 +173,9 @@ When the session is not valid, 0 is returned and no operation is performed. .Xr ssl 3 , .Xr SSL_CTX_sess_set_get_cb 3 , .Xr SSL_SESSION_free 3 +.Sh HISTORY +.Fn d2i_SSL_SESSION +and +.Fn i2d_SSL_SESSION +first appeared in SSLeay 0.5.2 and have been available since +.Ox 2.4 . diff --git a/man/d2i_TS_REQ.3 b/man/d2i_TS_REQ.3 index 7841843c..9f7c860f 100644 --- a/man/d2i_TS_REQ.3 +++ b/man/d2i_TS_REQ.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_TS_REQ.3,v 1.1 2016/12/27 20:56:18 schwarze Exp $ +.\" $OpenBSD: d2i_TS_REQ.3,v 1.2 2018/03/23 04:34:23 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 27 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt D2I_TS_REQ 3 .Os .Sh NAME @@ -327,3 +327,7 @@ return 1 for success or 0 if an error occurs. .Xr TS_REQ_new 3 .Sh STANDARDS RFC 3161: Internet X.509 Public Key Infrastructure Time-Stamp Protocol +.Sh HISTORY +These functions first appeared in OpenSSL 1.0.0 +and have been available since +.Ox 4.9 . diff --git a/man/d2i_X509.3 b/man/d2i_X509.3 index 1ade0a42..94b136a0 100644 --- a/man/d2i_X509.3 +++ b/man/d2i_X509.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_X509.3,v 1.6 2016/12/28 03:56:35 schwarze Exp $ +.\" $OpenBSD: d2i_X509.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 94480b57 Sep 12 23:34:41 2009 +0000 .\" .\" This file is a derived work. @@ -66,7 +66,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_X509 3 .Os .Sh NAME @@ -272,9 +272,25 @@ Certificate Revocation List (CRL) Profile .Sh HISTORY .Fn d2i_X509 , .Fn i2d_X509 , -.Fn d2i_X509_bio , .Fn d2i_X509_fp , -.Fn i2d_X509_bio , +.Fn i2d_X509_fp , +.Fn d2i_X509_CINF , +.Fn i2d_X509_CINF , +.Fn d2i_X509_VAL , and -.Fn i2d_X509_fp -are available in all versions of SSLeay and OpenSSL. +.Fn i2d_X509_VAL +first appeared in SSLeay 0.5.1. +.Fn d2i_X509_bio +and +.Fn i2d_X509_bio +first appeared in SSLeay 0.6.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn d2i_X509_AUX , +.Fn i2d_X509_AUX , +.Fn d2i_X509_CERT_AUX , +and +.Fn i2d_X509_CERT_AUX +first appeared in OpenSSL 0.9.5 and have been available since +.Ox 2.7 . diff --git a/man/d2i_X509_ALGOR.3 b/man/d2i_X509_ALGOR.3 index dcae72ad..530ae86c 100644 --- a/man/d2i_X509_ALGOR.3 +++ b/man/d2i_X509_ALGOR.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_X509_ALGOR.3,v 1.7 2016/12/28 14:17:47 schwarze Exp $ +.\" $OpenBSD: d2i_X509_ALGOR.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700 .\" .\" Copyright (c) 2016 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_X509_ALGOR 3 .Os .Sh NAME @@ -50,3 +50,9 @@ For details about the semantics, examples, caveats, and bugs, see .Sh STANDARDS RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile +.Sh HISTORY +.Fn d2i_X509_ALGOR +and +.Fn i2d_X509_ALGOR +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . diff --git a/man/d2i_X509_ATTRIBUTE.3 b/man/d2i_X509_ATTRIBUTE.3 index c8a17571..6b070e5e 100644 --- a/man/d2i_X509_ATTRIBUTE.3 +++ b/man/d2i_X509_ATTRIBUTE.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_X509_ATTRIBUTE.3,v 1.1 2016/12/28 13:45:30 schwarze Exp $ +.\" $OpenBSD: d2i_X509_ATTRIBUTE.3,v 1.3 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_X509_ATTRIBUTE 3 .Os .Sh NAME @@ -68,3 +68,9 @@ if an error occurs. ITU-T Recommendation X.501, also known as ISO/IEC 9594-2: Information Technology Open Systems Interconnection The Directory: Models, section 8.2: Overall structure +.Sh HISTORY +.Fn d2i_X509_ATTRIBUTE +and +.Fn i2d_X509_ATTRIBUTE +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . diff --git a/man/d2i_X509_CRL.3 b/man/d2i_X509_CRL.3 index 398af4cd..920be4aa 100644 --- a/man/d2i_X509_CRL.3 +++ b/man/d2i_X509_CRL.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_X509_CRL.3,v 1.5 2016/12/28 14:59:39 schwarze Exp $ +.\" $OpenBSD: d2i_X509_CRL.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 .\" .\" Copyright (c) 2016 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_X509_CRL 3 .Os .Sh NAME @@ -129,3 +129,20 @@ structure. RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 5: CRL and CRL Extensions Profile +.Sh HISTORY +.Fn d2i_X509_CRL , +.Fn i2d_X509_CRL , +.Fn d2i_X509_CRL_fp , +.Fn i2d_X509_CRL_fp , +.Fn d2i_X509_CRL_INFO , +.Fn i2d_X509_CRL_INFO , +.Fn d2i_X509_REVOKED , +and +.Fn i2d_X509_REVOKED +first appeared in SSLeay 0.5.1. +.Fn d2i_X509_CRL_bio +and +.Fn i2d_X509_CRL_bio +first appeared in SSLeay 0.6.0. +These functions have been available since +.Ox 2.4 . diff --git a/man/d2i_X509_EXTENSION.3 b/man/d2i_X509_EXTENSION.3 index 8b31e2c6..46a680c1 100644 --- a/man/d2i_X509_EXTENSION.3 +++ b/man/d2i_X509_EXTENSION.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_X509_EXTENSION.3,v 1.1 2016/12/28 13:45:30 schwarze Exp $ +.\" $OpenBSD: d2i_X509_EXTENSION.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_X509_EXTENSION 3 .Os .Sh NAME @@ -90,3 +90,15 @@ if an error occurs. .Sh STANDARDS RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile +.Sh HISTORY +.Fn d2i_X509_EXTENSION +and +.Fn i2d_X509_EXTENSION +first appeared in SSLeay 0.6.2 and have been available since +.Ox 2.4 . +.Pp +.Fn d2i_X509_EXTENSIONS +and +.Fn i2d_X509_EXTENSIONS +first appeared in OpenSSL 0.9.8h and have been available since +.Ox 4.5 . diff --git a/man/d2i_X509_NAME.3 b/man/d2i_X509_NAME.3 index 3dd337c4..3289ccb1 100644 --- a/man/d2i_X509_NAME.3 +++ b/man/d2i_X509_NAME.3 @@ -1,7 +1,9 @@ -.\" $OpenBSD: d2i_X509_NAME.3,v 1.10 2017/01/07 08:46:13 jmc Exp $ -.\" OpenSSL d900a015 Oct 8 14:40:42 2015 +0200 +.\" $OpenBSD: d2i_X509_NAME.3,v 1.14 2018/03/27 17:35:50 schwarze Exp $ +.\" checked up to: +.\" OpenSSL crypto/d2i_X509_NAME 4692340e Jun 7 15:49:08 2016 -0400 and +.\" OpenSSL man3/X509_NAME_get0_der 99d63d46 Oct 26 13:56:48 2016 -0400 .\" -.\" Copyright (c) 2016, 2017 Ingo Schwarze +.\" Copyright (c) 2016, 2017, 2018 Ingo Schwarze .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -15,12 +17,13 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 7 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_X509_NAME 3 .Os .Sh NAME .Nm d2i_X509_NAME , .Nm i2d_X509_NAME , +.Nm X509_NAME_get0_der , .Nm X509_NAME_dup , .Nm X509_NAME_hash , .Nm d2i_X509_NAME_ENTRY , @@ -28,7 +31,7 @@ .Nm X509_NAME_ENTRY_dup .\" In the following line, "X.501" and "Name" are not typos. .\" The "Name" type is defined in X.501, not in X.509. -.\" The type in called "Name" with capital "N", not "name". +.\" The type is called "Name" with capital "N", not "name". .Nd decode and encode X.501 Name objects .Sh SYNOPSIS .In openssl/x509.h @@ -43,6 +46,12 @@ .Fa "X509_NAME *val_in" .Fa "unsigned char **der_out" .Fc +.Ft int +.Fo X509_NAME_get0_der +.Fa "X509_NAME *val_in" +.Fa "const unsigned char **der_out" +.Fa "size_t *out_len" +.Fc .Ft X509_NAME * .Fo X509_NAME_dup .Fa "X509_NAME *val_in" @@ -80,6 +89,17 @@ decode and encode an ASN.1 .Vt Name structure defined in RFC 5280 section 4.1.2.4. .Pp +.Fn X509_NAME_get0_der +is a variant of +.Fn i2d_X509_NAME +that does not copy the encoded output but instead returns a pointer +to the internally cached DER-encoded version of the name. +Also, it does not return the length of the output in bytes, +but instead stores it in +.Fa out_len . +If the cached encoded form happens to be out of date, both functions +update it before copying it or returning a pointer to it. +.Pp .Fn X509_NAME_dup copies .Fa val_in @@ -121,6 +141,9 @@ object or .Dv NULL if an error occurs. .Pp +.Fn X509_NAME_get0_der +returns 1 on success or 0 if an error occurs. +.Pp .Fn X509_NAME_hash returns the hash value or 0 if an error occurs. .Pp @@ -151,3 +174,21 @@ ITU-T Recommendation X.690, also known as ISO/IEC 8825-1: Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER). +.Sh HISTORY +.Fn X509_NAME_dup +first appeared in SSLeay 0.4.4. +.Fn d2i_X509_NAME , +.Fn i2d_X509_NAME , +.Fn d2i_X509_NAME_ENTRY , +.Fn i2d_X509_NAME_ENTRY , +and +.Fn X509_NAME_ENTRY_dup +first appeared in SSLeay 0.5.1. +.Fn X509_NAME_hash +first appeared in SSLeay 0.8.0. +These functions have been available since +.Ox 2.4 . +.Pp +.Fn X509_NAME_get0_der +first appeared in OpenSSL 1.1.0 and has been available since +.Ox 6.3 . diff --git a/man/d2i_X509_REQ.3 b/man/d2i_X509_REQ.3 index e3e537fb..95785a2d 100644 --- a/man/d2i_X509_REQ.3 +++ b/man/d2i_X509_REQ.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_X509_REQ.3,v 1.5 2016/12/28 15:18:05 schwarze Exp $ +.\" $OpenBSD: d2i_X509_REQ.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 .\" .\" Copyright (c) 2016 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_X509_REQ 3 .Os .Sh NAME @@ -134,3 +134,18 @@ return 1 for success or 0 if an error occurs. .Xr X509_REQ_new 3 .Sh STANDARDS RFC 2986: PKCS #10: Certification Request Syntax Specification +.Sh HISTORY +.Fn d2i_X509_REQ , +.Fn i2d_X509_REQ , +.Fn d2i_X509_REQ_fp , +.Fn i2d_X509_REQ_fp , +.Fn d2i_X509_REQ_INFO , +and +.Fn i2d_X509_REQ_INFO +first appeared in SSLeay 0.5.1. +.Fn d2i_X509_REQ_bio +and +.Fn i2d_X509_REQ_bio +first appeared in SSLeay 0.6.0. +These functions have been available since +.Ox 2.4 . diff --git a/man/d2i_X509_SIG.3 b/man/d2i_X509_SIG.3 index bf050ce2..fddeed79 100644 --- a/man/d2i_X509_SIG.3 +++ b/man/d2i_X509_SIG.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: d2i_X509_SIG.3,v 1.6 2016/12/28 02:48:59 schwarze Exp $ +.\" $OpenBSD: d2i_X509_SIG.3,v 1.9 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" Copyright (c) 2016 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt D2I_X509_SIG 3 .Os .Sh NAME @@ -123,6 +123,20 @@ section 9: Signed-data content type .Pp RFC 8017: PKCS #1: RSA Cryptography Specifications, section 9: Encoding Methods for Signatures +.Sh HISTORY +.Fn d2i_X509_SIG +and +.Fn i2d_X509_SIG +first appeared in SSLeay 0.5.1 and have been available since +.Ox 2.4 . +.Pp +.Fn d2i_PKCS8_bio , +.Fn i2d_PKCS8_bio , +.Fn d2i_PKCS8_fp , +and +.Fn i2d_PKCS8_fp +first appeared in OpenSSL 0.9.4 and have been available since +.Ox 2.6 . .Sh BUGS .Fn d2i_PKCS8_bio , .Fn i2d_PKCS8_bio , diff --git a/man/des_read_pw.3 b/man/des_read_pw.3 index e772d0a6..8c63a65f 100644 --- a/man/des_read_pw.3 +++ b/man/des_read_pw.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: des_read_pw.3,v 1.6 2017/01/06 17:17:29 schwarze Exp $ +.\" $OpenBSD: des_read_pw.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL doc/crypto/ui_compat.pod May 14 11:28:00 2006 +0000 .\" OpenSSL doc/crypto/des.pod 2a9aca32 Oct 25 08:44:10 2001 +0000 .\" @@ -50,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 6 2017 $ +.Dd $Mdocdate: March 27 2018 $ .Dt DES_READ_PW 3 .Os .Sh NAME @@ -130,6 +130,15 @@ is functionally similar to .Fn des_read_pw_string . .Sh SEE ALSO .Xr UI_new 3 +.Sh HISTORY +.Fn des_read_pw_string +appeared in SSLeay 0.4 or earlier. +.Fn EVP_read_pw_string +first appeared in SSLeay 0.5.1. +.Fn des_read_pw +first appeared in SSLeay 0.8.0. +These functions have been available since +.Ox 2.4 . .Sh AUTHORS .An Richard Levitte Aq Mt richard@levitte.org for the OpenSSL project. diff --git a/man/engine.3 b/man/engine.3 deleted file mode 100644 index a8ef6a89..00000000 --- a/man/engine.3 +++ /dev/null @@ -1,1205 +0,0 @@ -.\" $OpenBSD: engine.3,v 1.10 2017/01/06 20:35:23 schwarze Exp $ -.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 -.\" -.\" This file was written by Geoff Thorpe . -.\" Copyright (c) 2002, 2004, 2007, 2015 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. -.\" -.Dd $Mdocdate: January 6 2017 $ -.Dt ENGINE 3 -.Os -.Sh NAME -.Nm ENGINE_add , -.Nm ENGINE_by_id , -.Nm ENGINE_finish , -.Nm ENGINE_get_first , -.Nm ENGINE_get_last , -.Nm ENGINE_get_next , -.Nm ENGINE_get_prev , -.Nm ENGINE_init , -.Nm ENGINE_load_builtin_engines , -.Nm ENGINE_remove -.Nd ENGINE cryptographic module support -.Sh SYNOPSIS -.In openssl/engine.h -.Ft ENGINE * -.Fn ENGINE_get_first void -.Ft ENGINE * -.Fn ENGINE_get_last void -.Ft ENGINE * -.Fo ENGINE_get_next -.Fa "ENGINE *e" -.Fc -.Ft ENGINE * -.Fo ENGINE_get_prev -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_add -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_remove -.Fa "ENGINE *e" -.Fc -.Ft ENGINE * -.Fo ENGINE_by_id -.Fa "const char *id" -.Fc -.Ft int -.Fo ENGINE_init -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_finish -.Fa "ENGINE *e" -.Fc -.Ft void -.Fn ENGINE_load_openssl void -.Ft void -.Fn ENGINE_load_dynamic void -.Ft void -.Fn ENGINE_load_cryptodev void -.Ft void -.Fn ENGINE_load_builtin_engines void -.Ft void -.Fn ENGINE_cleanup void -.Ft ENGINE * -.Fn ENGINE_get_default_RSA void -.Ft ENGINE * -.Fn ENGINE_get_default_DSA void -.Ft ENGINE * -.Fn ENGINE_get_default_ECDH void -.Ft ENGINE * -.Fn ENGINE_get_default_ECDSA void -.Ft ENGINE * -.Fn ENGINE_get_default_DH void -.Ft ENGINE * -.Fn ENGINE_get_default_RAND void -.Ft ENGINE * -.Fo ENGINE_get_cipher_engine -.Fa "int nid" -.Fc -.Ft ENGINE * -.Fo ENGINE_get_digest_engine -.Fa "int nid" -.Fc -.Ft int -.Fo ENGINE_set_default_RSA -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_set_default_DSA -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_set_default_ECDH -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_set_default_ECDSA -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_set_default_DH -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_set_default_RAND -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_set_default_ciphers -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_set_default_digests -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_set_default_string -.Fa "ENGINE *e" -.Fa "const char *list" -.Fc -.Ft int -.Fo ENGINE_set_default -.Fa "ENGINE *e" -.Fa "unsigned int flags" -.Fc -.Ft unsigned int -.Fn ENGINE_get_table_flags void -.Ft void -.Fo ENGINE_set_table_flags -.Fa "unsigned int flags" -.Fc -.Ft int -.Fo ENGINE_register_RSA -.Fa "ENGINE *e" -.Fc -.Ft void -.Fo ENGINE_unregister_RSA -.Fa "ENGINE *e" -.Fc -.Ft void -.Fn ENGINE_register_all_RSA void -.Ft int -.Fo ENGINE_register_DSA -.Fa "ENGINE *e" -.Fc -.Ft void -.Fo ENGINE_unregister_DSA -.Fa "ENGINE *e" -.Fc -.Ft void -.Fn ENGINE_register_all_DSA void -.Ft int -.Fo ENGINE_register_ECDH -.Fa "ENGINE *e" -.Fc -.Ft void -.Fo ENGINE_unregister_ECDH -.Fa "ENGINE *e" -.Fc -.Ft void -.Fn ENGINE_register_all_ECDH void -.Ft int -.Fo ENGINE_register_ECDSA -.Fa "ENGINE *e" -.Fc -.Ft void -.Fo ENGINE_unregister_ECDSA -.Fa "ENGINE *e" -.Fc -.Ft void -.Fn ENGINE_register_all_ECDSA void -.Ft int -.Fo ENGINE_register_DH -.Fa "ENGINE *e" -.Fc -.Ft void -.Fo ENGINE_unregister_DH -.Fa "ENGINE *e" -.Fc -.Ft void -.Fn ENGINE_register_all_DH void -.Ft int -.Fo ENGINE_register_RAND -.Fa "ENGINE *e" -.Fc -.Ft void -.Fo ENGINE_unregister_RAND -.Fa "ENGINE *e" -.Fc -.Ft void -.Fn ENGINE_register_all_RAND void -.Ft int -.Fo ENGINE_register_STORE -.Fa "ENGINE *e" -.Fc -.Ft void -.Fo ENGINE_unregister_STORE -.Fa "ENGINE *e" -.Fc -.Ft void -.Fn ENGINE_register_all_STORE void -.Ft int -.Fo ENGINE_register_ciphers -.Fa "ENGINE *e" -.Fc -.Ft void -.Fo ENGINE_unregister_ciphers -.Fa "ENGINE *e" -.Fc -.Ft void -.Fn ENGINE_register_all_ciphers void -.Ft int -.Fo ENGINE_register_digests -.Fa "ENGINE *e" -.Fc -.Ft void -.Fo ENGINE_unregister_digests -.Fa "ENGINE *e" -.Fc -.Ft void -.Fn ENGINE_register_all_digests void -.Ft int -.Fo ENGINE_register_complete -.Fa "ENGINE *e" -.Fc -.Ft int -.Fn ENGINE_register_all_complete void -.Ft int -.Fo ENGINE_ctrl -.Fa "ENGINE *e" -.Fa "int cmd" -.Fa "long i" -.Fa "void *p" -.Fa "void (*f)(void)" -.Fc -.Ft int -.Fo ENGINE_cmd_is_executable -.Fa "ENGINE *e" -.Fa "int cmd" -.Fc -.Ft int -.Fo ENGINE_ctrl_cmd -.Fa "ENGINE *e" -.Fa "const char *cmd_name" -.Fa "long i" -.Fa "void *p" -.Fa "void (*f)(void)" -.Fa "int cmd_optional" -.Fc -.Ft int -.Fo ENGINE_ctrl_cmd_string -.Fa "ENGINE *e" -.Fa "const char *cmd_name" -.Fa "const char *arg" -.Fa "int cmd_optional" -.Fc -.Ft ENGINE * -.Fn ENGINE_new void -.Ft int -.Fo ENGINE_free -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_up_ref -.Fa "ENGINE *e" -.Fc -.Ft int -.Fo ENGINE_set_id -.Fa "ENGINE *e" -.Fa "const char *id" -.Fc -.Ft int -.Fo ENGINE_set_name -.Fa "ENGINE *e" -.Fa "const char *name" -.Fc -.Ft int -.Fo ENGINE_set_RSA -.Fa "ENGINE *e" -.Fa "const RSA_METHOD *rsa_meth" -.Fc -.Ft int -.Fo ENGINE_set_DSA -.Fa "ENGINE *e" -.Fa "const DSA_METHOD *dsa_meth" -.Fc -.Ft int -.Fo ENGINE_set_ECDH -.Fa "ENGINE *e" -.Fa "const ECDH_METHOD *dh_meth" -.Fc -.Ft int -.Fo ENGINE_set_ECDSA -.Fa "ENGINE *e" -.Fa "const ECDSA_METHOD *dh_meth" -.Fc -.Ft int -.Fo ENGINE_set_DH -.Fa "ENGINE *e" -.Fa "const DH_METHOD *dh_meth" -.Fc -.Ft int -.Fo ENGINE_set_RAND -.Fa "ENGINE *e" -.Fa "const RAND_METHOD *rand_meth" -.Fc -.Ft int -.Fo ENGINE_set_STORE -.Fa "ENGINE *e" -.Fa "const STORE_METHOD *rand_meth" -.Fc -.Ft int -.Fo ENGINE_set_destroy_function -.Fa "ENGINE *e" -.Fa "ENGINE_GEN_INT_FUNC_PTR destroy_f" -.Fc -.Ft int -.Fo ENGINE_set_init_function -.Fa "ENGINE *e" -.Fa "ENGINE_GEN_INT_FUNC_PTR init_f" -.Fc -.Ft int -.Fo ENGINE_set_finish_function -.Fa "ENGINE *e" -.Fa "ENGINE_GEN_INT_FUNC_PTR finish_f" -.Fc -.Ft int -.Fo ENGINE_set_ctrl_function -.Fa "ENGINE *e" -.Fa "ENGINE_CTRL_FUNC_PTR ctrl_f" -.Fc -.Ft int -.Fo ENGINE_set_load_privkey_function -.Fa "ENGINE *e" -.Fa "ENGINE_LOAD_KEY_PTR loadpriv_f" -.Fc -.Ft int -.Fo ENGINE_set_load_pubkey_function -.Fa "ENGINE *e" -.Fa "ENGINE_LOAD_KEY_PTR loadpub_f" -.Fc -.Ft int -.Fo ENGINE_set_ciphers -.Fa "ENGINE *e" -.Fa "ENGINE_CIPHERS_PTR f" -.Fc -.Ft int -.Fo ENGINE_set_digests -.Fa "ENGINE *e" -.Fa "ENGINE_DIGESTS_PTR f" -.Fc -.Ft int -.Fo ENGINE_set_flags -.Fa "ENGINE *e" -.Fa "int flags" -.Fc -.Ft int -.Fo ENGINE_set_cmd_defns -.Fa "ENGINE *e" -.Fa "const ENGINE_CMD_DEFN *defns" -.Fc -.Ft const char * -.Fo ENGINE_get_id -.Fa "const ENGINE *e" -.Fc -.Ft const char * -.Fo ENGINE_get_name -.Fa "const ENGINE *e" -.Fc -.Ft const RSA_METHOD * -.Fo ENGINE_get_RSA -.Fa "const ENGINE *e" -.Fc -.Ft const DSA_METHOD * -.Fo ENGINE_get_DSA -.Fa "const ENGINE *e" -.Fc -.Ft const ECDH_METHOD * -.Fo ENGINE_get_ECDH -.Fa "const ENGINE *e" -.Fc -.Ft const ECDSA_METHOD * -.Fo ENGINE_get_ECDSA -.Fa "const ENGINE *e" -.Fc -.Ft const DH_METHOD * -.Fo ENGINE_get_DH -.Fa "const ENGINE *e" -.Fc -.Ft const RAND_METHOD * -.Fo ENGINE_get_RAND -.Fa "const ENGINE *e" -.Fc -.Ft const STORE_METHOD * -.Fo ENGINE_get_STORE -.Fa "const ENGINE *e" -.Fc -.Ft ENGINE_GEN_INT_FUNC_PTR -.Fo ENGINE_get_destroy_function -.Fa "const ENGINE *e" -.Fc -.Ft ENGINE_GEN_INT_FUNC_PTR -.Fo ENGINE_get_init_function -.Fa "const ENGINE *e" -.Fc -.Ft ENGINE_GEN_INT_FUNC_PTR -.Fo ENGINE_get_finish_function -.Fa "const ENGINE *e" -.Fc -.Ft ENGINE_CTRL_FUNC_PTR -.Fo ENGINE_get_ctrl_function -.Fa "const ENGINE *e" -.Fc -.Ft ENGINE_LOAD_KEY_PTR -.Fo ENGINE_get_load_privkey_function -.Fa "const ENGINE *e" -.Fc -.Ft ENGINE_LOAD_KEY_PTR -.Fo ENGINE_get_load_pubkey_function -.Fa "const ENGINE *e" -.Fc -.Ft ENGINE_CIPHERS_PTR -.Fo ENGINE_get_ciphers -.Fa "const ENGINE *e" -.Fc -.Ft ENGINE_DIGESTS_PTR -.Fo ENGINE_get_digests -.Fa "const ENGINE *e" -.Fc -.Ft const EVP_CIPHER * -.Fo ENGINE_get_cipher -.Fa "ENGINE *e" -.Fa "int nid" -.Fc -.Ft const EVP_MD * -.Fo ENGINE_get_digest -.Fa "ENGINE *e" -.Fa "int nid" -.Fc -.Ft int -.Fo ENGINE_get_flags -.Fa "const ENGINE *e" -.Fc -.Ft const ENGINE_CMD_DEFN * -.Fo ENGINE_get_cmd_defns -.Fa "const ENGINE *e" -.Fc -.Ft EVP_PKEY * -.Fo ENGINE_load_private_key -.Fa "ENGINE *e" -.Fa "const char *key_id" -.Fa "UI_METHOD *ui_method" -.Fa "void *callback_data" -.Fc -.Ft EVP_PKEY * -.Fo ENGINE_load_public_key -.Fa "ENGINE *e" -.Fa "const char *key_id" -.Fa "UI_METHOD *ui_method" -.Fa "void *callback_data" -.Fc -.Sh DESCRIPTION -These functions create, manipulate, and use cryptographic modules -in the form of -.Vt ENGINE -objects. -These objects act as containers for implementations of cryptographic -algorithms, and support a reference-counted mechanism to allow them to -be dynamically loaded in and out of the running application. -.Pp -The cryptographic functionality that can be provided by an -.Vt ENGINE -implementation includes the following abstractions: -.Pp -.Bl -bullet -compact -.It -.Vt RSA_METHOD : -for providing alternative RSA implementations -.It -.Vt DSA_METHOD , DH_METHOD , RAND_METHOD , ECDH_METHOD , -.Vt ECDSA_METHOD , STORE_METHOD : -similarly for other OpenSSL APIs -.It -.Vt EVP_CIPHER : -potentially multiple cipher algorithms (indexed by 'nid') -.It -.Vt EVP_DIGEST : -potentially multiple hash algorithms (indexed by 'nid') -.It -key-loading: loading public and/or private EVP_PKEY keys -.El -.Ss Reference counting and handles -Due to the modular nature of the -.Nm engine -API, pointers to -.Vt ENGINE Ns s -need to be treated as handles - i.e. not only as pointers, but also -as references to the underlying -.Vt ENGINE -object. -One should obtain a new reference when making copies of an -.Vt ENGINE -pointer if the copies will be used (and released) independently. -.Pp -.Vt ENGINE -objects have two levels of reference-counting to match the way in -which the objects are used. -At the most basic level, each -.Vt ENGINE -pointer is inherently a -.Sy structural -reference - a structural reference is required to use the pointer value -at all, as this kind of reference is a guarantee that the structure cannot -be deallocated until the reference is released. -.Pp -However, a structural reference provides no guarantee that the -.Vt ENGINE -is initialised and able to use any of its cryptographic implementations. -Indeed it's quite possible that most -.Vt ENGINE Ns s -will not initialise at all in typical environments, as -.Vt ENGINE Ns s -are typically used to support specialised hardware. -To use an -.Vt ENGINE Ap s -functionality, you need a -.Sy functional -reference. -This kind of reference can be considered a specialised form of -structural reference, because each functional reference implicitly -contains a structural reference as well - however to avoid -difficult-to-find programming bugs, it is recommended to treat the two -kinds of reference independently. -If you have a functional reference to an -.Vt ENGINE , -you have a guarantee that the -.Vt ENGINE -has been initialised and is ready to perform cryptographic operations and -will remain uninitialised until after you have released your -reference. -.Pp -.Em Structural references -.Pp -This basic type of reference is used for instantiating new -.Vt ENGINE Ns s , -iterating across OpenSSL's internal linked-list of loaded -.Vt ENGINE Ns s , -reading information about an -.Vt ENGINE , -etc. -Essentially a structural reference is sufficient if you only need to -query or manipulate the data of an -.Vt ENGINE -implementation rather than use its functionality. -.Pp -The -.Fn ENGINE_new -function returns a structural reference to a new (empty) -.Vt ENGINE -object. -There are other -.Nm engine -API functions that return structural references such as -.Fn ENGINE_by_id , -.Fn ENGINE_get_first , -.Fn ENGINE_get_last , -.Fn ENGINE_get_next , -and -.Fn ENGINE_get_prev . -All structural references should be released by a corresponding call -to the -.Fn ENGINE_free -function. -The -.Vt ENGINE -object itself will only actually be cleaned up and deallocated when -the last structural reference is released. -.Pp -It should also be noted that many -.Nm engine -API function calls that accept a structural reference will internally -obtain another reference. -Typically this happens whenever the supplied -.Vt ENGINE -will be needed by OpenSSL after the function has returned. -For example, the function to add a new -.Vt ENGINE -to OpenSSL's internal list is -.Fn ENGINE_add . -If this function returns success, OpenSSL will have stored a new -structural reference internally so the caller is still responsible for -freeing their own reference with -.Fn ENGINE_free -when they are finished with it. -In a similar way, some functions will automatically release the -structural reference passed to it if part of the function's job is -to do so. -For example, the -.Fn ENGINE_get_next -and -.Fn ENGINE_get_prev -functions are used for iterating across the internal -.Vt ENGINE -list. -They -will return a new structural reference to the next (or previous) -.Vt ENGINE -in the list or -.Dv NULL -if at the end (or beginning) of the list, but in either case the -structural reference passed to the function is released on behalf -of the caller. -.Pp -To clarify a particular function's handling of references, one should -always consult that function's manual page, or failing that the -.In openssl/engine.h -header file includes some hints. -.Pp -.Em Functional references -.Pp -As mentioned, functional references exist when the cryptographic -functionality of an -.Vt ENGINE -is required to be available. -A functional reference can be obtained in one of two ways; from an -existing structural reference to the required -.Vt ENGINE , -or by asking OpenSSL for the default operational -.Vt ENGINE -for a given cryptographic purpose. -.Pp -To obtain a functional reference from an existing structural reference, -call the -.Fn ENGINE_init -function. -This returns zero if the -.Vt ENGINE -was not already operational and couldn't be successfully initialised -(e.g. lack of system drivers, no special hardware attached), -otherwise it will return non-zero to indicate that the -.Vt ENGINE -is now operational and will have allocated a new -.Sy functional -reference to the -.Vt ENGINE . -All functional references are released by calling -.Fn ENGINE_finish , -which removes the implicit structural reference as well. -.Pp -The second way to get a functional reference is by asking OpenSSL for a -default implementation for a given task, e.g. -by -.Fn ENGINE_get_default_RSA , -.Fn ENGINE_get_default_cipher_engine , -etc. -These are discussed in the next section, though they are not usually -required by application programmers as they are used automatically when -creating and using the relevant algorithm-specific types in OpenSSL, -such as RSA, DSA, EVP_CIPHER_CTX, etc. -.Ss Default implementations -For each supported abstraction, the -.Nm engine -code maintains an internal table of state to control which -implementations are available for a given abstraction and which -should be used by default. -These implementations are registered in the tables and indexed by an -.Fa nid -value, because abstractions like -.Vt EVP_CIPHER -and -.Vt EVP_DIGEST -support many distinct algorithms and modes, and -.Vt ENGINE Ns s -can support arbitrarily many of them. -In the case of other abstractions like RSA, DSA, etc., there is -only one "algorithm" so all implementations implicitly register -using the same -.Fa nid -index. -.Pp -When a default -.Vt ENGINE -is requested for a given abstraction/algorithm/mode, (e.g. when -calling -.Fn RSA_new_method NULL ) , -a "get_default" call will be made to the -.Nm engine -subsystem to process the corresponding state table and return -a functional reference to an initialised -.Vt ENGINE -whose implementation should be used. -If no -.Vt ENGINE -should (or can) be used, it will return -.Dv NULL -and the caller will operate with a -.Dv NULL -.Vt ENGINE -handle. -This usually equates to using the conventional software implementation. -In the latter case, OpenSSL will from then on behave the way it used to -before the -.Nm engine -API existed. -.Pp -Each state table has a flag to note whether it has processed this -"get_default" query since the table was last modified, because to -process this question it must iterate across all the registered -.Vt ENGINE Ns s -in the table trying to initialise each of them in turn, in case one of -them is operational. -If it returns a functional reference to an -.Vt ENGINE , -it will also cache another reference to speed up processing future -queries (without needing to iterate across the table). -Likewise, it will cache a -.Dv NULL -response if no -.Vt ENGINE -was available so that future queries won't repeat the same iteration -unless the state table changes. -This behaviour can also be changed; if the -.Dv ENGINE_TABLE_FLAG_NOINIT -flag is set (using -.Fn ENGINE_set_table_flags ) , -no attempted initialisations will take place, instead the only way for -the state table to return a -.Pf non- Dv NULL -.Vt ENGINE -to the "get_default" query will be if one is expressly set in the table. -For example, -.Fn ENGINE_set_default_RSA -does the same job as -.Fn ENGINE_register_RSA -except that it also sets the state table's cached response for the -"get_default" query. -In the case of abstractions like -.Vt EVP_CIPHER , -where implementations are indexed by -.Fa nid , -these flags and cached-responses are distinct for each -.Fa nid -value. -.Ss Application requirements -This section will explain the basic things an application programmer -should support to make the most useful elements of the -.Nm engine -functionality available to the user. -The first thing to consider is whether the programmer wishes to make -alternative -.Vt ENGINE -modules available to the application and user. -OpenSSL maintains an internal linked list of "visible" -.Vt ENGINE Ns s -from which it has to operate. -At start-up, this list is empty, and in fact if an application does -not call any -.Nm engine -API calls and it uses static -linking against openssl, then the resulting application binary will -not contain any alternative -.Nm engine -code at all. -So the first consideration is whether any/all available -.Vt ENGINE -implementations should be made visible to OpenSSL. -This is controlled by calling the various "load" functions, e.g. -.Fn ENGINE_load_builtin_engines -to make all -.Vt ENGINE -implementations bundled with OpenSSL available. -.Pp -Note that -.Fn ENGINE_load_dynamic -is a placeholder and does not enable dynamic engine loading support. -.Pp -Having called any of these functions, -.Vt ENGINE -objects would have been dynamically allocated and populated with -these implementations and linked into OpenSSL's internal linked -list. -.Pp -If no -.Nm engine -API functions are called at all in an application, then there are -no inherent memory leaks to worry about from the -.Nm engine -functionality, however if any -.Vt ENGINE Ns s -are loaded, even if they are never registered or used, it is necessary -to use the -.Fn ENGINE_cleanup -function to correspondingly cleanup before program exit, if the caller -wishes to avoid memory leaks. -This mechanism uses an internal callback registration table so that any -.Nm engine -API functionality that knows it requires cleanup can register its -cleanup details to be called during -.Fn ENGINE_cleanup . -This approach allows -.Fn ENGINE_cleanup -to clean up after any -.Nm engine -functionality at all that your program uses, yet doesn't automatically -create linker dependencies to all possible -.Nm engine -functionality - only the cleanup callbacks required by the functionality -you do use will be required by the linker. -.Pp -The fact that -.Vt ENGINE Ns s -are made visible to OpenSSL (and thus are linked into the program -and loaded into memory at run-time) does not mean they are "registered" -or called into use by OpenSSL automatically - that behaviour is -something for the application to control. -Some applications will want to allow the user to specify exactly which -.Vt ENGINE -they want used if any is to be used at all. -Others may prefer to load all support and have OpenSSL automatically use -at run-time any -.Vt ENGINE -that is able to successfully initialised - i.e. to assume that this -corresponds to acceleration hardware attached to the machine or -some such thing. -There are probably numerous other ways in which applications may prefer -to handle things, so we will simply illustrate the consequences as they -apply to a couple of simple cases and leave developers to consider these -and the source code to openssl's builtin utilities as guides. -.Pp -.Em Using a specific ENGINE implementation -.Pp -Here we'll assume an application has been configured by its user or -admin to want to use the "ACME" -.Vt ENGINE -if it is available in the version of OpenSSL the application was -compiled with. -If it is available, it should be used by default for all RSA, DSA, and -symmetric cipher operations, otherwise OpenSSL should use its builtin -software as usual. -The following code illustrates how to approach this: -.Bd -literal -ENGINE *e; -const char *engine_id = "ACME"; -ENGINE_load_builtin_engines(); -e = ENGINE_by_id(engine_id); -if (!e) - /* the engine isn't available */ - return; -if (!ENGINE_init(e)) { - /* the engine couldn't initialise, release 'e' */ - ENGINE_free(e); - return; -} -if (!ENGINE_set_default_RSA(e)) - /* This should only happen when 'e' can't initialise, but the previous - * statement suggests it did. */ - abort(); -ENGINE_set_default_DSA(e); -ENGINE_set_default_ciphers(e); -/* Release the functional reference from ENGINE_init() */ -ENGINE_finish(e); -/* Release the structural reference from ENGINE_by_id() */ -ENGINE_free(e); -.Ed -.Pp -.Em Automatically using builtin ENGINE implementations -.Pp -Here we'll assume we want to load and register all -.Vt ENGINE -implementations bundled with OpenSSL, such that for any cryptographic -algorithm required by OpenSSL - if there is an -.Vt ENGINE -that implements it and can be initialised, it should be used. -The following code illustrates how this can work; -.Bd -literal -/* Load all bundled ENGINEs into memory and make them visible */ -ENGINE_load_builtin_engines(); -/* Register all of them for every algorithm they collectively implement */ -ENGINE_register_all_complete(); -.Ed -.Pp -That's all that's required. -For example, the next time OpenSSL tries to set up an RSA key, any bundled -.Vt ENGINE Ns s -that implement -.Vt RSA_METHOD -will be passed to -.Fn ENGINE_init -and if any of those succeed, that -.Vt ENGINE -will be set as the default for RSA use from then on. -.Ss Advanced configuration support -There is a mechanism supported by the -.Nm engine -framework that allows each -.Vt ENGINE -implementation to define an arbitrary set of configuration -"commands" and expose them to OpenSSL and any applications based on -OpenSSL. -This mechanism is entirely based on the use of name-value pairs -and assumes ASCII input (no unicode or UTF for now!), so it is ideal if -applications want to provide a transparent way for users to provide -arbitrary configuration "directives" directly to such -.Vt ENGINE Ns s . -It is also possible for the application to dynamically interrogate the -loaded -.Vt ENGINE -implementations for the names, descriptions, and input flags of -their available "control commands", providing a more flexible -configuration scheme. -However, if the user is expected to know which -.Vt ENGINE -device he/she is using (in the case of specialised hardware, this -goes without saying) then applications may not need to concern -themselves with discovering the supported control commands and -simply prefer to pass settings into -.Vt ENGINE s -exactly as they are provided by the user. -.Pp -Before illustrating how control commands work, it is worth mentioning -what they are typically used for. -Broadly speaking there are two uses for control commands; the first is -to provide the necessary details to the implementation (which may know -nothing at all specific to the host system) so that it can be -initialised for use. -This could include the path to any driver or config files it needs to -load, required network addresses, smart-card identifiers, passwords to -initialise protected devices, logging information, etc. -This class of commands typically needs to be passed to an -.Vt ENGINE -.Sy before -attempting to initialise it, i.e. before calling -.Fn ENGINE_init . -The other class of commands consist of settings or operations that tweak -certain behaviour or cause certain operations to take place, and these -commands may work either before or after -.Fn ENGINE_init , -or in some cases both. -.Vt ENGINE -implementations should provide indications of this in the descriptions -attached to builtin control commands and/or in external product -documentation. -.Pp -.Em Issuing control commands to an ENGINE -.Pp -Let's illustrate by example; a function for which the caller supplies -the name of the -.Vt ENGINE -it wishes to use, a table of string-pairs for use before initialisation, -and another table for use after initialisation. -Note that the string-pairs used for control commands consist of a -command "name" followed by the command "parameter" - the parameter -could be -.Dv NULL -in some cases but the name cannot. -This function should initialise the -.Vt ENGINE -(issuing the "pre" commands beforehand and the "post" commands -afterwards) and set it as the default for everything except RAND -and then return a boolean success or failure. -.Bd -literal -int -generic_load_engine_fn(const char *engine_id, - const char **pre_cmds, int pre_num, - const char **post_cmds, int post_num) -{ - ENGINE *e = ENGINE_by_id(engine_id); - - if (!e) - return 0; - while (pre_num--) { - if (!ENGINE_ctrl_cmd_string(e, - pre_cmds[0], pre_cmds[1], 0)) { - fprintf(stderr, - "Failed command (%s - %s:%s)\en", - engine_id, pre_cmds[0], - pre_cmds[1] ? pre_cmds[1] : "(NULL)"); - ENGINE_free(e); - return 0; - } - pre_cmds += 2; - } - if (!ENGINE_init(e)) { - fprintf(stderr, "Failed initialisation\en"); - ENGINE_free(e); - return 0; - } - /* - * ENGINE_init() returned a functional reference, - * so free the structural reference from - * ENGINE_by_id(). - */ - ENGINE_free(e); - while (post_num--) { - if (!ENGINE_ctrl_cmd_string(e, - post_cmds[0], post_cmds[1], 0)) { - fprintf(stderr, - "Failed command (%s - %s:%s)\en", - engine_id, post_cmds[0], - post_cmds[1] ? post_cmds[1] : "(NULL)"); - ENGINE_finish(e); - return 0; - } - post_cmds += 2; - } - ENGINE_set_default(e, ENGINE_METHOD_ALL & ~ENGINE_METHOD_RAND); - /* Success */ - return 1; -} -.Ed -.Pp -Note that -.Fn ENGINE_ctrl_cmd_string -accepts a boolean argument that can relax the semantics of the function. -If set to non-zero it will only return failure if the -.Vt ENGINE -supported the given command name but failed while executing it, if the -.Vt ENGINE -doesn't support the command name it will simply return success without -doing anything. -In this case we assume the user is only supplying commands specific to -the given -.Vt ENGINE -so we set this to FALSE. -.Pp -.Em Discovering supported control commands -.Pp -It is possible to discover at run-time the names, numerical-ids, -descriptions and input parameters of the control commands supported by an -.Vt ENGINE -using a structural reference. -Note that some control commands are defined by OpenSSL itself and it -will intercept and handle these control commands on behalf of the -.Vt ENGINE , -i.e. the -.Vt ENGINE Ap s -ctrl() handler is not used for the control command. -.In openssl/engine.h -defines an index, -.Dv ENGINE_CMD_BASE , -that all control commands implemented by -.Vt ENGINE Ns s -should be numbered from. -Any command value lower than this symbol is considered a "generic" -command is handled directly by the OpenSSL core routines. -.Pp -It is using these "core" control commands that one can discover the -control commands implemented by a given -.Vt ENGINE , -specifically the commands: -.Bd -literal -#define ENGINE_HAS_CTRL_FUNCTION 10 -#define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11 -#define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12 -#define ENGINE_CTRL_GET_CMD_FROM_NAME 13 -#define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14 -#define ENGINE_CTRL_GET_NAME_FROM_CMD 15 -#define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16 -#define ENGINE_CTRL_GET_DESC_FROM_CMD 17 -#define ENGINE_CTRL_GET_CMD_FLAGS 18 -.Ed -.Pp -Whilst these commands are automatically processed by the OpenSSL -framework code, they use various properties exposed by each -.Vt ENGINE -to process these queries. -An -.Vt ENGINE -has 3 properties it exposes that can affect how this behaves; -it can supply a ctrl() handler, it can specify -.Dv ENGINE_FLAGS_MANUAL_CMD_CTRL -in the -.Vt ENGINE Ap s -flags, and it can expose an array of control command descriptions. -If an -.Vt ENGINE -specifies the -.Dv ENGINE_FLAGS_MANUAL_CMD_CTRL -flag, then it will simply pass all these "core" control commands -directly to the -.Vt ENGINE Ap s -ctrl() handler (and thus, it must have supplied one), so it is up -to the -.Vt ENGINE -to reply to these "discovery" commands itself. -If that flag is not set, then the OpenSSL framework code will work with -the following rules; -.Bl -tag -width Ds -.It If no ctrl() handler is supplied: -.Dv ENGINE_HAS_CTRL_FUNCTION -returns FALSE (zero), all other commands fail. -.It If a ctrl() handler was supplied but no array of control commands: -.Dv ENGINE_HAS_CTRL_FUNCTION -returns TRUE, all other commands fail. -.It If a ctrl() handler and array of control commands was supplied: -.Dv ENGINE_HAS_CTRL_FUNCTION -returns TRUE, all other commands proceed processing... -.El -.Pp -If the -.Vt ENGINE Ns s -array of control commands is empty, then all other commands will fail. -Otherwise -.Dv ENGINE_CTRL_GET_FIRST_CMD_TYPE -returns the identifier of the first command supported by the -.Vt ENGINE , -.Dv ENGINE_GET_NEXT_CMD_TYPE -takes the identifier of a command supported by the -.Vt ENGINE -and returns the next command identifier or fails if there are no more, -.Dv ENGINE_CMD_FROM_NAME -takes a string name for a command and returns the corresponding -identifier or fails if no such command name exists, and the remaining -commands take a command identifier and return properties of the -corresponding commands. -All except -.Dv ENGINE_CTRL_GET_FLAGS -return the string length of a command name or description, or -populate a supplied character buffer with a copy of the command -name or description. -.Dv ENGINE_CTRL_GET_FLAGS -returns a bitwise-OR'd mask of the following possible values: -.Bd -literal -#define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001 -#define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002 -#define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004 -#define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008 -.Ed -.Pp -If the -.Dv ENGINE_CMD_FLAG_INTERNAL -flag is set, then any other flags are purely informational to the caller. -This flag will prevent the command being usable for any higher-level -.Vt ENGINE -functions such as -.Fn ENGINE_ctrl_cmd_string . -"INTERNAL" commands are not intended to be exposed to text-based -configuration by applications, administrations, users, etc. -These can support arbitrary operations via -.Fn ENGINE_ctrl , -including passing to and/or from the control commands data of any -arbitrary type. -These commands are supported in the discovery mechanisms simply allow -applications to determine if an -.Vt ENGINE -supports certain specific commands it might want to use (e.g. -application "foo" might query various -.Vt ENGINE Ns s -to see if they implement "FOO_GET_VENDOR_LOGO_GIF" - and -.Vt ENGINE -could therefore decide whether or not to support this "foo"-specific -extension). -.Sh SEE ALSO -.Xr DH_new 3 , -.Xr DSA_new 3 , -.Xr ENGINE_add_conf_module 3 , -.Xr ENGINE_set_ex_data 3 , -.Xr RSA_new 3 diff --git a/man/evp.3 b/man/evp.3 index 2d927de6..8ea9c78d 100644 --- a/man/evp.3 +++ b/man/evp.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: evp.3,v 1.4 2016/12/06 15:15:26 schwarze Exp $ +.\" $OpenBSD: evp.3,v 1.10 2019/03/21 14:15:13 schwarze Exp $ .\" OpenSSL a9c85cea Nov 11 09:33:55 2016 +0100 .\" .\" This file was written by Ulf Moeller , @@ -51,7 +51,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 21 2019 $ .Dt EVP 3 .Os .Sh NAME @@ -158,16 +158,15 @@ Algorithms are loaded with .Pp All the symmetric algorithms (ciphers), digests and asymmetric algorithms (public key algorithms) can be replaced by -.Xr engine 3 -modules providing alternative implementations. +.Vt ENGINE +modules providing alternative implementations; see +.Xr ENGINE_register_RSA 3 +and the related manual pages for more information. If .Vt ENGINE implementations of ciphers or digests are registered as defaults, then the various EVP functions will automatically use those implementations in preference to built in software implementations. -For more information, consult the -.Xr engine 3 -manual page. .Pp Although low level algorithm specific functions exist for many algorithms, their use is discouraged. @@ -181,9 +180,12 @@ Using them also makes code harder to adapt to new algorithms, some options are not cleanly supported at the low level, and some operations are more efficient using the high level interfaces. .Sh SEE ALSO -.Xr engine 3 , +.Xr ENGINE_register_RSA 3 , .Xr EVP_AEAD_CTX_init 3 , +.Xr EVP_aes_128_cbc 3 , .Xr EVP_BytesToKey 3 , +.Xr EVP_camellia_128_cbc 3 , +.Xr EVP_des_cbc 3 , .Xr EVP_DigestInit 3 , .Xr EVP_DigestSignInit 3 , .Xr EVP_EncryptInit 3 , @@ -198,7 +200,9 @@ operations are more efficient using the high level interfaces. .Xr EVP_PKEY_sign 3 , .Xr EVP_PKEY_verify 3 , .Xr EVP_PKEY_verify_recover 3 , +.Xr EVP_rc4 3 , .Xr EVP_SealInit 3 , .Xr EVP_SignInit 3 , +.Xr EVP_sm4_cbc 3 , .Xr EVP_VerifyInit 3 , .Xr OpenSSL_add_all_algorithms 3 diff --git a/man/get_rfc3526_prime_8192.3 b/man/get_rfc3526_prime_8192.3 index e9bbd915..b26e28be 100644 --- a/man/get_rfc3526_prime_8192.3 +++ b/man/get_rfc3526_prime_8192.3 @@ -1,4 +1,5 @@ -.\" $OpenBSD: get_rfc3526_prime_8192.3,v 1.1 2017/01/31 05:40:26 schwarze Exp $ +.\" $OpenBSD: get_rfc3526_prime_8192.3,v 1.4 2018/03/23 23:18:17 schwarze Exp $ +.\" checked up to: OpenSSL DH_get_1024_160 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" Copyright (c) 2017 Ingo Schwarze .\" @@ -14,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 31 2017 $ +.Dd $Mdocdate: March 23 2018 $ .Dt GET_RFC3526_PRIME_8192 3 .Os .Sh NAME @@ -25,7 +26,14 @@ .Nm get_rfc3526_prime_3072 , .Nm get_rfc3526_prime_4096 , .Nm get_rfc3526_prime_6144 , -.Nm get_rfc3526_prime_8192 +.Nm get_rfc3526_prime_8192 , +.Nm BN_get_rfc2409_prime_768 , +.Nm BN_get_rfc2409_prime_1024 , +.Nm BN_get_rfc3526_prime_2048 , +.Nm BN_get_rfc3526_prime_3072 , +.Nm BN_get_rfc3526_prime_4096 , +.Nm BN_get_rfc3526_prime_6144 , +.Nm BN_get_rfc3526_prime_8192 .Nd standard moduli for Diffie-Hellmann key exchange .Sh SYNOPSIS .In openssl/bn.h @@ -45,10 +53,29 @@ .Fn get_rfc3526_prime_6144 "BIGNUM *bn" .Ft BIGNUM * .Fn get_rfc3526_prime_8192 "BIGNUM *bn" +.Ft BIGNUM * +.Fn BN_get_rfc2409_prime_768 "BIGNUM *bn" +.Ft BIGNUM * +.Fn BN_get_rfc2409_prime_1024 "BIGNUM *bn" +.Ft BIGNUM * +.Fn BN_get_rfc3526_prime_1536 "BIGNUM *bn" +.Ft BIGNUM * +.Fn BN_get_rfc3526_prime_2048 "BIGNUM *bn" +.Ft BIGNUM * +.Fn BN_get_rfc3526_prime_3072 "BIGNUM *bn" +.Ft BIGNUM * +.Fn BN_get_rfc3526_prime_4096 "BIGNUM *bn" +.Ft BIGNUM * +.Fn BN_get_rfc3526_prime_6144 "BIGNUM *bn" +.Ft BIGNUM * +.Fn BN_get_rfc3526_prime_8192 "BIGNUM *bn" .Sh DESCRIPTION Each of these functions returns one specific constant Sophie Germain prime number .Fa p . +The names with the prefix +.Sq BN_ +are aliases for the names without that prefix. .Pp If .Fa bn @@ -124,6 +151,23 @@ information about these numbers. .Pp RFC 3526, "More Modular Exponential (MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)", defines the other six numbers. +.Sh HISTORY +.Fn get_rfc2409_prime_768 , +.Fn get_rfc2409_prime_1024 , +.Fn get_rfc3526_prime_1536 , +.Fn get_rfc3526_prime_2048 , +.Fn get_rfc3526_prime_3072 , +.Fn get_rfc3526_prime_4096 , +.Fn get_rfc3526_prime_6144 , +and +.Fn get_rfc3526_prime_8192 +first appeared in OpenSSL 0.9.8a and have been available since +.Ox 4.5 . +.Pp +The +.Sy BN_ +aliases first appeared in OpenSSL 1.1.0 and have been available since +.Ox 6.3 . .Sh CAVEATS As all the memory needed for storing the numbers is dynamically allocated, the diff --git a/man/i2d_PKCS7_bio_stream.3 b/man/i2d_PKCS7_bio_stream.3 index 97adbde1..463d861b 100644 --- a/man/i2d_PKCS7_bio_stream.3 +++ b/man/i2d_PKCS7_bio_stream.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: i2d_PKCS7_bio_stream.3,v 1.6 2016/12/13 15:00:22 schwarze Exp $ +.\" $OpenBSD: i2d_PKCS7_bio_stream.3,v 1.7 2018/03/23 04:34:23 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 13 2016 $ +.Dd $Mdocdate: March 23 2018 $ .Dt I2D_PKCS7_BIO_STREAM 3 .Os .Sh NAME @@ -86,7 +86,8 @@ returns 1 for success or 0 for failure. .Xr SMIME_write_PKCS7 3 .Sh HISTORY .Fn i2d_PKCS7_bio_stream -was added to OpenSSL 1.0.0. +first appeared in OpenSSL 1.0.0 and has been available since +.Ox 4.9 . .Sh BUGS The prefix "i2d" is arguably wrong because the function outputs BER format. diff --git a/man/lh_new.3 b/man/lh_new.3 index 4f2f3a15..3be32cf6 100644 --- a/man/lh_new.3 +++ b/man/lh_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: lh_new.3,v 1.3 2016/11/28 14:31:20 schwarze Exp $ +.\" $OpenBSD: lh_new.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL 1bc74519 May 20 08:11:46 2016 -0400 .\" .\" -------------------------------------------------------------------------- @@ -115,7 +115,7 @@ .\" copied and put under another distribution licence .\" [including the GNU Public Licence.] .\" -.Dd $Mdocdate: November 28 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt LH_NEW 3 .Os .Sh NAME @@ -525,7 +525,19 @@ rather it would be used in the function passed to .Sh SEE ALSO .Xr lh_stats 3 .Sh HISTORY -The lhash library is available in all versions of SSLeay and OpenSSL. +.Fn lh_new , +.Fn lh_free , +.Fn lh_insert , +.Fn lh_delete , +.Fn lh_retrieve , +and +.Fn lh_doall +appeared in SSLeay 0.4 or earlier. +.Fn lh_doall_arg +first appeared in SSLeay 0.5.1. +These functions have been available since +.Ox 2.4 . +.Pp .Fn lh__error was added in SSLeay 0.9.1b. .Pp diff --git a/man/lh_stats.3 b/man/lh_stats.3 index 90bd1c98..e057d7d6 100644 --- a/man/lh_stats.3 +++ b/man/lh_stats.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: lh_stats.3,v 1.5 2016/12/06 12:24:33 schwarze Exp $ +.\" $OpenBSD: lh_stats.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL e2f92610 May 18 11:44:05 2016 -0400 .\" .\" -------------------------------------------------------------------------- @@ -113,7 +113,7 @@ .\" copied and put under another distribution licence .\" [including the GNU Public Licence.] .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: March 27 2018 $ .Dt LH_STATS 3 .Os .Sh NAME @@ -193,6 +193,16 @@ These functions do not return values. .Xr BIO_new 3 , .Xr lh_new 3 .Sh HISTORY -These functions are available in all versions of SSLeay and OpenSSL. +.Fn lh_stats , +.Fn lh_node_stats , +.Fn lh_node_usage_stats +appeared in SSLeay 0.4. +.Fn lh_stats_bio , +.Fn lh_node_stats_bio , +and +.Fn lh_node_usage_stats_bio +first appeared in SSLeay 0.6.0. +These functions have been available since +.Ox 2.4 . .Sh AUTHORS .An Eric Young diff --git a/man/openssl.cnf.5 b/man/openssl.cnf.5 index de21a5d9..49b6c395 100644 --- a/man/openssl.cnf.5 +++ b/man/openssl.cnf.5 @@ -1,8 +1,9 @@ -.\" $OpenBSD: openssl.cnf.5,v 1.3 2017/07/06 15:42:04 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: openssl.cnf.5,v 1.5 2019/01/02 07:42:21 jmc Exp $ +.\" full merge up to: OpenSSL man5/config b53338cb Feb 28 12:30:28 2017 +0100 +.\" selective merge up to: OpenSSL a8c5ed81 Jul 18 13:57:25 2017 -0400 .\" .\" This file was written by Dr. Stephen Henson . -.\" Copyright (c) 1999, 2000, 2004, 2013, 2015, 2016 The OpenSSL Project. +.\" Copyright (c) 1999, 2000, 2004, 2013, 2015, 2016, 2017 The OpenSSL Project. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -49,7 +50,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 6 2017 $ +.Dd $Mdocdate: January 2 2019 $ .Dt OPENSSL.CNF 5 .Os .Sh NAME @@ -169,6 +170,8 @@ which is used by the utility. Other applications may use an alternative name such as .Sy myapplication_conf . +All library configuration lines appear in the default section +at the start of the configuration file. .Pp The configuration section should consist of a set of name value pairs which contain specific module configuration information. @@ -182,6 +185,7 @@ configuration section containing configuration module specific information. For example: .Bd -literal -offset indent +# The following line must be in the default section. openssl_conf = openssl_init [openssl_init] @@ -457,5 +461,5 @@ The escaping isn't quite right: if you want to use sequences like you can't use any quote escaping on the same line. .Pp Files are loaded in a single pass. -This means that an variable expansion will only work if the variables +This means that a variable expansion will only work if the variables referenced are defined earlier in the file. diff --git a/man/ssl.3 b/man/ssl.3 index 9f3f121b..4877342b 100644 --- a/man/ssl.3 +++ b/man/ssl.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: ssl.3,v 1.11 2017/08/21 10:10:25 schwarze Exp $ -.\" OpenSSL e330f55d Nov 11 00:51:04 2016 +0100 +.\" $OpenBSD: ssl.3,v 1.15 2019/04/05 18:29:43 schwarze Exp $ +.\" full merge up to: OpenSSL e330f55d Nov 11 00:51:04 2016 +0100 +.\" selective merge up to: OpenSSL cbade361 Dec 12 13:14:45 2017 +0100 .\" .\" This file was written by Ralf S. Engelschall , .\" Ben Laurie , and Ulf Moeller . @@ -50,7 +51,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: August 21 2017 $ +.Dd $Mdocdate: April 5 2019 $ .Dt SSL 3 .Os .Sh NAME @@ -129,7 +130,7 @@ client and server certificates, keys, etc. That's the main SSL/TLS structure which is created by a server or client per established connection. This actually is the core structure in the SSL API. -Under run-time the application usually deals with this structure which has +At run-time the application usually deals with this structure which has links to mostly all other structures. .El .Sh HEADER FILES @@ -199,6 +200,8 @@ Constructors and destructors: .Xr SSL_CTX_free 3 .Pp Configuration functions: +.Xr SSL_CTX_add1_chain_cert 3 , +.Xr SSL_CTX_add_extra_chain_cert 3 , .Xr SSL_CTX_ctrl 3 , .Xr SSL_CTX_flush_sessions 3 , .Xr SSL_CTX_get_verify_mode 3 , @@ -245,8 +248,10 @@ Accessors: .Xr SSL_SESSION_get_compress_id 3 , .Xr SSL_SESSION_get_ex_new_index 3 , .Xr SSL_SESSION_get_id 3 , +.Xr SSL_SESSION_get_protocol_version 3 , .Xr SSL_SESSION_get_time 3 , .Xr SSL_SESSION_get0_peer 3 , +.Xr SSL_SESSION_has_ticket 3 , .Xr SSL_SESSION_set1_id_context 3 .Pp Encoding and decoding: @@ -288,6 +293,7 @@ Accessors: .Xr SSL_export_keying_material 3 , .Xr SSL_get_SSL_CTX 3 , .Xr SSL_get_certificate 3 , +.Xr SSL_get_client_random 3 , .Xr SSL_get_default_timeout 3 , .Xr SSL_get_error 3 , .Xr SSL_get_ex_data_X509_STORE_CTX_idx 3 , diff --git a/man/tls_accept_socket.3 b/man/tls_accept_socket.3 index 95022603..931b9346 100644 --- a/man/tls_accept_socket.3 +++ b/man/tls_accept_socket.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tls_accept_socket.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $ +.\" $OpenBSD: tls_accept_socket.3,v 1.4 2018/05/26 12:35:26 schwarze Exp $ .\" .\" Copyright (c) 2015 Ted Unangst .\" Copyright (c) 2015 Joel Sing @@ -16,7 +16,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 28 2017 $ +.Dd $Mdocdate: May 26 2018 $ .Dt TLS_ACCEPT_SOCKET 3 .Os .Sh NAME @@ -74,7 +74,7 @@ and can contain a pointer to any caller-specified data. .Pp All these functions create a new context suitable for reading and writing and return it in -.Fa *cctx . +.Pf * Fa cctx . .Sh RETURN VALUES These functions return 0 on success or -1 on error. .Sh SEE ALSO diff --git a/man/tls_config_set_session_id.3 b/man/tls_config_set_session_id.3 index 7106de46..d969e01e 100644 --- a/man/tls_config_set_session_id.3 +++ b/man/tls_config_set_session_id.3 @@ -1,6 +1,7 @@ -.\" $OpenBSD: tls_config_set_session_id.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $ +.\" $OpenBSD: tls_config_set_session_id.3,v 1.5 2018/02/10 06:07:43 jsing Exp $ .\" .\" Copyright (c) 2017 Claudio Jeker +.\" Copyright (c) 2018 Joel Sing .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -14,10 +15,11 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 28 2017 $ +.Dd $Mdocdate: February 10 2018 $ .Dt TLS_CONFIG_SET_SESSION_ID 3 .Os .Sh NAME +.Nm tls_config_set_session_fd , .Nm tls_config_set_session_id , .Nm tls_config_set_session_lifetime , .Nm tls_config_add_ticket_key @@ -25,6 +27,11 @@ .Sh SYNOPSIS .In tls.h .Ft int +.Fo tls_config_set_session_fd +.Fa "struct tls_config *config" +.Fa "int session_fd" +.Fc +.Ft int .Fo tls_config_set_session_id .Fa "struct tls_config *config" .Fa "const unsigned char *session_id" @@ -43,18 +50,32 @@ .Fa "size_t keylen" .Fc .Sh DESCRIPTION +.Fn tls_config_set_session_fd +sets a file descriptor to be used to manage data for TLS sessions (client only). +The given file descriptor must be a regular file and be owned by the current +user, with permissions being restricted to only allow the owner to read and +write the file (0600). +If the file has a non-zero length, the client will attempt to read session +data from this file and resume the previous TLS session with the server. +Upon a successful handshake the file will be updated with current session +data, if available. +The caller is responsible for closing this file descriptor, after all TLS +contexts that have been configured to use it have been freed via +.Fn tls_free . +.Pp .Fn tls_config_set_session_id sets the session identifier that will be used by the TLS server when -sessions are enabled. +sessions are enabled (server only). By default a random value is used. .Pp .Fn tls_config_set_session_lifetime -sets the lifetime to be used for TLS sessions. +sets the lifetime to be used for TLS sessions (server only). Session support is disabled if a lifetime of zero is specified, which is the default. .Pp .Fn tls_config_add_ticket_key -adds a key used for the encryption and authentication of TLS tickets. +adds a key used for the encryption and authentication of TLS tickets +(server only). By default keys are generated and rotated automatically based on their lifetime. This function should only be used to synchronise ticket encryption key across multiple processes. @@ -69,7 +90,16 @@ These functions return 0 on success or -1 on error. .Xr tls_load_file 3 , .Xr tls_server 3 .Sh HISTORY -These functions appeared in +.Fn tls_config_set_session_id , +.Fn tls_config_set_session_lifetime +and +.Fn tls_config_add_ticket_key +appeared in .Ox 6.1 . +.Pp +.Fn tls_config_set_session_fd +appeared in +.Ox 6.3 . .Sh AUTHORS .An Claudio Jeker Aq Mt claudio@openbsd.org +.An Joel Sing Aq Mt jsing@openbsd.org diff --git a/man/tls_conn_version.3 b/man/tls_conn_version.3 index 8ac2c9b6..b93f1c34 100644 --- a/man/tls_conn_version.3 +++ b/man/tls_conn_version.3 @@ -1,7 +1,7 @@ -.\" $OpenBSD: tls_conn_version.3,v 1.4 2017/01/28 00:59:36 schwarze Exp $ +.\" $OpenBSD: tls_conn_version.3,v 1.9 2018/12/14 20:18:27 schwarze Exp $ .\" .\" Copyright (c) 2015 Bob Beck -.\" Copyright (c) 2016 Joel Sing +.\" Copyright (c) 2016, 2018 Joel Sing .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 28 2017 $ +.Dd $Mdocdate: December 14 2018 $ .Dt TLS_CONN_VERSION 3 .Os .Sh NAME @@ -23,8 +23,10 @@ .Nm tls_conn_cipher , .Nm tls_conn_alpn_selected , .Nm tls_conn_servername , +.Nm tls_conn_session_resumed , .Nm tls_peer_cert_provided , .Nm tls_peer_cert_contains_name , +.Nm tls_peer_cert_chain_pem , .Nm tls_peer_cert_issuer , .Nm tls_peer_cert_subject , .Nm tls_peer_cert_hash , @@ -42,12 +44,19 @@ .Ft const char * .Fn tls_conn_servername "struct tls *ctx" .Ft int +.Fn tls_conn_session_resumed "struct tls *ctx" +.Ft int .Fn tls_peer_cert_provided "struct tls *ctx" .Ft int .Fo tls_peer_cert_contains_name .Fa "struct tls *ctx" .Fa "const char *name" .Fc +.Ft const uint8_t * +.Fo tls_peer_cert_chain_pem +.Fa "struct tls *ctx" +.Fa "size_t *size" +.Fc .Ft const char * .Fn tls_peer_cert_issuer "struct tls *ctx" .Ft const char * @@ -84,6 +93,12 @@ returns a string corresponding to the servername that the client connected to .Ar ctx requested by sending a TLS Server Name Indication extension (server only). .Pp +.Fn tls_conn_session_resumed +indicates whether a TLS session has been resumed during the handshake with +the server connected to +.Ar ctx +(client only). +.Pp .Fn tls_peer_cert_provided checks if the peer of .Ar ctx @@ -96,6 +111,11 @@ has provided a certificate that contains a SAN or CN that matches .Ar name . .Pp +.Fn tls_peer_cert_chain_pem +returns a pointer to memory containing a PEM-encoded certificate chain for the +peer certificate from +.Ar ctx . +.Pp .Fn tls_peer_cert_subject returns a string corresponding to the subject of the peer certificate from @@ -130,11 +150,12 @@ the peer certificate from returns the time corresponding to the end of the validity period of the peer certificate from .Ar ctx . -.Pp -POINTER TO -.Xr tls_ocsp_process_response 3 .Sh RETURN VALUES The +.Fn tls_conn_session_resumed +function returns 1 if a TLS session was resumed or 0 if it was not. +.Pp +The .Fn tls_peer_cert_provided and .Fn tls_peer_cert_contains_name @@ -172,6 +193,10 @@ and .Fn tls_conn_alpn_selected appeared in .Ox 6.1 . +.Pp +.Fn tls_conn_session_resumed +appeared in +.Ox 6.3 . .Sh AUTHORS .An Bob Beck Aq Mt beck@openbsd.org .An Joel Sing Aq Mt jsing@openbsd.org diff --git a/man/tls_connect.3 b/man/tls_connect.3 index 161e0d64..4c4f01c2 100644 --- a/man/tls_connect.3 +++ b/man/tls_connect.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tls_connect.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $ +.\" $OpenBSD: tls_connect.3,v 1.4 2018/07/09 19:51:18 tb Exp $ .\" .\" Copyright (c) 2014 Ted Unangst .\" Copyright (c) 2014, 2015 Joel Sing @@ -16,7 +16,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 28 2017 $ +.Dd $Mdocdate: July 9 2018 $ .Dt TLS_CONNECT 3 .Os .Sh NAME @@ -84,13 +84,15 @@ If it is then a .Fa host of the format "hostname:port" is permitted. +The name to use for verification is inferred from the +.Ar host +value. .Pp The .Fn tls_connect_servername function has the same behaviour, however the name to use for verification is -explicitly provided, rather than being inferred from the -.Ar host -value. +explicitly provided, for the case where the TLS server name differs from the +DNS name. .Pp An already existing socket can be upgraded to a secure connection by calling .Fn tls_connect_socket . diff --git a/man/tls_init.3 b/man/tls_init.3 index c83c0375..55799810 100644 --- a/man/tls_init.3 +++ b/man/tls_init.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tls_init.3,v 1.7 2017/05/06 21:18:48 jsing Exp $ +.\" $OpenBSD: tls_init.3,v 1.13 2018/07/09 19:47:20 tb Exp $ .\" .\" Copyright (c) 2014 Ted Unangst .\" Copyright (c) 2016 Joel Sing @@ -16,7 +16,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 6 2017 $ +.Dd $Mdocdate: July 9 2018 $ .Dt TLS_INIT 3 .Os .Sh NAME @@ -45,8 +45,9 @@ Both clients and servers are supported. The .Fn tls_init function initializes global data structures. -It should be called once before any other functions. -It may be called more than once, but not concurrently. +It is no longer necessary to call this function directly, +since it is invoked internally when needed. +It may be called more than once, and may be called concurrently. .Pp Before a connection is created, a configuration must be created. The diff --git a/man/tls_load_file.3 b/man/tls_load_file.3 index 957e6550..d836a047 100644 --- a/man/tls_load_file.3 +++ b/man/tls_load_file.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tls_load_file.3,v 1.8 2017/08/01 08:41:36 jmc Exp $ +.\" $OpenBSD: tls_load_file.3,v 1.11 2018/11/29 14:24:23 tedu Exp $ .\" .\" Copyright (c) 2014 Ted Unangst .\" Copyright (c) 2015 Reyk Floeter @@ -17,7 +17,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 1 2017 $ +.Dd $Mdocdate: November 29 2018 $ .Dt TLS_LOAD_FILE 3 .Os .Sh NAME @@ -45,7 +45,8 @@ .Nm tls_config_clear_keys , .Nm tls_config_set_verify_depth , .Nm tls_config_verify_client , -.Nm tls_config_verify_client_optional +.Nm tls_config_verify_client_optional , +.Nm tls_default_ca_cert_file .Nd TLS certificate and key configuration .Sh SYNOPSIS .In tls.h @@ -118,7 +119,7 @@ .Ft int .Fo tls_config_set_ocsp_staple_file .Fa "struct tls_config *config" -.Fa "const uint8_t *staple_file" +.Fa "const char *staple_file" .Fc .Ft int .Fo tls_config_set_keypair_file @@ -193,6 +194,8 @@ .Fn tls_config_verify_client "struct tls_config *config" .Ft void .Fn tls_config_verify_client_optional "struct tls_config *config" +.Ft const char * +.Fn tls_default_ca_cert_file "void" .Sh DESCRIPTION .Fn tls_load_file loads a certificate or key from disk into memory to be used with @@ -210,6 +213,9 @@ unloads the memory that was returned from an earlier .Fn tls_load_file call, ensuring that the memory contents is discarded. .Pp +.Fn tls_default_ca_cert_file +returns the path of the file that contains the default root certificates. +.Pp .Fn tls_config_set_ca_file sets the filename used to load a file containing the root certificates. @@ -255,11 +261,11 @@ sets the files from which the public certificate, and private key will be read. directly sets the public certificate, and private key from memory. .Pp .Fn tls_config_set_keypair_ocsp_file -sets the files from which the public certificate, private key, and DER encoded +sets the files from which the public certificate, private key, and DER-encoded OCSP staple will be read. .Pp .Fn tls_config_set_keypair_ocsp_mem -directly sets the public certificate, private key, and DER encoded OCSP staple +directly sets the public certificate, private key, and DER-encoded OCSP staple from memory. .Pp .Fn tls_config_add_keypair_file @@ -271,12 +277,12 @@ adds an additional public certificate, and private key from memory, used as an alternative certificate for Server Name Indication (server only). .Pp .Fn tls_config_add_keypair_ocsp_file -adds an additional public certificate, private key, and DER encoded OCSP staple +adds an additional public certificate, private key, and DER-encoded OCSP staple from the specified files, used as an alternative certificate for Server Name Indication (server only). .Pp .Fn tls_config_add_keypair_ocsp_mem -adds an additional public certificate, private key, and DER encoded OCSP staple +adds an additional public certificate, private key, and DER-encoded OCSP staple from memory, used as an alternative certificate for Server Name Indication (server only). .Pp diff --git a/man/tls_ocsp_process_response.3 b/man/tls_ocsp_process_response.3 index cb979e80..6e3aa4ae 100644 --- a/man/tls_ocsp_process_response.3 +++ b/man/tls_ocsp_process_response.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tls_ocsp_process_response.3,v 1.4 2017/01/29 18:00:21 beck Exp $ +.\" $OpenBSD: tls_ocsp_process_response.3,v 1.6 2018/07/24 02:01:34 tb Exp $ .\" .\" Copyright (c) 2016 Bob Beck .\" @@ -14,19 +14,19 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 29 2017 $ +.Dd $Mdocdate: July 24 2018 $ .Dt TLS_OCSP_PROCESS_RESPONSE 3 .Os .Sh NAME .Nm tls_ocsp_process_response , +.Nm tls_peer_ocsp_url , +.Nm tls_peer_ocsp_response_status , .Nm tls_peer_ocsp_cert_status , .Nm tls_peer_ocsp_crl_reason , -.Nm tls_peer_ocsp_next_update , -.Nm tls_peer_ocsp_response_status , -.Nm tls_peer_ocsp_result_msg , +.Nm tls_peer_ocsp_result , .Nm tls_peer_ocsp_revocation_time , .Nm tls_peer_ocsp_this_update , -.Nm tls_peer_ocsp_url +.Nm tls_peer_ocsp_next_update .Nd inspect an OCSP response .Sh SYNOPSIS .In tls.h @@ -36,22 +36,22 @@ .Fa "const unsigned char *response" .Fa "size_t size" .Fc +.Ft const char * +.Fn tls_peer_ocsp_url "struct tls *ctx" +.Ft int +.Fn tls_peer_ocsp_response_status "struct tls *ctx" .Ft int .Fn tls_peer_ocsp_cert_status "struct tls *ctx" .Ft int .Fn tls_peer_ocsp_crl_reason "struct tls *ctx" -.Ft time_t -.Fn tls_peer_ocsp_next_update "struct tls *ctx" -.Ft int -.Fn tls_peer_ocsp_response_status "struct tls *ctx" .Ft const char * -.Fn tls_peer_ocsp_result_msg "struct tls *ctx" +.Fn tls_peer_ocsp_result "struct tls *ctx" .Ft time_t .Fn tls_peer_ocsp_revocation_time "struct tls *ctx" .Ft time_t .Fn tls_peer_ocsp_this_update "struct tls *ctx" -.Ft const char * -.Fn tls_peer_ocsp_url "struct tls *ctx" +.Ft time_t +.Fn tls_peer_ocsp_next_update "struct tls *ctx" .Sh DESCRIPTION .Fn tls_ocsp_process_response processes a raw OCSP response in @@ -73,6 +73,9 @@ that was obtained by validating a stapled OCSP response during the handshake, or via a previous call to .Fn tls_ocsp_process_response . .Pp +.Fn tls_peer_ocsp_response_status +returns the OCSP response status as per RFC 6960 section 2.3. +.Pp .Fn tls_peer_ocsp_cert_status returns the OCSP certificate status code as per RFC 6960 section 2.2. .Pp @@ -80,22 +83,33 @@ returns the OCSP certificate status code as per RFC 6960 section 2.2. returns the OCSP certificate revocation reason status code as per RFC 5280 section 5.3.1. .Pp -.Fn tls_peer_ocsp_next_update -returns the OCSP next update time. +.Fn tls_peer_ocsp_result +returns a textual representation of the OCSP status code +returned by one of the previous three functions. +If the OCSP response was valid and the certificate was not +revoked, the string indicates the OCSP certificate status. +Otherwise, the string indicates +the OCSP certificate revocation reason or the OCSP error. .Pp -.Fn tls_peer_ocsp_response_status -returns the OCSP response status as per RFC 6960 section 2.3. -.Pp -.\" XXX Fn tls_peer_ocsp_result_msg does what? .Fn tls_peer_ocsp_revocation_time returns the OCSP revocation time. .Pp .Fn tls_peer_ocsp_this_update returns the OCSP this update time. +.Pp +.Fn tls_peer_ocsp_next_update +returns the OCSP next update time. .Sh RETURN VALUES .Fn tls_ocsp_process_response returns 0 on success or -1 on error. .Pp +.Fn tls_peer_ocsp_url +and +.Fn tls_peer_ocsp_result +return +.Dv NULL +on error or an out of memory condition. +.Pp The .Fn tls_peer_ocsp_response_status function returns one of @@ -133,18 +147,11 @@ or .Dv TLS_CRL_REASON_AA_COMPROMISE on success or -1 on error. .Pp -.Fn tls_peer_ocsp_next_update , .Fn tls_peer_ocsp_revocation_time , +.Fn tls_peer_ocsp_this_update , and -.Fn tls_peer_ocsp_this_update +.Fn tls_peer_ocsp_next_update return a time in epoch-seconds on success or -1 on error. -.Pp -.Fn tls_peer_ocsp_result_msg -and -.Fn tls_peer_ocsp_url -return -.Dv NULL -on error or an out of memory condition. .Sh SEE ALSO .Xr tls_client 3 , .Xr tls_config_ocsp_require_stapling 3 , diff --git a/man/tls_read.3 b/man/tls_read.3 index a7faebae..e890357a 100644 --- a/man/tls_read.3 +++ b/man/tls_read.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tls_read.3,v 1.4 2017/02/20 13:09:15 schwarze Exp $ +.\" $OpenBSD: tls_read.3,v 1.5 2019/03/20 14:17:19 espie Exp $ .\" .\" Copyright (c) 2014, 2015 Ted Unangst .\" Copyright (c) 2015 Doug Hogan @@ -18,7 +18,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: February 20 2017 $ +.Dd $Mdocdate: March 20 2019 $ .Dt TLS_READ 3 .Os .Sh NAME @@ -164,7 +164,7 @@ while (len > 0) { if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) continue; if (ret < 0) - err(1, "tls_write: %s", tls_error(ctx)); + errx(1, "tls_write: %s", tls_error(ctx)); buf += ret; len -= ret; } @@ -193,7 +193,7 @@ while (len > 0) { else if (ret == TLS_WANT_POLLOUT) pfd[0].events = POLLOUT; else if (ret < 0) - err(1, "tls_write: %s", tls_error(ctx)); + errx(1, "tls_write: %s", tls_error(ctx)); else { buf += ret; len -= ret; diff --git a/man/x509v3.cnf.5 b/man/x509v3.cnf.5 index 19608697..d307e6a1 100644 --- a/man/x509v3.cnf.5 +++ b/man/x509v3.cnf.5 @@ -1,5 +1,7 @@ -.\" $OpenBSD: x509v3.cnf.5,v 1.3 2016/12/25 22:15:10 schwarze Exp $ -.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 +.\" $OpenBSD: x509v3.cnf.5,v 1.5 2018/08/26 18:04:54 jmc Exp $ +.\" full merge up to: +.\" OpenSSL man5/x509v3_config a41815f0 Mar 17 18:43:53 2017 -0700 +.\" selective merge up to: OpenSSL 36cf10cf Oct 4 02:11:08 2017 -0400 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2004, 2006, 2013, 2014, 2015, 2016 The OpenSSL Project. @@ -49,7 +51,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 25 2016 $ +.Dd $Mdocdate: August 26 2018 $ .Dt X509V3.CNF 5 .Os .Sh NAME @@ -128,7 +130,7 @@ is .Cm TRUE , then an optional .Ic pathlen -name followed by an non-negative value can be included. +name followed by a non-negative value can be included. For example: .Bd -literal -offset indent basicConstraints=CA:TRUE @@ -318,7 +320,7 @@ option that will copy all the subject alternative name values from the issuer certificate (if possible). Example: .Pp -.Dl issuserAltName = issuer:copy +.Dl issuerAltName = issuer:copy .Ss Authority info access The authority information access extension gives details about how to access certain information relating to the CA. diff --git a/missing b/missing index c6e37958..625aeb11 100644 --- a/missing +++ b/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC # 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 . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ else exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,7 +207,7 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/scripts/i686-w64-mingw32.cmake b/scripts/i686-w64-mingw32.cmake new file mode 100644 index 00000000..58efd58c --- /dev/null +++ b/scripts/i686-w64-mingw32.cmake @@ -0,0 +1,8 @@ +SET(CMAKE_SYSTEM_NAME Windows) +SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres) +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + diff --git a/scripts/travis b/scripts/travis index c8e67ce3..3e794e7f 100644 --- a/scripts/travis +++ b/scripts/travis @@ -12,22 +12,39 @@ if [ "x$ARCH" = "xnative" ]; then make dist tar zxvf libressl-*.tar.gz cd libressl-* - mkdir build - cd build + mkdir build-static + mkdir build-shared + + cd build-static # test cmake and ninja if [ `uname` = "Darwin" ]; then cmake .. make make test + + cd ../build-shared + cmake -DBUILD_SHARED_LIBS=ON .. + make + make test else sudo apt-get update sudo apt-get install -y cmake ninja-build + cmake -GNinja .. ninja ninja test + + cd ../build-shared + cmake -GNinja -DBUILD_SHARED_LIBS=ON .. + ninja + ninja test fi -else + +elif [ "x$ARCH" = "xmingw32" -o "x$ARCH" = "xmingw64" ]; then + sudo apt-get update + sudo apt-get install -y cmake ninja-build + CPU=i686 if [ "x$ARCH" = "xmingw64" ]; then CPU=x86_64 @@ -42,4 +59,101 @@ else ./configure --host=$CPU-w64-mingw32 make -j + + ( + rm -fr build-static + mkdir build-static + cd build-static + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../scripts/$CPU-w64-mingw32.cmake .. + ninja + ) + ( + rm -fr build-shared + mkdir build-shared + cd build-shared + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../scripts/$CPU-w64-mingw32.cmake -DBUILD_SHARED_LIBS=ON .. + ninja + ) + +elif [ "x$ARCH" = "xarm32" -o "x$ARCH" = "xarm64" ]; then + sudo apt-get update + sudo apt-get install -y qemu-user-static binfmt-support + + if [ "x$ARCH" = "xarm32" ]; then + sudo apt-get install -y g++-arm-linux-gnueabihf + sudo ln -s /usr/arm-linux-gnueabihf/lib /lib/arm-linux-gnueabihf + sudo ln -s /lib/arm-linux-gnueabihf/ld-2.19.so /lib/ld-linux-armhf.so.3 + export CC=arm-linux-gnueabihf-gcc + ./configure --host=arm-linux + else + sudo apt-get install -y g++-aarch64-linux-gnu + sudo ln -s /usr/aarch64-linux-gnu/lib/ /lib/aarch64-linux-gnu + sudo ln -s /lib/aarch64-linux-gnu/ld-2.19.so /lib/ld-linux-aarch64.so.1 + export CC=aarch64-linux-gnu-gcc + ./configure --host=aarch64-linux + fi + + make -j 4 check + file apps/openssl/.libs/openssl + +elif [ "x$ARCH" = "xandroid" ]; then + echo y | sdkmanager 'ndk-bundle' + echo y | sdkmanager 'cmake;3.6.4111459' + echo y | sdkmanager 'lldb;3.0' + echo y | sdkmanager --update + echo y | sdkmanager --licenses + + export CMAKE=$ANDROID_HOME/cmake/3.6.4111459/bin/cmake + export NINJA=$ANDROID_HOME/cmake/3.6.4111459/bin/ninja + export ANDROID_NDK_HOME=$ANDROID_HOME/ndk-bundle + export TC_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake + + # get available API level and architecture + pdir=$ANDROID_NDK_HOME/platforms + level_arch="" + level=$MIN_NAL + while [ $level -le $MAX_NAL ] + do + if [ -d $pdir/android-$level ] ; then + adir=$pdir/android-$level + if [ -d $adir/arch-arm ] ; then + level_arch="$level_arch $level;armeabi-v7a" + fi + if [ -d $adir/arch-arm64 ] ; then + level_arch="$level_arch $level;arm64-v8a" + fi + if [ -d $adir/arch-x86 ] ; then + level_arch="$level_arch $level;x86" + fi + if [ -d $adir/arch-x86_64 ] ; then + level_arch="$level_arch $level;x86_64" + fi + fi + level=`expr $level + 1` + done + + # build each API level and architecture + for la in $level_arch + do + NAL=`echo $la | cut -d ';' -f 1` + ABI=`echo $la | cut -d ';' -f 2` + echo "" + echo "##### Date: `date`, Native API level: $NAL, ABI: $ABI" + + ( + build_dir=build_$NAL_$ABI + rm -fr $build_dir + mkdir $build_dir + cd $build_dir + $CMAKE -GNinja -DCMAKE_MAKE_PROGRAM=$NINJA \ + -DANDROID_NDK=$ANDROID_NDK_HOME \ + -DCMAKE_TOOLCHAIN_FILE=$TC_FILE \ + -DANDROID_ABI=$ABI -DANDROID_NATIVE_API_LEVEL=$NAL .. + + $NINJA -j 4 + + echo "" + file apps/openssl/openssl + ) + done fi diff --git a/scripts/x86_64-w64-mingw32.cmake b/scripts/x86_64-w64-mingw32.cmake new file mode 100644 index 00000000..c52b6065 --- /dev/null +++ b/scripts/x86_64-w64-mingw32.cmake @@ -0,0 +1,8 @@ +SET(CMAKE_SYSTEM_NAME Windows) +SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) +SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index 3ea16a8f..5c6460f1 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt @@ -1,9 +1,3 @@ -include_directories( - . - ../include - ../include/compat -) - set( SSL_SRC bio_ssl.c @@ -14,7 +8,6 @@ set( d1_clnt.c d1_enc.c d1_lib.c - d1_meth.c d1_pkt.c d1_srtp.c d1_srvr.c @@ -26,47 +19,61 @@ set( ssl_both.c ssl_cert.c ssl_ciph.c + ssl_ciphers.c ssl_clnt.c ssl_err.c + ssl_init.c ssl_lib.c + ssl_methods.c ssl_packet.c ssl_pkt.c ssl_rsa.c ssl_sess.c + ssl_sigalgs.c ssl_srvr.c ssl_stat.c ssl_tlsext.c + ssl_transcript.c ssl_txt.c ssl_versions.c - t1_clnt.c t1_enc.c - t1_hash.c t1_lib.c - t1_meth.c - t1_srvr.c + tls13_buffer.c + tls13_client.c + tls13_handshake.c + tls13_handshake_msg.c + tls13_key_schedule.c + tls13_lib.c + tls13_record.c + tls13_record_layer.c ) -add_library(ssl-objects OBJECT ${SSL_SRC}) -if (BUILD_SHARED) - add_library(ssl STATIC $) - add_library(ssl-shared SHARED $) - export_symbol(ssl-shared ${CMAKE_CURRENT_SOURCE_DIR}/ssl.sym) - target_link_libraries(ssl-shared crypto-shared) +add_library(ssl ${SSL_SRC}) +target_include_directories(ssl + PRIVATE + . + ../include/compat + PUBLIC + ../include) + +if (BUILD_SHARED_LIBS) + export_symbol(ssl ${CMAKE_CURRENT_SOURCE_DIR}/ssl.sym) + target_link_libraries(ssl crypto ${PLATFORM_LIBS}) if (WIN32) - target_link_libraries(ssl-shared Ws2_32.lib) set(SSL_POSTFIX -${SSL_MAJOR_VERSION}) endif() - set_target_properties(ssl-shared PROPERTIES + set_target_properties(ssl PROPERTIES OUTPUT_NAME ssl${SSL_POSTFIX} ARCHIVE_OUTPUT_NAME ssl${SSL_POSTFIX}) - set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION} + set_target_properties(ssl PROPERTIES VERSION ${SSL_VERSION} SOVERSION ${SSL_MAJOR_VERSION}) - if(ENABLE_LIBRESSL_INSTALL) - install(TARGETS ssl ssl-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_LIBRESSL_INSTALL) -else() - add_library(ssl STATIC ${SSL_SRC}) - if(ENABLE_LIBRESSL_INSTALL) - install(TARGETS ssl DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_LIBRESSL_INSTALL) endif() + +if(ENABLE_LIBRESSL_INSTALL) + install( + TARGETS ssl + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +endif(ENABLE_LIBRESSL_INSTALL) diff --git a/ssl/Makefile.am b/ssl/Makefile.am index 99d138a0..02109f58 100644 --- a/ssl/Makefile.am +++ b/ssl/Makefile.am @@ -17,7 +17,6 @@ libssl_la_SOURCES += d1_both.c libssl_la_SOURCES += d1_clnt.c libssl_la_SOURCES += d1_enc.c libssl_la_SOURCES += d1_lib.c -libssl_la_SOURCES += d1_meth.c libssl_la_SOURCES += d1_pkt.c libssl_la_SOURCES += d1_srtp.c libssl_la_SOURCES += d1_srvr.c @@ -29,26 +28,39 @@ libssl_la_SOURCES += ssl_asn1.c libssl_la_SOURCES += ssl_both.c libssl_la_SOURCES += ssl_cert.c libssl_la_SOURCES += ssl_ciph.c +libssl_la_SOURCES += ssl_ciphers.c libssl_la_SOURCES += ssl_clnt.c libssl_la_SOURCES += ssl_err.c +libssl_la_SOURCES += ssl_init.c libssl_la_SOURCES += ssl_lib.c +libssl_la_SOURCES += ssl_methods.c libssl_la_SOURCES += ssl_packet.c libssl_la_SOURCES += ssl_pkt.c libssl_la_SOURCES += ssl_rsa.c libssl_la_SOURCES += ssl_sess.c +libssl_la_SOURCES += ssl_sigalgs.c libssl_la_SOURCES += ssl_srvr.c libssl_la_SOURCES += ssl_stat.c libssl_la_SOURCES += ssl_tlsext.c +libssl_la_SOURCES += ssl_transcript.c libssl_la_SOURCES += ssl_txt.c libssl_la_SOURCES += ssl_versions.c -libssl_la_SOURCES += t1_clnt.c libssl_la_SOURCES += t1_enc.c -libssl_la_SOURCES += t1_hash.c libssl_la_SOURCES += t1_lib.c -libssl_la_SOURCES += t1_meth.c -libssl_la_SOURCES += t1_srvr.c +libssl_la_SOURCES += tls13_buffer.c +libssl_la_SOURCES += tls13_client.c +libssl_la_SOURCES += tls13_handshake.c +libssl_la_SOURCES += tls13_handshake_msg.c +libssl_la_SOURCES += tls13_key_schedule.c +libssl_la_SOURCES += tls13_lib.c +libssl_la_SOURCES += tls13_record.c +libssl_la_SOURCES += tls13_record_layer.c -noinst_HEADERS = srtp.h +noinst_HEADERS = bytestring.h +noinst_HEADERS += srtp.h noinst_HEADERS += ssl_locl.h +noinst_HEADERS += ssl_sigalgs.h noinst_HEADERS += ssl_tlsext.h -noinst_HEADERS += bytestring.h +noinst_HEADERS += tls13_internal.h +noinst_HEADERS += tls13_handshake.h +noinst_HEADERS += tls13_record.h diff --git a/ssl/Makefile.in b/ssl/Makefile.in index 1ae569ad..efc91100 100644 --- a/ssl/Makefile.in +++ b/ssl/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -136,13 +136,16 @@ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libssl_la_DEPENDENCIES = $(abs_top_builddir)/crypto/libcrypto.la am_libssl_la_OBJECTS = bio_ssl.lo bs_ber.lo bs_cbb.lo bs_cbs.lo \ - d1_both.lo d1_clnt.lo d1_enc.lo d1_lib.lo d1_meth.lo d1_pkt.lo \ - d1_srtp.lo d1_srvr.lo pqueue.lo s3_cbc.lo s3_lib.lo \ - ssl_algs.lo ssl_asn1.lo ssl_both.lo ssl_cert.lo ssl_ciph.lo \ - ssl_clnt.lo ssl_err.lo ssl_lib.lo ssl_packet.lo ssl_pkt.lo \ - ssl_rsa.lo ssl_sess.lo ssl_srvr.lo ssl_stat.lo ssl_tlsext.lo \ - ssl_txt.lo ssl_versions.lo t1_clnt.lo t1_enc.lo t1_hash.lo \ - t1_lib.lo t1_meth.lo t1_srvr.lo + d1_both.lo d1_clnt.lo d1_enc.lo d1_lib.lo d1_pkt.lo d1_srtp.lo \ + d1_srvr.lo pqueue.lo s3_cbc.lo s3_lib.lo ssl_algs.lo \ + ssl_asn1.lo ssl_both.lo ssl_cert.lo ssl_ciph.lo ssl_ciphers.lo \ + ssl_clnt.lo ssl_err.lo ssl_init.lo ssl_lib.lo ssl_methods.lo \ + ssl_packet.lo ssl_pkt.lo ssl_rsa.lo ssl_sess.lo ssl_sigalgs.lo \ + ssl_srvr.lo ssl_stat.lo ssl_tlsext.lo ssl_transcript.lo \ + ssl_txt.lo ssl_versions.lo t1_enc.lo t1_lib.lo tls13_buffer.lo \ + tls13_client.lo tls13_handshake.lo tls13_handshake_msg.lo \ + tls13_key_schedule.lo tls13_lib.lo tls13_record.lo \ + tls13_record_layer.lo libssl_la_OBJECTS = $(am_libssl_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -165,7 +168,32 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/bio_ssl.Plo ./$(DEPDIR)/bs_ber.Plo \ + ./$(DEPDIR)/bs_cbb.Plo ./$(DEPDIR)/bs_cbs.Plo \ + ./$(DEPDIR)/d1_both.Plo ./$(DEPDIR)/d1_clnt.Plo \ + ./$(DEPDIR)/d1_enc.Plo ./$(DEPDIR)/d1_lib.Plo \ + ./$(DEPDIR)/d1_pkt.Plo ./$(DEPDIR)/d1_srtp.Plo \ + ./$(DEPDIR)/d1_srvr.Plo ./$(DEPDIR)/pqueue.Plo \ + ./$(DEPDIR)/s3_cbc.Plo ./$(DEPDIR)/s3_lib.Plo \ + ./$(DEPDIR)/ssl_algs.Plo ./$(DEPDIR)/ssl_asn1.Plo \ + ./$(DEPDIR)/ssl_both.Plo ./$(DEPDIR)/ssl_cert.Plo \ + ./$(DEPDIR)/ssl_ciph.Plo ./$(DEPDIR)/ssl_ciphers.Plo \ + ./$(DEPDIR)/ssl_clnt.Plo ./$(DEPDIR)/ssl_err.Plo \ + ./$(DEPDIR)/ssl_init.Plo ./$(DEPDIR)/ssl_lib.Plo \ + ./$(DEPDIR)/ssl_methods.Plo ./$(DEPDIR)/ssl_packet.Plo \ + ./$(DEPDIR)/ssl_pkt.Plo ./$(DEPDIR)/ssl_rsa.Plo \ + ./$(DEPDIR)/ssl_sess.Plo ./$(DEPDIR)/ssl_sigalgs.Plo \ + ./$(DEPDIR)/ssl_srvr.Plo ./$(DEPDIR)/ssl_stat.Plo \ + ./$(DEPDIR)/ssl_tlsext.Plo ./$(DEPDIR)/ssl_transcript.Plo \ + ./$(DEPDIR)/ssl_txt.Plo ./$(DEPDIR)/ssl_versions.Plo \ + ./$(DEPDIR)/t1_enc.Plo ./$(DEPDIR)/t1_lib.Plo \ + ./$(DEPDIR)/tls13_buffer.Plo ./$(DEPDIR)/tls13_client.Plo \ + ./$(DEPDIR)/tls13_handshake.Plo \ + ./$(DEPDIR)/tls13_handshake_msg.Plo \ + ./$(DEPDIR)/tls13_key_schedule.Plo ./$(DEPDIR)/tls13_lib.Plo \ + ./$(DEPDIR)/tls13_record.Plo \ + ./$(DEPDIR)/tls13_record_layer.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -347,13 +375,17 @@ EXTRA_DIST = VERSION CMakeLists.txt ssl.sym libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ -no-undefined -export-symbols $(top_srcdir)/ssl/ssl.sym libssl_la_LIBADD = $(abs_top_builddir)/crypto/libcrypto.la libssl_la_SOURCES = bio_ssl.c bs_ber.c bs_cbb.c bs_cbs.c d1_both.c \ - d1_clnt.c d1_enc.c d1_lib.c d1_meth.c d1_pkt.c d1_srtp.c \ - d1_srvr.c pqueue.c s3_cbc.c s3_lib.c ssl_algs.c ssl_asn1.c \ - ssl_both.c ssl_cert.c ssl_ciph.c ssl_clnt.c ssl_err.c \ - ssl_lib.c ssl_packet.c ssl_pkt.c ssl_rsa.c ssl_sess.c \ - ssl_srvr.c ssl_stat.c ssl_tlsext.c ssl_txt.c ssl_versions.c \ - t1_clnt.c t1_enc.c t1_hash.c t1_lib.c t1_meth.c t1_srvr.c -noinst_HEADERS = srtp.h ssl_locl.h ssl_tlsext.h bytestring.h + d1_clnt.c d1_enc.c d1_lib.c d1_pkt.c d1_srtp.c d1_srvr.c \ + pqueue.c s3_cbc.c s3_lib.c ssl_algs.c ssl_asn1.c ssl_both.c \ + ssl_cert.c ssl_ciph.c ssl_ciphers.c ssl_clnt.c ssl_err.c \ + ssl_init.c ssl_lib.c ssl_methods.c ssl_packet.c ssl_pkt.c \ + ssl_rsa.c ssl_sess.c ssl_sigalgs.c ssl_srvr.c ssl_stat.c \ + ssl_tlsext.c ssl_transcript.c ssl_txt.c ssl_versions.c \ + t1_enc.c t1_lib.c tls13_buffer.c tls13_client.c \ + tls13_handshake.c tls13_handshake_msg.c tls13_key_schedule.c \ + tls13_lib.c tls13_record.c tls13_record_layer.c +noinst_HEADERS = bytestring.h srtp.h ssl_locl.h ssl_sigalgs.h \ + ssl_tlsext.h tls13_internal.h tls13_handshake.h tls13_record.h all: all-am .SUFFIXES: @@ -375,8 +407,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/Makefile.am.common $(am__empty): @@ -433,44 +465,58 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bio_ssl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bs_ber.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bs_cbb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bs_cbs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_both.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_clnt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_meth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_pkt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_srtp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_srvr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pqueue.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3_cbc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_algs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_asn1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_both.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_cert.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_ciph.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_clnt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_err.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_packet.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_pkt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_rsa.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_sess.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_srvr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_stat.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_tlsext.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_txt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_versions.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1_clnt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1_enc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1_hash.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1_lib.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1_meth.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1_srvr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bio_ssl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bs_ber.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bs_cbb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bs_cbs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_both.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_clnt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_pkt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_srtp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d1_srvr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pqueue.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3_cbc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_algs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_asn1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_both.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_cert.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_ciph.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_ciphers.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_clnt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_init.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_methods.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_packet.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_pkt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_rsa.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_sess.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_sigalgs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_srvr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_stat.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_tlsext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_transcript.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_txt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_versions.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1_enc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t1_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls13_buffer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls13_client.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls13_handshake.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls13_handshake_msg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls13_key_schedule.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls13_lib.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls13_record.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls13_record_layer.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -554,7 +600,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -627,7 +676,52 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/bio_ssl.Plo + -rm -f ./$(DEPDIR)/bs_ber.Plo + -rm -f ./$(DEPDIR)/bs_cbb.Plo + -rm -f ./$(DEPDIR)/bs_cbs.Plo + -rm -f ./$(DEPDIR)/d1_both.Plo + -rm -f ./$(DEPDIR)/d1_clnt.Plo + -rm -f ./$(DEPDIR)/d1_enc.Plo + -rm -f ./$(DEPDIR)/d1_lib.Plo + -rm -f ./$(DEPDIR)/d1_pkt.Plo + -rm -f ./$(DEPDIR)/d1_srtp.Plo + -rm -f ./$(DEPDIR)/d1_srvr.Plo + -rm -f ./$(DEPDIR)/pqueue.Plo + -rm -f ./$(DEPDIR)/s3_cbc.Plo + -rm -f ./$(DEPDIR)/s3_lib.Plo + -rm -f ./$(DEPDIR)/ssl_algs.Plo + -rm -f ./$(DEPDIR)/ssl_asn1.Plo + -rm -f ./$(DEPDIR)/ssl_both.Plo + -rm -f ./$(DEPDIR)/ssl_cert.Plo + -rm -f ./$(DEPDIR)/ssl_ciph.Plo + -rm -f ./$(DEPDIR)/ssl_ciphers.Plo + -rm -f ./$(DEPDIR)/ssl_clnt.Plo + -rm -f ./$(DEPDIR)/ssl_err.Plo + -rm -f ./$(DEPDIR)/ssl_init.Plo + -rm -f ./$(DEPDIR)/ssl_lib.Plo + -rm -f ./$(DEPDIR)/ssl_methods.Plo + -rm -f ./$(DEPDIR)/ssl_packet.Plo + -rm -f ./$(DEPDIR)/ssl_pkt.Plo + -rm -f ./$(DEPDIR)/ssl_rsa.Plo + -rm -f ./$(DEPDIR)/ssl_sess.Plo + -rm -f ./$(DEPDIR)/ssl_sigalgs.Plo + -rm -f ./$(DEPDIR)/ssl_srvr.Plo + -rm -f ./$(DEPDIR)/ssl_stat.Plo + -rm -f ./$(DEPDIR)/ssl_tlsext.Plo + -rm -f ./$(DEPDIR)/ssl_transcript.Plo + -rm -f ./$(DEPDIR)/ssl_txt.Plo + -rm -f ./$(DEPDIR)/ssl_versions.Plo + -rm -f ./$(DEPDIR)/t1_enc.Plo + -rm -f ./$(DEPDIR)/t1_lib.Plo + -rm -f ./$(DEPDIR)/tls13_buffer.Plo + -rm -f ./$(DEPDIR)/tls13_client.Plo + -rm -f ./$(DEPDIR)/tls13_handshake.Plo + -rm -f ./$(DEPDIR)/tls13_handshake_msg.Plo + -rm -f ./$(DEPDIR)/tls13_key_schedule.Plo + -rm -f ./$(DEPDIR)/tls13_lib.Plo + -rm -f ./$(DEPDIR)/tls13_record.Plo + -rm -f ./$(DEPDIR)/tls13_record_layer.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -673,7 +767,52 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/bio_ssl.Plo + -rm -f ./$(DEPDIR)/bs_ber.Plo + -rm -f ./$(DEPDIR)/bs_cbb.Plo + -rm -f ./$(DEPDIR)/bs_cbs.Plo + -rm -f ./$(DEPDIR)/d1_both.Plo + -rm -f ./$(DEPDIR)/d1_clnt.Plo + -rm -f ./$(DEPDIR)/d1_enc.Plo + -rm -f ./$(DEPDIR)/d1_lib.Plo + -rm -f ./$(DEPDIR)/d1_pkt.Plo + -rm -f ./$(DEPDIR)/d1_srtp.Plo + -rm -f ./$(DEPDIR)/d1_srvr.Plo + -rm -f ./$(DEPDIR)/pqueue.Plo + -rm -f ./$(DEPDIR)/s3_cbc.Plo + -rm -f ./$(DEPDIR)/s3_lib.Plo + -rm -f ./$(DEPDIR)/ssl_algs.Plo + -rm -f ./$(DEPDIR)/ssl_asn1.Plo + -rm -f ./$(DEPDIR)/ssl_both.Plo + -rm -f ./$(DEPDIR)/ssl_cert.Plo + -rm -f ./$(DEPDIR)/ssl_ciph.Plo + -rm -f ./$(DEPDIR)/ssl_ciphers.Plo + -rm -f ./$(DEPDIR)/ssl_clnt.Plo + -rm -f ./$(DEPDIR)/ssl_err.Plo + -rm -f ./$(DEPDIR)/ssl_init.Plo + -rm -f ./$(DEPDIR)/ssl_lib.Plo + -rm -f ./$(DEPDIR)/ssl_methods.Plo + -rm -f ./$(DEPDIR)/ssl_packet.Plo + -rm -f ./$(DEPDIR)/ssl_pkt.Plo + -rm -f ./$(DEPDIR)/ssl_rsa.Plo + -rm -f ./$(DEPDIR)/ssl_sess.Plo + -rm -f ./$(DEPDIR)/ssl_sigalgs.Plo + -rm -f ./$(DEPDIR)/ssl_srvr.Plo + -rm -f ./$(DEPDIR)/ssl_stat.Plo + -rm -f ./$(DEPDIR)/ssl_tlsext.Plo + -rm -f ./$(DEPDIR)/ssl_transcript.Plo + -rm -f ./$(DEPDIR)/ssl_txt.Plo + -rm -f ./$(DEPDIR)/ssl_versions.Plo + -rm -f ./$(DEPDIR)/t1_enc.Plo + -rm -f ./$(DEPDIR)/t1_lib.Plo + -rm -f ./$(DEPDIR)/tls13_buffer.Plo + -rm -f ./$(DEPDIR)/tls13_client.Plo + -rm -f ./$(DEPDIR)/tls13_handshake.Plo + -rm -f ./$(DEPDIR)/tls13_handshake_msg.Plo + -rm -f ./$(DEPDIR)/tls13_key_schedule.Plo + -rm -f ./$(DEPDIR)/tls13_lib.Plo + -rm -f ./$(DEPDIR)/tls13_record.Plo + -rm -f ./$(DEPDIR)/tls13_record_layer.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -694,9 +833,9 @@ uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ diff --git a/ssl/VERSION b/ssl/VERSION index 420d6411..6c351901 100644 --- a/ssl/VERSION +++ b/ssl/VERSION @@ -1 +1 @@ -44:1:0 +47:5:0 diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c index 344ca217..93cfa0d2 100644 --- a/ssl/bio_ssl.c +++ b/ssl/bio_ssl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_ssl.c,v 1.27 2017/02/07 02:08:38 beck Exp $ */ +/* $OpenBSD: bio_ssl.c,v 1.29 2018/08/24 20:30:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -85,7 +85,7 @@ typedef struct bio_ssl_st { time_t last_time; } BIO_SSL; -static BIO_METHOD methods_sslp = { +static const BIO_METHOD methods_sslp = { .type = BIO_TYPE_SSL, .name = "ssl", .bwrite = ssl_write, @@ -97,7 +97,7 @@ static BIO_METHOD methods_sslp = { .callback_ctrl = ssl_callback_ctrl, }; -BIO_METHOD * +const BIO_METHOD * BIO_f_ssl(void) { return (&methods_sslp); @@ -568,7 +568,9 @@ BIO_ssl_copy_session_id(BIO *t, BIO *f) if ((((BIO_SSL *)t->ptr)->ssl == NULL) || (((BIO_SSL *)f->ptr)->ssl == NULL)) return (0); - SSL_copy_session_id(((BIO_SSL *)t->ptr)->ssl, ((BIO_SSL *)f->ptr)->ssl); + if (!SSL_copy_session_id(((BIO_SSL *)t->ptr)->ssl, + ((BIO_SSL *)f->ptr)->ssl)) + return (0); return (1); } diff --git a/ssl/bs_cbb.c b/ssl/bs_cbb.c index 1c02eaf0..a34e822c 100644 --- a/ssl/bs_cbb.c +++ b/ssl/bs_cbb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs_cbb.c,v 1.17.4.1 2017/12/09 13:43:25 jsing Exp $ */ +/* $OpenBSD: bs_cbb.c,v 1.20 2019/01/23 22:20:40 beck Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -14,7 +14,6 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include @@ -214,7 +213,8 @@ CBB_flush(CBB *cbb) uint8_t initial_length_byte; /* We already wrote 1 byte for the length. */ - assert (cbb->pending_len_len == 1); + if (cbb->pending_len_len != 1) + return 0; /* Check for long form */ if (len > 0xfffffffe) @@ -405,6 +405,15 @@ CBB_add_u24(CBB *cbb, size_t value) return cbb_add_u(cbb, (uint32_t)value, 3); } +int +CBB_add_u32(CBB *cbb, size_t value) +{ + if (value > 0xffffffffUL) + return 0; + + return cbb_add_u(cbb, (uint32_t)value, 4); +} + int CBB_add_asn1_uint64(CBB *cbb, uint64_t value) { diff --git a/ssl/bs_cbs.c b/ssl/bs_cbs.c index ea1f0108..5c3b9e3e 100644 --- a/ssl/bs_cbs.c +++ b/ssl/bs_cbs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs_cbs.c,v 1.17 2015/06/24 09:44:18 jsing Exp $ */ +/* $OpenBSD: bs_cbs.c,v 1.18 2019/01/23 22:20:40 beck Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -14,7 +14,6 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include @@ -347,10 +346,8 @@ cbs_get_asn1(CBS *cbs, CBS *out, unsigned int tag_value, int skip_header) tag != tag_value) return 0; - if (skip_header && !CBS_skip(out, header_len)) { - assert(0); + if (skip_header && !CBS_skip(out, header_len)) return 0; - } return 1; } diff --git a/ssl/bytestring.h b/ssl/bytestring.h index 42d3d5d6..20ee4399 100644 --- a/ssl/bytestring.h +++ b/ssl/bytestring.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bytestring.h,v 1.15.6.1 2017/12/09 13:43:25 jsing Exp $ */ +/* $OpenBSD: bytestring.h,v 1.17 2018/08/16 18:39:37 jsing Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -461,6 +461,12 @@ int CBB_add_u16(CBB *cbb, size_t value); */ int CBB_add_u24(CBB *cbb, size_t value); +/* + * CBB_add_u32 appends a 32-bit, big-endian number from |value| to |cbb|. It + * returns one on success and zero otherwise. + */ +int CBB_add_u32(CBB *cbb, size_t value); + /* * CBB_add_asn1_uint64 writes an ASN.1 INTEGER into |cbb| using |CBB_add_asn1| * and writes |value| in its contents. It returns one on success and zero on diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 6b86cfc0..8f3cc610 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_both.c,v 1.51 2017/05/07 04:22:24 beck Exp $ */ +/* $OpenBSD: d1_both.c,v 1.57 2019/02/10 16:42:35 phessler Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -161,10 +161,8 @@ static unsigned int g_probable_mtu[] = {1500 - 28, 512 - 28, 256 - 28}; static unsigned int dtls1_guess_mtu(unsigned int curr_mtu); static void dtls1_fix_message_header(SSL *s, unsigned long frag_off, unsigned long frag_len); -static unsigned char *dtls1_write_message_header(SSL *s, unsigned char *p); -static void dtls1_set_message_header_int(SSL *s, unsigned char mt, - unsigned long len, unsigned short seq_num, unsigned long frag_off, - unsigned long frag_len); +static int dtls1_write_message_header(const struct hm_header_st *msg_hdr, + unsigned long frag_off, unsigned long frag_len, unsigned char *p); static long dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok); @@ -215,7 +213,7 @@ dtls1_hm_fragment_free(hm_fragment *frag) if (frag->msg_header.is_ccs) { EVP_CIPHER_CTX_free( frag->msg_header.saved_retransmit_state.enc_write_ctx); - EVP_MD_CTX_destroy( + EVP_MD_CTX_free( frag->msg_header.saved_retransmit_state.write_hash); } free(frag->fragment); @@ -304,8 +302,10 @@ dtls1_do_write(SSL *s, int type) dtls1_fix_message_header(s, frag_off, len - DTLS1_HM_HEADER_LENGTH); - dtls1_write_message_header(s, - (unsigned char *)&s->internal->init_buf->data[s->internal->init_off]); + if (!dtls1_write_message_header(&D1I(s)->w_msg_hdr, + D1I(s)->w_msg_hdr.frag_off, D1I(s)->w_msg_hdr.frag_len, + (unsigned char *)&s->internal->init_buf->data[s->internal->init_off])) + return -1; OPENSSL_assert(len >= DTLS1_HM_HEADER_LENGTH); } @@ -351,19 +351,16 @@ dtls1_do_write(SSL *s, int type) * Reconstruct message header is if it * is being sent in single fragment */ - *p++ = msg_hdr->type; - l2n3(msg_hdr->msg_len, p); - s2n (msg_hdr->seq, p); - l2n3(0, p); - l2n3(msg_hdr->msg_len, p); - p -= DTLS1_HM_HEADER_LENGTH; + if (!dtls1_write_message_header(msg_hdr, + 0, msg_hdr->msg_len, p)) + return (-1); xlen = ret; } else { p += DTLS1_HM_HEADER_LENGTH; xlen = ret - DTLS1_HM_HEADER_LENGTH; } - tls1_finish_mac(s, p, xlen); + tls1_transcript_record(s, p, xlen); } if (ret == s->internal->init_num) { @@ -434,16 +431,12 @@ dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) msg_len = msg_hdr->msg_len; /* reconstruct message header */ - *(p++) = msg_hdr->type; - l2n3(msg_len, p); - s2n (msg_hdr->seq, p); - l2n3(0, p); - l2n3(msg_len, p); + if (!dtls1_write_message_header(msg_hdr, 0, msg_len, p)) + return -1; - p -= DTLS1_HM_HEADER_LENGTH; msg_len += DTLS1_HM_HEADER_LENGTH; - tls1_finish_mac(s, p, msg_len); + tls1_transcript_record(s, p, msg_len); if (s->internal->msg_callback) s->internal->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, p, msg_len, s, s->internal->msg_callback_arg); @@ -895,40 +888,6 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok) return (-1); } -/* - * for these 2 messages, we need to - * ssl->enc_read_ctx re-init - * ssl->s3->internal->read_sequence zero - * ssl->s3->internal->read_mac_secret re-init - * ssl->session->read_sym_enc assign - * ssl->session->read_hash assign - */ -int -dtls1_send_change_cipher_spec(SSL *s, int a, int b) -{ - unsigned char *p; - - if (S3I(s)->hs.state == a) { - p = (unsigned char *)s->internal->init_buf->data; - *p++=SSL3_MT_CCS; - D1I(s)->handshake_write_seq = D1I(s)->next_handshake_write_seq; - s->internal->init_num = DTLS1_CCS_HEADER_LENGTH; - - s->internal->init_off = 0; - - dtls1_set_message_header_int(s, SSL3_MT_CCS, 0, - D1I(s)->handshake_write_seq, 0, 0); - - /* buffer the message to handle re-xmits */ - dtls1_buffer_message(s, 1); - - S3I(s)->hs.state = b; - } - - /* SSL3_ST_CW_CHANGE_B */ - return (dtls1_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC)); -} - int dtls1_read_failed(SSL *s, int code) { @@ -1087,7 +1046,7 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off, item = pqueue_find(s->d1->sent_messages, seq64be); if (item == NULL) { #ifdef DEBUG - fprintf(stderr, "retransmit: message %d non-existant\n", seq); + fprintf(stderr, "retransmit: message %d non-existent\n", seq); #endif *found = 0; return 0; @@ -1182,7 +1141,7 @@ dtls1_set_message_header(SSL *s, unsigned char mt, unsigned long len, } /* don't actually do the writing, wait till the MTU has been retrieved */ -static void +void dtls1_set_message_header_int(SSL *s, unsigned char mt, unsigned long len, unsigned short seq_num, unsigned long frag_off, unsigned long frag_len) { @@ -1204,19 +1163,33 @@ dtls1_fix_message_header(SSL *s, unsigned long frag_off, unsigned long frag_len) msg_hdr->frag_len = frag_len; } -static unsigned char * -dtls1_write_message_header(SSL *s, unsigned char *p) +static int +dtls1_write_message_header(const struct hm_header_st *msg_hdr, + unsigned long frag_off, unsigned long frag_len, unsigned char *p) { - struct hm_header_st *msg_hdr = &D1I(s)->w_msg_hdr; + CBB cbb; - *p++ = msg_hdr->type; - l2n3(msg_hdr->msg_len, p); + /* We assume DTLS1_HM_HEADER_LENGTH bytes are available for now... */ + if (!CBB_init_fixed(&cbb, p, DTLS1_HM_HEADER_LENGTH)) + return 0; + if (!CBB_add_u8(&cbb, msg_hdr->type)) + goto err; + if (!CBB_add_u24(&cbb, msg_hdr->msg_len)) + goto err; + if (!CBB_add_u16(&cbb, msg_hdr->seq)) + goto err; + if (!CBB_add_u24(&cbb, frag_off)) + goto err; + if (!CBB_add_u24(&cbb, frag_len)) + goto err; + if (!CBB_finish(&cbb, NULL, NULL)) + goto err; - s2n(msg_hdr->seq, p); - l2n3(msg_hdr->frag_off, p); - l2n3(msg_hdr->frag_len, p); + return 1; - return p; + err: + CBB_cleanup(&cbb); + return 0; } unsigned int @@ -1280,12 +1253,3 @@ dtls1_get_ccs_header(unsigned char *data, struct ccs_header_st *ccs_hdr) ccs_hdr->type = *(data++); } - -int -dtls1_shutdown(SSL *s) -{ - int ret; - - ret = ssl3_shutdown(s); - return ret; -} diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c index 3eebf984..ee21a1be 100644 --- a/ssl/d1_clnt.c +++ b/ssl/d1_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_clnt.c,v 1.76 2017/05/07 04:22:24 beck Exp $ */ +/* $OpenBSD: d1_clnt.c,v 1.82 2018/11/05 05:45:15 jsing Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -127,481 +127,7 @@ #include "bytestring.h" -static int dtls1_get_hello_verify(SSL *s); - -static const SSL_METHOD_INTERNAL DTLSv1_client_method_internal_data = { - .version = DTLS1_VERSION, - .min_version = DTLS1_VERSION, - .max_version = DTLS1_VERSION, - .ssl_new = dtls1_new, - .ssl_clear = dtls1_clear, - .ssl_free = dtls1_free, - .ssl_accept = ssl_undefined_function, - .ssl_connect = dtls1_connect, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = dtls1_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = dtls1_get_client_method, - .get_timeout = dtls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = dtls1_get_message, - .ssl_read_bytes = dtls1_read_bytes, - .ssl_write_bytes = dtls1_write_app_data_bytes, - .ssl3_enc = &DTLSv1_enc_data, -}; - -static const SSL_METHOD DTLSv1_client_method_data = { - .ssl_dispatch_alert = dtls1_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = dtls1_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &DTLSv1_client_method_internal_data, -}; - -const SSL_METHOD * -DTLSv1_client_method(void) -{ - return &DTLSv1_client_method_data; -} - -const SSL_METHOD * -dtls1_get_client_method(int ver) -{ - if (ver == DTLS1_VERSION) - return (DTLSv1_client_method()); - return (NULL); -} - int -dtls1_connect(SSL *s) -{ - void (*cb)(const SSL *ssl, int type, int val) = NULL; - int ret = -1; - int new_state, state, skip = 0; - - ERR_clear_error(); - errno = 0; - - if (s->internal->info_callback != NULL) - cb = s->internal->info_callback; - else if (s->ctx->internal->info_callback != NULL) - cb = s->ctx->internal->info_callback; - - s->internal->in_handshake++; - if (!SSL_in_init(s) || SSL_in_before(s)) - SSL_clear(s); - - - for (;;) { - state = S3I(s)->hs.state; - - switch (S3I(s)->hs.state) { - case SSL_ST_RENEGOTIATE: - s->internal->renegotiate = 1; - S3I(s)->hs.state = SSL_ST_CONNECT; - s->ctx->internal->stats.sess_connect_renegotiate++; - /* break */ - case SSL_ST_BEFORE: - case SSL_ST_CONNECT: - case SSL_ST_BEFORE|SSL_ST_CONNECT: - case SSL_ST_OK|SSL_ST_CONNECT: - - s->server = 0; - if (cb != NULL) - cb(s, SSL_CB_HANDSHAKE_START, 1); - - if ((s->version & 0xff00 ) != (DTLS1_VERSION & 0xff00)) { - SSLerror(s, ERR_R_INTERNAL_ERROR); - ret = -1; - goto end; - } - - /* s->version=SSL3_VERSION; */ - s->internal->type = SSL_ST_CONNECT; - - if (!ssl3_setup_init_buffer(s)) { - ret = -1; - goto end; - } - if (!ssl3_setup_buffers(s)) { - ret = -1; - goto end; - } - if (!ssl_init_wbio_buffer(s, 0)) { - ret = -1; - goto end; - } - - /* don't push the buffering BIO quite yet */ - - S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_A; - s->ctx->internal->stats.sess_connect++; - s->internal->init_num = 0; - /* mark client_random uninitialized */ - memset(s->s3->client_random, 0, - sizeof(s->s3->client_random)); - D1I(s)->send_cookie = 0; - s->internal->hit = 0; - break; - - - case SSL3_ST_CW_CLNT_HELLO_A: - case SSL3_ST_CW_CLNT_HELLO_B: - - s->internal->shutdown = 0; - - /* every DTLS ClientHello resets Finished MAC */ - if (!tls1_init_finished_mac(s)) { - ret = -1; - goto end; - } - - dtls1_start_timer(s); - ret = ssl3_client_hello(s); - if (ret <= 0) - goto end; - - if (D1I(s)->send_cookie) { - S3I(s)->hs.state = SSL3_ST_CW_FLUSH; - S3I(s)->hs.next_state = SSL3_ST_CR_SRVR_HELLO_A; - } else - S3I(s)->hs.state = SSL3_ST_CR_SRVR_HELLO_A; - - s->internal->init_num = 0; - - /* turn on buffering for the next lot of output */ - if (s->bbio != s->wbio) - s->wbio = BIO_push(s->bbio, s->wbio); - - break; - - case SSL3_ST_CR_SRVR_HELLO_A: - case SSL3_ST_CR_SRVR_HELLO_B: - ret = ssl3_get_server_hello(s); - if (ret <= 0) - goto end; - else { - if (s->internal->hit) { - - S3I(s)->hs.state = SSL3_ST_CR_FINISHED_A; - } else - S3I(s)->hs.state = DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A; - } - s->internal->init_num = 0; - break; - - case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A: - case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B: - - ret = dtls1_get_hello_verify(s); - if (ret <= 0) - goto end; - dtls1_stop_timer(s); - if ( D1I(s)->send_cookie) /* start again, with a cookie */ - S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_A; - else - S3I(s)->hs.state = SSL3_ST_CR_CERT_A; - s->internal->init_num = 0; - break; - - case SSL3_ST_CR_CERT_A: - case SSL3_ST_CR_CERT_B: - ret = ssl3_check_finished(s); - if (ret <= 0) - goto end; - if (ret == 2) { - s->internal->hit = 1; - if (s->internal->tlsext_ticket_expected) - S3I(s)->hs.state = SSL3_ST_CR_SESSION_TICKET_A; - else - S3I(s)->hs.state = SSL3_ST_CR_FINISHED_A; - s->internal->init_num = 0; - break; - } - /* Check if it is anon DH. */ - if (!(S3I(s)->hs.new_cipher->algorithm_auth & - SSL_aNULL)) { - ret = ssl3_get_server_certificate(s); - if (ret <= 0) - goto end; - if (s->internal->tlsext_status_expected) - S3I(s)->hs.state = SSL3_ST_CR_CERT_STATUS_A; - else - S3I(s)->hs.state = SSL3_ST_CR_KEY_EXCH_A; - } else { - skip = 1; - S3I(s)->hs.state = SSL3_ST_CR_KEY_EXCH_A; - } - s->internal->init_num = 0; - break; - - case SSL3_ST_CR_KEY_EXCH_A: - case SSL3_ST_CR_KEY_EXCH_B: - ret = ssl3_get_server_key_exchange(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_CR_CERT_REQ_A; - s->internal->init_num = 0; - - /* at this point we check that we have the - * required stuff from the server */ - if (!ssl3_check_cert_and_algorithm(s)) { - ret = -1; - goto end; - } - break; - - case SSL3_ST_CR_CERT_REQ_A: - case SSL3_ST_CR_CERT_REQ_B: - ret = ssl3_get_certificate_request(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_CR_SRVR_DONE_A; - s->internal->init_num = 0; - break; - - case SSL3_ST_CR_SRVR_DONE_A: - case SSL3_ST_CR_SRVR_DONE_B: - ret = ssl3_get_server_done(s); - if (ret <= 0) - goto end; - dtls1_stop_timer(s); - if (S3I(s)->tmp.cert_req) - S3I(s)->hs.next_state = SSL3_ST_CW_CERT_A; - else - S3I(s)->hs.next_state = SSL3_ST_CW_KEY_EXCH_A; - s->internal->init_num = 0; - S3I(s)->hs.state = S3I(s)->hs.next_state; - break; - - case SSL3_ST_CW_CERT_A: - case SSL3_ST_CW_CERT_B: - case SSL3_ST_CW_CERT_C: - case SSL3_ST_CW_CERT_D: - dtls1_start_timer(s); - ret = ssl3_send_client_certificate(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_CW_KEY_EXCH_A; - s->internal->init_num = 0; - break; - - case SSL3_ST_CW_KEY_EXCH_A: - case SSL3_ST_CW_KEY_EXCH_B: - dtls1_start_timer(s); - ret = ssl3_send_client_key_exchange(s); - if (ret <= 0) - goto end; - - /* EAY EAY EAY need to check for DH fix cert - * sent back */ - /* For TLS, cert_req is set to 2, so a cert chain - * of nothing is sent, but no verify packet is sent */ - if (S3I(s)->tmp.cert_req == 1) { - S3I(s)->hs.state = SSL3_ST_CW_CERT_VRFY_A; - } else { - S3I(s)->hs.state = SSL3_ST_CW_CHANGE_A; - S3I(s)->change_cipher_spec = 0; - } - - s->internal->init_num = 0; - break; - - case SSL3_ST_CW_CERT_VRFY_A: - case SSL3_ST_CW_CERT_VRFY_B: - dtls1_start_timer(s); - ret = ssl3_send_client_verify(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_CW_CHANGE_A; - s->internal->init_num = 0; - S3I(s)->change_cipher_spec = 0; - break; - - case SSL3_ST_CW_CHANGE_A: - case SSL3_ST_CW_CHANGE_B: - if (!s->internal->hit) - dtls1_start_timer(s); - ret = dtls1_send_change_cipher_spec(s, - SSL3_ST_CW_CHANGE_A, SSL3_ST_CW_CHANGE_B); - if (ret <= 0) - goto end; - - S3I(s)->hs.state = SSL3_ST_CW_FINISHED_A; - s->internal->init_num = 0; - - s->session->cipher = S3I(s)->hs.new_cipher; - if (!tls1_setup_key_block(s)) { - ret = -1; - goto end; - } - - if (!tls1_change_cipher_state(s, - SSL3_CHANGE_CIPHER_CLIENT_WRITE)) { - ret = -1; - goto end; - } - - - dtls1_reset_seq_numbers(s, SSL3_CC_WRITE); - break; - - case SSL3_ST_CW_FINISHED_A: - case SSL3_ST_CW_FINISHED_B: - if (!s->internal->hit) - dtls1_start_timer(s); - ret = ssl3_send_finished(s, - SSL3_ST_CW_FINISHED_A, SSL3_ST_CW_FINISHED_B, - TLS_MD_CLIENT_FINISH_CONST, - TLS_MD_CLIENT_FINISH_CONST_SIZE); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_CW_FLUSH; - - /* clear flags */ - s->s3->flags&= ~SSL3_FLAGS_POP_BUFFER; - if (s->internal->hit) { - S3I(s)->hs.next_state = SSL_ST_OK; - if (s->s3->flags & SSL3_FLAGS_DELAY_CLIENT_FINISHED) { - S3I(s)->hs.state = SSL_ST_OK; - s->s3->flags |= SSL3_FLAGS_POP_BUFFER; - S3I(s)->delay_buf_pop_ret = 0; - } - } else { - - /* Allow NewSessionTicket if ticket expected */ - if (s->internal->tlsext_ticket_expected) - S3I(s)->hs.next_state = - SSL3_ST_CR_SESSION_TICKET_A; - else - S3I(s)->hs.next_state = - SSL3_ST_CR_FINISHED_A; - } - s->internal->init_num = 0; - break; - - case SSL3_ST_CR_SESSION_TICKET_A: - case SSL3_ST_CR_SESSION_TICKET_B: - ret = ssl3_get_new_session_ticket(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_CR_FINISHED_A; - s->internal->init_num = 0; - break; - - case SSL3_ST_CR_CERT_STATUS_A: - case SSL3_ST_CR_CERT_STATUS_B: - ret = ssl3_get_cert_status(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_CR_KEY_EXCH_A; - s->internal->init_num = 0; - break; - - case SSL3_ST_CR_FINISHED_A: - case SSL3_ST_CR_FINISHED_B: - D1I(s)->change_cipher_spec_ok = 1; - ret = ssl3_get_finished(s, SSL3_ST_CR_FINISHED_A, - SSL3_ST_CR_FINISHED_B); - if (ret <= 0) - goto end; - dtls1_stop_timer(s); - - if (s->internal->hit) - S3I(s)->hs.state = SSL3_ST_CW_CHANGE_A; - else - S3I(s)->hs.state = SSL_ST_OK; - - - s->internal->init_num = 0; - break; - - case SSL3_ST_CW_FLUSH: - s->internal->rwstate = SSL_WRITING; - if (BIO_flush(s->wbio) <= 0) { - /* If the write error was fatal, stop trying */ - if (!BIO_should_retry(s->wbio)) { - s->internal->rwstate = SSL_NOTHING; - S3I(s)->hs.state = S3I(s)->hs.next_state; - } - - ret = -1; - goto end; - } - s->internal->rwstate = SSL_NOTHING; - S3I(s)->hs.state = S3I(s)->hs.next_state; - break; - - case SSL_ST_OK: - /* clean a few things up */ - tls1_cleanup_key_block(s); - - /* If we are not 'joining' the last two packets, - * remove the buffering now */ - if (!(s->s3->flags & SSL3_FLAGS_POP_BUFFER)) - ssl_free_wbio_buffer(s); - /* else do it later in ssl3_write */ - - s->internal->init_num = 0; - s->internal->renegotiate = 0; - s->internal->new_session = 0; - - ssl_update_cache(s, SSL_SESS_CACHE_CLIENT); - if (s->internal->hit) - s->ctx->internal->stats.sess_hit++; - - ret = 1; - /* s->server=0; */ - s->internal->handshake_func = dtls1_connect; - s->ctx->internal->stats.sess_connect_good++; - - if (cb != NULL) - cb(s, SSL_CB_HANDSHAKE_DONE, 1); - - /* done with handshaking */ - D1I(s)->handshake_read_seq = 0; - D1I(s)->next_handshake_write_seq = 0; - goto end; - /* break; */ - - default: - SSLerror(s, SSL_R_UNKNOWN_STATE); - ret = -1; - goto end; - /* break; */ - } - - /* did we do anything */ - if (!S3I(s)->tmp.reuse_message && !skip) { - if (s->internal->debug) { - if ((ret = BIO_flush(s->wbio)) <= 0) - goto end; - } - - if ((cb != NULL) && (S3I(s)->hs.state != state)) { - new_state = S3I(s)->hs.state; - S3I(s)->hs.state = state; - cb(s, SSL_CB_CONNECT_LOOP, 1); - S3I(s)->hs.state = new_state; - } - } - skip = 0; - } - -end: - s->internal->in_handshake--; - if (cb != NULL) - cb(s, SSL_CB_CONNECT_EXIT, ret); - - return (ret); -} - -static int dtls1_get_hello_verify(SSL *s) { long n; diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c index 9f670fad..b406b625 100644 --- a/ssl/d1_pkt.c +++ b/ssl/d1_pkt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_pkt.c,v 1.63 2017/05/07 04:22:24 beck Exp $ */ +/* $OpenBSD: d1_pkt.c,v 1.66 2018/12/03 17:16:12 tb Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -200,11 +200,11 @@ dtls1_copy_record(SSL *s, pitem *item) rdata = (DTLS1_RECORD_DATA *)item->data; - free(s->s3->rbuf.buf); + free(S3I(s)->rbuf.buf); s->internal->packet = rdata->packet; s->internal->packet_length = rdata->packet_length; - memcpy(&(s->s3->rbuf), &(rdata->rbuf), sizeof(SSL3_BUFFER)); + memcpy(&(S3I(s)->rbuf), &(rdata->rbuf), sizeof(SSL3_BUFFER)); memcpy(&(S3I(s)->rrec), &(rdata->rrec), sizeof(SSL3_RECORD)); /* Set proper sequence number for mac calculation */ @@ -231,7 +231,7 @@ dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) rdata->packet = s->internal->packet; rdata->packet_length = s->internal->packet_length; - memcpy(&(rdata->rbuf), &(s->s3->rbuf), sizeof(SSL3_BUFFER)); + memcpy(&(rdata->rbuf), &(S3I(s)->rbuf), sizeof(SSL3_BUFFER)); memcpy(&(rdata->rrec), &(S3I(s)->rrec), sizeof(SSL3_RECORD)); item->data = rdata; @@ -239,7 +239,7 @@ dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) s->internal->packet = NULL; s->internal->packet_length = 0; - memset(&(s->s3->rbuf), 0, sizeof(SSL3_BUFFER)); + memset(&(S3I(s)->rbuf), 0, sizeof(SSL3_BUFFER)); memset(&(S3I(s)->rrec), 0, sizeof(SSL3_RECORD)); if (!ssl3_setup_buffers(s)) @@ -643,7 +643,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) SSL3_RECORD *rr; void (*cb)(const SSL *ssl, int type2, int val) = NULL; - if (s->s3->rbuf.buf == NULL) /* Not initialized yet */ + if (S3I(s)->rbuf.buf == NULL) /* Not initialized yet */ if (!ssl3_setup_buffers(s)) return (-1); @@ -672,7 +672,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) } } -start: + start: s->internal->rwstate = SSL_NOTHING; /* S3I(s)->rrec.type - is the type of record @@ -825,14 +825,6 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) /* XDTLS: In a pathalogical case, the Client Hello * may be fragmented--don't always expect dest_maxlen bytes */ if (rr->length < dest_maxlen) { -#ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE - /* - * for normal alerts rr->length is 2, while - * dest_maxlen is 7 if we were to handle this - * non-existing alert... - */ - FIX ME -#endif s->internal->rstate = SSL_ST_READ_HEADER; rr->length = 0; goto start; @@ -863,7 +855,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) (D1I(s)->handshake_fragment[3] != 0)) { al = SSL_AD_DECODE_ERROR; SSLerror(s, SSL_R_BAD_HELLO_REQUEST); - goto err; + goto f_err; } /* no need to check sequence number on HELLO REQUEST messages */ @@ -888,7 +880,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) } if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { - if (s->s3->rbuf.left == 0) /* no read-ahead left? */ + if (S3I(s)->rbuf.left == 0) /* no read-ahead left? */ { BIO *bio; /* In the case where we try to read application data, @@ -973,9 +965,9 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) /* XDTLS: check that epoch is consistent */ if ((rr->length != ccs_hdr_len) || (rr->off != 0) || (rr->data[0] != SSL3_MT_CCS)) { - i = SSL_AD_ILLEGAL_PARAMETER; + al = SSL_AD_DECODE_ERROR; SSLerror(s, SSL_R_BAD_CHANGE_CIPHER_SPEC); - goto err; + goto f_err; } rr->length = 0; @@ -1043,7 +1035,7 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) } if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { - if (s->s3->rbuf.left == 0) /* no read-ahead left? */ + if (S3I(s)->rbuf.left == 0) /* no read-ahead left? */ { BIO *bio; /* In the case where we try to read application data, @@ -1105,9 +1097,9 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) } /* not reached */ -f_err: + f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); -err: + err: return (-1); } @@ -1196,13 +1188,13 @@ do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len) /* first check if there is a SSL3_BUFFER still being written * out. This will happen with non blocking IO */ - if (s->s3->wbuf.left != 0) { + if (S3I(s)->wbuf.left != 0) { OPENSSL_assert(0); /* XDTLS: want to see if we ever get here */ return (ssl3_write_pending(s, type, buf, len)); } /* If we have an alert to send, lets send it */ - if (s->s3->alert_dispatch) { + if (S3I(s)->alert_dispatch) { i = s->method->ssl_dispatch_alert(s); if (i <= 0) return (i); @@ -1213,7 +1205,7 @@ do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len) return 0; wr = &(S3I(s)->wrec); - wb = &(s->s3->wbuf); + wb = &(S3I(s)->wbuf); sess = s->session; if ((sess == NULL) || (s->internal->enc_write_ctx == NULL) || @@ -1390,34 +1382,23 @@ dtls1_dispatch_alert(SSL *s) unsigned char buf[DTLS1_AL_HEADER_LENGTH]; unsigned char *ptr = &buf[0]; - s->s3->alert_dispatch = 0; + S3I(s)->alert_dispatch = 0; memset(buf, 0x00, sizeof(buf)); - *ptr++ = s->s3->send_alert[0]; - *ptr++ = s->s3->send_alert[1]; - -#ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE - if (s->s3->send_alert[1] == DTLS1_AD_MISSING_HANDSHAKE_MESSAGE) { - s2n(D1I(s)->handshake_read_seq, ptr); - l2n3(D1I(s)->r_msg_hdr.frag_off, ptr); - } -#endif + *ptr++ = S3I(s)->send_alert[0]; + *ptr++ = S3I(s)->send_alert[1]; i = do_dtls1_write(s, SSL3_RT_ALERT, &buf[0], sizeof(buf)); if (i <= 0) { - s->s3->alert_dispatch = 1; + S3I(s)->alert_dispatch = 1; /* fprintf( stderr, "not done with alert\n" ); */ } else { - if (s->s3->send_alert[0] == SSL3_AL_FATAL -#ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE - || s->s3->send_alert[1] == DTLS1_AD_MISSING_HANDSHAKE_MESSAGE -#endif - ) + if (S3I(s)->send_alert[0] == SSL3_AL_FATAL) (void)BIO_flush(s->wbio); if (s->internal->msg_callback) s->internal->msg_callback(1, s->version, SSL3_RT_ALERT, - s->s3->send_alert, 2, s, s->internal->msg_callback_arg); + S3I(s)->send_alert, 2, s, s->internal->msg_callback_arg); if (s->internal->info_callback != NULL) cb = s->internal->info_callback; @@ -1425,7 +1406,7 @@ dtls1_dispatch_alert(SSL *s) cb = s->ctx->internal->info_callback; if (cb != NULL) { - j = (s->s3->send_alert[0]<<8)|s->s3->send_alert[1]; + j = (S3I(s)->send_alert[0]<<8)|S3I(s)->send_alert[1]; cb(s, SSL_CB_WRITE_ALERT, j); } } diff --git a/ssl/d1_srtp.c b/ssl/d1_srtp.c index eb1877a1..4b1b24a3 100644 --- a/ssl/d1_srtp.c +++ b/ssl/d1_srtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_srtp.c,v 1.22 2017/08/27 02:58:04 doug Exp $ */ +/* $OpenBSD: d1_srtp.c,v 1.23 2018/11/09 04:35:09 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -207,6 +207,7 @@ ssl_ctx_make_profiles(const char *profiles_string, ptr = col + 1; } while (col); + sk_SRTP_PROTECTION_PROFILE_free(*out); *out = profiles; return 0; diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index ae90ee20..1a1ee542 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_srvr.c,v 1.88 2017/05/07 04:22:24 beck Exp $ */ +/* $OpenBSD: d1_srvr.c,v 1.95 2018/11/05 05:45:15 jsing Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -125,581 +125,6 @@ #include #include -static int dtls1_send_hello_verify_request(SSL *s); - -static const SSL_METHOD_INTERNAL DTLSv1_server_method_internal_data = { - .version = DTLS1_VERSION, - .min_version = DTLS1_VERSION, - .max_version = DTLS1_VERSION, - .ssl_new = dtls1_new, - .ssl_clear = dtls1_clear, - .ssl_free = dtls1_free, - .ssl_accept = dtls1_accept, - .ssl_connect = ssl_undefined_function, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = dtls1_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = dtls1_get_server_method, - .get_timeout = dtls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = dtls1_get_message, - .ssl_read_bytes = dtls1_read_bytes, - .ssl_write_bytes = dtls1_write_app_data_bytes, - .ssl3_enc = &DTLSv1_enc_data, -}; - -static const SSL_METHOD DTLSv1_server_method_data = { - .ssl_dispatch_alert = dtls1_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = dtls1_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &DTLSv1_server_method_internal_data, -}; - -const SSL_METHOD * -DTLSv1_server_method(void) -{ - return &DTLSv1_server_method_data; -} - -const SSL_METHOD * -dtls1_get_server_method(int ver) -{ - if (ver == DTLS1_VERSION) - return (DTLSv1_server_method()); - return (NULL); -} - -int -dtls1_accept(SSL *s) -{ - void (*cb)(const SSL *ssl, int type, int val) = NULL; - unsigned long alg_k; - int ret = -1; - int new_state, state, skip = 0; - int listen; - - ERR_clear_error(); - errno = 0; - - if (s->internal->info_callback != NULL) - cb = s->internal->info_callback; - else if (s->ctx->internal->info_callback != NULL) - cb = s->ctx->internal->info_callback; - - listen = D1I(s)->listen; - - /* init things to blank */ - s->internal->in_handshake++; - if (!SSL_in_init(s) || SSL_in_before(s)) - SSL_clear(s); - - D1I(s)->listen = listen; - - if (s->cert == NULL) { - SSLerror(s, SSL_R_NO_CERTIFICATE_SET); - ret = -1; - goto end; - } - - for (;;) { - state = S3I(s)->hs.state; - - switch (S3I(s)->hs.state) { - case SSL_ST_RENEGOTIATE: - s->internal->renegotiate = 1; - /* S3I(s)->hs.state=SSL_ST_ACCEPT; */ - - case SSL_ST_BEFORE: - case SSL_ST_ACCEPT: - case SSL_ST_BEFORE|SSL_ST_ACCEPT: - case SSL_ST_OK|SSL_ST_ACCEPT: - - s->server = 1; - if (cb != NULL) - cb(s, SSL_CB_HANDSHAKE_START, 1); - - if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00)) { - SSLerror(s, ERR_R_INTERNAL_ERROR); - ret = -1; - goto end; - } - s->internal->type = SSL_ST_ACCEPT; - - if (!ssl3_setup_init_buffer(s)) { - ret = -1; - goto end; - } - if (!ssl3_setup_buffers(s)) { - ret = -1; - goto end; - } - - s->internal->init_num = 0; - - if (S3I(s)->hs.state != SSL_ST_RENEGOTIATE) { - /* Ok, we now need to push on a buffering BIO so that - * the output is sent in a way that TCP likes :-) - * ...but not with SCTP :-) - */ - if (!ssl_init_wbio_buffer(s, 1)) { - ret = -1; - goto end; - } - - if (!tls1_init_finished_mac(s)) { - ret = -1; - goto end; - } - - S3I(s)->hs.state = SSL3_ST_SR_CLNT_HELLO_A; - s->ctx->internal->stats.sess_accept++; - } else { - /* S3I(s)->hs.state == SSL_ST_RENEGOTIATE, - * we will just send a HelloRequest */ - s->ctx->internal->stats.sess_accept_renegotiate++; - S3I(s)->hs.state = SSL3_ST_SW_HELLO_REQ_A; - } - - break; - - case SSL3_ST_SW_HELLO_REQ_A: - case SSL3_ST_SW_HELLO_REQ_B: - - s->internal->shutdown = 0; - dtls1_clear_record_buffer(s); - dtls1_start_timer(s); - ret = ssl3_send_hello_request(s); - if (ret <= 0) - goto end; - S3I(s)->hs.next_state = SSL3_ST_SR_CLNT_HELLO_A; - S3I(s)->hs.state = SSL3_ST_SW_FLUSH; - s->internal->init_num = 0; - - if (!tls1_init_finished_mac(s)) { - ret = -1; - goto end; - } - break; - - case SSL3_ST_SW_HELLO_REQ_C: - S3I(s)->hs.state = SSL_ST_OK; - break; - - case SSL3_ST_SR_CLNT_HELLO_A: - case SSL3_ST_SR_CLNT_HELLO_B: - case SSL3_ST_SR_CLNT_HELLO_C: - - s->internal->shutdown = 0; - ret = ssl3_get_client_hello(s); - if (ret <= 0) - goto end; - dtls1_stop_timer(s); - - if (ret == 1 && (SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE)) - S3I(s)->hs.state = DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A; - else - S3I(s)->hs.state = SSL3_ST_SW_SRVR_HELLO_A; - - s->internal->init_num = 0; - - /* Reflect ClientHello sequence to remain stateless while listening */ - if (listen) { - memcpy(S3I(s)->write_sequence, S3I(s)->read_sequence, sizeof(S3I(s)->write_sequence)); - } - - /* If we're just listening, stop here */ - if (listen && S3I(s)->hs.state == SSL3_ST_SW_SRVR_HELLO_A) { - ret = 2; - D1I(s)->listen = 0; - /* Set expected sequence numbers - * to continue the handshake. - */ - D1I(s)->handshake_read_seq = 2; - D1I(s)->handshake_write_seq = 1; - D1I(s)->next_handshake_write_seq = 1; - goto end; - } - - break; - - case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A: - case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B: - - ret = dtls1_send_hello_verify_request(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_SW_FLUSH; - S3I(s)->hs.next_state = SSL3_ST_SR_CLNT_HELLO_A; - - /* HelloVerifyRequest resets Finished MAC */ - if (!tls1_init_finished_mac(s)) { - ret = -1; - goto end; - } - break; - - - case SSL3_ST_SW_SRVR_HELLO_A: - case SSL3_ST_SW_SRVR_HELLO_B: - s->internal->renegotiate = 2; - dtls1_start_timer(s); - ret = ssl3_send_server_hello(s); - if (ret <= 0) - goto end; - - if (s->internal->hit) { - if (s->internal->tlsext_ticket_expected) - S3I(s)->hs.state = SSL3_ST_SW_SESSION_TICKET_A; - else - S3I(s)->hs.state = SSL3_ST_SW_CHANGE_A; - } else - S3I(s)->hs.state = SSL3_ST_SW_CERT_A; - s->internal->init_num = 0; - break; - - case SSL3_ST_SW_CERT_A: - case SSL3_ST_SW_CERT_B: - /* Check if it is anon DH. */ - if (!(S3I(s)->hs.new_cipher->algorithm_auth & - SSL_aNULL)) { - dtls1_start_timer(s); - ret = ssl3_send_server_certificate(s); - if (ret <= 0) - goto end; - if (s->internal->tlsext_status_expected) - S3I(s)->hs.state = SSL3_ST_SW_CERT_STATUS_A; - else - S3I(s)->hs.state = SSL3_ST_SW_KEY_EXCH_A; - } else { - skip = 1; - S3I(s)->hs.state = SSL3_ST_SW_KEY_EXCH_A; - } - s->internal->init_num = 0; - break; - - case SSL3_ST_SW_KEY_EXCH_A: - case SSL3_ST_SW_KEY_EXCH_B: - alg_k = S3I(s)->hs.new_cipher->algorithm_mkey; - - /* Only send if using a DH key exchange. */ - if (alg_k & (SSL_kDHE|SSL_kECDHE)) { - dtls1_start_timer(s); - ret = ssl3_send_server_key_exchange(s); - if (ret <= 0) - goto end; - } else - skip = 1; - - S3I(s)->hs.state = SSL3_ST_SW_CERT_REQ_A; - s->internal->init_num = 0; - break; - - case SSL3_ST_SW_CERT_REQ_A: - case SSL3_ST_SW_CERT_REQ_B: - /* - * Determine whether or not we need to request a - * certificate. - * - * Do not request a certificate if: - * - * - We did not ask for it (SSL_VERIFY_PEER is unset). - * - * - SSL_VERIFY_CLIENT_ONCE is set and we are - * renegotiating. - * - * - We are using an anonymous ciphersuites - * (see section "Certificate request" in SSL 3 drafts - * and in RFC 2246) ... except when the application - * insists on verification (against the specs, but - * s3_clnt.c accepts this for SSL 3). - */ - if (!(s->verify_mode & SSL_VERIFY_PEER) || - ((s->session->peer != NULL) && - (s->verify_mode & SSL_VERIFY_CLIENT_ONCE)) || - ((S3I(s)->hs.new_cipher->algorithm_auth & - SSL_aNULL) && !(s->verify_mode & - SSL_VERIFY_FAIL_IF_NO_PEER_CERT))) { - /* no cert request */ - skip = 1; - S3I(s)->tmp.cert_request = 0; - S3I(s)->hs.state = SSL3_ST_SW_SRVR_DONE_A; - } else { - S3I(s)->tmp.cert_request = 1; - dtls1_start_timer(s); - ret = ssl3_send_certificate_request(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_SW_SRVR_DONE_A; - s->internal->init_num = 0; - } - break; - - case SSL3_ST_SW_SRVR_DONE_A: - case SSL3_ST_SW_SRVR_DONE_B: - dtls1_start_timer(s); - ret = ssl3_send_server_done(s); - if (ret <= 0) - goto end; - S3I(s)->hs.next_state = SSL3_ST_SR_CERT_A; - S3I(s)->hs.state = SSL3_ST_SW_FLUSH; - s->internal->init_num = 0; - break; - - case SSL3_ST_SW_FLUSH: - s->internal->rwstate = SSL_WRITING; - if (BIO_flush(s->wbio) <= 0) { - /* If the write error was fatal, stop trying */ - if (!BIO_should_retry(s->wbio)) { - s->internal->rwstate = SSL_NOTHING; - S3I(s)->hs.state = S3I(s)->hs.next_state; - } - - ret = -1; - goto end; - } - s->internal->rwstate = SSL_NOTHING; - S3I(s)->hs.state = S3I(s)->hs.next_state; - break; - - case SSL3_ST_SR_CERT_A: - case SSL3_ST_SR_CERT_B: - if (S3I(s)->tmp.cert_request) { - ret = ssl3_get_client_certificate(s); - if (ret <= 0) - goto end; - } - s->internal->init_num = 0; - S3I(s)->hs.state = SSL3_ST_SR_KEY_EXCH_A; - break; - - case SSL3_ST_SR_KEY_EXCH_A: - case SSL3_ST_SR_KEY_EXCH_B: - ret = ssl3_get_client_key_exchange(s); - if (ret <= 0) - goto end; - - S3I(s)->hs.state = SSL3_ST_SR_CERT_VRFY_A; - s->internal->init_num = 0; - - if (ret == 2) { - /* For the ECDH ciphersuites when - * the client sends its ECDH pub key in - * a certificate, the CertificateVerify - * message is not sent. - */ - S3I(s)->hs.state = SSL3_ST_SR_FINISHED_A; - s->internal->init_num = 0; - } else if (SSL_USE_SIGALGS(s)) { - S3I(s)->hs.state = SSL3_ST_SR_CERT_VRFY_A; - s->internal->init_num = 0; - if (!s->session->peer) - break; - - /* - * For sigalgs freeze the handshake buffer - * at this point and digest cached records. - */ - if (!S3I(s)->handshake_buffer) { - SSLerror(s, ERR_R_INTERNAL_ERROR); - ret = -1; - goto end; - } - s->s3->flags |= TLS1_FLAGS_KEEP_HANDSHAKE; - if (!tls1_digest_cached_records(s)) { - ret = -1; - goto end; - } - } else { - S3I(s)->hs.state = SSL3_ST_SR_CERT_VRFY_A; - s->internal->init_num = 0; - - /* - * We need to get hashes here so if there is - * a client cert, it can be verified. - */ - if (S3I(s)->handshake_buffer) { - if (!tls1_digest_cached_records(s)) { - ret = -1; - goto end; - } - } - if (!tls1_handshake_hash_value(s, - S3I(s)->tmp.cert_verify_md, - sizeof(S3I(s)->tmp.cert_verify_md), - NULL)) { - ret = -1; - goto end; - } - } - break; - - case SSL3_ST_SR_CERT_VRFY_A: - case SSL3_ST_SR_CERT_VRFY_B: - - D1I(s)->change_cipher_spec_ok = 1; - /* we should decide if we expected this one */ - ret = ssl3_get_cert_verify(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_SR_FINISHED_A; - s->internal->init_num = 0; - break; - - case SSL3_ST_SR_FINISHED_A: - case SSL3_ST_SR_FINISHED_B: - D1I(s)->change_cipher_spec_ok = 1; - ret = ssl3_get_finished(s, SSL3_ST_SR_FINISHED_A, - SSL3_ST_SR_FINISHED_B); - if (ret <= 0) - goto end; - dtls1_stop_timer(s); - if (s->internal->hit) - S3I(s)->hs.state = SSL_ST_OK; - else if (s->internal->tlsext_ticket_expected) - S3I(s)->hs.state = SSL3_ST_SW_SESSION_TICKET_A; - else - S3I(s)->hs.state = SSL3_ST_SW_CHANGE_A; - s->internal->init_num = 0; - break; - - case SSL3_ST_SW_SESSION_TICKET_A: - case SSL3_ST_SW_SESSION_TICKET_B: - ret = ssl3_send_newsession_ticket(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_SW_CHANGE_A; - s->internal->init_num = 0; - break; - - case SSL3_ST_SW_CERT_STATUS_A: - case SSL3_ST_SW_CERT_STATUS_B: - ret = ssl3_send_cert_status(s); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_SW_KEY_EXCH_A; - s->internal->init_num = 0; - break; - - - case SSL3_ST_SW_CHANGE_A: - case SSL3_ST_SW_CHANGE_B: - - s->session->cipher = S3I(s)->hs.new_cipher; - if (!tls1_setup_key_block(s)) { - ret = -1; - goto end; - } - - ret = dtls1_send_change_cipher_spec(s, - SSL3_ST_SW_CHANGE_A, SSL3_ST_SW_CHANGE_B); - - if (ret <= 0) - goto end; - - - S3I(s)->hs.state = SSL3_ST_SW_FINISHED_A; - s->internal->init_num = 0; - - if (!tls1_change_cipher_state(s, - SSL3_CHANGE_CIPHER_SERVER_WRITE)) { - ret = -1; - goto end; - } - - dtls1_reset_seq_numbers(s, SSL3_CC_WRITE); - break; - - case SSL3_ST_SW_FINISHED_A: - case SSL3_ST_SW_FINISHED_B: - ret = ssl3_send_finished(s, - SSL3_ST_SW_FINISHED_A, SSL3_ST_SW_FINISHED_B, - TLS_MD_SERVER_FINISH_CONST, - TLS_MD_SERVER_FINISH_CONST_SIZE); - if (ret <= 0) - goto end; - S3I(s)->hs.state = SSL3_ST_SW_FLUSH; - if (s->internal->hit) { - S3I(s)->hs.next_state = SSL3_ST_SR_FINISHED_A; - - } else { - S3I(s)->hs.next_state = SSL_ST_OK; - } - s->internal->init_num = 0; - break; - - case SSL_ST_OK: - /* clean a few things up */ - tls1_cleanup_key_block(s); - - /* remove buffering on output */ - ssl_free_wbio_buffer(s); - - s->internal->init_num = 0; - - if (s->internal->renegotiate == 2) /* skipped if we just sent a HelloRequest */ - { - s->internal->renegotiate = 0; - s->internal->new_session = 0; - - ssl_update_cache(s, SSL_SESS_CACHE_SERVER); - - s->ctx->internal->stats.sess_accept_good++; - /* s->server=1; */ - s->internal->handshake_func = dtls1_accept; - - if (cb != NULL) - cb(s, SSL_CB_HANDSHAKE_DONE, 1); - } - - ret = 1; - - /* done handshaking, next message is client hello */ - D1I(s)->handshake_read_seq = 0; - /* next message is server hello */ - D1I(s)->handshake_write_seq = 0; - D1I(s)->next_handshake_write_seq = 0; - goto end; - /* break; */ - - default: - SSLerror(s, SSL_R_UNKNOWN_STATE); - ret = -1; - goto end; - /* break; */ - } - - if (!S3I(s)->tmp.reuse_message && !skip) { - if (s->internal->debug) { - if ((ret = BIO_flush(s->wbio)) <= 0) - goto end; - } - - if ((cb != NULL) && (S3I(s)->hs.state != state)) { - new_state = S3I(s)->hs.state; - S3I(s)->hs.state = state; - cb(s, SSL_CB_ACCEPT_LOOP, 1); - S3I(s)->hs.state = new_state; - } - } - skip = 0; - } -end: - /* BIO_flush(s->wbio); */ - - s->internal->in_handshake--; - - if (cb != NULL) - cb(s, SSL_CB_ACCEPT_EXIT, ret); - - return (ret); -} - int dtls1_send_hello_verify_request(SSL *s) { @@ -715,7 +140,7 @@ dtls1_send_hello_verify_request(SSL *s) return 0; } - if (!ssl3_handshake_msg_start_cbb(s, &cbb, &verify, + if (!ssl3_handshake_msg_start(s, &cbb, &verify, DTLS1_MT_HELLO_VERIFY_REQUEST)) goto err; if (!CBB_add_u16(&verify, s->version)) @@ -724,7 +149,7 @@ dtls1_send_hello_verify_request(SSL *s) goto err; if (!CBB_add_bytes(&cookie, D1I(s)->cookie, D1I(s)->cookie_len)) goto err; - if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) + if (!ssl3_handshake_msg_finish(s, &cbb)) goto err; S3I(s)->hs.state = DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B; diff --git a/ssl/s3_cbc.c b/ssl/s3_cbc.c index 8c910c5f..a1c0ce6b 100644 --- a/ssl/s3_cbc.c +++ b/ssl/s3_cbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_cbc.c,v 1.16 2017/01/23 08:08:06 beck Exp $ */ +/* $OpenBSD: s3_cbc.c,v 1.17 2018/09/08 14:39:41 jsing Exp $ */ /* ==================================================================== * Copyright (c) 2012 The OpenSSL Project. All rights reserved. * @@ -135,12 +135,6 @@ tls1_cbc_remove_padding(const SSL* s, SSL3_RECORD *rec, unsigned block_size, padding_length = rec->data[rec->length - 1]; - if (EVP_CIPHER_flags(s->enc_read_ctx->cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) { - /* padding is already verified */ - rec->length -= padding_length + 1; - return 1; - } - good = constant_time_ge(rec->length, overhead + padding_length); /* The padding consists of a length byte at the end of the record and * then that many bytes of padding, all with the same value as the diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index a05116cb..0357a70c 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_lib.c,v 1.161 2017/09/25 18:04:08 jsing Exp $ */ +/* $OpenBSD: s3_lib.c,v 1.186 2019/04/04 15:03:21 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -237,22 +237,6 @@ SSL_CIPHER ssl3_ciphers[] = { .alg_bits = 128, }, - /* Cipher 09 */ - { - .valid = 1, - .name = SSL3_TXT_RSA_DES_64_CBC_SHA, - .id = SSL3_CK_RSA_DES_64_CBC_SHA, - .algorithm_mkey = SSL_kRSA, - .algorithm_auth = SSL_aRSA, - .algorithm_enc = SSL_DES, - .algorithm_mac = SSL_SHA1, - .algorithm_ssl = SSL_SSLV3, - .algo_strength = SSL_LOW, - .algorithm2 = SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, - .strength_bits = 56, - .alg_bits = 56, - }, - /* Cipher 0A */ { .valid = 1, @@ -273,22 +257,6 @@ SSL_CIPHER ssl3_ciphers[] = { * Ephemeral DH (DHE) ciphers. */ - /* Cipher 15 */ - { - .valid = 1, - .name = SSL3_TXT_EDH_RSA_DES_64_CBC_SHA, - .id = SSL3_CK_EDH_RSA_DES_64_CBC_SHA, - .algorithm_mkey = SSL_kDHE, - .algorithm_auth = SSL_aRSA, - .algorithm_enc = SSL_DES, - .algorithm_mac = SSL_SHA1, - .algorithm_ssl = SSL_SSLV3, - .algo_strength = SSL_LOW, - .algorithm2 = SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, - .strength_bits = 56, - .alg_bits = 56, - }, - /* Cipher 16 */ { .valid = 1, @@ -321,22 +289,6 @@ SSL_CIPHER ssl3_ciphers[] = { .alg_bits = 128, }, - /* Cipher 1A */ - { - .valid = 1, - .name = SSL3_TXT_ADH_DES_64_CBC_SHA, - .id = SSL3_CK_ADH_DES_64_CBC_SHA, - .algorithm_mkey = SSL_kDHE, - .algorithm_auth = SSL_aNULL, - .algorithm_enc = SSL_DES, - .algorithm_mac = SSL_SHA1, - .algorithm_ssl = SSL_SSLV3, - .algo_strength = SSL_LOW, - .algorithm2 = SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, - .strength_bits = 56, - .alg_bits = 56, - }, - /* Cipher 1B */ { .valid = 1, @@ -722,7 +674,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(4)| + FIXED_NONCE_LEN(4)| SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD, .strength_bits = 128, .alg_bits = 128, @@ -740,7 +692,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(4)| + FIXED_NONCE_LEN(4)| SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD, .strength_bits = 256, .alg_bits = 256, @@ -758,7 +710,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(4)| + FIXED_NONCE_LEN(4)| SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD, .strength_bits = 128, .alg_bits = 128, @@ -776,7 +728,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(4)| + FIXED_NONCE_LEN(4)| SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD, .strength_bits = 256, .alg_bits = 256, @@ -794,7 +746,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(4)| + FIXED_NONCE_LEN(4)| SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD, .strength_bits = 128, .alg_bits = 128, @@ -812,7 +764,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(4)| + FIXED_NONCE_LEN(4)| SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD, .strength_bits = 256, .alg_bits = 256, @@ -918,6 +870,60 @@ SSL_CIPHER ssl3_ciphers[] = { }, #endif /* OPENSSL_NO_CAMELLIA */ + /* + * TLSv1.3 cipher suites. + */ + +#ifdef LIBRESSL_HAS_TLS1_3 + /* Cipher 1301 */ + { + .valid = 1, + .name = TLS1_3_TXT_AES_128_GCM_SHA256, + .id = TLS1_3_CK_AES_128_GCM_SHA256, + .algorithm_mkey = SSL_kTLS1_3, + .algorithm_auth = SSL_aTLS1_3, + .algorithm_enc = SSL_AES128GCM, + .algorithm_mac = SSL_AEAD, + .algorithm_ssl = SSL_TLSV1_3, + .algo_strength = SSL_HIGH, + .algorithm2 = SSL_HANDSHAKE_MAC_SHA256, /* XXX */ + .strength_bits = 128, + .alg_bits = 128, + }, + + /* Cipher 1302 */ + { + .valid = 1, + .name = TLS1_3_TXT_AES_256_GCM_SHA384, + .id = TLS1_3_CK_AES_256_GCM_SHA384, + .algorithm_mkey = SSL_kTLS1_3, + .algorithm_auth = SSL_aTLS1_3, + .algorithm_enc = SSL_AES256GCM, + .algorithm_mac = SSL_AEAD, + .algorithm_ssl = SSL_TLSV1_3, + .algo_strength = SSL_HIGH, + .algorithm2 = SSL_HANDSHAKE_MAC_SHA384, /* XXX */ + .strength_bits = 256, + .alg_bits = 256, + }, + + /* Cipher 1303 */ + { + .valid = 1, + .name = TLS1_3_TXT_CHACHA20_POLY1305_SHA256, + .id = TLS1_3_CK_CHACHA20_POLY1305_SHA256, + .algorithm_mkey = SSL_kTLS1_3, + .algorithm_auth = SSL_aTLS1_3, + .algorithm_enc = SSL_CHACHA20POLY1305, + .algorithm_mac = SSL_AEAD, + .algorithm_ssl = SSL_TLSV1_3, + .algo_strength = SSL_HIGH, + .algorithm2 = SSL_HANDSHAKE_MAC_SHA256, /* XXX */ + .strength_bits = 256, + .alg_bits = 256, + }, +#endif + /* Cipher C006 */ { .valid = 1, @@ -1239,7 +1245,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(4)| + FIXED_NONCE_LEN(4)| SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD, .strength_bits = 128, .alg_bits = 128, @@ -1257,7 +1263,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(4)| + FIXED_NONCE_LEN(4)| SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD, .strength_bits = 256, .alg_bits = 256, @@ -1275,7 +1281,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(4)| + FIXED_NONCE_LEN(4)| SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD, .strength_bits = 128, .alg_bits = 128, @@ -1293,7 +1299,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(4)| + FIXED_NONCE_LEN(4)| SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD, .strength_bits = 256, .alg_bits = 256, @@ -1311,7 +1317,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(12), + FIXED_NONCE_LEN(12), .strength_bits = 256, .alg_bits = 256, }, @@ -1328,7 +1334,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(12), + FIXED_NONCE_LEN(12), .strength_bits = 256, .alg_bits = 256, }, @@ -1345,7 +1351,7 @@ SSL_CIPHER ssl3_ciphers[] = { .algorithm_ssl = SSL_TLSV1_2, .algo_strength = SSL_HIGH, .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| - SSL_CIPHER_ALGORITHM2_AEAD|FIXED_NONCE_LEN(12), + FIXED_NONCE_LEN(12), .strength_bits = 256, .alg_bits = 256, }, @@ -1445,44 +1451,8 @@ ssl3_handshake_msg_hdr_len(SSL *s) SSL3_HM_HEADER_LENGTH); } -unsigned char * -ssl3_handshake_msg_start(SSL *s, uint8_t msg_type) -{ - unsigned char *d, *p; - - d = p = (unsigned char *)s->internal->init_buf->data; - - /* Handshake message type and length. */ - *(p++) = msg_type; - l2n3(0, p); - - return (d + ssl3_handshake_msg_hdr_len(s)); -} - -void -ssl3_handshake_msg_finish(SSL *s, unsigned int len) -{ - unsigned char *p; - uint8_t msg_type; - - p = (unsigned char *)s->internal->init_buf->data; - - /* Handshake message length. */ - msg_type = *(p++); - l2n3(len, p); - - s->internal->init_num = ssl3_handshake_msg_hdr_len(s) + (int)len; - s->internal->init_off = 0; - - if (SSL_IS_DTLS(s)) { - dtls1_set_message_header(s, msg_type, len, 0, len); - dtls1_buffer_message(s, 0); - } -} - int -ssl3_handshake_msg_start_cbb(SSL *s, CBB *handshake, CBB *body, - uint8_t msg_type) +ssl3_handshake_msg_start(SSL *s, CBB *handshake, CBB *body, uint8_t msg_type) { int ret = 0; @@ -1507,7 +1477,7 @@ ssl3_handshake_msg_start_cbb(SSL *s, CBB *handshake, CBB *body, } int -ssl3_handshake_msg_finish_cbb(SSL *s, CBB *handshake) +ssl3_handshake_msg_finish(SSL *s, CBB *handshake) { unsigned char *data = NULL; size_t outlen; @@ -1552,11 +1522,17 @@ ssl3_handshake_msg_finish_cbb(SSL *s, CBB *handshake) int ssl3_handshake_write(SSL *s) +{ + return ssl3_record_write(s, SSL3_RT_HANDSHAKE); +} + +int +ssl3_record_write(SSL *s, int type) { if (SSL_IS_DTLS(s)) - return dtls1_do_write(s, SSL3_RT_HANDSHAKE); + return dtls1_do_write(s, type); - return ssl3_do_write(s, SSL3_RT_HANDSHAKE); + return ssl3_do_write(s, type); } int @@ -1583,17 +1559,23 @@ ssl3_free(SSL *s) tls1_cleanup_key_block(s); ssl3_release_read_buffer(s); ssl3_release_write_buffer(s); + freezero(S3I(s)->hs.sigalgs, S3I(s)->hs.sigalgs_len); DH_free(S3I(s)->tmp.dh); EC_KEY_free(S3I(s)->tmp.ecdh); freezero(S3I(s)->tmp.x25519, X25519_KEY_LENGTH); - sk_X509_NAME_pop_free(S3I(s)->tmp.ca_names, X509_NAME_free); + tls13_secrets_destroy(S3I(s)->hs_tls13.secrets); + freezero(S3I(s)->hs_tls13.x25519_private, X25519_KEY_LENGTH); + freezero(S3I(s)->hs_tls13.x25519_public, X25519_KEY_LENGTH); + freezero(S3I(s)->hs_tls13.x25519_peer_public, X25519_KEY_LENGTH); + freezero(S3I(s)->hs_tls13.cookie, S3I(s)->hs_tls13.cookie_len); - BIO_free(S3I(s)->handshake_buffer); + sk_X509_NAME_pop_free(S3I(s)->tmp.ca_names, X509_NAME_free); - tls1_handshake_hash_free(s); + tls1_transcript_free(s); + tls1_transcript_hash_free(s); free(S3I(s)->alpn_selected); @@ -1617,19 +1599,34 @@ ssl3_clear(SSL *s) S3I(s)->tmp.dh = NULL; EC_KEY_free(S3I(s)->tmp.ecdh); S3I(s)->tmp.ecdh = NULL; + freezero(S3I(s)->hs.sigalgs, S3I(s)->hs.sigalgs_len); + S3I(s)->hs.sigalgs = NULL; + S3I(s)->hs.sigalgs_len = 0; freezero(S3I(s)->tmp.x25519, X25519_KEY_LENGTH); S3I(s)->tmp.x25519 = NULL; - rp = s->s3->rbuf.buf; - wp = s->s3->wbuf.buf; - rlen = s->s3->rbuf.len; - wlen = s->s3->wbuf.len; + tls13_secrets_destroy(S3I(s)->hs_tls13.secrets); + S3I(s)->hs_tls13.secrets = NULL; + freezero(S3I(s)->hs_tls13.x25519_private, X25519_KEY_LENGTH); + S3I(s)->hs_tls13.x25519_private = NULL; + freezero(S3I(s)->hs_tls13.x25519_public, X25519_KEY_LENGTH); + S3I(s)->hs_tls13.x25519_public = NULL; + freezero(S3I(s)->hs_tls13.x25519_peer_public, X25519_KEY_LENGTH); + S3I(s)->hs_tls13.x25519_peer_public = NULL; + freezero(S3I(s)->hs_tls13.cookie, S3I(s)->hs_tls13.cookie_len); + S3I(s)->hs_tls13.cookie = NULL; + S3I(s)->hs_tls13.cookie_len = 0; + + S3I(s)->hs.extensions_seen = 0; - BIO_free(S3I(s)->handshake_buffer); - S3I(s)->handshake_buffer = NULL; + rp = S3I(s)->rbuf.buf; + wp = S3I(s)->wbuf.buf; + rlen = S3I(s)->rbuf.len; + wlen = S3I(s)->wbuf.len; - tls1_handshake_hash_free(s); + tls1_transcript_free(s); + tls1_transcript_hash_free(s); free(S3I(s)->alpn_selected); S3I(s)->alpn_selected = NULL; @@ -1639,10 +1636,10 @@ ssl3_clear(SSL *s) memset(s->s3, 0, sizeof(*s->s3)); S3I(s) = internal; - s->s3->rbuf.buf = rp; - s->s3->wbuf.buf = wp; - s->s3->rbuf.len = rlen; - s->s3->wbuf.len = wlen; + S3I(s)->rbuf.buf = rp; + S3I(s)->wbuf.buf = wp; + S3I(s)->rbuf.len = rlen; + S3I(s)->wbuf.len = wlen; ssl_free_wbio_buffer(s); @@ -1752,11 +1749,6 @@ _SSL_set_tmp_dh(SSL *s, DH *dh) { DH *dh_tmp; - if (!ssl_cert_inst(&s->cert)) { - SSLerror(s, ERR_R_MALLOC_FAILURE); - return 0; - } - if (dh == NULL) { SSLerror(s, ERR_R_PASSED_NULL_PARAMETER); return 0; @@ -1786,11 +1778,6 @@ _SSL_set_tmp_ecdh(SSL *s, EC_KEY *ecdh) const EC_GROUP *group; int nid; - if (!ssl_cert_inst(&s->cert)) { - SSLerror(s, ERR_R_MALLOC_FAILURE); - return 0; - } - if (ecdh == NULL) return 0; if ((group = EC_KEY_get0_group(ecdh)) == NULL) @@ -1888,6 +1875,47 @@ _SSL_set_tlsext_status_ocsp_resp(SSL *s, unsigned char *resp, int resp_len) return 1; } +int +SSL_set0_chain(SSL *ssl, STACK_OF(X509) *chain) +{ + return ssl_cert_set0_chain(ssl->cert, chain); +} + +int +SSL_set1_chain(SSL *ssl, STACK_OF(X509) *chain) +{ + return ssl_cert_set1_chain(ssl->cert, chain); +} + +int +SSL_add0_chain_cert(SSL *ssl, X509 *x509) +{ + return ssl_cert_add0_chain_cert(ssl->cert, x509); +} + +int +SSL_add1_chain_cert(SSL *ssl, X509 *x509) +{ + return ssl_cert_add1_chain_cert(ssl->cert, x509); +} + +int +SSL_get0_chain_certs(const SSL *ssl, STACK_OF(X509) **out_chain) +{ + *out_chain = NULL; + + if (ssl->cert->key != NULL) + *out_chain = ssl->cert->key->chain; + + return 1; +} + +int +SSL_clear_chain_certs(SSL *ssl) +{ + return ssl_cert_set0_chain(ssl->cert, NULL); +} + int SSL_set1_groups(SSL *s, const int *groups, size_t groups_len) { @@ -1898,7 +1926,7 @@ SSL_set1_groups(SSL *s, const int *groups, size_t groups_len) int SSL_set1_groups_list(SSL *s, const char *groups) { - return tls1_set_groups_list(&s->internal->tlsext_supportedgroups, + return tls1_set_group_list(&s->internal->tlsext_supportedgroups, &s->internal->tlsext_supportedgroups_length, groups); } @@ -1969,6 +1997,21 @@ ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP: return _SSL_set_tlsext_status_ocsp_resp(s, parg, larg); + case SSL_CTRL_CHAIN: + if (larg == 0) + return SSL_set0_chain(s, (STACK_OF(X509) *)parg); + else + return SSL_set1_chain(s, (STACK_OF(X509) *)parg); + + case SSL_CTRL_CHAIN_CERT: + if (larg == 0) + return SSL_add0_chain_cert(s, (X509 *)parg); + else + return SSL_add1_chain_cert(s, (X509 *)parg); + + case SSL_CTRL_GET_CHAIN_CERTS: + return SSL_get0_chain_certs(s, (STACK_OF(X509) **)parg); + case SSL_CTRL_SET_GROUPS: return SSL_set1_groups(s, parg, larg); @@ -1978,6 +2021,12 @@ ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) case SSL_CTRL_GET_SERVER_TMP_KEY: return ssl_ctrl_get_server_tmp_key(s, parg); + case SSL_CTRL_GET_MIN_PROTO_VERSION: + return SSL_get_min_proto_version(s); + + case SSL_CTRL_GET_MAX_PROTO_VERSION: + return SSL_get_max_proto_version(s); + case SSL_CTRL_SET_MIN_PROTO_VERSION: if (larg < 0 || larg > UINT16_MAX) return 0; @@ -2012,13 +2061,6 @@ ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp)(void)) { - if (cmd == SSL_CTRL_SET_TMP_DH_CB || cmd == SSL_CTRL_SET_TMP_ECDH_CB) { - if (!ssl_cert_inst(&s->cert)) { - SSLerror(s, ERR_R_MALLOC_FAILURE); - return 0; - } - } - switch (cmd) { case SSL_CTRL_SET_TMP_RSA_CB: SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); @@ -2127,6 +2169,13 @@ _SSL_CTX_set_tlsext_ticket_keys(SSL_CTX *ctx, unsigned char *keys, int keys_len) return 1; } +static int +_SSL_CTX_get_tlsext_status_arg(SSL_CTX *ctx, void **arg) +{ + *arg = ctx->internal->tlsext_status_arg; + return 1; +} + static int _SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg) { @@ -2134,6 +2183,47 @@ _SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg) return 1; } +int +SSL_CTX_set0_chain(SSL_CTX *ctx, STACK_OF(X509) *chain) +{ + return ssl_cert_set0_chain(ctx->internal->cert, chain); +} + +int +SSL_CTX_set1_chain(SSL_CTX *ctx, STACK_OF(X509) *chain) +{ + return ssl_cert_set1_chain(ctx->internal->cert, chain); +} + +int +SSL_CTX_add0_chain_cert(SSL_CTX *ctx, X509 *x509) +{ + return ssl_cert_add0_chain_cert(ctx->internal->cert, x509); +} + +int +SSL_CTX_add1_chain_cert(SSL_CTX *ctx, X509 *x509) +{ + return ssl_cert_add1_chain_cert(ctx->internal->cert, x509); +} + +int +SSL_CTX_get0_chain_certs(const SSL_CTX *ctx, STACK_OF(X509) **out_chain) +{ + *out_chain = NULL; + + if (ctx->internal->cert->key != NULL) + *out_chain = ctx->internal->cert->key->chain; + + return 1; +} + +int +SSL_CTX_clear_chain_certs(SSL_CTX *ctx) +{ + return ssl_cert_set0_chain(ctx->internal->cert, NULL); +} + static int _SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *cert) { @@ -2147,14 +2237,14 @@ _SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *cert) return 1; } -int +static int _SSL_CTX_get_extra_chain_certs(SSL_CTX *ctx, STACK_OF(X509) **certs) { *certs = ctx->extra_certs; return 1; } -int +static int _SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx) { sk_X509_pop_free(ctx->extra_certs, X509_free); @@ -2172,7 +2262,7 @@ SSL_CTX_set1_groups(SSL_CTX *ctx, const int *groups, size_t groups_len) int SSL_CTX_set1_groups_list(SSL_CTX *ctx, const char *groups) { - return tls1_set_groups_list(&ctx->internal->tlsext_supportedgroups, + return tls1_set_group_list(&ctx->internal->tlsext_supportedgroups, &ctx->internal->tlsext_supportedgroups_length, groups); } @@ -2209,9 +2299,27 @@ ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) case SSL_CTRL_SET_TLSEXT_TICKET_KEYS: return _SSL_CTX_set_tlsext_ticket_keys(ctx, parg, larg); + case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG: + return _SSL_CTX_get_tlsext_status_arg(ctx, parg); + case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG: return _SSL_CTX_set_tlsext_status_arg(ctx, parg); + case SSL_CTRL_CHAIN: + if (larg == 0) + return SSL_CTX_set0_chain(ctx, (STACK_OF(X509) *)parg); + else + return SSL_CTX_set1_chain(ctx, (STACK_OF(X509) *)parg); + + case SSL_CTRL_CHAIN_CERT: + if (larg == 0) + return SSL_CTX_add0_chain_cert(ctx, (X509 *)parg); + else + return SSL_CTX_add1_chain_cert(ctx, (X509 *)parg); + + case SSL_CTRL_GET_CHAIN_CERTS: + return SSL_CTX_get0_chain_certs(ctx, (STACK_OF(X509) **)parg); + case SSL_CTRL_EXTRA_CHAIN_CERT: return _SSL_CTX_add_extra_chain_cert(ctx, parg); @@ -2227,6 +2335,12 @@ ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) case SSL_CTRL_SET_GROUPS_LIST: return SSL_CTX_set1_groups_list(ctx, parg); + case SSL_CTRL_GET_MIN_PROTO_VERSION: + return SSL_CTX_get_min_proto_version(ctx); + + case SSL_CTRL_GET_MAX_PROTO_VERSION: + return SSL_CTX_get_max_proto_version(ctx); + case SSL_CTRL_SET_MIN_PROTO_VERSION: if (larg < 0 || larg > UINT16_MAX) return 0; @@ -2273,6 +2387,10 @@ ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void)) (int (*)(SSL *, int *, void *))fp; return 1; + case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB: + *(int (**)(SSL *, void *))fp = ctx->internal->tlsext_status_cb; + return 1; + case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB: ctx->internal->tlsext_status_cb = (int (*)(SSL *, void *))fp; return 1; @@ -2292,12 +2410,12 @@ ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void)) const SSL_CIPHER * ssl3_get_cipher_by_char(const unsigned char *p) { - CBS cipher; uint16_t cipher_value; + CBS cbs; /* We have to assume it is at least 2 bytes due to existing API. */ - CBS_init(&cipher, p, 2); - if (!CBS_get_u16(&cipher, &cipher_value)) + CBS_init(&cbs, p, 2); + if (!CBS_get_u16(&cbs, &cipher_value)) return NULL; return ssl3_get_cipher_by_value(cipher_value); @@ -2306,12 +2424,29 @@ ssl3_get_cipher_by_char(const unsigned char *p) int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) { - if (p != NULL) { - if ((c->id & ~SSL3_CK_VALUE_MASK) != SSL3_CK_ID) - return (0); - s2n(ssl3_cipher_get_value(c), p); - } + CBB cbb; + + if (p == NULL) + return (2); + + if ((c->id & ~SSL3_CK_VALUE_MASK) != SSL3_CK_ID) + return (0); + + memset(&cbb, 0, sizeof(cbb)); + + /* We have to assume it is at least 2 bytes due to existing API. */ + if (!CBB_init_fixed(&cbb, p, 2)) + goto err; + if (!CBB_add_u16(&cbb, ssl3_cipher_get_value(c))) + goto err; + if (!CBB_finish(&cbb, NULL, NULL)) + goto err; + return (2); + + err: + CBB_cleanup(&cbb); + return (0); } SSL_CIPHER * @@ -2321,12 +2456,15 @@ ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, unsigned long alg_k, alg_a, mask_k, mask_a; STACK_OF(SSL_CIPHER) *prio, *allow; SSL_CIPHER *c, *ret = NULL; + int can_use_ecc; int i, ii, ok; CERT *cert; /* Let's see which ciphers we can support */ cert = s->cert; + can_use_ecc = (tls1_get_shared_curve(s) != NID_undef); + /* * Do not set the compare functions, because this may lead to a * reordering by "id". We want to keep the original ordering. @@ -2371,7 +2509,7 @@ ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, * an ephemeral EC key check it. */ if (alg_k & SSL_kECDHE) - ok = ok && tls1_check_ec_tmp_key(s); + ok = ok && can_use_ecc; if (!ok) continue; @@ -2441,11 +2579,11 @@ ssl3_shutdown(SSL *s) ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY); /* * Our shutdown alert has been sent now, and if it still needs - * to be written, s->s3->alert_dispatch will be true + * to be written, S3I(s)->alert_dispatch will be true */ - if (s->s3->alert_dispatch) + if (S3I(s)->alert_dispatch) return(-1); /* return WANT_WRITE */ - } else if (s->s3->alert_dispatch) { + } else if (S3I(s)->alert_dispatch) { /* resend it if not sent */ ret = s->method->ssl_dispatch_alert(s); if (ret == -1) { @@ -2466,7 +2604,7 @@ ssl3_shutdown(SSL *s) } if ((s->internal->shutdown == (SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN)) && - !s->s3->alert_dispatch) + !S3I(s)->alert_dispatch) return (1); else return (0); @@ -2475,56 +2613,13 @@ ssl3_shutdown(SSL *s) int ssl3_write(SSL *s, const void *buf, int len) { - int ret, n; - -#if 0 - if (s->internal->shutdown & SSL_SEND_SHUTDOWN) { - s->internal->rwstate = SSL_NOTHING; - return (0); - } -#endif errno = 0; + if (S3I(s)->renegotiate) ssl3_renegotiate_check(s); - /* - * This is an experimental flag that sends the - * last handshake message in the same packet as the first - * use data - used to see if it helps the TCP protocol during - * session-id reuse - */ - /* The second test is because the buffer may have been removed */ - if ((s->s3->flags & SSL3_FLAGS_POP_BUFFER) && (s->wbio == s->bbio)) { - /* First time through, we write into the buffer */ - if (S3I(s)->delay_buf_pop_ret == 0) { - ret = ssl3_write_bytes(s, SSL3_RT_APPLICATION_DATA, - buf, len); - if (ret <= 0) - return (ret); - - S3I(s)->delay_buf_pop_ret = ret; - } - - s->internal->rwstate = SSL_WRITING; - n = BIO_flush(s->wbio); - if (n <= 0) - return (n); - s->internal->rwstate = SSL_NOTHING; - - /* We have flushed the buffer, so remove it */ - ssl_free_wbio_buffer(s); - s->s3->flags&= ~SSL3_FLAGS_POP_BUFFER; - - ret = S3I(s)->delay_buf_pop_ret; - S3I(s)->delay_buf_pop_ret = 0; - } else { - ret = s->method->internal->ssl_write_bytes(s, - SSL3_RT_APPLICATION_DATA, buf, len); - if (ret <= 0) - return (ret); - } - - return (ret); + return s->method->internal->ssl_write_bytes(s, + SSL3_RT_APPLICATION_DATA, buf, len); } static int @@ -2587,7 +2682,7 @@ ssl3_renegotiate_check(SSL *s) int ret = 0; if (S3I(s)->renegotiate) { - if ((s->s3->rbuf.left == 0) && (s->s3->wbuf.left == 0) && + if ((S3I(s)->rbuf.left == 0) && (S3I(s)->wbuf.left == 0) && !SSL_in_init(s)) { /* * If we are the server, and we have sent diff --git a/ssl/ssl.sym b/ssl/ssl.sym index 94f9c53a..e094c2ae 100644 --- a/ssl/ssl.sym +++ b/ssl/ssl.sym @@ -4,6 +4,9 @@ BIO_new_ssl BIO_new_ssl_connect BIO_ssl_copy_session_id BIO_ssl_shutdown +DTLS_client_method +DTLS_method +DTLS_server_method DTLSv1_client_method DTLSv1_method DTLSv1_server_method @@ -30,29 +33,45 @@ d2i_SSL_SESSION i2d_SSL_SESSION ERR_load_SSL_strings SSL_CIPHER_description +SSL_CIPHER_get_auth_nid SSL_CIPHER_get_bits SSL_CIPHER_get_by_id SSL_CIPHER_get_by_value +SSL_CIPHER_get_cipher_nid +SSL_CIPHER_get_digest_nid SSL_CIPHER_get_id +SSL_CIPHER_get_kx_nid SSL_CIPHER_get_name SSL_CIPHER_get_value SSL_CIPHER_get_version +SSL_CIPHER_is_aead SSL_COMP_add_compression_method SSL_COMP_get_compression_methods SSL_COMP_get_name +SSL_CTX_add0_chain_cert +SSL_CTX_add1_chain_cert SSL_CTX_add_client_CA SSL_CTX_add_session SSL_CTX_callback_ctrl SSL_CTX_check_private_key +SSL_CTX_clear_chain_certs SSL_CTX_ctrl SSL_CTX_flush_sessions SSL_CTX_free +SSL_CTX_get0_certificate +SSL_CTX_get0_chain_certs +SSL_CTX_get0_param SSL_CTX_get_cert_store +SSL_CTX_get_ciphers SSL_CTX_get_client_CA_list SSL_CTX_get_client_cert_cb +SSL_CTX_get_default_passwd_cb +SSL_CTX_get_default_passwd_cb_userdata SSL_CTX_get_ex_data SSL_CTX_get_ex_new_index SSL_CTX_get_info_callback +SSL_CTX_get_max_proto_version +SSL_CTX_get_min_proto_version SSL_CTX_get_quiet_shutdown SSL_CTX_get_timeout SSL_CTX_get_verify_callback @@ -69,6 +88,8 @@ SSL_CTX_sess_set_get_cb SSL_CTX_sess_set_new_cb SSL_CTX_sess_set_remove_cb SSL_CTX_sessions +SSL_CTX_set0_chain +SSL_CTX_set1_chain SSL_CTX_set1_groups SSL_CTX_set1_groups_list SSL_CTX_set1_param @@ -88,8 +109,8 @@ SSL_CTX_set_default_verify_paths SSL_CTX_set_ex_data SSL_CTX_set_generate_session_id SSL_CTX_set_info_callback -SSL_CTX_set_min_proto_version SSL_CTX_set_max_proto_version +SSL_CTX_set_min_proto_version SSL_CTX_set_msg_callback SSL_CTX_set_next_proto_select_cb SSL_CTX_set_next_protos_advertised_cb @@ -105,6 +126,7 @@ SSL_CTX_set_tmp_rsa_callback SSL_CTX_set_trust SSL_CTX_set_verify SSL_CTX_set_verify_depth +SSL_CTX_up_ref SSL_CTX_use_PrivateKey SSL_CTX_use_PrivateKey_ASN1 SSL_CTX_use_PrivateKey_file @@ -117,21 +139,30 @@ SSL_CTX_use_certificate_chain_file SSL_CTX_use_certificate_chain_mem SSL_CTX_use_certificate_file SSL_SESSION_free +SSL_SESSION_get0_id_context SSL_SESSION_get0_peer SSL_SESSION_get_compress_id SSL_SESSION_get_ex_data SSL_SESSION_get_ex_new_index SSL_SESSION_get_id +SSL_SESSION_get_master_key +SSL_SESSION_get_protocol_version +SSL_SESSION_get_ticket_lifetime_hint SSL_SESSION_get_time SSL_SESSION_get_timeout +SSL_SESSION_has_ticket SSL_SESSION_new SSL_SESSION_print SSL_SESSION_print_fp +SSL_SESSION_set1_id SSL_SESSION_set1_id_context SSL_SESSION_set_ex_data SSL_SESSION_set_time SSL_SESSION_set_timeout +SSL_SESSION_up_ref SSL_accept +SSL_add0_chain_cert +SSL_add1_chain_cert SSL_add_client_CA SSL_add_dir_cert_subjects_to_stack SSL_add_file_cert_subjects_to_stack @@ -143,6 +174,7 @@ SSL_cache_hit SSL_callback_ctrl SSL_check_private_key SSL_clear +SSL_clear_chain_certs SSL_connect SSL_copy_session_id SSL_ctrl @@ -152,13 +184,18 @@ SSL_dup_CA_list SSL_export_keying_material SSL_free SSL_get0_alpn_selected +SSL_get0_chain_certs SSL_get0_next_proto_negotiated +SSL_get0_param SSL_get1_session +SSL_get1_supported_ciphers SSL_get_SSL_CTX SSL_get_certificate SSL_get_cipher_list SSL_get_ciphers SSL_get_client_CA_list +SSL_get_client_ciphers +SSL_get_client_random SSL_get_current_cipher SSL_get_current_compression SSL_get_current_expansion @@ -170,6 +207,8 @@ SSL_get_ex_new_index SSL_get_fd SSL_get_finished SSL_get_info_callback +SSL_get_max_proto_version +SSL_get_min_proto_version SSL_get_peer_cert_chain SSL_get_peer_certificate SSL_get_peer_finished @@ -179,6 +218,7 @@ SSL_get_rbio SSL_get_read_ahead SSL_get_rfd SSL_get_selected_srtp_profile +SSL_get_server_random SSL_get_servername SSL_get_servername_type SSL_get_session @@ -194,6 +234,7 @@ SSL_get_version SSL_get_wbio SSL_get_wfd SSL_has_matching_session_id +SSL_is_server SSL_library_init SSL_load_client_CA_file SSL_load_error_strings @@ -207,8 +248,11 @@ SSL_renegotiate_pending SSL_rstate_string SSL_rstate_string_long SSL_select_next_proto +SSL_set0_chain +SSL_set1_chain SSL_set1_groups SSL_set1_groups_list +SSL_set1_host SSL_set1_param SSL_set_SSL_CTX SSL_set_accept_state @@ -222,8 +266,8 @@ SSL_set_ex_data SSL_set_fd SSL_set_generate_session_id SSL_set_info_callback -SSL_set_min_proto_version SSL_set_max_proto_version +SSL_set_min_proto_version SSL_set_msg_callback SSL_set_purpose SSL_set_quiet_shutdown @@ -250,6 +294,7 @@ SSL_shutdown SSL_state SSL_state_string SSL_state_string_long +SSL_up_ref SSL_use_PrivateKey SSL_use_PrivateKey_ASN1 SSL_use_PrivateKey_file @@ -263,3 +308,4 @@ SSL_version SSL_version_str SSL_want SSL_write +OPENSSL_init_ssl diff --git a/ssl/ssl_algs.c b/ssl/ssl_algs.c index b63f36b3..bb736c5d 100644 --- a/ssl/ssl_algs.c +++ b/ssl/ssl_algs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_algs.c,v 1.27 2017/08/12 02:55:22 jsing Exp $ */ +/* $OpenBSD: ssl_algs.c,v 1.28 2019/04/04 16:44:24 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -119,8 +119,7 @@ SSL_library_init(void) EVP_add_digest(EVP_streebog256()); EVP_add_digest(EVP_streebog512()); #endif - /* initialize cipher/digest methods table */ - ssl_load_ciphers(); + return (1); } diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c index 95d36930..94fc8685 100644 --- a/ssl/ssl_asn1.c +++ b/ssl/ssl_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_asn1.c,v 1.55 2017/05/06 16:18:36 jsing Exp $ */ +/* $OpenBSD: ssl_asn1.c,v 1.57 2018/08/27 16:42:48 jsing Exp $ */ /* * Copyright (c) 2016 Joel Sing * @@ -44,23 +44,16 @@ time_max(void) return 0; } -int -i2d_SSL_SESSION(SSL_SESSION *s, unsigned char **pp) +static int +SSL_SESSION_encode(SSL_SESSION *s, unsigned char **out, size_t *out_len, + int ticket_encoding) { CBB cbb, session, cipher_suite, session_id, master_key, time, timeout; - CBB peer_cert, sidctx, verify_result, hostname, lifetime, ticket; - CBB value; - unsigned char *data = NULL, *peer_cert_bytes = NULL; - size_t data_len = 0; - int len, rv = -1; + CBB peer_cert, sidctx, verify_result, hostname, lifetime, ticket, value; + unsigned char *peer_cert_bytes = NULL; + int len, rv = 0; uint16_t cid; - if (s == NULL) - return (0); - - if (s->cipher == NULL && s->cipher_id == 0) - return (0); - if (!CBB_init(&cbb, 0)) goto err; @@ -87,10 +80,11 @@ i2d_SSL_SESSION(SSL_SESSION *s, unsigned char **pp) if (!CBB_add_u16(&cipher_suite, cid)) goto err; - /* Session ID. */ + /* Session ID - zero length for a ticket. */ if (!CBB_add_asn1(&session, &session_id, CBS_ASN1_OCTETSTRING)) goto err; - if (!CBB_add_bytes(&session_id, s->session_id, s->session_id_length)) + if (!CBB_add_bytes(&session_id, s->session_id, + ticket_encoding ? 0 : s->session_id_length)) goto err; /* Master key. */ @@ -173,7 +167,7 @@ i2d_SSL_SESSION(SSL_SESSION *s, unsigned char **pp) } /* Ticket [10]. */ - if (s->tlsext_tick) { + if (s->tlsext_tick != NULL) { if (!CBB_add_asn1(&session, &ticket, SSLASN1_TICKET_TAG)) goto err; if (!CBB_add_asn1(&ticket, &value, CBS_ASN1_OCTETSTRING)) @@ -185,7 +179,44 @@ i2d_SSL_SESSION(SSL_SESSION *s, unsigned char **pp) /* Compression method [11]. */ /* SRP username [12]. */ - if (!CBB_finish(&cbb, &data, &data_len)) + if (!CBB_finish(&cbb, out, out_len)) + goto err; + + rv = 1; + + err: + CBB_cleanup(&cbb); + free(peer_cert_bytes); + + return rv; +} + +int +SSL_SESSION_ticket(SSL_SESSION *ss, unsigned char **out, size_t *out_len) +{ + if (ss == NULL) + return 0; + + if (ss->cipher == NULL && ss->cipher_id == 0) + return 0; + + return SSL_SESSION_encode(ss, out, out_len, 1); +} + +int +i2d_SSL_SESSION(SSL_SESSION *ss, unsigned char **pp) +{ + unsigned char *data = NULL; + size_t data_len = 0; + int rv = -1; + + if (ss == NULL) + return 0; + + if (ss->cipher == NULL && ss->cipher_id == 0) + return 0; + + if (!SSL_SESSION_encode(ss, &data, &data_len, 0)) goto err; if (data_len > INT_MAX) @@ -204,9 +235,7 @@ i2d_SSL_SESSION(SSL_SESSION *s, unsigned char **pp) rv = (int)data_len; err: - CBB_cleanup(&session); freezero(data, data_len); - free(peer_cert_bytes); return rv; } diff --git a/ssl/ssl_both.c b/ssl/ssl_both.c index 17f93f55..6bd5f081 100644 --- a/ssl/ssl_both.c +++ b/ssl/ssl_both.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_both.c,v 1.10 2017/08/12 02:55:22 jsing Exp $ */ +/* $OpenBSD: ssl_both.c,v 1.15 2019/03/25 16:35:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -146,7 +146,7 @@ ssl3_do_write(SSL *s, int type) * Should not be done for 'Hello Request's, but in that case * we'll ignore the result anyway. */ - tls1_finish_mac(s, + tls1_transcript_record(s, (unsigned char *)&s->internal->init_buf->data[s->internal->init_off], ret); if (ret == s->internal->init_num) { @@ -191,12 +191,12 @@ ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) S3I(s)->previous_server_finished_len = md_len; } - if (!ssl3_handshake_msg_start_cbb(s, &cbb, &finished, + if (!ssl3_handshake_msg_start(s, &cbb, &finished, SSL3_MT_FINISHED)) goto err; if (!CBB_add_bytes(&finished, S3I(s)->tmp.finish_md, md_len)) goto err; - if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) + if (!ssl3_handshake_msg_finish(s, &cbb)) goto err; S3I(s)->hs.state = b; @@ -311,19 +311,44 @@ ssl3_get_finished(SSL *s, int a, int b) int ssl3_send_change_cipher_spec(SSL *s, int a, int b) { - unsigned char *p; + size_t outlen; + CBB cbb; + + memset(&cbb, 0, sizeof(cbb)); if (S3I(s)->hs.state == a) { - p = (unsigned char *)s->internal->init_buf->data; - *p = SSL3_MT_CCS; - s->internal->init_num = 1; + if (!CBB_init_fixed(&cbb, s->internal->init_buf->data, + s->internal->init_buf->length)) + goto err; + if (!CBB_add_u8(&cbb, SSL3_MT_CCS)) + goto err; + if (!CBB_finish(&cbb, NULL, &outlen)) + goto err; + + if (outlen > INT_MAX) + goto err; + + s->internal->init_num = (int)outlen; s->internal->init_off = 0; + if (SSL_IS_DTLS(s)) { + D1I(s)->handshake_write_seq = + D1I(s)->next_handshake_write_seq; + dtls1_set_message_header_int(s, SSL3_MT_CCS, 0, + D1I(s)->handshake_write_seq, 0, 0); + dtls1_buffer_message(s, 1); + } + S3I(s)->hs.state = b; } /* SSL3_ST_CW_CHANGE_B */ - return (ssl3_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC)); + return ssl3_record_write(s, SSL3_RT_CHANGE_CIPHER_SPEC); + + err: + CBB_cleanup(&cbb); + + return -1; } static int @@ -353,60 +378,56 @@ ssl3_add_cert(CBB *cbb, X509 *x) } int -ssl3_output_cert_chain(SSL *s, CBB *cbb, X509 *x) +ssl3_output_cert_chain(SSL *s, CBB *cbb, CERT_PKEY *cpk) { - int no_chain = 0; + X509_STORE_CTX *xs_ctx = NULL; + STACK_OF(X509) *chain; CBB cert_list; + X509 *x; int ret = 0; int i; if (!CBB_add_u24_length_prefixed(cbb, &cert_list)) goto err; - if ((s->internal->mode & SSL_MODE_NO_AUTO_CHAIN) || s->ctx->extra_certs) - no_chain = 1; + /* Send an empty certificate list when no certificate is available. */ + if (cpk == NULL) + goto done; - /* TLSv1 sends a chain with nothing in it, instead of an alert. */ - if (x != NULL) { - if (no_chain) { - if (!ssl3_add_cert(&cert_list, x)) - goto err; - } else { - X509_STORE_CTX xs_ctx; + if ((chain = cpk->chain) == NULL) + chain = s->ctx->extra_certs; - if (!X509_STORE_CTX_init(&xs_ctx, s->ctx->cert_store, - x, NULL)) { - SSLerror(s, ERR_R_X509_LIB); - goto err; - } - X509_verify_cert(&xs_ctx); - - /* Don't leave errors in the queue. */ - ERR_clear_error(); - for (i = 0; i < sk_X509_num(xs_ctx.chain); i++) { - x = sk_X509_value(xs_ctx.chain, i); - if (!ssl3_add_cert(&cert_list, x)) { - X509_STORE_CTX_cleanup(&xs_ctx); - goto err; - } - } - X509_STORE_CTX_cleanup(&xs_ctx); + if (chain != NULL || (s->internal->mode & SSL_MODE_NO_AUTO_CHAIN)) { + if (!ssl3_add_cert(&cert_list, cpk->x509)) + goto err; + } else { + if ((xs_ctx = X509_STORE_CTX_new()) == NULL) + goto err; + if (!X509_STORE_CTX_init(xs_ctx, s->ctx->cert_store, + cpk->x509, NULL)) { + SSLerror(s, ERR_R_X509_LIB); + goto err; } + X509_verify_cert(xs_ctx); + ERR_clear_error(); + chain = xs_ctx->chain; } - /* Thawte special :-) */ - for (i = 0; i < sk_X509_num(s->ctx->extra_certs); i++) { - x = sk_X509_value(s->ctx->extra_certs, i); + for (i = 0; i < sk_X509_num(chain); i++) { + x = sk_X509_value(chain, i); if (!ssl3_add_cert(&cert_list, x)) goto err; } + done: if (!CBB_flush(cbb)) goto err; ret = 1; err: + X509_STORE_CTX_free(xs_ctx); + return (ret); } @@ -532,7 +553,7 @@ ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) /* Feed this message into MAC computation. */ if (s->internal->mac_packet) { - tls1_finish_mac(s, (unsigned char *)s->internal->init_buf->data, + tls1_transcript_record(s, (unsigned char *)s->internal->init_buf->data, s->internal->init_num + 4); if (s->internal->msg_callback) @@ -675,16 +696,16 @@ ssl3_setup_read_buffer(SSL *s) align = (-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1); - if (s->s3->rbuf.buf == NULL) { + if (S3I(s)->rbuf.buf == NULL) { len = SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_ENCRYPTED_OVERHEAD + headerlen + align; if ((p = malloc(len)) == NULL) goto err; - s->s3->rbuf.buf = p; - s->s3->rbuf.len = len; + S3I(s)->rbuf.buf = p; + S3I(s)->rbuf.len = len; } - s->internal->packet = &(s->s3->rbuf.buf[0]); + s->internal->packet = &(S3I(s)->rbuf.buf[0]); return 1; err: @@ -705,7 +726,7 @@ ssl3_setup_write_buffer(SSL *s) align = (-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1); - if (s->s3->wbuf.buf == NULL) { + if (S3I(s)->wbuf.buf == NULL) { len = s->max_send_fragment + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD + headerlen + align; if (!(s->internal->options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS)) @@ -714,8 +735,8 @@ ssl3_setup_write_buffer(SSL *s) if ((p = malloc(len)) == NULL) goto err; - s->s3->wbuf.buf = p; - s->s3->wbuf.len = len; + S3I(s)->wbuf.buf = p; + S3I(s)->wbuf.len = len; } return 1; @@ -738,15 +759,15 @@ ssl3_setup_buffers(SSL *s) int ssl3_release_write_buffer(SSL *s) { - free(s->s3->wbuf.buf); - s->s3->wbuf.buf = NULL; + free(S3I(s)->wbuf.buf); + S3I(s)->wbuf.buf = NULL; return 1; } int ssl3_release_read_buffer(SSL *s) { - free(s->s3->rbuf.buf); - s->s3->rbuf.buf = NULL; + free(S3I(s)->rbuf.buf); + S3I(s)->rbuf.buf = NULL; return 1; } diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index a244353b..6c00b0d3 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_cert.c,v 1.66 2017/08/12 02:55:22 jsing Exp $ */ +/* $OpenBSD: ssl_cert.c,v 1.74 2019/03/25 17:33:26 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -158,18 +158,6 @@ SSL_get_ex_data_X509_STORE_CTX_idx(void) return ssl_x509_store_ctx_idx; } -static void -ssl_cert_set_default_md(CERT *cert) -{ - /* Set digest values to defaults */ - cert->pkeys[SSL_PKEY_RSA_SIGN].digest = EVP_sha1(); - cert->pkeys[SSL_PKEY_RSA_ENC].digest = EVP_sha1(); - cert->pkeys[SSL_PKEY_ECC].digest = EVP_sha1(); -#ifndef OPENSSL_NO_GOST - cert->pkeys[SSL_PKEY_GOST01].digest = EVP_gostr341194(); -#endif -} - CERT * ssl_cert_new(void) { @@ -182,7 +170,6 @@ ssl_cert_new(void) } ret->key = &(ret->pkeys[SSL_PKEY_RSA_ENC]); ret->references = 1; - ssl_cert_set_default_md(ret); return (ret); } @@ -234,14 +221,6 @@ ssl_cert_dup(CERT *cert) ret->dh_tmp_cb = cert->dh_tmp_cb; ret->dh_tmp_auto = cert->dh_tmp_auto; - if (cert->ecdh_tmp) { - ret->ecdh_tmp = EC_KEY_dup(cert->ecdh_tmp); - if (ret->ecdh_tmp == NULL) { - SSLerrorx(ERR_R_EC_LIB); - goto err; - } - } - for (i = 0; i < SSL_PKEY_NUM; i++) { if (cert->pkeys[i].x509 != NULL) { ret->pkeys[i].x509 = cert->pkeys[i].x509; @@ -279,6 +258,12 @@ ssl_cert_dup(CERT *cert) SSLerrorx(SSL_R_LIBRARY_BUG); } } + + if (cert->pkeys[i].chain != NULL) { + if ((ret->pkeys[i].chain = + X509_chain_up_ref(cert->pkeys[i].chain)) == NULL) + goto err; + } } /* @@ -287,21 +272,16 @@ ssl_cert_dup(CERT *cert) */ ret->references = 1; - /* - * Set digests to defaults. NB: we don't copy existing values - * as they will be set during handshake. - */ - ssl_cert_set_default_md(ret); return (ret); -err: + err: DH_free(ret->dh_tmp); - EC_KEY_free(ret->ecdh_tmp); for (i = 0; i < SSL_PKEY_NUM; i++) { X509_free(ret->pkeys[i].x509); EVP_PKEY_free(ret->pkeys[i].privatekey); + sk_X509_pop_free(ret->pkeys[i].chain, X509_free); } free (ret); return NULL; @@ -321,43 +301,71 @@ ssl_cert_free(CERT *c) return; DH_free(c->dh_tmp); - EC_KEY_free(c->ecdh_tmp); for (i = 0; i < SSL_PKEY_NUM; i++) { X509_free(c->pkeys[i].x509); EVP_PKEY_free(c->pkeys[i].privatekey); + sk_X509_pop_free(c->pkeys[i].chain, X509_free); } free(c); } int -ssl_cert_inst(CERT **o) +ssl_cert_set0_chain(CERT *c, STACK_OF(X509) *chain) { - /* - * Create a CERT if there isn't already one - * (which cannot really happen, as it is initially created in - * SSL_CTX_new; but the earlier code usually allows for that one - * being non-existant, so we follow that behaviour, as it might - * turn out that there actually is a reason for it -- but I'm - * not sure that *all* of the existing code could cope with - * s->cert being NULL, otherwise we could do without the - * initialization in SSL_CTX_new). - */ + if (c->key == NULL) + return 0; - if (o == NULL) { - SSLerrorx(ERR_R_PASSED_NULL_PARAMETER); - return (0); + sk_X509_pop_free(c->key->chain, X509_free); + c->key->chain = chain; + + return 1; +} + +int +ssl_cert_set1_chain(CERT *c, STACK_OF(X509) *chain) +{ + STACK_OF(X509) *new_chain = NULL; + + if (chain != NULL) { + if ((new_chain = X509_chain_up_ref(chain)) == NULL) + return 0; } - if (*o == NULL) { - if ((*o = ssl_cert_new()) == NULL) { - SSLerrorx(ERR_R_MALLOC_FAILURE); - return (0); - } + if (!ssl_cert_set0_chain(c, new_chain)) { + sk_X509_pop_free(new_chain, X509_free); + return 0; } - return (1); + + return 1; } +int +ssl_cert_add0_chain_cert(CERT *c, X509 *cert) +{ + if (c->key == NULL) + return 0; + + if (c->key->chain == NULL) { + if ((c->key->chain = sk_X509_new_null()) == NULL) + return 0; + } + if (!sk_X509_push(c->key->chain, cert)) + return 0; + + return 1; +} + +int +ssl_cert_add1_chain_cert(CERT *c, X509 *cert) +{ + if (!ssl_cert_add0_chain_cert(c, cert)) + return 0; + + X509_up_ref(cert); + + return 1; +} SESS_CERT * ssl_sess_cert_new(void) @@ -454,7 +462,7 @@ set_client_CA_list(STACK_OF(X509_NAME) **ca_list, } STACK_OF(X509_NAME) * -SSL_dup_CA_list(STACK_OF(X509_NAME) *sk) +SSL_dup_CA_list(const STACK_OF(X509_NAME) *sk) { int i; STACK_OF(X509_NAME) *ret; diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index f30ffeaf..ed167eff 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_ciph.c,v 1.97 2017/08/28 16:37:04 jsing Exp $ */ +/* $OpenBSD: ssl_ciph.c,v 1.108 2019/04/04 16:44:24 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -150,49 +150,6 @@ #include "ssl_locl.h" -#define SSL_ENC_DES_IDX 0 -#define SSL_ENC_3DES_IDX 1 -#define SSL_ENC_RC4_IDX 2 -#define SSL_ENC_IDEA_IDX 3 -#define SSL_ENC_NULL_IDX 4 -#define SSL_ENC_AES128_IDX 5 -#define SSL_ENC_AES256_IDX 6 -#define SSL_ENC_CAMELLIA128_IDX 7 -#define SSL_ENC_CAMELLIA256_IDX 8 -#define SSL_ENC_GOST89_IDX 9 -#define SSL_ENC_AES128GCM_IDX 10 -#define SSL_ENC_AES256GCM_IDX 11 -#define SSL_ENC_NUM_IDX 12 - - -static const EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX] = { - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL -}; - -#define SSL_MD_MD5_IDX 0 -#define SSL_MD_SHA1_IDX 1 -#define SSL_MD_GOST94_IDX 2 -#define SSL_MD_GOST89MAC_IDX 3 -#define SSL_MD_SHA256_IDX 4 -#define SSL_MD_SHA384_IDX 5 -#define SSL_MD_STREEBOG256_IDX 6 -/*Constant SSL_MAX_DIGEST equal to size of digests array should be - * defined in the - * ssl_locl.h */ -#define SSL_MD_NUM_IDX SSL_MAX_DIGEST -static const EVP_MD *ssl_digest_methods[SSL_MD_NUM_IDX] = { - NULL, NULL, NULL, NULL, NULL, NULL, NULL, -}; - -static int ssl_mac_pkey_id[SSL_MD_NUM_IDX] = { - EVP_PKEY_HMAC, EVP_PKEY_HMAC, EVP_PKEY_HMAC, EVP_PKEY_GOSTIMIT, - EVP_PKEY_HMAC, EVP_PKEY_HMAC, EVP_PKEY_HMAC, -}; - -static int ssl_mac_secret_size[SSL_MD_NUM_IDX] = { - 0, 0, 0, 0, 0, 0, 0, -}; - #define CIPHER_ADD 1 #define CIPHER_KILL 2 #define CIPHER_DEL 3 @@ -338,10 +295,6 @@ static const SSL_CIPHER cipher_aliases[] = { }, /* symmetric encryption aliases */ - { - .name = SSL_TXT_DES, - .algorithm_enc = SSL_DES, - }, { .name = SSL_TXT_3DES, .algorithm_enc = SSL_3DES, @@ -350,10 +303,6 @@ static const SSL_CIPHER cipher_aliases[] = { .name = SSL_TXT_RC4, .algorithm_enc = SSL_RC4, }, - { - .name = SSL_TXT_IDEA, - .algorithm_enc = SSL_IDEA, - }, { .name = SSL_TXT_eNULL, .algorithm_enc = SSL_eNULL, @@ -442,6 +391,10 @@ static const SSL_CIPHER cipher_aliases[] = { .name = SSL_TXT_TLSV1_2, .algorithm_ssl = SSL_TLSV1_2, }, + { + .name = SSL_TXT_TLSV1_3, + .algorithm_ssl = SSL_TLSV1_3, + }, /* strength classes */ { @@ -458,208 +411,97 @@ static const SSL_CIPHER cipher_aliases[] = { }, }; -void -ssl_load_ciphers(void) -{ - ssl_cipher_methods[SSL_ENC_DES_IDX] = - EVP_get_cipherbyname(SN_des_cbc); - ssl_cipher_methods[SSL_ENC_3DES_IDX] = - EVP_get_cipherbyname(SN_des_ede3_cbc); - ssl_cipher_methods[SSL_ENC_RC4_IDX] = - EVP_get_cipherbyname(SN_rc4); - ssl_cipher_methods[SSL_ENC_IDEA_IDX] = NULL; - ssl_cipher_methods[SSL_ENC_AES128_IDX] = - EVP_get_cipherbyname(SN_aes_128_cbc); - ssl_cipher_methods[SSL_ENC_AES256_IDX] = - EVP_get_cipherbyname(SN_aes_256_cbc); - ssl_cipher_methods[SSL_ENC_CAMELLIA128_IDX] = - EVP_get_cipherbyname(SN_camellia_128_cbc); - ssl_cipher_methods[SSL_ENC_CAMELLIA256_IDX] = - EVP_get_cipherbyname(SN_camellia_256_cbc); - ssl_cipher_methods[SSL_ENC_GOST89_IDX] = - EVP_get_cipherbyname(SN_gost89_cnt); - - ssl_cipher_methods[SSL_ENC_AES128GCM_IDX] = - EVP_get_cipherbyname(SN_aes_128_gcm); - ssl_cipher_methods[SSL_ENC_AES256GCM_IDX] = - EVP_get_cipherbyname(SN_aes_256_gcm); - - ssl_digest_methods[SSL_MD_MD5_IDX] = - EVP_get_digestbyname(SN_md5); - ssl_mac_secret_size[SSL_MD_MD5_IDX] = - EVP_MD_size(ssl_digest_methods[SSL_MD_MD5_IDX]); - OPENSSL_assert(ssl_mac_secret_size[SSL_MD_MD5_IDX] >= 0); - ssl_digest_methods[SSL_MD_SHA1_IDX] = - EVP_get_digestbyname(SN_sha1); - ssl_mac_secret_size[SSL_MD_SHA1_IDX] = - EVP_MD_size(ssl_digest_methods[SSL_MD_SHA1_IDX]); - OPENSSL_assert(ssl_mac_secret_size[SSL_MD_SHA1_IDX] >= 0); - ssl_digest_methods[SSL_MD_GOST94_IDX] = - EVP_get_digestbyname(SN_id_GostR3411_94); - if (ssl_digest_methods[SSL_MD_GOST94_IDX]) { - ssl_mac_secret_size[SSL_MD_GOST94_IDX] = - EVP_MD_size(ssl_digest_methods[SSL_MD_GOST94_IDX]); - OPENSSL_assert(ssl_mac_secret_size[SSL_MD_GOST94_IDX] >= 0); - } - ssl_digest_methods[SSL_MD_GOST89MAC_IDX] = - EVP_get_digestbyname(SN_id_Gost28147_89_MAC); - if (ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX]) { - ssl_mac_secret_size[SSL_MD_GOST89MAC_IDX] = 32; - } - - ssl_digest_methods[SSL_MD_SHA256_IDX] = - EVP_get_digestbyname(SN_sha256); - ssl_mac_secret_size[SSL_MD_SHA256_IDX] = - EVP_MD_size(ssl_digest_methods[SSL_MD_SHA256_IDX]); - ssl_digest_methods[SSL_MD_SHA384_IDX] = - EVP_get_digestbyname(SN_sha384); - ssl_mac_secret_size[SSL_MD_SHA384_IDX] = - EVP_MD_size(ssl_digest_methods[SSL_MD_SHA384_IDX]); - ssl_digest_methods[SSL_MD_STREEBOG256_IDX] = - EVP_get_digestbyname(SN_id_tc26_gost3411_2012_256); - ssl_mac_secret_size[SSL_MD_STREEBOG256_IDX] = - EVP_MD_size(ssl_digest_methods[SSL_MD_STREEBOG256_IDX]); -} - int -ssl_cipher_get_evp(const SSL_SESSION *s, const EVP_CIPHER **enc, +ssl_cipher_get_evp(const SSL_SESSION *ss, const EVP_CIPHER **enc, const EVP_MD **md, int *mac_pkey_type, int *mac_secret_size) { - const SSL_CIPHER *c; - int i; + *enc = NULL; + *md = NULL; + *mac_pkey_type = NID_undef; + *mac_secret_size = 0; - c = s->cipher; - if (c == NULL) - return (0); + if (ss->cipher == NULL) + return 0; /* * This function does not handle EVP_AEAD. * See ssl_cipher_get_aead_evp instead. */ - if (c->algorithm2 & SSL_CIPHER_ALGORITHM2_AEAD) - return(0); - - if ((enc == NULL) || (md == NULL)) - return (0); + if (ss->cipher->algorithm_mac & SSL_AEAD) + return 0; - switch (c->algorithm_enc) { - case SSL_DES: - i = SSL_ENC_DES_IDX; - break; + switch (ss->cipher->algorithm_enc) { case SSL_3DES: - i = SSL_ENC_3DES_IDX; + *enc = EVP_des_ede3_cbc(); break; case SSL_RC4: - i = SSL_ENC_RC4_IDX; - break; - case SSL_IDEA: - i = SSL_ENC_IDEA_IDX; + *enc = EVP_rc4(); break; case SSL_eNULL: - i = SSL_ENC_NULL_IDX; + *enc = EVP_enc_null(); break; case SSL_AES128: - i = SSL_ENC_AES128_IDX; + *enc = EVP_aes_128_cbc(); break; case SSL_AES256: - i = SSL_ENC_AES256_IDX; + *enc = EVP_aes_256_cbc(); break; case SSL_CAMELLIA128: - i = SSL_ENC_CAMELLIA128_IDX; + *enc = EVP_camellia_128_cbc(); break; case SSL_CAMELLIA256: - i = SSL_ENC_CAMELLIA256_IDX; + *enc = EVP_camellia_256_cbc(); break; case SSL_eGOST2814789CNT: - i = SSL_ENC_GOST89_IDX; - break; - case SSL_AES128GCM: - i = SSL_ENC_AES128GCM_IDX; - break; - case SSL_AES256GCM: - i = SSL_ENC_AES256GCM_IDX; - break; - default: - i = -1; + *enc = EVP_gost2814789_cnt(); break; } - if ((i < 0) || (i >= SSL_ENC_NUM_IDX)) - *enc = NULL; - else { - if (i == SSL_ENC_NULL_IDX) - *enc = EVP_enc_null(); - else - *enc = ssl_cipher_methods[i]; - } - - switch (c->algorithm_mac) { + switch (ss->cipher->algorithm_mac) { case SSL_MD5: - i = SSL_MD_MD5_IDX; + *md = EVP_md5(); break; case SSL_SHA1: - i = SSL_MD_SHA1_IDX; + *md = EVP_sha1(); break; case SSL_SHA256: - i = SSL_MD_SHA256_IDX; + *md = EVP_sha256(); break; case SSL_SHA384: - i = SSL_MD_SHA384_IDX; - break; - case SSL_GOST94: - i = SSL_MD_GOST94_IDX; + *md = EVP_sha384(); break; case SSL_GOST89MAC: - i = SSL_MD_GOST89MAC_IDX; + *md = EVP_gost2814789imit(); break; - case SSL_STREEBOG256: - i = SSL_MD_STREEBOG256_IDX; + case SSL_GOST94: + *md = EVP_gostr341194(); break; - default: - i = -1; + case SSL_STREEBOG256: + *md = EVP_streebog256(); break; } - if ((i < 0) || (i >= SSL_MD_NUM_IDX)) { - *md = NULL; - - if (mac_pkey_type != NULL) - *mac_pkey_type = NID_undef; - if (mac_secret_size != NULL) - *mac_secret_size = 0; - if (c->algorithm_mac == SSL_AEAD) - mac_pkey_type = NULL; + + if (*enc == NULL || *md == NULL) + return 0; + + /* + * EVP_CIPH_FLAG_AEAD_CIPHER and EVP_CIPH_GCM_MODE ciphers are not + * supported via EVP_CIPHER (they should be using EVP_AEAD instead). + */ + if (EVP_CIPHER_flags(*enc) & EVP_CIPH_FLAG_AEAD_CIPHER) + return 0; + if (EVP_CIPHER_mode(*enc) == EVP_CIPH_GCM_MODE) + return 0; + + if (ss->cipher->algorithm_mac == SSL_GOST89MAC) { + *mac_pkey_type = EVP_PKEY_GOSTIMIT; + *mac_secret_size = 32; /* XXX */ } else { - *md = ssl_digest_methods[i]; - if (mac_pkey_type != NULL) - *mac_pkey_type = ssl_mac_pkey_id[i]; - if (mac_secret_size != NULL) - *mac_secret_size = ssl_mac_secret_size[i]; + *mac_pkey_type = EVP_PKEY_HMAC; + *mac_secret_size = EVP_MD_size(*md); } - if ((*enc != NULL) && - (*md != NULL || (EVP_CIPHER_flags(*enc)&EVP_CIPH_FLAG_AEAD_CIPHER)) && - (!mac_pkey_type || *mac_pkey_type != NID_undef)) { - const EVP_CIPHER *evp; - - if (s->ssl_version >> 8 != TLS1_VERSION_MAJOR || - s->ssl_version < TLS1_VERSION) - return 1; - - if (c->algorithm_enc == SSL_RC4 && - c->algorithm_mac == SSL_MD5 && - (evp = EVP_get_cipherbyname("RC4-HMAC-MD5"))) - *enc = evp, *md = NULL; - else if (c->algorithm_enc == SSL_AES128 && - c->algorithm_mac == SSL_SHA1 && - (evp = EVP_get_cipherbyname("AES-128-CBC-HMAC-SHA1"))) - *enc = evp, *md = NULL; - else if (c->algorithm_enc == SSL_AES256 && - c->algorithm_mac == SSL_SHA1 && - (evp = EVP_get_cipherbyname("AES-256-CBC-HMAC-SHA1"))) - *enc = evp, *md = NULL; - return (1); - } else - return (0); + return 1; } /* @@ -667,26 +509,22 @@ ssl_cipher_get_evp(const SSL_SESSION *s, const EVP_CIPHER **enc, * for s->cipher. It returns 1 on success and 0 on error. */ int -ssl_cipher_get_evp_aead(const SSL_SESSION *s, const EVP_AEAD **aead) +ssl_cipher_get_evp_aead(const SSL_SESSION *ss, const EVP_AEAD **aead) { - const SSL_CIPHER *c = s->cipher; - *aead = NULL; - if (c == NULL) + if (ss->cipher == NULL) return 0; - if ((c->algorithm2 & SSL_CIPHER_ALGORITHM2_AEAD) == 0) + if ((ss->cipher->algorithm_mac & SSL_AEAD) == 0) return 0; - switch (c->algorithm_enc) { -#ifndef OPENSSL_NO_AES + switch (ss->cipher->algorithm_enc) { case SSL_AES128GCM: *aead = EVP_aead_aes_128_gcm(); return 1; case SSL_AES256GCM: *aead = EVP_aead_aes_256_gcm(); return 1; -#endif case SSL_CHACHA20POLY1305: *aead = EVP_aead_chacha20_poly1305(); return 1; @@ -786,26 +624,6 @@ ssl_cipher_get_disabled(unsigned long *mkey, unsigned long *auth, #ifdef SSL_FORBID_ENULL *enc |= SSL_eNULL; #endif - - *enc |= (ssl_cipher_methods[SSL_ENC_DES_IDX ] == NULL) ? SSL_DES : 0; - *enc |= (ssl_cipher_methods[SSL_ENC_3DES_IDX] == NULL) ? SSL_3DES : 0; - *enc |= (ssl_cipher_methods[SSL_ENC_RC4_IDX ] == NULL) ? SSL_RC4 : 0; - *enc |= (ssl_cipher_methods[SSL_ENC_IDEA_IDX] == NULL) ? SSL_IDEA : 0; - *enc |= (ssl_cipher_methods[SSL_ENC_AES128_IDX] == NULL) ? SSL_AES128 : 0; - *enc |= (ssl_cipher_methods[SSL_ENC_AES256_IDX] == NULL) ? SSL_AES256 : 0; - *enc |= (ssl_cipher_methods[SSL_ENC_AES128GCM_IDX] == NULL) ? SSL_AES128GCM : 0; - *enc |= (ssl_cipher_methods[SSL_ENC_AES256GCM_IDX] == NULL) ? SSL_AES256GCM : 0; - *enc |= (ssl_cipher_methods[SSL_ENC_CAMELLIA128_IDX] == NULL) ? SSL_CAMELLIA128 : 0; - *enc |= (ssl_cipher_methods[SSL_ENC_CAMELLIA256_IDX] == NULL) ? SSL_CAMELLIA256 : 0; - *enc |= (ssl_cipher_methods[SSL_ENC_GOST89_IDX] == NULL) ? SSL_eGOST2814789CNT : 0; - - *mac |= (ssl_digest_methods[SSL_MD_MD5_IDX ] == NULL) ? SSL_MD5 : 0; - *mac |= (ssl_digest_methods[SSL_MD_SHA1_IDX] == NULL) ? SSL_SHA1 : 0; - *mac |= (ssl_digest_methods[SSL_MD_SHA256_IDX] == NULL) ? SSL_SHA256 : 0; - *mac |= (ssl_digest_methods[SSL_MD_SHA384_IDX] == NULL) ? SSL_SHA384 : 0; - *mac |= (ssl_digest_methods[SSL_MD_GOST94_IDX] == NULL) ? SSL_GOST94 : 0; - *mac |= (ssl_digest_methods[SSL_MD_GOST89MAC_IDX] == NULL) ? SSL_GOST89MAC : 0; - *mac |= (ssl_digest_methods[SSL_MD_STREEBOG256_IDX] == NULL) ? SSL_STREEBOG256 : 0; } static void @@ -971,6 +789,9 @@ ssl_cipher_apply_rule(unsigned long cipher_id, unsigned long alg_mkey, cp = curr->cipher; + if (cipher_id && cp->id != cipher_id) + continue; + /* * Selection criteria is either the value of strength_bits * or the algorithms used. @@ -979,7 +800,6 @@ ssl_cipher_apply_rule(unsigned long cipher_id, unsigned long alg_mkey, if (strength_bits != cp->strength_bits) continue; } else { - if (alg_mkey && !(alg_mkey & cp->algorithm_mkey)) continue; if (alg_auth && !(alg_auth & cp->algorithm_auth)) @@ -994,7 +814,6 @@ ssl_cipher_apply_rule(unsigned long cipher_id, unsigned long alg_mkey, continue; } - /* add the cipher if it has not been added yet. */ if (rule == CIPHER_ADD) { /* reverse == 0 */ @@ -1372,8 +1191,8 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method, } ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers, - disabled_mkey, disabled_auth, disabled_enc, disabled_mac, disabled_ssl, - co_list, &head, &tail); + disabled_mkey, disabled_auth, disabled_enc, disabled_mac, disabled_ssl, + co_list, &head, &tail); /* Now arrange all ciphers by preference: */ @@ -1429,6 +1248,9 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method, /* Now disable everything (maintaining the ordering!) */ ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head, &tail); + /* TLSv1.3 first. */ + ssl_cipher_apply_rule(0, 0, 0, 0, 0, SSL_TLSV1_3, 0, CIPHER_ADD, -1, &head, &tail); + ssl_cipher_apply_rule(0, 0, 0, 0, 0, SSL_TLSV1_3, 0, CIPHER_DEL, -1, &head, &tail); /* * We also need cipher aliases for selecting based on the rule_str. @@ -1543,6 +1365,8 @@ SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) ver = "SSLv3"; else if (alg_ssl & SSL_TLSV1_2) ver = "TLSv1.2"; + else if (alg_ssl & SSL_TLSV1_3) + ver = "TLSv1.3"; else ver = "unknown"; @@ -1585,18 +1409,12 @@ SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) } switch (alg_enc) { - case SSL_DES: - enc = "DES(56)"; - break; case SSL_3DES: enc = "3DES(168)"; break; case SSL_RC4: enc = alg2 & SSL2_CF_8_BYTE_ENC ? "RC4(64)" : "RC4(128)"; break; - case SSL_IDEA: - enc = "IDEA(128)"; - break; case SSL_eNULL: enc = "None"; break; @@ -1674,7 +1492,7 @@ SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) return (ret); } -char * +const char * SSL_CIPHER_get_version(const SSL_CIPHER *c) { if (c == NULL) @@ -1720,6 +1538,104 @@ SSL_CIPHER_get_value(const SSL_CIPHER *c) return ssl3_cipher_get_value(c); } +int +SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *c) +{ + switch (c->algorithm_enc) { + case SSL_eNULL: + return NID_undef; + case SSL_3DES: + return NID_des_ede3_cbc; + case SSL_AES128: + return NID_aes_128_cbc; + case SSL_AES128GCM: + return NID_aes_128_gcm; + case SSL_AES256: + return NID_aes_256_cbc; + case SSL_AES256GCM: + return NID_aes_256_gcm; + case SSL_CAMELLIA128: + return NID_camellia_128_cbc; + case SSL_CAMELLIA256: + return NID_camellia_256_cbc; + case SSL_CHACHA20POLY1305: + return NID_chacha20_poly1305; + case SSL_DES: + return NID_des_cbc; + case SSL_RC4: + return NID_rc4; + case SSL_eGOST2814789CNT: + return NID_gost89_cnt; + default: + return NID_undef; + } +} + +int +SSL_CIPHER_get_digest_nid(const SSL_CIPHER *c) +{ + switch (c->algorithm_mac) { + case SSL_AEAD: + return NID_undef; + case SSL_GOST89MAC: + return NID_id_Gost28147_89_MAC; + case SSL_GOST94: + return NID_id_GostR3411_94; + case SSL_MD5: + return NID_md5; + case SSL_SHA1: + return NID_sha1; + case SSL_SHA256: + return NID_sha256; + case SSL_SHA384: + return NID_sha384; + case SSL_STREEBOG256: + return NID_id_tc26_gost3411_2012_256; + default: + return NID_undef; + } +} + +int +SSL_CIPHER_get_kx_nid(const SSL_CIPHER *c) +{ + switch (c->algorithm_mkey) { + case SSL_kDHE: + return NID_kx_dhe; + case SSL_kECDHE: + return NID_kx_ecdhe; + case SSL_kGOST: + return NID_kx_gost; + case SSL_kRSA: + return NID_kx_rsa; + default: + return NID_undef; + } +} + +int +SSL_CIPHER_get_auth_nid(const SSL_CIPHER *c) +{ + switch (c->algorithm_auth) { + case SSL_aNULL: + return NID_auth_null; + case SSL_aECDSA: + return NID_auth_ecdsa; + case SSL_aGOST01: + return NID_auth_gost01; + case SSL_aRSA: + return NID_auth_rsa; + default: + return NID_undef; + } +} + +int +SSL_CIPHER_is_aead(const SSL_CIPHER *c) +{ + return (c->algorithm_mac & SSL_AEAD) == SSL_AEAD; +} + void * SSL_COMP_get_compression_methods(void) { diff --git a/ssl/ssl_ciphers.c b/ssl/ssl_ciphers.c new file mode 100644 index 00000000..374cb668 --- /dev/null +++ b/ssl/ssl_ciphers.c @@ -0,0 +1,162 @@ +/* $OpenBSD: ssl_ciphers.c,v 1.2 2019/01/21 14:12:13 tb Exp $ */ +/* + * Copyright (c) 2015-2017 Doug Hogan + * Copyright (c) 2015-2018 Joel Sing + * Copyright (c) 2019 Theo Buehler + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#include "bytestring.h" +#include "ssl_locl.h" + +int +ssl_cipher_is_permitted(const SSL_CIPHER *cipher, uint16_t min_ver, + uint16_t max_ver) +{ + /* XXX: We only support DTLSv1 which is effectively TLSv1.1 */ + if (min_ver == DTLS1_VERSION || max_ver == DTLS1_VERSION) + min_ver = max_ver = TLS1_1_VERSION; + + switch(cipher->algorithm_ssl) { + case SSL_SSLV3: + if (min_ver <= TLS1_2_VERSION) + return 1; + break; + case SSL_TLSV1_2: + if (min_ver <= TLS1_2_VERSION && TLS1_2_VERSION <= max_ver) + return 1; + break; + case SSL_TLSV1_3: + if (min_ver <= TLS1_3_VERSION && TLS1_3_VERSION <= max_ver) + return 1; + break; + } + + return 0; +} + +int +ssl_cipher_list_to_bytes(SSL *s, STACK_OF(SSL_CIPHER) *ciphers, CBB *cbb) +{ + SSL_CIPHER *cipher; + int num_ciphers = 0; + uint16_t min_vers, max_vers; + int i; + + if (ciphers == NULL) + return 0; + + if (!ssl_supported_version_range(s, &min_vers, &max_vers)) + return 0; + + for (i = 0; i < sk_SSL_CIPHER_num(ciphers); i++) { + if ((cipher = sk_SSL_CIPHER_value(ciphers, i)) == NULL) + return 0; + + if (!ssl_cipher_is_permitted(cipher, min_vers, max_vers)) + continue; + + if (!CBB_add_u16(cbb, ssl3_cipher_get_value(cipher))) + return 0; + + num_ciphers++; + } + + /* Add SCSV if there are other ciphers and we're not renegotiating. */ + if (num_ciphers > 0 && !s->internal->renegotiate) { + if (!CBB_add_u16(cbb, SSL3_CK_SCSV & SSL3_CK_VALUE_MASK)) + return 0; + } + + if (!CBB_flush(cbb)) + return 0; + + return 1; +} + +STACK_OF(SSL_CIPHER) * +ssl_bytes_to_cipher_list(SSL *s, CBS *cbs) +{ + STACK_OF(SSL_CIPHER) *ciphers = NULL; + const SSL_CIPHER *cipher; + uint16_t cipher_value, max_version; + unsigned long cipher_id; + + if (s->s3 != NULL) + S3I(s)->send_connection_binding = 0; + + if ((ciphers = sk_SSL_CIPHER_new_null()) == NULL) { + SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; + } + + while (CBS_len(cbs) > 0) { + if (!CBS_get_u16(cbs, &cipher_value)) { + SSLerror(s, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST); + goto err; + } + + cipher_id = SSL3_CK_ID | cipher_value; + + if (s->s3 != NULL && cipher_id == SSL3_CK_SCSV) { + /* + * TLS_EMPTY_RENEGOTIATION_INFO_SCSV is fatal if + * renegotiating. + */ + if (s->internal->renegotiate) { + SSLerror(s, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING); + ssl3_send_alert(s, SSL3_AL_FATAL, + SSL_AD_HANDSHAKE_FAILURE); + + goto err; + } + S3I(s)->send_connection_binding = 1; + continue; + } + + if (cipher_id == SSL3_CK_FALLBACK_SCSV) { + /* + * TLS_FALLBACK_SCSV indicates that the client + * previously tried a higher protocol version. + * Fail if the current version is an unexpected + * downgrade. + */ + max_version = ssl_max_server_version(s); + if (max_version == 0 || s->version < max_version) { + SSLerror(s, SSL_R_INAPPROPRIATE_FALLBACK); + if (s->s3 != NULL) + ssl3_send_alert(s, SSL3_AL_FATAL, + SSL_AD_INAPPROPRIATE_FALLBACK); + goto err; + } + continue; + } + + if ((cipher = ssl3_get_cipher_by_value(cipher_value)) != NULL) { + if (!sk_SSL_CIPHER_push(ciphers, cipher)) { + SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; + } + } + } + + return (ciphers); + + err: + sk_SSL_CIPHER_free(ciphers); + + return (NULL); +} diff --git a/ssl/ssl_clnt.c b/ssl/ssl_clnt.c index 2370ce06..90aa80f5 100644 --- a/ssl/ssl_clnt.c +++ b/ssl/ssl_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_clnt.c,v 1.17 2017/08/12 21:47:59 jsing Exp $ */ +/* $OpenBSD: ssl_clnt.c,v 1.61 2019/03/31 15:49:03 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -170,15 +170,17 @@ #endif #include "bytestring.h" +#include "ssl_sigalgs.h" +#include "ssl_tlsext.h" static int ca_dn_cmp(const X509_NAME * const *a, const X509_NAME * const *b); int ssl3_connect(SSL *s) { - void (*cb)(const SSL *ssl, int type, int val) = NULL; - int ret = -1; - int new_state, state, skip = 0; + void (*cb)(const SSL *ssl, int type, int val) = NULL; + int ret = -1; + int new_state, state, skip = 0; ERR_clear_error(); errno = 0; @@ -210,10 +212,18 @@ ssl3_connect(SSL *s) if (cb != NULL) cb(s, SSL_CB_HANDSHAKE_START, 1); - if ((s->version & 0xff00 ) != 0x0300) { - SSLerror(s, ERR_R_INTERNAL_ERROR); - ret = -1; - goto end; + if (SSL_IS_DTLS(s)) { + if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00)) { + SSLerror(s, ERR_R_INTERNAL_ERROR); + ret = -1; + goto end; + } + } else { + if ((s->version & 0xff00) != 0x0300) { + SSLerror(s, ERR_R_INTERNAL_ERROR); + ret = -1; + goto end; + } } /* s->version=SSL3_VERSION; */ @@ -234,7 +244,7 @@ ssl3_connect(SSL *s) /* don't push the buffering BIO quite yet */ - if (!tls1_init_finished_mac(s)) { + if (!tls1_transcript_init(s)) { ret = -1; goto end; } @@ -242,16 +252,37 @@ ssl3_connect(SSL *s) S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_A; s->ctx->internal->stats.sess_connect++; s->internal->init_num = 0; + + if (SSL_IS_DTLS(s)) { + /* mark client_random uninitialized */ + memset(s->s3->client_random, 0, + sizeof(s->s3->client_random)); + D1I(s)->send_cookie = 0; + s->internal->hit = 0; + } break; case SSL3_ST_CW_CLNT_HELLO_A: case SSL3_ST_CW_CLNT_HELLO_B: - s->internal->shutdown = 0; - ret = ssl3_client_hello(s); + + if (SSL_IS_DTLS(s)) { + /* every DTLS ClientHello resets Finished MAC */ + tls1_transcript_reset(s); + + dtls1_start_timer(s); + } + + ret = ssl3_send_client_hello(s); if (ret <= 0) goto end; - S3I(s)->hs.state = SSL3_ST_CR_SRVR_HELLO_A; + + if (SSL_IS_DTLS(s) && D1I(s)->send_cookie) { + S3I(s)->hs.state = SSL3_ST_CW_FLUSH; + S3I(s)->hs.next_state = SSL3_ST_CR_SRVR_HELLO_A; + } else + S3I(s)->hs.state = SSL3_ST_CR_SRVR_HELLO_A; + s->internal->init_num = 0; /* turn on buffering for the next lot of output */ @@ -268,11 +299,32 @@ ssl3_connect(SSL *s) if (s->internal->hit) { S3I(s)->hs.state = SSL3_ST_CR_FINISHED_A; - if (s->internal->tlsext_ticket_expected) { - /* receive renewed session ticket */ - S3I(s)->hs.state = SSL3_ST_CR_SESSION_TICKET_A; + if (!SSL_IS_DTLS(s)) { + if (s->internal->tlsext_ticket_expected) { + /* receive renewed session ticket */ + S3I(s)->hs.state = SSL3_ST_CR_SESSION_TICKET_A; + } + + /* No client certificate verification. */ + tls1_transcript_free(s); } - } else + } else if (SSL_IS_DTLS(s)) { + S3I(s)->hs.state = DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A; + } else { + S3I(s)->hs.state = SSL3_ST_CR_CERT_A; + } + s->internal->init_num = 0; + break; + + case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A: + case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B: + ret = dtls1_get_hello_verify(s); + if (ret <= 0) + goto end; + dtls1_stop_timer(s); + if (D1I(s)->send_cookie) /* start again, with a cookie */ + S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_A; + else S3I(s)->hs.state = SSL3_ST_CR_CERT_A; s->internal->init_num = 0; break; @@ -340,6 +392,8 @@ ssl3_connect(SSL *s) ret = ssl3_get_server_done(s); if (ret <= 0) goto end; + if (SSL_IS_DTLS(s)) + dtls1_stop_timer(s); if (S3I(s)->tmp.cert_req) S3I(s)->hs.state = SSL3_ST_CW_CERT_A; else @@ -352,6 +406,8 @@ ssl3_connect(SSL *s) case SSL3_ST_CW_CERT_B: case SSL3_ST_CW_CERT_C: case SSL3_ST_CW_CERT_D: + if (SSL_IS_DTLS(s)) + dtls1_start_timer(s); ret = ssl3_send_client_certificate(s); if (ret <= 0) goto end; @@ -361,6 +417,8 @@ ssl3_connect(SSL *s) case SSL3_ST_CW_KEY_EXCH_A: case SSL3_ST_CW_KEY_EXCH_B: + if (SSL_IS_DTLS(s)) + dtls1_start_timer(s); ret = ssl3_send_client_key_exchange(s); if (ret <= 0) goto end; @@ -386,9 +444,11 @@ ssl3_connect(SSL *s) S3I(s)->hs.state = SSL3_ST_CW_CHANGE_A; S3I(s)->change_cipher_spec = 0; } - if (s->s3->flags & TLS1_FLAGS_SKIP_CERT_VERIFY) { - S3I(s)->hs.state = SSL3_ST_CW_CHANGE_A; - S3I(s)->change_cipher_spec = 0; + if (!SSL_IS_DTLS(s)) { + if (s->s3->flags & TLS1_FLAGS_SKIP_CERT_VERIFY) { + S3I(s)->hs.state = SSL3_ST_CW_CHANGE_A; + S3I(s)->change_cipher_spec = 0; + } } s->internal->init_num = 0; @@ -396,6 +456,8 @@ ssl3_connect(SSL *s) case SSL3_ST_CW_CERT_VRFY_A: case SSL3_ST_CW_CERT_VRFY_B: + if (SSL_IS_DTLS(s)) + dtls1_start_timer(s); ret = ssl3_send_client_verify(s); if (ret <= 0) goto end; @@ -406,6 +468,8 @@ ssl3_connect(SSL *s) case SSL3_ST_CW_CHANGE_A: case SSL3_ST_CW_CHANGE_B: + if (SSL_IS_DTLS(s) && !s->internal->hit) + dtls1_start_timer(s); ret = ssl3_send_change_cipher_spec(s, SSL3_ST_CW_CHANGE_A, SSL3_ST_CW_CHANGE_B); if (ret <= 0) @@ -426,37 +490,35 @@ ssl3_connect(SSL *s) goto end; } + if (SSL_IS_DTLS(s)) + dtls1_reset_seq_numbers(s, SSL3_CC_WRITE); + break; case SSL3_ST_CW_FINISHED_A: case SSL3_ST_CW_FINISHED_B: + if (SSL_IS_DTLS(s) && !s->internal->hit) + dtls1_start_timer(s); ret = ssl3_send_finished(s, SSL3_ST_CW_FINISHED_A, - SSL3_ST_CW_FINISHED_B, - TLS_MD_CLIENT_FINISH_CONST, + SSL3_ST_CW_FINISHED_B, TLS_MD_CLIENT_FINISH_CONST, TLS_MD_CLIENT_FINISH_CONST_SIZE); if (ret <= 0) goto end; - s->s3->flags |= SSL3_FLAGS_CCS_OK; + if (!SSL_IS_DTLS(s)) + s->s3->flags |= SSL3_FLAGS_CCS_OK; S3I(s)->hs.state = SSL3_ST_CW_FLUSH; /* clear flags */ - s->s3->flags &= ~SSL3_FLAGS_POP_BUFFER; if (s->internal->hit) { S3I(s)->hs.next_state = SSL_ST_OK; - if (s->s3->flags & - SSL3_FLAGS_DELAY_CLIENT_FINISHED) { - S3I(s)->hs.state = SSL_ST_OK; - s->s3->flags|=SSL3_FLAGS_POP_BUFFER; - S3I(s)->delay_buf_pop_ret = 0; - } } else { /* Allow NewSessionTicket if ticket expected */ if (s->internal->tlsext_ticket_expected) S3I(s)->hs.next_state = SSL3_ST_CR_SESSION_TICKET_A; else - - S3I(s)->hs.next_state = SSL3_ST_CR_FINISHED_A; + S3I(s)->hs.next_state = + SSL3_ST_CR_FINISHED_A; } s->internal->init_num = 0; break; @@ -481,11 +543,16 @@ ssl3_connect(SSL *s) case SSL3_ST_CR_FINISHED_A: case SSL3_ST_CR_FINISHED_B: - s->s3->flags |= SSL3_FLAGS_CCS_OK; + if (SSL_IS_DTLS(s)) + D1I(s)->change_cipher_spec_ok = 1; + else + s->s3->flags |= SSL3_FLAGS_CCS_OK; ret = ssl3_get_finished(s, SSL3_ST_CR_FINISHED_A, SSL3_ST_CR_FINISHED_B); if (ret <= 0) goto end; + if (SSL_IS_DTLS(s)) + dtls1_stop_timer(s); if (s->internal->hit) S3I(s)->hs.state = SSL3_ST_CW_CHANGE_A; @@ -497,6 +564,13 @@ ssl3_connect(SSL *s) case SSL3_ST_CW_FLUSH: s->internal->rwstate = SSL_WRITING; if (BIO_flush(s->wbio) <= 0) { + if (SSL_IS_DTLS(s)) { + /* If the write error was fatal, stop trying */ + if (!BIO_should_retry(s->wbio)) { + s->internal->rwstate = SSL_NOTHING; + S3I(s)->hs.state = S3I(s)->hs.next_state; + } + } ret = -1; goto end; } @@ -508,16 +582,18 @@ ssl3_connect(SSL *s) /* clean a few things up */ tls1_cleanup_key_block(s); - BUF_MEM_free(s->internal->init_buf); - s->internal->init_buf = NULL; + if (S3I(s)->handshake_transcript != NULL) { + SSLerror(s, ERR_R_INTERNAL_ERROR); + ret = -1; + goto end; + } - /* - * If we are not 'joining' the last two packets, - * remove the buffering now - */ - if (!(s->s3->flags & SSL3_FLAGS_POP_BUFFER)) - ssl_free_wbio_buffer(s); - /* else do it later in ssl3_write */ + if (!SSL_IS_DTLS(s)) { + BUF_MEM_free(s->internal->init_buf); + s->internal->init_buf = NULL; + } + + ssl_free_wbio_buffer(s); s->internal->init_num = 0; s->internal->renegotiate = 0; @@ -535,6 +611,12 @@ ssl3_connect(SSL *s) if (cb != NULL) cb(s, SSL_CB_HANDSHAKE_DONE, 1); + if (SSL_IS_DTLS(s)) { + /* done with handshaking */ + D1I(s)->handshake_read_seq = 0; + D1I(s)->next_handshake_write_seq = 0; + } + goto end; /* break; */ @@ -571,14 +653,14 @@ ssl3_connect(SSL *s) } int -ssl3_client_hello(SSL *s) +ssl3_send_client_hello(SSL *s) { - unsigned char *bufend, *p, *d; - uint16_t max_version; - size_t outlen; - int i; + CBB cbb, client_hello, session_id, cookie, cipher_suites; + CBB compression_methods; + uint16_t max_version; + size_t sl; - bufend = (unsigned char *)s->internal->init_buf->data + SSL3_RT_MAX_PLAIN_LENGTH; + memset(&cbb, 0, sizeof(cbb)); if (S3I(s)->hs.state == SSL3_ST_CW_CLNT_HELLO_A) { SSL_SESSION *sess = s->session; @@ -589,10 +671,10 @@ ssl3_client_hello(SSL *s) } s->client_version = s->version = max_version; - if ((sess == NULL) || - (sess->ssl_version != s->version) || + if (sess == NULL || + sess->ssl_version != s->version || (!sess->session_id_length && !sess->tlsext_tick) || - (sess->internal->not_resumable)) { + sess->internal->not_resumable) { if (!ssl_get_new_session(s, 0)) goto err; } @@ -606,7 +688,9 @@ ssl3_client_hello(SSL *s) if (!SSL_IS_DTLS(s) || D1I(s)->send_cookie == 0) arc4random_buf(s->s3->client_random, SSL3_RANDOM_SIZE); - d = p = ssl3_handshake_msg_start(s, SSL3_MT_CLIENT_HELLO); + if (!ssl3_handshake_msg_start(s, &cbb, &client_hello, + SSL3_MT_CLIENT_HELLO)) + goto err; /* * Version indicates the negotiated version: for example from @@ -638,27 +722,27 @@ ssl3_client_hello(SSL *s) * client_version in client hello and not resetting it to * the negotiated version. */ - - *(p++) = s->client_version >> 8; - *(p++) = s->client_version & 0xff; + if (!CBB_add_u16(&client_hello, s->client_version)) + goto err; /* Random stuff */ - memcpy(p, s->s3->client_random, SSL3_RANDOM_SIZE); - p += SSL3_RANDOM_SIZE; + if (!CBB_add_bytes(&client_hello, s->s3->client_random, + sizeof(s->s3->client_random))) + goto err; /* Session ID */ - if (s->internal->new_session) - i = 0; - else - i = s->session->session_id_length; - *(p++) = i; - if (i != 0) { - if (i > (int)sizeof(s->session->session_id)) { + if (!CBB_add_u8_length_prefixed(&client_hello, &session_id)) + goto err; + if (!s->internal->new_session && + s->session->session_id_length > 0) { + sl = s->session->session_id_length; + if (sl > sizeof(s->session->session_id)) { SSLerror(s, ERR_R_INTERNAL_ERROR); goto err; } - memcpy(p, s->session->session_id, i); - p += i; + if (!CBB_add_bytes(&session_id, + s->session->session_id, sl)) + goto err; } /* DTLS Cookie. */ @@ -667,33 +751,37 @@ ssl3_client_hello(SSL *s) SSLerror(s, ERR_R_INTERNAL_ERROR); goto err; } - *(p++) = D1I(s)->cookie_len; - memcpy(p, D1I(s)->cookie, D1I(s)->cookie_len); - p += D1I(s)->cookie_len; + if (!CBB_add_u8_length_prefixed(&client_hello, &cookie)) + goto err; + if (!CBB_add_bytes(&cookie, D1I(s)->cookie, + D1I(s)->cookie_len)) + goto err; } /* Ciphers supported */ - if (!ssl_cipher_list_to_bytes(s, SSL_get_ciphers(s), &p[2], - bufend - &p[2], &outlen)) - goto err; - if (outlen == 0) { + if (!CBB_add_u16_length_prefixed(&client_hello, &cipher_suites)) + return 0; + if (!ssl_cipher_list_to_bytes(s, SSL_get_ciphers(s), + &cipher_suites)) { SSLerror(s, SSL_R_NO_CIPHERS_AVAILABLE); goto err; } - s2n(outlen, p); - p += outlen; - /* add in (no) COMPRESSION */ - *(p++) = 1; - *(p++) = 0; /* Add the NULL method */ + /* Add in compression methods (null) */ + if (!CBB_add_u8_length_prefixed(&client_hello, + &compression_methods)) + goto err; + if (!CBB_add_u8(&compression_methods, 0)) + goto err; - /* TLS extensions*/ - if ((p = ssl_add_clienthello_tlsext(s, p, bufend)) == NULL) { + /* TLS extensions */ + if (!tlsext_client_build(s, &client_hello, SSL_TLSEXT_MSG_CH)) { SSLerror(s, ERR_R_INTERNAL_ERROR); goto err; } - ssl3_handshake_msg_finish(s, p - d); + if (!ssl3_handshake_msg_finish(s, &cbb)) + goto err; S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_B; } @@ -702,6 +790,8 @@ ssl3_client_hello(SSL *s) return (ssl3_handshake_write(s)); err: + CBB_cleanup(&cbb); + return (-1); } @@ -715,7 +805,6 @@ ssl3_get_server_hello(SSL *s) STACK_OF(SSL_CIPHER) *sk; const SSL_CIPHER *cipher; const SSL_METHOD *method; - unsigned char *p; unsigned long alg_k; size_t outlen; int i, al, ok; @@ -890,7 +979,7 @@ ssl3_get_server_hello(SSL *s) } S3I(s)->hs.new_cipher = cipher; - if (!tls1_handshake_hash_init(s)) + if (!tls1_transcript_hash_init(s)) goto err; /* @@ -898,11 +987,8 @@ ssl3_get_server_hello(SSL *s) * client authentication. */ alg_k = S3I(s)->hs.new_cipher->algorithm_mkey; - if (!(SSL_USE_SIGALGS(s) || (alg_k & SSL_kGOST)) && - !tls1_digest_cached_records(s)) { - al = SSL_AD_INTERNAL_ERROR; - goto f_err; - } + if (!(SSL_USE_SIGALGS(s) || (alg_k & SSL_kGOST))) + tls1_transcript_free(s); if (!CBS_get_u8(&cbs, &compression_method)) goto truncated; @@ -913,22 +999,31 @@ ssl3_get_server_hello(SSL *s) goto f_err; } - /* TLS extensions. */ - p = (unsigned char *)CBS_data(&cbs); - if (!ssl_parse_serverhello_tlsext(s, &p, CBS_len(&cbs), &al)) { - /* 'al' set by ssl_parse_serverhello_tlsext */ + if (!tlsext_client_parse(s, &cbs, &al, SSL_TLSEXT_MSG_SH)) { SSLerror(s, SSL_R_PARSE_TLSEXT); goto f_err; } + + /* + * Determine if we need to see RI. Strictly speaking if we want to + * avoid an attack we should *always* see RI even on initial server + * hello because the client doesn't see any renegotiation during an + * attack. However this would mean we could not connect to any server + * which doesn't support RI so for the immediate future tolerate RI + * absence on initial connect only. + */ + if (!S3I(s)->renegotiate_seen && + !(s->internal->options & SSL_OP_LEGACY_SERVER_CONNECT)) { + al = SSL_AD_HANDSHAKE_FAILURE; + SSLerror(s, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); + goto f_err; + } + if (ssl_check_serverhello_tlsext(s) <= 0) { SSLerror(s, SSL_R_SERVERHELLO_TLSEXT); goto err; } - /* See if any data remains... */ - if (p - CBS_data(&cbs) != CBS_len(&cbs)) - goto truncated; - return (1); truncated: @@ -1096,9 +1191,9 @@ ssl3_get_server_certificate(SSL *s) } static int -ssl3_get_server_kex_dhe(SSL *s, EVP_PKEY **pkey, unsigned char **pp, long *nn) +ssl3_get_server_kex_dhe(SSL *s, EVP_PKEY **pkey, CBS *cbs) { - CBS cbs, dhp, dhg, dhpk; + CBS dhp, dhg, dhpk; BN_CTX *bn_ctx = NULL; SESS_CERT *sc = NULL; DH *dh = NULL; @@ -1108,31 +1203,26 @@ ssl3_get_server_kex_dhe(SSL *s, EVP_PKEY **pkey, unsigned char **pp, long *nn) alg_a = S3I(s)->hs.new_cipher->algorithm_auth; sc = SSI(s)->sess_cert; - if (*nn < 0) - goto err; - - CBS_init(&cbs, *pp, *nn); - if ((dh = DH_new()) == NULL) { SSLerror(s, ERR_R_DH_LIB); goto err; } - if (!CBS_get_u16_length_prefixed(&cbs, &dhp)) + if (!CBS_get_u16_length_prefixed(cbs, &dhp)) goto truncated; if ((dh->p = BN_bin2bn(CBS_data(&dhp), CBS_len(&dhp), NULL)) == NULL) { SSLerror(s, ERR_R_BN_LIB); goto err; } - if (!CBS_get_u16_length_prefixed(&cbs, &dhg)) + if (!CBS_get_u16_length_prefixed(cbs, &dhg)) goto truncated; if ((dh->g = BN_bin2bn(CBS_data(&dhg), CBS_len(&dhg), NULL)) == NULL) { SSLerror(s, ERR_R_BN_LIB); goto err; } - if (!CBS_get_u16_length_prefixed(&cbs, &dhpk)) + if (!CBS_get_u16_length_prefixed(cbs, &dhpk)) goto truncated; if ((dh->pub_key = BN_bin2bn(CBS_data(&dhpk), CBS_len(&dhpk), NULL)) == NULL) { @@ -1157,9 +1247,6 @@ ssl3_get_server_kex_dhe(SSL *s, EVP_PKEY **pkey, unsigned char **pp, long *nn) sc->peer_dh_tmp = dh; - *nn = CBS_len(&cbs); - *pp = (unsigned char *)CBS_data(&cbs); - return (1); truncated: @@ -1260,9 +1347,9 @@ ssl3_get_server_kex_ecdhe_ecx(SSL *s, SESS_CERT *sc, int nid, CBS *public) } static int -ssl3_get_server_kex_ecdhe(SSL *s, EVP_PKEY **pkey, unsigned char **pp, long *nn) +ssl3_get_server_kex_ecdhe(SSL *s, EVP_PKEY **pkey, CBS *cbs) { - CBS cbs, public; + CBS public; uint8_t curve_type; uint16_t curve_id; SESS_CERT *sc; @@ -1273,15 +1360,10 @@ ssl3_get_server_kex_ecdhe(SSL *s, EVP_PKEY **pkey, unsigned char **pp, long *nn) alg_a = S3I(s)->hs.new_cipher->algorithm_auth; sc = SSI(s)->sess_cert; - if (*nn < 0) - goto err; - - CBS_init(&cbs, *pp, *nn); - /* Only named curves are supported. */ - if (!CBS_get_u8(&cbs, &curve_type) || + if (!CBS_get_u8(cbs, &curve_type) || curve_type != NAMED_CURVE_TYPE || - !CBS_get_u16(&cbs, &curve_id)) { + !CBS_get_u16(cbs, &curve_id)) { al = SSL_AD_DECODE_ERROR; SSLerror(s, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1303,7 +1385,7 @@ ssl3_get_server_kex_ecdhe(SSL *s, EVP_PKEY **pkey, unsigned char **pp, long *nn) goto f_err; } - if (!CBS_get_u8_length_prefixed(&cbs, &public)) + if (!CBS_get_u8_length_prefixed(cbs, &public)) goto truncated; if (nid == NID_X25519) { @@ -1327,9 +1409,6 @@ ssl3_get_server_kex_ecdhe(SSL *s, EVP_PKEY **pkey, unsigned char **pp, long *nn) /* XXX - Anonymous ECDH, so no certificate or pkey. */ *pkey = NULL; - *nn = CBS_len(&cbs); - *pp = (unsigned char *)CBS_data(&cbs); - return (1); truncated: @@ -1346,14 +1425,16 @@ ssl3_get_server_kex_ecdhe(SSL *s, EVP_PKEY **pkey, unsigned char **pp, long *nn) int ssl3_get_server_key_exchange(SSL *s) { - unsigned char *q, md_buf[EVP_MAX_MD_SIZE*2]; - EVP_MD_CTX md_ctx; - unsigned char *param, *p; - int al, i, j, param_len, ok; - long n, alg_k, alg_a; - EVP_PKEY *pkey = NULL; - const EVP_MD *md = NULL; - RSA *rsa = NULL; + CBS cbs, signature; + const EVP_MD *md = NULL; + EVP_PKEY *pkey = NULL; + EVP_MD_CTX md_ctx; + const unsigned char *param; + long n, alg_k, alg_a; + int al, ok; + size_t param_len; + + EVP_MD_CTX_init(&md_ctx); alg_k = S3I(s)->hs.new_cipher->algorithm_mkey; alg_a = S3I(s)->hs.new_cipher->algorithm_auth; @@ -1367,7 +1448,10 @@ ssl3_get_server_key_exchange(SSL *s) if (!ok) return ((int)n); - EVP_MD_CTX_init(&md_ctx); + if (n < 0) + goto err; + + CBS_init(&cbs, s->internal->init_msg, n); if (S3I(s)->tmp.message_type != SSL3_MT_SERVER_KEY_EXCHANGE) { /* @@ -1400,14 +1484,14 @@ ssl3_get_server_key_exchange(SSL *s) goto err; } - param = p = (unsigned char *)s->internal->init_msg; - param_len = n; + param = CBS_data(&cbs); + param_len = CBS_len(&cbs); if (alg_k & SSL_kDHE) { - if (ssl3_get_server_kex_dhe(s, &pkey, &p, &n) != 1) + if (ssl3_get_server_kex_dhe(s, &pkey, &cbs) != 1) goto err; } else if (alg_k & SSL_kECDHE) { - if (ssl3_get_server_kex_ecdhe(s, &pkey, &p, &n) != 1) + if (ssl3_get_server_kex_ecdhe(s, &pkey, &cbs) != 1) goto err; } else if (alg_k != 0) { al = SSL_AD_UNEXPECTED_MESSAGE; @@ -1415,93 +1499,73 @@ ssl3_get_server_key_exchange(SSL *s) goto f_err; } - param_len = param_len - n; + param_len -= CBS_len(&cbs); /* if it was signed, check the signature */ if (pkey != NULL) { + EVP_PKEY_CTX *pctx; + const struct ssl_sigalg *sigalg; + if (SSL_USE_SIGALGS(s)) { - int sigalg = tls12_get_sigid(pkey); - /* Should never happen */ - if (sigalg == -1) { - SSLerror(s, ERR_R_INTERNAL_ERROR); - goto err; - } - /* - * Check key type is consistent - * with signature - */ - if (2 > n) + uint16_t sigalg_value; + + if (!CBS_get_u16(&cbs, &sigalg_value)) goto truncated; - if (sigalg != (int)p[1]) { - SSLerror(s, SSL_R_WRONG_SIGNATURE_TYPE); + if ((sigalg = ssl_sigalg(sigalg_value, tls12_sigalgs, + tls12_sigalgs_len)) == NULL) { + SSLerror(s, SSL_R_UNKNOWN_DIGEST); al = SSL_AD_DECODE_ERROR; goto f_err; } - md = tls12_get_hash(p[0]); - if (md == NULL) { + if ((md = sigalg->md()) == NULL) { SSLerror(s, SSL_R_UNKNOWN_DIGEST); al = SSL_AD_DECODE_ERROR; goto f_err; } - p += 2; - n -= 2; - } else - md = EVP_sha1(); + if (!ssl_sigalg_pkey_ok(sigalg, pkey, 0)) { + SSLerror(s, SSL_R_WRONG_SIGNATURE_TYPE); + al = SSL_AD_DECODE_ERROR; + goto f_err; + } + } else if (pkey->type == EVP_PKEY_RSA) { + sigalg = ssl_sigalg_lookup(SIGALG_RSA_PKCS1_MD5_SHA1); + } else if (pkey->type == EVP_PKEY_EC) { + sigalg = ssl_sigalg_lookup(SIGALG_ECDSA_SHA1); + } else { + SSLerror(s, SSL_R_UNKNOWN_PKEY_TYPE); + al = SSL_AD_DECODE_ERROR; + goto f_err; + } + md = sigalg->md(); - if (2 > n) + if (!CBS_get_u16_length_prefixed(&cbs, &signature)) goto truncated; - n2s(p, i); - n -= 2; - j = EVP_PKEY_size(pkey); - - if (i != n || n > j) { - /* wrong packet length */ + if (CBS_len(&signature) > EVP_PKEY_size(pkey)) { al = SSL_AD_DECODE_ERROR; SSLerror(s, SSL_R_WRONG_SIGNATURE_LENGTH); goto f_err; } - if (pkey->type == EVP_PKEY_RSA && !SSL_USE_SIGALGS(s)) { - j = 0; - q = md_buf; - if (!EVP_DigestInit_ex(&md_ctx, EVP_md5_sha1(), NULL)) { - al = SSL_AD_INTERNAL_ERROR; - goto f_err; - } - EVP_DigestUpdate(&md_ctx, s->s3->client_random, - SSL3_RANDOM_SIZE); - EVP_DigestUpdate(&md_ctx, s->s3->server_random, - SSL3_RANDOM_SIZE); - EVP_DigestUpdate(&md_ctx, param, param_len); - EVP_DigestFinal_ex(&md_ctx, q, (unsigned int *)&i); - q += i; - j += i; - i = RSA_verify(NID_md5_sha1, md_buf, j, - p, n, pkey->pkey.rsa); - if (i < 0) { - al = SSL_AD_DECRYPT_ERROR; - SSLerror(s, SSL_R_BAD_RSA_DECRYPT); - goto f_err; - } - if (i == 0) { - /* bad signature */ - al = SSL_AD_DECRYPT_ERROR; - SSLerror(s, SSL_R_BAD_SIGNATURE); - goto f_err; - } - } else { - EVP_VerifyInit_ex(&md_ctx, md, NULL); - EVP_VerifyUpdate(&md_ctx, s->s3->client_random, - SSL3_RANDOM_SIZE); - EVP_VerifyUpdate(&md_ctx, s->s3->server_random, - SSL3_RANDOM_SIZE); - EVP_VerifyUpdate(&md_ctx, param, param_len); - if (EVP_VerifyFinal(&md_ctx, p,(int)n, pkey) <= 0) { - /* bad signature */ - al = SSL_AD_DECRYPT_ERROR; - SSLerror(s, SSL_R_BAD_SIGNATURE); - goto f_err; - } + if (!EVP_DigestVerifyInit(&md_ctx, &pctx, md, NULL, pkey)) + goto err; + if (!EVP_DigestVerifyUpdate(&md_ctx, s->s3->client_random, + SSL3_RANDOM_SIZE)) + goto err; + if ((sigalg->flags & SIGALG_FLAG_RSA_PSS) && + (!EVP_PKEY_CTX_set_rsa_padding(pctx, + RSA_PKCS1_PSS_PADDING) || + !EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, -1))) + goto err; + if (!EVP_DigestVerifyUpdate(&md_ctx, s->s3->server_random, + SSL3_RANDOM_SIZE)) + goto err; + if (!EVP_DigestVerifyUpdate(&md_ctx, param, param_len)) + goto err; + if (EVP_DigestVerifyFinal(&md_ctx, CBS_data(&signature), + CBS_len(&signature)) <= 0) { + al = SSL_AD_DECRYPT_ERROR; + SSLerror(s, SSL_R_BAD_SIGNATURE); + goto f_err; } } else { /* aNULL does not need public keys. */ @@ -1509,12 +1573,12 @@ ssl3_get_server_key_exchange(SSL *s) SSLerror(s, ERR_R_INTERNAL_ERROR); goto err; } - /* still data left over */ - if (n != 0) { - al = SSL_AD_DECODE_ERROR; - SSLerror(s, SSL_R_EXTRA_DATA_IN_MESSAGE); - goto f_err; - } + } + + if (CBS_len(&cbs) != 0) { + al = SSL_AD_DECODE_ERROR; + SSLerror(s, SSL_R_EXTRA_DATA_IN_MESSAGE); + goto f_err; } EVP_PKEY_free(pkey); @@ -1523,7 +1587,6 @@ ssl3_get_server_key_exchange(SSL *s) return (1); truncated: - /* wrong packet length */ al = SSL_AD_DECODE_ERROR; SSLerror(s, SSL_R_BAD_PACKET_LENGTH); @@ -1532,7 +1595,6 @@ ssl3_get_server_key_exchange(SSL *s) err: EVP_PKEY_free(pkey); - RSA_free(rsa); EVP_MD_CTX_cleanup(&md_ctx); return (-1); @@ -1563,10 +1625,7 @@ ssl3_get_certificate_request(SSL *s) * If we get here we don't need any cached handshake records * as we wont be doing client auth. */ - if (S3I(s)->handshake_buffer) { - if (!tls1_digest_cached_records(s)) - goto err; - } + tls1_transcript_free(s); return (1); } @@ -1612,20 +1671,19 @@ ssl3_get_certificate_request(SSL *s) SSLerror(s, SSL_R_DATA_LENGTH_TOO_LONG); goto err; } - - /* Check we have enough room for signature algorithms and - * following length value. - */ if (!CBS_get_u16_length_prefixed(&cert_request, &sigalgs)) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); SSLerror(s, SSL_R_DATA_LENGTH_TOO_LONG); goto err; } - if (!tls1_process_sigalgs(s, &sigalgs)) { + if (CBS_len(&sigalgs) % 2 != 0 || CBS_len(&sigalgs) > 64) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); SSLerror(s, SSL_R_SIGNATURE_ALGORITHMS_ERROR); goto err; } + if (!CBS_stow(&sigalgs, &S3I(s)->hs.sigalgs, + &S3I(s)->hs.sigalgs_len)) + goto err; } /* get the CA RDNs */ @@ -1956,13 +2014,15 @@ ssl3_send_client_kex_dhe(SSL *s, SESS_CERT *sess_cert, CBB *cbb) SSLerror(s, ERR_R_DH_LIB); goto err; } - key_size = DH_size(dh_clnt); + if ((key_size = DH_size(dh_clnt)) <= 0) { + SSLerror(s, ERR_R_DH_LIB); + goto err; + } if ((key = malloc(key_size)) == NULL) { SSLerror(s, ERR_R_MALLOC_FAILURE); goto err; } - key_len = DH_compute_key(key, dh_srvr->pub_key, dh_clnt); - if (key_len <= 0) { + if ((key_len = DH_compute_key(key, dh_srvr->pub_key, dh_clnt)) <= 0) { SSLerror(s, ERR_R_DH_LIB); goto err; } @@ -2020,7 +2080,7 @@ ssl3_send_client_kex_ecdhe_ecp(SSL *s, SESS_CERT *sc, CBB *cbb) } /* Generate a new ECDH key pair. */ - if (!(EC_KEY_generate_key(ecdh))) { + if (!EC_KEY_generate_key(ecdh)) { SSLerror(s, ERR_R_ECDH_LIB); goto err; } @@ -2030,6 +2090,7 @@ ssl3_send_client_kex_ecdhe_ecp(SSL *s, SESS_CERT *sc, CBB *cbb) } if ((key = malloc(key_size)) == NULL) { SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; } key_len = ECDH_compute_key(key, key_size, point, ecdh, NULL); if (key_len <= 0) { @@ -2190,7 +2251,7 @@ ssl3_send_client_kex_gost(SSL *s, SESS_CERT *sess_cert, CBB *cbb) /* * Compute shared IV and store it in algorithm-specific context data. */ - ukm_hash = EVP_MD_CTX_create(); + ukm_hash = EVP_MD_CTX_new(); if (ukm_hash == NULL) { SSLerror(s, ERR_R_MALLOC_FAILURE); goto err; @@ -2205,7 +2266,7 @@ ssl3_send_client_kex_gost(SSL *s, SESS_CERT *sess_cert, CBB *cbb) EVP_DigestUpdate(ukm_hash, s->s3->client_random, SSL3_RANDOM_SIZE); EVP_DigestUpdate(ukm_hash, s->s3->server_random, SSL3_RANDOM_SIZE); EVP_DigestFinal_ex(ukm_hash, shared_ukm, &md_len); - EVP_MD_CTX_destroy(ukm_hash); + EVP_MD_CTX_free(ukm_hash); if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, EVP_PKEY_OP_ENCRYPT, EVP_PKEY_CTRL_SET_IV, 8, shared_ukm) < 0) { SSLerror(s, SSL_R_LIBRARY_BUG); @@ -2268,7 +2329,7 @@ ssl3_send_client_key_exchange(SSL *s) goto err; } - if (!ssl3_handshake_msg_start_cbb(s, &cbb, &kex, + if (!ssl3_handshake_msg_start(s, &cbb, &kex, SSL3_MT_CLIENT_KEY_EXCHANGE)) goto err; @@ -2291,7 +2352,7 @@ ssl3_send_client_key_exchange(SSL *s) goto err; } - if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) + if (!ssl3_handshake_msg_finish(s, &cbb)) goto err; S3I(s)->hs.state = SSL3_ST_CW_KEY_EXCH_B; @@ -2306,147 +2367,275 @@ ssl3_send_client_key_exchange(SSL *s) return (-1); } +static int +ssl3_send_client_verify_sigalgs(SSL *s, CBB *cert_verify) +{ + const struct ssl_sigalg *sigalg; + CBB cbb_signature; + EVP_PKEY_CTX *pctx = NULL; + EVP_PKEY *pkey; + EVP_MD_CTX mctx; + const EVP_MD *md; + const unsigned char *hdata; + unsigned char *signature = NULL; + size_t signature_len, hdata_len; + int ret = 0; + + EVP_MD_CTX_init(&mctx); + + pkey = s->cert->key->privatekey; + if ((sigalg = ssl_sigalg_select(s, pkey)) == NULL) { + SSLerror(s, SSL_R_SIGNATURE_ALGORITHMS_ERROR); + goto err; + } + if ((md = sigalg->md()) == NULL) { + SSLerror(s, SSL_R_UNKNOWN_DIGEST); + goto err; + } + + if (!tls1_transcript_data(s, &hdata, &hdata_len)) { + SSLerror(s, ERR_R_INTERNAL_ERROR); + goto err; + } + if (!EVP_DigestSignInit(&mctx, &pctx, md, NULL, pkey)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if ((sigalg->flags & SIGALG_FLAG_RSA_PSS) && + (!EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING) || + !EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, -1))) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (!EVP_DigestSignUpdate(&mctx, hdata, hdata_len)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (!EVP_DigestSignFinal(&mctx, NULL, &signature_len) || + signature_len == 0) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if ((signature = calloc(1, signature_len)) == NULL) { + SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!EVP_DigestSignFinal(&mctx, signature, &signature_len)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + + if (!CBB_add_u16(cert_verify, sigalg->value)) + goto err; + if (!CBB_add_u16_length_prefixed(cert_verify, &cbb_signature)) + goto err; + if (!CBB_add_bytes(&cbb_signature, signature, signature_len)) + goto err; + if (!CBB_flush(cert_verify)) + goto err; + + ret = 1; + + err: + EVP_MD_CTX_cleanup(&mctx); + free(signature); + return ret; +} + +static int +ssl3_send_client_verify_rsa(SSL *s, CBB *cert_verify) +{ + CBB cbb_signature; + EVP_PKEY *pkey; + unsigned char data[EVP_MAX_MD_SIZE]; + unsigned char *signature = NULL; + unsigned int signature_len; + size_t data_len; + int ret = 0; + + pkey = s->cert->key->privatekey; + + if (!tls1_transcript_hash_value(s, data, sizeof(data), &data_len)) + goto err; + if ((signature = calloc(1, EVP_PKEY_size(pkey))) == NULL) + goto err; + if (RSA_sign(NID_md5_sha1, data, data_len, signature, + &signature_len, pkey->pkey.rsa) <= 0 ) { + SSLerror(s, ERR_R_RSA_LIB); + goto err; + } + + if (!CBB_add_u16_length_prefixed(cert_verify, &cbb_signature)) + goto err; + if (!CBB_add_bytes(&cbb_signature, signature, signature_len)) + goto err; + if (!CBB_flush(cert_verify)) + goto err; + + ret = 1; + err: + free(signature); + return ret; +} + +static int +ssl3_send_client_verify_ec(SSL *s, CBB *cert_verify) +{ + CBB cbb_signature; + EVP_PKEY *pkey; + unsigned char data[EVP_MAX_MD_SIZE]; + unsigned char *signature = NULL; + unsigned int signature_len; + int ret = 0; + + pkey = s->cert->key->privatekey; + + if (!tls1_transcript_hash_value(s, data, sizeof(data), NULL)) + goto err; + if ((signature = calloc(1, EVP_PKEY_size(pkey))) == NULL) + goto err; + if (!ECDSA_sign(pkey->save_type, &data[MD5_DIGEST_LENGTH], + SHA_DIGEST_LENGTH, signature, &signature_len, pkey->pkey.ec)) { + SSLerror(s, ERR_R_ECDSA_LIB); + goto err; + } + + if (!CBB_add_u16_length_prefixed(cert_verify, &cbb_signature)) + goto err; + if (!CBB_add_bytes(&cbb_signature, signature, signature_len)) + goto err; + if (!CBB_flush(cert_verify)) + goto err; + + ret = 1; + err: + free(signature); + return ret; +} + +#ifndef OPENSSL_NO_GOST +static int +ssl3_send_client_verify_gost(SSL *s, CBB *cert_verify) +{ + CBB cbb_signature; + EVP_MD_CTX mctx; + EVP_PKEY_CTX *pctx; + EVP_PKEY *pkey; + const EVP_MD *md; + const unsigned char *hdata; + unsigned char *signature = NULL; + size_t signature_len; + size_t hdata_len; + int nid; + int ret = 0; + + EVP_MD_CTX_init(&mctx); + + pkey = s->cert->key->privatekey; + + if (!tls1_transcript_data(s, &hdata, &hdata_len)) { + SSLerror(s, ERR_R_INTERNAL_ERROR); + goto err; + } + if (!EVP_PKEY_get_default_digest_nid(pkey, &nid) || + (md = EVP_get_digestbynid(nid)) == NULL) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (!EVP_DigestSignInit(&mctx, &pctx, md, NULL, pkey)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_SIGN, + EVP_PKEY_CTRL_GOST_SIG_FORMAT, GOST_SIG_FORMAT_RS_LE, NULL) <= 0) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (!EVP_DigestSignUpdate(&mctx, hdata, hdata_len)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (!EVP_DigestSignFinal(&mctx, NULL, &signature_len) || + signature_len == 0) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if ((signature = calloc(1, signature_len)) == NULL) { + SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!EVP_DigestSignFinal(&mctx, signature, &signature_len)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + + if (!CBB_add_u16_length_prefixed(cert_verify, &cbb_signature)) + goto err; + if (!CBB_add_bytes(&cbb_signature, signature, signature_len)) + goto err; + if (!CBB_flush(cert_verify)) + goto err; + + ret = 1; + err: + EVP_MD_CTX_cleanup(&mctx); + free(signature); + return ret; +} +#endif + int ssl3_send_client_verify(SSL *s) { - unsigned char *p; - unsigned char data[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH]; - EVP_PKEY *pkey; - EVP_PKEY_CTX *pctx = NULL; - EVP_MD_CTX mctx; - unsigned u = 0; - unsigned long n; - int j; + CBB cbb, cert_verify; + EVP_PKEY *pkey; - EVP_MD_CTX_init(&mctx); + memset(&cbb, 0, sizeof(cbb)); if (S3I(s)->hs.state == SSL3_ST_CW_CERT_VRFY_A) { - p = ssl3_handshake_msg_start(s, SSL3_MT_CERTIFICATE_VERIFY); + if (!ssl3_handshake_msg_start(s, &cbb, &cert_verify, + SSL3_MT_CERTIFICATE_VERIFY)) + goto err; - /* - * Create context from key and test if sha1 is allowed as - * digest. - */ pkey = s->cert->key->privatekey; - pctx = EVP_PKEY_CTX_new(pkey, NULL); - EVP_PKEY_sign_init(pctx); - - /* XXX - is this needed? */ - if (EVP_PKEY_CTX_set_signature_md(pctx, EVP_sha1()) <= 0) - ERR_clear_error(); - - if (!SSL_USE_SIGALGS(s)) { - if (S3I(s)->handshake_buffer) { - if (!tls1_digest_cached_records(s)) - goto err; - } - if (!tls1_handshake_hash_value(s, data, sizeof(data), - NULL)) - goto err; - } /* * For TLS v1.2 send signature algorithm and signature * using agreed digest and cached handshake records. */ if (SSL_USE_SIGALGS(s)) { - long hdatalen = 0; - void *hdata; - const EVP_MD *md = s->cert->key->digest; - hdatalen = BIO_get_mem_data(S3I(s)->handshake_buffer, - &hdata); - if (hdatalen <= 0 || - !tls12_get_sigandhash(p, pkey, md)) { - SSLerror(s, ERR_R_INTERNAL_ERROR); - goto err; - } - p += 2; - if (!EVP_SignInit_ex(&mctx, md, NULL) || - !EVP_SignUpdate(&mctx, hdata, hdatalen) || - !EVP_SignFinal(&mctx, p + 2, &u, pkey)) { - SSLerror(s, ERR_R_EVP_LIB); - goto err; - } - s2n(u, p); - n = u + 4; - if (!tls1_digest_cached_records(s)) + if (!ssl3_send_client_verify_sigalgs(s, &cert_verify)) goto err; } else if (pkey->type == EVP_PKEY_RSA) { - if (RSA_sign(NID_md5_sha1, data, - MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, &(p[2]), - &u, pkey->pkey.rsa) <= 0 ) { - SSLerror(s, ERR_R_RSA_LIB); + if (!ssl3_send_client_verify_rsa(s, &cert_verify)) goto err; - } - s2n(u, p); - n = u + 2; } else if (pkey->type == EVP_PKEY_EC) { - if (!ECDSA_sign(pkey->save_type, - &(data[MD5_DIGEST_LENGTH]), - SHA_DIGEST_LENGTH, &(p[2]), - (unsigned int *)&j, pkey->pkey.ec)) { - SSLerror(s, ERR_R_ECDSA_LIB); + if (!ssl3_send_client_verify_ec(s, &cert_verify)) goto err; - } - s2n(j, p); - n = j + 2; #ifndef OPENSSL_NO_GOST } else if (pkey->type == NID_id_GostR3410_94 || - pkey->type == NID_id_GostR3410_2001) { - unsigned char signbuf[128]; - long hdatalen = 0; - void *hdata; - const EVP_MD *md; - int nid; - size_t sigsize; - - hdatalen = BIO_get_mem_data(S3I(s)->handshake_buffer, &hdata); - if (hdatalen <= 0) { - SSLerror(s, ERR_R_INTERNAL_ERROR); + pkey->type == NID_id_GostR3410_2001) { + if (!ssl3_send_client_verify_gost(s, &cert_verify)) goto err; - } - if (!EVP_PKEY_get_default_digest_nid(pkey, &nid) || - !(md = EVP_get_digestbynid(nid))) { - SSLerror(s, ERR_R_EVP_LIB); - goto err; - } - if (!EVP_DigestInit_ex(&mctx, md, NULL) || - !EVP_DigestUpdate(&mctx, hdata, hdatalen) || - !EVP_DigestFinal(&mctx, signbuf, &u) || - (EVP_PKEY_CTX_set_signature_md(pctx, md) <= 0) || - (EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_SIGN, - EVP_PKEY_CTRL_GOST_SIG_FORMAT, - GOST_SIG_FORMAT_RS_LE, - NULL) <= 0) || - (EVP_PKEY_sign(pctx, &(p[2]), &sigsize, - signbuf, u) <= 0)) { - SSLerror(s, ERR_R_EVP_LIB); - goto err; - } - if (!tls1_digest_cached_records(s)) - goto err; - j = sigsize; - s2n(j, p); - n = j + 2; #endif } else { SSLerror(s, ERR_R_INTERNAL_ERROR); goto err; } - S3I(s)->hs.state = SSL3_ST_CW_CERT_VRFY_B; + tls1_transcript_free(s); - ssl3_handshake_msg_finish(s, n); - } + if (!ssl3_handshake_msg_finish(s, &cbb)) + goto err; - EVP_MD_CTX_cleanup(&mctx); - EVP_PKEY_CTX_free(pctx); + S3I(s)->hs.state = SSL3_ST_CW_CERT_VRFY_B; + } return (ssl3_handshake_write(s)); -err: - EVP_MD_CTX_cleanup(&mctx); - EVP_PKEY_CTX_free(pctx); + err: + CBB_cleanup(&cbb); + return (-1); } @@ -2461,8 +2650,8 @@ ssl3_send_client_certificate(SSL *s) memset(&cbb, 0, sizeof(cbb)); if (S3I(s)->hs.state == SSL3_ST_CW_CERT_A) { - if ((s->cert == NULL) || (s->cert->key->x509 == NULL) || - (s->cert->key->privatekey == NULL)) + if (s->cert->key->x509 == NULL || + s->cert->key->privatekey == NULL) S3I(s)->hs.state = SSL3_ST_CW_CERT_B; else S3I(s)->hs.state = SSL3_ST_CW_CERT_C; @@ -2493,21 +2682,25 @@ ssl3_send_client_certificate(SSL *s) X509_free(x509); EVP_PKEY_free(pkey); - if (i == 0) + if (i == 0) { S3I(s)->tmp.cert_req = 2; + /* There is no client certificate to verify. */ + tls1_transcript_free(s); + } + /* Ok, we have a cert */ S3I(s)->hs.state = SSL3_ST_CW_CERT_C; } if (S3I(s)->hs.state == SSL3_ST_CW_CERT_C) { - if (!ssl3_handshake_msg_start_cbb(s, &cbb, &client_cert, + if (!ssl3_handshake_msg_start(s, &cbb, &client_cert, SSL3_MT_CERTIFICATE)) goto err; if (!ssl3_output_cert_chain(s, &client_cert, - (S3I(s)->tmp.cert_req == 2) ? NULL : s->cert->key->x509)) + (S3I(s)->tmp.cert_req == 2) ? NULL : s->cert->key)) goto err; - if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) + if (!ssl3_handshake_msg_finish(s, &cbb)) goto err; S3I(s)->hs.state = SSL3_ST_CW_CERT_D; diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c index db3c1a0d..250a9eef 100644 --- a/ssl/ssl_err.c +++ b/ssl/ssl_err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_err.c,v 1.35 2017/08/28 17:36:58 jsing Exp $ */ +/* $OpenBSD: ssl_err.c,v 1.36 2018/03/20 15:28:12 tb Exp $ */ /* ==================================================================== * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. * @@ -390,6 +390,7 @@ static ERR_STRING_DATA SSL_str_reasons[]= { {ERR_REASON(SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG), "ssl session id context too long"}, {ERR_REASON(SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH), "ssl session id has bad length"}, {ERR_REASON(SSL_R_SSL_SESSION_ID_IS_DIFFERENT), "ssl session id is different"}, + {ERR_REASON(SSL_R_SSL_SESSION_ID_TOO_LONG), "ssl session id is too long"}, {ERR_REASON(SSL_R_TLSV1_ALERT_ACCESS_DENIED), "tlsv1 alert access denied"}, {ERR_REASON(SSL_R_TLSV1_ALERT_DECODE_ERROR), "tlsv1 alert decode error"}, {ERR_REASON(SSL_R_TLSV1_ALERT_DECRYPTION_FAILED), "tlsv1 alert decryption failed"}, diff --git a/ssl/ssl_init.c b/ssl/ssl_init.c new file mode 100644 index 00000000..b521d22d --- /dev/null +++ b/ssl/ssl_init.c @@ -0,0 +1,51 @@ +/* $OpenBSD: ssl_init.c,v 1.2 2018/03/30 14:59:46 jsing Exp $ */ +/* + * Copyright (c) 2018 Bob Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* OpenSSL style init */ + +#include +#include + +#include + +#include "ssl_locl.h" + +static pthread_t ssl_init_thread; + +static void +OPENSSL_init_ssl_internal(void) +{ + ssl_init_thread = pthread_self(); + SSL_load_error_strings(); + SSL_library_init(); +} + +int +OPENSSL_init_ssl(uint64_t opts, const void *settings) +{ + static pthread_once_t once = PTHREAD_ONCE_INIT; + + if (pthread_equal(pthread_self(), ssl_init_thread)) + return 1; /* don't recurse */ + + OPENSSL_init_crypto(opts, settings); + + if (pthread_once(&once, OPENSSL_init_ssl_internal) != 0) + return 0; + + return 1; +} diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 471fd700..adcaa1b3 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.170 2017/08/30 16:24:21 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.204 2019/03/25 17:33:26 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -156,6 +156,7 @@ #endif #include "bytestring.h" +#include "ssl_sigalgs.h" const char *SSL_version_str = OPENSSL_VERSION_TEXT; @@ -191,9 +192,7 @@ SSL_clear(SSL *s) BUF_MEM_free(s->internal->init_buf); s->internal->init_buf = NULL; - ssl_clear_cipher_ctx(s); - ssl_clear_hash_ctx(&s->read_hash); - ssl_clear_hash_ctx(&s->internal->write_hash); + ssl_clear_cipher_state(s); s->internal->first_packet = 0; @@ -263,23 +262,8 @@ SSL_new(SSL_CTX *ctx) s->internal->mode = ctx->internal->mode; s->internal->max_cert_list = ctx->internal->max_cert_list; - if (ctx->internal->cert != NULL) { - /* - * Earlier library versions used to copy the pointer to - * the CERT, not its contents; only when setting new - * parameters for the per-SSL copy, ssl_cert_new would be - * called (and the direct reference to the per-SSL_CTX - * settings would be lost, but those still were indirectly - * accessed for various purposes, and for that reason they - * used to be known as s->ctx->default_cert). - * Now we don't look at the SSL_CTX's CERT after having - * duplicated it once. - */ - s->cert = ssl_cert_dup(ctx->internal->cert); - if (s->cert == NULL) - goto err; - } else - s->cert=NULL; /* Cannot really happen (see SSL_CTX_new) */ + if ((s->cert = ssl_cert_dup(ctx->internal->cert)) == NULL) + goto err; s->internal->read_ahead = ctx->internal->read_ahead; s->internal->msg_callback = ctx->internal->msg_callback; @@ -328,7 +312,7 @@ SSL_new(SSL_CTX *ctx) if (ctx->internal->tlsext_supportedgroups != NULL) { s->internal->tlsext_supportedgroups = calloc(ctx->internal->tlsext_supportedgroups_length, - sizeof(ctx->internal->tlsext_supportedgroups)); + sizeof(ctx->internal->tlsext_supportedgroups[0])); if (s->internal->tlsext_supportedgroups == NULL) goto err; memcpy(s->internal->tlsext_supportedgroups, @@ -469,12 +453,30 @@ SSL_set_trust(SSL *s, int trust) return (X509_VERIFY_PARAM_set_trust(s->param, trust)); } +int +SSL_set1_host(SSL *s, const char *hostname) +{ + return X509_VERIFY_PARAM_set1_host(s->param, hostname, 0); +} + +X509_VERIFY_PARAM * +SSL_CTX_get0_param(SSL_CTX *ctx) +{ + return (ctx->param); +} + int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm) { return (X509_VERIFY_PARAM_set1(ctx->param, vpm)); } +X509_VERIFY_PARAM * +SSL_get0_param(SSL *ssl) +{ + return (ssl->param); +} + int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm) { @@ -522,9 +524,7 @@ SSL_free(SSL *s) SSL_SESSION_free(s->session); } - ssl_clear_cipher_ctx(s); - ssl_clear_hash_ctx(&s->read_hash); - ssl_clear_hash_ctx(&s->internal->write_hash); + ssl_clear_cipher_state(s); ssl_cert_free(s->cert); @@ -556,6 +556,13 @@ SSL_free(SSL *s) free(s); } +int +SSL_up_ref(SSL *s) +{ + int refs = CRYPTO_add(&s->references, 1, CRYPTO_LOCK_SSL); + return (refs > 1) ? 1 : 0; +} + void SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio) { @@ -746,7 +753,8 @@ SSL_CTX_get_verify_depth(const SSL_CTX *ctx) return (X509_VERIFY_PARAM_get_depth(ctx->param)); } -int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int, X509_STORE_CTX *) +int +(*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int, X509_STORE_CTX *) { return (ctx->internal->default_verify_callback); } @@ -789,7 +797,7 @@ SSL_pending(const SSL *s) * (Note that SSL_pending() is often used as a boolean value, * so we'd better not return -1.) */ - return (s->method->internal->ssl_pending(s)); + return (ssl3_pending(s)); } X509 * @@ -833,22 +841,21 @@ SSL_get_peer_cert_chain(const SSL *s) * Now in theory, since the calling process own 't' it should be safe to * modify. We need to be able to read f without being hassled */ -void +int SSL_copy_session_id(SSL *t, const SSL *f) { CERT *tmp; - /* Do we need to to SSL locking? */ - SSL_set_session(t, SSL_get_session(f)); + /* Do we need to do SSL locking? */ + if (!SSL_set_session(t, SSL_get_session(f))) + return 0; - /* - * What if we are setup as SSLv2 but want to talk SSLv3 or - * vice-versa. - */ + /* What if we are set up for one protocol but want to talk another? */ if (t->method != f->method) { - t->method->internal->ssl_free(t); /* cleanup current */ - t->method = f->method; /* change method */ - t->method->internal->ssl_new(t); /* setup new */ + t->method->internal->ssl_free(t); + t->method = f->method; + if (!t->method->internal->ssl_new(t)) + return 0; } tmp = t->cert; @@ -858,7 +865,11 @@ SSL_copy_session_id(SSL *t, const SSL *f) } else t->cert = NULL; ssl_cert_free(tmp); - SSL_set_session_id_context(t, f->sid_ctx, f->sid_ctx_length); + + if (!SSL_set_session_id_context(t, f->sid_ctx, f->sid_ctx_length)) + return 0; + + return 1; } /* Fix this so it checks all the valid key/cert options */ @@ -920,6 +931,12 @@ SSL_connect(SSL *s) return (s->method->internal->ssl_connect(s)); } +int +SSL_is_server(const SSL *s) +{ + return s->server; +} + long SSL_get_default_timeout(const SSL *s) { @@ -938,7 +955,7 @@ SSL_read(SSL *s, void *buf, int num) s->internal->rwstate = SSL_NOTHING; return (0); } - return (s->method->internal->ssl_read(s, buf, num)); + return ssl3_read(s, buf, num); } int @@ -952,7 +969,7 @@ SSL_peek(SSL *s, void *buf, int num) if (s->internal->shutdown & SSL_RECEIVED_SHUTDOWN) { return (0); } - return (s->method->internal->ssl_peek(s, buf, num)); + return ssl3_peek(s, buf, num); } int @@ -968,7 +985,7 @@ SSL_write(SSL *s, const void *buf, int num) SSLerror(s, SSL_R_PROTOCOL_IS_SHUTDOWN); return (-1); } - return (s->method->internal->ssl_write(s, buf, num)); + return ssl3_write(s, buf, num); } int @@ -986,10 +1003,10 @@ SSL_shutdown(SSL *s) return (-1); } - if ((s != NULL) && !SSL_in_init(s)) - return (s->method->internal->ssl_shutdown(s)); - else - return (1); + if (s != NULL && !SSL_in_init(s)) + return (ssl3_shutdown(s)); + + return (1); } int @@ -1238,6 +1255,48 @@ SSL_get_ciphers(const SSL *s) return (NULL); } +STACK_OF(SSL_CIPHER) * +SSL_get_client_ciphers(const SSL *s) +{ + if (s == NULL || s->session == NULL || !s->server) + return NULL; + return s->session->ciphers; +} + +STACK_OF(SSL_CIPHER) * +SSL_get1_supported_ciphers(SSL *s) +{ + STACK_OF(SSL_CIPHER) *supported_ciphers = NULL, *ciphers; + const SSL_CIPHER *cipher; + uint16_t min_vers, max_vers; + int i; + + if (s == NULL) + return NULL; + if (!ssl_supported_version_range(s, &min_vers, &max_vers)) + return NULL; + if ((ciphers = SSL_get_ciphers(s)) == NULL) + return NULL; + if ((supported_ciphers = sk_SSL_CIPHER_new_null()) == NULL) + return NULL; + + for (i = 0; i < sk_SSL_CIPHER_num(ciphers); i++) { + if ((cipher = sk_SSL_CIPHER_value(ciphers, i)) == NULL) + goto err; + if (!ssl_cipher_is_permitted(cipher, min_vers, max_vers)) + continue; + if (!sk_SSL_CIPHER_push(supported_ciphers, cipher)) + goto err; + } + + if (sk_SSL_CIPHER_num(supported_ciphers) > 0) + return supported_ciphers; + + err: + sk_SSL_CIPHER_free(supported_ciphers); + return NULL; +} + /* * Return a STACK of the ciphers available for the SSL and in order of * algorithm id. @@ -1301,6 +1360,12 @@ SSL_get_cipher_list(const SSL *s, int n) return (c->name); } +STACK_OF(SSL_CIPHER) * +SSL_CTX_get_ciphers(const SSL_CTX *ctx) +{ + return ctx->cipher_list; +} + /* Specify the ciphers to be used by default by the SSL_CTX. */ int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) @@ -1379,139 +1444,6 @@ SSL_get_shared_ciphers(const SSL *s, char *buf, int len) return (buf); } -int -ssl_cipher_list_to_bytes(SSL *s, STACK_OF(SSL_CIPHER) *sk, unsigned char *p, - size_t maxlen, size_t *outlen) -{ - SSL_CIPHER *cipher; - int ciphers = 0; - CBB cbb; - int i; - - *outlen = 0; - - if (sk == NULL) - return (0); - - if (!CBB_init_fixed(&cbb, p, maxlen)) - goto err; - - for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) { - cipher = sk_SSL_CIPHER_value(sk, i); - - /* Skip TLS v1.2 only ciphersuites if lower than v1.2 */ - if ((cipher->algorithm_ssl & SSL_TLSV1_2) && - (TLS1_get_client_version(s) < TLS1_2_VERSION)) - continue; - - if (!CBB_add_u16(&cbb, ssl3_cipher_get_value(cipher))) - goto err; - - ciphers++; - } - - /* Add SCSV if there are other ciphers and we're not renegotiating. */ - if (ciphers > 0 && !s->internal->renegotiate) { - if (!CBB_add_u16(&cbb, SSL3_CK_SCSV & SSL3_CK_VALUE_MASK)) - goto err; - } - - if (!CBB_finish(&cbb, NULL, outlen)) - goto err; - - return 1; - - err: - CBB_cleanup(&cbb); - - return 0; -} - -STACK_OF(SSL_CIPHER) * -ssl_bytes_to_cipher_list(SSL *s, const unsigned char *p, int num) -{ - CBS cbs; - const SSL_CIPHER *c; - STACK_OF(SSL_CIPHER) *sk = NULL; - unsigned long cipher_id; - uint16_t cipher_value, max_version; - - if (s->s3) - S3I(s)->send_connection_binding = 0; - - /* - * RFC 5246 section 7.4.1.2 defines the interval as [2,2^16-2]. - */ - if (num < 2 || num > 0x10000 - 2) { - SSLerror(s, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST); - return (NULL); - } - - if ((sk = sk_SSL_CIPHER_new_null()) == NULL) { - SSLerror(s, ERR_R_MALLOC_FAILURE); - goto err; - } - - CBS_init(&cbs, p, num); - while (CBS_len(&cbs) > 0) { - if (!CBS_get_u16(&cbs, &cipher_value)) { - SSLerror(s, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST); - goto err; - } - - cipher_id = SSL3_CK_ID | cipher_value; - - if (s->s3 != NULL && cipher_id == SSL3_CK_SCSV) { - /* - * TLS_EMPTY_RENEGOTIATION_INFO_SCSV is fatal if - * renegotiating. - */ - if (s->internal->renegotiate) { - SSLerror(s, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING); - ssl3_send_alert(s, SSL3_AL_FATAL, - SSL_AD_HANDSHAKE_FAILURE); - - goto err; - } - S3I(s)->send_connection_binding = 1; - continue; - } - - if (cipher_id == SSL3_CK_FALLBACK_SCSV) { - /* - * TLS_FALLBACK_SCSV indicates that the client - * previously tried a higher protocol version. - * Fail if the current version is an unexpected - * downgrade. - */ - max_version = ssl_max_server_version(s); - if (max_version == 0 || s->version < max_version) { - SSLerror(s, SSL_R_INAPPROPRIATE_FALLBACK); - if (s->s3 != NULL) - ssl3_send_alert(s, SSL3_AL_FATAL, - SSL_AD_INAPPROPRIATE_FALLBACK); - goto err; - } - continue; - } - - if ((c = ssl3_get_cipher_by_value(cipher_value)) != NULL) { - if (!sk_SSL_CIPHER_push(sk, c)) { - SSLerror(s, ERR_R_MALLOC_FAILURE); - goto err; - } - } - } - - return (sk); - -err: - sk_SSL_CIPHER_free(sk); - - return (NULL); -} - - /* * Return a servername extension value if provided in Client Hello, or NULL. * So far, only host_name types are defined (RFC 3546). @@ -1780,6 +1712,11 @@ SSL_CTX_new(const SSL_METHOD *meth) { SSL_CTX *ret; + if (!OPENSSL_init_ssl(0, NULL)) { + SSLerrorx(SSL_R_LIBRARY_BUG); + return (NULL); + } + if (meth == NULL) { SSLerrorx(SSL_R_NULL_SSL_METHOD_PASSED); return (NULL); @@ -1835,6 +1772,7 @@ SSL_CTX_new(const SSL_METHOD *meth) ret->verify_mode = SSL_VERIFY_NONE; ret->sid_ctx_length = 0; ret->internal->default_verify_callback = NULL; + if ((ret->internal->cert = ssl_cert_new()) == NULL) goto err; @@ -1960,8 +1898,7 @@ SSL_CTX_free(SSL_CTX *ctx) #endif #ifndef OPENSSL_NO_ENGINE - if (ctx->internal->client_cert_engine) - ENGINE_finish(ctx->internal->client_cert_engine); + ENGINE_finish(ctx->internal->client_cert_engine); #endif free(ctx->internal->tlsext_ecpointformatlist); @@ -1973,12 +1910,31 @@ SSL_CTX_free(SSL_CTX *ctx) free(ctx); } +int +SSL_CTX_up_ref(SSL_CTX *ctx) +{ + int refs = CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX); + return ((refs > 1) ? 1 : 0); +} + +pem_password_cb * +SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx) +{ + return (ctx->default_passwd_callback); +} + void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb) { ctx->default_passwd_callback = cb; } +void * +SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx) +{ + return ctx->default_passwd_callback_userdata; +} + void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u) { @@ -2137,20 +2093,12 @@ ssl_get_server_send_pkey(const SSL *s) return (c->pkeys + i); } -X509 * -ssl_get_server_send_cert(const SSL *s) -{ - CERT_PKEY *cpk; - - cpk = ssl_get_server_send_pkey(s); - if (!cpk) - return (NULL); - return (cpk->x509); -} - EVP_PKEY * -ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, const EVP_MD **pmd) +ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, const EVP_MD **pmd, + const struct ssl_sigalg **sap) { + const struct ssl_sigalg *sigalg = NULL; + EVP_PKEY *pkey = NULL; unsigned long alg_a; CERT *c; int idx = -1; @@ -2170,9 +2118,16 @@ ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, const EVP_MD **pmd) SSLerror(s, ERR_R_INTERNAL_ERROR); return (NULL); } - if (pmd) - *pmd = c->pkeys[idx].digest; - return (c->pkeys[idx].privatekey); + + pkey = c->pkeys[idx].privatekey; + if ((sigalg = ssl_sigalg_select(s, pkey)) == NULL) { + SSLerror(s, SSL_R_SIGNATURE_ALGORITHMS_ERROR); + return (NULL); + } + *pmd = sigalg->md(); + *sap = sigalg; + + return (pkey); } DH * @@ -2394,10 +2349,7 @@ SSL_set_accept_state(SSL *s) s->internal->shutdown = 0; S3I(s)->hs.state = SSL_ST_ACCEPT|SSL_ST_BEFORE; s->internal->handshake_func = s->method->internal->ssl_accept; - /* clear the current cipher */ - ssl_clear_cipher_ctx(s); - ssl_clear_hash_ctx(&s->read_hash); - ssl_clear_hash_ctx(&s->internal->write_hash); + ssl_clear_cipher_state(s); } void @@ -2407,10 +2359,7 @@ SSL_set_connect_state(SSL *s) s->internal->shutdown = 0; S3I(s)->hs.state = SSL_ST_CONNECT|SSL_ST_BEFORE; s->internal->handshake_func = s->method->internal->ssl_connect; - /* clear the current cipher */ - ssl_clear_cipher_ctx(s); - ssl_clear_hash_ctx(&s->read_hash); - ssl_clear_hash_ctx(&s->internal->write_hash); + ssl_clear_cipher_state(s); } int @@ -2446,6 +2395,8 @@ ssl_version_string(int ver) return (SSL_TXT_TLSV1_1); case TLS1_2_VERSION: return (SSL_TXT_TLSV1_2); + case TLS1_3_VERSION: + return (SSL_TXT_TLSV1_3); default: return ("unknown"); } @@ -2466,15 +2417,15 @@ SSL_dup(SSL *s) int i; if ((ret = SSL_new(SSL_get_SSL_CTX(s))) == NULL) - return (NULL); + goto err; ret->version = s->version; ret->internal->type = s->internal->type; ret->method = s->method; if (s->session != NULL) { - /* This copies session-id, SSL_METHOD, sid_ctx, and 'cert' */ - SSL_copy_session_id(ret, s); + if (!SSL_copy_session_id(ret, s)) + goto err; } else { /* * No session has been established yet, so we have to expect @@ -2487,15 +2438,13 @@ SSL_dup(SSL *s) ret->method = s->method; ret->method->internal->ssl_new(ret); - if (s->cert != NULL) { - ssl_cert_free(ret->cert); - ret->cert = ssl_cert_dup(s->cert); - if (ret->cert == NULL) - goto err; - } + ssl_cert_free(ret->cert); + if ((ret->cert = ssl_cert_dup(s->cert)) == NULL) + goto err; - SSL_set_session_id_context(ret, - s->sid_ctx, s->sid_ctx_length); + if (!SSL_set_session_id_context(ret, s->sid_ctx, + s->sid_ctx_length)) + goto err; } ret->internal->options = s->internal->options; @@ -2578,54 +2527,61 @@ SSL_dup(SSL *s) } } - if (0) { -err: - if (ret != NULL) - SSL_free(ret); - ret = NULL; - } - return (ret); + return ret; + err: + SSL_free(ret); + return NULL; +} + +void +ssl_clear_cipher_state(SSL *s) +{ + ssl_clear_cipher_read_state(s); + ssl_clear_cipher_write_state(s); } void -ssl_clear_cipher_ctx(SSL *s) +ssl_clear_cipher_read_state(SSL *s) { EVP_CIPHER_CTX_free(s->enc_read_ctx); s->enc_read_ctx = NULL; - EVP_CIPHER_CTX_free(s->internal->enc_write_ctx); - s->internal->enc_write_ctx = NULL; + EVP_MD_CTX_free(s->read_hash); + s->read_hash = NULL; if (s->internal->aead_read_ctx != NULL) { EVP_AEAD_CTX_cleanup(&s->internal->aead_read_ctx->ctx); free(s->internal->aead_read_ctx); s->internal->aead_read_ctx = NULL; } +} + +void +ssl_clear_cipher_write_state(SSL *s) +{ + EVP_CIPHER_CTX_free(s->internal->enc_write_ctx); + s->internal->enc_write_ctx = NULL; + EVP_MD_CTX_free(s->internal->write_hash); + s->internal->write_hash = NULL; + if (s->internal->aead_write_ctx != NULL) { EVP_AEAD_CTX_cleanup(&s->internal->aead_write_ctx->ctx); free(s->internal->aead_write_ctx); s->internal->aead_write_ctx = NULL; } - } /* Fix this function so that it takes an optional type parameter */ X509 * SSL_get_certificate(const SSL *s) { - if (s->cert != NULL) - return (s->cert->key->x509); - else - return (NULL); + return (s->cert->key->x509); } /* Fix this function so that it takes an optional type parameter */ EVP_PKEY * -SSL_get_privatekey(SSL *s) +SSL_get_privatekey(const SSL *s) { - if (s->cert != NULL) - return (s->cert->key->privatekey); - else - return (NULL); + return (s->cert->key->privatekey); } const SSL_CIPHER * @@ -2647,6 +2603,38 @@ SSL_get_current_expansion(SSL *s) return (NULL); } +size_t +SSL_get_client_random(const SSL *s, unsigned char *out, size_t max_out) +{ + size_t len = sizeof(s->s3->client_random); + + if (out == NULL) + return len; + + if (len > max_out) + len = max_out; + + memcpy(out, s->s3->client_random, len); + + return len; +} + +size_t +SSL_get_server_random(const SSL *s, unsigned char *out, size_t max_out) +{ + size_t len = sizeof(s->s3->server_random); + + if (out == NULL) + return len; + + if (len > max_out) + len = max_out; + + memcpy(out, s->s3->server_random, len); + + return len; +} + int ssl_init_wbio_buffer(SSL *s, int push) { @@ -2746,20 +2734,14 @@ SSL_get_SSL_CTX(const SSL *ssl) SSL_CTX * SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx) { - CERT *ocert = ssl->cert; - if (ssl->ctx == ctx) return (ssl->ctx); if (ctx == NULL) ctx = ssl->initial_ctx; + + ssl_cert_free(ssl->cert); ssl->cert = ssl_cert_dup(ctx->internal->cert); - if (ocert != NULL) { - int i; - /* Copy negotiated digests from original certificate. */ - for (i = 0; i < SSL_PKEY_NUM; i++) - ssl->cert->pkeys[i].digest = ocert->pkeys[i].digest; - ssl_cert_free(ocert); - } + CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX); SSL_CTX_free(ssl->ctx); /* decrement reference count */ ssl->ctx = ctx; @@ -2879,6 +2861,15 @@ SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store) ctx->cert_store = store; } +X509 * +SSL_CTX_get0_certificate(const SSL_CTX *ctx) +{ + if (ctx->internal->cert == NULL) + return NULL; + + return ctx->internal->cert->key->x509; +} + int SSL_want(const SSL *s) { @@ -2944,14 +2935,6 @@ SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, SSL_callback_ctrl(ssl, SSL_CTRL_SET_MSG_CALLBACK, (void (*)(void))cb); } -void -ssl_clear_hash_ctx(EVP_MD_CTX **hash) -{ - if (*hash) - EVP_MD_CTX_destroy(*hash); - *hash = NULL; -} - void SSL_set_debug(SSL *s, int debug) { @@ -2964,6 +2947,12 @@ SSL_cache_hit(SSL *s) return (s->internal->hit); } +int +SSL_CTX_get_min_proto_version(SSL_CTX *ctx) +{ + return ctx->internal->min_version; +} + int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) { @@ -2971,6 +2960,12 @@ SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) ctx->internal->max_version, &ctx->internal->min_version); } +int +SSL_CTX_get_max_proto_version(SSL_CTX *ctx) +{ + return ctx->internal->max_version; +} + int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) { @@ -2978,12 +2973,23 @@ SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) ctx->internal->min_version, &ctx->internal->max_version); } +int +SSL_get_min_proto_version(SSL *ssl) +{ + return ssl->internal->min_version; +} + int SSL_set_min_proto_version(SSL *ssl, uint16_t version) { return ssl_version_set_min(ssl->method, version, ssl->internal->max_version, &ssl->internal->min_version); } +int +SSL_get_max_proto_version(SSL *ssl) +{ + return ssl->internal->max_version; +} int SSL_set_max_proto_version(SSL *ssl, uint16_t version) diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 17a4a0d4..31f3e608 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_locl.h,v 1.193 2017/08/28 16:37:04 jsing Exp $ */ +/* $OpenBSD: ssl_locl.h,v 1.245 2019/04/04 16:44:24 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -161,9 +161,14 @@ #include #include "bytestring.h" +#include "ssl_sigalgs.h" +#include "tls13_internal.h" __BEGIN_HIDDEN_DECLS +#define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \ + __attribute__((__unused__)) + #define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \ *((c)++)=(unsigned char)(((l)>>16)&0xff), \ *((c)++)=(unsigned char)(((l)>> 8)&0xff), \ @@ -178,15 +183,9 @@ __BEGIN_HIDDEN_DECLS *((c)++)=(unsigned char)(((l)>> 8)&0xff), \ *((c)++)=(unsigned char)(((l) )&0xff)) -#define n2s(c,s) ((s=(((unsigned int)(c[0]))<< 8)| \ - (((unsigned int)(c[1])) )),c+=2) #define s2n(s,c) ((c[0]=(unsigned char)(((s)>> 8)&0xff), \ c[1]=(unsigned char)(((s) )&0xff)),c+=2) -#define l2n3(l,c) ((c[0]=(unsigned char)(((l)>>16)&0xff), \ - c[1]=(unsigned char)(((l)>> 8)&0xff), \ - c[2]=(unsigned char)(((l) )&0xff)),c+=3) - /* LOCAL STUFF */ #define SSL_DECRYPT 0 @@ -211,6 +210,7 @@ __BEGIN_HIDDEN_DECLS #define SSL_kDHE 0x00000008L /* tmp DH key no DH cert */ #define SSL_kECDHE 0x00000080L /* ephemeral ECDH */ #define SSL_kGOST 0x00000200L /* GOST key exchange */ +#define SSL_kTLS1_3 0x00000400L /* TLSv1.3 key exchange */ /* Bits for algorithm_auth (server authentication) */ #define SSL_aRSA 0x00000001L /* RSA auth */ @@ -218,6 +218,7 @@ __BEGIN_HIDDEN_DECLS #define SSL_aNULL 0x00000004L /* no auth (i.e. use ADH or AECDH) */ #define SSL_aECDSA 0x00000040L /* ECDSA auth*/ #define SSL_aGOST01 0x00000200L /* GOST R 34.10-2001 signature auth */ +#define SSL_aTLS1_3 0x00000400L /* TLSv1.3 authentication */ /* Bits for algorithm_enc (symmetric encryption) */ #define SSL_DES 0x00000001L @@ -254,6 +255,7 @@ __BEGIN_HIDDEN_DECLS #define SSL_SSLV3 0x00000002L #define SSL_TLSV1 SSL_SSLV3 /* for now */ #define SSL_TLSV1_2 0x00000004L +#define SSL_TLSV1_3 0x00000008L /* Bits for algorithm2 (handshake digests and other extra flags) */ @@ -267,10 +269,6 @@ __BEGIN_HIDDEN_DECLS #define SSL_HANDSHAKE_MAC_STREEBOG256 0x200 #define SSL_HANDSHAKE_MAC_DEFAULT (SSL_HANDSHAKE_MAC_MD5 | SSL_HANDSHAKE_MAC_SHA) -/* When adding new digest in the ssl_ciph.c and increment SSM_MD_NUM_IDX - * make sure to update this constant too */ -#define SSL_MAX_DIGEST 7 - #define SSL3_CK_ID 0x03000000 #define SSL3_CK_VALUE_MASK 0x0000ffff @@ -285,8 +283,10 @@ __BEGIN_HIDDEN_DECLS #define TLS1_PRF_STREEBOG256 (SSL_HANDSHAKE_MAC_STREEBOG256 << TLS1_PRF_DGST_SHIFT) #define TLS1_PRF (TLS1_PRF_MD5 | TLS1_PRF_SHA1) -/* Stream MAC for GOST ciphersuites from cryptopro draft - * (currently this also goes into algorithm2) */ +/* + * Stream MAC for GOST ciphersuites from cryptopro draft + * (currently this also goes into algorithm2). + */ #define TLS1_STREAM_MAC 0x04 /* @@ -296,15 +296,9 @@ __BEGIN_HIDDEN_DECLS */ #define SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD (1 << 22) -/* - * SSL_CIPHER_ALGORITHM2_AEAD is an algorithm2 flag that indicates the cipher - * is implemented via an EVP_AEAD. - */ -#define SSL_CIPHER_ALGORITHM2_AEAD (1 << 23) - /* * SSL_CIPHER_AEAD_FIXED_NONCE_LEN returns the number of bytes of fixed nonce - * for an SSL_CIPHER with the SSL_CIPHER_ALGORITHM2_AEAD flag. + * for an SSL_CIPHER with an algorithm_mac of SSL_AEAD. */ #define SSL_CIPHER_AEAD_FIXED_NONCE_LEN(ssl_cipher) \ (((ssl_cipher->algorithm2 >> 24) & 0xf) * 2) @@ -382,10 +376,6 @@ typedef struct ssl_method_internal_st { int (*ssl_accept)(SSL *s); int (*ssl_connect)(SSL *s); - int (*ssl_read)(SSL *s, void *buf, int len); - int (*ssl_peek)(SSL *s, void *buf, int len); - int (*ssl_write)(SSL *s, const void *buf, int len); - int (*ssl_shutdown)(SSL *s); int (*ssl_renegotiate)(SSL *s); int (*ssl_renegotiate_check)(SSL *s); @@ -396,7 +386,6 @@ typedef struct ssl_method_internal_st { int len, int peek); int (*ssl_write_bytes)(SSL *s, int type, const void *buf_, int len); - int (*ssl_pending)(const SSL *s); const struct ssl_method_st *(*get_ssl_method)(int version); long (*get_timeout)(void); @@ -440,8 +429,38 @@ typedef struct ssl_handshake_st { /* key_block is the record-layer key block for TLS 1.2 and earlier. */ int key_block_len; unsigned char *key_block; + + /* Extensions seen in this handshake. */ + uint32_t extensions_seen; + + /* sigalgs offered in this handshake in wire form */ + size_t sigalgs_len; + uint8_t *sigalgs; } SSL_HANDSHAKE; +typedef struct ssl_handshake_tls13_st { + uint16_t min_version; + uint16_t max_version; + uint16_t version; + + /* Version proposed by peer server. */ + uint16_t server_version; + + /* X25519 key share. */ + uint8_t *x25519_public; + uint8_t *x25519_private; + uint8_t *x25519_peer_public; + + struct tls13_secrets *secrets; + + uint8_t *cookie; + size_t cookie_len; + + /* Preserved transcript hash. */ + uint8_t transcript_hash[EVP_MAX_MD_SIZE]; + size_t transcript_hash_len; +} SSL_HANDSHAKE_TLS13; + typedef struct ssl_ctx_internal_st { uint16_t min_version; uint16_t max_version; @@ -460,7 +479,7 @@ typedef struct ssl_ctx_internal_st { int (*new_session_cb)(struct ssl_st *ssl, SSL_SESSION *sess); void (*remove_session_cb)(struct ssl_ctx_st *ctx, SSL_SESSION *sess); SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, - unsigned char *data, int len, int *copy); + const unsigned char *data, int len, int *copy); /* if defined, these override the X509_verify_cert() calls */ int (*app_verify_callback)(X509_STORE_CTX *, void *); @@ -474,7 +493,7 @@ typedef struct ssl_ctx_internal_st { unsigned int *cookie_len); /* verify cookie callback */ - int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, + int (*app_verify_cookie_cb)(SSL *ssl, const unsigned char *cookie, unsigned int cookie_len); void (*info_callback)(const SSL *ssl,int type,int val); /* used if SSL's info_callback is NULL */ @@ -604,6 +623,8 @@ typedef struct ssl_ctx_internal_st { } SSL_CTX_INTERNAL; typedef struct ssl_internal_st { + struct tls13_ctx *tls13; + uint16_t min_version; uint16_t max_version; @@ -757,8 +778,6 @@ typedef struct ssl_internal_st { } SSL_INTERNAL; typedef struct ssl3_state_internal_st { - int delay_buf_pop_ret; - unsigned char read_sequence[SSL3_SEQUENCE_SIZE]; int read_mac_secret_size; unsigned char read_mac_secret[EVP_MAX_MD_SIZE]; @@ -766,6 +785,14 @@ typedef struct ssl3_state_internal_st { int write_mac_secret_size; unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; + SSL3_BUFFER rbuf; /* read IO goes into here */ + SSL3_BUFFER wbuf; /* write IO goes into here */ + + /* we allow one fatal and one warning alert to be outstanding, + * send close alert via the warning alert */ + int alert_dispatch; + unsigned char send_alert[2]; + /* flags for countermeasure against known-IV weakness */ int need_empty_fragments; int empty_fragment_done; @@ -787,8 +814,8 @@ typedef struct ssl3_state_internal_st { int wpend_ret; /* number of bytes submitted */ const unsigned char *wpend_buf; - /* used during startup, digest all incoming/outgoing packets */ - BIO *handshake_buffer; + /* Transcript of handshake messages that have been sent and received. */ + BUF_MEM *handshake_transcript; /* Rolling hash of handshake messages. */ EVP_MD_CTX *handshake_hash; @@ -809,8 +836,11 @@ typedef struct ssl3_state_internal_st { int in_read_app_data; SSL_HANDSHAKE hs; + SSL_HANDSHAKE_TLS13 hs_tls13; struct { + int new_mac_secret_size; + /* actually only needs to be 16+20 */ unsigned char cert_verify_md[EVP_MAX_MD_SIZE*2]; @@ -935,8 +965,7 @@ typedef struct dtls1_state_internal_st { typedef struct cert_pkey_st { X509 *x509; EVP_PKEY *privatekey; - /* Digest to use when signing */ - const EVP_MD *digest; + STACK_OF(X509) *chain; } CERT_PKEY; typedef struct cert_st { @@ -955,8 +984,6 @@ typedef struct cert_st { DH *(*dh_tmp_cb)(SSL *ssl, int is_export, int keysize); int dh_tmp_auto; - EC_KEY *ecdh_tmp; - CERT_PKEY pkeys[SSL_PKEY_NUM]; int references; /* >1 only if SSL_copy_session_id is used */ @@ -1038,6 +1065,10 @@ int ssl_version_set_min(const SSL_METHOD *meth, uint16_t ver, uint16_t max_ver, int ssl_version_set_max(const SSL_METHOD *meth, uint16_t ver, uint16_t min_ver, uint16_t *out_ver); uint16_t ssl_max_server_version(SSL *s); +int ssl_cipher_is_permitted(const SSL_CIPHER *cipher, uint16_t min_ver, + uint16_t max_ver); + +const SSL_METHOD *tls_legacy_client_method(void); const SSL_METHOD *dtls1_get_client_method(int ver); const SSL_METHOD *dtls1_get_server_method(int ver); @@ -1049,25 +1080,31 @@ extern SSL3_ENC_METHOD TLSv1_enc_data; extern SSL3_ENC_METHOD TLSv1_1_enc_data; extern SSL3_ENC_METHOD TLSv1_2_enc_data; -void ssl_clear_cipher_ctx(SSL *s); +void ssl_clear_cipher_state(SSL *s); +void ssl_clear_cipher_read_state(SSL *s); +void ssl_clear_cipher_write_state(SSL *s); int ssl_clear_bad_session(SSL *s); + CERT *ssl_cert_new(void); CERT *ssl_cert_dup(CERT *cert); -int ssl_cert_inst(CERT **o); void ssl_cert_free(CERT *c); +int ssl_cert_set0_chain(CERT *c, STACK_OF(X509) *chain); +int ssl_cert_set1_chain(CERT *c, STACK_OF(X509) *chain); +int ssl_cert_add0_chain_cert(CERT *c, X509 *cert); +int ssl_cert_add1_chain_cert(CERT *c, X509 *cert); + SESS_CERT *ssl_sess_cert_new(void); void ssl_sess_cert_free(SESS_CERT *sc); int ssl_get_new_session(SSL *s, int session); -int ssl_get_prev_session(SSL *s, unsigned char *session, int len, - const unsigned char *limit); +int ssl_get_prev_session(SSL *s, const unsigned char *session_id, + int session_id_len, CBS *ext_block); int ssl_cipher_id_cmp(const SSL_CIPHER *a, const SSL_CIPHER *b); -SSL_CIPHER *OBJ_bsearch_ssl_cipher_id(SSL_CIPHER *key, SSL_CIPHER const *base, int num); +SSL_CIPHER *OBJ_bsearch_ssl_cipher_id(SSL_CIPHER *key, SSL_CIPHER const *base, + int num); int ssl_cipher_ptr_id_cmp(const SSL_CIPHER * const *ap, const SSL_CIPHER * const *bp); -STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s, const unsigned char *p, - int num); -int ssl_cipher_list_to_bytes(SSL *s, STACK_OF(SSL_CIPHER) *sk, - unsigned char *p, size_t maxlen, size_t *outlen); +int ssl_cipher_list_to_bytes(SSL *s, STACK_OF(SSL_CIPHER) *ciphers, CBB *cbb); +STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s, CBS *cbs); STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *meth, STACK_OF(SSL_CIPHER) **pref, STACK_OF(SSL_CIPHER) **sorted, const char *rule_str); @@ -1082,15 +1119,16 @@ int ssl_undefined_function(SSL *s); int ssl_undefined_void_function(void); int ssl_undefined_const_function(const SSL *s); CERT_PKEY *ssl_get_server_send_pkey(const SSL *s); -X509 *ssl_get_server_send_cert(const SSL *); -EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *c, const EVP_MD **pmd); +EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *c, const EVP_MD **pmd, + const struct ssl_sigalg **sap); DH *ssl_get_auto_dh(SSL *s); int ssl_cert_type(X509 *x, EVP_PKEY *pkey); void ssl_set_cert_masks(CERT *c, const SSL_CIPHER *cipher); STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL *s); int ssl_has_ecc_ciphers(SSL *s); int ssl_verify_alarm_type(long type); -void ssl_load_ciphers(void); + +int SSL_SESSION_ticket(SSL_SESSION *ss, unsigned char **out, size_t *out_len); const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p); int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p); @@ -1116,7 +1154,7 @@ int ssl3_renegotiate_check(SSL *ssl); int ssl3_dispatch_alert(SSL *s); int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek); int ssl3_write_bytes(SSL *s, int type, const void *buf, int len); -int ssl3_output_cert_chain(SSL *s, CBB *cbb, X509 *x); +int ssl3_output_cert_chain(SSL *s, CBB *cbb, CERT_PKEY *cpk); SSL_CIPHER *ssl3_choose_cipher(SSL *ssl, STACK_OF(SSL_CIPHER) *clnt, STACK_OF(SSL_CIPHER) *srvr); int ssl3_setup_buffers(SSL *s); @@ -1141,21 +1179,15 @@ long ssl3_ctx_callback_ctrl(SSL_CTX *s, int cmd, void (*fp)(void)); int ssl3_pending(const SSL *s); int ssl3_handshake_msg_hdr_len(SSL *s); -unsigned char *ssl3_handshake_msg_start(SSL *s, uint8_t htype); -void ssl3_handshake_msg_finish(SSL *s, unsigned int len); -int ssl3_handshake_msg_start_cbb(SSL *s, CBB *handshake, CBB *body, +int ssl3_handshake_msg_start(SSL *s, CBB *handshake, CBB *body, uint8_t msg_type); -int ssl3_handshake_msg_finish_cbb(SSL *s, CBB *handshake); +int ssl3_handshake_msg_finish(SSL *s, CBB *handshake); int ssl3_handshake_write(SSL *s); +int ssl3_record_write(SSL *s, int type); void tls1_record_sequence_increment(unsigned char *seq); int ssl3_do_change_cipher_spec(SSL *ssl); -int ssl23_read(SSL *s, void *buf, int len); -int ssl23_peek(SSL *s, void *buf, int len); -int ssl23_write(SSL *s, const void *buf, int len); -long ssl23_default_timeout(void); - long tls1_default_timeout(void); int dtls1_do_write(SSL *s, int type); int ssl3_packet_read(SSL *s, int plen); @@ -1166,12 +1198,13 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, unsigned int len); void dtls1_set_message_header(SSL *s, unsigned char mt, unsigned long len, unsigned long frag_off, unsigned long frag_len); +void dtls1_set_message_header_int(SSL *s, unsigned char mt, + unsigned long len, unsigned short seq_num, unsigned long frag_off, + unsigned long frag_len); int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf, int len); int dtls1_write_bytes(SSL *s, int type, const void *buf, int len); -int dtls1_send_change_cipher_spec(SSL *s, int a, int b); -unsigned long dtls1_output_cert_chain(SSL *s, X509 *x); int dtls1_read_failed(SSL *s, int code); int dtls1_buffer_message(SSL *s, int ccs); int dtls1_retransmit_message(SSL *s, unsigned short seq, @@ -1197,7 +1230,8 @@ void dtls1_double_timeout(SSL *s); unsigned int dtls1_min_mtu(void); /* some client-only functions */ -int ssl3_client_hello(SSL *s); +int dtls1_get_hello_verify(SSL *s); +int ssl3_send_client_hello(SSL *s); int ssl3_get_server_hello(SSL *s); int ssl3_get_certificate_request(SSL *s); int ssl3_get_new_session_ticket(SSL *s); @@ -1213,6 +1247,7 @@ int ssl3_check_cert_and_algorithm(SSL *s); int ssl3_check_finished(SSL *s); /* some server-only functions */ +int dtls1_send_hello_verify_request(SSL *s); int ssl3_get_client_hello(SSL *s); int ssl3_send_server_hello(SSL *s); int ssl3_send_hello_request(SSL *s); @@ -1223,22 +1258,14 @@ int ssl3_get_client_certificate(SSL *s); int ssl3_get_client_key_exchange(SSL *s); int ssl3_get_cert_verify(SSL *s); -int ssl23_accept(SSL *s); -int ssl23_connect(SSL *s); -int ssl23_read_bytes(SSL *s, int n); -int ssl23_write_bytes(SSL *s); - int tls1_new(SSL *s); void tls1_free(SSL *s); void tls1_clear(SSL *s); int dtls1_new(SSL *s); -int dtls1_accept(SSL *s); -int dtls1_connect(SSL *s); void dtls1_free(SSL *s); void dtls1_clear(SSL *s); long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg); -int dtls1_shutdown(SSL *s); long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok); int dtls1_get_record(SSL *s); @@ -1248,17 +1275,21 @@ int dtls1_enc(SSL *s, int snd); int ssl_init_wbio_buffer(SSL *s, int push); void ssl_free_wbio_buffer(SSL *s); -int tls1_handshake_hash_init(SSL *s); -int tls1_handshake_hash_update(SSL *s, const unsigned char *buf, size_t len); -int tls1_handshake_hash_value(SSL *s, const unsigned char *out, size_t len, +int tls1_transcript_hash_init(SSL *s); +int tls1_transcript_hash_update(SSL *s, const unsigned char *buf, size_t len); +int tls1_transcript_hash_value(SSL *s, const unsigned char *out, size_t len, size_t *outlen); -void tls1_handshake_hash_free(SSL *s); +void tls1_transcript_hash_free(SSL *s); + +int tls1_transcript_init(SSL *s); +void tls1_transcript_free(SSL *s); +void tls1_transcript_reset(SSL *s); +int tls1_transcript_append(SSL *s, const unsigned char *buf, size_t len); +int tls1_transcript_data(SSL *s, const unsigned char **data, size_t *len); +void tls1_transcript_freeze(SSL *s); +int tls1_transcript_record(SSL *s, const unsigned char *buf, size_t len); -int tls1_init_finished_mac(SSL *s); -int tls1_finish_mac(SSL *s, const unsigned char *buf, int len); -void tls1_free_digest_list(SSL *s); void tls1_cleanup_key_block(SSL *s); -int tls1_digest_cached_records(SSL *s); int tls1_change_cipher_state(SSL *s, int which); int tls1_setup_key_block(SSL *s); int tls1_enc(SSL *s, int snd); @@ -1275,24 +1306,21 @@ int ssl_ok(SSL *s); int ssl_using_ecc_cipher(SSL *s); int ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL *s); +void tls1_get_formatlist(SSL *s, int client_formats, const uint8_t **pformats, + size_t *pformatslen); +void tls1_get_group_list(SSL *s, int client_groups, const uint16_t **pgroups, + size_t *pgroupslen); + int tls1_set_groups(uint16_t **out_group_ids, size_t *out_group_ids_len, const int *groups, size_t ngroups); -int tls1_set_groups_list(uint16_t **out_group_ids, size_t *out_group_ids_len, +int tls1_set_group_list(uint16_t **out_group_ids, size_t *out_group_ids_len, const char *groups); int tls1_ec_curve_id2nid(const uint16_t curve_id); uint16_t tls1_ec_nid2curve_id(const int nid); -int tls1_check_curve(SSL *s, const uint16_t curve_id); +int tls1_check_curve(SSL *s, const uint16_t group_id); int tls1_get_shared_curve(SSL *s); -unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, - unsigned char *limit); - -unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, - unsigned char *limit); - -int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **data, - unsigned char *d, int n, int *al); int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **data, size_t n, int *al); int ssl_check_clienthello_tlsext_early(SSL *s); @@ -1300,21 +1328,12 @@ int ssl_check_clienthello_tlsext_late(SSL *s); int ssl_check_serverhello_tlsext(SSL *s); #define tlsext_tick_md EVP_sha256 -int tls1_process_ticket(SSL *s, const unsigned char *session_id, int len, - const unsigned char *limit, SSL_SESSION **ret); -int tls12_get_sigandhash(unsigned char *p, const EVP_PKEY *pk, - const EVP_MD *md); -int tls12_get_sigid(const EVP_PKEY *pk); -const EVP_MD *tls12_get_hash(unsigned char hash_alg); - -void ssl_clear_hash_ctx(EVP_MD_CTX **hash); +int tls1_process_ticket(SSL *s, const unsigned char *session_id, + int session_id_len, CBS *ext_block, SSL_SESSION **ret); + long ssl_get_algorithm2(SSL *s); -int tls1_process_sigalgs(SSL *s, CBS *cbs); -void tls12_get_req_sig_algs(SSL *s, unsigned char **sigalgs, - size_t *sigalgs_len); int tls1_check_ec_server_key(SSL *s); -int tls1_check_ec_tmp_key(SSL *s); int ssl_add_clienthello_use_srtp_ext(SSL *s, unsigned char *p, int *len, int maxlen); @@ -1342,11 +1361,6 @@ int SSL_state_func_code(int _state); #define SSLerrorx(r) ERR_PUT_error(ERR_LIB_SSL,(0xfff),(r),__FILE__,__LINE__) void SSL_error_internal(const SSL *s, int r, char *f, int l); -void tls1_get_formatlist(SSL *s, int client_formats, const uint8_t **pformats, - size_t *pformatslen); -void tls1_get_curvelist(SSL *s, int client_curves, const uint16_t **pcurves, - size_t *pcurveslen); - #ifndef OPENSSL_NO_SRTP int srtp_find_profile_by_name(char *profile_name, diff --git a/ssl/ssl_methods.c b/ssl/ssl_methods.c new file mode 100644 index 00000000..df99d98c --- /dev/null +++ b/ssl/ssl_methods.c @@ -0,0 +1,726 @@ +/* $OpenBSD: ssl_methods.c,v 1.4 2019/03/17 17:28:08 jsing Exp $ */ +/* 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.] + */ + +#include "ssl_locl.h" +#include "tls13_internal.h" + +static const SSL_METHOD_INTERNAL DTLSv1_client_method_internal_data = { + .version = DTLS1_VERSION, + .min_version = DTLS1_VERSION, + .max_version = DTLS1_VERSION, + .ssl_new = dtls1_new, + .ssl_clear = dtls1_clear, + .ssl_free = dtls1_free, + .ssl_accept = ssl_undefined_function, + .ssl_connect = ssl3_connect, + .get_ssl_method = dtls1_get_client_method, + .get_timeout = dtls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = dtls1_get_message, + .ssl_read_bytes = dtls1_read_bytes, + .ssl_write_bytes = dtls1_write_app_data_bytes, + .ssl3_enc = &DTLSv1_enc_data, +}; + +static const SSL_METHOD DTLSv1_client_method_data = { + .ssl_dispatch_alert = dtls1_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = dtls1_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &DTLSv1_client_method_internal_data, +}; + +const SSL_METHOD * +DTLSv1_client_method(void) +{ + return &DTLSv1_client_method_data; +} + +const SSL_METHOD * +DTLS_client_method(void) +{ + return DTLSv1_client_method(); +} + +const SSL_METHOD * +dtls1_get_client_method(int ver) +{ + if (ver == DTLS1_VERSION) + return (DTLSv1_client_method()); + return (NULL); +} + +static const SSL_METHOD *dtls1_get_method(int ver); + +static const SSL_METHOD_INTERNAL DTLSv1_method_internal_data = { + .version = DTLS1_VERSION, + .min_version = DTLS1_VERSION, + .max_version = DTLS1_VERSION, + .ssl_new = dtls1_new, + .ssl_clear = dtls1_clear, + .ssl_free = dtls1_free, + .ssl_accept = ssl3_accept, + .ssl_connect = ssl3_connect, + .get_ssl_method = dtls1_get_method, + .get_timeout = dtls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = dtls1_get_message, + .ssl_read_bytes = dtls1_read_bytes, + .ssl_write_bytes = dtls1_write_app_data_bytes, + .ssl3_enc = &DTLSv1_enc_data, +}; + +static const SSL_METHOD DTLSv1_method_data = { + .ssl_dispatch_alert = dtls1_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = dtls1_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &DTLSv1_method_internal_data, +}; + +const SSL_METHOD * +DTLSv1_method(void) +{ + return &DTLSv1_method_data; +} + +const SSL_METHOD * +DTLS_method(void) +{ + return DTLSv1_method(); +} + +static const SSL_METHOD * +dtls1_get_method(int ver) +{ + if (ver == DTLS1_VERSION) + return (DTLSv1_method()); + return (NULL); +} + +static const SSL_METHOD_INTERNAL DTLSv1_server_method_internal_data = { + .version = DTLS1_VERSION, + .min_version = DTLS1_VERSION, + .max_version = DTLS1_VERSION, + .ssl_new = dtls1_new, + .ssl_clear = dtls1_clear, + .ssl_free = dtls1_free, + .ssl_accept = ssl3_accept, + .ssl_connect = ssl_undefined_function, + .get_ssl_method = dtls1_get_server_method, + .get_timeout = dtls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = dtls1_get_message, + .ssl_read_bytes = dtls1_read_bytes, + .ssl_write_bytes = dtls1_write_app_data_bytes, + .ssl3_enc = &DTLSv1_enc_data, +}; + +static const SSL_METHOD DTLSv1_server_method_data = { + .ssl_dispatch_alert = dtls1_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = dtls1_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &DTLSv1_server_method_internal_data, +}; + +const SSL_METHOD * +DTLSv1_server_method(void) +{ + return &DTLSv1_server_method_data; +} + +const SSL_METHOD * +DTLS_server_method(void) +{ + return DTLSv1_server_method(); +} + +const SSL_METHOD * +dtls1_get_server_method(int ver) +{ + if (ver == DTLS1_VERSION) + return (DTLSv1_server_method()); + return (NULL); +} + +#ifdef LIBRESSL_HAS_TLS1_3 +static const SSL_METHOD_INTERNAL TLS_client_method_internal_data = { + .version = TLS1_3_VERSION, + .min_version = TLS1_VERSION, + .max_version = TLS1_3_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl_undefined_function, + .ssl_connect = tls13_legacy_connect, + .get_ssl_method = tls1_get_client_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl_undefined_function, + .ssl_renegotiate_check = ssl_ok, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = tls13_legacy_read_bytes, + .ssl_write_bytes = tls13_legacy_write_bytes, + .ssl3_enc = &TLSv1_2_enc_data, +}; + +static const SSL_METHOD TLS_client_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLS_client_method_internal_data, +}; +#endif + +static const SSL_METHOD_INTERNAL TLS_legacy_client_method_internal_data = { + .version = TLS1_2_VERSION, + .min_version = TLS1_VERSION, + .max_version = TLS1_2_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl_undefined_function, + .ssl_connect = ssl3_connect, + .get_ssl_method = tls1_get_client_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl_undefined_function, + .ssl_renegotiate_check = ssl_ok, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_2_enc_data, +}; + +static const SSL_METHOD TLS_legacy_client_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLS_legacy_client_method_internal_data, +}; + +static const SSL_METHOD_INTERNAL TLSv1_client_method_internal_data = { + .version = TLS1_VERSION, + .min_version = TLS1_VERSION, + .max_version = TLS1_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl_undefined_function, + .ssl_connect = ssl3_connect, + .get_ssl_method = tls1_get_client_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_enc_data, +}; + +static const SSL_METHOD TLSv1_client_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLSv1_client_method_internal_data, +}; + +static const SSL_METHOD_INTERNAL TLSv1_1_client_method_internal_data = { + .version = TLS1_1_VERSION, + .min_version = TLS1_1_VERSION, + .max_version = TLS1_1_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl_undefined_function, + .ssl_connect = ssl3_connect, + .get_ssl_method = tls1_get_client_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_1_enc_data, +}; + +static const SSL_METHOD TLSv1_1_client_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLSv1_1_client_method_internal_data, +}; + +static const SSL_METHOD_INTERNAL TLSv1_2_client_method_internal_data = { + .version = TLS1_2_VERSION, + .min_version = TLS1_2_VERSION, + .max_version = TLS1_2_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl_undefined_function, + .ssl_connect = ssl3_connect, + .get_ssl_method = tls1_get_client_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_2_enc_data, +}; + +static const SSL_METHOD TLSv1_2_client_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLSv1_2_client_method_internal_data, +}; + +const SSL_METHOD * +tls1_get_client_method(int ver) +{ + if (ver == TLS1_2_VERSION) + return (TLSv1_2_client_method()); + if (ver == TLS1_1_VERSION) + return (TLSv1_1_client_method()); + if (ver == TLS1_VERSION) + return (TLSv1_client_method()); + return (NULL); +} + +const SSL_METHOD * +SSLv23_client_method(void) +{ + return (TLS_client_method()); +} + +const SSL_METHOD * +TLS_client_method(void) +{ +#ifdef LIBRESSL_HAS_TLS1_3 + return (&TLS_client_method_data); +#else + return tls_legacy_client_method(); +#endif +} + +const SSL_METHOD * +tls_legacy_client_method(void) +{ + return (&TLS_legacy_client_method_data); +} + +const SSL_METHOD * +TLSv1_client_method(void) +{ + return (&TLSv1_client_method_data); +} + +const SSL_METHOD * +TLSv1_1_client_method(void) +{ + return (&TLSv1_1_client_method_data); +} + +const SSL_METHOD * +TLSv1_2_client_method(void) +{ + return (&TLSv1_2_client_method_data); +} + +static const SSL_METHOD *tls1_get_method(int ver); + +static const SSL_METHOD_INTERNAL TLS_method_internal_data = { + .version = TLS1_2_VERSION, + .min_version = TLS1_VERSION, + .max_version = TLS1_2_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl3_accept, + .ssl_connect = ssl3_connect, + .get_ssl_method = tls1_get_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl_undefined_function, + .ssl_renegotiate_check = ssl_ok, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_2_enc_data, +}; + +static const SSL_METHOD TLS_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLS_method_internal_data, +}; + +static const SSL_METHOD_INTERNAL TLSv1_method_internal_data = { + .version = TLS1_VERSION, + .min_version = TLS1_VERSION, + .max_version = TLS1_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl3_accept, + .ssl_connect = ssl3_connect, + .get_ssl_method = tls1_get_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_enc_data, +}; + +static const SSL_METHOD TLSv1_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLSv1_method_internal_data, +}; + +static const SSL_METHOD_INTERNAL TLSv1_1_method_internal_data = { + .version = TLS1_1_VERSION, + .min_version = TLS1_1_VERSION, + .max_version = TLS1_1_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl3_accept, + .ssl_connect = ssl3_connect, + .get_ssl_method = tls1_get_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_1_enc_data, +}; + +static const SSL_METHOD TLSv1_1_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLSv1_1_method_internal_data, +}; + +static const SSL_METHOD_INTERNAL TLSv1_2_method_internal_data = { + .version = TLS1_2_VERSION, + .min_version = TLS1_2_VERSION, + .max_version = TLS1_2_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl3_accept, + .ssl_connect = ssl3_connect, + .get_ssl_method = tls1_get_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_2_enc_data, +}; + +static const SSL_METHOD TLSv1_2_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLSv1_2_method_internal_data, +}; + +static const SSL_METHOD * +tls1_get_method(int ver) +{ + if (ver == TLS1_2_VERSION) + return (TLSv1_2_method()); + if (ver == TLS1_1_VERSION) + return (TLSv1_1_method()); + if (ver == TLS1_VERSION) + return (TLSv1_method()); + return (NULL); +} + +const SSL_METHOD * +SSLv23_method(void) +{ + return (TLS_method()); +} + +const SSL_METHOD * +TLS_method(void) +{ + return &TLS_method_data; +} + +const SSL_METHOD * +TLSv1_method(void) +{ + return (&TLSv1_method_data); +} + +const SSL_METHOD * +TLSv1_1_method(void) +{ + return (&TLSv1_1_method_data); +} + +const SSL_METHOD * +TLSv1_2_method(void) +{ + return (&TLSv1_2_method_data); +} + +static const SSL_METHOD_INTERNAL TLS_server_method_internal_data = { + .version = TLS1_2_VERSION, + .min_version = TLS1_VERSION, + .max_version = TLS1_2_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl3_accept, + .ssl_connect = ssl_undefined_function, + .get_ssl_method = tls1_get_server_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl_undefined_function, + .ssl_renegotiate_check = ssl_ok, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_2_enc_data, +}; + +static const SSL_METHOD TLS_server_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLS_server_method_internal_data, +}; + +static const SSL_METHOD_INTERNAL TLSv1_server_method_internal_data = { + .version = TLS1_VERSION, + .min_version = TLS1_VERSION, + .max_version = TLS1_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl3_accept, + .ssl_connect = ssl_undefined_function, + .get_ssl_method = tls1_get_server_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_enc_data, +}; + +static const SSL_METHOD TLSv1_server_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLSv1_server_method_internal_data, +}; + +static const SSL_METHOD_INTERNAL TLSv1_1_server_method_internal_data = { + .version = TLS1_1_VERSION, + .min_version = TLS1_1_VERSION, + .max_version = TLS1_1_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl3_accept, + .ssl_connect = ssl_undefined_function, + .get_ssl_method = tls1_get_server_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_1_enc_data, +}; + +static const SSL_METHOD TLSv1_1_server_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLSv1_1_server_method_internal_data, +}; + +static const SSL_METHOD_INTERNAL TLSv1_2_server_method_internal_data = { + .version = TLS1_2_VERSION, + .min_version = TLS1_2_VERSION, + .max_version = TLS1_2_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl3_accept, + .ssl_connect = ssl_undefined_function, + .get_ssl_method = tls1_get_server_method, + .get_timeout = tls1_default_timeout, + .ssl_version = ssl_undefined_void_function, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = ssl3_get_message, + .ssl_read_bytes = ssl3_read_bytes, + .ssl_write_bytes = ssl3_write_bytes, + .ssl3_enc = &TLSv1_2_enc_data, +}; + +static const SSL_METHOD TLSv1_2_server_method_data = { + .ssl_dispatch_alert = ssl3_dispatch_alert, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = ssl3_get_cipher, + .get_cipher_by_char = ssl3_get_cipher_by_char, + .put_cipher_by_char = ssl3_put_cipher_by_char, + .internal = &TLSv1_2_server_method_internal_data, +}; + +const SSL_METHOD * +tls1_get_server_method(int ver) +{ + if (ver == TLS1_2_VERSION) + return (TLSv1_2_server_method()); + if (ver == TLS1_1_VERSION) + return (TLSv1_1_server_method()); + if (ver == TLS1_VERSION) + return (TLSv1_server_method()); + return (NULL); +} + +const SSL_METHOD * +SSLv23_server_method(void) +{ + return (TLS_server_method()); +} + +const SSL_METHOD * +TLS_server_method(void) +{ + return (&TLS_server_method_data); +} + +const SSL_METHOD * +TLSv1_server_method(void) +{ + return (&TLSv1_server_method_data); +} + +const SSL_METHOD * +TLSv1_1_server_method(void) +{ + return (&TLSv1_1_server_method_data); +} + +const SSL_METHOD * +TLSv1_2_server_method(void) +{ + return (&TLSv1_2_server_method_data); +} diff --git a/ssl/ssl_packet.c b/ssl/ssl_packet.c index 5556ffb9..d8fb409d 100644 --- a/ssl/ssl_packet.c +++ b/ssl/ssl_packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_packet.c,v 1.6 2017/05/06 16:18:36 jsing Exp $ */ +/* $OpenBSD: ssl_packet.c,v 1.8 2018/11/08 22:28:52 jsing Exp $ */ /* * Copyright (c) 2016, 2017 Joel Sing * @@ -120,7 +120,7 @@ ssl_convert_sslv2_client_hello(SSL *s) if (n != record_length + 2) return n; - tls1_finish_mac(s, s->internal->packet + 2, + tls1_transcript_record(s, s->internal->packet + 2, s->internal->packet_length - 2); s->internal->mac_packet = 0; @@ -210,10 +210,10 @@ ssl_convert_sslv2_client_hello(SSL *s) if (!CBB_finish(&cbb, &data, &data_len)) goto err; - if (data_len > s->s3->rbuf.len) + if (data_len > S3I(s)->rbuf.len) goto err; - s->internal->packet = s->s3->rbuf.buf; + s->internal->packet = S3I(s)->rbuf.buf; s->internal->packet_length = data_len; memcpy(s->internal->packet, data, data_len); ret = 1; diff --git a/ssl/ssl_pkt.c b/ssl/ssl_pkt.c index 163b0292..2a0dd68a 100644 --- a/ssl/ssl_pkt.c +++ b/ssl/ssl_pkt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_pkt.c,v 1.12 2017/05/07 04:22:24 beck Exp $ */ +/* $OpenBSD: ssl_pkt.c,v 1.16 2019/03/19 16:53:03 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -141,7 +141,7 @@ ssl_force_want_read(SSL *s) /* * If extend == 0, obtain new n-byte packet; if extend == 1, increase * packet by another n bytes. - * The packet will be in the sub-array of s->s3->rbuf.buf specified + * The packet will be in the sub-array of S3I(s)->rbuf.buf specified * by s->internal->packet and s->internal->packet_length. * (If s->internal->read_ahead is set, 'max' bytes may be stored in rbuf * [plus s->internal->packet_length bytes if extend == 1].) @@ -157,7 +157,7 @@ ssl3_read_n(SSL *s, int n, int max, int extend) if (n <= 0) return n; - rb = &(s->s3->rbuf); + rb = &(S3I(s)->rbuf); if (rb->buf == NULL) if (!ssl3_setup_read_buffer(s)) return -1; @@ -239,7 +239,7 @@ ssl3_read_n(SSL *s, int n, int max, int extend) } while (left < n) { - /* Now we have len+left bytes at the front of s->s3->rbuf.buf + /* Now we have len+left bytes at the front of S3I(s)->rbuf.buf * and need to read in more until we have len+n (up to * len+max if possible) */ @@ -288,7 +288,7 @@ ssl3_packet_read(SSL *s, int plen) { int n; - n = ssl3_read_n(s, plen, s->s3->rbuf.len, 0); + n = ssl3_read_n(s, plen, S3I(s)->rbuf.len, 0); if (n <= 0) return n; if (s->internal->packet_length < plen) @@ -387,7 +387,7 @@ ssl3_get_record(SSL *s) goto err; } - if (rr->length > s->s3->rbuf.len - SSL3_RT_HEADER_LENGTH) { + if (rr->length > S3I(s)->rbuf.len - SSL3_RT_HEADER_LENGTH) { al = SSL_AD_RECORD_OVERFLOW; SSLerror(s, SSL_R_PACKET_LENGTH_TOO_LONG); goto f_err; @@ -629,7 +629,7 @@ do_ssl3_write(SSL *s, int type, const unsigned char *buf, int eivlen; size_t align; SSL3_RECORD *wr; - SSL3_BUFFER *wb = &(s->s3->wbuf); + SSL3_BUFFER *wb = &(S3I(s)->wbuf); SSL_SESSION *sess; if (wb->buf == NULL) @@ -642,7 +642,7 @@ do_ssl3_write(SSL *s, int type, const unsigned char *buf, return (ssl3_write_pending(s, type, buf, len)); /* If we have an alert to send, lets send it */ - if (s->s3->alert_dispatch) { + if (S3I(s)->alert_dispatch) { i = s->method->ssl_dispatch_alert(s); if (i <= 0) return (i); @@ -739,6 +739,7 @@ do_ssl3_write(SSL *s, int type, const unsigned char *buf, p += 2; /* Explicit IV length. */ + eivlen = 0; if (s->internal->enc_write_ctx && SSL_USE_EXPLICIT_IV(s)) { int mode = EVP_CIPHER_CTX_mode(s->internal->enc_write_ctx); if (mode == EVP_CIPH_CBC_MODE) { @@ -746,16 +747,10 @@ do_ssl3_write(SSL *s, int type, const unsigned char *buf, if (eivlen <= 1) eivlen = 0; } - /* Need explicit part of IV for GCM mode */ - else if (mode == EVP_CIPH_GCM_MODE) - eivlen = EVP_GCM_TLS_EXPLICIT_IV_LEN; - else - eivlen = 0; } else if (s->internal->aead_write_ctx != NULL && s->internal->aead_write_ctx->variable_nonce_in_record) { eivlen = s->internal->aead_write_ctx->variable_nonce_len; - } else - eivlen = 0; + } /* lets setup the record stuff. */ wr->data = p + eivlen; @@ -823,12 +818,12 @@ do_ssl3_write(SSL *s, int type, const unsigned char *buf, return -1; } -/* if s->s3->wbuf.left != 0, we need to call this */ +/* if S3I(s)->wbuf.left != 0, we need to call this */ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, unsigned int len) { int i; - SSL3_BUFFER *wb = &(s->s3->wbuf); + SSL3_BUFFER *wb = &(S3I(s)->wbuf); /* XXXX */ if ((S3I(s)->wpend_tot > (int)len) || ((S3I(s)->wpend_buf != buf) && @@ -906,7 +901,7 @@ ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) unsigned int n; SSL3_RECORD *rr; - if (s->s3->rbuf.buf == NULL) /* Not initialized yet */ + if (S3I(s)->rbuf.buf == NULL) /* Not initialized yet */ if (!ssl3_setup_read_buffer(s)) return (-1); @@ -1036,7 +1031,7 @@ ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) s->internal->rstate = SSL_ST_READ_HEADER; rr->off = 0; if (s->internal->mode & SSL_MODE_RELEASE_BUFFERS && - s->s3->rbuf.left == 0) + S3I(s)->rbuf.left == 0) ssl3_release_read_buffer(s); } } @@ -1120,7 +1115,7 @@ ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) } if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { - if (s->s3->rbuf.left == 0) { + if (S3I(s)->rbuf.left == 0) { /* no read-ahead left? */ /* In the case where we try to read application data, * but we trigger an SSL handshake, we return -1 with @@ -1281,7 +1276,7 @@ ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) } if (!(s->internal->mode & SSL_MODE_AUTO_RETRY)) { - if (s->s3->rbuf.left == 0) { /* no read-ahead left? */ + if (S3I(s)->rbuf.left == 0) { /* no read-ahead left? */ /* In the case where we try to read application data, * but we trigger an SSL handshake, we return -1 with * the retry option set. Otherwise renegotiation may @@ -1408,10 +1403,10 @@ ssl3_send_alert(SSL *s, int level, int desc) if ((level == 2) && (s->session != NULL)) SSL_CTX_remove_session(s->ctx, s->session); - s->s3->alert_dispatch = 1; - s->s3->send_alert[0] = level; - s->s3->send_alert[1] = desc; - if (s->s3->wbuf.left == 0) /* data still being written out? */ + S3I(s)->alert_dispatch = 1; + S3I(s)->send_alert[0] = level; + S3I(s)->send_alert[1] = desc; + if (S3I(s)->wbuf.left == 0) /* data still being written out? */ return s->method->ssl_dispatch_alert(s); /* else data is still being written out, we will get written @@ -1425,20 +1420,20 @@ ssl3_dispatch_alert(SSL *s) int i, j; void (*cb)(const SSL *ssl, int type, int val) = NULL; - s->s3->alert_dispatch = 0; - i = do_ssl3_write(s, SSL3_RT_ALERT, &s->s3->send_alert[0], 2, 0); + S3I(s)->alert_dispatch = 0; + i = do_ssl3_write(s, SSL3_RT_ALERT, &S3I(s)->send_alert[0], 2, 0); if (i <= 0) { - s->s3->alert_dispatch = 1; + S3I(s)->alert_dispatch = 1; } else { /* Alert sent to BIO. If it is important, flush it now. * If the message does not get sent due to non-blocking IO, * we will not worry too much. */ - if (s->s3->send_alert[0] == SSL3_AL_FATAL) + if (S3I(s)->send_alert[0] == SSL3_AL_FATAL) (void)BIO_flush(s->wbio); if (s->internal->msg_callback) s->internal->msg_callback(1, s->version, SSL3_RT_ALERT, - s->s3->send_alert, 2, s, s->internal->msg_callback_arg); + S3I(s)->send_alert, 2, s, s->internal->msg_callback_arg); if (s->internal->info_callback != NULL) cb = s->internal->info_callback; @@ -1446,7 +1441,7 @@ ssl3_dispatch_alert(SSL *s) cb = s->ctx->internal->info_callback; if (cb != NULL) { - j = (s->s3->send_alert[0]<<8)|s->s3->send_alert[1]; + j = (S3I(s)->send_alert[0]<<8)|S3I(s)->send_alert[1]; cb(s, SSL_CB_WRITE_ALERT, j); } } diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c index e99ce1e3..0936c0bd 100644 --- a/ssl/ssl_rsa.c +++ b/ssl/ssl_rsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_rsa.c,v 1.28 2017/02/07 02:08:38 beck Exp $ */ +/* $OpenBSD: ssl_rsa.c,v 1.31 2019/03/25 16:46:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -77,10 +77,6 @@ SSL_use_certificate(SSL *ssl, X509 *x) SSLerror(ssl, ERR_R_PASSED_NULL_PARAMETER); return (0); } - if (!ssl_cert_inst(&ssl->cert)) { - SSLerror(ssl, ERR_R_MALLOC_FAILURE); - return (0); - } return (ssl_set_cert(ssl->cert, x)); } @@ -133,7 +129,7 @@ SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len) X509 *x; int ret; - x = d2i_X509(NULL, &d,(long)len); + x = d2i_X509(NULL, &d, (long)len); if (x == NULL) { SSLerror(ssl, ERR_R_ASN1_LIB); return (0); @@ -154,10 +150,6 @@ SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa) SSLerror(ssl, ERR_R_PASSED_NULL_PARAMETER); return (0); } - if (!ssl_cert_inst(&ssl->cert)) { - SSLerror(ssl, ERR_R_MALLOC_FAILURE); - return (0); - } if ((pkey = EVP_PKEY_new()) == NULL) { SSLerror(ssl, ERR_R_EVP_LIB); return (0); @@ -254,14 +246,12 @@ SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type) } int -SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len) +SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const unsigned char *d, long len) { int ret; - const unsigned char *p; RSA *rsa; - p = d; - if ((rsa = d2i_RSAPrivateKey(NULL, &p,(long)len)) == NULL) { + if ((rsa = d2i_RSAPrivateKey(NULL, &d, (long)len)) == NULL) { SSLerror(ssl, ERR_R_ASN1_LIB); return (0); } @@ -280,10 +270,6 @@ SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) SSLerror(ssl, ERR_R_PASSED_NULL_PARAMETER); return (0); } - if (!ssl_cert_inst(&ssl->cert)) { - SSLerror(ssl, ERR_R_MALLOC_FAILURE); - return (0); - } ret = ssl_set_pkey(ssl->cert, pkey); return (ret); } @@ -332,11 +318,9 @@ int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, const unsigned char *d, long len) { int ret; - const unsigned char *p; EVP_PKEY *pkey; - p = d; - if ((pkey = d2i_PrivateKey(type, NULL, &p,(long)len)) == NULL) { + if ((pkey = d2i_PrivateKey(type, NULL, &d, (long)len)) == NULL) { SSLerror(ssl, ERR_R_ASN1_LIB); return (0); } @@ -353,10 +337,6 @@ SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x) SSLerrorx(ERR_R_PASSED_NULL_PARAMETER); return (0); } - if (!ssl_cert_inst(&ctx->internal->cert)) { - SSLerrorx(ERR_R_MALLOC_FAILURE); - return (0); - } return (ssl_set_cert(ctx->internal->cert, x)); } @@ -465,7 +445,7 @@ SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d) X509 *x; int ret; - x = d2i_X509(NULL, &d,(long)len); + x = d2i_X509(NULL, &d, (long)len); if (x == NULL) { SSLerrorx(ERR_R_ASN1_LIB); return (0); @@ -486,10 +466,6 @@ SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa) SSLerrorx(ERR_R_PASSED_NULL_PARAMETER); return (0); } - if (!ssl_cert_inst(&ctx->internal->cert)) { - SSLerrorx(ERR_R_MALLOC_FAILURE); - return (0); - } if ((pkey = EVP_PKEY_new()) == NULL) { SSLerrorx(ERR_R_EVP_LIB); return (0); @@ -547,11 +523,9 @@ int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len) { int ret; - const unsigned char *p; RSA *rsa; - p = d; - if ((rsa = d2i_RSAPrivateKey(NULL, &p,(long)len)) == NULL) { + if ((rsa = d2i_RSAPrivateKey(NULL, &d, (long)len)) == NULL) { SSLerrorx(ERR_R_ASN1_LIB); return (0); } @@ -568,10 +542,6 @@ SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) SSLerrorx(ERR_R_PASSED_NULL_PARAMETER); return (0); } - if (!ssl_cert_inst(&ctx->internal->cert)) { - SSLerrorx(ERR_R_MALLOC_FAILURE); - return (0); - } return (ssl_set_pkey(ctx->internal->cert, pkey)); } @@ -620,11 +590,9 @@ SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const unsigned char *d, long len) { int ret; - const unsigned char *p; EVP_PKEY *pkey; - p = d; - if ((pkey = d2i_PrivateKey(type, NULL, &p,(long)len)) == NULL) { + if ((pkey = d2i_PrivateKey(type, NULL, &d, (long)len)) == NULL) { SSLerrorx(ERR_R_ASN1_LIB); return (0); } @@ -643,63 +611,43 @@ SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const unsigned char *d, static int ssl_ctx_use_certificate_chain_bio(SSL_CTX *ctx, BIO *in) { + X509 *ca, *x = NULL; + unsigned long err; int ret = 0; - X509 *x = NULL; - - ERR_clear_error(); /* clear error stack for SSL_CTX_use_certificate() */ - x = PEM_read_bio_X509_AUX(in, NULL, ctx->default_passwd_callback, - ctx->default_passwd_callback_userdata); - if (x == NULL) { + if ((x = PEM_read_bio_X509_AUX(in, NULL, ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata)) == NULL) { SSLerrorx(ERR_R_PEM_LIB); - goto end; + goto err; } - ret = SSL_CTX_use_certificate(ctx, x); + if (!SSL_CTX_use_certificate(ctx, x)) + goto err; - if (ERR_peek_error() != 0) - ret = 0; - /* Key/certificate mismatch doesn't imply ret==0 ... */ - if (ret) { - /* - * If we could set up our certificate, now proceed to - * the CA certificates. - */ - X509 *ca; - int r; - unsigned long err; + if (!ssl_cert_set0_chain(ctx->internal->cert, NULL)) + goto err; - sk_X509_pop_free(ctx->extra_certs, X509_free); - ctx->extra_certs = NULL; - - while ((ca = PEM_read_bio_X509(in, NULL, - ctx->default_passwd_callback, - ctx->default_passwd_callback_userdata)) != NULL) { - r = SSL_CTX_add_extra_chain_cert(ctx, ca); - if (!r) { - X509_free(ca); - ret = 0; - goto end; - } - /* - * Note that we must not free r if it was successfully - * added to the chain (while we must free the main - * certificate, since its reference count is increased - * by SSL_CTX_use_certificate). - */ + /* Process any additional CA certificates. */ + while ((ca = PEM_read_bio_X509(in, NULL, + ctx->default_passwd_callback, + ctx->default_passwd_callback_userdata)) != NULL) { + if (!ssl_cert_add0_chain_cert(ctx->internal->cert, ca)) { + X509_free(ca); + goto err; } + } - /* When the while loop ends, it's usually just EOF. */ - err = ERR_peek_last_error(); - if (ERR_GET_LIB(err) == ERR_LIB_PEM && - ERR_GET_REASON(err) == PEM_R_NO_START_LINE) - ERR_clear_error(); - else - ret = 0; /* some real error */ + /* When the while loop ends, it's usually just EOF. */ + err = ERR_peek_last_error(); + if (ERR_GET_LIB(err) == ERR_LIB_PEM && + ERR_GET_REASON(err) == PEM_R_NO_START_LINE) { + ERR_clear_error(); + ret = 1; } -end: + err: X509_free(x); + return (ret); } diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 59d7d9ec..7e8a1bc6 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_sess.c,v 1.71 2017/04/10 17:27:33 jsing Exp $ */ +/* $OpenBSD: ssl_sess.c,v 1.84 2019/04/04 14:32:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -199,6 +199,11 @@ SSL_SESSION_new(void) { SSL_SESSION *ss; + if (!OPENSSL_init_ssl(0, NULL)) { + SSLerrorx(SSL_R_LIBRARY_BUG); + return(NULL); + } + if ((ss = calloc(1, sizeof(*ss))) == NULL) { SSLerrorx(ERR_R_MALLOC_FAILURE); return (NULL); @@ -228,19 +233,39 @@ SSL_SESSION_new(void) } const unsigned char * -SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len) +SSL_SESSION_get_id(const SSL_SESSION *ss, unsigned int *len) +{ + if (len != NULL) + *len = ss->session_id_length; + return ss->session_id; +} + +const unsigned char * +SSL_SESSION_get0_id_context(const SSL_SESSION *ss, unsigned int *len) { - if (len) - *len = s->session_id_length; - return s->session_id; + if (len != NULL) + *len = (unsigned int)ss->sid_ctx_length; + return ss->sid_ctx; } unsigned int -SSL_SESSION_get_compress_id(const SSL_SESSION *s) +SSL_SESSION_get_compress_id(const SSL_SESSION *ss) { return 0; } +unsigned long +SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s) +{ + return s->tlsext_tick_lifetime_hint; +} + +int +SSL_SESSION_has_ticket(const SSL_SESSION *s) +{ + return (s->tlsext_ticklen > 0) ? 1 : 0; +} + /* * SSLv3/TLSv1 has 32 bytes (256 bits) of session ID space. As such, filling * the ID with random gunk repeatedly until we have no conflict is going to @@ -395,8 +420,8 @@ ssl_get_new_session(SSL *s, int session) * session_id: points at the session ID in the ClientHello. This code will * read past the end of this in order to parse out the session ticket * extension, if any. - * len: the length of the session ID. - * limit: a pointer to the first byte after the ClientHello. + * session_id_len: the length of the session ID. + * ext_block: a CBS for the ClientHello extensions block. * * Returns: * -1: error @@ -410,8 +435,8 @@ ssl_get_new_session(SSL *s, int session) * to 1 if the server should issue a new session ticket (to 0 otherwise). */ int -ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, - const unsigned char *limit) +ssl_get_prev_session(SSL *s, const unsigned char *session_id, + int session_id_len, CBS *ext_block) { SSL_SESSION *ret = NULL; int fatal = 0; @@ -420,14 +445,14 @@ ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, /* This is used only by servers. */ - if (len > SSL_MAX_SSL_SESSION_ID_LENGTH) + if (session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH) goto err; - if (len == 0) + if (session_id_len == 0) try_session_cache = 0; /* Sets s->internal->tlsext_ticket_expected. */ - r = tls1_process_ticket(s, session_id, len, limit, &ret); + r = tls1_process_ticket(s, session_id, session_id_len, ext_block, &ret); switch (r) { case -1: /* Error during processing */ fatal = 1; @@ -440,7 +465,9 @@ ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, try_session_cache = 0; break; default: - abort(); + SSLerror(s, ERR_R_INTERNAL_ERROR); + fatal = 1; + goto err; } if (try_session_cache && ret == NULL && @@ -448,8 +475,8 @@ ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) { SSL_SESSION data; data.ssl_version = s->version; - data.session_id_length = len; - memcpy(data.session_id, session_id, len); + data.session_id_length = session_id_len; + memcpy(data.session_id, session_id, session_id_len); CRYPTO_r_lock(CRYPTO_LOCK_SSL_CTX); ret = lh_SSL_SESSION_retrieve(s->session_ctx->internal->sessions, &data); @@ -469,7 +496,7 @@ ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, int copy = 1; if ((ret = s->session_ctx->internal->get_session_cb(s, - session_id, len, ©))) { + session_id, session_id_len, ©))) { s->session_ctx->internal->stats.sess_cb_hit++; /* @@ -709,6 +736,13 @@ SSL_SESSION_free(SSL_SESSION *ss) freezero(ss, sizeof(*ss)); } +int +SSL_SESSION_up_ref(SSL_SESSION *ss) +{ + int refs = CRYPTO_add(&ss->references, 1, CRYPTO_LOCK_SSL_SESSION); + return (refs > 1) ? 1 : 0; +} + int SSL_set_session(SSL *s, SSL_SESSION *session) { @@ -753,6 +787,23 @@ SSL_set_session(SSL *s, SSL_SESSION *session) return (ret); } +size_t +SSL_SESSION_get_master_key(const SSL_SESSION *ss, unsigned char *out, + size_t max_out) +{ + size_t len = ss->master_key_length; + + if (out == NULL) + return len; + + if (len > max_out) + len = max_out; + + memcpy(out, ss->master_key, len); + + return len; +} + long SSL_SESSION_set_timeout(SSL_SESSION *s, long t) { @@ -789,12 +840,31 @@ SSL_SESSION_set_time(SSL_SESSION *s, long t) return (t); } +int +SSL_SESSION_get_protocol_version(const SSL_SESSION *s) +{ + return s->ssl_version; +} + X509 * SSL_SESSION_get0_peer(SSL_SESSION *s) { return s->peer; } +int +SSL_SESSION_set1_id(SSL_SESSION *s, const unsigned char *sid, + unsigned int sid_len) +{ + if (sid_len > SSL_MAX_SSL_SESSION_ID_LENGTH) { + SSLerrorx(SSL_R_SSL_SESSION_ID_TOO_LONG); + return 0; + } + s->session_id_length = sid_len; + memmove(s->session_id, sid, sid_len); + return 1; +} + int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx, unsigned int sid_ctx_len) @@ -1024,13 +1094,13 @@ void void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, SSL_SESSION *(*cb)(struct ssl_st *ssl, - unsigned char *data, int len, int *copy)) + const unsigned char *data, int len, int *copy)) { ctx->internal->get_session_cb = cb; } SSL_SESSION * -(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(SSL *ssl, unsigned char *data, +(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(SSL *ssl, const unsigned char *data, int len, int *copy) { return ctx->internal->get_session_cb; @@ -1090,7 +1160,7 @@ SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, - int (*cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)) + int (*cb)(SSL *ssl, const unsigned char *cookie, unsigned int cookie_len)) { ctx->internal->app_verify_cookie_cb = cb; } diff --git a/ssl/ssl_sigalgs.c b/ssl/ssl_sigalgs.c new file mode 100644 index 00000000..37fdcfa7 --- /dev/null +++ b/ssl/ssl_sigalgs.c @@ -0,0 +1,331 @@ +/* $OpenBSD: ssl_sigalgs.c,v 1.20 2019/04/01 02:09:21 beck Exp $ */ +/* + * Copyright (c) 2018-2019 Bob Beck + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +#include +#include + +#include + +#include "bytestring.h" +#include "ssl_locl.h" +#include "ssl_sigalgs.h" +#include "tls13_internal.h" + +const struct ssl_sigalg sigalgs[] = { + { + .value = SIGALG_RSA_PKCS1_SHA512, + .md = EVP_sha512, + .key_type = EVP_PKEY_RSA, + }, + { + .value = SIGALG_ECDSA_SECP521R1_SHA512, + .md = EVP_sha512, + .key_type = EVP_PKEY_EC, + .curve_nid = NID_secp521r1, + }, +#ifndef OPENSSL_NO_GOST + { + .value = SIGALG_GOSTR12_512_STREEBOG_512, + .md = EVP_streebog512, + .key_type = EVP_PKEY_GOSTR12_512, + }, +#endif + { + .value = SIGALG_RSA_PKCS1_SHA384, + .md = EVP_sha384, + .key_type = EVP_PKEY_RSA, + }, + { + .value = SIGALG_ECDSA_SECP384R1_SHA384, + .md = EVP_sha384, + .key_type = EVP_PKEY_EC, + .curve_nid = NID_secp384r1, + }, + { + .value = SIGALG_RSA_PKCS1_SHA256, + .md = EVP_sha256, + .key_type = EVP_PKEY_RSA, + }, + { + .value = SIGALG_ECDSA_SECP256R1_SHA256, + .md = EVP_sha256, + .key_type = EVP_PKEY_EC, + .curve_nid = NID_X9_62_prime256v1, + }, +#ifndef OPENSSL_NO_GOST + { + .value = SIGALG_GOSTR12_256_STREEBOG_256, + .md = EVP_streebog256, + .key_type = EVP_PKEY_GOSTR12_256, + }, + { + .value = SIGALG_GOSTR01_GOST94, + .md = EVP_gostr341194, + .key_type = EVP_PKEY_GOSTR01, + }, +#endif + { + .value = SIGALG_RSA_PSS_RSAE_SHA256, + .md = EVP_sha256, + .key_type = EVP_PKEY_RSA, + .flags = SIGALG_FLAG_RSA_PSS, + }, + { + .value = SIGALG_RSA_PSS_RSAE_SHA384, + .md = EVP_sha384, + .key_type = EVP_PKEY_RSA, + .flags = SIGALG_FLAG_RSA_PSS, + }, + { + .value = SIGALG_RSA_PSS_RSAE_SHA512, + .md = EVP_sha512, + .key_type = EVP_PKEY_RSA, + .flags = SIGALG_FLAG_RSA_PSS, + }, + { + .value = SIGALG_RSA_PSS_PSS_SHA256, + .md = EVP_sha256, + .key_type = EVP_PKEY_RSA, + .flags = SIGALG_FLAG_RSA_PSS, + }, + { + .value = SIGALG_RSA_PSS_PSS_SHA384, + .md = EVP_sha384, + .key_type = EVP_PKEY_RSA, + .flags = SIGALG_FLAG_RSA_PSS, + }, + { + .value = SIGALG_RSA_PSS_PSS_SHA512, + .md = EVP_sha512, + .key_type = EVP_PKEY_RSA, + .flags = SIGALG_FLAG_RSA_PSS, + }, + { + .value = SIGALG_RSA_PKCS1_SHA224, + .md = EVP_sha224, + .key_type = EVP_PKEY_RSA, + }, + { + .value = SIGALG_ECDSA_SECP224R1_SHA224, + .md = EVP_sha224, + .key_type = EVP_PKEY_EC, + }, + { + .value = SIGALG_RSA_PKCS1_SHA1, + .key_type = EVP_PKEY_RSA, + .md = EVP_sha1, + }, + { + .value = SIGALG_ECDSA_SHA1, + .key_type = EVP_PKEY_EC, + .md = EVP_sha1, + }, + { + .value = SIGALG_RSA_PKCS1_MD5_SHA1, + .key_type = EVP_PKEY_RSA, + .md = EVP_md5_sha1, + }, + { + .value = SIGALG_NONE, + }, +}; + +/* Sigalgs for tls 1.3, in preference order, */ +uint16_t tls13_sigalgs[] = { + SIGALG_RSA_PSS_RSAE_SHA512, + SIGALG_RSA_PKCS1_SHA512, + SIGALG_ECDSA_SECP521R1_SHA512, + SIGALG_RSA_PSS_RSAE_SHA384, + SIGALG_RSA_PKCS1_SHA384, + SIGALG_ECDSA_SECP384R1_SHA384, + SIGALG_RSA_PSS_RSAE_SHA256, + SIGALG_RSA_PKCS1_SHA256, + SIGALG_ECDSA_SECP256R1_SHA256, +}; +size_t tls13_sigalgs_len = (sizeof(tls13_sigalgs) / sizeof(tls13_sigalgs[0])); + +/* Sigalgs for tls 1.2, in preference order, */ +uint16_t tls12_sigalgs[] = { + SIGALG_RSA_PSS_RSAE_SHA512, + SIGALG_RSA_PKCS1_SHA512, + SIGALG_ECDSA_SECP521R1_SHA512, + SIGALG_RSA_PSS_RSAE_SHA384, + SIGALG_RSA_PKCS1_SHA384, + SIGALG_ECDSA_SECP384R1_SHA384, + SIGALG_RSA_PSS_RSAE_SHA256, + SIGALG_RSA_PKCS1_SHA256, + SIGALG_ECDSA_SECP256R1_SHA256, + SIGALG_RSA_PKCS1_SHA1, /* XXX */ + SIGALG_ECDSA_SHA1, /* XXX */ +}; +size_t tls12_sigalgs_len = (sizeof(tls12_sigalgs) / sizeof(tls12_sigalgs[0])); + +const struct ssl_sigalg * +ssl_sigalg_lookup(uint16_t sigalg) +{ + int i; + + for (i = 0; sigalgs[i].value != SIGALG_NONE; i++) { + if (sigalgs[i].value == sigalg) + return &sigalgs[i]; + } + + return NULL; +} + +const struct ssl_sigalg * +ssl_sigalg(uint16_t sigalg, uint16_t *values, size_t len) +{ + int i; + + for (i = 0; i < len; i++) { + if (values[i] == sigalg) + return ssl_sigalg_lookup(sigalg); + } + + return NULL; +} + +int +ssl_sigalgs_build(CBB *cbb, uint16_t *values, size_t len) +{ + size_t i; + + for (i = 0; sigalgs[i].value != SIGALG_NONE; i++); + if (len > i) + return 0; + + /* XXX check for duplicates and other sanity BS? */ + + /* Add values in order as long as they are supported. */ + for (i = 0; i < len; i++) { + /* Do not allow the legacy value for < 1.2 to be used */ + if (values[i] == SIGALG_RSA_PKCS1_MD5_SHA1) + return 0; + + if (ssl_sigalg_lookup(values[i]) != NULL) { + if (!CBB_add_u16(cbb, values[i])) + return 0; + } else + return 0; + } + return 1; +} + +int +ssl_sigalg_pkey_ok(const struct ssl_sigalg *sigalg, EVP_PKEY *pkey, + int check_curve) +{ + if (sigalg == NULL || pkey == NULL) + return 0; + if (sigalg->key_type != pkey->type) + return 0; + + if ((sigalg->flags & SIGALG_FLAG_RSA_PSS)) { + /* + * RSA PSS Must have an RSA key that needs to be at + * least as big as twice the size of the hash + 2 + */ + if (pkey->type != EVP_PKEY_RSA || + EVP_PKEY_size(pkey) < (2 * EVP_MD_size(sigalg->md()) + 2)) + return 0; + } + + if (pkey->type == EVP_PKEY_EC && check_curve) { + /* Curve must match for EC keys. */ + if (sigalg->curve_nid == 0) + return 0; + if (EC_GROUP_get_curve_name(EC_KEY_get0_group + (EVP_PKEY_get0_EC_KEY(pkey))) != sigalg->curve_nid) { + return 0; + } + } + + return 1; +} + +const struct ssl_sigalg * +ssl_sigalg_select(SSL *s, EVP_PKEY *pkey) +{ + uint16_t *tls_sigalgs = tls12_sigalgs; + size_t tls_sigalgs_len = tls12_sigalgs_len; + int check_curve = 0; + CBS cbs; + + if (TLS1_get_version(s) >= TLS1_3_VERSION) { + tls_sigalgs = tls13_sigalgs; + tls_sigalgs_len = tls13_sigalgs_len; + check_curve = 1; + } + + /* Pre TLS 1.2 defaults */ + if (!SSL_USE_SIGALGS(s)) { + switch (pkey->type) { + case EVP_PKEY_RSA: + return ssl_sigalg_lookup(SIGALG_RSA_PKCS1_MD5_SHA1); + case EVP_PKEY_EC: + return ssl_sigalg_lookup(SIGALG_ECDSA_SHA1); +#ifndef OPENSSL_NO_GOST + case EVP_PKEY_GOSTR01: + return ssl_sigalg_lookup(SIGALG_GOSTR01_GOST94); +#endif + } + SSLerror(s, SSL_R_UNKNOWN_PKEY_TYPE); + return (NULL); + } + + /* + * RFC 5246 allows a TLS 1.2 client to send no sigalgs, in + * which case the server must use the the default. + */ + if (TLS1_get_version(s) < TLS1_3_VERSION && + S3I(s)->hs.sigalgs == NULL) { + switch (pkey->type) { + case EVP_PKEY_RSA: + return ssl_sigalg_lookup(SIGALG_RSA_PKCS1_SHA1); + case EVP_PKEY_EC: + return ssl_sigalg_lookup(SIGALG_ECDSA_SHA1); +#ifndef OPENSSL_NO_GOST + case EVP_PKEY_GOSTR01: + return ssl_sigalg_lookup(SIGALG_GOSTR01_GOST94); +#endif + } + SSLerror(s, SSL_R_UNKNOWN_PKEY_TYPE); + return (NULL); + } + + /* + * If we get here, we have client or server sent sigalgs, use one. + */ + CBS_init(&cbs, S3I(s)->hs.sigalgs, S3I(s)->hs.sigalgs_len); + while (CBS_len(&cbs) > 0) { + uint16_t sig_alg; + const struct ssl_sigalg *sigalg; + + if (!CBS_get_u16(&cbs, &sig_alg)) + return 0; + + if ((sigalg = ssl_sigalg(sig_alg, tls_sigalgs, + tls_sigalgs_len)) == NULL) + continue; + + if (ssl_sigalg_pkey_ok(sigalg, pkey, check_curve)) + return sigalg; + } + + SSLerror(s, SSL_R_UNKNOWN_PKEY_TYPE); + return NULL; +} diff --git a/ssl/ssl_sigalgs.h b/ssl/ssl_sigalgs.h new file mode 100644 index 00000000..13a3597f --- /dev/null +++ b/ssl/ssl_sigalgs.h @@ -0,0 +1,86 @@ +/* $OpenBSD: ssl_sigalgs.h,v 1.14 2019/03/25 17:33:26 jsing Exp $ */ +/* + * Copyright (c) 2018-2019 Bob Beck + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_SSL_SIGALGS_H +#define HEADER_SSL_SIGALGS_H + +__BEGIN_HIDDEN_DECLS + +#define SIGALG_NONE 0x0000 + +/* + * RFC 8446 Section 4.2.3 + * RFC 5246 Section 7.4.1.4.1 + */ +#define SIGALG_RSA_PKCS1_SHA224 0x0301 +#define SIGALG_RSA_PKCS1_SHA256 0x0401 +#define SIGALG_RSA_PKCS1_SHA384 0x0501 +#define SIGALG_RSA_PKCS1_SHA512 0x0601 +#define SIGALG_ECDSA_SECP224R1_SHA224 0x0303 +#define SIGALG_ECDSA_SECP256R1_SHA256 0x0403 +#define SIGALG_ECDSA_SECP384R1_SHA384 0x0503 +#define SIGALG_ECDSA_SECP521R1_SHA512 0x0603 +#define SIGALG_RSA_PSS_RSAE_SHA256 0x0804 +#define SIGALG_RSA_PSS_RSAE_SHA384 0x0805 +#define SIGALG_RSA_PSS_RSAE_SHA512 0x0806 +#define SIGALG_ED25519 0x0807 +#define SIGALG_ED448 0x0808 +#define SIGALG_RSA_PSS_PSS_SHA256 0x0809 +#define SIGALG_RSA_PSS_PSS_SHA384 0x080a +#define SIGALG_RSA_PSS_PSS_SHA512 0x080b +#define SIGALG_RSA_PKCS1_SHA1 0x0201 +#define SIGALG_ECDSA_SHA1 0x0203 +#define SIGALG_PRIVATE_START 0xFE00 +#define SIGALG_PRIVATE_END 0xFFFF + +/* + * If Russia can elect the US President, surely + * IANA could fix this problem. + */ +#define SIGALG_GOSTR12_512_STREEBOG_512 0xEFEF +#define SIGALG_GOSTR12_256_STREEBOG_256 0xEEEE +#define SIGALG_GOSTR01_GOST94 0xEDED + +/* Legacy sigalg for < 1.2 same value as boring uses*/ +#define SIGALG_RSA_PKCS1_MD5_SHA1 0xFF01 + +#define SIGALG_FLAG_RSA_PSS 0x00000001 + +struct ssl_sigalg{ + uint16_t value; + const EVP_MD *(*md)(void); + int key_type; + int curve_nid; + int flags; +}; + +extern uint16_t tls12_sigalgs[]; +extern size_t tls12_sigalgs_len; +extern uint16_t tls13_sigalgs[]; +extern size_t tls13_sigalgs_len; + +const struct ssl_sigalg *ssl_sigalg_lookup(uint16_t sigalg); +const struct ssl_sigalg *ssl_sigalg(uint16_t sigalg, uint16_t *values, size_t len); +int ssl_sigalgs_build(CBB *cbb, uint16_t *values, size_t len); +int ssl_sigalg_pkey_check(uint16_t sigalg, EVP_PKEY *pk); +int ssl_sigalg_pkey_ok(const struct ssl_sigalg *sigalg, EVP_PKEY *pkey, + int check_curve); +const struct ssl_sigalg *ssl_sigalg_select(SSL *s, EVP_PKEY *pkey); + +__END_HIDDEN_DECLS + +#endif diff --git a/ssl/ssl_srvr.c b/ssl/ssl_srvr.c index c43d63d9..745d0228 100644 --- a/ssl/ssl_srvr.c +++ b/ssl/ssl_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_srvr.c,v 1.22 2017/08/12 21:47:59 jsing Exp $ */ +/* $OpenBSD: ssl_srvr.c,v 1.66 2019/03/25 17:21:18 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -166,14 +166,17 @@ #include #include "bytestring.h" +#include "ssl_sigalgs.h" +#include "ssl_tlsext.h" int ssl3_accept(SSL *s) { - unsigned long alg_k; void (*cb)(const SSL *ssl, int type, int val) = NULL; + unsigned long alg_k; int ret = -1; int new_state, state, skip = 0; + int listen = 0; ERR_clear_error(); errno = 0; @@ -183,16 +186,16 @@ ssl3_accept(SSL *s) else if (s->ctx->internal->info_callback != NULL) cb = s->ctx->internal->info_callback; + if (SSL_IS_DTLS(s)) + listen = D1I(s)->listen; + /* init things to blank */ s->internal->in_handshake++; if (!SSL_in_init(s) || SSL_in_before(s)) SSL_clear(s); - if (s->cert == NULL) { - SSLerror(s, SSL_R_NO_CERTIFICATE_SET); - ret = -1; - goto end; - } + if (SSL_IS_DTLS(s)) + D1I(s)->listen = listen; for (;;) { state = S3I(s)->hs.state; @@ -206,15 +209,22 @@ ssl3_accept(SSL *s) case SSL_ST_ACCEPT: case SSL_ST_BEFORE|SSL_ST_ACCEPT: case SSL_ST_OK|SSL_ST_ACCEPT: - s->server = 1; if (cb != NULL) cb(s, SSL_CB_HANDSHAKE_START, 1); - if ((s->version >> 8) != 3) { - SSLerror(s, ERR_R_INTERNAL_ERROR); - ret = -1; - goto end; + if (SSL_IS_DTLS(s)) { + if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00)) { + SSLerror(s, ERR_R_INTERNAL_ERROR); + ret = -1; + goto end; + } + } else { + if ((s->version >> 8) != 3) { + SSLerror(s, ERR_R_INTERNAL_ERROR); + ret = -1; + goto end; + } } s->internal->type = SSL_ST_ACCEPT; @@ -240,14 +250,14 @@ ssl3_accept(SSL *s) goto end; } - if (!tls1_init_finished_mac(s)) { + if (!tls1_transcript_init(s)) { ret = -1; goto end; } S3I(s)->hs.state = SSL3_ST_SR_CLNT_HELLO_A; s->ctx->internal->stats.sess_accept++; - } else if (!S3I(s)->send_connection_binding) { + } else if (!SSL_IS_DTLS(s) && !S3I(s)->send_connection_binding) { /* * Server attempting to renegotiate with * client that doesn't support secure @@ -261,7 +271,7 @@ ssl3_accept(SSL *s) } else { /* * S3I(s)->hs.state == SSL_ST_RENEGOTIATE, - * we will just send a HelloRequest + * we will just send a HelloRequest. */ s->ctx->internal->stats.sess_accept_renegotiate++; S3I(s)->hs.state = SSL3_ST_SW_HELLO_REQ_A; @@ -270,16 +280,22 @@ ssl3_accept(SSL *s) case SSL3_ST_SW_HELLO_REQ_A: case SSL3_ST_SW_HELLO_REQ_B: - s->internal->shutdown = 0; + if (SSL_IS_DTLS(s)) { + dtls1_clear_record_buffer(s); + dtls1_start_timer(s); + } ret = ssl3_send_hello_request(s); if (ret <= 0) goto end; - S3I(s)->hs.next_state = SSL3_ST_SW_HELLO_REQ_C; + if (SSL_IS_DTLS(s)) + S3I(s)->hs.next_state = SSL3_ST_SR_CLNT_HELLO_A; + else + S3I(s)->hs.next_state = SSL3_ST_SW_HELLO_REQ_C; S3I(s)->hs.state = SSL3_ST_SW_FLUSH; s->internal->init_num = 0; - if (!tls1_init_finished_mac(s)) { + if (!tls1_transcript_init(s)) { ret = -1; goto end; } @@ -292,21 +308,75 @@ ssl3_accept(SSL *s) case SSL3_ST_SR_CLNT_HELLO_A: case SSL3_ST_SR_CLNT_HELLO_B: case SSL3_ST_SR_CLNT_HELLO_C: - s->internal->shutdown = 0; - if (s->internal->rwstate != SSL_X509_LOOKUP) { + if (SSL_IS_DTLS(s)) { ret = ssl3_get_client_hello(s); if (ret <= 0) goto end; + dtls1_stop_timer(s); + + if (ret == 1 && + (SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE)) + S3I(s)->hs.state = DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A; + else + S3I(s)->hs.state = SSL3_ST_SW_SRVR_HELLO_A; + + s->internal->init_num = 0; + + /* + * Reflect ClientHello sequence to remain + * stateless while listening. + */ + if (listen) { + memcpy(S3I(s)->write_sequence, + S3I(s)->read_sequence, + sizeof(S3I(s)->write_sequence)); + } + + /* If we're just listening, stop here */ + if (listen && S3I(s)->hs.state == SSL3_ST_SW_SRVR_HELLO_A) { + ret = 2; + D1I(s)->listen = 0; + /* + * Set expected sequence numbers to + * continue the handshake. + */ + D1I(s)->handshake_read_seq = 2; + D1I(s)->handshake_write_seq = 1; + D1I(s)->next_handshake_write_seq = 1; + goto end; + } + } else { + if (s->internal->rwstate != SSL_X509_LOOKUP) { + ret = ssl3_get_client_hello(s); + if (ret <= 0) + goto end; + } + + s->internal->renegotiate = 2; + S3I(s)->hs.state = SSL3_ST_SW_SRVR_HELLO_A; + s->internal->init_num = 0; } + break; - s->internal->renegotiate = 2; - S3I(s)->hs.state = SSL3_ST_SW_SRVR_HELLO_A; - s->internal->init_num = 0; + case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A: + case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B: + ret = dtls1_send_hello_verify_request(s); + if (ret <= 0) + goto end; + S3I(s)->hs.state = SSL3_ST_SW_FLUSH; + S3I(s)->hs.next_state = SSL3_ST_SR_CLNT_HELLO_A; + + /* HelloVerifyRequest resets Finished MAC. */ + tls1_transcript_reset(s); break; case SSL3_ST_SW_SRVR_HELLO_A: case SSL3_ST_SW_SRVR_HELLO_B: + if (SSL_IS_DTLS(s)) { + s->internal->renegotiate = 2; + dtls1_start_timer(s); + } ret = ssl3_send_server_hello(s); if (ret <= 0) goto end; @@ -315,9 +385,9 @@ ssl3_accept(SSL *s) S3I(s)->hs.state = SSL3_ST_SW_SESSION_TICKET_A; else S3I(s)->hs.state = SSL3_ST_SW_CHANGE_A; - } - else + } else { S3I(s)->hs.state = SSL3_ST_SW_CERT_A; + } s->internal->init_num = 0; break; @@ -326,6 +396,8 @@ ssl3_accept(SSL *s) /* Check if it is anon DH or anon ECDH. */ if (!(S3I(s)->hs.new_cipher->algorithm_auth & SSL_aNULL)) { + if (SSL_IS_DTLS(s)) + dtls1_start_timer(s); ret = ssl3_send_server_certificate(s); if (ret <= 0) goto end; @@ -353,6 +425,8 @@ ssl3_accept(SSL *s) * public key for key exchange. */ if (alg_k & (SSL_kDHE|SSL_kECDHE)) { + if (SSL_IS_DTLS(s)) + dtls1_start_timer(s); ret = ssl3_send_server_key_exchange(s); if (ret <= 0) goto end; @@ -388,18 +462,17 @@ ssl3_accept(SSL *s) ((S3I(s)->hs.new_cipher->algorithm_auth & SSL_aNULL) && !(s->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT))) { - /* No cert request */ + /* No cert request. */ skip = 1; S3I(s)->tmp.cert_request = 0; S3I(s)->hs.state = SSL3_ST_SW_SRVR_DONE_A; - if (S3I(s)->handshake_buffer) { - if (!tls1_digest_cached_records(s)) { - ret = -1; - goto end; - } - } + + if (!SSL_IS_DTLS(s)) + tls1_transcript_free(s); } else { S3I(s)->tmp.cert_request = 1; + if (SSL_IS_DTLS(s)) + dtls1_start_timer(s); ret = ssl3_send_certificate_request(s); if (ret <= 0) goto end; @@ -410,6 +483,8 @@ ssl3_accept(SSL *s) case SSL3_ST_SW_SRVR_DONE_A: case SSL3_ST_SW_SRVR_DONE_B: + if (SSL_IS_DTLS(s)) + dtls1_start_timer(s); ret = ssl3_send_server_done(s); if (ret <= 0) goto end; @@ -419,7 +494,6 @@ ssl3_accept(SSL *s) break; case SSL3_ST_SW_FLUSH: - /* * This code originally checked to see if * any data was pending using BIO_CTRL_INFO @@ -430,14 +504,19 @@ ssl3_accept(SSL *s) * still exist. So instead we just flush * unconditionally. */ - s->internal->rwstate = SSL_WRITING; if (BIO_flush(s->wbio) <= 0) { + if (SSL_IS_DTLS(s)) { + /* If the write error was fatal, stop trying. */ + if (!BIO_should_retry(s->wbio)) { + s->internal->rwstate = SSL_NOTHING; + S3I(s)->hs.state = S3I(s)->hs.next_state; + } + } ret = -1; goto end; } s->internal->rwstate = SSL_NOTHING; - S3I(s)->hs.state = S3I(s)->hs.next_state; break; @@ -457,6 +536,12 @@ ssl3_accept(SSL *s) ret = ssl3_get_client_key_exchange(s); if (ret <= 0) goto end; + + if (SSL_IS_DTLS(s)) { + S3I(s)->hs.state = SSL3_ST_SR_CERT_VRFY_A; + s->internal->init_num = 0; + } + alg_k = S3I(s)->hs.new_cipher->algorithm_mkey; if (ret == 2) { /* @@ -476,38 +561,25 @@ ssl3_accept(SSL *s) if (!s->session->peer) break; /* - * For sigalgs freeze the handshake buffer - * at this point and digest cached records. + * Freeze the transcript for use during client + * certificate verification. */ - if (!S3I(s)->handshake_buffer) { - SSLerror(s, ERR_R_INTERNAL_ERROR); - ret = -1; - goto end; - } - s->s3->flags |= TLS1_FLAGS_KEEP_HANDSHAKE; - if (!tls1_digest_cached_records(s)) { - ret = -1; - goto end; - } + tls1_transcript_freeze(s); } else { S3I(s)->hs.state = SSL3_ST_SR_CERT_VRFY_A; s->internal->init_num = 0; + tls1_transcript_free(s); + /* * We need to get hashes here so if there is * a client cert, it can be verified. */ - if (S3I(s)->handshake_buffer) { - if (!tls1_digest_cached_records(s)) { - ret = -1; - goto end; - } - } - if (!tls1_handshake_hash_value(s, + if (!tls1_transcript_hash_value(s, S3I(s)->tmp.cert_verify_md, sizeof(S3I(s)->tmp.cert_verify_md), NULL)) { - ret = -1; + ret = -1; goto end; } } @@ -515,24 +587,31 @@ ssl3_accept(SSL *s) case SSL3_ST_SR_CERT_VRFY_A: case SSL3_ST_SR_CERT_VRFY_B: - s->s3->flags |= SSL3_FLAGS_CCS_OK; + if (SSL_IS_DTLS(s)) + D1I(s)->change_cipher_spec_ok = 1; + else + s->s3->flags |= SSL3_FLAGS_CCS_OK; /* we should decide if we expected this one */ ret = ssl3_get_cert_verify(s); if (ret <= 0) goto end; - S3I(s)->hs.state = SSL3_ST_SR_FINISHED_A; s->internal->init_num = 0; break; case SSL3_ST_SR_FINISHED_A: case SSL3_ST_SR_FINISHED_B: - s->s3->flags |= SSL3_FLAGS_CCS_OK; + if (SSL_IS_DTLS(s)) + D1I(s)->change_cipher_spec_ok = 1; + else + s->s3->flags |= SSL3_FLAGS_CCS_OK; ret = ssl3_get_finished(s, SSL3_ST_SR_FINISHED_A, SSL3_ST_SR_FINISHED_B); if (ret <= 0) goto end; + if (SSL_IS_DTLS(s)) + dtls1_stop_timer(s); if (s->internal->hit) S3I(s)->hs.state = SSL_ST_OK; else if (s->internal->tlsext_ticket_expected) @@ -560,10 +639,8 @@ ssl3_accept(SSL *s) s->internal->init_num = 0; break; - case SSL3_ST_SW_CHANGE_A: case SSL3_ST_SW_CHANGE_B: - s->session->cipher = S3I(s)->hs.new_cipher; if (!tls1_setup_key_block(s)) { ret = -1; @@ -572,32 +649,34 @@ ssl3_accept(SSL *s) ret = ssl3_send_change_cipher_spec(s, SSL3_ST_SW_CHANGE_A, SSL3_ST_SW_CHANGE_B); - if (ret <= 0) goto end; S3I(s)->hs.state = SSL3_ST_SW_FINISHED_A; s->internal->init_num = 0; - if (!tls1_change_cipher_state( - s, SSL3_CHANGE_CIPHER_SERVER_WRITE)) { + if (!tls1_change_cipher_state(s, + SSL3_CHANGE_CIPHER_SERVER_WRITE)) { ret = -1; goto end; } + if (SSL_IS_DTLS(s)) + dtls1_reset_seq_numbers(s, SSL3_CC_WRITE); break; case SSL3_ST_SW_FINISHED_A: case SSL3_ST_SW_FINISHED_B: ret = ssl3_send_finished(s, - SSL3_ST_SW_FINISHED_A, SSL3_ST_SW_FINISHED_B, - TLS_MD_SERVER_FINISH_CONST, - TLS_MD_SERVER_FINISH_CONST_SIZE); + SSL3_ST_SW_FINISHED_A, SSL3_ST_SW_FINISHED_B, + TLS_MD_SERVER_FINISH_CONST, + TLS_MD_SERVER_FINISH_CONST_SIZE); if (ret <= 0) goto end; S3I(s)->hs.state = SSL3_ST_SW_FLUSH; - if (s->internal->hit) + if (s->internal->hit) { S3I(s)->hs.next_state = SSL3_ST_SR_FINISHED_A; - else + tls1_transcript_free(s); + } else S3I(s)->hs.next_state = SSL_ST_OK; s->internal->init_num = 0; break; @@ -606,15 +685,23 @@ ssl3_accept(SSL *s) /* clean a few things up */ tls1_cleanup_key_block(s); - BUF_MEM_free(s->internal->init_buf); - s->internal->init_buf = NULL; + if (S3I(s)->handshake_transcript != NULL) { + SSLerror(s, ERR_R_INTERNAL_ERROR); + ret = -1; + goto end; + } + + if (!SSL_IS_DTLS(s)) { + BUF_MEM_free(s->internal->init_buf); + s->internal->init_buf = NULL; + } /* remove buffering on output */ ssl_free_wbio_buffer(s); s->internal->init_num = 0; - /* skipped if we just sent a HelloRequest */ + /* Skipped if we just sent a HelloRequest. */ if (s->internal->renegotiate == 2) { s->internal->renegotiate = 0; s->internal->new_session = 0; @@ -630,6 +717,14 @@ ssl3_accept(SSL *s) } ret = 1; + + if (SSL_IS_DTLS(s)) { + /* Done handshaking, next message is client hello. */ + D1I(s)->handshake_read_seq = 0; + /* Next message is server hello. */ + D1I(s)->handshake_write_seq = 0; + D1I(s)->next_handshake_write_seq = 0; + } goto end; /* break; */ @@ -658,10 +753,10 @@ ssl3_accept(SSL *s) } end: /* BIO_flush(s->wbio); */ - s->internal->in_handshake--; if (cb != NULL) cb(s, SSL_CB_ACCEPT_EXIT, ret); + return (ret); } @@ -673,10 +768,10 @@ ssl3_send_hello_request(SSL *s) memset(&cbb, 0, sizeof(cbb)); if (S3I(s)->hs.state == SSL3_ST_SW_HELLO_REQ_A) { - if (!ssl3_handshake_msg_start_cbb(s, &cbb, &hello, + if (!ssl3_handshake_msg_start(s, &cbb, &hello, SSL3_MT_HELLO_REQUEST)) goto err; - if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) + if (!ssl3_handshake_msg_finish(s, &cbb)) goto err; S3I(s)->hs.state = SSL3_ST_SW_HELLO_REQ_B; @@ -702,13 +797,11 @@ ssl3_get_client_hello(SSL *s) int i, j, ok, al, ret = -1, cookie_valid = 0; long n; unsigned long id; - unsigned char *p, *d; SSL_CIPHER *c; STACK_OF(SSL_CIPHER) *ciphers = NULL; unsigned long alg_k; const SSL_METHOD *method; uint16_t shared_version; - unsigned char *end; /* * We do this so that we will respond with our native type. @@ -732,18 +825,28 @@ ssl3_get_client_hello(SSL *s) if (n < 0) goto err; - d = p = (unsigned char *)s->internal->init_msg; - end = d + n; - CBS_init(&cbs, s->internal->init_msg, n); + /* Parse client hello up until the extensions (if any). */ + if (!CBS_get_u16(&cbs, &client_version)) + goto truncated; + if (!CBS_get_bytes(&cbs, &client_random, SSL3_RANDOM_SIZE)) + goto truncated; + if (!CBS_get_u8_length_prefixed(&cbs, &session_id)) + goto truncated; + if (SSL_IS_DTLS(s)) { + if (!CBS_get_u8_length_prefixed(&cbs, &cookie)) + goto truncated; + } + if (!CBS_get_u16_length_prefixed(&cbs, &cipher_suites)) + goto truncated; + if (!CBS_get_u8_length_prefixed(&cbs, &compression_methods)) + goto truncated; + /* * Use version from inside client hello, not from record header. * (may differ: see RFC 2246, Appendix E, second paragraph) */ - if (!CBS_get_u16(&cbs, &client_version)) - goto truncated; - if (ssl_max_shared_version(s, client_version, &shared_version) != 1) { SSLerror(s, SSL_R_WRONG_VERSION_NUMBER); if ((s->client_version >> 8) == SSL3_VERSION_MAJOR && @@ -768,19 +871,12 @@ ssl3_get_client_hello(SSL *s) } s->method = method; - if (!CBS_get_bytes(&cbs, &client_random, SSL3_RANDOM_SIZE)) - goto truncated; - if (!CBS_get_u8_length_prefixed(&cbs, &session_id)) - goto truncated; - /* - * If we require cookies (DTLS) and this ClientHello doesn't - * contain one, just return since we do not want to - * allocate any memory yet. So check cookie length... + * If we require cookies (DTLS) and this ClientHello does not contain + * one, just return since we do not want to allocate any memory yet. + * So check cookie length... */ if (SSL_IS_DTLS(s)) { - if (!CBS_get_u8_length_prefixed(&cbs, &cookie)) - goto truncated; if (SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE) { if (CBS_len(&cookie) == 0) return (1); @@ -813,10 +909,12 @@ ssl3_get_client_hello(SSL *s) if (!ssl_get_new_session(s, 1)) goto err; } else { - /* XXX - pass CBS through instead... */ - i = ssl_get_prev_session(s, - (unsigned char *)CBS_data(&session_id), - CBS_len(&session_id), end); + CBS ext_block; + + CBS_dup(&cbs, &ext_block); + + i = ssl_get_prev_session(s, CBS_data(&session_id), + CBS_len(&session_id), &ext_block); if (i == 1) { /* previous session */ s->internal->hit = 1; } else if (i == -1) @@ -870,9 +968,6 @@ ssl3_get_client_hello(SSL *s) } } - if (!CBS_get_u16_length_prefixed(&cbs, &cipher_suites)) - goto truncated; - /* XXX - This logic seems wrong... */ if (CBS_len(&cipher_suites) == 0 && CBS_len(&session_id) != 0) { /* we need a cipher if we are not resuming a session */ @@ -883,11 +978,12 @@ ssl3_get_client_hello(SSL *s) if (CBS_len(&cipher_suites) > 0) { if ((ciphers = ssl_bytes_to_cipher_list(s, - CBS_data(&cipher_suites), CBS_len(&cipher_suites))) == NULL) + &cipher_suites)) == NULL) goto err; } /* If it is a hit, check that the cipher is in the list */ + /* XXX - CBS_len(&cipher_suites) will always be zero here... */ if (s->internal->hit && CBS_len(&cipher_suites) > 0) { j = 0; id = s->session->cipher->id; @@ -910,9 +1006,6 @@ ssl3_get_client_hello(SSL *s) } } - if (!CBS_get_u8_length_prefixed(&cbs, &compression_methods)) - goto truncated; - comp_null = 0; while (CBS_len(&compression_methods) > 0) { if (!CBS_get_u8(&compression_methods, &comp_method)) @@ -926,14 +1019,17 @@ ssl3_get_client_hello(SSL *s) goto f_err; } - p = (unsigned char *)CBS_data(&cbs); - - /* TLS extensions*/ - if (!ssl_parse_clienthello_tlsext(s, &p, d, n, &al)) { - /* 'al' set by ssl_parse_clienthello_tlsext */ + if (!tlsext_server_parse(s, &cbs, &al, SSL_TLSEXT_MSG_CH)) { SSLerror(s, SSL_R_PARSE_TLSEXT); goto f_err; } + + if (!S3I(s)->renegotiate_seen && s->internal->renegotiate) { + al = SSL_AD_HANDSHAKE_FAILURE; + SSLerror(s, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); + goto f_err; + } + if (ssl_check_clienthello_tlsext_early(s) <= 0) { SSLerror(s, SSL_R_CLIENTHELLO_TLSEXT); goto err; @@ -1008,17 +1104,13 @@ ssl3_get_client_hello(SSL *s) S3I(s)->hs.new_cipher = s->session->cipher; } - if (!tls1_handshake_hash_init(s)) + if (!tls1_transcript_hash_init(s)) goto err; alg_k = S3I(s)->hs.new_cipher->algorithm_mkey; if (!(SSL_USE_SIGALGS(s) || (alg_k & SSL_kGOST)) || - !(s->verify_mode & SSL_VERIFY_PEER)) { - if (!tls1_digest_cached_records(s)) { - al = SSL_AD_INTERNAL_ERROR; - goto f_err; - } - } + !(s->verify_mode & SSL_VERIFY_PEER)) + tls1_transcript_free(s); /* * We now have the following setup. @@ -1056,25 +1148,19 @@ ssl3_get_client_hello(SSL *s) int ssl3_send_server_hello(SSL *s) { - unsigned char *bufend; - unsigned char *p, *d; - CBB cbb, session_id; - size_t outlen; - int sl; + CBB cbb, server_hello, session_id; + size_t sl; memset(&cbb, 0, sizeof(cbb)); - bufend = (unsigned char *)s->internal->init_buf->data + SSL3_RT_MAX_PLAIN_LENGTH; - if (S3I(s)->hs.state == SSL3_ST_SW_SRVR_HELLO_A) { - d = p = ssl3_handshake_msg_start(s, SSL3_MT_SERVER_HELLO); - - if (!CBB_init_fixed(&cbb, p, bufend - p)) + if (!ssl3_handshake_msg_start(s, &cbb, &server_hello, + SSL3_MT_SERVER_HELLO)) goto err; - if (!CBB_add_u16(&cbb, s->version)) + if (!CBB_add_u16(&server_hello, s->version)) goto err; - if (!CBB_add_bytes(&cbb, s->s3->server_random, + if (!CBB_add_bytes(&server_hello, s->s3->server_random, sizeof(s->s3->server_random))) goto err; @@ -1101,35 +1187,32 @@ ssl3_send_server_hello(SSL *s) s->session->session_id_length = 0; sl = s->session->session_id_length; - if (sl > (int)sizeof(s->session->session_id)) { + if (sl > sizeof(s->session->session_id)) { SSLerror(s, ERR_R_INTERNAL_ERROR); goto err; } - - if (!CBB_add_u8_length_prefixed(&cbb, &session_id)) + if (!CBB_add_u8_length_prefixed(&server_hello, &session_id)) goto err; if (!CBB_add_bytes(&session_id, s->session->session_id, sl)) goto err; /* Cipher suite. */ - if (!CBB_add_u16(&cbb, + if (!CBB_add_u16(&server_hello, ssl3_cipher_get_value(S3I(s)->hs.new_cipher))) goto err; - /* Compression method. */ - if (!CBB_add_u8(&cbb, 0)) + /* Compression method (null). */ + if (!CBB_add_u8(&server_hello, 0)) goto err; - if (!CBB_finish(&cbb, NULL, &outlen)) - goto err; - - if ((p = ssl_add_serverhello_tlsext(s, p + outlen, - bufend)) == NULL) { + /* TLS extensions */ + if (!tlsext_server_build(s, &server_hello, SSL_TLSEXT_MSG_SH)) { SSLerror(s, ERR_R_INTERNAL_ERROR); goto err; } - ssl3_handshake_msg_finish(s, p - d); + if (!ssl3_handshake_msg_finish(s, &cbb)) + goto err; } /* SSL3_ST_SW_SRVR_HELLO_B */ @@ -1149,10 +1232,10 @@ ssl3_send_server_done(SSL *s) memset(&cbb, 0, sizeof(cbb)); if (S3I(s)->hs.state == SSL3_ST_SW_SRVR_DONE_A) { - if (!ssl3_handshake_msg_start_cbb(s, &cbb, &done, + if (!ssl3_handshake_msg_start(s, &cbb, &done, SSL3_MT_SERVER_DONE)) goto err; - if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) + if (!ssl3_handshake_msg_finish(s, &cbb)) goto err; S3I(s)->hs.state = SSL3_ST_SW_SRVR_DONE_B; @@ -1167,7 +1250,7 @@ ssl3_send_server_done(SSL *s) return (-1); } -int +static int ssl3_send_server_kex_dhe(SSL *s, CBB *cbb) { CBB dh_p, dh_g, dh_Ys; @@ -1328,7 +1411,7 @@ ssl3_send_server_kex_ecdhe_ecp(SSL *s, int nid, CBB *cbb) BN_CTX_free(bn_ctx); return (1); - + f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); err: @@ -1397,36 +1480,39 @@ ssl3_send_server_kex_ecdhe(SSL *s, CBB *cbb) int ssl3_send_server_key_exchange(SSL *s) { - CBB cbb; + CBB cbb, cbb_params, cbb_signature, server_kex; + const struct ssl_sigalg *sigalg = NULL; + unsigned char *signature = NULL; + size_t signature_len = 0; unsigned char *params = NULL; size_t params_len; - unsigned char *q; - unsigned char md_buf[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH]; - unsigned int u; - EVP_PKEY *pkey; const EVP_MD *md = NULL; - unsigned char *p, *d; - int al, i, j, n, kn; unsigned long type; - BUF_MEM *buf; EVP_MD_CTX md_ctx; + EVP_PKEY_CTX *pctx; + EVP_PKEY *pkey; + int al; memset(&cbb, 0, sizeof(cbb)); + memset(&cbb_params, 0, sizeof(cbb_params)); EVP_MD_CTX_init(&md_ctx); + if (S3I(s)->hs.state == SSL3_ST_SW_KEY_EXCH_A) { - type = S3I(s)->hs.new_cipher->algorithm_mkey; - buf = s->internal->init_buf; + if (!ssl3_handshake_msg_start(s, &cbb, &server_kex, + SSL3_MT_SERVER_KEY_EXCHANGE)) + goto err; - if (!CBB_init(&cbb, 0)) + if (!CBB_init(&cbb_params, 0)) goto err; + type = S3I(s)->hs.new_cipher->algorithm_mkey; if (type & SSL_kDHE) { - if (ssl3_send_server_kex_dhe(s, &cbb) != 1) + if (ssl3_send_server_kex_dhe(s, &cbb_params) != 1) goto err; } else if (type & SSL_kECDHE) { - if (ssl3_send_server_kex_ecdhe(s, &cbb) != 1) + if (ssl3_send_server_kex_ecdhe(s, &cbb_params) != 1) goto err; } else { al = SSL_AD_HANDSHAKE_FAILURE; @@ -1434,117 +1520,96 @@ ssl3_send_server_key_exchange(SSL *s) goto f_err; } - if (!CBB_finish(&cbb, ¶ms, ¶ms_len)) + if (!CBB_finish(&cbb_params, ¶ms, ¶ms_len)) + goto err; + + if (!CBB_add_bytes(&server_kex, params, params_len)) goto err; + /* Add signature unless anonymous. */ if (!(S3I(s)->hs.new_cipher->algorithm_auth & SSL_aNULL)) { - if ((pkey = ssl_get_sign_pkey( - s, S3I(s)->hs.new_cipher, &md)) == NULL) { + if ((pkey = ssl_get_sign_pkey(s, S3I(s)->hs.new_cipher, + &md, &sigalg)) == NULL) { al = SSL_AD_DECODE_ERROR; goto f_err; } - kn = EVP_PKEY_size(pkey); - } else { - pkey = NULL; - kn = 0; - } - if (!BUF_MEM_grow_clean(buf, ssl3_handshake_msg_hdr_len(s) + - params_len + kn)) { - SSLerror(s, ERR_LIB_BUF); - goto err; - } - - d = p = ssl3_handshake_msg_start(s, - SSL3_MT_SERVER_KEY_EXCHANGE); - - memcpy(p, params, params_len); - - free(params); - params = NULL; - - n = params_len; - p += params_len; - - /* not anonymous */ - if (pkey != NULL) { - /* - * n is the length of the params, they start at &(d[4]) - * and p points to the space at the end. - */ - if (pkey->type == EVP_PKEY_RSA && !SSL_USE_SIGALGS(s)) { - q = md_buf; - j = 0; - if (!EVP_DigestInit_ex(&md_ctx, EVP_md5_sha1(), - NULL)) - goto err; - EVP_DigestUpdate(&md_ctx, s->s3->client_random, - SSL3_RANDOM_SIZE); - EVP_DigestUpdate(&md_ctx, s->s3->server_random, - SSL3_RANDOM_SIZE); - EVP_DigestUpdate(&md_ctx, d, n); - EVP_DigestFinal_ex(&md_ctx, q, - (unsigned int *)&i); - q += i; - j += i; - if (RSA_sign(NID_md5_sha1, md_buf, j, - &(p[2]), &u, pkey->pkey.rsa) <= 0) { - SSLerror(s, ERR_R_RSA_LIB); - goto err; - } - s2n(u, p); - n += u + 2; - } else if (md) { - /* Send signature algorithm. */ - if (SSL_USE_SIGALGS(s)) { - if (!tls12_get_sigandhash(p, pkey, md)) { - /* Should never happen */ - al = SSL_AD_INTERNAL_ERROR; - SSLerror(s, ERR_R_INTERNAL_ERROR); - goto f_err; - } - p += 2; - } - EVP_SignInit_ex(&md_ctx, md, NULL); - EVP_SignUpdate(&md_ctx, - s->s3->client_random, - SSL3_RANDOM_SIZE); - EVP_SignUpdate(&md_ctx, - s->s3->server_random, - SSL3_RANDOM_SIZE); - EVP_SignUpdate(&md_ctx, d, n); - if (!EVP_SignFinal(&md_ctx, &p[2], - (unsigned int *)&i, pkey)) { - SSLerror(s, ERR_R_EVP_LIB); - goto err; + /* Send signature algorithm. */ + if (SSL_USE_SIGALGS(s)) { + if (!CBB_add_u16(&server_kex, sigalg->value)) { + al = SSL_AD_INTERNAL_ERROR; + SSLerror(s, ERR_R_INTERNAL_ERROR); + goto f_err; } - s2n(i, p); - n += i + 2; - if (SSL_USE_SIGALGS(s)) - n += 2; - } else { - /* Is this error check actually needed? */ - al = SSL_AD_HANDSHAKE_FAILURE; - SSLerror(s, SSL_R_UNKNOWN_PKEY_TYPE); - goto f_err; } + + if (!EVP_DigestSignInit(&md_ctx, &pctx, md, NULL, pkey)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if ((sigalg->flags & SIGALG_FLAG_RSA_PSS) && + (!EVP_PKEY_CTX_set_rsa_padding(pctx, + RSA_PKCS1_PSS_PADDING) || + !EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, -1))) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (!EVP_DigestSignUpdate(&md_ctx, s->s3->client_random, + SSL3_RANDOM_SIZE)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (!EVP_DigestSignUpdate(&md_ctx, s->s3->server_random, + SSL3_RANDOM_SIZE)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (!EVP_DigestSignUpdate(&md_ctx, params, params_len)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (!EVP_DigestSignFinal(&md_ctx, NULL, &signature_len) || + !signature_len) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if ((signature = calloc(1, signature_len)) == NULL) { + SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!EVP_DigestSignFinal(&md_ctx, signature, &signature_len)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + + if (!CBB_add_u16_length_prefixed(&server_kex, + &cbb_signature)) + goto err; + if (!CBB_add_bytes(&cbb_signature, signature, + signature_len)) + goto err; } - ssl3_handshake_msg_finish(s, n); - } + if (!ssl3_handshake_msg_finish(s, &cbb)) + goto err; - S3I(s)->hs.state = SSL3_ST_SW_KEY_EXCH_B; + S3I(s)->hs.state = SSL3_ST_SW_KEY_EXCH_B; + } EVP_MD_CTX_cleanup(&md_ctx); + free(params); + free(signature); return (ssl3_handshake_write(s)); - + f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); err: - free(params); - EVP_MD_CTX_cleanup(&md_ctx); + CBB_cleanup(&cbb_params); CBB_cleanup(&cbb); + EVP_MD_CTX_cleanup(&md_ctx); + free(params); + free(signature); return (-1); } @@ -1564,7 +1629,7 @@ ssl3_send_certificate_request(SSL *s) memset(&cbb, 0, sizeof(cbb)); if (S3I(s)->hs.state == SSL3_ST_SW_CERT_REQ_A) { - if (!ssl3_handshake_msg_start_cbb(s, &cbb, &cert_request, + if (!ssl3_handshake_msg_start(s, &cbb, &cert_request, SSL3_MT_CERTIFICATE_REQUEST)) goto err; @@ -1574,14 +1639,9 @@ ssl3_send_certificate_request(SSL *s) goto err; if (SSL_USE_SIGALGS(s)) { - unsigned char *sigalgs_data; - size_t sigalgs_len; - - tls12_get_req_sig_algs(s, &sigalgs_data, &sigalgs_len); - if (!CBB_add_u16_length_prefixed(&cert_request, &sigalgs)) goto err; - if (!CBB_add_bytes(&sigalgs, sigalgs_data, sigalgs_len)) + if (!ssl_sigalgs_build(&sigalgs, tls12_sigalgs, tls12_sigalgs_len)) goto err; } @@ -1604,7 +1664,7 @@ ssl3_send_certificate_request(SSL *s) goto err; } - if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) + if (!ssl3_handshake_msg_finish(s, &cbb)) goto err; S3I(s)->hs.state = SSL3_ST_SW_CERT_REQ_B; @@ -1620,15 +1680,17 @@ ssl3_send_certificate_request(SSL *s) } static int -ssl3_get_client_kex_rsa(SSL *s, unsigned char *p, long n) +ssl3_get_client_kex_rsa(SSL *s, CBS *cbs) { unsigned char fakekey[SSL_MAX_MASTER_KEY_LENGTH]; - unsigned char *d; - RSA *rsa = NULL; + unsigned char *pms = NULL; + unsigned char *p; + size_t pms_len = 0; EVP_PKEY *pkey = NULL; - int i, al; - - d = p; + RSA *rsa = NULL; + CBS enc_pms; + int decrypt_len; + int al = -1; arc4random_buf(fakekey, sizeof(fakekey)); fakekey[0] = s->client_version >> 8; @@ -1643,61 +1705,48 @@ ssl3_get_client_kex_rsa(SSL *s, unsigned char *p, long n) } rsa = pkey->pkey.rsa; - if (2 > n) + pms_len = RSA_size(rsa); + if (pms_len < SSL_MAX_MASTER_KEY_LENGTH) + goto err; + if ((pms = malloc(pms_len)) == NULL) + goto err; + p = pms; + + if (!CBS_get_u16_length_prefixed(cbs, &enc_pms)) goto truncated; - n2s(p, i); - if (n != i + 2) { + if (CBS_len(cbs) != 0 || CBS_len(&enc_pms) != RSA_size(rsa)) { SSLerror(s, SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG); goto err; - } else - n = i; + } - i = RSA_private_decrypt((int)n, p, p, rsa, RSA_PKCS1_PADDING); + decrypt_len = RSA_private_decrypt(CBS_len(&enc_pms), CBS_data(&enc_pms), + pms, rsa, RSA_PKCS1_PADDING); ERR_clear_error(); - al = -1; - - if (i != SSL_MAX_MASTER_KEY_LENGTH) { + if (decrypt_len != SSL_MAX_MASTER_KEY_LENGTH) { al = SSL_AD_DECODE_ERROR; /* SSLerror(s, SSL_R_BAD_RSA_DECRYPT); */ } - if (p - d + 2 > n) /* needed in the SSL3 case */ - goto truncated; - if ((al == -1) && !((p[0] == (s->client_version >> 8)) && - (p[1] == (s->client_version & 0xff)))) { + if ((al == -1) && !((pms[0] == (s->client_version >> 8)) && + (pms[1] == (s->client_version & 0xff)))) { /* - * The premaster secret must contain the same version - * number as the ClientHello to detect version rollback - * attacks (strangely, the protocol does not offer such - * protection for DH ciphersuites). - * However, buggy clients exist that send the negotiated - * protocol version instead if the server does not - * support the requested protocol version. - * If SSL_OP_TLS_ROLLBACK_BUG is set, tolerate such - * clients. + * The premaster secret must contain the same version number + * as the ClientHello to detect version rollback attacks + * (strangely, the protocol does not offer such protection for + * DH ciphersuites). + * + * The Klima-Pokorny-Rosa extension of Bleichenbacher's attack + * (http://eprint.iacr.org/2003/052/) exploits the version + * number check as a "bad version oracle" -- an alert would + * reveal that the plaintext corresponding to some ciphertext + * made up by the adversary is properly formatted except that + * the version number is wrong. To avoid such attacks, we should + * treat this just like any other decryption error. */ - if (!((s->internal->options & SSL_OP_TLS_ROLLBACK_BUG) && - (p[0] == (s->version >> 8)) && - (p[1] == (s->version & 0xff)))) { - al = SSL_AD_DECODE_ERROR; - /* SSLerror(s, SSL_R_BAD_PROTOCOL_VERSION_NUMBER); */ - - /* - * The Klima-Pokorny-Rosa extension of - * Bleichenbacher's attack - * (http://eprint.iacr.org/2003/052/) exploits - * the version number check as a "bad version - * oracle" -- an alert would reveal that the - * plaintext corresponding to some ciphertext - * made up by the adversary is properly - * formatted except that the version number is - * wrong. - * To avoid such attacks, we should treat this - * just like any other decryption error. - */ - } + al = SSL_AD_DECODE_ERROR; + /* SSLerror(s, SSL_R_BAD_PROTOCOL_VERSION_NUMBER); */ } if (al != -1) { @@ -1707,43 +1756,40 @@ ssl3_get_client_kex_rsa(SSL *s, unsigned char *p, long n) * on PKCS #1 v1.5 RSA padding (see RFC 2246, * section 7.4.7.1). */ - i = SSL_MAX_MASTER_KEY_LENGTH; p = fakekey; } s->session->master_key_length = tls1_generate_master_secret(s, - s->session->master_key, p, i); + s->session->master_key, p, SSL_MAX_MASTER_KEY_LENGTH); - explicit_bzero(p, i); + freezero(pms, pms_len); return (1); -truncated: + + truncated: al = SSL_AD_DECODE_ERROR; SSLerror(s, SSL_R_BAD_PACKET_LENGTH); -f_err: + f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); -err: + err: + freezero(pms, pms_len); + return (-1); } static int -ssl3_get_client_kex_dhe(SSL *s, unsigned char *p, long n) +ssl3_get_client_kex_dhe(SSL *s, CBS *cbs) { + int key_size = 0, key_len, al; + unsigned char *key = NULL; BIGNUM *bn = NULL; - int key_size, al; - CBS cbs, dh_Yc; + CBS dh_Yc; DH *dh; - if (n < 0) - goto err; - - CBS_init(&cbs, p, n); - - if (!CBS_get_u16_length_prefixed(&cbs, &dh_Yc)) + if (!CBS_get_u16_length_prefixed(cbs, &dh_Yc)) goto truncated; - - if (CBS_len(&cbs) != 0) + if (CBS_len(cbs) != 0) goto truncated; if (S3I(s)->tmp.dh == NULL) { @@ -1758,22 +1804,26 @@ ssl3_get_client_kex_dhe(SSL *s, unsigned char *p, long n) goto err; } - key_size = DH_compute_key(p, bn, dh); - if (key_size <= 0) { + if ((key_size = DH_size(dh)) <= 0) { + SSLerror(s, ERR_R_DH_LIB); + goto err; + } + if ((key = malloc(key_size)) == NULL) { + SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; + } + if ((key_len = DH_compute_key(key, bn, dh)) <= 0) { SSLerror(s, ERR_R_DH_LIB); - BN_clear_free(bn); goto err; } - s->session->master_key_length = - tls1_generate_master_secret( - s, s->session->master_key, p, key_size); - - explicit_bzero(p, key_size); + s->session->master_key_length = tls1_generate_master_secret(s, + s->session->master_key, key, key_len); DH_free(S3I(s)->tmp.dh); S3I(s)->tmp.dh = NULL; + freezero(key, key_size); BN_clear_free(bn); return (1); @@ -1784,160 +1834,99 @@ ssl3_get_client_kex_dhe(SSL *s, unsigned char *p, long n) f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); err: + freezero(key, key_size); + BN_clear_free(bn); + return (-1); } static int -ssl3_get_client_kex_ecdhe_ecp(SSL *s, unsigned char *p, long n) +ssl3_get_client_kex_ecdhe_ecp(SSL *s, CBS *cbs) { - EC_KEY *srvr_ecdh = NULL; - EVP_PKEY *clnt_pub_pkey = NULL; - EC_POINT *clnt_ecpoint = NULL; + unsigned char *key = NULL; + int key_size = 0, key_len; + EC_POINT *point = NULL; BN_CTX *bn_ctx = NULL; - int i, al; - - int ret = 1; - int key_size; - const EC_KEY *tkey; const EC_GROUP *group; - const BIGNUM *priv_key; + EC_KEY *ecdh; + CBS public; + int ret = -1; - /* Initialize structures for server's ECDH key pair. */ - if ((srvr_ecdh = EC_KEY_new()) == NULL) { - SSLerror(s, ERR_R_MALLOC_FAILURE); + if (!CBS_get_u8_length_prefixed(cbs, &public)) + goto err; + if (CBS_len(cbs) != 0) goto err; - } /* - * Use the ephemeral values we saved when - * generating the ServerKeyExchange message. + * Use the ephemeral values we saved when generating the + * ServerKeyExchange message. */ - tkey = S3I(s)->tmp.ecdh; - - group = EC_KEY_get0_group(tkey); - priv_key = EC_KEY_get0_private_key(tkey); - - if (!EC_KEY_set_group(srvr_ecdh, group) || - !EC_KEY_set_private_key(srvr_ecdh, priv_key)) { - SSLerror(s, ERR_R_EC_LIB); + if ((ecdh = S3I(s)->tmp.ecdh) == NULL) { + SSLerror(s, ERR_R_INTERNAL_ERROR); goto err; } + group = EC_KEY_get0_group(ecdh); - /* Let's get client's public key */ - if ((clnt_ecpoint = EC_POINT_new(group)) == NULL) { + /* + * Get client's public key from encoded point in the ClientKeyExchange + * message. + */ + if ((bn_ctx = BN_CTX_new()) == NULL) { SSLerror(s, ERR_R_MALLOC_FAILURE); goto err; } - - if (n == 0L) { - /* Client Publickey was in Client Certificate */ - if (((clnt_pub_pkey = X509_get_pubkey( - s->session->peer)) == NULL) || - (clnt_pub_pkey->type != EVP_PKEY_EC)) { - /* - * XXX: For now, we do not support client - * authentication using ECDH certificates - * so this branch (n == 0L) of the code is - * never executed. When that support is - * added, we ought to ensure the key - * received in the certificate is - * authorized for key agreement. - * ECDH_compute_key implicitly checks that - * the two ECDH shares are for the same - * group. - */ - al = SSL_AD_HANDSHAKE_FAILURE; - SSLerror(s, SSL_R_UNABLE_TO_DECODE_ECDH_CERTS); - goto f_err; - } - - if (EC_POINT_copy(clnt_ecpoint, - EC_KEY_get0_public_key(clnt_pub_pkey->pkey.ec)) - == 0) { - SSLerror(s, ERR_R_EC_LIB); - goto err; - } - ret = 2; /* Skip certificate verify processing */ - } else { - /* - * Get client's public key from encoded point - * in the ClientKeyExchange message. - */ - if ((bn_ctx = BN_CTX_new()) == NULL) { - SSLerror(s, ERR_R_MALLOC_FAILURE); - goto err; - } - - /* Get encoded point length */ - i = *p; - - p += 1; - if (n != 1 + i) { - SSLerror(s, ERR_R_EC_LIB); - goto err; - } - if (EC_POINT_oct2point(group, - clnt_ecpoint, p, i, bn_ctx) == 0) { - SSLerror(s, ERR_R_EC_LIB); - goto err; - } - /* - * p is pointing to somewhere in the buffer - * currently, so set it to the start. - */ - p = (unsigned char *)s->internal->init_buf->data; + if ((point = EC_POINT_new(group)) == NULL) { + SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; + } + if (EC_POINT_oct2point(group, point, CBS_data(&public), + CBS_len(&public), bn_ctx) == 0) { + SSLerror(s, ERR_R_EC_LIB); + goto err; } /* Compute the shared pre-master secret */ - key_size = ECDH_size(srvr_ecdh); - if (key_size <= 0) { + if ((key_size = ECDH_size(ecdh)) <= 0) { SSLerror(s, ERR_R_ECDH_LIB); goto err; } - i = ECDH_compute_key(p, key_size, clnt_ecpoint, srvr_ecdh, - NULL); - if (i <= 0) { + if ((key = malloc(key_size)) == NULL) { + SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; + } + if ((key_len = ECDH_compute_key(key, key_size, point, ecdh, + NULL)) <= 0) { SSLerror(s, ERR_R_ECDH_LIB); goto err; } - EVP_PKEY_free(clnt_pub_pkey); - EC_POINT_free(clnt_ecpoint); - EC_KEY_free(srvr_ecdh); - BN_CTX_free(bn_ctx); + /* Compute the master secret */ + s->session->master_key_length = tls1_generate_master_secret(s, + s->session->master_key, key, key_len); + EC_KEY_free(S3I(s)->tmp.ecdh); S3I(s)->tmp.ecdh = NULL; - /* Compute the master secret */ - s->session->master_key_length = - tls1_generate_master_secret( - s, s->session->master_key, p, i); - - explicit_bzero(p, i); - return (ret); + ret = 1; - f_err: - ssl3_send_alert(s, SSL3_AL_FATAL, al); err: - EVP_PKEY_free(clnt_pub_pkey); - EC_POINT_free(clnt_ecpoint); - EC_KEY_free(srvr_ecdh); + freezero(key, key_size); + EC_POINT_free(point); BN_CTX_free(bn_ctx); - return (-1); + + return (ret); } static int -ssl3_get_client_kex_ecdhe_ecx(SSL *s, unsigned char *p, long n) +ssl3_get_client_kex_ecdhe_ecx(SSL *s, CBS *cbs) { uint8_t *shared_key = NULL; - CBS cbs, ecpoint; + CBS ecpoint; int ret = -1; - if (n < 0) + if (!CBS_get_u8_length_prefixed(cbs, &ecpoint)) goto err; - - CBS_init(&cbs, p, n); - if (!CBS_get_u8_length_prefixed(&cbs, &ecpoint)) + if (CBS_len(cbs) != 0) goto err; if (CBS_len(&ecpoint) != X25519_KEY_LENGTH) goto err; @@ -1963,25 +1952,23 @@ ssl3_get_client_kex_ecdhe_ecx(SSL *s, unsigned char *p, long n) } static int -ssl3_get_client_kex_ecdhe(SSL *s, unsigned char *p, long n) +ssl3_get_client_kex_ecdhe(SSL *s, CBS *cbs) { if (S3I(s)->tmp.x25519 != NULL) - return ssl3_get_client_kex_ecdhe_ecx(s, p, n); + return ssl3_get_client_kex_ecdhe_ecx(s, cbs); - return ssl3_get_client_kex_ecdhe_ecp(s, p, n); + return ssl3_get_client_kex_ecdhe_ecp(s, cbs); } static int -ssl3_get_client_kex_gost(SSL *s, unsigned char *p, long n) +ssl3_get_client_kex_gost(SSL *s, CBS *cbs) { - EVP_PKEY_CTX *pkey_ctx; EVP_PKEY *client_pub_pkey = NULL, *pk = NULL; - unsigned char premaster_secret[32], *start; - size_t outlen = 32, inlen; + unsigned char premaster_secret[32]; unsigned long alg_a; - int Ttag, Tclass; - long Tlen; + size_t outlen = 32; + CBS gostblob; int al; int ret = 0; @@ -1990,8 +1977,11 @@ ssl3_get_client_kex_gost(SSL *s, unsigned char *p, long n) if (alg_a & SSL_aGOST01) pk = s->cert->pkeys[SSL_PKEY_GOST01].privatekey; - pkey_ctx = EVP_PKEY_CTX_new(pk, NULL); - EVP_PKEY_decrypt_init(pkey_ctx); + if ((pkey_ctx = EVP_PKEY_CTX_new(pk, NULL)) == NULL) + goto err; + if (EVP_PKEY_decrypt_init(pkey_ctx) <= 0) + goto gerr; + /* * If client certificate is present and is of the same type, * maybe use it for key exchange. @@ -1999,32 +1989,28 @@ ssl3_get_client_kex_gost(SSL *s, unsigned char *p, long n) * it is completely valid to use a client certificate for * authorization only. */ - client_pub_pkey = X509_get_pubkey(s->session->peer); - if (client_pub_pkey) { + if ((client_pub_pkey = X509_get_pubkey(s->session->peer)) != NULL) { if (EVP_PKEY_derive_set_peer(pkey_ctx, client_pub_pkey) <= 0) ERR_clear_error(); } - if (2 > n) - goto truncated; + /* Decrypt session key */ - if (ASN1_get_object((const unsigned char **)&p, &Tlen, &Ttag, - &Tclass, n) != V_ASN1_CONSTRUCTED || - Ttag != V_ASN1_SEQUENCE || Tclass != V_ASN1_UNIVERSAL) { - SSLerror(s, SSL_R_DECRYPTION_FAILED); - goto gerr; - } - start = p; - inlen = Tlen; + if (!CBS_get_asn1(cbs, &gostblob, CBS_ASN1_SEQUENCE)) + goto truncated; + if (CBS_len(cbs) != 0) + goto truncated; if (EVP_PKEY_decrypt(pkey_ctx, premaster_secret, &outlen, - start, inlen) <=0) { + CBS_data(&gostblob), CBS_len(&gostblob)) <= 0) { SSLerror(s, SSL_R_DECRYPTION_FAILED); goto gerr; } + /* Generate master secret */ s->session->master_key_length = tls1_generate_master_secret( s, s->session->master_key, premaster_secret, 32); + /* Check if pubkey from client certificate was used */ if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, -1, EVP_PKEY_CTRL_PEER_KEY, 2, NULL) > 0) @@ -2051,8 +2037,8 @@ int ssl3_get_client_key_exchange(SSL *s) { unsigned long alg_k; - unsigned char *p; int al, ok; + CBS cbs; long n; /* 2048 maxlen is a guess. How long a key does that permit? */ @@ -2061,21 +2047,24 @@ ssl3_get_client_key_exchange(SSL *s) if (!ok) return ((int)n); - p = (unsigned char *)s->internal->init_msg; + if (n < 0) + goto err; + + CBS_init(&cbs, s->internal->init_msg, n); alg_k = S3I(s)->hs.new_cipher->algorithm_mkey; if (alg_k & SSL_kRSA) { - if (ssl3_get_client_kex_rsa(s, p, n) != 1) + if (ssl3_get_client_kex_rsa(s, &cbs) != 1) goto err; } else if (alg_k & SSL_kDHE) { - if (ssl3_get_client_kex_dhe(s, p, n) != 1) + if (ssl3_get_client_kex_dhe(s, &cbs) != 1) goto err; } else if (alg_k & SSL_kECDHE) { - if (ssl3_get_client_kex_ecdhe(s, p, n) != 1) + if (ssl3_get_client_kex_ecdhe(s, &cbs) != 1) goto err; } else if (alg_k & SSL_kGOST) { - if (ssl3_get_client_kex_gost(s, p, n) != 1) + if (ssl3_get_client_kex_gost(s, &cbs) != 1) goto err; } else { al = SSL_AD_HANDSHAKE_FAILURE; @@ -2083,6 +2072,12 @@ ssl3_get_client_key_exchange(SSL *s) goto f_err; } + if (CBS_len(&cbs) != 0) { + al = SSL_AD_DECODE_ERROR; + SSLerror(s, SSL_R_BAD_PACKET_LENGTH); + goto f_err; + } + return (1); f_err: @@ -2094,14 +2089,19 @@ ssl3_get_client_key_exchange(SSL *s) int ssl3_get_cert_verify(SSL *s) { - EVP_PKEY *pkey = NULL; - unsigned char *p; - int al, ok, ret = 0; - long n; - int type = 0, i, j; - X509 *peer; + CBS cbs, signature; + const struct ssl_sigalg *sigalg = NULL; const EVP_MD *md = NULL; + EVP_PKEY *pkey = NULL; + X509 *peer = NULL; EVP_MD_CTX mctx; + int al, ok, verify; + const unsigned char *hdata; + size_t hdatalen; + int type = 0; + int ret = 0; + long n; + EVP_MD_CTX_init(&mctx); n = s->method->internal->ssl_get_message(s, SSL3_ST_SR_CERT_VRFY_A, @@ -2109,13 +2109,15 @@ ssl3_get_cert_verify(SSL *s) if (!ok) return ((int)n); + if (n < 0) + goto err; + + CBS_init(&cbs, s->internal->init_msg, n); + if (s->session->peer != NULL) { peer = s->session->peer; pkey = X509_get_pubkey(peer); type = X509_certificate_type(peer, pkey); - } else { - peer = NULL; - pkey = NULL; } if (S3I(s)->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) { @@ -2147,149 +2149,144 @@ ssl3_get_cert_verify(SSL *s) goto f_err; } - /* we now have a signature that we need to verify */ - p = (unsigned char *)s->internal->init_msg; - /* - * Check for broken implementations of GOST ciphersuites. - * - * If key is GOST and n is exactly 64, it is a bare - * signature without length field. - */ - if (n == 64 && (pkey->type == NID_id_GostR3410_94 || - pkey->type == NID_id_GostR3410_2001) ) { - i = 64; - } else { - if (SSL_USE_SIGALGS(s)) { - int sigalg = tls12_get_sigid(pkey); - /* Should never happen */ - if (sigalg == -1) { - SSLerror(s, ERR_R_INTERNAL_ERROR); - al = SSL_AD_INTERNAL_ERROR; - goto f_err; - } - if (2 > n) - goto truncated; - /* Check key type is consistent with signature */ - if (sigalg != (int)p[1]) { - SSLerror(s, SSL_R_WRONG_SIGNATURE_TYPE); - al = SSL_AD_DECODE_ERROR; - goto f_err; - } - md = tls12_get_hash(p[0]); - if (md == NULL) { - SSLerror(s, SSL_R_UNKNOWN_DIGEST); - al = SSL_AD_DECODE_ERROR; - goto f_err; - } - p += 2; - n -= 2; + if (!SSL_USE_SIGALGS(s)) { + if (!CBS_get_u16_length_prefixed(&cbs, &signature)) + goto err; + if (CBS_len(&signature) > EVP_PKEY_size(pkey)) { + SSLerror(s, SSL_R_WRONG_SIGNATURE_SIZE); + al = SSL_AD_DECODE_ERROR; + goto f_err; + } + if (CBS_len(&cbs) != 0) { + al = SSL_AD_DECODE_ERROR; + SSLerror(s, SSL_R_EXTRA_DATA_IN_MESSAGE); + goto f_err; } - if (2 > n) - goto truncated; - n2s(p, i); - n -= 2; - if (i > n) - goto truncated; - } - j = EVP_PKEY_size(pkey); - if ((i > j) || (n > j) || (n <= 0)) { - SSLerror(s, SSL_R_WRONG_SIGNATURE_SIZE); - al = SSL_AD_DECODE_ERROR; - goto f_err; } if (SSL_USE_SIGALGS(s)) { - long hdatalen = 0; - void *hdata; - hdatalen = BIO_get_mem_data(S3I(s)->handshake_buffer, &hdata); - if (hdatalen <= 0) { + EVP_PKEY_CTX *pctx; + uint16_t sigalg_value; + + if (!CBS_get_u16(&cbs, &sigalg_value)) + goto truncated; + if ((sigalg = ssl_sigalg(sigalg_value, tls12_sigalgs, + tls12_sigalgs_len)) == NULL || + (md = sigalg->md()) == NULL) { + SSLerror(s, SSL_R_UNKNOWN_DIGEST); + al = SSL_AD_DECODE_ERROR; + goto f_err; + } + if (!ssl_sigalg_pkey_ok(sigalg, pkey, 0)) { + SSLerror(s, SSL_R_WRONG_SIGNATURE_TYPE); + al = SSL_AD_DECODE_ERROR; + goto f_err; + } + + if (!CBS_get_u16_length_prefixed(&cbs, &signature)) + goto err; + if (CBS_len(&signature) > EVP_PKEY_size(pkey)) { + SSLerror(s, SSL_R_WRONG_SIGNATURE_SIZE); + al = SSL_AD_DECODE_ERROR; + goto f_err; + } + if (CBS_len(&cbs) != 0) { + al = SSL_AD_DECODE_ERROR; + SSLerror(s, SSL_R_EXTRA_DATA_IN_MESSAGE); + goto f_err; + } + + if (!tls1_transcript_data(s, &hdata, &hdatalen)) { SSLerror(s, ERR_R_INTERNAL_ERROR); al = SSL_AD_INTERNAL_ERROR; goto f_err; } - if (!EVP_VerifyInit_ex(&mctx, md, NULL) || - !EVP_VerifyUpdate(&mctx, hdata, hdatalen)) { + if (!EVP_DigestVerifyInit(&mctx, &pctx, md, NULL, pkey)) { SSLerror(s, ERR_R_EVP_LIB); al = SSL_AD_INTERNAL_ERROR; goto f_err; } - - if (EVP_VerifyFinal(&mctx, p, i, pkey) <= 0) { + if ((sigalg->flags & SIGALG_FLAG_RSA_PSS) && + (!EVP_PKEY_CTX_set_rsa_padding + (pctx, RSA_PKCS1_PSS_PADDING) || + !EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, -1))) { + al = SSL_AD_INTERNAL_ERROR; + goto f_err; + } + if (!EVP_DigestVerifyUpdate(&mctx, hdata, hdatalen)) { + SSLerror(s, ERR_R_EVP_LIB); + al = SSL_AD_INTERNAL_ERROR; + goto f_err; + } + if (EVP_DigestVerifyFinal(&mctx, CBS_data(&signature), + CBS_len(&signature)) <= 0) { al = SSL_AD_DECRYPT_ERROR; SSLerror(s, SSL_R_BAD_SIGNATURE); goto f_err; } - } else - if (pkey->type == EVP_PKEY_RSA) { - i = RSA_verify(NID_md5_sha1, S3I(s)->tmp.cert_verify_md, - MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, p, i, - pkey->pkey.rsa); - if (i < 0) { + } else if (pkey->type == EVP_PKEY_RSA) { + verify = RSA_verify(NID_md5_sha1, S3I(s)->tmp.cert_verify_md, + MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, CBS_data(&signature), + CBS_len(&signature), pkey->pkey.rsa); + if (verify < 0) { al = SSL_AD_DECRYPT_ERROR; SSLerror(s, SSL_R_BAD_RSA_DECRYPT); goto f_err; } - if (i == 0) { + if (verify == 0) { al = SSL_AD_DECRYPT_ERROR; SSLerror(s, SSL_R_BAD_RSA_SIGNATURE); goto f_err; } - } else - if (pkey->type == EVP_PKEY_EC) { - j = ECDSA_verify(pkey->save_type, + } else if (pkey->type == EVP_PKEY_EC) { + verify = ECDSA_verify(pkey->save_type, &(S3I(s)->tmp.cert_verify_md[MD5_DIGEST_LENGTH]), - SHA_DIGEST_LENGTH, p, i, pkey->pkey.ec); - if (j <= 0) { - /* bad signature */ + SHA_DIGEST_LENGTH, CBS_data(&signature), + CBS_len(&signature), pkey->pkey.ec); + if (verify <= 0) { al = SSL_AD_DECRYPT_ERROR; SSLerror(s, SSL_R_BAD_ECDSA_SIGNATURE); goto f_err; } - } else #ifndef OPENSSL_NO_GOST - if (pkey->type == NID_id_GostR3410_94 || + } else if (pkey->type == NID_id_GostR3410_94 || pkey->type == NID_id_GostR3410_2001) { - long hdatalen = 0; - void *hdata; - unsigned char signature[128]; - unsigned int siglen = sizeof(signature); - int nid; + unsigned char sigbuf[128]; + unsigned int siglen = sizeof(sigbuf); EVP_PKEY_CTX *pctx; + int nid; - hdatalen = BIO_get_mem_data(S3I(s)->handshake_buffer, &hdata); - if (hdatalen <= 0) { + if (!tls1_transcript_data(s, &hdata, &hdatalen)) { SSLerror(s, ERR_R_INTERNAL_ERROR); al = SSL_AD_INTERNAL_ERROR; goto f_err; } if (!EVP_PKEY_get_default_digest_nid(pkey, &nid) || - !(md = EVP_get_digestbynid(nid))) { + !(md = EVP_get_digestbynid(nid))) { SSLerror(s, ERR_R_EVP_LIB); al = SSL_AD_INTERNAL_ERROR; goto f_err; } - pctx = EVP_PKEY_CTX_new(pkey, NULL); - if (!pctx) { + if ((pctx = EVP_PKEY_CTX_new(pkey, NULL)) == NULL) { SSLerror(s, ERR_R_EVP_LIB); al = SSL_AD_INTERNAL_ERROR; goto f_err; } if (!EVP_DigestInit_ex(&mctx, md, NULL) || !EVP_DigestUpdate(&mctx, hdata, hdatalen) || - !EVP_DigestFinal(&mctx, signature, &siglen) || + !EVP_DigestFinal(&mctx, sigbuf, &siglen) || (EVP_PKEY_verify_init(pctx) <= 0) || (EVP_PKEY_CTX_set_signature_md(pctx, md) <= 0) || (EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_VERIFY, - EVP_PKEY_CTRL_GOST_SIG_FORMAT, - GOST_SIG_FORMAT_RS_LE, - NULL) <= 0)) { + EVP_PKEY_CTRL_GOST_SIG_FORMAT, + GOST_SIG_FORMAT_RS_LE, NULL) <= 0)) { SSLerror(s, ERR_R_EVP_LIB); al = SSL_AD_INTERNAL_ERROR; EVP_PKEY_CTX_free(pctx); goto f_err; } - - if (EVP_PKEY_verify(pctx, p, i, signature, siglen) <= 0) { + if (EVP_PKEY_verify(pctx, CBS_data(&signature), + CBS_len(&signature), sigbuf, siglen) <= 0) { al = SSL_AD_DECRYPT_ERROR; SSLerror(s, SSL_R_BAD_SIGNATURE); EVP_PKEY_CTX_free(pctx); @@ -2297,29 +2294,24 @@ ssl3_get_cert_verify(SSL *s) } EVP_PKEY_CTX_free(pctx); - } else #endif - { + } else { SSLerror(s, ERR_R_INTERNAL_ERROR); al = SSL_AD_UNSUPPORTED_CERTIFICATE; goto f_err; } - ret = 1; if (0) { -truncated: + truncated: al = SSL_AD_DECODE_ERROR; SSLerror(s, SSL_R_BAD_PACKET_LENGTH); -f_err: + f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); } -end: - if (S3I(s)->handshake_buffer) { - BIO_free(S3I(s)->handshake_buffer); - S3I(s)->handshake_buffer = NULL; - s->s3->flags &= ~TLS1_FLAGS_KEEP_HANDSHAKE; - } + end: + tls1_transcript_free(s); + err: EVP_MD_CTX_cleanup(&mctx); EVP_PKEY_free(pkey); return (ret); @@ -2420,11 +2412,8 @@ ssl3_get_client_certificate(SSL *s) al = SSL_AD_HANDSHAKE_FAILURE; goto f_err; } - /* No client certificate so digest cached records */ - if (S3I(s)->handshake_buffer && !tls1_digest_cached_records(s)) { - al = SSL_AD_INTERNAL_ERROR; - goto f_err; - } + /* No client certificate so free transcript. */ + tls1_transcript_free(s); } else { i = ssl_verify_cert_chain(s, sk); if (i <= 0) { @@ -2478,7 +2467,7 @@ int ssl3_send_server_certificate(SSL *s) { CBB cbb, server_cert; - X509 *x; + CERT_PKEY *cpk; /* * Server Certificate - RFC 5246, section 7.4.2. @@ -2487,17 +2476,17 @@ ssl3_send_server_certificate(SSL *s) memset(&cbb, 0, sizeof(cbb)); if (S3I(s)->hs.state == SSL3_ST_SW_CERT_A) { - if ((x = ssl_get_server_send_cert(s)) == NULL) { + if ((cpk = ssl_get_server_send_pkey(s)) == NULL) { SSLerror(s, ERR_R_INTERNAL_ERROR); return (0); } - if (!ssl3_handshake_msg_start_cbb(s, &cbb, &server_cert, + if (!ssl3_handshake_msg_start(s, &cbb, &server_cert, SSL3_MT_CERTIFICATE)) goto err; - if (!ssl3_output_cert_chain(s, &server_cert, x)) + if (!ssl3_output_cert_chain(s, &server_cert, cpk)) goto err; - if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) + if (!ssl3_handshake_msg_finish(s, &cbb)) goto err; S3I(s)->hs.state = SSL3_ST_SW_CERT_B; @@ -2516,78 +2505,44 @@ ssl3_send_server_certificate(SSL *s) int ssl3_send_newsession_ticket(SSL *s) { - unsigned char *d, *p, *macstart; - unsigned char *senc = NULL; - const unsigned char *const_p; - int len, slen_full, slen; - SSL_SESSION *sess; - unsigned int hlen; - EVP_CIPHER_CTX ctx; - HMAC_CTX hctx; + CBB cbb, session_ticket, ticket; SSL_CTX *tctx = s->initial_ctx; + size_t enc_session_len, enc_session_max_len, hmac_len; + size_t session_len = 0; + unsigned char *enc_session = NULL, *session = NULL; unsigned char iv[EVP_MAX_IV_LENGTH]; unsigned char key_name[16]; + unsigned char *hmac; + unsigned int hlen; + EVP_CIPHER_CTX ctx; + HMAC_CTX hctx; + int len; - if (S3I(s)->hs.state == SSL3_ST_SW_SESSION_TICKET_A) { - /* get session encoding length */ - slen_full = i2d_SSL_SESSION(s->session, NULL); - /* - * Some length values are 16 bits, so forget it if session is - * too long - */ - if (slen_full > 0xFF00) - goto err; - senc = malloc(slen_full); - if (!senc) - goto err; - p = senc; - i2d_SSL_SESSION(s->session, &p); + /* + * New Session Ticket - RFC 5077, section 3.3. + */ - /* - * Create a fresh copy (not shared with other threads) to - * clean up - */ - const_p = senc; - sess = d2i_SSL_SESSION(NULL, &const_p, slen_full); - if (sess == NULL) - goto err; + EVP_CIPHER_CTX_init(&ctx); + HMAC_CTX_init(&hctx); - /* ID is irrelevant for the ticket */ - sess->session_id_length = 0; + memset(&cbb, 0, sizeof(cbb)); - slen = i2d_SSL_SESSION(sess, NULL); - if (slen > slen_full) { - /* shouldn't ever happen */ + if (S3I(s)->hs.state == SSL3_ST_SW_SESSION_TICKET_A) { + if (!ssl3_handshake_msg_start(s, &cbb, &session_ticket, + SSL3_MT_NEWSESSION_TICKET)) goto err; - } - p = senc; - i2d_SSL_SESSION(sess, &p); - SSL_SESSION_free(sess); - /* - * Grow buffer if need be: the length calculation is as - * follows 1 (size of message name) + 3 (message length - * bytes) + 4 (ticket lifetime hint) + 2 (ticket length) + - * 16 (key name) + max_iv_len (iv length) + - * session_length + max_enc_block_size (max encrypted session - * length) + max_md_size (HMAC). - */ - if (!BUF_MEM_grow(s->internal->init_buf, ssl3_handshake_msg_hdr_len(s) + - 22 + EVP_MAX_IV_LENGTH + EVP_MAX_BLOCK_LENGTH + - EVP_MAX_MD_SIZE + slen)) + if (!SSL_SESSION_ticket(s->session, &session, &session_len)) + goto err; + if (session_len > 0xffff) goto err; - - d = p = ssl3_handshake_msg_start(s, SSL3_MT_NEWSESSION_TICKET); - - EVP_CIPHER_CTX_init(&ctx); - HMAC_CTX_init(&hctx); /* - * Initialize HMAC and cipher contexts. If callback present - * it does all the work otherwise use generated values - * from parent ctx. + * Initialize HMAC and cipher contexts. If callback is present + * it does all the work, otherwise use generated values from + * parent context. */ - if (tctx->internal->tlsext_ticket_key_cb) { + if (tctx->internal->tlsext_ticket_key_cb != NULL) { if (tctx->internal->tlsext_ticket_key_cb(s, key_name, iv, &ctx, &hctx, 1) < 0) { EVP_CIPHER_CTX_cleanup(&ctx); @@ -2602,55 +2557,80 @@ ssl3_send_newsession_ticket(SSL *s) memcpy(key_name, tctx->internal->tlsext_tick_key_name, 16); } + /* Encrypt the session state. */ + enc_session_max_len = session_len + EVP_MAX_BLOCK_LENGTH; + if ((enc_session = calloc(1, enc_session_max_len)) == NULL) + goto err; + enc_session_len = 0; + if (!EVP_EncryptUpdate(&ctx, enc_session, &len, session, + session_len)) + goto err; + enc_session_len += len; + if (!EVP_EncryptFinal_ex(&ctx, enc_session + enc_session_len, + &len)) + goto err; + enc_session_len += len; + + if (enc_session_len > enc_session_max_len) + goto err; + + /* Generate the HMAC. */ + if (!HMAC_Update(&hctx, key_name, sizeof(key_name))) + goto err; + if (!HMAC_Update(&hctx, iv, EVP_CIPHER_CTX_iv_length(&ctx))) + goto err; + if (!HMAC_Update(&hctx, enc_session, enc_session_len)) + goto err; + + if ((hmac_len = HMAC_size(&hctx)) <= 0) + goto err; + /* * Ticket lifetime hint (advisory only): * We leave this unspecified for resumed session * (for simplicity), and guess that tickets for new * sessions will live as long as their sessions. */ - l2n(s->internal->hit ? 0 : s->session->timeout, p); - - /* Skip ticket length for now */ - p += 2; - /* Output key name */ - macstart = p; - memcpy(p, key_name, 16); - p += 16; - /* output IV */ - memcpy(p, iv, EVP_CIPHER_CTX_iv_length(&ctx)); - p += EVP_CIPHER_CTX_iv_length(&ctx); - /* Encrypt session data */ - EVP_EncryptUpdate(&ctx, p, &len, senc, slen); - p += len; - EVP_EncryptFinal_ex(&ctx, p, &len); - p += len; - EVP_CIPHER_CTX_cleanup(&ctx); - - HMAC_Update(&hctx, macstart, p - macstart); - HMAC_Final(&hctx, p, &hlen); - HMAC_CTX_cleanup(&hctx); - p += hlen; - - /* Now write out lengths: p points to end of data written */ - /* Total length */ - len = p - d; - - /* Skip ticket lifetime hint. */ - p = d + 4; - s2n(len - 6, p); /* Message length */ - - ssl3_handshake_msg_finish(s, len); + if (!CBB_add_u32(&session_ticket, + s->internal->hit ? 0 : s->session->timeout)) + goto err; - S3I(s)->hs.state = SSL3_ST_SW_SESSION_TICKET_B; + if (!CBB_add_u16_length_prefixed(&session_ticket, &ticket)) + goto err; + if (!CBB_add_bytes(&ticket, key_name, sizeof(key_name))) + goto err; + if (!CBB_add_bytes(&ticket, iv, EVP_CIPHER_CTX_iv_length(&ctx))) + goto err; + if (!CBB_add_bytes(&ticket, enc_session, enc_session_len)) + goto err; + if (!CBB_add_space(&ticket, &hmac, hmac_len)) + goto err; + + if (!HMAC_Final(&hctx, hmac, &hlen)) + goto err; + if (hlen != hmac_len) + goto err; + + if (!ssl3_handshake_msg_finish(s, &cbb)) + goto err; - freezero(senc, slen_full); + S3I(s)->hs.state = SSL3_ST_SW_SESSION_TICKET_B; } + EVP_CIPHER_CTX_cleanup(&ctx); + HMAC_CTX_cleanup(&hctx); + freezero(session, session_len); + free(enc_session); + /* SSL3_ST_SW_SESSION_TICKET_B */ return (ssl3_handshake_write(s)); err: - freezero(senc, slen_full); + CBB_cleanup(&cbb); + EVP_CIPHER_CTX_cleanup(&ctx); + HMAC_CTX_cleanup(&hctx); + freezero(session, session_len); + free(enc_session); return (-1); } @@ -2663,7 +2643,7 @@ ssl3_send_cert_status(SSL *s) memset(&cbb, 0, sizeof(cbb)); if (S3I(s)->hs.state == SSL3_ST_SW_CERT_STATUS_A) { - if (!ssl3_handshake_msg_start_cbb(s, &cbb, &certstatus, + if (!ssl3_handshake_msg_start(s, &cbb, &certstatus, SSL3_MT_CERTIFICATE_STATUS)) goto err; if (!CBB_add_u8(&certstatus, s->tlsext_status_type)) @@ -2673,7 +2653,7 @@ ssl3_send_cert_status(SSL *s) if (!CBB_add_bytes(&ocspresp, s->internal->tlsext_ocsp_resp, s->internal->tlsext_ocsp_resplen)) goto err; - if (!ssl3_handshake_msg_finish_cbb(s, &cbb)) + if (!ssl3_handshake_msg_finish(s, &cbb)) goto err; S3I(s)->hs.state = SSL3_ST_SW_CERT_STATUS_B; diff --git a/ssl/ssl_tlsext.c b/ssl/ssl_tlsext.c index 2abfa723..00afe1e5 100644 --- a/ssl/ssl_tlsext.c +++ b/ssl/ssl_tlsext.c @@ -1,8 +1,8 @@ -/* $OpenBSD: ssl_tlsext.c,v 1.17.4.1 2017/12/09 13:43:25 jsing Exp $ */ +/* $OpenBSD: ssl_tlsext.c,v 1.44.2.1 2019/05/15 19:25:15 tb Exp $ */ /* - * Copyright (c) 2016, 2017 Joel Sing + * Copyright (c) 2016, 2017, 2019 Joel Sing * Copyright (c) 2017 Doug Hogan - * Copyright (c) 2017 Bob Beck + * Copyright (c) 2018-2019 Bob Beck * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,11 +16,13 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include #include "ssl_locl.h" #include "bytestring.h" +#include "ssl_sigalgs.h" #include "ssl_tlsext.h" /* @@ -28,7 +30,7 @@ */ int -tlsext_alpn_clienthello_needs(SSL *s) +tlsext_alpn_client_needs(SSL *s) { /* ALPN protos have been specified and this is the initial handshake */ return s->internal->alpn_client_proto_list != NULL && @@ -36,7 +38,7 @@ tlsext_alpn_clienthello_needs(SSL *s) } int -tlsext_alpn_clienthello_build(SSL *s, CBB *cbb) +tlsext_alpn_client_build(SSL *s, CBB *cbb) { CBB protolist; @@ -54,7 +56,7 @@ tlsext_alpn_clienthello_build(SSL *s, CBB *cbb) } int -tlsext_alpn_clienthello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_alpn_server_parse(SSL *s, CBS *cbs, int *alert) { CBS proto_name_list, alpn; const unsigned char *selected; @@ -102,13 +104,13 @@ tlsext_alpn_clienthello_parse(SSL *s, CBS *cbs, int *alert) } int -tlsext_alpn_serverhello_needs(SSL *s) +tlsext_alpn_server_needs(SSL *s) { return S3I(s)->alpn_selected != NULL; } int -tlsext_alpn_serverhello_build(SSL *s, CBB *cbb) +tlsext_alpn_server_build(SSL *s, CBB *cbb) { CBB list, selected; @@ -129,7 +131,7 @@ tlsext_alpn_serverhello_build(SSL *s, CBB *cbb) } int -tlsext_alpn_serverhello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_alpn_client_parse(SSL *s, CBS *cbs, int *alert) { CBS list, proto; @@ -163,34 +165,34 @@ tlsext_alpn_serverhello_parse(SSL *s, CBS *cbs, int *alert) } /* - * Supported Elliptic Curves - RFC 4492 section 5.1.1 + * Supported Groups - RFC 7919 section 2 */ int -tlsext_ec_clienthello_needs(SSL *s) +tlsext_supportedgroups_client_needs(SSL *s) { - return ssl_has_ecc_ciphers(s); + return ssl_has_ecc_ciphers(s) || + (S3I(s)->hs_tls13.max_version >= TLS1_3_VERSION); } int -tlsext_ec_clienthello_build(SSL *s, CBB *cbb) +tlsext_supportedgroups_client_build(SSL *s, CBB *cbb) { - CBB curvelist; - size_t curves_len; + const uint16_t *groups; + size_t groups_len; + CBB grouplist; int i; - const uint16_t *curves; - - tls1_get_curvelist(s, 0, &curves, &curves_len); - if (curves_len == 0) { + tls1_get_group_list(s, 0, &groups, &groups_len); + if (groups_len == 0) { SSLerror(s, ERR_R_INTERNAL_ERROR); return 0; } - if (!CBB_add_u16_length_prefixed(cbb, &curvelist)) + if (!CBB_add_u16_length_prefixed(cbb, &grouplist)) return 0; - for (i = 0; i < curves_len; i++) { - if (!CBB_add_u16(&curvelist, curves[i])) + for (i = 0; i < groups_len; i++) { + if (!CBB_add_u16(&grouplist, groups[i])) return 0; } @@ -201,48 +203,48 @@ tlsext_ec_clienthello_build(SSL *s, CBB *cbb) } int -tlsext_ec_clienthello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_supportedgroups_server_parse(SSL *s, CBS *cbs, int *alert) { - CBS curvelist; - size_t curves_len; + CBS grouplist; + size_t groups_len; - if (!CBS_get_u16_length_prefixed(cbs, &curvelist)) + if (!CBS_get_u16_length_prefixed(cbs, &grouplist)) goto err; if (CBS_len(cbs) != 0) goto err; - curves_len = CBS_len(&curvelist); - if (curves_len == 0 || curves_len % 2 != 0) + groups_len = CBS_len(&grouplist); + if (groups_len == 0 || groups_len % 2 != 0) goto err; - curves_len /= 2; + groups_len /= 2; if (!s->internal->hit) { + uint16_t *groups; int i; - uint16_t *curves; if (SSI(s)->tlsext_supportedgroups != NULL) goto err; - if ((curves = reallocarray(NULL, curves_len, + if ((groups = reallocarray(NULL, groups_len, sizeof(uint16_t))) == NULL) { *alert = TLS1_AD_INTERNAL_ERROR; return 0; } - for (i = 0; i < curves_len; i++) { - if (!CBS_get_u16(&curvelist, &curves[i])) { - free(curves); + for (i = 0; i < groups_len; i++) { + if (!CBS_get_u16(&grouplist, &groups[i])) { + free(groups); goto err; } } - if (CBS_len(&curvelist) != 0) { - free(curves); + if (CBS_len(&grouplist) != 0) { + free(groups); goto err; } - SSI(s)->tlsext_supportedgroups = curves; - SSI(s)->tlsext_supportedgroups_length = curves_len; + SSI(s)->tlsext_supportedgroups = groups; + SSI(s)->tlsext_supportedgroups_length = groups_len; } return 1; @@ -254,28 +256,29 @@ tlsext_ec_clienthello_parse(SSL *s, CBS *cbs, int *alert) /* This extension is never used by the server. */ int -tlsext_ec_serverhello_needs(SSL *s) +tlsext_supportedgroups_server_needs(SSL *s) { return 0; } int -tlsext_ec_serverhello_build(SSL *s, CBB *cbb) +tlsext_supportedgroups_server_build(SSL *s, CBB *cbb) { return 0; } int -tlsext_ec_serverhello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_supportedgroups_client_parse(SSL *s, CBS *cbs, int *alert) { /* * Servers should not send this extension per the RFC. * - * However, F5 sends it by mistake (case ID 492780) so we need to skip - * over it. This bug is from at least 2014 but as of 2017, there - * are still large sites with this bug in production. + * However, certain F5 BIG-IP systems incorrectly send it. This bug is + * from at least 2014 but as of 2017, there are still large sites with + * this unpatched in production. As a result, we need to currently skip + * over the extension and ignore its content: * - * https://devcentral.f5.com/questions/disable-supported-elliptic-curves-extension-from-server + * https://support.f5.com/csp/article/K37345003 */ if (!CBS_skip(cbs, CBS_len(cbs))) { *alert = TLS1_AD_INTERNAL_ERROR; @@ -332,37 +335,39 @@ tlsext_ecpf_parse(SSL *s, CBS *cbs, int *alert) if (!s->internal->hit) { if (!CBS_stow(&ecpf, &(SSI(s)->tlsext_ecpointformatlist), - &(SSI(s)->tlsext_ecpointformatlist_length))) - goto err; + &(SSI(s)->tlsext_ecpointformatlist_length))) { + *alert = TLS1_AD_INTERNAL_ERROR; + return 0; + } } return 1; err: - *alert = TLS1_AD_INTERNAL_ERROR; + *alert = SSL_AD_DECODE_ERROR; return 0; } int -tlsext_ecpf_clienthello_needs(SSL *s) +tlsext_ecpf_client_needs(SSL *s) { return ssl_has_ecc_ciphers(s); } int -tlsext_ecpf_clienthello_build(SSL *s, CBB *cbb) +tlsext_ecpf_client_build(SSL *s, CBB *cbb) { return tlsext_ecpf_build(s, cbb); } int -tlsext_ecpf_clienthello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_ecpf_server_parse(SSL *s, CBS *cbs, int *alert) { return tlsext_ecpf_parse(s, cbs, alert); } int -tlsext_ecpf_serverhello_needs(SSL *s) +tlsext_ecpf_server_needs(SSL *s) { if (s->version == DTLS1_VERSION) return 0; @@ -371,13 +376,13 @@ tlsext_ecpf_serverhello_needs(SSL *s) } int -tlsext_ecpf_serverhello_build(SSL *s, CBB *cbb) +tlsext_ecpf_server_build(SSL *s, CBB *cbb) { return tlsext_ecpf_build(s, cbb); } int -tlsext_ecpf_serverhello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_ecpf_client_parse(SSL *s, CBS *cbs, int *alert) { return tlsext_ecpf_parse(s, cbs, alert); } @@ -386,13 +391,13 @@ tlsext_ecpf_serverhello_parse(SSL *s, CBS *cbs, int *alert) * Renegotiation Indication - RFC 5746. */ int -tlsext_ri_clienthello_needs(SSL *s) +tlsext_ri_client_needs(SSL *s) { return (s->internal->renegotiate); } int -tlsext_ri_clienthello_build(SSL *s, CBB *cbb) +tlsext_ri_client_build(SSL *s, CBB *cbb) { CBB reneg; @@ -408,7 +413,7 @@ tlsext_ri_clienthello_build(SSL *s, CBB *cbb) } int -tlsext_ri_clienthello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_ri_server_parse(SSL *s, CBS *cbs, int *alert) { CBS reneg; @@ -436,13 +441,13 @@ tlsext_ri_clienthello_parse(SSL *s, CBS *cbs, int *alert) } int -tlsext_ri_serverhello_needs(SSL *s) +tlsext_ri_server_needs(SSL *s) { return (S3I(s)->send_connection_binding); } int -tlsext_ri_serverhello_build(SSL *s, CBB *cbb) +tlsext_ri_server_build(SSL *s, CBB *cbb) { CBB reneg; @@ -461,7 +466,7 @@ tlsext_ri_serverhello_build(SSL *s, CBB *cbb) } int -tlsext_ri_serverhello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_ri_client_parse(SSL *s, CBS *cbs, int *alert) { CBS reneg, prev_client, prev_server; @@ -518,24 +523,30 @@ tlsext_ri_serverhello_parse(SSL *s, CBS *cbs, int *alert) * Signature Algorithms - RFC 5246 section 7.4.1.4.1. */ int -tlsext_sigalgs_clienthello_needs(SSL *s) +tlsext_sigalgs_client_needs(SSL *s) { return (TLS1_get_client_version(s) >= TLS1_2_VERSION); } int -tlsext_sigalgs_clienthello_build(SSL *s, CBB *cbb) +tlsext_sigalgs_client_build(SSL *s, CBB *cbb) { - unsigned char *sigalgs_data; - size_t sigalgs_len; + uint16_t *tls_sigalgs = tls12_sigalgs; + size_t tls_sigalgs_len = tls12_sigalgs_len; CBB sigalgs; - tls12_get_req_sig_algs(s, &sigalgs_data, &sigalgs_len); + if (TLS1_get_client_version(s) >= TLS1_3_VERSION && + S3I(s)->hs_tls13.min_version >= TLS1_3_VERSION) { + tls_sigalgs = tls13_sigalgs; + tls_sigalgs_len = tls13_sigalgs_len; + } if (!CBB_add_u16_length_prefixed(cbb, &sigalgs)) return 0; - if (!CBB_add_bytes(&sigalgs, sigalgs_data, sigalgs_len)) + + if (!ssl_sigalgs_build(&sigalgs, tls_sigalgs, tls_sigalgs_len)) return 0; + if (!CBB_flush(cbb)) return 0; @@ -543,30 +554,34 @@ tlsext_sigalgs_clienthello_build(SSL *s, CBB *cbb) } int -tlsext_sigalgs_clienthello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_sigalgs_server_parse(SSL *s, CBS *cbs, int *alert) { CBS sigalgs; if (!CBS_get_u16_length_prefixed(cbs, &sigalgs)) return 0; + if (CBS_len(&sigalgs) % 2 != 0 || CBS_len(&sigalgs) > 64) + return 0; + if (!CBS_stow(&sigalgs, &S3I(s)->hs.sigalgs, &S3I(s)->hs.sigalgs_len)) + return 0; - return tls1_process_sigalgs(s, &sigalgs); + return 1; } int -tlsext_sigalgs_serverhello_needs(SSL *s) +tlsext_sigalgs_server_needs(SSL *s) { return 0; } int -tlsext_sigalgs_serverhello_build(SSL *s, CBB *cbb) +tlsext_sigalgs_server_build(SSL *s, CBB *cbb) { return 0; } int -tlsext_sigalgs_serverhello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_sigalgs_client_parse(SSL *s, CBS *cbs, int *alert) { /* As per the RFC, servers must not send this extension. */ return 0; @@ -576,13 +591,13 @@ tlsext_sigalgs_serverhello_parse(SSL *s, CBS *cbs, int *alert) * Server Name Indication - RFC 6066, section 3. */ int -tlsext_sni_clienthello_needs(SSL *s) +tlsext_sni_client_needs(SSL *s) { return (s->tlsext_hostname != NULL); } int -tlsext_sni_clienthello_build(SSL *s, CBB *cbb) +tlsext_sni_client_build(SSL *s, CBB *cbb) { CBB server_name_list, host_name; @@ -602,7 +617,7 @@ tlsext_sni_clienthello_build(SSL *s, CBB *cbb) } int -tlsext_sni_clienthello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_sni_server_parse(SSL *s, CBS *cbs, int *alert) { CBS server_name_list, host_name; uint8_t name_type; @@ -660,19 +675,19 @@ tlsext_sni_clienthello_parse(SSL *s, CBS *cbs, int *alert) } int -tlsext_sni_serverhello_needs(SSL *s) +tlsext_sni_server_needs(SSL *s) { return (s->session->tlsext_hostname != NULL); } int -tlsext_sni_serverhello_build(SSL *s, CBB *cbb) +tlsext_sni_server_build(SSL *s, CBB *cbb) { return 1; } int -tlsext_sni_serverhello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_sni_client_parse(SSL *s, CBS *cbs, int *alert) { if (s->tlsext_hostname == NULL || CBS_len(cbs) != 0) { *alert = TLS1_AD_UNRECOGNIZED_NAME; @@ -710,14 +725,14 @@ tlsext_sni_serverhello_parse(SSL *s, CBS *cbs, int *alert) */ int -tlsext_ocsp_clienthello_needs(SSL *s) +tlsext_ocsp_client_needs(SSL *s) { return (s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp && s->version != DTLS1_VERSION); } int -tlsext_ocsp_clienthello_build(SSL *s, CBB *cbb) +tlsext_ocsp_client_build(SSL *s, CBB *cbb) { CBB respid_list, respid, exts; unsigned char *ext_data; @@ -761,7 +776,7 @@ tlsext_ocsp_clienthello_build(SSL *s, CBB *cbb) } int -tlsext_ocsp_clienthello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_ocsp_server_parse(SSL *s, CBS *cbs, int *alert) { int failure = SSL_AD_DECODE_ERROR; CBS respid_list, respid, exts; @@ -835,19 +850,19 @@ tlsext_ocsp_clienthello_parse(SSL *s, CBS *cbs, int *alert) } int -tlsext_ocsp_serverhello_needs(SSL *s) +tlsext_ocsp_server_needs(SSL *s) { return s->internal->tlsext_status_expected; } int -tlsext_ocsp_serverhello_build(SSL *s, CBB *cbb) +tlsext_ocsp_server_build(SSL *s, CBB *cbb) { return 1; } int -tlsext_ocsp_serverhello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_ocsp_client_parse(SSL *s, CBS *cbs, int *alert) { if (s->tlsext_status_type == -1) { *alert = TLS1_AD_UNSUPPORTED_EXTENSION; @@ -862,7 +877,7 @@ tlsext_ocsp_serverhello_parse(SSL *s, CBS *cbs, int *alert) * SessionTicket extension - RFC 5077 section 3.2 */ int -tlsext_sessionticket_clienthello_needs(SSL *s) +tlsext_sessionticket_client_needs(SSL *s) { /* * Send session ticket extension when enabled and not overridden. @@ -883,7 +898,7 @@ tlsext_sessionticket_clienthello_needs(SSL *s) } int -tlsext_sessionticket_clienthello_build(SSL *s, CBB *cbb) +tlsext_sessionticket_client_build(SSL *s, CBB *cbb) { /* * Signal that we support session tickets by sending an empty @@ -926,7 +941,7 @@ tlsext_sessionticket_clienthello_build(SSL *s, CBB *cbb) } int -tlsext_sessionticket_clienthello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_sessionticket_server_parse(SSL *s, CBS *cbs, int *alert) { if (s->internal->tls_session_ticket_ext_cb) { if (!s->internal->tls_session_ticket_ext_cb(s, CBS_data(cbs), @@ -947,22 +962,21 @@ tlsext_sessionticket_clienthello_parse(SSL *s, CBS *cbs, int *alert) } int -tlsext_sessionticket_serverhello_needs(SSL *s) +tlsext_sessionticket_server_needs(SSL *s) { return (s->internal->tlsext_ticket_expected && !(SSL_get_options(s) & SSL_OP_NO_TICKET)); } int -tlsext_sessionticket_serverhello_build(SSL *s, CBB *cbb) +tlsext_sessionticket_server_build(SSL *s, CBB *cbb) { /* Empty ticket */ - return 1; } int -tlsext_sessionticket_serverhello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_sessionticket_client_parse(SSL *s, CBS *cbs, int *alert) { if (s->internal->tls_session_ticket_ext_cb) { if (!s->internal->tls_session_ticket_ext_cb(s, CBS_data(cbs), @@ -990,13 +1004,13 @@ tlsext_sessionticket_serverhello_parse(SSL *s, CBS *cbs, int *alert) #ifndef OPENSSL_NO_SRTP int -tlsext_srtp_clienthello_needs(SSL *s) +tlsext_srtp_client_needs(SSL *s) { return SSL_IS_DTLS(s) && SSL_get_srtp_profiles(s) != NULL; } int -tlsext_srtp_clienthello_build(SSL *s, CBB *cbb) +tlsext_srtp_client_build(SSL *s, CBB *cbb) { CBB profiles, mki; int ct, i; @@ -1033,7 +1047,7 @@ tlsext_srtp_clienthello_build(SSL *s, CBB *cbb) } int -tlsext_srtp_clienthello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_srtp_server_parse(SSL *s, CBS *cbs, int *alert) { SRTP_PROTECTION_PROFILE *cprof, *sprof; STACK_OF(SRTP_PROTECTION_PROFILE) *clnt = NULL, *srvr; @@ -1113,13 +1127,13 @@ tlsext_srtp_clienthello_parse(SSL *s, CBS *cbs, int *alert) } int -tlsext_srtp_serverhello_needs(SSL *s) +tlsext_srtp_server_needs(SSL *s) { return SSL_IS_DTLS(s) && SSL_get_selected_srtp_profile(s) != NULL; } int -tlsext_srtp_serverhello_build(SSL *s, CBB *cbb) +tlsext_srtp_server_build(SSL *s, CBB *cbb) { SRTP_PROTECTION_PROFILE *profile; CBB srtp, mki; @@ -1143,7 +1157,7 @@ tlsext_srtp_serverhello_build(SSL *s, CBB *cbb) } int -tlsext_srtp_serverhello_parse(SSL *s, CBS *cbs, int *alert) +tlsext_srtp_client_parse(SSL *s, CBS *cbs, int *alert) { STACK_OF(SRTP_PROTECTION_PROFILE) *clnt; SRTP_PROTECTION_PROFILE *prof; @@ -1193,126 +1207,712 @@ tlsext_srtp_serverhello_parse(SSL *s, CBS *cbs, int *alert) #endif /* OPENSSL_NO_SRTP */ +/* + * TLSv1.3 Key Share - RFC 8446 section 4.2.8. + */ +int +tlsext_keyshare_client_needs(SSL *s) +{ + /* XXX once this gets initialized when we get tls13_client.c */ + if (S3I(s)->hs_tls13.max_version == 0) + return 0; + return (!SSL_IS_DTLS(s) && S3I(s)->hs_tls13.max_version >= + TLS1_3_VERSION); +} + +int +tlsext_keyshare_client_build(SSL *s, CBB *cbb) +{ + uint8_t *public_key = NULL, *private_key = NULL; + CBB client_shares, key_exchange; + + /* Generate and provide key shares. */ + if (!CBB_add_u16_length_prefixed(cbb, &client_shares)) + return 0; + + /* XXX - other groups. */ + + /* Generate X25519 key pair. */ + if ((public_key = malloc(X25519_KEY_LENGTH)) == NULL) + goto err; + if ((private_key = malloc(X25519_KEY_LENGTH)) == NULL) + goto err; + X25519_keypair(public_key, private_key); + + /* Add the group and serialize the public key. */ + if (!CBB_add_u16(&client_shares, tls1_ec_nid2curve_id(NID_X25519))) + goto err; + if (!CBB_add_u16_length_prefixed(&client_shares, &key_exchange)) + goto err; + if (!CBB_add_bytes(&key_exchange, public_key, X25519_KEY_LENGTH)) + goto err; + + if (!CBB_flush(cbb)) + goto err; + + S3I(s)->hs_tls13.x25519_public = public_key; + S3I(s)->hs_tls13.x25519_private = private_key; + + return 1; + + err: + freezero(public_key, X25519_KEY_LENGTH); + freezero(private_key, X25519_KEY_LENGTH); + + return 0; +} + +int +tlsext_keyshare_server_parse(SSL *s, CBS *cbs, int *alert) +{ + CBS client_shares; + CBS key_exchange; + uint16_t group; + size_t out_len; + int ret = 0; + + if (!CBS_get_u16_length_prefixed(cbs, &client_shares)) + goto err; + + if (CBS_len(cbs) != 0) + goto err; + + while (CBS_len(&client_shares) > 0) { + + /* Unpack client share. */ + if (!CBS_get_u16(&client_shares, &group)) + goto err; + + if (!CBS_get_u16_length_prefixed(&client_shares, &key_exchange)) + goto err; + + /* + * Skip this client share if not X25519 + * XXX support other groups later. + * XXX enforce group can only appear once. + */ + if (S3I(s)->hs_tls13.x25519_peer_public != NULL || + group != tls1_ec_nid2curve_id(NID_X25519)) + continue; + + if (CBS_len(&key_exchange) != X25519_KEY_LENGTH) + goto err; + + if (!CBS_stow(&key_exchange, &S3I(s)->hs_tls13.x25519_peer_public, + &out_len)) + goto err; + + ret = 1; + } + + return ret; + + err: + *alert = SSL_AD_DECODE_ERROR; + return 0; +} + +int +tlsext_keyshare_server_needs(SSL *s) +{ + if (SSL_IS_DTLS(s) || s->version < TLS1_3_VERSION) + return 0; + + return tlsext_extension_seen(s, TLSEXT_TYPE_key_share); +} + +int +tlsext_keyshare_server_build(SSL *s, CBB *cbb) +{ + uint8_t *public_key = NULL, *private_key = NULL; + CBB key_exchange; + + /* XXX deduplicate with client code */ + + /* X25519 */ + if (S3I(s)->hs_tls13.x25519_peer_public == NULL) + return 0; + + /* Generate X25519 key pair. */ + if ((public_key = malloc(X25519_KEY_LENGTH)) == NULL) + goto err; + if ((private_key = malloc(X25519_KEY_LENGTH)) == NULL) + goto err; + X25519_keypair(public_key, private_key); + + /* Add the group and serialize the public key. */ + if (!CBB_add_u16(cbb, tls1_ec_nid2curve_id(NID_X25519))) + goto err; + if (!CBB_add_u16_length_prefixed(cbb, &key_exchange)) + goto err; + if (!CBB_add_bytes(&key_exchange, public_key, X25519_KEY_LENGTH)) + goto err; + + if (!CBB_flush(cbb)) + goto err; + + S3I(s)->hs_tls13.x25519_public = public_key; + S3I(s)->hs_tls13.x25519_private = private_key; + + return 1; + + err: + freezero(public_key, X25519_KEY_LENGTH); + freezero(private_key, X25519_KEY_LENGTH); + + return 0; +} + +int +tlsext_keyshare_client_parse(SSL *s, CBS *cbs, int *alert) +{ + CBS key_exchange; + uint16_t group; + size_t out_len; + + /* Unpack server share. */ + if (!CBS_get_u16(cbs, &group)) + goto err; + + /* Handle other groups and verify that they're valid. */ + if (group != tls1_ec_nid2curve_id(NID_X25519)) + goto err; + + if (!CBS_get_u16_length_prefixed(cbs, &key_exchange)) + goto err; + + if (CBS_len(&key_exchange) != X25519_KEY_LENGTH) + goto err; + + if (!CBS_stow(&key_exchange, &S3I(s)->hs_tls13.x25519_peer_public, + &out_len)) + goto err; + + return 1; + + err: + *alert = SSL_AD_DECODE_ERROR; + return 0; +} + +/* + * Supported Versions - RFC 8446 section 4.2.1. + */ +int +tlsext_versions_client_needs(SSL *s) +{ + if (SSL_IS_DTLS(s)) + return 0; + return (S3I(s)->hs_tls13.max_version >= TLS1_3_VERSION); +} + +int +tlsext_versions_client_build(SSL *s, CBB *cbb) +{ + uint16_t max, min; + uint16_t version; + CBB versions; + + max = S3I(s)->hs_tls13.max_version; + min = S3I(s)->hs_tls13.min_version; + + if (min < TLS1_VERSION) + return 0; + + if (!CBB_add_u8_length_prefixed(cbb, &versions)) + return 0; + + /* XXX - fix, but contiguous for now... */ + for (version = max; version >= min; version--) { + if (!CBB_add_u16(&versions, version)) + return 0; + } + + if (!CBB_flush(cbb)) + return 0; + + return 1; +} + +int +tlsext_versions_server_parse(SSL *s, CBS *cbs, int *alert) +{ + CBS versions; + uint16_t version; + uint16_t max, min; + uint16_t matched_version = 0; + + max = S3I(s)->hs_tls13.max_version; + min = S3I(s)->hs_tls13.min_version; + + if (!CBS_get_u8_length_prefixed(cbs, &versions)) + goto err; + + while (CBS_len(&versions) > 0) { + if (!CBS_get_u16(&versions, &version)) + goto err; + /* + * XXX What is below implements client preference, and + * ignores any server preference entirely. + */ + if (matched_version == 0 && version >= min && version <= max) + matched_version = version; + } + + /* + * XXX if we haven't mached a version we should + * fail - but we currently need to succeed to + * ignore this before the server code for 1.3 + * is set up and initialized. + */ + if (max == 0) + return 1; /* XXX */ + + if (matched_version != 0) { + s->version = matched_version; + return 1; + } + + *alert = SSL_AD_PROTOCOL_VERSION; + return 0; + +err: + *alert = SSL_AD_DECODE_ERROR; + return 0; +} + +int +tlsext_versions_server_needs(SSL *s) +{ + return (!SSL_IS_DTLS(s) && s->version >= TLS1_3_VERSION); +} + +int +tlsext_versions_server_build(SSL *s, CBB *cbb) +{ + if (!CBB_add_u16(cbb, TLS1_3_VERSION)) + return 0; + /* XXX set 1.2 in legacy version? */ + + return 1; +} + +int +tlsext_versions_client_parse(SSL *s, CBS *cbs, int *alert) +{ + uint16_t selected_version; + + if (!CBS_get_u16(cbs, &selected_version)) { + *alert = SSL_AD_DECODE_ERROR; + return 0; + } + + if (selected_version < TLS1_3_VERSION) { + *alert = SSL_AD_ILLEGAL_PARAMETER; + return 0; + } + + /* XXX test between min and max once initialization code goes in */ + S3I(s)->hs_tls13.server_version = selected_version; + + return 1; +} + + +/* + * Cookie - RFC 8446 section 4.2.2. + */ + +int +tlsext_cookie_client_needs(SSL *s) +{ + if (SSL_IS_DTLS(s)) + return 0; + if (S3I(s)->hs_tls13.max_version < TLS1_3_VERSION) + return 0; + return (S3I(s)->hs_tls13.cookie_len > 0 && + S3I(s)->hs_tls13.cookie != NULL); +} + +int +tlsext_cookie_client_build(SSL *s, CBB *cbb) +{ + CBB cookie; + + if (!CBB_add_u16_length_prefixed(cbb, &cookie)) + return 0; + + if (!CBB_add_bytes(&cookie, S3I(s)->hs_tls13.cookie, + S3I(s)->hs_tls13.cookie_len)) + return 0; + + if (!CBB_flush(cbb)) + return 0; + + return 1; +} + +int +tlsext_cookie_server_parse(SSL *s, CBS *cbs, int *alert) +{ + CBS cookie; + + if (!CBS_get_u16_length_prefixed(cbs, &cookie)) + goto err; + + if (CBS_len(&cookie) != S3I(s)->hs_tls13.cookie_len) + goto err; + + /* + * Check provided cookie value against what server previously + * sent - client *MUST* send the same cookie with new CR after + * a cookie is sent by the server with an HRR. + */ + if (!CBS_mem_equal(&cookie, S3I(s)->hs_tls13.cookie, + S3I(s)->hs_tls13.cookie_len)) { + /* XXX special cookie mismatch alert? */ + *alert = SSL_AD_ILLEGAL_PARAMETER; + return 0; + } + + return 1; + + err: + *alert = SSL_AD_DECODE_ERROR; + return 0; +} + +int +tlsext_cookie_server_needs(SSL *s) +{ + + if (SSL_IS_DTLS(s)) + return 0; + if (S3I(s)->hs_tls13.max_version < TLS1_3_VERSION) + return 0; + /* + * Server needs to set cookie value in tls13 handshake + * in order to send one, should only be sent with HRR. + */ + return (S3I(s)->hs_tls13.cookie_len > 0 && + S3I(s)->hs_tls13.cookie != NULL); +} + +int +tlsext_cookie_server_build(SSL *s, CBB *cbb) +{ + CBB cookie; + + /* XXX deduplicate with client code */ + + if (!CBB_add_u16_length_prefixed(cbb, &cookie)) + return 0; + + if (!CBB_add_bytes(&cookie, S3I(s)->hs_tls13.cookie, + S3I(s)->hs_tls13.cookie_len)) + return 0; + + if (!CBB_flush(cbb)) + return 0; + + return 1; +} + +int +tlsext_cookie_client_parse(SSL *s, CBS *cbs, int *alert) +{ + CBS cookie; + + /* + * XXX This currently assumes we will not get a second + * HRR from a server with a cookie to process after accepting + * one from the server in the same handshake + */ + if (S3I(s)->hs_tls13.cookie != NULL || + S3I(s)->hs_tls13.cookie_len != 0) { + *alert = SSL_AD_ILLEGAL_PARAMETER; + return 0; + } + + if (!CBS_get_u16_length_prefixed(cbs, &cookie)) + goto err; + + if (!CBS_stow(&cookie, &S3I(s)->hs_tls13.cookie, + &S3I(s)->hs_tls13.cookie_len)) + goto err; + + return 1; + + err: + *alert = SSL_AD_DECODE_ERROR; + return 0; +} + +struct tls_extension_funcs { + int (*needs)(SSL *s); + int (*build)(SSL *s, CBB *cbb); + int (*parse)(SSL *s, CBS *cbs, int *alert); +}; + struct tls_extension { uint16_t type; - int (*clienthello_needs)(SSL *s); - int (*clienthello_build)(SSL *s, CBB *cbb); - int (*clienthello_parse)(SSL *s, CBS *cbs, int *alert); - int (*serverhello_needs)(SSL *s); - int (*serverhello_build)(SSL *s, CBB *cbb); - int (*serverhello_parse)(SSL *s, CBS *cbs, int *alert); + uint16_t messages; + struct tls_extension_funcs client; + struct tls_extension_funcs server; }; static struct tls_extension tls_extensions[] = { + { + .type = TLSEXT_TYPE_supported_versions, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_SH | + SSL_TLSEXT_MSG_HRR, + .client = { + .needs = tlsext_versions_client_needs, + .build = tlsext_versions_client_build, + .parse = tlsext_versions_server_parse, + }, + .server = { + .needs = tlsext_versions_server_needs, + .build = tlsext_versions_server_build, + .parse = tlsext_versions_client_parse, + }, + }, + { + .type = TLSEXT_TYPE_key_share, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_SH | + SSL_TLSEXT_MSG_HRR, + .client = { + .needs = tlsext_keyshare_client_needs, + .build = tlsext_keyshare_client_build, + .parse = tlsext_keyshare_server_parse, + }, + .server = { + .needs = tlsext_keyshare_server_needs, + .build = tlsext_keyshare_server_build, + .parse = tlsext_keyshare_client_parse, + }, + }, { .type = TLSEXT_TYPE_server_name, - .clienthello_needs = tlsext_sni_clienthello_needs, - .clienthello_build = tlsext_sni_clienthello_build, - .clienthello_parse = tlsext_sni_clienthello_parse, - .serverhello_needs = tlsext_sni_serverhello_needs, - .serverhello_build = tlsext_sni_serverhello_build, - .serverhello_parse = tlsext_sni_serverhello_parse, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_EE, + .client = { + .needs = tlsext_sni_client_needs, + .build = tlsext_sni_client_build, + .parse = tlsext_sni_server_parse, + }, + .server = { + .needs = tlsext_sni_server_needs, + .build = tlsext_sni_server_build, + .parse = tlsext_sni_client_parse, + }, }, { .type = TLSEXT_TYPE_renegotiate, - .clienthello_needs = tlsext_ri_clienthello_needs, - .clienthello_build = tlsext_ri_clienthello_build, - .clienthello_parse = tlsext_ri_clienthello_parse, - .serverhello_needs = tlsext_ri_serverhello_needs, - .serverhello_build = tlsext_ri_serverhello_build, - .serverhello_parse = tlsext_ri_serverhello_parse, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_SH, + .client = { + .needs = tlsext_ri_client_needs, + .build = tlsext_ri_client_build, + .parse = tlsext_ri_server_parse, + }, + .server = { + .needs = tlsext_ri_server_needs, + .build = tlsext_ri_server_build, + .parse = tlsext_ri_client_parse, + }, }, { .type = TLSEXT_TYPE_status_request, - .clienthello_needs = tlsext_ocsp_clienthello_needs, - .clienthello_build = tlsext_ocsp_clienthello_build, - .clienthello_parse = tlsext_ocsp_clienthello_parse, - .serverhello_needs = tlsext_ocsp_serverhello_needs, - .serverhello_build = tlsext_ocsp_serverhello_build, - .serverhello_parse = tlsext_ocsp_serverhello_parse, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_CR | + SSL_TLSEXT_MSG_CT, + .client = { + .needs = tlsext_ocsp_client_needs, + .build = tlsext_ocsp_client_build, + .parse = tlsext_ocsp_server_parse, + }, + .server = { + .needs = tlsext_ocsp_server_needs, + .build = tlsext_ocsp_server_build, + .parse = tlsext_ocsp_client_parse, + }, }, { .type = TLSEXT_TYPE_ec_point_formats, - .clienthello_needs = tlsext_ecpf_clienthello_needs, - .clienthello_build = tlsext_ecpf_clienthello_build, - .clienthello_parse = tlsext_ecpf_clienthello_parse, - .serverhello_needs = tlsext_ecpf_serverhello_needs, - .serverhello_build = tlsext_ecpf_serverhello_build, - .serverhello_parse = tlsext_ecpf_serverhello_parse, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_SH, + .client = { + .needs = tlsext_ecpf_client_needs, + .build = tlsext_ecpf_client_build, + .parse = tlsext_ecpf_server_parse, + }, + .server = { + .needs = tlsext_ecpf_server_needs, + .build = tlsext_ecpf_server_build, + .parse = tlsext_ecpf_client_parse, + }, }, { - .type = TLSEXT_TYPE_elliptic_curves, - .clienthello_needs = tlsext_ec_clienthello_needs, - .clienthello_build = tlsext_ec_clienthello_build, - .clienthello_parse = tlsext_ec_clienthello_parse, - .serverhello_needs = tlsext_ec_serverhello_needs, - .serverhello_build = tlsext_ec_serverhello_build, - .serverhello_parse = tlsext_ec_serverhello_parse, + .type = TLSEXT_TYPE_supported_groups, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_EE, + .client = { + .needs = tlsext_supportedgroups_client_needs, + .build = tlsext_supportedgroups_client_build, + .parse = tlsext_supportedgroups_server_parse, + }, + .server = { + .needs = tlsext_supportedgroups_server_needs, + .build = tlsext_supportedgroups_server_build, + .parse = tlsext_supportedgroups_client_parse, + }, }, { .type = TLSEXT_TYPE_session_ticket, - .clienthello_needs = tlsext_sessionticket_clienthello_needs, - .clienthello_build = tlsext_sessionticket_clienthello_build, - .clienthello_parse = tlsext_sessionticket_clienthello_parse, - .serverhello_needs = tlsext_sessionticket_serverhello_needs, - .serverhello_build = tlsext_sessionticket_serverhello_build, - .serverhello_parse = tlsext_sessionticket_serverhello_parse, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_SH, + .client = { + .needs = tlsext_sessionticket_client_needs, + .build = tlsext_sessionticket_client_build, + .parse = tlsext_sessionticket_server_parse, + }, + .server = { + .needs = tlsext_sessionticket_server_needs, + .build = tlsext_sessionticket_server_build, + .parse = tlsext_sessionticket_client_parse, + }, }, { .type = TLSEXT_TYPE_signature_algorithms, - .clienthello_needs = tlsext_sigalgs_clienthello_needs, - .clienthello_build = tlsext_sigalgs_clienthello_build, - .clienthello_parse = tlsext_sigalgs_clienthello_parse, - .serverhello_needs = tlsext_sigalgs_serverhello_needs, - .serverhello_build = tlsext_sigalgs_serverhello_build, - .serverhello_parse = tlsext_sigalgs_serverhello_parse, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_CR, + .client = { + .needs = tlsext_sigalgs_client_needs, + .build = tlsext_sigalgs_client_build, + .parse = tlsext_sigalgs_server_parse, + }, + .server = { + .needs = tlsext_sigalgs_server_needs, + .build = tlsext_sigalgs_server_build, + .parse = tlsext_sigalgs_client_parse, + }, }, { .type = TLSEXT_TYPE_application_layer_protocol_negotiation, - .clienthello_needs = tlsext_alpn_clienthello_needs, - .clienthello_build = tlsext_alpn_clienthello_build, - .clienthello_parse = tlsext_alpn_clienthello_parse, - .serverhello_needs = tlsext_alpn_serverhello_needs, - .serverhello_build = tlsext_alpn_serverhello_build, - .serverhello_parse = tlsext_alpn_serverhello_parse, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_EE, + .client = { + .needs = tlsext_alpn_client_needs, + .build = tlsext_alpn_client_build, + .parse = tlsext_alpn_server_parse, + }, + .server = { + .needs = tlsext_alpn_server_needs, + .build = tlsext_alpn_server_build, + .parse = tlsext_alpn_client_parse, + }, + }, + { + .type = TLSEXT_TYPE_cookie, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_HRR, + .client = { + .needs = tlsext_cookie_client_needs, + .build = tlsext_cookie_client_build, + .parse = tlsext_cookie_server_parse, + }, + .server = { + .needs = tlsext_cookie_server_needs, + .build = tlsext_cookie_server_build, + .parse = tlsext_cookie_client_parse, + }, }, #ifndef OPENSSL_NO_SRTP { .type = TLSEXT_TYPE_use_srtp, - .clienthello_needs = tlsext_srtp_clienthello_needs, - .clienthello_build = tlsext_srtp_clienthello_build, - .clienthello_parse = tlsext_srtp_clienthello_parse, - .serverhello_needs = tlsext_srtp_serverhello_needs, - .serverhello_build = tlsext_srtp_serverhello_build, - .serverhello_parse = tlsext_srtp_serverhello_parse, + .messages = SSL_TLSEXT_MSG_CH | SSL_TLSEXT_MSG_SH /* XXX */ | + SSL_TLSEXT_MSG_EE, + .client = { + .needs = tlsext_srtp_client_needs, + .build = tlsext_srtp_client_build, + .parse = tlsext_srtp_server_parse, + }, + .server = { + .needs = tlsext_srtp_server_needs, + .build = tlsext_srtp_server_build, + .parse = tlsext_srtp_client_parse, + }, } #endif /* OPENSSL_NO_SRTP */ }; #define N_TLS_EXTENSIONS (sizeof(tls_extensions) / sizeof(*tls_extensions)) +/* Ensure that extensions fit in a uint32_t bitmask. */ +CTASSERT(N_TLS_EXTENSIONS <= (sizeof(uint32_t) * 8)); + +struct tls_extension * +tls_extension_find(uint16_t type, size_t *tls_extensions_idx) +{ + size_t i; + + for (i = 0; i < N_TLS_EXTENSIONS; i++) { + if (tls_extensions[i].type == type) { + *tls_extensions_idx = i; + return &tls_extensions[i]; + } + } + + return NULL; +} + int -tlsext_clienthello_build(SSL *s, CBB *cbb) +tlsext_extension_seen(SSL *s, uint16_t type) { - CBB extensions, extension_data; + size_t idx; + + if (tls_extension_find(type, &idx) == NULL) + return 0; + return ((S3I(s)->hs.extensions_seen & (1 << idx)) != 0); +} + +static struct tls_extension_funcs * +tlsext_funcs(struct tls_extension *tlsext, int is_server) +{ + if (is_server) + return &tlsext->server; + + return &tlsext->client; +} + +static int +tlsext_build(SSL *s, CBB *cbb, int is_server, uint16_t msg_type) +{ + struct tls_extension_funcs *ext; struct tls_extension *tlsext; + CBB extensions, extension_data; int extensions_present = 0; size_t i; + uint16_t version; + + if (is_server) + version = s->version; + else + version = TLS1_get_client_version(s); if (!CBB_add_u16_length_prefixed(cbb, &extensions)) return 0; for (i = 0; i < N_TLS_EXTENSIONS; i++) { tlsext = &tls_extensions[i]; + ext = tlsext_funcs(tlsext, is_server); + + /* RFC 8446 Section 4.2 */ + if (version >= TLS1_3_VERSION && + !(tlsext->messages & msg_type)) + continue; - if (!tlsext->clienthello_needs(s)) + if (!ext->needs(s)) continue; if (!CBB_add_u16(&extensions, tlsext->type)) return 0; if (!CBB_add_u16_length_prefixed(&extensions, &extension_data)) return 0; - if (!tls_extensions[i].clienthello_build(s, &extension_data)) + + if (!ext->build(s, &extension_data)) return 0; extensions_present = 1; @@ -1327,88 +1927,116 @@ tlsext_clienthello_build(SSL *s, CBB *cbb) return 1; } -int -tlsext_clienthello_parse_one(SSL *s, CBS *cbs, uint16_t type, int *alert) +static int +tlsext_parse(SSL *s, CBS *cbs, int *alert, int is_server, uint16_t msg_type) { + struct tls_extension_funcs *ext; struct tls_extension *tlsext; - size_t i; + CBS extensions, extension_data; + uint16_t type; + size_t idx; + uint16_t version; - for (i = 0; i < N_TLS_EXTENSIONS; i++) { - tlsext = &tls_extensions[i]; + S3I(s)->hs.extensions_seen = 0; - if (tlsext->type != type) - continue; - if (!tlsext->clienthello_parse(s, cbs, alert)) - return 0; - if (CBS_len(cbs) != 0) { - *alert = SSL_AD_DECODE_ERROR; - return 0; - } + if (is_server) + version = s->version; + else + version = TLS1_get_client_version(s); + /* An empty extensions block is valid. */ + if (CBS_len(cbs) == 0) return 1; - } - - /* Not found. */ - return 2; -} -int -tlsext_serverhello_build(SSL *s, CBB *cbb) -{ - CBB extensions, extension_data; - struct tls_extension *tlsext; - int extensions_present = 0; - size_t i; + *alert = SSL_AD_DECODE_ERROR; - if (!CBB_add_u16_length_prefixed(cbb, &extensions)) + if (!CBS_get_u16_length_prefixed(cbs, &extensions)) return 0; - for (i = 0; i < N_TLS_EXTENSIONS; i++) { - tlsext = &tls_extensions[i]; + while (CBS_len(&extensions) > 0) { + if (!CBS_get_u16(&extensions, &type)) + return 0; + if (!CBS_get_u16_length_prefixed(&extensions, &extension_data)) + return 0; - if (!tlsext->serverhello_needs(s)) + if (s->internal->tlsext_debug_cb != NULL) + s->internal->tlsext_debug_cb(s, is_server, type, + (unsigned char *)CBS_data(&extension_data), + CBS_len(&extension_data), + s->internal->tlsext_debug_arg); + + /* Unknown extensions are ignored. */ + if ((tlsext = tls_extension_find(type, &idx)) == NULL) continue; - if (!CBB_add_u16(&extensions, tlsext->type)) + /* RFC 8446 Section 4.2 */ + if (version >= TLS1_3_VERSION && + !(tlsext->messages & msg_type)) { + *alert = SSL_AD_ILLEGAL_PARAMETER; return 0; - if (!CBB_add_u16_length_prefixed(&extensions, &extension_data)) + } + + /* Check for duplicate known extensions. */ + if ((S3I(s)->hs.extensions_seen & (1 << idx)) != 0) return 0; - if (!tlsext->serverhello_build(s, &extension_data)) + S3I(s)->hs.extensions_seen |= (1 << idx); + + ext = tlsext_funcs(tlsext, is_server); + if (!ext->parse(s, &extension_data, alert)) return 0; - extensions_present = 1; + if (CBS_len(&extension_data) != 0) + return 0; } - if (!extensions_present) - CBB_discard_child(cbb); + return 1; +} - if (!CBB_flush(cbb)) - return 0; +static void +tlsext_client_reset_state(SSL *s) +{ + s->internal->servername_done = 0; + s->tlsext_status_type = -1; + S3I(s)->renegotiate_seen = 0; + free(S3I(s)->alpn_selected); + S3I(s)->alpn_selected = NULL; + s->internal->srtp_profile = NULL; +} - return 1; +int +tlsext_client_build(SSL *s, CBB *cbb, uint16_t msg_type) +{ + return tlsext_build(s, cbb, 0, msg_type); } int -tlsext_serverhello_parse_one(SSL *s, CBS *cbs, uint16_t type, int *alert) +tlsext_server_parse(SSL *s, CBS *cbs, int *alert, uint16_t msg_type) { - struct tls_extension *tlsext; - size_t i; + /* XXX - this possibly should be done by the caller... */ + tlsext_client_reset_state(s); - for (i = 0; i < N_TLS_EXTENSIONS; i++) { - tlsext = &tls_extensions[i]; + return tlsext_parse(s, cbs, alert, 0, msg_type); +} - if (tlsext->type != type) - continue; - if (!tlsext->serverhello_parse(s, cbs, alert)) - return 0; - if (CBS_len(cbs) != 0) { - *alert = SSL_AD_DECODE_ERROR; - return 0; - } +static void +tlsext_server_reset_state(SSL *s) +{ + S3I(s)->renegotiate_seen = 0; + free(S3I(s)->alpn_selected); + S3I(s)->alpn_selected = NULL; +} - return 1; - } +int +tlsext_server_build(SSL *s, CBB *cbb, uint16_t msg_type) +{ + return tlsext_build(s, cbb, 1, msg_type); +} + +int +tlsext_client_parse(SSL *s, CBS *cbs, int *alert, uint16_t msg_type) +{ + /* XXX - this possibly should be done by the caller... */ + tlsext_server_reset_state(s); - /* Not found. */ - return 2; + return tlsext_parse(s, cbs, alert, 1, msg_type); } diff --git a/ssl/ssl_tlsext.h b/ssl/ssl_tlsext.h index 7c6250a7..2121ef66 100644 --- a/ssl/ssl_tlsext.h +++ b/ssl/ssl_tlsext.h @@ -1,7 +1,8 @@ -/* $OpenBSD: ssl_tlsext.h,v 1.10 2017/08/27 02:58:04 doug Exp $ */ +/* $OpenBSD: ssl_tlsext.h,v 1.21 2019/01/28 15:44:33 beck Exp $ */ /* * Copyright (c) 2016, 2017 Joel Sing * Copyright (c) 2017 Doug Hogan + * Copyright (c) 2019 Bob Beck * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,75 +17,114 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -int tlsext_alpn_clienthello_needs(SSL *s); -int tlsext_alpn_clienthello_build(SSL *s, CBB *cbb); -int tlsext_alpn_clienthello_parse(SSL *s, CBS *cbs, int *alert); -int tlsext_alpn_serverhello_needs(SSL *s); -int tlsext_alpn_serverhello_build(SSL *s, CBB *cbb); -int tlsext_alpn_serverhello_parse(SSL *s, CBS *cbs, int *alert); - -int tlsext_ri_clienthello_needs(SSL *s); -int tlsext_ri_clienthello_build(SSL *s, CBB *cbb); -int tlsext_ri_clienthello_parse(SSL *s, CBS *cbs, int *alert); -int tlsext_ri_serverhello_needs(SSL *s); -int tlsext_ri_serverhello_build(SSL *s, CBB *cbb); -int tlsext_ri_serverhello_parse(SSL *s, CBS *cbs, int *alert); - -int tlsext_sigalgs_clienthello_needs(SSL *s); -int tlsext_sigalgs_clienthello_build(SSL *s, CBB *cbb); -int tlsext_sigalgs_clienthello_parse(SSL *s, CBS *cbs, int *alert); -int tlsext_sigalgs_serverhello_needs(SSL *s); -int tlsext_sigalgs_serverhello_build(SSL *s, CBB *cbb); -int tlsext_sigalgs_serverhello_parse(SSL *s, CBS *cbs, int *alert); - -int tlsext_sni_clienthello_needs(SSL *s); -int tlsext_sni_clienthello_build(SSL *s, CBB *cbb); -int tlsext_sni_clienthello_parse(SSL *s, CBS *cbs, int *alert); -int tlsext_sni_serverhello_needs(SSL *s); -int tlsext_sni_serverhello_build(SSL *s, CBB *cbb); -int tlsext_sni_serverhello_parse(SSL *s, CBS *cbs, int *alert); - -int tlsext_ec_clienthello_needs(SSL *s); -int tlsext_ec_clienthello_build(SSL *s, CBB *cbb); -int tlsext_ec_clienthello_parse(SSL *s, CBS *cbs, int *alert); -int tlsext_ec_serverhello_needs(SSL *s); -int tlsext_ec_serverhello_build(SSL *s, CBB *cbb); -int tlsext_ec_serverhello_parse(SSL *s, CBS *cbs, int *alert); - -int tlsext_ecpf_clienthello_needs(SSL *s); -int tlsext_ecpf_clienthello_build(SSL *s, CBB *cbb); -int tlsext_ecpf_clienthello_parse(SSL *s, CBS *cbs, int *alert); -int tlsext_ecpf_serverhello_needs(SSL *s); -int tlsext_ecpf_serverhello_build(SSL *s, CBB *cbb); -int tlsext_ecpf_serverhello_parse(SSL *s, CBS *cbs, int *alert); - -int tlsext_ocsp_clienthello_needs(SSL *s); -int tlsext_ocsp_clienthello_build(SSL *s, CBB *cbb); -int tlsext_ocsp_clienthello_parse(SSL *s, CBS *cbs, int *alert); -int tlsext_ocsp_serverhello_needs(SSL *s); -int tlsext_ocsp_serverhello_build(SSL *s, CBB *cbb); -int tlsext_ocsp_serverhello_parse(SSL *s, CBS *cbs, int *alert); - -int tlsext_sessionticket_clienthello_needs(SSL *s); -int tlsext_sessionticket_clienthello_build(SSL *s, CBB *cbb); -int tlsext_sessionticket_clienthello_parse(SSL *s, CBS *cbs, int *alert); -int tlsext_sessionticket_serverhello_needs(SSL *s); -int tlsext_sessionticket_serverhello_build(SSL *s, CBB *cbb); -int tlsext_sessionticket_serverhello_parse(SSL *s, CBS *cbs, int *alert); +#ifndef HEADER_SSL_TLSEXT_H +#define HEADER_SSL_TLSEXT_H + +/* TLSv1.3 - RFC 8446 Section 4.2. */ +#define SSL_TLSEXT_MSG_CH 0x0001 /* ClientHello */ +#define SSL_TLSEXT_MSG_SH 0x0002 /* ServerHello */ +#define SSL_TLSEXT_MSG_EE 0x0004 /* EncryptedExtension */ +#define SSL_TLSEXT_MSG_CT 0x0008 /* Certificate */ +#define SSL_TLSEXT_MSG_CR 0x0010 /* CertificateRequest */ +#define SSL_TLSEXT_MSG_NST 0x0020 /* NewSessionTicket */ +#define SSL_TLSEXT_MSG_HRR 0x0030 /* HelloRetryRequest */ + +__BEGIN_HIDDEN_DECLS + +int tlsext_alpn_client_needs(SSL *s); +int tlsext_alpn_client_build(SSL *s, CBB *cbb); +int tlsext_alpn_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_alpn_server_needs(SSL *s); +int tlsext_alpn_server_build(SSL *s, CBB *cbb); +int tlsext_alpn_server_parse(SSL *s, CBS *cbs, int *alert); + +int tlsext_ri_client_needs(SSL *s); +int tlsext_ri_client_build(SSL *s, CBB *cbb); +int tlsext_ri_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_ri_server_needs(SSL *s); +int tlsext_ri_server_build(SSL *s, CBB *cbb); +int tlsext_ri_server_parse(SSL *s, CBS *cbs, int *alert); + +int tlsext_sigalgs_client_needs(SSL *s); +int tlsext_sigalgs_client_build(SSL *s, CBB *cbb); +int tlsext_sigalgs_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_sigalgs_server_needs(SSL *s); +int tlsext_sigalgs_server_build(SSL *s, CBB *cbb); +int tlsext_sigalgs_server_parse(SSL *s, CBS *cbs, int *alert); + +int tlsext_sni_client_needs(SSL *s); +int tlsext_sni_client_build(SSL *s, CBB *cbb); +int tlsext_sni_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_sni_server_needs(SSL *s); +int tlsext_sni_server_build(SSL *s, CBB *cbb); +int tlsext_sni_server_parse(SSL *s, CBS *cbs, int *alert); + +int tlsext_supportedgroups_client_needs(SSL *s); +int tlsext_supportedgroups_client_build(SSL *s, CBB *cbb); +int tlsext_supportedgroups_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_supportedgroups_server_needs(SSL *s); +int tlsext_supportedgroups_server_build(SSL *s, CBB *cbb); +int tlsext_supportedgroups_server_parse(SSL *s, CBS *cbs, int *alert); + +int tlsext_ecpf_client_needs(SSL *s); +int tlsext_ecpf_client_build(SSL *s, CBB *cbb); +int tlsext_ecpf_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_ecpf_server_needs(SSL *s); +int tlsext_ecpf_server_build(SSL *s, CBB *cbb); +int tlsext_ecpf_server_parse(SSL *s, CBS *cbs, int *alert); + +int tlsext_ocsp_client_needs(SSL *s); +int tlsext_ocsp_client_build(SSL *s, CBB *cbb); +int tlsext_ocsp_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_ocsp_server_needs(SSL *s); +int tlsext_ocsp_server_build(SSL *s, CBB *cbb); +int tlsext_ocsp_server_parse(SSL *s, CBS *cbs, int *alert); + +int tlsext_sessionticket_client_needs(SSL *s); +int tlsext_sessionticket_client_build(SSL *s, CBB *cbb); +int tlsext_sessionticket_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_sessionticket_server_needs(SSL *s); +int tlsext_sessionticket_server_build(SSL *s, CBB *cbb); +int tlsext_sessionticket_server_parse(SSL *s, CBS *cbs, int *alert); + +int tlsext_versions_client_needs(SSL *s); +int tlsext_versions_client_build(SSL *s, CBB *cbb); +int tlsext_versions_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_versions_server_needs(SSL *s); +int tlsext_versions_server_build(SSL *s, CBB *cbb); +int tlsext_versions_server_parse(SSL *s, CBS *cbs, int *alert); + +int tlsext_keyshare_client_needs(SSL *s); +int tlsext_keyshare_client_build(SSL *s, CBB *cbb); +int tlsext_keyshare_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_keyshare_server_needs(SSL *s); +int tlsext_keyshare_server_build(SSL *s, CBB *cbb); +int tlsext_keyshare_server_parse(SSL *s, CBS *cbs, int *alert); + +int tlsext_cookie_client_needs(SSL *s); +int tlsext_cookie_client_build(SSL *s, CBB *cbb); +int tlsext_cookie_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_cookie_server_needs(SSL *s); +int tlsext_cookie_server_build(SSL *s, CBB *cbb); +int tlsext_cookie_server_parse(SSL *s, CBS *cbs, int *alert); #ifndef OPENSSL_NO_SRTP -int tlsext_srtp_clienthello_needs(SSL *s); -int tlsext_srtp_clienthello_build(SSL *s, CBB *cbb); -int tlsext_srtp_clienthello_parse(SSL *s, CBS *cbs, int *alert); -int tlsext_srtp_serverhello_needs(SSL *s); -int tlsext_srtp_serverhello_build(SSL *s, CBB *cbb); -int tlsext_srtp_serverhello_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_srtp_client_needs(SSL *s); +int tlsext_srtp_client_build(SSL *s, CBB *cbb); +int tlsext_srtp_client_parse(SSL *s, CBS *cbs, int *alert); +int tlsext_srtp_server_needs(SSL *s); +int tlsext_srtp_server_build(SSL *s, CBB *cbb); +int tlsext_srtp_server_parse(SSL *s, CBS *cbs, int *alert); #endif -int tlsext_clienthello_build(SSL *s, CBB *cbb); -int tlsext_clienthello_parse_one(SSL *s, CBS *cbs, uint16_t tlsext_type, - int *alert); +int tlsext_client_build(SSL *s, CBB *cbb, uint16_t msg_type); +int tlsext_client_parse(SSL *s, CBS *cbs, int *alert, uint16_t msg_type); + +int tlsext_server_build(SSL *s, CBB *cbb, uint16_t msg_type); +int tlsext_server_parse(SSL *s, CBS *cbs, int *alert, uint16_t msg_type); -int tlsext_serverhello_build(SSL *s, CBB *cbb); -int tlsext_serverhello_parse_one(SSL *s, CBS *cbs, uint16_t tlsext_type, - int *alert); +struct tls_extension *tls_extension_find(uint16_t, size_t *); +int tlsext_extension_seen(SSL *s, uint16_t); +__END_HIDDEN_DECLS + +#endif diff --git a/ssl/ssl_transcript.c b/ssl/ssl_transcript.c new file mode 100644 index 00000000..e94eb8de --- /dev/null +++ b/ssl/ssl_transcript.c @@ -0,0 +1,201 @@ +/* $OpenBSD: ssl_transcript.c,v 1.1 2019/02/09 15:30:52 jsing Exp $ */ +/* + * Copyright (c) 2017 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "ssl_locl.h" + +#include + +int +tls1_transcript_hash_init(SSL *s) +{ + const unsigned char *data; + const EVP_MD *md; + size_t len; + + tls1_transcript_hash_free(s); + + if (!ssl_get_handshake_evp_md(s, &md)) { + SSLerrorx(ERR_R_INTERNAL_ERROR); + goto err; + } + + if ((S3I(s)->handshake_hash = EVP_MD_CTX_new()) == NULL) { + SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!EVP_DigestInit_ex(S3I(s)->handshake_hash, md, NULL)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + + if (!tls1_transcript_data(s, &data, &len)) { + SSLerror(s, SSL_R_BAD_HANDSHAKE_LENGTH); + goto err; + } + if (!tls1_transcript_hash_update(s, data, len)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + + return 1; + + err: + tls1_transcript_hash_free(s); + + return 0; +} + +int +tls1_transcript_hash_update(SSL *s, const unsigned char *buf, size_t len) +{ + if (S3I(s)->handshake_hash == NULL) + return 1; + + return EVP_DigestUpdate(S3I(s)->handshake_hash, buf, len); +} + +int +tls1_transcript_hash_value(SSL *s, const unsigned char *out, size_t len, + size_t *outlen) +{ + EVP_MD_CTX *mdctx = NULL; + unsigned int mdlen; + int ret = 0; + + if (EVP_MD_CTX_size(S3I(s)->handshake_hash) > len) + goto err; + + if ((mdctx = EVP_MD_CTX_new()) == NULL) { + SSLerror(s, ERR_R_MALLOC_FAILURE); + goto err; + } + if (!EVP_MD_CTX_copy_ex(mdctx, S3I(s)->handshake_hash)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (!EVP_DigestFinal_ex(mdctx, (unsigned char *)out, &mdlen)) { + SSLerror(s, ERR_R_EVP_LIB); + goto err; + } + if (outlen != NULL) + *outlen = mdlen; + + ret = 1; + + err: + EVP_MD_CTX_free(mdctx); + + return (ret); +} + +void +tls1_transcript_hash_free(SSL *s) +{ + EVP_MD_CTX_free(S3I(s)->handshake_hash); + S3I(s)->handshake_hash = NULL; +} + +int +tls1_transcript_init(SSL *s) +{ + if (S3I(s)->handshake_transcript != NULL) + return 0; + + if ((S3I(s)->handshake_transcript = BUF_MEM_new()) == NULL) + return 0; + + tls1_transcript_reset(s); + + return 1; +} + +void +tls1_transcript_free(SSL *s) +{ + BUF_MEM_free(S3I(s)->handshake_transcript); + S3I(s)->handshake_transcript = NULL; +} + +void +tls1_transcript_reset(SSL *s) +{ + /* + * We should check the return value of BUF_MEM_grow_clean(), however + * due to yet another bad API design, when called with a length of zero + * it is impossible to tell if it succeeded (returning a length of zero) + * or if it failed (and returned zero)... our implementation never + * fails with a length of zero, so we trust all is okay... + */ + (void)BUF_MEM_grow_clean(S3I(s)->handshake_transcript, 0); + + s->s3->flags &= ~TLS1_FLAGS_FREEZE_TRANSCRIPT; +} + +int +tls1_transcript_append(SSL *s, const unsigned char *buf, size_t len) +{ + size_t olen, nlen; + + if (S3I(s)->handshake_transcript == NULL) + return 1; + + if (s->s3->flags & TLS1_FLAGS_FREEZE_TRANSCRIPT) + return 1; + + olen = S3I(s)->handshake_transcript->length; + nlen = olen + len; + + if (nlen < olen) + return 0; + + if (BUF_MEM_grow(S3I(s)->handshake_transcript, nlen) == 0) + return 0; + + memcpy(S3I(s)->handshake_transcript->data + olen, buf, len); + + return 1; +} + +int +tls1_transcript_data(SSL *s, const unsigned char **data, size_t *len) +{ + if (S3I(s)->handshake_transcript == NULL) + return 0; + + *data = S3I(s)->handshake_transcript->data; + *len = S3I(s)->handshake_transcript->length; + + return 1; +} + +void +tls1_transcript_freeze(SSL *s) +{ + s->s3->flags |= TLS1_FLAGS_FREEZE_TRANSCRIPT; +} + +int +tls1_transcript_record(SSL *s, const unsigned char *buf, size_t len) +{ + if (!tls1_transcript_hash_update(s, buf, len)) + return 0; + + if (!tls1_transcript_append(s, buf, len)) + return 0; + + return 1; +} diff --git a/ssl/ssl_versions.c b/ssl/ssl_versions.c index 240a2498..2b5e94e5 100644 --- a/ssl/ssl_versions.c +++ b/ssl/ssl_versions.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_versions.c,v 1.3 2017/05/06 20:37:25 jsing Exp $ */ +/* $OpenBSD: ssl_versions.c,v 1.4 2018/11/06 01:40:23 jsing Exp $ */ /* * Copyright (c) 2016, 2017 Joel Sing * @@ -94,7 +94,7 @@ ssl_enabled_version_range(SSL *s, uint16_t *min_ver, uint16_t *max_ver) */ min_version = 0; - max_version = TLS1_2_VERSION; + max_version = TLS1_3_VERSION; if ((s->internal->options & SSL_OP_NO_TLSv1) == 0) min_version = TLS1_VERSION; @@ -102,7 +102,11 @@ ssl_enabled_version_range(SSL *s, uint16_t *min_ver, uint16_t *max_ver) min_version = TLS1_1_VERSION; else if ((s->internal->options & SSL_OP_NO_TLSv1_2) == 0) min_version = TLS1_2_VERSION; + else if ((s->internal->options & SSL_OP_NO_TLSv1_3) == 0) + min_version = TLS1_3_VERSION; + if ((s->internal->options & SSL_OP_NO_TLSv1_3) && min_version < TLS1_3_VERSION) + max_version = TLS1_2_VERSION; if ((s->internal->options & SSL_OP_NO_TLSv1_2) && min_version < TLS1_2_VERSION) max_version = TLS1_1_VERSION; if ((s->internal->options & SSL_OP_NO_TLSv1_1) && min_version < TLS1_1_VERSION) @@ -171,7 +175,9 @@ ssl_max_shared_version(SSL *s, uint16_t peer_ver, uint16_t *max_ver) return 0; } - if (peer_ver >= TLS1_2_VERSION) + if (peer_ver >= TLS1_3_VERSION) + shared_version = TLS1_3_VERSION; + else if (peer_ver >= TLS1_2_VERSION) shared_version = TLS1_2_VERSION; else if (peer_ver >= TLS1_1_VERSION) shared_version = TLS1_1_VERSION; diff --git a/ssl/t1_clnt.c b/ssl/t1_clnt.c deleted file mode 100644 index 92b5efb1..00000000 --- a/ssl/t1_clnt.c +++ /dev/null @@ -1,243 +0,0 @@ -/* $OpenBSD: t1_clnt.c,v 1.24 2017/01/26 05:31:25 jsing Exp $ */ -/* 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.] - */ - -#include - -#include "ssl_locl.h" - -#include -#include -#include - -static const SSL_METHOD_INTERNAL TLS_client_method_internal_data = { - .version = TLS1_2_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_2_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl_undefined_function, - .ssl_connect = ssl3_connect, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_client_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl_undefined_function, - .ssl_renegotiate_check = ssl_ok, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_2_enc_data, -}; - -static const SSL_METHOD TLS_client_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLS_client_method_internal_data, -}; - -static const SSL_METHOD_INTERNAL TLSv1_client_method_internal_data = { - .version = TLS1_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl_undefined_function, - .ssl_connect = ssl3_connect, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_client_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_enc_data, -}; - -static const SSL_METHOD TLSv1_client_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLSv1_client_method_internal_data, -}; - -static const SSL_METHOD_INTERNAL TLSv1_1_client_method_internal_data = { - .version = TLS1_1_VERSION, - .min_version = TLS1_1_VERSION, - .max_version = TLS1_1_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl_undefined_function, - .ssl_connect = ssl3_connect, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_client_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_1_enc_data, -}; - -static const SSL_METHOD TLSv1_1_client_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLSv1_1_client_method_internal_data, -}; - -static const SSL_METHOD_INTERNAL TLSv1_2_client_method_internal_data = { - .version = TLS1_2_VERSION, - .min_version = TLS1_2_VERSION, - .max_version = TLS1_2_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl_undefined_function, - .ssl_connect = ssl3_connect, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_client_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_2_enc_data, -}; - -static const SSL_METHOD TLSv1_2_client_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLSv1_2_client_method_internal_data, -}; - -const SSL_METHOD * -tls1_get_client_method(int ver) -{ - if (ver == TLS1_2_VERSION) - return (TLSv1_2_client_method()); - if (ver == TLS1_1_VERSION) - return (TLSv1_1_client_method()); - if (ver == TLS1_VERSION) - return (TLSv1_client_method()); - return (NULL); -} - -const SSL_METHOD * -SSLv23_client_method(void) -{ - return (TLS_client_method()); -} - -const SSL_METHOD * -TLS_client_method(void) -{ - return (&TLS_client_method_data); -} - -const SSL_METHOD * -TLSv1_client_method(void) -{ - return (&TLSv1_client_method_data); -} - -const SSL_METHOD * -TLSv1_1_client_method(void) -{ - return (&TLSv1_1_client_method_data); -} - -const SSL_METHOD * -TLSv1_2_client_method(void) -{ - return (&TLSv1_2_client_method_data); -} diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 95986135..79a5bdd2 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_enc.c,v 1.109 2017/05/06 22:24:58 beck Exp $ */ +/* $OpenBSD: t1_enc.c,v 1.117 2019/02/09 15:26:15 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -157,61 +157,6 @@ tls1_cleanup_key_block(SSL *s) S3I(s)->hs.key_block_len = 0; } -int -tls1_init_finished_mac(SSL *s) -{ - BIO_free(S3I(s)->handshake_buffer); - - S3I(s)->handshake_buffer = BIO_new(BIO_s_mem()); - if (S3I(s)->handshake_buffer == NULL) - return (0); - - (void)BIO_set_close(S3I(s)->handshake_buffer, BIO_CLOSE); - - return (1); -} - -int -tls1_finish_mac(SSL *s, const unsigned char *buf, int len) -{ - if (len < 0) - return 0; - - if (!tls1_handshake_hash_update(s, buf, len)) - return 0; - - if (S3I(s)->handshake_buffer && - !(s->s3->flags & TLS1_FLAGS_KEEP_HANDSHAKE)) { - BIO_write(S3I(s)->handshake_buffer, (void *)buf, len); - return 1; - } - - return 1; -} - -int -tls1_digest_cached_records(SSL *s) -{ - long hdatalen; - void *hdata; - - hdatalen = BIO_get_mem_data(S3I(s)->handshake_buffer, &hdata); - if (hdatalen <= 0) { - SSLerror(s, SSL_R_BAD_HANDSHAKE_LENGTH); - goto err; - } - - if (!(s->s3->flags & TLS1_FLAGS_KEEP_HANDSHAKE)) { - BIO_free(S3I(s)->handshake_buffer); - S3I(s)->handshake_buffer = NULL; - } - - return 1; - - err: - return 0; -} - void tls1_record_sequence_increment(unsigned char *seq) { @@ -397,10 +342,13 @@ tls1_change_cipher_state_aead(SSL *s, char is_read, const unsigned char *key, SSL_AEAD_CTX *aead_ctx; if (is_read) { + ssl_clear_cipher_read_state(s); if (!tls1_aead_ctx_init(&s->internal->aead_read_ctx)) return 0; aead_ctx = s->internal->aead_read_ctx; } else { + /* XXX - Need to correctly handle DTLS. */ + ssl_clear_cipher_write_state(s); if (!tls1_aead_ctx_init(&s->internal->aead_write_ctx)) return 0; aead_ctx = s->internal->aead_write_ctx; @@ -444,11 +392,10 @@ tls1_change_cipher_state_aead(SSL *s, char is_read, const unsigned char *key, * tls1_change_cipher_state_cipher performs the work needed to switch cipher * states when using EVP_CIPHER. The argument is_read is true iff this function * is being called due to reading, as opposed to writing, a ChangeCipherSpec - * message. In order to support export ciphersuites, use_client_keys indicates - * whether the key material provided is in the "client write" direction. + * message. */ static int -tls1_change_cipher_state_cipher(SSL *s, char is_read, char use_client_keys, +tls1_change_cipher_state_cipher(SSL *s, char is_read, const unsigned char *mac_secret, unsigned int mac_secret_size, const unsigned char *key, unsigned int key_len, const unsigned char *iv, unsigned int iv_len) @@ -456,6 +403,7 @@ tls1_change_cipher_state_cipher(SSL *s, char is_read, char use_client_keys, EVP_CIPHER_CTX *cipher_ctx; const EVP_CIPHER *cipher; EVP_MD_CTX *mac_ctx; + EVP_PKEY *mac_key; const EVP_MD *mac; int mac_type; @@ -469,15 +417,12 @@ tls1_change_cipher_state_cipher(SSL *s, char is_read, char use_client_keys, else s->internal->mac_flags &= ~SSL_MAC_FLAG_READ_MAC_STREAM; - EVP_CIPHER_CTX_free(s->enc_read_ctx); - s->enc_read_ctx = NULL; - EVP_MD_CTX_destroy(s->read_hash); - s->read_hash = NULL; + ssl_clear_cipher_read_state(s); if ((cipher_ctx = EVP_CIPHER_CTX_new()) == NULL) goto err; s->enc_read_ctx = cipher_ctx; - if ((mac_ctx = EVP_MD_CTX_create()) == NULL) + if ((mac_ctx = EVP_MD_CTX_new()) == NULL) goto err; s->read_hash = mac_ctx; } else { @@ -493,40 +438,24 @@ tls1_change_cipher_state_cipher(SSL *s, char is_read, char use_client_keys, * contexts that are used for DTLS - these are instead freed * by DTLS when its frees a ChangeCipherSpec fragment. */ - if (!SSL_IS_DTLS(s)) { - EVP_CIPHER_CTX_free(s->internal->enc_write_ctx); - s->internal->enc_write_ctx = NULL; - EVP_MD_CTX_destroy(s->internal->write_hash); - s->internal->write_hash = NULL; - } + if (!SSL_IS_DTLS(s)) + ssl_clear_cipher_write_state(s); + if ((cipher_ctx = EVP_CIPHER_CTX_new()) == NULL) goto err; s->internal->enc_write_ctx = cipher_ctx; - if ((mac_ctx = EVP_MD_CTX_create()) == NULL) + if ((mac_ctx = EVP_MD_CTX_new()) == NULL) goto err; s->internal->write_hash = mac_ctx; } - if (EVP_CIPHER_mode(cipher) == EVP_CIPH_GCM_MODE) { - EVP_CipherInit_ex(cipher_ctx, cipher, NULL, key, NULL, - !is_read); - EVP_CIPHER_CTX_ctrl(cipher_ctx, EVP_CTRL_GCM_SET_IV_FIXED, - iv_len, (unsigned char *)iv); - } else - EVP_CipherInit_ex(cipher_ctx, cipher, NULL, key, iv, !is_read); - - if (!(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { - EVP_PKEY *mac_key = EVP_PKEY_new_mac_key(mac_type, NULL, - mac_secret, mac_secret_size); - if (mac_key == NULL) - goto err; - EVP_DigestSignInit(mac_ctx, NULL, mac, NULL, mac_key); - EVP_PKEY_free(mac_key); - } else if (mac_secret_size > 0) { - /* Needed for "composite" AEADs, such as RC4-HMAC-MD5 */ - EVP_CIPHER_CTX_ctrl(cipher_ctx, EVP_CTRL_AEAD_SET_MAC_KEY, - mac_secret_size, (unsigned char *)mac_secret); - } + EVP_CipherInit_ex(cipher_ctx, cipher, NULL, key, iv, !is_read); + + if ((mac_key = EVP_PKEY_new_mac_key(mac_type, NULL, mac_secret, + mac_secret_size)) == NULL) + goto err; + EVP_DigestSignInit(mac_ctx, NULL, mac, NULL, mac_key); + EVP_PKEY_free(mac_key); if (S3I(s)->hs.new_cipher->algorithm_enc == SSL_eGOST2814789CNT) { int nid; @@ -560,7 +489,6 @@ tls1_change_cipher_state(SSL *s, int which) const EVP_AEAD *aead; char is_read, use_client_keys; - cipher = S3I(s)->tmp.new_sym_enc; aead = S3I(s)->tmp.new_aead; @@ -579,7 +507,6 @@ tls1_change_cipher_state(SSL *s, int which) use_client_keys = ((which == SSL3_CHANGE_CIPHER_CLIENT_WRITE) || (which == SSL3_CHANGE_CIPHER_SERVER_READ)); - /* * Reset sequence number to zero - for DTLS this is handled in * dtls1_reset_seq_numbers(). @@ -595,13 +522,9 @@ tls1_change_cipher_state(SSL *s, int which) } else { key_len = EVP_CIPHER_key_length(cipher); iv_len = EVP_CIPHER_iv_length(cipher); - - /* If GCM mode only part of IV comes from PRF. */ - if (EVP_CIPHER_mode(cipher) == EVP_CIPH_GCM_MODE) - iv_len = EVP_GCM_TLS_FIXED_IV_LEN; } - mac_secret_size = s->s3->tmp.new_mac_secret_size; + mac_secret_size = S3I(s)->tmp.new_mac_secret_size; key_block = S3I(s)->hs.key_block; client_write_mac_secret = key_block; @@ -645,7 +568,7 @@ tls1_change_cipher_state(SSL *s, int which) iv, iv_len); } - return tls1_change_cipher_state_cipher(s, is_read, use_client_keys, + return tls1_change_cipher_state_cipher(s, is_read, mac_secret, mac_secret_size, key, key_len, iv, iv_len); err2: @@ -667,7 +590,7 @@ tls1_setup_key_block(SSL *s) return (1); if (s->session->cipher && - (s->session->cipher->algorithm2 & SSL_CIPHER_ALGORITHM2_AEAD)) { + (s->session->cipher->algorithm_mac & SSL_AEAD)) { if (!ssl_cipher_get_evp_aead(s->session, &aead)) { SSLerror(s, SSL_R_CIPHER_OR_HASH_UNAVAILABLE); return (0); @@ -682,17 +605,13 @@ tls1_setup_key_block(SSL *s) } key_len = EVP_CIPHER_key_length(cipher); iv_len = EVP_CIPHER_iv_length(cipher); - - /* If GCM mode only part of IV comes from PRF. */ - if (EVP_CIPHER_mode(cipher) == EVP_CIPH_GCM_MODE) - iv_len = EVP_GCM_TLS_FIXED_IV_LEN; } S3I(s)->tmp.new_aead = aead; S3I(s)->tmp.new_sym_enc = cipher; S3I(s)->tmp.new_hash = mac; S3I(s)->tmp.new_mac_pkey_type = mac_type; - s->s3->tmp.new_mac_secret_size = mac_secret_size; + S3I(s)->tmp.new_mac_secret_size = mac_secret_size; tls1_cleanup_key_block(s); @@ -957,28 +876,7 @@ tls1_enc(SSL *s, int send) l = rec->length; bs = EVP_CIPHER_block_size(ds->cipher); - if (EVP_CIPHER_flags(ds->cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) { - unsigned char buf[13]; - - if (SSL_IS_DTLS(s)) { - dtls1_build_sequence_number(buf, seq, - send ? D1I(s)->w_epoch : D1I(s)->r_epoch); - } else { - memcpy(buf, seq, SSL3_SEQUENCE_SIZE); - tls1_record_sequence_increment(seq); - } - - buf[8] = rec->type; - buf[9] = (unsigned char)(s->version >> 8); - buf[10] = (unsigned char)(s->version); - buf[11] = rec->length >> 8; - buf[12] = rec->length & 0xff; - pad = EVP_CIPHER_CTX_ctrl(ds, EVP_CTRL_AEAD_TLS1_AAD, 13, buf); - if (send) { - l += pad; - rec->length += pad; - } - } else if ((bs != 1) && send) { + if (bs != 1 && send) { i = bs - ((int)l % bs); /* Add weird padding of upto 256 bytes */ @@ -1000,11 +898,6 @@ tls1_enc(SSL *s, int send) if ((EVP_CIPHER_flags(ds->cipher) & EVP_CIPH_FLAG_CUSTOM_CIPHER) ? (i < 0) : (i == 0)) return -1; /* AEAD can fail to verify MAC */ - if (EVP_CIPHER_mode(enc) == EVP_CIPH_GCM_MODE && !send) { - rec->data += EVP_GCM_TLS_EXPLICIT_IV_LEN; - rec->input += EVP_GCM_TLS_EXPLICIT_IV_LEN; - rec->length -= EVP_GCM_TLS_EXPLICIT_IV_LEN; - } ret = 1; if (EVP_MD_CTX_md(s->read_hash) != NULL) @@ -1026,7 +919,7 @@ tls1_final_finish_mac(SSL *s, const char *str, int str_len, unsigned char *out) if (str_len < 0) return 0; - if (!tls1_handshake_hash_value(s, buf, sizeof(buf), &hash_len)) + if (!tls1_transcript_hash_value(s, buf, sizeof(buf), &hash_len)) return 0; if (!tls1_PRF(s, s->session->master_key, s->session->master_key_length, diff --git a/ssl/t1_hash.c b/ssl/t1_hash.c deleted file mode 100644 index aef6e657..00000000 --- a/ssl/t1_hash.c +++ /dev/null @@ -1,111 +0,0 @@ -/* $OpenBSD: t1_hash.c,v 1.2 2017/05/06 16:18:36 jsing Exp $ */ -/* - * Copyright (c) 2017 Joel Sing - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "ssl_locl.h" - -#include - -int -tls1_handshake_hash_init(SSL *s) -{ - const EVP_MD *md; - long dlen; - void *data; - - tls1_handshake_hash_free(s); - - if (!ssl_get_handshake_evp_md(s, &md)) { - SSLerrorx(ERR_R_INTERNAL_ERROR); - goto err; - } - - if ((S3I(s)->handshake_hash = EVP_MD_CTX_create()) == NULL) { - SSLerror(s, ERR_R_MALLOC_FAILURE); - goto err; - } - if (!EVP_DigestInit_ex(S3I(s)->handshake_hash, md, NULL)) { - SSLerror(s, ERR_R_EVP_LIB); - goto err; - } - - dlen = BIO_get_mem_data(S3I(s)->handshake_buffer, &data); - if (dlen <= 0) { - SSLerror(s, SSL_R_BAD_HANDSHAKE_LENGTH); - goto err; - } - if (!tls1_handshake_hash_update(s, data, dlen)) { - SSLerror(s, ERR_R_EVP_LIB); - goto err; - } - - return 1; - - err: - tls1_handshake_hash_free(s); - - return 0; -} - -int -tls1_handshake_hash_update(SSL *s, const unsigned char *buf, size_t len) -{ - if (S3I(s)->handshake_hash == NULL) - return 1; - - return EVP_DigestUpdate(S3I(s)->handshake_hash, buf, len); -} - -int -tls1_handshake_hash_value(SSL *s, const unsigned char *out, size_t len, - size_t *outlen) -{ - EVP_MD_CTX *mdctx = NULL; - unsigned int mdlen; - int ret = 0; - - if (EVP_MD_CTX_size(S3I(s)->handshake_hash) > len) - goto err; - - if ((mdctx = EVP_MD_CTX_create()) == NULL) { - SSLerror(s, ERR_R_MALLOC_FAILURE); - goto err; - } - if (!EVP_MD_CTX_copy_ex(mdctx, S3I(s)->handshake_hash)) { - SSLerror(s, ERR_R_EVP_LIB); - goto err; - } - if (!EVP_DigestFinal_ex(mdctx, (unsigned char *)out, &mdlen)) { - SSLerror(s, ERR_R_EVP_LIB); - goto err; - } - if (outlen != NULL) - *outlen = mdlen; - - ret = 1; - - err: - EVP_MD_CTX_destroy(mdctx); - - return (ret); -} - -void -tls1_handshake_hash_free(SSL *s) -{ - EVP_MD_CTX_destroy(S3I(s)->handshake_hash); - S3I(s)->handshake_hash = NULL; -} diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 0d03b45a..5dbbdb78 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_lib.c,v 1.137 2017/08/30 16:44:37 jsing Exp $ */ +/* $OpenBSD: t1_lib.c,v 1.154 2019/03/25 17:27:31 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -119,6 +119,7 @@ #include "ssl_locl.h" #include "bytestring.h" +#include "ssl_sigalgs.h" #include "ssl_tlsext.h" static int tls_decrypt_ticket(SSL *s, const unsigned char *tick, int ticklen, @@ -361,25 +362,25 @@ tls1_get_formatlist(SSL *s, int client_formats, const uint8_t **pformats, } /* - * Return the appropriate curve list. If client_curves is non-zero, return - * the client/session curves. Otherwise return the custom curve list if one - * exists, or the default curves if a custom list has not been specified. + * Return the appropriate group list. If client_groups is non-zero, return + * the client/session groups. Otherwise return the custom group list if one + * exists, or the default groups if a custom list has not been specified. */ void -tls1_get_curvelist(SSL *s, int client_curves, const uint16_t **pcurves, - size_t *pcurveslen) +tls1_get_group_list(SSL *s, int client_groups, const uint16_t **pgroups, + size_t *pgroupslen) { - if (client_curves != 0) { - *pcurves = SSI(s)->tlsext_supportedgroups; - *pcurveslen = SSI(s)->tlsext_supportedgroups_length; + if (client_groups != 0) { + *pgroups = SSI(s)->tlsext_supportedgroups; + *pgroupslen = SSI(s)->tlsext_supportedgroups_length; return; } - *pcurves = s->internal->tlsext_supportedgroups; - *pcurveslen = s->internal->tlsext_supportedgroups_length; - if (*pcurves == NULL) { - *pcurves = eccurves_default; - *pcurveslen = sizeof(eccurves_default) / 2; + *pgroups = s->internal->tlsext_supportedgroups; + *pgroupslen = s->internal->tlsext_supportedgroups_length; + if (*pgroups == NULL) { + *pgroups = eccurves_default; + *pgroupslen = sizeof(eccurves_default) / 2; } } @@ -410,7 +411,7 @@ tls1_set_groups(uint16_t **out_group_ids, size_t *out_group_ids_len, } int -tls1_set_groups_list(uint16_t **out_group_ids, size_t *out_group_ids_len, +tls1_set_group_list(uint16_t **out_group_ids, size_t *out_group_ids_len, const char *groups) { uint16_t *new_group_ids, *group_ids = NULL; @@ -461,13 +462,13 @@ tls1_set_groups_list(uint16_t **out_group_ids, size_t *out_group_ids_len, int tls1_check_curve(SSL *s, const uint16_t curve_id) { - const uint16_t *curves; - size_t curveslen, i; + const uint16_t *groups; + size_t groupslen, i; - tls1_get_curvelist(s, 0, &curves, &curveslen); + tls1_get_group_list(s, 0, &groups, &groupslen); - for (i = 0; i < curveslen; i++) { - if (curves[i] == curve_id) + for (i = 0; i < groupslen; i++) { + if (groups[i] == curve_id) return (1); } return (0); @@ -486,8 +487,8 @@ tls1_get_shared_curve(SSL *s) /* Return first preference shared curve. */ server_pref = (s->internal->options & SSL_OP_CIPHER_SERVER_PREFERENCE); - tls1_get_curvelist(s, (server_pref == 0), &pref, &preflen); - tls1_get_curvelist(s, (server_pref != 0), &supp, &supplen); + tls1_get_group_list(s, (server_pref == 0), &pref, &preflen); + tls1_get_group_list(s, (server_pref != 0), &supp, &supplen); for (i = 0; i < preflen; i++) { for (j = 0; j < supplen; j++) { @@ -548,8 +549,8 @@ tls1_set_ec_id(uint16_t *curve_id, uint8_t *comp_id, EC_KEY *ec) static int tls1_check_ec_key(SSL *s, const uint16_t *curve_id, const uint8_t *comp_id) { - size_t curveslen, formatslen, i; - const uint16_t *curves; + size_t groupslen, formatslen, i; + const uint16_t *groups; const uint8_t *formats; /* @@ -569,13 +570,13 @@ tls1_check_ec_key(SSL *s, const uint16_t *curve_id, const uint8_t *comp_id) /* * Check curve list if present, otherwise everything is supported. */ - tls1_get_curvelist(s, 1, &curves, &curveslen); - if (curve_id != NULL && curves != NULL) { - for (i = 0; i < curveslen; i++) { - if (curves[i] == *curve_id) + tls1_get_group_list(s, 1, &groups, &groupslen); + if (curve_id != NULL && groups != NULL) { + for (i = 0; i < groupslen; i++) { + if (groups[i] == *curve_id) break; } - if (i == curveslen) + if (i == groupslen) return (0); } @@ -604,251 +605,6 @@ tls1_check_ec_server_key(SSL *s) return tls1_check_ec_key(s, &curve_id, &comp_id); } -/* Check EC temporary key is compatible with client extensions. */ -int -tls1_check_ec_tmp_key(SSL *s) -{ - EC_KEY *ec = s->cert->ecdh_tmp; - uint16_t curve_id; - - /* Need a shared curve. */ - if (tls1_get_shared_curve(s) != NID_undef) - return (1); - - if (ec == NULL) - return (0); - - if (tls1_set_ec_id(&curve_id, NULL, ec) != 1) - return (0); - - return tls1_check_ec_key(s, &curve_id, NULL); -} - -/* - * List of supported signature algorithms and hashes. Should make this - * customisable at some point, for now include everything we support. - */ - -static unsigned char tls12_sigalgs[] = { - TLSEXT_hash_sha512, TLSEXT_signature_rsa, - TLSEXT_hash_sha512, TLSEXT_signature_ecdsa, -#ifndef OPENSSL_NO_GOST - TLSEXT_hash_streebog_512, TLSEXT_signature_gostr12_512, -#endif - - TLSEXT_hash_sha384, TLSEXT_signature_rsa, - TLSEXT_hash_sha384, TLSEXT_signature_ecdsa, - - TLSEXT_hash_sha256, TLSEXT_signature_rsa, - TLSEXT_hash_sha256, TLSEXT_signature_ecdsa, - -#ifndef OPENSSL_NO_GOST - TLSEXT_hash_streebog_256, TLSEXT_signature_gostr12_256, - TLSEXT_hash_gost94, TLSEXT_signature_gostr01, -#endif - - TLSEXT_hash_sha224, TLSEXT_signature_rsa, - TLSEXT_hash_sha224, TLSEXT_signature_ecdsa, - - TLSEXT_hash_sha1, TLSEXT_signature_rsa, - TLSEXT_hash_sha1, TLSEXT_signature_ecdsa, -}; - -void -tls12_get_req_sig_algs(SSL *s, unsigned char **sigalgs, size_t *sigalgs_len) -{ - *sigalgs = tls12_sigalgs; - *sigalgs_len = sizeof(tls12_sigalgs); -} - -unsigned char * -ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned char *limit) -{ - size_t len; - CBB cbb; - - if (p >= limit) - return NULL; - - if (!CBB_init_fixed(&cbb, p, limit - p)) - return NULL; - if (!tlsext_clienthello_build(s, &cbb)) { - CBB_cleanup(&cbb); - return NULL; - } - if (!CBB_finish(&cbb, NULL, &len)) { - CBB_cleanup(&cbb); - return NULL; - } - - return (p + len); -} - -unsigned char * -ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned char *limit) -{ - size_t len; - CBB cbb; - - if (p >= limit) - return NULL; - - if (!CBB_init_fixed(&cbb, p, limit - p)) - return NULL; - if (!tlsext_serverhello_build(s, &cbb)) { - CBB_cleanup(&cbb); - return NULL; - } - if (!CBB_finish(&cbb, NULL, &len)) { - CBB_cleanup(&cbb); - return NULL; - } - - return (p + len); -} - -int -ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, - int n, int *al) -{ - unsigned short type; - unsigned short size; - unsigned short len; - unsigned char *data = *p; - unsigned char *end = d + n; - CBS cbs; - - s->internal->servername_done = 0; - s->tlsext_status_type = -1; - S3I(s)->renegotiate_seen = 0; - free(S3I(s)->alpn_selected); - S3I(s)->alpn_selected = NULL; - s->internal->srtp_profile = NULL; - - if (data == end) - goto ri_check; - - if (end - data < 2) - goto err; - n2s(data, len); - - if (end - data != len) - goto err; - - while (end - data >= 4) { - n2s(data, type); - n2s(data, size); - - if (end - data < size) - goto err; - - if (s->internal->tlsext_debug_cb) - s->internal->tlsext_debug_cb(s, 0, type, data, size, - s->internal->tlsext_debug_arg); - - CBS_init(&cbs, data, size); - if (!tlsext_clienthello_parse_one(s, &cbs, type, al)) - return 0; - - data += size; - } - - /* Spurious data on the end */ - if (data != end) - goto err; - - *p = data; - -ri_check: - - /* Need RI if renegotiating */ - - if (!S3I(s)->renegotiate_seen && s->internal->renegotiate) { - *al = SSL_AD_HANDSHAKE_FAILURE; - SSLerror(s, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); - return 0; - } - - return 1; - -err: - *al = SSL_AD_DECODE_ERROR; - return 0; -} - -int -ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, size_t n, int *al) -{ - unsigned short type; - unsigned short size; - unsigned short len; - unsigned char *data = *p; - unsigned char *end = *p + n; - CBS cbs; - - S3I(s)->renegotiate_seen = 0; - free(S3I(s)->alpn_selected); - S3I(s)->alpn_selected = NULL; - - if (data == end) - goto ri_check; - - if (end - data < 2) - goto err; - n2s(data, len); - - if (end - data != len) - goto err; - - while (end - data >= 4) { - n2s(data, type); - n2s(data, size); - - if (end - data < size) - goto err; - - if (s->internal->tlsext_debug_cb) - s->internal->tlsext_debug_cb(s, 1, type, data, size, - s->internal->tlsext_debug_arg); - - CBS_init(&cbs, data, size); - if (!tlsext_serverhello_parse_one(s, &cbs, type, al)) - return 0; - - data += size; - - } - - if (data != end) { - *al = SSL_AD_DECODE_ERROR; - return 0; - } - - *p = data; - -ri_check: - - /* Determine if we need to see RI. Strictly speaking if we want to - * avoid an attack we should *always* see RI even on initial server - * hello because the client doesn't see any renegotiation during an - * attack. However this would mean we could not connect to any server - * which doesn't support RI so for the immediate future tolerate RI - * absence on initial connect only. - */ - if (!S3I(s)->renegotiate_seen && - !(s->internal->options & SSL_OP_LEGACY_SERVER_CONNECT)) { - *al = SSL_AD_HANDSHAKE_FAILURE; - SSLerror(s, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); - return 0; - } - - return 1; - -err: - *al = SSL_AD_DECODE_ERROR; - return 0; -} - int ssl_check_clienthello_tlsext_early(SSL *s) { @@ -1003,11 +759,9 @@ ssl_check_serverhello_tlsext(SSL *s) * ClientHello, and other operations depend on the result, we need to handle * any TLS session ticket extension at the same time. * - * session_id: points at the session ID in the ClientHello. This code will - * read past the end of this in order to parse out the session ticket - * extension, if any. - * len: the length of the session ID. - * limit: a pointer to the first byte after the ClientHello. + * session_id: points at the session ID in the ClientHello. + * session_id_len: the length of the session ID. + * ext_block: a CBS for the ClientHello extensions block. * ret: (output) on return, if a ticket was decrypted, then this is set to * point to the resulting session. * @@ -1033,55 +787,34 @@ ssl_check_serverhello_tlsext(SSL *s) * Otherwise, s->internal->tlsext_ticket_expected is set to 0. */ int -tls1_process_ticket(SSL *s, const unsigned char *session, int session_len, - const unsigned char *limit, SSL_SESSION **ret) +tls1_process_ticket(SSL *s, const unsigned char *session_id, int session_id_len, + CBS *ext_block, SSL_SESSION **ret) { - /* Point after session ID in client hello */ - CBS session_id, cookie, cipher_list, compress_algo, extensions; + CBS extensions; - *ret = NULL; s->internal->tlsext_ticket_expected = 0; + *ret = NULL; - /* If tickets disabled behave as if no ticket present - * to permit stateful resumption. + /* + * If tickets disabled behave as if no ticket present to permit stateful + * resumption. */ if (SSL_get_options(s) & SSL_OP_NO_TICKET) return 0; - if (!limit) - return 0; - - if (limit < session) - return -1; - - CBS_init(&session_id, session, limit - session); - - /* Skip past the session id */ - if (!CBS_skip(&session_id, session_len)) - return -1; - - /* Skip past DTLS cookie */ - if (SSL_IS_DTLS(s)) { - if (!CBS_get_u8_length_prefixed(&session_id, &cookie)) - return -1; - } - - /* Skip past cipher list */ - if (!CBS_get_u16_length_prefixed(&session_id, &cipher_list)) - return -1; - /* Skip past compression algorithm list */ - if (!CBS_get_u8_length_prefixed(&session_id, &compress_algo)) - return -1; - - /* Now at start of extensions */ - if (CBS_len(&session_id) == 0) + /* + * An empty extensions block is valid, but obviously does not contain + * a session ticket. + */ + if (CBS_len(ext_block) == 0) return 0; - if (!CBS_get_u16_length_prefixed(&session_id, &extensions)) + + if (!CBS_get_u16_length_prefixed(ext_block, &extensions)) return -1; while (CBS_len(&extensions) > 0) { - CBS ext_data; uint16_t ext_type; + CBS ext_data; if (!CBS_get_u16(&extensions, &ext_type) || !CBS_get_u16_length_prefixed(&extensions, &ext_data)) @@ -1095,7 +828,7 @@ tls1_process_ticket(SSL *s, const unsigned char *session, int session_len, s->internal->tlsext_ticket_expected = 1; return 1; } - if (s->internal->tls_session_secret_cb) { + if (s->internal->tls_session_secret_cb != NULL) { /* Indicate that the ticket couldn't be * decrypted rather than generating the session * from ticket now, trigger abbreviated @@ -1105,7 +838,7 @@ tls1_process_ticket(SSL *s, const unsigned char *session, int session_len, } r = tls_decrypt_ticket(s, CBS_data(&ext_data), - CBS_len(&ext_data), session, session_len, ret); + CBS_len(&ext_data), session_id, session_id_len, ret); switch (r) { case 2: /* ticket couldn't be decrypted */ @@ -1266,163 +999,3 @@ tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, * ticket. */ return 2; } - -/* Tables to translate from NIDs to TLS v1.2 ids */ - -typedef struct { - int nid; - int id; -} tls12_lookup; - -static tls12_lookup tls12_md[] = { - {NID_md5, TLSEXT_hash_md5}, - {NID_sha1, TLSEXT_hash_sha1}, - {NID_sha224, TLSEXT_hash_sha224}, - {NID_sha256, TLSEXT_hash_sha256}, - {NID_sha384, TLSEXT_hash_sha384}, - {NID_sha512, TLSEXT_hash_sha512}, - {NID_id_GostR3411_94, TLSEXT_hash_gost94}, - {NID_id_tc26_gost3411_2012_256, TLSEXT_hash_streebog_256}, - {NID_id_tc26_gost3411_2012_512, TLSEXT_hash_streebog_512} -}; - -static tls12_lookup tls12_sig[] = { - {EVP_PKEY_RSA, TLSEXT_signature_rsa}, - {EVP_PKEY_EC, TLSEXT_signature_ecdsa}, - {EVP_PKEY_GOSTR01, TLSEXT_signature_gostr01}, -}; - -static int -tls12_find_id(int nid, tls12_lookup *table, size_t tlen) -{ - size_t i; - for (i = 0; i < tlen; i++) { - if (table[i].nid == nid) - return table[i].id; - } - return -1; -} - -int -tls12_get_sigandhash(unsigned char *p, const EVP_PKEY *pk, const EVP_MD *md) -{ - int sig_id, md_id; - if (!md) - return 0; - md_id = tls12_find_id(EVP_MD_type(md), tls12_md, - sizeof(tls12_md) / sizeof(tls12_lookup)); - if (md_id == -1) - return 0; - sig_id = tls12_get_sigid(pk); - if (sig_id == -1) - return 0; - p[0] = (unsigned char)md_id; - p[1] = (unsigned char)sig_id; - return 1; -} - -int -tls12_get_sigid(const EVP_PKEY *pk) -{ - return tls12_find_id(pk->type, tls12_sig, - sizeof(tls12_sig) / sizeof(tls12_lookup)); -} - -const EVP_MD * -tls12_get_hash(unsigned char hash_alg) -{ - switch (hash_alg) { - case TLSEXT_hash_sha1: - return EVP_sha1(); - case TLSEXT_hash_sha224: - return EVP_sha224(); - case TLSEXT_hash_sha256: - return EVP_sha256(); - case TLSEXT_hash_sha384: - return EVP_sha384(); - case TLSEXT_hash_sha512: - return EVP_sha512(); -#ifndef OPENSSL_NO_GOST - case TLSEXT_hash_gost94: - return EVP_gostr341194(); - case TLSEXT_hash_streebog_256: - return EVP_streebog256(); - case TLSEXT_hash_streebog_512: - return EVP_streebog512(); -#endif - default: - return NULL; - } -} - -/* Set preferred digest for each key type */ - -int -tls1_process_sigalgs(SSL *s, CBS *cbs) -{ - const EVP_MD *md; - CERT *c = s->cert; - int idx; - - /* Extension ignored for inappropriate versions */ - if (!SSL_USE_SIGALGS(s)) - return 1; - - /* Should never happen */ - if (c == NULL) - return 0; - - c->pkeys[SSL_PKEY_RSA_SIGN].digest = NULL; - c->pkeys[SSL_PKEY_RSA_ENC].digest = NULL; - c->pkeys[SSL_PKEY_ECC].digest = NULL; - c->pkeys[SSL_PKEY_GOST01].digest = NULL; - - while (CBS_len(cbs) > 0) { - uint8_t hash_alg, sig_alg; - - if (!CBS_get_u8(cbs, &hash_alg) || !CBS_get_u8(cbs, &sig_alg)) - return 0; - - switch (sig_alg) { - case TLSEXT_signature_rsa: - idx = SSL_PKEY_RSA_SIGN; - break; - case TLSEXT_signature_ecdsa: - idx = SSL_PKEY_ECC; - break; - case TLSEXT_signature_gostr01: - case TLSEXT_signature_gostr12_256: - case TLSEXT_signature_gostr12_512: - idx = SSL_PKEY_GOST01; - break; - default: - continue; - } - - if (c->pkeys[idx].digest == NULL) { - md = tls12_get_hash(hash_alg); - if (md) { - c->pkeys[idx].digest = md; - if (idx == SSL_PKEY_RSA_SIGN) - c->pkeys[SSL_PKEY_RSA_ENC].digest = md; - } - } - - } - - /* - * Set any remaining keys to default values. NOTE: if alg is not - * supported it stays as NULL. - */ - if (!c->pkeys[SSL_PKEY_RSA_SIGN].digest) { - c->pkeys[SSL_PKEY_RSA_SIGN].digest = EVP_sha1(); - c->pkeys[SSL_PKEY_RSA_ENC].digest = EVP_sha1(); - } - if (!c->pkeys[SSL_PKEY_ECC].digest) - c->pkeys[SSL_PKEY_ECC].digest = EVP_sha1(); -#ifndef OPENSSL_NO_GOST - if (!c->pkeys[SSL_PKEY_GOST01].digest) - c->pkeys[SSL_PKEY_GOST01].digest = EVP_gostr341194(); -#endif - return 1; -} diff --git a/ssl/t1_meth.c b/ssl/t1_meth.c deleted file mode 100644 index 6a4a243b..00000000 --- a/ssl/t1_meth.c +++ /dev/null @@ -1,243 +0,0 @@ -/* $OpenBSD: t1_meth.c,v 1.23 2017/01/26 05:31:25 jsing Exp $ */ -/* 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.] - */ - -#include - -#include - -#include "ssl_locl.h" - -static const SSL_METHOD *tls1_get_method(int ver); - -static const SSL_METHOD_INTERNAL TLS_method_internal_data = { - .version = TLS1_2_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_2_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl3_accept, - .ssl_connect = ssl3_connect, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl_undefined_function, - .ssl_renegotiate_check = ssl_ok, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_2_enc_data, -}; - -static const SSL_METHOD TLS_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLS_method_internal_data, -}; - -static const SSL_METHOD_INTERNAL TLSv1_method_internal_data = { - .version = TLS1_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl3_accept, - .ssl_connect = ssl3_connect, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_enc_data, -}; - -static const SSL_METHOD TLSv1_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLSv1_method_internal_data, -}; - -static const SSL_METHOD_INTERNAL TLSv1_1_method_internal_data = { - .version = TLS1_1_VERSION, - .min_version = TLS1_1_VERSION, - .max_version = TLS1_1_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl3_accept, - .ssl_connect = ssl3_connect, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_1_enc_data, -}; - -static const SSL_METHOD TLSv1_1_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLSv1_1_method_internal_data, -}; - -static const SSL_METHOD_INTERNAL TLSv1_2_method_internal_data = { - .version = TLS1_2_VERSION, - .min_version = TLS1_2_VERSION, - .max_version = TLS1_2_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl3_accept, - .ssl_connect = ssl3_connect, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_2_enc_data, -}; - -static const SSL_METHOD TLSv1_2_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLSv1_2_method_internal_data, -}; - -static const SSL_METHOD * -tls1_get_method(int ver) -{ - if (ver == TLS1_2_VERSION) - return (TLSv1_2_method()); - if (ver == TLS1_1_VERSION) - return (TLSv1_1_method()); - if (ver == TLS1_VERSION) - return (TLSv1_method()); - return (NULL); -} - -const SSL_METHOD * -SSLv23_method(void) -{ - return (TLS_method()); -} - -const SSL_METHOD * -TLS_method(void) -{ - return &TLS_method_data; -} - -const SSL_METHOD * -TLSv1_method(void) -{ - return (&TLSv1_method_data); -} - -const SSL_METHOD * -TLSv1_1_method(void) -{ - return (&TLSv1_1_method_data); -} - -const SSL_METHOD * -TLSv1_2_method(void) -{ - return (&TLSv1_2_method_data); -} diff --git a/ssl/t1_srvr.c b/ssl/t1_srvr.c deleted file mode 100644 index 1fc0ebe6..00000000 --- a/ssl/t1_srvr.c +++ /dev/null @@ -1,244 +0,0 @@ -/* $OpenBSD: t1_srvr.c,v 1.25 2017/01/26 05:31:25 jsing Exp $ */ -/* 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.] - */ - -#include - -#include "ssl_locl.h" - -#include -#include -#include -#include - -static const SSL_METHOD_INTERNAL TLS_server_method_internal_data = { - .version = TLS1_2_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_2_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl3_accept, - .ssl_connect = ssl_undefined_function, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_server_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl_undefined_function, - .ssl_renegotiate_check = ssl_ok, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_2_enc_data, -}; - -static const SSL_METHOD TLS_server_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLS_server_method_internal_data, -}; - -static const SSL_METHOD_INTERNAL TLSv1_server_method_internal_data = { - .version = TLS1_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl3_accept, - .ssl_connect = ssl_undefined_function, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_server_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_enc_data, -}; - -static const SSL_METHOD TLSv1_server_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLSv1_server_method_internal_data, -}; - -static const SSL_METHOD_INTERNAL TLSv1_1_server_method_internal_data = { - .version = TLS1_1_VERSION, - .min_version = TLS1_1_VERSION, - .max_version = TLS1_1_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl3_accept, - .ssl_connect = ssl_undefined_function, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_server_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_1_enc_data, -}; - -static const SSL_METHOD TLSv1_1_server_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLSv1_1_server_method_internal_data, -}; - -static const SSL_METHOD_INTERNAL TLSv1_2_server_method_internal_data = { - .version = TLS1_2_VERSION, - .min_version = TLS1_2_VERSION, - .max_version = TLS1_2_VERSION, - .ssl_new = tls1_new, - .ssl_clear = tls1_clear, - .ssl_free = tls1_free, - .ssl_accept = ssl3_accept, - .ssl_connect = ssl_undefined_function, - .ssl_read = ssl3_read, - .ssl_peek = ssl3_peek, - .ssl_write = ssl3_write, - .ssl_shutdown = ssl3_shutdown, - .ssl_pending = ssl3_pending, - .get_ssl_method = tls1_get_server_method, - .get_timeout = tls1_default_timeout, - .ssl_version = ssl_undefined_void_function, - .ssl_renegotiate = ssl3_renegotiate, - .ssl_renegotiate_check = ssl3_renegotiate_check, - .ssl_get_message = ssl3_get_message, - .ssl_read_bytes = ssl3_read_bytes, - .ssl_write_bytes = ssl3_write_bytes, - .ssl3_enc = &TLSv1_2_enc_data, -}; - -static const SSL_METHOD TLSv1_2_server_method_data = { - .ssl_dispatch_alert = ssl3_dispatch_alert, - .num_ciphers = ssl3_num_ciphers, - .get_cipher = ssl3_get_cipher, - .get_cipher_by_char = ssl3_get_cipher_by_char, - .put_cipher_by_char = ssl3_put_cipher_by_char, - .internal = &TLSv1_2_server_method_internal_data, -}; - -const SSL_METHOD * -tls1_get_server_method(int ver) -{ - if (ver == TLS1_2_VERSION) - return (TLSv1_2_server_method()); - if (ver == TLS1_1_VERSION) - return (TLSv1_1_server_method()); - if (ver == TLS1_VERSION) - return (TLSv1_server_method()); - return (NULL); -} - -const SSL_METHOD * -SSLv23_server_method(void) -{ - return (TLS_server_method()); -} - -const SSL_METHOD * -TLS_server_method(void) -{ - return (&TLS_server_method_data); -} - -const SSL_METHOD * -TLSv1_server_method(void) -{ - return (&TLSv1_server_method_data); -} - -const SSL_METHOD * -TLSv1_1_server_method(void) -{ - return (&TLSv1_1_server_method_data); -} - -const SSL_METHOD * -TLSv1_2_server_method(void) -{ - return (&TLSv1_2_server_method_data); -} diff --git a/ssl/tls13_buffer.c b/ssl/tls13_buffer.c new file mode 100644 index 00000000..1b490c8b --- /dev/null +++ b/ssl/tls13_buffer.c @@ -0,0 +1,125 @@ +/* $OpenBSD: tls13_buffer.c,v 1.1 2019/01/17 06:32:12 jsing Exp $ */ +/* + * Copyright (c) 2018, 2019 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "ssl_locl.h" + +#include "bytestring.h" +#include "tls13_internal.h" + +struct tls13_buffer { + size_t capacity; + uint8_t *data; + size_t len; + size_t offset; +}; + +static int tls13_buffer_resize(struct tls13_buffer *buf, size_t capacity); + +struct tls13_buffer * +tls13_buffer_new(size_t init_size) +{ + struct tls13_buffer *buf = NULL; + + if ((buf = calloc(1, sizeof(struct tls13_buffer))) == NULL) + goto err; + + if (!tls13_buffer_resize(buf, init_size)) + goto err; + + return buf; + + err: + tls13_buffer_free(buf); + + return NULL; +} + +void +tls13_buffer_free(struct tls13_buffer *buf) +{ + if (buf == NULL) + return; + + freezero(buf->data, buf->capacity); + freezero(buf, sizeof(struct tls13_buffer)); +} + +static int +tls13_buffer_resize(struct tls13_buffer *buf, size_t capacity) +{ + uint8_t *data; + + if (buf->capacity == capacity) + return 1; + + if ((data = recallocarray(buf->data, buf->capacity, capacity, 1)) == NULL) + return 0; + + buf->data = data; + buf->capacity = capacity; + + return 1; +} + +ssize_t +tls13_buffer_extend(struct tls13_buffer *buf, size_t len, + tls13_read_cb read_cb, void *cb_arg) +{ + ssize_t ret; + + if (len == buf->len) + return buf->len; + + if (len < buf->len) + return TLS13_IO_FAILURE; + + if (!tls13_buffer_resize(buf, len)) + return TLS13_IO_FAILURE; + + for (;;) { + if ((ret = read_cb(&buf->data[buf->len], + buf->capacity - buf->len, cb_arg)) <= 0) + return ret; + + buf->len += ret; + + if (buf->len == buf->capacity) + return buf->len; + } +} + +void +tls13_buffer_cbs(struct tls13_buffer *buf, CBS *cbs) +{ + CBS_init(cbs, buf->data, buf->len); +} + +int +tls13_buffer_finish(struct tls13_buffer *buf, uint8_t **out, size_t *out_len) +{ + if (out == NULL || out_len == NULL) + return 0; + + *out = buf->data; + *out_len = buf->len; + + buf->capacity = 0; + buf->data = NULL; + buf->len = 0; + + return 1; +} diff --git a/ssl/tls13_client.c b/ssl/tls13_client.c new file mode 100644 index 00000000..a9f1b6bb --- /dev/null +++ b/ssl/tls13_client.c @@ -0,0 +1,784 @@ +/* $OpenBSD: tls13_client.c,v 1.16 2019/04/05 20:23:38 tb Exp $ */ +/* + * Copyright (c) 2018, 2019 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "ssl_locl.h" + +#include +#include + +#include "bytestring.h" +#include "ssl_tlsext.h" +#include "tls13_handshake.h" +#include "tls13_internal.h" + +int +tls13_connect(struct tls13_ctx *ctx) +{ + if (ctx->mode != TLS13_HS_CLIENT) + return TLS13_IO_FAILURE; + + return tls13_handshake_perform(ctx); +} + +static int +tls13_client_init(struct tls13_ctx *ctx) +{ + SSL *s = ctx->ssl; + + if (!ssl_supported_version_range(s, &ctx->hs->min_version, + &ctx->hs->max_version)) { + SSLerror(s, SSL_R_NO_PROTOCOLS_AVAILABLE); + return 0; + } + s->client_version = s->version = ctx->hs->max_version; + + if (!ssl_get_new_session(s, 0)) /* XXX */ + return 0; + + if (!tls1_transcript_init(s)) + return 0; + + arc4random_buf(s->s3->client_random, SSL3_RANDOM_SIZE); + + return 1; +} + +int +tls13_legacy_connect(SSL *ssl) +{ + struct tls13_ctx *ctx = ssl->internal->tls13; + int ret; + + if (ctx == NULL) { + if ((ctx = tls13_ctx_new(TLS13_HS_CLIENT)) == NULL) { + SSLerror(ssl, ERR_R_INTERNAL_ERROR); /* XXX */ + return -1; + } + ssl->internal->tls13 = ctx; + ctx->ssl = ssl; + ctx->hs = &S3I(ssl)->hs_tls13; + + if (!tls13_client_init(ctx)) { + if (ERR_peek_error() == 0) + SSLerror(ssl, ERR_R_INTERNAL_ERROR); /* XXX */ + return -1; + } + } + + S3I(ssl)->hs.state = SSL_ST_CONNECT; + + ret = tls13_connect(ctx); + if (ret == TLS13_IO_USE_LEGACY) + return ssl->method->internal->ssl_connect(ssl); + if (ret == TLS13_IO_SUCCESS) + S3I(ssl)->hs.state = SSL_ST_OK; + + return tls13_legacy_return_code(ssl, ret); +} + +int +tls13_use_legacy_client(struct tls13_ctx *ctx) +{ + SSL *s = ctx->ssl; + CBS cbs; + + s->method = tls_legacy_client_method(); + s->client_version = s->version = s->method->internal->max_version; + + if (!ssl3_setup_init_buffer(s)) + goto err; + if (!ssl3_setup_buffers(s)) + goto err; + if (!ssl_init_wbio_buffer(s, 0)) + goto err; + + if (s->bbio != s->wbio) + s->wbio = BIO_push(s->bbio, s->wbio); + + if (!tls13_handshake_msg_content(ctx->hs_msg, &cbs)) + goto err; + + if (!BUF_MEM_grow_clean(s->internal->init_buf, CBS_len(&cbs) + 4)) + goto err; + + if (!CBS_write_bytes(&cbs, s->internal->init_buf->data + 4, + s->internal->init_buf->length - 4, NULL)) + goto err; + + S3I(s)->tmp.reuse_message = 1; + S3I(s)->tmp.message_type = tls13_handshake_msg_type(ctx->hs_msg); + S3I(s)->tmp.message_size = CBS_len(&cbs); + + S3I(s)->hs.state = SSL3_ST_CR_SRVR_HELLO_A; + + return 1; + + err: + return 0; +} + +static int +tls13_client_hello_build(SSL *s, CBB *cbb) +{ + CBB cipher_suites, compression_methods, session_id; + uint8_t *sid; + + if (!CBB_add_u16(cbb, TLS1_2_VERSION)) + goto err; + if (!CBB_add_bytes(cbb, s->s3->client_random, SSL3_RANDOM_SIZE)) + goto err; + + /* Either 32-random bytes or zero length... */ + /* XXX - session resumption for TLSv1.2? */ + if (!CBB_add_u8_length_prefixed(cbb, &session_id)) + goto err; + if (!CBB_add_space(&session_id, &sid, 32)) + goto err; + arc4random_buf(sid, 32); + + if (!CBB_add_u16_length_prefixed(cbb, &cipher_suites)) + goto err; + if (!ssl_cipher_list_to_bytes(s, SSL_get_ciphers(s), &cipher_suites)) { + SSLerror(s, SSL_R_NO_CIPHERS_AVAILABLE); + goto err; + } + + if (!CBB_add_u8_length_prefixed(cbb, &compression_methods)) + goto err; + if (!CBB_add_u8(&compression_methods, 0)) + goto err; + + if (!tlsext_client_build(s, cbb, SSL_TLSEXT_MSG_CH)) + goto err; + + if (!CBB_flush(cbb)) + goto err; + + return 1; + + err: + return 0; +} + +int +tls13_client_hello_send(struct tls13_ctx *ctx) +{ + CBB body; + + if (!tls13_handshake_msg_start(ctx->hs_msg, &body, TLS13_MT_CLIENT_HELLO)) + return 0; + if (!tls13_client_hello_build(ctx->ssl, &body)) + return 0; + if (!tls13_handshake_msg_finish(ctx->hs_msg)) + return 0; + + return 1; +} + +/* + * HelloRetryRequest hash - RFC 8446 section 4.1.3. + */ +static const uint8_t tls13_hello_retry_request_hash[] = { + 0xcf, 0x21, 0xad, 0x74, 0xe5, 0x9a, 0x61, 0x11, + 0xbe, 0x1d, 0x8c, 0x02, 0x1e, 0x65, 0xb8, 0x91, + 0xc2, 0xa2, 0x11, 0x16, 0x7a, 0xbb, 0x8c, 0x5e, + 0x07, 0x9e, 0x09, 0xe2, 0xc8, 0xa8, 0x33, 0x9c, +}; + +static int +tls13_server_hello_is_legacy(CBS *cbs) +{ + CBS extensions_block, extensions, extension_data; + uint16_t selected_version = 0; + uint16_t type; + + CBS_dup(cbs, &extensions_block); + + if (!CBS_get_u16_length_prefixed(&extensions_block, &extensions)) + return 1; + + while (CBS_len(&extensions) > 0) { + if (!CBS_get_u16(&extensions, &type)) + return 1; + if (!CBS_get_u16_length_prefixed(&extensions, &extension_data)) + return 1; + + if (type != TLSEXT_TYPE_supported_versions) + continue; + if (!CBS_get_u16(&extension_data, &selected_version)) + return 1; + if (CBS_len(&extension_data) != 0) + return 1; + } + + return (selected_version < TLS1_3_VERSION); +} + +static int +tls13_server_hello_process(struct tls13_ctx *ctx, CBS *cbs) +{ + CBS server_random, session_id; + uint16_t cipher_suite, legacy_version; + uint8_t compression_method; + const SSL_CIPHER *cipher; + SSL *s = ctx->ssl; + int alert; + + if (!CBS_get_u16(cbs, &legacy_version)) + goto err; + if (!CBS_get_bytes(cbs, &server_random, SSL3_RANDOM_SIZE)) + goto err; + if (!CBS_get_u8_length_prefixed(cbs, &session_id)) + goto err; + if (!CBS_get_u16(cbs, &cipher_suite)) + goto err; + if (!CBS_get_u8(cbs, &compression_method)) + goto err; + + if (tls13_server_hello_is_legacy(cbs)) + return tls13_use_legacy_client(ctx); + + if (!tlsext_client_parse(s, cbs, &alert, SSL_TLSEXT_MSG_SH)) + goto err; + + if (CBS_len(cbs) != 0) + goto err; + + /* + * See if a supported versions extension was returned. If it was then + * the legacy version must be set to 0x0303 (RFC 8446 section 4.1.3). + * Otherwise, fallback to the legacy version, ensuring that it is both + * within range and not TLS 1.3 or greater (which must use the + * supported version extension. + */ + if (ctx->hs->server_version != 0) { + if (legacy_version != TLS1_2_VERSION) { + /* XXX - alert. */ + goto err; + } + } else { + if (legacy_version < ctx->hs->min_version || + legacy_version > ctx->hs->max_version || + legacy_version > TLS1_2_VERSION) { + /* XXX - alert. */ + goto err; + } + ctx->hs->server_version = legacy_version; + } + + /* XXX - session_id must match. */ + + /* + * Ensure that the cipher suite is one that we offered in the client + * hello and that it matches the TLS version selected. + */ + cipher = ssl3_get_cipher_by_value(cipher_suite); + if (cipher == NULL || + sk_SSL_CIPHER_find(ssl_get_ciphers_by_id(s), cipher) < 0) { + /* XXX - alert. */ + goto err; + } + if (ctx->hs->server_version == TLS1_3_VERSION && + cipher->algorithm_ssl != SSL_TLSV1_3) { + /* XXX - alert. */ + goto err; + } + /* XXX - move this to hs_tls13? */ + S3I(s)->hs.new_cipher = cipher; + + if (compression_method != 0) { + /* XXX - alert. */ + goto err; + } + + if (CBS_mem_equal(&server_random, tls13_hello_retry_request_hash, + sizeof(tls13_hello_retry_request_hash))) + ctx->handshake_stage.hs_type |= WITH_HRR; + + return 1; + + err: + /* XXX - send alert. */ + + return 0; +} + +int +tls13_server_hello_recv(struct tls13_ctx *ctx) +{ + struct tls13_secrets *secrets; + struct tls13_secret context; + unsigned char buf[EVP_MAX_MD_SIZE]; + uint8_t *shared_key = NULL; + size_t hash_len; + SSL *s = ctx->ssl; + int ret = 0; + CBS cbs; + + if (!tls13_handshake_msg_content(ctx->hs_msg, &cbs)) + goto err; + + if (!tls13_server_hello_process(ctx, &cbs)) + goto err; + + /* See if we switched back to the legacy client method. */ + if (s->method->internal->version < TLS1_3_VERSION) + return 1; + + /* XXX - handle other key share types. */ + if (ctx->hs->x25519_peer_public == NULL) { + /* XXX - alert. */ + goto err; + } + if ((shared_key = malloc(X25519_KEY_LENGTH)) == NULL) + goto err; + if (!X25519(shared_key, ctx->hs->x25519_private, + ctx->hs->x25519_peer_public)) + goto err; + + s->session->cipher = S3I(s)->hs.new_cipher; + s->session->ssl_version = ctx->hs->server_version; + + if ((ctx->aead = tls13_cipher_aead(S3I(s)->hs.new_cipher)) == NULL) + goto err; + if ((ctx->hash = tls13_cipher_hash(S3I(s)->hs.new_cipher)) == NULL) + goto err; + + if ((secrets = tls13_secrets_create(ctx->hash, 0)) == NULL) + goto err; + S3I(ctx->ssl)->hs_tls13.secrets = secrets; + + /* XXX - pass in hash. */ + if (!tls1_transcript_hash_init(s)) + goto err; + if (!tls1_transcript_hash_value(s, buf, sizeof(buf), &hash_len)) + goto err; + context.data = buf; + context.len = hash_len; + + /* Early secrets. */ + if (!tls13_derive_early_secrets(secrets, secrets->zeros.data, + secrets->zeros.len, &context)) + goto err; + + /* Handshake secrets. */ + if (!tls13_derive_handshake_secrets(ctx->hs->secrets, shared_key, + X25519_KEY_LENGTH, &context)) + goto err; + + tls13_record_layer_set_aead(ctx->rl, ctx->aead); + tls13_record_layer_set_hash(ctx->rl, ctx->hash); + + if (!tls13_record_layer_set_read_traffic_key(ctx->rl, + &secrets->server_handshake_traffic)) + goto err; + if (!tls13_record_layer_set_write_traffic_key(ctx->rl, + &secrets->client_handshake_traffic)) + goto err; + + ctx->handshake_stage.hs_type |= NEGOTIATED; + ret = 1; + + err: + freezero(shared_key, X25519_KEY_LENGTH); + return ret; +} + +int +tls13_server_encrypted_extensions_recv(struct tls13_ctx *ctx) +{ + int alert; + CBS cbs; + + if (!tls13_handshake_msg_content(ctx->hs_msg, &cbs)) + goto err; + + if (!tlsext_client_parse(ctx->ssl, &cbs, &alert, SSL_TLSEXT_MSG_EE)) + goto err; + + if (CBS_len(&cbs) != 0) + goto err; + + return 1; + + err: + /* XXX - send alert. */ + + return 0; +} + +int +tls13_server_certificate_request_recv(struct tls13_ctx *ctx) +{ + /* + * Thanks to poor state design in the RFC, this function can be called + * when we actually have a certificate message instead of a certificate + * request... in that case we call the certificate handler after + * switching state, to avoid advancing state. + */ + if (tls13_handshake_msg_type(ctx->hs_msg) == TLS13_MT_CERTIFICATE) { + ctx->handshake_stage.hs_type |= WITHOUT_CR; + return tls13_server_certificate_recv(ctx); + } + + /* XXX - unimplemented. */ + + return 0; +} + +int +tls13_server_certificate_recv(struct tls13_ctx *ctx) +{ + CBS cbs, cert_request_context, cert_list, cert_data, cert_exts; + struct stack_st_X509 *certs = NULL; + SSL *s = ctx->ssl; + X509 *cert = NULL; + EVP_PKEY *pkey; + const uint8_t *p; + int cert_idx; + int ret = 0; + + if ((certs = sk_X509_new_null()) == NULL) + goto err; + + if (!tls13_handshake_msg_content(ctx->hs_msg, &cbs)) + goto err; + + if (!CBS_get_u8_length_prefixed(&cbs, &cert_request_context)) + goto err; + if (CBS_len(&cert_request_context) != 0) + goto err; + if (!CBS_get_u24_length_prefixed(&cbs, &cert_list)) + goto err; + if (CBS_len(&cbs) != 0) + goto err; + + while (CBS_len(&cert_list) > 0) { + if (!CBS_get_u24_length_prefixed(&cert_list, &cert_data)) + goto err; + if (!CBS_get_u16_length_prefixed(&cert_list, &cert_exts)) + goto err; + + p = CBS_data(&cert_data); + if ((cert = d2i_X509(NULL, &p, CBS_len(&cert_data))) == NULL) + goto err; + if (p != CBS_data(&cert_data) + CBS_len(&cert_data)) + goto err; + + if (!sk_X509_push(certs, cert)) + goto err; + + cert = NULL; + } + + /* + * At this stage we still have no proof of possession. As such, it would + * be preferable to keep the chain and verify once we have successfully + * processed the CertificateVerify message. + */ + if (ssl_verify_cert_chain(s, certs) <= 0 && + s->verify_mode != SSL_VERIFY_NONE) { + /* XXX send alert */ + goto err; + } + ERR_clear_error(); + + cert = sk_X509_value(certs, 0); + X509_up_ref(cert); + + if ((pkey = X509_get0_pubkey(cert)) == NULL) + goto err; + if (EVP_PKEY_missing_parameters(pkey)) + goto err; + if ((cert_idx = ssl_cert_type(cert, pkey)) < 0) + goto err; + + ssl_sess_cert_free(SSI(s)->sess_cert); + if ((SSI(s)->sess_cert = ssl_sess_cert_new()) == NULL) + goto err; + + SSI(s)->sess_cert->cert_chain = certs; + certs = NULL; + + X509_up_ref(cert); + SSI(s)->sess_cert->peer_pkeys[cert_idx].x509 = cert; + SSI(s)->sess_cert->peer_key = &(SSI(s)->sess_cert->peer_pkeys[cert_idx]); + + X509_free(s->session->peer); + + X509_up_ref(cert); + s->session->peer = cert; + s->session->verify_result = s->verify_result; + + ret = 1; + + err: + sk_X509_pop_free(certs, X509_free); + X509_free(cert); + + return ret; +} + +/* + * Certificate Verify padding - RFC 8446 section 4.4.3. + */ +static uint8_t cert_verify_pad[64] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, +}; + +static uint8_t server_cert_verify_context[] = "TLS 1.3, server CertificateVerify"; + +int +tls13_server_certificate_verify_recv(struct tls13_ctx *ctx) +{ + const struct ssl_sigalg *sigalg; + uint16_t signature_scheme; + uint8_t *sig_content = NULL; + size_t sig_content_len; + EVP_MD_CTX *mdctx = NULL; + EVP_PKEY_CTX *pctx; + EVP_PKEY *pkey; + X509 *cert; + CBS cbs, signature; + CBB cbb; + int ret = 0; + + memset(&cbb, 0, sizeof(cbb)); + + if (!tls13_handshake_msg_content(ctx->hs_msg, &cbs)) + goto err; + + if (!CBS_get_u16(&cbs, &signature_scheme)) + goto err; + if (!CBS_get_u16_length_prefixed(&cbs, &signature)) + goto err; + if (CBS_len(&cbs) != 0) + goto err; + + if ((sigalg = ssl_sigalg(signature_scheme, tls13_sigalgs, + tls13_sigalgs_len)) == NULL) + goto err; + + if (!CBB_init(&cbb, 0)) + goto err; + if (!CBB_add_bytes(&cbb, cert_verify_pad, sizeof(cert_verify_pad))) + goto err; + if (!CBB_add_bytes(&cbb, server_cert_verify_context, + strlen(server_cert_verify_context))) + goto err; + if (!CBB_add_u8(&cbb, 0)) + goto err; + if (!CBB_add_bytes(&cbb, ctx->hs->transcript_hash, + ctx->hs->transcript_hash_len)) + goto err; + if (!CBB_finish(&cbb, &sig_content, &sig_content_len)) + goto err; + + if ((cert = ctx->ssl->session->peer) == NULL) + goto err; + if ((pkey = X509_get0_pubkey(cert)) == NULL) + goto err; + if (!ssl_sigalg_pkey_ok(sigalg, pkey, 1)) + goto err; + + if (CBS_len(&signature) > EVP_PKEY_size(pkey)) + goto err; + + if ((mdctx = EVP_MD_CTX_new()) == NULL) + goto err; + if (!EVP_DigestVerifyInit(mdctx, &pctx, sigalg->md(), NULL, pkey)) + goto err; + if (sigalg->flags & SIGALG_FLAG_RSA_PSS) { + if (!EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING)) + goto err; + if (!EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, -1)) + goto err; + } + if (!EVP_DigestVerifyUpdate(mdctx, sig_content, sig_content_len)) + goto err; + if (EVP_DigestVerifyFinal(mdctx, CBS_data(&signature), + CBS_len(&signature)) <= 0) { + /* XXX - send alert. */ + goto err; + } + + ret = 1; + + err: + CBB_cleanup(&cbb); + EVP_MD_CTX_free(mdctx); + free(sig_content); + + return ret; +} + +int +tls13_server_finished_recv(struct tls13_ctx *ctx) +{ + struct tls13_secrets *secrets = ctx->hs->secrets; + struct tls13_secret context = { .data = "", .len = 0 }; + struct tls13_secret finished_key; + uint8_t transcript_hash[EVP_MAX_MD_SIZE]; + size_t transcript_hash_len; + uint8_t *verify_data = NULL; + size_t verify_data_len; + uint8_t key[EVP_MAX_MD_SIZE]; + HMAC_CTX *hmac_ctx = NULL; + unsigned int hlen; + int ret = 0; + CBS cbs; + + if (!tls13_handshake_msg_content(ctx->hs_msg, &cbs)) + goto err; + + /* + * Verify server finished. + */ + finished_key.data = key; + finished_key.len = EVP_MD_size(ctx->hash); + + if (!tls13_hkdf_expand_label(&finished_key, ctx->hash, + &secrets->server_handshake_traffic, "finished", + &context)) + goto err; + + if ((hmac_ctx = HMAC_CTX_new()) == NULL) + goto err; + if (!HMAC_Init_ex(hmac_ctx, finished_key.data, finished_key.len, + ctx->hash, NULL)) + goto err; + if (!HMAC_Update(hmac_ctx, ctx->hs->transcript_hash, + ctx->hs->transcript_hash_len)) + goto err; + verify_data_len = HMAC_size(hmac_ctx); + if ((verify_data = calloc(1, verify_data_len)) == NULL) + goto err; + if (!HMAC_Final(hmac_ctx, verify_data, &hlen)) + goto err; + if (hlen != verify_data_len) + goto err; + + if (!CBS_mem_equal(&cbs, verify_data, verify_data_len)) { + /* XXX - send alert. */ + goto err; + } + + /* + * Derive application traffic keys. + */ + if (!tls1_transcript_hash_value(ctx->ssl, transcript_hash, + sizeof(transcript_hash), &transcript_hash_len)) + goto err; + + context.data = transcript_hash; + context.len = transcript_hash_len; + + if (!tls13_derive_application_secrets(secrets, &context)) + goto err; + + /* + * Any records following the server finished message must be encrypted + * using the server application traffic keys. + */ + if (!tls13_record_layer_set_read_traffic_key(ctx->rl, + &secrets->server_application_traffic)) + goto err; + + ret = 1; + + err: + HMAC_CTX_free(hmac_ctx); + free(verify_data); + + return ret; +} + +int +tls13_client_finished_send(struct tls13_ctx *ctx) +{ + struct tls13_secrets *secrets = ctx->hs->secrets; + struct tls13_secret context = { .data = "", .len = 0 }; + struct tls13_secret finished_key; + uint8_t transcript_hash[EVP_MAX_MD_SIZE]; + size_t transcript_hash_len; + uint8_t key[EVP_MAX_MD_SIZE]; + uint8_t *verify_data; + size_t hmac_len; + unsigned int hlen; + HMAC_CTX *hmac_ctx = NULL; + int ret = 0; + CBB body; + + finished_key.data = key; + finished_key.len = EVP_MD_size(ctx->hash); + + if (!tls13_hkdf_expand_label(&finished_key, ctx->hash, + &secrets->client_handshake_traffic, "finished", + &context)) + goto err; + + if (!tls1_transcript_hash_value(ctx->ssl, transcript_hash, + sizeof(transcript_hash), &transcript_hash_len)) + goto err; + + if ((hmac_ctx = HMAC_CTX_new()) == NULL) + goto err; + if (!HMAC_Init_ex(hmac_ctx, finished_key.data, finished_key.len, + ctx->hash, NULL)) + goto err; + if (!HMAC_Update(hmac_ctx, transcript_hash, transcript_hash_len)) + goto err; + + if (!tls13_handshake_msg_start(ctx->hs_msg, &body, TLS13_MT_FINISHED)) + goto err; + hmac_len = HMAC_size(hmac_ctx); + if (!CBB_add_space(&body, &verify_data, hmac_len)) + goto err; + if (!HMAC_Final(hmac_ctx, verify_data, &hlen)) + goto err; + if (hlen != hmac_len) + goto err; + if (!tls13_handshake_msg_finish(ctx->hs_msg)) + goto err; + + ret = 1; + + err: + HMAC_CTX_free(hmac_ctx); + + return ret; +} + +int +tls13_client_finished_sent(struct tls13_ctx *ctx) +{ + struct tls13_secrets *secrets = ctx->hs->secrets; + + /* + * Any records following the client finished message must be encrypted + * using the client application traffic keys. + */ + return tls13_record_layer_set_write_traffic_key(ctx->rl, + &secrets->client_application_traffic); +} diff --git a/ssl/tls13_handshake.c b/ssl/tls13_handshake.c new file mode 100644 index 00000000..542410bd --- /dev/null +++ b/ssl/tls13_handshake.c @@ -0,0 +1,525 @@ +/* $OpenBSD: tls13_handshake.c,v 1.35 2019/04/05 20:23:38 tb Exp $ */ +/* + * Copyright (c) 2018-2019 Theo Buehler + * Copyright (c) 2019 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#include "ssl_locl.h" +#include "tls13_handshake.h" +#include "tls13_internal.h" + +/* Based on RFC 8446 and inspired by s2n's TLS 1.2 state machine. */ + +struct tls13_handshake_action { + uint8_t handshake_type; + uint8_t sender; + uint8_t handshake_complete; + uint8_t preserve_transcript_hash; + + int (*send)(struct tls13_ctx *ctx); + int (*sent)(struct tls13_ctx *ctx); + int (*recv)(struct tls13_ctx *ctx); +}; + +enum tls13_message_type tls13_handshake_active_state(struct tls13_ctx *ctx); + +int tls13_accept(struct tls13_ctx *ctx); + +struct tls13_handshake_action * + tls13_handshake_active_action(struct tls13_ctx *ctx); +int tls13_handshake_advance_state_machine(struct tls13_ctx *ctx); + +int tls13_handshake_send_action(struct tls13_ctx *ctx, + struct tls13_handshake_action *action); +int tls13_handshake_recv_action(struct tls13_ctx *ctx, + struct tls13_handshake_action *action); + +struct tls13_handshake_action state_machine[] = { + [CLIENT_HELLO] = { + .handshake_type = TLS13_MT_CLIENT_HELLO, + .sender = TLS13_HS_CLIENT, + .send = tls13_client_hello_send, + .recv = tls13_client_hello_recv, + }, + [CLIENT_HELLO_RETRY] = { + .handshake_type = TLS13_MT_CLIENT_HELLO, + .sender = TLS13_HS_CLIENT, + .send = tls13_client_hello_retry_send, + .recv = tls13_client_hello_retry_recv, + }, + [CLIENT_END_OF_EARLY_DATA] = { + .handshake_type = TLS13_MT_END_OF_EARLY_DATA, + .sender = TLS13_HS_CLIENT, + .send = tls13_client_end_of_early_data_send, + .recv = tls13_client_end_of_early_data_recv, + }, + [CLIENT_CERTIFICATE] = { + .handshake_type = TLS13_MT_CERTIFICATE, + .sender = TLS13_HS_CLIENT, + .send = tls13_client_certificate_send, + .recv = tls13_client_certificate_recv, + }, + [CLIENT_CERTIFICATE_VERIFY] = { + .handshake_type = TLS13_MT_CERTIFICATE_VERIFY, + .sender = TLS13_HS_CLIENT, + .send = tls13_client_certificate_verify_send, + .recv = tls13_client_certificate_verify_recv, + }, + [CLIENT_FINISHED] = { + .handshake_type = TLS13_MT_FINISHED, + .sender = TLS13_HS_CLIENT, + .send = tls13_client_finished_send, + .sent = tls13_client_finished_sent, + .recv = tls13_client_finished_recv, + }, + [CLIENT_KEY_UPDATE] = { + .handshake_type = TLS13_MT_KEY_UPDATE, + .sender = TLS13_HS_CLIENT, + .send = tls13_client_key_update_send, + .recv = tls13_client_key_update_recv, + }, + [SERVER_HELLO] = { + .handshake_type = TLS13_MT_SERVER_HELLO, + .sender = TLS13_HS_SERVER, + .send = tls13_server_hello_send, + .recv = tls13_server_hello_recv, + }, + [SERVER_HELLO_RETRY] = { + .handshake_type = TLS13_MT_SERVER_HELLO, + .sender = TLS13_HS_SERVER, + .send = tls13_server_hello_retry_send, + .recv = tls13_server_hello_retry_recv, + }, + [SERVER_ENCRYPTED_EXTENSIONS] = { + .handshake_type = TLS13_MT_ENCRYPTED_EXTENSIONS, + .sender = TLS13_HS_SERVER, + .send = tls13_server_encrypted_extensions_send, + .recv = tls13_server_encrypted_extensions_recv, + }, + [SERVER_CERTIFICATE] = { + .handshake_type = TLS13_MT_CERTIFICATE, + .sender = TLS13_HS_SERVER, + .send = tls13_server_certificate_send, + .recv = tls13_server_certificate_recv, + }, + [SERVER_CERTIFICATE_REQUEST] = { + .handshake_type = TLS13_MT_CERTIFICATE, + .sender = TLS13_HS_SERVER, + .send = tls13_server_certificate_request_send, + .recv = tls13_server_certificate_request_recv, + }, + [SERVER_CERTIFICATE_VERIFY] = { + .handshake_type = TLS13_MT_CERTIFICATE_VERIFY, + .sender = TLS13_HS_SERVER, + .preserve_transcript_hash = 1, + .send = tls13_server_certificate_verify_send, + .recv = tls13_server_certificate_verify_recv, + }, + [SERVER_FINISHED] = { + .handshake_type = TLS13_MT_FINISHED, + .sender = TLS13_HS_SERVER, + .preserve_transcript_hash = 1, + .send = tls13_server_finished_send, + .recv = tls13_server_finished_recv, + }, + [APPLICATION_DATA] = { + .handshake_complete = 1, + }, +}; + +enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES] = { + [INITIAL] = { + CLIENT_HELLO, + SERVER_HELLO, + }, + [NEGOTIATED] = { + CLIENT_HELLO, + SERVER_HELLO, + SERVER_ENCRYPTED_EXTENSIONS, + SERVER_CERTIFICATE_REQUEST, + SERVER_CERTIFICATE, + SERVER_CERTIFICATE_VERIFY, + SERVER_FINISHED, + CLIENT_CERTIFICATE, + CLIENT_FINISHED, + APPLICATION_DATA, + }, + [NEGOTIATED | WITH_HRR] = { + CLIENT_HELLO, + SERVER_HELLO, + CLIENT_HELLO_RETRY, + SERVER_HELLO_RETRY, + SERVER_ENCRYPTED_EXTENSIONS, + SERVER_CERTIFICATE_REQUEST, + SERVER_CERTIFICATE, + SERVER_CERTIFICATE_VERIFY, + SERVER_FINISHED, + CLIENT_CERTIFICATE, + CLIENT_FINISHED, + APPLICATION_DATA, + }, + [NEGOTIATED | WITHOUT_CR] = { + CLIENT_HELLO, + SERVER_HELLO, + SERVER_ENCRYPTED_EXTENSIONS, + SERVER_CERTIFICATE, + SERVER_CERTIFICATE_VERIFY, + SERVER_FINISHED, + CLIENT_FINISHED, + APPLICATION_DATA, + }, + [NEGOTIATED | WITH_HRR | WITHOUT_CR] = { + CLIENT_HELLO, + SERVER_HELLO, + CLIENT_HELLO_RETRY, + SERVER_HELLO_RETRY, + SERVER_ENCRYPTED_EXTENSIONS, + SERVER_CERTIFICATE, + SERVER_CERTIFICATE_VERIFY, + SERVER_FINISHED, + CLIENT_FINISHED, + APPLICATION_DATA, + }, + [NEGOTIATED | WITH_PSK] = { + CLIENT_HELLO, + SERVER_HELLO, + SERVER_ENCRYPTED_EXTENSIONS, + SERVER_FINISHED, + CLIENT_FINISHED, + APPLICATION_DATA, + }, + [NEGOTIATED | WITH_HRR | WITH_PSK] = { + CLIENT_HELLO, + SERVER_HELLO, + CLIENT_HELLO_RETRY, + SERVER_HELLO_RETRY, + SERVER_ENCRYPTED_EXTENSIONS, + SERVER_FINISHED, + CLIENT_FINISHED, + APPLICATION_DATA, + }, + [NEGOTIATED | WITH_CCV] = { + CLIENT_HELLO, + SERVER_HELLO, + SERVER_ENCRYPTED_EXTENSIONS, + SERVER_CERTIFICATE_REQUEST, + SERVER_CERTIFICATE, + SERVER_CERTIFICATE_VERIFY, + SERVER_FINISHED, + CLIENT_CERTIFICATE, + CLIENT_CERTIFICATE_VERIFY, + CLIENT_FINISHED, + APPLICATION_DATA, + }, + [NEGOTIATED | WITH_HRR | WITH_CCV] = { + CLIENT_HELLO, + SERVER_HELLO, + CLIENT_HELLO_RETRY, + SERVER_HELLO_RETRY, + SERVER_ENCRYPTED_EXTENSIONS, + SERVER_CERTIFICATE_REQUEST, + SERVER_CERTIFICATE, + SERVER_CERTIFICATE_VERIFY, + SERVER_FINISHED, + CLIENT_CERTIFICATE, + CLIENT_CERTIFICATE_VERIFY, + CLIENT_FINISHED, + APPLICATION_DATA, + }, +}; + +const size_t handshake_count = sizeof(handshakes) / sizeof(handshakes[0]); + +enum tls13_message_type +tls13_handshake_active_state(struct tls13_ctx *ctx) +{ + struct tls13_handshake_stage hs = ctx->handshake_stage; + + if (hs.hs_type >= handshake_count) + return INVALID; + if (hs.message_number >= TLS13_NUM_MESSAGE_TYPES) + return INVALID; + + return handshakes[hs.hs_type][hs.message_number]; +} + +struct tls13_handshake_action * +tls13_handshake_active_action(struct tls13_ctx *ctx) +{ + enum tls13_message_type mt = tls13_handshake_active_state(ctx); + + if (mt == INVALID) + return NULL; + + return &state_machine[mt]; +} + +int +tls13_handshake_advance_state_machine(struct tls13_ctx *ctx) +{ + if (++ctx->handshake_stage.message_number >= TLS13_NUM_MESSAGE_TYPES) + return 0; + + return 1; +} + +int +tls13_handshake_perform(struct tls13_ctx *ctx) +{ + struct tls13_handshake_action *action; + int ret; + + for (;;) { + if ((action = tls13_handshake_active_action(ctx)) == NULL) + return TLS13_IO_FAILURE; + + if (action->handshake_complete) { + ctx->handshake_completed = 1; + tls13_record_layer_handshake_completed(ctx->rl); + return TLS13_IO_SUCCESS; + } + + if (action->sender == ctx->mode) { + if ((ret = tls13_handshake_send_action(ctx, action)) <= 0) + return ret; + } else { + if ((ret = tls13_handshake_recv_action(ctx, action)) <= 0) + return ret; + } + + if (!tls13_handshake_advance_state_machine(ctx)) + return TLS13_IO_FAILURE; + } +} + +int +tls13_accept(struct tls13_ctx *ctx) +{ + ctx->mode = TLS13_HS_SERVER; + + return tls13_handshake_perform(ctx); +} + +int +tls13_handshake_send_action(struct tls13_ctx *ctx, + struct tls13_handshake_action *action) +{ + ssize_t ret; + CBS cbs; + + /* If we have no handshake message, we need to build one. */ + if (ctx->hs_msg == NULL) { + if ((ctx->hs_msg = tls13_handshake_msg_new()) == NULL) + return TLS13_IO_FAILURE; + + /* XXX - provide CBB. */ + if (!action->send(ctx)) + return TLS13_IO_FAILURE; + } + + if ((ret = tls13_handshake_msg_send(ctx->hs_msg, ctx->rl)) <= 0) + return ret; + + tls13_handshake_msg_data(ctx->hs_msg, &cbs); + if (!tls1_transcript_record(ctx->ssl, CBS_data(&cbs), CBS_len(&cbs))) + return TLS13_IO_FAILURE; + + tls13_handshake_msg_free(ctx->hs_msg); + ctx->hs_msg = NULL; + + if (action->sent != NULL && !action->sent(ctx)) + return TLS13_IO_FAILURE; + + return TLS13_IO_SUCCESS; +} + +int +tls13_handshake_recv_action(struct tls13_ctx *ctx, + struct tls13_handshake_action *action) +{ + uint8_t msg_type; + ssize_t ret; + CBS cbs; + + if (ctx->hs_msg == NULL) { + if ((ctx->hs_msg = tls13_handshake_msg_new()) == NULL) + return TLS13_IO_FAILURE; + } + + if ((ret = tls13_handshake_msg_recv(ctx->hs_msg, ctx->rl)) <= 0) + return ret; + + if (action->preserve_transcript_hash) { + if (!tls1_transcript_hash_value(ctx->ssl, + ctx->hs->transcript_hash, sizeof(ctx->hs->transcript_hash), + &ctx->hs->transcript_hash_len)) + return TLS13_IO_FAILURE; + } + + tls13_handshake_msg_data(ctx->hs_msg, &cbs); + if (!tls1_transcript_record(ctx->ssl, CBS_data(&cbs), CBS_len(&cbs))) + return TLS13_IO_FAILURE; + + /* + * In TLSv1.3 there is no way to know if you're going to receive a + * certificate request message or not, hence we have to special case it + * here. The receive handler also knows how to deal with this situation. + */ + msg_type = tls13_handshake_msg_type(ctx->hs_msg); + if (msg_type != action->handshake_type && + (msg_type != TLS13_MT_CERTIFICATE || + action->handshake_type != TLS13_MT_CERTIFICATE_REQUEST)) { + /* XXX send unexpected message alert */ + return TLS13_IO_FAILURE; + } + + /* XXX provide CBS and check all consumed. */ + ret = TLS13_IO_FAILURE; + if (action->recv(ctx)) + ret = TLS13_IO_SUCCESS; + + tls13_handshake_msg_free(ctx->hs_msg); + ctx->hs_msg = NULL; + + if (ctx->ssl->method->internal->version < TLS1_3_VERSION) + return TLS13_IO_USE_LEGACY; + + return ret; +} + +int +tls13_client_hello_recv(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_client_hello_retry_send(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_server_hello_retry_recv(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_client_hello_retry_recv(struct tls13_ctx *ctx) +{ + return 0; +} + + +int +tls13_client_end_of_early_data_send(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_client_end_of_early_data_recv(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_client_certificate_send(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_client_certificate_recv(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_client_certificate_verify_send(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_client_certificate_verify_recv(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_client_finished_recv(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_client_key_update_send(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_client_key_update_recv(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_server_hello_send(struct tls13_ctx *ctx) +{ + ctx->handshake_stage.hs_type |= NEGOTIATED; + + return 0; +} + +int +tls13_server_hello_retry_send(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_server_encrypted_extensions_send(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_server_certificate_send(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_server_certificate_request_send(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_server_certificate_verify_send(struct tls13_ctx *ctx) +{ + return 0; +} + +int +tls13_server_finished_send(struct tls13_ctx *ctx) +{ + return 0; +} diff --git a/ssl/tls13_handshake.h b/ssl/tls13_handshake.h new file mode 100644 index 00000000..9910dab1 --- /dev/null +++ b/ssl/tls13_handshake.h @@ -0,0 +1,56 @@ +/* $OpenBSD: tls13_handshake.h,v 1.3 2019/04/05 20:23:38 tb Exp $ */ +/* + * Copyright (c) 2019 Theo Buehler + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_TLS13_HANDSHAKE_H +#define HEADER_TLS13_HANDSHAKE_H + +#include /* for NULL */ + +__BEGIN_HIDDEN_DECLS + +#define INITIAL 0x00 +#define NEGOTIATED 0x01 +#define WITH_HRR 0x02 +#define WITHOUT_CR 0x04 +#define WITH_PSK 0x08 +#define WITH_CCV 0x10 +#define WITH_0RTT 0x20 + +enum tls13_message_type { + INVALID, + CLIENT_HELLO, + SERVER_HELLO, + CLIENT_HELLO_RETRY, + SERVER_HELLO_RETRY, + SERVER_ENCRYPTED_EXTENSIONS, + SERVER_CERTIFICATE_REQUEST, + SERVER_CERTIFICATE, + SERVER_CERTIFICATE_VERIFY, + SERVER_FINISHED, + CLIENT_END_OF_EARLY_DATA, + CLIENT_CERTIFICATE, + CLIENT_CERTIFICATE_VERIFY, + CLIENT_FINISHED, + CLIENT_KEY_UPDATE, + SERVER_NEW_SESSION_TICKET, + APPLICATION_DATA, + TLS13_NUM_MESSAGE_TYPES, +}; + +__END_HIDDEN_DECLS + +#endif /* !HEADER_TLS13_HANDSHAKE_H */ diff --git a/ssl/tls13_handshake_msg.c b/ssl/tls13_handshake_msg.c new file mode 100644 index 00000000..f85271a5 --- /dev/null +++ b/ssl/tls13_handshake_msg.c @@ -0,0 +1,188 @@ +/* $OpenBSD: tls13_handshake_msg.c,v 1.1 2019/01/20 12:27:34 jsing Exp $ */ +/* + * Copyright (c) 2018, 2019 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "bytestring.h" +#include "ssl_locl.h" +#include "tls13_internal.h" + +#define TLS13_HANDSHAKE_MSG_HEADER_LEN 4 +#define TLS13_HANDSHAKE_MSG_INITIAL_LEN 256 +#define TLS13_HANDSHAKE_MSG_MAX_LEN (256 * 1024) + +struct tls13_handshake_msg { + uint8_t msg_type; + uint32_t msg_len; + uint8_t *data; + size_t data_len; + + struct tls13_buffer *buf; + CBS cbs; + CBB cbb; +}; + +struct tls13_handshake_msg * +tls13_handshake_msg_new() +{ + struct tls13_handshake_msg *msg = NULL; + + if ((msg = calloc(1, sizeof(struct tls13_handshake_msg))) == NULL) + goto err; + if ((msg->buf = tls13_buffer_new(0)) == NULL) + goto err; + + return msg; + + err: + tls13_handshake_msg_free(msg); + + return NULL; +} + +void +tls13_handshake_msg_free(struct tls13_handshake_msg *msg) +{ + if (msg == NULL) + return; + + tls13_buffer_free(msg->buf); + + CBB_cleanup(&msg->cbb); + + freezero(msg->data, msg->data_len); + freezero(msg, sizeof(struct tls13_handshake_msg)); +} + +void +tls13_handshake_msg_data(struct tls13_handshake_msg *msg, CBS *cbs) +{ + CBS_init(cbs, msg->data, msg->data_len); +} + +uint8_t +tls13_handshake_msg_type(struct tls13_handshake_msg *msg) +{ + return msg->msg_type; +} + +int +tls13_handshake_msg_content(struct tls13_handshake_msg *msg, CBS *cbs) +{ + tls13_handshake_msg_data(msg, cbs); + + return CBS_skip(cbs, TLS13_HANDSHAKE_MSG_HEADER_LEN); +} + +int +tls13_handshake_msg_start(struct tls13_handshake_msg *msg, CBB *body, + uint8_t msg_type) +{ + if (!CBB_init(&msg->cbb, TLS13_HANDSHAKE_MSG_INITIAL_LEN)) + return 0; + if (!CBB_add_u8(&msg->cbb, msg_type)) + return 0; + if (!CBB_add_u24_length_prefixed(&msg->cbb, body)) + return 0; + + return 1; +} + +int +tls13_handshake_msg_finish(struct tls13_handshake_msg *msg) +{ + if (!CBB_finish(&msg->cbb, &msg->data, &msg->data_len)) + return 0; + + CBS_init(&msg->cbs, msg->data, msg->data_len); + + return 1; +} + +static ssize_t +tls13_handshake_msg_read_cb(void *buf, size_t n, void *cb_arg) +{ + struct tls13_record_layer *rl = cb_arg; + + return tls13_read_handshake_data(rl, buf, n); +} + +int +tls13_handshake_msg_recv(struct tls13_handshake_msg *msg, + struct tls13_record_layer *rl) +{ + uint8_t msg_type; + uint32_t msg_len; + CBS cbs; + int ret; + + if (msg->data != NULL) + return TLS13_IO_FAILURE; + + if (msg->msg_type == 0) { + if ((ret = tls13_buffer_extend(msg->buf, + TLS13_HANDSHAKE_MSG_HEADER_LEN, + tls13_handshake_msg_read_cb, rl)) <= 0) + return ret; + + tls13_buffer_cbs(msg->buf, &cbs); + + if (!CBS_get_u8(&cbs, &msg_type)) + return TLS13_IO_FAILURE; + if (!CBS_get_u24(&cbs, &msg_len)) + return TLS13_IO_FAILURE; + + /* XXX - do we want to make this variable on message type? */ + if (msg_len > TLS13_HANDSHAKE_MSG_MAX_LEN) + return TLS13_IO_FAILURE; + + msg->msg_type = msg_type; + msg->msg_len = msg_len; + } + + if ((ret = tls13_buffer_extend(msg->buf, + TLS13_HANDSHAKE_MSG_HEADER_LEN + msg->msg_len, + tls13_handshake_msg_read_cb, rl)) <= 0) + return ret; + + if (!tls13_buffer_finish(msg->buf, &msg->data, &msg->data_len)) + return TLS13_IO_FAILURE; + + return TLS13_IO_SUCCESS; +} + +int +tls13_handshake_msg_send(struct tls13_handshake_msg *msg, + struct tls13_record_layer *rl) +{ + ssize_t ret; + + if (msg->data == NULL) + return TLS13_IO_FAILURE; + + if (CBS_len(&msg->cbs) == 0) + return TLS13_IO_FAILURE; + + while (CBS_len(&msg->cbs) > 0) { + if ((ret = tls13_write_handshake_data(rl, CBS_data(&msg->cbs), + CBS_len(&msg->cbs))) <= 0) + return ret; + + if (!CBS_skip(&msg->cbs, ret)) + return TLS13_IO_FAILURE; + } + + return TLS13_IO_SUCCESS; +} diff --git a/ssl/tls13_internal.h b/ssl/tls13_internal.h new file mode 100644 index 00000000..1d7a7eb6 --- /dev/null +++ b/ssl/tls13_internal.h @@ -0,0 +1,247 @@ +/* $OpenBSD: tls13_internal.h,v 1.28 2019/04/05 20:23:38 tb Exp $ */ +/* + * Copyright (c) 2018 Bob Beck + * Copyright (c) 2018 Theo Buehler + * Copyright (c) 2018, 2019 Joel Sing + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_TLS13_INTERNAL_H +#define HEADER_TLS13_INTERNAL_H + +#include +#include + +#include "bytestring.h" + +__BEGIN_HIDDEN_DECLS + +#define TLS13_HS_CLIENT 1 +#define TLS13_HS_SERVER 2 + +#define TLS13_IO_SUCCESS 1 +#define TLS13_IO_EOF 0 +#define TLS13_IO_FAILURE -1 +#define TLS13_IO_WANT_POLLIN -2 +#define TLS13_IO_WANT_POLLOUT -3 +#define TLS13_IO_USE_LEGACY -4 + +typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg); +typedef int (*tls13_post_handshake_cb)(void *_cb_arg); +typedef ssize_t (*tls13_read_cb)(void *_buf, size_t _buflen, void *_cb_arg); +typedef ssize_t (*tls13_write_cb)(const void *_buf, size_t _buflen, + void *_cb_arg); + +struct tls13_buffer; + +struct tls13_buffer *tls13_buffer_new(size_t init_size); +void tls13_buffer_free(struct tls13_buffer *buf); +ssize_t tls13_buffer_extend(struct tls13_buffer *buf, size_t len, + tls13_read_cb read_cb, void *cb_arg); +void tls13_buffer_cbs(struct tls13_buffer *buf, CBS *cbs); +int tls13_buffer_finish(struct tls13_buffer *buf, uint8_t **out, + size_t *out_len); + +struct tls13_secret { + uint8_t *data; + size_t len; +}; + +/* RFC 8446 Section 7.1 Page 92 */ +struct tls13_secrets { + const EVP_MD *digest; + int resumption; + int init_done; + int early_done; + int handshake_done; + int schedule_done; + int insecure; /* Set by tests */ + struct tls13_secret zeros; + struct tls13_secret empty_hash; + struct tls13_secret extracted_early; + struct tls13_secret binder_key; + struct tls13_secret client_early_traffic; + struct tls13_secret early_exporter_master; + struct tls13_secret derived_early; + struct tls13_secret extracted_handshake; + struct tls13_secret client_handshake_traffic; + struct tls13_secret server_handshake_traffic; + struct tls13_secret derived_handshake; + struct tls13_secret extracted_master; + struct tls13_secret client_application_traffic; + struct tls13_secret server_application_traffic; + struct tls13_secret exporter_master; + struct tls13_secret resumption_master; +}; + +struct tls13_secrets *tls13_secrets_create(const EVP_MD *digest, + int resumption); +void tls13_secrets_destroy(struct tls13_secrets *secrets); + +int tls13_hkdf_expand_label(struct tls13_secret *out, const EVP_MD *digest, + const struct tls13_secret *secret, const char *label, + const struct tls13_secret *context); + +int tls13_derive_early_secrets(struct tls13_secrets *secrets, uint8_t *psk, + size_t psk_len, const struct tls13_secret *context); +int tls13_derive_handshake_secrets(struct tls13_secrets *secrets, + const uint8_t *ecdhe, size_t ecdhe_len, const struct tls13_secret *context); +int tls13_derive_application_secrets(struct tls13_secrets *secrets, + const struct tls13_secret *context); + +/* + * Record Layer. + */ +struct tls13_record_layer; + +struct tls13_record_layer *tls13_record_layer_new(tls13_read_cb wire_read, + tls13_write_cb wire_write, tls13_alert_cb alert_cb, + tls13_post_handshake_cb post_handshake_cb, void *cb_arg); +void tls13_record_layer_free(struct tls13_record_layer *rl); +void tls13_record_layer_set_aead(struct tls13_record_layer *rl, + const EVP_AEAD *aead); +void tls13_record_layer_set_hash(struct tls13_record_layer *rl, + const EVP_MD *hash); +void tls13_record_layer_handshake_completed(struct tls13_record_layer *rl); +int tls13_record_layer_set_read_traffic_key(struct tls13_record_layer *rl, + struct tls13_secret *read_key); +int tls13_record_layer_set_write_traffic_key(struct tls13_record_layer *rl, + struct tls13_secret *write_key); + +ssize_t tls13_read_handshake_data(struct tls13_record_layer *rl, uint8_t *buf, size_t n); +ssize_t tls13_write_handshake_data(struct tls13_record_layer *rl, const uint8_t *buf, + size_t n); +ssize_t tls13_read_application_data(struct tls13_record_layer *rl, uint8_t *buf, size_t n); +ssize_t tls13_write_application_data(struct tls13_record_layer *rl, const uint8_t *buf, + size_t n); + +/* + * Handshake Messages. + */ +struct tls13_handshake_msg; + +struct tls13_handshake_msg *tls13_handshake_msg_new(void); +void tls13_handshake_msg_free(struct tls13_handshake_msg *msg); +void tls13_handshake_msg_data(struct tls13_handshake_msg *msg, CBS *cbs); +uint8_t tls13_handshake_msg_type(struct tls13_handshake_msg *msg); +int tls13_handshake_msg_content(struct tls13_handshake_msg *msg, CBS *cbs); +int tls13_handshake_msg_start(struct tls13_handshake_msg *msg, CBB *body, + uint8_t msg_type); +int tls13_handshake_msg_finish(struct tls13_handshake_msg *msg); +int tls13_handshake_msg_recv(struct tls13_handshake_msg *msg, + struct tls13_record_layer *rl); +int tls13_handshake_msg_send(struct tls13_handshake_msg *msg, + struct tls13_record_layer *rl); + +struct tls13_handshake_stage { + uint8_t hs_type; + uint8_t message_number; +}; + +struct ssl_handshake_tls13_st; + +struct tls13_ctx { + SSL *ssl; + struct ssl_handshake_tls13_st *hs; + uint8_t mode; + struct tls13_handshake_stage handshake_stage; + int handshake_completed; + + const EVP_AEAD *aead; + const EVP_MD *hash; + + struct tls13_record_layer *rl; + struct tls13_handshake_msg *hs_msg; +}; + +struct tls13_ctx *tls13_ctx_new(int mode); +void tls13_ctx_free(struct tls13_ctx *ctx); + +const EVP_AEAD *tls13_cipher_aead(const SSL_CIPHER *cipher); +const EVP_MD *tls13_cipher_hash(const SSL_CIPHER *cipher); + +/* + * Legacy interfaces. + */ +int tls13_legacy_connect(SSL *ssl); +int tls13_legacy_return_code(SSL *ssl, ssize_t ret); +ssize_t tls13_legacy_wire_read_cb(void *buf, size_t n, void *arg); +ssize_t tls13_legacy_wire_write_cb(const void *buf, size_t n, void *arg); +int tls13_legacy_read_bytes(SSL *ssl, int type, unsigned char *buf, int len, + int peek); +int tls13_legacy_write_bytes(SSL *ssl, int type, const void *buf, int len); + +/* + * Message Types - RFC 8446, Section B.3. + * + * Values listed as "_RESERVED" were used in previous versions of TLS and are + * listed here for completeness. TLS 1.3 implementations MUST NOT send them but + * might receive them from older TLS implementations. + */ +#define TLS13_MT_HELLO_REQUEST_RESERVED 0 +#define TLS13_MT_CLIENT_HELLO 1 +#define TLS13_MT_SERVER_HELLO 2 +#define TLS13_MT_HELLO_VERIFY_REQUEST_RESERVED 3 +#define TLS13_MT_NEW_SESSION_TICKET 4 +#define TLS13_MT_END_OF_EARLY_DATA 5 +#define TLS13_MT_HELLO_RETRY_REQUEST_RESERVED 6 +#define TLS13_MT_ENCRYPTED_EXTENSIONS 8 +#define TLS13_MT_CERTIFICATE 11 +#define TLS13_MT_SERVER_KEY_EXCHANGE_RESERVED 12 +#define TLS13_MT_CERTIFICATE_REQUEST 13 +#define TLS13_MT_SERVER_HELLO_DONE_RESERVED 14 +#define TLS13_MT_CERTIFICATE_VERIFY 15 +#define TLS13_MT_CLIENT_KEY_EXCHANGE_RESERVED 16 +#define TLS13_MT_FINISHED 20 +#define TLS13_MT_CERTIFICATE_URL_RESERVED 21 +#define TLS13_MT_CERTIFICATE_STATUS_RESERVED 22 +#define TLS13_MT_SUPPLEMENTAL_DATA_RESERVED 23 +#define TLS13_MT_KEY_UPDATE 24 +#define TLS13_MT_MESSAGE_HASH 254 + +int tls13_handshake_perform(struct tls13_ctx *ctx); + +int tls13_client_hello_send(struct tls13_ctx *ctx); +int tls13_client_hello_recv(struct tls13_ctx *ctx); +int tls13_client_hello_retry_send(struct tls13_ctx *ctx); +int tls13_client_hello_retry_recv(struct tls13_ctx *ctx); +int tls13_client_end_of_early_data_send(struct tls13_ctx *ctx); +int tls13_client_end_of_early_data_recv(struct tls13_ctx *ctx); +int tls13_client_certificate_send(struct tls13_ctx *ctx); +int tls13_client_certificate_recv(struct tls13_ctx *ctx); +int tls13_client_certificate_verify_send(struct tls13_ctx *ctx); +int tls13_client_certificate_verify_recv(struct tls13_ctx *ctx); +int tls13_client_finished_recv(struct tls13_ctx *ctx); +int tls13_client_finished_send(struct tls13_ctx *ctx); +int tls13_client_finished_sent(struct tls13_ctx *ctx); +int tls13_client_key_update_send(struct tls13_ctx *ctx); +int tls13_client_key_update_recv(struct tls13_ctx *ctx); +int tls13_server_hello_recv(struct tls13_ctx *ctx); +int tls13_server_hello_send(struct tls13_ctx *ctx); +int tls13_server_hello_retry_recv(struct tls13_ctx *ctx); +int tls13_server_hello_retry_send(struct tls13_ctx *ctx); +int tls13_server_encrypted_extensions_recv(struct tls13_ctx *ctx); +int tls13_server_encrypted_extensions_send(struct tls13_ctx *ctx); +int tls13_server_certificate_recv(struct tls13_ctx *ctx); +int tls13_server_certificate_send(struct tls13_ctx *ctx); +int tls13_server_certificate_request_recv(struct tls13_ctx *ctx); +int tls13_server_certificate_request_send(struct tls13_ctx *ctx); +int tls13_server_certificate_verify_send(struct tls13_ctx *ctx); +int tls13_server_certificate_verify_recv(struct tls13_ctx *ctx); +int tls13_server_finished_recv(struct tls13_ctx *ctx); +int tls13_server_finished_send(struct tls13_ctx *ctx); + +__END_HIDDEN_DECLS + +#endif diff --git a/ssl/tls13_key_schedule.c b/ssl/tls13_key_schedule.c new file mode 100644 index 00000000..8a0b3e8a --- /dev/null +++ b/ssl/tls13_key_schedule.c @@ -0,0 +1,376 @@ +/* $OpenBSD: tls13_key_schedule.c,v 1.7 2018/11/13 01:25:13 beck Exp $ */ +/* Copyright (c) 2018, Bob Beck + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include + +#include "bytestring.h" +#include "tls13_internal.h" + +void +tls13_secrets_destroy(struct tls13_secrets *secrets) +{ + if (secrets == NULL) + return; + + /* you can never be too sure :) */ + freezero(secrets->zeros.data, secrets->zeros.len); + freezero(secrets->empty_hash.data, secrets->empty_hash.len); + + freezero(secrets->extracted_early.data, + secrets->extracted_early.len); + freezero(secrets->binder_key.data, + secrets->binder_key.len); + freezero(secrets->client_early_traffic.data, + secrets->client_early_traffic.len); + freezero(secrets->early_exporter_master.data, + secrets->early_exporter_master.len); + freezero(secrets->derived_early.data, + secrets->derived_early.len); + freezero(secrets->extracted_handshake.data, + secrets->extracted_handshake.len); + freezero(secrets->client_handshake_traffic.data, + secrets->client_handshake_traffic.len); + freezero(secrets->server_handshake_traffic.data, + secrets->server_handshake_traffic.len); + freezero(secrets->derived_handshake.data, + secrets->derived_handshake.len); + freezero(secrets->extracted_master.data, + secrets->extracted_master.len); + freezero(secrets->client_application_traffic.data, + secrets->client_application_traffic.len); + freezero(secrets->server_application_traffic.data, + secrets->server_application_traffic.len); + freezero(secrets->exporter_master.data, + secrets->exporter_master.len); + freezero(secrets->resumption_master.data, + secrets->resumption_master.len); + + freezero(secrets, sizeof(struct tls13_secrets)); +} + +/* + * Allocate a set of secrets for a key schedule using + * a size of hash_length from RFC 8446 section 7.1. + */ +struct tls13_secrets * +tls13_secrets_create(const EVP_MD *digest, int resumption) +{ + struct tls13_secrets *secrets = NULL; + EVP_MD_CTX *mdctx = NULL; + unsigned int mdlen; + size_t hash_length; + + hash_length = EVP_MD_size(digest); + + if ((secrets = calloc(1, sizeof(struct tls13_secrets))) == NULL) + goto err; + + if ((secrets->zeros.data = calloc(hash_length, sizeof(uint8_t))) == + NULL) + goto err; + secrets->zeros.len = hash_length; + + if ((secrets->empty_hash.data = malloc(hash_length)) == NULL) + goto err; + secrets->empty_hash.len = hash_length; + + if ((secrets->extracted_early.data = malloc(hash_length)) == NULL) + goto err; + secrets->extracted_early.len = hash_length; + if ((secrets->binder_key.data = malloc(hash_length)) == NULL) + goto err; + secrets->binder_key.len = hash_length; + if ((secrets->client_early_traffic.data = malloc(hash_length)) == NULL) + goto err; + secrets->client_early_traffic.len = hash_length; + if ((secrets->early_exporter_master.data = malloc(hash_length)) == + NULL) + goto err; + secrets->early_exporter_master.len = hash_length; + if ((secrets->derived_early.data = malloc(hash_length)) == NULL) + goto err; + secrets->derived_early.len = hash_length; + if ((secrets->extracted_handshake.data = malloc(hash_length)) == NULL) + goto err; + secrets->extracted_handshake.len = hash_length; + if ((secrets->client_handshake_traffic.data = malloc(hash_length)) + == NULL) + goto err; + secrets->client_handshake_traffic.len = hash_length; + if ((secrets->server_handshake_traffic.data = malloc(hash_length)) + == NULL) + goto err; + secrets->server_handshake_traffic.len = hash_length; + if ((secrets->derived_handshake.data = malloc(hash_length)) == NULL) + goto err; + secrets->derived_handshake.len = hash_length; + if ((secrets->extracted_master.data = malloc(hash_length)) == NULL) + goto err; + secrets->extracted_master.len = hash_length; + if ((secrets->client_application_traffic.data = malloc(hash_length)) == + NULL) + goto err; + secrets->client_application_traffic.len = hash_length; + if ((secrets->server_application_traffic.data = malloc(hash_length)) == + NULL) + goto err; + secrets->server_application_traffic.len = hash_length; + if ((secrets->exporter_master.data = malloc(hash_length)) == NULL) + goto err; + secrets->exporter_master.len = hash_length; + if ((secrets->resumption_master.data = malloc(hash_length)) == NULL) + goto err; + secrets->resumption_master.len = hash_length; + + /* + * Calculate the hash of a zero-length string - this is needed during + * the "derived" step for key extraction. + */ + if ((mdctx = EVP_MD_CTX_new()) == NULL) + goto err; + if (!EVP_DigestInit_ex(mdctx, digest, NULL)) + goto err; + if (!EVP_DigestUpdate(mdctx, secrets->zeros.data, 0)) + goto err; + if (!EVP_DigestFinal_ex(mdctx, secrets->empty_hash.data, &mdlen)) + goto err; + EVP_MD_CTX_free(mdctx); + mdctx = NULL; + + if (secrets->empty_hash.len != mdlen) + goto err; + + secrets->digest = digest; + secrets->resumption = resumption; + secrets->init_done = 1; + + return secrets; + + err: + tls13_secrets_destroy(secrets); + EVP_MD_CTX_free(mdctx); + + return NULL; +} + +int +tls13_hkdf_expand_label(struct tls13_secret *out, const EVP_MD *digest, + const struct tls13_secret *secret, const char *label, + const struct tls13_secret *context) +{ + const char tls13_plabel[] = "tls13 "; + uint8_t *hkdf_label; + size_t hkdf_label_len; + CBB cbb, child; + int ret; + + if (!CBB_init(&cbb, 256)) + return 0; + if (!CBB_add_u16(&cbb, out->len)) + goto err; + if (!CBB_add_u8_length_prefixed(&cbb, &child)) + goto err; + if (!CBB_add_bytes(&child, tls13_plabel, strlen(tls13_plabel))) + goto err; + if (!CBB_add_bytes(&child, label, strlen(label))) + goto err; + if (!CBB_add_u8_length_prefixed(&cbb, &child)) + goto err; + if (!CBB_add_bytes(&child, context->data, context->len)) + goto err; + if (!CBB_finish(&cbb, &hkdf_label, &hkdf_label_len)) + goto err; + + ret = HKDF_expand(out->data, out->len, digest, secret->data, + secret->len, hkdf_label, hkdf_label_len); + + free(hkdf_label); + return(ret); + err: + CBB_cleanup(&cbb); + return(0); +} + +static int +tls13_derive_secret(struct tls13_secret *out, const EVP_MD *digest, + const struct tls13_secret *secret, const char *label, + const struct tls13_secret *context) +{ + return tls13_hkdf_expand_label(out, digest, secret, label, context); +} + +int +tls13_derive_early_secrets(struct tls13_secrets *secrets, + uint8_t *psk, size_t psk_len, const struct tls13_secret *context) +{ + if (!secrets->init_done || secrets->early_done) + return 0; + + if (!HKDF_extract(secrets->extracted_early.data, + &secrets->extracted_early.len, secrets->digest, psk, psk_len, + secrets->zeros.data, secrets->zeros.len)) + return 0; + + if (secrets->extracted_early.len != secrets->zeros.len) + return 0; + + if (!tls13_derive_secret(&secrets->binder_key, secrets->digest, + &secrets->extracted_early, + secrets->resumption ? "res binder" : "ext binder", + &secrets->empty_hash)) + return 0; + if (!tls13_derive_secret(&secrets->client_early_traffic, + secrets->digest, &secrets->extracted_early, "c e traffic", + context)) + return 0; + if (!tls13_derive_secret(&secrets->early_exporter_master, + secrets->digest, &secrets->extracted_early, "e exp master", + context)) + return 0; + if (!tls13_derive_secret(&secrets->derived_early, + secrets->digest, &secrets->extracted_early, "derived", + &secrets->empty_hash)) + return 0; + + /* RFC 8446 recommends */ + if (!secrets->insecure) + explicit_bzero(secrets->extracted_early.data, + secrets->extracted_early.len); + secrets->early_done = 1; + return 1; +} + +int +tls13_derive_handshake_secrets(struct tls13_secrets *secrets, + const uint8_t *ecdhe, size_t ecdhe_len, + const struct tls13_secret *context) +{ + if (!secrets->init_done || !secrets->early_done || + secrets->handshake_done) + return 0; + + if (!HKDF_extract(secrets->extracted_handshake.data, + &secrets->extracted_handshake.len, secrets->digest, + ecdhe, ecdhe_len, secrets->derived_early.data, + secrets->derived_early.len)) + return 0; + + if (secrets->extracted_handshake.len != secrets->zeros.len) + return 0; + + /* XXX */ + if (!secrets->insecure) + explicit_bzero(secrets->derived_early.data, + secrets->derived_early.len); + + if (!tls13_derive_secret(&secrets->client_handshake_traffic, + secrets->digest, &secrets->extracted_handshake, "c hs traffic", + context)) + return 0; + if (!tls13_derive_secret(&secrets->server_handshake_traffic, + secrets->digest, &secrets->extracted_handshake, "s hs traffic", + context)) + return 0; + if (!tls13_derive_secret(&secrets->derived_handshake, + secrets->digest, &secrets->extracted_handshake, "derived", + &secrets->empty_hash)) + return 0; + + /* RFC 8446 recommends */ + if (!secrets->insecure) + explicit_bzero(secrets->extracted_handshake.data, + secrets->extracted_handshake.len); + + secrets->handshake_done = 1; + + return 1; +} + +int +tls13_derive_application_secrets(struct tls13_secrets *secrets, + const struct tls13_secret *context) +{ + if (!secrets->init_done || !secrets->early_done || + !secrets->handshake_done || secrets->schedule_done) + return 0; + + if (!HKDF_extract(secrets->extracted_master.data, + &secrets->extracted_master.len, secrets->digest, + secrets->zeros.data, secrets->zeros.len, + secrets->derived_handshake.data, secrets->derived_handshake.len)) + return 0; + + if (secrets->extracted_master.len != secrets->zeros.len) + return 0; + + /* XXX */ + if (!secrets->insecure) + explicit_bzero(secrets->derived_handshake.data, + secrets->derived_handshake.len); + + if (!tls13_derive_secret(&secrets->client_application_traffic, + secrets->digest, &secrets->extracted_master, "c ap traffic", + context)) + return 0; + if (!tls13_derive_secret(&secrets->server_application_traffic, + secrets->digest, &secrets->extracted_master, "s ap traffic", + context)) + return 0; + if (!tls13_derive_secret(&secrets->exporter_master, + secrets->digest, &secrets->extracted_master, "exp master", + context)) + return 0; + if (!tls13_derive_secret(&secrets->resumption_master, + secrets->digest, &secrets->extracted_master, "res master", + context)) + return 0; + + /* RFC 8446 recommends */ + if (!secrets->insecure) + explicit_bzero(secrets->extracted_master.data, + secrets->extracted_master.len); + + secrets->schedule_done = 1; + + return 1; +} + +int +tls13_update_client_traffic_secret(struct tls13_secrets *secrets) +{ + if (!secrets->init_done || !secrets->early_done || + !secrets->handshake_done || !secrets->schedule_done) + return 0; + + return tls13_hkdf_expand_label(&secrets->client_application_traffic, + secrets->digest, &secrets->client_application_traffic, + "traffic upd", &secrets->empty_hash); +} + +int +tls13_update_server_traffic_secret(struct tls13_secrets *secrets) +{ + if (!secrets->init_done || !secrets->early_done || + !secrets->handshake_done || !secrets->schedule_done) + return 0; + + return tls13_hkdf_expand_label(&secrets->server_application_traffic, + secrets->digest, &secrets->server_application_traffic, + "traffic upd", &secrets->empty_hash); +} diff --git a/ssl/tls13_lib.c b/ssl/tls13_lib.c new file mode 100644 index 00000000..81325cd8 --- /dev/null +++ b/ssl/tls13_lib.c @@ -0,0 +1,324 @@ +/* $OpenBSD: tls13_lib.c,v 1.11 2019/03/17 15:13:23 jsing Exp $ */ +/* + * Copyright (c) 2018, 2019 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include + +#include "ssl_locl.h" +#include "tls13_internal.h" + +const EVP_AEAD * +tls13_cipher_aead(const SSL_CIPHER *cipher) +{ + if (cipher == NULL) + return NULL; + if (cipher->algorithm_ssl != SSL_TLSV1_3) + return NULL; + + switch (cipher->algorithm_enc) { + case SSL_AES128GCM: + return EVP_aead_aes_128_gcm(); + case SSL_AES256GCM: + return EVP_aead_aes_256_gcm(); + case SSL_CHACHA20POLY1305: + return EVP_aead_chacha20_poly1305(); + } + + return NULL; +} + +const EVP_MD * +tls13_cipher_hash(const SSL_CIPHER *cipher) +{ + if (cipher == NULL) + return NULL; + if (cipher->algorithm_ssl != SSL_TLSV1_3) + return NULL; + + switch (cipher->algorithm2) { + case SSL_HANDSHAKE_MAC_SHA256: + return EVP_sha256(); + case SSL_HANDSHAKE_MAC_SHA384: + return EVP_sha384(); + } + + return NULL; +} + +static void +tls13_alert_received_cb(uint8_t alert_desc, void *arg) +{ + struct tls13_ctx *ctx = arg; + SSL *s = ctx->ssl; + + if (alert_desc == SSL_AD_CLOSE_NOTIFY) { + ctx->ssl->internal->shutdown |= SSL_RECEIVED_SHUTDOWN; + S3I(ctx->ssl)->warn_alert = alert_desc; + return; + } + + if (alert_desc == SSL_AD_USER_CANCELLED) { + /* + * We treat this as advisory, since a close_notify alert + * SHOULD follow this alert (RFC 8446 section 6.1). + */ + return; + } + + /* All other alerts are treated as fatal in TLSv1.3. */ + S3I(ctx->ssl)->fatal_alert = alert_desc; + + SSLerror(ctx->ssl, SSL_AD_REASON_OFFSET + alert_desc); + ERR_asprintf_error_data("SSL alert number %d", alert_desc); + + SSL_CTX_remove_session(s->ctx, s->session); +} + +struct tls13_ctx * +tls13_ctx_new(int mode) +{ + struct tls13_ctx *ctx = NULL; + + if ((ctx = calloc(sizeof(struct tls13_ctx), 1)) == NULL) + goto err; + + ctx->mode = mode; + + if ((ctx->rl = tls13_record_layer_new(tls13_legacy_wire_read_cb, + tls13_legacy_wire_write_cb, tls13_alert_received_cb, NULL, + ctx)) == NULL) + goto err; + + return ctx; + + err: + tls13_ctx_free(ctx); + + return NULL; +} + +void +tls13_ctx_free(struct tls13_ctx *ctx) +{ + if (ctx == NULL) + return; + + tls13_record_layer_free(ctx->rl); + + freezero(ctx, sizeof(struct tls13_ctx)); +} + +static ssize_t +tls13_legacy_wire_read(SSL *ssl, uint8_t *buf, size_t len) +{ + int n; + + if (ssl->rbio == NULL) { + SSLerror(ssl, SSL_R_BIO_NOT_SET); + return TLS13_IO_FAILURE; + } + + ssl->internal->rwstate = SSL_READING; + + if ((n = BIO_read(ssl->rbio, buf, len)) <= 0) { + if (BIO_should_read(ssl->rbio)) + return TLS13_IO_WANT_POLLIN; + if (BIO_should_write(ssl->rbio)) + return TLS13_IO_WANT_POLLOUT; + if (n == 0) + return TLS13_IO_EOF; + + return TLS13_IO_FAILURE; + } + + if (n == len) + ssl->internal->rwstate = SSL_NOTHING; + + return n; +} + +ssize_t +tls13_legacy_wire_read_cb(void *buf, size_t n, void *arg) +{ + struct tls13_ctx *ctx = arg; + + return tls13_legacy_wire_read(ctx->ssl, buf, n); +} + +static ssize_t +tls13_legacy_wire_write(SSL *ssl, const uint8_t *buf, size_t len) +{ + int n; + + if (ssl->wbio == NULL) { + SSLerror(ssl, SSL_R_BIO_NOT_SET); + return TLS13_IO_FAILURE; + } + + ssl->internal->rwstate = SSL_WRITING; + + if ((n = BIO_write(ssl->wbio, buf, len)) <= 0) { + if (BIO_should_read(ssl->wbio)) + return TLS13_IO_WANT_POLLIN; + if (BIO_should_write(ssl->wbio)) + return TLS13_IO_WANT_POLLOUT; + + return TLS13_IO_FAILURE; + } + + if (n == len) + ssl->internal->rwstate = SSL_NOTHING; + + return n; +} + +ssize_t +tls13_legacy_wire_write_cb(const void *buf, size_t n, void *arg) +{ + struct tls13_ctx *ctx = arg; + + return tls13_legacy_wire_write(ctx->ssl, buf, n); +} + +int +tls13_legacy_return_code(SSL *ssl, ssize_t ret) +{ + if (ret > INT_MAX) { + SSLerror(ssl, ERR_R_INTERNAL_ERROR); + return -1; + } + + /* A successful read, write or other operation. */ + if (ret > 0) + return ret; + + ssl->internal->rwstate = SSL_NOTHING; + + switch (ret) { + case TLS13_IO_EOF: + return 0; + + case TLS13_IO_FAILURE: + /* XXX - we need to record/map internal errors. */ + if (ERR_peek_error() == 0) + SSLerror(ssl, ERR_R_INTERNAL_ERROR); + return -1; + + case TLS13_IO_WANT_POLLIN: + BIO_set_retry_read(ssl->rbio); + ssl->internal->rwstate = SSL_READING; + return -1; + + case TLS13_IO_WANT_POLLOUT: + BIO_set_retry_write(ssl->wbio); + ssl->internal->rwstate = SSL_WRITING; + return -1; + } + + SSLerror(ssl, ERR_R_INTERNAL_ERROR); + return -1; +} + +int +tls13_legacy_read_bytes(SSL *ssl, int type, unsigned char *buf, int len, int peek) +{ + struct tls13_ctx *ctx = ssl->internal->tls13; + ssize_t ret; + + if (ctx == NULL || !ctx->handshake_completed) { + if ((ret = ssl->internal->handshake_func(ssl)) <= 0) + return ret; + return tls13_legacy_return_code(ssl, TLS13_IO_WANT_POLLIN); + } + + if (peek) { + /* XXX - support peek... */ + SSLerror(ssl, ERR_R_INTERNAL_ERROR); + return -1; + } + + if (type != SSL3_RT_APPLICATION_DATA) { + SSLerror(ssl, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return -1; + } + if (len < 0) { + SSLerror(ssl, SSL_R_BAD_LENGTH); + return -1; + } + + ret = tls13_read_application_data(ctx->rl, buf, len); + return tls13_legacy_return_code(ssl, ret); +} + +int +tls13_legacy_write_bytes(SSL *ssl, int type, const void *vbuf, int len) +{ + struct tls13_ctx *ctx = ssl->internal->tls13; + const uint8_t *buf = vbuf; + size_t n, sent; + ssize_t ret; + + if (ctx == NULL || !ctx->handshake_completed) { + if ((ret = ssl->internal->handshake_func(ssl)) <= 0) + return ret; + return tls13_legacy_return_code(ssl, TLS13_IO_WANT_POLLOUT); + } + + if (type != SSL3_RT_APPLICATION_DATA) { + SSLerror(ssl, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return -1; + } + if (len <= 0) { + SSLerror(ssl, SSL_R_BAD_LENGTH); + return -1; + } + + /* + * The TLSv1.3 record layer write behaviour is the same as + * SSL_MODE_ENABLE_PARTIAL_WRITE. + */ + if (ssl->internal->mode & SSL_MODE_ENABLE_PARTIAL_WRITE) { + ret = tls13_write_application_data(ctx->rl, buf, len); + return tls13_legacy_return_code(ssl, ret); + } + + /* + * In the non-SSL_MODE_ENABLE_PARTIAL_WRITE case we have to loop until + * we have written out all of the requested data. + */ + sent = S3I(ssl)->wnum; + if (len < sent) { + SSLerror(ssl, SSL_R_BAD_LENGTH); + return -1; + } + n = len - sent; + for (;;) { + if (n == 0) { + S3I(ssl)->wnum = 0; + return sent; + } + if ((ret = tls13_write_application_data(ctx->rl, + &buf[sent], n)) <= 0) { + S3I(ssl)->wnum = sent; + return tls13_legacy_return_code(ssl, ret); + } + sent += ret; + n -= ret; + } +} diff --git a/ssl/tls13_record.c b/ssl/tls13_record.c new file mode 100644 index 00000000..e0631dff --- /dev/null +++ b/ssl/tls13_record.c @@ -0,0 +1,188 @@ +/* $OpenBSD: tls13_record.c,v 1.3 2019/01/21 00:24:19 jsing Exp $ */ +/* + * Copyright (c) 2018, 2019 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "ssl_locl.h" + +#include + +#include "tls13_internal.h" +#include "tls13_record.h" + +struct tls13_record { + uint16_t version; + uint8_t content_type; + size_t rec_len; + uint8_t *data; + size_t data_len; + CBS cbs; + + struct tls13_buffer *buf; +}; + +struct tls13_record * +tls13_record_new(void) +{ + struct tls13_record *rec = NULL; + + if ((rec = calloc(1, sizeof(struct tls13_record))) == NULL) + goto err; + if ((rec->buf = tls13_buffer_new(TLS13_RECORD_MAX_LEN)) == NULL) + goto err; + + return rec; + + err: + tls13_record_free(rec); + + return NULL; +} + +void +tls13_record_free(struct tls13_record *rec) +{ + if (rec == NULL) + return; + + tls13_buffer_free(rec->buf); + + freezero(rec->data, rec->data_len); + freezero(rec, sizeof(struct tls13_record)); +} + +uint16_t +tls13_record_version(struct tls13_record *rec) +{ + return rec->version; +} + +uint8_t +tls13_record_content_type(struct tls13_record *rec) +{ + return rec->content_type; +} + +int +tls13_record_header(struct tls13_record *rec, CBS *cbs) +{ + if (rec->data_len < TLS13_RECORD_HEADER_LEN) + return 0; + + CBS_init(cbs, rec->data, TLS13_RECORD_HEADER_LEN); + + return 1; +} + +int +tls13_record_content(struct tls13_record *rec, CBS *cbs) +{ + CBS content; + + tls13_record_data(rec, &content); + + if (!CBS_skip(&content, TLS13_RECORD_HEADER_LEN)) + return 0; + + CBS_dup(&content, cbs); + + return 1; +} + +void +tls13_record_data(struct tls13_record *rec, CBS *cbs) +{ + CBS_init(cbs, rec->data, rec->data_len); +} + +int +tls13_record_set_data(struct tls13_record *rec, uint8_t *data, size_t data_len) +{ + if (data_len > TLS13_RECORD_MAX_LEN) + return 0; + + freezero(rec->data, rec->data_len); + rec->data = data; + rec->data_len = data_len; + CBS_init(&rec->cbs, rec->data, rec->data_len); + + return 1; +} + +ssize_t +tls13_record_recv(struct tls13_record *rec, tls13_read_cb wire_read, + void *wire_arg) +{ + uint16_t rec_len, rec_version; + uint8_t content_type; + ssize_t ret; + CBS cbs; + + if (rec->data != NULL) + return TLS13_IO_FAILURE; + + if (rec->content_type == 0) { + if ((ret = tls13_buffer_extend(rec->buf, + TLS13_RECORD_HEADER_LEN, wire_read, wire_arg)) <= 0) + return ret; + + tls13_buffer_cbs(rec->buf, &cbs); + + if (!CBS_get_u8(&cbs, &content_type)) + return TLS13_IO_FAILURE; + if (!CBS_get_u16(&cbs, &rec_version)) + return TLS13_IO_FAILURE; + if (!CBS_get_u16(&cbs, &rec_len)) + return TLS13_IO_FAILURE; + + /* XXX - record overflow alert. */ + if (rec_len > TLS13_RECORD_MAX_CIPHERTEXT_LEN) + return TLS13_IO_FAILURE; + + rec->content_type = content_type; + rec->version = rec_version; + rec->rec_len = rec_len; + } + + if ((ret = tls13_buffer_extend(rec->buf, + TLS13_RECORD_HEADER_LEN + rec->rec_len, wire_read, wire_arg)) <= 0) + return ret; + + if (!tls13_buffer_finish(rec->buf, &rec->data, &rec->data_len)) + return TLS13_IO_FAILURE; + + return rec->data_len; +} + +ssize_t +tls13_record_send(struct tls13_record *rec, tls13_write_cb wire_write, + void *wire_arg) +{ + ssize_t ret; + + if (rec->data == NULL) + return TLS13_IO_FAILURE; + + while (CBS_len(&rec->cbs) > 0) { + if ((ret = wire_write(CBS_data(&rec->cbs), + CBS_len(&rec->cbs), wire_arg)) <= 0) + return ret; + + if (!CBS_skip(&rec->cbs, ret)) + return TLS13_IO_FAILURE; + } + + return rec->data_len; +} diff --git a/ssl/tls13_record.h b/ssl/tls13_record.h new file mode 100644 index 00000000..400153ba --- /dev/null +++ b/ssl/tls13_record.h @@ -0,0 +1,67 @@ +/* $OpenBSD: tls13_record.h,v 1.3 2019/01/21 00:24:19 jsing Exp $ */ +/* + * Copyright (c) 2019 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_TLS13_RECORD_H +#define HEADER_TLS13_RECORD_H + +#include "bytestring.h" +#include "tls13_internal.h" + +__BEGIN_HIDDEN_DECLS + +/* + * TLSv1.3 Record Protocol - RFC 8446 section 5. + * + * The maximum plaintext is 2^14, however for inner plaintext an additional + * byte is allowed for the content type. A maximum AEAD overhead of 255-bytes + * is permitted, along with a 5-byte header, giving a maximum size of + * 5 + 2^14 + 1 + 255 = 16,645-bytes. + */ +#define TLS13_RECORD_HEADER_LEN 5 +#define TLS13_RECORD_MAX_AEAD_OVERHEAD 255 +#define TLS13_RECORD_MAX_PLAINTEXT_LEN 16384 +#define TLS13_RECORD_MAX_INNER_PLAINTEXT_LEN \ + (TLS13_RECORD_MAX_PLAINTEXT_LEN + 1) +#define TLS13_RECORD_MAX_CIPHERTEXT_LEN \ + (TLS13_RECORD_MAX_INNER_PLAINTEXT_LEN + TLS13_RECORD_MAX_AEAD_OVERHEAD) +#define TLS13_RECORD_MAX_LEN \ + (TLS13_RECORD_HEADER_LEN + TLS13_RECORD_MAX_CIPHERTEXT_LEN) + +/* + * TLSv1.3 Per-Record Nonces and Sequence Numbers - RFC 8446 section 5.3. + */ +#define TLS13_RECORD_SEQ_NUM_LEN 8 + +struct tls13_record; + +struct tls13_record *tls13_record_new(void); +void tls13_record_free(struct tls13_record *_rec); +uint16_t tls13_record_version(struct tls13_record *_rec); +uint8_t tls13_record_content_type(struct tls13_record *_rec); +int tls13_record_header(struct tls13_record *_rec, CBS *_cbs); +int tls13_record_content(struct tls13_record *_rec, CBS *_cbs); +void tls13_record_data(struct tls13_record *_rec, CBS *_cbs); +int tls13_record_set_data(struct tls13_record *_rec, uint8_t *_data, + size_t _data_len); +ssize_t tls13_record_recv(struct tls13_record *_rec, tls13_read_cb _wire_read, + void *_wire_arg); +ssize_t tls13_record_send(struct tls13_record *_rec, tls13_write_cb _wire_write, + void *_wire_arg); + +__END_HIDDEN_DECLS + +#endif diff --git a/ssl/tls13_record_layer.c b/ssl/tls13_record_layer.c new file mode 100644 index 00000000..66e201fc --- /dev/null +++ b/ssl/tls13_record_layer.c @@ -0,0 +1,799 @@ +/* $OpenBSD: tls13_record_layer.c,v 1.9 2019/03/17 15:13:23 jsing Exp $ */ +/* + * Copyright (c) 2018, 2019 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "ssl_locl.h" + +#include + +#include "tls13_internal.h" +#include "tls13_record.h" + +struct tls13_record_layer { + int change_cipher_spec_seen; + int handshake_completed; + + /* + * Read and/or write channels are closed due to an alert being + * sent or received. In the case of an error alert both channels + * are closed, whereas in the case of a close notify only one + * channel is closed. + */ + int read_closed; + int write_closed; + + struct tls13_record *rrec; + struct tls13_record *wrec; + + /* Buffer containing plaintext from opened records. */ + uint8_t rbuf_content_type; + uint8_t *rbuf; + size_t rbuf_len; + CBS rbuf_cbs; + + /* Record protection. */ + const EVP_MD *hash; + const EVP_AEAD *aead; + EVP_AEAD_CTX read_aead_ctx; + EVP_AEAD_CTX write_aead_ctx; + struct tls13_secret read_iv; + struct tls13_secret write_iv; + struct tls13_secret read_nonce; + struct tls13_secret write_nonce; + uint8_t read_seq_num[TLS13_RECORD_SEQ_NUM_LEN]; + uint8_t write_seq_num[TLS13_RECORD_SEQ_NUM_LEN]; + + /* Record callbacks. */ + tls13_alert_cb alert_cb; + tls13_post_handshake_cb post_handshake_cb; + + /* Wire read/write callbacks. */ + tls13_read_cb wire_read; + tls13_write_cb wire_write; + void *cb_arg; +}; + +static void +tls13_record_layer_rbuf_free(struct tls13_record_layer *rl) +{ + CBS_init(&rl->rbuf_cbs, NULL, 0); + freezero(rl->rbuf, rl->rbuf_len); + rl->rbuf = NULL; + rl->rbuf_len = 0; + rl->rbuf_content_type = 0; +} + +static void +tls13_record_layer_rrec_free(struct tls13_record_layer *rl) +{ + tls13_record_free(rl->rrec); + rl->rrec = NULL; +} + +static void +tls13_record_layer_wrec_free(struct tls13_record_layer *rl) +{ + tls13_record_free(rl->wrec); + rl->wrec = NULL; +} + +struct tls13_record_layer * +tls13_record_layer_new(tls13_read_cb wire_read, tls13_write_cb wire_write, + tls13_alert_cb alert_cb, tls13_post_handshake_cb post_handshake_cb, + void *cb_arg) +{ + struct tls13_record_layer *rl; + + if ((rl = calloc(1, sizeof(struct tls13_record_layer))) == NULL) + return NULL; + + rl->wire_read = wire_read; + rl->wire_write = wire_write; + rl->alert_cb = alert_cb; + rl->post_handshake_cb = post_handshake_cb; + rl->cb_arg = cb_arg; + + return rl; +} + +void +tls13_record_layer_free(struct tls13_record_layer *rl) +{ + if (rl == NULL) + return; + + tls13_record_layer_rbuf_free(rl); + + tls13_record_layer_rrec_free(rl); + tls13_record_layer_wrec_free(rl); + + EVP_AEAD_CTX_cleanup(&rl->read_aead_ctx); + EVP_AEAD_CTX_cleanup(&rl->write_aead_ctx); + + freezero(rl->read_iv.data, rl->read_iv.len); + freezero(rl->write_iv.data, rl->write_iv.len); + freezero(rl->read_nonce.data, rl->read_nonce.len); + freezero(rl->write_nonce.data, rl->write_nonce.len); + + freezero(rl, sizeof(struct tls13_record_layer)); +} + +static int +tls13_record_layer_inc_seq_num(uint8_t *seq_num) +{ + size_t i; + + for (i = TLS13_RECORD_SEQ_NUM_LEN - 1; i > 0; i--) { + if (++seq_num[i] != 0) + break; + } + + /* RFC 8446 section 5.3 - sequence numbers must not wrap. */ + return (i != 0 || seq_num[0] != 0); +} + +static int +tls13_record_layer_update_nonce(struct tls13_secret *nonce, + struct tls13_secret *iv, uint8_t *seq_num) +{ + ssize_t i, j; + + if (nonce->len != iv->len) + return 0; + + /* + * RFC 8446 section 5.3 - sequence number is zero padded and XOR'd + * with the IV to produce a per-record nonce. The IV will also be + * at least 8-bytes in length. + */ + for (i = nonce->len - 1, j = TLS13_RECORD_SEQ_NUM_LEN - 1; i >= 0; i--, j--) + nonce->data[i] = iv->data[i] ^ (j >= 0 ? seq_num[j] : 0); + + return 1; +} + +void +tls13_record_layer_set_aead(struct tls13_record_layer *rl, + const EVP_AEAD *aead) +{ + rl->aead = aead; +} + +void +tls13_record_layer_set_hash(struct tls13_record_layer *rl, + const EVP_MD *hash) +{ + rl->hash = hash; +} + +void +tls13_record_layer_handshake_completed(struct tls13_record_layer *rl) +{ + rl->handshake_completed = 1; +} + +static ssize_t +tls13_record_layer_process_alert(struct tls13_record_layer *rl) +{ + uint8_t alert_level, alert_desc; + ssize_t ret = TLS13_IO_FAILURE; + + /* + * RFC 8446 - sections 5.1 and 6. + * + * A TLSv1.3 alert record can only contain a single alert - this means + * that processing the alert must consume all of the record. The alert + * will result in one of three things - continuation (user_cancelled), + * read channel closure (close_notify) or termination (all others). + */ + if (rl->rbuf == NULL) + goto err; + if (rl->rbuf_content_type != SSL3_RT_ALERT) + goto err; + + if (!CBS_get_u8(&rl->rbuf_cbs, &alert_level)) + goto err; /* XXX - decode error alert. */ + if (!CBS_get_u8(&rl->rbuf_cbs, &alert_desc)) + goto err; /* XXX - decode error alert. */ + + if (CBS_len(&rl->rbuf_cbs) != 0) + goto err; /* XXX - decode error alert. */ + + tls13_record_layer_rbuf_free(rl); + + /* + * Alert level is ignored for closure alerts (RFC 8446 section 6.1), + * however for error alerts (RFC 8446 section 6.2), the alert level + * must be specified as fatal. + */ + if (alert_desc == SSL_AD_CLOSE_NOTIFY) { + rl->read_closed = 1; + ret = TLS13_IO_EOF; + } else if (alert_desc == SSL_AD_USER_CANCELLED) { + /* Ignored at the record layer. */ + ret = TLS13_IO_WANT_POLLIN; + } else if (alert_level == SSL3_AL_FATAL) { + rl->read_closed = 1; + rl->write_closed = 1; + ret = TLS13_IO_EOF; + } else { + /* XXX - decode error alert. */ + return TLS13_IO_FAILURE; + } + + rl->alert_cb(alert_desc, rl->cb_arg); + + err: + return ret; +} + +int +tls13_record_layer_send_alert(struct tls13_record_layer *rl, + uint8_t alert_level, uint8_t alert_desc) +{ + /* XXX - implement. */ + return -1; +} + +static int +tls13_record_layer_set_traffic_key(const EVP_AEAD *aead, EVP_AEAD_CTX *aead_ctx, + const EVP_MD *hash, struct tls13_secret *iv, struct tls13_secret *nonce, + struct tls13_secret *traffic_key) +{ + struct tls13_secret context = { .data = "", .len = 0 }; + struct tls13_secret key = { .data = NULL, .len = 0 }; + int ret = 0; + + freezero(iv->data, iv->len); + iv->data = NULL; + iv->len = 0; + + freezero(nonce->data, nonce->len); + nonce->data = NULL; + nonce->len = 0; + + if ((iv->data = calloc(1, EVP_AEAD_nonce_length(aead))) == NULL) + goto err; + iv->len = EVP_AEAD_nonce_length(aead); + + if ((nonce->data = calloc(1, EVP_AEAD_nonce_length(aead))) == NULL) + goto err; + nonce->len = EVP_AEAD_nonce_length(aead); + + if ((key.data = calloc(1, EVP_AEAD_key_length(aead))) == NULL) + goto err; + key.len = EVP_AEAD_key_length(aead); + + if (!tls13_hkdf_expand_label(iv, hash, traffic_key, "iv", &context)) + goto err; + if (!tls13_hkdf_expand_label(&key, hash, traffic_key, "key", &context)) + goto err; + + if (!EVP_AEAD_CTX_init(aead_ctx, aead, key.data, key.len, + EVP_AEAD_DEFAULT_TAG_LENGTH, NULL)) + goto err; + + ret = 1; + + err: + freezero(key.data, key.len); + + return ret; +} + +int +tls13_record_layer_set_read_traffic_key(struct tls13_record_layer *rl, + struct tls13_secret *read_key) +{ + memset(rl->read_seq_num, 0, TLS13_RECORD_SEQ_NUM_LEN); + + return tls13_record_layer_set_traffic_key(rl->aead, &rl->read_aead_ctx, + rl->hash, &rl->read_iv, &rl->read_nonce, read_key); +} + +int +tls13_record_layer_set_write_traffic_key(struct tls13_record_layer *rl, + struct tls13_secret *write_key) +{ + memset(rl->write_seq_num, 0, TLS13_RECORD_SEQ_NUM_LEN); + + return tls13_record_layer_set_traffic_key(rl->aead, &rl->write_aead_ctx, + rl->hash, &rl->write_iv, &rl->write_nonce, write_key); +} + +static int +tls13_record_layer_open_record_plaintext(struct tls13_record_layer *rl) +{ + CBS cbs; + + if (rl->aead != NULL) + return 0; + + /* + * We're still operating in plaintext mode, so just copy the + * content from the record to the plaintext buffer. + */ + if (!tls13_record_content(rl->rrec, &cbs)) + return 0; + + tls13_record_layer_rbuf_free(rl); + + if (!CBS_stow(&cbs, &rl->rbuf, &rl->rbuf_len)) + return 0; + + rl->rbuf_content_type = tls13_record_content_type(rl->rrec); + + CBS_init(&rl->rbuf_cbs, rl->rbuf, rl->rbuf_len); + + return 1; +} + +static int +tls13_record_layer_open_record_protected(struct tls13_record_layer *rl) +{ + CBS header, enc_record; + uint8_t *content = NULL; + ssize_t content_len = 0; + uint8_t content_type; + size_t out_len; + + if (rl->aead == NULL) + goto err; + + if (!tls13_record_header(rl->rrec, &header)) + goto err; + if (!tls13_record_content(rl->rrec, &enc_record)) + goto err; + + if ((content = calloc(1, CBS_len(&enc_record))) == NULL) + goto err; + content_len = CBS_len(&enc_record); + + if (!tls13_record_layer_update_nonce(&rl->read_nonce, &rl->read_iv, + rl->read_seq_num)) + goto err; + + if (!EVP_AEAD_CTX_open(&rl->read_aead_ctx, + content, &out_len, content_len, + rl->read_nonce.data, rl->read_nonce.len, + CBS_data(&enc_record), CBS_len(&enc_record), + CBS_data(&header), CBS_len(&header))) + goto err; + + if (!tls13_record_layer_inc_seq_num(rl->read_seq_num)) + goto err; + + /* + * The real content type is hidden at the end of the record content and + * it may be followed by padding that consists of one or more zeroes. + * Time to hunt for that elusive content type! + */ + /* XXX - CBS from end? CBS_get_end_u8()? */ + content_len = out_len - 1; + while (content_len >= 0 && content[content_len] == 0) + content_len--; + if (content_len < 0) + goto err; + content_type = content[content_len]; + + tls13_record_layer_rbuf_free(rl); + + rl->rbuf_content_type = content_type; + rl->rbuf = content; + rl->rbuf_len = content_len; + + CBS_init(&rl->rbuf_cbs, rl->rbuf, rl->rbuf_len); + + return 1; + + err: + freezero(content, content_len); + + return 0; +} + +static int +tls13_record_layer_open_record(struct tls13_record_layer *rl) +{ + if (rl->aead == NULL) + return tls13_record_layer_open_record_plaintext(rl); + + return tls13_record_layer_open_record_protected(rl); +} + +static int +tls13_record_layer_seal_record_plaintext(struct tls13_record_layer *rl, + uint8_t content_type, const uint8_t *content, size_t content_len) +{ + uint8_t *data = NULL; + size_t data_len = 0; + uint16_t version; + CBB cbb, body; + + if (rl->aead != NULL) + return 0; + + /* XXX - TLS1_VERSION for first client hello... */ + version = TLS1_2_VERSION; + + /* + * We're still operating in plaintext mode, so just copy the + * content into the record. + */ + if (!CBB_init(&cbb, TLS13_RECORD_HEADER_LEN + content_len)) + goto err; + + if (!CBB_add_u8(&cbb, content_type)) + goto err; + if (!CBB_add_u16(&cbb, version)) + goto err; + if (!CBB_add_u16_length_prefixed(&cbb, &body)) + goto err; + if (!CBB_add_bytes(&body, content, content_len)) + goto err; + + if (!CBB_finish(&cbb, &data, &data_len)) + goto err; + + if (!tls13_record_set_data(rl->wrec, data, data_len)) + goto err; + + return 1; + + err: + CBB_cleanup(&cbb); + freezero(data, data_len); + + return 0; +} + +static int +tls13_record_layer_seal_record_protected(struct tls13_record_layer *rl, + uint8_t content_type, const uint8_t *content, size_t content_len) +{ + uint8_t *data = NULL, *header = NULL, *inner = NULL; + size_t data_len = 0, header_len = 0, inner_len = 0; + uint8_t *enc_record; + size_t enc_record_len; + ssize_t ret = 0; + size_t out_len; + CBB cbb; + + if (rl->aead == NULL) + return 0; + + memset(&cbb, 0, sizeof(cbb)); + + /* Build inner plaintext. */ + if (!CBB_init(&cbb, content_len + 1)) + goto err; + if (!CBB_add_bytes(&cbb, content, content_len)) + goto err; + if (!CBB_add_u8(&cbb, content_type)) + goto err; + /* XXX - padding? */ + if (!CBB_finish(&cbb, &inner, &inner_len)) + goto err; + + if (inner_len > TLS13_RECORD_MAX_INNER_PLAINTEXT_LEN) + goto err; + + /* XXX EVP_AEAD_max_tag_len vs EVP_AEAD_CTX_tag_len. */ + enc_record_len = inner_len + EVP_AEAD_max_tag_len(rl->aead); + if (enc_record_len > TLS13_RECORD_MAX_CIPHERTEXT_LEN) + goto err; + + /* Build the record header. */ + if (!CBB_init(&cbb, TLS13_RECORD_HEADER_LEN)) + goto err; + if (!CBB_add_u8(&cbb, SSL3_RT_APPLICATION_DATA)) + goto err; + if (!CBB_add_u16(&cbb, TLS1_2_VERSION)) + goto err; + if (!CBB_add_u16(&cbb, enc_record_len)) + goto err; + if (!CBB_finish(&cbb, &header, &header_len)) + goto err; + + /* Build the actual record. */ + if (!CBB_init(&cbb, TLS13_RECORD_HEADER_LEN + enc_record_len)) + goto err; + if (!CBB_add_bytes(&cbb, header, header_len)) + goto err; + if (!CBB_add_space(&cbb, &enc_record, enc_record_len)) + goto err; + if (!CBB_finish(&cbb, &data, &data_len)) + goto err; + + if (!tls13_record_layer_update_nonce(&rl->write_nonce, + &rl->write_iv, rl->write_seq_num)) + goto err; + + /* + * XXX - consider a EVP_AEAD_CTX_seal_iov() that takes an iovec... + * this would avoid a copy since the inner would be passed as two + * separate pieces. + */ + if (!EVP_AEAD_CTX_seal(&rl->write_aead_ctx, + enc_record, &out_len, enc_record_len, + rl->write_nonce.data, rl->write_nonce.len, + inner, inner_len, header, header_len)) + goto err; + + if (out_len != enc_record_len) + goto err; + + if (!tls13_record_layer_inc_seq_num(rl->write_seq_num)) + goto err; + + if (!tls13_record_set_data(rl->wrec, data, data_len)) + goto err; + + data = NULL; + data_len = 0; + + ret = 1; + + err: + CBB_cleanup(&cbb); + + freezero(data, data_len); + freezero(header, header_len); + freezero(inner, inner_len); + + return ret; +} + +static int +tls13_record_layer_seal_record(struct tls13_record_layer *rl, + uint8_t content_type, const uint8_t *content, size_t content_len) +{ + tls13_record_layer_wrec_free(rl); + + if ((rl->wrec = tls13_record_new()) == NULL) + return 0; + + if (rl->aead == NULL) + return tls13_record_layer_seal_record_plaintext(rl, + content_type, content, content_len); + + return tls13_record_layer_seal_record_protected(rl, content_type, + content, content_len); +} + +static ssize_t +tls13_record_layer_read_record(struct tls13_record_layer *rl) +{ + uint8_t content_type, ccs; + ssize_t ret; + CBS cbs; + + if (rl->rrec == NULL) { + if ((rl->rrec = tls13_record_new()) == NULL) + goto err; + } + + if ((ret = tls13_record_recv(rl->rrec, rl->wire_read, rl->cb_arg)) <= 0) + return ret; + + /* XXX - record version checks. */ + + content_type = tls13_record_content_type(rl->rrec); + + /* + * Bag of hacks ahead... after the first ClientHello message has been + * sent or received and before the peer's Finished message has been + * received, we may receive an unencrypted ChangeCipherSpec record + * (see RFC 8446 section 5 and appendix D.4). This record must be + * ignored. + */ + if (content_type == SSL3_RT_CHANGE_CIPHER_SPEC) { + /* XXX - need to check after ClientHello, before Finished. */ + if (rl->handshake_completed || rl->change_cipher_spec_seen) { + /* XXX - unexpected message alert. */ + goto err; + } + if (!tls13_record_content(rl->rrec, &cbs)) { + /* XXX - decode error alert. */ + goto err; + } + if (!CBS_get_u8(&cbs, &ccs)) { + /* XXX - decode error alert. */ + goto err; + } + if (ccs != 1) { + /* XXX - something alert. */ + goto err; + } + rl->change_cipher_spec_seen = 1; + tls13_record_layer_rrec_free(rl); + return TLS13_IO_WANT_POLLIN; + } + + /* + * Once record protection is engaged, we should only receive + * protected application data messages (aside from the + * dummy ChangeCipherSpec messages, handled above). + */ + if (rl->aead != NULL && content_type != SSL3_RT_APPLICATION_DATA) { + /* XXX - unexpected message alert. */ + goto err; + } + + if (!tls13_record_layer_open_record(rl)) + goto err; + + tls13_record_layer_rrec_free(rl); + + switch (rl->rbuf_content_type) { + case SSL3_RT_ALERT: + return tls13_record_layer_process_alert(rl); + + case SSL3_RT_HANDSHAKE: + break; + + case SSL3_RT_APPLICATION_DATA: + if (!rl->handshake_completed) { + /* XXX - unexpected message alert. */ + goto err; + } + break; + + default: + /* XXX - unexpected message alert. */ + goto err; + } + + return TLS13_IO_SUCCESS; + + err: + return TLS13_IO_FAILURE; +} + +ssize_t +tls13_record_layer_read(struct tls13_record_layer *rl, uint8_t content_type, + uint8_t *buf, size_t n) +{ + ssize_t ret; + + if (rl->read_closed) + return TLS13_IO_EOF; + + /* XXX - loop here with record and byte limits. */ + /* XXX - send alert... */ + + /* If necessary, pull up the next record. */ + if (CBS_len(&rl->rbuf_cbs) == 0) { + if ((ret = tls13_record_layer_read_record(rl)) <= 0) + return ret; + + /* XXX - need to check record version. */ + } + if (rl->rbuf_content_type != content_type) { + /* + * Handshake content can appear as post-handshake messages (yup, + * the RFC reused the same content type...), which means we can + * be trying to read application data and need to handle a + * post-handshake handshake message instead... + */ + if (rl->rbuf_content_type == SSL3_RT_HANDSHAKE) { + if (rl->handshake_completed) { + /* XXX - call callback, drop for now... */ + tls13_record_layer_rbuf_free(rl); + return TLS13_IO_WANT_POLLIN; + } + } + + /* XXX - unexpected message alert. */ + goto err; + } + + if (n > CBS_len(&rl->rbuf_cbs)) + n = CBS_len(&rl->rbuf_cbs); + + /* XXX - CBS_memcpy? CBS_copy_bytes? */ + memcpy(buf, CBS_data(&rl->rbuf_cbs), n); + if (!CBS_skip(&rl->rbuf_cbs, n)) + goto err; + + if (CBS_len(&rl->rbuf_cbs) == 0) + tls13_record_layer_rbuf_free(rl); + + return n; + + err: + return TLS13_IO_FAILURE; +} + +static ssize_t +tls13_record_layer_write_record(struct tls13_record_layer *rl, + uint8_t content_type, const uint8_t *content, size_t content_len) +{ + ssize_t ret; + + if (rl->write_closed) + return TLS13_IO_EOF; + + /* See if there is an existing record and attempt to push it out... */ + if (rl->wrec != NULL) { + if ((ret = tls13_record_send(rl->wrec, rl->wire_write, + rl->cb_arg)) <= 0) + return ret; + + tls13_record_layer_wrec_free(rl); + + /* XXX - could be pushing out different data... */ + return content_len; + } + + if (content_len > TLS13_RECORD_MAX_PLAINTEXT_LEN) + goto err; + + if (!tls13_record_layer_seal_record(rl, content_type, content, content_len)) + goto err; + + if ((ret = tls13_record_send(rl->wrec, rl->wire_write, rl->cb_arg)) <= 0) + return ret; + + tls13_record_layer_wrec_free(rl); + + return content_len; + + err: + return TLS13_IO_FAILURE; +} + +static ssize_t +tls13_record_layer_write(struct tls13_record_layer *rl, uint8_t content_type, + const uint8_t *buf, size_t n) +{ + if (n > TLS13_RECORD_MAX_PLAINTEXT_LEN) + n = TLS13_RECORD_MAX_PLAINTEXT_LEN; + + return tls13_record_layer_write_record(rl, content_type, buf, n); +} + +ssize_t +tls13_read_handshake_data(struct tls13_record_layer *rl, uint8_t *buf, size_t n) +{ + return tls13_record_layer_read(rl, SSL3_RT_HANDSHAKE, buf, n); +} + +ssize_t +tls13_write_handshake_data(struct tls13_record_layer *rl, const uint8_t *buf, + size_t n) +{ + return tls13_record_layer_write(rl, SSL3_RT_HANDSHAKE, buf, n); +} + +ssize_t +tls13_read_application_data(struct tls13_record_layer *rl, uint8_t *buf, size_t n) +{ + if (!rl->handshake_completed) + return TLS13_IO_FAILURE; + + return tls13_record_layer_read(rl, SSL3_RT_APPLICATION_DATA, buf, n); +} + +ssize_t +tls13_write_application_data(struct tls13_record_layer *rl, const uint8_t *buf, + size_t n) +{ + if (!rl->handshake_completed) + return TLS13_IO_FAILURE; + + return tls13_record_layer_write(rl, SSL3_RT_APPLICATION_DATA, buf, n); +} diff --git a/tap-driver.sh b/tap-driver.sh index 82efa96c..2516e9c3 100644 --- a/tap-driver.sh +++ b/tap-driver.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2011-2017 Free Software Foundation, Inc. +# Copyright (C) 2011-2018 Free Software Foundation, Inc. # # 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 @@ -12,7 +12,7 @@ # 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 . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -132,7 +132,7 @@ fi # last `echo $?' statement), and would thus die reporting an internal # error. # For more information, see the Autoconf manual and the threads: - # + # # trap : 1 3 2 13 15 if test $merge -gt 0; then @@ -643,7 +643,7 @@ test $? -eq 0 || fatal "I/O or internal error" # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/test-driver b/test-driver index 0218a01f..b8521a48 100644 --- a/test-driver +++ b/test-driver @@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2017 Free Software Foundation, Inc. +# Copyright (C) 2011-2018 Free Software Foundation, Inc. # # 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 @@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC # 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 . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -140,7 +140,7 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9341969d..25e23522 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,242 +1,285 @@ include_directories( . - ../include - ../include/compat ../crypto/modes ../crypto/asn1 ../ssl + ../tls ../apps/openssl ../apps/openssl/compat + ../include/compat ) add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/../apps/openssl/cert.pem\") -foreach(lib IN LISTS OPENSSL_LIBS) - if(${lib} STREQUAL "tls-shared") - set(TESTS_LIBS ${TESTS_LIBS} tls) - elseif(${lib} STREQUAL "ssl-shared") - set(TESTS_LIBS ${TESTS_LIBS} ssl) - elseif(${lib} STREQUAL "crypto-shared") - set(TESTS_LIBS ${TESTS_LIBS} crypto) - else() - set(TESTS_LIBS ${TESTS_LIBS} ${lib}) - endif() -endforeach() +file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} TEST_SOURCE_DIR) # aeadtest add_executable(aeadtest aeadtest.c) -target_link_libraries(aeadtest ${TESTS_LIBS}) +target_link_libraries(aeadtest ${OPENSSL_LIBS}) add_test(aeadtest aeadtest ${CMAKE_CURRENT_SOURCE_DIR}/aeadtests.txt) # aes_wrap add_executable(aes_wrap aes_wrap.c) -target_link_libraries(aes_wrap ${TESTS_LIBS}) +target_link_libraries(aes_wrap ${OPENSSL_LIBS}) add_test(aes_wrap aes_wrap) # arc4randomforktest # Windows/mingw does not have fork, but Cygwin does. -if(NOT CMAKE_HOST_WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES "MINGW") +if(NOT (WIN32 OR (CMAKE_SYSTEM_NAME MATCHES "MINGW"))) add_executable(arc4randomforktest arc4randomforktest.c) - target_link_libraries(arc4randomforktest ${TESTS_LIBS}) + target_link_libraries(arc4randomforktest ${OPENSSL_LIBS}) add_test(arc4randomforktest ${CMAKE_CURRENT_SOURCE_DIR}/arc4randomforktest.sh) endif() +# asn1evp +add_executable(asn1evp asn1evp.c) +target_link_libraries(asn1evp ${OPENSSL_LIBS}) +add_test(asn1evp asn1evp) + # asn1test add_executable(asn1test asn1test.c) -target_link_libraries(asn1test ${TESTS_LIBS}) +target_link_libraries(asn1test ${OPENSSL_LIBS}) add_test(asn1test asn1test) # asn1time add_executable(asn1time asn1time.c) -target_link_libraries(asn1time ${TESTS_LIBS}) +target_link_libraries(asn1time ${OPENSSL_LIBS}) add_test(asn1time asn1time) # base64test add_executable(base64test base64test.c) -target_link_libraries(base64test ${TESTS_LIBS}) +target_link_libraries(base64test ${OPENSSL_LIBS}) add_test(base64test base64test) # bftest add_executable(bftest bftest.c) -target_link_libraries(bftest ${TESTS_LIBS}) +target_link_libraries(bftest ${OPENSSL_LIBS}) add_test(bftest bftest) # biotest # the BIO tests rely on resolver results that are OS and environment-specific if(ENABLE_EXTRATESTS) add_executable(biotest biotest.c) - target_link_libraries(biotest ${TESTS_LIBS}) + target_link_libraries(biotest ${OPENSSL_LIBS}) add_test(biotest biotest) endif() +# bnaddsub +add_executable(bnaddsub bnaddsub.c) +target_link_libraries(bnaddsub ${OPENSSL_LIBS}) +add_test(bnaddsub bnaddsub) + +# bn_rand_interval +if(NOT BUILD_SHARED_LIBS) + add_executable(bn_rand_interval bn_rand_interval.c) + target_link_libraries(bn_rand_interval ${OPENSSL_LIBS}) + add_test(bn_rand_interval bn_rand_interval) +endif() + # bntest -add_executable(bntest bntest.c) -set_source_files_properties(bntest.c PROPERTIES COMPILE_FLAGS -ULIBRESSL_INTERNAL) -target_link_libraries(bntest ${TESTS_LIBS}) -add_test(bntest bntest) +if(NOT BUILD_SHARED_LIBS) + add_executable(bntest bntest.c) + set_source_files_properties(bntest.c PROPERTIES COMPILE_FLAGS + -ULIBRESSL_INTERNAL) + target_link_libraries(bntest ${OPENSSL_LIBS}) + add_test(bntest bntest) +endif() + +# buffertest +if(NOT BUILD_SHARED_LIBS) + add_executable(buffertest buffertest.c) + target_link_libraries(buffertest ${OPENSSL_LIBS}) + add_test(buffertest buffertest) +endif() # bytestringtest -add_executable(bytestringtest bytestringtest.c) -target_link_libraries(bytestringtest ${TESTS_LIBS}) -add_test(bytestringtest bytestringtest) +if(NOT BUILD_SHARED_LIBS) + add_executable(bytestringtest bytestringtest.c) + target_link_libraries(bytestringtest ${OPENSSL_LIBS}) + add_test(bytestringtest bytestringtest) +endif() # casttest add_executable(casttest casttest.c) -target_link_libraries(casttest ${TESTS_LIBS}) +target_link_libraries(casttest ${OPENSSL_LIBS}) add_test(casttest casttest) # chachatest add_executable(chachatest chachatest.c) -target_link_libraries(chachatest ${TESTS_LIBS}) +target_link_libraries(chachatest ${OPENSSL_LIBS}) add_test(chachatest chachatest) # cipher_list -add_executable(cipher_list cipher_list.c) -target_link_libraries(cipher_list ${TESTS_LIBS}) -add_test(cipher_list cipher_list) +if(NOT BUILD_SHARED_LIBS) + add_executable(cipher_list cipher_list.c) + target_link_libraries(cipher_list ${OPENSSL_LIBS}) + add_test(cipher_list cipher_list) +endif() # cipherstest add_executable(cipherstest cipherstest.c) -target_link_libraries(cipherstest ${TESTS_LIBS}) +target_link_libraries(cipherstest ${OPENSSL_LIBS}) add_test(cipherstest cipherstest) # clienttest add_executable(clienttest clienttest.c) -target_link_libraries(clienttest ${TESTS_LIBS}) +target_link_libraries(clienttest ${OPENSSL_LIBS}) add_test(clienttest clienttest) +# configtest +add_executable(configtest configtest.c) +target_link_libraries(configtest ${OPENSSL_LIBS}) +add_test(configtest configtest) + # cts128test add_executable(cts128test cts128test.c) -target_link_libraries(cts128test ${TESTS_LIBS}) +target_link_libraries(cts128test ${OPENSSL_LIBS}) add_test(cts128test cts128test) # destest add_executable(destest destest.c) -target_link_libraries(destest ${TESTS_LIBS}) +target_link_libraries(destest ${OPENSSL_LIBS}) add_test(destest destest) # dhtest add_executable(dhtest dhtest.c) -target_link_libraries(dhtest ${TESTS_LIBS}) +target_link_libraries(dhtest ${OPENSSL_LIBS}) add_test(dhtest dhtest) # dsatest add_executable(dsatest dsatest.c) -target_link_libraries(dsatest ${TESTS_LIBS}) +target_link_libraries(dsatest ${OPENSSL_LIBS}) add_test(dsatest dsatest) # ecdhtest add_executable(ecdhtest ecdhtest.c) -target_link_libraries(ecdhtest ${TESTS_LIBS}) +target_link_libraries(ecdhtest ${OPENSSL_LIBS}) add_test(ecdhtest ecdhtest) # ecdsatest add_executable(ecdsatest ecdsatest.c) -target_link_libraries(ecdsatest ${TESTS_LIBS}) +target_link_libraries(ecdsatest ${OPENSSL_LIBS}) add_test(ecdsatest ecdsatest) # ectest add_executable(ectest ectest.c) -target_link_libraries(ectest ${TESTS_LIBS}) +target_link_libraries(ectest ${OPENSSL_LIBS}) add_test(ectest ectest) # enginetest add_executable(enginetest enginetest.c) -target_link_libraries(enginetest ${TESTS_LIBS}) +target_link_libraries(enginetest ${OPENSSL_LIBS}) add_test(enginetest enginetest) # evptest add_executable(evptest evptest.c) -target_link_libraries(evptest ${TESTS_LIBS}) +target_link_libraries(evptest ${OPENSSL_LIBS}) add_test(evptest evptest ${CMAKE_CURRENT_SOURCE_DIR}/evptests.txt) # explicit_bzero # explicit_bzero relies on SA_ONSTACK, which is unavailable on Windows -if(NOT CMAKE_HOST_WIN32) +if(NOT WIN32) if(HAVE_MEMMEM) add_executable(explicit_bzero explicit_bzero.c) else() add_executable(explicit_bzero explicit_bzero.c compat/memmem.c) endif() - target_link_libraries(explicit_bzero ${TESTS_LIBS}) + target_link_libraries(explicit_bzero ${OPENSSL_LIBS}) add_test(explicit_bzero explicit_bzero) endif() # exptest -add_executable(exptest exptest.c) -set_source_files_properties(exptest.c PROPERTIES COMPILE_FLAGS -ULIBRESSL_INTERNAL) -target_link_libraries(exptest ${TESTS_LIBS}) -add_test(exptest exptest) +if(NOT BUILD_SHARED_LIBS) + add_executable(exptest exptest.c) + set_source_files_properties(exptest.c PROPERTIES COMPILE_FLAGS + -ULIBRESSL_INTERNAL) + target_link_libraries(exptest ${OPENSSL_LIBS}) + add_test(exptest exptest) +endif() # freenull add_executable(freenull freenull.c) -target_link_libraries(freenull ${TESTS_LIBS}) +target_link_libraries(freenull ${OPENSSL_LIBS}) add_test(freenull freenull) # gcm128test add_executable(gcm128test gcm128test.c) -target_link_libraries(gcm128test ${TESTS_LIBS}) +target_link_libraries(gcm128test ${OPENSSL_LIBS}) add_test(gcm128test gcm128test) # gost2814789t add_executable(gost2814789t gost2814789t.c) -target_link_libraries(gost2814789t ${TESTS_LIBS}) +target_link_libraries(gost2814789t ${OPENSSL_LIBS}) add_test(gost2814789t gost2814789t) # hkdf_test add_executable(hkdf_test hkdf_test.c) -target_link_libraries(hkdf_test ${TESTS_LIBS}) +target_link_libraries(hkdf_test ${OPENSSL_LIBS}) add_test(hkdf_test hkdf_test) # hmactest add_executable(hmactest hmactest.c) -target_link_libraries(hmactest ${TESTS_LIBS}) +target_link_libraries(hmactest ${OPENSSL_LIBS}) add_test(hmactest hmactest) # ideatest add_executable(ideatest ideatest.c) -target_link_libraries(ideatest ${TESTS_LIBS}) +target_link_libraries(ideatest ${OPENSSL_LIBS}) add_test(ideatest ideatest) # igetest add_executable(igetest igetest.c) -target_link_libraries(igetest ${TESTS_LIBS}) +target_link_libraries(igetest ${OPENSSL_LIBS}) add_test(igetest igetest) +# keypairtest +if(NOT BUILD_SHARED_LIBS) + add_executable(key_schedule key_schedule.c) + target_link_libraries(key_schedule ${OPENSSL_LIBS}) + add_test(key_schedule key_schedule) + + add_executable(keypairtest keypairtest.c) + target_link_libraries(keypairtest ${OPENSSL_LIBS}) + add_test(keypairtest keypairtest + ${CMAKE_CURRENT_SOURCE_DIR}/ca.pem + ${CMAKE_CURRENT_SOURCE_DIR}/server.pem + ${CMAKE_CURRENT_SOURCE_DIR}/server.pem) +endif() + # md4test add_executable(md4test md4test.c) -target_link_libraries(md4test ${TESTS_LIBS}) +target_link_libraries(md4test ${OPENSSL_LIBS}) add_test(md4test md4test) # md5test add_executable(md5test md5test.c) -target_link_libraries(md5test ${TESTS_LIBS}) +target_link_libraries(md5test ${OPENSSL_LIBS}) add_test(md5test md5test) # mont add_executable(mont mont.c) -target_link_libraries(mont ${TESTS_LIBS}) +target_link_libraries(mont ${OPENSSL_LIBS}) add_test(mont mont) # ocsp_test if(ENABLE_EXTRATESTS) add_executable(ocsp_test ocsp_test.c) - target_link_libraries(ocsp_test ${TESTS_LIBS}) + target_link_libraries(ocsp_test ${OPENSSL_LIBS}) if(NOT MSVC) - add_test(ocsptest ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.sh) + add_test(NAME ocsptest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.sh) else() - add_test(ocsptest ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.bat) + add_test(NAME ocsptest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.bat $) endif() endif() # optionstest add_executable(optionstest optionstest.c) -target_link_libraries(optionstest ${TESTS_LIBS}) +target_link_libraries(optionstest ${OPENSSL_LIBS}) add_test(optionstest optionstest) # pbkdf2 add_executable(pbkdf2 pbkdf2.c) -target_link_libraries(pbkdf2 ${TESTS_LIBS}) +target_link_libraries(pbkdf2 ${OPENSSL_LIBS}) add_test(pbkdf2 pbkdf2) # pidwraptest @@ -244,48 +287,61 @@ add_test(pbkdf2 pbkdf2) # awkward on systems with slow fork if(ENABLE_EXTRATESTS AND NOT MSVC) add_executable(pidwraptest pidwraptest.c) - target_link_libraries(pidwraptest ${TESTS_LIBS}) + target_link_libraries(pidwraptest ${OPENSSL_LIBS}) add_test(pidwraptest ${CMAKE_CURRENT_SOURCE_DIR}/pidwraptest.sh) endif() # pkcs7test add_executable(pkcs7test pkcs7test.c) -target_link_libraries(pkcs7test ${TESTS_LIBS}) +target_link_libraries(pkcs7test ${OPENSSL_LIBS}) add_test(pkcs7test pkcs7test) # poly1305test add_executable(poly1305test poly1305test.c) -target_link_libraries(poly1305test ${TESTS_LIBS}) +target_link_libraries(poly1305test ${OPENSSL_LIBS}) add_test(poly1305test poly1305test) # pq_test -add_executable(pq_test pq_test.c) -target_link_libraries(pq_test ${TESTS_LIBS}) -if(NOT MSVC) - add_test(pq_test ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) -else() - add_test(pq_test ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat) +if(NOT BUILD_SHARED_LIBS) + add_executable(pq_test pq_test.c) + target_link_libraries(pq_test ${OPENSSL_LIBS}) + if(NOT MSVC) + add_test(NAME pq_test COMMAND + ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) + else() + add_test(NAME pq_test COMMAND + ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat + $) + endif() + set_tests_properties(pq_test PROPERTIES ENVIRONMENT + "srcdir=${TEST_SOURCE_DIR}") endif() -set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") # randtest add_executable(randtest randtest.c) -target_link_libraries(randtest ${TESTS_LIBS}) +target_link_libraries(randtest ${OPENSSL_LIBS}) add_test(randtest randtest) # rc2test add_executable(rc2test rc2test.c) -target_link_libraries(rc2test ${TESTS_LIBS}) +target_link_libraries(rc2test ${OPENSSL_LIBS}) add_test(rc2test rc2test) # rc4test add_executable(rc4test rc4test.c) -target_link_libraries(rc4test ${TESTS_LIBS}) +target_link_libraries(rc4test ${OPENSSL_LIBS}) add_test(rc4test rc4test) +# recordtest +if(NOT BUILD_SHARED_LIBS) + add_executable(recordtest recordtest.c) + target_link_libraries(recordtest ${OPENSSL_LIBS}) + add_test(recordtest recordtest) +endif() + # rfc5280time add_executable(rfc5280time rfc5280time.c) -target_link_libraries(rfc5280time ${TESTS_LIBS}) +target_link_libraries(rfc5280time ${OPENSSL_LIBS}) if(SMALL_TIME_T) add_test(rfc5280time ${CMAKE_CURRENT_SOURCE_DIR}/rfc5280time_small.test) else() @@ -294,87 +350,101 @@ endif() # rmdtest add_executable(rmdtest rmdtest.c) -target_link_libraries(rmdtest ${TESTS_LIBS}) +target_link_libraries(rmdtest ${OPENSSL_LIBS}) add_test(rmdtest rmdtest) # rsa_test add_executable(rsa_test rsa_test.c) -target_link_libraries(rsa_test ${TESTS_LIBS}) +target_link_libraries(rsa_test ${OPENSSL_LIBS}) add_test(rsa_test rsa_test) # servertest add_executable(servertest servertest.c) -target_link_libraries(servertest ${TESTS_LIBS}) +target_link_libraries(servertest ${OPENSSL_LIBS}) if(NOT MSVC) - add_test(servertest ${CMAKE_CURRENT_SOURCE_DIR}/servertest.sh) + add_test(NAME servertest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/servertest.sh) else() - add_test(servertest ${CMAKE_CURRENT_SOURCE_DIR}/servertest.bat) + add_test(NAME servertest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/servertest.bat $) endif() -set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") +set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") # sha1test add_executable(sha1test sha1test.c) -target_link_libraries(sha1test ${TESTS_LIBS}) +target_link_libraries(sha1test ${OPENSSL_LIBS}) add_test(sha1test sha1test) # sha256test add_executable(sha256test sha256test.c) -target_link_libraries(sha256test ${TESTS_LIBS}) +target_link_libraries(sha256test ${OPENSSL_LIBS}) add_test(sha256test sha256test) # sha512test add_executable(sha512test sha512test.c) -target_link_libraries(sha512test ${TESTS_LIBS}) +target_link_libraries(sha512test ${OPENSSL_LIBS}) add_test(sha512test sha512test) +# sm3test +add_executable(sm3test sm3test.c) +target_link_libraries(sm3test ${OPENSSL_LIBS}) +add_test(sm3test sm3test) + +# sm4test +add_executable(sm4test sm4test.c) +target_link_libraries(sm4test ${OPENSSL_LIBS}) +add_test(sm4test sm4test) + # ssl_versions -add_executable(ssl_versions ssl_versions.c) -target_link_libraries(ssl_versions ${TESTS_LIBS}) -add_test(ssl_versions ssl_versions) +if(NOT BUILD_SHARED_LIBS) + add_executable(ssl_versions ssl_versions.c) + target_link_libraries(ssl_versions ${OPENSSL_LIBS}) + add_test(ssl_versions ssl_versions) +endif() # ssltest add_executable(ssltest ssltest.c) -target_link_libraries(ssltest ${TESTS_LIBS}) +target_link_libraries(ssltest ${OPENSSL_LIBS}) if(NOT MSVC) - add_test(ssltest ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.sh) + add_test(NAME ssltest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.sh) else() - add_test(ssltest ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.bat) + add_test(NAME ssltest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.bat $ $) endif() -set_tests_properties(ssltest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") +set_tests_properties(ssltest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") # testdsa if(NOT MSVC) - add_test(testdsa ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.sh) + add_test(NAME testdsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.sh) else() - add_test(testdsa ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.bat) + add_test(NAME testdsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.bat $) endif() -set_tests_properties(testdsa PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") +set_tests_properties(testdsa PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") # testenc if(NOT MSVC) - add_test(testenc ${CMAKE_CURRENT_SOURCE_DIR}/testenc.sh) + add_test(NAME testenc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testenc.sh) else() - add_test(testenc ${CMAKE_CURRENT_SOURCE_DIR}/testenc.bat) + add_test(NAME testenc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testenc.bat $) endif() -set_tests_properties(testenc PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") +set_tests_properties(testenc PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") # testrsa if(NOT MSVC) - add_test(testrsa ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.sh) + add_test(NAME testrsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.sh) else() - add_test(testrsa ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.bat) + add_test(NAME testrsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.bat $) endif() -set_tests_properties(testrsa PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") +set_tests_properties(testrsa PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") # timingsafe add_executable(timingsafe timingsafe.c) -target_link_libraries(timingsafe ${TESTS_LIBS}) +target_link_libraries(timingsafe ${OPENSSL_LIBS}) add_test(timingsafe timingsafe) # tlsexttest -add_executable(tlsexttest tlsexttest.c) -target_link_libraries(tlsexttest ${TESTS_LIBS}) -add_test(tlsexttest tlsexttest) +if(NOT BUILD_SHARED_LIBS) + add_executable(tlsexttest tlsexttest.c) + target_link_libraries(tlsexttest ${OPENSSL_LIBS}) + add_test(tlsexttest tlsexttest) +endif() # tlstest set(TLSTEST_SRC tlstest.c) @@ -386,45 +456,65 @@ else() endif() add_executable(tlstest ${TLSTEST_SRC}) -target_link_libraries(tlstest ${TESTS_LIBS}) +target_link_libraries(tlstest ${OPENSSL_LIBS}) if(NOT MSVC) - add_test(tlstest ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.sh) + add_test(NAME tlstest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.sh) else() - add_test(tlstest ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.bat) + add_test(NAME tlstest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.bat $) endif() -set_tests_properties(tlstest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") +set_tests_properties(tlstest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") # tls_ext_alpn -add_executable(tls_ext_alpn tls_ext_alpn.c) -target_link_libraries(tls_ext_alpn ${TESTS_LIBS}) -add_test(tls_ext_alpn tls_ext_alpn) +if(NOT BUILD_SHARED_LIBS) + add_executable(tls_ext_alpn tls_ext_alpn.c) + target_link_libraries(tls_ext_alpn ${OPENSSL_LIBS}) + add_test(tls_ext_alpn tls_ext_alpn) +endif() # tls_prf -add_executable(tls_prf tls_prf.c) -target_link_libraries(tls_prf ${TESTS_LIBS}) -add_test(tls_prf tls_prf) +if(NOT BUILD_SHARED_LIBS) + add_executable(tls_prf tls_prf.c) + target_link_libraries(tls_prf ${OPENSSL_LIBS}) + add_test(tls_prf tls_prf) +endif() # utf8test -add_executable(utf8test utf8test.c) -target_link_libraries(utf8test ${TESTS_LIBS}) -add_test(utf8test utf8test) +if(NOT BUILD_SHARED_LIBS) + add_executable(utf8test utf8test.c) + target_link_libraries(utf8test ${OPENSSL_LIBS}) + add_test(utf8test utf8test) +endif() + +# valid_handshakes_terminate +if(NOT BUILD_SHARED_LIBS) + add_executable(valid_handshakes_terminate valid_handshakes_terminate.c) + target_link_libraries(valid_handshakes_terminate ${OPENSSL_LIBS}) + add_test(valid_handshakes_terminate valid_handshakes_terminate) +endif() # verifytest -add_executable(verifytest verifytest.c) -target_link_libraries(verifytest tls ${TESTS_LIBS}) -add_test(verifytest verifytest) +if(NOT BUILD_SHARED_LIBS) + add_executable(verifytest verifytest.c) + target_link_libraries(verifytest ${OPENSSL_LIBS}) + add_test(verifytest verifytest) +endif() # x25519test add_executable(x25519test x25519test.c) -target_link_libraries(x25519test ${TESTS_LIBS}) +target_link_libraries(x25519test ${OPENSSL_LIBS}) add_test(x25519test x25519test) -if(ENABLE_VSTEST AND USE_SHARED) +# x509name +add_executable(x509name x509name.c) +target_link_libraries(x509name ${OPENSSL_LIBS}) +add_test(x509name x509name) + +if(BUILD_SHARED_LIBS) add_custom_command(TARGET x25519test POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy - "$" - "$" - "$" + "$" + "$" + "$" "${CMAKE_CURRENT_BINARY_DIR}" COMMENT "Copying DLLs for regression tests") endif() diff --git a/tests/Makefile.am b/tests/Makefile.am index be362db8..bf1db369 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.am.common AM_CPPFLAGS += -I $(top_srcdir)/crypto/modes AM_CPPFLAGS += -I $(top_srcdir)/crypto/asn1 AM_CPPFLAGS += -I $(top_srcdir)/ssl +AM_CPPFLAGS += -I $(top_srcdir)/tls AM_CPPFLAGS += -I $(top_srcdir)/apps/openssl AM_CPPFLAGS += -I $(top_srcdir)/apps/openssl/compat AM_CPPFLAGS += -D_PATH_SSL_CA_FILE=\"$(top_srcdir)/apps/openssl/cert.pem\" @@ -43,6 +44,11 @@ arc4randomforktest_SOURCES = arc4randomforktest.c endif EXTRA_DIST += arc4randomforktest.sh +# asn1evp +TESTS += asn1evp +check_PROGRAMS += asn1evp +asn1evp_SOURCES = asn1evp.c + # asn1test TESTS += asn1test check_PROGRAMS += asn1test @@ -71,12 +77,28 @@ check_PROGRAMS += biotest biotest_SOURCES = biotest.c endif +# bnaddsub +TESTS += bnaddsub +check_PROGRAMS += bnaddsub +bnaddsub_SOURCES = bnaddsub.c + +# bn_rand_interval +TESTS += bn_rand_interval +check_PROGRAMS += bn_rand_interval +bn_rand_interval_SOURCES = bn_rand_interval.c + # bntest TESTS += bntest bntest_CPPFLAGS = $(AM_CPPFLAGS) -ULIBRESSL_INTERNAL check_PROGRAMS += bntest bntest_SOURCES = bntest.c +# buffertest +TESTS += buffertest +buffertest_CPPFLAGS = $(AM_CPPFLAGS) +check_PROGRAMS += buffertest +buffertest_SOURCES = buffertest.c + # bytestringtest TESTS += bytestringtest check_PROGRAMS += bytestringtest @@ -108,6 +130,11 @@ TESTS += clienttest check_PROGRAMS += clienttest clienttest_SOURCES = clienttest.c +# configtest +TESTS += configtest +check_PROGRAMS += configtest +configtest_SOURCES = configtest.c + # cts128test TESTS += cts128test check_PROGRAMS += cts128test @@ -189,6 +216,10 @@ TESTS += gost2814789t check_PROGRAMS += gost2814789t gost2814789t_SOURCES = gost2814789t.c +# handshake_table +noinst_PROGRAMS = handshake_table +handshake_table_SOURCES = handshake_table.c + # hkdf_test TESTS += hkdftest check_PROGRAMS += hkdftest @@ -209,6 +240,17 @@ TESTS += igetest check_PROGRAMS += igetest igetest_SOURCES = igetest.c +# keypairtest +TESTS += keypairtest.sh +check_PROGRAMS += keypairtest +keypairtest_SOURCES = keypairtest.c +EXTRA_DIST += keypairtest.sh + +# key_schedule +TESTS += key_schedule +check_PROGRAMS += key_schedule +key_schedule_SOURCES = key_schedule.c + # md4test TESTS += md4test check_PROGRAMS += md4test @@ -284,6 +326,11 @@ TESTS += rc4test check_PROGRAMS += rc4test rc4test_SOURCES = rc4test.c +# recordtest +TESTS += recordtest +check_PROGRAMS += recordtest +recordtest_SOURCES = recordtest.c + # rfc5280time check_PROGRAMS += rfc5280time rfc5280time_SOURCES = rfc5280time.c @@ -325,6 +372,16 @@ TESTS += sha512test check_PROGRAMS += sha512test sha512test_SOURCES = sha512test.c +# sm3test +TESTS += sm3test +check_PROGRAMS += sm3test +sm3test_SOURCES = sm3test.c + +# sm4test +TESTS += sm4test +check_PROGRAMS += sm4test +sm4test_SOURCES = sm4test.c + # ssl_versions TESTS += ssl_versions check_PROGRAMS += ssl_versions @@ -384,6 +441,11 @@ TESTS += utf8test check_PROGRAMS += utf8test utf8test_SOURCES = utf8test.c +# valid_handshakes_terminate +TESTS += valid_handshakes_terminate +check_PROGRAMS += valid_handshakes_terminate +valid_handshakes_terminate_SOURCES = valid_handshakes_terminate.c + # verifytest TESTS += verifytest check_PROGRAMS += verifytest @@ -393,3 +455,8 @@ verifytest_SOURCES = verifytest.c TESTS += x25519test check_PROGRAMS += x25519test x25519test_SOURCES = x25519test.c + +# x509name +TESTS += x509name +check_PROGRAMS += x509name +x509name_SOURCES = x509name.c diff --git a/tests/Makefile.in b/tests/Makefile.in index 380ae424..0b715ccd 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,6 +14,7 @@ @SET_MAKE@ + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -89,49 +90,58 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HOST_ASM_MACOSX_X86_64_TRUE@am__append_1 = $(abs_top_builddir)/crypto/.libs/libcrypto_la-cpuid-macosx-x86_64.o -TESTS = aeadtest.sh aes_wrap$(EXEEXT) $(am__append_2) \ +TESTS = aeadtest.sh aes_wrap$(EXEEXT) $(am__append_2) asn1evp$(EXEEXT) \ asn1test$(EXEEXT) asn1time$(EXEEXT) base64test$(EXEEXT) \ - bftest$(EXEEXT) $(am__EXEEXT_2) bntest$(EXEEXT) \ + bftest$(EXEEXT) $(am__EXEEXT_2) bnaddsub$(EXEEXT) \ + bn_rand_interval$(EXEEXT) bntest$(EXEEXT) buffertest$(EXEEXT) \ bytestringtest$(EXEEXT) casttest$(EXEEXT) chachatest$(EXEEXT) \ cipher_list$(EXEEXT) cipherstest$(EXEEXT) clienttest$(EXEEXT) \ - cts128test$(EXEEXT) destest$(EXEEXT) dhtest$(EXEEXT) \ - dsatest$(EXEEXT) ecdhtest$(EXEEXT) ecdsatest$(EXEEXT) \ - ectest$(EXEEXT) enginetest$(EXEEXT) evptest.sh $(am__EXEEXT_3) \ - exptest$(EXEEXT) freenull$(EXEEXT) gcm128test$(EXEEXT) \ - gost2814789t$(EXEEXT) hkdftest$(EXEEXT) hmactest$(EXEEXT) \ - ideatest$(EXEEXT) igetest$(EXEEXT) md4test$(EXEEXT) \ + configtest$(EXEEXT) cts128test$(EXEEXT) destest$(EXEEXT) \ + dhtest$(EXEEXT) dsatest$(EXEEXT) ecdhtest$(EXEEXT) \ + ecdsatest$(EXEEXT) ectest$(EXEEXT) enginetest$(EXEEXT) \ + evptest.sh $(am__EXEEXT_3) exptest$(EXEEXT) freenull$(EXEEXT) \ + gcm128test$(EXEEXT) gost2814789t$(EXEEXT) hkdftest$(EXEEXT) \ + hmactest$(EXEEXT) ideatest$(EXEEXT) igetest$(EXEEXT) \ + keypairtest.sh key_schedule$(EXEEXT) md4test$(EXEEXT) \ md5test$(EXEEXT) mont$(EXEEXT) $(am__append_9) \ optionstest$(EXEEXT) pbkdf2$(EXEEXT) $(am__append_11) \ pkcs7test$(EXEEXT) poly1305test$(EXEEXT) pq_test.sh \ randtest$(EXEEXT) rc2test$(EXEEXT) rc4test$(EXEEXT) \ - $(am__append_13) $(am__EXEEXT_6) rmdtest$(EXEEXT) \ - rsa_test$(EXEEXT) servertest.sh sha1test$(EXEEXT) \ - sha256test$(EXEEXT) sha512test$(EXEEXT) ssl_versions$(EXEEXT) \ + recordtest$(EXEEXT) $(am__append_13) $(am__EXEEXT_6) \ + rmdtest$(EXEEXT) rsa_test$(EXEEXT) servertest.sh \ + sha1test$(EXEEXT) sha256test$(EXEEXT) sha512test$(EXEEXT) \ + sm3test$(EXEEXT) sm4test$(EXEEXT) ssl_versions$(EXEEXT) \ ssltest.sh testdsa.sh testenc.sh testrsa.sh \ timingsafe$(EXEEXT) tlsexttest$(EXEEXT) tlstest.sh \ tls_ext_alpn$(EXEEXT) tls_prf$(EXEEXT) utf8test$(EXEEXT) \ - verifytest$(EXEEXT) x25519test$(EXEEXT) + valid_handshakes_terminate$(EXEEXT) verifytest$(EXEEXT) \ + x25519test$(EXEEXT) x509name$(EXEEXT) check_PROGRAMS = aeadtest$(EXEEXT) aes_wrap$(EXEEXT) $(am__EXEEXT_1) \ - asn1test$(EXEEXT) asn1time$(EXEEXT) base64test$(EXEEXT) \ - bftest$(EXEEXT) $(am__EXEEXT_2) bntest$(EXEEXT) \ - bytestringtest$(EXEEXT) casttest$(EXEEXT) chachatest$(EXEEXT) \ - cipher_list$(EXEEXT) cipherstest$(EXEEXT) clienttest$(EXEEXT) \ - cts128test$(EXEEXT) destest$(EXEEXT) dhtest$(EXEEXT) \ - dsatest$(EXEEXT) ecdhtest$(EXEEXT) ecdsatest$(EXEEXT) \ - ectest$(EXEEXT) enginetest$(EXEEXT) evptest$(EXEEXT) \ - $(am__EXEEXT_3) exptest$(EXEEXT) freenull$(EXEEXT) \ - gcm128test$(EXEEXT) gost2814789t$(EXEEXT) hkdftest$(EXEEXT) \ - hmactest$(EXEEXT) ideatest$(EXEEXT) igetest$(EXEEXT) \ - md4test$(EXEEXT) md5test$(EXEEXT) mont$(EXEEXT) \ - $(am__EXEEXT_4) optionstest$(EXEEXT) pbkdf2$(EXEEXT) \ - $(am__EXEEXT_5) pkcs7test$(EXEEXT) poly1305test$(EXEEXT) \ - pq_test$(EXEEXT) randtest$(EXEEXT) rc2test$(EXEEXT) \ - rc4test$(EXEEXT) rfc5280time$(EXEEXT) rmdtest$(EXEEXT) \ - rsa_test$(EXEEXT) servertest$(EXEEXT) sha1test$(EXEEXT) \ - sha256test$(EXEEXT) sha512test$(EXEEXT) ssl_versions$(EXEEXT) \ - ssltest$(EXEEXT) timingsafe$(EXEEXT) tlsexttest$(EXEEXT) \ - tlstest$(EXEEXT) tls_ext_alpn$(EXEEXT) tls_prf$(EXEEXT) \ - utf8test$(EXEEXT) verifytest$(EXEEXT) x25519test$(EXEEXT) + asn1evp$(EXEEXT) asn1test$(EXEEXT) asn1time$(EXEEXT) \ + base64test$(EXEEXT) bftest$(EXEEXT) $(am__EXEEXT_2) \ + bnaddsub$(EXEEXT) bn_rand_interval$(EXEEXT) bntest$(EXEEXT) \ + buffertest$(EXEEXT) bytestringtest$(EXEEXT) casttest$(EXEEXT) \ + chachatest$(EXEEXT) cipher_list$(EXEEXT) cipherstest$(EXEEXT) \ + clienttest$(EXEEXT) configtest$(EXEEXT) cts128test$(EXEEXT) \ + destest$(EXEEXT) dhtest$(EXEEXT) dsatest$(EXEEXT) \ + ecdhtest$(EXEEXT) ecdsatest$(EXEEXT) ectest$(EXEEXT) \ + enginetest$(EXEEXT) evptest$(EXEEXT) $(am__EXEEXT_3) \ + exptest$(EXEEXT) freenull$(EXEEXT) gcm128test$(EXEEXT) \ + gost2814789t$(EXEEXT) hkdftest$(EXEEXT) hmactest$(EXEEXT) \ + ideatest$(EXEEXT) igetest$(EXEEXT) keypairtest$(EXEEXT) \ + key_schedule$(EXEEXT) md4test$(EXEEXT) md5test$(EXEEXT) \ + mont$(EXEEXT) $(am__EXEEXT_4) optionstest$(EXEEXT) \ + pbkdf2$(EXEEXT) $(am__EXEEXT_5) pkcs7test$(EXEEXT) \ + poly1305test$(EXEEXT) pq_test$(EXEEXT) randtest$(EXEEXT) \ + rc2test$(EXEEXT) rc4test$(EXEEXT) recordtest$(EXEEXT) \ + rfc5280time$(EXEEXT) rmdtest$(EXEEXT) rsa_test$(EXEEXT) \ + servertest$(EXEEXT) sha1test$(EXEEXT) sha256test$(EXEEXT) \ + sha512test$(EXEEXT) sm3test$(EXEEXT) sm4test$(EXEEXT) \ + ssl_versions$(EXEEXT) ssltest$(EXEEXT) timingsafe$(EXEEXT) \ + tlsexttest$(EXEEXT) tlstest$(EXEEXT) tls_ext_alpn$(EXEEXT) \ + tls_prf$(EXEEXT) utf8test$(EXEEXT) \ + valid_handshakes_terminate$(EXEEXT) verifytest$(EXEEXT) \ + x25519test$(EXEEXT) x509name$(EXEEXT) # arc4randomforktest # Windows/mingw does not have fork, but Cygwin does. @@ -148,6 +158,7 @@ check_PROGRAMS = aeadtest$(EXEEXT) aes_wrap$(EXEEXT) $(am__EXEEXT_1) \ @HOST_CYGWIN_FALSE@@HOST_WIN_FALSE@am__append_6 = explicit_bzero @HOST_CYGWIN_FALSE@@HOST_WIN_FALSE@am__append_7 = explicit_bzero @HAVE_MEMMEM_FALSE@@HOST_CYGWIN_FALSE@@HOST_WIN_FALSE@am__append_8 = compat/memmem.c +noinst_PROGRAMS = handshake_table$(EXEEXT) # ocsp_test @ENABLE_EXTRATESTS_TRUE@am__append_9 = ocsptest.sh @@ -183,6 +194,7 @@ CONFIG_CLEAN_VPATH_FILES = @HOST_CYGWIN_FALSE@@HOST_WIN_FALSE@ explicit_bzero$(EXEEXT) @ENABLE_EXTRATESTS_TRUE@am__EXEEXT_4 = ocsp_test$(EXEEXT) @ENABLE_EXTRATESTS_TRUE@am__EXEEXT_5 = pidwraptest$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) am_aeadtest_OBJECTS = aeadtest.$(OBJEXT) aeadtest_OBJECTS = $(am_aeadtest_OBJECTS) aeadtest_LDADD = $(LDADD) @@ -212,6 +224,13 @@ arc4randomforktest_DEPENDENCIES = \ $(abs_top_builddir)/ssl/.libs/libssl.a \ $(abs_top_builddir)/crypto/.libs/libcrypto.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_asn1evp_OBJECTS = asn1evp.$(OBJEXT) +asn1evp_OBJECTS = $(am_asn1evp_OBJECTS) +asn1evp_LDADD = $(LDADD) +asn1evp_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) am_asn1test_OBJECTS = asn1test.$(OBJEXT) asn1test_OBJECTS = $(am_asn1test_OBJECTS) asn1test_LDADD = $(LDADD) @@ -248,6 +267,21 @@ biotest_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ $(abs_top_builddir)/ssl/.libs/libssl.a \ $(abs_top_builddir)/crypto/.libs/libcrypto.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_bn_rand_interval_OBJECTS = bn_rand_interval.$(OBJEXT) +bn_rand_interval_OBJECTS = $(am_bn_rand_interval_OBJECTS) +bn_rand_interval_LDADD = $(LDADD) +bn_rand_interval_DEPENDENCIES = \ + $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_bnaddsub_OBJECTS = bnaddsub.$(OBJEXT) +bnaddsub_OBJECTS = $(am_bnaddsub_OBJECTS) +bnaddsub_LDADD = $(LDADD) +bnaddsub_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) am_bntest_OBJECTS = bntest-bntest.$(OBJEXT) bntest_OBJECTS = $(am_bntest_OBJECTS) bntest_LDADD = $(LDADD) @@ -255,6 +289,13 @@ bntest_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ $(abs_top_builddir)/ssl/.libs/libssl.a \ $(abs_top_builddir)/crypto/.libs/libcrypto.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_buffertest_OBJECTS = buffertest-buffertest.$(OBJEXT) +buffertest_OBJECTS = $(am_buffertest_OBJECTS) +buffertest_LDADD = $(LDADD) +buffertest_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) am_bytestringtest_OBJECTS = bytestringtest.$(OBJEXT) bytestringtest_OBJECTS = $(am_bytestringtest_OBJECTS) bytestringtest_LDADD = $(LDADD) @@ -297,6 +338,13 @@ clienttest_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ $(abs_top_builddir)/ssl/.libs/libssl.a \ $(abs_top_builddir)/crypto/.libs/libcrypto.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_configtest_OBJECTS = configtest.$(OBJEXT) +configtest_OBJECTS = $(am_configtest_OBJECTS) +configtest_LDADD = $(LDADD) +configtest_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) am_cts128test_OBJECTS = cts128test.$(OBJEXT) cts128test_OBJECTS = $(am_cts128test_OBJECTS) cts128test_LDADD = $(LDADD) @@ -400,6 +448,13 @@ gost2814789t_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ $(abs_top_builddir)/ssl/.libs/libssl.a \ $(abs_top_builddir)/crypto/.libs/libcrypto.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_handshake_table_OBJECTS = handshake_table.$(OBJEXT) +handshake_table_OBJECTS = $(am_handshake_table_OBJECTS) +handshake_table_LDADD = $(LDADD) +handshake_table_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) am_hkdftest_OBJECTS = hkdf_test.$(OBJEXT) hkdftest_OBJECTS = $(am_hkdftest_OBJECTS) hkdftest_LDADD = $(LDADD) @@ -428,6 +483,20 @@ igetest_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ $(abs_top_builddir)/ssl/.libs/libssl.a \ $(abs_top_builddir)/crypto/.libs/libcrypto.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_key_schedule_OBJECTS = key_schedule.$(OBJEXT) +key_schedule_OBJECTS = $(am_key_schedule_OBJECTS) +key_schedule_LDADD = $(LDADD) +key_schedule_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_keypairtest_OBJECTS = keypairtest.$(OBJEXT) +keypairtest_OBJECTS = $(am_keypairtest_OBJECTS) +keypairtest_LDADD = $(LDADD) +keypairtest_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) am_md4test_OBJECTS = md4test.$(OBJEXT) md4test_OBJECTS = $(am_md4test_OBJECTS) md4test_LDADD = $(LDADD) @@ -522,6 +591,13 @@ rc4test_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ $(abs_top_builddir)/ssl/.libs/libssl.a \ $(abs_top_builddir)/crypto/.libs/libcrypto.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_recordtest_OBJECTS = recordtest.$(OBJEXT) +recordtest_OBJECTS = $(am_recordtest_OBJECTS) +recordtest_LDADD = $(LDADD) +recordtest_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) am_rfc5280time_OBJECTS = rfc5280time.$(OBJEXT) rfc5280time_OBJECTS = $(am_rfc5280time_OBJECTS) rfc5280time_LDADD = $(LDADD) @@ -571,6 +647,20 @@ sha512test_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ $(abs_top_builddir)/ssl/.libs/libssl.a \ $(abs_top_builddir)/crypto/.libs/libcrypto.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_sm3test_OBJECTS = sm3test.$(OBJEXT) +sm3test_OBJECTS = $(am_sm3test_OBJECTS) +sm3test_LDADD = $(LDADD) +sm3test_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_sm4test_OBJECTS = sm4test.$(OBJEXT) +sm4test_OBJECTS = $(am_sm4test_OBJECTS) +sm4test_LDADD = $(LDADD) +sm4test_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) am_ssl_versions_OBJECTS = ssl_versions.$(OBJEXT) ssl_versions_OBJECTS = $(am_ssl_versions_OBJECTS) ssl_versions_LDADD = $(LDADD) @@ -629,6 +719,16 @@ utf8test_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ $(abs_top_builddir)/ssl/.libs/libssl.a \ $(abs_top_builddir)/crypto/.libs/libcrypto.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_valid_handshakes_terminate_OBJECTS = \ + valid_handshakes_terminate.$(OBJEXT) +valid_handshakes_terminate_OBJECTS = \ + $(am_valid_handshakes_terminate_OBJECTS) +valid_handshakes_terminate_LDADD = $(LDADD) +valid_handshakes_terminate_DEPENDENCIES = \ + $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) am_verifytest_OBJECTS = verifytest.$(OBJEXT) verifytest_OBJECTS = $(am_verifytest_OBJECTS) verifytest_LDADD = $(LDADD) @@ -643,6 +743,13 @@ x25519test_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ $(abs_top_builddir)/ssl/.libs/libssl.a \ $(abs_top_builddir)/crypto/.libs/libcrypto.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) +am_x509name_OBJECTS = x509name.$(OBJEXT) +x509name_OBJECTS = $(am_x509name_OBJECTS) +x509name_LDADD = $(LDADD) +x509name_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \ + $(abs_top_builddir)/ssl/.libs/libssl.a \ + $(abs_top_builddir)/crypto/.libs/libcrypto.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -657,7 +764,48 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/aeadtest.Po ./$(DEPDIR)/aes_wrap.Po \ + ./$(DEPDIR)/arc4randomforktest.Po ./$(DEPDIR)/asn1evp.Po \ + ./$(DEPDIR)/asn1test.Po ./$(DEPDIR)/asn1time.Po \ + ./$(DEPDIR)/base64test.Po ./$(DEPDIR)/bftest.Po \ + ./$(DEPDIR)/biotest.Po ./$(DEPDIR)/bn_rand_interval.Po \ + ./$(DEPDIR)/bnaddsub.Po ./$(DEPDIR)/bntest-bntest.Po \ + ./$(DEPDIR)/buffertest-buffertest.Po \ + ./$(DEPDIR)/bytestringtest.Po ./$(DEPDIR)/casttest.Po \ + ./$(DEPDIR)/chachatest.Po ./$(DEPDIR)/cipher_list.Po \ + ./$(DEPDIR)/cipherstest.Po ./$(DEPDIR)/clienttest.Po \ + ./$(DEPDIR)/configtest.Po ./$(DEPDIR)/cts128test.Po \ + ./$(DEPDIR)/destest.Po ./$(DEPDIR)/dhtest.Po \ + ./$(DEPDIR)/dsatest.Po ./$(DEPDIR)/ecdhtest.Po \ + ./$(DEPDIR)/ecdsatest.Po ./$(DEPDIR)/ectest.Po \ + ./$(DEPDIR)/enginetest.Po ./$(DEPDIR)/evptest.Po \ + ./$(DEPDIR)/explicit_bzero.Po ./$(DEPDIR)/exptest-exptest.Po \ + ./$(DEPDIR)/freenull.Po ./$(DEPDIR)/gcm128test.Po \ + ./$(DEPDIR)/gost2814789t.Po ./$(DEPDIR)/handshake_table.Po \ + ./$(DEPDIR)/hkdf_test.Po ./$(DEPDIR)/hmactest.Po \ + ./$(DEPDIR)/ideatest.Po ./$(DEPDIR)/igetest.Po \ + ./$(DEPDIR)/key_schedule.Po ./$(DEPDIR)/keypairtest.Po \ + ./$(DEPDIR)/md4test.Po ./$(DEPDIR)/md5test.Po \ + ./$(DEPDIR)/mont.Po ./$(DEPDIR)/ocsp_test.Po \ + ./$(DEPDIR)/optionstest.Po ./$(DEPDIR)/pbkdf2.Po \ + ./$(DEPDIR)/pidwraptest.Po ./$(DEPDIR)/pkcs7test.Po \ + ./$(DEPDIR)/poly1305test.Po ./$(DEPDIR)/pq_test.Po \ + ./$(DEPDIR)/randtest.Po ./$(DEPDIR)/rc2test.Po \ + ./$(DEPDIR)/rc4test.Po ./$(DEPDIR)/recordtest.Po \ + ./$(DEPDIR)/rfc5280time.Po ./$(DEPDIR)/rmdtest.Po \ + ./$(DEPDIR)/rsa_test.Po ./$(DEPDIR)/servertest.Po \ + ./$(DEPDIR)/sha1test.Po ./$(DEPDIR)/sha256test.Po \ + ./$(DEPDIR)/sha512test.Po ./$(DEPDIR)/sm3test.Po \ + ./$(DEPDIR)/sm4test.Po ./$(DEPDIR)/ssl_versions.Po \ + ./$(DEPDIR)/ssltest.Po ./$(DEPDIR)/timingsafe.Po \ + ./$(DEPDIR)/tls_ext_alpn.Po ./$(DEPDIR)/tls_prf.Po \ + ./$(DEPDIR)/tlsexttest.Po ./$(DEPDIR)/tlstest.Po \ + ./$(DEPDIR)/utf8test.Po \ + ./$(DEPDIR)/valid_handshakes_terminate.Po \ + ./$(DEPDIR)/verifytest.Po ./$(DEPDIR)/x25519test.Po \ + ./$(DEPDIR)/x509name.Po compat/$(DEPDIR)/memmem.Po \ + compat/$(DEPDIR)/pipe2.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -678,57 +826,68 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(aeadtest_SOURCES) $(aes_wrap_SOURCES) \ - $(arc4randomforktest_SOURCES) $(asn1test_SOURCES) \ - $(asn1time_SOURCES) $(base64test_SOURCES) $(bftest_SOURCES) \ - $(biotest_SOURCES) $(bntest_SOURCES) $(bytestringtest_SOURCES) \ - $(casttest_SOURCES) $(chachatest_SOURCES) \ - $(cipher_list_SOURCES) $(cipherstest_SOURCES) \ - $(clienttest_SOURCES) $(cts128test_SOURCES) $(destest_SOURCES) \ + $(arc4randomforktest_SOURCES) $(asn1evp_SOURCES) \ + $(asn1test_SOURCES) $(asn1time_SOURCES) $(base64test_SOURCES) \ + $(bftest_SOURCES) $(biotest_SOURCES) \ + $(bn_rand_interval_SOURCES) $(bnaddsub_SOURCES) \ + $(bntest_SOURCES) $(buffertest_SOURCES) \ + $(bytestringtest_SOURCES) $(casttest_SOURCES) \ + $(chachatest_SOURCES) $(cipher_list_SOURCES) \ + $(cipherstest_SOURCES) $(clienttest_SOURCES) \ + $(configtest_SOURCES) $(cts128test_SOURCES) $(destest_SOURCES) \ $(dhtest_SOURCES) $(dsatest_SOURCES) $(ecdhtest_SOURCES) \ $(ecdsatest_SOURCES) $(ectest_SOURCES) $(enginetest_SOURCES) \ $(evptest_SOURCES) $(explicit_bzero_SOURCES) \ $(exptest_SOURCES) $(freenull_SOURCES) $(gcm128test_SOURCES) \ - $(gost2814789t_SOURCES) $(hkdftest_SOURCES) \ - $(hmactest_SOURCES) $(ideatest_SOURCES) $(igetest_SOURCES) \ - $(md4test_SOURCES) $(md5test_SOURCES) $(mont_SOURCES) \ - $(ocsp_test_SOURCES) $(optionstest_SOURCES) $(pbkdf2_SOURCES) \ - $(pidwraptest_SOURCES) $(pkcs7test_SOURCES) \ + $(gost2814789t_SOURCES) $(handshake_table_SOURCES) \ + $(hkdftest_SOURCES) $(hmactest_SOURCES) $(ideatest_SOURCES) \ + $(igetest_SOURCES) $(key_schedule_SOURCES) \ + $(keypairtest_SOURCES) $(md4test_SOURCES) $(md5test_SOURCES) \ + $(mont_SOURCES) $(ocsp_test_SOURCES) $(optionstest_SOURCES) \ + $(pbkdf2_SOURCES) $(pidwraptest_SOURCES) $(pkcs7test_SOURCES) \ $(poly1305test_SOURCES) $(pq_test_SOURCES) $(randtest_SOURCES) \ - $(rc2test_SOURCES) $(rc4test_SOURCES) $(rfc5280time_SOURCES) \ - $(rmdtest_SOURCES) $(rsa_test_SOURCES) $(servertest_SOURCES) \ - $(sha1test_SOURCES) $(sha256test_SOURCES) \ - $(sha512test_SOURCES) $(ssl_versions_SOURCES) \ - $(ssltest_SOURCES) $(timingsafe_SOURCES) \ - $(tls_ext_alpn_SOURCES) $(tls_prf_SOURCES) \ - $(tlsexttest_SOURCES) $(tlstest_SOURCES) $(utf8test_SOURCES) \ - $(verifytest_SOURCES) $(x25519test_SOURCES) + $(rc2test_SOURCES) $(rc4test_SOURCES) $(recordtest_SOURCES) \ + $(rfc5280time_SOURCES) $(rmdtest_SOURCES) $(rsa_test_SOURCES) \ + $(servertest_SOURCES) $(sha1test_SOURCES) \ + $(sha256test_SOURCES) $(sha512test_SOURCES) $(sm3test_SOURCES) \ + $(sm4test_SOURCES) $(ssl_versions_SOURCES) $(ssltest_SOURCES) \ + $(timingsafe_SOURCES) $(tls_ext_alpn_SOURCES) \ + $(tls_prf_SOURCES) $(tlsexttest_SOURCES) $(tlstest_SOURCES) \ + $(utf8test_SOURCES) $(valid_handshakes_terminate_SOURCES) \ + $(verifytest_SOURCES) $(x25519test_SOURCES) \ + $(x509name_SOURCES) DIST_SOURCES = $(aeadtest_SOURCES) $(aes_wrap_SOURCES) \ - $(am__arc4randomforktest_SOURCES_DIST) $(asn1test_SOURCES) \ - $(asn1time_SOURCES) $(base64test_SOURCES) $(bftest_SOURCES) \ - $(am__biotest_SOURCES_DIST) $(bntest_SOURCES) \ + $(am__arc4randomforktest_SOURCES_DIST) $(asn1evp_SOURCES) \ + $(asn1test_SOURCES) $(asn1time_SOURCES) $(base64test_SOURCES) \ + $(bftest_SOURCES) $(am__biotest_SOURCES_DIST) \ + $(bn_rand_interval_SOURCES) $(bnaddsub_SOURCES) \ + $(bntest_SOURCES) $(buffertest_SOURCES) \ $(bytestringtest_SOURCES) $(casttest_SOURCES) \ $(chachatest_SOURCES) $(cipher_list_SOURCES) \ $(cipherstest_SOURCES) $(clienttest_SOURCES) \ - $(cts128test_SOURCES) $(destest_SOURCES) $(dhtest_SOURCES) \ - $(dsatest_SOURCES) $(ecdhtest_SOURCES) $(ecdsatest_SOURCES) \ - $(ectest_SOURCES) $(enginetest_SOURCES) $(evptest_SOURCES) \ - $(am__explicit_bzero_SOURCES_DIST) $(exptest_SOURCES) \ - $(freenull_SOURCES) $(gcm128test_SOURCES) \ - $(gost2814789t_SOURCES) $(hkdftest_SOURCES) \ - $(hmactest_SOURCES) $(ideatest_SOURCES) $(igetest_SOURCES) \ - $(md4test_SOURCES) $(md5test_SOURCES) $(mont_SOURCES) \ - $(am__ocsp_test_SOURCES_DIST) $(optionstest_SOURCES) \ - $(pbkdf2_SOURCES) $(am__pidwraptest_SOURCES_DIST) \ - $(pkcs7test_SOURCES) $(poly1305test_SOURCES) \ - $(pq_test_SOURCES) $(randtest_SOURCES) $(rc2test_SOURCES) \ - $(rc4test_SOURCES) $(rfc5280time_SOURCES) $(rmdtest_SOURCES) \ - $(rsa_test_SOURCES) $(servertest_SOURCES) $(sha1test_SOURCES) \ - $(sha256test_SOURCES) $(sha512test_SOURCES) \ - $(ssl_versions_SOURCES) $(ssltest_SOURCES) \ + $(configtest_SOURCES) $(cts128test_SOURCES) $(destest_SOURCES) \ + $(dhtest_SOURCES) $(dsatest_SOURCES) $(ecdhtest_SOURCES) \ + $(ecdsatest_SOURCES) $(ectest_SOURCES) $(enginetest_SOURCES) \ + $(evptest_SOURCES) $(am__explicit_bzero_SOURCES_DIST) \ + $(exptest_SOURCES) $(freenull_SOURCES) $(gcm128test_SOURCES) \ + $(gost2814789t_SOURCES) $(handshake_table_SOURCES) \ + $(hkdftest_SOURCES) $(hmactest_SOURCES) $(ideatest_SOURCES) \ + $(igetest_SOURCES) $(key_schedule_SOURCES) \ + $(keypairtest_SOURCES) $(md4test_SOURCES) $(md5test_SOURCES) \ + $(mont_SOURCES) $(am__ocsp_test_SOURCES_DIST) \ + $(optionstest_SOURCES) $(pbkdf2_SOURCES) \ + $(am__pidwraptest_SOURCES_DIST) $(pkcs7test_SOURCES) \ + $(poly1305test_SOURCES) $(pq_test_SOURCES) $(randtest_SOURCES) \ + $(rc2test_SOURCES) $(rc4test_SOURCES) $(recordtest_SOURCES) \ + $(rfc5280time_SOURCES) $(rmdtest_SOURCES) $(rsa_test_SOURCES) \ + $(servertest_SOURCES) $(sha1test_SOURCES) \ + $(sha256test_SOURCES) $(sha512test_SOURCES) $(sm3test_SOURCES) \ + $(sm4test_SOURCES) $(ssl_versions_SOURCES) $(ssltest_SOURCES) \ $(timingsafe_SOURCES) $(tls_ext_alpn_SOURCES) \ $(tls_prf_SOURCES) $(tlsexttest_SOURCES) \ $(am__tlstest_SOURCES_DIST) $(utf8test_SOURCES) \ - $(verifytest_SOURCES) $(x25519test_SOURCES) + $(valid_handshakes_terminate_SOURCES) $(verifytest_SOURCES) \ + $(x25519test_SOURCES) $(x509name_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -1090,7 +1249,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/compat \ -DLIBRESSL_INTERNAL -D__BEGIN_HIDDEN_DECLS= \ -D__END_HIDDEN_DECLS= -I $(top_srcdir)/crypto/modes -I \ $(top_srcdir)/crypto/asn1 -I $(top_srcdir)/ssl -I \ - $(top_srcdir)/apps/openssl -I \ + $(top_srcdir)/tls -I $(top_srcdir)/apps/openssl -I \ $(top_srcdir)/apps/openssl/compat \ -D_PATH_SSL_CA_FILE=\"$(top_srcdir)/apps/openssl/cert.pem\" LDADD = $(abs_top_builddir)/tls/.libs/libtls.a \ @@ -1099,8 +1258,8 @@ LDADD = $(abs_top_builddir)/tls/.libs/libtls.a \ $(PROG_LDADD) $(am__append_1) TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh EXTRA_DIST = CMakeLists.txt aeadtest.sh aeadtests.txt \ - arc4randomforktest.sh evptest.sh evptests.txt ocsptest.sh \ - ocsptest.bat pidwraptest.sh pq_test.sh pq_test.bat \ + arc4randomforktest.sh evptest.sh evptests.txt keypairtest.sh \ + ocsptest.sh ocsptest.bat pidwraptest.sh pq_test.sh pq_test.bat \ pq_expected.txt rfc5280time_small.test servertest.sh \ servertest.bat ssltest.sh ssltest.bat testssl testssl.bat \ ca.pem server.pem testdsa.sh testdsa.bat openssl.cnf \ @@ -1110,13 +1269,18 @@ DISTCLEANFILES = pidwraptest.txt aeadtest_SOURCES = aeadtest.c aes_wrap_SOURCES = aes_wrap.c @HOST_WIN_FALSE@arc4randomforktest_SOURCES = arc4randomforktest.c +asn1evp_SOURCES = asn1evp.c asn1test_SOURCES = asn1test.c asn1time_SOURCES = asn1time.c base64test_SOURCES = base64test.c bftest_SOURCES = bftest.c @ENABLE_EXTRATESTS_TRUE@biotest_SOURCES = biotest.c +bnaddsub_SOURCES = bnaddsub.c +bn_rand_interval_SOURCES = bn_rand_interval.c bntest_CPPFLAGS = $(AM_CPPFLAGS) -ULIBRESSL_INTERNAL bntest_SOURCES = bntest.c +buffertest_CPPFLAGS = $(AM_CPPFLAGS) +buffertest_SOURCES = buffertest.c bytestringtest_SOURCES = bytestringtest.c casttest_SOURCES = casttest.c chachatest_SOURCES = chachatest.c @@ -1124,6 +1288,7 @@ cipher_list_SOURCES = cipher_list.c noinst_HEADERS = tests.h cipherstest_SOURCES = cipherstest.c clienttest_SOURCES = clienttest.c +configtest_SOURCES = configtest.c cts128test_SOURCES = cts128test.c destest_SOURCES = destest.c dhtest_SOURCES = dhtest.c @@ -1141,10 +1306,13 @@ exptest_SOURCES = exptest.c freenull_SOURCES = freenull.c gcm128test_SOURCES = gcm128test.c gost2814789t_SOURCES = gost2814789t.c +handshake_table_SOURCES = handshake_table.c hkdftest_SOURCES = hkdf_test.c hmactest_SOURCES = hmactest.c ideatest_SOURCES = ideatest.c igetest_SOURCES = igetest.c +keypairtest_SOURCES = keypairtest.c +key_schedule_SOURCES = key_schedule.c md4test_SOURCES = md4test.c md5test_SOURCES = md5test.c mont_SOURCES = mont.c @@ -1158,6 +1326,7 @@ pq_test_SOURCES = pq_test.c randtest_SOURCES = randtest.c rc2test_SOURCES = rc2test.c rc4test_SOURCES = rc4test.c +recordtest_SOURCES = recordtest.c rfc5280time_SOURCES = rfc5280time.c rmdtest_SOURCES = rmdtest.c rsa_test_SOURCES = rsa_test.c @@ -1165,6 +1334,8 @@ servertest_SOURCES = servertest.c sha1test_SOURCES = sha1test.c sha256test_SOURCES = sha256test.c sha512test_SOURCES = sha512test.c +sm3test_SOURCES = sm3test.c +sm4test_SOURCES = sm4test.c ssl_versions_SOURCES = ssl_versions.c ssltest_SOURCES = ssltest.c timingsafe_SOURCES = timingsafe.c @@ -1173,8 +1344,10 @@ tlstest_SOURCES = tlstest.c $(am__append_15) tls_ext_alpn_SOURCES = tls_ext_alpn.c tls_prf_SOURCES = tls_prf.c utf8test_SOURCES = utf8test.c +valid_handshakes_terminate_SOURCES = valid_handshakes_terminate.c verifytest_SOURCES = verifytest.c x25519test_SOURCES = x25519test.c +x509name_SOURCES = x509name.c all: all-am .SUFFIXES: @@ -1196,8 +1369,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/Makefile.am.common $(am__empty): @@ -1219,6 +1392,15 @@ clean-checkPROGRAMS: echo " rm -f" $$list; \ rm -f $$list +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + aeadtest$(EXEEXT): $(aeadtest_OBJECTS) $(aeadtest_DEPENDENCIES) $(EXTRA_aeadtest_DEPENDENCIES) @rm -f aeadtest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(aeadtest_OBJECTS) $(aeadtest_LDADD) $(LIBS) @@ -1231,6 +1413,10 @@ arc4randomforktest$(EXEEXT): $(arc4randomforktest_OBJECTS) $(arc4randomforktest_ @rm -f arc4randomforktest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(arc4randomforktest_OBJECTS) $(arc4randomforktest_LDADD) $(LIBS) +asn1evp$(EXEEXT): $(asn1evp_OBJECTS) $(asn1evp_DEPENDENCIES) $(EXTRA_asn1evp_DEPENDENCIES) + @rm -f asn1evp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(asn1evp_OBJECTS) $(asn1evp_LDADD) $(LIBS) + asn1test$(EXEEXT): $(asn1test_OBJECTS) $(asn1test_DEPENDENCIES) $(EXTRA_asn1test_DEPENDENCIES) @rm -f asn1test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(asn1test_OBJECTS) $(asn1test_LDADD) $(LIBS) @@ -1251,10 +1437,22 @@ biotest$(EXEEXT): $(biotest_OBJECTS) $(biotest_DEPENDENCIES) $(EXTRA_biotest_DEP @rm -f biotest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(biotest_OBJECTS) $(biotest_LDADD) $(LIBS) +bn_rand_interval$(EXEEXT): $(bn_rand_interval_OBJECTS) $(bn_rand_interval_DEPENDENCIES) $(EXTRA_bn_rand_interval_DEPENDENCIES) + @rm -f bn_rand_interval$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bn_rand_interval_OBJECTS) $(bn_rand_interval_LDADD) $(LIBS) + +bnaddsub$(EXEEXT): $(bnaddsub_OBJECTS) $(bnaddsub_DEPENDENCIES) $(EXTRA_bnaddsub_DEPENDENCIES) + @rm -f bnaddsub$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bnaddsub_OBJECTS) $(bnaddsub_LDADD) $(LIBS) + bntest$(EXEEXT): $(bntest_OBJECTS) $(bntest_DEPENDENCIES) $(EXTRA_bntest_DEPENDENCIES) @rm -f bntest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bntest_OBJECTS) $(bntest_LDADD) $(LIBS) +buffertest$(EXEEXT): $(buffertest_OBJECTS) $(buffertest_DEPENDENCIES) $(EXTRA_buffertest_DEPENDENCIES) + @rm -f buffertest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(buffertest_OBJECTS) $(buffertest_LDADD) $(LIBS) + bytestringtest$(EXEEXT): $(bytestringtest_OBJECTS) $(bytestringtest_DEPENDENCIES) $(EXTRA_bytestringtest_DEPENDENCIES) @rm -f bytestringtest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bytestringtest_OBJECTS) $(bytestringtest_LDADD) $(LIBS) @@ -1279,6 +1477,10 @@ clienttest$(EXEEXT): $(clienttest_OBJECTS) $(clienttest_DEPENDENCIES) $(EXTRA_cl @rm -f clienttest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(clienttest_OBJECTS) $(clienttest_LDADD) $(LIBS) +configtest$(EXEEXT): $(configtest_OBJECTS) $(configtest_DEPENDENCIES) $(EXTRA_configtest_DEPENDENCIES) + @rm -f configtest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(configtest_OBJECTS) $(configtest_LDADD) $(LIBS) + cts128test$(EXEEXT): $(cts128test_OBJECTS) $(cts128test_DEPENDENCIES) $(EXTRA_cts128test_DEPENDENCIES) @rm -f cts128test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cts128test_OBJECTS) $(cts128test_LDADD) $(LIBS) @@ -1343,6 +1545,10 @@ gost2814789t$(EXEEXT): $(gost2814789t_OBJECTS) $(gost2814789t_DEPENDENCIES) $(EX @rm -f gost2814789t$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gost2814789t_OBJECTS) $(gost2814789t_LDADD) $(LIBS) +handshake_table$(EXEEXT): $(handshake_table_OBJECTS) $(handshake_table_DEPENDENCIES) $(EXTRA_handshake_table_DEPENDENCIES) + @rm -f handshake_table$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(handshake_table_OBJECTS) $(handshake_table_LDADD) $(LIBS) + hkdftest$(EXEEXT): $(hkdftest_OBJECTS) $(hkdftest_DEPENDENCIES) $(EXTRA_hkdftest_DEPENDENCIES) @rm -f hkdftest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(hkdftest_OBJECTS) $(hkdftest_LDADD) $(LIBS) @@ -1359,6 +1565,14 @@ igetest$(EXEEXT): $(igetest_OBJECTS) $(igetest_DEPENDENCIES) $(EXTRA_igetest_DEP @rm -f igetest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(igetest_OBJECTS) $(igetest_LDADD) $(LIBS) +key_schedule$(EXEEXT): $(key_schedule_OBJECTS) $(key_schedule_DEPENDENCIES) $(EXTRA_key_schedule_DEPENDENCIES) + @rm -f key_schedule$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(key_schedule_OBJECTS) $(key_schedule_LDADD) $(LIBS) + +keypairtest$(EXEEXT): $(keypairtest_OBJECTS) $(keypairtest_DEPENDENCIES) $(EXTRA_keypairtest_DEPENDENCIES) + @rm -f keypairtest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keypairtest_OBJECTS) $(keypairtest_LDADD) $(LIBS) + md4test$(EXEEXT): $(md4test_OBJECTS) $(md4test_DEPENDENCIES) $(EXTRA_md4test_DEPENDENCIES) @rm -f md4test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(md4test_OBJECTS) $(md4test_LDADD) $(LIBS) @@ -1411,6 +1625,10 @@ rc4test$(EXEEXT): $(rc4test_OBJECTS) $(rc4test_DEPENDENCIES) $(EXTRA_rc4test_DEP @rm -f rc4test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rc4test_OBJECTS) $(rc4test_LDADD) $(LIBS) +recordtest$(EXEEXT): $(recordtest_OBJECTS) $(recordtest_DEPENDENCIES) $(EXTRA_recordtest_DEPENDENCIES) + @rm -f recordtest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(recordtest_OBJECTS) $(recordtest_LDADD) $(LIBS) + rfc5280time$(EXEEXT): $(rfc5280time_OBJECTS) $(rfc5280time_DEPENDENCIES) $(EXTRA_rfc5280time_DEPENDENCIES) @rm -f rfc5280time$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rfc5280time_OBJECTS) $(rfc5280time_LDADD) $(LIBS) @@ -1439,6 +1657,14 @@ sha512test$(EXEEXT): $(sha512test_OBJECTS) $(sha512test_DEPENDENCIES) $(EXTRA_sh @rm -f sha512test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sha512test_OBJECTS) $(sha512test_LDADD) $(LIBS) +sm3test$(EXEEXT): $(sm3test_OBJECTS) $(sm3test_DEPENDENCIES) $(EXTRA_sm3test_DEPENDENCIES) + @rm -f sm3test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sm3test_OBJECTS) $(sm3test_LDADD) $(LIBS) + +sm4test$(EXEEXT): $(sm4test_OBJECTS) $(sm4test_DEPENDENCIES) $(EXTRA_sm4test_DEPENDENCIES) + @rm -f sm4test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sm4test_OBJECTS) $(sm4test_LDADD) $(LIBS) + ssl_versions$(EXEEXT): $(ssl_versions_OBJECTS) $(ssl_versions_DEPENDENCIES) $(EXTRA_ssl_versions_DEPENDENCIES) @rm -f ssl_versions$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ssl_versions_OBJECTS) $(ssl_versions_LDADD) $(LIBS) @@ -1473,6 +1699,10 @@ utf8test$(EXEEXT): $(utf8test_OBJECTS) $(utf8test_DEPENDENCIES) $(EXTRA_utf8test @rm -f utf8test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(utf8test_OBJECTS) $(utf8test_LDADD) $(LIBS) +valid_handshakes_terminate$(EXEEXT): $(valid_handshakes_terminate_OBJECTS) $(valid_handshakes_terminate_DEPENDENCIES) $(EXTRA_valid_handshakes_terminate_DEPENDENCIES) + @rm -f valid_handshakes_terminate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(valid_handshakes_terminate_OBJECTS) $(valid_handshakes_terminate_LDADD) $(LIBS) + verifytest$(EXEEXT): $(verifytest_OBJECTS) $(verifytest_DEPENDENCIES) $(EXTRA_verifytest_DEPENDENCIES) @rm -f verifytest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(verifytest_OBJECTS) $(verifytest_LDADD) $(LIBS) @@ -1481,6 +1711,10 @@ x25519test$(EXEEXT): $(x25519test_OBJECTS) $(x25519test_DEPENDENCIES) $(EXTRA_x2 @rm -f x25519test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(x25519test_OBJECTS) $(x25519test_LDADD) $(LIBS) +x509name$(EXEEXT): $(x509name_OBJECTS) $(x509name_DEPENDENCIES) $(EXTRA_x509name_DEPENDENCIES) + @rm -f x509name$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(x509name_OBJECTS) $(x509name_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f compat/*.$(OBJEXT) @@ -1488,71 +1722,90 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aeadtest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aes_wrap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arc4randomforktest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bftest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/biotest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bntest-bntest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bytestringtest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/casttest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chachatest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cipher_list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cipherstest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clienttest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cts128test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/destest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dhtest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsatest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecdhtest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecdsatest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ectest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enginetest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evptest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/explicit_bzero.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exptest-exptest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freenull.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gcm128test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gost2814789t.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hkdf_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hmactest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ideatest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igetest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md4test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mont.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocsp_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optionstest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbkdf2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pidwraptest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkcs7test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poly1305test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pq_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randtest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc2test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc4test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfc5280time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdtest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsa_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/servertest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha256test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha512test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_versions.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssltest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timingsafe.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls_ext_alpn.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls_prf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tlsexttest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tlstest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verifytest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x25519test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/memmem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/pipe2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aeadtest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aes_wrap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arc4randomforktest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1evp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bftest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/biotest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bn_rand_interval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bnaddsub.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bntest-bntest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffertest-buffertest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bytestringtest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/casttest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chachatest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cipher_list.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cipherstest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clienttest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/configtest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cts128test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/destest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dhtest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsatest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecdhtest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecdsatest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ectest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enginetest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evptest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exptest-exptest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freenull.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gcm128test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gost2814789t.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handshake_table.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hkdf_test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hmactest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ideatest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igetest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/key_schedule.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keypairtest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md4test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mont.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocsp_test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optionstest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbkdf2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pidwraptest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkcs7test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poly1305test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pq_test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randtest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc2test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc4test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recordtest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfc5280time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdtest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsa_test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/servertest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha256test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha512test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sm3test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sm4test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_versions.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssltest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timingsafe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls_ext_alpn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls_prf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tlsexttest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tlstest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/valid_handshakes_terminate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verifytest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x25519test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x509name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/memmem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -1592,6 +1845,20 @@ bntest-bntest.obj: bntest.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bntest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bntest-bntest.obj `if test -f 'bntest.c'; then $(CYGPATH_W) 'bntest.c'; else $(CYGPATH_W) '$(srcdir)/bntest.c'; fi` +buffertest-buffertest.o: buffertest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(buffertest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffertest-buffertest.o -MD -MP -MF $(DEPDIR)/buffertest-buffertest.Tpo -c -o buffertest-buffertest.o `test -f 'buffertest.c' || echo '$(srcdir)/'`buffertest.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/buffertest-buffertest.Tpo $(DEPDIR)/buffertest-buffertest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='buffertest.c' object='buffertest-buffertest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(buffertest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buffertest-buffertest.o `test -f 'buffertest.c' || echo '$(srcdir)/'`buffertest.c + +buffertest-buffertest.obj: buffertest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(buffertest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffertest-buffertest.obj -MD -MP -MF $(DEPDIR)/buffertest-buffertest.Tpo -c -o buffertest-buffertest.obj `if test -f 'buffertest.c'; then $(CYGPATH_W) 'buffertest.c'; else $(CYGPATH_W) '$(srcdir)/buffertest.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/buffertest-buffertest.Tpo $(DEPDIR)/buffertest-buffertest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='buffertest.c' object='buffertest-buffertest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(buffertest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buffertest-buffertest.obj `if test -f 'buffertest.c'; then $(CYGPATH_W) 'buffertest.c'; else $(CYGPATH_W) '$(srcdir)/buffertest.c'; fi` + exptest-exptest.o: exptest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(exptest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT exptest-exptest.o -MD -MP -MF $(DEPDIR)/exptest-exptest.Tpo -c -o exptest-exptest.o `test -f 'exptest.c' || echo '$(srcdir)/'`exptest.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/exptest-exptest.Tpo $(DEPDIR)/exptest-exptest.Po @@ -1784,7 +2051,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) fi; \ $$success || exit 1 -check-TESTS: +check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @@ -1826,6 +2093,13 @@ arc4randomforktest.sh.log: arc4randomforktest.sh --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +asn1evp.log: asn1evp$(EXEEXT) + @p='asn1evp$(EXEEXT)'; \ + b='asn1evp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) asn1test.log: asn1test$(EXEEXT) @p='asn1test$(EXEEXT)'; \ b='asn1test'; \ @@ -1861,6 +2135,20 @@ biotest.log: biotest$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +bnaddsub.log: bnaddsub$(EXEEXT) + @p='bnaddsub$(EXEEXT)'; \ + b='bnaddsub'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +bn_rand_interval.log: bn_rand_interval$(EXEEXT) + @p='bn_rand_interval$(EXEEXT)'; \ + b='bn_rand_interval'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) bntest.log: bntest$(EXEEXT) @p='bntest$(EXEEXT)'; \ b='bntest'; \ @@ -1868,6 +2156,13 @@ bntest.log: bntest$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +buffertest.log: buffertest$(EXEEXT) + @p='buffertest$(EXEEXT)'; \ + b='buffertest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) bytestringtest.log: bytestringtest$(EXEEXT) @p='bytestringtest$(EXEEXT)'; \ b='bytestringtest'; \ @@ -1910,6 +2205,13 @@ clienttest.log: clienttest$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +configtest.log: configtest$(EXEEXT) + @p='configtest$(EXEEXT)'; \ + b='configtest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) cts128test.log: cts128test$(EXEEXT) @p='cts128test$(EXEEXT)'; \ b='cts128test'; \ @@ -2036,6 +2338,20 @@ igetest.log: igetest$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +keypairtest.sh.log: keypairtest.sh + @p='keypairtest.sh'; \ + b='keypairtest.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +key_schedule.log: key_schedule$(EXEEXT) + @p='key_schedule$(EXEEXT)'; \ + b='key_schedule'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) md4test.log: md4test$(EXEEXT) @p='md4test$(EXEEXT)'; \ b='md4test'; \ @@ -2127,6 +2443,13 @@ rc4test.log: rc4test$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +recordtest.log: recordtest$(EXEEXT) + @p='recordtest$(EXEEXT)'; \ + b='recordtest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) rfc5280time.log: rfc5280time$(EXEEXT) @p='rfc5280time$(EXEEXT)'; \ b='rfc5280time'; \ @@ -2176,6 +2499,20 @@ sha512test.log: sha512test$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +sm3test.log: sm3test$(EXEEXT) + @p='sm3test$(EXEEXT)'; \ + b='sm3test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +sm4test.log: sm4test$(EXEEXT) + @p='sm4test$(EXEEXT)'; \ + b='sm4test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) ssl_versions.log: ssl_versions$(EXEEXT) @p='ssl_versions$(EXEEXT)'; \ b='ssl_versions'; \ @@ -2253,6 +2590,13 @@ utf8test.log: utf8test$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +valid_handshakes_terminate.log: valid_handshakes_terminate$(EXEEXT) + @p='valid_handshakes_terminate$(EXEEXT)'; \ + b='valid_handshakes_terminate'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) verifytest.log: verifytest$(EXEEXT) @p='verifytest$(EXEEXT)'; \ b='verifytest'; \ @@ -2267,6 +2611,13 @@ x25519test.log: x25519test$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +x509name.log: x509name$(EXEEXT) + @p='x509name$(EXEEXT)'; \ + b='x509name'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ @@ -2282,7 +2633,10 @@ x25519test.log: x25519test$(EXEEXT) @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -2316,7 +2670,7 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(HEADERS) +all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am @@ -2357,10 +2711,87 @@ maintainer-clean-generic: clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ - mostlyclean-am + clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) compat/$(DEPDIR) + -rm -f ./$(DEPDIR)/aeadtest.Po + -rm -f ./$(DEPDIR)/aes_wrap.Po + -rm -f ./$(DEPDIR)/arc4randomforktest.Po + -rm -f ./$(DEPDIR)/asn1evp.Po + -rm -f ./$(DEPDIR)/asn1test.Po + -rm -f ./$(DEPDIR)/asn1time.Po + -rm -f ./$(DEPDIR)/base64test.Po + -rm -f ./$(DEPDIR)/bftest.Po + -rm -f ./$(DEPDIR)/biotest.Po + -rm -f ./$(DEPDIR)/bn_rand_interval.Po + -rm -f ./$(DEPDIR)/bnaddsub.Po + -rm -f ./$(DEPDIR)/bntest-bntest.Po + -rm -f ./$(DEPDIR)/buffertest-buffertest.Po + -rm -f ./$(DEPDIR)/bytestringtest.Po + -rm -f ./$(DEPDIR)/casttest.Po + -rm -f ./$(DEPDIR)/chachatest.Po + -rm -f ./$(DEPDIR)/cipher_list.Po + -rm -f ./$(DEPDIR)/cipherstest.Po + -rm -f ./$(DEPDIR)/clienttest.Po + -rm -f ./$(DEPDIR)/configtest.Po + -rm -f ./$(DEPDIR)/cts128test.Po + -rm -f ./$(DEPDIR)/destest.Po + -rm -f ./$(DEPDIR)/dhtest.Po + -rm -f ./$(DEPDIR)/dsatest.Po + -rm -f ./$(DEPDIR)/ecdhtest.Po + -rm -f ./$(DEPDIR)/ecdsatest.Po + -rm -f ./$(DEPDIR)/ectest.Po + -rm -f ./$(DEPDIR)/enginetest.Po + -rm -f ./$(DEPDIR)/evptest.Po + -rm -f ./$(DEPDIR)/explicit_bzero.Po + -rm -f ./$(DEPDIR)/exptest-exptest.Po + -rm -f ./$(DEPDIR)/freenull.Po + -rm -f ./$(DEPDIR)/gcm128test.Po + -rm -f ./$(DEPDIR)/gost2814789t.Po + -rm -f ./$(DEPDIR)/handshake_table.Po + -rm -f ./$(DEPDIR)/hkdf_test.Po + -rm -f ./$(DEPDIR)/hmactest.Po + -rm -f ./$(DEPDIR)/ideatest.Po + -rm -f ./$(DEPDIR)/igetest.Po + -rm -f ./$(DEPDIR)/key_schedule.Po + -rm -f ./$(DEPDIR)/keypairtest.Po + -rm -f ./$(DEPDIR)/md4test.Po + -rm -f ./$(DEPDIR)/md5test.Po + -rm -f ./$(DEPDIR)/mont.Po + -rm -f ./$(DEPDIR)/ocsp_test.Po + -rm -f ./$(DEPDIR)/optionstest.Po + -rm -f ./$(DEPDIR)/pbkdf2.Po + -rm -f ./$(DEPDIR)/pidwraptest.Po + -rm -f ./$(DEPDIR)/pkcs7test.Po + -rm -f ./$(DEPDIR)/poly1305test.Po + -rm -f ./$(DEPDIR)/pq_test.Po + -rm -f ./$(DEPDIR)/randtest.Po + -rm -f ./$(DEPDIR)/rc2test.Po + -rm -f ./$(DEPDIR)/rc4test.Po + -rm -f ./$(DEPDIR)/recordtest.Po + -rm -f ./$(DEPDIR)/rfc5280time.Po + -rm -f ./$(DEPDIR)/rmdtest.Po + -rm -f ./$(DEPDIR)/rsa_test.Po + -rm -f ./$(DEPDIR)/servertest.Po + -rm -f ./$(DEPDIR)/sha1test.Po + -rm -f ./$(DEPDIR)/sha256test.Po + -rm -f ./$(DEPDIR)/sha512test.Po + -rm -f ./$(DEPDIR)/sm3test.Po + -rm -f ./$(DEPDIR)/sm4test.Po + -rm -f ./$(DEPDIR)/ssl_versions.Po + -rm -f ./$(DEPDIR)/ssltest.Po + -rm -f ./$(DEPDIR)/timingsafe.Po + -rm -f ./$(DEPDIR)/tls_ext_alpn.Po + -rm -f ./$(DEPDIR)/tls_prf.Po + -rm -f ./$(DEPDIR)/tlsexttest.Po + -rm -f ./$(DEPDIR)/tlstest.Po + -rm -f ./$(DEPDIR)/utf8test.Po + -rm -f ./$(DEPDIR)/valid_handshakes_terminate.Po + -rm -f ./$(DEPDIR)/verifytest.Po + -rm -f ./$(DEPDIR)/x25519test.Po + -rm -f ./$(DEPDIR)/x509name.Po + -rm -f compat/$(DEPDIR)/memmem.Po + -rm -f compat/$(DEPDIR)/pipe2.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -2406,7 +2837,84 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) compat/$(DEPDIR) + -rm -f ./$(DEPDIR)/aeadtest.Po + -rm -f ./$(DEPDIR)/aes_wrap.Po + -rm -f ./$(DEPDIR)/arc4randomforktest.Po + -rm -f ./$(DEPDIR)/asn1evp.Po + -rm -f ./$(DEPDIR)/asn1test.Po + -rm -f ./$(DEPDIR)/asn1time.Po + -rm -f ./$(DEPDIR)/base64test.Po + -rm -f ./$(DEPDIR)/bftest.Po + -rm -f ./$(DEPDIR)/biotest.Po + -rm -f ./$(DEPDIR)/bn_rand_interval.Po + -rm -f ./$(DEPDIR)/bnaddsub.Po + -rm -f ./$(DEPDIR)/bntest-bntest.Po + -rm -f ./$(DEPDIR)/buffertest-buffertest.Po + -rm -f ./$(DEPDIR)/bytestringtest.Po + -rm -f ./$(DEPDIR)/casttest.Po + -rm -f ./$(DEPDIR)/chachatest.Po + -rm -f ./$(DEPDIR)/cipher_list.Po + -rm -f ./$(DEPDIR)/cipherstest.Po + -rm -f ./$(DEPDIR)/clienttest.Po + -rm -f ./$(DEPDIR)/configtest.Po + -rm -f ./$(DEPDIR)/cts128test.Po + -rm -f ./$(DEPDIR)/destest.Po + -rm -f ./$(DEPDIR)/dhtest.Po + -rm -f ./$(DEPDIR)/dsatest.Po + -rm -f ./$(DEPDIR)/ecdhtest.Po + -rm -f ./$(DEPDIR)/ecdsatest.Po + -rm -f ./$(DEPDIR)/ectest.Po + -rm -f ./$(DEPDIR)/enginetest.Po + -rm -f ./$(DEPDIR)/evptest.Po + -rm -f ./$(DEPDIR)/explicit_bzero.Po + -rm -f ./$(DEPDIR)/exptest-exptest.Po + -rm -f ./$(DEPDIR)/freenull.Po + -rm -f ./$(DEPDIR)/gcm128test.Po + -rm -f ./$(DEPDIR)/gost2814789t.Po + -rm -f ./$(DEPDIR)/handshake_table.Po + -rm -f ./$(DEPDIR)/hkdf_test.Po + -rm -f ./$(DEPDIR)/hmactest.Po + -rm -f ./$(DEPDIR)/ideatest.Po + -rm -f ./$(DEPDIR)/igetest.Po + -rm -f ./$(DEPDIR)/key_schedule.Po + -rm -f ./$(DEPDIR)/keypairtest.Po + -rm -f ./$(DEPDIR)/md4test.Po + -rm -f ./$(DEPDIR)/md5test.Po + -rm -f ./$(DEPDIR)/mont.Po + -rm -f ./$(DEPDIR)/ocsp_test.Po + -rm -f ./$(DEPDIR)/optionstest.Po + -rm -f ./$(DEPDIR)/pbkdf2.Po + -rm -f ./$(DEPDIR)/pidwraptest.Po + -rm -f ./$(DEPDIR)/pkcs7test.Po + -rm -f ./$(DEPDIR)/poly1305test.Po + -rm -f ./$(DEPDIR)/pq_test.Po + -rm -f ./$(DEPDIR)/randtest.Po + -rm -f ./$(DEPDIR)/rc2test.Po + -rm -f ./$(DEPDIR)/rc4test.Po + -rm -f ./$(DEPDIR)/recordtest.Po + -rm -f ./$(DEPDIR)/rfc5280time.Po + -rm -f ./$(DEPDIR)/rmdtest.Po + -rm -f ./$(DEPDIR)/rsa_test.Po + -rm -f ./$(DEPDIR)/servertest.Po + -rm -f ./$(DEPDIR)/sha1test.Po + -rm -f ./$(DEPDIR)/sha256test.Po + -rm -f ./$(DEPDIR)/sha512test.Po + -rm -f ./$(DEPDIR)/sm3test.Po + -rm -f ./$(DEPDIR)/sm4test.Po + -rm -f ./$(DEPDIR)/ssl_versions.Po + -rm -f ./$(DEPDIR)/ssltest.Po + -rm -f ./$(DEPDIR)/timingsafe.Po + -rm -f ./$(DEPDIR)/tls_ext_alpn.Po + -rm -f ./$(DEPDIR)/tls_prf.Po + -rm -f ./$(DEPDIR)/tlsexttest.Po + -rm -f ./$(DEPDIR)/tlstest.Po + -rm -f ./$(DEPDIR)/utf8test.Po + -rm -f ./$(DEPDIR)/valid_handshakes_terminate.Po + -rm -f ./$(DEPDIR)/verifytest.Po + -rm -f ./$(DEPDIR)/x25519test.Po + -rm -f ./$(DEPDIR)/x509name.Po + -rm -f compat/$(DEPDIR)/memmem.Po + -rm -f compat/$(DEPDIR)/pipe2.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -2427,19 +2935,20 @@ uninstall-am: .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - recheck tags tags-am uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am recheck tags tags-am uninstall \ + uninstall-am .PRECIOUS: Makefile diff --git a/tests/aeadtest.c b/tests/aeadtest.c index 712ff5ca..ed0c6898 100644 --- a/tests/aeadtest.c +++ b/tests/aeadtest.c @@ -1,3 +1,4 @@ +/* $OpenBSD: aeadtest.c,v 1.12 2019/01/22 00:59:21 dlg Exp $ */ /* ==================================================================== * Copyright (c) 2011-2013 The OpenSSL Project. All rights reserved. * @@ -51,8 +52,11 @@ #include #include #include +#include +#include #include +#include /* This program tests an AEAD against a series of test vectors from a file. The * test vector file consists of key-value lines where the key and value are @@ -139,6 +143,12 @@ aead_from_name(const EVP_AEAD **aead, const char *name) *aead = EVP_aead_chacha20_poly1305(); #else fprintf(stderr, "No chacha20-poly1305 support.\n"); +#endif + } else if (strcmp(name, "xchacha20-poly1305") == 0) { +#if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305) + *aead = EVP_aead_xchacha20_poly1305(); +#else + fprintf(stderr, "No xchacha20-poly1305 support.\n"); #endif } else { fprintf(stderr, "Unknown AEAD: %s\n", name); diff --git a/tests/aeadtests.txt b/tests/aeadtests.txt index 3a3420a5..4ca47303 100644 --- a/tests/aeadtests.txt +++ b/tests/aeadtests.txt @@ -1,3 +1,4 @@ +# $OpenBSD: aeadtests.txt,v 1.8 2019/01/22 00:59:21 dlg Exp $ # # MACsec GCM-AES Test Vectors (bn-randall-test-vectors-0511-v1.pdf) # @@ -74,3 +75,12 @@ AD: c0c1c2c3c4c5c6c7d0d1d2d3d4d5d6d72e202500000000090000004529000029 CT: 610394701f8d017f7c12924889 TAG: 6b71bfe25236efd7cdc67066906315b2 +# Test vector from draft-arciszewski-xchacha-02 +AEAD: xchacha20-poly1305 +KEY: 808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f +NONCE: 404142434445464748494a4b4c4d4e4f5051525354555657 +IN: 4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e +AD: 50515253c0c1c2c3c4c5c6c7 +CT: bd6d179d3e83d43b9576579493c0e939572a1700252bfaccbed2902c21396cbb731c7f1b0b4aa6440bf3a82f4eda7e39ae64c6708c54c216cb96b72e1213b4522f8c9ba40db5d945b11b69b982c1bb9e3f3fac2bc369488f76b2383565d3fff921f9664c97637da9768812f615c68b13b52e +TAG: c0875924c1c7987947deafd8780acf49 + diff --git a/tests/aes_wrap.c b/tests/aes_wrap.c index 292ce5e8..b48c7ae6 100644 --- a/tests/aes_wrap.c +++ b/tests/aes_wrap.c @@ -1,4 +1,4 @@ -/* crypto/aes/aes_wrap.c */ +/* $OpenBSD: aes_wrap.c,v 1.4 2018/07/17 17:06:49 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ diff --git a/tests/asn1evp.c b/tests/asn1evp.c new file mode 100644 index 00000000..64a3becc --- /dev/null +++ b/tests/asn1evp.c @@ -0,0 +1,150 @@ +/* $OpenBSD: asn1evp.c,v 1.3 2018/11/08 21:37:21 jsing Exp $ */ +/* + * Copyright (c) 2017 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +#include + +#define TEST_NUM 0x7fffffffL + +unsigned char asn1_atios[] = { + 0x30, 0x10, 0x02, 0x04, 0x7f, 0xff, 0xff, 0xff, + 0x04, 0x08, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, + 0x06, 0x07, +}; + +unsigned char test_octetstring[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, +}; + +static void +hexdump(const unsigned char *buf, size_t len) +{ + size_t i; + + for (i = 1; i <= len; i++) + fprintf(stderr, " 0x%02hhx,%s", buf[i - 1], i % 8 ? "" : "\n"); + + fprintf(stderr, "\n"); +} + +static int +compare_data(const char *label, const unsigned char *d1, size_t d1_len, + const unsigned char *d2, size_t d2_len) +{ + if (d1_len != d2_len) { + fprintf(stderr, "FAIL: got %s with length %zu, want %zu\n", + label, d1_len, d2_len); + return -1; + } + if (memcmp(d1, d2, d1_len) != 0) { + fprintf(stderr, "FAIL: %s differs\n", label); + fprintf(stderr, "got:\n"); + hexdump(d1, d1_len); + fprintf(stderr, "want:\n"); + hexdump(d2, d2_len); + return -1; + } + return 0; +} + +int +main(int argc, char **argv) +{ + unsigned char data[16]; + long num = TEST_NUM; + ASN1_TYPE *at = NULL; + int failed = 1; + int len; + + if ((at = ASN1_TYPE_new()) == NULL) { + fprintf(stderr, "FAIL: ASN1_TYPE_new returned NULL\n"); + goto done; + } + + if (!ASN1_TYPE_set_int_octetstring(at, num, test_octetstring, + sizeof(test_octetstring))) { + fprintf(stderr, "FAIL: ASN1_TYPE_set_int_octetstring failed\n"); + goto done; + } + if (at->type != V_ASN1_SEQUENCE) { + fprintf(stderr, "FAIL: not a V_ASN1_SEQUENCE (%i != %i)\n", + at->type, V_ASN1_SEQUENCE); + goto done; + } + if (at->value.sequence->type != V_ASN1_OCTET_STRING) { + fprintf(stderr, "FAIL: not a V_ASN1_OCTET_STRING (%i != %i)\n", + at->type, V_ASN1_OCTET_STRING); + goto done; + } + if (compare_data("sequence", at->value.sequence->data, + at->value.sequence->length, asn1_atios, sizeof(asn1_atios)) == -1) + goto done; + + memset(&data, 0, sizeof(data)); + num = 0; + + if ((len = ASN1_TYPE_get_int_octetstring(at, &num, data, + sizeof(data))) < 0) { + fprintf(stderr, "FAIL: ASN1_TYPE_get_int_octetstring failed\n"); + goto done; + } + if (num != TEST_NUM) { + fprintf(stderr, "FAIL: got num %li, want %li\n", num, TEST_NUM); + goto done; + } + if (compare_data("octet string", data, len, + test_octetstring, sizeof(test_octetstring)) == -1) + goto done; + if (data[len] != 0) { + fprintf(stderr, "FAIL: octet string overflowed buffer\n"); + goto done; + } + + memset(&data, 0, sizeof(data)); + num = 0; + + /* With a limit buffer, the output should be truncated... */ + if ((len = ASN1_TYPE_get_int_octetstring(at, &num, data, 4)) < 0) { + fprintf(stderr, "FAIL: ASN1_TYPE_get_int_octetstring failed\n"); + goto done; + } + if (num != TEST_NUM) { + fprintf(stderr, "FAIL: got num %li, want %li\n", num, TEST_NUM); + goto done; + } + if (len != sizeof(test_octetstring)) { + fprintf(stderr, "FAIL: got length mismatch (%i != %zu)\n", + len, sizeof(test_octetstring)); + goto done; + } + if (compare_data("octet string", data, 4, test_octetstring, 4) == -1) + goto done; + if (data[4] != 0) { + fprintf(stderr, "FAIL: octet string overflowed buffer\n"); + goto done; + } + + failed = 0; + + done: + ASN1_TYPE_free(at); + + return failed; +} diff --git a/tests/base64test.c b/tests/base64test.c index ed494b6d..d6874d41 100644 --- a/tests/base64test.c +++ b/tests/base64test.c @@ -1,3 +1,4 @@ +/* $OpenBSD: base64test.c,v 1.5 2018/07/17 17:06:49 tb Exp $ */ /* * Copyright (c) 2014 Joel Sing * diff --git a/tests/bftest.c b/tests/bftest.c index f4d8aa0e..5239ffb2 100644 --- a/tests/bftest.c +++ b/tests/bftest.c @@ -1,4 +1,4 @@ -/* crypto/bf/bftest.c */ +/* $OpenBSD: bftest.c,v 1.3 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/bn_rand_interval.c b/tests/bn_rand_interval.c new file mode 100644 index 00000000..b8b84bd8 --- /dev/null +++ b/tests/bn_rand_interval.c @@ -0,0 +1,117 @@ +/* $OpenBSD: bn_rand_interval.c,v 1.3 2018/11/10 01:39:35 tb Exp $ */ +/* + * Copyright (c) 2018 Theo Buehler + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include + +#define NUM_TESTS 1000000 + +int bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_incl, + const BIGNUM *upper_excl); +void print_triple(BIGNUM *a, BIGNUM *b, BIGNUM *x); + +void +print_triple(BIGNUM *a, BIGNUM *b, BIGNUM *x) { + if (a != NULL) { + printf("a = "); + BN_print_fp(stdout, a); + printf("\n"); + } + + if (b != NULL) { + printf("b = "); + BN_print_fp(stdout, b); + printf("\n"); + } + + if (x != NULL) { + printf("x = "); + BN_print_fp(stdout, x); + printf("\n"); + } +} + +int +main(int argc, char *argv[]) +{ + BIGNUM *a, *b, *x; + int i, success = 1; + + if ((a = BN_new()) == NULL) + err(1, "BN_new(a)"); + if ((b = BN_new()) == NULL) + err(1, "BN_new(b)"); + if ((x = BN_new()) == NULL) + err(1, "BN_new(c)"); + + for (i = 0; i < NUM_TESTS; i++) { + if (!BN_rand(a, 256, 0, 0)) + err(1, "BN_rand(a)"); + + if (bn_rand_interval(x, a, a) != 0) { + success = 0; + + printf("bn_rand_interval(a == a) succeeded\n"); + print_triple(a, NULL, x); + } + + if (!BN_rand(b, 256, 0, 0)) + err(1, "BN_rand(b)"); + + switch(BN_cmp(a, b)) { + case 0: /* a == b */ + continue; + + case 1: /* a > b */ + BN_swap(a, b); + break; + + default: /* a < b */ + break; + } + + if (!bn_rand_interval(x, a, b)) + err(1, "bn_rand_interval() failed"); + + if (BN_cmp(x, a) < 0 || BN_cmp(x, b) >= 0) { + success = 0; + + printf("generated number x not inside [a,b)\n"); + print_triple(a, b, x); + } + + if (bn_rand_interval(x, b, a) != 0) { + success = 0; + + printf("bn_rand_interval(x, b, a) succeeded\n"); + print_triple(a, b, x); + } + } + + if (success == 1) + printf("success\n"); + else + printf("FAIL"); + + BN_free(a); + BN_free(b); + BN_free(x); + + return 1 - success; +} diff --git a/tests/bnaddsub.c b/tests/bnaddsub.c new file mode 100644 index 00000000..e23821ed --- /dev/null +++ b/tests/bnaddsub.c @@ -0,0 +1,236 @@ +/* $OpenBSD: bnaddsub.c,v 1.3 2018/07/23 17:15:21 tb Exp $ */ +/* + * Copyright (c) 2018 Theo Buehler + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* Test basic functionality of BN_add(), BN_sub(), BN_uadd() and BN_usub() */ + +#include +#include + +#include +#include +#include + +#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) + +BIO *bio_err; + +struct hexinput_st { + const char *a_hex; + const char *b_hex; + const char *e_hex; /* expected result */ + const char ret; /* check return value */ + int compare; /* use BN_cmp() to verify results */ +}; + +int bn_op_test(int (*)(BIGNUM *, const BIGNUM *, const BIGNUM *), + struct hexinput_st[], unsigned int, const char *); +void print_failure_case(BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, int, + const char *); + +struct hexinput_st test_bn_add[] = { + { + "F", + "F", + "1E", + 1, + 1, + }, + { + "FFFFFFFFFFFFFFFFFFF", + "1", + "10000000000000000000", + 1, + 1, + }, + { + "7878787878787878", + "1010101010101010", + "8888888888888888", + 1, + 1, + }, + { + "FFFFFFFFFFFFFFFF0000000000000000", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "1FFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", + 1, + 1, + }, + { + "F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0", + "10101010101010101010101010101010", + "101010101010101010101010101010100", + 1, + 1, + }, +}; + +struct hexinput_st test_bn_sub[] = { + { + "10", + "1", + "F", + 1, + 1, + }, + { + "10", + "1", + "E", + 1, + 0, + }, + { + "100000000001000000000", + "11100000001", + "FFFFFFFFFEFEFFFFFFFF", + 1, + 1, + }, + { + "-FFFFFFFFFFFFFFFFFFFF", + "1", + "-100000000000000000000", + 1, + 1, + }, +}; + +struct hexinput_st test_bn_usub[] = { + { + "10", + "1", + "F", + 1, + 1, + }, + { + "10", + "1", + "E", + 1, + 0, + }, + { + "100000000001000000000", + "11100000001", + "FFFFFFFFFEFEFFFFFFFF", + 1, + 1, + }, + { + "100000000000000000000", + "1", + "FFFFFFFFFFFFFFFFFFFF", + 1, + 1, + }, + { + "0", + "1", + "0", + 0, + 0, + }, +}; + +void +print_failure_case(BIGNUM *a, BIGNUM *b, BIGNUM *e, BIGNUM *r, int i, + const char *testname) +{ + BIO_printf(bio_err, "%s #%d failed:", testname, i); + BIO_printf(bio_err, "\na = "); + BN_print(bio_err, a); + BIO_printf(bio_err, "\nb = "); + BN_print(bio_err, b); + BIO_printf(bio_err, "\nexpected: e = "); + BN_print(bio_err, e); + BIO_printf(bio_err, "\nobtained: r = "); + BN_print(bio_err, r); + BIO_printf(bio_err, "\n"); +} + +int +bn_op_test(int (*bn_op)(BIGNUM *, const BIGNUM *, const BIGNUM *), + struct hexinput_st tests[], unsigned int ntests, const char *testname) +{ + BIGNUM *a = NULL, *b = NULL, *e = NULL, *r = NULL; + unsigned int i; + int failed = 0; + + if (((a = BN_new()) == NULL) || + ((b = BN_new()) == NULL) || + ((e = BN_new()) == NULL) || + ((r = BN_new()) == NULL)) { + failed = 1; + ERR_print_errors(bio_err); + goto err; + } + + for (i = 0; i < ntests; i++) { + int print = 0; + + if (!BN_hex2bn(&a, tests[i].a_hex) || + !BN_hex2bn(&b, tests[i].b_hex) || + !BN_hex2bn(&e, tests[i].e_hex)) { + print = 1; + ERR_print_errors(bio_err); + } + + if (tests[i].ret != bn_op(r, a, b)) + print = 1; + if (tests[i].compare == 1 && BN_cmp(e, r) != 0) + print = 1; + if (print) { + failed = 1; + print_failure_case(a, b, e, r, i, testname); + } + } + + err: + BN_free(a); + BN_free(b); + BN_free(e); + BN_free(r); + return failed; +} + +int +main(int argc, char *argv[]) +{ + int failed = 0; + + if ((bio_err = BIO_new_fp(stderr, BIO_NOCLOSE)) == NULL) { + fprintf(stderr, "bnaddsub: failed to initialize bio_err"); + return 1; + } + + if (bn_op_test(BN_add, test_bn_add, nitems(test_bn_add), + "BN_add with test_bn_add[]")) + failed = 1; + if (bn_op_test(BN_uadd, test_bn_add, nitems(test_bn_add), + "BN_uadd with test_bn_add[]")) + failed = 1; + if (bn_op_test(BN_sub, test_bn_sub, nitems(test_bn_sub), + "BN_sub with test_bn_sub[]")) + failed = 1; + if (bn_op_test(BN_usub, test_bn_usub, nitems(test_bn_usub), + "BN_usub with test_bn_usub[]")) + failed = 1; + + return failed; +} diff --git a/tests/bntest.c b/tests/bntest.c index 3cca951c..cff77606 100644 --- a/tests/bntest.c +++ b/tests/bntest.c @@ -1,4 +1,4 @@ -/* crypto/bn/bntest.c */ +/* $OpenBSD: bntest.c,v 1.20 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/buffertest.c b/tests/buffertest.c new file mode 100644 index 00000000..e627865e --- /dev/null +++ b/tests/buffertest.c @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2019 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include "tls13_internal.h" + +uint8_t testdata[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, +}; + +struct read_state { + uint8_t *buf; + size_t len; + size_t offset; +}; + +static ssize_t +read_cb(void *buf, size_t buflen, void *cb_arg) +{ + struct read_state *rs = cb_arg; + ssize_t n; + + if (rs->offset > rs->len) + return TLS13_IO_EOF; + + if ((size_t)(n = buflen) > (rs->len - rs->offset)) + n = rs->len - rs->offset; + + if (n == 0) + return TLS13_IO_WANT_POLLIN; + + memcpy(buf, &rs->buf[rs->offset], n); + rs->offset += n; + + return n; +} + +struct extend_test { + size_t extend_len; + size_t read_len; + ssize_t want_ret; +}; + +struct extend_test extend_tests[] = { + { + .extend_len = 4, + .read_len = 0, + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .extend_len = 4, + .read_len = 8, + .want_ret = 4, + }, + { + .extend_len = 12, + .read_len = 8, + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .extend_len = 12, + .read_len = 10, + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .extend_len = 12, + .read_len = 12, + .want_ret = 12, + }, + { + .extend_len = 16, + .read_len = 16, + .want_ret = 16, + }, + { + .extend_len = 20, + .read_len = 1, + .want_ret = TLS13_IO_EOF, + }, +}; + +#define N_EXTEND_TESTS (sizeof(extend_tests) / sizeof(extend_tests[0])) + +int +main(int argc, char **argv) +{ + struct tls13_buffer *buf; + struct extend_test *et; + struct read_state rs; + uint8_t *data; + size_t i, data_len; + ssize_t ret; + CBS cbs; + + rs.buf = testdata; + rs.offset = 0; + + if ((buf = tls13_buffer_new(0)) == NULL) + errx(1, "tls13_buffer_new"); + + for (i = 0; i < N_EXTEND_TESTS; i++) { + et = &extend_tests[i]; + rs.len = et->read_len; + + ret = tls13_buffer_extend(buf, et->extend_len, read_cb, &rs); + if (ret != extend_tests[i].want_ret) { + fprintf(stderr, "FAIL: Test %zi - extend returned %zi, " + "want %zi\n", i, ret, et->want_ret); + return 1; + } + + tls13_buffer_cbs(buf, &cbs); + + if (!CBS_mem_equal(&cbs, testdata, CBS_len(&cbs))) { + fprintf(stderr, "FAIL: Test %zi - extend buffer " + "mismatch", i); + return 1; + } + } + + if (!tls13_buffer_finish(buf, &data, &data_len)) { + fprintf(stderr, "FAIL: failed to finish\n"); + return 1; + } + + tls13_buffer_free(buf); + + if (data_len != sizeof(testdata)) { + fprintf(stderr, "FAIL: got data length %zu, want %zu\n", + data_len, sizeof(testdata)); + return 1; + } + if (memcmp(data, testdata, data_len) != 0) { + fprintf(stderr, "FAIL: data mismatch\n"); + return 1; + } + free(data); + + return 0; +} diff --git a/tests/bytestringtest.c b/tests/bytestringtest.c index 52752699..0e9f5f47 100644 --- a/tests/bytestringtest.c +++ b/tests/bytestringtest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bytestringtest.c,v 1.10 2015/10/25 20:15:06 doug Exp $ */ +/* $OpenBSD: bytestringtest.c,v 1.12 2018/08/16 18:40:19 jsing Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -268,7 +268,7 @@ test_get_optional_asn1_bool(void) static int test_cbb_basic(void) { - static const uint8_t kExpected[] = {1, 2, 3, 4, 5, 6, 7, 8}; + static const uint8_t kExpected[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; uint8_t *buf = NULL; size_t buf_len; int ret = 0; @@ -282,7 +282,8 @@ test_cbb_basic(void) CHECK_GOTO(CBB_add_u8(&cbb, 1)); CHECK_GOTO(CBB_add_u16(&cbb, 0x203)); CHECK_GOTO(CBB_add_u24(&cbb, 0x40506)); - CHECK_GOTO(CBB_add_bytes(&cbb, (const uint8_t*) "\x07\x08", 2)); + CHECK_GOTO(CBB_add_u32(&cbb, 0x708090a)); + CHECK_GOTO(CBB_add_bytes(&cbb, (const uint8_t*) "\x0b\x0c", 2)); CHECK_GOTO(CBB_finish(&cbb, &buf, &buf_len)); ret = (buf_len == sizeof(kExpected) @@ -350,9 +351,9 @@ test_cbb_prefixed(void) { static const uint8_t kExpected[] = {0, 1, 1, 0, 2, 2, 3, 0, 0, 3, 4, 5, 6, 5, 4, 1, 0, 1, 2}; + CBB cbb, contents, inner_contents, inner_inner_contents; uint8_t *buf = NULL; size_t buf_len; - CBB cbb, contents, inner_contents, inner_inner_contents; int ret = 0; CHECK(CBB_init(&cbb, 0)); @@ -382,6 +383,59 @@ test_cbb_prefixed(void) return ret; } +static int +test_cbb_discard_child(void) +{ + static const uint8_t kExpected[] = { + 0xaa, + 0, + 1, 0xbb, + 0, 2, 0xcc, 0xcc, + 0, 0, 3, 0xdd, 0xdd, 0xdd, + 1, 0xff, + }; + CBB cbb, contents, inner_contents, inner_inner_contents; + uint8_t *buf = NULL; + size_t buf_len; + int ret = 0; + + CHECK(CBB_init(&cbb, 0)); + CHECK_GOTO(CBB_add_u8(&cbb, 0xaa)); + + // Discarding |cbb|'s children preserves the byte written. + CBB_discard_child(&cbb); + + CHECK_GOTO(CBB_add_u8_length_prefixed(&cbb, &contents)); + CHECK_GOTO(CBB_add_u8_length_prefixed(&cbb, &contents)); + CHECK_GOTO(CBB_add_u8(&contents, 0xbb)); + CHECK_GOTO(CBB_add_u16_length_prefixed(&cbb, &contents)); + CHECK_GOTO(CBB_add_u16(&contents, 0xcccc)); + CHECK_GOTO(CBB_add_u24_length_prefixed(&cbb, &contents)); + CHECK_GOTO(CBB_add_u24(&contents, 0xdddddd)); + CHECK_GOTO(CBB_add_u8_length_prefixed(&cbb, &contents)); + CHECK_GOTO(CBB_add_u8(&contents, 0xff)); + CHECK_GOTO(CBB_add_u8_length_prefixed(&contents, &inner_contents)); + CHECK_GOTO(CBB_add_u8(&inner_contents, 0x42)); + CHECK_GOTO(CBB_add_u16_length_prefixed(&inner_contents, + &inner_inner_contents)); + CHECK_GOTO(CBB_add_u8(&inner_inner_contents, 0x99)); + + // Discard everything from |inner_contents| down. + CBB_discard_child(&contents); + + CHECK_GOTO(CBB_finish(&cbb, &buf, &buf_len)); + + ret = (buf_len == sizeof(kExpected) + && memcmp(buf, kExpected, buf_len) == 0); + + if (0) { +err: + CBB_cleanup(&cbb); + } + free(buf); + return ret; +} + static int test_cbb_misuse(void) { @@ -805,6 +859,7 @@ main(void) failed |= !test_cbb_basic(); failed |= !test_cbb_fixed(); failed |= !test_cbb_finish_child(); + failed |= !test_cbb_discard_child(); failed |= !test_cbb_misuse(); failed |= !test_cbb_prefixed(); failed |= !test_cbb_asn1(); diff --git a/tests/casttest.c b/tests/casttest.c index 77f8ed4b..81b878ee 100644 --- a/tests/casttest.c +++ b/tests/casttest.c @@ -1,4 +1,4 @@ -/* crypto/cast/casttest.c */ +/* $OpenBSD: casttest.c,v 1.2 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/chachatest.c b/tests/chachatest.c index bb2b54d1..4e159746 100644 --- a/tests/chachatest.c +++ b/tests/chachatest.c @@ -1,3 +1,4 @@ +/* $OpenBSD: chachatest.c,v 1.6 2019/01/22 00:59:21 dlg Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -291,6 +292,170 @@ struct chacha_test_function chacha_test_functions[] = { #define N_FUNCS (sizeof(chacha_test_functions) / sizeof(*chacha_test_functions)) +/* draft-arciszewski-xchacha-02 test vectors */ +static int +crypto_hchacha_20_test(void) +{ + static const unsigned char key[32] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f + }; + static const unsigned char nonce[16] = { + 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4a, + 0x00, 0x00, 0x00, 0x00, 0x31, 0x41, 0x59, 0x27, + }; + static const unsigned char result[32] = { + 0x82, 0x41, 0x3b, 0x42, 0x27, 0xb2, 0x7b, 0xfe, + 0xd3, 0x0e, 0x42, 0x50, 0x8a, 0x87, 0x7d, 0x73, + 0xa0, 0xf9, 0xe4, 0xd5, 0x8a, 0x74, 0xa8, 0x53, + 0xc1, 0x2e, 0xc4, 0x13, 0x26, 0xd3, 0xec, 0xdc, + }; + unsigned char out[32]; + int failed = 0; + size_t k; + + CRYPTO_hchacha_20(out, key, nonce); + + if (memcmp(out, result, sizeof(out)) != 0) { + printf("HChaCha20 failed!\n"); + + printf("Got:\t"); + for (k = 0; k < sizeof(out); k++) + printf("%2.2x", out[k]); + printf("\n"); + + printf("Want:\t"); + for (k = 0; k < sizeof(result); k++) + printf("%2.2x", result[k]); + printf("\n"); + + failed = 1; + } + + return (failed); +} + +static int +crypto_xchacha_20_test(void) +{ + static const unsigned char key[32] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + }; + static const unsigned char iv[24] = { + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x58 + }; + static const unsigned char plain[] = { + 0x54, 0x68, 0x65, 0x20, 0x64, 0x68, 0x6f, 0x6c, + 0x65, 0x20, 0x28, 0x70, 0x72, 0x6f, 0x6e, 0x6f, + 0x75, 0x6e, 0x63, 0x65, 0x64, 0x20, 0x22, 0x64, + 0x6f, 0x6c, 0x65, 0x22, 0x29, 0x20, 0x69, 0x73, + 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x6b, 0x6e, + 0x6f, 0x77, 0x6e, 0x20, 0x61, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x41, 0x73, 0x69, 0x61, 0x74, + 0x69, 0x63, 0x20, 0x77, 0x69, 0x6c, 0x64, 0x20, + 0x64, 0x6f, 0x67, 0x2c, 0x20, 0x72, 0x65, 0x64, + 0x20, 0x64, 0x6f, 0x67, 0x2c, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x77, 0x68, 0x69, 0x73, 0x74, 0x6c, + 0x69, 0x6e, 0x67, 0x20, 0x64, 0x6f, 0x67, 0x2e, + 0x20, 0x49, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, + 0x62, 0x6f, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6f, 0x66, + 0x20, 0x61, 0x20, 0x47, 0x65, 0x72, 0x6d, 0x61, + 0x6e, 0x20, 0x73, 0x68, 0x65, 0x70, 0x68, 0x65, + 0x72, 0x64, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6c, + 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x6d, 0x6f, 0x72, + 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x61, + 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x2d, 0x6c, 0x65, + 0x67, 0x67, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x78, + 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x68, + 0x69, 0x67, 0x68, 0x6c, 0x79, 0x20, 0x65, 0x6c, + 0x75, 0x73, 0x69, 0x76, 0x65, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x65, + 0x64, 0x20, 0x6a, 0x75, 0x6d, 0x70, 0x65, 0x72, + 0x20, 0x69, 0x73, 0x20, 0x63, 0x6c, 0x61, 0x73, + 0x73, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x77, + 0x69, 0x74, 0x68, 0x20, 0x77, 0x6f, 0x6c, 0x76, + 0x65, 0x73, 0x2c, 0x20, 0x63, 0x6f, 0x79, 0x6f, + 0x74, 0x65, 0x73, 0x2c, 0x20, 0x6a, 0x61, 0x63, + 0x6b, 0x61, 0x6c, 0x73, 0x2c, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x66, 0x6f, 0x78, 0x65, 0x73, 0x20, + 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, + 0x61, 0x78, 0x6f, 0x6e, 0x6f, 0x6d, 0x69, 0x63, + 0x20, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x20, + 0x43, 0x61, 0x6e, 0x69, 0x64, 0x61, 0x65, 0x2e, + }; + static const unsigned char cipher[] = { + 0x45, 0x59, 0xab, 0xba, 0x4e, 0x48, 0xc1, 0x61, + 0x02, 0xe8, 0xbb, 0x2c, 0x05, 0xe6, 0x94, 0x7f, + 0x50, 0xa7, 0x86, 0xde, 0x16, 0x2f, 0x9b, 0x0b, + 0x7e, 0x59, 0x2a, 0x9b, 0x53, 0xd0, 0xd4, 0xe9, + 0x8d, 0x8d, 0x64, 0x10, 0xd5, 0x40, 0xa1, 0xa6, + 0x37, 0x5b, 0x26, 0xd8, 0x0d, 0xac, 0xe4, 0xfa, + 0xb5, 0x23, 0x84, 0xc7, 0x31, 0xac, 0xbf, 0x16, + 0xa5, 0x92, 0x3c, 0x0c, 0x48, 0xd3, 0x57, 0x5d, + 0x4d, 0x0d, 0x2c, 0x67, 0x3b, 0x66, 0x6f, 0xaa, + 0x73, 0x10, 0x61, 0x27, 0x77, 0x01, 0x09, 0x3a, + 0x6b, 0xf7, 0xa1, 0x58, 0xa8, 0x86, 0x42, 0x92, + 0xa4, 0x1c, 0x48, 0xe3, 0xa9, 0xb4, 0xc0, 0xda, + 0xec, 0xe0, 0xf8, 0xd9, 0x8d, 0x0d, 0x7e, 0x05, + 0xb3, 0x7a, 0x30, 0x7b, 0xbb, 0x66, 0x33, 0x31, + 0x64, 0xec, 0x9e, 0x1b, 0x24, 0xea, 0x0d, 0x6c, + 0x3f, 0xfd, 0xdc, 0xec, 0x4f, 0x68, 0xe7, 0x44, + 0x30, 0x56, 0x19, 0x3a, 0x03, 0xc8, 0x10, 0xe1, + 0x13, 0x44, 0xca, 0x06, 0xd8, 0xed, 0x8a, 0x2b, + 0xfb, 0x1e, 0x8d, 0x48, 0xcf, 0xa6, 0xbc, 0x0e, + 0xb4, 0xe2, 0x46, 0x4b, 0x74, 0x81, 0x42, 0x40, + 0x7c, 0x9f, 0x43, 0x1a, 0xee, 0x76, 0x99, 0x60, + 0xe1, 0x5b, 0xa8, 0xb9, 0x68, 0x90, 0x46, 0x6e, + 0xf2, 0x45, 0x75, 0x99, 0x85, 0x23, 0x85, 0xc6, + 0x61, 0xf7, 0x52, 0xce, 0x20, 0xf9, 0xda, 0x0c, + 0x09, 0xab, 0x6b, 0x19, 0xdf, 0x74, 0xe7, 0x6a, + 0x95, 0x96, 0x74, 0x46, 0xf8, 0xd0, 0xfd, 0x41, + 0x5e, 0x7b, 0xee, 0x2a, 0x12, 0xa1, 0x14, 0xc2, + 0x0e, 0xb5, 0x29, 0x2a, 0xe7, 0xa3, 0x49, 0xae, + 0x57, 0x78, 0x20, 0xd5, 0x52, 0x0a, 0x1f, 0x3f, + 0xb6, 0x2a, 0x17, 0xce, 0x6a, 0x7e, 0x68, 0xfa, + 0x7c, 0x79, 0x11, 0x1d, 0x88, 0x60, 0x92, 0x0b, + 0xc0, 0x48, 0xef, 0x43, 0xfe, 0x84, 0x48, 0x6c, + 0xcb, 0x87, 0xc2, 0x5f, 0x0a, 0xe0, 0x45, 0xf0, + 0xcc, 0xe1, 0xe7, 0x98, 0x9a, 0x9a, 0xa2, 0x20, + 0xa2, 0x8b, 0xdd, 0x48, 0x27, 0xe7, 0x51, 0xa2, + 0x4a, 0x6d, 0x5c, 0x62, 0xd7, 0x90, 0xa6, 0x63, + 0x93, 0xb9, 0x31, 0x11, 0xc1, 0xa5, 0x5d, 0xd7, + 0x42, 0x1a, 0x10, 0x18, 0x49, 0x74, 0xc7, 0xc5, + }; + unsigned char out[sizeof(cipher)]; + int failed = 0; + size_t k; + + CRYPTO_xchacha_20(out, plain, sizeof(out), key, iv); + + if (memcmp(out, cipher, sizeof(out)) != 0) { + printf("XChaCha20 failed!\n"); + + printf("Got:\t"); + for (k = 0; k < sizeof(out); k++) + printf("%2.2x", out[k]); + printf("\n"); + + printf("Want:\t"); + for (k = 0; k < sizeof(cipher); k++) + printf("%2.2x", cipher[k]); + printf("\n"); + + failed = 1; + } + + return (failed); +} + int main(int argc, char **argv) { @@ -334,5 +499,11 @@ main(int argc, char **argv) } } + if (crypto_hchacha_20_test() != 0) + failed = 1; + + if (crypto_xchacha_20_test() != 0) + failed = 1; + return failed; } diff --git a/tests/cipher_list.c b/tests/cipher_list.c index c4b42764..70f547ab 100644 --- a/tests/cipher_list.c +++ b/tests/cipher_list.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher_list.c,v 1.6 2017/08/28 17:32:04 jsing Exp $ */ +/* $OpenBSD: cipher_list.c,v 1.9 2018/06/02 16:35:02 jsing Exp $ */ /* * Copyright (c) 2015 Doug Hogan * Copyright (c) 2015 Joel Sing @@ -49,7 +49,6 @@ static uint8_t cipher_bytes[] = { 0xcc, 0xaa, /* DHE-RSA-CHACHA20-POLY1305 */ 0x00, 0x9c, /* AES128-GCM-SHA256 */ 0x00, 0x3d, /* AES256-SHA256 */ - 0x00, 0x09, /* DES-CBC-SHA */ }; static uint16_t cipher_values[] = { @@ -58,25 +57,21 @@ static uint16_t cipher_values[] = { 0xccaa, /* DHE-RSA-CHACHA20-POLY1305 */ 0x009c, /* AES128-GCM-SHA256 */ 0x003d, /* AES256-SHA256 */ - 0x0009, /* DES-CBC-SHA */ }; #define N_CIPHERS (sizeof(cipher_bytes) / 2) -extern STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s, - const unsigned char *p, int num); -extern int ssl_cipher_list_to_bytes(SSL *s, STACK_OF(SSL_CIPHER) *sk, - unsigned char *p, size_t len, size_t *outlen); - static int ssl_bytes_to_list_alloc(SSL *s, STACK_OF(SSL_CIPHER) **ciphers) { SSL_CIPHER *cipher; uint16_t value; + CBS cbs; int i; - *ciphers = ssl_bytes_to_cipher_list(s, cipher_bytes, - sizeof(cipher_bytes)); + CBS_init(&cbs, cipher_bytes, sizeof(cipher_bytes)); + + *ciphers = ssl_bytes_to_cipher_list(s, &cbs); CHECK(*ciphers != NULL); CHECK(sk_SSL_CIPHER_num(*ciphers) == N_CIPHERS); for (i = 0; i < sk_SSL_CIPHER_num(*ciphers); i++) { @@ -92,6 +87,7 @@ ssl_bytes_to_list_alloc(SSL *s, STACK_OF(SSL_CIPHER) **ciphers) static int ssl_list_to_bytes_scsv(SSL *s, STACK_OF(SSL_CIPHER) **ciphers) { + CBB cbb; unsigned char *buf = NULL; size_t buflen, outlen; int ret = 0; @@ -101,7 +97,9 @@ ssl_list_to_bytes_scsv(SSL *s, STACK_OF(SSL_CIPHER) **ciphers) buflen = sizeof(cipher_bytes) + 2 + 2; CHECK((buf = calloc(1, buflen)) != NULL); - CHECK(ssl_cipher_list_to_bytes(s, *ciphers, buf, buflen, &outlen)); + CHECK(CBB_init_fixed(&cbb, buf, buflen)); + CHECK(ssl_cipher_list_to_bytes(s, *ciphers, &cbb)); + CHECK(CBB_finish(&cbb, NULL, &outlen)); CHECK_GOTO(outlen > 0 && outlen == buflen - 2); CHECK_GOTO(memcmp(buf, cipher_bytes, sizeof(cipher_bytes)) == 0); @@ -118,6 +116,7 @@ ssl_list_to_bytes_scsv(SSL *s, STACK_OF(SSL_CIPHER) **ciphers) static int ssl_list_to_bytes_no_scsv(SSL *s, STACK_OF(SSL_CIPHER) **ciphers) { + CBB cbb; unsigned char *buf = NULL; size_t buflen, outlen; int ret = 0; @@ -132,7 +131,9 @@ ssl_list_to_bytes_no_scsv(SSL *s, STACK_OF(SSL_CIPHER) **ciphers) /* Set renegotiate so it doesn't add SCSV */ s->internal->renegotiate = 1; - CHECK(ssl_cipher_list_to_bytes(s, *ciphers, buf, buflen, &outlen)); + CHECK(CBB_init_fixed(&cbb, buf, buflen)); + CHECK(ssl_cipher_list_to_bytes(s, *ciphers, &cbb)); + CHECK(CBB_finish(&cbb, NULL, &outlen)); CHECK_GOTO(outlen > 0 && outlen == buflen - 2); CHECK_GOTO(memcmp(buf, cipher_bytes, sizeof(cipher_bytes)) == 0); @@ -149,25 +150,18 @@ static int ssl_bytes_to_list_invalid(SSL *s, STACK_OF(SSL_CIPHER) **ciphers) { uint8_t empty_cipher_bytes[] = {0}; + CBS cbs; sk_SSL_CIPHER_free(*ciphers); /* Invalid length: CipherSuite is 2 bytes so it must be even */ - *ciphers = ssl_bytes_to_cipher_list(s, cipher_bytes, - sizeof(cipher_bytes) - 1); + CBS_init(&cbs, cipher_bytes, sizeof(cipher_bytes) - 1); + *ciphers = ssl_bytes_to_cipher_list(s, &cbs); CHECK(*ciphers == NULL); /* Invalid length: cipher_suites must be at least 2 */ - *ciphers = ssl_bytes_to_cipher_list(s, empty_cipher_bytes, - sizeof(empty_cipher_bytes)); - CHECK(*ciphers == NULL); - - /* Invalid length: cipher_suites must be at most 2^16-2 */ - *ciphers = ssl_bytes_to_cipher_list(s, cipher_bytes, 0x10000); - CHECK(*ciphers == NULL); - - /* Invalid len: prototype is signed, but it shouldn't accept len < 0 */ - *ciphers = ssl_bytes_to_cipher_list(s, cipher_bytes, -2); + CBS_init(&cbs, empty_cipher_bytes, sizeof(empty_cipher_bytes)); + *ciphers = ssl_bytes_to_cipher_list(s, &cbs); CHECK(*ciphers == NULL); return 1; diff --git a/tests/clienttest.c b/tests/clienttest.c index d198d277..6b8ea7d8 100644 --- a/tests/clienttest.c +++ b/tests/clienttest.c @@ -36,26 +36,24 @@ static unsigned char cipher_list_dtls1[] = { 0x00, 0x88, 0x00, 0x81, 0x00, 0x35, 0x00, 0x84, 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45, 0x00, 0x2f, 0x00, 0x41, 0xc0, 0x12, 0xc0, 0x08, - 0x00, 0x16, 0x00, 0x0a, 0x00, 0x15, 0x00, 0x09, - 0x00, 0xff, + 0x00, 0x16, 0x00, 0x0a, 0x00, 0xff, }; static unsigned char client_hello_dtls1[] = { 0x16, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, - 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x58, 0xfe, 0xff, 0xc3, 0xd6, 0x19, 0xf8, 0x5d, - 0x6a, 0xe3, 0x6d, 0x16, 0x4a, 0xf7, 0x8f, 0x8e, - 0x4a, 0x12, 0x87, 0xcf, 0x07, 0x99, 0xa7, 0x92, - 0x40, 0xbd, 0x06, 0x9f, 0xe9, 0xd2, 0x68, 0x84, - 0xff, 0x6f, 0xe8, 0x00, 0x00, 0x00, 0x2a, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, + 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x54, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x39, 0xff, 0x85, 0x00, 0x88, 0x00, 0x81, 0x00, 0x35, 0x00, 0x84, 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45, 0x00, 0x2f, 0x00, 0x41, 0xc0, 0x12, 0xc0, 0x08, 0x00, - 0x16, 0x00, 0x0a, 0x00, 0x15, 0x00, 0x09, 0x00, - 0xff, 0x01, 0x00, 0x00, 0x04, 0x00, 0x23, 0x00, - 0x00, + 0x16, 0x00, 0x0a, 0x00, 0xff, 0x01, 0x00, 0x00, + 0x04, 0x00, 0x23, 0x00, 0x00, }; static unsigned char cipher_list_tls10[] = { @@ -64,27 +62,25 @@ static unsigned char cipher_list_tls10[] = { 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45, 0x00, 0x2f, 0x00, 0x41, 0xc0, 0x11, 0xc0, 0x07, 0x00, 0x05, 0x00, 0x04, 0xc0, 0x12, 0xc0, 0x08, - 0x00, 0x16, 0x00, 0x0a, 0x00, 0x15, 0x00, 0x09, - 0x00, 0xff, + 0x00, 0x16, 0x00, 0x0a, 0x00, 0xff, }; static unsigned char client_hello_tls10[] = { - 0x16, 0x03, 0x01, 0x00, 0x75, 0x01, 0x00, 0x00, - 0x71, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x16, 0x03, 0x01, 0x00, 0x71, 0x01, 0x00, 0x00, + 0x6d, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0xc0, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x39, 0xff, 0x85, 0x00, 0x88, 0x00, 0x81, 0x00, 0x35, 0x00, 0x84, 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45, 0x00, 0x2f, 0x00, 0x41, 0xc0, 0x11, 0xc0, 0x07, 0x00, 0x05, 0x00, 0x04, 0xc0, 0x12, 0xc0, 0x08, 0x00, 0x16, - 0x00, 0x0a, 0x00, 0x15, 0x00, 0x09, 0x00, 0xff, - 0x01, 0x00, 0x00, 0x16, 0x00, 0x0b, 0x00, 0x02, - 0x01, 0x00, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x06, - 0x00, 0x1d, 0x00, 0x17, 0x00, 0x18, 0x00, 0x23, - 0x00, 0x00, + 0x00, 0x0a, 0x00, 0xff, 0x01, 0x00, 0x00, 0x16, + 0x00, 0x0b, 0x00, 0x02, 0x01, 0x00, 0x00, 0x0a, + 0x00, 0x08, 0x00, 0x06, 0x00, 0x1d, 0x00, 0x17, + 0x00, 0x18, 0x00, 0x23, 0x00, 0x00, }; static unsigned char cipher_list_tls11[] = { @@ -93,27 +89,25 @@ static unsigned char cipher_list_tls11[] = { 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45, 0x00, 0x2f, 0x00, 0x41, 0xc0, 0x11, 0xc0, 0x07, 0x00, 0x05, 0x00, 0x04, 0xc0, 0x12, 0xc0, 0x08, - 0x00, 0x16, 0x00, 0x0a, 0x00, 0x15, 0x00, 0x09, - 0x00, 0xff, + 0x00, 0x16, 0x00, 0x0a, 0x00, 0xff, }; static unsigned char client_hello_tls11[] = { - 0x16, 0x03, 0x01, 0x00, 0x75, 0x01, 0x00, 0x00, - 0x71, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x16, 0x03, 0x01, 0x00, 0x71, 0x01, 0x00, 0x00, + 0x6d, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0xc0, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0xc0, 0x14, 0xc0, 0x0a, 0x00, 0x39, 0xff, 0x85, 0x00, 0x88, 0x00, 0x81, 0x00, 0x35, 0x00, 0x84, 0xc0, 0x13, - 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45, 0x00, 0x2f, + 0xc0, 0x09, 0x00, 0x33, 0x00, 0x45, 0x00, 0x2f, 0x00, 0x41, 0xc0, 0x11, 0xc0, 0x07, 0x00, 0x05, 0x00, 0x04, 0xc0, 0x12, 0xc0, 0x08, 0x00, 0x16, - 0x00, 0x0a, 0x00, 0x15, 0x00, 0x09, 0x00, 0xff, - 0x01, 0x00, 0x00, 0x16, 0x00, 0x0b, 0x00, 0x02, - 0x01, 0x00, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x06, - 0x00, 0x1d, 0x00, 0x17, 0x00, 0x18, 0x00, 0x23, - 0x00, 0x00, + 0x00, 0x0a, 0x00, 0xff, 0x01, 0x00, 0x00, 0x16, + 0x00, 0x0b, 0x00, 0x02, 0x01, 0x00, 0x00, 0x0a, + 0x00, 0x08, 0x00, 0x06, 0x00, 0x1d, 0x00, 0x17, + 0x00, 0x18, 0x00, 0x23, 0x00, 0x00, }; static unsigned char cipher_list_tls12_aes[] = { @@ -128,7 +122,7 @@ static unsigned char cipher_list_tls12_aes[] = { 0x00, 0x9c, 0x00, 0x3c, 0x00, 0x2f, 0x00, 0xba, 0x00, 0x41, 0xc0, 0x11, 0xc0, 0x07, 0x00, 0x05, 0x00, 0x04, 0xc0, 0x12, 0xc0, 0x08, 0x00, 0x16, - 0x00, 0x0a, 0x00, 0x15, 0x00, 0x09, 0x00, 0xff, + 0x00, 0x0a, 0x00, 0xff, }; static unsigned char cipher_list_tls12_chacha[] = { @@ -143,19 +137,19 @@ static unsigned char cipher_list_tls12_chacha[] = { 0x00, 0x9c, 0x00, 0x3c, 0x00, 0x2f, 0x00, 0xba, 0x00, 0x41, 0xc0, 0x11, 0xc0, 0x07, 0x00, 0x05, 0x00, 0x04, 0xc0, 0x12, 0xc0, 0x08, 0x00, 0x16, - 0x00, 0x0a, 0x00, 0x15, 0x00, 0x09, 0x00, 0xff, + 0x00, 0x0a, 0x00, 0xff, }; static unsigned char client_hello_tls12[] = { - 0x16, 0x03, 0x01, 0x00, 0xc3, 0x01, 0x00, 0x00, - 0xbf, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xcc, 0xa9, - 0xcc, 0xa8, 0xcc, 0xaa, 0xc0, 0x30, 0xc0, 0x2c, - 0xc0, 0x28, 0xc0, 0x24, 0xc0, 0x14, 0xc0, 0x0a, - 0x00, 0x9f, 0x00, 0x6b, 0x00, 0x39, 0xff, 0x85, + 0x16, 0x03, 0x01, 0x00, 0xbb, 0x01, 0x00, 0x00, + 0xb7, 0x03, 0x03, 0x2b, 0x39, 0xcc, 0x56, 0xfc, + 0xc4, 0x98, 0x8e, 0xfc, 0x22, 0x89, 0xc5, 0x1e, + 0xa9, 0x88, 0xbd, 0x6e, 0xd8, 0xd1, 0xd6, 0xc1, + 0xc3, 0x12, 0xe8, 0xe0, 0x1e, 0xfa, 0xa8, 0x21, + 0xd9, 0x2d, 0x4d, 0x00, 0x00, 0x5c, 0xc0, 0x30, + 0xc0, 0x2c, 0xc0, 0x28, 0xc0, 0x24, 0xc0, 0x14, + 0xc0, 0x0a, 0x00, 0x9f, 0x00, 0x6b, 0x00, 0x39, + 0xcc, 0xa9, 0xcc, 0xa8, 0xcc, 0xaa, 0xff, 0x85, 0x00, 0xc4, 0x00, 0x88, 0x00, 0x81, 0x00, 0x9d, 0x00, 0x3d, 0x00, 0x35, 0x00, 0xc0, 0x00, 0x84, 0xc0, 0x2f, 0xc0, 0x2b, 0xc0, 0x27, 0xc0, 0x23, @@ -164,14 +158,13 @@ static unsigned char client_hello_tls12[] = { 0x00, 0x3c, 0x00, 0x2f, 0x00, 0xba, 0x00, 0x41, 0xc0, 0x11, 0xc0, 0x07, 0x00, 0x05, 0x00, 0x04, 0xc0, 0x12, 0xc0, 0x08, 0x00, 0x16, 0x00, 0x0a, - 0x00, 0x15, 0x00, 0x09, 0x00, 0xff, 0x01, 0x00, - 0x00, 0x36, 0x00, 0x0b, 0x00, 0x02, 0x01, 0x00, - 0x00, 0x0a, 0x00, 0x08, 0x00, 0x06, 0x00, 0x1d, - 0x00, 0x17, 0x00, 0x18, 0x00, 0x23, 0x00, 0x00, - 0x00, 0x0d, 0x00, 0x1c, 0x00, 0x1a, 0x06, 0x01, - 0x06, 0x03, 0xef, 0xef, 0x05, 0x01, 0x05, 0x03, - 0x04, 0x01, 0x04, 0x03, 0xee, 0xee, 0xed, 0xed, - 0x03, 0x01, 0x03, 0x03, 0x02, 0x01, 0x02, 0x03, + 0x00, 0xff, 0x01, 0x00, 0x00, 0x32, 0x00, 0x0b, + 0x00, 0x02, 0x01, 0x00, 0x00, 0x0a, 0x00, 0x08, + 0x00, 0x06, 0x00, 0x1d, 0x00, 0x17, 0x00, 0x18, + 0x00, 0x23, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x18, + 0x00, 0x16, 0x08, 0x06, 0x06, 0x01, 0x06, 0x03, + 0x08, 0x05, 0x05, 0x01, 0x05, 0x03, 0x08, 0x04, + 0x04, 0x01, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, }; struct client_hello_test { @@ -413,6 +406,7 @@ client_hello_test(int testno, struct client_hello_test *cht) memcmp(&client_hello[i], &wbuf[i], len - i) != 0) { fprintf(stderr, "FAIL: ClientHello differs:\n"); fprintf(stderr, "received:\n"); + memset(&wbuf[cht->random_start], 0, SSL3_RANDOM_SIZE); hexdump(wbuf, len); fprintf(stderr, "test data:\n"); hexdump(client_hello, client_hello_len); diff --git a/tests/configtest.c b/tests/configtest.c new file mode 100644 index 00000000..61474aa8 --- /dev/null +++ b/tests/configtest.c @@ -0,0 +1,171 @@ +/* $OpenBSD: configtest.c,v 1.1 2017/12/09 16:43:09 jsing Exp $ */ +/* + * Copyright (c) 2017 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +#include + +struct parse_protocols_test { + const char *protostr; + int want_return; + uint32_t want_protocols; +}; + +struct parse_protocols_test parse_protocols_tests[] = { + { + .protostr = NULL, + .want_return = 0, + .want_protocols = TLS_PROTOCOLS_DEFAULT, + }, + { + .protostr = "default", + .want_return = 0, + .want_protocols = TLS_PROTOCOLS_DEFAULT, + }, + { + .protostr = "secure", + .want_return = 0, + .want_protocols = TLS_PROTOCOLS_DEFAULT, + }, + { + .protostr = "all", + .want_return = 0, + .want_protocols = TLS_PROTOCOLS_ALL, + }, + { + .protostr = "tlsv1", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1, + }, + { + .protostr = "tlsv1.2", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1_2, + }, + { + .protostr = "", + .want_return = -1, + .want_protocols = 0, + }, + { + .protostr = "tlsv1.0:tlsv1.1:tlsv1.2", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1_0 | TLS_PROTOCOL_TLSv1_1 | + TLS_PROTOCOL_TLSv1_2, + }, + { + .protostr = "tlsv1.0,tlsv1.1,tlsv1.2", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1_0 | TLS_PROTOCOL_TLSv1_1 | + TLS_PROTOCOL_TLSv1_2, + }, + { + .protostr = "tlsv1.1,tlsv1.2,tlsv1.0", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1_0 | TLS_PROTOCOL_TLSv1_1 | + TLS_PROTOCOL_TLSv1_2, + }, + { + .protostr = "tlsv1.1,tlsv1.2,tlsv1.1", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1_1 | TLS_PROTOCOL_TLSv1_2, + }, + { + .protostr = "tlsv1.1,tlsv1.2,!tlsv1.1", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1_2, + }, + { + .protostr = "unknown", + .want_return = -1, + .want_protocols = 0, + }, + { + .protostr = "all,!unknown", + .want_return = -1, + .want_protocols = 0, + }, + { + .protostr = "sslv3,tlsv1.0,tlsv1.1,tlsv1.2", + .want_return = -1, + .want_protocols = 0, + }, + { + .protostr = "all,!tlsv1.0", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1_1 | TLS_PROTOCOL_TLSv1_2, + }, + { + .protostr = "!tlsv1.0", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1_1 | TLS_PROTOCOL_TLSv1_2, + }, + { + .protostr = "!tlsv1.0,!tlsv1.1", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1_2, + }, + { + .protostr = "!tlsv1.0,!tlsv1.1,tlsv1.2", + .want_return = 0, + .want_protocols = TLS_PROTOCOL_TLSv1_2, + }, +}; + +#define N_PARSE_PROTOCOLS_TESTS \ + (sizeof(parse_protocols_tests) / sizeof(*parse_protocols_tests)) + +static int +do_parse_protocols_test(int test_no, struct parse_protocols_test *ppt) +{ + uint32_t protocols = 0; + int failed = 1; + int rv; + + rv = tls_config_parse_protocols(&protocols, ppt->protostr); + if (rv != ppt->want_return) { + fprintf(stderr, "FAIL: test %i - tls_config_parse_protocols() " + "returned %i, want %i\n", test_no, rv, ppt->want_return); + goto done; + } + if (protocols != ppt->want_protocols) { + fprintf(stderr, "FAIL: test %i - got protocols 0x%x, " + "want 0x%x\n", test_no, protocols, ppt->want_protocols); + goto done; + } + + failed = 0; + + done: + return (failed); +} + +int +main(int argc, char **argv) +{ + int failed = 0; + size_t i; + + tls_init(); + + for (i = 0; i < N_PARSE_PROTOCOLS_TESTS; i++) + failed += do_parse_protocols_test(i, &parse_protocols_tests[i]); + + return (failed); +} diff --git a/tests/cts128test.c b/tests/cts128test.c index d910f3d4..ca608087 100644 --- a/tests/cts128test.c +++ b/tests/cts128test.c @@ -1,3 +1,4 @@ +/* $OpenBSD: cts128test.c,v 1.3 2018/07/17 17:06:49 tb Exp $ */ /* ==================================================================== * Copyright (c) 2008 The OpenSSL Project. All rights reserved. * diff --git a/tests/destest.c b/tests/destest.c index d2737438..ebc67f31 100644 --- a/tests/destest.c +++ b/tests/destest.c @@ -1,4 +1,4 @@ -/* crypto/des/destest.c */ +/* $OpenBSD: destest.c,v 1.4 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/dhtest.c b/tests/dhtest.c index 9c2d507d..599c51d5 100644 --- a/tests/dhtest.c +++ b/tests/dhtest.c @@ -1,4 +1,4 @@ -/* crypto/dh/dhtest.c */ +/* $OpenBSD: dhtest.c,v 1.5 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/dsatest.c b/tests/dsatest.c index 444cda53..dd3e3166 100644 --- a/tests/dsatest.c +++ b/tests/dsatest.c @@ -1,4 +1,4 @@ -/* crypto/dsa/dsatest.c */ +/* $OpenBSD: dsatest.c,v 1.5 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/ecdhtest.c b/tests/ecdhtest.c index b46a3d57..faf519e0 100644 --- a/tests/ecdhtest.c +++ b/tests/ecdhtest.c @@ -1,4 +1,4 @@ -/* crypto/ecdh/ecdhtest.c */ +/* $OpenBSD: ecdhtest.c,v 1.10 2018/07/17 17:06:49 tb Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * diff --git a/tests/ecdsatest.c b/tests/ecdsatest.c index 810fef61..097768d1 100644 --- a/tests/ecdsatest.c +++ b/tests/ecdsatest.c @@ -1,4 +1,4 @@ -/* crypto/ecdsa/ecdsatest.c */ +/* $OpenBSD: ecdsatest.c,v 1.6 2018/07/17 17:10:04 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -10,7 +10,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 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 @@ -58,13 +58,13 @@ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * - * Portions of the attached software ("Contribution") are developed by + * Portions of the attached software ("Contribution") are developed by * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. * * The Contribution is licensed pursuant to the OpenSSL open source * license provided above. * - * The elliptic curve binary polynomial software is originally written by + * The elliptic curve binary polynomial software is originally written by * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. * */ @@ -88,8 +88,9 @@ int x9_62_test_internal(BIO *out, int nid, const char *r, const char *s); int test_builtin(BIO *); /* some tests from the X9.62 draft */ -int x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in) - { +int +x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in) +{ int ret = 0; const char message[] = "abc"; unsigned char digest[20]; @@ -137,7 +138,7 @@ int x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in) BIO_printf(out, " ok\n"); ret = 1; -x962_int_err: + x962_int_err: if (!ret) BIO_printf(out, " failed\n"); if (key) @@ -150,12 +151,13 @@ int x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in) BN_free(s); EVP_MD_CTX_cleanup(&md_ctx); return ret; - } +} -int test_builtin(BIO *out) - { +int +test_builtin(BIO *out) +{ EC_builtin_curve *curves = NULL; - size_t crv_len = 0, n = 0; + size_t num_curves = 0, n = 0; EC_KEY *eckey = NULL, *wrong_eckey = NULL; EC_GROUP *group; ECDSA_SIG *ecdsa_sig = NULL; @@ -166,36 +168,32 @@ int test_builtin(BIO *out) unsigned char *raw_buf = NULL; unsigned int sig_len, degree, r_len, s_len, bn_len, buf_len; int nid, ret = 0; - + /* fill digest values with some random data */ arc4random_buf(digest, 20); arc4random_buf(wrong_digest, 20); - /* create and verify a ecdsa signature with every availble curve - * (with ) */ + /* create and verify a ecdsa signature with every available curve */ BIO_printf(out, "\ntesting ECDSA_sign() and ECDSA_verify() " "with some internal curves:\n"); /* get a list of all internal curves */ - crv_len = EC_get_builtin_curves(NULL, 0); + num_curves = EC_get_builtin_curves(NULL, 0); - curves = reallocarray(NULL, sizeof(EC_builtin_curve), crv_len); + curves = reallocarray(NULL, sizeof(EC_builtin_curve), num_curves); - if (curves == NULL) - { - BIO_printf(out, "malloc error\n"); + if (curves == NULL) { + BIO_printf(out, "reallocarray error\n"); goto builtin_err; - } - - if (!EC_get_builtin_curves(curves, crv_len)) - { + } + + if (!EC_get_builtin_curves(curves, num_curves)) { BIO_printf(out, "unable to get internal curves\n"); goto builtin_err; - } + } /* now create and verify a signature for every curve */ - for (n = 0; n < crv_len; n++) - { + for (n = 0; n < num_curves; n++) { unsigned char dirt, offset; nid = curves[n].nid; @@ -211,20 +209,18 @@ int test_builtin(BIO *out) goto builtin_err; EC_GROUP_free(group); degree = EC_GROUP_get_degree(EC_KEY_get0_group(eckey)); - if (degree < 160) - /* drop the curve */ - { + if (degree < 160) { + /* drop the curve */ EC_KEY_free(eckey); eckey = NULL; continue; - } + } BIO_printf(out, "%s: ", OBJ_nid2sn(nid)); /* create key */ - if (!EC_KEY_generate_key(eckey)) - { + if (!EC_KEY_generate_key(eckey)) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } /* create second key */ if ((wrong_eckey = EC_KEY_new()) == NULL) goto builtin_err; @@ -234,88 +230,83 @@ int test_builtin(BIO *out) if (EC_KEY_set_group(wrong_eckey, group) == 0) goto builtin_err; EC_GROUP_free(group); - if (!EC_KEY_generate_key(wrong_eckey)) - { + if (!EC_KEY_generate_key(wrong_eckey)) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } BIO_printf(out, "."); (void)BIO_flush(out); /* check key */ - if (!EC_KEY_check_key(eckey)) - { + if (!EC_KEY_check_key(eckey)) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } BIO_printf(out, "."); (void)BIO_flush(out); /* create signature */ sig_len = ECDSA_size(eckey); if ((signature = malloc(sig_len)) == NULL) goto builtin_err; - if (!ECDSA_sign(0, digest, 20, signature, &sig_len, eckey)) - { + if (!ECDSA_sign(0, digest, 20, signature, &sig_len, eckey)) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } BIO_printf(out, "."); (void)BIO_flush(out); /* verify signature */ - if (ECDSA_verify(0, digest, 20, signature, sig_len, eckey) != 1) - { + if (ECDSA_verify(0, digest, 20, signature, sig_len, + eckey) != 1) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } BIO_printf(out, "."); (void)BIO_flush(out); /* verify signature with the wrong key */ - if (ECDSA_verify(0, digest, 20, signature, sig_len, - wrong_eckey) == 1) - { + if (ECDSA_verify(0, digest, 20, signature, sig_len, + wrong_eckey) == 1) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } BIO_printf(out, "."); (void)BIO_flush(out); /* wrong digest */ if (ECDSA_verify(0, wrong_digest, 20, signature, sig_len, - eckey) == 1) - { + eckey) == 1) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } BIO_printf(out, "."); (void)BIO_flush(out); /* wrong length */ if (ECDSA_verify(0, digest, 20, signature, sig_len - 1, - eckey) == 1) - { + eckey) == 1) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } BIO_printf(out, "."); (void)BIO_flush(out); - /* Modify a single byte of the signature: to ensure we don't + /* + * Modify a single byte of the signature: to ensure we don't * garble the ASN1 structure, we read the raw signature and - * modify a byte in one of the bignums directly. */ + * modify a byte in one of the bignums directly. + */ sig_ptr = signature; - if ((ecdsa_sig = d2i_ECDSA_SIG(NULL, &sig_ptr, sig_len)) == NULL) - { + if ((ecdsa_sig = d2i_ECDSA_SIG(NULL, &sig_ptr, + sig_len)) == NULL) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } /* Store the two BIGNUMs in raw_buf. */ r_len = BN_num_bytes(ecdsa_sig->r); s_len = BN_num_bytes(ecdsa_sig->s); bn_len = (degree + 7) / 8; - if ((r_len > bn_len) || (s_len > bn_len)) - { + if ((r_len > bn_len) || (s_len > bn_len)) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } buf_len = 2 * bn_len; if ((raw_buf = calloc(1, buf_len)) == NULL) goto builtin_err; @@ -328,32 +319,32 @@ int test_builtin(BIO *out) raw_buf[offset] ^= dirt; /* Now read the BIGNUMs back in from raw_buf. */ if ((BN_bin2bn(raw_buf, bn_len, ecdsa_sig->r) == NULL) || - (BN_bin2bn(raw_buf + bn_len, bn_len, ecdsa_sig->s) == NULL)) + (BN_bin2bn(raw_buf + bn_len, bn_len, ecdsa_sig->s) == NULL)) goto builtin_err; sig_ptr2 = signature; sig_len = i2d_ECDSA_SIG(ecdsa_sig, &sig_ptr2); - if (ECDSA_verify(0, digest, 20, signature, sig_len, eckey) == 1) - { + if (ECDSA_verify(0, digest, 20, signature, sig_len, + eckey) == 1) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } /* Sanity check: undo the modification and verify signature. */ raw_buf[offset] ^= dirt; if ((BN_bin2bn(raw_buf, bn_len, ecdsa_sig->r) == NULL) || - (BN_bin2bn(raw_buf + bn_len, bn_len, ecdsa_sig->s) == NULL)) + (BN_bin2bn(raw_buf + bn_len, bn_len, ecdsa_sig->s) == NULL)) goto builtin_err; sig_ptr2 = signature; sig_len = i2d_ECDSA_SIG(ecdsa_sig, &sig_ptr2); - if (ECDSA_verify(0, digest, 20, signature, sig_len, eckey) != 1) - { + if (ECDSA_verify(0, digest, 20, signature, sig_len, + eckey) != 1) { BIO_printf(out, " failed\n"); goto builtin_err; - } + } BIO_printf(out, "."); (void)BIO_flush(out); - + BIO_printf(out, " ok\n"); /* cleanup */ /* clean bogus errors */ @@ -368,25 +359,23 @@ int test_builtin(BIO *out) ecdsa_sig = NULL; free(raw_buf); raw_buf = NULL; - } + } - ret = 1; -builtin_err: - if (eckey) - EC_KEY_free(eckey); - if (wrong_eckey) - EC_KEY_free(wrong_eckey); - if (ecdsa_sig) - ECDSA_SIG_free(ecdsa_sig); + ret = 1; + builtin_err: + EC_KEY_free(eckey); + EC_KEY_free(wrong_eckey); + ECDSA_SIG_free(ecdsa_sig); free(signature); free(raw_buf); free(curves); return ret; - } +} -int main(void) - { +int +main(void) +{ int ret = 1; BIO *out; @@ -395,13 +384,14 @@ int main(void) ERR_load_crypto_strings(); /* the tests */ - if (!test_builtin(out)) goto err; - + if (!test_builtin(out)) + goto err; + ret = 0; -err: - if (ret) + err: + if (ret) BIO_printf(out, "\nECDSA test failed\n"); - else + else BIO_printf(out, "\nECDSA test passed\n"); if (ret) ERR_print_errors(out); @@ -412,4 +402,4 @@ int main(void) if (out != NULL) BIO_free(out); return ret; - } +} diff --git a/tests/ectest.c b/tests/ectest.c index 9d7533b6..401c013a 100644 --- a/tests/ectest.c +++ b/tests/ectest.c @@ -1,3 +1,4 @@ +/* $OpenBSD: ectest.c,v 1.8 2018/07/15 18:22:57 tb Exp $ */ /* crypto/ec/ectest.c */ /* * Originally written by Bodo Moeller for the OpenSSL project. @@ -661,101 +662,29 @@ prime_field_tests(void) /* more tests using the last curve */ - + fprintf(stdout, "infinity tests ..."); + fflush(stdout); if (!EC_POINT_copy(Q, P)) ABORT; if (EC_POINT_is_at_infinity(group, Q)) ABORT; + /* P := 2P */ if (!EC_POINT_dbl(group, P, P, ctx)) ABORT; if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; - if (!EC_POINT_invert(group, Q, ctx)) ABORT; /* P = -2Q */ - - if (!EC_POINT_add(group, R, P, Q, ctx)) - ABORT; + /* Q := -P */ + if (!EC_POINT_invert(group, Q, ctx)) + ABORT; + /* R := 2P - P = P */ + if (!EC_POINT_add(group, R, P, Q, ctx)) + ABORT; + /* R := R + Q = P - P = infty */ if (!EC_POINT_add(group, R, R, Q, ctx)) ABORT; - if (!EC_POINT_is_at_infinity(group, R)) ABORT; /* R = P + 2Q */ - - { - const EC_POINT *points[4]; - const BIGNUM *scalars[4]; - BIGNUM scalar3; - - if (EC_POINT_is_at_infinity(group, Q)) - ABORT; - points[0] = Q; - points[1] = Q; - points[2] = Q; - points[3] = Q; - - if (!EC_GROUP_get_order(group, z, ctx)) - ABORT; - if (!BN_add(y, z, BN_value_one())) - ABORT; - if (BN_is_odd(y)) - ABORT; - if (!BN_rshift1(y, y)) - ABORT; - scalars[0] = y; /* (group order + 1)/2, so y*Q + y*Q = Q */ - scalars[1] = y; - - fprintf(stdout, "combined multiplication ..."); - fflush(stdout); - - /* z is still the group order */ - if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) - ABORT; - if (!EC_POINTs_mul(group, R, z, 2, points, scalars, ctx)) - ABORT; - if (0 != EC_POINT_cmp(group, P, R, ctx)) - ABORT; - if (0 != EC_POINT_cmp(group, R, Q, ctx)) - ABORT; - - fprintf(stdout, "."); - fflush(stdout); - - if (!BN_pseudo_rand(y, BN_num_bits(y), 0, 0)) - ABORT; - if (!BN_add(z, z, y)) - ABORT; - BN_set_negative(z, 1); - scalars[0] = y; - scalars[1] = z; /* z = -(order + y) */ - - if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) - ABORT; - if (!EC_POINT_is_at_infinity(group, P)) - ABORT; - - fprintf(stdout, "."); - fflush(stdout); - - if (!BN_pseudo_rand(x, BN_num_bits(y) - 1, 0, 0)) - ABORT; - if (!BN_add(z, x, y)) - ABORT; - BN_set_negative(z, 1); - scalars[0] = x; - scalars[1] = y; - scalars[2] = z; /* z = -(x+y) */ - - BN_init(&scalar3); - BN_zero(&scalar3); - scalars[3] = &scalar3; - - if (!EC_POINTs_mul(group, P, NULL, 4, points, scalars, ctx)) - ABORT; - if (!EC_POINT_is_at_infinity(group, P)) - ABORT; - - fprintf(stdout, " ok\n\n"); - - BN_free(&scalar3); - } - + if (!EC_POINT_is_at_infinity(group, R)) + ABORT; + fprintf(stdout, " ok\n\n"); if (ctx) BN_CTX_free(ctx); @@ -1185,91 +1114,29 @@ prime_field_tests(void) ); /* more tests using the last curve */ - + fprintf(stdout, "infinity tests ..."); + fflush(stdout); if (!EC_POINT_copy(Q, P)) ABORT; if (EC_POINT_is_at_infinity(group, Q)) ABORT; + /* P := 2P */ if (!EC_POINT_dbl(group, P, P, ctx)) ABORT; if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; - if (!EC_POINT_invert(group, Q, ctx)) ABORT; /* P = -2Q */ - - if (!EC_POINT_add(group, R, P, Q, ctx)) - ABORT; + /* Q := -P */ + if (!EC_POINT_invert(group, Q, ctx)) + ABORT; + /* R := 2P - P = P */ + if (!EC_POINT_add(group, R, P, Q, ctx)) + ABORT; + /* R := R + Q = P - P = infty */ if (!EC_POINT_add(group, R, R, Q, ctx)) ABORT; - if (!EC_POINT_is_at_infinity(group, R)) ABORT; /* R = P + 2Q */ - - { - const EC_POINT *points[3]; - const BIGNUM *scalars[3]; - - if (EC_POINT_is_at_infinity(group, Q)) - ABORT; - points[0] = Q; - points[1] = Q; - points[2] = Q; - - if (!BN_add(y, z, BN_value_one())) - ABORT; - if (BN_is_odd(y)) - ABORT; - if (!BN_rshift1(y, y)) - ABORT; - scalars[0] = y; /* (group order + 1)/2, so y*Q + y*Q = Q */ - scalars[1] = y; - - fprintf(stdout, "combined multiplication ..."); - fflush(stdout); - - /* z is still the group order */ - if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) - ABORT; - if (!EC_POINTs_mul(group, R, z, 2, points, scalars, ctx)) - ABORT; - if (0 != EC_POINT_cmp(group, P, R, ctx)) - ABORT; - if (0 != EC_POINT_cmp(group, R, Q, ctx)) - ABORT; - - fprintf(stdout, "."); - fflush(stdout); - - if (!BN_pseudo_rand(y, BN_num_bits(y), 0, 0)) - ABORT; - if (!BN_add(z, z, y)) - ABORT; - BN_set_negative(z, 1); - scalars[0] = y; - scalars[1] = z; /* z = -(order + y) */ - - if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) - ABORT; - if (!EC_POINT_is_at_infinity(group, P)) - ABORT; - - fprintf(stdout, "."); - fflush(stdout); - - if (!BN_pseudo_rand(x, BN_num_bits(y) - 1, 0, 0)) - ABORT; - if (!BN_add(z, x, y)) - ABORT; - BN_set_negative(z, 1); - scalars[0] = x; - scalars[1] = y; - scalars[2] = z; /* z = -(x+y) */ - - if (!EC_POINTs_mul(group, P, NULL, 3, points, scalars, ctx)) - ABORT; - if (!EC_POINT_is_at_infinity(group, P)) - ABORT; - - fprintf(stdout, " ok\n\n"); - } - + if (!EC_POINT_is_at_infinity(group, R)) + ABORT; + fprintf(stdout, " ok\n\n"); if (ctx) BN_CTX_free(ctx); diff --git a/tests/enginetest.c b/tests/enginetest.c index bb2472a3..12386625 100644 --- a/tests/enginetest.c +++ b/tests/enginetest.c @@ -1,4 +1,4 @@ -/* crypto/engine/enginetest.c */ +/* $OpenBSD: enginetest.c,v 1.8 2018/07/17 17:06:49 tb Exp $ */ /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL * project 2000. */ @@ -129,8 +129,7 @@ int main(int argc, char *argv[]) printf("Remove failed!\n"); goto end; } - if (ptr) - ENGINE_free(ptr); + ENGINE_free(ptr); display_engine_list(); if (!ENGINE_add(new_h3) || !ENGINE_add(new_h2)) { printf("Add failed!\n"); @@ -178,8 +177,7 @@ int main(int argc, char *argv[]) if (!ENGINE_remove(ptr)) printf("Remove failed!i - probably no hardware " "support present.\n"); - if (ptr) - ENGINE_free(ptr); + ENGINE_free(ptr); display_engine_list(); if (!ENGINE_add(new_h1) || !ENGINE_remove(new_h1)) { @@ -231,13 +229,12 @@ int main(int argc, char *argv[]) end: if (to_return) ERR_print_errors_fp(stderr); - if (new_h1) ENGINE_free(new_h1); - if (new_h2) ENGINE_free(new_h2); - if (new_h3) ENGINE_free(new_h3); - if (new_h4) ENGINE_free(new_h4); + ENGINE_free(new_h1); + ENGINE_free(new_h2); + ENGINE_free(new_h3); + ENGINE_free(new_h4); for (loop = 0; loop < 512; loop++) - if (block[loop]) - ENGINE_free(block[loop]); + ENGINE_free(block[loop]); ENGINE_cleanup(); CRYPTO_cleanup_all_ex_data(); ERR_free_strings(); diff --git a/tests/evptest.c b/tests/evptest.c index bd5da475..ac15a55a 100644 --- a/tests/evptest.c +++ b/tests/evptest.c @@ -1,3 +1,4 @@ +/* $OpenBSD: evptest.c,v 1.8 2019/03/17 18:33:01 tb Exp $ */ /* Written by Ben Laurie, 2001 */ /* * Copyright (c) 2001 The OpenSSL Project. All rights reserved. @@ -143,6 +144,7 @@ test1(const EVP_CIPHER *c, const unsigned char *key, int kn, { EVP_CIPHER_CTX ctx; unsigned char out[4096]; + const unsigned char *eiv; int outl, outl2; printf("Testing cipher %s%s\n", EVP_CIPHER_name(c), @@ -159,8 +161,12 @@ test1(const EVP_CIPHER *c, const unsigned char *key, int kn, test1_exit(5); } EVP_CIPHER_CTX_init(&ctx); + EVP_CIPHER_CTX_set_flags(&ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW); if (encdec != 0) { - if (!EVP_EncryptInit_ex(&ctx, c,NULL, key, iv)) { + eiv = iv; + if (EVP_CIPHER_mode(c) == EVP_CIPH_WRAP_MODE && in == 0) + eiv = NULL; + if (!EVP_EncryptInit_ex(&ctx, c, NULL, key, eiv)) { fprintf(stderr, "EncryptInit failed\n"); ERR_print_errors_fp(stderr); test1_exit(10); @@ -193,7 +199,10 @@ test1(const EVP_CIPHER *c, const unsigned char *key, int kn, } if (encdec <= 0) { - if (!EVP_DecryptInit_ex(&ctx, c,NULL, key, iv)) { + eiv = iv; + if (EVP_CIPHER_mode(c) == EVP_CIPH_WRAP_MODE && in == 0) + eiv = NULL; + if (!EVP_DecryptInit_ex(&ctx, c,NULL, key, eiv)) { fprintf(stderr, "DecryptInit failed\n"); ERR_print_errors_fp(stderr); test1_exit(11); diff --git a/tests/evptests.txt b/tests/evptests.txt index d4b24df8..3c133dba 100644 --- a/tests/evptests.txt +++ b/tests/evptests.txt @@ -1,3 +1,4 @@ +# $OpenBSD: evptests.txt,v 1.6 2019/03/17 18:33:01 tb Exp $ #cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt) #digest:::input:output @@ -183,6 +184,13 @@ aes-256-ctr:776BEFF2851DB06F4C8A0542C8696F6C6A81AF1EEC96B4D37FC1D689E6C1C104:000 aes-256-ctr:F6D66D6BD52D59BB0796365879EFF886C66DD51A5B6A99744B50590C87A23884:00FAAC24C1585EF15A43D87500000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:F05E231B3894612C49EE000B804EB2A9B8306B508F839D6A5530831D9344AF1C:1 aes-256-ctr:FF7A617CE69148E4F1726E2F43581DE2AA62D9F805532EDFF1EED687FB54153D:001CC5B751A51D70A1C1114800000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:EB6C52821D0BBBF7CE7594462ACA4FAAB407DF866569FD07F48CC0B583D6071F1EC0E6B8:1 +# AES wrap tests from RFC3394 +id-aes128-wrap:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:1FA68B0A8112B447AEF34BD8FB5A7B829D3E862371D2CFE5 +id-aes192-wrap:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:96778B25AE6CA435F92B5B97C050AED2468AB8A17AD84E5D +id-aes256-wrap:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:64E8C3F9CE0F5BA263E9777905818A2A93C8191E7D6E8AE7 +id-aes192-wrap:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF0001020304050607:031D33264E15D33268F24EC260743EDCE1C6C7DDEE725A936BA814915C6762D2 +id-aes256-wrap:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF0001020304050607:A8F9BC1612C68B3FF6E6F4FBE30E71E4769C8B80A32CB8958CD5D17D6B254DA1 +id-aes256-wrap:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF000102030405060708090A0B0C0D0E0F:28C9F404C4B810F4CBCCB35CFB87F8263F5786E2D80ED326CBC7F0E71A99F43BFB988B9B7A02DD21 # DES ECB tests (from destest) DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 diff --git a/tests/exptest.c b/tests/exptest.c index 375628cb..e7f58485 100644 --- a/tests/exptest.c +++ b/tests/exptest.c @@ -1,4 +1,4 @@ -/* crypto/bn/exptest.c */ +/* $OpenBSD: exptest.c,v 1.7 2018/11/08 22:20:25 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -204,33 +204,37 @@ static int test_exp_mod_zero(void) int main(int argc, char *argv[]) { + BIGNUM *r_mont, *r_mont_const, *r_recp, *r_simple; + BIGNUM *r_mont_ct, *r_mont_nonct, *a, *b, *m; BN_CTX *ctx; BIO *out = NULL; - int i, ret; unsigned char c; - BIGNUM *r_mont, *r_mont_const, *r_recp, *r_simple, - *r_mont_ct, *r_mont_nonct, *a, *b, *m; + int i, ret; ERR_load_BN_strings(); - ctx = BN_CTX_new(); - if (ctx == NULL) - exit(1); - r_mont = BN_new(); - r_mont_const = BN_new(); - r_mont_ct = BN_new(); - r_mont_nonct = BN_new(); - r_recp = BN_new(); - r_simple = BN_new(); - a = BN_new(); - b = BN_new(); - m = BN_new(); - if ((r_mont == NULL) || (r_recp == NULL) || (a == NULL) || (b == NULL)) + if ((ctx = BN_CTX_new()) == NULL) + goto err; + if ((r_mont = BN_new()) == NULL) + goto err; + if ((r_mont_const = BN_new()) == NULL) + goto err; + if ((r_mont_ct = BN_new()) == NULL) + goto err; + if ((r_mont_nonct = BN_new()) == NULL) + goto err; + if ((r_recp = BN_new()) == NULL) + goto err; + if ((r_simple = BN_new()) == NULL) + goto err; + if ((a = BN_new()) == NULL) + goto err; + if ((b = BN_new()) == NULL) + goto err; + if ((m = BN_new()) == NULL) goto err; - out = BIO_new(BIO_s_file()); - - if (out == NULL) + if ((out = BIO_new(BIO_s_file())) == NULL) exit(1); BIO_set_fp(out, stdout, BIO_NOCLOSE); @@ -253,48 +257,42 @@ int main(int argc, char *argv[]) ret = BN_mod_exp_mont(r_mont, a, b, m, ctx, NULL); if (ret <= 0) { printf("BN_mod_exp_mont() problems\n"); - ERR_print_errors(out); - exit(1); + goto err; } ret = BN_mod_exp_mont_ct(r_mont_ct, a, b, m, ctx, NULL); if (ret <= 0) { printf("BN_mod_exp_mont_ct() problems\n"); - ERR_print_errors(out); - exit(1); + goto err; } ret = BN_mod_exp_mont_nonct(r_mont_nonct, a, b, m, ctx, NULL); if (ret <= 0) { printf("BN_mod_exp_mont_nonct() problems\n"); - ERR_print_errors(out); - exit(1); + goto err; } ret = BN_mod_exp_recp(r_recp, a, b, m, ctx); if (ret <= 0) { printf("BN_mod_exp_recp() problems\n"); - ERR_print_errors(out); - exit(1); + goto err; } ret = BN_mod_exp_simple(r_simple, a, b, m, ctx); if (ret <= 0) { printf("BN_mod_exp_simple() problems\n"); - ERR_print_errors(out); - exit(1); + goto err; } ret = BN_mod_exp_mont_consttime(r_mont_const, a, b, m, ctx, NULL); if (ret <= 0) { printf("BN_mod_exp_mont_consttime() problems\n"); - ERR_print_errors(out); - exit(1); + goto err; } - if (BN_cmp(r_simple, r_mont) == 0 - && BN_cmp(r_simple, r_recp) == 0 - && BN_cmp(r_simple, r_mont_const) == 0) { + if (BN_cmp(r_simple, r_mont) == 0 && + BN_cmp(r_simple, r_recp) == 0 && + BN_cmp(r_simple, r_mont_const) == 0) { printf("."); fflush(stdout); } else { @@ -329,6 +327,8 @@ int main(int argc, char *argv[]) } BN_free(r_mont); BN_free(r_mont_const); + BN_free(r_mont_ct); + BN_free(r_mont_nonct); BN_free(r_recp); BN_free(r_simple); BN_free(a); @@ -346,6 +346,7 @@ int main(int argc, char *argv[]) printf("done\n"); return (0); + err: ERR_load_crypto_strings(); ERR_print_errors(out); diff --git a/tests/freenull.c b/tests/freenull.c index d946a265..fbecf783 100644 --- a/tests/freenull.c +++ b/tests/freenull.c @@ -1,21 +1,20 @@ -/* $OpenBSD: freenull.c,v 1.4 2017/05/06 21:23:57 jsing Exp $ */ -/* - * Copyright (c) 2017 Bob Beck - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ +/* $OpenBSD: freenull.c.head,v 1.2 2018/07/10 20:55:57 tb Exp $ */ #include +#include +#include +#include +#include +#ifndef OPENSSL_NO_ENGINE +#include +#endif +#include +#include +#include +#include +#include +#include +#include #include #include @@ -23,31 +22,208 @@ #include #include -/* Make sure we do the right thing. Add here if you convert ones in tree */ int main(int argc, char **argv) { + ACCESS_DESCRIPTION_free(NULL); + ASN1_BIT_STRING_free(NULL); + ASN1_BMPSTRING_free(NULL); + ASN1_ENUMERATED_free(NULL); + ASN1_GENERALIZEDTIME_free(NULL); + ASN1_GENERALSTRING_free(NULL); + ASN1_IA5STRING_free(NULL); ASN1_INTEGER_free(NULL); + ASN1_NULL_free(NULL); ASN1_OBJECT_free(NULL); ASN1_OCTET_STRING_free(NULL); - - BIO_free_all(NULL); - + ASN1_PCTX_free(NULL); + ASN1_PRINTABLESTRING_free(NULL); + ASN1_PRINTABLE_free(NULL); + ASN1_STRING_free(NULL); + ASN1_T61STRING_free(NULL); + ASN1_TIME_free(NULL); + ASN1_TYPE_free(NULL); + ASN1_UNIVERSALSTRING_free(NULL); + ASN1_UTCTIME_free(NULL); + ASN1_UTF8STRING_free(NULL); + ASN1_VISIBLESTRING_free(NULL); + AUTHORITY_INFO_ACCESS_free(NULL); + AUTHORITY_KEYID_free(NULL); + BASIC_CONSTRAINTS_free(NULL); + BIO_free(NULL); + BIO_meth_free(NULL); + BN_BLINDING_free(NULL); + BN_CTX_free(NULL); + BN_GENCB_free(NULL); + BN_MONT_CTX_free(NULL); + BN_RECP_CTX_free(NULL); + BN_clear_free(NULL); + BN_free(NULL); + BUF_MEM_free(NULL); + CERTIFICATEPOLICIES_free(NULL); + CMAC_CTX_free(NULL); + COMP_CTX_free(NULL); + CONF_free(NULL); + CRL_DIST_POINTS_free(NULL); + DH_free(NULL); + DIRECTORYSTRING_free(NULL); + DISPLAYTEXT_free(NULL); + DIST_POINT_NAME_free(NULL); DIST_POINT_free(NULL); - + DSA_SIG_free(NULL); + DSA_free(NULL); + DSA_meth_free(NULL); + DSO_free(NULL); + ECDSA_SIG_free(NULL); + EC_GROUP_clear_free(NULL); + EC_GROUP_free(NULL); + EC_KEY_METHOD_free(NULL); + EC_KEY_free(NULL); + EC_POINT_clear_free(NULL); + EC_POINT_free(NULL); + EDIPARTYNAME_free(NULL); +#ifndef OPENSSL_NO_ENGINE + ENGINE_free(NULL); +#endif + ESS_CERT_ID_free(NULL); + ESS_ISSUER_SERIAL_free(NULL); + ESS_SIGNING_CERT_free(NULL); + EVP_CIPHER_CTX_free(NULL); + EVP_ENCODE_CTX_free(NULL); + EVP_MD_CTX_free(NULL); + EVP_PKEY_CTX_free(NULL); + EVP_PKEY_asn1_free(NULL); EVP_PKEY_free(NULL); - + EVP_PKEY_meth_free(NULL); + EXTENDED_KEY_USAGE_free(NULL); + GENERAL_NAMES_free(NULL); GENERAL_NAME_free(NULL); GENERAL_SUBTREE_free(NULL); - + GOST_CIPHER_PARAMS_free(NULL); + GOST_KEY_free(NULL); + HMAC_CTX_free(NULL); + ISSUING_DIST_POINT_free(NULL); NAME_CONSTRAINTS_free(NULL); + NCONF_free(NULL); + NETSCAPE_CERT_SEQUENCE_free(NULL); + NETSCAPE_SPKAC_free(NULL); + NETSCAPE_SPKI_free(NULL); + NETSCAPE_X509_free(NULL); + NOTICEREF_free(NULL); + OCSP_BASICRESP_free(NULL); + OCSP_CERTID_free(NULL); + OCSP_CERTSTATUS_free(NULL); + OCSP_CRLID_free(NULL); + OCSP_ONEREQ_free(NULL); + OCSP_REQINFO_free(NULL); + OCSP_REQUEST_free(NULL); + OCSP_REQ_CTX_free(NULL); + OCSP_RESPBYTES_free(NULL); + OCSP_RESPDATA_free(NULL); + OCSP_RESPID_free(NULL); + OCSP_RESPONSE_free(NULL); + OCSP_REVOKEDINFO_free(NULL); + OCSP_SERVICELOC_free(NULL); + OCSP_SIGNATURE_free(NULL); + OCSP_SINGLERESP_free(NULL); + OTHERNAME_free(NULL); + PBE2PARAM_free(NULL); + PBEPARAM_free(NULL); + PBKDF2PARAM_free(NULL); + PKCS12_BAGS_free(NULL); + PKCS12_MAC_DATA_free(NULL); + PKCS12_SAFEBAG_free(NULL); + PKCS12_free(NULL); + PKCS7_DIGEST_free(NULL); + PKCS7_ENCRYPT_free(NULL); + PKCS7_ENC_CONTENT_free(NULL); + PKCS7_ENVELOPE_free(NULL); + PKCS7_ISSUER_AND_SERIAL_free(NULL); + PKCS7_RECIP_INFO_free(NULL); + PKCS7_SIGNED_free(NULL); + PKCS7_SIGNER_INFO_free(NULL); + PKCS7_SIGN_ENVELOPE_free(NULL); + PKCS7_free(NULL); + PKCS8_PRIV_KEY_INFO_free(NULL); + PKEY_USAGE_PERIOD_free(NULL); + POLICYINFO_free(NULL); + POLICYQUALINFO_free(NULL); + POLICY_CONSTRAINTS_free(NULL); + POLICY_MAPPING_free(NULL); + PROXY_CERT_INFO_EXTENSION_free(NULL); + PROXY_POLICY_free(NULL); + RSA_PSS_PARAMS_free(NULL); + RSA_free(NULL); + RSA_meth_free(NULL); + SXNETID_free(NULL); + SXNET_free(NULL); + TS_ACCURACY_free(NULL); + TS_MSG_IMPRINT_free(NULL); + TS_REQ_ext_free(NULL); + TS_REQ_free(NULL); + TS_RESP_CTX_free(NULL); + TS_RESP_free(NULL); + TS_STATUS_INFO_free(NULL); + TS_TST_INFO_ext_free(NULL); + TS_TST_INFO_free(NULL); + TS_VERIFY_CTX_free(NULL); + TXT_DB_free(NULL); + UI_free(NULL); + USERNOTICE_free(NULL); + X509V3_conf_free(NULL); + X509_ALGOR_free(NULL); + X509_ATTRIBUTE_free(NULL); + X509_CERT_AUX_free(NULL); + X509_CERT_PAIR_free(NULL); + X509_CINF_free(NULL); + X509_CRL_INFO_free(NULL); + X509_CRL_METHOD_free(NULL); + X509_CRL_free(NULL); + X509_EXTENSION_free(NULL); + X509_INFO_free(NULL); + X509_LOOKUP_free(NULL); + X509_NAME_ENTRY_free(NULL); + X509_NAME_free(NULL); + X509_PKEY_free(NULL); + X509_PUBKEY_free(NULL); + X509_REQ_INFO_free(NULL); + X509_REQ_free(NULL); + X509_REVOKED_free(NULL); + X509_SIG_free(NULL); + X509_STORE_CTX_free(NULL); + X509_STORE_free(NULL); + X509_VAL_free(NULL); + X509_VERIFY_PARAM_free(NULL); + X509_email_free(NULL); + X509_free(NULL); + X509_policy_tree_free(NULL); + lh_free(NULL); + sk_free(NULL); +/* $OpenBSD: freenull.c.tail,v 1.2 2018/07/10 20:55:57 tb Exp $ */ - sk_GENERAL_NAME_pop_free(NULL, GENERAL_NAME_free); - sk_X509_NAME_ENTRY_pop_free(NULL, X509_NAME_ENTRY_free); + BIO_free_all(NULL); + NCONF_free_data(NULL); + _CONF_free_data(NULL); - X509_NAME_ENTRY_free(NULL); + lh_FUNCTION_free(NULL); + + sk_ASN1_OBJECT_pop_free(NULL, NULL); + sk_CONF_VALUE_pop_free(NULL, NULL); + sk_GENERAL_NAME_pop_free(NULL, NULL); + sk_OCSP_CERTID_free(NULL); + sk_OPENSSL_STRING_free(NULL); + sk_PKCS12_SAFEBAG_pop_free(NULL, NULL); + sk_PKCS7_pop_free(NULL, NULL); + sk_X509_ATTRIBUTE_free(NULL); + sk_X509_CRL_pop_free(NULL, NULL); + sk_X509_EXTENSION_pop_free(NULL, NULL); + sk_X509_INFO_free(NULL); + sk_X509_INFO_pop_free(NULL, NULL); + sk_X509_NAME_ENTRY_pop_free(NULL, NULL); + sk_X509_free(NULL); + sk_X509_pop_free(NULL, NULL); printf("PASS\n"); - return (0); + return 0; } diff --git a/tests/gcm128test.c b/tests/gcm128test.c index cf52d1fd..07c6128c 100644 --- a/tests/gcm128test.c +++ b/tests/gcm128test.c @@ -1,3 +1,4 @@ +/* $OpenBSD: gcm128test.c,v 1.6 2018/07/17 17:06:49 tb Exp $ */ /* ==================================================================== * Copyright (c) 2010 The OpenSSL Project. All rights reserved. * diff --git a/tests/handshake_table.c b/tests/handshake_table.c new file mode 100644 index 00000000..494f72fd --- /dev/null +++ b/tests/handshake_table.c @@ -0,0 +1,516 @@ +/* $OpenBSD: handshake_table.c,v 1.11 2019/04/05 20:25:25 tb Exp $ */ +/* + * Copyright (c) 2019 Theo Buehler + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include +#include +#include + +#include "tls13_handshake.h" + +/* + * From RFC 8446: + * + * Appendix A. State Machine + * + * This appendix provides a summary of the legal state transitions for + * the client and server handshakes. State names (in all capitals, + * e.g., START) have no formal meaning but are provided for ease of + * comprehension. Actions which are taken only in certain circumstances + * are indicated in []. The notation "K_{send,recv} = foo" means "set + * the send/recv key to the given key". + * + * A.1. Client + * + * START <----+ + * Send ClientHello | | Recv HelloRetryRequest + * [K_send = early data] | | + * v | + * / WAIT_SH ----+ + * | | Recv ServerHello + * | | K_recv = handshake + * Can | V + * send | WAIT_EE + * early | | Recv EncryptedExtensions + * data | +--------+--------+ + * | Using | | Using certificate + * | PSK | v + * | | WAIT_CERT_CR + * | | Recv | | Recv CertificateRequest + * | | Certificate | v + * | | | WAIT_CERT + * | | | | Recv Certificate + * | | v v + * | | WAIT_CV + * | | | Recv CertificateVerify + * | +> WAIT_FINISHED <+ + * | | Recv Finished + * \ | [Send EndOfEarlyData] + * | K_send = handshake + * | [Send Certificate [+ CertificateVerify]] + * Can send | Send Finished + * app data --> | K_send = K_recv = application + * after here v + * CONNECTED + * + * Note that with the transitions as shown above, clients may send + * alerts that derive from post-ServerHello messages in the clear or + * with the early data keys. If clients need to send such alerts, they + * SHOULD first rekey to the handshake keys if possible. + * + */ + +struct child { + enum tls13_message_type mt; + uint8_t flag; + uint8_t forced; + uint8_t illegal; +}; + +#define DEFAULT 0x00 + +static struct child stateinfo[][TLS13_NUM_MESSAGE_TYPES] = { + [CLIENT_HELLO] = { + {SERVER_HELLO, DEFAULT, 0, 0}, + }, + [SERVER_HELLO] = { + {SERVER_ENCRYPTED_EXTENSIONS, DEFAULT, 0, 0}, + {CLIENT_HELLO_RETRY, WITH_HRR, 0, 0}, + }, + [CLIENT_HELLO_RETRY] = { + {SERVER_HELLO_RETRY, DEFAULT, 0, 0}, + }, + [SERVER_HELLO_RETRY] = { + {SERVER_ENCRYPTED_EXTENSIONS, DEFAULT, 0, 0}, + }, + [SERVER_ENCRYPTED_EXTENSIONS] = { + {SERVER_CERTIFICATE_REQUEST, DEFAULT, 0, 0}, + {SERVER_CERTIFICATE, WITHOUT_CR, 0, 0}, + {SERVER_FINISHED, WITH_PSK, 0, 0}, + }, + [SERVER_CERTIFICATE_REQUEST] = { + {SERVER_CERTIFICATE, DEFAULT, 0, 0}, + }, + [SERVER_CERTIFICATE] = { + {SERVER_CERTIFICATE_VERIFY, DEFAULT, 0, 0}, + }, + [SERVER_CERTIFICATE_VERIFY] = { + {SERVER_FINISHED, DEFAULT, 0, 0}, + }, + [SERVER_FINISHED] = { + {CLIENT_FINISHED, DEFAULT, WITHOUT_CR | WITH_PSK, 0}, + {CLIENT_CERTIFICATE, DEFAULT, 0, WITHOUT_CR | WITH_PSK}, + }, + [CLIENT_CERTIFICATE] = { + {CLIENT_FINISHED, DEFAULT, 0, 0}, + {CLIENT_CERTIFICATE_VERIFY, WITH_CCV, 0, 0}, + }, + [CLIENT_CERTIFICATE_VERIFY] = { + {CLIENT_FINISHED, DEFAULT, 0, 0}, + }, + [CLIENT_FINISHED] = { + {APPLICATION_DATA, DEFAULT, 0, 0}, + }, + [APPLICATION_DATA] = { + {0, DEFAULT, 0, 0}, + }, +}; + +const size_t stateinfo_count = sizeof(stateinfo) / sizeof(stateinfo[0]); + +void build_table(enum tls13_message_type + table[UINT8_MAX][TLS13_NUM_MESSAGE_TYPES], + struct child current, struct child end, + struct child path[], uint8_t flags, unsigned int depth); +size_t count_handshakes(void); +void edge(enum tls13_message_type start, + enum tls13_message_type end, uint8_t flag); +const char *flag2str(uint8_t flag); +void flag_label(uint8_t flag); +void forced_edges(enum tls13_message_type start, + enum tls13_message_type end, uint8_t forced); +int generate_graphics(void); +void fprint_entry(FILE *stream, + enum tls13_message_type path[TLS13_NUM_MESSAGE_TYPES], + uint8_t flags); +void fprint_flags(FILE *stream, uint8_t flags); +const char *mt2str(enum tls13_message_type mt); +__dead void usage(void); +int verify_table(enum tls13_message_type + table[UINT8_MAX][TLS13_NUM_MESSAGE_TYPES], int print); + +const char * +flag2str(uint8_t flag) +{ + const char *ret; + + if (flag & (flag - 1)) + errx(1, "more than one bit is set"); + + switch (flag) { + case INITIAL: + ret = "INITIAL"; + break; + case NEGOTIATED: + ret = "NEGOTIATED"; + break; + case WITHOUT_CR: + ret = "WITHOUT_CR"; + break; + case WITH_HRR: + ret = "WITH_HRR"; + break; + case WITH_PSK: + ret = "WITH_PSK"; + break; + case WITH_CCV: + ret = "WITH_CCV"; + break; + case WITH_0RTT: + ret = "WITH_0RTT"; + break; + default: + ret = "UNKNOWN"; + } + + return ret; +} + +const char * +mt2str(enum tls13_message_type mt) +{ + const char *ret; + + switch (mt) { + case INVALID: + ret = "INVALID"; + break; + case CLIENT_HELLO: + ret = "CLIENT_HELLO"; + break; + case CLIENT_HELLO_RETRY: + ret = "CLIENT_HELLO_RETRY"; + break; + case CLIENT_END_OF_EARLY_DATA: + ret = "CLIENT_END_OF_EARLY_DATA"; + break; + case CLIENT_CERTIFICATE: + ret = "CLIENT_CERTIFICATE"; + break; + case CLIENT_CERTIFICATE_VERIFY: + ret = "CLIENT_CERTIFICATE_VERIFY"; + break; + case CLIENT_FINISHED: + ret = "CLIENT_FINISHED"; + break; + case CLIENT_KEY_UPDATE: + ret = "CLIENT_KEY_UPDATE"; + break; + case SERVER_HELLO: + ret = "SERVER_HELLO"; + break; + case SERVER_HELLO_RETRY: + ret = "SERVER_HELLO_RETRY"; + break; + case SERVER_NEW_SESSION_TICKET: + ret = "SERVER_NEW_SESSION_TICKET"; + break; + case SERVER_ENCRYPTED_EXTENSIONS: + ret = "SERVER_ENCRYPTED_EXTENSIONS"; + break; + case SERVER_CERTIFICATE: + ret = "SERVER_CERTIFICATE"; + break; + case SERVER_CERTIFICATE_VERIFY: + ret = "SERVER_CERTIFICATE_VERIFY"; + break; + case SERVER_CERTIFICATE_REQUEST: + ret = "SERVER_CERTIFICATE_REQUEST"; + break; + case SERVER_FINISHED: + ret = "SERVER_FINISHED"; + break; + case APPLICATION_DATA: + ret = "APPLICATION_DATA"; + break; + case TLS13_NUM_MESSAGE_TYPES: + ret = "TLS13_NUM_MESSAGE_TYPES"; + break; + default: + ret = "UNKNOWN"; + break; + } + + return ret; +} + +void +fprint_flags(FILE *stream, uint8_t flags) +{ + int first = 1, i; + + if (flags == 0) { + fprintf(stream, "%s", flag2str(flags)); + return; + } + + for (i = 0; i < 8; i++) { + uint8_t set = flags & (1U << i); + + if (set) { + fprintf(stream, "%s%s", first ? "" : " | ", + flag2str(set)); + first = 0; + } + } +} + +void +fprint_entry(FILE *stream, + enum tls13_message_type path[TLS13_NUM_MESSAGE_TYPES], uint8_t flags) +{ + int i; + + fprintf(stream, "\t["); + fprint_flags(stream, flags); + fprintf(stream, "] = {\n"); + + for (i = 0; i < TLS13_NUM_MESSAGE_TYPES; i++) { + if (path[i] == 0) + break; + fprintf(stream, "\t\t%s,\n", mt2str(path[i])); + } + fprintf(stream, "\t},\n"); +} + +void +edge(enum tls13_message_type start, enum tls13_message_type end, + uint8_t flag) +{ + printf("\t%s -> %s", mt2str(start), mt2str(end)); + flag_label(flag); + printf(";\n"); +} + +void +flag_label(uint8_t flag) +{ + if (flag) + printf(" [label=\"%s\"]", flag2str(flag)); +} + +void +forced_edges(enum tls13_message_type start, enum tls13_message_type end, + uint8_t forced) +{ + uint8_t forced_flag, i; + + if (forced == 0) + return; + + for (i = 0; i < 8; i++) { + forced_flag = forced & (1U << i); + if (forced_flag) + edge(start, end, forced_flag); + } +} + +int +generate_graphics(void) +{ + enum tls13_message_type start, end; + unsigned int child; + uint8_t flag; + uint8_t forced; + + printf("digraph G {\n"); + printf("\t%s [shape=box];\n", mt2str(CLIENT_HELLO)); + printf("\t%s [shape=box];\n", mt2str(APPLICATION_DATA)); + + for (start = CLIENT_HELLO; start < APPLICATION_DATA; start++) { + for (child = 0; stateinfo[start][child].mt != 0; child++) { + end = stateinfo[start][child].mt; + flag = stateinfo[start][child].flag; + forced = stateinfo[start][child].forced; + + if (forced == 0) + edge(start, end, flag); + else + forced_edges(start, end, forced); + } + } + + printf("}\n"); + return 0; +} + +extern enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES]; +extern size_t handshake_count; + +size_t +count_handshakes(void) +{ + size_t ret = 0, i; + + for (i = 0; i < handshake_count; i++) { + if (handshakes[i][0] != INVALID) + ret++; + } + + return ret; +} + +void +build_table(enum tls13_message_type table[UINT8_MAX][TLS13_NUM_MESSAGE_TYPES], + struct child current, struct child end, struct child path[], uint8_t flags, + unsigned int depth) +{ + unsigned int i; + + if (depth >= TLS13_NUM_MESSAGE_TYPES - 1) + errx(1, "recursed too deeply"); + + /* Record current node. */ + path[depth++] = current; + flags |= current.flag; + + /* If we haven't reached the end, recurse over the children. */ + if (current.mt != end.mt) { + for (i = 0; stateinfo[current.mt][i].mt != 0; i++) { + struct child child = stateinfo[current.mt][i]; + int forced = stateinfo[current.mt][i].forced; + int illegal = stateinfo[current.mt][i].illegal; + + if ((forced == 0 || (forced & flags)) && + (illegal == 0 || !(illegal & flags))) + build_table(table, child, end, path, flags, + depth); + } + return; + } + + if (flags == 0) + errx(1, "path does not set flags"); + + if (table[flags][0] != 0) + errx(1, "path traversed twice"); + + for (i = 0; i < depth; i++) + table[flags][i] = path[i].mt; +} + +int +verify_table(enum tls13_message_type table[UINT8_MAX][TLS13_NUM_MESSAGE_TYPES], + int print) +{ + int success = 1, i; + size_t num_valid, num_found = 0; + uint8_t flags = 0; + + do { + if (table[flags][0] == 0) + continue; + + num_found++; + + for (i = 0; i < TLS13_NUM_MESSAGE_TYPES; i++) { + if (table[flags][i] != handshakes[flags][i]) { + fprintf(stderr, + "incorrect entry %d of handshake ", i); + fprint_flags(stderr, flags); + fprintf(stderr, "\n"); + success = 0; + } + } + + if (print) + fprint_entry(stdout, table[flags], flags); + } while(++flags != 0); + + num_valid = count_handshakes(); + if (num_valid != num_found) { + fprintf(stderr, + "incorrect number of handshakes: want %zu, got %zu.\n", + num_valid, num_found); + success = 0; + } + + return success; +} + +__dead void +usage(void) +{ + fprintf(stderr, "usage: handshake_table [-C | -g]\n"); + exit(1); +} + +int +main(int argc, char *argv[]) +{ + static enum tls13_message_type + hs_table[UINT8_MAX][TLS13_NUM_MESSAGE_TYPES] = { + [INITIAL] = { + CLIENT_HELLO, + SERVER_HELLO, + }, + }; + struct child start = { + CLIENT_HELLO, DEFAULT, 0, 0, + }; + struct child end = { + APPLICATION_DATA, DEFAULT, 0, 0, + }; + struct child path[TLS13_NUM_MESSAGE_TYPES] = {{0}}; + uint8_t flags = NEGOTIATED; + unsigned int depth = 0; + int ch, graphviz = 0, print = 0; + + while ((ch = getopt(argc, argv, "Cg")) != -1) { + switch (ch) { + case 'C': + print = 1; + break; + case 'g': + graphviz = 1; + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (argc != 0) + usage(); + + if (graphviz && print) + usage(); + + if (graphviz) + return generate_graphics(); + + build_table(hs_table, start, end, path, flags, depth); + if (!verify_table(hs_table, print)) + return 1; + + if (!print) + printf("SUCCESS\n"); + + return 0; +} diff --git a/tests/hkdf_test.c b/tests/hkdf_test.c index 3c04262e..5e89f338 100644 --- a/tests/hkdf_test.c +++ b/tests/hkdf_test.c @@ -1,3 +1,4 @@ +/* $OpenBSD: hkdf_test.c,v 1.2 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (c) 2014, Google Inc. * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/tests/hmactest.c b/tests/hmactest.c index ab75d350..1f120da5 100644 --- a/tests/hmactest.c +++ b/tests/hmactest.c @@ -1,4 +1,4 @@ -/* crypto/hmac/hmactest.c */ +/* $OpenBSD: hmactest.c,v 1.4 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/ideatest.c b/tests/ideatest.c index c6478916..b33b824a 100644 --- a/tests/ideatest.c +++ b/tests/ideatest.c @@ -1,4 +1,4 @@ -/* crypto/idea/ideatest.c */ +/* $OpenBSD: ideatest.c,v 1.2 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/igetest.c b/tests/igetest.c index 7945aab3..2191af85 100644 --- a/tests/igetest.c +++ b/tests/igetest.c @@ -1,4 +1,4 @@ -/* test/igetest.c -*- mode:C; c-file-style: "eay" -*- */ +/* $OpenBSD: igetest.c,v 1.4 2018/07/17 17:06:49 tb Exp $ */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/tests/key_schedule.c b/tests/key_schedule.c new file mode 100644 index 00000000..21751aa0 --- /dev/null +++ b/tests/key_schedule.c @@ -0,0 +1,270 @@ +/* $OpenBSD: key_schedule.c,v 1.6 2018/11/13 01:32:33 beck Exp $ */ +/* + * Copyright (c) 2018 Bob Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#include "ssl_locl.h" + +#include "bytestring.h" +#include "ssl_tlsext.h" +#include "tls13_internal.h" + +static int failures = 0; + +static void +hexdump(const unsigned char *buf, size_t len) +{ + size_t i; + + for (i = 1; i <= len; i++) + fprintf(stderr, " 0x%02hhx,%s", buf[i - 1], i % 8 ? "" : "\n"); + + fprintf(stderr, "\n"); +} + +static void +compare_data(const uint8_t *recv, size_t recv_len, const uint8_t *expect, + size_t expect_len) +{ + fprintf(stderr, "received:\n"); + hexdump(recv, recv_len); + + fprintf(stderr, "test data:\n"); + hexdump(expect, expect_len); +} + +#define FAIL(msg, ...) \ +do { \ + fprintf(stderr, "[%s:%d] FAIL: ", __FILE__, __LINE__); \ + fprintf(stderr, msg, ##__VA_ARGS__); \ + failures++; \ +} while(0) + +/* Hashes and secrets from test vector */ + +uint8_t chello[] = { + 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, + 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, + 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, + 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55 +}; +const struct tls13_secret chello_hash = { + .data = chello, + .len = 32, +}; + +uint8_t cshello [] = { + 0x86, 0x0c, 0x06, 0xed, 0xc0, 0x78, 0x58, 0xee, + 0x8e, 0x78, 0xf0, 0xe7, 0x42, 0x8c, 0x58, 0xed, + 0xd6, 0xb4, 0x3f, 0x2c, 0xa3, 0xe6, 0xe9, 0x5f, + 0x02, 0xed, 0x06, 0x3c, 0xf0, 0xe1, 0xca, 0xd8 +}; + +const struct tls13_secret cshello_hash = { + .data = cshello, + .len = 32, +}; + +const uint8_t ecdhe [] = { + 0x8b, 0xd4, 0x05, 0x4f, 0xb5, 0x5b, 0x9d, 0x63, + 0xfd, 0xfb, 0xac, 0xf9, 0xf0, 0x4b, 0x9f, 0x0d, + 0x35, 0xe6, 0xd6, 0x3f, 0x53, 0x75, 0x63, 0xef, + 0xd4, 0x62, 0x72, 0x90, 0x0f, 0x89, 0x49, 0x2d +}; + +uint8_t csfhello [] = { + 0x96, 0x08, 0x10, 0x2a, 0x0f, 0x1c, 0xcc, 0x6d, + 0xb6, 0x25, 0x0b, 0x7b, 0x7e, 0x41, 0x7b, 0x1a, + 0x00, 0x0e, 0xaa, 0xda, 0x3d, 0xaa, 0xe4, 0x77, + 0x7a, 0x76, 0x86, 0xc9, 0xff, 0x83, 0xdf, 0x13 +}; + +const struct tls13_secret csfhello_hash = { + .data = csfhello, + .len = 32, +}; + + +/* Expected Values */ + +uint8_t expected_extracted_early[] = { + 0x33, 0xad, 0x0a, 0x1c, 0x60, 0x7e, 0xc0, 0x3b, + 0x09, 0xe6, 0xcd, 0x98, 0x93, 0x68, 0x0c, 0xe2, + 0x10, 0xad, 0xf3, 0x00, 0xaa, 0x1f, 0x26, 0x60, + 0xe1, 0xb2, 0x2e, 0x10, 0xf1, 0x70, 0xf9, 0x2a +}; +uint8_t expected_derived_early[] = { + 0x6f, 0x26, 0x15, 0xa1, 0x08, 0xc7, 0x02, 0xc5, + 0x67, 0x8f, 0x54, 0xfc, 0x9d, 0xba, 0xb6, 0x97, + 0x16, 0xc0, 0x76, 0x18, 0x9c, 0x48, 0x25, 0x0c, + 0xeb, 0xea, 0xc3, 0x57, 0x6c, 0x36, 0x11, 0xba +}; +uint8_t expected_extracted_handshake[] = { + 0x1d, 0xc8, 0x26, 0xe9, 0x36, 0x06, 0xaa, 0x6f, + 0xdc, 0x0a, 0xad, 0xc1, 0x2f, 0x74, 0x1b, 0x01, + 0x04, 0x6a, 0xa6, 0xb9, 0x9f, 0x69, 0x1e, 0xd2, + 0x21, 0xa9, 0xf0, 0xca, 0x04, 0x3f, 0xbe, 0xac +}; +uint8_t expected_client_handshake_traffic[] = { + 0xb3, 0xed, 0xdb, 0x12, 0x6e, 0x06, 0x7f, 0x35, + 0xa7, 0x80, 0xb3, 0xab, 0xf4, 0x5e, 0x2d, 0x8f, + 0x3b, 0x1a, 0x95, 0x07, 0x38, 0xf5, 0x2e, 0x96, + 0x00, 0x74, 0x6a, 0x0e, 0x27, 0xa5, 0x5a, 0x21 +}; + +uint8_t expected_server_handshake_traffic[] = { + 0xb6, 0x7b, 0x7d, 0x69, 0x0c, 0xc1, 0x6c, 0x4e, + 0x75, 0xe5, 0x42, 0x13, 0xcb, 0x2d, 0x37, 0xb4, + 0xe9, 0xc9, 0x12, 0xbc, 0xde, 0xd9, 0x10, 0x5d, + 0x42, 0xbe, 0xfd, 0x59, 0xd3, 0x91, 0xad, 0x38 +}; + +uint8_t expected_derived_handshake[] = { + 0x43, 0xde, 0x77, 0xe0, 0xc7, 0x77, 0x13, 0x85, + 0x9a, 0x94, 0x4d, 0xb9, 0xdb, 0x25, 0x90, 0xb5, + 0x31, 0x90, 0xa6, 0x5b, 0x3e, 0xe2, 0xe4, 0xf1, + 0x2d, 0xd7, 0xa0, 0xbb, 0x7c, 0xe2, 0x54, 0xb4 +}; + +uint8_t expected_extracted_master[] = { + 0x18, 0xdf, 0x06, 0x84, 0x3d, 0x13, 0xa0, 0x8b, + 0xf2, 0xa4, 0x49, 0x84, 0x4c, 0x5f, 0x8a, 0x47, + 0x80, 0x01, 0xbc, 0x4d, 0x4c, 0x62, 0x79, 0x84, + 0xd5, 0xa4, 0x1d, 0xa8, 0xd0, 0x40, 0x29, 0x19 +}; + +uint8_t expected_server_application_traffic[] = { + 0xa1, 0x1a, 0xf9, 0xf0, 0x55, 0x31, 0xf8, 0x56, + 0xad, 0x47, 0x11, 0x6b, 0x45, 0xa9, 0x50, 0x32, + 0x82, 0x04, 0xb4, 0xf4, 0x4b, 0xfb, 0x6b, 0x3a, + 0x4b, 0x4f, 0x1f, 0x3f, 0xcb, 0x63, 0x16, 0x43 +}; + +uint8_t expected_exporter_master[] = { + 0xfe, 0x22, 0xf8, 0x81, 0x17, 0x6e, 0xda, 0x18, + 0xeb, 0x8f, 0x44, 0x52, 0x9e, 0x67, 0x92, 0xc5, + 0x0c, 0x9a, 0x3f, 0x89, 0x45, 0x2f, 0x68, 0xd8, + 0xae, 0x31, 0x1b, 0x43, 0x09, 0xd3, 0xcf, 0x50 +}; + +int main () { + struct tls13_secrets *secrets; + + if ((secrets = tls13_secrets_create(EVP_sha256(), 0)) == NULL) + errx(1,"failed to create secrets\n"); + + secrets->insecure = 1; /* don't explicit_bzero when done */ + + if (tls13_derive_handshake_secrets(secrets, ecdhe, 32, &cshello_hash)) + FAIL("derive_handshake_secrets worked when it shouldn't\n"); + if (tls13_derive_application_secrets(secrets, + &chello_hash)) + FAIL("derive_application_secrets worked when it shouldn't\n"); + + if (!tls13_derive_early_secrets(secrets, + secrets->zeros.data, secrets->zeros.len, &chello_hash)) + FAIL("derive_early_secrets failed\n"); + if (tls13_derive_early_secrets(secrets, + secrets->zeros.data, secrets->zeros.len, &chello_hash)) + FAIL("derive_early_secrets worked when it shouldn't(2)\n"); + + if (!tls13_derive_handshake_secrets(secrets, ecdhe, 32, &cshello_hash)) + FAIL("derive_handshake_secrets failed\n"); + if (tls13_derive_handshake_secrets(secrets, ecdhe, 32, &cshello_hash)) + FAIL("derive_handshake_secrets worked when it shouldn't(2)\n"); + + /* XXX fix hash here once test vector sorted */ + if (!tls13_derive_application_secrets(secrets, &csfhello_hash)) + FAIL("derive_application_secrets failed\n"); + if (tls13_derive_application_secrets(secrets, &csfhello_hash)) + FAIL("derive_application_secrets worked when it " + "shouldn't(2)\n"); + + fprintf(stderr, "extracted_early:\n"); + compare_data(secrets->extracted_early.data, 32, + expected_extracted_early, 32); + if (memcmp(secrets->extracted_early.data, + expected_extracted_early, 32) != 0) + FAIL("extracted_early does not match\n"); + + fprintf(stderr, "derived_early:\n"); + compare_data(secrets->derived_early.data, 32, + expected_derived_early, 32); + if (memcmp(secrets->derived_early.data, + expected_derived_early, 32) != 0) + FAIL("derived_early does not match\n"); + + fprintf(stderr, "extracted_handshake:\n"); + compare_data(secrets->extracted_handshake.data, 32, + expected_extracted_handshake, 32); + if (memcmp(secrets->extracted_handshake.data, + expected_extracted_handshake, 32) != 0) + FAIL("extracted_handshake does not match\n"); + + fprintf(stderr, "client_handshake_traffic:\n"); + compare_data(secrets->client_handshake_traffic.data, 32, + expected_client_handshake_traffic, 32); + if (memcmp(secrets->client_handshake_traffic.data, + expected_client_handshake_traffic, 32) != 0) + FAIL("client_handshake_traffic does not match\n"); + + fprintf(stderr, "server_handshake_traffic:\n"); + compare_data(secrets->server_handshake_traffic.data, 32, + expected_server_handshake_traffic, 32); + if (memcmp(secrets->server_handshake_traffic.data, + expected_server_handshake_traffic, 32) != 0) + FAIL("server_handshake_traffic does not match\n"); + + fprintf(stderr, "derived_early:\n"); + compare_data(secrets->derived_early.data, 32, + expected_derived_early, 32); + if (memcmp(secrets->derived_early.data, + expected_derived_early, 32) != 0) + FAIL("derived_early does not match\n"); + + fprintf(stderr, "derived_handshake:\n"); + compare_data(secrets->derived_handshake.data, 32, + expected_derived_handshake, 32); + if (memcmp(secrets->derived_handshake.data, + expected_derived_handshake, 32) != 0) + FAIL("derived_handshake does not match\n"); + + fprintf(stderr, "extracted_master:\n"); + compare_data(secrets->extracted_master.data, 32, + expected_extracted_master, 32); + if (memcmp(secrets->extracted_master.data, + expected_extracted_master, 32) != 0) + FAIL("extracted_master does not match\n"); + + fprintf(stderr, "server_application_traffic:\n"); + compare_data(secrets->server_application_traffic.data, 32, + expected_server_application_traffic, 32); + if (memcmp(secrets->server_application_traffic.data, + expected_server_application_traffic, 32) != 0) + FAIL("server_application_traffic does not match\n"); + + fprintf(stderr, "exporter_master:\n"); + compare_data(secrets->exporter_master.data, 32, + expected_exporter_master, 32); + if (memcmp(secrets->exporter_master.data, + expected_exporter_master, 32) != 0) + FAIL("exporter_master does not match\n"); + + tls13_secrets_destroy(secrets); + + return failures; +} diff --git a/tests/keypairtest.c b/tests/keypairtest.c new file mode 100644 index 00000000..d9a3b5fa --- /dev/null +++ b/tests/keypairtest.c @@ -0,0 +1,215 @@ +/* $OpenBSD: keypairtest.c,v 1.4 2018/04/07 16:42:17 jsing Exp $ */ +/* + * Copyright (c) 2018 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef _MSC_VER +#define NO_REDEF_POSIX_FUNCTIONS +#endif + +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#define PUBKEY_HASH \ + "SHA256:858d0f94beb0a08eb4f13871ba57bf0a2e081287d0efbaeb3bbac59dd8f1a8e5" + +char *cert_file, *key_file, *ocsp_staple_file; + +static void +load_file(const char *filename, const uint8_t **data, size_t *data_len) +{ + struct stat sb; + uint8_t *buf; + size_t len; + ssize_t n; + int fd; + + if ((fd = open(filename, O_RDONLY)) == -1) + err(1, "failed to open '%s'", filename); + if ((fstat(fd, &sb)) == -1) + err(1, "failed to stat '%s'", filename); + if (sb.st_size < 0) + err(1, "file size invalid for '%s'", filename); + len = (size_t)sb.st_size; + if ((buf = malloc(len)) == NULL) + err(1, "out of memory"); + n = read(fd, buf, len); + if (n < 0 || (size_t)n != len) + err(1, "failed to read '%s'", filename); + close(fd); + + *data = buf; + *data_len = len; +} + +static int +compare_mem(char *label, const uint8_t *data1, size_t data1_len, + const uint8_t *data2, size_t data2_len) +{ + if (data1_len != data2_len) { + fprintf(stderr, "FAIL: %s length mismatch (%zu != %zu)\n", + label, data1_len, data2_len); + return -1; + } + if (data1 == data2) { + fprintf(stderr, "FAIL: %s comparing same memory (%p == %p)\n", + label, data1, data2); + return -1; + } + if (memcmp(data1, data2, data1_len) != 0) { + fprintf(stderr, "FAIL: %s data mismatch\n", label); + return -1; + } + return 0; +} + +static int +do_keypair_tests(void) +{ + size_t cert_len, key_len, ocsp_staple_len; + const uint8_t *cert, *key, *ocsp_staple; + X509 *x509_cert = NULL; + struct tls_keypair *kp; + struct tls_error err; + char *hash = NULL; + int failed = 1; + + load_file(cert_file, &cert, &cert_len); + load_file(key_file, &key, &key_len); + load_file(ocsp_staple_file, &ocsp_staple, &ocsp_staple_len); + + if ((kp = tls_keypair_new()) == NULL) { + fprintf(stderr, "FAIL: failed to create keypair\n"); + goto done; + } + + if (tls_keypair_set_cert_file(kp, &err, cert_file) == -1) { + fprintf(stderr, "FAIL: failed to load cert file: %s\n", + err.msg); + goto done; + } + if (tls_keypair_set_key_file(kp, &err, key_file) == -1) { + fprintf(stderr, "FAIL: failed to load key file: %s\n", err.msg); + goto done; + } + if (tls_keypair_set_ocsp_staple_file(kp, &err, ocsp_staple_file) == -1) { + fprintf(stderr, "FAIL: failed to load ocsp staple file: %s\n", + err.msg); + goto done; + } + + if (compare_mem("certificate", cert, cert_len, kp->cert_mem, + kp->cert_len) == -1) + goto done; + if (compare_mem("key", key, key_len, kp->key_mem, kp->cert_len) == -1) + goto done; + if (compare_mem("ocsp staple", ocsp_staple, ocsp_staple_len, + kp->ocsp_staple, kp->ocsp_staple_len) == -1) + goto done; + if (strcmp(kp->pubkey_hash, PUBKEY_HASH) != 0) { + fprintf(stderr, "FAIL: got pubkey hash '%s', want '%s'", + hash, PUBKEY_HASH); + goto done; + } + + tls_keypair_clear_key(kp); + + if (kp->key_mem != NULL || kp->key_len != 0) { + fprintf(stderr, "FAIL: key not cleared (mem %p, len %zu)", + kp->key_mem, kp->key_len); + goto done; + } + + if (tls_keypair_set_cert_mem(kp, &err, cert, cert_len) == -1) { + fprintf(stderr, "FAIL: failed to load cert: %s\n", err.msg); + goto done; + } + if (tls_keypair_set_key_mem(kp, &err, key, key_len) == -1) { + fprintf(stderr, "FAIL: failed to load key: %s\n", err.msg); + goto done; + } + if (tls_keypair_set_ocsp_staple_mem(kp, &err, ocsp_staple, + ocsp_staple_len) == -1) { + fprintf(stderr, "FAIL: failed to load ocsp staple: %s\n", err.msg); + goto done; + } + if (compare_mem("certificate", cert, cert_len, kp->cert_mem, + kp->cert_len) == -1) + goto done; + if (compare_mem("key", key, key_len, kp->key_mem, kp->cert_len) == -1) + goto done; + if (compare_mem("ocsp staple", ocsp_staple, ocsp_staple_len, + kp->ocsp_staple, kp->ocsp_staple_len) == -1) + goto done; + if (strcmp(kp->pubkey_hash, PUBKEY_HASH) != 0) { + fprintf(stderr, "FAIL: got pubkey hash '%s', want '%s'", + hash, PUBKEY_HASH); + goto done; + } + + if (tls_keypair_load_cert(kp, &err, &x509_cert) == -1) { + fprintf(stderr, "FAIL: failed to load X509 certificate: %s\n", + err.msg); + goto done; + } + + tls_keypair_clear_key(kp); + + if (kp->key_mem != NULL || kp->key_len != 0) { + fprintf(stderr, "FAIL: key not cleared (mem %p, len %zu)", + kp->key_mem, kp->key_len); + goto done; + } + + tls_keypair_free(kp); + + failed = 0; + + done: + X509_free(x509_cert); + free(hash); + + return (failed); +} + +int +main(int argc, char **argv) +{ + int failure = 0; + + if (argc != 4) { + fprintf(stderr, "usage: %s ocspstaplefile certfile keyfile\n", + argv[0]); + return (1); + } + + ocsp_staple_file = argv[1]; + cert_file = argv[2]; + key_file = argv[3]; + + failure |= do_keypair_tests(); + + return (failure); +} diff --git a/tests/keypairtest.sh b/tests/keypairtest.sh new file mode 100644 index 00000000..3c24869b --- /dev/null +++ b/tests/keypairtest.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -e +TEST=./keypairtest +if [ -e ./keypairtest.exe ]; then + TEST=./keypairtest.exe +fi + +if [ -z $srcdir ]; then + srcdir=. +fi + +$TEST $srcdir/ca.pem $srcdir/server.pem $srcdir/server.pem diff --git a/tests/md4test.c b/tests/md4test.c index 60b2c0ee..7279e40f 100644 --- a/tests/md4test.c +++ b/tests/md4test.c @@ -1,4 +1,4 @@ -/* crypto/md4/md4test.c */ +/* $OpenBSD: md4test.c,v 1.4 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/md5test.c b/tests/md5test.c index 481ddaa4..92b1b4a2 100644 --- a/tests/md5test.c +++ b/tests/md5test.c @@ -1,4 +1,4 @@ -/* crypto/md5/md5test.c */ +/* $OpenBSD: md5test.c,v 1.2 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/ocsp_test.c b/tests/ocsp_test.c index 995ea180..94ef73e7 100644 --- a/tests/ocsp_test.c +++ b/tests/ocsp_test.c @@ -1,3 +1,20 @@ +/* $OpenBSD: ocsp_test.c,v 1.6 2018/07/18 16:24:16 tb Exp $ */ +/* + * Copyright (c) 2016 Bob Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + #include #include #include diff --git a/tests/ocsptest.bat b/tests/ocsptest.bat index ef5a483a..058aeaf9 100644 --- a/tests/ocsptest.bat +++ b/tests/ocsptest.bat @@ -1,11 +1,12 @@ @echo off setlocal enabledelayedexpansion -REM ocsptest.bat +REM ocspocsp_test_bin.bat -set TEST=Debug\ocsp_test.exe -if not exist %TEST% exit /b 1 +set ocsp_test_bin=%1 +set ocsp_test_bin=%ocsp_test_bin:/=\% +if not exist %ocsp_test_bin% exit /b 1 -%TEST% www.amazon.com 443 & if !errorlevel! neq 0 exit /b 1 -%TEST% cloudflare.com 443 & if !errorlevel! neq 0 exit /b 1 +%ocsp_test_bin% www.amazon.com 443 & if !errorlevel! neq 0 exit /b 1 +%ocsp_test_bin% cloudflare.com 443 & if !errorlevel! neq 0 exit /b 1 endlocal diff --git a/tests/pbkdf2.c b/tests/pbkdf2.c index 591213fe..9cbc0318 100644 --- a/tests/pbkdf2.c +++ b/tests/pbkdf2.c @@ -1,3 +1,4 @@ +/* $OpenBSD: pbkdf2.c,v 1.2 2018/07/17 17:06:49 tb Exp $ */ /* Written by Christian Heimes, 2013 */ /* * Copyright (c) 2013 The OpenSSL Project. All rights reserved. diff --git a/tests/pkcs7test.c b/tests/pkcs7test.c index 55483073..5a72586c 100644 --- a/tests/pkcs7test.c +++ b/tests/pkcs7test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs7test.c,v 1.3 2014/11/26 05:48:00 bcook Exp $ */ +/* $OpenBSD: pkcs7test.c,v 1.4 2018/11/10 02:23:28 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -203,10 +203,12 @@ main(int argc, char **argv) fatal("PEM_read_bio_PKCS7"); if (PKCS7_decrypt(p7, pkey, cert, bio_out, 0) != 1) fatal("PKCS7_decrypt"); + PKCS7_free(p7); len = BIO_get_mem_data(bio_out, &out); message_compare(out, len); + BIO_free(bio_in); BIO_free(bio_out); /* @@ -235,6 +237,7 @@ main(int argc, char **argv) fatal("PEM_read_bio_PKCS7"); if (PKCS7_verify(p7, certs, store, NULL, bio_out, 0) != 1) fatal("PKCS7_verify"); + PKCS7_free(p7); len = BIO_get_mem_data(bio_out, &out); message_compare(out, len); @@ -277,6 +280,7 @@ main(int argc, char **argv) fatal("PEM_read_bio_PKCS7"); if (PKCS7_verify(p7, certs, store, bio_content, bio_out, flags) != 1) fatal("PKCS7_verify"); + PKCS7_free(p7); len = BIO_get_mem_data(bio_out, &out); message_compare(out, len); @@ -284,6 +288,14 @@ main(int argc, char **argv) BIO_free(bio_in); BIO_free(bio_out); BIO_free(bio_content); + BIO_free(bio_cert); + BIO_free(bio_pkey); + + EVP_PKEY_free(pkey); + + X509_free(cert); + X509_STORE_free(store); + sk_X509_free(certs); return 0; } diff --git a/tests/poly1305test.c b/tests/poly1305test.c index 91e296e3..3f9af0db 100644 --- a/tests/poly1305test.c +++ b/tests/poly1305test.c @@ -1,3 +1,4 @@ +/* $OpenBSD: poly1305test.c,v 1.3 2018/07/17 17:06:49 tb Exp $ */ /* * Public Domain poly1305 from Andrew Moon * Based on poly1305-donna.c from: diff --git a/tests/pq_test.bat b/tests/pq_test.bat index 893cdd92..15e0c51e 100644 --- a/tests/pq_test.bat +++ b/tests/pq_test.bat @@ -2,13 +2,14 @@ setlocal enabledelayedexpansion REM pq_test.bat -set TEST=Debug\pq_test.exe -if not exist %TEST% exit /b 1 +set pq_test_bin=%1 +set pq_test_bin=%pq_test_bin:/=\% +if not exist %pq_test_bin% exit /b 1 set pq_output=pq_output.txt if exist %pq_output% del %pq_output% -%TEST% > %pq_output% +%pq_test_bin% > %pq_output% fc /b %pq_output% %srcdir%\pq_expected.txt endlocal diff --git a/tests/randtest.c b/tests/randtest.c index 7217c14c..d0f02ad2 100644 --- a/tests/randtest.c +++ b/tests/randtest.c @@ -1,4 +1,4 @@ -/* crypto/rand/randtest.c */ +/* $OpenBSD: randtest.c,v 1.3 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/rc2test.c b/tests/rc2test.c index 80e1b303..a8d33077 100644 --- a/tests/rc2test.c +++ b/tests/rc2test.c @@ -1,4 +1,4 @@ -/* crypto/rc2/rc2test.c */ +/* $OpenBSD: rc2test.c,v 1.2 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/rc4test.c b/tests/rc4test.c index c4d34b1a..c1d98eb8 100644 --- a/tests/rc4test.c +++ b/tests/rc4test.c @@ -1,4 +1,4 @@ -/* crypto/rc4/rc4test.c */ +/* $OpenBSD: rc4test.c,v 1.4 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/recordtest.c b/tests/recordtest.c new file mode 100644 index 00000000..42bba88c --- /dev/null +++ b/tests/recordtest.c @@ -0,0 +1,554 @@ +/* + * Copyright (c) 2019 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include + +#include "tls13_internal.h" +#include "tls13_record.h" + +/* Valid record. */ +static uint8_t test_record_1[] = { + 0x16, 0x03, 0x03, 0x00, 0x7a, 0x02, 0x00, 0x00, + 0x76, 0x03, 0x03, 0x14, 0xae, 0x2b, 0x6d, 0x58, + 0xe9, 0x79, 0x9d, 0xd4, 0x90, 0x52, 0x90, 0x13, + 0x1c, 0x08, 0xaa, 0x3f, 0x5b, 0xfb, 0x64, 0xfe, + 0x9a, 0xca, 0x73, 0x6d, 0x87, 0x8d, 0x8b, 0x3b, + 0x70, 0x14, 0xa3, 0x20, 0xd7, 0x50, 0xa4, 0xe5, + 0x17, 0x42, 0x5d, 0xce, 0xe6, 0xfe, 0x1b, 0x59, + 0x27, 0x6b, 0xff, 0xc8, 0x40, 0xc7, 0xac, 0x16, + 0x32, 0xe6, 0x5b, 0xd2, 0xd9, 0xd4, 0xb5, 0x3f, + 0x8f, 0x74, 0x6e, 0x7d, 0x13, 0x02, 0x00, 0x00, + 0x2e, 0x00, 0x33, 0x00, 0x24, 0x00, 0x1d, 0x00, + 0x20, 0x72, 0xb0, 0xaf, 0x7f, 0xf5, 0x89, 0x0f, + 0xcd, 0x6e, 0x45, 0xb1, 0x51, 0xa0, 0xbd, 0x1e, + 0xee, 0x7e, 0xf1, 0xa5, 0xc5, 0xc6, 0x7e, 0x5f, + 0x6a, 0xca, 0xc9, 0xe4, 0xae, 0xb9, 0x50, 0x76, + 0x0a, 0x00, 0x2b, 0x00, 0x02, 0x03, 0x04, +}; + +/* Truncated record. */ +static uint8_t test_record_2[] = { + 0x17, 0x03, 0x03, 0x41, 0x00, 0x02, 0x00, 0x00, +}; + +/* Oversized and truncated record. */ +static uint8_t test_record_3[] = { + 0x17, 0x03, 0x03, 0x41, 0x01, 0x02, 0x00, 0x00, +}; + +static void +hexdump(const unsigned char *buf, size_t len) +{ + size_t i; + + for (i = 1; i <= len; i++) + fprintf(stderr, " 0x%02x,%s", buf[i - 1], i % 8 ? "" : "\n"); + if (len % 8 != 0) + fprintf(stderr, "\n"); +} + +struct rw_state { + uint8_t *buf; + size_t len; + size_t offset; + uint8_t eof; +}; + +static ssize_t +read_cb(void *buf, size_t buflen, void *cb_arg) +{ + struct rw_state *rs = cb_arg; + ssize_t n; + + if (rs->eof) + return TLS13_IO_EOF; + + if ((size_t)(n = buflen) > (rs->len - rs->offset)) + n = rs->len - rs->offset; + + if (n == 0) + return TLS13_IO_WANT_POLLIN; + + memcpy(buf, &rs->buf[rs->offset], n); + rs->offset += n; + + return n; +} + +static ssize_t +write_cb(const void *buf, size_t buflen, void *cb_arg) +{ + struct rw_state *ws = cb_arg; + ssize_t n; + + if (ws->eof) + return TLS13_IO_EOF; + + if ((size_t)(n = buflen) > (ws->len - ws->offset)) + n = ws->len - ws->offset; + + if (n == 0) + return TLS13_IO_WANT_POLLOUT; + + memcpy(&ws->buf[ws->offset], buf, n); + ws->offset += n; + + return n; +} + +struct record_test { + size_t rw_len; + int eof; + ssize_t want_ret; +}; + +struct record_recv_test { + uint8_t *read_buf; + struct record_test rt[10]; + uint8_t want_content_type; + uint8_t *want_data; + size_t want_len; +}; + +struct record_recv_test record_recv_tests[] = { + { + .read_buf = test_record_1, + .rt = { + { + .rw_len = sizeof(test_record_1), + .want_ret = sizeof(test_record_1), + }, + }, + .want_content_type = SSL3_RT_HANDSHAKE, + .want_data = test_record_1, + .want_len = sizeof(test_record_1), + }, + { + .read_buf = test_record_1, + .rt = { + { + .rw_len = 0, + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .rw_len = sizeof(test_record_1), + .want_ret = sizeof(test_record_1), + }, + }, + .want_content_type = SSL3_RT_HANDSHAKE, + .want_data = test_record_1, + .want_len = sizeof(test_record_1), + }, + { + .read_buf = test_record_1, + .rt = { + { + .rw_len = 0, + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .rw_len = 5, + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .rw_len = sizeof(test_record_1), + .want_ret = sizeof(test_record_1), + }, + }, + .want_content_type = SSL3_RT_HANDSHAKE, + .want_data = test_record_1, + .want_len = sizeof(test_record_1), + }, + { + .read_buf = test_record_1, + .rt = { + { + .rw_len = 0, + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .rw_len = 2, + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .rw_len = 6, + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .rw_len = sizeof(test_record_1), + .want_ret = sizeof(test_record_1), + }, + }, + .want_content_type = SSL3_RT_HANDSHAKE, + .want_data = test_record_1, + .want_len = sizeof(test_record_1), + }, + { + .read_buf = test_record_1, + .rt = { + { + .rw_len = 4, + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .eof = 1, + .want_ret = TLS13_IO_EOF, + }, + }, + }, + { + .read_buf = test_record_1, + .rt = { + { + .eof = 1, + .want_ret = TLS13_IO_EOF, + }, + }, + }, + { + .read_buf = test_record_2, + .rt = { + { + .rw_len = sizeof(test_record_2), + .want_ret = TLS13_IO_WANT_POLLIN, + }, + { + .eof = 1, + .want_ret = TLS13_IO_EOF, + }, + }, + .want_content_type = SSL3_RT_APPLICATION_DATA, + }, + { + .read_buf = test_record_3, + .rt = { + { + .rw_len = sizeof(test_record_3), + .want_ret = TLS13_IO_FAILURE, + }, + }, + }, +}; + +#define N_RECORD_RECV_TESTS (sizeof(record_recv_tests) / sizeof(record_recv_tests[0])) + +struct record_send_test { + uint8_t *data; + size_t data_len; + struct record_test rt[10]; + uint8_t *want_data; + size_t want_len; +}; + +struct record_send_test record_send_tests[] = { + { + .data = test_record_1, + .data_len = sizeof(test_record_1), + .rt = { + { + .rw_len = sizeof(test_record_1), + .want_ret = sizeof(test_record_1), + }, + }, + .want_data = test_record_1, + .want_len = sizeof(test_record_1), + }, + { + .data = test_record_1, + .data_len = sizeof(test_record_1), + .rt = { + { + .rw_len = 0, + .want_ret = TLS13_IO_WANT_POLLOUT, + }, + { + .rw_len = sizeof(test_record_1), + .want_ret = sizeof(test_record_1), + }, + }, + .want_data = test_record_1, + .want_len = sizeof(test_record_1), + }, + { + .data = test_record_1, + .data_len = sizeof(test_record_1), + .rt = { + { + .rw_len = 0, + .want_ret = TLS13_IO_WANT_POLLOUT, + }, + { + .rw_len = 5, + .want_ret = TLS13_IO_WANT_POLLOUT, + }, + { + .rw_len = sizeof(test_record_1), + .want_ret = sizeof(test_record_1), + }, + }, + .want_data = test_record_1, + .want_len = sizeof(test_record_1), + }, + { + .data = test_record_1, + .data_len = sizeof(test_record_1), + .rt = { + { + .rw_len = 0, + .want_ret = TLS13_IO_WANT_POLLOUT, + }, + { + .rw_len = 2, + .want_ret = TLS13_IO_WANT_POLLOUT, + }, + { + .rw_len = 6, + .want_ret = TLS13_IO_WANT_POLLOUT, + }, + { + .rw_len = sizeof(test_record_1), + .want_ret = sizeof(test_record_1), + }, + }, + .want_data = test_record_1, + .want_len = sizeof(test_record_1), + }, + { + .data = test_record_1, + .data_len = sizeof(test_record_1), + .rt = { + { + .rw_len = 4, + .want_ret = TLS13_IO_WANT_POLLOUT, + }, + { + .eof = 1, + .want_ret = TLS13_IO_EOF, + }, + }, + .want_data = test_record_1, + .want_len = 4, + }, + { + .data = test_record_1, + .data_len = sizeof(test_record_1), + .rt = { + { + .rw_len = 0, + .want_ret = TLS13_IO_WANT_POLLOUT, + }, + { + .eof = 1, + .want_ret = TLS13_IO_EOF, + }, + }, + .want_data = NULL, + .want_len = 0, + }, +}; + +#define N_RECORD_SEND_TESTS (sizeof(record_send_tests) / sizeof(record_send_tests[0])) + +static int +test_record_recv(size_t test_no, struct record_recv_test *rrt) +{ + struct tls13_record *rec; + struct rw_state rs; + int failed = 1; + ssize_t ret; + size_t i; + CBS cbs; + + rs.buf = rrt->read_buf; + rs.offset = 0; + + if ((rec = tls13_record_new()) == NULL) + errx(1, "tls13_record_new"); + + for (i = 0; rrt->rt[i].rw_len != 0 || rrt->rt[i].want_ret != 0; i++) { + rs.eof = rrt->rt[i].eof; + rs.len = rrt->rt[i].rw_len; + + ret = tls13_record_recv(rec, read_cb, &rs); + if (ret != rrt->rt[i].want_ret) { + fprintf(stderr, "FAIL: Test %zu/%zu - tls_record_recv " + "returned %zi, want %zi\n", test_no, i, ret, + rrt->rt[i].want_ret); + goto failure; + } + } + + if (tls13_record_content_type(rec) != rrt->want_content_type) { + fprintf(stderr, "FAIL: Test %zu - got content type %u, " + "want %u\n", test_no, tls13_record_content_type(rec), + rrt->want_content_type); + goto failure; + } + + tls13_record_data(rec, &cbs); + if (rrt->want_data == NULL) { + if (CBS_data(&cbs) != NULL || CBS_len(&cbs) != 0) { + fprintf(stderr, "FAIL: Test %zu - got CBS with data, " + "want NULL\n", test_no); + goto failure; + } + goto done; + } + if (!CBS_mem_equal(&cbs, rrt->want_data, rrt->want_len)) { + fprintf(stderr, "FAIL: Test %zu - data mismatch\n", test_no); + fprintf(stderr, "Got record data:\n"); + hexdump(CBS_data(&cbs), CBS_len(&cbs)); + fprintf(stderr, "Want record data:\n"); + hexdump(rrt->want_data, rrt->want_len); + goto failure; + } + + if (!tls13_record_header(rec, &cbs)) { + fprintf(stderr, "FAIL: Test %zu - fail to get record " + "header", test_no); + goto failure; + } + if (!CBS_mem_equal(&cbs, rrt->want_data, TLS13_RECORD_HEADER_LEN)) { + fprintf(stderr, "FAIL: Test %zu - header mismatch\n", test_no); + fprintf(stderr, "Got record header:\n"); + hexdump(CBS_data(&cbs), CBS_len(&cbs)); + fprintf(stderr, "Want record header:\n"); + hexdump(rrt->want_data, rrt->want_len); + goto failure; + } + + if (!tls13_record_content(rec, &cbs)) { + fprintf(stderr, "FAIL: Test %zu - fail to get record " + "content", test_no); + goto failure; + } + if (!CBS_mem_equal(&cbs, rrt->want_data + TLS13_RECORD_HEADER_LEN, + rrt->want_len - TLS13_RECORD_HEADER_LEN)) { + fprintf(stderr, "FAIL: Test %zu - content mismatch\n", test_no); + fprintf(stderr, "Got record content:\n"); + hexdump(CBS_data(&cbs), CBS_len(&cbs)); + fprintf(stderr, "Want record content:\n"); + hexdump(rrt->want_data, rrt->want_len); + goto failure; + } + + done: + failed = 0; + + failure: + tls13_record_free(rec); + + return failed; +} + +static int +test_record_send(size_t test_no, struct record_send_test *rst) +{ + uint8_t *data = NULL; + struct tls13_record *rec; + struct rw_state ws; + int failed = 1; + ssize_t ret; + size_t i; + + if ((ws.buf = malloc(TLS13_RECORD_MAX_LEN)) == NULL) + errx(1, "malloc"); + + ws.offset = 0; + + if ((rec = tls13_record_new()) == NULL) + errx(1, "tls13_record_new"); + + if ((data = malloc(rst->data_len)) == NULL) + errx(1, "malloc"); + memcpy(data, rst->data, rst->data_len); + + if (!tls13_record_set_data(rec, data, rst->data_len)) { + fprintf(stderr, "FAIL: Test %zu - failed to set record data\n", + test_no); + goto failure; + } + data = NULL; + + for (i = 0; rst->rt[i].rw_len != 0 || rst->rt[i].want_ret != 0; i++) { + ws.eof = rst->rt[i].eof; + ws.len = rst->rt[i].rw_len; + + ret = tls13_record_send(rec, write_cb, &ws); + if (ret != rst->rt[i].want_ret) { + fprintf(stderr, "FAIL: Test %zu/%zu - tls_record_send " + "returned %zi, want %zi\n", test_no, i, ret, + rst->rt[i].want_ret); + goto failure; + } + } + + if (rst->want_data != NULL && + memcmp(ws.buf, rst->want_data, rst->want_len) != 0) { + fprintf(stderr, "FAIL: Test %zu - content mismatch\n", test_no); + fprintf(stderr, "Got record data:\n"); + hexdump(rst->data, rst->data_len); + fprintf(stderr, "Want record data:\n"); + hexdump(rst->want_data, rst->want_len); + goto failure; + } + + failed = 0; + + failure: + tls13_record_free(rec); + free(ws.buf); + + return failed; +} + +static int +test_recv_records(void) +{ + int failed = 0; + size_t i; + + for (i = 0; i < N_RECORD_RECV_TESTS; i++) + failed |= test_record_recv(i, &record_recv_tests[i]); + + return failed; +} + +static int +test_send_records(void) +{ + int failed = 0; + size_t i; + + for (i = 0; i < N_RECORD_SEND_TESTS; i++) + failed |= test_record_send(i, &record_send_tests[i]); + + return failed; +} + +int +main(int argc, char **argv) +{ + int failed = 0; + + failed |= test_recv_records(); + failed |= test_send_records(); + + return failed; +} diff --git a/tests/rmdtest.c b/tests/rmdtest.c index 1a488fb1..aa6cb017 100644 --- a/tests/rmdtest.c +++ b/tests/rmdtest.c @@ -1,4 +1,4 @@ -/* crypto/ripemd/rmdtest.c */ +/* $OpenBSD: rmdtest.c,v 1.2 2018/07/17 17:06:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 0bb08264..9e7cd6f4 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -1,3 +1,4 @@ +/* $OpenBSD: rsa_test.c,v 1.3 2018/07/17 17:06:49 tb Exp $ */ /* * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. * diff --git a/tests/servertest.bat b/tests/servertest.bat index 1232ad5d..815fbb0b 100644 --- a/tests/servertest.bat +++ b/tests/servertest.bat @@ -2,13 +2,10 @@ setlocal enabledelayedexpansion REM servertest.bat -set servertest_bin=Debug\servertest.exe +set servertest_bin=%1 +set servertest_bin=%servertest_bin:/=\% if not exist %servertest_bin% exit /b 1 -if "%srcdir%"=="" ( - set srcdir=. -) - %servertest_bin% %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem if !errorlevel! neq 0 ( exit /b 1 diff --git a/tests/sha1test.c b/tests/sha1test.c index b7251b31..7f28ba67 100644 --- a/tests/sha1test.c +++ b/tests/sha1test.c @@ -1,4 +1,4 @@ -/* crypto/sha/sha1test.c */ +/* $OpenBSD: sha1test.c,v 1.3 2018/07/17 17:06:50 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/tests/sha256test.c b/tests/sha256test.c index 1515e303..9c22bc76 100644 --- a/tests/sha256test.c +++ b/tests/sha256test.c @@ -1,4 +1,4 @@ -/* crypto/sha/sha256t.c */ +/* $OpenBSD: sha256test.c,v 1.3 2018/07/17 17:06:50 tb Exp $ */ /* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved. * ==================================================================== diff --git a/tests/sha512test.c b/tests/sha512test.c index 453be517..bbcec93a 100644 --- a/tests/sha512test.c +++ b/tests/sha512test.c @@ -1,4 +1,4 @@ -/* crypto/sha/sha512t.c */ +/* $OpenBSD: sha512test.c,v 1.4 2018/07/17 17:06:50 tb Exp $ */ /* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved. * ==================================================================== diff --git a/tests/sm3test.c b/tests/sm3test.c new file mode 100644 index 00000000..66113728 --- /dev/null +++ b/tests/sm3test.c @@ -0,0 +1,98 @@ +/* $OpenBSD: sm3test.c,v 1.2 2018/11/12 15:55:59 tb Exp $ */ +/* + * Copyright (c) 2018 Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +#include + +#define SM3_TESTS 3 + +const char *sm3_input[SM3_TESTS] = { + "", + "abc", + "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd", +}; + +const uint8_t sm3_expected[SM3_TESTS][32] = { + { + 0x1a, 0xb2, 0x1d, 0x83, 0x55, 0xcf, 0xa1, 0x7f, + 0x8e, 0x61, 0x19, 0x48, 0x31, 0xe8, 0x1a, 0x8f, + 0x22, 0xbe, 0xc8, 0xc7, 0x28, 0xfe, 0xfb, 0x74, + 0x7e, 0xd0, 0x35, 0xeb, 0x50, 0x82, 0xaa, 0x2b, + }, + { + 0x66, 0xc7, 0xf0, 0xf4, 0x62, 0xee, 0xed, 0xd9, + 0xd1, 0xf2, 0xd4, 0x6b, 0xdc, 0x10, 0xe4, 0xe2, + 0x41, 0x67, 0xc4, 0x87, 0x5c, 0xf2, 0xf7, 0xa2, + 0x29, 0x7d, 0xa0, 0x2b, 0x8f, 0x4b, 0xa8, 0xe0, + }, + { + 0xde, 0xbe, 0x9f, 0xf9, 0x22, 0x75, 0xb8, 0xa1, + 0x38, 0x60, 0x48, 0x89, 0xc1, 0x8e, 0x5a, 0x4d, + 0x6f, 0xdb, 0x70, 0xe5, 0x38, 0x7e, 0x57, 0x65, + 0x29, 0x3d, 0xcb, 0xa3, 0x9c, 0x0c, 0x57, 0x32, + }, +}; + +/* Tweaked version of libssl/key_schedule/key_schedule.c. */ +static void +hexdump(const uint8_t *buf, size_t len) +{ + size_t i; + + for (i = 1; i <= len; i++) + fprintf(stderr, " 0x%02x,%s", buf[i - 1], (i % 8) ? "" : "\n"); + + if (i % 8 != 1) + fprintf(stderr, "\n"); +} + +int +main(int argc, char *argv[]) +{ + EVP_MD_CTX *ctx; + uint8_t digest[32]; + int numerrors = 0, i; + + if ((ctx = EVP_MD_CTX_new()) == NULL) + err(1, NULL); + + for (i = 0; i != SM3_TESTS; ++i) { + if (!EVP_DigestInit(ctx, EVP_sm3())) + errx(1, "EVP_DigestInit() failed"); + if (!EVP_DigestUpdate(ctx, sm3_input[i], strlen(sm3_input[i]))) + errx(1, "EVP_DigestInit() failed"); + if (!EVP_DigestFinal(ctx, digest, NULL)) + errx(1, "EVP_DigestFinal() failed"); + + if (memcmp(digest, sm3_expected[i], sizeof(digest)) != 0) { + fprintf(stderr, "TEST %d failed\n", i); + fprintf(stderr, "Produced:\n"); + hexdump(digest, sizeof(digest)); + fprintf(stderr, "Expected:\n"); + hexdump(sm3_expected[i], sizeof(sm3_expected[i])); + numerrors++; + } else + fprintf(stderr, "SM3 test %d ok\n", i); + } + + EVP_MD_CTX_free(ctx); + + return (numerrors > 0) ? 1 : 0; +} diff --git a/tests/sm4test.c b/tests/sm4test.c new file mode 100644 index 00000000..1bfdbb63 --- /dev/null +++ b/tests/sm4test.c @@ -0,0 +1,108 @@ +/* $OpenBSD: sm4test.c,v 1.1 2019/03/17 17:48:31 tb Exp $ */ +/* + * Copyright (c) 2017, 2019 Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +#include + +static void +hexdump(FILE *fp, const char *title, const uint8_t *buf, size_t len) +{ + size_t i; + + fprintf(fp, "%s:\n", title); + for (i = 1; i <= len; i++) + fprintf(fp, " 0x%02x,%s", buf[i - 1], (i % 8) ? "" : "\n"); + + if (i % 8 != 1) + fprintf(fp, "\n"); +} + +int +main(int argc, char *argv[]) +{ + int i; + SM4_KEY key; + uint8_t block[SM4_BLOCK_SIZE]; + + static const uint8_t k[SM4_BLOCK_SIZE] = { + 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 + }; + + static const uint8_t input[SM4_BLOCK_SIZE] = { + 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 + }; + + /* + * This test vector comes from Example 1 of GB/T 32907-2016, + * and described in Internet Draft draft-ribose-cfrg-sm4-02. + */ + static const uint8_t expected[SM4_BLOCK_SIZE] = { + 0x68, 0x1e, 0xdf, 0x34, 0xd2, 0x06, 0x96, 0x5e, + 0x86, 0xb3, 0xe9, 0x4f, 0x53, 0x6e, 0x42, 0x46 + }; + + /* + * This test vector comes from Example 2 from GB/T 32907-2016, + * and described in Internet Draft draft-ribose-cfrg-sm4-02. + * After 1,000,000 iterations. + */ + static const uint8_t expected_iter[SM4_BLOCK_SIZE] = { + 0x59, 0x52, 0x98, 0xc7, 0xc6, 0xfd, 0x27, 0x1f, + 0x04, 0x02, 0xf8, 0x04, 0xc3, 0x3d, 0x3f, 0x66 + }; + + if (!SM4_set_key(k, &key)) + errx(1, "SM4_set_key() failed"); + + memcpy(block, input, SM4_BLOCK_SIZE); + + SM4_encrypt(block, block, &key); + + if (memcmp(block, expected, SM4_BLOCK_SIZE) != 0) { + fprintf(stderr, "FAIL: Encryption failed\n"); + hexdump(stderr, "Got", block, SM4_BLOCK_SIZE); + hexdump(stderr, "Expected", expected, SM4_BLOCK_SIZE); + return 1; + } + + for (i = 0; i < 999999; i++) + SM4_encrypt(block, block, &key); + + if (memcmp(block, expected_iter, SM4_BLOCK_SIZE) != 0) { + fprintf(stderr, "FAIL: Multi-iteration encryption failed\n"); + hexdump(stderr, "Got", block, SM4_BLOCK_SIZE); + hexdump(stderr, "Expected", expected_iter, SM4_BLOCK_SIZE); + return 1; + } + + for (i = 0; i < 1000000; i++) + SM4_decrypt(block, block, &key); + + if (memcmp(block, input, SM4_BLOCK_SIZE) != 0) { + fprintf(stderr, "FAIL: Decrypted data does not match input\n"); + hexdump(stderr, "Got", block, SM4_BLOCK_SIZE); + hexdump(stderr, "Expected", input, SM4_BLOCK_SIZE); + return 1; + } + + return 0; +} diff --git a/tests/ssl_versions.c b/tests/ssl_versions.c index c12f115c..ec16576e 100644 --- a/tests/ssl_versions.c +++ b/tests/ssl_versions.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_versions.c,v 1.4 2017/05/06 20:39:03 jsing Exp $ */ +/* $OpenBSD: ssl_versions.c,v 1.7 2019/04/04 15:47:15 jsing Exp $ */ /* * Copyright (c) 2016, 2017 Joel Sing * @@ -28,6 +28,13 @@ struct version_range_test { }; static struct version_range_test version_range_tests[] = { + { + .options = 0, + .minver = TLS1_VERSION, + .maxver = TLS1_3_VERSION, + .want_minver = TLS1_VERSION, + .want_maxver = TLS1_3_VERSION, + }, { .options = 0, .minver = TLS1_VERSION, @@ -42,6 +49,13 @@ static struct version_range_test version_range_tests[] = { .want_minver = TLS1_1_VERSION, .want_maxver = TLS1_2_VERSION, }, + { + .options = SSL_OP_NO_TLSv1_3, + .minver = TLS1_VERSION, + .maxver = TLS1_3_VERSION, + .want_minver = TLS1_VERSION, + .want_maxver = TLS1_2_VERSION, + }, { .options = SSL_OP_NO_TLSv1_2, .minver = TLS1_VERSION, @@ -78,12 +92,29 @@ static struct version_range_test version_range_tests[] = { .want_maxver = TLS1_1_VERSION, }, { - .options = SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2, + .options = SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | + SSL_OP_NO_TLSv1_2, .minver = TLS1_VERSION, .maxver = TLS1_2_VERSION, .want_minver = 0, .want_maxver = 0, }, + { + .options = SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | + SSL_OP_NO_TLSv1_2, + .minver = TLS1_VERSION, + .maxver = TLS1_3_VERSION, + .want_minver = TLS1_3_VERSION, + .want_maxver = TLS1_3_VERSION, + }, + { + .options = SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | + SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3, + .minver = TLS1_VERSION, + .maxver = TLS1_3_VERSION, + .want_minver = 0, + .want_maxver = 0, + }, { .options = 0, .minver = TLS1_VERSION, @@ -105,6 +136,34 @@ static struct version_range_test version_range_tests[] = { .want_minver = TLS1_2_VERSION, .want_maxver = TLS1_2_VERSION, }, + { + .options = 0, + .minver = TLS1_VERSION, + .maxver = TLS1_3_VERSION, + .want_minver = TLS1_VERSION, + .want_maxver = TLS1_3_VERSION, + }, + { + .options = 0, + .minver = TLS1_1_VERSION, + .maxver = TLS1_3_VERSION, + .want_minver = TLS1_1_VERSION, + .want_maxver = TLS1_3_VERSION, + }, + { + .options = 0, + .minver = TLS1_2_VERSION, + .maxver = TLS1_3_VERSION, + .want_minver = TLS1_2_VERSION, + .want_maxver = TLS1_3_VERSION, + }, + { + .options = 0, + .minver = TLS1_3_VERSION, + .maxver = TLS1_3_VERSION, + .want_minver = TLS1_3_VERSION, + .want_maxver = TLS1_3_VERSION, + }, { .options = 0, .minver = TLS1_VERSION, @@ -149,7 +208,7 @@ test_ssl_enabled_version_range(void) vrt = &version_range_tests[i]; SSL_clear_options(ssl, SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | - SSL_OP_NO_TLSv1_2); + SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3); SSL_set_options(ssl, vrt->options); minver = maxver = 0xffff; @@ -233,6 +292,14 @@ static struct shared_version_test shared_version_tests[] = { .peerver = TLS1_2_VERSION, .want_maxver = TLS1_2_VERSION, }, + { + .ssl_method = TLS_method, + .options = 0, + .minver = TLS1_VERSION, + .maxver = TLS1_2_VERSION, + .peerver = TLS1_3_VERSION, + .want_maxver = TLS1_2_VERSION, + }, { .ssl_method = TLS_method, .options = 0, @@ -383,7 +450,7 @@ test_ssl_max_shared_version(void) } SSL_clear_options(ssl, SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | - SSL_OP_NO_TLSv1_2); + SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3); SSL_set_options(ssl, svt->options); maxver = 0; @@ -442,6 +509,13 @@ static struct min_max_version_test min_max_version_tests[] = { .want_minver = TLS1_VERSION, .want_maxver = TLS1_2_VERSION, }, + { + .ssl_method = TLS_method, + .minver = 0, + .maxver = TLS1_3_VERSION, + .want_minver = TLS1_VERSION, + .want_maxver = TLS1_2_VERSION, + }, { .ssl_method = TLS_method, .minver = TLS1_VERSION, @@ -584,7 +658,7 @@ test_ssl_min_max_version(void) failed = 0; - for (i = 0; i < N_SHARED_VERSION_TESTS; i++) { + for (i = 0; i < N_MIN_MAX_VERSION_TESTS; i++) { mmvt = &min_max_version_tests[i]; if ((ssl_ctx = SSL_CTX_new(mmvt->ssl_method())) == NULL) { @@ -620,16 +694,16 @@ test_ssl_min_max_version(void) goto next; } - if (ssl_ctx->internal->min_version != mmvt->want_minver) { + if (SSL_CTX_get_min_proto_version(ssl_ctx) != mmvt->want_minver) { fprintf(stderr, "FAIL: test %zu - got SSL_CTX min " "version 0x%x, want 0x%x\n", i, - ssl_ctx->internal->min_version, mmvt->want_minver); + SSL_CTX_get_min_proto_version(ssl_ctx), mmvt->want_minver); goto next; } - if (ssl_ctx->internal->max_version != mmvt->want_maxver) { + if (SSL_CTX_get_max_proto_version(ssl_ctx) != mmvt->want_maxver) { fprintf(stderr, "FAIL: test %zu - got SSL_CTX max " "version 0x%x, want 0x%x\n", i, - ssl_ctx->internal->max_version, mmvt->want_maxver); + SSL_CTX_get_max_proto_version(ssl_ctx), mmvt->want_maxver); goto next; } @@ -638,16 +712,16 @@ test_ssl_min_max_version(void) return 1; } - if (ssl->internal->min_version != mmvt->want_minver) { + if (SSL_get_min_proto_version(ssl) != mmvt->want_minver) { fprintf(stderr, "FAIL: test %zu - initial SSL min " "version 0x%x, want 0x%x\n", i, - ssl_ctx->internal->min_version, mmvt->want_minver); + SSL_get_min_proto_version(ssl), mmvt->want_minver); goto next; } - if (ssl->internal->max_version != mmvt->want_maxver) { + if (SSL_get_max_proto_version(ssl) != mmvt->want_maxver) { fprintf(stderr, "FAIL: test %zu - initial SSL max " "version 0x%x, want 0x%x\n", i, - ssl_ctx->internal->max_version, mmvt->want_maxver); + SSL_get_max_proto_version(ssl), mmvt->want_maxver); goto next; } @@ -679,16 +753,16 @@ test_ssl_min_max_version(void) goto next; } - if (ssl->internal->min_version != mmvt->want_minver) { + if (SSL_get_min_proto_version(ssl) != mmvt->want_minver) { fprintf(stderr, "FAIL: test %zu - got SSL min " "version 0x%x, want 0x%x\n", i, - ssl_ctx->internal->min_version, mmvt->want_minver); + SSL_get_min_proto_version(ssl), mmvt->want_minver); goto next; } - if (ssl->internal->max_version != mmvt->want_maxver) { + if (SSL_get_max_proto_version(ssl) != mmvt->want_maxver) { fprintf(stderr, "FAIL: test %zu - got SSL max " "version 0x%x, want 0x%x\n", i, - ssl->internal->max_version, mmvt->want_maxver); + SSL_get_max_proto_version(ssl), mmvt->want_maxver); goto next; } @@ -710,6 +784,8 @@ main(int argc, char **argv) SSL_library_init(); + /* XXX - Test ssl_supported_version_range() */ + failed |= test_ssl_enabled_version_range(); failed |= test_ssl_max_shared_version(); failed |= test_ssl_min_max_version(); diff --git a/tests/ssltest.bat b/tests/ssltest.bat index 47489658..c68deca7 100644 --- a/tests/ssltest.bat +++ b/tests/ssltest.bat @@ -2,16 +2,14 @@ setlocal enabledelayedexpansion REM ssltest.bat -set ssltest_bin=Debug\ssltest.exe +set ssltest_bin=%1 +set ssltest_bin=%ssltest_bin:/=\% if not exist %ssltest_bin% exit /b 1 -set openssl_bin=..\apps\openssl\Debug\openssl.exe +set openssl_bin=%2 +set openssl_bin=%openssl_bin:/=\% if not exist %openssl_bin% exit /b 1 -if "%srcdir%"=="" ( - set srcdir=. -) - %srcdir%\testssl.bat %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem ^ %ssltest_bin% %openssl_bin% if !errorlevel! neq 0 ( diff --git a/tests/ssltest.c b/tests/ssltest.c index 7137d0c4..0c9a03c8 100644 --- a/tests/ssltest.c +++ b/tests/ssltest.c @@ -403,60 +403,6 @@ print_details(SSL *c_ssl, const char *prefix) BIO_printf(bio_stdout, "\n"); } -static void -lock_dbg_cb(int mode, int type, const char *file, int line) -{ - static int modes[CRYPTO_NUM_LOCKS]; /* = {0, 0, ... } */ - const char *errstr = NULL; - int rw; - - rw = mode & (CRYPTO_READ|CRYPTO_WRITE); - if (!((rw == CRYPTO_READ) || (rw == CRYPTO_WRITE))) { - errstr = "invalid mode"; - goto err; - } - - if (type < 0 || type >= CRYPTO_NUM_LOCKS) { - errstr = "type out of bounds"; - goto err; - } - - if (mode & CRYPTO_LOCK) { - if (modes[type]) { - errstr = "already locked"; - /* must not happen in a single-threaded program - * (would deadlock) */ - goto err; - } - - modes[type] = rw; - } else if (mode & CRYPTO_UNLOCK) { - if (!modes[type]) { - errstr = "not locked"; - goto err; - } - - if (modes[type] != rw) { - errstr = (rw == CRYPTO_READ) ? - "CRYPTO_r_unlock on write lock" : - "CRYPTO_w_unlock on read lock"; - } - - modes[type] = 0; - } else { - errstr = "invalid mode"; - goto err; - } - -err: - if (errstr) { - /* we cannot use bio_err here */ - fprintf(stderr, - "openssl (lock_dbg_cb): %s (mode=%d, type=%d) at %s:%d\n", - errstr, mode, type, file, line); - } -} - int main(int argc, char *argv[]) { @@ -495,8 +441,6 @@ main(int argc, char *argv[]) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE|BIO_FP_TEXT); - CRYPTO_set_locking_callback(lock_dbg_cb); - bio_stdout = BIO_new_fp(stdout, BIO_NOCLOSE|BIO_FP_TEXT); argc--; @@ -504,7 +448,7 @@ main(int argc, char *argv[]) while (argc >= 1) { if (!strcmp(*argv, "-F")) { - fprintf(stderr, "not compiled with FIPS support, so exitting without running.\n"); + fprintf(stderr, "not compiled with FIPS support, so exiting without running.\n"); exit(0); } else if (strcmp(*argv, "-server_auth") == 0) server_auth = 1; diff --git a/tests/testdsa.bat b/tests/testdsa.bat index 660bf28c..ed2ff93f 100644 --- a/tests/testdsa.bat +++ b/tests/testdsa.bat @@ -5,29 +5,26 @@ REM testdsa.bat REM # Test DSA certificate generation of openssl -set cmd=..\apps\openssl\Debug\openssl.exe -if not exist %cmd% exit /b 1 - -if "%srcdir%"=="" ( - set srcdir=. -) +set openssl_bin=%1 +set openssl_bin=%openssl_bin:/=\% +if not exist %openssl_bin% exit /b 1 REM # Generate DSA paramter set -%cmd% dsaparam 512 -out dsa512.pem +%openssl_bin% dsaparam 512 -out dsa512.pem if !errorlevel! neq 0 ( exit /b 1 ) REM # Generate a DSA certificate -%cmd% req -config %srcdir%\openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key +%openssl_bin% req -config %srcdir%\openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key if !errorlevel! neq 0 ( exit /b 1 ) REM # Now check the certificate -%cmd% x509 -text -in testdsa.pem +%openssl_bin% x509 -text -in testdsa.pem if !errorlevel! neq 0 ( exit /b 1 ) diff --git a/tests/testenc.bat b/tests/testenc.bat index 5ca5f609..cca78d3f 100644 --- a/tests/testenc.bat +++ b/tests/testenc.bat @@ -3,16 +3,16 @@ setlocal enabledelayedexpansion REM testenc.bat set test=p -set cmd=..\apps\openssl\Debug\openssl.exe -if not exist %cmd% exit /b 1 -set srcdir=..\..\tests +set openssl_bin=%1 +set openssl_bin=%openssl_bin:/=\% +if not exist %openssl_bin% exit /b 1 copy %srcdir%\openssl.cnf %test% echo cat -%cmd% enc -in %test% -out %test%.cipher -%cmd% enc -in %test%.cipher -out %test%.clear +%openssl_bin% enc -in %test% -out %test%.cipher +%openssl_bin% enc -in %test%.cipher -out %test%.clear fc /b %test% %test%.clear if !errorlevel! neq 0 ( exit /b 1 @@ -21,8 +21,8 @@ if !errorlevel! neq 0 ( ) echo base64 -%cmd% enc -a -e -in %test% -out %test%.cipher -%cmd% enc -a -d -in %test%.cipher -out %test%.clear +%openssl_bin% enc -a -e -in %test% -out %test%.cipher +%openssl_bin% enc -a -d -in %test%.cipher -out %test%.clear fc /b %test% %test%.clear if !errorlevel! neq 0 ( exit /b 1 @@ -45,8 +45,8 @@ for %%i in ( rc4 rc4-40 ) do ( echo %%i - %cmd% %%i -e -k test -in %test% -out %test%.%%i.cipher - %cmd% %%i -d -k test -in %test%.%%i.cipher -out %test%.%%i.clear + %openssl_bin% %%i -e -k test -in %test% -out %test%.%%i.cipher + %openssl_bin% %%i -d -k test -in %test%.%%i.cipher -out %test%.%%i.clear fc /b %test% %test%.%%i.clear if !errorlevel! neq 0 ( exit /b 1 @@ -55,8 +55,8 @@ for %%i in ( ) echo %%i base64 - %cmd% %%i -a -e -k test -in %test% -out %test%.%%i.cipher - %cmd% %%i -a -d -k test -in %test%.%%i.cipher -out %test%.%%i.clear + %openssl_bin% %%i -a -e -k test -in %test% -out %test%.%%i.cipher + %openssl_bin% %%i -a -d -k test -in %test%.%%i.cipher -out %test%.%%i.clear fc /b %test% %test%.%%i.clear if !errorlevel! neq 0 ( exit /b 1 diff --git a/tests/testrsa.bat b/tests/testrsa.bat index f826f595..4947a303 100644 --- a/tests/testrsa.bat +++ b/tests/testrsa.bat @@ -5,29 +5,26 @@ REM testrsa.bat REM # Test RSA certificate generation of openssl -set cmd=..\apps\openssl\Debug\openssl.exe -if not exist %cmd% exit /b 1 - -if "%srcdir%"=="" ( - set srcdir=. -) +set openssl_bin=%1 +set openssl_bin=%openssl_bin:/=\% +if not exist %openssl_bin% exit /b 1 REM # Generate RSA private key -%cmd% genrsa -out rsakey.pem +%openssl_bin% genrsa -out rsakey.pem if !errorlevel! neq 0 ( exit /b 1 ) REM # Generate an RSA certificate -%cmd% req -config %srcdir%\openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem +%openssl_bin% req -config %srcdir%\openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem if !errorlevel! neq 0 ( exit /b 1 ) REM # Now check the certificate -%cmd% x509 -text -in rsacert.pem +%openssl_bin% x509 -text -in rsacert.pem if !errorlevel! neq 0 ( exit /b 1 ) diff --git a/tests/tls_ext_alpn.c b/tests/tls_ext_alpn.c index 7fd7afac..63e5f247 100644 --- a/tests/tls_ext_alpn.c +++ b/tests/tls_ext_alpn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_ext_alpn.c,v 1.3 2017/01/22 08:19:36 jsing Exp $ */ +/* $OpenBSD: tls_ext_alpn.c,v 1.6 2019/01/18 00:55:15 jsing Exp $ */ /* * Copyright (c) 2015 Doug Hogan * @@ -22,6 +22,7 @@ #include #include "ssl_locl.h" +#include "ssl_tlsext.h" #include "tests.h" @@ -314,15 +315,15 @@ static uint8_t proto_invalid_missing9[] = { }; -#define CHECK_BOTH(c_val,s_val,proto) do { \ +#define CHECK_BOTH(c_val, s_val, proto) do { \ { \ - unsigned char *p = proto; \ + CBS cbs; \ int al; \ - CHECK(c_val == ssl_parse_clienthello_tlsext(s, &p, \ - proto, sizeof(proto), &al)); \ - p = proto; \ - CHECK(s_val == ssl_parse_serverhello_tlsext(s, &p, \ - sizeof(proto), &al)); \ + \ + CBS_init(&cbs, proto, sizeof(proto)); \ + CHECK(c_val == tlsext_server_parse(s, &cbs, &al, SSL_TLSEXT_MSG_CH)); \ + CBS_init(&cbs, proto, sizeof(proto)); \ + CHECK(s_val == tlsext_client_parse(s, &cbs, &al, SSL_TLSEXT_MSG_SH)); \ } \ } while (0) diff --git a/tests/tlsexttest.c b/tests/tlsexttest.c index 53488b11..67871c39 100644 --- a/tests/tlsexttest.c +++ b/tests/tlsexttest.c @@ -1,7 +1,8 @@ -/* $OpenBSD: tlsexttest.c,v 1.16 2017/08/29 17:24:59 jsing Exp $ */ +/* $OpenBSD: tlsexttest.c,v 1.29 2019/03/25 18:12:05 jsing Exp $ */ /* * Copyright (c) 2017 Joel Sing * Copyright (c) 2017 Doug Hogan + * Copyright (c) 2019 Bob Beck * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -119,7 +120,7 @@ const uint8_t tlsext_alpn_single_proto[] = { }; static int -test_tlsext_alpn_clienthello(void) +test_tlsext_alpn_client(void) { SSL_CTX *ssl_ctx = NULL; SSL *ssl = NULL; @@ -139,8 +140,8 @@ test_tlsext_alpn_clienthello(void) errx(1, "failed to create SSL"); /* By default, we don't need this */ - if (tlsext_alpn_clienthello_needs(ssl)) { - FAIL("clienthello should not need ALPN by default"); + if (tlsext_alpn_client_needs(ssl)) { + FAIL("client should not need ALPN by default"); goto err; } @@ -156,22 +157,22 @@ test_tlsext_alpn_clienthello(void) FAIL("should be able to set ALPN to http/1.1"); goto err; } - if (!tlsext_alpn_clienthello_needs(ssl)) { - FAIL("clienthello should need ALPN by now"); + if (!tlsext_alpn_client_needs(ssl)) { + FAIL("client should need ALPN by now"); goto err; } - /* Make sure we can build the clienthello with a single proto. */ + /* Make sure we can build the client with a single proto. */ - if (!tlsext_alpn_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build ALPN\n"); + if (!tlsext_alpn_client_build(ssl, &cbb)) { + FAIL("client failed to build ALPN\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); if (dlen != sizeof(tlsext_alpn_single_proto)) { - FAIL("got clienthello ALPN with length %zu, " + FAIL("got client ALPN with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_alpn_single_proto)); compare_data(data, dlen, tlsext_alpn_single_proto, @@ -179,7 +180,7 @@ test_tlsext_alpn_clienthello(void) goto err; } if (memcmp(data, tlsext_alpn_single_proto, dlen) != 0) { - FAIL("clienthello ALPN differs:\n"); + FAIL("client ALPN differs:\n"); compare_data(data, dlen, tlsext_alpn_single_proto, sizeof(tlsext_alpn_single_proto)); goto err; @@ -194,7 +195,7 @@ test_tlsext_alpn_clienthello(void) CBS_init(&cbs, tlsext_alpn_single_proto, sizeof(tlsext_alpn_single_proto)); - if (!tlsext_alpn_clienthello_parse(ssl, &cbs, &alert)) { + if (!tlsext_alpn_server_parse(ssl, &cbs, &alert)) { FAIL("failed to parse ALPN"); goto err; } @@ -205,7 +206,7 @@ test_tlsext_alpn_clienthello(void) if (ssl->internal->alpn_client_proto_list_len != sizeof(tlsext_alpn_single_proto_val)) { - FAIL("got clienthello ALPN with length %zu, " + FAIL("got client ALPN with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_alpn_single_proto_val)); compare_data(ssl->internal->alpn_client_proto_list, @@ -217,7 +218,7 @@ test_tlsext_alpn_clienthello(void) if (memcmp(ssl->internal->alpn_client_proto_list, tlsext_alpn_single_proto_val, sizeof(tlsext_alpn_single_proto_val)) != 0) { - FAIL("clienthello ALPN differs:\n"); + FAIL("client ALPN differs:\n"); compare_data(data, dlen, tlsext_alpn_single_proto_val, sizeof(tlsext_alpn_single_proto_val)); goto err; @@ -230,20 +231,20 @@ test_tlsext_alpn_clienthello(void) FAIL("should be able to set ALPN to http/1.1"); goto err; } - if (!tlsext_alpn_clienthello_needs(ssl)) { - FAIL("clienthello should need ALPN by now"); + if (!tlsext_alpn_client_needs(ssl)) { + FAIL("client should need ALPN by now"); goto err; } - if (!tlsext_alpn_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build ALPN\n"); + if (!tlsext_alpn_client_build(ssl, &cbb)) { + FAIL("client failed to build ALPN\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); if (dlen != sizeof(tlsext_alpn_multiple_protos)) { - FAIL("got clienthello ALPN with length %zu, " + FAIL("got client ALPN with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_alpn_multiple_protos)); compare_data(data, dlen, tlsext_alpn_multiple_protos, @@ -251,7 +252,7 @@ test_tlsext_alpn_clienthello(void) goto err; } if (memcmp(data, tlsext_alpn_multiple_protos, dlen) != 0) { - FAIL("clienthello ALPN differs:\n"); + FAIL("client ALPN differs:\n"); compare_data(data, dlen, tlsext_alpn_multiple_protos, sizeof(tlsext_alpn_multiple_protos)); goto err; @@ -261,7 +262,7 @@ test_tlsext_alpn_clienthello(void) CBS_init(&cbs, tlsext_alpn_multiple_protos, sizeof(tlsext_alpn_multiple_protos)); - if (!tlsext_alpn_clienthello_parse(ssl, &cbs, &alert)) { + if (!tlsext_alpn_server_parse(ssl, &cbs, &alert)) { FAIL("failed to parse ALPN"); goto err; } @@ -272,7 +273,7 @@ test_tlsext_alpn_clienthello(void) if (ssl->internal->alpn_client_proto_list_len != sizeof(tlsext_alpn_multiple_protos_val)) { - FAIL("got clienthello ALPN with length %zu, " + FAIL("got client ALPN with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_alpn_multiple_protos_val)); compare_data(ssl->internal->alpn_client_proto_list, @@ -284,7 +285,7 @@ test_tlsext_alpn_clienthello(void) if (memcmp(ssl->internal->alpn_client_proto_list, tlsext_alpn_multiple_protos_val, sizeof(tlsext_alpn_multiple_protos_val)) != 0) { - FAIL("clienthello ALPN differs:\n"); + FAIL("client ALPN differs:\n"); compare_data(data, dlen, tlsext_alpn_multiple_protos_val, sizeof(tlsext_alpn_multiple_protos_val)); goto err; @@ -296,8 +297,8 @@ test_tlsext_alpn_clienthello(void) ssl->internal->alpn_client_proto_list = NULL; ssl->internal->alpn_client_proto_list_len = 0; - if (tlsext_alpn_clienthello_needs(ssl)) { - FAIL("clienthello should need ALPN by default"); + if (tlsext_alpn_client_needs(ssl)) { + FAIL("client should need ALPN by default"); goto err; } @@ -313,7 +314,7 @@ test_tlsext_alpn_clienthello(void) } static int -test_tlsext_alpn_serverhello(void) +test_tlsext_alpn_server(void) { SSL_CTX *ssl_ctx = NULL; SSL *ssl = NULL; @@ -333,8 +334,8 @@ test_tlsext_alpn_serverhello(void) errx(1, "failed to create SSL"); /* By default, ALPN isn't needed. */ - if (tlsext_alpn_serverhello_needs(ssl)) { - FAIL("serverhello should not need ALPN by default\n"); + if (tlsext_alpn_server_needs(ssl)) { + FAIL("server should not need ALPN by default\n"); goto err; } @@ -351,22 +352,22 @@ test_tlsext_alpn_serverhello(void) sizeof(tlsext_alpn_single_proto_name)); S3I(ssl)->alpn_selected_len = sizeof(tlsext_alpn_single_proto_name); - if (!tlsext_alpn_serverhello_needs(ssl)) { - FAIL("serverhello should need ALPN after a protocol is selected\n"); + if (!tlsext_alpn_server_needs(ssl)) { + FAIL("server should need ALPN after a protocol is selected\n"); goto err; } - /* Make sure we can build a serverhello with one protocol */ + /* Make sure we can build a server with one protocol */ - if (!tlsext_alpn_serverhello_build(ssl, &cbb)) { - FAIL("serverhello should be able to build a response"); + if (!tlsext_alpn_server_build(ssl, &cbb)) { + FAIL("server should be able to build a response"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); if (dlen != sizeof(tlsext_alpn_single_proto)) { - FAIL("got clienthello ALPN with length %zu, " + FAIL("got client ALPN with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_alpn_single_proto)); compare_data(data, dlen, tlsext_alpn_single_proto, @@ -374,7 +375,7 @@ test_tlsext_alpn_serverhello(void) goto err; } if (memcmp(data, tlsext_alpn_single_proto, dlen) != 0) { - FAIL("clienthello ALPN differs:\n"); + FAIL("client ALPN differs:\n"); compare_data(data, dlen, tlsext_alpn_single_proto, sizeof(tlsext_alpn_single_proto)); goto err; @@ -391,8 +392,8 @@ test_tlsext_alpn_serverhello(void) sizeof(tlsext_alpn_single_proto)); /* Shouldn't be able to parse without requesting */ - if (tlsext_alpn_serverhello_parse(ssl, &cbs, &alert)) { - FAIL("Should only parse serverhello if we requested it"); + if (tlsext_alpn_client_parse(ssl, &cbs, &alert)) { + FAIL("Should only parse server if we requested it"); goto err; } @@ -402,8 +403,8 @@ test_tlsext_alpn_serverhello(void) FAIL("should be able to set ALPN to http/1.1"); goto err; } - if (!tlsext_alpn_serverhello_parse(ssl, &cbs, &alert)) { - FAIL("Should be able to parse serverhello when we request it"); + if (!tlsext_alpn_server_parse(ssl, &cbs, &alert)) { + FAIL("Should be able to parse server when we request it"); goto err; } if (CBS_len(&cbs) != 0) { @@ -413,7 +414,7 @@ test_tlsext_alpn_serverhello(void) if (S3I(ssl)->alpn_selected_len != sizeof(tlsext_alpn_single_proto_name)) { - FAIL("got serverhello ALPN with length %zu, " + FAIL("got server ALPN with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_alpn_single_proto_name)); compare_data(S3I(ssl)->alpn_selected, @@ -425,7 +426,7 @@ test_tlsext_alpn_serverhello(void) if (memcmp(S3I(ssl)->alpn_selected, tlsext_alpn_single_proto_name, sizeof(tlsext_alpn_single_proto_name)) != 0) { - FAIL("serverhello ALPN differs:\n"); + FAIL("server ALPN differs:\n"); compare_data(S3I(ssl)->alpn_selected, S3I(ssl)->alpn_selected_len, tlsext_alpn_single_proto_name, @@ -434,7 +435,7 @@ test_tlsext_alpn_serverhello(void) } /* - * We should NOT be able to build a serverhello with multiple + * We should NOT be able to build a server with multiple * protocol names. However, the existing code did not check for this * case because it is passed in as an encoded value. */ @@ -445,8 +446,8 @@ test_tlsext_alpn_serverhello(void) S3I(ssl)->alpn_selected = NULL; S3I(ssl)->alpn_selected_len = 0; - if (tlsext_alpn_serverhello_needs(ssl)) { - FAIL("serverhello should need ALPN by default"); + if (tlsext_alpn_server_needs(ssl)) { + FAIL("server should need ALPN by default"); goto err; } @@ -468,34 +469,34 @@ test_tlsext_alpn_serverhello(void) * This extension is only used by the client. */ -static uint8_t tlsext_ec_clienthello_default[] = { +static uint8_t tlsext_supportedgroups_client_default[] = { 0x00, 0x06, 0x00, 0x1d, /* X25519 (29) */ 0x00, 0x17, /* secp256r1 (23) */ 0x00, 0x18 /* secp384r1 (24) */ }; -static uint16_t tlsext_ec_clienthello_secp384r1_val[] = { +static uint16_t tlsext_supportedgroups_client_secp384r1_val[] = { 0x0018 /* tls1_ec_nid2curve_id(NID_secp384r1) */ }; -static uint8_t tlsext_ec_clienthello_secp384r1[] = { +static uint8_t tlsext_supportedgroups_client_secp384r1[] = { 0x00, 0x02, 0x00, 0x18 /* secp384r1 (24) */ }; /* Example from RFC 4492 section 5.1.1 */ -static uint16_t tlsext_ec_clienthello_nistp192and224_val[] = { +static uint16_t tlsext_supportedgroups_client_nistp192and224_val[] = { 0x0013, /* tls1_ec_nid2curve_id(NID_X9_62_prime192v1) */ 0x0015 /* tls1_ec_nid2curve_id(NID_secp224r1) */ }; -static uint8_t tlsext_ec_clienthello_nistp192and224[] = { +static uint8_t tlsext_supportedgroups_client_nistp192and224[] = { 0x00, 0x04, 0x00, 0x13, /* secp192r1 aka NIST P-192 */ 0x00, 0x15 /* secp224r1 aka NIST P-224 */ }; static int -test_tlsext_ec_clienthello(void) +test_tlsext_supportedgroups_client(void) { unsigned char *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -518,8 +519,8 @@ test_tlsext_ec_clienthello(void) /* * Default ciphers include EC so we need it by default. */ - if (!tlsext_ec_clienthello_needs(ssl)) { - FAIL("clienthello should need Ellipticcurves for default " + if (!tlsext_supportedgroups_client_needs(ssl)) { + FAIL("client should need Ellipticcurves for default " "ciphers\n"); goto err; } @@ -528,11 +529,11 @@ test_tlsext_ec_clienthello(void) * Exclude cipher suites so we can test not including it. */ if (!SSL_set_cipher_list(ssl, "TLSv1.2:!ECDHE:!ECDSA")) { - FAIL("clienthello should be able to set cipher list\n"); + FAIL("client should be able to set cipher list\n"); goto err; } - if (tlsext_ec_clienthello_needs(ssl)) { - FAIL("clienthello should not need Ellipticcurves\n"); + if (tlsext_supportedgroups_client_needs(ssl)) { + FAIL("client should not need Ellipticcurves\n"); goto err; } @@ -540,11 +541,11 @@ test_tlsext_ec_clienthello(void) * Use libtls default for the rest of the testing */ if (!SSL_set_cipher_list(ssl, "TLSv1.2+AEAD+ECDHE")) { - FAIL("clienthello should be able to set cipher list\n"); + FAIL("client should be able to set cipher list\n"); goto err; } - if (!tlsext_ec_clienthello_needs(ssl)) { - FAIL("clienthello should need Ellipticcurves\n"); + if (!tlsext_supportedgroups_client_needs(ssl)) { + FAIL("client should need Ellipticcurves\n"); goto err; } @@ -562,32 +563,32 @@ test_tlsext_ec_clienthello(void) SSI(ssl)->tlsext_supportedgroups[0] = tls1_ec_nid2curve_id(NID_secp384r1); SSI(ssl)->tlsext_supportedgroups_length = 1; - if (!tlsext_ec_clienthello_needs(ssl)) { - FAIL("clienthello should need Ellipticcurves\n"); + if (!tlsext_supportedgroups_client_needs(ssl)) { + FAIL("client should need Ellipticcurves\n"); goto err; } - if (!tlsext_ec_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build Ellipticcurves\n"); + if (!tlsext_supportedgroups_client_build(ssl, &cbb)) { + FAIL("client failed to build Ellipticcurves\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); - if (dlen != sizeof(tlsext_ec_clienthello_default)) { - FAIL("got clienthello Ellipticcurves with length %zu, " + if (dlen != sizeof(tlsext_supportedgroups_client_default)) { + FAIL("got client Ellipticcurves with length %zu, " "want length %zu\n", dlen, - sizeof(tlsext_ec_clienthello_default)); - compare_data(data, dlen, tlsext_ec_clienthello_default, - sizeof(tlsext_ec_clienthello_default)); + sizeof(tlsext_supportedgroups_client_default)); + compare_data(data, dlen, tlsext_supportedgroups_client_default, + sizeof(tlsext_supportedgroups_client_default)); goto err; } - if (memcmp(data, tlsext_ec_clienthello_default, dlen) != 0) { - FAIL("clienthello Ellipticcurves differs:\n"); - compare_data(data, dlen, tlsext_ec_clienthello_default, - sizeof(tlsext_ec_clienthello_default)); + if (memcmp(data, tlsext_supportedgroups_client_default, dlen) != 0) { + FAIL("client Ellipticcurves differs:\n"); + compare_data(data, dlen, tlsext_supportedgroups_client_default, + sizeof(tlsext_supportedgroups_client_default)); goto err; } @@ -603,10 +604,10 @@ test_tlsext_ec_clienthello(void) if ((ssl->session = SSL_SESSION_new()) == NULL) errx(1, "failed to create session"); - CBS_init(&cbs, tlsext_ec_clienthello_secp384r1, - sizeof(tlsext_ec_clienthello_secp384r1)); - if (!tlsext_ec_clienthello_parse(ssl, &cbs, &alert)) { - FAIL("failed to parse clienthello Ellipticcurves\n"); + CBS_init(&cbs, tlsext_supportedgroups_client_secp384r1, + sizeof(tlsext_supportedgroups_client_secp384r1)); + if (!tlsext_supportedgroups_server_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse client Ellipticcurves\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -615,21 +616,21 @@ test_tlsext_ec_clienthello(void) } if (SSI(ssl)->tlsext_supportedgroups_length != - sizeof(tlsext_ec_clienthello_secp384r1_val) / sizeof(uint16_t)) { - FAIL("no tlsext_ellipticcurves from clienthello " + sizeof(tlsext_supportedgroups_client_secp384r1_val) / sizeof(uint16_t)) { + FAIL("no tlsext_ellipticcurves from client " "Ellipticcurves\n"); goto err; } if (memcmp(SSI(ssl)->tlsext_supportedgroups, - tlsext_ec_clienthello_secp384r1_val, - sizeof(tlsext_ec_clienthello_secp384r1_val)) != 0) { - FAIL("clienthello had an incorrect Ellipticcurves " + tlsext_supportedgroups_client_secp384r1_val, + sizeof(tlsext_supportedgroups_client_secp384r1_val)) != 0) { + FAIL("client had an incorrect Ellipticcurves " "entry\n"); compare_data2(SSI(ssl)->tlsext_supportedgroups, SSI(ssl)->tlsext_supportedgroups_length * 2, - tlsext_ec_clienthello_secp384r1_val, - sizeof(tlsext_ec_clienthello_secp384r1_val)); + tlsext_supportedgroups_client_secp384r1_val, + sizeof(tlsext_supportedgroups_client_secp384r1_val)); goto err; } @@ -651,38 +652,38 @@ test_tlsext_ec_clienthello(void) ssl->internal->tlsext_supportedgroups[1] = tls1_ec_nid2curve_id(NID_secp224r1); ssl->internal->tlsext_supportedgroups_length = 2; - if (!tlsext_ec_clienthello_needs(ssl)) { - FAIL("clienthello should need Ellipticcurves\n"); + if (!tlsext_supportedgroups_client_needs(ssl)) { + FAIL("client should need Ellipticcurves\n"); goto err; } - if (!tlsext_ec_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build Ellipticcurves\n"); + if (!tlsext_supportedgroups_client_build(ssl, &cbb)) { + FAIL("client failed to build Ellipticcurves\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); - if (dlen != sizeof(tlsext_ec_clienthello_nistp192and224)) { - FAIL("got clienthello Ellipticcurves with length %zu, " + if (dlen != sizeof(tlsext_supportedgroups_client_nistp192and224)) { + FAIL("got client Ellipticcurves with length %zu, " "want length %zu\n", dlen, - sizeof(tlsext_ec_clienthello_nistp192and224)); + sizeof(tlsext_supportedgroups_client_nistp192and224)); fprintf(stderr, "received:\n"); hexdump(data, dlen); fprintf(stderr, "test data:\n"); - hexdump(tlsext_ec_clienthello_nistp192and224, - sizeof(tlsext_ec_clienthello_nistp192and224)); + hexdump(tlsext_supportedgroups_client_nistp192and224, + sizeof(tlsext_supportedgroups_client_nistp192and224)); goto err; } - if (memcmp(data, tlsext_ec_clienthello_nistp192and224, dlen) != 0) { - FAIL("clienthello Ellipticcurves differs:\n"); + if (memcmp(data, tlsext_supportedgroups_client_nistp192and224, dlen) != 0) { + FAIL("client Ellipticcurves differs:\n"); fprintf(stderr, "received:\n"); hexdump(data, dlen); fprintf(stderr, "test data:\n"); - hexdump(tlsext_ec_clienthello_nistp192and224, - sizeof(tlsext_ec_clienthello_nistp192and224)); + hexdump(tlsext_supportedgroups_client_nistp192and224, + sizeof(tlsext_supportedgroups_client_nistp192and224)); goto err; } @@ -703,10 +704,10 @@ test_tlsext_ec_clienthello(void) ssl->internal->tlsext_supportedgroups = NULL; ssl->internal->tlsext_supportedgroups_length = 0; - CBS_init(&cbs, tlsext_ec_clienthello_nistp192and224, - sizeof(tlsext_ec_clienthello_nistp192and224)); - if (!tlsext_ec_clienthello_parse(ssl, &cbs, &alert)) { - FAIL("failed to parse clienthello Ellipticcurves\n"); + CBS_init(&cbs, tlsext_supportedgroups_client_nistp192and224, + sizeof(tlsext_supportedgroups_client_nistp192and224)); + if (!tlsext_supportedgroups_server_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse client Ellipticcurves\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -715,20 +716,19 @@ test_tlsext_ec_clienthello(void) } if (SSI(ssl)->tlsext_supportedgroups_length != - sizeof(tlsext_ec_clienthello_nistp192and224_val) / sizeof(uint16_t)) { - FAIL("no tlsext_ellipticcurves from clienthello " - "Ellipticcurves\n"); + sizeof(tlsext_supportedgroups_client_nistp192and224_val) / sizeof(uint16_t)) { + FAIL("no tlsext_ellipticcurves from client Ellipticcurves\n"); goto err; } if (memcmp(SSI(ssl)->tlsext_supportedgroups, - tlsext_ec_clienthello_nistp192and224_val, - sizeof(tlsext_ec_clienthello_nistp192and224_val)) != 0) { - FAIL("clienthello had an incorrect Ellipticcurves entry\n"); + tlsext_supportedgroups_client_nistp192and224_val, + sizeof(tlsext_supportedgroups_client_nistp192and224_val)) != 0) { + FAIL("client had an incorrect Ellipticcurves entry\n"); compare_data2(SSI(ssl)->tlsext_supportedgroups, SSI(ssl)->tlsext_supportedgroups_length * 2, - tlsext_ec_clienthello_nistp192and224_val, - sizeof(tlsext_ec_clienthello_nistp192and224_val)); + tlsext_supportedgroups_client_nistp192and224_val, + sizeof(tlsext_supportedgroups_client_nistp192and224_val)); goto err; } @@ -746,7 +746,7 @@ test_tlsext_ec_clienthello(void) /* elliptic_curves is only used by the client so this doesn't test much. */ static int -test_tlsext_ec_serverhello(void) +test_tlsext_supportedgroups_server(void) { SSL_CTX *ssl_ctx = NULL; SSL *ssl = NULL; @@ -759,16 +759,16 @@ test_tlsext_ec_serverhello(void) if ((ssl = SSL_new(ssl_ctx)) == NULL) errx(1, "failed to create SSL"); - if (tlsext_ec_serverhello_needs(ssl)) { - FAIL("serverhello should not need elliptic_curves\n"); + if (tlsext_supportedgroups_server_needs(ssl)) { + FAIL("server should not need elliptic_curves\n"); goto err; } if ((ssl->session = SSL_SESSION_new()) == NULL) errx(1, "failed to create session"); - if (tlsext_ec_serverhello_needs(ssl)) { - FAIL("serverhello should not need elliptic_curves\n"); + if (tlsext_supportedgroups_server_needs(ssl)) { + FAIL("server should not need elliptic_curves\n"); goto err; } @@ -815,7 +815,7 @@ static uint8_t tlsext_ecpf_hello_prefer_order[] = { }; static int -test_tlsext_ecpf_clienthello(void) +test_tlsext_ecpf_client(void) { uint8_t *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -837,8 +837,8 @@ test_tlsext_ecpf_clienthello(void) /* * Default ciphers include EC so we need it by default. */ - if (!tlsext_ecpf_clienthello_needs(ssl)) { - FAIL("clienthello should need ECPointFormats for default " + if (!tlsext_ecpf_client_needs(ssl)) { + FAIL("client should need ECPointFormats for default " "ciphers\n"); goto err; } @@ -847,11 +847,11 @@ test_tlsext_ecpf_clienthello(void) * Exclude EC cipher suites so we can test not including it. */ if (!SSL_set_cipher_list(ssl, "ALL:!ECDHE:!ECDH")) { - FAIL("clienthello should be able to set cipher list\n"); + FAIL("client should be able to set cipher list\n"); goto err; } - if (tlsext_ecpf_clienthello_needs(ssl)) { - FAIL("clienthello should not need ECPointFormats\n"); + if (tlsext_ecpf_client_needs(ssl)) { + FAIL("client should not need ECPointFormats\n"); goto err; } @@ -859,11 +859,11 @@ test_tlsext_ecpf_clienthello(void) * Use libtls default for the rest of the testing */ if (!SSL_set_cipher_list(ssl, "TLSv1.2+AEAD+ECDHE")) { - FAIL("clienthello should be able to set cipher list\n"); + FAIL("client should be able to set cipher list\n"); goto err; } - if (!tlsext_ecpf_clienthello_needs(ssl)) { - FAIL("clienthello should need ECPointFormats\n"); + if (!tlsext_ecpf_client_needs(ssl)) { + FAIL("client should need ECPointFormats\n"); goto err; } @@ -873,8 +873,8 @@ test_tlsext_ecpf_clienthello(void) if ((ssl->session = SSL_SESSION_new()) == NULL) errx(1, "failed to create session"); - if (!tlsext_ecpf_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build ECPointFormats\n"); + if (!tlsext_ecpf_client_build(ssl, &cbb)) { + FAIL("client failed to build ECPointFormats\n"); goto err; } @@ -882,7 +882,7 @@ test_tlsext_ecpf_clienthello(void) errx(1, "failed to finish CBB"); if (dlen != sizeof(tlsext_ecpf_hello_uncompressed)) { - FAIL("got clienthello ECPointFormats with length %zu, " + FAIL("got client ECPointFormats with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_ecpf_hello_uncompressed)); compare_data(data, dlen, tlsext_ecpf_hello_uncompressed, @@ -891,7 +891,7 @@ test_tlsext_ecpf_clienthello(void) } if (memcmp(data, tlsext_ecpf_hello_uncompressed, dlen) != 0) { - FAIL("clienthello ECPointFormats differs:\n"); + FAIL("client ECPointFormats differs:\n"); compare_data(data, dlen, tlsext_ecpf_hello_uncompressed, sizeof(tlsext_ecpf_hello_uncompressed)); goto err; @@ -911,8 +911,8 @@ test_tlsext_ecpf_clienthello(void) CBS_init(&cbs, tlsext_ecpf_hello_uncompressed, sizeof(tlsext_ecpf_hello_uncompressed)); - if (!tlsext_ecpf_clienthello_parse(ssl, &cbs, &alert)) { - FAIL("failed to parse clienthello ECPointFormats\n"); + if (!tlsext_ecpf_server_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse client ECPointFormats\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -922,7 +922,7 @@ test_tlsext_ecpf_clienthello(void) if (SSI(ssl)->tlsext_ecpointformatlist_length != sizeof(tlsext_ecpf_hello_uncompressed_val)) { - FAIL("no tlsext_ecpointformats from clienthello " + FAIL("no tlsext_ecpointformats from client " "ECPointFormats\n"); goto err; } @@ -930,7 +930,7 @@ test_tlsext_ecpf_clienthello(void) if (memcmp(SSI(ssl)->tlsext_ecpointformatlist, tlsext_ecpf_hello_uncompressed_val, sizeof(tlsext_ecpf_hello_uncompressed_val)) != 0) { - FAIL("clienthello had an incorrect ECPointFormats entry\n"); + FAIL("client had an incorrect ECPointFormats entry\n"); goto err; } @@ -955,14 +955,14 @@ test_tlsext_ecpf_clienthello(void) ssl->internal->tlsext_ecpointformatlist[2] = TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2; ssl->internal->tlsext_ecpointformatlist_length = 3; - if (!tlsext_ecpf_clienthello_needs(ssl)) { - FAIL("clienthello should need ECPointFormats with a custom " + if (!tlsext_ecpf_client_needs(ssl)) { + FAIL("client should need ECPointFormats with a custom " "format\n"); goto err; } - if (!tlsext_ecpf_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build ECPointFormats\n"); + if (!tlsext_ecpf_client_build(ssl, &cbb)) { + FAIL("client failed to build ECPointFormats\n"); goto err; } @@ -970,7 +970,7 @@ test_tlsext_ecpf_clienthello(void) errx(1, "failed to finish CBB"); if (dlen != sizeof(tlsext_ecpf_hello_prefer_order)) { - FAIL("got clienthello ECPointFormats with length %zu, " + FAIL("got client ECPointFormats with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_ecpf_hello_prefer_order)); compare_data(data, dlen, tlsext_ecpf_hello_prefer_order, @@ -979,7 +979,7 @@ test_tlsext_ecpf_clienthello(void) } if (memcmp(data, tlsext_ecpf_hello_prefer_order, dlen) != 0) { - FAIL("clienthello ECPointFormats differs:\n"); + FAIL("client ECPointFormats differs:\n"); compare_data(data, dlen, tlsext_ecpf_hello_prefer_order, sizeof(tlsext_ecpf_hello_prefer_order)); goto err; @@ -1004,8 +1004,8 @@ test_tlsext_ecpf_clienthello(void) CBS_init(&cbs, tlsext_ecpf_hello_prefer_order, sizeof(tlsext_ecpf_hello_prefer_order)); - if (!tlsext_ecpf_clienthello_parse(ssl, &cbs, &alert)) { - FAIL("failed to parse clienthello ECPointFormats\n"); + if (!tlsext_ecpf_server_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse client ECPointFormats\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -1015,7 +1015,7 @@ test_tlsext_ecpf_clienthello(void) if (SSI(ssl)->tlsext_ecpointformatlist_length != sizeof(tlsext_ecpf_hello_prefer_order_val)) { - FAIL("no tlsext_ecpointformats from clienthello " + FAIL("no tlsext_ecpointformats from client " "ECPointFormats\n"); goto err; } @@ -1023,7 +1023,7 @@ test_tlsext_ecpf_clienthello(void) if (memcmp(SSI(ssl)->tlsext_ecpointformatlist, tlsext_ecpf_hello_prefer_order_val, sizeof(tlsext_ecpf_hello_prefer_order_val)) != 0) { - FAIL("clienthello had an incorrect ECPointFormats entry\n"); + FAIL("client had an incorrect ECPointFormats entry\n"); goto err; } @@ -1040,7 +1040,7 @@ test_tlsext_ecpf_clienthello(void) } static int -test_tlsext_ecpf_serverhello(void) +test_tlsext_ecpf_server(void) { uint8_t *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -1066,7 +1066,7 @@ test_tlsext_ecpf_serverhello(void) if ((S3I(ssl)->hs.new_cipher = ssl3_get_cipher_by_id(TLS1_CK_ECDHE_ECDSA_CHACHA20_POLY1305)) == NULL) { - FAIL("serverhello cannot find cipher\n"); + FAIL("server cannot find cipher\n"); goto err; } if ((SSI(ssl)->tlsext_ecpointformatlist = malloc(sizeof(uint8_t))) @@ -1077,8 +1077,8 @@ test_tlsext_ecpf_serverhello(void) SSI(ssl)->tlsext_ecpointformatlist[0] = TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime; SSI(ssl)->tlsext_ecpointformatlist_length = 1; - if (!tlsext_ecpf_serverhello_needs(ssl)) { - FAIL("serverhello should need ECPointFormats now\n"); + if (!tlsext_ecpf_server_needs(ssl)) { + FAIL("server should need ECPointFormats now\n"); goto err; } @@ -1086,8 +1086,8 @@ test_tlsext_ecpf_serverhello(void) * The server will ignore the session list and use either a custom * list or the default (uncompressed). */ - if (!tlsext_ecpf_serverhello_build(ssl, &cbb)) { - FAIL("serverhello failed to build ECPointFormats\n"); + if (!tlsext_ecpf_server_build(ssl, &cbb)) { + FAIL("server failed to build ECPointFormats\n"); goto err; } @@ -1095,7 +1095,7 @@ test_tlsext_ecpf_serverhello(void) errx(1, "failed to finish CBB"); if (dlen != sizeof(tlsext_ecpf_hello_uncompressed)) { - FAIL("got serverhello ECPointFormats with length %zu, " + FAIL("got server ECPointFormats with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_ecpf_hello_uncompressed)); compare_data(data, dlen, tlsext_ecpf_hello_uncompressed, @@ -1104,7 +1104,7 @@ test_tlsext_ecpf_serverhello(void) } if (memcmp(data, tlsext_ecpf_hello_uncompressed, dlen) != 0) { - FAIL("serverhello ECPointFormats differs:\n"); + FAIL("server ECPointFormats differs:\n"); compare_data(data, dlen, tlsext_ecpf_hello_uncompressed, sizeof(tlsext_ecpf_hello_uncompressed)); goto err; @@ -1124,8 +1124,8 @@ test_tlsext_ecpf_serverhello(void) CBS_init(&cbs, tlsext_ecpf_hello_prime, sizeof(tlsext_ecpf_hello_prime)); - if (tlsext_ecpf_serverhello_parse(ssl, &cbs, &alert)) { - FAIL("must include uncompressed in serverhello ECPointFormats\n"); + if (tlsext_ecpf_client_parse(ssl, &cbs, &alert)) { + FAIL("must include uncompressed in server ECPointFormats\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -1164,13 +1164,13 @@ test_tlsext_ecpf_serverhello(void) ssl->internal->tlsext_ecpointformatlist[2] = TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2; ssl->internal->tlsext_ecpointformatlist_length = 3; - if (!tlsext_ecpf_serverhello_needs(ssl)) { - FAIL("serverhello should need ECPointFormats\n"); + if (!tlsext_ecpf_server_needs(ssl)) { + FAIL("server should need ECPointFormats\n"); goto err; } - if (!tlsext_ecpf_serverhello_build(ssl, &cbb)) { - FAIL("serverhello failed to build ECPointFormats\n"); + if (!tlsext_ecpf_server_build(ssl, &cbb)) { + FAIL("server failed to build ECPointFormats\n"); goto err; } @@ -1178,7 +1178,7 @@ test_tlsext_ecpf_serverhello(void) errx(1, "failed to finish CBB"); if (dlen != sizeof(tlsext_ecpf_hello_prefer_order)) { - FAIL("got serverhello ECPointFormats with length %zu, " + FAIL("got server ECPointFormats with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_ecpf_hello_prefer_order)); compare_data(data, dlen, tlsext_ecpf_hello_prefer_order, @@ -1187,7 +1187,7 @@ test_tlsext_ecpf_serverhello(void) } if (memcmp(data, tlsext_ecpf_hello_prefer_order, dlen) != 0) { - FAIL("serverhello ECPointFormats differs:\n"); + FAIL("server ECPointFormats differs:\n"); compare_data(data, dlen, tlsext_ecpf_hello_prefer_order, sizeof(tlsext_ecpf_hello_prefer_order)); goto err; @@ -1212,8 +1212,8 @@ test_tlsext_ecpf_serverhello(void) CBS_init(&cbs, tlsext_ecpf_hello_prefer_order, sizeof(tlsext_ecpf_hello_prefer_order)); - if (!tlsext_ecpf_serverhello_parse(ssl, &cbs, &alert)) { - FAIL("failed to parse serverhello ECPointFormats\n"); + if (!tlsext_ecpf_client_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse server ECPointFormats\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -1223,7 +1223,7 @@ test_tlsext_ecpf_serverhello(void) if (SSI(ssl)->tlsext_ecpointformatlist_length != sizeof(tlsext_ecpf_hello_prefer_order_val)) { - FAIL("no tlsext_ecpointformats from serverhello " + FAIL("no tlsext_ecpointformats from server " "ECPointFormats\n"); goto err; } @@ -1231,7 +1231,7 @@ test_tlsext_ecpf_serverhello(void) if (memcmp(SSI(ssl)->tlsext_ecpointformatlist, tlsext_ecpf_hello_prefer_order_val, sizeof(tlsext_ecpf_hello_prefer_order_val)) != 0) { - FAIL("serverhello had an incorrect ECPointFormats entry\n"); + FAIL("server had an incorrect ECPointFormats entry\n"); goto err; } @@ -1260,13 +1260,13 @@ static unsigned char tlsext_ri_prev_server[] = { 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x00, }; -static unsigned char tlsext_ri_clienthello[] = { +static unsigned char tlsext_ri_client[] = { 0x10, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, }; -static unsigned char tlsext_ri_serverhello[] = { +static unsigned char tlsext_ri_server[] = { 0x20, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, @@ -1275,7 +1275,7 @@ static unsigned char tlsext_ri_serverhello[] = { }; static int -test_tlsext_ri_clienthello(void) +test_tlsext_ri_client(void) { unsigned char *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -1295,8 +1295,8 @@ test_tlsext_ri_clienthello(void) if ((ssl = SSL_new(ssl_ctx)) == NULL) errx(1, "failed to create SSL"); - if (tlsext_ri_clienthello_needs(ssl)) { - FAIL("clienthello should not need RI\n"); + if (tlsext_ri_client_needs(ssl)) { + FAIL("client should not need RI\n"); goto err; } @@ -1305,8 +1305,8 @@ test_tlsext_ri_clienthello(void) goto err; } - if (!tlsext_ri_clienthello_needs(ssl)) { - FAIL("clienthello should need RI\n"); + if (!tlsext_ri_client_needs(ssl)) { + FAIL("client should need RI\n"); goto err; } @@ -1316,32 +1316,32 @@ test_tlsext_ri_clienthello(void) S3I(ssl)->renegotiate_seen = 0; - if (!tlsext_ri_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build RI\n"); + if (!tlsext_ri_client_build(ssl, &cbb)) { + FAIL("client failed to build RI\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); - if (dlen != sizeof(tlsext_ri_clienthello)) { - FAIL("got clienthello RI with length %zu, " - "want length %zu\n", dlen, sizeof(tlsext_ri_clienthello)); + if (dlen != sizeof(tlsext_ri_client)) { + FAIL("got client RI with length %zu, " + "want length %zu\n", dlen, sizeof(tlsext_ri_client)); goto err; } - if (memcmp(data, tlsext_ri_clienthello, dlen) != 0) { - FAIL("clienthello RI differs:\n"); + if (memcmp(data, tlsext_ri_client, dlen) != 0) { + FAIL("client RI differs:\n"); fprintf(stderr, "received:\n"); hexdump(data, dlen); fprintf(stderr, "test data:\n"); - hexdump(tlsext_ri_clienthello, sizeof(tlsext_ri_clienthello)); + hexdump(tlsext_ri_client, sizeof(tlsext_ri_client)); goto err; } - CBS_init(&cbs, tlsext_ri_clienthello, sizeof(tlsext_ri_clienthello)); - if (!tlsext_ri_clienthello_parse(ssl, &cbs, &alert)) { - FAIL("failed to parse clienthello RI\n"); + CBS_init(&cbs, tlsext_ri_client, sizeof(tlsext_ri_client)); + if (!tlsext_ri_server_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse client RI\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -1353,7 +1353,7 @@ test_tlsext_ri_clienthello(void) FAIL("renegotiate seen not set\n"); goto err; } - if (S3I(ssl)->send_connection_binding != 1) { + if (S3I(ssl)->send_connection_binding != 1) { FAIL("send connection binding not set\n"); goto err; } @@ -1363,9 +1363,9 @@ test_tlsext_ri_clienthello(void) S3I(ssl)->renegotiate_seen = 0; - CBS_init(&cbs, tlsext_ri_clienthello, sizeof(tlsext_ri_clienthello)); - if (tlsext_ri_clienthello_parse(ssl, &cbs, &alert)) { - FAIL("parsed invalid clienthello RI\n"); + CBS_init(&cbs, tlsext_ri_client, sizeof(tlsext_ri_client)); + if (tlsext_ri_server_parse(ssl, &cbs, &alert)) { + FAIL("parsed invalid client RI\n"); failure = 1; goto err; } @@ -1387,7 +1387,7 @@ test_tlsext_ri_clienthello(void) } static int -test_tlsext_ri_serverhello(void) +test_tlsext_ri_server(void) { unsigned char *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -1407,15 +1407,15 @@ test_tlsext_ri_serverhello(void) if ((ssl = SSL_new(ssl_ctx)) == NULL) errx(1, "failed to create SSL"); - if (tlsext_ri_serverhello_needs(ssl)) { - FAIL("serverhello should not need RI\n"); + if (tlsext_ri_server_needs(ssl)) { + FAIL("server should not need RI\n"); goto err; } - S3I(ssl)->send_connection_binding = 1; + S3I(ssl)->send_connection_binding = 1; - if (!tlsext_ri_serverhello_needs(ssl)) { - FAIL("serverhello should need RI\n"); + if (!tlsext_ri_server_needs(ssl)) { + FAIL("server should need RI\n"); goto err; } @@ -1429,32 +1429,32 @@ test_tlsext_ri_serverhello(void) S3I(ssl)->renegotiate_seen = 0; - if (!tlsext_ri_serverhello_build(ssl, &cbb)) { - FAIL("serverhello failed to build RI\n"); + if (!tlsext_ri_server_build(ssl, &cbb)) { + FAIL("server failed to build RI\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); - if (dlen != sizeof(tlsext_ri_serverhello)) { - FAIL("got serverhello RI with length %zu, " - "want length %zu\n", dlen, sizeof(tlsext_ri_serverhello)); + if (dlen != sizeof(tlsext_ri_server)) { + FAIL("got server RI with length %zu, " + "want length %zu\n", dlen, sizeof(tlsext_ri_server)); goto err; } - if (memcmp(data, tlsext_ri_serverhello, dlen) != 0) { - FAIL("serverhello RI differs:\n"); + if (memcmp(data, tlsext_ri_server, dlen) != 0) { + FAIL("server RI differs:\n"); fprintf(stderr, "received:\n"); hexdump(data, dlen); fprintf(stderr, "test data:\n"); - hexdump(tlsext_ri_serverhello, sizeof(tlsext_ri_serverhello)); + hexdump(tlsext_ri_server, sizeof(tlsext_ri_server)); goto err; } - CBS_init(&cbs, tlsext_ri_serverhello, sizeof(tlsext_ri_serverhello)); - if (!tlsext_ri_serverhello_parse(ssl, &cbs, &alert)) { - FAIL("failed to parse serverhello RI\n"); + CBS_init(&cbs, tlsext_ri_server, sizeof(tlsext_ri_server)); + if (!tlsext_ri_client_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse server RI\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -1466,7 +1466,7 @@ test_tlsext_ri_serverhello(void) FAIL("renegotiate seen not set\n"); goto err; } - if (S3I(ssl)->send_connection_binding != 1) { + if (S3I(ssl)->send_connection_binding != 1) { FAIL("send connection binding not set\n"); goto err; } @@ -1478,9 +1478,9 @@ test_tlsext_ri_serverhello(void) S3I(ssl)->renegotiate_seen = 0; - CBS_init(&cbs, tlsext_ri_serverhello, sizeof(tlsext_ri_serverhello)); - if (tlsext_ri_serverhello_parse(ssl, &cbs, &alert)) { - FAIL("parsed invalid serverhello RI\n"); + CBS_init(&cbs, tlsext_ri_server, sizeof(tlsext_ri_server)); + if (tlsext_ri_client_parse(ssl, &cbs, &alert)) { + FAIL("parsed invalid server RI\n"); goto err; } @@ -1504,15 +1504,14 @@ test_tlsext_ri_serverhello(void) * Signature Algorithms - RFC 5246 section 7.4.1.4.1. */ -static unsigned char tlsext_sigalgs_clienthello[] = { - 0x00, 0x1a, 0x06, 0x01, 0x06, 0x03, 0xef, 0xef, - 0x05, 0x01, 0x05, 0x03, 0x04, 0x01, 0x04, 0x03, - 0xee, 0xee, 0xed, 0xed, 0x03, 0x01, 0x03, 0x03, - 0x02, 0x01, 0x02, 0x03, +static unsigned char tlsext_sigalgs_client[] = { + 0x00, 0x16, 0x08, 0x06, 0x06, 0x01, 0x06, 0x03, + 0x08, 0x05, 0x05, 0x01, 0x05, 0x03, 0x08, 0x04, + 0x04, 0x01, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, }; static int -test_tlsext_sigalgs_clienthello(void) +test_tlsext_sigalgs_client(void) { unsigned char *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -1532,22 +1531,22 @@ test_tlsext_sigalgs_clienthello(void) ssl->client_version = TLS1_1_VERSION; - if (tlsext_sigalgs_clienthello_needs(ssl)) { - fprintf(stderr, "FAIL: clienthello should not need sigalgs\n"); + if (tlsext_sigalgs_client_needs(ssl)) { + fprintf(stderr, "FAIL: client should not need sigalgs\n"); failure = 1; goto done; } ssl->client_version = TLS1_2_VERSION; - if (!tlsext_sigalgs_clienthello_needs(ssl)) { - fprintf(stderr, "FAIL: clienthello should need sigalgs\n"); + if (!tlsext_sigalgs_client_needs(ssl)) { + fprintf(stderr, "FAIL: client should need sigalgs\n"); failure = 1; goto done; } - if (!tlsext_sigalgs_clienthello_build(ssl, &cbb)) { - fprintf(stderr, "FAIL: clienthello failed to build sigalgs\n"); + if (!tlsext_sigalgs_client_build(ssl, &cbb)) { + fprintf(stderr, "FAIL: client failed to build sigalgs\n"); failure = 1; goto done; } @@ -1555,26 +1554,26 @@ test_tlsext_sigalgs_clienthello(void) if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); - if (dlen != sizeof(tlsext_sigalgs_clienthello)) { - fprintf(stderr, "FAIL: got clienthello sigalgs with length %zu, " - "want length %zu\n", dlen, sizeof(tlsext_sigalgs_clienthello)); + if (dlen != sizeof(tlsext_sigalgs_client)) { + fprintf(stderr, "FAIL: got client sigalgs with length %zu, " + "want length %zu\n", dlen, sizeof(tlsext_sigalgs_client)); failure = 1; goto done; } - if (memcmp(data, tlsext_sigalgs_clienthello, dlen) != 0) { - fprintf(stderr, "FAIL: clienthello SNI differs:\n"); + if (memcmp(data, tlsext_sigalgs_client, dlen) != 0) { + fprintf(stderr, "FAIL: client SNI differs:\n"); fprintf(stderr, "received:\n"); hexdump(data, dlen); fprintf(stderr, "test data:\n"); - hexdump(tlsext_sigalgs_clienthello, sizeof(tlsext_sigalgs_clienthello)); + hexdump(tlsext_sigalgs_client, sizeof(tlsext_sigalgs_client)); failure = 1; goto done; } - CBS_init(&cbs, tlsext_sigalgs_clienthello, sizeof(tlsext_sigalgs_clienthello)); - if (!tlsext_sigalgs_clienthello_parse(ssl, &cbs, &alert)) { - fprintf(stderr, "FAIL: failed to parse clienthello SNI\n"); + CBS_init(&cbs, tlsext_sigalgs_client, sizeof(tlsext_sigalgs_client)); + if (!tlsext_sigalgs_server_parse(ssl, &cbs, &alert)) { + fprintf(stderr, "FAIL: failed to parse client SNI\n"); failure = 1; goto done; } @@ -1583,27 +1582,6 @@ test_tlsext_sigalgs_clienthello(void) goto done; } - if (ssl->cert->pkeys[SSL_PKEY_RSA_SIGN].digest != EVP_sha512()) { - fprintf(stderr, "FAIL: RSA sign digest mismatch\n"); - failure = 1; - goto done; - } - if (ssl->cert->pkeys[SSL_PKEY_RSA_ENC].digest != EVP_sha512()) { - fprintf(stderr, "FAIL: RSA enc digest mismatch\n"); - failure = 1; - goto done; - } - if (ssl->cert->pkeys[SSL_PKEY_ECC].digest != EVP_sha512()) { - fprintf(stderr, "FAIL: ECC digest mismatch\n"); - failure = 1; - goto done; - } - if (ssl->cert->pkeys[SSL_PKEY_GOST01].digest != EVP_streebog512()) { - fprintf(stderr, "FAIL: GOST01 digest mismatch\n"); - failure = 1; - goto done; - } - done: CBB_cleanup(&cbb); SSL_CTX_free(ssl_ctx); @@ -1614,7 +1592,7 @@ test_tlsext_sigalgs_clienthello(void) } static int -test_tlsext_sigalgs_serverhello(void) +test_tlsext_sigalgs_server(void) { unsigned char *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -1632,14 +1610,14 @@ test_tlsext_sigalgs_serverhello(void) if ((ssl = SSL_new(ssl_ctx)) == NULL) errx(1, "failed to create SSL"); - if (tlsext_sigalgs_serverhello_needs(ssl)) { - fprintf(stderr, "FAIL: serverhello should not need sigalgs\n"); + if (tlsext_sigalgs_server_needs(ssl)) { + fprintf(stderr, "FAIL: server should not need sigalgs\n"); failure = 1; goto done; } - if (tlsext_sigalgs_serverhello_build(ssl, &cbb)) { - fprintf(stderr, "FAIL: serverhello should not build sigalgs\n"); + if (tlsext_sigalgs_server_build(ssl, &cbb)) { + fprintf(stderr, "FAIL: server should not build sigalgs\n"); failure = 1; goto done; } @@ -1647,9 +1625,9 @@ test_tlsext_sigalgs_serverhello(void) if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); - CBS_init(&cbs, tlsext_sigalgs_clienthello, sizeof(tlsext_sigalgs_clienthello)); - if (tlsext_sigalgs_serverhello_parse(ssl, &cbs, &alert)) { - fprintf(stderr, "FAIL: serverhello should not parse sigalgs\n"); + CBS_init(&cbs, tlsext_sigalgs_client, sizeof(tlsext_sigalgs_client)); + if (tlsext_sigalgs_client_parse(ssl, &cbs, &alert)) { + fprintf(stderr, "FAIL: server should not parse sigalgs\n"); failure = 1; goto done; } @@ -1669,19 +1647,19 @@ test_tlsext_sigalgs_serverhello(void) #define TEST_SNI_SERVERNAME "www.libressl.org" -static unsigned char tlsext_sni_clienthello[] = { +static unsigned char tlsext_sni_client[] = { 0x00, 0x13, 0x00, 0x00, 0x10, 0x77, 0x77, 0x77, 0x2e, 0x6c, 0x69, 0x62, 0x72, 0x65, 0x73, 0x73, 0x6c, 0x2e, 0x6f, 0x72, 0x67, }; -static unsigned char tlsext_sni_serverhello[] = { +static unsigned char tlsext_sni_server[] = { 0x00 }; -const size_t sizeof_tlsext_sni_serverhello = 0; +const size_t sizeof_tlsext_sni_server = 0; static int -test_tlsext_sni_clienthello(void) +test_tlsext_sni_client(void) { unsigned char *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -1701,8 +1679,8 @@ test_tlsext_sni_clienthello(void) if ((ssl = SSL_new(ssl_ctx)) == NULL) errx(1, "failed to create SSL"); - if (tlsext_sni_clienthello_needs(ssl)) { - FAIL("clienthello should not need SNI\n"); + if (tlsext_sni_client_needs(ssl)) { + FAIL("client should not need SNI\n"); goto err; } @@ -1711,31 +1689,31 @@ test_tlsext_sni_clienthello(void) goto err; } - if (!tlsext_sni_clienthello_needs(ssl)) { - FAIL("clienthello should need SNI\n"); + if (!tlsext_sni_client_needs(ssl)) { + FAIL("client should need SNI\n"); goto err; } - if (!tlsext_sni_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build SNI\n"); + if (!tlsext_sni_client_build(ssl, &cbb)) { + FAIL("client failed to build SNI\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); - if (dlen != sizeof(tlsext_sni_clienthello)) { - FAIL("got clienthello SNI with length %zu, " - "want length %zu\n", dlen, sizeof(tlsext_sni_clienthello)); + if (dlen != sizeof(tlsext_sni_client)) { + FAIL("got client SNI with length %zu, " + "want length %zu\n", dlen, sizeof(tlsext_sni_client)); goto err; } - if (memcmp(data, tlsext_sni_clienthello, dlen) != 0) { - FAIL("clienthello SNI differs:\n"); + if (memcmp(data, tlsext_sni_client, dlen) != 0) { + FAIL("client SNI differs:\n"); fprintf(stderr, "received:\n"); hexdump(data, dlen); fprintf(stderr, "test data:\n"); - hexdump(tlsext_sni_clienthello, sizeof(tlsext_sni_clienthello)); + hexdump(tlsext_sni_client, sizeof(tlsext_sni_client)); goto err; } @@ -1744,9 +1722,9 @@ test_tlsext_sni_clienthello(void) ssl->internal->hit = 0; - CBS_init(&cbs, tlsext_sni_clienthello, sizeof(tlsext_sni_clienthello)); - if (!tlsext_sni_clienthello_parse(ssl, &cbs, &alert)) { - FAIL("failed to parse clienthello SNI\n"); + CBS_init(&cbs, tlsext_sni_client, sizeof(tlsext_sni_client)); + if (!tlsext_sni_server_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse client SNI\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -1755,7 +1733,7 @@ test_tlsext_sni_clienthello(void) } if (ssl->session->tlsext_hostname == NULL) { - FAIL("no tlsext_hostname from clienthello SNI\n"); + FAIL("no tlsext_hostname from client SNI\n"); goto err; } @@ -1773,9 +1751,9 @@ test_tlsext_sni_clienthello(void) NULL) errx(1, "failed to strdup tlsext_hostname"); - CBS_init(&cbs, tlsext_sni_clienthello, sizeof(tlsext_sni_clienthello)); - if (tlsext_sni_clienthello_parse(ssl, &cbs, &alert)) { - FAIL("parsed clienthello with mismatched SNI\n"); + CBS_init(&cbs, tlsext_sni_client, sizeof(tlsext_sni_client)); + if (tlsext_sni_server_parse(ssl, &cbs, &alert)) { + FAIL("parsed client with mismatched SNI\n"); goto err; } @@ -1791,7 +1769,7 @@ test_tlsext_sni_clienthello(void) } static int -test_tlsext_sni_serverhello(void) +test_tlsext_sni_server(void) { unsigned char *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -1814,8 +1792,8 @@ test_tlsext_sni_serverhello(void) if ((ssl->session = SSL_SESSION_new()) == NULL) errx(1, "failed to create session"); - if (tlsext_sni_serverhello_needs(ssl)) { - FAIL("serverhello should not need SNI\n"); + if (tlsext_sni_server_needs(ssl)) { + FAIL("server should not need SNI\n"); goto err; } @@ -1828,40 +1806,40 @@ test_tlsext_sni_serverhello(void) NULL) errx(1, "failed to strdup tlsext_hostname"); - if (!tlsext_sni_serverhello_needs(ssl)) { - FAIL("serverhello should need SNI\n"); + if (!tlsext_sni_server_needs(ssl)) { + FAIL("server should need SNI\n"); goto err; } - if (!tlsext_sni_serverhello_build(ssl, &cbb)) { - FAIL("serverhello failed to build SNI\n"); + if (!tlsext_sni_server_build(ssl, &cbb)) { + FAIL("server failed to build SNI\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); - if (dlen != sizeof_tlsext_sni_serverhello) { - FAIL("got serverhello SNI with length %zu, " - "want length %zu\n", dlen, sizeof_tlsext_sni_serverhello); + if (dlen != sizeof_tlsext_sni_server) { + FAIL("got server SNI with length %zu, " + "want length %zu\n", dlen, sizeof_tlsext_sni_server); goto err; } - if (memcmp(data, tlsext_sni_serverhello, dlen) != 0) { - FAIL("serverhello SNI differs:\n"); + if (memcmp(data, tlsext_sni_server, dlen) != 0) { + FAIL("server SNI differs:\n"); fprintf(stderr, "received:\n"); hexdump(data, dlen); fprintf(stderr, "test data:\n"); - hexdump(tlsext_sni_serverhello, sizeof_tlsext_sni_serverhello); + hexdump(tlsext_sni_server, sizeof_tlsext_sni_server); goto err; } free(ssl->session->tlsext_hostname); ssl->session->tlsext_hostname = NULL; - CBS_init(&cbs, tlsext_sni_serverhello, sizeof_tlsext_sni_serverhello); - if (!tlsext_sni_serverhello_parse(ssl, &cbs, &alert)) { - FAIL("failed to parse serverhello SNI\n"); + CBS_init(&cbs, tlsext_sni_server, sizeof_tlsext_sni_server); + if (!tlsext_sni_client_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse server SNI\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -1870,7 +1848,7 @@ test_tlsext_sni_serverhello(void) } if (ssl->session->tlsext_hostname == NULL) { - FAIL("no tlsext_hostname after serverhello SNI\n"); + FAIL("no tlsext_hostname after server SNI\n"); goto err; } @@ -1893,12 +1871,12 @@ test_tlsext_sni_serverhello(void) return (failure); } -static unsigned char tls_ocsp_clienthello_default[] = { +static unsigned char tls_ocsp_client_default[] = { 0x01, 0x00, 0x00, 0x00, 0x00 }; static int -test_tlsext_ocsp_clienthello(void) +test_tlsext_ocsp_client(void) { unsigned char *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -1918,42 +1896,42 @@ test_tlsext_ocsp_clienthello(void) if ((ssl = SSL_new(ssl_ctx)) == NULL) errx(1, "failed to create SSL"); - if (tlsext_ocsp_clienthello_needs(ssl)) { - FAIL("clienthello should not need ocsp\n"); + if (tlsext_ocsp_client_needs(ssl)) { + FAIL("client should not need ocsp\n"); goto err; } SSL_set_tlsext_status_type(ssl, TLSEXT_STATUSTYPE_ocsp); - if (!tlsext_ocsp_clienthello_needs(ssl)) { - FAIL("clienthello should need ocsp\n"); + if (!tlsext_ocsp_client_needs(ssl)) { + FAIL("client should need ocsp\n"); goto err; } - if (!tlsext_ocsp_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build SNI\n"); + if (!tlsext_ocsp_client_build(ssl, &cbb)) { + FAIL("client failed to build SNI\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); - if (dlen != sizeof(tls_ocsp_clienthello_default)) { - FAIL("got ocsp clienthello with length %zu, " + if (dlen != sizeof(tls_ocsp_client_default)) { + FAIL("got ocsp client with length %zu, " "want length %zu\n", dlen, - sizeof(tls_ocsp_clienthello_default)); + sizeof(tls_ocsp_client_default)); goto err; } - if (memcmp(data, tls_ocsp_clienthello_default, dlen) != 0) { - FAIL("ocsp clienthello differs:\n"); + if (memcmp(data, tls_ocsp_client_default, dlen) != 0) { + FAIL("ocsp client differs:\n"); fprintf(stderr, "received:\n"); hexdump(data, dlen); fprintf(stderr, "test data:\n"); - hexdump(tls_ocsp_clienthello_default, - sizeof(tls_ocsp_clienthello_default)); + hexdump(tls_ocsp_client_default, + sizeof(tls_ocsp_client_default)); goto err; } - CBS_init(&cbs, tls_ocsp_clienthello_default, - sizeof(tls_ocsp_clienthello_default)); - if (!tlsext_ocsp_clienthello_parse(ssl, &cbs, &alert)) { - FAIL("failed to parse ocsp clienthello\n"); + CBS_init(&cbs, tls_ocsp_client_default, + sizeof(tls_ocsp_client_default)); + if (!tlsext_ocsp_server_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse ocsp client\n"); goto err; } if (CBS_len(&cbs) != 0) { @@ -1973,7 +1951,7 @@ test_tlsext_ocsp_clienthello(void) } static int -test_tlsext_ocsp_serverhello(void) +test_tlsext_ocsp_server(void) { unsigned char *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -1991,19 +1969,19 @@ test_tlsext_ocsp_serverhello(void) if ((ssl = SSL_new(ssl_ctx)) == NULL) errx(1, "failed to create SSL"); - if (tlsext_ocsp_serverhello_needs(ssl)) { - FAIL("serverhello should not need ocsp\n"); + if (tlsext_ocsp_server_needs(ssl)) { + FAIL("server should not need ocsp\n"); goto err; } ssl->internal->tlsext_status_expected = 1; - if (!tlsext_ocsp_serverhello_needs(ssl)) { - FAIL("serverhello should need ocsp\n"); + if (!tlsext_ocsp_server_needs(ssl)) { + FAIL("server should need ocsp\n"); goto err; } - if (!tlsext_ocsp_serverhello_build(ssl, &cbb)) { - FAIL("serverhello failed to build ocsp\n"); + if (!tlsext_ocsp_server_build(ssl, &cbb)) { + FAIL("server failed to build ocsp\n"); goto err; } @@ -2032,7 +2010,7 @@ static uint8_t tlsext_sessionticket_hello_min[1]; static uint8_t tlsext_sessionticket_hello_max[65535]; static int -test_tlsext_sessionticket_clienthello(void) +test_tlsext_sessionticket_client(void) { unsigned char *data = NULL; SSL_CTX *ssl_ctx = NULL; @@ -2058,8 +2036,8 @@ test_tlsext_sessionticket_clienthello(void) errx(1, "failed to create SSL"); /* Should need a ticket by default. */ - if (!tlsext_sessionticket_clienthello_needs(ssl)) { - FAIL("clienthello should need Sessionticket for default " + if (!tlsext_sessionticket_client_needs(ssl)) { + FAIL("client should need Sessionticket for default " "ciphers\n"); goto err; } @@ -2069,8 +2047,8 @@ test_tlsext_sessionticket_clienthello(void) FAIL("Cannot disable tickets in the TLS connection"); return 0; } - if (tlsext_sessionticket_clienthello_needs(ssl)) { - FAIL("clienthello should not need SessionTicket if it was disabled"); + if (tlsext_sessionticket_client_needs(ssl)) { + FAIL("client should not need SessionTicket if it was disabled"); goto err; } @@ -2079,13 +2057,13 @@ test_tlsext_sessionticket_clienthello(void) FAIL("Cannot re-enable tickets in the TLS connection"); return 0; } - if (!tlsext_sessionticket_clienthello_needs(ssl)) { - FAIL("clienthello should need SessionTicket if it was disabled"); + if (!tlsext_sessionticket_client_needs(ssl)) { + FAIL("client should need SessionTicket if it was disabled"); goto err; } /* Since we don't have a session, we should build an empty ticket. */ - if (!tlsext_sessionticket_clienthello_build(ssl, &cbb)) { + if (!tlsext_sessionticket_client_build(ssl, &cbb)) { FAIL("Cannot build a ticket"); goto err; } @@ -2106,11 +2084,11 @@ test_tlsext_sessionticket_clienthello(void) /* With a new session (but no ticket), we should still have 0 length */ if ((ssl->session = SSL_SESSION_new()) == NULL) errx(1, "failed to create session"); - if (!tlsext_sessionticket_clienthello_needs(ssl)) { + if (!tlsext_sessionticket_client_needs(ssl)) { FAIL("Should still want a session ticket with a new session"); goto err; } - if (!tlsext_sessionticket_clienthello_build(ssl, &cbb)) { + if (!tlsext_sessionticket_client_build(ssl, &cbb)) { FAIL("Cannot build a ticket"); goto err; } @@ -2140,11 +2118,11 @@ test_tlsext_sessionticket_clienthello(void) memcpy(ssl->session->tlsext_tick, dummy, sizeof(dummy)); ssl->session->tlsext_ticklen = sizeof(dummy); - if (!tlsext_sessionticket_clienthello_needs(ssl)) { + if (!tlsext_sessionticket_client_needs(ssl)) { FAIL("Should still want a session ticket with a new session"); goto err; } - if (!tlsext_sessionticket_clienthello_build(ssl, &cbb)) { + if (!tlsext_sessionticket_client_build(ssl, &cbb)) { FAIL("Cannot build a ticket"); goto err; } @@ -2157,7 +2135,7 @@ test_tlsext_sessionticket_clienthello(void) goto err; } if (memcmp(data, dummy, dlen) != 0) { - FAIL("serverhello SNI differs:\n"); + FAIL("server SNI differs:\n"); compare_data(data, dlen, dummy, sizeof(dummy)); goto err; @@ -2180,7 +2158,7 @@ test_tlsext_sessionticket_clienthello(void) goto err; } /* Should not need a ticket in this case */ - if (tlsext_sessionticket_clienthello_needs(ssl)) { + if (tlsext_sessionticket_client_needs(ssl)) { FAIL("Should not want to use session tickets with a NULL custom"); goto err; } @@ -2192,7 +2170,7 @@ test_tlsext_sessionticket_clienthello(void) free(ssl->internal->tlsext_session_ticket); ssl->internal->tlsext_session_ticket = NULL; - if (!tlsext_sessionticket_clienthello_needs(ssl)) { + if (!tlsext_sessionticket_client_needs(ssl)) { FAIL("Should need a session ticket again when the custom one is removed"); goto err; } @@ -2203,11 +2181,11 @@ test_tlsext_sessionticket_clienthello(void) FAIL("Should be able to set a custom ticket"); goto err; } - if (!tlsext_sessionticket_clienthello_needs(ssl)) { + if (!tlsext_sessionticket_client_needs(ssl)) { FAIL("Should need a session ticket again when the custom one is not empty"); goto err; } - if (!tlsext_sessionticket_clienthello_build(ssl, &cbb)) { + if (!tlsext_sessionticket_client_build(ssl, &cbb)) { FAIL("Cannot build a ticket with a max length random payload"); goto err; } @@ -2242,7 +2220,7 @@ test_tlsext_sessionticket_clienthello(void) static int -test_tlsext_sessionticket_serverhello(void) +test_tlsext_sessionticket_server(void) { SSL_CTX *ssl_ctx = NULL; SSL *ssl = NULL; @@ -2264,8 +2242,8 @@ test_tlsext_sessionticket_serverhello(void) * By default, should not need a session ticket since the ticket * is not yet expected. */ - if (tlsext_sessionticket_serverhello_needs(ssl)) { - FAIL("serverhello should not need SessionTicket by default\n"); + if (tlsext_sessionticket_server_needs(ssl)) { + FAIL("server should not need SessionTicket by default\n"); goto err; } @@ -2274,8 +2252,8 @@ test_tlsext_sessionticket_serverhello(void) FAIL("Cannot disable tickets in the TLS connection"); return 0; } - if (tlsext_sessionticket_serverhello_needs(ssl)) { - FAIL("serverhello should not need SessionTicket if it was disabled"); + if (tlsext_sessionticket_server_needs(ssl)) { + FAIL("server should not need SessionTicket if it was disabled"); goto err; } @@ -2284,20 +2262,20 @@ test_tlsext_sessionticket_serverhello(void) FAIL("Cannot re-enable tickets in the TLS connection"); return 0; } - if (tlsext_sessionticket_serverhello_needs(ssl)) { - FAIL("serverhello should not need SessionTicket yet"); + if (tlsext_sessionticket_server_needs(ssl)) { + FAIL("server should not need SessionTicket yet"); goto err; } /* Set expected to require it. */ ssl->internal->tlsext_ticket_expected = 1; - if (!tlsext_sessionticket_serverhello_needs(ssl)) { - FAIL("serverhello should now be required for SessionTicket"); + if (!tlsext_sessionticket_server_needs(ssl)) { + FAIL("server should now be required for SessionTicket"); goto err; } /* server hello's session ticket should always be 0 length payload. */ - if (!tlsext_sessionticket_serverhello_build(ssl, &cbb)) { + if (!tlsext_sessionticket_server_build(ssl, &cbb)) { FAIL("Cannot build a ticket with a max length random payload"); goto err; } @@ -2370,7 +2348,7 @@ const uint8_t tlsext_srtp_multiple_one_valid[] = { }; static int -test_tlsext_srtp_clienthello(void) +test_tlsext_srtp_client(void) { SRTP_PROTECTION_PROFILE *prof; SSL_CTX *ssl_ctx = NULL; @@ -2392,8 +2370,8 @@ test_tlsext_srtp_clienthello(void) errx(1, "failed to create SSL"); /* By default, we don't need this */ - if (tlsext_srtp_clienthello_needs(ssl)) { - FAIL("clienthello should not need SRTP by default\n"); + if (tlsext_srtp_client_needs(ssl)) { + FAIL("client should not need SRTP by default\n"); goto err; } @@ -2401,22 +2379,22 @@ test_tlsext_srtp_clienthello(void) FAIL("should be able to set a single SRTP\n"); goto err; } - if (!tlsext_srtp_clienthello_needs(ssl)) { - FAIL("clienthello should need SRTP\n"); + if (!tlsext_srtp_client_needs(ssl)) { + FAIL("client should need SRTP\n"); goto err; } - /* Make sure we can build the clienthello with a single profile. */ + /* Make sure we can build the client with a single profile. */ - if (!tlsext_srtp_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build SRTP\n"); + if (!tlsext_srtp_client_build(ssl, &cbb)) { + FAIL("client failed to build SRTP\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); if (dlen != sizeof(tlsext_srtp_single)) { - FAIL("got clienthello SRTP with length %zu, " + FAIL("got client SRTP with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_srtp_single)); compare_data(data, dlen, tlsext_srtp_single, @@ -2424,7 +2402,7 @@ test_tlsext_srtp_clienthello(void) goto err; } if (memcmp(data, tlsext_srtp_single, dlen) != 0) { - FAIL("clienthello SRTP differs:\n"); + FAIL("client SRTP differs:\n"); compare_data(data, dlen, tlsext_srtp_single, sizeof(tlsext_srtp_single)); goto err; @@ -2443,7 +2421,7 @@ test_tlsext_srtp_clienthello(void) } CBS_init(&cbs, tlsext_srtp_single, sizeof(tlsext_srtp_single)); - if (!tlsext_srtp_clienthello_parse(ssl, &cbs, &alert)) { + if (!tlsext_srtp_server_parse(ssl, &cbs, &alert)) { FAIL("failed to parse SRTP\n"); goto err; } @@ -2461,7 +2439,7 @@ test_tlsext_srtp_clienthello(void) goto err; } - if (!tlsext_srtp_serverhello_needs(ssl)) { + if (!tlsext_srtp_server_needs(ssl)) { FAIL("should send server extension when profile selected\n"); goto err; } @@ -2472,20 +2450,20 @@ test_tlsext_srtp_clienthello(void) FAIL("should be able to set SRTP to multiple profiles\n"); goto err; } - if (!tlsext_srtp_clienthello_needs(ssl)) { - FAIL("clienthello should need SRTP by now\n"); + if (!tlsext_srtp_client_needs(ssl)) { + FAIL("client should need SRTP by now\n"); goto err; } - if (!tlsext_srtp_clienthello_build(ssl, &cbb)) { - FAIL("clienthello failed to build SRTP\n"); + if (!tlsext_srtp_client_build(ssl, &cbb)) { + FAIL("client failed to build SRTP\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); if (dlen != sizeof(tlsext_srtp_multiple)) { - FAIL("got clienthello SRTP with length %zu, " + FAIL("got client SRTP with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_srtp_multiple)); compare_data(data, dlen, tlsext_srtp_multiple, @@ -2493,7 +2471,7 @@ test_tlsext_srtp_clienthello(void) goto err; } if (memcmp(data, tlsext_srtp_multiple, dlen) != 0) { - FAIL("clienthello SRTP differs:\n"); + FAIL("client SRTP differs:\n"); compare_data(data, dlen, tlsext_srtp_multiple, sizeof(tlsext_srtp_multiple)); goto err; @@ -2510,7 +2488,7 @@ test_tlsext_srtp_clienthello(void) CBS_init(&cbs, tlsext_srtp_multiple, sizeof(tlsext_srtp_multiple)); - if (!tlsext_srtp_clienthello_parse(ssl, &cbs, &alert)) { + if (!tlsext_srtp_server_parse(ssl, &cbs, &alert)) { FAIL("failed to parse SRTP\n"); goto err; } @@ -2528,7 +2506,7 @@ test_tlsext_srtp_clienthello(void) goto err; } - if (!tlsext_srtp_serverhello_needs(ssl)) { + if (!tlsext_srtp_server_needs(ssl)) { FAIL("should send server extension when profile selected\n"); goto err; } @@ -2541,7 +2519,7 @@ test_tlsext_srtp_clienthello(void) CBS_init(&cbs, tlsext_srtp_multiple_one_valid, sizeof(tlsext_srtp_multiple_one_valid)); - if (!tlsext_srtp_clienthello_parse(ssl, &cbs, &alert)) { + if (!tlsext_srtp_server_parse(ssl, &cbs, &alert)) { FAIL("failed to parse SRTP\n"); goto err; } @@ -2559,7 +2537,7 @@ test_tlsext_srtp_clienthello(void) goto err; } - if (!tlsext_srtp_serverhello_needs(ssl)) { + if (!tlsext_srtp_server_needs(ssl)) { FAIL("should send server extension when profile selected\n"); goto err; } @@ -2570,7 +2548,7 @@ test_tlsext_srtp_clienthello(void) CBS_init(&cbs, tlsext_srtp_multiple_invalid, sizeof(tlsext_srtp_multiple_invalid)); - if (!tlsext_srtp_clienthello_parse(ssl, &cbs, &alert)) { + if (!tlsext_srtp_server_parse(ssl, &cbs, &alert)) { FAIL("should be able to fall back to negotiated\n"); goto err; } @@ -2584,7 +2562,7 @@ test_tlsext_srtp_clienthello(void) FAIL("should not have selected a profile when none found\n"); goto err; } - if (tlsext_srtp_serverhello_needs(ssl)) { + if (tlsext_srtp_server_needs(ssl)) { FAIL("should not send server tlsext when no profile found\n"); goto err; } @@ -2601,7 +2579,7 @@ test_tlsext_srtp_clienthello(void) } static int -test_tlsext_srtp_serverhello(void) +test_tlsext_srtp_server(void) { SRTP_PROTECTION_PROFILE *prof; SSL_CTX *ssl_ctx = NULL; @@ -2623,8 +2601,8 @@ test_tlsext_srtp_serverhello(void) errx(1, "failed to create SSL"); /* By default, we don't need this */ - if (tlsext_srtp_serverhello_needs(ssl)) { - FAIL("serverhello should not need SRTP by default\n"); + if (tlsext_srtp_server_needs(ssl)) { + FAIL("server should not need SRTP by default\n"); goto err; } @@ -2634,22 +2612,22 @@ test_tlsext_srtp_serverhello(void) goto err; } ssl->internal->srtp_profile = prof; - if (!tlsext_srtp_serverhello_needs(ssl)) { - FAIL("serverhello should need SRTP by now\n"); + if (!tlsext_srtp_server_needs(ssl)) { + FAIL("server should need SRTP by now\n"); goto err; } - /* Make sure we can build the serverhello with a single profile. */ + /* Make sure we can build the server with a single profile. */ - if (!tlsext_srtp_serverhello_build(ssl, &cbb)) { - FAIL("serverhello failed to build SRTP\n"); + if (!tlsext_srtp_server_build(ssl, &cbb)) { + FAIL("server failed to build SRTP\n"); goto err; } if (!CBB_finish(&cbb, &data, &dlen)) errx(1, "failed to finish CBB"); if (dlen != sizeof(tlsext_srtp_single)) { - FAIL("got serverhello SRTP with length %zu, " + FAIL("got server SRTP with length %zu, " "want length %zu\n", dlen, sizeof(tlsext_srtp_single)); compare_data(data, dlen, tlsext_srtp_single, @@ -2657,7 +2635,7 @@ test_tlsext_srtp_serverhello(void) goto err; } if (memcmp(data, tlsext_srtp_single, dlen) != 0) { - FAIL("serverhello SRTP differs:\n"); + FAIL("server SRTP differs:\n"); compare_data(data, dlen, tlsext_srtp_single, sizeof(tlsext_srtp_single)); goto err; @@ -2683,7 +2661,7 @@ test_tlsext_srtp_serverhello(void) } CBS_init(&cbs, tlsext_srtp_single, sizeof(tlsext_srtp_single)); - if (!tlsext_srtp_serverhello_parse(ssl, &cbs, &alert)) { + if (!tlsext_srtp_client_parse(ssl, &cbs, &alert)) { FAIL("failed to parse SRTP\n"); goto err; } @@ -2706,17 +2684,17 @@ test_tlsext_srtp_serverhello(void) CBS_init(&cbs, tlsext_srtp_multiple, sizeof(tlsext_srtp_multiple)); - if (tlsext_srtp_serverhello_parse(ssl, &cbs, &alert)) { + if (tlsext_srtp_client_parse(ssl, &cbs, &alert)) { FAIL("should not find multiple entries from the server\n"); goto err; } - /* Make sure we cannot parse a serverhello with unknown profile */ + /* Make sure we cannot parse a server with unknown profile */ ssl->internal->srtp_profile = NULL; CBS_init(&cbs, tlsext_srtp_single_invalid, sizeof(tlsext_srtp_single_invalid)); - if (tlsext_srtp_serverhello_parse(ssl, &cbs, &alert)) { + if (tlsext_srtp_client_parse(ssl, &cbs, &alert)) { FAIL("should not be able to parse this\n"); goto err; } @@ -2733,43 +2711,879 @@ test_tlsext_srtp_serverhello(void) } #endif /* OPENSSL_NO_SRTP */ -int -main(int argc, char **argv) +unsigned char tlsext_clienthello_default[] = { + 0x00, 0x32, 0x00, 0x0b, 0x00, 0x02, 0x01, 0x00, + 0x00, 0x0a, 0x00, 0x08, 0x00, 0x06, 0x00, 0x1d, + 0x00, 0x17, 0x00, 0x18, 0x00, 0x23, 0x00, 0x00, + 0x00, 0x0d, 0x00, 0x18, 0x00, 0x16, 0x08, 0x06, + 0x06, 0x01, 0x06, 0x03, 0x08, 0x05, 0x05, 0x01, + 0x05, 0x03, 0x08, 0x04, 0x04, 0x01, 0x04, 0x03, + 0x02, 0x01, 0x02, 0x03, +}; + +unsigned char tlsext_clienthello_disabled[] = { + 0x00 +}; +const size_t sizeof_tlsext_clienthello_disabled = 0; + +static int +test_tlsext_clienthello_build(void) { - int failed = 0; + unsigned char *data = NULL; + SSL_CTX *ssl_ctx = NULL; + SSL *ssl = NULL; + size_t dlen; + int failure; + CBB cbb; - SSL_library_init(); + failure = 1; + + if (!CBB_init(&cbb, 0)) + errx(1, "failed to create CBB"); + + if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) + errx(1, "failed to create SSL_CTX"); + if ((ssl = SSL_new(ssl_ctx)) == NULL) + errx(1, "failed to create SSL"); + + if (!tlsext_client_build(ssl, &cbb, SSL_TLSEXT_MSG_CH)) { + FAIL("failed to build clienthello extensions\n"); + goto err; + } + if (!CBB_finish(&cbb, &data, &dlen)) + errx(1, "failed to finish CBB"); + + if (dlen != sizeof(tlsext_clienthello_default)) { + FAIL("got clienthello extensions with length %zu, " + "want length %zu\n", dlen, + sizeof(tlsext_clienthello_default)); + compare_data(data, dlen, tlsext_clienthello_default, + sizeof(tlsext_clienthello_default)); + goto err; + } + if (memcmp(data, tlsext_clienthello_default, dlen) != 0) { + FAIL("clienthello extensions differs:\n"); + compare_data(data, dlen, tlsext_clienthello_default, + sizeof(tlsext_clienthello_default)); + goto err; + } + + CBB_cleanup(&cbb); + CBB_init(&cbb, 0); + + /* Switch to TLSv1.1, disable EC ciphers and session tickets. */ + ssl->client_version = TLS1_1_VERSION; + if (!SSL_set_cipher_list(ssl, "TLSv1.2:!ECDHE:!ECDSA")) { + FAIL("failed to set cipher list\n"); + goto err; + } + if ((SSL_set_options(ssl, SSL_OP_NO_TICKET) & SSL_OP_NO_TICKET) == 0) { + FAIL("failed to disable session tickets"); + return 0; + } + + if (!tlsext_client_build(ssl, &cbb, SSL_TLSEXT_MSG_CH)) { + FAIL("failed to build clienthello extensions\n"); + goto err; + } + if (!CBB_finish(&cbb, &data, &dlen)) + errx(1, "failed to finish CBB"); - failed |= test_tlsext_alpn_clienthello(); - failed |= test_tlsext_alpn_serverhello(); + if (dlen != sizeof_tlsext_clienthello_disabled) { + FAIL("got clienthello extensions with length %zu, " + "want length %zu\n", dlen, + sizeof_tlsext_clienthello_disabled); + compare_data(data, dlen, tlsext_clienthello_disabled, + sizeof_tlsext_clienthello_disabled); + goto err; + } + if (memcmp(data, tlsext_clienthello_disabled, dlen) != 0) { + FAIL("clienthello extensions differs:\n"); + compare_data(data, dlen, tlsext_clienthello_disabled, + sizeof_tlsext_clienthello_disabled); + goto err; + } - failed |= test_tlsext_ec_clienthello(); - failed |= test_tlsext_ec_serverhello(); + failure = 0; - failed |= test_tlsext_ecpf_clienthello(); - failed |= test_tlsext_ecpf_serverhello(); + err: + CBB_cleanup(&cbb); + SSL_CTX_free(ssl_ctx); + SSL_free(ssl); + free(data); - failed |= test_tlsext_ri_clienthello(); - failed |= test_tlsext_ri_serverhello(); + return (failure); +} - failed |= test_tlsext_sigalgs_clienthello(); - failed |= test_tlsext_sigalgs_serverhello(); +unsigned char tlsext_serverhello_default[] = { + 0x00 +}; +const size_t sizeof_tlsext_serverhello_default = 0; - failed |= test_tlsext_sni_clienthello(); - failed |= test_tlsext_sni_serverhello(); +unsigned char tlsext_serverhello_enabled[] = { + 0x00, 0x13, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x23, 0x00, 0x00, +}; - failed |= test_tlsext_ocsp_clienthello(); - failed |= test_tlsext_ocsp_serverhello(); +static int +test_tlsext_serverhello_build(void) +{ + unsigned char *data = NULL; + SSL_CTX *ssl_ctx = NULL; + SSL *ssl = NULL; + size_t dlen; + int failure; + CBB cbb; - failed |= test_tlsext_sessionticket_clienthello(); - failed |= test_tlsext_sessionticket_serverhello(); + failure = 1; -#ifndef OPENSSL_NO_SRTP - failed |= test_tlsext_srtp_clienthello(); - failed |= test_tlsext_srtp_serverhello(); -#else - fprintf(stderr, "Skipping SRTP tests due to OPENSSL_NO_SRTP\n"); -#endif + if (!CBB_init(&cbb, 0)) + errx(1, "failed to create CBB"); + + if ((ssl_ctx = SSL_CTX_new(TLS_server_method())) == NULL) + errx(1, "failed to create SSL_CTX"); + if ((ssl = SSL_new(ssl_ctx)) == NULL) + errx(1, "failed to create SSL"); + if ((ssl->session = SSL_SESSION_new()) == NULL) + errx(1, "failed to create session"); + + S3I(ssl)->hs.new_cipher = + ssl3_get_cipher_by_id(TLS1_CK_RSA_WITH_AES_128_SHA256); + + if (!tlsext_server_build(ssl, &cbb, SSL_TLSEXT_MSG_SH)) { + FAIL("failed to build serverhello extensions\n"); + goto err; + } + if (!CBB_finish(&cbb, &data, &dlen)) + errx(1, "failed to finish CBB"); + + if (dlen != sizeof_tlsext_serverhello_default) { + FAIL("got serverhello extensions with length %zu, " + "want length %zu\n", dlen, + sizeof_tlsext_serverhello_default); + compare_data(data, dlen, tlsext_serverhello_default, + sizeof_tlsext_serverhello_default); + goto err; + } + if (memcmp(data, tlsext_serverhello_default, dlen) != 0) { + FAIL("serverhello extensions differs:\n"); + compare_data(data, dlen, tlsext_serverhello_default, + sizeof_tlsext_serverhello_default); + goto err; + } + + CBB_cleanup(&cbb); + CBB_init(&cbb, 0); + + /* Turn a few things on so we get extensions... */ + S3I(ssl)->send_connection_binding = 1; + S3I(ssl)->hs.new_cipher = + ssl3_get_cipher_by_id(TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256); + ssl->internal->tlsext_status_expected = 1; + ssl->internal->tlsext_ticket_expected = 1; + if ((SSI(ssl)->tlsext_ecpointformatlist = malloc(1)) == NULL) + errx(1, "malloc failed"); + SSI(ssl)->tlsext_ecpointformatlist_length = 1; + SSI(ssl)->tlsext_ecpointformatlist[0] = + TLSEXT_ECPOINTFORMAT_uncompressed; + + if (!tlsext_server_build(ssl, &cbb, SSL_TLSEXT_MSG_SH)) { + FAIL("failed to build serverhello extensions\n"); + goto err; + } + if (!CBB_finish(&cbb, &data, &dlen)) + errx(1, "failed to finish CBB"); + + if (dlen != sizeof(tlsext_serverhello_enabled)) { + FAIL("got serverhello extensions with length %zu, " + "want length %zu\n", dlen, + sizeof(tlsext_serverhello_enabled)); + compare_data(data, dlen, tlsext_serverhello_enabled, + sizeof(tlsext_serverhello_enabled)); + goto err; + } + if (memcmp(data, tlsext_serverhello_enabled, dlen) != 0) { + FAIL("serverhello extensions differs:\n"); + compare_data(data, dlen, tlsext_serverhello_enabled, + sizeof(tlsext_serverhello_enabled)); + goto err; + } + + failure = 0; + + err: + CBB_cleanup(&cbb); + SSL_CTX_free(ssl_ctx); + SSL_free(ssl); + free(data); + + return (failure); +} + +const unsigned char tlsext_versions_client[] = { + 0x08, 0x03, 0x04, 0x03, 0x03, 0x03, + 0x02, 0x03, 0x01, +}; + +const unsigned char tlsext_versions_server[] = { + 0x03, 0x04, +}; + +static int +test_tlsext_versions_client(void) +{ + unsigned char *data = NULL; + SSL_CTX *ssl_ctx = NULL; + SSL *ssl = NULL; + int failure = 0; + size_t dlen; + int alert; + CBB cbb; + CBS cbs; + + CBB_init(&cbb, 0); + + if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) + errx(1, "failed to create SSL_CTX"); + if ((ssl = SSL_new(ssl_ctx)) == NULL) + errx(1, "failed to create SSL"); + + S3I(ssl)->hs_tls13.max_version = 0; + + if (tlsext_versions_client_needs(ssl)) { + FAIL("client should not need versions\n"); + failure = 1; + goto done; + } + + S3I(ssl)->hs_tls13.max_version = TLS1_2_VERSION; + + if (tlsext_versions_client_needs(ssl)) { + FAIL("client should not need versions\n"); + failure = 1; + goto done; + } + + S3I(ssl)->hs_tls13.max_version = TLS1_3_VERSION; + + if (!tlsext_versions_client_needs(ssl)) { + FAIL("client should need versions\n"); + failure = 1; + goto done; + } + + S3I(ssl)->hs_tls13.max_version = TLS1_3_VERSION; + S3I(ssl)->hs_tls13.min_version = 0; + if (tlsext_versions_client_build(ssl, &cbb)) { + FAIL("client should not have built versions\n"); + failure = 1; + goto done; + } + + S3I(ssl)->hs_tls13.max_version = TLS1_3_VERSION; + S3I(ssl)->hs_tls13.min_version = TLS1_VERSION; + if (!tlsext_versions_client_build(ssl, &cbb)) { + FAIL("client should have built versions\n"); + failure = 1; + goto done; + } + + if (!CBB_finish(&cbb, &data, &dlen)) { + FAIL("failed to finish CBB"); + failure = 1; + goto done; + } + + if (dlen != sizeof(tlsext_versions_client)) { + FAIL("got versions with length %zu, " + "want length %zu\n", dlen, sizeof(tlsext_versions_client)); + failure = 1; + goto done; + } + + CBS_init(&cbs, data, dlen); + if (!tlsext_versions_server_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse client versions\n"); + failure = 1; + goto done; + } + if (CBS_len(&cbs) != 0) { + FAIL("extension data remaining"); + failure = 1; + goto done; + } + done: + CBB_cleanup(&cbb); + SSL_CTX_free(ssl_ctx); + SSL_free(ssl); + free(data); + + return (failure); +} + + +static int +test_tlsext_versions_server(void) +{ + unsigned char *data = NULL; + SSL_CTX *ssl_ctx = NULL; + SSL *ssl = NULL; + int failure = 0; + size_t dlen; + int alert; + CBB cbb; + CBS cbs; + + CBB_init(&cbb, 0); + + if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) + errx(1, "failed to create SSL_CTX"); + if ((ssl = SSL_new(ssl_ctx)) == NULL) + errx(1, "failed to create SSL"); + + ssl->version = TLS1_2_VERSION; + + if (tlsext_versions_server_needs(ssl)) { + FAIL("server should not need versions\n"); + failure = 1; + goto done; + } + + ssl->version = TLS1_3_VERSION; + + if (!tlsext_versions_server_needs(ssl)) { + FAIL("server should need versions\n"); + failure = 1; + goto done; + } + + if (!tlsext_versions_server_build(ssl, &cbb)) { + FAIL("server should have built versions\n"); + failure = 1; + goto done; + } + + if (!CBB_finish(&cbb, &data, &dlen)) { + FAIL("failed to finish CBB"); + failure = 1; + goto done; + } + + if (dlen != sizeof(tlsext_versions_server)) { + FAIL("got versions with length %zu, " + "want length %zu\n", dlen, sizeof(tlsext_versions_server)); + failure = 1; + goto done; + } + + CBS_init(&cbs, data, dlen); + if (!tlsext_versions_client_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse client versions\n"); + failure = 1; + goto done; + } + if (CBS_len(&cbs) != 0) { + FAIL("extension data remaining"); + failure = 1; + goto done; + } + done: + CBB_cleanup(&cbb); + SSL_CTX_free(ssl_ctx); + SSL_free(ssl); + free(data); + + return (failure); +} + +const unsigned char tlsext_keyshare_client[] = { + 0x00, 0x24, 0x00, 0x1d, 0x00, 0x20, 0xba, 0x83, + 0x2e, 0x4a, 0x18, 0xbe, 0x96, 0xd2, 0x71, 0x70, + 0x18, 0x04, 0xf9, 0x9d, 0x76, 0x98, 0xef, 0xe8, + 0x4f, 0x8b, 0x85, 0x41, 0xa4, 0xd9, 0x61, 0x57, + 0xad, 0x5b, 0xa4, 0xe9, 0x8b, 0x6b, +}; + +const unsigned char tlsext_keyshare_server[] = { + 0x00, 0x1d, 0x00, 0x20, 0xe5, 0xe8, 0x5a, 0xb9, + 0x7e, 0x12, 0x62, 0xe3, 0xd8, 0x7f, 0x6e, 0x3c, + 0xec, 0xa6, 0x8b, 0x99, 0x45, 0x77, 0x8e, 0x11, + 0xb3, 0xb9, 0x12, 0xb6, 0xbe, 0x35, 0xca, 0x51, + 0x76, 0x1e, 0xe8, 0x22 +}; + +static int +test_tlsext_keyshare_client(void) +{ + unsigned char *data = NULL; + SSL_CTX *ssl_ctx = NULL; + SSL *ssl = NULL; + int failure = 0; + size_t dlen; + int alert; + CBB cbb; + CBS cbs; + + CBB_init(&cbb, 0); + + if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) + errx(1, "failed to create SSL_CTX"); + if ((ssl = SSL_new(ssl_ctx)) == NULL) + errx(1, "failed to create SSL"); + + S3I(ssl)->hs_tls13.max_version = 0; + + if (tlsext_keyshare_client_needs(ssl)) { + FAIL("client should not need keyshare\n"); + failure = 1; + goto done; + } + + S3I(ssl)->hs_tls13.max_version = TLS1_2_VERSION; + if (tlsext_keyshare_client_needs(ssl)) { + FAIL("client should not need keyshare\n"); + failure = 1; + goto done; + } + + S3I(ssl)->hs_tls13.max_version = TLS1_3_VERSION; + if (!tlsext_keyshare_client_needs(ssl)) { + FAIL("client should need keyshare\n"); + failure = 1; + goto done; + } + + S3I(ssl)->hs_tls13.max_version = TLS1_3_VERSION; + if (!tlsext_keyshare_client_build(ssl, &cbb)) { + FAIL("client should have built keyshare\n"); + failure = 1; + goto done; + } + + if (!CBB_finish(&cbb, &data, &dlen)) { + FAIL("failed to finish CBB"); + failure = 1; + goto done; + } + + if (dlen != sizeof(tlsext_keyshare_client)) { + FAIL("got client keyshare with length %zu, " + "want length %zu\n", dlen, (size_t) sizeof(tlsext_keyshare_client)); + failure = 1; + goto done; + } + + (ssl)->version = TLS1_3_VERSION; + CBS_init(&cbs, data, dlen); + + if (!tlsext_keyshare_server_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse client keyshare\n"); + failure = 1; + goto done; + } + + if (CBS_len(&cbs) != 0) { + FAIL("extension data remaining"); + failure = 1; + goto done; + } + + + done: + CBB_cleanup(&cbb); + SSL_CTX_free(ssl_ctx); + SSL_free(ssl); + free(data); + + return (failure); +} + +static int +test_tlsext_keyshare_server(void) +{ + unsigned char *data = NULL; + SSL_CTX *ssl_ctx = NULL; + SSL *ssl = NULL; + int failure = 0; + size_t dlen, idx; + int alert; + CBB cbb; + CBS cbs; + uint8_t bogokey[] = { + 0xe5, 0xe8, 0x5a, 0xb9, 0x7e, 0x12, 0x62, 0xe3, + 0xd8, 0x7f, 0x6e, 0x3c, 0xec, 0xa6, 0x8b, 0x99, + 0x45, 0x77, 0x8e, 0x11, 0xb3, 0xb9, 0x12, 0xb6, + 0xbe, 0x35, 0xca, 0x51, 0x76, 0x1e, 0xe8, 0x22 + }; + + CBB_init(&cbb, 0); + + if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) + errx(1, "failed to create SSL_CTX"); + if ((ssl = SSL_new(ssl_ctx)) == NULL) + errx(1, "failed to create SSL"); + + (ssl)->version = 0; + if (tlsext_keyshare_server_needs(ssl)) { + FAIL("server should not need keyshare\n"); + failure = 1; + goto done; + } + + (ssl)->version = TLS1_2_VERSION; + if (tlsext_keyshare_server_needs(ssl)) { + FAIL("server should not need keyshare\n"); + failure = 1; + goto done; + } + + ssl->version = TLS1_3_VERSION; + if (tlsext_keyshare_server_needs(ssl)) { + FAIL("client should not need keyshare\n"); + failure = 1; + goto done; + } + + if (tls_extension_find(TLSEXT_TYPE_key_share, &idx) == NULL) + FAIL("Can't find keyshare extension"); + S3I(ssl)->hs.extensions_seen |= (1 << idx); + + if (!tlsext_keyshare_server_needs(ssl)) { + FAIL("server should need keyshare"); + failure = 1; + goto done; + } + + if (tlsext_keyshare_server_build(ssl, &cbb)) { + FAIL("server should not have built a keyshare response"); + failure = 1; + goto done; + } + + if ((S3I(ssl)->hs_tls13.x25519_peer_public = + malloc(sizeof(bogokey))) == NULL) + errx(1, "malloc failed"); + memcpy(S3I(ssl)->hs_tls13.x25519_peer_public, bogokey, sizeof(bogokey)); + + if (!tlsext_keyshare_server_build(ssl, &cbb)) { + FAIL("server should be able to build a keyshare response"); + failure = 1; + goto done; + } + + if (!CBB_finish(&cbb, &data, &dlen)) { + FAIL("failed to finish CBB"); + failure = 1; + goto done; + } + + if (dlen != sizeof(tlsext_keyshare_server)) { + FAIL("got server keyshare with length %zu, " + "want length %zu\n", dlen, sizeof(tlsext_keyshare_server)); + failure = 1; + goto done; + } + + CBS_init(&cbs, data, dlen); + + if (!tlsext_keyshare_client_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse server keyshare\n"); + failure = 1; + goto done; + } + + if (CBS_len(&cbs) != 0) { + FAIL("extension data remaining"); + failure = 1; + goto done; + } + +done: + CBB_cleanup(&cbb); + SSL_CTX_free(ssl_ctx); + SSL_free(ssl); + free(data); + + return (failure); +} + +/* One day I hope to be the only Muppet in this codebase */ +const uint8_t cookie[] = "\n" + " .---. .---. \n" + " : : o : me want cookie! \n" + " _..-: o : :-.._ / \n" + " .-'' ' `---' `---' ' ``-. \n" + " .' ' ' ' . ' . ' ' `. \n" + " : '.---.,,.,...,.,.,.,..---. ' ; \n" + " `. ' `. .' ' .' \n" + " `. '`. .' ' .' \n" + " `. `-._ _.-' ' .' .----. \n" + " `. ' ''--...--'' . ' .' .' o `. \n" + " .'`-._' ' . ' _.-'`. : o : \n" + " jgs .' ```--.....--''' ' `:_ o : \n" + " .' ' ' ' ' ; `.;';';';' \n" + " ; ' ' ' . ; .' ; ; ; \n" + " ; ' ' ' ' .' .-' \n" + " ' ' ' ' ' ' _.-' \n"; + +static int +test_tlsext_cookie_client(void) +{ + unsigned char *data = NULL; + SSL_CTX *ssl_ctx = NULL; + SSL *ssl = NULL; + int failure = 0; + size_t dlen; + int alert; + CBB cbb; + CBS cbs; + + CBB_init(&cbb, 0); + + if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) + errx(1, "failed to create SSL_CTX"); + if ((ssl = SSL_new(ssl_ctx)) == NULL) + errx(1, "failed to create SSL"); + + S3I(ssl)->hs_tls13.max_version = 0; + if (tlsext_cookie_client_needs(ssl)) { + FAIL("client should not need cookie\n"); + failure = 1; + goto done; + } + + S3I(ssl)->hs_tls13.max_version = TLS1_2_VERSION; + if (tlsext_cookie_client_needs(ssl)) { + FAIL("client should not need cookie\n"); + failure = 1; + goto done; + } + + + S3I(ssl)->hs_tls13.max_version = TLS1_3_VERSION; + if (tlsext_cookie_client_needs(ssl)) { + FAIL("client should not need cookie\n"); + failure = 1; + goto done; + } + + /* Normally would be set by receiving a server cookie in an HRR */ + S3I(ssl)->hs_tls13.cookie = strdup(cookie); + S3I(ssl)->hs_tls13.cookie_len = strlen(cookie); + + if (!tlsext_cookie_client_needs(ssl)) { + FAIL("client should need cookie"); + failure = 1; + goto done; + } + + if (!tlsext_cookie_client_build(ssl, &cbb)) { + FAIL("client should have built a cookie response"); + failure = 1; + goto done; + } + + if (!CBB_finish(&cbb, &data, &dlen)) { + FAIL("failed to finish CBB"); + failure = 1; + goto done; + } + + if (dlen != strlen(cookie) + sizeof(uint16_t)) { + FAIL("got cookie with length %zu, " + "want length %zu\n", dlen, strlen(cookie) + + sizeof(uint16_t)); + failure = 1; + goto done; + } + + CBS_init(&cbs, data, dlen); + + /* Checks cookie against what's in the hs_tls13 */ + if (!tlsext_cookie_server_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse client cookie\n"); + failure = 1; + goto done; + } + + if (CBS_len(&cbs) != 0) { + FAIL("extension data remaining"); + failure = 1; + goto done; + } + + done: + CBB_cleanup(&cbb); + SSL_CTX_free(ssl_ctx); + SSL_free(ssl); + free(data); + + return (failure); +} + +static int +test_tlsext_cookie_server(void) +{ + unsigned char *data = NULL; + SSL_CTX *ssl_ctx = NULL; + SSL *ssl = NULL; + int failure = 0; + size_t dlen; + int alert; + CBB cbb; + CBS cbs; + + CBB_init(&cbb, 0); + + if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) + errx(1, "failed to create SSL_CTX"); + if ((ssl = SSL_new(ssl_ctx)) == NULL) + errx(1, "failed to create SSL"); + + S3I(ssl)->hs_tls13.max_version = 0; + if (tlsext_cookie_server_needs(ssl)) { + FAIL("server should not need cookie\n"); + failure = 1; + goto done; + } + + S3I(ssl)->hs_tls13.max_version = TLS1_2_VERSION; + if (tlsext_cookie_server_needs(ssl)) { + FAIL("server should not need cookie\n"); + failure = 1; + goto done; + } + + + S3I(ssl)->hs_tls13.max_version = TLS1_3_VERSION; + if (tlsext_cookie_server_needs(ssl)) { + FAIL("server should not need cookie\n"); + failure = 1; + goto done; + } + + /* Normally would be set by server before sending HRR */ + S3I(ssl)->hs_tls13.cookie = strdup(cookie); + S3I(ssl)->hs_tls13.cookie_len = strlen(cookie); + + if (!tlsext_cookie_server_needs(ssl)) { + FAIL("server should need cookie"); + failure = 1; + goto done; + } + + if (!tlsext_cookie_server_build(ssl, &cbb)) { + FAIL("server have built a cookie response"); + failure = 1; + goto done; + } + + if (!CBB_finish(&cbb, &data, &dlen)) { + FAIL("failed to finish CBB"); + failure = 1; + goto done; + } + + if (dlen != strlen(cookie) + sizeof(uint16_t)) { + FAIL("got cookie with length %zu, " + "want length %zu\n", dlen, strlen(cookie) + + sizeof(uint16_t)); + failure = 1; + goto done; + } + + CBS_init(&cbs, data, dlen); + + if (tlsext_cookie_client_parse(ssl, &cbs, &alert)) { + FAIL("client should not have parsed server cookie\n"); + failure = 1; + goto done; + } + + freezero(S3I(ssl)->hs_tls13.cookie, S3I(ssl)->hs_tls13.cookie_len); + S3I(ssl)->hs_tls13.cookie = NULL; + S3I(ssl)->hs_tls13.cookie_len = 0; + + if (!tlsext_cookie_client_parse(ssl, &cbs, &alert)) { + FAIL("failed to parse server cookie\n"); + failure = 1; + goto done; + } + + if (memcmp(cookie, S3I(ssl)->hs_tls13.cookie, + S3I(ssl)->hs_tls13.cookie_len) != 0) { + FAIL("parsed server cookie does not match sent cookie\n"); + failure = 1; + goto done; + } + + if (CBS_len(&cbs) != 0) { + FAIL("extension data remaining"); + failure = 1; + goto done; + } + +done: + CBB_cleanup(&cbb); + SSL_CTX_free(ssl_ctx); + SSL_free(ssl); + free(data); + + return (failure); +} + + +int +main(int argc, char **argv) +{ + int failed = 0; + + SSL_library_init(); + SSL_load_error_strings(); + + failed |= test_tlsext_alpn_client(); + failed |= test_tlsext_alpn_server(); + + failed |= test_tlsext_supportedgroups_client(); + failed |= test_tlsext_supportedgroups_server(); + + failed |= test_tlsext_ecpf_client(); + failed |= test_tlsext_ecpf_server(); + + failed |= test_tlsext_ri_client(); + failed |= test_tlsext_ri_server(); + + failed |= test_tlsext_sigalgs_client(); + failed |= test_tlsext_sigalgs_server(); + + failed |= test_tlsext_sni_client(); + failed |= test_tlsext_sni_server(); + + failed |= test_tlsext_ocsp_client(); + failed |= test_tlsext_ocsp_server(); + + failed |= test_tlsext_sessionticket_client(); + failed |= test_tlsext_sessionticket_server(); + + failed |= test_tlsext_versions_client(); + failed |= test_tlsext_versions_server(); + + failed |= test_tlsext_keyshare_client(); + failed |= test_tlsext_keyshare_server(); + + failed |= test_tlsext_cookie_client(); + failed |= test_tlsext_cookie_server(); + +#ifndef OPENSSL_NO_SRTP + failed |= test_tlsext_srtp_client(); + failed |= test_tlsext_srtp_server(); +#else + fprintf(stderr, "Skipping SRTP tests due to OPENSSL_NO_SRTP\n"); +#endif + + failed |= test_tlsext_clienthello_build(); + failed |= test_tlsext_serverhello_build(); return (failed); } diff --git a/tests/tlstest.bat b/tests/tlstest.bat index 55286aee..4b4fad1b 100644 --- a/tests/tlstest.bat +++ b/tests/tlstest.bat @@ -2,13 +2,10 @@ setlocal enabledelayedexpansion REM tlstest.bat -set tlstest_bin=Debug\tlstest.exe +set tlstest_bin=%1 +set tlstest_bin=%tlstest_bin:/=\% if not exist %tlstest_bin% exit /b 1 -if "%srcdir%"=="" ( - set srcdir=. -) - %tlstest_bin% %srcdir%\ca.pem %srcdir%\server.pem %srcdir%\server.pem if !errorlevel! neq 0 ( exit /b 1 diff --git a/tests/tlstest.c b/tests/tlstest.c index fcc40262..8a4d5dbb 100644 --- a/tests/tlstest.c +++ b/tests/tlstest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlstest.c,v 1.9 2017/05/07 03:25:26 jsing Exp $ */ +/* $OpenBSD: tlstest.c,v 1.10 2018/03/19 16:36:12 jsing Exp $ */ /* * Copyright (c) 2017 Joel Sing * @@ -443,9 +443,6 @@ main(int argc, char **argv) certfile = argv[2]; keyfile = argv[3]; - if (tls_init() == -1) - errx(1, "failed to initialise tls"); - failure |= do_tls_tests(); failure |= do_tls_ordering_tests(); diff --git a/tests/utf8test.c b/tests/utf8test.c index 5da57097..e3a47d5a 100644 --- a/tests/utf8test.c +++ b/tests/utf8test.c @@ -1,3 +1,4 @@ +/* $OpenBSD: utf8test.c,v 1.4 2018/07/17 17:06:50 tb Exp $ */ /* * Copyright (c) 2014 Philip Guenther * diff --git a/tests/valid_handshakes_terminate.c b/tests/valid_handshakes_terminate.c new file mode 100644 index 00000000..5f0e4f2c --- /dev/null +++ b/tests/valid_handshakes_terminate.c @@ -0,0 +1,57 @@ +/* $OpenBSD: valid_handshakes_terminate.c,v 1.3 2019/04/05 20:25:42 tb Exp $ */ +/* + * Copyright (c) 2019 Theo Buehler + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include "tls13_handshake.c" + +int +main(int argc, char *argv[]) +{ + size_t i, j; + int terminates; + int fail = 0; + + for (i = 1; i < handshake_count; i++) { + enum tls13_message_type mt = handshakes[i][0]; + + if (mt == INVALID) + continue; + + terminates = 0; + + for (j = 0; j < TLS13_NUM_MESSAGE_TYPES; j++) { + mt = handshakes[i][j]; + if (state_machine[mt].handshake_complete) { + terminates = 1; + break; + } + } + + if (!terminates) { + fail = 1; + printf("FAIL: handshake_complete never true in " + "handshake %zu\n", i); + } + } + + if (!fail) + printf("SUCCESS\n"); + + return fail; +} diff --git a/tests/x25519test.c b/tests/x25519test.c index ae6e296a..02da807b 100644 --- a/tests/x25519test.c +++ b/tests/x25519test.c @@ -1,3 +1,4 @@ +/* $OpenBSD: x25519test.c,v 1.2 2018/07/17 17:06:49 tb Exp $ */ /* * Copyright (c) 2015, Google Inc. * diff --git a/tests/x509name.c b/tests/x509name.c new file mode 100644 index 00000000..c9c96d4e --- /dev/null +++ b/tests/x509name.c @@ -0,0 +1,61 @@ +/* $OpenBSD: x509name.c,v 1.2 2018/11/10 01:43:03 tb Exp $ */ +/* + * Copyright (c) 2018 Ingo Schwarze + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include + +static void debug_print(X509_NAME *); + +static void +debug_print(X509_NAME *name) +{ + int loc; + + for (loc = 0; loc < X509_NAME_entry_count(name); loc++) + printf("%d:", X509_NAME_get_entry(name, loc)->set); + putchar(' '); + X509_NAME_print_ex_fp(stdout, name, 0, XN_FLAG_SEP_CPLUS_SPC); + putchar('\n'); +} + +int +main(void) +{ + X509_NAME *name; + + if ((name = X509_NAME_new()) == NULL) + err(1, NULL); + X509_NAME_add_entry_by_txt(name, "ST", MBSTRING_ASC, + "BaWue", -1, -1, 0); + X509_NAME_add_entry_by_txt(name, "O", MBSTRING_ASC, + "KIT", -1, -1, 0); + debug_print(name); + + X509_NAME_add_entry_by_txt(name, "L", MBSTRING_ASC, + "Karlsruhe", -1, 1, 0); + debug_print(name); + + X509_NAME_add_entry_by_txt(name, "C", MBSTRING_ASC, + "DE", -1, 0, 1); + debug_print(name); + + X509_NAME_free(name); + + return 0; +} diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt index fbe66930..94803ce1 100644 --- a/tls/CMakeLists.txt +++ b/tls/CMakeLists.txt @@ -1,9 +1,3 @@ -include_directories( - . - ../include - ../include/compat -) - set( TLS_SRC tls.c @@ -11,6 +5,7 @@ set( tls_client.c tls_config.c tls_conninfo.c + tls_keypair.c tls_server.c tls_ocsp.c tls_peer.c @@ -18,6 +13,15 @@ set( tls_verify.c ) +if(WIN32) + set( + TLS_SRC + ${TLS_SRC} + compat/ftruncate.c + compat/pread.c + compat/pwrite.c + ) +endif() if(NOT "${OPENSSLDIR}" STREQUAL "") add_definitions(-D_PATH_SSL_CA_FILE=\"${OPENSSLDIR}/cert.pem\") @@ -25,28 +29,32 @@ else() add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\") endif() -add_library(tls-objects OBJECT ${TLS_SRC}) -if (BUILD_SHARED) - add_library(tls STATIC $) - add_library(tls-shared SHARED $) - export_symbol(tls-shared ${CMAKE_CURRENT_SOURCE_DIR}/tls.sym) - target_link_libraries(tls-shared ssl-shared crypto-shared) +add_library(tls ${TLS_SRC}) +target_include_directories(tls + PRIVATE + . + ../include/compat + PUBLIC + ../include) + +if (BUILD_SHARED_LIBS) + export_symbol(tls ${CMAKE_CURRENT_SOURCE_DIR}/tls.sym) + target_link_libraries(tls ssl crypto ${PLATFORM_LIBS}) if (WIN32) - target_link_libraries(tls-shared Ws2_32.lib) set(TLS_POSTFIX -${TLS_MAJOR_VERSION}) endif() - set_target_properties(tls-shared PROPERTIES + set_target_properties(tls PROPERTIES OUTPUT_NAME tls${TLS_POSTFIX} ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX}) - set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION} + set_target_properties(tls PROPERTIES VERSION ${TLS_VERSION} SOVERSION ${TLS_MAJOR_VERSION}) - if(ENABLE_LIBRESSL_INSTALL) - install(TARGETS tls tls-shared DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_LIBRESSL_INSTALL) -else() - add_library(tls STATIC ${TLS_SRC}) - if(ENABLE_LIBRESSL_INSTALL) - install(TARGETS tls DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_LIBRESSL_INSTALL) endif() +if(ENABLE_LIBRESSL_INSTALL) + install( + TARGETS tls + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +endif(ENABLE_LIBRESSL_INSTALL) diff --git a/tls/Makefile.am b/tls/Makefile.am index bd2707a5..fec147e8 100644 --- a/tls/Makefile.am +++ b/tls/Makefile.am @@ -23,9 +23,16 @@ libtls_la_SOURCES += tls_client.c libtls_la_SOURCES += tls_bio_cb.c libtls_la_SOURCES += tls_config.c libtls_la_SOURCES += tls_conninfo.c +libtls_la_SOURCES += tls_keypair.c libtls_la_SOURCES += tls_server.c libtls_la_SOURCES += tls_ocsp.c libtls_la_SOURCES += tls_peer.c libtls_la_SOURCES += tls_util.c libtls_la_SOURCES += tls_verify.c noinst_HEADERS = tls_internal.h + +if HOST_WIN +libtls_la_SOURCES += compat/ftruncate.c +libtls_la_SOURCES += compat/pread.c +libtls_la_SOURCES += compat/pwrite.c +endif diff --git a/tls/Makefile.in b/tls/Makefile.in index 4112ff36..a5c39630 100644 --- a/tls/Makefile.in +++ b/tls/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,6 +91,8 @@ build_triplet = @build@ host_triplet = @host@ @OPENSSLDIR_DEFINED_TRUE@am__append_1 = -D_PATH_SSL_CA_FILE=\"@OPENSSLDIR@/cert.pem\" @OPENSSLDIR_DEFINED_FALSE@am__append_2 = -D_PATH_SSL_CA_FILE=\"$(sysconfdir)/ssl/cert.pem\" +@HOST_WIN_TRUE@am__append_3 = compat/ftruncate.c compat/pread.c \ +@HOST_WIN_TRUE@ compat/pwrite.c subdir = tls ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/check-hardening-options.m4 \ @@ -139,11 +141,20 @@ LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libtls_la_DEPENDENCIES = $(abs_top_builddir)/ssl/libssl.la \ $(abs_top_builddir)/crypto/libcrypto.la $(am__DEPENDENCIES_1) +am__libtls_la_SOURCES_DIST = tls.c tls_client.c tls_bio_cb.c \ + tls_config.c tls_conninfo.c tls_keypair.c tls_server.c \ + tls_ocsp.c tls_peer.c tls_util.c tls_verify.c \ + compat/ftruncate.c compat/pread.c compat/pwrite.c +am__dirstamp = $(am__leading_dot)dirstamp +@HOST_WIN_TRUE@am__objects_1 = compat/libtls_la-ftruncate.lo \ +@HOST_WIN_TRUE@ compat/libtls_la-pread.lo \ +@HOST_WIN_TRUE@ compat/libtls_la-pwrite.lo am_libtls_la_OBJECTS = libtls_la-tls.lo libtls_la-tls_client.lo \ libtls_la-tls_bio_cb.lo libtls_la-tls_config.lo \ - libtls_la-tls_conninfo.lo libtls_la-tls_server.lo \ - libtls_la-tls_ocsp.lo libtls_la-tls_peer.lo \ - libtls_la-tls_util.lo libtls_la-tls_verify.lo + libtls_la-tls_conninfo.lo libtls_la-tls_keypair.lo \ + libtls_la-tls_server.lo libtls_la-tls_ocsp.lo \ + libtls_la-tls_peer.lo libtls_la-tls_util.lo \ + libtls_la-tls_verify.lo $(am__objects_1) libtls_la_OBJECTS = $(am_libtls_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -166,7 +177,21 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/libtls_la-tls.Plo \ + ./$(DEPDIR)/libtls_la-tls_bio_cb.Plo \ + ./$(DEPDIR)/libtls_la-tls_client.Plo \ + ./$(DEPDIR)/libtls_la-tls_config.Plo \ + ./$(DEPDIR)/libtls_la-tls_conninfo.Plo \ + ./$(DEPDIR)/libtls_la-tls_keypair.Plo \ + ./$(DEPDIR)/libtls_la-tls_ocsp.Plo \ + ./$(DEPDIR)/libtls_la-tls_peer.Plo \ + ./$(DEPDIR)/libtls_la-tls_server.Plo \ + ./$(DEPDIR)/libtls_la-tls_util.Plo \ + ./$(DEPDIR)/libtls_la-tls_verify.Plo \ + compat/$(DEPDIR)/libtls_la-ftruncate.Plo \ + compat/$(DEPDIR)/libtls_la-pread.Plo \ + compat/$(DEPDIR)/libtls_la-pwrite.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -187,7 +212,7 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtls_la_SOURCES) -DIST_SOURCES = $(libtls_la_SOURCES) +DIST_SOURCES = $(am__libtls_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -350,8 +375,8 @@ libtls_la_LIBADD = $(abs_top_builddir)/ssl/libssl.la \ $(abs_top_builddir)/crypto/libcrypto.la $(PLATFORM_LDADD) libtls_la_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_1) $(am__append_2) libtls_la_SOURCES = tls.c tls_client.c tls_bio_cb.c tls_config.c \ - tls_conninfo.c tls_server.c tls_ocsp.c tls_peer.c tls_util.c \ - tls_verify.c + tls_conninfo.c tls_keypair.c tls_server.c tls_ocsp.c \ + tls_peer.c tls_util.c tls_verify.c $(am__append_3) noinst_HEADERS = tls_internal.h all: all-am @@ -374,8 +399,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/Makefile.am.common $(am__empty): @@ -422,26 +447,50 @@ clean-libLTLIBRARIES: echo rm -f $${locs}; \ rm -f $${locs}; \ } +compat/$(am__dirstamp): + @$(MKDIR_P) compat + @: > compat/$(am__dirstamp) +compat/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) compat/$(DEPDIR) + @: > compat/$(DEPDIR)/$(am__dirstamp) +compat/libtls_la-ftruncate.lo: compat/$(am__dirstamp) \ + compat/$(DEPDIR)/$(am__dirstamp) +compat/libtls_la-pread.lo: compat/$(am__dirstamp) \ + compat/$(DEPDIR)/$(am__dirstamp) +compat/libtls_la-pwrite.lo: compat/$(am__dirstamp) \ + compat/$(DEPDIR)/$(am__dirstamp) libtls.la: $(libtls_la_OBJECTS) $(libtls_la_DEPENDENCIES) $(EXTRA_libtls_la_DEPENDENCIES) $(AM_V_CCLD)$(libtls_la_LINK) -rpath $(libdir) $(libtls_la_OBJECTS) $(libtls_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f compat/*.$(OBJEXT) + -rm -f compat/*.lo distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_bio_cb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_client.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_config.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_conninfo.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_ocsp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_peer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_server.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_util.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_verify.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_bio_cb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_client.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_config.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_conninfo.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_keypair.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_ocsp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_peer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_server.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_util.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtls_la-tls_verify.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/libtls_la-ftruncate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/libtls_la-pread.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/libtls_la-pwrite.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -502,6 +551,13 @@ libtls_la-tls_conninfo.lo: tls_conninfo.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtls_la-tls_conninfo.lo `test -f 'tls_conninfo.c' || echo '$(srcdir)/'`tls_conninfo.c +libtls_la-tls_keypair.lo: tls_keypair.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtls_la-tls_keypair.lo -MD -MP -MF $(DEPDIR)/libtls_la-tls_keypair.Tpo -c -o libtls_la-tls_keypair.lo `test -f 'tls_keypair.c' || echo '$(srcdir)/'`tls_keypair.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtls_la-tls_keypair.Tpo $(DEPDIR)/libtls_la-tls_keypair.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tls_keypair.c' object='libtls_la-tls_keypair.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtls_la-tls_keypair.lo `test -f 'tls_keypair.c' || echo '$(srcdir)/'`tls_keypair.c + libtls_la-tls_server.lo: tls_server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtls_la-tls_server.lo -MD -MP -MF $(DEPDIR)/libtls_la-tls_server.Tpo -c -o libtls_la-tls_server.lo `test -f 'tls_server.c' || echo '$(srcdir)/'`tls_server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtls_la-tls_server.Tpo $(DEPDIR)/libtls_la-tls_server.Plo @@ -537,11 +593,33 @@ libtls_la-tls_verify.lo: tls_verify.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtls_la-tls_verify.lo `test -f 'tls_verify.c' || echo '$(srcdir)/'`tls_verify.c +compat/libtls_la-ftruncate.lo: compat/ftruncate.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compat/libtls_la-ftruncate.lo -MD -MP -MF compat/$(DEPDIR)/libtls_la-ftruncate.Tpo -c -o compat/libtls_la-ftruncate.lo `test -f 'compat/ftruncate.c' || echo '$(srcdir)/'`compat/ftruncate.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) compat/$(DEPDIR)/libtls_la-ftruncate.Tpo compat/$(DEPDIR)/libtls_la-ftruncate.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='compat/ftruncate.c' object='compat/libtls_la-ftruncate.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat/libtls_la-ftruncate.lo `test -f 'compat/ftruncate.c' || echo '$(srcdir)/'`compat/ftruncate.c + +compat/libtls_la-pread.lo: compat/pread.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compat/libtls_la-pread.lo -MD -MP -MF compat/$(DEPDIR)/libtls_la-pread.Tpo -c -o compat/libtls_la-pread.lo `test -f 'compat/pread.c' || echo '$(srcdir)/'`compat/pread.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) compat/$(DEPDIR)/libtls_la-pread.Tpo compat/$(DEPDIR)/libtls_la-pread.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='compat/pread.c' object='compat/libtls_la-pread.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat/libtls_la-pread.lo `test -f 'compat/pread.c' || echo '$(srcdir)/'`compat/pread.c + +compat/libtls_la-pwrite.lo: compat/pwrite.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compat/libtls_la-pwrite.lo -MD -MP -MF compat/$(DEPDIR)/libtls_la-pwrite.Tpo -c -o compat/libtls_la-pwrite.lo `test -f 'compat/pwrite.c' || echo '$(srcdir)/'`compat/pwrite.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) compat/$(DEPDIR)/libtls_la-pwrite.Tpo compat/$(DEPDIR)/libtls_la-pwrite.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='compat/pwrite.c' object='compat/libtls_la-pwrite.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat/libtls_la-pwrite.lo `test -f 'compat/pwrite.c' || echo '$(srcdir)/'`compat/pwrite.c + mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs + -rm -rf compat/.libs compat/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -595,7 +673,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -658,6 +739,8 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f compat/$(DEPDIR)/$(am__dirstamp) + -rm -f compat/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -668,7 +751,20 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libtls_la-tls.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_bio_cb.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_client.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_config.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_conninfo.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_keypair.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_ocsp.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_peer.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_server.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_util.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_verify.Plo + -rm -f compat/$(DEPDIR)/libtls_la-ftruncate.Plo + -rm -f compat/$(DEPDIR)/libtls_la-pread.Plo + -rm -f compat/$(DEPDIR)/libtls_la-pwrite.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -714,7 +810,20 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libtls_la-tls.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_bio_cb.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_client.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_config.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_conninfo.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_keypair.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_ocsp.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_peer.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_server.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_util.Plo + -rm -f ./$(DEPDIR)/libtls_la-tls_verify.Plo + -rm -f compat/$(DEPDIR)/libtls_la-ftruncate.Plo + -rm -f compat/$(DEPDIR)/libtls_la-pread.Plo + -rm -f compat/$(DEPDIR)/libtls_la-pwrite.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -735,9 +844,9 @@ uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ diff --git a/tls/VERSION b/tls/VERSION index 92dcf9a4..ff02fcea 100644 --- a/tls/VERSION +++ b/tls/VERSION @@ -1 +1 @@ -16:1:0 +19:6:0 diff --git a/tls/compat/ftruncate.c b/tls/compat/ftruncate.c new file mode 100644 index 00000000..e825e504 --- /dev/null +++ b/tls/compat/ftruncate.c @@ -0,0 +1,17 @@ +/* + * Public domain + * + * Kinichiro Inoguchi + */ + +#ifdef _WIN32 + +#include + +int +ftruncate(int fd, off_t length) +{ + return _chsize(fd, length); +} + +#endif diff --git a/tls/compat/pread.c b/tls/compat/pread.c new file mode 100644 index 00000000..b9d6b097 --- /dev/null +++ b/tls/compat/pread.c @@ -0,0 +1,29 @@ +/* + * Public domain + * + * Kinichiro Inoguchi + */ + +#ifdef _WIN32 + +#define NO_REDEF_POSIX_FUNCTIONS + +#include + +ssize_t +pread(int d, void *buf, size_t nbytes, off_t offset) +{ + off_t cpos, opos, rpos; + ssize_t bytes; + if((cpos = lseek(d, 0, SEEK_CUR)) == -1) + return -1; + if((opos = lseek(d, offset, SEEK_SET)) == -1) + return -1; + if((bytes = read(d, buf, nbytes)) == -1) + return -1; + if((rpos = lseek(d, cpos, SEEK_SET)) == -1) + return -1; + return bytes; +} + +#endif diff --git a/tls/compat/pwrite.c b/tls/compat/pwrite.c new file mode 100644 index 00000000..82f5f555 --- /dev/null +++ b/tls/compat/pwrite.c @@ -0,0 +1,29 @@ +/* + * Public domain + * + * Kinichiro Inoguchi + */ + +#ifdef _WIN32 + +#define NO_REDEF_POSIX_FUNCTIONS + +#include + +ssize_t +pwrite(int d, const void *buf, size_t nbytes, off_t offset) +{ + off_t cpos, opos, rpos; + ssize_t bytes; + if((cpos = lseek(d, 0, SEEK_CUR)) == -1) + return -1; + if((opos = lseek(d, offset, SEEK_SET)) == -1) + return -1; + if((bytes = write(d, buf, nbytes)) == -1) + return -1; + if((rpos = lseek(d, cpos, SEEK_SET)) == -1) + return -1; + return bytes; +} + +#endif diff --git a/tls/tls.c b/tls/tls.c index f07c4c6d..46ed8180 100644 --- a/tls/tls.c +++ b/tls/tls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls.c,v 1.71 2017/09/20 17:05:17 jsing Exp $ */ +/* $OpenBSD: tls.c,v 1.83 2019/04/01 15:58:02 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -35,28 +36,33 @@ static struct tls_config *tls_config_default; -int -tls_init(void) -{ - static int tls_initialised = 0; +static int tls_init_rv = -1; - if (tls_initialised) - return (0); - - SSL_load_error_strings(); - SSL_library_init(); +static void +tls_do_init(void) +{ + OPENSSL_init_ssl(OPENSSL_INIT_NO_LOAD_CONFIG, NULL); if (BIO_sock_init() != 1) - return (-1); + return; - if ((tls_config_default = tls_config_new()) == NULL) - return (-1); + if ((tls_config_default = tls_config_new_internal()) == NULL) + return; tls_config_default->refcount++; - tls_initialised = 1; + tls_init_rv = 0; +} - return (0); +int +tls_init(void) +{ + static pthread_once_t once = PTHREAD_ONCE_INIT; + + if (pthread_once(&once, tls_do_init) != 0) + return -1; + + return tls_init_rv; } const char * @@ -250,7 +256,9 @@ tls_configure(struct tls *ctx, struct tls_config *config) if (config == NULL) config = tls_config_default; + pthread_mutex_lock(&config->mutex); config->refcount++; + pthread_mutex_unlock(&config->mutex); tls_config_free(ctx->config); @@ -269,7 +277,9 @@ tls_cert_hash(X509 *cert, char **hash) char d[EVP_MAX_MD_SIZE], *dhex = NULL; int dlen, rv = -1; + free(*hash); *hash = NULL; + if (X509_digest(cert, EVP_sha256(), d, &dlen) != 1) goto err; @@ -288,23 +298,15 @@ tls_cert_hash(X509 *cert, char **hash) return (rv); } -static int -tls_keypair_pubkey_hash(struct tls_keypair *keypair, char **hash) +int +tls_cert_pubkey_hash(X509 *cert, char **hash) { - BIO *membio = NULL; - X509 *cert = NULL; char d[EVP_MAX_MD_SIZE], *dhex = NULL; int dlen, rv = -1; + free(*hash); *hash = NULL; - if ((membio = BIO_new_mem_buf(keypair->cert_mem, - keypair->cert_len)) == NULL) - goto err; - if ((cert = PEM_read_bio_X509_AUX(membio, NULL, tls_password_cb, - NULL)) == NULL) - goto err; - if (X509_pubkey_digest(cert, EVP_sha256(), d, &dlen) != 1) goto err; @@ -320,13 +322,10 @@ tls_keypair_pubkey_hash(struct tls_keypair *keypair, char **hash) err: free(dhex); - X509_free(cert); - BIO_free(membio); return (rv); } - int tls_configure_ssl_keypair(struct tls *ctx, SSL_CTX *ssl_ctx, struct tls_keypair *keypair, int required) @@ -350,8 +349,6 @@ tls_configure_ssl_keypair(struct tls *ctx, SSL_CTX *ssl_ctx, tls_set_errorx(ctx, "failed to load certificate"); goto err; } - if (tls_keypair_pubkey_hash(keypair, &keypair->pubkey_hash) == -1) - goto err; } if (keypair->key_mem != NULL) { @@ -506,7 +503,7 @@ tls_configure_ssl_verify(struct tls *ctx, SSL_CTX *ssl_ctx, int verify) /* If no CA has been specified, attempt to load the default. */ if (ctx->config->ca_mem == NULL && ctx->config->ca_path == NULL) { - if (tls_config_load_file(&ctx->error, "CA", _PATH_SSL_CA_FILE, + if (tls_config_load_file(&ctx->error, "CA", tls_default_ca_cert_file(), &ca_mem, &ca_len) != 0) goto err; ca_free = ca_mem; diff --git a/tls/tls.sym b/tls/tls.sym index 1e7538cf..4064be1b 100644 --- a/tls/tls.sym +++ b/tls/tls.sym @@ -42,6 +42,7 @@ tls_config_set_ocsp_staple_file tls_config_set_protocols tls_config_set_session_id tls_config_set_session_lifetime +tls_config_set_session_fd tls_config_set_verify_depth tls_config_skip_private_key_check tls_config_verify @@ -51,12 +52,14 @@ tls_configure tls_conn_alpn_selected tls_conn_cipher tls_conn_servername +tls_conn_session_resumed tls_conn_version tls_connect tls_connect_cbs tls_connect_fds tls_connect_servername tls_connect_socket +tls_default_ca_cert_file tls_error tls_free tls_handshake diff --git a/tls/tls_client.c b/tls/tls_client.c index c79f462a..04e44020 100644 --- a/tls/tls_client.c +++ b/tls/tls_client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_client.c,v 1.43 2017/08/10 18:18:30 jsing Exp $ */ +/* $OpenBSD: tls_client.c,v 1.45 2018/03/19 16:34:47 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -17,10 +17,12 @@ #include #include +#include #include #include +#include #include #include #include @@ -36,6 +38,9 @@ tls_client(void) { struct tls *ctx; + if (tls_init() == -1) + return (NULL); + if ((ctx = tls_new()) == NULL) return (NULL); @@ -158,6 +163,118 @@ tls_connect_servername(struct tls *ctx, const char *host, const char *port, return (rv); } +static int +tls_client_read_session(struct tls *ctx) +{ + int sfd = ctx->config->session_fd; + uint8_t *session = NULL; + size_t session_len = 0; + SSL_SESSION *ss = NULL; + BIO *bio = NULL; + struct stat sb; + ssize_t n; + int rv = -1; + + if (fstat(sfd, &sb) == -1) { + tls_set_error(ctx, "failed to stat session file"); + goto err; + } + if (sb.st_size < 0 || sb.st_size > INT_MAX) { + tls_set_errorx(ctx, "invalid session file size"); + goto err; + } + session_len = (size_t)sb.st_size; + + /* A zero size file means that we do not yet have a valid session. */ + if (session_len == 0) + goto done; + + if ((session = malloc(session_len)) == NULL) + goto err; + + n = pread(sfd, session, session_len, 0); + if (n < 0 || (size_t)n != session_len) { + tls_set_error(ctx, "failed to read session file"); + goto err; + } + if ((bio = BIO_new_mem_buf(session, session_len)) == NULL) + goto err; + if ((ss = PEM_read_bio_SSL_SESSION(bio, NULL, tls_password_cb, + NULL)) == NULL) { + tls_set_errorx(ctx, "failed to parse session"); + goto err; + } + + if (SSL_set_session(ctx->ssl_conn, ss) != 1) { + tls_set_errorx(ctx, "failed to set session"); + goto err; + } + + done: + rv = 0; + + err: + freezero(session, session_len); + SSL_SESSION_free(ss); + BIO_free(bio); + + return rv; +} + +static int +tls_client_write_session(struct tls *ctx) +{ + int sfd = ctx->config->session_fd; + SSL_SESSION *ss = NULL; + BIO *bio = NULL; + long data_len; + char *data; + off_t offset; + size_t len; + ssize_t n; + int rv = -1; + + if ((ss = SSL_get1_session(ctx->ssl_conn)) == NULL) { + if (ftruncate(sfd, 0) == -1) { + tls_set_error(ctx, "failed to truncate session file"); + goto err; + } + goto done; + } + + if ((bio = BIO_new(BIO_s_mem())) == NULL) + goto err; + if (PEM_write_bio_SSL_SESSION(bio, ss) == 0) + goto err; + if ((data_len = BIO_get_mem_data(bio, &data)) <= 0) + goto err; + + len = (size_t)data_len; + offset = 0; + + if (ftruncate(sfd, len) == -1) { + tls_set_error(ctx, "failed to truncate session file"); + goto err; + } + while (len > 0) { + if ((n = pwrite(sfd, data + offset, len, offset)) == -1) { + tls_set_error(ctx, "failed to write session file"); + goto err; + } + offset += n; + len -= n; + } + + done: + rv = 0; + + err: + SSL_SESSION_free(ss); + BIO_free_all(bio); + + return (rv); +} + static int tls_connect_common(struct tls *ctx, const char *servername) { @@ -221,6 +338,12 @@ tls_connect_common(struct tls *ctx, const char *servername) goto err; } + if (ctx->config->session_fd != -1) { + SSL_clear_options(ctx->ssl_conn, SSL_OP_NO_TICKET); + if (tls_client_read_session(ctx) == -1) + goto err; + } + if (SSL_set_tlsext_status_type(ctx->ssl_conn, TLSEXT_STATUSTYPE_ocsp) != 1) { tls_set_errorx(ctx, "ssl OCSP extension setup failure"); goto err; @@ -336,6 +459,12 @@ tls_handshake_client(struct tls *ctx) } ctx->state |= TLS_HANDSHAKE_COMPLETE; + + if (ctx->config->session_fd != -1) { + if (tls_client_write_session(ctx) == -1) + goto err; + } + rv = 0; err: diff --git a/tls/tls_config.c b/tls/tls_config.c index e7a746d3..1e617100 100644 --- a/tls/tls_config.c +++ b/tls/tls_config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_config.c,v 1.44.4.1 2017/12/09 16:49:17 jsing Exp $ */ +/* $OpenBSD: tls_config.c,v 1.56 2019/04/04 15:09:09 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -15,135 +15,29 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef _MSC_VER +#define NO_REDEF_POSIX_FUNCTIONS +#endif + #include #include #include #include +#include #include #include #include -#include "tls_internal.h" - -static int -set_string(const char **dest, const char *src) -{ - free((char *)*dest); - *dest = NULL; - if (src != NULL) - if ((*dest = strdup(src)) == NULL) - return -1; - return 0; -} - -static void * -memdup(const void *in, size_t len) -{ - void *out; - - if ((out = malloc(len)) == NULL) - return NULL; - memcpy(out, in, len); - return out; -} - -static int -set_mem(char **dest, size_t *destlen, const void *src, size_t srclen) -{ - free(*dest); - *dest = NULL; - *destlen = 0; - if (src != NULL) - if ((*dest = memdup(src, srclen)) == NULL) - return -1; - *destlen = srclen; - return 0; -} - -static struct tls_keypair * -tls_keypair_new(void) -{ - return calloc(1, sizeof(struct tls_keypair)); -} - -static void -tls_keypair_clear_key(struct tls_keypair *keypair) -{ - freezero(keypair->key_mem, keypair->key_len); - keypair->key_mem = NULL; - keypair->key_len = 0; -} -static int -tls_keypair_set_cert_file(struct tls_keypair *keypair, struct tls_error *error, - const char *cert_file) -{ - return tls_config_load_file(error, "certificate", cert_file, - &keypair->cert_mem, &keypair->cert_len); -} - -static int -tls_keypair_set_cert_mem(struct tls_keypair *keypair, const uint8_t *cert, - size_t len) -{ - return set_mem(&keypair->cert_mem, &keypair->cert_len, cert, len); -} - -static int -tls_keypair_set_key_file(struct tls_keypair *keypair, struct tls_error *error, - const char *key_file) -{ - tls_keypair_clear_key(keypair); - return tls_config_load_file(error, "key", key_file, - &keypair->key_mem, &keypair->key_len); -} - -static int -tls_keypair_set_key_mem(struct tls_keypair *keypair, const uint8_t *key, - size_t len) -{ - tls_keypair_clear_key(keypair); - return set_mem(&keypair->key_mem, &keypair->key_len, key, len); -} - -static int -tls_keypair_set_ocsp_staple_file(struct tls_keypair *keypair, - struct tls_error *error, const char *ocsp_file) -{ - return tls_config_load_file(error, "ocsp", ocsp_file, - &keypair->ocsp_staple, &keypair->ocsp_staple_len); -} +#include "tls_internal.h" -static int -tls_keypair_set_ocsp_staple_mem(struct tls_keypair *keypair, - const uint8_t *staple, size_t len) -{ - return set_mem(&keypair->ocsp_staple, &keypair->ocsp_staple_len, staple, - len); -} +static const char default_ca_file[] = "/etc/ssl/cert.pem"; -static void -tls_keypair_clear(struct tls_keypair *keypair) +const char * +tls_default_ca_cert_file(void) { - tls_keypair_set_cert_mem(keypair, NULL, 0); - tls_keypair_set_key_mem(keypair, NULL, 0); -} - -static void -tls_keypair_free(struct tls_keypair *keypair) -{ - if (keypair == NULL) - return; - - tls_keypair_clear(keypair); - - free(keypair->cert_mem); - free(keypair->key_mem); - free(keypair->ocsp_staple); - free(keypair->pubkey_hash); - - free(keypair); + return default_ca_file; } int @@ -161,31 +55,31 @@ tls_config_load_file(struct tls_error *error, const char *filetype, if ((fd = open(filename, O_RDONLY)) == -1) { tls_error_set(error, "failed to open %s file '%s'", filetype, filename); - goto fail; + goto err; } if (fstat(fd, &st) != 0) { tls_error_set(error, "failed to stat %s file '%s'", filetype, filename); - goto fail; + goto err; } if (st.st_size < 0) - goto fail; + goto err; *len = (size_t)st.st_size; if ((*buf = malloc(*len)) == NULL) { tls_error_set(error, "failed to allocate buffer for " "%s file", filetype); - goto fail; + goto err; } n = read(fd, *buf, *len); if (n < 0 || (size_t)n != *len) { tls_error_set(error, "failed to read %s file '%s'", filetype, filename); - goto fail; + goto err; } close(fd); return 0; - fail: + err: if (fd != -1) close(fd); freezero(*buf, *len); @@ -196,7 +90,7 @@ tls_config_load_file(struct tls_error *error, const char *filetype, } struct tls_config * -tls_config_new(void) +tls_config_new_internal(void) { struct tls_config *config; unsigned char sid[TLS_MAX_SESSION_ID_LENGTH]; @@ -204,10 +98,14 @@ tls_config_new(void) if ((config = calloc(1, sizeof(*config))) == NULL) return (NULL); - if ((config->keypair = tls_keypair_new()) == NULL) + if (pthread_mutex_init(&config->mutex, NULL) != 0) goto err; config->refcount = 1; + config->session_fd = -1; + + if ((config->keypair = tls_keypair_new()) == NULL) + goto err; /* * Default configuration. @@ -246,15 +144,29 @@ tls_config_new(void) return (NULL); } +struct tls_config * +tls_config_new(void) +{ + if (tls_init() == -1) + return (NULL); + + return tls_config_new_internal(); +} + void tls_config_free(struct tls_config *config) { struct tls_keypair *kp, *nkp; + int refcount; if (config == NULL) return; - if (--config->refcount > 0) + pthread_mutex_lock(&config->mutex); + refcount = --config->refcount; + pthread_mutex_unlock(&config->mutex); + + if (refcount > 0) return; for (kp = config->keypair; kp != NULL; kp = nkp) { @@ -298,10 +210,7 @@ tls_config_clear_keys(struct tls_config *config) struct tls_keypair *kp; for (kp = config->keypair; kp != NULL; kp = kp->next) - tls_keypair_clear(kp); - - tls_config_set_ca_mem(config, NULL, 0); - tls_config_set_crl_mem(config, NULL, 0); + tls_keypair_clear_key(kp); } int @@ -469,12 +378,13 @@ tls_config_add_keypair_mem_internal(struct tls_config *config, const uint8_t *ce if ((keypair = tls_keypair_new()) == NULL) return (-1); - if (tls_keypair_set_cert_mem(keypair, cert, cert_len) != 0) + if (tls_keypair_set_cert_mem(keypair, &config->error, cert, cert_len) != 0) goto err; - if (tls_keypair_set_key_mem(keypair, key, key_len) != 0) + if (tls_keypair_set_key_mem(keypair, &config->error, key, key_len) != 0) goto err; if (staple != NULL && - tls_keypair_set_ocsp_staple_mem(keypair, staple, staple_len) != 0) + tls_keypair_set_ocsp_staple_mem(keypair, &config->error, staple, + staple_len) != 0) goto err; tls_config_keypair_add(config, keypair); @@ -529,13 +439,13 @@ tls_config_set_ca_file(struct tls_config *config, const char *ca_file) int tls_config_set_ca_path(struct tls_config *config, const char *ca_path) { - return set_string(&config->ca_path, ca_path); + return tls_set_string(&config->ca_path, ca_path); } int tls_config_set_ca_mem(struct tls_config *config, const uint8_t *ca, size_t len) { - return set_mem(&config->ca_mem, &config->ca_len, ca, len); + return tls_set_mem(&config->ca_mem, &config->ca_len, ca, len); } int @@ -549,7 +459,8 @@ int tls_config_set_cert_mem(struct tls_config *config, const uint8_t *cert, size_t len) { - return tls_keypair_set_cert_mem(config->keypair, cert, len); + return tls_keypair_set_cert_mem(config->keypair, &config->error, + cert, len); } int @@ -571,17 +482,17 @@ tls_config_set_ciphers(struct tls_config *config, const char *ciphers) if ((ssl_ctx = SSL_CTX_new(SSLv23_method())) == NULL) { tls_config_set_errorx(config, "out of memory"); - goto fail; + goto err; } if (SSL_CTX_set_cipher_list(ssl_ctx, ciphers) != 1) { tls_config_set_errorx(config, "no ciphers for '%s'", ciphers); - goto fail; + goto err; } SSL_CTX_free(ssl_ctx); - return set_string(&config->ciphers, ciphers); + return tls_set_string(&config->ciphers, ciphers); - fail: + err: SSL_CTX_free(ssl_ctx); return -1; } @@ -597,7 +508,7 @@ int tls_config_set_crl_mem(struct tls_config *config, const uint8_t *crl, size_t len) { - return set_mem(&config->crl_mem, &config->crl_len, crl, len); + return tls_set_mem(&config->crl_mem, &config->crl_len, crl, len); } int @@ -624,17 +535,16 @@ tls_config_set_dheparams(struct tls_config *config, const char *params) int tls_config_set_ecdhecurve(struct tls_config *config, const char *curve) { - if (strchr(curve, ',') != NULL || strchr(curve, ':') != NULL) { + if (curve == NULL || + strcasecmp(curve, "none") == 0 || + strcasecmp(curve, "auto") == 0) { + curve = TLS_ECDHE_CURVES; + } else if (strchr(curve, ',') != NULL || strchr(curve, ':') != NULL) { tls_config_set_errorx(config, "invalid ecdhe curve '%s'", curve); return (-1); } - if (curve == NULL || - strcasecmp(curve, "none") == 0 || - strcasecmp(curve, "auto") == 0) - curve = TLS_ECDHE_CURVES; - return tls_config_set_ecdhecurves(config, curve); } @@ -710,7 +620,8 @@ int tls_config_set_key_mem(struct tls_config *config, const uint8_t *key, size_t len) { - return tls_keypair_set_key_mem(config->keypair, key, len); + return tls_keypair_set_key_mem(config->keypair, &config->error, + key, len); } static int @@ -721,8 +632,6 @@ tls_config_set_keypair_file_internal(struct tls_config *config, return (-1); if (tls_config_set_key_file(config, key_file) != 0) return (-1); - if (tls_config_set_key_file(config, key_file) != 0) - return (-1); if (ocsp_file != NULL && tls_config_set_ocsp_staple_file(config, ocsp_file) != 0) return (-1); @@ -788,6 +697,44 @@ tls_config_set_protocols(struct tls_config *config, uint32_t protocols) return (0); } +int +tls_config_set_session_fd(struct tls_config *config, int session_fd) +{ + struct stat sb; + mode_t mugo; + + if (session_fd == -1) { + config->session_fd = session_fd; + return (0); + } + + if (fstat(session_fd, &sb) == -1) { + tls_config_set_error(config, "failed to stat session file"); + return (-1); + } + if (!S_ISREG(sb.st_mode)) { + tls_config_set_errorx(config, + "session file is not a regular file"); + return (-1); + } + + if (sb.st_uid != getuid()) { + tls_config_set_errorx(config, "session file has incorrect " + "owner (uid %i != %i)", sb.st_uid, getuid()); + return (-1); + } + mugo = sb.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO); + if (mugo != (S_IRUSR|S_IWUSR)) { + tls_config_set_errorx(config, "session file has incorrect " + "permissions (%o != 600)", mugo); + return (-1); + } + + config->session_fd = session_fd; + + return (0); +} + int tls_config_set_verify_depth(struct tls_config *config, int verify_depth) { @@ -869,7 +816,8 @@ int tls_config_set_ocsp_staple_mem(struct tls_config *config, const uint8_t *staple, size_t len) { - return tls_keypair_set_ocsp_staple_mem(config->keypair, staple, len); + return tls_keypair_set_ocsp_staple_mem(config->keypair, &config->error, + staple, len); } int diff --git a/tls/tls_conninfo.c b/tls/tls_conninfo.c index e3820988..8e479ed8 100644 --- a/tls/tls_conninfo.c +++ b/tls/tls_conninfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_conninfo.c,v 1.16 2017/08/27 01:39:26 beck Exp $ */ +/* $OpenBSD: tls_conninfo.c,v 1.20 2018/02/10 04:48:44 jsing Exp $ */ /* * Copyright (c) 2015 Joel Sing * Copyright (c) 2015 Bob Beck @@ -185,8 +185,6 @@ tls_conninfo_cert_pem(struct tls *ctx) BIO *membio = NULL; BUF_MEM *bptr = NULL; - if (ctx->conninfo == NULL) - goto err; if (ctx->ssl_peer_cert == NULL) return 0; if ((membio = BIO_new(BIO_s_mem()))== NULL) @@ -221,6 +219,14 @@ tls_conninfo_cert_pem(struct tls *ctx) return rv; } +static int +tls_conninfo_session(struct tls *ctx) +{ + ctx->conninfo->session_resumed = SSL_session_reused(ctx->ssl_conn); + + return 0; +} + int tls_conninfo_populate(struct tls *ctx) { @@ -238,8 +244,7 @@ tls_conninfo_populate(struct tls *ctx) if ((tmp = SSL_get_cipher(ctx->ssl_conn)) == NULL) goto err; - ctx->conninfo->cipher = strdup(tmp); - if (ctx->conninfo->cipher == NULL) + if ((ctx->conninfo->cipher = strdup(tmp)) == NULL) goto err; if (ctx->servername != NULL) { @@ -250,8 +255,7 @@ tls_conninfo_populate(struct tls *ctx) if ((tmp = SSL_get_version(ctx->ssl_conn)) == NULL) goto err; - ctx->conninfo->version = strdup(tmp); - if (ctx->conninfo->version == NULL) + if ((ctx->conninfo->version = strdup(tmp)) == NULL) goto err; if (tls_get_peer_cert_info(ctx) == -1) @@ -260,6 +264,9 @@ tls_conninfo_populate(struct tls *ctx) if (tls_conninfo_cert_pem(ctx) == -1) goto err; + if (tls_conninfo_session(ctx) == -1) + goto err; + return (0); err: @@ -276,24 +283,15 @@ tls_conninfo_free(struct tls_conninfo *conninfo) return; free(conninfo->alpn); - conninfo->alpn = NULL; free(conninfo->cipher); - conninfo->cipher = NULL; free(conninfo->servername); - conninfo->servername = NULL; free(conninfo->version); - conninfo->version = NULL; free(conninfo->hash); - conninfo->hash = NULL; free(conninfo->issuer); - conninfo->issuer = NULL; free(conninfo->subject); - conninfo->subject = NULL; free(conninfo->peer_cert); - conninfo->peer_cert = NULL; - conninfo->peer_cert_len = 0; free(conninfo); } @@ -322,6 +320,14 @@ tls_conn_servername(struct tls *ctx) return (ctx->conninfo->servername); } +int +tls_conn_session_resumed(struct tls *ctx) +{ + if (ctx->conninfo == NULL) + return (0); + return (ctx->conninfo->session_resumed); +} + const char * tls_conn_version(struct tls *ctx) { @@ -329,4 +335,3 @@ tls_conn_version(struct tls *ctx) return (NULL); return (ctx->conninfo->version); } - diff --git a/tls/tls_internal.h b/tls/tls_internal.h index f688743c..3842439d 100644 --- a/tls/tls_internal.h +++ b/tls/tls_internal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_internal.h,v 1.65 2017/09/20 17:05:17 jsing Exp $ */ +/* $OpenBSD: tls_internal.h,v 1.74 2019/04/01 15:58:02 jsing Exp $ */ /* * Copyright (c) 2014 Jeremie Courreges-Anglas * Copyright (c) 2014 Joel Sing @@ -19,6 +19,8 @@ #ifndef HEADER_TLS_INTERNAL_H #define HEADER_TLS_INTERNAL_H +#include + #include #include @@ -26,10 +28,6 @@ __BEGIN_HIDDEN_DECLS -#ifndef _PATH_SSL_CA_FILE -#define _PATH_SSL_CA_FILE "/etc/ssl/cert.pem" -#endif - #define TLS_CIPHERS_DEFAULT "TLSv1.2+AEAD+ECDHE:TLSv1.2+AEAD+DHE" #define TLS_CIPHERS_COMPAT "HIGH:!aNULL" #define TLS_CIPHERS_LEGACY "HIGH:MEDIUM:!aNULL" @@ -79,6 +77,7 @@ struct tls_ticket_key { struct tls_config { struct tls_error error; + pthread_mutex_t mutex; int refcount; char *alpn; @@ -97,6 +96,7 @@ struct tls_config { int ocsp_require_stapling; uint32_t protocols; unsigned char session_id[TLS_MAX_SESSION_ID_LENGTH]; + int session_fd; int session_lifetime; struct tls_ticket_key ticket_keys[TLS_NUM_TICKETS]; uint32_t ticket_keyrev; @@ -113,6 +113,7 @@ struct tls_conninfo { char *alpn; char *cipher; char *servername; + int session_resumed; char *version; char *hash; @@ -194,9 +195,33 @@ struct tls { void *cb_arg; }; +int tls_set_mem(char **_dest, size_t *_destlen, const void *_src, + size_t _srclen); +int tls_set_string(const char **_dest, const char *_src); + +struct tls_keypair *tls_keypair_new(void); +void tls_keypair_clear_key(struct tls_keypair *_keypair); +void tls_keypair_free(struct tls_keypair *_keypair); +int tls_keypair_set_cert_file(struct tls_keypair *_keypair, + struct tls_error *_error, const char *_cert_file); +int tls_keypair_set_cert_mem(struct tls_keypair *_keypair, + struct tls_error *_error, const uint8_t *_cert, size_t _len); +int tls_keypair_set_key_file(struct tls_keypair *_keypair, + struct tls_error *_error, const char *_key_file); +int tls_keypair_set_key_mem(struct tls_keypair *_keypair, + struct tls_error *_error, const uint8_t *_key, size_t _len); +int tls_keypair_set_ocsp_staple_file(struct tls_keypair *_keypair, + struct tls_error *_error, const char *_ocsp_file); +int tls_keypair_set_ocsp_staple_mem(struct tls_keypair *_keypair, + struct tls_error *_error, const uint8_t *_staple, size_t _len); +int tls_keypair_load_cert(struct tls_keypair *_keypair, + struct tls_error *_error, X509 **_cert); + struct tls_sni_ctx *tls_sni_ctx_new(void); void tls_sni_ctx_free(struct tls_sni_ctx *sni_ctx); +struct tls_config *tls_config_new_internal(void); + struct tls *tls_new(void); struct tls *tls_server_conn(struct tls *ctx); @@ -256,6 +281,7 @@ struct tls_ocsp *tls_ocsp_setup_from_peer(struct tls *ctx); int tls_hex_string(const unsigned char *_in, size_t _inlen, char **_out, size_t *_outlen); int tls_cert_hash(X509 *_cert, char **_hash); +int tls_cert_pubkey_hash(X509 *_cert, char **_hash); int tls_password_cb(char *_buf, int _size, int _rwflag, void *_u); diff --git a/tls/tls_keypair.c b/tls/tls_keypair.c new file mode 100644 index 00000000..a98e5c2e --- /dev/null +++ b/tls/tls_keypair.c @@ -0,0 +1,169 @@ +/* $OpenBSD: tls_keypair.c,v 1.6 2018/04/07 16:35:34 jsing Exp $ */ +/* + * Copyright (c) 2014 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +#include + +#include "tls_internal.h" + +struct tls_keypair * +tls_keypair_new(void) +{ + return calloc(1, sizeof(struct tls_keypair)); +} + +static int +tls_keypair_pubkey_hash(struct tls_keypair *keypair, struct tls_error *error) +{ + X509 *cert = NULL; + int rv = -1; + + free(keypair->pubkey_hash); + keypair->pubkey_hash = NULL; + + if (keypair->cert_mem == NULL) { + rv = 0; + goto done; + } + + if (tls_keypair_load_cert(keypair, error, &cert) == -1) + goto err; + if (tls_cert_pubkey_hash(cert, &keypair->pubkey_hash) == -1) + goto err; + + rv = 0; + + err: + X509_free(cert); + done: + return (rv); +} + +void +tls_keypair_clear_key(struct tls_keypair *keypair) +{ + freezero(keypair->key_mem, keypair->key_len); + keypair->key_mem = NULL; + keypair->key_len = 0; +} + +int +tls_keypair_set_cert_file(struct tls_keypair *keypair, struct tls_error *error, + const char *cert_file) +{ + if (tls_config_load_file(error, "certificate", cert_file, + &keypair->cert_mem, &keypair->cert_len) == -1) + return -1; + return tls_keypair_pubkey_hash(keypair, error); +} + +int +tls_keypair_set_cert_mem(struct tls_keypair *keypair, struct tls_error *error, + const uint8_t *cert, size_t len) +{ + if (tls_set_mem(&keypair->cert_mem, &keypair->cert_len, cert, len) == -1) + return -1; + return tls_keypair_pubkey_hash(keypair, error); +} + +int +tls_keypair_set_key_file(struct tls_keypair *keypair, struct tls_error *error, + const char *key_file) +{ + tls_keypair_clear_key(keypair); + return tls_config_load_file(error, "key", key_file, + &keypair->key_mem, &keypair->key_len); +} + +int +tls_keypair_set_key_mem(struct tls_keypair *keypair, struct tls_error *error, + const uint8_t *key, size_t len) +{ + tls_keypair_clear_key(keypair); + return tls_set_mem(&keypair->key_mem, &keypair->key_len, key, len); +} + +int +tls_keypair_set_ocsp_staple_file(struct tls_keypair *keypair, + struct tls_error *error, const char *ocsp_file) +{ + return tls_config_load_file(error, "ocsp", ocsp_file, + &keypair->ocsp_staple, &keypair->ocsp_staple_len); +} + +int +tls_keypair_set_ocsp_staple_mem(struct tls_keypair *keypair, + struct tls_error *error, const uint8_t *staple, size_t len) +{ + return tls_set_mem(&keypair->ocsp_staple, &keypair->ocsp_staple_len, + staple, len); +} + +void +tls_keypair_free(struct tls_keypair *keypair) +{ + if (keypair == NULL) + return; + + tls_keypair_clear_key(keypair); + + free(keypair->cert_mem); + free(keypair->ocsp_staple); + free(keypair->pubkey_hash); + + free(keypair); +} + +int +tls_keypair_load_cert(struct tls_keypair *keypair, struct tls_error *error, + X509 **cert) +{ + char *errstr = "unknown"; + BIO *cert_bio = NULL; + int ssl_err; + int rv = -1; + + X509_free(*cert); + *cert = NULL; + + if (keypair->cert_mem == NULL) { + tls_error_set(error, "keypair has no certificate"); + goto err; + } + if ((cert_bio = BIO_new_mem_buf(keypair->cert_mem, + keypair->cert_len)) == NULL) { + tls_error_set(error, "failed to create certificate bio"); + goto err; + } + if ((*cert = PEM_read_bio_X509(cert_bio, NULL, tls_password_cb, + NULL)) == NULL) { + if ((ssl_err = ERR_peek_error()) != 0) + errstr = ERR_error_string(ssl_err, NULL); + tls_error_set(error, "failed to load certificate: %s", errstr); + goto err; + } + + rv = 0; + + err: + BIO_free(cert_bio); + + return (rv); +} diff --git a/tls/tls_ocsp.c b/tls/tls_ocsp.c index a8835edc..17afb8e8 100644 --- a/tls/tls_ocsp.c +++ b/tls/tls_ocsp.c @@ -47,11 +47,9 @@ tls_ocsp_free(struct tls_ocsp *ocsp) return; X509_free(ocsp->main_cert); - ocsp->main_cert = NULL; free(ocsp->ocsp_result); - ocsp->ocsp_result = NULL; free(ocsp->ocsp_url); - ocsp->ocsp_url = NULL; + free(ocsp); } @@ -101,23 +99,24 @@ tls_ocsp_fill_info(struct tls *ctx, int response_status, int cert_status, tls_ocsp_asn1_parse_time(ctx, revtime, &info->revocation_time) != 0) { tls_set_error(ctx, "unable to parse revocation time in OCSP reply"); - goto error; + goto err; } if (thisupd != NULL && tls_ocsp_asn1_parse_time(ctx, thisupd, &info->this_update) != 0) { tls_set_error(ctx, "unable to parse this update time in OCSP reply"); - goto error; + goto err; } if (nextupd != NULL && tls_ocsp_asn1_parse_time(ctx, nextupd, &info->next_update) != 0) { tls_set_error(ctx, "unable to parse next update time in OCSP reply"); - goto error; + goto err; } ctx->ocsp->ocsp_result = info; return 0; - error: + + err: free(info); return -1; } @@ -162,32 +161,32 @@ tls_ocsp_setup_from_peer(struct tls *ctx) STACK_OF(OPENSSL_STRING) *ocsp_urls = NULL; if ((ocsp = tls_ocsp_new()) == NULL) - goto failed; + goto err; /* steal state from ctx struct */ ocsp->main_cert = SSL_get_peer_certificate(ctx->ssl_conn); ocsp->extra_certs = SSL_get_peer_cert_chain(ctx->ssl_conn); if (ocsp->main_cert == NULL) { tls_set_errorx(ctx, "no peer certificate for OCSP"); - goto failed; + goto err; } ocsp_urls = X509_get1_ocsp(ocsp->main_cert); if (ocsp_urls == NULL) { tls_set_errorx(ctx, "no OCSP URLs in peer certificate"); - goto failed; + goto err; } ocsp->ocsp_url = strdup(sk_OPENSSL_STRING_value(ocsp_urls, 0)); if (ocsp->ocsp_url == NULL) { tls_set_errorx(ctx, "out of memory"); - goto failed; + goto err; } X509_email_free(ocsp_urls); return ocsp; - failed: + err: tls_ocsp_free(ocsp); X509_email_free(ocsp_urls); return NULL; @@ -206,7 +205,7 @@ tls_ocsp_verify_response(struct tls *ctx, OCSP_RESPONSE *resp) if ((br = OCSP_response_get1_basic(resp)) == NULL) { tls_set_errorx(ctx, "cannot load ocsp reply"); - goto error; + goto err; } /* @@ -219,7 +218,7 @@ tls_ocsp_verify_response(struct tls *ctx, OCSP_RESPONSE *resp) if (OCSP_basic_verify(br, ctx->ocsp->extra_certs, SSL_CTX_get_cert_store(ctx->ssl_ctx), flags) != 1) { tls_set_error(ctx, "ocsp verify failed"); - goto error; + goto err; } /* signature OK, look inside */ @@ -227,43 +226,43 @@ tls_ocsp_verify_response(struct tls *ctx, OCSP_RESPONSE *resp) if (response_status != OCSP_RESPONSE_STATUS_SUCCESSFUL) { tls_set_errorx(ctx, "ocsp verify failed: response - %s", OCSP_response_status_str(response_status)); - goto error; + goto err; } cid = tls_ocsp_get_certid(ctx->ocsp->main_cert, ctx->ocsp->extra_certs, ctx->ssl_ctx); if (cid == NULL) { tls_set_errorx(ctx, "ocsp verify failed: no issuer cert"); - goto error; + goto err; } if (OCSP_resp_find_status(br, cid, &cert_status, &crl_reason, &revtime, &thisupd, &nextupd) != 1) { tls_set_errorx(ctx, "ocsp verify failed: no result for cert"); - goto error; + goto err; } if (OCSP_check_validity(thisupd, nextupd, JITTER_SEC, MAXAGE_SEC) != 1) { tls_set_errorx(ctx, "ocsp verify failed: ocsp response not current"); - goto error; + goto err; } if (tls_ocsp_fill_info(ctx, response_status, cert_status, crl_reason, revtime, thisupd, nextupd) != 0) - goto error; + goto err; /* finally can look at status */ if (cert_status != V_OCSP_CERTSTATUS_GOOD && cert_status != V_OCSP_CERTSTATUS_UNKNOWN) { tls_set_errorx(ctx, "ocsp verify failed: revoked cert - %s", OCSP_crl_reason_str(crl_reason)); - goto error; + goto err; } ret = 0; - error: + err: sk_X509_free(combined); OCSP_CERTID_free(cid); OCSP_BASICRESP_free(br); diff --git a/tls/tls_server.c b/tls/tls_server.c index e1011769..44bef6bb 100644 --- a/tls/tls_server.c +++ b/tls/tls_server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_server.c,v 1.42 2017/09/20 17:05:17 jsing Exp $ */ +/* $OpenBSD: tls_server.c,v 1.44 2018/03/19 16:34:47 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -31,6 +31,9 @@ tls_server(void) { struct tls *ctx; + if (tls_init() == -1) + return (NULL); + if ((ctx = tls_new()) == NULL) return (NULL); @@ -203,43 +206,6 @@ tls_server_ticket_cb(SSL *ssl, unsigned char *keyname, unsigned char *iv, } } -static int -tls_keypair_load_cert(struct tls_keypair *keypair, struct tls_error *error, - X509 **cert) -{ - char *errstr = "unknown"; - BIO *cert_bio = NULL; - int ssl_err; - int rv = -1; - - X509_free(*cert); - *cert = NULL; - - if (keypair->cert_mem == NULL) { - tls_error_set(error, "keypair has no certificate"); - goto err; - } - if ((cert_bio = BIO_new_mem_buf(keypair->cert_mem, - keypair->cert_len)) == NULL) { - tls_error_set(error, "failed to create certificate bio"); - goto err; - } - if ((*cert = PEM_read_bio_X509(cert_bio, NULL, tls_password_cb, - NULL)) == NULL) { - if ((ssl_err = ERR_peek_error()) != 0) - errstr = ERR_error_string(ssl_err, NULL); - tls_error_set(error, "failed to load certificate: %s", errstr); - goto err; - } - - rv = 0; - - err: - BIO_free(cert_bio); - - return (rv); -} - static int tls_configure_server_ssl(struct tls *ctx, SSL_CTX **ssl_ctx, struct tls_keypair *keypair) diff --git a/tls/tls_util.c b/tls/tls_util.c index aaa3eef4..755e9a61 100644 --- a/tls/tls_util.c +++ b/tls/tls_util.c @@ -1,6 +1,7 @@ -/* $OpenBSD: tls_util.c,v 1.9 2017/06/22 18:03:57 jsing Exp $ */ +/* $OpenBSD: tls_util.c,v 1.13 2019/04/04 15:10:10 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing + * Copyright (c) 2014 Ted Unangst * Copyright (c) 2015 Reyk Floeter * * Permission to use, copy, modify, and distribute this software for any @@ -16,6 +17,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef _MSC_VER +#define NO_REDEF_POSIX_FUNCTIONS +#endif + #include #include @@ -25,6 +30,42 @@ #include "tls.h" #include "tls_internal.h" +static void * +memdup(const void *in, size_t len) +{ + void *out; + + if ((out = malloc(len)) == NULL) + return NULL; + memcpy(out, in, len); + return out; +} + +int +tls_set_mem(char **dest, size_t *destlen, const void *src, size_t srclen) +{ + free(*dest); + *dest = NULL; + *destlen = 0; + if (src != NULL) { + if ((*dest = memdup(src, srclen)) == NULL) + return -1; + *destlen = srclen; + } + return 0; +} + +int +tls_set_string(const char **dest, const char *src) +{ + free((char *)*dest); + *dest = NULL; + if (src != NULL) + if ((*dest = strdup(src)) == NULL) + return -1; + return 0; +} + /* * Extract the host and port from a colon separated value. For a literal IPv6 * address the address must be contained with square braces. If a host and @@ -43,7 +84,7 @@ tls_host_port(const char *hostport, char **host, char **port) *port = NULL; if ((s = strdup(hostport)) == NULL) - goto fail; + goto err; h = p = s; @@ -66,14 +107,14 @@ tls_host_port(const char *hostport, char **host, char **port) *p++ = '\0'; if (asprintf(host, "%s", h) == -1) - goto fail; + goto err; if (asprintf(port, "%s", p) == -1) - goto fail; + goto err; rv = 0; goto done; - fail: + err: free(*host); *host = NULL; free(*port); @@ -126,38 +167,38 @@ tls_load_file(const char *name, size_t *len, char *password) /* Just load the file into memory without decryption */ if (password == NULL) { if (fstat(fd, &st) != 0) - goto fail; + goto err; if (st.st_size < 0) - goto fail; + goto err; size = (size_t)st.st_size; if ((buf = malloc(size)) == NULL) - goto fail; + goto err; n = read(fd, buf, size); if (n < 0 || (size_t)n != size) - goto fail; + goto err; close(fd); goto done; } /* Or read the (possibly) encrypted key from file */ if ((fp = fdopen(fd, "r")) == NULL) - goto fail; + goto err; fd = -1; key = PEM_read_PrivateKey(fp, NULL, tls_password_cb, password); fclose(fp); if (key == NULL) - goto fail; + goto err; /* Write unencrypted key to memory buffer */ if ((bio = BIO_new(BIO_s_mem())) == NULL) - goto fail; + goto err; if (!PEM_write_bio_PrivateKey(bio, key, NULL, NULL, 0, NULL, NULL)) - goto fail; + goto err; if ((size = BIO_get_mem_data(bio, &data)) <= 0) - goto fail; + goto err; if ((buf = malloc(size)) == NULL) - goto fail; + goto err; memcpy(buf, data, size); BIO_free_all(bio); @@ -167,7 +208,7 @@ tls_load_file(const char *name, size_t *len, char *password) *len = size; return (buf); - fail: + err: if (fd != -1) close(fd); freezero(buf, size); diff --git a/tls/tls_verify.c b/tls/tls_verify.c index 3bd1057d..acbe163f 100644 --- a/tls/tls_verify.c +++ b/tls/tls_verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_verify.c,v 1.19 2017/04/10 17:11:13 jsing Exp $ */ +/* $OpenBSD: tls_verify.c,v 1.20 2018/02/05 00:52:24 jsing Exp $ */ /* * Copyright (c) 2014 Jeremie Courreges-Anglas * @@ -215,16 +215,16 @@ tls_check_common_name(struct tls *ctx, X509 *cert, const char *name, subject_name = X509_get_subject_name(cert); if (subject_name == NULL) - goto out; + goto done; common_name_len = X509_NAME_get_text_by_NID(subject_name, NID_commonName, NULL, 0); if (common_name_len < 0) - goto out; + goto done; common_name = calloc(common_name_len + 1, 1); if (common_name == NULL) - goto out; + goto done; X509_NAME_get_text_by_NID(subject_name, NID_commonName, common_name, common_name_len + 1); @@ -236,7 +236,7 @@ tls_check_common_name(struct tls *ctx, X509 *cert, const char *name, "NUL byte in Common Name field, " "probably a malicious certificate", name); rv = -1; - goto out; + goto done; } /* @@ -247,13 +247,13 @@ tls_check_common_name(struct tls *ctx, X509 *cert, const char *name, inet_pton(AF_INET6, name, &addrbuf) == 1) { if (strcmp(common_name, name) == 0) *cn_match = 1; - goto out; + goto done; } if (tls_match_name(common_name, name) == 0) *cn_match = 1; - out: + done: free(common_name); return rv; }