fast cookie expiration
This commit is contained in:
@@ -114,6 +114,12 @@ fast_parse_cookie(kdc_request_t r, const PA_DATA *pa)
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
if (r->fast.expiration < kdc_time) {
|
||||
kdc_log(r->context, r->config, 0, "fast cookie expired");
|
||||
ret = KRB5KDC_ERR_POLICY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
free_KDCFastCookie(&data);
|
||||
|
||||
@@ -131,6 +137,8 @@ fast_add_cookie(kdc_request_t r, METHOD_DATA *method_data)
|
||||
|
||||
memset(&shell, 0, sizeof(shell));
|
||||
|
||||
r->fast.expiration = kdc_time + FAST_EXPIRATION_TIME;
|
||||
|
||||
ASN1_MALLOC_ENCODE(KDCFastState, data.data, data.length,
|
||||
&r->fast, &size, ret);
|
||||
if (ret)
|
||||
|
@@ -47,6 +47,8 @@ typedef struct kdc_request_desc *kdc_request_t;
|
||||
|
||||
#include <kdc-private.h>
|
||||
|
||||
#define FAST_EXPIRATION_TIME (3 * 60)
|
||||
|
||||
struct kdc_request_desc {
|
||||
krb5_context context;
|
||||
krb5_kdc_configuration *config;
|
||||
|
Reference in New Issue
Block a user