[Mageia-sysadm] [389] - print passphrase in hex (as ssss doesn't like binary files)

root at mageia.org root at mageia.org
Thu Feb 3 12:36:19 CET 2011


Revision: 389
Author:   boklm
Date:     2011-02-03 12:36:18 +0100 (Thu, 03 Feb 2011)
Log Message:
-----------
- print passphrase in hex (as ssss doesn't like binary files)
- limit to 100 bytes (as ssss only accepts 128)

Modified Paths:
--------------
    gpg/random-passphrase

Modified: gpg/random-passphrase
===================================================================
--- gpg/random-passphrase	2011-02-03 11:10:33 UTC (rev 388)
+++ gpg/random-passphrase	2011-02-03 11:36:18 UTC (rev 389)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-my $size = 200;
+my $size = 100;
 
 binmode(STDOUT, ":utf8");
 
@@ -11,7 +11,7 @@
     print STDERR "$size random bytes to read.\n";
     read $rf, $o, 1;
     if ($o ne "\n" && $o ne "\r") {
-	print $o;
+	print unpack("H*", $o);
 	$size--;
     }
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20110203/8ef0eef2/attachment.html>


More information about the Mageia-sysadm mailing list