tsig.c revision 76c8294c81fb48b1da6e1fc5b83322a4cedb8e58
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * Copyright (C) 1999-2001 Internet Software Consortium.
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * Permission to use, copy, modify, and distribute this software for any
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * purpose with or without fee is hereby granted, provided that the above
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * copyright notice and this permission notice appear in all copies.
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt * $Id: tsig.c,v 1.112 2001/08/08 22:54:44 gson Exp $
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt#include <isc/string.h> /* Required for HP/UX (and others?) */
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt#define VALID_TSIG_KEY(x) ISC_MAGIC_VALID(x, TSIG_MAGIC)
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt#define is_response(msg) (msg->flags & DNS_MESSAGEFLAG_QR)
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Huntstatic unsigned char hmacmd5_ndata[] = "\010hmac-md5\007sig-alg\003reg\003int";
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Huntstatic unsigned char hmacmd5_offsets[] = { 0, 9, 17, 21, 25 };
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Huntstatic unsigned char gsstsig_ndata[] = "\010gss-tsig";
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt/* It's nice of Microsoft to conform to their own standard. */
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Huntstatic unsigned char gsstsigms_ndata[] = "\003gss\011microsoft\003com";
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Huntstatic unsigned char gsstsigms_offsets[] = { 0, 4, 14, 18 };
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunttsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg);
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunttsig_log(dns_tsigkey_t *key, int level, const char *fmt, ...)
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunttsig_log(dns_tsigkey_t *key, int level, const char *fmt, ...) {
unsigned int refs = 0;
return (ISC_R_NOMEMORY);
goto cleanup_key;
goto cleanup_name;
goto cleanup_name;
goto cleanup_algorithm;
goto cleanup_algorithm;
goto cleanup_algorithm;
goto cleanup_algorithm;
refs++;
refs++;
namestr);
return (ISC_R_SUCCESS);
return (ret);
if (length > 0)
return (DNS_R_BADALG);
isc_buffer_t b;
return (result);
return (result);
unsigned int refs;
if (refs == 0)
isc_region_t r;
unsigned int sigsize = 0;
return (DNS_R_EXPECTEDTSIG);
return (ret);
goto cleanup_context;
NULL);
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_signature;
goto cleanup_signature;
goto cleanup_signature;
goto cleanup_dynbuf;
goto cleanup_dynbuf;
goto cleanup_owner;
goto cleanup_owner;
goto cleanup_owner;
return (ISC_R_SUCCESS);
return (ret);
return (DNS_R_EXPECTEDTSIG);
return (DNS_R_UNEXPECTEDTSIG);
return (ret);
return (ret);
return (ret);
return (ret);
return (DNS_R_TSIGVERIFYFAILURE);
return (ret);
return (DNS_R_TSIGVERIFYFAILURE);
return (DNS_R_CLOCKSKEW);
return (DNS_R_CLOCKSKEW);
return (ret);
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
return (DNS_R_TSIGVERIFYFAILURE);
return (DNS_R_CLOCKSKEW);
return (DNS_R_TSIGERRORSET);
return (ISC_R_SUCCESS);
return (ret);
static isc_result_t
return (ret);
return (ret);
goto cleanup_querystruct;
goto cleanup_querystruct;
goto cleanup_querystruct;
goto cleanup_querystruct;
goto cleanup_querystruct;
goto cleanup_querystruct;
goto cleanup_context;
goto cleanup_context;
if (has_tsig) {
if (has_tsig) {
goto cleanup_context;
if (has_tsig)
goto cleanup_context;
if (has_tsig) {
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
goto cleanup_context;
return (ISC_R_SUCCESS);
return (ret);
return (ISC_R_NOTFOUND);
return (ISC_R_NOTFOUND);
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
return (ISC_R_NOMEMORY);
return (ISC_R_UNEXPECTED);
return (result);
return (ISC_R_SUCCESS);