Skip to content

Commit

Permalink
Minor cleanup to enable warning-free Windows build:
Browse files Browse the repository at this point in the history
- Changed int32_t to size_t
- Removed some unused variables
- Added missing include files
- changed ordering to ensure variable declarations are before asserts

Signed-off-by: Adriaan de Jong <[email protected]>
Tested-by: Samuli Seppänen <[email protected]>
Acked-by: David Sommerseth <[email protected]>
Signed-off-by: David Sommerseth <[email protected]>
  • Loading branch information
andj authored and David Sommerseth committed Nov 21, 2011
1 parent 1d90851 commit be960aa
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,11 +1336,10 @@ prng_uninit (void)
void
prng_bytes (uint8_t *output, int len)
{
static int32_t processed = 0;
static size_t processed = 0;

if (nonce_md)
{
md_ctx_t ctx;
const int md_size = md_kt_size (nonce_md);
while (len > 0)
{
Expand Down
1 change: 0 additions & 1 deletion pkcs11_polarssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ pkcs11_init_tls_session(pkcs11h_certificate_t certificate,
struct tls_root_ctx * const ssl_ctx)
{
int ret = 1;
pkcs11_context pkcs11_ctx;

ASSERT (NULL != ssl_ctx);

Expand Down
6 changes: 3 additions & 3 deletions ssl_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "memdbg.h"
#include "ssl_backend.h"
#include "ssl_common.h"
#include "base64.h"

#ifdef ENABLE_CRYPTOAPI
#include "cryptoapi.h"
Expand Down Expand Up @@ -349,7 +350,6 @@ tls_ctx_load_cryptoapi(struct tls_root_ctx *ctx, const char *cryptoapi_cert)
static int
tls_ctx_read_certificate_file(SSL_CTX *ctx, const char *file, X509 **x509)
{
int j;
BIO *in;
int ret=0;
X509 *x=NULL;
Expand Down Expand Up @@ -480,10 +480,10 @@ tls_ctx_load_priv_file (struct tls_root_ctx *ctx, const char *priv_key_file
#endif
)
{
ASSERT(NULL != ctx);

int status;

ASSERT(NULL != ctx);

#if ENABLE_INLINE_FILES
if (!strcmp (priv_key_file, INLINE_FILE_TAG) && priv_key_file_inline)
{
Expand Down
2 changes: 0 additions & 2 deletions ssl_polarssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ void tls_ctx_load_ca (struct tls_root_ctx *ctx, const char *ca_file,
const char *ca_path, bool tls_server
)
{
int status;

if (ca_path)
msg(M_FATAL, "ERROR: PolarSSL cannot handle the capath directive");

Expand Down
1 change: 1 addition & 0 deletions ssl_verify_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "ssl_verify_backend.h"
#include "ssl_openssl.h"
#include <openssl/x509v3.h>
#include <openssl/err.h>

int
verify_callback (int preverify_ok, X509_STORE_CTX * ctx)
Expand Down
2 changes: 1 addition & 1 deletion ssl_verify_polarssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ x509_free_subject (char *subject)
void
x509_setenv (struct env_set *es, int cert_depth, x509_cert_t *cert)
{
int i, ret;
int i;
unsigned char c;
const x509_name *name;
char s[128];
Expand Down

0 comments on commit be960aa

Please sign in to comment.