slightly newer than this server's time. Allow 1 second difference
to avoid random failures due to token being into future. */
if (nbf > t0 + 1) {
- *error_r = "Token is not valid yet";
+ *error_r = t_strdup_printf(
+ "Token is not valid yet (nbf=%"PRId64" > %"PRId64")",
+ nbf, t0 + 1);
return -1;
}
if (iat > t0 + 1) {
- *error_r = "Token is issued in future";
+ *error_r = t_strdup_printf(
+ "Token is issued in future (iat=%"PRId64" > %"PRId64")",
+ iat, t0 + 1);
return -1;
}
if (exp < t0) {
- *error_r = "Token has expired";
+ *error_r = t_strdup_printf(
+ "Token has expired (exp=%"PRId64" < %"PRId64")",
+ exp, t0);
return -1;
}
&is_jwt, &error) != 0, i);
test_assert_idx(is_jwt == TRUE, i);
if (test_case->error != NULL) {
- test_assert_strcmp(test_case->error, error);
+ test_assert(strstr(error, test_case->error) != NULL);
}
test_assert(error != NULL);
} T_END;