chiark / gitweb /
keyfunc.sh.in, cryptop.{genkey,recover}: Care over key ownership.
[distorted-keys] / cryptop.recover
index f66156938d80e240fbcc9a07ab16b70191d4f64c..26142e99533ab0761ef8669a82026450e19f9639 100755 (executable)
@@ -38,11 +38,15 @@ key=$1 recov=$2
 parse_keylabel "$key"
 if [ ! -d $kdir ]; then echo >&2 "$quis: unknown key \`$key'"; exit 1; fi
 checkword "recovery key label" "$recov"
+case $kowner in
+  $USERV_USER) ;;
+  *) echo >&2 "$quis: you're not the owner of key \`$key'"; exit 1 ;;
+esac
 
 mktmp
 nubid=$(cat $kdir/nubid)
 readmeta $kdir
-read_profile "$profile"
+read_profile $kowner "$profile"
 if [ -f $knub ]; then
   nubbin=$(nubid <$knub)
   case "$nubbin" in