We're getting a clash with C++ because it has a type called 'list'.
Therefore, change all instances of the symbol 'list' to something else. PR: 758 Submitted by: Frédéric Giudicelli <groups@newpki.org>
This commit is contained in:
parent
6a6a08cbea
commit
b64614adfe
@ -576,12 +576,12 @@ char *CONF_get1_default_config_file(void)
|
|||||||
* be used to parse comma separated lists for example.
|
* be used to parse comma separated lists for example.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int CONF_parse_list(const char *list, int sep, int nospc,
|
int CONF_parse_list(const char *list_, int sep, int nospc,
|
||||||
int (*list_cb)(const char *elem, int len, void *usr), void *arg)
|
int (*list_cb)(const char *elem, int len, void *usr), void *arg)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
const char *lstart, *tmpend, *p;
|
const char *lstart, *tmpend, *p;
|
||||||
lstart = list;
|
lstart = list_;
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
|
@ -107,14 +107,14 @@ static int int_def_cb(const char *alg, int len, void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ENGINE_set_default_string(ENGINE *e, const char *list)
|
int ENGINE_set_default_string(ENGINE *e, const char *def_list)
|
||||||
{
|
{
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
if (!CONF_parse_list(list, ',', 1, int_def_cb, &flags))
|
if (!CONF_parse_list(def_list, ',', 1, int_def_cb, &flags))
|
||||||
{
|
{
|
||||||
ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_STRING,
|
ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_STRING,
|
||||||
ENGINE_R_INVALID_STRING);
|
ENGINE_R_INVALID_STRING);
|
||||||
ERR_add_error_data(2, "str=",list);
|
ERR_add_error_data(2, "str=",def_list);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return ENGINE_set_default(e, flags);
|
return ENGINE_set_default(e, flags);
|
||||||
|
@ -513,7 +513,7 @@ ENGINE *ENGINE_get_digest_engine(int nid);
|
|||||||
* structure will have had its reference count up'd so the caller
|
* structure will have had its reference count up'd so the caller
|
||||||
* should still free their own reference 'e'. */
|
* should still free their own reference 'e'. */
|
||||||
int ENGINE_set_default_RSA(ENGINE *e);
|
int ENGINE_set_default_RSA(ENGINE *e);
|
||||||
int ENGINE_set_default_string(ENGINE *e, const char *list);
|
int ENGINE_set_default_string(ENGINE *e, const char *def_list);
|
||||||
/* Same for the other "methods" */
|
/* Same for the other "methods" */
|
||||||
int ENGINE_set_default_DSA(ENGINE *e);
|
int ENGINE_set_default_DSA(ENGINE *e);
|
||||||
int ENGINE_set_default_DH(ENGINE *e);
|
int ENGINE_set_default_DH(ENGINE *e);
|
||||||
|
@ -1357,8 +1357,8 @@ const char *SSL_alert_type_string(int value);
|
|||||||
const char *SSL_alert_desc_string_long(int value);
|
const char *SSL_alert_desc_string_long(int value);
|
||||||
const char *SSL_alert_desc_string(int value);
|
const char *SSL_alert_desc_string(int value);
|
||||||
|
|
||||||
void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *list);
|
void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list);
|
||||||
void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *list);
|
void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list);
|
||||||
STACK_OF(X509_NAME) *SSL_get_client_CA_list(SSL *s);
|
STACK_OF(X509_NAME) *SSL_get_client_CA_list(SSL *s);
|
||||||
STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(SSL_CTX *s);
|
STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(SSL_CTX *s);
|
||||||
int SSL_add_client_CA(SSL *ssl,X509 *x);
|
int SSL_add_client_CA(SSL *ssl,X509 *x);
|
||||||
|
@ -505,12 +505,12 @@ int ssl_verify_cert_chain(SSL *s,STACK_OF(X509) *sk)
|
|||||||
return(i);
|
return(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_client_CA_list(STACK_OF(X509_NAME) **ca_list,STACK_OF(X509_NAME) *list)
|
static void set_client_CA_list(STACK_OF(X509_NAME) **ca_list,STACK_OF(X509_NAME) *name_list)
|
||||||
{
|
{
|
||||||
if (*ca_list != NULL)
|
if (*ca_list != NULL)
|
||||||
sk_X509_NAME_pop_free(*ca_list,X509_NAME_free);
|
sk_X509_NAME_pop_free(*ca_list,X509_NAME_free);
|
||||||
|
|
||||||
*ca_list=list;
|
*ca_list=name_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk)
|
STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk)
|
||||||
@ -532,14 +532,14 @@ STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk)
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSL_set_client_CA_list(SSL *s,STACK_OF(X509_NAME) *list)
|
void SSL_set_client_CA_list(SSL *s,STACK_OF(X509_NAME) *name_list)
|
||||||
{
|
{
|
||||||
set_client_CA_list(&(s->client_CA),list);
|
set_client_CA_list(&(s->client_CA),name_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSL_CTX_set_client_CA_list(SSL_CTX *ctx,STACK_OF(X509_NAME) *list)
|
void SSL_CTX_set_client_CA_list(SSL_CTX *ctx,STACK_OF(X509_NAME) *name_list)
|
||||||
{
|
{
|
||||||
set_client_CA_list(&(ctx->client_CA),list);
|
set_client_CA_list(&(ctx->client_CA),name_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(SSL_CTX *ctx)
|
STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(SSL_CTX *ctx)
|
||||||
|
@ -334,10 +334,10 @@ static unsigned long ssl_cipher_get_disabled(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void ssl_cipher_collect_ciphers(const SSL_METHOD *ssl_method,
|
static void ssl_cipher_collect_ciphers(const SSL_METHOD *ssl_method,
|
||||||
int num_of_ciphers, unsigned long mask, CIPHER_ORDER *list,
|
int num_of_ciphers, unsigned long mask, CIPHER_ORDER *co_list,
|
||||||
CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p)
|
CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p)
|
||||||
{
|
{
|
||||||
int i, list_num;
|
int i, co_list_num;
|
||||||
SSL_CIPHER *c;
|
SSL_CIPHER *c;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -348,18 +348,18 @@ static void ssl_cipher_collect_ciphers(const SSL_METHOD *ssl_method,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Get the initial list of ciphers */
|
/* Get the initial list of ciphers */
|
||||||
list_num = 0; /* actual count of ciphers */
|
co_list_num = 0; /* actual count of ciphers */
|
||||||
for (i = 0; i < num_of_ciphers; i++)
|
for (i = 0; i < num_of_ciphers; i++)
|
||||||
{
|
{
|
||||||
c = ssl_method->get_cipher(i);
|
c = ssl_method->get_cipher(i);
|
||||||
/* drop those that use any of that is not available */
|
/* drop those that use any of that is not available */
|
||||||
if ((c != NULL) && c->valid && !(c->algorithms & mask))
|
if ((c != NULL) && c->valid && !(c->algorithms & mask))
|
||||||
{
|
{
|
||||||
list[list_num].cipher = c;
|
co_list[co_list_num].cipher = c;
|
||||||
list[list_num].next = NULL;
|
co_list[co_list_num].next = NULL;
|
||||||
list[list_num].prev = NULL;
|
co_list[co_list_num].prev = NULL;
|
||||||
list[list_num].active = 0;
|
co_list[co_list_num].active = 0;
|
||||||
list_num++;
|
co_list_num++;
|
||||||
#ifdef KSSL_DEBUG
|
#ifdef KSSL_DEBUG
|
||||||
printf("\t%d: %s %lx %lx\n",i,c->name,c->id,c->algorithms);
|
printf("\t%d: %s %lx %lx\n",i,c->name,c->id,c->algorithms);
|
||||||
#endif /* KSSL_DEBUG */
|
#endif /* KSSL_DEBUG */
|
||||||
@ -372,18 +372,18 @@ static void ssl_cipher_collect_ciphers(const SSL_METHOD *ssl_method,
|
|||||||
/*
|
/*
|
||||||
* Prepare linked list from list entries
|
* Prepare linked list from list entries
|
||||||
*/
|
*/
|
||||||
for (i = 1; i < list_num - 1; i++)
|
for (i = 1; i < co_list_num - 1; i++)
|
||||||
{
|
{
|
||||||
list[i].prev = &(list[i-1]);
|
co_list[i].prev = &(co_list[i-1]);
|
||||||
list[i].next = &(list[i+1]);
|
co_list[i].next = &(co_list[i+1]);
|
||||||
}
|
}
|
||||||
if (list_num > 0)
|
if (co_list_num > 0)
|
||||||
{
|
{
|
||||||
(*head_p) = &(list[0]);
|
(*head_p) = &(co_list[0]);
|
||||||
(*head_p)->prev = NULL;
|
(*head_p)->prev = NULL;
|
||||||
(*head_p)->next = &(list[1]);
|
(*head_p)->next = &(co_list[1]);
|
||||||
(*tail_p) = &(list[list_num - 1]);
|
(*tail_p) = &(co_list[co_list_num - 1]);
|
||||||
(*tail_p)->prev = &(list[list_num - 2]);
|
(*tail_p)->prev = &(co_list[co_list_num - 2]);
|
||||||
(*tail_p)->next = NULL;
|
(*tail_p)->next = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -429,7 +429,7 @@ static void ssl_cipher_collect_aliases(SSL_CIPHER **ca_list,
|
|||||||
|
|
||||||
static void ssl_cipher_apply_rule(unsigned long algorithms, unsigned long mask,
|
static void ssl_cipher_apply_rule(unsigned long algorithms, unsigned long mask,
|
||||||
unsigned long algo_strength, unsigned long mask_strength,
|
unsigned long algo_strength, unsigned long mask_strength,
|
||||||
int rule, int strength_bits, CIPHER_ORDER *list,
|
int rule, int strength_bits, CIPHER_ORDER *co_list,
|
||||||
CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p)
|
CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p)
|
||||||
{
|
{
|
||||||
CIPHER_ORDER *head, *tail, *curr, *curr2, *tail2;
|
CIPHER_ORDER *head, *tail, *curr, *curr2, *tail2;
|
||||||
@ -524,8 +524,9 @@ static void ssl_cipher_apply_rule(unsigned long algorithms, unsigned long mask,
|
|||||||
*tail_p = tail;
|
*tail_p = tail;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ssl_cipher_strength_sort(CIPHER_ORDER *list, CIPHER_ORDER **head_p,
|
static int ssl_cipher_strength_sort(CIPHER_ORDER *co_list,
|
||||||
CIPHER_ORDER **tail_p)
|
CIPHER_ORDER **head_p,
|
||||||
|
CIPHER_ORDER **tail_p)
|
||||||
{
|
{
|
||||||
int max_strength_bits, i, *number_uses;
|
int max_strength_bits, i, *number_uses;
|
||||||
CIPHER_ORDER *curr;
|
CIPHER_ORDER *curr;
|
||||||
@ -570,14 +571,14 @@ static int ssl_cipher_strength_sort(CIPHER_ORDER *list, CIPHER_ORDER **head_p,
|
|||||||
for (i = max_strength_bits; i >= 0; i--)
|
for (i = max_strength_bits; i >= 0; i--)
|
||||||
if (number_uses[i] > 0)
|
if (number_uses[i] > 0)
|
||||||
ssl_cipher_apply_rule(0, 0, 0, 0, CIPHER_ORD, i,
|
ssl_cipher_apply_rule(0, 0, 0, 0, CIPHER_ORD, i,
|
||||||
list, head_p, tail_p);
|
co_list, head_p, tail_p);
|
||||||
|
|
||||||
OPENSSL_free(number_uses);
|
OPENSSL_free(number_uses);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ssl_cipher_process_rulestr(const char *rule_str,
|
static int ssl_cipher_process_rulestr(const char *rule_str,
|
||||||
CIPHER_ORDER *list, CIPHER_ORDER **head_p,
|
CIPHER_ORDER *co_list, CIPHER_ORDER **head_p,
|
||||||
CIPHER_ORDER **tail_p, SSL_CIPHER **ca_list)
|
CIPHER_ORDER **tail_p, SSL_CIPHER **ca_list)
|
||||||
{
|
{
|
||||||
unsigned long algorithms, mask, algo_strength, mask_strength;
|
unsigned long algorithms, mask, algo_strength, mask_strength;
|
||||||
@ -702,7 +703,7 @@ static int ssl_cipher_process_rulestr(const char *rule_str,
|
|||||||
ok = 0;
|
ok = 0;
|
||||||
if ((buflen == 8) &&
|
if ((buflen == 8) &&
|
||||||
!strncmp(buf, "STRENGTH", 8))
|
!strncmp(buf, "STRENGTH", 8))
|
||||||
ok = ssl_cipher_strength_sort(list,
|
ok = ssl_cipher_strength_sort(co_list,
|
||||||
head_p, tail_p);
|
head_p, tail_p);
|
||||||
else
|
else
|
||||||
SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR,
|
SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR,
|
||||||
@ -722,7 +723,7 @@ static int ssl_cipher_process_rulestr(const char *rule_str,
|
|||||||
{
|
{
|
||||||
ssl_cipher_apply_rule(algorithms, mask,
|
ssl_cipher_apply_rule(algorithms, mask,
|
||||||
algo_strength, mask_strength, rule, -1,
|
algo_strength, mask_strength, rule, -1,
|
||||||
list, head_p, tail_p);
|
co_list, head_p, tail_p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -744,7 +745,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
|
|||||||
unsigned long disabled_mask;
|
unsigned long disabled_mask;
|
||||||
STACK_OF(SSL_CIPHER) *cipherstack;
|
STACK_OF(SSL_CIPHER) *cipherstack;
|
||||||
const char *rule_p;
|
const char *rule_p;
|
||||||
CIPHER_ORDER *list = NULL, *head = NULL, *tail = NULL, *curr;
|
CIPHER_ORDER *co_list = NULL, *head = NULL, *tail = NULL, *curr;
|
||||||
SSL_CIPHER **ca_list = NULL;
|
SSL_CIPHER **ca_list = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -774,15 +775,15 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
|
|||||||
#ifdef KSSL_DEBUG
|
#ifdef KSSL_DEBUG
|
||||||
printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers);
|
printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers);
|
||||||
#endif /* KSSL_DEBUG */
|
#endif /* KSSL_DEBUG */
|
||||||
list = (CIPHER_ORDER *)OPENSSL_malloc(sizeof(CIPHER_ORDER) * num_of_ciphers);
|
co_list = (CIPHER_ORDER *)OPENSSL_malloc(sizeof(CIPHER_ORDER) * num_of_ciphers);
|
||||||
if (list == NULL)
|
if (co_list == NULL)
|
||||||
{
|
{
|
||||||
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST,ERR_R_MALLOC_FAILURE);
|
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST,ERR_R_MALLOC_FAILURE);
|
||||||
return(NULL); /* Failure */
|
return(NULL); /* Failure */
|
||||||
}
|
}
|
||||||
|
|
||||||
ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers, disabled_mask,
|
ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers, disabled_mask,
|
||||||
list, &head, &tail);
|
co_list, &head, &tail);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We also need cipher aliases for selecting based on the rule_str.
|
* We also need cipher aliases for selecting based on the rule_str.
|
||||||
@ -798,7 +799,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
|
|||||||
(SSL_CIPHER **)OPENSSL_malloc(sizeof(SSL_CIPHER *) * num_of_alias_max);
|
(SSL_CIPHER **)OPENSSL_malloc(sizeof(SSL_CIPHER *) * num_of_alias_max);
|
||||||
if (ca_list == NULL)
|
if (ca_list == NULL)
|
||||||
{
|
{
|
||||||
OPENSSL_free(list);
|
OPENSSL_free(co_list);
|
||||||
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST,ERR_R_MALLOC_FAILURE);
|
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST,ERR_R_MALLOC_FAILURE);
|
||||||
return(NULL); /* Failure */
|
return(NULL); /* Failure */
|
||||||
}
|
}
|
||||||
@ -814,21 +815,21 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
|
|||||||
if (strncmp(rule_str,"DEFAULT",7) == 0)
|
if (strncmp(rule_str,"DEFAULT",7) == 0)
|
||||||
{
|
{
|
||||||
ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
|
ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
|
||||||
list, &head, &tail, ca_list);
|
co_list, &head, &tail, ca_list);
|
||||||
rule_p += 7;
|
rule_p += 7;
|
||||||
if (*rule_p == ':')
|
if (*rule_p == ':')
|
||||||
rule_p++;
|
rule_p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok && (strlen(rule_p) > 0))
|
if (ok && (strlen(rule_p) > 0))
|
||||||
ok = ssl_cipher_process_rulestr(rule_p, list, &head, &tail,
|
ok = ssl_cipher_process_rulestr(rule_p, co_list, &head, &tail,
|
||||||
ca_list);
|
ca_list);
|
||||||
|
|
||||||
OPENSSL_free(ca_list); /* Not needed anymore */
|
OPENSSL_free(ca_list); /* Not needed anymore */
|
||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{ /* Rule processing failure */
|
{ /* Rule processing failure */
|
||||||
OPENSSL_free(list);
|
OPENSSL_free(co_list);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -837,7 +838,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
|
|||||||
*/
|
*/
|
||||||
if ((cipherstack = sk_SSL_CIPHER_new_null()) == NULL)
|
if ((cipherstack = sk_SSL_CIPHER_new_null()) == NULL)
|
||||||
{
|
{
|
||||||
OPENSSL_free(list);
|
OPENSSL_free(co_list);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -855,7 +856,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OPENSSL_free(list); /* Not needed any longer */
|
OPENSSL_free(co_list); /* Not needed any longer */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following passage is a little bit odd. If pointer variables
|
* The following passage is a little bit odd. If pointer variables
|
||||||
|
Loading…
x
Reference in New Issue
Block a user