]> git.ipfire.org Git - ipfire.org.git/commitdiff
people: Show key type of SSH keys
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 18 Oct 2018 10:14:17 +0000 (11:14 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 18 Oct 2018 10:14:17 +0000 (11:14 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/people/ssh-keys/index.html

index 30d94533234454142213cec852ceb764fa44c9b6..a3884e9f1a0c3429b95b44cda2164fe25e752558 100644 (file)
@@ -8,12 +8,26 @@
        <ul class="list-group mb-3">
                {% for key in account.ssh_keys %}
                        <li class="list-group-item">
-                               <h5 class="mb-3">
+                               <h5 class="mb-1">
                                        <a class="text-dark" href="/users/{{ account.uid }}/ssh-keys/{{ key.hash_sha256() }}">
                                                {{ key.comment or _("%s Key") % key.key_type.decode() }}
                                        </a>
                                </h5>
 
+                               <p class="small text-muted mb-3">
+                                       {% if key.key_type == b"ssh-rsa" %}
+                                               {{ _("RSA") }}
+                                       {% elif key.key_type.startswith(b"ecdsa-sha") %}
+                                               {{ _("ECDSA") }}
+                                       {% elif key.key_type == b"ssh-ed25519" %}
+                                               {{ _("Ed25519") }}
+                                       {% else %}
+                                               {{ key.key_type.decode() }}
+                                       {% end %}
+
+                                       {{ _("%s Bit") % key.bits }}
+                               </p>
+
                                <p class="text-monospace small text-truncate">
                                        {% for h in (key.hash_md5(), key.hash_sha256(), key.hash_sha512()) %}
                                                {{ h }}<br>