mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 00:15:17 +00:00
Upgrade password system
This commit is contained in:
@ -22,18 +22,17 @@ pub fn sha1_str(input: &str) -> String {
|
||||
|
||||
/// One-way user password crypt
|
||||
///
|
||||
/// This method will have to be replaced by a stronger algorithm once this implementation is
|
||||
/// completely built.
|
||||
/// This method is just transitional
|
||||
///
|
||||
/// It currently depends on PHP
|
||||
///
|
||||
/// ```
|
||||
/// use comunic_server::utils::crypt_utils::crypt_pass;
|
||||
/// use comunic_server::utils::crypt_utils::legacy_crypt_pass;
|
||||
///
|
||||
/// let res = crypt_pass("secret").unwrap();
|
||||
/// let res = legacy_crypt_pass("secret").unwrap();
|
||||
/// assert_eq!(res, "e5GUe5kdeUMGs");
|
||||
/// ```
|
||||
pub fn crypt_pass(pass: &str) -> ResultBoxError<String> {
|
||||
pub fn legacy_crypt_pass(pass: &str) -> ResultBoxError<String> {
|
||||
let hash = sha1_str(pass);
|
||||
|
||||
let result = std::process::Command::new("/usr/bin/php")
|
||||
|
Reference in New Issue
Block a user