version 1.127, 2016/10/10 19:28:48 |
version 1.128, 2017/02/03 23:01:19 |
|
|
/* |
/* |
* Assemble a list of algorithms from a default list and a string from a |
* Assemble a list of algorithms from a default list and a string from a |
* configuration file. The user-provided string may begin with '+' to |
* configuration file. The user-provided string may begin with '+' to |
* indicate that it should be appended to the default. |
* indicate that it should be appended to the default or '-' that the |
|
* specified names should be removed. |
*/ |
*/ |
int |
int |
kex_assemble_names(const char *def, char **list) |
kex_assemble_names(const char *def, char **list) |
|
|
*list = strdup(def); |
*list = strdup(def); |
return 0; |
return 0; |
} |
} |
if (**list != '+') { |
if (**list == '+') { |
return 0; |
if ((ret = kex_names_cat(def, *list + 1)) == NULL) |
|
return SSH_ERR_ALLOC_FAIL; |
|
free(*list); |
|
*list = ret; |
|
} else if (**list == '-') { |
|
if ((ret = match_filter_list(def, *list + 1)) == NULL) |
|
return SSH_ERR_ALLOC_FAIL; |
|
free(*list); |
|
*list = ret; |
} |
} |
|
|
if ((ret = kex_names_cat(def, *list + 1)) == NULL) |
|
return SSH_ERR_ALLOC_FAIL; |
|
free(*list); |
|
*list = ret; |
|
return 0; |
return 0; |
} |
} |
|
|