add ecdsa and ed25519 support for sshfp
Hanno Böck

Hanno Böck commited on 2014-09-20 11:39:48
Zeige 1 geänderte Dateien mit 14 Einfügungen und 3 Löschungen.

... ...
@@ -118,10 +118,21 @@ if ($type == 'spf' || $type == 'txt')
118 118
 
119 119
 if ($type == 'sshfp')
120 120
 {
121
-  $rsadefault = ($data['spec'] == 1) ? ' selected="selected"' : '';
122
-  $dsadefault = ($data['spec'] == 2) ? ' selected="selected"' : '';
121
+  $algs = array(
122
+    1 => "RSA",
123
+    2 => "DSA",
124
+    3 => "ECDSA",
125
+    4 => "ED25519" );
126
+
127
+  $option="";
128
+  foreach ($algs as $key => $alg) {
129
+    $option .= '<option value="'.$key.'" ';
130
+    if ($key == $data['spec']) $option .= 'selected="selected"';
131
+    $option .= '>'.$alg.' ('.$key.')</option>';
132
+  }
133
+ 
123 134
   $form .= '
124
-<tr><td><label for="spec">Algorithmus:</label></td><td><select name="spec" id="spec"><option value="1"'.$rsadefault.'>RSA (1)</option><option value="2"'.$dsadefault.'>DSS (2)</option></select></td></tr>
135
+<tr><td><label for="spec">Algorithmus:</label></td><td><select name="spec" id="spec">'.$option.'</select></td></tr>
125 136
 <tr><td><label for="data">Fingerabdruck:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
126 137
 ';
127 138
 }
128 139