local_fulladdr.contents = remote_fulladdr.contents = NULL;
/* Determine the remote comparison address. */
- if (ac->remote_port != NULL) {
- ret = krb5_make_fulladdr(context, ac->remote_addr, ac->remote_port,
- &remote_fulladdr);
- if (ret)
- goto cleanup;
- remote_addr = &remote_fulladdr;
+ if (ac->remote_addr != NULL) {
+ if (ac->remote_port != NULL) {
+ ret = krb5_make_fulladdr(context, ac->remote_addr, ac->remote_port,
+ &remote_fulladdr);
+ if (ret)
+ goto cleanup;
+ remote_addr = &remote_fulladdr;
+ } else
+ remote_addr = ac->remote_addr;
} else
- remote_addr = ac->remote_addr;
+ remote_addr = NULL;
/* Determine the local comparison address (possibly NULL). */
if (ac->local_addr != NULL) {
local_addr = NULL;
/* Check the remote address against the message's sender address. */
- if (!krb5_address_compare(context, remote_addr, msg_s_addr)) {
+ if (remote_addr != NULL &&
+ !krb5_address_compare(context, remote_addr, msg_s_addr)) {
ret = KRB5KRB_AP_ERR_BADADDR;
goto cleanup;
}
/* Need a better error */
return KRB5_RC_REQUIRED;
- if (!auth_context->remote_addr)
+ if ((auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_TIME) &&
+ (auth_context->remote_addr == NULL))
return KRB5_REMOTE_ADDR_REQUIRED;
if ((auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_TIME) &&
/* Need a better error */
return KRB5_RC_REQUIRED;
+ if ((auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_TIME) &&
+ (auth_context->remote_addr == NULL))
+ return KRB5_REMOTE_ADDR_REQUIRED;
+
if ((auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_TIME) &&
(auth_context->rcache == NULL))
return KRB5_RC_REQUIRED;
- if (!auth_context->remote_addr)
- return KRB5_REMOTE_ADDR_REQUIRED;
-
/* Get key */
if ((key = auth_context->recv_subkey) == NULL)
key = auth_context->key;