(krb5_get_forwarded_creds): get the local and remote address and add
them to the krb-cred packet git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6374 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -167,8 +167,9 @@ krb5_get_forwarded_creds (krb5_context context,
|
||||
in_creds,
|
||||
&out_creds);
|
||||
krb5_free_addresses (context, &addrs);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
memset (&cred, 0, sizeof(cred));
|
||||
cred.pvno = 5;
|
||||
@@ -203,14 +204,30 @@ krb5_get_forwarded_creds (krb5_context context,
|
||||
if (enc_krb_cred_part.usec == NULL) {
|
||||
ret = ENOMEM;
|
||||
goto out4;
|
||||
}
|
||||
}
|
||||
*enc_krb_cred_part.usec = usec;
|
||||
|
||||
enc_krb_cred_part.s_address = NULL; /* XXX */
|
||||
enc_krb_cred_part.r_address = NULL; /* XXX */
|
||||
ret = krb5_make_addrport (&enc_krb_cred_part.s_address,
|
||||
auth_context->local_address,
|
||||
auth_context->local_port);
|
||||
if (ret)
|
||||
goto out4;
|
||||
|
||||
ALLOC(enc_krb_cred_part.r_address, 1);
|
||||
if (enc_krb_cred_part.r_address == NULL) {
|
||||
ret = ENOMEM;
|
||||
goto out4;
|
||||
}
|
||||
|
||||
ret = krb5_copy_address (context, auth_context->remote_address,
|
||||
enc_krb_cred_part.r_address);
|
||||
if (ret)
|
||||
goto out4;
|
||||
|
||||
/* fill ticket_info.val[0] */
|
||||
|
||||
enc_krb_cred_part.ticket_info.len = 1;
|
||||
|
||||
krb_cred_info = enc_krb_cred_part.ticket_info.val;
|
||||
|
||||
copy_EncryptionKey (&out_creds->session, &krb_cred_info->key);
|
||||
|
Reference in New Issue
Block a user