summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-02-03 21:36:07 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-02-03 21:36:07 -0500
commit17b89ec0f5ff0fce733f60b6973e8fc372d7c037 (patch)
tree98cc8b39b16581d0db03e52b220fe6275adfc0ce /src
parent4fcff7688ff46ed5d6f8fb013a659f8bce027226 (diff)
stupid perl flailing in pem2openpgp.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/keytrans/pem2openpgp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/keytrans/pem2openpgp b/src/keytrans/pem2openpgp
index 0910d07..61ce00f 100755
--- a/src/keytrans/pem2openpgp
+++ b/src/keytrans/pem2openpgp
@@ -352,14 +352,17 @@ my $hash_algo = pack('C', $digests->{sha1});
# could an environment variable (if set) override the current time, to
# be able to create a standard key? If we read the key from a file
# instead of stdin, should we use the creation time on the file?
-my $timestamp = $ENV{PEM2OPENPGP_TIMESTAMP};
-if (! defined $timestamp)
+my $timestamp = 0;
+if (defined $ENV{PEM2OPENPGP_TIMESTAMP}) {
+ $timestamp = ($ENV{PEM2OPENPGP_TIMESTAMP} + 0);
+} else {
$timestamp = time();
+}
my $flags = 0;
-if (! defined $ENV{PEM2OPENPGP_USAGE_FLAGS})
+if (! defined $ENV{PEM2OPENPGP_USAGE_FLAGS}) {
$flags = $usage_flags->{authenticate};
-else {
+} else {
my @ff = split(",", $ENV{PEM2OPENPGP_USAGE_FLAGS});
foreach $f (@ff) {
if (! defined $usage_flags->{$f})