sshfp_44.c revision a134177ed9f82189504191d90f3ed9e97c2b47cb
5cd4555ad444fd391002ae32450572054369fd42Rob Austein * Copyright (C) 2003, 2004, 2006, 2007, 2009, 2011-2013, 2015-2017 Internet Systems Consortium, Inc. ("ISC")
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson * This Source Code Form is subject to the terms of the Mozilla Public
938440694b33cd752e9e4b71a526368b4811c177Tinderbox User * License, v. 2.0. If a copy of the MPL was not distributed with this
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Algorithm.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews RETERR(uint8_tobuffer(token.value.as_ulong, target));
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Digest type.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein RETERR(uint8_tobuffer(token.value.as_ulong, target));
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein unsigned int n;
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson REQUIRE(rdata->type == dns_rdatatype_sshfp);
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Algorithm.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Digest type.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson RETERR(str_totext(tctx->linebreak, target));
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson RETERR(isc_hex_totext(&sr, 0, "", target));
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein return (mem_tobuffer(target, sr.base, sr.length));
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein return (mem_tobuffer(target, sr.base, sr.length));
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinstatic inline int
8eea877894ea5bcf5cdd9ca124a8601ad421d753Andreas Gustafsson RETERR(uint8_tobuffer(sshfp->algorithm, target));
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson RETERR(uint8_tobuffer(sshfp->digest_type, target));
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein return (mem_tobuffer(target, sshfp->digest, sshfp->length));
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafsson sshfp->digest_type = uint8_fromregion(®ion);
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein sshfp->digest = mem_maybedup(mctx, region.base, region.length);
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinstatic inline void