(krb5_get_forwarded_creds): use KRB5_AUTH_CONTEXT_DO_TIME if we want
timestamp in forwarded krb-cred git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13191 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -163,8 +163,6 @@ krb5_get_forwarded_creds (krb5_context context,
|
|||||||
size_t len;
|
size_t len;
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
size_t buf_size;
|
size_t buf_size;
|
||||||
krb5_timestamp sec;
|
|
||||||
int32_t usec;
|
|
||||||
krb5_kdc_flags kdc_flags;
|
krb5_kdc_flags kdc_flags;
|
||||||
krb5_crypto crypto;
|
krb5_crypto crypto;
|
||||||
struct addrinfo *ai;
|
struct addrinfo *ai;
|
||||||
@@ -224,22 +222,30 @@ krb5_get_forwarded_creds (krb5_context context,
|
|||||||
goto out4;
|
goto out4;
|
||||||
}
|
}
|
||||||
|
|
||||||
krb5_us_timeofday (context, &sec, &usec);
|
if (auth_context->flags & KRB5_AUTH_CONTEXT_DO_TIME) {
|
||||||
|
krb5_timestamp sec;
|
||||||
|
int32_t usec;
|
||||||
|
|
||||||
ALLOC(enc_krb_cred_part.timestamp, 1);
|
krb5_us_timeofday (context, &sec, &usec);
|
||||||
if (enc_krb_cred_part.timestamp == NULL) {
|
|
||||||
ret = ENOMEM;
|
ALLOC(enc_krb_cred_part.timestamp, 1);
|
||||||
krb5_set_error_string(context, "malloc: out of memory");
|
if (enc_krb_cred_part.timestamp == NULL) {
|
||||||
goto out4;
|
ret = ENOMEM;
|
||||||
|
krb5_set_error_string(context, "malloc: out of memory");
|
||||||
|
goto out4;
|
||||||
|
}
|
||||||
|
*enc_krb_cred_part.timestamp = sec;
|
||||||
|
ALLOC(enc_krb_cred_part.usec, 1);
|
||||||
|
if (enc_krb_cred_part.usec == NULL) {
|
||||||
|
ret = ENOMEM;
|
||||||
|
krb5_set_error_string(context, "malloc: out of memory");
|
||||||
|
goto out4;
|
||||||
|
}
|
||||||
|
*enc_krb_cred_part.usec = usec;
|
||||||
|
} else {
|
||||||
|
enc_krb_cred_part.timestamp = NULL;
|
||||||
|
enc_krb_cred_part.usec = NULL;
|
||||||
}
|
}
|
||||||
*enc_krb_cred_part.timestamp = sec;
|
|
||||||
ALLOC(enc_krb_cred_part.usec, 1);
|
|
||||||
if (enc_krb_cred_part.usec == NULL) {
|
|
||||||
ret = ENOMEM;
|
|
||||||
krb5_set_error_string(context, "malloc: out of memory");
|
|
||||||
goto out4;
|
|
||||||
}
|
|
||||||
*enc_krb_cred_part.usec = usec;
|
|
||||||
|
|
||||||
if (auth_context->local_address && auth_context->local_port) {
|
if (auth_context->local_address && auth_context->local_port) {
|
||||||
krb5_boolean noaddr;
|
krb5_boolean noaddr;
|
||||||
|
Reference in New Issue
Block a user