From b793e80086e481735327368f8078c0d322042ec2 Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 27 Mar 2013 16:44:15 +0100 Subject: Actually the md5sigkey is directly given in hex revert partially previous commit --- config/openbgpd/openbgpd.inc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'config') diff --git a/config/openbgpd/openbgpd.inc b/config/openbgpd/openbgpd.inc index f099e44d..08108807 100644 --- a/config/openbgpd/openbgpd.inc +++ b/config/openbgpd/openbgpd.inc @@ -122,11 +122,8 @@ function openbgpd_install_conf() { $conffile .= " tcp md5sig password {$neighbor['md5sigpass']}\n"; } if($neighbor['md5sigkey']) { - $hex = ""; - for ($i = 0; $i < strlen($neighbor['md5sigkey']); $i++) - $hex .= dechex(ord($neighbor['md5sigkey'][$i])); - $setkeycf .= "add {$openbgpd_conf['listenip']} {$neighbor['neighbor']} tcp 0x1000 -A tcp-md5 0x{$hex};\n"; - $conffile .= " tcp md5sig key {$hex}\n"; + $setkeycf .= "add {$openbgpd_conf['listenip']} {$neighbor['neighbor']} tcp 0x1000 -A tcp-md5 0x{$neighbor['md5sigkey']};\n"; + $conffile .= " tcp md5sig key {$neighbor['md5sigkey']}\n"; } foreach($neighbor['row'] as $row) { $conffile .= " {$row['parameters']} {$row['parmvalue']} \n"; @@ -152,11 +149,8 @@ function openbgpd_install_conf() { $conffile .= " tcp md5sig password {$neighbor['md5sigpass']}\n"; } if ($neighbor['md5sigkey']) { - $hex = ""; - for ($i = 0; $i < strlen($neighbor['md5sigkey']); $i++) - $hex .= dechex(ord($neighbor['md5sigkey'][$i])); - $setkeycf .= "add {$openbgpd_conf['listenip']} {$neighbor['neighbor']} tcp 0x1000 -A tcp-md5 0x{$hex};\n"; - $conffile .= " tcp md5sig key {$hex}\n"; + $setkeycf .= "add {$openbgpd_conf['listenip']} {$neighbor['neighbor']} tcp 0x1000 -A tcp-md5 0x{$neighbor['md5sigkey']};\n"; + $conffile .= " tcp md5sig key {$neighbor['md5sigkey']}\n"; } $used_this_item = true; foreach($neighbor['row'] as $row) { -- cgit v1.2.3