diff options
author | Alexei Czeskis <aczeskis@google.com> | 2020-07-06 08:47:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 08:47:38 -0700 |
commit | 0275885d8e6038c39b8a8ca55e75d1d4d1727f47 (patch) | |
tree | d2da3a87e6558cde2cd3a66fa8f6bc5db7e76401 | |
parent | 4550c84830286c24f8c189cbd54edbbd986a2dd1 (diff) | |
parent | b7255085a3629a667fbdc046ff88521a4c845f2c (diff) | |
download | ukey2-0275885d8e6038c39b8a8ca55e75d1d4d1727f47.tar.gz |
Merge pull request #6 from apolyudov/master
Roll forward to cl/319125760
-rw-r--r-- | src/main/cpp/include/securegcm/ukey2_handshake.h | 24 | ||||
-rw-r--r-- | src/main/cpp/src/securegcm/ukey2_handshake.cc | 14 |
2 files changed, 19 insertions, 19 deletions
diff --git a/src/main/cpp/include/securegcm/ukey2_handshake.h b/src/main/cpp/include/securegcm/ukey2_handshake.h index 7e5973f..8455fd7 100644 --- a/src/main/cpp/include/securegcm/ukey2_handshake.h +++ b/src/main/cpp/include/securegcm/ukey2_handshake.h @@ -33,39 +33,39 @@ namespace securegcm { class UKey2Handshake { public: // Handshake states: - // IN_PROGRESS: + // kInProgress: // The handshake is in progress, caller should use // |GetNextHandshakeMessage()| and |ParseHandshakeMessage()| to continue // the handshake. // - // VERIFICATION_NEEDED: + // kVerificationNeeded: // The handshake is complete, but pending verification of the // authentication string. Clients should use |GetVerificationString()| // to get the verification string and use out-of-band methods to // authenticate the handshake. // - // VERIFICATION_IN_PROGRESS: + // kVerificationInProgress: // The handshake is complete, verification string has been generated, // but has not been confirmed. After authenticating the handshake // out-of-band, use |VerifyHandshake()| to mark the handshake as // verified. // - // FINISHED: + // kFinished: // The handshake is finished, and the caller can use // |ToConnectionContext()| to produce a |D2DConnectionContextV1|. // - // ALREADY_USED: + // kAlreadyUsed: // The hanshake has already been used and should be destroyed. // - // ERROR: + // kError: // The handshake produced an error and should be destroyed. enum class State { - IN_PROGRESS, - VERIFICATION_NEEDED, - VERIFICATION_IN_PROGRESS, - FINISHED, - ALREADY_USED, - ERROR, + kInProgress, + kVerificationNeeded, + kVerificationInProgress, + kFinished, + kAlreadyUsed, + kError, }; // Currently implemented UKEY2 handshake ciphers. Each cipher is a tuple diff --git a/src/main/cpp/src/securegcm/ukey2_handshake.cc b/src/main/cpp/src/securegcm/ukey2_handshake.cc index 295331e..dc5c131 100644 --- a/src/main/cpp/src/securegcm/ukey2_handshake.cc +++ b/src/main/cpp/src/securegcm/ukey2_handshake.cc @@ -97,20 +97,20 @@ UKey2Handshake::State UKey2Handshake::GetHandshakeState() const { case InternalState::SERVER_AFTER_CLIENT_INIT: case InternalState::SERVER_WAITING_FOR_CLIENT_FINISHED: // Fallthrough intended -- these are all in-progress states. - return State::IN_PROGRESS; + return State::kInProgress; case InternalState::HANDSHAKE_VERIFICATION_NEEDED: - return State::VERIFICATION_NEEDED; + return State::kVerificationNeeded; case InternalState::HANDSHAKE_VERIFICATION_IN_PROGRESS: - return State::VERIFICATION_IN_PROGRESS; + return State::kVerificationInProgress; case InternalState::HANDSHAKE_FINISHED: - return State::FINISHED; + return State::kFinished; case InternalState::HANDSHAKE_ALREADY_USED: - return State::ALREADY_USED; + return State::kAlreadyUsed; case InternalState::HANDSHAKE_ERROR: - return State::ERROR; + return State::kError; default: // Unreachable. - return State::ERROR; + return State::kError; } } |