Commit Graph

714 Commits

Author SHA1 Message Date
Tomas Mraz dabf4696d4 Copyright year updates
Reviewed-by: Matt Caswell <matt@openssl.org>
Release: yes
2023-09-11 16:07:52 +02:00
Tianjia Zhang a60f8b8871
Fix typo in function name
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21608)

(cherry picked from commit 38c70a161c)
2023-08-02 20:29:30 +01:00
Tomas Mraz aff2886eab Copyright year updates
Reviewed-by: Richard Levitte <levitte@openssl.org>
Release: yes
2023-05-30 14:42:20 +02:00
Tomas Mraz 0d16b7e99a Fix documentation of X509_VERIFY_PARAM_add0_policy()
The function was incorrectly documented as enabling policy checking.

Fixes: CVE-2023-0466

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20564)
2023-03-28 14:13:38 +02:00
Tomas Mraz 7d8a20ce24 Update copyright year
Reviewed-by: Richard Levitte <levitte@openssl.org>
Release: yes
(Merged from https://github.com/openssl/openssl/pull/19560)
2022-11-01 13:28:05 +01:00
Pauli c7a02ba09e doc: fix copy/paste error
Fixes #19460

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19461)

(cherry picked from commit 5b9480fc1e)
2022-10-24 09:52:46 +11:00
Dr. David von Oheimb ad714baea8 Fix many inconsistencies in doc of CMS_verify() and PKC7_verify() etc.
Also change B< to I< in {CMS,PKCS7}_verify.pod, PKCS7_sign{,_add_signer}.pod

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19108)

(cherry picked from commit 312a6b3a03)
2022-10-19 20:31:22 +02:00
Matt Caswell 0874d7f21b Update copyright year
Reviewed-by: Richard Levitte <levitte@openssl.org>
Release: yes
(Merged from https://github.com/openssl/openssl/pull/19383)
2022-10-11 13:26:59 +01:00
Roberto Hueso Gomez 4648839300 Fix EC_KEY_set_private_key() NULL priv_key docs
Updates the docs to describe EC_KEY_set_private_key() function behavior
when a NULL priv_key argument is passed.

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18874)
2022-08-04 12:09:16 +03:00
Pauli 7dfe4aa2b0 Note that EVP_CIPHER_iv_length returns negative values on error
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18894)
2022-07-29 10:15:06 +01:00
Pauli e544f3ec83
Fix error in LHASH documentation
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/18859)

(cherry picked from commit 316fad64c1)
2022-07-26 08:05:05 +01:00
Dr. David von Oheimb ee4562d5d3 X509_STORE_CTX_purpose_inherit(): add missing details to its documentation
Fixes #18801

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18830)

(cherry picked from commit c00fd2dece)
2022-07-21 11:53:11 +02:00
Richard Levitte 95a17c0ead Update copyright year
Reviewed-by: Paul Dale <pauli@openssl.org>
Release: yes
2022-07-05 10:33:00 +02:00
olszomal 8825732466 SSL_get_current_cipher() and SSL_get_pending_cipher() return 'const SSL_CIPHER *'
Fix the documentation.

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18599)

(cherry picked from commit d842b6eff0)
2022-06-28 18:00:27 +02:00
Matt Caswell a3fc812c0c Update copyright year
Reviewed-by: Richard Levitte <levitte@openssl.org>
Release: yes
2022-06-21 14:13:56 +01:00
Fraser Tweedale 20af01d46c Fix documentation of BIO_FLAGS_BASE64_NO_NL
Commit 8bfb7506d2 updated
`BIO_f_base64(3)` to improve the documentation of the
`BIO_FLAGS_BASE64_NO_NL` flag.  In particular, the updated text
states that when this flag is used, all newlines in the input are
ignored.  This is incorrect, as the following program proves:

```c

unsigned char *in_buf =
    "IlRoZSBxdWljayBicm93biBmb3gganVt\ncHMgb3ZlciBhIGxhenkgZG9nLiI=\n";

int main(int argc, char **argv) {
    BIO *b64 = BIO_new(BIO_f_base64());
    if (b64 == NULL) return 1;
    BIO_set_flags(b64, BIO_get_flags(b64) | BIO_FLAGS_BASE64_NO_NL);
    int in_len = strlen(in_buf);
    BIO *in = BIO_new_mem_buf(in_buf, in_len);
    if (in == NULL) return 2;
    in = BIO_push(b64, in);
    unsigned char *out_buf = calloc(in_len, sizeof(unsigned char));
    if (out_buf == NULL) return 3;
    size_t out_len;
    int r = BIO_read_ex(in, out_buf, in_len, &out_len);
    printf("rv = %d\n", r);
    printf("decoded = %s\n", out_buf);
    return 0;
}
```

Update the text of `BIO_f_base64(3)` to clarify that when the flag
is set, the data must be all on one line (with or without a trailing
newline character).

Signed-off-by: Fraser Tweedale <ftweedal@redhat.com>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18568)

(cherry picked from commit 0edcbacca9)
2022-06-16 16:09:17 +02:00
Hugo Landau ec1b4bf26c (1.1) Add SSL_(CTX_)?get0_(verify|chain)_cert_store functions
Backport of #18038 to 1.1.

Fixes #18035.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/18190)
2022-05-05 17:54:46 +10:00
Matt Caswell b5b37553bc Update copyright year
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Release: yes
2022-05-03 13:38:37 +01:00
Todd Short 79dbd85fe2 ticket_lifetime_hint may exceed 1 week in TLSv1.3
For TLSv1.3, limit ticket lifetime hint to 1 week per RFC8446

Fixes #17948

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17952)

(cherry picked from commit 0089cc7f9d)
2022-03-25 13:24:05 -04:00
Matt Caswell 0c5bc96fb7 Update copyright year
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2022-03-15 13:57:22 +00:00
Tomas Mraz b5fcb7e133 Add documentation of BN_mod_sqrt()
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2022-03-15 13:39:27 +00:00
Todd Short 655e06a18b DOC: TLS compression is disabled by default
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/17854)

(cherry picked from commit 2cb52118dd)
2022-03-11 10:38:51 -05:00
Daniel 2d7afbd93d Improve documentation of BIO_FLAGS_BASE64_NO_NL flag.
Fixes #12491.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17744)

(cherry picked from commit 8bfb7506d2)
2022-03-02 13:02:14 +01:00
Thomas1664 191c9e6c24 Correct return type for BIO_ptr_ctrl
Fixes #17549
CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17636)

(cherry picked from commit 984cc9a028)
2022-02-07 11:50:43 +11:00
Matt Caswell 7349bf14be Document purpose and trust setting functions
In particular:
X509_STORE_CTX_set_purpose()
X509_STORE_CTX_set_trust();
X509_STORE_CTX_purpose_inherit();

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17604)
2022-02-02 14:17:19 +00:00
Dr. David von Oheimb 4623700d4e OBJ_obj2txt(): fix off-by-one documentation of the result
This backports the doc improvements of #17188.

Reviewed-by: Tomas Mraz <tomas@openssl.org>

(cherry picked from commit e36d10925396b6519e1abd338e1ef62cd5b1c9e6)
2022-01-03 17:56:57 +01:00
Michael Baentsch 5da141ff6c document additional stack push error code
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17351)
2021-12-24 08:32:05 +01:00
Matt Caswell defe51c178 Update copyright year
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17271)
2021-12-14 14:49:05 +00:00
Richard Levitte 8b35838b44 Fix faulty detail in BN_rand() manual
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17131)
2021-12-11 09:29:56 +01:00
Dr. David von Oheimb 7a045a4e5a OBJ_nid2obj.pod: Replace remaining 'B<' by 'I<' were appropriate
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17221)
2021-12-09 18:08:19 +01:00
Matt Caswell b1553c8928 Fix documentation for tlsext_ticket_key
The tlsext_ticket_key functions are documented as returning 0 on success.
In fact they return 1 on success.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17210)

(cherry picked from commit b0be101326)
2021-12-07 14:26:14 +00:00
Dr. David von Oheimb 54c358382e BIO_f_ssl.pod: Make clear where an SSL BIOs are expected as an argument
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17135)
2021-12-03 11:55:14 +01:00
Dr. David von Oheimb 791bfd91bc BIO_push.pod: fix confusing text and add details on corner cases
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17086)

(cherry picked from commit 7a37fd09a8)
2021-11-26 15:13:36 +01:00
Matt Caswell fd0fd729bb Clarify and correct the EVP_CTRL_AEAD_SET_TAG docs
The restriction about setting a tag length prior to setting the IV only
applies to OCB mode. We clarify when in the process EVP_CTRL_AEAD_SET_TAG
can be called.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17111)

(cherry picked from commit 3607b8ad8e)
2021-11-24 17:19:59 +00:00
Richard Levitte 6052078d41 DOC: Add a few previously documented functions
d2i_X509_bio(), d2i_X509_fp(), i2d_X509_bio(), and i2d_X509_fp()
were documented in OpenSSL 1.0.2.  In a grand unification of the
documentation of (almost) all d2i and i2d functions, these were
dropped, most likely by mistake.

This simply adds them back.

Fixes #17091

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17093)
2021-11-23 19:38:04 +01:00
PW Hu 851abe78b4 Fix some documentation errors related to return values
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16794)

(cherry picked from commit f1d077f110)
2021-10-22 11:40:49 +02:00
Dr. Matthias St. Pierre c23abef43e doc/man3/SSL_set_fd.pod: add note about Windows compiler warning
According to an old stackoverflow thread [1], citing an even older comment by
Andy Polyakov (1875e6db29, Pull up Win64 support from 0.9.8., 2005-07-05),
a cast of 'SOCKET' (UINT_PTR) to 'int' does not create a problem, because although
the documentation [2] claims that the upper limit is INVALID_SOCKET-1 (2^64 - 2),
in practice the socket() implementation on Windows returns an index into the kernel
handle table, the size of which is limited to 2^24 [3].

Add this note to the manual page to avoid unnecessary roundtrips to StackOverflow.

[1] https://stackoverflow.com/questions/1953639/is-it-safe-to-cast-socket-to-int-under-win64
[2] https://docs.microsoft.com/en-us/windows/win32/winsock/socket-data-type-2
[3] https://docs.microsoft.com/en-us/windows/win32/sysinfo/kernel-objects

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16699)

(cherry picked from commit f8dd5869bc)
2021-09-30 14:09:59 +02:00
Matt Caswell 5402f96aba Correct the documentation for SSL_set_num_tickets()
The behaviour for what happens in a resumption connection was not quite
described correctly.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16582)

(cherry picked from commit 4603b782e6)
2021-09-17 14:35:10 +02:00
Matt Caswell 97a1fb5106 Clarify what SSL_get_session() does on the server side in TLSv1.3
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16582)

(cherry picked from commit 9e51f87793)
2021-09-17 14:34:16 +02:00
Matt Caswell 6f2a7abe22 Update copyright year
Reviewed-by: Richard Levitte <levitte@openssl.org>
2021-08-24 14:14:34 +01:00
Billy Brumley 5b31b9df7f [doc/man3] documentation: BN_cmp manpage updates
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/16214)

(cherry picked from commit 3d4ca443b4)
2021-08-05 12:29:03 +02:00
Tomas Mraz f775b5c485 doc: Mention the update of der data pointers in d2i/i2d
Fixes #15958

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15973)
2021-07-01 16:08:42 +02:00
Nan Xiao 46dc0bca6c Remove unnecessary BIO_do_handshake()s
Since BIO_do_connect() and BIO_do_handshake() are same, no
need to invoke BIO_do_handshake() once more after BIO_do_connect().

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14725)

(cherry picked from commit 975e37cd01)
2021-04-01 15:22:10 +02:00
Nan Xiao 4cd2e3c952 Fix typo in BIO_push.pod
CLA: trivial

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14718)

(cherry picked from commit 2db9bef264)
2021-03-30 18:56:01 +02:00
Matt Caswell 2b2e3106fc Update copyright year
Reviewed-by: Richard Levitte <levitte@openssl.org>
2021-02-16 15:17:22 +00:00
Dr. David von Oheimb fb1e241104 X509_cmp(): Fix comparison in case x509v3_cache_extensions() failed to due to invalid cert
This is the backport of #13755 to v1.1.1.
Fixes #13698

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13756)
2021-01-14 14:36:09 +01:00
Billy Brumley 6e3ba20dc4 [crypto/dh] side channel hardening for computing DH shared keys (1.1.1)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/13772)
2021-01-10 21:58:39 +02:00
Rich Salz 3b5edb4a8c Document OCSP_REQ_CTX_i2d.
This is a backport of the documentation from #13620.

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13691)
2020-12-18 09:16:45 +01:00
Nan Xiao 5daa28ad70 Fix typo in OPENSSL_malloc.pod
CLA: trivial

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13632)

(cherry picked from commit 74c8dd1c51)
2020-12-09 13:36:55 +01:00
Dr. David von Oheimb 315c47e00b x509_vfy.c: Restore rejection of expired trusted (root) certificate
The certificate path validation procedure specified in RFC 5280 does not
include checking the validity period of the trusted (root) certificate.
Still it is common good practice to perform this check.
Also OpenSSL did this until version 1.1.1h, yet
commit e2590c3a16 accidentally killed it.

The current commit restores the previous behavior.
It also removes the cause of that bug, namely counter-intuitive design
of the internal function check_issued(), which was complicated by checks
that actually belong to some other internal function, namely find_issuer().

Moreover, this commit adds a regression check and proper documentation of
the root cert validity period check feature, which had been missing so far.

Fixes #13471

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13585)
2020-12-03 15:11:41 +01:00