tls: two small code cleanups
authorHenning Westerholt <henning.westerholt@1und1.de>
Thu, 28 Jul 2011 20:26:24 +0000 (22:26 +0200)
committerHenning Westerholt <henning.westerholt@1und1.de>
Thu, 28 Jul 2011 20:26:24 +0000 (22:26 +0200)
modules/tls/tls_domain.c

index e6cae06..07fe4b8 100644 (file)
@@ -68,10 +68,6 @@ tls_domain_t* tls_new_domain(int type, struct ip_addr *ip, unsigned short port)
        d->verify_depth = -1;
        d->require_cert = -1;
        return d;
-/*
- error:
-       shm_free(d);
-       return 0; */
 }
 
 
@@ -831,7 +827,6 @@ static int passwd_cb(char *buf, int size, int rwflag, void *filename)
 }
 
 
-#define NUM_RETRIES 3
 /**
  * @brief Load a private key from a file 
  * @param d TLS domain
@@ -854,7 +849,7 @@ static int load_private_key(tls_domain_t* d)
                SSL_CTX_set_default_passwd_cb(d->ctx[i], passwd_cb);
                SSL_CTX_set_default_passwd_cb_userdata(d->ctx[i], d->pkey_file.s);
                
-               for(idx = 0, ret_pwd = 0; idx < NUM_RETRIES; idx++) {
+               for(idx = 0, ret_pwd = 0; idx < 3; idx++) {
                        ret_pwd = SSL_CTX_use_PrivateKey_file(d->ctx[i], d->pkey_file.s,
                                        SSL_FILETYPE_PEM);
                        if (ret_pwd) {