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