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

Unified Diff: username_passkey.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/mount ('k') | username_passkey.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: username_passkey.h
diff --git a/username_passkey.h b/username_passkey.h
index e2dc99f67891babb3ee176dbe1cfdb2556cc0bbd..15b9399b0251ec53c8b1ae4b52707c05bb9c1281 100644
--- a/username_passkey.h
+++ b/username_passkey.h
@@ -8,51 +8,32 @@
#ifndef CRYPTOHOME_USERNAME_PASSKEY_H_
#define CRYPTOHOME_USERNAME_PASSKEY_H_
-#include "cryptohome/credentials.h"
+#include "credentials.h"
-#include <string.h>
-
-#include "base/basictypes.h"
+#include <base/basictypes.h>
+#include <string>
namespace cryptohome {
class UsernamePasskey : public Credentials {
public:
- // Constructs UsernamePasskey from username strings and passkeys
- UsernamePasskey(const char *username, const int username_length,
- const char *passkey, const int passkey_length);
- UsernamePasskey(const char *username, const int username_length,
- const chromeos::Blob& passkey);
- UsernamePasskey(const char *username, const int username_length,
- const std::string& passkey);
- UsernamePasskey(const UsernamePasskey& rhs);
+ // Constructs UsernamePasskey from username strings and passkeys and passwords
+ UsernamePasskey(const char* username, const chromeos::Blob& passkey);
~UsernamePasskey();
- UsernamePasskey& operator=(const UsernamePasskey& rhs);
-
- // Constructs UsernamePasskey from a username and password, converting the
- // password to a passkey using the given salt
- static UsernamePasskey FromUsernamePassword(const char* username,
- const char* password,
- const chromeos::Blob& salt);
-
// Overridden from cryptohome::Credentials
void GetFullUsername(char *name_buffer, int length) const;
- std::string GetFullUsername() const;
+ std::string GetFullUsernameString() const;
void GetPartialUsername(char *name_buffer, int length) const;
std::string GetObfuscatedUsername(const chromeos::Blob &system_salt) const;
- SecureBlob GetPasskey() const;
+ void GetPasskey(SecureBlob* passkey) const;
private:
- static SecureBlob PasswordToPasskey(const char *password,
- const chromeos::Blob& salt);
- static void AsciiEncodeToBuffer(const unsigned char* source,
- int source_length, char* buffer,
- int buffer_length);
-
std::string username_;
SecureBlob passkey_;
+
+ DISALLOW_COPY_AND_ASSIGN(UsernamePasskey);
};
} // namespace cryptohome
« no previous file with comments | « tests/mount ('k') | username_passkey.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698