Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Side by Side Diff: crypto/p224_spake.h

Issue 761663004: Allow to get key from SPAKE2 after the first round trip. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | crypto/p224_spake.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CRYPTO_P224_SPAKE_H_ 5 #ifndef CRYPTO_P224_SPAKE_H_
6 #define CRYPTO_P224_SPAKE_H_ 6 #define CRYPTO_P224_SPAKE_H_
7 7
8 #include <base/strings/string_piece.h> 8 #include <base/strings/string_piece.h>
9 #include <crypto/p224.h> 9 #include <crypto/p224.h>
10 #include <crypto/sha2.h> 10 #include <crypto/sha2.h>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // ProcessMessage processes a message which must have been generated by a 61 // ProcessMessage processes a message which must have been generated by a
62 // call to GetMessage() by the other party. 62 // call to GetMessage() by the other party.
63 Result ProcessMessage(const base::StringPiece& message); 63 Result ProcessMessage(const base::StringPiece& message);
64 64
65 // In the event that ProcessMessage() returns kResultFailed, error will 65 // In the event that ProcessMessage() returns kResultFailed, error will
66 // return a human readable error message. 66 // return a human readable error message.
67 const std::string& error() const; 67 const std::string& error() const;
68 68
69 // The key established as result of the key exchange. Must be called 69 // The key established as result of the key exchange. Must be called
70 // at then end after ProcessMessage() returns kResultSuccess. 70 // at then end after ProcessMessage() returns kResultSuccess.
71 const std::string& GetKey(); 71 const std::string& GetKey() const;
72
73 // The key established as result of the key exchange. Can be called after
74 // the first ProcessMessage()
75 const std::string& GetUnverifiedKey() const;
72 76
73 private: 77 private:
74 // The authentication state machine is very simple and each party proceeds 78 // The authentication state machine is very simple and each party proceeds
75 // through each of these states, in order. 79 // through each of these states, in order.
76 enum State { 80 enum State {
77 kStateInitial, 81 kStateInitial,
78 kStateRecvDH, 82 kStateRecvDH,
79 kStateSendHash, 83 kStateSendHash,
80 kStateRecvHash, 84 kStateRecvHash,
81 kStateDone, 85 kStateDone,
(...skipping 23 matching lines...) Expand all
105 // expected_authenticator_ is used to store the hash value expected from the 109 // expected_authenticator_ is used to store the hash value expected from the
106 // other party. 110 // other party.
107 uint8 expected_authenticator_[kSHA256Length]; 111 uint8 expected_authenticator_[kSHA256Length];
108 112
109 std::string key_; 113 std::string key_;
110 }; 114 };
111 115
112 } // namespace crypto 116 } // namespace crypto
113 117
114 #endif // CRYPTO_P224_SPAKE_H_ 118 #endif // CRYPTO_P224_SPAKE_H_
OLDNEW
« no previous file with comments | « no previous file | crypto/p224_spake.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698