X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fapps.c;h=09d9df2817a7e669f7b2a92279b9a998b5fcb79b;hp=b04bfbd3c3460ce6cad070ad47f59aa593860974;hb=636b6b450dcc0c694780ea34ed2f5d4a39d5d9b5;hpb=d4f0339c66eace1b7f90f07f43b6d8595342cce3;ds=sidebyside diff --git a/apps/apps.c b/apps/apps.c index b04bfbd3c3..09d9df2817 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -109,14 +109,16 @@ * */ +#ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 2 /* On VMS, you need to define this to get the declaration of fileno(). The value 2 is to make sure no function defined in POSIX-2 is left undefined. */ +#endif #include #include #include -#ifndef OPENSSL_SYSNAME_WIN32 +#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(NETWARE_CLIB) #include #endif #include @@ -1486,7 +1488,7 @@ char *make_config_name() return p; } -static unsigned long index_serial_hash(const CSTRING *a) +static unsigned long index_serial_hash(const OPENSSL_CSTRING *a) { const char *n; @@ -1495,7 +1497,7 @@ static unsigned long index_serial_hash(const CSTRING *a) return(lh_strhash(n)); } -static int index_serial_cmp(const CSTRING *a, const CSTRING *b) +static int index_serial_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b) { const char *aa,*bb; @@ -1507,16 +1509,16 @@ static int index_serial_cmp(const CSTRING *a, const CSTRING *b) static int index_name_qual(char **a) { return(a[0][0] == 'V'); } -static unsigned long index_name_hash(const CSTRING *a) +static unsigned long index_name_hash(const OPENSSL_CSTRING *a) { return(lh_strhash(a[DB_name])); } -int index_name_cmp(const CSTRING *a, const CSTRING *b) +int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b) { return(strcmp(a[DB_name], b[DB_name])); } -static IMPLEMENT_LHASH_HASH_FN(index_serial, CSTRING) -static IMPLEMENT_LHASH_COMP_FN(index_serial, CSTRING) -static IMPLEMENT_LHASH_HASH_FN(index_name, CSTRING) -static IMPLEMENT_LHASH_COMP_FN(index_name, CSTRING) +static IMPLEMENT_LHASH_HASH_FN(index_serial, OPENSSL_CSTRING) +static IMPLEMENT_LHASH_COMP_FN(index_serial, OPENSSL_CSTRING) +static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING) +static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING) #undef BSIZE #define BSIZE 256 @@ -2190,7 +2192,7 @@ int args_verify(char ***pargs, int *pargc, ASN1_OBJECT *otmp = NULL; unsigned long flags = 0; int i; - int purpose = 0; + int purpose = 0, depth = -1; char **oldargs = *pargs; char *arg = **pargs, *argn = (*pargs)[1]; if (!strcmp(arg, "-policy")) @@ -2230,6 +2232,21 @@ int args_verify(char ***pargs, int *pargc, } (*pargs)++; } + else if (strcmp(arg,"-verify_depth") == 0) + { + if (!argn) + *badarg = 1; + else + { + depth = atoi(argn); + if(depth < 0) + { + BIO_printf(err, "invalid depth\n"); + *badarg = 1; + } + } + (*pargs)++; + } else if (!strcmp(arg, "-ignore_critical")) flags |= X509_V_FLAG_IGNORE_CRITICAL; else if (!strcmp(arg, "-issuer_checks")) @@ -2254,6 +2271,8 @@ int args_verify(char ***pargs, int *pargc, flags |= X509_V_FLAG_USE_DELTAS; else if (!strcmp(arg, "-policy_print")) flags |= X509_V_FLAG_NOTIFY_POLICY; + else if (!strcmp(arg, "-check_ss_sig")) + flags |= X509_V_FLAG_CHECK_SS_SIGNATURE; else return 0; @@ -2279,6 +2298,9 @@ int args_verify(char ***pargs, int *pargc, if (purpose) X509_VERIFY_PARAM_set_purpose(*pm, purpose); + if (depth >= 0) + X509_VERIFY_PARAM_set_depth(*pm, depth); + end: (*pargs)++;