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