1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-22 14:39:24 -05:00

Pageant: reindent the main handler function.

Somehow it had acquired a lot of internal 2-space indentation, which
is out of step with the rest of this code base's style. Before I get
into making more changes in here, let's clean it up.
This commit is contained in:
Simon Tatham 2020-12-15 13:04:13 +00:00
parent e617a5b768
commit 78e006b60b

View File

@ -676,8 +676,7 @@ static PageantAsyncOp *pageant_make_op(
put_byte(sb, SSH2_AGENT_IDENTITIES_ANSWER); put_byte(sb, SSH2_AGENT_IDENTITIES_ANSWER);
pageant_make_keylist2(BinarySink_UPCAST(sb)); pageant_make_keylist2(BinarySink_UPCAST(sb));
pageant_client_log(pc, reqid, pageant_client_log(pc, reqid, "reply: SSH2_AGENT_IDENTITIES_ANSWER");
"reply: SSH2_AGENT_IDENTITIES_ANSWER");
if (!pc->suppress_logging) { if (!pc->suppress_logging) {
int i; int i;
ssh2_userkey *skey; ssh2_userkey *skey;
@ -704,8 +703,7 @@ static PageantAsyncOp *pageant_make_op(
unsigned char response_md5[16]; unsigned char response_md5[16];
int i; int i;
pageant_client_log(pc, reqid, pageant_client_log(pc, reqid, "request: SSH1_AGENTC_RSA_CHALLENGE");
"request: SSH1_AGENTC_RSA_CHALLENGE");
response = NULL; response = NULL;
memset(&reqkey, 0, sizeof(reqkey)); memset(&reqkey, 0, sizeof(reqkey));
@ -728,8 +726,7 @@ static PageantAsyncOp *pageant_make_op(
char *fingerprint; char *fingerprint;
reqkey.comment = NULL; reqkey.comment = NULL;
fingerprint = rsa_ssh1_fingerprint(&reqkey); fingerprint = rsa_ssh1_fingerprint(&reqkey);
pageant_client_log(pc, reqid, "requested key: %s", pageant_client_log(pc, reqid, "requested key: %s", fingerprint);
fingerprint);
sfree(fingerprint); sfree(fingerprint);
} }
@ -794,8 +791,7 @@ static PageantAsyncOp *pageant_make_op(
if (!pc->suppress_logging) { if (!pc->suppress_logging) {
char *fingerprint = ssh2_fingerprint_blob(keyblob); char *fingerprint = ssh2_fingerprint_blob(keyblob);
pageant_client_log(pc, reqid, "requested key: %s", pageant_client_log(pc, reqid, "requested key: %s", fingerprint);
fingerprint);
sfree(fingerprint); sfree(fingerprint);
} }
if ((pk = findkey2(keyblob)) == NULL) { if ((pk = findkey2(keyblob)) == NULL) {
@ -834,8 +830,7 @@ static PageantAsyncOp *pageant_make_op(
*/ */
RSAKey *key; RSAKey *key;
pageant_client_log(pc, reqid, pageant_client_log(pc, reqid, "request: SSH1_AGENTC_ADD_RSA_IDENTITY");
"request: SSH1_AGENTC_ADD_RSA_IDENTITY");
key = get_rsa_ssh1_priv_agent(msg); key = get_rsa_ssh1_priv_agent(msg);
key->comment = mkstr(get_string(msg)); key->comment = mkstr(get_string(msg));
@ -992,8 +987,7 @@ static PageantAsyncOp *pageant_make_op(
PageantKey *pk; PageantKey *pk;
ptrlen blob; ptrlen blob;
pageant_client_log(pc, reqid, pageant_client_log(pc, reqid, "request: SSH2_AGENTC_REMOVE_IDENTITY");
"request: SSH2_AGENTC_REMOVE_IDENTITY");
blob = get_string(msg); blob = get_string(msg);
@ -1014,8 +1008,7 @@ static PageantAsyncOp *pageant_make_op(
goto responded; goto responded;
} }
pageant_client_log(pc, reqid, pageant_client_log(pc, reqid, "found with comment: %s", pk->comment);
"found with comment: %s", pk->comment);
del234(keytree, pk); del234(keytree, pk);
keylist_update(); keylist_update();
@ -1029,8 +1022,8 @@ static PageantAsyncOp *pageant_make_op(
/* /*
* Remove all SSH-1 keys. Always returns success. * Remove all SSH-1 keys. Always returns success.
*/ */
pageant_client_log(pc, reqid, "request:" pageant_client_log(pc, reqid,
" SSH1_AGENTC_REMOVE_ALL_RSA_IDENTITIES"); "request: SSH1_AGENTC_REMOVE_ALL_RSA_IDENTITIES");
remove_all_keys(1); remove_all_keys(1);
keylist_update(); keylist_update();
@ -1091,8 +1084,7 @@ static PageantAsyncOp *pageant_make_op(
put_byte(sb, SSH_AGENT_SUCCESS); put_byte(sb, SSH_AGENT_SUCCESS);
for (size_t i = 0; i < lenof(extension_names); i++) for (size_t i = 0; i < lenof(extension_names); i++)
put_stringpl(sb, extension_names[i]); put_stringpl(sb, extension_names[i]);
pageant_client_log(pc, reqid, pageant_client_log(pc, reqid, "reply: SSH_AGENT_SUCCESS + names");
"reply: SSH_AGENT_SUCCESS + names");
break; break;
case EXT_ADD_PPK: { case EXT_ADD_PPK: {
@ -1110,8 +1102,7 @@ static PageantAsyncOp *pageant_make_op(
char *comment; char *comment;
BinarySource_BARE_INIT_PL(src, keyfile); BinarySource_BARE_INIT_PL(src, keyfile);
if (!ppk_loadpub_s(src, NULL, if (!ppk_loadpub_s(src, NULL, BinarySink_UPCAST(public_blob),
BinarySink_UPCAST(public_blob),
&comment, &error)) { &comment, &error)) {
fail("failed to extract public key blob: %s", error); fail("failed to extract public key blob: %s", error);
goto add_ppk_cleanup; goto add_ppk_cleanup;
@ -1139,8 +1130,7 @@ static PageantAsyncOp *pageant_make_op(
keylist_update(); keylist_update();
put_byte(sb, SSH_AGENT_SUCCESS); put_byte(sb, SSH_AGENT_SUCCESS);
pageant_client_log(pc, reqid, pageant_client_log(pc, reqid, "reply: SSH_AGENT_SUCCESS"
"reply: SSH_AGENT_SUCCESS"
" (loaded unencrypted PPK)"); " (loaded unencrypted PPK)");
} else { } else {
fail("key already present"); fail("key already present");
@ -1168,10 +1158,9 @@ static PageantAsyncOp *pageant_make_op(
put_datapl(pk->encrypted_key_file, keyfile); put_datapl(pk->encrypted_key_file, keyfile);
put_byte(sb, SSH_AGENT_SUCCESS); put_byte(sb, SSH_AGENT_SUCCESS);
pageant_client_log(pc, reqid, pageant_client_log(
"reply: SSH_AGENT_SUCCESS (added" pc, reqid, "reply: SSH_AGENT_SUCCESS (added encrypted"
" encrypted PPK to existing key" " PPK to existing key record)");
" record)");
} else { } else {
fail("key already present"); fail("key already present");
} }
@ -1196,9 +1185,8 @@ static PageantAsyncOp *pageant_make_op(
assert(added == pk); (void)added; assert(added == pk); (void)added;
put_byte(sb, SSH_AGENT_SUCCESS); put_byte(sb, SSH_AGENT_SUCCESS);
pageant_client_log(pc, reqid, "reply: SSH_AGENT_SUCCESS" pageant_client_log(pc, reqid, "reply: SSH_AGENT_SUCCESS (made"
" (made new encrypted-only key" " new encrypted-only key record)");
" record)");
} }
add_ppk_cleanup: add_ppk_cleanup: