mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-17 14:07:03 +01:00
Add gpgsm server command GETINFO agent-check.
Fix tests.
This commit is contained in:
parent
7d63aa42e5
commit
8381a43ca7
@ -1,3 +1,8 @@
|
|||||||
|
2008-09-30 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* server.c (cmd_getinfo): New subcommand agent-check.
|
||||||
|
* call-agent.c (gpgsm_agent_send_nop): New.
|
||||||
|
|
||||||
2008-09-29 Werner Koch <wk@g10code.com>
|
2008-09-29 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* certcheck.c (MY_GCRY_PK_ECDSA): Remove. Change users to
|
* certcheck.c (MY_GCRY_PK_ECDSA): Remove. Change users to
|
||||||
|
@ -328,7 +328,7 @@ gpgsm_agent_pkdecrypt (ctrl_t ctrl, const char *keygrip, const char *desc,
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
char line[ASSUAN_LINELENGTH];
|
char line[ASSUAN_LINELENGTH];
|
||||||
membuf_t data;
|
membuf_t data;
|
||||||
struct cipher_parm_s cipher_parm;
|
struct cipher_parm_s cipher_parm;
|
||||||
size_t n, len;
|
size_t n, len;
|
||||||
char *p, *buf, *endp;
|
char *p, *buf, *endp;
|
||||||
@ -802,3 +802,21 @@ gpgsm_agent_get_confirmation (ctrl_t ctrl, const char *desc)
|
|||||||
default_inq_cb, ctrl, NULL, NULL);
|
default_inq_cb, ctrl, NULL, NULL);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Return 0 if the agent is alive. This is useful to make sure that
|
||||||
|
an agent has been started. */
|
||||||
|
gpg_error_t
|
||||||
|
gpgsm_agent_send_nop (ctrl_t ctrl)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = start_agent (ctrl);
|
||||||
|
if (!rc)
|
||||||
|
rc = assuan_transact (agent_ctx, "NOP",
|
||||||
|
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -393,6 +393,7 @@ int gpgsm_agent_marktrusted (ctrl_t ctrl, ksba_cert_t cert);
|
|||||||
int gpgsm_agent_learn (ctrl_t ctrl);
|
int gpgsm_agent_learn (ctrl_t ctrl);
|
||||||
int gpgsm_agent_passwd (ctrl_t ctrl, const char *hexkeygrip, const char *desc);
|
int gpgsm_agent_passwd (ctrl_t ctrl, const char *hexkeygrip, const char *desc);
|
||||||
gpg_error_t gpgsm_agent_get_confirmation (ctrl_t ctrl, const char *desc);
|
gpg_error_t gpgsm_agent_get_confirmation (ctrl_t ctrl, const char *desc);
|
||||||
|
gpg_error_t gpgsm_agent_send_nop (ctrl_t ctrl);
|
||||||
|
|
||||||
/*-- call-dirmngr.c --*/
|
/*-- call-dirmngr.c --*/
|
||||||
int gpgsm_dirmngr_isvalid (ctrl_t ctrl,
|
int gpgsm_dirmngr_isvalid (ctrl_t ctrl,
|
||||||
|
@ -1016,6 +1016,7 @@ cmd_getauditlog (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
version - Return the version of the program.
|
version - Return the version of the program.
|
||||||
pid - Return the process id of the server.
|
pid - Return the process id of the server.
|
||||||
|
agent-check - Return success if the agent is running.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
@ -1035,6 +1036,11 @@ cmd_getinfo (assuan_context_t ctx, char *line)
|
|||||||
snprintf (numbuf, sizeof numbuf, "%lu", (unsigned long)getpid ());
|
snprintf (numbuf, sizeof numbuf, "%lu", (unsigned long)getpid ());
|
||||||
rc = assuan_send_data (ctx, numbuf, strlen (numbuf));
|
rc = assuan_send_data (ctx, numbuf, strlen (numbuf));
|
||||||
}
|
}
|
||||||
|
else if (!strcmp (line, "agent-check"))
|
||||||
|
{
|
||||||
|
ctrl_t ctrl = assuan_get_pointer (ctx);
|
||||||
|
rc = gpgsm_agent_send_nop (ctrl);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");
|
rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2008-09-29 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* Makefile.am (TESTS): Remove tests.
|
||||||
|
|
||||||
2008-02-19 Werner Koch <wk@g10code.com>
|
2008-02-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* Makefile.am: Always run pkits tests.
|
* Makefile.am: Always run pkits tests.
|
||||||
|
@ -44,7 +44,13 @@ EXTRA_DIST = runtest inittests $(testscripts) \
|
|||||||
samplekeys/cert_g10code_test1.pem \
|
samplekeys/cert_g10code_test1.pem \
|
||||||
samplekeys/cert_g10code_theo1.pem
|
samplekeys/cert_g10code_theo1.pem
|
||||||
|
|
||||||
TESTS = $(testscripts)
|
# We used to run $(testscripts) here but tehse asschk scripts ares not
|
||||||
|
# completely reliable in all enviromnets and thus we better disable
|
||||||
|
# them. The tests are anyway way to minimal. We will eventually
|
||||||
|
# write new tests based on gpg-connect-agent which has a full fledged
|
||||||
|
# script language and thus makes it far easier to write tests than to
|
||||||
|
# use the low--level asschk stuff.
|
||||||
|
TESTS =
|
||||||
|
|
||||||
CLEANFILES = inittests.stamp x y y z out err \
|
CLEANFILES = inittests.stamp x y y z out err \
|
||||||
*.lock .\#lk*
|
*.lock .\#lk*
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2008-09-29 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* clearsig.test: Replace -sat by --clearsign.
|
||||||
|
|
||||||
2008-03-19 Werner Koch <wk@g10code.com>
|
2008-03-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* import.test, bug894-test.asc: New.
|
* import.test, bug894-test.asc: New.
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# it is clear text and not binary text.
|
# it is clear text and not binary text.
|
||||||
# ======================================
|
# ======================================
|
||||||
for i in $plain_files plain-large ; do
|
for i in $plain_files plain-large ; do
|
||||||
echo "$usrpass1" | $GPG --passphrase-fd 0 -sat -o x --yes $i
|
echo "$usrpass1" | $GPG --passphrase-fd 0 --clearsign -o x --yes $i
|
||||||
$GPG --verify x
|
$GPG --verify x
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ done
|
|||||||
|
|
||||||
if have_pubkey_algo "RSA"; then
|
if have_pubkey_algo "RSA"; then
|
||||||
for i in $plain_files plain-large ; do
|
for i in $plain_files plain-large ; do
|
||||||
$GPG -u $usrname3 --rfc1991 --digest-algo md5 -sat -o x --yes $i
|
$GPG -u $usrname3 --rfc1991 --digest-algo md5 --clearsign -o x --yes $i
|
||||||
$GPG --verify x
|
$GPG --verify x
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user