Commit 83551d7f authored by Ivan Vilata-i-Balaguer's avatar Ivan Vilata-i-Balaguer
Browse files

Update Ouinet protocol version from 5 to 6.

Since the way blocks are signed is different and client-to-client retrieval
requires a first exchange of block signatures and hashes.
parent 3ce27a3e
......@@ -101,7 +101,7 @@ public:
// Example:
//
// ...
// X-Ouinet-Version: 5
// X-Ouinet-Version: 6
// X-Ouinet-URI: https://example.com/foo
// X-Ouinet-Injection: id=d6076384-2295-462b-a047-fe2c9274e58d,ts=1516048310
// X-Ouinet-BSigs: keyId="...",algorithm="hs2019",size=65536
......@@ -199,9 +199,9 @@ SignedHead::sign_response( const http::request_header<>& rqh
auto key_id = encode_key_id(pk);
// TODO: This should be a `static_assert`.
assert(protocol_version_hdr_current == protocol_version_hdr_v5);
assert(protocol_version_hdr_current == protocol_version_hdr_v6);
rsh.set(protocol_version_hdr, protocol_version_hdr_v5);
rsh.set(protocol_version_hdr, protocol_version_hdr_v6);
rsh.set(response_uri_hdr, rqh.target());
rsh.set(response_injection_hdr
, boost::format("id=%s,ts=%d") % injection_id % injection_ts);
......
......@@ -34,8 +34,9 @@ static const std::string protocol_version_hdr_v2 = "2";
static const std::string protocol_version_hdr_v3 = "3";
static const std::string protocol_version_hdr_v4 = "4";
static const std::string protocol_version_hdr_v5 = "5";
static const std::string protocol_version_hdr_current = protocol_version_hdr_v5;
static const unsigned protocol_version_current = 5;
static const std::string protocol_version_hdr_v6 = "6";
static const std::string protocol_version_hdr_current = protocol_version_hdr_v6;
static const unsigned protocol_version_current = 6;
// The presence of this HTTP request header
// indicates that an error happened processing the request,
......
......@@ -118,7 +118,7 @@ static const string _rs_fields_origin = (
);
static const string _rs_head_injection = util::str(
"X-Ouinet-Version: 5\r\n",
"X-Ouinet-Version: 6\r\n",
"X-Ouinet-URI: ",rq_target,"\r\n",
"X-Ouinet-Injection: id=", inj_id, ",ts=", inj_ts, "\r\n",
"X-Ouinet-BSigs: keyId=\"ed25519=",inj_b64pk,"\",",
......@@ -142,7 +142,7 @@ static string _get_signature_field(bool is_final, size_t body_size, const string
"server: Apache1, Apache2\n"
"content-type: text/html\n"
"content-disposition: inline; filename=\"foo.html\"\n"
"x-ouinet-version: 5\n"
"x-ouinet-version: 6\n"
"x-ouinet-uri: ",rq_target,"\n"
"x-ouinet-injection: id=",inj_id,",ts=",inj_ts,"\n"
"x-ouinet-bsigs: keyId=\"ed25519=",inj_b64pk,"\",algorithm=\"hs2019\",size=",inj_bs,
......
......@@ -71,7 +71,7 @@ static const string _rs_head_origin =
+ _rs_fields_origin);
static const string _rs_head_injection = (
"X-Ouinet-Version: 5\r\n"
"X-Ouinet-Version: 6\r\n"
"X-Ouinet-URI: https://example.com/foo\r\n"
"X-Ouinet-Injection: id=d6076384-2295-462b-a047-fe2c9274e58d,ts=1516048310\r\n"
"X-Ouinet-BSigs: keyId=\"ed25519=DlBwx8WbSsZP7eni20bf5VKUH3t1XAF/+hlDoLbZzuw=\","
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment