Slightly different function prototypes

This commit is contained in:
Willem Toorop 2017-09-21 12:38:49 +02:00
parent edba5b77f8
commit 1b47ce4d10
5 changed files with 24 additions and 93 deletions

View File

@ -734,7 +734,7 @@ void _getdns_context_equip_with_anchor(
X509_STORE *store = NULL;
if ((r = getdns_context_get_trust_anchor_verify_CA(
context, ".", &verify_CA)))
context, &verify_CA)))
DEBUG_ANCHOR("ERROR %s(): Getting trust anchor verify"
" CA: \"%s\"\n", __FUNC__
, getdns_get_errorstr_by_id(r));
@ -744,7 +744,7 @@ void _getdns_context_equip_with_anchor(
"disabled by empty verify CA\n");
else if ((r = getdns_context_get_trust_anchor_verify_email(
context, ".", &verify_email)))
context, &verify_email)))
DEBUG_ANCHOR("ERROR %s(): Getting trust anchor verify email "
"address: \"%s\"\n", __FUNC__
, getdns_get_errorstr_by_id(r));
@ -1017,7 +1017,7 @@ static void tas_doc_read(getdns_context *context, tas_connection *a)
p7s_bd.size = a->tcp.read_buf_len;
if ((r = getdns_context_get_trust_anchor_verify_CA(
context, ".", (const char **)&verify_CA.data)))
context, (const char **)&verify_CA.data)))
DEBUG_ANCHOR("ERROR %s(): Getting trust anchor verify"
" CA: \"%s\"\n", __FUNC__
, getdns_get_errorstr_by_id(r));
@ -1026,7 +1026,7 @@ static void tas_doc_read(getdns_context *context, tas_connection *a)
; /* pass */
else if ((r = getdns_context_get_trust_anchor_verify_email(
context, ".", &verify_email)))
context, &verify_email)))
DEBUG_ANCHOR("ERROR %s(): Getting trust anchor verify"
" email address: \"%s\"\n", __FUNC__
, getdns_get_errorstr_by_id(r));
@ -1264,7 +1264,7 @@ static getdns_return_t _getdns_get_tas_url_hostname(
char *next_slash;
size_t s;
if ((r = getdns_context_get_trust_anchor_url(context, ".", &url)))
if ((r = getdns_context_get_trust_anchor_url(context, &url)))
return r;
if ((next_slash = strchr(url + 7 /* "http://" */, '/'))) {
@ -1523,7 +1523,7 @@ void _getdns_start_fetching_ta(getdns_context *context, getdns_eventloop *loop)
return;
} else if ((r = getdns_context_get_trust_anchor_verify_CA(
context, ".", &verify_CA))) {
context, &verify_CA))) {
DEBUG_ANCHOR("ERROR %s(): Could not get verify CA"
": \"%s\"", __FUNC__
, getdns_get_errorstr_by_id(r));
@ -1535,7 +1535,7 @@ void _getdns_start_fetching_ta(getdns_context *context, getdns_eventloop *loop)
return;
} else if ((r = getdns_context_get_trust_anchor_verify_email(
context, ".", &verify_email))) {
context, &verify_email))) {
DEBUG_ANCHOR("ERROR %s(): Could not get verify email address"
": \"%s\"", __FUNC__
, getdns_get_errorstr_by_id(r));

View File

@ -4828,7 +4828,7 @@ int _getdns_context_can_write_appdata(getdns_context *context)
getdns_return_t
getdns_context_set_trust_anchor_url(
getdns_context *context, const char *zone, const char *url)
getdns_context *context, const char *url)
{
const char *path;
size_t path_len;
@ -4836,9 +4836,6 @@ getdns_context_set_trust_anchor_url(
if (!context || !url)
return GETDNS_RETURN_INVALID_PARAMETER;
if (zone && !(zone[0] == '.' && zone[1] == '\0'))
return GETDNS_RETURN_NOT_IMPLEMENTED;
if (! ((url[0] == 'h' || url[0] == 'H')
&& (url[1] == 't' || url[1] == 'T')
&& (url[2] == 't' || url[2] == 'T')
@ -4862,14 +4859,11 @@ getdns_context_set_trust_anchor_url(
getdns_return_t
getdns_context_get_trust_anchor_url(
getdns_context *context, const char *zone, const char **url)
getdns_context *context, const char **url)
{
if (!context || !url)
return GETDNS_RETURN_INVALID_PARAMETER;
if (zone && (zone[0] != '.' || zone[1] != '\0'))
return GETDNS_RETURN_NOT_IMPLEMENTED;
*url = context && context->root_anchor_url
? context->root_anchor_url
: _getdns_default_root_anchor_url;
@ -4878,14 +4872,11 @@ getdns_context_get_trust_anchor_url(
getdns_return_t
getdns_context_set_trust_anchor_verify_CA(
getdns_context *context, const char *zone, const char *verify_CA)
getdns_context *context, const char *verify_CA)
{
if (!context || !verify_CA)
return GETDNS_RETURN_INVALID_PARAMETER;
if (zone && (zone[0] != '.' || zone[1] != '\0'))
return GETDNS_RETURN_NOT_IMPLEMENTED;
context->root_anchor_verify_CA = verify_CA;
dispatch_updated(context, GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_CA);
return GETDNS_RETURN_GOOD;
@ -4893,14 +4884,11 @@ getdns_context_set_trust_anchor_verify_CA(
getdns_return_t
getdns_context_get_trust_anchor_verify_CA(
getdns_context *context, const char *zone, const char **verify_CA)
getdns_context *context, const char **verify_CA)
{
if (!verify_CA)
return GETDNS_RETURN_INVALID_PARAMETER;
if (zone && (zone[0] != '.' || zone[1] != '\0'))
return GETDNS_RETURN_NOT_IMPLEMENTED;
*verify_CA = context && context->root_anchor_verify_CA
? context->root_anchor_verify_CA
: _getdns_default_root_anchor_verify_CA;
@ -4909,14 +4897,11 @@ getdns_context_get_trust_anchor_verify_CA(
getdns_return_t
getdns_context_set_trust_anchor_verify_email(
getdns_context *context, const char *zone, const char *verify_email)
getdns_context *context, const char *verify_email)
{
if (!context || !verify_email)
return GETDNS_RETURN_INVALID_PARAMETER;
if (zone && (zone[0] != '.' || zone[1] != '\0'))
return GETDNS_RETURN_NOT_IMPLEMENTED;
context->root_anchor_verify_email = verify_email;
dispatch_updated(context, GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_EMAIL);
return GETDNS_RETURN_GOOD;
@ -4924,14 +4909,11 @@ getdns_context_set_trust_anchor_verify_email(
getdns_return_t
getdns_context_get_trust_anchor_verify_email(
getdns_context *context, const char *zone, const char **verify_email)
getdns_context *context, const char **verify_email)
{
if (!verify_email)
return GETDNS_RETURN_INVALID_PARAMETER;
if (zone && (zone[0] != '.' || zone[1] != '\0'))
return GETDNS_RETURN_NOT_IMPLEMENTED;
*verify_email = context && context->root_anchor_verify_email
? context->root_anchor_verify_email
: _getdns_default_root_anchor_verify_email;

View File

@ -1851,6 +1851,10 @@ getdns_yaml2list(const char *str, getdns_list **list)
#endif /* USE_YAML_CONFIG */
}
/* WT: I don't see how the two functions below would be different from
* the str2bindata and str2int ones.
*/
#if 0
getdns_return_t
getdns_yaml2bindata(const char *str, getdns_bindata **bindata)
{
@ -1898,4 +1902,4 @@ getdns_yaml2int(const char *str, uint32_t *value)
return GETDNS_RETURN_NOT_IMPLEMENTED;
#endif /* USE_YAML_CONFIG */
}
#endif

View File

@ -548,22 +548,21 @@ getdns_context_set_logfunc(getdns_context *context, void *userarg,
*
*/
getdns_return_t
getdns_context_set_trust_anchor_url(
getdns_context *context, const char *zone, const char *url);
getdns_context_set_trust_anchor_url(getdns_context *context, const char *url);
/**
*
*/
getdns_return_t
getdns_context_set_trust_anchor_verify_CA(
getdns_context *context, const char *zone, const char *verify_CA);
getdns_context *context, const char *verify_CA);
/**
*
*/
getdns_return_t
getdns_context_set_trust_anchor_verify_email(
getdns_context *context, const char *zone, const char *verify_email);
getdns_context *context, const char *verify_email);
/**
@ -936,21 +935,21 @@ getdns_context_get_update_callback(getdns_context *context, void **userarg,
*/
getdns_return_t
getdns_context_get_trust_anchor_url(
getdns_context *context, const char *zone, const char **url);
getdns_context *context, const char **url);
/**
*
*/
getdns_return_t
getdns_context_get_trust_anchor_verify_CA(
getdns_context *context, const char *zone, const char **verify_CA);
getdns_context *context, const char **verify_CA);
/**
*
*/
getdns_return_t
getdns_context_get_trust_anchor_verify_email(
getdns_context *context, const char *zone, const char **verify_email);
getdns_context *context, const char **verify_email);
/** @}
@ -1776,58 +1775,6 @@ getdns_yaml2dict(const char *str, getdns_dict **dict);
getdns_return_t
getdns_yaml2list(const char *str, getdns_list **list);
/**
* Convert string text to a getdns_bindata.
*
* @param str A textual representation of a getdns_bindata
* The format is similar, but not precisely YAML.
* - Strings between double-quotes will be converted to bindata
* containers, but *without the trailing null byte*.
* For example: `{ suffix: [ "nlnetlabs.nl.", "nlnet.nl." ] }`
* - bindata representation of IP or IPv6 addresses may be
* given in their presentation format. For example:
* `{ dns_root_servers: [ 2001:7fd::1, 193.0.14.129 ] }`
* - Arbitrary binary data may be given with a `0x` prefix,
* or in base64 encoding.
* For example:
*
* { add_opt_parameters:
* { options: [ { option_code: 10
* , option_data: 0xA9E4EC50C03F5D65
* } ]
* }
* }
*
* - Wireformat domain name bindatas can be given with a trailing dot.
* For example:
*
* { upstream_recursive_servers:
* [ { address_data : 2a04:b900:0:100::37
* , tsig_name : hmac-md5.tsigs.getdnsapi.net.
* , tsig_algorithm: hmac-md5.sig-alg.reg.int.
* , tsig_secret : 16G69OTeXW6xSQ==
* } ]
* }
* @param bindata The returned getdns_bindata.
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
*/
getdns_return_t
getdns_yaml2bindata(const char *str, getdns_bindata **bindata);
/**
* Convert string text to a getdns 32 bits unsigned integer.
*
* @param str A textual representation of the integer.
* The format is similar, but not precisely YAML.
* - integer values may be given by the constant name.
* For example: `{ resolution_type: GETDNS_RESOLUTION_STUB }`
* or `{ specify_class: GETDNS_RRCLASS_CH }`
* @param value The returned integer.
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
*/
getdns_return_t
getdns_yaml2int(const char *str, uint32_t *value);
/** @}
*/

View File

@ -165,9 +165,7 @@ getdns_wire2msg_dict_scan
getdns_wire2rr_dict
getdns_wire2rr_dict_buf
getdns_wire2rr_dict_scan
getdns_yaml2bindata
getdns_yaml2dict
getdns_yaml2int
getdns_yaml2list
plain_mem_funcs_user_arg
priv_getdns_context_mf