]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/vpnmain.cgi
vpnmain.cgi: Generate random UUIDs
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / vpnmain.cgi
index 8cd43c30521437adbc9ca34bd5be53dc2c486898..601fc74927b535774912dc7b73d229780d8d36e9 100644 (file)
@@ -19,6 +19,7 @@
 #                                                                             #
 ###############################################################################
 
+use Data::UUID;
 use MIME::Base64;
 use Net::DNS;
 use File::Copy;
@@ -1184,11 +1185,14 @@ END
        &General::readhasharray("${General::swroot}/vpn/config", \%confighash);
        my $key = $cgiparams{'KEY'};
 
-       my $uuid1 = "AAAABBBB";
-       my $uuid2 = "CCCCDDDD";
+       # Create a UUID generator
+       my $uuid = Data::UUID->new();
+
+       my $uuid1 = $uuid->create_str();
+       my $uuid2 = $uuid->create_str();
 
        my $cert = "";
-       my $cert_uuid = "123456789";
+       my $cert_uuid = $uuid->create_str();
 
        # Read and encode certificate
        if ($confighash{$key}[4] eq "cert") {