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;
|
key->bits = num_bits;
|
||||||
len = size - sizeof(key->bits);
|
len = size - sizeof(key->bits);
|
||||||
for (i=0; i<len; i++) {
|
for (i=0; i<len; i++) {
|
||||||
fs = fscanf(f, "%2x", &n);
|
fscanf(f, "%2x", &n);
|
||||||
if (fs != 1) return ERR_NULL;
|
|
||||||
key->data[i] = n;
|
key->data[i] = n;
|
||||||
}
|
}
|
||||||
fs = fscanf(f, ".");
|
fs = fscanf(f, ".");
|
||||||
|
|
|
@ -863,6 +863,7 @@ bool send_code_sign_key(char* code_sign_key) {
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
strip_whitespace(oldkey);
|
||||||
if (!strcmp(oldkey, g_request->code_sign_key)) {
|
if (!strcmp(oldkey, g_request->code_sign_key)) {
|
||||||
// We've found the client's key.
|
// We've found the client's key.
|
||||||
// Get the signature for the new key.
|
// Get the signature for the new key.
|
||||||
|
@ -883,6 +884,9 @@ bool send_code_sign_key(char* code_sign_key) {
|
||||||
free(oldkey);
|
free(oldkey);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} 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, code_sign_key);
|
||||||
safe_strcpy(g_reply->code_sign_key_signature, signature);
|
safe_strcpy(g_reply->code_sign_key_signature, signature);
|
||||||
free(signature);
|
free(signature);
|
||||||
|
|
Loading…
Reference in New Issue