summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ui/ui_lib.c (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
* Add a const qualifier to the argument of UI_method_get_closer(),tb2018-06-021-7/+7
| | | | | | | | | 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-191-2/+2
| | | | | | ^^^^^ tested in a bulk build by sthen ok jsing
* Send the function codes from the error functions to the bit bucket,beck2017-01-291-29/+23
| | | | | | as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ 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.
* 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@
* 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-111-4/+3
| | | | | | | | 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@
* tags as requested by miod and teduderaadt2014-06-121-1/+1
|
* c-file-style hints, begone; ok beckderaadt2014-06-111-1/+1
|
* 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-241-1/+4
| | | | | | | 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@
* 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@
* 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@
* More KNF.jsing2014-04-241-35/+35
|
* 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-181-112/+115
|
* stab at indentationtedu2014-04-171-524/+498
|
* Change library to use intrinsic memory allocation functions instead ofbeck2014-04-171-16/+16
| | | | | | | | OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
* 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@
* resolve conflicts, fix local changesdjm2010-10-011-0/+19
|
* resolve conflictsdjm2009-04-061-0/+1
|
* resolve conflictsdjm2008-09-061-3/+5
|
* merge 0.9.7dmarkus2004-04-081-7/+7
|
* merge 0.9.7b with local changes; crank majors for libssl/libcryptomarkus2003-05-121-4/+6
|
* Less strcpy/strcat/sprintf. tdeval@ ok.ho2003-03-161-6/+7
|
* OpenSSL 0.9.7 stable 2002 05 08 mergebeck2002-05-151-0/+899