comparison common/binverify.c @ 1387:c64b6c56ce96 0.9.8

(issue95) Change keys for release build. Fix release build usage.
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 15 Jan 2015 16:46:36 +0100
parents 948f03bb5254
children f3e2df6b49ba
comparison
equal deleted inserted replaced
1386:90a8eb36e9b0 1387:c64b6c56ce96
415 415
416 bin_verify_result 416 bin_verify_result
417 verify_binary_linux(const char *filename, size_t name_len) 417 verify_binary_linux(const char *filename, size_t name_len)
418 { 418 {
419 int ret = -1; 419 int ret = -1;
420 const size_t sig_b64_size = TRUSTBRIDGE_RSA_KEY_SIZE / 8 * 4 / 3; 420 const size_t sig_b64_size = TRUSTBRIDGE_RSA_CODESIGN_SIZE / 8 * 4 / 3;
421 char *data = NULL, 421 char *data = NULL,
422 signature_b64[sig_b64_size + 1]; 422 signature_b64[sig_b64_size + 1];
423 size_t data_size = 0, 423 size_t data_size = 0,
424 sig_size = TRUSTBRIDGE_RSA_KEY_SIZE / 8; 424 sig_size = TRUSTBRIDGE_RSA_CODESIGN_SIZE / 8;
425 unsigned char signature[sig_size], 425 unsigned char signature[sig_size],
426 hash[32]; 426 hash[32];
427 FILE *fptr = NULL; 427 FILE *fptr = NULL;
428 428
429 bin_verify_result retval; 429 bin_verify_result retval;
469 signature_b64[sig_b64_size] = '\0'; 469 signature_b64[sig_b64_size] = '\0';
470 470
471 ret = base64_decode(signature, &sig_size, 471 ret = base64_decode(signature, &sig_size,
472 (unsigned char *)signature_b64, sig_b64_size); 472 (unsigned char *)signature_b64, sig_b64_size);
473 473
474 if (ret != 0 || sig_size != TRUSTBRIDGE_RSA_KEY_SIZE / 8) 474 if (ret != 0 || sig_size != TRUSTBRIDGE_RSA_CODESIGN_SIZE / 8)
475 { 475 {
476 ERRORPRINTF ("Base 64 decode failed with error: %i\n", ret); 476 ERRORPRINTF ("Base 64 decode failed with error: %i\n", ret);
477 goto done; 477 goto done;
478 } 478 }
479 479

http://wald.intevation.org/projects/trustbridge/