(krb5_rd_cred): compare the sender's address as an addrport one
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6376 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997 - 1999 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -91,12 +91,28 @@ krb5_rd_cred (krb5_context context,
|
|||||||
/* check sender address */
|
/* check sender address */
|
||||||
|
|
||||||
if (enc_krb_cred_part.s_address
|
if (enc_krb_cred_part.s_address
|
||||||
&& auth_context->remote_address
|
&& auth_context->remote_address) {
|
||||||
&& !krb5_address_compare (context,
|
krb5_address *a;
|
||||||
|
int cmp;
|
||||||
|
|
||||||
|
ret = krb5_make_addrport (&a,
|
||||||
auth_context->remote_address,
|
auth_context->remote_address,
|
||||||
enc_krb_cred_part.s_address)) {
|
auth_context->remote_port);
|
||||||
ret = KRB5KRB_AP_ERR_BADADDR;
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
||||||
|
cmp = krb5_address_compare (context,
|
||||||
|
a,
|
||||||
|
enc_krb_cred_part.s_address);
|
||||||
|
|
||||||
|
krb5_free_address (context, a);
|
||||||
|
free (a);
|
||||||
|
|
||||||
|
if (cmp == 0) {
|
||||||
|
ret = KRB5KRB_AP_ERR_BADADDR;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check receiver address */
|
/* check receiver address */
|
||||||
|
Reference in New Issue
Block a user