servnest/public/ns/dnssec.php
2022-04-23 01:57:43 +02:00

75 lines
1.3 KiB
PHP

<?php require "../../common/top.php"; ?>
Afin d'activer DNSSEC, vous devez indiquer un enregistrement DS à la zone parente.
<form method="post">
<select required="" name="zone" id="zone">
<option value="" disabled="" selected="">---</option>
<?php
$zones = nsListUserZones($_SESSION['username']);
if ($zones) {
foreach($zones as $zone) {
echo "<option value='" . $zone . "'>" . $zone . "</option>";
}
}
?>
</select>
<br>
<input value="Valider" type="submit">
</form>
<?php
if (isset($_POST['zone']) AND isset($_SESSION['username'])) {
antiCSRF();
nsCheckZonePossession($_POST['zone']);
exec(KEYMGR_PATH . " " . $_POST['zone'] . " ds", $output);
$l0 = explode(" ", $output[0]);
$l1 = explode(" ", $output[1]);
?>
<dl>
<dt>Zone</dt>
<dd>
<code><?= $_POST['zone'] ?></code>
</dd>
<dt>Tag</dt>
<dd>
<code><?= $l0[2] ?></code>
</dd>
<dt>Algorithme</dt>
<dd>
<code>15</code> (Ed25519)
</dd>
<dt>Condensat de type <code>2</code> (SHA-256)</dt>
<dd>
<code><?= $l0[5] ?></code>
</dd>
<dt>Condensat de type <code>4</code> (SHA-384 ; optionnel)</dt>
<dd>
<code><?= $l1[5] ?></code>
</dd>
</dl>
<details>
<summary>Données brutes</summary>
<code><?= $output[0] ?></code><br><code><?= $output[1] ?></code>
</details>
<?php } ?>
<?php require "../../common/bottom.php"; ?>