comparison common/binverify.c @ 1395:a2574a029322

Fix Base 64 signature size calculation. If the signature byte size is not equally dividable by three the base 64 encoding needs three additional bytes. The value is now fixed to avoid such errors in the future.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 26 Jan 2015 13:17:32 +0100
parents f3e2df6b49ba
children
comparison
equal deleted inserted replaced
1394:8d27c6d226cd 1395:a2574a029322
411 411
412 bin_verify_result 412 bin_verify_result
413 verify_binary_linux(const char *filename, size_t name_len) 413 verify_binary_linux(const char *filename, size_t name_len)
414 { 414 {
415 int ret = -1; 415 int ret = -1;
416 const size_t sig_b64_size = TRUSTBRIDGE_RSA_CODESIGN_SIZE / 8 * 4 / 3; 416 const size_t sig_b64_size = TRUSTBRIDGE_RSA_CODESIGN_B64_SIZE;
417 char *data = NULL, 417 char *data = NULL,
418 signature_b64[sig_b64_size + 1]; 418 signature_b64[sig_b64_size + 1];
419 size_t data_size = 0, 419 size_t data_size = 0,
420 sig_size = TRUSTBRIDGE_RSA_CODESIGN_SIZE / 8; 420 sig_size = TRUSTBRIDGE_RSA_CODESIGN_SIZE / 8;
421 unsigned char signature[sig_size], 421 unsigned char signature[sig_size],

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