/*
* Copyright (C) 2004-2008, 2011, 2012, 2014 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2002 Internet Software Consortium.
*
* 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$
*/
#include <config.h>
#ifdef GSSAPI
#include "dst_internal.h"
#include "dst_parse.h"
do { \
} while (0)
struct dst_gssapi_signverifyctx {
};
/*%
* Allocate a temporary "context" for use in gathering data for signing
* or verifying.
*/
static isc_result_t
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS) {
return (result);
}
return (ISC_R_SUCCESS);
}
/*%
*/
static void
}
}
/*%
* Add data to our running buffer of data we will be signing or verifying.
* This code will see if the new data will fit in our existing buffer, and
* copy it in if it will. If not, it will attempt to allocate a larger
* buffer and copy old+new into it, and free the old buffer.
*/
static isc_result_t
isc_region_t r;
unsigned int length;
if (result == ISC_R_SUCCESS)
return (ISC_R_SUCCESS);
if (result != ISC_R_SUCCESS)
return (result);
(void)isc_buffer_copyregion(newbuffer, &r);
return (ISC_R_SUCCESS);
}
/*%
* Sign.
*/
static isc_result_t
/*
* Convert the data we wish to sign into a structure gssapi can
* understand.
*/
/*
* Generate the signature.
*/
&gsig);
/*
* If it did not complete, we log the result and return a generic
* failure code.
*/
if (gret != GSS_S_COMPLETE) {
return (ISC_R_FAILURE);
}
/*
* If it will not fit in our allocated buffer, return that we need
* more space.
*/
return (ISC_R_NOSPACE);
}
/*
* Copy the output into our buffer space, and release the gssapi
* allocated space.
*/
return (ISC_R_SUCCESS);
}
/*%
* Verify.
*/
static isc_result_t
unsigned char *buf;
/*
* Convert the data we wish to sign into a structure gssapi can
* understand.
*/
/*
* XXXMLG
* It seem that gss_verify_mic() modifies the signature buffer,
* at least on Heimdal's implementation. Copy it here to an allocated
* buffer.
*/
return (ISC_R_FAILURE);
REGION_TO_GBUFFER(r, gsig);
/*
* Verify the data.
*/
/*
* Convert return codes into something useful to us.
*/
if (gret != GSS_S_COMPLETE) {
if (gret == GSS_S_DEFECTIVE_TOKEN ||
gret == GSS_S_BAD_SIG ||
gret == GSS_S_DUPLICATE_TOKEN ||
gret == GSS_S_OLD_TOKEN ||
gret == GSS_S_UNSEQ_TOKEN ||
gret == GSS_S_GAP_TOKEN ||
gret == GSS_S_CONTEXT_EXPIRED ||
gret == GSS_S_NO_CONTEXT ||
gret == GSS_S_FAILURE)
return(DST_R_VERIFYFAILURE);
else
return (ISC_R_FAILURE);
}
return (ISC_R_SUCCESS);
}
static isc_boolean_t
/* No idea */
}
static isc_result_t
/* No idea */
return (ISC_R_FAILURE);
}
static isc_boolean_t
return (ISC_TRUE);
}
static void
}
NULL, /*%< computesecret */
NULL, /*%< paramcompare */
NULL, /*%< todns */
NULL, /*%< fromdns */
NULL, /*%< tofile */
NULL, /*%< parse */
NULL, /*%< cleanup */
NULL /*%< fromlabel */
};
*funcp = &gssapi_functions;
return (ISC_R_SUCCESS);
}
#else
#endif
/*! \file */