Tadashi Okoshi
slash****@users*****
2006年 1月 19日 (木) 16:18:09 JST
Index: affelio/lib/Affelio/App/Admin/FriendsGraph.pm
diff -u affelio/lib/Affelio/App/Admin/FriendsGraph.pm:1.9 affelio/lib/Affelio/App/Admin/FriendsGraph.pm:1.10
--- affelio/lib/Affelio/App/Admin/FriendsGraph.pm:1.9 Wed Nov 23 13:00:19 2005
+++ affelio/lib/Affelio/App/Admin/FriendsGraph.pm Thu Jan 19 16:18:09 2006
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# $Id: FriendsGraph.pm,v 1.9 2005/11/23 04:00:19 slash5234 Exp $
+# $Id: FriendsGraph.pm,v 1.10 2006/01/19 07:18:09 slash5234 Exp $
package Affelio::App::Admin::FriendsGraph;
{
@@ -83,7 +83,7 @@
##################################################
#Get peer's friends list.
try{
- my $ret = get_F2List(dest_uri =>"$peer_af_id/bin/xml-rpc-serv.cgi",
+ my $ret = get_F2List(dest_uri =>"$peer_af_id",
timestamp => $last_updated);
debug_print("FriendsGraph::retrieve: \tget_F2List finished.");
debug_print("FriendsGraph::retrieve: \t[$ret]");
Index: affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm
diff -u affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm:1.2 affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm:1.3
--- affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm:1.2 Sun Dec 18 13:20:36 2005
+++ affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm Thu Jan 19 16:18:09 2006
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# $Id: MakeAffelioLink.pm,v 1.2 2005/12/18 04:20:36 slash5234 Exp $
+# $Id: MakeAffelioLink.pm,v 1.3 2006/01/19 07:18:09 slash5234 Exp $
package Affelio::App::Admin::MakeAffelioLink;
{
@@ -22,7 +22,6 @@
use lib("../../../../extlib/");
use Error qw(:try);
- use Crypt::DH;
use MIME::Base64::Perl;
use lib("../../../");
@@ -77,86 +76,26 @@
my $output_ref = shift;
my $wi = new Affelio::misc::WebInput;
- debug_print("MakeAffelioLink::send_request: start.");
+ debug_print("MakeAffelioLink::send: start.");
my $dest_uri = $wi->PTN_URL($cgi->param("dest_uri"));
- my $my_mesg = $cgi->param("my_mesg");
- debug_print("MakeAffelioLink::send_request: $dest_uri");
- debug_print("MakeAffelioLink::send_request: $my_mesg");
-
- _send_request($af, $dest_uri, $my_mesg);
-
- $output_ref->{ret_msg} = "Affelio Link Request has been sent to<BR><A HREF=\"$dest_uri\">$dest_uri</A>";
- return;
- }
-
-
-
- #######################################################################
- #show
- #######################################################################
- sub show{
- my $af= shift;
- my $q=shift;
- my $output_ref = shift;
- my $wi = new Affelio::misc::WebInput;
-
- debug_print("MakeAffelioLink::show start.");
-
- my $dest_uri = $wi->PTN_URL($q->url_param("dest_url"));
-
- $output_ref->{"dest_uri"} = $dest_uri;
-
- debug_print("MakeAffelioLink::show end.");
- }
-
-
- sub _send_request{
- my $af=shift;
- my $dest_uri= shift;
- my $my_mesg= shift;
-
- ######################
- #Remove "/" from the end of $dest_uri
- ######################
$dest_uri =~ s/\/$//;
- my $dest_xml_uri = $dest_uri . "/bin/xml-rpc-serv.cgi";
- debug_print("MakeAffelioLink::send_request: $dest_xml_uri\n");
-
- ###########################################
- # Get current time;
+ my $my_mesg = $cgi->param("my_mesg");
my $cur_time = get_timestamp();
-
- ###########################################
- #DH key generation
- my $mydh = Crypt::DH->new;
- #RFC 2412 - The OAKLEY Key Determination Protocol
- #Group 1: A 768 bit prime
- my $DH_g="2";
- my $DH_p="1552518092300708935130918131258481755631334049434514313202351194902966239949102107258669453876591642442910007680288864229150803718918046342632727613031282983744380820890196288509170691316593175367469551763119843371637221007210577919";
- $mydh->g($DH_g);
- $mydh->p($DH_p);
-
- #Step (1): create my public_key
- $mydh->generate_keys;
- my $my_DH_pub_key_str = $mydh->pub_key->bstr;
- my $my_DH_pri_key_str = $mydh->priv_key->bstr;
-
- debug_print("MakeAffelioLink::send_request: pri_key = $my_DH_pri_key_str [" . length($my_DH_pri_key_str) . "]digits");
- debug_print("MakeAffelioLink::send_request: pub_key = $my_DH_pub_key_str [" . length($my_DH_pub_key_str) . "]digits");
-
+ debug_print("MakeAffelioLink::send: $dest_uri");
+ debug_print("MakeAffelioLink::send: $my_mesg");
###########################################
# Send HandShake to the URL
###########################################
- my $ret="";
+ my $my_DH_pri_key_str="";
try{
- $ret = send_HandShake(dest_uri => $dest_xml_uri,
- timestamp => $cur_time,
- my_nickname => $af->{user__nickname},
- my_AFID => $af->{site__web_root},
- DH_pub_key_str => $my_DH_pub_key_str,
- mesg => $my_mesg);
+ $my_DH_pri_key_str
+ = send_HandShake(dest_uri => $dest_uri,
+ my_nickname => $af->{user__nickname},
+ my_AFID => $af->{site__web_root},
+ mesg => $my_mesg,
+ timestamp => $cur_time);
}catch Affelio::exception::NetworkException with{
my $E = shift;
throw Affelio::exception::CommunicationException($E);
@@ -164,23 +103,41 @@
my $E = shift;
throw Affelio::exception::CommunicationException($E);
};
- if($ret->{flerror} == 1){
- #XML-RPC communication was successful.
- #But the peer returned error. denyetc...
- throw Affelio::exception::CommunicationException($@);
- }
+ debug_print("MakeAffelioLink::send: send_HandShake returned success.");
###########################################
# Save peer's info into pending_DB
###########################################
my $tmpdb= new Affelio::SNS::Handshaker_tmpDB($af);
$tmpdb->add_sent_Handshake($cur_time,
- $dest_xml_uri,
+ $dest_uri,
"",
$cur_time,
$my_DH_pri_key_str);
- debug_print("MakeAffelioLink::send_request: wrote DB $dest_uri => $cur_time\n");
+ debug_print("MakeAffelioLink::send: wroteDB $dest_uri=>[$cur_time]\n");
+
+ $output_ref->{ret_msg} = "Affelio Link Request has been sent to<BR><A HREF=\"$dest_uri\">$dest_uri</A>";
+
+ debug_print("MakeAffelioLink::send: end.");
+ return;
}
+ #######################################################################
+ #show
+ #######################################################################
+ sub show{
+ my $af= shift;
+ my $q=shift;
+ my $output_ref = shift;
+ my $wi = new Affelio::misc::WebInput;
+
+ debug_print("MakeAffelioLink::show start.");
+
+ my $dest_uri = $wi->PTN_URL($q->url_param("dest_url"));
+
+ $output_ref->{"dest_uri"} = $dest_uri;
+
+ debug_print("MakeAffelioLink::show end.");
+ }
}
1;
Index: affelio/lib/Affelio/App/Admin/Messaging.pm
diff -u affelio/lib/Affelio/App/Admin/Messaging.pm:1.20 affelio/lib/Affelio/App/Admin/Messaging.pm:1.21
--- affelio/lib/Affelio/App/Admin/Messaging.pm:1.20 Mon Dec 19 13:08:13 2005
+++ affelio/lib/Affelio/App/Admin/Messaging.pm Thu Jan 19 16:18:09 2006
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# $Id: Messaging.pm,v 1.20 2005/12/19 04:08:13 slash5234 Exp $
+# $Id: Messaging.pm,v 1.21 2006/01/19 07:18:09 slash5234 Exp $
package Affelio::App::Admin::Messaging;
{
@@ -130,7 +130,7 @@
my $ret="";
try{
- $ret = post_Message(dest_uri => "$msg_to/bin/xml-rpc-serv.cgi",
+ $ret = post_Message(dest_uri => $msg_to,
src => $af->{site__web_root},
password => $passAB,
msg_from => $af->{site__web_root},