Commit Graph

525 Commits

Author SHA1 Message Date
Kurt Roeckx d777ca4900 Fix propotype to include the const qualifier
Reviewed-by: Andy Polyakov <appro@openssl.org>
GH: #5582
2018-03-11 14:30:28 +01:00
Dr. Matthias St. Pierre abeb388fd0 BIO_s_mem.pod: fix indirection for out parameter **pp
BIO_get_mem_data() and BIO_get_mem_ptr() assign to *pp, not pp

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5544)
2018-03-07 15:12:43 +01:00
Ivan Filenko c1190c32c4 Fix typo in ASN1_STRING_length doc
CLA: trivial

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/5458)
2018-03-01 20:15:21 +01:00
Rich Salz fe8199badf Add warnings to thread doc.
Thanks to Yun Jiang for pointing this out.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5164)
2018-01-24 17:28:45 -05:00
Rich Salz d3736a65ba Fix BN doc
Backport from https://github.com/openssl/openssl/pull/5141

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5151)

(cherry picked from commit 8b2124aba3)
2018-01-24 16:08:27 -05:00
Viktor Dukhovni 6f4c54dcf3 Add missing comma between references
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
2017-12-23 13:03:20 -05:00
Viktor Dukhovni 71d53e8ba5 Document the X509_V_FLAG_PARTIAL_CHAIN flag
Also documented X509_V_FLAG_TRUSTED_FIRST

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
2017-12-13 10:52:03 -05:00
FdaSilvaYY 2821412ac5 Fix docs for EVP_EncryptUpdate and EVP_DecryptUpdate
Fixes #4775

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4815)

(cherry picked from commit a61c15eb9b)
2017-11-30 19:09:17 +01:00
Dr. Stephen Henson 720aa0f534 Fix backport by moving file.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4453)
2017-10-03 14:23:26 +01:00
Hubert Kario d9a38e859d doc: note that the BN_new() initialises the BIGNUM
BN_new() and BN_secure_new() not only allocate memory, but also
initialise it to deterministic value - 0.

Document that behaviour to make it explicit

backport from #4438

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4443)
2017-09-29 12:53:14 -04:00
Hubert Kario 20d2aaf22e doc: BN_free() is NULL-safe
document that parameter to BN_free can be NULL

backport from master

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4439)
2017-09-29 13:27:32 +02:00
Dr. Stephen Henson e74be3266d Correct GCM docs.
Fix GCM documentation: the tag does not have to be supplied before
decrypting any data any more.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4231)
2017-08-24 00:00:31 +01:00
Rich Salz c0f4a55605 Tweak wording to be more clear.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4234)

(cherry picked from commit a130950df9)
2017-08-23 17:47:58 -04:00
Paul Yang 63de36ae12 Backport X509_check_private_key.pod
to address #3973, and original PR to master branch is #3614

test case in the original PR is not applied.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4002)
2017-07-26 23:16:26 -04:00
Emilia Kasper 5c5fef4d7a RSA_padding_check_PKCS1_type_2 is not constant time.
This is an inherent weakness of the padding mode. We can't make the
implementation constant time (see the comments in rsa_pk1.c), so add a
warning to the docs.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2017-07-18 11:27:27 +02:00
Matt Caswell 8a996d2a55 Document that HMAC() with a NULL md is not thread safe
Fixes #3541

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3555)
2017-05-25 15:36:58 +01:00
Camille Guérin 60a70a5107 Fixed typo in X509_STORE_CTX_new description
'X509_XTORE_CTX_cleanup' ->  'X509_STORE_CTX_cleanup'
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3271)
(cherry picked from commit 7643a1723e)

(cherry picked from commit 2c0b8d2872)
2017-04-22 18:28:01 -04:00
Steven Collison 04bc46ddd5 doc: Add stitched ciphers to EVP_EncryptInit.pod
These ciphers don't appear to be documented anywhere. Given the
performance[1] benefits I think it makes sense to expose them.

[1] https://software.intel.com/sites/default/files/open-ssl-performance-paper.pdf

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3067)
(cherry picked from commit 209fac9f8a)
2017-03-29 09:36:16 +01:00
Matt Caswell 366a997f89 Fix some RSA documentation
RSA_private_encrypt(), RSA_public_decrypt(), RSA_public_encrypt() and
RSA_private_decrypt() are declared with a "const" from parameter, but
this is not reflected in the docs.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2899)
(cherry picked from commit b41f6b64f8)
2017-03-10 16:21:47 +00:00
Pauli 5c09502be4 Remove doc reference to non-existant GCM example
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2866)

(cherry picked from commit c1f84df248)
2017-03-07 10:08:47 -05:00
Darren Tucker 07109409da DES keys are not 7 days long.
CLA: trivial
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2604)

(cherry picked from commit ca423a693a)
2017-02-13 11:55:15 +01:00
Finn Hakansson 3fb9f875e7 Fix typo.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
CLA: trivial
(Merged from https://github.com/openssl/openssl/pull/2086)
(cherry picked from commit 0b742f93ea)

(cherry picked from commit f7a2da1d58)
2016-12-18 21:48:46 +01:00
Richard Levitte c4c71650bb Clarify what X509_NAME_online does with the given buffer and size
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1980)
(cherry picked from commit 19cb71ef6e)

(cherry picked from commit 793d9b7903)
2016-11-23 00:37:53 +01:00
Beat Bolli 09b894b512 Use consistent variable names
In the X509_NAME_get_index_by_NID.pod example, the initialized variable is called
"loc", but the one used in the for loop is called "lastpos". Make the names match.

CLA: trivial
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1949)

(cherry picked from commit 4b9c2669f3)
2016-11-18 07:35:01 -05:00
Steven Fackler 78ee64c237 Fix signatures of EVP_Digest{Sign,Verify}Update
These are implemented as macros delegating to `EVP_DigestUpdate`, which
takes a `size_t` as its third argument, not an `unsigned int`.

CLA: trivial

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 8bdce8d160)
2016-10-15 23:47:01 +01:00
Rich Salz 3f10149603 Misc BN fixes
Never output -0; make "negative zero" an impossibility.
Do better checking on BN_rand top/bottom requirements and #bits.
Update doc.
Ignoring trailing garbage in BN_asc2bn.

Port this commit from boringSSL: https://boringssl.googlesource.com/boringssl/+/899b9b19a4cd3fe526aaf5047ab9234cdca19f7d%5E!/
        Ensure |BN_div| never gives negative zero in the no_branch code.

        Have |bn_correct_top| fix |bn->neg| if the input is zero so that we
        don't have negative zeros lying around.

        Thanks to Brian Smith for noticing.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 01c09f9fde)
(Some manual work required)
2016-09-06 11:09:50 -04:00
Rich Salz a03f81f4ea Fix NULL-return checks in 1.0.2
RT4386: Add sanity checks for BN_new()
RT4384: Missing Sanity Checks for RSA_new_method()
RT4384: Missing Sanity Check plus potential NULL pointer deref
RT4382: Missing Sanity Check(s) for BUF_strdup()
RT4380: Missing Sanity Checks for EVP_PKEY_new()
RT4377: Prevent potential NULL pointer dereference
RT4375: Missing sanity checks for OPENSSL_malloc()
RT4374: Potential for NULL pointer dereferences
RT4371: Missing Sanity Check for malloc()
RT4370: Potential for NULL pointer dereferences

Also expand tabs, make update, typo fix (rsalz)
Minor tweak by Paul Dale.
Some minor internal review feedback.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-08-19 10:44:32 -04:00
Dr. Stephen Henson b880283683 Clarify digest change in HMAC_Init_ex()
RT#4603

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-22 14:11:13 +01:00
Rich Salz f3dbce6634 RT2964: Fix it via doc
OBJ_nid2obj() and friends should be treated as const.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit 5d28ff38fd)
2016-06-26 09:26:19 -04:00
Rich Salz 345b8400c1 Revert "RT2964: Fix it via doc"
This reverts commit 58b18779ba.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-06-25 22:09:05 -04:00
Rich Salz 58b18779ba RT2964: Fix it via doc
OBJ_nid2obj() and friends should be treated as const.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit 82f31fe4dd)
2016-06-25 16:40:51 -04:00
Andy Polyakov ecb044db58 doc/crypto/OPENSSL_ia32cap.pod: harmonize with actual declaration.
[Note that in master declaration is different.]

RT#4568

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-22 20:18:17 +02:00
Pauli d9e6d77164 RT4573: Synopsis for RAND_add is wrong
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-06-16 07:28:49 -04:00
Rich Salz 95fb422ace RT4546: Backport doc fix
Reviewed-by: Matt Caswell <matt@openssl.org>
Manual cherry-pick of 538860a3ce.
2016-06-14 15:04:33 -04:00
Rich Salz dd8a1f2016 RT4562: Backport doc fix.
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-06-14 12:44:27 -04:00
Dr. Stephen Henson fd785ca892 Parameter copy sanity checks.
Don't copy parameters is they're already present in the destination.
Return error if an attempt is made to copy different parameters to
destination. Update documentation.

If key type is not initialised return missing parameters

RT#4149

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit f72f00d495)
2016-05-31 13:26:54 +01:00
Viktor Dukhovni 96747f0f4e Clarify negative return from X509_verify_cert()
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-05-19 18:14:43 -04:00
Richard Levitte 2a73576f89 Documentation: Clarify sizes for UI_add_input_string()
The given sizes to not include the final NUL character.

RT#2622

Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 727ee8cfeb)
2016-05-16 18:35:11 +02:00
Viktor Dukhovni 36c3794490 Fix i2d_X509_AUX and update docs
When *pp is NULL, don't write garbage, return an unexpected pointer
or leak memory on error.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-05-11 01:50:03 -04:00
Matt Caswell d516d7a940 Fix BIO_eof() for BIO pairs
BIO_eof() was always returning true when using a BIO pair. It should only
be true if the peer BIO is empty and has been shutdown.

RT#1215

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 3105d69535)
2016-05-09 17:06:25 +01:00
Dr. Stephen Henson 9dfd498af8 add documentation
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit b1b3e14fbe)
2016-05-04 12:59:10 +01:00
Matt Caswell 643e8e972e Remove some documentation for functions not in 1.0.x
A few functions in the recently added EVP_EncodeInit docs don't apply to
the 1.0.x branches.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-03 12:53:47 +01:00
Matt Caswell 0b3762a342 Add documentation for EVP_EncodeInit() and similar functions
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-03 11:50:13 +01:00
Daniel Kahn Gillmor a38a159bfc RT4129: BUF_new_mem_buf should take const void *
Signed-off-by: Rich Salz <rsalz@akamai.com>
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit 8ab31975ba)
2016-02-01 08:43:27 -05:00
Richard Levitte 7eb5125125 Document how BIO_get_conn_ip and BIO_get_conn_int_port actually work
No dummy arguments.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-19 22:07:42 +01:00
Matt Caswell ca3658e000 Minor EVP_SignInit_ex doc fix
EVP_SignInit_ex was missing from the NAME section of its man page so
typing "man EVP_SignInit_ex" failed to load the page.

Reviewed-by: Stephen Henson <steve@openssl.org>
(cherry picked from commit 3d866ea67e)
2015-11-04 14:39:16 +00:00
Alessandro Ghedini ec3a7c9b37 Fix typos
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit d900a015b5)
2015-10-23 20:32:58 +02:00
Adam Eijdenberg 8d43c0053b Clarify return values for EVP_DigestVerifyFinal.
Previous language was unclear.  New language isn't pretty but I believe
it is more accurate.

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Ben Laurie <ben@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 8cbb048c3e)
2015-10-22 18:28:38 -04:00
Ismo Puustinen 6f997dc365 GH367: use random data if seed too short.
Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-09-29 12:48:43 -04:00
Emilia Kasper 51ff683c12 Document BUF_strnlen
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 21b0fa9118)
2015-09-22 20:04:36 +02:00