cvs: pear /Net_DNS generate_package_xml.php package.xml /Net_DNS/DNS/RR TSIG.php
| From: | Florian Anderiasch | Date: | Thu, 26 Oct 2006 14:30:11 +0000 |
| Subject: | cvs: pear /Net_DNS generate_package_xml.php package.xml /Net_DNS/DNS/RR TSIG.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-42823@lists.php.net to get a copy of this message | ||
fa Thu Oct 26 14:30:11 2006 UTC
Modified files:
/pear/Net_DNS generate_package_xml.php package.xml
/pear/Net_DNS/DNS/RR TSIG.php
Log:
removed mhash dependency
http://cvs.php.net/viewvc.cgi/pear/Net_DNS/generate_package_xml.php?r1=1.6&r2=1.7&diff_format=u
Index: pear/Net_DNS/generate_package_xml.php
diff -u pear/Net_DNS/generate_package_xml.php:1.6 pear/Net_DNS/generate_package_xml.php:1.7
--- pear/Net_DNS/generate_package_xml.php:1.6 Wed Oct 25 18:07:17 2006
+++ pear/Net_DNS/generate_package_xml.php Thu Oct 26 14:30:11 2006
@@ -72,7 +72,6 @@
}
$e = $pkg->addDependency('php', '4.2', 'ge', 'php');
-$e = $pkg->addDependency('mhash', null, 'has', 'ext');
$e = $pkg->addGlobalReplacement('package-info', '@package_version@',
'version');
$e = $pkg->addGlobalReplacement('pear-config', '@data_dir@',
'data_dir');
http://cvs.php.net/viewvc.cgi/pear/Net_DNS/package.xml?r1=1.24&r2=1.25&diff_format=u
Index: pear/Net_DNS/package.xml
diff -u pear/Net_DNS/package.xml:1.24 pear/Net_DNS/package.xml:1.25
--- pear/Net_DNS/package.xml:1.24 Wed Oct 25 18:07:18 2006
+++ pear/Net_DNS/package.xml Thu Oct 26 14:30:11 2006
@@ -32,7 +32,6 @@
</notes>
<deps>
<dep type="php" rel="ge" version="4.2"
optional="no"/>
- <dep type="ext" rel="has" optional="no">mhash</dep>
</deps>
<filelist>
<dir name="/" baseinstalldir="Net">
http://cvs.php.net/viewvc.cgi/pear/Net_DNS/DNS/RR/TSIG.php?r1=1.7&r2=1.8&diff_format=u
Index: pear/Net_DNS/DNS/RR/TSIG.php
diff -u pear/Net_DNS/DNS/RR/TSIG.php:1.7 pear/Net_DNS/DNS/RR/TSIG.php:1.8
--- pear/Net_DNS/DNS/RR/TSIG.php:1.7 Tue Nov 22 12:29:24 2005
+++ pear/Net_DNS/DNS/RR/TSIG.php Thu Oct 26 14:30:11 2006
@@ -185,7 +185,8 @@
$sigdata .= pack('nN', 0, $this->other_data);
}
- $this->mac = mhash(MHASH_MD5, $sigdata, $key);
+ //$this->mac = mhash(MHASH_MD5, $sigdata, $key);
+ $this->mac = $this->hmac($sigdata, $key, 'md5');
$this->mac_size = strlen($this->mac);
/*
@@ -218,7 +219,21 @@
}
return $rcode;
}
-
+ /* }}} */
+
+ /* Net_DNS_RR_TSIG::hmac() {{{ */
+ // Calculate HMAC according to RFC2104
+ // http://www.ietf.org/rfc/rfc2104.txt
+ // posted by mina86 at tlen dot pl on http://php.net/manual/en/function.md5.php
+ function hmac($data, $key, $hash = 'md5', $blocksize = 64) {
+ if (strlen($key)>$blocksize) {
+ $key = pack('H*', $hash($key));
+ }
+ $key = str_pad($key, $blocksize, chr(0));
+ $ipad = str_repeat(chr(0x36), $blocksize);
+ $opad = str_repeat(chr(0x5c), $blocksize);
+ return $hash(($key^$opad) . pack('H*', $hash(($key^$ipad) . $data)));
+ }
/* }}} */
}
/* }}} */