1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2024-11-29 00:24:13 +01:00
Commit Graph

885 Commits

Author SHA1 Message Date
Jean Paul Galea
02f2e056b1 FIXME marker. 2015-08-12 11:02:40 +02:00
Jean Paul Galea
c8bf5216d2 Fix failing tests.
- bug introduced in 382cfc2ab5.

- travis perl server test should use port 8002 to simulate ksm server.
2015-08-12 10:50:08 +02:00
Jean Paul Galea
eabdfd2503 FIXME markers. 2015-07-28 17:11:47 +00:00
Jean Paul Galea
382cfc2ab5 Modify default KSM URL.
- our ksm daemon listens on port 8002 by default,
	so ykval should also have the same default.
2015-07-28 17:09:36 +00:00
Jean Paul Galea
b106789217 Fix.
- fix bug introduced in 6181abee14.

- essentially, strftime() uses different format than date()
2015-07-24 14:50:02 +02:00
Jean Paul Galea
9704cf7ae1 Refactor.
- avoid unnecessary strtotime() call.

- instead of:
		strtotime(date('Y-m-d H:i:s', $timestamp))

	use:
		$timestamp

	since:
		$timestamp === strtotime(date('Y-m-d H:i:s', $timestamp))
2015-07-24 14:45:41 +02:00
Jean Paul Galea
6181abee14 Refactor.
- strftime -> date.

- strftime is same as date, but with locales.

- date format doesn't output names (January, March, etc.),
	so locale doesn't matter.

- also, would we really want locale in logs?
2015-07-24 14:35:30 +02:00
Jean Paul Galea
342ceac544 Modify log write.
- Log::log() internally support array implode,
	so no need to duplicate functionality.

- however, the internal implode uses two consecutive spaces as separator,
	so this will change the log format slightly.

	e.g. "delta=x now=y" becomes "delta=x  now=y"
2015-07-24 14:01:22 +02:00
Jean Paul Galea
c05a505b9c Refactor. 2015-07-24 13:54:49 +02:00
Jean Paul Galea
a6ad2e7d4b Cosmetic changes. 2015-07-24 10:55:34 +02:00
Jean Paul Galea
231c1ad0c5 Refactor. 2015-07-24 10:54:21 +02:00
Jean Paul Galea
1341227342 Refactor. 2015-07-24 10:50:21 +02:00
Jean Paul Galea
17378733af Refactor.
- rename $curlopts -> $opts.
2015-07-22 19:48:43 +00:00
Jean Paul Galea
5fc6c1c37d Refactor. 2015-07-22 19:44:35 +00:00
Jean Paul Galea
6246aa5ab4 Refactor.
- rename $handle -> $ch.
2015-07-22 19:43:06 +00:00
Jean Paul Galea
9dfb9b9302 Refactor. 2015-07-22 19:41:25 +00:00
Jean Paul Galea
4c2d4414a0 Cosmetic changes. 2015-07-22 19:38:32 +00:00
Jean Paul Galea
bef2c0cd4a Cosmetic changes. 2015-07-22 19:21:45 +00:00
Jean Paul Galea
424fbdf962 FIXME markers. 2015-07-21 21:45:07 +00:00
Jean Paul Galea
da689f7de4 Cosmetic changes. 2015-07-21 21:38:46 +00:00
Jean Paul Galea
ca5e787452 Refactor. 2015-07-21 21:38:37 +00:00
Jean Paul Galea
3572410b30 Better grouping.
- same as 1e799aa6e5.

- group $timeout filtering and validation.

- this commit might change replies sent to clients,
	since the validation check is done eaerlier now,
	and we might return S_MISSING_PARAM before S_BAD_OTP for example.

- this should really not cause any issues though,
	the order of which error is raised first should not matter to clients.
2015-07-21 21:27:33 +00:00
Jean Paul Galea
1e799aa6e5 Better grouping.
- group $sl filtering and validation.

- this commit might change replies sent to clients,
	since the validation check is done eaerlier now,
	and we might return S_MISSING_PARAM before S_BAD_OTP for example.

- this should really not cause any issues though,
	the order of which error is raised first should not matter to clients.
2015-07-21 21:17:59 +00:00
Jean Paul Galea
1e4453ccdf Refactor and unset after use. 2015-07-21 21:12:21 +00:00
Jean Paul Galea
82d5796245 Refactor. 2015-07-21 21:09:17 +00:00
Jean Paul Galea
262671f50b Refactor.
- single quotes.

- unset after use.

- don't wrap.
2015-07-21 21:05:16 +00:00
Jean Paul Galea
847f288cf5 Refactor. 2015-07-21 21:03:03 +00:00
Jean Paul Galea
11c160b05c Cosmetic changes. 2015-07-21 21:02:50 +00:00
Jean Paul Galea
e5238b8f54 Refactor.
- only add nonce to $extra array after check.
2015-07-21 20:56:02 +00:00
Jean Paul Galea
e24b02a7dc Refactor.
- $new_otp not used afterwards,
	clean up to avoid reuse by mistake.
2015-07-21 20:54:49 +00:00
Jean Paul Galea
84e867a6eb Better grouping.
- no functional affect whatsoever.
2015-07-21 20:53:13 +00:00
Jean Paul Galea
0749db6e8f More robust https check. 2015-07-21 20:49:17 +00:00
Jean Paul Galea
c5983f13eb Refactor. 2015-07-21 20:45:57 +00:00
Jean Paul Galea
06d037ef09 Refactor. 2015-07-21 20:44:53 +00:00
Jean Paul Galea
937dd1a674 Refactor.
- avoid using $_SERVER vars in "core",
	helps when debugging or running via cli.
2015-07-21 20:38:57 +00:00
Jean Paul Galea
2aa06ec0a3 Refactor sign function.
- this commit might affect LOG_DEBUG message,
    since now we log utf8_encode($qs) not $qs.

- this is probably what we want though,
    since we run hash_hmac on the latter.
2015-07-21 20:36:56 +00:00
Jean Paul Galea
3414c15eb4 Unwrap else block.
- sendResp calls exit()
2015-07-21 20:26:55 +00:00
Jean Paul Galea
1ca175ef2e More minor fixes. 2015-07-21 20:26:37 +00:00
Jean Paul Galea
116d992da2 Refactor.
- $apiKey is initiliased further down.
2015-07-21 20:13:17 +00:00
Jean Paul Galea
b24eabeac4 Refactor.
- str substitution rather than concat.

- cosmetic changes.
2015-07-21 20:12:05 +00:00
Jean Paul Galea
7686afc4a7 double -> single quotes. 2015-07-21 20:01:24 +00:00
Jean Paul Galea
b417759932 Update copyright year. 2015-07-20 20:01:16 +00:00
Jean Paul Galea
c0048ce7cc Add FIXME markers. 2015-07-20 19:56:43 +00:00
Jean Paul Galea
5ed2f1d4d5 Refactor.
- negate test and return early.

- avoid wrapping whole function in `if () { }`.

- move $condition below $arr,
	since $arr is passwed first, then $condition, to conditionalUpdateBy().
2015-07-20 19:53:45 +00:00
Jean Paul Galea
3097d13629 Refactor. 2015-07-20 19:44:56 +00:00
Jean Paul Galea
c52300ab39 Improve documentation. 2015-07-20 19:39:59 +00:00
Jean Paul Galea
4ca6fb5448 Refactor database configuration.
- don't repeat config-db.php file path

- add @is_readable,
	we might not have the proper permissions.

- use 'require_once' instead of 'include',
	this file should only be included once and we
	should fail dramatically if we can't load it.

- better documentation.
2015-07-20 19:20:04 +00:00
Jean Paul Galea
7e76f9bff8 Cosmetic changes.
\# -> //
2015-07-20 19:09:38 +00:00
Jean Paul Galea
1dab5c64aa Cosmetic changes. 2015-07-20 19:04:57 +00:00
Jean Paul Galea
f9fd53046a Move comment where applicable. 2015-07-20 19:04:36 +00:00