summaryrefslogtreecommitdiffstats
path: root/apps
AgeCommit message (Collapse)Author
2017-03-01Check that async_jobs is not negative and not too high.Bernd Edlinger
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2693) (cherry picked from commit f8aa15728ba960137faf77b298fa60c1e63dc50f)
2017-02-23Check for the presence of _WIN32 rather than its value.Richard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2727) (cherry picked from commit 46958a043d51633ed36bcfb13ff048a3381366a6)
2017-02-23In apps/rehash.c, decorate the inclusion of internal/o_dir.h for VMSRichard Levitte
The library files are built with symbol names as is, while the application is built with the default uppercase-all-symbols mode. That's fine for public APIs, because we have __DECC_INCLUDE_PROLOGUE.H and __DECC_INCLUDE_EPILOGUE.H automatically telling the compiler how to treat the public header files. However, we don't have the same setup for internal library APIs, since they are usually only used by the libraries. Because apps/rehash.c uses a library internal header file, we have to surround that inclusion with the same kind of pragmas found in __DECC_INCLUDE_PROLOGUE.H and __DECC_INCLUDE_EPILOGUE.H, or we get unresolved symbols when building no-shared. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2725) (cherry picked from commit 2ac915f16218982f48dbc799b8308a07441d2e35)
2017-02-23On VMS, massage the fetch file names to remove the generation numberRichard Levitte
The generation number is ';nnn' at the end of the file name fetched with readdir(). Because rehash checks for specific extensions and doesn't expect an additional generation number, the easiest is to massage the received file name early by simply removing the generation number. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2717) (cherry picked from commit 39aceac320a1561d50c7d71ac2560aec7ab8eddb)
2017-02-23Let the output from 'openssl enc -ciphers' go to stdoutRichard Levitte
Also, don't exit with an error code Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2716) (cherry picked from commit 341de5f1997d21b60cee69be656f1ae709bccdac)
2017-02-22Make "openssl rehash" work on VMS 8.3 and upRichard Levitte
A spelling error prevented it from building correctly. Furthermore, we need to be more careful when to add a / at the end of the dirname and when not. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2706) (cherry picked from commit 5c80e2af3a7d8aa5129a1668c286c1464983e1ac)
2017-02-21Fix some more memory leaks with TXT_DB_insert.Bernd Edlinger
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2684) (cherry picked from commit 0fbaef9e64fa10446aff805791befaa2b967e322)
2017-02-21Fix a few memleaks in TXT_DB.Bernd Edlinger
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2684) (cherry picked from commit 9ad52c562a93c9a57ae3024e54c575430753244c)
2017-02-16Change req_check_len error messagelrns
it also accepts 20 bytes, but states 'less than' in the error message Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2648) (cherry picked from commit 0cb8c9d85e9d5690670d6f1f02e8ccc756520210)
2017-02-14Make -xcert work again.Dr. Stephen Henson
When a certificate is prepended update the list pointer. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2628) (cherry picked from commit 52f4840cb237cc37cad5eac8328828cf3d3e1049)
2017-02-14mem leak on error path and error propagation fixYuchi
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2559) (cherry picked from commit e0670973d5c0b837eb5a9f1670e47107f466fbc7)
2017-02-07Remove unused variablePauli
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2566) (cherry picked from commit a19a6c8179faa3da0dedaaf2effae385cf7dd65d)
2017-02-06Fix parsing of serial# in reqRich Salz
Reported by Jakub Wilk. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2556) (cherry picked from commit be4c82aa767998ce2a5717fc895482052373f1b1)
2017-01-25s_client: Better response success check for CONNECTRichard Levitte
Instead of looking for "200" and "established" (and failing all other 2xx responses or "Established"), let's look for a line that's not a header (i.e. doesn't contain a ':') and where the first space is followed by a '2'. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1664) (cherry picked from commit ec2a0e60652c0e61e90dde367756c5d92cd882d3)
2017-01-24Cleanup EVP_CIPH/EP_CTRL duplicate definesTodd Short
Remove duplicate defines from EVP source files. Most of them were in evp.h, which is always included. Add new ones evp_int.h EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK is now always defined in evp.h, so remove conditionals on it Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2201) (cherry picked from commit 9d6fcd4295fef7ebc4232aab85718a99d36cc50a)
2017-01-23Fix use before assignmentFdaSilvaYY
it was getting the SerialNumber of a previous cert. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2272) (cherry picked from commit 0db1fb3fc13c4b1a2b916efbb374f40579b1398f)
2017-01-17Fix list -disabled for blake2 algEasySec
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2241) (cherry picked from commit 487d3a726a1970e84853434561d88cb4ac212d15)
2016-12-08Make sure that password_callback exercises UIRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2040) (cherry picked from commit 57c0f378b8fdbdc55dba783e9b744b8ed2132819)
2016-11-17Support MSBLOB format if RC4 is disabledDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit b6c6898234a12b9c6cdaa8f16fb9156097649ad7)
2016-11-17Make MSBLOB format work with dsa utility.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit b3795987477f1d478fd8bd20efb812e71b190e8b)
2016-11-12Update s_client and s_server documentation about some missing argumentsEasySec
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1837) (cherry picked from commit a22f9c84b468eed83c651cb5f2c68c7ad4103ffd)
2016-10-28Fix a double free in ca command lineMatt Caswell
Providing a spkac file with no default section causes a double free. Thanks to Brian Carpenter for reporting this issue. Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit 229bd12487f8576fc088dc4f641950ac33c62033)
2016-10-20apps: remove some #ifndef clutterRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1643) (cherry picked from commit b85bf6395251dc28457b95de586a2f0a5faae4af)
2016-10-20apps: instead of varying implementation, make setup_engine a function alwaysRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1643) (cherry picked from commit 907c6c86331243897b80f37895a14de1e7957541)
2016-10-20If an engine comes up explicitely, it must also come down explicitelyRichard Levitte
In apps/apps.c, one can set up an engine with setup_engine(). However, we freed the structural reference immediately, which means that for engines that don't already have a structural reference somewhere else (because it's a built in engine), we end up returning an invalid reference. Instead, the function release_engine() is added, and called at the end of the routines that call setup_engine(). Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1643) (cherry picked from commit dd1abd4462e4e4fa84b8f8de2ec70375f9b0e191)
2016-10-01fix memory leakDr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit eb67172ae53da63a6ff5189dfde2af8f98309ce3)
2016-09-29Restore '-keyform engine' support for s_clientDavid Woodhouse
This used to work in 1.0.2 but disappeared when the argument parsing was revamped. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1639) (cherry picked from commit a6972f346248fbc37e42056bb943fae0896a2967)
2016-09-28apps/apps.c: initialize and de-initialize engine around key loadingRichard Levitte
Before loading a key from an engine, it may need to be initialized. When done loading the key, we must de-initialize the engine. (if the engine is already initialized somehow, only the reference counter will be incremented then decremented) Reviewed-by: Stephen Henson <steve@openssl.org> (cherry picked from commit 49e476a5382602d0bad1139d6f1f66ddbc7959d6)
2016-09-20RT3669: dgst can only sign/verify one file.Rich Salz
Check arg count and print an error message. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 13a461831ab85ec9f55806ebf2df5ffb7f3f357a)
2016-09-20apps/apps.c: include sys/socket.h to declare recv()Richard Levitte
Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit a19228b7f4fc6fcb49713455b3caedbc24fb0b01)
2016-09-19Remove an option related to a deprecated flagFdaSilvaYY
CMS_NOOLDMIMETYPE and PKCS7_NOOLDMIMETYPE are unused in pkcs7/cms code. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1585) (cherry picked from commit 28aef3d9558dc2e11ba56576b3a4d3faaef8a9d3)
2016-09-19Fix various missing option help messages ...FdaSilvaYY
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1585) (cherry picked from commit 12d56b2992ebd61e1b30c99ca1898dde42345cf7)
2016-09-19Fix no-ocspRichard Levitte
Some compilers complain about unused variables, and some tests do not run well without OCSP. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 057c676afb2a69b7d2bb9cf6e895e720a2a62b78)
2016-09-15Refactor to avoid unnecessary preprocessor logicRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 51e5133d551b4c132f72fc2ff5bbe076f5a3e052)
2016-09-15Reformat to fit OpenSSL source code standardsRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit c7bdb6a31ff0fcae66b451d3f80a684ad77f4966)
2016-09-15Add copyright and license on apps/vms_term_sock.[ch]Richard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 0d0723e813870c2e7a009ec47e933668a1548531)
2016-09-15VSI submission: redirect terminal input through socketRichard Levitte
This is needed, because on VMS, select() can only be used on sockets. being able to use select() on all kinds of file descriptors is unique to Unix. So, the solution for VMS is to create a layer that translates input from standard input to socket communication. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 0d3b65832c6fa94c1d1cfa2f99335f323e3227c1)
2016-09-14Add -h and -help for c_rehash script and appRich Salz
Resolves GH1515 and GH1509. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 7d959c358a09244bcaea601121b276529ff437ce)
2016-09-14Fix 'openssl passwd' with arguments -1 or -apr1Richard Levitte
RT#4674 Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 9f9f962d96425ed741569460791eee0280fcf942)
2016-09-13s_client: avoid warning on Windows/MS-DOS systemsViktor Szakats
it appears when using gcc/mingw: ``` apps/s_client.c:815:9: warning: variable 'at_eof' set but not used [-Wunused-but-set-variable] int at_eof = 0; ^~~~~~ ``` Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1512) (cherry picked from commit d485640b8083aea895ecf31b4ea6a338ee561b67)
2016-08-25Windows: UTF-8 opt-in for command-line arguments and console input.Andy Polyakov
User can make Windows openssl.exe to treat command-line arguments and console input as UTF-8 By setting OPENSSL_WIN32_UTF8 environment variable (to any value). This is likely to be required for data interchangeability with other OSes and PKCS#12 containers generated with Windows CryptoAPI. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-08-25Support broken PKCS#12 key generation.Dr. Stephen Henson
OpenSSL versions before 1.1.0 didn't convert non-ASCII UTF8 PKCS#12 passwords to Unicode correctly. To correctly decrypt older files, if MAC verification fails with the supplied password attempt to use the broken format which is compatible with earlier versions of OpenSSL. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-08-24Clarify the error messages in 08f6ae5b28Matt Caswell
Ensure it is clear to the user why there has been an error. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-24Trust RSA_check_key() to return correct valuesRichard Levitte
In apps/rsa.c, we were second guessing RSA_check_key() to leave error codes lying around without returning -1 properly. However, this also catches other errors that are lying around and that we should not care about. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-24Fix some resource leaks in the appsMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-08-22Closing output file from inside the loop who open itFdaSilvaYY
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1471
2016-08-22Fix loopargs_t object duplication into ASYNC contextFdaSilvaYY
Code was relying on an implicit data-sharing through duplication of loopargs_t pointer-members made by ASYNC_start_job(). Now share structure address instead of structure content. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-22Avoid more compiler warnings for use of uninitialised variablesRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-08-22Make 'openssl req -x509' more equivalent to 'openssl req -new'Richard Levitte
The following would fail, or rather, freeze: openssl genrsa -out rsa2048.pem 2048 openssl req -x509 -key rsa2048.pem -keyform PEM -out cert.pem In that case, the second command wants to read a certificate request from stdin, because -x509 wasn't fully flagged as being for creating something new. This changes makes it fully flagged. RT#4655 Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-08-21Add X509_getm_notBefore, X509_getm_notAfterDr. Stephen Henson
Add mutable versions of X509_get0_notBefore and X509_get0_notAfter. Rename X509_SIG_get0_mutable to X509_SIG_getm. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>