summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-23 17:48:36 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-23 17:48:36 +0000
commita173699822603988389b4f7ea55e5910ebe9ba4a (patch)
tree706dc198d825ce11ba12ffe137c9376cd945a069
parenteca52c90e80f76c1fdffb5b1420a9cc4641de2fb (diff)
downloadmanaserv-a173699822603988389b4f7ea55e5910ebe9ba4a.tar.gz
manaserv-a173699822603988389b4f7ea55e5910ebe9ba4a.tar.bz2
manaserv-a173699822603988389b4f7ea55e5910ebe9ba4a.tar.xz
manaserv-a173699822603988389b4f7ea55e5910ebe9ba4a.zip
Fixed docs not to mention encryption, since all we do is hashing. Also, since
we decided not to use libcrypto, remove its configure check.
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac3
-rw-r--r--src/account-server/account.hpp49
3 files changed, 26 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index b3e58616..3e116c5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,10 @@
* src/game-server/mapmanager.cpp, src/game-server/mapmanager.hpp:
Accepted fix by rodge, getting rid of assertion failure when an admin
tries to warp to a non-existing map.
+ * src/account-server/account.hpp: Fixed docs not to mention
+ encryption, since all we do is hashing.
+ * configure.ac: Since we decided not to use libcrypto, remove its
+ configure check.
2008-04-22 Bjørn Lindeijer <bjorn@lindeijer.nl>
diff --git a/configure.ac b/configure.ac
index e73c9dbd..d8ef919d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,9 +17,6 @@ AC_PROG_INSTALL
# Checks for libraries.
-AC_CHECK_LIB([crypto], [EVP_md5], ,
-AC_MSG_ERROR([ *** Unable to find libcrypto library]))
-
AC_CHECK_LIB([physfs], [PHYSFS_init], ,
AC_MSG_ERROR([ *** Unable to find PhysFS library (icculus.org/physfs/)]))
diff --git a/src/account-server/account.hpp b/src/account-server/account.hpp
index 4414cb27..59f25f75 100644
--- a/src/account-server/account.hpp
+++ b/src/account-server/account.hpp
@@ -29,19 +29,8 @@
#include "account-server/character.hpp"
/**
- * Notes:
- * - change from the previous implementation: this class does not encrypt
- * passwords anymore and will just store the passwords as they are
- * passed to setPassword().
- * - the encryption should and must be performed externally from this
- * class or else we would end up with the password being encrypted many
- * times (e.g setPassword(getPassword()) would encrypt the password
- * twice or setPassword(encrypted_password_from_database) would also
- * encrypt the password twice).
- */
-
-/**
- * A player's account.
+ * A player's account. Stores the account information as well as the
+ * player characters available under this account.
*/
class Account
{
@@ -77,36 +66,42 @@ class Account
/**
- * Set the user password.
+ * Set the user password. The password is expected to be already
+ * hashed with a salt.
+ *
+ * The hashing must be performed externally from this class or else
+ * we would end up with the password being hashed many times
+ * (e.g setPassword(getPassword()) would hash the password twice.
*
- * @param password the user password.
+ * @param password the user password (hashed with salt).
*/
void setPassword(std::string const &password)
{ mPassword = password; }
/**
- * Get the user password.
+ * Get the user password (hashed with salt).
*
- * @return the user password.
+ * @return the user password (hashed with salt).
*/
std::string const &getPassword() const
{ return mPassword; }
/**
- * Set the user email address.
+ * Set the user email address. The email address is expected to be
+ * already hashed.
*
- * @param email the user email address.
+ * @param email the user email address (hashed).
*/
void setEmail(std::string const &email)
{ mEmail = email; }
/**
- * Get the user email address.
+ * Get the user email address (hashed).
*
- * @return the user email address.
+ * @return the user email address (hashed).
*/
std::string const &getEmail() const
{ return mEmail; }
@@ -190,12 +185,12 @@ class Account
private:
- std::string mName; /**< user name */
- std::string mPassword; /**< user password (encrypted with salt) */
- std::string mEmail; /**< user email address (encrypted) */
- Characters mCharacters; /**< Character data */
- int mID; /**< unique id */
- unsigned char mLevel; /**< account level */
+ std::string mName; /**< User name */
+ std::string mPassword; /**< User password (hashed with salt) */
+ std::string mEmail; /**< User email address (hashed) */
+ Characters mCharacters; /**< Character data */
+ int mID; /**< Unique id */
+ unsigned char mLevel; /**< Account level */
};
typedef std::vector< Account * > Accounts;