summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2017-02-13 11:22:40 -0500
committerRandolph Tan <randolph@10gen.com>2017-02-27 13:15:43 -0500
commit2e68e8bf05fd7c6cb94b82fcfd0fe237c9f7ccb8 (patch)
tree2374dc732dbe4f1f59b63e2680e205533fecf976 /src/mongo/db
parenta4e1443629b733c7c0fd44dddcd78e884da848bd (diff)
downloadmongo-2e68e8bf05fd7c6cb94b82fcfd0fe237c9f7ccb8.tar.gz
SERVER-27748 Implement LogicalTimeMetadata
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/SConscript1
-rw-r--r--src/mongo/db/signed_logical_time.cpp2
-rw-r--r--src/mongo/db/signed_logical_time.h2
-rw-r--r--src/mongo/db/time_proof_service.h6
4 files changed, 6 insertions, 5 deletions
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index 55ea57fe7fc..20aa7fe127e 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -941,6 +941,7 @@ env.Library(
],
LIBDEPS=[
'logical_time',
+ '$BUILD_DIR/mongo/crypto/sha1_block',
],
)
diff --git a/src/mongo/db/signed_logical_time.cpp b/src/mongo/db/signed_logical_time.cpp
index bcfb89f027a..16404950ac5 100644
--- a/src/mongo/db/signed_logical_time.cpp
+++ b/src/mongo/db/signed_logical_time.cpp
@@ -34,7 +34,7 @@ namespace mongo {
std::string SignedLogicalTime::toString() const {
StringBuilder buf;
- buf << _time.toString() << "|" << _proof;
+ buf << _time.toString() << "|" << _proof.toString();
return buf.str();
}
diff --git a/src/mongo/db/signed_logical_time.h b/src/mongo/db/signed_logical_time.h
index 52cf1230e58..7b96e51df79 100644
--- a/src/mongo/db/signed_logical_time.h
+++ b/src/mongo/db/signed_logical_time.h
@@ -36,7 +36,7 @@ namespace mongo {
/**
* The SignedLogicalTime class is a pair of value i.e. time and a signature i.e. _proof
- * The class is immutable and is used to hold the cryptogrphically protected LogicalTime.
+ * The class is immutable and is used to hold the cryptographically protected LogicalTime.
*/
class SignedLogicalTime {
public:
diff --git a/src/mongo/db/time_proof_service.h b/src/mongo/db/time_proof_service.h
index bc43e1ceee3..5be6bf46e38 100644
--- a/src/mongo/db/time_proof_service.h
+++ b/src/mongo/db/time_proof_service.h
@@ -29,6 +29,7 @@
#pragma once
#include "mongo/base/status.h"
+#include "mongo/crypto/sha1_block.h"
#include "mongo/db/logical_time.h"
namespace mongo {
@@ -40,14 +41,13 @@ namespace mongo {
class TimeProofService {
public:
// This type must be synchronized with the library that generates SHA1 or other proof.
- using TimeProof = std::string;
+ using TimeProof = SHA1Block;
/**
* Returns the proof matching the time argument.
*/
TimeProof getProof(LogicalTime time) {
- TimeProof proof = "12345678901234567890";
- return proof;
+ return SHA1Block();
}
/**