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

Side by Side Diff: secure_blob.h

Issue 2645008: Update on feedback, update dbus API, add unit tests. TEST=manual,unit,BVT BUG=3628 323 (Closed) Base URL: ssh://git@chromiumos-git/cryptohome.git
Patch Set: Address second round of feedback. Created 10 years, 6 months 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 | « platform.cc ('k') | secure_blob.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) 2009-2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009-2010 The Chromium OS 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 SECURE_BLOB_H_ 5 #ifndef SECURE_BLOB_H_
6 #define SECURE_BLOB_H_ 6 #define SECURE_BLOB_H_
7 7
8 #include "chromeos/utility.h" 8 #include <chromeos/utility.h>
9 9
10 namespace cryptohome { 10 namespace cryptohome {
11 11
12 typedef unsigned char SecureBlobElement; 12 typedef unsigned char SecureBlobElement;
13 13
14 // SecureBlob erases the contents on destruction. It does not guarantee erasure 14 // SecureBlob erases the contents on destruction. It does not guarantee erasure
15 // on resize, assign, etc. 15 // on resize, assign, etc.
16 class SecureBlob : public chromeos::Blob { 16 class SecureBlob : public chromeos::Blob {
17 public: 17 public:
18 SecureBlob(); 18 SecureBlob();
19 SecureBlob(chromeos::Blob::const_iterator begin, 19 SecureBlob(chromeos::Blob::const_iterator begin,
20 chromeos::Blob::const_iterator end); 20 chromeos::Blob::const_iterator end);
21 explicit SecureBlob(int size); 21 explicit SecureBlob(int size);
22 SecureBlob(const unsigned char* from, int from_length);
23 SecureBlob(const char* from, int from_length);
22 virtual ~SecureBlob(); 24 virtual ~SecureBlob();
23 25
24 void resize(size_type sz); 26 void resize(size_type sz);
25 void resize(size_type sz, const SecureBlobElement& x); 27 void resize(size_type sz, const SecureBlobElement& x);
28
29 void* data();
30 const void* const_data() const;
26 }; 31 };
27 32
28 } // cryptohome 33 } // cryptohome
29 34
30 #endif // SECURE_BLOB_H_ 35 #endif // SECURE_BLOB_H_
OLDNEW
« no previous file with comments | « platform.cc ('k') | secure_blob.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698