summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-11-03Change EVP_PKEY_CTX_new_provided() to take a library context too.Richard Levitte
With provided algorithms, the library context is ever present, so of course it should be specified alongside the algorithm name and property query string. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10308)
2019-11-03Make EVP_PKEY_CTX initialization more preciseRichard Levitte
There is a vagueness around how the provider data (algorithm name and property query string) is initialized in the presence of an engine. This change modifies this slightly so that the algorithm name for use with providers is never set if the initilization was given an engine. This makes it easier for other functions to simply check ctx->algorithm to see if the context is meant to be used for strictly legacy stuff or not. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10308)
2019-11-03Fix --strict-warnings buildPatrick Steuer
The %zd format corresponds to ssize_t which is used for function to either return a valid size or a negative value to indicate an error. Since size_t is in [-1,SSIZE_MAX] it is not a portable way to represent a pointer diff. For the %td format which corresponds to ptrdiff_t is C11, we chose to cast to long instead as it is already done in other places. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10335)
2019-11-03s390x assembly pack: enable clang buildPatrick Steuer
clang imposes some restrictions on the assembler code that gcc does not. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10330)
2019-11-03doc/man3/OSSL_PARAM.pod: Clarify return_size with integer typesRichard Levitte
Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> (Merged from https://github.com/openssl/openssl/pull/10326)
2019-11-03test/params_api_test.c: Correct the checks of OSSL_PARAM_set_BN()Richard Levitte
Now, the returned size check matches the check made for all other integer types. Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> (Merged from https://github.com/openssl/openssl/pull/10326)
2019-11-03Fix OSSL_PARAM_set_BN() to fill the given buffer correctly.Richard Levitte
OSSL_PARAM_set_BN() filled the buffer from the left with as many bytes as that the BIGNUM takes, regardless of buffer size or native endianness. This was due to BN_bn2nativepad() being given the size of the BIGNUM rather than the size of the buffer (which meant it never had to pad anything). The fix is to given BN_bn2nativepad() the size of the buffer instead. This aligns well with the corresponding _set_ functions for native integer types work. Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> (Merged from https://github.com/openssl/openssl/pull/10326)
2019-11-03test/build.info: add missing inclusion for ssl_ctx_testRichard Levitte
Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> (Merged from https://github.com/openssl/openssl/pull/10334)
2019-11-02VMS: Added new method to gather entropy on VMS, based on SYS$GET_ENTROPY.Richard Levitte
This system services is based on FreeBSD 12's getentropy(), and is therefore treated the same way as getentropy() with regards to amount of entropy bits per data bit. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8926)
2019-11-02Add test cases for min/max protocol APIChristian Heimes
Signed-off-by: Christian Heimes <christian@python.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6553)
2019-11-02Configure: Make --strict-warnings meaningful with MSVC clRichard Levitte
We also add this to our x86_64 builds on appveyor Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10287)
2019-11-02BIO_s_connect: add an error state and use itRichard Levitte
If no connection could be made, addr_iter will eventually end up being NULL, and if the user didn't check the returned error value, the BIO_CONN_S_CONNECT code will be performed again and will crash. So instead, we add a state BIO_CONN_S_CONNECT_ERROR that we enter into when we run out of addresses to try. That state will just simply say "error" back, until the user does something better with the BIO, such as free it or reset it. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7630)
2019-11-02DRBG: add check for XOF so these can be disallowed by the DRBGsPauli
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/10321)
2019-11-02DRBG: weaken the restriction on allowed digests.Pauli
The artificial restriction of digests for the HMAC and HASH DRBGs is lifted. Any fetchable digest is acceptable except XOF ones (such as SHAKE). In FIPS mode, the fetch remains internal to the provider so only a FIPS validated digest will be located. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/10321)
2019-11-01s390x: fix build errorsPatrick Steuer
ecp_s390x_nistp.c and ecx_meth.c need to include s390x_arch.h. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10317)
2019-11-01fix for Missing null check after OPENSSL_zallocjayaram
Fixes #10283 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> (Merged from https://github.com/openssl/openssl/pull/10296)
2019-11-01md4/md5: macros should not include the line following themPatrick Steuer
Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10311)
2019-11-01Fix potential memory leak in dh_ameth.cScott Wilson
Free dukm in error handling of dh_cms_encrypt() Fixes #10294 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> (Merged from https://github.com/openssl/openssl/pull/10310)
2019-10-31Fix L<> entries without sectionsRich Salz
Add sections (almost always "(3)" to L<> references that were missing them. Among other things, this Fixes: #10226 Also remove two references to non-existant manpages that have never existed, and with the 3.0 structure, are unlikely to do so. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10240)
2019-10-31Infrastructure for templated doc in POD filesRich Salz
Use new doc-build capabilities Add -i flag to dofile. Add doc/man1 to SUBDIRS for the new templated doc files Rewrite commit a397aca (merged from PR 10118) to use the doc-template stuff. Put template references in common place Template options and text come at the end of command-specific options: opt_x, opt_trust, opt_r (in that order). Refactor xchain options. Do doc-nits after building generated sources. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10159)
2019-10-31evp_pkey_ctx_free_old_ops(): Make sure to assign NULL to freed pointersRichard Levitte
Otherwise, should this function be called more than once on the same EVP_PKEY_CTX, we get double free issues. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10292)
2019-10-31Fix SYNOPSIS for ASN1_ENUMERATED_get_int64 and ASN1_ENUMERATED_set_int64Jakub Zelenka
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9823)
2019-10-31[crypto/bn] fix a few small timing leaks in BN_lshift1 and BN_rshift1Billy Brumley
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10209)
2019-10-31Fix typo in cipher_chacha20_poly1305_hw.c.Kelvin Lee
CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10275)
2019-10-31Fix find/rm command in Unix clean recipeTanzinul Islam
The `./pyca-cryptography/.travis/downstream.d` subdirectory that causes the `rm` command to fail (albeit harmlessly, but with a warning from `make` nonetheless). >rm -f `find . -name '*.d' \! -name '.*' -print` >rm: cannot remove './pyca-cryptography/.travis/downstream.d': Is a directory >make: [Makefile:1910: clean] Error 1 (ignored) Exclude directories from being matched by the `find` commands. CLA: trivial Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10264)
2019-10-31Don't generate a MAC when using KTLS.John Baldwin
The kernel will generate the MAC when transmitting the frame. Doing so here causes the MAC to be included as part of the plain text that the kernel MACs and encrypts. Note that this path is not taken when using stitched cipher suites. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10045)
2019-10-31Fix BIO_get_ktls_send() and BIO_get_ktls_recv() to work again.John Baldwin
This partially reverts 3119ab3c9e6d211c461a245f3744893e17b6c193. In the case of a simple openssl s_server instance, the bio in s->wbio is a BIO_TYPE_BUFFER BIO, not BIO_TYPE_SOCKET. This caused all of the checks to fail breaking KTLS. The default return value of control methods I have looked it is zero for unknown control requests, so invoking the control requests should be returning 0 for non-socket BIOs already. This does still map the requests to 0 at compile time for the non-KTLS case so that the compiler can optimize the checks away entirely. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10045)
2019-10-31Simplify NO_KTLS path in SSL_sendfile.John Baldwin
Avoid tripping over errno values from previous system calls in the thread and just hardcode the specific error. BIO_get_ktls_send() should never be true in the NO_KTLS path, so the #ifdef could be moved even higher up to assume that error path in the NO_KTLS case instead. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10045)
2019-10-31Bypass multiblock and send individual records when using KTLS.Andrew Gallatin
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10045)
2019-10-31Add support for in-kernel TLS (KTLS) on FreeBSD.Andrew Gallatin
- Check for the <sys/ktls.h> header to determine if KTLS support is available. - Populate a tls_enable structure with session key material for supported algorithms. At present, AES-GCM128/256 and AES-CBC128/256 with SHA1 and SHA2-256 HMACs are supported. For AES-CBC, only MtE is supported. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10045)
2019-10-31crypto/evp/evp_fetch.c: Make it more prominent that these functions are EVPRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10257)
2019-10-31KDF: use string names not macros to align with other algorithms.Pauli
Only the KDF and PRF algorithms used the macros for their names, all other algorithms used a string name directly. This brings the KDFs and PRFs into line with the rest. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10293)
2019-10-30Add a GitHub issue template for documentation issuesDr. Matthias St. Pierre
This template automatically adds the [issue: documentation] label. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10051)
2019-10-30Add a GitHub issue template for questionsDr. Matthias St. Pierre
Actually, we would rather see general questions posted to the openssl-users mailing list. But habits have changed and more and more users ask questions on GitHub. Many of them are currently tagged as bug reports or feature requests, because there is no appropriate template for questions. This commit adds the missing template. This template automatically adds the [issue: question] label. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10051)
2019-10-30Fix undefined array OPENSSL_ia32cap_P.Kelvin Lee
CLA: trivial Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> (Merged from https://github.com/openssl/openssl/pull/10274)
2019-10-30apps/dgst.c: allocate a new signature bufferPavel Karagodin
... if the fixed-size buffer is too small. Fixes #9732 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com> (Merged from https://github.com/openssl/openssl/pull/10276)
2019-10-29chunk 5 of CMP contribution to OpenSSLDr. David von Oheimb
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10036)
2019-10-28Fix an s_server arbitrary file read issue on WindowsMatt Caswell
Running s_server in WWW mode on Windows can allow a client to read files outside the s_server directory by including backslashes in the name, e.g. GET /..\myfile.txt HTTP/1.0 There exists a check for this for Unix paths but it is not sufficient for Windows. Since s_server is a test tool no CVE is assigned. Thanks to Jobert Abma for reporting this. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10215)
2019-10-28Fix a copy&paste error in the TLSv1.3 server side PSK documentationMatt Caswell
The introductory paragraph for the TLSv1.3 server side PSK documentation is a copy & paste of the client side documentation which has not been updated with the server side equivalent information. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10245)
2019-10-28Clarify the description of the NULL argument in SSL_set1_host().Pauli
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/10253)
2019-10-28Allow EVP_PKEY_get0_RSA for RSA-PSS keysTobias Nießen
RSA-PSS keys use the same internal structure as RSA keys but do not allow accessing it through EVP_PKEY_get0_RSA. This commit changes that behavior. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10217)
2019-10-28Cleanup hardcoded cipher suite codepoints in s_serverJohannes Bauer
The hardcoded code points for TLSv1.3 cipher suites are used in the TLS PSK server callback. However, they seem to have been refactored a while ago to use tls13_aes128gcmsha256_id, so these defines are not necessary within the s_server code anymore. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10243)
2019-10-26github: switch issue templates to new labelsDr. Matthias St. Pierre
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10266)
2019-10-25Strip BOM on loading PEM filesDmitry Belyavskiy
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Viktor Dukhovni <openssl-users@dukhovni.org>
2019-10-24Fix broken links, mainly typo'sRich Salz
Also tweak find-doc-nits while fixing a bug (don't need .in files) Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10239)
2019-10-2420-test_enc_more.t: Replace deprecated -ciphers option with -listTomas Mraz
[extended tests] Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/10242)
2019-10-23Document "get/set-app-data" macros.Rich Salz
Documenting the macros removes 14 undocumented items. Merged three separate manpages into one. Rename the DRBG CRYPTO_EX define into RAND_DRBG, but keep the old one for API compatibility. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10216)
2019-10-23Enable runtime testing of no-deprecated builds in TravisCesar Pereida Garcia
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10232)
2019-10-23Update control logic for BN_gcdCesar Pereida Garcia
PR https://github.com/openssl/openssl/pull/10122 introduced changes to the BN_gcd function and the control logic inside it accessed `g->d[0]` irrespective of `g->top`. When BN_add is called, in case the result is zero, `BN_zero` is called. The latter behaves differently depending on the API compatibility level flag: normally `g->d[0]` is cleared but in `no-deprecated` builds only `g->top` is set to zero. This commit uses bitwise logic to ensure that `g` is treated as zero if `g->top` is zero, irrespective of `g->d[0]`. Co-authored-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10232)
2019-10-23Document the -inform, etc., in openssl.podRich Salz
Add P12 format description. Remove PEM NOTES sections; it's in openssl.pod Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10142)