danwent / Perspectives

Perspectives Firefox Extension
http://perspectives-project.org
66 stars 19 forks source link

Support SHA256 and SHA512 hashes #149

Open ghost opened 10 years ago

ghost commented 10 years ago

Perspectives no longer shows error messages in Firefox 32 and MD5 hashes have be reintroduced on the client side. But we still need to update the servers and then support the new hash responses.

related to #123, #139, #141, danwent/Perspectives-Server#22

daveschaefer commented 10 years ago

Thanks for creating a ticket for this.

ghost commented 10 years ago

Another thought: if we can agree on what the server/client interface should look like for serving the new hashes, it may be possible to work on each side simultaneously.

The corresponding code for the client is located in xml_notary_client.js. Do we have an example server XML response somewhere? I still have to think this through but one thing we have to keep in mind at least is backwards compatibility. The response provides a version field. Also, is it safe to assume that the timestamps for different hashes are the same? i.e. updated servers always retrieve MD5 and SHA256 together and don't check MD5 at one point and SHA256 at another point in time and thus the timestamps diverge.

daveschaefer commented 10 years ago

Sample server XML response is now documented in the server API doc. Is that what you need?

one thing we have to keep in mind at least is backwards compatibility. The response provides a version field.

Yes, this version check is rather unfortunate :-/

    if(version !== expected_version) { return null; }

It's probably not feasible to upgrade all clients and all servers simultaneously. Thus we may want to change the client code first to allow server versions to be slightly different/newer so they won't completely error out if they see something new?

is it safe to assume that the timestamps for different hashes are the same? i.e. updated servers always retrieve MD5 and SHA256 together and don't check MD5 at one point and SHA256 at another point in time

This is my plan for notary behaviour, and yes I think it is a good sane thing to do to make the code easier. Retrieve the observed certificate once; once it has been fetched, save/update the timestamp for all/both hashes.