mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-22 10:10:54 +00:00
Improve keyring debugging
This commit is contained in:
parent
705f414a4d
commit
03f38d2031
@ -266,6 +266,8 @@ void keyring_free_keypair(keypair *kp)
|
|||||||
*/
|
*/
|
||||||
int keyring_enter_keyringpin(keyring_file *k, const char *pin)
|
int keyring_enter_keyringpin(keyring_file *k, const char *pin)
|
||||||
{
|
{
|
||||||
|
if (config.debug.keyring)
|
||||||
|
DEBUGF("k=%p", k);
|
||||||
if (!k) return WHY("k is null");
|
if (!k) return WHY("k is null");
|
||||||
if (k->context_count>=KEYRING_MAX_CONTEXTS)
|
if (k->context_count>=KEYRING_MAX_CONTEXTS)
|
||||||
return WHY("Too many loaded contexts already");
|
return WHY("Too many loaded contexts already");
|
||||||
@ -741,6 +743,8 @@ int keyring_decrypt_pkr(keyring_file *k,keyring_context *c,
|
|||||||
We might find more than one. */
|
We might find more than one. */
|
||||||
int keyring_enter_pin(keyring_file *k, const char *pin)
|
int keyring_enter_pin(keyring_file *k, const char *pin)
|
||||||
{
|
{
|
||||||
|
if (config.debug.keyring)
|
||||||
|
DEBUGF("k=%p, pin=%s", k, alloca_str_toprint(pin));
|
||||||
IN();
|
IN();
|
||||||
if (!k) RETURN(-1);
|
if (!k) RETURN(-1);
|
||||||
if (!pin) pin="";
|
if (!pin) pin="";
|
||||||
@ -1374,6 +1378,8 @@ keyring_file *keyring_open_instance_cli(const struct cli_parsed *parsed)
|
|||||||
This identity will not be pin protected (initially). */
|
This identity will not be pin protected (initially). */
|
||||||
int keyring_seed(keyring_file *k)
|
int keyring_seed(keyring_file *k)
|
||||||
{
|
{
|
||||||
|
if (config.debug.keyring)
|
||||||
|
DEBUGF("k=%p", k);
|
||||||
if (!k) return WHY("keyring is null");
|
if (!k) return WHY("keyring is null");
|
||||||
|
|
||||||
/* nothing to do if there is already an identity */
|
/* nothing to do if there is already an identity */
|
||||||
|
@ -25,6 +25,9 @@ shopt -s extglob
|
|||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
setup_servald
|
setup_servald
|
||||||
|
executeOk_servald config set debug.keyring on
|
||||||
|
executeOk_servald keyring list
|
||||||
|
assert_keyring_list 0
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_keyring_list() {
|
assert_keyring_list() {
|
||||||
@ -102,10 +105,15 @@ test_KeyringPinIdentityPinless() {
|
|||||||
|
|
||||||
doc_KeyringAutoCreate="Starting a server with no keyring creates a valid identity"
|
doc_KeyringAutoCreate="Starting a server with no keyring creates a valid identity"
|
||||||
test_KeyringAutoCreate() {
|
test_KeyringAutoCreate() {
|
||||||
executeOk_servald start
|
servald_start
|
||||||
executeOk_servald keyring list
|
executeOk_servald keyring list
|
||||||
assert_keyring_list 1
|
assert_keyring_list 1
|
||||||
executeOk_servald stop
|
}
|
||||||
|
finally_KeyringAutoCreate() {
|
||||||
|
stop_servald_server
|
||||||
|
}
|
||||||
|
teardown_KeyringAutoCreate() {
|
||||||
|
report_servald_server
|
||||||
}
|
}
|
||||||
|
|
||||||
runTests "$@"
|
runTests "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user