the import_subkey function was in fact not implement at all. MUST FIX!
[monkeysphere.git] / src / share / m / import_subkey
index d71c2581719db705ce4dd8b44afe624b68ef569e..1823f71d69ae84b57973aa359f2ed5e587919e3f 100644 (file)
@@ -33,6 +33,9 @@ import_subkey() {
     # check that an authentication subkey does not already exist
     check_gpg_authentication_subkey "$keyID"
 
+    # FIXME: implement!
+    failure "implement me!"
+
     # setup the temp fifo dir for retrieving the key password
     log debug "creating password fifo..."
     fifoDir=$(msmktempdir)
@@ -42,12 +45,12 @@ import_subkey() {
     # import ssh key to as authentication subkey
     if [ "$sshKeyFile" = '-' ] ; then
        log verbose "importing ssh key from stdin..."
-       ssh2openpgp \
-           | gpg --passphrase-fd 3 3< "$fifoDir/pass" --expert --command-fd 0 --import &
+       PEM2OPENPGP_USAGE_FLAGS=authenticate pem2openpgp "$userID" \
+           | gpg_user --passphrase-fd 3 3< "$fifoDir/pass" --expert --command-fd 0 --import &
     else
        log verbose "importing ssh key from file '$sshKeyFile'..."
-       ssh2openpgp <"$sshKeyFile" \
-           | gpg --passphrase-fd 3 3< "$fifoDir/pass" --expert --command-fd 0 --import &
+       PEM2OPENPGP_USAGE_FLAGS=authenticate pem2openpgp "$userID" <"$sshKeyFile" \
+           | gpg_user --passphrase-fd 3 3< "$fifoDir/pass" --expert --command-fd 0 --import &
     fi
 
     # get the password if needed