diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2014-04-17 22:08:46 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2014-04-17 22:08:46 +0000 |
commit | cba11444aba6d3e89c1efd8263d49279dea1f7a5 (patch) | |
tree | 02185b092b51ef3972c7230f234b764d00baf2eb /lib/libcrypto | |
parent | c86dd888861fbe6ccf10b02002286348c86463f4 (diff) |
no need for a variable which is hardcoded and only used in an snprintf,
ok giovanni@. tidy comments nearby while there.
Diffstat (limited to 'lib/libcrypto')
-rw-r--r-- | lib/libcrypto/x509/by_dir.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/lib/libcrypto/x509/by_dir.c b/lib/libcrypto/x509/by_dir.c index 9795b636204..749323be1e4 100644 --- a/lib/libcrypto/x509/by_dir.c +++ b/lib/libcrypto/x509/by_dir.c @@ -336,11 +336,8 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, hent = NULL; } for (;;) { - char c = '/'; - - (void) snprintf(b->data, b->max, - "%s%c%08lx.%s%d", ent->dir, c, h, - postfix, k); + (void) snprintf(b->data, b->max, "%s/%08lx.%s%d", + ent->dir, h, postfix, k); #ifndef OPENSSL_NO_POSIX_IO { @@ -363,8 +360,7 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, k++; } - /* we have added it to the cache so now pull - * it out again */ + /* we have added it to the cache so now pull it out again */ CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); j = sk_X509_OBJECT_find(xl->store_ctx->objs, &stmp); if (j != -1) @@ -372,12 +368,11 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, else tmp = NULL; CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE); - /* If a CRL, update the last file suffix added for this */ - if (type == X509_LU_CRL) { CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); - /* Look for entry again in case another thread added + /* + * Look for entry again in case another thread added * an entry first. */ if (!hent) { @@ -408,9 +403,10 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, ok = 1; ret->type = tmp->type; memcpy(&ret->data, &tmp->data, sizeof(ret->data)); - /* If we were going to up the reference count, - * we would need to do it on a perl 'type' - * basis */ + /* + * If we were going to up the reference count, + * we would need to do it on a perl 'type' basis + */ /* CRYPTO_add(&tmp->data.x509->references,1, CRYPTO_LOCK_X509);*/ goto finish; |