Skip to content

Commit

Permalink
Fixed installation error: check on RSA generated key
Browse files Browse the repository at this point in the history
  • Loading branch information
gubi committed Dec 10, 2013
1 parent f6aaf4a commit a46c6a7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
// Generate RSA key
if(!file_exists("common/include/conf/rsa_2048_priv.pem")) {
shell_exec('openssl genrsa -out common/include/conf/rsa_2048_priv.pem 2048');
if(!file_exists("common/include/conf/rsa_2048_pub.pem")) {
shell_exec('openssl rsa -pubout -in common/include/conf/rsa_2048_priv.pem -out common/include/conf/rsa_2048_pub.pem');
if(file_exists("common/include/conf/rsa_2048_priv.pem")) {
if(!file_exists("common/include/conf/rsa_2048_pub.pem")) {
shell_exec('openssl rsa -pubout -in common/include/conf/rsa_2048_priv.pem -out common/include/conf/rsa_2048_pub.pem');
}
} else {
header("Content-type: text/plain");
print "OUCH!\nNon riesco a creare le chiavi RSA per questo device.\nPer favore dai i permessi in scrittura alla directory common/include/conf.";
exit();
}
}
if(isset($_GET["s"]) && trim($_GET["s"]) !== "") {
Expand Down

0 comments on commit a46c6a7

Please sign in to comment.