summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ui (follow)
Commit message (Collapse)AuthorAgeFilesLines
* KNF for a few comments and indent a labeltb2020-09-251-8/+12
|
* Remove some dangling elses for consistency with the rest of the filetb2020-09-251-25/+19
|
* Simplify UI_new_method()tb2020-09-251-10/+4
| | | | | Use calloc() instead of malloc() and setting all members manually to 0. Avoid unnecessary else branch.
* Move variable declaration to the top of UI_set_result and ditchtb2020-09-251-19/+16
| | | | | | a pointless local scope. suggested by jsing
* The default branch of a switch somehow got moved inside of a pointlesstb2020-09-251-3/+3
| | | | | | | | local scope of a case branch. Move it into the proper location. No binary change on amd64. "sure" jsing
* Simplify call to ERR_print_errors_cb()tb2020-09-251-5/+4
| | | | | | | | | There is no reason for print_error()'s third argument to be a UI *. It may just as well be a void * to match what ERR_print_errors_cb() expects. This avoids casting the function pointer. Also, there's no need for a (void *) cast. ok jsing
* Error out if ok_chars and cancel_chars overlaptb2020-09-241-2/+4
| | | | | | | It is a bit silly to push an error on the stack without erroring out, so error out if the ok_chars and cancel_chars overlap. ok jsing
* Fix a number of leaks in the UI_dup_* functionstb2020-09-241-143/+99
| | | | | | | | | | | | | | | | | | | | | | | | | If any of general_allocate_{prompt,string,boolean}() fail, the UI_dup_* functions may leak the strings they strduped beforehand. Instead, use strdup inside these functions, so we can free as necessary. This makes the UI_add_* and UI_dup_* simple wrappers around general_allocate_{string,boolean}() that differ only in passing a Boolean that indicates whether or not to use strdup. Make a general cleanup pass over these functions, simplify the logic and make it overall a bit easier to follow. While there, use strcspn() instead of a handrolled variant. The only changes in behavior are that ERR_R_MALLOC_FAILURE is now pushed onto the stack a bit more often and that UI_dup_input_string() now returns -1 on failure to dup prompt like all the other UI_dup_* functions. This is not a problem since the manual already documents that errors are signaled with <= 0. The only consumer of this function according to Debian's codesearch is libp11, I sent them a PR to fix their (already broken) error handling. Addresses about 10 errors thrown by the LLVM static analyzer in ui/. ok jsing
* Push ERR_R_MALLOC_FAILURE onto the error stacktb2020-09-241-3/+3
| | | | | | | If sk_UI_STRING_new_null() fails, this must be due to a memory error, so signal this to the user. ok jsing
* Make free_strings() NULL safetb2020-09-241-1/+3
| | | | ok jsing
* KNF and grammar tweaks for comments; wrap a few overlong prototypes.tb2020-09-241-163/+188
|
* Add a const qualifier to the argument of UI_method_get_closer(),tb2018-06-022-14/+14
| | | | | | | | | UI_method_get_flusher(), UI_method_get_opener(), UI_method_get_prompt_constructor(), UI_method_get_reader(), and UI_method_get_writer(). tested in a bulk build by sthen ok jsing
* UI_METHOD *UI_create_method(const char *name).tb2018-05-192-4/+4
| | | | | | ^^^^^ tested in a bulk build by sthen ok jsing
* Send the function codes from the error functions to the bit bucket,beck2017-01-292-42/+25
| | | | | | as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
* Explicitly export a list of symbols from libcrypto.jsing2016-12-211-1/+5
| | | | | | | | | | | | | | | | Move the "internal" BN functions from bn.h to bn_lcl.h and stop exporting the bn_* symbols. These are documented as only being intended for internal use, so why they were placed in a public header is beyond me... This hides 363 previously exported symbols, most of which exist in headers that are not installed and were never intended to be public. This also removes a few crusty old things that should have died long ago (like _ossl_old_des_read_pw). But don't worry... there are still 3451 symbols exported from the library. With input and testing from inoguchi@. ok beck@ inoguchi@
* don't go into an unbreakable infinite loop during operations suchtedu2016-04-281-1/+2
| | | | | as reading passwords. allow ^C to break. the pain was mine, the fix is miod's.
* Correct spelling of OPENSSL_cleanse.jsing2015-09-102-4/+4
| | | | ok miod@
* After reading a password with terminal echo off, restore the terminal toguenther2015-07-161-6/+5
| | | | | | | its original state instead of blindly turning echo on. problem reported on the openssl-dev list by William Freeman ok miod@ beck@
* Remove more IMPLEMENT_STACK_OF noops that have been hiding for the lastjsing2015-02-101-2/+2
| | | | 15 years.
* Use string literals in printf style calls so gcc's -Wformat works.doug2014-10-031-6/+10
| | | | ok tedu@, miod@
* Kill a bunch more BUF_strdup's - these are converted to have a check forbeck2014-07-221-3/+3
| | | | | NULL before an intrinsic strdup. ok miod@
* The bell tolls for BUF_strdup - Start the migration to usingbeck2014-07-131-9/+9
| | | | | | intrinsics. This is the easy ones, a few left to check one at a time. ok miod@ deraadt@
* remove silly castderaadt2014-07-131-2/+2
|
* adapt addapt spelling to adapt; request from miodderaadt2014-07-111-3/+3
|
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-112-12/+8
| | | | | | | | Remove the openssl public includes from cryptlib.h and add a small number of includes into the source files that actually need them. While here, also sort/group/tidy the includes. ok beck@ miod@
* Explicitly include <openssl/opensslconf.h> in every file that referencesjsing2014-07-102-2/+7
| | | | | | | | | an OPENSSL_NO_* define. This avoids relying on something else pulling it in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is never going to do anything, since OPENSSL_NO_XYZ will never defined, due to the fact that opensslconf.h has not been included. This also includes some miscellaneous sorting/tidying of headers.
* tags as requested by miod and teduderaadt2014-06-127-7/+8
|
* c-file-style hints, begone; ok beckderaadt2014-06-116-6/+6
|
* malloc() result does not need a cast.deraadt2014-06-071-2/+2
| | | | ok miod
* calloc instead of malloc/memset. from Benjamin Baiertedu2014-05-251-4/+3
|
* Almost nothing actually needs to include <openssl/e_os2.h>, however byjsing2014-05-242-2/+5
| | | | | | | including it they get <openssl/opensslconf.h>. So instead of pulling in <openssl/e_os2.h>, just pull in <openssl/opensslconf.h>. "go ahead" miod@
* if (x) free(x) -> free(x); semantic patch generated with coccinelle, carefullymiod2014-05-221-8/+4
| | | | eyeballed before applying. Contributed by Cyril Roelandt on tech@
* Use C99 initializers for the various FOO_METHOD structs. More readable, andmiod2014-04-271-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | avoid unreadable/unmaintainable constructs like that: const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = { EVP_PKEY_CMAC, EVP_PKEY_CMAC, 0, "CMAC", "OpenSSL CMAC method", 0,0,0,0, 0,0,0, cmac_size, 0, 0,0,0,0,0,0,0, cmac_key_free, 0, 0,0 }; ok matthew@ deraadt@
* We do not need a separate file for two compatibility wrapper functions.jsing2014-04-272-69/+18
| | | | ok miod@
* Replace all use of ERR_add_error_data with ERR_asprintf_error_data.beck2014-04-261-24/+19
| | | | | | | | This avoids a lot of ugly gymnastics to do snprintfs before sending the bag of strings to ERR, and eliminates at least one place in dso_dlfctn.c where it was being called with the incorrect number of arguments and using random things off the stack as addresses of strings. ok krw@, jsing@
* Clean up the remaining TTY related remnants.jsing2014-04-251-41/+8
| | | | ok miod@
* Use const char *.jsing2014-04-251-1/+1
| | | | Suggested by miod@
* Remove some malloc/strlcpy/strlcat horror. Just use asprintf and avoid anjsing2014-04-241-25/+12
| | | | | | unchecked malloc at the same time. ok beck@
* You want signals?!? I'll give you signals!!! Oh, and we have termios asjsing2014-04-241-36/+0
| | | | | | well... ok beck@
* More KNF.jsing2014-04-242-37/+37
|
* Restore beck's rev 1.8: snprintf() was reviewed.guenther2014-04-201-2/+2
|
* We'll interpret a (void) cast on snprintf() to mean it's been verified thatguenther2014-04-191-2/+2
| | | | | | truncation is either desirable, not an issue, or is detected and handled later ok deraadt@
* use intrinsic strlcpy and strlcat everywhere so we only have one set ofbeck2014-04-191-6/+6
| | | | | | funcitons to check for incorrect use. keep BUF_strlcpy and BUF_strlcat for API comptibility only. ok tedu@
* More KNF.jsing2014-04-188-203/+195
|
* stab at indentationtedu2014-04-175-737/+725
|
* Change library to use intrinsic memory allocation functions instead ofbeck2014-04-173-18/+18
| | | | | | | | OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
* whack the ifdef pinata:tedu2014-04-161-260/+5
| | | | | | | | | | | | | | | | | | OPENSSL_SYSNAME_VXWORKS OPENSSL_SYS_VMS OPENSSL_SYS_MSDOS OPENSSL_UNISTD OPENSSL_SYS_WIN16 WIN_CONSOLE_BUG OPENSSL_SYS_WINCE SGTTY OPENSSL_SYS_MACINTOSH_CLASSIC MAC_OS_GUSI_SOURCE OPENSSL_SYS_NETWARE OPENSSL_SYS_SUNOS __DJGPP__ OPENSSL_SYS_BEOS OPENSSL_SYS_WIN32
* we don't use these files for buildingtedu2014-04-151-79/+0
|
* Part 1 of eliminating BIO_snprintf(). This fixes mechanical conversionsbeck2014-04-151-2/+2
| | | | | where the return value is ignored changing to (void) snprintf. ok deraadt@
* remove auto-generated dependencies from the old unused build system, soderaadt2014-04-141-32/+0
| | | | | that it is easier to find code pieces. They are getting in the way. ok miod