Conversation
|
have you looked at any tests from w3c? Google it, there's a bunch. |
|
Most tests are about uri joining, which this module doesn't do. |
|
Ok, that's a load of test URIs, and the bugs they helped clear out fixed |
f5420c4 to
9a51a9f
Compare
|
Rebased on top of a fresher master |
ae6e7d0 to
927f8fe
Compare
fb1c130 to
034c36e
Compare
e17b89d to
d4212d4
Compare
|
Update: there is now a function to decode the authority into its smaller parts, user, password, host and service, as well as a function to do percent decoding inline. |
aa3b35d to
e18c0c7
Compare
richsalz
left a comment
There was a problem hiding this comment.
you find it useful/interesting to look at the stanza stuff in bntest.c
| } | ||
|
|
||
| static int linecounter = 0; | ||
| static TEST_DATA *read_test_data(FILE *f) |
There was a problem hiding this comment.
this is a useful function; e.g., bntest and exptest could use it.
|
|
||
| if (*p == '\n') { | ||
| if (test_data != NULL) | ||
| break; |
There was a problem hiding this comment.
add skip lines starting with #
|
Actually, perhaps go the other say. Look at test/bntest.c, which has a generic key/value reader. Pull that out and then use it in your code here, with semantics on top of the PAIRs. |
|
Ok, @mattcaswell, I think I've responded to all your comments. |
|
The better idea would be to make a stanza library for everyone to use instead of doing reuse-by-copy. |
|
well, yeah, that's what i was suggesting you do :) |
|
Ah. Frankly, I'd rather do that refactor in a separate PR. |
|
@richsalz, I noticed your comments about |
mattcaswell
left a comment
There was a problem hiding this comment.
I took another scan through this and picked up a few more nits.
The main stumbling block for me on this is the licence question.
crypto/uri.c
Outdated
| if (++dblcolon > 1) | ||
| break; | ||
| maxcolons -= 2; | ||
| } else |
|
|
||
| /* Check if the loop stopped because of an invalid character */ | ||
| if (!is_valid(p[off])) { | ||
| char tmpbuf[200]; |
crypto/uri.c
Outdated
| { | ||
| const char *p = uri; | ||
|
|
||
| OPENSSL_init_crypto(0, NULL); |
There was a problem hiding this comment.
I'm wondering if this is actually necessary?
There was a problem hiding this comment.
It's been some time, I do recall there was a reason but cannot remember what it was...
There was a problem hiding this comment.
It would be good to know. The thing is we are supposed to auto-initialise if we call any functions that need it. These functions don't seem to need it themselves (e.g. no shared global data etc), so if this call was necessary then it suggests some other function call was made that didn't auto-initialise when (possibly) it should have done.
There was a problem hiding this comment.
It might be something in the STORE effort that got jinxed... Anyway, I've just taken those inits away, things are still working fine, so...
crypto/uri.c
Outdated
| { | ||
| const char *p = authority; | ||
|
|
||
| OPENSSL_init_crypto(0, NULL); |
test/uri_internal_test.c
Outdated
| } else if (strcasecmp(key, "scheme") == 0 | ||
| || strcasecmp(key, "decoded_scheme") == 0) { | ||
| if (test_data != NULL && test_data->expected.scheme == NULL) { | ||
| test_data->expected.scheme = value; |
There was a problem hiding this comment.
Weren't you going to do this stuff in a macro?
|
As for licensing, if we don't get an answer, I'll simply take it all away and we'll just add new cases as time goes. |
|
I just discovered that the IPv6 address parser failed on some perfectly acceptable addresses... |
|
I rewrote Also fixed a few errors in the IPv6address check |
|
This is abandoned, right? If it comes back, does it need to support RFC7512 URIs too? I was actually inclined to just use libp11-kit for a PKCS#11 STORE so I don't really need it, but if OpenSSL has a URI parser then it would make sense for me to use it. |
|
It is abandoned, yes. |
Checklist
Description of change
The test uses
test/uritests.txt. That file could use some more tests, please suggest some.Fixes #1957