mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +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
|
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!
|
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>
|
2008-10-09 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||||
|
|
||||||
* src/ejabberd_c2s.erl: Fix handling of unauthenticated stanzas which
|
* 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 ->
|
#xmlel{ns = ?NS_SASL, name = 'auth'} when TLSEnabled ->
|
||||||
case exmpp_server_sasl:next_step(El) of
|
case exmpp_server_sasl:next_step(El) of
|
||||||
{auth, "EXTERNAL", Auth} ->
|
{auth, "EXTERNAL", Auth} ->
|
||||||
AuthDomain = jlib:nameprep(Auth),
|
{AuthDomain, AuthRes} = try
|
||||||
AuthRes =
|
AuthDomain0 = exmpp_stringprep:nameprep(Auth),
|
||||||
case (StateData#state.sockmod):get_peer_certificate(
|
AuthRes0 = case (StateData#state.sockmod):get_peer_certificate(
|
||||||
StateData#state.socket) of
|
StateData#state.socket) of
|
||||||
{ok, Cert} ->
|
{ok, Cert} ->
|
||||||
case (StateData#state.sockmod):get_verify_result(
|
case (StateData#state.sockmod):get_verify_result(
|
||||||
StateData#state.socket) of
|
StateData#state.socket) of
|
||||||
0 ->
|
0 ->
|
||||||
case AuthDomain of
|
case idna:domain_utf8_to_ascii(AuthDomain0) of
|
||||||
error ->
|
false ->
|
||||||
false;
|
false;
|
||||||
_ ->
|
PCAuthDomain ->
|
||||||
case idna:domain_utf8_to_ascii(AuthDomain) of
|
lists:any(
|
||||||
false ->
|
fun(D) ->
|
||||||
false;
|
match_domain(
|
||||||
PCAuthDomain ->
|
PCAuthDomain, D)
|
||||||
lists:any(
|
end, get_cert_domains(Cert))
|
||||||
fun(D) ->
|
|
||||||
match_domain(
|
|
||||||
PCAuthDomain, D)
|
|
||||||
end, get_cert_domains(Cert))
|
|
||||||
end
|
|
||||||
end;
|
end;
|
||||||
_ ->
|
_ ->
|
||||||
false
|
false
|
||||||
end;
|
end;
|
||||||
error ->
|
error ->
|
||||||
false
|
{undefined, false}
|
||||||
end,
|
end,
|
||||||
|
{AuthDomain0, AuthRes0}
|
||||||
|
catch
|
||||||
|
_ ->
|
||||||
|
false
|
||||||
|
end,
|
||||||
if
|
if
|
||||||
AuthRes ->
|
AuthRes ->
|
||||||
(StateData#state.sockmod):reset_stream(
|
(StateData#state.sockmod):reset_stream(
|
||||||
|
Loading…
Reference in New Issue
Block a user