aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-04-29 09:43:46 +0000
committerWerner Koch <[email protected]>2021-04-29 09:43:46 +0000
commit3db99b8861a7544efee13be45d14bbac63c0c868 (patch)
tree6a9b6076ef7b1f0186862ed86adc785dfd7b6379
parentscd: Extend an internal function to also return the algo. (diff)
downloadgnupg-3db99b8861a7544efee13be45d14bbac63c0c868.tar.gz
gnupg-3db99b8861a7544efee13be45d14bbac63c0c868.zip
scd: Minor changes to assist in backporting from 2.3
* scd/command.c (send_status_direct): Return an error code. * scd/app-common.h (APP_LEARN_FLAG_REREAD): New.
-rw-r--r--scd/app-common.h1
-rw-r--r--scd/command.c10
-rw-r--r--scd/scdaemon.h3
3 files changed, 9 insertions, 5 deletions
diff --git a/scd/app-common.h b/scd/app-common.h
index 9240c5f05..299465023 100644
--- a/scd/app-common.h
+++ b/scd/app-common.h
@@ -46,6 +46,7 @@
/* Flags used by the app_write_learn_status. */
#define APP_LEARN_FLAG_KEYPAIRINFO 1 /* Return only keypair infos. */
#define APP_LEARN_FLAG_MULTI 2 /* Return info for all apps. */
+#define APP_LEARN_FLAG_REREAD 4 /* Re-read infos from the token. */
/* List of supported card types. Generic is the usual ISO7817-4
diff --git a/scd/command.c b/scd/command.c
index a4557eb50..e8c9ff66d 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -1897,15 +1897,17 @@ send_status_info (ctrl_t ctrl, const char *keyword, ...)
/* Send a ready formatted status line via assuan. */
-void
+gpg_error_t
send_status_direct (ctrl_t ctrl, const char *keyword, const char *args)
{
assuan_context_t ctx = ctrl->server_local->assuan_ctx;
if (strchr (args, '\n'))
- log_error ("error: LF detected in status line - not sending\n");
- else
- assuan_write_status (ctx, keyword, args);
+ {
+ log_error ("error: LF detected in status line - not sending\n");
+ return gpg_error (GPG_ERR_INTERNAL);
+ }
+ return assuan_write_status (ctx, keyword, args);
}
diff --git a/scd/scdaemon.h b/scd/scdaemon.h
index 900af5b39..806ad8f1a 100644
--- a/scd/scdaemon.h
+++ b/scd/scdaemon.h
@@ -124,7 +124,8 @@ gpg_error_t initialize_module_command (void);
int scd_command_handler (ctrl_t, int);
void send_status_info (ctrl_t ctrl, const char *keyword, ...)
GPGRT_ATTR_SENTINEL(1);
-void send_status_direct (ctrl_t ctrl, const char *keyword, const char *args);
+gpg_error_t send_status_direct (ctrl_t ctrl, const char *keyword,
+ const char *args);
gpg_error_t send_status_printf (ctrl_t ctrl, const char *keyword,
const char *format, ...) GPGRT_ATTR_PRINTF(3,4);