chiark / gitweb /
Ian Jackson [Thu, 29 Oct 2015 02:09:01 +0000 (02:09 +0000)]
Testing: New run-all script
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 29 Oct 2015 02:07:33 +0000 (02:07 +0000)]
Testing: Makefile: always redirect stdin from /dev/null
make -j does this for all but the first job anyway. If we do it
ourselves we will catch sooner ant silly bugs where we read from
stdin.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 29 Oct 2015 01:57:00 +0000 (01:57 +0000)]
Testing: Move expect_before timeout to right place
Otherwise it relates to the default spawn id which is stdin. The
effect is that (a) the timeout is for the whole script, not each
expect, and (b) when stdin is /dev/null Tcl gets EOF, closes it, and
then complains
error writing "stdout": bad file number
(which is rather daft).
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 29 Oct 2015 01:23:06 +0000 (01:23 +0000)]
Testing: Provide Makefile
Can be run with `make -C tests/'. Currently there is a bug with -j.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 29 Oct 2015 01:17:39 +0000 (01:17 +0000)]
Testing: Introduce varying CAFTEST_TMP
This defaults to tests/tmp, but we set it in autotest to a
test-specific value. We are going to use make to do parallel test
running, so they all need their own logfile.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 29 Oct 2015 00:37:50 +0000 (00:37 +0000)]
Testing: Increase timeout
5s was too short on zealot.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 29 Oct 2015 00:36:46 +0000 (00:36 +0000)]
srcdump: git: Do not include ~ files in .git
Eg, COMMIT_EDITMSG~.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 28 Oct 2015 16:55:59 +0000 (16:55 +0000)]
Testing: Disable srcdump in tests by default
We will want to introduce a new srcdump test, but that does not exist
yet. In the meantime the srcdump_prepare runs during every test page
load (because we have no fastcgi or speedy or similar), which makes
the general (non-srcdump) tests unecessarily slow.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:51:51 +0000 (16:51 +0000)]
Testing: Break out loginout.at
Same test, but run differently.
This prepares us for multiple different tests.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:49:42 +0000 (16:49 +0000)]
Testing: autotest: Move some code about
No functional change.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:48:37 +0000 (16:48 +0000)]
Testing: autotest: Introduce dospawn
No functional change.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:38:23 +0000 (16:38 +0000)]
_check_divert_core: Update cookie lifetime when request is OK
The timeout should be from last load, not from login.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:37:13 +0000 (16:37 +0000)]
Testing: autotest: Introduce "loginas"
No functional change.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:36:18 +0000 (16:36 +0000)]
Testing: Login/logout interrupted session tests
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:35:14 +0000 (16:35 +0000)]
Docs: Say that unknown divert kinds should be fatal
This ought to be obvious, but we should state it explicitly.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:29:50 +0000 (16:29 +0000)]
Introduce STALE divert kind
This is discussed in the algorithm comment in _check_divert_core, but
was not implemented.
Sadly this means we were missing a divert kind - however, apps which
don't handle it should die if they don't understand the divert kind,
which is what we did ourselves previously.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:27:07 +0000 (16:27 +0000)]
check_nonpage: Handle ParmT ne 'y' correctly
If check_nonpage needs to check authenticity of the submission, only a
valid hidden form parameter ought to be permitted.
This seems to have simply a logic error where (in
2cc2bcd0 "javascript
hijacking fix") I thought ParmT was a perl booleanish; but, of course,
it isn't.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:25:36 +0000 (16:25 +0000)]
_check_divert_core: Minor comment reformatting
Remove a couple of `/' which are not needed for clarity. We are going
to add more cases to some of the other entries which will involve
removing their `/' too.
No change even to the meaning of the comment.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:22:24 +0000 (16:22 +0000)]
_check_divert_core: Change handling of $parmt=='t'
This can mean that the form parameter refers to a cookie now deleted
from the db: ie one relating to a previous user session.
This is not a bug or (necessariloy) an attack; it might simply mean
that the submission comes from a page generated in a previous login
session.
So handle this case the same way as $parmt=='n' (ie, expired hidden
parameter value). (Double-checked by searching the function beyond
that point for references to parmt.)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 28 Oct 2015 16:19:28 +0000 (16:19 +0000)]
Docs: Various fixes and minor clarifications
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 19:22:20 +0000 (19:22 +0000)]
Testing: Test going back
This currently breaks, so comment out the last expect.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 19:21:57 +0000 (19:21 +0000)]
Testing: Move \t out of submitform-expect
No functional change.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 19:12:39 +0000 (19:12 +0000)]
Testing: More realistic mutating checks
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 19:12:14 +0000 (19:12 +0000)]
Testing: Provide incrementing url
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 19:11:45 +0000 (19:11 +0000)]
Testing: Tidy up html a bit
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 19:10:50 +0000 (19:10 +0000)]
Testing: Test url suffix
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 18:59:21 +0000 (18:59 +0000)]
Testing: Log in
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 18:51:03 +0000 (18:51 +0000)]
Testing: Fix up $url management
We need to handle the incoming URL more subtly in tests/cgi so that
the tail of the path is preserved; the existing approach squashes it
for the purposes of the CAF get_url callback, but fails to sanitise
the URL at all for the purposes of tests/cgi's form generation.
It would be best if there were a way in the CGI specification for w3m
to tell the script that its own url is actually file:///something, so
that CGI(3pm)'s url method would DTRT. But there isn't.
In the absence of any useful information provided by w3m, CGI makes up
`http://localhost', which is fair enough. We can simply replace that
with our own URL prefix.
So we replace the CAFTEST_URL variable with CAFTEST_URLBASE, which
contains the start of the URL (not including the path part, which
tests/cgi can get out of $q->url, and which we would have difficulty
dismantling and reassembling anyway).
In tests/cgi, we apply this to $url if CAFTEST_URLBASE is set, and
then we can unconditionally supply a get_url hook (which hook is
equivalent to the default one if $url wasn't modified).
Adjusting $url in tests/cgi makes the form field come out with the
right URL. And the new adjustment scheme means that invocations with
a nonempty PATH_INFO do not lose the PATH_INFO.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 18:49:04 +0000 (18:49 +0000)]
blinding: Fix (again) move of Params setting into check_divert
Do not inadvertently autoviviy $divert as an arrayref.
If we do then the web app (or check_ok) sees it as trueish and will try
diverting with an empty divert spec, rather than seeing it as falseish
and correctly proceeding to do the real work.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 18:48:03 +0000 (18:48 +0000)]
API: Expose $authreq->chain_params()
Contrary to what I said in
a97dc2ce, it seems that this function is
indeed useful. test/cgi wants it!
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 18:47:10 +0000 (18:47 +0000)]
Docs: Clarify url_with_query_params $params
It doesn't want CAF-specific parameters: it will put those in for
itself.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 18:46:41 +0000 (18:46 +0000)]
Testing: Move runes to tests/README
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 18:46:05 +0000 (18:46 +0000)]
Testing: Provide another test rune in TODO
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 18:08:11 +0000 (18:08 +0000)]
Testing: autotest script
Can do one test now. More to be added RSN.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 18:07:51 +0000 (18:07 +0000)]
Testing: clarify rune in TODO
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 18:07:42 +0000 (18:07 +0000)]
Testing: write wrap's log to wrap.log
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 17:12:31 +0000 (17:12 +0000)]
Testing: Reorganise files, variables, etc.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 16:50:05 +0000 (16:50 +0000)]
Testing: Provide test-wrap script
w3m in local cgi mode does not appear to honour our attempts to set
cookies. Provide a test-wrap script which fishes the cookie out of
CAF's output and passes it back in on the next run.
Document the necessary rune.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 16:49:15 +0000 (16:49 +0000)]
Testing: test.cgi: Honour CAFTEST_URL
No-one sets this yet.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 16:48:31 +0000 (16:48 +0000)]
Testing: test.cgi: Provide debug output hook
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 16:48:16 +0000 (16:48 +0000)]
Testing: test.cgi: Break out @verifier_params
No functional change.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 16:47:28 +0000 (16:47 +0000)]
blinding: Use . as separator rather than / (which ends up as %2e)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 16:46:50 +0000 (16:46 +0000)]
blinding: Fix move of Params setting into check_divert
We were setting various things in $r rather than $r->{Divert}.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 16:46:00 +0000 (16:46 +0000)]
srcdump: Report tar output to stderr, not stdout
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 16:45:30 +0000 (16:45 +0000)]
Testing: rename dump to test-data
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 15:17:55 +0000 (15:17 +0000)]
test.cgi: ignore "dump" directory
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 15:15:27 +0000 (15:15 +0000)]
test.cgi: unset srcdump_filter_cwd
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Oct 2015 15:15:05 +0000 (15:15 +0000)]
blinding: Properly lift _blind and _unblind for "" and undef
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Sun, 25 Oct 2015 13:37:15 +0000 (13:37 +0000)]
blinding: Blind cookies and hidden form param
Each time we generate a cookie or a hidden form parameter, generate
some random hex digits and xor them with the hex digits in the cookie
or parameter value.
Our cookies contain decimal digits, and punctuation, too. The decimal
digits are simply blinded the same way (which is fine) and the
punctuation is left alone. It's the actual values we care about.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 25 Oct 2015 13:35:25 +0000 (13:35 +0000)]
blinding: Remove handling of REDIRECT-LOGOUT
Nothing sets $kind to REDIRECT-LOGOUT.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 25 Oct 2015 13:34:31 +0000 (13:34 +0000)]
blinding: Move another setting of Params into check_divert
Previously, divert_ok had the knowledge of the need to set
the first of loggedout_param_names. Put this into check_divert.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 25 Oct 2015 13:25:44 +0000 (13:25 +0000)]
blinding: Move setting of Params into check_divert
Previously, divert_ok had the knowledge of the need to set
assoc_param_name in some cases. Put this into check_divert.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 25 Oct 2015 13:24:43 +0000 (13:24 +0000)]
blinding: Discuss CookieSecret a bit differently
Ian Jackson [Sun, 25 Oct 2015 13:23:56 +0000 (13:23 +0000)]
blinding: Introduce _CookieRaw (same as CookieSecret for now
Ian Jackson [Sun, 25 Oct 2015 13:20:49 +0000 (13:20 +0000)]
Fix broken db creation
Ian Jackson [Sun, 25 Oct 2015 13:20:14 +0000 (13:20 +0000)]
srcdump: Fix git vcsscript to work properly
Ian Jackson [Sun, 25 Oct 2015 13:19:26 +0000 (13:19 +0000)]
srcdump: Skip undef entries in srcdump_dirscan_prepare (relevant if SCRIPT_FILENAME is undef, for example
Ian Jackson [Sun, 25 Oct 2015 13:18:33 +0000 (13:18 +0000)]
Add caf-srcdump to .gitignore
Ian Jackson [Sun, 25 Oct 2015 12:05:05 +0000 (12:05 +0000)]
Reformat construct_cookie (no functional change)
Ian Jackson [Thu, 16 Jul 2015 12:10:40 +0000 (13:10 +0100)]
Fix ref to nonpagetype in check_nonpage
Ian Jackson [Thu, 16 Jul 2015 12:10:15 +0000 (13:10 +0100)]
Abolish default_db_setup_stmts and set it up in new_verifier
Ian Jackson [Sun, 7 Apr 2013 17:06:36 +0000 (18:06 +0100)]
db_... settings: rename file from assocdb_...
Ian Jackson [Sun, 7 Apr 2013 16:56:55 +0000 (17:56 +0100)]
caf.db: rename file from caf-assocs.db
Ian Jackson [Sun, 7 Apr 2013 16:51:29 +0000 (17:51 +0100)]
db_prefix setting: change from assocdb_table
Ian Jackson [Wed, 3 Apr 2013 20:52:22 +0000 (21:52 +0100)]
docs: more work
Ian Jackson [Wed, 3 Apr 2013 20:52:14 +0000 (21:52 +0100)]
db_setup_stmts: new setting
Ian Jackson [Thu, 28 Mar 2013 21:15:23 +0000 (21:15 +0000)]
docs: more work
Ian Jackson [Thu, 28 Mar 2013 21:10:44 +0000 (21:10 +0000)]
docs: more work
Ian Jackson [Thu, 28 Mar 2013 21:10:35 +0000 (21:10 +0000)]
docs: more work
Ian Jackson [Thu, 28 Mar 2013 21:01:44 +0000 (21:01 +0000)]
docs: more work
Ian Jackson [Thu, 28 Mar 2013 20:17:55 +0000 (20:17 +0000)]
docs: more work
Ian Jackson [Thu, 28 Mar 2013 19:53:32 +0000 (19:53 +0000)]
_chain_params: make an internal-only function as seems to have little plausible external use
Ian Jackson [Thu, 28 Mar 2013 19:50:01 +0000 (19:50 +0000)]
docs: more work
Ian Jackson [Thu, 28 Mar 2013 19:44:12 +0000 (19:44 +0000)]
docs: more work
Ian Jackson [Thu, 28 Mar 2013 19:44:05 +0000 (19:44 +0000)]
srcdump_vcsscript: make into a single hash, not a bevy of separate settings
Ian Jackson [Thu, 28 Mar 2013 19:20:18 +0000 (19:20 +0000)]
docs: more work
Ian Jackson [Thu, 28 Mar 2013 19:06:25 +0000 (19:06 +0000)]
docs: more work
Ian Jackson [Thu, 28 Mar 2013 19:06:02 +0000 (19:06 +0000)]
srcdump_vcs_dirs, etc.: do not handle CVS as metadata dir in ever subdir means we need CVS-specific logic to find working tree root(s)
Ian Jackson [Thu, 21 Mar 2013 17:12:04 +0000 (17:12 +0000)]
docs: more work
Ian Jackson [Thu, 21 Mar 2013 17:10:14 +0000 (17:10 +0000)]
docs: more work
Ian Jackson [Thu, 21 Mar 2013 17:09:55 +0000 (17:09 +0000)]
TODO: some untranslated strings
Ian Jackson [Thu, 21 Mar 2013 17:09:12 +0000 (17:09 +0000)]
is_page: remove obsolete hook
Ian Jackson [Thu, 21 Mar 2013 17:08:57 +0000 (17:08 +0000)]
get_params hook: actually DTRT for multiple-valued parameters
Ian Jackson [Thu, 21 Mar 2013 17:07:32 +0000 (17:07 +0000)]
is_https hook: rename from check_https
Ian Jackson [Thu, 21 Mar 2013 14:57:29 +0000 (14:57 +0000)]
docs: more work
Ian Jackson [Wed, 20 Mar 2013 18:29:33 +0000 (18:29 +0000)]
docs: more work
Ian Jackson [Wed, 20 Mar 2013 18:29:21 +0000 (18:29 +0000)]
need_add_hidden: support use with the class rather than an object
Ian Jackson [Wed, 20 Mar 2013 18:29:02 +0000 (18:29 +0000)]
update_get_need_add_hidden: new $force parameter
Ian Jackson [Wed, 20 Mar 2013 18:27:57 +0000 (18:27 +0000)]
mutate_ok: abolish, and provide only check_mutate
Ian Jackson [Tue, 19 Mar 2013 19:04:27 +0000 (19:04 +0000)]
docs: more work
Ian Jackson [Tue, 19 Mar 2013 17:47:56 +0000 (17:47 +0000)]
docs: more work
Ian Jackson [Tue, 19 Mar 2013 01:09:59 +0000 (01:09 +0000)]
docs: more work
Ian Jackson [Tue, 19 Mar 2013 01:09:55 +0000 (01:09 +0000)]
fixes
Ian Jackson [Sun, 17 Mar 2013 14:12:18 +0000 (14:12 +0000)]
update_get_need_add_hidden: new function
Ian Jackson [Sun, 17 Mar 2013 14:07:08 +0000 (14:07 +0000)]
docs: more work
Ian Jackson [Sun, 17 Mar 2013 14:06:54 +0000 (14:06 +0000)]
.gitignore: add lots of docs files
Ian Jackson [Sun, 17 Mar 2013 13:59:59 +0000 (13:59 +0000)]
docs: more work
Ian Jackson [Sun, 17 Mar 2013 13:59:31 +0000 (13:59 +0000)]
minor improvements and a todo, prompted by docs work
Ian Jackson [Sun, 17 Mar 2013 13:20:40 +0000 (13:20 +0000)]
rename nonpage_ok to check_nonpage
Ian Jackson [Thu, 7 Mar 2013 18:09:41 +0000 (18:09 +0000)]
javascript hijacking fix, docs are still wip