gsstest.c revision 1b2ae58ef163d9369ac1b693dde667ec49627ad9
/*
* Copyright (C) 2006, 2007, 2009-2011, 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: gsstest.c,v 1.19 2011/11/30 00:48:51 marka Exp $ */
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <isc/sockaddr.h>
#include <dns/dispatch.h>
#include <dns/fixedname.h>
#include <dns/keyvalues.h>
#include <dns/masterdump.h>
#include <dns/rdataset.h>
#include <dns/resolver.h>
#ifdef GSSAPI
#include ISC_PLATFORM_GSSAPIHEADER
struct dst_context {
unsigned int magic;
void *opaque;
};
if ((x) != ISC_R_SUCCESS) { \
goto end; \
} \
}
static dns_requestmgr_t *requestmgr;
static isc_sockaddr_t address;
static dns_tsig_keyring_t *ring;
static gss_ctx_id_t gssctx;
#define PORT 53
#define TIMEOUT 30
static void setup();
static void
{
char buf[32];
int c;
for (;;) {
printf("\nCommand => ");
return;
}
return;
}
return;
}
printf("Unknown command\n");
}
}
static void
goto end;
}
printf("\nReceived Response:\n");
&outbuf);
(char *)isc_buffer_base(&outbuf));
end:
sizeof(*event));
return;
}
static void
{
static char host[256];
int c;
printf("Query => ");
if (c == EOF)
return;
dns_rootname, 0, NULL);
if (result != ISC_R_SUCCESS)
goto end;
if (result != ISC_R_SUCCESS)
goto end;
if (result != ISC_R_SUCCESS)
goto end;
printf("Submitting query:\n");
&outbuf);
(char *)isc_buffer_base(&outbuf));
return;
end:
}
static void
goto end;
}
goto end;
}
printf("Received token from server, calling gss_init_sec_context()\n");
printf("Context accepted\n");
if (qtype == dns_rdatatype_tkey) {
printf("Received TKEY response from server\n");
printf("Context completed\n");
} else {
printf("Did not receive TKEY response from server\n");
printf("Context not completed\n");
}
end:
sizeof(*event));
return;
}
static void
char gssid[512];
char contextname[512];
int c;
printf("Initctx - GSS name => ");
if (c == EOF)
return;
printf("Negotiating GSSAPI context: ");
printf("\n");
/*
* Setup a GSSAPI context with the server
*/
dns_rootname, 0, NULL);
/* Make name happen */
dns_rootname, 0, NULL);
printf("Calling gss_init_sec_context()\n");
printf("Sending context token to server\n");
return;
end:
sizeof(*event));
}
static void
setup(void)
{
for (;;) {
char serveraddress[512];
int c;
printf("Server IP => ");
return;
}
return;
}
}
}
int
/*
* Create and install the default channel.
*/
dispatchmgr = NULL;
dispatchv4 = NULL;
requestmgr = NULL;
&requestmgr));
&sock));
setup();
(void)isc_app_run();
if (tsigkey)
return (0);
}
#else
int
return (0);
}
#endif