Set cksumtype.

Functions for handling addresses


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2099 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-07-09 04:55:30 +00:00
parent 4ebf838e7d
commit b3ca17767c

View File

@@ -16,8 +16,10 @@ krb5_auth_con_init(krb5_context context,
if (!p->authenticator) if (!p->authenticator)
return ENOMEM; return ENOMEM;
p->flags = KRB5_AUTH_CONTEXT_DO_TIME; p->flags = KRB5_AUTH_CONTEXT_DO_TIME;
p->cksumtype = CKSUMTYPE_RSA_MD4_DES; p->cksumtype = CKSUMTYPE_RSA_MD4; /* XXX - CKSUMTYPE_RSA_MD4_DES */;
p->enctype = ETYPE_DES_CBC_CRC; p->enctype = ETYPE_DES_CBC_CRC;
p->local_address = NULL;
p->remote_address = NULL;
*auth_context = p; *auth_context = p;
return 0; return 0;
} }
@@ -57,14 +59,16 @@ krb5_auth_con_setaddrs(krb5_context context,
krb5_address *local_addr, krb5_address *local_addr,
krb5_address *remote_addr) krb5_address *remote_addr)
{ {
auth_context->local_address.addr_type = local_addr->addr_type; if (local_addr) {
krb5_data_copy (&auth_context->local_address.address, if (auth_context->local_address)
local_addr->address.data, krb5_free_address (context, auth_context->local_address);
local_addr->address.length); krb5_copy_address(context, local_addr, auth_context->local_address);
auth_context->remote_address.addr_type = remote_addr->addr_type; }
krb5_data_copy (&auth_context->remote_address.address, if (remote_addr) {
remote_addr->address.data, if (auth_context->remote_address)
remote_addr->address.length); krb5_free_address (context, auth_context->remote_address);
krb5_copy_address(context, remote_addr, auth_context->remote_address);
}
return 0; return 0;
} }
@@ -82,25 +86,18 @@ krb5_auth_con_getaddrs(krb5_context context,
*local_addr = malloc (sizeof(**local_addr)); *local_addr = malloc (sizeof(**local_addr));
if (*local_addr == NULL) if (*local_addr == NULL)
return ENOMEM; return ENOMEM;
(*local_addr)->addr_type = auth_context->local_address.addr_type; krb5_copy_address(context,
ret = krb5_data_copy (&(*local_addr)->address, auth_context->local_address,
auth_context->local_address.address.data, *local_addr);
auth_context->local_address.address.length);
if (ret)
return ret;
if(*remote_addr) if(*remote_addr)
krb5_free_address (context, *remote_addr); krb5_free_address (context, *remote_addr);
*remote_addr = malloc (sizeof(**remote_addr)); *remote_addr = malloc (sizeof(**remote_addr));
if (*remote_addr == NULL) if (*remote_addr == NULL)
return ENOMEM; return ENOMEM;
(*remote_addr)->addr_type = auth_context->remote_address.addr_type; krb5_copy_address(context,
ret = krb5_data_copy (&(*remote_addr)->address, auth_context->remote_address,
auth_context->remote_address.address.data, *remote_addr);
auth_context->remote_address.address.length);
if (ret)
return ret;
return 0; return 0;
} }