summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-03-01 03:24:20 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-03-01 03:24:20 -0500
commit207272adad58f4ee86f961367e56fd478c754b39 (patch)
treeae620ebf838eebf3976901a54f452ebff5a816e9 /src
parent620e3d1021993760ef7572ed9e5d6bf9f033b91e (diff)
fix rounding issue. Thanks, Richard K Darst!
Diffstat (limited to 'src')
-rwxr-xr-xsrc/keytrans/pem2openpgp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/keytrans/pem2openpgp b/src/keytrans/pem2openpgp
index 73becfe..8bf17fb 100755
--- a/src/keytrans/pem2openpgp
+++ b/src/keytrans/pem2openpgp
@@ -29,6 +29,7 @@ use Crypt::OpenSSL::Bignum;
use Crypt::OpenSSL::Bignum::CTX;
use Digest::SHA1;
use MIME::Base64;
+use POSIX;
## make sure all length() and substr() calls use bytes only:
use bytes;
@@ -329,7 +330,7 @@ sub read_mpi {
$bitlen = unpack('n', $bitlen);
$$readtally += 2;
- my $bytestoread = ($bitlen + 7)/8;
+ my $bytestoread = POSIX::floor(($bitlen + 7)/8);
my $ret;
read($instr, $ret, $bytestoread) or die "could not read MPI body.\n";
$$readtally += $bytestoread;