mirror of https://github.com/BOINC/boinc.git
scheduler: fix bugs related to changing code signing key
Two separate problems: - a well-meaning change to remove compile warnings on 9 July 2013 broke the reading of key files - in the logic to scan old key files, we needed to use strip_whitespace() to remove the \n at end of file.
This commit is contained in:
parent
87d3cb5474
commit
5250f55c8a
|
@ -213,8 +213,7 @@ int scan_key_hex(FILE* f, KEY* key, int size) {
|
|||
key->bits = num_bits;
|
||||
len = size - sizeof(key->bits);
|
||||
for (i=0; i<len; i++) {
|
||||
fs = fscanf(f, "%2x", &n);
|
||||
if (fs != 1) return ERR_NULL;
|
||||
fscanf(f, "%2x", &n);
|
||||
key->data[i] = n;
|
||||
}
|
||||
fs = fscanf(f, ".");
|
||||
|
|
|
@ -863,6 +863,7 @@ bool send_code_sign_key(char* code_sign_key) {
|
|||
);
|
||||
return false;
|
||||
}
|
||||
strip_whitespace(oldkey);
|
||||
if (!strcmp(oldkey, g_request->code_sign_key)) {
|
||||
// We've found the client's key.
|
||||
// Get the signature for the new key.
|
||||
|
@ -883,6 +884,9 @@ bool send_code_sign_key(char* code_sign_key) {
|
|||
free(oldkey);
|
||||
return false;
|
||||
} else {
|
||||
log_messages.printf(MSG_NORMAL,
|
||||
"sending new code sign key and signature\n"
|
||||
);
|
||||
safe_strcpy(g_reply->code_sign_key, code_sign_key);
|
||||
safe_strcpy(g_reply->code_sign_key_signature, signature);
|
||||
free(signature);
|
||||
|
|
Loading…
Reference in New Issue