OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_QUIC_CRYPTO_CHANNEL_ID_H_ | 5 #ifndef NET_QUIC_CRYPTO_CHANNEL_ID_H_ |
6 #define NET_QUIC_CRYPTO_CHANNEL_ID_H_ | 6 #define NET_QUIC_CRYPTO_CHANNEL_ID_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // kClientToServerStr follows kContextStr to specify that the ChannelID is | 37 // kClientToServerStr follows kContextStr to specify that the ChannelID is |
38 // being used in the client to server direction. (The terminating NUL byte is | 38 // being used in the client to server direction. (The terminating NUL byte is |
39 // included.) | 39 // included.) |
40 static const char kClientToServerStr[]; | 40 static const char kClientToServerStr[]; |
41 | 41 |
42 // Verify returns true iff |signature| is a valid signature of |signed_data| | 42 // Verify returns true iff |signature| is a valid signature of |signed_data| |
43 // by |key|. | 43 // by |key|. |
44 static bool Verify(base::StringPiece key, | 44 static bool Verify(base::StringPiece key, |
45 base::StringPiece signed_data, | 45 base::StringPiece signed_data, |
46 base::StringPiece signature); | 46 base::StringPiece signature); |
| 47 |
| 48 // FOR TESTING ONLY: VerifyRaw returns true iff |signature| is a valid |
| 49 // signature of |signed_data| by |key|. |is_channel_id_signature| indicates |
| 50 // whether |signature| is a ChannelID signature (with kContextStr prepended |
| 51 // to the data to be signed). |
| 52 static bool VerifyRaw(base::StringPiece key, |
| 53 base::StringPiece signed_data, |
| 54 base::StringPiece signature, |
| 55 bool is_channel_id_signature); |
47 }; | 56 }; |
48 | 57 |
49 } // namespace net | 58 } // namespace net |
50 | 59 |
51 #endif // NET_QUIC_CRYPTO_CHANNEL_ID_H_ | 60 #endif // NET_QUIC_CRYPTO_CHANNEL_ID_H_ |
OLD | NEW |