diff options
author | Badlop <badlop@process-one.net> | 2018-12-19 12:33:46 +0100 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2018-12-19 13:17:28 +0100 |
commit | 788d829823202b41d586b300763af87ea7d7b69f (patch) | |
tree | 5f43c2715d1c5efd1afb387d73a0ae397c952b54 /src/ejabberd_piefxis.erl | |
parent | Search also for _jid when importing room from prosody (#2723) (diff) |
Fix PIEFXIS export of user when password is scrammed (#2721)
Diffstat (limited to 'src/ejabberd_piefxis.erl')
-rw-r--r-- | src/ejabberd_piefxis.erl | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/ejabberd_piefxis.erl b/src/ejabberd_piefxis.erl index 541fcad8..b4e412d3 100644 --- a/src/ejabberd_piefxis.erl +++ b/src/ejabberd_piefxis.erl @@ -166,15 +166,10 @@ export_users([], _Server, _Fd) -> export_user(User, Server, Fd) -> Password = ejabberd_auth:get_password_s(User, Server), LServer = jid:nameprep(Server), - PasswordFormat = ejabberd_auth:password_format(LServer), - Pass = case Password of - {_,_,_,_} -> - case PasswordFormat of - scram -> format_scram_password(Password); - _ -> <<"">> - end; - _ -> Password - end, + Pass = case ejabberd_auth:password_format(LServer) of + scram -> format_scram_password(Password); + _ -> Password + end, Els = get_offline(User, Server) ++ get_vcard(User, Server) ++ get_privacy(User, Server) ++ @@ -186,7 +181,8 @@ export_user(User, Server, Fd) -> {<<"password">>, Pass}], children = Els})). -format_scram_password({StoredKey, ServerKey, Salt, IterationCount}) -> +format_scram_password(#scram{storedkey = StoredKey, serverkey = ServerKey, + salt = Salt, iterationcount = IterationCount}) -> StoredKeyB64 = base64:encode(StoredKey), ServerKeyB64 = base64:encode(ServerKey), SaltB64 = base64:encode(Salt), |