提交 40cb2be7 编写于 作者: R Rich Salz 提交者: Richard Levitte
上级 be4660f8
...@@ -64,7 +64,7 @@ See the example below. ...@@ -64,7 +64,7 @@ See the example below.
=back =back
=head1 EXAMPLE =head1 EXAMPLES
To list all the commands available to a dynamic engine: To list all the commands available to a dynamic engine:
......
...@@ -20,7 +20,7 @@ second colon. ...@@ -20,7 +20,7 @@ second colon.
None. None.
=head1 EXAMPLE =head1 EXAMPLES
The error code: The error code:
......
...@@ -60,7 +60,7 @@ This option checks the correctness of parameters. ...@@ -60,7 +60,7 @@ This option checks the correctness of parameters.
=back =back
=head1 EXAMPLE =head1 EXAMPLES
Print out text version of parameters: Print out text version of parameters:
......
...@@ -170,7 +170,7 @@ is included, commonly as one of the first included headers. Therefore ...@@ -170,7 +170,7 @@ is included, commonly as one of the first included headers. Therefore
it is defined as an application developer's responsibility to include it is defined as an application developer's responsibility to include
windows.h prior to async.h. windows.h prior to async.h.
=head1 EXAMPLE =head1 EXAMPLES
The following example demonstrates how to use most of the core async APIs: The following example demonstrates how to use most of the core async APIs:
......
...@@ -129,9 +129,25 @@ BIO_set_ssl(), BIO_get_ssl(), BIO_set_ssl_mode(), ...@@ -129,9 +129,25 @@ BIO_set_ssl(), BIO_get_ssl(), BIO_set_ssl_mode(),
BIO_set_ssl_renegotiate_bytes(), BIO_set_ssl_renegotiate_timeout(), BIO_set_ssl_renegotiate_bytes(), BIO_set_ssl_renegotiate_timeout(),
BIO_get_num_renegotiates(), and BIO_do_handshake() are implemented as macros. BIO_get_num_renegotiates(), and BIO_do_handshake() are implemented as macros.
=head1 EXAMPLE =head1 RETURN VALUES
BIO_f_ssl() returns the SSL B<BIO_METHOD> structure.
BIO_set_ssl(), BIO_get_ssl(), BIO_set_ssl_mode(), BIO_set_ssl_renegotiate_bytes(),
BIO_set_ssl_renegotiate_timeout() and BIO_get_num_renegotiates() return 1 on
success or a value which is less than or equal to 0 if an error occurred.
BIO_new_ssl(), BIO_new_ssl_connect() and BIO_new_buffer_ssl_connect() return
a valid B<BIO> structure on success or B<NULL> if an error occurred.
BIO_ssl_copy_session_id() returns 1 on success or 0 on error.
BIO_do_handshake() returns 1 if the connection was established successfully.
A zero or negative value is returned if the connection could not be established.
=head1 EXAMPLES
This SSL/TLS client example, attempts to retrieve a page from an This SSL/TLS client example attempts to retrieve a page from an
SSL/TLS web server. The I/O routines are identical to those of the SSL/TLS web server. The I/O routines are identical to those of the
unencrypted example in L<BIO_s_connect(3)>. unencrypted example in L<BIO_s_connect(3)>.
...@@ -271,22 +287,6 @@ a client and also echoes the request to standard output. ...@@ -271,22 +287,6 @@ a client and also echoes the request to standard output.
BIO_flush(sbio); BIO_flush(sbio);
BIO_free_all(sbio); BIO_free_all(sbio);
=head1 RETURN VALUES
BIO_f_ssl() returns the SSL B<BIO_METHOD> structure.
BIO_set_ssl(), BIO_get_ssl(), BIO_set_ssl_mode(), BIO_set_ssl_renegotiate_bytes(),
BIO_set_ssl_renegotiate_timeout() and BIO_get_num_renegotiates() return 1 on
success or a value which is less than or equal to 0 if an error occurred.
BIO_new_ssl(), BIO_new_ssl_connect() and BIO_new_buffer_ssl_connect() return
a valid B<BIO> structure on success or B<NULL> if an error occurred.
BIO_ssl_copy_session_id() returns 1 on success or 0 on error.
BIO_do_handshake() returns 1 if the connection was established successfully.
A zero or negative value is returned if the connection could not be established.
=head1 HISTORY =head1 HISTORY
In OpenSSL before 1.0.0 the BIO_pop() call was handled incorrectly, In OpenSSL before 1.0.0 the BIO_pop() call was handled incorrectly,
......
...@@ -40,7 +40,7 @@ BIO_next() returns the next BIO in a chain. ...@@ -40,7 +40,7 @@ BIO_next() returns the next BIO in a chain.
BIO_method_type() returns the type of the BIO B<b>. BIO_method_type() returns the type of the BIO B<b>.
=head1 EXAMPLE =head1 EXAMPLES
Traverse a chain looking for digest BIOs: Traverse a chain looking for digest BIOs:
......
...@@ -53,7 +53,7 @@ on it other than the discarded return value. ...@@ -53,7 +53,7 @@ on it other than the discarded return value.
BIO_set() was removed in OpenSSL 1.1.0 as BIO type is now opaque. BIO_set() was removed in OpenSSL 1.1.0 as BIO type is now opaque.
=head1 EXAMPLE =head1 EXAMPLES
Create a memory BIO: Create a memory BIO:
......
...@@ -174,7 +174,7 @@ BIO_get_bind_mode() returns the set of B<BIO_BIND> flags, or -1 on failure. ...@@ -174,7 +174,7 @@ BIO_get_bind_mode() returns the set of B<BIO_BIND> flags, or -1 on failure.
BIO_new_accept() returns a BIO or NULL on error. BIO_new_accept() returns a BIO or NULL on error.
=head1 EXAMPLE =head1 EXAMPLES
This example accepts two connections on port 4444, sends messages This example accepts two connections on port 4444, sends messages
down each and finally closes both down. down each and finally closes both down.
......
...@@ -133,7 +133,7 @@ locations for B<bio1> and B<bio2>. Check the error stack for more information. ...@@ -133,7 +133,7 @@ locations for B<bio1> and B<bio2>. Check the error stack for more information.
[XXXXX: More return values need to be added here] [XXXXX: More return values need to be added here]
=head1 EXAMPLE =head1 EXAMPLES
The BIO pair can be used to have full control over the network access of an The BIO pair can be used to have full control over the network access of an
application. The application can call select() on the socket as required application. The application can call select() on the socket as required
...@@ -176,7 +176,7 @@ and must be transferred to the network. Use BIO_ctrl_get_read_request() to ...@@ -176,7 +176,7 @@ and must be transferred to the network. Use BIO_ctrl_get_read_request() to
find out, how many bytes must be written into the buffer before the find out, how many bytes must be written into the buffer before the
SSL_operation() can successfully be continued. SSL_operation() can successfully be continued.
=head1 WARNING =head1 WARNINGS
As the data is buffered, SSL_operation() may return with an ERROR_SSL_WANT_READ As the data is buffered, SSL_operation() may return with an ERROR_SSL_WANT_READ
condition, but there is still data in the write buffer. An application must condition, but there is still data in the write buffer. An application must
......
...@@ -163,7 +163,7 @@ BIO_set_nbio() always returns 1. ...@@ -163,7 +163,7 @@ BIO_set_nbio() always returns 1.
BIO_do_connect() returns 1 if the connection was successfully BIO_do_connect() returns 1 if the connection was successfully
established and 0 or -1 if the connection failed. established and 0 or -1 if the connection failed.
=head1 EXAMPLE =head1 EXAMPLES
This is example connects to a webserver on the local host and attempts This is example connects to a webserver on the local host and attempts
to retrieve a page and copy the result to standard output. to retrieve a page and copy the result to standard output.
......
...@@ -68,7 +68,7 @@ been initialized. ...@@ -68,7 +68,7 @@ been initialized.
BIO_new_fd() returns the newly allocated BIO or NULL is an error BIO_new_fd() returns the newly allocated BIO or NULL is an error
occurred. occurred.
=head1 EXAMPLE =head1 EXAMPLES
This is a file descriptor BIO version of "Hello World": This is a file descriptor BIO version of "Hello World":
......
...@@ -118,7 +118,16 @@ BIO_FLAGS_NONCLEAR_RST set has the same effect as a write operation. ...@@ -118,7 +118,16 @@ BIO_FLAGS_NONCLEAR_RST set has the same effect as a write operation.
There should be an option to set the maximum size of a memory BIO. There should be an option to set the maximum size of a memory BIO.
=head1 EXAMPLE =head1 RETURN VALUES
BIO_s_mem() and BIO_s_secmem() return a valid memory B<BIO_METHOD> structure.
BIO_set_mem_eof_return(), BIO_get_mem_data(), BIO_set_mem_buf() and BIO_get_mem_ptr()
return 1 on success or a value which is less than or equal to 0 if an error occurred.
BIO_new_mem_buf() returns a valid B<BIO> structure on success or NULL on error.
=head1 EXAMPLES
Create a memory BIO and write some data to it: Create a memory BIO and write some data to it:
...@@ -139,14 +148,6 @@ Extract the BUF_MEM structure from a memory BIO and then free up the BIO: ...@@ -139,14 +148,6 @@ Extract the BUF_MEM structure from a memory BIO and then free up the BIO:
BIO_set_close(mem, BIO_NOCLOSE); /* So BIO_free() leaves BUF_MEM alone */ BIO_set_close(mem, BIO_NOCLOSE); /* So BIO_free() leaves BUF_MEM alone */
BIO_free(mem); BIO_free(mem);
=head1 RETURN VALUES
BIO_s_mem() and BIO_s_secmem() return a valid memory B<BIO_METHOD> structure.
BIO_set_mem_eof_return(), BIO_get_mem_data(), BIO_set_mem_buf() and BIO_get_mem_ptr()
return 1 on success or a value which is less than or equal to 0 if an error occurred.
BIO_new_mem_buf() returns a valid B<BIO> structure on success or NULL on error.
=head1 COPYRIGHT =head1 COPYRIGHT
......
...@@ -211,11 +211,6 @@ the actual call parameter, see B<BIO_callback_ctrl>. ...@@ -211,11 +211,6 @@ the actual call parameter, see B<BIO_callback_ctrl>.
=back =back
=head1 EXAMPLE
The BIO_debug_callback() function is a good example, its source is
in crypto/bio/bio_cb.c
=head1 RETURN VALUES =head1 RETURN VALUES
BIO_get_callback_ex() and BIO_get_callback() return the callback function BIO_get_callback_ex() and BIO_get_callback() return the callback function
...@@ -228,6 +223,11 @@ via a call to BIO_set_callback_arg(). ...@@ -228,6 +223,11 @@ via a call to BIO_set_callback_arg().
BIO_debug_callback() returns 1 or B<ret> if it's called after specific BIO BIO_debug_callback() returns 1 or B<ret> if it's called after specific BIO
operations. operations.
=head1 EXAMPLES
The BIO_debug_callback() function is a good example, its source is
in crypto/bio/bio_cb.c
=head1 COPYRIGHT =head1 COPYRIGHT
Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
......
...@@ -64,7 +64,7 @@ BN_MONT_CTX_free() has no return value. ...@@ -64,7 +64,7 @@ BN_MONT_CTX_free() has no return value.
For the other functions, 1 is returned for success, 0 on error. For the other functions, 1 is returned for success, 0 on error.
The error codes can be obtained by L<ERR_get_error(3)>. The error codes can be obtained by L<ERR_get_error(3)>.
=head1 WARNING =head1 WARNINGS
The inputs must be reduced modulo B<m>, otherwise the result will be The inputs must be reduced modulo B<m>, otherwise the result will be
outside the expected range. outside the expected range.
......
...@@ -97,7 +97,7 @@ one of the first included headers. Therefore it is defined as an ...@@ -97,7 +97,7 @@ one of the first included headers. Therefore it is defined as an
application developer's responsibility to include windows.h prior to application developer's responsibility to include windows.h prior to
crypto.h where use of CRYPTO_THREAD_* types and functions is required. crypto.h where use of CRYPTO_THREAD_* types and functions is required.
=head1 EXAMPLE =head1 EXAMPLES
This example safely initializes and uses a lock. This example safely initializes and uses a lock.
......
...@@ -304,7 +304,7 @@ macros. ...@@ -304,7 +304,7 @@ macros.
EVP_MD_CTX_ctrl() sends commands to message digests for additional configuration EVP_MD_CTX_ctrl() sends commands to message digests for additional configuration
or control. or control.
=head1 EXAMPLE =head1 EXAMPLES
This example digests the data "Test Message\n" and "Hello World\n", using the This example digests the data "Test Message\n" and "Hello World\n", using the
digest name passed on the command line. digest name passed on the command line.
......
...@@ -121,7 +121,7 @@ All these functions return 1 for success and 0 or a negative value for failure. ...@@ -121,7 +121,7 @@ All these functions return 1 for success and 0 or a negative value for failure.
In particular a return value of -2 indicates the operation is not supported by In particular a return value of -2 indicates the operation is not supported by
the public key algorithm. the public key algorithm.
=head1 EXAMPLE =head1 EXAMPLES
This example derives 10 bytes using SHA-256 with the secret key "secret", This example derives 10 bytes using SHA-256 with the secret key "secret",
salt value "salt" and info value "label": salt value "salt" and info value "label":
......
...@@ -70,7 +70,7 @@ All these functions return 1 for success and 0 or a negative value for failure. ...@@ -70,7 +70,7 @@ All these functions return 1 for success and 0 or a negative value for failure.
In particular a return value of -2 indicates the operation is not supported by In particular a return value of -2 indicates the operation is not supported by
the public key algorithm. the public key algorithm.
=head1 EXAMPLE =head1 EXAMPLES
This example derives 10 bytes using SHA-256 with the secret key "secret" This example derives 10 bytes using SHA-256 with the secret key "secret"
and seed value "seed": and seed value "seed":
......
...@@ -41,7 +41,7 @@ EVP_PKEY_decrypt_init() and EVP_PKEY_decrypt() return 1 for success and 0 ...@@ -41,7 +41,7 @@ EVP_PKEY_decrypt_init() and EVP_PKEY_decrypt() return 1 for success and 0
or a negative value for failure. In particular a return value of -2 or a negative value for failure. In particular a return value of -2
indicates the operation is not supported by the public key algorithm. indicates the operation is not supported by the public key algorithm.
=head1 EXAMPLE =head1 EXAMPLES
Decrypt data using OAEP (for RSA keys): Decrypt data using OAEP (for RSA keys):
......
...@@ -42,7 +42,7 @@ EVP_PKEY_derive_init() and EVP_PKEY_derive() return 1 for success and 0 ...@@ -42,7 +42,7 @@ EVP_PKEY_derive_init() and EVP_PKEY_derive() return 1 for success and 0
or a negative value for failure. In particular a return value of -2 or a negative value for failure. In particular a return value of -2
indicates the operation is not supported by the public key algorithm. indicates the operation is not supported by the public key algorithm.
=head1 EXAMPLE =head1 EXAMPLES
Derive shared secret (for example DH or EC keys): Derive shared secret (for example DH or EC keys):
......
...@@ -41,7 +41,7 @@ EVP_PKEY_encrypt_init() and EVP_PKEY_encrypt() return 1 for success and 0 ...@@ -41,7 +41,7 @@ EVP_PKEY_encrypt_init() and EVP_PKEY_encrypt() return 1 for success and 0
or a negative value for failure. In particular a return value of -2 or a negative value for failure. In particular a return value of -2
indicates the operation is not supported by the public key algorithm. indicates the operation is not supported by the public key algorithm.
=head1 EXAMPLE =head1 EXAMPLES
Encrypt data using OAEP (for RSA keys). See also L<PEM_read_PUBKEY(3)> or Encrypt data using OAEP (for RSA keys). See also L<PEM_read_PUBKEY(3)> or
L<d2i_X509(3)> for means to load a public key. You may also simply L<d2i_X509(3)> for means to load a public key. You may also simply
......
...@@ -46,7 +46,7 @@ EVP_PKEY_sign_init() and EVP_PKEY_sign() return 1 for success and 0 ...@@ -46,7 +46,7 @@ EVP_PKEY_sign_init() and EVP_PKEY_sign() return 1 for success and 0
or a negative value for failure. In particular a return value of -2 or a negative value for failure. In particular a return value of -2
indicates the operation is not supported by the public key algorithm. indicates the operation is not supported by the public key algorithm.
=head1 EXAMPLE =head1 EXAMPLES
Sign data using RSA with PKCS#1 padding and SHA256 digest: Sign data using RSA with PKCS#1 padding and SHA256 digest:
......
...@@ -44,7 +44,7 @@ A negative value indicates an error other that signature verification failure. ...@@ -44,7 +44,7 @@ A negative value indicates an error other that signature verification failure.
In particular a return value of -2 indicates the operation is not supported by In particular a return value of -2 indicates the operation is not supported by
the public key algorithm. the public key algorithm.
=head1 EXAMPLE =head1 EXAMPLES
Verify signature using PKCS#1 and SHA256 digest: Verify signature using PKCS#1 and SHA256 digest:
......
...@@ -49,7 +49,7 @@ EVP_PKEY_verify_recover_init() and EVP_PKEY_verify_recover() return 1 for succes ...@@ -49,7 +49,7 @@ EVP_PKEY_verify_recover_init() and EVP_PKEY_verify_recover() return 1 for succes
and 0 or a negative value for failure. In particular a return value of -2 and 0 or a negative value for failure. In particular a return value of -2
indicates the operation is not supported by the public key algorithm. indicates the operation is not supported by the public key algorithm.
=head1 EXAMPLE =head1 EXAMPLES
Recover digest originally signed using PKCS#1 and SHA256 digest: Recover digest originally signed using PKCS#1 and SHA256 digest:
......
...@@ -75,7 +75,7 @@ corresponding to each certificate. ...@@ -75,7 +75,7 @@ corresponding to each certificate.
OCSP_request_onereq_count() and OCSP_request_onereq_get0() are mainly used by OCSP_request_onereq_count() and OCSP_request_onereq_get0() are mainly used by
OCSP responders. OCSP responders.
=head1 EXAMPLE =head1 EXAMPLES
Create an B<OCSP_REQUEST> structure for certificate B<cert> with issuer Create an B<OCSP_REQUEST> structure for certificate B<cert> with issuer
B<issuer>: B<issuer>:
......
...@@ -34,7 +34,7 @@ L<UI_OpenSSL(3)>, for example. ...@@ -34,7 +34,7 @@ L<UI_OpenSSL(3)>, for example.
PKCS12_newpass() returns 1 on success or 0 on failure. Applications can PKCS12_newpass() returns 1 on success or 0 on failure. Applications can
retrieve the most recent error from PKCS12_newpass() with ERR_get_error(). retrieve the most recent error from PKCS12_newpass() with ERR_get_error().
=head1 EXAMPLE =head1 EXAMPLES
This example loads a PKCS#12 file, changes its password and writes out This example loads a PKCS#12 file, changes its password and writes out
the result to a new file. the result to a new file.
......
...@@ -123,7 +123,7 @@ The RSA_padding_check_xxx() functions return the length of the ...@@ -123,7 +123,7 @@ The RSA_padding_check_xxx() functions return the length of the
recovered data, -1 on error. Error codes can be obtained by calling recovered data, -1 on error. Error codes can be obtained by calling
L<ERR_get_error(3)>. L<ERR_get_error(3)>.
=head1 WARNING =head1 WARNINGS
The result of RSA_padding_check_PKCS1_type_2() is a very sensitive The result of RSA_padding_check_PKCS1_type_2() is a very sensitive
information which can potentially be used to mount a Bleichenbacher information which can potentially be used to mount a Bleichenbacher
......
...@@ -81,7 +81,7 @@ means only that the plaintext was empty. ...@@ -81,7 +81,7 @@ means only that the plaintext was empty.
On error, -1 is returned; the error codes can be On error, -1 is returned; the error codes can be
obtained by L<ERR_get_error(3)>. obtained by L<ERR_get_error(3)>.
=head1 WARNING =head1 WARNINGS
Decryption failures in the RSA_PKCS1_PADDING mode leak information Decryption failures in the RSA_PKCS1_PADDING mode leak information
which can potentially be used to mount a Bleichenbacher padding oracle which can potentially be used to mount a Bleichenbacher padding oracle
......
...@@ -33,7 +33,7 @@ file syntax. ...@@ -33,7 +33,7 @@ file syntax.
SSL_CTX_config() and SSL_config() return 1 for success or 0 if an error SSL_CTX_config() and SSL_config() return 1 for success or 0 if an error
occurred. occurred.
=head1 EXAMPLE =head1 EXAMPLES
If the file "config.cnf" contains the following: If the file "config.cnf" contains the following:
......
...@@ -181,7 +181,7 @@ The functions SSL_CTX_dane_set_flags(), SSL_CTX_dane_clear_flags(), ...@@ -181,7 +181,7 @@ The functions SSL_CTX_dane_set_flags(), SSL_CTX_dane_clear_flags(),
SSL_dane_set_flags() and SSL_dane_clear_flags() return the B<flags> in effect SSL_dane_set_flags() and SSL_dane_clear_flags() return the B<flags> in effect
before they were called. before they were called.
=head1 EXAMPLE =head1 EXAMPLES
Suppose "smtp.example.com" is the MX host of the domain "example.com", and has Suppose "smtp.example.com" is the MX host of the domain "example.com", and has
DNSSEC-validated TLSA records. DNSSEC-validated TLSA records.
......
...@@ -29,13 +29,6 @@ Typically parameters are retrieved from an B<SSL_CTX> or B<SSL> structure ...@@ -29,13 +29,6 @@ Typically parameters are retrieved from an B<SSL_CTX> or B<SSL> structure
using SSL_CTX_get0_param() or SSL_get0_param() and an application modifies using SSL_CTX_get0_param() or SSL_get0_param() and an application modifies
them to suit its needs: for example to add a hostname check. them to suit its needs: for example to add a hostname check.
=head1 EXAMPLE
Check hostname matches "www.foo.com" in peer certificate:
X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl);
X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0);
=head1 RETURN VALUES =head1 RETURN VALUES
SSL_CTX_get0_param() and SSL_get0_param() return a pointer to an SSL_CTX_get0_param() and SSL_get0_param() return a pointer to an
...@@ -44,6 +37,13 @@ B<X509_VERIFY_PARAM> structure. ...@@ -44,6 +37,13 @@ B<X509_VERIFY_PARAM> structure.
SSL_CTX_set1_param() and SSL_set1_param() return 1 for success and 0 SSL_CTX_set1_param() and SSL_set1_param() return 1 for success and 0
for failure. for failure.
=head1 EXAMPLES
Check hostname matches "www.foo.com" in peer certificate:
X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl);
X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0);
=head1 SEE ALSO =head1 SEE ALSO
L<X509_VERIFY_PARAM_set_flags(3)> L<X509_VERIFY_PARAM_set_flags(3)>
......
...@@ -25,7 +25,7 @@ implemented as a macro. ...@@ -25,7 +25,7 @@ implemented as a macro.
SSL_library_init() must be called before any other action takes place. SSL_library_init() must be called before any other action takes place.
SSL_library_init() is not reentrant. SSL_library_init() is not reentrant.
=head1 WARNING =head1 WARNINGS
SSL_library_init() adds ciphers and digests used directly and indirectly by SSL_library_init() adds ciphers and digests used directly and indirectly by
SSL/TLS. SSL/TLS.
......
...@@ -71,7 +71,7 @@ applicable (as with RFC7671 DANE-EE(3)), or no trusted peername was ...@@ -71,7 +71,7 @@ applicable (as with RFC7671 DANE-EE(3)), or no trusted peername was
matched. Otherwise, it returns the matched peername. To determine matched. Otherwise, it returns the matched peername. To determine
whether verification succeeded call L<SSL_get_verify_result(3)>. whether verification succeeded call L<SSL_get_verify_result(3)>.
=head1 EXAMPLE =head1 EXAMPLES
Suppose "smtp.example.com" is the MX host of the domain "example.com". Suppose "smtp.example.com" is the MX host of the domain "example.com".
The calls below will arrange to match either the MX hostname or the The calls below will arrange to match either the MX hostname or the
......
...@@ -57,7 +57,7 @@ operation is considered completed. The bytes are sent and a new write call with ...@@ -57,7 +57,7 @@ operation is considered completed. The bytes are sent and a new write call with
a new buffer (with the already sent bytes removed) must be started. A partial a new buffer (with the already sent bytes removed) must be started. A partial
write is performed with the size of a message block, which is 16kB. write is performed with the size of a message block, which is 16kB.
=head1 WARNING =head1 WARNINGS
When a write function call has to be repeated because L<SSL_get_error(3)> When a write function call has to be repeated because L<SSL_get_error(3)>
returned B<SSL_ERROR_WANT_READ> or B<SSL_ERROR_WANT_WRITE>, it must be repeated returned B<SSL_ERROR_WANT_READ> or B<SSL_ERROR_WANT_WRITE>, it must be repeated
......
...@@ -76,7 +76,7 @@ from the corresponding B<X509_STORE>, please see ...@@ -76,7 +76,7 @@ from the corresponding B<X509_STORE>, please see
L<X509_STORE_set_verify(3)> for more information. L<X509_STORE_set_verify(3)> for more information.
=head1 WARNING =head1 WARNINGS
In general a verification callback should B<NOT> unconditionally return 1 in In general a verification callback should B<NOT> unconditionally return 1 in
all circumstances because this will allow verification to succeed no matter all circumstances because this will allow verification to succeed no matter
......
...@@ -346,7 +346,7 @@ If CRLs checking is enable CRLs are expected to be available in the ...@@ -346,7 +346,7 @@ If CRLs checking is enable CRLs are expected to be available in the
corresponding B<X509_STORE> structure. No attempt is made to download corresponding B<X509_STORE> structure. No attempt is made to download
CRLs from the CRL distribution points extension. CRLs from the CRL distribution points extension.
=head1 EXAMPLE =head1 EXAMPLES
Enable CRL checking when performing certificate verification during SSL Enable CRL checking when performing certificate verification during SSL
connections associated with an B<SSL_CTX> structure B<ctx>: connections associated with an B<SSL_CTX> structure B<ctx>:
......
...@@ -483,7 +483,7 @@ For example: ...@@ -483,7 +483,7 @@ For example:
basicConstraints=critical,DER:00:01:02:03 basicConstraints=critical,DER:00:01:02:03
=head1 WARNING =head1 WARNINGS
There is no guarantee that a specific implementation will process a given There is no guarantee that a specific implementation will process a given
extension. It may therefore be sometimes possible to use certificates for extension. It may therefore be sometimes possible to use certificates for
...@@ -493,7 +493,6 @@ not recognize or honour the values of the relevant extensions. ...@@ -493,7 +493,6 @@ not recognize or honour the values of the relevant extensions.
The DER and ASN1 options should be used with caution. It is possible to create The DER and ASN1 options should be used with caution. It is possible to create
totally invalid extensions if they are not used carefully. totally invalid extensions if they are not used carefully.
=head1 NOTES =head1 NOTES
If an extension is multi-value and a field value must contain a comma the long If an extension is multi-value and a field value must contain a comma the long
......
...@@ -53,7 +53,7 @@ Ed25519 and Ed448 can be tested within L<speed(1)> application since version 1.1 ...@@ -53,7 +53,7 @@ Ed25519 and Ed448 can be tested within L<speed(1)> application since version 1.1
Valid algorithm names are B<ed25519>, B<ed448> and B<eddsa>. If B<eddsa> is Valid algorithm names are B<ed25519>, B<ed448> and B<eddsa>. If B<eddsa> is
specified, then both Ed25519 and Ed448 are benchmarked. specified, then both Ed25519 and Ed448 are benchmarked.
=head1 EXAMPLE =head1 EXAMPLES
This example generates an B<ED25519> private key and writes it to standard This example generates an B<ED25519> private key and writes it to standard
output in PEM format: output in PEM format:
......
...@@ -41,7 +41,7 @@ done by calling: ...@@ -41,7 +41,7 @@ done by calling:
And normally there is no need to pass a B<pctx> parameter to EVP_DigestSignInit() And normally there is no need to pass a B<pctx> parameter to EVP_DigestSignInit()
or EVP_DigestVerifyInit() in such a scenario. or EVP_DigestVerifyInit() in such a scenario.
=head1 EXAMPLE =head1 EXAMPLES
This example demonstrates the calling sequence for using an B<EVP_PKEY> to verify This example demonstrates the calling sequence for using an B<EVP_PKEY> to verify
a message with the SM2 signature algorithm and the SM3 hash algorithm: a message with the SM2 signature algorithm and the SM3 hash algorithm:
......
...@@ -37,7 +37,7 @@ X25519 or X448 public keys can be set directly using ...@@ -37,7 +37,7 @@ X25519 or X448 public keys can be set directly using
L<EVP_PKEY_new_raw_public_key(3)> or loaded from a SubjectPublicKeyInfo L<EVP_PKEY_new_raw_public_key(3)> or loaded from a SubjectPublicKeyInfo
structure in a PEM file using L<PEM_read_bio_PUBKEY(3)> (or similar function). structure in a PEM file using L<PEM_read_bio_PUBKEY(3)> (or similar function).
=head1 EXAMPLE =head1 EXAMPLES
This example generates an B<X25519> private key and writes it to standard This example generates an B<X25519> private key and writes it to standard
output in PEM format: output in PEM format:
......
...@@ -52,7 +52,7 @@ pointer to a BIO_METHOD. There is a naming convention for such functions: ...@@ -52,7 +52,7 @@ pointer to a BIO_METHOD. There is a naming convention for such functions:
a source/sink BIO is normally called BIO_s_*() and a filter BIO a source/sink BIO is normally called BIO_s_*() and a filter BIO
BIO_f_*(); BIO_f_*();
=head1 EXAMPLE =head1 EXAMPLES
Create a memory BIO: Create a memory BIO:
......
...@@ -38,7 +38,7 @@ A context for scrypt can be obtained by calling: ...@@ -38,7 +38,7 @@ A context for scrypt can be obtained by calling:
The output length of an scrypt key derivation is specified via the The output length of an scrypt key derivation is specified via the
length parameter to the L<EVP_PKEY_derive(3)> function. length parameter to the L<EVP_PKEY_derive(3)> function.
=head1 EXAMPLE =head1 EXAMPLES
This example derives a 64-byte long test vector using scrypt using the password This example derives a 64-byte long test vector using scrypt using the password
"password", salt "NaCl" and N = 1024, r = 8, p = 16. "password", salt "NaCl" and N = 1024, r = 8, p = 16.
......
...@@ -137,17 +137,17 @@ sub name_synopsis() ...@@ -137,17 +137,17 @@ sub name_synopsis()
} }
} }
# Check if SECTION is located before BEFORE # Check if SECTION ($3) is located before BEFORE ($4)
sub check_section_location() sub check_section_location()
{ {
my $filename = shift; my $id = shift;
my $contents = shift; my $contents = shift;
my $section = shift; my $section = shift;
my $before = shift; my $before = shift;
return unless $contents =~ /=head1 $section/ return
and $contents =~ /=head1 $before/; unless $contents =~ /=head1 $section/ and $contents =~ /=head1 $before/;
print "$filename: $section should be placed before $before section\n" print "$id $section should be placed before $before section\n"
if $contents =~ /=head1 $before.*=head1 $section/ms; if $contents =~ /=head1 $before.*=head1 $section/ms;
} }
...@@ -164,15 +164,15 @@ sub check() ...@@ -164,15 +164,15 @@ sub check()
close POD; close POD;
} }
# Check if EXAMPLES is located after RETURN VALUES section.
&check_section_location($filename, $contents, "RETURN VALUES", "EXAMPLES") if $filename =~ m|man3/|;
# Check if HISTORY is located after SEE ALSO
&check_section_location($filename, $contents, "SEE ALSO", "HISTORY") if $filename =~ m|man3/|;
# Check if SEE ALSO is located after EXAMPLES
&check_section_location($filename, $contents, "EXAMPLES", "SEE ALSO") if $filename =~ m|man3/|;
my $id = "${filename}:1:"; my $id = "${filename}:1:";
# Check ordering of some sections in man3
if ( $filename =~ m|man3/| ) {
&check_section_location($id, $contents, "RETURN VALUES", "EXAMPLES");
&check_section_location($id, $contents, "SEE ALSO", "HISTORY");
&check_section_location($id, $contents, "EXAMPLES", "SEE ALSO");
}
&name_synopsis($id, $filename, $contents) &name_synopsis($id, $filename, $contents)
unless $contents =~ /=for comment generic/ unless $contents =~ /=for comment generic/
or $filename =~ m@man[157]/@; or $filename =~ m@man[157]/@;
...@@ -183,6 +183,10 @@ sub check() ...@@ -183,6 +183,10 @@ sub check()
if $contents !~ /=cut\n$/; if $contents !~ /=cut\n$/;
print "$id more than one cut line.\n" print "$id more than one cut line.\n"
if $contents =~ /=cut.*=cut/ms; if $contents =~ /=cut.*=cut/ms;
print "$id EXAMPLE not EXAMPLES section.\n"
if $contents =~ /=head1 EXAMPLE[^S]/;
print "$id WARNING not WARNINGS section.\n"
if $contents =~ /=head1 WARNING[^S]/;
print "$id missing copyright\n" print "$id missing copyright\n"
if $contents !~ /Copyright .* The OpenSSL Project Authors/; if $contents !~ /Copyright .* The OpenSSL Project Authors/;
print "$id copyright not last\n" print "$id copyright not last\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册