mirror of
https://github.com/ChronosX88/psyced.git
synced 2024-11-09 20:11:00 +00:00
should we do NAMEPREP automatically?
This commit is contained in:
parent
61ef5ce041
commit
9f9bdc4e20
@ -298,6 +298,7 @@ jabberMsg(XMLNode node) {
|
|||||||
sendmsg(origin,
|
sendmsg(origin,
|
||||||
"_dialback_request_verify", 0,
|
"_dialback_request_verify", 0,
|
||||||
([ "_INTERNAL_target_jabber" : source,
|
([ "_INTERNAL_target_jabber" : source,
|
||||||
|
// we shouldnt have to NAMEPREP a static string.. FIXME
|
||||||
"_INTERNAL_source_jabber" : NAMEPREP(_host_XMPP),
|
"_INTERNAL_source_jabber" : NAMEPREP(_host_XMPP),
|
||||||
"_dialback_key" : node[Cdata],
|
"_dialback_key" : node[Cdata],
|
||||||
"_tag" : streamid
|
"_tag" : streamid
|
||||||
|
@ -86,6 +86,7 @@ virtual inherit JABBER_PATH "common";
|
|||||||
|
|
||||||
// net/jabber is not ready for regular is_localhost
|
// net/jabber is not ready for regular is_localhost
|
||||||
#define is_localhost(a) (lower_case(a)) == _host_XMPP
|
#define is_localhost(a) (lower_case(a)) == _host_XMPP
|
||||||
|
// but.. what about NAMEPREP here?
|
||||||
|
|
||||||
|
|
||||||
#define JABSOURCE "_INTERNAL_source_jabber"
|
#define JABSOURCE "_INTERNAL_source_jabber"
|
||||||
|
@ -277,6 +277,7 @@ logon() {
|
|||||||
#endif
|
#endif
|
||||||
nodeHandler = #'jabberMsg;
|
nodeHandler = #'jabberMsg;
|
||||||
set_prompt("");
|
set_prompt("");
|
||||||
|
// we shouldn't have to NAMEPREP our SERVER_HOST for each new user.. FIXME
|
||||||
myjid = NODEPREP(MYLOWERNICK) +"@" + NAMEPREP(SERVER_HOST);
|
myjid = NODEPREP(MYLOWERNICK) +"@" + NAMEPREP(SERVER_HOST);
|
||||||
myjidresource = myjid +"/"+ RESOURCEPREP(resource);
|
myjidresource = myjid +"/"+ RESOURCEPREP(resource);
|
||||||
P2(("%O ready to rumble (%O)\n", myjidresource, ME))
|
P2(("%O ready to rumble (%O)\n", myjidresource, ME))
|
||||||
|
@ -132,6 +132,8 @@ static varargs void ready_freddie(vamixed ip) {
|
|||||||
|
|
||||||
static void create() {
|
static void create() {
|
||||||
PROTECT("CREATE")
|
PROTECT("CREATE")
|
||||||
|
string t;
|
||||||
|
|
||||||
#ifndef __PIKE__
|
#ifndef __PIKE__
|
||||||
master = previous_object();
|
master = previous_object();
|
||||||
restore_object(DATA_PATH "library");
|
restore_object(DATA_PATH "library");
|
||||||
@ -259,9 +261,10 @@ static void create() {
|
|||||||
#ifdef JABBER_PATH
|
#ifdef JABBER_PATH
|
||||||
register_target("xmpp:"+ myLowerCaseHost);
|
register_target("xmpp:"+ myLowerCaseHost);
|
||||||
# ifdef _host_XMPP
|
# ifdef _host_XMPP
|
||||||
register_localhost(lower_case(_host_XMPP));
|
t = NAMEPREP(_host_XMPP);
|
||||||
register_target(lower_case(_host_XMPP));
|
register_localhost(t);
|
||||||
register_target("xmpp:"+ lower_case(_host_XMPP));
|
register_target(t);
|
||||||
|
register_target("xmpp:"+ t);
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
// base64decode("test2000");
|
// base64decode("test2000");
|
||||||
|
@ -225,8 +225,8 @@ int logon(int neverfails) {
|
|||||||
P1(("%O believing dNSName %O\n", ME, m))
|
P1(("%O believing dNSName %O\n", ME, m))
|
||||||
// probably also: register_target?
|
// probably also: register_target?
|
||||||
// but be careful never to register_target wildcards
|
// but be careful never to register_target wildcards
|
||||||
if (stringp(m)) sAuthenticated(NAMEPREP(m));
|
if (stringp(m)) sAuthenticated(m);
|
||||||
else foreach(t : m) sAuthenticated(NAMEPREP(t));
|
else foreach(t : m) sAuthenticated(t);
|
||||||
}
|
}
|
||||||
//#ifdef _flag_allow_certificate_name_common // to be switched this year
|
//#ifdef _flag_allow_certificate_name_common // to be switched this year
|
||||||
# ifndef _flag_disallow_certificate_name_common
|
# ifndef _flag_disallow_certificate_name_common
|
||||||
@ -235,7 +235,7 @@ int logon(int neverfails) {
|
|||||||
// note: CN is deprecated for good reasons.
|
// note: CN is deprecated for good reasons.
|
||||||
else if (t = cert["2.5.4.3"]) {
|
else if (t = cert["2.5.4.3"]) {
|
||||||
P1(("%O believing CN %O\n", ME, t))
|
P1(("%O believing CN %O\n", ME, t))
|
||||||
sAuthenticated(NAMEPREP(t));
|
sAuthenticated(t);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
if (m = tls_query_connection_info(ME)) {
|
if (m = tls_query_connection_info(ME)) {
|
||||||
|
@ -598,7 +598,7 @@ vamixed getdata(string a) {
|
|||||||
#else
|
#else
|
||||||
# ifdef PSYC_TCP
|
# ifdef PSYC_TCP
|
||||||
// Authenticated
|
// Authenticated
|
||||||
} else if (qAuthenticated(NAMEPREP(u[UHost]))) {
|
} else if (qAuthenticated(u[UHost])) {
|
||||||
if (u[UTransport] && (u[UTransport] !=
|
if (u[UTransport] && (u[UTransport] !=
|
||||||
# if __EFUN_DEFINED__(tls_query_connection_state)
|
# if __EFUN_DEFINED__(tls_query_connection_state)
|
||||||
tls_query_connection_state() ? "s" :
|
tls_query_connection_state() ? "s" :
|
||||||
|
@ -120,10 +120,10 @@ int logon(int failure) {
|
|||||||
// probably also: register_target?
|
// probably also: register_target?
|
||||||
// but be careful never to register_target wildcards
|
// but be careful never to register_target wildcards
|
||||||
if (stringp(m))
|
if (stringp(m))
|
||||||
sAuthenticated(NAMEPREP(m));
|
sAuthenticated(m);
|
||||||
else
|
else
|
||||||
foreach(t : m)
|
foreach(t : m)
|
||||||
sAuthenticated(NAMEPREP(t));
|
sAuthenticated(t);
|
||||||
}
|
}
|
||||||
//#ifdef _flag_allow_certificate_name_common // to be switched this year
|
//#ifdef _flag_allow_certificate_name_common // to be switched this year
|
||||||
#ifndef _flag_disallow_certificate_name_common
|
#ifndef _flag_disallow_certificate_name_common
|
||||||
@ -132,7 +132,7 @@ int logon(int failure) {
|
|||||||
// note: CN is deprecated for good reasons.
|
// note: CN is deprecated for good reasons.
|
||||||
else if (t = cert["2.5.4.3"]) {
|
else if (t = cert["2.5.4.3"]) {
|
||||||
P1(("%O believing CN %O\n", ME, t))
|
P1(("%O believing CN %O\n", ME, t))
|
||||||
sAuthenticated(NAMEPREP(t));
|
sAuthenticated(t);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (m = tls_query_connection_info(ME)) {
|
if (m = tls_query_connection_info(ME)) {
|
||||||
@ -224,7 +224,7 @@ void circuit_msg(string mc, mapping vars, string data) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
u = parse_uniform(vars["_uniform_source"]);
|
u = parse_uniform(vars["_uniform_source"]);
|
||||||
u[UHost] = NAMEPREP(u[UHost]);
|
// qAuthenticated does that:u[UHost] = NAMEPREP(u[UHost]);
|
||||||
if (qAuthenticated(u[UHost])) {
|
if (qAuthenticated(u[UHost])) {
|
||||||
// possibly different _uniform_target only
|
// possibly different _uniform_target only
|
||||||
if (flags & TCP_PENDING_TIMEOUT) {
|
if (flags & TCP_PENDING_TIMEOUT) {
|
||||||
|
@ -163,7 +163,7 @@ void dispatch(mapping rvars, mapping evars, mixed method, mixed body) {
|
|||||||
}
|
}
|
||||||
#ifdef USE_VERIFICATION
|
#ifdef USE_VERIFICATION
|
||||||
# ifdef PSYC_TCP
|
# ifdef PSYC_TCP
|
||||||
unless (qAuthenticated(NAMEPREP(u[UHost]))) {
|
unless (qAuthenticated(u[UHost])) {
|
||||||
DISPATCHERROR("non-authenticated host\n")
|
DISPATCHERROR("non-authenticated host\n")
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
|
Loading…
Reference in New Issue
Block a user