aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/x509/by_dir.c
Commit message (Collapse)AuthorAgeFilesLines
* Ignore dups in X509_STORE_add_*Rich Salz2017-04-201-1/+8
| | | | | | | | | | | | | | | | | | | | | | X509_STORE_add_cert and X509_STORE_add_crl are changed to return success if the object to be added was already found in the store, rather than returning an error. Raise errors if empty or malformed files are read when loading certificates and CRLs. Remove NULL checks and allow a segv to occur. Add error handing for all calls to X509_STORE_add_c{ert|tl} Refactor these two routines into one. Bring the unit test for duplicate certificates up to date using the test framework. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2830)
* Use X509_LOOKUP_TYPE for lookup type consistently.Dr. Stephen Henson2016-07-261-2/+2
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Copyright consolidation 09/10Rich Salz2016-05-171-54/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fold threads.h into crypto.h making API publicViktor Dukhovni2016-05-161-1/+0
| | | | | | Document thread-safe lock creation Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove use of the old CRYPTO_LOCK_X5O9_STOREMatt Caswell2016-03-091-12/+22
| | | | | | | | The locking here is a bit strange and unclear. Rather than refactor anything and possibly break stuff I have just moved to using the new thread API following as closely as possible what was there previously. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Reuse strndup(), simplify codeDmitry-Me2016-03-081-9/+8
| | | | | Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-261-1/+0
| | | | | | | | | | | | This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Only declare stacks in headersDr. Stephen Henson2016-01-071-7/+5
| | | | | | | Don't define stacks in C source files: it causes warnings about unused functions in some compilers. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Rename DECLARE*STACK_OF to DEFINE*STACK_OFDr. Stephen Henson2016-01-071-2/+2
| | | | | | | | | | Applications wishing to include their own stacks now just need to include DEFINE_STACK_OF(foo) in a header file. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Continue standardising malloc style for libcryptoMatt Caswell2015-11-091-2/+2
| | | | | | | Continuing from previous commit ensure our style is consistent for malloc return checks. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* Fix no-stdio buildDavid Woodhouse2015-09-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Much related/similar work also done by Ivan Nestlerode <ivan.nestlerode@sonos.com> +Replace FILE BIO's with dummy ops that fail. +Include <stdio.h> for sscanf() even with no-stdio (since the declaration is there). We rely on sscanf() to parse the OPENSSL_ia32cap environment variable, since it can be larger than a 'long'. And we don't rely on the availability of strtoull(). +Remove OPENSSL_stderr(); not used. +Make OPENSSL_showfatal() do nothing (currently without stdio there's nothing we can do). +Remove file-based functionality from ssl/. The function prototypes were already gone, but not the functions themselves. +Remove unviable conf functionality via SYS_UEFI +Add fallback definition of BUFSIZ. +Remove functions taking FILE * from header files. +Add missing DECLARE_PEM_write_fp_const +Disable X509_LOOKUP_hash_dir(). X509_LOOKUP_file() was already compiled out, so remove its prototype. +Use OPENSSL_showfatal() in CRYPTO_destroy_dynlockid(). +Eliminate SRP_VBASE_init() and supporting functions. Users will need to build the verifier manually instead. +Eliminate compiler warning for unused do_pk8pkey_fp(). +Disable TEST_ENG_OPENSSL_PKEY. +Disable GOST engine as is uses [f]printf all over the place. +Eliminate compiler warning for unused send_fp_chars(). Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
* Embed X509_CINFDr. Stephen Henson2015-09-161-7/+3
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* X509_CRL_INFO embedDr. Stephen Henson2015-09-161-7/+3
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Enable -Wmissing-variable-declarations andBen Laurie2015-09-111-1/+1
| | | | | | | -Wincompatible-pointer-types-discards-qualifiers (the latter did not require any code changes). Reviewed-by: Rich Salz <rsalz@openssl.org>
* make X509_CRL opaqueDr. Stephen Henson2015-09-021-0/+1
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Use enum for X509_LOOKUP_TYPERich Salz2015-05-281-2/+2
| | | | | | | Using an enum with -Wswitch means all lookup routines handle all cases. Remove X509_LU_PKEY which was never used. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Identify and move common internal libcrypto header filesRichard Levitte2015-05-141-1/+1
| | | | | | | | | | | | | There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
* Use safer sizeof variant in mallocRich Salz2015-05-041-3/+3
| | | | | | | | | | | | | For a local variable: TYPE *p; Allocations like this are "risky": p = OPENSSL_malloc(sizeof(TYPE)); if the type of p changes, and the malloc call isn't updated, you could get memory corruption. Instead do this: p = OPENSSL_malloc(sizeof(*p)); Also fixed a few memset() calls that I noticed while doing this. Reviewed-by: Richard Levitte <levitte@openssl.org>
* free NULL cleanup -- codaRich Salz2015-05-011-8/+4
| | | | | | | | After the finale, the "real" final part. :) Do a recursive grep with "-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are an "if NULL" check that can be removed. Reviewed-by: Tim Hudson <tjh@openssl.org>
* free null cleanup finaleRich Salz2015-05-011-2/+1
| | | | | | Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
* remove malloc castsRich Salz2015-04-281-1/+1
| | | | | | | Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
* More comment realignmentmaster-post-reformatMatt Caswell2015-01-221-2/+2
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Run util/openssl-format-source -v -c .Matt Caswell2015-01-221-389/+344
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Further comment changes for reformat (master)Matt Caswell2015-01-221-1/+1
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* get_cert_by_subject: check for NULL when allocating hentJonas Maebe2014-08-171-0/+7
| | | | | Signed-off-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* x509/by_dir.c: fix run-away pointer (and potential SEGV)Andy Polyakov2014-02-241-4/+2
| | | | | | | when adding duplicates in add_cert_dir. PR: 3261 Reported by: Marian Done
* Fix X509_STORE lockingBodo Möller2010-02-191-3/+2
|
* This _WIN32-specific patch makes it possible to "wrap" OpenSSL in anotherAndy Polyakov2008-12-221-0/+3
| | | | | | | .DLL, in particular static build. The issue has been discussed in RT#1230 and later on openssl-dev, and mutually exclusive approaches were suggested. This completes compromise solution suggested in RT#1230. PR: 1230
* Finish gcc 4.2 changes.Dr. Stephen Henson2007-06-071-2/+2
|
* Updates from 0.9.8-stable branch.Dr. Stephen Henson2007-02-181-1/+1
|
* avoid duplicate entries in add_cert_dir()Nils Larsch2006-12-051-5/+6
| | | | | PR: 1407 Submitted by: Tomas Mraz <tmraz@redhat.com>
* Initialize new callbacks and make sure hent is always initialized.Dr. Stephen Henson2006-09-261-0/+3
|
* Complete the change for VMS.Richard Levitte2006-09-251-1/+1
|
* Overhaul of by_dir code to handle dynamic loading of CRLs.Dr. Stephen Henson2006-09-171-52/+146
|
* Keep disclaiming 16-bit platform support. For now remove WIN16 referencesAndy Polyakov2005-12-181-1/+1
| | | | from .h files...
* Mask libcrypto references to stat with OPENSSL_NO_POSIX_IO.Andy Polyakov2005-11-031-4/+6
|
* Fix bugs in bug-fix to x509/by_dir.c.Andy Polyakov2005-07-031-6/+5
| | | | PR: 1131
* Initialise dir to avoid a compiler warning.Richard Levitte2005-06-231-1/+1
|
* Change dir_ctrl to check for the environment variable before using the defaultRichard Levitte2005-06-231-6/+6
| | | | | | directory instead of the other way around. PR: 1131
* Typo...Richard Levitte2004-01-221-1/+1
|
* Adding a slash between the directoryt and the file is a problem withRichard Levitte2004-01-101-3/+32
| | | | | | | | | | | | | | | | | VMS. The C RTL can handle it well if the "directory" is a logical name with no colon, therefore ending being 'logname/file'. However, if the given logical names actually has a colon, or if you use a full VMS-syntax directory, you end up with 'logname:/file' or 'dev:[dir1.dir2]/file', and that isn't handled in any good way. So, on VMS, we need to check if the directory string ends with a separator (one of ':', ']' or '>' (< and > can be used instead [ and ])), and handle that by not inserting anything between the directory spec and the file name. In all other cases, it's assumed the directory spec is a logical name, so we need to place a colon between it and the file. Notified by Kevin Greaney <kevin.greaney@hp.com>.
* Use BUF_strlcpy() instead of strcpy().Richard Levitte2003-12-271-2/+3
| | | | | | | 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>
* Fix for typo in certificate directory lookup code.Dr. Stephen Henson2000-10-141-1/+1
|
* *BIG* verify code reorganisation.Dr. Stephen Henson2000-09-051-1/+3
| | | | | | | | | | | | | | | | | The old code was painfully primitive and couldn't handle distinct certificates using the same subject name. The new code performs several tests on a candidate issuer certificate based on certificate extensions. It also adds several callbacks to X509_VERIFY_CTX so its behaviour can be customised. Unfortunately some hackery was needed to persuade X509_STORE to tolerate this. This should go away when X509_STORE is replaced, sometime... This must have broken something though :-(
* There have been a number of complaints from a number of sources that namesRichard Levitte2000-06-011-11/+11
| | | | | | | | | like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
* Seek out and destroy another evil cast.Ulf Möller2000-01-301-2/+2
|
* Source code cleanups: Use void * rather than char * in lhash,Ulf Möller2000-01-301-2/+1
| | | | eliminate some of the -Wcast-qual warnings (debug-ben-strict target)
* Initial support for MacOS.Andy Polyakov1999-09-111-2/+10
| | | | | | | | | | | | | | This will soon be complemented with MacOS specific source code files and INSTALL.MacOS. I (Andy) have decided to get rid of a number of #include <sys/types.h>. I've verified it's ok (both by examining /usr/include/*.h and compiling) on a number of Unix platforms. Unfortunately I don't have Windows box to verify this on. I really appreciate if somebody could try to compile it and contact me a.s.a.p. in case a problem occurs. Submitted by: Roy Wood <roy@centricsystems.ca> Reviewed by: Andy Polyakov <appro@fy.chalmers.se>
* Use "const char *" instead of "char *" for filenames passed to functions.Bodo Möller1999-05-091-2/+3
| | | | | | Submitted by: Reviewed by: PR:
* Remove NOPROTO definitions and error code comments.Ulf Möller1999-04-261-9/+0
|