move variable declarations to top of function

svn:r425
This commit is contained in:
Roger Dingledine 2003-09-05 05:58:21 +00:00
parent fd20011c26
commit 99d1e4931b

View File

@ -135,13 +135,14 @@ tor_tls_write_certificate(char *certfile, crypto_pk_env_t *rsa, char *nickname)
tor_tls_context * tor_tls_context *
tor_tls_context_new(char *certfile, crypto_pk_env_t *rsa, int isServer) tor_tls_context_new(char *certfile, crypto_pk_env_t *rsa, int isServer)
{ {
assert(!rsa || rsa->type == CRYPTO_PK_RSA);
assert((certfile && rsa) || (!certfile && !rsa));
crypto_dh_env_t *dh = NULL; crypto_dh_env_t *dh = NULL;
RSA *_rsa = NULL; RSA *_rsa = NULL;
EVP_PKEY *pkey = NULL; EVP_PKEY *pkey = NULL;
tor_tls_context *result; tor_tls_context *result;
assert(!rsa || rsa->type == CRYPTO_PK_RSA);
assert((certfile && rsa) || (!certfile && !rsa));
result = tor_malloc(sizeof(tor_tls_context)); result = tor_malloc(sizeof(tor_tls_context));
if (!(result->ctx = SSL_CTX_new(TLSv1_method()))) if (!(result->ctx = SSL_CTX_new(TLSv1_method())))
return NULL; return NULL;