diff options
author | samantharitter <samantha.ritter@10gen.com> | 2017-06-27 12:09:40 -0400 |
---|---|---|
committer | Jason Carey <jcarey@argv.me> | 2017-07-13 17:40:53 -0400 |
commit | e1cae24805e3e7282958ee67a01555dd6ce40039 (patch) | |
tree | ebce77d9a502a193784483b2201b65e1a5010d98 /src/mongo/crypto/sha1_block.h | |
parent | 9a49ee3a03e02597086e577f06a71a0723bc0582 (diff) | |
download | mongo-e1cae24805e3e7282958ee67a01555dd6ce40039.tar.gz |
SERVER-29610 Allow LogicalSessionIds to contain signed user information
Diffstat (limited to 'src/mongo/crypto/sha1_block.h')
-rw-r--r-- | src/mongo/crypto/sha1_block.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/crypto/sha1_block.h b/src/mongo/crypto/sha1_block.h index 3cead63d6f9..7beaba8074d 100644 --- a/src/mongo/crypto/sha1_block.h +++ b/src/mongo/crypto/sha1_block.h @@ -31,7 +31,9 @@ #include <array> #include <cstddef> #include <string> +#include <vector> +#include "mongo/base/data_range.h" #include "mongo/base/status_with.h" namespace mongo { @@ -85,6 +87,10 @@ public: uint8_t* data() const&& = delete; + ConstDataRange toCDR() const { + return ConstDataRange(reinterpret_cast<const char*>(_hash.data()), kHashLength); + } + size_t size() const { return _hash.size(); } @@ -95,6 +101,11 @@ public: static StatusWith<SHA1Block> fromBinData(const BSONBinData& binData); /** + * Make a new SHA1Block from a vector of bytes representing bindata. For IDL. + */ + static SHA1Block fromBinData(std::vector<unsigned char> bytes); + + /** * Append this to a builder using the given name as a BSON BinData type value. */ void appendAsBinData(BSONObjBuilder& builder, StringData fieldName) const; |