Clean up the distinction between krb5_enctype and int, and between
krb5_key_usage and unsigned. These patches are necessary for platforms with short enums, and should already be in Heimdal CVS.
This commit is contained in:
parent
16189b5a23
commit
57a0815fae
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include "kdc_locl.h"
|
||||
|
||||
RCSID("$Id: kerberos5.c,v 1.4 2001/09/17 12:32:36 assar Exp $");
|
||||
RCSID("$Id: kerberos5.c,v 1.5 2002/02/10 15:31:18 bjh21 Exp $");
|
||||
|
||||
#define MAX_TIME ((time_t)((1U << 31) - 1))
|
||||
|
||||
|
@ -109,7 +109,7 @@ find_keys(hdb_entry *client,
|
|||
krb5_enctype *cetype,
|
||||
Key **skey,
|
||||
krb5_enctype *setype,
|
||||
int *etypes,
|
||||
krb5_enctype *etypes,
|
||||
unsigned num_etypes)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include "krb5_locl.h"
|
||||
RCSID("$Id: crypto.c,v 1.7 2001/09/17 12:32:38 assar Exp $");
|
||||
RCSID("$Id: crypto.c,v 1.8 2002/02/10 15:31:19 bjh21 Exp $");
|
||||
|
||||
#undef CRYPTO_DEBUG
|
||||
#ifdef CRYPTO_DEBUG
|
||||
|
@ -1447,7 +1447,7 @@ do_checksum (krb5_context context,
|
|||
static krb5_error_code
|
||||
create_checksum(krb5_context context,
|
||||
krb5_crypto crypto,
|
||||
krb5_key_usage usage, /* not krb5_key_usage */
|
||||
unsigned usage, /* not krb5_key_usage */
|
||||
krb5_cksumtype type, /* 0 -> pick from crypto */
|
||||
void *data,
|
||||
size_t len,
|
||||
|
@ -2143,18 +2143,18 @@ krb5_error_code
|
|||
krb5_keytype_to_enctypes (krb5_context context,
|
||||
krb5_keytype keytype,
|
||||
unsigned *len,
|
||||
int **val)
|
||||
krb5_enctype **val)
|
||||
{
|
||||
int i;
|
||||
unsigned n = 0;
|
||||
int *ret;
|
||||
krb5_enctype *ret;
|
||||
|
||||
for (i = num_etypes - 1; i >= 0; --i) {
|
||||
if (etypes[i]->keytype->type == keytype
|
||||
&& !(etypes[i]->flags & F_PSEUDO))
|
||||
++n;
|
||||
}
|
||||
ret = malloc(n * sizeof(int));
|
||||
ret = malloc(n * sizeof(*ret));
|
||||
if (ret == NULL && n != 0) {
|
||||
krb5_set_error_string(context, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
|
@ -2179,10 +2179,10 @@ krb5_error_code
|
|||
krb5_keytype_to_enctypes_default (krb5_context context,
|
||||
krb5_keytype keytype,
|
||||
unsigned *len,
|
||||
int **val)
|
||||
krb5_enctype **val)
|
||||
{
|
||||
int i, n;
|
||||
int *ret;
|
||||
krb5_enctype *ret;
|
||||
|
||||
if (keytype != KEYTYPE_DES || context->etypes_des == NULL)
|
||||
return krb5_keytype_to_enctypes (context, keytype, len, val);
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
|
||||
#include "krb5_locl.h"
|
||||
|
||||
RCSID("$Id: get_in_tkt.c,v 1.1.1.5 2001/09/17 12:25:03 assar Exp $");
|
||||
RCSID("$Id: get_in_tkt.c,v 1.2 2002/02/10 15:31:20 bjh21 Exp $");
|
||||
|
||||
krb5_error_code
|
||||
krb5_init_etype (krb5_context context,
|
||||
unsigned *len,
|
||||
int **val,
|
||||
krb5_enctype **val,
|
||||
const krb5_enctype *etypes)
|
||||
{
|
||||
int i;
|
||||
|
@ -58,7 +58,7 @@ krb5_init_etype (krb5_context context,
|
|||
for (i = 0; tmp[i]; ++i)
|
||||
;
|
||||
*len = i;
|
||||
*val = malloc(i * sizeof(int));
|
||||
*val = malloc(i * sizeof(**val));
|
||||
if (i != 0 && *val == NULL) {
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_string(context, "malloc: out of memory");
|
||||
|
@ -370,14 +370,14 @@ add_padata(krb5_context context,
|
|||
krb5_principal client,
|
||||
krb5_key_proc key_proc,
|
||||
krb5_const_pointer keyseed,
|
||||
int *enctypes,
|
||||
krb5_enctype *enctypes,
|
||||
unsigned netypes,
|
||||
krb5_salt *salt)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
PA_DATA *pa2;
|
||||
krb5_salt salt2;
|
||||
int *ep;
|
||||
krb5_enctype *ep;
|
||||
int i;
|
||||
|
||||
if(salt == NULL) {
|
||||
|
@ -386,7 +386,7 @@ add_padata(krb5_context context,
|
|||
salt = &salt2;
|
||||
}
|
||||
if (!enctypes) {
|
||||
enctypes = (int *)context->etypes; /* XXX */
|
||||
enctypes = context->etypes;
|
||||
netypes = 0;
|
||||
for (ep = enctypes; *ep != ETYPE_NULL; ep++)
|
||||
netypes++;
|
||||
|
|
|
@ -1603,7 +1603,7 @@ krb5_error_code
|
|||
krb5_init_etype __P((
|
||||
krb5_context context,
|
||||
unsigned *len,
|
||||
int **val,
|
||||
krb5_enctype **val,
|
||||
const krb5_enctype *etypes));
|
||||
|
||||
krb5_error_code
|
||||
|
@ -1633,14 +1633,14 @@ krb5_keytype_to_enctypes __P((
|
|||
krb5_context context,
|
||||
krb5_keytype keytype,
|
||||
unsigned *len,
|
||||
int **val));
|
||||
krb5_enctype **val));
|
||||
|
||||
krb5_error_code
|
||||
krb5_keytype_to_enctypes_default __P((
|
||||
krb5_context context,
|
||||
krb5_keytype keytype,
|
||||
unsigned *len,
|
||||
int **val));
|
||||
krb5_enctype **val));
|
||||
|
||||
krb5_error_code
|
||||
krb5_keytype_to_string __P((
|
||||
|
|
Loading…
Reference in New Issue