projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix no-psk
[openssl.git]
/
apps
/
rehash.c
diff --git
a/apps/rehash.c
b/apps/rehash.c
index 23dbfd8daa41760847b76743332abcefd145b175..e3c02448fbdd52ca3ee7337e79481a6f5ca76e21 100644
(file)
--- a/
apps/rehash.c
+++ b/
apps/rehash.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 2015-201
6
The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-201
7
The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@
-254,11
+254,11
@@
static int do_file(const char *filename, const char *fullpath, enum Hash h)
goto end;
}
x = sk_X509_INFO_value(inf, 0);
goto end;
}
x = sk_X509_INFO_value(inf, 0);
- if (x->x509) {
+ if (x->x509
!= NULL
) {
type = TYPE_CERT;
name = X509_get_subject_name(x->x509);
X509_digest(x->x509, evpmd, digest, NULL);
type = TYPE_CERT;
name = X509_get_subject_name(x->x509);
X509_digest(x->x509, evpmd, digest, NULL);
- } else if (x->crl) {
+ } else if (x->crl
!= NULL
) {
type = TYPE_CRL;
name = X509_CRL_get_issuer(x->crl);
X509_CRL_digest(x->crl, evpmd, digest, NULL);
type = TYPE_CRL;
name = X509_CRL_get_issuer(x->crl);
X509_CRL_digest(x->crl, evpmd, digest, NULL);
@@
-266,7
+266,7
@@
static int do_file(const char *filename, const char *fullpath, enum Hash h)
++errs;
goto end;
}
++errs;
goto end;
}
- if (name) {
+ if (name
!= NULL
) {
if ((h == HASH_NEW) || (h == HASH_BOTH))
errs += add_entry(type, X509_NAME_hash(name), filename, digest, 1, ~0);
if ((h == HASH_OLD) || (h == HASH_BOTH))
if ((h == HASH_NEW) || (h == HASH_BOTH))
errs += add_entry(type, X509_NAME_hash(name), filename, digest, 1, ~0);
if ((h == HASH_OLD) || (h == HASH_BOTH))
@@
-287,10
+287,10
@@
static int ends_with_dirsep(const char *path)
{
if (*path != '\0')
path += strlen(path) - 1;
{
if (*path != '\0')
path += strlen(path) - 1;
-# if
def
__VMS
+# if
defined
__VMS
if (*path == ']' || *path == '>' || *path == ':')
return 1;
if (*path == ']' || *path == '>' || *path == ':')
return 1;
-# elif _WIN32
+# elif
defined
_WIN32
if (*path == '\\')
return 1;
# endif
if (*path == '\\')
return 1;
# endif
@@
-362,8
+362,8
@@
static int do_dir(const char *dirname, enum Hash h)
numfiles = sk_OPENSSL_STRING_num(files);
for (n = 0; n < numfiles; ++n) {
filename = sk_OPENSSL_STRING_value(files, n);
numfiles = sk_OPENSSL_STRING_num(files);
for (n = 0; n < numfiles; ++n) {
filename = sk_OPENSSL_STRING_value(files, n);
- if (snprintf(buf, buflen, "%s%s%s",
- dirname, pathsep, filename) >= buflen)
+ if (
BIO_
snprintf(buf, buflen, "%s%s%s",
+
dirname, pathsep, filename) >= buflen)
continue;
if (lstat(buf, &st) < 0)
continue;
continue;
if (lstat(buf, &st) < 0)
continue;
@@
-386,8
+386,8
@@
static int do_dir(const char *dirname, enum Hash h)
nextep = ep->next;
if (ep->old_id < bp->num_needed) {
/* Link exists, and is used as-is */
nextep = ep->next;
if (ep->old_id < bp->num_needed) {
/* Link exists, and is used as-is */
- snprintf(buf, buflen, "%08x.%s%d", bp->hash,
- suffixes[bp->type], ep->old_id);
+
BIO_
snprintf(buf, buflen, "%08x.%s%d", bp->hash,
+
suffixes[bp->type], ep->old_id);
if (verbose)
BIO_printf(bio_out, "link %s -> %s\n",
ep->filename, buf);
if (verbose)
BIO_printf(bio_out, "link %s -> %s\n",
ep->filename, buf);
@@
-396,9
+396,9
@@
static int do_dir(const char *dirname, enum Hash h)
while (bit_isset(idmask, nextid))
nextid++;
while (bit_isset(idmask, nextid))
nextid++;
- snprintf(buf, buflen, "%s%s%n%08x.%s%d",
- dirname, pathsep, &n, bp->hash,
- suffixes[bp->type], nextid);
+
BIO_
snprintf(buf, buflen, "%s%s%n%08x.%s%d",
+
dirname, pathsep, &n, bp->hash,
+
suffixes[bp->type], nextid);
if (verbose)
BIO_printf(bio_out, "link %s -> %s\n",
ep->filename, &buf[n]);
if (verbose)
BIO_printf(bio_out, "link %s -> %s\n",
ep->filename, &buf[n]);
@@
-418,9
+418,9
@@
static int do_dir(const char *dirname, enum Hash h)
bit_set(idmask, nextid);
} else if (remove_links) {
/* Link to be deleted */
bit_set(idmask, nextid);
} else if (remove_links) {
/* Link to be deleted */
- snprintf(buf, buflen, "%s%s%n%08x.%s%d",
- dirname, pathsep, &n, bp->hash,
- suffixes[bp->type], ep->old_id);
+
BIO_
snprintf(buf, buflen, "%s%s%n%08x.%s%d",
+
dirname, pathsep, &n, bp->hash,
+
suffixes[bp->type], ep->old_id);
if (verbose)
BIO_printf(bio_out, "unlink %s\n",
&buf[n]);
if (verbose)
BIO_printf(bio_out, "unlink %s\n",
&buf[n]);
@@
-499,8
+499,8
@@
int rehash_main(int argc, char **argv)
evpmd = EVP_sha1();
evpmdsize = EVP_MD_size(evpmd);
evpmd = EVP_sha1();
evpmdsize = EVP_MD_size(evpmd);
- if (*argv) {
- while (*argv)
+ if (*argv
!= NULL
) {
+ while (*argv
!= NULL
)
errs += do_dir(*argv++, h);
} else if ((env = getenv("SSL_CERT_DIR")) != NULL) {
m = OPENSSL_strdup(env);
errs += do_dir(*argv++, h);
} else if ((env = getenv("SSL_CERT_DIR")) != NULL) {
m = OPENSSL_strdup(env);