Check-in [6f21205c77]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:update libressl to version 2.8.2
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6f21205c77ed93793dda380cbd1bc5aeb02f7c01
User & Date: chw 2018-10-19 04:54:12.422
Context
2018-10-19
06:31
update tdbc and tdbc::(mysql,postgres,sqlite3) to version 1.1.0 check-in: b130a09522 user: chw tags: trunk
05:53
merge with trunk check-in: e098b28ff2 user: chw tags: wtf-8-experiment
04:54
update libressl to version 2.8.2 check-in: 6f21205c77 user: chw tags: trunk
2018-10-17
09:34
add missing files to tklib check-in: 643bd5a305 user: chw tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to jni/libressl/CMakeLists.txt.
51
52
53
54
55
56
57

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

104
105
106
107
108
109
110
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux")
	add_definitions(-D_DEFAULT_SOURCE)
	add_definitions(-D_BSD_SOURCE)
	add_definitions(-D_POSIX_SOURCE)
	add_definitions(-D_GNU_SOURCE)

endif()

if(CMAKE_SYSTEM_NAME MATCHES "MINGW")
	set(BUILD_NC false)
endif()

if(WIN32)
	set(BUILD_NC false)
endif()

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} -mlp64")
	else()
		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 +DD64 +Otype_safety=off")
	endif()
	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT")

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} -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")

endif()

add_definitions(-DLIBRESSL_INTERNAL)
add_definitions(-DOPENSSL_NO_HW_PADLOCK)
add_definitions(-D__BEGIN_HIDDEN_DECLS=)
add_definitions(-D__END_HIDDEN_DECLS=)

set(CMAKE_POSITION_INDEPENDENT_CODE true)

if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
	add_definitions(-Wno-pointer-sign)
endif()

if(WIN32)
	add_definitions(-Drestrict)
	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)
	add_definitions(-DCPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG -DNO_CRYPT)

endif()

if(MSVC)
	add_definitions(-Dinline=__inline)
	message(STATUS "Using [${CMAKE_C_COMPILER_ID}] compiler")
	if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
		set(MSVC_DISABLED_WARNINGS_LIST







>


















>








>


















|

>







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux")
	add_definitions(-D_DEFAULT_SOURCE)
	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")
	set(BUILD_NC false)
endif()

if(WIN32)
	set(BUILD_NC false)
endif()

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} -mlp64")
	else()
		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 +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} -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")
	set(PLATFORM_LIBS ${PLATFORM_LIBS} nsl socket)
endif()

add_definitions(-DLIBRESSL_INTERNAL)
add_definitions(-DOPENSSL_NO_HW_PADLOCK)
add_definitions(-D__BEGIN_HIDDEN_DECLS=)
add_definitions(-D__END_HIDDEN_DECLS=)

set(CMAKE_POSITION_INDEPENDENT_CODE true)

if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
	add_definitions(-Wno-pointer-sign)
endif()

if(WIN32)
	add_definitions(-Drestrict)
	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=0x0600)
	add_definitions(-DCPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG -DNO_CRYPT)
	set(PLATFORM_LIBS ${PLATFORM_LIBS} ws2_32)
endif()

if(MSVC)
	add_definitions(-Dinline=__inline)
	message(STATUS "Using [${CMAKE_C_COMPILER_ID}] compiler")
	if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
		set(MSVC_DISABLED_WARNINGS_LIST
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302


303
304
305
306
307
308
309
			set(HOST_ASM_ELF_X86_64 true)
		endif()
	elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
		set(HOST_ASM_MACOSX_X86_64 true)
	endif()
endif()

set(OPENSSL_LIBS tls ssl crypto)

# Add additional required libs
if(WIN32)
	set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
	set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread)
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)
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)
	endif()
else()
	# Otherwise, simply check if it exists
	check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
endif()
if(HAVE_CLOCK_GETTIME)
	add_definitions(-DHAVE_CLOCK_GETTIME)
endif()

check_type_size(time_t SIZEOF_TIME_T)
if(SIZEOF_TIME_T STREQUAL "4")
	set(SMALL_TIME_T true)
	add_definitions(-DSMALL_TIME_T)
	message(WARNING " ** Warning, this system is unable to represent times past 2038\n"
	                " ** It will behave incorrectly when handling valid RFC5280 dates")
endif()
add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T})



add_subdirectory(crypto)
add_subdirectory(ssl)
if(LIBRESSL_APPS)
	add_subdirectory(apps)
endif()
add_subdirectory(tls)







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




|

















>
>







262
263
264
265
266
267
268
















269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
			set(HOST_ASM_ELF_X86_64 true)
		endif()
	elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
		set(HOST_ASM_MACOSX_X86_64 true)
	endif()
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(PLATFORM_LIBS ${PLATFORM_LIBS} rt)
	endif()
else()
	# Otherwise, simply check if it exists
	check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
endif()
if(HAVE_CLOCK_GETTIME)
	add_definitions(-DHAVE_CLOCK_GETTIME)
endif()

check_type_size(time_t SIZEOF_TIME_T)
if(SIZEOF_TIME_T STREQUAL "4")
	set(SMALL_TIME_T true)
	add_definitions(-DSMALL_TIME_T)
	message(WARNING " ** Warning, this system is unable to represent times past 2038\n"
	                " ** It will behave incorrectly when handling valid RFC5280 dates")
endif()
add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T})

set(OPENSSL_LIBS tls ssl crypto ${PLATFORM_LIBS})

add_subdirectory(crypto)
add_subdirectory(ssl)
if(LIBRESSL_APPS)
	add_subdirectory(apps)
endif()
add_subdirectory(tls)
318
319
320
321
322
323
324

325
326
327
328
329
330
331

if(NOT MSVC)
	# Create pkgconfig files.
	set(prefix      ${CMAKE_INSTALL_PREFIX})
	set(exec_prefix \${prefix})
	set(libdir      \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
	set(includedir  \${prefix}/include)

	file(STRINGS    "VERSION" VERSION LIMIT_COUNT 1)
	file(GLOB       OPENSSL_PKGCONFIGS "*.pc.in")
	foreach(file ${OPENSSL_PKGCONFIGS})
		get_filename_component(filename ${file} NAME)
		string(REPLACE ".in" "" new_file "${filename}")
		configure_file(${filename} pkgconfig/${new_file} @ONLY)
	endforeach()







>







308
309
310
311
312
313
314
315
316
317
318
319
320
321
322

if(NOT MSVC)
	# Create pkgconfig files.
	set(prefix      ${CMAKE_INSTALL_PREFIX})
	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})
		get_filename_component(filename ${file} NAME)
		string(REPLACE ".in" "" new_file "${filename}")
		configure_file(${filename} pkgconfig/${new_file} @ONLY)
	endforeach()
Changes to jni/libressl/ChangeLog.
24
25
26
27
28
29
30






























































































































31
32
33
34
35
36
37
The portable bits of the project are largely maintained out-of-tree, and their
history is also available from Git.

	https://github.com/libressl-portable/portable

LibreSSL Portable Release Notes:































































































































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
	  arithmetic, which introduces branches that leak information
	  regarding secret values. Issue identified and reported by Keegan
	  Ryan of NCC Group.







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
The portable bits of the project are largely maintained out-of-tree, and their
history is also available from Git.

	https://github.com/libressl-portable/portable

LibreSSL Portable Release Notes:

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
	  arithmetic, which introduces branches that leak information
	  regarding secret values. Issue identified and reported by Keegan
	  Ryan of NCC Group.
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942

	* Added Application-Layer Protocol Negotiation (ALPN) support.

	* Removed GOST R 34.10-94 signature authentication.

	* Removed nonfunctional Netscape browser-hang workaround code.

	* Simplfied and refactored SSL/DTLS handshake code.

	* Added SHA256 Camellia cipher suites for TLS 1.2 from RFC 5932.

	* Hide timing info about padding errors during handshakes.

	* Improved libtls support for non-blocking sockets, added randomized
	  session ID contexts. Work is ongoing with this library - feedback







|







1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068

	* Added Application-Layer Protocol Negotiation (ALPN) support.

	* Removed GOST R 34.10-94 signature authentication.

	* Removed nonfunctional Netscape browser-hang workaround code.

	* Simplified and refactored SSL/DTLS handshake code.

	* Added SHA256 Camellia cipher suites for TLS 1.2 from RFC 5932.

	* Hide timing info about padding errors during handshakes.

	* Improved libtls support for non-blocking sockets, added randomized
	  session ID contexts. Work is ongoing with this library - feedback
Changes to jni/libressl/VERSION.
1
2
2.7.4

|

1
2
2.8.2

Changes to jni/libressl/apps/nc/CMakeLists.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
if(BUILD_NC)

include_directories(
	.
	./compat
	../../include
	../../include/compat
)

set(
	NC_SRC
	atomicio.c
	netcat.c
	socks.c
	compat/socket.c
)


<
<
<
<
<
<
<







1
2







3
4
5
6
7
8
9
if(BUILD_NC)








set(
	NC_SRC
	atomicio.c
	netcat.c
	socks.c
	compat/socket.c
)
46
47
48
49
50
51
52

53
54
55
56
57
58
59
60
61
62
if(NOT "${OPENSSLDIR}" STREQUAL "")
	add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
else()
	add_definitions(-DDEFAULT_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\")
endif()

add_executable(nc ${NC_SRC})

target_link_libraries(nc tls ${OPENSSL_LIBS})

if(ENABLE_NC)
	if(ENABLE_LIBRESSL_INSTALL)
		install(TARGETS nc DESTINATION ${CMAKE_INSTALL_BINDIR})
		install(FILES nc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
	endif(ENABLE_LIBRESSL_INSTALL)
endif()

endif()







>










39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
if(NOT "${OPENSSLDIR}" STREQUAL "")
	add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
else()
	add_definitions(-DDEFAULT_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\")
endif()

add_executable(nc ${NC_SRC})
target_include_directories(nc PRIVATE . ./compat ../../include/compat)
target_link_libraries(nc tls ${OPENSSL_LIBS})

if(ENABLE_NC)
	if(ENABLE_LIBRESSL_INSTALL)
		install(TARGETS nc DESTINATION ${CMAKE_INSTALL_BINDIR})
		install(FILES nc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
	endif(ENABLE_LIBRESSL_INSTALL)
endif()

endif()
Changes to jni/libressl/apps/nc/nc.1.
1
2
3
4
5
6
7
8
.\"     $OpenBSD: nc.1,v 1.88 2017/11/28 16:59:10 jsing Exp $
.\"
.\" Copyright (c) 1996 David Sacerdote
.\" 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
2
3
4
5
6
7
8
.\"     $OpenBSD: nc.1,v 1.91 2018/09/25 20:05:07 jmc Exp $
.\"
.\" Copyright (c) 1996 David Sacerdote
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.\" 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 28 2017 $
.Dt NC 1
.Os
.Sh NAME
.Nm nc
.Nd arbitrary TCP and UDP connections and listens
.Sh SYNOPSIS
.Nm nc







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.\" 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 25 2018 $
.Dt NC 1
.Os
.Sh NAME
.Nm nc
.Nd arbitrary TCP and UDP connections and listens
.Sh SYNOPSIS
.Nm nc
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107

108
109


110
111

112
113
114
115
116
117
118



119


120
121
122
123
124
125
126
127
128
129
130
131
132
133
134




135
136
137
138




139

140
141
142
143
144
145
146


147
148
149
150

151
152


153
154
155
156
157
158

159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195

196
197
198



199
200
201
202
203
204
205
206
207
208
209
210
211

212
213
214
215


216
217
218
219
220
221
222
223


224
225
226
227
228
229
230

231
232

233
234
235
236
237
238
239
240
241
242
243
244
245


246
247
248
249
250
251
252
253
254

255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280


281
282




283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345


346
347

348
349


350
351
352
353
354

355
356
357
358
359
360
361
362
363
.It
and much, much more
.El
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl 4
Forces
.Nm
to use IPv4 addresses only.
.It Fl 6
Forces
.Nm
to 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.


.It Fl c
If using a TCP socket to connect or listen, use TLS.

Illegal if not using TCP sockets.
.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.


.It Fl F
Pass the first connected socket using
.Xr sendmsg 2
to stdout and exit.
This is useful in conjunction with
.Fl X
to have
.Nm
perform connection setup with a proxy but then leave the rest of the
connection to another program (e.g.\&
.Xr ssh 1
using the
.Xr ssh_config 5
.Cm ProxyUseFdpass
option).




.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.

.It Fl h
Prints out
.Nm
help.
.It Fl I Ar length
Specifies the size of the TCP receive buffer.
.It Fl i Ar interval


Specifies a delay time interval 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.


.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 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
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.
Additionally, any timeouts specified with the
.Fl w
option are ignored.
.It Fl M Ar ttl
Set the TTL / hop limit of outgoing packets.
.It Fl m Ar minttl
Ask the kernel to drop incoming packets whose TTL / hop limit is under
.Ar minttl .
.It Fl N
.Xr shutdown 2
the network socket after EOF on the input.
Some servers require this to finish their work.
.It Fl n
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.
.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
DER format.
May only be used with TLS and when a certificate is being used.



.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
.Nm
should use, subject to privilege restrictions and availability.
It is an error to use this option in conjunction with the
.Fl l
option.
.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
.Pa /etc/ssl/cert.pem .


.It Fl r
Specifies that source and/or destination ports should be chosen 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.
.It Fl s Ar source
Specifies the IP of the interface which is used to send the packets.


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
.Fl l
option.

.It Fl T Ar keyword
Change IPv4 TOS value or TLS options.

For TLS options
.Ar keyword
may be one of:
.Ar noverify ,
which disables certificate verification;
.Ar noname ,
which disables certificate name checking;
.Ar clientcert ,
which requires a client certificate on incoming connections; or
.Ar muststaple ,
which requires the peer to provide a valid stapled OCSP response
with the handshake.
The following TLS options specify a value in the form of a key=value pair:


.Ar ciphers ,
which allows the supported TLS ciphers to be specified (see
.Xr tls_config_set_ciphers 3
for further details);
.Ar protocols ,
which allows the supported TLS protocols to be specified (see
.Xr tls_config_parse_protocols 3
for further details).
It is illegal to specify TLS options if not using TLS.

.Pp
For IPv4 TOS value
.Ar keyword
may be one of
.Ar critical ,
.Ar inetcontrol ,
.Ar lowdelay ,
.Ar netcontrol ,
.Ar throughput ,
.Ar reliability ,
or one of the DiffServ Code Points:
.Ar ef ,
.Ar af11 ... af43 ,
.Ar cs0 ... 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.
This makes it possible to use
.Nm
to script telnet sessions.
.It Fl U
Specifies to use
.Ux Ns -domain
sockets.


.It Fl u
Use UDP instead of the default option of TCP.




For
.Ux Ns -domain
sockets, use a datagram socket instead of a stream socket.
If a
.Ux Ns -domain
socket is used, a temporary receiving socket is created in
.Pa /tmp
unless the
.Fl s
flag is given.
.It Fl V Ar rtable
Set the routing table to be used.
.It Fl v
Have
.Nm
give more verbose output.
.It Fl W Ar recvlimit
Terminate after receiving
.Ar recvlimit
packets from the network.
.It Fl w Ar timeout
Connections which cannot be established or are idle timeout after
.Ar timeout
seconds.
The
.Fl w
flag has no effect on the
.Fl l
option, i.e.\&
.Nm
will listen forever for a connection, with or without the
.Fl w
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.
Supported protocols are
.Dq 4
(SOCKS v.4),
.Dq 5
(SOCKS v.5)
and
.Dq 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
.Ar destination
using a proxy at
.Ar proxy_address
and
.Ar port .
If
.Ar port
is not specified, the well-known port for the proxy protocol is used (1080
for SOCKS, 3128 for HTTPS).
An IPv6 address can be specified unambiguously by enclosing
.Ar proxy_address
in square brackets.


.It Fl Z Ar peercertfile
Specifies the filename in which the peer supplied certificates will be saved

in PEM format.
May only be used with TLS.


.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.
.El
.Pp
.Ar destination
can be a numerical IP address or a symbolic hostname
(unless the
.Fl n
option is given).







<
<
|

<
<
|

|
>
|
<
>
>

|
>
|





|
>
>
>
|
>
>















>
>
>
>

|
<
|
>
>
>
>
|
>

|

|

|

>
>
|


|
>
|
<
>
>

<
<
<
|
<
>
|
<





<
<
|

|
|
<
<
<
<
















|

<
|
>
|

|
>
>
>





|


|
|
<

|
>
|
<
<

>
>

|



|

|
>
>




|

|
>

|
>
|


|

|

|

|


|
>
>
|



|



|
>

|


|
|
|
|
|
|

|
|
|


<
<
|




|


>
>

|
>
>
>
>













<
<
|



















|
|
|

|

|


|



<
<
|












>
>

|
>

<
>
>

<
<
|
<
>
|
<







92
93
94
95
96
97
98


99
100


101
102
103
104
105

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144

145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166

167
168
169



170

171
172

173
174
175
176
177


178
179
180
181




182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199

200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217

218
219
220
221


222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286


287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315


316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348


349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367

368
369
370


371

372
373

374
375
376
377
378
379
380
.It
and much, much more
.El
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl 4


Use IPv4 addresses only.
.It Fl 6


Use IPv6 addresses only.
.It Fl C Ar certfile
Load the public key part of the TLS peer certificate from
.Ar certfile ,
in PEM format.

Requires
.Fl c .
.It Fl c
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
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
to stdout and exit.
This is useful in conjunction with
.Fl X
to have
.Nm
perform connection setup with a proxy but then leave the rest of the
connection to another program (e.g.\&
.Xr ssh 1
using the
.Xr ssh_config 5
.Cm ProxyUseFdpass
option).
Cannot be used with
.Fl c
or
.Fl U .
.It Fl H Ar hash
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
Print out the
.Nm
help text and exit.
.It Fl I Ar length
Specify the size of the TCP receive buffer.
.It Fl i Ar interval
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
Load the TLS private key from
.Ar keyfile ,
in PEM format.

Requires
.Fl c .
.It Fl k



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


Listen for an incoming connection rather than initiating a
connection to a remote host.
Cannot be used together with any of the options
.Fl psxz .




Additionally, any timeouts specified with the
.Fl w
option are ignored.
.It Fl M Ar ttl
Set the TTL / hop limit of outgoing packets.
.It Fl m Ar minttl
Ask the kernel to drop incoming packets whose TTL / hop limit is under
.Ar minttl .
.It Fl N
.Xr shutdown 2
the network socket after EOF on the input.
Some servers require this to finish their work.
.It Fl n
Do not do any DNS or service lookups on any specified addresses,
hostnames or ports.
.It Fl O Ar length
Specify the size of the TCP send buffer.
.It Fl o Ar staplefile

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.
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
Specify the source port
.Nm
should use, subject to privilege restrictions and availability.
Cannot be used together with
.Fl l .

.It Fl R Ar CAfile
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
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
Enable the RFC 2385 TCP MD5 signature option.
.It Fl s Ar source
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.
Cannot be used together with
.Fl l
or
.Fl x .
.It Fl T Ar keyword
Change the IPv4 TOS/IPv6 traffic class value or the TLS options.
.Pp
For TLS options,
.Ar keyword
may be one of:
.Cm noverify ,
which disables certificate verification;
.Cm noname ,
which disables certificate name checking;
.Cm clientcert ,
which requires a client certificate on incoming connections; or
.Cm muststaple ,
which requires the peer to provide a valid stapled OCSP response
with the handshake.
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
.Cm critical ,
.Cm inetcontrol ,
.Cm lowdelay ,
.Cm netcontrol ,
.Cm throughput ,
.Cm reliability ,
or one of the DiffServ Code Points:
.Cm ef ,
.Cm af11 No ... Cm af43 ,
.Cm cs0 No ... Cm cs7 ;
or a number in either hex or decimal.
.It Fl t


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
Use
.Ux Ns -domain
sockets.
Cannot be used together with any of the options
.Fl cFx .
.It Fl u
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.
If a
.Ux Ns -domain
socket is used, a temporary receiving socket is created in
.Pa /tmp
unless the
.Fl s
flag is given.
.It Fl V Ar rtable
Set the routing table to be used.
.It Fl v


Produce more verbose output.
.It Fl W Ar recvlimit
Terminate after receiving
.Ar recvlimit
packets from the network.
.It Fl w Ar timeout
Connections which cannot be established or are idle timeout after
.Ar timeout
seconds.
The
.Fl w
flag has no effect on the
.Fl l
option, i.e.\&
.Nm
will listen forever for a connection, with or without the
.Fl w
flag.
The default is no timeout.
.It Fl X Ar proxy_protocol
Use
.Ar proxy_protocol
when talking to the proxy server.
Supported protocols are
.Cm 4
(SOCKS v.4),
.Cm 5
(SOCKS v.5)
and
.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


Connect to
.Ar destination
using a proxy at
.Ar proxy_address
and
.Ar port .
If
.Ar port
is not specified, the well-known port for the proxy protocol is used (1080
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
Save the peer certificates to
.Ar peercertfile ,
in PEM format.

Requires
.Fl c .
.It Fl z


Only scan for listening daemons, without sending any data to them.

Cannot be used together with
.Fl l .

.El
.Pp
.Ar destination
can be a numerical IP address or a symbolic hostname
(unless the
.Fl n
option is given).
371
372
373
374
375
376
377
378

379
380
381
382
383
384
385
sockets, a destination is required and is the socket path to connect to
(or listen on if the
.Fl l
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.

In general,
a destination port must be specified,
unless the
.Fl U
option is given.
.Sh CLIENT/SERVER MODEL
It is quite simple to build a very basic client/server model using







|
>







388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
sockets, a destination is required and is the socket path to connect to
(or listen on if the
.Fl l
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
.Ar nn Ns - Ns Ar mm .
In general,
a destination port must be specified,
unless the
.Fl U
option is given.
.Sh CLIENT/SERVER MODEL
It is quite simple to build a very basic client/server model using
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
if the proxy requires it:
.Pp
.Dl $ nc -x10.2.3.4:8080 -Xconnect -Pruser host.example.com 42
.Sh SEE ALSO
.Xr cat 1 ,
.Xr ssh 1
.Sh AUTHORS
Original implementation by *Hobbit*
.Aq Mt hobbit@avian.org .
.br
Rewritten with IPv6 support by
.An Eric Jackson Aq Mt ericj@monkey.org .
.Sh CAVEATS
UDP port scans using the
.Fl uz
combination of flags will always report success irrespective of







|
|







562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
if the proxy requires it:
.Pp
.Dl $ nc -x10.2.3.4:8080 -Xconnect -Pruser host.example.com 42
.Sh SEE ALSO
.Xr cat 1 ,
.Xr ssh 1
.Sh AUTHORS
Original implementation by
.An *Hobbit* Aq Mt hobbit@avian.org .
.br
Rewritten with IPv6 support by
.An Eric Jackson Aq Mt ericj@monkey.org .
.Sh CAVEATS
UDP port scans using the
.Fl uz
combination of flags will always report success irrespective of
Changes to jni/libressl/apps/nc/netcat.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: netcat.c,v 1.190 2018/03/19 16:35:29 jsing Exp $ */
/*
 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
 * Copyright (c) 2015 Bob Beck.  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
2
3
4
5
6
7
8
/* $OpenBSD: netcat.c,v 1.195 2018/10/04 17:04:50 bluhm Exp $ */
/*
 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
 * Copyright (c) 2015 Bob Beck.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
int ttl = -1;
int minttl = -1;

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);
void	readwrite(int, struct tls *);
void	fdpass(int nfd) __attribute__((noreturn));
int	remote_connect(const char *, const char *, struct addrinfo);
int	timeout_tls(int, struct tls *, int (*)(struct tls *));
int	timeout_connect(int, const struct sockaddr *, socklen_t);
int	socks_connect(const char *, const char *, struct addrinfo,
	    const char *, const char *, struct addrinfo, int, const char *);







|







124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
int ttl = -1;
int minttl = -1;

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(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);
int	timeout_tls(int, struct tls *, int (*)(struct tls *));
int	timeout_connect(int, const struct sockaddr *, socklen_t);
int	socks_connect(const char *, const char *, struct addrinfo,
	    const char *, const char *, struct addrinfo, int, const char *);
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399












































400
401
402
403
404
405
406

#ifdef SO_RTABLE
	if (rtableid >= 0)
		if (setrtable(rtableid) == -1)
			err(1, "setrtable");
#endif

	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) { 
		if (pledge("stdio inet dns sendfd", NULL) == -1)
			err(1, "pledge");
	} else if (Pflag && usetls) {
		if (pledge("stdio rpath inet dns tty", NULL) == -1)
			err(1, "pledge");
	} else if (Pflag) {
		if (pledge("stdio inet dns tty", NULL) == -1)
			err(1, "pledge");
	} else if (usetls) {
		if (pledge("stdio rpath inet dns", NULL) == -1)
			err(1, "pledge");
	} 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)
		errx(1, "cannot use -p and -l");
	if (lflag && zflag)
		errx(1, "cannot use -z and -l");
	if (!lflag && kflag)







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







357
358
359
360
361
362
363





















364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429

#ifdef SO_RTABLE
	if (rtableid >= 0)
		if (setrtable(rtableid) == -1)
			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) {
		if (pledge("stdio inet dns sendfd", NULL) == -1)
			err(1, "pledge");
	} else if (Pflag && usetls) {
		if (pledge("stdio rpath inet dns tty", NULL) == -1)
			err(1, "pledge");
	} else if (Pflag) {
		if (pledge("stdio inet dns tty", NULL) == -1)
			err(1, "pledge");
	} else if (usetls) {
		if (pledge("stdio rpath inet dns", NULL) == -1)
			err(1, "pledge");
	} else if (pledge("stdio inet dns", NULL) == -1)
		err(1, "pledge");

	if (lflag && sflag)
		errx(1, "cannot use -s and -l");
	if (lflag && pflag)
		errx(1, "cannot use -p and -l");
	if (lflag && zflag)
		errx(1, "cannot use -z and -l");
	if (!lflag && kflag)
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556


557

558
559
560
561
562
563
564
		if (Pflag) {
			if (pledge("stdio inet dns tty", NULL) == -1)
				err(1, "pledge");
		} else if (pledge("stdio inet dns", NULL) == -1)
			err(1, "pledge");
	}
	if (lflag) {
		struct tls *tls_cctx = NULL;
		int connfd;
		ret = 0;

		if (family == AF_UNIX) {
			if (uflag)
				s = unix_bind(host, 0);
			else
				s = unix_listen(host);
		}

		if (usetls) {
			tls_config_verify_client_optional(tls_cfg);
			if ((tls_ctx = tls_server()) == NULL)
				errx(1, "tls server creation failed");
			if (tls_configure(tls_ctx, tls_cfg) == -1)
				errx(1, "tls configuration failed (%s)",
				    tls_error(tls_ctx));
		}
		/* Allow only one connection at a time, but stay alive. */
		for (;;) {
			if (family != AF_UNIX)


				s = local_listen(host, uport, hints);

			if (s < 0)
				err(1, NULL);
			if (uflag && kflag) {
				/*
				 * For UDP and -k, don't connect the socket,
				 * let it receive datagrams from multiple
				 * socket pairs.







<
<



















|
>
>

>







551
552
553
554
555
556
557


558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
		if (Pflag) {
			if (pledge("stdio inet dns tty", NULL) == -1)
				err(1, "pledge");
		} else if (pledge("stdio inet dns", NULL) == -1)
			err(1, "pledge");
	}
	if (lflag) {


		ret = 0;

		if (family == AF_UNIX) {
			if (uflag)
				s = unix_bind(host, 0);
			else
				s = unix_listen(host);
		}

		if (usetls) {
			tls_config_verify_client_optional(tls_cfg);
			if ((tls_ctx = tls_server()) == NULL)
				errx(1, "tls server creation failed");
			if (tls_configure(tls_ctx, tls_cfg) == -1)
				errx(1, "tls configuration failed (%s)",
				    tls_error(tls_ctx));
		}
		/* Allow only one connection at a time, but stay alive. */
		for (;;) {
			if (family != AF_UNIX) {
				if (s != -1)
					close(s);
				s = local_listen(host, uport, hints);
			}
			if (s < 0)
				err(1, NULL);
			if (uflag && kflag) {
				/*
				 * For UDP and -k, don't connect the socket,
				 * let it receive datagrams from multiple
				 * socket pairs.
585
586
587
588
589
590
591



592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608

609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
					err(1, "connect");

				if (vflag)
					report_connect((struct sockaddr *)&z, len, NULL);

				readwrite(s, NULL);
			} else {



				len = sizeof(cliaddr);
				connfd = accept4(s, (struct sockaddr *)&cliaddr,
				    &len, SOCK_NONBLOCK);
				if (connfd == -1) {
					/* For now, all errnos are fatal */
					err(1, "accept");
				}
				if (vflag)
					report_connect((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) {
					timeout_tls(s, tls_cctx, tls_close);

					tls_free(tls_cctx);
					tls_cctx = NULL;
				}
				close(connfd);
			}
			if (family != AF_UNIX)
				close(s);
			else if (uflag) {
				if (connect(s, NULL, 0) < 0)
					err(1, "connect");
			}

			if (!kflag)
				break;
		}







>
>
>















|

>
|
<
|
<
<
|
<
<







609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637

638


639


640
641
642
643
644
645
646
					err(1, "connect");

				if (vflag)
					report_connect((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);
				if (connfd == -1) {
					/* For now, all errnos are fatal */
					err(1, "accept");
				}
				if (vflag)
					report_connect((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)
					timeout_tls(s, tls_cctx, tls_close);
				close(connfd);
				tls_free(tls_cctx);

			}


			if (family == AF_UNIX && uflag) {


				if (connect(s, NULL, 0) < 0)
					err(1, "connect");
			}

			if (!kflag)
				break;
		}
641
642
643
644
645
646
647


648
649
650
651
652
653
654
		/* Construct the portlist[] array. */
		build_ports(uport);

		/* Cycle through portlist, connecting to each port. */
		for (s = -1, i = 0; portlist[i] != NULL; i++) {
			if (s != -1)
				close(s);



			if (usetls) {
				if ((tls_ctx = tls_client()) == NULL)
					errx(1, "tls client creation failed");
				if (tls_configure(tls_ctx, tls_cfg) == -1)
					errx(1, "tls configuration failed (%s)",
					    tls_error(tls_ctx));







>
>







664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
		/* Construct the portlist[] array. */
		build_ports(uport);

		/* Cycle through portlist, connecting to each port. */
		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)
					errx(1, "tls client creation failed");
				if (tls_configure(tls_ctx, tls_cfg) == -1)
					errx(1, "tls configuration failed (%s)",
					    tls_error(tls_ctx));
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
			if (Fflag)
				fdpass(s);
			else {
				if (usetls)
					tls_setup_client(tls_ctx, s, host);
				if (!zflag)
					readwrite(s, 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_config_free(tls_cfg);

	return ret;
}

/*
 * unix_bind()







|

<
<
<






|







716
717
718
719
720
721
722
723
724



725
726
727
728
729
730
731
732
733
734
735
736
737
738
			if (Fflag)
				fdpass(s);
			else {
				if (usetls)
					tls_setup_client(tls_ctx, s, host);
				if (!zflag)
					readwrite(s, tls_ctx);
				if (tls_ctx)
					timeout_tls(s, tls_ctx, tls_close);



			}
		}
	}

	if (s != -1)
		close(s);
	tls_free(tls_ctx);
	tls_config_free(tls_cfg);

	return ret;
}

/*
 * unix_bind()
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997

/*
 * local_listen()
 * Returns a socket listening on a local port, binds to specified source
 * address. Returns -1 on failure.
 */
int
local_listen(char *host, char *port, struct addrinfo hints)
{
	struct addrinfo *res, *res0;
	int s = -1, save_errno;
#ifdef SO_REUSEPORT
	int ret, x = 1;
#endif
	int error;







|







1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019

/*
 * local_listen()
 * Returns a socket listening on a local port, binds to specified source
 * address. Returns -1 on failure.
 */
int
local_listen(const char *host, const char *port, struct addrinfo hints)
{
	struct addrinfo *res, *res0;
	int s = -1, save_errno;
#ifdef SO_REUSEPORT
	int ret, x = 1;
#endif
	int error;
Changes to jni/libressl/apps/nc/socks.c.
1
2
3
4
5
6
7
8
/*	$OpenBSD: socks.c,v 1.24 2016/06/27 14:43:04 deraadt Exp $	*/

/*
 * Copyright (c) 1999 Niklas Hallqvist.  All rights reserved.
 * Copyright (c) 2004, 2005 Damien Miller.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
/*	$OpenBSD: socks.c,v 1.25 2018/03/27 16:31:10 deraadt Exp $	*/

/*
 * Copyright (c) 1999 Niklas Hallqvist.  All rights reserved.
 * Copyright (c) 2004, 2005 Damien Miller.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
105
106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
			break;
		}
		off++;
	}
	return (off);
}

static const char *
getproxypass(const char *proxyuser, const char *proxyhost)

{
	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)
		errx(1, "Unable to read proxy passphrase");
	return (pw);
}

/*
 * Error strings adapted from the generally accepted SOCKSv4 spec:
 *
 * http://ftp.icm.edu.pl/packages/socks/socks4/SOCKS4.protocol
 */







|
|
>


<



|

<







105
106
107
108
109
110
111
112
113
114
115
116

117
118
119
120
121

122
123
124
125
126
127
128
			break;
		}
		off++;
	}
	return (off);
}

static void
getproxypass(const char *proxyuser, const char *proxyhost,
    char *pw, size_t pwlen)
{
	char prompt[512];


	snprintf(prompt, sizeof(prompt), "Proxy password for %s@%s: ",
	   proxyuser, proxyhost);
	if (readpassphrase(prompt, pw, pwlen, RPP_REQUIRE_TTY) == NULL)
		errx(1, "Unable to read proxy passphrase");

}

/*
 * Error strings adapted from the generally accepted SOCKSv4 spec:
 *
 * http://ftp.icm.edu.pl/packages/socks/socks4/SOCKS4.protocol
 */
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
	size_t hlen, wlen;
	unsigned char buf[1024];
	size_t cnt;
	struct sockaddr_storage addr;
	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;

	/* Abuse API to lookup port */
	if (decode_addrport("0.0.0.0", port, (struct sockaddr *)&addr,
	    sizeof(addr), 1, 1) == -1)







<







183
184
185
186
187
188
189

190
191
192
193
194
195
196
	size_t hlen, wlen;
	unsigned char buf[1024];
	size_t cnt;
	struct sockaddr_storage addr;
	struct sockaddr_in *in4 = (struct sockaddr_in *)&addr;
	struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)&addr;
	in_port_t serverport;


	if (proxyport == NULL)
		proxyport = (socksv == -1) ? HTTP_PROXY_PORT : SOCKS_PORT;

	/* Abuse API to lookup port */
	if (decode_addrport("0.0.0.0", port, (struct sockaddr *)&addr,
	    sizeof(addr), 1, 1) == -1)
341
342
343
344
345
346
347

348
349
350

351
352

353
354
355
356
357
358
359
360
361
362
363


364
365
366
367
368
369
370
		r = strlen(buf);

		cnt = atomicio(vwrite, proxyfd, buf, r);
		if (cnt != r)
			err(1, "write failed (%zu/%d)", cnt, r);

		if (authretry > 1) {

			char resp[1024];

			proxypass = getproxypass(proxyuser, proxyhost);

			r = snprintf(buf, sizeof(buf), "%s:%s",
			    proxyuser, proxypass);

			if (r == -1 || (size_t)r >= sizeof(buf) ||
			    b64_ntop(buf, strlen(buf), resp,
			    sizeof(resp)) == -1)
				errx(1, "Proxy username/password too long");
			r = snprintf(buf, sizeof(buf), "Proxy-Authorization: "
			    "Basic %s\r\n", resp);
			if (r == -1 || (size_t)r >= sizeof(buf))
				errx(1, "Proxy auth response too long");
			r = strlen(buf);
			if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r)
				err(1, "write failed (%zu/%d)", cnt, r);


		}

		/* Terminate headers */
		if ((cnt = atomicio(vwrite, proxyfd, "\r\n", 2)) != 2)
			err(1, "write failed (%zu/2)", cnt);

		/* Read status reply */







>


|
>


>











>
>







339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
		r = strlen(buf);

		cnt = atomicio(vwrite, proxyfd, buf, r);
		if (cnt != r)
			err(1, "write failed (%zu/%d)", cnt, r);

		if (authretry > 1) {
			char proxypass[256];
			char resp[1024];

			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)
				errx(1, "Proxy username/password too long");
			r = snprintf(buf, sizeof(buf), "Proxy-Authorization: "
			    "Basic %s\r\n", resp);
			if (r == -1 || (size_t)r >= sizeof(buf))
				errx(1, "Proxy auth response too long");
			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 */
		if ((cnt = atomicio(vwrite, proxyfd, "\r\n", 2)) != 2)
			err(1, "write failed (%zu/2)", cnt);

		/* Read status reply */
Changes to jni/libressl/apps/ocspcheck/CMakeLists.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
37
38
if(NOT MSVC)

include_directories(
	.
	./compat
	../../include
	../../include/compat
)

set(
	OCSPCHECK_SRC
	http.c
	ocspcheck.c
)

check_function_exists(memmem HAVE_MEMMEM)
if(HAVE_MEMMEM)
        add_definitions(-DHAVE_MEMMEM)
else()
        set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c)
endif()

if(NOT "${OPENSSLDIR}" STREQUAL "")
	add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
else()
	add_definitions(-DDEFAULT_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\")
endif()

add_executable(ocspcheck ${OCSPCHECK_SRC})

target_link_libraries(ocspcheck tls ${OPENSSL_LIBS})

if(ENABLE_LIBRESSL_INSTALL)
	install(TARGETS ocspcheck DESTINATION ${CMAKE_INSTALL_BINDIR})
	install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)

endif(ENABLE_LIBRESSL_INSTALL)

endif()


<
<
<
<
<
<
<




















>









1
2







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
if(NOT MSVC)








set(
	OCSPCHECK_SRC
	http.c
	ocspcheck.c
)

check_function_exists(memmem HAVE_MEMMEM)
if(HAVE_MEMMEM)
        add_definitions(-DHAVE_MEMMEM)
else()
        set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c)
endif()

if(NOT "${OPENSSLDIR}" STREQUAL "")
	add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
else()
	add_definitions(-DDEFAULT_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\")
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)
	install(TARGETS ocspcheck DESTINATION ${CMAKE_INSTALL_BINDIR})
	install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)

endif(ENABLE_LIBRESSL_INSTALL)

endif()
Changes to jni/libressl/apps/openssl/CMakeLists.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
include_directories(
	.
	../../include
	../../include/compat
)

set(
	OPENSSL_SRC
	apps.c
	asn1pars.c
	ca.c
	ciphers.c
	crl.c
<
<
<
<
<
<













1
2
3
4
5
6
7






set(
	OPENSSL_SRC
	apps.c
	asn1pars.c
	ca.c
	ciphers.c
	crl.c
70
71
72
73
74
75
76

77
78
79
80
81
82
83
if(HAVE_STRTONUM)
	add_definitions(-DHAVE_STRTONUM)
else()
	set(OPENSSL_SRC ${OPENSSL_SRC} compat/strtonum.c)
endif()

add_executable(openssl ${OPENSSL_SRC})

target_link_libraries(openssl ${OPENSSL_LIBS})

if(ENABLE_LIBRESSL_INSTALL)
	install(TARGETS openssl DESTINATION ${CMAKE_INSTALL_BINDIR})
	install(FILES openssl.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif(ENABLE_LIBRESSL_INSTALL)








>







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
if(HAVE_STRTONUM)
	add_definitions(-DHAVE_STRTONUM)
else()
	set(OPENSSL_SRC ${OPENSSL_SRC} compat/strtonum.c)
endif()

add_executable(openssl ${OPENSSL_SRC})
target_include_directories(openssl PRIVATE . ../../include/compat)
target_link_libraries(openssl ${OPENSSL_LIBS})

if(ENABLE_LIBRESSL_INSTALL)
	install(TARGETS openssl DESTINATION ${CMAKE_INSTALL_BINDIR})
	install(FILES openssl.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif(ENABLE_LIBRESSL_INSTALL)

Changes to jni/libressl/apps/openssl/apps.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: apps.c,v 1.47 2018/02/07 08:57:25 jsing Exp $ */
/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/* $OpenBSD: apps.c,v 1.49 2018/08/16 16:56:51 tb Exp $ */
/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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.
 *
2061
2062
2063
2064
2065
2066
2067

2068
2069
2070
2071
2072
2073
2074
2075

	BIO_printf(out, "Require explicit Policy: %s\n",
	    explicit_policy ? "True" : "False");

	nodes_print(out, "Authority", X509_policy_tree_get0_policies(tree));
	nodes_print(out, "User", X509_policy_tree_get0_user_policies(tree));


	BIO_free(out);
}

/*
 * next_protos_parse parses a comma separated list of strings into a string
 * in a format suitable for passing to SSL_CTX_set_next_protos_advertised.
 *   outlen: (output) set to the length of the resulting buffer on success.
 *   err: (maybe NULL) on failure, an error message line is written to this BIO.







>
|







2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076

	BIO_printf(out, "Require explicit Policy: %s\n",
	    explicit_policy ? "True" : "False");

	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);
}

/*
 * next_protos_parse parses a comma separated list of strings into a string
 * in a format suitable for passing to SSL_CTX_set_next_protos_advertised.
 *   outlen: (output) set to the length of the resulting buffer on success.
 *   err: (maybe NULL) on failure, an error message line is written to this BIO.
Changes to jni/libressl/apps/openssl/apps.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: apps.h,v 1.20 2017/12/05 15:02:06 jca 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: apps.h,v 1.21 2018/07/13 18:36:56 cheloha 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.
 *
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290

#define APP_PASS_LEN	1024

#define SERIAL_RAND_BITS	64

int app_isdir(const char *);

#define TM_START	0
#define TM_STOP		1
double app_timer_real(int stop);
double app_timer_user(int stop);

#define OPENSSL_NO_SSL_INTERN

struct option {
	const char *name;
	const char *argname;
	const char *desc;







|
|
|
|







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290

#define APP_PASS_LEN	1024

#define SERIAL_RAND_BITS	64

int app_isdir(const char *);

#define TM_RESET	0
#define TM_GET		1
double app_timer_real(int);
double app_timer_user(int);

#define OPENSSL_NO_SSL_INTERN

struct option {
	const char *name;
	const char *argname;
	const char *desc;
Changes to jni/libressl/apps/openssl/apps_posix.c.
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#include <sys/time.h>

#include <time.h>

#include "apps.h"

double
app_timer_real(int stop)
{
	static struct timespec start;
	struct timespec elapsed, now;

	clock_gettime(CLOCK_MONOTONIC, &now);
	if (stop) {
		timespecsub(&now, &start, &elapsed);
		return elapsed.tv_sec + elapsed.tv_nsec / 1000000000.0;
	}
	start = now;
	return 0.0;
}

double
app_timer_user(int stop)
{
	static struct timeval start;
	struct timeval elapsed;
	struct rusage now;

	getrusage(RUSAGE_SELF, &now);
	if (stop) {
		timersub(&now.ru_utime, &start, &elapsed);
		return elapsed.tv_sec + elapsed.tv_usec / 1000000.0;
	}
	start = now.ru_utime;
	return 0.0;
}








|





|








|






|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#include <sys/time.h>

#include <time.h>

#include "apps.h"

double
app_timer_real(int get)
{
	static struct timespec start;
	struct timespec elapsed, now;

	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;

	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;
}

Changes to jni/libressl/apps/openssl/apps_win.c.
1
2
3
4
5
6
7
8
9
10
11
12
13














14
15
16
17
18
19
20
/*
 * Public domain
 *
 * Dongsheng Song <dongsheng.song@gmail.com>
 * Brent Cook <bcook@openbsd.org>
 */

#include <windows.h>

#include <io.h>
#include <fcntl.h>

#include "apps.h"















double
app_timer_user(int stop)
{
	static unsigned __int64 tmstart;
	union {
		unsigned __int64 u64;













>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * Public domain
 *
 * Dongsheng Song <dongsheng.song@gmail.com>
 * Brent Cook <bcook@openbsd.org>
 */

#include <windows.h>

#include <io.h>
#include <fcntl.h>

#include "apps.h"

double
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 {
		unsigned __int64 u64;
Changes to jni/libressl/apps/openssl/cert.pem.
1
2
3
4
5
6
7
8
# $OpenBSD: cert.pem,v 1.16 2018/03/21 15:26:09 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)
|







1
2
3
4
5
6
7
8
# $OpenBSD: cert.pem,v 1.17 2018/09/12 22:17:08 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)
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy
WL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ
1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30
6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT
91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml
e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p
TpPDpFQUWw==
-----END CERTIFICATE-----

### T\DCRKTRUST Bilgi \U0130leti\U015Fim ve Bili\U015Fim G\FCvenli\U011Fi Hizmetleri A.\U015E.

=== /C=TR/L=Ankara/O=T\xC3\x9CRKTRUST Bilgi \xC4\xB0leti\xC5\x9Fim ve Bili\xC5\x9Fim G\xC3\xBCvenli\xC4\x9Fi Hizmetleri A.\xC5\x9E./CN=T\xC3\x9CRKTRUST Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xC4\xB1c\xC4\xB1s\xC4\xB1 H5
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 156233699172481 (0x8e17fe242081)
    Signature Algorithm: sha256WithRSAEncryption
        Validity
            Not Before: Apr 30 08:07:01 2013 GMT
            Not After : Apr 28 08:07:01 2023 GMT
        Subject: C=TR, L=Ankara, O=T\xC3\x9CRKTRUST Bilgi \xC4\xB0leti\xC5\x9Fim ve Bili\xC5\x9Fim G\xC3\xBCvenli\xC4\x9Fi Hizmetleri A.\xC5\x9E., CN=T\xC3\x9CRKTRUST Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xC4\xB1c\xC4\xB1s\xC4\xB1 H5
        X509v3 extensions:
            X509v3 Subject Key Identifier: 
                56:99:07:1E:D3:AC:0C:69:64:B4:0C:50:47:DE:43:2C:BE:20:C0:FB
            X509v3 Key Usage: critical
                Certificate Sign, CRL Sign
            X509v3 Basic Constraints: critical
                CA:TRUE
SHA1 Fingerprint=C4:18:F6:4D:46:D1:DF:00:3D:27:30:13:72:43:A9:12:11:C6:75:FB
SHA256 Fingerprint=49:35:1B:90:34:44:C1:85:CC:DC:5C:69:3D:24:D8:55:5C:B2:08:D6:A8:14:13:07:69:9F:4A:F0:63:19:9D:78
-----BEGIN CERTIFICATE-----
MIIEJzCCAw+gAwIBAgIHAI4X/iQggTANBgkqhkiG9w0BAQsFADCBsTELMAkGA1UE
BhMCVFIxDzANBgNVBAcMBkFua2FyYTFNMEsGA1UECgxEVMOcUktUUlVTVCBCaWxn
aSDEsGxldGnFn2ltIHZlIEJpbGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkg
QS7Fni4xQjBABgNVBAMMOVTDnFJLVFJVU1QgRWxla3Ryb25payBTZXJ0aWZpa2Eg
SGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSBINTAeFw0xMzA0MzAwODA3MDFaFw0yMzA0
MjgwODA3MDFaMIGxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMU0wSwYD
VQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8
dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBF
bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg1MIIB
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApCUZ4WWe60ghUEoI5RHwWrom
/4NZzkQqL/7hzmAD/I0Dpe3/a6i6zDQGn1k19uwsu537jVJp45wnEFPzpALFp/kR
Gml1bsMdi9GYjZOHp3GXDSHHmflS0yxjXVW86B8BSLlg/kJK9siArs1mep5Fimh3
4khon6La8eHBEJ/rPCmBp+EyCNSgBbGM+42WAA4+Jd9ThiI7/PS98wl+d+yG6w8z
5UNP9FR1bSmZLmZaQ9/LXMrI5Tjxfjs1nQ/0xVqhzPMggCTTV+wVunUlm+hkS7M0
hO8EuPbJbKoCPrZV4jI3X/xml1/N1p7HIL9Nxqw/dV8c7TKcfGkAaZHjIxhT6QID
AQABo0IwQDAdBgNVHQ4EFgQUVpkHHtOsDGlktAxQR95DLL4gwPswDgYDVR0PAQH/
BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAJ5FdnsX
SDLyOIspve6WSk6BGLFRRyDN0GSxDsnZAdkJzsiZ3GglE9Rc8qPoBP5yCccLqh0l
VX6Wmle3usURehnmp349hQ71+S4pL+f5bFgWV1Al9j4uPqrtd3GqqpmWRgqujuwq
URawXs3qZwQcWDD1YIq9pr1N5Za0/EKJAWv2cMhQOQwt1WbZyNKzMrcbGW3LM/nf
peYVhDfwwvJllpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CF
Yv4HAqGEVka+lgqaE9chTLd8B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW
+qtB4Uu2NQvAmxU=
-----END CERTIFICATE-----

### TAIWAN-CA

=== /C=TW/O=TAIWAN-CA/OU=Root CA/CN=TWCA Global Root CA
Certificate:
    Data:







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







5334
5335
5336
5337
5338
5339
5340















































5341
5342
5343
5344
5345
5346
5347
A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy
WL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ
1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30
6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT
91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml
e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p
TpPDpFQUWw==















































-----END CERTIFICATE-----

### TAIWAN-CA

=== /C=TW/O=TAIWAN-CA/OU=Root CA/CN=TWCA Global Root CA
Certificate:
    Data:
Changes to jni/libressl/apps/openssl/openssl.1.
1
2
3
4
5
6
7
8
.\" $OpenBSD: openssl.1,v 1.89 2018/03/22 19:24:18 jmc Exp $
.\" ====================================================================
.\" Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
|







1
2
3
4
5
6
7
8
.\" $OpenBSD: openssl.1,v 1.94 2018/08/24 20:12:24 tb Exp $
.\" ====================================================================
.\" Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
.\" 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.]
.\"
.\" OPENSSL
.\"
.Dd $Mdocdate: March 22 2018 $
.Dt OPENSSL 1
.Os
.Sh NAME
.Nm openssl
.Nd OpenSSL command line tool
.Sh SYNOPSIS
.Nm
.Cm command
.Op Ar command_opts
.Op Ar command_args
.Pp
.Nm
.Cm list-standard-commands |
.Cm list-message-digest-commands |
.Cm list-cipher-commands |







<
<
|







|







106
107
108
109
110
111
112


113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.\" 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.]
.\"


.Dd $Mdocdate: August 24 2018 $
.Dt OPENSSL 1
.Os
.Sh NAME
.Nm openssl
.Nd OpenSSL command line tool
.Sh SYNOPSIS
.Nm
.Ar command
.Op Ar command_opts
.Op Ar command_args
.Pp
.Nm
.Cm list-standard-commands |
.Cm list-message-digest-commands |
.Cm list-cipher-commands |
298
299
300
301
302
303
304

305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323

324
325
326
327
328
329
330
331
332

333
334
335
336
337
338

339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358




359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390


391
392
393
394
395
396
397


398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415










416
417
418
419
420
421
422
.El
.Sh CA
.nr nS 1
.Nm "openssl ca"
.Op Fl batch
.Op Fl cert Ar file
.Op Fl config Ar file

.Op Fl crl_CA_compromise Ar time
.Op Fl crl_compromise Ar time
.Op Fl crl_hold Ar instruction
.Op Fl crl_reason Ar reason
.Op Fl crldays Ar days
.Op Fl crlexts Ar section
.Op Fl crlhours Ar hours
.Op Fl days Ar arg
.Op Fl enddate Ar date
.Op Fl extensions Ar section
.Op Fl extfile Ar section
.Op Fl gencrl
.Op Fl in Ar file
.Op Fl infiles
.Op Fl key Ar keyfile
.Op Fl keyfile Ar arg
.Op Fl keyform Ar pem
.Op Fl md Ar arg
.Op Fl msie_hack

.Op Fl name Ar section
.Op Fl noemailDN
.Op Fl notext
.Op Fl out Ar file
.Op Fl outdir Ar dir
.Op Fl passin Ar arg
.Op Fl policy Ar arg
.Op Fl preserveDN
.Op Fl revoke Ar file

.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 verbose
.nr nS 0
.Pp
The
.Nm ca
command is a minimal certificate authority (CA) application.
It can be used to sign certificate requests in a variety of forms
and generate certificate revocation lists (CRLs).
It also maintains a text database of issued certificates and their status.
.Pp
The options relevant to CAs are as follows:
.Bl -tag -width "XXXX"
.It Fl batch
Batch mode.
In this mode no questions will be asked
and all certificates will be certified automatically.
.It Fl cert Ar file
The CA certificate file.
.It Fl config Ar file
Specify an alternative configuration file.




.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 [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
.Cm x509_extensions
unless the
.Fl extfile
option is used).
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.



.It Fl extfile Ar file
An additional configuration
.Ar file
to read certificate extensions from
(using the default section unless the
.Fl extensions
option is also used).
.It Fl in Ar file
An input
.Ar file
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.
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
Private key file format.


.It Fl md Ar alg
The message digest to use.
Possible values include
.Ar md5
and
.Ar sha1 .
This option also applies to CRLs.
.It Fl msie_hack
This is a legacy option to make
.Nm ca
work with very old versions of the IE certificate enrollment control
.Qq certenr3 .
It used UniversalStrings for almost everything.
Since the old control has various security bugs,
its use is strongly discouraged.
The newer control
.Qq Xenroll
does not need this option.










.It Fl name Ar section
Specifies the configuration file
.Ar section
to use (overrides
.Cm default_ca
in the
.Cm ca







>














|

|


>









>






>




















>
>
>
>

















>
>
>














|
>
>
|




|

>
>


















>
>
>
>
>
>
>
>
>
>







296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
.El
.Sh CA
.nr nS 1
.Nm "openssl ca"
.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
.Op Fl crl_reason Ar reason
.Op Fl crldays Ar days
.Op Fl crlexts Ar section
.Op Fl crlhours Ar hours
.Op Fl days Ar arg
.Op Fl enddate Ar date
.Op Fl extensions Ar section
.Op Fl extfile Ar section
.Op Fl gencrl
.Op Fl in Ar file
.Op Fl infiles
.Op Fl key Ar password
.Op Fl keyfile Ar arg
.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
.Op Fl out Ar file
.Op Fl outdir Ar dir
.Op Fl passin Ar arg
.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
The
.Nm ca
command is a minimal certificate authority (CA) application.
It can be used to sign certificate requests in a variety of forms
and generate certificate revocation lists (CRLs).
It also maintains a text database of issued certificates and their status.
.Pp
The options relevant to CAs are as follows:
.Bl -tag -width "XXXX"
.It Fl batch
Batch mode.
In this mode no questions will be asked
and all certificates will be certified automatically.
.It Fl cert Ar file
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 [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
.Cm x509_extensions
unless the
.Fl extfile
option is used).
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
to read certificate extensions from
(using the default section unless the
.Fl extensions
option is also used).
.It Fl in Ar file
An input
.Ar file
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 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 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
.Ar md5
and
.Ar sha1 .
This option also applies to CRLs.
.It Fl msie_hack
This is a legacy option to make
.Nm ca
work with very old versions of the IE certificate enrollment control
.Qq certenr3 .
It used UniversalStrings for almost everything.
Since the old control has various security bugs,
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
to use (overrides
.Cm default_ca
in the
.Cm ca
433
434
435
436
437
438
439
440



441
442
443
444
445
446
447
.Ar email_in_dn
keyword can be used in the configuration file to enable this behaviour.
.It Fl notext
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.



.It Fl outdir Ar directory
The
.Ar directory
to output certificates to.
The certificate will be written to a file consisting of the
serial number in hex with
.Qq .pem







|
>
>
>







456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
.Ar email_in_dn
keyword can be used in the configuration file to enable this behaviour.
.It Fl notext
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 in
PEM format, except that
.Fl spkac
outputs DER format.
.It Fl outdir Ar directory
The
.Ar directory
to output certificates to.
The certificate will be written to a file consisting of the
serial number in hex with
.Qq .pem
470
471
472
473
474
475
476





















477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498

499









500
501



502
503
504
505
506
507
508
Normally, the DN order of a certificate is the same as the order of the
fields in the relevant policy section.
When this option is set, the order is the same as the request.
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 spkac Ar file
A file containing a single Netscape signed public key and challenge,
and additional field values to be signed by the CA.
This will usually come from the
KEYGEN tag in an HTML form to create a new private key.
It is, however, possible to create SPKACs using the
.Nm spkac
utility.
.Pp
The file should contain the variable SPKAC set to the value of
the SPKAC and also the required DN components as name value pairs.
If it's necessary to include the same component twice,
then it can be preceded by a number and a
.Sq \&. .
.It Fl ss_cert Ar file
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 [YY]YYMMDDHHMMSSZ,
with all four year digits required for dates from 2050 onwards.
.It Fl status Ar serial
Show the status of the certificate with serial number

.Ar serial .









.It Fl updatedb
Update database for expired certificates.



.It Fl verbose
Print extra details about the operations being performed.
.El
.Pp
The options relevant to CRLs are as follows:
.Bl -tag -width "XXXX"
.It Fl crl_CA_compromise Ar time







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




















|
|
>
|
>
>
>
>
>
>
>
>
>
|
<
>
>
>







496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557

558
559
560
561
562
563
564
565
566
567
Normally, the DN order of a certificate is the same as the order of the
fields in the relevant policy section.
When this option is set, the order is the same as the request.
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.
This will usually come from the
KEYGEN tag in an HTML form to create a new private key.
It is, however, possible to create SPKACs using the
.Nm spkac
utility.
.Pp
The file should contain the variable SPKAC set to the value of
the SPKAC and also the required DN components as name value pairs.
If it's necessary to include the same component twice,
then it can be preceded by a number and a
.Sq \&. .
.It Fl ss_cert Ar file
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 [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
.Pp
The options relevant to CRLs are as follows:
.Bl -tag -width "XXXX"
.It Fl crl_CA_compromise Ar time
545
546
547
548
549
550
551



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569

570
571
572
573
574
575
576
of the configuration file containing CRL extensions to include.
If no CRL extension section is present then a V1 CRL is created;
if the CRL extension section is present
(even if it is empty)
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.



.It Fl crlhours Ar num
The number of hours before the next CRL is due.
.It Fl gencrl
Generate a CRL based on information in the index file.
.It Fl revoke Ar 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.

.El
.Pp
Many of the options can be set in the
.Cm ca
section of the configuration file
(or in the default section of the configuration file),
specified using







>
>
>








|
|
<
|
|
<
<
<
<
<
>







604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623

624
625





626
627
628
629
630
631
632
633
of the configuration file containing CRL extensions to include.
If no CRL extension section is present then a V1 CRL is created;
if the CRL extension section is present
(even if it is empty)
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
Generate a CRL based on information in the index file.
.It Fl revoke Ar file
A
.Ar file
containing a certificate to revoke.
.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
.Cm ca
section of the configuration file
(or in the default section of the configuration file),
specified using
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
For example, if a certificate request contains a
.Cm basicConstraints
extension with CA:TRUE and the
.Cm copy_extensions
value is set to
.Cm copyall
and the user does not spot
this when the certificate is displayed, then this will hand the requestor
a valid CA certificate.
.Pp
This situation can be avoided by setting
.Cm copy_extensions
to
.Cm copy
and including







|







678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
For example, if a certificate request contains a
.Cm basicConstraints
extension with CA:TRUE and the
.Cm copy_extensions
value is set to
.Cm copyall
and the user does not spot
this when the certificate is displayed, then this will hand the requester
a valid CA certificate.
.Pp
This situation can be avoided by setting
.Cm copy_extensions
to
.Cm copy
and including
776
777
778
779
780
781
782
783
784
785
786
787
788
789


790




791
792
793
794
795
796
797
798
799
800

801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
.It Cm x509_extensions
The same as
.Fl extensions .
.El
.Sh CIPHERS
.Nm openssl ciphers
.Op Fl hVv
.Op Fl tls1
.Op Ar cipherlist
.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.
.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).
.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
.Nm "openssl crl"
.Op Fl CAfile Ar file
.Op Fl CApath Ar dir
.Op Fl fingerprint







<
|



|
|
>
>
|
>
>
>
>
|





<
<


>
|
|
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







833
834
835
836
837
838
839

840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858


859
860
861
862
863


864
865
866
867










































































































































868
869
870
871
872
873
874
.It Cm x509_extensions
The same as
.Fl extensions .
.El
.Sh CIPHERS
.Nm openssl ciphers
.Op Fl hVv

.Op Ar control
.Pp
The
.Nm ciphers
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 V
Verbose.
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.










































































































































.El
.Sh CRL
.nr nS 1
.Nm "openssl crl"
.Op Fl CAfile Ar file
.Op Fl CApath Ar dir
.Op Fl fingerprint
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
preceded by their subject and issuer names in a one-line format.
.It Fl text
Print certificate details in full rather than just subject and issuer names.
.El
.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
.Op Fl passout Ar arg
.Op Fl topk8
.Op Fl v1 Ar alg
.Op Fl v2 Ar alg







<




<
<







2322
2323
2324
2325
2326
2327
2328

2329
2330
2331
2332


2333
2334
2335
2336
2337
2338
2339
preceded by their subject and issuer names in a one-line format.
.It Fl text
Print certificate details in full rather than just subject and issuer names.
.El
.Sh PKCS8
.nr nS 1
.Nm "openssl pkcs8"

.Op Fl in Ar file
.Op Fl inform Cm der | pem
.Op Fl nocrypt
.Op Fl noiter


.Op Fl out Ar file
.Op Fl outform Cm der | pem
.Op Fl passin Ar arg
.Op Fl passout Ar arg
.Op Fl topk8
.Op Fl v1 Ar alg
.Op Fl v2 Ar alg
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
with a variety of PKCS#5 (v1.5 and v2.0) and PKCS#12 algorithms.
The default encryption is only 56 bits;
keys encrypted using PKCS#5 v2.0 algorithms and high iteration counts
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.
If the key is encrypted, a pass phrase will be prompted for.
.It Fl inform Cm der | pem
The input format.
.It Fl nocrypt
Generate an unencrypted PrivateKeyInfo structure.
This option does not encrypt private keys at all
and should only be used when absolutely necessary.
.It Fl noiter
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.
If any encryption options are set, a pass phrase will be prompted for.
.It Fl outform Cm der | pem
The output format.
.It Fl passin Ar arg







<
<
<
<
<
<
<















<
<
<
<
<
<
<
<
<
<







2347
2348
2349
2350
2351
2352
2353







2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368










2369
2370
2371
2372
2373
2374
2375
with a variety of PKCS#5 (v1.5 and v2.0) and PKCS#12 algorithms.
The default encryption is only 56 bits;
keys encrypted using PKCS#5 v2.0 algorithms and high iteration counts
are more secure.
.Pp
The options are as follows:
.Bl -tag -width Ds







.It Fl in Ar file
The input file to read from,
or standard input if not specified.
If the key is encrypted, a pass phrase will be prompted for.
.It Fl inform Cm der | pem
The input format.
.It Fl nocrypt
Generate an unencrypted PrivateKeyInfo structure.
This option does not encrypt private keys at all
and should only be used when absolutely necessary.
.It Fl noiter
Use an iteration count of 1.
See the
.Sx PKCS12
section below for a detailed explanation of this option.










.It Fl out Ar file
The output file to write to,
or standard output if none is specified.
If any encryption options are set, a pass phrase will be prompted for.
.It Fl outform Cm der | pem
The output format.
.It Fl passin Ar arg
6050
6051
6052
6053
6054
6055
6056


6057
6058
6059
6060
6061
6062
6063
Default configuration file for
.Nm x509
certificates.
.El
.Sh SEE ALSO
.Xr acme-client 1 ,
.Xr nc 1 ,


.Xr ssl 8 ,
.Xr starttls 8
.Sh STANDARDS
.Rs
.%A T. Dierks
.%A C. Allen
.%D January 1999







>
>







5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
Default configuration file for
.Nm x509
certificates.
.El
.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
.Rs
.%A T. Dierks
.%A C. Allen
.%D January 1999
Changes to jni/libressl/apps/openssl/pkcs8.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: pkcs8.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 1999-2004.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
	const EVP_CIPHER *cipher;
	char *infile;
	int informat;
	int iter;
	int nocrypt;
	char *outfile;
	int outformat;
	int p8_broken;
	char *passargin;
	char *passargout;
	int pbe_nid;
	int topk8;
} pkcs8_config;

static int







<







71
72
73
74
75
76
77

78
79
80
81
82
83
84
	const EVP_CIPHER *cipher;
	char *infile;
	int informat;
	int iter;
	int nocrypt;
	char *outfile;
	int outformat;

	char *passargin;
	char *passargout;
	int pbe_nid;
	int topk8;
} pkcs8_config;

static int
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
	}

	return (0);
}

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",
		.desc = "Input file (default stdin)",
		.type = OPTION_ARG,
		.opt.arg = &pkcs8_config.infile,
	},
	{
		.name = "inform",
		.argname = "format",
		.desc = "Input format (DER or PEM (default))",
		.type = OPTION_ARG_FORMAT,
		.opt.value = &pkcs8_config.informat,
	},
	{
		.name = "nocrypt",
		.desc = "Use or expect unencrypted private key",
		.type = OPTION_FLAG,
		.opt.flag = &pkcs8_config.nocrypt,
	},
	{
		.name = "noiter",
		.desc = "Use 1 as iteration count",
		.type = OPTION_VALUE,
		.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",
		.desc = "Output file (default stdout)",
		.type = OPTION_ARG,
		.opt.arg = &pkcs8_config.outfile,
	},
	{
		.name = "outform",
		.argname = "format",
		.desc = "Output format (DER or PEM (default))",
		.type = OPTION_ARG_FORMAT,
		.opt.value = &pkcs8_config.outformat,
	},
	{
		.name = "passin",
		.argname = "source",
		.desc = "Input file passphrase source",







<
<
<
<
<
<
<








|
|

















<
<
<
<
<
<
<
<
<
<
<
<
<
<








|
|







101
102
103
104
105
106
107







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134














135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
	}

	return (0);
}

static struct option pkcs8_options[] = {
	{







		.name = "in",
		.argname = "file",
		.desc = "Input file (default stdin)",
		.type = OPTION_ARG,
		.opt.arg = &pkcs8_config.infile,
	},
	{
		.name = "inform",
		.argname = "der | pem",
		.desc = "Input format (default PEM)",
		.type = OPTION_ARG_FORMAT,
		.opt.value = &pkcs8_config.informat,
	},
	{
		.name = "nocrypt",
		.desc = "Use or expect unencrypted private key",
		.type = OPTION_FLAG,
		.opt.flag = &pkcs8_config.nocrypt,
	},
	{
		.name = "noiter",
		.desc = "Use 1 as iteration count",
		.type = OPTION_VALUE,
		.value = 1,
		.opt.value = &pkcs8_config.iter,
	},
	{














		.name = "out",
		.argname = "file",
		.desc = "Output file (default stdout)",
		.type = OPTION_ARG,
		.opt.arg = &pkcs8_config.outfile,
	},
	{
		.name = "outform",
		.argname = "der | pem",
		.desc = "Output format (default PEM)",
		.type = OPTION_ARG_FORMAT,
		.opt.value = &pkcs8_config.outformat,
	},
	{
		.name = "passin",
		.argname = "source",
		.desc = "Input file passphrase source",
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
	},
	{ NULL },
};

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");
	options_usage(pkcs8_options);
}

int
pkcs8_main(int argc, char **argv)
{
	BIO *in = NULL, *out = NULL;







|
|
|
<
|







182
183
184
185
186
187
188
189
190
191

192
193
194
195
196
197
198
199
	},
	{ NULL },
};

static void
pkcs8_usage()
{
	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);
}

int
pkcs8_main(int argc, char **argv)
{
	BIO *in = NULL, *out = NULL;
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
	}

	memset(&pkcs8_config, 0, sizeof(pkcs8_config));

	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) {
		pkcs8_usage();
		return (1);
	}








<







211
212
213
214
215
216
217

218
219
220
221
222
223
224
	}

	memset(&pkcs8_config, 0, sizeof(pkcs8_config));

	pkcs8_config.iter = PKCS12_DEFAULT_ITER;
	pkcs8_config.informat = FORMAT_PEM;
	pkcs8_config.outformat = FORMAT_PEM;

	pkcs8_config.pbe_nid = -1;

	if (options_parse(argc, argv, pkcs8_options, NULL, NULL) != 0) {
		pkcs8_usage();
		return (1);
	}

274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
		out = BIO_new_fp(stdout, BIO_NOCLOSE);
	}
	if (pkcs8_config.topk8) {
		pkey = load_key(bio_err, pkcs8_config.infile,
		    pkcs8_config.informat, 1, passin, "key");
		if (!pkey)
			goto end;
		if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey,
		    pkcs8_config.p8_broken))) {
			BIO_printf(bio_err, "Error converting key\n");
			ERR_print_errors(bio_err);
			goto end;
		}
		if (pkcs8_config.nocrypt) {
			if (pkcs8_config.outformat == FORMAT_PEM)
				PEM_write_bio_PKCS8_PRIV_KEY_INFO(out, p8inf);







|
<







250
251
252
253
254
255
256
257

258
259
260
261
262
263
264
		out = BIO_new_fp(stdout, BIO_NOCLOSE);
	}
	if (pkcs8_config.topk8) {
		pkey = load_key(bio_err, pkcs8_config.infile,
		    pkcs8_config.informat, 1, passin, "key");
		if (!pkey)
			goto end;
		if (!(p8inf = EVP_PKEY2PKCS8(pkey))) {

			BIO_printf(bio_err, "Error converting key\n");
			ERR_print_errors(bio_err);
			goto end;
		}
		if (pkcs8_config.nocrypt) {
			if (pkcs8_config.outformat == FORMAT_PEM)
				PEM_write_bio_PKCS8_PRIV_KEY_INFO(out, p8inf);
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
		goto end;
	}
	if (!(pkey = EVP_PKCS82PKEY(p8inf))) {
		BIO_printf(bio_err, "Error converting key\n");
		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);
	else if (pkcs8_config.outformat == FORMAT_ASN1)
		i2d_PrivateKey_bio(out, pkey);
	else {
		BIO_printf(bio_err, "Bad format specified for key\n");







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







340
341
342
343
344
345
346


























347
348
349
350
351
352
353
		goto end;
	}
	if (!(pkey = EVP_PKCS82PKEY(p8inf))) {
		BIO_printf(bio_err, "Error converting key\n");
		ERR_print_errors(bio_err);
		goto end;
	}


























	if (pkcs8_config.outformat == FORMAT_PEM)
		PEM_write_bio_PrivateKey(out, pkey, NULL, NULL, 0, NULL,
		    passout);
	else if (pkcs8_config.outformat == FORMAT_ASN1)
		i2d_PrivateKey_bio(out, pkey);
	else {
		BIO_printf(bio_err, "Bad format specified for key\n");
Changes to jni/libressl/apps/openssl/s_apps.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: s_apps.h,v 1.4 2016/12/30 17:25:48 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
143
144
145
146
147
148
149
150
151
    size_t len, SSL *ssl, void *arg);
void tlsext_cb(SSL *s, int client_server, int type, unsigned char *data,
    int len, void *arg);
#endif

int generate_cookie_callback(SSL *ssl, unsigned char *cookie,
    unsigned int *cookie_len);
int verify_cookie_callback(SSL *ssl, unsigned char *cookie,
    unsigned int cookie_len);







|

143
144
145
146
147
148
149
150
151
    size_t len, SSL *ssl, void *arg);
void tlsext_cb(SSL *s, int client_server, int type, unsigned char *data,
    int len, void *arg);
#endif

int generate_cookie_callback(SSL *ssl, unsigned char *cookie,
    unsigned int *cookie_len);
int verify_cookie_callback(SSL *ssl, const unsigned char *cookie,
    unsigned int cookie_len);
Changes to jni/libressl/apps/openssl/s_cb.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: s_cb.c,v 1.9 2018/01/15 11:02:07 inoguchi 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: s_cb.c,v 1.10 2018/04/25 07:12:33 tb 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.
 *
817
818
819
820
821
822
823
824

825
826
827
828
829
830
831
	memcpy(cookie, result, resultlength);
	*cookie_len = resultlength;

	return 1;
}

int
verify_cookie_callback(SSL * ssl, unsigned char *cookie, unsigned int cookie_len)

{
	unsigned char *buffer, result[EVP_MAX_MD_SIZE];
	unsigned int length, resultlength;
	union {
		struct sockaddr sa;
		struct sockaddr_in s4;
		struct sockaddr_in6 s6;







|
>







817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
	memcpy(cookie, result, resultlength);
	*cookie_len = resultlength;

	return 1;
}

int
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;
	union {
		struct sockaddr sa;
		struct sockaddr_in s4;
		struct sockaddr_in6 s6;
Changes to jni/libressl/apps/openssl/s_socket.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: s_socket.c,v 1.9 2018/02/07 05:47:55 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
272
273
274
275
276
277
278

279
280
281
282
283

284
285
286
287
288
289
290
			return (0);
		}

		h2 = gethostbyname(*host);
		if (h2 == NULL) {
			BIO_printf(bio_err, "gethostbyname failure\n");
			close(ret);

			return (0);
		}
		if (h2->h_addrtype != AF_INET) {
			BIO_printf(bio_err, "gethostbyname addr is not AF_INET\n");
			close(ret);

			return (0);
		}
	}

 end:
	*sock = ret;
	return (1);







>





>







272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
			return (0);
		}

		h2 = gethostbyname(*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:
	*sock = ret;
	return (1);
Changes to jni/libressl/apps/openssl/s_time.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: s_time.c,v 1.23 2018/02/07 05:47:55 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
86
87
88
89
90
91
92

93

94
95
96
97
98
99
100

#define MYBUFSIZ 1024*8

#define SECONDS	30
extern int verify_depth;

static void s_time_usage(void);

static SSL *doConnection(SSL * scon);


static SSL_CTX *tm_ctx = NULL;
static const SSL_METHOD *s_time_meth = NULL;
static long bytes_read = 0;

struct {
	int bugs;







>
|
>







86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

#define MYBUFSIZ 1024*8

#define SECONDS	30
extern int verify_depth;

static void s_time_usage(void);
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;
static long bytes_read = 0;

struct {
	int bugs;
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
	    "[-bugs] [-CAfile file] [-CApath directory] [-cert file]\n"
	    "    [-cipher cipherlist] [-connect host:port] [-key keyfile]\n"
	    "    [-nbio] [-new] [-no_shutdown] [-reuse] [-time seconds]\n"
	    "    [-verify depth] [-www page]\n\n");
	options_usage(s_time_options);
}

/***********************************************************************
 * TIME - time functions
 */
#define START	0
#define STOP	1

static double
tm_Time_F(int op)
{
	return app_timer_user(op);
}

/***********************************************************************
 * MAIN - main processing area for client
 *			real name depends on MONOLITH
 */
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 dns", NULL) == -1) {
			perror("pledge");
			exit(1);
		}
	}

	s_time_meth = SSLv23_client_method();

	verify_depth = 0;

	memset(&s_time_config, 0, sizeof(s_time_config));

	s_time_config.host = SSL_CONNECT_NAME;
	s_time_config.maxtime = SECONDS;







<
<
<
<
<
<
<
<
<
<
<
<







<
<
<
<

<
<








|







223
224
225
226
227
228
229












230
231
232
233
234
235
236




237


238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
	    "[-bugs] [-CAfile file] [-CApath directory] [-cert file]\n"
	    "    [-cipher cipherlist] [-connect host:port] [-key keyfile]\n"
	    "    [-nbio] [-new] [-no_shutdown] [-reuse] [-time seconds]\n"
	    "    [-verify depth] [-www page]\n\n");
	options_usage(s_time_options);
}













/***********************************************************************
 * MAIN - main processing area for client
 *			real name depends on MONOLITH
 */
int
s_time_main(int argc, char **argv)
{




	int ret = 1;



	if (single_execution) {
		if (pledge("stdio rpath inet dns", NULL) == -1) {
			perror("pledge");
			exit(1);
		}
	}

	s_time_meth = TLS_client_method();

	verify_depth = 0;

	memset(&s_time_config, 0, sizeof(s_time_config));

	s_time_config.host = SSL_CONNECT_NAME;
	s_time_config.maxtime = SECONDS;
317
318
319
320
321
322
323

324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487

488
489
490
491
492
493
494
495

496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538




































































539








540
541
542













543
544
		 * BIO_printf(bio_err,"error setting default verify
		 * locations\n");
		 */
		ERR_print_errors(bio_err);
		/* 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)
			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);

		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);

	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)
			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);

		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:
	SSL_free(scon);

	if (tm_ctx != NULL) {
		SSL_CTX_free(tm_ctx);
		tm_ctx = NULL;
	}

	return (ret);
}

/***********************************************************************
 * doConnection - make a connection

 * Args:
 *		scon	= earlier ssl connection for session id, or NULL
 * Returns:
 *		SSL *	= the connection pointer.
 */
static SSL *
doConnection(SSL * scon)
{

	struct pollfd pfd[1];
	SSL *serverCon;
	BIO *conn;
	long verify_error;
	int i;

	if ((conn = BIO_new(BIO_s_connect())) == NULL)
		return (NULL);

/*	BIO_set_conn_port(conn,port);*/
	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 */
	for (;;) {
		i = SSL_connect(serverCon);
		if (BIO_sock_should_retry(i)) {
			BIO_printf(bio_err, "DELAY\n");

			i = SSL_get_fd(serverCon);
			pfd[0].fd = i;
			pfd[0].events = POLLIN;
			poll(pfd, 1, -1);
			continue;
		}
		break;
	}
	if (i <= 0) {
		BIO_printf(bio_err, "ERROR\n");
		verify_error = SSL_get_verify_result(serverCon);
		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 serverCon;
}







>
|
<
|
|
|
<
<
<
<
<
<
<
<
<

|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
|
<
|
|
<
<
<
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


<
<









|
>

|

|

|
|

>

<


|


|
<
<

<
<
<
<
<
|
<
<
|
<
<

|


<
<
|








|





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|

301
302
303
304
305
306
307
308
309

310
311
312









313
314














































315
316
317
318


319

320
321



322
323









































































324
325


326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346

347
348
349
350
351
352


353





354


355


356
357
358
359


360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
		 * BIO_printf(bio_err,"error setting default verify
		 * locations\n");
		 */
		ERR_print_errors(bio_err);
		/* goto end; */
	}

	/* Loop and time how long it takes to make connections */
	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;
	}














































	/*
	 * Now loop and time connections using the same session id over and
	 * over
	 */


	if (s_time_config.perform & 2) {

		printf("\n\nNow timing with session id reuse.\n");
		if (benchmark(1))



			goto end;
	}









































































	ret = 0;
 end:


	if (tm_ctx != NULL) {
		SSL_CTX_free(tm_ctx);
		tm_ctx = NULL;
	}

	return (ret);
}

/***********************************************************************
 * run_test - make a connection, get a file, and shut down the connection
 *	
 * Args:
 *		scon	= SSL connection
 * Returns:
 *		1 on success, 0 on error
 */
static int
run_test(SSL *scon)
{
	char buf[1024 * 8];
	struct pollfd pfd[1];

	BIO *conn;
	long verify_error;
	int i, retval;

	if ((conn = BIO_new(BIO_s_connect())) == NULL)
		return 0;


	BIO_set_conn_hostname(conn, s_time_config.host);





	SSL_set_connect_state(scon);


	SSL_set_bio(scon, conn, conn);


	for (;;) {
		i = SSL_connect(scon);
		if (BIO_sock_should_retry(i)) {
			BIO_printf(bio_err, "DELAY\n");


			pfd[0].fd = SSL_get_fd(scon);
			pfd[0].events = POLLIN;
			poll(pfd, 1, -1);
			continue;
		}
		break;
	}
	if (i <= 0) {
		BIO_printf(bio_err, "ERROR\n");
		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);
		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 = '*';
	}
	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;
}
Changes to jni/libressl/apps/openssl/speed.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: speed.c,v 1.22 2018/02/07 05:47:55 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
static void
sig_done(int sig)
{
	signal(SIGALRM, sig_done);
	run = 0;
}

#define START	0
#define STOP	1


static double
Time_F(int s)
{
	if (usertime)
		return app_timer_user(s);







|
|







191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
static void
sig_done(int sig)
{
	signal(SIGALRM, sig_done);
	run = 0;
}

#define START	TM_RESET
#define STOP	TM_GET


static double
Time_F(int s)
{
	if (usertime)
		return app_timer_user(s);
Changes to jni/libressl/configure.
1
2
3
4
5
6
7
8
9
10
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libressl 2.7.4.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.


|







1
2
3
4
5
6
7
8
9
10
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libressl 2.8.2.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
subdirs=
MFLAGS=
MAKEFLAGS=

# Identity of this package.
PACKAGE_NAME='libressl'
PACKAGE_TARNAME='libressl'
PACKAGE_VERSION='2.7.4'
PACKAGE_STRING='libressl 2.7.4'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H







|
|







583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
subdirs=
MFLAGS=
MAKEFLAGS=

# Identity of this package.
PACKAGE_NAME='libressl'
PACKAGE_TARNAME='libressl'
PACKAGE_VERSION='2.8.2'
PACKAGE_STRING='libressl 2.8.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
#
# Report the --help message.
#
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.7.4 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.







|







1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
#
# Report the --help message.
#
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.8.2 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi

if test -n "$ac_init_help"; then
  case $ac_init_help in
     short | recursive ) echo "Configuration of libressl 2.7.4:";;
   esac
  cat <<\_ACEOF

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]







|







1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi

if test -n "$ac_init_help"; then
  case $ac_init_help in
     short | recursive ) echo "Configuration of libressl 2.8.2:";;
   esac
  cat <<\_ACEOF

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
    cd "$ac_pwd" || { ac_status=$?; break; }
  done
fi

test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
  cat <<\_ACEOF
libressl configure 2.7.4
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit







|







1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
    cd "$ac_pwd" || { ac_status=$?; break; }
  done
fi

test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
  cat <<\_ACEOF
libressl configure 2.8.2
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
  as_fn_set_status $ac_retval

} # ac_fn_c_compute_int
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.7.4, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ $0 $@

_ACEOF
exec 5>>config.log
{







|







2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
  as_fn_set_status $ac_retval

} # ac_fn_c_compute_int
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.8.2, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ $0 $@

_ACEOF
exec 5>>config.log
{
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
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


LIBCRYPTO_VERSION=43:1:0

LIBSSL_VERSION=45:1:0

LIBTLS_VERSION=17:1:0


ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
  if test -f "$ac_dir/install-sh"; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"







|

|

|







2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
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


LIBCRYPTO_VERSION=44:1:0

LIBSSL_VERSION=46:1:0

LIBTLS_VERSION=18:1:0


ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
  if test -f "$ac_dir/install-sh"; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
    CYGPATH_W=echo
  fi
fi


# Define the identity of the package.
 PACKAGE='libressl'
 VERSION='2.7.4'


cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF









|







3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
    CYGPATH_W=echo
  fi
fi


# Define the identity of the package.
 PACKAGE='libressl'
 VERSION='2.8.2'


cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF


12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240

		;;
	*mingw*)
		HOST_OS=win
		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"
		CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SPEED"
		PLATFORM_LDADD='-lws2_32'

		;;
	*solaris*)
		HOST_OS=solaris
		HOST_ABI=elf







|







12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240

		;;
	*mingw*)
		HOST_OS=win
		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=0x0600"
		CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SPEED"
		PLATFORM_LDADD='-lws2_32'

		;;
	*solaris*)
		HOST_OS=solaris
		HOST_ABI=elf
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if .gnu.warning accepts long strings" >&5
$as_echo_n "checking if .gnu.warning accepts long strings... " >&6; }
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");
int main() {return 0;}

_ACEOF
if ac_fn_c_try_link "$LINENO"; then :


$as_echo "#define HAS_GNU_WARNING_LONG 1" >>confdefs.h







|







13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if .gnu.warning accepts long strings" >&5
$as_echo_n "checking if .gnu.warning accepts long strings... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

extern void SSLv3_method();
__asm__(".section .gnu.warning.SSLv3_method\n\t.ascii \"SSLv3_method is insecure\"\n\t.text");
int main() {return 0;}

_ACEOF
if ac_fn_c_try_link "$LINENO"; then :


$as_echo "#define HAS_GNU_WARNING_LONG 1" >>confdefs.h
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# 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.7.4, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@







|







14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# 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.8.2, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892

Report bugs to the package provider."

_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.7.4
configured by $0, generated by GNU Autoconf 2.69,
  with options \\"\$ac_cs_config\\"

Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."








|







14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892

Report bugs to the package provider."

_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.8.2
configured by $0, generated by GNU Autoconf 2.69,
  with options \\"\$ac_cs_config\\"

Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."

Changes to jni/libressl/configure.ac.
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
	[x86_64], [HOSTARCH=intel]
)
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");
int main() {return 0;}
]])], [
    AC_DEFINE(HAS_GNU_WARNING_LONG, 1, [Define if .gnu.warning accepts long strings.])
    AC_MSG_RESULT(yes)
], [
   AC_MSG_RESULT(no)
])







|







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
	[x86_64], [HOSTARCH=intel]
)
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\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.])
    AC_MSG_RESULT(yes)
], [
   AC_MSG_RESULT(no)
])
Changes to jni/libressl/crypto/CMakeLists.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
include_directories(
	.
	../include
	../include/compat
	asn1
	bn
	dsa
	evp
	modes
)

if(HOST_ASM_ELF_X86_64)
	set(
		ASM_X86_64_ELF_SRC
		aes/aes-elf-x86_64.S
		aes/bsaes-elf-x86_64.S
		aes/vpaes-elf-x86_64.S
		aes/aesni-elf-x86_64.S
<
<
<
<
<
<
<
<
<
<
<


















1
2
3
4
5
6
7











if(HOST_ASM_ELF_X86_64)
	set(
		ASM_X86_64_ELF_SRC
		aes/aes-elf-x86_64.S
		aes/bsaes-elf-x86_64.S
		aes/vpaes-elf-x86_64.S
		aes/aesni-elf-x86_64.S
87
88
89
90
91
92
93

94
95
96
97
98
99
100
	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_MACOSX_SRC})
	set_property(SOURCE ${ASM_X86_64_MACOSX_SRC} PROPERTY LANGUAGE C)

endif()

if((NOT HOST_ASM_ELF_X86_64) AND (NOT HOST_ASM_MACOSX_X86_64))
	set(
		CRYPTO_SRC
		${CRYPTO_SRC}
		aes/aes_cbc.c







>







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
	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_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((NOT HOST_ASM_ELF_X86_64) AND (NOT HOST_ASM_MACOSX_X86_64))
	set(
		CRYPTO_SRC
		${CRYPTO_SRC}
		aes/aes_cbc.c
806
807
808
809
810
811
812












813
814

815
816
817
818
819
820
821
822
823
	list(SORT EXTRA_EXPORT)
	foreach(SYM IN LISTS EXTRA_EXPORT)
		file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym "${SYM}\n")
	endforeach()
endif()

add_library(crypto ${CRYPTO_SRC})












if (BUILD_SHARED_LIBS)
	export_symbol(crypto ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym)

	if (WIN32)
		target_link_libraries(crypto Ws2_32.lib)
		set(CRYPTO_POSTFIX -${CRYPTO_MAJOR_VERSION})
	endif()
	set_target_properties(crypto PROPERTIES
		OUTPUT_NAME crypto${CRYPTO_POSTFIX}
		ARCHIVE_OUTPUT_NAME crypto${CRYPTO_POSTFIX})
	set_target_properties(crypto PROPERTIES VERSION
		${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION})







>
>
>
>
>
>
>
>
>
>
>
>


>

<







796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818

819
820
821
822
823
824
825
	list(SORT EXTRA_EXPORT)
	foreach(SYM IN LISTS EXTRA_EXPORT)
		file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym "${SYM}\n")
	endforeach()
endif()

add_library(crypto ${CRYPTO_SRC})
target_include_directories(crypto
	PRIVATE
		.
		asn1
		bn
		dsa
		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)

		set(CRYPTO_POSTFIX -${CRYPTO_MAJOR_VERSION})
	endif()
	set_target_properties(crypto PROPERTIES
		OUTPUT_NAME crypto${CRYPTO_POSTFIX}
		ARCHIVE_OUTPUT_NAME crypto${CRYPTO_POSTFIX})
	set_target_properties(crypto PROPERTIES VERSION
		${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION})
Changes to jni/libressl/crypto/VERSION.
1
43:1:0
|
1
44:1:0
Changes to jni/libressl/crypto/asn1/a_bitstr.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: a_bitstr.c,v 1.24 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: a_bitstr.c,v 1.28 2018/05/13 13:48: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.
 *
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149






150
151
152
153
154
155
156
157

158
159
160
161
162
163
164
165
166
167
168
169
170
171

172

173
174

175

176
177
178
179
180
181

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242

243
244
245
246
247
248
249
250
{
	ASN1_BIT_STRING *ret = NULL;
	const unsigned char *p;
	unsigned char *s;
	int i;

	if (len < 1) {
		i = ASN1_R_STRING_TOO_SHORT;
		goto err;
	}

	if ((a == NULL) || ((*a) == NULL)) {
		if ((ret = ASN1_BIT_STRING_new()) == NULL)
			return (NULL);
	} else
		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;
			goto err;
		}
		memcpy(s, p, len);
		s[len - 1] &= (0xff << i);
		p += len;
	} else
		s = NULL;

	ret->length = (int)len;
	free(ret->data);
	ret->data = s;

	ret->type = V_ASN1_BIT_STRING;

	if (a != NULL)
		(*a) = ret;

	*pp = p;

	return (ret);

err:
	ASN1error(i);
	if ((ret != NULL) && ((a == NULL) || (*a != ret)))
		ASN1_BIT_STRING_free(ret);

	return (NULL);
}

/* These next 2 functions from Goetz Babin-Ebell <babinebell@trustcenter.de>
 */
int
ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
{
	int w, v, iv;
	unsigned char *c;

	w = n/8;
	v = 1 << (7 - (n & 0x07));
	iv = ~v;
	if (!value)
		v = 0;

	if (a == NULL)
		return 0;

	a->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); /* clear, set on write */

	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) {
			ASN1error(ERR_R_MALLOC_FAILURE);
			return 0;
		}
		if (w + 1 - a->length > 0)
			memset(c + a->length, 0, w + 1 - a->length);
		a->data = c;
		a->length = w + 1;
	}
	a->data[w] = ((a->data[w]) & iv) | v;
	while ((a->length > 0) && (a->data[a->length - 1] == 0))
		a->length--;

	return (1);
}

int
ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n)
{
	int w, v;

	w = n / 8;
	v = 1 << (7 - (n & 0x07));
	if ((a == NULL) || (a->length < (w + 1)) || (a->data == NULL))
		return (0);
	return ((a->data[w] & v) != 0);
}

/*
 * Checks if the given bit string contains only bits specified by
 * the flags vector. Returns 0 if there is at least one bit set in 'a'
 * which is not specified in 'flags', 1 otherwise.
 * 'len' is the length of 'flags'.
 */
int

ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, unsigned char *flags, int flags_len)
{
	int i, ok;

	/* Check if there is one bit set at all. */
	if (!a || !a->data)
		return 1;








|



|



|



>
>
>
>
>
>
|
|
|
|
|

|
<
>
|
<
|








<


>

>

|
>

>


|
<
|

>



<
<




















|
<
















|

















>
|







131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162

163
164

165
166
167
168
169
170
171
172
173

174
175
176
177
178
179
180
181
182
183
184
185
186

187
188
189
190
191
192


193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213

214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
{
	ASN1_BIT_STRING *ret = NULL;
	const unsigned char *p;
	unsigned char *s;
	int i;

	if (len < 1) {
		ASN1error(ASN1_R_STRING_TOO_SHORT);
		goto err;
	}

	if (a == NULL || *a == NULL) {
		if ((ret = ASN1_BIT_STRING_new()) == NULL)
			return (NULL);
	} else
		ret = *a;

	p = *pp;
	i = *(p++);
	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);
		s[len - 1] &= (0xff << i);
		p += len;
	} else
		s = NULL;


	free(ret->data);
	ret->data = s;
	ret->length = (int)len;
	ret->type = V_ASN1_BIT_STRING;

	if (a != NULL)
		*a = ret;

	*pp = p;

	return (ret);

 err:

	if (a == NULL || *a != ret)
		ASN1_BIT_STRING_free(ret);

	return (NULL);
}



int
ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
{
	int w, v, iv;
	unsigned char *c;

	w = n/8;
	v = 1 << (7 - (n & 0x07));
	iv = ~v;
	if (!value)
		v = 0;

	if (a == NULL)
		return 0;

	a->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); /* clear, set on write */

	if ((a->length < (w + 1)) || (a->data == NULL)) {
		if (!value)
			return(1); /* Don't need to set */
		if ((c = recallocarray(a->data, a->length, w + 1, 1)) == NULL) {

			ASN1error(ERR_R_MALLOC_FAILURE);
			return 0;
		}
		if (w + 1 - a->length > 0)
			memset(c + a->length, 0, w + 1 - a->length);
		a->data = c;
		a->length = w + 1;
	}
	a->data[w] = ((a->data[w]) & iv) | v;
	while ((a->length > 0) && (a->data[a->length - 1] == 0))
		a->length--;

	return (1);
}

int
ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n)
{
	int w, v;

	w = n / 8;
	v = 1 << (7 - (n & 0x07));
	if ((a == NULL) || (a->length < (w + 1)) || (a->data == NULL))
		return (0);
	return ((a->data[w] & v) != 0);
}

/*
 * Checks if the given bit string contains only bits specified by
 * the flags vector. Returns 0 if there is at least one bit set in 'a'
 * which is not specified in 'flags', 1 otherwise.
 * 'len' is the length of 'flags'.
 */
int
ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, const unsigned char *flags,
    int flags_len)
{
	int i, ok;

	/* Check if there is one bit set at all. */
	if (!a || !a->data)
		return 1;

Changes to jni/libressl/crypto/asn1/a_digest.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: a_digest.c,v 1.15 2014/07/11 08:44:47 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
73
74
75
76
77
78
79
80

81


82
83
84
	int i;
	unsigned char *str = NULL;

	i = ASN1_item_i2d(asn, &str, it);
	if (!str)
		return (0);

	if (!EVP_Digest(str, i, md, len, type, NULL))

		return 0;


	free(str);
	return (1);
}







|
>
|
>
>



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
	int i;
	unsigned char *str = NULL;

	i = ASN1_item_i2d(asn, &str, it);
	if (!str)
		return (0);

	if (!EVP_Digest(str, i, md, len, type, NULL)) {
		free(str);
		return (0);
	}

	free(str);
	return (1);
}
Changes to jni/libressl/crypto/asn1/a_enum.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: a_enum.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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
	for (k = i - 1; k >= 0; k--)
		a->data[j++] = buf[k];
	a->length = j;
	return (1);
}

long
ASN1_ENUMERATED_get(ASN1_ENUMERATED *a)
{
	int neg = 0, i;
	long r = 0;

	if (a == NULL)
		return (0L);
	i = a->type;







|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
	for (k = i - 1; k >= 0; k--)
		a->data[j++] = buf[k];
	a->length = j;
	return (1);
}

long
ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a)
{
	int neg = 0, i;
	long r = 0;

	if (a == NULL)
		return (0L);
	i = a->type;
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
	}
	if (neg)
		r = -r;
	return (r);
}

ASN1_ENUMERATED *
BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
{
	ASN1_ENUMERATED *ret;
	int len, j;

	if (ai == NULL)
		ret = ASN1_ENUMERATED_new();
	else







|







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
	}
	if (neg)
		r = -r;
	return (r);
}

ASN1_ENUMERATED *
BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai)
{
	ASN1_ENUMERATED *ret;
	int len, j;

	if (ai == NULL)
		ret = ASN1_ENUMERATED_new();
	else
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
err:
	if (ret != ai)
		ASN1_ENUMERATED_free(ret);
	return (NULL);
}

BIGNUM *
ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn)
{
	BIGNUM *ret;

	if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL)
		ASN1error(ASN1_R_BN_LIB);
	else if (ai->type == V_ASN1_NEG_ENUMERATED)
		BN_set_negative(ret, 1);
	return (ret);
}







|









173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
err:
	if (ret != ai)
		ASN1_ENUMERATED_free(ret);
	return (NULL);
}

BIGNUM *
ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn)
{
	BIGNUM *ret;

	if ((ret = BN_bin2bn(ai->data, ai->length, bn)) == NULL)
		ASN1error(ASN1_R_BN_LIB);
	else if (ai->type == V_ASN1_NEG_ENUMERATED)
		BN_set_negative(ret, 1);
	return (ret);
}
Changes to jni/libressl/crypto/asn1/a_object.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: a_object.c,v 1.30 2017/05/02 03:59:44 deraadt 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <openssl/asn1.h>
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/buffer.h>
#include <openssl/objects.h>

int
i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
{
	unsigned char *p;
	int objsize;

	if ((a == NULL) || (a->data == NULL))
		return (0);








|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <openssl/asn1.h>
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/buffer.h>
#include <openssl/objects.h>

int
i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
{
	unsigned char *p;
	int objsize;

	if ((a == NULL) || (a->data == NULL))
		return (0);

209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
	if (tmp != ftmp)
		free(tmp);
	BN_free(bl);
	return (0);
}

int
i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a)
{
	return OBJ_obj2txt(buf, buf_len, a, 0);
}

int
i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a)
{
	char *tmp = NULL;
	size_t tlen = 256;
	int i = -1;

	if ((a == NULL) || (a->data == NULL))
		return(BIO_write(bp, "NULL", 4));







|





|







209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
	if (tmp != ftmp)
		free(tmp);
	BN_free(bl);
	return (0);
}

int
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, const ASN1_OBJECT *a)
{
	char *tmp = NULL;
	size_t tlen = 256;
	int i = -1;

	if ((a == NULL) || (a->data == NULL))
		return(BIO_write(bp, "NULL", 4));
Changes to jni/libressl/crypto/asn1/a_strex.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: a_strex.c,v 1.25 2015/02/07 13:19:15 doug Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
/* "dump" a string. This is done when the type is unknown,
 * or the flags request it. We can either dump the content
 * octets or the entire DER encoding. This uses the RFC2253
 * #01234 format.
 */

static int
do_dump(unsigned long lflags, char_io *io_ch, void *arg, ASN1_STRING *str)
{
	/* Placing the ASN1_STRING in a temp ASN1_TYPE allows
	 * the DER encoding to readily obtained
	 */
	ASN1_TYPE t;
	unsigned char *der_buf, *p;
	int outlen, der_len;







|







285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
/* "dump" a string. This is done when the type is unknown,
 * or the flags request it. We can either dump the content
 * octets or the entire DER encoding. This uses the RFC2253
 * #01234 format.
 */

static int
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
	 */
	ASN1_TYPE t;
	unsigned char *der_buf, *p;
	int outlen, der_len;
342
343
344
345
346
347
348
349

350
351
352
353
354
355
356
 * ASN1_STRING taking note of various escape
 * and display options. Returns number of
 * characters written or -1 if an error
 * occurred.
 */

static int
do_print_ex(char_io *io_ch, void *arg, unsigned long lflags, ASN1_STRING *str)

{
	int outlen, len;
	int type;
	char quotes;
	unsigned char flags;

	quotes = 0;







|
>







342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
 * ASN1_STRING taking note of various escape
 * and display options. Returns number of
 * characters written or -1 if an error
 * occurred.
 */

static int
do_print_ex(char_io *io_ch, void *arg, unsigned long lflags,
    const ASN1_STRING *str)
{
	int outlen, len;
	int type;
	char quotes;
	unsigned char flags;

	quotes = 0;
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
	return 1;
}

#define FN_WIDTH_LN	25
#define FN_WIDTH_SN	10

static int
do_name_ex(char_io *io_ch, void *arg, X509_NAME *n, int indent,
    unsigned long flags)
{
	int i, prev = -1, orflags, cnt;
	int fn_opt, fn_nid;
	ASN1_OBJECT *fn;
	ASN1_STRING *val;
	X509_NAME_ENTRY *ent;







|







436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
	return 1;
}

#define FN_WIDTH_LN	25
#define FN_WIDTH_SN	10

static int
do_name_ex(char_io *io_ch, void *arg, const X509_NAME *n, int indent,
    unsigned long flags)
{
	int i, prev = -1, orflags, cnt;
	int fn_opt, fn_nid;
	ASN1_OBJECT *fn;
	ASN1_STRING *val;
	X509_NAME_ENTRY *ent;
577
578
579
580
581
582
583
584

585
586
587
588
589
590
591
592

593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
	}
	return outlen;
}

/* Wrappers round the main functions */

int
X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags)

{
	if (flags == XN_FLAG_COMPAT)
		return X509_NAME_print(out, nm, indent);
	return do_name_ex(send_bio_chars, out, nm, indent, flags);
}

int
X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags)

{
	if (flags == XN_FLAG_COMPAT) {
		BIO *btmp;
		int ret;
		btmp = BIO_new_fp(fp, BIO_NOCLOSE);
		if (!btmp)
			return -1;
		ret = X509_NAME_print(btmp, nm, indent);
		BIO_free(btmp);
		return ret;
	}
	return do_name_ex(send_fp_chars, fp, nm, indent, flags);
}

int
ASN1_STRING_print_ex(BIO *out, 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)
{
	return do_print_ex(send_fp_chars, fp, flags, str);
}

/* Utility function: convert any string type to UTF8, returns number of bytes
 * in output string or a negative error code
 */

int
ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in)
{
	ASN1_STRING stmp, *str = &stmp;
	int mbflag, type, ret;

	if (!in)
		return -1;
	type = in->type;







|
>







|
>















|





|









|







578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
	}
	return outlen;
}

/* Wrappers round the main functions */

int
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);
	return do_name_ex(send_bio_chars, out, nm, indent, flags);
}

int
X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent,
    unsigned long flags)
{
	if (flags == XN_FLAG_COMPAT) {
		BIO *btmp;
		int ret;
		btmp = BIO_new_fp(fp, BIO_NOCLOSE);
		if (!btmp)
			return -1;
		ret = X509_NAME_print(btmp, nm, indent);
		BIO_free(btmp);
		return ret;
	}
	return do_name_ex(send_fp_chars, fp, nm, indent, flags);
}

int
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, const ASN1_STRING *str, unsigned long flags)
{
	return do_print_ex(send_fp_chars, fp, flags, str);
}

/* Utility function: convert any string type to UTF8, returns number of bytes
 * in output string or a negative error code
 */

int
ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in)
{
	ASN1_STRING stmp, *str = &stmp;
	int mbflag, type, ret;

	if (!in)
		return -1;
	type = in->type;
Changes to jni/libressl/crypto/asn1/a_time_tm.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: a_time_tm.c,v 1.14 2017/08/28 17:42:47 jsing Exp $ */
/*
 * Copyright (c) 2015 Bob Beck <beck@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/* $OpenBSD: a_time_tm.c,v 1.15 2018/04/25 11:48:21 tb Exp $ */
/*
 * Copyright (c) 2015 Bob Beck <beck@openbsd.org>
 *
 * 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.
 *
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
ASN1_TIME *
ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec)
{
	return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec, RFC5280));
}

int
ASN1_TIME_check(ASN1_TIME *t)
{
	if (t->type != V_ASN1_GENERALIZEDTIME && t->type != V_ASN1_UTCTIME)
		return (0);
	return (t->type == ASN1_time_parse(t->data, t->length, NULL, t->type));
}

ASN1_GENERALIZEDTIME *
ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out)
{
	ASN1_GENERALIZEDTIME *tmp = NULL;
	struct tm tm;
	char *str;

	if (t->type != V_ASN1_GENERALIZEDTIME && t->type != V_ASN1_UTCTIME)
		return (NULL);







|







|







333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
ASN1_TIME *
ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec)
{
	return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec, RFC5280));
}

int
ASN1_TIME_check(const ASN1_TIME *t)
{
	if (t->type != V_ASN1_GENERALIZEDTIME && t->type != V_ASN1_UTCTIME)
		return (0);
	return (t->type == ASN1_time_parse(t->data, t->length, NULL, t->type));
}

ASN1_GENERALIZEDTIME *
ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, ASN1_GENERALIZEDTIME **out)
{
	ASN1_GENERALIZEDTIME *tmp = NULL;
	struct tm tm;
	char *str;

	if (t->type != V_ASN1_GENERALIZEDTIME && t->type != V_ASN1_UTCTIME)
		return (NULL);
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
}

/*
 * ASN1_UTCTIME wrappers
 */

int
ASN1_UTCTIME_check(ASN1_UTCTIME *d)
{
	if (d->type != V_ASN1_UTCTIME)
		return (0);
	return (d->type == ASN1_time_parse(d->data, d->length, NULL, d->type));
}

int







|







382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
}

/*
 * ASN1_UTCTIME wrappers
 */

int
ASN1_UTCTIME_check(const ASN1_UTCTIME *d)
{
	if (d->type != V_ASN1_UTCTIME)
		return (0);
	return (d->type == ASN1_time_parse(d->data, d->length, NULL, d->type));
}

int
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
}

/*
 * ASN1_GENERALIZEDTIME wrappers
 */

int
ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d)
{
	if (d->type != V_ASN1_GENERALIZEDTIME)
		return (0);
	return (d->type == ASN1_time_parse(d->data, d->length, NULL, d->type));
}

int







|







438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
}

/*
 * ASN1_GENERALIZEDTIME wrappers
 */

int
ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d)
{
	if (d->type != V_ASN1_GENERALIZEDTIME)
		return (0);
	return (d->type == ASN1_time_parse(d->data, d->length, NULL, d->type));
}

int
Changes to jni/libressl/crypto/asn1/a_type.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: a_type.c,v 1.19 2016/05/04 15:00:24 tedu 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

#include <stdio.h>

#include <openssl/asn1t.h>
#include <openssl/objects.h>

int
ASN1_TYPE_get(ASN1_TYPE *a)
{
	if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL))
		return (a->type);
	else
		return (0);
}








|







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

#include <stdio.h>

#include <openssl/asn1t.h>
#include <openssl/objects.h>

int
ASN1_TYPE_get(const ASN1_TYPE *a)
{
	if ((a->value.ptr != NULL) || (a->type == V_ASN1_NULL))
		return (a->type);
	else
		return (0);
}

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
		ASN1_TYPE_set(a, type, sdup);
	}
	return 1;
}

/* Returns 0 if they are equal, != 0 otherwise. */
int
ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b)
{
	int result = -1;

	if (!a || !b || a->type != b->type)
		return -1;

	switch (a->type) {







|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
		ASN1_TYPE_set(a, type, sdup);
	}
	return 1;
}

/* Returns 0 if they are equal, != 0 otherwise. */
int
ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)
{
	int result = -1;

	if (!a || !b || a->type != b->type)
		return -1;

	switch (a->type) {
Changes to jni/libressl/crypto/asn1/ameth_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ameth_lib.c,v 1.16 2017/01/21 04:31:25 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326

327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
		*pinfo = ameth->info;
	if (ppem_str)
		*ppem_str = ameth->pem_str;
	return 1;
}

const EVP_PKEY_ASN1_METHOD*
EVP_PKEY_get0_asn1(EVP_PKEY *pkey)
{
	return pkey->ameth;
}

EVP_PKEY_ASN1_METHOD*
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)
		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)
			goto err;
	} else
		ameth->info = NULL;


	if (pem_str) {
		ameth->pem_str = strdup(pem_str);
		if (!ameth->pem_str)
			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:
	EVP_PKEY_asn1_free(ameth);
	return NULL;
}

void
EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, const EVP_PKEY_ASN1_METHOD *src)
{







|









|
<






|
|
<

<
<
|
>
|
|
<

<
<
|
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


|







295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312

313
314
315
316
317
318
319
320

321


322
323
324
325

326


327




328























329
330
331
332
333
334
335
336
337
338
		*pinfo = ameth->info;
	if (ppem_str)
		*ppem_str = ameth->pem_str;
	return 1;
}

const EVP_PKEY_ASN1_METHOD*
EVP_PKEY_get0_asn1(const EVP_PKEY *pkey)
{
	return pkey->ameth;
}

EVP_PKEY_ASN1_METHOD*
EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, const char *info)
{
	EVP_PKEY_ASN1_METHOD *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 != NULL) {
		if ((ameth->info = strdup(info)) == NULL)

			goto err;


	}

	if (pem_str != NULL) {
		if ((ameth->pem_str = strdup(pem_str)) == NULL)

			goto err;


	}




























	return ameth;

 err:
	EVP_PKEY_asn1_free(ameth);
	return NULL;
}

void
EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, const EVP_PKEY_ASN1_METHOD *src)
{
386
387
388
389
390
391
392

393
394
395
396
397
398
399

	dst->param_decode = src->param_decode;
	dst->param_encode = src->param_encode;
	dst->param_missing = src->param_missing;
	dst->param_copy = src->param_copy;
	dst->param_cmp = src->param_cmp;
	dst->param_print = src->param_print;


	dst->pkey_free = src->pkey_free;
	dst->pkey_ctrl = src->pkey_ctrl;

	dst->item_sign = src->item_sign;
	dst->item_verify = src->item_verify;
}







>







353
354
355
356
357
358
359
360
361
362
363
364
365
366
367

	dst->param_decode = src->param_decode;
	dst->param_encode = src->param_encode;
	dst->param_missing = src->param_missing;
	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;

	dst->item_sign = src->item_sign;
	dst->item_verify = src->item_verify;
}
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
	ameth->pub_print = pub_print;
	ameth->pkey_size = pkey_size;
	ameth->pkey_bits = pkey_bits;
}

void
EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
    int (*priv_decode)(EVP_PKEY *pk, 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))
{
	ameth->priv_decode = priv_decode;
	ameth->priv_encode = priv_encode;
	ameth->priv_print = priv_print;







|







392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
	ameth->pub_print = pub_print;
	ameth->pkey_size = pkey_size;
	ameth->pkey_bits = pkey_bits;
}

void
EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
    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))
{
	ameth->priv_decode = priv_decode;
	ameth->priv_encode = priv_encode;
	ameth->priv_print = priv_print;
Changes to jni/libressl/crypto/asn1/asn1_err.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: asn1_err.c,v 1.20 2017/01/29 17:49:22 beck Exp $ */
/* ====================================================================
 * Copyright (c) 1999-2011 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
2
3
4
5
6
7
8
/* $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.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
146
147
148
149
150
151
152

153
154
155
156
157
158
159
	{ERR_REASON(ASN1_R_MIME_SIG_PARSE_ERROR) , "mime sig parse error"},
	{ERR_REASON(ASN1_R_MISSING_EOC)          , "missing eoc"},
	{ERR_REASON(ASN1_R_MISSING_SECOND_NUMBER), "missing second number"},
	{ERR_REASON(ASN1_R_MISSING_VALUE)        , "missing value"},
	{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_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"},
	{ERR_REASON(ASN1_R_NO_CONTENT_TYPE)      , "no content type"},
	{ERR_REASON(ASN1_R_NO_DEFAULT_DIGEST)    , "no default digest"},
	{ERR_REASON(ASN1_R_NO_MATCHING_CHOICE_TYPE), "no matching choice type"},
	{ERR_REASON(ASN1_R_NO_MULTIPART_BODY_FAILURE), "no multipart body failure"},







>







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
	{ERR_REASON(ASN1_R_MIME_SIG_PARSE_ERROR) , "mime sig parse error"},
	{ERR_REASON(ASN1_R_MISSING_EOC)          , "missing eoc"},
	{ERR_REASON(ASN1_R_MISSING_SECOND_NUMBER), "missing second number"},
	{ERR_REASON(ASN1_R_MISSING_VALUE)        , "missing value"},
	{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"},
	{ERR_REASON(ASN1_R_NO_CONTENT_TYPE)      , "no content type"},
	{ERR_REASON(ASN1_R_NO_DEFAULT_DIGEST)    , "no default digest"},
	{ERR_REASON(ASN1_R_NO_MATCHING_CHOICE_TYPE), "no matching choice type"},
	{ERR_REASON(ASN1_R_NO_MULTIPART_BODY_FAILURE), "no multipart body failure"},
Changes to jni/libressl/crypto/asn1/asn1_gen.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: asn1_gen.c,v 1.16 2017/01/29 17:49:22 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2002.
 */
/* ====================================================================
 * Copyright (c) 2002 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2002 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
    int exp_constructed, int exp_pad, int imp_ok);
static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass);
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf);
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)
{
	X509V3_CTX cnf;

	if (!nconf)
		return ASN1_generate_v3(str, NULL);

	X509V3_set_nconf(&cnf, nconf);
	return ASN1_generate_v3(str, &cnf);
}

ASN1_TYPE *
ASN1_generate_v3(char *str, X509V3_CTX *cnf)
{
	ASN1_TYPE *ret;
	tag_exp_arg asn1_tags;
	tag_exp_type *etmp;

	int i, len;








|











|







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
    int exp_constructed, int exp_pad, int imp_ok);
static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass);
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf);
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(const char *str, CONF *nconf)
{
	X509V3_CTX cnf;

	if (!nconf)
		return ASN1_generate_v3(str, NULL);

	X509V3_set_nconf(&cnf, nconf);
	return ASN1_generate_v3(str, &cnf);
}

ASN1_TYPE *
ASN1_generate_v3(const char *str, X509V3_CTX *cnf)
{
	ASN1_TYPE *ret;
	tag_exp_arg asn1_tags;
	tag_exp_type *etmp;

	int i, len;

Changes to jni/libressl/crypto/asn1/asn1_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: asn1_lib.c,v 1.40 2018/02/14 16:46:04 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: asn1_lib.c,v 1.41 2018/04/25 11:48:21 tb 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.
 *
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
void
ASN1_STRING_length_set(ASN1_STRING *x, int len)
{
	x->length = len;
}

int
ASN1_STRING_type(ASN1_STRING *x)
{
	return (x->type);
}

unsigned char *
ASN1_STRING_data(ASN1_STRING *x)
{







|







470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
void
ASN1_STRING_length_set(ASN1_STRING *x, int len)
{
	x->length = len;
}

int
ASN1_STRING_type(const ASN1_STRING *x)
{
	return (x->type);
}

unsigned char *
ASN1_STRING_data(ASN1_STRING *x)
{
Changes to jni/libressl/crypto/asn1/asn1_locl.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: asn1_locl.h,v 1.10 2017/08/27 01:39:26 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

	int (*pub_decode)(EVP_PKEY *pk, X509_PUBKEY *pub);
	int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk);
	int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b);
	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_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk);
	int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent,
	    ASN1_PCTX *pctx);

	int (*pkey_size)(const EVP_PKEY *pk);
	int (*pkey_bits)(const EVP_PKEY *pk);








|







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

	int (*pub_decode)(EVP_PKEY *pk, X509_PUBKEY *pub);
	int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk);
	int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b);
	int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent,
	    ASN1_PCTX *pctx);

	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);

	int (*pkey_size)(const EVP_PKEY *pk);
	int (*pkey_bits)(const EVP_PKEY *pk);

Changes to jni/libressl/crypto/asn1/asn_pack.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: asn_pack.c,v 1.16 2017/01/29 17:49:22 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: asn_pack.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 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
		ASN1_STRING_free(octmp);
	return NULL;
}

/* Extract an ASN1 object from an ASN1_STRING */

void *
ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it)
{
	const unsigned char *p;
	void *ret;

	p = oct->data;
	if (!(ret = ASN1_item_d2i(NULL, &p, oct->length, it)))
		ASN1error(ASN1_R_DECODE_ERROR);
	return ret;
}







|









199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
		ASN1_STRING_free(octmp);
	return NULL;
}

/* Extract an ASN1 object from an ASN1_STRING */

void *
ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it)
{
	const unsigned char *p;
	void *ret;

	p = oct->data;
	if (!(ret = ASN1_item_d2i(NULL, &p, oct->length, it)))
		ASN1error(ASN1_R_DECODE_ERROR);
	return ret;
}
Changes to jni/libressl/crypto/asn1/bio_asn1.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bio_asn1.c,v 1.12 2015/12/23 01:46:33 mmcc Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
static int asn1_bio_init(BIO_ASN1_BUF_CTX *ctx, int size);
static int asn1_bio_flush_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
    asn1_ps_func *cleanup, asn1_bio_state_t next);
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 = {
	.type = BIO_TYPE_ASN1,
	.name = "asn1",
	.bwrite = asn1_bio_write,
	.bread = asn1_bio_read,
	.bputs = asn1_bio_puts,
	.bgets = asn1_bio_gets,
	.ctrl = asn1_bio_ctrl,
	.create = asn1_bio_new,
	.destroy = asn1_bio_free,
	.callback_ctrl = asn1_bio_callback_ctrl
};

BIO_METHOD *
BIO_f_asn1(void)
{
	return (&methods_asn1);
}

static int
asn1_bio_new(BIO *b)







|












|







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
static int asn1_bio_init(BIO_ASN1_BUF_CTX *ctx, int size);
static int asn1_bio_flush_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
    asn1_ps_func *cleanup, asn1_bio_state_t next);
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 const BIO_METHOD methods_asn1 = {
	.type = BIO_TYPE_ASN1,
	.name = "asn1",
	.bwrite = asn1_bio_write,
	.bread = asn1_bio_read,
	.bputs = asn1_bio_puts,
	.bgets = asn1_bio_gets,
	.ctrl = asn1_bio_ctrl,
	.create = asn1_bio_new,
	.destroy = asn1_bio_free,
	.callback_ctrl = asn1_bio_callback_ctrl
};

const BIO_METHOD *
BIO_f_asn1(void)
{
	return (&methods_asn1);
}

static int
asn1_bio_new(BIO *b)
Changes to jni/libressl/crypto/asn1/d2i_pr.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: d2i_pr.c,v 1.15 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: d2i_pr.c,v 1.16 2018/04/14 07:09:21 tb 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.
 *
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
		if ((ret = EVP_PKEY_new()) == NULL) {
			ASN1error(ERR_R_EVP_LIB);
			return (NULL);
		}
	} else {
		ret = *a;
#ifndef OPENSSL_NO_ENGINE
		if (ret->engine) {
			ENGINE_finish(ret->engine);
			ret->engine = NULL;
		}
#endif
	}

	if (!EVP_PKEY_set_type(ret, type)) {
		ASN1error(ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);
		goto err;
	}







<
|
|
<







82
83
84
85
86
87
88

89
90

91
92
93
94
95
96
97
		if ((ret = EVP_PKEY_new()) == NULL) {
			ASN1error(ERR_R_EVP_LIB);
			return (NULL);
		}
	} else {
		ret = *a;
#ifndef OPENSSL_NO_ENGINE

		ENGINE_finish(ret->engine);
		ret->engine = NULL;

#endif
	}

	if (!EVP_PKEY_set_type(ret, type)) {
		ASN1error(ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);
		goto err;
	}
Changes to jni/libressl/crypto/asn1/evp_asn1.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: evp_asn1.c,v 1.20 2017/11/28 16:51:21 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: evp_asn1.c,v 1.21 2018/04/25 11:48:21 tb 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.
 *
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
		return (0);
	}
	ASN1_TYPE_set(a, V_ASN1_OCTET_STRING, os);
	return (1);
}

int
ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len)
{
	int ret, num;
	unsigned char *p;

	if ((a->type != V_ASN1_OCTET_STRING) ||
	    (a->value.octet_string == NULL)) {
		ASN1error(ASN1_R_DATA_IS_WRONG);







|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
		return (0);
	}
	ASN1_TYPE_set(a, V_ASN1_OCTET_STRING, os);
	return (1);
}

int
ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len)
{
	int ret, num;
	unsigned char *p;

	if ((a->type != V_ASN1_OCTET_STRING) ||
	    (a->value.octet_string == NULL)) {
		ASN1error(ASN1_R_DATA_IS_WRONG);
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
	ASN1_item_free((ASN1_VALUE *)ios, &ASN1_INT_OCTETSTRING_it);
	ASN1_STRING_free(sp);

	return ret;
}

int
ASN1_TYPE_get_int_octetstring(ASN1_TYPE *at, long *num, unsigned char *data,
    int max_len)
{
	ASN1_STRING *sp = at->value.sequence;
	ASN1_int_octetstring *ios = NULL;
	int ret = -1;
	int len;








|







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
	ASN1_item_free((ASN1_VALUE *)ios, &ASN1_INT_OCTETSTRING_it);
	ASN1_STRING_free(sp);

	return ret;
}

int
ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *at, long *num, unsigned char *data,
    int max_len)
{
	ASN1_STRING *sp = at->value.sequence;
	ASN1_int_octetstring *ios = NULL;
	int ret = -1;
	int len;

Changes to jni/libressl/crypto/asn1/f_enum.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: f_enum.c,v 1.15 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <openssl/asn1.h>
#include <openssl/buffer.h>
#include <openssl/err.h>

/* Based on a_int.c: equivalent ENUMERATED functions */

int
i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a)
{
	int i, n = 0;
	static const char h[] = "0123456789ABCDEF";
	char buf[2];

	if (a == NULL)
		return (0);







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <openssl/asn1.h>
#include <openssl/buffer.h>
#include <openssl/err.h>

/* Based on a_int.c: equivalent ENUMERATED functions */

int
i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a)
{
	int i, n = 0;
	static const char h[] = "0123456789ABCDEF";
	char buf[2];

	if (a == NULL)
		return (0);
Changes to jni/libressl/crypto/asn1/f_int.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: f_int.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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <stdio.h>

#include <openssl/asn1.h>
#include <openssl/buffer.h>
#include <openssl/err.h>

int
i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a)
{
	int i, n = 0;
	static const char h[] = "0123456789ABCDEF";
	char buf[2];

	if (a == NULL)
		return (0);







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <stdio.h>

#include <openssl/asn1.h>
#include <openssl/buffer.h>
#include <openssl/err.h>

int
i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a)
{
	int i, n = 0;
	static const char h[] = "0123456789ABCDEF";
	char buf[2];

	if (a == NULL)
		return (0);
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
		i -= again;
		if (i % 2 != 0) {
			ASN1error(ASN1_R_ODD_NUMBER_OF_CHARS);
			goto err;
		}
		i /= 2;
		if (num + i > slen) {
			sp = OPENSSL_realloc_clean(s, slen, num + i);
			if (sp == NULL) {
				ASN1error(ERR_R_MALLOC_FAILURE);
				goto err;
			}
			s = sp;
			slen = num + i;
		}
		for (j = 0; j < i; j++, k += 2) {







|
<







154
155
156
157
158
159
160
161

162
163
164
165
166
167
168
		i -= again;
		if (i % 2 != 0) {
			ASN1error(ASN1_R_ODD_NUMBER_OF_CHARS);
			goto err;
		}
		i /= 2;
		if (num + i > slen) {
			if ((sp = recallocarray(s, slen, num + i, 1)) == NULL) {

				ASN1error(ERR_R_MALLOC_FAILURE);
				goto err;
			}
			s = sp;
			slen = num + i;
		}
		for (j = 0; j < i; j++, k += 2) {
Changes to jni/libressl/crypto/asn1/f_string.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: f_string.c,v 1.17 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <stdio.h>

#include <openssl/asn1.h>
#include <openssl/buffer.h>
#include <openssl/err.h>

int
i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type)
{
	int i, n = 0;
	static const char h[] = "0123456789ABCDEF";
	char buf[2];

	if (a == NULL)
		return (0);







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <stdio.h>

#include <openssl/asn1.h>
#include <openssl/buffer.h>
#include <openssl/err.h>

int
i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type)
{
	int i, n = 0;
	static const char h[] = "0123456789ABCDEF";
	char buf[2];

	if (a == NULL)
		return (0);
Changes to jni/libressl/crypto/asn1/n_pkey.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: n_pkey.c,v 1.31 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
269
270
271
272
273
274
275

276
277
278
279
280
281
282
283
284
285
286
287
	i2d_RSAPrivateKey(a, &zz);

	if ((zz = malloc(pkeylen)) == NULL) {
		ASN1error(ERR_R_MALLOC_FAILURE);
		goto err;
	}


	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 */
	explicit_bzero(pkey->private_key->data, rsalen);

	if (cb == NULL)
		cb = EVP_read_pw_string;







>




<







269
270
271
272
273
274
275
276
277
278
279
280

281
282
283
284
285
286
287
	i2d_RSAPrivateKey(a, &zz);

	if ((zz = malloc(pkeylen)) == NULL) {
		ASN1error(ERR_R_MALLOC_FAILURE);
		goto err;
	}

	enckey->enckey->digest->data = zz;
	if (!ASN1_STRING_set(enckey->os, "private-key", -1)) {
		ASN1error(ERR_R_MALLOC_FAILURE);
		goto err;
	}

	i2d_NETSCAPE_PKEY(pkey, &zz);

	/* Wipe the private key encoding */
	explicit_bzero(pkey->private_key->data, rsalen);

	if (cb == NULL)
		cb = EVP_read_pw_string;
Changes to jni/libressl/crypto/asn1/p8_pkey.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: p8_pkey.c,v 1.17 2015/09/10 15:56:25 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* Minor tweak to operation: zero private key data */
static int
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);
	}
	return 1;
}

static const ASN1_AUX PKCS8_PRIV_KEY_INFO_aux = {
	.asn1_cb = pkey_cb,
};







|
<
<
|
<







65
66
67
68
69
70
71
72


73

74
75
76
77
78
79
80
/* Minor tweak to operation: zero private key data */
static int
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)


			explicit_bzero(key->pkey->data, key->pkey->length);

	}
	return 1;
}

static const ASN1_AUX PKCS8_PRIV_KEY_INFO_aux = {
	.asn1_cb = pkey_cb,
};
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
		.offset = offsetof(PKCS8_PRIV_KEY_INFO, pkeyalg),
		.field_name = "pkeyalg",
		.item = &X509_ALGOR_it,
	},
	{
		.offset = offsetof(PKCS8_PRIV_KEY_INFO, pkey),
		.field_name = "pkey",
		.item = &ASN1_ANY_it,
	},
	{
		.flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_SET_OF | ASN1_TFLG_OPTIONAL,
		.offset = offsetof(PKCS8_PRIV_KEY_INFO, attributes),
		.field_name = "attributes",
		.item = &X509_ATTRIBUTE_it,
	},







|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
		.offset = offsetof(PKCS8_PRIV_KEY_INFO, pkeyalg),
		.field_name = "pkeyalg",
		.item = &X509_ALGOR_it,
	},
	{
		.offset = offsetof(PKCS8_PRIV_KEY_INFO, pkey),
		.field_name = "pkey",
		.item = &ASN1_OCTET_STRING_it,
	},
	{
		.flags = ASN1_TFLG_IMPLICIT | ASN1_TFLG_SET_OF | ASN1_TFLG_OPTIONAL,
		.offset = offsetof(PKCS8_PRIV_KEY_INFO, attributes),
		.field_name = "attributes",
		.item = &X509_ATTRIBUTE_it,
	},
141
142
143
144
145
146
147
148
149
150
151
152
153


154
155
156
157
158
159

160




161
162
163
164
165
166
167
168
169
170
171
172
173
174




175
176
177
178
179
180

181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201

	ASN1_item_free((ASN1_VALUE *)a, &PKCS8_PRIV_KEY_INFO_it);
}

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;
		return 0;
	}




	return 1;
}

int
PKCS8_pkey_get0(ASN1_OBJECT **ppkalg, const unsigned char **pk, int *ppklen,
    X509_ALGOR **pa, PKCS8_PRIV_KEY_INFO *p8)

{
	if (ppkalg)
		*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)
		*pa = p8->pkeyalg;
	return 1;
}








<
<




>
>
|
<
|
<
<
|
>
|
>
>
>
>
|
|
|
|
<
|
<

<
<
|
|
|
|
>
>
>
>
|



<
|
>

|
<
<
<
|
<
<
<
<
<
<
<
<
<
<
|
<
<
|

>
138
139
140
141
142
143
144


145
146
147
148
149
150
151

152


153
154
155
156
157
158
159
160
161
162
163

164

165


166
167
168
169
170
171
172
173
174
175
176
177

178
179
180
181



182










183


184
185
186
	ASN1_item_free((ASN1_VALUE *)a, &PKCS8_PRIV_KEY_INFO_it);
}

int
PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version,
    int ptype, void *pval, unsigned char *penc, int penclen)
{


	if (version >= 0) {
		if (!ASN1_INTEGER_set(priv->version, version))
			return 0;
	}
	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(const ASN1_OBJECT **ppkalg, const unsigned char **pk,
    int *ppklen, const X509_ALGOR **pa, const PKCS8_PRIV_KEY_INFO *p8)
{
	if (ppkalg != NULL)
		*ppkalg = p8->pkeyalg->algorithm;
	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;
}

Changes to jni/libressl/crypto/asn1/t_bitst.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: t_bitst.c,v 1.7 2014/07/11 08:44:47 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
		}
	}
	BIO_puts(out, "\n");
	return 1;
}

int
ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
    BIT_STRING_BITNAME *tbl)
{
	int bitnum;

	bitnum = ASN1_BIT_STRING_num_asc(name, tbl);
	if (bitnum < 0)
		return 0;
	if (bs) {
		if (!ASN1_BIT_STRING_set_bit(bs, bitnum, value))
			return 0;
	}
	return 1;
}

int
ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl)
{
	BIT_STRING_BITNAME *bnam;

	for (bnam = tbl; bnam->lname; bnam++) {
		if (!strcmp(bnam->sname, name) ||
		    !strcmp(bnam->lname, name))
			return bnam->bitnum;
	}
	return -1;
}







|















|










79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
		}
	}
	BIO_puts(out, "\n");
	return 1;
}

int
ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
    BIT_STRING_BITNAME *tbl)
{
	int bitnum;

	bitnum = ASN1_BIT_STRING_num_asc(name, tbl);
	if (bitnum < 0)
		return 0;
	if (bs) {
		if (!ASN1_BIT_STRING_set_bit(bs, bitnum, value))
			return 0;
	}
	return 1;
}

int
ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl)
{
	BIT_STRING_BITNAME *bnam;

	for (bnam = tbl; bnam->lname; bnam++) {
		if (!strcmp(bnam->sname, name) ||
		    !strcmp(bnam->lname, name))
			return bnam->bitnum;
	}
	return -1;
}
Changes to jni/libressl/crypto/asn1/t_x509.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: t_x509.c,v 1.28 2017/04/03 15:52:59 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
242
243
244
245
246
247
248

249
250
251
252
253
254
255
256
	ret = 1;

err:
	free(m);
	return (ret);
}


int X509_ocspid_print (BIO *bp, X509 *x)
{
	unsigned char *der = NULL;
	unsigned char *dertmp;
	int derlen;
	int i;
	unsigned char SHA1md[SHA_DIGEST_LENGTH];








>
|







242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
	ret = 1;

err:
	free(m);
	return (ret);
}

int
X509_ocspid_print(BIO *bp, X509 *x)
{
	unsigned char *der = NULL;
	unsigned char *dertmp;
	int derlen;
	int i;
	unsigned char SHA1md[SHA_DIGEST_LENGTH];

316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
	if (BIO_write(bp, "\n", 1) != 1)
		return 0;

	return 1;
}

int
X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig)
{
	int sig_nid;
	if (BIO_puts(bp, "    Signature Algorithm: ") <= 0)
		return 0;
	if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0)
		return 0;








|







317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
	if (BIO_write(bp, "\n", 1) != 1)
		return 0;

	return 1;
}

int
X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, const ASN1_STRING *sig)
{
	int sig_nid;
	if (BIO_puts(bp, "    Signature Algorithm: ") <= 0)
		return 0;
	if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0)
		return 0;

383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
	if (tm->type == V_ASN1_GENERALIZEDTIME)
		return ASN1_GENERALIZEDTIME_print(bp, tm);
	BIO_write(bp, "Bad time value", 14);
	return (0);
}

static const char *mon[12] = {
	"Jan", "Feb", "Mar", "Apr", "May", "Jun", 
	"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};

int
ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
{
	char *v;







|







384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
	if (tm->type == V_ASN1_GENERALIZEDTIME)
		return ASN1_GENERALIZEDTIME_print(bp, tm);
	BIO_write(bp, "Bad time value", 14);
	return (0);
}

static const char *mon[12] = {
	"Jan", "Feb", "Mar", "Apr", "May", "Jun",
	"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};

int
ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
{
	char *v;
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499

err:
	BIO_write(bp, "Bad time value", 14);
	return (0);
}

int
X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
{
	char *s, *c, *b;
	int ret = 0, l, i;

	l = 80 - 2 - obase;

	b = X509_NAME_oneline(name, NULL, 0);







|







486
487
488
489
490
491
492
493
494
495
496
497
498
499
500

err:
	BIO_write(bp, "Bad time value", 14);
	return (0);
}

int
X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
{
	char *s, *c, *b;
	int ret = 0, l, i;

	l = 80 - 2 - obase;

	b = X509_NAME_oneline(name, NULL, 0);
Changes to jni/libressl/crypto/asn1/tasn_dec.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: tasn_dec.c,v 1.34 2017/01/29 17:49:22 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 2000-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: tasn_dec.c,v 1.36 2018/09/17 18:18:01 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 2000-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
60
61
62
63
64
65
66






67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include <stddef.h>
#include <string.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/objects.h>
#include <openssl/buffer.h>
#include <openssl/err.h>







static int asn1_check_eoc(const unsigned char **in, long len);
static int asn1_find_end(const unsigned char **in, long len, char inf);

static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len,
    char inf, int tag, int aclass, int depth);

static int collect_data(BUF_MEM *buf, const unsigned char **p, long plen);

static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass,
    char *inf, char *cst, const unsigned char **in, long len, int exptag,
    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);
static int asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in,
    long len, const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx);
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);

/* Table to convert tags to bit values, used for MSTRING type */
static const unsigned long tag2bit[32] = {
	0,	0,	0,	B_ASN1_BIT_STRING,	/* tags  0 -  3 */







>
>
>
>
>
>














|

|







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include <stddef.h>
#include <string.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/objects.h>
#include <openssl/buffer.h>
#include <openssl/err.h>

/* 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);

static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len,
    char inf, int tag, int aclass, int depth);

static int collect_data(BUF_MEM *buf, const unsigned char **p, long plen);

static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass,
    char *inf, char *cst, const unsigned char **in, long len, int exptag,
    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, 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, 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);

/* Table to convert tags to bit values, used for MSTRING type */
static const unsigned long tag2bit[32] = {
	0,	0,	0,	B_ASN1_BIT_STRING,	/* tags  0 -  3 */
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179


180

181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
int
ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
    const ASN1_TEMPLATE *tt)
{
	ASN1_TLC c;

	asn1_tlc_clear_nc(&c);
	return asn1_template_ex_d2i(pval, in, len, tt, 0, &c);
}


/* Decode an item, taking care of IMPLICIT tagging, if any.
 * 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)

{
	const ASN1_TEMPLATE *tt, *errtt = NULL;
	const ASN1_EXTERN_FUNCS *ef;
	const ASN1_AUX *aux = it->funcs;
	ASN1_aux_cb *asn1_cb;
	const unsigned char *p = NULL, *q;
	unsigned char oclass;
	char seq_eoc, seq_nolen, cst, isopt;
	long tmplen;
	int i;
	int otag;
	int ret = 0;
	ASN1_VALUE **pchptr;
	int combine;

	combine = aclass & ASN1_TFLG_COMBINE;
	aclass &= ~ASN1_TFLG_COMBINE;

	if (!pval)
		return 0;

	if (aux && aux->asn1_cb)
		asn1_cb = aux->asn1_cb;
	else


		asn1_cb = 0;


	switch (it->itype) {
	case ASN1_ITYPE_PRIMITIVE:
		if (it->templates) {
			/* tagging or OPTIONAL is currently illegal on an item
			 * template because the flags can't get passed down.
			 * In practice this isn't a problem: we include the
			 * relevant flags from the item template in the
			 * template itself.
			 */
			if ((tag != -1) || opt) {
				ASN1error(ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE);
				goto err;
			}
			return asn1_template_ex_d2i(pval, in, len,
			    it->templates, opt, ctx);
		}
		return asn1_d2i_ex_primitive(pval, in, len, it,
		    tag, aclass, opt, ctx);
		break;

	case ASN1_ITYPE_MSTRING:
		p = *in;







|







|
|
|
>




|


















|
>
>
|
>















|







144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
int
ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
    const ASN1_TEMPLATE *tt)
{
	ASN1_TLC c;

	asn1_tlc_clear_nc(&c);
	return asn1_template_ex_d2i(pval, in, len, tt, 0, &c, 0);
}


/* Decode an item, taking care of IMPLICIT tagging, if any.
 * If 'opt' set and tag mismatch return -1 to handle OPTIONAL
 */

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 = NULL;
	const unsigned char *p = NULL, *q;
	unsigned char oclass;
	char seq_eoc, seq_nolen, cst, isopt;
	long tmplen;
	int i;
	int otag;
	int ret = 0;
	ASN1_VALUE **pchptr;
	int combine;

	combine = aclass & ASN1_TFLG_COMBINE;
	aclass &= ~ASN1_TFLG_COMBINE;

	if (!pval)
		return 0;

	if (aux && aux->asn1_cb)
		asn1_cb = aux->asn1_cb;

	if (++depth > ASN1_MAX_CONSTRUCTED_NEST) {
		ASN1error(ASN1_R_NESTED_TOO_DEEP);
		goto err;
	}

	switch (it->itype) {
	case ASN1_ITYPE_PRIMITIVE:
		if (it->templates) {
			/* tagging or OPTIONAL is currently illegal on an item
			 * template because the flags can't get passed down.
			 * In practice this isn't a problem: we include the
			 * relevant flags from the item template in the
			 * template itself.
			 */
			if ((tag != -1) || opt) {
				ASN1error(ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE);
				goto err;
			}
			return asn1_template_ex_d2i(pval, in, len,
			    it->templates, opt, ctx, depth);
		}
		return asn1_d2i_ex_primitive(pval, in, len, it,
		    tag, aclass, opt, ctx);
		break;

	case ASN1_ITYPE_MSTRING:
		p = *in;
254
255
256
257
258
259
260
261

262
263
264
265
266
267
268
		/* CHOICE type, try each possibility in turn */
		p = *in;
		for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
			pchptr = asn1_get_field_ptr(pval, tt);
			/* We mark field as OPTIONAL so its absence
			 * can be recognised.
			 */
			ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx);

			/* If field not present, try the next one */
			if (ret == -1)
				continue;
			/* If positive return, read OK, break loop */
			if (ret > 0)
				break;
			/* Otherwise must be an ASN1 parsing error */







|
>







264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
		/* CHOICE type, try each possibility in turn */
		p = *in;
		for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
			pchptr = asn1_get_field_ptr(pval, tt);
			/* We mark field as OPTIONAL so its absence
			 * can be recognised.
			 */
			ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx,
				depth);
			/* If field not present, try the next one */
			if (ret == -1)
				continue;
			/* If positive return, read OK, break loop */
			if (ret > 0)
				break;
			/* Otherwise must be an ASN1 parsing error */
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
				isopt = 0;
			else
				isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL);
			/* attempt to read in field, allowing each to be
			 * OPTIONAL */

			ret = asn1_template_ex_d2i(pseqval, &p, len,
			    seqtt, isopt, ctx);
			if (!ret) {
				errtt = seqtt;
				goto err;
			} else if (ret == -1) {
				/* OPTIONAL component absent.
				 * Free and zero the field.
				 */







|







383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
				isopt = 0;
			else
				isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL);
			/* attempt to read in field, allowing each to be
			 * OPTIONAL */

			ret = asn1_template_ex_d2i(pseqval, &p, len,
			    seqtt, isopt, ctx, depth);
			if (!ret) {
				errtt = seqtt;
				goto err;
			} else if (ret == -1) {
				/* OPTIONAL component absent.
				 * Free and zero the field.
				 */
443
444
445
446
447
448
449







450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
	if (errtt)
		ERR_asprintf_error_data("Field=%s, Type=%s", errtt->field_name,
		    it->sname);
	else
		ERR_asprintf_error_data("Type=%s", it->sname);
	return 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)
{
	int flags, aclass;
	int ret;
	long len;
	const unsigned char *p, *q;
	char exp_eoc;








>
>
>
>
>
>
>







|







454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
	if (errtt)
		ERR_asprintf_error_data("Field=%s, Type=%s", errtt->field_name,
		    it->sname);
	else
		ERR_asprintf_error_data("Type=%s", it->sname);
	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, int depth)
{
	int flags, aclass;
	int ret;
	long len;
	const unsigned char *p, *q;
	char exp_eoc;

485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
		} else if (ret == -1)
			return -1;
		if (!cst) {
			ASN1error(ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED);
			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);
		if (!ret) {
			ASN1error(ERR_R_NESTED_ASN1_ERROR);
			return 0;
		}
		/* We read the field in OK so update length */
		len -= p - q;
		if (exp_eoc) {







|







503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
		} else if (ret == -1)
			return -1;
		if (!cst) {
			ASN1error(ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED);
			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, depth);
		if (!ret) {
			ASN1error(ERR_R_NESTED_ASN1_ERROR);
			return 0;
		}
		/* We read the field in OK so update length */
		len -= p - q;
		if (exp_eoc) {
507
508
509
510
511
512
513
514

515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
			 * an error */
			if (len) {
				ASN1error(ASN1_R_EXPLICIT_LENGTH_MISMATCH);
				goto err;
			}
		}
	} else
		return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx);


	*in = p;
	return 1;

err:
	ASN1_template_free(val, tt);
	return 0;
}

static int
asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, long len,
    const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx)
{
	int flags, aclass;
	int ret;
	const unsigned char *p, *q;

	if (!val)
		return 0;







|
>











|







525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
			 * an error */
			if (len) {
				ASN1error(ASN1_R_EXPLICIT_LENGTH_MISMATCH);
				goto err;
			}
		}
	} else
		return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx,
			depth);

	*in = p;
	return 1;

err:
	ASN1_template_free(val, tt);
	return 0;
}

static int
asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, long len,
    const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx, int depth)
{
	int flags, aclass;
	int ret;
	const unsigned char *p, *q;

	if (!val)
		return 0;
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
					goto err;
				}
				len -= p - q;
				sk_eoc = 0;
				break;
			}
			skfield = NULL;
			if (!ASN1_item_ex_d2i(&skfield, &p, len,
			    tt->item, -1, 0, 0, ctx)) {
				ASN1error(ERR_R_NESTED_ASN1_ERROR);
				goto err;
			}
			len -= p - q;
			if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val,
			    skfield)) {
				ASN1error(ERR_R_MALLOC_FAILURE);
				goto err;
			}
		}
		if (sk_eoc) {
			ASN1error(ASN1_R_MISSING_EOC);
			goto err;
		}
	} else if (flags & ASN1_TFLG_IMPTAG) {
		/* IMPLICIT tagging */
		ret = ASN1_item_ex_d2i(val, &p, len,
		    tt->item, tt->tag, aclass, opt, ctx);
		if (!ret) {
			ASN1error(ERR_R_NESTED_ASN1_ERROR);
			goto err;
		} else if (ret == -1)
			return -1;
	} else {
		/* Nothing special */
		ret = ASN1_item_ex_d2i(val, &p, len, tt->item,
		    -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx);
		if (!ret) {
			ASN1error(ERR_R_NESTED_ASN1_ERROR);
			goto err;
		} else if (ret == -1)
			return -1;
	}








|
|
















|
|







|
|







609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
					goto err;
				}
				len -= p - q;
				sk_eoc = 0;
				break;
			}
			skfield = NULL;
			if (!asn1_item_ex_d2i(&skfield, &p, len,
			    tt->item, -1, 0, 0, ctx, depth)) {
				ASN1error(ERR_R_NESTED_ASN1_ERROR);
				goto err;
			}
			len -= p - q;
			if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val,
			    skfield)) {
				ASN1error(ERR_R_MALLOC_FAILURE);
				goto err;
			}
		}
		if (sk_eoc) {
			ASN1error(ASN1_R_MISSING_EOC);
			goto err;
		}
	} else if (flags & ASN1_TFLG_IMPTAG) {
		/* IMPLICIT tagging */
		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;
		} else if (ret == -1)
			return -1;
	} else {
		/* Nothing special */
		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;
		} else if (ret == -1)
			return -1;
	}

Changes to jni/libressl/crypto/asn1/tasn_fre.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: tasn_fre.c,v 1.15 2016/12/30 16:04:34 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: tasn_fre.c,v 1.16 2018/04/06 12:16:06 bluhm Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
84
85
86
87
88
89
90
91



92
93
94
95
96
97
98
{
	const ASN1_TEMPLATE *tt = NULL, *seqtt;
	const ASN1_EXTERN_FUNCS *ef;
	const ASN1_AUX *aux = it->funcs;
	ASN1_aux_cb *asn1_cb = NULL;
	int i;

	if (pval == NULL || *pval == NULL)



		return;

	if (aux != NULL && aux->asn1_cb != NULL)
		asn1_cb = aux->asn1_cb;

	switch (it->itype) {
	case ASN1_ITYPE_PRIMITIVE:







|
>
>
>







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
	const ASN1_TEMPLATE *tt = NULL, *seqtt;
	const ASN1_EXTERN_FUNCS *ef;
	const ASN1_AUX *aux = it->funcs;
	ASN1_aux_cb *asn1_cb = NULL;
	int i;

	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)
		asn1_cb = aux->asn1_cb;

	switch (it->itype) {
	case ASN1_ITYPE_PRIMITIVE:
Changes to jni/libressl/crypto/asn1/tasn_prn.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: tasn_prn.c,v 1.16 2017/01/29 17:49:22 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 2000,2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: tasn_prn.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 2000.
 */
/* ====================================================================
 * Copyright (c) 2000,2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
void
ASN1_PCTX_free(ASN1_PCTX *p)
{
	free(p);
}

unsigned long
ASN1_PCTX_get_flags(ASN1_PCTX *p)
{
	return p->flags;
}

void
ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags)
{
	p->flags = flags;
}

unsigned long
ASN1_PCTX_get_nm_flags(ASN1_PCTX *p)
{
	return p->nm_flags;
}

void
ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags)
{
	p->nm_flags = flags;
}

unsigned long
ASN1_PCTX_get_cert_flags(ASN1_PCTX *p)
{
	return p->cert_flags;
}

void
ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags)
{
	p->cert_flags = flags;
}

unsigned long
ASN1_PCTX_get_oid_flags(ASN1_PCTX *p)
{
	return p->oid_flags;
}

void
ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags)
{
	p->oid_flags = flags;
}

unsigned long
ASN1_PCTX_get_str_flags(ASN1_PCTX *p)
{
	return p->str_flags;
}

void
ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags)
{







|











|











|











|











|







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
void
ASN1_PCTX_free(ASN1_PCTX *p)
{
	free(p);
}

unsigned long
ASN1_PCTX_get_flags(const ASN1_PCTX *p)
{
	return p->flags;
}

void
ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags)
{
	p->flags = flags;
}

unsigned long
ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p)
{
	return p->nm_flags;
}

void
ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags)
{
	p->nm_flags = flags;
}

unsigned long
ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p)
{
	return p->cert_flags;
}

void
ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags)
{
	p->cert_flags = flags;
}

unsigned long
ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p)
{
	return p->oid_flags;
}

void
ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags)
{
	p->oid_flags = flags;
}

unsigned long
ASN1_PCTX_get_str_flags(const ASN1_PCTX *p)
{
	return p->str_flags;
}

void
ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags)
{
Changes to jni/libressl/crypto/asn1/x_algor.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x_algor.c,v 1.21 2015/07/24 15:09:52 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
		}
	} else
		ASN1_TYPE_set(alg->parameter, ptype, pval);
	return 1;
}

void
X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
    X509_ALGOR *algor)
{
	if (paobj)
		*paobj = algor->algorithm;
	if (pptype) {
		if (algor->parameter == NULL) {
			*pptype = V_ASN1_UNDEF;
			return;







|
|







172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
		}
	} else
		ASN1_TYPE_set(alg->parameter, ptype, pval);
	return 1;
}

void
X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval,
    const X509_ALGOR *algor)
{
	if (paobj)
		*paobj = algor->algorithm;
	if (pptype) {
		if (algor->parameter == NULL) {
			*pptype = V_ASN1_UNDEF;
			return;
Changes to jni/libressl/crypto/asn1/x_crl.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x_crl.c,v 1.30 2018/03/17 14:33:20 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: x_crl.c,v 1.33 2018/08/24 19:55:58 tb 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.
 *
671
672
673
674
675
676
677


678
679
680
681
682
683
684
	m->flags = X509_CRL_METHOD_DYNAMIC;
	return m;
}

void
X509_CRL_METHOD_free(X509_CRL_METHOD *m)
{


	if (!(m->flags & X509_CRL_METHOD_DYNAMIC))
		return;
	free(m);
}

void
X509_CRL_set_meth_data(X509_CRL *crl, void *dat)







>
>







671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
	m->flags = X509_CRL_METHOD_DYNAMIC;
	return m;
}

void
X509_CRL_METHOD_free(X509_CRL_METHOD *m)
{
	if (m == NULL)
		return;
	if (!(m->flags & X509_CRL_METHOD_DYNAMIC))
		return;
	free(m);
}

void
X509_CRL_set_meth_data(X509_CRL *crl, void *dat)
699
700
701
702
703
704
705






706
707
708
709






710
711
712
713
714
715
716
717


















718
719
720
721
722
723
724
725
726
727
}

const STACK_OF(X509_EXTENSION) *
X509_CRL_get0_extensions(const X509_CRL *crl)
{
	return crl->crl->extensions;
}







const ASN1_TIME *
X509_CRL_get0_lastUpdate(const X509_CRL *crl)
{






	return crl->crl->lastUpdate;
}

const ASN1_TIME *
X509_CRL_get0_nextUpdate(const X509_CRL *crl)
{
	return crl->crl->nextUpdate;
}



















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;
}







>
>
>
>
>
>




>
>
>
>
>
>








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
}

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;
}
Changes to jni/libressl/crypto/asn1/x_x509a.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x_x509a.c,v 1.14 2015/02/14 15:28:39 miod Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
		return NULL;
	if (!x->aux && !(x->aux = X509_CERT_AUX_new()))
		return NULL;
	return x->aux;
}

int
X509_alias_set1(X509 *x, unsigned char *name, int len)
{
	X509_CERT_AUX *aux;
	if (!name) {
		if (!x || !x->aux || !x->aux->alias)
			return 1;
		ASN1_UTF8STRING_free(x->aux->alias);
		x->aux->alias = NULL;
		return 1;
	}
	if (!(aux = aux_get(x)))
		return 0;
	if (!aux->alias && !(aux->alias = ASN1_UTF8STRING_new()))
		return 0;
	return ASN1_STRING_set(aux->alias, name, len);
}

int
X509_keyid_set1(X509 *x, unsigned char *id, int len)
{
	X509_CERT_AUX *aux;
	if (!id) {
		if (!x || !x->aux || !x->aux->keyid)
			return 1;
		ASN1_OCTET_STRING_free(x->aux->keyid);
		x->aux->keyid = NULL;







|

















|







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
		return NULL;
	if (!x->aux && !(x->aux = X509_CERT_AUX_new()))
		return NULL;
	return x->aux;
}

int
X509_alias_set1(X509 *x, const unsigned char *name, int len)
{
	X509_CERT_AUX *aux;
	if (!name) {
		if (!x || !x->aux || !x->aux->alias)
			return 1;
		ASN1_UTF8STRING_free(x->aux->alias);
		x->aux->alias = NULL;
		return 1;
	}
	if (!(aux = aux_get(x)))
		return 0;
	if (!aux->alias && !(aux->alias = ASN1_UTF8STRING_new()))
		return 0;
	return ASN1_STRING_set(aux->alias, name, len);
}

int
X509_keyid_set1(X509 *x, const unsigned char *id, int len)
{
	X509_CERT_AUX *aux;
	if (!id) {
		if (!x || !x->aux || !x->aux->keyid)
			return 1;
		ASN1_OCTET_STRING_free(x->aux->keyid);
		x->aux->keyid = NULL;
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
		return NULL;
	if (len)
		*len = x->aux->keyid->length;
	return x->aux->keyid->data;
}

int
X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj)
{
	X509_CERT_AUX *aux;
	ASN1_OBJECT *objtmp;
	int rc;

	if (!(objtmp = OBJ_dup(obj)))
		return 0;







|







206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
		return NULL;
	if (len)
		*len = x->aux->keyid->length;
	return x->aux->keyid->data;
}

int
X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj)
{
	X509_CERT_AUX *aux;
	ASN1_OBJECT *objtmp;
	int rc;

	if (!(objtmp = OBJ_dup(obj)))
		return 0;
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242

err:
	ASN1_OBJECT_free(objtmp);
	return 0;
}

int
X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj)
{
	X509_CERT_AUX *aux;
	ASN1_OBJECT *objtmp;
	int rc;

	if (!(objtmp = OBJ_dup(obj)))
		return 0;







|







228
229
230
231
232
233
234
235
236
237
238
239
240
241
242

err:
	ASN1_OBJECT_free(objtmp);
	return 0;
}

int
X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj)
{
	X509_CERT_AUX *aux;
	ASN1_OBJECT *objtmp;
	int rc;

	if (!(objtmp = OBJ_dup(obj)))
		return 0;
Changes to jni/libressl/crypto/bio/bf_buff.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bf_buff.c,v 1.24 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
static int buffer_gets(BIO *h, char *str, int size);
static long buffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static int buffer_new(BIO *h);
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 = {
	.type = BIO_TYPE_BUFFER,
	.name = "buffer",
	.bwrite = buffer_write,
	.bread = buffer_read,
	.bputs = buffer_puts,
	.bgets = buffer_gets,
	.ctrl = buffer_ctrl,
	.create = buffer_new,
	.destroy = buffer_free,
	.callback_ctrl = buffer_callback_ctrl
};

BIO_METHOD *
BIO_f_buffer(void)
{
	return (&methods_buffer);
}

static int
buffer_new(BIO *bi)







|












|







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
static int buffer_gets(BIO *h, char *str, int size);
static long buffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static int buffer_new(BIO *h);
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 const BIO_METHOD methods_buffer = {
	.type = BIO_TYPE_BUFFER,
	.name = "buffer",
	.bwrite = buffer_write,
	.bread = buffer_read,
	.bputs = buffer_puts,
	.bgets = buffer_gets,
	.ctrl = buffer_ctrl,
	.create = buffer_new,
	.destroy = buffer_free,
	.callback_ctrl = buffer_callback_ctrl
};

const BIO_METHOD *
BIO_f_buffer(void)
{
	return (&methods_buffer);
}

static int
buffer_new(BIO *bi)
Changes to jni/libressl/crypto/bio/bf_nbio.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bf_nbio.c,v 1.19 2015/02/07 13:19:15 doug 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

typedef struct nbio_test_st {
	/* only set if we sent a 'should retry' error */
	int lrn;
	int lwn;
} NBIO_TEST;

static BIO_METHOD methods_nbiof = {
	.type = BIO_TYPE_NBIO_TEST,
	.name = "non-blocking IO test filter",
	.bwrite = nbiof_write,
	.bread = nbiof_read,
	.bputs = nbiof_puts,
	.bgets = nbiof_gets,
	.ctrl = nbiof_ctrl,
	.create = nbiof_new,
	.destroy = nbiof_free,
	.callback_ctrl = nbiof_callback_ctrl
};

BIO_METHOD *
BIO_f_nbio_test(void)
{
	return (&methods_nbiof);
}

static int
nbiof_new(BIO *bi)







|












|







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

typedef struct nbio_test_st {
	/* only set if we sent a 'should retry' error */
	int lrn;
	int lwn;
} NBIO_TEST;

static const BIO_METHOD methods_nbiof = {
	.type = BIO_TYPE_NBIO_TEST,
	.name = "non-blocking IO test filter",
	.bwrite = nbiof_write,
	.bread = nbiof_read,
	.bputs = nbiof_puts,
	.bgets = nbiof_gets,
	.ctrl = nbiof_ctrl,
	.create = nbiof_new,
	.destroy = nbiof_free,
	.callback_ctrl = nbiof_callback_ctrl
};

const BIO_METHOD *
BIO_f_nbio_test(void)
{
	return (&methods_nbiof);
}

static int
nbiof_new(BIO *bi)
Changes to jni/libressl/crypto/bio/bf_null.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bf_null.c,v 1.11 2014/07/11 08:44:47 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
static int nullf_puts(BIO *h, const char *str);
static int nullf_gets(BIO *h, char *str, int size);
static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2);
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 = {
	.type = BIO_TYPE_NULL_FILTER,
	.name = "NULL filter",
	.bwrite = nullf_write,
	.bread = nullf_read,
	.bputs = nullf_puts,
	.bgets = nullf_gets,
	.ctrl = nullf_ctrl,
	.create = nullf_new,
	.destroy = nullf_free,
	.callback_ctrl = nullf_callback_ctrl
};

BIO_METHOD *
BIO_f_null(void)
{
	return (&methods_nullf);
}

static int
nullf_new(BIO *bi)







|












|







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
static int nullf_puts(BIO *h, const char *str);
static int nullf_gets(BIO *h, char *str, int size);
static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2);
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 const BIO_METHOD methods_nullf = {
	.type = BIO_TYPE_NULL_FILTER,
	.name = "NULL filter",
	.bwrite = nullf_write,
	.bread = nullf_read,
	.bputs = nullf_puts,
	.bgets = nullf_gets,
	.ctrl = nullf_ctrl,
	.create = nullf_new,
	.destroy = nullf_free,
	.callback_ctrl = nullf_callback_ctrl
};

const BIO_METHOD *
BIO_f_null(void)
{
	return (&methods_nullf);
}

static int
nullf_new(BIO *bi)
Changes to jni/libressl/crypto/bio/bio_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bio_lib.c,v 1.27 2018/02/22 16:38:43 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
	if (index > 255)
		return -1;

	return index;
}

BIO *
BIO_new(BIO_METHOD *method)
{
	BIO *ret = NULL;

	ret = malloc(sizeof(BIO));
	if (ret == NULL) {
		BIOerror(ERR_R_MALLOC_FAILURE);
		return (NULL);
	}
	if (!BIO_set(ret, method)) {
		free(ret);
		ret = NULL;
	}
	return (ret);
}

int
BIO_set(BIO *bio, BIO_METHOD *method)
{
	bio->method = method;
	bio->callback = NULL;
	bio->cb_arg = NULL;
	bio->init = 0;
	bio->shutdown = 1;
	bio->flags = 0;







|
















|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
	if (index > 255)
		return -1;

	return index;
}

BIO *
BIO_new(const BIO_METHOD *method)
{
	BIO *ret = NULL;

	ret = malloc(sizeof(BIO));
	if (ret == NULL) {
		BIOerror(ERR_R_MALLOC_FAILURE);
		return (NULL);
	}
	if (!BIO_set(ret, method)) {
		free(ret);
		ret = NULL;
	}
	return (ret);
}

int
BIO_set(BIO *bio, const BIO_METHOD *method)
{
	bio->method = method;
	bio->callback = NULL;
	bio->cb_arg = NULL;
	bio->init = 0;
	bio->shutdown = 1;
	bio->flags = 0;
Changes to jni/libressl/crypto/bio/bio_meth.c.
1
2
3
4
5
6
7
8
/*	$OpenBSD: bio_meth.c,v 1.5 2018/02/20 18:51:35 tb Exp $	*/
/*
 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/*	$OpenBSD: bio_meth.c,v 1.6 2018/06/02 04:41:12 tb Exp $	*/
/*
 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
 *
 * 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.
 *
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
void
BIO_meth_free(BIO_METHOD *biom)
{
	free(biom);
}

int
(*BIO_meth_get_write(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(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(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(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(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(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(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(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;
}







|












|












|












|












|












|












|












|













36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
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;
}
Changes to jni/libressl/crypto/bio/bss_acpt.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bss_acpt.c,v 1.27 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
static BIO_ACCEPT *BIO_ACCEPT_new(void );
static void BIO_ACCEPT_free(BIO_ACCEPT *a);

#define ACPT_S_BEFORE			1
#define ACPT_S_GET_ACCEPT_SOCKET	2
#define ACPT_S_OK			3

static BIO_METHOD methods_acceptp = {
	.type = BIO_TYPE_ACCEPT,
	.name = "socket accept",
	.bwrite = acpt_write,
	.bread = acpt_read,
	.bputs = acpt_puts,
	.ctrl = acpt_ctrl,
	.create = acpt_new,
	.destroy = acpt_free
};

BIO_METHOD *
BIO_s_accept(void)
{
	return (&methods_acceptp);
}

static int
acpt_new(BIO *bi)







|










|







96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
static BIO_ACCEPT *BIO_ACCEPT_new(void );
static void BIO_ACCEPT_free(BIO_ACCEPT *a);

#define ACPT_S_BEFORE			1
#define ACPT_S_GET_ACCEPT_SOCKET	2
#define ACPT_S_OK			3

static const BIO_METHOD methods_acceptp = {
	.type = BIO_TYPE_ACCEPT,
	.name = "socket accept",
	.bwrite = acpt_write,
	.bread = acpt_read,
	.bputs = acpt_puts,
	.ctrl = acpt_ctrl,
	.create = acpt_new,
	.destroy = acpt_free
};

const BIO_METHOD *
BIO_s_accept(void)
{
	return (&methods_acceptp);
}

static int
acpt_new(BIO *bi)
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446

	n = strlen(str);
	ret = acpt_write(bp, str, n);
	return (ret);
}

BIO *
BIO_new_accept(char *str)
{
	BIO *ret;

	ret = BIO_new(BIO_s_accept());
	if (ret == NULL)
		return (NULL);
	if (BIO_set_accept_port(ret, str))







|







432
433
434
435
436
437
438
439
440
441
442
443
444
445
446

	n = strlen(str);
	ret = acpt_write(bp, str, n);
	return (ret);
}

BIO *
BIO_new_accept(const char *str)
{
	BIO *ret;

	ret = BIO_new(BIO_s_accept());
	if (ret == NULL)
		return (NULL);
	if (BIO_set_accept_port(ret, str))
Changes to jni/libressl/crypto/bio/bss_bio.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bss_bio.c,v 1.23 2017/01/29 17:49:22 beck Exp $ */
/* ====================================================================
 * Copyright (c) 1998-2003 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
2
3
4
5
6
7
8
/* $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.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
static int bio_write(BIO *bio, const char *buf, int num);
static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr);
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 = {
	.type = BIO_TYPE_BIO,
	.name = "BIO pair",
	.bwrite = bio_write,
	.bread = bio_read,
	.bputs = bio_puts,
	.ctrl = bio_ctrl,
	.create = bio_new,
	.destroy = bio_free
};

BIO_METHOD *
BIO_s_bio(void)
{
	return &methods_biop;
}

struct bio_bio_st {
	BIO *peer;	/* NULL if buf == NULL.







|










|







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
static int bio_write(BIO *bio, const char *buf, int num);
static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr);
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 const BIO_METHOD methods_biop = {
	.type = BIO_TYPE_BIO,
	.name = "BIO pair",
	.bwrite = bio_write,
	.bread = bio_read,
	.bputs = bio_puts,
	.ctrl = bio_ctrl,
	.create = bio_new,
	.destroy = bio_free
};

const BIO_METHOD *
BIO_s_bio(void)
{
	return &methods_biop;
}

struct bio_bio_st {
	BIO *peer;	/* NULL if buf == NULL.
Changes to jni/libressl/crypto/bio/bss_conn.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bss_conn.c,v 1.33 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
static long conn_callback_ctrl(BIO *h, int cmd, bio_info_cb *);

static int conn_state(BIO *b, BIO_CONNECT *c);
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 = {
	.type = BIO_TYPE_CONNECT,
	.name = "socket connect",
	.bwrite = conn_write,
	.bread = conn_read,
	.bputs = conn_puts,
	.ctrl = conn_ctrl,
	.create = conn_new,







|







102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
static long conn_callback_ctrl(BIO *h, int cmd, bio_info_cb *);

static int conn_state(BIO *b, BIO_CONNECT *c);
static void conn_close_socket(BIO *data);
BIO_CONNECT *BIO_CONNECT_new(void);
void BIO_CONNECT_free(BIO_CONNECT *a);

static const BIO_METHOD methods_connectp = {
	.type = BIO_TYPE_CONNECT,
	.name = "socket connect",
	.bwrite = conn_write,
	.bread = conn_read,
	.bputs = conn_puts,
	.ctrl = conn_ctrl,
	.create = conn_new,
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
		return;

	free(a->param_hostname);
	free(a->param_port);
	free(a);
}

BIO_METHOD *
BIO_s_connect(void)
{
	return (&methods_connectp);
}

static int
conn_new(BIO *bi)







|







315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
		return;

	free(a->param_hostname);
	free(a->param_port);
	free(a);
}

const BIO_METHOD *
BIO_s_connect(void)
{
	return (&methods_connectp);
}

static int
conn_new(BIO *bi)
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593

	n = strlen(str);
	ret = conn_write(bp, str, n);
	return (ret);
}

BIO *
BIO_new_connect(char *str)
{
	BIO *ret;

	ret = BIO_new(BIO_s_connect());
	if (ret == NULL)
		return (NULL);
	if (BIO_set_conn_hostname(ret, str))







|







579
580
581
582
583
584
585
586
587
588
589
590
591
592
593

	n = strlen(str);
	ret = conn_write(bp, str, n);
	return (ret);
}

BIO *
BIO_new_connect(const char *str)
{
	BIO *ret;

	ret = BIO_new(BIO_s_connect());
	if (ret == NULL)
		return (NULL);
	if (BIO_set_conn_hostname(ret, str))
Changes to jni/libressl/crypto/bio/bss_dgram.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bss_dgram.c,v 1.41 2015/07/20 23:15:28 doug Exp $ */
/* 
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.  
 */
/* ====================================================================
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 *
|







1
2
3
4
5
6
7
8
/* $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.  
 */
/* ====================================================================
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 *
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
static int dgram_new(BIO *h);
static int dgram_free(BIO *data);
static int dgram_clear(BIO *bio);


static int BIO_dgram_should_retry(int s);

static BIO_METHOD methods_dgramp = {
	.type = BIO_TYPE_DGRAM,
	.name = "datagram socket",
	.bwrite = dgram_write,
	.bread = dgram_read,
	.bputs = dgram_puts,
	.ctrl = dgram_ctrl,
	.create = dgram_new,







|







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
static int dgram_new(BIO *h);
static int dgram_free(BIO *data);
static int dgram_clear(BIO *bio);


static int BIO_dgram_should_retry(int s);

static const BIO_METHOD methods_dgramp = {
	.type = BIO_TYPE_DGRAM,
	.name = "datagram socket",
	.bwrite = dgram_write,
	.bread = dgram_read,
	.bputs = dgram_puts,
	.ctrl = dgram_ctrl,
	.create = dgram_new,
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
	unsigned int _errno;
	unsigned int mtu;
	struct timeval next_timeout;
	struct timeval socket_timeout;
} bio_dgram_data;


BIO_METHOD *
BIO_s_datagram(void)
{
	return (&methods_dgramp);
}

BIO *
BIO_new_dgram(int fd, int close_flag)







|







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
	unsigned int _errno;
	unsigned int mtu;
	struct timeval next_timeout;
	struct timeval socket_timeout;
} bio_dgram_data;


const BIO_METHOD *
BIO_s_datagram(void)
{
	return (&methods_dgramp);
}

BIO *
BIO_new_dgram(int fd, int close_flag)
Changes to jni/libressl/crypto/bio/bss_fd.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bss_fd.c,v 1.18 2015/02/12 03:54:07 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
static int fd_puts(BIO *h, const char *str);
static int fd_gets(BIO *h, char *buf, int size);
static long fd_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static int fd_new(BIO *h);
static int fd_free(BIO *data);
int BIO_fd_should_retry(int s);

static BIO_METHOD methods_fdp = {
	.type = BIO_TYPE_FD,
	.name = "file descriptor",
	.bwrite = fd_write,
	.bread = fd_read,
	.bputs = fd_puts,
	.bgets = fd_gets,
	.ctrl = fd_ctrl,
	.create = fd_new,
	.destroy = fd_free
};

BIO_METHOD *
BIO_s_fd(void)
{
	return (&methods_fdp);
}

BIO *
BIO_new_fd(int fd, int close_flag)







|











|







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
static int fd_puts(BIO *h, const char *str);
static int fd_gets(BIO *h, char *buf, int size);
static long fd_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static int fd_new(BIO *h);
static int fd_free(BIO *data);
int BIO_fd_should_retry(int s);

static const BIO_METHOD methods_fdp = {
	.type = BIO_TYPE_FD,
	.name = "file descriptor",
	.bwrite = fd_write,
	.bread = fd_read,
	.bputs = fd_puts,
	.bgets = fd_gets,
	.ctrl = fd_ctrl,
	.create = fd_new,
	.destroy = fd_free
};

const BIO_METHOD *
BIO_s_fd(void)
{
	return (&methods_fdp);
}

BIO *
BIO_new_fd(int fd, int close_flag)
Changes to jni/libressl/crypto/bio/bss_file.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bss_file.c,v 1.32 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
static int file_read(BIO *h, char *buf, int size);
static int file_puts(BIO *h, const char *str);
static int file_gets(BIO *h, char *str, int size);
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 = {
	.type = BIO_TYPE_FILE,
	.name = "FILE pointer",
	.bwrite = file_write,
	.bread = file_read,
	.bputs = file_puts,
	.bgets = file_gets,
	.ctrl = file_ctrl,







|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
static int file_read(BIO *h, char *buf, int size);
static int file_puts(BIO *h, const char *str);
static int file_gets(BIO *h, char *str, int size);
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 const BIO_METHOD methods_filep = {
	.type = BIO_TYPE_FILE,
	.name = "FILE pointer",
	.bwrite = file_write,
	.bread = file_read,
	.bputs = file_puts,
	.bgets = file_gets,
	.ctrl = file_ctrl,
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
	if ((ret = BIO_new(BIO_s_file())) == NULL)
		return (NULL);

	BIO_set_fp(ret, stream, close_flag);
	return (ret);
}

BIO_METHOD *
BIO_s_file(void)
{
	return (&methods_filep);
}

static int
file_new(BIO *bi)







|







144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
	if ((ret = BIO_new(BIO_s_file())) == NULL)
		return (NULL);

	BIO_set_fp(ret, stream, close_flag);
	return (ret);
}

const BIO_METHOD *
BIO_s_file(void)
{
	return (&methods_filep);
}

static int
file_new(BIO *bi)
Changes to jni/libressl/crypto/bio/bss_log.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bss_log.c,v 1.21 2014/07/11 08:44:47 jsing Exp $ */
/* ====================================================================
 * Copyright (c) 1999 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
2
3
4
5
6
7
8
/* $OpenBSD: bss_log.c,v 1.22 2018/05/01 13:29:10 tb Exp $ */
/* ====================================================================
 * Copyright (c) 1999 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:
 *
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
static long slg_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static int slg_new(BIO *h);
static int slg_free(BIO *data);
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 = {
	.type = BIO_TYPE_MEM,
	.name = "syslog",
	.bwrite = slg_write,
	.bputs = slg_puts,
	.ctrl = slg_ctrl,
	.create = slg_new,
	.destroy = slg_free
};

BIO_METHOD *
BIO_s_log(void)
{
	return (&methods_slg);
}

static int
slg_new(BIO *bi)







|









|







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
static long slg_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static int slg_new(BIO *h);
static int slg_free(BIO *data);
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 const BIO_METHOD methods_slg = {
	.type = BIO_TYPE_MEM,
	.name = "syslog",
	.bwrite = slg_write,
	.bputs = slg_puts,
	.ctrl = slg_ctrl,
	.create = slg_new,
	.destroy = slg_free
};

const BIO_METHOD *
BIO_s_log(void)
{
	return (&methods_slg);
}

static int
slg_new(BIO *bi)
Changes to jni/libressl/crypto/bio/bss_mem.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bss_mem.c,v 1.15 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
static int mem_read(BIO *h, char *buf, int size);
static int mem_puts(BIO *h, const char *str);
static int mem_gets(BIO *h, char *str, int size);
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 = {
	.type = BIO_TYPE_MEM,
	.name = "memory buffer",
	.bwrite = mem_write,
	.bread = mem_read,
	.bputs = mem_puts,
	.bgets = mem_gets,
	.ctrl = mem_ctrl,
	.create = mem_new,
	.destroy = mem_free
};

/* bio->num is used to hold the value to return on 'empty', if it is
 * 0, should_retry is not set */

BIO_METHOD *
BIO_s_mem(void)
{
	return (&mem_method);
}

BIO *
BIO_new_mem_buf(void *buf, int len)
{
	BIO *ret;
	BUF_MEM *b;
	size_t sz;

	if (!buf) {
		BIOerror(BIO_R_NULL_PARAMETER);
		return NULL;
	}
	sz = (len < 0) ? strlen(buf) : (size_t)len;
	if (!(ret = BIO_new(BIO_s_mem())))
		return NULL;
	b = (BUF_MEM *)ret->ptr;
	b->data = buf;
	b->length = sz;
	b->max = sz;
	ret->flags |= BIO_FLAGS_MEM_RDONLY;
	/* Since this is static data retrying wont help */
	ret->num = 0;
	return ret;
}







|














|






|













|







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
static int mem_read(BIO *h, char *buf, int size);
static int mem_puts(BIO *h, const char *str);
static int mem_gets(BIO *h, char *str, int size);
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 const BIO_METHOD mem_method = {
	.type = BIO_TYPE_MEM,
	.name = "memory buffer",
	.bwrite = mem_write,
	.bread = mem_read,
	.bputs = mem_puts,
	.bgets = mem_gets,
	.ctrl = mem_ctrl,
	.create = mem_new,
	.destroy = mem_free
};

/* bio->num is used to hold the value to return on 'empty', if it is
 * 0, should_retry is not set */

const BIO_METHOD *
BIO_s_mem(void)
{
	return (&mem_method);
}

BIO *
BIO_new_mem_buf(const void *buf, int len)
{
	BIO *ret;
	BUF_MEM *b;
	size_t sz;

	if (!buf) {
		BIOerror(BIO_R_NULL_PARAMETER);
		return NULL;
	}
	sz = (len < 0) ? strlen(buf) : (size_t)len;
	if (!(ret = BIO_new(BIO_s_mem())))
		return NULL;
	b = (BUF_MEM *)ret->ptr;
	b->data = (void *)buf;	/* Trust in the BIO_FLAGS_MEM_RDONLY flag. */
	b->length = sz;
	b->max = sz;
	ret->flags |= BIO_FLAGS_MEM_RDONLY;
	/* Since this is static data retrying wont help */
	ret->num = 0;
	return ret;
}
Changes to jni/libressl/crypto/bio/bss_null.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bss_null.c,v 1.10 2014/07/11 08:44:47 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
static int null_read(BIO *h, char *buf, int size);
static int null_puts(BIO *h, const char *str);
static int null_gets(BIO *h, char *str, int size);
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 = {
	.type = BIO_TYPE_NULL,
	.name = "NULL",
	.bwrite = null_write,
	.bread = null_read,
	.bputs = null_puts,
	.bgets = null_gets,
	.ctrl = null_ctrl,
	.create = null_new,
	.destroy = null_free
};

BIO_METHOD *
BIO_s_null(void)
{
	return (&null_method);
}

static int
null_new(BIO *bi)







|











|







66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
static int null_read(BIO *h, char *buf, int size);
static int null_puts(BIO *h, const char *str);
static int null_gets(BIO *h, char *str, int size);
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 const BIO_METHOD null_method = {
	.type = BIO_TYPE_NULL,
	.name = "NULL",
	.bwrite = null_write,
	.bread = null_read,
	.bputs = null_puts,
	.bgets = null_gets,
	.ctrl = null_ctrl,
	.create = null_new,
	.destroy = null_free
};

const BIO_METHOD *
BIO_s_null(void)
{
	return (&null_method);
}

static int
null_new(BIO *bi)
Changes to jni/libressl/crypto/bio/bss_sock.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bss_sock.c,v 1.23 2014/07/11 08:44:47 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
static int sock_read(BIO *h, char *buf, int size);
static int sock_puts(BIO *h, const char *str);
static long sock_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static int sock_new(BIO *h);
static int sock_free(BIO *data);
int BIO_sock_should_retry(int s);

static BIO_METHOD methods_sockp = {
	.type = BIO_TYPE_SOCKET,
	.name = "socket",
	.bwrite = sock_write,
	.bread = sock_read,
	.bputs = sock_puts,
	.ctrl = sock_ctrl,
	.create = sock_new,
	.destroy = sock_free
};

BIO_METHOD *
BIO_s_socket(void)
{
	return (&methods_sockp);
}

BIO *
BIO_new_socket(int fd, int close_flag)







|










|







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
static int sock_read(BIO *h, char *buf, int size);
static int sock_puts(BIO *h, const char *str);
static long sock_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static int sock_new(BIO *h);
static int sock_free(BIO *data);
int BIO_sock_should_retry(int s);

static const BIO_METHOD methods_sockp = {
	.type = BIO_TYPE_SOCKET,
	.name = "socket",
	.bwrite = sock_write,
	.bread = sock_read,
	.bputs = sock_puts,
	.ctrl = sock_ctrl,
	.create = sock_new,
	.destroy = sock_free
};

const BIO_METHOD *
BIO_s_socket(void)
{
	return (&methods_sockp);
}

BIO *
BIO_new_socket(int fd, int close_flag)
Changes to jni/libressl/crypto/bn/bn_add.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bn_add.c,v 1.11 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

91
92
93
94
95
96
97


98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119


120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282



283
284
285

286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313

#include <stdio.h>

#include <openssl/err.h>

#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;

	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;
		} else {
			if (!BN_usub(r, a, b))
				return (0);
			r->neg = 0;


		}
		return (1);
	}

	ret = BN_uadd(r, a, b);
	r->neg = a_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;

	bn_check_top(a);
	bn_check_top(b);

	if (a->top < b->top) {


		tmp = a;
		a = b;
		b = tmp;
	}
	max = a->top;
	min = b->top;
	dif = max - min;

	if (bn_wexpand(r, max + 1) == NULL)
		return 0;

	r->top = max;

	ap = a->d;
	bp = b->d;
	rp = r->d;

	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++;
		}
	}
	if (dif && rp != ap)
		while (dif--)
			/* copy remaining words if ap != rp */
			*(rp++) = *(ap++);
	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;

	bn_check_top(a);
	bn_check_top(b);

	max = a->top;
	min = b->top;
	dif = max - min;

	if (dif < 0)	/* hmm... should not be happening */
	{
		BNerror(BN_R_ARG2_LT_ARG3);
		return (0);
	}

	if (bn_wexpand(r, max) == NULL)
		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);
	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;
		}
	}
#endif

	r->top = max;
	r->neg = 0;
	bn_correct_top(r);
	return (1);
}

int
BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
{
	int max;
	int add = 0, neg = 0;
	const BIGNUM *tmp;

	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;
		}



	} else {
		if (b->neg) {
			add = 1;

			neg = 0;
		}
	}

	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;
	}
	bn_check_top(r);
	return (1);
}







<



<
|




<
<
<
<
<
|
<
|
|
|
|
|
|
|
|
|
>
|
<
<

<
<
|
>
>

<


<
|




<




|
|





>
>




















<

<
|
|
|
|
|
<
|
<
|
<
<
<
|
|
|
<
<
<
<
<





<




>
|
<








|
<

|



|





<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|

<

<
<
|
<
<
<
|
|
|
|
|
|
<
|
|
<
|
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<



|





|
<
<




<
<
<
<
<
|
<
|
|
<
|
|
<
|
>
>
>
|
|
|
>
|
<
<
|
<
<
|
<
<
|
|
<

<
<
<
<
<
<
|
<
<
<
<
<

|

58
59
60
61
62
63
64

65
66
67

68
69
70
71
72





73

74
75
76
77
78
79
80
81
82
83
84


85


86
87
88
89

90
91

92
93
94
95
96

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129

130

131
132
133
134
135

136

137



138
139
140





141
142
143
144
145

146
147
148
149
150
151

152
153
154
155
156
157
158
159
160

161
162
163
164
165
166
167
168
169
170
171















172
173

174


175



176
177
178
179
180
181

182
183

184



185













186



187
188
189
190
191
192
193
194
195
196


197
198
199
200





201

202
203

204
205

206
207
208
209
210
211
212
213
214


215


216


217
218

219






220





221
222
223

#include <stdio.h>

#include <openssl/err.h>

#include "bn_lcl.h"


int
BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
{

	int ret, r_neg;

	bn_check_top(a);
	bn_check_top(b);






	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 {


			r_neg = 0;
			BN_zero(r);
			ret = 1;
		}

	}


	r->neg = r_neg;
	bn_check_top(r);
	return ret;
}


int
BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
{
	int max, min, dif;
	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;
	}
	max = a->top;
	min = b->top;
	dif = max - min;

	if (bn_wexpand(r, max + 1) == NULL)
		return 0;

	r->top = max;

	ap = a->d;
	bp = b->d;
	rp = r->d;

	carry = bn_add_words(rp, ap, bp, min);
	rp += min;
	ap += min;



	while (dif) {
		dif--;
		t1 = *(ap++);
		t2 = (t1 + carry) & BN_MASK2;
		*(rp++) = t2;

		carry &= (t2 == 0);

	}



	*rp = carry;
	r->top += carry;






	r->neg = 0;
	bn_check_top(r);
	return 1;
}


int
BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
{
	int max, min, dif;
	const BN_ULONG *ap, *bp;
	BN_ULONG t1, t2, borrow, *rp;


	bn_check_top(a);
	bn_check_top(b);

	max = a->top;
	min = b->top;
	dif = max - min;

	if (dif < 0) {

		BNerror(BN_R_ARG2_LT_ARG3);
		return 0;
	}

	if (bn_wexpand(r, max) == NULL)
		return 0;

	ap = a->d;
	bp = b->d;
	rp = r->d;
















	borrow = bn_sub_words(rp, ap, bp, min);
	ap += min;

	rp += min;






	while (dif) {
		dif--;
		t1 = *(ap++);
		t2 = (t1 - borrow) & BN_MASK2;
		*(rp++) = t2;
		borrow &= (t1 == 0);

	}


	while (max > 0 && *--rp == 0)



		max--;

















	r->top = max;
	r->neg = 0;
	bn_correct_top(r);
	return 1;
}

int
BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
{
	int ret, r_neg;



	bn_check_top(a);
	bn_check_top(b);






	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 {
			r_neg = 0;


			BN_zero(r);


			ret = 1;


		}
	}








	r->neg = r_neg;





	bn_check_top(r);
	return ret;
}
Changes to jni/libressl/crypto/bn/bn_lcl.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: bn_lcl.h,v 1.27 2017/01/25 06:15:44 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: bn_lcl.h,v 1.29 2018/07/23 18:14:32 tb 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.
 *
601
602
603
604
605
606
607



608
609
#define BN_mod_nonct(rem,m,d,ctx) BN_div_nonct(NULL,(rem),(m),(d),(ctx))
BIGNUM *BN_mod_inverse_ct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n,
    BN_CTX *ctx);
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);



__END_HIDDEN_DECLS
#endif







>
>
>


601
602
603
604
605
606
607
608
609
610
611
612
#define BN_mod_nonct(rem,m,d,ctx) BN_div_nonct(NULL,(rem),(m),(d),(ctx))
BIGNUM *BN_mod_inverse_ct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n,
    BN_CTX *ctx);
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
Changes to jni/libressl/crypto/bn/bn_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bn_lib.c,v 1.39 2018/02/20 17:13:14 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: bn_lib.c,v 1.45 2018/07/23 18:14:32 tb 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.
 *
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
}

void
BN_clear(BIGNUM *a)
{
	bn_check_top(a);
	if (a->d != NULL)
		memset(a->d, 0, a->dmax * sizeof(a->d[0]));
	a->top = 0;
	a->neg = 0;
}

BN_ULONG
BN_get_word(const BIGNUM *a)
{







|







525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
}

void
BN_clear(BIGNUM *a)
{
	bn_check_top(a);
	if (a->d != NULL)
		explicit_bzero(a->d, a->dmax * sizeof(a->d[0]));
	a->top = 0;
	a->neg = 0;
}

BN_ULONG
BN_get_word(const BIGNUM *a)
{
833
834
835
836
837
838
839
840

841

842
843
844
845
846
847
848
		}
	}
	return bn_cmp_words(a, b, cl);
}

/*
 * 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,

 * and that no more than nwords are used by either a or b.
 * a and b cannot be the same number
 */
void
BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
{
	BN_ULONG t;







|
>
|
>







833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
		}
	}
	return bn_cmp_words(a, b, cl);
}

/*
 * 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,
 * and that no more than nwords are used by either a or b.
 * a and b cannot be the same number
 */
void
BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
{
	BN_ULONG t;
884
885
886
887
888
889
890



















































891
892
893
894
895
896
897
	case 3: BN_CONSTTIME_SWAP(2); /* Fallthrough */
	case 2: BN_CONSTTIME_SWAP(1); /* Fallthrough */
	case 1:
		BN_CONSTTIME_SWAP(0);
	}
#undef BN_CONSTTIME_SWAP
}




















































BN_GENCB *
BN_GENCB_new(void)
{
	BN_GENCB *cb;

	if ((cb = calloc(1, sizeof(*cb))) == NULL)







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
	case 3: BN_CONSTTIME_SWAP(2); /* Fallthrough */
	case 2: BN_CONSTTIME_SWAP(1); /* Fallthrough */
	case 1:
		BN_CONSTTIME_SWAP(0);
	}
#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)
Changes to jni/libressl/crypto/crypto.sym.
1254
1255
1256
1257
1258
1259
1260

1261
1262
1263

1264
1265
1266
1267
1268
1269
1270
1271
1272

1273
1274
1275
1276
1277
1278
1279
EVP_BytesToKey
EVP_CIPHER_CTX_block_size
EVP_CIPHER_CTX_cipher
EVP_CIPHER_CTX_cleanup
EVP_CIPHER_CTX_clear_flags
EVP_CIPHER_CTX_copy
EVP_CIPHER_CTX_ctrl

EVP_CIPHER_CTX_flags
EVP_CIPHER_CTX_free
EVP_CIPHER_CTX_get_app_data

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_key_length
EVP_CIPHER_CTX_set_padding
EVP_CIPHER_CTX_test_flags
EVP_CIPHER_asn1_to_param
EVP_CIPHER_block_size
EVP_CIPHER_do_all
EVP_CIPHER_do_all_sorted







>



>









>







1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
EVP_BytesToKey
EVP_CIPHER_CTX_block_size
EVP_CIPHER_CTX_cipher
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
EVP_CIPHER_asn1_to_param
EVP_CIPHER_block_size
EVP_CIPHER_do_all
EVP_CIPHER_do_all_sorted
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
EVP_PBE_CipherInit
EVP_PBE_alg_add
EVP_PBE_alg_add_type
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
EVP_PKEY_CTX_free
EVP_PKEY_CTX_get0_peerkey
EVP_PKEY_CTX_get0_pkey
EVP_PKEY_CTX_get_app_data







<







1348
1349
1350
1351
1352
1353
1354

1355
1356
1357
1358
1359
1360
1361
EVP_PBE_CipherInit
EVP_PBE_alg_add
EVP_PBE_alg_add_type
EVP_PBE_cleanup
EVP_PBE_find
EVP_PKCS82PKEY
EVP_PKEY2PKCS8

EVP_PKEY_CTX_ctrl
EVP_PKEY_CTX_ctrl_str
EVP_PKEY_CTX_dup
EVP_PKEY_CTX_free
EVP_PKEY_CTX_get0_peerkey
EVP_PKEY_CTX_get0_pkey
EVP_PKEY_CTX_get_app_data
2187
2188
2189
2190
2191
2192
2193

2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
PKCS7_verify
PKCS8_PRIV_KEY_INFO_free
PKCS8_PRIV_KEY_INFO_it
PKCS8_PRIV_KEY_INFO_new
PKCS8_add_keyusage
PKCS8_decrypt
PKCS8_encrypt

PKCS8_pkey_get0
PKCS8_pkey_set0
PKCS8_set_broken
PKEY_USAGE_PERIOD_free
PKEY_USAGE_PERIOD_it
PKEY_USAGE_PERIOD_new
POLICYINFO_free
POLICYINFO_it
POLICYINFO_new
POLICYQUALINFO_free







>

|
|







2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
PKCS7_verify
PKCS8_PRIV_KEY_INFO_free
PKCS8_PRIV_KEY_INFO_it
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
PKEY_USAGE_PERIOD_free
PKEY_USAGE_PERIOD_it
PKEY_USAGE_PERIOD_new
POLICYINFO_free
POLICYINFO_it
POLICYINFO_new
POLICYQUALINFO_free
2268
2269
2270
2271
2272
2273
2274

2275

2276
2277
2278
2279
2280
2281
2282
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_new

RSA_meth_set_finish
RSA_meth_set_priv_dec
RSA_meth_set_priv_enc
RSA_new
RSA_new_method
RSA_padding_add_PKCS1_OAEP
RSA_padding_add_PKCS1_PSS







>

>







2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
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
RSA_padding_add_PKCS1_PSS
2666
2667
2668
2669
2670
2671
2672

2673
2674
2675
2676
2677
2678


2679

2680

2681
2682
2683
2684
2685
2686
2687
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_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_meth_data

X509_CRL_get_signature_nid

X509_CRL_it
X509_CRL_match
X509_CRL_new
X509_CRL_print
X509_CRL_print_fp
X509_CRL_set1_lastUpdate
X509_CRL_set1_nextUpdate







>






>
>

>

>







2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
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
2813
2814
2815
2816
2817
2818
2819


2820
2821
2822
2823
2824
2825
2826
X509_REQ_get_attr_by_NID
X509_REQ_get_attr_by_OBJ
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_it
X509_REQ_new
X509_REQ_print
X509_REQ_print_ex
X509_REQ_print_fp
X509_REQ_set_extension_nids
X509_REQ_set_pubkey







>
>







2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
X509_REQ_get_attr_by_NID
X509_REQ_get_attr_by_OBJ
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
X509_REQ_print_ex
X509_REQ_print_fp
X509_REQ_set_extension_nids
X509_REQ_set_pubkey
3003
3004
3005
3006
3007
3008
3009

3010
3011

3012

3013
3014
3015
3016
3017
3018
3019
X509_get_ext_by_OBJ
X509_get_ext_by_critical
X509_get_ext_count
X509_get_ext_d2i
X509_get_issuer_name
X509_get_pubkey
X509_get_pubkey_parameters

X509_get_serialNumber
X509_get_signature_nid

X509_get_subject_name

X509_getm_notAfter
X509_getm_notBefore
X509_gmtime_adj
X509_issuer_and_serial_cmp
X509_issuer_and_serial_hash
X509_issuer_name_cmp
X509_issuer_name_hash







>


>

>







3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
X509_get_ext_by_OBJ
X509_get_ext_by_critical
X509_get_ext_count
X509_get_ext_d2i
X509_get_issuer_name
X509_get_pubkey
X509_get_pubkey_parameters
X509_get0_serialNumber
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
X509_issuer_name_cmp
X509_issuer_name_hash
Changes to jni/libressl/crypto/dh/dh_ameth.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: dh_ameth.c,v 1.14 2017/01/29 17:49:22 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

static int
dh_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
{
	const unsigned char *p, *pm;
	int pklen, pmlen;
	int ptype;
	void *pval;
	ASN1_STRING *pstr;
	X509_ALGOR *palg;
	ASN1_INTEGER *public_key = NULL;
	DH *dh = NULL;

	if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
		return 0;
	X509_ALGOR_get0(NULL, &ptype, &pval, palg);







|
|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

static int
dh_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
{
	const unsigned char *p, *pm;
	int pklen, pmlen;
	int ptype;
	const void *pval;
	const ASN1_STRING *pstr;
	X509_ALGOR *palg;
	ASN1_INTEGER *public_key = NULL;
	DH *dh = NULL;

	if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
		return 0;
	X509_ALGOR_get0(NULL, &ptype, &pval, palg);
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/*
 * PKCS#8 DH is defined in PKCS#11 of all places. It is similar to DH in
 * that the AlgorithmIdentifier contains the paramaters, the private key
 * is explcitly included and the pubkey must be recalculated.
 */
	
static int
dh_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
{
	const unsigned char *p, *pm;
	int pklen, pmlen;
	int ptype;
	void *pval;
	ASN1_STRING *pstr;
	X509_ALGOR *palg;
	ASN1_INTEGER *privkey = NULL;
	DH *dh = NULL;

	if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8))
		return 0;

	X509_ALGOR_get0(NULL, &ptype, &pval, palg);







|




|
|
|







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/*
 * PKCS#8 DH is defined in PKCS#11 of all places. It is similar to DH in
 * that the AlgorithmIdentifier contains the paramaters, the private key
 * is explcitly included and the pubkey must be recalculated.
 */
	
static int
dh_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8)
{
	const unsigned char *p, *pm;
	int pklen, pmlen;
	int ptype;
	const void *pval;
	const ASN1_STRING *pstr;
	const X509_ALGOR *palg;
	ASN1_INTEGER *privkey = NULL;
	DH *dh = NULL;

	if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8))
		return 0;

	X509_ALGOR_get0(NULL, &ptype, &pval, palg);
Changes to jni/libressl/crypto/dh/dh_key.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: dh_key.c,v 1.27.2.1 2018/06/13 15:13:30 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.
 * 
|







1
2
3
4
5
6
7
8
/* $OpenBSD: dh_key.c,v 1.29 2018/06/12 15:33:18 sthen 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.
 * 
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210

	ctx = BN_CTX_new();
	if (ctx == NULL)
		goto err;
	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;
	}

	if (dh->flags & DH_FLAG_CACHE_MONT_P) {
		mont = BN_MONT_CTX_set_locked(&dh->method_mont_p,







|







196
197
198
199
200
201
202
203
204
205
206
207
208
209
210

	ctx = BN_CTX_new();
	if (ctx == NULL)
		goto err;
	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;
	}

	if (dh->flags & DH_FLAG_CACHE_MONT_P) {
		mont = BN_MONT_CTX_set_locked(&dh->method_mont_p,
Changes to jni/libressl/crypto/dh/dh_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: dh_lib.c,v 1.30.2.1 2018/05/02 16:57:35 tb 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
	 */
        const DH_METHOD *mtmp;

        mtmp = dh->meth;
        if (mtmp->finish)
		mtmp->finish(dh);
#ifndef OPENSSL_NO_ENGINE
	if (dh->engine) {
		ENGINE_finish(dh->engine);
		dh->engine = NULL;
	}
#endif
        dh->meth = meth;
        if (meth->init)
		meth->init(dh);
        return 1;
}








<
|
|
<







94
95
96
97
98
99
100

101
102

103
104
105
106
107
108
109
	 */
        const DH_METHOD *mtmp;

        mtmp = dh->meth;
        if (mtmp->finish)
		mtmp->finish(dh);
#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(dh->engine);
	dh->engine = NULL;

#endif
        dh->meth = meth;
        if (meth->init)
		meth->init(dh);
        return 1;
}

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
			return NULL;
		}
		ret->engine = engine;
	} else
		ret->engine = ENGINE_get_default_DH();
	if(ret->engine) {
		ret->meth = ENGINE_get_DH(ret->engine);
		if (!ret->meth) {
			DHerror(ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
		}
	}
#endif







|







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
			return NULL;
		}
		ret->engine = engine;
	} else
		ret->engine = ENGINE_get_default_DH();
	if(ret->engine) {
		ret->meth = ENGINE_get_DH(ret->engine);
		if (ret->meth == NULL) {
			DHerror(ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
		}
	}
#endif
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
	ret->counter = NULL;
	ret->method_mont_p=NULL;
	ret->references = 1;
	ret->flags = ret->meth->flags & ~DH_FLAG_NON_FIPS_ALLOW;
	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);
#endif
		CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data);
		free(ret);
		ret = NULL;
	}
	return ret;
}







<
|







160
161
162
163
164
165
166

167
168
169
170
171
172
173
174
	ret->counter = NULL;
	ret->method_mont_p=NULL;
	ret->references = 1;
	ret->flags = ret->meth->flags & ~DH_FLAG_NON_FIPS_ALLOW;
	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

		ENGINE_finish(ret->engine);
#endif
		CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data);
		free(ret);
		ret = NULL;
	}
	return ret;
}
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
	i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH);
	if (i > 0)
		return;

	if (r->meth->finish)
		r->meth->finish(r);
#ifndef OPENSSL_NO_ENGINE
	if (r->engine)
		ENGINE_finish(r->engine);
#endif

	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);

	BN_clear_free(r->p);
	BN_clear_free(r->g);
	BN_clear_free(r->q);







<
|







183
184
185
186
187
188
189

190
191
192
193
194
195
196
197
	i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH);
	if (i > 0)
		return;

	if (r->meth->finish)
		r->meth->finish(r);
#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(r->engine);
#endif

	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);

	BN_clear_free(r->p);
	BN_clear_free(r->g);
	BN_clear_free(r->q);
Changes to jni/libressl/crypto/dsa/dsa_ameth.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: dsa_ameth.c,v 1.23 2017/01/29 17:49:22 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: dsa_ameth.c,v 1.26 2018/08/24 20:22:15 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

static int
dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
{
	const unsigned char *p, *pm;
	int pklen, pmlen;
	int ptype;
	void *pval;
	ASN1_STRING *pstr;
	X509_ALGOR *palg;
	ASN1_INTEGER *public_key = NULL;

	DSA *dsa = NULL;

	if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
		return 0;







|
|







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

static int
dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
{
	const unsigned char *p, *pm;
	int pklen, pmlen;
	int ptype;
	const void *pval;
	const ASN1_STRING *pstr;
	X509_ALGOR *palg;
	ASN1_INTEGER *public_key = NULL;

	DSA *dsa = NULL;

	if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
		return 0;
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
	return 0;
}

/* In PKCS#8 DSA: you just get a private key integer and parameters in the
 * AlgorithmIdentifier the pubkey must be recalculated.
 */
static int
dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
{
	const unsigned char *p, *pm;
	int pklen, pmlen;
	int ptype;
	void *pval;
	ASN1_STRING *pstr;
	X509_ALGOR *palg;
	ASN1_INTEGER *privkey = NULL;
	BN_CTX *ctx = NULL;
	DSA *dsa = NULL;

	int ret = 0;

	if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8))







|




|
|
|







175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
	return 0;
}

/* In PKCS#8 DSA: you just get a private key integer and parameters in the
 * AlgorithmIdentifier the pubkey must be recalculated.
 */
static int
dsa_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8)
{
	const unsigned char *p, *pm;
	int pklen, pmlen;
	int ptype;
	const void *pval;
	const ASN1_STRING *pstr;
	const X509_ALGOR *palg;
	ASN1_INTEGER *privkey = NULL;
	BN_CTX *ctx = NULL;
	DSA *dsa = NULL;

	int ret = 0;

	if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8))
Changes to jni/libressl/crypto/dsa/dsa_asn1.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: dsa_asn1.c,v 1.21 2018/02/20 17:48:35 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 2000-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2000-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* Override the default new methods */
static int
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) {
			DSAerror(ERR_R_MALLOC_FAILURE);
			return 0;
		}
		sig->r = NULL;
		sig->s = NULL;
		*pval = (ASN1_VALUE *)sig;
		return 2;
	}
	return 1;
}

static const ASN1_AUX DSA_SIG_aux = {







|
<



<
<







67
68
69
70
71
72
73
74

75
76
77


78
79
80
81
82
83
84
/* Override the default new methods */
static int
sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
{
	if (operation == ASN1_OP_NEW_PRE) {
		DSA_SIG *sig;

		if ((sig = DSA_SIG_new()) == NULL) {

			DSAerror(ERR_R_MALLOC_FAILURE);
			return 0;
		}


		*pval = (ASN1_VALUE *)sig;
		return 2;
	}
	return 1;
}

static const ASN1_AUX DSA_SIG_aux = {
Changes to jni/libressl/crypto/dsa/dsa_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: dsa_lib.c,v 1.28 2018/02/20 17:52:27 tb 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
	 * to deal with which ENGINE it comes from.
	 */
        const DSA_METHOD *mtmp;
        mtmp = dsa->meth;
        if (mtmp->finish)
		mtmp->finish(dsa);
#ifndef OPENSSL_NO_ENGINE
	if (dsa->engine) {
		ENGINE_finish(dsa->engine);
		dsa->engine = NULL;
	}
#endif
        dsa->meth = meth;
        if (meth->init)
		meth->init(dsa);
        return 1;
}








<
|
|
<







104
105
106
107
108
109
110

111
112

113
114
115
116
117
118
119
	 * to deal with which ENGINE it comes from.
	 */
        const DSA_METHOD *mtmp;
        mtmp = dsa->meth;
        if (mtmp->finish)
		mtmp->finish(dsa);
#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(dsa->engine);
	dsa->engine = NULL;

#endif
        dsa->meth = meth;
        if (meth->init)
		meth->init(dsa);
        return 1;
}

138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
			return NULL;
		}
		ret->engine = engine;
	} else
		ret->engine = ENGINE_get_default_DSA();
	if (ret->engine) {
		ret->meth = ENGINE_get_DSA(ret->engine);
		if (!ret->meth) {
			DSAerror(ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
		}
	}
#endif







|







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
			return NULL;
		}
		ret->engine = engine;
	} else
		ret->engine = ENGINE_get_default_DSA();
	if (ret->engine) {
		ret->meth = ENGINE_get_DSA(ret->engine);
		if (ret->meth == NULL) {
			DSAerror(ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
		}
	}
#endif
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
	ret->method_mont_p = NULL;

	ret->references = 1;
	ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
	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);
#endif
		CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data);
		free(ret);
		ret = NULL;
	}
	
	return ret;







<
|







164
165
166
167
168
169
170

171
172
173
174
175
176
177
178
	ret->method_mont_p = NULL;

	ret->references = 1;
	ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
	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

		ENGINE_finish(ret->engine);
#endif
		CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data);
		free(ret);
		ret = NULL;
	}
	
	return ret;
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
	i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DSA);
	if (i > 0)
		return;

	if (r->meth->finish)
		r->meth->finish(r);
#ifndef OPENSSL_NO_ENGINE
	if (r->engine)
		ENGINE_finish(r->engine);
#endif

	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);

	BN_clear_free(r->p);
	BN_clear_free(r->q);
	BN_clear_free(r->g);







<
|







189
190
191
192
193
194
195

196
197
198
199
200
201
202
203
	i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DSA);
	if (i > 0)
		return;

	if (r->meth->finish)
		r->meth->finish(r);
#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(r->engine);
#endif

	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);

	BN_clear_free(r->p);
	BN_clear_free(r->q);
	BN_clear_free(r->g);
Changes to jni/libressl/crypto/dsa/dsa_ossl.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: dsa_ossl.c,v 1.30.2.1 2018/06/13 15:08: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.
 * 
|







1
2
3
4
5
6
7
8
/* $OpenBSD: dsa_ossl.c,v 1.37 2018/06/14 18:34:50 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.
 * 
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106



107
108
109
110
111
112
113
114
115
116
117
118











119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135









136
137



138

139
140
141
142




143
144


145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163





164
165
166
167
168
169
170
171
172
173
174


175

176

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192


193
194
195
196
197
198
199
200
201







202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225




226
227
228
229
230
231

232
233
234
235
236
237
238
239
240

241
242
243
244
245
246
247
248
249
250
251
252
253
254
255

256

257
258
259
260
261
262
263
264



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
#include <openssl/err.h>
#include <openssl/sha.h>

#include "bn_lcl.h"

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);
static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
	    DSA *dsa);
static int dsa_init(DSA *dsa);
static int dsa_finish(DSA *dsa);

static DSA_METHOD openssl_dsa_meth = {
	.name = "OpenSSL DSA method",
	.dsa_do_sign = dsa_do_sign,
	.dsa_sign_setup = dsa_sign_setup,
	.dsa_do_verify = dsa_do_verify,
	.init = dsa_init,
	.finish = dsa_finish
};

const DSA_METHOD *
DSA_OpenSSL(void)
{
	return &openssl_dsa_meth;
}

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;
	BN_CTX *ctx = NULL;
	int reason = ERR_R_BN_LIB;
	DSA_SIG *ret = NULL;
	int noredo = 0;

	BN_init(&m);
	BN_init(&xr);




	if (!dsa->p || !dsa->q || !dsa->g) {
		reason = DSA_R_MISSING_PARAMETERS;
		goto err;
	}

	s = BN_new();
	if (s == NULL)
		goto err;
	ctx = BN_CTX_new();
	if (ctx == NULL)
		goto err;











redo:
	if (dsa->kinv == NULL || dsa->r == NULL) {
		if (!DSA_sign_setup(dsa, ctx, &kinv, &r))
			goto err;
	} else {
		kinv = dsa->kinv;
		dsa->kinv = NULL;
		r = dsa->r;
		dsa->r = NULL;
		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









	 */
	if (dlen > BN_num_bytes(dsa->q))



		dlen = BN_num_bytes(dsa->q);

	if (BN_bin2bn(dgst,dlen,&m) == 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 */
		goto err;


	if (!BN_mod_add(s, &xr, &m, 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.
	 */
	if (BN_is_zero(r) || BN_is_zero(s)) {
		if (noredo) {
			reason = DSA_R_NEED_NEW_SETUP_VALUES;
			goto err;
		}
		goto redo;
	}





	ret->r = r;
	ret->s = s;
	
err:
	if (!ret) {
		DSAerror(reason);
		BN_free(r);
		BN_free(s);
	}
	BN_CTX_free(ctx);
	BN_clear_free(&m);


	BN_clear_free(&xr);

	BN_clear_free(kinv);

	return ret;
}

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;

	if (!dsa->p || !dsa->q || !dsa->g) {
		DSAerror(DSA_R_MISSING_PARAMETERS);
		return 0;
	}

	BN_init(&k);



	if (ctx_in == NULL) {
		if ((ctx = BN_CTX_new()) == NULL)
			goto err;
	} else
		ctx = ctx_in;

	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));

	BN_set_flags(&k, BN_FLG_CONSTTIME);

	if (dsa->flags & DSA_FLAG_CACHE_MONT_P) {
		if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p,
		    CRYPTO_LOCK_DSA, dsa->p, ctx))
			goto err;
	}

	/* Compute r = (g^k mod p) mod q */

	/*
	 * We do not want timing information to leak the length of k,
	 * so we compute g^k using an equivalent exponent of fixed
	 * length.
	 *
	 * (This is a kludge that we need because the BN_mod_exp_mont()
	 * does not let us specify the desired timing behaviour.)




	 */

	if (!BN_add(&k, &k, dsa->q))
		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))
			goto err;
	} else {
		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))
		goto err;

	/* Compute  part of 's = inv(k) (m + xr) mod q' */
	if ((kinv = BN_mod_inverse_ct(NULL, &k, dsa->q, ctx)) == NULL)
		goto err;

	BN_clear_free(*kinvp);
	*kinvp = kinv;
	kinv = NULL;
	BN_clear_free(*rp);
	*rp = r;

	ret = 1;

err:
	if (!ret) {
		DSAerror(ERR_R_BN_LIB);
		BN_clear_free(r);
	}
	if (ctx_in == NULL)
		BN_CTX_free(ctx);
	BN_clear_free(&k);



	return ret;
}

static int
dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa)
{
	BN_CTX *ctx;
	BIGNUM u1, u2, t1;
	BN_MONT_CTX *mont = NULL;
	int ret = -1, i;

	if (!dsa->p || !dsa->q || !dsa->g) {
		DSAerror(DSA_R_MISSING_PARAMETERS);
		return -1;
	}

	i = BN_num_bits(dsa->q);
	/* fips 186-3 allows only different sizes for q */
	if (i != 160 && i != 224 && i != 256) {
		DSAerror(DSA_R_BAD_Q_VALUE);
		return -1;
	}

	if (BN_num_bits(dsa->p) > OPENSSL_DSA_MAX_MODULUS_BITS) {
		DSAerror(DSA_R_MODULUS_TOO_LARGE);







|

|









|











|
<
<





|
|
>
>
>












>
>
>
>
>
>
>
>
>
>
>
|











<

<
<
|
>
>
>
>
>
>
>
>
>

|
>
>
>
|
>
|


<
>
>
>
>
|

>
>
|




<
<
<

|
|








>
>
>
>
>



|






|
>
>
|
>

>







|
|







>
>









>
>
>
>
>
>
>



















|
|

|
|
>
>
>
>


|
<
<
|
>
|
<



|


|
>



|











>

>
|







>
>
>

















|







66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97


98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142

143


144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163

164
165
166
167
168
169
170
171
172
173
174
175
176



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274


275
276
277

278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
#include <openssl/err.h>
#include <openssl/sha.h>

#include "bn_lcl.h"

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);
static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
    DSA *dsa);
static int dsa_init(DSA *dsa);
static int dsa_finish(DSA *dsa);

static DSA_METHOD openssl_dsa_meth = {
	.name = "OpenSSL DSA method",
	.dsa_do_sign = dsa_do_sign,
	.dsa_sign_setup = dsa_sign_setup,
	.dsa_do_verify = dsa_do_verify,
	.init = dsa_init,
	.finish = dsa_finish,
};

const DSA_METHOD *
DSA_OpenSSL(void)
{
	return &openssl_dsa_meth;
}

static DSA_SIG *
dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
{
	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);

	if (!dsa->p || !dsa->q || !dsa->g) {
		reason = DSA_R_MISSING_PARAMETERS;
		goto err;
	}

	s = BN_new();
	if (s == NULL)
		goto err;
	ctx = BN_CTX_new();
	if (ctx == NULL)
		goto err;

	/*
	 * 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;
	} else {
		kinv = dsa->kinv;
		dsa->kinv = NULL;
		r = dsa->r;
		dsa->r = NULL;
		noredo = 1;
	}


	/*


	 * 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-1].
	 */
	if (!BN_sub(&bm, dsa->q, BN_value_one()))
		goto err;
	if (!BN_rand_range(&b, &bm))
		goto err;
	if (!BN_add(&b, &b, BN_value_one()))
		goto err;
	if (BN_mod_inverse_ct(&binv, &b, dsa->q, ctx) == NULL)
		goto err;


	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, &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;




	/*
	 * 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) {
			reason = DSA_R_NEED_NEW_SETUP_VALUES;
			goto err;
		}
		goto redo;
	}

	if ((ret = DSA_SIG_new()) == NULL) {
		reason = ERR_R_MALLOC_FAILURE;
		goto err;
	}
	ret->r = r;
	ret->s = s;
	
 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(kinv);

	return ret;
}

static int
dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
{
	BN_CTX *ctx;
	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);
		return 0;
	}

	BN_init(&k);
	BN_init(&l);
	BN_init(&m);

	if (ctx_in == NULL) {
		if ((ctx = BN_CTX_new()) == NULL)
			goto err;
	} else
		ctx = ctx_in;

	if ((r = BN_new()) == NULL)
		goto err;

	/* 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;

	/* Get random k */
	do {
		if (!BN_rand_range(&k, dsa->q))
			goto err;
	} while (BN_is_zero(&k));

	BN_set_flags(&k, BN_FLG_CONSTTIME);

	if (dsa->flags & DSA_FLAG_CACHE_MONT_P) {
		if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p,
		    CRYPTO_LOCK_DSA, dsa->p, ctx))
			goto err;
	}

	/* Compute r = (g^k mod p) mod q */

	/*
	 * We do not want timing information to leak the length of k,
	 * 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.
	 *
	 * TODO: revisit the BN_copy aiming for a memory access agnostic
	 * conditional copy.
	 */

	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 (dsa->meth->bn_mod_exp != NULL) {
		if (!dsa->meth->bn_mod_exp(dsa, r, dsa->g, &k, dsa->p, ctx,
		    dsa->method_mont_p))
			goto err;
	} else {
		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))
		goto err;

	/* Compute  part of 's = inv(k) (m + xr) mod q' */
	if ((kinv = BN_mod_inverse_ct(NULL, &k, dsa->q, ctx)) == NULL)
		goto err;

	BN_clear_free(*kinvp);
	*kinvp = kinv;
	kinv = NULL;
	BN_clear_free(*rp);
	*rp = r;

	ret = 1;

 err:
	if (!ret) {
		DSAerror(ERR_R_BN_LIB);
		BN_clear_free(r);
	}
	if (ctx_in == NULL)
		BN_CTX_free(ctx);
	BN_clear_free(&k);
	BN_clear_free(&l);
	BN_clear_free(&m);

	return ret;
}

static int
dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa)
{
	BN_CTX *ctx;
	BIGNUM u1, u2, t1;
	BN_MONT_CTX *mont = NULL;
	int ret = -1, i;

	if (!dsa->p || !dsa->q || !dsa->g) {
		DSAerror(DSA_R_MISSING_PARAMETERS);
		return -1;
	}

	i = BN_num_bits(dsa->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;
	}

	if (BN_num_bits(dsa->p) > OPENSSL_DSA_MAX_MODULUS_BITS) {
		DSAerror(DSA_R_MODULUS_TOO_LARGE);
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322


323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367

368
369
370
371
372
373
374
	}
	if (BN_is_zero(sig->s) || BN_is_negative(sig->s) ||
	    BN_ucmp(sig->s, dsa->q) >= 0) {
		ret = 0;
		goto err;
	}

	/* Calculate W = inv(S) mod Q
	 * save 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
	 */
	if (dgst_len > (i >> 3))
		dgst_len = (i >> 3);


	if (BN_bin2bn(dgst, dgst_len, &u1) == NULL)
		goto err;

	/* u1 = M * w mod q */
	if (!BN_mod_mul(&u1, &u1, &u2, dsa->q, ctx))
		goto err;

	/* u2 = r * w mod q */
	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);
		if (!mont)
			goto err;
	}

	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))
			goto err;
	} else {
		if (!BN_mod_exp2_mont(&t1, dsa->g, &u1, dsa->pub_key, &u2, dsa->p, ctx,
						mont))
			goto err;
	}

	/* BN_copy(&u1,&t1); */
	/* let u1 = u1 mod q */
	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. */
	ret = BN_ucmp(&u1, sig->r) == 0;

err:
	if (ret < 0)
		DSAerror(ERR_R_BN_LIB);
	BN_CTX_free(ctx);
	BN_free(&u1);
	BN_free(&u2);
	BN_free(&t1);

	return ret;
}

static int
dsa_init(DSA *dsa)
{
	dsa->flags |= DSA_FLAG_CACHE_MONT_P;







|
<



<


|
<



>
>



|






<









|
|


|
|








|
<


|






>







353
354
355
356
357
358
359
360

361
362
363

364
365
366

367
368
369
370
371
372
373
374
375
376
377
378
379
380
381

382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405

406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
	}
	if (BN_is_zero(sig->s) || BN_is_negative(sig->s) ||
	    BN_ucmp(sig->s, dsa->q) >= 0) {
		ret = 0;
		goto err;
	}

	/* Calculate w = inv(s) mod q, saving w in u2. */

	if ((BN_mod_inverse_ct(&u2, sig->s, dsa->q, ctx)) == NULL)
		goto err;


	/*
	 * 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.

	 */
	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 */
	if (!BN_mod_mul(&u1, &u1, &u2, dsa->q, ctx))
		goto err;

	/* u2 = r * w mod q */
	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);
		if (!mont)
			goto err;
	}

	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))
			goto err;
	} else {
		if (!BN_mod_exp2_mont(&t1, dsa->g, &u1, dsa->pub_key, &u2,
		    dsa->p, ctx, mont))
			goto err;
	}

	/* BN_copy(&u1,&t1); */
	/* let u1 = u1 mod q */
	if (!BN_mod_ct(&u1, &t1, dsa->q, ctx))
		goto err;

	/* v is in u1 - if the signature is correct, it will be equal to r. */

	ret = BN_ucmp(&u1, sig->r) == 0;

 err:
	if (ret < 0)
		DSAerror(ERR_R_BN_LIB);
	BN_CTX_free(ctx);
	BN_free(&u1);
	BN_free(&u2);
	BN_free(&t1);

	return ret;
}

static int
dsa_init(DSA *dsa)
{
	dsa->flags |= DSA_FLAG_CACHE_MONT_P;
Changes to jni/libressl/crypto/dsa/dsa_sign.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: dsa_sign.c,v 1.19 2014/10/18 17:20:40 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
	return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, 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;
}

void
DSA_SIG_free(DSA_SIG *sig)
{
	if (sig) {
		BN_free(sig->r);
		BN_free(sig->s);
		free(sig);
	}
}







<
<
|
<
<
<
<
<





|





72
73
74
75
76
77
78


79





80
81
82
83
84
85
86
87
88
89
90
{
	return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
}

DSA_SIG *
DSA_SIG_new(void)
{


	return calloc(1, sizeof(DSA_SIG));





}

void
DSA_SIG_free(DSA_SIG *sig)
{
	if (sig != NULL) {
		BN_free(sig->r);
		BN_free(sig->s);
		free(sig);
	}
}
Changes to jni/libressl/crypto/dso/dso_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: dso_lib.c,v 1.19 2017/01/29 17:49:23 beck Exp $ */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
170
171
172
173
174
175
176


177
178
179
180
181
182
183
184
185
186
187
188
189
190
	return ((dso == NULL) ? 0 : dso->flags);
}


int
DSO_up_ref(DSO *dso)
{


	if (dso == NULL) {
		DSOerror(ERR_R_PASSED_NULL_PARAMETER);
		return (0);
	}

	CRYPTO_add(&dso->references, 1, CRYPTO_LOCK_DSO);
	return (1);
}

DSO *
DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags)
{
	DSO *ret;
	int allocated = 0;







>
>





|
|







170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
	return ((dso == NULL) ? 0 : dso->flags);
}


int
DSO_up_ref(DSO *dso)
{
	int refs;

	if (dso == NULL) {
		DSOerror(ERR_R_PASSED_NULL_PARAMETER);
		return (0);
	}

	refs = CRYPTO_add(&dso->references, 1, CRYPTO_LOCK_DSO);
	return ((refs > 1) ? 1 : 0);
}

DSO *
DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags)
{
	DSO *ret;
	int allocated = 0;
Changes to jni/libressl/crypto/ec/ec2_mult.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec2_mult.c,v 1.9 2017/01/29 17:49:23 beck Exp $ */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ec2_mult.c,v 1.13 2018/07/23 18:24:22 tb Exp $ */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
67
68
69
70
71
72
73

74
75
76
77
78
79
80
 *
 */

#include <openssl/opensslconf.h>

#include <openssl/err.h>


#include "ec_lcl.h"

#ifndef OPENSSL_NO_EC2M


/* Compute the x-coordinate x/z for the point 2*(x/z) in Montgomery projective
 * coordinates.







>







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
 *
 */

#include <openssl/opensslconf.h>

#include <openssl/err.h>

#include "bn_lcl.h"
#include "ec_lcl.h"

#ifndef OPENSSL_NO_EC2M


/* Compute the x-coordinate x/z for the point 2*(x/z) in Montgomery projective
 * coordinates.
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
	if (!group->meth->field_mul(group, t1, &group->b, t1, ctx))
		goto err;
	if (!BN_GF2m_add(x, x, t1))
		goto err;

	ret = 1;

err:
	BN_CTX_end(ctx);
	return ret;
}

/* Compute the x-coordinate x1/z1 for the point (x1/z1)+(x2/x2) in Montgomery
 * projective coordinates.
 * Uses algorithm Madd in appendix of







|







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
	if (!group->meth->field_mul(group, t1, &group->b, t1, ctx))
		goto err;
	if (!BN_GF2m_add(x, x, t1))
		goto err;

	ret = 1;

 err:
	BN_CTX_end(ctx);
	return ret;
}

/* Compute the x-coordinate x1/z1 for the point (x1/z1)+(x2/x2) in Montgomery
 * projective coordinates.
 * Uses algorithm Madd in appendix of
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
	if (!group->meth->field_mul(group, x1, z1, t1, ctx))
		goto err;
	if (!BN_GF2m_add(x1, x1, t2))
		goto err;

	ret = 1;

err:
	BN_CTX_end(ctx);
	return ret;
}

/* Compute the x, y affine coordinates from the point (x1, z1) (x2, z2)
 * using Montgomery point multiplication algorithm Mxy() in appendix of
 *     Lopez, J. and Dahab, R.  "Fast multiplication on elliptic curves over







|







152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
	if (!group->meth->field_mul(group, x1, z1, t1, ctx))
		goto err;
	if (!BN_GF2m_add(x1, x1, t2))
		goto err;

	ret = 1;

 err:
	BN_CTX_end(ctx);
	return ret;
}

/* Compute the x, y affine coordinates from the point (x1, z1) (x2, z2)
 * using Montgomery point multiplication algorithm Mxy() in appendix of
 *     Lopez, J. and Dahab, R.  "Fast multiplication on elliptic curves over
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
	if (!group->meth->field_mul(group, z2, z2, t4, ctx))
		goto err;
	if (!BN_GF2m_add(z2, z2, y))
		goto err;

	ret = 2;

err:
	BN_CTX_end(ctx);
	return ret;
}


/* Computes scalar*point and stores the result in r.
 * point can not equal r.







|







240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
	if (!group->meth->field_mul(group, z2, z2, t4, ctx))
		goto err;
	if (!BN_GF2m_add(z2, z2, y))
		goto err;

	ret = 2;

 err:
	BN_CTX_end(ctx);
	return ret;
}


/* Computes scalar*point and stores the result in r.
 * point can not equal r.
320
321
322
323
324
325
326
327

328

329
330
331
332
333

334

335
336
337
338
339
340
341
	if (!mask) {
		i--;
		mask = BN_TBIT;
	}
	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 (!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);

			mask >>= 1;
		}
		mask = BN_TBIT;
	}

	/* convert out of "projective" coordinates */
	i = gf2m_Mxy(group, &point->X, &point->Y, x1, z1, x2, z2, ctx);







|
>
|
>




|
>
|
>







321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
	if (!mask) {
		i--;
		mask = BN_TBIT;
	}
	for (; i >= 0; i--) {
		word = scalar->d[i];
		while (mask) {
			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;
			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;
	}

	/* convert out of "projective" coordinates */
	i = gf2m_Mxy(group, &point->X, &point->Y, x1, z1, x2, z2, ctx);
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366

	/* GF(2^m) field elements should always have BIGNUM::neg = 0 */
	BN_set_negative(&r->X, 0);
	BN_set_negative(&r->Y, 0);

	ret = 1;

err:
	BN_CTX_end(ctx);
	return ret;
}


/* Computes the sum
 *     scalar*group->generator + scalars[0]*points[0] + ... + scalars[num-1]*points[num-1]







|







357
358
359
360
361
362
363
364
365
366
367
368
369
370
371

	/* GF(2^m) field elements should always have BIGNUM::neg = 0 */
	BN_set_negative(&r->X, 0);
	BN_set_negative(&r->Y, 0);

	ret = 1;

 err:
	BN_CTX_end(ctx);
	return ret;
}


/* Computes the sum
 *     scalar*group->generator + scalars[0]*points[0] + ... + scalars[num-1]*points[num-1]
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
	}

	if (!EC_POINT_copy(r, acc))
		goto err;

	ret = 1;

err:
	EC_POINT_free(p);
	EC_POINT_free(acc);
	BN_CTX_free(new_ctx);
	return ret;
}









|







425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
	}

	if (!EC_POINT_copy(r, acc))
		goto err;

	ret = 1;

 err:
	EC_POINT_free(p);
	EC_POINT_free(acc);
	BN_CTX_free(new_ctx);
	return ret;
}


Changes to jni/libressl/crypto/ec/ec2_oct.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec2_oct.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ec2_oct.c,v 1.11 2018/07/15 16:27:39 tb Exp $ */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
	}

	if (!EC_POINT_set_affine_coordinates_GF2m(group, point, x, y, ctx))
		goto err;

	ret = 1;

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


/* Converts an EC_POINT to an octet string.







|







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
	}

	if (!EC_POINT_set_affine_coordinates_GF2m(group, point, x, y, ctx))
		goto err;

	ret = 1;

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


/* Converts an EC_POINT to an octet string.
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
		}
	}
	if (used_ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;

err:
	if (used_ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return 0;
}









|







268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
		}
	}
	if (used_ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;

 err:
	if (used_ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return 0;
}


370
371
372
373
374
375
376
377
378
379
380
381
382
	/* test required by X9.62 */
	if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
		ECerror(EC_R_POINT_IS_NOT_ON_CURVE);
		goto err;
	}
	ret = 1;

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}
#endif







|





370
371
372
373
374
375
376
377
378
379
380
381
382
	/* test required by X9.62 */
	if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
		ECerror(EC_R_POINT_IS_NOT_ON_CURVE);
		goto err;
	}
	ret = 1;

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}
#endif
Changes to jni/libressl/crypto/ec/ec2_smpl.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec2_smpl.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ec2_smpl.c,v 1.20 2018/07/16 17:32:39 tb Exp $ */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
		.dbl = ec_GF2m_simple_dbl,
		.invert = ec_GF2m_simple_invert,
		.is_at_infinity = ec_GF2m_simple_is_at_infinity,
		.is_on_curve = ec_GF2m_simple_is_on_curve,
		.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,
		.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,
	};

	return &ret;
}







|
<
<
|
<
|


<







103
104
105
106
107
108
109
110


111

112
113
114

115
116
117
118
119
120
121
		.dbl = ec_GF2m_simple_dbl,
		.invert = ec_GF2m_simple_invert,
		.is_at_infinity = ec_GF2m_simple_is_at_infinity,
		.is_on_curve = ec_GF2m_simple_is_on_curve,
		.point_cmp = ec_GF2m_simple_cmp,
		.make_affine = ec_GF2m_simple_make_affine,
		.points_make_affine = ec_GF2m_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,
		.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,
	};

	return &ret;
}
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
		goto err;
	if (bn_wexpand(&group->b, (int) (group->poly[0] + BN_BITS2 - 1) / BN_BITS2) == NULL)
		goto err;
	for (i = group->b.top; i < group->b.dmax; i++)
		group->b.d[i] = 0;

	ret = 1;
err:
	return ret;
}


/* Get the curve parameters of an EC_GROUP structure.
 * If p, a, or b are NULL then there values will not be set but the method will return with success.
 */







|







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
		goto err;
	if (bn_wexpand(&group->b, (int) (group->poly[0] + BN_BITS2 - 1) / BN_BITS2) == NULL)
		goto err;
	for (i = group->b.top; i < group->b.dmax; i++)
		group->b.d[i] = 0;

	ret = 1;
 err:
	return ret;
}


/* Get the curve parameters of an EC_GROUP structure.
 * If p, a, or b are NULL then there values will not be set but the method will return with success.
 */
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
	}
	if (b != NULL) {
		if (!BN_copy(b, &group->b))
			goto err;
	}
	ret = 1;

err:
	return ret;
}


/* Gets the degree of the field.  For a curve over GF(2^m) this is the value m. */
int 
ec_GF2m_simple_group_get_degree(const EC_GROUP * group)







|







252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
	}
	if (b != NULL) {
		if (!BN_copy(b, &group->b))
			goto err;
	}
	ret = 1;

 err:
	return ret;
}


/* Gets the degree of the field.  For a curve over GF(2^m) this is the value m. */
int 
ec_GF2m_simple_group_get_degree(const EC_GROUP * group)
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
	 * curve <=> b != 0 (mod p)
	 */
	if (BN_is_zero(b))
		goto err;

	ret = 1;

err:
	if (ctx != NULL)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}









|







298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
	 * curve <=> b != 0 (mod p)
	 */
	if (BN_is_zero(b))
		goto err;

	ret = 1;

 err:
	if (ctx != NULL)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
	BN_set_negative(&point->Y, 0);
	if (!BN_copy(&point->Z, BN_value_one()))
		goto err;
	BN_set_negative(&point->Z, 0);
	point->Z_is_one = 1;
	ret = 1;

err:
	return ret;
}


/* Gets the affine coordinates of an EC_POINT.
 * Note that the simple implementation only uses affine coordinates.
 */







|







390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
	BN_set_negative(&point->Y, 0);
	if (!BN_copy(&point->Z, BN_value_one()))
		goto err;
	BN_set_negative(&point->Z, 0);
	point->Z_is_one = 1;
	ret = 1;

 err:
	return ret;
}


/* Gets the affine coordinates of an EC_POINT.
 * Note that the simple implementation only uses affine coordinates.
 */
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
	if (y != NULL) {
		if (!BN_copy(y, &point->Y))
			goto err;
		BN_set_negative(y, 0);
	}
	ret = 1;

err:
	return ret;
}

/* Computes a + b and stores the result in r.  r could be a or b, a could be b.
 * Uses algorithm A.10.2 of IEEE P1363.
 */
int 







|







424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
	if (y != NULL) {
		if (!BN_copy(y, &point->Y))
			goto err;
		BN_set_negative(y, 0);
	}
	ret = 1;

 err:
	return ret;
}

/* Computes a + b and stores the result in r.  r could be a or b, a could be b.
 * Uses algorithm A.10.2 of IEEE P1363.
 */
int 
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
		goto err;

	if (!EC_POINT_set_affine_coordinates_GF2m(group, r, x2, y2, ctx))
		goto err;

	ret = 1;

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


/* Computes 2 * a and stores the result in r.  r could be a.







|







541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
		goto err;

	if (!EC_POINT_set_affine_coordinates_GF2m(group, r, x2, y2, ctx))
		goto err;

	ret = 1;

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


/* Computes 2 * a and stores the result in r.  r could be a.
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
	if (!BN_GF2m_add(lh, lh, &group->b))
		goto err;
	if (!field_sqr(group, y2, &point->Y, ctx))
		goto err;
	if (!BN_GF2m_add(lh, lh, y2))
		goto err;
	ret = BN_is_zero(lh);
err:
	if (ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}









|







633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
	if (!BN_GF2m_add(lh, lh, &group->b))
		goto err;
	if (!field_sqr(group, y2, &point->Y, ctx))
		goto err;
	if (!BN_GF2m_add(lh, lh, y2))
		goto err;
	ret = BN_is_zero(lh);
 err:
	if (ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


689
690
691
692
693
694
695
696
697
698
699
700
701
702
703

	if (!EC_POINT_get_affine_coordinates_GF2m(group, a, aX, aY, ctx))
		goto err;
	if (!EC_POINT_get_affine_coordinates_GF2m(group, b, bX, bY, ctx))
		goto err;
	ret = ((BN_cmp(aX, bX) == 0) && BN_cmp(aY, bY) == 0) ? 0 : 1;

err:
	if (ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}









|







685
686
687
688
689
690
691
692
693
694
695
696
697
698
699

	if (!EC_POINT_get_affine_coordinates_GF2m(group, a, aX, aY, ctx))
		goto err;
	if (!EC_POINT_get_affine_coordinates_GF2m(group, b, bX, bY, ctx))
		goto err;
	ret = ((BN_cmp(aX, bX) == 0) && BN_cmp(aY, bY) == 0) ? 0 : 1;

 err:
	if (ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
	if (!BN_copy(&point->Y, y))
		goto err;
	if (!BN_one(&point->Z))
		goto err;

	ret = 1;

err:
	if (ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}









|







726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
	if (!BN_copy(&point->Y, y))
		goto err;
	if (!BN_one(&point->Z))
		goto err;

	ret = 1;

 err:
	if (ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


Changes to jni/libressl/crypto/ec/ec_ameth.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec_ameth.c,v 1.19 2018/03/12 13:14:21 inoguchi Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
	p = penc;
	penclen = i2o_ECPublicKey(ec_key, &p);
	if (penclen <= 0)
		goto err;
	if (X509_PUBKEY_set0_param(pk, OBJ_nid2obj(EVP_PKEY_EC),
		ptype, pval, penc, penclen))
		return 1;
err:
	if (ptype == V_ASN1_OBJECT)
		ASN1_OBJECT_free(pval);
	else
		ASN1_STRING_free(pval);
	free(penc);
	return 0;
}

static EC_KEY *
eckey_type2param(int ptype, void *pval)
{
	EC_KEY *eckey = NULL;

	if (ptype == V_ASN1_SEQUENCE) {
		ASN1_STRING *pstr = pval;
		const unsigned char *pm = NULL;
		int pmlen;

		pm = pstr->data;
		pmlen = pstr->length;
		if (!(eckey = d2i_ECParameters(NULL, &pm, pmlen))) {
			ECerror(EC_R_DECODE_ERROR);
			goto ecerr;
		}
	} else if (ptype == V_ASN1_OBJECT) {
		ASN1_OBJECT *poid = pval;
		EC_GROUP *group;

		/*
		 * type == V_ASN1_OBJECT => the parameters are given by an
		 * asn1 OID
		 */
		if ((eckey = EC_KEY_new()) == NULL) {







|









|




|










|







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
	p = penc;
	penclen = i2o_ECPublicKey(ec_key, &p);
	if (penclen <= 0)
		goto err;
	if (X509_PUBKEY_set0_param(pk, OBJ_nid2obj(EVP_PKEY_EC),
		ptype, pval, penc, penclen))
		return 1;
 err:
	if (ptype == V_ASN1_OBJECT)
		ASN1_OBJECT_free(pval);
	else
		ASN1_STRING_free(pval);
	free(penc);
	return 0;
}

static EC_KEY *
eckey_type2param(int ptype, const void *pval)
{
	EC_KEY *eckey = NULL;

	if (ptype == V_ASN1_SEQUENCE) {
		const ASN1_STRING *pstr = pval;
		const unsigned char *pm = NULL;
		int pmlen;

		pm = pstr->data;
		pmlen = pstr->length;
		if (!(eckey = d2i_ECParameters(NULL, &pm, pmlen))) {
			ECerror(EC_R_DECODE_ERROR);
			goto ecerr;
		}
	} else if (ptype == V_ASN1_OBJECT) {
		const ASN1_OBJECT *poid = pval;
		EC_GROUP *group;

		/*
		 * type == V_ASN1_OBJECT => the parameters are given by an
		 * asn1 OID
		 */
		if ((eckey = EC_KEY_new()) == NULL) {
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
	} else {
		ECerror(EC_R_DECODE_ERROR);
		goto ecerr;
	}

	return eckey;

ecerr:
	if (eckey)
		EC_KEY_free(eckey);
	return NULL;
}

static int 
eckey_pub_decode(EVP_PKEY * pkey, X509_PUBKEY * pubkey)
{
	const unsigned char *p = NULL;
	void *pval;
	int ptype, pklen;
	EC_KEY *eckey = NULL;
	X509_ALGOR *palg;

	if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
		return 0;
	X509_ALGOR_get0(NULL, &ptype, &pval, palg);







|









|







173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
	} else {
		ECerror(EC_R_DECODE_ERROR);
		goto ecerr;
	}

	return eckey;

 ecerr:
	if (eckey)
		EC_KEY_free(eckey);
	return NULL;
}

static int 
eckey_pub_decode(EVP_PKEY * pkey, X509_PUBKEY * pubkey)
{
	const unsigned char *p = NULL;
	const void *pval;
	int ptype, pklen;
	EC_KEY *eckey = NULL;
	X509_ALGOR *palg;

	if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
		return 0;
	X509_ALGOR_get0(NULL, &ptype, &pval, palg);
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
	if (!o2i_ECPublicKey(&eckey, &p, pklen)) {
		ECerror(EC_R_DECODE_ERROR);
		goto ecerr;
	}
	EVP_PKEY_assign_EC_KEY(pkey, eckey);
	return 1;

ecerr:
	if (eckey)
		EC_KEY_free(eckey);
	return 0;
}

static int 
eckey_pub_cmp(const EVP_PKEY * a, const EVP_PKEY * b)







|







206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
	if (!o2i_ECPublicKey(&eckey, &p, pklen)) {
		ECerror(EC_R_DECODE_ERROR);
		goto ecerr;
	}
	EVP_PKEY_assign_EC_KEY(pkey, eckey);
	return 1;

 ecerr:
	if (eckey)
		EC_KEY_free(eckey);
	return 0;
}

static int 
eckey_pub_cmp(const EVP_PKEY * a, const EVP_PKEY * b)
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
		return 1;
	if (r == 1)
		return 0;
	return -2;
}

static int 
eckey_priv_decode(EVP_PKEY * pkey, PKCS8_PRIV_KEY_INFO * p8)
{
	const unsigned char *p = NULL;
	void *pval;
	int ptype, pklen;
	EC_KEY *eckey = NULL;
	X509_ALGOR *palg;

	if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8))
		return 0;
	X509_ALGOR_get0(NULL, &ptype, &pval, palg);

	eckey = eckey_type2param(ptype, pval);








|


|


|







228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
		return 1;
	if (r == 1)
		return 0;
	return -2;
}

static int 
eckey_priv_decode(EVP_PKEY * pkey, const PKCS8_PRIV_KEY_INFO * p8)
{
	const unsigned char *p = NULL;
	const void *pval;
	int ptype, pklen;
	EC_KEY *eckey = NULL;
	const X509_ALGOR *palg;

	if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8))
		return 0;
	X509_ALGOR_get0(NULL, &ptype, &pval, palg);

	eckey = eckey_type2param(ptype, pval);

286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
			goto ecliberr;
		}
		EC_POINT_free(pub_key);
	}
	EVP_PKEY_assign_EC_KEY(pkey, eckey);
	return 1;

ecliberr:
	ECerror(ERR_R_EC_LIB);
ecerr:
	if (eckey)
		EC_KEY_free(eckey);
	return 0;
}

static int 
eckey_priv_encode(PKCS8_PRIV_KEY_INFO * p8, const EVP_PKEY * pkey)







|

|







286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
			goto ecliberr;
		}
		EC_POINT_free(pub_key);
	}
	EVP_PKEY_assign_EC_KEY(pkey, eckey);
	return 1;

 ecliberr:
	ECerror(ERR_R_EC_LIB);
 ecerr:
	if (eckey)
		EC_KEY_free(eckey);
	return 0;
}

static int 
eckey_priv_encode(PKCS8_PRIV_KEY_INFO * p8, const EVP_PKEY * pkey)
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
		goto err;
	if ((pub_key != NULL) && !ASN1_bn_print(bp, "pub: ", pub_key,
		buffer, off))
		goto err;
	if (!ECPKParameters_print(bp, group, off))
		goto err;
	ret = 1;
err:
	if (!ret)
		ECerror(reason);
	BN_free(pub_key);
	BN_free(order);
	BN_CTX_free(ctx);
	free(buffer);
	return (ret);







|







479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
		goto err;
	if ((pub_key != NULL) && !ASN1_bn_print(bp, "pub: ", pub_key,
		buffer, off))
		goto err;
	if (!ECPKParameters_print(bp, group, off))
		goto err;
	ret = 1;
 err:
	if (!ret)
		ECerror(reason);
	BN_free(pub_key);
	BN_free(order);
	BN_CTX_free(ctx);
	free(buffer);
	return (ret);
Changes to jni/libressl/crypto/ec/ec_asn1.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec_asn1.c,v 1.25 2018/03/12 13:14:21 inoguchi Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 2000-2003 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ec_asn1.c,v 1.31 2018/09/01 16:23:15 tb Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 2000-2003 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
82
83
84
85
86
87
88

89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

107
108
109
110
111
112
113
		return NID_X9_62_ppBasis;
	else if (i == 2)
		return NID_X9_62_tpBasis;
	else
		/* 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)
{
	if (group == NULL)
		return 0;

	if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
	    NID_X9_62_characteristic_two_field
	    || !((group->poly[0] != 0) && (group->poly[1] != 0) && (group->poly[2] == 0))) {
		ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
		return 0;
	}
	if (k)
		*k = group->poly[1];

	return 1;
}

int 
EC_GROUP_get_pentanomial_basis(const EC_GROUP * group, unsigned int *k1,
    unsigned int *k2, unsigned int *k3)
{
	if (group == NULL)
		return 0;








>


















>







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
		return NID_X9_62_ppBasis;
	else if (i == 2)
		return NID_X9_62_tpBasis;
	else
		/* 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)
{
	if (group == NULL)
		return 0;

	if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
	    NID_X9_62_characteristic_two_field
	    || !((group->poly[0] != 0) && (group->poly[1] != 0) && (group->poly[2] == 0))) {
		ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
		return 0;
	}
	if (k)
		*k = group->poly[1];

	return 1;
}

int 
EC_GROUP_get_pentanomial_basis(const EC_GROUP * group, unsigned int *k1,
    unsigned int *k2, unsigned int *k3)
{
	if (group == NULL)
		return 0;

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
		*k2 = group->poly[2];
	if (k3)
		*k3 = group->poly[1];

	return 1;
}
#endif


/* some structures needed for the asn1 encoding */
typedef struct x9_62_pentanomial_st {
	long k1;
	long k2;
	long k3;
} X9_62_PENTANOMIAL;







<







125
126
127
128
129
130
131

132
133
134
135
136
137
138
		*k2 = group->poly[2];
	if (k3)
		*k3 = group->poly[1];

	return 1;
}
#endif


/* some structures needed for the asn1 encoding */
typedef struct x9_62_pentanomial_st {
	long k1;
	long k2;
	long k3;
} X9_62_PENTANOMIAL;
330
331
332
333
334
335
336

337
338
339
340
341
342
343
344
345
346
347
348
349
350

351
352
353
354
355
356
357
	.utype = V_ASN1_SEQUENCE,
	.templates = X9_62_CHARACTERISTIC_TWO_seq_tt,
	.tcount = sizeof(X9_62_CHARACTERISTIC_TWO_seq_tt) / sizeof(ASN1_TEMPLATE),
	.funcs = NULL,
	.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);

X9_62_CHARACTERISTIC_TWO *
X9_62_CHARACTERISTIC_TWO_new(void)
{
	return (X9_62_CHARACTERISTIC_TWO*)ASN1_item_new(&X9_62_CHARACTERISTIC_TWO_it);
}

void
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,
	.offset = offsetof(X9_62_FIELDID, p.other),
	.field_name = "p.other",
	.item = &ASN1_ANY_it,
};







>














>







331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
	.utype = V_ASN1_SEQUENCE,
	.templates = X9_62_CHARACTERISTIC_TWO_seq_tt,
	.tcount = sizeof(X9_62_CHARACTERISTIC_TWO_seq_tt) / sizeof(ASN1_TEMPLATE),
	.funcs = NULL,
	.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);

X9_62_CHARACTERISTIC_TWO *
X9_62_CHARACTERISTIC_TWO_new(void)
{
	return (X9_62_CHARACTERISTIC_TWO*)ASN1_item_new(&X9_62_CHARACTERISTIC_TWO_it);
}

void
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,
	.offset = offsetof(X9_62_FIELDID, p.other),
	.field_name = "p.other",
	.item = &ASN1_ANY_it,
};
502
503
504
505
506
507
508

509
510
511
512
513
514
515
	.utype = V_ASN1_SEQUENCE,
	.templates = ECPARAMETERS_seq_tt,
	.tcount = sizeof(ECPARAMETERS_seq_tt) / sizeof(ASN1_TEMPLATE),
	.funcs = NULL,
	.size = sizeof(ECPARAMETERS),
	.sname = "ECPARAMETERS",
};

ECPARAMETERS *ECPARAMETERS_new(void);
void ECPARAMETERS_free(ECPARAMETERS *a);

ECPARAMETERS *
ECPARAMETERS_new(void)
{
	return (ECPARAMETERS*)ASN1_item_new(&ECPARAMETERS_it);







>







505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
	.utype = V_ASN1_SEQUENCE,
	.templates = ECPARAMETERS_seq_tt,
	.tcount = sizeof(ECPARAMETERS_seq_tt) / sizeof(ASN1_TEMPLATE),
	.funcs = NULL,
	.size = sizeof(ECPARAMETERS),
	.sname = "ECPARAMETERS",
};

ECPARAMETERS *ECPARAMETERS_new(void);
void ECPARAMETERS_free(ECPARAMETERS *a);

ECPARAMETERS *
ECPARAMETERS_new(void)
{
	return (ECPARAMETERS*)ASN1_item_new(&ECPARAMETERS_it);
651
652
653
654
655
656
657

658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
}

void
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 */
static int ec_asn1_group2fieldid(const EC_GROUP *, X9_62_FIELDID *);
/* ec_asn1_group2curve() sets the values in a X9_62_CURVE object */
static int ec_asn1_group2curve(const EC_GROUP *, X9_62_CURVE *);
/* ec_asn1_parameters2group() creates a EC_GROUP object from a
 * ECPARAMETERS object */
static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *);
/* ec_asn1_group2parameters() creates a ECPARAMETERS object from a
 * EC_GROUP object */
static ECPARAMETERS *ec_asn1_group2parameters(const EC_GROUP *, ECPARAMETERS *);
/* ec_asn1_pkparameters2group() creates a EC_GROUP object from a
 * ECPKPARAMETERS object */
static EC_GROUP *ec_asn1_pkparameters2group(const ECPKPARAMETERS *);
/* ec_asn1_group2pkparameters() creates a ECPKPARAMETERS object from a
 * EC_GROUP object */
static ECPKPARAMETERS *ec_asn1_group2pkparameters(const EC_GROUP *,
    ECPKPARAMETERS *);


/* the function definitions */

static int
ec_asn1_group2fieldid(const EC_GROUP * group, X9_62_FIELDID * field)
{
	int ok = 0, nid;







>



















<







655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681

682
683
684
685
686
687
688
}

void
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 */
static int ec_asn1_group2fieldid(const EC_GROUP *, X9_62_FIELDID *);
/* ec_asn1_group2curve() sets the values in a X9_62_CURVE object */
static int ec_asn1_group2curve(const EC_GROUP *, X9_62_CURVE *);
/* ec_asn1_parameters2group() creates a EC_GROUP object from a
 * ECPARAMETERS object */
static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *);
/* ec_asn1_group2parameters() creates a ECPARAMETERS object from a
 * EC_GROUP object */
static ECPARAMETERS *ec_asn1_group2parameters(const EC_GROUP *, ECPARAMETERS *);
/* ec_asn1_pkparameters2group() creates a EC_GROUP object from a
 * ECPKPARAMETERS object */
static EC_GROUP *ec_asn1_pkparameters2group(const ECPKPARAMETERS *);
/* ec_asn1_group2pkparameters() creates a ECPKPARAMETERS object from a
 * EC_GROUP object */
static ECPKPARAMETERS *ec_asn1_group2pkparameters(const EC_GROUP *,
    ECPKPARAMETERS *);


/* the function definitions */

static int
ec_asn1_group2fieldid(const EC_GROUP * group, X9_62_FIELDID * field)
{
	int ok = 0, nid;
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
			}
		}
	}
#endif

	ok = 1;

err:
	BN_free(tmp);
	return (ok);
}

static int 
ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve)
{







|







789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
			}
		}
	}
#endif

	ok = 1;

 err:
	BN_free(tmp);
	return (ok);
}

static int 
ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve)
{
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
			ASN1_BIT_STRING_free(curve->seed);
			curve->seed = NULL;
		}
	}

	ok = 1;

err:
	free(buffer_1);
	free(buffer_2);
	BN_free(tmp_1);
	BN_free(tmp_2);
	return (ok);
}








|







892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
			ASN1_BIT_STRING_free(curve->seed);
			curve->seed = NULL;
		}
	}

	ok = 1;

 err:
	free(buffer_1);
	free(buffer_2);
	BN_free(tmp_1);
	BN_free(tmp_2);
	return (ok);
}

980
981
982
983
984
985
986

987
988
989
990
991
992
993
994
		if (ret->cofactor == NULL) {
			ECerror(ERR_R_ASN1_LIB);
			goto err;
		}
	}
	ok = 1;


err:	if (!ok) {
		if (ret && !param)
			ECPARAMETERS_free(ret);
		ret = NULL;
	}
	BN_free(tmp);
	free(buffer);
	return (ret);







>
|







984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
		if (ret->cofactor == NULL) {
			ECerror(ERR_R_ASN1_LIB);
			goto err;
		}
	}
	ok = 1;

 err:
	if (!ok) {
		if (ret && !param)
			ECPARAMETERS_free(ret);
		ret = NULL;
	}
	BN_free(tmp);
	free(buffer);
	return (ret);
1236
1237
1238
1239
1240
1241
1242

1243
1244
1245
1246
1247
1248
1249
1250
	/* set the generator, order and cofactor (if present) */
	if (!EC_GROUP_set_generator(ret, point, a, b)) {
		ECerror(ERR_R_EC_LIB);
		goto err;
	}
	ok = 1;


err:	if (!ok) {
		EC_GROUP_clear_free(ret);
		ret = NULL;
	}
	BN_free(p);
	BN_free(a);
	BN_free(b);
	EC_POINT_free(point);







>
|







1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
	/* set the generator, order and cofactor (if present) */
	if (!EC_GROUP_set_generator(ret, point, a, b)) {
		ECerror(ERR_R_EC_LIB);
		goto err;
	}
	ok = 1;

 err:
	if (!ok) {
		EC_GROUP_clear_free(ret);
		ret = NULL;
	}
	BN_free(p);
	BN_free(a);
	BN_free(b);
	EC_POINT_free(point);
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
	}

	if (a != NULL) {
		EC_GROUP_clear_free(*a);
		*a = group;
	}

err:
	ECPKPARAMETERS_free(params);
	return (group);
}

int 
i2d_ECPKParameters(const EC_GROUP * a, unsigned char **out)
{







|







1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
	}

	if (a != NULL) {
		EC_GROUP_clear_free(*a);
		*a = group;
	}

 err:
	ECPKPARAMETERS_free(params);
	return (group);
}

int 
i2d_ECPKParameters(const EC_GROUP * a, unsigned char **out)
{
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
	}

	EC_PRIVATEKEY_free(priv_key);
	if (a != NULL)
		*a = ret;
	return (ret);

err:
	if (a == NULL || *a != ret)
		EC_KEY_free(ret);
	if (priv_key)
		EC_PRIVATEKEY_free(priv_key);

	return (NULL);
}







|







1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
	}

	EC_PRIVATEKEY_free(priv_key);
	if (a != NULL)
		*a = ret;
	return (ret);

 err:
	if (a == NULL || *a != ret)
		EC_KEY_free(ret);
	if (priv_key)
		EC_PRIVATEKEY_free(priv_key);

	return (NULL);
}
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
		}
	}
	if ((ret = i2d_EC_PRIVATEKEY(priv_key, out)) == 0) {
		ECerror(ERR_R_EC_LIB);
		goto err;
	}
	ok = 1;
err:
	free(buffer);
	if (priv_key)
		EC_PRIVATEKEY_free(priv_key);
	return (ok ? ret : 0);
}

int 







|







1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
		}
	}
	if ((ret = i2d_EC_PRIVATEKEY(priv_key, out)) == 0) {
		ECerror(ERR_R_EC_LIB);
		goto err;
	}
	ok = 1;
 err:
	free(buffer);
	if (priv_key)
		EC_PRIVATEKEY_free(priv_key);
	return (ok ? ret : 0);
}

int 
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592

EC_KEY *
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
		 */
		ECerror(ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	ret = *a;
	if (ret->pub_key == NULL &&
	    (ret->pub_key = EC_POINT_new(ret->group)) == NULL) {
		ECerror(ERR_R_MALLOC_FAILURE);
		return 0;
	}
	if (!EC_POINT_oct2point(ret->group, ret->pub_key, *in, len, NULL)) {
		ECerror(ERR_R_EC_LIB);
		return 0;
	}
	/* save the point conversion form */
	ret->conv_form = (point_conversion_form_t) (*in[0] & ~0x01);
	*in += len;
	return ret;
}

int 
i2o_ECPublicKey(EC_KEY * a, unsigned char **out)
{
	size_t buf_len = 0;
	int new_buffer = 0;

	if (a == NULL) {
		ECerror(ERR_R_PASSED_NULL_PARAMETER);
		return 0;







<
|
<
<




















|







1560
1561
1562
1563
1564
1565
1566

1567


1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595

EC_KEY *
o2i_ECPublicKey(EC_KEY ** a, const unsigned char **in, long len)
{
	EC_KEY *ret = NULL;

	if (a == NULL || (*a) == NULL || (*a)->group == NULL) {

		/* An EC_GROUP structure is necessary to set the public key. */


		ECerror(ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	ret = *a;
	if (ret->pub_key == NULL &&
	    (ret->pub_key = EC_POINT_new(ret->group)) == NULL) {
		ECerror(ERR_R_MALLOC_FAILURE);
		return 0;
	}
	if (!EC_POINT_oct2point(ret->group, ret->pub_key, *in, len, NULL)) {
		ECerror(ERR_R_EC_LIB);
		return 0;
	}
	/* save the point conversion form */
	ret->conv_form = (point_conversion_form_t) (*in[0] & ~0x01);
	*in += len;
	return ret;
}

int 
i2o_ECPublicKey(const EC_KEY * a, unsigned char **out)
{
	size_t buf_len = 0;
	int new_buffer = 0;

	if (a == NULL) {
		ECerror(ERR_R_PASSED_NULL_PARAMETER);
		return 0;
Changes to jni/libressl/crypto/ec/ec_check.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec_check.c,v 1.6 2017/01/29 17:49:23 beck Exp $ */
/* ====================================================================
 * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
102
103
104
105
106
107
108
109
110
111
112
113
114
115
		goto err;
	if (EC_POINT_is_at_infinity(group, point) <= 0) {
		ECerror(EC_R_INVALID_GROUP_ORDER);
		goto err;
	}
	ret = 1;

err:
	if (ctx != NULL)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	EC_POINT_free(point);
	return ret;
}







|






102
103
104
105
106
107
108
109
110
111
112
113
114
115
		goto err;
	if (EC_POINT_is_at_infinity(group, point) <= 0) {
		ECerror(EC_R_INVALID_GROUP_ORDER);
		goto err;
	}
	ret = 1;

 err:
	if (ctx != NULL)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	EC_POINT_free(point);
	return ret;
}
Changes to jni/libressl/crypto/ec/ec_curve.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec_curve.c,v 1.16 2018/03/16 12:31:09 mpi Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2010 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ec_curve.c,v 1.19 2018/07/15 16:27:39 tb Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2010 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
	if (seed_len) {
		if (!EC_GROUP_set_seed(group, params - seed_len, seed_len)) {
			ECerror(ERR_R_EC_LIB);
			goto err;
		}
	}
	ok = 1;
err:
	if (!ok) {
		EC_GROUP_free(group);
		group = NULL;
	}
	EC_POINT_free(P);
	BN_CTX_free(ctx);
	BN_free(p);







|







3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
	if (seed_len) {
		if (!EC_GROUP_set_seed(group, params - seed_len, seed_len)) {
			ECerror(ERR_R_EC_LIB);
			goto err;
		}
	}
	ok = 1;
 err:
	if (!ok) {
		EC_GROUP_free(group);
		group = NULL;
	}
	EC_POINT_free(P);
	BN_CTX_free(ctx);
	BN_free(p);
Changes to jni/libressl/crypto/ec/ec_key.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec_key.c,v 1.14 2017/05/02 03:59:44 deraadt Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ec_key.c,v 1.17 2018/07/15 16:27:39 tb Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
		goto err;

	eckey->priv_key = priv_key;
	eckey->pub_key = pub_key;

	ok = 1;

err:
	BN_free(order);
	if (pub_key != NULL && eckey->pub_key == NULL)
		EC_POINT_free(pub_key);
	if (priv_key != NULL && eckey->priv_key == NULL)
		BN_free(priv_key);
	BN_CTX_free(ctx);
	return (ok);







|







249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
		goto err;

	eckey->priv_key = priv_key;
	eckey->pub_key = pub_key;

	ok = 1;

 err:
	BN_free(order);
	if (pub_key != NULL && eckey->pub_key == NULL)
		EC_POINT_free(pub_key);
	if (priv_key != NULL && eckey->priv_key == NULL)
		BN_free(priv_key);
	BN_CTX_free(ctx);
	return (ok);
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
		if (EC_POINT_cmp(eckey->group, point, eckey->pub_key,
			ctx) != 0) {
			ECerror(EC_R_INVALID_PRIVATE_KEY);
			goto err;
		}
	}
	ok = 1;
err:
	BN_CTX_free(ctx);
	EC_POINT_free(point);
	return (ok);
}

int 
EC_KEY_set_public_key_affine_coordinates(EC_KEY * key, BIGNUM * x, BIGNUM * y)







|







320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
		if (EC_POINT_cmp(eckey->group, point, eckey->pub_key,
			ctx) != 0) {
			ECerror(EC_R_INVALID_PRIVATE_KEY);
			goto err;
		}
	}
	ok = 1;
 err:
	BN_CTX_free(ctx);
	EC_POINT_free(point);
	return (ok);
}

int 
EC_KEY_set_public_key_affine_coordinates(EC_KEY * key, BIGNUM * x, BIGNUM * y)
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
		goto err;

	if (EC_KEY_check_key(key) == 0)
		goto err;

	ok = 1;

err:
	BN_CTX_free(ctx);
	EC_POINT_free(point);
	return ok;

}

const EC_GROUP *







|







391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
		goto err;

	if (EC_KEY_check_key(key) == 0)
		goto err;

	ok = 1;

 err:
	BN_CTX_free(ctx);
	EC_POINT_free(point);
	return ok;

}

const EC_GROUP *
Changes to jni/libressl/crypto/ec/ec_lcl.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec_lcl.h,v 1.7 2016/12/21 15:49:29 jsing Exp $ */
/*
 * Originally written by Bodo Moeller for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2010 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ec_lcl.h,v 1.10 2018/07/16 17:32:39 tb Exp $ */
/*
 * Originally written by Bodo Moeller for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2010 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
156
157
158
159
160
161
162
163
164
165
166


167
168
169
170
171
172
173
	int (*is_on_curve)(const EC_GROUP *, const EC_POINT *, BN_CTX *);
	int (*point_cmp)(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *);

	/* used by EC_POINT_make_affine, EC_POINTs_make_affine: */
	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 *);


	int (*precompute_mult)(EC_GROUP *group, BN_CTX *);
	int (*have_precompute_mult)(const EC_GROUP *group);


	/* internal functions */

	/* 'field_mul', 'field_sqr', and 'field_div' can be used by 'add' and 'dbl' so that







|
|
|
|
>
>







156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
	int (*is_on_curve)(const EC_GROUP *, const EC_POINT *, BN_CTX *);
	int (*point_cmp)(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *);

	/* used by EC_POINT_make_affine, EC_POINTs_make_affine: */
	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 */
	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);


	/* internal functions */

	/* 'field_mul', 'field_sqr', and 'field_div' can be used by 'add' and 'dbl' so that
333
334
335
336
337
338
339





340
341
342
343
344
345
346
int ec_GFp_simple_is_at_infinity(const EC_GROUP *, const EC_POINT *);
int ec_GFp_simple_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *);
int ec_GFp_simple_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *);
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 *);







/* method functions in ecp_mont.c */
int ec_GFp_mont_group_init(EC_GROUP *);
int ec_GFp_mont_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
void ec_GFp_mont_group_finish(EC_GROUP *);
void ec_GFp_mont_group_clear_finish(EC_GROUP *);







>
>
>
>
>







335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
int ec_GFp_simple_is_at_infinity(const EC_GROUP *, const EC_POINT *);
int ec_GFp_simple_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *);
int ec_GFp_simple_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *);
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_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 */
int ec_GFp_mont_group_init(EC_GROUP *);
int ec_GFp_mont_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
void ec_GFp_mont_group_finish(EC_GROUP *);
void ec_GFp_mont_group_clear_finish(EC_GROUP *);
Changes to jni/libressl/crypto/ec/ec_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec_lib.c,v 1.24 2017/05/02 03:59:44 deraadt Exp $ */
/*
 * Originally written by Bodo Moeller for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2003 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ec_lib.c,v 1.29 2018/07/16 17:32:39 tb Exp $ */
/*
 * Originally written by Bodo Moeller for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2003 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
	}
	BN_CTX_end(ctx);
	if (ctx_new)
		BN_CTX_free(ctx);

	return r;

err:
	BN_CTX_end(ctx);
	if (ctx_new)
		BN_CTX_free(ctx);
	return -1;
}









|







522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
	}
	BN_CTX_end(ctx);
	if (ctx_new)
		BN_CTX_free(ctx);

	return r;

 err:
	BN_CTX_end(ctx);
	if (ctx_new)
		BN_CTX_free(ctx);
	return -1;
}


1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038




1039






1040


1041

1042


1043




1044
1045
1046
1047
1048
1049
1050




1051







1052

1053
1054
1055
1056








1057
1058
1059









1060



1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
			return 0;
		}
	}
	return group->meth->points_make_affine(group, num, points, ctx);
}


/* 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.
 */

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);




}

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);



}

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
		return 1;	/* nothing to do, so report success */
}

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
		return 0;	/* cannot tell whether precomputation has
				 * been performed */
}








|
<
<
<
<
<




>
>
>
>
|
>
>
>
>
>
>
|
>
>
|
>
|
>
>
|
>
>
>
>






|
>
>
>
>
|
>
>
>
>
>
>
>
|
>
|
|
|
|
>
>
>
>
>
>
>
>
|
<
|
>
>
>
>
>
>
>
>
>
|
>
>
>





<
<
<
<









<
<
<
<







1022
1023
1024
1025
1026
1027
1028
1029





1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091

1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110




1111
1112
1113
1114
1115
1116
1117
1118
1119




1120
1121
1122
1123
1124
1125
1126
			return 0;
		}
	}
	return group->meth->points_make_affine(group, num, points, ctx);
}


/* 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)
{
	/*
	 * 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)
{
	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->precompute_mult != 0)
		return group->meth->precompute_mult(group, ctx);
	else
		return 1;	/* nothing to do, so report success */
}

int 
EC_GROUP_have_precompute_mult(const EC_GROUP * group)
{




	if (group->meth->have_precompute_mult != 0)
		return group->meth->have_precompute_mult(group);
	else
		return 0;	/* cannot tell whether precomputation has
				 * been performed */
}

Changes to jni/libressl/crypto/ec/ec_mult.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec_mult.c,v 1.21 2017/05/02 03:59:44 deraadt Exp $ */
/*
 * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2007 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1998-2007 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
	if (j > len + 1) {
		ECerror(ERR_R_INTERNAL_ERROR);
		goto err;
	}
	len = j;
	ok = 1;

err:
	if (!ok) {
		free(r);
		r = NULL;
	}
	if (ok)
		*ret_len = len;
	return r;







|







297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
	if (j > len + 1) {
		ECerror(ERR_R_INTERNAL_ERROR);
		goto err;
	}
	len = j;
	ok = 1;

 err:
	if (!ok) {
		free(r);
		r = NULL;
	}
	if (ok)
		*ret_len = len;
	return r;
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
		if (r_is_inverted)
			if (!EC_POINT_invert(group, r, ctx))
				goto err;
	}

	ret = 1;

err:
	BN_CTX_free(new_ctx);
	EC_POINT_free(tmp);
	free(wsize);
	free(wNAF_len);
	free(tmp_wNAF);
	if (wNAF != NULL) {
		signed char **w;







|







674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
		if (r_is_inverted)
			if (!EC_POINT_invert(group, r, ctx))
				goto err;
	}

	ret = 1;

 err:
	BN_CTX_free(new_ctx);
	EC_POINT_free(tmp);
	free(wsize);
	free(wNAF_len);
	free(tmp_wNAF);
	if (wNAF != NULL) {
		signed char **w;
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867

	if (!EC_EX_DATA_set_data(&group->extra_data, pre_comp,
		ec_pre_comp_dup, ec_pre_comp_free, ec_pre_comp_clear_free))
		goto err;
	pre_comp = NULL;

	ret = 1;
err:
	if (ctx != NULL)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	ec_pre_comp_free(pre_comp);
	if (points) {
		EC_POINT **p;








|







853
854
855
856
857
858
859
860
861
862
863
864
865
866
867

	if (!EC_EX_DATA_set_data(&group->extra_data, pre_comp,
		ec_pre_comp_dup, ec_pre_comp_free, ec_pre_comp_clear_free))
		goto err;
	pre_comp = NULL;

	ret = 1;
 err:
	if (ctx != NULL)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	ec_pre_comp_free(pre_comp);
	if (points) {
		EC_POINT **p;

Changes to jni/libressl/crypto/ec/eck_prn.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: eck_prn.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: eck_prn.c,v 1.15 2018/07/15 16:27:39 tb Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
		if ((cofactor != NULL) && !ASN1_bn_print(bp, "Cofactor: ", cofactor,
			buffer, off))
			goto err;
		if (seed && !print_bin(bp, "Seed:", seed, seed_len, off))
			goto err;
	}
	ret = 1;
err:
	if (!ret)
		ECerror(reason);
	BN_free(p);
	BN_free(a);
	BN_free(b);
	BN_free(gen);
	BN_free(order);







|







317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
		if ((cofactor != NULL) && !ASN1_bn_print(bp, "Cofactor: ", cofactor,
			buffer, off))
			goto err;
		if (seed && !print_bin(bp, "Seed:", seed, seed_len, off))
			goto err;
	}
	ret = 1;
 err:
	if (!ret)
		ECerror(reason);
	BN_free(p);
	BN_free(a);
	BN_free(b);
	BN_free(gen);
	BN_free(order);
Changes to jni/libressl/crypto/ec/ecp_mont.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ecp_mont.c,v 1.11 2017/01/29 17:49:23 beck Exp $ */
/*
 * Originally written by Bodo Moeller for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ecp_mont.c,v 1.16 2018/07/16 17:32:39 tb Exp $ */
/*
 * Originally written by Bodo Moeller for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
98
99
100
101
102
103
104



105
106
107
108
109
110
111
		.dbl = ec_GFp_simple_dbl,
		.invert = ec_GFp_simple_invert,
		.is_at_infinity = ec_GFp_simple_is_at_infinity,
		.is_on_curve = ec_GFp_simple_is_on_curve,
		.point_cmp = ec_GFp_simple_cmp,
		.make_affine = ec_GFp_simple_make_affine,
		.points_make_affine = ec_GFp_simple_points_make_affine,



		.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
	};








>
>
>







98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
		.dbl = ec_GFp_simple_dbl,
		.invert = ec_GFp_simple_invert,
		.is_at_infinity = ec_GFp_simple_is_at_infinity,
		.is_on_curve = ec_GFp_simple_is_on_curve,
		.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
	};

168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
	if (src->field_data2 != NULL) {
		dest->field_data2 = BN_dup(src->field_data2);
		if (dest->field_data2 == NULL)
			goto err;
	}
	return 1;

err:
	if (dest->field_data1 != NULL) {
		BN_MONT_CTX_free(dest->field_data1);
		dest->field_data1 = NULL;
	}
	return 0;
}








|







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
	if (src->field_data2 != NULL) {
		dest->field_data2 = BN_dup(src->field_data2);
		if (dest->field_data2 == NULL)
			goto err;
	}
	return 1;

 err:
	if (dest->field_data1 != NULL) {
		BN_MONT_CTX_free(dest->field_data1);
		dest->field_data1 = NULL;
	}
	return 0;
}

221
222
223
224
225
226
227
228
229
230
231
232
233
234
235

	if (!ret) {
		BN_MONT_CTX_free(group->field_data1);
		group->field_data1 = NULL;
		BN_free(group->field_data2);
		group->field_data2 = NULL;
	}
err:
	BN_CTX_free(new_ctx);
	BN_MONT_CTX_free(mont);
	BN_free(one);
	return ret;
}









|







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238

	if (!ret) {
		BN_MONT_CTX_free(group->field_data1);
		group->field_data1 = NULL;
		BN_free(group->field_data2);
		group->field_data2 = NULL;
	}
 err:
	BN_CTX_free(new_ctx);
	BN_MONT_CTX_free(mont);
	BN_free(one);
	return ret;
}


Changes to jni/libressl/crypto/ec/ecp_nist.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ecp_nist.c,v 1.10 2017/01/29 17:49:23 beck Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2003 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ecp_nist.c,v 1.14 2018/07/16 17:32:39 tb Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2003 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
99
100
101
102
103
104
105



106
107
108
109
110
111
112
		.dbl = ec_GFp_simple_dbl,
		.invert = ec_GFp_simple_invert,
		.is_at_infinity = ec_GFp_simple_is_at_infinity,
		.is_on_curve = ec_GFp_simple_is_on_curve,
		.point_cmp = ec_GFp_simple_cmp,
		.make_affine = ec_GFp_simple_make_affine,
		.points_make_affine = ec_GFp_simple_points_make_affine,



		.field_mul = ec_GFp_nist_field_mul,
		.field_sqr = ec_GFp_nist_field_sqr
	};

	return &ret;
}








>
>
>







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
		.dbl = ec_GFp_simple_dbl,
		.invert = ec_GFp_simple_invert,
		.is_at_infinity = ec_GFp_simple_is_at_infinity,
		.is_on_curve = ec_GFp_simple_is_on_curve,
		.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
	};

	return &ret;
}

147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
	else {
		ECerror(EC_R_NOT_A_NIST_PRIME);
		goto err;
	}

	ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx);

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 







|







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
	else {
		ECerror(EC_R_NOT_A_NIST_PRIME);
		goto err;
	}

	ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx);

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189

	if (!BN_mul(r, a, b, ctx))
		goto err;
	if (!group->field_mod_func(r, r, &group->field, ctx))
		goto err;

	ret = 1;
err:
	BN_CTX_free(ctx_new);
	return ret;
}


int 
ec_GFp_nist_field_sqr(const EC_GROUP * group, BIGNUM * r, const BIGNUM * a,







|







178
179
180
181
182
183
184
185
186
187
188
189
190
191
192

	if (!BN_mul(r, a, b, ctx))
		goto err;
	if (!group->field_mod_func(r, r, &group->field, ctx))
		goto err;

	ret = 1;
 err:
	BN_CTX_free(ctx_new);
	return ret;
}


int 
ec_GFp_nist_field_sqr(const EC_GROUP * group, BIGNUM * r, const BIGNUM * a,
202
203
204
205
206
207
208
209
210
211
212

	if (!BN_sqr(r, a, ctx))
		goto err;
	if (!group->field_mod_func(r, r, &group->field, ctx))
		goto err;

	ret = 1;
err:
	BN_CTX_free(ctx_new);
	return ret;
}







|



205
206
207
208
209
210
211
212
213
214
215

	if (!BN_sqr(r, a, ctx))
		goto err;
	if (!group->field_mod_func(r, r, &group->field, ctx))
		goto err;

	ret = 1;
 err:
	BN_CTX_free(ctx_new);
	return ret;
}
Changes to jni/libressl/crypto/ec/ecp_oct.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ecp_oct.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
 * for the OpenSSL project.
 * Includes code written by Bodo Moeller for the OpenSSL project.
*/
/* ====================================================================
 * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ecp_oct.c,v 1.11 2018/07/15 16:27:39 tb Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
 * for the OpenSSL project.
 * Includes code written by Bodo Moeller for the OpenSSL project.
*/
/* ====================================================================
 * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
 *
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
		goto err;
	}
	if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx))
		goto err;

	ret = 1;

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


size_t 







|







186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
		goto err;
	}
	if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx))
		goto err;

	ret = 1;

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


size_t 
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
		}
	}
	if (used_ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;

err:
	if (used_ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return 0;
}









|







290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
		}
	}
	if (used_ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;

 err:
	if (used_ctx)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return 0;
}


384
385
386
387
388
389
390
391
392
393
394
395
	/* test required by X9.62 */
	if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
		ECerror(EC_R_POINT_IS_NOT_ON_CURVE);
		goto err;
	}
	ret = 1;

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}







|




384
385
386
387
388
389
390
391
392
393
394
395
	/* test required by X9.62 */
	if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
		ECerror(EC_R_POINT_IS_NOT_ON_CURVE);
		goto err;
	}
	ret = 1;

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}
Changes to jni/libressl/crypto/ec/ecp_smpl.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ecp_smpl.c,v 1.17 2017/01/29 17:49:23 beck Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
 * for the OpenSSL project.
 * Includes code written by Bodo Moeller for the OpenSSL project.
*/
/* ====================================================================
 * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ecp_smpl.c,v 1.22 2018/07/16 17:32:39 tb Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
 * for the OpenSSL project.
 * Includes code written by Bodo Moeller for the OpenSSL project.
*/
/* ====================================================================
 * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
 *
99
100
101
102
103
104
105



106
107
108
109
110
111
112
		.dbl = ec_GFp_simple_dbl,
		.invert = ec_GFp_simple_invert,
		.is_at_infinity = ec_GFp_simple_is_at_infinity,
		.is_on_curve = ec_GFp_simple_is_on_curve,
		.point_cmp = ec_GFp_simple_cmp,
		.make_affine = ec_GFp_simple_make_affine,
		.points_make_affine = ec_GFp_simple_points_make_affine,



		.field_mul = ec_GFp_simple_field_mul,
		.field_sqr = ec_GFp_simple_field_sqr
	};

	return &ret;
}








>
>
>







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
		.dbl = ec_GFp_simple_dbl,
		.invert = ec_GFp_simple_invert,
		.is_at_infinity = ec_GFp_simple_is_at_infinity,
		.is_on_curve = ec_GFp_simple_is_on_curve,
		.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
	};

	return &ret;
}

216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
	/* group->a_is_minus3 */
	if (!BN_add_word(tmp_a, 3))
		goto err;
	group->a_is_minus3 = (0 == BN_cmp(tmp_a, &group->field));

	ret = 1;

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 







|







219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
	/* group->a_is_minus3 */
	if (!BN_add_word(tmp_a, 3))
		goto err;
	group->a_is_minus3 = (0 == BN_cmp(tmp_a, &group->field));

	ret = 1;

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
				if (!BN_copy(b, &group->b))
					goto err;
			}
		}
	}
	ret = 1;

err:
	BN_CTX_free(new_ctx);
	return ret;
}


int 
ec_GFp_simple_group_get_degree(const EC_GROUP * group)







|







264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
				if (!BN_copy(b, &group->b))
					goto err;
			}
		}
	}
	ret = 1;

 err:
	BN_CTX_free(new_ctx);
	return ret;
}


int 
ec_GFp_simple_group_get_degree(const EC_GROUP * group)
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
		if (!BN_mod_add(a, tmp_1, tmp_2, p, ctx))
			goto err;
		if (BN_is_zero(a))
			goto err;
	}
	ret = 1;

err:
	if (ctx != NULL)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}









|







345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
		if (!BN_mod_add(a, tmp_1, tmp_2, p, ctx))
			goto err;
		if (BN_is_zero(a))
			goto err;
	}
	ret = 1;

 err:
	if (ctx != NULL)
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
					goto err;
			}
		}
		point->Z_is_one = Z_is_one;
	}
	ret = 1;

err:
	BN_CTX_free(new_ctx);
	return ret;
}


int 
ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP * group, const EC_POINT * point,







|







455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
					goto err;
			}
		}
		point->Z_is_one = Z_is_one;
	}
	ret = 1;

 err:
	BN_CTX_free(new_ctx);
	return ret;
}


int 
ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP * group, const EC_POINT * point,
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
			if (!BN_copy(z, &point->Z))
				goto err;
		}
	}

	ret = 1;

err:
	BN_CTX_free(new_ctx);
	return ret;
}


int 
ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * point,







|







503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
			if (!BN_copy(z, &point->Z))
				goto err;
		}
	}

	ret = 1;

 err:
	BN_CTX_free(new_ctx);
	return ret;
}


int 
ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * point,
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
			if (!group->meth->field_mul(group, y, &point->Y, Z_3, ctx))
				goto err;
		}
	}

	ret = 1;

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}

int 
ec_GFp_simple_add(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, const EC_POINT * b, BN_CTX * ctx)







|







623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
			if (!group->meth->field_mul(group, y, &point->Y, Z_3, ctx))
				goto err;
		}
	}

	ret = 1;

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}

int 
ec_GFp_simple_add(const EC_GROUP * group, EC_POINT * r, const EC_POINT * a, const EC_POINT * b, BN_CTX * ctx)
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
	/* now  0 <= n0 < 2*p,  and n0 is even */
	if (!BN_rshift1(&r->Y, n0))
		goto end;
	/* Y_r = (n6 * 'n9' - 'n8' * 'n5^3') / 2 */

	ret = 1;

end:
	if (ctx)		/* otherwise we already called BN_CTX_end */
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}









|







810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
	/* now  0 <= n0 < 2*p,  and n0 is even */
	if (!BN_rshift1(&r->Y, n0))
		goto end;
	/* Y_r = (n6 * 'n9' - 'n8' * 'n5^3') / 2 */

	ret = 1;

 end:
	if (ctx)		/* otherwise we already called BN_CTX_end */
		BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
		goto err;
	if (!BN_mod_sub_quick(&r->Y, n0, n3, p))
		goto err;
	/* Y_r = n1 * (n2 - X_r) - n3 */

	ret = 1;

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 







|







953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
		goto err;
	if (!BN_mod_sub_quick(&r->Y, n0, n3, p))
		goto err;
	/* Y_r = n1 * (n2 - X_r) - n3 */

	ret = 1;

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085

	/* 'lh' := Y^2 */
	if (!field_sqr(group, tmp, &point->Y, ctx))
		goto err;

	ret = (0 == BN_ucmp(tmp, rh));

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 







|







1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088

	/* 'lh' := Y^2 */
	if (!field_sqr(group, tmp, &point->Y, ctx))
		goto err;

	ret = (0 == BN_ucmp(tmp, rh));

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
	if (BN_cmp(tmp1_, tmp2_) != 0) {
		ret = 1;	/* points differ */
		goto end;
	}
	/* points are equal */
	ret = 0;

end:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 







|







1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
	if (BN_cmp(tmp1_, tmp2_) != 0) {
		ret = 1;	/* points differ */
		goto end;
	}
	/* points are equal */
	ret = 0;

 end:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
		goto err;
	if (!point->Z_is_one) {
		ECerror(ERR_R_INTERNAL_ERROR);
		goto err;
	}
	ret = 1;

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 







|







1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
		goto err;
	if (!point->Z_is_one) {
		ECerror(ERR_R_INTERNAL_ERROR);
		goto err;
	}
	ret = 1;

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	return ret;
}


int 
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
			}
			p->Z_is_one = 1;
		}
	}

	ret = 1;

err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	if (heap != NULL) {
		/*
		 * heap[pow2/2] .. heap[pow2-1] have not been allocated
		 * locally!
		 */







|







1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
			}
			p->Z_is_one = 1;
		}
	}

	ret = 1;

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(new_ctx);
	if (heap != NULL) {
		/*
		 * heap[pow2/2] .. heap[pow2-1] have not been allocated
		 * locally!
		 */
1405
1406
1407
1408
1409
1410
1411























































































































































































































































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);
}




























































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659


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);
}

#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 + 1) == NULL) ||
	    (bn_wexpand(lambda, group_top + 1) == 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 + 1))
		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;

	/* 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);
}
Changes to jni/libressl/crypto/ecdh/ech_key.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ech_key.c,v 1.7 2017/01/29 17:49:23 beck Exp $ */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ech_key.c,v 1.8 2018/09/02 17:20:31 tb Exp $ */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
121
122
123
124
125
126
127




128
129
130
131
132
133
134
	priv_key = EC_KEY_get0_private_key(ecdh);
	if (priv_key == NULL) {
		ECDHerror(ECDH_R_NO_PRIVATE_VALUE);
		goto err;
	}

	group = EC_KEY_get0_group(ecdh);




	if ((tmp = EC_POINT_new(group)) == NULL) {
		ECDHerror(ERR_R_MALLOC_FAILURE);
		goto err;
	}

	if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) {
		ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE);







>
>
>
>







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
	priv_key = EC_KEY_get0_private_key(ecdh);
	if (priv_key == NULL) {
		ECDHerror(ECDH_R_NO_PRIVATE_VALUE);
		goto err;
	}

	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;
	}

	if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) {
		ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE);
Changes to jni/libressl/crypto/ecdh/ech_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ech_lib.c,v 1.13 2017/05/02 03:59:44 deraadt Exp $ */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ech_lib.c,v 1.14 2018/04/14 07:09:21 tb Exp $ */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122

	ecdh = ecdh_check(eckey);

	if (ecdh == NULL)
		return 0;

#ifndef OPENSSL_NO_ENGINE
	if (ecdh->engine) {
		ENGINE_finish(ecdh->engine);
		ecdh->engine = NULL;
	}
#endif
	ecdh->meth = meth;
	return 1;
}

static ECDH_DATA *
ECDH_DATA_new_method(ENGINE *engine)







<
|
|
<







105
106
107
108
109
110
111

112
113

114
115
116
117
118
119
120

	ecdh = ecdh_check(eckey);

	if (ecdh == NULL)
		return 0;

#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(ecdh->engine);
	ecdh->engine = NULL;

#endif
	ecdh->meth = meth;
	return 1;
}

static ECDH_DATA *
ECDH_DATA_new_method(ENGINE *engine)
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
	ret->meth = ECDH_get_default_method();
	ret->engine = engine;
#ifndef OPENSSL_NO_ENGINE
	if (!ret->engine)
		ret->engine = ENGINE_get_default_ECDH();
	if (ret->engine) {
		ret->meth = ENGINE_get_ECDH(ret->engine);
		if (!ret->meth) {
			ECDHerror(ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
		}
	}
#endif







|







132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
	ret->meth = ECDH_get_default_method();
	ret->engine = engine;
#ifndef OPENSSL_NO_ENGINE
	if (!ret->engine)
		ret->engine = ENGINE_get_default_ECDH();
	if (ret->engine) {
		ret->meth = ENGINE_get_ECDH(ret->engine);
		if (ret->meth == NULL) {
			ECDHerror(ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
		}
	}
#endif
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187

void
ecdh_data_free(void *data)
{
	ECDH_DATA *r = (ECDH_DATA *)data;

#ifndef OPENSSL_NO_ENGINE
	if (r->engine)
		ENGINE_finish(r->engine);
#endif

	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDH, r, &r->ex_data);

	freezero(r, sizeof(ECDH_DATA));
}








<
|







170
171
172
173
174
175
176

177
178
179
180
181
182
183
184

void
ecdh_data_free(void *data)
{
	ECDH_DATA *r = (ECDH_DATA *)data;

#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(r->engine);
#endif

	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDH, r, &r->ex_data);

	freezero(r, sizeof(ECDH_DATA));
}

Changes to jni/libressl/crypto/ecdsa/ecs_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ecs_lib.c,v 1.12 2017/05/02 03:59:44 deraadt Exp $ */
/* ====================================================================
 * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109

	ecdsa = ecdsa_check(eckey);

	if (ecdsa == NULL)
		return 0;

#ifndef OPENSSL_NO_ENGINE
	if (ecdsa->engine) {
		ENGINE_finish(ecdsa->engine);
		ecdsa->engine = NULL;
	}
#endif
	ecdsa->meth = meth;

	return 1;
}

static ECDSA_DATA *







<
|
|
<







92
93
94
95
96
97
98

99
100

101
102
103
104
105
106
107

	ecdsa = ecdsa_check(eckey);

	if (ecdsa == NULL)
		return 0;

#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(ecdsa->engine);
	ecdsa->engine = NULL;

#endif
	ecdsa->meth = meth;

	return 1;
}

static ECDSA_DATA *
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	ret->meth = ECDSA_get_default_method();
	ret->engine = engine;
#ifndef OPENSSL_NO_ENGINE
	if (!ret->engine)
		ret->engine = ENGINE_get_default_ECDSA();
	if (ret->engine) {
		ret->meth = ENGINE_get_ECDSA(ret->engine);
		if (!ret->meth) {
			ECDSAerror(ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
		}
	}
#endif







|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
	ret->meth = ECDSA_get_default_method();
	ret->engine = engine;
#ifndef OPENSSL_NO_ENGINE
	if (!ret->engine)
		ret->engine = ENGINE_get_default_ECDSA();
	if (ret->engine) {
		ret->meth = ENGINE_get_ECDSA(ret->engine);
		if (ret->meth == NULL) {
			ECDSAerror(ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
		}
	}
#endif
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

static void
ecdsa_data_free(void *data)
{
	ECDSA_DATA *r = (ECDSA_DATA *)data;

#ifndef OPENSSL_NO_ENGINE
	if (r->engine)
		ENGINE_finish(r->engine);
#endif
	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDSA, r, &r->ex_data);

	freezero(r, sizeof(ECDSA_DATA));
}

ECDSA_DATA *







<
|







158
159
160
161
162
163
164

165
166
167
168
169
170
171
172

static void
ecdsa_data_free(void *data)
{
	ECDSA_DATA *r = (ECDSA_DATA *)data;

#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(r->engine);
#endif
	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDSA, r, &r->ex_data);

	freezero(r, sizeof(ECDSA_DATA));
}

ECDSA_DATA *
Changes to jni/libressl/crypto/ecdsa/ecs_ossl.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ecs_ossl.c,v 1.9.2.1 2018/06/13 15:08:08 jsing Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project
 */
/* ====================================================================
 * Copyright (c) 1998-2004 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ecs_ossl.c,v 1.16 2018/07/10 21:36:02 tb Exp $ */
/*
 * Written by Nils Larsch for the OpenSSL project
 */
/* ====================================================================
 * Copyright (c) 1998-2004 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
61
62
63
64
65
66
67


68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
























87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126







127
128
129
130

131
132
133
134
135

136
137
138










139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232


233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254

255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271




































272
273
274
275




276




277
278
279
280
281
282
283

284

285
286

287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303

304
305



306
307
308
309
310
311
312
313
314
315
316
317
318
319
320

321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349

350
351

352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374

375
376
377
378
379
380
381
382
383
384
385
386
387
388

389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418

419
420
421
422
423
424
425
426
427
#include <openssl/err.h>
#include <openssl/obj_mac.h>
#include <openssl/bn.h>

#include "bn_lcl.h"
#include "ecs_locl.h"



static ECDSA_SIG *ecdsa_do_sign(const unsigned char *dgst, int dlen,
    const BIGNUM *, const BIGNUM *, EC_KEY *eckey);
static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
    BIGNUM **rp);
static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len,
    const ECDSA_SIG *sig, EC_KEY *eckey);

static ECDSA_METHOD openssl_ecdsa_meth = {
	.name = "OpenSSL ECDSA method",
	.ecdsa_do_sign = ecdsa_do_sign,
	.ecdsa_sign_setup = ecdsa_sign_setup,
	.ecdsa_do_verify = ecdsa_do_verify
};

const ECDSA_METHOD *
ECDSA_OpenSSL(void)
{
	return &openssl_ecdsa_meth;
}

























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;
	const EC_GROUP *group;
	int 	 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 = 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) {
		ECDSAerror(ERR_R_MALLOC_FAILURE);
		goto err;
	}
	if ((tmp_point = EC_POINT_new(group)) == NULL) {
		ECDSAerror(ERR_R_EC_LIB);
		goto err;
	}
	if (!EC_GROUP_get_order(group, order, ctx)) {
		ECDSAerror(ERR_R_EC_LIB);
		goto err;
	}








	do {
		/* get random k */
		do
			if (!BN_rand_range(k, order)) {

				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))
			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)) {
			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)) {
				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)) {
				ECDSAerror(ERR_R_EC_LIB);
				goto err;
			}
		}
#endif
		if (!BN_nnmod(r, X, order, ctx)) {
			ECDSAerror(ERR_R_BN_LIB);
			goto err;
		}
	} 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) {
		BN_clear_free(k);
		BN_clear_free(r);
	}
	if (ctx_in == NULL)
		BN_CTX_free(ctx);
	BN_free(order);
	EC_POINT_free(tmp_point);
	BN_clear_free(X);
	return (ret);
}


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;
	ECDSA_SIG  *ret;
	ECDSA_DATA *ecdsa;
	const BIGNUM *priv_key;

	ecdsa = ecdsa_check(eckey);
	group = EC_KEY_get0_group(eckey);
	priv_key = EC_KEY_get0_private_key(eckey);

	if (group == NULL || priv_key == NULL || ecdsa == NULL) {
		ECDSAerror(ERR_R_PASSED_NULL_PARAMETER);
		return NULL;
	}

	ret = ECDSA_SIG_new();
	if (!ret) {
		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) {
		ECDSAerror(ERR_R_MALLOC_FAILURE);
		goto err;
	}

	if (!EC_GROUP_get_order(group, order, ctx)) {
		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);

		goto err;
	}
	do {
		if (in_kinv == NULL || in_r == NULL) {
			if (!ECDSA_sign_setup(eckey, ctx, &kinv, &ret->r)) {
				ECDSAerror(ERR_R_ECDSA_LIB);
				goto err;
			}
			ckinv = kinv;
		} else {
			ckinv = in_kinv;
			if (BN_copy(ret->r, in_r) == NULL) {
				ECDSAerror(ERR_R_MALLOC_FAILURE);
				goto err;
			}
		}





































		if (!BN_mod_mul(tmp, priv_key, ret->r, order, ctx)) {
			ECDSAerror(ERR_R_BN_LIB);
			goto err;
		}




		if (!BN_mod_add(s, tmp, m, order, ctx)) {




			ECDSAerror(ERR_R_BN_LIB);
			goto err;
		}
		if (!BN_mod_mul(s, s, ckinv, order, ctx)) {
			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 (in_kinv != NULL && in_r != NULL) {
				ECDSAerror(ECDSA_R_NEED_NEW_SETUP_VALUES);
				goto err;
			}
		} else
			/* s != 0 => we have a valid signature */
			break;
	} while (1);

	ok = 1;

err:
	if (!ok) {
		ECDSA_SIG_free(ret);
		ret = NULL;
	}
	BN_CTX_free(ctx);

	BN_clear_free(m);
	BN_clear_free(tmp);



	BN_free(order);
	BN_clear_free(kinv);
	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;
	EC_POINT *point = NULL;
	const EC_GROUP *group;
	const EC_POINT *pub_key;


	/* 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) {
		ECDSAerror(ERR_R_MALLOC_FAILURE);
		return -1;
	}
	BN_CTX_start(ctx);
	order = BN_CTX_get(ctx);
	u1 = BN_CTX_get(ctx);
	u2 = BN_CTX_get(ctx);
	m = BN_CTX_get(ctx);
	X = BN_CTX_get(ctx);
	if (!X) {
		ECDSAerror(ERR_R_BN_LIB);
		goto err;
	}

	if (!EC_GROUP_get_order(group, order, ctx)) {
		ECDSAerror(ERR_R_EC_LIB);
		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) {
		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);
		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);
		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);
		goto err;
	}
	/* u1 = m * tmp mod order */
	if (!BN_mod_mul(u1, m, u2, order, ctx)) {
		ECDSAerror(ERR_R_BN_LIB);
		goto err;
	}
	/* u2 = r * w mod q */
	if (!BN_mod_mul(u2, sig->r, u2, order, ctx)) {
		ECDSAerror(ERR_R_BN_LIB);
		goto err;
	}


	if ((point = EC_POINT_new(group)) == NULL) {
		ECDSAerror(ERR_R_MALLOC_FAILURE);
		goto err;
	}
	if (!EC_POINT_mul(group, point, u1, pub_key, u2, 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,
		    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)) {
			ECDSAerror(ERR_R_EC_LIB);
			goto err;
		}
	}
#endif
	if (!BN_nnmod(u1, X, order, ctx)) {
		ECDSAerror(ERR_R_BN_LIB);
		goto err;
	}

	/*  if the signature is correct u1 is equal to sig->r */
	ret = (BN_ucmp(u1, sig->r) == 0);

err:
	BN_CTX_end(ctx);
	BN_CTX_free(ctx);
	EC_POINT_free(point);
	return ret;
}







>
>
|


















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




|
|
|

|






|




<
<
|
|
<
|
|
<



|








>
>
>
>
>
>
>

<
|

>
|


|

>
|
|
|
>
>
>
>
>
>
>
>
>
>
|
|
|
<
|



|
|





|
|





|
<
|
|











<




<


<




|
|






|









|
|
|
|
|


|










|
<






>
>
|








<
<
<
<
<
<
<
<
<
|
<
<
<
>

|















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|



>
>
>
>
|
>
>
>
>







>

>
|
|
>











|
|




>
|
|
>
>
>

|







<
|
|



>

<






|
<









|









>
|
|
>
|

|


<
<
<
<
|
<
<
<
<
<
<
<
|
<

|
<
<
>



<
|



<
|




>










|
|





|
<
|
|









>
|


|





61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132


133
134

135
136

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156

157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200

201
202
203
204
205
206
207
208
209
210
211
212
213

214
215
216
217

218
219

220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260

261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277









278



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390

391
392
393
394
395
396
397

398
399
400
401
402
403
404

405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432




433







434

435
436


437
438
439
440

441
442
443
444

445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468

469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
#include <openssl/err.h>
#include <openssl/obj_mac.h>
#include <openssl/bn.h>

#include "bn_lcl.h"
#include "ecs_locl.h"

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);
static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len,
    const ECDSA_SIG *sig, EC_KEY *eckey);

static ECDSA_METHOD openssl_ecdsa_meth = {
	.name = "OpenSSL ECDSA method",
	.ecdsa_do_sign = ecdsa_do_sign,
	.ecdsa_sign_setup = ecdsa_sign_setup,
	.ecdsa_do_verify = ecdsa_do_verify
};

const ECDSA_METHOD *
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;
}

static int
ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
{
	BN_CTX *ctx = ctx_in;
	BIGNUM *k = NULL, *r = NULL, *order = NULL, *X = NULL;
	EC_POINT *point = NULL;
	const EC_GROUP *group;
	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 == NULL) {
		if ((ctx = BN_CTX_new()) == NULL) {
			ECDSAerror(ERR_R_MALLOC_FAILURE);
			return 0;
		}


	}


	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 ((point = EC_POINT_new(group)) == NULL) {
		ECDSAerror(ERR_R_EC_LIB);
		goto err;
	}
	if (!EC_GROUP_get_order(group, order, ctx)) {
		ECDSAerror(ERR_R_EC_LIB);
		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 {

		do {
			if (!BN_rand_range(k, order)) {
				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.
		 *
		 * 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;

		BN_set_flags(k, BN_FLG_CONSTTIME);

		/* 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, 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)) {
				ECDSAerror(ERR_R_EC_LIB);
				goto err;
			}
		}
#endif
		if (!BN_nnmod(r, X, order, ctx)) {
			ECDSAerror(ERR_R_BN_LIB);
			goto err;
		}
	} while (BN_is_zero(r));


	if (!BN_mod_inverse_ct(k, k, order, ctx)) {
		ECDSAerror(ERR_R_BN_LIB);
		goto err;
	}

	BN_clear_free(*rp);
	BN_clear_free(*kinvp);

	*rp = r;
	*kinvp = k;
	ret = 1;

 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(point);
	BN_clear_free(X);
	return (ret);
}


static ECDSA_SIG *
ecdsa_do_sign(const unsigned char *dgst, int dgst_len,
    const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey)
{
	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;
	int ok = 0;

	ecdsa = ecdsa_check(eckey);
	group = EC_KEY_get0_group(eckey);
	priv_key = EC_KEY_get0_private_key(eckey);

	if (group == NULL || priv_key == NULL || ecdsa == NULL) {
		ECDSAerror(ERR_R_PASSED_NULL_PARAMETER);
		return NULL;
	}

	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 ||
	    (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;
	}

	if (!EC_GROUP_get_order(group, order, ctx)) {
		ECDSAerror(ERR_R_EC_LIB);
		goto err;
	}













	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)) {
				ECDSAerror(ERR_R_ECDSA_LIB);
				goto err;
			}
			ckinv = kinv;
		} else {
			ckinv = in_kinv;
			if (BN_copy(ret->r, in_r) == NULL) {
				ECDSAerror(ERR_R_MALLOC_FAILURE);
				goto err;
			}
		}

		/*
		 * 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_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;
		}
		if (!BN_mod_mul(s, s, ckinv, order, ctx)) {
			ECDSAerror(ERR_R_BN_LIB);
			goto err;
		}

		if (BN_is_zero(s)) {
			/*
			 * 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;
			}
		} else
			/* s != 0 => we have a valid signature */
			break;
	} while (1);

	ok = 1;

 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_free(order);
	BN_free(range);
	return ret;
}

static int
ecdsa_do_verify(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig,
    EC_KEY *eckey)
{

	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;


	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;
	}

	if ((ctx = BN_CTX_new()) == NULL) {

		ECDSAerror(ERR_R_MALLOC_FAILURE);
		return -1;
	}
	BN_CTX_start(ctx);
	order = BN_CTX_get(ctx);
	u1 = BN_CTX_get(ctx);
	u2 = BN_CTX_get(ctx);
	m = BN_CTX_get(ctx);
	X = BN_CTX_get(ctx);
	if (X == NULL) {
		ECDSAerror(ERR_R_BN_LIB);
		goto err;
	}

	if (!EC_GROUP_get_order(group, order, ctx)) {
		ECDSAerror(ERR_R_EC_LIB);
		goto err;
	}

	/* 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;
		goto err;
	}












	if (!ecdsa_prepare_digest(dgst, dgst_len, order, m))

		goto err;



	if (!BN_mod_inverse_ct(u2, sig->s, order, ctx)) {	/* w = inv(s) */
		ECDSAerror(ERR_R_BN_LIB);
		goto err;
	}

	if (!BN_mod_mul(u1, m, u2, order, ctx)) {		/* u1 = mw */
		ECDSAerror(ERR_R_BN_LIB);
		goto err;
	}

	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;
	}
	if (!EC_POINT_mul(group, point, u1, pub_key, u2, 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, 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)) {
			ECDSAerror(ERR_R_EC_LIB);
			goto err;
		}
	}
#endif
	if (!BN_nnmod(u1, X, order, ctx)) {
		ECDSAerror(ERR_R_BN_LIB);
		goto err;
	}

	/* If the signature is correct, the x-coordinate is equal to sig->r. */
	ret = (BN_ucmp(u1, sig->r) == 0);

 err:
	BN_CTX_end(ctx);
	BN_CTX_free(ctx);
	EC_POINT_free(point);
	return ret;
}
Changes to jni/libressl/crypto/engine/eng_cnf.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: eng_cnf.c,v 1.14 2017/01/29 17:49:23 beck Exp $ */
/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL
 * project 2001.
 */
/* ====================================================================
 * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
	if (ret != 1) {
		ENGINEerror(ENGINE_R_ENGINE_CONFIGURATION_ERROR);
		if (ecmd)
			ERR_asprintf_error_data(
			    "section=%s, name=%s, value=%s",
			    ecmd->section, ecmd->name, ecmd->value);
	}
	if (e)
		ENGINE_free(e);
	return ret;
}


static int
int_engine_module_init(CONF_IMODULE *md, const CONF *cnf)
{







<
|







196
197
198
199
200
201
202

203
204
205
206
207
208
209
210
	if (ret != 1) {
		ENGINEerror(ENGINE_R_ENGINE_CONFIGURATION_ERROR);
		if (ecmd)
			ERR_asprintf_error_data(
			    "section=%s, name=%s, value=%s",
			    ecmd->section, ecmd->name, ecmd->value);
	}

	ENGINE_free(e);
	return ret;
}


static int
int_engine_module_init(CONF_IMODULE *md, const CONF *cnf)
{
Changes to jni/libressl/crypto/engine/eng_init.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: eng_init.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */
/* ====================================================================
 * Copyright (c) 1999-2001 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
2
3
4
5
6
7
8
/* $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.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149

/* The API (locked) version of "finish" */
int
ENGINE_finish(ENGINE *e)
{
	int to_return = 1;

	if (e == NULL) {
		ENGINEerror(ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
	to_return = engine_unlocked_finish(e, 1);
	CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
	if (!to_return) {
		ENGINEerror(ENGINE_R_FINISH_FAILED);
		return 0;
	}
	return to_return;
}







|
<
|
<









130
131
132
133
134
135
136
137

138

139
140
141
142
143
144
145
146
147

/* The API (locked) version of "finish" */
int
ENGINE_finish(ENGINE *e)
{
	int to_return = 1;

	if (e == NULL)

		return 1;

	CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
	to_return = engine_unlocked_finish(e, 1);
	CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
	if (!to_return) {
		ENGINEerror(ENGINE_R_FINISH_FAILED);
		return 0;
	}
	return to_return;
}
Changes to jni/libressl/crypto/engine/eng_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: eng_lib.c,v 1.13 2018/03/17 16:20:01 beck Exp $ */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 1999-2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
}

int
engine_free_util(ENGINE *e, int locked)
{
	int i;

	if (e == NULL) {
		ENGINEerror(ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	if (locked)
		i = CRYPTO_add(&e->struct_ref, -1, CRYPTO_LOCK_ENGINE);
	else
		i = --e->struct_ref;
	engine_ref_debug(e, 0, -1)
	if (i > 0)
		return 1;







|
<
|
<







111
112
113
114
115
116
117
118

119

120
121
122
123
124
125
126
}

int
engine_free_util(ENGINE *e, int locked)
{
	int i;

	if (e == NULL)

		return 1;

	if (locked)
		i = CRYPTO_add(&e->struct_ref, -1, CRYPTO_LOCK_ENGINE);
	else
		i = --e->struct_ref;
	engine_ref_debug(e, 0, -1)
	if (i > 0)
		return 1;
Changes to jni/libressl/crypto/engine/eng_list.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: eng_list.c,v 1.22 2017/01/29 17:49:23 beck Exp $ */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 1999-2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: eng_list.c,v 1.23 2018/08/24 19:25:31 tb Exp $ */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 1999-2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
369
370
371
372
373
374
375


376
377
378
379
380
381
382
	}
	return iterator;
}

int
ENGINE_up_ref(ENGINE *e)
{


	if (e == NULL) {
		ENGINEerror(ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	CRYPTO_add(&e->struct_ref, 1, CRYPTO_LOCK_ENGINE);
	return 1;
}







>
>




|
|

369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
	}
	return iterator;
}

int
ENGINE_up_ref(ENGINE *e)
{
	int refs;

	if (e == NULL) {
		ENGINEerror(ERR_R_PASSED_NULL_PARAMETER);
		return 0;
	}
	refs = CRYPTO_add(&e->struct_ref, 1, CRYPTO_LOCK_ENGINE);
	return refs > 1 ? 1 : 0;
}
Changes to jni/libressl/crypto/engine/eng_openssl.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: eng_openssl.c,v 1.12 2015/12/07 03:30:09 bcook Exp $ */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 1999-2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
}

static ENGINE *
engine_openssl(void)
{
	ENGINE *ret = ENGINE_new();

	if (!ret)
		return NULL;
	if (!bind_helper(ret)) {
		ENGINE_free(ret);
		return NULL;
	}
	return ret;
}

void
ENGINE_load_openssl(void)
{
	ENGINE *toadd = engine_openssl();

	if (!toadd)
		return;
	(void) ENGINE_add(toadd);
	/* If the "add" worked, it gets a structural reference. So either way,
	 * we release our just-created reference. */
	ENGINE_free(toadd);
	ERR_clear_error();
}







|













|







173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
}

static ENGINE *
engine_openssl(void)
{
	ENGINE *ret = ENGINE_new();

	if (ret == NULL)
		return NULL;
	if (!bind_helper(ret)) {
		ENGINE_free(ret);
		return NULL;
	}
	return ret;
}

void
ENGINE_load_openssl(void)
{
	ENGINE *toadd = engine_openssl();

	if (toadd == NULL)
		return;
	(void) ENGINE_add(toadd);
	/* If the "add" worked, it gets a structural reference. So either way,
	 * we release our just-created reference. */
	ENGINE_free(toadd);
	ERR_clear_error();
}
Changes to jni/libressl/crypto/err/err.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: err.c,v 1.46 2018/03/17 16:20:01 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
1103
1104
1105
1106
1107
1108
1109
1110

1111
1112
1113
1114
1115
1116
1117

	err_clear_data(es, i);
	es->err_data[i] = data;
	es->err_data_flags[i] = flags;
}

void
ERR_asprintf_error_data(char * format, ...) {

	char *errbuf = NULL;
	va_list ap;
	int r;

	va_start(ap, format);
	r = vasprintf(&errbuf, format, ap);
	va_end(ap);







|
>







1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118

	err_clear_data(es, i);
	es->err_data[i] = data;
	es->err_data_flags[i] = flags;
}

void
ERR_asprintf_error_data(char * format, ...)
{
	char *errbuf = NULL;
	va_list ap;
	int r;

	va_start(ap, format);
	r = vasprintf(&errbuf, format, ap);
	va_end(ap);
Changes to jni/libressl/crypto/evp/bio_b64.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bio_b64.c,v 1.20 2015/02/07 13:19:15 doug 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
	int start;		/* have we started decoding yet? */
	int cont;		/* <= 0 when finished */
	EVP_ENCODE_CTX base64;
	char buf[EVP_ENCODE_LENGTH(B64_BLOCK_SIZE) + 10];
	char tmp[B64_BLOCK_SIZE];
} BIO_B64_CTX;

static BIO_METHOD methods_b64 = {
	.type = BIO_TYPE_BASE64,
	.name = "base64 encoding",
	.bwrite = b64_write,
	.bread = b64_read,
	.bputs = b64_puts,
	.ctrl = b64_ctrl,
	.create = b64_new,
	.destroy = b64_free,
	.callback_ctrl = b64_callback_ctrl
};

BIO_METHOD *
BIO_f_base64(void)
{
	return (&methods_b64);
}

static int
b64_new(BIO *bi)







|











|







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
	int start;		/* have we started decoding yet? */
	int cont;		/* <= 0 when finished */
	EVP_ENCODE_CTX base64;
	char buf[EVP_ENCODE_LENGTH(B64_BLOCK_SIZE) + 10];
	char tmp[B64_BLOCK_SIZE];
} BIO_B64_CTX;

static const BIO_METHOD methods_b64 = {
	.type = BIO_TYPE_BASE64,
	.name = "base64 encoding",
	.bwrite = b64_write,
	.bread = b64_read,
	.bputs = b64_puts,
	.ctrl = b64_ctrl,
	.create = b64_new,
	.destroy = b64_free,
	.callback_ctrl = b64_callback_ctrl
};

const BIO_METHOD *
BIO_f_base64(void)
{
	return (&methods_b64);
}

static int
b64_new(BIO *bi)
426
427
428
429
430
431
432
433
434
435

436
437
438
439
440
441
442
				    (const unsigned char *)in, n);
				OPENSSL_assert(ctx->buf_len <=
				    (int)sizeof(ctx->buf));
				OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
				ret += n;
			}
		} else {
			EVP_EncodeUpdate(&(ctx->base64),
			    (unsigned char *)ctx->buf, &ctx->buf_len,
			    (unsigned char *)in, n);

			OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
			OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
			ret += n;
		}
		inl -= n;
		in += n;








|

|
>







426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
				    (const unsigned char *)in, n);
				OPENSSL_assert(ctx->buf_len <=
				    (int)sizeof(ctx->buf));
				OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
				ret += n;
			}
		} else {
			if (!EVP_EncodeUpdate(&(ctx->base64),
			    (unsigned char *)ctx->buf, &ctx->buf_len,
			    (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;
		}
		inl -= n;
		in += n;

Changes to jni/libressl/crypto/evp/bio_enc.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bio_enc.c,v 1.20 2017/05/02 03:59:44 deraadt 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
	EVP_CIPHER_CTX cipher;
	/* buf is larger than ENC_BLOCK_SIZE because EVP_DecryptUpdate
	 * can return up to a block more data than is presented to it
	 */
	char buf[ENC_BLOCK_SIZE + BUF_OFFSET + 2];
} BIO_ENC_CTX;

static BIO_METHOD methods_enc = {
	.type = BIO_TYPE_CIPHER,
	.name = "cipher",
	.bwrite = enc_write,
	.bread = enc_read,
	.ctrl = enc_ctrl,
	.create = enc_new,
	.destroy = enc_free,
	.callback_ctrl = enc_callback_ctrl
};

BIO_METHOD *
BIO_f_cipher(void)
{
	return (&methods_enc);
}

static int
enc_new(BIO *bi)







|










|







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
	EVP_CIPHER_CTX cipher;
	/* buf is larger than ENC_BLOCK_SIZE because EVP_DecryptUpdate
	 * can return up to a block more data than is presented to it
	 */
	char buf[ENC_BLOCK_SIZE + BUF_OFFSET + 2];
} BIO_ENC_CTX;

static const BIO_METHOD methods_enc = {
	.type = BIO_TYPE_CIPHER,
	.name = "cipher",
	.bwrite = enc_write,
	.bread = enc_read,
	.ctrl = enc_ctrl,
	.create = enc_new,
	.destroy = enc_free,
	.callback_ctrl = enc_callback_ctrl
};

const BIO_METHOD *
BIO_f_cipher(void)
{
	return (&methods_enc);
}

static int
enc_new(BIO *bi)
400
401
402
403
404
405
406
407
408
409
410
411

412
413
414
415


416

417

418
419
420

421
422

423
424
425
426


	memcpy(ctx->cipher,c,sizeof(EVP_CIPHER_CTX));

	if (b->callback != NULL)
		b->callback(b,BIO_CB_CTRL,(char *)c,BIO_CTRL_SET,e,1L);
	}
*/

void
BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k,
    const unsigned char *i, int e)
{
	BIO_ENC_CTX *ctx;


	if (b == NULL)
		return;



	if ((b->callback != NULL) &&

	    (b->callback(b, BIO_CB_CTRL, (const char *)c, BIO_CTRL_SET, e, 0L) <= 0))

		return;

	b->init = 1;

	ctx = (BIO_ENC_CTX *)b->ptr;
	EVP_CipherInit_ex(&(ctx->cipher), c, NULL, k, i, e);


	if (b->callback != NULL)
		b->callback(b, BIO_CB_CTRL, (const char *)c, BIO_CTRL_SET, e, 1L);
}









|




>


|

>
>
|
>
|
>
|
|
|
>
|
|
>

|
|
|
>
>
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
	memcpy(ctx->cipher,c,sizeof(EVP_CIPHER_CTX));

	if (b->callback != NULL)
		b->callback(b,BIO_CB_CTRL,(char *)c,BIO_CTRL_SET,e,1L);
	}
*/

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 0;

	if ((ctx = BIO_get_data(b)) == NULL)
		return 0;

	if ((cb = BIO_get_callback(b)) != NULL) {
		if (cb(b, BIO_CB_CTRL, (const char *)c, BIO_CTRL_SET, e, 0L)
		    <= 0)
			return 0;
	}

	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;
}
Changes to jni/libressl/crypto/evp/bio_md.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bio_md.c,v 1.14 2014/07/11 08:44:48 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*static int md_puts(BIO *h, const char *str); */
static int md_gets(BIO *h, char *str, int size);
static long md_ctrl(BIO *h, int cmd, long arg1, void *arg2);
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 = {
	.type = BIO_TYPE_MD,
	.name = "message digest",
	.bwrite = md_write,
	.bread = md_read,
	.bgets = md_gets,
	.ctrl = md_ctrl,
	.create = md_new,
	.destroy = md_free,
	.callback_ctrl = md_callback_ctrl
};

BIO_METHOD *
BIO_f_md(void)
{
	return (&methods_md);
}

static int
md_new(BIO *bi)







|











|







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*static int md_puts(BIO *h, const char *str); */
static int md_gets(BIO *h, char *str, int size);
static long md_ctrl(BIO *h, int cmd, long arg1, void *arg2);
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 const BIO_METHOD methods_md = {
	.type = BIO_TYPE_MD,
	.name = "message digest",
	.bwrite = md_write,
	.bread = md_read,
	.bgets = md_gets,
	.ctrl = md_ctrl,
	.create = md_new,
	.destroy = md_free,
	.callback_ctrl = md_callback_ctrl
};

const BIO_METHOD *
BIO_f_md(void)
{
	return (&methods_md);
}

static int
md_new(BIO *bi)
Changes to jni/libressl/crypto/evp/digest.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: digest.c,v 1.29 2018/02/17 14:55:31 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
	if (ctx->engine && ctx->digest && (!type ||
	    (type && (type->type == ctx->digest->type))))
		goto skip_to_init;
	if (type) {
		/* 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) {
			if (!ENGINE_init(impl)) {
				EVPerror(EVP_R_INITIALIZATION_ERROR);
				return 0;
			}
		} else
			/* Ask if an ENGINE is reserved for this job */
			impl = ENGINE_get_digest_engine(type->type);
		if (impl) {
			/* There's an ENGINE for this job ... (apparently) */
			const EVP_MD *d = ENGINE_get_digest(impl, type->type);
			if (!d) {
				/* Same comment from evp_enc.c */
				EVPerror(EVP_R_INITIALIZATION_ERROR);
				ENGINE_finish(impl);
				return 0;
			}
			/* We'll use the ENGINE's private digest definition */
			type = d;







<
|
|







|


|







142
143
144
145
146
147
148

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
	if (ctx->engine && ctx->digest && (!type ||
	    (type && (type->type == ctx->digest->type))))
		goto skip_to_init;
	if (type) {
		/* 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). */

		ENGINE_finish(ctx->engine);
		if (impl != NULL) {
			if (!ENGINE_init(impl)) {
				EVPerror(EVP_R_INITIALIZATION_ERROR);
				return 0;
			}
		} else
			/* Ask if an ENGINE is reserved for this job */
			impl = ENGINE_get_digest_engine(type->type);
		if (impl != NULL) {
			/* There's an ENGINE for this job ... (apparently) */
			const EVP_MD *d = ENGINE_get_digest(impl, type->type);
			if (d == NULL) {
				/* Same comment from evp_enc.c */
				EVPerror(EVP_R_INITIALIZATION_ERROR);
				ENGINE_finish(impl);
				return 0;
			}
			/* We'll use the ENGINE's private digest definition */
			type = d;
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
	    !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_CLEANED))
		ctx->digest->cleanup(ctx);
	if (ctx->digest && ctx->digest->ctx_size && ctx->md_data &&
	    !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE))
		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);
#endif
	memset(ctx, 0, sizeof(*ctx));

	return 1;
}

int







<
<
<
|







379
380
381
382
383
384
385



386
387
388
389
390
391
392
393
	    !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_CLEANED))
		ctx->digest->cleanup(ctx);
	if (ctx->digest && ctx->digest->ctx_size && ctx->md_data &&
	    !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE))
		freezero(ctx->md_data, ctx->digest->ctx_size);
	EVP_PKEY_CTX_free(ctx->pctx);
#ifndef OPENSSL_NO_ENGINE



	ENGINE_finish(ctx->engine);
#endif
	memset(ctx, 0, sizeof(*ctx));

	return 1;
}

int
Changes to jni/libressl/crypto/evp/encode.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: encode.c,v 1.24 2016/05/04 15:05:13 tedu 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: encode.c,v 1.25 2018/08/24 19:45:11 tb 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.
 *
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
EVP_EncodeInit(EVP_ENCODE_CTX *ctx)
{
	ctx->length = 48;
	ctx->num = 0;
	ctx->line_num = 0;
}

void
EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
    const unsigned char *in, int inl)
{
	int i, j;
	size_t total = 0;

	*outl = 0;
	if (inl == 0)
		return;
	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;
	}
	if (ctx->num != 0) {
		i = ctx->length - ctx->num;
		memcpy(&(ctx->enc_data[ctx->num]), in, i);
		in += i;
		inl -= i;
		j = EVP_EncodeBlock(out, ctx->enc_data, ctx->length);







|







|
|




|







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
EVP_EncodeInit(EVP_ENCODE_CTX *ctx)
{
	ctx->length = 48;
	ctx->num = 0;
	ctx->line_num = 0;
}

int
EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
    const unsigned char *in, int inl)
{
	int i, j;
	size_t total = 0;

	*outl = 0;
	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 1;
	}
	if (ctx->num != 0) {
		i = ctx->length - ctx->num;
		memcpy(&(ctx->enc_data[ctx->num]), in, i);
		in += i;
		inl -= i;
		j = EVP_EncodeBlock(out, ctx->enc_data, ctx->length);
156
157
158
159
160
161
162
163
164
165
166
167
168


169
170
171
172
173
174
175
		*(out++) = '\n';
		*out = '\0';
		total += j + 1;
	}
	if (total > INT_MAX) {
		/* Too much output data! */
		*outl = 0;
		return;
	}
	if (inl != 0)
		memcpy(&(ctx->enc_data[0]), in, inl);
	ctx->num = inl;
	*outl = total;


}

void
EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)
{
	unsigned int ret = 0;








|





>
>







156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
		*(out++) = '\n';
		*out = '\0';
		total += j + 1;
	}
	if (total > INT_MAX) {
		/* Too much output data! */
		*outl = 0;
		return 0;
	}
	if (inl != 0)
		memcpy(&(ctx->enc_data[0]), in, inl);
	ctx->num = inl;
	*outl = total;

	return 1;
}

void
EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)
{
	unsigned int ret = 0;

Changes to jni/libressl/crypto/evp/evp_enc.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: evp_enc.c,v 1.38 2018/02/17 16:54: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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: evp_enc.c,v 1.39 2018/04/14 07:09:21 tb 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.
 *
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
			return 0;
		/* Cleanse cipher context data */
		if (c->cipher_data)
			explicit_bzero(c->cipher_data, c->cipher->ctx_size);
	}
	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);
#endif
	explicit_bzero(c, sizeof(EVP_CIPHER_CTX));
	return 1;
}

int
EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen)







<
<
<
|







573
574
575
576
577
578
579



580
581
582
583
584
585
586
587
			return 0;
		/* Cleanse cipher context data */
		if (c->cipher_data)
			explicit_bzero(c->cipher_data, c->cipher->ctx_size);
	}
	free(c->cipher_data);
#ifndef OPENSSL_NO_ENGINE



	ENGINE_finish(c->engine);
#endif
	explicit_bzero(c, sizeof(EVP_CIPHER_CTX));
	return 1;
}

int
EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen)
Changes to jni/libressl/crypto/evp/evp_key.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: evp_key.c,v 1.24 2017/01/29 17:49:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
97
98
99
100
101
102
103





104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt,
    int verify)
{
	int ret;
	char buff[BUFSIZ];
	UI *ui;






	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)
		return -1;
	if (verify) {
		if (UI_add_verify_string(ui, prompt, 0, buff, min,
		    (len >= BUFSIZ) ? BUFSIZ - 1 : len, buf) < 0)
			return -1;
	}
	ret = UI_process(ui);
	UI_free(ui);
	explicit_bzero(buff, BUFSIZ);
	return ret;
}







>
>
>
>
>





|
<


|
|







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123
124
125
EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt,
    int verify)
{
	int ret;
	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 - 1) < 0)

		return -1;
	if (verify) {
		if (UI_add_verify_string(ui, prompt, 0, buff, min, len - 1, buf)
		    < 0)
			return -1;
	}
	ret = UI_process(ui);
	UI_free(ui);
	explicit_bzero(buff, BUFSIZ);
	return ret;
}
Changes to jni/libressl/crypto/evp/evp_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: evp_lib.c,v 1.15 2017/01/29 17:49:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
202
203
204
205
206
207
208






209
210
211
212
213
214
215
}

const EVP_CIPHER *
EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx)
{
	return ctx->cipher;
}







unsigned long
EVP_CIPHER_flags(const EVP_CIPHER *cipher)
{
	return cipher->flags;
}








>
>
>
>
>
>







202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
}

const EVP_CIPHER *
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)
{
	return cipher->flags;
}

262
263
264
265
266
267
268






































269
270
271
272
273
274
275
}

int
EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx)
{
	return ctx->cipher->nid;
}







































int
EVP_MD_block_size(const EVP_MD *md)
{
	return md->block_size;
}








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
}

int
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)
{
	return md->block_size;
}

Changes to jni/libressl/crypto/evp/evp_pkey.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: evp_pkey.c,v 1.19 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <openssl/x509.h>

#include "asn1_locl.h"

/* Extract a private key from a PKCS8 structure */

EVP_PKEY *
EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8)
{
	EVP_PKEY *pkey = NULL;
	ASN1_OBJECT *algoid;
	char obj_tmp[80];

	if (!PKCS8_pkey_get0(&algoid, NULL, NULL, NULL, p8))
		return NULL;

	if (!(pkey = EVP_PKEY_new())) {
		EVPerror(ERR_R_MALLOC_FAILURE);







|


|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <openssl/x509.h>

#include "asn1_locl.h"

/* Extract a private key from a PKCS8 structure */

EVP_PKEY *
EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8)
{
	EVP_PKEY *pkey = NULL;
	const ASN1_OBJECT *algoid;
	char obj_tmp[80];

	if (!PKCS8_pkey_get0(&algoid, NULL, NULL, NULL, p8))
		return NULL;

	if (!(pkey = EVP_PKEY_new())) {
		EVPerror(ERR_R_MALLOC_FAILURE);
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
	return pkey;

error:
	EVP_PKEY_free(pkey);
	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)
{
	PKCS8_PRIV_KEY_INFO *p8;

	if (!(p8 = PKCS8_PRIV_KEY_INFO_new())) {
		EVPerror(ERR_R_MALLOC_FAILURE);
		return NULL;
	}
	p8->broken = broken;

	if (pkey->ameth) {
		if (pkey->ameth->priv_encode) {
			if (!pkey->ameth->priv_encode(p8, pkey)) {
				EVPerror(EVP_R_PRIVATE_KEY_ENCODE_ERROR);
				goto error;
			}







<
<
<
<
<
<



|







<







101
102
103
104
105
106
107






108
109
110
111
112
113
114
115
116
117
118

119
120
121
122
123
124
125
	return pkey;

error:
	EVP_PKEY_free(pkey);
	return NULL;
}







/* Turn a private key into a PKCS8 structure */

PKCS8_PRIV_KEY_INFO *
EVP_PKEY2PKCS8(EVP_PKEY *pkey)
{
	PKCS8_PRIV_KEY_INFO *p8;

	if (!(p8 = PKCS8_PRIV_KEY_INFO_new())) {
		EVPerror(ERR_R_MALLOC_FAILURE);
		return NULL;
	}


	if (pkey->ameth) {
		if (pkey->ameth->priv_encode) {
			if (!pkey->ameth->priv_encode(p8, pkey)) {
				EVPerror(EVP_R_PRIVATE_KEY_ENCODE_ERROR);
				goto error;
			}
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184

185
186
187
188
189
190
191
	return p8;

error:
	PKCS8_PRIV_KEY_INFO_free(p8);
	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
EVP_PKEY_get_attr_count(const EVP_PKEY *key)
{
	return X509at_get_attr_count(key->attributes);
}

int
EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos)
{
	return X509at_get_attr_by_NID(key->attributes, nid, lastpos);
}

int
EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj, int lastpos)

{
	return X509at_get_attr_by_OBJ(key->attributes, obj, lastpos);
}

X509_ATTRIBUTE *
EVP_PKEY_get_attr(const EVP_PKEY *key, int loc)
{







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<















|
>







134
135
136
137
138
139
140





















141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
	return p8;

error:
	PKCS8_PRIV_KEY_INFO_free(p8);
	return NULL;
}






















/* EVP_PKEY attribute functions */

int
EVP_PKEY_get_attr_count(const EVP_PKEY *key)
{
	return X509at_get_attr_count(key->attributes);
}

int
EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos)
{
	return X509at_get_attr_by_NID(key->attributes, nid, lastpos);
}

int
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);
}

X509_ATTRIBUTE *
EVP_PKEY_get_attr(const EVP_PKEY *key, int loc)
{
Changes to jni/libressl/crypto/evp/m_md5_sha1.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21




22
23
24
25
26
27
28
/* $OpenBSD: m_md5_sha1.c,v 1.1 2017/02/28 14:15:37 jsing Exp $ */
/*
 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
 *
 * 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 <openssl/evp.h>
#include <openssl/md5.h>
#include <openssl/objects.h>
#include <openssl/sha.h>





struct md5_sha1_ctx {
	MD5_CTX md5;
	SHA_CTX sha1;
};

static int
|




















>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* $OpenBSD: m_md5_sha1.c,v 1.2 2018/08/10 17:30:29 jsing Exp $ */
/*
 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
 *
 * 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 <openssl/evp.h>
#include <openssl/md5.h>
#include <openssl/objects.h>
#include <openssl/sha.h>

#ifndef OPENSSL_NO_RSA
#include <openssl/rsa.h>
#endif

struct md5_sha1_ctx {
	MD5_CTX md5;
	SHA_CTX sha1;
};

static int
70
71
72
73
74
75
76







77
78
79
80
81
82
83
        .md_size = MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH,
        .flags = 0,
        .init = md5_sha1_init,
        .update = md5_sha1_update,
        .final = md5_sha1_final,
        .block_size = MD5_CBLOCK, /* MD5_CBLOCK == SHA_CBLOCK */
        .ctx_size = sizeof(EVP_MD *) + sizeof(struct md5_sha1_ctx),







};

const EVP_MD *
EVP_md5_sha1(void)
{
	return &md5_sha1_md;
}







>
>
>
>
>
>
>







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
        .md_size = MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH,
        .flags = 0,
        .init = md5_sha1_init,
        .update = md5_sha1_update,
        .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 *
EVP_md5_sha1(void)
{
	return &md5_sha1_md;
}
Changes to jni/libressl/crypto/evp/m_sigver.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: m_sigver.c,v 1.6 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006,2007 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006,2007 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
				return 0;
		}
	}
	return 1;
}

int
EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen)
{
	EVP_MD_CTX tmp_ctx;
	unsigned char md[EVP_MAX_MD_SIZE];
	int r;
	unsigned int mdlen = 0;
	int vctx;








|







162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
				return 0;
		}
	}
	return 1;
}

int
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];
	int r;
	unsigned int mdlen = 0;
	int vctx;

Changes to jni/libressl/crypto/evp/p_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: p_lib.c,v 1.20 2018/02/20 18:05:28 tb 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: p_lib.c,v 1.24 2018/05/30 15:40:50 tb 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.
 *
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#endif

#include "asn1_locl.h"

static void EVP_PKEY_free_it(EVP_PKEY *x);

int
EVP_PKEY_bits(EVP_PKEY *pkey)
{
	if (pkey && pkey->ameth && pkey->ameth->pkey_bits)
		return pkey->ameth->pkey_bits(pkey);
	return 0;
}

int
EVP_PKEY_size(EVP_PKEY *pkey)
{
	if (pkey && pkey->ameth && pkey->ameth->pkey_size)
		return pkey->ameth->pkey_size(pkey);
	return 0;
}

int







|







|







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#endif

#include "asn1_locl.h"

static void EVP_PKEY_free_it(EVP_PKEY *x);

int
EVP_PKEY_bits(const EVP_PKEY *pkey)
{
	if (pkey && pkey->ameth && pkey->ameth->pkey_bits)
		return pkey->ameth->pkey_bits(pkey);
	return 0;
}

int
EVP_PKEY_size(const EVP_PKEY *pkey)
{
	if (pkey && pkey->ameth && pkey->ameth->pkey_size)
		return pkey->ameth->pkey_size(pkey);
	return 0;
}

int
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
			EVP_PKEY_free_it(pkey);
		/* If key type matches and a method exists then this
		 * lookup has succeeded once so just indicate success.
		 */
		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;
		}
#endif
	}
	if (str)
		ameth = EVP_PKEY_asn1_find_str(&e, str, len);
	else
		ameth = EVP_PKEY_asn1_find(&e, type);
#ifndef OPENSSL_NO_ENGINE
	if (!pkey && e)
		ENGINE_finish(e);
#endif
	if (!ameth) {
		EVPerror(EVP_R_UNSUPPORTED_ALGORITHM);
		return 0;
	}
	if (pkey) {







<
<
|
|
<







|







225
226
227
228
229
230
231


232
233

234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
			EVP_PKEY_free_it(pkey);
		/* If key type matches and a method exists then this
		 * lookup has succeeded once so just indicate success.
		 */
		if ((type == pkey->save_type) && pkey->ameth)
			return 1;
#ifndef OPENSSL_NO_ENGINE


		ENGINE_finish(pkey->engine);
		pkey->engine = NULL;

#endif
	}
	if (str)
		ameth = EVP_PKEY_asn1_find_str(&e, str, len);
	else
		ameth = EVP_PKEY_asn1_find(&e, type);
#ifndef OPENSSL_NO_ENGINE
	if (pkey == NULL)
		ENGINE_finish(e);
#endif
	if (!ameth) {
		EVPerror(EVP_R_UNSUPPORTED_ALGORITHM);
		return 0;
	}
	if (pkey) {
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
	if (!EVP_PKEY_set_type(pkey, type))
		return 0;
	pkey->pkey.ptr = key;
	return (key != NULL);
}

void *
EVP_PKEY_get0(EVP_PKEY *pkey)
{
	return pkey->pkey.ptr;
}

#ifndef OPENSSL_NO_RSA
RSA *
EVP_PKEY_get0_RSA(EVP_PKEY *pkey)







|







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
	if (!EVP_PKEY_set_type(pkey, type))
		return 0;
	pkey->pkey.ptr = key;
	return (key != NULL);
}

void *
EVP_PKEY_get0(const EVP_PKEY *pkey)
{
	return pkey->pkey.ptr;
}

#ifndef OPENSSL_NO_RSA
RSA *
EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
	ENGINE *e;
	ameth = EVP_PKEY_asn1_find(&e, type);
	if (ameth)
		ret = ameth->pkey_id;
	else
		ret = NID_undef;
#ifndef OPENSSL_NO_ENGINE
	if (e)
		ENGINE_finish(e);
#endif
	return ret;
}

int
EVP_PKEY_id(const EVP_PKEY *pkey)
{







<
|







419
420
421
422
423
424
425

426
427
428
429
430
431
432
433
	ENGINE *e;
	ameth = EVP_PKEY_asn1_find(&e, type);
	if (ameth)
		ret = ameth->pkey_id;
	else
		ret = NID_undef;
#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(e);
#endif
	return ret;
}

int
EVP_PKEY_id(const EVP_PKEY *pkey)
{
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
EVP_PKEY_free_it(EVP_PKEY *x)
{
	if (x->ameth && x->ameth->pkey_free) {
		x->ameth->pkey_free(x);
		x->pkey.ptr = NULL;
	}
#ifndef OPENSSL_NO_ENGINE
	if (x->engine) {
		ENGINE_finish(x->engine);
		x->engine = NULL;
	}
#endif
}

static int
unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent, const char *kstr)
{
	BIO_indent(out, indent, 128);







<
|
|
<







462
463
464
465
466
467
468

469
470

471
472
473
474
475
476
477
EVP_PKEY_free_it(EVP_PKEY *x)
{
	if (x->ameth && x->ameth->pkey_free) {
		x->ameth->pkey_free(x);
		x->pkey.ptr = NULL;
	}
#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(x->engine);
	x->engine = NULL;

#endif
}

static int
unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent, const char *kstr)
{
	BIO_indent(out, indent, 128);
Changes to jni/libressl/crypto/evp/pmeth_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: pmeth_lib.c,v 1.13 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201

	if (pmeth == NULL) {
		EVPerror(EVP_R_UNSUPPORTED_ALGORITHM);
		return NULL;
	}

	ret = malloc(sizeof(EVP_PKEY_CTX));
	if (!ret) {
#ifndef OPENSSL_NO_ENGINE
		if (e)
			ENGINE_finish(e);
#endif
		EVPerror(ERR_R_MALLOC_FAILURE);
		return NULL;
	}
	ret->engine = e;
	ret->pmeth = pmeth;
	ret->operation = EVP_PKEY_OP_UNDEFINED;







|

<
|







184
185
186
187
188
189
190
191
192

193
194
195
196
197
198
199
200

	if (pmeth == NULL) {
		EVPerror(EVP_R_UNSUPPORTED_ALGORITHM);
		return NULL;
	}

	ret = malloc(sizeof(EVP_PKEY_CTX));
	if (ret == NULL) {
#ifndef OPENSSL_NO_ENGINE

		ENGINE_finish(e);
#endif
		EVPerror(ERR_R_MALLOC_FAILURE);
		return NULL;
	}
	ret->engine = e;
	ret->pmeth = pmeth;
	ret->operation = EVP_PKEY_OP_UNDEFINED;
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
	if (ctx == NULL)
		return;
	if (ctx->pmeth && ctx->pmeth->cleanup)
		ctx->pmeth->cleanup(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);
#endif
	free(ctx);
}

int
EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd,
    int p1, void *p2)







<
<
<
|







389
390
391
392
393
394
395



396
397
398
399
400
401
402
403
	if (ctx == NULL)
		return;
	if (ctx->pmeth && ctx->pmeth->cleanup)
		ctx->pmeth->cleanup(ctx);
	EVP_PKEY_free(ctx->pkey);
	EVP_PKEY_free(ctx->peerkey);
#ifndef OPENSSL_NO_ENGINE



	ENGINE_finish(ctx->engine);
#endif
	free(ctx);
}

int
EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd,
    int p1, void *p2)
Changes to jni/libressl/crypto/gost/gostr341001_ameth.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: gostr341001_ameth.c,v 1.11 2017/01/29 17:49:23 beck Exp $ */
/*
 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
 * Copyright (c) 2005-2006 Cryptocom LTD
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
|







1
2
3
4
5
6
7
8
/* $OpenBSD: gostr341001_ameth.c,v 1.15 2018/08/24 20:22:15 tb Exp $ */
/*
 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
 * Copyright (c) 2005-2006 Cryptocom LTD
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
	int ptype = V_ASN1_UNDEF;
	ASN1_STRING *pval = NULL;

	if (X509_PUBKEY_get0_param(&palgobj, &pubkey_buf, &pub_len, &palg, pub)
	    == 0)
		return 0;
	(void)EVP_PKEY_assign_GOST(pk, NULL);
	X509_ALGOR_get0(NULL, &ptype, (void **)&pval, palg);
	if (ptype != V_ASN1_SEQUENCE) {
		GOSTerror(GOST_R_BAD_KEY_PARAMETERS_FORMAT);
		return 0;
	}
	p = pval->data;
	if (decode_gost01_algor_params(pk, &p, pval->length) == 0)
		return 0;







|







197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
	int ptype = V_ASN1_UNDEF;
	ASN1_STRING *pval = NULL;

	if (X509_PUBKEY_get0_param(&palgobj, &pubkey_buf, &pub_len, &palg, pub)
	    == 0)
		return 0;
	(void)EVP_PKEY_assign_GOST(pk, NULL);
	X509_ALGOR_get0(NULL, &ptype, (const void **)&pval, palg);
	if (ptype != V_ASN1_SEQUENCE) {
		GOSTerror(GOST_R_BAD_KEY_PARAMETERS_FORMAT);
		return 0;
	}
	p = pval->data;
	if (decode_gost01_algor_params(pk, &p, pval->length) == 0)
		return 0;
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436

437
438
439
440
441
442
443
444
445
		BN_print(out, key);
	BIO_printf(out, "\n");

	return pub_print_gost01(out, pkey, indent, pctx);
}

static int
priv_decode_gost01(EVP_PKEY *pk, 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;
	ASN1_INTEGER *priv_key = NULL;
	GOST_KEY *ec;
	int ptype = V_ASN1_UNDEF;
	ASN1_STRING *pval = NULL;

	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);
	if (ptype != V_ASN1_SEQUENCE) {
		GOSTerror(GOST_R_BAD_KEY_PARAMETERS_FORMAT);
		return 0;
	}
	p = pval->data;
	if (decode_gost01_algor_params(pk, &p, pval->length) == 0)
		return 0;
	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) {
			GOSTerror(EVP_R_DECODE_ERROR);
			ASN1_STRING_free(s);
			return 0;
		}
		for (i = 0; i < 32; i++) {
			rev_buf[31 - i] = s->data[i];
		}

		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)
			return 0;
		ret = ((pk_num = ASN1_INTEGER_to_BN(priv_key, NULL)) != NULL);
		ASN1_INTEGER_free(priv_key);
		if (ret == 0) {







|





|
|








|










<
<



|




<
<
|
>

<







390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423


424
425
426
427
428
429
430
431


432
433
434

435
436
437
438
439
440
441
		BN_print(out, key);
	BIO_printf(out, "\n");

	return pub_print_gost01(out, pkey, indent, pctx);
}

static int
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;
	const X509_ALGOR *palg = NULL;
	const ASN1_OBJECT *palg_obj = NULL;
	ASN1_INTEGER *priv_key = NULL;
	GOST_KEY *ec;
	int ptype = V_ASN1_UNDEF;
	ASN1_STRING *pval = NULL;

	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, (const void **)&pval, palg);
	if (ptype != V_ASN1_SEQUENCE) {
		GOSTerror(GOST_R_BAD_KEY_PARAMETERS_FORMAT);
		return 0;
	}
	p = pval->data;
	if (decode_gost01_algor_params(pk, &p, pval->length) == 0)
		return 0;
	p = pkey_buf;
	if (V_ASN1_OCTET_STRING == *p) {
		/* New format - Little endian octet string */


		ASN1_OCTET_STRING *s =
		    d2i_ASN1_OCTET_STRING(NULL, &p, priv_len);

		if (s == NULL) {
			GOSTerror(EVP_R_DECODE_ERROR);
			ASN1_STRING_free(s);
			return 0;
		}



		pk_num = GOST_le2bn(s->data, s->length, NULL);
		ASN1_STRING_free(s);

	} else {
		priv_key = d2i_ASN1_INTEGER(NULL, &p, priv_len);
		if (priv_key == NULL)
			return 0;
		ret = ((pk_num = ASN1_INTEGER_to_BN(priv_key, NULL)) != NULL);
		ASN1_INTEGER_free(priv_key);
		if (ret == 0) {
Changes to jni/libressl/crypto/hkdf/hkdf.c.

1
2
3
4
5
6
7

/* Copyright (c) 2014, Google 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
>







1
2
3
4
5
6
7
8
/* $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
 * 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
Changes to jni/libressl/crypto/malloc-wrapper.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: malloc-wrapper.c,v 1.6 2017/05/02 03:59:44 deraadt Exp $ */
/*
 * Copyright (c) 2014 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: malloc-wrapper.c,v 1.7 2018/05/13 13:49:04 jsing Exp $ */
/*
 * Copyright (c) 2014 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.
 *
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162

163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
}

void *
CRYPTO_realloc(void *ptr, int num, const char *file, int line)
{
	if (num <= 0)
		return NULL;

	return realloc(ptr, num);
}

void *
CRYPTO_realloc_clean(void *ptr, int old_len, int num, const char *file,
    int line)
{
	void *ret = NULL;

	if (num <= 0)
		return NULL;

	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;
}

void
CRYPTO_free(void *ptr)
{
	free(ptr);
}







<







<
<


>

|
<
<
<
<
<
|







144
145
146
147
148
149
150

151
152
153
154
155
156
157


158
159
160
161
162





163
164
165
166
167
168
169
170
}

void *
CRYPTO_realloc(void *ptr, int num, const char *file, int line)
{
	if (num <= 0)
		return NULL;

	return realloc(ptr, num);
}

void *
CRYPTO_realloc_clean(void *ptr, int old_len, int num, const char *file,
    int line)
{


	if (num <= 0)
		return NULL;
	/* Original does not support shrinking. */
	if (num < old_len)
		return NULL;





	return recallocarray(ptr, old_len, num, 1);
}

void
CRYPTO_free(void *ptr)
{
	free(ptr);
}
Changes to jni/libressl/crypto/mem_dbg.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: mem_dbg.c,v 1.22 2014/06/12 15:49:27 deraadt 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: mem_dbg.c,v 1.23 2018/08/24 19:16:03 tb 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.
 *
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
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();
}

void
CRYPTO_mem_leaks(BIO *b)
{
	return;
}

void
CRYPTO_mem_leaks_fp(FILE *fp)
{
	return;
}


void
CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb)
{
	return;
}







|


|


|


|



|


|

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
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();
}

int
CRYPTO_mem_leaks(BIO *b)
{
	return -1;
}

int
CRYPTO_mem_leaks_fp(FILE *fp)
{
	return -1;
}


int
CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb)
{
	return -1;
}
Changes to jni/libressl/crypto/objects/obj_dat.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: obj_dat.c,v 1.39 2017/01/29 17:49:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
	}
	o->flags &= ~(ASN1_OBJECT_FLAG_DYNAMIC |
	    ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
	    ASN1_OBJECT_FLAG_DYNAMIC_DATA);

	return (o->nid);

err2:
	OBJerror(ERR_R_MALLOC_FAILURE);
err:
	for (i = ADDED_DATA; i <= ADDED_NID; i++)
		free(ao[i]);
	free(o);
	return (NID_undef);
}

ASN1_OBJECT *
OBJ_nid2obj(int n)
{
	ADDED_OBJ ad, *adp;







|

|


|







324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
	}
	o->flags &= ~(ASN1_OBJECT_FLAG_DYNAMIC |
	    ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
	    ASN1_OBJECT_FLAG_DYNAMIC_DATA);

	return (o->nid);

 err2:
	OBJerror(ERR_R_MALLOC_FAILURE);
 err:
	for (i = ADDED_DATA; i <= ADDED_NID; i++)
		free(ao[i]);
	ASN1_OBJECT_free(o);
	return (NID_undef);
}

ASN1_OBJECT *
OBJ_nid2obj(int n)
{
	ADDED_OBJ ad, *adp;
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
				buf_len -= i;
			}
			ret += i;
			l = 0;
		}
	}

out:
	BN_free(bl);
	return ret;

err:
	ret = 0;
	goto out;
}

int
OBJ_txt2nid(const char *s)
{







|



|







628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
				buf_len -= i;
			}
			ret += i;
			l = 0;
		}
	}

 out:
	BN_free(bl);
	return ret;

 err:
	ret = 0;
	goto out;
}

int
OBJ_txt2nid(const char *s)
{
806
807
808
809
810
811
812
813
814
815
816
817
	if (i == 0)
		goto err;
	op = (ASN1_OBJECT *)ASN1_OBJECT_create(OBJ_new_nid(1), buf, i, sn, ln);
	if (op == NULL)
		goto err;
	ok = OBJ_add_object(op);

err:
	ASN1_OBJECT_free(op);
	free(buf);
	return (ok);
}







|




806
807
808
809
810
811
812
813
814
815
816
817
	if (i == 0)
		goto err;
	op = (ASN1_OBJECT *)ASN1_OBJECT_create(OBJ_new_nid(1), buf, i, sn, ln);
	if (op == NULL)
		goto err;
	ok = OBJ_add_object(op);

 err:
	ASN1_OBJECT_free(op);
	free(buf);
	return (ok);
}
Changes to jni/libressl/crypto/objects/obj_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: obj_lib.c,v 1.14 2017/01/29 17:49:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
			goto err;
		r->sn = sn;
	}
	r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC |
	    ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | ASN1_OBJECT_FLAG_DYNAMIC_DATA);
	return (r);

err:
	OBJerror(ERR_R_MALLOC_FAILURE);
	free(ln);
	free(sn);
	free(data);
	free(r);
	return (NULL);
}







|







105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
			goto err;
		r->sn = sn;
	}
	r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC |
	    ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | ASN1_OBJECT_FLAG_DYNAMIC_DATA);
	return (r);

 err:
	OBJerror(ERR_R_MALLOC_FAILURE);
	free(ln);
	free(sn);
	free(data);
	free(r);
	return (NULL);
}
Changes to jni/libressl/crypto/ocsp/ocsp_ext.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ocsp_ext.c,v 1.15 2016/12/27 16:01:19 jsing Exp $ */
/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
 * project. */

/* History:
   This file was transfered to Richard Levitte from CertCo by Kathy
   Weinhold in mid-spring 2000 to be included in OpenSSL or released
   as a patch kit. */
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ocsp_ext.c,v 1.18 2018/05/14 23:47:10 tb Exp $ */
/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
 * project. */

/* History:
   This file was transfered to Richard Levitte from CertCo by Kathy
   Weinhold in mid-spring 2000 to be included in OpenSSL or released
   as a patch kit. */
84
85
86
87
88
89
90
91

92
93
94
95
96
97
98
OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(x->tbsRequest->requestExtensions, nid,
	    lastpos);
}

int
OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos)

{
	return X509v3_get_ext_by_OBJ(x->tbsRequest->requestExtensions, obj,
	    lastpos);
}

int
OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos)







|
>







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(x->tbsRequest->requestExtensions, nid,
	    lastpos);
}

int
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);
}

int
OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos)
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
int
OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(x->singleRequestExtensions, nid, lastpos);
}

int
OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos)
{
	return X509v3_get_ext_by_OBJ(x->singleRequestExtensions, obj, lastpos);
}

int
OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos)
{







|







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
int
OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(x->singleRequestExtensions, nid, lastpos);
}

int
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);
}

int
OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos)
{
205
206
207
208
209
210
211
212

213
214
215
216
217
218
219
OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(x->tbsResponseData->responseExtensions,
	    nid, lastpos);
}

int
OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos)

{
	return X509v3_get_ext_by_OBJ(x->tbsResponseData->responseExtensions,
	    obj, lastpos);
}

int
OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, int lastpos)







|
>







206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(x->tbsResponseData->responseExtensions,
	    nid, lastpos);
}

int
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);
}

int
OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, int lastpos)
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
int
OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(x->singleExtensions, nid, lastpos);
}

int
OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj,
    int lastpos)
{
	return X509v3_get_ext_by_OBJ(x->singleExtensions, obj, lastpos);
}

int
OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, int lastpos)







|







269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
int
OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(x->singleExtensions, nid, lastpos);
}

int
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);
}

int
OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, int lastpos)
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
	if (req_idx < 0)
		return 2;
	req_ext = OCSP_REQUEST_get_ext(req, req_idx);
	return OCSP_BASICRESP_add_ext(resp, req_ext, -1);
}

X509_EXTENSION *
OCSP_crlID_new(char *url, long *n, char *tim)
{
	X509_EXTENSION *x = NULL;
	OCSP_CRLID *cid = NULL;

	if (!(cid = OCSP_CRLID_new()))
		goto err;
	if (url) {







|







433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
	if (req_idx < 0)
		return 2;
	req_ext = OCSP_REQUEST_get_ext(req, req_idx);
	return OCSP_BASICRESP_add_ext(resp, req_ext, -1);
}

X509_EXTENSION *
OCSP_crlID_new(const char *url, long *n, char *tim)
{
	X509_EXTENSION *x = NULL;
	OCSP_CRLID *cid = NULL;

	if (!(cid = OCSP_CRLID_new()))
		goto err;
	if (url) {
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
}

/* per ACCESS_DESCRIPTION parameter are oids, of which there are currently
 * two--NID_ad_ocsp, NID_id_ad_caIssuers--and GeneralName value.  This
 * method forces NID_ad_ocsp and uniformResourceLocator [6] IA5String.
 */
X509_EXTENSION *
OCSP_url_svcloc_new(X509_NAME* issuer, char **urls)
{
	X509_EXTENSION *x = NULL;
	ASN1_IA5STRING *ia5 = NULL;
	OCSP_SERVICELOC *sloc = NULL;
	ACCESS_DESCRIPTION *ad = NULL;

	if (!(sloc = OCSP_SERVICELOC_new()))







|







515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
}

/* per ACCESS_DESCRIPTION parameter are oids, of which there are currently
 * two--NID_ad_ocsp, NID_id_ad_caIssuers--and GeneralName value.  This
 * method forces NID_ad_ocsp and uniformResourceLocator [6] IA5String.
 */
X509_EXTENSION *
OCSP_url_svcloc_new(X509_NAME* issuer, const char **urls)
{
	X509_EXTENSION *x = NULL;
	ASN1_IA5STRING *ia5 = NULL;
	OCSP_SERVICELOC *sloc = NULL;
	ACCESS_DESCRIPTION *ad = NULL;

	if (!(sloc = OCSP_SERVICELOC_new()))
Changes to jni/libressl/crypto/ocsp/ocsp_ht.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ocsp_ht.c,v 1.24 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
	}
	if (BIO_write(rctx->mem, "\r\n", 2) != 2)
		return 0;
	return 1;
}

OCSP_REQ_CTX *
OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline)
{
	OCSP_REQ_CTX *rctx;

	rctx = malloc(sizeof(OCSP_REQ_CTX));
	if (rctx == NULL)
		return NULL;
	rctx->state = OHS_ERROR;







|







145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
	}
	if (BIO_write(rctx->mem, "\r\n", 2) != 2)
		return 0;
	return 1;
}

OCSP_REQ_CTX *
OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req, int maxline)
{
	OCSP_REQ_CTX *rctx;

	rctx = malloc(sizeof(OCSP_REQ_CTX));
	if (rctx == NULL)
		return NULL;
	rctx->state = OHS_ERROR;
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
	}

	return 0;
}

/* 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_RESPONSE *resp = NULL;
	OCSP_REQ_CTX *ctx;
	int rv;

	ctx = OCSP_sendreq_new(b, path, req, -1);
	if (ctx == NULL)







|







436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
	}

	return 0;
}

/* Blocking OCSP request handler: now a special case of non-blocking I/O */
OCSP_RESPONSE *
OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req)
{
	OCSP_RESPONSE *resp = NULL;
	OCSP_REQ_CTX *ctx;
	int rv;

	ctx = OCSP_sendreq_new(b, path, req, -1);
	if (ctx == NULL)
Changes to jni/libressl/crypto/ocsp/ocsp_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ocsp_lib.c,v 1.20 2017/01/29 17:49:23 beck Exp $ */
/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
 * project. */

/* History:
   This file was transfered to Richard Levitte from CertCo by Kathy
   Weinhold in mid-spring 2000 to be included in OpenSSL or released
   as a patch kit. */
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ocsp_lib.c,v 1.23 2018/08/24 20:03:21 tb Exp $ */
/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
 * project. */

/* History:
   This file was transfered to Richard Levitte from CertCo by Kathy
   Weinhold in mid-spring 2000 to be included in OpenSSL or released
   as a patch kit. */
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#include <openssl/pem.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>

/* Convert a certificate and its issuer to an OCSP_CERTID */

OCSP_CERTID *
OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer)
{
	X509_NAME *iname;
	ASN1_INTEGER *serial;
	ASN1_BIT_STRING *ikey;

#ifndef OPENSSL_NO_SHA1
	if (!dgst)
		dgst = EVP_sha1();
#endif
	if (subject) {
		iname = X509_get_issuer_name(subject);
		serial = X509_get_serialNumber(subject);
	} else {
		iname = X509_get_subject_name(issuer);
		serial = NULL;
	}
	ikey = X509_get0_pubkey_bitstr(issuer);
	return OCSP_cert_id_new(dgst, iname, ikey, serial);
}

OCSP_CERTID *
OCSP_cert_id_new(const EVP_MD *dgst, X509_NAME *issuerName,
    ASN1_BIT_STRING* issuerKey, ASN1_INTEGER *serialNumber)
{
	int nid;
	unsigned int i;
	X509_ALGOR *alg;
	OCSP_CERTID *cid = NULL;
	unsigned char md[EVP_MAX_MD_SIZE];








|


|








|









|
|







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#include <openssl/pem.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>

/* Convert a certificate and its issuer to an OCSP_CERTID */

OCSP_CERTID *
OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject, const X509 *issuer)
{
	X509_NAME *iname;
	const ASN1_INTEGER *serial;
	ASN1_BIT_STRING *ikey;

#ifndef OPENSSL_NO_SHA1
	if (!dgst)
		dgst = EVP_sha1();
#endif
	if (subject) {
		iname = X509_get_issuer_name(subject);
		serial = X509_get0_serialNumber(subject);
	} else {
		iname = X509_get_subject_name(issuer);
		serial = NULL;
	}
	ikey = X509_get0_pubkey_bitstr(issuer);
	return OCSP_cert_id_new(dgst, iname, ikey, serial);
}

OCSP_CERTID *
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;
	X509_ALGOR *alg;
	OCSP_CERTID *cid = NULL;
	unsigned char md[EVP_MAX_MD_SIZE];

176
177
178
179
180
181
182
183

184
185
186
187
188
189
190
	return ASN1_INTEGER_cmp(a->serialNumber, b->serialNumber);
}

/* Parse a URL and split it up into host, port and path components and whether
 * it is SSL.
 */
int
OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl)

{
	char *host, *path, *port, *tmp;

	*phost = *pport = *ppath = NULL;
	*pssl = 0;

	if (strncmp(url, "https://", 8) == 0) {







|
>







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
	return ASN1_INTEGER_cmp(a->serialNumber, b->serialNumber);
}

/* Parse a URL and split it up into host, port and path components and whether
 * it is SSL.
 */
int
OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
    int *pssl)
{
	char *host, *path, *port, *tmp;

	*phost = *pport = *ppath = NULL;
	*pssl = 0;

	if (strncmp(url, "https://", 8) == 0) {
Changes to jni/libressl/crypto/pem/pem_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: pem_lib.c,v 1.45 2017/05/02 03:59:44 deraadt 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
			if (ameth) {
				int r;
				if (ameth->param_decode)
					r = 1;
				else
					r = 0;
#ifndef OPENSSL_NO_ENGINE
				if (e)
					ENGINE_finish(e);
#endif
				return r;
			}
		}
		return 0;
	}








<
|







223
224
225
226
227
228
229

230
231
232
233
234
235
236
237
			if (ameth) {
				int r;
				if (ameth->param_decode)
					r = 1;
				else
					r = 0;
#ifndef OPENSSL_NO_ENGINE

				ENGINE_finish(e);
#endif
				return r;
			}
		}
		return 0;
	}

561
562
563
564
565
566
567

568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
	}

	*fromp = from;
	return (1);
}

int

PEM_write(FILE *fp, char *name, char *header, unsigned char *data, long len)
{
	BIO *b;
	int ret;

	if ((b = BIO_new(BIO_s_file())) == NULL) {
		PEMerror(ERR_R_BUF_LIB);
		return (0);
	}
	BIO_set_fp(b, fp, BIO_NOCLOSE);
	ret = PEM_write_bio(b, name, header, data, len);
	BIO_free(b);
	return (ret);
}

int
PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data,
    long len)
{
	int nlen, n, i, j, outl;
	unsigned char *buf = NULL;
	EVP_ENCODE_CTX ctx;
	int reason = ERR_R_BUF_LIB;

	EVP_EncodeInit(&ctx);







>
|















|
|







560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
	}

	*fromp = from;
	return (1);
}

int
PEM_write(FILE *fp, const char *name, const char *header,
    const unsigned char *data, long len)
{
	BIO *b;
	int ret;

	if ((b = BIO_new(BIO_s_file())) == NULL) {
		PEMerror(ERR_R_BUF_LIB);
		return (0);
	}
	BIO_set_fp(b, fp, BIO_NOCLOSE);
	ret = PEM_write_bio(b, name, header, data, len);
	BIO_free(b);
	return (ret);
}

int
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;
	EVP_ENCODE_CTX ctx;
	int reason = ERR_R_BUF_LIB;

	EVP_EncodeInit(&ctx);
609
610
611
612
613
614
615
616

617
618
619
620
621
622
623
		reason = ERR_R_MALLOC_FAILURE;
		goto err;
	}

	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 ((outl) && (BIO_write(bp, (char *)buf, outl) != outl))
			goto err;
		i += outl;
		len -= n;
		j += n;
	}
	EVP_EncodeFinal(&ctx, buf, &outl);







|
>







609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
		reason = ERR_R_MALLOC_FAILURE;
		goto err;
	}

	i = j = 0;
	while (len > 0) {
		n = (int)((len > (PEM_BUFSIZE * 5)) ? (PEM_BUFSIZE * 5) : len);
		if (!EVP_EncodeUpdate(&ctx, buf, &outl, &(data[j]), n))
			goto err;
		if ((outl) && (BIO_write(bp, (char *)buf, outl) != outl))
			goto err;
		i += outl;
		len -= n;
		j += n;
	}
	EVP_EncodeFinal(&ctx, buf, &outl);
Changes to jni/libressl/crypto/pem/pem_sign.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: pem_sign.c,v 1.13 2017/01/29 17:49:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/pem.h>
#include <openssl/x509.h>

void
PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type)
{
	EVP_DigestInit_ex(ctx, type, NULL);
}

void
PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data,
    unsigned int count)
{
	EVP_DigestUpdate(ctx, data, count);
}

int
PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
    EVP_PKEY *pkey)
{
	unsigned char *m;







|


|


|



|







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/pem.h>
#include <openssl/x509.h>

int
PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type)
{
	return EVP_DigestInit_ex(ctx, type, NULL);
}

int
PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data,
    unsigned int count)
{
	return EVP_DigestUpdate(ctx, data, count);
}

int
PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
    EVP_PKEY *pkey)
{
	unsigned char *m;
Changes to jni/libressl/crypto/pem/pvkfmt.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: pvkfmt.c,v 1.19 2017/05/02 03:59:44 deraadt Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2005.
 */
/* ====================================================================
 * Copyright (c) 2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878

879
880
881
882
883
884
885
886
887
	EVP_CIPHER_CTX_init(&cctx);
	if (enclevel)
		outlen += PVK_SALTLEN;
	pklen = do_i2b(NULL, pk, 0);
	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;
	}

	write_ledword(&p, MS_PVKMAGIC);
	write_ledword(&p, 0);
	if (pk->type == EVP_PKEY_DSA)
		write_ledword(&p, MS_KEYTYPE_SIGN);
	else
		write_ledword(&p, MS_KEYTYPE_KEYX);
	write_ledword(&p, enclevel ? 1 : 0);
	write_ledword(&p, enclevel ? PVK_SALTLEN : 0);
	write_ledword(&p, pklen);
	if (enclevel) {
		arc4random_buf(p, PVK_SALTLEN);
		salt = p;
		p += PVK_SALTLEN;
	}
	do_i2b(&p, pk, 0);
	if (enclevel == 0)

		return outlen;
	else {
		char psbuf[PEM_BUFSIZE];
		unsigned char keybuf[20];
		int enctmplen, inlen;
		if (cb)
			inlen = cb(psbuf, PEM_BUFSIZE, 1, u);
		else
			inlen = PEM_def_callback(psbuf, PEM_BUFSIZE, 1, u);







<
<
<
<
<
|
|
|
|
<
<

















|
>

|







843
844
845
846
847
848
849





850
851
852
853


854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
	EVP_CIPHER_CTX_init(&cctx);
	if (enclevel)
		outlen += PVK_SALTLEN;
	pklen = do_i2b(NULL, pk, 0);
	if (pklen < 0)
		return -1;
	outlen += pklen;





	p = malloc(outlen);
	if (!p) {
		PEMerror(ERR_R_MALLOC_FAILURE);
		return -1;


	}

	write_ledword(&p, MS_PVKMAGIC);
	write_ledword(&p, 0);
	if (pk->type == EVP_PKEY_DSA)
		write_ledword(&p, MS_KEYTYPE_SIGN);
	else
		write_ledword(&p, MS_KEYTYPE_KEYX);
	write_ledword(&p, enclevel ? 1 : 0);
	write_ledword(&p, enclevel ? PVK_SALTLEN : 0);
	write_ledword(&p, pklen);
	if (enclevel) {
		arc4random_buf(p, PVK_SALTLEN);
		salt = p;
		p += PVK_SALTLEN;
	}
	do_i2b(&p, pk, 0);
	if (enclevel == 0) {
		*out = p;
		return outlen;
	} else {
		char psbuf[PEM_BUFSIZE];
		unsigned char keybuf[20];
		int enctmplen, inlen;
		if (cb)
			inlen = cb(psbuf, PEM_BUFSIZE, 1, u);
		else
			inlen = PEM_def_callback(psbuf, PEM_BUFSIZE, 1, u);
900
901
902
903
904
905
906

907
908
909
910

911
912
913
914
915
916
917
		explicit_bzero(keybuf, 20);
		if (!EVP_DecryptUpdate(&cctx, p, &enctmplen, p, pklen - 8))
			goto error;
		if (!EVP_DecryptFinal_ex(&cctx, p + enctmplen, &enctmplen))
			goto error;
	}
	EVP_CIPHER_CTX_cleanup(&cctx);

	return outlen;

error:
	EVP_CIPHER_CTX_cleanup(&cctx);

	return -1;
}

int
i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, pem_password_cb *cb, void *u)
{
	unsigned char *tmp = NULL;







>




>







894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
		explicit_bzero(keybuf, 20);
		if (!EVP_DecryptUpdate(&cctx, p, &enctmplen, p, pklen - 8))
			goto error;
		if (!EVP_DecryptFinal_ex(&cctx, p + enctmplen, &enctmplen))
			goto error;
	}
	EVP_CIPHER_CTX_cleanup(&cctx);
	*out = p;
	return outlen;

error:
	EVP_CIPHER_CTX_cleanup(&cctx);
	free(p);
	return -1;
}

int
i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, pem_password_cb *cb, void *u)
{
	unsigned char *tmp = NULL;
Changes to jni/libressl/crypto/pkcs12/p12_add.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: p12_add.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
		return NULL;
	return PKCS12_item_decrypt_d2i(p7->d.encrypted->enc_data->algorithm,
	    &PKCS12_SAFEBAGS_it, pass, passlen,
	    p7->d.encrypted->enc_data->enc_data, 1);
}

PKCS8_PRIV_KEY_INFO *
PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, const char *pass, int passlen)
{
	return PKCS8_decrypt(bag->value.shkeybag, pass, passlen);
}

int
PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes)
{
	if (ASN1_item_pack(safes, &PKCS12_AUTHSAFES_it,
	    &p12->authsafes->d.data))
		return 1;
	return 0;
}

STACK_OF(PKCS7) *
PKCS12_unpack_authsafes(PKCS12 *p12)
{
	if (!PKCS7_type_is_data(p12->authsafes)) {
		PKCS12error(PKCS12_R_CONTENT_TYPE_NOT_DATA);
		return NULL;
	}
	return ASN1_item_unpack(p12->authsafes->d.data,
	    &PKCS12_AUTHSAFES_it);
}







|














|








228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
		return NULL;
	return PKCS12_item_decrypt_d2i(p7->d.encrypted->enc_data->algorithm,
	    &PKCS12_SAFEBAGS_it, pass, passlen,
	    p7->d.encrypted->enc_data->enc_data, 1);
}

PKCS8_PRIV_KEY_INFO *
PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag, const char *pass, int passlen)
{
	return PKCS8_decrypt(bag->value.shkeybag, pass, passlen);
}

int
PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes)
{
	if (ASN1_item_pack(safes, &PKCS12_AUTHSAFES_it,
	    &p12->authsafes->d.data))
		return 1;
	return 0;
}

STACK_OF(PKCS7) *
PKCS12_unpack_authsafes(const PKCS12 *p12)
{
	if (!PKCS7_type_is_data(p12->authsafes)) {
		PKCS12error(PKCS12_R_CONTENT_TYPE_NOT_DATA);
		return NULL;
	}
	return ASN1_item_unpack(p12->authsafes->d.data,
	    &PKCS12_AUTHSAFES_it);
}
Changes to jni/libressl/crypto/pkcs12/p12_attr.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: p12_attr.c,v 1.10 2014/07/11 08:44:49 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
}

/* Add key usage to PKCS#8 structure */

int
PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage)
{
	unsigned char us_val;

	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;
}

/* Add a friendlyname to a safebag */

int
PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, int namelen)
{







|

<
|
|
<
<
<







73
74
75
76
77
78
79
80
81

82
83



84
85
86
87
88
89
90
}

/* Add key usage to PKCS#8 structure */

int
PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage)
{
	unsigned char us_val = (unsigned char)usage;


	return PKCS8_pkey_add1_attr_by_NID(p8, NID_key_usage, V_ASN1_BIT_STRING,
	    &us_val, 1);



}

/* Add a friendlyname to a safebag */

int
PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, int namelen)
{
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
	    MBSTRING_ASC, (unsigned char *)name, namelen))
		return 1;
	else
		return 0;
}

ASN1_TYPE *
PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid)
{
	X509_ATTRIBUTE *attrib;
	int i;

	if (!attrs)
		return NULL;
	for (i = 0; i < sk_X509_ATTRIBUTE_num (attrs); i++) {







|







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
	    MBSTRING_ASC, (unsigned char *)name, namelen))
		return 1;
	else
		return 0;
}

ASN1_TYPE *
PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid)
{
	X509_ATTRIBUTE *attrib;
	int i;

	if (!attrs)
		return NULL;
	for (i = 0; i < sk_X509_ATTRIBUTE_num (attrs); i++) {
Changes to jni/libressl/crypto/pkcs12/p12_crt.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: p12_crt.c,v 1.17 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project.
 */
/* ====================================================================
 * Copyright (c) 1999-2002 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2002 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
	attr = EVP_PKEY_get_attr(pkey, idx);
	if (!X509at_add1_attr(&bag->attrib, attr))
		return 0;
	return 1;
}

PKCS12 *
PKCS12_create(char *pass, 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 *p12 = NULL;
	STACK_OF(PKCS7) *safes = NULL;
	STACK_OF(PKCS12_SAFEBAG) *bags = NULL;
	PKCS12_SAFEBAG *bag = NULL;







|







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
	attr = EVP_PKEY_get_attr(pkey, idx);
	if (!X509at_add1_attr(&bag->attrib, attr))
		return 0;
	return 1;
}

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 *p12 = NULL;
	STACK_OF(PKCS7) *safes = NULL;
	STACK_OF(PKCS12_SAFEBAG) *bags = NULL;
	PKCS12_SAFEBAG *bag = NULL;
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
		PKCS12_SAFEBAG_free(bag);

	return NULL;
}

PKCS12_SAFEBAG *
PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, int key_usage,
    int iter, int nid_key, char *pass)
{
	PKCS12_SAFEBAG *bag = NULL;
	PKCS8_PRIV_KEY_INFO *p8 = NULL;

	/* Make a PKCS#8 structure */
	if (!(p8 = EVP_PKEY2PKCS8(key)))
		goto err;







|







217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
		PKCS12_SAFEBAG_free(bag);

	return NULL;
}

PKCS12_SAFEBAG *
PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, int key_usage,
    int iter, int nid_key, const char *pass)
{
	PKCS12_SAFEBAG *bag = NULL;
	PKCS8_PRIV_KEY_INFO *p8 = NULL;

	/* Make a PKCS#8 structure */
	if (!(p8 = EVP_PKEY2PKCS8(key)))
		goto err;
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
		PKCS8_PRIV_KEY_INFO_free(p8);

	return NULL;
}

int
PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
    int nid_safe, int iter, char *pass)
{
	PKCS7 *p7 = NULL;
	int free_safes = 0;

	if (!*psafes) {
		*psafes = sk_PKCS7_new_null();
		if (!*psafes)







|







257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
		PKCS8_PRIV_KEY_INFO_free(p8);

	return NULL;
}

int
PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
    int nid_safe, int iter, const char *pass)
{
	PKCS7 *p7 = NULL;
	int free_safes = 0;

	if (!*psafes) {
		*psafes = sk_PKCS7_new_null();
		if (!*psafes)
Changes to jni/libressl/crypto/pkcs12/p12_decr.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: p12_decr.c,v 1.18 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
63
64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
#include <openssl/pkcs12.h>

/* Encrypt/Decrypt a buffer based on password and algor, result in a
 * malloc'ed buffer
 */

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)

{
	unsigned char *out;
	int outlen, i;
	EVP_CIPHER_CTX ctx;

	EVP_CIPHER_CTX_init(&ctx);
	/* Decrypt data */







|
|
>







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include <openssl/pkcs12.h>

/* Encrypt/Decrypt a buffer based on password and algor, result in a
 * malloc'ed buffer
 */

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)
{
	unsigned char *out;
	int outlen, i;
	EVP_CIPHER_CTX ctx;

	EVP_CIPHER_CTX_init(&ctx);
	/* Decrypt data */
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
}

/* Decrypt an OCTET STRING and decode ASN1 structure
 * if zbuf set zero buffer after use.
 */

void *
PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,
    const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf)
{
	unsigned char *out;
	const unsigned char *p;
	void *ret;
	int outlen;

	if (!PKCS12_pbe_crypt(algor, pass, passlen, oct->data, oct->length,







|
|







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
}

/* Decrypt an OCTET STRING and decode ASN1 structure
 * if zbuf set zero buffer after use.
 */

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)
{
	unsigned char *out;
	const unsigned char *p;
	void *ret;
	int outlen;

	if (!PKCS12_pbe_crypt(algor, pass, passlen, oct->data, oct->length,
Changes to jni/libressl/crypto/pkcs12/p12_npas.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: p12_npas.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
61
62
63
64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include <string.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <openssl/pkcs12.h>

/* 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 alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen);

/*
 * Change the password on a PKCS#12 structure.
 */

int
PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass)
{
	/* Check for NULL PKCS12 structure */

	if (!p12) {
		PKCS12error(PKCS12_R_INVALID_NULL_PKCS12_POINTER);
		return 0;
	}







|
|
|
|
>







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include <string.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <openssl/pkcs12.h>

/* PKCS#12 password change routine */

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);

/*
 * Change the password on a PKCS#12 structure.
 */

int
PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass)
{
	/* Check for NULL PKCS12 structure */

	if (!p12) {
		PKCS12error(PKCS12_R_INVALID_NULL_PKCS12_POINTER);
		return 0;
	}
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

	return 1;
}

/* Parse the outer PKCS#12 structure */

static int
newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
{
	STACK_OF(PKCS7) *asafes, *newsafes;
	STACK_OF(PKCS12_SAFEBAG) *bags;
	int i, bagnid, pbe_nid = 0, pbe_iter = 0, pbe_saltlen = 0;
	PKCS7 *p7, *p7new;
	ASN1_OCTET_STRING *p12_data_tmp = NULL, *macnew = NULL;
	unsigned char mac[EVP_MAX_MD_SIZE];







|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

	return 1;
}

/* Parse the outer PKCS#12 structure */

static int
newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass)
{
	STACK_OF(PKCS7) *asafes, *newsafes;
	STACK_OF(PKCS12_SAFEBAG) *bags;
	int i, bagnid, pbe_nid = 0, pbe_iter = 0, pbe_saltlen = 0;
	PKCS7 *p7, *p7new;
	ASN1_OCTET_STRING *p12_data_tmp = NULL, *macnew = NULL;
	unsigned char mac[EVP_MAX_MD_SIZE];
185
186
187
188
189
190
191
192

193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
	sk_PKCS7_pop_free(asafes, PKCS7_free);
	sk_PKCS7_pop_free(newsafes, PKCS7_free);
	return 0;
}


static int
newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, char *newpass)

{
	int i;

	for (i = 0; i < sk_PKCS12_SAFEBAG_num(bags); i++) {
		if (!newpass_bag(sk_PKCS12_SAFEBAG_value(bags, i),
		    oldpass, newpass))
			return 0;
	}
	return 1;
}

/* Change password of safebag: only needs handle shrouded keybags */

static int
newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass)
{
	PKCS8_PRIV_KEY_INFO *p8;
	X509_SIG *p8new;
	int p8_nid, p8_saltlen, p8_iter;

	if (OBJ_obj2nid(bag->type) != NID_pkcs8ShroudedKeyBag)
		return 1;







|
>














|







186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
	sk_PKCS7_pop_free(asafes, PKCS7_free);
	sk_PKCS7_pop_free(newsafes, PKCS7_free);
	return 0;
}


static int
newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *oldpass,
    const char *newpass)
{
	int i;

	for (i = 0; i < sk_PKCS12_SAFEBAG_num(bags); i++) {
		if (!newpass_bag(sk_PKCS12_SAFEBAG_value(bags, i),
		    oldpass, newpass))
			return 0;
	}
	return 1;
}

/* Change password of safebag: only needs handle shrouded keybags */

static int
newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass, const char *newpass)
{
	PKCS8_PRIV_KEY_INFO *p8;
	X509_SIG *p8new;
	int p8_nid, p8_saltlen, p8_iter;

	if (OBJ_obj2nid(bag->type) != NID_pkcs8ShroudedKeyBag)
		return 1;
Changes to jni/libressl/crypto/pkcs12/p12_p8d.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: p12_p8d.c,v 1.6 2016/12/30 15:34:35 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2001.
 */
/* ====================================================================
 * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
57
58
59
60
61
62
63
64
65
66
67
68
 */

#include <stdio.h>

#include <openssl/pkcs12.h>

PKCS8_PRIV_KEY_INFO *
PKCS8_decrypt(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);
}







|




57
58
59
60
61
62
63
64
65
66
67
68
 */

#include <stdio.h>

#include <openssl/pkcs12.h>

PKCS8_PRIV_KEY_INFO *
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);
}
Changes to jni/libressl/crypto/pkcs12/p12_utl.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: p12_utl.c,v 1.15 2016/12/30 15:34:35 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
		*unilen = ulen;
	if (uni)
		*uni = unitmp;
	return unitmp;
}

char *
OPENSSL_uni2asc(unsigned char *uni, int unilen)
{
	size_t asclen, u16len, i;
	char *asctmp;

	if (unilen < 0)
		return NULL;








|







96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
		*unilen = ulen;
	if (uni)
		*uni = unitmp;
	return unitmp;
}

char *
OPENSSL_uni2asc(const unsigned char *uni, int unilen)
{
	size_t asclen, u16len, i;
	char *asctmp;

	if (unilen < 0)
		return NULL;

Changes to jni/libressl/crypto/rsa/rsa_ameth.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: rsa_ameth.c,v 1.18 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
		return 0;
	}

	return 1;
}

static int
rsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8)
{
	const unsigned char *p;
	int pklen;

	if (!PKCS8_pkey_get0(NULL, &p, &pklen, NULL, p8))
		return 0;
	return old_rsa_priv_decode(pkey, &p, pklen);







|







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
		return 0;
	}

	return 1;
}

static int
rsa_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8)
{
	const unsigned char *p;
	int pklen;

	if (!PKCS8_pkey_get0(NULL, &p, &pklen, NULL, p8))
		return 0;
	return old_rsa_priv_decode(pkey, &p, pklen);
Changes to jni/libressl/crypto/rsa/rsa_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: rsa_lib.c,v 1.36 2018/02/20 17:42:32 tb 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
	 */
	const RSA_METHOD *mtmp;

	mtmp = rsa->meth;
	if (mtmp->finish)
		mtmp->finish(rsa);
#ifndef OPENSSL_NO_ENGINE
	if (rsa->engine) {
		ENGINE_finish(rsa->engine);
		rsa->engine = NULL;
	}
#endif
	rsa->meth = meth;
	if (meth->init)
		meth->init(rsa);
	return 1;
}








<
|
|
<







110
111
112
113
114
115
116

117
118

119
120
121
122
123
124
125
	 */
	const RSA_METHOD *mtmp;

	mtmp = rsa->meth;
	if (mtmp->finish)
		mtmp->finish(rsa);
#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(rsa->engine);
	rsa->engine = NULL;

#endif
	rsa->meth = meth;
	if (meth->init)
		meth->init(rsa);
	return 1;
}

145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
			return NULL;
		}
		ret->engine = engine;
	} else
		ret->engine = ENGINE_get_default_RSA();
	if (ret->engine) {
		ret->meth = ENGINE_get_RSA(ret->engine);
		if (!ret->meth) {
			RSAerror(ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
		}
	}
#endif







|







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
			return NULL;
		}
		ret->engine = engine;
	} else
		ret->engine = ENGINE_get_default_RSA();
	if (ret->engine) {
		ret->meth = ENGINE_get_RSA(ret->engine);
		if (ret->meth == NULL) {
			RSAerror(ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
		}
	}
#endif
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
	ret->_method_mod_p = NULL;
	ret->_method_mod_q = NULL;
	ret->blinding = NULL;
	ret->mt_blinding = NULL;
	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);
#endif
		free(ret);
		return NULL;
	}

	if (ret->meth->init != NULL && !ret->meth->init(ret)) {
#ifndef OPENSSL_NO_ENGINE
		if (ret->engine)
			ENGINE_finish(ret->engine);
#endif
		CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data);
		free(ret);
		ret = NULL;
	}
	return ret;
}







<
|







<
|







171
172
173
174
175
176
177

178
179
180
181
182
183
184
185

186
187
188
189
190
191
192
193
	ret->_method_mod_p = NULL;
	ret->_method_mod_q = NULL;
	ret->blinding = NULL;
	ret->mt_blinding = NULL;
	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

		ENGINE_finish(ret->engine);
#endif
		free(ret);
		return NULL;
	}

	if (ret->meth->init != NULL && !ret->meth->init(ret)) {
#ifndef OPENSSL_NO_ENGINE

		ENGINE_finish(ret->engine);
#endif
		CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data);
		free(ret);
		ret = NULL;
	}
	return ret;
}
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
	i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_RSA);
	if (i > 0)
		return;

	if (r->meth->finish)
		r->meth->finish(r);
#ifndef OPENSSL_NO_ENGINE
	if (r->engine)
		ENGINE_finish(r->engine);
#endif

	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);

	BN_clear_free(r->n);
	BN_clear_free(r->e);
	BN_clear_free(r->d);







<
|







203
204
205
206
207
208
209

210
211
212
213
214
215
216
217
	i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_RSA);
	if (i > 0)
		return;

	if (r->meth->finish)
		r->meth->finish(r);
#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(r->engine);
#endif

	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);

	BN_clear_free(r->n);
	BN_clear_free(r->e);
	BN_clear_free(r->d);
Changes to jni/libressl/crypto/rsa/rsa_meth.c.
1
2
3
4
5
6
7
8
/*	$OpenBSD: rsa_meth.c,v 1.1 2018/03/17 15:12:56 tb Exp $	*/
/*
 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/*	$OpenBSD: rsa_meth.c,v 1.2 2018/09/12 06:35:38 djm Exp $	*/
/*
 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
 *
 * 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.
 *
57
58
59
60
61
62
63


















64
65
66
67
68
69
70
	if ((copy->name = strdup(meth->name)) == NULL) {
		free(copy);
		return NULL;
	}

	return copy;
}



















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;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
	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;
Changes to jni/libressl/crypto/rsa/rsa_oaep.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: rsa_oaep.c,v 1.26 2017/01/29 17:49:23 beck Exp $ */
/* Written by Ulf Moeller. This software is distributed on an "AS IS"
   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */

/* EME-OAEP as defined in RFC 2437 (PKCS #1 v2.0) */

/* See Victor Shoup, "OAEP reconsidered," Nov. 2000,
 * <URL: http://www.shoup.net/papers/oaep.ps.Z>
|







1
2
3
4
5
6
7
8
/* $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. */

/* EME-OAEP as defined in RFC 2437 (PKCS #1 v2.0) */

/* See Victor Shoup, "OAEP reconsidered," Nov. 2000,
 * <URL: http://www.shoup.net/papers/oaep.ps.Z>
68
69
70
71
72
73
74
75

76

77
78
79
80
81

82

83
84
85
86
87
88
89
	dbmask = malloc(emlen - SHA_DIGEST_LENGTH);
	if (dbmask == NULL) {
		RSAerror(ERR_R_MALLOC_FAILURE);
		return 0;
	}

	if (MGF1(dbmask, emlen - SHA_DIGEST_LENGTH, seed,
	    SHA_DIGEST_LENGTH) < 0)

		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)

		return 0;

	for (i = 0; i < SHA_DIGEST_LENGTH; i++)
		seed[i] ^= seedmask[i];

	free(dbmask);
	return 1;
}








|
>

>




|
>

>







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
	dbmask = malloc(emlen - SHA_DIGEST_LENGTH);
	if (dbmask == NULL) {
		RSAerror(ERR_R_MALLOC_FAILURE);
		return 0;
	}

	if (MGF1(dbmask, emlen - SHA_DIGEST_LENGTH, seed,
	    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) {
		free(dbmask);
		return 0;
	}
	for (i = 0; i < SHA_DIGEST_LENGTH; i++)
		seed[i] ^= seedmask[i];

	free(dbmask);
	return 1;
}

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
		 */
		bad = 1;
		lzero = 0;
		flen = num; /* don't overflow the memcpy to padded_from */
	}

	dblen = num - SHA_DIGEST_LENGTH;
	db = malloc(dblen + num);
	if (db == NULL) {
		RSAerror(ERR_R_MALLOC_FAILURE);
		return -1;
	}

	/*
	 * Always do this zero-padding copy (even when lzero == 0)
	 * to avoid leaking timing info about the value of lzero.
	 */
	padded_from = db + dblen;
	memset(padded_from, 0, lzero);
	memcpy(padded_from + lzero, from, flen);

	maskeddb = padded_from + SHA_DIGEST_LENGTH;

	if (MGF1(seed, SHA_DIGEST_LENGTH, maskeddb, dblen))
		return -1;
	for (i = 0; i < SHA_DIGEST_LENGTH; i++)
		seed[i] ^= padded_from[i];

	if (MGF1(db, dblen, seed, SHA_DIGEST_LENGTH))
		return -1;
	for (i = 0; i < dblen; i++)
		db[i] ^= maskeddb[i];

	if (!EVP_Digest((void *)param, plen, phash, NULL, EVP_sha1(), NULL))
		return -1;

	if (timingsafe_memcmp(db, phash, SHA_DIGEST_LENGTH) != 0 || bad)
		goto decoding_err;
	else {
		for (i = SHA_DIGEST_LENGTH; i < dblen; i++)
			if (db[i] != 0x00)
				break;







|
<















|




|




|







122
123
124
125
126
127
128
129

130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
		 */
		bad = 1;
		lzero = 0;
		flen = num; /* don't overflow the memcpy to padded_from */
	}

	dblen = num - SHA_DIGEST_LENGTH;
	if ((db = malloc(dblen + num)) == NULL) {

		RSAerror(ERR_R_MALLOC_FAILURE);
		return -1;
	}

	/*
	 * Always do this zero-padding copy (even when lzero == 0)
	 * to avoid leaking timing info about the value of lzero.
	 */
	padded_from = db + dblen;
	memset(padded_from, 0, lzero);
	memcpy(padded_from + lzero, from, flen);

	maskeddb = padded_from + SHA_DIGEST_LENGTH;

	if (MGF1(seed, SHA_DIGEST_LENGTH, maskeddb, dblen))
		goto err;
	for (i = 0; i < SHA_DIGEST_LENGTH; i++)
		seed[i] ^= padded_from[i];

	if (MGF1(db, dblen, seed, SHA_DIGEST_LENGTH))
		goto err;
	for (i = 0; i < dblen; i++)
		db[i] ^= maskeddb[i];

	if (!EVP_Digest((void *)param, plen, phash, NULL, EVP_sha1(), NULL))
		goto err;

	if (timingsafe_memcmp(db, phash, SHA_DIGEST_LENGTH) != 0 || bad)
		goto decoding_err;
	else {
		for (i = SHA_DIGEST_LENGTH; i < dblen; i++)
			if (db[i] != 0x00)
				break;
169
170
171
172
173
174
175
176
177
178
179
180
181

182
183
184
185
186
187
188
			} else
				memcpy(to, db + i, mlen);
		}
	}
	free(db);
	return mlen;

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);

	free(db);
	return -1;
}

int
PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed,
    long seedlen, const EVP_MD *dgst)







|





>







172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
			} else
				memcpy(to, db + i, mlen);
		}
	}
	free(db);
	return mlen;

 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;
}

int
PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed,
    long seedlen, const EVP_MD *dgst)
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
			if (!EVP_DigestFinal_ex(&c, md, NULL))
				goto err;
			memcpy(mask + outlen, md, len - outlen);
			outlen = len;
		}
	}
	rv = 0;
err:
	EVP_MD_CTX_cleanup(&c);
	return rv;
}

static int
MGF1(unsigned char *mask, long len, const unsigned char *seed, long seedlen)
{
	return PKCS1_MGF1(mask, len, seed, seedlen, EVP_sha1());
}
#endif







|










219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
			if (!EVP_DigestFinal_ex(&c, md, NULL))
				goto err;
			memcpy(mask + outlen, md, len - outlen);
			outlen = len;
		}
	}
	rv = 0;
 err:
	EVP_MD_CTX_cleanup(&c);
	return rv;
}

static int
MGF1(unsigned char *mask, long len, const unsigned char *seed, long seedlen)
{
	return PKCS1_MGF1(mask, len, seed, seedlen, EVP_sha1());
}
#endif
Changes to jni/libressl/crypto/rsa/rsa_pmeth.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: rsa_pmeth.c,v 1.20 2017/08/28 17:41:59 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2006.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
			return -1;
		rslen = RSA_public_decrypt(siglen, sig, rctx->tbuf, rsa,
		    rctx->pad_mode);
		if (rslen == 0)
			return 0;
	}

	if (rslen != tbslen || memcmp(tbs, rctx->tbuf, rslen))
		return 0;

	return 1;
}

static int
pkey_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,







|







292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
			return -1;
		rslen = RSA_public_decrypt(siglen, sig, rctx->tbuf, rsa,
		    rctx->pad_mode);
		if (rslen == 0)
			return 0;
	}

	if (rslen != tbslen || timingsafe_bcmp(tbs, rctx->tbuf, rslen))
		return 0;

	return 1;
}

static int
pkey_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
Changes to jni/libressl/crypto/rsa/rsa_pss.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: rsa_pss.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2005.
 */
/* ====================================================================
 * Copyright (c) 2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
		goto err;
	if (maskedDBLen - i) {
		if (!EVP_DigestUpdate(&ctx, DB + i, maskedDBLen - i))
			goto err;
	}
	if (!EVP_DigestFinal_ex(&ctx, H_, NULL))
		goto err;
	if (memcmp(H_, H, hLen)) {
		RSAerror(RSA_R_BAD_SIGNATURE);
		ret = 0;
	} else
		ret = 1;

err:
	free(DB);







|







159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
		goto err;
	if (maskedDBLen - i) {
		if (!EVP_DigestUpdate(&ctx, DB + i, maskedDBLen - i))
			goto err;
	}
	if (!EVP_DigestFinal_ex(&ctx, H_, NULL))
		goto err;
	if (timingsafe_bcmp(H_, H, hLen)) {
		RSAerror(RSA_R_BAD_SIGNATURE);
		ret = 0;
	} else
		ret = 1;

err:
	free(DB);
Changes to jni/libressl/crypto/rsa/rsa_saos.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: rsa_saos.c,v 1.23 2017/05/02 03:59:45 deraadt 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

	p = s;
	sig = d2i_ASN1_OCTET_STRING(NULL, &p, (long)i);
	if (sig == NULL)
		goto err;

	if ((unsigned int)sig->length != m_len ||
	    memcmp(m, sig->data, m_len) != 0) {
		RSAerror(RSA_R_BAD_SIGNATURE);
	} else
		ret = 1;
err:
	ASN1_OCTET_STRING_free(sig);
	freezero(s, (unsigned int)siglen);
	return ret;
}







|








126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

	p = s;
	sig = d2i_ASN1_OCTET_STRING(NULL, &p, (long)i);
	if (sig == NULL)
		goto err;

	if ((unsigned int)sig->length != m_len ||
	    timingsafe_bcmp(m, sig->data, m_len) != 0) {
		RSAerror(RSA_R_BAD_SIGNATURE);
	} else
		ret = 1;
err:
	ASN1_OCTET_STRING_free(sig);
	freezero(s, (unsigned int)siglen);
	return ret;
}
Changes to jni/libressl/crypto/rsa/rsa_sign.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: rsa_sign.c,v 1.29 2017/05/02 03:59:45 deraadt 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
65
66
67
68
69
70
71


















































72
73
74
75
76
77
78
79
80
81
82
83

84
85
86
87
88

89





90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
132
133
134
135
136
137
138

139
140
141
142








143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171

172
173
174




175
176
177

178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194

195
196
197
198
199
200




201
202

203

204
205
206
207
208
209
210
211
212
213
214
215

216
217



218


219


220


221
222
223
224
225

226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#include <openssl/rsa.h>
#include <openssl/x509.h>

#include "rsa_locl.h"

/* 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)
{
	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_OCTET_STRING digest;


	if ((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_sign)
		return rsa->meth->rsa_sign(type, m, m_len, sigret, siglen, rsa);

	/* Special case: SSL signature, just check the length */

	if (type == NID_md5_sha1) {





		if (m_len != SSL_SIG_LENGTH) {
			RSAerror(RSA_R_INVALID_MESSAGE_LENGTH);
			return 0;
		}
		i = SSL_SIG_LENGTH;
		s = 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 = &parameter;

		sig.digest = &digest;
		sig.digest->data = (unsigned char *)m; /* TMP UGLY CAST */
		sig.digest->length = m_len;

		i = i2d_X509_SIG(&sig, NULL);
	}
	j = RSA_size(rsa);
	if (i > j - 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;
	}
	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);
	return (ret);
}









int
int_rsa_verify(int dtype, 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;

	if (siglen != (unsigned int)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) {
		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)

		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;
	} else {
		const unsigned char *p = s;

		sig = d2i_X509_SIG(NULL, &p, (long)i);

		if (sig == NULL)
			goto err;

		/* Excess data can be used to create forgeries */

		if (p != s + i) {
			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;
		}

		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);
	return ret;
}

int
RSA_verify(int dtype, const unsigned char *m, unsigned int m_len,
    const unsigned char *sigbuf, unsigned int siglen, RSA *rsa)
{
	if ((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_verify)
		return rsa->meth->rsa_verify(dtype, m, m_len, sigbuf, siglen,
		    rsa);

	return int_rsa_verify(dtype, m, m_len, NULL, NULL, sigbuf, siglen, rsa);
}







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





<
<
<
|
|
<
<
>

|


<
>

>
>
>
>
>

|


|
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
|
<
<
<
|
|

<
|

|

<
<
<
>
|
|
|
|
<
<
<
<
<
|
<
<

<
>
|



>
>
>
>
>
>
>
>

|



<
|
|

|




<
<
<
<
<
<
<
<
|
|
<



<
>
|

|
>
>
>
>
|
|
|
>
|
|
|
|
|
<
<
|
|
<
|
<
|
<
|
|
<
>
|
|
|
|
|
|
>
>
>
>
|
|
>
|
>
|
|
|
|
<
<
<
|
|
|
<
<
>
|
|
>
>
>
|
>
>
|
>
>
|
>
>
|
<
|
<
|
>
|
<
<
<
|
<
|
|
|













65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126



127
128


129
130
131
132
133

134
135
136
137
138
139
140
141
142
143
144
145













146
147
148



149
150
151

152
153
154
155



156
157
158
159
160





161


162

163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180

181
182
183
184
185
186
187
188








189
190

191
192
193

194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210


211
212

213

214

215
216

217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236



237
238
239


240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255

256

257
258
259



260

261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
#include <openssl/rsa.h>
#include <openssl/x509.h>

#include "rsa_locl.h"

/* Size of an SSL signature: MD5+SHA1 */
#define SSL_SIG_LENGTH	36

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;
	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 = &parameter;

	sig.digest = &digest;
	sig.digest->data = (unsigned char*)m; /* TMP UGLY CAST */
	sig.digest->length = m_len;

	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);


	/* 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_DIGEST_LENGTH);
			return 0;
		}
		encoded_len = SSL_SIG_LENGTH;













		encoded = m;
	} else {
		if (!encode_pkcs1(&tmps, &encoded_len, type, m, m_len))



			goto err;
		encoded = tmps;
	}

	if (encoded_len > RSA_size(rsa) - RSA_PKCS1_PADDING_SIZE) {
		RSAerror(RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY);
		goto err;
	}



	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 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)
{

	unsigned char *decrypt_buf, *encoded = NULL;
	int decrypt_len, encoded_len = 0, ret = 0;

	if (siglen != (size_t)RSA_size(rsa)) {
		RSAerror(RSA_R_WRONG_SIGNATURE_LENGTH);
		return 0;
	}









	/* Recover the encoded digest. */
	if ((decrypt_buf = malloc(siglen)) == NULL) {

		RSAerror(ERR_R_MALLOC_FAILURE);
		goto err;
	}

	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;
		}

		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 {
		/*
		 * 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;

		       	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;
		}

		/* Construct the encoded digest and ensure it matches */
		if (!encode_pkcs1(&encoded, &encoded_len, type, m, m_len))
			goto err;

		if (encoded_len != decrypt_len ||
		    timingsafe_bcmp(encoded, decrypt_buf, encoded_len) != 0) {
			RSAerror(RSA_R_BAD_SIGNATURE);
			goto err;
		}

		/* Output the recovered digest. */
		if (rm != NULL) {
			memcpy(rm, m, m_len);

			*prm_len = m_len;

		}
	}




	ret = 1;

 err:
	freezero(encoded, (size_t)encoded_len);
	freezero(decrypt_buf, siglen);
	return ret;
}

int
RSA_verify(int dtype, const unsigned char *m, unsigned int m_len,
    const unsigned char *sigbuf, unsigned int siglen, RSA *rsa)
{
	if ((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_verify)
		return rsa->meth->rsa_verify(dtype, m, m_len, sigbuf, siglen,
		    rsa);

	return int_rsa_verify(dtype, m, m_len, NULL, NULL, sigbuf, siglen, rsa);
}
Changes to jni/libressl/crypto/stack/stack.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: stack.c,v 1.19 2015/02/07 13:19:15 doug 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
308
309
310
311
312
313
314

315
316
317
318
319
320
321
}

void *
sk_set(_STACK *st, int i, void *value)
{
	if (!st || (i < 0) || (i >= st->num))
		return NULL;

	return (st->data[i] = value);
}

void
sk_sort(_STACK *st)
{
	if (st && !st->sorted) {







>







308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
}

void *
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);
}

void
sk_sort(_STACK *st)
{
	if (st && !st->sorted) {
Changes to jni/libressl/crypto/ts/ts_conf.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ts_conf.c,v 1.10 2017/01/29 17:49:23 beck Exp $ */
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
 * project 2002.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
	ret = 1;

err:
	if (!ret) {
		TSerror(TS_R_COULD_NOT_SET_ENGINE);
		ERR_asprintf_error_data("engine:%s", name);
	}
	if (e)
		ENGINE_free(e);
	return ret;
}

#endif

int
TS_CONF_set_signer_cert(CONF *conf, const char *section, const char *cert,







<
|







244
245
246
247
248
249
250

251
252
253
254
255
256
257
258
	ret = 1;

err:
	if (!ret) {
		TSerror(TS_R_COULD_NOT_SET_ENGINE);
		ERR_asprintf_error_data("engine:%s", name);
	}

	ENGINE_free(e);
	return ret;
}

#endif

int
TS_CONF_set_signer_cert(CONF *conf, const char *section, const char *cert,
Changes to jni/libressl/crypto/ts/ts_req_utils.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ts_req_utils.c,v 1.5 2017/01/29 17:49:23 beck Exp $ */
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
 * project 2002.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
ASN1_OCTET_STRING *
TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a)
{
	return a->hashed_msg;
}

int
TS_REQ_set_policy_id(TS_REQ *a, ASN1_OBJECT *policy)
{
	ASN1_OBJECT *new_policy;

	if (a->policy_id == policy)
		return 1;
	new_policy = OBJ_dup(policy);
	if (new_policy == NULL) {







|







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
ASN1_OCTET_STRING *
TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a)
{
	return a->hashed_msg;
}

int
TS_REQ_set_policy_id(TS_REQ *a, const ASN1_OBJECT *policy)
{
	ASN1_OBJECT *new_policy;

	if (a->policy_id == policy)
		return 1;
	new_policy = OBJ_dup(policy);
	if (new_policy == NULL) {
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
int
TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(a->extensions, nid, lastpos);
}

int
TS_REQ_get_ext_by_OBJ(TS_REQ *a, ASN1_OBJECT *obj, int lastpos)
{
	return X509v3_get_ext_by_OBJ(a->extensions, obj, lastpos);
}

int
TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos)
{







|







215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
int
TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(a->extensions, nid, lastpos);
}

int
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);
}

int
TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos)
{
Changes to jni/libressl/crypto/ts/ts_rsp_sign.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ts_rsp_sign.c,v 1.21 2017/01/29 17:49:23 beck Exp $ */
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
 * project 2002.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
	ctx->signer_key = key;
	CRYPTO_add(&ctx->signer_key->references, +1, CRYPTO_LOCK_EVP_PKEY);

	return 1;
}

int
TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *def_policy)
{
	if (ctx->default_policy)
		ASN1_OBJECT_free(ctx->default_policy);
	if (!(ctx->default_policy = OBJ_dup(def_policy)))
		goto err;
	return 1;








|







197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
	ctx->signer_key = key;
	CRYPTO_add(&ctx->signer_key->references, +1, CRYPTO_LOCK_EVP_PKEY);

	return 1;
}

int
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);
	if (!(ctx->default_policy = OBJ_dup(def_policy)))
		goto err;
	return 1;

234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
		CRYPTO_add(&cert->references, +1, CRYPTO_LOCK_X509);
	}

	return 1;
}

int
TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *policy)
{
	ASN1_OBJECT *copy = NULL;

	/* Create new policy stack if necessary. */
	if (!ctx->policies && !(ctx->policies = sk_ASN1_OBJECT_new_null()))
		goto err;
	if (!(copy = OBJ_dup(policy)))







|







234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
		CRYPTO_add(&cert->references, +1, CRYPTO_LOCK_X509);
	}

	return 1;
}

int
TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *policy)
{
	ASN1_OBJECT *copy = NULL;

	/* Create new policy stack if necessary. */
	if (!ctx->policies && !(ctx->policies = sk_ASN1_OBJECT_new_null()))
		goto err;
	if (!(copy = OBJ_dup(policy)))
Changes to jni/libressl/crypto/ts/ts_rsp_utils.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ts_rsp_utils.c,v 1.6 2017/01/29 17:49:23 beck Exp $ */
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
 * project 2002.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
int
TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(a->extensions, nid, lastpos);
}

int
TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, ASN1_OBJECT *obj, int lastpos)
{
	return X509v3_get_ext_by_OBJ(a->extensions, obj, lastpos);
}

int
TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos)
{







|







394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
int
TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos)
{
	return X509v3_get_ext_by_NID(a->extensions, nid, lastpos);
}

int
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);
}

int
TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos)
{
Changes to jni/libressl/crypto/ui/ui_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ui_lib.c,v 1.32 2017/01/29 17:49:23 beck Exp $ */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
 * project 2001.
 */
/* ====================================================================
 * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
{
	ui->meth = meth;
	return ui->meth;
}


UI_METHOD *
UI_create_method(char *name)
{
	UI_METHOD *ui_method = calloc(1, sizeof(UI_METHOD));

	if (ui_method && name)
		ui_method->name = strdup(name);

	return ui_method;







|







578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
{
	ui->meth = meth;
	return ui->meth;
}


UI_METHOD *
UI_create_method(const char *name)
{
	UI_METHOD *ui_method = calloc(1, sizeof(UI_METHOD));

	if (ui_method && name)
		ui_method->name = strdup(name);

	return ui_method;
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
		method->ui_construct_prompt = prompt_constructor;
		return 0;
	} else
		return -1;
}

int
(*UI_method_get_opener(UI_METHOD * method))(UI *)
{
	if (method)
		return method->ui_open_session;
	else
		return NULL;
}

int
(*UI_method_get_writer(UI_METHOD *method))(UI *, UI_STRING *)
{
	if (method)
		return method->ui_write_string;
	else
		return NULL;
}

int
(*UI_method_get_flusher(UI_METHOD *method)) (UI *)
{
	if (method)
		return method->ui_flush;
	else
		return NULL;
}

int
(*UI_method_get_reader(UI_METHOD *method))(UI *, UI_STRING *)
{
	if (method)
		return method->ui_read_string;
	else
		return NULL;
}

int
(*UI_method_get_closer(UI_METHOD *method))(UI *)
{
	if (method)
		return method->ui_close_session;
	else
		return NULL;
}

char *
(*UI_method_get_prompt_constructor(UI_METHOD *method))(UI *, const char *,
    const char *)
{
	if (method)
		return method->ui_construct_prompt;
	else
		return NULL;
}







|








|








|








|








|








|







662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
		method->ui_construct_prompt = prompt_constructor;
		return 0;
	} else
		return -1;
}

int
(*UI_method_get_opener(const UI_METHOD * method))(UI *)
{
	if (method)
		return method->ui_open_session;
	else
		return NULL;
}

int
(*UI_method_get_writer(const UI_METHOD *method))(UI *, UI_STRING *)
{
	if (method)
		return method->ui_write_string;
	else
		return NULL;
}

int
(*UI_method_get_flusher(const UI_METHOD *method)) (UI *)
{
	if (method)
		return method->ui_flush;
	else
		return NULL;
}

int
(*UI_method_get_reader(const UI_METHOD *method))(UI *, UI_STRING *)
{
	if (method)
		return method->ui_read_string;
	else
		return NULL;
}

int
(*UI_method_get_closer(const UI_METHOD *method))(UI *)
{
	if (method)
		return method->ui_close_session;
	else
		return NULL;
}

char *
(*UI_method_get_prompt_constructor(const UI_METHOD *method))(UI *, const char *,
    const char *)
{
	if (method)
		return method->ui_construct_prompt;
	else
		return NULL;
}
Changes to jni/libressl/crypto/x509/by_dir.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: by_dir.c,v 1.38 2017/01/29 17:49:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
    X509_OBJECT *ret);

static X509_LOOKUP_METHOD x509_dir_lookup = {
	.name = "Load certs from files in a directory",
	.new_item = new_dir,
	.free = free_dir,
	.init = NULL, 
	.shutdown = NULL,
	.ctrl = dir_ctrl,
	.get_by_subject = get_cert_by_subject,
	.get_by_issuer_serial = NULL,
	.get_by_fingerprint = NULL,
	.get_by_alias = NULL,
};







|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
    X509_OBJECT *ret);

static X509_LOOKUP_METHOD x509_dir_lookup = {
	.name = "Load certs from files in a directory",
	.new_item = new_dir,
	.free = free_dir,
	.init = NULL,
	.shutdown = NULL,
	.ctrl = dir_ctrl,
	.get_by_subject = get_cert_by_subject,
	.get_by_issuer_serial = NULL,
	.get_by_fingerprint = NULL,
	.get_by_alias = NULL,
};
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
		BY_DIR_HASH htmp, *hent;
		ent = sk_BY_DIR_ENTRY_value(ctx->dirs, i);
		j = strlen(ent->dir) + 1 + 8 + 6 + 1 + 1;
		if (!BUF_MEM_grow(b, j)) {
			X509error(ERR_R_MALLOC_FAILURE);
			goto finish;
		}
		if (type == X509_LU_CRL && ent->hashes) {
			htmp.hash = h;
			CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
			idx = sk_BY_DIR_HASH_find(ent->hashes, &htmp);
			if (idx >= 0) {
				hent = sk_BY_DIR_HASH_value(ent->hashes, idx);
				k = hent->suffix;
			} else {







|







312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
		BY_DIR_HASH htmp, *hent;
		ent = sk_BY_DIR_ENTRY_value(ctx->dirs, i);
		j = strlen(ent->dir) + 1 + 8 + 6 + 1 + 1;
		if (!BUF_MEM_grow(b, j)) {
			X509error(ERR_R_MALLOC_FAILURE);
			goto finish;
		}
		if (type == X509_LU_CRL) {
			htmp.hash = h;
			CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
			idx = sk_BY_DIR_HASH_find(ent->hashes, &htmp);
			if (idx >= 0) {
				hent = sk_BY_DIR_HASH_value(ent->hashes, idx);
				k = hent->suffix;
			} else {
Changes to jni/libressl/crypto/x509/vpm_int.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: vpm_int.h,v 1.3 2016/12/21 15:49:29 jsing Exp $ */
/*
 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
 * 2013.
 */
/* ====================================================================
 * Copyright (c) 2013 The OpenSSL Project.  All rights reserved.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2013 The OpenSSL Project.  All rights reserved.
 *
65
66
67
68
69
70
71

72
73
74
	STACK_OF(OPENSSL_STRING) *hosts; /* Set of acceptable names */
	unsigned int hostflags;     /* Flags to control matching features */
	char *peername;             /* Matching hostname in peer certificate */
	char *email;                /* If not NULL email address to match */
	size_t emaillen;
	unsigned char *ip;          /* If not NULL IP address to match */
	size_t iplen;               /* Length of IP address */

};

__END_HIDDEN_DECLS







>



65
66
67
68
69
70
71
72
73
74
75
	STACK_OF(OPENSSL_STRING) *hosts; /* Set of acceptable names */
	unsigned int hostflags;     /* Flags to control matching features */
	char *peername;             /* Matching hostname in peer certificate */
	char *email;                /* If not NULL email address to match */
	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
Changes to jni/libressl/crypto/x509/x509_att.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_att.c,v 1.15 2017/01/29 17:49:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
	obj = OBJ_nid2obj(nid);
	if (obj == NULL)
		return (-2);
	return (X509at_get_attr_by_OBJ(x, obj, lastpos));
}

int
X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj,
    int lastpos)
{
	int n;
	X509_ATTRIBUTE *ex;

	if (sk == NULL)
		return (-1);
	lastpos++;







|
|







80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
	obj = OBJ_nid2obj(nid);
	if (obj == NULL)
		return (-2);
	return (X509at_get_attr_by_OBJ(x, obj, lastpos));
}

int
X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,
    const ASN1_OBJECT *obj, int lastpos)
{
	int n;
	X509_ATTRIBUTE *ex;

	if (sk == NULL)
		return (-1);
	lastpos++;
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
		return 0;
	ret = X509at_add1_attr(x, attr);
	X509_ATTRIBUTE_free(attr);
	return ret;
}

void *
X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, ASN1_OBJECT *obj,
    int lastpos, int type)
{
	int i;
	X509_ATTRIBUTE *at;

	i = X509at_get_attr_by_OBJ(x, obj, lastpos);
	if (i == -1)







|







201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
		return 0;
	ret = X509at_add1_attr(x, attr);
	X509_ATTRIBUTE_free(attr);
	return ret;
}

void *
X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, const ASN1_OBJECT *obj,
    int lastpos, int type)
{
	int i;
	X509_ATTRIBUTE *at;

	i = X509at_get_attr_by_OBJ(x, obj, lastpos);
	if (i == -1)
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
	ASN1_TYPE_free(ttmp);
	ASN1_STRING_free(stmp);
	X509error(ERR_R_MALLOC_FAILURE);
	return 0;
}

int
X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr)
{
	if (!attr->single)
		return sk_ASN1_TYPE_num(attr->value.set);
	if (attr->value.single)
		return 1;
	return 0;
}







|







349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
	ASN1_TYPE_free(ttmp);
	ASN1_STRING_free(stmp);
	X509error(ERR_R_MALLOC_FAILURE);
	return 0;
}

int
X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr)
{
	if (!attr->single)
		return sk_ASN1_TYPE_num(attr->value.set);
	if (attr->value.single)
		return 1;
	return 0;
}
Changes to jni/libressl/crypto/x509/x509_cmp.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_cmp.c,v 1.30 2018/03/17 14:57:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: x509_cmp.c,v 1.34 2018/08/24 19:59:32 tb 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.
 *
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174






175
176
177
178
179
180
181
X509_CRL_match(const X509_CRL *a, const X509_CRL *b)
{
	return memcmp(a->sha1_hash, b->sha1_hash, 20);
}
#endif

X509_NAME *
X509_get_issuer_name(X509 *a)
{
	return (a->cert_info->issuer);
}

unsigned long
X509_issuer_name_hash(X509 *x)
{
	return (X509_NAME_hash(x->cert_info->issuer));
}

#ifndef OPENSSL_NO_MD5
unsigned long
X509_issuer_name_hash_old(X509 *x)
{
	return (X509_NAME_hash_old(x->cert_info->issuer));
}
#endif

X509_NAME *
X509_get_subject_name(X509 *a)
{
	return (a->cert_info->subject);
}

ASN1_INTEGER *
X509_get_serialNumber(X509 *a)






{
	return (a->cert_info->serialNumber);
}

unsigned long
X509_subject_name_hash(X509 *x)
{







|



















|






>
>
>
>
>
>







141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
X509_CRL_match(const X509_CRL *a, const X509_CRL *b)
{
	return memcmp(a->sha1_hash, b->sha1_hash, 20);
}
#endif

X509_NAME *
X509_get_issuer_name(const X509 *a)
{
	return (a->cert_info->issuer);
}

unsigned long
X509_issuer_name_hash(X509 *x)
{
	return (X509_NAME_hash(x->cert_info->issuer));
}

#ifndef OPENSSL_NO_MD5
unsigned long
X509_issuer_name_hash_old(X509 *x)
{
	return (X509_NAME_hash_old(x->cert_info->issuer));
}
#endif

X509_NAME *
X509_get_subject_name(const X509 *a)
{
	return (a->cert_info->subject);
}

ASN1_INTEGER *
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)
{
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
{
	if (x == NULL || x->cert_info == NULL)
		return (NULL);
	return (X509_PUBKEY_get(x->cert_info->key));
}

EVP_PKEY *
X509_get0_pubkey(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)
{
	if (!x)
		return NULL;
	return x->cert_info->key->public_key;
}

int
X509_check_private_key(X509 *x, EVP_PKEY *k)
{
	EVP_PKEY *xk;
	int ret;

	xk = X509_get_pubkey(x);

	if (xk)
		ret = EVP_PKEY_cmp(xk, k);
	else
		ret = -2;

	switch (ret) {
	case 1:
		break;
	case 0:
		X509error(X509_R_KEY_VALUES_MISMATCH);
		break;
	case -1:
		X509error(X509_R_KEY_TYPE_MISMATCH);
		break;
	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







|















|

|


|


















<







329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375

376
377
378
379
380
381
382
{
	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)
{
	if (!x)
		return NULL;
	return x->cert_info->key->public_key;
}

int
X509_check_private_key(const X509 *x, const EVP_PKEY *k)
{
	const EVP_PKEY *xk;
	int ret;

	xk = X509_get0_pubkey(x);

	if (xk)
		ret = EVP_PKEY_cmp(xk, k);
	else
		ret = -2;

	switch (ret) {
	case 1:
		break;
	case 0:
		X509error(X509_R_KEY_VALUES_MISMATCH);
		break;
	case -1:
		X509error(X509_R_KEY_TYPE_MISMATCH);
		break;
	case -2:
		X509error(X509_R_UNKNOWN_KEY_TYPE);
	}

	if (ret > 0)
		return 1;
	return 0;
}

/*
 * Not strictly speaking an "up_ref" as a STACK doesn't have a reference
Changes to jni/libressl/crypto/x509/x509_ext.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_ext.c,v 1.9 2015/02/10 08:33:10 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192

193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/stack.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>

int
X509_CRL_get_ext_count(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)
{
	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)
{
	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)
{
	return (X509v3_get_ext_by_critical(x->crl->extensions, crit, lastpos));
}

X509_EXTENSION *
X509_CRL_get_ext(X509_CRL *x, int loc)
{
	return (X509v3_get_ext(x->crl->extensions, loc));
}

X509_EXTENSION *
X509_CRL_delete_ext(X509_CRL *x, int loc)
{
	return (X509v3_delete_ext(x->crl->extensions, loc));
}

void *
X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx)
{
	return X509V3_get_d2i(x->crl->extensions, nid, crit, idx);
}

int
X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
    unsigned long flags)
{
	return X509V3_add1_i2d(&x->crl->extensions, nid, value, crit, flags);
}

int
X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc)
{
	return (X509v3_add_ext(&(x->crl->extensions), ex, loc) != NULL);
}

int
X509_get_ext_count(X509 *x)
{
	return (X509v3_get_ext_count(x->cert_info->extensions));
}

int
X509_get_ext_by_NID(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)
{
	return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos));
}

int
X509_get_ext_by_critical(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)
{
	return (X509v3_get_ext(x->cert_info->extensions, loc));
}

X509_EXTENSION *
X509_delete_ext(X509 *x, int loc)
{
	return (X509v3_delete_ext(x->cert_info->extensions, loc));
}

int
X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc)
{
	return (X509v3_add_ext(&(x->cert_info->extensions), ex, loc) != NULL);
}

void *
X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx)
{
	return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx);
}

int
X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, unsigned long flags)
{
	return X509V3_add1_i2d(&x->cert_info->extensions, nid, value, crit,
	    flags);
}

int
X509_REVOKED_get_ext_count(X509_REVOKED *x)
{
	return (X509v3_get_ext_count(x->extensions));
}

int
X509_REVOKED_get_ext_by_NID(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)

{
	return (X509v3_get_ext_by_OBJ(x->extensions, obj, lastpos));
}

int
X509_REVOKED_get_ext_by_critical(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)
{
	return (X509v3_get_ext(x->extensions, loc));
}

X509_EXTENSION *
X509_REVOKED_delete_ext(X509_REVOKED *x, int loc)
{
	return (X509v3_delete_ext(x->extensions, loc));
}

int
X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc)
{
	return (X509v3_add_ext(&(x->extensions), ex, loc) != NULL);
}

void *
X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx)
{
	return X509V3_get_d2i(x->extensions, nid, crit, idx);
}

int
X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
    unsigned long flags)
{
	return X509V3_add1_i2d(&x->extensions, nid, value, crit, flags);
}







|





|





|





|





|











|


















|





|





|





|






|

















|












|





|





|
>





|





|

















|










62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/stack.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>

int
X509_CRL_get_ext_count(const X509_CRL *x)
{
	return (X509v3_get_ext_count(x->crl->extensions));
}

int
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(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(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(const X509_CRL *x, int loc)
{
	return (X509v3_get_ext(x->crl->extensions, loc));
}

X509_EXTENSION *
X509_CRL_delete_ext(X509_CRL *x, int loc)
{
	return (X509v3_delete_ext(x->crl->extensions, loc));
}

void *
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);
}

int
X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
    unsigned long flags)
{
	return X509V3_add1_i2d(&x->crl->extensions, nid, value, crit, flags);
}

int
X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc)
{
	return (X509v3_add_ext(&(x->crl->extensions), ex, loc) != NULL);
}

int
X509_get_ext_count(const X509 *x)
{
	return (X509v3_get_ext_count(x->cert_info->extensions));
}

int
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(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(const X509 *x, int crit, int lastpos)
{
	return (X509v3_get_ext_by_critical(x->cert_info->extensions, crit,
	    lastpos));
}

X509_EXTENSION *
X509_get_ext(const X509 *x, int loc)
{
	return (X509v3_get_ext(x->cert_info->extensions, loc));
}

X509_EXTENSION *
X509_delete_ext(X509 *x, int loc)
{
	return (X509v3_delete_ext(x->cert_info->extensions, loc));
}

int
X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc)
{
	return (X509v3_add_ext(&(x->cert_info->extensions), ex, loc) != NULL);
}

void *
X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx)
{
	return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx);
}

int
X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, unsigned long flags)
{
	return X509V3_add1_i2d(&x->cert_info->extensions, nid, value, crit,
	    flags);
}

int
X509_REVOKED_get_ext_count(const X509_REVOKED *x)
{
	return (X509v3_get_ext_count(x->extensions));
}

int
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(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(const X509_REVOKED *x, int crit, int lastpos)
{
	return (X509v3_get_ext_by_critical(x->extensions, crit, lastpos));
}

X509_EXTENSION *
X509_REVOKED_get_ext(const X509_REVOKED *x, int loc)
{
	return (X509v3_get_ext(x->extensions, loc));
}

X509_EXTENSION *
X509_REVOKED_delete_ext(X509_REVOKED *x, int loc)
{
	return (X509v3_delete_ext(x->extensions, loc));
}

int
X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc)
{
	return (X509v3_add_ext(&(x->extensions), ex, loc) != NULL);
}

void *
X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit, int *idx)
{
	return X509V3_get_d2i(x->extensions, nid, crit, idx);
}

int
X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
    unsigned long flags)
{
	return X509V3_add1_i2d(&x->extensions, nid, value, crit, flags);
}
Changes to jni/libressl/crypto/x509/x509_lu.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_lu.c,v 1.28 2018/03/17 15:43:32 tb 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <openssl/err.h>
#include <openssl/lhash.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#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)
{
	X509_LOOKUP *ret;

	ret = malloc(sizeof(X509_LOOKUP));







<







61
62
63
64
65
66
67

68
69
70
71
72
73
74
#include <openssl/err.h>
#include <openssl/lhash.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include "x509_lcl.h"

static void X509_OBJECT_dec_ref_count(X509_OBJECT *a);


X509_LOOKUP *
X509_LOOKUP_new(X509_LOOKUP_METHOD *method)
{
	X509_LOOKUP *ret;

	ret = malloc(sizeof(X509_LOOKUP));
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
	if ((ctx->method == NULL) ||
	    (ctx->method->get_by_issuer_serial == NULL))
		return X509_LU_FAIL;
	return ctx->method->get_by_issuer_serial(ctx, type, name, serial, ret);
}

int
X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, unsigned char *bytes,
    int len, X509_OBJECT *ret)
{
	if ((ctx->method == NULL) || (ctx->method->get_by_fingerprint == NULL))
		return X509_LU_FAIL;
	return ctx->method->get_by_fingerprint(ctx, type, bytes, len, ret);
}

int
X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len,
    X509_OBJECT *ret)
{
	if ((ctx->method == NULL) || (ctx->method->get_by_alias == NULL))
		return X509_LU_FAIL;
	return ctx->method->get_by_alias(ctx, type, str, len, ret);
}








|
|







|







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
	if ((ctx->method == NULL) ||
	    (ctx->method->get_by_issuer_serial == NULL))
		return X509_LU_FAIL;
	return ctx->method->get_by_issuer_serial(ctx, type, name, serial, ret);
}

int
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;
	return ctx->method->get_by_fingerprint(ctx, type, bytes, len, ret);
}

int
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))
		return X509_LU_FAIL;
	return ctx->method->get_by_alias(ctx, type, str, len, ret);
}

441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458

459
460
461
462
463
464
465
		break;
	case X509_LU_CRL:
		CRYPTO_add(&a->data.crl->references, -1, CRYPTO_LOCK_X509_CRL);
		break;
	}
}

/*static*/ void
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;
	case X509_LU_CRL:
		CRYPTO_add(&a->data.crl->references, 1, CRYPTO_LOCK_X509_CRL);
		break;
	}

}

int
X509_OBJECT_get_type(const X509_OBJECT *a)
{
	return a->type;
}







|




|
<

|
<

>







440
441
442
443
444
445
446
447
448
449
450
451
452

453
454

455
456
457
458
459
460
461
462
463
		break;
	case X509_LU_CRL:
		CRYPTO_add(&a->data.crl->references, -1, CRYPTO_LOCK_X509_CRL);
		break;
	}
}

int
X509_OBJECT_up_ref_count(X509_OBJECT *a)
{
	switch (a->type) {
	case X509_LU_X509:
		return X509_up_ref(a->data.x509);

	case X509_LU_CRL:
		return X509_CRL_up_ref(a->data.crl);

	}
	return 1;
}

int
X509_OBJECT_get_type(const X509_OBJECT *a)
{
	return a->type;
}
Changes to jni/libressl/crypto/x509/x509_obj.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_obj.c,v 1.17 2017/01/29 17:49:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <openssl/buffer.h>
#include <openssl/err.h>
#include <openssl/lhash.h>
#include <openssl/objects.h>
#include <openssl/x509.h>

char *
X509_NAME_oneline(X509_NAME *a, char *buf, int len)
{
	X509_NAME_ENTRY *ne;
	int i;
	int n, lold, l, l1, l2, num, j, type;
	const char *s;
	char *p;
	unsigned char *q;







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <openssl/buffer.h>
#include <openssl/err.h>
#include <openssl/lhash.h>
#include <openssl/objects.h>
#include <openssl/x509.h>

char *
X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
{
	X509_NAME_ENTRY *ne;
	int i;
	int n, lold, l, l1, l2, num, j, type;
	const char *s;
	char *p;
	unsigned char *q;
Changes to jni/libressl/crypto/x509/x509_req.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_req.c,v 1.20 2017/01/29 17:49:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
282
283
284
285
286
287
288
289

290
291
292
293
294
295
296
int
X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos)
{
	return X509at_get_attr_by_NID(req->req_info->attributes, nid, lastpos);
}

int
X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, int lastpos)

{
	return X509at_get_attr_by_OBJ(req->req_info->attributes, obj, lastpos);
}

X509_ATTRIBUTE *
X509_REQ_get_attr(const X509_REQ *req, int loc)
{







|
>







282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
int
X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos)
{
	return X509at_get_attr_by_NID(req->req_info->attributes, nid, lastpos);
}

int
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);
}

X509_ATTRIBUTE *
X509_REQ_get_attr(const X509_REQ *req, int loc)
{
Changes to jni/libressl/crypto/x509/x509_set.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_set.c,v 1.16 2018/02/22 17:09:28 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
82
83
84
85
86
87
88






89
90
91
92
93
94
95
		return (0);
	if (x->cert_info->version == NULL) {
		if ((x->cert_info->version = ASN1_INTEGER_new()) == NULL)
			return (0);
	}
	return (ASN1_INTEGER_set(x->cert_info->version, version));
}







int
X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial)
{
	ASN1_INTEGER *in;

	if (x == NULL)







>
>
>
>
>
>







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
		return (0);
	if (x->cert_info->version == NULL) {
		if ((x->cert_info->version = ASN1_INTEGER_new()) == NULL)
			return (0);
	}
	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)
{
	ASN1_INTEGER *in;

	if (x == NULL)
200
201
202
203
204
205
206






int
X509_set_pubkey(X509 *x, EVP_PKEY *pkey)
{
	if ((x == NULL) || (x->cert_info == NULL))
		return (0);
	return (X509_PUBKEY_set(&(x->cert_info->key), pkey));
}













>
>
>
>
>
>
206
207
208
209
210
211
212
213
214
215
216
217
218
int
X509_set_pubkey(X509 *x, EVP_PKEY *pkey)
{
	if ((x == NULL) || (x->cert_info == NULL))
		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));
}
Changes to jni/libressl/crypto/x509/x509_trs.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_trs.c,v 1.22 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
	}
	*t = trust;
	return 1;
}

int
X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
    char *name, int arg1, void *arg2)
{
	int idx;
	X509_TRUST *trtmp;
	char *name_dup;

	/* This is set according to what we change: application can't set it */
	flags &= ~X509_TRUST_DYNAMIC;







|







183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
	}
	*t = trust;
	return 1;
}

int
X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
    const char *name, int arg1, void *arg2)
{
	int idx;
	X509_TRUST *trtmp;
	char *name_dup;

	/* This is set according to what we change: application can't set it */
	flags &= ~X509_TRUST_DYNAMIC;
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
	for (i = 0; i < X509_TRUST_COUNT; i++)
		trtable_free(trstandard + i);
	sk_X509_TRUST_pop_free(trtable, trtable_free);
	trtable = NULL;
}

int
X509_TRUST_get_flags(X509_TRUST *xp)
{
	return xp->flags;
}

char *
X509_TRUST_get0_name(X509_TRUST *xp)
{
	return xp->name;
}

int
X509_TRUST_get_trust(X509_TRUST *xp)
{
	return xp->trust;
}

static int
trust_1oidany(X509_TRUST *trust, X509 *x, int flags)
{







|





|





|







270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
	for (i = 0; i < X509_TRUST_COUNT; i++)
		trtable_free(trstandard + i);
	sk_X509_TRUST_pop_free(trtable, trtable_free);
	trtable = NULL;
}

int
X509_TRUST_get_flags(const X509_TRUST *xp)
{
	return xp->flags;
}

char *
X509_TRUST_get0_name(const X509_TRUST *xp)
{
	return xp->name;
}

int
X509_TRUST_get_trust(const X509_TRUST *xp)
{
	return xp->trust;
}

static int
trust_1oidany(X509_TRUST *trust, X509 *x, int flags)
{
Changes to jni/libressl/crypto/x509/x509_v3.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_v3.c,v 1.14 2017/01/29 17:49:23 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
	obj = OBJ_nid2obj(nid);
	if (obj == NULL)
		return (-2);
	return (X509v3_get_ext_by_OBJ(x, obj, lastpos));
}

int
X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, ASN1_OBJECT *obj,
    int lastpos)
{
	int n;
	X509_EXTENSION *ex;

	if (sk == NULL)
		return (-1);
	lastpos++;







|
|







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
	obj = OBJ_nid2obj(nid);
	if (obj == NULL)
		return (-2);
	return (X509v3_get_ext_by_OBJ(x, obj, lastpos));
}

int
X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk,
    const ASN1_OBJECT *obj, int lastpos)
{
	int n;
	X509_EXTENSION *ex;

	if (sk == NULL)
		return (-1);
	lastpos++;
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
	ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data);
	if (ret == NULL)
		ASN1_OBJECT_free(obj);
	return (ret);
}

X509_EXTENSION *
X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, ASN1_OBJECT *obj, int crit,
    ASN1_OCTET_STRING *data)
{
	X509_EXTENSION *ret;

	if ((ex == NULL) || (*ex == NULL)) {
		if ((ret = X509_EXTENSION_new()) == NULL) {
			X509error(ERR_R_MALLOC_FAILURE);
			return (NULL);







|
|







205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
	ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data);
	if (ret == NULL)
		ASN1_OBJECT_free(obj);
	return (ret);
}

X509_EXTENSION *
X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, const ASN1_OBJECT *obj,
    int crit, ASN1_OCTET_STRING *data)
{
	X509_EXTENSION *ret;

	if ((ex == NULL) || (*ex == NULL)) {
		if ((ret = X509_EXTENSION_new()) == NULL) {
			X509error(ERR_R_MALLOC_FAILURE);
			return (NULL);
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
err:
	if ((ex == NULL) || (ret != *ex))
		X509_EXTENSION_free(ret);
	return (NULL);
}

int
X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj)
{
	if ((ex == NULL) || (obj == NULL))
		return (0);
	ASN1_OBJECT_free(ex->object);
	ex->object = OBJ_dup(obj);
	return ex->object != NULL;
}







|







236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
err:
	if ((ex == NULL) || (ret != *ex))
		X509_EXTENSION_free(ret);
	return (NULL);
}

int
X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj)
{
	if ((ex == NULL) || (obj == NULL))
		return (0);
	ASN1_OBJECT_free(ex->object);
	ex->object = OBJ_dup(obj);
	return ex->object != NULL;
}
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
{
	if (ex == NULL)
		return (NULL);
	return (ex->value);
}

int
X509_EXTENSION_get_critical(X509_EXTENSION *ex)
{
	if (ex == NULL)
		return (0);
	if (ex->critical > 0)
		return 1;
	return 0;
}







|







284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
{
	if (ex == NULL)
		return (NULL);
	return (ex->value);
}

int
X509_EXTENSION_get_critical(const X509_EXTENSION *ex)
{
	if (ex == NULL)
		return (0);
	if (ex->critical > 0)
		return 1;
	return 0;
}
Changes to jni/libressl/crypto/x509/x509_vfy.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_vfy.c,v 1.68 2018/02/22 17:11:30 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: x509_vfy.c,v 1.71 2018/08/19 20:19:31 tb 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.
 *
178
179
180
181
182
183
184
185
186
187
188

189
190
191
192
193
194
195
	ctx->error_depth = 0;
	return ctx->verify_cb(0, ctx);
}

static int
check_hosts(X509 *x, X509_VERIFY_PARAM_ID *id)
{
	size_t i;
	size_t n = sk_OPENSSL_STRING_num(id->hosts);
	char *name;


	free(id->peername);
	id->peername = NULL;

	for (i = 0; i < n; ++i) {
		name = sk_OPENSSL_STRING_value(id->hosts, i);
		if (X509_check_host(x, name, strlen(name), id->hostflags,
		    &id->peername) > 0)







|
<


>







178
179
180
181
182
183
184
185

186
187
188
189
190
191
192
193
194
195
	ctx->error_depth = 0;
	return ctx->verify_cb(0, ctx);
}

static int
check_hosts(X509 *x, X509_VERIFY_PARAM_ID *id)
{
	size_t i, n;

	char *name;

	n = sk_OPENSSL_STRING_num(id->hosts);
	free(id->peername);
	id->peername = NULL;

	for (i = 0; i < n; ++i) {
		name = sk_OPENSSL_STRING_value(id->hosts, i);
		if (X509_check_host(x, name, strlen(name), id->hostflags,
		    &id->peername) > 0)
237
238
239
240
241
242
243









244
245
246
247
248
249
250
		ctx->error = X509_V_ERR_INVALID_CALL;
		return -1;
	}
	if (ctx->chain != NULL) {
		/*
		 * This X509_STORE_CTX has already been used to verify
		 * a cert. We cannot do another one.









		 */
		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) {
		/*







>
>
>
>
>
>
>
>
>







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
		ctx->error = X509_V_ERR_INVALID_CALL;
		return -1;
	}
	if (ctx->chain != NULL) {
		/*
		 * This X509_STORE_CTX has already been used to verify
		 * a cert. We cannot do another one.
		 */
		X509error(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
		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) {
		/*
483
484
485
486
487
488
489
490
491

492

493
494
495
496
497
498
499
			if (ctx->last_untrusted >= num)
				ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY;
			else
				ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
			ctx->current_cert = x;
		} else {
			if (!sk_X509_push(ctx->chain, chain_ss)) {
				X509_free(chain_ss);
				X509error(ERR_R_MALLOC_FAILURE);

				return 0;

			}
			num++;
			ctx->last_untrusted = num;
			ctx->current_cert = chain_ss;
			ctx->error = X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN;
			chain_ss = NULL;
		}







<

>
|
>







492
493
494
495
496
497
498

499
500
501
502
503
504
505
506
507
508
509
			if (ctx->last_untrusted >= num)
				ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY;
			else
				ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
			ctx->current_cert = x;
		} else {
			if (!sk_X509_push(ctx->chain, chain_ss)) {

				X509error(ERR_R_MALLOC_FAILURE);
				ctx->error = X509_V_ERR_OUT_OF_MEM;
				ok = 0;
				goto end;
			}
			num++;
			ctx->last_untrusted = num;
			ctx->current_cert = chain_ss;
			ctx->error = X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN;
			chain_ss = NULL;
		}
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
		goto end;

	/* If we get this far evaluate policies */
	if (!bad_chain && (ctx->param->flags & X509_V_FLAG_POLICY_CHECK))
		ok = ctx->check_policy(ctx);

 end:
	if (sktmp != NULL)
		sk_X509_free(sktmp);
	X509_free(chain_ss);

	/* Safety net, error returns must set ctx->error */
	if (ok <= 0 && ctx->error == X509_V_OK)
		ctx->error = X509_V_ERR_UNSPECIFIED;
	return ok;
}







<
|







545
546
547
548
549
550
551

552
553
554
555
556
557
558
559
		goto end;

	/* If we get this far evaluate policies */
	if (!bad_chain && (ctx->param->flags & X509_V_FLAG_POLICY_CHECK))
		ok = ctx->check_policy(ctx);

 end:

	sk_X509_free(sktmp);
	X509_free(chain_ss);

	/* Safety net, error returns must set ctx->error */
	if (ok <= 0 && ctx->error == X509_V_OK)
		ctx->error = X509_V_ERR_UNSPECIFIED;
	return ok;
}
Changes to jni/libressl/crypto/x509/x509_vpm.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_vpm.c,v 1.17 2018/03/22 15:54:46 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2004.
 */
/* ====================================================================
 * Copyright (c) 2004 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2004 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
		}
	}

	return ret;
}

static int
int_x509_param_set_hosts(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;

	if (mode == SET_HOST && id->hosts) {
		string_stack_free(id->hosts);
		id->hosts = NULL;







|








<







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

137
138
139
140
141
142
143
		}
	}

	return ret;
}

static int
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.

	 */
	if (name && memchr(name, '\0', namelen))
		return 0;

	if (mode == SET_HOST && id->hosts) {
		string_stack_free(id->hosts);
		id->hosts = NULL;
193
194
195
196
197
198
199

200
201
202
203
204
205
206
	paramid->peername = NULL;
	free(paramid->email);
	paramid->email = NULL;
	paramid->emaillen = 0;
	free(paramid->ip);
	paramid->ip = NULL;
	paramid->iplen = 0;

}

X509_VERIFY_PARAM *
X509_VERIFY_PARAM_new(void)
{
	X509_VERIFY_PARAM *param;
	X509_VERIFY_PARAM_ID *paramid;







>







192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
	paramid->peername = NULL;
	free(paramid->email);
	paramid->email = NULL;
	paramid->emaillen = 0;
	free(paramid->ip);
	paramid->ip = NULL;
	paramid->iplen = 0;
	paramid->poisoned = 0;
}

X509_VERIFY_PARAM *
X509_VERIFY_PARAM_new(void)
{
	X509_VERIFY_PARAM *param;
	X509_VERIFY_PARAM_ID *paramid;
363
364
365
366
367
368
369
370
371
372
373

374


375



376
377
378
379


380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
	to->inh_flags |= X509_VP_FLAG_DEFAULT;
	ret = X509_VERIFY_PARAM_inherit(to, from);
	to->inh_flags = save_flags;
	return ret;
}

static int
int_x509_param_set1(char **pdest, size_t *pdestlen,  const char *src,
    size_t srclen)
{
	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);
		}
	} else {
		tmp = NULL;
		srclen = 0;
	}
	if (*pdest)
		free(*pdest);
	*pdest = tmp;
	if (pdestlen)
		*pdestlen = srclen;
	return 1;
}







|
|


>
|
>
>
|
>
>
>
|
|
<
|
>
>
|
|
|
|
<
<
<
|







363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383

384
385
386
387
388
389
390



391
392
393
394
395
396
397
398
	to->inh_flags |= X509_VP_FLAG_DEFAULT;
	ret = X509_VERIFY_PARAM_inherit(to, from);
	to->inh_flags = save_flags;
	return ret;
}

static int
x509_param_set1_internal(char **pdest, size_t *pdestlen,  const char *src,
    size_t srclen, int nonul)
{
	char *tmp;

	if (src == NULL)
		return 0;

	if (srclen == 0) {
		srclen = strlen(src);
		if (srclen == 0)
			return 0;
		if ((tmp = strdup(src)) == NULL)
			return 0;

	} else {
		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;
	if (pdestlen)
		*pdestlen = srclen;
	return 1;
}
501
502
503
504
505
506
507
508



509
510
511
512
513
514
515



516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535



536
537
538
539
540
541
542
543
544
545




546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
	return 1;
}

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);



}

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);



}

void
X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags)
{
	param->id->hostflags = flags;
}

char *
X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param)
{
	return param->id->peername;
}

int
X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,  const char *email,
    size_t emaillen)
{
	return int_x509_param_set1(&param->id->email, &param->id->emaillen,
	    email, emaillen);



}

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 **)&param->id->ip, &param->id->iplen,
	    (char *)ip, iplen);




}

int
X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc)
{
	unsigned char ipout[16];
	size_t iplen;

	iplen = (size_t)a2i_ipadd(ipout, ipasc);
	if (iplen == 0)
		return 0;
	return X509_VERIFY_PARAM_set1_ip(param, ipout, iplen);
}

int
X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param)
{
	return param->depth;







|
>
>
>






|
>
>
>


















|
|
>
>
>






|
|
|
|
>
>
>
>









<
<







505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571


572
573
574
575
576
577
578
	return 1;
}

int
X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
    const char *name, size_t 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)
{
	if (x509_param_set_hosts_internal(param->id, ADD_HOST, name, namelen))
		return 1;
	param->id->poisoned = 1;
	return 0;
}

void
X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags)
{
	param->id->hostflags = flags;
}

char *
X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param)
{
	return param->id->peername;
}

int
X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,  const char *email,
    size_t emaillen)
{
	if (x509_param_set1_internal(&param->id->email, &param->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 != 4 && iplen != 16)
		goto err;
	if (x509_param_set1_internal((char **)&param->id->ip, &param->id->iplen,
		(char *)ip, iplen, 0))
		return 1;
 err:
	param->id->poisoned = 1;
	return 0;
}

int
X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc)
{
	unsigned char ipout[16];
	size_t iplen;

	iplen = (size_t)a2i_ipadd(ipout, ipasc);


	return X509_VERIFY_PARAM_set1_ip(param, ipout, iplen);
}

int
X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param)
{
	return param->depth;
Changes to jni/libressl/crypto/x509/x509name.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509name.c,v 1.15 2018/03/17 15:28:27 tb 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
	obj = OBJ_nid2obj(nid);
	if (obj == NULL)
		return (-1);
	return (X509_NAME_get_text_by_OBJ(name, obj, buf, len));
}

int
X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, char *buf,
    int len)
{
	int i;
	ASN1_STRING *data;

	i = X509_NAME_get_index_by_OBJ(name, obj, -1);
	if (i < 0)
		return (-1);
	data = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name, i));
	i = (data->length > (len - 1)) ? (len - 1) : data->length;
	if (buf == NULL)
		return (data->length);
	if (i >= 0) {
		memcpy(buf, data->data, i);
		buf[i] = '\0';
	}
	return (i);
}

int
X509_NAME_entry_count(X509_NAME *name)
{
	if (name == NULL)
		return (0);
	return (sk_X509_NAME_ENTRY_num(name->entries));
}

int
X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos)
{
	ASN1_OBJECT *obj;

	obj = OBJ_nid2obj(nid);
	if (obj == NULL)
		return (-2);
	return (X509_NAME_get_index_by_OBJ(name, obj, 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)

{
	int n;
	X509_NAME_ENTRY *ne;
	STACK_OF(X509_NAME_ENTRY) *sk;

	if (name == NULL)
		return (-1);
	if (lastpos < 0)
		lastpos = -1;
	sk = name->entries;
	n = sk_X509_NAME_ENTRY_num(sk);
	for (lastpos++; lastpos < n; lastpos++) {
		ne = sk_X509_NAME_ENTRY_value(sk, lastpos);
		if (OBJ_cmp(ne->object, obj) == 0)
			return (lastpos);
	}
	return (-1);
}

X509_NAME_ENTRY *
X509_NAME_get_entry(X509_NAME *name, int loc)
{
	if (name == NULL || sk_X509_NAME_ENTRY_num(name->entries) <= loc ||
	    loc < 0)
		return (NULL);
	else
		return (sk_X509_NAME_ENTRY_value(name->entries, loc));
}







|




















|







|











|
>




















|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
	obj = OBJ_nid2obj(nid);
	if (obj == NULL)
		return (-1);
	return (X509_NAME_get_text_by_OBJ(name, obj, buf, len));
}

int
X509_NAME_get_text_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, char *buf,
    int len)
{
	int i;
	ASN1_STRING *data;

	i = X509_NAME_get_index_by_OBJ(name, obj, -1);
	if (i < 0)
		return (-1);
	data = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name, i));
	i = (data->length > (len - 1)) ? (len - 1) : data->length;
	if (buf == NULL)
		return (data->length);
	if (i >= 0) {
		memcpy(buf, data->data, i);
		buf[i] = '\0';
	}
	return (i);
}

int
X509_NAME_entry_count(const X509_NAME *name)
{
	if (name == NULL)
		return (0);
	return (sk_X509_NAME_ENTRY_num(name->entries));
}

int
X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos)
{
	ASN1_OBJECT *obj;

	obj = OBJ_nid2obj(nid);
	if (obj == NULL)
		return (-2);
	return (X509_NAME_get_index_by_OBJ(name, obj, lastpos));
}

/* NOTE: you should be passsing -1, not 0 as lastpos */
int
X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
    int lastpos)
{
	int n;
	X509_NAME_ENTRY *ne;
	STACK_OF(X509_NAME_ENTRY) *sk;

	if (name == NULL)
		return (-1);
	if (lastpos < 0)
		lastpos = -1;
	sk = name->entries;
	n = sk_X509_NAME_ENTRY_num(sk);
	for (lastpos++; lastpos < n; lastpos++) {
		ne = sk_X509_NAME_ENTRY_value(sk, lastpos);
		if (OBJ_cmp(ne->object, obj) == 0)
			return (lastpos);
	}
	return (-1);
}

X509_NAME_ENTRY *
X509_NAME_get_entry(const X509_NAME *name, int loc)
{
	if (name == NULL || sk_X509_NAME_ENTRY_num(name->entries) <= loc ||
	    loc < 0)
		return (NULL);
	else
		return (sk_X509_NAME_ENTRY_value(name->entries, loc));
}
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
	if (set_prev + 1 < set_next)
		for (i = loc; i < n; i++)
			sk_X509_NAME_ENTRY_value(sk, i)->set--;
	return (ret);
}

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_ENTRY *ne;
	int ret;

	ne = X509_NAME_ENTRY_create_by_OBJ(NULL, obj, type, bytes, len);
	if (!ne)
		return 0;
	ret = X509_NAME_add_entry(name, ne, loc, set);
	X509_NAME_ENTRY_free(ne);
	return ret;
}

int
X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
    unsigned char *bytes, int len, int loc, int set)
{
	X509_NAME_ENTRY *ne;
	int ret;

	ne = X509_NAME_ENTRY_create_by_NID(NULL, nid, type, bytes, len);
	if (!ne)
		return 0;







|
|














|







185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
	if (set_prev + 1 < set_next)
		for (i = loc; i < n; i++)
			sk_X509_NAME_ENTRY_value(sk, i)->set--;
	return (ret);
}

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)
{
	X509_NAME_ENTRY *ne;
	int ret;

	ne = X509_NAME_ENTRY_create_by_OBJ(NULL, obj, type, bytes, len);
	if (!ne)
		return 0;
	ret = X509_NAME_add_entry(name, ne, loc, set);
	X509_NAME_ENTRY_free(ne);
	return ret;
}

int
X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
    const unsigned char *bytes, int len, int loc, int set)
{
	X509_NAME_ENTRY *ne;
	int ret;

	ne = X509_NAME_ENTRY_create_by_NID(NULL, nid, type, bytes, len);
	if (!ne)
		return 0;
231
232
233
234
235
236
237
238

239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273

274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
	X509_NAME_ENTRY_free(ne);
	return ret;
}

/* 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_ENTRY *new_name = NULL;
	int n, i, inc;
	STACK_OF(X509_NAME_ENTRY) *sk;

	if (name == NULL)
		return (0);
	sk = name->entries;
	n = sk_X509_NAME_ENTRY_num(sk);
	if (loc > n)
		loc = n;
	else if (loc < 0)
		loc = n;

	name->modified = 1;

	if (set == -1) {
		if (loc == 0) {
			set = 0;
			inc = 1;
		} else {
			set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set;
			inc = 0;
		}
	} else /* if (set >= 0) */ {
		if (loc >= n) {
			if (loc != 0)
				set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set + 1;
			else
				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)
		goto err;
	new_name->set = set;
	if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) {
		X509error(ERR_R_MALLOC_FAILURE);
		goto err;
	}
	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;
	}
	return (1);

err:
	if (new_name != NULL)
		X509_NAME_ENTRY_free(new_name);
	return (0);







|
>













|






|

<
<








<


>
|









|







232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262


263
264
265
266
267
268
269
270

271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
	X509_NAME_ENTRY_free(ne);
	return ret;
}

/* 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, const X509_NAME_ENTRY *ne, int loc,
    int set)
{
	X509_NAME_ENTRY *new_name = NULL;
	int n, i, inc;
	STACK_OF(X509_NAME_ENTRY) *sk;

	if (name == NULL)
		return (0);
	sk = name->entries;
	n = sk_X509_NAME_ENTRY_num(sk);
	if (loc > n)
		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
			set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set;


	} else /* if (set >= 0) */ {
		if (loc >= n) {
			if (loc != 0)
				set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set + 1;
			else
				set = 0;
		} else
			set = sk_X509_NAME_ENTRY_value(sk, loc)->set;

	}

	/* 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)) {
		X509error(ERR_R_MALLOC_FAILURE);
		goto err;
	}
	if (inc) {
		n = sk_X509_NAME_ENTRY_num(sk);
		for (i = loc + 1; i < n; i++)
			sk_X509_NAME_ENTRY_value(sk, i)->set += 1;
	}
	return (1);

err:
	if (new_name != NULL)
		X509_NAME_ENTRY_free(new_name);
	return (0);
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
	nentry = X509_NAME_ENTRY_create_by_OBJ(ne, obj, type, bytes, len);
	ASN1_OBJECT_free(obj);
	return nentry;
}

X509_NAME_ENTRY *
X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type,
    unsigned char *bytes, int len)
{
	ASN1_OBJECT *obj;
	X509_NAME_ENTRY *nentry;

	obj = OBJ_nid2obj(nid);
	if (obj == NULL) {
		X509error(X509_R_UNKNOWN_NID);
		return (NULL);
	}
	nentry = X509_NAME_ENTRY_create_by_OBJ(ne, obj, type, bytes, len);
	ASN1_OBJECT_free(obj);
	return nentry;
}

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 *ret;

	if ((ne == NULL) || (*ne == NULL)) {
		if ((ret = X509_NAME_ENTRY_new()) == NULL)
			return (NULL);
	} else







|















|
|







307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
	nentry = X509_NAME_ENTRY_create_by_OBJ(ne, obj, type, bytes, len);
	ASN1_OBJECT_free(obj);
	return nentry;
}

X509_NAME_ENTRY *
X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type,
    const unsigned char *bytes, int len)
{
	ASN1_OBJECT *obj;
	X509_NAME_ENTRY *nentry;

	obj = OBJ_nid2obj(nid);
	if (obj == NULL) {
		X509error(X509_R_UNKNOWN_NID);
		return (NULL);
	}
	nentry = X509_NAME_ENTRY_create_by_OBJ(ne, obj, type, bytes, len);
	ASN1_OBJECT_free(obj);
	return nentry;
}

X509_NAME_ENTRY *
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;

	if ((ne == NULL) || (*ne == NULL)) {
		if ((ret = X509_NAME_ENTRY_new()) == NULL)
			return (NULL);
	} else
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
err:
	if ((ne == NULL) || (ret != *ne))
		X509_NAME_ENTRY_free(ret);
	return (NULL);
}

int
X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj)
{
	if ((ne == NULL) || (obj == NULL)) {
		X509error(ERR_R_PASSED_NULL_PARAMETER);
		return (0);
	}
	ASN1_OBJECT_free(ne->object);
	ne->object = OBJ_dup(obj);







|







350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
err:
	if ((ne == NULL) || (ret != *ne))
		X509_NAME_ENTRY_free(ret);
	return (NULL);
}

int
X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj)
{
	if ((ne == NULL) || (obj == NULL)) {
		X509error(ERR_R_PASSED_NULL_PARAMETER);
		return (0);
	}
	ASN1_OBJECT_free(ne->object);
	ne->object = OBJ_dup(obj);
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
		else
			ne->value->type = type;
	}
	return (1);
}

ASN1_OBJECT *
X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne)
{
	if (ne == NULL)
		return (NULL);
	return (ne->object);
}

ASN1_STRING *
X509_NAME_ENTRY_get_data(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);
}







|







|











387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
		else
			ne->value->type = type;
	}
	return (1);
}

ASN1_OBJECT *
X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne)
{
	if (ne == NULL)
		return (NULL);
	return (ne->object);
}

ASN1_STRING *
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);
}
Changes to jni/libressl/crypto/x509/x509rset.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509rset.c,v 1.6 2014/07/11 08:44:49 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
66
67
68
69
70
71
72






73
74
75
76
77
78
79
80






81
82
83
84
85
86
87
88
int
X509_REQ_set_version(X509_REQ *x, long version)
{
	if (x == NULL)
		return (0);
	return (ASN1_INTEGER_set(x->req_info->version, version));
}







int
X509_REQ_set_subject_name(X509_REQ *x, X509_NAME *name)
{
	if ((x == NULL) || (x->req_info == NULL))
		return (0);
	return (X509_NAME_set(&x->req_info->subject, name));
}







int
X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey)
{
	if ((x == NULL) || (x->req_info == NULL))
		return (0);
	return (X509_PUBKEY_set(&x->req_info->pubkey, pkey));
}







>
>
>
>
>
>








>
>
>
>
>
>








66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
int
X509_REQ_set_version(X509_REQ *x, long version)
{
	if (x == NULL)
		return (0);
	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)
{
	if ((x == NULL) || (x->req_info == NULL))
		return (0);
	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)
{
	if ((x == NULL) || (x->req_info == NULL))
		return (0);
	return (X509_PUBKEY_set(&x->req_info->pubkey, pkey));
}
Changes to jni/libressl/crypto/x509/x509type.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509type.c,v 1.12 2015/06/13 08:38:10 doug 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include <stdio.h>

#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>

int
X509_certificate_type(X509 *x, EVP_PKEY *pkey)
{
	EVP_PKEY *pk;
	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);

	switch (pk->type) {
	case EVP_PKEY_RSA:
		ret = EVP_PK_RSA|EVP_PKT_SIGN;
/*		if (!sign only extension) */
		ret |= EVP_PKT_ENC;
		break;
	case EVP_PKEY_DSA:
		ret = EVP_PK_DSA|EVP_PKT_SIGN;
		break;
	case EVP_PKEY_EC:
		ret = EVP_PK_EC|EVP_PKT_SIGN|EVP_PKT_EXCH;
		break;







|

|





|
|
|
<
|
<
<



|
<
<







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

77


78
79
80
81


82
83
84
85
86
87
88
#include <stdio.h>

#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>

int
X509_certificate_type(const X509 *x, const EVP_PKEY *pkey)
{
	const EVP_PKEY *pk = pkey;
	int ret = 0, i;

	if (x == 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|EVP_PKT_ENC;


		break;
	case EVP_PKEY_DSA:
		ret = EVP_PK_DSA|EVP_PKT_SIGN;
		break;
	case EVP_PKEY_EC:
		ret = EVP_PK_EC|EVP_PKT_SIGN|EVP_PKT_EXCH;
		break;
120
121
122
123
124
125
126
127
128
129
130
			break;
		}
	}

	/* /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);
}







<
<


115
116
117
118
119
120
121


122
123
			break;
		}
	}

	/* /8 because it's 1024 bits we look for, not bytes */
	if (EVP_PKEY_size(pk) <= 1024 / 8)
		ret |= EVP_PKT_EXP;


	return (ret);
}
Changes to jni/libressl/crypto/x509v3/v3_alt.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: v3_alt.c,v 1.27 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project.
 */
/* ====================================================================
 * Copyright (c) 1999-2003 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2003 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method,
    X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
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);

const X509V3_EXT_METHOD v3_alt[] = {
	{
		.ext_nid = NID_subject_alt_name,
		.ext_flags = 0,
		.it = &GENERAL_NAMES_it,
		.ext_new = NULL,







|
|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method,
    X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
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, 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[] = {
	{
		.ext_nid = NID_subject_alt_name,
		.ext_flags = 0,
		.it = &GENERAL_NAMES_it,
		.ext_new = NULL,
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
    CONF_VALUE *cnf)
{
	return v2i_GENERAL_NAME_ex(NULL, method, ctx, cnf, 0);
}

GENERAL_NAME *
a2i_GENERAL_NAME(GENERAL_NAME *out, const X509V3_EXT_METHOD *method,
    X509V3_CTX *ctx, int gen_type, char *value, int is_nc)
{
	char is_string = 0;
	GENERAL_NAME *gen = NULL;

	if (!value) {
		X509V3error(X509V3_R_MISSING_VALUE);
		return NULL;







|







477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
    CONF_VALUE *cnf)
{
	return v2i_GENERAL_NAME_ex(NULL, method, ctx, cnf, 0);
}

GENERAL_NAME *
a2i_GENERAL_NAME(GENERAL_NAME *out, const X509V3_EXT_METHOD *method,
    X509V3_CTX *ctx, int gen_type, const char *value, int is_nc)
{
	char is_string = 0;
	GENERAL_NAME *gen = NULL;

	if (!value) {
		X509V3error(X509V3_R_MISSING_VALUE);
		return NULL;
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
	default:
		X509V3error(X509V3_R_UNSUPPORTED_TYPE);
		goto err;
	}

	if (is_string) {
		if (!(gen->d.ia5 = ASN1_IA5STRING_new()) ||
		    !ASN1_STRING_set(gen->d.ia5, (unsigned char*)value,
			strlen(value))) {
			X509V3error(ERR_R_MALLOC_FAILURE);
			goto err;
		}
	}

	gen->type = gen_type;








|
<







549
550
551
552
553
554
555
556

557
558
559
560
561
562
563
	default:
		X509V3error(X509V3_R_UNSUPPORTED_TYPE);
		goto err;
	}

	if (is_string) {
		if (!(gen->d.ia5 = ASN1_IA5STRING_new()) ||
		    !ASN1_STRING_set(gen->d.ia5, value, strlen(value))) {

			X509V3error(ERR_R_MALLOC_FAILURE);
			goto err;
		}
	}

	gen->type = gen_type;

605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
		return NULL;
	}

	return a2i_GENERAL_NAME(out, method, ctx, type, value, is_nc);
}

static int
do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx)
{
	char *objtmp = NULL, *p;
	int objlen;

	if (!(p = strchr(value, ';')))
		return 0;
	if (!(gen->d.otherName = OTHERNAME_new()))







|







604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
		return NULL;
	}

	return a2i_GENERAL_NAME(out, method, ctx, type, value, is_nc);
}

static int
do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx)
{
	char *objtmp = NULL, *p;
	int objlen;

	if (!(p = strchr(value, ';')))
		return 0;
	if (!(gen->d.otherName = OTHERNAME_new()))
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
		gen->d.otherName->type_id = NULL;
	if (!gen->d.otherName->type_id)
		return 0;
	return 1;
}

static int
do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx)
{
	int ret;
	STACK_OF(CONF_VALUE) *sk;
	X509_NAME *nm;

	if (!(nm = X509_NAME_new()))
		return 0;







|







633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
		gen->d.otherName->type_id = NULL;
	if (!gen->d.otherName->type_id)
		return 0;
	return 1;
}

static int
do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx)
{
	int ret;
	STACK_OF(CONF_VALUE) *sk;
	X509_NAME *nm;

	if (!(nm = X509_NAME_new()))
		return 0;
Changes to jni/libressl/crypto/x509v3/v3_conf.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: v3_conf.c,v 1.21 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999-2002 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2002 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
62
63
64
65
66
67
68
69
70
71
72
73
74
75

76

77
78
79

80
81
82
83
84
85

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

121
122
123
124
125
126
127
#include <string.h>

#include <openssl/conf.h>
#include <openssl/err.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>

static int v3_check_critical(char **value);
static int v3_check_generic(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, 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 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);


/* CONF *conf:  Config file    */
/* char *name:  Name    */
/* char *value:  Value    */
X509_EXTENSION *
X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value)

{
	int crit;
	int ext_type;
	X509_EXTENSION *ret;

	crit = v3_check_critical(&value);
	if ((ext_type = v3_check_generic(&value)))
		return v3_generic_extension(name, value, crit, ext_type, ctx);
	ret = do_ext_nconf(conf, ctx, OBJ_sn2nid(name), crit, value);
	if (!ret) {
		X509V3error(X509V3_R_ERROR_IN_EXTENSION);
		ERR_asprintf_error_data("name=%s, value=%s", name, value);
	}
	return ret;
}

/* CONF *conf:  Config file    */
/* char *value:  Value    */
X509_EXTENSION *
X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value)

{
	int crit;
	int ext_type;

	crit = v3_check_critical(&value);
	if ((ext_type = v3_check_generic(&value)))
		return v3_generic_extension(OBJ_nid2sn(ext_nid),
		    value, crit, ext_type, ctx);
	return do_ext_nconf(conf, ctx, ext_nid, crit, 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)

{
	const X509V3_EXT_METHOD *method;
	X509_EXTENSION *ext;
	void *ext_struc;

	if (ext_nid == NID_undef) {
		X509V3error(X509V3_R_UNKNOWN_EXTENSION_NAME);







|
|

|
|

|
>
|
>


|
>





|
>



















|
>














|
>







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#include <string.h>

#include <openssl/conf.h>
#include <openssl/err.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>

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, 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, 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(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, const char *name,
    const char *value)
{
	int crit;
	int ext_type;
	X509_EXTENSION *ret;

	crit = v3_check_critical(&value);
	if ((ext_type = v3_check_generic(&value)))
		return v3_generic_extension(name, value, crit, ext_type, ctx);
	ret = do_ext_nconf(conf, ctx, OBJ_sn2nid(name), crit, value);
	if (!ret) {
		X509V3error(X509V3_R_ERROR_IN_EXTENSION);
		ERR_asprintf_error_data("name=%s, value=%s", name, value);
	}
	return ret;
}

/* CONF *conf:  Config file    */
/* char *value:  Value    */
X509_EXTENSION *
X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
    const char *value)
{
	int crit;
	int ext_type;

	crit = v3_check_critical(&value);
	if ((ext_type = v3_check_generic(&value)))
		return v3_generic_extension(OBJ_nid2sn(ext_nid),
		    value, crit, ext_type, ctx);
	return do_ext_nconf(conf, ctx, ext_nid, crit, value);
}

/* CONF *conf:  Config file    */
/* char *value:  Value    */
static X509_EXTENSION *
do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, int crit,
    const char *value)
{
	const X509V3_EXT_METHOD *method;
	X509_EXTENSION *ext;
	void *ext_struc;

	if (ext_nid == NID_undef) {
		X509V3error(X509V3_R_UNKNOWN_EXTENSION_NAME);
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
		return NULL;
	}
	return do_ext_i2d(method, ext_nid, crit, ext_struc);
}

/* Check the extension string for critical flag */
static int
v3_check_critical(char **value)
{
	char *p = *value;

	if ((strlen(p) < 9) || strncmp(p, "critical,", 9))
		return 0;
	p += 9;
	while (isspace((unsigned char)*p)) p++;
		*value = p;
	return 1;
}

/* Check extension string for generic extension and return the type */
static int
v3_check_generic(char **value)
{
	int gen_type = 0;
	char *p = *value;

	if ((strlen(p) >= 4) && !strncmp(p, "DER:", 4)) {
		p += 4;
		gen_type = 1;
	} else if ((strlen(p) >= 5) && !strncmp(p, "ASN1:", 5)) {
		p += 5;
		gen_type = 2;
	} else
		return 0;

	while (isspace((unsigned char)*p))
		p++;
	*value = p;
	return gen_type;
}

/* 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,
    X509V3_CTX *ctx)
{
	unsigned char *ext_der = NULL;
	long ext_len = 0;
	ASN1_OBJECT *obj = NULL;
	ASN1_OCTET_STRING *oct = NULL;
	X509_EXTENSION *extension = NULL;







|

|











|


|


















|







235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
		return NULL;
	}
	return do_ext_i2d(method, ext_nid, crit, ext_struc);
}

/* Check the extension string for critical flag */
static int
v3_check_critical(const char **value)
{
	const char *p = *value;

	if ((strlen(p) < 9) || strncmp(p, "critical,", 9))
		return 0;
	p += 9;
	while (isspace((unsigned char)*p)) p++;
		*value = p;
	return 1;
}

/* Check extension string for generic extension and return the type */
static int
v3_check_generic(const char **value)
{
	int gen_type = 0;
	const char *p = *value;

	if ((strlen(p) >= 4) && !strncmp(p, "DER:", 4)) {
		p += 4;
		gen_type = 1;
	} else if ((strlen(p) >= 5) && !strncmp(p, "ASN1:", 5)) {
		p += 5;
		gen_type = 2;
	} else
		return 0;

	while (isspace((unsigned char)*p))
		p++;
	*value = p;
	return gen_type;
}

/* Create a generic extension: for now just handle DER type */
static X509_EXTENSION *
v3_generic_extension(const char *ext, const char *value, int crit, int gen_type,
    X509V3_CTX *ctx)
{
	unsigned char *ext_der = NULL;
	long ext_len = 0;
	ASN1_OBJECT *obj = NULL;
	ASN1_OCTET_STRING *oct = NULL;
	X509_EXTENSION *extension = NULL;
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
	ASN1_OBJECT_free(obj);
	ASN1_OCTET_STRING_free(oct);
	free(ext_der);
	return extension;
}

static unsigned char *
generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len)
{
	ASN1_TYPE *typ;
	unsigned char *ext_der = NULL;

	typ = ASN1_generate_v3(value, ctx);
	if (typ == NULL)
		return NULL;
	*ext_len = i2d_ASN1_TYPE(typ, &ext_der);
	ASN1_TYPE_free(typ);
	return ext_der;
}

/* This is the main function: add a bunch of extensions based on a config file
 * section to an extension STACK.
 */

int
X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section,
    STACK_OF(X509_EXTENSION) **sk)
{
	X509_EXTENSION *ext;
	STACK_OF(CONF_VALUE) *nval;
	CONF_VALUE *val;
	int i;








|

















|







320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
	ASN1_OBJECT_free(obj);
	ASN1_OCTET_STRING_free(oct);
	free(ext_der);
	return extension;
}

static unsigned char *
generic_asn1(const char *value, X509V3_CTX *ctx, long *ext_len)
{
	ASN1_TYPE *typ;
	unsigned char *ext_der = NULL;

	typ = ASN1_generate_v3(value, ctx);
	if (typ == NULL)
		return NULL;
	*ext_len = i2d_ASN1_TYPE(typ, &ext_der);
	ASN1_TYPE_free(typ);
	return ext_der;
}

/* This is the main function: add a bunch of extensions based on a config file
 * section to an extension STACK.
 */

int
X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, const char *section,
    STACK_OF(X509_EXTENSION) **sk)
{
	X509_EXTENSION *ext;
	STACK_OF(CONF_VALUE) *nval;
	CONF_VALUE *val;
	int i;

356
357
358
359
360
361
362
363

364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
	}
	return 1;
}

/* 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)

{
	STACK_OF(X509_EXTENSION) **sk = NULL;

	if (cert)
		sk = &cert->cert_info->extensions;
	return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
}

/* Same as above but for a CRL */

int
X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
    X509_CRL *crl)
{
	STACK_OF(X509_EXTENSION) **sk = NULL;

	if (crl)
		sk = &crl->crl->extensions;
	return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
}

/* Add extensions to certificate request */

int
X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
    X509_REQ *req)
{
	STACK_OF(X509_EXTENSION) *extlist = NULL, **sk = NULL;
	int i;

	if (req)
		sk = &extlist;
	i = X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
	if (!i || !sk)
		return i;
	i = X509_REQ_add_extensions(req, extlist);
	sk_X509_EXTENSION_pop_free(extlist, X509_EXTENSION_free);
	return i;
}

/* Config database functions */

char *
X509V3_get_string(X509V3_CTX *ctx, char *name, 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;
}

STACK_OF(CONF_VALUE) *
X509V3_get_section(X509V3_CTX *ctx, 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;
}

void
X509V3_string_free(X509V3_CTX *ctx, char *str)
{
	if (!str)
		return;







|
>











|












|


















|





<
|
<



|





<
|
<







362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419

420

421
422
423
424
425
426
427
428
429

430

431
432
433
434
435
436
437
	}
	return 1;
}

/* Convenience functions to add extensions to a certificate, CRL and request */

int
X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
    X509 *cert)
{
	STACK_OF(X509_EXTENSION) **sk = NULL;

	if (cert)
		sk = &cert->cert_info->extensions;
	return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
}

/* Same as above but for a CRL */

int
X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
    X509_CRL *crl)
{
	STACK_OF(X509_EXTENSION) **sk = NULL;

	if (crl)
		sk = &crl->crl->extensions;
	return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
}

/* Add extensions to certificate request */

int
X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
    X509_REQ *req)
{
	STACK_OF(X509_EXTENSION) *extlist = NULL, **sk = NULL;
	int i;

	if (req)
		sk = &extlist;
	i = X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
	if (!i || !sk)
		return i;
	i = X509_REQ_add_extensions(req, extlist);
	sk_X509_EXTENSION_pop_free(extlist, X509_EXTENSION_free);
	return i;
}

/* Config database functions */

char *
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;
	}

	return ctx->db_meth->get_string(ctx->db, name, section);

}

STACK_OF(CONF_VALUE) *
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;
	}

	return ctx->db_meth->get_section(ctx->db, section);

}

void
X509V3_string_free(X509V3_CTX *ctx, char *str)
{
	if (!str)
		return;
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
	if (!section)
		return;
	if (ctx->db_meth->free_section)
		ctx->db_meth->free_section(ctx->db, section);
}

static char *
nconf_get_string(void *db, char *section, char *value)
{
	return NCONF_get_string(db, section, value);
}

static
STACK_OF(CONF_VALUE) *nconf_get_section(void *db, char *section)
{
	return NCONF_get_section(db, section);
}

static X509V3_CONF_METHOD nconf_method = {
	nconf_get_string,
	nconf_get_section,







|




|
|







445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
	if (!section)
		return;
	if (ctx->db_meth->free_section)
		ctx->db_meth->free_section(ctx->db, section);
}

static char *
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, const char *section)
{
	return NCONF_get_section(db, section);
}

static X509V3_CONF_METHOD nconf_method = {
	nconf_get_string,
	nconf_get_section,
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
	ctx->subject_req = req;
	ctx->flags = flags;
}

/* Old conf compatibility functions */

X509_EXTENSION *
X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, char *name,
    char *value)
{
	CONF ctmp;

	CONF_set_nconf(&ctmp, conf);
	return X509V3_EXT_nconf(&ctmp, ctx, name, value);
}

/* LHASH *conf:  Config file    */
/* char *value:  Value    */
X509_EXTENSION *
X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, int ext_nid,
    char *value)
{
	CONF ctmp;

	CONF_set_nconf(&ctmp, conf);
	return X509V3_EXT_nconf_nid(&ctmp, ctx, ext_nid, value);
}

static char *
conf_lhash_get_string(void *db, char *section, char *value)
{
	return CONF_get_string(db, section, value);
}

static STACK_OF(CONF_VALUE) *
conf_lhash_get_section(void *db, char *section)
{
	return CONF_get_section(db, section);
}

static X509V3_CONF_METHOD conf_lhash_method = {
	conf_lhash_get_string,
	conf_lhash_get_section,
	NULL,
	NULL
};

void
X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash)
{
	ctx->db_meth = &conf_lhash_method;
	ctx->db = lhash;
}

int
X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, char *section,
    X509 *cert)
{
	CONF ctmp;

	CONF_set_nconf(&ctmp, conf);
	return X509V3_EXT_add_nconf(&ctmp, ctx, section, cert);
}

/* Same as above but for a CRL */

int
X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
    char *section, X509_CRL *crl)
{
	CONF ctmp;

	CONF_set_nconf(&ctmp, conf);
	return X509V3_EXT_CRL_add_nconf(&ctmp, ctx, section, crl);
}

/* Add extensions to certificate request */

int
X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
    char *section, X509_REQ *req)
{
	CONF ctmp;

	CONF_set_nconf(&ctmp, conf);
	return X509V3_EXT_REQ_add_nconf(&ctmp, ctx, section, req);
}







|
|











|








|





|



















|
|











|











|






484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
	ctx->subject_req = req;
	ctx->flags = flags;
}

/* Old conf compatibility functions */

X509_EXTENSION *
X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, const char *name,
    const char *value)
{
	CONF ctmp;

	CONF_set_nconf(&ctmp, conf);
	return X509V3_EXT_nconf(&ctmp, ctx, name, value);
}

/* LHASH *conf:  Config file    */
/* char *value:  Value    */
X509_EXTENSION *
X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, int ext_nid,
    const char *value)
{
	CONF ctmp;

	CONF_set_nconf(&ctmp, conf);
	return X509V3_EXT_nconf_nid(&ctmp, ctx, ext_nid, value);
}

static char *
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, const char *section)
{
	return CONF_get_section(db, section);
}

static X509V3_CONF_METHOD conf_lhash_method = {
	conf_lhash_get_string,
	conf_lhash_get_section,
	NULL,
	NULL
};

void
X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash)
{
	ctx->db_meth = &conf_lhash_method;
	ctx->db = lhash;
}

int
X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
    const char *section, X509 *cert)
{
	CONF ctmp;

	CONF_set_nconf(&ctmp, conf);
	return X509V3_EXT_add_nconf(&ctmp, ctx, section, cert);
}

/* Same as above but for a CRL */

int
X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
    const char *section, X509_CRL *crl)
{
	CONF ctmp;

	CONF_set_nconf(&ctmp, conf);
	return X509V3_EXT_CRL_add_nconf(&ctmp, ctx, section, crl);
}

/* Add extensions to certificate request */

int
X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
    const char *section, X509_REQ *req)
{
	CONF ctmp;

	CONF_set_nconf(&ctmp, conf);
	return X509V3_EXT_REQ_add_nconf(&ctmp, ctx, section, req);
}
Changes to jni/libressl/crypto/x509v3/v3_enum.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: v3_enum.c,v 1.12 2016/12/30 15:54:49 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
	.v2i = NULL,
	.i2r = NULL,
	.r2i = NULL,
	.usr_data = crl_reasons,
};

char *
i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *e)
{
	ENUMERATED_NAMES *enam;
	long strval;

	strval = ASN1_ENUMERATED_get(e);
	for (enam = method->usr_data; enam->lname; enam++) {
		if (strval == enam->bitnum)
			return strdup(enam->lname);
	}
	return i2s_ASN1_ENUMERATED(method, e);
}







|











89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
	.v2i = NULL,
	.i2r = NULL,
	.r2i = NULL,
	.usr_data = crl_reasons,
};

char *
i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *e)
{
	ENUMERATED_NAMES *enam;
	long strval;

	strval = ASN1_ENUMERATED_get(e);
	for (enam = method->usr_data; enam->lname; enam++) {
		if (strval == enam->bitnum)
			return strdup(enam->lname);
	}
	return i2s_ASN1_ENUMERATED(method, e);
}
Changes to jni/libressl/crypto/x509v3/v3_info.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: v3_info.c,v 1.25 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
289
290
291
292
293
294
295
296
297
298
299
300

err:
	sk_ACCESS_DESCRIPTION_pop_free(ainfo, ACCESS_DESCRIPTION_free);
	return NULL;
}

int
i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION* a)
{
	i2a_ASN1_OBJECT(bp, a->method);
	return 2;
}







|




289
290
291
292
293
294
295
296
297
298
299
300

err:
	sk_ACCESS_DESCRIPTION_pop_free(ainfo, ACCESS_DESCRIPTION_free);
	return NULL;
}

int
i2a_ACCESS_DESCRIPTION(BIO *bp, const ACCESS_DESCRIPTION* a)
{
	i2a_ASN1_OBJECT(bp, a->method);
	return 2;
}
Changes to jni/libressl/crypto/x509v3/v3_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: v3_lib.c,v 1.17 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
 * the value of *crit reflects the cause:
 * >= 0, extension found but not decoded (reflects critical value).
 * -1 extension not found.
 * -2 extension occurs more than once.
 */

void *
X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx)
{
	int lastpos, i;
	X509_EXTENSION *ex, *found_ex = NULL;

	if (!x) {
		if (idx)
			*idx = -1;







|







223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
 * the value of *crit reflects the cause:
 * >= 0, extension found but not decoded (reflects critical value).
 * -1 extension not found.
 * -2 extension occurs more than once.
 */

void *
X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx)
{
	int lastpos, i;
	X509_EXTENSION *ex, *found_ex = NULL;

	if (!x) {
		if (idx)
			*idx = -1;
Changes to jni/libressl/crypto/x509v3/v3_prn.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: v3_prn.c,v 1.19 2016/12/30 15:54:49 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
		ASN1_item_free(ext_str, method->it);
	else
		method->ext_free(ext_str);
	return ok;
}

int
X509V3_extensions_print(BIO *bp, char *title, STACK_OF(X509_EXTENSION) *exts,
    unsigned long flag, int indent)
{
	int i, j;

	if (sk_X509_EXTENSION_num(exts) <= 0)
		return 1;

	if (title) {







|
|







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
		ASN1_item_free(ext_str, method->it);
	else
		method->ext_free(ext_str);
	return ok;
}

int
X509V3_extensions_print(BIO *bp, const char *title,
    const STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent)
{
	int i, j;

	if (sk_X509_EXTENSION_num(exts) <= 0)
		return 1;

	if (title) {
Changes to jni/libressl/crypto/x509v3/v3_purp.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: v3_purp.c,v 1.30 2017/06/22 17:28:00 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 2001.
 */
/* ====================================================================
 * Copyright (c) 1999-2004 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2004 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
		return NULL;
	if (idx < (int)X509_PURPOSE_COUNT)
		return xstandard + idx;
	return sk_X509_PURPOSE_value(xptable, idx - X509_PURPOSE_COUNT);
}

int
X509_PURPOSE_get_by_sname(char *sname)
{
	int i;
	X509_PURPOSE *xptmp;

	for (i = 0; i < X509_PURPOSE_get_count(); i++) {
		xptmp = X509_PURPOSE_get0(i);
		if (!strcmp(xptmp->sname, sname))







|







168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
		return NULL;
	if (idx < (int)X509_PURPOSE_COUNT)
		return xstandard + idx;
	return sk_X509_PURPOSE_value(xptable, idx - X509_PURPOSE_COUNT);
}

int
X509_PURPOSE_get_by_sname(const char *sname)
{
	int i;
	X509_PURPOSE *xptmp;

	for (i = 0; i < X509_PURPOSE_get_count(); i++) {
		xptmp = X509_PURPOSE_get0(i);
		if (!strcmp(xptmp->sname, sname))
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
	if (idx == -1)
		return -1;
	return idx + X509_PURPOSE_COUNT;
}

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 idx;
	X509_PURPOSE *ptmp;
	char *name_dup, *sname_dup;

	name_dup = sname_dup = NULL;








|
|







200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
	if (idx == -1)
		return -1;
	return idx + X509_PURPOSE_COUNT;
}

int
X509_PURPOSE_add(int id, int trust, int flags,
    int (*ck)(const X509_PURPOSE *, const X509 *, int), const char *name,
    const char *sname, void *arg)
{
	int idx;
	X509_PURPOSE *ptmp;
	char *name_dup, *sname_dup;

	name_dup = sname_dup = NULL;

298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
	sk_X509_PURPOSE_pop_free(xptable, xptable_free);
	for(i = 0; i < X509_PURPOSE_COUNT; i++)
		xptable_free(xstandard + i);
	xptable = NULL;
}

int
X509_PURPOSE_get_id(X509_PURPOSE *xp)
{
	return xp->purpose;
}

char *
X509_PURPOSE_get0_name(X509_PURPOSE *xp)
{
	return xp->name;
}

char *
X509_PURPOSE_get0_sname(X509_PURPOSE *xp)
{
	return xp->sname;
}

int
X509_PURPOSE_get_trust(X509_PURPOSE *xp)
{
	return xp->trust;
}

static int
nid_cmp(const int *a, const int *b)
{







|





|





|





|







298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
	sk_X509_PURPOSE_pop_free(xptable, xptable_free);
	for(i = 0; i < X509_PURPOSE_COUNT; i++)
		xptable_free(xstandard + i);
	xptable = NULL;
}

int
X509_PURPOSE_get_id(const X509_PURPOSE *xp)
{
	return xp->purpose;
}

char *
X509_PURPOSE_get0_name(const X509_PURPOSE *xp)
{
	return xp->name;
}

char *
X509_PURPOSE_get0_sname(const X509_PURPOSE *xp)
{
	return xp->sname;
}

int
X509_PURPOSE_get_trust(const X509_PURPOSE *xp)
{
	return xp->trust;
}

static int
nid_cmp(const int *a, const int *b)
{
Changes to jni/libressl/crypto/x509v3/v3_skey.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: v3_skey.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
79
80
81
82
83
84
85
86
87
88
89
90
91
92

93
94
95
96
97
98
99
	.v2i = NULL,
	.i2r = NULL,
	.r2i = NULL,
	.usr_data = NULL,
};

char *
i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, 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)

{
	ASN1_OCTET_STRING *oct;
	long length;

	if (!(oct = ASN1_OCTET_STRING_new())) {
		X509V3error(ERR_R_MALLOC_FAILURE);
		return NULL;







|





|
>







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
	.v2i = NULL,
	.i2r = NULL,
	.r2i = NULL,
	.usr_data = NULL,
};

char *
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,
    const char *str)
{
	ASN1_OCTET_STRING *oct;
	long length;

	if (!(oct = ASN1_OCTET_STRING_new())) {
		X509V3error(ERR_R_MALLOC_FAILURE);
		return NULL;
Changes to jni/libressl/crypto/x509v3/v3_sxnet.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: v3_sxnet.c,v 1.19 2017/01/29 17:49:23 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $OpenBSD: v3_sxnet.c,v 1.21 2018/05/13 15:03:01 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270

271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289

290
291
292
293
294
295
296
#endif

/* Strong Extranet utility functions */

/* Add an id given the zone as an ASCII number */

int
SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen)
{
	ASN1_INTEGER *izone = NULL;

	if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) {
		X509V3error(X509V3_R_ERROR_CONVERTING_ZONE);
		return 0;
	}
	return SXNET_add_id_INTEGER(psx, izone, user, 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)

{
	ASN1_INTEGER *izone = NULL;

	if (!(izone = ASN1_INTEGER_new()) ||
	    !ASN1_INTEGER_set(izone, lzone)) {
		X509V3error(ERR_R_MALLOC_FAILURE);
		ASN1_INTEGER_free(izone);
		return 0;
	}
	return SXNET_add_id_INTEGER(psx, izone, user, userlen);
}

/* Add an id given the zone as an ASN1_INTEGER.
 * Note this version uses the passed integer and doesn't make a copy so don't
 * free it up afterwards.
 */

int
SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, char *user, int userlen)

{
	SXNET *sx = NULL;
	SXNETID *id = NULL;

	if (!psx || !zone || !user) {
		X509V3error(X509V3_R_INVALID_NULL_ARGUMENT);
		return 0;







|













|
>


















|
>







249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
#endif

/* Strong Extranet utility functions */

/* Add an id given the zone as an ASCII number */

int
SXNET_add_id_asc(SXNET **psx, const char *zone, const char *user, int userlen)
{
	ASN1_INTEGER *izone = NULL;

	if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) {
		X509V3error(X509V3_R_ERROR_CONVERTING_ZONE);
		return 0;
	}
	return SXNET_add_id_INTEGER(psx, izone, user, userlen);
}

/* Add an id given the zone as an unsigned long */

int
SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, const char *user,
    int userlen)
{
	ASN1_INTEGER *izone = NULL;

	if (!(izone = ASN1_INTEGER_new()) ||
	    !ASN1_INTEGER_set(izone, lzone)) {
		X509V3error(ERR_R_MALLOC_FAILURE);
		ASN1_INTEGER_free(izone);
		return 0;
	}
	return SXNET_add_id_INTEGER(psx, izone, user, userlen);
}

/* Add an id given the zone as an ASN1_INTEGER.
 * Note this version uses the passed integer and doesn't make a copy so don't
 * free it up afterwards.
 */

int
SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, const char *user,
    int userlen)
{
	SXNET *sx = NULL;
	SXNETID *id = NULL;

	if (!psx || !zone || !user) {
		X509V3error(X509V3_R_INVALID_NULL_ARGUMENT);
		return 0;
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
	SXNETID_free(id);
	SXNET_free(sx);
	*psx = NULL;
	return 0;
}

ASN1_OCTET_STRING *
SXNET_get_id_asc(SXNET *sx, char *zone)
{
	ASN1_INTEGER *izone = NULL;
	ASN1_OCTET_STRING *oct;

	if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) {
		X509V3error(X509V3_R_ERROR_CONVERTING_ZONE);
		return NULL;







|







333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
	SXNETID_free(id);
	SXNET_free(sx);
	*psx = NULL;
	return 0;
}

ASN1_OCTET_STRING *
SXNET_get_id_asc(SXNET *sx, const char *zone)
{
	ASN1_INTEGER *izone = NULL;
	ASN1_OCTET_STRING *oct;

	if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) {
		X509V3error(X509V3_R_ERROR_CONVERTING_ZONE);
		return NULL;
Changes to jni/libressl/crypto/x509v3/v3_utl.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: v3_utl.c,v 1.27 2018/03/20 16:16:59 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project.
 */
/* ====================================================================
 * Copyright (c) 1999-2003 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2003 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
{
	if (asn1_bool)
		return X509V3_add_value(name, "TRUE", extlist);
	return X509V3_add_value(name, "FALSE", extlist);
}

int
X509V3_add_value_bool_nf(char *name, int asn1_bool,
    STACK_OF(CONF_VALUE) **extlist)
{
	if (asn1_bool)
		return X509V3_add_value(name, "TRUE", extlist);
	return 1;
}


char *
i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *a)
{
	BIGNUM *bntmp = NULL;
	char *strtmp = NULL;

	if (!a)
		return NULL;
	if (!(bntmp = ASN1_ENUMERATED_to_BN(a, NULL)) ||
	    !(strtmp = BN_bn2dec(bntmp)))
		X509V3error(ERR_R_MALLOC_FAILURE);
	BN_free(bntmp);
	return strtmp;
}

char *
i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, ASN1_INTEGER *a)
{
	BIGNUM *bntmp = NULL;
	char *strtmp = NULL;

	if (!a)
		return NULL;
	if (!(bntmp = ASN1_INTEGER_to_BN(a, NULL)) ||
	    !(strtmp = BN_bn2dec(bntmp)))
		X509V3error(ERR_R_MALLOC_FAILURE);
	BN_free(bntmp);
	return strtmp;
}

ASN1_INTEGER *
s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value)
{
	BIGNUM *bn = NULL;
	ASN1_INTEGER *aint;
	int isneg, ishex;
	int ret;

	if (!value) {







|









|














|














|







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
{
	if (asn1_bool)
		return X509V3_add_value(name, "TRUE", extlist);
	return X509V3_add_value(name, "FALSE", extlist);
}

int
X509V3_add_value_bool_nf(const char *name, int asn1_bool,
    STACK_OF(CONF_VALUE) **extlist)
{
	if (asn1_bool)
		return X509V3_add_value(name, "TRUE", extlist);
	return 1;
}


char *
i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *a)
{
	BIGNUM *bntmp = NULL;
	char *strtmp = NULL;

	if (!a)
		return NULL;
	if (!(bntmp = ASN1_ENUMERATED_to_BN(a, NULL)) ||
	    !(strtmp = BN_bn2dec(bntmp)))
		X509V3error(ERR_R_MALLOC_FAILURE);
	BN_free(bntmp);
	return strtmp;
}

char *
i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, const ASN1_INTEGER *a)
{
	BIGNUM *bntmp = NULL;
	char *strtmp = NULL;

	if (!a)
		return NULL;
	if (!(bntmp = ASN1_INTEGER_to_BN(a, NULL)) ||
	    !(strtmp = BN_bn2dec(bntmp)))
		X509V3error(ERR_R_MALLOC_FAILURE);
	BN_free(bntmp);
	return strtmp;
}

ASN1_INTEGER *
s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value)
{
	BIGNUM *bn = NULL;
	ASN1_INTEGER *aint;
	int isneg, ishex;
	int ret;

	if (!value) {
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
	}
	if (isneg)
		aint->type |= V_ASN1_NEG;
	return aint;
}

int
X509V3_add_value_int(const char *name, ASN1_INTEGER *aint,
    STACK_OF(CONF_VALUE) **extlist)
{
	char *strtmp;
	int ret;

	if (!aint)
		return 1;
	if (!(strtmp = i2s_ASN1_INTEGER(NULL, aint)))
		return 0;
	ret = X509V3_add_value(name, strtmp, extlist);
	free(strtmp);
	return ret;
}

int
X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool)
{
	char *btmp;

	if (!(btmp = value->value))
		goto err;
	if (!strcmp(btmp, "TRUE") || !strcmp(btmp, "true") ||
	    !strcmp(btmp, "Y") || !strcmp(btmp, "y") ||







|















|







226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
	}
	if (isneg)
		aint->type |= V_ASN1_NEG;
	return aint;
}

int
X509V3_add_value_int(const char *name, const ASN1_INTEGER *aint,
    STACK_OF(CONF_VALUE) **extlist)
{
	char *strtmp;
	int ret;

	if (!aint)
		return 1;
	if (!(strtmp = i2s_ASN1_INTEGER(NULL, aint)))
		return 0;
	ret = X509V3_add_value(name, strtmp, extlist);
	free(strtmp);
	return ret;
}

int
X509V3_get_value_bool(const CONF_VALUE *value, int *asn1_bool)
{
	char *btmp;

	if (!(btmp = value->value))
		goto err;
	if (!strcmp(btmp, "TRUE") || !strcmp(btmp, "true") ||
	    !strcmp(btmp, "Y") || !strcmp(btmp, "y") ||
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
err:
	X509V3error(X509V3_R_INVALID_BOOLEAN_STRING);
	X509V3_conf_err(value);
	return 0;
}

int
X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint)
{
	ASN1_INTEGER *itmp;

	if (!(itmp = s2i_ASN1_INTEGER(NULL, value->value))) {
		X509V3_conf_err(value);
		return 0;
	}







|







267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
err:
	X509V3error(X509V3_R_INVALID_BOOLEAN_STRING);
	X509V3_conf_err(value);
	return 0;
}

int
X509V3_get_value_int(const CONF_VALUE *value, ASN1_INTEGER **aint)
{
	ASN1_INTEGER *itmp;

	if (!(itmp = s2i_ASN1_INTEGER(NULL, value->value))) {
		X509V3_conf_err(value);
		return 0;
	}
Changes to jni/libressl/include/compat/sys/types.h.
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef __STRING
#define __STRING(x) #x
#endif

#if defined(__GNUC__)  && defined (HAS_GNU_WARNING_LONG)
#define __warn_references(sym,msg)          \
  __asm__(".section .gnu.warning." __STRING(sym)  \
         " ; .ascii \"" msg "\" ; .text");
#else
#define __warn_references(sym,msg)
#endif

#endif /* __warn_references */
#endif /* _WIN32 */








|







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef __STRING
#define __STRING(x) #x
#endif

#if defined(__GNUC__)  && defined (HAS_GNU_WARNING_LONG)
#define __warn_references(sym,msg)          \
  __asm__(".section .gnu.warning." __STRING(sym)  \
         "\n\t.ascii \"" msg "\"\n\t.text");
#else
#define __warn_references(sym,msg)
#endif

#endif /* __warn_references */
#endif /* _WIN32 */

Changes to jni/libressl/include/compat/unistd.h.
58
59
60
61
62
63
64

65
66
67
68
69
70
#endif

#ifndef HAVE_GETPAGESIZE
int getpagesize(void);
#endif

#define pledge(request, paths) 0


#ifndef HAVE_PIPE2
int pipe2(int fildes[2], int flags);
#endif

#endif







>






58
59
60
61
62
63
64
65
66
67
68
69
70
71
#endif

#ifndef HAVE_GETPAGESIZE
int getpagesize(void);
#endif

#define pledge(request, paths) 0
#define unveil(path, permissions) 0

#ifndef HAVE_PIPE2
int pipe2(int fildes[2], int flags);
#endif

#endif
Changes to jni/libressl/include/openssl/asn1.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: asn1.h,v 1.44 2018/02/14 16:46:04 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: asn1.h,v 1.49 2018/05/19 10:46:28 tb 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.
 *
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816

ASN1_TYPE *ASN1_TYPE_new(void);
void ASN1_TYPE_free(ASN1_TYPE *a);
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);
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);

ASN1_OBJECT *ASN1_OBJECT_new(void );
void ASN1_OBJECT_free(ASN1_OBJECT *a);
int i2d_ASN1_OBJECT(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,
    long length);

extern const ASN1_ITEM ASN1_OBJECT_it;

DECLARE_STACK_OF(ASN1_OBJECT)

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 );
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 * */
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);
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);
ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **in, long len);
int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **out);
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_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);

#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,
    BIT_STRING_BITNAME *tbl);

int i2d_ASN1_BOOLEAN(int a, unsigned char **pp);
int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length);

ASN1_INTEGER *ASN1_INTEGER_new(void);
void ASN1_INTEGER_free(ASN1_INTEGER *a);







|


|

|

|













|







|











|

|
|
|





|
|







750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816

ASN1_TYPE *ASN1_TYPE_new(void);
void ASN1_TYPE_free(ASN1_TYPE *a);
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(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(const ASN1_TYPE *a, const ASN1_TYPE *b);

ASN1_OBJECT *ASN1_OBJECT_new(void);
void ASN1_OBJECT_free(ASN1_OBJECT *a);
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,
    long length);

extern const ASN1_ITEM ASN1_OBJECT_it;

DECLARE_STACK_OF(ASN1_OBJECT)

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);
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 * */
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(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);
ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **in, long len);
int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **out);
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_bit(ASN1_BIT_STRING *a, int n, int value);
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(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);
int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length);

ASN1_INTEGER *ASN1_INTEGER_new(void);
void ASN1_INTEGER_free(ASN1_INTEGER *a);
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851

ASN1_ENUMERATED *ASN1_ENUMERATED_new(void);
void ASN1_ENUMERATED_free(ASN1_ENUMERATED *a);
ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char **in, long len);
int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out);
extern const ASN1_ITEM ASN1_ENUMERATED_it;

int ASN1_UTCTIME_check(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);
int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);

#ifndef LIBRESSL_INTERNAL
int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
#endif /* !LIBRESSL_INTERNAL */

int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a);
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
    time_t t);
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
    time_t t, int offset_day, long offset_sec);
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);

ASN1_OCTET_STRING *ASN1_OCTET_STRING_new(void);







|









|







827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851

ASN1_ENUMERATED *ASN1_ENUMERATED_new(void);
void ASN1_ENUMERATED_free(ASN1_ENUMERATED *a);
ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char **in, long len);
int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out);
extern const ASN1_ITEM ASN1_ENUMERATED_it;

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);
int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);

#ifndef LIBRESSL_INTERNAL
int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
#endif /* !LIBRESSL_INTERNAL */

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,
    time_t t, int offset_day, long offset_sec);
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);

ASN1_OCTET_STRING *ASN1_OCTET_STRING_new(void);
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987

extern const ASN1_ITEM ASN1_OCTET_STRING_NDEF_it;

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,
    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 a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size);
int i2a_ASN1_ENUMERATED(BIO *bp, 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 a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size);
int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type);
#endif
int i2t_ASN1_OBJECT(char *buf, int buf_len, 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,
    const char *sn, const char *ln);

int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
long ASN1_INTEGER_get(const ASN1_INTEGER *a);
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);

/* 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,







|
|










|

|

|

|

|











|
|
|







939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987

extern const ASN1_ITEM ASN1_OCTET_STRING_NDEF_it;

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(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, const ASN1_INTEGER *a);
int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size);
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, const ASN1_OBJECT *a);
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size);
int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type);
#endif
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,
    const char *sn, const char *ln);

int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
long ASN1_INTEGER_get(const ASN1_INTEGER *a);
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(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,
1048
1049
1050
1051
1052
1053
1054
1055

1056
1057
1058
1059
1060
1061
1062
1063
1064

#define ASN1_i2d_fp_of_const(type,i2d,out,x) \
    (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \
		 out, \
		 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_to_UTF8(unsigned char **out, ASN1_STRING *in);

#ifndef OPENSSL_NO_BIO
void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x);

#define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
    ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \
			  CHECKED_D2I_OF(type, d2i), \







|
>

|







1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065

#define ASN1_i2d_fp_of_const(type,i2d,out,x) \
    (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \
		 out, \
		 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, const ASN1_STRING *str,
    unsigned long flags);

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);

#define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
    ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \
			  CHECKED_D2I_OF(type, d2i), \
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105

1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
		  CHECKED_PTR_OF(const type, x)))

int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
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_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
const char *ASN1_tag2str(int tag);

/* Used to load and write netscape format cert */

NETSCAPE_X509 *NETSCAPE_X509_new(void);
void NETSCAPE_X509_free(NETSCAPE_X509 *a);
NETSCAPE_X509 *d2i_NETSCAPE_X509(NETSCAPE_X509 **a, const unsigned char **in, long len);
int i2d_NETSCAPE_X509(NETSCAPE_X509 *a, unsigned char **out);
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 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);

ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it,
    ASN1_OCTET_STRING **oct);

void ASN1_STRING_set_default_mask(unsigned long mask);







|


















|
>


|
|




|

|







1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
		  CHECKED_PTR_OF(const type, x)))

int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
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, 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
const char *ASN1_tag2str(int tag);

/* Used to load and write netscape format cert */

NETSCAPE_X509 *NETSCAPE_X509_new(void);
void NETSCAPE_X509_free(NETSCAPE_X509 *a);
NETSCAPE_X509 *d2i_NETSCAPE_X509(NETSCAPE_X509 **a, const unsigned char **in, long len);
int i2d_NETSCAPE_X509(NETSCAPE_X509 *a, unsigned char **out);
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(const 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(const ASN1_TYPE *a, long *num,
    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(const ASN1_STRING *oct, const ASN1_ITEM *it);
ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,
    ASN1_OCTET_STRING **oct);

ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it,
    ASN1_OCTET_STRING **oct);

void ASN1_STRING_set_default_mask(unsigned long mask);
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
void ASN1_STRING_TABLE_cleanup(void);

/* ASN1 template functions */

/* 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,
    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 Print flags */

/* Indicate missing OPTIONAL fields */
#define ASN1_PCTX_FLAGS_SHOW_ABSENT		0x001
/* Mark start and end of SEQUENCE */
#define ASN1_PCTX_FLAGS_SHOW_SEQUENCE		0x002







|






|
|







1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
void ASN1_STRING_TABLE_cleanup(void);

/* ASN1 template functions */

/* 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,
    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(const char *str, CONF *nconf);
ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf);

/* ASN1 Print flags */

/* Indicate missing OPTIONAL fields */
#define ASN1_PCTX_FLAGS_SHOW_ABSENT		0x001
/* Mark start and end of SEQUENCE */
#define ASN1_PCTX_FLAGS_SHOW_SEQUENCE		0x002
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
/* Don't show structure name even at top level */
#define ASN1_PCTX_FLAGS_NO_STRUCT_NAME		0x100

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);
void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags);
unsigned long ASN1_PCTX_get_nm_flags(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);
void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags);
unsigned long ASN1_PCTX_get_oid_flags(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);
void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags);

BIO_METHOD *BIO_f_asn1(void);

BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);

int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
    const ASN1_ITEM *it);
int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
    const char *hdr, const ASN1_ITEM *it);







|

|

|

|

|


|







1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
/* Don't show structure name even at top level */
#define ASN1_PCTX_FLAGS_NO_STRUCT_NAME		0x100

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(const ASN1_PCTX *p);
void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags);
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(const ASN1_PCTX *p);
void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags);
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(const ASN1_PCTX *p);
void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags);

const BIO_METHOD *BIO_f_asn1(void);

BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);

int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
    const ASN1_ITEM *it);
int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
    const char *hdr, const ASN1_ITEM *it);
1401
1402
1403
1404
1405
1406
1407

1408
1409
1410
1411
1412
1413
1414
#define ASN1_R_MIME_SIG_PARSE_ERROR			 208
#define ASN1_R_MISSING_EOC				 137
#define ASN1_R_MISSING_SECOND_NUMBER			 138
#define ASN1_R_MISSING_VALUE				 189
#define ASN1_R_MSTRING_NOT_UNIVERSAL			 139
#define ASN1_R_MSTRING_WRONG_TAG			 140
#define ASN1_R_NESTED_ASN1_STRING			 197

#define ASN1_R_NON_HEX_CHARACTERS			 141
#define ASN1_R_NOT_ASCII_FORMAT				 190
#define ASN1_R_NOT_ENOUGH_DATA				 142
#define ASN1_R_NO_CONTENT_TYPE				 209
#define ASN1_R_NO_DEFAULT_DIGEST			 201
#define ASN1_R_NO_MATCHING_CHOICE_TYPE			 143
#define ASN1_R_NO_MULTIPART_BODY_FAILURE		 210







>







1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
#define ASN1_R_MIME_SIG_PARSE_ERROR			 208
#define ASN1_R_MISSING_EOC				 137
#define ASN1_R_MISSING_SECOND_NUMBER			 138
#define ASN1_R_MISSING_VALUE				 189
#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
#define ASN1_R_NO_CONTENT_TYPE				 209
#define ASN1_R_NO_DEFAULT_DIGEST			 201
#define ASN1_R_NO_MATCHING_CHOICE_TYPE			 143
#define ASN1_R_NO_MULTIPART_BODY_FAILURE		 210
Changes to jni/libressl/include/openssl/bio.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: bio.h,v 1.40 2018/03/17 15:05:55 tb 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
	long (*ctrl)(BIO *, int, long, void *);
	int (*create)(BIO *);
	int (*destroy)(BIO *);
	long (*callback_ctrl)(BIO *, int, bio_info_cb *);
} BIO_METHOD;

struct bio_st {
	BIO_METHOD *method;
	/* bio, mode, argp, argi, argl, ret */
	long (*callback)(struct bio_st *, int, const char *, int, long, long);
	char *cb_arg; /* first argument for the callback */

	int init;
	int shutdown;
	int flags;	/* extra storage */







|







282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
	long (*ctrl)(BIO *, int, long, void *);
	int (*create)(BIO *);
	int (*destroy)(BIO *);
	long (*callback_ctrl)(BIO *, int, bio_info_cb *);
} BIO_METHOD;

struct bio_st {
	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 */

	int init;
	int shutdown;
	int flags;	/* extra storage */
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362

/* 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(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(BIO_METHOD *biom))(BIO *, char *, int);
int BIO_meth_set_read(BIO_METHOD *biom, int (*read)(BIO *, char *, int));
int (*BIO_meth_get_puts(BIO_METHOD *biom))(BIO *, const char *);
int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts)(BIO *, const char *));
int (*BIO_meth_get_gets(BIO_METHOD *biom))(BIO *, char *, int);
int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets)(BIO *, char *, int));
long (*BIO_meth_get_ctrl(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(BIO_METHOD *biom))(BIO *);
int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *));
int (*BIO_meth_get_destroy(BIO_METHOD *biom))(BIO *);
int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *));
long (*BIO_meth_get_callback_ctrl(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
#define BIO_CONN_S_GET_IP		2
#define BIO_CONN_S_GET_PORT		3







|


|

|

|

|

|

|

|







333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362

/* 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
#define BIO_CONN_S_GET_IP		2
#define BIO_CONN_S_GET_PORT		3
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
asn1_ps_func *suffix_free);
int
BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
asn1_ps_func **psuffix_free);

int BIO_get_new_index(void);
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);
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);







|



|
|







593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
asn1_ps_func *suffix_free);
int
BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
asn1_ps_func **psuffix_free);

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(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);
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
int BIO_nread(BIO *bio, char **buf, int num);
int BIO_nwrite0(BIO *bio, char **buf);
int BIO_nwrite(BIO *bio, char **buf, int num);

long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,
    long argl, long ret);

BIO_METHOD *BIO_s_mem(void);
BIO *BIO_new_mem_buf(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);
#ifndef OPENSSL_NO_DGRAM
BIO_METHOD *BIO_s_datagram(void);
#endif

/* BIO_METHOD *BIO_f_ber(void); */

int BIO_sock_should_retry(int i);
int BIO_sock_non_fatal_error(int _error);
int BIO_dgram_non_fatal_error(int _error);







|
|
|
|
|
|
|
|
|
|
|
|

|







637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
int BIO_nread(BIO *bio, char **buf, int num);
int BIO_nwrite0(BIO *bio, char **buf);
int BIO_nwrite(BIO *bio, char **buf, int num);

long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,
    long argl, long ret);

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
const BIO_METHOD *BIO_s_datagram(void);
#endif

/* BIO_METHOD *BIO_f_ber(void); */

int BIO_sock_should_retry(int i);
int BIO_sock_non_fatal_error(int _error);
int BIO_dgram_non_fatal_error(int _error);
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
int BIO_sock_init(void );
void BIO_sock_cleanup(void);
int BIO_set_tcp_ndelay(int sock, int turn_on);

BIO *BIO_new_socket(int sock, int close_flag);
BIO *BIO_new_dgram(int fd, int close_flag);
BIO *BIO_new_fd(int fd, int close_flag);
BIO *BIO_new_connect(char *host_port);
BIO *BIO_new_accept(char *host_port);

int
BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
BIO **bio2, size_t writebuf2);
/* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.
 * Otherwise returns 0 and sets *bio1 and *bio2 to NULL.
 * Size 0 uses default value.







|
|







694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
int BIO_sock_init(void );
void BIO_sock_cleanup(void);
int BIO_set_tcp_ndelay(int sock, int turn_on);

BIO *BIO_new_socket(int sock, int close_flag);
BIO *BIO_new_dgram(int fd, int close_flag);
BIO *BIO_new_fd(int fd, int close_flag);
BIO *BIO_new_connect(const char *host_port);
BIO *BIO_new_accept(const char *host_port);

int
BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
BIO **bio2, size_t writebuf2);
/* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.
 * Otherwise returns 0 and sets *bio1 and *bio2 to NULL.
 * Size 0 uses default value.
Changes to jni/libressl/include/openssl/crypto.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: crypto.h,v 1.45 2018/03/19 03:35:38 beck Exp $ */
/* ====================================================================
 * Copyright (c) 1998-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
2
3
4
5
6
7
8
/* $OpenBSD: crypto.h,v 1.47 2018/08/24 19:16:03 tb Exp $ */
/* ====================================================================
 * Copyright (c) 1998-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:
 *
295
296
297
298
299
300
301

302
303
304
305
306
307
308
#define CRYPTO_EX_INDEX_COMP		14
#define CRYPTO_EX_INDEX_STORE		15

/* Dynamically assigned indexes start from this value (don't use directly, use
 * via CRYPTO_ex_data_new_class). */
#define CRYPTO_EX_INDEX_USER		100


#define CRYPTO_malloc_init()		(0)
#define CRYPTO_malloc_debug_init()	(0)

#if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD
# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */
#  define CRYPTO_MDEBUG
# endif







>







295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#define CRYPTO_EX_INDEX_COMP		14
#define CRYPTO_EX_INDEX_STORE		15

/* 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)

#if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD
# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */
#  define CRYPTO_MDEBUG
# endif
325
326
327
328
329
330
331

332
333
334
335
336
337
338
	CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
#define OPENSSL_freeFunc	CRYPTO_free
#define OPENSSL_free(addr)	CRYPTO_free(addr)

#define OPENSSL_malloc_locked(num) \
	CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)
#define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr)


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







>







326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
	CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
#define OPENSSL_freeFunc	CRYPTO_free
#define OPENSSL_free(addr)	CRYPTO_free(addr)

#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
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
 */
void CRYPTO_dbg_set_options(long bits)
	__attribute__ ((deprecated));
long CRYPTO_dbg_get_options(void)
	__attribute__ ((deprecated));


void CRYPTO_mem_leaks_fp(FILE *);
void 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);

/* die if we have to */
void OpenSSLDie(const char *file, int line, const char *assertion);
#define OPENSSL_assert(e)       (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))

uint64_t OPENSSL_cpu_caps(void);








|
|

|
|







491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
 */
void CRYPTO_dbg_set_options(long bits)
	__attribute__ ((deprecated));
long CRYPTO_dbg_get_options(void)
	__attribute__ ((deprecated));


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 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);
#define OPENSSL_assert(e)       (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))

uint64_t OPENSSL_cpu_caps(void);

Changes to jni/libressl/include/openssl/dtls1.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: dtls1.h,v 1.21 2017/01/22 07:16:39 beck Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 *
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#define DTLS1_HM_HEADER_LENGTH                  12

#define DTLS1_HM_BAD_FRAGMENT                   -2
#define DTLS1_HM_FRAGMENT_RETRY                 -3

#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


typedef struct dtls1_bitmap_st {
	unsigned long map;		/* track 32 packets on 32-bit systems
					   and 64 - on 64-bit systems */







<
<
<

<







87
88
89
90
91
92
93



94

95
96
97
98
99
100
101
#define DTLS1_HM_HEADER_LENGTH                  12

#define DTLS1_HM_BAD_FRAGMENT                   -2
#define DTLS1_HM_FRAGMENT_RETRY                 -3

#define DTLS1_CCS_HEADER_LENGTH                  1




#define DTLS1_AL_HEADER_LENGTH                   2


#ifndef OPENSSL_NO_SSL_INTERN


typedef struct dtls1_bitmap_st {
	unsigned long map;		/* track 32 packets on 32-bit systems
					   and 64 - on 64-bit systems */
Changes to jni/libressl/include/openssl/ec.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: ec.h,v 1.12 2016/11/04 17:33:19 miod Exp $ */
/*
 * Originally written by Bodo Moeller for the OpenSSL project.
 */
/**
 * \file crypto/ec/ec.h Include file for the OpenSSL EC functions
 * \author Originally written by Bodo Moeller for the OpenSSL project
 */
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ec.h,v 1.13 2018/05/19 10:37:02 tb Exp $ */
/*
 * Originally written by Bodo Moeller for the OpenSSL project.
 */
/**
 * \file crypto/ec/ec.h Include file for the OpenSSL EC functions
 * \author Originally written by Bodo Moeller for the OpenSSL project
 */
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921

/** Encodes a ec public key in an octet string.
 *  \param  key  the EC_KEY object with the public key
 *  \param  out  the buffer for the result (if NULL the function returns number
 *               of bytes needed).
 *  \return 1 on success and 0 if an error occurred
 */
int i2o_ECPublicKey(EC_KEY *key, unsigned char **out);

#ifndef OPENSSL_NO_BIO
/** Prints out the ec parameters on human readable form.
 *  \param  bp   BIO object to which the information is printed
 *  \param  key  EC_KEY object
 *  \return 1 on success and 0 if an error occurred
 */







|







907
908
909
910
911
912
913
914
915
916
917
918
919
920
921

/** Encodes a ec public key in an octet string.
 *  \param  key  the EC_KEY object with the public key
 *  \param  out  the buffer for the result (if NULL the function returns number
 *               of bytes needed).
 *  \return 1 on success and 0 if an error occurred
 */
int i2o_ECPublicKey(const EC_KEY *key, unsigned char **out);

#ifndef OPENSSL_NO_BIO
/** Prints out the ec parameters on human readable form.
 *  \param  bp   BIO object to which the information is printed
 *  \param  key  EC_KEY object
 *  \return 1 on success and 0 if an error occurred
 */
Changes to jni/libressl/include/openssl/evp.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: evp.h,v 1.58 2018/02/20 18:05:28 tb 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: evp.h,v 1.69 2018/09/12 06:35:38 djm 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.
 *
487
488
489
490
491
492
493

494
495
496
497




498
499
500
501
502
503
504
int EVP_CIPHER_block_size(const EVP_CIPHER *cipher);
int EVP_CIPHER_key_length(const EVP_CIPHER *cipher);
int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher);
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_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_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);
#define EVP_CIPHER_CTX_type(c)         EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx);
#define EVP_CIPHER_CTX_mode(e)		(EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE)








>




>
>
>
>







487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
int EVP_CIPHER_block_size(const EVP_CIPHER *cipher);
int EVP_CIPHER_key_length(const EVP_CIPHER *cipher);
int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher);
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);
#define EVP_CIPHER_CTX_type(c)         EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx);
#define EVP_CIPHER_CTX_mode(e)		(EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE)

613
614
615
616
617
618
619
620

621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639

int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
    const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
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_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
    const unsigned char *ek, int ekl, const unsigned char *iv, EVP_PKEY *priv);
int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);

int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
    unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk,
    int npubk);
int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);

void EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
void 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);

void EVP_DecodeInit(EVP_ENCODE_CTX *ctx);
int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
    const unsigned char *in, int inl);







|
>











|







618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645

int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
    const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
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, 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);
int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);

int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
    unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk,
    int npubk);
int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);

void EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
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);

void EVP_DecodeInit(EVP_ENCODE_CTX *ctx);
int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
    const unsigned char *in, int inl);
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
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 unsigned char *i, int enc);
#endif

const EVP_MD *EVP_md_null(void);
#ifndef OPENSSL_NO_MD4
const EVP_MD *EVP_md4(void);
#endif







|
|
|
|







653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
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
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

const EVP_MD *EVP_md_null(void);
#ifndef OPENSSL_NO_MD4
const EVP_MD *EVP_md4(void);
#endif
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
int EVP_PKEY_decrypt_old(unsigned char *dec_key, const unsigned char *enc_key,
    int enc_key_len, EVP_PKEY *private_key);
int EVP_PKEY_encrypt_old(unsigned char *enc_key, const unsigned char *key,
    int key_len, EVP_PKEY *pub_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_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);

#ifndef OPENSSL_NO_RSA
struct rsa_st;
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







|
|



|







868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
int EVP_PKEY_decrypt_old(unsigned char *dec_key, const unsigned char *enc_key,
    int enc_key_len, EVP_PKEY *private_key);
int EVP_PKEY_encrypt_old(unsigned char *enc_key, const unsigned char *key,
    int key_len, EVP_PKEY *pub_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(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(const EVP_PKEY *pkey);

#ifndef OPENSSL_NO_RSA
struct rsa_st;
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
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
    const char *str, int len);
int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth);
int EVP_PKEY_asn1_add_alias(int to, int from);
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);
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,
    const EVP_PKEY_ASN1_METHOD *src);
void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);
void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
    int (*pub_decode)(EVP_PKEY *pk, X509_PUBKEY *pub),
    int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk),
    int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b),
    int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent,
    ASN1_PCTX *pctx),
    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_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk),
    int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent,
    ASN1_PCTX *pctx));
void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
    int (*param_decode)(EVP_PKEY *pkey, const unsigned char **pder, int derlen),
    int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder),
    int (*param_missing)(const EVP_PKEY *pk),







|














|







997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
    const char *str, int len);
int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth);
int EVP_PKEY_asn1_add_alias(int to, int from);
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(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,
    const EVP_PKEY_ASN1_METHOD *src);
void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);
void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
    int (*pub_decode)(EVP_PKEY *pk, X509_PUBKEY *pub),
    int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk),
    int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b),
    int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent,
    ASN1_PCTX *pctx),
    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, 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));
void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
    int (*param_decode)(EVP_PKEY *pkey, const unsigned char **pder, int derlen),
    int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder),
    int (*param_missing)(const EVP_PKEY *pk),
Changes to jni/libressl/include/openssl/hkdf.h.

1
2
3
4
5
6
7

/* Copyright (c) 2014, Google 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
>







1
2
3
4
5
6
7
8
/* $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
 * 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
Changes to jni/libressl/include/openssl/modes.h.
1
2
3
4
5
6
7
8
9




10
11
12
13
14
15
16
/* $OpenBSD: modes.h,v 1.2 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
 *
 * Rights for redistribution and usage in source and binary
 * forms are granted according to the OpenSSL license.
 */

#include <stddef.h>





typedef void (*block128_f)(const unsigned char in[16],
			unsigned char out[16],
			const void *key);

typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out,
			size_t len, const void *key,
|








>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* $OpenBSD: modes.h,v 1.3 2018/07/24 10:47:19 bcook Exp $ */
/* ====================================================================
 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
 *
 * Rights for redistribution and usage in source and binary
 * forms are granted according to the OpenSSL license.
 */

#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef void (*block128_f)(const unsigned char in[16],
			unsigned char out[16],
			const void *key);

typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out,
			size_t len, const void *key,
130
131
132
133
134
135
136




	ccm128_f stream);
size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);

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);











>
>
>
>
134
135
136
137
138
139
140
141
142
143
144
	ccm128_f stream);
size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);

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
Changes to jni/libressl/include/openssl/ocsp.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: ocsp.h,v 1.12 2018/03/17 14:44:34 jsing Exp $ */
/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
 * project. */

/* History:
   This file was transfered to Richard Levitte from CertCo by Kathy
   Weinhold in mid-spring 2000 to be included in OpenSSL or released
   as a patch kit. */
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ocsp.h,v 1.16 2018/08/24 20:03:21 tb Exp $ */
/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
 * project. */

/* History:
   This file was transfered to Richard Levitte from CertCo by Kathy
   Weinhold in mid-spring 2000 to be included in OpenSSL or released
   as a patch kit. */
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395

396
397
398
399
400
401
402
403
404
405
    ASN1_item_digest(&ASN1_BIT_STRING_it,type,data,md,len)

#define OCSP_CERTSTATUS_dup(cs) \
	ASN1_item_dup(&OCSP_CERTSTATUS_it, cs)

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,
	    int maxline);
int	OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);
void	OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
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_id_new(const EVP_MD *dgst, X509_NAME *issuerName,
	    ASN1_BIT_STRING* issuerKey, ASN1_INTEGER *serialNumber);

OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);

int	OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
int	OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
int	OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
int	OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);







|
|







|
>

|
|







379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
    ASN1_item_digest(&ASN1_BIT_STRING_it,type,data,md,len)

#define OCSP_CERTSTATUS_dup(cs) \
	ASN1_item_dup(&OCSP_CERTSTATUS_it, cs)

OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);

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);
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, const X509 *subject,
	    const X509 *issuer);

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);

int	OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
int	OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
int	OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
int	OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
	    ASN1_GENERALIZEDTIME **thisupd, ASN1_GENERALIZEDTIME **nextupd);
int	OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
	    ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);

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_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
int	OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);

int	OCSP_request_onereq_count(OCSP_REQUEST *req);
OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
int	OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
	    ASN1_OCTET_STRING **pikeyHash, ASN1_INTEGER **pserial,
	    OCSP_CERTID *cid);
int	OCSP_request_is_signed(OCSP_REQUEST *req);
OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp, OCSP_CERTID *cid,
	    int status, int reason, ASN1_TIME *revtime, ASN1_TIME *thisupd,
	    ASN1_TIME *nextupd);
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_accept_responses_new(char **oids);

X509_EXTENSION *OCSP_archive_cutoff_new(char* tim);

X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, 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 lastpos);
int	OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit,
	    int lastpos);
X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx);
int	OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value,
	    int crit, unsigned long flags);
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 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);
X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
int	OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
	    unsigned long flags);
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 lastpos);
int	OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
	    int lastpos);
X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
	    int *idx);
int	OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
	    int crit, unsigned long flags);
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_critical(OCSP_SINGLERESP *x, int crit,
	    int lastpos);
X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
	    int *idx);
int	OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,







|
|



















|





|



|












|











|














|
|







425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
	    ASN1_GENERALIZEDTIME **thisupd, ASN1_GENERALIZEDTIME **nextupd);
int	OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
	    ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);

int	OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
	    X509_STORE *store, unsigned long flags);

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);

int	OCSP_request_onereq_count(OCSP_REQUEST *req);
OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
int	OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
	    ASN1_OCTET_STRING **pikeyHash, ASN1_INTEGER **pserial,
	    OCSP_CERTID *cid);
int	OCSP_request_is_signed(OCSP_REQUEST *req);
OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp, OCSP_CERTID *cid,
	    int status, int reason, ASN1_TIME *revtime, ASN1_TIME *thisupd,
	    ASN1_TIME *nextupd);
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(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, 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, const ASN1_OBJECT *obj,
	    int lastpos);
int	OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit,
	    int lastpos);
X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx);
int	OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value,
	    int crit, unsigned long flags);
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, 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);
X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
int	OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
	    unsigned long flags);
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, const ASN1_OBJECT *obj,
	    int lastpos);
int	OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
	    int lastpos);
X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
	    int *idx);
int	OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
	    int crit, unsigned long flags);
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,
	    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);
X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
	    int *idx);
int	OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
Changes to jni/libressl/include/openssl/opensslv.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* $OpenBSD: opensslv.h,v 1.46.2.2 2018/06/13 14:54:17 bcook Exp $ */
#ifndef HEADER_OPENSSLV_H
#define HEADER_OPENSSLV_H

/* These will change with each release of LibreSSL-portable */
#define LIBRESSL_VERSION_NUMBER 0x2070400fL
/*                                    ^ Patch starts here   */
#define LIBRESSL_VERSION_TEXT   "LibreSSL 2.7.4"

/* These will never change */
#define OPENSSL_VERSION_NUMBER	0x20000000L
#define OPENSSL_VERSION_TEXT	LIBRESSL_VERSION_TEXT
#define OPENSSL_VERSION_PTEXT	" part of " OPENSSL_VERSION_TEXT

#define SHLIB_VERSION_HISTORY ""
|




|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* $OpenBSD: opensslv.h,v 1.49 2018/09/30 02:35:23 bcook Exp $ */
#ifndef HEADER_OPENSSLV_H
#define HEADER_OPENSSLV_H

/* These will change with each release of LibreSSL-portable */
#define LIBRESSL_VERSION_NUMBER 0x2080200fL
/*                                    ^ Patch starts here   */
#define LIBRESSL_VERSION_TEXT   "LibreSSL 2.8.2"

/* These will never change */
#define OPENSSL_VERSION_NUMBER	0x20000000L
#define OPENSSL_VERSION_TEXT	LIBRESSL_VERSION_TEXT
#define OPENSSL_VERSION_PTEXT	" part of " OPENSSL_VERSION_TEXT

#define SHLIB_VERSION_HISTORY ""
Changes to jni/libressl/include/openssl/pem.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: pem.h,v 1.17 2016/09/04 16:22:54 jsing Exp $ */
/* Copyright (C) 1995-1997 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
int	PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
int	PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
	    pem_password_cb *callback, void *u);

#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_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,
	    void **x, pem_password_cb *cb, void *u);
int	PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,
	    const EVP_CIPHER *enc, unsigned char *kstr, int klen,
	    pem_password_cb *cb, void *u);

STACK_OF(X509_INFO) *	PEM_X509_INFO_read_bio(BIO *bp,
	    STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u);
int	PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
	    unsigned char *kstr, int klen, pem_password_cb *cd, void *u);
#endif

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);
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,
	    void *x, const EVP_CIPHER *enc, unsigned char *kstr,
	    int klen, pem_password_cb *callback, void *u);
STACK_OF(X509_INFO) *	PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
	    pem_password_cb *cb, void *u);

int	PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type,
	    EVP_MD *md_type, unsigned char **ek, int *ekl,
	    unsigned char *iv, EVP_PKEY **pubk, int npubk);
void	PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl,
	    unsigned char *in, int inl);
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_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
	    unsigned int *siglen, EVP_PKEY *pkey);

int	PEM_def_callback(char *buf, int num, int w, void *key);
void	PEM_proc_type(char *buf, int type);
void	PEM_dek_info(char *buf, const char *type, int len, char *str);








|
|
















|
|
















|
|







381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
int	PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
int	PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
	    pem_password_cb *callback, void *u);

#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, 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,
	    void **x, pem_password_cb *cb, void *u);
int	PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,
	    const EVP_CIPHER *enc, unsigned char *kstr, int klen,
	    pem_password_cb *cb, void *u);

STACK_OF(X509_INFO) *	PEM_X509_INFO_read_bio(BIO *bp,
	    STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u);
int	PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
	    unsigned char *kstr, int klen, pem_password_cb *cd, void *u);
#endif

int	PEM_read(FILE *fp, char **name, char **header,
	    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,
	    void *x, const EVP_CIPHER *enc, unsigned char *kstr,
	    int klen, pem_password_cb *callback, void *u);
STACK_OF(X509_INFO) *	PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
	    pem_password_cb *cb, void *u);

int	PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type,
	    EVP_MD *md_type, unsigned char **ek, int *ekl,
	    unsigned char *iv, EVP_PKEY **pubk, int npubk);
void	PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl,
	    unsigned char *in, int inl);
int	PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl,
	    unsigned char *out, int *outl, EVP_PKEY *priv);

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);

int	PEM_def_callback(char *buf, int num, int w, void *key);
void	PEM_proc_type(char *buf, int type);
void	PEM_dek_info(char *buf, const char *type, int len, char *str);

Changes to jni/libressl/include/openssl/pkcs12.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: pkcs12.h,v 1.17 2016/12/30 15:08:58 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
174
175
176
177
178
179
180
181

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209

210
211
212
213
214
215
216
217
218
219
220
221
222
PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl);
X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag);
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,
    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);
PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass,
    int passlen, unsigned char *salt, int saltlen, int iter,
    PKCS8_PRIV_KEY_INFO *p8);
PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
    unsigned char *salt, int saltlen, int iter, STACK_OF(PKCS12_SAFEBAG) *bags);
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);

int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
    int namelen);
int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
    int namelen);
int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
    int namelen);
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);

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,
    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);
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);
int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
    int saltlen, int id, int iter, int n, unsigned char *out,
    const EVP_MD *md_type);
int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,







|
>
|
|














|










|
>

|
|

|
|







174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl);
X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag);
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(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);
PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass,
    int passlen, unsigned char *salt, int saltlen, int iter,
    PKCS8_PRIV_KEY_INFO *p8);
PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
    unsigned char *salt, int saltlen, int iter, STACK_OF(PKCS12_SAFEBAG) *bags);
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(const PKCS12 *p12);

int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
    int namelen);
int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
    int namelen);
int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
    int namelen);
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(const STACK_OF(X509_ATTRIBUTE) *attrs,
    int attr_nid);
char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
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(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);
int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
    int saltlen, int id, int iter, int n, unsigned char *out,
    const EVP_MD *md_type);
int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
    unsigned char *salt, int saltlen, int iter,
    const EVP_MD *md_type);
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);

PKCS12 *PKCS12_new(void);
void PKCS12_free(PKCS12 *a);
PKCS12 *d2i_PKCS12(PKCS12 **a, const unsigned char **in, long len);
int i2d_PKCS12(PKCS12 *a, unsigned char **out);
extern const ASN1_ITEM PKCS12_it;
PKCS12_MAC_DATA *PKCS12_MAC_DATA_new(void);







|







233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
    unsigned char *salt, int saltlen, int iter,
    const EVP_MD *md_type);
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(const unsigned char *uni, int unilen);

PKCS12 *PKCS12_new(void);
void PKCS12_free(PKCS12 *a);
PKCS12 *d2i_PKCS12(PKCS12 **a, const unsigned char **in, long len);
int i2d_PKCS12(PKCS12 *a, unsigned char **out);
extern const ASN1_ITEM PKCS12_it;
PKCS12_MAC_DATA *PKCS12_MAC_DATA_new(void);
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289

extern const ASN1_ITEM PKCS12_SAFEBAGS_it;
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,
    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 PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
    int safe_nid, int iter, 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);

/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_PKCS12_strings(void);








|
|




|

|






|







262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291

extern const ASN1_ITEM PKCS12_SAFEBAGS_it;
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(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, const char *pass);
int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
    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, const char *oldpass, const char *newpass);

/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_PKCS12_strings(void);

Changes to jni/libressl/include/openssl/rsa.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: rsa.h,v 1.38 2018/03/17 15:12:56 tb 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
429
430
431
432
433
434
435

436
437
438
439

440
441
442
443
444
445
446
 * check.
 */
#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_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_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.
 */
void ERR_load_RSA_strings(void);







>




>







429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
 * check.
 */
#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.
 */
void ERR_load_RSA_strings(void);
Changes to jni/libressl/include/openssl/ssl.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl.h,v 1.154 2018/03/20 15:28:12 tb 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl.h,v 1.159 2018/08/24 20:30:21 tb 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.
 *
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
/* Disallow client initiated renegotiation. */
#define SSL_OP_NO_CLIENT_RENEGOTIATION			0x00020000L
/* If set, always create a new key when using tmp_dh parameters */
#define SSL_OP_SINGLE_DH_USE				0x00100000L
/* 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

/* SSL_OP_ALL: various bug workarounds that should be rather harmless. */
#define SSL_OP_ALL \







<
<
<
<
<







503
504
505
506
507
508
509





510
511
512
513
514
515
516
/* Disallow client initiated renegotiation. */
#define SSL_OP_NO_CLIENT_RENEGOTIATION			0x00020000L
/* If set, always create a new key when using tmp_dh parameters */
#define SSL_OP_SINGLE_DH_USE				0x00100000L
/* Set on servers to choose the cipher according to the server's
 * preferences */
#define SSL_OP_CIPHER_SERVER_PREFERENCE			0x00400000L






#define SSL_OP_NO_TLSv1					0x04000000L
#define SSL_OP_NO_TLSv1_2				0x08000000L
#define SSL_OP_NO_TLSv1_1				0x10000000L

/* SSL_OP_ALL: various bug workarounds that should be rather harmless. */
#define SSL_OP_ALL \
541
542
543
544
545
546
547

548
549
550
551
552
553
554
#define SSL_OP_SAFARI_ECDHE_ECDSA_BUG			0x0
#define SSL_OP_SINGLE_ECDH_USE				0x0
#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG			0x0
#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG		0x0
#define SSL_OP_TLSEXT_PADDING				0x0
#define SSL_OP_TLS_BLOCK_PADDING_BUG			0x0
#define SSL_OP_TLS_D5_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): */
#define SSL_MODE_ENABLE_PARTIAL_WRITE       0x00000001L
/* Make it possible to retry SSL_write() with changed buffer location
 * (buffer contents must stay the same!); this is not the default to avoid
 * the misconception that non-blocking SSL_write() behaves like







>







536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
#define SSL_OP_SAFARI_ECDHE_ECDSA_BUG			0x0
#define SSL_OP_SINGLE_ECDH_USE				0x0
#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG			0x0
#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG		0x0
#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): */
#define SSL_MODE_ENABLE_PARTIAL_WRITE       0x00000001L
/* Make it possible to retry SSL_write() with changed buffer location
 * (buffer contents must stay the same!); this is not the default to avoid
 * the misconception that non-blocking SSL_write() behaves like
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(struct ssl_st *ssl,
    SSL_SESSION *sess);
void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx,
    void (*remove_session_cb)(struct ssl_ctx_st *ctx, SSL_SESSION *sess));
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 *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(struct ssl_st *ssl,
    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,
    int val);
void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx,
    int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey));
int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509,
    EVP_PKEY **pkey);
#ifndef OPENSSL_NO_ENGINE
int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e);
#endif
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,
    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);
void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s, int (*cb)(SSL *ssl,
    unsigned char **out, unsigned char *outlen, const unsigned char *in,
    unsigned int inlen, void *arg), void *arg);








|
|

|















|







723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(struct ssl_st *ssl,
    SSL_SESSION *sess);
void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx,
    void (*remove_session_cb)(struct ssl_ctx_st *ctx, SSL_SESSION *sess));
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,
    const unsigned char *data, int len, int *copy));
SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(struct ssl_st *ssl,
    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,
    int val);
void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx,
    int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey));
int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509,
    EVP_PKEY **pkey);
#ifndef OPENSSL_NO_ENGINE
int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e);
#endif
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, 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);
void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s, int (*cb)(SSL *ssl,
    unsigned char **out, unsigned char *outlen, const unsigned char *in,
    unsigned int inlen, void *arg), void *arg);

1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
#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

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);







|







1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
#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);
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261

void	SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm);

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_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);







|







1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257

void	SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm);

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);
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);
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
int	SSL_get_verify_mode(const SSL *s);
int	SSL_get_verify_depth(const SSL *s);
int	(*SSL_get_verify_callback(const SSL *s))(int, X509_STORE_CTX *);
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_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);
int	SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len);

int	SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
int	SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);







|







1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
int	SSL_get_verify_mode(const SSL *s);
int	SSL_get_verify_depth(const SSL *s);
int	(*SSL_get_verify_callback(const SSL *s))(int, X509_STORE_CTX *);
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, 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);
int	SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len);

int	SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
int	SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
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);
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);







|







1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
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);
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);
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
void SSL_set_accept_state(SSL *s);

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);

SSL *SSL_dup(SSL *ssl);

X509 *SSL_get_certificate(const SSL *ssl);
/* EVP_PKEY */ struct evp_pkey_st *SSL_get_privatekey(SSL *ssl);

void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx,int mode);
int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx);
void SSL_set_quiet_shutdown(SSL *ssl,int mode);
int SSL_get_quiet_shutdown(const SSL *ssl);
void SSL_set_shutdown(SSL *ssl,int mode);
int SSL_get_shutdown(const SSL *ssl);







|




|







1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
void SSL_set_accept_state(SSL *s);

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(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(const SSL *ssl);

void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx,int mode);
int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx);
void SSL_set_quiet_shutdown(SSL *ssl,int mode);
int SSL_get_quiet_shutdown(const SSL *ssl);
void SSL_set_shutdown(SSL *ssl,int mode);
int SSL_get_shutdown(const SSL *ssl);
Changes to jni/libressl/include/openssl/ssl3.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl3.h,v 1.46 2017/08/28 17:36:58 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl3.h,v 1.47 2018/04/07 16:55:13 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.
 *
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
#define SSL3_CT_FORTEZZA_DMS			20
/* SSL3_CT_NUMBER is used to size arrays and it must be large
 * enough to contain all of the cert types defined either for
 * SSLv3 and TLSv1.
 */
#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 SSL3_FLAGS_CCS_OK			0x0080

#ifndef OPENSSL_NO_SSL_INTERN

struct ssl3_state_internal_st;







<

<
<
<







344
345
346
347
348
349
350

351



352
353
354
355
356
357
358
#define SSL3_CT_FORTEZZA_DMS			20
/* SSL3_CT_NUMBER is used to size arrays and it must be large
 * enough to contain all of the cert types defined either for
 * SSLv3 and TLSv1.
 */
#define SSL3_CT_NUMBER			11


#define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS	0x0001



#define TLS1_FLAGS_SKIP_CERT_VERIFY		0x0010
#define TLS1_FLAGS_KEEP_HANDSHAKE		0x0020
#define SSL3_FLAGS_CCS_OK			0x0080

#ifndef OPENSSL_NO_SSL_INTERN

struct ssl3_state_internal_st;
Changes to jni/libressl/include/openssl/ts.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: ts.h,v 1.8 2016/12/27 16:05:57 jsing Exp $ */
/* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL
 * project 2002, 2003, 2004.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388

int TS_MSG_IMPRINT_set_algo(TS_MSG_IMPRINT *a, X509_ALGOR *alg);
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);
ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a);

int TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce);
const ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a);

int TS_REQ_set_cert_req(TS_REQ *a, int cert_req);
int TS_REQ_get_cert_req(const TS_REQ *a);

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_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);
int TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc);
void *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx);

/* Function declarations for TS_REQ defined in ts/ts_req_print.c */







|












|







361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388

int TS_MSG_IMPRINT_set_algo(TS_MSG_IMPRINT *a, X509_ALGOR *alg);
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, 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);
const ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a);

int TS_REQ_set_cert_req(TS_REQ *a, int cert_req);
int TS_REQ_get_cert_req(const TS_REQ *a);

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, 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);
int TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc);
void *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx);

/* Function declarations for TS_REQ defined in ts/ts_req_print.c */
435
436
437
438
439
440
441
442

443
444
445
446
447
448
449
int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa);
GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a);

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_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);
int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc);
void *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx);

/* Declarations related to response generation, defined in ts/ts_resp_sign.c. */







|
>







435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa);
GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a);

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, 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);
int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc);
void *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx);

/* Declarations related to response generation, defined in ts/ts_resp_sign.c. */
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
/* This parameter must be set. */
int TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer);

/* This parameter must be set. */
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);

/* 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);

/* Adds a new acceptable message digest. Note that no message digests
   are accepted by default. The md argument is shared with the caller. */
int TS_RESP_CTX_add_md(TS_RESP_CTX *ctx, const EVP_MD *md);

/* Accuracy is not included by default. */
int TS_RESP_CTX_set_accuracy(TS_RESP_CTX *ctx,







|






|







521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
/* This parameter must be set. */
int TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer);

/* This parameter must be set. */
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, 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, 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. */
int TS_RESP_CTX_add_md(TS_RESP_CTX *ctx, const EVP_MD *md);

/* Accuracy is not included by default. */
int TS_RESP_CTX_set_accuracy(TS_RESP_CTX *ctx,
Changes to jni/libressl/include/openssl/ui.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: ui.h,v 1.9 2014/07/10 22:45:58 jsing Exp $ */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
 * project 2001.
 */
/* ====================================================================
 * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
	UIT_VERIFY,		/* Prompt for a string and verify */
	UIT_BOOLEAN,		/* Prompt for a yes/no response */
	UIT_INFO,		/* Send info to the user */
	UIT_ERROR		/* Send an error message to the user */
};

/* Create and manipulate methods */
UI_METHOD *UI_create_method(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));
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*);

/* The following functions are helpers for method writers to access relevant
   data from a UI_STRING. */

/* Return type of the UI_STRING */
enum UI_string_types UI_get_string_type(UI_STRING *uis);
/* Return input flags of the UI_STRING */







|







|
|
|
|
|
|







300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
	UIT_VERIFY,		/* Prompt for a string and verify */
	UIT_BOOLEAN,		/* Prompt for a yes/no response */
	UIT_INFO,		/* Send info to the user */
	UIT_ERROR		/* Send an error message to the user */
};

/* Create and manipulate methods */
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));
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(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. */

/* Return type of the UI_STRING */
enum UI_string_types UI_get_string_type(UI_STRING *uis);
/* Return input flags of the UI_STRING */
Changes to jni/libressl/include/openssl/x509.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509.h,v 1.44 2018/03/17 15:28:27 tb 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#endif
#include <openssl/ossl_typ.h>

#ifdef  __cplusplus
extern "C" {
#endif

#if defined(_WIN32)
#ifndef LIBRESSL_INTERNAL
#ifdef _MSC_VER
#pragma message("Warning, overriding WinCrypt defines")
#else
#warning overriding WinCrypt defines
#endif
#endif







|







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#endif
#include <openssl/ossl_typ.h>

#ifdef  __cplusplus
extern "C" {
#endif

#if defined(_WIN32) && defined(__WINCRYPT_H__)
#ifndef LIBRESSL_INTERNAL
#ifdef _MSC_VER
#pragma message("Warning, overriding WinCrypt defines")
#else
#warning overriding WinCrypt defines
#endif
#endif
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625

626
627




628
629
630
631
632
633
634
ASN1_INTEGER *keylength;
X509_ALGOR *prf;
} PBKDF2PARAM;


/* 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
        ASN1_INTEGER *version;
        X509_ALGOR *pkeyalg;
        ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */
        STACK_OF(X509_ATTRIBUTE) *attributes;
        };

#ifdef  __cplusplus
}
#endif

#include <openssl/x509_vfy.h>
#include <openssl/pkcs7.h>

#ifdef  __cplusplus
extern "C" {
#endif

#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);

const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl);
const ASN1_TIME *X509_CRL_get0_nextUpdate(const 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);







|
<
<
<
<
<
<
<


|

|















<
<
<
<

<
<


<
<
<
<
<
<
<





>


>
>
>
>







570
571
572
573
574
575
576
577







578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597




598


599
600







601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
ASN1_INTEGER *keylength;
X509_ALGOR *prf;
} PBKDF2PARAM;


/* PKCS#8 private key info structure */

struct pkcs8_priv_key_info_st {







        ASN1_INTEGER *version;
        X509_ALGOR *pkeyalg;
        ASN1_OCTET_STRING *pkey;
        STACK_OF(X509_ATTRIBUTE) *attributes;
};

#ifdef  __cplusplus
}
#endif

#include <openssl/x509_vfy.h>
#include <openssl/pkcs7.h>

#ifdef  __cplusplus
extern "C" {
#endif

#define X509_EXT_PACK_UNKNOWN	1
#define X509_EXT_PACK_STRING	2





#define		X509_extract_key(x)	X509_get_pubkey(x) /*****/


#define		X509_REQ_extract_key(a)	X509_REQ_get_pubkey(a)
#define		X509_name_cmp(a,b)	X509_NAME_cmp((a),(b))








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);
662
663
664
665
666
667
668
669
670

671
672
673
674
675
676
677
NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len);
char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
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_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);
int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);







|
|
>







647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len);
char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
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, 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);
int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
X509 *X509_dup(X509 *x509);
X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa);
X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex);
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_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);








|
|







753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
X509 *X509_dup(X509 *x509);
X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa);
X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex);
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(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);

916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
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);
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, 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);
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);
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);







|
|
|
|


|
|







902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
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);
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, 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);
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998

999
1000

1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017

1018



1019

1020

1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, const unsigned char **in, long len);
int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **out);
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);

int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data,
	unsigned char *md,unsigned int *len);

int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,
	ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey);

int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
	ASN1_BIT_STRING *signature,
	void *data, EVP_PKEY *pkey, const EVP_MD *type);
int ASN1_item_sign_ctx(const ASN1_ITEM *it,
		X509_ALGOR *algor1, X509_ALGOR *algor2,
	     	ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx);
#endif

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);

int 		X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
ASN1_INTEGER *	X509_get_serialNumber(X509 *x);

int 		X509_set_issuer_name(X509 *x, X509_NAME *name);
X509_NAME *	X509_get_issuer_name(X509 *a);
int 		X509_set_subject_name(X509 *x, X509_NAME *name);
X509_NAME *	X509_get_subject_name(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);
EVP_PKEY *	X509_get0_pubkey(X509 *x);
ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);
int		X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */);





int		X509_REQ_set_version(X509_REQ *x,long version);

int		X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name);

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);
int *		X509_REQ_get_extension_nids(void);
void		X509_REQ_set_extension_nids(int *nids);
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
				int nid);
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 lastpos);
X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);
X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);
int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
			const ASN1_OBJECT *obj, int type,
			const unsigned char *bytes, int len);







|


















>


>

|

|










|

|
>

>
>
>

>
|
>












|







959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, const unsigned char **in, long len);
int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **out);
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(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);

int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,
	ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey);

int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
	ASN1_BIT_STRING *signature,
	void *data, EVP_PKEY *pkey, const EVP_MD *type);
int ASN1_item_sign_ctx(const ASN1_ITEM *it,
		X509_ALGOR *algor1, X509_ALGOR *algor2,
	     	ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx);
#endif

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(const X509 *a);
int 		X509_set_subject_name(X509 *x, X509_NAME *name);
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);
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);
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);
int *		X509_REQ_get_extension_nids(void);
void		X509_REQ_set_extension_nids(int *nids);
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
				int nid);
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, 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);
int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
			const ASN1_OBJECT *obj, int type,
			const unsigned char *bytes, int len);
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
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_issuer_and_serial_cmp(const X509 *a, const X509 *b);
unsigned long	X509_issuer_and_serial_hash(X509 *a);

int		X509_issuer_name_cmp(const X509 *a, const X509 *b);
unsigned long	X509_issuer_name_hash(X509 *a);








|







1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
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(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);

int		X509_issuer_name_cmp(const X509 *a, const X509 *b);
unsigned long	X509_issuer_name_hash(X509 *a);

1084
1085
1086
1087
1088
1089
1090
1091

1092
1093
1094

1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113

1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155

1156
1157
1158
1159
1160
1161
1162
1163
1164
1165

1166

1167

1168
1169
1170
1171

1172
1173
1174
1175
1176

1177

1178

1179
1180
1181

1182

1183
1184
1185
1186
1187
1188
1189
1190

1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242

int		X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
int		X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
int		X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
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);


#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_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);
int		X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent);
int		X509_CRL_print(BIO *bp,X509_CRL *x);
int		X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag);
int		X509_REQ_print(BIO *bp,X509_REQ *req);
#endif

int 		X509_NAME_entry_count(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);

/* 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 lastpos);
X509_NAME_ENTRY *X509_NAME_get_entry(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 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_NID(X509_NAME *name, int nid, int type,
			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 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);
int 		X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne,
			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);
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);
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);
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);
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);
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);
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);
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);

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);

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 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);
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,
					 X509_ATTRIBUTE *attr);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
			const ASN1_OBJECT *obj, int type,
			const unsigned char *bytes, int len);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
			int nid, int type,
			const unsigned char *bytes, int len);
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);
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,
	     const ASN1_OBJECT *obj, int atrtype, const void *data, int len);
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
		const char *atrname, int type, const unsigned char *bytes, int len);
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);
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 lastpos);
X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc);
X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc);
int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
			const ASN1_OBJECT *obj, int type,
			const unsigned char *bytes, int len);







|
>


|
>
|









|


|
|



|
>
|
|
|

|

|
|

|



|



|
|

|


|
|






|







|
|
|
>
|
|


|



|
|
>
|
>
|
>
|


|
>
|
|

|
|
>
|
>
|
>
|

|
>
|
>
|
|




|
|
>





|




|
|














|










|






|







1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250

int		X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
int		X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
int		X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
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, const X509_NAME *nm, int indent,
		    unsigned long flags);

#ifndef OPENSSL_NO_BIO
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);
int		X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent);
int		X509_CRL_print(BIO *bp,X509_CRL *x);
int		X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag);
int		X509_REQ_print(BIO *bp,X509_REQ *req);
#endif

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,
			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(const X509_NAME *name, int nid,
			int lastpos);
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, const X509_NAME_ENTRY *ne,
			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,
			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, 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,
			const ASN1_OBJECT *obj, int type,
			const unsigned char *bytes, int len);
int 		X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne,
			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(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,
				      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);
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(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(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(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(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(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,
    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(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,
    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,
					 X509_ATTRIBUTE *attr);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
			const ASN1_OBJECT *obj, int type,
			const unsigned char *bytes, int len);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
			int nid, int type,
			const unsigned char *bytes, int len);
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,
    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,
	     const ASN1_OBJECT *obj, int atrtype, const void *data, int len);
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
		const char *atrname, int type, const unsigned char *bytes, int len);
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(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, 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);
int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
			const ASN1_OBJECT *obj, int type,
			const unsigned char *bytes, int len);
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306


1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332

PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void);
void PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a);
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, const unsigned char **in, long len);
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);
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 X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,
					int ptype, void *pval,
					unsigned char *penc, int penclen);
int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
		const unsigned char **pk, int *ppklen,
		X509_ALGOR **pa,
		X509_PUBKEY *pub);

int X509_check_trust(X509 *x, int id, int flags);
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);
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_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
 * made after this point may be overwritten when the script is next run.







|

<
<

|
<
|
|
|
|
|
>
>














|

|
|
|







1296
1297
1298
1299
1300
1301
1302
1303
1304


1305
1306

1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339

PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void);
void PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a);
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, const unsigned char **in, long len);
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(const PKCS8_PRIV_KEY_INFO *p8);
PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey);



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,
					unsigned char *penc, int penclen);
int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
		const unsigned char **pk, int *ppklen,
		X509_ALGOR **pa,
		X509_PUBKEY *pub);

int X509_check_trust(X509 *x, int id, int flags);
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),
    const char *name, int arg1, void *arg2);
void X509_TRUST_cleanup(void);
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
 * made after this point may be overwritten when the script is next run.
Changes to jni/libressl/include/openssl/x509_vfy.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509_vfy.h,v 1.27 2018/03/20 15:26:22 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.
 * 
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
typedef struct x509_lookup_method_st
	{
	const char *name;
	int (*new_item)(X509_LOOKUP *ctx);
	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);
	} X509_LOOKUP_METHOD;

typedef struct X509_VERIFY_PARAM_ID_st X509_VERIFY_PARAM_ID;

/* This structure hold all parameters associated with a verify operation
 * by including an X509_VERIFY_PARAM structure in related structures the
 * parameters used can be customized







|
|
|
|
|
|
|
|
<
|
|







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144

145
146
147
148
149
150
151
152
153
typedef struct x509_lookup_method_st
	{
	const char *name;
	int (*new_item)(X509_LOOKUP *ctx);
	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,
	    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;

/* This structure hold all parameters associated with a verify operation
 * by including an X509_VERIFY_PARAM structure in related structures the
 * parameters used can be customized
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
				| X509_V_FLAG_INHIBIT_ANY \
				| X509_V_FLAG_INHIBIT_MAP)

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_get_type(const X509_OBJECT *a);
void X509_OBJECT_free_contents(X509_OBJECT *a);
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);







|







419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
				| X509_V_FLAG_INHIBIT_ANY \
				| X509_V_FLAG_INHIBIT_MAP)

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);
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 *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);
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
void X509_LOOKUP_free(X509_LOOKUP *ctx);
int X509_LOOKUP_init(X509_LOOKUP *ctx);
int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name,
	X509_OBJECT *ret);
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,
	int len, X509_OBJECT *ret);
int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);

int	X509_STORE_load_locations (X509_STORE *ctx,
		const char *file, const char *dir);
int	X509_STORE_load_mem(X509_STORE *ctx, void *buf, int len);
int	X509_STORE_set_default_paths(X509_STORE *ctx);







|
|







491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
void X509_LOOKUP_free(X509_LOOKUP *ctx);
int X509_LOOKUP_init(X509_LOOKUP *ctx);
int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name,
	X509_OBJECT *ret);
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,
	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);

int	X509_STORE_load_locations (X509_STORE *ctx,
		const char *file, const char *dir);
int	X509_STORE_load_mem(X509_STORE *ctx, void *buf, int len);
int	X509_STORE_set_default_paths(X509_STORE *ctx);
Changes to jni/libressl/include/openssl/x509v3.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: x509v3.h,v 1.22 2017/06/22 17:28:00 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project 1999.
 */
/* ====================================================================
 * Copyright (c) 1999-2004 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/* $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.
 */
/* ====================================================================
 * Copyright (c) 1999-2004 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
X509V3_EXT_I2R i2r;
X509V3_EXT_R2I r2i;

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);
void (*free_section)(void *db, STACK_OF(CONF_VALUE) *section);
} X509V3_CONF_METHOD;

/* Context specific info */
struct v3_ext_ctx {
#define CTX_TEST 0x1
int flags;







|
|
|







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
X509V3_EXT_I2R i2r;
X509V3_EXT_R2I r2i;

void *usr_data;	/* Any extension specific data */
};

typedef struct X509V3_CONF_METHOD_st {
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;

/* Context specific info */
struct v3_ext_ctx {
#define CTX_TEST 0x1
int flags;
520
521
522
523
524
525
526
527

528

529

530
531
532
533
534
535
536
537
538
extern const ASN1_ITEM SXNET_it;
SXNETID *SXNETID_new(void);
void SXNETID_free(SXNETID *a);
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); 


ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, 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);

AUTHORITY_KEYID *AUTHORITY_KEYID_new(void);
void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a);
AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **a, const unsigned char **in, long len);
int i2d_AUTHORITY_KEYID(AUTHORITY_KEYID *a, unsigned char **out);







|
>
|
>
|
>

|







520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
extern const ASN1_ITEM SXNET_it;
SXNETID *SXNETID_new(void);
void SXNETID_free(SXNETID *a);
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, 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, 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);

AUTHORITY_KEYID *AUTHORITY_KEYID_new(void);
void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a);
AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **a, const unsigned char **in, long len);
int i2d_AUTHORITY_KEYID(AUTHORITY_KEYID *a, unsigned char **out);
588
589
590
591
592
593
594
595

596

597
598
599
600
601
602
603
604
605
606
607
608
609
610
void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value);
void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype);
int GENERAL_NAME_set0_othername(GENERAL_NAME *gen,
				ASN1_OBJECT *oid, ASN1_TYPE *value);
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);


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);

CERTIFICATEPOLICIES *CERTIFICATEPOLICIES_new(void);
void CERTIFICATEPOLICIES_free(CERTIFICATEPOLICIES *a);
CERTIFICATEPOLICIES *d2i_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES **a, const unsigned char **in, long len);
int i2d_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES *a, unsigned char **out);
extern const ASN1_ITEM CERTIFICATEPOLICIES_it;
POLICYINFO *POLICYINFO_new(void);







|
>
|
>






|







591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value);
void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype);
int GENERAL_NAME_set0_othername(GENERAL_NAME *gen,
				ASN1_OBJECT *oid, ASN1_TYPE *value);
int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen, 
				ASN1_OBJECT **poid, ASN1_TYPE **pvalue);

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, const ACCESS_DESCRIPTION* a);

CERTIFICATEPOLICIES *CERTIFICATEPOLICIES_new(void);
void CERTIFICATEPOLICIES_free(CERTIFICATEPOLICIES *a);
CERTIFICATEPOLICIES *d2i_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES **a, const unsigned char **in, long len);
int i2d_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES *a, unsigned char **out);
extern const ASN1_ITEM CERTIFICATEPOLICIES_it;
POLICYINFO *POLICYINFO_new(void);
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696

697

698

699

700

701

702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722

723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740

741
742
743
744
745
746
747
748
749
750
751

752
753
754
755
756
757
758
759
760
761
762
763
764
765

766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792

POLICY_CONSTRAINTS *POLICY_CONSTRAINTS_new(void);
void POLICY_CONSTRAINTS_free(POLICY_CONSTRAINTS *a);
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);

#ifdef HEADER_CONF_H
GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
			       CONF_VALUE *cnf);
GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out,
				  const X509V3_EXT_METHOD *method,
				  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_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
				    int ext_nid, char *value);
X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
				char *name, char *value);
int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
			char *section, X509 *cert);
int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
			    char *section, X509_REQ *req);
int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
			    char *section, X509_CRL *crl);

int X509V3_add_value_bool_nf(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);
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);
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,
				 X509_REQ *req, X509_CRL *crl, int flags);

int X509V3_add_value(const char *name, const char *value,
						STACK_OF(CONF_VALUE) **extlist);
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,
						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);

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);
void X509V3_EXT_cleanup(void);

const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);
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);



X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc);
int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags);

char *hex_to_string(const unsigned char *buffer, long len);
unsigned char *string_to_hex(const char *str, long *len);
int name_cmp(const char *name, const char *cmp);

void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
								 int ml);
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 X509_check_ca(X509 *x);
int X509_check_purpose(X509 *x, int id, int ca);
int X509_supported_extension(X509_EXTENSION *ex);
int X509_PURPOSE_set(int *p, int purpose);
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_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);
void X509_PURPOSE_cleanup(void);
int X509_PURPOSE_get_id(X509_PURPOSE *);

STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);
STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);
void X509_email_free(STACK_OF(OPENSSL_STRING) *sk);
STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);

/* Flags for X509_check_* functions */







|









|
>
|
>
|
>
|
>
|
>
|
>


|

|

|

|

|

|

|
|




|
>
|











|

|
|
|
|
>










|
>














>
|









|



|
|
|
|

|







684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807

POLICY_CONSTRAINTS *POLICY_CONSTRAINTS_new(void);
void POLICY_CONSTRAINTS_free(POLICY_CONSTRAINTS *a);
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, const char *value, int is_nc);

#ifdef HEADER_CONF_H
GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
			       CONF_VALUE *cnf);
GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out,
				  const X509V3_EXT_METHOD *method,
				  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,
    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, const char *value);
X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
    const char *name, const char *value);
int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
    const char *section, X509 *cert);
int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
    const char *section, X509_REQ *req);
int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
    const char *section, X509_CRL *crl);

int X509V3_add_value_bool_nf(const char *name, int asn1_bool,
			     STACK_OF(CONF_VALUE) **extlist);
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, 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,
				 X509_REQ *req, X509_CRL *crl, int flags);

int X509V3_add_value(const char *name, const char *value,
						STACK_OF(CONF_VALUE) **extlist);
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, const ASN1_INTEGER *aint,
						STACK_OF(CONF_VALUE) **extlist);
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);
void X509V3_EXT_cleanup(void);

const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);
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(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);
int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags);

char *hex_to_string(const unsigned char *buffer, long len);
unsigned char *string_to_hex(const char *str, long *len);
int name_cmp(const char *name, const char *cmp);

void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
								 int ml);
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, 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);
int X509_supported_extension(X509_EXTENSION *ex);
int X509_PURPOSE_set(int *p, int purpose);
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(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),
			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(const X509_PURPOSE *);

STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);
STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);
void X509_email_free(STACK_OF(OPENSSL_STRING) *sk);
STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);

/* Flags for X509_check_* functions */
Added jni/libressl/man/ASN1_INTEGER_get.3.




























































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
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 <steve@openssl.org>.
.\" 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.
Changes to jni/libressl/man/ASN1_OBJECT_new.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ASN1_OBJECT_new.3,v 1.9 2018/03/20 18:35:13 schwarze Exp $
.\"	OpenSSL 99d63d4 Mar 19 12:28:58 2016 -0400
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 20 2018 $
.Dt ASN1_OBJECT_NEW 3
.Os
.Sh NAME
.Nm ASN1_OBJECT_new ,
.Nm ASN1_OBJECT_free
.Nd ASN.1 object identifiers
.Sh SYNOPSIS







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 ASN1_OBJECT_NEW 3
.Os
.Sh NAME
.Nm ASN1_OBJECT_new ,
.Nm ASN1_OBJECT_free
.Nd ASN.1 object identifiers
.Sh SYNOPSIS
133
134
135
136
137
138
139
140
141
.Sh SEE ALSO
.Xr d2i_ASN1_OBJECT 3 ,
.Xr OBJ_nid2obj 3
.Sh HISTORY
.Fn ASN1_OBJECT_new
and
.Fn ASN1_OBJECT_free
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .







|

133
134
135
136
137
138
139
140
141
.Sh SEE ALSO
.Xr d2i_ASN1_OBJECT 3 ,
.Xr OBJ_nid2obj 3
.Sh HISTORY
.Fn ASN1_OBJECT_new
and
.Fn ASN1_OBJECT_free
first appeared in SSLeay 0.5.1 and have been available since
.Ox 2.4 .
Changes to jni/libressl/man/ASN1_STRING_length.3.
1
2
3
4
5
6
7
8
9
.\" $OpenBSD: ASN1_STRING_length.3,v 1.13 2018/03/23 23:18:17 schwarze Exp $
.\" full 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 <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
|
|







1
2
3
4
5
6
7
8
9
.\" $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 is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
.\" 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 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 ,
.Nm ASN1_STRING_to_UTF8 ,
.Nm ASN1_STRING_type
.Nd ASN1_STRING utility functions
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft int
.Fo ASN1_STRING_cmp
.Fa "ASN1_STRING *a"
.Fa "ASN1_STRING *b"
.Fc
.Ft unsigned char *
.Fo ASN1_STRING_data
.Fa "ASN1_STRING *x"
.Fc
.Ft ASN1_STRING *
.Fo ASN1_STRING_dup
.Fa "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"
.Fc
.Ft void
.Fo ASN1_STRING_length_set
.Fa "ASN1_STRING *x"
.Fa "int len"
.Fc
.Ft int
.Fo ASN1_STRING_set
.Fa "ASN1_STRING *str"
.Fa "const void *data"
.Fa "int len"
.Fc
.Ft int
.Fo ASN1_STRING_to_UTF8
.Fa "unsigned char **out"
.Fa "ASN1_STRING *in"
.Fc
.Ft int
.Fo ASN1_STRING_type
.Fa "ASN1_STRING *x"
.Fc
.Sh DESCRIPTION
These functions manipulate
.Vt ASN1_STRING
structures.
.Pp
.Fn ASN1_STRING_cmp







|

















|
|







|







|















|



|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
.\" 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 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 ,
.Nm ASN1_STRING_to_UTF8 ,
.Nm ASN1_STRING_type
.Nd ASN1_STRING utility functions
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft int
.Fo ASN1_STRING_cmp
.Fa "const ASN1_STRING *a"
.Fa "const ASN1_STRING *b"
.Fc
.Ft unsigned char *
.Fo ASN1_STRING_data
.Fa "ASN1_STRING *x"
.Fc
.Ft ASN1_STRING *
.Fo ASN1_STRING_dup
.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 "const ASN1_STRING *x"
.Fc
.Ft void
.Fo ASN1_STRING_length_set
.Fa "ASN1_STRING *x"
.Fa "int len"
.Fc
.Ft int
.Fo ASN1_STRING_set
.Fa "ASN1_STRING *str"
.Fa "const void *data"
.Fa "int len"
.Fc
.Ft int
.Fo ASN1_STRING_to_UTF8
.Fa "unsigned char **out"
.Fa "const ASN1_STRING *in"
.Fc
.Ft int
.Fo ASN1_STRING_type
.Fa "const ASN1_STRING *x"
.Fc
.Sh DESCRIPTION
These functions manipulate
.Vt ASN1_STRING
structures.
.Pp
.Fn ASN1_STRING_cmp
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
.Fn ASN1_STRING_get0_data
and
.Fn ASN1_STRING_data
is NUL terminated, and it may contain embedded NUL characters.
The format of the data depends on the string type:
for example for an
.Vt IA5String
the data contains ASCII characters, a
.Vt BMPString
two bytes per character in big endian format, and a
.Vt UTF8String
UTF-8 characters.
.Pp
Similar care should be taken to ensure the data is in the correct format
when calling
.Fn ASN1_STRING_set .
.Sh RETURN VALUES







|

|







236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
.Fn ASN1_STRING_get0_data
and
.Fn ASN1_STRING_data
is NUL terminated, and it may contain embedded NUL characters.
The format of the data depends on the string type:
for example for an
.Vt IA5String
the data contains ASCII characters, for a
.Vt BMPString
two bytes per character in big endian format, and for a
.Vt UTF8String
UTF-8 characters.
.Pp
Similar care should be taken to ensure the data is in the correct format
when calling
.Fn ASN1_STRING_set .
.Sh RETURN VALUES
287
288
289
290
291
292
293
294

295

296
297
298
299
300
301
302
303
304
305
306
.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_data ,

.Fn ASN1_STRING_dup ,

.Fn ASN1_STRING_set ,
and
.Fn ASN1_STRING_type
appeared in SSLeay 0.8.1b or earlier.
.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







|
>
|
>
|


|







287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
.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
Changes to jni/libressl/man/ASN1_STRING_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\"	$OpenBSD: ASN1_STRING_new.3,v 1.14 2018/03/21 17:57:48 schwarze Exp $
.\"	OpenSSL 99d63d46 Tue Mar 24 07:52:24 2015 -0400
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 ASN1_STRING_NEW 3
.Os
.Sh NAME
.Nm ASN1_STRING_new ,
.Nm ASN1_STRING_type_new ,
.Nm ASN1_STRING_free ,
.Nm ASN1_OCTET_STRING_new ,
|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\"	$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 <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt ASN1_STRING_NEW 3
.Os
.Sh NAME
.Nm ASN1_STRING_new ,
.Nm ASN1_STRING_type_new ,
.Nm ASN1_STRING_free ,
.Nm ASN1_OCTET_STRING_new ,
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233











234
235
236
237
238
239
240
241
if an error occurs.
.Sh SEE ALSO
.Xr ASN1_time_parse 3 ,
.Xr ASN1_TIME_set 3 ,
.Xr d2i_ASN1_OCTET_STRING 3 ,
.Xr ERR_get_error 3
.Sh HISTORY
.Fn ASN1_STRING_new ,
.Fn ASN1_STRING_type_new ,
.Fn ASN1_STRING_free ,
.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_UNIVERSALSTRING_new ,
.Fn ASN1_UNIVERSALSTRING_free ,
.Fn ASN1_GENERALSTRING_new ,
.Fn ASN1_GENERALSTRING_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











appeared in SSLeay 0.8.1b or earlier.
.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







<
<
<








<
<
<
<









>
>
>
>
>
>
>
>
>
>
>
|







203
204
205
206
207
208
209



210
211
212
213
214
215
216
217




218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
if an error occurs.
.Sh SEE ALSO
.Xr ASN1_time_parse 3 ,
.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
Changes to jni/libressl/man/ASN1_STRING_print_ex.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: ASN1_STRING_print_ex.3,v 1.12 2018/03/22 17:11:04 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.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $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.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.\" 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 22 2018 $
.Dt ASN1_STRING_PRINT_EX 3
.Os
.Sh NAME
.Nm ASN1_STRING_print_ex ,
.Nm ASN1_STRING_print_ex_fp ,
.Nm ASN1_STRING_print ,
.Nm ASN1_tag2str
.Nd ASN1_STRING output routines
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft int
.Fo ASN1_STRING_print_ex
.Fa "BIO *out"
.Fa "ASN1_STRING *str"
.Fa "unsigned long flags"
.Fc
.Ft int
.Fo ASN1_STRING_print_ex_fp
.Fa "FILE *fp"
.Fa "ASN1_STRING *str"
.Fa "unsigned long flags"
.Fc
.Ft int
.Fo ASN1_STRING_print
.Fa "BIO *out"
.Fa "ASN1_STRING *str"
.Fc
.Ft const char *
.Fo ASN1_tag2str
.Fa "int tag"
.Fc
.Sh DESCRIPTION
These functions output an







|













|





|





|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.\" 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 25 2018 $
.Dt ASN1_STRING_PRINT_EX 3
.Os
.Sh NAME
.Nm ASN1_STRING_print_ex ,
.Nm ASN1_STRING_print_ex_fp ,
.Nm ASN1_STRING_print ,
.Nm ASN1_tag2str
.Nd ASN1_STRING output routines
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft int
.Fo ASN1_STRING_print_ex
.Fa "BIO *out"
.Fa "const ASN1_STRING *str"
.Fa "unsigned long flags"
.Fc
.Ft int
.Fo ASN1_STRING_print_ex_fp
.Fa "FILE *fp"
.Fa "const ASN1_STRING *str"
.Fa "unsigned long flags"
.Fc
.Ft int
.Fo ASN1_STRING_print
.Fa "BIO *out"
.Fa "const ASN1_STRING *str"
.Fc
.Ft const char *
.Fo ASN1_tag2str
.Fa "int tag"
.Fc
.Sh DESCRIPTION
These functions output an
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
.Pp
.Fn ASN1_tag2str
returns a static string.
.Sh SEE ALSO
.Xr X509_NAME_print_ex 3
.Sh HISTORY
.Fn ASN1_STRING_print
appeared in SSLeay 0.8.1b or earlier 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 .







|











219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
.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 .
Changes to jni/libressl/man/ASN1_TIME_set.3.
1
2
3

4
5
6
7
8
9
10
.\"	$OpenBSD: ASN1_TIME_set.3,v 1.10 2018/03/23 23:18:17 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

.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>
.\" and Todd Short <tshort@akamai.com>.
.\" 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
|
<
|
>







1

2
3
4
5
6
7
8
9
10
.\" $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 <steve@openssl.org>
.\" and Todd Short <tshort@akamai.com>.
.\" 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 ASN1_TIME_SET 3
.Os
.Sh NAME
.Nm ASN1_TIME_set ,
.Nm ASN1_UTCTIME_set ,
.Nm ASN1_GENERALIZEDTIME_set ,
.Nm ASN1_TIME_adj ,







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 25 2018 $
.Dt ASN1_TIME_SET 3
.Os
.Sh NAME
.Nm ASN1_TIME_set ,
.Nm ASN1_UTCTIME_set ,
.Nm ASN1_GENERALIZEDTIME_set ,
.Nm ASN1_TIME_adj ,
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
.Ft int
.Fo ASN1_UTCTIME_cmp_time_t
.Fa "const ASN1_UTCTIME *s"
.Fa "time_t t"
.Fc
.Ft ASN1_GENERALIZEDTIME *
.Fo ASN1_TIME_to_generalizedtime
.Fa "ASN1_TIME *t"
.Fa "ASN1_GENERALIZEDTIME **out"
.Fc
.Sh DESCRIPTION
The functions
.Fn ASN1_TIME_set ,
.Fn ASN1_UTCTIME_set ,
and







|







154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
.Ft int
.Fo ASN1_UTCTIME_cmp_time_t
.Fa "const ASN1_UTCTIME *s"
.Fa "time_t t"
.Fc
.Ft ASN1_GENERALIZEDTIME *
.Fo ASN1_TIME_to_generalizedtime
.Fa "const ASN1_TIME *t"
.Fa "ASN1_GENERALIZEDTIME **out"
.Fc
.Sh DESCRIPTION
The functions
.Fn ASN1_TIME_set ,
.Fn ASN1_UTCTIME_set ,
and
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
a new time structure is allocated and returned.
.Pp
.Fn ASN1_TIME_adj
may change the type from
.Vt ASN1_GENERALIZEDTIME
to
.Vt ASN1_UTCTIME
or vise-versa depending on the resulting year.
The functions
.Fn ASN1_UTCTIME_adj
and
.Fn ASN1_GENERALIZEDTIME_adj
do not modify the type of the return structure.
.Pp
The functions







|







210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
a new time structure is allocated and returned.
.Pp
.Fn ASN1_TIME_adj
may change the type from
.Vt ASN1_GENERALIZEDTIME
to
.Vt ASN1_UTCTIME
or vice versa depending on the resulting year.
The functions
.Fn ASN1_UTCTIME_adj
and
.Fn ASN1_GENERALIZEDTIME_adj
do not modify the type of the return structure.
.Pp
The functions
392
393
394
395
396
397
398
399
400
401
402
403


404
405
406
407
408
409
410
tm = ASN1_TIME_adj(NULL, t, 0, 60 * 60);
b = BIO_new_fp(stdout, BIO_NOCLOSE);
ASN1_TIME_print(b, tm);
ASN1_STRING_free(tm);
BIO_free(b);
.Ed
.Sh HISTORY
.Fn ASN1_UTCTIME_set ,
.Fn ASN1_UTCTIME_check ,
and
.Fn ASN1_UTCTIME_print
appeared in SSLeay 0.8.1b or earlier.


.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 ,







|
<


|
>
>







392
393
394
395
396
397
398
399

400
401
402
403
404
405
406
407
408
409
410
411
tm = ASN1_TIME_adj(NULL, t, 0, 60 * 60);
b = BIO_new_fp(stdout, BIO_NOCLOSE);
ASN1_TIME_print(b, tm);
ASN1_STRING_free(tm);
BIO_free(b);
.Ed
.Sh HISTORY
.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 ,
Changes to jni/libressl/man/ASN1_TYPE_get.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ASN1_TYPE_get.3,v 1.6 2018/03/23 02:20:16 schwarze Exp $
.\"	OpenSSL 99d63d46 Mon Jun 6 00:43:05 2016 -0400
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
.\" 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 ASN1_TYPE_GET 3
.Os
.Sh NAME
.Nm ASN1_TYPE_new ,
.Nm ASN1_TYPE_free ,
.Nm ASN1_TYPE_get ,
.Nm ASN1_TYPE_set ,
.Nm ASN1_TYPE_set1 ,
.Nm ASN1_TYPE_cmp
.Nd ASN.1 objects of arbitrary type
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft ASN1_TYPE *
.Fn ASN1_TYPE_new void
.Ft void
.Fn ASN1_TYPE_free "ASN1_TYPE *a"
.Ft int
.Fo ASN1_TYPE_get
.Fa "ASN1_TYPE *a"
.Fc
.Ft void
.Fo ASN1_TYPE_set
.Fa "ASN1_TYPE *a"
.Fa "int type"
.Fa "void *value"
.Fc
.Ft int
.Fo ASN1_TYPE_set1
.Fa "ASN1_TYPE *a"
.Fa "int type"
.Fa "const void *value"
.Fc
.Ft int
.Fo ASN1_TYPE_cmp
.Fa "ASN1_TYPE *a"
.Fa "ASN1_TYPE *b"
.Fc
.Sh DESCRIPTION
.Vt ASN1_TYPE
represents the ASN.1 ANY type.
An
.Vt ASN1_TYPE
object can store an ASN.1 value of arbitrary type,







|


















|















|
|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
.\" 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 25 2018 $
.Dt ASN1_TYPE_GET 3
.Os
.Sh NAME
.Nm ASN1_TYPE_new ,
.Nm ASN1_TYPE_free ,
.Nm ASN1_TYPE_get ,
.Nm ASN1_TYPE_set ,
.Nm ASN1_TYPE_set1 ,
.Nm ASN1_TYPE_cmp
.Nd ASN.1 objects of arbitrary type
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft ASN1_TYPE *
.Fn ASN1_TYPE_new void
.Ft void
.Fn ASN1_TYPE_free "ASN1_TYPE *a"
.Ft int
.Fo ASN1_TYPE_get
.Fa "const ASN1_TYPE *a"
.Fc
.Ft void
.Fo ASN1_TYPE_set
.Fa "ASN1_TYPE *a"
.Fa "int type"
.Fa "void *value"
.Fc
.Ft int
.Fo ASN1_TYPE_set1
.Fa "ASN1_TYPE *a"
.Fa "int type"
.Fa "const void *value"
.Fc
.Ft int
.Fo ASN1_TYPE_cmp
.Fa "const ASN1_TYPE *a"
.Fa "const ASN1_TYPE *b"
.Fc
.Sh DESCRIPTION
.Vt ASN1_TYPE
represents the ASN.1 ANY type.
An
.Vt ASN1_TYPE
object can store an ASN.1 value of arbitrary type,
275
276
277
278
279
280
281
282

283

284
285
286
287

288
289
290
291
292
293
294
295

296
returns 0 for a match or non-zero for a mismatch.
.Sh SEE ALSO
.Xr ASN1_item_free 3 ,
.Xr ASN1_STRING_dup 3 ,
.Xr d2i_ASN1_TYPE 3 ,
.Xr OBJ_dup 3
.Sh HISTORY
.Fn ASN1_TYPE_new ,

.Fn ASN1_TYPE_free ,

.Fn ASN1_TYPE_get ,
and
.Fn ASN1_TYPE_set
appeared in SSLeay 0.8.1b or earlier and 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 and has been available since

.Ox 4.9 .







|
>
|
>
|


|
>







|
>

275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
returns 0 for a match or non-zero for a mismatch.
.Sh SEE ALSO
.Xr ASN1_item_free 3 ,
.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 .
Changes to jni/libressl/man/ASN1_generate_nconf.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ASN1_generate_nconf.3,v 1.10 2018/03/23 00:09:11 schwarze Exp $
.\"	OpenSSL 05ea606a Fri May 20 20:52:46 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson.
.\" Copyright (c) 2002, 2003, 2006-2009, 2013-2015 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" Copyright (c) 2002, 2003, 2006-2009, 2013-2015 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 ASN1_GENERATE_NCONF 3
.Os
.Sh NAME
.Nm ASN1_generate_nconf ,
.Nm ASN1_generate_v3
.Nd ASN.1 generation functions
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft ASN1_TYPE *
.Fo ASN1_generate_nconf
.Fa "char *str"
.Fa "CONF *nconf"
.Fc
.Ft ASN1_TYPE *
.Fo ASN1_generate_v3
.Fa "char *str"
.Fa "X509V3_CTX *cnf"
.Fc
.Sh DESCRIPTION
These functions generate the ASN.1 encoding of a string in an
.Vt ASN1_TYPE
structure.
.Pp







|










|




|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 25 2018 $
.Dt ASN1_GENERATE_NCONF 3
.Os
.Sh NAME
.Nm ASN1_generate_nconf ,
.Nm ASN1_generate_v3
.Nd ASN.1 generation functions
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft ASN1_TYPE *
.Fo ASN1_generate_nconf
.Fa "const char *str"
.Fa "CONF *nconf"
.Fc
.Ft ASN1_TYPE *
.Fo ASN1_generate_v3
.Fa "const char *str"
.Fa "X509V3_CTX *cnf"
.Fc
.Sh DESCRIPTION
These functions generate the ASN.1 encoding of a string in an
.Vt ASN1_TYPE
structure.
.Pp
Changes to jni/libressl/man/ASN1_item_d2i.3.
1
2
3
4
5
6
7
8
.\"     $OpenBSD: ASN1_item_d2i.3,v 1.7 2018/03/23 04:34:23 schwarze Exp $
.\"     OpenSSL doc/man3/d2i_X509.pod b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"     $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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 ASN1_ITEM_D2I 3
.Os
.Sh NAME
.Nm ASN1_item_d2i ,
.Nm ASN1_item_d2i_bio ,
.Nm ASN1_item_d2i_fp ,
.Nm d2i_ASN1_TYPE ,







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 ASN1_ITEM_D2I 3
.Os
.Sh NAME
.Nm ASN1_item_d2i ,
.Nm ASN1_item_d2i_bio ,
.Nm ASN1_item_d2i_fp ,
.Nm d2i_ASN1_TYPE ,
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
.Sh SEE ALSO
.Xr ASN1_item_new 3 ,
.Xr ASN1_TYPE_new 3
.Sh HISTORY
.Fn d2i_ASN1_TYPE
and
.Fn i2d_ASN1_TYPE
appeared in SSLeay 0.8.1b or earlier 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 ,







|







363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
.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 ,
Changes to jni/libressl/man/BF_set_key.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BF_set_key.3,v 1.7 2018/03/21 05:49:43 schwarze Exp $
.\"	OpenSSL 99d63d46 Jul 19 09:27:53 2016 -0400
.\"
.\" This file was written by Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000, 2002, 2005, 2014, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: BF_set_key.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $
.\"	OpenSSL 99d63d46 Jul 19 09:27:53 2016 -0400
.\"
.\" This file was written by Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000, 2002, 2005, 2014, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt BF_SET_KEY 3
.Os
.Sh NAME
.Nm BF_set_key ,
.Nm BF_encrypt ,
.Nm BF_decrypt ,
.Nm BF_ecb_encrypt ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 BF_SET_KEY 3
.Os
.Sh NAME
.Nm BF_set_key ,
.Nm BF_encrypt ,
.Nm BF_decrypt ,
.Nm BF_ecb_encrypt ,
254
255
256
257
258
259
260








261
262
263
264
265
These functions should not be used unless implementing `modes' of Blowfish.
The alternative is to use
.Fn BF_ecb_encrypt .
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








This Blowfish implementation 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 .







>
>
>
>
>
>
>
>
|




254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
These functions should not be used unless implementing `modes' of Blowfish.
The alternative is to use
.Fn BF_ecb_encrypt .
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
.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 .
Changes to jni/libressl/man/BIO_ctrl.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_ctrl.3,v 1.13 2018/03/22 16:06:33 schwarze Exp $
.\"	OpenSSL b055fceb Thu Oct 20 09:56:18 2016 +0100
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt BIO_CTRL 3
.Os
.Sh NAME
.Nm BIO_ctrl ,
.Nm BIO_callback_ctrl ,
.Nm BIO_ptr_ctrl ,
.Nm BIO_int_ctrl ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BIO_CTRL 3
.Os
.Sh NAME
.Nm BIO_ctrl ,
.Nm BIO_callback_ctrl ,
.Nm BIO_ptr_ctrl ,
.Nm BIO_int_ctrl ,
313
314
315
316
317
318
319
320
321


322
323
324
325
326
327
328
329
330
.Sh HISTORY
.Fn BIO_ctrl ,
.Fn BIO_reset ,
.Fn BIO_flush ,
.Fn BIO_eof ,
.Fn BIO_set_close ,
.Fn BIO_get_close ,
.Fn BIO_pending ,
and


.Fn BIO_wpending
appeared in SSLeay 0.8.1b or earlier.
.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







<

>
>

|







313
314
315
316
317
318
319

320
321
322
323
324
325
326
327
328
329
330
331
.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
Changes to jni/libressl/man/BIO_f_base64.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_f_base64.3,v 1.8 2018/03/20 23:56:07 schwarze Exp $
.\"	OpenSSL fc1d88f0 Wed Jul 2 22:42:40 2014 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2003, 2005, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2003, 2005, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.\" 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 20 2018 $
.Dt BIO_F_BASE64 3
.Os
.Sh NAME
.Nm BIO_f_base64
.Nd base64 BIO filter
.Sh SYNOPSIS
.In openssl/bio.h
.In openssl/evp.h
.Ft BIO_METHOD *
.Fo BIO_f_base64
.Fa void
.Fc
.Sh DESCRIPTION
.Fn BIO_f_base64
returns the base64 BIO method.
This is a filter BIO that base64 encodes any data written through it







|








|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.\" 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 2 2018 $
.Dt BIO_F_BASE64 3
.Os
.Sh NAME
.Nm BIO_f_base64
.Nd base64 BIO filter
.Sh SYNOPSIS
.In openssl/bio.h
.In openssl/evp.h
.Ft const BIO_METHOD *
.Fo BIO_f_base64
.Fa void
.Fc
.Sh DESCRIPTION
.Fn BIO_f_base64
returns the base64 BIO method.
This is a filter BIO that base64 encodes any data written through it
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
BIO_flush(bio_out);
BIO_free_all(b64);
.Ed
.Sh SEE ALSO
.Xr BIO_new 3
.Sh HISTORY
.Fn BIO_f_base64
appeared in SSLeay 0.8.1b or earlier 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.
.Pp
There should be some way of specifying a test that the BIO can perform
to reliably determine EOF (for example a MIME boundary).







|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
BIO_flush(bio_out);
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.
.Pp
There should be some way of specifying a test that the BIO can perform
to reliably determine EOF (for example a MIME boundary).
Changes to jni/libressl/man/BIO_f_buffer.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_f_buffer.3,v 1.8 2018/03/21 06:09:37 schwarze Exp $
.\"	OpenSSL 9b86974e Mar 19 12:32:14 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2010, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2010, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.\" 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 2018 $
.Dt BIO_F_BUFFER 3
.Os
.Sh NAME
.Nm BIO_f_buffer ,
.Nm BIO_get_buffer_num_lines ,
.Nm BIO_set_read_buffer_size ,
.Nm BIO_set_write_buffer_size ,
.Nm BIO_set_buffer_size ,
.Nm BIO_set_buffer_read_data
.Nd buffering BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO_METHOD *
.Fo BIO_f_buffer
.Fa void
.Fc
.Ft long
.Fo BIO_get_buffer_num_lines
.Fa "BIO *b"
.Fc







|












|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.\" 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 1 2018 $
.Dt BIO_F_BUFFER 3
.Os
.Sh NAME
.Nm BIO_f_buffer ,
.Nm BIO_get_buffer_num_lines ,
.Nm BIO_set_read_buffer_size ,
.Nm BIO_set_write_buffer_size ,
.Nm BIO_set_buffer_size ,
.Nm BIO_set_buffer_read_data
.Nd buffering BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft const BIO_METHOD *
.Fo BIO_f_buffer
.Fa void
.Fc
.Ft long
.Fo BIO_get_buffer_num_lines
.Fa "BIO *b"
.Fc
177
178
179
180
181
182
183
184

185

186

187
188
189
190
191
192
193
194
.Sh SEE ALSO
.Xr BIO_ctrl 3 ,
.Xr BIO_flush 3 ,
.Xr BIO_new 3 ,
.Xr BIO_pop 3 ,
.Xr BIO_reset 3
.Sh HISTORY
.Fn BIO_f_buffer ,

.Fn BIO_get_buffer_num_lines ,

.Fn BIO_set_read_buffer_size ,

.Fn BIO_set_write_buffer_size ,
and
.Fn BIO_set_buffer_size
appeared in SSLeay 0.8.1b or earlier.
.Fn BIO_set_buffer_read_data
first appeared in SSLeay 0.9.0.
All these functions have been available since
.Ox 2.4 .







|
>
|
>
|
>
|

|
|




177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
.Sh SEE ALSO
.Xr BIO_ctrl 3 ,
.Xr BIO_flush 3 ,
.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 .
Changes to jni/libressl/man/BIO_f_cipher.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_f_cipher.3,v 1.8 2018/03/21 09:03:49 schwarze Exp $
.\"	OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2003, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2003, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 2018 $
.Dt BIO_F_CIPHER 3
.Os
.Sh NAME
.Nm BIO_f_cipher ,
.Nm BIO_set_cipher ,
.Nm BIO_get_cipher_status ,
.Nm BIO_get_cipher_ctx
.Nd cipher BIO filter
.Sh SYNOPSIS
.In openssl/bio.h
.In openssl/evp.h
.Ft BIO_METHOD *
.Fo BIO_f_cipher
.Fa void
.Fc
.Ft void
.Fo BIO_set_cipher
.Fa "BIO *b"
.Fa "const EVP_CIPHER *cipher"
.Fa "unsigned char *key"
.Fa "unsigned char *iv"
.Fa "int enc"
.Fc







|











|



|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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: August 24 2018 $
.Dt BIO_F_CIPHER 3
.Os
.Sh NAME
.Nm BIO_f_cipher ,
.Nm BIO_set_cipher ,
.Nm BIO_get_cipher_status ,
.Nm BIO_get_cipher_ctx
.Nd cipher BIO filter
.Sh SYNOPSIS
.In openssl/bio.h
.In openssl/evp.h
.Ft const BIO_METHOD *
.Fo BIO_f_cipher
.Fa void
.Fc
.Ft int
.Fo BIO_set_cipher
.Fa "BIO *b"
.Fa "const EVP_CIPHER *cipher"
.Fa "unsigned char *key"
.Fa "unsigned char *iv"
.Fa "int enc"
.Fc
150
151
152
153
154
155
156


157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
or
.Xr BIO_puts 3
support is needed, then it can be achieved
by preceding the cipher BIO with a buffering BIO.
.Sh RETURN VALUES
.Fn BIO_f_cipher
returns the cipher BIO method.


.Pp
.Fn BIO_get_cipher_status
returns 1 for a successful decrypt and 0 for failure.
.Pp
.Fn BIO_get_cipher_ctx
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
appeared in SSLeay 0.8.1b or earlier 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 .







>
>













|





150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
or
.Xr BIO_puts 3
support is needed, then it can be achieved
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.
.Pp
.Fn BIO_get_cipher_ctx
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 .
Changes to jni/libressl/man/BIO_f_md.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_f_md.3,v 1.8 2018/03/20 23:56:07 schwarze Exp $
.\"	OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2006, 2009, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2006, 2009, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.\" 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 20 2018 $
.Dt BIO_F_MD 3
.Os
.Sh NAME
.Nm BIO_f_md ,
.Nm BIO_set_md ,
.Nm BIO_get_md ,
.Nm BIO_get_md_ctx
.Nd message digest BIO filter
.Sh SYNOPSIS
.In openssl/bio.h
.In openssl/evp.h
.Ft BIO_METHOD *
.Fo BIO_f_md
.Fa void
.Fc
.Ft int
.Fo BIO_set_md
.Fa "BIO *b"
.Fa "EVP_MD *md"







|











|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.\" 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 2 2018 $
.Dt BIO_F_MD 3
.Os
.Sh NAME
.Nm BIO_f_md ,
.Nm BIO_set_md ,
.Nm BIO_get_md ,
.Nm BIO_get_md_ctx
.Nd message digest BIO filter
.Sh SYNOPSIS
.In openssl/bio.h
.In openssl/evp.h
.Ft const BIO_METHOD *
.Fo BIO_f_md
.Fa void
.Fc
.Ft int
.Fo BIO_set_md
.Fa "BIO *b"
.Fa "EVP_MD *md"
244
245
246
247
248
249
250
251
252


253
254

255
256
257
258
259
260
261
BIO_free_all(bio);
.Ed
.Sh SEE ALSO
.Xr BIO_new 3
.Sh HISTORY
.Fn BIO_f_md ,
.Fn BIO_set_md ,
.Fn BIO_get_md ,
and


.Fn BIO_get_md_ctx
appeared in SSLeay 0.8.1b or earlier and 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
.Vt BIO
had been initialized, for example by calling







<

>
>

|
>







244
245
246
247
248
249
250

251
252
253
254
255
256
257
258
259
260
261
262
263
BIO_free_all(bio);
.Ed
.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
.Vt BIO
had been initialized, for example by calling
Changes to jni/libressl/man/BIO_f_null.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_f_null.3,v 1.7 2018/03/20 19:33:16 schwarze Exp $
.\"	OpenSSL e117a890 Sep 14 12:14:41 2000 +0000
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.\" 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 20 2018 $
.Dt BIO_F_NULL 3
.Os
.Sh NAME
.Nm BIO_f_null
.Nd null filter
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO_METHOD *
.Fo BIO_f_null
.Fa void
.Fc
.Sh DESCRIPTION
.Fn BIO_f_null
returns the null filter BIO method.
This is a filter BIO that does nothing.
As may be apparent, a null filter BIO is not particularly useful.
.Pp
All requests to a null filter BIO are passed through to the next BIO
in the chain: this means that a BIO chain containing a null filter BIO
behaves just as though the BIO was not there.
.Sh RETURN VALUES
.Fn BIO_f_null
returns the null filter BIO method.
.Sh SEE ALSO
.Xr BIO_new 3
.Sh HISTORY
.Fn BIO_f_null
appeared in SSLeay 0.8.1b or earlier and has been available since
.Ox 2.4 .







|







|



















|

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.\" 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 1 2018 $
.Dt BIO_F_NULL 3
.Os
.Sh NAME
.Nm BIO_f_null
.Nd null filter
.Sh SYNOPSIS
.In openssl/bio.h
.Ft const BIO_METHOD *
.Fo BIO_f_null
.Fa void
.Fc
.Sh DESCRIPTION
.Fn BIO_f_null
returns the null filter BIO method.
This is a filter BIO that does nothing.
As may be apparent, a null filter BIO is not particularly useful.
.Pp
All requests to a null filter BIO are passed through to the next BIO
in the chain: this means that a BIO chain containing a null filter BIO
behaves just as though the BIO was not there.
.Sh RETURN VALUES
.Fn BIO_f_null
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 .
Changes to jni/libressl/man/BIO_f_ssl.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: BIO_f_ssl.3,v 1.8 2018/03/21 08:06:34 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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2003, 2009, 2014-2016 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2003, 2009, 2014-2016 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.\" 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 2018 $
.Dt BIO_F_SSL 3
.Os
.Sh NAME
.Nm BIO_f_ssl ,
.Nm BIO_set_ssl ,
.Nm BIO_get_ssl ,
.Nm BIO_set_ssl_mode ,
.Nm BIO_set_ssl_renegotiate_bytes ,
.Nm BIO_get_num_renegotiates ,
.Nm BIO_set_ssl_renegotiate_timeout ,
.Nm BIO_new_ssl ,
.Nm BIO_new_ssl_connect ,
.Nm BIO_new_buffer_ssl_connect ,
.Nm BIO_ssl_copy_session_id ,
.Nm BIO_ssl_shutdown ,
.Nm BIO_do_handshake
.Nd SSL BIO
.Sh SYNOPSIS
.In openssl/bio.h
.In openssl/ssl.h
.Ft BIO_METHOD *
.Fn BIO_f_ssl void
.Ft long
.Fo BIO_set_ssl
.Fa "BIO *b"
.Fa "SSL *ssl"
.Fa "long c"
.Fc







|




















|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.\" 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 1 2018 $
.Dt BIO_F_SSL 3
.Os
.Sh NAME
.Nm BIO_f_ssl ,
.Nm BIO_set_ssl ,
.Nm BIO_get_ssl ,
.Nm BIO_set_ssl_mode ,
.Nm BIO_set_ssl_renegotiate_bytes ,
.Nm BIO_get_num_renegotiates ,
.Nm BIO_set_ssl_renegotiate_timeout ,
.Nm BIO_new_ssl ,
.Nm BIO_new_ssl_connect ,
.Nm BIO_new_buffer_ssl_connect ,
.Nm BIO_ssl_copy_session_id ,
.Nm BIO_ssl_shutdown ,
.Nm BIO_do_handshake
.Nd SSL BIO
.Sh SYNOPSIS
.In openssl/bio.h
.In openssl/ssl.h
.Ft const BIO_METHOD *
.Fn BIO_f_ssl void
.Ft long
.Fo BIO_set_ssl
.Fa "BIO *b"
.Fa "SSL *ssl"
.Fa "long c"
.Fc
564
565
566
567
568
569
570

571

572
573

574

575
576
577
578
579
580
581
582
583
584
585
BIO_flush(sbio);

BIO_free_all(sbio);
.Ed
.Sh HISTORY
.Fn BIO_f_ssl ,
.Fn BIO_set_ssl ,

.Fn BIO_get_ssl ,

.Fn BIO_set_ssl_mode ,
.Fn BIO_new_ssl ,

.Fn BIO_ssl_copy_session_id ,

.Fn BIO_ssl_shutdown ,
and
.Fn BIO_do_handshake
appeared before SSLeay 0.8.
.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.







>
|
>


>
|
>
|


|







564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
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.
Changes to jni/libressl/man/BIO_find_type.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_find_type.3,v 1.8 2018/03/22 17:11:04 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2013, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2013, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt BIO_FIND_TYPE 3
.Os
.Sh NAME
.Nm BIO_find_type ,
.Nm BIO_next ,
.Nm BIO_method_type
.Nd BIO chain traversal







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BIO_FIND_TYPE 3
.Os
.Sh NAME
.Nm BIO_find_type ,
.Nm BIO_next ,
.Nm BIO_method_type
.Nd BIO chain traversal
152
153
154
155
156
157
158
159
160
161



162
163
164
165
166
167
168
169
170
171
172
173
174

	btmp = BIO_next(btmp);
} while(btmp);
.Ed
.Sh SEE ALSO
.Xr BIO_new 3
.Sh HISTORY
.Fn BIO_find_type
and
.Fn BIO_method_type



appeared in SSLeay 0.8.1b or earlier and 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
.Dv NULL
pointer for the
.Fa b
argument.







<
<

>
>
>
|












152
153
154
155
156
157
158


159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

	btmp = BIO_next(btmp);
} while(btmp);
.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
.Dv NULL
pointer for the
.Fa b
argument.
Changes to jni/libressl/man/BIO_get_ex_new_index.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: BIO_get_ex_new_index.3,v 1.8 2018/03/23 00:09:11 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 <rsalz@akamai.com>.
.\" Copyright (c) 2015, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\" $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 <rsalz@akamai.com>.
.\" Copyright (c) 2015, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_EX_NEW_INDEX 3
.Os
.Sh NAME
.Nm BIO_get_ex_new_index ,
.Nm BIO_set_ex_data ,
.Nm BIO_get_ex_data ,
.Nm ENGINE_get_ex_new_index ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 18 2018 $
.Dt BIO_GET_EX_NEW_INDEX 3
.Os
.Sh NAME
.Nm BIO_get_ex_new_index ,
.Nm BIO_set_ex_data ,
.Nm BIO_get_ex_data ,
.Nm ENGINE_get_ex_new_index ,
145
146
147
148
149
150
151



152
153
154
155
156
157
158
.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 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







>
>
>







145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
.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
Changes to jni/libressl/man/BIO_meth_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: BIO_meth_new.3,v 1.4 2018/03/23 23:18: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 is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
|







1
2
3
4
5
6
7
8
.\" $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 <schwarze@openbsd.org>
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.\" 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_METH_NEW 3
.Os
.Sh NAME
.Nm BIO_get_new_index ,
.Nm BIO_meth_new ,
.Nm BIO_meth_free ,
.Nm BIO_meth_get_write ,







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.\" 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 ,
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.Fa "const char *name"
.Fc
.Ft void
.Fo BIO_meth_free
.Fa "BIO_METHOD *biom"
.Fc
.Ft int
.Fn "(*BIO_meth_get_write(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(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(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(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(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(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(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(BIO_METHOD *biom))"
.Fa "BIO *"
.Fa int
.Fa "BIO_info_cb *"
.Fc
.Ft int
.Fo BIO_meth_set_callback_ctrl
.Fa "BIO_METHOD *biom"







|






|






|






|






|






|






|






|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.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"
Changes to jni/libressl/man/BIO_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: BIO_new.3,v 1.14 2018/03/23 23:18:17 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 <steve@openssl.org>.
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>.
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.\" 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_NEW 3
.Os
.Sh NAME
.Nm BIO_new ,
.Nm BIO_up_ref ,
.Nm BIO_set ,
.Nm BIO_free ,
.Nm BIO_vfree ,
.Nm BIO_free_all
.Nd construct and destruct I/O abstraction objects
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO *
.Fo BIO_new
.Fa "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"
.Fc
.Ft int
.Fo BIO_free
.Fa "BIO *a"
.Fc
.Ft void
.Fo BIO_vfree







|














|








|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.\" 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 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 ,
.Nm BIO_free_all
.Nd construct and destruct I/O abstraction objects
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO *
.Fo BIO_new
.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 "const BIO_METHOD *type"
.Fc
.Ft int
.Fo BIO_free
.Fa "BIO *a"
.Fc
.Ft void
.Fo BIO_vfree
248
249
250
251
252
253
254
255

256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
.Xr BIO_s_file 3 ,
.Xr BIO_s_mem 3 ,
.Xr BIO_s_null 3 ,
.Xr BIO_s_socket 3 ,
.Xr BIO_set_callback 3 ,
.Xr BIO_should_retry 3
.Sh HISTORY
.Fn BIO_new

and
.Fn BIO_free
first appeared in SSLeay 0.6.0.
.Fn BIO_set
and
.Fn BIO_free_all
appeared in SSLeay 0.8.1b or earlier.
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 .







|
>



<
<

|










248
249
250
251
252
253
254
255
256
257
258
259


260
261
262
263
264
265
266
267
268
269
270
271
.Xr BIO_s_file 3 ,
.Xr BIO_s_mem 3 ,
.Xr BIO_s_null 3 ,
.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 .
Changes to jni/libressl/man/BIO_push.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_push.3,v 1.6 2018/03/20 19:33:16 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
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2014 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2014 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 20 2018 $
.Dt BIO_PUSH 3
.Os
.Sh NAME
.Nm BIO_push ,
.Nm BIO_pop
.Nd add and remove BIOs from a chain
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 BIO_PUSH 3
.Os
.Sh NAME
.Nm BIO_push ,
.Nm BIO_pop
.Nd add and remove BIOs from a chain
.Sh SYNOPSIS
174
175
176
177
178
179
180
181
182

183
184
as before.
.Sh SEE ALSO
.Xr BIO_find_type 3 ,
.Xr BIO_new 3 ,
.Xr BIO_read 3
.Sh HISTORY
.Fn BIO_push
and
.Fn BIO_pop

appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .







|

>
|

174
175
176
177
178
179
180
181
182
183
184
185
as before.
.Sh SEE ALSO
.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 .
Changes to jni/libressl/man/BIO_read.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_read.3,v 1.7 2018/03/20 19:33:16 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt BIO_READ 3
.Os
.Sh NAME
.Nm BIO_read ,
.Nm BIO_gets ,
.Nm BIO_write ,
.Nm BIO_puts







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BIO_READ 3
.Os
.Sh NAME
.Nm BIO_read ,
.Nm BIO_gets ,
.Nm BIO_write ,
.Nm BIO_puts
170
171
172
173
174
175
176
177
178
.Xr BIO_should_retry 3
.Sh HISTORY
.Fn BIO_read ,
.Fn BIO_gets ,
.Fn BIO_write ,
and
.Fn BIO_puts
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .







|

170
171
172
173
174
175
176
177
178
.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 .
Changes to jni/libressl/man/BIO_s_accept.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_s_accept.3,v 1.8 2018/03/21 09:03:49 schwarze Exp $
.\"	OpenSSL c03726ca Thu Aug 27 12:28:08 2015 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2014, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2014, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.\" 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 2018 $
.Dt BIO_S_ACCEPT 3
.Os
.Sh NAME
.Nm BIO_s_accept ,
.Nm BIO_set_accept_port ,
.Nm BIO_get_accept_port ,
.Nm BIO_new_accept ,
.Nm BIO_set_nbio_accept ,
.Nm BIO_set_accept_bios ,
.Nm BIO_set_bind_mode ,
.Nm BIO_get_bind_mode ,
.Nm BIO_do_accept
.Nd accept BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO_METHOD *
.Fo BIO_s_accept
.Fa void
.Fc
.Ft long
.Fo BIO_set_accept_port
.Fa "BIO *b"
.Fa "char *name"
.Fc
.Ft char *
.Fo BIO_get_accept_port
.Fa "BIO *b"
.Fc
.Ft BIO *
.Fo BIO_new_accept
.Fa "char *host_port"
.Fc
.Ft long
.Fo BIO_set_nbio_accept
.Fa "BIO *b"
.Fa "int n"
.Fc
.Ft long







|















|














|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.\" 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 12 2018 $
.Dt BIO_S_ACCEPT 3
.Os
.Sh NAME
.Nm BIO_s_accept ,
.Nm BIO_set_accept_port ,
.Nm BIO_get_accept_port ,
.Nm BIO_new_accept ,
.Nm BIO_set_nbio_accept ,
.Nm BIO_set_accept_bios ,
.Nm BIO_set_bind_mode ,
.Nm BIO_get_bind_mode ,
.Nm BIO_do_accept
.Nd accept BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft const BIO_METHOD *
.Fo BIO_s_accept
.Fa void
.Fc
.Ft long
.Fo BIO_set_accept_port
.Fa "BIO *b"
.Fa "char *name"
.Fc
.Ft char *
.Fo BIO_get_accept_port
.Fa "BIO *b"
.Fc
.Ft BIO *
.Fo BIO_new_accept
.Fa "const char *host_port"
.Fc
.Ft long
.Fo BIO_set_nbio_accept
.Fa "BIO *b"
.Fa "int n"
.Fc
.Ft long
354
355
356
357
358
359
360
361
362
363
364
365


366
367
368
369
370
371
372
373
374
375
.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_nbio_accept ,
.Fn BIO_set_accept_bios ,
and
.Fn BIO_do_accept
appeared in SSLeay 0.8.1b or earlier.


.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 .







<



|
>
>










354
355
356
357
358
359
360

361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
.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 .
Changes to jni/libressl/man/BIO_s_bio.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_s_bio.3,v 1.12 2018/03/22 17:11:04 schwarze Exp $
.\"	OpenSSL c03726ca Aug 27 12:28:08 2015 -0400
.\"
.\" This file was written by
.\" Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE>,
.\" Dr. Stephen Henson <steve@openssl.org>,
.\" Bodo Moeller <bodo@openssl.org>,
.\" and Richard Levitte <levitte@openssl.org>.
|







1
2
3
4
5
6
7
8
.\"	$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
.\" Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE>,
.\" Dr. Stephen Henson <steve@openssl.org>,
.\" Bodo Moeller <bodo@openssl.org>,
.\" and Richard Levitte <levitte@openssl.org>.
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.\" 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 22 2018 $
.Dt BIO_S_BIO 3
.Os
.Sh NAME
.Nm BIO_s_bio ,
.Nm BIO_make_bio_pair ,
.Nm BIO_destroy_bio_pair ,
.Nm BIO_shutdown_wr ,
.Nm BIO_set_write_buf_size ,
.Nm BIO_get_write_buf_size ,
.Nm BIO_new_bio_pair ,
.Nm BIO_get_write_guarantee ,
.Nm BIO_ctrl_get_write_guarantee ,
.Nm BIO_get_read_request ,
.Nm BIO_ctrl_get_read_request ,
.Nm BIO_ctrl_reset_read_request
.Nd BIO pair BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO_METHOD *
.Fo BIO_s_bio
.Fa void
.Fc
.Ft int
.Fo BIO_make_bio_pair
.Fa "BIO *b1"
.Fa "BIO *b2"







|


















|







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.\" 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 1 2018 $
.Dt BIO_S_BIO 3
.Os
.Sh NAME
.Nm BIO_s_bio ,
.Nm BIO_make_bio_pair ,
.Nm BIO_destroy_bio_pair ,
.Nm BIO_shutdown_wr ,
.Nm BIO_set_write_buf_size ,
.Nm BIO_get_write_buf_size ,
.Nm BIO_new_bio_pair ,
.Nm BIO_get_write_guarantee ,
.Nm BIO_ctrl_get_write_guarantee ,
.Nm BIO_get_read_request ,
.Nm BIO_ctrl_get_read_request ,
.Nm BIO_ctrl_reset_read_request
.Nd BIO pair BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft const BIO_METHOD *
.Fo BIO_s_bio
.Fa void
.Fc
.Ft int
.Fo BIO_make_bio_pair
.Fa "BIO *b1"
.Fa "BIO *b2"
Changes to jni/libressl/man/BIO_s_connect.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_s_connect.3,v 1.8 2018/03/21 06:09:37 schwarze Exp $
.\"	OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.\" 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 2018 $
.Dt BIO_S_CONNECT 3
.Os
.Sh NAME
.Nm BIO_s_connect ,
.Nm BIO_new_connect ,
.Nm BIO_set_conn_hostname ,
.Nm BIO_set_conn_port ,
.Nm BIO_set_conn_ip ,
.Nm BIO_set_conn_int_port ,
.Nm BIO_get_conn_hostname ,
.Nm BIO_get_conn_port ,
.Nm BIO_get_conn_ip ,
.Nm BIO_get_conn_int_port ,
.Nm BIO_set_nbio ,
.Nm BIO_do_connect
.Nd connect BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO_METHOD *
.Fo BIO_s_connect
.Fa void
.Fc
.Ft BIO *
.Fo BIO_new_connect
.Fa "char *name"
.Fc
.Ft long
.Fo BIO_set_conn_hostname
.Fa "BIO *b"
.Fa "char *name"
.Fc
.Ft long







|


















|





|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.\" 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 12 2018 $
.Dt BIO_S_CONNECT 3
.Os
.Sh NAME
.Nm BIO_s_connect ,
.Nm BIO_new_connect ,
.Nm BIO_set_conn_hostname ,
.Nm BIO_set_conn_port ,
.Nm BIO_set_conn_ip ,
.Nm BIO_set_conn_int_port ,
.Nm BIO_get_conn_hostname ,
.Nm BIO_get_conn_port ,
.Nm BIO_get_conn_ip ,
.Nm BIO_get_conn_int_port ,
.Nm BIO_set_nbio ,
.Nm BIO_do_connect
.Nd connect BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft const BIO_METHOD *
.Fo BIO_s_connect
.Fa void
.Fc
.Ft BIO *
.Fo BIO_new_connect
.Fa "const char *name"
.Fc
.Ft long
.Fo BIO_set_conn_hostname
.Fa "BIO *b"
.Fa "char *name"
.Fc
.Ft long
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
.Xr BIO_new 3
.Sh HISTORY
.Fn BIO_s_connect ,
.Fn BIO_new_connect ,
.Fn BIO_set_nbio ,
and
.Fn BIO_do_connect
appeared in SSLeay 0.8.1b or earlier.
.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 .







|












371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
.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 .
Changes to jni/libressl/man/BIO_s_fd.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_s_fd.3,v 1.7 2018/03/20 19:33:16 schwarze Exp $
.\"	OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.\" 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 20 2018 $
.Dt BIO_S_FD 3
.Os
.Sh NAME
.Nm BIO_s_fd ,
.Nm BIO_set_fd ,
.Nm BIO_get_fd ,
.Nm BIO_new_fd
.Nd file descriptor BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO_METHOD *
.Fo BIO_s_fd
.Fa "void"
.Fc
.Ft long
.Fo BIO_set_fd
.Fa "BIO *b"
.Fa "int fd"







|










|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.\" 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 1 2018 $
.Dt BIO_S_FD 3
.Os
.Sh NAME
.Nm BIO_s_fd ,
.Nm BIO_set_fd ,
.Nm BIO_get_fd ,
.Nm BIO_new_fd
.Nd file descriptor BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft const BIO_METHOD *
.Fo BIO_s_fd
.Fa "void"
.Fc
.Ft long
.Fo BIO_set_fd
.Fa "BIO *b"
.Fa "int fd"
191
192
193
194
195
196
197






198
199
200
.Ed
.Sh SEE ALSO
.Xr BIO_new 3 ,
.Xr BIO_read 3 ,
.Xr BIO_s_socket 3 ,
.Xr BIO_seek 3
.Sh HISTORY






These functions appeared in SSLeay 0.8.1b or earlier
and have been available since
.Ox 2.4 .







>
>
>
>
>
>
|
|

191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
.Ed
.Sh SEE ALSO
.Xr BIO_new 3 ,
.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 .
Changes to jni/libressl/man/BIO_s_file.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_s_file.3,v 1.8 2018/03/21 09:03:49 schwarze Exp $
.\"	OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2010 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
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_s_file.3,v 1.10 2018/07/09 09:54:08 tb Exp $
.\"	OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2010 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.\" 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 2018 $
.Dt BIO_S_FILE 3
.Os
.Sh NAME
.Nm BIO_s_file ,
.Nm BIO_new_file ,
.Nm BIO_new_fp ,
.Nm BIO_set_fp ,
.Nm BIO_get_fp ,
.Nm BIO_read_filename ,
.Nm BIO_write_filename ,
.Nm BIO_append_filename ,
.Nm BIO_rw_filename
.Nd FILE BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO_METHOD *
.Fo BIO_s_file
.Fa void
.Fc
.Ft BIO *
.Fo BIO_new_file
.Fa "const char *filename"
.Fa "const char *mode"







|















|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.\" 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_S_FILE 3
.Os
.Sh NAME
.Nm BIO_s_file ,
.Nm BIO_new_file ,
.Nm BIO_new_fp ,
.Nm BIO_set_fp ,
.Nm BIO_get_fp ,
.Nm BIO_read_filename ,
.Nm BIO_write_filename ,
.Nm BIO_append_filename ,
.Nm BIO_rw_filename
.Nd FILE BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft const BIO_METHOD *
.Fo BIO_s_file
.Fa void
.Fc
.Ft BIO *
.Fo BIO_new_file
.Fa "const char *filename"
.Fa "const char *mode"
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299




300
301
302
303
304
305
306
307
BIO_free(out);
.Ed
.Sh SEE ALSO
.Xr BIO_new 3 ,
.Xr BIO_read 3 ,
.Xr BIO_seek 3
.Sh HISTORY
.Fn BIO_s_file
and
.Fn BIO_set_fp
first appeared in SSLeay 0.6.0.
.Fn BIO_new_file ,
.Fn BIO_new_fp ,
.Fn BIO_get_fp ,
.Fn BIO_read_filename ,
.Fn BIO_write_filename ,
and
.Fn BIO_append_filename




appeared in SSLeay 0.8.1b or earlier.
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







|
<
|
<
<
<





>
>
>
>
|







282
283
284
285
286
287
288
289

290



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
BIO_free(out);
.Ed
.Sh SEE ALSO
.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
Changes to jni/libressl/man/BIO_s_mem.3.
1
2
3
4
5
6
7
8
9
10
.\" $OpenBSD: BIO_s_mem.3,v 1.9 2018/03/22 16:06:33 schwarze Exp $
.\" full merge up to: OpenSSL 8711efb4 Mon Apr 20 11:33:12 2009 +0000
.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
.\" are met:
|

|







1
2
3
4
5
6
7
8
9
10
.\" $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 <steve@openssl.org>.
.\" 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
.\" are met:
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.\" 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 22 2018 $
.Dt BIO_S_MEM 3
.Os
.Sh NAME
.Nm BIO_s_mem ,
.Nm BIO_set_mem_eof_return ,
.Nm BIO_get_mem_data ,
.Nm BIO_set_mem_buf ,
.Nm BIO_get_mem_ptr ,
.Nm BIO_new_mem_buf
.Nd memory BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO_METHOD *
.Fo BIO_s_mem
.Fa "void"
.Fc
.Ft long
.Fo BIO_set_mem_eof_return
.Fa "BIO *b"
.Fa "int v"







|












|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.\" 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 12 2018 $
.Dt BIO_S_MEM 3
.Os
.Sh NAME
.Nm BIO_s_mem ,
.Nm BIO_set_mem_eof_return ,
.Nm BIO_get_mem_data ,
.Nm BIO_set_mem_buf ,
.Nm BIO_get_mem_ptr ,
.Nm BIO_new_mem_buf
.Nd memory BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft const BIO_METHOD *
.Fo BIO_s_mem
.Fa "void"
.Fc
.Ft long
.Fo BIO_set_mem_eof_return
.Fa "BIO *b"
.Fa "int v"
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
.Ft long
.Fo BIO_get_mem_ptr
.Fa "BIO *b"
.Fa "BUF_MEM **pp"
.Fc
.Ft BIO *
.Fo BIO_new_mem_buf
.Fa "void *buf"
.Fa "int len"
.Fc
.Sh DESCRIPTION
.Fn BIO_s_mem
returns the memory BIO method function.
.Pp
A memory BIO is a source/sink BIO which uses memory for its I/O.







|







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
.Ft long
.Fo BIO_get_mem_ptr
.Fa "BIO *b"
.Fa "BUF_MEM **pp"
.Fc
.Ft BIO *
.Fo BIO_new_mem_buf
.Fa "const void *buf"
.Fa "int len"
.Fc
.Sh DESCRIPTION
.Fn BIO_s_mem
returns the memory BIO method function.
.Pp
A memory BIO is a source/sink BIO which uses memory for its I/O.
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
is true.
To avoid ambiguity with a normal positive return value
.Fa v
should be set to a negative value, typically -1.
.Pp
.Fn BIO_get_mem_data
sets
.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.
.Pp
.Fn BIO_set_mem_buf
sets the internal BUF_MEM structure to
.Fa bm







|







147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
is true.
To avoid ambiguity with a normal positive return value
.Fa v
should be set to a negative value, typically -1.
.Pp
.Fn BIO_get_mem_data
sets
.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.
.Pp
.Fn BIO_set_mem_buf
sets the internal BUF_MEM structure to
.Fa bm
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
.Fn BIO_set_mem_buf
is a macro.
.Pp
.Fn BIO_get_mem_ptr
places the underlying
.Vt BUF_MEM
structure in
.Fa pp .
It is a macro.
.Pp
.Fn BIO_new_mem_buf
creates a memory BIO using
.Fa len
bytes of data at
.Fa buf .







|







170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
.Fn BIO_set_mem_buf
is a macro.
.Pp
.Fn BIO_get_mem_ptr
places the underlying
.Vt BUF_MEM
structure in
.Pf * Fa pp .
It is a macro.
.Pp
.Fn BIO_new_mem_buf
creates a memory BIO using
.Fa len
bytes of data at
.Fa buf .
247
248
249
250
251
252
253
254

255
256
257

258
259
260
261
262
263
264
265
/* Make sure BIO_free() leaves BUF_MEM alone. */
BIO_set_close(mem, BIO_NOCLOSE);
BIO_free(mem);
.Ed
.Sh SEE ALSO
.Xr BIO_new 3
.Sh HISTORY
.Fn BIO_s_mem ,

.Fn BIO_set_mem_buf ,
and
.Fn BIO_get_mem_ptr

appeared in SSLeay 0.8.1b or earlier and 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 .







|
>
|


>
|







247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
/* Make sure BIO_free() leaves BUF_MEM alone. */
BIO_set_close(mem, BIO_NOCLOSE);
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 .
Changes to jni/libressl/man/BIO_s_null.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_s_null.3,v 1.6 2018/03/20 19:33:16 schwarze Exp $
.\"	OpenSSL e117a890 Sep 14 12:14:41 2000 +0000
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.\" 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 20 2018 $
.Dt BIO_S_NULL 3
.Os
.Sh NAME
.Nm BIO_s_null
.Nd null data sink
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO_METHOD *
.Fo BIO_s_null
.Fa void
.Fc
.Sh DESCRIPTION
.Fn BIO_s_null
returns the null sink BIO method.
Data written to the null sink is discarded, reads return EOF.







|







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.\" 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 1 2018 $
.Dt BIO_S_NULL 3
.Os
.Sh NAME
.Nm BIO_s_null
.Nd null data sink
.Sh SYNOPSIS
.In openssl/bio.h
.Ft const BIO_METHOD *
.Fo BIO_s_null
.Fa void
.Fc
.Sh DESCRIPTION
.Fn BIO_s_null
returns the null sink BIO method.
Data written to the null sink is discarded, reads return EOF.
80
81
82
83
84
85
86
87
88
.Sh RETURN VALUES
.Fn BIO_s_null
returns the null sink BIO method.
.Sh SEE ALSO
.Xr BIO_new 3
.Sh HISTORY
.Fn BIO_s_null
appeared in SSLeay 0.8.1b or earlier and has been available since
.Ox 2.4 .







|

80
81
82
83
84
85
86
87
88
.Sh RETURN VALUES
.Fn BIO_s_null
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 .
Changes to jni/libressl/man/BIO_s_socket.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BIO_s_socket.3,v 1.7 2018/03/20 19:33:16 schwarze Exp $
.\"	OpenSSL bbdc9c98 Oct 19 22:02:21 2000 +0000
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.\" 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 20 2018 $
.Dt BIO_S_SOCKET 3
.Os
.Sh NAME
.Nm BIO_s_socket ,
.Nm BIO_new_socket
.Nd socket BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft BIO_METHOD *
.Fo BIO_s_socket
.Fa void
.Fc
.Ft BIO *
.Fo BIO_new_socket
.Fa "int sock"
.Fa "int close_flag"







|








|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.\" 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 1 2018 $
.Dt BIO_S_SOCKET 3
.Os
.Sh NAME
.Nm BIO_s_socket ,
.Nm BIO_new_socket
.Nd socket BIO
.Sh SYNOPSIS
.In openssl/bio.h
.Ft const BIO_METHOD *
.Fo BIO_s_socket
.Fa void
.Fc
.Ft BIO *
.Fo BIO_new_socket
.Fa "int sock"
.Fa "int close_flag"
105
106
107
108
109
110
111
112
113
114

115
.Dv NULL
if an error occurred.
.Sh SEE ALSO
.Xr BIO_get_fd 3 ,
.Xr BIO_new 3
.Sh HISTORY
.Fn BIO_s_socket
and
.Fn BIO_new_socket
appeared in SSLeay 0.8.1b or earlier and have been available since

.Ox 2.4 .







|

|
>

105
106
107
108
109
110
111
112
113
114
115
116
.Dv NULL
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 .
Changes to jni/libressl/man/BIO_set_callback.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: BIO_set_callback.3,v 1.7 2018/03/20 19:33:16 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 is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
|







1
2
3
4
5
6
7
8
.\" $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 is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.\" 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 20 2018 $
.Dt BIO_SET_CALLBACK 3
.Os
.Sh NAME
.Nm BIO_set_callback ,
.Nm BIO_get_callback ,
.Nm BIO_set_callback_arg ,
.Nm BIO_get_callback_arg ,







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.\" 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 29 2018 $
.Dt BIO_SET_CALLBACK 3
.Os
.Sh NAME
.Nm BIO_set_callback ,
.Nm BIO_get_callback ,
.Nm BIO_set_callback_arg ,
.Nm BIO_get_callback_arg ,
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
after.
.It Fn BIO_gets b out outl
.Fn callback b BIO_CB_GETS out outl 0L 1L
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
is called before the operation and
.Fn callback b BIO_CB_WRITE|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
is called before the call and
.Fn callback b BIO_CB_CTRL|BIO_CB_RETURN parg oper larg ret
after.
.El







|

|







207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
after.
.It Fn BIO_gets b out outl
.Fn callback b BIO_CB_GETS out outl 0L 1L
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_PUTS in 0 0L 1L
is called before the operation and
.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
is called before the call and
.Fn callback b BIO_CB_CTRL|BIO_CB_RETURN parg oper larg ret
after.
.El
253
254
255
256
257
258
259







260
261
262
.Fn BIO_debug_callback
function is a good example.
Its source is in the file
.Pa crypto/bio/bio_cb.c .
.Sh SEE ALSO
.Xr BIO_new 3
.Sh HISTORY







These functions appeared in SSLeay 0.8.1b or earlier
and have been available since
.Ox 2.4 .







>
>
>
>
>
>
>
|
|

253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
.Fn BIO_debug_callback
function is a good example.
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 .
Changes to jni/libressl/man/BIO_should_retry.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: BIO_should_retry.3,v 1.7 2018/03/20 19:33:16 schwarze Exp $
.\" full merge up to: OpenSSL 60e24554 Apr 6 14:45:18 2010 +0000
.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2010, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\" $OpenBSD: BIO_should_retry.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $
.\" full merge up to: OpenSSL 60e24554 Apr 6 14:45:18 2010 +0000
.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2010, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 20 2018 $
.Dt BIO_SHOULD_RETRY 3
.Os
.Sh NAME
.Nm BIO_should_read ,
.Nm BIO_should_write ,
.Nm BIO_should_io_special ,
.Nm BIO_retry_type ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 BIO_SHOULD_RETRY 3
.Os
.Sh NAME
.Nm BIO_should_read ,
.Nm BIO_should_write ,
.Nm BIO_should_io_special ,
.Nm BIO_retry_type ,
211
212
213
214
215
216
217










218
219
220
221
222
223
224
225
and use a timeout on the
.Xr select 2
(or equivalent) call.
.Sh SEE ALSO
.Xr BIO_new 3 ,
.Xr BIO_read 3
.Sh HISTORY










These functions appeared in SSLeay 0.8.1b or earlier
and 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.
This is usually worked around by only passing the relevant data to ASN.1
functions when the entire structure can be read or written.







>
>
>
>
>
>
>
>
>
>
|
|






211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
and use a timeout on the
.Xr select 2
(or equivalent) call.
.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.
This is usually worked around by only passing the relevant data to ASN.1
functions when the entire structure can be read or written.
Changes to jni/libressl/man/BN_CTX_new.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_CTX_new.3,v 1.7 2018/03/21 09:03:49 schwarze Exp $
.\"	OpenSSL aafbe1cc Jun 12 23:42:08 2013 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt BN_CTX_NEW 3
.Os
.Sh NAME
.Nm BN_CTX_new ,
.Nm BN_CTX_free ,
.Nm BN_CTX_init
.Nd allocate and free BN_CTX structures







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BN_CTX_NEW 3
.Os
.Sh NAME
.Nm BN_CTX_new ,
.Nm BN_CTX_free ,
.Nm BN_CTX_init
.Nd allocate and free BN_CTX structures
132
133
134
135
136
137
138
139
140
141
142
143
144
.Xr BN_CTX_start 3 ,
.Xr BN_new 3 ,
.Xr ERR_get_error 3
.Sh HISTORY
.Fn BN_CTX_new
and
.Fn BN_CTX_free
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Pp
.Fn BN_CTX_init
first appeared in SSLeay 0.9.1 and has been available since
.Ox 2.6 .







|





132
133
134
135
136
137
138
139
140
141
142
143
144
.Xr BN_CTX_start 3 ,
.Xr BN_new 3 ,
.Xr ERR_get_error 3
.Sh HISTORY
.Fn BN_CTX_new
and
.Fn BN_CTX_free
first appeared in SSLeay 0.5.1 and have been available since
.Ox 2.4 .
.Pp
.Fn BN_CTX_init
first appeared in SSLeay 0.9.1 and has been available since
.Ox 2.6 .
Changes to jni/libressl/man/BN_add.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_add.3,v 1.11 2018/03/22 21:08:22 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>
.\" and Bodo Moeller <bodo@openssl.org>.
.\" Copyright (c) 2000, 2001, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>
.\" and Bodo Moeller <bodo@openssl.org>.
.\" Copyright (c) 2000, 2001, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68







69
70
71
72
73
74
75
.\" 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 22 2018 $
.Dt BN_ADD 3
.Os
.Sh NAME
.Nm BN_add ,
.Nm BN_sub ,
.Nm BN_mul ,
.Nm BN_sqr ,
.Nm BN_div ,
.Nm BN_mod ,
.Nm BN_nnmod ,
.Nm BN_mod_add ,
.Nm BN_mod_sub ,
.Nm BN_mod_mul ,
.Nm BN_mod_sqr ,
.Nm BN_exp ,
.Nm BN_mod_exp ,







.Nm BN_gcd
.Nd arithmetic operations on BIGNUMs
.Sh SYNOPSIS
.In openssl/bn.h
.Ft int
.Fo BN_add
.Fa "BIGNUM *r"







|
















>
>
>
>
>
>
>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.\" 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 29 2018 $
.Dt BN_ADD 3
.Os
.Sh NAME
.Nm BN_add ,
.Nm BN_sub ,
.Nm BN_mul ,
.Nm BN_sqr ,
.Nm BN_div ,
.Nm BN_mod ,
.Nm BN_nnmod ,
.Nm BN_mod_add ,
.Nm BN_mod_sub ,
.Nm BN_mod_mul ,
.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 <openssl/bn.h>.
.Nm BN_gcd
.Nd arithmetic operations on BIGNUMs
.Sh SYNOPSIS
.In openssl/bn.h
.Ft int
.Fo BN_add
.Fa "BIGNUM *r"
241
242
243
244
245
246
247







248
249
250
251
252
253
254
by
.Fa d
and places the result in
.Fa dv
and the remainder in
.Fa rem
.Pq Li dv=a/d , rem=a%d .







Either of
.Fa dv
and
.Fa rem
may be
.Dv NULL ,
in which case the respective value is not returned.







>
>
>
>
>
>
>







248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
by
.Fa d
and places the result in
.Fa dv
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
.Fa rem
may be
.Dv NULL ,
in which case the respective value is not returned.
339
340
341
342
343
344
345





346
347
348
349
350
351
352
computes
.Fa a
to the
.Fa p Ns -th
power modulo
.Fa m
.Pq Li r=(a^p)%m .





This function uses less time and space than
.Fn BN_exp .
.Pp
.Fn BN_gcd
computes the greatest common divisor of
.Fa a
and







>
>
>
>
>







353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
computes
.Fa a
to the
.Fa p Ns -th
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
.Fn BN_gcd
computes the greatest common divisor of
.Fa a
and
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419




























.Fn BN_sqr ,
.Fn BN_div ,
.Fn BN_mod ,
.Fn BN_mod_mul ,
.Fn BN_mod_exp ,
and
.Fn BN_gcd
appeared before SSLeay 0.8.
.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.1 and
.Ox 2.6 .
.Pp
.Fn BN_nnmod ,
.Fn BN_mod_add ,
.Fn BN_mod_sub ,
and
.Fn BN_mod_sqr
first appeared in OpenSSL 0.9.7 and have been available since
.Ox 3.2 .



































|



















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
.Fn BN_sqr ,
.Fn BN_div ,
.Fn BN_mod ,
.Fn BN_mod_mul ,
.Fn BN_mod_exp ,
and
.Fn BN_gcd
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.1 and
.Ox 2.6 .
.Pp
.Fn BN_nnmod ,
.Fn BN_mod_add ,
.Fn BN_mod_sub ,
and
.Fn BN_mod_sqr
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.
Changes to jni/libressl/man/BN_add_word.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_add_word.3,v 1.7 2018/03/21 06:26:31 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt BN_ADD_WORD 3
.Os
.Sh NAME
.Nm BN_add_word ,
.Nm BN_sub_word ,
.Nm BN_mul_word ,
.Nm BN_div_word ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BN_ADD_WORD 3
.Os
.Sh NAME
.Nm BN_add_word ,
.Nm BN_sub_word ,
.Nm BN_mul_word ,
.Nm BN_div_word ,
151
152
153
154
155
156
157
158

159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
.Po Vt BN_ULONG Pc Ns -1
if an error occurred.
.Sh SEE ALSO
.Xr BN_add 3 ,
.Xr BN_new 3 ,
.Xr ERR_get_error 3
.Sh HISTORY
.Fn BN_add_word

and
.Fn BN_mod_word
appeared before SSLeay 0.8.
.Fn BN_div_word
first appeared in SSLeay 0.8.
.Fn BN_sub_word
and
.Fn BN_mul_word
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
and
.Fn BN_mod_word
in case of an error was 0.







|
>


<
<
|












151
152
153
154
155
156
157
158
159
160
161


162
163
164
165
166
167
168
169
170
171
172
173
174
.Po Vt BN_ULONG Pc Ns -1
if an error occurred.
.Sh SEE ALSO
.Xr BN_add 3 ,
.Xr BN_new 3 ,
.Xr ERR_get_error 3
.Sh HISTORY
.Fn BN_add_word ,
.Fn BN_div_word ,
and
.Fn BN_mod_word


first appeared in SSLeay 0.5.1.
.Fn BN_sub_word
and
.Fn BN_mul_word
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
and
.Fn BN_mod_word
in case of an error was 0.
Changes to jni/libressl/man/BN_bn2bin.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_bn2bin.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 Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 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
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_bn2bin.3,v 1.11 2018/03/27 17:35:50 schwarze Exp $
.\"	OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BN_BN2BIN 3
.Os
.Sh NAME
.Nm BN_bn2bin ,
.Nm BN_bin2bn ,
.Nm BN_bn2hex ,
.Nm BN_bn2dec ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BN_BN2BIN 3
.Os
.Sh NAME
.Nm BN_bn2bin ,
.Nm BN_bin2bn ,
.Nm BN_bn2hex ,
.Nm BN_bn2dec ,
297
298
299
300
301
302
303
304
305


306
307
308
309
310
311
312
313
314
.Xr BN_new 3 ,
.Xr BN_num_bytes 3 ,
.Xr BN_zero 3 ,
.Xr ERR_get_error 3
.Sh HISTORY
.Fn BN_bn2bin ,
.Fn BN_bin2bn ,
.Fn BN_print ,
and


.Fn BN_print_fp
appeared before SSLeay 0.8.
.Fn BN_bn2hex ,
.Fn BN_bn2dec ,
.Fn BN_hex2bn ,
.Fn BN_dec2bn ,
.Fn BN_bn2mpi ,
and
.Fn BN_mpi2bn







<

>
>

|







297
298
299
300
301
302
303

304
305
306
307
308
309
310
311
312
313
314
315
.Xr BN_new 3 ,
.Xr BN_num_bytes 3 ,
.Xr BN_zero 3 ,
.Xr ERR_get_error 3
.Sh HISTORY
.Fn BN_bn2bin ,
.Fn BN_bin2bn ,

and
.Fn BN_print
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 ,
.Fn BN_dec2bn ,
.Fn BN_bn2mpi ,
and
.Fn BN_mpi2bn
Changes to jni/libressl/man/BN_cmp.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_cmp.3,v 1.5 2018/03/20 20:26:23 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt BN_CMP 3
.Os
.Sh NAME
.Nm BN_cmp ,
.Nm BN_ucmp ,
.Nm BN_is_zero ,
.Nm BN_is_one ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BN_CMP 3
.Os
.Sh NAME
.Nm BN_cmp ,
.Nm BN_ucmp ,
.Nm BN_is_zero ,
.Nm BN_is_one ,
140
141
142
143
144
145
146
147
148
149
150
151
.Sh HISTORY
.Fn BN_cmp ,
.Fn BN_ucmp ,
.Fn BN_is_zero ,
.Fn BN_is_one ,
and
.Fn BN_is_word
appeared before SSLeay 0.8.
.Fn BN_is_odd
first appeared in SSLeay 0.8.
All these functions have been available since
.Ox 2.4 .







|

|


140
141
142
143
144
145
146
147
148
149
150
151
.Sh HISTORY
.Fn BN_cmp ,
.Fn BN_ucmp ,
.Fn BN_is_zero ,
.Fn BN_is_one ,
and
.Fn BN_is_word
first appeared in SSLeay 0.5.1.
.Fn BN_is_odd
first appeared in SSLeay 0.8.0.
All these functions have been available since
.Ox 2.4 .
Changes to jni/libressl/man/BN_copy.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_copy.3,v 1.8 2018/03/22 22:07:12 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>
.\" and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>
.\" and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 22 2018 $
.Dt BN_COPY 3
.Os
.Sh NAME
.Nm BN_copy ,
.Nm BN_dup ,
.Nm BN_with_flags
.Nd copy BIGNUMs







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 BN_COPY 3
.Os
.Sh NAME
.Nm BN_copy ,
.Nm BN_dup ,
.Nm BN_with_flags
.Nd copy BIGNUMs
152
153
154
155
156
157
158
159
160
161
162
163

164
.Sh SEE ALSO
.Xr BN_new 3 ,
.Xr BN_set_flags 3
.Sh HISTORY
.Fn BN_copy
and
.Fn BN_dup
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Pp
.Fn BN_with_flags
first appeared in OpenSSL 0.9.7h and has been available since

.Ox 4.0 .







|



|
>

152
153
154
155
156
157
158
159
160
161
162
163
164
165
.Sh SEE ALSO
.Xr BN_new 3 ,
.Xr BN_set_flags 3
.Sh HISTORY
.Fn BN_copy
and
.Fn BN_dup
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 .
Changes to jni/libressl/man/BN_generate_prime.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: BN_generate_prime.3,v 1.13 2018/03/23 23:18:17 schwarze Exp $
.\" full merge up to: OpenSSL b3696a55 Sep 2 09:35:50 2017 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>
.\" Bodo Moeller <bodo@openssl.org>, and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2003, 2013, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $OpenBSD: BN_generate_prime.3,v 1.14 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 Ulf Moeller <ulf@openssl.org>
.\" Bodo Moeller <bodo@openssl.org>, and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2003, 2013, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 BN_GENERATE_PRIME 3
.Os
.Sh NAME
.Nm BN_generate_prime_ex ,
.Nm BN_is_prime_ex ,
.Nm BN_is_prime_fasttest_ex ,
.Nm BN_GENCB_call ,







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 BN_GENERATE_PRIME 3
.Os
.Sh NAME
.Nm BN_generate_prime_ex ,
.Nm BN_is_prime_ex ,
.Nm BN_is_prime_fasttest_ex ,
.Nm BN_GENCB_call ,
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
.Xr BN_new 3 ,
.Xr ERR_get_error 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn BN_generate_prime
and
.Fn BN_is_prime
appeared before SSLeay 0.8 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







|







375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
.Xr BN_new 3 ,
.Xr ERR_get_error 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn BN_generate_prime
and
.Fn BN_is_prime
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
Changes to jni/libressl/man/BN_mod_inverse.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_mod_inverse.3,v 1.8 2018/03/21 09:03:49 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt BN_MOD_INVERSE 3
.Os
.Sh NAME
.Nm BN_mod_inverse
.Nd compute inverse modulo n
.Sh SYNOPSIS
.In openssl/bn.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 29 2018 $
.Dt BN_MOD_INVERSE 3
.Os
.Sh NAME
.Nm BN_mod_inverse
.Nd compute inverse modulo n
.Sh SYNOPSIS
.In openssl/bn.h
76
77
78
79
80
81
82








83
84
85
86
87
88
89
.Fa r
is
.Dv NULL ,
a new
.Vt BIGNUM
is created.
.Pp








.Fa ctx
is a previously allocated
.Vt BN_CTX
used for temporary variables.
.Fa r
may be the same
.Vt BIGNUM







>
>
>
>
>
>
>
>







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.Fa r
is
.Dv NULL ,
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
used for temporary variables.
.Fa r
may be the same
.Vt BIGNUM
102
103
104
105
106
107
108
109
110
111
112
113
114
115
.Xr ERR_get_error 3 .
.Sh SEE ALSO
.Xr BN_add 3 ,
.Xr BN_new 3 ,
.Xr BN_set_flags 3
.Sh HISTORY
.Fn BN_mod_inverse
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .
.Pp
The
.Fa r
argument was added in SSLeay 0.9.1 and
.Ox 2.6 .







|






110
111
112
113
114
115
116
117
118
119
120
121
122
123
.Xr ERR_get_error 3 .
.Sh SEE ALSO
.Xr BN_add 3 ,
.Xr BN_new 3 ,
.Xr BN_set_flags 3
.Sh HISTORY
.Fn BN_mod_inverse
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 .
Changes to jni/libressl/man/BN_mod_mul_montgomery.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_mod_mul_montgomery.3,v 1.10 2018/03/23 23:18:17 schwarze Exp $
.\"	OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BN_MOD_MUL_MONTGOMERY 3
.Os
.Sh NAME
.Nm BN_MONT_CTX_new ,
.Nm BN_MONT_CTX_init ,
.Nm BN_MONT_CTX_free ,
.Nm BN_MONT_CTX_set ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BN_MOD_MUL_MONTGOMERY 3
.Os
.Sh NAME
.Nm BN_MONT_CTX_new ,
.Nm BN_MONT_CTX_init ,
.Nm BN_MONT_CTX_free ,
.Nm BN_MONT_CTX_set ,
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
.Fn BN_MONT_CTX_new ,
.Fn BN_MONT_CTX_free ,
.Fn BN_MONT_CTX_set ,
.Fn BN_mod_mul_montgomery ,
.Fn BN_from_montgomery ,
and
.Fn BN_to_montgomery
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Pp
.Fn BN_MONT_CTX_init
and
.Fn BN_MONT_CTX_copy
first appeared in SSLeay 0.9.1 and have been available since
.Ox 2.6 .







|







221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
.Fn BN_MONT_CTX_new ,
.Fn BN_MONT_CTX_free ,
.Fn BN_MONT_CTX_set ,
.Fn BN_mod_mul_montgomery ,
.Fn BN_from_montgomery ,
and
.Fn BN_to_montgomery
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
first appeared in SSLeay 0.9.1 and have been available since
.Ox 2.6 .
Changes to jni/libressl/man/BN_mod_mul_reciprocal.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_mod_mul_reciprocal.3,v 1.9 2018/03/21 09:03:49 schwarze Exp $
.\"	OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt BN_MOD_MUL_RECIPROCAL 3
.Os
.Sh NAME
.Nm BN_mod_mul_reciprocal ,
.Nm BN_RECP_CTX_new ,
.Nm BN_RECP_CTX_init ,
.Nm BN_RECP_CTX_free ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BN_MOD_MUL_RECIPROCAL 3
.Os
.Sh NAME
.Nm BN_mod_mul_reciprocal ,
.Nm BN_RECP_CTX_new ,
.Nm BN_RECP_CTX_init ,
.Nm BN_RECP_CTX_free ,
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
.Xr ERR_get_error 3 .
.Sh SEE ALSO
.Xr BN_add 3 ,
.Xr BN_CTX_new 3 ,
.Xr BN_new 3
.Sh HISTORY
.Fn BN_mod_mul_reciprocal
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .
.Pp
.Vt BN_RECP_CTX
was added in SSLeay 0.9.0.
Before that, a function
.Fn BN_reciprocal
was used instead, and the







|







187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
.Xr ERR_get_error 3 .
.Sh SEE ALSO
.Xr BN_add 3 ,
.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
.Fn BN_reciprocal
was used instead, and the
Changes to jni/libressl/man/BN_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: BN_new.3,v 1.12 2018/03/21 09:03:49 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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2004 The OpenSSL Project.  All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2004 The OpenSSL Project.  All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 2018 $
.Dt BN_NEW 3
.Os
.Sh NAME
.Nm BN_new ,
.Nm BN_init ,
.Nm BN_clear ,
.Nm BN_free ,







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 29 2018 $
.Dt BN_NEW 3
.Os
.Sh NAME
.Nm BN_new ,
.Nm BN_init ,
.Nm BN_clear ,
.Nm BN_free ,
98
99
100
101
102
103
104
105




106
107
108
109
110
111
112
It is used to hold a single large integer.
This type should be considered opaque and fields should not be modified
or accessed directly.
.Pp
.Fn BN_new
allocates and initializes a
.Vt BIGNUM
structure, in particular setting the value to zero.




.Pp
.Fn BN_init
initializes an existing uninitialized
.Vt BIGNUM .
It is deprecated and dangerous: see
.Sx CAVEATS .
.Pp







|
>
>
>
>







98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
It is used to hold a single large integer.
This type should be considered opaque and fields should not be modified
or accessed directly.
.Pp
.Fn BN_new
allocates and initializes a
.Vt BIGNUM
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
.Vt BIGNUM .
It is deprecated and dangerous: see
.Sx CAVEATS .
.Pp
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
.Xr BN_zero 3
.Sh HISTORY
.Fn BN_new ,
.Fn BN_clear ,
.Fn BN_free ,
and
.Fn BN_clear_free
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Pp
.Fn BN_init
first appeared in SSLeay 0.9.1 and has been available since
.Ox 2.6 .
.Sh CAVEATS
.Fn BN_init







|







166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
.Xr BN_zero 3
.Sh HISTORY
.Fn BN_new ,
.Fn BN_clear ,
.Fn BN_free ,
and
.Fn BN_clear_free
first appeared in SSLeay 0.5.1 and have been available since
.Ox 2.4 .
.Pp
.Fn BN_init
first appeared in SSLeay 0.9.1 and has been available since
.Ox 2.6 .
.Sh CAVEATS
.Fn BN_init
Changes to jni/libressl/man/BN_num_bytes.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_num_bytes.3,v 1.6 2018/03/20 20:26:23 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>
.\" and Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000, 2004 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>
.\" and Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000, 2004 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 20 2018 $
.Dt BN_NUM_BYTES 3
.Os
.Sh NAME
.Nm BN_num_bytes ,
.Nm BN_num_bits ,
.Nm BN_num_bits_word
.Nd get BIGNUM size







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 BN_NUM_BYTES 3
.Os
.Sh NAME
.Nm BN_num_bytes ,
.Nm BN_num_bits ,
.Nm BN_num_bits_word
.Nd get BIGNUM size
116
117
118
119
120
121
122






123
124
The size.
.Sh SEE ALSO
.Xr BN_new 3 ,
.Xr DH_size 3 ,
.Xr DSA_size 3 ,
.Xr RSA_size 3
.Sh HISTORY






These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







>
>
>
>
>
>
|

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
The size.
.Sh SEE ALSO
.Xr BN_new 3 ,
.Xr DH_size 3 ,
.Xr DSA_size 3 ,
.Xr RSA_size 3
.Sh HISTORY
.Fn BN_num_bytes
and
.Fn BN_num_bits
first appeared in SSLeay 0.5.1.
.Fn BN_num_bits_word
first appeared in SSLeay 0.5.2.
These functions have been available since
.Ox 2.4 .
Changes to jni/libressl/man/BN_rand.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_rand.3,v 1.10 2018/03/22 17:38:08 schwarze Exp $
.\"	OpenSSL 05ea606a May 20 20:52:46 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2013, 2015 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_rand.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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2013, 2015 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 22 2018 $
.Dt BN_RAND 3
.Os
.Sh NAME
.Nm BN_rand ,
.Nm BN_pseudo_rand ,
.Nm BN_rand_range ,
.Nm BN_pseudo_rand_range







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 BN_RAND 3
.Os
.Sh NAME
.Nm BN_rand ,
.Nm BN_pseudo_rand ,
.Nm BN_rand_range ,
.Nm BN_pseudo_rand_range
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
.Sh SEE ALSO
.Xr BN_new 3 ,
.Xr ERR_get_error 3 ,
.Xr RAND_add 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn BN_rand
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .
.Pp
.Fn BN_pseudo_rand
first appeared in OpenSSL 0.9.5 and has been available since
.Ox 2.7 .
.Pp
The







|







135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
.Sh SEE ALSO
.Xr BN_new 3 ,
.Xr ERR_get_error 3 ,
.Xr RAND_add 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn BN_rand
first appeared in SSLeay 0.5.1 and has been available since
.Ox 2.4 .
.Pp
.Fn BN_pseudo_rand
first appeared in OpenSSL 0.9.5 and has been available since
.Ox 2.7 .
.Pp
The
Changes to jni/libressl/man/BN_set_bit.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BN_set_bit.3,v 1.6 2018/03/20 20:26:23 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt BN_SET_BIT 3
.Os
.Sh NAME
.Nm BN_set_bit ,
.Nm BN_clear_bit ,
.Nm BN_is_bit_set ,
.Nm BN_mask_bits ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 BN_SET_BIT 3
.Os
.Sh NAME
.Nm BN_set_bit ,
.Nm BN_clear_bit ,
.Nm BN_is_bit_set ,
.Nm BN_mask_bits ,
208
209
210
211
212
213
214
215
216
.Fn BN_is_bit_set ,
.Fn BN_mask_bits ,
.Fn BN_lshift ,
.Fn BN_lshift1 ,
.Fn BN_rshift ,
and
.Fn BN_rshift1
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

208
209
210
211
212
213
214
215
216
.Fn BN_is_bit_set ,
.Fn BN_mask_bits ,
.Fn BN_lshift ,
.Fn BN_lshift1 ,
.Fn BN_rshift ,
and
.Fn BN_rshift1
first appeared in SSLeay 0.5.1 and have been available since
.Ox 2.4 .
Changes to jni/libressl/man/BN_set_flags.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: BN_set_flags.3,v 1.2 2018/03/21 09:03:49 schwarze Exp $
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 BN_SET_FLAGS 3
.Os
.Sh NAME
.Nm BN_set_flags ,
.Nm BN_get_flags
.Nd enable and inspect flags on BIGNUM objects
.Sh SYNOPSIS
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: BN_set_flags.3,v 1.3 2018/04/29 15:58:21 schwarze Exp $
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 29 2018 $
.Dt BN_SET_FLAGS 3
.Os
.Sh NAME
.Nm BN_set_flags ,
.Nm BN_get_flags
.Nd enable and inspect flags on BIGNUM objects
.Sh SYNOPSIS
43
44
45
46
47
48
49


50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.Fa flags
argument can contain zero or more of the following constants OR'ed
together:
.Bl -tag -width Ds
.It Dv BN_FLG_CONSTTIME
If this flag is set on the divident
.Fa a


in
.Xr BN_div 3 ,
on the exponent
.Fa p
in
.Xr BN_mod_exp 3 ,
or on the divisor
.Fa a
or the modulus
.Fa n
in
.Xr BN_mod_inverse 3 ,
these functions prefer algorithms with an execution time independent
of the respective numbers, to avoid exposing sensitive information
to timing 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.
.It Dv BN_FLG_MALLOCED
If this flag is set,
.Xr BN_free 3
and
.Xr BN_clear_free 3
will not only clear and free the components of
.Fa b ,







>
>












|

|

|
|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71













72
73
74
75
76
77
78
.Fa flags
argument can contain zero or more of the following constants OR'ed
together:
.Bl -tag -width Ds
.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
.Fa p
in
.Xr BN_mod_exp 3 ,
or on the divisor
.Fa a
or the modulus
.Fa n
in
.Xr BN_mod_inverse 3 ,
these functions select algorithms with an execution time independent
of the respective numbers, to avoid exposing sensitive information
to timing side-channel attacks.
.Pp
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
and
.Xr BN_clear_free 3
will not only clear and free the components of
.Fa b ,
144
145
146
147
148
149
150




























.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 .



































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
.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.
Changes to jni/libressl/man/BN_zero.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: BN_zero.3,v 1.8 2018/03/20 20:26:23 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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2018 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2018 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 20 2018 $
.Dt BN_ZERO 3
.Os
.Sh NAME
.Nm BN_zero ,
.Nm BN_one ,
.Nm BN_value_one ,
.Nm BN_set_word ,







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 BN_ZERO 3
.Os
.Sh NAME
.Nm BN_zero ,
.Nm BN_one ,
.Nm BN_value_one ,
.Nm BN_set_word ,
127
128
129
130
131
132
133

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.Xr BN_bn2bin 3 ,
.Xr BN_new 3 ,
.Xr BN_set_bit 3 ,
.Xr BN_set_negative 3
.Sh HISTORY
.Fn BN_zero ,
.Fn BN_one ,

and
.Fn BN_set_word
appeared before SSLeay 0.8.
.Fn BN_value_one
and
.Fn BN_get_word
first appeared in SSLeay 0.8.
All these functions have been available since
.Ox 2.4 .
.Pp
.Fn BN_value_one
was changed to return a true
.Vt const BIGNUM *
in OpenSSL 0.9.7.
.Sh BUGS
Someone might change the constant.
.Pp
If the value of a
.Vt BIGNUM
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.







>


|
<
<

|


<
<
<
<
<













127
128
129
130
131
132
133
134
135
136
137


138
139
140
141





142
143
144
145
146
147
148
149
150
151
152
153
154
.Xr BN_bn2bin 3 ,
.Xr BN_new 3 ,
.Xr BN_set_bit 3 ,
.Xr BN_set_negative 3
.Sh HISTORY
.Fn BN_zero ,
.Fn BN_one ,
.Fn BN_value_one ,
and
.Fn BN_set_word
first appeared in SSLeay 0.5.1.


.Fn BN_get_word
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 the value of a
.Vt BIGNUM
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.
Changes to jni/libressl/man/BUF_MEM_new.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: BUF_MEM_new.3,v 1.14 2018/03/23 04:34:23 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
.\"	not merged: c952780c, 91da5e77
.\"	OpenSSL doc/man3/BUF_MEM_new.pod 498180de Dec 12 15:35:09 2016 +0300
.\"
.\" This file was written by Ralf S. Engelschall <rse@openssl.org>.
|







1
2
3
4
5
6
7
8
.\"	$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
.\"	not merged: c952780c, 91da5e77
.\"	OpenSSL doc/man3/BUF_MEM_new.pod 498180de Dec 12 15:35:09 2016 +0300
.\"
.\" This file was written by Ralf S. Engelschall <rse@openssl.org>.
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.\" 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 BUF_MEM_NEW 3
.Os
.Sh NAME
.Nm BUF_MEM_new ,
.Nm BUF_MEM_free ,
.Nm BUF_MEM_grow ,
.Nm BUF_MEM_grow_clean ,







|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.\" 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 BUF_MEM_NEW 3
.Os
.Sh NAME
.Nm BUF_MEM_new ,
.Nm BUF_MEM_free ,
.Nm BUF_MEM_grow ,
.Nm BUF_MEM_grow_clean ,
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
.Sh SEE ALSO
.Xr BIO_new 3
.Sh HISTORY
.Fn BUF_MEM_new ,
.Fn BUF_MEM_free ,
and
.Fn BUF_MEM_grow
appeared before SSLeay 0.8.
.Fn BUF_strdup
first appeared in SSLeay 0.8.
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 .







|

|










186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
.Sh SEE ALSO
.Xr BIO_new 3
.Sh HISTORY
.Fn BUF_MEM_new ,
.Fn BUF_MEM_free ,
and
.Fn BUF_MEM_grow
first appeared in SSLeay 0.6.0.
.Fn BUF_strdup
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 .
Changes to jni/libressl/man/CRYPTO_get_mem_functions.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: CRYPTO_get_mem_functions.3,v 1.4 2018/03/20 21:27:32 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 20 2018 $
.Dt CRYPTO_GET_MEM_FUNCTIONS 3
.Os
.Sh NAME
.Nm CRYPTO_get_mem_functions ,
.Nm CRYPTO_set_mem_functions ,
.Nm CRYPTO_mem_ctrl ,
.Nm CRYPTO_mem_leaks ,
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: CRYPTO_get_mem_functions.3,v 1.6 2018/08/24 19:17:38 tb Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 CRYPTO_GET_MEM_FUNCTIONS 3
.Os
.Sh NAME
.Nm CRYPTO_get_mem_functions ,
.Nm CRYPTO_set_mem_functions ,
.Nm CRYPTO_mem_ctrl ,
.Nm CRYPTO_mem_leaks ,
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.Fa "void *(*r)(void *, size_t)"
.Fa "void (*f)(void *)"
.Fc
.Ft int
.Fo CRYPTO_mem_ctrl
.Fa "int mode"
.Fc
.Ft void
.Fo CRYPTO_mem_leaks
.Fa "BIO *b"
.Fc
.Ft void
.Fo CRYPTO_mem_leaks_fp
.Fa "FILE *fp"
.Fc
.Ft typedef void *
.Fo CRYPTO_MEM_LEAK_CB
.Fa "unsigned long"
.Fa "const char *"
.Fa int
.Fa int
.Fa "void *"
.Fc
.Ft void
.Fo CRYPTO_mem_leaks_cb
.Fa "CRYPTO_MEM_LEAK_CB *cb"
.Fc
.Sh DESCRIPTION
Do not use any of the interfaces documented here.
They are provided purely for compatibility with legacy application code.
.Pp







|



|



|







|







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.Fa "void *(*r)(void *, size_t)"
.Fa "void (*f)(void *)"
.Fc
.Ft int
.Fo CRYPTO_mem_ctrl
.Fa "int mode"
.Fc
.Ft int
.Fo CRYPTO_mem_leaks
.Fa "BIO *b"
.Fc
.Ft int
.Fo CRYPTO_mem_leaks_fp
.Fa "FILE *fp"
.Fc
.Ft typedef int *
.Fo CRYPTO_MEM_LEAK_CB
.Fa "unsigned long"
.Fa "const char *"
.Fa int
.Fa int
.Fa "void *"
.Fc
.Ft int
.Fo CRYPTO_mem_leaks_cb
.Fa "CRYPTO_MEM_LEAK_CB *cb"
.Fc
.Sh DESCRIPTION
Do not use any of the interfaces documented here.
They are provided purely for compatibility with legacy application code.
.Pp
86
87
88
89
90
91
92






93




94






95
96
.Sh RETURN VALUES
.Fn CRYPTO_set_mem_functions
always returns 0.
.Pp
.Fn CRYPTO_mem_ctrl
always returns
.Dv CRYPTO_MEM_CHECK_OFF .






.Sh HISTORY




These functions appeared in SSLeay 0.8.1b or earlier






and have been available since
.Ox 2.4 .







>
>
>
>
>
>

>
>
>
>
|
>
>
>
>
>
>
|

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
.Sh RETURN VALUES
.Fn CRYPTO_set_mem_functions
always returns 0.
.Pp
.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 .
Changes to jni/libressl/man/CRYPTO_set_ex_data.3.
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.\"	$OpenBSD: CRYPTO_set_ex_data.3,v 1.9 2018/03/22 16:06:33 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 <steve@openssl.org>.
.\" 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
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>
.\" and by Rich Salz <rsalz@akamai.com>.
.\" Copyright (c) 2000, 2006, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|
>
|
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1
2
3






4









































5
6
7
8
9
10
11
.\" $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 <steve@openssl.org>
.\" and by Rich Salz <rsalz@akamai.com>.
.\" Copyright (c) 2000, 2006, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.\" 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 22 2018 $
.Dt CRYPTO_SET_EX_DATA 3
.Os
.Sh NAME
.Nm CRYPTO_EX_new ,
.Nm CRYPTO_EX_free ,
.Nm CRYPTO_EX_dup ,
.Nm CRYPTO_get_ex_new_index ,







|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.\" 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 8 2018 $
.Dt CRYPTO_SET_EX_DATA 3
.Os
.Sh NAME
.Nm CRYPTO_EX_new ,
.Nm CRYPTO_EX_free ,
.Nm CRYPTO_EX_dup ,
.Nm CRYPTO_get_ex_new_index ,
173
174
175
176
177
178
179







180
181
182

183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
.Fa "CRYPTO_EX_DATA *r"
.Fc
.Sh DESCRIPTION
Several OpenSSL structures can have application specific data attached
to them, known as "exdata".
The specific structures are:
.Bd -literal







    SSL
    SSL_CTX
    SSL_SESSION

    X509
    X509_STORE
    X509_STORE_CTX
    DH
    DSA
    RSA
    ENGINE
    UI
    BIO
.Ed
.Pp
Each is identified by a
.Dv CRYPTO_EX_INDEX_*
constant defined in the
.In openssl/crypto.h
header file.







>
>
>
>
>
>
>



>



<
<
<
<
<
<







127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147






148
149
150
151
152
153
154
.Fa "CRYPTO_EX_DATA *r"
.Fc
.Sh DESCRIPTION
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






.Ed
.Pp
Each is identified by a
.Dv CRYPTO_EX_INDEX_*
constant defined in the
.In openssl/crypto.h
header file.
Changes to jni/libressl/man/CRYPTO_set_locking_callback.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: CRYPTO_set_locking_callback.3,v 1.9 2018/03/23 04:34:23 schwarze Exp $
.\"	OpenSSL doc/crypto/threads.pod fb552ac6 Sep 30 23:43:01 2009 +0000
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>,
.\" Richard Levitte <levitte@openssl.org>, Bodo Moeller <bodo@openssl.org>,
.\" and Geoff Thorpe <geoff@openssl.org>.
.\" Copyright (c) 2000, 2001, 2005, 2006, 2008, 2009 The OpenSSL Project.
.\" All rights reserved.
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: CRYPTO_set_locking_callback.3,v 1.10 2018/03/27 17:35:50 schwarze Exp $
.\"	OpenSSL doc/crypto/threads.pod fb552ac6 Sep 30 23:43:01 2009 +0000
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>,
.\" Richard Levitte <levitte@openssl.org>, Bodo Moeller <bodo@openssl.org>,
.\" and Geoff Thorpe <geoff@openssl.org>.
.\" Copyright (c) 2000, 2001, 2005, 2006, 2008, 2009 The OpenSSL Project.
.\" All rights reserved.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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 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 ,







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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 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 ,
365
366
367
368
369
370
371
372
373


374

375
376
377
378
379
380
381
382
.Xr crypto 3
.Sh HISTORY
.Fn CRYPTO_set_locking_callback ,
.Fn CRYPTO_lock ,
.Fn CRYPTO_w_lock ,
.Fn CRYPTO_w_unlock ,
.Fn CRYPTO_r_lock ,
.Fn CRYPTO_r_unlock ,
and


.Fn CRYPTO_add

appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
.Fn CRYPTO_num_locks
first appeared in OpenSSL 0.9.4 and have been available since
.Ox 2.6 .
.Pp
.Fn CRYPTO_set_dynlock_create_callback ,







<

>
>

>
|







365
366
367
368
369
370
371

372
373
374
375
376
377
378
379
380
381
382
383
384
.Xr crypto 3
.Sh HISTORY
.Fn CRYPTO_set_locking_callback ,
.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_num_locks
first appeared in OpenSSL 0.9.4 and have been available since
.Ox 2.6 .
.Pp
.Fn CRYPTO_set_dynlock_create_callback ,
Changes to jni/libressl/man/DES_set_key.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: DES_set_key.3,v 1.11 2018/03/22 21:08:22 schwarze Exp $
.\" full merge up to:
.\" OpenSSL man3/DES_random_key 61f805c1 Jan 16 01:01:46 2018 +0800
.\"
.\" --------------------------------------------------------------------------
.\" Major patches to this file were contributed by
.\" Ulf Moeller <ulf@openssl.org>, Ben Laurie <ben@openssl.org>,
.\" and Richard Levitte <levitte@openssl.org>.
|







1
2
3
4
5
6
7
8
.\" $OpenBSD: DES_set_key.3,v 1.12 2018/03/27 17:35:50 schwarze Exp $
.\" full merge up to:
.\" OpenSSL man3/DES_random_key 61f805c1 Jan 16 01:01:46 2018 +0800
.\"
.\" --------------------------------------------------------------------------
.\" Major patches to this file were contributed by
.\" Ulf Moeller <ulf@openssl.org>, Ben Laurie <ben@openssl.org>,
.\" and Richard Levitte <levitte@openssl.org>.
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
.\" 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.]
.\"
.Dd $Mdocdate: March 22 2018 $
.Dt DES_SET_KEY 3
.Os
.Sh NAME
.Nm DES_random_key ,
.Nm DES_set_key ,
.Nm DES_key_sched ,
.Nm DES_set_key_checked ,







|







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
.\" 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.]
.\"
.Dd $Mdocdate: March 27 2018 $
.Dt DES_SET_KEY 3
.Os
.Sh NAME
.Nm DES_random_key ,
.Nm DES_set_key ,
.Nm DES_key_sched ,
.Nm DES_set_key_checked ,
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820


821













822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
library provides higher-level encryption functions.
.Sh STANDARDS
ANSI X3.106
.Pp
The DES library was initially written to be source code compatible
with the MIT Kerberos library.
.Sh HISTORY
Versions of
.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_ecb2_encrypt ,
.Fn DES_ecb3_encrypt ,
.Fn DES_ncbc_encrypt ,
.Fn DES_cfb_encrypt ,
.Fn DES_ofb_encrypt ,
.Fn DES_pcbc_encrypt ,
.Fn DES_cfb64_encrypt ,
.Fn DES_ofb64_encrypt ,
.Fn DES_xcbc_encrypt ,
.Fn DES_ede2_cbc_encrypt ,
.Fn DES_ede2_cfb64_encrypt ,
.Fn DES_ede2_ofb64_encrypt ,
.Fn DES_ede3_cbc_encrypt ,
.Fn DES_ede3_cfb64_encrypt ,
.Fn DES_ede3_ofb64_encrypt ,
.Fn DES_cbc_cksum ,
.Fn DES_quad_cksum ,
.Fn DES_string_to_key ,
.Fn DES_string_to_2keys ,
.Fn DES_fcrypt ,
.Fn DES_crypt ,
.Fn DES_enc_read ,
and
.Fn DES_enc_write
with lower case names starting with


.Sy des_













appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
Versions of
.Fn DES_set_key_checked
and
.Fn DES_set_key_unchecked
with lower case names starting with
.Sy des_
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_







<






<
<
<





<
<
<
<

<
<




<




|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|


<



<
<







782
783
784
785
786
787
788

789
790
791
792
793
794



795
796
797
798
799




800


801
802
803
804

805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828

829
830
831


832
833
834
835
836
837
838
library provides higher-level encryption functions.
.Sh STANDARDS
ANSI X3.106
.Pp
The DES library was initially written to be source code compatible
with the MIT Kerberos library.
.Sh HISTORY

.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


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_
Changes to jni/libressl/man/DH_generate_key.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DH_generate_key.3,v 1.8 2018/03/20 22:22:10 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt DH_GENERATE_KEY 3
.Os
.Sh NAME
.Nm DH_generate_key ,
.Nm DH_compute_key
.Nd perform Diffie-Hellman key exchange
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 DH_GENERATE_KEY 3
.Os
.Sh NAME
.Nm DH_generate_key ,
.Nm DH_compute_key
.Nd perform Diffie-Hellman key exchange
.Sh SYNOPSIS
115
116
117
118
119
120
121
122
123
.Xr DH_size 3 ,
.Xr ERR_get_error 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn DH_generate_key
and
.Fn DH_compute_key
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .







|

115
116
117
118
119
120
121
122
123
.Xr DH_size 3 ,
.Xr ERR_get_error 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn DH_generate_key
and
.Fn DH_compute_key
first appeared in SSLeay 0.5.1 and have been available since
.Ox 2.4 .
Changes to jni/libressl/man/DH_generate_parameters.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DH_generate_parameters.3,v 1.10 2018/03/23 23:18:17 schwarze Exp $
.\"	OpenSSL 05ea606a May 20 20:52:46 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 DH_GENERATE_PARAMETERS 3
.Os
.Sh NAME
.Nm DH_generate_parameters_ex ,
.Nm DH_check ,
.Nm DH_generate_parameters
.Nd generate and check Diffie-Hellman parameters







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 DH_GENERATE_PARAMETERS 3
.Os
.Sh NAME
.Nm DH_generate_parameters_ex ,
.Nm DH_check ,
.Nm DH_generate_parameters
.Nd generate and check Diffie-Hellman parameters
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
.Xr DH_new 3 ,
.Xr ERR_get_error 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn DH_check
and
.Fn DH_generate_parameters
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
The
.Fa cb_arg
argument to
.Fn DH_generate_parameters
was added in SSLeay 0.9.0.







|







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
.Xr DH_new 3 ,
.Xr ERR_get_error 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn DH_check
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
.Fn DH_generate_parameters
was added in SSLeay 0.9.0.
Changes to jni/libressl/man/DH_new.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DH_new.3,v 1.6 2018/03/20 22:22:10 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55

56
57
58
59
60
61




62
63
64
65
66
67
68
69
70
71
72





73



74

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110




.\" 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 20 2018 $
.Dt DH_NEW 3
.Os
.Sh NAME
.Nm DH_new ,

.Nm DH_free
.Nd allocate and free DH objects
.Sh SYNOPSIS
.In openssl/dh.h
.Ft DH*
.Fn DH_new void




.Ft void
.Fo DH_free
.Fa "DH *dh"
.Fc
.Sh DESCRIPTION
The DH functions implement the Diffie-Hellman key agreement protocol.
.Pp
.Fn DH_new
allocates and initializes a
.Vt DH
structure.





.Pp



.Fn DH_free

frees the
.Vt DH
structure and its components.
The values are erased before the memory is returned to the system.
If
.Fa dh
is a
.Dv NULL
pointer, no action occurs.
.Sh RETURN VALUES
If the allocation fails,
.Fn DH_new
returns
.Dv NULL
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.



.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 EVP_PKEY_set1_DH 3
.Sh HISTORY
.Fn DH_new
and
.Fn DH_free
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .











|




>






>
>
>
>










|
>
>
>
>
>

>
>
>

>
|
















>
>
>

















|

>
>
>
>
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
.\" 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 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"
.Fc
.Sh DESCRIPTION
The DH functions implement the Diffie-Hellman key agreement protocol.
.Pp
.Fn DH_new
allocates and initializes a
.Vt DH
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
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.
If
.Fa dh
is a
.Dv NULL
pointer, no action occurs.
.Sh RETURN VALUES
If the allocation fails,
.Fn DH_new
returns
.Dv NULL
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 EVP_PKEY_set1_DH 3
.Sh HISTORY
.Fn DH_new
and
.Fn DH_free
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 .
Changes to jni/libressl/man/DH_set_method.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DH_set_method.3,v 1.6 2018/03/22 16:06:33 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 2007 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 2007 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt DH_SET_METHOD 3
.Os
.Sh NAME
.Nm DH_set_default_method ,
.Nm DH_get_default_method ,
.Nm DH_set_method ,
.Nm DH_new_method ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 18 2018 $
.Dt DH_SET_METHOD 3
.Os
.Sh NAME
.Nm DH_set_default_method ,
.Nm DH_get_default_method ,
.Nm DH_set_method ,
.Nm DH_new_method ,
80
81
82
83
84
85
86

87
88
89
90
91
92
93
94
95
96
97
98
99



100
101
102
103
104
105
106
107
108
109
110
111


112
113
114

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
.Ft const DH_METHOD *
.Fo DH_OpenSSL
.Fa void
.Fc
.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 .



.Pp
.Fn DH_set_default_method
makes
.Fa meth
the default method for all
.Vt DH
structures created later.
.Sy NB :
This is true only whilst no
.Vt ENGINE
has been set as a default for DH, so this function is no longer
recommended.


.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.
.Pp
.Fn DH_set_method
selects
.Fa meth
to perform all operations using the key
.Fa dh .
This will replace 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.
It is possible to have
.Vt DH
keys that only work with certain
.Vt DH_METHOD
implementations (e.g. from an
.Vt ENGINE
module that supports embedded hardware-protected keys),
and in such cases attempting to change the
.Vt DH_METHOD
for the key can have unexpected results.
.Pp
.Fn DH_new_method
allocates and initializes a
.Vt DH
structure so that
.Fa engine
will be 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
.Fn DH_set_default_method
is used.
.Pp
The
.Vt DH_METHOD
structure is defined as follows:
.Bd -literal







>
|
<
<
<
<
<
<
<
<
<
<
|
|
>
>
>


|

|


|
<

<
|
>
>


|
>
|
<
<
<






|





<
|
|
















|




<
|
|
|
|
<
|







80
81
82
83
84
85
86
87
88










89
90
91
92
93
94
95
96
97
98
99
100
101

102

103
104
105
106
107
108
109
110



111
112
113
114
115
116
117
118
119
120
121
122

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145

146
147
148
149

150
151
152
153
154
155
156
157
.Ft const DH_METHOD *
.Fo DH_OpenSSL
.Fa void
.Fc
.Sh DESCRIPTION
A
.Vt DH_METHOD
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
selects
.Fa meth
as the default method for all
.Vt DH
structures created later.
If any

.Vt ENGINE

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 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 replaces the
.Vt DH_METHOD
used by the
.Fa dh
key and if the previous method was supplied by an
.Vt ENGINE ,

.Xr ENGINE_finish 3
is called on it.
It is possible to have
.Vt DH
keys that only work with certain
.Vt DH_METHOD
implementations (e.g. from an
.Vt ENGINE
module that supports embedded hardware-protected keys),
and in such cases attempting to change the
.Vt DH_METHOD
for the key can have unexpected results.
.Pp
.Fn DH_new_method
allocates and initializes a
.Vt DH
structure so that
.Fa engine
is used for the DH operations.
If
.Fa engine
is
.Dv NULL ,

.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
The
.Vt DH_METHOD
structure is defined as follows:
.Bd -literal
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
} DH_METHOD;
.Ed
.Sh RETURN VALUES
.Fn DH_OpenSSL
and
.Fn DH_get_default_method
return pointers to the respective
.Sy DH_METHOD Ns s.
.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 ) .
.Pp
.Fn DH_new_method
returns
.Dv NULL
and sets an error code that can be obtained by
.Xr ERR_get_error 3
if the allocation fails.
Otherwise it returns a pointer to the newly allocated structure.
.Sh SEE ALSO
.Xr DH_new 3



.Sh HISTORY
.Fn DH_set_default_method ,
.Fn DH_get_default_method ,
.Fn DH_set_method ,
.Fn DH_new_method
and
.Fn DH_OpenSSL
first appeared in OpenSSL 0.9.5 and have been available since
.Ox 2.7 .
.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.







|


|
<
<
<
<
|
<
<









|
>
>
>









<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
184
185
186
187
188
189
190
191
192
193
194




195


196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217

















} DH_METHOD;
.Ed
.Sh RETURN VALUES
.Fn DH_OpenSSL
and
.Fn DH_get_default_method
return pointers to the respective
.Vt DH_METHOD .
.Pp
.Fn DH_set_method
returns 1 on success or 0 on failure.




Currently, it cannot fail.


.Pp
.Fn DH_new_method
returns
.Dv NULL
and sets an error code that can be obtained by
.Xr ERR_get_error 3
if the allocation fails.
Otherwise it returns a pointer to the newly allocated structure.
.Sh SEE ALSO
.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 ,
.Fn DH_set_method ,
.Fn DH_new_method
and
.Fn DH_OpenSSL
first appeared in OpenSSL 0.9.5 and have been available since
.Ox 2.7 .

















Changes to jni/libressl/man/DH_size.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: DH_size.3,v 1.8 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 <ulf@openssl.org>
.\" and Kurt Roeckx <kurt@roeckx.be>.
.\" Copyright (c) 2000, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\" $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 <ulf@openssl.org>
.\" and Kurt Roeckx <kurt@roeckx.be>.
.\" Copyright (c) 2000, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 DH_SIZE 3
.Os
.Sh NAME
.Nm DH_size ,
.Nm DH_bits
.Nd get Diffie-Hellman prime size
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 DH_SIZE 3
.Os
.Sh NAME
.Nm DH_size ,
.Nm DH_bits
.Nd get Diffie-Hellman prime size
.Sh SYNOPSIS
84
85
86
87
88
89
90
91
92
93
94
95
96
.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
appeared in SSLeay 0.8.1b or earlier 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 .







|





84
85
86
87
88
89
90
91
92
93
94
95
96
.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
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 .
Changes to jni/libressl/man/DSA_generate_key.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DSA_generate_key.3,v 1.7 2018/03/20 22:37:32 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt DSA_GENERATE_KEY 3
.Os
.Sh NAME
.Nm DSA_generate_key
.Nd generate DSA key pair
.Sh SYNOPSIS
.In openssl/dsa.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 DSA_GENERATE_KEY 3
.Os
.Sh NAME
.Nm DSA_generate_key
.Nd generate DSA key pair
.Sh SYNOPSIS
.In openssl/dsa.h
78
79
80
81
82
83
84
85
86
.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
first appeared in SSLeay 0.8 and has been available since
.Ox 2.4 .







|

78
79
80
81
82
83
84
85
86
.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
first appeared in SSLeay 0.6.0 and has been available since
.Ox 2.4 .
Changes to jni/libressl/man/DSA_generate_parameters.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DSA_generate_parameters.3,v 1.9 2018/03/23 00:09:11 schwarze Exp $
.\"	OpenSSL 9b86974e Aug 7 22:14:47 2015 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>,
.\" Bodo Moeller <bodo@openssl.org>, and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2013 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>,
.\" Bodo Moeller <bodo@openssl.org>, and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2013 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_GENERATE_PARAMETERS 3
.Os
.Sh NAME
.Nm DSA_generate_parameters_ex ,
.Nm DSA_generate_parameters
.Nd generate DSA parameters
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 DSA_GENERATE_PARAMETERS 3
.Os
.Sh NAME
.Nm DSA_generate_parameters_ex ,
.Nm DSA_generate_parameters
.Nd generate DSA parameters
.Sh SYNOPSIS
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
.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
first appeared in SSLeay 0.8 and had its
.Fa cb_arg
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 ...\&







|







200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
.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
first appeared in SSLeay 0.8.0 and had its
.Fa cb_arg
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 ...\&
Changes to jni/libressl/man/DSA_new.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DSA_new.3,v 1.8 2018/03/20 22:37:32 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55

56
57
58
59
60
61




62
63
64
65
66
67
68
69
70
71
72
73
74



75



76

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122




.\" 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 20 2018 $
.Dt DSA_NEW 3
.Os
.Sh NAME
.Nm DSA_new ,

.Nm DSA_free
.Nd allocate and free DSA objects
.Sh SYNOPSIS
.In openssl/dsa.h
.Ft DSA*
.Fn DSA_new void




.Ft void
.Fo DSA_free
.Fa "DSA *dsa"
.Fc
.Sh DESCRIPTION
The DSA functions implement the Digital Signature Algorithm.
.Pp
.Fn DSA_new
allocates and initializes a
.Vt DSA
structure.
It is equivalent to calling
.Fn DSA_new_method NULL .



.Pp



.Fn DSA_free

frees the
.Vt DSA
structure and its components.
The values are erased before the memory is returned to the system.
If
.Fa dsa
is a
.Dv NULL
pointer, no action occurs.
.Sh RETURN VALUES
If the allocation fails,
.Fn DSA_new
returns
.Dv NULL
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.



.Sh SEE ALSO
.Xr BN_new 3 ,
.Xr d2i_DSAPublicKey 3 ,
.Xr DH_new 3 ,
.Xr DSA_do_sign 3 ,
.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
Standard, DSS), ANSI X9.30
.Sh HISTORY
.Fn DSA_new
and
.Fn DSA_free
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .











|




>






>
>
>
>










|

|
>
>
>

>
>
>

>
|
















>
>
>
















<










|

>
>
>
>
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.\" 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 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"
.Fc
.Sh DESCRIPTION
The DSA functions implement the Digital Signature Algorithm.
.Pp
.Fn DSA_new
allocates and initializes a
.Vt DSA
structure, setting the reference count to 1.
It is equivalent to calling
.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
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.
If
.Fa dsa
is a
.Dv NULL
pointer, no action occurs.
.Sh RETURN VALUES
If the allocation fails,
.Fn DSA_new
returns
.Dv NULL
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 ,
.Xr DH_new 3 ,
.Xr DSA_do_sign 3 ,
.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 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
Standard, DSS), ANSI X9.30
.Sh HISTORY
.Fn DSA_new
and
.Fn DSA_free
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 .
Changes to jni/libressl/man/DSA_set_method.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DSA_set_method.3,v 1.8 2018/03/22 16:06:33 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 2007 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 2007 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96



97
98
99
100
101
102
103
104
105
106
107
108


109
110
111

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152

153
154
155
156
157
158
159
160
.\" 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 22 2018 $
.Dt DSA_SET_METHOD 3
.Os
.Sh NAME
.Nm DSA_set_default_method ,
.Nm DSA_get_default_method ,
.Nm DSA_set_method ,
.Nm DSA_new_method ,
.Nm DSA_OpenSSL
.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"
.Fc
.Ft const DSA_METHOD *
.Fn DSA_get_default_method void
.Ft int
.Fo DSA_set_method
.Fa "DSA *dsa"
.Fa "const DSA_METHOD *meth"
.Fc
.Ft DSA *
.Fo DSA_new_method
.Fa "ENGINE *engine"
.Fc
.Ft DSA_METHOD *
.Fn DSA_OpenSSL void
.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 .



.Pp
.Fn DSA_set_default_method
makes
.Fa meth
the default method for all
.Vt DSA
structures created later.
.Sy Note :
this is true only whilst no
.Vt ENGINE
has been set as a default for DSA, so this function is no longer
recommended.


.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.
.Pp
.Fn DSA_set_method
selects
.Fa meth
to perform all operations using the key
.Fa dsa .
This will replace 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.
It is possible to have DSA keys that only work with certain
.Vt DSA_METHOD
implementations (e.g. from an
.Vt ENGINE
module that supports embedded hardware-protected keys),
and in such cases attempting to change the
.Vt DSA_METHOD
for the key can have unexpected results.
.Pp
.Fn DSA_new_method
allocates and initializes a
.Vt DSA
structure so that
.Fa engine
will be 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
.Fn DSA_set_default_method
is used.
.Pp
The
.Vt DSA_METHOD
structure is defined as follows:
.Bd -literal







|











<




















|
<
<
<
<
<
<
<
<
<
<
|
|
>
>
>


|

|


|
<

<
|
>
>


|
>
|
<
<
<






|



<
|
|














|




<
|
<
|
|
>
|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83










84
85
86
87
88
89
90
91
92
93
94
95
96

97

98
99
100
101
102
103
104
105



106
107
108
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

137

138
139
140
141
142
143
144
145
146
147
148
.\" 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 18 2018 $
.Dt DSA_SET_METHOD 3
.Os
.Sh NAME
.Nm DSA_set_default_method ,
.Nm DSA_get_default_method ,
.Nm DSA_set_method ,
.Nm DSA_new_method ,
.Nm DSA_OpenSSL
.Nd select DSA method
.Sh SYNOPSIS
.In openssl/dsa.h

.Ft void
.Fo DSA_set_default_method
.Fa "const DSA_METHOD *meth"
.Fc
.Ft const DSA_METHOD *
.Fn DSA_get_default_method void
.Ft int
.Fo DSA_set_method
.Fa "DSA *dsa"
.Fa "const DSA_METHOD *meth"
.Fc
.Ft DSA *
.Fo DSA_new_method
.Fa "ENGINE *engine"
.Fc
.Ft DSA_METHOD *
.Fn DSA_OpenSSL void
.Sh DESCRIPTION
A
.Vt DSA_METHOD
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
selects
.Fa meth
as the default method for all
.Vt DSA
structures created later.
If any

.Vt ENGINE

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 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 replaces the
.Vt DSA_METHOD
used by the DSA key and if the previous method was supplied by an
.Vt ENGINE ,

.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
.Vt ENGINE
module that supports embedded hardware-protected keys),
and in such cases attempting to change the
.Vt DSA_METHOD
for the key can have unexpected results.
.Pp
.Fn DSA_new_method
allocates and initializes a
.Vt DSA
structure so that
.Fa engine
is used for the DSA operations.
If
.Fa engine
is
.Dv NULL ,

.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
The
.Vt DSA_METHOD
structure is defined as follows:
.Bd -literal
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
} DSA_METHOD;
.Ed
.Sh RETURN VALUES
.Fn DSA_OpenSSL
and
.Fn DSA_get_default_method
return pointers to the respective
.Vt DSA_METHOD Ns s .
.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 ) .
.Pp
.Fn DSA_new_method
returns
.Dv NULL
and sets an error code that can be obtained by
.Xr ERR_get_error 3
if the allocation fails.
Otherwise it returns a pointer to the newly allocated structure.
.Sh SEE ALSO
.Xr DSA_meth_new 3 ,
.Xr DSA_new 3



.Sh HISTORY
.Fn DSA_set_default_method ,
.Fn DSA_get_default_method ,
.Fn DSA_set_method ,
.Fn DSA_new_method ,
and
.Fn DSA_OpenSSL
first appeared in OpenSSL 0.9.5 and have been available since
.Ox 2.7 .
.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.







|


|
<
<
<
<
|
<
<










|
>
>
>









<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
187
188
189
190
191
192
193
194
195
196
197




198


199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221















} DSA_METHOD;
.Ed
.Sh RETURN VALUES
.Fn DSA_OpenSSL
and
.Fn DSA_get_default_method
return pointers to the respective
.Vt DSA_METHOD .
.Pp
.Fn DSA_set_method
returns 1 on success or 0 on failure.




Currently, it cannot fail.


.Pp
.Fn DSA_new_method
returns
.Dv NULL
and sets an error code that can be obtained by
.Xr ERR_get_error 3
if the allocation fails.
Otherwise it returns a pointer to the newly allocated structure.
.Sh SEE ALSO
.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 ,
.Fn DSA_set_method ,
.Fn DSA_new_method ,
and
.Fn DSA_OpenSSL
first appeared in OpenSSL 0.9.5 and have been available since
.Ox 2.7 .















Changes to jni/libressl/man/DSA_sign.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DSA_sign.3,v 1.7 2018/03/20 22:37:32 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt DSA_SIGN 3
.Os
.Sh NAME
.Nm DSA_sign ,
.Nm DSA_sign_setup ,
.Nm DSA_verify
.Nd DSA signatures







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 DSA_SIGN 3
.Os
.Sh NAME
.Nm DSA_sign ,
.Nm DSA_sign_setup ,
.Nm DSA_verify
.Nd DSA signatures
164
165
166
167
168
169
170
171
172
173
174
175
.Sh STANDARDS
US Federal Information Processing Standard FIPS 186 (Digital Signature
Standard, DSS), ANSI X9.30
.Sh HISTORY
.Fn DSA_sign
and
.Fn DSA_verify
appeared before SSLeay 0.8.
.Fn DSA_sign_setup
first appeared in SSLeay 0.8.
All these functions have been available since
.Ox 2.4 .







|

|


164
165
166
167
168
169
170
171
172
173
174
175
.Sh STANDARDS
US Federal Information Processing Standard FIPS 186 (Digital Signature
Standard, DSS), ANSI X9.30
.Sh HISTORY
.Fn DSA_sign
and
.Fn DSA_verify
first appeared in SSLeay 0.6.0.
.Fn DSA_sign_setup
first appeared in SSLeay 0.8.0.
All these functions have been available since
.Ox 2.4 .
Changes to jni/libressl/man/DSA_size.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DSA_size.3,v 1.6 2018/03/20 22:37:32 schwarze Exp $
.\"	OpenSSL 05ea606a May 20 20:52:46 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt DSA_SIZE 3
.Os
.Sh NAME
.Nm DSA_size
.Nd get DSA signature size
.Sh SYNOPSIS
.In openssl/dsa.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 DSA_SIZE 3
.Os
.Sh NAME
.Nm DSA_size
.Nd get DSA signature size
.Sh SYNOPSIS
.In openssl/dsa.h
73
74
75
76
77
78
79
80
81
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
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

73
74
75
76
77
78
79
80
81
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
first appeared in SSLeay 0.6.0 and has been available since
.Ox 2.4 .
Changes to jni/libressl/man/DTLSv1_listen.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: DTLSv1_listen.3,v 1.3 2018/03/23 02:21:08 schwarze Exp $
.\"	OpenSSL 7795475f Dec 18 13:18:31 2015 -0500
.\"
.\" This file was written by Matt Caswell <matt@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <matt@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 DTLSV1_LISTEN 3
.Os
.Sh NAME
.Nm DTLSv1_listen
.Nd listen for incoming DTLS connections
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 DTLSV1_LISTEN 3
.Os
.Sh NAME
.Nm DTLSv1_listen
.Nd listen for incoming DTLS connections
.Sh SYNOPSIS
.In openssl/ssl.h
179
180
181
182
183
184
185
186
187
.Sh SEE ALSO
.Xr BIO_new 3 ,
.Xr ssl 3 ,
.Xr SSL_accept 3 ,
.Xr SSL_get_error 3
.Sh HISTORY
.Fn DTLSv1_listen
first appeared in OpenSSL 0.9.8m and have been available since
.Ox 4.9 .







|

179
180
181
182
183
184
185
186
187
.Sh SEE ALSO
.Xr BIO_new 3 ,
.Xr ssl 3 ,
.Xr SSL_accept 3 ,
.Xr SSL_get_error 3
.Sh HISTORY
.Fn DTLSv1_listen
first appeared in OpenSSL 0.9.8m and has been available since
.Ox 4.9 .
Changes to jni/libressl/man/EC_POINT_add.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: EC_POINT_add.3,v 1.8 2018/03/23 00:09:11 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Matt Caswell <matt@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <matt@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 EC_POINT_ADD 3
.Os
.Sh NAME
.Nm EC_POINT_add ,
.Nm EC_POINT_dbl ,
.Nm EC_POINT_invert ,
.Nm EC_POINT_is_at_infinity ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 16 2018 $
.Dt EC_POINT_ADD 3
.Os
.Sh NAME
.Nm EC_POINT_add ,
.Nm EC_POINT_dbl ,
.Nm EC_POINT_invert ,
.Nm EC_POINT_is_at_infinity ,
213
214
215
216
217
218
219
220
221






222
223
224
225












226
227
228
229
230
231
232
.Pp
and stores the result in
.Fa r .
The value
.Fa n
may be
.Dv NULL ,
in which case the result is just q * m.
.Pp






.Fn EC_POINTs_mul
calculates the value
.Pp
.Dl generator * n + q[0] * m[0] + ... + q[num-1] * m[num-1]












.Pp
As for
.Fn EC_POINT_mul ,
the value
.Fa n
may be
.Dv NULL .







|

>
>
>
>
>
>



|
>
>
>
>
>
>
>
>
>
>
>
>







213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
.Pp
and stores the result in
.Fa r .
The value
.Fa n
may be
.Dv NULL ,
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].
.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 ,
the value
.Fa n
may be
.Dv NULL .
Changes to jni/libressl/man/EC_POINT_new.3.
1
2
3
4
5
6
7
8
9
.\"	$OpenBSD: EC_POINT_new.3,v 1.8 2018/03/23 00:09:11 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2013, 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
2
3
4
5
6
7
8
9
.\" $OpenBSD: EC_POINT_new.3,v 1.9 2018/03/29 20:56:49 schwarze Exp $
.\" full merge up to: OpenSSL ddc1caac Mar 6 14:00:24 2018 -0500
.\"
.\" This file was written by Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2013, 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:
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 EC_POINT_NEW 3
.Os
.Sh NAME
.Nm EC_POINT_new ,
.Nm EC_POINT_free ,
.Nm EC_POINT_clear_free ,
.Nm EC_POINT_copy ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 29 2018 $
.Dt EC_POINT_NEW 3
.Os
.Sh NAME
.Nm EC_POINT_new ,
.Nm EC_POINT_free ,
.Nm EC_POINT_clear_free ,
.Nm EC_POINT_copy ,
298
299
300
301
302
303
304












305
306
307
308
309
310
311
.Fa x
and
.Fa y
coordinates for the point
.Fa p
defined over the curve given in
.Fa group .












.Pp
As well as the affine coordinates, a point can alternatively be
described in terms of its Jacobian projective coordinates (for Fp
curves only).
Jacobian projective coordinates are expressed as three values
.Fa x ,
.Fa y ,







>
>
>
>
>
>
>
>
>
>
>
>







298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
.Fa x
and
.Fa y
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
curves only).
Jacobian projective coordinates are expressed as three values
.Fa x ,
.Fa y ,
Added jni/libressl/man/ENGINE_add.3.






































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
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 <schwarze@openbsd.org>
.\"
.\" 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 .
Added jni/libressl/man/ENGINE_ctrl.3.












































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
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 <schwarze@openbsd.org>
.\"
.\" 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 .
Added jni/libressl/man/ENGINE_get_default_RSA.3.
































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
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 <schwarze@openbsd.org>
.\"
.\" 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 .
Added jni/libressl/man/ENGINE_init.3.












































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
.\" $OpenBSD: ENGINE_init.3,v 1.2 2018/04/18 03:39:22 schwarze Exp $
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 .
Added jni/libressl/man/ENGINE_new.3.


























































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
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 <schwarze@openbsd.org>
.\"
.\" 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 .
Added jni/libressl/man/ENGINE_register_RSA.3.




























































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
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 <schwarze@openbsd.org>
.\"
.\" 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.
Added jni/libressl/man/ENGINE_register_all_RSA.3.






















































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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 <schwarze@openbsd.org>
.\"
.\" 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 .
Added jni/libressl/man/ENGINE_set_RSA.3.










































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
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 <schwarze@openbsd.org>
.\"
.\" 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 .
Added jni/libressl/man/ENGINE_set_default.3.


















































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
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 <schwarze@openbsd.org>
.\"
.\" 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.
Added jni/libressl/man/ENGINE_set_flags.3.
























































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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 <schwarze@openbsd.org>
.\"
.\" 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 .
Added jni/libressl/man/ENGINE_unregister_RSA.3.














































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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 <schwarze@openbsd.org>
.\"
.\" 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 .
Changes to jni/libressl/man/ERR_GET_LIB.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ERR_GET_LIB.3,v 1.6 2018/03/20 22:56:38 schwarze Exp $
.\"	OpenSSL doc/man3/ERR_GET_LIB.pod 3dfda1a6 Dec 12 11:14:40 2016 -0500
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt ERR_GET_LIB 3
.Os
.Sh NAME
.Nm ERR_GET_LIB ,
.Nm ERR_GET_FUNC ,
.Nm ERR_GET_REASON ,
.Nm ERR_FATAL_ERROR







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 ERR_GET_LIB 3
.Os
.Sh NAME
.Nm ERR_GET_LIB ,
.Nm ERR_GET_FUNC ,
.Nm ERR_GET_REASON ,
.Nm ERR_FATAL_ERROR
118
119
120
121
122
123
124
125
126
.Xr ERR_get_error 3
.Sh HISTORY
.Fn ERR_GET_LIB ,
.Fn ERR_GET_FUNC ,
.Fn ERR_GET_REASON ,
and
.Fn ERR_FATAL_ERROR
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .







|

118
119
120
121
122
123
124
125
126
.Xr ERR_get_error 3
.Sh HISTORY
.Fn ERR_GET_LIB ,
.Fn ERR_GET_FUNC ,
.Fn ERR_GET_REASON ,
and
.Fn ERR_FATAL_ERROR
first appeared in SSLeay 0.4.4 and have been available since
.Ox 2.4 .
Changes to jni/libressl/man/ERR_clear_error.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ERR_clear_error.3,v 1.4 2018/03/20 22:56:38 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.\" 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 20 2018 $
.Dt ERR_CLEAR_ERROR 3
.Os
.Sh NAME
.Nm ERR_clear_error
.Nd clear the OpenSSL error queue
.Sh SYNOPSIS
.In openssl/err.h
.Ft void
.Fn ERR_clear_error void
.Sh DESCRIPTION
.Fn ERR_clear_error
empties the current thread's error queue.
.Sh SEE ALSO
.Xr ERR 3 ,
.Xr ERR_get_error 3
.Sh HISTORY
.Fn ERR_clear_error
appeared in SSLeay 0.8.1b or earlier and has been available since
.Ox 2.4 .







|

















|

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.\" 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 ERR_CLEAR_ERROR 3
.Os
.Sh NAME
.Nm ERR_clear_error
.Nd clear the OpenSSL error queue
.Sh SYNOPSIS
.In openssl/err.h
.Ft void
.Fn ERR_clear_error void
.Sh DESCRIPTION
.Fn ERR_clear_error
empties the current thread's error queue.
.Sh SEE ALSO
.Xr ERR 3 ,
.Xr ERR_get_error 3
.Sh HISTORY
.Fn ERR_clear_error
first appeared in SSLeay 0.4.4 and has been available since
.Ox 2.4 .
Changes to jni/libressl/man/ERR_error_string.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ERR_error_string.3,v 1.6 2018/03/23 23:18:17 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 ERR_ERROR_STRING 3
.Os
.Sh NAME
.Nm ERR_error_string ,
.Nm ERR_error_string_n ,
.Nm ERR_lib_error_string ,
.Nm ERR_func_error_string ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 ERR_ERROR_STRING 3
.Os
.Sh NAME
.Nm ERR_error_string ,
.Nm ERR_error_string_n ,
.Nm ERR_lib_error_string ,
.Nm ERR_func_error_string ,
164
165
166
167
168
169
170
171
172
173
174
175
176
.Xr SSL_load_error_strings 3
.Sh HISTORY
.Fn ERR_error_string ,
.Fn ERR_lib_error_string ,
.Fn ERR_func_error_string ,
and
.Fn ERR_reason_error_string
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
.Fn ERR_error_string_n
first appeared in OpenSSL 0.9.6 and has been available since
.Ox 2.9 .







|





164
165
166
167
168
169
170
171
172
173
174
175
176
.Xr SSL_load_error_strings 3
.Sh HISTORY
.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
first appeared in OpenSSL 0.9.6 and has been available since
.Ox 2.9 .
Changes to jni/libressl/man/ERR_get_error.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ERR_get_error.3,v 1.7 2018/03/22 21:08:22 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 2014 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 2014 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt ERR_GET_ERROR 3
.Os
.Sh NAME
.Nm ERR_get_error ,
.Nm ERR_peek_error ,
.Nm ERR_peek_last_error ,
.Nm ERR_get_error_line ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 ERR_GET_ERROR 3
.Os
.Sh NAME
.Nm ERR_get_error ,
.Nm ERR_peek_error ,
.Nm ERR_peek_last_error ,
.Nm ERR_get_error_line ,
164
165
166
167
168
169
170
171

172

173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
.Sh RETURN VALUES
The error code, or 0 if there is no error in the queue.
.Sh SEE ALSO
.Xr ERR 3 ,
.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 ,
and
.Fn ERR_peek_error_line
appeared in SSLeay 0.8.1b or earlier.
.Fn ERR_get_error_line_data
and
.Fn ERR_peek_error_line_data
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
first appeared in OpenSSL 0.9.7 and have been available since
.Ox 3.2 .







|
>
|
>
|


|













164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
.Sh RETURN VALUES
The error code, or 0 if there is no error in the queue.
.Sh SEE ALSO
.Xr ERR 3 ,
.Xr ERR_error_string 3 ,
.Xr ERR_GET_LIB 3
.Sh HISTORY
.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
first appeared in SSLeay 0.6.0.
.Fn ERR_get_error_line_data
and
.Fn ERR_peek_error_line_data
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
first appeared in OpenSSL 0.9.7 and have been available since
.Ox 3.2 .
Changes to jni/libressl/man/ERR_load_crypto_strings.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ERR_load_crypto_strings.3,v 1.6 2018/03/20 20:26:23 schwarze Exp $
.\"	OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 20 2018 $
.Dt ERR_LOAD_CRYPTO_STRINGS 3
.Os
.Sh NAME
.Nm ERR_load_crypto_strings ,
.Nm ERR_free_strings ,
.Nm ERR_load_BN_strings ,
.Nm SSL_load_error_strings







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 ERR_LOAD_CRYPTO_STRINGS 3
.Os
.Sh NAME
.Nm ERR_load_crypto_strings ,
.Nm ERR_free_strings ,
.Nm ERR_load_BN_strings ,
.Nm SSL_load_error_strings
115
116
117
118
119
120
121
122



123
124
125
126

127
128
129
130
131
132
133
134
135
136
.Pp
.Fn ERR_free_strings
frees all previously loaded error strings.
.Sh SEE ALSO
.Xr ERR 3 ,
.Xr ERR_error_string 3
.Sh HISTORY
.Fn ERR_load_crypto_strings ,



.Fn ERR_free_strings ,
.Fn ERR_load_BN_strings ,
and
.Fn SSL_load_error_strings

appeared before SSLeay 0.8 and have 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
again using dynamically allocated memory on the heap.
That may fail if insufficient memory is available,
but these functions do not report such errors.
Instead, they fail silently, possibly having registered none or only
a part of the strings requested.







|
>
>
>
|
<

|
>
|









115
116
117
118
119
120
121
122
123
124
125
126

127
128
129
130
131
132
133
134
135
136
137
138
139
.Pp
.Fn ERR_free_strings
frees all previously loaded error strings.
.Sh SEE ALSO
.Xr ERR 3 ,
.Xr ERR_error_string 3
.Sh HISTORY
.Fn ERR_load_crypto_strings
and
.Fn SSL_load_error_strings
first appeared in SSLeay 0.4.4.
.Fn ERR_free_strings

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
again using dynamically allocated memory on the heap.
That may fail if insufficient memory is available,
but these functions do not report such errors.
Instead, they fail silently, possibly having registered none or only
a part of the strings requested.
Changes to jni/libressl/man/ERR_load_strings.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ERR_load_strings.3,v 1.6 2018/03/21 06:44:51 schwarze Exp $
.\"	OpenSSL 05ea606a May 20 20:52:46 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt ERR_LOAD_STRINGS 3
.Os
.Sh NAME
.Nm ERR_load_strings ,
.Nm ERR_PACK ,
.Nm ERR_get_next_error_library
.Nd load arbitrary OpenSSL error strings







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 ERR_LOAD_STRINGS 3
.Os
.Sh NAME
.Nm ERR_load_strings ,
.Nm ERR_PACK ,
.Nm ERR_get_next_error_library
.Nd load arbitrary OpenSSL error strings
106
107
108
109
110
111
112
113
114
115
116
117
returns a new library number.
.Sh SEE ALSO
.Xr ERR 3
.Sh HISTORY
.Fn ERR_load_strings
and
.Fn ERR_PACK
appeared in SSLeay 0.8.1b or earlier.
.Fn ERR_get_next_error_library
first appeared in SSLeay 0.9.0.
These functions have been available since
.Ox 2.4 .







|




106
107
108
109
110
111
112
113
114
115
116
117
returns a new library number.
.Sh SEE ALSO
.Xr ERR 3
.Sh HISTORY
.Fn ERR_load_strings
and
.Fn ERR_PACK
first appeared in SSLeay 0.4.4.
.Fn ERR_get_next_error_library
first appeared in SSLeay 0.9.0.
These functions have been available since
.Ox 2.4 .
Changes to jni/libressl/man/ERR_print_errors.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ERR_print_errors.3,v 1.6 2018/03/22 21:08:22 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>,
.\" with additions by Rich Salz <rsalz@openssl.org>.
.\" Copyright (c) 2000, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>,
.\" with additions by Rich Salz <rsalz@openssl.org>.
.\" Copyright (c) 2000, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 22 2018 $
.Dt ERR_PRINT_ERRORS 3
.Os
.Sh NAME
.Nm ERR_print_errors ,
.Nm ERR_print_errors_fp ,
.Nm ERR_print_errors_cb
.Nd print OpenSSL error messages







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 ERR_PRINT_ERRORS 3
.Os
.Sh NAME
.Nm ERR_print_errors ,
.Nm ERR_print_errors_fp ,
.Nm ERR_print_errors_cb
.Nd print OpenSSL error messages
112
113
114
115
116
117
118
119
120

121
122
123
124
125
126
.Xr ERR 3 ,
.Xr ERR_error_string 3 ,
.Xr ERR_get_error 3 ,
.Xr ERR_load_crypto_strings 3 ,
.Xr SSL_load_error_strings 3
.Sh HISTORY
.Fn ERR_print_errors
and
.Fn ERR_print_errors_fp

appeared in SSLeay 0.8.1b or earlier and 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 .







|

>
|





112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
.Xr ERR 3 ,
.Xr ERR_error_string 3 ,
.Xr ERR_get_error 3 ,
.Xr ERR_load_crypto_strings 3 ,
.Xr SSL_load_error_strings 3
.Sh HISTORY
.Fn ERR_print_errors
first appeared in SSLeay 0.4.5.
.Fn ERR_print_errors_fp
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 .
Changes to jni/libressl/man/ERR_put_error.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ERR_put_error.3,v 1.8 2018/03/23 05:48:56 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 ERR_PUT_ERROR 3
.Os
.Sh NAME
.Nm ERR_put_error ,
.Nm ERR_add_error_data ,
.Nm ERR_add_error_vdata
.Nd record an OpenSSL error







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 ERR_PUT_ERROR 3
.Os
.Sh NAME
.Nm ERR_put_error ,
.Nm ERR_add_error_data ,
.Nm ERR_add_error_vdata
.Nd record an OpenSSL error
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
macro.
.Sh SEE ALSO
.Xr ERR 3 ,
.Xr ERR_asprintf_error_data 3 ,
.Xr ERR_load_strings 3
.Sh HISTORY
.Fn ERR_put_error
appeared in SSLeay 0.8.1b or earlier.
.Fn ERR_add_error_data
first appeared in SSLeay 0.9.0.
These 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 .







|


|





143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
macro.
.Sh SEE ALSO
.Xr ERR 3 ,
.Xr ERR_asprintf_error_data 3 ,
.Xr ERR_load_strings 3
.Sh HISTORY
.Fn ERR_put_error
first appeared in SSLeay 0.4.4.
.Fn ERR_add_error_data
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 .
Changes to jni/libressl/man/ERR_remove_state.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: ERR_remove_state.3,v 1.5 2018/03/23 04:34:23 schwarze Exp $
.\"	OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org> and
.\" Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2013 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org> and
.\" Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2013 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 ERR_REMOVE_STATE 3
.Os
.Sh NAME
.Nm ERR_remove_thread_state ,
.Nm ERR_remove_state
.Nd free a thread's OpenSSL error queue
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 ERR_REMOVE_STATE 3
.Os
.Sh NAME
.Nm ERR_remove_thread_state ,
.Nm ERR_remove_state
.Nd free a thread's OpenSSL error queue
.Sh SYNOPSIS
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
and
.Fn ERR_remove_state
return no value.
.Sh SEE ALSO
.Xr ERR 3
.Sh HISTORY
.Fn ERR_remove_state
appeared in SSLeay 0.8.1b or earlier 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
.Vt unsigned long .







|









97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
and
.Fn ERR_remove_state
return no value.
.Sh SEE ALSO
.Xr ERR 3
.Sh HISTORY
.Fn ERR_remove_state
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
.Vt unsigned long .
Changes to jni/libressl/man/EVP_BytesToKey.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: EVP_BytesToKey.3,v 1.6 2018/03/20 23:56:07 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2001, 2011, 2013, 2014, 2015 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2001, 2011, 2013, 2014, 2015 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 20 2018 $
.Dt EVP_BYTESTOKEY 3
.Os
.Sh NAME
.Nm EVP_BytesToKey
.Nd password based encryption routine
.Sh SYNOPSIS
.In openssl/evp.h







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 EVP_BYTESTOKEY 3
.Os
.Sh NAME
.Nm EVP_BytesToKey
.Nd password based encryption routine
.Sh SYNOPSIS
.In openssl/evp.h
136
137
138
139
140
141
142
143
144
.Sh SEE ALSO
.Xr evp 3 ,
.Xr EVP_EncryptInit 3 ,
.Xr PKCS5_PBKDF2_HMAC 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn EVP_BytesToKey
appeared in SSLeay 0.8.1b or earlier and has been available since
.Ox 2.4 .







|

136
137
138
139
140
141
142
143
144
.Sh SEE ALSO
.Xr evp 3 ,
.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 .
Changes to jni/libressl/man/EVP_DigestInit.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: EVP_DigestInit.3,v 1.14 2018/03/23 23:18:17 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 <steve@openssl.org>
.\" and Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000-2004, 2009, 2012-2016 The OpenSSL Project.
.\" All rights reserved.
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>
.\" and Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000-2004, 2009, 2012-2016 The OpenSSL Project.
.\" All rights reserved.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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_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 ,







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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 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 ,
619
620
621
622
623
624
625


626

627



628

629
630
631
632
633

634
635
636
637
638
639
640
641
642
643
644
645
646
647
.Sh SEE ALSO
.Xr evp 3
.Sh HISTORY
.Fn EVP_DigestInit ,
.Fn EVP_DigestUpdate ,
.Fn EVP_DigestFinal ,
.Dv EVP_MAX_MD_SIZE ,


.Fn EVP_MD_type ,

.Fn EVP_MD_pkey_type ,



.Fn EVP_MD_size ,

.Fn EVP_MD_CTX_size ,
.Fn EVP_MD_CTX_type ,
.Fn EVP_md_null ,
.Fn EVP_md5 ,
.Fn EVP_sha1 ,

.Fn EVP_dss ,
.Fn EVP_dss1 ,
.Fn EVP_get_digestbyname ,
.Fn EVP_get_digestbynid ,
and
.Fn EVP_get_digestbyobj
appeared in SSLeay 0.8.1b or earlier.
.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







>
>
|
>
|
>
>
>
|
>



|
|
>
|
|
<



|







619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643

644
645
646
647
648
649
650
651
652
653
654
.Sh SEE ALSO
.Xr evp 3
.Sh HISTORY
.Fn EVP_DigestInit ,
.Fn EVP_DigestUpdate ,
.Fn EVP_DigestFinal ,
.Dv EVP_MAX_MD_SIZE ,
.Fn EVP_md5 ,
and
.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
669
670
671
672
673
674
675
676

677
678
679
680
681
682
683
.Ox 3.2 .
.Pp
.Fn EVP_sha224 ,
.Fn EVP_sha256 ,
.Fn EVP_sha384 ,
and
.Fn EVP_sha512
first appeared in OpenSSL 0.8.7h 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 ,







|
>







676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
.Ox 3.2 .
.Pp
.Fn EVP_sha224 ,
.Fn EVP_sha256 ,
.Fn EVP_sha384 ,
and
.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 ,
Changes to jni/libressl/man/EVP_DigestVerifyInit.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: EVP_DigestVerifyInit.3,v 1.5 2018/03/23 04:34:23 schwarze Exp $
.\"	OpenSSL fb552ac6 Sep 30 23:43:01 2009 +0000
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2006, 2009, 2014, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: EVP_DigestVerifyInit.3,v 1.6 2018/05/13 14:00:22 schwarze Exp $
.\"	OpenSSL fb552ac6 Sep 30 23:43:01 2009 +0000
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2006, 2009, 2014, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_DIGESTVERIFYINIT 3
.Os
.Sh NAME
.Nm EVP_DigestVerifyInit ,
.Nm EVP_DigestVerifyUpdate ,
.Nm EVP_DigestVerifyFinal
.Nd EVP signature verification functions







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_DIGESTVERIFYINIT 3
.Os
.Sh NAME
.Nm EVP_DigestVerifyInit ,
.Nm EVP_DigestVerifyUpdate ,
.Nm EVP_DigestVerifyFinal
.Nd EVP signature verification functions
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.Fa "EVP_MD_CTX *ctx"
.Fa "const void *d"
.Fa "size_t cnt"
.Fc
.Ft int
.Fo EVP_DigestVerifyFinal
.Fa "EVP_MD_CTX *ctx"
.Fa "unsigned char *sig"
.Fa "size_t siglen"
.Fc
.Sh DESCRIPTION
The EVP signature routines are a high level interface to digital
signatures.
.Pp
.Fn EVP_DigestVerifyInit







|







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.Fa "EVP_MD_CTX *ctx"
.Fa "const void *d"
.Fa "size_t cnt"
.Fc
.Ft int
.Fo EVP_DigestVerifyFinal
.Fa "EVP_MD_CTX *ctx"
.Fa "const unsigned char *sig"
.Fa "size_t siglen"
.Fc
.Sh DESCRIPTION
The EVP signature routines are a high level interface to digital
signatures.
.Pp
.Fn EVP_DigestVerifyInit
Changes to jni/libressl/man/EVP_EncodeInit.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: EVP_EncodeInit.3,v 1.3 2018/03/20 23:56:07 schwarze Exp $
.\"	OpenSSL f430ba31 Jun 19 19:39:01 2016 +0200
.\"
.\" This file was written by Matt Caswell <matt@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: EVP_EncodeInit.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
.\"	OpenSSL f430ba31 Jun 19 19:39:01 2016 +0200
.\"
.\" This file was written by Matt Caswell <matt@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt EVP_ENCODEINIT 3
.Os
.Sh NAME
.Nm EVP_EncodeInit ,
.Nm EVP_EncodeUpdate ,
.Nm EVP_EncodeFinal ,
.Nm EVP_EncodeBlock ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 EVP_ENCODEINIT 3
.Os
.Sh NAME
.Nm EVP_EncodeInit ,
.Nm EVP_EncodeUpdate ,
.Nm EVP_EncodeFinal ,
.Nm EVP_EncodeBlock ,
290
291
292
293
294
295
296
297
298
299
returns -1 on error or 1 on success.
.Pp
.Fn EVP_DecodeBlock
returns the length of the data decoded or -1 on error.
.Sh SEE ALSO
.Xr evp 3
.Sh HISTORY
These functions appeared in SSLeay 0.8.1b or earlier
and have been available since
.Ox 2.4 .







|


290
291
292
293
294
295
296
297
298
299
returns -1 on error or 1 on success.
.Pp
.Fn EVP_DecodeBlock
returns the length of the data decoded or -1 on error.
.Sh SEE ALSO
.Xr evp 3
.Sh HISTORY
These functions first appeared in SSLeay 0.5.1
and have been available since
.Ox 2.4 .
Changes to jni/libressl/man/EVP_EncryptInit.3.
1
2
3
4
5
6
7
8
9
10
.\" $OpenBSD: EVP_EncryptInit.3,v 1.19 2018/03/23 23:18:17 schwarze Exp $
.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800
.\" selective merge up to: OpenSSL 5c5eb286 Dec 5 00:36:43 2017 +0100
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>
.\" and Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000-2002, 2005, 2012-2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|

|







1
2
3
4
5
6
7
8
9
10
.\" $OpenBSD: EVP_EncryptInit.3,v 1.25 2018/09/12 15:09:22 jmc Exp $
.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800
.\" selective merge up to: OpenSSL 16cfc2c9 Mar 8 22:30:28 2018 +0100
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>
.\" and Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000-2002, 2005, 2012-2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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_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 ,







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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 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 ,
90
91
92
93
94
95
96


97
98
99
100
101
102
103
.Nm EVP_CIPHER_mode ,
.Nm EVP_CIPHER_type ,
.Nm EVP_CIPHER_CTX_cipher ,
.Nm EVP_CIPHER_CTX_nid ,
.Nm EVP_CIPHER_CTX_block_size ,
.Nm EVP_CIPHER_CTX_key_length ,
.Nm EVP_CIPHER_CTX_iv_length ,


.Nm EVP_CIPHER_CTX_get_app_data ,
.Nm EVP_CIPHER_CTX_set_app_data ,
.Nm EVP_CIPHER_CTX_type ,
.Nm EVP_CIPHER_CTX_flags ,
.Nm EVP_CIPHER_CTX_mode ,
.Nm EVP_CIPHER_param_to_asn1 ,
.Nm EVP_CIPHER_asn1_to_param ,







>
>







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
.Nm EVP_CIPHER_mode ,
.Nm EVP_CIPHER_type ,
.Nm EVP_CIPHER_CTX_cipher ,
.Nm EVP_CIPHER_CTX_nid ,
.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 ,
.Nm EVP_CIPHER_CTX_flags ,
.Nm EVP_CIPHER_CTX_mode ,
.Nm EVP_CIPHER_param_to_asn1 ,
.Nm EVP_CIPHER_asn1_to_param ,
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
.Fa "EVP_CIPHER_CTX *ctx"
.Fc
.Ft int
.Fo EVP_EncryptInit_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "ENGINE *impl"
.Fa "unsigned char *key"
.Fa "unsigned char *iv"
.Fc
.Ft int
.Fo EVP_EncryptUpdate
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *out"
.Fa "int *outl"
.Fa "const unsigned char *in"
.Fa "int inl"
.Fc
.Ft int
.Fo EVP_EncryptFinal_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *out"
.Fa "int *outl"
.Fc
.Ft int
.Fo EVP_DecryptInit_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "ENGINE *impl"
.Fa "unsigned char *key"
.Fa "unsigned char *iv"
.Fc
.Ft int
.Fo EVP_DecryptUpdate
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *out"
.Fa "int *outl"
.Fa "const unsigned char *in"
.Fa "int inl"
.Fc
.Ft int
.Fo EVP_DecryptFinal_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *outm"
.Fa "int *outl"
.Fc
.Ft int
.Fo EVP_CipherInit_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "ENGINE *impl"
.Fa "unsigned char *key"
.Fa "unsigned char *iv"
.Fa "int enc"
.Fc
.Ft int
.Fo EVP_CipherUpdate
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *out"
.Fa "int *outl"
.Fa "unsigned char *in"
.Fa "int inl"
.Fc
.Ft int
.Fo EVP_CipherFinal_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *outm"
.Fa "int *outl"
.Fc
.Ft int
.Fo EVP_EncryptInit
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "unsigned char *key"
.Fa "unsigned char *iv"
.Fc
.Ft int
.Fo EVP_EncryptFinal
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *out"
.Fa "int *outl"
.Fc
.Ft int
.Fo EVP_DecryptInit
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "unsigned char *key"
.Fa "unsigned char *iv"
.Fc
.Ft int
.Fo EVP_DecryptFinal
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *outm"
.Fa "int *outl"
.Fc
.Ft int
.Fo EVP_CipherInit
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "unsigned char *key"
.Fa "unsigned char *iv"
.Fa "int enc"
.Fc
.Ft int
.Fo EVP_CipherFinal
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *outm"
.Fa "int *outl"







|
|




















|
|




















|
|







|












|
|











|
|











|
|







181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
.Fa "EVP_CIPHER_CTX *ctx"
.Fc
.Ft int
.Fo EVP_EncryptInit_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "ENGINE *impl"
.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 "const unsigned char *in"
.Fa "int inl"
.Fc
.Ft int
.Fo EVP_EncryptFinal_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *out"
.Fa "int *outl"
.Fc
.Ft int
.Fo EVP_DecryptInit_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "ENGINE *impl"
.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 "const unsigned char *in"
.Fa "int inl"
.Fc
.Ft int
.Fo EVP_DecryptFinal_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *outm"
.Fa "int *outl"
.Fc
.Ft int
.Fo EVP_CipherInit_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "ENGINE *impl"
.Fa "const unsigned char *key"
.Fa "const unsigned char *iv"
.Fa "int enc"
.Fc
.Ft int
.Fo EVP_CipherUpdate
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *out"
.Fa "int *outl"
.Fa "const unsigned char *in"
.Fa "int inl"
.Fc
.Ft int
.Fo EVP_CipherFinal_ex
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *outm"
.Fa "int *outl"
.Fc
.Ft int
.Fo EVP_EncryptInit
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "const unsigned char *key"
.Fa "const unsigned char *iv"
.Fc
.Ft int
.Fo EVP_EncryptFinal
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *out"
.Fa "int *outl"
.Fc
.Ft int
.Fo EVP_DecryptInit
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "const unsigned char *key"
.Fa "const unsigned char *iv"
.Fc
.Ft int
.Fo EVP_DecryptFinal
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *outm"
.Fa "int *outl"
.Fc
.Ft int
.Fo EVP_CipherInit
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "const EVP_CIPHER *type"
.Fa "const unsigned char *key"
.Fa "const unsigned char *iv"
.Fa "int enc"
.Fc
.Ft int
.Fo EVP_CipherFinal
.Fa "EVP_CIPHER_CTX *ctx"
.Fa "unsigned char *outm"
.Fa "int *outl"
363
364
365
366
367
368
369












370
371
372
373
374
375
376
.Fo EVP_CIPHER_CTX_key_length
.Fa "const EVP_CIPHER_CTX *ctx"
.Fc
.Ft int
.Fo EVP_CIPHER_CTX_iv_length
.Fa "const EVP_CIPHER_CTX *ctx"
.Fc












.Ft void *
.Fo EVP_CIPHER_CTX_get_app_data
.Fa "const EVP_CIPHER_CTX *ctx"
.Fc
.Ft void
.Fo EVP_CIPHER_CTX_set_app_data
.Fa "const EVP_CIPHER_CTX *ctx"







>
>
>
>
>
>
>
>
>
>
>
>







365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
.Fo EVP_CIPHER_CTX_key_length
.Fa "const EVP_CIPHER_CTX *ctx"
.Fc
.Ft int
.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"
.Fc
.Ft void
.Fo EVP_CIPHER_CTX_set_app_data
.Fa "const EVP_CIPHER_CTX *ctx"
647
648
649
650
651
652
653









654
655
656
657
658
659
660
or
.Vt EVP_CIPHER_CTX .
It will return zero if the cipher does not use an IV.
The constant
.Dv EVP_MAX_IV_LENGTH
is the maximum IV length for all ciphers.
.Pp









.Fn EVP_CIPHER_block_size
and
.Fn EVP_CIPHER_CTX_block_size
return the block size of a cipher when passed an
.Vt EVP_CIPHER
or
.Vt EVP_CIPHER_CTX







>
>
>
>
>
>
>
>
>







661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
or
.Vt EVP_CIPHER_CTX .
It will return zero if the cipher does not use an IV.
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
return the block size of a cipher when passed an
.Vt EVP_CIPHER
or
.Vt EVP_CIPHER_CTX
800
801
802
803
804
805
806


807
808
809
810
811
812
813
.Vt EVP_CIPHER_CTX
for success or
.Dv NULL
for failure.
.Pp
.Fn EVP_CIPHER_CTX_reset ,
.Fn EVP_CIPHER_CTX_cleanup ,


.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 ,







>
>







823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
.Vt EVP_CIPHER_CTX
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 ,
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
The tag length is often referred to as M.
If not set, a default value is used (12 for AES).
.It Fn EVP_CIPHER_CTX_ctrl ctx EVP_CTRL_CCM_SET_L ivlen NULL
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.
The nonce length is given by 15 - L so it is 7 by default for AES.
.El
.Sh EXAMPLES
Encrypt a string using blowfish:
.Bd -literal -offset 3n
int
do_crypt(char *outfile)







|







1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
The tag length is often referred to as M.
If not set, a default value is used (12 for AES).
.It Fn EVP_CIPHER_CTX_ctrl ctx EVP_CTRL_CCM_SET_L ivlen NULL
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 a nonce value.
The nonce length is given by 15 - L so it is 7 by default for AES.
.El
.Sh EXAMPLES
Encrypt a string using blowfish:
.Bd -literal -offset 3n
int
do_crypt(char *outfile)
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248

1249

1250
1251
1252

1253













1254
1255
1256
1257
1258












1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
	EVP_CIPHER_CTX_free(ctx);
	return 1;
}
.Ed
.Sh SEE ALSO
.Xr evp 3
.Sh HISTORY
.Fn EVP_CIPHER_CTX_cleanup ,
.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_get_cipherbynid ,
.Fn EVP_get_cipherbyobj ,
.Fn EVP_CIPHER_nid ,
.Fn EVP_CIPHER_block_size ,
.Fn EVP_CIPHER_key_length ,
.Fn EVP_CIPHER_iv_length ,
.Fn EVP_CIPHER_CTX_cipher ,
.Fn EVP_CIPHER_CTX_nid ,
.Fn EVP_CIPHER_CTX_block_size ,
.Fn EVP_CIPHER_CTX_key_length ,
.Fn EVP_CIPHER_CTX_iv_length ,
.Fn EVP_CIPHER_CTX_get_app_data ,
.Fn EVP_CIPHER_CTX_set_app_data ,
.Fn EVP_enc_null ,
.Fn EVP_des_cbc ,
.Fn EVP_des_ecb ,
.Fn EVP_des_cfb ,
.Fn EVP_des_ofb ,
.Fn EVP_des_ede_cbc ,
.Fn EVP_des_ede ,
.Fn EVP_des_ede_ofb ,
.Fn EVP_des_ede_cfb ,
.Fn EVP_des_ede3_cbc ,
.Fn EVP_des_ede3 ,
.Fn EVP_des_ede3_ofb ,
.Fn EVP_des_ede3_cfb ,
.Fn EVP_desx_cbc ,
.Fn EVP_rc4 ,
.Fn EVP_idea_cbc ,
.Fn EVP_idea_ecb ,
.Fn EVP_idea_cfb ,

.Fn EVP_idea_ofb ,

.Fn EVP_rc2_cbc ,
.Fn EVP_rc2_ecb ,
.Fn EVP_rc2_cfb ,

.Fn EVP_rc2_ofb ,













.Fn EVP_bf_cbc ,
.Fn EVP_bf_ecb ,
.Fn EVP_bf_cfb ,
and
.Fn EVP_bf_ofb












appeared in SSLeay 0.8.1b or earlier.
.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_64_cbc
first appeared in SSL_eay 0.9.1.
.Fn EVP_CIPHER_CTX_type
first appeared in OpenSSL 0.9.3.
These functions and 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 ,







<










<
<
<
<
<
<
<
<
<
<
<
<
<
<












<




>
|
>



>
|
>
>
>
>
>
>
>
>
>
>
>
>
>





>
>
>
>
>
>
>
>
>
>
>
>
|












|







1225
1226
1227
1228
1229
1230
1231

1232
1233
1234
1235
1236
1237
1238
1239
1240
1241














1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253

1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
	EVP_CIPHER_CTX_free(ctx);
	return 1;
}
.Ed
.Sh SEE ALSO
.Xr evp 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_des_cbc ,
.Fn EVP_des_ecb ,
.Fn EVP_des_cfb ,
.Fn EVP_des_ofb ,
.Fn EVP_des_ede_cbc ,
.Fn EVP_des_ede ,
.Fn EVP_des_ede_ofb ,
.Fn EVP_des_ede_cfb ,
.Fn EVP_des_ede3_cbc ,
.Fn EVP_des_ede3 ,
.Fn EVP_des_ede3_ofb ,
.Fn EVP_des_ede3_cfb ,

.Fn EVP_rc4 ,
.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_desx_cbc
first appeared in SSLeay 0.6.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_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 ,
1314
1315
1316
1317
1318
1319
1320






1321
1322
1323
1324
1325
1326
1327
.Fn EVP_aes_256_cbc_hmac_sha1
first appeared in OpenSSL 1.0.1 and have been available since
.Ox 5.3 .
.Pp
.Fn EVP_CIPHER_CTX_reset
first appeared in OpenSSL 1.1.0 and has been available since
.Ox 6.3 .






.Sh BUGS
.Dv EVP_MAX_KEY_LENGTH
and
.Dv EVP_MAX_IV_LENGTH
only refer to the internal ciphers with default key lengths.
If custom ciphers exceed these values the results are unpredictable.
This is because it has become standard practice to define a generic key







>
>
>
>
>
>







1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
.Fn EVP_aes_256_cbc_hmac_sha1
first appeared in OpenSSL 1.0.1 and have been available since
.Ox 5.3 .
.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
only refer to the internal ciphers with default key lengths.
If custom ciphers exceed these values the results are unpredictable.
This is because it has become standard practice to define a generic key
Changes to jni/libressl/man/EVP_OpenInit.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: EVP_OpenInit.3,v 1.6 2018/03/20 23:56:07 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt EVP_OPENINIT 3
.Os
.Sh NAME
.Nm EVP_OpenInit ,
.Nm EVP_OpenUpdate ,
.Nm EVP_OpenFinal
.Nd EVP envelope decryption







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 EVP_OPENINIT 3
.Os
.Sh NAME
.Nm EVP_OpenInit ,
.Nm EVP_OpenUpdate ,
.Nm EVP_OpenFinal
.Nd EVP envelope decryption
147
148
149
150
151
152
153
154
155
.Xr EVP_SealInit 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn EVP_OpenInit ,
.Fn EVP_OpenUpdate ,
and
.Fn EVP_OpenFinal
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .







|

147
148
149
150
151
152
153
154
155
.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 .
Changes to jni/libressl/man/EVP_PKEY_asn1_get_count.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: EVP_PKEY_asn1_get_count.3,v 1.2 2018/03/23 04:34:23 schwarze Exp $
.\" full merge up to: OpenSSL 751148e2 Oct 27 00:11:11 2017 +0200
.\"
.\" This file was written by Richard Levitte <levitte@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\" $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 <levitte@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
64
65
66
67




68
69
70
71
72
73
74
.\" 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_ASN1_GET_COUNT 3
.Os
.Sh NAME
.Nm EVP_PKEY_asn1_get_count ,
.Nm EVP_PKEY_asn1_get0 ,

.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_asn1_find
.Fa "ENGINE **pe"
.Fa "int type"
.Fc
.Ft const EVP_PKEY_ASN1_METHOD *







|





>











>
>
>
>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.\" 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 *
147
148
149
150
151
152
153




154
155
156
157
158
159
160
161
162
163
.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_asn1_get0_info
returns 1 on success or 0 on failure.
.Sh SEE ALSO
.Xr EVP_PKEY_asn1_add0 3 ,
.Xr EVP_PKEY_asn1_new 3
.Sh HISTORY
These functions first appeared in OpenSSL 1.0.0
and have been available since
.Ox 4.9 .







>
>
>
>




|
|




152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
.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 .
Changes to jni/libressl/man/EVP_PKEY_asn1_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: EVP_PKEY_asn1_new.3,v 1.2 2018/03/23 04:34:23 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 <levitte@openssl.org>
.\" Copyright (c) 2017 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\" $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 <levitte@openssl.org>
.\" Copyright (c) 2017 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_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 ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 ,
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
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's called by
.Fn EVP_PKEY_bits .
.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)







|
|







252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
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)
Changes to jni/libressl/man/EVP_PKEY_cmp.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: EVP_PKEY_cmp.3,v 1.8 2018/03/23 00:09:11 schwarze Exp $
.\"	OpenSSL 05ea606a May 20 20:52:46 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2006, 2013, 2014, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2006, 2013, 2014, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_CMP 3
.Os
.Sh NAME
.Nm EVP_PKEY_missing_parameters ,
.Nm EVP_PKEY_copy_parameters ,
.Nm EVP_PKEY_cmp_parameters ,
.Nm EVP_PKEY_cmp







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 EVP_PKEY_CMP 3
.Os
.Sh NAME
.Nm EVP_PKEY_missing_parameters ,
.Nm EVP_PKEY_copy_parameters ,
.Nm EVP_PKEY_cmp_parameters ,
.Nm EVP_PKEY_cmp
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.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
appeared in SSLeay 0.8.1b or earlier.
.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 .







|








144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.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 .
Changes to jni/libressl/man/EVP_PKEY_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: EVP_PKEY_new.3,v 1.7 2018/03/23 23:18:17 schwarze Exp $
.\" full merge up to: OpenSSL 99d63d42 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\" $OpenBSD: EVP_PKEY_new.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $
.\" full merge up to: OpenSSL 99d63d42 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_NEW 3
.Os
.Sh NAME
.Nm EVP_PKEY_new ,
.Nm EVP_PKEY_up_ref ,
.Nm EVP_PKEY_free
.Nd private key allocation functions







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 EVP_PKEY_NEW 3
.Os
.Sh NAME
.Nm EVP_PKEY_new ,
.Nm EVP_PKEY_up_ref ,
.Nm EVP_PKEY_free
.Nd private key allocation functions
110
111
112
113
114
115
116
117
118
119
120
121
122
.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
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
.Fn EVP_PKEY_up_ref
first appeared in OpenSSL 1.1.0 and has been available since
.Ox 6.3 .







|





110
111
112
113
114
115
116
117
118
119
120
121
122
.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
first appeared in SSLeay 0.6.0 and have been available since
.Ox 2.4 .
.Pp
.Fn EVP_PKEY_up_ref
first appeared in OpenSSL 1.1.0 and has been available since
.Ox 6.3 .
Changes to jni/libressl/man/EVP_PKEY_set1_RSA.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.12 2018/03/23 23:18:17 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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2015, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.14 2018/05/13 16:44:57 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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2015, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.\" 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_SET1_RSA 3
.Os
.Sh NAME
.Nm EVP_PKEY_set1_RSA ,
.Nm EVP_PKEY_set1_DSA ,
.Nm EVP_PKEY_set1_DH ,
.Nm EVP_PKEY_set1_EC_KEY ,
.Nm EVP_PKEY_get1_RSA ,
.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_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_type
.Nd EVP_PKEY assignment functions
.Sh SYNOPSIS
.In openssl/evp.h
.Ft int
.Fo EVP_PKEY_set1_RSA
.Fa "EVP_PKEY *pkey"







|



















|
|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.\" 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_SET1_RSA 3
.Os
.Sh NAME
.Nm EVP_PKEY_set1_RSA ,
.Nm EVP_PKEY_set1_DSA ,
.Nm EVP_PKEY_set1_DH ,
.Nm EVP_PKEY_set1_EC_KEY ,
.Nm EVP_PKEY_get1_RSA ,
.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_assign_RSA ,
.Nm EVP_PKEY_assign_DSA ,
.Nm EVP_PKEY_assign_DH ,
.Nm EVP_PKEY_assign_EC_KEY ,
.Nm EVP_PKEY_base_id ,
.Nm EVP_PKEY_id ,
.Nm EVP_PKEY_type
.Nd EVP_PKEY assignment functions
.Sh SYNOPSIS
.In openssl/evp.h
.Ft int
.Fo EVP_PKEY_set1_RSA
.Fa "EVP_PKEY *pkey"
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
.Fc
.Ft int
.Fo EVP_PKEY_assign_EC_KEY
.Fa "EVP_PKEY *pkey"
.Fa "EC_KEY *key"
.Fc
.Ft int
.Fo EVP_PKEY_id
.Fa "EVP_PKEY *pkey"
.Fc
.Ft int
.Fo EVP_PKEY_base_id
.Fa "EVP_PKEY *pkey"
.Fc
.Ft int
.Fo EVP_PKEY_type
.Fa "int type"
.Fc
.Sh DESCRIPTION







|



|







144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
.Fc
.Ft int
.Fo EVP_PKEY_assign_EC_KEY
.Fa "EVP_PKEY *pkey"
.Fa "EC_KEY *key"
.Fc
.Ft int
.Fo EVP_PKEY_base_id
.Fa "EVP_PKEY *pkey"
.Fc
.Ft int
.Fo EVP_PKEY_id
.Fa "EVP_PKEY *pkey"
.Fc
.Ft int
.Fo EVP_PKEY_type
.Fa "int type"
.Fc
.Sh DESCRIPTION
290
291
292
293
294
295
296

297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
(equivalently
.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_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
appeared in SSLeay 0.8.1b or earlier 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 ,







>








|







290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
(equivalently
.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 ,
Changes to jni/libressl/man/EVP_SealInit.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: EVP_SealInit.3,v 1.6 2018/03/20 23:56:07 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2002, 2003, 2005, 2015 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2002, 2003, 2005, 2015 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 20 2018 $
.Dt EVP_SEALINIT 3
.Os
.Sh NAME
.Nm EVP_SealInit ,
.Nm EVP_SealUpdate ,
.Nm EVP_SealFinal
.Nd EVP envelope encryption







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 EVP_SEALINIT 3
.Os
.Sh NAME
.Nm EVP_SealInit ,
.Nm EVP_SealUpdate ,
.Nm EVP_SealFinal
.Nd EVP envelope encryption
178
179
180
181
182
183
184
185
186
187
188
189
.Xr EVP_OpenInit 3 ,
.Xr RAND_bytes 3
.Sh HISTORY
.Fn EVP_SealInit ,
.Fn EVP_SealUpdate ,
and
.Fn EVP_SealFinal
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
.Fn EVP_SealFinal
did not return a value before OpenSSL 0.9.7.







|




178
179
180
181
182
183
184
185
186
187
188
189
.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.
Changes to jni/libressl/man/EVP_SignInit.3.
1
2

3
4
5
6
7
8
9
.\"	$OpenBSD: EVP_SignInit.3,v 1.7 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 <steve@openssl.org>.
.\" Copyright (c) 2000-2002, 2005, 2006, 2014-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
|
|
>







1
2
3
4
5
6
7
8
9
10
.\" $OpenBSD: EVP_SignInit.3,v 1.11 2018/07/09 09:56:05 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 <steve@openssl.org>.
.\" Copyright (c) 2000-2002, 2005, 2006, 2014-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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

61
62
63
64
65
66
67
.\" 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 22 2018 $
.Dt EVP_SIGNINIT 3
.Os
.Sh NAME
.Nm EVP_SignInit_ex ,
.Nm EVP_SignUpdate ,
.Nm EVP_SignFinal ,
.Nm EVP_SignInit ,
.Nm EVP_PKEY_size

.Nd EVP signing functions
.Sh SYNOPSIS
.In openssl/evp.h
.Ft int
.Fo EVP_SignInit_ex
.Fa "EVP_MD_CTX *ctx"
.Fa "const EVP_MD *type"







|







|
>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.\" 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 EVP_SIGNINIT 3
.Os
.Sh NAME
.Nm EVP_SignInit_ex ,
.Nm EVP_SignUpdate ,
.Nm EVP_SignFinal ,
.Nm EVP_SignInit ,
.Nm EVP_PKEY_size ,
.Nm EVP_PKEY_bits
.Nd EVP signing functions
.Sh SYNOPSIS
.In openssl/evp.h
.Ft int
.Fo EVP_SignInit_ex
.Fa "EVP_MD_CTX *ctx"
.Fa "const EVP_MD *type"
83
84
85
86
87
88
89
90




91
92
93
94
95
96
97
.Ft void
.Fo EVP_SignInit
.Fa "EVP_MD_CTX *ctx"
.Fa "const EVP_MD *type"
.Fc
.Ft int
.Fo EVP_PKEY_size
.Fa "EVP_PKEY *pkey"




.Fc
.Sh DESCRIPTION
The EVP signature routines are a high level interface to digital
signatures.
.Pp
.Fn EVP_SignInit_ex
sets up a signing context







|
>
>
>
>







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.Ft void
.Fo EVP_SignInit
.Fa "EVP_MD_CTX *ctx"
.Fa "const EVP_MD *type"
.Fc
.Ft int
.Fo EVP_PKEY_size
.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
signatures.
.Pp
.Fn EVP_SignInit_ex
sets up a signing context
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
may be smaller.
.Pp
The EVP interface to digital signatures should almost always be
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.
This means that calls to
.Fn EVP_SignUpdate
and
.Fn EVP_SignFinal







<
<
<
<
<







156
157
158
159
160
161
162





163
164
165
166
167
168
169
may be smaller.
.Pp
The EVP interface to digital signatures should almost always be
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





The call to
.Fn EVP_SignFinal
internally finalizes a copy of the digest context.
This means that calls to
.Fn EVP_SignUpdate
and
.Fn EVP_SignFinal
178
179
180
181
182
183
184




185
186
187
188
189
190
191
192
193
194
195
196
197


198



199
200
201
202
203
204
205
206
and
.Fn EVP_SignFinal
return 1 for success and 0 for failure.
.Pp
.Fn EVP_PKEY_size
returns the maximum size of a signature in bytes.
.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 ,
.Fn EVP_SignFinal ,
and


.Fn EVP_PKEY_size



appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
.Fn EVP_SignInit_ex
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







>
>
>
>











<

>
>

>
>
>
|







179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200

201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
and
.Fn EVP_SignFinal
return 1 for success and 0 for failure.
.Pp
.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
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
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
Changes to jni/libressl/man/EVP_VerifyInit.3.
1
2

3
4
5
6
7
8
9
.\"	$OpenBSD: EVP_VerifyInit.3,v 1.6 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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2001, 2006, 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
|
|
>







1
2
3
4
5
6
7
8
9
10
.\" $OpenBSD: EVP_VerifyInit.3,v 1.8 2018/03/29 21:26:51 schwarze 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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2001, 2006, 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 22 2018 $
.Dt EVP_VERIFYINIT 3
.Os
.Sh NAME
.Nm EVP_VerifyInit_ex ,
.Nm EVP_VerifyUpdate ,
.Nm EVP_VerifyFinal ,
.Nm EVP_VerifyInit







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 29 2018 $
.Dt EVP_VERIFYINIT 3
.Os
.Sh NAME
.Nm EVP_VerifyInit_ex ,
.Nm EVP_VerifyUpdate ,
.Nm EVP_VerifyFinal ,
.Nm EVP_VerifyInit
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
.Fa type .
.Pp
The EVP interface to digital signatures should almost always be
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.
This means that calls to
.Fn EVP_VerifyUpdate
and
.Fn EVP_VerifyFinal







<
<
<
<
<







130
131
132
133
134
135
136





137
138
139
140
141
142
143
.Fa type .
.Pp
The EVP interface to digital signatures should almost always be
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





The call to
.Fn EVP_VerifyFinal
internally finalizes a copy of the digest context.
This means that calls to
.Fn EVP_VerifyUpdate
and
.Fn EVP_VerifyFinal
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
.Xr EVP_DigestInit 3 ,
.Xr EVP_SignInit 3
.Sh HISTORY
.Fn EVP_VerifyInit ,
.Fn EVP_VerifyUpdate ,
and
.Fn EVP_VerifyFinal
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
.Fn EVP_VerifyInit_ex
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







|







165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
.Xr EVP_DigestInit 3 ,
.Xr EVP_SignInit 3
.Sh HISTORY
.Fn EVP_VerifyInit ,
.Fn EVP_VerifyUpdate ,
and
.Fn EVP_VerifyFinal
first appeared in SSLeay 0.5.1 and have been available since
.Ox 2.4 .
.Pp
.Fn EVP_VerifyInit_ex
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
Changes to jni/libressl/man/MD5.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: MD5.3,v 1.7 2018/03/22 17:11:04 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org> and
.\" Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000, 2006 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org> and
.\" Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000, 2006 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 22 2018 $
.Dt MD5 3
.Os
.Sh NAME
.Nm MD4 ,
.Nm MD5 ,
.Nm MD4_Init ,
.Nm MD4_Update ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 MD5 3
.Os
.Sh NAME
.Nm MD4 ,
.Nm MD5 ,
.Nm MD4_Init ,
.Nm MD4_Update ,
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
RFC 1320, RFC 1321
.Sh HISTORY
.Fn MD5 ,
.Fn MD5_Init ,
.Fn MD5_Update ,
and
.Fn MD5_Final
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
.Fn MD4 ,
.Fn MD4_Init ,
.Fn MD4_Update ,
and
.Fn MD4_Final
first appeared in OpenSSL 0.9.6 and have been available since
.Ox 2.9 .







|









180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
RFC 1320, RFC 1321
.Sh HISTORY
.Fn MD5 ,
.Fn MD5_Init ,
.Fn MD5_Update ,
and
.Fn MD5_Final
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_Final
first appeared in OpenSSL 0.9.6 and have been available since
.Ox 2.9 .
Changes to jni/libressl/man/Makefile.am.
112
113
114
115
116
117
118

119
120
121
122
123
124
125
dist_man3_MANS += SSL_shutdown.3
dist_man3_MANS += SSL_state_string.3
dist_man3_MANS += SSL_want.3
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_OBJECT_new.3
dist_man3_MANS += ASN1_STRING_TABLE_add.3
dist_man3_MANS += ASN1_STRING_length.3
dist_man3_MANS += ASN1_STRING_new.3
dist_man3_MANS += ASN1_STRING_print_ex.3
dist_man3_MANS += ASN1_TIME_set.3
dist_man3_MANS += ASN1_TYPE_get.3







>







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
dist_man3_MANS += SSL_shutdown.3
dist_man3_MANS += SSL_state_string.3
dist_man3_MANS += SSL_want.3
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
dist_man3_MANS += ASN1_STRING_new.3
dist_man3_MANS += ASN1_STRING_print_ex.3
dist_man3_MANS += ASN1_TIME_set.3
dist_man3_MANS += ASN1_TYPE_get.3
205
206
207
208
209
210
211











212
213
214
215
216
217
218
dist_man3_MANS += ECDSA_SIG_new.3
dist_man3_MANS += EC_GFp_simple_method.3
dist_man3_MANS += EC_GROUP_copy.3
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 += ERR.3
dist_man3_MANS += ERR_GET_LIB.3
dist_man3_MANS += ERR_asprintf_error_data.3
dist_man3_MANS += ERR_clear_error.3
dist_man3_MANS += ERR_error_string.3
dist_man3_MANS += ERR_get_error.3
dist_man3_MANS += ERR_load_crypto_strings.3







>
>
>
>
>
>
>
>
>
>
>







206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
dist_man3_MANS += ECDSA_SIG_new.3
dist_man3_MANS += EC_GFp_simple_method.3
dist_man3_MANS += EC_GROUP_copy.3
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
dist_man3_MANS += ERR_clear_error.3
dist_man3_MANS += ERR_error_string.3
dist_man3_MANS += ERR_get_error.3
dist_man3_MANS += ERR_load_crypto_strings.3
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
dist_man3_MANS += d2i_X509_ATTRIBUTE.3
dist_man3_MANS += d2i_X509_CRL.3
dist_man3_MANS += d2i_X509_EXTENSION.3
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
dist_man3_MANS += lh_new.3
dist_man3_MANS += lh_stats.3
dist_man3_MANS += tls_accept_socket.3
dist_man3_MANS += tls_client.3







<







412
413
414
415
416
417
418

419
420
421
422
423
424
425
dist_man3_MANS += d2i_X509_ATTRIBUTE.3
dist_man3_MANS += d2i_X509_CRL.3
dist_man3_MANS += d2i_X509_EXTENSION.3
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 += evp.3
dist_man3_MANS += get_rfc3526_prime_8192.3
dist_man3_MANS += i2d_PKCS7_bio_stream.3
dist_man3_MANS += lh_new.3
dist_man3_MANS += lh_stats.3
dist_man3_MANS += tls_accept_socket.3
dist_man3_MANS += tls_client.3
424
425
426
427
428
429
430







431
432
433
434
435
436
437
dist_man3_MANS += tls_read.3
dist_man5_MANS += openssl.cnf.5
dist_man5_MANS += x509v3.cnf.5
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_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"







>
>
>
>
>
>
>







435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
dist_man3_MANS += tls_read.3
dist_man5_MANS += openssl.cnf.5
dist_man5_MANS += x509v3.cnf.5
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"
858
859
860
861
862
863
864

865
866
867
868
869
870
871
	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_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"







>







876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
	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"
889
890
891
892
893
894
895

896
897
898
899
900
901
902
	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_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"
	ln -sf "DSA_set_method.3" "$(DESTDIR)$(mandir)/man3/DSA_set_default_method.3"
	ln -sf "DSA_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_sign_setup.3"
	ln -sf "DSA_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_verify.3"
	ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3"







>







908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
	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"
	ln -sf "DSA_set_method.3" "$(DESTDIR)$(mandir)/man3/DSA_set_default_method.3"
	ln -sf "DSA_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_sign_setup.3"
	ln -sf "DSA_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_verify.3"
	ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3"
1009
1010
1011
1012
1013
1014
1015


































































































1016
1017
1018
1019
1020
1021
1022
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_point2oct.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_Jprojective_coordinates_GFp.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GF2m.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GFp.3"
	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 "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"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_error_string_n.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_func_error_string.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_lib_error_string.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_reason_error_string.3"







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_point2oct.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_Jprojective_coordinates_GFp.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GF2m.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GFp.3"
	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"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_error_string_n.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_func_error_string.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_lib_error_string.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_reason_error_string.3"
1105
1106
1107
1108
1109
1110
1111

1112
1113
1114
1115
1116
1117
1118
1119
1120

1121
1122
1123
1124
1125
1126
1127
	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_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_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_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_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"
	ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_flags.3"
	ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_iv_length.3"







>









>







1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
	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_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_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_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"
	ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_flags.3"
	ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_iv_length.3"
1218
1219
1220
1221
1222
1223
1224

1225
1226
1227
1228
1229
1230
1231
	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_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"







>







1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
	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"
1288
1289
1290
1291
1292
1293
1294

1295
1296
1297
1298
1299
1300
1301
	ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_set1_EC_KEY.3"
	ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_type.3"
	ln -sf "EVP_PKEY_sign.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_sign_init.3"
	ln -sf "EVP_PKEY_verify.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_init.3"
	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_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"
	ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SignUpdate.3"
	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"







>







1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
	ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_set1_EC_KEY.3"
	ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_type.3"
	ln -sf "EVP_PKEY_sign.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_sign_init.3"
	ln -sf "EVP_PKEY_verify.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_init.3"
	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"
	ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SignUpdate.3"
	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"
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_obj2nid.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_obj2txt.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_sn2nid.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_txt2nid.3"
	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"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_new.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQUEST_free.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_free.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_new.3"







<







1463
1464
1465
1466
1467
1468
1469

1470
1471
1472
1473
1474
1475
1476
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_obj2nid.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_obj2txt.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_sn2nid.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_txt2nid.3"
	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_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"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_new.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQUEST_free.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_free.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_new.3"
1604
1605
1606
1607
1608
1609
1610


1611
1612
1613
1614

1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
	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_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_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"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_OAEP.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_1.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_2.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_none.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DHparams_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DHparams_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSA_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSA_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSAparams_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSAparams_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/RSA_print_fp.3"
	ln -sf "RSA_private_encrypt.3" "$(DESTDIR)$(mandir)/man3/RSA_public_decrypt.3"
	ln -sf "RSA_public_encrypt.3" "$(DESTDIR)$(mandir)/man3/RSA_private_decrypt.3"
	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"
	ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA224.3"







>
>




>



















<


<

<







1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757

1758
1759

1760

1761
1762
1763
1764
1765
1766
1767
	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"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_OAEP.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_1.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_2.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_none.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DHparams_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DHparams_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSA_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSA_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSAparams_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSAparams_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/RSA_print_fp.3"
	ln -sf "RSA_private_encrypt.3" "$(DESTDIR)$(mandir)/man3/RSA_public_decrypt.3"
	ln -sf "RSA_public_encrypt.3" "$(DESTDIR)$(mandir)/man3/RSA_private_decrypt.3"
	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_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_set_default_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"
	ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA224.3"
1735
1736
1737
1738
1739
1740
1741


1742
1743
1744
1745
1746
1747
1748
	ln -sf "SSL_CTX_set_cert_store.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_cert_store.3"
	ln -sf "SSL_CTX_set_cipher_list.3" "$(DESTDIR)$(mandir)/man3/SSL_set_cipher_list.3"
	ln -sf "SSL_CTX_set_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_add_client_CA.3"
	ln -sf "SSL_CTX_set_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_add_client_CA.3"
	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_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"
	ln -sf "SSL_CTX_set_generate_session_id.3" "$(DESTDIR)$(mandir)/man3/SSL_has_matching_session_id.3"
	ln -sf "SSL_CTX_set_generate_session_id.3" "$(DESTDIR)$(mandir)/man3/SSL_set_generate_session_id.3"
	ln -sf "SSL_CTX_set_info_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_info_callback.3"
	ln -sf "SSL_CTX_set_info_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_get_info_callback.3"







>
>







1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
	ln -sf "SSL_CTX_set_cert_store.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_cert_store.3"
	ln -sf "SSL_CTX_set_cipher_list.3" "$(DESTDIR)$(mandir)/man3/SSL_set_cipher_list.3"
	ln -sf "SSL_CTX_set_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_add_client_CA.3"
	ln -sf "SSL_CTX_set_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_add_client_CA.3"
	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"
	ln -sf "SSL_CTX_set_generate_session_id.3" "$(DESTDIR)$(mandir)/man3/SSL_has_matching_session_id.3"
	ln -sf "SSL_CTX_set_generate_session_id.3" "$(DESTDIR)$(mandir)/man3/SSL_set_generate_session_id.3"
	ln -sf "SSL_CTX_set_info_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_info_callback.3"
	ln -sf "SSL_CTX_set_info_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_get_info_callback.3"
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
	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_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"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/SSL_set_verify.3"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/SSL_set_verify_depth.3"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/verify_callback.3"
	ln -sf "SSL_CTX_use_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_check_private_key.3"







|







1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
	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_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"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/SSL_set_verify.3"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/SSL_set_verify_depth.3"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/verify_callback.3"
	ln -sf "SSL_CTX_use_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_check_private_key.3"
1957
1958
1959
1960
1961
1962
1963

1964
1965
1966
1967
1968
1969
1970
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get0_user_data.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get_default_method.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get_method.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_new_method.3"
	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 "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"







>







2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get0_user_data.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get_default_method.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get_method.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_new_method.3"
	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"
2026
2027
2028
2029
2030
2031
2032

2033
2034
2035
2036
2037
2038
2039
	ln -sf "X509_NAME_get_index_by_NID.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_get_text_by_OBJ.3"
	ln -sf "X509_NAME_new.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_free.3"
	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_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"







>







2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
	ln -sf "X509_NAME_get_index_by_NID.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_get_text_by_OBJ.3"
	ln -sf "X509_NAME_new.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_free.3"
	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"
2081
2082
2083
2084
2085
2086
2087

2088
2089
2090
2091
2092
2093
2094
	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_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"







>







2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
	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"
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_high.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_low_normal.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_low_recursive.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_normal.3"
	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"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_comba4.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_comba8.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_normal.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_recursive.3"







<







2340
2341
2342
2343
2344
2345
2346

2347
2348
2349
2350
2351
2352
2353
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_high.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_low_normal.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_low_recursive.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_normal.3"
	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_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"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_comba4.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_comba8.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_normal.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_recursive.3"
2294
2295
2296
2297
2298
2299
2300


2301
2302
2303
2304
2305
2306
2307
2308
2309


2310
2311
2312
2313
2314
2315
2316
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_bio.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_fp.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_bio.3"
	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/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"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAPublicKey.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_bio.3"
	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_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"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECParameters_print.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECParameters_print_fp.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_bio.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_fp.3"







>
>









>
>







2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_bio.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_fp.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_bio.3"
	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"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAPublicKey.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_bio.3"
	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"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECParameters_print.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECParameters_print_fp.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_bio.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_fp.3"
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_bio.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_fp.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_bio.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_fp.3"
	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"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2661
2662
2663
2664
2665
2666
2667
















































































































2668
2669
2670
2671
2672
2673
2674
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_bio.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_fp.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_bio.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_fp.3"
	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 "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"
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770







2771
2772
2773
2774
2775
2776
2777
	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_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_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"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_close.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_error.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_handshake.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_reset.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_write.3"

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_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"







|













>
>
>
>
>
>
>







2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
	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_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.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"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_close.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_error.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_handshake.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_reset.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_write.3"

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"
3198
3199
3200
3201
3202
3203
3204

3205
3206
3207
3208
3209
3210
3211
	-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_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"







>







3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
	-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"
3229
3230
3231
3232
3233
3234
3235

3236
3237
3238
3239
3240
3241
3242
	-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_OpenSSL.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_get_default_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_new_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_set_default_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_sign_setup.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_verify.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3"







>







3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_set_default_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_sign_setup.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_verify.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3"
3349
3350
3351
3352
3353
3354
3355


































































































3356
3357
3358
3359
3360
3361
3362
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_point2oct.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_Jprojective_coordinates_GFp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GF2m.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GFp.3"
	-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/ERR_FATAL_ERROR.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_GET_FUNC.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_GET_REASON.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_error_string_n.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_func_error_string.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_lib_error_string.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_reason_error_string.3"







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_point2oct.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_Jprojective_coordinates_GFp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GF2m.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GFp.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_error_string_n.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_func_error_string.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_lib_error_string.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_reason_error_string.3"
3445
3446
3447
3448
3449
3450
3451

3452
3453
3454
3455
3456
3457
3458
3459
3460

3461
3462
3463
3464
3465
3466
3467
	-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_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_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_key_length.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_padding.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"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_flags.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_iv_length.3"







>









>







3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
	-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_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_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_type.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_asn1_to_param.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_block_size.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_flags.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_iv_length.3"
3558
3559
3560
3561
3562
3563
3564

3565
3566
3567
3568
3569
3570
3571
	-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_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"







>







3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
	-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"
3628
3629
3630
3631
3632
3633
3634

3635
3636
3637
3638
3639
3640
3641
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_set1_EC_KEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_type.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_sign_init.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_init.3"
	-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_size.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignFinal.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignInit_ex.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignUpdate.3"
	-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"







>







3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_set1_EC_KEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_type.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_sign_init.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_init.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignUpdate.3"
	-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"
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_obj2nid.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_obj2txt.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_sn2nid.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_txt2nid.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_new.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQUEST_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_new.3"







<







3809
3810
3811
3812
3813
3814
3815

3816
3817
3818
3819
3820
3821
3822
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_obj2nid.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_obj2txt.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_sn2nid.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_txt2nid.3"
	-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_ONEREQ_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_ONEREQ_new.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_new.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQUEST_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_new.3"
3944
3945
3946
3947
3948
3949
3950


3951
3952
3953
3954

3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
	-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_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_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"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_OAEP.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_1.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_2.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_none.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DHparams_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DHparams_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSAparams_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSAparams_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_public_decrypt.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_private_decrypt.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/SHA224.3"







>
>




>



















<


<

<







4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103

4104
4105

4106

4107
4108
4109
4110
4111
4112
4113
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_OAEP.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_1.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_2.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_none.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DHparams_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DHparams_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSAparams_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSAparams_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_public_decrypt.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_private_decrypt.3"
	-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_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_new_method.3"

	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_set_default_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"
	-rm -f "$(DESTDIR)$(mandir)/man3/SHA224.3"
4075
4076
4077
4078
4079
4080
4081


4082
4083
4084
4085
4086
4087
4088
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_cert_store.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_cipher_list.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_add_client_CA.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_add_client_CA.3"
	-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_set_default_passwd_cb_userdata.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/pem_password_cb.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/GEN_SESSION_CB.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_has_matching_session_id.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_generate_session_id.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_info_callback.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_info_callback.3"







>
>







4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_cert_store.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_cipher_list.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_add_client_CA.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_add_client_CA.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_has_matching_session_id.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_generate_session_id.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_info_callback.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_info_callback.3"
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
	-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_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"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_verify.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_verify_depth.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/verify_callback.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_check_private_key.3"







|







4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
	-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_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"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_verify.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_verify_depth.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/verify_callback.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_check_private_key.3"
4297
4298
4299
4300
4301
4302
4303

4304
4305
4306
4307
4308
4309
4310
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get0_user_data.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get_default_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_new_method.3"
	-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/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"







>







4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get0_user_data.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get_default_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_new_method.3"
	-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"
4366
4367
4368
4369
4370
4371
4372

4373
4374
4375
4376
4377
4378
4379
	-rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_get_text_by_OBJ.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_free.3"
	-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_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"







>







4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
	-rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_get_text_by_OBJ.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_free.3"
	-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"
4421
4422
4423
4424
4425
4426
4427

4428
4429
4430
4431
4432
4433
4434
	-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_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"







>







4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
	-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"
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_high.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_low_normal.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_low_recursive.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_normal.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_comba4.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_comba8.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_normal.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_recursive.3"







<







4686
4687
4688
4689
4690
4691
4692

4693
4694
4695
4696
4697
4698
4699
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_high.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_low_normal.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_low_recursive.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_normal.3"
	-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_set_high.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_set_low.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_set_max.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_comba4.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_comba8.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_normal.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_recursive.3"
4634
4635
4636
4637
4638
4639
4640


4641
4642
4643
4644
4645
4646
4647
4648
4649


4650
4651
4652
4653
4654
4655
4656
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_bio.3"
	-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/i2d_DSAPrivateKey.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPublicKey.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_bio.3"
	-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/ECPKParameters_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECPKParameters_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_dup.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_fp.3"







>
>









>
>







4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_bio.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPublicKey.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_bio.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_fp.3"
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_fp.3"
	-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"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







5007
5008
5009
5010
5011
5012
5013
















































































































5014
5015
5016
5017
5018
5019
5020
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_fp.3"
	-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/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"
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
	-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_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_revocation_time.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_this_update.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_url.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_close.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_error.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_handshake.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_reset.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_write.3"







|








5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
	-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_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.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"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_close.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_error.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_handshake.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_reset.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_write.3"
Changes to jni/libressl/man/Makefile.in.
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343

344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362




363
364
365
366
367
368
369
	SSL_pending.3 SSL_read.3 SSL_renegotiate.3 SSL_rstate_string.3 \
	SSL_session_reused.3 SSL_set1_param.3 SSL_set_bio.3 \
	SSL_set_connect_state.3 SSL_set_fd.3 \
	SSL_set_max_send_fragment.3 SSL_set_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_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 BIO_should_retry.3 BN_BLINDING_new.3 \
	BN_CTX_new.3 BN_CTX_start.3 BN_add.3 BN_add_word.3 BN_bn2bin.3 \
	BN_cmp.3 BN_copy.3 BN_generate_prime.3 \
	BN_get0_nist_prime_521.3 BN_mod_inverse.3 \
	BN_mod_mul_montgomery.3 BN_mod_mul_reciprocal.3 BN_new.3 \
	BN_num_bytes.3 BN_rand.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 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_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 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 \







|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|


|
>
>
>
>







328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358

359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
	SSL_pending.3 SSL_read.3 SSL_renegotiate.3 SSL_rstate_string.3 \
	SSL_session_reused.3 SSL_set1_param.3 SSL_set_bio.3 \
	SSL_set_connect_state.3 SSL_set_fd.3 \
	SSL_set_max_send_fragment.3 SSL_set_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_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 \
	BIO_should_retry.3 BN_BLINDING_new.3 BN_CTX_new.3 \
	BN_CTX_start.3 BN_add.3 BN_add_word.3 BN_bn2bin.3 BN_cmp.3 \
	BN_copy.3 BN_generate_prime.3 BN_get0_nist_prime_521.3 \
	BN_mod_inverse.3 BN_mod_mul_montgomery.3 \
	BN_mod_mul_reciprocal.3 BN_new.3 BN_num_bytes.3 BN_rand.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 \
	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_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 \
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
	d2i_GENERAL_NAME.3 d2i_OCSP_REQUEST.3 d2i_OCSP_RESPONSE.3 \
	d2i_PKCS12.3 d2i_PKCS7.3 d2i_PKCS8PrivateKey_bio.3 \
	d2i_PKCS8_PRIV_KEY_INFO.3 d2i_PKEY_USAGE_PERIOD.3 \
	d2i_POLICYINFO.3 d2i_PROXY_POLICY.3 d2i_PrivateKey.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 \
	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 \
	tls_ocsp_process_response.3 tls_read.3
dist_man5_MANS = openssl.cnf.5 x509v3.cnf.5
all: all-am








|
|







428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
	d2i_GENERAL_NAME.3 d2i_OCSP_REQUEST.3 d2i_OCSP_RESPONSE.3 \
	d2i_PKCS12.3 d2i_PKCS7.3 d2i_PKCS8PrivateKey_bio.3 \
	d2i_PKCS8_PRIV_KEY_INFO.3 d2i_PKEY_USAGE_PERIOD.3 \
	d2i_POLICYINFO.3 d2i_PROXY_POLICY.3 d2i_PrivateKey.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 \
	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 \
	tls_ocsp_process_response.3 tls_read.3
dist_man5_MANS = openssl.cnf.5 x509v3.cnf.5
all: all-am

716
717
718
719
720
721
722







723
724
725
726
727
728
729

.PRECIOUS: Makefile

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_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"







>
>
>
>
>
>
>







720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740

.PRECIOUS: Makefile

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"
1150
1151
1152
1153
1154
1155
1156

1157
1158
1159
1160
1161
1162
1163
	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_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"







>







1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
	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"
1181
1182
1183
1184
1185
1186
1187

1188
1189
1190
1191
1192
1193
1194
	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_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"
	ln -sf "DSA_set_method.3" "$(DESTDIR)$(mandir)/man3/DSA_set_default_method.3"
	ln -sf "DSA_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_sign_setup.3"
	ln -sf "DSA_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_verify.3"
	ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3"







>







1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
	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"
	ln -sf "DSA_set_method.3" "$(DESTDIR)$(mandir)/man3/DSA_set_default_method.3"
	ln -sf "DSA_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_sign_setup.3"
	ln -sf "DSA_sign.3" "$(DESTDIR)$(mandir)/man3/DSA_verify.3"
	ln -sf "ECDSA_SIG_new.3" "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3"
1301
1302
1303
1304
1305
1306
1307


































































































1308
1309
1310
1311
1312
1313
1314
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_point2oct.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_Jprojective_coordinates_GFp.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GF2m.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GFp.3"
	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 "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"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_error_string_n.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_func_error_string.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_lib_error_string.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_reason_error_string.3"







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_point2oct.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_Jprojective_coordinates_GFp.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GF2m.3"
	ln -sf "EC_POINT_new.3" "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GFp.3"
	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"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_error_string_n.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_func_error_string.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_lib_error_string.3"
	ln -sf "ERR_error_string.3" "$(DESTDIR)$(mandir)/man3/ERR_reason_error_string.3"
1397
1398
1399
1400
1401
1402
1403

1404
1405
1406
1407
1408
1409
1410
1411
1412

1413
1414
1415
1416
1417
1418
1419
	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_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_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_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_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"
	ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_flags.3"
	ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_iv_length.3"







>









>







1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
	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_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_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_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"
	ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_flags.3"
	ln -sf "EVP_EncryptInit.3" "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_iv_length.3"
1510
1511
1512
1513
1514
1515
1516

1517
1518
1519
1520
1521
1522
1523
	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_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"







>







1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
	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"
1580
1581
1582
1583
1584
1585
1586

1587
1588
1589
1590
1591
1592
1593
	ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_set1_EC_KEY.3"
	ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_type.3"
	ln -sf "EVP_PKEY_sign.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_sign_init.3"
	ln -sf "EVP_PKEY_verify.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_init.3"
	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_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"
	ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SignUpdate.3"
	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"







>







1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
	ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_set1_EC_KEY.3"
	ln -sf "EVP_PKEY_set1_RSA.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_type.3"
	ln -sf "EVP_PKEY_sign.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_sign_init.3"
	ln -sf "EVP_PKEY_verify.3" "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_init.3"
	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"
	ln -sf "EVP_SignInit.3" "$(DESTDIR)$(mandir)/man3/EVP_SignUpdate.3"
	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"
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_obj2nid.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_obj2txt.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_sn2nid.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_txt2nid.3"
	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"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_new.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQUEST_free.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_free.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_new.3"







<







1748
1749
1750
1751
1752
1753
1754

1755
1756
1757
1758
1759
1760
1761
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_obj2nid.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_obj2txt.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_sn2nid.3"
	ln -sf "OBJ_nid2obj.3" "$(DESTDIR)$(mandir)/man3/OBJ_txt2nid.3"
	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_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"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_new.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_REQUEST_free.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_free.3"
	ln -sf "OCSP_REQUEST_new.3" "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_new.3"
1896
1897
1898
1899
1900
1901
1902


1903
1904
1905
1906

1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
	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_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_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"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_OAEP.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_1.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_2.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_none.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DHparams_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DHparams_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSA_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSA_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSAparams_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSAparams_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/RSA_print_fp.3"
	ln -sf "RSA_private_encrypt.3" "$(DESTDIR)$(mandir)/man3/RSA_public_decrypt.3"
	ln -sf "RSA_public_encrypt.3" "$(DESTDIR)$(mandir)/man3/RSA_private_decrypt.3"
	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"
	ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA224.3"







>
>




>



















<


<

<







2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042

2043
2044

2045

2046
2047
2048
2049
2050
2051
2052
	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"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_OAEP.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_1.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_2.3"
	ln -sf "RSA_padding_add_PKCS1_type_1.3" "$(DESTDIR)$(mandir)/man3/RSA_padding_check_none.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DHparams_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DHparams_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSA_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSA_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSAparams_print.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/DSAparams_print_fp.3"
	ln -sf "RSA_print.3" "$(DESTDIR)$(mandir)/man3/RSA_print_fp.3"
	ln -sf "RSA_private_encrypt.3" "$(DESTDIR)$(mandir)/man3/RSA_public_decrypt.3"
	ln -sf "RSA_public_encrypt.3" "$(DESTDIR)$(mandir)/man3/RSA_private_decrypt.3"
	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_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_set_default_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"
	ln -sf "SHA1.3" "$(DESTDIR)$(mandir)/man3/SHA224.3"
2027
2028
2029
2030
2031
2032
2033


2034
2035
2036
2037
2038
2039
2040
	ln -sf "SSL_CTX_set_cert_store.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_cert_store.3"
	ln -sf "SSL_CTX_set_cipher_list.3" "$(DESTDIR)$(mandir)/man3/SSL_set_cipher_list.3"
	ln -sf "SSL_CTX_set_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_add_client_CA.3"
	ln -sf "SSL_CTX_set_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_add_client_CA.3"
	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_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"
	ln -sf "SSL_CTX_set_generate_session_id.3" "$(DESTDIR)$(mandir)/man3/SSL_has_matching_session_id.3"
	ln -sf "SSL_CTX_set_generate_session_id.3" "$(DESTDIR)$(mandir)/man3/SSL_set_generate_session_id.3"
	ln -sf "SSL_CTX_set_info_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_info_callback.3"
	ln -sf "SSL_CTX_set_info_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_get_info_callback.3"







>
>







2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
	ln -sf "SSL_CTX_set_cert_store.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_cert_store.3"
	ln -sf "SSL_CTX_set_cipher_list.3" "$(DESTDIR)$(mandir)/man3/SSL_set_cipher_list.3"
	ln -sf "SSL_CTX_set_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_add_client_CA.3"
	ln -sf "SSL_CTX_set_client_CA_list.3" "$(DESTDIR)$(mandir)/man3/SSL_add_client_CA.3"
	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"
	ln -sf "SSL_CTX_set_generate_session_id.3" "$(DESTDIR)$(mandir)/man3/SSL_has_matching_session_id.3"
	ln -sf "SSL_CTX_set_generate_session_id.3" "$(DESTDIR)$(mandir)/man3/SSL_set_generate_session_id.3"
	ln -sf "SSL_CTX_set_info_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_info_callback.3"
	ln -sf "SSL_CTX_set_info_callback.3" "$(DESTDIR)$(mandir)/man3/SSL_get_info_callback.3"
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
	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_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"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/SSL_set_verify.3"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/SSL_set_verify_depth.3"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/verify_callback.3"
	ln -sf "SSL_CTX_use_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_check_private_key.3"







|







2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
	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_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"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/SSL_set_verify.3"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/SSL_set_verify_depth.3"
	ln -sf "SSL_CTX_set_verify.3" "$(DESTDIR)$(mandir)/man3/verify_callback.3"
	ln -sf "SSL_CTX_use_certificate.3" "$(DESTDIR)$(mandir)/man3/SSL_CTX_check_private_key.3"
2249
2250
2251
2252
2253
2254
2255

2256
2257
2258
2259
2260
2261
2262
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get0_user_data.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get_default_method.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get_method.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_new_method.3"
	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 "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"







>







2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get0_user_data.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get_default_method.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_get_method.3"
	ln -sf "UI_new.3" "$(DESTDIR)$(mandir)/man3/UI_new_method.3"
	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"
2318
2319
2320
2321
2322
2323
2324

2325
2326
2327
2328
2329
2330
2331
	ln -sf "X509_NAME_get_index_by_NID.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_get_text_by_OBJ.3"
	ln -sf "X509_NAME_new.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_free.3"
	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_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"







>







2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
	ln -sf "X509_NAME_get_index_by_NID.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_get_text_by_OBJ.3"
	ln -sf "X509_NAME_new.3" "$(DESTDIR)$(mandir)/man3/X509_NAME_free.3"
	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"
2373
2374
2375
2376
2377
2378
2379

2380
2381
2382
2383
2384
2385
2386
	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_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"







>







2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
	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"
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_high.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_low_normal.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_low_recursive.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_normal.3"
	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"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_comba4.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_comba8.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_normal.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_recursive.3"







<







2625
2626
2627
2628
2629
2630
2631

2632
2633
2634
2635
2636
2637
2638
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_high.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_low_normal.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_low_recursive.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_mul_normal.3"
	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_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"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_comba4.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_comba8.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_normal.3"
	ln -sf "bn_dump.3" "$(DESTDIR)$(mandir)/man3/bn_sqr_recursive.3"
2586
2587
2588
2589
2590
2591
2592


2593
2594
2595
2596
2597
2598
2599
2600
2601


2602
2603
2604
2605
2606
2607
2608
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_bio.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_fp.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_bio.3"
	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/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"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAPublicKey.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_bio.3"
	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_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"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECParameters_print.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECParameters_print_fp.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_bio.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_fp.3"







>
>









>
>







2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_bio.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_fp.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_bio.3"
	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"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSAPublicKey.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY.3"
	ln -sf "d2i_DSAPublicKey.3" "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_bio.3"
	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"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECParameters_print.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/ECParameters_print_fp.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_bio.3"
	ln -sf "d2i_ECPKParameters.3" "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_fp.3"
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_bio.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_fp.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_bio.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_fp.3"
	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"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2946
2947
2948
2949
2950
2951
2952
















































































































2953
2954
2955
2956
2957
2958
2959
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_bio.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_fp.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_bio.3"
	ln -sf "d2i_X509_SIG.3" "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_fp.3"
	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 "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"
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062







3063
3064
3065
3066
3067
3068
3069
	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_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_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"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_close.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_error.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_handshake.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_reset.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_write.3"

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_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"







|













>
>
>
>
>
>
>







3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
	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_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.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"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_close.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_error.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_handshake.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_reset.3"
	ln -sf "tls_read.3" "$(DESTDIR)$(mandir)/man3/tls_write.3"

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"
3490
3491
3492
3493
3494
3495
3496

3497
3498
3499
3500
3501
3502
3503
	-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_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"







>







3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
	-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"
3521
3522
3523
3524
3525
3526
3527

3528
3529
3530
3531
3532
3533
3534
	-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_OpenSSL.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_get_default_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_new_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_set_default_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_sign_setup.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_verify.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3"







>







3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_set_default_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_sign_setup.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_verify.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECDSA_OpenSSL.3"
3641
3642
3643
3644
3645
3646
3647


































































































3648
3649
3650
3651
3652
3653
3654
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_point2oct.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_Jprojective_coordinates_GFp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GF2m.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GFp.3"
	-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/ERR_FATAL_ERROR.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_GET_FUNC.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_GET_REASON.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_error_string_n.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_func_error_string.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_lib_error_string.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_reason_error_string.3"







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_point2oct.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_Jprojective_coordinates_GFp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GF2m.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EC_POINT_set_affine_coordinates_GFp.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_error_string_n.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_func_error_string.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_lib_error_string.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ERR_reason_error_string.3"
3737
3738
3739
3740
3741
3742
3743

3744
3745
3746
3747
3748
3749
3750
3751
3752

3753
3754
3755
3756
3757
3758
3759
	-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_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_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_key_length.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_CTX_set_padding.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"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_flags.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_iv_length.3"







>









>







3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
	-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_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_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_type.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_asn1_to_param.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_block_size.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_flags.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_CIPHER_iv_length.3"
3850
3851
3852
3853
3854
3855
3856

3857
3858
3859
3860
3861
3862
3863
	-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_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"







>







3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
	-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"
3920
3921
3922
3923
3924
3925
3926

3927
3928
3929
3930
3931
3932
3933
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_set1_EC_KEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_type.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_sign_init.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_init.3"
	-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_size.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignFinal.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignInit_ex.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignUpdate.3"
	-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"







>







4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_set1_EC_KEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_type.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_sign_init.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_PKEY_verify_init.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/EVP_SignUpdate.3"
	-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"
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_obj2nid.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_obj2txt.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_sn2nid.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_txt2nid.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_new.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQUEST_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_new.3"







<







4094
4095
4096
4097
4098
4099
4100

4101
4102
4103
4104
4105
4106
4107
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_obj2nid.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_obj2txt.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_sn2nid.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OBJ_txt2nid.3"
	-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_ONEREQ_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_ONEREQ_new.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQINFO_new.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_REQUEST_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_free.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/OCSP_SIGNATURE_new.3"
4236
4237
4238
4239
4240
4241
4242


4243
4244
4245
4246

4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
	-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_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_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"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_OAEP.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_1.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_2.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_none.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DHparams_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DHparams_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSAparams_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSAparams_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_public_decrypt.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_private_decrypt.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/SHA224.3"







>
>




>



















<


<

<







4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388

4389
4390

4391

4392
4393
4394
4395
4396
4397
4398
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_OAEP.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_1.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_PKCS1_type_2.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_padding_check_none.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DHparams_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DHparams_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSA_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSAparams_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/DSAparams_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_public_decrypt.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_private_decrypt.3"
	-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_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_new_method.3"

	-rm -f "$(DESTDIR)$(mandir)/man3/RSA_set_default_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"
	-rm -f "$(DESTDIR)$(mandir)/man3/SHA224.3"
4367
4368
4369
4370
4371
4372
4373


4374
4375
4376
4377
4378
4379
4380
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_cert_store.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_cipher_list.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_add_client_CA.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_add_client_CA.3"
	-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_set_default_passwd_cb_userdata.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/pem_password_cb.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/GEN_SESSION_CB.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_has_matching_session_id.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_generate_session_id.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_info_callback.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_info_callback.3"







>
>







4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_cert_store.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_cipher_list.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_add_client_CA.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_add_client_CA.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_has_matching_session_id.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_generate_session_id.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_get_info_callback.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_get_info_callback.3"
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
	-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_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"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_verify.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_verify_depth.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/verify_callback.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_check_private_key.3"







|







4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
	-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_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"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_verify.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_set_verify_depth.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/verify_callback.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/SSL_CTX_check_private_key.3"
4589
4590
4591
4592
4593
4594
4595

4596
4597
4598
4599
4600
4601
4602
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get0_user_data.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get_default_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_new_method.3"
	-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/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"







>







4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get0_user_data.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get_default_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_get_method.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/UI_new_method.3"
	-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"
4658
4659
4660
4661
4662
4663
4664

4665
4666
4667
4668
4669
4670
4671
	-rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_get_text_by_OBJ.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_free.3"
	-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_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"







>







4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
	-rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_get_text_by_OBJ.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/X509_NAME_free.3"
	-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"
4713
4714
4715
4716
4717
4718
4719

4720
4721
4722
4723
4724
4725
4726
	-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_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"







>







4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
	-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"
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_high.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_low_normal.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_low_recursive.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_normal.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_comba4.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_comba8.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_normal.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_recursive.3"







<







4971
4972
4973
4974
4975
4976
4977

4978
4979
4980
4981
4982
4983
4984
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_high.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_low_normal.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_low_recursive.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_mul_normal.3"
	-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_set_high.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_set_low.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_set_max.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_comba4.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_comba8.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_normal.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/bn_sqr_recursive.3"
4926
4927
4928
4929
4930
4931
4932


4933
4934
4935
4936
4937
4938
4939
4940
4941


4942
4943
4944
4945
4946
4947
4948
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_bio.3"
	-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/i2d_DSAPrivateKey.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPrivateKey_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPublicKey.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_bio.3"
	-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/ECPKParameters_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECPKParameters_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_dup.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_fp.3"







>
>









>
>







5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSAPrivateKey_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_DSA_PUBKEY_bio.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSAPublicKey.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_DSA_PUBKEY_bio.3"
	-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"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_print.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/ECParameters_print_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_ECPKParameters_fp.3"
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_fp.3"
	-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"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







5292
5293
5294
5295
5296
5297
5298
















































































































5299
5300
5301
5302
5303
5304
5305
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/d2i_PKCS8_fp.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_bio.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/i2d_PKCS8_fp.3"
	-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/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"
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
	-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_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_revocation_time.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_this_update.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_peer_ocsp_url.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_close.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_error.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_handshake.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_reset.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_write.3"

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:







|












5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
	-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_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.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"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_close.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_error.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_handshake.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_reset.3"
	-rm -f "$(DESTDIR)$(mandir)/man3/tls_write.3"

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
Changes to jni/libressl/man/OBJ_nid2obj.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: OBJ_nid2obj.3,v 1.10 2018/03/21 21:18:08 schwarze Exp $
.\"	OpenSSL c264592d May 14 11:28:00 2006 +0000
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.\" 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 2018 $
.Dt OBJ_NID2OBJ 3
.Os
.Sh NAME
.Nm OBJ_nid2obj ,
.Nm OBJ_nid2ln ,
.Nm OBJ_nid2sn ,
.Nm OBJ_obj2nid ,







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.\" 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 25 2018 $
.Dt OBJ_NID2OBJ 3
.Os
.Sh NAME
.Nm OBJ_nid2obj ,
.Nm OBJ_nid2ln ,
.Nm OBJ_nid2sn ,
.Nm OBJ_obj2nid ,
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.Ft void
.Fn OBJ_cleanup void
.In openssl/asn1.h
.Ft int
.Fo i2t_ASN1_OBJECT
.Fa "char *buf"
.Fa "int buf_len"
.Fa "ASN1_OBJECT *a"
.Fc
.Sh DESCRIPTION
The ASN.1 object utility functions process
.Vt ASN1_OBJECT
structures which are a representation of the ASN.1 OBJECT IDENTIFIER
(OID) type.
For convenience, OIDs are usually represented in source code as







|







145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.Ft void
.Fn OBJ_cleanup void
.In openssl/asn1.h
.Ft int
.Fo i2t_ASN1_OBJECT
.Fa "char *buf"
.Fa "int buf_len"
.Fa "const ASN1_OBJECT *a"
.Fc
.Sh DESCRIPTION
The ASN.1 object utility functions process
.Vt ASN1_OBJECT
structures which are a representation of the ASN.1 OBJECT IDENTIFIER
(OID) type.
For convenience, OIDs are usually represented in source code as
374
375
376
377
378
379
380
381
382


383
384
385
386
387
388
389
390
391
.Fn OBJ_nid2ln ,
.Fn OBJ_nid2sn ,
.Fn OBJ_obj2nid ,
.Fn OBJ_ln2nid ,
.Fn OBJ_sn2nid ,
.Fn OBJ_txt2nid ,
.Fn OBJ_cmp ,
.Fn OBJ_dup ,
and


.Fn OBJ_cleanup
appeared in SSLeay 0.8.1b or earlier.
.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







<

>
>

|







374
375
376
377
378
379
380

381
382
383
384
385
386
387
388
389
390
391
392
.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
Changes to jni/libressl/man/OCSP_CRLID_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.\"	$OpenBSD: OCSP_CRLID_new.3,v 1.4 2018/03/22 21:08:22 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 22 2018 $
.Dt OCSP_CRLID_NEW 3
.Os
.Sh NAME
.Nm OCSP_CRLID_new ,
.Nm OCSP_CRLID_free ,
.Nm OCSP_crlID_new
.Nd OCSP CRL extension
.Sh SYNOPSIS
.In opsenssl/ocsp.h
.Ft OCSP_CRLID *
.Fn OCSP_CRLID_new void
.Ft void
.Fn OCSP_CRLID_free "OCSP_CRLID *crlid"
.Ft X509_EXTENSION *
.Fo OCSP_crlID_new
.Fa "char *url"
.Fa "long *number"
.Fa "char *time"
.Fc
.Sh DESCRIPTION
If a client asks about the validity of a certificate and it turns
out to be invalid, the responder may optionally communicate which
certificate revocation list the certificate was found on.
|















|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.\"	$OpenBSD: OCSP_CRLID_new.3,v 1.6 2018/05/13 14:36:05 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 13 2018 $
.Dt OCSP_CRLID_NEW 3
.Os
.Sh NAME
.Nm OCSP_CRLID_new ,
.Nm OCSP_CRLID_free ,
.Nm OCSP_crlID_new
.Nd OCSP CRL extension
.Sh SYNOPSIS
.In opsenssl/ocsp.h
.Ft OCSP_CRLID *
.Fn OCSP_CRLID_new void
.Ft void
.Fn OCSP_CRLID_free "OCSP_CRLID *crlid"
.Ft X509_EXTENSION *
.Fo OCSP_crlID_new
.Fa "const char *url"
.Fa "long *number"
.Fa "char *time"
.Fc
.Sh DESCRIPTION
If a client asks about the validity of a certificate and it turns
out to be invalid, the responder may optionally communicate which
certificate revocation list the certificate was found on.
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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 has been available since
.Ox 3.2 .
.Sh CAVEATS
The function names
.Fn OCSP_CRLID_new
and
.Fn OCSP_crlID_new
only differ in case.







|







98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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
and
.Fn OCSP_crlID_new
only differ in case.
Changes to jni/libressl/man/OCSP_SERVICELOC_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.\"	$OpenBSD: OCSP_SERVICELOC_new.3,v 1.6 2018/03/22 21:08:22 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 22 2018 $
.Dt OCSP_SERVICELOC_NEW 3
.Os
.Sh NAME
.Nm OCSP_SERVICELOC_new ,
.Nm OCSP_SERVICELOC_free ,
.Nm OCSP_url_svcloc_new
.Nd OCSP service locator extension
.Sh SYNOPSIS
.In openssl/ocsp.h
.Ft OCSP_SERVICELOC *
.Fn OCSP_SERVICELOC_new void
.Ft void
.Fn OCSP_SERVICELOC_free "OCSP_SERVICELOC *sloc"
.Ft X509_EXTENSION *
.Fo OCSP_url_svcloc_new
.Fa "X509_NAME *issuer"
.Fa "char **urls"
.Fc
.Sh DESCRIPTION
Due to restrictions of network routing, a client may be unable to
directly contact the authoritative OCSP server for a certificate
that needs to be checked.
In that case, the request can be sent via a proxy server.
An ASN.1
|















|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.\"	$OpenBSD: OCSP_SERVICELOC_new.3,v 1.7 2018/05/13 14:36:05 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 13 2018 $
.Dt OCSP_SERVICELOC_NEW 3
.Os
.Sh NAME
.Nm OCSP_SERVICELOC_new ,
.Nm OCSP_SERVICELOC_free ,
.Nm OCSP_url_svcloc_new
.Nd OCSP service locator extension
.Sh SYNOPSIS
.In openssl/ocsp.h
.Ft OCSP_SERVICELOC *
.Fn OCSP_SERVICELOC_new void
.Ft void
.Fn OCSP_SERVICELOC_free "OCSP_SERVICELOC *sloc"
.Ft X509_EXTENSION *
.Fo OCSP_url_svcloc_new
.Fa "X509_NAME *issuer"
.Fa "const char **urls"
.Fc
.Sh DESCRIPTION
Due to restrictions of network routing, a client may be unable to
directly contact the authoritative OCSP server for a certificate
that needs to be checked.
In that case, the request can be sent via a proxy server.
An ASN.1
Changes to jni/libressl/man/OCSP_cert_to_id.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: OCSP_cert_to_id.3,v 1.7 2018/03/22 21:08:22 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
.\" 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 22 2018 $
.Dt OCSP_CERT_TO_ID 3
.Os
.Sh NAME
.Nm OCSP_CERTID_new ,
.Nm OCSP_CERTID_free ,
.Nm OCSP_cert_to_id ,
.Nm OCSP_cert_id_new ,
.Nm OCSP_id_issuer_cmp ,
.Nm OCSP_id_cmp ,
.Nm OCSP_id_get0_info
.Nd OCSP certificate ID utility functions
.Sh SYNOPSIS
.In openssl/ocsp.h
.Ft OCSP_CERTID *
.Fn OCSP_CERTID_new void
.Ft void
.Fn OCSP_CERTID_free "OCSP_CERTID *id"
.Ft OCSP_CERTID *
.Fo OCSP_cert_to_id
.Fa "const EVP_MD *dgst"
.Fa "X509 *subject"
.Fa "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"
.Fc
.Ft int
.Fo OCSP_id_issuer_cmp
.Fa "OCSP_CERTID *a"
.Fa "OCSP_CERTID *b"
.Fc
.Ft int







|




















|
|




|
|
|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
.\" 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: August 24 2018 $
.Dt OCSP_CERT_TO_ID 3
.Os
.Sh NAME
.Nm OCSP_CERTID_new ,
.Nm OCSP_CERTID_free ,
.Nm OCSP_cert_to_id ,
.Nm OCSP_cert_id_new ,
.Nm OCSP_id_issuer_cmp ,
.Nm OCSP_id_cmp ,
.Nm OCSP_id_get0_info
.Nd OCSP certificate ID utility functions
.Sh SYNOPSIS
.In openssl/ocsp.h
.Ft OCSP_CERTID *
.Fn OCSP_CERTID_new void
.Ft void
.Fn OCSP_CERTID_free "OCSP_CERTID *id"
.Ft OCSP_CERTID *
.Fo OCSP_cert_to_id
.Fa "const EVP_MD *dgst"
.Fa "const X509 *subject"
.Fa "const X509 *issuer"
.Fc
.Ft OCSP_CERTID *
.Fo OCSP_cert_id_new
.Fa "const EVP_MD *dgst"
.Fa "const X509_NAME *issuerName"
.Fa "const ASN1_BIT_STRING *issuerKey"
.Fa "const ASN1_INTEGER *serialNumber"
.Fc
.Ft int
.Fo OCSP_id_issuer_cmp
.Fa "OCSP_CERTID *a"
.Fa "OCSP_CERTID *b"
.Fc
.Ft int
Changes to jni/libressl/man/OPENSSL_VERSION_NUMBER.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: OPENSSL_VERSION_NUMBER.3,v 1.9 2018/03/23 23:18:17 schwarze Exp $
.\" full merge up to: OpenSSL 1f13ad31 Dec 25 17:50:39 2017 +0800
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\" $OpenBSD: OPENSSL_VERSION_NUMBER.3,v 1.10 2018/03/27 17:35:50 schwarze Exp $
.\" full merge up to: OpenSSL 1f13ad31 Dec 25 17:50:39 2017 +0800
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
.\" 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 OPENSSL_VERSION_NUMBER 3
.Os
.Sh NAME
.Nm OPENSSL_VERSION_NUMBER ,
.Nm LIBRESSL_VERSION_NUMBER ,
.Nm LIBRESSL_VERSION_TEXT ,
.Nm OpenSSL_version_num ,







|







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
.\" 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 OPENSSL_VERSION_NUMBER 3
.Os
.Sh NAME
.Nm OPENSSL_VERSION_NUMBER ,
.Nm LIBRESSL_VERSION_NUMBER ,
.Nm LIBRESSL_VERSION_TEXT ,
.Nm OpenSSL_version_num ,
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260

261
262
263
264
265
266
267
.Sh SEE ALSO
.Xr crypto 3
.Sh HISTORY
.Fn SSLeay ,
.Fn SSLeay_version ,
and
.Dv SSLEAY_VERSION_NUMBER
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
.Dv OPENSSL_VERSION_NUMBER
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.

.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







|








|
>







244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
.Sh SEE ALSO
.Xr crypto 3
.Sh HISTORY
.Fn SSLeay ,
.Fn SSLeay_version ,
and
.Dv SSLEAY_VERSION_NUMBER
first appeared in SSLeay 0.6.0 and have been available since
.Ox 2.4 .
.Pp
.Dv OPENSSL_VERSION_NUMBER
first appeared in the first OpenSSL release, OpenSSL 0.9.1c,
and has been available since
.Ox 2.6 .
.Pp
.Dv SSLEAY_DIR
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
Changes to jni/libressl/man/OPENSSL_config.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: OPENSSL_config.3,v 1.10 2018/03/22 21:08:22 schwarze Exp $
.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\" $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 is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 22 2018 $
.Dt OPENSSL_CONFIG 3
.Os
.Sh NAME
.Nm OPENSSL_config ,
.Nm OPENSSL_no_config
.Nd simple crypto and ssl library configuration
.Sh SYNOPSIS







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 7 2018 $
.Dt OPENSSL_CONFIG 3
.Os
.Sh NAME
.Nm OPENSSL_config ,
.Nm OPENSSL_no_config
.Nd simple crypto and ssl library configuration
.Sh SYNOPSIS
100
101
102
103
104
105
106

107
108



109
110
111
112
113
114
115
116
is used.
Any errors are ignored.
Further calls to
.Fn OPENSSL_config
have no effect.
.Pp
.Fn OPENSSL_no_config

has no effect except that later calls to
.Fn OPENSSL_config



will be ignored.
.Pp
Calling these functions is optional.
All required initialization of the crypto libraries happens
automatically when needed.
.Pp
If an application is compiled with the preprocessor symbol
.Dv OPENSSL_LOAD_CONF







>
|

>
>
>
|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
is used.
Any errors are ignored.
Further calls to
.Fn OPENSSL_config
have no effect.
.Pp
.Fn OPENSSL_no_config
suppresses the loading of any configuration file, so that any
future calls to
.Fn OPENSSL_config
or to
.Xr OPENSSL_init_crypto 3
will ensure the library is initialized but no configuration
file will be loaded.
.Pp
Calling these functions is optional.
All required initialization of the crypto libraries happens
automatically when needed.
.Pp
If an application is compiled with the preprocessor symbol
.Dv OPENSSL_LOAD_CONF
Changes to jni/libressl/man/OPENSSL_malloc.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: OPENSSL_malloc.3,v 1.7 2018/03/23 02:20:16 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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_MALLOC 3
.Os
.Sh NAME
.Nm OPENSSL_malloc ,
.Nm OPENSSL_realloc ,
.Nm OPENSSL_free ,
.Nm OPENSSL_strdup ,
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: OPENSSL_malloc.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt OPENSSL_MALLOC 3
.Os
.Sh NAME
.Nm OPENSSL_malloc ,
.Nm OPENSSL_realloc ,
.Nm OPENSSL_free ,
.Nm OPENSSL_strdup ,
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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
appeared in SSLeay 0.8.1b or earlier 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







|







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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
Changes to jni/libressl/man/OPENSSL_sk_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\" $OpenBSD: OPENSSL_sk_new.3,v 1.7 2018/03/23 00:09:11 schwarze Exp $
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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_SK_NEW 3
.Os
.Sh NAME
.Nm sk_new_null ,
.Nm sk_new ,
.Nm sk_set_cmp_func ,
.Nm sk_dup ,
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\" $OpenBSD: OPENSSL_sk_new.3,v 1.10 2018/08/08 18:21:02 tb Exp $
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 ,
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
.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-generates 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







|







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
.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
275
276
277
278
279
280
281

282
283
284
285
286
287
288
289
290
Calling
.Fn sk_new_null
or
.Fn sk_new ,
successfuly calling
.Fn sk_push ,
.Fn sk_unshift ,

or
.Fn sk_insert ,
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.







>

|







275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
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.
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542

543



544
545
546

547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
.Fa wanted
or
.Dv NULL
if it is not found.
.Sh HISTORY
.Fn sk_new_null ,
.Fn sk_new ,
.Fn sk_set_cmp_func ,
.Fn sk_dup ,
.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 ,

.Fn sk_delete_ptr ,



and
.Fn sk_zero
appeared in SSLeay 0.8.1b or earlier and 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_new_null
first appeared in OpenSSL 0.9.6 and has been available since
.Ox 2.9 .
.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
.Fn sk_set
does not set the state of the
.Fa stack
to unsorted.
This can cause wrong results from subsequent
.Fn sk_find
and
.Fn sk_find_ex .
.Pp
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







<
<











>
|
>
>
>


|
>









<
<
<
<








<
<
<
<
<
<
<
<
<







524
525
526
527
528
529
530


531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559




560
561
562
563
564
565
566
567









568
569
570
571
572
573
574
.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
Changes to jni/libressl/man/OpenSSL_add_all_algorithms.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: OpenSSL_add_all_algorithms.3,v 1.6 2018/03/22 16:06:33 schwarze Exp $
.\" full merge up to: OpenSSL b3696a55 Sep 2 09:35:50 2017 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2003, 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
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>.
.\" Copyright (c) 2000, 2003, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt OPENSSL_ADD_ALL_ALGORITHMS 3
.Os
.Sh NAME
.Nm OpenSSL_add_all_algorithms ,
.Nm OpenSSL_add_all_ciphers ,
.Nm OpenSSL_add_all_digests ,
.Nm EVP_cleanup







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 OPENSSL_ADD_ALL_ALGORITHMS 3
.Os
.Sh NAME
.Nm OpenSSL_add_all_algorithms ,
.Nm OpenSSL_add_all_ciphers ,
.Nm OpenSSL_add_all_digests ,
.Nm EVP_cleanup
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
.Sh HISTORY
.Fn EVP_cleanup
and precursor functions
.Fn SSLeay_add_all_algorithms ,
.Fn SSLeay_add_all_ciphers ,
and
.Fn SSLeay_add_all_digests
appeared in SSLeay 0.8.1b or earlier 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.
This will only happen as a result of a memory allocation failure so this
is not too much of a problem in practice.







|













101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
.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.
This will only happen as a result of a memory allocation failure so this
is not too much of a problem in practice.
Changes to jni/libressl/man/PEM_read.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: PEM_read.3,v 1.4 2018/03/21 00:37:32 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Viktor Dukhovni
.\" and by Rich Salz <rsalz@openssl.org>.
.\" Copyright (c) 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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
.\" and by Rich Salz <rsalz@openssl.org>.
.\" Copyright (c) 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.\" 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 2018 $
.Dt PEM_READ 3
.Os
.Sh NAME
.Nm PEM_write ,
.Nm PEM_write_bio ,
.Nm PEM_read ,
.Nm PEM_read_bio ,
.Nm PEM_do_header ,
.Nm PEM_get_EVP_CIPHER_INFO
.Nd PEM encoding routines
.Sh SYNOPSIS
.In openssl/pem.h
.Ft int
.Fo PEM_write
.Fa "FILE *fp"
.Fa "char *name"
.Fa "char *header"
.Fa "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 "long len"
.Fc
.Ft int
.Fo PEM_read
.Fa "FILE *fp"
.Fa "char **name"
.Fa "char **header"







|















|
|
|






|
|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.\" 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 PEM_READ 3
.Os
.Sh NAME
.Nm PEM_write ,
.Nm PEM_write_bio ,
.Nm PEM_read ,
.Nm PEM_read_bio ,
.Nm PEM_do_header ,
.Nm PEM_get_EVP_CIPHER_INFO
.Nd PEM encoding routines
.Sh SYNOPSIS
.In openssl/pem.h
.Ft int
.Fo PEM_write
.Fa "FILE *fp"
.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 "const char *header"
.Fa "ocnst unsigned char *data"
.Fa "long len"
.Fc
.Ft int
.Fo PEM_read
.Fa "FILE *fp"
.Fa "char **name"
.Fa "char **header"
279
280
281
282
283
284
285






286




287
288
.Sh SEE ALSO
.Xr d2i_PKCS8PrivateKey_bio 3 ,
.Xr ERR_GET_LIB 3 ,
.Xr ERR_peek_last_error 3 ,
.Xr PEM_bytes_read_bio 3 ,
.Xr PEM_read_bio_PrivateKey 3
.Sh HISTORY






These functions appeared in SSLeay 0.8.1b or earlier




and have been available since
.Ox 2.4 .







>
>
>
>
>
>
|
>
>
>
>
|

279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
.Sh SEE ALSO
.Xr d2i_PKCS8PrivateKey_bio 3 ,
.Xr ERR_GET_LIB 3 ,
.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 .
Changes to jni/libressl/man/PEM_read_SSL_SESSION.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: PEM_read_SSL_SESSION.3,v 1.2 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL doc/man3/PEM_read_CMS.pod b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Rich Salz <rsalz@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <rsalz@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt PEM_READ_SSL_SESSION 3
.Os
.Sh NAME
.Nm PEM_read_SSL_SESSION ,
.Nm PEM_read_bio_SSL_SESSION ,
.Nm PEM_write_SSL_SESSION ,
.Nm PEM_write_bio_SSL_SESSION







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 PEM_READ_SSL_SESSION 3
.Os
.Sh NAME
.Nm PEM_read_SSL_SESSION ,
.Nm PEM_read_bio_SSL_SESSION ,
.Nm PEM_write_SSL_SESSION ,
.Nm PEM_write_bio_SSL_SESSION
130
131
132
133
134
135
136
137
138
139


140
141

142
143
.Fn PEM_write_SSL_SESSION
and
.Fn PEM_write_bio_SSL_SESSION
return the number of bytes written or 0 on error.
.Sh SEE ALSO
.Xr PEM_read 3
.Sh HISTORY
.Fn PEM_read_SSL_SESSION ,
.Fn PEM_read_bio_SSL_SESSION ,
.Fn PEM_write_SSL_SESSION ,


and
.Fn PEM_write_bio_SSL_SESSION

appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|
|
|
>
>


>
|

130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
.Fn PEM_write_SSL_SESSION
and
.Fn PEM_write_bio_SSL_SESSION
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 .
Changes to jni/libressl/man/PEM_read_bio_PrivateKey.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: PEM_read_bio_PrivateKey.3,v 1.12 2018/03/23 00:09:11 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2001-2004, 2009, 2013-2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2001-2004, 2009, 2013-2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 PEM_READ_BIO_PRIVATEKEY 3
.Os
.Sh NAME
.Nm PEM_read_bio_PrivateKey ,
.Nm PEM_read_PrivateKey ,
.Nm PEM_write_bio_PrivateKey ,
.Nm PEM_write_PrivateKey ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 PEM_READ_BIO_PRIVATEKEY 3
.Os
.Sh NAME
.Nm PEM_read_bio_PrivateKey ,
.Nm PEM_read_PrivateKey ,
.Nm PEM_write_bio_PrivateKey ,
.Nm PEM_write_PrivateKey ,
1213
1214
1215
1216
1217
1218
1219
1220



1221
1222


1223

1224

1225
1226


1227

1228
1229

1230
1231
1232
1233
1234
1235
1236
1237
1238

1239
1240
1241
1242
1243
1244
1245
1246
1247
1248

1249

1250
1251
1252
1253
1254

1255

1256
1257
1258
1259
1260
1261

1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
}
.Ed
.Sh SEE ALSO
.Xr BIO_new 3 ,
.Xr PEM_bytes_read_bio 3 ,
.Xr PEM_read 3
.Sh HISTORY
.Fn PEM_read_bio_PrivateKey ,



.Fn PEM_read_PrivateKey ,
.Fn PEM_write_bio_PrivateKey ,


.Fn PEM_write_PrivateKey ,

.Fn PEM_read_bio_RSAPrivateKey ,

.Fn PEM_read_RSAPrivateKey ,
.Fn PEM_write_bio_RSAPrivateKey ,


.Fn PEM_write_RSAPrivateKey ,

.Fn PEM_read_bio_RSAPublicKey ,
.Fn PEM_read_RSAPublicKey ,

.Fn PEM_write_bio_RSAPublicKey ,
.Fn PEM_write_RSAPublicKey ,
.Fn PEM_read_bio_DSAPrivateKey ,
.Fn PEM_read_DSAPrivateKey ,
.Fn PEM_write_bio_DSAPrivateKey ,
.Fn PEM_write_DSAPrivateKey ,
.Fn PEM_read_bio_DSAparams ,
.Fn PEM_read_DSAparams ,
.Fn PEM_write_bio_DSAparams ,

.Fn PEM_write_DSAparams ,
.Fn PEM_read_bio_DHparams ,
.Fn PEM_read_DHparams ,
.Fn PEM_write_bio_DHparams ,
.Fn PEM_write_DHparams ,
.Fn PEM_read_bio_X509 ,
.Fn PEM_read_X509 ,
.Fn PEM_write_bio_X509 ,
.Fn PEM_write_X509 ,
.Fn PEM_read_bio_X509_REQ ,

.Fn PEM_read_X509_REQ ,

.Fn PEM_write_bio_X509_REQ ,
.Fn PEM_write_X509_REQ ,
.Fn PEM_read_bio_X509_CRL ,
.Fn PEM_read_X509_CRL ,
.Fn PEM_write_bio_X509_CRL ,

.Fn PEM_write_X509_CRL ,

.Fn PEM_read_bio_PKCS7 ,
.Fn PEM_read_PKCS7 ,
.Fn PEM_write_bio_PKCS7 ,
and
.Fn PEM_write_PKCS7
appeared in SSLeay 0.8.1b or earlier and 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 ,







|
>
>
>
|
|
>
>
|
>
|
>
|
|
>
>
|
>
|
|
>
|
<




|
<
|
>
|
|
<
|
<
|
<
|
<
|
>
|
>
|
|
|
|
|
>
|
>
|
|
|

|
|
>
















|







1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241

1242
1243
1244
1245
1246

1247
1248
1249
1250

1251

1252

1253

1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
}
.Ed
.Sh SEE ALSO
.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 ,
Changes to jni/libressl/man/PKCS12_create.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: PKCS12_create.3,v 1.6 2018/03/21 17:57:48 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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.\" 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 2018 $
.Dt PKCS12_CREATE 3
.Os
.Sh NAME
.Nm PKCS12_create
.Nd create a PKCS#12 structure
.Sh SYNOPSIS
.In openssl/pkcs12.h
.Ft PKCS12 *
.Fo PKCS12_create
.Fa "char *pass"
.Fa "char *name"
.Fa "EVP_PKEY *pkey"
.Fa "X509 *cert"
.Fa "STACK_OF(X509) *ca"
.Fa "int nid_key"
.Fa "int nid_cert"
.Fa "int iter"
.Fa "int mac_iter"







|









|
|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.\" 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 PKCS12_CREATE 3
.Os
.Sh NAME
.Nm PKCS12_create
.Nd create a PKCS#12 structure
.Sh SYNOPSIS
.In openssl/pkcs12.h
.Ft PKCS12 *
.Fo PKCS12_create
.Fa "const char *pass"
.Fa "const char *name"
.Fa "EVP_PKEY *pkey"
.Fa "X509 *cert"
.Fa "STACK_OF(X509) *ca"
.Fa "int nid_key"
.Fa "int nid_cert"
.Fa "int iter"
.Fa "int mac_iter"
Changes to jni/libressl/man/PKCS7_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: PKCS7_new.3,v 1.3 2018/03/21 00:54:31 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 PKCS7_NEW 3
.Os
.Sh NAME
.Nm PKCS7_new ,
.Nm PKCS7_free ,
.Nm PKCS7_SIGNED_new ,
.Nm PKCS7_SIGNED_free ,
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: PKCS7_new.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt PKCS7_NEW 3
.Os
.Sh NAME
.Nm PKCS7_new ,
.Nm PKCS7_free ,
.Nm PKCS7_SIGNED_new ,
.Nm PKCS7_SIGNED_free ,
250
251
252
253
254
255
256
257
258
259
.Xr PKCS7_sign_add_signer 3 ,
.Xr PKCS7_verify 3 ,
.Xr SMIME_read_PKCS7 3 ,
.Xr SMIME_write_PKCS7 3
.Sh STANDARDS
RFC 2315: PKCS #7: Cryptographic Message Syntax Version 1.5
.Sh HISTORY
These functions appeared in SSLeay 0.8.1b or earlier
and have been available since
.Ox 2.4 .







|


250
251
252
253
254
255
256
257
258
259
.Xr PKCS7_sign_add_signer 3 ,
.Xr PKCS7_verify 3 ,
.Xr SMIME_read_PKCS7 3 ,
.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 .
Changes to jni/libressl/man/RAND_add.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\" $OpenBSD: RAND_add.3,v 1.9 2018/03/23 23:18:17 schwarze Exp $
.\" content checked up to: OpenSSL c16de9d8 Aug 31 23:16:22 2017 +0200
.\"
.\" Copyright (c) 2014 Miod Vallat <miod@openbsd.org>
.\"
.\" 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 RAND_ADD 3
.Os
.Sh NAME
.Nm RAND_add ,
.Nm RAND_cleanup ,
.Nm RAND_poll ,
.Nm RAND_seed ,
|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\" $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 <miod@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt RAND_ADD 3
.Os
.Sh NAME
.Nm RAND_add ,
.Nm RAND_cleanup ,
.Nm RAND_poll ,
.Nm RAND_seed ,
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
and
.Fn RAND_status
always return 1.
.Sh HISTORY
.Fn RAND_cleanup
and
.Fn RAND_seed
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Pp
.Fn RAND_add
and
.Fn RAND_status
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 .







|











55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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
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 .
Changes to jni/libressl/man/RAND_bytes.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RAND_bytes.3,v 1.5 2018/03/22 16:06:33 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt RAND_BYTES 3
.Os
.Sh NAME
.Nm RAND_bytes ,
.Nm RAND_pseudo_bytes
.Nd generate random data
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 RAND_BYTES 3
.Os
.Sh NAME
.Nm RAND_bytes ,
.Nm RAND_pseudo_bytes
.Nd generate random data
.Sh SYNOPSIS
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.Sh RETURN VALUES
.Fn RAND_bytes
returns 1.
.Fn RAND_pseudo_bytes
returns 1.
.Sh HISTORY
.Fn RAND_bytes
appeared in SSLeay 0.8.1b or earlier 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
first appeared in OpenSSL 0.9.5 and has been available since
.Ox 2.7 .







|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.Sh RETURN VALUES
.Fn RAND_bytes
returns 1.
.Fn RAND_pseudo_bytes
returns 1.
.Sh HISTORY
.Fn RAND_bytes
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
first appeared in OpenSSL 0.9.5 and has been available since
.Ox 2.7 .
Changes to jni/libressl/man/RAND_load_file.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RAND_load_file.3,v 1.5 2018/03/21 01:02:06 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2001 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2001 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt RAND_LOAD_FILE 3
.Os
.Sh NAME
.Nm RAND_file_name ,
.Nm RAND_load_file ,
.Nm RAND_write_file
.Nd PRNG seed file







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 RAND_LOAD_FILE 3
.Os
.Sh NAME
.Nm RAND_file_name ,
.Nm RAND_load_file ,
.Nm RAND_write_file
.Nd PRNG seed file
111
112
113
114
115
116
117
118
119
.Dv NULL
on error.
.Sh HISTORY
.Fn RAND_load_file ,
.Fn RAND_write_file ,
and
.Fn RAND_file_name
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .







|

111
112
113
114
115
116
117
118
119
.Dv NULL
on error.
.Sh HISTORY
.Fn RAND_load_file ,
.Fn RAND_write_file ,
and
.Fn RAND_file_name
first appeared in SSLeay 0.5.1 and have been available since
.Ox 2.4 .
Changes to jni/libressl/man/RC4.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RC4.3,v 1.5 2018/03/21 01:05:25 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt RC4 3
.Os
.Sh NAME
.Nm RC4_set_key ,
.Nm RC4
.Nd RC4 encryption
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 RC4 3
.Os
.Sh NAME
.Nm RC4_set_key ,
.Nm RC4
.Nd RC4 encryption
.Sh SYNOPSIS
120
121
122
123
124
125
126
127
128
129
130
.Sh SEE ALSO
.Xr blowfish 3 ,
.Xr EVP_EncryptInit 3
.Sh HISTORY
.Fn RC4_set_key
and
.Fn RC4
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .
.Sh BUGS
This cipher is broken and should no longer be used.







|



120
121
122
123
124
125
126
127
128
129
130
.Sh SEE ALSO
.Xr blowfish 3 ,
.Xr EVP_EncryptInit 3
.Sh HISTORY
.Fn RC4_set_key
and
.Fn RC4
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.
Changes to jni/libressl/man/RSA_generate_key.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RSA_generate_key.3,v 1.10 2018/03/23 00:09:11 schwarze Exp $
.\"	OpenSSL RSA_generate_key.pod bb6c5e7f Feb 5 10:29:22 2017 -0500
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_GENERATE_KEY 3
.Os
.Sh NAME
.Nm RSA_generate_key_ex ,
.Nm RSA_generate_key
.Nd generate RSA key pair
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 RSA_GENERATE_KEY 3
.Os
.Sh NAME
.Nm RSA_generate_key_ex ,
.Nm RSA_generate_key
.Nd generate RSA key pair
.Sh SYNOPSIS
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
.Sh SEE ALSO
.Xr BN_generate_prime 3 ,
.Xr ERR_get_error 3 ,
.Xr RSA_get0_key 3 ,
.Xr RSA_new 3
.Sh HISTORY
.Fn RSA_generate_key
appeared before SSLeay 0.8 and had its
.Fa cb_arg
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







|







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
.Sh SEE ALSO
.Xr BN_generate_prime 3 ,
.Xr ERR_get_error 3 ,
.Xr RSA_get0_key 3 ,
.Xr RSA_new 3
.Sh HISTORY
.Fn RSA_generate_key
appeared in SSLeay 0.4 or earlier and had its
.Fa cb_arg
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
Changes to jni/libressl/man/RSA_meth_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: RSA_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 <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\" $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 <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72

73
74

75
76
77
78
79
80
81
82
83
84
85




86
87
88
89
90
91
92

93


94
95
96
97
98
99
100
.\" 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 RSA_METH_NEW 3
.Os
.Sh NAME
.Nm RSA_meth_new ,

.Nm RSA_meth_free ,
.Nm RSA_meth_dup ,

.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 void
.Fo RSA_meth_free
.Fa "RSA_METHOD *meth"
.Fc
.Ft RSA_METHOD *
.Fo RSA_meth_dup
.Fa "const RSA_METHOD *meth"

.Fc


.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







|




>

|
>











>
>
>
>




|
|
|
>

>
>







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
.\" 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
138
139
140
141
142
143
144










145
146
147
148
149
150
151
152
153
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_set_finish
sets an optional function for destroying an
.Vt RSA
object.
Unless
.Fa finish
is
.Dv NULL ,
it will be called from







>
>
>
>
>
>
>
>
>
>

|







147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191



192


193
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



and have been available since


.Ox 6.3 .







|







|
>
>
>
|
>
>

195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
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 .
Changes to jni/libressl/man/RSA_new.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RSA_new.3,v 1.7 2018/03/21 01:27:25 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
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56

57
58
59
60
61
62




63
64
65
66
67
68
69
70
71
72
73
74
75
76



77



78

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.\" 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 2018 $
.Dt RSA_NEW 3
.Os
.Sh NAME
.Nm RSA_new ,

.Nm RSA_free
.Nd allocate and free RSA objects
.Sh SYNOPSIS
.In openssl/rsa.h
.Ft RSA *
.Fn RSA_new void




.Ft void
.Fo RSA_free
.Fa "RSA *rsa"
.Fc
.Sh DESCRIPTION
The RSA functions implement RSA public key encryption and signatures
as defined in PKCS #1 v2.0 (RFC 2437).
.Pp
.Fn RSA_new
allocates and initializes an
.Vt RSA
structure.
It is equivalent to calling
.Fn RSA_new_method NULL .



.Pp



.Fn RSA_free

frees the
.Vt RSA
structure and its components.
The key is erased before the memory is returned to the system.
If
.Fa rsa
is a
.Dv NULL
pointer, no action occurs.
.Pp
The
.Vt RSA
structure consists of several
.Vt BIGNUM
components.
It can contain public as well as private RSA keys:
.Bd -literal
typdef struct {
	BIGNUM *n;		// public modulus
	BIGNUM *e;		// public exponent
	BIGNUM *d;		// private exponent
	BIGNUM *p;		// secret prime factor
	BIGNUM *q;		// secret prime factor
	BIGNUM *dmp1;		// d mod (p-1)
	BIGNUM *dmq1;		// d mod (q-1)







|




>






>
>
>
>











|

|
>
>
>

>
>
>

>
|
















|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
.\" 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 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"
.Fc
.Sh DESCRIPTION
The RSA functions implement RSA public key encryption and signatures
as defined in PKCS #1 v2.0 (RFC 2437).
.Pp
.Fn RSA_new
allocates and initializes an
.Vt RSA
structure, setting the reference count to 1.
It is equivalent to calling
.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
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.
If
.Fa rsa
is a
.Dv NULL
pointer, no action occurs.
.Pp
The
.Vt RSA
structure consists of several
.Vt BIGNUM
components.
It can contain public as well as private RSA keys:
.Bd -literal
typedef struct {
	BIGNUM *n;		// public modulus
	BIGNUM *e;		// public exponent
	BIGNUM *d;		// private exponent
	BIGNUM *p;		// secret prime factor
	BIGNUM *q;		// secret prime factor
	BIGNUM *dmp1;		// d mod (p-1)
	BIGNUM *dmq1;		// d mod (q-1)
145
146
147
148
149
150
151



152
153
154
155
156
157
158
159
160
161
162
163
164
If the allocation fails,
.Fn RSA_new
returns
.Dv NULL
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.



.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 ,







>
>
>





<







157
158
159
160
161
162
163
164
165
166
167
168
169
170
171

172
173
174
175
176
177
178
If the allocation fails,
.Fn RSA_new
returns
.Dv NULL
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 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 ,
175
176
177
178
179
180
181
182
183




SSL, PKCS #1 v2.0
.Pp
RSA was covered by a US patent which expired in September 2000.
.Sh HISTORY
.Fn RSA_new
and
.Fn RSA_free
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .











|

>
>
>
>
189
190
191
192
193
194
195
196
197
198
199
200
201
SSL, PKCS #1 v2.0
.Pp
RSA was covered by a US patent which expired in September 2000.
.Sh HISTORY
.Fn RSA_new
and
.Fn RSA_free
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 .
Changes to jni/libressl/man/RSA_print.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RSA_print.3,v 1.7 2018/03/20 22:22:10 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 2003 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2002, 2003 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 20 2018 $
.Dt RSA_PRINT 3
.Os
.Sh NAME
.Nm RSA_print ,
.Nm RSA_print_fp ,
.Nm DSAparams_print ,
.Nm DSAparams_print_fp ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 RSA_PRINT 3
.Os
.Sh NAME
.Nm RSA_print ,
.Nm RSA_print_fp ,
.Nm DSAparams_print ,
.Nm DSAparams_print_fp ,
124
125
126
127
128
129
130
131



132
133
134
135
136
137
138
139
140
141
142
143
144
.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_fp ,
.Fn DSA_print ,
.Fn DSA_print_fp ,
.Fn DHparams_print ,
and
.Fn DHparams_print_fp
appeared before SSLeay 0.8.
.Fn DSAparams_print
and
.Fn DSAparams_print_fp
first appeared in SSLeay 0.8.
All these functions have been available since
.Ox 2.4 .







|
>
>
>


<
<


|
<
<
|
|


124
125
126
127
128
129
130
131
132
133
134
135
136


137
138
139


140
141
142
143
.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
and
.Fn DHparams_print
first appeared in SSLeay 0.5.1.
.Fn RSA_print_fp ,
.Fn DSA_print ,


and
.Fn DHparams_print_fp
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 .
Changes to jni/libressl/man/RSA_private_encrypt.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RSA_private_encrypt.3,v 1.8 2018/03/21 01:27:25 schwarze Exp $
.\"	OpenSSL RSA_private_encrypt.pod b41f6b64 Mar 10 15:49:04 2017 +0000
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt RSA_PRIVATE_ENCRYPT 3
.Os
.Sh NAME
.Nm RSA_private_encrypt ,
.Nm RSA_public_decrypt
.Nd low level signature operations
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 RSA_PRIVATE_ENCRYPT 3
.Os
.Sh NAME
.Nm RSA_private_encrypt ,
.Nm RSA_public_decrypt
.Nd low level signature operations
.Sh SYNOPSIS
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
.Xr RSA_new 3 ,
.Xr RSA_sign 3 ,
.Xr RSA_verify 3
.Sh HISTORY
.Fn RSA_private_encrypt
and
.Fn RSA_public_decrypt
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Pp
The
.Fa padding
argument was added in SSLeay 0.8.
.Dv RSA_NO_PADDING
is available since SSLeay 0.9.0.







|


<
<
<


140
141
142
143
144
145
146
147
148
149



150
151
.Xr RSA_new 3 ,
.Xr RSA_sign 3 ,
.Xr RSA_verify 3
.Sh HISTORY
.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.
Changes to jni/libressl/man/RSA_public_encrypt.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RSA_public_encrypt.3,v 1.10 2018/03/21 01:27:25 schwarze Exp $
.\"	OpenSSL RSA_public_encrypt.pod 1e3f62a3 Jul 17 16:47:13 2017 +0200
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt RSA_PUBLIC_ENCRYPT 3
.Os
.Sh NAME
.Nm RSA_public_encrypt ,
.Nm RSA_private_decrypt
.Nd RSA public key cryptography
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 RSA_PUBLIC_ENCRYPT 3
.Os
.Sh NAME
.Nm RSA_public_encrypt ,
.Nm RSA_private_decrypt
.Nd RSA public key cryptography
.Sh SYNOPSIS
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
.Xr RSA_size 3
.Sh STANDARDS
SSL, PKCS #1 v2.0
.Sh HISTORY
.Fn RSA_public_encrypt
and
.Fn RSA_private_decrypt
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Pp
The
.Fa padding
argument was added in SSLeay 0.8.
.Dv RSA_NO_PADDING
is available since SSLeay 0.9.0.
OAEP was added in OpenSSL 0.9.2b.
.Sh BUGS
Decryption failures in the
.Dv RSA_PKCS1_PADDING
mode leak information which can potentially be used to mount a
Bleichenbacher padding oracle attack.
This is an inherent weakness in the PKCS #1 v1.5 padding design.
Prefer
.Dv RSA_PKCS1_OAEP_PADDING .







|


<
<
<











148
149
150
151
152
153
154
155
156
157



158
159
160
161
162
163
164
165
166
167
168
.Xr RSA_size 3
.Sh STANDARDS
SSL, PKCS #1 v2.0
.Sh HISTORY
.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.
.Sh BUGS
Decryption failures in the
.Dv RSA_PKCS1_PADDING
mode leak information which can potentially be used to mount a
Bleichenbacher padding oracle attack.
This is an inherent weakness in the PKCS #1 v1.5 padding design.
Prefer
.Dv RSA_PKCS1_OAEP_PADDING .
Changes to jni/libressl/man/RSA_set_method.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RSA_set_method.3,v 1.10 2018/03/22 16:06:33 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>
.\" and Geoff Thorpe <geoff@openssl.org>.
.\" Copyright (c) 2000, 2002, 2007, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>
.\" and Geoff Thorpe <geoff@openssl.org>.
.\" Copyright (c) 2000, 2002, 2007, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110



111
112
113
114
115
116
117
118
119
120
121
122


123
124
125

126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
.\" 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 22 2018 $
.Dt RSA_SET_METHOD 3
.Os
.Sh NAME
.Nm RSA_set_default_method ,
.Nm RSA_get_default_method ,
.Nm RSA_set_method ,
.Nm RSA_get_method ,
.Nm RSA_PKCS1_SSLeay ,
.Nm RSA_null_method ,
.Nm RSA_flags ,
.Nm RSA_new_method
.Nd select RSA method
.Sh SYNOPSIS
.In openssl/rsa.h
.Ft void
.Fo RSA_set_default_method
.Fa "const RSA_METHOD *meth"
.Fc
.Ft 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 *
.Fo RSA_get_method
.Fa "const RSA *rsa"
.Fc
.Ft 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"
.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 .



.Pp
.Fn RSA_set_default_method
makes
.Fa meth
the default method for all
.Vt RSA
structures created later.
.Sy NB :
This is true only whilst no
.Vt ENGINE
has been set as a default for RSA, so this function is no longer
recommended.


.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.
.Pp
.Fn RSA_set_method
selects
.Fa meth
to perform all operations using the key
.Fa rsa .
This will replace 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.
It is possible to have RSA keys that only work with certain
.Vt RSA_METHOD
implementations (e.g. from an
.Vt ENGINE
module that supports embedded hardware-protected keys),
and in such cases attempting to change the
.Vt RSA_METHOD







|








<









|






|



|

<
<






|




|
<
<
<
<
<
<
<
<
<
<
|
|
>
>
>


|

|


|
<

<
|
>
>


|
>
|
<
<
<
<






|



<
|
|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83


84
85
86
87
88
89
90
91
92
93
94
95










96
97
98
99
100
101
102
103
104
105
106
107
108

109

110
111
112
113
114
115
116
117




118
119
120
121
122
123
124
125
126
127

128
129
130
131
132
133
134
135
136
.\" 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 18 2018 $
.Dt RSA_SET_METHOD 3
.Os
.Sh NAME
.Nm RSA_set_default_method ,
.Nm RSA_get_default_method ,
.Nm RSA_set_method ,
.Nm RSA_get_method ,
.Nm RSA_PKCS1_SSLeay ,

.Nm RSA_flags ,
.Nm RSA_new_method
.Nd select RSA method
.Sh SYNOPSIS
.In openssl/rsa.h
.Ft void
.Fo RSA_set_default_method
.Fa "const RSA_METHOD *meth"
.Fc
.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 const RSA_METHOD *
.Fo RSA_get_method
.Fa "const RSA *rsa"
.Fc
.Ft const RSA_METHOD *
.Fn RSA_PKCS1_SSLeay void


.Ft int
.Fo RSA_flags
.Fa "const RSA *rsa"
.Fc
.Ft RSA *
.Fo RSA_new_method
.Fa "ENGINE *engine"
.Fc
.Sh DESCRIPTION
An
.Vt RSA_METHOD
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
selects
.Fa meth
as the default method for all
.Vt RSA
structures created later.
If any

.Vt ENGINE

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 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 replaces the
.Vt RSA_METHOD
used by the RSA key, and if the previous method was supplied by an
.Vt ENGINE ,

.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
.Vt ENGINE
module that supports embedded hardware-protected keys),
and in such cases attempting to change the
.Vt RSA_METHOD
171
172
173
174
175
176
177
178
179
180
181



182


183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
.Sx BUGS
section.
.Pp
.Fn RSA_new_method
allocates and initializes an
.Vt RSA
structure so that
.Fa meth
will be 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
.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
.Bd -literal
typedef struct rsa_meth_st
{
     /* name of the implementation */
	const char *name;

     /* encrypt */







|
|

|
>
>
>
|
>
>
|



<
|
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
<







157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

178







179
180








181
182
183
184
185
186
187
.Sx BUGS
section.
.Pp
.Fn RSA_new_method
allocates and initializes an
.Vt RSA
structure so that
.Fa engine
is used for the RSA operations.
If
.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

The







.Dv RSA_METHOD
structure is defined as follows:








.Bd -literal
typedef struct rsa_meth_st
{
     /* name of the implementation */
	const char *name;

     /* encrypt */
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300



301
302
303

304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
	int (*rsa_verify)(int type, unsigned char *m, unsigned int m_len,
           unsigned char *sigbuf, unsigned int siglen, RSA *rsa);

} RSA_METHOD;
.Ed
.Sh RETURN VALUES
.Fn RSA_PKCS1_SSLeay ,
.Fn RSA_null_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.
.Pp
.Fn RSA_new_method
returns
.Dv NULL
and sets an error code that can be obtained by
.Xr ERR_get_error 3
if the allocation fails.
Otherwise it returns a pointer to the newly allocated structure.
.Sh SEE ALSO



.Xr RSA_meth_new 3 ,
.Xr RSA_new 3
.Sh HISTORY

.Fn RSA_PKCS1_SSLeay
appeared before SSLeay 0.8.
.Fn RSA_new_method
and
.Fn RSA_set_default_method
first appeared in SSLeay 0.8.
.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
.Fn RSA_get_method
as well as the
.Fa rsa_sign
and
.Fa rsa_verify
components of
.Vt RSA_METHOD
first appeared in OpenSSL 0.9.4 and have been available since
.Ox 2.6 .
.Pp
.Fn RSA_null_method
first appeared in OpenSSL 0.9.5 and has been available since
.Ox 2.7 .
.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.
.Sh BUGS
The behaviour of
.Fn RSA_flags
is a misfeature that is left as-is for now to avoid creating
compatibility problems.
RSA functionality, such as the encryption functions, are controlled by
the







<
|






|
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<









>
>
>



>
|
<
<

|
|

















<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







236
237
238
239
240
241
242

243
244
245
246
247
248
249
250








251






252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268


269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288

























289
290
291
292
293
294
295
	int (*rsa_verify)(int type, unsigned char *m, unsigned int m_len,
           unsigned char *sigbuf, unsigned int siglen, RSA *rsa);

} RSA_METHOD;
.Ed
.Sh RETURN VALUES
.Fn RSA_PKCS1_SSLeay ,

.Fn RSA_get_default_method ,
and
.Fn RSA_get_method
return pointers to the respective
.Vt RSA_METHOD .
.Pp
.Fn RSA_set_method
returns 1 on success or 0 on failure.








Currently, it cannot fail.






.Pp
.Fn RSA_new_method
returns
.Dv NULL
and sets an error code that can be obtained by
.Xr ERR_get_error 3
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_set_default_method ,
.Fn RSA_PKCS1_SSLeay ,


and
.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
.Fn RSA_get_method
as well as the
.Fa rsa_sign
and
.Fa rsa_verify
components of
.Vt RSA_METHOD
first appeared in OpenSSL 0.9.4 and have been available since
.Ox 2.6 .

























.Sh BUGS
The behaviour of
.Fn RSA_flags
is a misfeature that is left as-is for now to avoid creating
compatibility problems.
RSA functionality, such as the encryption functions, are controlled by
the
Changes to jni/libressl/man/RSA_sign.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RSA_sign.3,v 1.5 2018/03/21 01:27:25 schwarze Exp $
.\"	OpenSSL aa90ca11 Aug 20 15:48:56 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" Copyright (c) 2000, 2005, 2014, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" Copyright (c) 2000, 2005, 2014, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt RSA_SIGN 3
.Os
.Sh NAME
.Nm RSA_sign ,
.Nm RSA_verify
.Nd RSA signatures
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 RSA_SIGN 3
.Os
.Sh NAME
.Nm RSA_sign ,
.Nm RSA_verify
.Nd RSA signatures
.Sh SYNOPSIS
136
137
138
139
140
141
142
143
144

145
146
.Xr RSA_new 3 ,
.Xr RSA_private_encrypt 3 ,
.Xr RSA_public_decrypt 3
.Sh STANDARDS
SSL, PKCS #1 v2.0
.Sh HISTORY
.Fn RSA_sign
and
.Fn RSA_verify

appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

>
|

136
137
138
139
140
141
142
143
144
145
146
147
.Xr RSA_new 3 ,
.Xr RSA_private_encrypt 3 ,
.Xr RSA_public_decrypt 3
.Sh STANDARDS
SSL, PKCS #1 v2.0
.Sh HISTORY
.Fn RSA_sign
first appeared in SSLeay 0.4.4.
.Fn RSA_verify
first appeared in SSLeay 0.6.0.
Both functions have been available since
.Ox 2.4 .
Changes to jni/libressl/man/RSA_sign_ASN1_OCTET_STRING.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: RSA_sign_ASN1_OCTET_STRING.3,v 1.5 2018/03/21 01:27:25 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt RSA_SIGN_ASN1_OCTET_STRING 3
.Os
.Sh NAME
.Nm RSA_sign_ASN1_OCTET_STRING ,
.Nm RSA_verify_ASN1_OCTET_STRING
.Nd RSA signatures
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 RSA_SIGN_ASN1_OCTET_STRING 3
.Os
.Sh NAME
.Nm RSA_sign_ASN1_OCTET_STRING ,
.Nm RSA_verify_ASN1_OCTET_STRING
.Nd RSA signatures
.Sh SYNOPSIS
122
123
124
125
126
127
128
129
130
131
132
.Xr RSA_new 3 ,
.Xr RSA_sign 3 ,
.Xr RSA_verify 3
.Sh HISTORY
.Fn RSA_sign_ASN1_OCTET_STRING
and
.Fn RSA_verify_ASN1_OCTET_STRING
first appeared in SSLeay 0.8 and have been available since
.Ox 2.4 .
.Sh BUGS
These functions serve no recognizable purpose.







|



122
123
124
125
126
127
128
129
130
131
132
.Xr RSA_new 3 ,
.Xr RSA_sign 3 ,
.Xr RSA_verify 3
.Sh HISTORY
.Fn RSA_sign_ASN1_OCTET_STRING
and
.Fn RSA_verify_ASN1_OCTET_STRING
first appeared in SSLeay 0.8.0 and have been available since
.Ox 2.4 .
.Sh BUGS
These functions serve no recognizable purpose.
Changes to jni/libressl/man/RSA_size.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: RSA_size.3,v 1.8 2018/03/23 23:18:17 schwarze Exp $
.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org> and
.\" Kurt Roeckx <kurt@roeckx.be>.
.\" Copyright (c) 2000, 2002, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\" $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 <ulf@openssl.org> and
.\" Kurt Roeckx <kurt@roeckx.be>.
.\" Copyright (c) 2000, 2002, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_SIZE 3
.Os
.Sh NAME
.Nm RSA_size ,
.Nm RSA_bits
.Nd get the RSA modulus size
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 RSA_SIZE 3
.Os
.Sh NAME
.Nm RSA_size ,
.Nm RSA_bits
.Nd get the RSA modulus size
.Sh SYNOPSIS
84
85
86
87
88
89
90
91
92
93
94
95
96
The size.
.Sh SEE ALSO
.Xr BN_num_bits 3 ,
.Xr RSA_get0_key 3 ,
.Xr RSA_new 3
.Sh HISTORY
.Fn RSA_size
appeared before SSLeay 0.8 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 .







|





84
85
86
87
88
89
90
91
92
93
94
95
96
The size.
.Sh SEE ALSO
.Xr BN_num_bits 3 ,
.Xr RSA_get0_key 3 ,
.Xr RSA_new 3
.Sh HISTORY
.Fn RSA_size
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 .
Changes to jni/libressl/man/SHA1.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SHA1.3,v 1.6 2018/03/23 00:09:11 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org> and
.\" Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2006, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <ulf@openssl.org> and
.\" Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2006, 2015 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SHA1 3
.Os
.Sh NAME
.Nm SHA1 ,
.Nm SHA1_Init ,
.Nm SHA1_Update ,
.Nm SHA1_Final ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SHA1 3
.Os
.Sh NAME
.Nm SHA1 ,
.Nm SHA1_Init ,
.Nm SHA1_Update ,
.Nm SHA1_Final ,
264
265
266
267
268
269
270
271
272
273
274
275
276
PUB 180-1 (Secure Hash Standard), ANSI X9.30
.Sh HISTORY
.Fn SHA1 ,
.Fn SHA1_Init ,
.Fn SHA1_Update ,
and
.Fn SHA1_Final
appeared in SSLeay 0.8.1b or earlier 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 .







|





264
265
266
267
268
269
270
271
272
273
274
275
276
PUB 180-1 (Secure Hash Standard), ANSI X9.30
.Sh HISTORY
.Fn SHA1 ,
.Fn SHA1_Init ,
.Fn SHA1_Update ,
and
.Fn SHA1_Final
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 .
Changes to jni/libressl/man/SSL_CIPHER_get_name.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: SSL_CIPHER_get_name.3,v 1.8 2018/03/24 00:55:37 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 <jaenicke@openssl.org>,
.\" Dr. Stephen Henson <steve@openssl.org>, Todd Short <tshort@akamai.com>,
.\" and Paul Yang <yang.yang@baishancloud.com>.
.\" Copyright (c) 2000, 2005, 2009, 2013, 2014, 2015, 2016, 2017
|







1
2
3
4
5
6
7
8
.\" $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 <jaenicke@openssl.org>,
.\" Dr. Stephen Henson <steve@openssl.org>, Todd Short <tshort@akamai.com>,
.\" and Paul Yang <yang.yang@baishancloud.com>.
.\" Copyright (c) 2000, 2005, 2009, 2013, 2014, 2015, 2016, 2017
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.\" 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_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
.In openssl/ssl.h
.Ft const char *
.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 *
.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"







|




















|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.\" 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 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
.In openssl/ssl.h
.Ft const char *
.Fn SSL_CIPHER_get_name "const SSL_CIPHER *cipher"
.Ft int
.Fn SSL_CIPHER_get_bits "const SSL_CIPHER *cipher" "int *alg_bits"
.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"
318
319
320
321
322
323
324
325

326
327
328
329

330
331
332
333
334
335
336
337
.Dl $ openssl ciphers -v ALL
.Sh SEE ALSO
.Xr openssl 1 ,
.Xr ssl 3 ,
.Xr SSL_get_ciphers 3 ,
.Xr SSL_get_current_cipher 3
.Sh HISTORY
.Fn SSL_CIPHER_get_name ,

.Fn SSL_CIPHER_get_bits ,
.Fn SSL_CIPHER_get_version ,
and
.Fn SSL_CIPHER_description

appeared before SSLeay 0.8 and 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 ,







|
>
|
|

|
>
|







318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
.Dl $ openssl ciphers -v ALL
.Sh SEE ALSO
.Xr openssl 1 ,
.Xr ssl 3 ,
.Xr SSL_get_ciphers 3 ,
.Xr SSL_get_current_cipher 3
.Sh HISTORY
.Fn SSL_CIPHER_description
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 ,
Changes to jni/libressl/man/SSL_CTX_add_session.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_add_session.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL SSL_CTX_add_session.pod 1722496f Jun 8 15:18:38 2017 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org> and
.\" Geoff Thorpe <geoff@openssl.org>.
.\" Copyright (c) 2001, 2002, 2014 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org> and
.\" Geoff Thorpe <geoff@openssl.org>.
.\" Copyright (c) 2001, 2002, 2014 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_CTX_ADD_SESSION 3
.Os
.Sh NAME
.Nm SSL_CTX_add_session ,
.Nm SSL_CTX_remove_session
.Nd manipulate session cache
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_CTX_ADD_SESSION 3
.Os
.Sh NAME
.Nm SSL_CTX_add_session ,
.Nm SSL_CTX_remove_session
.Nd manipulate session cache
.Sh SYNOPSIS
124
125
126
127
128
129
130
131
132
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

124
125
126
127
128
129
130
131
132
.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 .
Changes to jni/libressl/man/SSL_CTX_ctrl.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_ctrl.3,v 1.6 2018/03/22 16:07:53 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt SSL_CTX_CTRL 3
.Os
.Sh NAME
.Nm SSL_CTX_ctrl ,
.Nm SSL_CTX_callback_ctrl ,
.Nm SSL_ctrl ,
.Nm SSL_callback_ctrl







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_CTRL 3
.Os
.Sh NAME
.Nm SSL_CTX_ctrl ,
.Nm SSL_CTX_callback_ctrl ,
.Nm SSL_ctrl ,
.Nm SSL_callback_ctrl
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
.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
appeared before SSLeay 0.8 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 .







|







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
.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 .
Changes to jni/libressl/man/SSL_CTX_flush_sessions.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_flush_sessions.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL SSL_CTX_flush_sessions.pod 1722496f Jun 8 15:18:38 2017 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_FLUSH_SESSIONS 3
.Os
.Sh NAME
.Nm SSL_CTX_flush_sessions
.Nd remove expired sessions
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_FLUSH_SESSIONS 3
.Os
.Sh NAME
.Nm SSL_CTX_flush_sessions
.Nd remove expired sessions
.Sh SYNOPSIS
.In openssl/ssl.h
92
93
94
95
96
97
98
99
100
.Sh SEE ALSO
.Xr ssl 3 ,
.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
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

92
93
94
95
96
97
98
99
100
.Sh SEE ALSO
.Xr ssl 3 ,
.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 .
Changes to jni/libressl/man/SSL_CTX_free.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_free.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2003 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2003 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_FREE 3
.Os
.Sh NAME
.Nm SSL_CTX_free
.Nd free an allocated SSL_CTX object
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_FREE 3
.Os
.Sh NAME
.Nm SSL_CTX_free
.Nd free an allocated SSL_CTX object
.Sh SYNOPSIS
.In openssl/ssl.h
93
94
95
96
97
98
99
100
101
.Fn SSL_CTX_free .
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_CTX_new 3 ,
.Xr SSL_CTX_sess_set_get_cb 3
.Sh HISTORY
.Fn SSL_CTX_free
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

93
94
95
96
97
98
99
100
101
.Fn SSL_CTX_free .
.Sh SEE ALSO
.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 .
Changes to jni/libressl/man/SSL_CTX_get_verify_mode.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_get_verify_mode.3,v 1.4 2018/03/21 17:58:58 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_GET_VERIFY_MODE 3
.Os
.Sh NAME
.Nm SSL_CTX_get_verify_mode ,
.Nm SSL_get_verify_mode ,
.Nm SSL_CTX_get_verify_depth ,
.Nm SSL_get_verify_depth ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_GET_VERIFY_MODE 3
.Os
.Sh NAME
.Nm SSL_CTX_get_verify_mode ,
.Nm SSL_get_verify_mode ,
.Nm SSL_CTX_get_verify_depth ,
.Nm SSL_get_verify_depth ,
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
.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
appeared before SSLeay 0.8 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 .







|







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
.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 .
Changes to jni/libressl/man/SSL_CTX_load_verify_locations.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_load_verify_locations.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_CTX_LOAD_VERIFY_LOCATIONS 3
.Os
.Sh NAME
.Nm SSL_CTX_load_verify_locations ,
.Nm SSL_CTX_set_default_verify_paths
.Nd set default locations for trusted CA certificates
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_CTX_LOAD_VERIFY_LOCATIONS 3
.Os
.Sh NAME
.Nm SSL_CTX_load_verify_locations ,
.Nm SSL_CTX_set_default_verify_paths
.Nd set default locations for trusted CA certificates
.Sh SYNOPSIS
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
.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
appeared before SSLeay 0.8 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.
This may lead to unexpected results if the same CA certificate is available
with different expiration dates.
If a
.Dq certificate expired
verification error occurs, no other certificate will be searched.
Make sure to not have expired certificates mixed with valid ones.







|










221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
.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.
This may lead to unexpected results if the same CA certificate is available
with different expiration dates.
If a
.Dq certificate expired
verification error occurs, no other certificate will be searched.
Make sure to not have expired certificates mixed with valid ones.
Changes to jni/libressl/man/SSL_CTX_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: SSL_CTX_new.3,v 1.9 2018/03/24 00:55:37 schwarze Exp $
.\" full merge up to: OpenSSL 21cd6e00 Oct 21 14:40:15 2015 +0100
.\" selective merge up to: OpenSSL eb43101f Dec 9 18:07:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2005, 2012, 2013, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $OpenBSD: SSL_CTX_new.3,v 1.10 2018/03/27 17:35:50 schwarze Exp $
.\" full merge up to: OpenSSL 21cd6e00 Oct 21 14:40:15 2015 +0100
.\" selective merge up to: OpenSSL eb43101f Dec 9 18:07:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2005, 2012, 2013, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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_CTX_NEW 3
.Os
.Sh NAME
.Nm SSL_CTX_new ,
.Nm SSL_CTX_up_ref ,
.Nm TLS_method ,
.Nm TLS_server_method ,







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 SSL_CTX_NEW 3
.Os
.Sh NAME
.Nm SSL_CTX_new ,
.Nm SSL_CTX_up_ref ,
.Nm TLS_method ,
.Nm TLS_server_method ,
235
236
237
238
239
240
241
242

243
244
245
246
247
248
249
250
251
252
253
254
.Xr ssl 3 ,
.Xr SSL_accept 3 ,
.Xr SSL_CTX_free 3 ,
.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 ,

.Fn SSLv23_method ,
.Fn SSLv23_server_method ,
and
.Fn SSLv23_client_method
appeared before SSLeay 0.8.
.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 .







|
>




|







235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
.Xr ssl 3 ,
.Xr SSL_accept 3 ,
.Xr SSL_CTX_free 3 ,
.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 .
Changes to jni/libressl/man/SSL_CTX_sess_number.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_sess_number.3,v 1.7 2018/03/24 00:55:37 schwarze Exp $
.\"	OpenSSL SSL_CTX_sess_number.pod 7bd27895 Mar 29 11:45:29 2017 +1000
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_CTX_SESS_NUMBER 3
.Os
.Sh NAME
.Nm SSL_CTX_sess_number ,
.Nm SSL_CTX_sess_connect ,
.Nm SSL_CTX_sess_connect_good ,
.Nm SSL_CTX_sess_connect_renegotiate ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SESS_NUMBER 3
.Os
.Sh NAME
.Nm SSL_CTX_sess_number ,
.Nm SSL_CTX_sess_connect ,
.Nm SSL_CTX_sess_connect_good ,
.Nm SSL_CTX_sess_connect_renegotiate ,
148
149
150
151
152
153
154
155
156
157
158
159


160
161
162
163
164
165
166
.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_cb_hits ,
.Fn SSL_CTX_sess_misses ,
and
.Fn SSL_CTX_sess_timeouts
appeared before SSLeay 0.8.


.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 .







<



|
>
>







148
149
150
151
152
153
154

155
156
157
158
159
160
161
162
163
164
165
166
167
.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 .
Changes to jni/libressl/man/SSL_CTX_sess_set_get_cb.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_sess_set_get_cb.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2002, 2003, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2002, 2003, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_CTX_SESS_SET_GET_CB 3
.Os
.Sh NAME
.Nm SSL_CTX_sess_set_new_cb ,
.Nm SSL_CTX_sess_set_remove_cb ,
.Nm SSL_CTX_sess_set_get_cb ,
.Nm SSL_CTX_sess_get_new_cb ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 25 2018 $
.Dt SSL_CTX_SESS_SET_GET_CB 3
.Os
.Sh NAME
.Nm SSL_CTX_sess_set_new_cb ,
.Nm SSL_CTX_sess_set_remove_cb ,
.Nm SSL_CTX_sess_set_get_cb ,
.Nm SSL_CTX_sess_get_new_cb ,
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
.Fo SSL_CTX_sess_set_remove_cb
.Fa "SSL_CTX *ctx"
.Fa "void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *)"
.Fc
.Ft void
.Fo SSL_CTX_sess_set_get_cb
.Fa "SSL_CTX *ctx"
.Fa "SSL_SESSION (*get_session_cb)(SSL *, unsigned char *, int, int *)"
.Fc
.Ft int
.Fo "(*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))"
.Fa "struct ssl_st *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_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 "int len"
.Fa "int *copy"
.Fc
.Ft int
.Fo "(*new_session_cb)"
.Fa "struct ssl_st *ssl"
.Fa "SSL_SESSION *sess"
.Fc
.Ft void
.Fo "(*remove_session_cb)"
.Fa "struct ssl_ctx_st *ctx"
.Fa "SSL_SESSION *sess"
.Fc
.Ft SSL_SESSION *
.Fo "(*get_session_cb)"
.Fa "struct ssl_st *ssl"
.Fa "unsigned char *data"
.Fa "int len"
.Fa "int *copy"
.Fc
.Sh DESCRIPTION
.Fn SSL_CTX_sess_set_new_cb
sets the callback function which is automatically called whenever a new session







|



|




|




|
|





|




|




|







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
.Fo SSL_CTX_sess_set_remove_cb
.Fa "SSL_CTX *ctx"
.Fa "void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *)"
.Fc
.Ft void
.Fo SSL_CTX_sess_set_get_cb
.Fa "SSL_CTX *ctx"
.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 "SSL *ssl"
.Fa "SSL_SESSION *sess"
.Fc
.Ft void
.Fo "(*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))"
.Fa "SSL_CTX *ctx"
.Fa "SSL_SESSION *sess"
.Fc
.Ft SSL_SESSION *
.Fo "(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))"
.Fa "SSL *ssl"
.Fa "const unsigned char *data"
.Fa "int len"
.Fa "int *copy"
.Fc
.Ft int
.Fo "(*new_session_cb)"
.Fa "SSL *ssl"
.Fa "SSL_SESSION *sess"
.Fc
.Ft void
.Fo "(*remove_session_cb)"
.Fa "SSL_CTX *ctx"
.Fa "SSL_SESSION *sess"
.Fc
.Ft SSL_SESSION *
.Fo "(*get_session_cb)"
.Fa "SSL *ssl"
.Fa "unsigned char *data"
.Fa "int len"
.Fa "int *copy"
.Fc
.Sh DESCRIPTION
.Fn SSL_CTX_sess_set_new_cb
sets the callback function which is automatically called whenever a new session
202
203
204
205
206
207
208










209
210
.Xr d2i_SSL_SESSION 3 ,
.Xr ssl 3 ,
.Xr SSL_CTX_flush_sessions 3 ,
.Xr SSL_CTX_free 3 ,
.Xr SSL_CTX_set_session_cache_mode 3 ,
.Xr SSL_SESSION_free 3
.Sh HISTORY










These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







>
>
>
>
>
>
>
>
>
>
|

202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
.Xr d2i_SSL_SESSION 3 ,
.Xr ssl 3 ,
.Xr SSL_CTX_flush_sessions 3 ,
.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 .
Changes to jni/libressl/man/SSL_CTX_sessions.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_sessions.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.\" 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 2018 $
.Dt SSL_CTX_SESSIONS 3
.Os
.Sh NAME
.Nm SSL_CTX_sessions
.Nd access internal session cache
.Sh SYNOPSIS
.In openssl/ssl.h
.Ft struct lhash_st *
.Fn SSL_CTX_sessions "SSL_CTX *ctx"
.Sh DESCRIPTION
.Fn SSL_CTX_sessions
returns a pointer to the lhash databases containing the internal session cache
for
.Fa ctx .
.Pp







|







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.\" 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 25 2018 $
.Dt SSL_CTX_SESSIONS 3
.Os
.Sh NAME
.Nm SSL_CTX_sessions
.Nd access internal session cache
.Sh SYNOPSIS
.In openssl/ssl.h
.Ft LHASH_OF(SSL_SESSION) *
.Fn SSL_CTX_sessions "SSL_CTX *ctx"
.Sh DESCRIPTION
.Fn SSL_CTX_sessions
returns a pointer to the lhash databases containing the internal session cache
for
.Fa ctx .
.Pp
78
79
80
81
82
83
84
85
86
.Sh SEE ALSO
.Xr lh_new 3 ,
.Xr ssl 3 ,
.Xr SSL_CTX_add_session 3 ,
.Xr SSL_CTX_set_session_cache_mode 3
.Sh HISTORY
.Fn SSL_CTX_sessions
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

78
79
80
81
82
83
84
85
86
.Sh SEE ALSO
.Xr lh_new 3 ,
.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 .
Changes to jni/libressl/man/SSL_CTX_set_cert_store.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_cert_store.3,v 1.6 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2002, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2002, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_SET_CERT_STORE 3
.Os
.Sh NAME
.Nm SSL_CTX_set_cert_store ,
.Nm SSL_CTX_get_cert_store
.Nd manipulate X509 certificate verification storage
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_CERT_STORE 3
.Os
.Sh NAME
.Nm SSL_CTX_set_cert_store ,
.Nm SSL_CTX_get_cert_store
.Nd manipulate X509 certificate verification storage
.Sh SYNOPSIS
122
123
124
125
126
127
128
129
130
.Xr SSL_CTX_load_verify_locations 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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

122
123
124
125
126
127
128
129
130
.Xr SSL_CTX_load_verify_locations 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 .
Changes to jni/libressl/man/SSL_CTX_set_cert_verify_callback.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_cert_verify_callback.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_SET_CERT_VERIFY_CALLBACK 3
.Os
.Sh NAME
.Nm SSL_CTX_set_cert_verify_callback
.Nd set peer certificate verification procedure
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_CERT_VERIFY_CALLBACK 3
.Os
.Sh NAME
.Nm SSL_CTX_set_cert_verify_callback
.Nd set peer certificate verification procedure
.Sh SYNOPSIS
.In openssl/ssl.h
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_CTX_load_verify_locations 3 ,
.Xr SSL_CTX_set_verify 3 ,
.Xr SSL_get_verify_result 3
.Sh HISTORY
.Fn SSL_CTX_set_cert_verify_callback
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .
.Pp
Previous to OpenSSL 0.9.7, the
.Fa arg
argument to
.Fn SSL_CTX_set_cert_verify_callback
was ignored, and







|







124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_CTX_load_verify_locations 3 ,
.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
.Fn SSL_CTX_set_cert_verify_callback
was ignored, and
Changes to jni/libressl/man/SSL_CTX_set_cipher_list.3.
1
2
3

















4
5
6
7
8
9
10
11
.\"	$OpenBSD: SSL_CTX_set_cipher_list.3,v 1.5 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"

















.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 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
|
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.\" $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 is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
































































































































83




























84








85







86





















































87


88
89



90
91
92
93

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
.\" 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 2018 $
.Dt SSL_CTX_SET_CIPHER_LIST 3
.Os
.Sh NAME
.Nm SSL_CTX_set_cipher_list ,
.Nm SSL_set_cipher_list
.Nd choose list of available SSL_CIPHERs
.Sh SYNOPSIS
.In openssl/ssl.h
.Ft int
.Fn SSL_CTX_set_cipher_list "SSL_CTX *ctx" "const char *str"
.Ft int
.Fn SSL_set_cipher_list "SSL *ssl" "const char *str"
.Sh DESCRIPTION
.Fn SSL_CTX_set_cipher_list
sets the list of available ciphers 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
.Fa ssl
objects created from
.Fa ctx .
.Pp
.Fn SSL_set_cipher_list
sets the list of ciphers 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.



.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.
ADH ciphers don't need a certificate, but DH-parameters must have been set.
All other ciphers 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
(see
.Xr SSL_CTX_set_tmp_dh_callback 3 ) .
.Pp
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

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
.Pq Dv SSL_R_NO_SHARED_CIPHER
error is generated and the handshake will fail.
.Sh RETURN VALUES
.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.
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|









|

|


|

|
|
<
|
<
|





|


|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
|
|
>
>
>

<
<
|
>
|
<

|










|
>









|










|

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

87

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334


335
336
337

338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
.\" 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 2018 $
.Dt SSL_CTX_SET_CIPHER_LIST 3
.Os
.Sh NAME
.Nm SSL_CTX_set_cipher_list ,
.Nm SSL_set_cipher_list
.Nd choose list of available SSL_CIPHERs
.Sh SYNOPSIS
.In openssl/ssl.h
.Ft int
.Fn SSL_CTX_set_cipher_list "SSL_CTX *ctx" "const char *control"
.Ft int
.Fn SSL_set_cipher_list "SSL *ssl" "const char *control"
.Sh DESCRIPTION
.Fn SSL_CTX_set_cipher_list
sets the list of available cipher suites for
.Fa ctx
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 cipher suites only for
.Fa ssl .
.Pp
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
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 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
(see
.Xr SSL_CTX_set_tmp_dh_callback 3 ) .
.Pp
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 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
.Pq Dv SSL_R_NO_SHARED_CIPHER
error is generated and the handshake will fail.
.Sh RETURN VALUES
.Fn SSL_CTX_set_cipher_list
and
.Fn SSL_set_cipher_list
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 .
Changes to jni/libressl/man/SSL_CTX_set_client_CA_list.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_client_CA_list.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_SET_CLIENT_CA_LIST 3
.Os
.Sh NAME
.Nm SSL_CTX_set_client_CA_list ,
.Nm SSL_set_client_CA_list ,
.Nm SSL_CTX_add_client_CA ,
.Nm  SSL_add_client_CA







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_CLIENT_CA_LIST 3
.Os
.Sh NAME
.Nm SSL_CTX_set_client_CA_list ,
.Nm SSL_set_client_CA_list ,
.Nm SSL_CTX_add_client_CA ,
.Nm  SSL_add_client_CA
180
181
182
183
184
185
186
187
188
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

180
181
182
183
184
185
186
187
188
.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 .
Changes to jni/libressl/man/SSL_CTX_set_client_cert_cb.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_client_cert_cb.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_SET_CLIENT_CERT_CB 3
.Os
.Sh NAME
.Nm SSL_CTX_set_client_cert_cb ,
.Nm SSL_CTX_get_client_cert_cb
.Nd handle client certificate callback function
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_CLIENT_CERT_CB 3
.Os
.Sh NAME
.Nm SSL_CTX_set_client_cert_cb ,
.Nm SSL_CTX_get_client_cert_cb
.Nd handle client certificate callback function
.Sh SYNOPSIS
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Sh BUGS
The
.Fa client_cert_cb()
cannot return a complete certificate chain;
it can only return one client certificate.
If the chain only has a length of 2,







|







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.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()
cannot return a complete certificate chain;
it can only return one client certificate.
If the chain only has a length of 2,
Changes to jni/libressl/man/SSL_CTX_set_default_passwd_cb.3.
1
2

3
4

5
6
7
8
9
10
11
12
.\"	$OpenBSD: SSL_CTX_set_default_passwd_cb.3,v 1.5 2018/03/21 21:20:26 schwarze Exp $
.\"	OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400

.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.

.\" Copyright (c) 2000, 2001 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.
|
|
>

|
>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
.\" $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 <jaenicke@openssl.org>
.\" and Christian Heimes <cheimes@redhat.com>.
.\" 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
.\" are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
44
45
46
47
48
49
50
51
52
53
54
55
56


57
58
59
60
61
62
63
64




65
66
67
68
69
70
71
.\" 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 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 pem_password_cb
.Nd set 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"




.In openssl/pem.h
.Ft typedef int
.Fn pem_password_cb "char *buf" "int size" "int rwflag" "void *userdata"
.Sh DESCRIPTION
.Fn SSL_CTX_set_default_passwd_cb
sets the default password callback called when loading/storing a PEM
certificate with encryption.







|





>
>

|






>
>
>
>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.\" 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 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 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"
.Sh DESCRIPTION
.Fn SSL_CTX_set_default_passwd_cb
sets the default password callback called when loading/storing a PEM
certificate with encryption.
110
111
112
113
114
115
116














117
118
119
120
121
122
123
to check whether an item shall be encrypted
.Pq Fa rwflag No = 1 .
In this case the password dialog may ask for the same password twice for
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 EXAMPLES
The following example returns the password provided as
.Fa userdata
to the calling function.
The password is considered to be a
.Sq \e0
terminated string.







>
>
>
>
>
>
>
>
>
>
>
>
>
>







118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
to check whether an item shall be encrypted
.Pq Fa rwflag No = 1 .
In this case the password dialog may ask for the same password twice for
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
to the calling function.
The password is considered to be a
.Sq \e0
terminated string.
131
132
133
134
135
136
137
138
139
140
141
142
143






}
.Ed
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_CTX_use_certificate 3
.Sh HISTORY
.Fn SSL_CTX_set_default_passwd_cb
appeared before SSLeay 0.8 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 .













|





>
>
>
>
>
>
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
}
.Ed
.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 .
Changes to jni/libressl/man/SSL_CTX_set_info_callback.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_info_callback.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005, 2014 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005, 2014 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_SET_INFO_CALLBACK 3
.Os
.Sh NAME
.Nm SSL_CTX_set_info_callback ,
.Nm SSL_CTX_get_info_callback ,
.Nm SSL_set_info_callback ,
.Nm SSL_get_info_callback







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_INFO_CALLBACK 3
.Os
.Sh NAME
.Nm SSL_CTX_set_info_callback ,
.Nm SSL_CTX_get_info_callback ,
.Nm SSL_set_info_callback ,
.Nm SSL_get_info_callback
224
225
226
227
228
229
230

231
232
}
.Ed
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_alert_type_string 3 ,
.Xr SSL_state_string 3
.Sh HISTORY

These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







>
|

224
225
226
227
228
229
230
231
232
233
}
.Ed
.Sh SEE ALSO
.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 .
Changes to jni/libressl/man/SSL_CTX_set_options.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: SSL_CTX_set_options.3,v 1.11 2018/03/24 00:55:37 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 <jaenicke@openssl.org>,
.\" Bodo Moeller <bodo@openssl.org>, and
.\" Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2001-2003, 2005, 2007, 2009, 2010, 2013-2015
|







1
2
3
4
5
6
7
8
.\" $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 <jaenicke@openssl.org>,
.\" Bodo Moeller <bodo@openssl.org>, and
.\" Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2001-2003, 2005, 2007, 2009, 2010, 2013-2015
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.\" 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_CTX_SET_OPTIONS 3
.Os
.Sh NAME
.Nm SSL_CTX_set_options ,
.Nm SSL_set_options ,
.Nm SSL_CTX_clear_options ,
.Nm SSL_clear_options ,







|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.\" 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 11 2018 $
.Dt SSL_CTX_SET_OPTIONS 3
.Os
.Sh NAME
.Nm SSL_CTX_set_options ,
.Nm SSL_set_options ,
.Nm SSL_CTX_clear_options ,
.Nm SSL_clear_options ,
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
.It Dv SSL_OP_NO_TLSv1_1
Do not use the TLSv1.1 protocol.
.It Dv SSL_OP_NO_TLSv1_2
Do not use the TLSv1.2 protocol.
Deprecated; use
.Xr SSL_CTX_set_max_proto_version 3
instead.
.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.)
.El
.Pp
The following options used to be supported at some point in the past
and no longer have any effect:
.Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION ,
.Dv SSL_OP_EPHEMERAL_RSA ,
.Dv SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER ,







<
<
<
<
<
<
<
<
<
<
<







205
206
207
208
209
210
211











212
213
214
215
216
217
218
.It Dv SSL_OP_NO_TLSv1_1
Do not use the TLSv1.1 protocol.
.It Dv SSL_OP_NO_TLSv1_2
Do not use the TLSv1.2 protocol.
Deprecated; use
.Xr SSL_CTX_set_max_proto_version 3
instead.











.El
.Pp
The following options used to be supported at some point in the past
and no longer have any effect:
.Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION ,
.Dv SSL_OP_EPHEMERAL_RSA ,
.Dv SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER ,
240
241
242
243
244
245
246

247
248
249
250
251
252
253
.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_TLSEXT_PADDING .
.Sh SECURE RENEGOTIATION
OpenSSL 0.9.8m and later always attempts to use secure renegotiation as
described in RFC5746.
This counters the prefix attack described in CVE-2009-3555 and elsewhere.
.Pp
This attack has far-reaching consequences which application writers should be







>







229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
.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_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.
This counters the prefix attack described in CVE-2009-3555 and elsewhere.
.Pp
This attack has far-reaching consequences which application writers should be
Changes to jni/libressl/man/SSL_CTX_set_quiet_shutdown.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_quiet_shutdown.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_SET_QUIET_SHUTDOWN 3
.Os
.Sh NAME
.Nm SSL_CTX_set_quiet_shutdown ,
.Nm SSL_CTX_get_quiet_shutdown ,
.Nm SSL_set_quiet_shutdown ,
.Nm SSL_get_quiet_shutdown







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_QUIET_SHUTDOWN 3
.Os
.Sh NAME
.Nm SSL_CTX_set_quiet_shutdown ,
.Nm SSL_CTX_get_quiet_shutdown ,
.Nm SSL_set_quiet_shutdown ,
.Nm SSL_get_quiet_shutdown
157
158
159
160
161
162
163

164
165
.Xr ssl 3 ,
.Xr SSL_clear 3 ,
.Xr SSL_free 3 ,
.Xr SSL_new 3 ,
.Xr SSL_set_shutdown 3 ,
.Xr SSL_shutdown 3
.Sh HISTORY

These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







>
|

157
158
159
160
161
162
163
164
165
166
.Xr ssl 3 ,
.Xr SSL_clear 3 ,
.Xr SSL_free 3 ,
.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 .
Changes to jni/libressl/man/SSL_CTX_set_read_ahead.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_read_ahead.3,v 1.3 2018/03/21 16:12:41 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Matt Caswell <matt@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <matt@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_SET_READ_AHEAD 3
.Os
.Sh NAME
.Nm SSL_CTX_set_read_ahead ,
.Nm SSL_CTX_get_read_ahead ,
.Nm SSL_set_read_ahead ,
.Nm SSL_get_read_ahead ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_READ_AHEAD 3
.Os
.Sh NAME
.Nm SSL_CTX_set_read_ahead ,
.Nm SSL_CTX_get_read_ahead ,
.Nm SSL_set_read_ahead ,
.Nm SSL_get_read_ahead ,
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_pending 3
.Sh HISTORY
.Fn SSL_set_read_ahead
and
.Fn SSL_get_read_ahead
appeared before SSLeay 0.8 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
function.







|












125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.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
function.
Changes to jni/libressl/man/SSL_CTX_set_session_cache_mode.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_session_cache_mode.3,v 1.5 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL 67adf0a7 Dec 25 19:58:38 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org> and
.\" Geoff Thorpe <geoff@openssl.org>.
.\" Copyright (c) 2001, 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org> and
.\" Geoff Thorpe <geoff@openssl.org>.
.\" Copyright (c) 2001, 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_CTX_SET_SESSION_CACHE_MODE 3
.Os
.Sh NAME
.Nm SSL_CTX_set_session_cache_mode ,
.Nm SSL_CTX_get_session_cache_mode
.Nd enable/disable session caching
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_CTX_SET_SESSION_CACHE_MODE 3
.Os
.Sh NAME
.Nm SSL_CTX_set_session_cache_mode ,
.Nm SSL_CTX_get_session_cache_mode
.Nd enable/disable session caching
.Sh SYNOPSIS
184
185
186
187
188
189
190
191
192
193
194
195
196
197
.Xr SSL_CTX_set_timeout 3 ,
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Pp
.Dv SSL_SESS_CACHE_NO_INTERNAL_STORE
and
.Dv SSL_SESS_CACHE_NO_INTERNAL
were introduced in OpenSSL 0.9.6h.







|






184
185
186
187
188
189
190
191
192
193
194
195
196
197
.Xr SSL_CTX_set_timeout 3 ,
.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
were introduced in OpenSSL 0.9.6h.
Changes to jni/libressl/man/SSL_CTX_set_ssl_version.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_ssl_version.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_SET_SSL_VERSION 3
.Os
.Sh NAME
.Nm SSL_CTX_set_ssl_version ,
.Nm SSL_set_ssl_method ,
.Nm SSL_get_ssl_method
.Nd choose a new TLS/SSL method







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_SSL_VERSION 3
.Os
.Sh NAME
.Nm SSL_CTX_set_ssl_version ,
.Nm SSL_set_ssl_method ,
.Nm SSL_get_ssl_method
.Nd choose a new TLS/SSL method
127
128
129
130
131
132
133
134
135
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

127
128
129
130
131
132
133
134
135
.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 .
Changes to jni/libressl/man/SSL_CTX_set_timeout.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_timeout.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_SET_TIMEOUT 3
.Os
.Sh NAME
.Nm SSL_CTX_set_timeout ,
.Nm SSL_CTX_get_timeout
.Nd manipulate timeout values for session caching
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_TIMEOUT 3
.Os
.Sh NAME
.Nm SSL_CTX_set_timeout ,
.Nm SSL_CTX_get_timeout
.Nd manipulate timeout values for session caching
.Sh SYNOPSIS
110
111
112
113
114
115
116
117
118
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

110
111
112
113
114
115
116
117
118
.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 .
Changes to jni/libressl/man/SSL_CTX_set_tlsext_use_srtp.3.
1
2
3
4
5
6
7
8
9
.\" $OpenBSD: SSL_CTX_set_tlsext_use_srtp.3,v 1.2 2018/03/24 00:55:37 schwarze Exp $
.\" full merge up to: OpenSSL 3733ce61 Aug 21 08:44:14 2017 +0100
.\"
.\" This file was written by Matt Caswell <matt@openssl.org>.
.\" 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
2
3
4
5
6
7
8
9
.\" $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 <matt@openssl.org>.
.\" 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:
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_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







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
.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 sucessfully 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 ,







|







139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
.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 ,
Changes to jni/libressl/man/SSL_CTX_set_tmp_dh_callback.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_tmp_dh_callback.3,v 1.6 2018/03/21 16:12:41 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2014, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2014, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_CTX_SET_TMP_DH_CALLBACK 3
.Os
.Sh NAME
.Nm SSL_CTX_set_tmp_dh_callback ,
.Nm SSL_CTX_set_tmp_dh ,
.Nm SSL_set_tmp_dh_callback ,
.Nm SSL_set_tmp_dh







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_TMP_DH_CALLBACK 3
.Os
.Sh NAME
.Nm SSL_CTX_set_tmp_dh_callback ,
.Nm SSL_CTX_set_tmp_dh ,
.Nm SSL_set_tmp_dh_callback ,
.Nm SSL_set_tmp_dh
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
.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
appeared before SSLeay 0.8 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 .







|







221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
.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 .
Changes to jni/libressl/man/SSL_CTX_set_tmp_rsa_callback.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_set_tmp_rsa_callback.3,v 1.7 2018/03/24 00:55:37 schwarze Exp $
.\"	OpenSSL 0b30fc90 Dec 19 15:23:05 2013 -0500
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2006, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2006, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_CTX_SET_TMP_RSA_CALLBACK 3
.Os
.Sh NAME
.Nm SSL_CTX_set_tmp_rsa_callback ,
.Nm SSL_CTX_set_tmp_rsa ,
.Nm SSL_CTX_need_tmp_RSA ,
.Nm SSL_set_tmp_rsa_callback ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_CTX_SET_TMP_RSA_CALLBACK 3
.Os
.Sh NAME
.Nm SSL_CTX_set_tmp_rsa_callback ,
.Nm SSL_CTX_set_tmp_rsa ,
.Nm SSL_CTX_need_tmp_RSA ,
.Nm SSL_set_tmp_rsa_callback ,
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
.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
appeared before SSLeay 0.8 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 .







|








99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
.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 .
Changes to jni/libressl/man/SSL_CTX_set_verify.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: SSL_CTX_set_verify.3,v 1.6 2018/03/21 17:58:58 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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2003, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2003, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 2018 $
.Dt SSL_CTX_SET_VERIFY 3
.Os
.Sh NAME
.Nm SSL_CTX_set_verify ,
.Nm SSL_set_verify ,
.Nm SSL_CTX_set_verify_depth ,
.Nm SSL_set_verify_depth







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 SSL_CTX_SET_VERIFY 3
.Os
.Sh NAME
.Nm SSL_CTX_set_verify ,
.Nm SSL_set_verify ,
.Nm SSL_CTX_set_verify_depth ,
.Nm SSL_set_verify_depth
441
442
443
444
445
446
447


448
449
450
451
452
453
454
455
456
457
458
.Xr SSL_CTX_set_cert_verify_callback 3 ,
.Xr SSL_get_ex_data_X509_STORE_CTX_idx 3 ,
.Xr SSL_get_ex_new_index 3 ,
.Xr SSL_get_peer_certificate 3 ,
.Xr SSL_get_verify_result 3 ,
.Xr SSL_new 3
.Sh HISTORY


.Fn SSL_CTX_set_verify
and
.Fn SSL_set_verify
appeared before SSLeay 0.8 and 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 .







>
>

<
|
|







441
442
443
444
445
446
447
448
449
450

451
452
453
454
455
456
457
458
459
.Xr SSL_CTX_set_cert_verify_callback 3 ,
.Xr SSL_get_ex_data_X509_STORE_CTX_idx 3 ,
.Xr SSL_get_ex_new_index 3 ,
.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 .
Changes to jni/libressl/man/SSL_CTX_use_certificate.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_use_certificate.3,v 1.7 2018/03/24 00:55:37 schwarze Exp $
.\"	OpenSSL e248596b Apr 8 22:49:57 2005 +0000
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2003, 2005 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_CTX_use_certificate.3,v 1.9 2018/04/25 13:51:34 schwarze Exp $
.\"	OpenSSL e248596b Apr 8 22:49:57 2005 +0000
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2003, 2005 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_CTX_USE_CERTIFICATE 3
.Os
.Sh NAME
.Nm SSL_CTX_use_certificate ,
.Nm SSL_CTX_use_certificate_ASN1 ,
.Nm SSL_CTX_use_certificate_file ,
.Nm SSL_use_certificate ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 25 2018 $
.Dt SSL_CTX_USE_CERTIFICATE 3
.Os
.Sh NAME
.Nm SSL_CTX_use_certificate ,
.Nm SSL_CTX_use_certificate_ASN1 ,
.Nm SSL_CTX_use_certificate_file ,
.Nm SSL_use_certificate ,
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
.Ft int
.Fn SSL_use_PrivateKey_ASN1 "int pk" "SSL *ssl" "unsigned char *d" "long len"
.Ft int
.Fn SSL_use_PrivateKey_file "SSL *ssl" "const char *file" "int type"
.Ft int
.Fn SSL_use_RSAPrivateKey "SSL *ssl" "RSA *rsa"
.Ft int
.Fn SSL_use_RSAPrivateKey_ASN1 "SSL *ssl" "unsigned char *d" "long len"
.Ft int
.Fn SSL_use_RSAPrivateKey_file "SSL *ssl" "const char *file" "int type"
.Ft int
.Fn SSL_CTX_check_private_key "const SSL_CTX *ctx"
.Ft int
.Fn SSL_check_private_key "const SSL *ssl"
.Sh DESCRIPTION







|







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
.Ft int
.Fn SSL_use_PrivateKey_ASN1 "int pk" "SSL *ssl" "unsigned char *d" "long len"
.Ft int
.Fn SSL_use_PrivateKey_file "SSL *ssl" "const char *file" "int type"
.Ft int
.Fn SSL_use_RSAPrivateKey "SSL *ssl" "RSA *rsa"
.Ft int
.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
.Fn SSL_CTX_check_private_key "const SSL_CTX *ctx"
.Ft int
.Fn SSL_check_private_key "const SSL *ssl"
.Sh DESCRIPTION
388
389
390
391
392
393
394















395
396
397
398
399
400
401
402
403
404
405

406
407
408
409
410
411
412
413
414
415

416
417
418
419
420
421
422
423
.Xr SSL_CTX_load_verify_locations 3 ,
.Xr SSL_CTX_set_cipher_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_CTX_use_certificate ,
.Fn SSL_CTX_use_certificate_ASN1 ,
.Fn SSL_CTX_use_certificate_file ,
.Fn SSL_use_certificate ,
.Fn SSL_use_certificate_ASN1 ,
.Fn SSL_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 ,

.Fn SSL_CTX_use_RSAPrivateKey_file ,
.Fn SSL_use_PrivateKey_file ,
.Fn SSL_use_PrivateKey_ASN1 ,
.Fn SSL_use_PrivateKey ,
.Fn SSL_use_RSAPrivateKey ,
.Fn SSL_use_RSAPrivateKey_ASN1 ,
.Fn SSL_use_RSAPrivateKey_file ,
.Fn SSL_CTX_check_private_key ,
and
.Fn SSL_check_private_key

appeared before SSLeay 0.8 and 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







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



<
<
<





>
|
<
<
|
<
<
<
|


>
|







388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412



413
414
415
416
417
418
419


420



421
422
423
424
425
426
427
428
429
430
431
432
.Xr SSL_CTX_load_verify_locations 3 ,
.Xr SSL_CTX_set_cipher_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
Changes to jni/libressl/man/SSL_SESSION_free.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: SSL_SESSION_free.3,v 1.5 2018/03/24 00:55:37 schwarze Exp $
.\" full merge up to: OpenSSL b31db505 Mar 24 16:01:50 2017 +0000
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>
.\" and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2001, 2009, 2017 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $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 <jaenicke@openssl.org>
.\" and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2001, 2009, 2017 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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_FREE 3
.Os
.Sh NAME
.Nm SSL_SESSION_up_ref ,
.Nm SSL_SESSION_free
.Nd SSL_SESSION reference counting
.Sh SYNOPSIS







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 SSL_SESSION_FREE 3
.Os
.Sh NAME
.Nm SSL_SESSION_up_ref ,
.Nm SSL_SESSION_free
.Nd SSL_SESSION reference counting
.Sh SYNOPSIS
135
136
137
138
139
140
141
142
143
144
145
146
147
.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
appeared before SSLeay 0.8 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 .







|





135
136
137
138
139
140
141
142
143
144
145
146
147
.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 .
Changes to jni/libressl/man/SSL_SESSION_get_time.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_SESSION_get_time.3,v 1.6 2018/03/21 08:06:34 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005, 2006, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005, 2006, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_SESSION_GET_TIME 3
.Os
.Sh NAME
.Nm SSL_SESSION_get_time ,
.Nm SSL_SESSION_set_time ,
.Nm SSL_SESSION_get_timeout ,
.Nm SSL_SESSION_set_timeout ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_SESSION_GET_TIME 3
.Os
.Sh NAME
.Nm SSL_SESSION_get_time ,
.Nm SSL_SESSION_set_time ,
.Nm SSL_SESSION_get_timeout ,
.Nm SSL_SESSION_set_timeout ,
145
146
147
148
149
150
151
152
153
154
155


156
157
158
159
160
161
162
163
164
.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_set_time ,
.Fn SSL_get_timeout ,
and
.Fn SSL_set_timeout


appeared before SSLeay 0.8.
.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 .







<



>
>
|








145
146
147
148
149
150
151

152
153
154
155
156
157
158
159
160
161
162
163
164
165
.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 .
Changes to jni/libressl/man/SSL_SESSION_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: SSL_SESSION_new.3,v 1.5 2018/03/21 05:07:04 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 SSL_SESSION_NEW 3
.Os
.Sh NAME
.Nm SSL_SESSION_new
.Nd construct a new SSL_SESSION object
.Sh SYNOPSIS
.In openssl/ssl.h
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: SSL_SESSION_new.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt SSL_SESSION_NEW 3
.Os
.Sh NAME
.Nm SSL_SESSION_new
.Nd construct a new SSL_SESSION object
.Sh SYNOPSIS
.In openssl/ssl.h
68
69
70
71
72
73
74
75
76
.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
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

68
69
70
71
72
73
74
75
76
.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 .
Changes to jni/libressl/man/SSL_SESSION_print.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: SSL_SESSION_print.3,v 1.2 2018/03/21 05:07:04 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 SSL_SESSION_PRINT 3
.Os
.Sh NAME
.Nm SSL_SESSION_print ,
.Nm SSL_SESSION_print_fp
.Nd print some properties of an SSL_SESSION object
.Sh SYNOPSIS
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: SSL_SESSION_print.3,v 1.3 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt SSL_SESSION_PRINT 3
.Os
.Sh NAME
.Nm SSL_SESSION_print ,
.Nm SSL_SESSION_print_fp
.Nd print some properties of an SSL_SESSION object
.Sh SYNOPSIS
62
63
64
65
66
67
68
69
70

71
72
.Xr SSL_get_session 3 ,
.Xr SSL_SESSION_free 3 ,
.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
and
.Fn SSL_SESSION_print_fp

appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

>
|

62
63
64
65
66
67
68
69
70
71
72
73
.Xr SSL_get_session 3 ,
.Xr SSL_SESSION_free 3 ,
.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 .
Changes to jni/libressl/man/SSL_accept.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_accept.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2003 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2003 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_ACCEPT 3
.Os
.Sh NAME
.Nm SSL_accept
.Nd wait for a TLS/SSL client to initiate a TLS/SSL handshake
.Sh SYNOPSIS
.In openssl/ssl.h







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_ACCEPT 3
.Os
.Sh NAME
.Nm SSL_accept
.Nd wait for a TLS/SSL client to initiate a TLS/SSL handshake
.Sh SYNOPSIS
.In openssl/ssl.h
147
148
149
150
151
152
153
154
155
.Xr SSL_CTX_new 3 ,
.Xr SSL_do_handshake 3 ,
.Xr SSL_get_error 3 ,
.Xr SSL_set_connect_state 3 ,
.Xr SSL_shutdown 3
.Sh HISTORY
.Fn SSL_accept
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

147
148
149
150
151
152
153
154
155
.Xr SSL_CTX_new 3 ,
.Xr SSL_do_handshake 3 ,
.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 .
Changes to jni/libressl/man/SSL_alert_type_string.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_alert_type_string.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2011 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2011 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_ALERT_TYPE_STRING 3
.Os
.Sh NAME
.Nm SSL_alert_type_string ,
.Nm SSL_alert_type_string_long ,
.Nm SSL_alert_desc_string ,
.Nm SSL_alert_desc_string_long







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_ALERT_TYPE_STRING 3
.Os
.Sh NAME
.Nm SSL_alert_type_string ,
.Nm SSL_alert_type_string_long ,
.Nm SSL_alert_desc_string ,
.Nm SSL_alert_desc_string_long
235
236
237
238
239
240
241

242
243
.Fa value
does not contain a correct alert message.
.El
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_CTX_set_info_callback 3
.Sh HISTORY

These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







>
|

235
236
237
238
239
240
241
242
243
244
.Fa value
does not contain a correct alert message.
.El
.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 .
Changes to jni/libressl/man/SSL_clear.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_clear.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2011, 2015 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2011, 2015 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_CLEAR 3
.Os
.Sh NAME
.Nm SSL_clear
.Nd reset SSL object to allow another connection
.Sh SYNOPSIS
.In openssl/ssl.h







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_CLEAR 3
.Os
.Sh NAME
.Nm SSL_clear
.Nd reset SSL object to allow another connection
.Sh SYNOPSIS
.In openssl/ssl.h
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
.Xr SSL_CTX_set_options 3 ,
.Xr SSL_free 3 ,
.Xr SSL_new 3 ,
.Xr SSL_set_shutdown 3 ,
.Xr SSL_shutdown 3
.Sh HISTORY
.Fn SSL_clear
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .
.Sh CAVEATS
.Fn SSL_clear
resets the
.Vt SSL
object to allow for another connection.
The reset operation however keeps several settings of the last sessions







|







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
.Xr SSL_CTX_set_options 3 ,
.Xr SSL_free 3 ,
.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
.Vt SSL
object to allow for another connection.
The reset operation however keeps several settings of the last sessions
Changes to jni/libressl/man/SSL_connect.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_connect.3,v 1.5 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2003 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2003 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_CONNECT 3
.Os
.Sh NAME
.Nm SSL_connect
.Nd initiate the TLS/SSL handshake with a TLS/SSL server
.Sh SYNOPSIS
.In openssl/ssl.h







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_CONNECT 3
.Os
.Sh NAME
.Nm SSL_connect
.Nd initiate the TLS/SSL handshake with a TLS/SSL server
.Sh SYNOPSIS
.In openssl/ssl.h
146
147
148
149
150
151
152
153
154
.Xr SSL_CTX_new 3 ,
.Xr SSL_do_handshake 3 ,
.Xr SSL_get_error 3 ,
.Xr SSL_set_connect_state 3 ,
.Xr SSL_shutdown 3
.Sh HISTORY
.Fn SSL_connect
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

146
147
148
149
150
151
152
153
154
.Xr SSL_CTX_new 3 ,
.Xr SSL_do_handshake 3 ,
.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 .
Changes to jni/libressl/man/SSL_copy_session_id.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.\"	$OpenBSD: SSL_copy_session_id.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 SSL_COPY_SESSION_ID 3
.Os
.Sh NAME
.Nm SSL_copy_session_id
.Nd copy session details between SSL objects
.Sh SYNOPSIS
.In openssl/ssl.h
.Ft void
.Fo SSL_copy_session_id
.Fa "SSL *to"
.Fa "const SSL *from"
.Fc
.Sh DESCRIPTION
.Fn SSL_copy_session_id
copies the following data from
|















|







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.\"	$OpenBSD: SSL_copy_session_id.3,v 1.6 2018/08/24 21:29:51 jmc Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 SSL_COPY_SESSION_ID 3
.Os
.Sh NAME
.Nm SSL_copy_session_id
.Nd copy session details between SSL objects
.Sh SYNOPSIS
.In openssl/ssl.h
.Ft int
.Fo SSL_copy_session_id
.Fa "SSL *to"
.Fa "const SSL *from"
.Fc
.Sh DESCRIPTION
.Fn SSL_copy_session_id
copies the following data from
51
52
53
54
55
56
57



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
the session ID context
.El
.Pp
This function is used internally by
.Xr SSL_dup 3
and by
.Xr BIO_ssl_copy_session_id 3 .



.Sh SEE ALSO
.Xr BIO_ssl_copy_session_id 3 ,
.Xr SSL_dup 3 ,
.Xr SSL_get_session 3 ,
.Xr SSL_SESSION_get_id 3 ,
.Xr SSL_SESSION_new 3 ,
.Xr SSL_set_session 3 ,
.Xr SSL_set_session_id_context 3
.Sh HISTORY
.Fn SSL_copy_session_id
appeared before SSLeay 0.8 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
.Fa to
in an invalid or inconsistent state.
An improved version reporting failure is available in OpenSSL 1.1.0.







>
>
>










|



<
<
|
<
|


<
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74


75

76
77
78

the session ID context
.El
.Pp
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 ,
.Xr SSL_get_session 3 ,
.Xr SSL_SESSION_get_id 3 ,
.Xr SSL_SESSION_new 3 ,
.Xr SSL_set_session 3 ,
.Xr SSL_set_session_id_context 3
.Sh HISTORY
.Fn SSL_copy_session_id
appeared in SSLeay 0.4 or earlier and has been available since
.Ox 2.4 .
.Sh BUGS
Failures of


.Xr CRYPTO_add 3

are silently ignored and may leave
.Fa to
in an invalid or inconsistent state.

Changes to jni/libressl/man/SSL_do_handshake.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_do_handshake.3,v 1.5 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Martin Sjoegren <martin@strakt.com>.
.\" Copyright (c) 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <martin@strakt.com>.
.\" Copyright (c) 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_DO_HANDSHAKE 3
.Os
.Sh NAME
.Nm SSL_do_handshake
.Nd perform a TLS/SSL handshake
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_DO_HANDSHAKE 3
.Os
.Sh NAME
.Nm SSL_do_handshake
.Nd perform a TLS/SSL handshake
.Sh SYNOPSIS
.In openssl/ssl.h
144
145
146
147
148
149
150
151
152
.Xr ssl 3 ,
.Xr SSL_accept 3 ,
.Xr SSL_connect 3 ,
.Xr SSL_get_error 3 ,
.Xr SSL_set_connect_state 3
.Sh HISTORY
.Fn SSL_do_handshake
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

144
145
146
147
148
149
150
151
152
.Xr ssl 3 ,
.Xr SSL_accept 3 ,
.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 .
Changes to jni/libressl/man/SSL_dup.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: SSL_dup.3,v 1.2 2018/03/21 05:07:04 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 SSL_DUP 3
.Os
.Sh NAME
.Nm SSL_dup
.Nd deep copy of an SSL object
.Sh SYNOPSIS
.In openssl/ssl.h
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: SSL_dup.3,v 1.3 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt SSL_DUP 3
.Os
.Sh NAME
.Nm SSL_dup
.Nd deep copy of an SSL object
.Sh SYNOPSIS
.In openssl/ssl.h
52
53
54
55
56
57
58
59
60
.Sh SEE ALSO
.Xr SSL_clear 3 ,
.Xr SSL_copy_session_id 3 ,
.Xr SSL_free 3 ,
.Xr SSL_new 3
.Sh HISTORY
.Fn SSL_dup
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

52
53
54
55
56
57
58
59
60
.Sh SEE ALSO
.Xr SSL_clear 3 ,
.Xr SSL_copy_session_id 3 ,
.Xr SSL_free 3 ,
.Xr SSL_new 3
.Sh HISTORY
.Fn SSL_dup
first appeared in SSLeay 0.8.0 and has been available since
.Ox 2.4 .
Changes to jni/libressl/man/SSL_dup_CA_list.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.\"	$OpenBSD: SSL_dup_CA_list.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 SSL_DUP_CA_LIST 3
.Os
.Sh NAME
.Nm SSL_dup_CA_list
.Nd deep copy of a stack of X.509 Name objects
.\" The capital "N" in "Name" is intentional (X.509 syntax).
.Sh SYNOPSIS
.Ft STACK_OF(X509_NAME) *
.Fo SSL_dup_CA_list
.Fa "STACK_OF(X509_NAME) *sk"
.Fc
.Sh DESCRIPTION
.Fn SSL_dup_CA_list
constructs a new
.Vt STACK_OF(X509_NAME)
object and places copies of all the
.Vt X509_NAME
|















|









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.\"	$OpenBSD: SSL_dup_CA_list.3,v 1.5 2018/04/25 13:51:34 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 25 2018 $
.Dt SSL_DUP_CA_LIST 3
.Os
.Sh NAME
.Nm SSL_dup_CA_list
.Nd deep copy of a stack of X.509 Name objects
.\" The capital "N" in "Name" is intentional (X.509 syntax).
.Sh SYNOPSIS
.Ft STACK_OF(X509_NAME) *
.Fo SSL_dup_CA_list
.Fa "const STACK_OF(X509_NAME) *sk"
.Fc
.Sh DESCRIPTION
.Fn SSL_dup_CA_list
constructs a new
.Vt STACK_OF(X509_NAME)
object and places copies of all the
.Vt X509_NAME
45
46
47
48
49
50
51
52
53
.Sh SEE ALSO
.Xr SSL_CTX_set_client_CA_list 3 ,
.Xr SSL_get_client_CA_list 3 ,
.Xr SSL_load_client_CA_file 3 ,
.Xr X509_NAME_new 3
.Sh HISTORY
.Fn SSL_dup_CA_list
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

45
46
47
48
49
50
51
52
53
.Sh SEE ALSO
.Xr SSL_CTX_set_client_CA_list 3 ,
.Xr SSL_get_client_CA_list 3 ,
.Xr SSL_load_client_CA_file 3 ,
.Xr X509_NAME_new 3
.Sh HISTORY
.Fn SSL_dup_CA_list
first appeared in SSLeay 0.8.0 and has been available since
.Ox 2.4 .
Changes to jni/libressl/man/SSL_free.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_free.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_FREE 3
.Os
.Sh NAME
.Nm SSL_free
.Nd free an allocated SSL structure
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_FREE 3
.Os
.Sh NAME
.Nm SSL_free
.Nd free an allocated SSL structure
.Sh SYNOPSIS
.In openssl/ssl.h
110
111
112
113
114
115
116
117
118
.Xr ssl 3 ,
.Xr SSL_clear 3 ,
.Xr SSL_new 3 ,
.Xr SSL_set_shutdown 3 ,
.Xr SSL_shutdown 3
.Sh HISTORY
.Fn SSL_free
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

110
111
112
113
114
115
116
117
118
.Xr ssl 3 ,
.Xr SSL_clear 3 ,
.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 .
Changes to jni/libressl/man/SSL_get_SSL_CTX.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_SSL_CTX.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_GET_SSL_CTX 3
.Os
.Sh NAME
.Nm SSL_get_SSL_CTX
.Nd get the SSL_CTX from which an SSL is created
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_GET_SSL_CTX 3
.Os
.Sh NAME
.Nm SSL_get_SSL_CTX
.Nd get the SSL_CTX from which an SSL is created
.Sh SYNOPSIS
.In openssl/ssl.h
71
72
73
74
75
76
77
78
79
.Vt SSL_CTX
object is returned.
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_new 3
.Sh HISTORY
.Fn SSL_get_SSL_CTX
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

71
72
73
74
75
76
77
78
79
.Vt SSL_CTX
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 .
Changes to jni/libressl/man/SSL_get_certificate.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.\"	$OpenBSD: SSL_get_certificate.3,v 1.2 2018/03/21 05:07:04 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 SSL_GET_CERTIFICATE 3
.Os
.Sh NAME
.Nm SSL_get_certificate ,
.Nm SSL_get_privatekey
.Nd get SSL certificate and private key
.Sh SYNOPSIS
.In openssl/ssl.h
.Ft X509 *
.Fo SSL_get_certificate
.Fa "const SSL *ssl"
.Fc
.Ft EVP_PKEY *
.Fo SSL_get_privatekey
.Fa "SSL *ssl"
.Fc
.Sh DESCRIPTION
These functions retrieve certificate and key data from an
.Vt SSL
object.
They return internal pointers that must not be freed by the application
program.
|















|














|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.\"	$OpenBSD: SSL_get_certificate.3,v 1.4 2018/04/25 13:51:34 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 25 2018 $
.Dt SSL_GET_CERTIFICATE 3
.Os
.Sh NAME
.Nm SSL_get_certificate ,
.Nm SSL_get_privatekey
.Nd get SSL certificate and private key
.Sh SYNOPSIS
.In openssl/ssl.h
.Ft X509 *
.Fo SSL_get_certificate
.Fa "const SSL *ssl"
.Fc
.Ft EVP_PKEY *
.Fo SSL_get_privatekey
.Fa "const SSL *ssl"
.Fc
.Sh DESCRIPTION
These functions retrieve certificate and key data from an
.Vt SSL
object.
They return internal pointers that must not be freed by the application
program.
52
53
54
55
56
57
58
59
60

61
62
.Dv NULL
if none is active.
.Sh SEE ALSO
.Xr SSL_check_private_key 3 ,
.Xr SSL_use_certificate 3
.Sh HISTORY
.Fn SSL_get_certificate
and
.Fn SSL_get_privatekey

appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

>
|

52
53
54
55
56
57
58
59
60
61
62
63
.Dv NULL
if none is active.
.Sh SEE ALSO
.Xr SSL_check_private_key 3 ,
.Xr SSL_use_certificate 3
.Sh HISTORY
.Fn SSL_get_certificate
first appeared in SSLeay 0.5.2a.
.Fn SSL_get_privatekey
first appeared in SSLeay 0.8.0.
Both functions have been available since
.Ox 2.4 .
Changes to jni/libressl/man/SSL_get_ciphers.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: SSL_get_ciphers.3,v 1.5 2018/03/24 00:55:37 schwarze Exp $
.\" full merge up to: OpenSSL c3e64028 Mar 30 11:50:14 2005 +0000
.\" selective merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>,
.\" Nick Mathewson <nickm@torproject.org>, and Kazuki Yamaguchi <k@rhe.jp>.
.\" Copyright (c) 2000, 2005, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
|







1
2
3
4
5
6
7
8
.\" $OpenBSD: SSL_get_ciphers.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $
.\" full merge up to: OpenSSL c3e64028 Mar 30 11:50:14 2005 +0000
.\" selective merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>,
.\" Nick Mathewson <nickm@torproject.org>, and Kazuki Yamaguchi <k@rhe.jp>.
.\" Copyright (c) 2000, 2005, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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_CIPHERS 3
.Os
.Sh NAME
.Nm SSL_get_ciphers ,
.Nm SSL_CTX_get_ciphers ,
.Nm SSL_get_cipher_list
.Nd get list of available SSL_CIPHERs







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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 SSL_GET_CIPHERS 3
.Os
.Sh NAME
.Nm SSL_get_ciphers ,
.Nm SSL_CTX_get_ciphers ,
.Nm SSL_get_cipher_list
.Nd get list of available SSL_CIPHERs
132
133
134
135
136
137
138
139
140
141

142
143
144
145
146
147
.Dv NULL
is returned.
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_CIPHER_get_name 3 ,
.Xr SSL_CTX_set_cipher_list 3
.Sh HISTORY
.Fn SSL_get_ciphers
and
.Fn SSL_get_cipher_list

appeared before SSLeay 0.8 and 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 .







|
|
|
>
|





132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
.Dv NULL
is returned.
.Sh SEE ALSO
.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 .
Changes to jni/libressl/man/SSL_get_client_CA_list.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_client_CA_list.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2005 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2005 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_GET_CLIENT_CA_LIST 3
.Os
.Sh NAME
.Nm SSL_get_client_CA_list ,
.Nm SSL_CTX_get_client_CA_list
.Nd get list of client CAs
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_GET_CLIENT_CA_LIST 3
.Os
.Sh NAME
.Nm SSL_get_client_CA_list ,
.Nm SSL_CTX_get_client_CA_list
.Nd get list of client CAs
.Sh SYNOPSIS
88
89
90
91
92
93
94
95
96
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

88
89
90
91
92
93
94
95
96
.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 .
Changes to jni/libressl/man/SSL_get_current_cipher.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_current_cipher.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2005, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2005, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_GET_CURRENT_CIPHER 3
.Os
.Sh NAME
.Nm SSL_get_current_cipher ,
.Nm SSL_get_cipher ,
.Nm SSL_get_cipher_name ,
.Nm  SSL_get_cipher_bits ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_GET_CURRENT_CIPHER 3
.Os
.Sh NAME
.Nm SSL_get_current_cipher ,
.Nm SSL_get_cipher ,
.Nm SSL_get_cipher_name ,
.Nm  SSL_get_cipher_bits ,
104
105
106
107
108
109
110










111
112
returns the cipher actually used, or
.Dv NULL
if no session has been established.
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_CIPHER_get_name 3
.Sh HISTORY










These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







>
>
>
>
>
>
>
>
>
>
|

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
returns the cipher actually used, or
.Dv NULL
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 .
Changes to jni/libressl/man/SSL_get_default_timeout.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_default_timeout.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_GET_DEFAULT_TIMEOUT 3
.Os
.Sh NAME
.Nm SSL_get_default_timeout
.Nd get default session timeout value
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_GET_DEFAULT_TIMEOUT 3
.Os
.Sh NAME
.Nm SSL_get_default_timeout
.Nd get default session timeout value
.Sh SYNOPSIS
.In openssl/ssl.h
77
78
79
80
81
82
83
84
85
.Sh SEE ALSO
.Xr ssl 3 ,
.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
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

77
78
79
80
81
82
83
84
85
.Sh SEE ALSO
.Xr ssl 3 ,
.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 .
Changes to jni/libressl/man/SSL_get_error.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_error.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
.\"
.\" This file was written by Bodo Moeller <bodo@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <bodo@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_GET_ERROR 3
.Os
.Sh NAME
.Nm SSL_get_error
.Nd obtain result code for TLS/SSL I/O operation
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 29 2018 $
.Dt SSL_GET_ERROR 3
.Os
.Sh NAME
.Nm SSL_get_error
.Nd obtain result code for TLS/SSL I/O operation
.Sh SYNOPSIS
.In openssl/ssl.h
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.Sh RETURN VALUES
The following return values can currently occur:
.Bl -tag -width Ds
.It Dv SSL_ERROR_NONE
The TLS/SSL I/O operation completed.
This result code is returned if and only if
.Fa ret
< 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
only if a closure alert has occurred in the protocol, i.e., if the connection
has been closed cleanly.
Note that in this case
.Dv SSL_ERROR_ZERO_RETURN







|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.Sh RETURN VALUES
The following return values can currently occur:
.Bl -tag -width Ds
.It Dv SSL_ERROR_NONE
The TLS/SSL I/O operation completed.
This result code is returned if and only if
.Fa ret
> 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
only if a closure alert has occurred in the protocol, i.e., if the connection
has been closed cleanly.
Note that in this case
.Dv SSL_ERROR_ZERO_RETURN
209
210
211
212
213
214
215
216
217
The OpenSSL error queue contains more information on the error.
.El
.Sh SEE ALSO
.Xr err 3 ,
.Xr ssl 3
.Sh HISTORY
.Fn SSL_get_error
first appeared in SSLeay 0.8 and have been available since
.Ox 2.4 .







|

209
210
211
212
213
214
215
216
217
The OpenSSL error queue contains more information on the error.
.El
.Sh SEE ALSO
.Xr err 3 ,
.Xr ssl 3
.Sh HISTORY
.Fn SSL_get_error
first appeared in SSLeay 0.8.0 and have been available since
.Ox 2.4 .
Changes to jni/libressl/man/SSL_get_ex_new_index.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_GET_EX_NEW_INDEX 3
.Os
.Sh NAME
.Nm SSL_get_ex_new_index ,
.Nm SSL_set_ex_data ,
.Nm SSL_get_ex_data
.Nd internal application specific data functions







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_GET_EX_NEW_INDEX 3
.Os
.Sh NAME
.Nm SSL_get_ex_new_index ,
.Nm SSL_set_ex_data ,
.Nm SSL_get_ex_data
.Nd internal application specific data functions
118
119
120
121
122
123
124






125
126
127
128
129
130
.Xr SSL_CTX_set_verify 3 .
.Sh SEE ALSO
.Xr CRYPTO_set_ex_data 3 ,
.Xr RSA_get_ex_new_index 3 ,
.Xr ssl 3 ,
.Xr SSL_CTX_set_verify 3
.Sh HISTORY






.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 .







>
>
>
>
>
>






118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
.Xr SSL_CTX_set_verify 3 .
.Sh SEE ALSO
.Xr CRYPTO_set_ex_data 3 ,
.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 .
Changes to jni/libressl/man/SSL_get_fd.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_fd.3,v 1.5 2018/03/22 17:38:41 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2005, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2005, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt SSL_GET_FD 3
.Os
.Sh NAME
.Nm SSL_get_fd ,
.Nm SSL_get_rfd ,
.Nm SSL_get_wfd
.Nd get file descriptor linked to an SSL object







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_GET_FD 3
.Os
.Sh NAME
.Nm SSL_get_fd ,
.Nm SSL_get_rfd ,
.Nm SSL_get_wfd
.Nd get file descriptor linked to an SSL object
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.El
.Sh SEE ALSO
.Xr BIO_new 3 ,
.Xr ssl 3 ,
.Xr SSL_set_fd 3
.Sh HISTORY
.Fn SSL_get_fd
appeared before SSLeay 0.8 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 .







|







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.El
.Sh SEE ALSO
.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 .
Changes to jni/libressl/man/SSL_get_peer_cert_chain.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_peer_cert_chain.3,v 1.4 2018/03/21 05:07:04 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
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2005, 2014, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\"	$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
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2005, 2014, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 2018 $
.Dt SSL_GET_PEER_CERT_CHAIN 3
.Os
.Sh NAME
.Nm SSL_get_peer_cert_chain
.Nd get the X509 certificate chain sent by the peer
.Sh SYNOPSIS
.In openssl/ssl.h







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 SSL_GET_PEER_CERT_CHAIN 3
.Os
.Sh NAME
.Nm SSL_get_peer_cert_chain
.Nd get the X509 certificate chain sent by the peer
.Sh SYNOPSIS
.In openssl/ssl.h
99
100
101
102
103
104
105
106
107
The return value points to the certificate chain presented by the peer.
.El
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_get_peer_certificate 3
.Sh HISTORY
.Fn SSL_get_peer_cert_chain
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

99
100
101
102
103
104
105
106
107
The return value points to the certificate chain presented by the peer.
.El
.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 .
Changes to jni/libressl/man/SSL_get_peer_certificate.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_peer_certificate.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_GET_PEER_CERTIFICATE 3
.Os
.Sh NAME
.Nm SSL_get_peer_certificate
.Nd get the X509 certificate of the peer
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_GET_PEER_CERTIFICATE 3
.Os
.Sh NAME
.Nm SSL_get_peer_certificate
.Nd get the X509 certificate of the peer
.Sh SYNOPSIS
.In openssl/ssl.h
96
97
98
99
100
101
102
103
104
.El
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_CTX_set_verify 3 ,
.Xr SSL_get_verify_result 3
.Sh HISTORY
.Fn SSL_get_peer_certificate
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

96
97
98
99
100
101
102
103
104
.El
.Sh SEE ALSO
.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 .
Changes to jni/libressl/man/SSL_get_rbio.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_rbio.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_GET_RBIO 3
.Os
.Sh NAME
.Nm SSL_get_rbio ,
.Nm SSL_get_wbio
.Nd get BIO linked to an SSL object
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_GET_RBIO 3
.Os
.Sh NAME
.Nm SSL_get_rbio ,
.Nm SSL_get_wbio
.Nd get BIO linked to an SSL object
.Sh SYNOPSIS
90
91
92
93
94
95
96
97
98
.Xr BIO_new 3 ,
.Xr ssl 3 ,
.Xr SSL_set_bio 3
.Sh HISTORY
.Fn SSL_get_rbio
and
.Fn SSL_get_wbio
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

90
91
92
93
94
95
96
97
98
.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 .
Changes to jni/libressl/man/SSL_get_session.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_session.3,v 1.6 2018/03/22 16:07:53 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2005, 2013, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2005, 2013, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 22 2018 $
.Dt SSL_GET_SESSION 3
.Os
.Sh NAME
.Nm SSL_get_session ,
.Nm SSL_get0_session ,
.Nm SSL_get1_session
.Nd retrieve TLS/SSL session data







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_GET_SESSION 3
.Os
.Sh NAME
.Nm SSL_get_session ,
.Nm SSL_get0_session ,
.Nm SSL_get1_session
.Nd retrieve TLS/SSL session data
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.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_set_session 3
.Sh HISTORY
.Fn SSL_get_session
appeared before SSLeay 0.8 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 .







|







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.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_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 .
Changes to jni/libressl/man/SSL_get_shared_ciphers.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: SSL_get_shared_ciphers.3,v 1.2 2018/03/21 05:07:04 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 SSL_GET_SHARED_CIPHERS 3
.Os
.Sh NAME
.Nm SSL_get_shared_ciphers
.Nd ciphers supported by both client and server
.Sh SYNOPSIS
.In openssl/ssl.h
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: SSL_get_shared_ciphers.3,v 1.3 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt SSL_GET_SHARED_CIPHERS 3
.Os
.Sh NAME
.Nm SSL_get_shared_ciphers
.Nd ciphers supported by both client and server
.Sh SYNOPSIS
.In openssl/ssl.h
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.Fn SSL_get_shared_ciphers
returns
.Dv NULL .
Otherwise, it returns
.Fa buf .
.Sh HISTORY
.Fn SSL_get_shared_ciphers
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .
.Sh BUGS
If the list is too long to fit into
.Fa len
bytes, it is silently truncated after the last cipher name that fits,
and all following ciphers are skipped.
If the buffer is very short such that even the first cipher name
does not fit, an empty string is returned even when some shared
ciphers are actually available.
.Pp
There is no easy way to find out how much space is required for
.Fa buf
or whether the supplied space was sufficient.







|













51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.Fn SSL_get_shared_ciphers
returns
.Dv NULL .
Otherwise, it returns
.Fa buf .
.Sh HISTORY
.Fn SSL_get_shared_ciphers
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
bytes, it is silently truncated after the last cipher name that fits,
and all following ciphers are skipped.
If the buffer is very short such that even the first cipher name
does not fit, an empty string is returned even when some shared
ciphers are actually available.
.Pp
There is no easy way to find out how much space is required for
.Fa buf
or whether the supplied space was sufficient.
Changes to jni/libressl/man/SSL_get_state.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: SSL_get_state.3,v 1.3 2018/03/21 08:06:34 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 SSL_GET_STATE 3
.Os
.Sh NAME
.Nm SSL_get_state ,
.Nm SSL_state ,
.Nm SSL_in_accept_init ,
.Nm SSL_in_before ,
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: SSL_get_state.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt SSL_GET_STATE 3
.Os
.Sh NAME
.Nm SSL_get_state ,
.Nm SSL_state ,
.Nm SSL_in_accept_init ,
.Nm SSL_in_before ,
139
140
141
142
143
144
145
146

147

148
149
150
151
152


153
154
155
156
157
other bits.
.Pp
All these functions may be implemented as macros.
.Sh SEE ALSO
.Xr SSL_renegotiate 3 ,
.Xr SSL_set_connect_state 3
.Sh HISTORY
.Fn SSL_state ,

.Fn SSL_in_accept_init ,

.Fn SSL_in_before ,
.Fn SSL_in_connect_init ,
.Fn SSL_in_init ,
and
.Fn SSL_is_init_finished


appeared before SSLeay 0.8.
.Fn SSL_get_state
first appeared in SSLeay 0.9.0.
These functions have been available since
.Ox 2.4 .







|
>
|
>
|

<

|
>
>
|


|

139
140
141
142
143
144
145
146
147
148
149
150
151

152
153
154
155
156
157
158
159
160
other bits.
.Pp
All these functions may be implemented as macros.
.Sh SEE ALSO
.Xr SSL_renegotiate 3 ,
.Xr SSL_set_connect_state 3
.Sh HISTORY
.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 .
Changes to jni/libressl/man/SSL_get_verify_result.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_verify_result.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_GET_VERIFY_RESULT 3
.Os
.Sh NAME
.Nm SSL_get_verify_result
.Nd get result of peer certificate verification
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_GET_VERIFY_RESULT 3
.Os
.Sh NAME
.Nm SSL_get_verify_result
.Nd get result of peer certificate verification
.Sh SYNOPSIS
.In openssl/ssl.h
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.Sh SEE ALSO
.Xr openssl 1 ,
.Xr ssl 3 ,
.Xr SSL_get_peer_certificate 3 ,
.Xr SSL_set_verify_result 3
.Sh HISTORY
.Fn SSL_get_verify_result
appeared before SSLeay 0.8 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 .
This is because no verification error occurred;
however, it does not indicate success.
.Fn SSL_get_verify_result
is only useful in connection with
.Xr SSL_get_peer_certificate 3 .







|









84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.Sh SEE ALSO
.Xr openssl 1 ,
.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 .
This is because no verification error occurred;
however, it does not indicate success.
.Fn SSL_get_verify_result
is only useful in connection with
.Xr SSL_get_peer_certificate 3 .
Changes to jni/libressl/man/SSL_get_version.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_version.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005, 2014 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
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_get_version.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
.\"	OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005, 2014 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_GET_VERSION 3
.Os
.Sh NAME
.Nm SSL_get_version ,
.Nm SSL_version
.Nd get the protocol version of a connection
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_GET_VERSION 3
.Os
.Sh NAME
.Nm SSL_get_version ,
.Nm SSL_version
.Nd get the protocol version of a connection
.Sh SYNOPSIS
84
85
86
87
88
89
90
91
92
.El
.Sh SEE ALSO
.Xr ssl 3
.Sh HISTORY
.Fn SSL_get_version
and
.Fn SSL_version
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

84
85
86
87
88
89
90
91
92
.El
.Sh SEE ALSO
.Xr ssl 3
.Sh HISTORY
.Fn SSL_get_version
and
.Fn SSL_version
first appeared in SSLeay 0.8.0 and have been available since
.Ox 2.4 .
Changes to jni/libressl/man/SSL_library_init.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_library_init.3,v 1.5 2018/03/22 16:07:53 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2006, 2010 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2006, 2010 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt SSL_LIBRARY_INIT 3
.Os
.Sh NAME
.Nm SSL_library_init ,
.Nm OpenSSL_add_ssl_algorithms ,
.Nm SSLeay_add_ssl_algorithms
.Nd initialize SSL library by registering algorithms







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_LIBRARY_INIT 3
.Os
.Sh NAME
.Nm SSL_library_init ,
.Nm OpenSSL_add_ssl_algorithms ,
.Nm SSLeay_add_ssl_algorithms
.Nd initialize SSL library by registering algorithms
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.Ed
.Sh SEE ALSO
.Xr RAND_add 3 ,
.Xr ssl 3 ,
.Xr SSL_load_error_strings 3
.Sh HISTORY
.Fn SSLeay_add_ssl_algorithms
appeared before SSLeay 0.8 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 .







|









94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.Ed
.Sh SEE ALSO
.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 .
Changes to jni/libressl/man/SSL_load_client_CA_file.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_load_client_CA_file.3,v 1.7 2018/03/21 16:12:41 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 2018 $
.Dt SSL_LOAD_CLIENT_CA_FILE 3
.Os
.Sh NAME
.Nm SSL_load_client_CA_file ,
.Nm SSL_add_file_cert_subjects_to_stack ,
.Nm SSL_add_dir_cert_subjects_to_stack
.Nd load certificate names from files







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 SSL_LOAD_CLIENT_CA_FILE 3
.Os
.Sh NAME
.Nm SSL_load_client_CA_file ,
.Nm SSL_add_file_cert_subjects_to_stack ,
.Nm SSL_add_dir_cert_subjects_to_stack
.Nd load certificate names from files
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.Sh SEE ALSO
.Xr PEM_read_bio_X509 3 ,
.Xr SSL_CTX_set_client_CA_list 3 ,
.Xr X509_get_subject_name 3 ,
.Xr X509_NAME_new 3
.Sh HISTORY
.Fn SSL_load_client_CA_file
appeared before SSLeay 0.8 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 and have been available since
.Ox 2.6 .







|







142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.Sh SEE ALSO
.Xr PEM_read_bio_X509 3 ,
.Xr SSL_CTX_set_client_CA_list 3 ,
.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 and have been available since
.Ox 2.6 .
Changes to jni/libressl/man/SSL_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: SSL_new.3,v 1.5 2018/03/24 00:55:37 schwarze Exp $
.\" full merge up to: OpenSSL 1c7ae3dd Mar 29 19:17:55 2017 +1000
.\"
.\" This file was written by Richard Levitte <levitte@openssl.org>
.\" and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\" $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 Richard Levitte <levitte@openssl.org>
.\" and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_NEW 3
.Os
.Sh NAME
.Nm SSL_new ,
.Nm SSL_up_ref
.Nd create a new SSL structure for a connection
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_NEW 3
.Os
.Sh NAME
.Nm SSL_new ,
.Nm SSL_up_ref
.Nd create a new SSL structure for a connection
.Sh SYNOPSIS
97
98
99
100
101
102
103
104
105
106
107
108
109
.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 before SSLeay 0.8 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 .







|





97
98
99
100
101
102
103
104
105
106
107
108
109
.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 .
Changes to jni/libressl/man/SSL_pending.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_pending.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>,
.\" Bodo Moeller <bodo@openssl.org>, and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2005, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>,
.\" Bodo Moeller <bodo@openssl.org>, and Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2005, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 2018 $
.Dt SSL_PENDING 3
.Os
.Sh NAME
.Nm SSL_pending
.Nd obtain number of readable bytes buffered in an SSL object
.Sh SYNOPSIS
.In openssl/ssl.h







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 SSL_PENDING 3
.Os
.Sh NAME
.Nm SSL_pending
.Nd obtain number of readable bytes buffered in an SSL object
.Sh SYNOPSIS
.In openssl/ssl.h
97
98
99
100
101
102
103
104
105
106
107
108
109
bytes that are pending and are available for immediate read.
.Sh SEE ALSO
.Xr ssl 3 ,
.Xr SSL_CTX_set_read_ahead 3 ,
.Xr SSL_read 3
.Sh HISTORY
.Fn SSL_pending
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .
.Sh BUGS
Up to OpenSSL 0.9.6,
.Fn SSL_pending
did not check if the record type of pending data is application data.







|





97
98
99
100
101
102
103
104
105
106
107
108
109
bytes that are pending and are available for immediate read.
.Sh SEE ALSO
.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
did not check if the record type of pending data is application data.
Changes to jni/libressl/man/SSL_read.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_read.3,v 1.5 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org> and
.\" Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2001, 2008, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org> and
.\" Matt Caswell <matt@openssl.org>.
.\" Copyright (c) 2000, 2001, 2008, 2016 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_READ 3
.Os
.Sh NAME
.Nm SSL_read ,
.Nm SSL_peek
.Nd read bytes from a TLS/SSL connection
.Sh SYNOPSIS







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_READ 3
.Os
.Sh NAME
.Nm SSL_read ,
.Nm SSL_peek
.Nd read bytes from a TLS/SSL connection
.Sh SYNOPSIS
221
222
223
224
225
226
227
228
229

230
231
.Xr SSL_pending 3 ,
.Xr SSL_set_connect_state 3 ,
.Xr SSL_set_shutdown 3 ,
.Xr SSL_shutdown 3 ,
.Xr SSL_write 3
.Sh HISTORY
.Fn SSL_read
and
.Fn SSL_peek

appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

>
|

221
222
223
224
225
226
227
228
229
230
231
232
.Xr SSL_pending 3 ,
.Xr SSL_set_connect_state 3 ,
.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 .
Changes to jni/libressl/man/SSL_renegotiate.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_renegotiate.3,v 1.7 2018/03/23 05:50:30 schwarze Exp $
.\"	OpenSSL SSL_key_update.pod 4fbfe86a Feb 16 17:04:40 2017 +0000
.\"
.\" This file is a derived work.
.\" Some parts are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" Some parts are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 SSL_RENEGOTIATE 3
.Os
.Sh NAME
.Nm SSL_renegotiate ,
.Nm SSL_renegotiate_abbreviated ,
.Nm SSL_renegotiate_pending
.Nd initiate a new TLS handshake







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 SSL_RENEGOTIATE 3
.Os
.Sh NAME
.Nm SSL_renegotiate ,
.Nm SSL_renegotiate_abbreviated ,
.Nm SSL_renegotiate_pending
.Nd initiate a new TLS handshake
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
.Sh SEE ALSO
.Xr SSL_do_handshake 3 ,
.Xr SSL_num_renegotiations 3 ,
.Xr SSL_read 3 ,
.Xr SSL_write 3
.Sh HISTORY
.Fn SSL_renegotiate
appeared before SSLeay 0.8 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 .







|









149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
.Sh SEE ALSO
.Xr SSL_do_handshake 3 ,
.Xr SSL_num_renegotiations 3 ,
.Xr SSL_read 3 ,
.Xr SSL_write 3
.Sh HISTORY
.Fn SSL_renegotiate
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 .
Changes to jni/libressl/man/SSL_rstate_string.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_rstate_string.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_RSTATE_STRING 3
.Os
.Sh NAME
.Nm SSL_rstate_string ,
.Nm SSL_rstate_string_long
.Nd get textual description of state of an SSL object during read operation
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_RSTATE_STRING 3
.Os
.Sh NAME
.Nm SSL_rstate_string ,
.Nm SSL_rstate_string_long
.Nd get textual description of state of an SSL object during read operation
.Sh SYNOPSIS
100
101
102
103
104
105
106
107
108
.El
.Sh SEE ALSO
.Xr ssl 3
.Sh HISTORY
.Fn SSL_rstate_string
and
.Fn SSL_rstate_string_long
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

100
101
102
103
104
105
106
107
108
.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 .
Changes to jni/libressl/man/SSL_session_reused.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_session_reused.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_SESSION_REUSED 3
.Os
.Sh NAME
.Nm SSL_session_reused
.Nd query whether a reused session was negotiated during handshake
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_SESSION_REUSED 3
.Os
.Sh NAME
.Nm SSL_session_reused
.Nd query whether a reused session was negotiated during handshake
.Sh SYNOPSIS
.In openssl/ssl.h
75
76
77
78
79
80
81
82
83
.El
.Sh SEE ALSO
.Xr SSL_ctrl 3 ,
.Xr SSL_CTX_set_session_cache_mode 3 ,
.Xr SSL_set_session 3
.Sh HISTORY
.Fn SSL_session_reused
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

75
76
77
78
79
80
81
82
83
.El
.Sh SEE ALSO
.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 .
Changes to jni/libressl/man/SSL_set_bio.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_set_bio.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL acb5b343 Sep 16 16:00:38 2000 +0000
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_SET_BIO 3
.Os
.Sh NAME
.Nm SSL_set_bio
.Nd connect the SSL object with a BIO
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_SET_BIO 3
.Os
.Sh NAME
.Nm SSL_set_bio
.Nd connect the SSL object with a BIO
.Sh SYNOPSIS
.In openssl/ssl.h
94
95
96
97
98
99
100
101
102
.Xr ssl 3 ,
.Xr SSL_accept 3 ,
.Xr SSL_connect 3 ,
.Xr SSL_get_rbio 3 ,
.Xr SSL_shutdown 3
.Sh HISTORY
.Fn SSL_set_bio
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

94
95
96
97
98
99
100
101
102
.Xr ssl 3 ,
.Xr SSL_accept 3 ,
.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 .
Changes to jni/libressl/man/SSL_set_connect_state.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: SSL_set_connect_state.3,v 1.5 2018/03/23 14:28:16 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 <jaenicke@openssl.org>
.\" and Paul Yang <yang.yang@baishancloud.com>.
.\" Copyright (c) 2001, 2017 The OpenSSL Project.  All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $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 <jaenicke@openssl.org>
.\" and Paul Yang <yang.yang@baishancloud.com>.
.\" Copyright (c) 2001, 2017 The OpenSSL Project.  All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 SSL_SET_CONNECT_STATE 3
.Os
.Sh NAME
.Nm SSL_set_connect_state ,
.Nm SSL_set_accept_state ,
.Nm SSL_is_server
.Nd prepare SSL object to work in client or server mode







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 SSL_SET_CONNECT_STATE 3
.Os
.Sh NAME
.Nm SSL_set_connect_state ,
.Nm SSL_set_accept_state ,
.Nm SSL_is_server
.Nd prepare SSL object to work in client or server mode
141
142
143
144
145
146
147
148
149
150
151
152
153
.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
appeared before SSLeay 0.8 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 .







|





141
142
143
144
145
146
147
148
149
150
151
152
153
.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 .
Changes to jni/libressl/man/SSL_set_fd.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_set_fd.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_SET_FD 3
.Os
.Sh NAME
.Nm SSL_set_fd ,
.Nm SSL_set_rfd ,
.Nm SSL_set_wfd
.Nd connect the SSL object with a file descriptor







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_SET_FD 3
.Os
.Sh NAME
.Nm SSL_set_fd ,
.Nm SSL_set_rfd ,
.Nm SSL_set_wfd
.Nd connect the SSL object with a file descriptor
115
116
117
118
119
120
121






122
123
.Xr ssl 3 ,
.Xr SSL_accept 3 ,
.Xr SSL_connect 3 ,
.Xr SSL_get_fd 3 ,
.Xr SSL_set_bio 3 ,
.Xr SSL_shutdown 3
.Sh HISTORY






These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







>
>
>
>
>
>
|

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
.Xr ssl 3 ,
.Xr SSL_accept 3 ,
.Xr SSL_connect 3 ,
.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 .
Changes to jni/libressl/man/SSL_set_session.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_set_session.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL 05ea606a May 20 20:52:46 2016 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_SET_SESSION 3
.Os
.Sh NAME
.Nm SSL_set_session
.Nd set a TLS/SSL session to be used during TLS/SSL connect
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_SET_SESSION 3
.Os
.Sh NAME
.Nm SSL_set_session
.Nd set a TLS/SSL session to be used during TLS/SSL connect
.Sh SYNOPSIS
.In openssl/ssl.h
111
112
113
114
115
116
117
118
119
.Xr ssl 3 ,
.Xr SSL_CTX_set_session_cache_mode 3 ,
.Xr SSL_get_session 3 ,
.Xr SSL_SESSION_free 3 ,
.Xr SSL_session_reused 3
.Sh HISTORY
.Fn SSL_set_session
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

111
112
113
114
115
116
117
118
119
.Xr ssl 3 ,
.Xr SSL_CTX_set_session_cache_mode 3 ,
.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 .
Changes to jni/libressl/man/SSL_set_shutdown.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_set_shutdown.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_SET_SHUTDOWN 3
.Os
.Sh NAME
.Nm SSL_set_shutdown ,
.Nm SSL_get_shutdown
.Nd manipulate shutdown state of an SSL connection
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_SET_SHUTDOWN 3
.Os
.Sh NAME
.Nm SSL_set_shutdown ,
.Nm SSL_get_shutdown
.Nd manipulate shutdown state of an SSL connection
.Sh SYNOPSIS
133
134
135
136
137
138
139
140
141
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

133
134
135
136
137
138
139
140
141
.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 .
Changes to jni/libressl/man/SSL_set_verify_result.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_set_verify_result.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_SET_VERIFY_RESULT 3
.Os
.Sh NAME
.Nm SSL_set_verify_result
.Nd override result of peer certificate verification
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_SET_VERIFY_RESULT 3
.Os
.Sh NAME
.Nm SSL_set_verify_result
.Nd override result of peer certificate verification
.Sh SYNOPSIS
.In openssl/ssl.h
85
86
87
88
89
90
91
92
93
.Sh SEE ALSO
.Xr openssl 1 ,
.Xr ssl 3 ,
.Xr SSL_get_peer_certificate 3 ,
.Xr SSL_get_verify_result 3
.Sh HISTORY
.Fn SSL_set_verify_result
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

85
86
87
88
89
90
91
92
93
.Sh SEE ALSO
.Xr openssl 1 ,
.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 .
Changes to jni/libressl/man/SSL_shutdown.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_shutdown.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2004, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2004, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 2018 $
.Dt SSL_SHUTDOWN 3
.Os
.Sh NAME
.Nm SSL_shutdown
.Nd shut down a TLS/SSL connection
.Sh SYNOPSIS
.In openssl/ssl.h







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 SSL_SHUTDOWN 3
.Os
.Sh NAME
.Nm SSL_shutdown
.Nd shut down a TLS/SSL connection
.Sh SYNOPSIS
.In openssl/ssl.h
245
246
247
248
249
250
251
252
253
.Xr SSL_connect 3 ,
.Xr SSL_CTX_set_quiet_shutdown 3 ,
.Xr SSL_free 3 ,
.Xr SSL_get_error 3 ,
.Xr SSL_set_shutdown 3
.Sh HISTORY
.Fn SSL_shutdown
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

245
246
247
248
249
250
251
252
253
.Xr SSL_connect 3 ,
.Xr SSL_CTX_set_quiet_shutdown 3 ,
.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 .
Changes to jni/libressl/man/SSL_state_string.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_state_string.3,v 1.3 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_STATE_STRING 3
.Os
.Sh NAME
.Nm SSL_state_string ,
.Nm SSL_state_string_long
.Nd get textual description of state of an SSL object
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_STATE_STRING 3
.Os
.Sh NAME
.Nm SSL_state_string ,
.Nm SSL_state_string_long
.Nd get textual description of state of an SSL object
.Sh SYNOPSIS
102
103
104
105
106
107
108
109
110
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

102
103
104
105
106
107
108
109
110
.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 .
Changes to jni/libressl/man/SSL_want.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_want.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_WANT 3
.Os
.Sh NAME
.Nm SSL_want ,
.Nm SSL_want_nothing ,
.Nm SSL_want_read ,
.Nm SSL_want_write ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_WANT 3
.Os
.Sh NAME
.Nm SSL_want ,
.Nm SSL_want_nothing ,
.Nm SSL_want_read ,
.Nm SSL_want_write ,
145
146
147
148
149
150
151








152
153
.Fn SSL_want_x509_lookup
return 1 when the corresponding condition is true or 0 otherwise.
.Sh SEE ALSO
.Xr err 3 ,
.Xr ssl 3 ,
.Xr SSL_get_error 3
.Sh HISTORY








These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







>
>
>
>
>
>
>
>
|

145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
.Fn SSL_want_x509_lookup
return 1 when the corresponding condition is true or 0 otherwise.
.Sh SEE ALSO
.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 .
Changes to jni/libressl/man/SSL_write.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: SSL_write.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2000, 2001, 2002 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt SSL_WRITE 3
.Os
.Sh NAME
.Nm SSL_write
.Nd write bytes to a TLS/SSL connection
.Sh SYNOPSIS
.In openssl/ssl.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 SSL_WRITE 3
.Os
.Sh NAME
.Nm SSL_write
.Nd write bytes to a TLS/SSL connection
.Sh SYNOPSIS
.In openssl/ssl.h
216
217
218
219
220
221
222
223
224
.Xr SSL_CTX_new 3 ,
.Xr SSL_CTX_set_mode 3 ,
.Xr SSL_get_error 3 ,
.Xr SSL_read 3 ,
.Xr SSL_set_connect_state 3
.Sh HISTORY
.Fn SSL_write
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .







|

216
217
218
219
220
221
222
223
224
.Xr SSL_CTX_new 3 ,
.Xr SSL_CTX_set_mode 3 ,
.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 .
Changes to jni/libressl/man/UI_create_method.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: UI_create_method.3,v 1.4 2018/03/23 04:34:23 schwarze Exp $
.\"	OpenSSL UI_create_method.pod 8e3d46e5 Mar 11 10:51:04 2017 +0100
.\"
.\" This file was written by Richard Levitte <levitte@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <levitte@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 UI_CREATE_METHOD 3
.Os
.Sh NAME
.Nm UI_create_method ,
.Nm UI_destroy_method ,
.Nm UI_method_set_opener ,
.Nm UI_method_set_writer ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 19 2018 $
.Dt UI_CREATE_METHOD 3
.Os
.Sh NAME
.Nm UI_create_method ,
.Nm UI_destroy_method ,
.Nm UI_method_set_opener ,
.Nm UI_method_set_writer ,
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.Nm UI_method_get_closer ,
.Nm UI_method_get_prompt_constructor
.Nd user interface method creation and destruction
.Sh SYNOPSIS
.In openssl/ui.h
.Ft UI_METHOD *
.Fo UI_create_method
.Fa "char *name"
.Fc
.Ft void
.Fo UI_destroy_method
.Fa "UI_METHOD *ui_method"
.Fc
.Ft int
.Fo UI_method_set_opener







|







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.Nm UI_method_get_closer ,
.Nm UI_method_get_prompt_constructor
.Nd user interface method creation and destruction
.Sh SYNOPSIS
.In openssl/ui.h
.Ft UI_METHOD *
.Fo UI_create_method
.Fa "const char *name"
.Fc
.Ft void
.Fo UI_destroy_method
.Fa "UI_METHOD *ui_method"
.Fc
.Ft int
.Fo UI_method_set_opener
Changes to jni/libressl/man/X25519.3.
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55





56









57

58
59
60
61
62
63
64


65


66

67

68
69
70
71
72

73


74
75
76


77
78

79

80
81
82

83
84
85
86
87
88




89
90


91
92
93


94
95


96
97

98
99






.\"	$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
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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: April 10 2017 $
.Dt X25519 3
.Os
.Sh NAME
.Nm X25519





.Nd EVP_PKEY X25519 support









.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.


.Pp

The peer public key must be set using

.Xr EVP_PKEY_derive_set_peer 3
when performing key derivation.
.Pp
A context for the
.Nm

algorithm can be obtained by calling:


.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 <openssl/evp.h>
#include <openssl/pem.h>


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


.Pp
The key derivation example in
.Xr EVP_PKEY_derive 3


can be used with
.Nm .


.Sh SEE ALSO
.Xr EVP_PKEY_CTX_new 3 ,

.Xr EVP_PKEY_derive 3 ,
.Xr EVP_PKEY_keygen 3






|
>
|

<
|
<
<
<
<
<
|
<

<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
|
|

<
<
<
<
<
|
|
|
<
<
|
<
|
<
|
<
|

|



|
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>

>
|
<
<
<
<
<

>
>
|
>
>

>
|
>
|
|
<
|
<
>
|
>
>

|
<
>
>
|
<
>
|
>
|
|
<
>
|
|
|
|
|
|
>
>
>
>
|
<
>
>

|
|
>
>
|
<
>
>

<
>
|
<
>
>
>
>
>
>
1
2
3
4

5





6

7











8




9
10
11





12
13
14


15

16

17

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42





43
44
45
46
47
48
49
50
51
52
53
54

55

56
57
58
59
60
61

62
63
64

65
66
67
68
69

70
71
72
73
74
75
76
77
78
79
80
81

82
83
84
85
86
87
88
89

90
91
92

93
94

95
96
97
98
99
100
.\" $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
.\"

.\" Copyright (c) 2015 Google Inc.





.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>

.\"











.\" 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: August 10 2018 $
.Dt X25519 3
.Os
.Sh NAME
.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
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
.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
.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
.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 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

.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
Changes to jni/libressl/man/X509_ALGOR_dup.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_ALGOR_dup.3,v 1.11 2018/03/23 05:48:56 schwarze Exp $
.\"	OpenSSL 4692340e Jun 7 15:49:08 2016 -0400
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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_ALGOR_DUP 3
.Os
.Sh NAME
.Nm X509_ALGOR_new ,
.Nm X509_ALGOR_free ,
.Nm X509_ALGOR_dup ,
.Nm X509_ALGOR_set0 ,







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 1 2018 $
.Dt X509_ALGOR_DUP 3
.Os
.Sh NAME
.Nm X509_ALGOR_new ,
.Nm X509_ALGOR_free ,
.Nm X509_ALGOR_dup ,
.Nm X509_ALGOR_set0 ,
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.Fa "X509_ALGOR *alg"
.Fa "ASN1_OBJECT *aobj"
.Fa "int ptype"
.Fa "void *pval"
.Fc
.Ft void
.Fo X509_ALGOR_get0
.Fa "ASN1_OBJECT **paobj"
.Fa "int *pptype"
.Fa "const void **ppval"
.Fa "const X509_ALGOR *alg"
.Fc
.Ft void
.Fo X509_ALGOR_set_md
.Fa "X509_ALGOR *alg"







|







92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.Fa "X509_ALGOR *alg"
.Fa "ASN1_OBJECT *aobj"
.Fa "int ptype"
.Fa "void *pval"
.Fc
.Ft void
.Fo X509_ALGOR_get0
.Fa "const ASN1_OBJECT **paobj"
.Fa "int *pptype"
.Fa "const void **ppval"
.Fa "const X509_ALGOR *alg"
.Fc
.Ft void
.Fo X509_ALGOR_set_md
.Fa "X509_ALGOR *alg"
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233

234
235
236
237
238
.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 before SSLeay 0.8 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 and 1.0.0p 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 .







|













|
>





212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
.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 .
Changes to jni/libressl/man/X509_ATTRIBUTE_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_ATTRIBUTE_new.3,v 1.5 2018/03/21 03:16:08 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 X509_ATTRIBUTE_NEW 3
.Os
.Sh NAME
.Nm X509_ATTRIBUTE_new ,
.Nm X509_ATTRIBUTE_free
.\" In the following line, "X.501" and "Attribute" are not typos.
.\" The "Attribute" type is defined in X.501, not in X.509.
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_ATTRIBUTE_new.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt X509_ATTRIBUTE_NEW 3
.Os
.Sh NAME
.Nm X509_ATTRIBUTE_new ,
.Nm X509_ATTRIBUTE_free
.\" In the following line, "X.501" and "Attribute" are not typos.
.\" The "Attribute" type is defined in X.501, not in X.509.
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Sh BUGS
A data type designed to hold arbitrary data is an oxymoron.
.Pp
While it may occasionally be useful for abstract syntax specification
or for generic container objects, using it for the representation
of specific data in a specific data structure feels like dubious







|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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
While it may occasionally be useful for abstract syntax specification
or for generic container objects, using it for the representation
of specific data in a specific data structure feels like dubious
Changes to jni/libressl/man/X509_CINF_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_CINF_new.3,v 1.4 2018/03/22 16:06:33 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 22 2018 $
.Dt X509_CINF_NEW 3
.Os
.Sh NAME
.Nm X509_CINF_new ,
.Nm X509_CINF_free ,
.Nm X509_VAL_new ,
.Nm X509_VAL_free ,
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_CINF_new.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt X509_CINF_NEW 3
.Os
.Sh NAME
.Nm X509_CINF_new ,
.Nm X509_CINF_free ,
.Nm X509_VAL_new ,
.Nm X509_VAL_free ,
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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 before SSLeay 0.8 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 .







|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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 .
Changes to jni/libressl/man/X509_CRL_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_CRL_new.3,v 1.6 2018/03/23 23:18:17 schwarze Exp $
.\"
.\" Copyright (c) 2016, 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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_CRL_NEW 3
.Os
.Sh NAME
.Nm X509_CRL_new ,
.Nm X509_CRL_dup ,
.Nm X509_CRL_up_ref ,
.Nm X509_CRL_free ,
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_CRL_new.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016, 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 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 ,
116
117
118
119
120
121
122
123
124
125
126
127



128
129
130
131
132
133
.Xr X509_STORE_CTX_set0_crls 3
.Sh STANDARDS
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_dup ,
.Fn X509_CRL_free ,
.Fn X509_CRL_INFO_new ,
and
.Fn X509_CRL_INFO_free



appeared before SSLeay 0.8 and 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 .







<




>
>
>
|





116
117
118
119
120
121
122

123
124
125
126
127
128
129
130
131
132
133
134
135
.Xr X509_STORE_CTX_set0_crls 3
.Sh STANDARDS
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 .
Changes to jni/libressl/man/X509_EXTENSION_set_object.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_EXTENSION_set_object.3,v 1.7 2018/03/21 03:16:08 schwarze Exp $
.\"	OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 2018 $
.Dt X509_EXTENSION_SET_OBJECT 3
.Os
.Sh NAME
.Nm X509_EXTENSION_new ,
.Nm X509_EXTENSION_free ,
.Nm X509_EXTENSION_create_by_NID ,
.Nm X509_EXTENSION_create_by_OBJ ,







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 19 2018 $
.Dt X509_EXTENSION_SET_OBJECT 3
.Os
.Sh NAME
.Nm X509_EXTENSION_new ,
.Nm X509_EXTENSION_free ,
.Nm X509_EXTENSION_create_by_NID ,
.Nm X509_EXTENSION_create_by_OBJ ,
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.Fa "ASN1_OBJECT *obj"
.Fa "int crit"
.Fa "ASN1_OCTET_STRING *data"
.Fc
.Ft int
.Fo X509_EXTENSION_set_object
.Fa "X509_EXTENSION *ex"
.Fa "ASN1_OBJECT *obj"
.Fc
.Ft int
.Fo X509_EXTENSION_set_critical
.Fa "X509_EXTENSION *ex"
.Fa "int crit"
.Fc
.Ft int
.Fo X509_EXTENSION_set_data
.Fa "X509_EXTENSION *ex"
.Fa "ASN1_OCTET_STRING *data"
.Fc
.Ft ASN1_OBJECT *
.Fo X509_EXTENSION_get_object
.Fa "X509_EXTENSION *ex"
.Fc
.Ft int
.Fo X509_EXTENSION_get_critical
.Fa "X509_EXTENSION *ex"
.Fc
.Ft ASN1_OCTET_STRING *
.Fo X509_EXTENSION_get_data
.Fa "X509_EXTENSION *ne"
.Fc
.Sh DESCRIPTION
.Fn X509_EXTENSION_new







|

















|







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.Fa "ASN1_OBJECT *obj"
.Fa "int crit"
.Fa "ASN1_OCTET_STRING *data"
.Fc
.Ft int
.Fo X509_EXTENSION_set_object
.Fa "X509_EXTENSION *ex"
.Fa "const ASN1_OBJECT *obj"
.Fc
.Ft int
.Fo X509_EXTENSION_set_critical
.Fa "X509_EXTENSION *ex"
.Fa "int crit"
.Fc
.Ft int
.Fo X509_EXTENSION_set_data
.Fa "X509_EXTENSION *ex"
.Fa "ASN1_OCTET_STRING *data"
.Fc
.Ft ASN1_OBJECT *
.Fo X509_EXTENSION_get_object
.Fa "X509_EXTENSION *ex"
.Fc
.Ft int
.Fo X509_EXTENSION_get_critical
.Fa "const X509_EXTENSION *ex"
.Fc
.Ft ASN1_OCTET_STRING *
.Fo X509_EXTENSION_get_data
.Fa "X509_EXTENSION *ne"
.Fc
.Sh DESCRIPTION
.Fn X509_EXTENSION_new
283
284
285
286
287
288
289














290
291
.Xr SXNET_new 3 ,
.Xr X509V3_get_d2i 3 ,
.Xr X509v3_get_ext_by_NID 3
.Sh STANDARDS
RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
Certificate Revocation List (CRL) Profile
.Sh HISTORY














These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
.Xr SXNET_new 3 ,
.Xr X509V3_get_d2i 3 ,
.Xr X509v3_get_ext_by_NID 3
.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 .
Changes to jni/libressl/man/X509_LOOKUP_hash_dir.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_LOOKUP_hash_dir.3,v 1.7 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 Victor B. Wagner <vitus@cryptocom.ru>
.\" and Claus Assmann.
.\" Copyright (c) 2015, 2016, 2017 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\" $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 <vitus@cryptocom.ru>
.\" and Claus Assmann.
.\" Copyright (c) 2015, 2016, 2017 The OpenSSL Project.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 22 2018 $
.Dt X509_LOOKUP_HASH_DIR 3
.Os
.Sh NAME
.Nm X509_LOOKUP_hash_dir ,
.Nm X509_LOOKUP_file ,
.Nm X509_load_cert_file ,
.Nm X509_load_crl_file ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_LOOKUP_HASH_DIR 3
.Os
.Sh NAME
.Nm X509_LOOKUP_hash_dir ,
.Nm X509_LOOKUP_file ,
.Nm X509_load_cert_file ,
.Nm X509_load_crl_file ,
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
.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
appeared before SSLeay 0.8.
.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 .







|








229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
.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 .
Changes to jni/libressl/man/X509_NAME_ENTRY_get_object.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_NAME_ENTRY_get_object.3,v 1.9 2018/03/22 16:06:33 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:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
|







1
2
3
4
5
6
7
8
.\" $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:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.\" 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 22 2018 $
.Dt X509_NAME_ENTRY_GET_OBJECT 3
.Os
.Sh NAME
.Nm X509_NAME_ENTRY_new ,
.Nm X509_NAME_ENTRY_free ,
.Nm X509_NAME_ENTRY_get_object ,
.Nm X509_NAME_ENTRY_get_data ,







|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.\" 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 19 2018 $
.Dt X509_NAME_ENTRY_GET_OBJECT 3
.Os
.Sh NAME
.Nm X509_NAME_ENTRY_new ,
.Nm X509_NAME_ENTRY_free ,
.Nm X509_NAME_ENTRY_get_object ,
.Nm X509_NAME_ENTRY_get_data ,
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
.Fn X509_NAME_ENTRY_new void
.Ft void
.Fo X509_NAME_ENTRY_free
.Fa "X509_NAME_ENTRY* ne"
.Fc
.Ft ASN1_OBJECT *
.Fo X509_NAME_ENTRY_get_object
.Fa "X509_NAME_ENTRY *ne"
.Fc
.Ft ASN1_STRING *
.Fo X509_NAME_ENTRY_get_data
.Fa "X509_NAME_ENTRY *ne"
.Fc
.Ft int
.Fo X509_NAME_ENTRY_set_object
.Fa "X509_NAME_ENTRY *ne"
.Fa "ASN1_OBJECT *obj"
.Fc
.Ft int
.Fo X509_NAME_ENTRY_set_data
.Fa "X509_NAME_ENTRY *ne"
.Fa "int type"
.Fa "const unsigned char *bytes"
.Fa "int len"







|



|




|







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
.Fn X509_NAME_ENTRY_new void
.Ft void
.Fo X509_NAME_ENTRY_free
.Fa "X509_NAME_ENTRY* ne"
.Fc
.Ft ASN1_OBJECT *
.Fo X509_NAME_ENTRY_get_object
.Fa "const X509_NAME_ENTRY *ne"
.Fc
.Ft ASN1_STRING *
.Fo X509_NAME_ENTRY_get_data
.Fa "const X509_NAME_ENTRY *ne"
.Fc
.Ft int
.Fo X509_NAME_ENTRY_set_object
.Fa "X509_NAME_ENTRY *ne"
.Fa "const ASN1_OBJECT *obj"
.Fc
.Ft int
.Fo X509_NAME_ENTRY_set_data
.Fa "X509_NAME_ENTRY *ne"
.Fa "int type"
.Fa "const unsigned char *bytes"
.Fa "int len"
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.Fa "int len"
.Fc
.Ft X509_NAME_ENTRY *
.Fo X509_NAME_ENTRY_create_by_NID
.Fa "X509_NAME_ENTRY **ne"
.Fa "int nid"
.Fa "int type"
.Fa "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 "int type"
.Fa "const unsigned char *bytes"
.Fa "int len"
.Fc
.Sh DESCRIPTION
An X.501
.Vt RelativeDistinguishedName







|





|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.Fa "int len"
.Fc
.Ft X509_NAME_ENTRY *
.Fo X509_NAME_ENTRY_create_by_NID
.Fa "X509_NAME_ENTRY **ne"
.Fa "int nid"
.Fa "int type"
.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 "const ASN1_OBJECT *obj"
.Fa "int type"
.Fa "const unsigned char *bytes"
.Fa "int len"
.Fc
.Sh DESCRIPTION
An X.501
.Vt RelativeDistinguishedName
262
263
264
265
266
267
268
269

270

271
272
273
274
275
276
277

278
279
280
281
282
283
RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
Certificate Revocation List (CRL) Profile
.Pp
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 ,

.Fn X509_NAME_ENTRY_free ,

.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

appeared before SSLeay 0.8 and 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 .







|
>
|
>







>
|





262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
Certificate Revocation List (CRL) Profile
.Pp
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 .
Changes to jni/libressl/man/X509_NAME_add_entry_by_txt.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_NAME_add_entry_by_txt.3,v 1.9 2018/03/22 16:06:33 schwarze Exp $
.\"	OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2002, 2005, 2006, 2013, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2005, 2006, 2013, 2014 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 22 2018 $
.Dt X509_NAME_ADD_ENTRY_BY_TXT 3
.Os
.Sh NAME
.Nm X509_NAME_add_entry_by_txt ,
.Nm X509_NAME_add_entry_by_OBJ ,
.Nm X509_NAME_add_entry_by_NID ,
.Nm X509_NAME_add_entry ,







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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 19 2018 $
.Dt X509_NAME_ADD_ENTRY_BY_TXT 3
.Os
.Sh NAME
.Nm X509_NAME_add_entry_by_txt ,
.Nm X509_NAME_add_entry_by_OBJ ,
.Nm X509_NAME_add_entry_by_NID ,
.Nm X509_NAME_add_entry ,
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
.Fa "int len"
.Fa "int loc"
.Fa "int set"
.Fc
.Ft int
.Fo X509_NAME_add_entry_by_OBJ
.Fa "X509_NAME *name"
.Fa "ASN1_OBJECT *obj"
.Fa "int type"
.Fa "unsigned char *bytes"
.Fa "int len"
.Fa "int loc"
.Fa "int set"
.Fc
.Ft int
.Fo X509_NAME_add_entry_by_NID
.Fa "X509_NAME *name"
.Fa "int nid"
.Fa "int type"
.Fa "unsigned char *bytes"
.Fa "int len"
.Fa "int loc"
.Fa "int set"
.Fc
.Ft int
.Fo X509_NAME_add_entry
.Fa "X509_NAME *name"
.Fa "X509_NAME_ENTRY *ne"
.Fa "int loc"
.Fa "int set"
.Fc
.Ft X509_NAME_ENTRY *
.Fo X509_NAME_delete_entry
.Fa "X509_NAME *name"
.Fa "int loc"







|

|









|







|







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
.Fa "int len"
.Fa "int loc"
.Fa "int set"
.Fc
.Ft int
.Fo X509_NAME_add_entry_by_OBJ
.Fa "X509_NAME *name"
.Fa "const ASN1_OBJECT *obj"
.Fa "int type"
.Fa "const unsigned char *bytes"
.Fa "int len"
.Fa "int loc"
.Fa "int set"
.Fc
.Ft int
.Fo X509_NAME_add_entry_by_NID
.Fa "X509_NAME *name"
.Fa "int nid"
.Fa "int type"
.Fa "const unsigned char *bytes"
.Fa "int len"
.Fa "int loc"
.Fa "int set"
.Fc
.Ft int
.Fo X509_NAME_add_entry
.Fa "X509_NAME *name"
.Fa "const X509_NAME_ENTRY *ne"
.Fa "int loc"
.Fa "int set"
.Fc
.Ft X509_NAME_ENTRY *
.Fo X509_NAME_delete_entry
.Fa "X509_NAME *name"
.Fa "int loc"
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
.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
appeared before SSLeay 0.8 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







|







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
.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
Changes to jni/libressl/man/X509_NAME_get_index_by_NID.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_NAME_get_index_by_NID.3,v 1.7 2018/03/21 03:16:08 schwarze Exp $
.\"	OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2002, 2006, 2014, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2006, 2014, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.\" 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 2018 $
.Dt X509_NAME_GET_INDEX_BY_NID 3
.Os
.Sh NAME
.Nm X509_NAME_get_index_by_NID ,
.Nm X509_NAME_get_index_by_OBJ ,
.Nm X509_NAME_entry_count ,
.Nm X509_NAME_get_entry ,
.Nm X509_NAME_get_text_by_NID ,
.Nm X509_NAME_get_text_by_OBJ
.Nd X509_NAME lookup and enumeration functions
.Sh SYNOPSIS
.In openssl/x509.h
.Ft int
.Fo X509_NAME_get_index_by_NID
.Fa "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 "int lastpos"
.Fc
.Ft int
.Fo X509_NAME_entry_count
.Fa "X509_NAME *name"
.Fc
.Ft X509_NAME_ENTRY *
.Fo X509_NAME_get_entry
.Fa "X509_NAME *name"
.Fa "int loc"
.Fc
.Ft int
.Fo X509_NAME_get_text_by_NID
.Fa "X509_NAME *name"
.Fa "int nid"
.Fa "char *buf"
.Fa "int len"
.Fc
.Ft int
.Fo X509_NAME_get_text_by_OBJ
.Fa "X509_NAME *name"
.Fa "ASN1_OBJECT *obj"
.Fa "char *buf"
.Fa "int len"
.Fc
.Sh DESCRIPTION
These functions allow an
.Vt X509_NAME
structure to be examined.







|














|





|
|




|



|












|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.\" 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 X509_NAME_GET_INDEX_BY_NID 3
.Os
.Sh NAME
.Nm X509_NAME_get_index_by_NID ,
.Nm X509_NAME_get_index_by_OBJ ,
.Nm X509_NAME_entry_count ,
.Nm X509_NAME_get_entry ,
.Nm X509_NAME_get_text_by_NID ,
.Nm X509_NAME_get_text_by_OBJ
.Nd X509_NAME lookup and enumeration functions
.Sh SYNOPSIS
.In openssl/x509.h
.Ft int
.Fo X509_NAME_get_index_by_NID
.Fa "const X509_NAME *name"
.Fa "int nid"
.Fa "int lastpos"
.Fc
.Ft int
.Fo X509_NAME_get_index_by_OBJ
.Fa "const X509_NAME *name"
.Fa "const ASN1_OBJECT *obj"
.Fa "int lastpos"
.Fc
.Ft int
.Fo X509_NAME_entry_count
.Fa "const X509_NAME *name"
.Fc
.Ft X509_NAME_ENTRY *
.Fo X509_NAME_get_entry
.Fa "const X509_NAME *name"
.Fa "int loc"
.Fc
.Ft int
.Fo X509_NAME_get_text_by_NID
.Fa "X509_NAME *name"
.Fa "int nid"
.Fa "char *buf"
.Fa "int len"
.Fc
.Ft int
.Fo X509_NAME_get_text_by_OBJ
.Fa "X509_NAME *name"
.Fa "const ASN1_OBJECT *obj"
.Fa "char *buf"
.Fa "int len"
.Fc
.Sh DESCRIPTION
These functions allow an
.Vt X509_NAME
structure to be examined.
224
225
226
227
228
229
230

231
232
233
234
235
236
237
238
}
.Ed
.Sh SEE ALSO
.Xr d2i_X509_NAME 3 ,
.Xr ERR_get_error 3 ,
.Xr X509_NAME_new 3
.Sh HISTORY

These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Sh CAVEATS
.Fn X509_NAME_get_text_by_NID
and
.Fn X509_NAME_get_text_by_OBJ
are legacy functions which have various limitations which make them of
minimal use in practice.







>
|







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
}
.Ed
.Sh SEE ALSO
.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
.Fn X509_NAME_get_text_by_OBJ
are legacy functions which have various limitations which make them of
minimal use in practice.
Changes to jni/libressl/man/X509_NAME_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_NAME_new.3,v 1.4 2018/03/21 03:16:08 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 X509_NAME_NEW 3
.Os
.Sh NAME
.Nm X509_NAME_new ,
.Nm X509_NAME_free
.\" In the following line, "X.501" and "Name" are not typos.
.\" The "Name" type is defined in X.501, not in X.509.
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_NAME_new.3,v 1.6 2018/07/29 20:29:32 tb Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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: July 29 2018 $
.Dt X509_NAME_NEW 3
.Os
.Sh NAME
.Nm X509_NAME_new ,
.Nm X509_NAME_free
.\" In the following line, "X.501" and "Name" are not typos.
.\" The "Name" type is defined in X.501, not in X.509.
58
59
60
61
62
63
64





65
66
67
68
69
70
71
.Pp
.Fn X509_NAME_free
frees
.Fa name
and all the
.Vt X509_NAME_ENTRY
objects contained in it.





.Sh RETURN VALUES
.Fn X509_NAME_new
returns a new
.Vt X509_NAME
object or
.Dv NULL
if an error occurred.







>
>
>
>
>







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.Pp
.Fn X509_NAME_free
frees
.Fa name
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
.Vt X509_NAME
object or
.Dv NULL
if an error occurred.
86
87
88
89
90
91
92
93
94
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 before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

91
92
93
94
95
96
97
98
99
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 .
Changes to jni/libressl/man/X509_NAME_print_ex.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_NAME_print_ex.3,v 1.9 2018/03/22 17:11:04 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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2004, 2007, 2016, 2017 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2004, 2007, 2016, 2017 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.\" 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 22 2018 $
.Dt X509_NAME_PRINT_EX 3
.Os
.Sh NAME
.Nm X509_NAME_print_ex ,
.Nm X509_NAME_print_ex_fp ,
.Nm X509_NAME_oneline ,
.Nm X509_NAME_print
.Nd X509_NAME printing routines
.Sh SYNOPSIS
.In openssl/x509.h
.Ft int
.Fo X509_NAME_print_ex
.Fa "BIO *out"
.Fa "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 "int indent"
.Fa "unsigned long flags"
.Fc
.Ft char *
.Fo X509_NAME_oneline
.Fa "X509_NAME *a"
.Fa "char *buf"
.Fa "int size"
.Fc
.Ft int
.Fo X509_NAME_print
.Fa "BIO *bp"
.Fa "X509_NAME *name"
.Fa "int obase"
.Fc
.Sh DESCRIPTION
.Fn X509_NAME_print_ex
prints a human readable version of
.Fa nm
to







|













|






|





|






|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.\" 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 19 2018 $
.Dt X509_NAME_PRINT_EX 3
.Os
.Sh NAME
.Nm X509_NAME_print_ex ,
.Nm X509_NAME_print_ex_fp ,
.Nm X509_NAME_oneline ,
.Nm X509_NAME_print
.Nd X509_NAME printing routines
.Sh SYNOPSIS
.In openssl/x509.h
.Ft int
.Fo X509_NAME_print_ex
.Fa "BIO *out"
.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 "const X509_NAME *nm"
.Fa "int indent"
.Fa "unsigned long flags"
.Fc
.Ft char *
.Fo X509_NAME_oneline
.Fa "const X509_NAME *a"
.Fa "char *buf"
.Fa "int size"
.Fc
.Ft int
.Fo X509_NAME_print
.Fa "BIO *bp"
.Fa "const X509_NAME *name"
.Fa "int obase"
.Fc
.Sh DESCRIPTION
.Fn X509_NAME_print_ex
prints a human readable version of
.Fa nm
to
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
.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
appeared before SSLeay 0.8 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 .







|







272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
.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 .
Changes to jni/libressl/man/X509_OBJECT_get0_X509.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27
28
29
30




31
32
33
34
35
36
37
.\" $OpenBSD: X509_OBJECT_get0_X509.3,v 1.5 2018/03/23 23:18:17 schwarze Exp $
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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_OBJECT_GET0_X509 3
.Os
.Sh NAME

.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 void




.Fo X509_OBJECT_up_ref_count
.Fa "X509_OBJECT *obj"
.Fc
.Ft void
.Fo X509_OBJECT_free_contents
.Fa "X509_OBJECT *obj"
.Fc
|














|



>










|
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.\" $OpenBSD: X509_OBJECT_get0_X509.3,v 1.8 2018/08/24 19:23:07 tb Exp $
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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
68
69
70
71
72
73
74
75

76
77
78
79
80
81
82
certificate object, one
.Vt X509_CRL
certificate revocation list object, one
.Vt EVP_PKEY
private key object, or one
.Vt char *
string.
It also remembers which type of object it contains at any given time.

.Pp
Each
.Vt X509_STORE
object uses one stack of
.Vt X509_OBJECT
structures as its main storage area.
.Pp







|
>







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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
141
142
143
144
145
146
147













148
149
150
151
152
153
154
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_get0_X509
returns an internal pointer to the certificate contained in
.Fa obj
or
.Dv NULL
if
.Fa obj







>
>
>
>
>
>
>
>
>
>
>
>
>







147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231

232
233
234
235
236
.\" 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
appeared before SSLeay 0.8 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_get0_X509
and
.Fn X509_OBJECT_get0_X509_CRL
first appeared in OpenSSL 1.1.0 and have been available since
.Ox 6.3 .







|









>
|




234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
.\" 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 .
Changes to jni/libressl/man/X509_PUBKEY_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_PUBKEY_new.3,v 1.12 2018/03/23 23:18:17 schwarze Exp $
.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_PUBKEY_NEW 3
.Os
.Sh NAME
.Nm X509_PUBKEY_new ,
.Nm X509_PUBKEY_free ,
.Nm X509_PUBKEY_set ,
.Nm X509_PUBKEY_get0 ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_PUBKEY_NEW 3
.Os
.Sh NAME
.Nm X509_PUBKEY_new ,
.Nm X509_PUBKEY_free ,
.Nm X509_PUBKEY_set ,
.Nm X509_PUBKEY_get0 ,
279
280
281
282
283
284
285
286

287

288
289
290

291
292
293
294
295
296
297
298
.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 ,

.Fn X509_PUBKEY_free ,

.Fn X509_PUBKEY_set ,
and
.Fn X509_PUBKEY_get

appeared before SSLeay 0.8 and 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 .







|
>
|
>
|


>
|







279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
.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 .
Changes to jni/libressl/man/X509_REQ_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_REQ_new.3,v 1.3 2018/03/21 03:16:08 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 X509_REQ_NEW 3
.Os
.Sh NAME
.Nm X509_REQ_new ,
.Nm X509_REQ_free ,
.Nm X509_REQ_INFO_new ,
.Nm X509_REQ_INFO_free
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_REQ_new.3,v 1.5 2018/07/29 20:29:32 tb Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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: July 29 2018 $
.Dt X509_REQ_NEW 3
.Os
.Sh NAME
.Nm X509_REQ_new ,
.Nm X509_REQ_free ,
.Nm X509_REQ_INFO_new ,
.Nm X509_REQ_INFO_free
43
44
45
46
47
48
49





50
51
52
53
54
55
56
57
58
59
60
61
62
63





64
65
66
67
68
69
70
It can hold a pointer to an
.Vt X509_REQ_INFO
object discussed below together with a cryptographic signature and
information about the signature algorithm used.
.Fn X509_REQ_free
frees
.Fa req .





.Pp
.Fn X509_REQ_INFO_new
allocates and initializes an empty
.Vt X509_REQ_INFO
object, representing an ASN.1
.Vt CertificationRequestInfo
structure defined in RFC 2986 section 4.1.
It is used inside the
.Vt X509_REQ
object and can hold the subject and the public key of the requested
certificate and additional attributes.
.Fn X509_REQ_INFO_free
frees
.Fa req_info .





.Sh RETURN VALUES
.Fn X509_REQ_new
and
.Fn X509_REQ_INFO_new
return the new
.Vt X509_REQ
or







>
>
>
>
>














>
>
>
>
>







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
It can hold a pointer to an
.Vt X509_REQ_INFO
object discussed below together with a cryptographic signature and
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
.Vt X509_REQ_INFO
object, representing an ASN.1
.Vt CertificationRequestInfo
structure defined in RFC 2986 section 4.1.
It is used inside the
.Vt X509_REQ
object and can hold the subject and the public key of the requested
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
.Fn X509_REQ_INFO_new
return the new
.Vt X509_REQ
or
84
85
86
87
88
89
90
91
92
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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

94
95
96
97
98
99
100
101
102
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 .
Changes to jni/libressl/man/X509_REVOKED_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_REVOKED_new.3,v 1.8 2018/03/23 23:18:17 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:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
|







1
2
3
4
5
6
7
8
.\" $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:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.\" 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_REVOKED_NEW 3
.Os
.Sh NAME
.Nm X509_REVOKED_new ,
.Nm X509_REVOKED_dup ,
.Nm X509_REVOKED_free ,
.Nm X509_REVOKED_get0_serialNumber ,







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.\" 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_REVOKED_NEW 3
.Os
.Sh NAME
.Nm X509_REVOKED_new ,
.Nm X509_REVOKED_dup ,
.Nm X509_REVOKED_free ,
.Nm X509_REVOKED_get0_serialNumber ,
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
.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
appeared before SSLeay 0.8 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 .







|







178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
.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 .
Changes to jni/libressl/man/X509_SIG_new.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_SIG_new.3,v 1.3 2018/03/21 03:16:08 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 X509_SIG_NEW 3
.Os
.Sh NAME
.Nm X509_SIG_new ,
.Nm X509_SIG_free
.Nd PKCS#7 digest information
.Sh SYNOPSIS
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_SIG_new.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt X509_SIG_NEW 3
.Os
.Sh NAME
.Nm X509_SIG_new ,
.Nm X509_SIG_free
.Nd PKCS#7 digest information
.Sh SYNOPSIS
59
60
61
62
63
64
65
66
67
.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 before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

59
60
61
62
63
64
65
66
67
.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 .
Changes to jni/libressl/man/X509_STORE_CTX_get_error.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_STORE_CTX_get_error.3,v 1.10 2018/03/23 23:18:17 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 <steve@openssl.org>.
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>.
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.\" 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_STORE_CTX_GET_ERROR 3
.Os
.Sh NAME
.Nm X509_STORE_CTX_get_error ,
.Nm X509_STORE_CTX_set_error ,
.Nm X509_STORE_CTX_get_error_depth ,
.Nm X509_STORE_CTX_get_current_cert ,







|







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.\" 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_CTX_GET_ERROR 3
.Os
.Sh NAME
.Nm X509_STORE_CTX_get_error ,
.Nm X509_STORE_CTX_set_error ,
.Nm X509_STORE_CTX_get_error_depth ,
.Nm X509_STORE_CTX_get_current_cert ,
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
.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
appeared before SSLeay 0.8 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 .







|











377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
.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 .
Changes to jni/libressl/man/X509_STORE_CTX_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_STORE_CTX_new.3,v 1.17 2018/03/23 23:18:17 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 <steve@openssl.org>
.\" and Rich Salz <rsalz@openssl.org>.
.\" Copyright (c) 2009, 2015, 2016 The OpenSSL Project.  All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>
.\" and Rich Salz <rsalz@openssl.org>.
.\" Copyright (c) 2009, 2015, 2016 The OpenSSL Project.  All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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_STORE_CTX_NEW 3
.Os
.Sh NAME
.Nm X509_STORE_CTX_new ,
.Nm X509_STORE_CTX_cleanup ,
.Nm X509_STORE_CTX_free ,
.Nm X509_STORE_CTX_init ,







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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_CTX_NEW 3
.Os
.Sh NAME
.Nm X509_STORE_CTX_new ,
.Nm X509_STORE_CTX_cleanup ,
.Nm X509_STORE_CTX_free ,
.Nm X509_STORE_CTX_init ,
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
.Xr X509_VERIFY_PARAM_set_flags 3
.Sh HISTORY
.Fn X509_STORE_CTX_cleanup ,
.Fn X509_STORE_CTX_init ,
.Fn X509_STORE_CTX_set_cert ,
and
.Fn X509_STORE_CTX_set_chain
appeared before SSLeay 0.8 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 .







|







323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
.Xr X509_VERIFY_PARAM_set_flags 3
.Sh HISTORY
.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 .
Changes to jni/libressl/man/X509_STORE_load_locations.3.
1


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: X509_STORE_load_locations.3,v 1.4 2018/03/21 03:28:40 schwarze Exp $


.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 X509_STORE_LOAD_LOCATIONS 3
.Os
.Sh NAME
.Nm X509_STORE_load_locations ,
.Nm X509_STORE_set_default_paths
.Nd configure files and directories used by a certificate store
.Sh SYNOPSIS
|
>
>















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.\" $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 <schwarze@openbsd.org>
.\"
.\" 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 30 2018 $
.Dt X509_STORE_LOAD_LOCATIONS 3
.Os
.Sh NAME
.Nm X509_STORE_load_locations ,
.Nm X509_STORE_set_default_paths
.Nd configure files and directories used by a certificate store
.Sh SYNOPSIS
40
41
42
43
44
45
46


47
48
49
50
51
52
53
to use the PEM file
.Fa file
and all the PEM files in the directories
contained in the colon-separated list
.Fa dirs
for looking up certificates, in addition to files and directories
that are already configured.


Directories already in use are not added again.
If
.Dv NULL
is passed for
.Fa file
or
.Fa dirs ,







>
>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
to use the PEM file
.Fa file
and all the PEM files in the directories
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
is passed for
.Fa file
or
.Fa dirs ,
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.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
appeared before SSLeay 0.8 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,
so these functions may change the state of the store even when they fail.
.Pp
.Fn X509_STORE_set_default_paths
clears the error queue, deleting even error information that was
already present when it was called.







|









112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.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,
so these functions may change the state of the store even when they fail.
.Pp
.Fn X509_STORE_set_default_paths
clears the error queue, deleting even error information that was
already present when it was called.
Changes to jni/libressl/man/X509_STORE_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_STORE_new.3,v 1.3 2018/03/23 23:18:17 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 <schwarze@openbsd.org>
|







1
2
3
4
5
6
7
8
.\" $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 <schwarze@openbsd.org>
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.\" 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_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







|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.\" 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
128
129
130
131
132
133
134
135
136
137
138
139
140
.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
appeared before SSLeay 0.8 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 .







|





128
129
130
131
132
133
134
135
136
137
138
139
140
.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 .
Changes to jni/libressl/man/X509_STORE_set1_param.3.
1
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
.\" $OpenBSD: X509_STORE_set1_param.3,v 1.12 2018/03/23 23:18:17 schwarze Exp $
.\" content checked up to:

.\" OpenSSL man3/X509_STORE_get0_param e90fc053 Jul 15 09:39:45 2017 -0400
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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_STORE_SET1_PARAM 3
.Os
.Sh NAME
.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_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
|

>
















|










>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.\" $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
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 2 2018 $
.Dt X509_STORE_SET1_PARAM 3
.Os
.Sh NAME
.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
64
65
66
67
68
69
70




71
72
73
74
75
76
77
.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 STACK_OF(X509_OBJECT) *
.Fo X509_STORE_get0_objects
.Fa "X509_STORE *store"
.Fc
.Ft int
.Fo X509_STORE_get_ex_new_index







>
>
>
>







66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.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
119
120
121
122
123
124
125

126
127
128
129
130
131
132
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.

.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







>







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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
163
164
165
166
167
168
169
170
171
172
173


174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210

211
212
213
214
215
216
217
.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_objects
returns an internal pointer to the stack of certificates, revocation lists,
and private keys contained in the
.Fa store .


The returned pointer 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
appeared before SSLeay 0.8.
.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
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_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 .







|
|
|
|
>
>
|

















|


















>







170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
.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
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 .
Changes to jni/libressl/man/X509_STORE_set_verify_cb_func.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_STORE_set_verify_cb_func.3,v 1.7 2018/03/23 23:18:17 schwarze Exp $
.\"	OpenSSL 05ea606a May 20 20:52:46 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_STORE_SET_VERIFY_CB_FUNC 3
.Os
.Sh NAME
.Nm X509_STORE_set_verify_cb ,
.Nm X509_STORE_set_verify_cb_func
.Nd set verification callback
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_SET_VERIFY_CB_FUNC 3
.Os
.Sh NAME
.Nm X509_STORE_set_verify_cb ,
.Nm X509_STORE_set_verify_cb_func
.Nd set verification callback
.Sh SYNOPSIS
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.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_new 3
.Sh HISTORY
.Fn X509_STORE_set_verify_cb_func
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .
.Pp
.Fn X509_STORE_set_verify_cb
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.







|








92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.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_new 3
.Sh HISTORY
.Fn X509_STORE_set_verify_cb_func
first appeared in SSLeay 0.8.0 and has been available since
.Ox 2.4 .
.Pp
.Fn X509_STORE_set_verify_cb
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.
Changes to jni/libressl/man/X509_VERIFY_PARAM_set_flags.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_VERIFY_PARAM_set_flags.3,v 1.12 2018/03/23 14:26:40 schwarze 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 is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
|







1
2
3
4
5
6
7
8
.\" $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 is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
.\" 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_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 ,







|







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
.\" 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 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 ,
340
341
342
343
344
345
346
347




348
349
350
351
352
353
354
355
356
357
358
359
360
361
362




363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378












379
380
381
382
383
384
385
386
387
388
389
390
391
392
393




394
395
396
397

398
399
400

401
402
403
404
405
406
407
408
409
410
411
412






413
414
415
416
417
418
419
420
421
422
423
424




425
426
427
428
429
430
431
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.
If




.Fa name
is NUL-terminated,
.Fa namelen
may be zero, otherwise
.Fa namelen
must be set to the length of
.Fa name .
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).




.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.












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 .
If




.Fa email
is NUL-terminated,
.Fa emaillen
may be zero, otherwise

.Fa emaillen
must be set to the length of
.Fa email .

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.






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.




.Pp
.Fn X509_VERIFY_PARAM_add0_table
adds
.Fa param
to a static list of
.Vt X509_VERIFY_PARAM
objects maintained by the library.







<
>
>
>
>



|
<
<
<








>
>
>
>
















>
>
>
>
>
>
>
>
>
>
>
>














<
>
>
>
>



|
>
|
<
|
>












>
>
>
>
>
>












>
>
>
>







340
341
342
343
344
345
346

347
348
349
350
351
352
353
354



355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408

409
410
411
412
413
414
415
416
417
418

419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
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.
472
473
474
475
476
477
478




479
480
481
482
483
484
485
486






487
488
489
490
491
492
493
.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 ,




.Fn X509_VERIFY_PARAM_set1_host ,
.Fn X509_VERIFY_PARAM_add1_host ,
.Fn X509_VERIFY_PARAM_set1_email ,
.Fn X509_VERIFY_PARAM_set1_ip ,
.Fn X509_VERIFY_PARAM_set1_ip_asc ,
and
.Fn X509_VERIFY_PARAM_add0_table
return 1 for success or 0 for failure.






.Pp
.Fn X509_VERIFY_PARAM_get_flags
returns the current verification flags.
.Pp
.Fn X509_VERIFY_PARAM_get_depth
returns the current verification depth.
.Pp







>
>
>
>




<

|

>
>
>
>
>
>







502
503
504
505
506
507
508
509
510
511
512
513
514
515
516

517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
.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_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_get_depth
returns the current verification depth.
.Pp
Changes to jni/libressl/man/X509_check_private_key.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.\"	$OpenBSD: X509_check_private_key.3,v 1.3 2018/03/23 00:09:11 schwarze Exp $
.\"	OpenSSL X509_check_private_key.pod 09ddb878 Jun 5 03:56:07 2017 +0800
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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_CHECK_PRIVATE_KEY 3
.Os
.Sh NAME
.Nm X509_check_private_key ,
.Nm X509_REQ_check_private_key
.Nd compare public key components
.Sh SYNOPSIS
.In openssl/x509.h
.Ft int
.Fo X509_check_private_key
.Fa "X509 *x"
.Fa "EVP_PKEY *k"
.Fc
.Ft int
.Fo X509_REQ_check_private_key
.Fa "X509_REQ *x"
.Fa "EVP_PKEY *k"
.Fc
.Sh DESCRIPTION
|
















|










|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.\"	$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 <schwarze@openbsd.org>
.\"
.\" 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 19 2018 $
.Dt X509_CHECK_PRIVATE_KEY 3
.Os
.Sh NAME
.Nm X509_check_private_key ,
.Nm X509_REQ_check_private_key
.Nd compare public key components
.Sh SYNOPSIS
.In openssl/x509.h
.Ft int
.Fo X509_check_private_key
.Fa "const X509 *x"
.Fa "const EVP_PKEY *k"
.Fc
.Ft int
.Fo X509_REQ_check_private_key
.Fa "X509_REQ *x"
.Fa "EVP_PKEY *k"
.Fc
.Sh DESCRIPTION
59
60
61
62
63
64
65
66
67
68
69
70
71
match, or 0 if they do not or if an error occurs.
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
appeared before SSLeay 0.8 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 .







|





59
60
61
62
63
64
65
66
67
68
69
70
71
match, or 0 if they do not or if an error occurs.
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 .
Changes to jni/libressl/man/X509_cmp_time.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_cmp_time.3,v 1.7 2018/03/23 04:34:23 schwarze Exp $
.\"	OpenSSL X509_cmp_time.pod 24053693 Mar 28 14:27:37 2017 +0200
.\"
.\" This file was written by Emilia Kasper <emilia@openssl.org>
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <emilia@openssl.org>
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_CMP_TIME 3
.Os
.Sh NAME
.Nm X509_cmp_time ,
.Nm X509_cmp_current_time ,
.Nm X509_time_adj_ex ,
.Nm X509_time_adj







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_CMP_TIME 3
.Os
.Sh NAME
.Nm X509_cmp_time ,
.Nm X509_cmp_current_time ,
.Nm X509_time_adj_ex ,
.Nm X509_time_adj
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
.Dv NULL
on error.
.Sh SEE ALSO
.Xr ASN1_time_parse 3 ,
.Xr time 3
.Sh HISTORY
.Fn X509_cmp_current_time
appeared before SSLeay 0.8 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 .







|











135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
.Dv NULL
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 .
Changes to jni/libressl/man/X509_digest.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_digest.3,v 1.5 2018/03/22 21:08:22 schwarze Exp $
.\"	OpenSSL X509_digest.pod 3ba4dac6 Mar 23 13:04:52 2017 -0400
.\"
.\" This file was written by Rich Salz <rsalz@openssl.org>
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <rsalz@openssl.org>
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt X509_DIGEST 3
.Os
.Sh NAME
.Nm X509_digest ,
.Nm X509_CRL_digest ,
.Nm X509_pubkey_digest ,
.Nm X509_NAME_digest ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_DIGEST 3
.Os
.Sh NAME
.Nm X509_digest ,
.Nm X509_CRL_digest ,
.Nm X509_pubkey_digest ,
.Nm X509_NAME_digest ,
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
.Sh SEE ALSO
.Xr EVP_get_digestbyname 3
.Sh HISTORY
.Fn X509_digest ,
.Fn X509_NAME_digest ,
and
.Fn PKCS7_ISSUER_AND_SERIAL_digest
appeared before SSLeay 0.8 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 .







|











132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
.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 .
Changes to jni/libressl/man/X509_get_pubkey.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_get_pubkey.3,v 1.4 2018/03/23 23:18:17 schwarze Exp $
.\" selective merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_GET_PUBKEY 3
.Os
.Sh NAME
.Nm X509_get_pubkey ,
.Nm X509_get0_pubkey ,
.Nm X509_set_pubkey ,
.Nm X509_get_X509_PUBKEY ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_GET_PUBKEY 3
.Os
.Sh NAME
.Nm X509_get_pubkey ,
.Nm X509_get0_pubkey ,
.Nm X509_set_pubkey ,
.Nm X509_get_X509_PUBKEY ,
155
156
157
158
159
160
161
162
163
164
165



166
167
168
169
170
171
.Xr X509_new 3 ,
.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_get_X509_PUBKEY ,
.Fn X509_REQ_get_pubkey ,
and
.Fn X509_REQ_set_pubkey



appeared before SSLeay 0.8 and 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 .







<



>
>
>
|





155
156
157
158
159
160
161

162
163
164
165
166
167
168
169
170
171
172
173
.Xr X509_new 3 ,
.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 .
Changes to jni/libressl/man/X509_get_serialNumber.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_get_serialNumber.3,v 1.2 2018/03/21 03:16:08 schwarze Exp $
.\"	OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt X509_GET_SERIALNUMBER 3
.Os
.Sh NAME
.Nm X509_get_serialNumber ,
.Nm X509_set_serialNumber
.Nd get or set certificate serial number
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_GET_SERIALNUMBER 3
.Os
.Sh NAME
.Nm X509_get_serialNumber ,
.Nm X509_set_serialNumber
.Nd get or set certificate serial number
.Sh SYNOPSIS
105
106
107
108
109
110
111
112
113
.Xr X509_sign 3 ,
.Xr X509_verify_cert 3 ,
.Xr X509V3_get_d2i 3
.Sh HISTORY
.Fn X509_get_serialNumber
and
.Fn X509_set_serialNumber
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

105
106
107
108
109
110
111
112
113
.Xr X509_sign 3 ,
.Xr X509_verify_cert 3 ,
.Xr X509V3_get_d2i 3
.Sh HISTORY
.Fn X509_get_serialNumber
and
.Fn X509_set_serialNumber
first appeared in SSLeay 0.6.5 and have been available since
.Ox 2.4 .
Changes to jni/libressl/man/X509_get_subject_name.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_get_subject_name.3,v 1.5 2018/03/22 21:08:22 schwarze Exp $
.\"	OpenSSL 0ad69cd6 Jun 14 23:02:16 2016 +0200
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.\" 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 22 2018 $
.Dt X509_GET_SUBJECT_NAME 3
.Os
.Sh NAME
.Nm X509_get_subject_name ,
.Nm X509_set_subject_name ,
.Nm X509_get_issuer_name ,
.Nm X509_set_issuer_name ,
.Nm X509_REQ_get_subject_name ,
.Nm X509_REQ_set_subject_name ,
.Nm X509_CRL_get_issuer ,
.Nm X509_CRL_set_issuer_name
.Nd get and set issuer or subject names
.Sh SYNOPSIS
.In openssl/x509.h
.Ft X509_NAME *
.Fo X509_get_subject_name
.Fa "X509 *x"
.Fc
.Ft int
.Fo X509_set_subject_name
.Fa "X509 *x"
.Fa "X509_NAME *name"
.Fc
.Ft X509_NAME *
.Fo X509_get_issuer_name
.Fa "X509 *x"
.Fc
.Ft int
.Fo X509_set_issuer_name
.Fa "X509 *x"
.Fa "X509_NAME *name"
.Fc
.Ft X509_NAME *







|
















|








|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.\" 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 X509_GET_SUBJECT_NAME 3
.Os
.Sh NAME
.Nm X509_get_subject_name ,
.Nm X509_set_subject_name ,
.Nm X509_get_issuer_name ,
.Nm X509_set_issuer_name ,
.Nm X509_REQ_get_subject_name ,
.Nm X509_REQ_set_subject_name ,
.Nm X509_CRL_get_issuer ,
.Nm X509_CRL_set_issuer_name
.Nd get and set issuer or subject names
.Sh SYNOPSIS
.In openssl/x509.h
.Ft X509_NAME *
.Fo X509_get_subject_name
.Fa "const X509 *x"
.Fc
.Ft int
.Fo X509_set_subject_name
.Fa "X509 *x"
.Fa "X509_NAME *name"
.Fc
.Ft X509_NAME *
.Fo X509_get_issuer_name
.Fa "const X509 *x"
.Fc
.Ft int
.Fo X509_set_issuer_name
.Fa "X509 *x"
.Fa "X509_NAME *name"
.Fc
.Ft X509_NAME *
165
166
167
168
169
170
171
172



173
174
175
176
177
178

179
180
181
182
183
184
185
186
187
188
.Xr X509_NAME_new 3 ,
.Xr X509_NAME_print_ex 3 ,
.Xr X509_new 3 ,
.Xr X509_sign 3 ,
.Xr X509_verify_cert 3 ,
.Xr X509V3_get_d2i 3
.Sh HISTORY
.Fn X509_get_subject_name ,



.Fn X509_set_subject_name ,
.Fn X509_get_issuer_name ,
.Fn X509_set_issuer_name ,
.Fn X509_REQ_get_subject_name ,
and
.Fn X509_REQ_set_subject_name

appeared before SSLeay 0.8 and 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 .







|
>
>
>

<




>
|









165
166
167
168
169
170
171
172
173
174
175
176

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
.Xr X509_NAME_new 3 ,
.Xr X509_NAME_print_ex 3 ,
.Xr X509_new 3 ,
.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 .
Changes to jni/libressl/man/X509_get_version.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_get_version.3,v 1.4 2018/03/22 21:08:22 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 22 2018 $
.Dt X509_GET_VERSION 3
.Os
.Sh NAME
.Nm X509_get_version ,
.Nm X509_set_version ,
.Nm X509_REQ_get_version ,
.Nm X509_REQ_set_version ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_GET_VERSION 3
.Os
.Sh NAME
.Nm X509_get_version ,
.Nm X509_set_version ,
.Nm X509_REQ_get_version ,
.Nm X509_REQ_set_version ,
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
.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
appeared before SSLeay 0.8 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 .







|









149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
.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 .
Changes to jni/libressl/man/X509_new.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: X509_new.3,v 1.14 2018/03/23 23:18:17 schwarze Exp $
.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2002, 2006, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2006, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_NEW 3
.Os
.Sh NAME
.Nm X509_new ,
.Nm X509_free ,
.Nm X509_up_ref ,
.Nm X509_chain_up_ref







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" 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_NEW 3
.Os
.Sh NAME
.Nm X509_new ,
.Nm X509_free ,
.Nm X509_up_ref ,
.Nm X509_chain_up_ref
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
.Sh STANDARDS
RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
Certificate Revocation List (CRL) Profile
.Sh HISTORY
.Fn X509_new
and
.Fn X509_free
appeared before SSLeay 0.8 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







|







154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
.Sh STANDARDS
RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
Certificate Revocation List (CRL) Profile
.Sh HISTORY
.Fn X509_new
and
.Fn X509_free
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
Changes to jni/libressl/man/X509_sign.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_sign.3,v 1.4 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 <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_SIGN 3
.Os
.Sh NAME
.Nm X509_sign ,
.Nm X509_sign_ctx ,
.Nm X509_verify ,
.Nm X509_REQ_sign ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_SIGN 3
.Os
.Sh NAME
.Nm X509_sign ,
.Nm X509_sign_ctx ,
.Nm X509_verify ,
.Nm X509_REQ_sign ,
185
186
187
188
189
190
191
192

193

194

195
196
197
198



199
200
201
202
203
204
205
206
207
.Xr X509_NAME_ENTRY_get_object 3 ,
.Xr X509_NAME_get_index_by_NID 3 ,
.Xr X509_NAME_print_ex 3 ,
.Xr X509_new 3 ,
.Xr X509_verify_cert 3 ,
.Xr X509V3_get_d2i 3
.Sh HISTORY
.Fn X509_sign ,

.Fn X509_verify ,

.Fn X509_REQ_sign ,

.Fn X509_REQ_verify ,
.Fn X509_CRL_sign ,
and
.Fn X509_CRL_verify



appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .
.Pp
.Fn X509_sign_ctx ,
.Fn X509_REQ_sign_ctx ,
and
.Fn X509_CRL_sign_ctx
first appeared in OpenSSL 1.0.1 and have been available since
.Ox 5.3 .







|
>
|
>
|
>
|
<


>
>
>
|








185
186
187
188
189
190
191
192
193
194
195
196
197
198

199
200
201
202
203
204
205
206
207
208
209
210
211
212
.Xr X509_NAME_ENTRY_get_object 3 ,
.Xr X509_NAME_get_index_by_NID 3 ,
.Xr X509_NAME_print_ex 3 ,
.Xr X509_new 3 ,
.Xr X509_verify_cert 3 ,
.Xr X509V3_get_d2i 3
.Sh HISTORY
.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
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
first appeared in OpenSSL 1.0.1 and have been available since
.Ox 5.3 .
Changes to jni/libressl/man/X509_verify_cert.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509_verify_cert.3,v 1.6 2018/03/21 03:16:08 schwarze Exp $
.\"	OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2009, 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
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2009, 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt X509_VERIFY_CERT 3
.Os
.Sh NAME
.Nm X509_verify_cert
.Nd discover and verify X509 certificate chain
.Sh SYNOPSIS
.In openssl/x509.h







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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_VERIFY_CERT 3
.Os
.Sh NAME
.Nm X509_verify_cert
.Nd discover and verify X509 certificate chain
.Sh SYNOPSIS
.In openssl/x509.h
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using
.Xr X509_STORE_CTX_get_error 3 .
.Sh SEE ALSO
.Xr openssl 1 ,
.Xr X509_STORE_CTX_get_error 3
.Sh HISTORY
.Fn X509_verify_cert
appeared before SSLeay 0.8 and has been available since
.Ox 2.4 .
.Sh BUGS
This function uses the header
.In openssl/x509.h
as opposed to most chain verification functions which use
.In openssl/x509_vfy.h .







|






79
80
81
82
83
84
85
86
87
88
89
90
91
92
using
.Xr X509_STORE_CTX_get_error 3 .
.Sh SEE ALSO
.Xr openssl 1 ,
.Xr X509_STORE_CTX_get_error 3
.Sh HISTORY
.Fn X509_verify_cert
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
as opposed to most chain verification functions which use
.In openssl/x509_vfy.h .
Changes to jni/libressl/man/X509v3_get_ext_by_NID.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509v3_get_ext_by_NID.3,v 1.6 2018/03/21 03:16:08 schwarze Exp $
.\"	OpenSSL c952780c Jun 21 07:03:34 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: X509v3_get_ext_by_NID.3,v 1.9 2018/05/19 22:37:10 schwarze Exp $
.\"	OpenSSL c952780c Jun 21 07:03:34 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt X509V3_GET_EXT_BY_NID 3
.Os
.Sh NAME
.Nm X509v3_get_ext_count ,
.Nm X509v3_get_ext ,
.Nm X509v3_get_ext_by_NID ,
.Nm X509v3_get_ext_by_OBJ ,







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 19 2018 $
.Dt X509V3_GET_EXT_BY_NID 3
.Os
.Sh NAME
.Nm X509v3_get_ext_count ,
.Nm X509v3_get_ext ,
.Nm X509v3_get_ext_by_NID ,
.Nm X509v3_get_ext_by_OBJ ,
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
.Fa "const STACK_OF(X509_EXTENSION) *x"
.Fa "int nid"
.Fa "int lastpos"
.Fc
.Ft int
.Fo X509v3_get_ext_by_OBJ
.Fa "const STACK_OF(X509_EXTENSION) *x"
.Fa "ASN1_OBJECT *obj"
.Fa "int lastpos"
.Fc
.Ft int
.Fo X509v3_get_ext_by_critical
.Fa "const STACK_OF(X509_EXTENSION) *x"
.Fa "int crit"
.Fa "int lastpos"







|







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
.Fa "const STACK_OF(X509_EXTENSION) *x"
.Fa "int nid"
.Fa "int lastpos"
.Fc
.Ft int
.Fo X509v3_get_ext_by_OBJ
.Fa "const STACK_OF(X509_EXTENSION) *x"
.Fa "const ASN1_OBJECT *obj"
.Fa "int lastpos"
.Fc
.Ft int
.Fo X509v3_get_ext_by_critical
.Fa "const STACK_OF(X509_EXTENSION) *x"
.Fa "int crit"
.Fa "int lastpos"
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
.Fo X509v3_add_ext
.Fa "STACK_OF(X509_EXTENSION) **x"
.Fa "X509_EXTENSION *ex"
.Fa "int loc"
.Fc
.Ft int
.Fo X509_get_ext_count
.Fa "X509 *x"
.Fc
.Ft X509_EXTENSION *
.Fo X509_get_ext
.Fa "X509 *x"
.Fa "int loc"
.Fc
.Ft int
.Fo X509_get_ext_by_NID
.Fa "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 "int lastpos"
.Fc
.Ft int
.Fo X509_get_ext_by_critical
.Fa "X509 *x"
.Fa "int crit"
.Fa "int lastpos"
.Fc
.Ft X509_EXTENSION *
.Fo X509_delete_ext
.Fa "X509 *x"
.Fa "int loc"







|



|




|





|
|




|







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
.Fo X509v3_add_ext
.Fa "STACK_OF(X509_EXTENSION) **x"
.Fa "X509_EXTENSION *ex"
.Fa "int loc"
.Fc
.Ft int
.Fo X509_get_ext_count
.Fa "const X509 *x"
.Fc
.Ft X509_EXTENSION *
.Fo X509_get_ext
.Fa "const X509 *x"
.Fa "int loc"
.Fc
.Ft int
.Fo X509_get_ext_by_NID
.Fa "const X509 *x"
.Fa "int nid"
.Fa "int lastpos"
.Fc
.Ft int
.Fo X509_get_ext_by_OBJ
.Fa "const X509 *x"
.Fa "const ASN1_OBJECT *obj"
.Fa "int lastpos"
.Fc
.Ft int
.Fo X509_get_ext_by_critical
.Fa "const X509 *x"
.Fa "int crit"
.Fa "int lastpos"
.Fc
.Ft X509_EXTENSION *
.Fo X509_delete_ext
.Fa "X509 *x"
.Fa "int loc"
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
.Fo X509_CRL_add_ext
.Fa "X509_CRL *x"
.Fa "X509_EXTENSION *ex"
.Fa "int loc"
.Fc
.Ft int
.Fo X509_REVOKED_get_ext_count
.Fa "X509_REVOKED *x"
.Fc
.Ft X509_EXTENSION *
.Fo X509_REVOKED_get_ext
.Fa "X509_REVOKED *x"
.Fa "int loc"
.Fc
.Ft int
.Fo X509_REVOKED_get_ext_by_NID
.Fa "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 "int lastpos"
.Fc
.Ft int
.Fo X509_REVOKED_get_ext_by_critical
.Fa "X509_REVOKED *x"
.Fa "int crit"
.Fa "int lastpos"
.Fc
.Ft X509_EXTENSION *
.Fo X509_REVOKED_delete_ext
.Fa "X509_REVOKED *x"
.Fa "int loc"







|



|




|





|
|




|







195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
.Fo X509_CRL_add_ext
.Fa "X509_CRL *x"
.Fa "X509_EXTENSION *ex"
.Fa "int loc"
.Fc
.Ft int
.Fo X509_REVOKED_get_ext_count
.Fa "const X509_REVOKED *x"
.Fc
.Ft X509_EXTENSION *
.Fo X509_REVOKED_get_ext
.Fa "const X509_REVOKED *x"
.Fa "int loc"
.Fc
.Ft int
.Fo X509_REVOKED_get_ext_by_NID
.Fa "const X509_REVOKED *x"
.Fa "int nid"
.Fa "int lastpos"
.Fc
.Ft int
.Fo X509_REVOKED_get_ext_by_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 "const X509_REVOKED *x"
.Fa "int crit"
.Fa "int lastpos"
.Fc
.Ft X509_EXTENSION *
.Fo X509_REVOKED_delete_ext
.Fa "X509_REVOKED *x"
.Fa "int loc"
384
385
386
387
388
389
390

391
392
.Dv NULL
on error.
.Sh SEE ALSO
.Xr X509_EXTENSION_new 3 ,
.Xr X509_REVOKED_new 3 ,
.Xr X509V3_get_d2i 3
.Sh HISTORY

These functions appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







>
|

384
385
386
387
388
389
390
391
392
393
.Dv NULL
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 .
Changes to jni/libressl/man/d2i_ASN1_OBJECT.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.\"	$OpenBSD: d2i_ASN1_OBJECT.3,v 1.7 2018/03/20 18:35:13 schwarze Exp $
.\"	OpenSSL 05ea606a May 20 20:52:46 2016 -0400
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 20 2018 $
.Dt D2I_ASN1_OBJECT 3
.Os
.Sh NAME
.Nm d2i_ASN1_OBJECT ,
.Nm i2d_ASN1_OBJECT
.Nd decode and encode ASN.1 object identifiers
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft ASN1_OBJECT *
.Fo d2i_ASN1_OBJECT
.Fa "ASN1_OBJECT **val_out"
.Fa "unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_ASN1_OBJECT
.Fa "ASN1_OBJECT *val_in"
.Fa "unsigned char **der_out"
.Fc
.Sh DESCRIPTION
These functions decode and encode ASN.1 object identifiers.
For details about the semantics, examples, caveats, and bugs, see
.Xr ASN1_item_d2i 3 .
.Pp
|
















|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.\"	$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 <schwarze@openbsd.org>
.\"
.\" 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 25 2018 $
.Dt D2I_ASN1_OBJECT 3
.Os
.Sh NAME
.Nm d2i_ASN1_OBJECT ,
.Nm i2d_ASN1_OBJECT
.Nd decode and encode ASN.1 object identifiers
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft ASN1_OBJECT *
.Fo d2i_ASN1_OBJECT
.Fa "ASN1_OBJECT **val_out"
.Fa "unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_ASN1_OBJECT
.Fa "const ASN1_OBJECT *val_in"
.Fa "unsigned char **der_out"
.Fc
.Sh DESCRIPTION
These functions decode and encode ASN.1 object identifiers.
For details about the semantics, examples, caveats, and bugs, see
.Xr ASN1_item_d2i 3 .
.Pp
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.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
appeared in SSLeay 0.8.1b or earlier 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
object identifier matches one that is built into the library.
To find the names of an object identifier parsed from DER or BER
input, call







|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.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
object identifier matches one that is built into the library.
To find the names of an object identifier parsed from DER or BER
input, call
Changes to jni/libressl/man/d2i_ASN1_OCTET_STRING.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: d2i_ASN1_OCTET_STRING.3,v 1.11 2018/03/23 23:18:17 schwarze Exp $
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 D2I_ASN1_OCTET_STRING 3
.Os
.Sh NAME
.Nm d2i_ASN1_OCTET_STRING ,
.Nm i2d_ASN1_OCTET_STRING ,
.Nm d2i_ASN1_BIT_STRING ,
.Nm i2d_ASN1_BIT_STRING ,
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: d2i_ASN1_OCTET_STRING.3,v 1.12 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt D2I_ASN1_OCTET_STRING 3
.Os
.Sh NAME
.Nm d2i_ASN1_OCTET_STRING ,
.Nm i2d_ASN1_OCTET_STRING ,
.Nm d2i_ASN1_BIT_STRING ,
.Nm i2d_ASN1_BIT_STRING ,
390
391
392
393
394
395
396

397

398
399
400
401
402
403
404
405
406
407
408
409
410
.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 d2i_ASN1_PRINTABLESTRING ,

.Fn d2i_ASN1_PRINTABLE ,
.Fn i2d_ASN1_PRINTABLE ,
.Fn d2i_ASN1_UTCTIME ,
and
.Fn i2d_ASN1_UTCTIME
appeared in SSLeay 0.8.1b or earlier 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 ,







>

>





|







390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
.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 ,
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
.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 i2d_ASN1_PRINTABLESTRING
first appeared in OpenSSL 0.9.5 and has been available since
.Ox 2.7 .
.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 .







<
<
<
<







427
428
429
430
431
432
433




434
435
436
437
438
439
440
.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 .
Changes to jni/libressl/man/d2i_DHparams.3.
1
2
3
4
5
6
7
8
.\" $OpenBSD: d2i_DHparams.3,v 1.7 2018/03/20 22:22:10 schwarze Exp $
.\" full merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org> and
.\" Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2002, 2015, 2017 The OpenSSL Project.
.\" All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\" $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 <ulf@openssl.org> and
.\" Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2002, 2015, 2017 The OpenSSL Project.
.\" All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 20 2018 $
.Dt D2I_DHPARAMS 3
.Os
.Sh NAME
.Nm d2i_DHparams ,
.Nm i2d_DHparams
.Nd PKCS#3 DH parameter functions
.Sh SYNOPSIS







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 D2I_DHPARAMS 3
.Os
.Sh NAME
.Nm d2i_DHparams ,
.Nm i2d_DHparams
.Nd PKCS#3 DH parameter functions
.Sh SYNOPSIS
91
92
93
94
95
96
97
98
99
.Sh SEE ALSO
.Xr d2i_X509 3 ,
.Xr DH_new 3
.Sh HISTORY
.Fn d2i_DHparams
and
.Fn i2d_DHparams
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .







|

91
92
93
94
95
96
97
98
99
.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 .
Changes to jni/libressl/man/d2i_DSAPublicKey.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: d2i_DSAPublicKey.3,v 1.12 2018/03/22 16:06:33 schwarze Exp $
.\"	OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2002, 2003, 2013, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
.\"	$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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2003, 2013, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71




72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

89
90
91
92
93
94
95
.\" 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 22 2018 $
.Dt D2I_DSAPUBLICKEY 3
.Os
.Sh NAME
.Nm d2i_DSAPublicKey ,
.Nm i2d_DSAPublicKey ,
.Nm d2i_DSA_PUBKEY ,
.Nm i2d_DSA_PUBKEY ,
.Nm d2i_DSA_PUBKEY_bio ,
.Nm d2i_DSA_PUBKEY_fp ,
.Nm i2d_DSA_PUBKEY_bio ,
.Nm i2d_DSA_PUBKEY_fp ,
.Nm d2i_DSAPrivateKey ,
.Nm i2d_DSAPrivateKey ,
.Nm d2i_DSAPrivateKey_bio ,
.Nm d2i_DSAPrivateKey_fp ,
.Nm i2d_DSAPrivateKey_bio ,
.Nm i2d_DSAPrivateKey_fp ,
.Nm d2i_DSAparams ,
.Nm i2d_DSAparams ,




.Nm DSAparams_dup ,
.Nm d2i_DSA_SIG ,
.Nm i2d_DSA_SIG
.Nd decode and encode DSA keys
.Sh SYNOPSIS
.In openssl/dsa.h
.Ft DSA *
.Fo d2i_DSAPublicKey
.Fa "DSA **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_DSAPublicKey
.Fa "const DSA *val_in"
.Fa "unsigned char **der_out"
.Fc

.Ft DSA *
.Fo d2i_DSA_PUBKEY
.Fa "DSA **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int







|



















>
>
>
>

















>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.\" 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: August 26 2018 $
.Dt D2I_DSAPUBLICKEY 3
.Os
.Sh NAME
.Nm d2i_DSAPublicKey ,
.Nm i2d_DSAPublicKey ,
.Nm d2i_DSA_PUBKEY ,
.Nm i2d_DSA_PUBKEY ,
.Nm d2i_DSA_PUBKEY_bio ,
.Nm d2i_DSA_PUBKEY_fp ,
.Nm i2d_DSA_PUBKEY_bio ,
.Nm i2d_DSA_PUBKEY_fp ,
.Nm d2i_DSAPrivateKey ,
.Nm i2d_DSAPrivateKey ,
.Nm d2i_DSAPrivateKey_bio ,
.Nm d2i_DSAPrivateKey_fp ,
.Nm i2d_DSAPrivateKey_bio ,
.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
.Nd decode and encode DSA keys
.Sh SYNOPSIS
.In openssl/dsa.h
.Ft DSA *
.Fo d2i_DSAPublicKey
.Fa "DSA **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_DSAPublicKey
.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"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
113
114
115
116
117
118
119

120
121
122
123
124
125
126
127
128
129
130

131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
159
160
161




















162
163
164
165
166
167
168
.Fa "DSA *val_in"
.Fc
.Ft int
.Fo i2d_DSA_PUBKEY_fp
.Fa "FILE *out_fp"
.Fa "DSA *val_in"
.Fc

.Ft DSA *
.Fo d2i_DSAPrivateKey
.Fa "DSA **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_DSAPrivateKey
.Fa "const DSA *val_in"
.Fa "unsigned char **der_out"
.Fc

.Ft DSA *
.Fo d2i_DSAPrivateKey_bio
.Fa "BIO *in_bio"
.Fa "DSA **val_out"
.Fc
.Ft DSA *
.Fo d2i_DSAPrivateKey_fp
.Fa "FILE *in_fp"
.Fa "DSA **val_out"
.Fc
.Ft int
.Fo i2d_DSAPrivateKey_bio
.Fa "BIO *out_bio"
.Fa "DSA *val_in"
.Fc
.Ft int
.Fo i2d_DSAPrivateKey_fp
.Fa "FILE *out_fp"
.Fa "DSA *val_in"
.Fc

.Ft DSA *
.Fo d2i_DSAparams
.Fa "DSA **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_DSAparams
.Fa "const DSA *val_in"
.Fa "unsigned char **der_out"
.Fc




















.Ft DSA *
.Fo DSAparams_dup
.Fa "DSA *val_in"
.Fc
.Ft DSA_SIG *
.Fo d2i_DSA_SIG
.Fa "DSA_SIG **val_out"







>











>




















>











>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
.Fa "DSA *val_in"
.Fc
.Ft int
.Fo i2d_DSA_PUBKEY_fp
.Fa "FILE *out_fp"
.Fa "DSA *val_in"
.Fc
.In openssl/dsa.h
.Ft DSA *
.Fo d2i_DSAPrivateKey
.Fa "DSA **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_DSAPrivateKey
.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"
.Fa "DSA **val_out"
.Fc
.Ft DSA *
.Fo d2i_DSAPrivateKey_fp
.Fa "FILE *in_fp"
.Fa "DSA **val_out"
.Fc
.Ft int
.Fo i2d_DSAPrivateKey_bio
.Fa "BIO *out_bio"
.Fa "DSA *val_in"
.Fc
.Ft int
.Fo i2d_DSAPrivateKey_fp
.Fa "FILE *out_fp"
.Fa "DSA *val_in"
.Fc
.In openssl/dsa.h
.Ft DSA *
.Fo d2i_DSAparams
.Fa "DSA **val_out"
.Fa "const unsigned char **der_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2d_DSAparams
.Fa "const DSA *val_in"
.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
.Ft DSA_SIG *
.Fo d2i_DSA_SIG
.Fa "DSA_SIG **val_out"
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269









270
271
272
273
274
275
276
.Fa val_in->priv_key
fields.
This data format is unencrypted.
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 ,
and
.Fn i2d_DSAPrivateKey_fp
are similar except that they decode or encode using a
.Vt BIO
or
.Vt FILE
pointer.
.Pp
.Fn d2i_DSAparams
and
.Fn i2d_DSAparams
decode and encode the DSA parameters using an ASN.1
.Vt Dss-Parms
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.









.Pp
.Fn DSAparams_dup
allocates and initializes an empty
.Vt DSA
object and copies the DSA parameters from
.Fa val_in
to it by calling







<




















>
>
>
>
>
>
>
>
>







270
271
272
273
274
275
276

277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
.Fa val_in->priv_key
fields.
This data format is unencrypted.
For private key security when writing private keys to files,
consider using
.Xr PEM_write_DSAPrivateKey 3
instead.

.Fn d2i_DSAPrivateKey_bio ,
.Fn d2i_DSAPrivateKey_fp ,
.Fn i2d_DSAPrivateKey_bio ,
and
.Fn i2d_DSAPrivateKey_fp
are similar except that they decode or encode using a
.Vt BIO
or
.Vt FILE
pointer.
.Pp
.Fn d2i_DSAparams
and
.Fn i2d_DSAparams
decode and encode the DSA parameters using an ASN.1
.Vt Dss-Parms
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
.Vt DSA
object and copies the DSA parameters from
.Fa val_in
to it by calling
295
296
297
298
299
300
301


302
303
304
305
306
307
308
.Fn d2i_DSA_PUBKEY ,
.Fn d2i_DSA_PUBKEY_bio ,
.Fn d2i_DSA_PUBKEY_fp ,
.Fn d2i_DSAPrivateKey ,
.Fn d2i_DSAPrivateKey_bio ,
.Fn d2i_DSAPrivateKey_fp ,
.Fn d2i_DSAparams ,


and
.Fn DSAparams_dup
return a valid
.Vt DSA
object or
.Dv NULL
if an error occurs.







>
>







331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
.Fn d2i_DSA_PUBKEY ,
.Fn d2i_DSA_PUBKEY_bio ,
.Fn d2i_DSA_PUBKEY_fp ,
.Fn d2i_DSAPrivateKey ,
.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
.Vt DSA
object or
.Dv NULL
if an error occurs.
334
335
336
337
338
339
340

341

342
343
344
345
346
347




348
349

350
351
352
353
354
355
356
357
.It
section 2.3.2: DSA Signature Keys
.El
.Sh HISTORY
.Fn d2i_DSAPublicKey ,
.Fn i2d_DSAPublicKey ,
.Fn d2i_DSAPrivateKey ,

.Fn i2d_DSAPrivateKey ,

.Fn d2i_DSAPrivateKey_bio ,
.Fn d2i_DSAPrivateKey_fp ,
.Fn i2d_DSAPrivateKey_bio ,
.Fn i2d_DSAPrivateKey_fp ,
.Fn d2i_DSAparams ,
.Fn i2d_DSAparams ,




and
.Fn DSAparams_dup

appeared before SSLeay 0.8 and 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 .







>
|
>






>
>
>
>


>
|







372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
.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 .
Changes to jni/libressl/man/d2i_ECPKParameters.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: d2i_ECPKParameters.3,v 1.11 2018/03/23 00:09:11 schwarze Exp $
.\"	OpenSSL 05ea606a May 20 20:52:46 2016 -0400
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 D2I_ECPKPARAMETERS 3
.Os
.Sh NAME
.Nm d2i_ECPKParameters ,
.Nm i2d_ECPKParameters ,
.Nm d2i_ECPKParameters_bio ,
.Nm i2d_ECPKParameters_bio ,







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 19 2018 $
.Dt D2I_ECPKPARAMETERS 3
.Os
.Sh NAME
.Nm d2i_ECPKParameters ,
.Nm i2d_ECPKParameters ,
.Nm d2i_ECPKParameters_bio ,
.Nm i2d_ECPKParameters_bio ,
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
.Fo o2i_ECPublicKey
.Fa "EC_KEY **val_out"
.Fa "const unsigned char **des_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2o_ECPublicKey
.Fa "EC_KEY *val_in"
.Fa "unsigned char **des_out"
.Fc
.Ft int
.Fo ECPKParameters_print
.Fa "BIO *out_bio"
.Fa "const EC_GROUP *val_in"
.Fa "int indent"







|







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
.Fo o2i_ECPublicKey
.Fa "EC_KEY **val_out"
.Fa "const unsigned char **des_in"
.Fa "long length"
.Fc
.Ft int
.Fo i2o_ECPublicKey
.Fa "const EC_KEY *val_in"
.Fa "unsigned char **des_out"
.Fc
.Ft int
.Fo ECPKParameters_print
.Fa "BIO *out_bio"
.Fa "const EC_GROUP *val_in"
.Fa "int indent"
Changes to jni/libressl/man/d2i_PKCS7.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: d2i_PKCS7.3,v 1.5 2018/03/21 00:54:31 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 D2I_PKCS7 3
.Os
.Sh NAME
.Nm d2i_PKCS7 ,
.Nm i2d_PKCS7 ,
.Nm d2i_PKCS7_bio ,
.Nm i2d_PKCS7_bio ,
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: d2i_PKCS7.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt D2I_PKCS7 3
.Os
.Sh NAME
.Nm d2i_PKCS7 ,
.Nm i2d_PKCS7 ,
.Nm d2i_PKCS7_bio ,
.Nm i2d_PKCS7_bio ,
346
347
348
349
350
351
352
353
354
.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
appeared in SSLeay 0.8.1b or earlier and have been available since
.Ox 2.4 .







|

346
347
348
349
350
351
352
353
354
.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 .
Changes to jni/libressl/man/d2i_PrivateKey.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: d2i_PrivateKey.3,v 1.7 2018/03/22 16:06:33 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 22 2018 $
.Dt D2I_PRIVATEKEY 3
.Os
.Sh NAME
.Nm d2i_PrivateKey ,
.Nm d2i_AutoPrivateKey ,
.Nm i2d_PrivateKey ,
.Nm d2i_PrivateKey_bio ,







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" 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 D2I_PRIVATEKEY 3
.Os
.Sh NAME
.Nm d2i_PrivateKey ,
.Nm d2i_AutoPrivateKey ,
.Nm i2d_PrivateKey ,
.Nm d2i_PrivateKey_bio ,
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
Information Syntax Specification
.Sh HISTORY
.Fn d2i_PrivateKey ,
.Fn i2d_PrivateKey ,
.Fn d2i_PublicKey ,
and
.Fn i2d_PublicKey
appeared in SSLeay 0.8.1b or earlier 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 .







|












267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
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 .
Changes to jni/libressl/man/d2i_RSAPublicKey.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: d2i_RSAPublicKey.3,v 1.12 2018/03/23 05:48:56 schwarze Exp $
.\"	OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.\" 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 D2I_RSAPUBLICKEY 3
.Os
.Sh NAME
.Nm d2i_RSAPublicKey ,
.Nm i2d_RSAPublicKey ,
.Nm d2i_RSAPrivateKey ,
.Nm i2d_RSAPrivateKey ,







|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.\" 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 D2I_RSAPUBLICKEY 3
.Os
.Sh NAME
.Nm d2i_RSAPublicKey ,
.Nm i2d_RSAPublicKey ,
.Nm d2i_RSAPrivateKey ,
.Nm i2d_RSAPrivateKey ,
349
350
351
352
353
354
355


356

357





358
359
360
361
362
363
364
365
366

367
368
369
370
371
372
373
374
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_Netscape_RSA ,

.Fn i2d_Netscape_RSA ,





.Fn d2i_RSAPublicKey_bio ,
.Fn d2i_RSAPublicKey_fp ,
.Fn i2d_RSAPublicKey_bio ,
.Fn i2d_RSAPublicKey_fp ,
.Fn d2i_RSAPrivateKey_bio ,
.Fn d2i_RSAPrivateKey_fp ,
.Fn i2d_RSAPrivateKey_bio ,
and
.Fn i2d_RSAPrivateKey_fp

appeared before SSLeay 0.8 and 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 ,







>
>

>
|
>
>
>
>
>



<
<
<
<

|
>
|







349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368




369
370
371
372
373
374
375
376
377
378
379
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 ,
Changes to jni/libressl/man/d2i_SSL_SESSION.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: d2i_SSL_SESSION.3,v 1.4 2018/03/21 05:07:04 schwarze Exp $
.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005, 2014 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
|







1
2
3
4
5
6
7
8
.\"	$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 <jaenicke@openssl.org>.
.\" Copyright (c) 2001, 2005, 2014 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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 2018 $
.Dt D2I_SSL_SESSION 3
.Os
.Sh NAME
.Nm d2i_SSL_SESSION ,
.Nm i2d_SSL_SESSION
.Nd convert SSL_SESSION object from/to ASN1 representation
.Sh SYNOPSIS







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.\" 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: August 27 2018 $
.Dt D2I_SSL_SESSION 3
.Os
.Sh NAME
.Nm d2i_SSL_SESSION ,
.Nm i2d_SSL_SESSION
.Nd convert SSL_SESSION object from/to ASN1 representation
.Sh SYNOPSIS
127
128
129
130
131
132
133
134
135
136
137
138
139
140

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
.Pp
When using
.Fn i2d_SSL_SESSION ,
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
.Fn i2d_SSL_SESSION
with
.Fa pp Ns
= Ns
.Dv NULL ,
and obtain the size needed, then allocate the memory and call

.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;

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);
 }
.Ed
.Sh RETURN VALUES
.Fn d2i_SSL_SESSION
returns a pointer to the newly allocated
.Vt SSL_SESSION
object.
In case of failure a







|

|
|
<
<
|
>






|
|
|
<

|
|
|
|
|
|
|







127
128
129
130
131
132
133
134
135
136
137


138
139
140
141
142
143
144
145
146
147
148

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.Pp
When using
.Fn i2d_SSL_SESSION ,
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 call
.Fn i2d_SSL_SESSION
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 -offset indent
char	*p, *pp;
int	 elen, len;


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
returns a pointer to the newly allocated
.Vt SSL_SESSION
object.
In case of failure a
175
176
177
178
179
180
181
182
183
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

173
174
175
176
177
178
179
180
181
.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 .
Changes to jni/libressl/man/d2i_X509.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: d2i_X509.3,v 1.8 2018/03/22 16:06:33 schwarze Exp $
.\"	OpenSSL 94480b57 Sep 12 23:34:41 2009 +0000
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
|







1
2
3
4
5
6
7
8
.\"	$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.
.\" The changes are covered by the following Copyright and license:
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.\" 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 22 2018 $
.Dt D2I_X509 3
.Os
.Sh NAME
.Nm d2i_X509 ,
.Nm i2d_X509 ,
.Nm d2i_X509_bio ,
.Nm d2i_X509_fp ,







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.\" 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 D2I_X509 3
.Os
.Sh NAME
.Nm d2i_X509 ,
.Nm i2d_X509 ,
.Nm d2i_X509_bio ,
.Nm d2i_X509_fp ,
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283





284
285
286
287
288
289
290
291
292
293
.Xr X509_new 3
.Sh STANDARDS
RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
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_VAL





appeared before SSLeay 0.8 and 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 .







<

<






>
>
>
>
>
|









268
269
270
271
272
273
274

275

276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
.Xr X509_new 3
.Sh STANDARDS
RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
Certificate Revocation List (CRL) Profile
.Sh HISTORY
.Fn d2i_X509 ,
.Fn i2d_X509 ,

.Fn d2i_X509_fp ,

.Fn i2d_X509_fp ,
.Fn d2i_X509_CINF ,
.Fn i2d_X509_CINF ,
.Fn d2i_X509_VAL ,
and
.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 .
Changes to jni/libressl/man/d2i_X509_ALGOR.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\"	$OpenBSD: d2i_X509_ALGOR.3,v 1.8 2018/03/21 03:16:08 schwarze Exp $
.\"	OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 D2I_X509_ALGOR 3
.Os
.Sh NAME
.Nm d2i_X509_ALGOR ,
.Nm i2d_X509_ALGOR
.Nd decode and encode algorithm identifiers
.Sh SYNOPSIS
|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\"	$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 <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt D2I_X509_ALGOR 3
.Os
.Sh NAME
.Nm d2i_X509_ALGOR ,
.Nm i2d_X509_ALGOR
.Nd decode and encode algorithm identifiers
.Sh SYNOPSIS
50
51
52
53
54
55
56
57
58
.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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

50
51
52
53
54
55
56
57
58
.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 .
Changes to jni/libressl/man/d2i_X509_ATTRIBUTE.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: d2i_X509_ATTRIBUTE.3,v 1.2 2018/03/21 03:16:08 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 D2I_X509_ATTRIBUTE 3
.Os
.Sh NAME
.Nm d2i_X509_ATTRIBUTE ,
.Nm i2d_X509_ATTRIBUTE
.\" In the following line, "X.501" and "Attribute" are not typos.
.\" The "Attribute" type is defined in X.501, not in X.509.
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: d2i_X509_ATTRIBUTE.3,v 1.3 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt D2I_X509_ATTRIBUTE 3
.Os
.Sh NAME
.Nm d2i_X509_ATTRIBUTE ,
.Nm i2d_X509_ATTRIBUTE
.\" In the following line, "X.501" and "Attribute" are not typos.
.\" The "Attribute" type is defined in X.501, not in X.509.
68
69
70
71
72
73
74
75
76
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
appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







|

68
69
70
71
72
73
74
75
76
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 .
Changes to jni/libressl/man/d2i_X509_CRL.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\"	$OpenBSD: d2i_X509_CRL.3,v 1.6 2018/03/21 03:16:08 schwarze Exp $
.\"	OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 D2I_X509_CRL 3
.Os
.Sh NAME
.Nm d2i_X509_CRL ,
.Nm i2d_X509_CRL ,
.Nm d2i_X509_CRL_bio ,
.Nm d2i_X509_CRL_fp ,
|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\"	$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 <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt D2I_X509_CRL 3
.Os
.Sh NAME
.Nm d2i_X509_CRL ,
.Nm i2d_X509_CRL ,
.Nm d2i_X509_CRL_bio ,
.Nm d2i_X509_CRL_fp ,
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143





144
145
.Sh STANDARDS
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_bio ,
.Fn d2i_X509_CRL_fp ,
.Fn i2d_X509_CRL_bio ,
.Fn i2d_X509_CRL_fp ,
.Fn d2i_X509_CRL_INFO ,
.Fn i2d_X509_CRL_INFO ,
.Fn d2i_X509_REVOKED ,
and
.Fn i2d_X509_REVOKED





appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







<

<






>
>
>
>
>
|

128
129
130
131
132
133
134

135

136
137
138
139
140
141
142
143
144
145
146
147
148
.Sh STANDARDS
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 .
Changes to jni/libressl/man/d2i_X509_EXTENSION.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: d2i_X509_EXTENSION.3,v 1.3 2018/03/23 01:05:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 D2I_X509_EXTENSION 3
.Os
.Sh NAME
.Nm d2i_X509_EXTENSION ,
.Nm i2d_X509_EXTENSION ,
.Nm d2i_X509_EXTENSIONS ,
.Nm i2d_X509_EXTENSIONS
|















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.\"	$OpenBSD: d2i_X509_EXTENSION.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt D2I_X509_EXTENSION 3
.Os
.Sh NAME
.Nm d2i_X509_EXTENSION ,
.Nm i2d_X509_EXTENSION ,
.Nm d2i_X509_EXTENSIONS ,
.Nm i2d_X509_EXTENSIONS
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
.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
appeared before SSLeay 0.8 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 .







|







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
.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 .
Changes to jni/libressl/man/d2i_X509_NAME.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.\" $OpenBSD: d2i_X509_NAME.3,v 1.13 2018/03/23 23:18:17 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, 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 D2I_X509_NAME 3
.Os
.Sh NAME
.Nm d2i_X509_NAME ,
.Nm i2d_X509_NAME ,
.Nm X509_NAME_get0_der ,
.Nm X509_NAME_dup ,
|


















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.\" $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, 2018 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 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 ,
171
172
173
174
175
176
177


178
179
180
181
182
183
184
185



186
187
188
189
190
191
Certificate Revocation List (CRL) Profile
.Pp
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 d2i_X509_NAME ,
.Fn i2d_X509_NAME ,
.Fn X509_NAME_dup ,
.Fn X509_NAME_hash ,
.Fn d2i_X509_NAME_ENTRY ,
.Fn i2d_X509_NAME_ENTRY ,
and
.Fn X509_NAME_ENTRY_dup



appeared before SSLeay 0.8 and 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 .







>
>


<
<




>
>
>
|





171
172
173
174
175
176
177
178
179
180
181


182
183
184
185
186
187
188
189
190
191
192
193
194
Certificate Revocation List (CRL) Profile
.Pp
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 .
Changes to jni/libressl/man/d2i_X509_REQ.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\"	$OpenBSD: d2i_X509_REQ.3,v 1.6 2018/03/21 03:16:08 schwarze Exp $
.\"	OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 D2I_X509_REQ 3
.Os
.Sh NAME
.Nm d2i_X509_REQ ,
.Nm i2d_X509_REQ ,
.Nm d2i_X509_REQ_bio ,
.Nm d2i_X509_REQ_fp ,
|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\"	$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 <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt D2I_X509_REQ 3
.Os
.Sh NAME
.Nm d2i_X509_REQ ,
.Nm i2d_X509_REQ ,
.Nm d2i_X509_REQ_bio ,
.Nm d2i_X509_REQ_fp ,
133
134
135
136
137
138
139
140
141
142
143
144
145
146





147
148
.Xr PEM_read_X509_REQ 3 ,
.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_bio ,
.Fn d2i_X509_REQ_fp ,
.Fn i2d_X509_REQ_bio ,
.Fn i2d_X509_REQ_fp ,
.Fn d2i_X509_REQ_INFO ,
and
.Fn i2d_X509_REQ_INFO





appeared before SSLeay 0.8 and have been available since
.Ox 2.4 .







<

<




>
>
>
>
>
|

133
134
135
136
137
138
139

140

141
142
143
144
145
146
147
148
149
150
151
.Xr PEM_read_X509_REQ 3 ,
.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 .
Changes to jni/libressl/man/d2i_X509_SIG.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\"	$OpenBSD: d2i_X509_SIG.3,v 1.8 2018/03/21 21:18:08 schwarze Exp $
.\"	OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 D2I_X509_SIG 3
.Os
.Sh NAME
.Nm d2i_X509_SIG ,
.Nm i2d_X509_SIG ,
.Nm d2i_PKCS8_bio ,
.Nm i2d_PKCS8_bio ,
|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\"	$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 <schwarze@openbsd.org>
.\"
.\" 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 27 2018 $
.Dt D2I_X509_SIG 3
.Os
.Sh NAME
.Nm d2i_X509_SIG ,
.Nm i2d_X509_SIG ,
.Nm d2i_PKCS8_bio ,
.Nm i2d_PKCS8_bio ,
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
.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
appeared before SSLeay 0.8 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







|







123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
.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
Changes to jni/libressl/man/des_read_pw.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: des_read_pw.3,v 1.7 2018/03/20 22:06:59 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
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org> and
.\" Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000, 2001 The OpenSSL Project.  All rights reserved.
.\"
|







1
2
3
4
5
6
7
8
.\"	$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
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org> and
.\" Richard Levitte <levitte@openssl.org>.
.\" Copyright (c) 2000, 2001 The OpenSSL Project.  All rights reserved.
.\"
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 20 2018 $
.Dt DES_READ_PW 3
.Os
.Sh NAME
.Nm des_read_pw ,
.Nm des_read_pw_string ,
.Nm EVP_read_pw_string
.Nd compatibility user interface functions







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" 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 DES_READ_PW 3
.Os
.Sh NAME
.Nm des_read_pw ,
.Nm des_read_pw_string ,
.Nm EVP_read_pw_string
.Nd compatibility user interface functions
127
128
129
130
131
132
133





134
135
136
137
138
139
.Pp
.Fn EVP_read_pw_string
is functionally similar to
.Fn des_read_pw_string .
.Sh SEE ALSO
.Xr UI_new 3
.Sh HISTORY





These functions appeared in SSLeay 0.8.1b or earlier
and have been available since
.Ox 2.4 .
.Sh AUTHORS
.An Richard Levitte Aq Mt richard@levitte.org
for the OpenSSL project.







>
>
>
>
>
|
|




127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.Pp
.Fn EVP_read_pw_string
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.
Deleted jni/libressl/man/engine.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
.\" $OpenBSD: engine.3,v 1.13 2018/03/22 21:08:22 schwarze Exp $
.\" full merge up to: OpenSSL crypto/engine e6390aca Jul 21 10:06:03 2015 -0400
.\" selective merge up to: man3/ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800
.\"
.\" This file was written by Geoff Thorpe <geoff@openssl.org>
.\" with contributions from Paul Yang <yang.yang@baishancloud.com>.
.\" Copyright (c) 2002, 2004, 2007, 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
.\" 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 22 2018 $
.Dt ENGINE 3
.Os
.Sh NAME
.Nm ENGINE_get_first ,
.Nm ENGINE_get_last ,
.Nm ENGINE_get_next ,
.Nm ENGINE_get_prev ,
.Nm ENGINE_add ,
.Nm ENGINE_remove ,
.Nm ENGINE_by_id ,
.Nm ENGINE_init ,
.Nm ENGINE_finish ,
.Nm ENGINE_load_openssl ,
.Nm ENGINE_load_dynamic ,
.Nm ENGINE_load_cryptodev ,
.Nm ENGINE_load_builtin_engines ,
.Nm ENGINE_cleanup ,
.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_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 ,
.Nm ENGINE_set_default_string ,
.Nm ENGINE_set_default ,
.Nm ENGINE_get_table_flags ,
.Nm ENGINE_set_table_flags ,
.Nm ENGINE_register_RSA ,
.Nm ENGINE_unregister_RSA ,
.Nm ENGINE_register_all_RSA ,
.Nm ENGINE_register_DSA ,
.Nm ENGINE_unregister_DSA ,
.Nm ENGINE_register_all_DSA ,
.Nm ENGINE_register_ECDH ,
.Nm ENGINE_unregister_ECDH ,
.Nm ENGINE_register_all_ECDH ,
.Nm ENGINE_register_ECDSA ,
.Nm ENGINE_unregister_ECDSA ,
.Nm ENGINE_register_all_ECDSA ,
.Nm ENGINE_register_DH ,
.Nm ENGINE_unregister_DH ,
.Nm ENGINE_register_all_DH ,
.Nm ENGINE_register_RAND ,
.Nm ENGINE_unregister_RAND ,
.Nm ENGINE_register_all_RAND ,
.Nm ENGINE_register_STORE ,
.Nm ENGINE_unregister_STORE ,
.Nm ENGINE_register_all_STORE ,
.Nm ENGINE_register_ciphers ,
.Nm ENGINE_unregister_ciphers ,
.Nm ENGINE_register_all_ciphers ,
.Nm ENGINE_register_digests ,
.Nm ENGINE_unregister_digests ,
.Nm ENGINE_register_all_digests ,
.Nm ENGINE_register_complete ,
.Nm ENGINE_register_all_complete ,
.Nm ENGINE_ctrl ,
.Nm ENGINE_cmd_is_executable ,
.Nm ENGINE_ctrl_cmd ,
.Nm ENGINE_ctrl_cmd_string ,
.Nm ENGINE_new ,
.Nm ENGINE_free ,
.Nm ENGINE_up_ref ,
.Nm ENGINE_set_id ,
.Nm ENGINE_set_name ,
.Nm ENGINE_set_RSA ,
.Nm ENGINE_set_DSA ,
.Nm ENGINE_set_ECDH ,
.Nm ENGINE_set_ECDSA ,
.Nm ENGINE_set_DH ,
.Nm ENGINE_set_RAND ,
.Nm ENGINE_set_STORE ,
.Nm ENGINE_set_destroy_function ,
.Nm ENGINE_set_init_function ,
.Nm ENGINE_set_finish_function ,
.Nm ENGINE_set_ctrl_function ,
.Nm ENGINE_set_load_privkey_function ,
.Nm ENGINE_set_load_pubkey_function ,
.Nm ENGINE_set_ciphers ,
.Nm ENGINE_set_digests ,
.Nm ENGINE_set_flags ,
.Nm ENGINE_set_cmd_defns ,
.Nm ENGINE_get_id ,
.Nm ENGINE_get_name ,
.Nm ENGINE_get_RSA ,
.Nm ENGINE_get_DSA ,
.Nm ENGINE_get_ECDH ,
.Nm ENGINE_get_ECDSA ,
.Nm ENGINE_get_DH ,
.Nm ENGINE_get_RAND ,
.Nm ENGINE_get_STORE ,
.Nm ENGINE_get_destroy_function ,
.Nm ENGINE_get_init_function ,
.Nm ENGINE_get_finish_function ,
.Nm ENGINE_get_ctrl_function ,
.Nm ENGINE_get_load_privkey_function ,
.Nm ENGINE_get_load_pubkey_function ,
.Nm ENGINE_get_ciphers ,
.Nm ENGINE_get_digests ,
.Nm ENGINE_get_cipher ,
.Nm ENGINE_get_digest ,
.Nm ENGINE_get_flags ,
.Nm ENGINE_get_cmd_defns ,
.Nm ENGINE_load_private_key ,
.Nm ENGINE_load_public_key
.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 RETURN VALUES
.Fn ENGINE_get_first ,
.Fn ENGINE_get_last ,
.Fn ENGINE_get_next ,
.Fn ENGINE_get_prev ,
.Fn ENGINE_by_id ,
.Fn ENGINE_get_cipher_engine ,
.Fn ENGINE_get_digest_engine ,
.Fn ENGINE_new ,
and all
.Fn ENGINE_get_default_*
functions return a valid
.Vt ENGINE
structure or
.Dv NULL
if an error occurred.
.Pp
.Fn ENGINE_add ,
.Fn ENGINE_remove ,
.Fn ENGINE_init ,
.Fn ENGINE_finish ,
.Fn ENGINE_ctrl_cmd ,
.Fn ENGINE_ctrl_cmd_string ,
.Fn ENGINE_free ,
.Fn ENGINE_up_ref ,
and all
.Fn ENGINE_set_*
and
.Fn ENGINE_register_*
functions return 1 on success or 0 on error.
.Pp
.Fn ENGINE_get_table_flags
returns an unsigned integer value representing the global table
flags which are used to control the registration behaviour of
.Vt ENGINE
implementations.
.Pp
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
.Fn ENGINE_cmd_is_executable
returns 1 if
.Fa cmd
is executable or 0 otherwise.
.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_RSA ,
.Fn ENGINE_get_DSA ,
.Fn ENGINE_get_DH ,
.Fn ENGINE_get_RAND ,
and
.Fn ENGINE_get_STORE
return a method structure for the respective algorithm.
.Pp
.Fn ENGINE_get_destroy_function ,
.Fn ENGINE_get_init_function ,
.Fn ENGINE_get_finish_function ,
.Fn ENGINE_get_ctrl_function ,
.Fn ENGINE_get_load_privkey_function ,
.Fn ENGINE_get_load_pubkey_function ,
.Fn ENGINE_get_ciphers ,
and
.Fn ENGINE_get_digests
return a function pointer to the respective callback.
.Pp
.Fn ENGINE_get_cipher
returns a valid
.Vt EVP_CIPHER
structure on success or
.Dv NULL
if an error occurred.
.Pp
.Fn ENGINE_get_digest
returns a valid
.Vt EVP_MD
structure on success or
.Dv NULL
if an error occurred.
.Pp
.Fn ENGINE_get_flags
returns an integer representing the flags
which are used to control various behaviours of an
.Vt ENGINE .
.Pp
.Fn ENGINE_get_cmd_defns
returns an
.Vt ENGINE_CMD_DEFN
structure or
.Dv NULL
if none is set.
.Pp
.Fn ENGINE_load_private_key
and
.Fn ENGINE_load_public_key
return a valid
.Vt EVP_PKEY
structure on success or
.Dv NULL
if an error occurred.
.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
.Sh HISTORY
The engine API first appeared in OpenSSL 0.9.7
and has been available since
.Ox 3.2 .
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Changes to jni/libressl/man/evp.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: evp.3,v 1.4 2016/12/06 15:15:26 schwarze Exp $
.\"	OpenSSL a9c85cea Nov 11 09:33:55 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>,
.\" Matt Caswell <matt@openssl.org>, Geoff Thorpe <geoff@openssl.org>,
.\" and Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2002, 2006, 2013, 2016 The OpenSSL Project.
.\" All rights reserved.
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: evp.3,v 1.5 2018/04/18 01:12:11 schwarze Exp $
.\"	OpenSSL a9c85cea Nov 11 09:33:55 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>,
.\" Matt Caswell <matt@openssl.org>, Geoff Thorpe <geoff@openssl.org>,
.\" and Dr. Stephen Henson <steve@openssl.org>.
.\" Copyright (c) 2000, 2002, 2006, 2013, 2016 The OpenSSL Project.
.\" All rights reserved.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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 6 2016 $
.Dt EVP 3
.Os
.Sh NAME
.Nm evp
.Nd high level cryptographic functions
.Sh SYNOPSIS
.In openssl/evp.h







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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 18 2018 $
.Dt EVP 3
.Os
.Sh NAME
.Nm evp
.Nd high level cryptographic functions
.Sh SYNOPSIS
.In openssl/evp.h
154
155
156
157
158
159
160
161
162


163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
example, PBKDF2 from PCKS#5).
.Pp
Algorithms are loaded with
.Xr OpenSSL_add_all_algorithms 3 .
.Pp
All the symmetric algorithms (ciphers), digests and asymmetric
algorithms (public key algorithms) can be replaced by
.Xr engine 3
modules providing alternative implementations.


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.
They cannot be used with an
.Vt ENGINE ,
and
.Vt ENGINE
versions of new algorithms cannot be accessed using the low level
functions.
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 EVP_AEAD_CTX_init 3 ,
.Xr EVP_BytesToKey 3 ,
.Xr EVP_DigestInit 3 ,
.Xr EVP_DigestSignInit 3 ,
.Xr EVP_EncryptInit 3 ,
.Xr EVP_OpenInit 3 ,
.Xr EVP_PKEY_decrypt 3 ,







|
|
>
>





<
<
<













|







154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
example, PBKDF2 from PCKS#5).
.Pp
Algorithms are loaded with
.Xr OpenSSL_add_all_algorithms 3 .
.Pp
All the symmetric algorithms (ciphers), digests and asymmetric
algorithms (public key algorithms) can be replaced by
.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.



.Pp
Although low level algorithm specific functions exist for many
algorithms, their use is discouraged.
They cannot be used with an
.Vt ENGINE ,
and
.Vt ENGINE
versions of new algorithms cannot be accessed using the low level
functions.
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_register_RSA 3 ,
.Xr EVP_AEAD_CTX_init 3 ,
.Xr EVP_BytesToKey 3 ,
.Xr EVP_DigestInit 3 ,
.Xr EVP_DigestSignInit 3 ,
.Xr EVP_EncryptInit 3 ,
.Xr EVP_OpenInit 3 ,
.Xr EVP_PKEY_decrypt 3 ,
Changes to jni/libressl/man/lh_new.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: lh_new.3,v 1.3 2016/11/28 14:31:20 schwarze Exp $
.\"	OpenSSL 1bc74519 May 20 08:11:46 2016 -0400
.\"
.\" --------------------------------------------------------------------------
.\" Major patches to this file were contributed by
.\" Ulf Moeller <ulf@openssl.org>, Geoff Thorpe <geoff@openssl.org>,
.\" and Ben Laurie <ben@openssl.org>.
.\" --------------------------------------------------------------------------
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: lh_new.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
.\"	OpenSSL 1bc74519 May 20 08:11:46 2016 -0400
.\"
.\" --------------------------------------------------------------------------
.\" Major patches to this file were contributed by
.\" Ulf Moeller <ulf@openssl.org>, Geoff Thorpe <geoff@openssl.org>,
.\" and Ben Laurie <ben@openssl.org>.
.\" --------------------------------------------------------------------------
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
.\" 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.]
.\"
.Dd $Mdocdate: November 28 2016 $
.Dt LH_NEW 3
.Os
.Sh NAME
.Nm lh_new ,
.Nm lh_free ,
.Nm lh_insert ,
.Nm lh_delete ,







|







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
.\" 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.]
.\"
.Dd $Mdocdate: March 27 2018 $
.Dt LH_NEW 3
.Os
.Sh NAME
.Nm lh_new ,
.Nm lh_free ,
.Nm lh_insert ,
.Nm lh_delete ,
521
522
523
524
525
526
527







528





529
530
531
532
533
534
535
routine would not normally be passed to
.Fn lh_<type>_new ,
rather it would be used in the function passed to
.Fn lh_<type>_new .
.Sh SEE ALSO
.Xr lh_stats 3
.Sh HISTORY







The lhash library is available in all versions of SSLeay and OpenSSL.





.Fn lh_<type>_error
was added in SSLeay 0.9.1b.
.Pp
In OpenSSL 0.9.7, all lhash functions that were passed function pointers
were changed for better type safety, and the function types
.Vt LHASH_COMP_FN_TYPE ,
.Vt LHASH_HASH_FN_TYPE ,







>
>
>
>
>
>
>
|
>
>
>
>
>







521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
routine would not normally be passed to
.Fn lh_<type>_new ,
rather it would be used in the function passed to
.Fn lh_<type>_new .
.Sh SEE ALSO
.Xr lh_stats 3
.Sh HISTORY
.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_<type>_error
was added in SSLeay 0.9.1b.
.Pp
In OpenSSL 0.9.7, all lhash functions that were passed function pointers
were changed for better type safety, and the function types
.Vt LHASH_COMP_FN_TYPE ,
.Vt LHASH_HASH_FN_TYPE ,
Changes to jni/libressl/man/lh_stats.3.
1
2
3
4
5
6
7
8
.\"	$OpenBSD: lh_stats.3,v 1.5 2016/12/06 12:24:33 schwarze Exp $
.\"	OpenSSL e2f92610 May 18 11:44:05 2016 -0400
.\"
.\" --------------------------------------------------------------------------
.\" Major patches to this file were contributed by
.\" Ulf Moeller <ulf@openssl.org>.
.\" --------------------------------------------------------------------------
.\" Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
|







1
2
3
4
5
6
7
8
.\"	$OpenBSD: lh_stats.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $
.\"	OpenSSL e2f92610 May 18 11:44:05 2016 -0400
.\"
.\" --------------------------------------------------------------------------
.\" Major patches to this file were contributed by
.\" Ulf Moeller <ulf@openssl.org>.
.\" --------------------------------------------------------------------------
.\" Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.\" 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.]
.\"
.Dd $Mdocdate: December 6 2016 $
.Dt LH_STATS 3
.Os
.Sh NAME
.Nm lh_stats ,
.Nm lh_node_stats ,
.Nm lh_node_usage_stats ,
.Nm lh_stats_bio ,







|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.\" 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.]
.\"
.Dd $Mdocdate: March 27 2018 $
.Dt LH_STATS 3
.Os
.Sh NAME
.Nm lh_stats ,
.Nm lh_node_stats ,
.Nm lh_node_usage_stats ,
.Nm lh_stats_bio ,
189
190
191
192
193
194
195









196

197
198
.Vt BIO .
.Sh RETURN VALUES
These functions do not return values.
.Sh SEE ALSO
.Xr BIO_new 3 ,
.Xr lh_new 3
.Sh HISTORY









These functions are available in all versions of SSLeay and OpenSSL.

.Sh AUTHORS
.An Eric Young







>
>
>
>
>
>
>
>
>
|
>


189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
.Vt BIO .
.Sh RETURN VALUES
These functions do not return values.
.Sh SEE ALSO
.Xr BIO_new 3 ,
.Xr lh_new 3
.Sh HISTORY
.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
Changes to jni/libressl/man/tls_accept_socket.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.\" $OpenBSD: tls_accept_socket.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $
.\"
.\" Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
.\" Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
.\" Copyright (c) 2016 Brent Cook <bcook@openbsd.org>
.\"
.\" 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: January 28 2017 $
.Dt TLS_ACCEPT_SOCKET 3
.Os
.Sh NAME
.Nm tls_accept_socket ,
.Nm tls_accept_fds ,
.Nm tls_accept_cbs
.Nd accept an incoming client connection in a TLS server
|

















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.\" $OpenBSD: tls_accept_socket.3,v 1.4 2018/05/26 12:35:26 schwarze Exp $
.\"
.\" Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
.\" Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
.\" Copyright (c) 2016 Brent Cook <bcook@openbsd.org>
.\"
.\" 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 26 2018 $
.Dt TLS_ACCEPT_SOCKET 3
.Os
.Sh NAME
.Nm tls_accept_socket ,
.Nm tls_accept_fds ,
.Nm tls_accept_cbs
.Nd accept an incoming client connection in a TLS server
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
The specified
.Fa cb_arg
parameter is passed back to the functions,
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 .
.Sh RETURN VALUES
These functions return 0 on success or -1 on error.
.Sh SEE ALSO
.Xr tls_close 3 ,
.Xr tls_config_set_session_id 3 ,
.Xr tls_configure 3 ,
.Xr tls_connect 3 ,







|







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
The specified
.Fa cb_arg
parameter is passed back to the functions,
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
.Pf * Fa cctx .
.Sh RETURN VALUES
These functions return 0 on success or -1 on error.
.Sh SEE ALSO
.Xr tls_close 3 ,
.Xr tls_config_set_session_id 3 ,
.Xr tls_configure 3 ,
.Xr tls_connect 3 ,
Changes to jni/libressl/man/tls_conn_version.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\" $OpenBSD: tls_conn_version.3,v 1.7 2018/02/10 04:43:16 jsing Exp $
.\"
.\" Copyright (c) 2015 Bob Beck <beck@openbsd.org>
.\" Copyright (c) 2016, 2018 Joel Sing <jsing@openbsd.org>
.\"
.\" 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: February 10 2018 $
.Dt TLS_CONN_VERSION 3
.Os
.Sh NAME
.Nm tls_conn_version ,
.Nm tls_conn_cipher ,
.Nm tls_conn_alpn_selected ,
.Nm tls_conn_servername ,
|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.\" $OpenBSD: tls_conn_version.3,v 1.8 2018/05/26 12:32:59 schwarze Exp $
.\"
.\" Copyright (c) 2015 Bob Beck <beck@openbsd.org>
.\" Copyright (c) 2016, 2018 Joel Sing <jsing@openbsd.org>
.\"
.\" 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 26 2018 $
.Dt TLS_CONN_VERSION 3
.Os
.Sh NAME
.Nm tls_conn_version ,
.Nm tls_conn_cipher ,
.Nm tls_conn_alpn_selected ,
.Nm tls_conn_servername ,
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.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 *
.Fn tls_peer_cert_subject "struct tls *ctx"
.Ft const char *
.Fn tls_peer_cert_hash "struct tls *ctx"







|
|







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.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 *
.Fn tls_peer_cert_subject "struct tls *ctx"
.Ft const char *
.Fn tls_peer_cert_hash "struct tls *ctx"
Changes to jni/libressl/man/tls_connect.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.\" $OpenBSD: tls_connect.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $
.\"
.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
.\" Copyright (c) 2014, 2015 Joel Sing <jsing@openbsd.org>
.\" Copyright (c) 2016 Brent Cook <bcook@openbsd.org>
.\"
.\" 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: January 28 2017 $
.Dt TLS_CONNECT 3
.Os
.Sh NAME
.Nm tls_connect ,
.Nm tls_connect_fds ,
.Nm tls_connect_servername ,
.Nm tls_connect_socket ,
|

















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.\" $OpenBSD: tls_connect.3,v 1.4 2018/07/09 19:51:18 tb Exp $
.\"
.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
.\" Copyright (c) 2014, 2015 Joel Sing <jsing@openbsd.org>
.\" Copyright (c) 2016 Brent Cook <bcook@openbsd.org>
.\"
.\" 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: July 9 2018 $
.Dt TLS_CONNECT 3
.Os
.Sh NAME
.Nm tls_connect ,
.Nm tls_connect_fds ,
.Nm tls_connect_servername ,
.Nm tls_connect_socket ,
80
81
82
83
84
85
86



87
88
89
90
91
92
93
94
95
96
97
98
99
100
.Fa port
may be numeric or a service name.
If it is
.Dv NULL ,
then a
.Fa host
of the format "hostname:port" is permitted.



.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.
.Pp
An already existing socket can be upgraded to a secure connection by calling
.Fn tls_connect_socket .
.Pp
Alternatively, a secure connection can be established over a pair of existing
file descriptors by calling
.Fn tls_connect_fds .







>
>
>




|
<
|







80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

95
96
97
98
99
100
101
102
.Fa port
may be numeric or a service name.
If it is
.Dv NULL ,
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, 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 .
.Pp
Alternatively, a secure connection can be established over a pair of existing
file descriptors by calling
.Fn tls_connect_fds .
Changes to jni/libressl/man/tls_init.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.\" $OpenBSD: tls_init.3,v 1.11 2018/03/19 16:34:47 jsing Exp $
.\"
.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
.\" Copyright (c) 2016 Joel Sing <jsing@openbsd.org>
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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 19 2018 $
.Dt TLS_INIT 3
.Os
.Sh NAME
.Nm tls_init ,
.Nm tls_config_new ,
.Nm tls_config_free ,
.Nm tls_config_error
|

















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.\" $OpenBSD: tls_init.3,v 1.13 2018/07/09 19:47:20 tb Exp $
.\"
.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
.\" Copyright (c) 2016 Joel Sing <jsing@openbsd.org>
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" 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: July 9 2018 $
.Dt TLS_INIT 3
.Os
.Sh NAME
.Nm tls_init ,
.Nm tls_config_new ,
.Nm tls_config_free ,
.Nm tls_config_error
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
family of functions establishes a secure communications channel
using the TLS socket protocol.
Both clients and servers are supported.
.Pp
The
.Fn tls_init
function initializes global data structures.
It may be called once before any other functions, however this is no
longer necessary since it will be handled internally on demand.
It may be called more than once, and may be called concurrently.
.Pp
Before a connection is created, a configuration must be created.
The
.Fn tls_config_new
function allocates, initializes, and returns a new default configuration
object that can be used for future connections.







|
|







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
family of functions establishes a secure communications channel
using the TLS socket protocol.
Both clients and servers are supported.
.Pp
The
.Fn tls_init
function initializes global data structures.
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
.Fn tls_config_new
function allocates, initializes, and returns a new default configuration
object that can be used for future connections.
Changes to jni/libressl/man/tls_load_file.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.\" $OpenBSD: tls_load_file.3,v 1.9 2017/10/08 06:56:36 jmc Exp $
.\"
.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
.\" Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
.\" Copyright (c) 2015 Bob Beck <beck@openbsd.org>
.\" Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org>
.\"
.\" 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: October 8 2017 $
.Dt TLS_LOAD_FILE 3
.Os
.Sh NAME
.Nm tls_load_file ,
.Nm tls_unload_file ,
.Nm tls_config_set_ca_file ,
.Nm tls_config_set_ca_path ,
|


















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.\" $OpenBSD: tls_load_file.3,v 1.10 2018/08/21 00:35:55 schwarze Exp $
.\"
.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
.\" Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
.\" Copyright (c) 2015 Bob Beck <beck@openbsd.org>
.\" Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org>
.\"
.\" 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 21 2018 $
.Dt TLS_LOAD_FILE 3
.Os
.Sh NAME
.Nm tls_load_file ,
.Nm tls_unload_file ,
.Nm tls_config_set_ca_file ,
.Nm tls_config_set_ca_path ,
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.Fa "struct tls_config *config"
.Fa "const uint8_t *staple"
.Fa "size_t len"
.Fc
.Ft int
.Fo tls_config_set_ocsp_staple_file
.Fa "struct tls_config *config"
.Fa "const uint8_t *staple_file"
.Fc
.Ft int
.Fo tls_config_set_keypair_file
.Fa "struct tls_config *config"
.Fa "const char *cert_file"
.Fa "const char *key_file"
.Fc







|







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.Fa "struct tls_config *config"
.Fa "const uint8_t *staple"
.Fa "size_t len"
.Fc
.Ft int
.Fo tls_config_set_ocsp_staple_file
.Fa "struct tls_config *config"
.Fa "const char *staple_file"
.Fc
.Ft int
.Fo tls_config_set_keypair_file
.Fa "struct tls_config *config"
.Fa "const char *cert_file"
.Fa "const char *key_file"
.Fc
Changes to jni/libressl/man/tls_ocsp_process_response.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38




39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" $OpenBSD: tls_ocsp_process_response.3,v 1.4 2017/01/29 18:00:21 beck Exp $
.\"
.\" Copyright (c) 2016 Bob Beck <beck@openbsd.org>
.\"
.\" 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: January 29 2017 $
.Dt TLS_OCSP_PROCESS_RESPONSE 3
.Os
.Sh NAME
.Nm tls_ocsp_process_response ,
.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_revocation_time ,
.Nm tls_peer_ocsp_this_update ,
.Nm tls_peer_ocsp_url
.Nd inspect an OCSP response
.Sh SYNOPSIS
.In tls.h
.Ft int
.Fo tls_ocsp_process_response
.Fa "struct tls *ctx"
.Fa "const unsigned char *response"
.Fa "size_t size"
.Fc




.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"
.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"
.Sh DESCRIPTION
.Fn tls_ocsp_process_response
processes a raw OCSP response in
.Ar response
of size
.Ar size
to check the revocation status of the peer certificate from
|















|




|
|
|
|
|


|









>
>
>
>




<
<
<
<

|




|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46




47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" $OpenBSD: tls_ocsp_process_response.3,v 1.6 2018/07/24 02:01:34 tb Exp $
.\"
.\" Copyright (c) 2016 Bob Beck <beck@openbsd.org>
.\"
.\" 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: 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_result ,
.Nm tls_peer_ocsp_revocation_time ,
.Nm tls_peer_ocsp_this_update ,
.Nm tls_peer_ocsp_next_update
.Nd inspect an OCSP response
.Sh SYNOPSIS
.In tls.h
.Ft int
.Fo tls_ocsp_process_response
.Fa "struct tls *ctx"
.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 const char *
.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 time_t
.Fn tls_peer_ocsp_next_update "struct tls *ctx"
.Sh DESCRIPTION
.Fn tls_ocsp_process_response
processes a raw OCSP response in
.Ar response
of size
.Ar size
to check the revocation status of the peer certificate from
69
70
71
72
73
74
75



76
77
78
79
80
81
82
83
84
85
86


87
88
89
90
91
92
93
94



95
96
97
98







99
100
101
102
103
104
105
.Pp
The following functions return information about the peer certificate from
.Ar ctx
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_cert_status
returns the OCSP certificate status code as per RFC 6960 section 2.2.
.Pp
.Fn tls_peer_ocsp_crl_reason
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.
.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.



.Sh RETURN VALUES
.Fn tls_ocsp_process_response
returns 0 on success or -1 on error.
.Pp







The
.Fn tls_peer_ocsp_response_status
function returns one of
.Dv TLS_OCSP_RESPONSE_SUCCESSFUL ,
.Dv TLS_OCSP_RESPONSE_MALFORMED ,
.Dv TLS_OCSP_RESPONSE_INTERNALERROR ,
.Dv TLS_OCSP_RESPONSE_TRYLATER ,







>
>
>







|
|
|
|
>
>
|

<





>
>
>




>
>
>
>
>
>
>







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
.Pp
The following functions return information about the peer certificate from
.Ar ctx
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
.Fn tls_peer_ocsp_crl_reason
returns the OCSP certificate revocation reason status code as per RFC 5280
section 5.3.1.
.Pp
.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_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
.Dv TLS_OCSP_RESPONSE_SUCCESSFUL ,
.Dv TLS_OCSP_RESPONSE_MALFORMED ,
.Dv TLS_OCSP_RESPONSE_INTERNALERROR ,
.Dv TLS_OCSP_RESPONSE_TRYLATER ,
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.Dv TLS_CRL_REASON_CERTIFICATE_HOLD ,
.Dv TLS_CRL_REASON_REMOVE_FROM_CRL ,
.Dv TLS_CRL_REASON_PRIVILEGE_WITHDRAWN ,
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 ,
and
.Fn tls_peer_ocsp_this_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 ,
.Xr tls_conn_version 3 ,
.Xr tls_connect 3 ,
.Xr tls_handshake 3 ,
.Xr tls_init 3
.Sh HISTORY
These functions appeared in
.Ox 6.1 .
.Sh AUTHORS
.An Bob Beck Aq Mt beck@openbsd.org
.An Marko Kreen Aq Mt markokr@gmail.com







|
|

|

<
<
<
<
<
<
<













143
144
145
146
147
148
149
150
151
152
153
154







155
156
157
158
159
160
161
162
163
164
165
166
167
.Dv TLS_CRL_REASON_CERTIFICATE_HOLD ,
.Dv TLS_CRL_REASON_REMOVE_FROM_CRL ,
.Dv TLS_CRL_REASON_PRIVILEGE_WITHDRAWN ,
or
.Dv  TLS_CRL_REASON_AA_COMPROMISE
on success or -1 on error.
.Pp
.Fn tls_peer_ocsp_revocation_time ,
.Fn tls_peer_ocsp_this_update ,
and
.Fn tls_peer_ocsp_next_update
return a time in epoch-seconds on success or -1 on error.







.Sh SEE ALSO
.Xr tls_client 3 ,
.Xr tls_config_ocsp_require_stapling 3 ,
.Xr tls_conn_version 3 ,
.Xr tls_connect 3 ,
.Xr tls_handshake 3 ,
.Xr tls_init 3
.Sh HISTORY
These functions appeared in
.Ox 6.1 .
.Sh AUTHORS
.An Bob Beck Aq Mt beck@openbsd.org
.An Marko Kreen Aq Mt markokr@gmail.com
Changes to jni/libressl/man/x509v3.cnf.5.
1
2
3
4
5
6
7
8
.\" $OpenBSD: x509v3.cnf.5,v 1.4 2018/02/16 18:48:55 schwarze 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 <steve@openssl.org>.
.\" Copyright (c) 2004, 2006, 2013, 2014, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
|







1
2
3
4
5
6
7
8
.\" $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 <steve@openssl.org>.
.\" Copyright (c) 2004, 2006, 2013, 2014, 2015, 2016 The OpenSSL Project.
.\" All rights reserved.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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: February 16 2018 $
.Dt X509V3.CNF 5
.Os
.Sh NAME
.Nm x509v3.cnf
.Nd X.509 V3 certificate extension configuration format
.Sh DESCRIPTION
Several of the OpenSSL utilities can add extensions to a certificate or







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\" 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: August 26 2018 $
.Dt X509V3.CNF 5
.Os
.Sh NAME
.Nm x509v3.cnf
.Nd X.509 V3 certificate extension configuration format
.Sh DESCRIPTION
Several of the OpenSSL utilities can add extensions to a certificate or
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.Cm FALSE .
If
.Ic CA
is
.Cm TRUE ,
then an optional
.Ic pathlen
name followed by an non-negative value can be included.
For example:
.Bd -literal -offset indent
basicConstraints=CA:TRUE
basicConstraints=CA:FALSE
basicConstraints=critical,CA:TRUE, pathlen:0
.Ed
.Pp







|







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.Cm FALSE .
If
.Ic CA
is
.Cm TRUE ,
then an optional
.Ic pathlen
name followed by a non-negative value can be included.
For example:
.Bd -literal -offset indent
basicConstraints=CA:TRUE
basicConstraints=CA:FALSE
basicConstraints=critical,CA:TRUE, pathlen:0
.Ed
.Pp
Changes to jni/libressl/ssl/CMakeLists.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
include_directories(
	.
	../include
	../include/compat
)

set(
	SSL_SRC
	bio_ssl.c
	bs_ber.c
	bs_cbb.c
	bs_cbs.c
	d1_both.c
<
<
<
<
<
<













1
2
3
4
5
6
7






set(
	SSL_SRC
	bio_ssl.c
	bs_ber.c
	bs_cbb.c
	bs_cbs.c
	d1_both.c
44
45
46
47
48
49
50







51
52
53
54
55
56
57
58
59
60
61
62
	t1_hash.c
	t1_lib.c
	t1_meth.c
	t1_srvr.c
)

add_library(ssl ${SSL_SRC})







if (BUILD_SHARED_LIBS)
	export_symbol(ssl ${CMAKE_CURRENT_SOURCE_DIR}/ssl.sym)
	target_link_libraries(ssl crypto)
	if (WIN32)
		target_link_libraries(ssl Ws2_32.lib)
		set(SSL_POSTFIX -${SSL_MAJOR_VERSION})
	endif()
	set_target_properties(ssl PROPERTIES
		OUTPUT_NAME ssl${SSL_POSTFIX}
		ARCHIVE_OUTPUT_NAME ssl${SSL_POSTFIX})
	set_target_properties(ssl PROPERTIES VERSION ${SSL_VERSION}
		SOVERSION ${SSL_MAJOR_VERSION})







>
>
>
>
>
>
>


|

<







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

56
57
58
59
60
61
62
	t1_hash.c
	t1_lib.c
	t1_meth.c
	t1_srvr.c
)

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)

		set(SSL_POSTFIX -${SSL_MAJOR_VERSION})
	endif()
	set_target_properties(ssl PROPERTIES
		OUTPUT_NAME ssl${SSL_POSTFIX}
		ARCHIVE_OUTPUT_NAME ssl${SSL_POSTFIX})
	set_target_properties(ssl PROPERTIES VERSION ${SSL_VERSION}
		SOVERSION ${SSL_MAJOR_VERSION})
Changes to jni/libressl/ssl/Makefile.in.
346
347
348
349
350
351
352
353
354
355

356
357
358
359
360
361
362
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
all: all-am

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.common $(am__configure_deps)
	@for dep in $?; do \







|
|
|
>







346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
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_init.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
all: all-am

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.common $(am__configure_deps)
	@for dep in $?; do \
451
452
453
454
455
456
457

458
459
460
461
462
463
464
@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@







>







452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
@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_init.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@
Changes to jni/libressl/ssl/VERSION.
1
45:1:0
|
1
46:1:0
Changes to jni/libressl/ssl/bio_ssl.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: bio_ssl.c,v 1.27 2017/02/07 02:08:38 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.
 *
|







1
2
3
4
5
6
7
8
/* $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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
	int num_renegotiates;
	unsigned long renegotiate_count;
	unsigned long byte_count;
	unsigned long renegotiate_timeout;
	time_t last_time;
} BIO_SSL;

static BIO_METHOD methods_sslp = {
	.type = BIO_TYPE_SSL,
	.name = "ssl",
	.bwrite = ssl_write,
	.bread = ssl_read,
	.bputs = ssl_puts,
	.ctrl = ssl_ctrl,
	.create = ssl_new,
	.destroy = ssl_free,
	.callback_ctrl = ssl_callback_ctrl,
};

BIO_METHOD *
BIO_f_ssl(void)
{
	return (&methods_sslp);
}

static int
ssl_new(BIO *bi)







|











|







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
	int num_renegotiates;
	unsigned long renegotiate_count;
	unsigned long byte_count;
	unsigned long renegotiate_timeout;
	time_t last_time;
} BIO_SSL;

static const BIO_METHOD methods_sslp = {
	.type = BIO_TYPE_SSL,
	.name = "ssl",
	.bwrite = ssl_write,
	.bread = ssl_read,
	.bputs = ssl_puts,
	.ctrl = ssl_ctrl,
	.create = ssl_new,
	.destroy = ssl_free,
	.callback_ctrl = ssl_callback_ctrl,
};

const BIO_METHOD *
BIO_f_ssl(void)
{
	return (&methods_sslp);
}

static int
ssl_new(BIO *bi)
564
565
566
567
568
569
570
571


572
573
574
575
576
577
578
	t = BIO_find_type(t, BIO_TYPE_SSL);
	f = BIO_find_type(f, BIO_TYPE_SSL);
	if ((t == NULL) || (f == NULL))
		return (0);
	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);


	return (1);
}

void
BIO_ssl_shutdown(BIO *b)
{
	SSL *s;







|
>
>







564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
	t = BIO_find_type(t, BIO_TYPE_SSL);
	f = BIO_find_type(f, BIO_TYPE_SSL);
	if ((t == NULL) || (f == NULL))
		return (0);
	if ((((BIO_SSL *)t->ptr)->ssl == NULL) ||
	    (((BIO_SSL *)f->ptr)->ssl == NULL))
		return (0);
	if (!SSL_copy_session_id(((BIO_SSL *)t->ptr)->ssl,
	    ((BIO_SSL *)f->ptr)->ssl))
		return (0);
	return (1);
}

void
BIO_ssl_shutdown(BIO *b)
{
	SSL *s;
Changes to jni/libressl/ssl/bs_cbb.c.
1
2
3
4
5
6
7
8
/*	$OpenBSD: bs_cbb.c,v 1.18 2017/11/28 16:34:20 jsing Exp $	*/
/*
 * Copyright (c) 2014, Google 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.
 *
|







1
2
3
4
5
6
7
8
/*	$OpenBSD: bs_cbb.c,v 1.19 2018/08/16 18:39:37 jsing Exp $	*/
/*
 * Copyright (c) 2014, Google 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.
 *
400
401
402
403
404
405
406









407
408
409
410
411
412
413
CBB_add_u24(CBB *cbb, size_t value)
{
	if (value > 0xffffffUL)
		return 0;

	return cbb_add_u(cbb, (uint32_t)value, 3);
}










int
CBB_add_asn1_uint64(CBB *cbb, uint64_t value)
{
	CBB child;
	size_t i;
	int started = 0;







>
>
>
>
>
>
>
>
>







400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
CBB_add_u24(CBB *cbb, size_t value)
{
	if (value > 0xffffffUL)
		return 0;

	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)
{
	CBB child;
	size_t i;
	int started = 0;
Changes to jni/libressl/ssl/bytestring.h.
1
2
3
4
5
6
7
8
/*	$OpenBSD: bytestring.h,v 1.16 2017/11/28 16:34:20 jsing Exp $	*/
/*
 * Copyright (c) 2014, Google 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.
 *
|







1
2
3
4
5
6
7
8
/*	$OpenBSD: bytestring.h,v 1.17 2018/08/16 18:39:37 jsing Exp $	*/
/*
 * Copyright (c) 2014, Google 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.
 *
457
458
459
460
461
462
463






464
465
466
467
468
469
470

/*
 * CBB_add_u24 appends a 24-bit, big-endian number from |value| to |cbb|. It
 * returns one on success and zero otherwise.
 */
int CBB_add_u24(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
 * error.
 */
int CBB_add_asn1_uint64(CBB *cbb, uint64_t value);








>
>
>
>
>
>







457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476

/*
 * CBB_add_u24 appends a 24-bit, big-endian number from |value| to |cbb|. It
 * returns one on success and zero otherwise.
 */
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
 * error.
 */
int CBB_add_asn1_uint64(CBB *cbb, uint64_t value);

Changes to jni/libressl/ssl/d1_both.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: d1_both.c,v 1.52 2017/10/08 16:24:02 jsing Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: d1_both.c,v 1.55 2018/09/05 16:58:59 jsing Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.
 *
157
158
159
160
161
162
163
164

165
166
167
168
169
170
171

/* XDTLS:  figure out the right values */
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 long dtls1_get_message_fragment(SSL *s, int st1, int stn, long max,
    int *ok);

static hm_fragment *
dtls1_hm_fragment_new(unsigned long frag_len, int reassembly)
{
	hm_fragment *frag = NULL;







|
>







157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

/* XDTLS:  figure out the right values */
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 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);

static hm_fragment *
dtls1_hm_fragment_new(unsigned long frag_len, int reassembly)
{
	hm_fragment *frag = NULL;
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
{
	if (frag == NULL)
		return;

	if (frag->msg_header.is_ccs) {
		EVP_CIPHER_CTX_free(
		    frag->msg_header.saved_retransmit_state.enc_write_ctx);
		EVP_MD_CTX_destroy(
		    frag->msg_header.saved_retransmit_state.write_hash);
	}
	free(frag->fragment);
	free(frag->reassembly);
	free(frag);
}








|







209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
{
	if (frag == NULL)
		return;

	if (frag->msg_header.is_ccs) {
		EVP_CIPHER_CTX_free(
		    frag->msg_header.saved_retransmit_state.enc_write_ctx);
		EVP_MD_CTX_free(
		    frag->msg_header.saved_retransmit_state.write_hash);
	}
	free(frag->fragment);
	free(frag->reassembly);
	free(frag);
}

297
298
299
300
301
302
303
304

305

306
307
308
309
310
311
312
				else
					len = s->internal->init_num;
			}

			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]);


			OPENSSL_assert(len >= DTLS1_HM_HEADER_LENGTH);
		}

		ret = dtls1_write_bytes(s, type,
		    &s->internal->init_buf->data[s->internal->init_off], len);
		if (ret < 0) {







|
>
|
>







298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
				else
					len = s->internal->init_num;
			}

			dtls1_fix_message_header(s, frag_off,
			    len - DTLS1_HM_HEADER_LENGTH);

			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);
		}

		ret = dtls1_write_bytes(s, type,
		    &s->internal->init_buf->data[s->internal->init_off], len);
		if (ret < 0) {
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
				int xlen;

				if (frag_off == 0) {
					/*
					 * 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;
					xlen = ret;
				} else {
					p += DTLS1_HM_HEADER_LENGTH;
					xlen = ret - DTLS1_HM_HEADER_LENGTH;
				}

				tls1_finish_mac(s, p, xlen);







|
|
|
<
<
<







347
348
349
350
351
352
353
354
355
356



357
358
359
360
361
362
363
				int xlen;

				if (frag_off == 0) {
					/*
					 * Reconstruct message header is if it
					 * is being sent in single fragment
					 */
					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);
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
	else if (i <= 0 && !*ok)
		return i;

	p = (unsigned char *)s->internal->init_buf->data;
	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);

	p -= DTLS1_HM_HEADER_LENGTH;
	msg_len += DTLS1_HM_HEADER_LENGTH;

	tls1_finish_mac(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);








<
|
|
<
<

<







427
428
429
430
431
432
433

434
435


436

437
438
439
440
441
442
443
	else if (i <= 0 && !*ok)
		return i;

	p = (unsigned char *)s->internal->init_buf->data;
	msg_len = msg_hdr->msg_len;

	/* reconstruct message header */

	if (!dtls1_write_message_header(msg_hdr, 0, msg_len, p))
		return -1;




	msg_len += DTLS1_HM_HEADER_LENGTH;

	tls1_finish_mac(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);

1163
1164
1165
1166
1167
1168
1169
1170
1171

1172
1173

1174



1175

1176
1177
1178

1179





1180

1181


1182
1183
1184
1185
1186
1187
1188
1189
{
	struct hm_header_st *msg_hdr = &D1I(s)->w_msg_hdr;

	msg_hdr->frag_off = frag_off;
	msg_hdr->frag_len = frag_len;
}

static unsigned char *
dtls1_write_message_header(SSL *s, unsigned char *p)

{
	struct hm_header_st *msg_hdr = &D1I(s)->w_msg_hdr;





	*p++ = msg_hdr->type;

	l2n3(msg_hdr->msg_len, p);

	s2n(msg_hdr->seq, p);

	l2n3(msg_hdr->frag_off, p);





	l2n3(msg_hdr->frag_len, p);




	return p;
}

unsigned int
dtls1_min_mtu(void)
{
	return (g_probable_mtu[(sizeof(g_probable_mtu) /
	    sizeof(g_probable_mtu[0])) - 1]);







|
|
>

<
>

>
>
>
|
>
|
|
|
>
|
>
>
>
>
>
|
>

>
>
|







1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169

1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
{
	struct hm_header_st *msg_hdr = &D1I(s)->w_msg_hdr;

	msg_hdr->frag_off = frag_off;
	msg_hdr->frag_len = 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)
{

	CBB cbb;

	/* 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;

	return 1;

 err:
	CBB_cleanup(&cbb);
	return 0;
}

unsigned int
dtls1_min_mtu(void)
{
	return (g_probable_mtu[(sizeof(g_probable_mtu) /
	    sizeof(g_probable_mtu[0])) - 1]);
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
void
dtls1_get_ccs_header(unsigned char *data, struct ccs_header_st *ccs_hdr)
{
	memset(ccs_hdr, 0x00, sizeof(struct ccs_header_st));

	ccs_hdr->type = *(data++);
}

int
dtls1_shutdown(SSL *s)
{
	int ret;

	ret = ssl3_shutdown(s);
	return ret;
}







<
<
<
<
<
<
<
<
<
1249
1250
1251
1252
1253
1254
1255









void
dtls1_get_ccs_header(unsigned char *data, struct ccs_header_st *ccs_hdr)
{
	memset(ccs_hdr, 0x00, sizeof(struct ccs_header_st));

	ccs_hdr->type = *(data++);
}









Changes to jni/libressl/ssl/d1_clnt.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: d1_clnt.c,v 1.79 2017/10/10 15:13:26 jsing Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1999-2007 The OpenSSL Project.  All rights reserved.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: d1_clnt.c,v 1.81 2018/08/30 16:56:16 jsing Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1999-2007 The OpenSSL Project.  All rights reserved.
 *
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
	.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,
	.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,







<
<
<
<
<







132
133
134
135
136
137
138





139
140
141
142
143
144
145
	.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,
Changes to jni/libressl/ssl/d1_meth.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: d1_meth.c,v 1.15 2017/10/12 15:52:50 jsing Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: d1_meth.c,v 1.17 2018/08/30 16:56:16 jsing Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 *
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
	.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,
	.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,







<
<
<
<
<







70
71
72
73
74
75
76





77
78
79
80
81
82
83
	.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,
Changes to jni/libressl/ssl/d1_pkt.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: d1_pkt.c,v 1.63 2017/05/07 04:22:24 beck Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: d1_pkt.c,v 1.64 2018/08/24 19:35:05 jsing Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.
 *
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
			goto f_err;
		}

		if (dest_maxlen > 0) {
            /* 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;
			}

			/* now move 'n' bytes: */
			for ( k = 0; k < dest_maxlen; k++) {







<
<
<
<
<
<
<
<







821
822
823
824
825
826
827








828
829
830
831
832
833
834
			goto f_err;
		}

		if (dest_maxlen > 0) {
            /* XDTLS:  In a pathalogical case, the Client Hello
             *  may be fragmented--don't always expect dest_maxlen bytes */
			if (rr->length < dest_maxlen) {








				s->internal->rstate = SSL_ST_READ_HEADER;
				rr->length = 0;
				goto start;
			}

			/* now move 'n' bytes: */
			for ( k = 0; k < dest_maxlen; k++) {
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422

	s->s3->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

	i = do_dtls1_write(s, SSL3_RT_ALERT, &buf[0], sizeof(buf));
	if (i <= 0) {
		s->s3->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
		)
			(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);

		if (s->internal->info_callback != NULL)







<
<
<
<
<
<
<





|
<
<
<
<







1384
1385
1386
1387
1388
1389
1390







1391
1392
1393
1394
1395
1396




1397
1398
1399
1400
1401
1402
1403

	s->s3->alert_dispatch = 0;

	memset(buf, 0x00, sizeof(buf));
	*ptr++ = s->s3->send_alert[0];
	*ptr++ = s->s3->send_alert[1];








	i = do_dtls1_write(s, SSL3_RT_ALERT, &buf[0], sizeof(buf));
	if (i <= 0) {
		s->s3->alert_dispatch = 1;
		/* fprintf( stderr, "not done with alert\n" ); */
	} else {
		if (s->s3->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);

		if (s->internal->info_callback != NULL)
Changes to jni/libressl/ssl/d1_srvr.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: d1_srvr.c,v 1.91 2017/10/12 15:52:50 jsing Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1999-2007 The OpenSSL Project.  All rights reserved.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: d1_srvr.c,v 1.94 2018/08/30 16:56:16 jsing Exp $ */
/*
 * DTLS implementation written by Nagendra Modadugu
 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
 */
/* ====================================================================
 * Copyright (c) 1999-2007 The OpenSSL Project.  All rights reserved.
 *
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
	.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,
	.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,







<
<
<
<
<







130
131
132
133
134
135
136





137
138
139
140
141
142
143
	.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,
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
		if (s->ctx->internal->app_gen_cookie_cb == NULL ||
		    s->ctx->internal->app_gen_cookie_cb(s, D1I(s)->cookie,
			&(D1I(s)->cookie_len)) == 0) {
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			return 0;
		}

		if (!ssl3_handshake_msg_start_cbb(s, &cbb, &verify,
		    DTLS1_MT_HELLO_VERIFY_REQUEST))
			goto err;
		if (!CBB_add_u16(&verify, s->version))
			goto err;
		if (!CBB_add_u8_length_prefixed(&verify, &cookie))
			goto err;
		if (!CBB_add_bytes(&cookie, D1I(s)->cookie, D1I(s)->cookie_len))
			goto err;
		if (!ssl3_handshake_msg_finish_cbb(s, &cbb))
			goto err;

		S3I(s)->hs.state = DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B;
	}

	/* S3I(s)->hs.state = DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (-1);
}







|








|













179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
		if (s->ctx->internal->app_gen_cookie_cb == NULL ||
		    s->ctx->internal->app_gen_cookie_cb(s, D1I(s)->cookie,
			&(D1I(s)->cookie_len)) == 0) {
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			return 0;
		}

		if (!ssl3_handshake_msg_start(s, &cbb, &verify,
		    DTLS1_MT_HELLO_VERIFY_REQUEST))
			goto err;
		if (!CBB_add_u16(&verify, s->version))
			goto err;
		if (!CBB_add_u8_length_prefixed(&verify, &cookie))
			goto err;
		if (!CBB_add_bytes(&cookie, D1I(s)->cookie, D1I(s)->cookie_len))
			goto err;
		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		S3I(s)->hs.state = DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B;
	}

	/* S3I(s)->hs.state = DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (-1);
}
Changes to jni/libressl/ssl/s3_cbc.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: s3_cbc.c,v 1.16 2017/01/23 08:08:06 beck Exp $ */
/* ====================================================================
 * Copyright (c) 2012 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
2
3
4
5
6
7
8
/* $OpenBSD: s3_cbc.c,v 1.17 2018/09/08 14:39:41 jsing Exp $ */
/* ====================================================================
 * Copyright (c) 2012 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:
 *
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
		rec->input += block_size;
		rec->length -= block_size;
	} else if (overhead > rec->length)
		return 0;

	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
	 * length byte. Thus, with the length byte included, there are i+1
	 * bytes of padding.
	 *
	 * We can't check just |padding_length+1| bytes because that leaks







<
<
<
<
<
<







131
132
133
134
135
136
137






138
139
140
141
142
143
144
		rec->input += block_size;
		rec->length -= block_size;
	} else if (overhead > rec->length)
		return 0;

	padding_length = rec->data[rec->length - 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
	 * length byte. Thus, with the length byte included, there are i+1
	 * bytes of padding.
	 *
	 * We can't check just |padding_length+1| bytes because that leaks
Changes to jni/libressl/ssl/s3_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: s3_lib.c,v 1.165 2018/03/15 12:27:00 jca 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: s3_lib.c,v 1.170 2018/09/06 16:40:45 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.
 *
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
		.algorithm_ssl = SSL_SSLV3,
		.algo_strength = SSL_LOW,
		.algorithm2 = SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
		.strength_bits = 128,
		.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,
		.name = SSL3_TXT_RSA_DES_192_CBC3_SHA,
		.id = SSL3_CK_RSA_DES_192_CBC3_SHA,
		.algorithm_mkey = SSL_kRSA,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_3DES,
		.algorithm_mac = SSL_SHA1,
		.algorithm_ssl = SSL_SSLV3,
		.algo_strength = SSL_MEDIUM,
		.algorithm2 = SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
		.strength_bits = 112,
		.alg_bits = 168,
	},

	/*
	 * 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,
		.name = SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA,
		.id = SSL3_CK_EDH_RSA_DES_192_CBC3_SHA,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aRSA,







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




















<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







233
234
235
236
237
238
239
















240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
















260
261
262
263
264
265
266
		.algorithm_ssl = SSL_SSLV3,
		.algo_strength = SSL_LOW,
		.algorithm2 = SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
		.strength_bits = 128,
		.alg_bits = 128,
	},

















	/* Cipher 0A */
	{
		.valid = 1,
		.name = SSL3_TXT_RSA_DES_192_CBC3_SHA,
		.id = SSL3_CK_RSA_DES_192_CBC3_SHA,
		.algorithm_mkey = SSL_kRSA,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_3DES,
		.algorithm_mac = SSL_SHA1,
		.algorithm_ssl = SSL_SSLV3,
		.algo_strength = SSL_MEDIUM,
		.algorithm2 = SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
		.strength_bits = 112,
		.alg_bits = 168,
	},

	/*
	 * Ephemeral DH (DHE) ciphers.
	 */

















	/* Cipher 16 */
	{
		.valid = 1,
		.name = SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA,
		.id = SSL3_CK_EDH_RSA_DES_192_CBC3_SHA,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aRSA,
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
		.algorithm_ssl = SSL_SSLV3,
		.algo_strength = SSL_LOW,
		.algorithm2 = SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
		.strength_bits = 128,
		.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,
		.name = SSL3_TXT_ADH_DES_192_CBC_SHA,
		.id = SSL3_CK_ADH_DES_192_CBC_SHA,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aNULL,







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







285
286
287
288
289
290
291
















292
293
294
295
296
297
298
		.algorithm_ssl = SSL_SSLV3,
		.algo_strength = SSL_LOW,
		.algorithm2 = SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
		.strength_bits = 128,
		.alg_bits = 128,
	},

















	/* Cipher 1B */
	{
		.valid = 1,
		.name = SSL3_TXT_ADH_DES_192_CBC_SHA,
		.id = SSL3_CK_ADH_DES_192_CBC_SHA,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aNULL,
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
		.algorithm_mkey = SSL_kRSA,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES128GCM,
		.algorithm_mac = SSL_AEAD,
		.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)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 128,
		.alg_bits = 128,
	},

	/* Cipher 9D */
	{
		.valid = 1,
		.name = TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384,
		.id = TLS1_CK_RSA_WITH_AES_256_GCM_SHA384,
		.algorithm_mkey = SSL_kRSA,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES256GCM,
		.algorithm_mac = SSL_AEAD,
		.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)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher 9E */
	{
		.valid = 1,
		.name = TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256,
		.id = TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES128GCM,
		.algorithm_mac = SSL_AEAD,
		.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)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 128,
		.alg_bits = 128,
	},

	/* Cipher 9F */
	{
		.valid = 1,
		.name = TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384,
		.id = TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES256GCM,
		.algorithm_mac = SSL_AEAD,
		.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)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher A6 */
	{
		.valid = 1,
		.name = TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256,
		.id = TLS1_CK_ADH_WITH_AES_128_GCM_SHA256,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aNULL,
		.algorithm_enc = SSL_AES128GCM,
		.algorithm_mac = SSL_AEAD,
		.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)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 128,
		.alg_bits = 128,
	},

	/* Cipher A7 */
	{
		.valid = 1,
		.name = TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384,
		.id = TLS1_CK_ADH_WITH_AES_256_GCM_SHA384,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aNULL,
		.algorithm_enc = SSL_AES256GCM,
		.algorithm_mac = SSL_AEAD,
		.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)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 256,
		.alg_bits = 256,
	},

#ifndef OPENSSL_NO_CAMELLIA
	/* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */







|

















|

















|

















|

















|

















|







670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
		.algorithm_mkey = SSL_kRSA,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES128GCM,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256|
		    FIXED_NONCE_LEN(4)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 128,
		.alg_bits = 128,
	},

	/* Cipher 9D */
	{
		.valid = 1,
		.name = TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384,
		.id = TLS1_CK_RSA_WITH_AES_256_GCM_SHA384,
		.algorithm_mkey = SSL_kRSA,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES256GCM,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384|
		    FIXED_NONCE_LEN(4)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher 9E */
	{
		.valid = 1,
		.name = TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256,
		.id = TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES128GCM,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256|
		    FIXED_NONCE_LEN(4)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 128,
		.alg_bits = 128,
	},

	/* Cipher 9F */
	{
		.valid = 1,
		.name = TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384,
		.id = TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES256GCM,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384|
		    FIXED_NONCE_LEN(4)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher A6 */
	{
		.valid = 1,
		.name = TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256,
		.id = TLS1_CK_ADH_WITH_AES_128_GCM_SHA256,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aNULL,
		.algorithm_enc = SSL_AES128GCM,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256|
		    FIXED_NONCE_LEN(4)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 128,
		.alg_bits = 128,
	},

	/* Cipher A7 */
	{
		.valid = 1,
		.name = TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384,
		.id = TLS1_CK_ADH_WITH_AES_256_GCM_SHA384,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aNULL,
		.algorithm_enc = SSL_AES256GCM,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384|
		    FIXED_NONCE_LEN(4)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 256,
		.alg_bits = 256,
	},

#ifndef OPENSSL_NO_CAMELLIA
	/* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aECDSA,
		.algorithm_enc = SSL_AES128GCM,
		.algorithm_mac = SSL_AEAD,
		.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)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 128,
		.alg_bits = 128,
	},

	/* Cipher C02C */
	{
		.valid = 1,
		.name = TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
		.id = TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aECDSA,
		.algorithm_enc = SSL_AES256GCM,
		.algorithm_mac = SSL_AEAD,
		.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)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher C02F */
	{
		.valid = 1,
		.name = TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
		.id = TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES128GCM,
		.algorithm_mac = SSL_AEAD,
		.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)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 128,
		.alg_bits = 128,
	},

	/* Cipher C030 */
	{
		.valid = 1,
		.name = TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
		.id = TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES256GCM,
		.algorithm_mac = SSL_AEAD,
		.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)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher CCA8 */
	{
		.valid = 1,
		.name = TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305,
		.id = TLS1_CK_ECDHE_RSA_CHACHA20_POLY1305,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_CHACHA20POLY1305,
		.algorithm_mac = SSL_AEAD,
		.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),
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher CCA9 */
	{
		.valid = 1,
		.name = TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
		.id = TLS1_CK_ECDHE_ECDSA_CHACHA20_POLY1305,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aECDSA,
		.algorithm_enc = SSL_CHACHA20POLY1305,
		.algorithm_mac = SSL_AEAD,
		.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),
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher CCAA */
	{
		.valid = 1,
		.name = TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305,
		.id = TLS1_CK_DHE_RSA_CHACHA20_POLY1305,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_CHACHA20POLY1305,
		.algorithm_mac = SSL_AEAD,
		.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),
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher FF85 FIXME IANA */
	{
		.valid = 1,







|

















|

















|

















|

















|
















|
















|







1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aECDSA,
		.algorithm_enc = SSL_AES128GCM,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256|
		    FIXED_NONCE_LEN(4)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 128,
		.alg_bits = 128,
	},

	/* Cipher C02C */
	{
		.valid = 1,
		.name = TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
		.id = TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aECDSA,
		.algorithm_enc = SSL_AES256GCM,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384|
		    FIXED_NONCE_LEN(4)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher C02F */
	{
		.valid = 1,
		.name = TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
		.id = TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES128GCM,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256|
		    FIXED_NONCE_LEN(4)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 128,
		.alg_bits = 128,
	},

	/* Cipher C030 */
	{
		.valid = 1,
		.name = TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
		.id = TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_AES256GCM,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384|
		    FIXED_NONCE_LEN(4)|
		    SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher CCA8 */
	{
		.valid = 1,
		.name = TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305,
		.id = TLS1_CK_ECDHE_RSA_CHACHA20_POLY1305,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_CHACHA20POLY1305,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256|
		    FIXED_NONCE_LEN(12),
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher CCA9 */
	{
		.valid = 1,
		.name = TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
		.id = TLS1_CK_ECDHE_ECDSA_CHACHA20_POLY1305,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aECDSA,
		.algorithm_enc = SSL_CHACHA20POLY1305,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256|
		    FIXED_NONCE_LEN(12),
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher CCAA */
	{
		.valid = 1,
		.name = TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305,
		.id = TLS1_CK_DHE_RSA_CHACHA20_POLY1305,
		.algorithm_mkey = SSL_kDHE,
		.algorithm_auth = SSL_aRSA,
		.algorithm_enc = SSL_CHACHA20POLY1305,
		.algorithm_mac = SSL_AEAD,
		.algorithm_ssl = SSL_TLSV1_2,
		.algo_strength = SSL_HIGH,
		.algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256|
		    FIXED_NONCE_LEN(12),
		.strength_bits = 256,
		.alg_bits = 256,
	},

	/* Cipher FF85 FIXME IANA */
	{
		.valid = 1,
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
int
ssl3_handshake_msg_hdr_len(SSL *s)
{
	return (SSL_IS_DTLS(s) ? DTLS1_HM_HEADER_LENGTH :
            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)
{
	int ret = 0;

	if (!CBB_init(handshake, SSL3_RT_MAX_PLAIN_LENGTH))
		goto err;
	if (!CBB_add_u8(handshake, msg_type))
		goto err;







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

|
<







1393
1394
1395
1396
1397
1398
1399



































1400
1401

1402
1403
1404
1405
1406
1407
1408
int
ssl3_handshake_msg_hdr_len(SSL *s)
{
	return (SSL_IS_DTLS(s) ? DTLS1_HM_HEADER_LENGTH :
            SSL3_HM_HEADER_LENGTH);
}




































int
ssl3_handshake_msg_start(SSL *s, CBB *handshake, CBB *body, uint8_t msg_type)

{
	int ret = 0;

	if (!CBB_init(handshake, SSL3_RT_MAX_PLAIN_LENGTH))
		goto err;
	if (!CBB_add_u8(handshake, msg_type))
		goto err;
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
	ret = 1;

 err:
	return (ret);
}

int
ssl3_handshake_msg_finish_cbb(SSL *s, CBB *handshake)
{
	unsigned char *data = NULL;
	size_t outlen;
	int ret = 0;

	if (!CBB_finish(handshake, &data, &outlen))
		goto err;







|







1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
	ret = 1;

 err:
	return (ret);
}

int
ssl3_handshake_msg_finish(SSL *s, CBB *handshake)
{
	unsigned char *data = NULL;
	size_t outlen;
	int ret = 0;

	if (!CBB_finish(handshake, &data, &outlen))
		goto err;
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
	}
	if (sk_X509_push(ctx->extra_certs, cert) == 0)
		return 0;

	return 1;
}

int
_SSL_CTX_get_extra_chain_certs(SSL_CTX *ctx, STACK_OF(X509) **certs)
{
	*certs = ctx->extra_certs;
	return 1;
}

int
_SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx)
{
	sk_X509_pop_free(ctx->extra_certs, X509_free);
	ctx->extra_certs = NULL;
	return 1;
}








|






|







2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
	}
	if (sk_X509_push(ctx->extra_certs, cert) == 0)
		return 0;

	return 1;
}

static int
_SSL_CTX_get_extra_chain_certs(SSL_CTX *ctx, STACK_OF(X509) **certs)
{
	*certs = ctx->extra_certs;
	return 1;
}

static int
_SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx)
{
	sk_X509_pop_free(ctx->extra_certs, X509_free);
	ctx->extra_certs = NULL;
	return 1;
}

2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
	else
		return (0);
}

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);
}

static int
ssl3_read_internal(SSL *s, void *buf, int len, int peek)
{
	int	ret;








<
|
<
<
<
<
|
<
<



<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<







2436
2437
2438
2439
2440
2441
2442

2443




2444


2445
2446
2447































2448
2449





2450
2451
2452
2453
2454
2455
2456
	else
		return (0);
}

int
ssl3_write(SSL *s, const void *buf, int len)
{

	errno = 0;







	if (S3I(s)->renegotiate)
		ssl3_renegotiate_check(s);
































	return s->method->internal->ssl_write_bytes(s,
	    SSL3_RT_APPLICATION_DATA, buf, len);





}

static int
ssl3_read_internal(SSL *s, void *buf, int len, int peek)
{
	int	ret;

Changes to jni/libressl/ssl/ssl_asn1.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_asn1.c,v 1.56 2018/03/20 16:10:57 jsing Exp $ */
/*
 * Copyright (c) 2016 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/* $OpenBSD: ssl_asn1.c,v 1.57 2018/08/27 16:42:48 jsing Exp $ */
/*
 * Copyright (c) 2016 Joel Sing <jsing@openbsd.org>
 *
 * 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.
 *
40
41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
	if (sizeof(time_t) == sizeof(int32_t))
		return INT32_MAX;
	if (sizeof(time_t) == sizeof(int64_t))
		return INT64_MAX;
	return 0;
}

int
i2d_SSL_SESSION(SSL_SESSION *s, unsigned char **pp)

{
	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;
	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;

	if (!CBB_add_asn1(&cbb, &session, CBS_ASN1_SEQUENCE))
		goto err;

	/* Session ASN1 version. */







|
|
>


|
<
|
<
|


<
<
<
<
<
<







40
41
42
43
44
45
46
47
48
49
50
51
52

53

54
55
56






57
58
59
60
61
62
63
	if (sizeof(time_t) == sizeof(int32_t))
		return INT32_MAX;
	if (sizeof(time_t) == sizeof(int64_t))
		return INT64_MAX;
	return 0;
}

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, value;

	unsigned char *peer_cert_bytes = NULL;

	int len, rv = 0;
	uint16_t cid;







	if (!CBB_init(&cbb, 0))
		goto err;

	if (!CBB_add_asn1(&cbb, &session, CBS_ASN1_SEQUENCE))
		goto err;

	/* Session ASN1 version. */
83
84
85
86
87
88
89
90
91
92
93

94
95
96
97
98
99
100
	if (s->cipher != NULL)
		cid = ssl3_cipher_get_value(s->cipher);
	if (!CBB_add_asn1(&session, &cipher_suite, CBS_ASN1_OCTETSTRING))
		goto err;
	if (!CBB_add_u16(&cipher_suite, cid))
		goto err;

	/* Session ID. */
	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))

		goto err;

	/* Master key. */
	if (!CBB_add_asn1(&session, &master_key, CBS_ASN1_OCTETSTRING))
		goto err;
	if (!CBB_add_bytes(&master_key, s->master_key, s->master_key_length))
		goto err;







|


|
>







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
	if (s->cipher != NULL)
		cid = ssl3_cipher_get_value(s->cipher);
	if (!CBB_add_asn1(&session, &cipher_suite, CBS_ASN1_OCTETSTRING))
		goto err;
	if (!CBB_add_u16(&cipher_suite, cid))
		goto err;

	/* 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,
	    ticket_encoding ? 0 : s->session_id_length))
		goto err;

	/* Master key. */
	if (!CBB_add_asn1(&session, &master_key, CBS_ASN1_OCTETSTRING))
		goto err;
	if (!CBB_add_bytes(&master_key, s->master_key, s->master_key_length))
		goto err;
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188





































189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
			goto err;
		if (!CBB_add_asn1_uint64(&lifetime,
		    s->tlsext_tick_lifetime_hint))
			goto err;
	}

	/* Ticket [10]. */
	if (s->tlsext_tick) {
		if (!CBB_add_asn1(&session, &ticket, SSLASN1_TICKET_TAG))
			goto err;
		if (!CBB_add_asn1(&ticket, &value, CBS_ASN1_OCTETSTRING))
			goto err;
		if (!CBB_add_bytes(&value, s->tlsext_tick, s->tlsext_ticklen))
			goto err;
	}

	/* Compression method [11]. */
	/* SRP username [12]. */

	if (!CBB_finish(&cbb, &data, &data_len))





































		goto err;

	if (data_len > INT_MAX)
		goto err;

	if (pp != NULL) {
		if (*pp == NULL) {
			*pp = data;
			data = NULL;
		} else {
			memcpy(*pp, data, data_len);
			*pp += data_len;
		}
	}

	rv = (int)data_len;

 err:
	CBB_cleanup(&cbb);
	freezero(data, data_len);
	free(peer_cert_bytes);

	return rv;
}

SSL_SESSION *
d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length)
{







|











|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


















<

<







163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237

238

239
240
241
242
243
244
245
			goto err;
		if (!CBB_add_asn1_uint64(&lifetime,
		    s->tlsext_tick_lifetime_hint))
			goto err;
	}

	/* Ticket [10]. */
	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))
			goto err;
		if (!CBB_add_bytes(&value, s->tlsext_tick, s->tlsext_ticklen))
			goto err;
	}

	/* Compression method [11]. */
	/* SRP username [12]. */

	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)
		goto err;

	if (pp != NULL) {
		if (*pp == NULL) {
			*pp = data;
			data = NULL;
		} else {
			memcpy(*pp, data, data_len);
			*pp += data_len;
		}
	}

	rv = (int)data_len;

 err:

	freezero(data, data_len);


	return rv;
}

SSL_SESSION *
d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length)
{
Changes to jni/libressl/ssl/ssl_both.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_both.c,v 1.11 2017/10/08 16:24:02 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_both.c,v 1.12 2018/08/24 17:30:32 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.
 *
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
			S3I(s)->previous_client_finished_len = md_len;
		} else {
			memcpy(S3I(s)->previous_server_finished,
			    S3I(s)->tmp.finish_md, md_len);
			S3I(s)->previous_server_finished_len = md_len;
		}

		if (!ssl3_handshake_msg_start_cbb(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))
			goto err;

		S3I(s)->hs.state = b;
	}

	return (ssl3_handshake_write(s));








|




|







187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
			S3I(s)->previous_client_finished_len = md_len;
		} else {
			memcpy(S3I(s)->previous_server_finished,
			    S3I(s)->tmp.finish_md, md_len);
			S3I(s)->previous_server_finished_len = md_len;
		}

		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(s, &cbb))
			goto err;

		S3I(s)->hs.state = b;
	}

	return (ssl3_handshake_write(s));

Changes to jni/libressl/ssl/ssl_cert.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_cert.c,v 1.66 2017/08/12 02:55:22 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_cert.c,v 1.67 2018/04/25 07:10:39 tb 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.
 *
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
    STACK_OF(X509_NAME) *name_list)
{
	sk_X509_NAME_pop_free(*ca_list, X509_NAME_free);
	*ca_list = name_list;
}

STACK_OF(X509_NAME) *
SSL_dup_CA_list(STACK_OF(X509_NAME) *sk)
{
	int i;
	STACK_OF(X509_NAME) *ret;
	X509_NAME *name;

	ret = sk_X509_NAME_new_null();
	for (i = 0; i < sk_X509_NAME_num(sk); i++) {







|







450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
    STACK_OF(X509_NAME) *name_list)
{
	sk_X509_NAME_pop_free(*ca_list, X509_NAME_free);
	*ca_list = name_list;
}

STACK_OF(X509_NAME) *
SSL_dup_CA_list(const STACK_OF(X509_NAME) *sk)
{
	int i;
	STACK_OF(X509_NAME) *ret;
	X509_NAME *name;

	ret = sk_X509_NAME_new_null();
	for (i = 0; i < sk_X509_NAME_num(sk); i++) {
Changes to jni/libressl/ssl/ssl_ciph.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_ciph.c,v 1.98 2018/03/17 14:40:45 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_ciph.c,v 1.105 2018/09/08 14:39:41 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.
 *
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189

#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif

#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,







<
|
|
<
|
|
|
|
|
|
<
<
|

<

|


|
|
|
|
|
|
|
<
<
<
|







146
147
148
149
150
151
152

153
154

155
156
157
158
159
160


161
162

163
164
165
166
167
168
169
170
171
172
173



174
175
176
177
178
179
180
181

#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif

#include "ssl_locl.h"


#define SSL_ENC_3DES_IDX	0
#define SSL_ENC_RC4_IDX		1

#define SSL_ENC_NULL_IDX	2
#define SSL_ENC_AES128_IDX	3
#define SSL_ENC_AES256_IDX	4
#define SSL_ENC_CAMELLIA128_IDX	5
#define SSL_ENC_CAMELLIA256_IDX	6
#define SSL_ENC_GOST89_IDX	7


#define SSL_ENC_NUM_IDX		8


static const EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX] = {
	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



#define SSL_MD_NUM_IDX		7
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,
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
		.name = SSL_TXT_AECDH,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aNULL,
	},

	/* symmetric encryption aliases */
	{
		.name = SSL_TXT_DES,
		.algorithm_enc = SSL_DES,
	},
	{
		.name = SSL_TXT_3DES,
		.algorithm_enc = SSL_3DES,
	},
	{
		.name = SSL_TXT_RC4,
		.algorithm_enc = SSL_RC4,
	},
	{
		.name = SSL_TXT_IDEA,
		.algorithm_enc = SSL_IDEA,
	},
	{
		.name = SSL_TXT_eNULL,
		.algorithm_enc = SSL_eNULL,
	},
	{
		.name = SSL_TXT_AES128,
		.algorithm_enc = SSL_AES128|SSL_AES128GCM,
	},







<
<
<
<








<
<
<
<







327
328
329
330
331
332
333




334
335
336
337
338
339
340
341




342
343
344
345
346
347
348
		.name = SSL_TXT_AECDH,
		.algorithm_mkey = SSL_kECDHE,
		.algorithm_auth = SSL_aNULL,
	},

	/* symmetric encryption aliases */
	{




		.name = SSL_TXT_3DES,
		.algorithm_enc = SSL_3DES,
	},
	{
		.name = SSL_TXT_RC4,
		.algorithm_enc = SSL_RC4,
	},
	{




		.name = SSL_TXT_eNULL,
		.algorithm_enc = SSL_eNULL,
	},
	{
		.name = SSL_TXT_AES128,
		.algorithm_enc = SSL_AES128|SSL_AES128GCM,
	},
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
		.algo_strength = SSL_HIGH,
	},
};

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);







<
<




<











<
<
<
<
<







441
442
443
444
445
446
447


448
449
450
451

452
453
454
455
456
457
458
459
460
461
462





463
464
465
466
467
468
469
		.algo_strength = SSL_HIGH,
	},
};

void
ssl_load_ciphers(void)
{


	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_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_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);
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
	if (c == 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);

	switch (c->algorithm_enc) {
	case SSL_DES:
		i = SSL_ENC_DES_IDX;
		break;
	case SSL_3DES:
		i = SSL_ENC_3DES_IDX;
		break;
	case SSL_RC4:
		i = SSL_ENC_RC4_IDX;
		break;
	case SSL_IDEA:
		i = SSL_ENC_IDEA_IDX;
		break;
	case SSL_eNULL:
		i = SSL_ENC_NULL_IDX;
		break;
	case SSL_AES128:
		i = SSL_ENC_AES128_IDX;
		break;
	case SSL_AES256:
		i = SSL_ENC_AES256_IDX;
		break;
	case SSL_CAMELLIA128:
		i = SSL_ENC_CAMELLIA128_IDX;
		break;
	case SSL_CAMELLIA256:
		i = SSL_ENC_CAMELLIA256_IDX;
		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;
		break;
	}

	if ((i < 0) || (i >= SSL_ENC_NUM_IDX))
		*enc = NULL;







|






<
<
<






<
<
<


















<
<
<
<
<
<







508
509
510
511
512
513
514
515
516
517
518
519
520
521



522
523
524
525
526
527



528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545






546
547
548
549
550
551
552
	if (c == NULL)
		return (0);

	/*
	 * This function does not handle EVP_AEAD.
	 * See ssl_cipher_get_aead_evp instead.
	 */
	if (c->algorithm_mac & SSL_AEAD)
		return(0);

	if ((enc == NULL) || (md == NULL))
		return (0);

	switch (c->algorithm_enc) {



	case SSL_3DES:
		i = SSL_ENC_3DES_IDX;
		break;
	case SSL_RC4:
		i = SSL_ENC_RC4_IDX;
		break;



	case SSL_eNULL:
		i = SSL_ENC_NULL_IDX;
		break;
	case SSL_AES128:
		i = SSL_ENC_AES128_IDX;
		break;
	case SSL_AES256:
		i = SSL_ENC_AES256_IDX;
		break;
	case SSL_CAMELLIA128:
		i = SSL_ENC_CAMELLIA128_IDX;
		break;
	case SSL_CAMELLIA256:
		i = SSL_ENC_CAMELLIA256_IDX;
		break;
	case SSL_eGOST2814789CNT:
		i = SSL_ENC_GOST89_IDX;
		break;






	default:
		i = -1;
		break;
	}

	if ((i < 0) || (i >= SSL_ENC_NUM_IDX))
		*enc = NULL;
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642

643

644
645


646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
	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;
	} 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];
	}

	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);
}

/*
 * ssl_cipher_get_evp_aead sets aead to point to the correct EVP_AEAD object
 * 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)
{
	const SSL_CIPHER *c = s->cipher;

	*aead = NULL;

	if (c == NULL)
		return 0;
	if ((c->algorithm2 & SSL_CIPHER_ALGORITHM2_AEAD) == 0)
		return 0;

	switch (c->algorithm_enc) {
#ifndef OPENSSL_NO_AES
	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;
	default:
		break;
	}
	return 0;







<
<








|
<
|
<
>

>
|
|
>
>
|
|
<
<
<
<
<
<
<
<
<
<
<
<
|
|
|















|



<






<







586
587
588
589
590
591
592


593
594
595
596
597
598
599
600
601

602

603
604
605
606
607
608
609
610
611












612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633

634
635
636
637
638
639

640
641
642
643
644
645
646
	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;


	} 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];
	}

	if (*enc == NULL || *md == NULL ||

	    (mac_pkey_type != NULL && *mac_pkey_type == NID_undef))

		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;

	return 1;
}

/*
 * ssl_cipher_get_evp_aead sets aead to point to the correct EVP_AEAD object
 * 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)
{
	const SSL_CIPHER *c = s->cipher;

	*aead = NULL;

	if (c == NULL)
		return 0;
	if ((c->algorithm_mac & SSL_AEAD) == 0)
		return 0;

	switch (c->algorithm_enc) {

	case SSL_AES128GCM:
		*aead = EVP_aead_aes_128_gcm();
		return 1;
	case SSL_AES256GCM:
		*aead = EVP_aead_aes_256_gcm();
		return 1;

	case SSL_CHACHA20POLY1305:
		*aead = EVP_aead_chacha20_poly1305();
		return 1;
	default:
		break;
	}
	return 0;
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
		*mkey |= SSL_kGOST;
	}

#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;







<


<


<
<







733
734
735
736
737
738
739

740
741

742
743


744
745
746
747
748
749
750
		*mkey |= SSL_kGOST;
	}

#ifdef SSL_FORBID_ENULL
	*enc |= SSL_eNULL;
#endif


	*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_AES128_IDX] == NULL) ? SSL_AES128 : 0;
	*enc |= (ssl_cipher_methods[SSL_ENC_AES256_IDX] == NULL) ? SSL_AES256 : 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;
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
		break;
	default:
		au = "unknown";
		break;
	}

	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;
	case SSL_AES128:
		enc = "AES(128)";
		break;
	case SSL_AES256:







<
<
<






<
<
<







1527
1528
1529
1530
1531
1532
1533



1534
1535
1536
1537
1538
1539



1540
1541
1542
1543
1544
1545
1546
		break;
	default:
		au = "unknown";
		break;
	}

	switch (alg_enc) {



	case SSL_3DES:
		enc = "3DES(168)";
		break;
	case SSL_RC4:
		enc = alg2 & SSL2_CF_8_BYTE_ENC ? "RC4(64)" : "RC4(128)";
		break;



	case SSL_eNULL:
		enc = "None";
		break;
	case SSL_AES128:
		enc = "AES(128)";
		break;
	case SSL_AES256:
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
		if (l >= len)
			ret = "Buffer too small";
	}

	return (ret);
}

char *
SSL_CIPHER_get_version(const SSL_CIPHER *c)
{
	if (c == NULL)
		return("(NONE)");
	if ((c->id >> 24) == 3)
		return("TLSv1/SSLv3");
	else







|







1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
		if (l >= len)
			ret = "Buffer too small";
	}

	return (ret);
}

const char *
SSL_CIPHER_get_version(const SSL_CIPHER *c)
{
	if (c == NULL)
		return("(NONE)");
	if ((c->id >> 24) == 3)
		return("TLSv1/SSLv3");
	else
Changes to jni/libressl/ssl/ssl_clnt.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_clnt.c,v 1.23 2018/02/08 11:30:30 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_clnt.c,v 1.34 2018/09/05 16:58:59 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.
 *
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
			if (ret <= 0)
				goto end;
			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 =







<


<
<
<
<
<
<







506
507
508
509
510
511
512

513
514






515
516
517
518
519
520
521
			if (ret <= 0)
				goto end;
			if (!SSL_IS_DTLS(s))
				s->s3->flags |= SSL3_FLAGS_CCS_OK;
			S3I(s)->hs.state = SSL3_ST_CW_FLUSH;

			/* clear flags */

			if (s->internal->hit) {
				S3I(s)->hs.next_state = SSL_ST_OK;






			} 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 =
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
			tls1_cleanup_key_block(s);

			if (!SSL_IS_DTLS(s)) {
				BUF_MEM_free(s->internal->init_buf);
				s->internal->init_buf = NULL;
			}

			/*
			 * 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)







<
<
<
<
<
|
<







584
585
586
587
588
589
590





591

592
593
594
595
596
597
598
			tls1_cleanup_key_block(s);

			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;
			s->internal->new_session = 0;

			ssl_update_cache(s, SSL_SESS_CACHE_CLIENT);
			if (s->internal->hit)
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
		 * If a DTLS ClientHello message is being resent after a
		 * HelloVerifyRequest, we must retain the original client
		 * random value.
		 */
		if (!SSL_IS_DTLS(s) || D1I(s)->send_cookie == 0)
			arc4random_buf(s->s3->client_random, SSL3_RANDOM_SIZE);

		if (!ssl3_handshake_msg_start_cbb(s, &cbb, &client_hello,
		    SSL3_MT_CLIENT_HELLO))
			goto err;

		/*
		 * Version indicates the negotiated version: for example from
		 * an SSLv2/v3 compatible client hello). The client_version
		 * field is the maximum version we permit and it is also







|







679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
		 * If a DTLS ClientHello message is being resent after a
		 * HelloVerifyRequest, we must retain the original client
		 * random value.
		 */
		if (!SSL_IS_DTLS(s) || D1I(s)->send_cookie == 0)
			arc4random_buf(s->s3->client_random, SSL3_RANDOM_SIZE);

		if (!ssl3_handshake_msg_start(s, &cbb, &client_hello,
		    SSL3_MT_CLIENT_HELLO))
			goto err;

		/*
		 * Version indicates the negotiated version: for example from
		 * an SSLv2/v3 compatible client hello). The client_version
		 * field is the maximum version we permit and it is also
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798

		/* TLS extensions */
		if (!tlsext_clienthello_build(s, &client_hello)) {
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			goto err;
		}

		if (!ssl3_handshake_msg_finish_cbb(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_B;
	}

	/* SSL3_ST_CW_CLNT_HELLO_B */
	return (ssl3_handshake_write(s));







|







771
772
773
774
775
776
777
778
779
780
781
782
783
784
785

		/* TLS extensions */
		if (!tlsext_clienthello_build(s, &client_hello)) {
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			goto err;
		}

		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_B;
	}

	/* SSL3_ST_CW_CLNT_HELLO_B */
	return (ssl3_handshake_write(s));
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
	X509_free(x);
	sk_X509_pop_free(sk, X509_free);

	return (ret);
}

static int
ssl3_get_server_kex_dhe(SSL *s, EVP_PKEY **pkey, unsigned char **pp, long *nn)
{
	CBS cbs, dhp, dhg, dhpk;
	BN_CTX *bn_ctx = NULL;
	SESS_CERT *sc = NULL;
	DH *dh = NULL;
	long alg_a;
	int al;

	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))
		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))
		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))
		goto truncated;
	if ((dh->pub_key = BN_bin2bn(CBS_data(&dhpk), CBS_len(&dhpk),
	    NULL)) == NULL) {
		SSLerror(s, ERR_R_BN_LIB);
		goto err;
	}








|

|









<
<
<
<
<





|






|






|







1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203





1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
	X509_free(x);
	sk_X509_pop_free(sk, X509_free);

	return (ret);
}

static int
ssl3_get_server_kex_dhe(SSL *s, EVP_PKEY **pkey, CBS *cbs)
{
	CBS dhp, dhg, dhpk;
	BN_CTX *bn_ctx = NULL;
	SESS_CERT *sc = NULL;
	DH *dh = NULL;
	long alg_a;
	int al;

	alg_a = S3I(s)->hs.new_cipher->algorithm_auth;
	sc = SSI(s)->sess_cert;






	if ((dh = DH_new()) == NULL) {
		SSLerror(s, ERR_R_DH_LIB);
		goto err;
	}

	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))
		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))
		goto truncated;
	if ((dh->pub_key = BN_bin2bn(CBS_data(&dhpk), CBS_len(&dhpk),
	    NULL)) == NULL) {
		SSLerror(s, ERR_R_BN_LIB);
		goto err;
	}

1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
		*pkey = X509_get_pubkey(sc->peer_pkeys[SSL_PKEY_RSA_ENC].x509);
	else
		/* XXX - Anonymous DH, so no certificate or pkey. */
		*pkey = NULL;

	sc->peer_dh_tmp = dh;

	*nn = CBS_len(&cbs);
	*pp = (unsigned char *)CBS_data(&cbs);

	return (1);

 truncated:
	al = SSL_AD_DECODE_ERROR;
	SSLerror(s, SSL_R_BAD_PACKET_LENGTH);
	ssl3_send_alert(s, SSL3_AL_FATAL, al);








<
<
<







1241
1242
1243
1244
1245
1246
1247



1248
1249
1250
1251
1252
1253
1254
		*pkey = X509_get_pubkey(sc->peer_pkeys[SSL_PKEY_RSA_ENC].x509);
	else
		/* XXX - Anonymous DH, so no certificate or pkey. */
		*pkey = NULL;

	sc->peer_dh_tmp = dh;




	return (1);

 truncated:
	al = SSL_AD_DECODE_ERROR;
	SSLerror(s, SSL_R_BAD_PACKET_LENGTH);
	ssl3_send_alert(s, SSL3_AL_FATAL, al);

1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
	return (1);

 err:
	return (-1);
}

static int
ssl3_get_server_kex_ecdhe(SSL *s, EVP_PKEY **pkey, unsigned char **pp, long *nn)
{
	CBS cbs, public;
	uint8_t curve_type;
	uint16_t curve_id;
	SESS_CERT *sc;
	long alg_a;
	int nid;
	int al;

	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) ||
	    curve_type != NAMED_CURVE_TYPE ||
	    !CBS_get_u16(&cbs, &curve_id)) {
		al = SSL_AD_DECODE_ERROR;
		SSLerror(s, SSL_R_LENGTH_TOO_SHORT);
		goto f_err;
	}

	/*
	 * Check that the curve is one of our preferences - if it is not,







|

|










<
<
<
<
<

|

|







1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360





1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
	return (1);

 err:
	return (-1);
}

static int
ssl3_get_server_kex_ecdhe(SSL *s, EVP_PKEY **pkey, CBS *cbs)
{
	CBS public;
	uint8_t curve_type;
	uint16_t curve_id;
	SESS_CERT *sc;
	long alg_a;
	int nid;
	int al;

	alg_a = S3I(s)->hs.new_cipher->algorithm_auth;
	sc = SSI(s)->sess_cert;






	/* Only named curves are supported. */
	if (!CBS_get_u8(cbs, &curve_type) ||
	    curve_type != NAMED_CURVE_TYPE ||
	    !CBS_get_u16(cbs, &curve_id)) {
		al = SSL_AD_DECODE_ERROR;
		SSLerror(s, SSL_R_LENGTH_TOO_SHORT);
		goto f_err;
	}

	/*
	 * Check that the curve is one of our preferences - if it is not,
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419

	if ((nid = tls1_ec_curve_id2nid(curve_id)) == 0) {
		al = SSL_AD_INTERNAL_ERROR;
		SSLerror(s, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS);
		goto f_err;
	}

	if (!CBS_get_u8_length_prefixed(&cbs, &public))
		goto truncated;

	if (nid == NID_X25519) {
		if (ssl3_get_server_kex_ecdhe_ecx(s, sc, nid, &public) != 1)
			goto err;
	} else {
		if (ssl3_get_server_kex_ecdhe_ecp(s, sc, nid, &public) != 1)







|







1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393

	if ((nid = tls1_ec_curve_id2nid(curve_id)) == 0) {
		al = SSL_AD_INTERNAL_ERROR;
		SSLerror(s, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS);
		goto f_err;
	}

	if (!CBS_get_u8_length_prefixed(cbs, &public))
		goto truncated;

	if (nid == NID_X25519) {
		if (ssl3_get_server_kex_ecdhe_ecx(s, sc, nid, &public) != 1)
			goto err;
	} else {
		if (ssl3_get_server_kex_ecdhe_ecp(s, sc, nid, &public) != 1)
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454

1455

1456
1457
1458
1459


1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475


1476

1477
1478
1479
1480
1481
1482
1483
		*pkey = X509_get_pubkey(sc->peer_pkeys[SSL_PKEY_RSA_ENC].x509);
	else if (alg_a & SSL_aECDSA)
		*pkey = X509_get_pubkey(sc->peer_pkeys[SSL_PKEY_ECC].x509);
	else
		/* XXX - Anonymous ECDH, so no certificate or pkey. */
		*pkey = NULL;

	*nn = CBS_len(&cbs);
	*pp = (unsigned char *)CBS_data(&cbs);

	return (1);

 truncated:
	al = SSL_AD_DECODE_ERROR;
	SSLerror(s, SSL_R_BAD_PACKET_LENGTH);

 f_err:
	ssl3_send_alert(s, SSL3_AL_FATAL, al);

 err:
	return (-1);
}

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;

	alg_k = S3I(s)->hs.new_cipher->algorithm_mkey;
	alg_a = S3I(s)->hs.new_cipher->algorithm_auth;

	/*
	 * Use same message size as in ssl3_get_certificate_request()
	 * as ServerKeyExchange message may be skipped.
	 */
	n = s->method->internal->ssl_get_message(s, SSL3_ST_CR_KEY_EXCH_A,
	    SSL3_ST_CR_KEY_EXCH_B, -1, s->internal->max_cert_list, &ok);
	if (!ok)
		return ((int)n);



	EVP_MD_CTX_init(&md_ctx);


	if (S3I(s)->tmp.message_type != SSL3_MT_SERVER_KEY_EXCHANGE) {
		/*
		 * Do not skip server key exchange if this cipher suite uses
		 * ephemeral keys.
		 */
		if (alg_k & (SSL_kDHE|SSL_kECDHE)) {







<
<
<
















>
|
>
|
|
|
|
>
>
|
|
<













>
>
|
>







1403
1404
1405
1406
1407
1408
1409



1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436

1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
		*pkey = X509_get_pubkey(sc->peer_pkeys[SSL_PKEY_RSA_ENC].x509);
	else if (alg_a & SSL_aECDSA)
		*pkey = X509_get_pubkey(sc->peer_pkeys[SSL_PKEY_ECC].x509);
	else
		/* XXX - Anonymous ECDH, so no certificate or pkey. */
		*pkey = NULL;




	return (1);

 truncated:
	al = SSL_AD_DECODE_ERROR;
	SSLerror(s, SSL_R_BAD_PACKET_LENGTH);

 f_err:
	ssl3_send_alert(s, SSL3_AL_FATAL, al);

 err:
	return (-1);
}

int
ssl3_get_server_key_exchange(SSL *s)
{
	CBS cbs, signature;
	const EVP_MD *md = NULL;
	EVP_PKEY *pkey = NULL;
	EVP_MD_CTX md_ctx;
	const unsigned char *param;
	uint8_t hash_id, sig_id;
	long n, alg_k, alg_a;
	int al, ok, sigalg;
	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;

	/*
	 * Use same message size as in ssl3_get_certificate_request()
	 * as ServerKeyExchange message may be skipped.
	 */
	n = s->method->internal->ssl_get_message(s, SSL3_ST_CR_KEY_EXCH_A,
	    SSL3_ST_CR_KEY_EXCH_B, -1, s->internal->max_cert_list, &ok);
	if (!ok)
		return ((int)n);

	if (n < 0)
		goto err;

	CBS_init(&cbs, s->internal->init_msg, n);

	if (S3I(s)->tmp.message_type != SSL3_MT_SERVER_KEY_EXCHANGE) {
		/*
		 * Do not skip server key exchange if this cipher suite uses
		 * ephemeral keys.
		 */
		if (alg_k & (SSL_kDHE|SSL_kECDHE)) {
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528












1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557

1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603

1604

1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617

1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
		SSI(s)->sess_cert->peer_x25519_tmp = NULL;
	} else {
		SSI(s)->sess_cert = ssl_sess_cert_new();
		if (SSI(s)->sess_cert == NULL)
			goto err;
	}

	param = p = (unsigned char *)s->internal->init_msg;
	param_len = n;

	if (alg_k & SSL_kDHE) {
		if (ssl3_get_server_kex_dhe(s, &pkey, &p, &n) != 1)
			goto err;
	} else if (alg_k & SSL_kECDHE) {
		if (ssl3_get_server_kex_ecdhe(s, &pkey, &p, &n) != 1)
			goto err;
	} else if (alg_k != 0) {
		al = SSL_AD_UNEXPECTED_MESSAGE;
		SSLerror(s, SSL_R_UNEXPECTED_MESSAGE);
			goto f_err;
	}

	param_len = param_len - n;

	/* if it was signed, check the signature */
	if (pkey != NULL) {
		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)
				goto truncated;
			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;
		} else
			md = EVP_sha1();

		if (2 > n)

			goto truncated;
		n2s(p, i);
		n -= 2;
		j = EVP_PKEY_size(pkey);

		if (i != n || n > j) {
			/* wrong packet length */
			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;
			}
		}
	} else {
		/* aNULL does not need public keys. */
		if (!(alg_a & SSL_aNULL)) {
			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;
		}
	}

	EVP_PKEY_free(pkey);
	EVP_MD_CTX_cleanup(&md_ctx);

	return (1);

 truncated:
	/* wrong packet length */
	al = SSL_AD_DECODE_ERROR;
	SSLerror(s, SSL_R_BAD_PACKET_LENGTH);

 f_err:
	ssl3_send_alert(s, SSL3_AL_FATAL, al);

 err:
	EVP_PKEY_free(pkey);
	RSA_free(rsa);
	EVP_MD_CTX_cleanup(&md_ctx);

	return (-1);
}

int
ssl3_get_certificate_request(SSL *s)







|
|


|


|







|




>
>
>
>
>
>
>
>
>
>
>
>
|
|
<



<
<
<
<
<
<
|




<
|
<
<
<
<
|
<
|

|
|
>

<
<
|
<
<
<





<
<
<
|
<
|
<
|
|
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
|
|
>
|
>
|
|
|
|
|
<







>
|
|
|
|
|
<








<








<







1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519

1520
1521
1522






1523
1524
1525
1526
1527

1528




1529

1530
1531
1532
1533
1534
1535


1536



1537
1538
1539
1540
1541



1542

1543

1544
1545











1546











1547
1548
1549
1550
1551
1552
1553
1554
1555
1556

1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569

1570
1571
1572
1573
1574
1575
1576
1577

1578
1579
1580
1581
1582
1583
1584
1585

1586
1587
1588
1589
1590
1591
1592
		SSI(s)->sess_cert->peer_x25519_tmp = NULL;
	} else {
		SSI(s)->sess_cert = ssl_sess_cert_new();
		if (SSI(s)->sess_cert == NULL)
			goto err;
	}

	param = CBS_data(&cbs);
	param_len = CBS_len(&cbs);

	if (alg_k & SSL_kDHE) {
		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, &cbs) != 1)
			goto err;
	} else if (alg_k != 0) {
		al = SSL_AD_UNEXPECTED_MESSAGE;
		SSLerror(s, SSL_R_UNEXPECTED_MESSAGE);
			goto f_err;
	}

	param_len -= CBS_len(&cbs);

	/* if it was signed, check the signature */
	if (pkey != NULL) {
		if (SSL_USE_SIGALGS(s)) {
			if (!CBS_get_u8(&cbs, &hash_id))
				goto truncated;
			if (!CBS_get_u8(&cbs, &sig_id))
				goto truncated;

			if ((md = tls12_get_hash(hash_id)) == NULL) {
				SSLerror(s, SSL_R_UNKNOWN_DIGEST);
				al = SSL_AD_DECODE_ERROR;
				goto f_err;
			}

			/* Check key type is consistent with signature. */
			if ((sigalg = tls12_get_sigid(pkey)) == -1) {
				/* Should never happen */

				SSLerror(s, ERR_R_INTERNAL_ERROR);
				goto err;
			}






			if (sigalg != sig_id) {
				SSLerror(s, SSL_R_WRONG_SIGNATURE_TYPE);
				al = SSL_AD_DECODE_ERROR;
				goto f_err;
			}

		} else if (pkey->type == EVP_PKEY_RSA) {




			md = EVP_md5_sha1();

		} else {
			md = EVP_sha1();
		}

		if (!CBS_get_u16_length_prefixed(&cbs, &signature))
			goto truncated;


		if (CBS_len(&signature) > EVP_PKEY_size(pkey)) {



			al = SSL_AD_DECODE_ERROR;
			SSLerror(s, SSL_R_WRONG_SIGNATURE_LENGTH);
			goto f_err;
		}




		if (!EVP_VerifyInit_ex(&md_ctx, md, NULL))

			goto err;

		if (!EVP_VerifyUpdate(&md_ctx, s->s3->client_random,
		    SSL3_RANDOM_SIZE))











			goto err;











		if (!EVP_VerifyUpdate(&md_ctx, s->s3->server_random,
		    SSL3_RANDOM_SIZE))
			goto err;
		if (!EVP_VerifyUpdate(&md_ctx, param, param_len))
			goto err;
		if (EVP_VerifyFinal(&md_ctx, CBS_data(&signature),
		    CBS_len(&signature), pkey) <= 0) {
			al = SSL_AD_DECRYPT_ERROR;
			SSLerror(s, SSL_R_BAD_SIGNATURE);
			goto f_err;

		}
	} else {
		/* aNULL does not need public keys. */
		if (!(alg_a & SSL_aNULL)) {
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			goto 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);
	EVP_MD_CTX_cleanup(&md_ctx);

	return (1);

 truncated:

	al = SSL_AD_DECODE_ERROR;
	SSLerror(s, SSL_R_BAD_PACKET_LENGTH);

 f_err:
	ssl3_send_alert(s, SSL3_AL_FATAL, al);

 err:
	EVP_PKEY_free(pkey);

	EVP_MD_CTX_cleanup(&md_ctx);

	return (-1);
}

int
ssl3_get_certificate_request(SSL *s)
2058
2059
2060
2061
2062
2063
2064
2065



2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
		SSLerror(s, ERR_R_DH_LIB);
		goto err;
	}
	if (!DH_generate_key(dh_clnt)) {
		SSLerror(s, ERR_R_DH_LIB);
		goto err;
	}
	key_size = DH_size(dh_clnt);



	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) {
		SSLerror(s, ERR_R_DH_LIB);
		goto err;
	}

	/* Generate master key from the result. */
	s->session->master_key_length =
	    tls1_generate_master_secret(s,







|
>
>
>




|
<







2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017

2018
2019
2020
2021
2022
2023
2024
		SSLerror(s, ERR_R_DH_LIB);
		goto err;
	}
	if (!DH_generate_key(dh_clnt)) {
		SSLerror(s, ERR_R_DH_LIB);
		goto err;
	}
	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;
	}
	if ((key_len = DH_compute_key(key, dh_srvr->pub_key, dh_clnt)) <= 0) {

		SSLerror(s, ERR_R_DH_LIB);
		goto err;
	}

	/* Generate master key from the result. */
	s->session->master_key_length =
	    tls1_generate_master_secret(s,
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138

2139
2140
2141
2142
2143
2144
2145

	if (!EC_KEY_set_group(ecdh, group)) {
		SSLerror(s, ERR_R_EC_LIB);
		goto err;
	}

	/* Generate a new ECDH key pair. */
	if (!(EC_KEY_generate_key(ecdh))) {
		SSLerror(s, ERR_R_ECDH_LIB);
		goto err;
	}
	if ((key_size = ECDH_size(ecdh)) <= 0) {
		SSLerror(s, ERR_R_ECDH_LIB);
		goto err;
	}
	if ((key = malloc(key_size)) == NULL) {
		SSLerror(s, ERR_R_MALLOC_FAILURE);

	}
	key_len = ECDH_compute_key(key, key_size, point, ecdh, NULL);
	if (key_len <= 0) {
		SSLerror(s, ERR_R_ECDH_LIB);
		goto err;
	}








|









>







2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092

	if (!EC_KEY_set_group(ecdh, group)) {
		SSLerror(s, ERR_R_EC_LIB);
		goto err;
	}

	/* Generate a new ECDH key pair. */
	if (!EC_KEY_generate_key(ecdh)) {
		SSLerror(s, ERR_R_ECDH_LIB);
		goto err;
	}
	if ((key_size = ECDH_size(ecdh)) <= 0) {
		SSLerror(s, ERR_R_ECDH_LIB);
		goto err;
	}
	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) {
		SSLerror(s, ERR_R_ECDH_LIB);
		goto err;
	}

2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
			ERR_clear_error();
		}
	}

	/*
	 * Compute shared IV and store it in algorithm-specific context data.
	 */
	ukm_hash = EVP_MD_CTX_create();
	if (ukm_hash == NULL) {
		SSLerror(s, ERR_R_MALLOC_FAILURE);
		goto err;
	}

	if (ssl_get_algorithm2(s) & SSL_HANDSHAKE_MAC_GOST94)
		nid = NID_id_GostR3411_94;
	else
		nid = NID_id_tc26_gost3411_2012_256;
	if (!EVP_DigestInit(ukm_hash, EVP_get_digestbynid(nid)))
		goto err;
	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);
	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);
		goto err;
	}

	/*







|














|







2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
			ERR_clear_error();
		}
	}

	/*
	 * Compute shared IV and store it in algorithm-specific context data.
	 */
	ukm_hash = EVP_MD_CTX_new();
	if (ukm_hash == NULL) {
		SSLerror(s, ERR_R_MALLOC_FAILURE);
		goto err;
	}

	if (ssl_get_algorithm2(s) & SSL_HANDSHAKE_MAC_GOST94)
		nid = NID_id_GostR3411_94;
	else
		nid = NID_id_tc26_gost3411_2012_256;
	if (!EVP_DigestInit(ukm_hash, EVP_get_digestbynid(nid)))
		goto err;
	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_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);
		goto err;
	}

	/*
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
		if ((sess_cert = SSI(s)->sess_cert) == NULL) {
			ssl3_send_alert(s, SSL3_AL_FATAL,
			    SSL_AD_UNEXPECTED_MESSAGE);
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			goto err;
		}

		if (!ssl3_handshake_msg_start_cbb(s, &cbb, &kex,
		    SSL3_MT_CLIENT_KEY_EXCHANGE))
			goto err;

		if (alg_k & SSL_kRSA) {
			if (ssl3_send_client_kex_rsa(s, sess_cert, &kex) != 1)
				goto err;
		} else if (alg_k & SSL_kDHE) {







|







2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
		if ((sess_cert = SSI(s)->sess_cert) == NULL) {
			ssl3_send_alert(s, SSL3_AL_FATAL,
			    SSL_AD_UNEXPECTED_MESSAGE);
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			goto err;
		}

		if (!ssl3_handshake_msg_start(s, &cbb, &kex,
		    SSL3_MT_CLIENT_KEY_EXCHANGE))
			goto err;

		if (alg_k & SSL_kRSA) {
			if (ssl3_send_client_kex_rsa(s, sess_cert, &kex) != 1)
				goto err;
		} else if (alg_k & SSL_kDHE) {
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417


2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428


2429

2430

2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442



2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463

2464
2465
2466
2467
2468
2469
2470
2471
2472

2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507

2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531



2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543



2544
2545



2546
2547
2548
2549

2550
2551
2552
2553

2554
2555


2556
2557
2558
2559
2560
2561
2562
		} else {
			ssl3_send_alert(s, SSL3_AL_FATAL,
			    SSL_AD_HANDSHAKE_FAILURE);
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			goto err;
		}

		if (!ssl3_handshake_msg_finish_cbb(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_CW_KEY_EXCH_B;
	}

	/* SSL3_ST_CW_KEY_EXCH_B */
	return (ssl3_handshake_write(s));

err:
	CBB_cleanup(&cbb);

	return (-1);
}

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;

	EVP_MD_CTX_init(&mctx);



	if (S3I(s)->hs.state == SSL3_ST_CW_CERT_VRFY_A) {

		p = ssl3_handshake_msg_start(s, SSL3_MT_CERTIFICATE_VERIFY);


		/*
		 * 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))
				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);
				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);
				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);
				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;




		ssl3_handshake_msg_finish(s, n);



	}

	EVP_MD_CTX_cleanup(&mctx);
	EVP_PKEY_CTX_free(pctx);


	return (ssl3_handshake_write(s));

err:

	EVP_MD_CTX_cleanup(&mctx);
	EVP_PKEY_CTX_free(pctx);


	return (-1);
}

int
ssl3_send_client_certificate(SSL *s)
{
	EVP_PKEY *pkey = NULL;







|

















>
>
|
|
|
|
|
|
|
|



>
>

>
|
>












>
>
>
















<
<
<


>

|



<


|
>



<
<




|
|



<
<


|
<
|



<
<


|

<
<
<
|

>
















|
|
<
|
|



>
>
>


<
<
<






|
>
>
>

|
>
>
>




>



|
>


>
>







2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414



2415
2416
2417
2418
2419
2420
2421
2422

2423
2424
2425
2426
2427
2428
2429


2430
2431
2432
2433
2434
2435
2436
2437
2438


2439
2440
2441

2442
2443
2444
2445


2446
2447
2448
2449



2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470

2471
2472
2473
2474
2475
2476
2477
2478
2479
2480



2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
		} else {
			ssl3_send_alert(s, SSL3_AL_FATAL,
			    SSL_AD_HANDSHAKE_FAILURE);
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			goto err;
		}

		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_CW_KEY_EXCH_B;
	}

	/* SSL3_ST_CW_KEY_EXCH_B */
	return (ssl3_handshake_write(s));

err:
	CBB_cleanup(&cbb);

	return (-1);
}

int
ssl3_send_client_verify(SSL *s)
{
	CBB cbb, cert_verify, cbb_signature;
	unsigned char data[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH];
	unsigned char *signature = NULL;
	unsigned int signature_len;
	EVP_PKEY_CTX *pctx = NULL;
	EVP_PKEY *pkey;
	EVP_MD_CTX mctx;
	const EVP_MD *md;
	long hdatalen;
	void *hdata;

	EVP_MD_CTX_init(&mctx);

	memset(&cbb, 0, sizeof(cbb));

	if (S3I(s)->hs.state == SSL3_ST_CW_CERT_VRFY_A) {
		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 ((signature = calloc(1, EVP_PKEY_size(pkey))) == NULL)
			goto err;

		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)) {



			hdatalen = BIO_get_mem_data(S3I(s)->handshake_buffer,
			    &hdata);
			md = s->cert->key->digest;
			if (hdatalen <= 0 ||
			    !tls12_get_hashandsig(&cert_verify, pkey, md)) {
				SSLerror(s, ERR_R_INTERNAL_ERROR);
				goto err;
			}

			if (!EVP_SignInit_ex(&mctx, md, NULL) ||
			    !EVP_SignUpdate(&mctx, hdata, hdatalen) ||
			    !EVP_SignFinal(&mctx, signature, &signature_len,
				pkey)) {
				SSLerror(s, ERR_R_EVP_LIB);
				goto err;
			}


			if (!tls1_digest_cached_records(s))
				goto err;
		} else if (pkey->type == EVP_PKEY_RSA) {
			if (RSA_sign(NID_md5_sha1, data,
			    MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, signature,
			    &signature_len, pkey->pkey.rsa) <= 0 ) {
				SSLerror(s, ERR_R_RSA_LIB);
				goto err;
			}


		} else if (pkey->type == EVP_PKEY_EC) {
			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;
			}


#ifndef OPENSSL_NO_GOST
		} else if (pkey->type == NID_id_GostR3410_94 ||
		    pkey->type == NID_id_GostR3410_2001) {
			unsigned char signbuf[128];



			unsigned int u;
			size_t sigsize;
			int nid;

			hdatalen = BIO_get_mem_data(S3I(s)->handshake_buffer, &hdata);
			if (hdatalen <= 0) {
				SSLerror(s, ERR_R_INTERNAL_ERROR);
				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, signature, &sigsize,
				signbuf, u) <= 0)) {
				SSLerror(s, ERR_R_EVP_LIB);
				goto err;
			}
			if (sigsize > UINT_MAX)
				goto err;
			signature_len = sigsize;
			if (!tls1_digest_cached_records(s))
				goto err;



#endif
		} else {
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			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 (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_CW_CERT_VRFY_B;
	}

	EVP_MD_CTX_cleanup(&mctx);
	EVP_PKEY_CTX_free(pctx);
	free(signature);

	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);
	EVP_MD_CTX_cleanup(&mctx);
	EVP_PKEY_CTX_free(pctx);
	free(signature);

	return (-1);
}

int
ssl3_send_client_certificate(SSL *s)
{
	EVP_PKEY *pkey = NULL;
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
			S3I(s)->tmp.cert_req = 2;

		/* 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,
		    SSL3_MT_CERTIFICATE))
			goto err;
		if (!ssl3_output_cert_chain(s, &client_cert,
		    (S3I(s)->tmp.cert_req == 2) ? NULL : s->cert->key->x509))
			goto err;
		if (!ssl3_handshake_msg_finish_cbb(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_CW_CERT_D;
	}

	/* SSL3_ST_CW_CERT_D */
	return (ssl3_handshake_write(s));







|





|







2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
			S3I(s)->tmp.cert_req = 2;

		/* 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(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))
			goto err;
		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_CW_CERT_D;
	}

	/* SSL3_ST_CW_CERT_D */
	return (ssl3_handshake_write(s));
Changes to jni/libressl/ssl/ssl_init.c.

1
2
3
4
5
6
7

/*
 * Copyright (c) 2018 Bob Beck <beck@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/* $OpenBSD: ssl_init.c,v 1.2 2018/03/30 14:59:46 jsing Exp $ */
/*
 * Copyright (c) 2018 Bob Beck <beck@openbsd.org>
 *
 * 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.
 *
Changes to jni/libressl/ssl/ssl_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_lib.c,v 1.182 2018/03/17 16:20:01 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_lib.c,v 1.189 2018/09/05 16:58:59 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.
 *
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
	s->client_version = s->version;
	s->internal->rwstate = SSL_NOTHING;
	s->internal->rstate = SSL_ST_READ_HEADER;

	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);

	s->internal->first_packet = 0;

	/*
	 * Check to see if we were changed into a different method, if
	 * so, revert back if we are not doing session-id reuse.
	 */







|
<
<







187
188
189
190
191
192
193
194


195
196
197
198
199
200
201
	s->client_version = s->version;
	s->internal->rwstate = SSL_NOTHING;
	s->internal->rstate = SSL_ST_READ_HEADER;

	BUF_MEM_free(s->internal->init_buf);
	s->internal->init_buf = NULL;

	ssl_clear_cipher_state(s);



	s->internal->first_packet = 0;

	/*
	 * Check to see if we were changed into a different method, if
	 * so, revert back if we are not doing session-id reuse.
	 */
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546

	/* Make the next call work :-) */
	if (s->session != NULL) {
		ssl_clear_bad_session(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_cert_free(s->cert);

	free(s->tlsext_hostname);
	SSL_CTX_free(s->initial_ctx);

	free(s->internal->tlsext_ecpointformatlist);







|
<
<







528
529
530
531
532
533
534
535


536
537
538
539
540
541
542

	/* Make the next call work :-) */
	if (s->session != NULL) {
		ssl_clear_bad_session(s);
		SSL_SESSION_free(s->session);
	}

	ssl_clear_cipher_state(s);



	ssl_cert_free(s->cert);

	free(s->tlsext_hostname);
	SSL_CTX_free(s->initial_ctx);

	free(s->internal->tlsext_ecpointformatlist);
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
	 * SSL_pending cannot work properly if read-ahead is enabled
	 * (SSL_[CTX_]ctrl(..., SSL_CTRL_SET_READ_AHEAD, 1, NULL)),
	 * and it is impossible to fix since SSL_pending cannot report
	 * errors that may be observed while scanning the new data.
	 * (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));
}

X509 *
SSL_get_peer_certificate(const SSL *s)
{
	X509	*r;








|







801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
	 * SSL_pending cannot work properly if read-ahead is enabled
	 * (SSL_[CTX_]ctrl(..., SSL_CTRL_SET_READ_AHEAD, 1, NULL)),
	 * and it is impossible to fix since SSL_pending cannot report
	 * errors that may be observed while scanning the new data.
	 * (Note that SSL_pending() is often used as a boolean value,
	 * so we'd better not return -1.)
	 */
	return (ssl3_pending(s));
}

X509 *
SSL_get_peer_certificate(const SSL *s)
{
	X509	*r;

849
850
851
852
853
854
855
856
857
858
859
860
861
862

863
864
865
866
867
868
869
870
871

872
873
874
875
876
877
878
879
880

881



882
883
884
885
886
887
888
	return (r);
}

/*
 * 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
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));


	/*
	 * What if we are setup as SSLv2 but want to talk SSLv3 or
	 * vice-versa.
	 */
	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 */

	}

	tmp = t->cert;
	if (f->cert != NULL) {
		CRYPTO_add(&f->cert->references, 1, CRYPTO_LOCK_SSL_CERT);
		t->cert = f->cert;
	} else
		t->cert = NULL;
	ssl_cert_free(tmp);

	SSL_set_session_id_context(t, f->sid_ctx, f->sid_ctx_length);



}

/* Fix this so it checks all the valid key/cert options */
int
SSL_CTX_check_private_key(const SSL_CTX *ctx)
{
	if ((ctx == NULL) || (ctx->internal->cert == NULL) ||







|




|
|
>

<
|
<
<

|
|
|
>









>
|
>
>
>







845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860

861


862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
	return (r);
}

/*
 * 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
 */
int
SSL_copy_session_id(SSL *t, const SSL *f)
{
	CERT	*tmp;

	/* Do we need to do SSL locking? */
	if (!SSL_set_session(t, SSL_get_session(f)))
		return 0;


	/* 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);
		t->method = f->method;
		if (!t->method->internal->ssl_new(t))
			return 0;
	}

	tmp = t->cert;
	if (f->cert != NULL) {
		CRYPTO_add(&f->cert->references, 1, CRYPTO_LOCK_SSL_CERT);
		t->cert = f->cert;
	} else
		t->cert = NULL;
	ssl_cert_free(tmp);

	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 */
int
SSL_CTX_check_private_key(const SSL_CTX *ctx)
{
	if ((ctx == NULL) || (ctx->internal->cert == NULL) ||
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
		return (-1);
	}

	if (s->internal->shutdown & SSL_RECEIVED_SHUTDOWN) {
		s->internal->rwstate = SSL_NOTHING;
		return (0);
	}
	return (s->method->internal->ssl_read(s, buf, num));
}

int
SSL_peek(SSL *s, void *buf, int num)
{
	if (s->internal->handshake_func == NULL) {
		SSLerror(s, SSL_R_UNINITIALIZED);
		return (-1);
	}

	if (s->internal->shutdown & SSL_RECEIVED_SHUTDOWN) {
		return (0);
	}
	return (s->method->internal->ssl_peek(s, buf, num));
}

int
SSL_write(SSL *s, const void *buf, int num)
{
	if (s->internal->handshake_func == NULL) {
		SSLerror(s, SSL_R_UNINITIALIZED);
		return (-1);
	}

	if (s->internal->shutdown & SSL_SENT_SHUTDOWN) {
		s->internal->rwstate = SSL_NOTHING;
		SSLerror(s, SSL_R_PROTOCOL_IS_SHUTDOWN);
		return (-1);
	}
	return (s->method->internal->ssl_write(s, buf, num));
}

int
SSL_shutdown(SSL *s)
{
	/*
	 * Note that this function behaves differently from what one might
	 * expect.  Return values are 0 for no success (yet),
	 * 1 for success; but calling it once is usually not enough,
	 * even if blocking I/O is used (see ssl3_shutdown).
	 */

	if (s->internal->handshake_func == NULL) {
		SSLerror(s, SSL_R_UNINITIALIZED);
		return (-1);
	}

	if ((s != NULL) && !SSL_in_init(s))
		return (s->method->internal->ssl_shutdown(s));
	else
		return (1);
}

int
SSL_renegotiate(SSL *s)
{
	if (s->internal->renegotiate == 0)
		s->internal->renegotiate = 1;







|













|















|

















|
|
|
|







959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
		return (-1);
	}

	if (s->internal->shutdown & SSL_RECEIVED_SHUTDOWN) {
		s->internal->rwstate = SSL_NOTHING;
		return (0);
	}
	return ssl3_read(s, buf, num);
}

int
SSL_peek(SSL *s, void *buf, int num)
{
	if (s->internal->handshake_func == NULL) {
		SSLerror(s, SSL_R_UNINITIALIZED);
		return (-1);
	}

	if (s->internal->shutdown & SSL_RECEIVED_SHUTDOWN) {
		return (0);
	}
	return ssl3_peek(s, buf, num);
}

int
SSL_write(SSL *s, const void *buf, int num)
{
	if (s->internal->handshake_func == NULL) {
		SSLerror(s, SSL_R_UNINITIALIZED);
		return (-1);
	}

	if (s->internal->shutdown & SSL_SENT_SHUTDOWN) {
		s->internal->rwstate = SSL_NOTHING;
		SSLerror(s, SSL_R_PROTOCOL_IS_SHUTDOWN);
		return (-1);
	}
	return ssl3_write(s, buf, num);
}

int
SSL_shutdown(SSL *s)
{
	/*
	 * Note that this function behaves differently from what one might
	 * expect.  Return values are 0 for no success (yet),
	 * 1 for success; but calling it once is usually not enough,
	 * even if blocking I/O is used (see ssl3_shutdown).
	 */

	if (s->internal->handshake_func == NULL) {
		SSLerror(s, SSL_R_UNINITIALIZED);
		return (-1);
	}

	if (s != NULL && !SSL_in_init(s))
		return (ssl3_shutdown(s));

	return (1);
}

int
SSL_renegotiate(SSL *s)
{
	if (s->internal->renegotiate == 0)
		s->internal->renegotiate = 1;
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987

#ifndef OPENSSL_NO_SRTP
	if (ctx->internal->srtp_profiles)
		sk_SRTP_PROTECTION_PROFILE_free(ctx->internal->srtp_profiles);
#endif

#ifndef OPENSSL_NO_ENGINE
	if (ctx->internal->client_cert_engine)
		ENGINE_finish(ctx->internal->client_cert_engine);
#endif

	free(ctx->internal->tlsext_ecpointformatlist);
	free(ctx->internal->tlsext_supportedgroups);

	free(ctx->internal->alpn_client_proto_list);








<
|







1971
1972
1973
1974
1975
1976
1977

1978
1979
1980
1981
1982
1983
1984
1985

#ifndef OPENSSL_NO_SRTP
	if (ctx->internal->srtp_profiles)
		sk_SRTP_PROTECTION_PROFILE_free(ctx->internal->srtp_profiles);
#endif

#ifndef OPENSSL_NO_ENGINE

	ENGINE_finish(ctx->internal->client_cert_engine);
#endif

	free(ctx->internal->tlsext_ecpointformatlist);
	free(ctx->internal->tlsext_supportedgroups);

	free(ctx->internal->alpn_client_proto_list);

2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
void
SSL_set_accept_state(SSL *s)
{
	s->server = 1;
	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);
}

void
SSL_set_connect_state(SSL *s)
{
	s->server = 0;
	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);
}

int
ssl_undefined_function(SSL *s)
{
	SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
	return (0);







<
|
<
<









<
|
<
<







2423
2424
2425
2426
2427
2428
2429

2430


2431
2432
2433
2434
2435
2436
2437
2438
2439

2440


2441
2442
2443
2444
2445
2446
2447
void
SSL_set_accept_state(SSL *s)
{
	s->server = 1;
	s->internal->shutdown = 0;
	S3I(s)->hs.state = SSL_ST_ACCEPT|SSL_ST_BEFORE;
	s->internal->handshake_func = s->method->internal->ssl_accept;

	ssl_clear_cipher_state(s);


}

void
SSL_set_connect_state(SSL *s)
{
	s->server = 0;
	s->internal->shutdown = 0;
	S3I(s)->hs.state = SSL_ST_CONNECT|SSL_ST_BEFORE;
	s->internal->handshake_func = s->method->internal->ssl_connect;

	ssl_clear_cipher_state(s);


}

int
ssl_undefined_function(SSL *s)
{
	SSLerror(s, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
	return (0);
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512

2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533

2534
2535
2536
2537
2538
2539
2540
{
	STACK_OF(X509_NAME) *sk;
	X509_NAME *xn;
	SSL *ret;
	int i;

	if ((ret = SSL_new(SSL_get_SSL_CTX(s))) == NULL)
		return (NULL);

	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);

	} else {
		/*
		 * No session has been established yet, so we have to expect
		 * that s->cert or ret->cert will be changed later --
		 * they should not both point to the same object,
		 * and thus we can't use SSL_copy_session_id.
		 */

		ret->method->internal->ssl_free(ret);
		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_set_session_id_context(ret,
		s->sid_ctx, s->sid_ctx_length);

	}

	ret->internal->options = s->internal->options;
	ret->internal->mode = s->internal->mode;
	SSL_set_max_cert_list(ret, SSL_get_max_cert_list(s));
	SSL_set_read_ahead(ret, SSL_get_read_ahead(s));
	ret->internal->msg_callback = s->internal->msg_callback;







|






<
|
>



















|
|
>







2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502

2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
{
	STACK_OF(X509_NAME) *sk;
	X509_NAME *xn;
	SSL *ret;
	int i;

	if ((ret = SSL_new(SSL_get_SSL_CTX(s))) == NULL)
		goto err;

	ret->version = s->version;
	ret->internal->type = s->internal->type;
	ret->method = s->method;

	if (s->session != NULL) {

		if (!SSL_copy_session_id(ret, s))
			goto err;
	} else {
		/*
		 * No session has been established yet, so we have to expect
		 * that s->cert or ret->cert will be changed later --
		 * they should not both point to the same object,
		 * and thus we can't use SSL_copy_session_id.
		 */

		ret->method->internal->ssl_free(ret);
		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;
		}

		if (!SSL_set_session_id_context(ret, s->sid_ctx,
		    s->sid_ctx_length))
			goto err;
	}

	ret->internal->options = s->internal->options;
	ret->internal->mode = s->internal->mode;
	SSL_set_max_cert_list(ret, SSL_get_max_cert_list(s));
	SSL_set_read_ahead(ret, SSL_get_read_ahead(s));
	ret->internal->msg_callback = s->internal->msg_callback;
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622





2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637










2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
			    X509_NAME_dup(xn)) == NULL) {
				X509_NAME_free(xn);
				goto err;
			}
		}
	}

	if (0) {
err:
		if (ret != NULL)
			SSL_free(ret);
		ret = NULL;
	}
	return (ret);





}

void
ssl_clear_cipher_ctx(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;

	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;
	}










	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);
}

/* Fix this function so that it takes an optional type parameter */
EVP_PKEY *
SSL_get_privatekey(SSL *s)
{
	if (s->cert != NULL)
		return (s->cert->key->privatekey);
	else
		return (NULL);
}








|
|
<
|
|
|
|
>
>
>
>
>



|



|
|






>
>
>
>
>
>
>
>
>
>





<














|







2602
2603
2604
2605
2606
2607
2608
2609
2610

2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649

2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
			    X509_NAME_dup(xn)) == NULL) {
				X509_NAME_free(xn);
				goto err;
			}
		}
	}

	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_read_state(SSL *s)
{
	EVP_CIPHER_CTX_free(s->enc_read_ctx);
	s->enc_read_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);
}

/* Fix this function so that it takes an optional type parameter */
EVP_PKEY *
SSL_get_privatekey(const SSL *s)
{
	if (s->cert != NULL)
		return (s->cert->key->privatekey);
	else
		return (NULL);
}

3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
void
SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version,
    int content_type, const void *buf, size_t len, SSL *ssl, void *arg))
{
	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)
{
	s->internal->debug = debug;
}

int







<
<
<
<
<
<
<
<







3022
3023
3024
3025
3026
3027
3028








3029
3030
3031
3032
3033
3034
3035
void
SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version,
    int content_type, const void *buf, size_t len, SSL *ssl, void *arg))
{
	SSL_callback_ctrl(ssl, SSL_CTRL_SET_MSG_CALLBACK, (void (*)(void))cb);
}









void
SSL_set_debug(SSL *s, int debug)
{
	s->internal->debug = debug;
}

int
Changes to jni/libressl/ssl/ssl_locl.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_locl.h,v 1.202 2018/01/27 15:30:05 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_locl.h,v 1.215 2018/09/08 14:29:52 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.
 *
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
			 *((c)++)=(unsigned char)(((l)>>40)&0xff), \
			 *((c)++)=(unsigned char)(((l)>>32)&0xff), \
			 *((c)++)=(unsigned char)(((l)>>24)&0xff), \
			 *((c)++)=(unsigned char)(((l)>>16)&0xff), \
			 *((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
#define SSL_ENCRYPT	1

/*
 * Define the Bitmasks for SSL_CIPHER.algorithms.







<
<



<
<
<
<







177
178
179
180
181
182
183


184
185
186




187
188
189
190
191
192
193
			 *((c)++)=(unsigned char)(((l)>>40)&0xff), \
			 *((c)++)=(unsigned char)(((l)>>32)&0xff), \
			 *((c)++)=(unsigned char)(((l)>>24)&0xff), \
			 *((c)++)=(unsigned char)(((l)>>16)&0xff), \
			 *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
			 *((c)++)=(unsigned char)(((l)    )&0xff))



#define s2n(s,c)	((c[0]=(unsigned char)(((s)>> 8)&0xff), \
			  c[1]=(unsigned char)(((s)    )&0xff)),c+=2)





/* LOCAL STUFF */

#define SSL_DECRYPT	0
#define SSL_ENCRYPT	1

/*
 * Define the Bitmasks for SSL_CIPHER.algorithms.
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290

291
292

293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
#define SSL_HANDSHAKE_MAC_SHA		0x020
#define SSL_HANDSHAKE_MAC_GOST94	0x040
#define SSL_HANDSHAKE_MAC_SHA256	0x080
#define SSL_HANDSHAKE_MAC_SHA384	0x100
#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

#define TLS1_PRF_DGST_MASK	(0xff << TLS1_PRF_DGST_SHIFT)

#define TLS1_PRF_DGST_SHIFT 10
#define TLS1_PRF_MD5 (SSL_HANDSHAKE_MAC_MD5 << TLS1_PRF_DGST_SHIFT)
#define TLS1_PRF_SHA1 (SSL_HANDSHAKE_MAC_SHA << TLS1_PRF_DGST_SHIFT)
#define TLS1_PRF_SHA256 (SSL_HANDSHAKE_MAC_SHA256 << TLS1_PRF_DGST_SHIFT)
#define TLS1_PRF_SHA384 (SSL_HANDSHAKE_MAC_SHA384 << TLS1_PRF_DGST_SHIFT)
#define TLS1_PRF_GOST94 (SSL_HANDSHAKE_MAC_GOST94 << TLS1_PRF_DGST_SHIFT)
#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) */

#define TLS1_STREAM_MAC 0x04

/*
 * SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD is an algorithm2 flag that
 * indicates that the variable part of the nonce is included as a prefix of
 * the record (AES-GCM, for example, does this with an 8-byte variable nonce.)
 */
#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.
 */
#define SSL_CIPHER_AEAD_FIXED_NONCE_LEN(ssl_cipher) \
	(((ssl_cipher->algorithm2 >> 24) & 0xf) * 2)

/*
 * Cipher strength information.
 */







<
<
<
<














>
|
|
>










<
<
<
<
<
<

|







260
261
262
263
264
265
266




267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294






295
296
297
298
299
300
301
302
303
#define SSL_HANDSHAKE_MAC_SHA		0x020
#define SSL_HANDSHAKE_MAC_GOST94	0x040
#define SSL_HANDSHAKE_MAC_SHA256	0x080
#define SSL_HANDSHAKE_MAC_SHA384	0x100
#define SSL_HANDSHAKE_MAC_STREEBOG256	0x200
#define SSL_HANDSHAKE_MAC_DEFAULT (SSL_HANDSHAKE_MAC_MD5 | SSL_HANDSHAKE_MAC_SHA)





#define SSL3_CK_ID		0x03000000
#define SSL3_CK_VALUE_MASK	0x0000ffff

#define TLS1_PRF_DGST_MASK	(0xff << TLS1_PRF_DGST_SHIFT)

#define TLS1_PRF_DGST_SHIFT 10
#define TLS1_PRF_MD5 (SSL_HANDSHAKE_MAC_MD5 << TLS1_PRF_DGST_SHIFT)
#define TLS1_PRF_SHA1 (SSL_HANDSHAKE_MAC_SHA << TLS1_PRF_DGST_SHIFT)
#define TLS1_PRF_SHA256 (SSL_HANDSHAKE_MAC_SHA256 << TLS1_PRF_DGST_SHIFT)
#define TLS1_PRF_SHA384 (SSL_HANDSHAKE_MAC_SHA384 << TLS1_PRF_DGST_SHIFT)
#define TLS1_PRF_GOST94 (SSL_HANDSHAKE_MAC_GOST94 << TLS1_PRF_DGST_SHIFT)
#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).
 */
#define TLS1_STREAM_MAC 0x04

/*
 * SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD is an algorithm2 flag that
 * indicates that the variable part of the nonce is included as a prefix of
 * the record (AES-GCM, for example, does this with an 8-byte variable nonce.)
 */
#define SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD (1 << 22)

/*






 * SSL_CIPHER_AEAD_FIXED_NONCE_LEN returns the number of bytes of fixed nonce
 * 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)

/*
 * Cipher strength information.
 */
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409

	int (*ssl_new)(SSL *s);
	void (*ssl_clear)(SSL *s);
	void (*ssl_free)(SSL *s);

	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);

	long (*ssl_get_message)(SSL *s, int st1, int stn, int mt,
	    long max, int *ok);
	int (*ssl_read_bytes)(SSL *s, int type, unsigned char *buf,
	    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);
	int (*ssl_version)(void);

	struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */
} SSL_METHOD_INTERNAL;







<
<
<
<










<







367
368
369
370
371
372
373




374
375
376
377
378
379
380
381
382
383

384
385
386
387
388
389
390

	int (*ssl_new)(SSL *s);
	void (*ssl_clear)(SSL *s);
	void (*ssl_free)(SSL *s);

	int (*ssl_accept)(SSL *s);
	int (*ssl_connect)(SSL *s);





	int (*ssl_renegotiate)(SSL *s);
	int (*ssl_renegotiate_check)(SSL *s);

	long (*ssl_get_message)(SSL *s, int st1, int stn, int mt,
	    long max, int *ok);
	int (*ssl_read_bytes)(SSL *s, int type, unsigned char *buf,
	    int len, int peek);
	int (*ssl_write_bytes)(SSL *s, int type, const void *buf_, int len);


	const struct ssl_method_st *(*get_ssl_method)(int version);

	long (*get_timeout)(void);
	int (*ssl_version)(void);

	struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */
} SSL_METHOD_INTERNAL;
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
	 * on 0, it means the callback has finished with it.
	 * If remove_session_cb is not null, it will be called when
	 * a session-id is removed from the cache.  After the call,
	 * OpenSSL will SSL_SESSION_free() it. */
	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);

	/* if defined, these override the X509_verify_cert() calls */
	int (*app_verify_callback)(X509_STORE_CTX *, void *);
	    void *app_verify_arg;

	/* get client cert callback */
	int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey);

	/* cookie generate callback */
	int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie,
	    unsigned int *cookie_len);

	/* verify cookie callback */
	int (*app_verify_cookie_cb)(SSL *ssl, 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 */

	/* callback that allows applications to peek at protocol messages */
	void (*msg_callback)(int write_p, int version, int content_type,
	    const void *buf, size_t len, SSL *ssl, void *arg);







|













|







440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
	 * on 0, it means the callback has finished with it.
	 * If remove_session_cb is not null, it will be called when
	 * a session-id is removed from the cache.  After the call,
	 * OpenSSL will SSL_SESSION_free() it. */
	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,
	    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 *);
	    void *app_verify_arg;

	/* get client cert callback */
	int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey);

	/* cookie generate callback */
	int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie,
	    unsigned int *cookie_len);

	/* verify cookie callback */
	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 */

	/* callback that allows applications to peek at protocol messages */
	void (*msg_callback)(int write_p, int version, int content_type,
	    const void *buf, size_t len, SSL *ssl, void *arg);
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771

	int mac_packet;

	int empty_record_count;
} 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];
	unsigned char write_sequence[SSL3_SEQUENCE_SIZE];
	int write_mac_secret_size;
	unsigned char write_mac_secret[EVP_MAX_MD_SIZE];








<
<







737
738
739
740
741
742
743


744
745
746
747
748
749
750

	int mac_packet;

	int empty_record_count;
} SSL_INTERNAL;

typedef struct ssl3_state_internal_st {


	unsigned char read_sequence[SSL3_SEQUENCE_SIZE];
	int read_mac_secret_size;
	unsigned char read_mac_secret[EVP_MAX_MD_SIZE];
	unsigned char write_sequence[SSL3_SEQUENCE_SIZE];
	int write_mac_secret_size;
	unsigned char write_mac_secret[EVP_MAX_MD_SIZE];

1048
1049
1050
1051
1052
1053
1054
1055


1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067

1068
1069
1070
1071
1072
1073
1074
const SSL_METHOD *tls1_get_server_method(int ver);

extern SSL3_ENC_METHOD DTLSv1_enc_data;
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);


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);
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_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);

int ssl_cipher_ptr_id_cmp(const SSL_CIPHER * const *ap,
    const SSL_CIPHER * const *bp);
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);







|
>
>








|
|

|
>







1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
const SSL_METHOD *tls1_get_server_method(int ver);

extern SSL3_ENC_METHOD DTLSv1_enc_data;
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_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);
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, 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);
int ssl_cipher_ptr_id_cmp(const SSL_CIPHER * const *ap,
    const SSL_CIPHER * const *bp);
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);
1088
1089
1090
1091
1092
1093
1094


1095
1096
1097
1098
1099
1100
1101
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);



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);
int ssl3_send_server_certificate(SSL *s);
int ssl3_send_newsession_ticket(SSL *s);
int ssl3_send_cert_status(SSL *s);
int ssl3_get_finished(SSL *s, int state_a, int state_b);







>
>







1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
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);
int ssl3_send_server_certificate(SSL *s);
int ssl3_send_newsession_ticket(SSL *s);
int ssl3_send_cert_status(SSL *s);
int ssl3_get_finished(SSL *s, int state_a, int state_b);
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
long	ssl3_ctrl(SSL *s, int cmd, long larg, void *parg);
long	ssl3_ctx_ctrl(SSL_CTX *s, int cmd, long larg, void *parg);
long	ssl3_callback_ctrl(SSL *s, int cmd, void (*fp)(void));
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,
    uint8_t msg_type);
int ssl3_handshake_msg_finish_cbb(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);

long tls1_default_timeout(void);







<
<
|

|







1122
1123
1124
1125
1126
1127
1128


1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
long	ssl3_ctrl(SSL *s, int cmd, long larg, void *parg);
long	ssl3_ctx_ctrl(SSL_CTX *s, int cmd, long larg, void *parg);
long	ssl3_callback_ctrl(SSL *s, int cmd, void (*fp)(void));
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);


int ssl3_handshake_msg_start(SSL *s, CBB *handshake, CBB *body,
    uint8_t msg_type);
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);

long tls1_default_timeout(void);
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
void tls1_free(SSL *s);
void tls1_clear(SSL *s);

int dtls1_new(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);
int dtls1_dispatch_alert(SSL *s);
int dtls1_enc(SSL *s, int snd);

int ssl_init_wbio_buffer(SSL *s, int push);







<







1209
1210
1211
1212
1213
1214
1215

1216
1217
1218
1219
1220
1221
1222
void tls1_free(SSL *s);
void tls1_clear(SSL *s);

int dtls1_new(SSL *s);
void dtls1_free(SSL *s);
void dtls1_clear(SSL *s);
long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg);


long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok);
int dtls1_get_record(SSL *s);
int dtls1_dispatch_alert(SSL *s);
int dtls1_enc(SSL *s, int snd);

int ssl_init_wbio_buffer(SSL *s, int push);
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292

1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **data,
    size_t n, int *al);
int ssl_check_clienthello_tlsext_early(SSL *s);
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);
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);







|
|
<
|

>


<







1262
1263
1264
1265
1266
1267
1268
1269
1270

1271
1272
1273
1274
1275

1276
1277
1278
1279
1280
1281
1282
int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **data,
    size_t n, int *al);
int ssl_check_clienthello_tlsext_early(SSL *s);
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 session_id_len, CBS *ext_block, SSL_SESSION **ret);

int tls12_get_hashid(const EVP_MD *md);
int tls12_get_sigid(const EVP_PKEY *pk);
int tls12_get_hashandsig(CBB *cbb, const EVP_PKEY *pk, const EVP_MD *md);
const EVP_MD *tls12_get_hash(unsigned char hash_alg);


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);
Changes to jni/libressl/ssl/ssl_pkt.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_pkt.c,v 1.12 2017/05/07 04:22:24 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_pkt.c,v 1.13 2018/09/08 14:39:41 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.
 *
735
736
737
738
739
740
741

742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758

759
760
761
762
763
764
765
		*(p++) = s->version&0xff;

	/* field where we are to write out packet length */
	plen = p;
	p += 2;

	/* Explicit IV length. */

	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) {
			eivlen = EVP_CIPHER_CTX_iv_length(s->internal->enc_write_ctx);
			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;
	wr->length = (int)len;
	wr->input = (unsigned char *)buf;

	/* we now 'read' from wr->input, wr->length bytes into wr->data */







>







<
<
<
<
<



<
<
>







735
736
737
738
739
740
741
742
743
744
745
746
747
748
749





750
751
752


753
754
755
756
757
758
759
760
		*(p++) = s->version&0xff;

	/* field where we are to write out packet length */
	plen = p;
	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) {
			eivlen = EVP_CIPHER_CTX_iv_length(s->internal->enc_write_ctx);
			if (eivlen <= 1)
				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;


	}

	/* lets setup the record stuff. */
	wr->data = p + eivlen;
	wr->length = (int)len;
	wr->input = (unsigned char *)buf;

	/* we now 'read' from wr->input, wr->length bytes into wr->data */
Changes to jni/libressl/ssl/ssl_rsa.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_rsa.c,v 1.28 2017/02/07 02:08:38 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_rsa.c,v 1.29 2018/04/25 07:10:39 tb 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.
 *
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143

int
SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len)
{
	X509 *x;
	int ret;

	x = d2i_X509(NULL, &d,(long)len);
	if (x == NULL) {
		SSLerror(ssl, ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_use_certificate(ssl, x);
	X509_free(x);







|







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143

int
SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len)
{
	X509 *x;
	int ret;

	x = d2i_X509(NULL, &d, (long)len);
	if (x == NULL) {
		SSLerror(ssl, ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_use_certificate(ssl, x);
	X509_free(x);
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
	RSA_free(rsa);
end:
	BIO_free(in);
	return (ret);
}

int
SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len)
{
	int ret;
	const unsigned char *p;
	RSA *rsa;

	p = d;
	if ((rsa = d2i_RSAPrivateKey(NULL, &p,(long)len)) == NULL) {
		SSLerror(ssl, ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_use_RSAPrivateKey(ssl, rsa);
	RSA_free(rsa);
	return (ret);







|


<


<
|







250
251
252
253
254
255
256
257
258
259

260
261

262
263
264
265
266
267
268
269
	RSA_free(rsa);
end:
	BIO_free(in);
	return (ret);
}

int
SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const unsigned char *d, long len)
{
	int ret;

	RSA *rsa;


	if ((rsa = d2i_RSAPrivateKey(NULL, &d, (long)len)) == NULL) {
		SSLerror(ssl, ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_use_RSAPrivateKey(ssl, rsa);
	RSA_free(rsa);
	return (ret);
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
	return (ret);
}

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) {
		SSLerror(ssl, ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_use_PrivateKey(ssl, pkey);
	EVP_PKEY_free(pkey);
	return (ret);







<


<
|







326
327
328
329
330
331
332

333
334

335
336
337
338
339
340
341
342
	return (ret);
}

int
SSL_use_PrivateKey_ASN1(int type, SSL *ssl, const unsigned char *d, long len)
{
	int ret;

	EVP_PKEY *pkey;


	if ((pkey = d2i_PrivateKey(type, NULL, &d, (long)len)) == NULL) {
		SSLerror(ssl, ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_use_PrivateKey(ssl, pkey);
	EVP_PKEY_free(pkey);
	return (ret);
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475

int
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);
	if (x == NULL) {
		SSLerrorx(ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_CTX_use_certificate(ctx, x);
	X509_free(x);







|







457
458
459
460
461
462
463
464
465
466
467
468
469
470
471

int
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);
	if (x == NULL) {
		SSLerrorx(ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_CTX_use_certificate(ctx, x);
	X509_free(x);
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
	return (ret);
}

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) {
		SSLerrorx(ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_CTX_use_RSAPrivateKey(ctx, rsa);
	RSA_free(rsa);
	return (ret);







<


<
|







539
540
541
542
543
544
545

546
547

548
549
550
551
552
553
554
555
	return (ret);
}

int
SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len)
{
	int ret;

	RSA *rsa;


	if ((rsa = d2i_RSAPrivateKey(NULL, &d, (long)len)) == NULL) {
		SSLerrorx(ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_CTX_use_RSAPrivateKey(ctx, rsa);
	RSA_free(rsa);
	return (ret);
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
}

int
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) {
		SSLerrorx(ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_CTX_use_PrivateKey(ctx, pkey);
	EVP_PKEY_free(pkey);
	return (ret);







<


<
|







610
611
612
613
614
615
616

617
618

619
620
621
622
623
624
625
626
}

int
SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const unsigned char *d,
    long len)
{
	int ret;

	EVP_PKEY *pkey;


	if ((pkey = d2i_PrivateKey(type, NULL, &d, (long)len)) == NULL) {
		SSLerrorx(ERR_R_ASN1_LIB);
		return (0);
	}

	ret = SSL_CTX_use_PrivateKey(ctx, pkey);
	EVP_PKEY_free(pkey);
	return (ret);
Changes to jni/libressl/ssl/ssl_sess.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_sess.c,v 1.79 2018/03/20 15:28:12 tb 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_sess.c,v 1.81 2018/08/24 18:10: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.
 *
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
/*
 * ssl_get_prev attempts to find an SSL_SESSION to be used to resume this
 * connection. It is only called by servers.
 *
 *   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.
 *
 * Returns:
 *   -1: error
 *    0: a session may have been found.
 *
 * Side effects:
 *   - If a session is found then s->session is pointed at it (after freeing
 *     an existing session if need be) and s->verify_result is set from the
 *     session.
 *   - Both for new and resumed sessions, s->internal->tlsext_ticket_expected is set
 *     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_SESSION *ret = NULL;
	int fatal = 0;
	int try_session_cache = 1;
	int r;

	/* This is used only by servers. */

	if (len > SSL_MAX_SSL_SESSION_ID_LENGTH)
		goto err;

	if (len == 0)
		try_session_cache = 0;

	/* Sets s->internal->tlsext_ticket_expected. */
	r = tls1_process_ticket(s, session_id, len, limit, &ret);
	switch (r) {
	case -1: /* Error during processing */
		fatal = 1;
		goto err;
	case 0: /* No ticket found */
	case 1: /* Zero length ticket found */
		break; /* Ok to carry on processing session id. */
	case 2: /* Ticket found but not decrypted. */
	case 3: /* Ticket decrypted, *ret has been set. */
		try_session_cache = 0;
		break;
	default:
		abort();
	}

	if (try_session_cache && ret == NULL &&
	    !(s->session_ctx->internal->session_cache_mode &
	     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);

		CRYPTO_r_lock(CRYPTO_LOCK_SSL_CTX);
		ret = lh_SSL_SESSION_retrieve(s->session_ctx->internal->sessions, &data);
		if (ret != NULL) {
			/* Don't allow other threads to steal it. */
			CRYPTO_add(&ret->references, 1,
			    CRYPTO_LOCK_SSL_SESSION);
		}
		CRYPTO_r_unlock(CRYPTO_LOCK_SSL_CTX);

		if (ret == NULL)
			s->session_ctx->internal->stats.sess_miss++;
	}

	if (try_session_cache && ret == NULL &&
	    s->session_ctx->internal->get_session_cb != NULL) {
		int copy = 1;

		if ((ret = s->session_ctx->internal->get_session_cb(s,
		    session_id, len, &copy))) {
			s->session_ctx->internal->stats.sess_cb_hit++;

			/*
			 * Increment reference count now if the session
			 * callback asks us to do so (note that if the session
			 * structures returned by the callback are shared
			 * between threads, it must handle the reference count







|
|













|
|








|


|



|




















|
|



















|







416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
/*
 * ssl_get_prev attempts to find an SSL_SESSION to be used to resume this
 * connection. It is only called by servers.
 *
 *   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.
 *   session_id_len: the length of the session ID.
 *   ext_block: a CBS for the ClientHello extensions block.
 *
 * Returns:
 *   -1: error
 *    0: a session may have been found.
 *
 * Side effects:
 *   - If a session is found then s->session is pointed at it (after freeing
 *     an existing session if need be) and s->verify_result is set from the
 *     session.
 *   - Both for new and resumed sessions, s->internal->tlsext_ticket_expected is set
 *     to 1 if the server should issue a new session ticket (to 0 otherwise).
 */
int
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;
	int try_session_cache = 1;
	int r;

	/* This is used only by servers. */

	if (session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH)
		goto err;

	if (session_id_len == 0)
		try_session_cache = 0;

	/* Sets s->internal->tlsext_ticket_expected. */
	r = tls1_process_ticket(s, session_id, session_id_len, ext_block, &ret);
	switch (r) {
	case -1: /* Error during processing */
		fatal = 1;
		goto err;
	case 0: /* No ticket found */
	case 1: /* Zero length ticket found */
		break; /* Ok to carry on processing session id. */
	case 2: /* Ticket found but not decrypted. */
	case 3: /* Ticket decrypted, *ret has been set. */
		try_session_cache = 0;
		break;
	default:
		abort();
	}

	if (try_session_cache && ret == NULL &&
	    !(s->session_ctx->internal->session_cache_mode &
	     SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) {
		SSL_SESSION data;
		data.ssl_version = s->version;
		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);
		if (ret != NULL) {
			/* Don't allow other threads to steal it. */
			CRYPTO_add(&ret->references, 1,
			    CRYPTO_LOCK_SSL_SESSION);
		}
		CRYPTO_r_unlock(CRYPTO_LOCK_SSL_CTX);

		if (ret == NULL)
			s->session_ctx->internal->stats.sess_miss++;
	}

	if (try_session_cache && ret == NULL &&
	    s->session_ctx->internal->get_session_cb != NULL) {
		int copy = 1;

		if ((ret = s->session_ctx->internal->get_session_cb(s,
		    session_id, session_id_len, &copy))) {
			s->session_ctx->internal->stats.sess_cb_hit++;

			/*
			 * Increment reference count now if the session
			 * callback asks us to do so (note that if the session
			 * structures returned by the callback are shared
			 * between threads, it must handle the reference count
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
(*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(SSL_CTX * ctx, SSL_SESSION *sess)
{
	return ctx->internal->remove_session_cb;
}

void
SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, SSL_SESSION *(*cb)(struct ssl_st *ssl,
    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,
    int len, int *copy)
{
	return ctx->internal->get_session_cb;
}

void
SSL_CTX_set_info_callback(SSL_CTX *ctx,







|





|







1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
(*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(SSL_CTX * ctx, SSL_SESSION *sess)
{
	return ctx->internal->remove_session_cb;
}

void
SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, SSL_SESSION *(*cb)(struct ssl_st *ssl,
    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, const unsigned char *data,
    int len, int *copy)
{
	return ctx->internal->get_session_cb;
}

void
SSL_CTX_set_info_callback(SSL_CTX *ctx,
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
    int (*cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len))
{
	ctx->internal->app_gen_cookie_cb = cb;
}

void
SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx,
    int (*cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len))
{
	ctx->internal->app_verify_cookie_cb = cb;
}

int
PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x)
{







|







1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
    int (*cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len))
{
	ctx->internal->app_gen_cookie_cb = cb;
}

void
SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx,
    int (*cb)(SSL *ssl, const unsigned char *cookie, unsigned int cookie_len))
{
	ctx->internal->app_verify_cookie_cb = cb;
}

int
PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x)
{
Changes to jni/libressl/ssl/ssl_srvr.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_srvr.c,v 1.28 2018/01/28 09:21:34 inoguchi 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_srvr.c,v 1.48 2018/08/27 17:04:34 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.
 *
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
ssl3_send_hello_request(SSL *s)
{
	CBB cbb, hello;

	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,
		    SSL3_MT_HELLO_REQUEST))
			goto err;
		if (!ssl3_handshake_msg_finish_cbb(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_SW_HELLO_REQ_B;
	}

	/* SSL3_ST_SW_HELLO_REQ_B */
	return (ssl3_handshake_write(s));







|


|







780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
ssl3_send_hello_request(SSL *s)
{
	CBB cbb, hello;

	memset(&cbb, 0, sizeof(cbb));

	if (S3I(s)->hs.state == SSL3_ST_SW_HELLO_REQ_A) {
		if (!ssl3_handshake_msg_start(s, &cbb, &hello,
		    SSL3_MT_HELLO_REQUEST))
			goto err;
		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_SW_HELLO_REQ_B;
	}

	/* SSL3_ST_SW_HELLO_REQ_B */
	return (ssl3_handshake_write(s));
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
	long n;
	unsigned long id;
	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.
	 * If we are TLSv1 and we get SSLv3, we will respond with TLSv1,
	 * This down switching should be handled by a different method.
	 * If we are SSLv3, we will respond with SSLv3, even if prompted with
	 * TLSv1.







<







814
815
816
817
818
819
820

821
822
823
824
825
826
827
	long n;
	unsigned long id;
	SSL_CIPHER *c;
	STACK_OF(SSL_CIPHER) *ciphers = NULL;
	unsigned long alg_k;
	const SSL_METHOD *method;
	uint16_t shared_version;


	/*
	 * We do this so that we will respond with our native type.
	 * If we are TLSv1 and we get SSLv3, we will respond with TLSv1,
	 * This down switching should be handled by a different method.
	 * If we are SSLv3, we will respond with SSLv3, even if prompted with
	 * TLSv1.
838
839
840
841
842
843
844
845
846

847













848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
	if (!ok)
		return ((int)n);
	s->internal->first_packet = 0;

	if (n < 0)
		goto err;

	end = (unsigned char *)s->internal->init_msg + n;


	CBS_init(&cbs, s->internal->init_msg, n);














	/*
	 * 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 &&
		    !s->internal->enc_write_ctx && !s->internal->write_hash) {
			/*
			 * Similar to ssl3_get_record, send alert using remote
			 * version number.







|

>
|
>
>
>
>
>
>
>
>
>
>
>
>
>





<
<
<







837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865



866
867
868
869
870
871
872
	if (!ok)
		return ((int)n);
	s->internal->first_packet = 0;

	if (n < 0)
		goto err;

	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 (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 &&
		    !s->internal->enc_write_ctx && !s->internal->write_hash) {
			/*
			 * Similar to ssl3_get_record, send alert using remote
			 * version number.
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
		method = dtls1_get_server_method(shared_version);
	if (method == NULL) {
		SSLerror(s, ERR_R_INTERNAL_ERROR);
		goto err;
	}
	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 (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);
		}
	}

	if (!CBS_write_bytes(&client_random, s->s3->client_random,







<
<
<
<
<

|
|
|


<
<







883
884
885
886
887
888
889





890
891
892
893
894
895


896
897
898
899
900
901
902
		method = dtls1_get_server_method(shared_version);
	if (method == NULL) {
		SSLerror(s, ERR_R_INTERNAL_ERROR);
		goto err;
	}
	s->method = method;






	/*
	 * 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 (SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE) {
			if (CBS_len(&cookie) == 0)
				return (1);
		}
	}

	if (!CBS_write_bytes(&client_random, s->s3->client_random,
918
919
920
921
922
923
924

925


926
927
928
929
930
931
932
933
934
935
	 * ignored.
	 */
	if ((s->internal->new_session && (s->internal->options &
	    SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION))) {
		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);
		if (i == 1) { /* previous session */
			s->internal->hit = 1;
		} else if (i == -1)
			goto err;
		else {
			/* i == 0 */
			if (!ssl_get_new_session(s, 1))







>
|
>
>
|
<
|







921
922
923
924
925
926
927
928
929
930
931
932

933
934
935
936
937
938
939
940
	 * ignored.
	 */
	if ((s->internal->new_session && (s->internal->options &
	    SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION))) {
		if (!ssl_get_new_session(s, 1))
			goto err;
	} else {
		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)
			goto err;
		else {
			/* i == 0 */
			if (!ssl_get_new_session(s, 1))
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
				SSLerror(s, SSL_R_COOKIE_MISMATCH);
				goto f_err;
			}
			cookie_valid = 1;
		}
	}

	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 */
		al = SSL_AD_ILLEGAL_PARAMETER;
		SSLerror(s, SSL_R_NO_CIPHERS_SPECIFIED);
		goto f_err;
	}







<
<
<







980
981
982
983
984
985
986



987
988
989
990
991
992
993
				SSLerror(s, SSL_R_COOKIE_MISMATCH);
				goto f_err;
			}
			cookie_valid = 1;
		}
	}




	/* 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 */
		al = SSL_AD_ILLEGAL_PARAMETER;
		SSLerror(s, SSL_R_NO_CIPHERS_SPECIFIED);
		goto f_err;
	}
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
			 */
			al = SSL_AD_ILLEGAL_PARAMETER;
			SSLerror(s, SSL_R_REQUIRED_CIPHER_MISSING);
			goto f_err;
		}
	}

	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))
			goto truncated;
		if (comp_method == 0)
			comp_null = 1;
	}







<
<
<







1018
1019
1020
1021
1022
1023
1024



1025
1026
1027
1028
1029
1030
1031
			 */
			al = SSL_AD_ILLEGAL_PARAMETER;
			SSLerror(s, SSL_R_REQUIRED_CIPHER_MISSING);
			goto f_err;
		}
	}




	comp_null = 0;
	while (CBS_len(&compression_methods) > 0) {
		if (!CBS_get_u8(&compression_methods, &comp_method))
			goto truncated;
		if (comp_method == 0)
			comp_null = 1;
	}
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
{
	CBB cbb, server_hello, session_id;
	size_t sl;

	memset(&cbb, 0, sizeof(cbb));

	if (S3I(s)->hs.state == SSL3_ST_SW_SRVR_HELLO_A) {
		if (!ssl3_handshake_msg_start_cbb(s, &cbb, &server_hello,
		    SSL3_MT_SERVER_HELLO))
			goto err;

		if (!CBB_add_u16(&server_hello, s->version))
			goto err;
		if (!CBB_add_bytes(&server_hello, s->s3->server_random,
		    sizeof(s->s3->server_random)))







|







1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
{
	CBB cbb, server_hello, session_id;
	size_t sl;

	memset(&cbb, 0, sizeof(cbb));

	if (S3I(s)->hs.state == SSL3_ST_SW_SRVR_HELLO_A) {
		if (!ssl3_handshake_msg_start(s, &cbb, &server_hello,
		    SSL3_MT_SERVER_HELLO))
			goto err;

		if (!CBB_add_u16(&server_hello, s->version))
			goto err;
		if (!CBB_add_bytes(&server_hello, s->s3->server_random,
		    sizeof(s->s3->server_random)))
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281

		/* TLS extensions */
		if (!tlsext_serverhello_build(s, &server_hello)) {
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			goto err;
		}

		if (!ssl3_handshake_msg_finish_cbb(s, &cbb))
			goto err;
	}

	/* SSL3_ST_SW_SRVR_HELLO_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (-1);
}

int
ssl3_send_server_done(SSL *s)
{
	CBB cbb, done;

	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,
		    SSL3_MT_SERVER_DONE))
			goto err;
		if (!ssl3_handshake_msg_finish_cbb(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_SW_SRVR_DONE_B;
	}

	/* SSL3_ST_SW_SRVR_DONE_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (-1);
}

int
ssl3_send_server_kex_dhe(SSL *s, CBB *cbb)
{
	CBB dh_p, dh_g, dh_Ys;
	DH *dh = NULL, *dhp;
	unsigned char *data;
	int al;








|




















|


|














|







1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280

		/* TLS extensions */
		if (!tlsext_serverhello_build(s, &server_hello)) {
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			goto err;
		}

		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;
	}

	/* SSL3_ST_SW_SRVR_HELLO_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (-1);
}

int
ssl3_send_server_done(SSL *s)
{
	CBB cbb, done;

	memset(&cbb, 0, sizeof(cbb));

	if (S3I(s)->hs.state == SSL3_ST_SW_SRVR_DONE_A) {
		if (!ssl3_handshake_msg_start(s, &cbb, &done,
		    SSL3_MT_SERVER_DONE))
			goto err;
		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_SW_SRVR_DONE_B;
	}

	/* SSL3_ST_SW_SRVR_DONE_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (-1);
}

static int
ssl3_send_server_kex_dhe(SSL *s, CBB *cbb)
{
	CBB dh_p, dh_g, dh_Ys;
	DH *dh = NULL, *dhp;
	unsigned char *data;
	int al;

1497
1498
1499
1500
1501
1502
1503
1504


1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516


1517
1518

1519
1520

1521
1522
1523


1524
1525
1526
1527
1528

1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543




1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635







1636

1637


1638














1639












1640
1641

1642


1643
1644
1645
1646
1647
1648
1649
1650
1651



1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678

	return ssl3_send_server_kex_ecdhe_ecp(s, nid, cbb);
}

int
ssl3_send_server_key_exchange(SSL *s)
{
	CBB cbb;


	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;



	memset(&cbb, 0, sizeof(cbb));


	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 (!CBB_init(&cbb, 0))
			goto err;


		if (type & SSL_kDHE) {
			if (ssl3_send_server_kex_dhe(s, &cbb) != 1)
				goto err;
		} else if (type & SSL_kECDHE) {
			if (ssl3_send_server_kex_ecdhe(s, &cbb) != 1)
				goto err;
		} else {
			al = SSL_AD_HANDSHAKE_FAILURE;
			SSLerror(s, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE);
			goto f_err;
		}

		if (!CBB_finish(&cbb, &params, &params_len))
			goto err;





		if (!(S3I(s)->hs.new_cipher->algorithm_auth & SSL_aNULL)) {
			if ((pkey = ssl_get_sign_pkey(
			    s, S3I(s)->hs.new_cipher, &md)) == 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;
				}
				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;
			}
		}









		ssl3_handshake_msg_finish(s, n);


	}



























	S3I(s)->hs.state = SSL3_ST_SW_KEY_EXCH_B;


	EVP_MD_CTX_cleanup(&md_ctx);



	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);




	return (-1);
}

int
ssl3_send_certificate_request(SSL *s)
{
	CBB cbb, cert_request, cert_types, sigalgs, cert_auth, dn;
	STACK_OF(X509_NAME) *sk = NULL;
	X509_NAME *name;
	int i;

	/*
	 * Certificate Request - RFC 5246 section 7.4.4.
	 */

	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,
		    SSL3_MT_CERTIFICATE_REQUEST))
			goto err;

		if (!CBB_add_u8_length_prefixed(&cert_request, &cert_types))
			goto err;
		if (!ssl3_get_req_cert_types(s, &cert_types))
			goto err;







|
>
>


<
<
<
<

<
<

<

>
>


>


>

<

>
>
|

|


>

|


|







|


>
>
>
>

|
|



<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<





|
>
>
>
>
>
>
>
|
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>

>
>






|
<

>
>
>



















|







1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507




1508


1509

1510
1511
1512
1513
1514
1515
1516
1517
1518
1519

1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553




1554
























1555


1556















1557


1558




























1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617

1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648

	return ssl3_send_server_kex_ecdhe_ecp(s, nid, cbb);
}

int
ssl3_send_server_key_exchange(SSL *s)
{
	CBB cbb, cbb_params, cbb_signature, server_kex;
	unsigned char *signature = NULL;
	unsigned int signature_len;
	unsigned char *params = NULL;
	size_t params_len;




	const EVP_MD *md = NULL;


	unsigned long type;

	EVP_MD_CTX md_ctx;
	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) {


		if (!ssl3_handshake_msg_start(s, &cbb, &server_kex,
		    SSL3_MT_SERVER_KEY_EXCHANGE))
			goto err;

		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_params) != 1)
				goto err;
		} else if (type & SSL_kECDHE) {
			if (ssl3_send_server_kex_ecdhe(s, &cbb_params) != 1)
				goto err;
		} else {
			al = SSL_AD_HANDSHAKE_FAILURE;
			SSLerror(s, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE);
			goto f_err;
		}

		if (!CBB_finish(&cbb_params, &params, &params_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) {
				al = SSL_AD_DECODE_ERROR;
				goto f_err;
			}





























			if (pkey->type == EVP_PKEY_RSA && !SSL_USE_SIGALGS(s))


				md = EVP_md5_sha1();















		


			if (md == NULL) {




























				/* Is this error check actually needed? */
				al = SSL_AD_HANDSHAKE_FAILURE;
				SSLerror(s, SSL_R_UNKNOWN_PKEY_TYPE);
				goto f_err;
			}

			/* Send signature algorithm. */
			if (SSL_USE_SIGALGS(s)) {
				if (!tls12_get_hashandsig(&server_kex, pkey, md)) {
					/* Should never happen */
					al = SSL_AD_INTERNAL_ERROR;
					SSLerror(s, ERR_R_INTERNAL_ERROR);
					goto f_err;
				}
			}

			if ((signature = calloc(1, EVP_PKEY_size(pkey))) == NULL)
				goto err;

			if (!EVP_SignInit_ex(&md_ctx, md, NULL))
				goto err;
			if (!EVP_SignUpdate(&md_ctx, s->s3->client_random,
			    SSL3_RANDOM_SIZE))
				goto err;
			if (!EVP_SignUpdate(&md_ctx, s->s3->server_random,
			    SSL3_RANDOM_SIZE))
				goto err;
			if (!EVP_SignUpdate(&md_ctx, params, params_len))
				goto err;
			if (!EVP_SignFinal(&md_ctx, signature, &signature_len,
			    pkey)) {
				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;
		}

		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		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:
	CBB_cleanup(&cbb_params);

	CBB_cleanup(&cbb);
	EVP_MD_CTX_cleanup(&md_ctx);
	free(params);
	free(signature);

	return (-1);
}

int
ssl3_send_certificate_request(SSL *s)
{
	CBB cbb, cert_request, cert_types, sigalgs, cert_auth, dn;
	STACK_OF(X509_NAME) *sk = NULL;
	X509_NAME *name;
	int i;

	/*
	 * Certificate Request - RFC 5246 section 7.4.4.
	 */

	memset(&cbb, 0, sizeof(cbb));

	if (S3I(s)->hs.state == SSL3_ST_SW_CERT_REQ_A) {
		if (!ssl3_handshake_msg_start(s, &cbb, &cert_request,
		    SSL3_MT_CERTIFICATE_REQUEST))
			goto err;

		if (!CBB_add_u8_length_prefixed(&cert_request, &cert_types))
			goto err;
		if (!ssl3_get_req_cert_types(s, &cert_types))
			goto err;
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730

1731
1732
1733
1734


1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749






1750

1751
1752
1753
1754
1755
1756
1757
1758


1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804


1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824

1825
1826
1827
1828
1829
1830


1831
1832
1833
1834
1835
1836


1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865







1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880

1881
1882
1883
1884
1885
1886
1887
1888
1889
1890



1891
1892
1893
1894
1895
1896
1897
1898

1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932

1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963

1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988



1989



1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001


2002
2003
2004
2005
2006

2007

2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
				goto err;
			if (!CBB_add_space(&dn, &name_data, name_len))
				goto err;
			if (i2d_X509_NAME(name, &name_data) != name_len)
				goto err;
		}

		if (!ssl3_handshake_msg_finish_cbb(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_SW_CERT_REQ_B;
	}

	/* SSL3_ST_SW_CERT_REQ_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (-1);
}

static int
ssl3_get_client_kex_rsa(SSL *s, unsigned char *p, long n)
{
	unsigned char fakekey[SSL_MAX_MASTER_KEY_LENGTH];
	unsigned char *d;

	RSA *rsa = NULL;
	EVP_PKEY *pkey = NULL;
	int i, al;



	d = p;

	arc4random_buf(fakekey, sizeof(fakekey));
	fakekey[0] = s->client_version >> 8;
	fakekey[1] = s->client_version & 0xff;

	pkey = s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey;
	if ((pkey == NULL) || (pkey->type != EVP_PKEY_RSA) ||
	    (pkey->pkey.rsa == NULL)) {
		al = SSL_AD_HANDSHAKE_FAILURE;
		SSLerror(s, SSL_R_MISSING_RSA_CERTIFICATE);
		goto f_err;
	}
	rsa = pkey->pkey.rsa;







	if (2 > n)

		goto truncated;
	n2s(p, i);
	if (n != i + 2) {
		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);

	ERR_clear_error();

	al = -1;

	if (i != 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)))) {
		/*
		 * 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.
		 */
		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.
			 */
		}


	}

	if (al != -1) {
		/*
		 * Some decryption failure -- use random value instead
		 * as countermeasure against Bleichenbacher's attack
		 * 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);

	explicit_bzero(p, i);

	return (1);

truncated:
	al = SSL_AD_DECODE_ERROR;
	SSLerror(s, SSL_R_BAD_PACKET_LENGTH);
f_err:
	ssl3_send_alert(s, SSL3_AL_FATAL, al);
err:


	return (-1);
}

static int
ssl3_get_client_kex_dhe(SSL *s, unsigned char *p, long n)
{


	BIGNUM *bn = NULL;
	int key_size, al;
	CBS cbs, dh_Yc;
	DH *dh;

	if (n < 0)
		goto err;

	CBS_init(&cbs, p, n);

	if (!CBS_get_u16_length_prefixed(&cbs, &dh_Yc))
		goto truncated;

	if (CBS_len(&cbs) != 0)
		goto truncated;

	if (S3I(s)->tmp.dh == NULL) {
		al = SSL_AD_HANDSHAKE_FAILURE;
		SSLerror(s, SSL_R_MISSING_TMP_DH_KEY);
		goto f_err;
	}
	dh = S3I(s)->tmp.dh;

	if ((bn = BN_bin2bn(CBS_data(&dh_Yc), CBS_len(&dh_Yc), NULL)) == NULL) {
		SSLerror(s, SSL_R_BN_LIB);
		goto err;
	}

	key_size = DH_compute_key(p, bn, dh);







	if (key_size <= 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);

	DH_free(S3I(s)->tmp.dh);
	S3I(s)->tmp.dh = NULL;


	BN_clear_free(bn);

	return (1);

 truncated:
	al = SSL_AD_DECODE_ERROR;
	SSLerror(s, SSL_R_BAD_PACKET_LENGTH);
 f_err:
	ssl3_send_alert(s, SSL3_AL_FATAL, al);
 err:



	return (-1);
}

static int
ssl3_get_client_kex_ecdhe_ecp(SSL *s, unsigned char *p, long n)
{
	EC_KEY *srvr_ecdh = NULL;
	EVP_PKEY *clnt_pub_pkey = NULL;

	EC_POINT *clnt_ecpoint = 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;

	/* Initialize structures for server's ECDH key pair. */
	if ((srvr_ecdh = EC_KEY_new()) == NULL) {
		SSLerror(s, ERR_R_MALLOC_FAILURE);
		goto err;
	}

	/*
	 * 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);
		goto err;
	}

	/* Let's get client's public key */
	if ((clnt_ecpoint = EC_POINT_new(group)) == 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;
	}

	/* Compute the shared pre-master secret */
	key_size = ECDH_size(srvr_ecdh);
	if (key_size <= 0) {
		SSLerror(s, ERR_R_ECDH_LIB);
		goto err;
	}
	i = ECDH_compute_key(p, key_size, clnt_ecpoint, srvr_ecdh,


	    NULL);
	if (i <= 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);
	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);

 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);
	BN_CTX_free(bn_ctx);
	return (-1);
}

static int
ssl3_get_client_kex_ecdhe_ecx(SSL *s, unsigned char *p, long n)
{
	uint8_t *shared_key = NULL;
	CBS cbs, ecpoint;
	int ret = -1;

	if (n < 0)
		goto err;

	CBS_init(&cbs, p, n);
	if (!CBS_get_u8_length_prefixed(&cbs, &ecpoint))
		goto err;
	if (CBS_len(&ecpoint) != X25519_KEY_LENGTH)
		goto err;

	if ((shared_key = malloc(X25519_KEY_LENGTH)) == NULL)
		goto err;
	if (!X25519(shared_key, S3I(s)->tmp.x25519, CBS_data(&ecpoint)))







|















|


|
>
|

<
|
>
>
|














>
>
>
>
>
>
|
>

<
|


<
<
|
>
>
|



<
<
|




<
<
|
|

|
|
|
|
<
<
<
<
<
<
<
<
<
<
<
|
<
|
<
|
|
<
|
|
<
<
|
|
|
<
>
>









<





|

|


>
|


|

|
>
>




|

>
>

<
|


<
<
<
<
<
|

<
|














|
>
>
>
>
>
>
>
|

<



|
<
|
<
<




>










>
>
>




|

<
|
>
|

<
<
<
<
<

<
|
<
<
<
<
<
|
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
|
|
|
>

|
<
<
<
<
<
<
|
<
<
<
<
|
<
<
<
<
|
|
<
<
<
<
|
<
<
<
|
|
|
>
|
<
|
|
|
|
|
|
|
|
|
<
<
<
<
<
|
|
|
|
|
|
|
|
|
>
>
>
|
>
>
>
|
<
<

|
<
<
|



|
>
>
|
|
|
|
|
>

>
|
|
<

<
<

<
<
<
<
<
<

|
<
<
<
<
<
<
<
<
|
<

|


|


|

|
<
<







1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703

1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730

1731
1732
1733


1734
1735
1736
1737
1738
1739
1740


1741
1742
1743
1744
1745


1746
1747
1748
1749
1750
1751
1752











1753

1754

1755
1756

1757
1758


1759
1760
1761

1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772

1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800

1801
1802
1803





1804
1805

1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830

1831
1832
1833
1834

1835


1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859

1860
1861
1862
1863





1864

1865





1866





1867









1868
1869
1870
1871
1872
1873






1874




1875




1876
1877




1878



1879
1880
1881
1882
1883

1884
1885
1886
1887
1888
1889
1890
1891
1892





1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909


1910
1911


1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928

1929


1930






1931
1932








1933

1934
1935
1936
1937
1938
1939
1940
1941
1942
1943


1944
1945
1946
1947
1948
1949
1950
				goto err;
			if (!CBB_add_space(&dn, &name_data, name_len))
				goto err;
			if (i2d_X509_NAME(name, &name_data) != name_len)
				goto err;
		}

		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_SW_CERT_REQ_B;
	}

	/* SSL3_ST_SW_CERT_REQ_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (-1);
}

static int
ssl3_get_client_kex_rsa(SSL *s, CBS *cbs)
{
	unsigned char fakekey[SSL_MAX_MASTER_KEY_LENGTH];
	unsigned char *pms = NULL;
	unsigned char *p;
	size_t pms_len = 0;
	EVP_PKEY *pkey = NULL;

	RSA *rsa = NULL;
	CBS enc_pms;
	int decrypt_len;
	int al = -1;

	arc4random_buf(fakekey, sizeof(fakekey));
	fakekey[0] = s->client_version >> 8;
	fakekey[1] = s->client_version & 0xff;

	pkey = s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey;
	if ((pkey == NULL) || (pkey->type != EVP_PKEY_RSA) ||
	    (pkey->pkey.rsa == NULL)) {
		al = SSL_AD_HANDSHAKE_FAILURE;
		SSLerror(s, SSL_R_MISSING_RSA_CERTIFICATE);
		goto f_err;
	}
	rsa = pkey->pkey.rsa;

	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;

	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;


	}

	decrypt_len = RSA_private_decrypt(CBS_len(&enc_pms), CBS_data(&enc_pms),
	    pms, rsa, RSA_PKCS1_PADDING);

	ERR_clear_error();



	if (decrypt_len != SSL_MAX_MASTER_KEY_LENGTH) {
		al = SSL_AD_DECODE_ERROR;
		/* SSLerror(s, SSL_R_BAD_RSA_DECRYPT); */
	}



	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).











		 *

		 * 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) {
		/*
		 * Some decryption failure -- use random value instead
		 * as countermeasure against Bleichenbacher's attack
		 * on PKCS #1 v1.5 RSA padding (see RFC 2246,
		 * section 7.4.7.1).
		 */

		p = fakekey;
	}

	s->session->master_key_length =
	    tls1_generate_master_secret(s,
	        s->session->master_key, p, SSL_MAX_MASTER_KEY_LENGTH);

	freezero(pms, pms_len);

	return (1);

 truncated:
	al = SSL_AD_DECODE_ERROR;
	SSLerror(s, SSL_R_BAD_PACKET_LENGTH);
 f_err:
	ssl3_send_alert(s, SSL3_AL_FATAL, al);
 err:
	freezero(pms, pms_len);

	return (-1);
}

static int
ssl3_get_client_kex_dhe(SSL *s, CBS *cbs)
{
	int key_size = 0, key_len, al;
	unsigned char *key = NULL;
	BIGNUM *bn = NULL;

	CBS dh_Yc;
	DH *dh;






	if (!CBS_get_u16_length_prefixed(cbs, &dh_Yc))
		goto truncated;

	if (CBS_len(cbs) != 0)
		goto truncated;

	if (S3I(s)->tmp.dh == NULL) {
		al = SSL_AD_HANDSHAKE_FAILURE;
		SSLerror(s, SSL_R_MISSING_TMP_DH_KEY);
		goto f_err;
	}
	dh = S3I(s)->tmp.dh;

	if ((bn = BN_bin2bn(CBS_data(&dh_Yc), CBS_len(&dh_Yc), NULL)) == NULL) {
		SSLerror(s, SSL_R_BN_LIB);
		goto err;
	}

	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);

		goto err;
	}

	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);

 truncated:
	al = SSL_AD_DECODE_ERROR;
	SSLerror(s, SSL_R_BAD_PACKET_LENGTH);
 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, CBS *cbs)
{

	unsigned char *key = NULL;
	int key_size = 0, key_len;
	EC_POINT *point = NULL;
	BN_CTX *bn_ctx = NULL;





	const EC_GROUP *group;

	EC_KEY *ecdh;





	CBS public;





	int ret = -1;










	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.
	 */




	if ((ecdh = S3I(s)->tmp.ecdh) == NULL) {



		SSLerror(s, ERR_R_INTERNAL_ERROR);
		goto err;
	}
	group = EC_KEY_get0_group(ecdh);


	/*
	 * 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 ((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 */
	if ((key_size = ECDH_size(ecdh)) <= 0) {
		SSLerror(s, ERR_R_ECDH_LIB);
		goto err;
	}
	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;
	}

	/* 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;

	ret = 1;

 err:
	freezero(key, key_size);
	EC_POINT_free(point);

	BN_CTX_free(bn_ctx);









	return (ret);
}










static int
ssl3_get_client_kex_ecdhe_ecx(SSL *s, CBS *cbs)
{
	uint8_t *shared_key = NULL;
	CBS ecpoint;
	int ret = -1;

	if (!CBS_get_u8_length_prefixed(cbs, &ecpoint))
		goto err;
	if (CBS_len(cbs) != 0)


		goto err;
	if (CBS_len(&ecpoint) != X25519_KEY_LENGTH)
		goto err;

	if ((shared_key = malloc(X25519_KEY_LENGTH)) == NULL)
		goto err;
	if (!X25519(shared_key, S3I(s)->tmp.x25519, CBS_data(&ecpoint)))
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097

2098


2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117





2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131

2132
2133
2134
2135
2136
2137
2138
 err:
	freezero(shared_key, X25519_KEY_LENGTH);

	return (ret);
}

static int
ssl3_get_client_kex_ecdhe(SSL *s, unsigned char *p, long n)
{
        if (S3I(s)->tmp.x25519 != NULL)
		return ssl3_get_client_kex_ecdhe_ecx(s, p, n);

	return ssl3_get_client_kex_ecdhe_ecp(s, p, n);
}

static int
ssl3_get_client_kex_gost(SSL *s, unsigned char *p, long n)
{

	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 long alg_a;
	int Ttag, Tclass;
	long Tlen;
	int al;
	int ret = 0;

	/* Get our certificate private key*/
	alg_a = S3I(s)->hs.new_cipher->algorithm_auth;
	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 client certificate is present and is of the same type,
	 * maybe use it for key exchange.
	 * Don't mind errors from EVP_PKEY_derive_set_peer, because
	 * 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 (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 (EVP_PKEY_decrypt(pkey_ctx, premaster_secret, &outlen,
	    start, inlen) <=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)
		ret = 2;
	else
		ret = 1;
 gerr:







|


|

|



|

<


|
<

|
|








|
>
|
>
>







|
<




|
<

<
<
|
>
>
>
>
>



<
<
<
<
<
<
|




>







1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979

1980
1981
1982

1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006

2007
2008
2009
2010
2011

2012


2013
2014
2015
2016
2017
2018
2019
2020
2021






2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
 err:
	freezero(shared_key, X25519_KEY_LENGTH);

	return (ret);
}

static int
ssl3_get_client_kex_ecdhe(SSL *s, CBS *cbs)
{
        if (S3I(s)->tmp.x25519 != NULL)
		return ssl3_get_client_kex_ecdhe_ecx(s, cbs);

	return ssl3_get_client_kex_ecdhe_ecp(s, cbs);
}

static int
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];

	unsigned long alg_a;
	size_t outlen = 32;
	CBS gostblob;
	int al;
	int ret = 0;

	/* Get our certificate private key*/
	alg_a = S3I(s)->hs.new_cipher->algorithm_auth;
	if (alg_a & SSL_aGOST01)
		pk = s->cert->pkeys[SSL_PKEY_GOST01].privatekey;

	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.
	 * Don't mind errors from EVP_PKEY_derive_set_peer, because
	 * it is completely valid to use a client certificate for
	 * authorization only.
	 */
	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();
	}


	/* Decrypt session key */


	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,
	    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)
		ret = 2;
	else
		ret = 1;
 gerr:
2151
2152
2153
2154
2155
2156
2157
2158
2159

2160
2161
2162
2163
2164
2165
2166
2167



2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188






2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200


2201
2202


2203
2204
2205


2206
2207
2208
2209
2210
2211
2212
2213
2214
2215





2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
	return (-1);
}

int
ssl3_get_client_key_exchange(SSL *s)
{
	unsigned long alg_k;
	unsigned char *p;
	int al, ok;

	long n;

	/* 2048 maxlen is a guess.  How long a key does that permit? */
	n = s->method->internal->ssl_get_message(s, SSL3_ST_SR_KEY_EXCH_A,
	    SSL3_ST_SR_KEY_EXCH_B, SSL3_MT_CLIENT_KEY_EXCHANGE, 2048, &ok);
	if (!ok)
		return ((int)n);




	p = (unsigned char *)s->internal->init_msg;

	alg_k = S3I(s)->hs.new_cipher->algorithm_mkey;

	if (alg_k & SSL_kRSA) {
		if (ssl3_get_client_kex_rsa(s, p, n) != 1)
			goto err;
	} else if (alg_k & SSL_kDHE) {
		if (ssl3_get_client_kex_dhe(s, p, n) != 1)
			goto err;
	} else if (alg_k & SSL_kECDHE) {
		if (ssl3_get_client_kex_ecdhe(s, p, n) != 1)
			goto err;
	} else if (alg_k & SSL_kGOST) {
		if (ssl3_get_client_kex_gost(s, p, n) != 1)
			goto err;
	} else {
		al = SSL_AD_HANDSHAKE_FAILURE;
		SSLerror(s, SSL_R_UNKNOWN_CIPHER_TYPE);
		goto f_err;
	}







	return (1);

 f_err:
	ssl3_send_alert(s, SSL3_AL_FATAL, al);
 err:
	return (-1);
}

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;
	const EVP_MD *md = NULL;
	EVP_MD_CTX mctx;
	EVP_MD_CTX_init(&mctx);

	n = s->method->internal->ssl_get_message(s, SSL3_ST_SR_CERT_VRFY_A,
	    SSL3_ST_SR_CERT_VRFY_B, -1, SSL3_RT_MAX_PLAIN_LENGTH, &ok);
	if (!ok)
		return ((int)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) {
		S3I(s)->tmp.reuse_message = 1;
		if (peer != NULL) {
			al = SSL_AD_UNEXPECTED_MESSAGE;
			SSLerror(s, SSL_R_MISSING_VERIFY_MESSAGE);







<

>








>
>
>
|




|


|


|


|






>
>
>
>
>
>












>
>

|
>
>
|
<
|
>
>
|
|
|







>
>
>
>
>




<
<
<







2047
2048
2049
2050
2051
2052
2053

2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112

2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134



2135
2136
2137
2138
2139
2140
2141
	return (-1);
}

int
ssl3_get_client_key_exchange(SSL *s)
{
	unsigned long alg_k;

	int al, ok;
	CBS cbs;
	long n;

	/* 2048 maxlen is a guess.  How long a key does that permit? */
	n = s->method->internal->ssl_get_message(s, SSL3_ST_SR_KEY_EXCH_A,
	    SSL3_ST_SR_KEY_EXCH_B, SSL3_MT_CLIENT_KEY_EXCHANGE, 2048, &ok);
	if (!ok)
		return ((int)n);

	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, &cbs) != 1)
			goto err;
	} else if (alg_k & SSL_kDHE) {
		if (ssl3_get_client_kex_dhe(s, &cbs) != 1)
			goto err;
	} else if (alg_k & SSL_kECDHE) {
		if (ssl3_get_client_kex_ecdhe(s, &cbs) != 1)
			goto err;
	} else if (alg_k & SSL_kGOST) {
		if (ssl3_get_client_kex_gost(s, &cbs) != 1)
			goto err;
	} else {
		al = SSL_AD_HANDSHAKE_FAILURE;
		SSLerror(s, SSL_R_UNKNOWN_CIPHER_TYPE);
		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:
	ssl3_send_alert(s, SSL3_AL_FATAL, al);
 err:
	return (-1);
}

int
ssl3_get_cert_verify(SSL *s)
{
	CBS cbs, signature;
	const EVP_MD *md = NULL;
	EVP_PKEY *pkey = NULL;
	X509 *peer = NULL;
	EVP_MD_CTX mctx;
	uint8_t hash_id, sig_id;
	int al, ok, sigalg, verify;

	int type = 0;
	int ret = 0;
	long hdatalen;
	void *hdata;
	long n;

	EVP_MD_CTX_init(&mctx);

	n = s->method->internal->ssl_get_message(s, SSL3_ST_SR_CERT_VRFY_A,
	    SSL3_ST_SR_CERT_VRFY_B, -1, SSL3_RT_MAX_PLAIN_LENGTH, &ok);
	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);



	}

	if (S3I(s)->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) {
		S3I(s)->tmp.reuse_message = 1;
		if (peer != NULL) {
			al = SSL_AD_UNEXPECTED_MESSAGE;
			SSLerror(s, SSL_R_MISSING_VERIFY_MESSAGE);
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263


2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288


2289


2290
2291


2292
2293
2294


2295
2296
2297
2298
2299
2300
2301
2302
2303




2304

2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321

2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345

2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361

2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396

2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426

2427
2428
2429
2430
2431
2432
2433

	if (S3I(s)->change_cipher_spec) {
		SSLerror(s, SSL_R_CCS_RECEIVED_EARLY);
		al = SSL_AD_UNEXPECTED_MESSAGE;
		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 (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) {
			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)) {
			SSLerror(s, ERR_R_EVP_LIB);
			al = SSL_AD_INTERNAL_ERROR;
			goto f_err;
		}

		if (EVP_VerifyFinal(&mctx, p, i, pkey) <= 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) {
			al = SSL_AD_DECRYPT_ERROR;
			SSLerror(s, SSL_R_BAD_RSA_DECRYPT);
			goto f_err;
		}
		if (i == 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,
		    &(S3I(s)->tmp.cert_verify_md[MD5_DIGEST_LENGTH]),
		    SHA_DIGEST_LENGTH, p, i, pkey->pkey.ec);

		if (j <= 0) {
			/* bad signature */
			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 ||
	    pkey->type == NID_id_GostR3410_2001) {
		long hdatalen = 0;
		void *hdata;
		unsigned char signature[128];
		unsigned int siglen = sizeof(signature);
		int nid;
		EVP_PKEY_CTX *pctx;


		hdatalen = BIO_get_mem_data(S3I(s)->handshake_buffer, &hdata);
		if (hdatalen <= 0) {
			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))) {
			SSLerror(s, ERR_R_EVP_LIB);
			al = SSL_AD_INTERNAL_ERROR;
			goto f_err;
		}
		pctx = EVP_PKEY_CTX_new(pkey, NULL);
		if (!pctx) {
			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_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)) {
			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) {

			al = SSL_AD_DECRYPT_ERROR;
			SSLerror(s, SSL_R_BAD_SIGNATURE);
			EVP_PKEY_CTX_free(pctx);
			goto f_err;
		}

		EVP_PKEY_CTX_free(pctx);
	} else
#endif
	{
		SSLerror(s, ERR_R_INTERNAL_ERROR);
		al = SSL_AD_UNSUPPORTED_CERTIFICATE;
		goto f_err;
	}


	ret = 1;
	if (0) {
truncated:
		al = SSL_AD_DECODE_ERROR;
		SSLerror(s, SSL_R_BAD_PACKET_LENGTH);
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;
	}

	EVP_MD_CTX_cleanup(&mctx);
	EVP_PKEY_free(pkey);
	return (ret);
}

int
ssl3_get_client_certificate(SSL *s)







<
<






|
|
>
>
|


<
<
|
<
<
|
<
|

<
<
<
<
<
|
|
<




|
>
>
|
>
>
|
|
>
>
|
<
<
>
>
|
|

|
<




>
>
>
>
|
>

<
<












<
|
>




<
|
|
|
|
|




|




<
|
|

|
>
|
<








<
<
|
|
<

>








|




|
<






|



|
|
<





<
|
>















<


|


|


|





>







2159
2160
2161
2162
2163
2164
2165


2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178


2179


2180

2181
2182





2183
2184

2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199


2200
2201
2202
2203
2204
2205

2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216


2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228

2229
2230
2231
2232
2233
2234

2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248

2249
2250
2251
2252
2253
2254

2255
2256
2257
2258
2259
2260
2261
2262


2263
2264

2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280

2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292

2293
2294
2295
2296
2297

2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314

2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336

	if (S3I(s)->change_cipher_spec) {
		SSLerror(s, SSL_R_CCS_RECEIVED_EARLY);
		al = SSL_AD_UNEXPECTED_MESSAGE;
		goto f_err;
	}



	/*
	 * 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 ((pkey->type == NID_id_GostR3410_94 ||
	     pkey->type == NID_id_GostR3410_2001) && CBS_len(&cbs) == 64) {
		CBS_dup(&cbs, &signature);
		if (!CBS_skip(&cbs, CBS_len(&cbs)))
			goto err;
	} else {
		if (SSL_USE_SIGALGS(s)) {


			if (!CBS_get_u8(&cbs, &hash_id))


				goto truncated;

			if (!CBS_get_u8(&cbs, &sig_id))
				goto truncated;






			if ((md = tls12_get_hash(hash_id)) == NULL) {

				SSLerror(s, SSL_R_UNKNOWN_DIGEST);
				al = SSL_AD_DECODE_ERROR;
				goto f_err;
			}

			/* Check key type is consistent with signature. */
			if ((sigalg = tls12_get_sigid(pkey)) == -1) {
				/* Should never happen */
				SSLerror(s, ERR_R_INTERNAL_ERROR);
				goto err;
			}
			if (sigalg != sig_id) {
				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 (SSL_USE_SIGALGS(s)) {


		hdatalen = BIO_get_mem_data(S3I(s)->handshake_buffer, &hdata);
		if (hdatalen <= 0) {
			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)) {
			SSLerror(s, ERR_R_EVP_LIB);
			al = SSL_AD_INTERNAL_ERROR;
			goto f_err;
		}

		if (EVP_VerifyFinal(&mctx, CBS_data(&signature),
		    CBS_len(&signature), pkey) <= 0) {
			al = SSL_AD_DECRYPT_ERROR;
			SSLerror(s, SSL_R_BAD_SIGNATURE);
			goto f_err;
		}

	} 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 (verify == 0) {
			al = SSL_AD_DECRYPT_ERROR;
			SSLerror(s, SSL_R_BAD_RSA_SIGNATURE);
			goto f_err;
		}

	} 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, 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 ||
	    pkey->type == NID_id_GostR3410_2001) {


		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) {
			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))) {
			SSLerror(s, ERR_R_EVP_LIB);
			al = SSL_AD_INTERNAL_ERROR;
			goto f_err;
		}
		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, 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)) {

			SSLerror(s, ERR_R_EVP_LIB);
			al = SSL_AD_INTERNAL_ERROR;
			EVP_PKEY_CTX_free(pctx);
			goto f_err;
		}

		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);
			goto f_err;
		}

		EVP_PKEY_CTX_free(pctx);
	} else
#endif
	{
		SSLerror(s, ERR_R_INTERNAL_ERROR);
		al = SSL_AD_UNSUPPORTED_CERTIFICATE;
		goto f_err;
	}


	ret = 1;
	if (0) {
 truncated:
		al = SSL_AD_DECODE_ERROR;
		SSLerror(s, SSL_R_BAD_PACKET_LENGTH);
 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;
	}
 err:
	EVP_MD_CTX_cleanup(&mctx);
	EVP_PKEY_free(pkey);
	return (ret);
}

int
ssl3_get_client_certificate(SSL *s)
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622





2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657


2658
2659
2660

2661
2662



2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708




























2709
2710
2711
2712
2713
2714

2715

2716
2717
2718
2719
2720
2721
2722
2723
2724

2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746

2747
2748
2749
2750
2751




2752
2753
2754
2755
2756



2757

2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793

	if (S3I(s)->hs.state == SSL3_ST_SW_CERT_A) {
		if ((x = ssl_get_server_send_cert(s)) == NULL) {
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			return (0);
		}

		if (!ssl3_handshake_msg_start_cbb(s, &cbb, &server_cert,
		    SSL3_MT_CERTIFICATE))
			goto err;
		if (!ssl3_output_cert_chain(s, &server_cert, x))
			goto err;
		if (!ssl3_handshake_msg_finish_cbb(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_SW_CERT_B;
	}

	/* SSL3_ST_SW_CERT_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (0);
}

/* send a new session ticket (not necessarily for a new session) */
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;
	SSL_CTX *tctx = s->initial_ctx;
	unsigned char iv[EVP_MAX_IV_LENGTH];
	unsigned char key_name[16];

	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);

		/*
		 * 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;



		/* ID is irrelevant for the ticket */
		sess->session_id_length = 0;


		slen = i2d_SSL_SESSION(sess, NULL);



		if (slen > slen_full) {
			/* shouldn't ever happen */
			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))
			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.
		 */
		if (tctx->internal->tlsext_ticket_key_cb) {
			if (tctx->internal->tlsext_ticket_key_cb(s,
			    key_name, iv, &ctx, &hctx, 1) < 0) {
				EVP_CIPHER_CTX_cleanup(&ctx);
				goto err;
			}
		} else {
			arc4random_buf(iv, 16);
			EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL,
			    tctx->internal->tlsext_tick_aes_key, iv);
			HMAC_Init_ex(&hctx, tctx->internal->tlsext_tick_hmac_key,
			    16, tlsext_tick_md(), NULL);
			memcpy(key_name, tctx->internal->tlsext_tick_key_name, 16);
		}





























		/*
		 * 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);


		S3I(s)->hs.state = SSL3_ST_SW_SESSION_TICKET_B;

		freezero(senc, slen_full);
	}





	/* SSL3_ST_SW_SESSION_TICKET_B */
	return (ssl3_handshake_write(s));

 err:



	freezero(senc, slen_full);


	return (-1);
}

int
ssl3_send_cert_status(SSL *s)
{
	CBB cbb, certstatus, ocspresp;

	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,
		    SSL3_MT_CERTIFICATE_STATUS))
			goto err;
		if (!CBB_add_u8(&certstatus, s->tlsext_status_type))
			goto err;
		if (!CBB_add_u24_length_prefixed(&certstatus, &ocspresp))
			goto err;
		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))
			goto err;

		S3I(s)->hs.state = SSL3_ST_SW_CERT_STATUS_B;
	}

	/* SSL3_ST_SW_CERT_STATUS_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (-1);
}







|




|


















>
>
>
>
>
|
|
|
<
<



|
<
<

<
<
<
|
|
<
|
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
>
>

<
<
>

|
>
>
>
<
<
<
|
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<

|
<
|
<
<


|
|
|

|














>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






>
|
>

|
|
<
<
|
|
<
|
>
|
<
<
|
|
|
<

<
|
<
<
|
<
<
|
|
<
<
<

|
>


|
<
|
>
>
>
>





>
>
>
|
>












|









|













2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533


2534
2535
2536
2537


2538



2539
2540

2541







2542








2543
2544
2545


2546
2547
2548
2549
2550
2551



2552



2553











2554
2555

2556


2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617


2618
2619

2620
2621
2622


2623
2624
2625

2626

2627


2628


2629
2630



2631
2632
2633
2634
2635
2636

2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687

	if (S3I(s)->hs.state == SSL3_ST_SW_CERT_A) {
		if ((x = ssl_get_server_send_cert(s)) == NULL) {
			SSLerror(s, ERR_R_INTERNAL_ERROR);
			return (0);
		}

		if (!ssl3_handshake_msg_start(s, &cbb, &server_cert,
		    SSL3_MT_CERTIFICATE))
			goto err;
		if (!ssl3_output_cert_chain(s, &server_cert, x))
			goto err;
		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_SW_CERT_B;
	}

	/* SSL3_ST_SW_CERT_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (0);
}

/* send a new session ticket (not necessarily for a new session) */
int
ssl3_send_newsession_ticket(SSL *s)
{
	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;






	/*
	 * New Session Ticket - RFC 5077, section 3.3.

	 */
















	EVP_CIPHER_CTX_init(&ctx);
	HMAC_CTX_init(&hctx);



	memset(&cbb, 0, sizeof(cbb));

	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;







		if (!SSL_SESSION_ticket(s->session, &session, &session_len))











			goto err;
		if (session_len > 0xffff)

			goto err;



		/*
		 * 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 != NULL) {
			if (tctx->internal->tlsext_ticket_key_cb(s,
			    key_name, iv, &ctx, &hctx, 1) < 0) {
				EVP_CIPHER_CTX_cleanup(&ctx);
				goto err;
			}
		} else {
			arc4random_buf(iv, 16);
			EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL,
			    tctx->internal->tlsext_tick_aes_key, iv);
			HMAC_Init_ex(&hctx, tctx->internal->tlsext_tick_hmac_key,
			    16, tlsext_tick_md(), NULL);
			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.
		 */
		if (!CBB_add_u32(&session_ticket,
		    s->internal->hit ? 0 : s->session->timeout))
			goto err;

		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;

		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:
	CBB_cleanup(&cbb);
	EVP_CIPHER_CTX_cleanup(&ctx);
	HMAC_CTX_cleanup(&hctx);
	freezero(session, session_len);
	free(enc_session);

	return (-1);
}

int
ssl3_send_cert_status(SSL *s)
{
	CBB cbb, certstatus, ocspresp;

	memset(&cbb, 0, sizeof(cbb));

	if (S3I(s)->hs.state == SSL3_ST_SW_CERT_STATUS_A) {
		if (!ssl3_handshake_msg_start(s, &cbb, &certstatus,
		    SSL3_MT_CERTIFICATE_STATUS))
			goto err;
		if (!CBB_add_u8(&certstatus, s->tlsext_status_type))
			goto err;
		if (!CBB_add_u24_length_prefixed(&certstatus, &ocspresp))
			goto err;
		if (!CBB_add_bytes(&ocspresp, s->internal->tlsext_ocsp_resp,
		    s->internal->tlsext_ocsp_resplen))
			goto err;
		if (!ssl3_handshake_msg_finish(s, &cbb))
			goto err;

		S3I(s)->hs.state = SSL3_ST_SW_CERT_STATUS_B;
	}

	/* SSL3_ST_SW_CERT_STATUS_B */
	return (ssl3_handshake_write(s));

 err:
	CBB_cleanup(&cbb);

	return (-1);
}
Changes to jni/libressl/ssl/ssl_tlsext.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_tlsext.c,v 1.21 2018/02/08 11:30:30 jsing Exp $ */
/*
 * Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org>
 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
 * Copyright (c) 2017 Bob Beck <beck@openbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
|







1
2
3
4
5
6
7
8
/* $OpenBSD: ssl_tlsext.c,v 1.22 2018/05/12 17:27:22 jsing Exp $ */
/*
 * Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org>
 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
 * Copyright (c) 2017 Bob Beck <beck@openbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
329
330
331
332
333
334
335
336

337

338
339
340
341
342
343
344
345
346
347
348
349
350
	if (!CBS_contains_zero_byte(&ecpf)) {
		SSLerror(s, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST);
		goto err;
	}

	if (!s->internal->hit) {
		if (!CBS_stow(&ecpf, &(SSI(s)->tlsext_ecpointformatlist),
		    &(SSI(s)->tlsext_ecpointformatlist_length)))

			goto err;

	}

	return 1;

 err:
	*alert = TLS1_AD_INTERNAL_ERROR;
	return 0;
}

int
tlsext_ecpf_clienthello_needs(SSL *s)
{
	return ssl_has_ecc_ciphers(s);







|
>
|
>





|







329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
	if (!CBS_contains_zero_byte(&ecpf)) {
		SSLerror(s, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST);
		goto err;
	}

	if (!s->internal->hit) {
		if (!CBS_stow(&ecpf, &(SSI(s)->tlsext_ecpointformatlist),
		    &(SSI(s)->tlsext_ecpointformatlist_length))) {
			*alert = TLS1_AD_INTERNAL_ERROR;
			return 0;
		}
	}

	return 1;

 err:
	*alert = SSL_AD_DECODE_ERROR;
	return 0;
}

int
tlsext_ecpf_clienthello_needs(SSL *s)
{
	return ssl_has_ecc_ciphers(s);
Changes to jni/libressl/ssl/t1_clnt.c.
1
2
3
4
5
6
7
8
/* $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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: t1_clnt.c,v 1.26 2018/08/30 16:56:16 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.
 *
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
	.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,







<
<
<
<
<







69
70
71
72
73
74
75





76
77
78
79
80
81
82
	.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,
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
	.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,







<
<
<
<
<







98
99
100
101
102
103
104





105
106
107
108
109
110
111
	.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,
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
	.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,







<
<
<
<
<







127
128
129
130
131
132
133





134
135
136
137
138
139
140
	.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,
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
	.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,







<
<
<
<
<







156
157
158
159
160
161
162





163
164
165
166
167
168
169
	.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,
Changes to jni/libressl/ssl/t1_enc.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: t1_enc.c,v 1.109 2017/05/06 22:24:58 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: t1_enc.c,v 1.114 2018/09/08 14:39:41 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.
 *
393
394
395
396
397
398
399

400
401
402
403


404
405
406
407
408
409
410
tls1_change_cipher_state_aead(SSL *s, char is_read, const unsigned char *key,
    unsigned key_len, const unsigned char *iv, unsigned iv_len)
{
	const EVP_AEAD *aead = S3I(s)->tmp.new_aead;
	SSL_AEAD_CTX *aead_ctx;

	if (is_read) {

		if (!tls1_aead_ctx_init(&s->internal->aead_read_ctx))
			return 0;
		aead_ctx = s->internal->aead_read_ctx;
	} else {


		if (!tls1_aead_ctx_init(&s->internal->aead_write_ctx))
			return 0;
		aead_ctx = s->internal->aead_write_ctx;
	}

	if (!EVP_AEAD_CTX_init(&aead_ctx->ctx, aead, key, key_len,
	    EVP_AEAD_DEFAULT_TAG_LENGTH, NULL))







>




>
>







393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
tls1_change_cipher_state_aead(SSL *s, char is_read, const unsigned char *key,
    unsigned key_len, const unsigned char *iv, unsigned iv_len)
{
	const EVP_AEAD *aead = S3I(s)->tmp.new_aead;
	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;
	}

	if (!EVP_AEAD_CTX_init(&aead_ctx->ctx, aead, key, key_len,
	    EVP_AEAD_DEFAULT_TAG_LENGTH, NULL))
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458

459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
	return (1);
}

/*
 * 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.
 */
static int
tls1_change_cipher_state_cipher(SSL *s, char is_read, char use_client_keys,
    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)
{
	EVP_CIPHER_CTX *cipher_ctx;
	const EVP_CIPHER *cipher;
	EVP_MD_CTX *mac_ctx;

	const EVP_MD *mac;
	int mac_type;

	cipher = S3I(s)->tmp.new_sym_enc;
	mac = S3I(s)->tmp.new_hash;
	mac_type = S3I(s)->tmp.new_mac_pkey_type;

	if (is_read) {
		if (S3I(s)->hs.new_cipher->algorithm2 & TLS1_STREAM_MAC)
			s->internal->mac_flags |= SSL_MAC_FLAG_READ_MAC_STREAM;
		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;

		if ((cipher_ctx = EVP_CIPHER_CTX_new()) == NULL)
			goto err;
		s->enc_read_ctx = cipher_ctx;
		if ((mac_ctx = EVP_MD_CTX_create()) == NULL)
			goto err;
		s->read_hash = mac_ctx;
	} else {
		if (S3I(s)->hs.new_cipher->algorithm2 & TLS1_STREAM_MAC)
			s->internal->mac_flags |= SSL_MAC_FLAG_WRITE_MAC_STREAM;
		else
			s->internal->mac_flags &= ~SSL_MAC_FLAG_WRITE_MAC_STREAM;

		/*
		 * DTLS fragments retain a pointer to the compression, cipher
		 * and hash contexts, so that it can restore state in order
		 * to perform retransmissions. As such, we cannot free write
		 * 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 ((cipher_ctx = EVP_CIPHER_CTX_new()) == NULL)
			goto err;
		s->internal->enc_write_ctx = cipher_ctx;
		if ((mac_ctx = EVP_MD_CTX_create()) == 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);
	}

	if (S3I(s)->hs.new_cipher->algorithm_enc == SSL_eGOST2814789CNT) {
		int nid;
		if (S3I(s)->hs.new_cipher->algorithm2 & SSL_HANDSHAKE_MAC_GOST94)
			nid = NID_id_Gost28147_89_CryptoPro_A_ParamSet;
		else
			nid = NID_id_tc26_gost_28147_param_Z;







|
<


|







>













<
|
<
<




|















|
<
<
<
|
|



|




<
<
<
<
<
<
|

<
|
|
<
|
|
|
<
<
<
<
<







443
444
445
446
447
448
449
450

451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474

475


476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496



497
498
499
500
501
502
503
504
505
506






507
508

509
510

511
512
513





514
515
516
517
518
519
520
	return (1);
}

/*
 * 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.

 */
static int
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)
{
	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;

	cipher = S3I(s)->tmp.new_sym_enc;
	mac = S3I(s)->tmp.new_hash;
	mac_type = S3I(s)->tmp.new_mac_pkey_type;

	if (is_read) {
		if (S3I(s)->hs.new_cipher->algorithm2 & TLS1_STREAM_MAC)
			s->internal->mac_flags |= SSL_MAC_FLAG_READ_MAC_STREAM;
		else
			s->internal->mac_flags &= ~SSL_MAC_FLAG_READ_MAC_STREAM;


		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_new()) == NULL)
			goto err;
		s->read_hash = mac_ctx;
	} else {
		if (S3I(s)->hs.new_cipher->algorithm2 & TLS1_STREAM_MAC)
			s->internal->mac_flags |= SSL_MAC_FLAG_WRITE_MAC_STREAM;
		else
			s->internal->mac_flags &= ~SSL_MAC_FLAG_WRITE_MAC_STREAM;

		/*
		 * DTLS fragments retain a pointer to the compression, cipher
		 * and hash contexts, so that it can restore state in order
		 * to perform retransmissions. As such, we cannot free write
		 * contexts that are used for DTLS - these are instead freed
		 * by DTLS when its frees a ChangeCipherSpec fragment.
		 */
		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_new()) == NULL)
			goto err;
		s->internal->write_hash = mac_ctx;
	}







	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;
		if (S3I(s)->hs.new_cipher->algorithm2 & SSL_HANDSHAKE_MAC_GOST94)
			nid = NID_id_Gost28147_89_CryptoPro_A_ParamSet;
		else
			nid = NID_id_tc26_gost_28147_param_Z;
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
	const unsigned char *mac_secret, *key, *iv;
	int mac_secret_size, key_len, iv_len;
	unsigned char *key_block, *seq;
	const EVP_CIPHER *cipher;
	const EVP_AEAD *aead;
	char is_read, use_client_keys;


	cipher = S3I(s)->tmp.new_sym_enc;
	aead = S3I(s)->tmp.new_aead;

	/*
	 * is_read is true if we have just read a ChangeCipherSpec message,
	 * that is we need to update the read cipherspec. Otherwise we have
	 * just written one.
	 */
	is_read = (which & SSL3_CC_READ) != 0;

	/*
	 * use_client_keys is true if we wish to use the keys for the "client
	 * write" direction. This is the case if we're a client sending a
	 * ChangeCipherSpec, or a server reading a client's ChangeCipherSpec.
	 */
	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().
	 */
	if (!SSL_IS_DTLS(s)) {
		seq = is_read ? S3I(s)->read_sequence : S3I(s)->write_sequence;
		memset(seq, 0, SSL3_SEQUENCE_SIZE);
	}

	if (aead != NULL) {
		key_len = EVP_AEAD_key_length(aead);
		iv_len = SSL_CIPHER_AEAD_FIXED_NONCE_LEN(S3I(s)->hs.new_cipher);
	} 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;

	key_block = S3I(s)->hs.key_block;
	client_write_mac_secret = key_block;
	key_block += mac_secret_size;







<


















<















<
<
<
<







540
541
542
543
544
545
546

547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564

565
566
567
568
569
570
571
572
573
574
575
576
577
578
579




580
581
582
583
584
585
586
	const unsigned char *mac_secret, *key, *iv;
	int mac_secret_size, key_len, iv_len;
	unsigned char *key_block, *seq;
	const EVP_CIPHER *cipher;
	const EVP_AEAD *aead;
	char is_read, use_client_keys;


	cipher = S3I(s)->tmp.new_sym_enc;
	aead = S3I(s)->tmp.new_aead;

	/*
	 * is_read is true if we have just read a ChangeCipherSpec message,
	 * that is we need to update the read cipherspec. Otherwise we have
	 * just written one.
	 */
	is_read = (which & SSL3_CC_READ) != 0;

	/*
	 * use_client_keys is true if we wish to use the keys for the "client
	 * write" direction. This is the case if we're a client sending a
	 * ChangeCipherSpec, or a server reading a client's ChangeCipherSpec.
	 */
	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().
	 */
	if (!SSL_IS_DTLS(s)) {
		seq = is_read ? S3I(s)->read_sequence : S3I(s)->write_sequence;
		memset(seq, 0, SSL3_SEQUENCE_SIZE);
	}

	if (aead != NULL) {
		key_len = EVP_AEAD_key_length(aead);
		iv_len = SSL_CIPHER_AEAD_FIXED_NONCE_LEN(S3I(s)->hs.new_cipher);
	} else {
		key_len = EVP_CIPHER_key_length(cipher);
		iv_len = EVP_CIPHER_iv_length(cipher);




	}

	mac_secret_size = s->s3->tmp.new_mac_secret_size;

	key_block = S3I(s)->hs.key_block;
	client_write_mac_secret = key_block;
	key_block += mac_secret_size;
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
	}

	if (aead != NULL) {
		return tls1_change_cipher_state_aead(s, is_read, key, key_len,
		    iv, iv_len);
	}

	return tls1_change_cipher_state_cipher(s, is_read, use_client_keys,
	    mac_secret, mac_secret_size, key, key_len, iv, iv_len);

err2:
	return (0);
}

int







|







619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
	}

	if (aead != NULL) {
		return tls1_change_cipher_state_aead(s, is_read, key, key_len,
		    iv, iv_len);
	}

	return tls1_change_cipher_state_cipher(s, is_read,
	    mac_secret, mac_secret_size, key, key_len, iv, iv_len);

err2:
	return (0);
}

int
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
	const EVP_MD *mac = NULL;
	int ret = 0;

	if (S3I(s)->hs.key_block_len != 0)
		return (1);

	if (s->session->cipher &&
	    (s->session->cipher->algorithm2 & SSL_CIPHER_ALGORITHM2_AEAD)) {
		if (!ssl_cipher_get_evp_aead(s->session, &aead)) {
			SSLerror(s, SSL_R_CIPHER_OR_HASH_UNAVAILABLE);
			return (0);
		}
		key_len = EVP_AEAD_key_length(aead);
		iv_len = SSL_CIPHER_AEAD_FIXED_NONCE_LEN(s->session->cipher);
	} else {
		if (!ssl_cipher_get_evp(s->session, &cipher, &mac, &mac_type,
		    &mac_secret_size)) {
			SSLerror(s, SSL_R_CIPHER_OR_HASH_UNAVAILABLE);
			return (0);
		}
		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;







|














<
<
<
<







641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662




663
664
665
666
667
668
669
	const EVP_MD *mac = NULL;
	int ret = 0;

	if (S3I(s)->hs.key_block_len != 0)
		return (1);

	if (s->session->cipher &&
	    (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);
		}
		key_len = EVP_AEAD_key_length(aead);
		iv_len = SSL_CIPHER_AEAD_FIXED_NONCE_LEN(s->session->cipher);
	} else {
		if (!ssl_cipher_get_evp(s->session, &cipher, &mac, &mac_type,
		    &mac_secret_size)) {
			SSLerror(s, SSL_R_CIPHER_OR_HASH_UNAVAILABLE);
			return (0);
		}
		key_len = EVP_CIPHER_key_length(cipher);
		iv_len = EVP_CIPHER_iv_length(cipher);




	}

	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;
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
		memmove(rec->data, rec->input, rec->length);
		rec->input = rec->data;
		ret = 1;
	} else {
		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) {
			i = bs - ((int)l % bs);

			/* Add weird padding of upto 256 bytes */

			/* we need to add 'i' padding bytes of value j */
			j = i - 1;
			for (k = (int)l; k < (int)(l + i); k++)







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|







927
928
929
930
931
932
933





















934
935
936
937
938
939
940
941
		memmove(rec->data, rec->input, rec->length);
		rec->input = rec->data;
		ret = 1;
	} else {
		l = rec->length;
		bs = EVP_CIPHER_block_size(ds->cipher);






















		if (bs != 1 && send) {
			i = bs - ((int)l % bs);

			/* Add weird padding of upto 256 bytes */

			/* we need to add 'i' padding bytes of value j */
			j = i - 1;
			for (k = (int)l; k < (int)(l + i); k++)
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
				return 0;
		}

		i = EVP_Cipher(ds, rec->data, rec->input, l);
		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)
			mac_size = EVP_MD_CTX_size(s->read_hash);
		if ((bs != 1) && !send)
			ret = tls1_cbc_remove_padding(s, rec, bs, mac_size);
		if (pad && !send)







<
<
<
<
<







949
950
951
952
953
954
955





956
957
958
959
960
961
962
				return 0;
		}

		i = EVP_Cipher(ds, rec->data, rec->input, l);
		if ((EVP_CIPHER_flags(ds->cipher) &
		    EVP_CIPH_FLAG_CUSTOM_CIPHER) ? (i < 0) : (i == 0))
			return -1;	/* AEAD can fail to verify MAC */






		ret = 1;
		if (EVP_MD_CTX_md(s->read_hash) != NULL)
			mac_size = EVP_MD_CTX_size(s->read_hash);
		if ((bs != 1) && !send)
			ret = tls1_cbc_remove_padding(s, rec, bs, mac_size);
		if (pad && !send)
Changes to jni/libressl/ssl/t1_hash.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: t1_hash.c,v 1.2 2017/05/06 16:18:36 jsing Exp $ */
/*
 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/* $OpenBSD: t1_hash.c,v 1.3 2018/09/05 16:58:59 jsing Exp $ */
/*
 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
 *
 * 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.
 *
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
	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;
	}







|







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
	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_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;
	}
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
	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;
}







|

















|







|


76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
	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_handshake_hash_free(SSL *s)
{
	EVP_MD_CTX_free(S3I(s)->handshake_hash);
	S3I(s)->handshake_hash = NULL;
}
Changes to jni/libressl/ssl/t1_lib.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: t1_lib.c,v 1.141 2018/02/08 11:30:30 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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: t1_lib.c,v 1.144 2018/08/24 18:10: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.
 *
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
	}
}

/* Since the server cache lookup is done early on in the processing of the
 * 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.
 *   ret: (output) on return, if a ticket was decrypted, then this is set to
 *       point to the resulting session.
 *
 * If s->internal->tls_session_secret_cb is set then we are expecting a pre-shared key
 * ciphersuite, in which case we have no use for session tickets and one will
 * never be decrypted, nor will s->internal->tlsext_ticket_expected be set to 1.
 *







|
<
<
|
|







811
812
813
814
815
816
817
818


819
820
821
822
823
824
825
826
827
	}
}

/* Since the server cache lookup is done early on in the processing of the
 * 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.


 *   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.
 *
 * If s->internal->tls_session_secret_cb is set then we are expecting a pre-shared key
 * ciphersuite, in which case we have no use for session tickets and one will
 * never be decrypted, nor will s->internal->tlsext_ticket_expected be set to 1.
 *
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855

856

857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896

897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
 *   a new session ticket to the client because the client indicated support
 *   (and s->internal->tls_session_secret_cb is NULL) but the client either doesn't have
 *   a session ticket or we couldn't use the one it gave us, or if
 *   s->ctx->tlsext_ticket_key_cb asked to renew the client's ticket.
 *   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)
{
	/* Point after session ID in client hello */
	CBS session_id, cookie, cipher_list, compress_algo, extensions;

	*ret = NULL;
	s->internal->tlsext_ticket_expected = 0;



	/* 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)
		return 0;
	if (!CBS_get_u16_length_prefixed(&session_id, &extensions))
		return -1;

	while (CBS_len(&extensions) > 0) {
		CBS ext_data;
		uint16_t ext_type;


		if (!CBS_get_u16(&extensions, &ext_type) ||
		    !CBS_get_u16_length_prefixed(&extensions, &ext_data))
			return -1;

		if (ext_type == TLSEXT_TYPE_session_ticket) {
			int r;
			if (CBS_len(&ext_data) == 0) {
				/* The client will accept a ticket but doesn't
				 * currently have one. */
				s->internal->tlsext_ticket_expected = 1;
				return 1;
			}
			if (s->internal->tls_session_secret_cb) {
				/* Indicate that the ticket couldn't be
				 * decrypted rather than generating the session
				 * from ticket now, trigger abbreviated
				 * handshake based on external mechanism to
				 * calculate the master secret later. */
				return 2;
			}

			r = tls_decrypt_ticket(s, CBS_data(&ext_data),
			    CBS_len(&ext_data), session, session_len, ret);

			switch (r) {
			case 2: /* ticket couldn't be decrypted */
				s->internal->tlsext_ticket_expected = 1;
				return 2;
			case 3: /* ticket was decrypted */
				return r;







|
|

<
|

<

>

>
|
|



<
<

<
<
|
<
|
|
<
<
|
<
<
<
<
<
|
<
<
|

<
<
<
<
<
<
<
|



<

>













|









|







839
840
841
842
843
844
845
846
847
848

849
850

851
852
853
854
855
856
857
858
859


860


861

862
863


864





865


866
867







868
869
870
871

872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
 *   a new session ticket to the client because the client indicated support
 *   (and s->internal->tls_session_secret_cb is NULL) but the client either doesn't have
 *   a session ticket or we couldn't use the one it gave us, or if
 *   s->ctx->tlsext_ticket_key_cb asked to renew the client's ticket.
 *   Otherwise, s->internal->tlsext_ticket_expected is set to 0.
 */
int
tls1_process_ticket(SSL *s, const unsigned char *session_id, int session_id_len,
    CBS *ext_block, SSL_SESSION **ret)
{

	CBS extensions;


	s->internal->tlsext_ticket_expected = 0;
	*ret = NULL;

	/*
	 * If tickets disabled behave as if no ticket present to permit stateful
	 * resumption.
	 */
	if (SSL_get_options(s) & SSL_OP_NO_TICKET)
		return 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(ext_block, &extensions))
		return -1;

	while (CBS_len(&extensions) > 0) {

		uint16_t ext_type;
		CBS ext_data;

		if (!CBS_get_u16(&extensions, &ext_type) ||
		    !CBS_get_u16_length_prefixed(&extensions, &ext_data))
			return -1;

		if (ext_type == TLSEXT_TYPE_session_ticket) {
			int r;
			if (CBS_len(&ext_data) == 0) {
				/* The client will accept a ticket but doesn't
				 * currently have one. */
				s->internal->tlsext_ticket_expected = 1;
				return 1;
			}
			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
				 * handshake based on external mechanism to
				 * calculate the master secret later. */
				return 2;
			}

			r = tls_decrypt_ticket(s, CBS_data(&ext_data),
			    CBS_len(&ext_data), session_id, session_id_len, ret);

			switch (r) {
			case 2: /* ticket couldn't be decrypted */
				s->internal->tlsext_ticket_expected = 1;
				return 2;
			case 3: /* ticket was decrypted */
				return r;
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123

1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138



1139
1140
1141


















1142
1143
1144
1145
1146
1147
1148
		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();







|

<
|
|
>
|

<
<
<
<
<
<
<
<





>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1089
1090
1091
1092
1093
1094
1095
1096
1097

1098
1099
1100
1101
1102








1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
		if (table[i].nid == nid)
			return table[i].id;
	}
	return -1;
}

int
tls12_get_hashid(const EVP_MD *md)
{

	if (md == NULL)
		return -1;

	return tls12_find_id(EVP_MD_type(md), tls12_md,
	    sizeof(tls12_md) / sizeof(tls12_lookup));








}

int
tls12_get_sigid(const EVP_PKEY *pk)
{
	if (pk == NULL)
		return -1;

	return tls12_find_id(pk->type, tls12_sig,
	    sizeof(tls12_sig) / sizeof(tls12_lookup));
}

int
tls12_get_hashandsig(CBB *cbb, const EVP_PKEY *pk, const EVP_MD *md)
{
	int hash_id, sig_id;

	if ((hash_id = tls12_get_hashid(md)) == -1)
		return 0;
	if ((sig_id = tls12_get_sigid(pk)) == -1)
		return 0;

	if (!CBB_add_u8(cbb, hash_id))
		return 0;
	if (!CBB_add_u8(cbb, sig_id))
		return 0;

	return 1;
}

const EVP_MD *
tls12_get_hash(unsigned char hash_alg)
{
	switch (hash_alg) {
	case TLSEXT_hash_sha1:
		return EVP_sha1();
Changes to jni/libressl/ssl/t1_meth.c.
1
2
3
4
5
6
7
8
/* $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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: t1_meth.c,v 1.25 2018/08/30 16:56:16 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.
 *
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
	.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,







<
<
<
<
<







69
70
71
72
73
74
75





76
77
78
79
80
81
82
	.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,
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
	.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,







<
<
<
<
<







98
99
100
101
102
103
104





105
106
107
108
109
110
111
	.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,
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
	.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,







<
<
<
<
<







127
128
129
130
131
132
133





134
135
136
137
138
139
140
	.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,
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
	.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,







<
<
<
<
<







156
157
158
159
160
161
162





163
164
165
166
167
168
169
	.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,
Changes to jni/libressl/ssl/t1_srvr.c.
1
2
3
4
5
6
7
8
/* $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.
 *
|







1
2
3
4
5
6
7
8
/* $OpenBSD: t1_srvr.c,v 1.27 2018/08/30 16:56:16 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.
 *
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
	.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,







<
<
<
<
<







70
71
72
73
74
75
76





77
78
79
80
81
82
83
	.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,
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
	.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,







<
<
<
<
<







99
100
101
102
103
104
105





106
107
108
109
110
111
112
	.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,
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
	.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,







<
<
<
<
<







128
129
130
131
132
133
134





135
136
137
138
139
140
141
	.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,
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
	.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,







<
<
<
<
<







157
158
159
160
161
162
163





164
165
166
167
168
169
170
	.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,
Changes to jni/libressl/tests/CMakeLists.txt.
1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
include_directories(
	.
	../include
	../include/compat
	../crypto/modes
	../crypto/asn1
	../ssl
	../tls
	../apps/openssl
	../apps/openssl/compat

)

add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/../apps/openssl/cert.pem\")

file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} TEST_SOURCE_DIR)

# aeadtest


<
<






>







1
2


3
4
5
6
7
8
9
10
11
12
13
14
15
16
include_directories(
	.


	../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\")

file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} TEST_SOURCE_DIR)

# aeadtest
61
62
63
64
65
66
67





68
69
70
71
72
73
74
# 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 ${OPENSSL_LIBS})
	add_test(biotest biotest)
endif()






# 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)







>
>
>
>
>







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# 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 ${OPENSSL_LIBS})
	add_test(biotest biotest)
endif()

# bnaddsub
add_executable(bnaddsub bnaddsub.c)
target_link_libraries(bnaddsub ${OPENSSL_LIBS})
add_test(bnaddsub bnaddsub)

# 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)
Changes to jni/libressl/tests/Makefile.am.
73
74
75
76
77
78
79





80
81
82
83
84
85
86
# the BIO tests rely on resolver results that are OS and environment-specific
if ENABLE_EXTRATESTS
TESTS += biotest
check_PROGRAMS += biotest
biotest_SOURCES = biotest.c
endif






# bntest
TESTS += bntest
bntest_CPPFLAGS = $(AM_CPPFLAGS) -ULIBRESSL_INTERNAL
check_PROGRAMS += bntest
bntest_SOURCES = bntest.c

# bytestringtest







>
>
>
>
>







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# the BIO tests rely on resolver results that are OS and environment-specific
if ENABLE_EXTRATESTS
TESTS += biotest
check_PROGRAMS += biotest
biotest_SOURCES = biotest.c
endif

# bnaddsub
TESTS += bnaddsub
check_PROGRAMS += bnaddsub
bnaddsub_SOURCES = bnaddsub.c

# bntest
TESTS += bntest
bntest_CPPFLAGS = $(AM_CPPFLAGS) -ULIBRESSL_INTERNAL
check_PROGRAMS += bntest
bntest_SOURCES = bntest.c

# bytestringtest
Changes to jni/libressl/tests/Makefile.in.
87
88
89
90
91
92
93
94
95
96
97
98
99

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

136
137
138
139
140
141
142
PRE_UNINSTALL = :
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) asn1evp$(EXEEXT) \
	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) \
	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 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) \
	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)
check_PROGRAMS = aeadtest$(EXEEXT) aes_wrap$(EXEEXT) $(am__EXEEXT_1) \
	asn1evp$(EXEEXT) 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) 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) \
	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)


# arc4randomforktest
# Windows/mingw does not have fork, but Cygwin does.
@HOST_WIN_FALSE@am__append_2 = arc4randomforktest.sh
@HOST_WIN_FALSE@am__append_3 = arc4randomforktest

# biotest







|
|
|
|
|
|
>
|
|
|
|













|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
PRE_UNINSTALL = :
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) asn1evp$(EXEEXT) \
	asn1test$(EXEEXT) asn1time$(EXEEXT) base64test$(EXEEXT) \
	bftest$(EXEEXT) $(am__EXEEXT_2) bnaddsub$(EXEEXT) \
	bntest$(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.sh $(am__EXEEXT_3) \
	exptest$(EXEEXT) freenull$(EXEEXT) gcm128test$(EXEEXT) \
	gost2814789t$(EXEEXT) hkdftest$(EXEEXT) hmactest$(EXEEXT) \
	ideatest$(EXEEXT) igetest$(EXEEXT) keypairtest.sh \
	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) \
	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)
check_PROGRAMS = aeadtest$(EXEEXT) aes_wrap$(EXEEXT) $(am__EXEEXT_1) \
	asn1evp$(EXEEXT) asn1test$(EXEEXT) asn1time$(EXEEXT) \
	base64test$(EXEEXT) bftest$(EXEEXT) $(am__EXEEXT_2) \
	bnaddsub$(EXEEXT) bntest$(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) 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)

# arc4randomforktest
# Windows/mingw does not have fork, but Cygwin does.
@HOST_WIN_FALSE@am__append_2 = arc4randomforktest.sh
@HOST_WIN_FALSE@am__append_3 = arc4randomforktest

# biotest
250
251
252
253
254
255
256







257
258
259
260
261
262
263
	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1)
am__biotest_SOURCES_DIST = biotest.c
@ENABLE_EXTRATESTS_TRUE@am_biotest_OBJECTS = biotest.$(OBJEXT)
biotest_OBJECTS = $(am_biotest_OBJECTS)
biotest_LDADD = $(LDADD)
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_bntest_OBJECTS = bntest-bntest.$(OBJEXT)
bntest_OBJECTS = $(am_bntest_OBJECTS)
bntest_LDADD = $(LDADD)
bntest_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \
	$(abs_top_builddir)/ssl/.libs/libssl.a \







>
>
>
>
>
>
>







252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1)
am__biotest_SOURCES_DIST = biotest.c
@ENABLE_EXTRATESTS_TRUE@am_biotest_OBJECTS = biotest.$(OBJEXT)
biotest_OBJECTS = $(am_biotest_OBJECTS)
biotest_LDADD = $(LDADD)
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_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)
bntest_DEPENDENCIES = $(abs_top_builddir)/tls/.libs/libtls.a \
	$(abs_top_builddir)/ssl/.libs/libssl.a \
698
699
700
701
702
703
704
705
706
707
708

709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
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) $(asn1evp_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) \

	$(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) \
	$(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)
DIST_SOURCES = $(aeadtest_SOURCES) $(aes_wrap_SOURCES) \
	$(am__arc4randomforktest_SOURCES_DIST) $(asn1evp_SOURCES) \
	$(asn1test_SOURCES) $(asn1time_SOURCES) $(base64test_SOURCES) \
	$(bftest_SOURCES) $(am__biotest_SOURCES_DIST) \
	$(bntest_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) \
	$(am__explicit_bzero_SOURCES_DIST) $(exptest_SOURCES) \
	$(freenull_SOURCES) $(gcm128test_SOURCES) \
	$(gost2814789t_SOURCES) $(hkdftest_SOURCES) \
	$(hmactest_SOURCES) $(ideatest_SOURCES) $(igetest_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) \







|
|
|
|
>
|
|
|
|
|


















|
|
|
|
|
|
|
|
|







707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
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) $(asn1evp_SOURCES) \
	$(asn1test_SOURCES) $(asn1time_SOURCES) $(base64test_SOURCES) \
	$(bftest_SOURCES) $(biotest_SOURCES) $(bnaddsub_SOURCES) \
	$(bntest_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) \
	$(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)
DIST_SOURCES = $(aeadtest_SOURCES) $(aes_wrap_SOURCES) \
	$(am__arc4randomforktest_SOURCES_DIST) $(asn1evp_SOURCES) \
	$(asn1test_SOURCES) $(asn1time_SOURCES) $(base64test_SOURCES) \
	$(bftest_SOURCES) $(am__biotest_SOURCES_DIST) \
	$(bnaddsub_SOURCES) $(bntest_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) $(am__explicit_bzero_SOURCES_DIST) \
	$(exptest_SOURCES) $(freenull_SOURCES) $(gcm128test_SOURCES) \
	$(gost2814789t_SOURCES) $(hkdftest_SOURCES) \
	$(hmactest_SOURCES) $(ideatest_SOURCES) $(igetest_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) \
1137
1138
1139
1140
1141
1142
1143

1144
1145
1146
1147
1148
1149
1150
@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

bntest_CPPFLAGS = $(AM_CPPFLAGS) -ULIBRESSL_INTERNAL
bntest_SOURCES = bntest.c
bytestringtest_SOURCES = bytestringtest.c
casttest_SOURCES = casttest.c
chachatest_SOURCES = chachatest.c
cipher_list_SOURCES = cipher_list.c
noinst_HEADERS = tests.h







>







1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
@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
bntest_CPPFLAGS = $(AM_CPPFLAGS) -ULIBRESSL_INTERNAL
bntest_SOURCES = bntest.c
bytestringtest_SOURCES = bytestringtest.c
casttest_SOURCES = casttest.c
chachatest_SOURCES = chachatest.c
cipher_list_SOURCES = cipher_list.c
noinst_HEADERS = tests.h
1278
1279
1280
1281
1282
1283
1284




1285
1286
1287
1288
1289
1290
1291
bftest$(EXEEXT): $(bftest_OBJECTS) $(bftest_DEPENDENCIES) $(EXTRA_bftest_DEPENDENCIES) 
	@rm -f bftest$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(bftest_OBJECTS) $(bftest_LDADD) $(LIBS)

biotest$(EXEEXT): $(biotest_OBJECTS) $(biotest_DEPENDENCIES) $(EXTRA_biotest_DEPENDENCIES) 
	@rm -f biotest$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(biotest_OBJECTS) $(biotest_LDADD) $(LIBS)





bntest$(EXEEXT): $(bntest_OBJECTS) $(bntest_DEPENDENCIES) $(EXTRA_bntest_DEPENDENCIES) 
	@rm -f bntest$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(bntest_OBJECTS) $(bntest_LDADD) $(LIBS)

bytestringtest$(EXEEXT): $(bytestringtest_OBJECTS) $(bytestringtest_DEPENDENCIES) $(EXTRA_bytestringtest_DEPENDENCIES) 
	@rm -f bytestringtest$(EXEEXT)







>
>
>
>







1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
bftest$(EXEEXT): $(bftest_OBJECTS) $(bftest_DEPENDENCIES) $(EXTRA_bftest_DEPENDENCIES) 
	@rm -f bftest$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(bftest_OBJECTS) $(bftest_LDADD) $(LIBS)

biotest$(EXEEXT): $(biotest_OBJECTS) $(biotest_DEPENDENCIES) $(EXTRA_biotest_DEPENDENCIES) 
	@rm -f biotest$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(biotest_OBJECTS) $(biotest_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)

bytestringtest$(EXEEXT): $(bytestringtest_OBJECTS) $(bytestringtest_DEPENDENCIES) $(EXTRA_bytestringtest_DEPENDENCIES) 
	@rm -f bytestringtest$(EXEEXT)
1533
1534
1535
1536
1537
1538
1539

1540
1541
1542
1543
1544
1545
1546
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arc4randomforktest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1evp.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@







>







1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arc4randomforktest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1evp.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)/bnaddsub.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@
1903
1904
1905
1906
1907
1908
1909







1910
1911
1912
1913
1914
1915
1916
	$(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)
biotest.log: biotest$(EXEEXT)
	@p='biotest$(EXEEXT)'; \
	b='biotest'; \







	$(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'; \







>
>
>
>
>
>
>







1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
	$(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)
biotest.log: biotest$(EXEEXT)
	@p='biotest$(EXEEXT)'; \
	b='biotest'; \
	$(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)
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)
bntest.log: bntest$(EXEEXT)
	@p='bntest$(EXEEXT)'; \
	b='bntest'; \
Changes to jni/libressl/tests/aeadtest.c.

1
2
3
4
5
6
7

/* ====================================================================
 * Copyright (c) 2011-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
2
3
4
5
6
7
8
/*	$OpenBSD: aeadtest.c,v 1.11 2018/07/17 17:06:49 tb Exp $	*/
/* ====================================================================
 * Copyright (c) 2011-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:
 *
Changes to jni/libressl/tests/aeadtests.txt.

1
2
3
4
5
6
7

#
# MACsec GCM-AES Test Vectors (bn-randall-test-vectors-0511-v1.pdf)
#

# 2.5.1 65-byte Packet Authentication Using GCM-AES-128
AEAD: aes-128-gcm
KEY: 013FE00B5F11BE7F866D0CBBC55A7A90
>







1
2
3
4
5
6
7
8
#	$OpenBSD: aeadtests.txt,v 1.7 2018/07/17 17:06:49 tb Exp $
#
# MACsec GCM-AES Test Vectors (bn-randall-test-vectors-0511-v1.pdf)
#

# 2.5.1 65-byte Packet Authentication Using GCM-AES-128
AEAD: aes-128-gcm
KEY: 013FE00B5F11BE7F866D0CBBC55A7A90
Changes to jni/libressl/tests/aes_wrap.c.
1
2
3
4
5
6
7
8
/* crypto/aes/aes_wrap.c */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
 * project.
 */
/* ====================================================================
 * Copyright (c) 2008 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/*	$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.
 */
/* ====================================================================
 * Copyright (c) 2008 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
Changes to jni/libressl/tests/base64test.c.

1
2
3
4
5
6
7

/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/*	$OpenBSD: base64test.c,v 1.5 2018/07/17 17:06:49 tb Exp $	*/
/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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.
 *
Changes to jni/libressl/tests/bftest.c.
1
2
3
4
5
6
7
8
/* crypto/bf/bftest.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Added jni/libressl/tests/bnaddsub.c.
























































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/*	$OpenBSD: bnaddsub.c,v 1.3 2018/07/23 17:15:21 tb Exp $	*/
/*
 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
 *
 * 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 <err.h>
#include <stdio.h>

#include <openssl/bio.h>
#include <openssl/bn.h>
#include <openssl/err.h>

#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;
}
Changes to jni/libressl/tests/bntest.c.
1
2
3
4
5
6
7
8
/* crypto/bn/bntest.c */
/* 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.
 *
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
Changes to jni/libressl/tests/bytestringtest.c.
1
2
3
4
5
6
7
8
/*	$OpenBSD: bytestringtest.c,v 1.11 2017/11/28 16:35:05 jsing Exp $	*/
/*
 * Copyright (c) 2014, Google 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.
 *
|







1
2
3
4
5
6
7
8
/*	$OpenBSD: bytestringtest.c,v 1.12 2018/08/16 18:40:19 jsing Exp $	*/
/*
 * Copyright (c) 2014, Google 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.
 *
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284

285
286
287
288
289
290
291
292

	return 1;
}

static int
test_cbb_basic(void)
{
	static const uint8_t kExpected[] = {1, 2, 3, 4, 5, 6, 7, 8};
	uint8_t *buf = NULL;
	size_t buf_len;
	int ret = 0;
	CBB cbb;

	CHECK(CBB_init(&cbb, 100));

	CBB_cleanup(&cbb);

	CHECK(CBB_init(&cbb, 0));
	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_finish(&cbb, &buf, &buf_len));

	ret = (buf_len == sizeof(kExpected)
	    && memcmp(buf, kExpected, buf_len) == 0);

	if (0) {
err:







|













>
|







264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293

	return 1;
}

static int
test_cbb_basic(void)
{
	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;
	CBB cbb;

	CHECK(CBB_init(&cbb, 100));

	CBB_cleanup(&cbb);

	CHECK(CBB_init(&cbb, 0));
	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_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)
	    && memcmp(buf, kExpected, buf_len) == 0);

	if (0) {
err:
Changes to jni/libressl/tests/casttest.c.
1
2
3
4
5
6
7
8
/* crypto/cast/casttest.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/chachatest.c.

1
2
3
4
5
6
7

/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/*	$OpenBSD: chachatest.c,v 1.5 2018/07/17 17:06:49 tb Exp $	*/
/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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.
 *
Changes to jni/libressl/tests/cipher_list.c.
1
2
3
4
5
6
7
8
/*	$OpenBSD: cipher_list.c,v 1.8 2017/10/11 17:35:53 jsing Exp $	*/
/*
 * Copyright (c) 2015 Doug Hogan <doug@openbsd.org>
 * Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/*	$OpenBSD: cipher_list.c,v 1.9 2018/06/02 16:35:02 jsing Exp $	*/
/*
 * Copyright (c) 2015 Doug Hogan <doug@openbsd.org>
 * Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
 *
 * 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.
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

static uint8_t cipher_bytes[] = {
	0xcc, 0xa8,	/* ECDHE-ECDSA-CHACHA20-POLY1305 */
	0xcc, 0xa9,	/* ECDHE-RSA-CHACHA20-POLY1305 */
	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[] = {
	0xcca8,		/* ECDHE-ECDSA-CHACHA20-POLY1305 */
	0xcca9,		/* ECDHE-RSA-CHACHA20-POLY1305 */
	0xccaa,		/* DHE-RSA-CHACHA20-POLY1305 */
	0x009c,		/* AES128-GCM-SHA256 */
	0x003d,		/* AES256-SHA256 */
	0x0009,		/* DES-CBC-SHA */
};

#define N_CIPHERS (sizeof(cipher_bytes) / 2)

static int
ssl_bytes_to_list_alloc(SSL *s, STACK_OF(SSL_CIPHER) **ciphers)
{







<








<







45
46
47
48
49
50
51

52
53
54
55
56
57
58
59

60
61
62
63
64
65
66

static uint8_t cipher_bytes[] = {
	0xcc, 0xa8,	/* ECDHE-ECDSA-CHACHA20-POLY1305 */
	0xcc, 0xa9,	/* ECDHE-RSA-CHACHA20-POLY1305 */
	0xcc, 0xaa,	/* DHE-RSA-CHACHA20-POLY1305 */
	0x00, 0x9c,	/* AES128-GCM-SHA256 */
	0x00, 0x3d,	/* AES256-SHA256 */

};

static uint16_t cipher_values[] = {
	0xcca8,		/* ECDHE-ECDSA-CHACHA20-POLY1305 */
	0xcca9,		/* ECDHE-RSA-CHACHA20-POLY1305 */
	0xccaa,		/* DHE-RSA-CHACHA20-POLY1305 */
	0x009c,		/* AES128-GCM-SHA256 */
	0x003d,		/* AES256-SHA256 */

};

#define N_CIPHERS (sizeof(cipher_bytes) / 2)

static int
ssl_bytes_to_list_alloc(SSL *s, STACK_OF(SSL_CIPHER) **ciphers)
{
Changes to jni/libressl/tests/clienttest.c.
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#define SSL3_CIPHER_OFFSET (SSL3_HM_OFFSET + 37)

static unsigned char cipher_list_dtls1[] = {
	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,
};

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,
	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,
};

static unsigned char cipher_list_tls10[] = {
	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,
};

static unsigned char client_hello_tls10[] = {
	0x16, 0x03, 0x01, 0x00, 0x75, 0x01, 0x00, 0x00,
	0x71, 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,
	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,
};

static unsigned char cipher_list_tls11[] = {
	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,
};

static unsigned char client_hello_tls11[] = {
	0x16, 0x03, 0x01, 0x00, 0x75, 0x01, 0x00, 0x00,
	0x71, 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,
	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,
};

static unsigned char cipher_list_tls12_aes[] = {
	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, 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x9e,
	0x00, 0x67, 0x00, 0x33, 0x00, 0xbe, 0x00, 0x45,
	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,
};

static unsigned char cipher_list_tls12_chacha[] = {
	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, 0x00, 0xc4, 0x00, 0x88, 0x00, 0x81,
	0x00, 0x9d, 0x00, 0x3d, 0x00, 0x35, 0x00, 0xc0,
	0x00, 0x84, 0xc0, 0x2f, 0xc0, 0x2b, 0xc0, 0x27,
	0xc0, 0x23, 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x9e,
	0x00, 0x67, 0x00, 0x33, 0x00, 0xbe, 0x00, 0x45,
	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,
};

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,
	0x00, 0xc4, 0x00, 0x88, 0x00, 0x81, 0x00, 0x9d,
	0x00, 0x3d, 0x00, 0x35, 0x00, 0xc0, 0x00, 0x84,
	0xc0, 0x2f, 0xc0, 0x2b, 0xc0, 0x27, 0xc0, 0x23,
	0xc0, 0x13, 0xc0, 0x09, 0x00, 0x9e, 0x00, 0x67,
	0x00, 0x33, 0x00, 0xbe, 0x00, 0x45, 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, 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,
};

struct client_hello_test {
	const unsigned char *desc;
	const int protocol;
	const size_t random_start;
	const SSL_METHOD *(*ssl_method)(void);







|
<




|
|
|
|
|
|
|




|
|
<








|
<



|
|



|





|
|
|
|
<








|
<



|
|



|


|


|
|
|
|
<














|














|



|
|



|











|
|
|
|
|
|
|
|







32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
64
65

66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91
92

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#define SSL3_CIPHER_OFFSET (SSL3_HM_OFFSET + 37)

static unsigned char cipher_list_dtls1[] = {
	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, 0xff,

};

static unsigned char client_hello_dtls1[] = {
	0x16, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
	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, 0xff, 0x01, 0x00, 0x00,
	0x04, 0x00, 0x23, 0x00, 0x00,

};

static unsigned char cipher_list_tls10[] = {
	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, 0xff,

};

static unsigned char client_hello_tls10[] = {
	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, 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, 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[] = {
	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, 0xff,

};

static unsigned char client_hello_tls11[] = {
	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, 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, 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[] = {
	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, 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x9e,
	0x00, 0x67, 0x00, 0x33, 0x00, 0xbe, 0x00, 0x45,
	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, 0xff,
};

static unsigned char cipher_list_tls12_chacha[] = {
	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, 0x00, 0xc4, 0x00, 0x88, 0x00, 0x81,
	0x00, 0x9d, 0x00, 0x3d, 0x00, 0x35, 0x00, 0xc0,
	0x00, 0x84, 0xc0, 0x2f, 0xc0, 0x2b, 0xc0, 0x27,
	0xc0, 0x23, 0xc0, 0x13, 0xc0, 0x09, 0x00, 0x9e,
	0x00, 0x67, 0x00, 0x33, 0x00, 0xbe, 0x00, 0x45,
	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, 0xff,
};

static unsigned char client_hello_tls12[] = {
	0x16, 0x03, 0x01, 0x00, 0xbf, 0x01, 0x00, 0x00,
	0xbb, 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, 0x5c, 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,
	0x00, 0xc4, 0x00, 0x88, 0x00, 0x81, 0x00, 0x9d,
	0x00, 0x3d, 0x00, 0x35, 0x00, 0xc0, 0x00, 0x84,
	0xc0, 0x2f, 0xc0, 0x2b, 0xc0, 0x27, 0xc0, 0x23,
	0xc0, 0x13, 0xc0, 0x09, 0x00, 0x9e, 0x00, 0x67,
	0x00, 0x33, 0x00, 0xbe, 0x00, 0x45, 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, 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,
};

struct client_hello_test {
	const unsigned char *desc;
	const int protocol;
	const size_t random_start;
	const SSL_METHOD *(*ssl_method)(void);
409
410
411
412
413
414
415

416
417
418
419
420
421
422
	i = cht->random_start + SSL3_RANDOM_SIZE;
	if (memcmp(client_hello, wbuf, cht->random_start) != 0 ||
	    memcmp(&client_hello[cht->random_start],
		&wbuf[cht->random_start], SSL3_RANDOM_SIZE) == 0 ||
	    memcmp(&client_hello[i], &wbuf[i], len - i) != 0) {
		fprintf(stderr, "FAIL: ClientHello differs:\n");
		fprintf(stderr, "received:\n");

		hexdump(wbuf, len);
		fprintf(stderr, "test data:\n");
		hexdump(client_hello, client_hello_len);
		fprintf(stderr, "\n");
		goto failure;
	}
	







>







403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
	i = cht->random_start + SSL3_RANDOM_SIZE;
	if (memcmp(client_hello, wbuf, cht->random_start) != 0 ||
	    memcmp(&client_hello[cht->random_start],
		&wbuf[cht->random_start], SSL3_RANDOM_SIZE) == 0 ||
	    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);
		fprintf(stderr, "\n");
		goto failure;
	}
	
Changes to jni/libressl/tests/cts128test.c.

1
2
3
4
5
6
7

/* ====================================================================
 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
 *
 * Rights for redistribution and usage in source and binary
 * forms are granted according to the OpenSSL license.
 */

>







1
2
3
4
5
6
7
8
/*	$OpenBSD: cts128test.c,v 1.3 2018/07/17 17:06:49 tb Exp $	*/
/* ====================================================================
 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
 *
 * Rights for redistribution and usage in source and binary
 * forms are granted according to the OpenSSL license.
 */

Changes to jni/libressl/tests/destest.c.
1
2
3
4
5
6
7
8
/* crypto/des/destest.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/dhtest.c.
1
2
3
4
5
6
7
8
/* crypto/dh/dhtest.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/dsatest.c.
1
2
3
4
5
6
7
8
/* crypto/dsa/dsatest.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/ecdhtest.c.
1
2
3
4
5
6
7
8
/* crypto/ecdh/ecdhtest.c */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
|







1
2
3
4
5
6
7
8
/*	$OpenBSD: ecdhtest.c,v 1.10 2018/07/17 17:06:49 tb Exp $	*/
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
 * to the OpenSSL project.
 *
Changes to jni/libressl/tests/ecdsatest.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* crypto/ecdsa/ecdsatest.c */
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 2000-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer. 
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. All advertising materials mentioning features or use of this
|











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*	$OpenBSD: ecdsatest.c,v 1.6 2018/07/17 17:10:04 tb Exp $	*/
/*
 * Written by Nils Larsch for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 2000-2005 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. All advertising materials mentioning features or use of this
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
 * (eay@cryptsoft.com).  This product includes software written by Tim
 * Hudson (tjh@cryptsoft.com).
 *
 */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * 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 
 * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>







|





|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
 * (eay@cryptsoft.com).  This product includes software written by Tim
 * Hudson (tjh@cryptsoft.com).
 *
 */
/* ====================================================================
 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
 *
 * 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
 * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
84
85
86
87
88
89
90

91
92
93
94
95
96
97
98
99
#include <openssl/err.h>

/* declaration of the test functions */
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	ret = 0;
	const char message[] = "abc";
	unsigned char digest[20];
	unsigned int  dgst_len = 0;
	EVP_MD_CTX md_ctx;
	EC_KEY    *key = NULL;
	ECDSA_SIG *signature = NULL;







>
|
|







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include <openssl/err.h>

/* declaration of the test functions */
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	ret = 0;
	const char message[] = "abc";
	unsigned char digest[20];
	unsigned int  dgst_len = 0;
	EVP_MD_CTX md_ctx;
	EC_KEY    *key = NULL;
	ECDSA_SIG *signature = NULL;
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154

155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266

267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299

300
301
302

303
304
305

306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337

338
339
340
341
342
343
344
345
346
347
348
349
350

351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387

388
389
390
391
392
393
394
395
396
397
398

399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
	if (ECDSA_do_verify(digest, 20, signature, key) != 1)
		goto x962_int_err;
	BIO_printf(out, ".");
	(void)BIO_flush(out);

	BIO_printf(out, " ok\n");
	ret = 1;
x962_int_err:
	if (!ret)
		BIO_printf(out, " failed\n");
	if (key)
		EC_KEY_free(key);
	if (signature)
		ECDSA_SIG_free(signature);
	if (r)
		BN_free(r);
	if (s)
		BN_free(s);
	EVP_MD_CTX_cleanup(&md_ctx);
	return ret;
	}


int test_builtin(BIO *out)
	{
	EC_builtin_curve *curves = NULL;
	size_t		crv_len = 0, n = 0;
	EC_KEY		*eckey = NULL, *wrong_eckey = NULL;
	EC_GROUP	*group;
	ECDSA_SIG	*ecdsa_sig = NULL;
	unsigned char	digest[20], wrong_digest[20];
	unsigned char	*signature = NULL;
	const unsigned char	*sig_ptr;
	unsigned char	*sig_ptr2;
	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 ) */
	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);

	curves = reallocarray(NULL, sizeof(EC_builtin_curve), crv_len);

	if (curves == NULL)
		{
		BIO_printf(out, "malloc error\n");
		goto builtin_err;
		}
	
	if (!EC_get_builtin_curves(curves, crv_len))
		{
		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++)
		{
		unsigned char dirt, offset;

		nid = curves[n].nid;
		if (nid == NID_ipsec4)
			continue;
		/* create new ecdsa key (== EC_KEY) */
		if ((eckey = EC_KEY_new()) == NULL)
			goto builtin_err;
		group = EC_GROUP_new_by_curve_name(nid);
		if (group == NULL)
			goto builtin_err;
		if (EC_KEY_set_group(eckey, group) == 0)
			goto builtin_err;
		EC_GROUP_free(group);
		degree = EC_GROUP_get_degree(EC_KEY_get0_group(eckey));
		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))
			{
			BIO_printf(out, " failed\n");
			goto builtin_err;
			}
		/* create second key */
		if ((wrong_eckey = EC_KEY_new()) == NULL)
			goto builtin_err;
		group = EC_GROUP_new_by_curve_name(nid);
		if (group == NULL)
			goto builtin_err;
		if (EC_KEY_set_group(wrong_eckey, group) == 0)
			goto builtin_err;
		EC_GROUP_free(group);
		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))
			{
			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))
			{
			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)
			{

			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)
			{
			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)
			{
			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)
			{
			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
		 * garble the ASN1 structure, we read the raw signature and
		 * modify a byte in one of the bignums directly. */

		sig_ptr = signature;
		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))
			{
			BIO_printf(out, " failed\n");
			goto builtin_err;
			}
		buf_len = 2 * bn_len;
		if ((raw_buf = calloc(1, buf_len)) == NULL)
			goto builtin_err;
		BN_bn2bin(ecdsa_sig->r, raw_buf + bn_len - r_len);
		BN_bn2bin(ecdsa_sig->s, raw_buf + buf_len - s_len);

		/* Modify a single byte in the buffer. */
		offset = raw_buf[10] % buf_len;
		dirt   = raw_buf[11] ? raw_buf[11] : 1;
		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))
			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)
			{

			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))
			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)
			{

			BIO_printf(out, " failed\n");
			goto builtin_err;
			}
		BIO_printf(out, ".");
		(void)BIO_flush(out);
		
		BIO_printf(out, " ok\n");
		/* cleanup */
		/* clean bogus errors */
		ERR_clear_error();
		free(signature);
		signature = NULL;
		EC_KEY_free(eckey);
		eckey = NULL;
		EC_KEY_free(wrong_eckey);
		wrong_eckey = NULL;
		ECDSA_SIG_free(ecdsa_sig);
		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);
	free(signature);
	free(raw_buf);
	free(curves);

	return ret;
	}


int main(void)
	{
	int 	ret = 1;
	BIO	*out;

	out = BIO_new_fp(stdout, BIO_NOCLOSE);

	ERR_load_crypto_strings();

	/* the tests */
	if (!test_builtin(out)) goto err;

	
	ret = 0;
err:	
	if (ret) 	
		BIO_printf(out, "\nECDSA test failed\n");
	else 
		BIO_printf(out, "\nECDSA test passed\n");
	if (ret)
		ERR_print_errors(out);
	CRYPTO_cleanup_all_ex_data();
	ERR_remove_thread_state(NULL);
	ERR_free_strings();
	CRYPTO_mem_leaks(out);
	if (out != NULL)
		BIO_free(out);
	return ret;
	}	







|












|

>
|
|

|










|




|
<




|

|

|
<
|

|
|
|
<


|


|
<















|
|
<



|


|
<


|









|
<


|




|
<


|






|
<


|



|
<
>


|



|
|
<


|




|
<


|




|
<


|



>
|

|
>

|
<
>


|





|
<


|












|




|
<
>


|



|




|
<
>


|


|














|

|
|
<
|
<
|
<
|





|

>
|
|








|
>
|

|
|

|










|
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

177
178
179
180
181
182
183
184
185

186
187
188
189
190

191
192
193
194
195
196

197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213

214
215
216
217
218
219
220

221
222
223
224
225
226
227
228
229
230
231
232
233

234
235
236
237
238
239
240
241

242
243
244
245
246
247
248
249
250
251

252
253
254
255
256
257
258

259
260
261
262
263
264
265
266
267

268
269
270
271
272
273
274
275

276
277
278
279
280
281
282
283

284
285
286
287
288
289
290
291
292
293
294
295
296

297
298
299
300
301
302
303
304
305
306

307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327

328
329
330
331
332
333
334
335
336
337
338
339
340

341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365

366

367

368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
	if (ECDSA_do_verify(digest, 20, signature, key) != 1)
		goto x962_int_err;
	BIO_printf(out, ".");
	(void)BIO_flush(out);

	BIO_printf(out, " ok\n");
	ret = 1;
 x962_int_err:
	if (!ret)
		BIO_printf(out, " failed\n");
	if (key)
		EC_KEY_free(key);
	if (signature)
		ECDSA_SIG_free(signature);
	if (r)
		BN_free(r);
	if (s)
		BN_free(s);
	EVP_MD_CTX_cleanup(&md_ctx);
	return ret;
}

int
test_builtin(BIO *out)
{
	EC_builtin_curve *curves = NULL;
	size_t		num_curves = 0, n = 0;
	EC_KEY		*eckey = NULL, *wrong_eckey = NULL;
	EC_GROUP	*group;
	ECDSA_SIG	*ecdsa_sig = NULL;
	unsigned char	digest[20], wrong_digest[20];
	unsigned char	*signature = NULL;
	const unsigned char	*sig_ptr;
	unsigned char	*sig_ptr2;
	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 available curve */

	BIO_printf(out, "\ntesting ECDSA_sign() and ECDSA_verify() "
		"with some internal curves:\n");

	/* get a list of all internal curves */
	num_curves = EC_get_builtin_curves(NULL, 0);

	curves = reallocarray(NULL, sizeof(EC_builtin_curve), num_curves);

	if (curves == NULL) {

		BIO_printf(out, "reallocarray error\n");
		goto builtin_err;
	}

	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 < num_curves; n++) {

		unsigned char dirt, offset;

		nid = curves[n].nid;
		if (nid == NID_ipsec4)
			continue;
		/* create new ecdsa key (== EC_KEY) */
		if ((eckey = EC_KEY_new()) == NULL)
			goto builtin_err;
		group = EC_GROUP_new_by_curve_name(nid);
		if (group == NULL)
			goto builtin_err;
		if (EC_KEY_set_group(eckey, group) == 0)
			goto builtin_err;
		EC_GROUP_free(group);
		degree = EC_GROUP_get_degree(EC_KEY_get0_group(eckey));
		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)) {

			BIO_printf(out, " failed\n");
			goto builtin_err;
		}
		/* create second key */
		if ((wrong_eckey = EC_KEY_new()) == NULL)
			goto builtin_err;
		group = EC_GROUP_new_by_curve_name(nid);
		if (group == NULL)
			goto builtin_err;
		if (EC_KEY_set_group(wrong_eckey, group) == 0)
			goto builtin_err;
		EC_GROUP_free(group);
		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)) {

			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)) {

			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) {
			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) {

			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) {

			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) {

			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
		 * garble the ASN1 structure, we read the raw signature and
		 * modify a byte in one of the bignums directly.
		 */
		sig_ptr = signature;
		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)) {

			BIO_printf(out, " failed\n");
			goto builtin_err;
		}
		buf_len = 2 * bn_len;
		if ((raw_buf = calloc(1, buf_len)) == NULL)
			goto builtin_err;
		BN_bn2bin(ecdsa_sig->r, raw_buf + bn_len - r_len);
		BN_bn2bin(ecdsa_sig->s, raw_buf + buf_len - s_len);

		/* Modify a single byte in the buffer. */
		offset = raw_buf[10] % buf_len;
		dirt   = raw_buf[11] ? raw_buf[11] : 1;
		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))
			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) {
			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))
			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) {
			BIO_printf(out, " failed\n");
			goto builtin_err;
		}
		BIO_printf(out, ".");
		(void)BIO_flush(out);

		BIO_printf(out, " ok\n");
		/* cleanup */
		/* clean bogus errors */
		ERR_clear_error();
		free(signature);
		signature = NULL;
		EC_KEY_free(eckey);
		eckey = NULL;
		EC_KEY_free(wrong_eckey);
		wrong_eckey = NULL;
		ECDSA_SIG_free(ecdsa_sig);
		ecdsa_sig = NULL;
		free(raw_buf);
		raw_buf = NULL;
	}

	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 	ret = 1;
	BIO	*out;

	out = BIO_new_fp(stdout, BIO_NOCLOSE);

	ERR_load_crypto_strings();

	/* the tests */
	if (!test_builtin(out))
		goto err;

	ret = 0;
 err:
	if (ret)
		BIO_printf(out, "\nECDSA test failed\n");
	else
		BIO_printf(out, "\nECDSA test passed\n");
	if (ret)
		ERR_print_errors(out);
	CRYPTO_cleanup_all_ex_data();
	ERR_remove_thread_state(NULL);
	ERR_free_strings();
	CRYPTO_mem_leaks(out);
	if (out != NULL)
		BIO_free(out);
	return ret;
}
Changes to jni/libressl/tests/ectest.c.

1
2
3
4
5
6
7

/* crypto/ec/ectest.c */
/*
 * Originally written by Bodo Moeller for the OpenSSL project.
 */
/* ====================================================================
 * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
 *
>







1
2
3
4
5
6
7
8
/*	$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.
 */
/* ====================================================================
 * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
 *
657
658
659
660
661
662
663
664

665
666
667
668

669
670
671
672

673
674
675
676

677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
	if (!(P_521 = EC_GROUP_new(EC_GROUP_method_of(group))))
		ABORT;
	if (!EC_GROUP_copy(P_521, group))
		ABORT;


	/* more tests using the last curve */


	if (!EC_POINT_copy(Q, P))
		ABORT;
	if (EC_POINT_is_at_infinity(group, Q))
		ABORT;

	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;

	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 (ctx)
		BN_CTX_free(ctx);
	BN_free(p);
	BN_free(a);
	BN_free(b);
	EC_GROUP_free(group);







|
>




>




>
|
<
<
|
>
|

<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
|
<
<
<
<







658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677


678
679
680
681

682

















































683
684



















685
686

687




688
689
690
691
692
693
694
	if (!(P_521 = EC_GROUP_new(EC_GROUP_method_of(group))))
		ABORT;
	if (!EC_GROUP_copy(P_521, group))
		ABORT;


	/* 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;
	/* 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;

	fprintf(stdout, " ok\n\n");





	if (ctx)
		BN_CTX_free(ctx);
	BN_free(p);
	BN_free(a);
	BN_free(b);
	EC_GROUP_free(group);
1181
1182
1183
1184
1185
1186
1187
1188

1189
1190
1191
1192

1193
1194
1195
1196

1197
1198
1199
1200

1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
	    "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47",
	    "2",
	    571,
	C2_B571
	);

	/* more tests using the last curve */


	if (!EC_POINT_copy(Q, P))
		ABORT;
	if (EC_POINT_is_at_infinity(group, Q))
		ABORT;

	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;

	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 (ctx)
		BN_CTX_free(ctx);
	BN_free(p);
	BN_free(a);
	BN_free(b);
	EC_GROUP_free(group);







|
>




>




>
|
<
<
|
>
|

<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
|
<
<







1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129


1130
1131
1132
1133

1134













































1135
1136















1137
1138

1139


1140
1141
1142
1143
1144
1145
1146
	    "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47",
	    "2",
	    571,
	C2_B571
	);

	/* 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;
	/* 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;

	fprintf(stdout, " ok\n\n");



	if (ctx)
		BN_CTX_free(ctx);
	BN_free(p);
	BN_free(a);
	BN_free(b);
	EC_GROUP_free(group);
Changes to jni/libressl/tests/enginetest.c.
1
2
3
4
5
6
7
8
/* crypto/engine/enginetest.c */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
 * project 2000.
 */
/* ====================================================================
 * Copyright (c) 1999-2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
|







1
2
3
4
5
6
7
8
/*	$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.
 */
/* ====================================================================
 * Copyright (c) 1999-2001 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
	}
	display_engine_list();
	ptr = ENGINE_get_first();
	if (!ENGINE_remove(ptr)) {
		printf("Remove failed!\n");
		goto end;
	}
	if (ptr)
		ENGINE_free(ptr);
	display_engine_list();
	if (!ENGINE_add(new_h3) || !ENGINE_add(new_h2)) {
		printf("Add failed!\n");
		goto end;
	}
	display_engine_list();
	if (!ENGINE_remove(new_h2)) {







<
|







125
126
127
128
129
130
131

132
133
134
135
136
137
138
139
	}
	display_engine_list();
	ptr = ENGINE_get_first();
	if (!ENGINE_remove(ptr)) {
		printf("Remove failed!\n");
		goto end;
	}

	ENGINE_free(ptr);
	display_engine_list();
	if (!ENGINE_add(new_h3) || !ENGINE_add(new_h2)) {
		printf("Add failed!\n");
		goto end;
	}
	display_engine_list();
	if (!ENGINE_remove(new_h2)) {
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
	 * in, this remove may be destined to fail.
	 */
	ptr = ENGINE_get_first();
	if (ptr)
		if (!ENGINE_remove(ptr))
			printf("Remove failed!i - probably no hardware "
				"support present.\n");
	if (ptr)
		ENGINE_free(ptr);
	display_engine_list();

	if (!ENGINE_add(new_h1) || !ENGINE_remove(new_h1)) {
		printf("Couldn't add and remove to an empty list!\n");
		goto end;
	} else
		printf("Successfully added and removed to an empty list!\n");







<
|







173
174
175
176
177
178
179

180
181
182
183
184
185
186
187
	 * in, this remove may be destined to fail.
	 */
	ptr = ENGINE_get_first();
	if (ptr)
		if (!ENGINE_remove(ptr))
			printf("Remove failed!i - probably no hardware "
				"support present.\n");

	ENGINE_free(ptr);
	display_engine_list();

	if (!ENGINE_add(new_h1) || !ENGINE_remove(new_h1)) {
		printf("Couldn't add and remove to an empty list!\n");
		goto end;
	} else
		printf("Successfully added and removed to an empty list!\n");
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
		free((void *)ENGINE_get_name(block[loop]));
	}
	printf("\nTests completed happily\n");
	to_return = 0;
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);
	for (loop = 0; loop < 512; loop++)
		if (block[loop])
			ENGINE_free(block[loop]);
	ENGINE_cleanup();
	CRYPTO_cleanup_all_ex_data();
	ERR_free_strings();
	ERR_remove_thread_state(NULL);
	CRYPTO_mem_leaks_fp(stderr);
	return to_return;
}







|
|
|
|

<
|







225
226
227
228
229
230
231
232
233
234
235
236

237
238
239
240
241
242
243
244
		free((void *)ENGINE_get_name(block[loop]));
	}
	printf("\nTests completed happily\n");
	to_return = 0;
end:
	if (to_return)
		ERR_print_errors_fp(stderr);
	ENGINE_free(new_h1);
	ENGINE_free(new_h2);
	ENGINE_free(new_h3);
	ENGINE_free(new_h4);
	for (loop = 0; loop < 512; loop++)

		ENGINE_free(block[loop]);
	ENGINE_cleanup();
	CRYPTO_cleanup_all_ex_data();
	ERR_free_strings();
	ERR_remove_thread_state(NULL);
	CRYPTO_mem_leaks_fp(stderr);
	return to_return;
}
Changes to jni/libressl/tests/evptest.c.

1
2
3
4
5
6
7

/* Written by Ben Laurie, 2001 */
/*
 * Copyright (c) 2001 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
2
3
4
5
6
7
8
/*	$OpenBSD: evptest.c,v 1.7 2018/07/17 17:06:49 tb Exp $	*/
/* Written by Ben Laurie, 2001 */
/*
 * Copyright (c) 2001 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:
Changes to jni/libressl/tests/evptests.txt.

1
2
3
4
5
6
7

#cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt)
#digest:::input:output

# SHA(1) tests (from shatest.c)
SHA1:::616263:a9993e364706816aba3e25717850c26c9cd0d89d

# MD5 tests (from md5test.c)
>







1
2
3
4
5
6
7
8
#	$OpenBSD: evptests.txt,v 1.5 2018/07/17 17:06:49 tb Exp $
#cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt)
#digest:::input:output

# SHA(1) tests (from shatest.c)
SHA1:::616263:a9993e364706816aba3e25717850c26c9cd0d89d

# MD5 tests (from md5test.c)
Changes to jni/libressl/tests/exptest.c.
1
2
3
4
5
6
7
8
/* crypto/bn/exptest.c */
/* 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.
 *
|







1
2
3
4
5
6
7
8
/*	$OpenBSD: exptest.c,v 1.5 2018/07/17 17:06:49 tb 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.
 *
Changes to jni/libressl/tests/freenull.c.
1
2
3
4


5
6
7
8

9
10
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34



35
36


37

38
39





40
41

42





43


44



45
46
47



48

49



50
51
52


53

54
55
56
57







58

59

60



61
62




63
64
65

66
67

68
69




70
71



72






73




74









75
76








77




78

79
80
81
82

83
84
85
86


87






88
89
90

91
92



93

94
95
96

97
98
99








100
101
102
103
104
105
106
/* $OpenBSD: freenull.c,v 1.6 2018/02/07 05:07:39 jsing Exp $ */
/*
 * Copyright (c) 2017 Bob Beck <beck@openbsd.org>
 *


 * 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 <openssl/asn1.h>

#include <openssl/ocsp.h>
#include <openssl/pkcs12.h>
#include <openssl/ts.h>
#include <openssl/ui.h>
#include <openssl/txt_db.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>

#include <err.h>
#include <stdio.h>
#include <string.h>

/* Make sure we do the right thing. Add here if you convert ones in tree */
int
main(int argc, char **argv)
{



	ASN1_ENUMERATED_free(NULL);
	ASN1_GENERALIZEDTIME_free(NULL);


	ASN1_INTEGER_free(NULL);

	ASN1_OBJECT_free(NULL);
	ASN1_OCTET_STRING_free(NULL);





	ASN1_TIME_free(NULL);
	ASN1_TYPE_free(NULL);

	ASN1_UTCTIME_free(NULL);





	BIO_free(NULL);


	BIO_free_all(NULL);



	BN_clear_free(NULL);
	BN_free(NULL);
	BUF_MEM_free(NULL);



	CONF_free(NULL);

	DH_free(NULL);



	DIST_POINT_free(NULL);
	DSA_SIG_free(NULL);
	DSA_free(NULL);


	ECDSA_SIG_free(NULL);

	EC_GROUP_free(NULL);
	EC_KEY_free(NULL);
	EC_POINT_clear_free(NULL);
	EC_POINT_free(NULL);







	EVP_CIPHER_CTX_free(NULL);

	EVP_PKEY_CTX_free(NULL);

	EVP_PKEY_free(NULL);



	GENERAL_NAME_free(NULL);
	GENERAL_SUBTREE_free(NULL);




	NAME_CONSTRAINTS_free(NULL);
	NCONF_free(NULL);
	NETSCAPE_CERT_SEQUENCE_free(NULL);

	NETSCAPE_SPKI_free(NULL);
	NETSCAPE_X509_free(NULL);

	OCSP_BASICRESP_free(NULL);
	OCSP_CERTID_free(NULL);




	OCSP_REQUEST_free(NULL);
	OCSP_REQ_CTX_free(NULL);



	OCSP_RESPONSE_free(NULL);






	PBEPARAM_free(NULL);




	PKCS12_free(NULL);









	PKCS7_free(NULL);
	PKCS8_PRIV_KEY_INFO_free(NULL);








	RSA_free(NULL);




	TS_MSG_IMPRINT_free(NULL);

	TS_REQ_free(NULL);
	TS_RESP_CTX_free(NULL);
	TS_RESP_free(NULL);
	TS_STATUS_INFO_free(NULL);

	TS_TST_INFO_free(NULL);
	TS_VERIFY_CTX_free(NULL);
	TXT_DB_free(NULL);
	UI_free(NULL);


	X509_ALGOR_free(NULL);






	X509_CRL_free(NULL);
	X509_EXTENSION_free(NULL);
	X509_INFO_free(NULL);

	X509_NAME_ENTRY_free(NULL);
	X509_NAME_free(NULL);



	X509_REQ_free(NULL);

	X509_SIG_free(NULL);
	X509_STORE_CTX_free(NULL);
	X509_STORE_free(NULL);

	X509_VERIFY_PARAM_free(NULL);
	X509_email_free(NULL);
	X509_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);
|
<
<
|
>
>
|
|
|
<
>
|
<
<
<
<
<
<
<
|
|
>












<



>
>
>


>
>

>


>
>
>
>
>


>

>
>
>
>
>

>
>
|
>
>
>



>
>
>

>

>
>
>



>
>

>




>
>
>
>
>
>
>

>

>

>
>
>


>
>
>
>



>


>


>
>
>
>


>
>
>

>
>
>
>
>
>

>
>
>
>

>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>

>
>
>
>

>




>




>
>

>
>
>
>
>
>



>


>
>
>

>



>



>
>
>
>
>
>
>
>







1


2
3
4
5
6
7

8
9







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
/*	$OpenBSD: freenull.c.head,v 1.2 2018/07/10 20:55:57 tb Exp $	*/



#include <openssl/asn1.h>
#include <openssl/cmac.h>
#include <openssl/comp.h>
#include <openssl/conf_api.h>
#include <openssl/dso.h>

#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>







#endif
#include <openssl/gost.h>
#include <openssl/hmac.h>
#include <openssl/ocsp.h>
#include <openssl/pkcs12.h>
#include <openssl/ts.h>
#include <openssl/ui.h>
#include <openssl/txt_db.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>

#include <err.h>
#include <stdio.h>
#include <string.h>


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);
	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_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_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 $	*/

	BIO_free_all(NULL);
	NCONF_free_data(NULL);
	_CONF_free_data(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);
114
115
116
117
118
119
120
121
122
	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);
}







|

219
220
221
222
223
224
225
226
227
	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;
}
Changes to jni/libressl/tests/gcm128test.c.

1
2
3
4
5
6
7

/* ====================================================================
 * Copyright (c) 2010 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
2
3
4
5
6
7
8
/*	$OpenBSD: gcm128test.c,v 1.6 2018/07/17 17:06:49 tb Exp $	*/
/* ====================================================================
 * Copyright (c) 2010 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:
 *
Changes to jni/libressl/tests/hkdf_test.c.

1
2
3
4
5
6
7

/* Copyright (c) 2014, Google 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
>







1
2
3
4
5
6
7
8
/*	$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
 * 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
Changes to jni/libressl/tests/hmactest.c.
1
2
3
4
5
6
7
8
/* crypto/hmac/hmactest.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/ideatest.c.
1
2
3
4
5
6
7
8
/* crypto/idea/ideatest.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/igetest.c.
1
2
3
4
5
6
7
8
/* test/igetest.c -*- mode:C; c-file-style: "eay" -*- */
/* ====================================================================
 * Copyright (c) 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
2
3
4
5
6
7
8
/*	$OpenBSD: igetest.c,v 1.4 2018/07/17 17:06:49 tb Exp $	*/
/* ====================================================================
 * Copyright (c) 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:
 *
Changes to jni/libressl/tests/keypairtest.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: keypairtest.c,v 1.3 2018/02/14 15:59:50 jsing Exp $ */
/*
 * Copyright (c) 2018 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/* $OpenBSD: keypairtest.c,v 1.4 2018/04/07 16:42:17 jsing Exp $ */
/*
 * Copyright (c) 2018 Joel Sing <jsing@openbsd.org>
 *
 * 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.
 *
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
		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(kp);

	if (kp->cert_mem != NULL || kp->cert_len != 0) {
		fprintf(stderr, "FAIL: cert not cleared (mem %p, len %zu)",
		    kp->cert_mem, kp->cert_len);
		goto done;
	}
	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 (kp->ocsp_staple != NULL || kp->ocsp_staple_len != 0) {
		fprintf(stderr, "FAIL: ocsp staple not cleared (mem %p, "
		    "len %zu)", kp->ocsp_staple, kp->ocsp_staple_len);
		goto done;
	}
	if (kp->pubkey_hash != NULL) {
		fprintf(stderr, "FAIL: pubkey hash not cleared (mem %p)\n",
		    kp->pubkey_hash);
		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);







|

<
<
<
<
<





<
<
<
<
<
<
<
<
<
<







130
131
132
133
134
135
136
137
138





139
140
141
142
143










144
145
146
147
148
149
150
		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);
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200

	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(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;
	}








|







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185

	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;
	}

Changes to jni/libressl/tests/md4test.c.
1
2
3
4
5
6
7
8
/* crypto/md4/md4test.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/md5test.c.
1
2
3
4
5
6
7
8
/* crypto/md5/md5test.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/ocsp_test.c.

















1
2
3
4
5
6
7

















#include <stdio.h>
#include <netdb.h>
#include <stdlib.h>
#include <unistd.h>
#include <err.h>
#include <sys/socket.h>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*	$OpenBSD: ocsp_test.c,v 1.6 2018/07/18 16:24:16 tb Exp $	*/
/*
 * Copyright (c) 2016 Bob Beck <beck@openbsd.org>
 *
 * 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 <stdio.h>
#include <netdb.h>
#include <stdlib.h>
#include <unistd.h>
#include <err.h>
#include <sys/socket.h>

Changes to jni/libressl/tests/pbkdf2.c.

1
2
3
4
5
6
7

/* Written by Christian Heimes, 2013 */
/*
 * 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
2
3
4
5
6
7
8
/*	$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.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
Changes to jni/libressl/tests/poly1305test.c.

1
2
3
4
5
6
7

/*
 * Public Domain poly1305 from Andrew Moon
 * Based on poly1305-donna.c from:
 *   https://github.com/floodyberry/poly1305-donna
 */

#include <stdio.h>
>







1
2
3
4
5
6
7
8
/*	$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:
 *   https://github.com/floodyberry/poly1305-donna
 */

#include <stdio.h>
Changes to jni/libressl/tests/randtest.c.
1
2
3
4
5
6
7
8
/* crypto/rand/randtest.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/rc2test.c.
1
2
3
4
5
6
7
8
/* crypto/rc2/rc2test.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/rc4test.c.
1
2
3
4
5
6
7
8
/* crypto/rc4/rc4test.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/rmdtest.c.
1
2
3
4
5
6
7
8
/* crypto/ripemd/rmdtest.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/rsa_test.c.

1
2
3
4
5
6
7

/*
 * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
>







1
2
3
4
5
6
7
8
/*	$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.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
Changes to jni/libressl/tests/sha1test.c.
1
2
3
4
5
6
7
8
/* crypto/sha/sha1test.c */
/* 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.
 * 
|







1
2
3
4
5
6
7
8
/*	$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.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 * 
Changes to jni/libressl/tests/sha256test.c.
1
2
3
4
5
6
7
8
/* crypto/sha/sha256t.c */
/* ====================================================================
 * Copyright (c) 2004 The OpenSSL Project.  All rights reserved.
 * ====================================================================
 */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
|







1
2
3
4
5
6
7
8
/*	$OpenBSD: sha256test.c,v 1.3 2018/07/17 17:06:50 tb Exp $	*/
/* ====================================================================
 * Copyright (c) 2004 The OpenSSL Project.  All rights reserved.
 * ====================================================================
 */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Changes to jni/libressl/tests/sha512test.c.
1
2
3
4
5
6
7
8
/* crypto/sha/sha512t.c */
/* ====================================================================
 * Copyright (c) 2004 The OpenSSL Project.  All rights reserved.
 * ====================================================================
 */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
|







1
2
3
4
5
6
7
8
/*	$OpenBSD: sha512test.c,v 1.4 2018/07/17 17:06:50 tb Exp $	*/
/* ====================================================================
 * Copyright (c) 2004 The OpenSSL Project.  All rights reserved.
 * ====================================================================
 */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Changes to jni/libressl/tests/utf8test.c.

1
2
3
4
5
6
7

/*
 * Copyright (c) 2014 Philip Guenther <guenther@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/*	$OpenBSD: utf8test.c,v 1.4 2018/07/17 17:06:50 tb Exp $	*/
/*
 * Copyright (c) 2014 Philip Guenther <guenther@openbsd.org>
 *
 * 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.
 *
Changes to jni/libressl/tests/x25519test.c.

1
2
3
4
5
6
7

/*
 * Copyright (c) 2015, Google 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.
 *
>







1
2
3
4
5
6
7
8
/*	$OpenBSD: x25519test.c,v 1.2 2018/07/17 17:06:49 tb Exp $	*/
/*
 * Copyright (c) 2015, Google 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.
 *
Changes to jni/libressl/tls/CMakeLists.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
include_directories(
	.
	../include
	../include/compat
)

set(
	TLS_SRC
	tls.c
	tls_bio_cb.c
	tls_client.c
	tls_config.c
	tls_conninfo.c
<
<
<
<
<
<













1
2
3
4
5
6
7






set(
	TLS_SRC
	tls.c
	tls_bio_cb.c
	tls_client.c
	tls_config.c
	tls_conninfo.c
33
34
35
36
37
38
39







40
41
42
43
44
45
46
47
48
49
50
51
if(NOT "${OPENSSLDIR}" STREQUAL "")
	add_definitions(-D_PATH_SSL_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
else()
	add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\")
endif()

add_library(tls ${TLS_SRC})







if (BUILD_SHARED_LIBS)
	export_symbol(tls ${CMAKE_CURRENT_SOURCE_DIR}/tls.sym)
	target_link_libraries(tls ssl crypto)
	if (WIN32)
		target_link_libraries(tls Ws2_32.lib)
		set(TLS_POSTFIX -${TLS_MAJOR_VERSION})
	endif()
	set_target_properties(tls PROPERTIES
		OUTPUT_NAME tls${TLS_POSTFIX}
		ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX})
	set_target_properties(tls PROPERTIES VERSION ${TLS_VERSION}
		SOVERSION ${TLS_MAJOR_VERSION})







>
>
>
>
>
>
>


|

<







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
if(NOT "${OPENSSLDIR}" STREQUAL "")
	add_definitions(-D_PATH_SSL_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
else()
	add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\")
endif()

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)

		set(TLS_POSTFIX -${TLS_MAJOR_VERSION})
	endif()
	set_target_properties(tls PROPERTIES
		OUTPUT_NAME tls${TLS_POSTFIX}
		ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX})
	set_target_properties(tls PROPERTIES VERSION ${TLS_VERSION}
		SOVERSION ${TLS_MAJOR_VERSION})
Changes to jni/libressl/tls/VERSION.
1
17:1:0
|
1
18:1:0
Changes to jni/libressl/tls/tls.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: tls.c,v 1.79 2018/03/19 16:34:47 jsing Exp $ */
/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/* $OpenBSD: tls.c,v 1.80 2018/04/07 16:30:59 jsing Exp $ */
/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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.
 *
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
static struct tls_config *tls_config_default;

static int tls_init_rv = -1;

static void
tls_do_init(void)
{
	SSL_load_error_strings();
	SSL_library_init();

	if (BIO_sock_init() != 1)
		return;

	if ((tls_config_default = tls_config_new_internal()) == NULL)
		return;








<
|







37
38
39
40
41
42
43

44
45
46
47
48
49
50
51
static struct tls_config *tls_config_default;

static int tls_init_rv = -1;

static void
tls_do_init(void)
{

	OPENSSL_init_ssl(OPENSSL_INIT_NO_LOAD_CONFIG, NULL);

	if (BIO_sock_init() != 1)
		return;

	if ((tls_config_default = tls_config_new_internal()) == NULL)
		return;

Changes to jni/libressl/tls/tls_config.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: tls_config.c,v 1.51.2.1 2018/04/18 16:29:11 jsing Exp $ */
/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/* $OpenBSD: tls_config.c,v 1.52 2018/04/07 16:35:34 jsing Exp $ */
/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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.
 *
Changes to jni/libressl/tls/tls_internal.h.
1
2
3
4
5
6
7
8
/* $OpenBSD: tls_internal.h,v 1.71.2.1 2018/04/18 16:29:11 jsing Exp $ */
/*
 * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org>
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/* $OpenBSD: tls_internal.h,v 1.72 2018/04/07 16:35:34 jsing Exp $ */
/*
 * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org>
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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.
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212

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_clear(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);







<







198
199
200
201
202
203
204

205
206
207
208
209
210
211

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);
Changes to jni/libressl/tls/tls_keypair.c.
1
2
3
4
5
6
7
8
/* $OpenBSD: tls_keypair.c,v 1.5.2.1 2018/04/18 16:29:11 jsing Exp $ */
/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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
2
3
4
5
6
7
8
/* $OpenBSD: tls_keypair.c,v 1.6 2018/04/07 16:35:34 jsing Exp $ */
/*
 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
 *
 * 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.
 *
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

struct tls_keypair *
tls_keypair_new(void)
{
	return calloc(1, sizeof(struct tls_keypair));
}

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_pubkey_hash(struct tls_keypair *keypair, struct tls_error *error)
{
	X509 *cert = NULL;
	int rv = -1;

	free(keypair->pubkey_hash);







<
<
<
<
<
<
<
<







25
26
27
28
29
30
31








32
33
34
35
36
37
38

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);
59
60
61
62
63
64
65








66
67
68
69
70
71
72
	rv = 0;

 err:
	X509_free(cert);
 done:
	return (rv);
}









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)







>
>
>
>
>
>
>
>







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
	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)
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138




139
140
141
142
143
144
145
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_clear(struct tls_keypair *keypair)
{
	struct tls_error error;

	tls_keypair_set_cert_mem(keypair, &error, NULL, 0);
	tls_keypair_set_key_mem(keypair, &error, NULL, 0);
	tls_keypair_set_ocsp_staple_mem(keypair, &error, NULL, 0);

	free(keypair->pubkey_hash);
	keypair->pubkey_hash = NULL;
}

void
tls_keypair_free(struct tls_keypair *keypair)
{
	if (keypair == NULL)
		return;

	tls_keypair_clear(keypair);





	free(keypair);
}

int
tls_keypair_load_cert(struct tls_keypair *keypair, struct tls_error *error,
    X509 **cert)







<
<
<
<
<
<
<
<
<
<
<
<
<






|
>
>
>
>







112
113
114
115
116
117
118













119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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)