summaryrefslogtreecommitdiffstats
path: root/crypto
AgeCommit message (Collapse)Author
2017-07-07Add sha/asm/keccak1600-avx512.pl.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/3861)
2017-07-07Address potential buffer overflows.Pauli
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3878)
2017-07-07change return (x) to return xPauli
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3878)
2017-07-06Remove some now-unneeded VMS controlsRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3875)
2017-07-07BIO range checking.Pauli
Add length limits to avoid problems with sprintf, strcpy and strcat. This replaces recently removed code but also guards some previously missing function calls (for DOS & Windows). Reworked the BIO_dump_indent_cb code to reduce temporary storage. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3870)
2017-07-06Cleanup RAND_load_file,RAND_write_fileRich Salz
Document an internal assumption that these are only for use with files, and return an error if not. That made the code much simpler. Leave it as writing 1024 bytes, even though we don't need more than 256 from a security perspective. But the amount isn't specified, now, so we can change it later if we want. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3864)
2017-07-06Memory bounds checking in asn1 code.Pauli
Check that sprint, strcpy don't overflow. Avoid some strlen operations when the previous sprintf return value can be used. Also fix the undefined behaviour `*(long *)x = y` when x isn't a long or character pointer. ISO/IEC 9899:1999 6.5/7 for the details. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3869)
2017-07-05Add two trivial fixes from old commitsRich Salz
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3865)
2017-07-05Fix crashRich Salz
[extended tests] Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3700)
2017-07-05Undo commit cd359b2Rich Salz
Original text: Clarify use of |$end0| in stitched x86-64 AES-GCM code. There was some uncertainty about what the code is doing with |$end0| and whether it was necessary for |$len| to be a multiple of 16 or 96. Hopefully these added comments make it clear that the code is correct except for the caveat regarding low memory addresses. Change-Id: Iea546a59dc7aeb400f50ac5d2d7b9cb88ace9027 Reviewed-on: https://boringssl-review.googlesource.com/7194 Reviewed-by: Adam Langley <agl@google.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3700)
2017-07-05Undo commit 40720ceRich Salz
Comment in the commit: /* Ignore NULLs, thanks to Bob Beck <beck@obtuse.com> */ Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3700)
2017-07-05Undo commit de02ec2Rich Salz
Original text: Check if a random "file" is really a device file, and treat it specially if it is. Add a few OpenBSD-specific cases. This is part of a large change submitted by Markus Friedl <markus@openbsd.or Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3700)
2017-07-05Undo commit 0755217Rich Salz
Original text: Fix Perl problems on sparc64. This is part of a large change submitted by Markus Friedl <markus@openbsd.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3700)
2017-07-05STORE 'file' scheme loader: fix try_decode_params() to check ambiguityRichard Levitte
The way try_decode_params works in raw more, it would take the first ASN1 that could decode and return a STORE_INFO with the resulting EVP_PKEY. This change has it go through all the matching ASN1 methods and properly check if there's more than one match, i.e. an ambiguity. Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/3863)
2017-07-05Fix small UI issuesRichard Levitte
- in EVP_read_pw_string_min(), the return value from UI_add_* wasn't properly checked - in UI_process(), |state| was never made NULL, which means an error when closing the session wouldn't be accurately reported. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/3849)
2017-07-05Avoid possible memleak in X509_policy_check()Richard Levitte
When tree_calculate_user_set() fails, a jump to error failed to deallocate a possibly allocated |auth_nodes|. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/3850)
2017-07-05Undo commit d420ac2Rich Salz
[extended tests] Original text: Use BUF_strlcpy() instead of strcpy(). Use BUF_strlcat() instead of strcat(). Use BIO_snprintf() instead of sprintf(). In some cases, keep better track of buffer lengths. This is part of a large change submitted by Markus Friedl <markus@openbsd.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/3701)
2017-07-04STORE: fix possible memory leakRichard Levitte
If scheme is NULL, the allocated res is leaked Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3841)
2017-07-04Use the return value from write(2)Pauli
This prevents a warning when building with crypto-mdebug. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3836)
2017-07-03BN_pseudo_rand is really BN_randRich Salz
And BN_pseudo_rand_range is really BN_rand_range. Document that we might deprecate those functions. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3743)
2017-07-03'make update' after objects/objects.txt update.Andy Polyakov
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/3643)
2017-07-03objects/objects.txt: add SHA3 OIDs.Andy Polyakov
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/3643)
2017-07-03sha/keccak1600.c: internalize KeccakF1600 and simplify SHA3_absorb.Andy Polyakov
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
2017-07-03sha/asm/keccak1600-x86_64.pl: close gap with Keccak Code Package.Andy Polyakov
[Also typo and readability fixes. Ryzen result is added.] Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
2017-07-03sha/asm/keccak1600-s390x.pl: typo and readability, minor size optimization.Andy Polyakov
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
2017-07-03x86_64 assembly pack: fill some blanks in Ryzen results.Andy Polyakov
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
2017-07-03Remove the possibility to disable the UI module entirelyRichard Levitte
Instead, make it possible to disable the console reader that's part of the UI module. This makes it possible to use the UI API and other UI methods in environments where the console reader isn't useful. To disable the console reader, configure with 'no-ui-console' / 'disable-ui-console'. 'no-ui' / 'disable-ui' is now an alias for 'no-ui-console' / 'disable-ui-console'. Fixes #3806 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3820)
2017-07-03Make sure OSSL_STORE_load() isn't caught in an endless loopRichard Levitte
The post process callback might potentially say "no" to everything (by constantly returning NULL) and thereby cause an endless loop. Ensure that we stop all processing when "eof" is reached. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/3823)
2017-07-03Fix copyright date for the ARIA evp file.Pauli
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3831)
2017-07-02STORE 'file' scheme loader: DNS name in URI is case insensitiveRichard Levitte
... so compare accordingly with "//localhost" Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/3827)
2017-06-30Cleanup some copyright stuffRich Salz
Remove some incorrect copyright references. Move copyright to standard place Add OpenSSL copyright where missing. Remove copyrighted file that we don't use any more Remove Itanium assembler for RC4 and MD5 (assembler versions of old and weak algorithms for an old chip) Standardize apps/rehash copyright comment; approved by Timo Put dual-copyright notice on mkcert Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3691)
2017-06-30Fix build with no-threads no-ecDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3817)
2017-06-30Fix atfork flag. Avoid double-negatives :)Rich Salz
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/3815)
2017-06-30Merge Intel copyright notice into standardRich Salz
This is done with the kind permission of Intel. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3813)
2017-06-29Add fork handlers, based on pthread_atforkRich Salz
Only for Unix platforms Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3754)
2017-06-29STORE: Make sure the loader to be registered is completeRichard Levitte
Most of the loader function pointers are crucial, they must be defined unconditionally. Therefore, let's make sure OSSL_STORE_register_loader refuses to register incomplete loaders Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/3805)
2017-06-29STORE: simplify store_loader_cmp()Richard Levitte
We have already made sure that the loader scheme isn't NULL, so checking if they are NULL or not when comparing registered loaders is redundant. We still soft assert it, just to be entirely sure. Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/3805)
2017-06-29Add sha/asm/keccak1600-s390x.pl.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-06-29sha/asm/keccak1600-x86_64.pl: add CFI directives.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-06-29sha/asm/keccak1600-x86_64.pl: optimize by re-ordering instructions.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-06-29sha/asm/keccak1600-x86_64.pl: remove redundant moves.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-06-29Add sha/asm/keccak1600-x86_64.pl.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-06-29Add internal functions to fetch PEM data from an opened BIORichard Levitte
store_attach_pem_bio() creates a STORE_CTX with the 'file' scheme loader backend in PEM reading mode on an already opened BIO. store_detach_pem_bio() detaches the STORE_CTX from the BIO and destroys it (without destroying the BIO). These two functions can be used in place of STORE_open() and STORE_close(), and are present as internal support for other OpenSSL functions. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2745)
2017-06-29Make it possible to tell the file loader to use secure memoryRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3483)
2017-06-29STORE 'file' scheme loader: refactor the treatment of matchesRichard Levitte
Sometimes, 'file_load' couldn't really distinguish if a file handler matched the data and produced an error or if it didn't match the data at all. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3542)
2017-06-29STORE: add ENGINE information to loadersRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3542)
2017-06-29STORE 'file' scheme loader: Add directory listing capabilityRichard Levitte
This has it recognised when the given path is a directory. In that case, the file loader will give back a series of names, all as URI formatted as possible given the incoming URI. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3542)
2017-06-29STORE 'file' scheme loader: Add handler for encrypted PKCS#8 dataRichard Levitte
Add a separate handler for encrypted PKCS#8 data. This uses the new restart functionality. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3542)
2017-06-29STORE 'file' scheme loader: refactor file_load to support decoding restartRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3542)
2017-06-29STORE: Add a OSSL_STORE_INFO type to help support file handler restartsRichard Levitte
Some containers might very simply decode into something new that deserves to be considered as new (embedded) data. With the help of a special OSSL_STORE_INFO type, make that new data available to the loader functions so they can start over. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3542)