Skip to content

Commit

Permalink
Define that DownloadFile content hash method is SHA256
Browse files Browse the repository at this point in the history
Resolves #67

Without specifying the hashing method it was useless for the purposes it claims to exist for
>The hash of the file content. Can be used by the Agent to verify that the file was downloaded correctly.

You can't verify that the hash matches the content if you don't know the hashing method.

Now it is precisely defined to be SHA256 of the content.
  • Loading branch information
tigrannajaryan committed Mar 2, 2022
1 parent d62da9f commit 0d87698
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ There are 3 levels of hashes:

<h4 id="file-hash">File Hash</h4>

The hash of the addon file content. This is stored in the [hash](#hash) field in
The hash of the addon file content. This is stored in the [content_sha256](#content_sha256) field in
the [DownloadableFile](#downloadablefile-message) message. This value SHOULD be
used by the Agent to determine if the particular file it has is different on the
Server and needs to be re-downloaded.
Expand Down Expand Up @@ -1963,7 +1963,7 @@ The message has the following structure:
```protobuf
message DownloadableFile {
string download_url = 1;
bytes content_hash = 2;
bytes content_sha256 = 2;
}
```

Expand All @@ -1973,9 +1973,9 @@ The URL from which the file can be downloaded using HTTP GET request. The server
at the specified URL SHOULD support range requests to allow for resuming
downloads.

<h4 id="content_hash">content_hash</h4>
<h4 id="content_sha256">content_sha256</h4>

The hash of the file content. Can be used by the Agent to verify that the file
The SHA256 hash of the file content. Can be used by the Agent to verify that the file
was downloaded correctly.

<h2 id="agent-package-updates">Agent Package Updates</h2>
Expand Down

0 comments on commit 0d87698

Please sign in to comment.