comparison common/pubkey-test.h @ 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 c64b6c56ce96
children
comparison
equal deleted inserted replaced
1394:8d27c6d226cd 1395:a2574a029322
9 #define PUBKEY_TEST_H 9 #define PUBKEY_TEST_H
10 10
11 /**@def The size of the RSA modulus */ 11 /**@def The size of the RSA modulus */
12 #define TRUSTBRIDGE_RSA_KEY_SIZE 3072 12 #define TRUSTBRIDGE_RSA_KEY_SIZE 3072
13 #define TRUSTBRIDGE_RSA_CODESIGN_SIZE 2048 13 #define TRUSTBRIDGE_RSA_CODESIGN_SIZE 2048
14
15 /** @def the size of the base 64 encoded signature.
16 * The formula for this is modulus / 8 * 4 / 3
17 * +3 if this is not equaly devidable by 3. */
18 #define TRUSTBRIDGE_RSA_CODESIGN_B64_SIZE 344
19 #define TRUSTBRIDGE_RSA_B64_SIZE 512
14 20
15 /* PEM encoded public key */ 21 /* PEM encoded public key */
16 static const unsigned char public_key_pem[] = 22 static const unsigned char public_key_pem[] =
17 "-----BEGIN PUBLIC KEY-----\n" 23 "-----BEGIN PUBLIC KEY-----\n"
18 "MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAljObDbSjuYULdW9TtAzl\n" 24 "MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAljObDbSjuYULdW9TtAzl\n"

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