From 44ee7c0f5ad0e48b30d8cda9b5a00aa65f7a36f9 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 15 Sep 2020 14:30:52 -0400 Subject: new name format --- bin/samizdat-ssh-uid | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'bin/samizdat-ssh-uid') diff --git a/bin/samizdat-ssh-uid b/bin/samizdat-ssh-uid index 94d8f8c..33cb2b4 100755 --- a/bin/samizdat-ssh-uid +++ b/bin/samizdat-ssh-uid @@ -19,12 +19,23 @@ SSH_CLIENT_FINGERPRINT=$(ssh-keygen -r . -f "${PEMFILE}" | sed -ne 's/^. IN SSHF SSH_CLIENT_FINGERPRINT_B32=$(b16_to_b32 "$SSH_CLIENT_FINGERPRINT") read keytype keydata < "${PEMFILE}" || die "reading from PEMFILE=$PEMFILE" -case "$keytype" in - ssh-rsa|ssh-dss|ecdsa-sha2-nistp256|ssh-ed25519) - domain=$keytype.cryptonomic.net ;; - *) - die "Unsupported key type: $keytype" ;; -esac + +ssh_keytag_to_path_fragment() +{ + case "$1" in + ssh-dss) echo dsa ;; + ecdsa-sha2-nistp256) echo ecdsa ;; + ssh-rsa|ssh-ed25519) echo ${1#ssh-} ;; + *) return 1 ;; + esac +} + +if keyfrag=$(ssh_keytag_to_path_fragment "$keytype") +then + domain=${keyfrag}.cryptonomic.net +else + die "Unsupported key type: $keytype" +fi if [ "$1" = '--copy-pem' -a "$2" ] then -- cgit v1.2.3