OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_GCM_DRIVER_CRYPTO_ENCRYPTION_HEADER_PARSERS_H_ | |
6 #define COMPONENTS_GCM_DRIVER_CRYPTO_ENCRYPTION_HEADER_PARSERS_H_ | |
7 | |
8 #include <stdint.h> | |
whywhat
2015/09/14 14:57:43
can we include <cstdint> ? (.h is much more common
Peter Beverloo
2015/09/15 19:41:11
That just includes stdint.h, except that it also p
| |
9 #include <string> | |
10 | |
11 namespace gcm { | |
12 | |
13 // Parses |input| following the syntax of the Encryption HTTP header. Chrome | |
14 // only supports a single set of properties to be read from the header at this | |
15 // time. The base64url encoded salt will be decoded, |rs| will be validated. | |
whywhat
2015/09/14 14:57:43
s/salt/|salt|? what about |keyid|?
Peter Beverloo
2015/09/15 19:41:11
s/|rs|/rs/ in fact. This part of the comment refer
| |
16 // | |
17 // https://tools.ietf.org/html/draft-thomson-http-encryption-01#section-3 | |
18 // | |
19 // Returns whether the |input| could successfully be parsed, and the resulting | |
whywhat
2015/09/14 14:57:43
s/could successfully be parsed/was (or has been) s
Peter Beverloo
2015/09/15 19:41:11
Done.
| |
20 // information was stored in |keyid|, |salt| and |rs|. | |
21 bool ParseEncryptionHeader(const std::string& input, | |
22 std::string* keyid, | |
23 std::string* salt, | |
24 int64_t* rs); | |
25 | |
26 // Parses |input| following the syntax of the Encryption-Key HTTP header. Chrome | |
27 // only supports a single set of properties to be read from the header at this | |
28 // time. The base64url encoded key and dh will be decoded. | |
whywhat
2015/09/14 14:57:43
s/key/|key| and s/dh/|dh|?
Mostly to be consistent
Peter Beverloo
2015/09/15 19:41:11
Acknowledged.
| |
29 // | |
30 // https://tools.ietf.org/html/draft-thomson-http-encryption-01#section-4 | |
31 // | |
32 // Returns whether |input| could be successfully parsed, and the resulting | |
whywhat
2015/09/14 14:57:43
ditto about the phrasing and the return value
Peter Beverloo
2015/09/15 19:41:11
Done.
| |
33 // information was stored in |keyid|, |key| and |dh|. | |
34 bool ParseEncryptionKeyHeader(const std::string& input, | |
35 std::string* keyid, | |
36 std::string* key, | |
37 std::string* dh); | |
38 | |
39 } // namespace gcm | |
40 | |
41 #endif // COMPONENTS_GCM_DRIVER_CRYPTO_ENCRYPTION_HEADER_PARSERS_H_ | |
OLD | NEW |