2022-05-22 14:59:45 +02:00
|
|
|
<?php require "../../common/html.php"; ?>
|
2021-05-22 14:07:25 +02:00
|
|
|
|
|
|
|
<form method="post">
|
|
|
|
|
2022-04-23 01:57:43 +02:00
|
|
|
<?php require "../../form.ns.php"; ?>
|
2022-04-18 16:05:00 +02:00
|
|
|
|
|
|
|
<br>
|
|
|
|
<label for="use">Utilisation</label>
|
|
|
|
<br>
|
|
|
|
<select required="" name="use" id="use">
|
|
|
|
<option value="" selected="" disabled="">-</option>
|
|
|
|
<option value="0">0 (PKIX-TA, <abbr title="also known as">aka<abbr> CA constraint)</option>
|
|
|
|
<option value="1">1 (PKIX-EE, <abbr title="also known as">aka<abbr> Service certificate constraint)</option>
|
|
|
|
<option value="2">2 (DANE-TA, <abbr title="also known as">aka<abbr> Trust Anchor Assertion)</option>
|
|
|
|
<option value="3">3 (DANE-EE, <abbr title="also known as">aka<abbr> Domain issued certificate)</option>
|
|
|
|
</select>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<label for="selector">Selecteur</label>
|
|
|
|
<br>
|
|
|
|
<select required="" name="selector" id="selector">
|
|
|
|
<option value="" selected="" disabled="">-</option>
|
|
|
|
<option value="0">0 (le certificat entier doit correspondre)</option>
|
|
|
|
<option value="1">1 (la clé publique du certificat doit correspondre)</option>
|
|
|
|
</select>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<label for="type">Type de correspondance</label>
|
|
|
|
<br>
|
|
|
|
<select required="" name="type" id="type">
|
|
|
|
<option value="" selected="" disabled="">-</option>
|
|
|
|
<option value="0">0 (certificat entier)</option>
|
|
|
|
<option value="1">1 (SHA-256)</option>
|
|
|
|
<option value="2">2 (SHA-512)</option>
|
|
|
|
</select>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<label for="content">Contenu</label>
|
|
|
|
<br>
|
|
|
|
<input id="content" minlenght="3" maxlength="1024" pattern="^[a-zA-Z0-9.-]{3,1024}$" placeholder="gjioerjgioer" name="content" type="text">
|
|
|
|
<br>
|
|
|
|
<input value="Valider" type="submit">
|
2021-05-22 14:07:25 +02:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
if (nsCommonRequirements()
|
2022-04-18 16:05:00 +02:00
|
|
|
AND isset($_POST['use'])
|
|
|
|
AND isset($_POST['selector'])
|
|
|
|
AND isset($_POST['type'])
|
|
|
|
AND isset($_POST['content'])
|
|
|
|
) {
|
2021-05-22 14:07:25 +02:00
|
|
|
|
2022-04-18 16:05:00 +02:00
|
|
|
$values = nsParseCommonRequirements();
|
2021-05-22 14:07:25 +02:00
|
|
|
|
2022-04-18 16:05:00 +02:00
|
|
|
if (!($_POST['use'] >= 0 AND $_POST['use'] <= 3))
|
2022-05-20 02:19:45 +02:00
|
|
|
userError("Wrong value for <code>use</code>.");
|
2021-05-22 14:07:25 +02:00
|
|
|
|
2022-04-18 16:05:00 +02:00
|
|
|
if (!($_POST['selector'] === "0" OR $_POST['selector'] === "1"))
|
2022-05-20 02:19:45 +02:00
|
|
|
userError("Wrong value for <code>selector</code>.");
|
2021-05-22 14:07:25 +02:00
|
|
|
|
2022-04-18 16:05:00 +02:00
|
|
|
if (!($_POST['type'] >= 0 OR $_POST['type'] <= 2))
|
2022-05-20 02:19:45 +02:00
|
|
|
userError("Wrong value for <code>type</code>.");
|
2021-05-22 14:07:25 +02:00
|
|
|
|
2022-04-18 16:05:00 +02:00
|
|
|
if (!(preg_match("/^[a-zA-Z0-9.-]{1,1024}$/", $_POST['content'])))
|
2022-05-20 02:19:45 +02:00
|
|
|
userError("Wrong value for <code>content</code>.");
|
2021-05-22 14:07:25 +02:00
|
|
|
|
2022-05-20 00:15:13 +02:00
|
|
|
exec(CONF['ns']['knotc_path'] . " zone-begin " . $_POST['zone']);
|
|
|
|
exec(CONF['ns']['knotc_path'] . " zone-" . $values['action'] . "set " . $_POST['zone'] . " " . $values['domain'] . " " . $values['ttl'] . " IN TLSA " . $_POST['use'] . " " . $_POST['selector'] . " " . $_POST['type'] . " " . $_POST['content']);
|
|
|
|
exec(CONF['ns']['knotc_path'] . " zone-commit " . $_POST['zone']);
|
2022-04-18 16:05:00 +02:00
|
|
|
echo "Enregistrement ajouté";
|
2021-05-22 14:07:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
2022-05-22 14:59:45 +02:00
|
|
|
<?php closeHTML(); ?>
|