summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pem/pvkfmt.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Clean up pvkfmt.cinoguchi2019-07-081-63/+66
| | | | | | | | | | | - Replace EVP_CIPHER_CTX_init with EVP_CIPHER_CTX_new and handle return value - Replace EVP_CIPHER_CTX_cleanup with EVP_CIPHER_CTX_free - Change two 'return -1;' to 'goto err;' for avoiding leak - Remove the case if enclevel == 0 - Change enclevel checking to make more consistent - Change all goto label to 'err' and insert space before goto label ok and advise from tb@
* Fix pvk format processing in libcryptoinoguchi2019-07-071-11/+11
| | | | | | | | - Return the valid pointer in i2b_PVK() - Use EVP_Decrypt* instead of EVP_Encrypt* - Fix error handling after BIO_write() in i2b_PVK_bio() ok tb@
* Fix memory leak in i2b_PVK in error handling.bcook2018-08-051-14/+10
| | | | | | | Simplify parameter checks since this is only called from one place. Found by Coverity, CID 183502. ok beck@
* use freezero() instead of memset/explicit_bzero + free. Substantiallyderaadt2017-05-021-5/+2
| | | | | | | | | | reduces conditional logic (-218, +82). MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH cache alignment calculation bn/bn_exp.c wasn'tt quite right. Two other tricky bits with ASN1_STRING_FLAG_NDEF and BN_FLG_STATIC_DATA where the condition cannot be collapsed completely. Passes regress. ok beck
* Send the function codes from the error functions to the bit bucket,beck2017-01-291-36/+32
| | | | | | as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
* Make explicit _ct and _nonct versions of bn_mod_exp funcitons thatbeck2017-01-211-2/+4
| | | | | | | | | | | | matter for constant time, and make the public interface only used external to the library. This moves us to a model where the important things are constant time versions unless you ask for them not to be, rather than the opposite. I'll continue with this method by method. Add regress tests for same. ok jsing@
* fix the rest of the read_ledword() calls used as lengths to be bounded.beck2016-03-021-1/+5
| | | | | inspired by guido vranken https://guidovranken.wordpress.com/2016/03/01/public-disclosure-malformed-private-keys-lead-to-heap-corruption-in-b2i_pvk_bio/ ok doug@
* bound lengths coming out of a pem file to something like realitybeck2016-03-021-3/+7
| | | | ok deraadt@
* Correct spelling of OPENSSL_cleanse.jsing2015-09-101-5/+5
| | | | ok miod@
* Fix return paths with missing EVP_CIPHER_CTX_cleanup() calls.jsg2015-05-151-7/+5
| | | | ok doug@
* Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().jsing2014-10-221-4/+3
| | | | | | | | arc4random_buf() is guaranteed to always succeed - it is worth noting that a number of the replaced function calls were already missing return value checks. ok deraadt@
* if (x) FOO_free(x) -> FOO_free(x).miod2014-07-121-11/+6
| | | | | | | Improves readability, keeps the code smaller so that it is warmer in your cache. review & ok deraadt@
* Missing bounds check in do_PVK_body(); OpenSSL RT #2277, from OpenSSL trunk,miod2014-07-111-4/+10
| | | | but without a memory leak.
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-111-3/+4
| | | | | | | | 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-101-1/+3
| | | | | | | | | 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.
* Stop including standard headers via cryptlib.h - pull in the headers thatjsing2014-07-101-1/+3
| | | | | | are needed in the source files that actually require them. ok beck@ miod@
* tags as requested by miod and teduderaadt2014-06-121-0/+1
|
* if (x) free(x) -> free(x); semantic patch generated with coccinelle, carefullymiod2014-05-221-2/+1
| | | | eyeballed before applying. Contributed by Cyril Roelandt on tech@
* KNF.jsing2014-04-211-311/+287
|
* fix some of the leaksjsg2014-04-171-1/+3
| | | | ok miod@ looks good deraadt@
* Change library to use intrinsic memory allocation functions instead ofbeck2014-04-171-12/+12
| | | | | | | | OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
* import OpenSSL-1.0.1cdjm2012-10-131-23/+35
|
* import OpenSSL 1.0.0edjm2011-11-031-7/+3
|
* import OpenSSL-1.0.0adjm2010-10-011-0/+942