Deleted Added
full compact
hip_55.c (234010) hip_55.c (262706)
1/*
1/*
2 * Copyright (C) 2009, 2011 Internet Systems Consortium, Inc. ("ISC")
2 * Copyright (C) 2009, 2011, 2013 Internet Systems Consortium, Inc. ("ISC")
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,

--- 60 unchanged lines hidden (view full) ---

71 RETTOK(isc_hex_decodestring(DNS_AS_STR(token), target));
72
73 /*
74 * Fill in HIT len.
75 */
76 len = (unsigned char *)isc_buffer_used(target) - start;
77 if (len > 0xffU)
78 RETTOK(ISC_R_RANGE);
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,

--- 60 unchanged lines hidden (view full) ---

71 RETTOK(isc_hex_decodestring(DNS_AS_STR(token), target));
72
73 /*
74 * Fill in HIT len.
75 */
76 len = (unsigned char *)isc_buffer_used(target) - start;
77 if (len > 0xffU)
78 RETTOK(ISC_R_RANGE);
79 RETERR(uint8_tobuffer(len, &hit_len));
79 RETERR(uint8_tobuffer((isc_uint32_t)len, &hit_len));
80
81 /*
82 * Public key (base64).
83 */
84 start = isc_buffer_used(target);
85 RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
86 ISC_FALSE));
87 RETTOK(isc_base64_decodestring(DNS_AS_STR(token), target));
88
89 /*
90 * Fill in KEY len.
91 */
92 len = (unsigned char *)isc_buffer_used(target) - start;
93 if (len > 0xffffU)
94 RETTOK(ISC_R_RANGE);
80
81 /*
82 * Public key (base64).
83 */
84 start = isc_buffer_used(target);
85 RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
86 ISC_FALSE));
87 RETTOK(isc_base64_decodestring(DNS_AS_STR(token), target));
88
89 /*
90 * Fill in KEY len.
91 */
92 len = (unsigned char *)isc_buffer_used(target) - start;
93 if (len > 0xffffU)
94 RETTOK(ISC_R_RANGE);
95 RETERR(uint16_tobuffer(len, &key_len));
95 RETERR(uint16_tobuffer((isc_uint32_t)len, &key_len));
96
97 /*
98 * Rendezvous Servers.
99 */
100 dns_name_init(&name, NULL);
101 do {
102 RETERR(isc_lex_getmastertoken(lexer, &token,
103 isc_tokentype_string,

--- 13 unchanged lines hidden (view full) ---

117
118 return (ISC_R_SUCCESS);
119}
120
121static inline isc_result_t
122totext_hip(ARGS_TOTEXT) {
123 isc_region_t region;
124 dns_name_t name;
96
97 /*
98 * Rendezvous Servers.
99 */
100 dns_name_init(&name, NULL);
101 do {
102 RETERR(isc_lex_getmastertoken(lexer, &token,
103 isc_tokentype_string,

--- 13 unchanged lines hidden (view full) ---

117
118 return (ISC_R_SUCCESS);
119}
120
121static inline isc_result_t
122totext_hip(ARGS_TOTEXT) {
123 isc_region_t region;
124 dns_name_t name;
125 size_t length, key_len, hit_len;
125 unsigned int length, key_len, hit_len;
126 unsigned char algorithm;
127 char buf[sizeof("225 ")];
128
129 REQUIRE(rdata->type == 55);
130 REQUIRE(rdata->length != 0);
131
132 dns_rdata_toregion(rdata, &region);
133

--- 373 unchanged lines hidden ---
126 unsigned char algorithm;
127 char buf[sizeof("225 ")];
128
129 REQUIRE(rdata->type == 55);
130 REQUIRE(rdata->length != 0);
131
132 dns_rdata_toregion(rdata, &region);
133

--- 373 unchanged lines hidden ---