message: age: Base64-decode metadata arguments to "confirm" message
diff: @@ -8,6 +8,8 @@ use age_core::{
  };
  use bech32::Variant;
  use i18n_embed_fl::fl;
  +
  +use std::borrow::Borrow;
  use std::fmt;
  use std::io;
  use std::iter;
  @@ -227,8 +229,13 @@ fn handle_confirm<R: io::Read, W: io::Write, C: Callbacks>(
  callbacks: &C,
  ) -> Response {
  let message = String::from_utf8_lossy(&command.body);
  - let (yes_string, no_string) = match &command.args[..] {
  - [] => {
  + let mut strings = command
  + .args
  + .iter()
  + .take(2)
  + .map(|s| base64::decode_config(s, base64::STANDARD_NO_PAD));
  + let (yes_string, no_string) = match (strings.next(), strings.next()) {
  + (None, _) => {
  errors.push(PluginError::Other {
  kind: "internal".to_owned(),
  metadata: vec![],
  @@ -239,12 +246,29 @@ fn handle_confirm<R: io::Read, W: io::Write, C: Callbacks>(
  });
  return reply.fail();
  }
  - [yes_string] => (yes_string, None),
  - [yes_string, no_string, ..] => (yes_string, Some(no_string)),
  + (Some(Err(_)), _) | (_, Some(Err(_))) => {
  + errors.push(PluginError::Other {
  + kind: "internal".to_owned(),
  + metadata: vec![],
  + message: format!(
  + "The first two metadata arguments to the {} command must be Base64-encoded",
  + CMD_CONFIRM
  + ),
  + });
  + return reply.fail();
  + }
  + (Some(Ok(yes_string)), None) => (yes_string, None),
  + (Some(Ok(yes_string)), Some(Ok(no_string))) => (yes_string, Some(no_string)),
  };
  - if let Some(value) =
  - callbacks.confirm(&message, yes_string, no_string.as_ref().map(|s| s.as_str()))
  - {
  + if let Some(value) = callbacks.confirm(
  + &message,
  + &String::from_utf8_lossy(&yes_string),
  + no_string
  + .as_ref()
  + .map(|s| String::from_utf8_lossy(s))
  + .as_ref()
  + .map(|s| s.borrow()),
  + ) {
  reply.ok(Some(if value { "yes" } else { "no" }.as_bytes()))
  } else {
  reply.fail()
  