openssldsa_link.c revision dafcb997e390efa4423883dafd100c975c4095d6
/*
* Portions Copyright (C) 2004 Internet System Consortium, Inc. ("ISC")
* Portions Copyright (C) 1999-2002 Internet Software Consortium.
* Portions Copyright (C) 1995-2000 by Network Associates, Inc.
*
* Permission to use, copy, modify, and distribute this software for any
* 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 AND NETWORK ASSOCIATES 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: openssldsa_link.c,v 1.14 2004/03/05 05:10:31 marka Exp $ */
#ifdef OPENSSL
#include <config.h>
#include <string.h>
#include "dst_internal.h"
#include "dst_openssl.h"
#include "dst_parse.h"
static isc_result_t
return (ISC_R_SUCCESS);
}
static void
}
}
static isc_result_t
return (ISC_R_SUCCESS);
}
static int
while (bytes-- > 0)
*buf++ = 0;
return (size);
}
static isc_result_t
isc_region_t r;
unsigned char digest[ISC_SHA1_DIGESTLENGTH];
return (ISC_R_NOSPACE);
return (dst__openssl_toresult(DST_R_SIGNFAILURE));
r.base += ISC_SHA1_DIGESTLENGTH;
r.base += ISC_SHA1_DIGESTLENGTH;
return (ISC_R_SUCCESS);
}
static isc_result_t
int status = 0;
unsigned char digest[ISC_SHA1_DIGESTLENGTH];
return (DST_R_VERIFYFAILURE);
cp++; /* Skip T */
dsasig = DSA_SIG_new();
if (status == 0)
return (dst__openssl_toresult(DST_R_VERIFYFAILURE));
return (ISC_R_SUCCESS);
}
static isc_boolean_t
int status;
return (ISC_TRUE);
return (ISC_FALSE);
if (status != 0)
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_FALSE);
}
return (ISC_TRUE);
}
static isc_result_t
unsigned char rand_array[ISC_SHA1_DIGESTLENGTH];
if (result != ISC_R_SUCCESS)
return (result);
return (dst__openssl_toresult(DST_R_OPENSSLFAILURE));
if (DSA_generate_key(dsa) == 0) {
return (dst__openssl_toresult(DST_R_OPENSSLFAILURE));
}
return (ISC_R_SUCCESS);
}
static isc_boolean_t
}
static void
}
static isc_result_t
isc_region_t r;
int dnslen;
unsigned int t, p_bytes;
if (t > 8)
return (DST_R_INVALIDPUBLICKEY);
return (ISC_R_NOSPACE);
*r.base++ = t;
r.base += ISC_SHA1_DIGESTLENGTH;
return (ISC_R_SUCCESS);
}
static isc_result_t
isc_region_t r;
unsigned int t, p_bytes;
if (r.length == 0)
return (ISC_R_SUCCESS);
return (ISC_R_NOMEMORY);
t = (unsigned int) *r.base++;
if (t > 8) {
return (DST_R_INVALIDPUBLICKEY);
}
return (DST_R_INVALIDPUBLICKEY);
}
r.base += ISC_SHA1_DIGESTLENGTH;
return (ISC_R_SUCCESS);
}
static isc_result_t
int cnt = 0;
return (DST_R_NULLKEY);
cnt++;
cnt++;
cnt++;
cnt++;
cnt++;
}
static isc_result_t
int i;
/* read private key file */
if (ret != ISC_R_SUCCESS)
return (ret);
case TAG_DSA_PRIME:
break;
case TAG_DSA_SUBPRIME:
break;
case TAG_DSA_BASE:
break;
case TAG_DSA_PRIVATE:
break;
case TAG_DSA_PUBLIC:
break;
}
}
return (ISC_R_SUCCESS);
err:
return (ret);
}
static dst_func_t openssldsa_functions = {
NULL, /* computesecret */
NULL, /* paramcompare */
NULL, /* cleanup */
};
return (ISC_R_SUCCESS);
}
#else /* OPENSSL */
#endif /* OPENSSL */