diff options
Diffstat (limited to 'src/scm/webid-oidc/errors.scm')
-rw-r--r-- | src/scm/webid-oidc/errors.scm | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/scm/webid-oidc/errors.scm b/src/scm/webid-oidc/errors.scm index 1eb5a78..6cd337a 100644 --- a/src/scm/webid-oidc/errors.scm +++ b/src/scm/webid-oidc/errors.scm @@ -512,9 +512,16 @@ &external-error '(signed requested))) +(define (the-date object) + (when (integer? object) + (set! object (make-time time-utc 0 object))) + (when (time? object) + (set! object (time-utc->date object))) + object) + (define-public (raise-dpop-signed-in-future signed requested) (raise-exception - ((record-constructor &dpop-signed-in-future) signed requested))) + ((record-constructor &dpop-signed-in-future) (the-date signed) (the-date requested)))) (define-public &dpop-too-old (make-exception-type @@ -524,7 +531,7 @@ (define-public (raise-dpop-too-old signed requested) (raise-exception - ((record-constructor &dpop-too-old) signed requested))) + ((record-constructor &dpop-too-old) (the-date signed) (the-date requested)))) (define-public &dpop-unconfirmed-key (make-exception-type @@ -693,16 +700,10 @@ '(exp current-time))) (define-public (raise-authorization-code-expired exp current-time) - (when (integer? exp) - (set! exp (make-time time-utc 0 exp))) - (when (time? exp) - (set! exp (time-utc->date exp))) - (when (integer? current-time) - (set! current-time (make-time time-utc 0 current-time))) - (when (time? current-time) - (set! current-time (time-utc->date current-time))) - (raise-exception - ((record-constructor &authorization-code-expired) exp current-time))) + (raise-exception + ((record-constructor &authorization-code-expired) + (the-date exp) + (the-date current-time)))) (define-public &cannot-decode-authorization-code (make-exception-type |