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

Side by Side Diff: src/platform/cryptohome/secure_blob.cc

Issue 2051003: Initial patch from Will. (Closed) Base URL: ssh://git@chromiumos-git/chromiumos
Patch Set: Address style nits. 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cryptohome/secure_blob.h"
6
7 namespace cryptohome {
8
9 SecureBlob::SecureBlob()
10 : chromeos::Blob() {
11 }
12
13 SecureBlob::SecureBlob(chromeos::Blob::const_iterator begin,
14 chromeos::Blob::const_iterator end)
15 : chromeos::Blob(begin, end) {
16 }
17
18 SecureBlob::SecureBlob(int size)
19 : chromeos::Blob(size) {
20 }
21
22 SecureBlob::~SecureBlob() {
23 chromeos::SecureMemset(&this->front(), this->capacity(), 0);
24 }
25
26 void SecureBlob::resize(size_type sz) {
27 if(sz < size()) {
28 chromeos::SecureMemset(&this->at(sz), size() - sz, 0);
29 }
30 chromeos::Blob::resize(sz);
31 }
32
33 void SecureBlob::resize(size_type sz, const SecureBlobElement& x) {
34 if(sz < size()) {
35 chromeos::SecureMemset(&this->at(sz), size() - sz, 0);
36 }
37 chromeos::Blob::resize(sz, x);
38 }
39
40 } // cryptohome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698