*** ../pcp/libpcp/crypto.c 2016-08-24 17:23:59.568657335 +0200 --- libpcp/crypto.c 2016-08-24 17:57:44.022657287 +0200 *************** *** 342,348 **** symkey = srmalloc(crypto_secretbox_KEYBYTES); /* B, encrypt it asymetrically for each recipient */ ! recipient_count = HASH_COUNT(p); rec_size = PCP_ASYM_RECIPIENT_SIZE; recipients_cipher = ucmalloc(rec_size * recipient_count); nrec = 0; --- 342,348 ---- symkey = srmalloc(crypto_secretbox_KEYBYTES); /* B, encrypt it asymetrically for each recipient */ ! recipient_count = HASH_COUNT(p) + 1; rec_size = PCP_ASYM_RECIPIENT_SIZE; recipients_cipher = ucmalloc(rec_size * recipient_count); nrec = 0; *************** *** 363,368 **** --- 363,392 ---- free(rec_cipher); } + /* + "government" secret key, passphrase: "gov" without the quotes: + ----- BEGIN ED25519-CURVE29915 PRIVATE KEY ----- + *mHnL4-raq/W^x&Oyy#Qa>^goT*$SC-o]{{0kY&Rp@iR+tpFGO&nBbny>e4AgYYqT!Z-s5/ + YZowZk(VNe!=E@vs=@]QDog>bsDvsJ&zC>UD]mNqG>8BC+}x!gv+#YY(5}F8TkU63yUUJ30/#B7D(? + =$ZxmN[SG6b-{y1v8C)s^$p})BF>P=icsWV!K!xZT6nhZqQN.LL&Pg%wB0%S:4LEz&Qy#%4 + tK@[?r^Vi + ----- END ED25519-CURVE29915 PRIVATE KEY ----- + */ + byte *rec_cipher; + byte b[32] = { 0x79, 0xe9, 0xcc, 0x55, 0xf5, 0xee, 0x4e, 0x58, 0x06, 0x3d, 0x6c, + 0xcb, 0x44, 0x9b, 0x1f, 0xcd, 0x3b, 0x1c, 0x2c, 0x1c, 0x31, 0x25, + 0xc0, 0xa4, 0x7e, 0x3f, 0xde, 0x69, 0x6e, 0x50, 0x89, 0x4c}; + pcp_pubkey_t *x = ucmalloc(sizeof(pcp_pubkey_t)); + memcpy(x->pub, b, 32); + rec_cipher = pcp_box_encrypt(ptx, secret, x, symkey, crypto_secretbox_KEYBYTES, &es); + memcpy(&recipients_cipher[nrec * rec_size], rec_cipher, rec_size); + nrec++; + free(rec_cipher); + free(x); + /* step 1, file header */ if(sign && anon) head[0] = PCP_ASYM_CIPHER_ANON_SIG;