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

Unified Diff: src/platform/cryptohome/username_passhash.h

Issue 2051003: Initial patch from Will. (Closed) Base URL: ssh://git@chromiumos-git/chromiumos
Patch Set: Address style nits. Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: src/platform/cryptohome/username_passhash.h
diff --git a/src/platform/cryptohome/username_passhash.h b/src/platform/cryptohome/username_passhash.h
deleted file mode 100644
index 75351fad964916883ed8308ff8c2177c8637e3ca..0000000000000000000000000000000000000000
--- a/src/platform/cryptohome/username_passhash.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// UsernamePasshash wraps a username/salted password hash pair that
-// can be used to authenticate a user.
-
-#ifndef CRYPTOHOME_USERNAME_PASSHASH_H_
-#define CRYPTOHOME_USERNAME_PASSHASH_H_
-
-#include "cryptohome/credentials.h"
-
-#include <string.h>
-
-#include "base/basictypes.h"
-
-namespace cryptohome {
-
-class UsernamePasshash : public Credentials {
- public:
- // |passhash| is a weak hash of the user's password, using the same
- // algorithm that pam/pam_google/pam_mount use to get the user's
- // plaintext passhash safely passed on to the login session. That
- // means we compute a sha256sum of the ASCII encoded system salt plus
- // the plaintext passhash, ASCII encode the result, and take the first
- // 32 bytes. To say that in bash...
- //
- // $(cat <(echo -n $(xxd -p "$SYSTEM_SALT_FILE"))
- // <(echo -n "$PASSHASH") | sha256sum | head -c 32)
- //
- UsernamePasshash(const char *username, const int username_length,
- const char *passhash, const int passhash_length);
-
- ~UsernamePasshash() {}
-
- // Overridden from cryptohome::Credentials
- void GetFullUsername(char *name_buffer, int length) const;
- void GetPartialUsername(char *name_buffer, int length) const;
- std::string GetObfuscatedUsername(const chromeos::Blob &system_salt) const;
- std::string GetPasswordWeakHash(const chromeos::Blob &system_salt) const;
-
- private:
- std::string username_;
- std::string passhash_;
-
- DISALLOW_COPY_AND_ASSIGN(UsernamePasshash);
-};
-
-} // namespace cryptohome
-
-#endif // CRYPTOHOME_USERNAME_PASSHASH_H_

Powered by Google App Engine
This is Rietveld 408576698