keydata_65533.c revision 6fb9b25791778f69002eb72be6235e20d98ec452
f1c89cb4f5c72c54bb67dc48cd6f2b332eab9e92Automatic Updater * Copyright (C) 2009, 2011-2013, 2015-2017 Internet Systems Consortium, Inc. ("ISC")
f1c89cb4f5c72c54bb67dc48cd6f2b332eab9e92Automatic Updater * This Source Code Form is subject to the terms of the Mozilla Public
f1c89cb4f5c72c54bb67dc48cd6f2b332eab9e92Automatic Updater * License, v. 2.0. If a copy of the MPL was not distributed with this
f1c89cb4f5c72c54bb67dc48cd6f2b332eab9e92Automatic Updater * file, You can obtain one at http://mozilla.org/MPL/2.0/.
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* refresh timer */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &refresh));
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* add hold-down */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &addhd));
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* remove hold-down */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &removehd));
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETTOK(dns_keyflags_fromtext(&flags, &token.value.as_textregion));
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* protocol */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETTOK(dns_secproto_fromtext(&proto, &token.value.as_textregion));
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* algorithm */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETTOK(dns_secalg_fromtext(&alg, &token.value.as_textregion));
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* No Key? */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* Ensure there's at least enough data to compute a key ID for MD5 */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt if (alg == DST_ALG_RSAMD5 && isc_buffer_usedlength(target) < 19)
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt unsigned int flags;
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt unsigned char algorithm;
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt const char *keyinfo;
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt if ((tctx->flags & DNS_STYLEFLAG_KEYDATA) == 0 || rdata->length < 16)
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* refresh timer */
79ce3a9e82384cc31fd6b86be8f3d1474fcfd9f4Evan Hunt /* add hold-down */
87002e151b8507e2deb8a72e475b77a87cb35045Automatic Updater /* remove hold-down */
79ce3a9e82384cc31fd6b86be8f3d1474fcfd9f4Evan Hunt /* protocol */
79ce3a9e82384cc31fd6b86be8f3d1474fcfd9f4Evan Hunt /* algorithm */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* No Key? */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt else if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0) {
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt dns_secalg_format((dns_secalg_t) algorithm, algbuf,
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* Skip over refresh, addhd, and removehd */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt sprintf(buf, "%u", dst_region_computeid(&tmpr, algorithm));
c6f4972c745f8903aba6dcca41f17a44c473db66Mark Andrews if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
c6f4972c745f8903aba6dcca41f17a44c473db66Mark Andrews RETERR(str_totext("; next refresh: ", target));
c6f4972c745f8903aba6dcca41f17a44c473db66Mark Andrews isc_time_formathttptimestamp(&t, rbuf, sizeof(rbuf));
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt if (add == 0U) {
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt return (mem_tobuffer(target, sr.base, sr.length));
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt return (mem_tobuffer(target, sr.base, sr.length));
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Huntstatic inline int
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* Refresh timer */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt RETERR(uint32_tobuffer(keydata->refresh, target));
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* Add hold-down */
0b24b2d3c423560a0a4cd9a4476b9a2dcafb7ea3Evan Hunt /* Remove hold-down */
static inline isc_result_t
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
static inline isc_result_t
return (ISC_R_SUCCESS);
static inline isc_result_t
isc_region_t r;
static inline isc_boolean_t
return (ISC_TRUE);
static inline isc_boolean_t
return (ISC_TRUE);