 +			if (auth_parse_options(pw, line, file, 0) == 1)
 +				success = 1;
 +		}
-+
++	 waitpid_error:
 +		close(pipe_out[0]);
 +	}
 +

+		restore_uid();
+		return (-1);
+	case 0:
+		/* setup output pipe */
+		close(0);
+		close(pipe_out[0]);
+		dup2(pipe_out[1], 1);
+		close(pipe_out[1]);
+
+		/* BN_bn2hex allocates a string, but we cant free it anyway */
+		switch(key->type) {
+		case KEY_RSA1:
+		case KEY_RSA:
+			execl(file, file, "rsa", BN_bn2hex(key->rsa->e),
+				BN_bn2hex(key->rsa->n), NULL);
+		case KEY_DSA:
+			execl(file, file, "dsa", BN_bn2hex(key->dsa->p),
+				BN_bn2hex(key->dsa->q), BN_bn2hex(key->dsa->g),
+				BN_bn2hex(key->dsa->pub_key), NULL);
+		}
+
+		/* exec failed */
+		error("execl(): %s", strerror(errno));

 /* check whether given key is in .ssh/authorized_keys* */
 int
 user_key_allowed(struct passwd *pw, Key *key)
@@ -268,6 +359,15 @@ user_key_allowed(struct passwd *pw, Key *key)
 	file = authorized_keys_file2(pw);
 	success = user_key_allowed2(pw, key, file);
 	xfree(file);
