mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
Replace jlib:nameprep/1 by exmpp_stringprep:nameprep/1 and change the
error handling. PR: EJABP-1 SVN Revision: 1618
This commit is contained in:
parent
ccd94bb734
commit
c0e4af9ac0
@ -8,6 +8,10 @@
|
||||
was passed to exmpp_jid:jid_to_list/1 instead of a #jid. Now we use
|
||||
exmpp_jid:jid_to_list/3. Thanks to Pablo Polvorin!
|
||||
|
||||
* src/ejabberd_s2s_in.erl (wait_for_feature_request/2): Replace
|
||||
jlib:nameprep/1 by exmpp_stringprep:nameprep/1 and change the error
|
||||
handling.
|
||||
|
||||
2008-10-09 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
* src/ejabberd_c2s.erl: Fix handling of unauthenticated stanzas which
|
||||
|
@ -255,35 +255,35 @@ wait_for_feature_request({xmlstreamelement, El}, StateData) ->
|
||||
#xmlel{ns = ?NS_SASL, name = 'auth'} when TLSEnabled ->
|
||||
case exmpp_server_sasl:next_step(El) of
|
||||
{auth, "EXTERNAL", Auth} ->
|
||||
AuthDomain = jlib:nameprep(Auth),
|
||||
AuthRes =
|
||||
case (StateData#state.sockmod):get_peer_certificate(
|
||||
{AuthDomain, AuthRes} = try
|
||||
AuthDomain0 = exmpp_stringprep:nameprep(Auth),
|
||||
AuthRes0 = case (StateData#state.sockmod):get_peer_certificate(
|
||||
StateData#state.socket) of
|
||||
{ok, Cert} ->
|
||||
case (StateData#state.sockmod):get_verify_result(
|
||||
StateData#state.socket) of
|
||||
0 ->
|
||||
case AuthDomain of
|
||||
error ->
|
||||
case idna:domain_utf8_to_ascii(AuthDomain0) of
|
||||
false ->
|
||||
false;
|
||||
_ ->
|
||||
case idna:domain_utf8_to_ascii(AuthDomain) of
|
||||
false ->
|
||||
false;
|
||||
PCAuthDomain ->
|
||||
lists:any(
|
||||
fun(D) ->
|
||||
match_domain(
|
||||
PCAuthDomain, D)
|
||||
end, get_cert_domains(Cert))
|
||||
end
|
||||
PCAuthDomain ->
|
||||
lists:any(
|
||||
fun(D) ->
|
||||
match_domain(
|
||||
PCAuthDomain, D)
|
||||
end, get_cert_domains(Cert))
|
||||
end;
|
||||
_ ->
|
||||
false
|
||||
end;
|
||||
error ->
|
||||
false
|
||||
{undefined, false}
|
||||
end,
|
||||
{AuthDomain0, AuthRes0}
|
||||
catch
|
||||
_ ->
|
||||
false
|
||||
end,
|
||||
if
|
||||
AuthRes ->
|
||||
(StateData#state.sockmod):reset_stream(
|
||||
|
Loading…
Reference in New Issue
Block a user