ENGINE_289: helps to actually ADD the tests. ENGINE-289
authorKrista Bennett <krista@pep-project.org>
Wed, 17 Jan 2018 23:00:00 +0100
branchENGINE-289
changeset 2406be9932cba368
parent 2405 f723208869f7
child 2407 94524e2377b9
ENGINE_289: helps to actually ADD the tests.
test/new_update_id_and_myself_test.cc
test/test_keys/priv/bernd.das.brot-0xCAFAA422_priv.asc
test/test_keys/priv/pep.test.alexander-0x26B54E4E_priv.asc
test/test_keys/priv/pep.test.bella-0xAF516AAE_priv.asc
test/test_keys/pub/bernd.das.brot-0xCAFAA422_pub.asc
test/test_keys/pub/pep.test.alexander-0x26B54E4E_pub.asc
test/test_keys/pub/pep.test.bella-0xAF516AAE_pub.asc
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/new_update_id_and_myself_test.cc	Wed Jan 17 23:00:00 2018 +0100
     1.3 @@ -0,0 +1,480 @@
     1.4 +// This file is under GNU General Public License 3.0
     1.5 +// see LICENSE.txt
     1.6 +
     1.7 +#include <iostream>
     1.8 +#include <iostream>
     1.9 +#include <fstream>
    1.10 +#include <string>
    1.11 +#include <cstring> // for strcmp()
    1.12 +#include <assert.h>
    1.13 +#include "pEpEngine.h"
    1.14 +#include "message_api.h"
    1.15 +#include "keymanagement.h"
    1.16 +#include "test_util.h"
    1.17 +
    1.18 +using namespace std;
    1.19 +
    1.20 +int main() {
    1.21 +    cout << "\n*** test update_identity and myself ***\n\n";
    1.22 +    
    1.23 +    PEP_SESSION session;
    1.24 +    
    1.25 +    cout << "calling init()\n";
    1.26 +    PEP_STATUS status = init(&session);
    1.27 +    assert(status == PEP_STATUS_OK);
    1.28 +    assert(session);
    1.29 +    cout << "init() completed.\n";
    1.30 +    cout << endl;
    1.31 +    cout << "***********************************************************************" << endl;
    1.32 +    cout << "* Section I. myself()" << endl;
    1.33 +    cout << "***********************************************************************" << endl << endl;
    1.34 +
    1.35 +    // Create id with no key
    1.36 +    cout << "Creating new own id with no key for : ";
    1.37 +    char *uniqname = strdup("AAAAtestuser@testdomain.org");
    1.38 +    srandom(time(NULL));
    1.39 +    for(int i=0; i < 4;i++)
    1.40 +        uniqname[i] += random() & 0xf;
    1.41 +    
    1.42 +    cout << uniqname << "\n";
    1.43 +    
    1.44 +    const char* own_user_id = "FineOwnIdentitiesOfBuckTFerris";
    1.45 +    const char* start_username = "Unser Testkandidat";
    1.46 +
    1.47 +    pEp_identity * new_me = new_identity(uniqname, NULL, own_user_id, start_username);
    1.48 +    
    1.49 +    cout << "***********************************************************************" << endl;
    1.50 +    cout << "* I: 1. myself() on id with no record in the DB and no input fpr" << endl;
    1.51 +    cout << "***********************************************************************" << endl << endl;
    1.52 +    status = myself(session, new_me);
    1.53 +    assert(status == PEP_STATUS_OK);
    1.54 +    assert(new_me->fpr);
    1.55 +    
    1.56 +    cout << "PASS: myself() generated fingerprint ";
    1.57 +    cout << new_me->fpr << endl << endl;
    1.58 +
    1.59 +    char* generated_fpr = strdup(new_me->fpr);
    1.60 +    
    1.61 +    assert(new_me->comm_type == PEP_ct_pEp);
    1.62 +    
    1.63 +    free_identity(new_me);
    1.64 +
    1.65 +    cout << "***********************************************************************" << endl;
    1.66 +    cout << "* I: 2. myself() on id with no input fpr and a record in the DB" << endl;
    1.67 +    cout << "***********************************************************************" << endl << endl;
    1.68 +
    1.69 +    new_me = new_identity(uniqname, NULL, own_user_id, NULL);
    1.70 +    status = myself(session, new_me);
    1.71 +    assert(status == PEP_STATUS_OK);
    1.72 +    
    1.73 +    assert(new_me->fpr);
    1.74 +    assert(strcmp(new_me->fpr, generated_fpr) == 0);
    1.75 +    assert(new_me->username);
    1.76 +    assert(strcmp(new_me->username, start_username) == 0);
    1.77 +    assert(new_me->user_id);
    1.78 +    assert(new_me->comm_type == PEP_ct_pEp);
    1.79 +    
    1.80 +    char* default_own_id = NULL;
    1.81 +    status = get_userid_alias_default(session, own_user_id, &default_own_id);
    1.82 +    if (status == PEP_CANNOT_FIND_ALIAS) {
    1.83 +        // Ok, we presume our own id above is the default (should be true if there was no existing DB as in test env)
    1.84 +        default_own_id = strdup(own_user_id);
    1.85 +    }
    1.86 +
    1.87 +    assert(strcmp(new_me->user_id, default_own_id) == 0);
    1.88 +    
    1.89 +    cout << "PASS: myself() retrieved the correct fpr, username and default user id" << endl << endl;
    1.90 +
    1.91 +    free_identity(new_me);
    1.92 +     
    1.93 +    cout << "****************************************************************************************" << endl;
    1.94 +    cout << "* I: 3. myself() on id with no input fpr, a different user_id, and a record in the DB" << endl;
    1.95 +    cout << "****************************************************************************************" << endl << endl;
    1.96 +
    1.97 +    const char* alias_id = "Huss Es El Mejor Presidente Del Mundo!";
    1.98 +
    1.99 +    new_me = new_identity(uniqname, NULL, alias_id, NULL);
   1.100 +    status = myself(session, new_me);
   1.101 +    assert(status == PEP_STATUS_OK);
   1.102 +    
   1.103 +    assert(new_me->fpr);
   1.104 +    assert(strcmp(new_me->fpr, generated_fpr) == 0);
   1.105 +    assert(new_me->username);
   1.106 +    assert(strcmp(new_me->username, start_username) == 0);
   1.107 +    assert(new_me->user_id);
   1.108 +    assert(strcmp(new_me->user_id, default_own_id) == 0);
   1.109 +    assert(new_me->comm_type == PEP_ct_pEp);
   1.110 +    
   1.111 +    char* tmp_def = NULL;
   1.112 +    
   1.113 +    status = get_userid_alias_default(session, alias_id, &tmp_def);
   1.114 +    assert(status == PEP_STATUS_OK);
   1.115 +    assert(strcmp(tmp_def, default_own_id) == 0);
   1.116 +
   1.117 +    cout << "PASS: myself() retrieved the correct fpr, username and default user id, and put the right alias in for the default";
   1.118 +    cout << endl << endl;
   1.119 +    
   1.120 +    free(tmp_def);
   1.121 +    free_identity(new_me);
   1.122 +
   1.123 +    cout << "****************************************************************************************" << endl;
   1.124 +    cout << "* I: 4. myself(), replace fpr" << endl;
   1.125 +    cout << "****************************************************************************************" << endl << endl;
   1.126 +
   1.127 +    new_me = new_identity(uniqname, NULL, alias_id, start_username);
   1.128 +    status = generate_keypair(session, new_me);
   1.129 +    assert(new_me->fpr);
   1.130 +    
   1.131 +    cout << "Generated fingerprint ";
   1.132 +    cout << new_me->fpr << "\n";
   1.133 +
   1.134 +    char* new_fpr = strdup(new_me->fpr);
   1.135 +
   1.136 +    new_me = new_identity(uniqname, new_fpr, alias_id, NULL);
   1.137 +
   1.138 +    status = myself(session, new_me);
   1.139 +    assert(status == PEP_STATUS_OK);
   1.140 +    assert(new_me->fpr);
   1.141 +    assert(strcmp(new_me->fpr, generated_fpr) != 0);
   1.142 +    assert(strcmp(new_me->fpr, new_fpr) == 0);
   1.143 +    assert(new_me->username);
   1.144 +    assert(strcmp(new_me->username, start_username) == 0);
   1.145 +    assert(new_me->user_id);
   1.146 +    assert(strcmp(new_me->user_id, default_own_id) == 0);
   1.147 +    assert(new_me->me);
   1.148 +    assert(new_me->comm_type == PEP_ct_pEp);
   1.149 +
   1.150 +    cout << "PASS: myself() set and retrieved the new fpr, username and default user id, and put the right alias in for the default";
   1.151 +    cout << endl << endl;
   1.152 +
   1.153 +    // since that worked, we'll set it back as the default
   1.154 +    free(new_me->fpr);
   1.155 +    new_me->fpr = strdup(generated_fpr);
   1.156 +    new_me->comm_type = PEP_ct_unknown;
   1.157 +    status = myself(session, new_me);
   1.158 +    assert(status == PEP_STATUS_OK);
   1.159 +    assert(strcmp(new_me->fpr, generated_fpr) == 0);
   1.160 +    assert(new_me->comm_type == PEP_ct_pEp);
   1.161 +    
   1.162 +    cout << "****************************************************************************************" << endl;
   1.163 +    cout << "* I: 5. myself(), replace fpr, revoke key" << endl;
   1.164 +    cout << "****************************************************************************************" << endl << endl;
   1.165 +
   1.166 +    status = revoke_key(session, generated_fpr, "Because it's fun");
   1.167 +    assert (status == PEP_STATUS_OK);
   1.168 +    
   1.169 +    new_me = new_identity(uniqname, new_fpr, alias_id, NULL);
   1.170 +    
   1.171 +    status = myself(session, new_me);
   1.172 +    assert(status == PEP_STATUS_OK);
   1.173 +    assert(new_me->fpr);
   1.174 +    assert(strcmp(new_me->fpr, generated_fpr) != 0);
   1.175 +    assert(new_me->username);
   1.176 +    assert(strcmp(new_me->username, start_username) == 0);
   1.177 +    assert(new_me->user_id);
   1.178 +    assert(strcmp(new_me->user_id, default_own_id) == 0);
   1.179 +    assert(new_me->me);
   1.180 +    assert(new_me->comm_type == PEP_ct_pEp);
   1.181 +    
   1.182 +    cout << "PASS: myself() retrieved the new fpr, username and default user id, and put the right alias in for the default";
   1.183 +    cout << endl << endl;
   1.184 +        
   1.185 +    cout << "***********************************************************************" << endl;
   1.186 +    cout << "* Section II. update_identity()" << endl;
   1.187 +    cout << "***********************************************************************" << endl << endl;
   1.188 +
   1.189 +    cout << "****************************************************************************************" << endl;
   1.190 +    cout << "* II: 1. update_identity() - get identity with matching address and user_id and username" << endl;
   1.191 +    cout << "****************************************************************************************" << endl << endl;    
   1.192 +    // 1. create original identity
   1.193 +    const char* alex_address = "pep.test.alexander@peptest.ch";
   1.194 +    const char* alex_fpr = "3AD9F60FAEB22675DB873A1362D6981326B54E4E";
   1.195 +    const char* alex_userid = "Alex";
   1.196 +    const char* alex_username = "SuperDuperAlex";
   1.197 +    const string alex_pub_key = slurp("test_keys/pub/pep.test.alexander-0x26B54E4E_pub.asc");
   1.198 +    
   1.199 +    PEP_STATUS statuspub = import_key(session, alex_pub_key.c_str(), alex_pub_key.length(), NULL);
   1.200 +    assert(statuspub == PEP_STATUS_OK);
   1.201 +
   1.202 +    pEp_identity* alex = new_identity(alex_address, alex_fpr, alex_userid, alex_username);
   1.203 +
   1.204 +    // 2. set identity
   1.205 +    status = set_identity(session, alex);
   1.206 +    assert(status == PEP_STATUS_OK);
   1.207 +    free_identity(alex);
   1.208 +            
   1.209 +    alex = new_identity(alex_address, NULL, alex_userid, alex_username); 
   1.210 +    status = update_identity(session, alex);
   1.211 +    assert(status == PEP_STATUS_OK);
   1.212 +    assert(alex->fpr);
   1.213 +    assert(strcmp(alex->fpr, alex_fpr) == 0);
   1.214 +    assert(alex->username);
   1.215 +    assert(strcmp(alex->username, alex_username) == 0);
   1.216 +    assert(alex->user_id);
   1.217 +    assert(strcmp(alex->user_id, alex_userid) == 0);
   1.218 +    assert(!alex->me); 
   1.219 +    assert(alex->comm_type == PEP_ct_OpenPGP_unconfirmed);
   1.220 +    assert(strcmp(alex->address, alex_address) == 0);
   1.221 +
   1.222 +    cout << "PASS: update_identity() correctly retrieved extant record with matching address, id, and username" << endl << endl;
   1.223 +    free_identity(alex);
   1.224 +
   1.225 +    cout << "****************************************************************************************" << endl;
   1.226 +    cout << "* II: 2. update_identity() - get identity with matching address and user_id and new username" << endl;
   1.227 +    cout << "****************************************************************************************" << endl << endl;    
   1.228 +
   1.229 +    const char* new_username = "Test Patchy";
   1.230 +            
   1.231 +    alex = new_identity(alex_address, NULL, alex_userid, new_username); 
   1.232 +    status = update_identity(session, alex);
   1.233 +    assert(status == PEP_STATUS_OK);
   1.234 +    assert(alex->fpr);
   1.235 +    assert(strcmp(alex->fpr, alex_fpr) == 0);
   1.236 +    assert(alex->username);
   1.237 +    assert(strcmp(alex->username, new_username) == 0);
   1.238 +    assert(alex->user_id);
   1.239 +    assert(strcmp(alex->user_id, alex_userid) == 0);
   1.240 +    assert(!alex->me); 
   1.241 +    assert(alex->comm_type == PEP_ct_OpenPGP_unconfirmed);
   1.242 +    assert(strcmp(alex->address, alex_address) == 0);
   1.243 +
   1.244 +    cout << "PASS: update_identity() correctly retrieved extant record with matching address and id, and patched username" << endl << endl;
   1.245 +    free_identity(alex);
   1.246 +
   1.247 +    cout << "****************************************************************************************" << endl;
   1.248 +    cout << "* II: 3. update_identity() - get identity with matching address and user_id only" << endl;
   1.249 +    cout << "****************************************************************************************" << endl << endl;    
   1.250 +        
   1.251 +    alex = new_identity(alex_address, NULL, alex_userid, NULL); 
   1.252 +    status = update_identity(session, alex);
   1.253 +    assert(status == PEP_STATUS_OK);
   1.254 +    assert(alex->fpr);
   1.255 +    assert(strcmp(alex->fpr, alex_fpr) == 0);
   1.256 +    assert(alex->username);
   1.257 +    assert(strcmp(alex->username, new_username) == 0);
   1.258 +    assert(alex->user_id);
   1.259 +    assert(strcmp(alex->user_id, alex_userid) == 0);
   1.260 +    assert(!alex->me); 
   1.261 +    assert(alex->comm_type == PEP_ct_OpenPGP_unconfirmed);
   1.262 +    assert(strcmp(alex->address, alex_address) == 0);
   1.263 +
   1.264 +    cout << "PASS: update_identity() correctly retrieved extant record with matching address and id, and patched username" << endl << endl;
   1.265 +    free_identity(alex);
   1.266 +
   1.267 +    cout << "****************************************************************************************" << endl;
   1.268 +    cout << "* II: 4. update_identity() - get identity with just address and username" << endl;
   1.269 +    cout << "****************************************************************************************" << endl << endl;    
   1.270 +
   1.271 +    alex = new_identity(alex_address, NULL, NULL, new_username); 
   1.272 +    status = update_identity(session, alex);
   1.273 +    assert(status == PEP_STATUS_OK);
   1.274 +    assert(alex->fpr);
   1.275 +    assert(strcmp(alex->fpr, alex_fpr) == 0);
   1.276 +    assert(alex->username);
   1.277 +    assert(strcmp(alex->username, new_username) == 0);
   1.278 +    assert(alex->user_id);
   1.279 +    assert(strcmp(alex->user_id, alex_userid) == 0);
   1.280 +    assert(!alex->me); 
   1.281 +    assert(alex->comm_type == PEP_ct_OpenPGP_unconfirmed);
   1.282 +    assert(strcmp(alex->address, alex_address) == 0);
   1.283 +
   1.284 +    cout << "PASS: update_identity() correctly retrieved extant record with matching address and username" << endl << endl;
   1.285 +    free_identity(alex);
   1.286 +
   1.287 +    cout << "****************************************************************************************" << endl;
   1.288 +    cout << "* II: 5. update_identity() with just address " << endl;
   1.289 +    cout << "****************************************************************************************" << endl << endl;
   1.290 +    
   1.291 +    alex = new_identity(alex_address, NULL, NULL, NULL); 
   1.292 +    status = update_identity(session, alex);
   1.293 +    assert(status == PEP_STATUS_OK);
   1.294 +    assert(alex->fpr);
   1.295 +    assert(strcmp(alex->fpr, alex_fpr) == 0);
   1.296 +    assert(alex->username);
   1.297 +    assert(strcmp(alex->username, new_username) == 0);
   1.298 +    assert(alex->user_id);
   1.299 +    assert(strcmp(alex->user_id, alex_userid) == 0);
   1.300 +    assert(!alex->me); 
   1.301 +    assert(alex->comm_type == PEP_ct_OpenPGP_unconfirmed);
   1.302 +    assert(strcmp(alex->address, alex_address) == 0);
   1.303 +
   1.304 +    cout << "PASS: update_identity() correctly retrieved extant record with just matching address. Retrieved previously patched username." << endl << endl;
   1.305 +    free_identity(alex);
   1.306 +
   1.307 +
   1.308 +    cout << "****************************************************************************************" << endl;
   1.309 +    cout << "* II: 6. update_identity() with just address on own identity (only case where this is legal)" << endl;
   1.310 +    cout << "****************************************************************************************" << endl << endl;
   1.311 +    
   1.312 +    pEp_identity* somebody = new_identity(uniqname, NULL, NULL, NULL); 
   1.313 +    status = update_identity(session, somebody);
   1.314 +    assert(status == PEP_STATUS_OK);
   1.315 +    myself(session, somebody);
   1.316 +    assert(somebody->fpr);
   1.317 +    assert(strcmp(somebody->fpr, new_fpr) == 0);
   1.318 +    assert(somebody->username);
   1.319 +    assert(strcmp(somebody->username, start_username) == 0);
   1.320 +    assert(somebody->user_id);
   1.321 +    assert(strcmp(somebody->user_id, default_own_id) == 0);
   1.322 +    assert(somebody->me); // true in this case, as it was an own identity
   1.323 +    assert(somebody->comm_type == PEP_ct_pEp);
   1.324 +    assert(strcmp(somebody->address, uniqname) == 0);
   1.325 +    
   1.326 +    cout << "PASS: update_identity() retrieved the right identity information given just an address";
   1.327 +    cout << endl << endl;
   1.328 +
   1.329 +    free_identity(somebody);
   1.330 +
   1.331 +    cout << "****************************************************************************************" << endl;
   1.332 +    cout << "* II: 7. update_identity() for address and user_id that don't exist" << endl;
   1.333 +    cout << "****************************************************************************************" << endl << endl;
   1.334 +
   1.335 +    somebody = new_identity("nope@nope.nope", NULL, "some_user_id", NULL); 
   1.336 +    status = update_identity(session, somebody);
   1.337 +    assert(status == PEP_CANNOT_FIND_IDENTITY);
   1.338 +    cout << "PASS: update_identity() returns PEP_CANNOT_FIND_IDENTITY" << endl << endl;
   1.339 +
   1.340 +    free_identity(somebody);
   1.341 +    
   1.342 +    cout << "****************************************************************************************" << endl;
   1.343 +    cout << "* II: 8. update_identity() for address and and username, but non-matching temp user_id" << endl;
   1.344 +    cout << "****************************************************************************************" << endl << endl;
   1.345 +
   1.346 +    // 1. create identity
   1.347 +    const char* bella_address = "pep.test.bella@peptest.ch";
   1.348 +    const char* bella_fpr = "5631BF1357326A02AA470EEEB815EF7FA4516AAE";
   1.349 +    const char* bella_userid = "TOFU_pep.test.bella@peptest.ch"; // simulate temp ID
   1.350 +    const char* bella_username = "Annabella the Great";
   1.351 +    const string bella_pub_key = slurp("test_keys/pub/pep.test.bella-0xAF516AAE_pub.asc");
   1.352 +    
   1.353 +    statuspub = import_key(session, bella_pub_key.c_str(), bella_pub_key.length(), NULL);
   1.354 +    assert(statuspub == PEP_STATUS_OK);
   1.355 +
   1.356 +    pEp_identity* bella = new_identity(bella_address, bella_fpr, bella_userid, bella_username);
   1.357 +    
   1.358 +    // 2. set identity
   1.359 +    status = set_identity(session, bella);
   1.360 +    assert(status == PEP_STATUS_OK);
   1.361 +    free_identity(bella);
   1.362 +    
   1.363 +    const char* not_my_userid = "Bad Company";
   1.364 +            
   1.365 +    bella = new_identity(bella_address, NULL, not_my_userid, bella_username); 
   1.366 +    status = update_identity(session, bella);
   1.367 +    assert(status == PEP_STATUS_OK);
   1.368 +    assert(bella->fpr);
   1.369 +    assert(strcmp(bella->fpr, bella_fpr) == 0);
   1.370 +    assert(bella->username);
   1.371 +    assert(strcmp(bella->username, bella_username) == 0);
   1.372 +    assert(bella->user_id);
   1.373 +    assert(strcmp(bella->user_id, not_my_userid) == 0); // ???
   1.374 +    assert(!bella->me); 
   1.375 +    assert(bella->comm_type == PEP_ct_OpenPGP_unconfirmed);
   1.376 +    assert(strcmp(bella->address, bella_address) == 0);
   1.377 +
   1.378 +    cout << "PASS: update_identity() correctly retrieved extant record with matching address and username; temp user_id in DB patched" << endl << endl;
   1.379 +    free_identity(bella);
   1.380 +
   1.381 +    cout << "****************************************************************************************" << endl;
   1.382 +    cout << "* II: 9. update_identity() for address, username, and user_id, but no matching record" << endl;
   1.383 +    cout << "****************************************************************************************" << endl << endl;
   1.384 +    
   1.385 +    const char* rando_name = "Pickley BoofBoof";
   1.386 +    const char* rando_userid = "Boofy";
   1.387 +    const char* rando_address = "boof@pickles.org";
   1.388 +    somebody = new_identity(rando_address, NULL, rando_userid, rando_name);
   1.389 +    status = update_identity(session, somebody);
   1.390 +
   1.391 +    assert(status == PEP_STATUS_OK);
   1.392 +    assert(!somebody->fpr || somebody->fpr[0] == '\0');
   1.393 +    assert(somebody->username);
   1.394 +    assert(strcmp(somebody->username, rando_name) == 0);
   1.395 +    assert(somebody->user_id);
   1.396 +    assert(strcmp(somebody->user_id, rando_userid) == 0); // ???
   1.397 +    assert(!somebody->me); 
   1.398 +    assert(somebody->comm_type == PEP_ct_key_not_found);
   1.399 +    assert(strcmp(somebody->address, rando_address) == 0);
   1.400 +
   1.401 +    cout << "PASS: update_identity() correctly created record with no key" << endl << endl;
   1.402 +    free_identity(somebody);
   1.403 +    
   1.404 +    cout << "****************************************************************************************" << endl;
   1.405 +    cout << "* II: 10. update_identity() for address, username, but no matching record" << endl;
   1.406 +    cout << "****************************************************************************************" << endl << endl;
   1.407 +
   1.408 +    const char* rando2_name = "Pickles BoofyBoof";
   1.409 +    const char* rando2_address = "boof2@pickles.org";
   1.410 +    somebody = new_identity(rando2_address, NULL, NULL, rando2_name);
   1.411 +    status = update_identity(session, somebody);
   1.412 +    const char* expected_rando2_userid = "TOFU_boof2@pickles.org";
   1.413 +
   1.414 +    assert(status == PEP_STATUS_OK);
   1.415 +    assert(!somebody->fpr || somebody->fpr[0] == '\0');
   1.416 +    assert(somebody->username);
   1.417 +    assert(strcmp(somebody->username, rando2_name) == 0);
   1.418 +    assert(somebody->user_id);
   1.419 +    assert(strcmp(somebody->user_id, expected_rando2_userid) == 0); // ???
   1.420 +    assert(!somebody->me); 
   1.421 +    assert(somebody->comm_type == PEP_ct_key_not_found);
   1.422 +    assert(strcmp(somebody->address, rando2_address) == 0);
   1.423 +
   1.424 +    cout << "PASS: update_identity() correctly created record with no key" << endl << endl;
   1.425 +    free_identity(somebody);
   1.426 +
   1.427 +    cout << "****************************************************************************************" << endl;
   1.428 +    cout << "* II: 11. update_identity() for address only, but multiple matching records" << endl;
   1.429 +    cout << "****************************************************************************************" << endl << endl;
   1.430 +
   1.431 +    const char* bella_id_2 = "Bella2";
   1.432 +    bella = new_identity(bella_address, NULL, bella_id_2, bella_username);
   1.433 +    
   1.434 +    // 2. set identity
   1.435 +    status = set_identity(session, bella);
   1.436 +    assert(status == PEP_STATUS_OK);
   1.437 +    free_identity(bella);
   1.438 +                
   1.439 +    bella = new_identity(bella_address, NULL, NULL, NULL); 
   1.440 +    status = update_identity(session, bella);
   1.441 +    assert(status != PEP_STATUS_OK);
   1.442 +
   1.443 +    cout << "PASS: update_identity() correctly failed with no matching records (too little info)" << endl << endl;
   1.444 +    
   1.445 +    cout << "****************************************************************************************" << endl;
   1.446 +    cout << "* III: key election " << endl;
   1.447 +    cout << "****************************************************************************************" << endl << endl;
   1.448 +
   1.449 +    cout << "****************************************************************************************" << endl;
   1.450 +    cout << "* III: key election:  " << endl;
   1.451 +    cout << "****************************************************************************************" << endl << endl;
   1.452 +
   1.453 +    cout << "****************************************************************************************" << endl;
   1.454 +    cout << "* III: key election:  " << endl;
   1.455 +    cout << "****************************************************************************************" << endl << endl;
   1.456 +    cout << "****************************************************************************************" << endl;
   1.457 +    cout << "* III: key election:  " << endl;
   1.458 +    cout << "****************************************************************************************" << endl << endl;
   1.459 +    cout << "****************************************************************************************" << endl;
   1.460 +    cout << "* III: key election:  " << endl;
   1.461 +    cout << "****************************************************************************************" << endl << endl;
   1.462 +    cout << "****************************************************************************************" << endl;
   1.463 +    cout << "* III: key election:  " << endl;
   1.464 +    cout << "****************************************************************************************" << endl << endl;
   1.465 +    cout << "****************************************************************************************" << endl;
   1.466 +    cout << "* III: key election:  " << endl;
   1.467 +    cout << "****************************************************************************************" << endl << endl;
   1.468 +    cout << "****************************************************************************************" << endl;
   1.469 +    cout << "* III: key election:  " << endl;
   1.470 +    cout << "****************************************************************************************" << endl << endl;
   1.471 +    cout << "****************************************************************************************" << endl;
   1.472 +    cout << "* III: key election:  " << endl;
   1.473 +    cout << "****************************************************************************************" << endl << endl;
   1.474 +    cout << "****************************************************************************************" << endl;
   1.475 +    cout << "* III: key election:  " << endl;
   1.476 +    cout << "****************************************************************************************" << endl << endl;
   1.477 +    cout << "****************************************************************************************" << endl;
   1.478 +    cout << "* III: key election:  " << endl;
   1.479 +    cout << "****************************************************************************************" << endl << endl;
   1.480 +
   1.481 +
   1.482 +    return 0;
   1.483 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/test/test_keys/priv/bernd.das.brot-0xCAFAA422_priv.asc	Wed Jan 17 23:00:00 2018 +0100
     2.3 @@ -0,0 +1,59 @@
     2.4 +-----BEGIN PGP PRIVATE KEY BLOCK-----
     2.5 +
     2.6 +lQOYBFpctn4BCACx7hSdsA+AnAQ+VRT8vb820MUhgiZ2gBOmmjZt+R+U8jGA0RFT
     2.7 +OFGWMNwVNNDV+FFES4yTbbmH3JPEPfRTKzcBJrty0WfTrCQ65lv1GBmGPO306pg3
     2.8 +/AA8n8e7SAVwc3fHB0oImQTkiN9Jx13KvFhSm32e4DWlDEYEIOSXY5ZjmczMoLTq
     2.9 +mwbf0ROXI+aXh793AS+oUlxl8CZJxwW8EmLiHAc2KJVXubJCq3nkwtz03/NvgCYL
    2.10 +M0cXds/jNrEEpTbXjx7pnVJC1tIrCrFrKChM4qUpcWqSPwn0pIs8EP2FHS5Ou0MK
    2.11 +O59bGVWP5EPy2gyS8bfgtWt8tL0jilBlUa4hABEBAAEAB/wM0c7+x4BubznntctD
    2.12 +zyCs6zYbd8bxUxassmqz2gxPonLfnvCPyDx/ROOZIYuJsbuaiejwdv+JjY0V9Agb
    2.13 +n+mgIHFxUIDEYaA19YKa8j1l4b5GnvUQVOHoJvObMjwLbJOs2CvE2nrdmQuhb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AgMB
    2.29 +Ah4BAheAAAoJENSwiKfK+qQi+OMIAIXUeU2A74JwnbtO7XzGZ60j7roCAOAn5AHx
    2.30 +GNnWlguRIk0it+7H1PPdFMETWDKATVesmNFVATQ1vs5/G3TmHCzie/yjLMKHg2iv
    2.31 +ouQhEde5x5sbI+w501GDinDLihJC1kIrBW9MnEE4LniXZ1SBXoTwy9H7vLhvgckH
    2.32 +p3JL/zT3Z7hn/oGT21Der/smYJp8lI3gLOA52eFCiwtzn1Rv09fjUYIcuvHFMl9o
    2.33 +1yJTu/hLSRBwJliLdvl/HQLiM+onr7NoJCxdnvDrQUqMVH4qjDAHJKZMjjy5TLko
    2.34 +TAcLeohO3NlMSXmRIhDUIr6S34hUNdrHIopORgajXbfKbM4iAL6dA5gEWly2fgEI
    2.35 +AKnO1DQBmoB4KlrcNKXlCazCWp0cLPWB11cIGpb0DGeVEndCxQfBGRocZs7zZn1M
    2.36 +pEpzRx9Ae/R/o3w42IaBF62RXOpofq2WSe/TYI4QJJvSPJ168VuP9BmNeARL0Q1E
    2.37 +AMro483LCCUpGIOb7uC9hn/Bi1OmK956tJqEOSYqrpxkY3kw3CUVknDCd12nc7zB
    2.38 ++1KQDCYSqQVZJ5zkagr65E26SXfvzf3n/x+UB9FhnIE2zzkUJvsgY7s7z/XL/NXD
    2.39 +uKjPbbIL6bhhP08koljCN49q0pSlB+Evw5oukmON46JSe1YymBzVA49b73IrSVrX
    2.40 +KT0tbKVguiUG3ewc9aunUpcAEQEAAQAH/jIgkucZVBU5o/M3jzkr0DvWEe7QOvts
    2.41 +jXetNkA6ohDP4mgfZ0+fMrxRBw5vruEtR1CNEEFLBWyLY2UP2Od341gDEeVG3KJ8
    2.42 +u63W/eliHZR8LxWkDezkJYCHkRbflMJwQTWlI16EYY6qv4hWd2GTwUkkhu82Hjwq
    2.43 +h/cXMlGwhuQ2iTDJOcCmYh3ExgVrhc6XPCmtPSuG28KR2sN2pRDl5pPH+/wbKNVS
    2.44 +hk01m9/kDdDMSi6U4PMPZ4Sq/0mzlfWXeD6Itn2vKhLnEFp3vYr8P8m2+AgWtM+D
    2.45 +7fPAf1O07xNWxDkNgnolgluoU3FrpifYwaaj6N6rFGsBEv0Nfwju8kEEAMiu71QB
    2.46 +kLf6Mf1R/lRWEyP6/HPiNu9fMHnV+ml6VFyiaJCCZvUBbZOKDOmedVS3pJXGp9uk
    2.47 +G6CLSqlCghgPK9M+ExtSN2JrgNPU1bXSMviHVMq70HtUeo/wHPfIoYpQ+VRiu5i8
    2.48 +kZgkCCFCKlxr0WTp3tI51xu0g0fQOrpT16hXBADYnTG7WYMHyDCO3uh+/zErhw/r
    2.49 +6POZZWegnPteim6GN8X8NG7GJnQB7Voqn8X7tAcKPgCQBEdOltz3PWWDm66E4VFs
    2.50 +e7Bau5i+SshzKXdKwYVkGH6h8YWlJjqOm3m9WCAUg517xy9VMyxihpTvZs2Wwtk2
    2.51 +TY2/Cv7RyrXAAvw/wQP/XQjphddiuST6wKiAWsbzYhuof3zyXX3fy4vE6rNxvl/D
    2.52 +RAOcKFex0Q59K0YOePRYrEjQlUoPhqyeQGUp7DZsyiTGMpmFVRqg6LcmAfQdO62y
    2.53 +53gEc5cr5fnZOKavu5agP/ktry28z8pzg0pXUkqcdqxluIXp9Av/Dc+aB5VzQXtG
    2.54 +k4kBPAQYAQgAJhYhBPjOD34k6xkKL8v9ONSwiKfK+qQiBQJaXLZ+AhsMBQkAAVGA
    2.55 +AAoJENSwiKfK+qQifC4H/13K4LnWFOqSAXzzqnass2aY++1EVXRnMDdXsp3jU17t
    2.56 +CFJZufoNAw7vmInrCgxMViUjfV6DfyDsrYynDWfIAS6FO3ThnFtgkgekdTrNg6DZ
    2.57 +OMl7D9+xaP0S/fVITZz5XRqs7amRkojftQHJMpPNoXwcGK1hGLgPIvN4cbLIRvnG
    2.58 +SDhkstFdsvNbC92z2upit7+yq9eW+Kn2exJRszgbZ53ghmhNy4CrhjJC90CsYF1S
    2.59 +zsDlqwc1ET4vjV1pCnjyVk+pNsw1V9kKMm8icFFwB57xX5Q9EdwMipNaWWg7CHMM
    2.60 +8+Bjqsj2qHs0LNWO7eQyr8Uj0BwfT04Wwz68iD57lEQ=
    2.61 +=GIbJ
    2.62 +-----END PGP PRIVATE KEY BLOCK-----
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/test_keys/priv/pep.test.alexander-0x26B54E4E_priv.asc	Wed Jan 17 23:00:00 2018 +0100
     3.3 @@ -0,0 +1,58 @@
     3.4 +-----BEGIN PGP PRIVATE KEY BLOCK-----
     3.5 +
     3.6 +lQOYBFpfqMMBCACz5nJSa4CRwT9IaF9HVduwwhv7Ibwu/5xEviQDczmeUYxGS3K5
     3.7 +P22aKWKiGdu9zebCBPqozLTz7bk4yCbIxuUm4+TVyJx0ORgaPswmbp5WnKhnzGo8
     3.8 +7iKLHerXTQOsFyA0eyVkEokR4GmNlyc0KK3hO4M6q71A43bYf7J0uZdXfezMoYJG
     3.9 +lcJ8UxmOLfB6GrNjd2zD244Csa/tCqjNXp2EUI4DrJWByVN18pHAeT+MmrJYkMM4
    3.10 +lOeQjeFCkPnekn8afBJ3QTaEF7yi8qrWQ0VJQpT9MSe56f5KaCbYWhv27ZzDVGWm
    3.11 +OavXDWfNgCp45jPEypAcD3jcUUrmTonYELrZABEBAAEAB/0ZeUg244IRIYwUdLMJ
    3.12 +Jt806EeOB/jdrtQx57qxwl8mS+XRDl3wXUrnyXRt/7td5QoH7yyPOm1lHQRdRfo3
    3.13 +8/H+z8ZXf1CoJG2FSd8ekgtZuFUgXZGtjwrVKCdY1U7vz1aAF+/ze6xtG5nWstCa
    3.14 +UihM/GBYrnjd91ec0Hg0jxMfEDiX5S1GkP0VVeCp5/gNgNxymgMGa0WWQArxaa5G
    3.15 +iwiVf9LIjiHUm0yOpa+5KvOiymu+zVHUuM0YnGcTM+8WaUVjXRxZ/9MMHKVz0Vmm
    3.16 +xC6Kqun95goFivIrzpsRgSBCPR9q/cx3tS+kCgFs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g5PUTC7lJHnrg9Tcd/YVVAShk/1Y3Hn
    3.32 +s20paq3cM1So5J6SmXdrm9sp/9lnBhK+/55N3JgsRcjy6Q0ONoyVfJOV+UjugP0V
    3.33 +WmEEncrjYRKqQ7pvCyx3gFDv8vRWtHndYR00V2gys50DmARaX6jDAQgAzzSE1q5Y
    3.34 +5bcSXP2qGSg4oeVPK5Uj2nb4DF3IDF6KGmWiNBk/DWmh0v89LjvgPR5l7HcHaQr7
    3.35 +Xz48FFe3e3kNbwSckTLip6fnGZhBCQ480hMjZjXICetpc6WRbj8UNsLGkKluN4ws
    3.36 +uvtgZ5z+XDUrOwgKgwmK2KxBWh26yhCZqUYt4+l6wYbfCvzXIlUReaL+kc1lEmp5
    3.37 +nQKdzLOXKay2MO5kY4ZTQLh8vsGIS03AoG7HD4QuY6AVaB9tZ08wwoBKRRxh2/+Z
    3.38 +a12GX1qVm4aWdQd91cyaNepHnLOyejb9nyenfBWEFx171MxOQRocasZSoE0+DQ9H
    3.39 +tlI6GeSov9CbhwARAQABAAf9GvLGKhOfzTSLp1t4YXA5OVkU/GKXuKSLazRRPcaX
    3.40 +6In6WBNGf4yS9tmqT9aKufg3olLyvEco3UC/WJf17ZGXXS543GuFTe/I3yvNnYtj
    3.41 +/qBtlK/+9cdPvjI04WVD0EFxyMO4aXIKKUFjTuZ8sGpb1oAbueImVDrG/xzpu7j/
    3.42 ++yNAzTIFvdHsbuHlK5CZ52j7hWqkR7Pgji3qit6+DBMRXnwMqHQFVg685uKnwumt
    3.43 +Bld7fdxc9IQmchdAfIlF2xDQ/sadME3aCe/aJIXxka07OSJfguIoLkdYCQ8Re4gG
    3.44 +Ge6NNe5QuGpJ9d+b8Wlw/O3zZB9PnALfqudtQxLoznJ+jQQA0aNcEESsAdaTFbXO
    3.45 +1xSUv6vXXQsFS18CSKMlcM7Kx8KYwC2PkzwQns7YS98pHwWW0XiYBt+YPiNpHKfv
    3.46 +kvcYk0iavsOEoxjVb3dtyzH+BAgtKcznwnZRBLK+/dTj6RHPJ3+3OyjKFDL8QRtF
    3.47 +xMBUv8oQnAUXISiCb3vWX+PY+uUEAP0HarZ+uiYW7J1iMwSlwOx00Ne1Nz/9rtts
    3.48 +Z1zUCei85HtVZ5yHqhsRo2LZhBkghwVkd/xrcbLzBvDmAVdLDAwd3x7yH/ogzCzw
    3.49 +qZXgyrno5JSpWUj3QIebIH6vhWY3sooXzdviJYAqXOtQKq4QcWntcpFxPbxEpQCP
    3.50 +PlvM5Vn7A/4voesQWnZM68SDK4q9YCdcBmEzH8YXNfshD6svVzfhEKD9CWXCNn52
    3.51 +lyYOD839Ns7T0A0CL3/4STGNJ/RMu+N9KYKnTrVgdBXcMR1U6sgXlLZuWWKze8Zu
    3.52 +YNM38dD3rlhsPNXvHQwFwyv07SOtdsgpRy5izWdSZElhm+MDXLUu9ESBiQE2BBgB
    3.53 +CAAgFiEEOtn2D66yJnXbhzoTYtaYEya1Tk4FAlpfqMMCGwwACgkQYtaYEya1Tk5R
    3.54 +gggAo2kakClMpSC24XoBbkCCLd5UgMyb7AvqUOZgtdP+kyS1AuRHuur2OhpF87By
    3.55 +EeZs+ZxD8Hr0sju372hNey4c9e/VFMZvru+315RCF+4I/Cv5iMq6YhBCoNlL39ij
    3.56 +zto3kCZlRXg/twBPmB07D/M4k2/FXZWjqiQaN8DjXlIzXK+cVggdq7PXiyxurFdL
    3.57 +ghCeBKc+J8ZR6sshYPkpe7SmgGqqeRX2Dv+xU8i4mxXM4JAif9dOWpxoWqH49ReJ
    3.58 +Om1gWCHou7d7NS5qO6M413dqF8QWO1c71qt5OSpq+wen9Z45TOwJo8wxs0BgtRZV
    3.59 +iNqClyzhbFlp9Jpk5HhTOxOe6A==
    3.60 +=sNFr
    3.61 +-----END PGP PRIVATE KEY BLOCK-----
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/test/test_keys/priv/pep.test.bella-0xAF516AAE_priv.asc	Wed Jan 17 23:00:00 2018 +0100
     4.3 @@ -0,0 +1,58 @@
     4.4 +-----BEGIN PGP PRIVATE KEY BLOCK-----
     4.5 +
     4.6 +lQOYBFpfuwkBCADXNMGMEroRCUpZ3jRQ9o38NBbOlmXXQ7ZSSuXdbJU9xd+UOUsj
     4.7 +JLapYg56XbU7o17oAFfa9VZlX57OtHbdGuoUgiNS5QT/T4R6cSiPg92+riVygVop
     4.8 +ncERHsXq+7noyiSdv7peSfVygcn2Z6T63HkY/tGJJVPbfFDDUWn+qKDydpFkSiUx
     4.9 +2SDBhgDOstYMxOsDRlIEOWWYIBXKJe2tN9DSA7nDtnu1GapLNHtZRfib8E+wwK5e
    4.10 ++WijHElB/dvJdL5Zp/gT1jhtr8WxWdmbKaJQwX49VT0uU/IdWfwxfZKEjaPTKNU9
    4.11 +urrRDq+0Kgo/j9s+edYiN5cKBUkIoEFNE4LvABEBAAEAB/sHCecwrSYfy4V+hfmB
    4.12 +EmdXcd6zGBExprnOXDvDb7s7335uCyeteRRuWtItZ2Y3kqLWhLha5X5TZ3q6uQVQ
    4.13 +OwKf9BeyrOHqdc/X716LvxzgETMRWTC5PrsjU7XWdzA/8GidLjmqvtGD0sHnyMEJ
    4.14 +IW/mhOMWkL165sh/cui8FwjYlT/IA3nKO1glAAwCBQYc16ejMqWn4ghyRjmkpv8F
    4.15 +GULn3dMI4ewet4MFvqTZN2OjU7KiBTEka083Ht2yChLS16dSunfwP5M+i9wPklOz
    4.16 +GXfLAsxqP/V24tysLWyoOC6VTIJuqLzc4o9A5zdX9wukG3gEf7ceFRp6U8KGPtRu
    4.17 +UXExBADXaOQQPZ+rAn8PJTDaWFRtrFm/J9V30BuZCsN56EZ7A4nhZZkguC79vC2N
    4.18 +EoI8PzbPTSCf7Fnm3Y166ExxC1drftMtsXmKKEk3lGFUeCieiHFhFyc47nioGT2b
    4.19 +mf1kxRUUjKGq/1rCLi1lEU6z1FHpYnKu+uSEoVPTQkC/EvUdHwQA/8IKj8OKVFL6
    4.20 +pENUtACp/3ofSh+6DxDZj8+63sScTMY1LytNTn2lu9/7NyVa898ppuEq/qtrD4ti
    4.21 +o3xqT/DBhXKnFp1rQI8ySpVPjYF0KLBqdQth8YRuPeOdNAbjoOGtQsKJXzJSVu5s
    4.22 +dW4zdwFaeUxD3p+f6x/fKPrwp+PJEDEEALYhX9p0LV1GLpmGGvZIO7mBwl06I6EY
    4.23 +O4Ett+1fN0AdeAEtszomyTotCa8TDEmpVIvISebsi11eNXn/0e44jjFM9Bemdeev
    4.24 +F/tBcxbaKgESWIORf0Tgpf1xmmACG0O/yg0geQQD9v2cAhQlH5jgCBmVB2MJqwjb
    4.25 +5a6bHoBdDUIPLGi0OVBlcCBUZXN0IEJlbGxhIChQZXAgVGVzdCBLZXkpIDxwZXAu
    4.26 +dGVzdC5iZWxsYUBwZXB0ZXN0LmNoPokBTgQTAQgAOBYhBFYxvxNXMmoCqkcO7rgV
    4.27 +73+kUWquBQJaX7sJAhsDBQsJCAcCBhUICQoLAgQWAgMBAh4BAheAAAoJELgV73+k
    4.28 +UWquzNEH/1CB1zM18gXosslKF/Kxh0xFqnXKvrc7W4pO/rYNW+qfArGp7p+fjiqc
    4.29 +5amPWO7GINW5BPw4taoAirr6sXSYB9uWYxRXL//euTcuAIyeA0Xvw9I9EL92HtAM
    4.30 +e71PNcsPeQskTtfCUGH2B8OZ84+bTSgf6WcLT9CSESHl84rA+mVXQneGTXbY7cJ8
    4.31 +i6g8HedNbzz/wmAJoByYrei1lypPnWXawBbxheDe45NmvL1AQS7psXTPHJTFFZWC
    4.32 +bswfEtYobRFX9UJ9rNGp0tY0CmzW4qRwR38P57XkgurgM7nOvlYDlVium+qv7ERw
    4.33 +Q4wsn5cSuAun93vjY9TM9O4MIzzFKdOdA5gEWl+7CQEIAOg2gQ1AF4l+/2GRwwzB
    4.34 +Rk845rzLbpp81Hlys7JQ0P/klE1zoXcSWnsBAHV9Y0utIEGwIIxKB0TAi8CFlDsM
    4.35 +/pAI7TPjIMtxndltA0JWsWtT9d0HtmyOCslk4VvFCsN7UgCrklwPSnabzbNr9W/J
    4.36 +0bpGK6sey+u0BEPAcbZPRndm8JLy+EkbbOaah97xKt1kvtcutvkPwof62bVB0i5+
    4.37 +GuvX33b5jokBjk9eWdSeZSNZQjiOtArCdnLMa5H/EbdG4Ge4b7ey//E4VKdjGcD8
    4.38 +KfW4lA6N9XZbLfJNjjLWn0XUa7BVE8K+6RDWZ0cmg4v2TC73YarNW7N+lTgwf86R
    4.39 +HMUAEQEAAQAH/AznxI3SN0yornRDd9HcZvYtrSMmci/rSpqyTXrWQ3tJPpW8XKej
    4.40 +sTwfTuF4tb1FsqJ78Z8iWRuQ0OOC+P08KGSkXlxxHcg4uQNVq+Xyr/sNSD9/t3t6
    4.41 +fG57aQvi3EmHb8QCRQjRP7vuRkUXtaUAFCQUVMZ2mHIxx7/lMNynNL0bdBtXUAsr
    4.42 +RTqBiOLq1uS1yOwdOjzae7Y5IDGZ5iwmTNtO+zVRtlyiOQ2l2lXLc8h/1n21W3io
    4.43 +f/MVKePNXDteSIJZ0UJIMRd5N4Ba8TCu/yu6iKANKbtjbrMhP/1JS1z5xCRxyfVW
    4.44 +n9DMaAG/wRiCrytRZ+bjdy4oa7d6QkoErQkEAOwFckqUHKDLtzP5SXjrA8ZTLuPW
    4.45 +4OaxmyRMScxq7KoHw9KXyvJ22aueeHRykLSjg3RNka/1L5mE/ESsZG5qhXhgJtIC
    4.46 +JGHpKg+vUmfztBdFRA38vLVdY1or7fio07Bqg9V06Nfa6eVCK004pDW5YThqOkbZ
    4.47 +tRTfhy97FDVHKI0NBAD73offmAzqGQrED0ilcy7va6/0cYnJderdFpY8MntRZSKd
    4.48 +rOpZWFAleNVzQ1F1HGOkhB4XLvdz3OI8KS8q+KgupiWPkx7NAZXV8mTA8JHUwFNS
    4.49 +4K9Dv7FpbW4Agx77+zK097B0ICki/BNDF8k3VHgbTnoSRhz2o+stKlrGP5QQmQQA
    4.50 +y6WSbOxPFrZlUgCJxDydcVGgDNEb7cFSzra56ZQ21By7LKOaKcdiWe5xI9iLdAYp
    4.51 +GRLsmmEzxn4KiRuYSkGWJlVR9o/2ZFqr6ZpGYY+WyJpqDckmfFmPFMcB8h9r4lIa
    4.52 +WDi82b8LP1Iosg5jWVYjJ1swFgwAfCjyG753jaRCzF01sYkBNgQYAQgAIBYhBFYx
    4.53 +vxNXMmoCqkcO7rgV73+kUWquBQJaX7sJAhsMAAoJELgV73+kUWqughYIAIpK+sEe
    4.54 +eRt5ZKCEH7d02F4CXVOCRY/+hJXwVVBtE86j6xjUgUpC0tb45UmUfiBMfiIN/aU5
    4.55 +6tE+8tsl419oWyUXhR/jX3hBHxxWQRrL7omqKM1pC/TYt2EH93g7el4Gmv1xUjSG
    4.56 +/djdaF15iLyNsBVMH7r5VtvAcOhhiEZQzAUXek0HT+oD+g1rt91CIG/IN9SBpd0c
    4.57 +7JgIe5m+W1rVYl4wD5JCLi371eRokrVr6pd4/tSF6KBoik9HOphNbGdx7O3P0Sap
    4.58 +mjXUGbq2UmjsEF9ObP32NdCI6srekivexxn3FUUWEe/PK3uGh9vc8vHONWo268Ld
    4.59 +Pnr7619NE1SUzJU=
    4.60 +=GFL3
    4.61 +-----END PGP PRIVATE KEY BLOCK-----
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/test_keys/pub/bernd.das.brot-0xCAFAA422_pub.asc	Wed Jan 17 23:00:00 2018 +0100
     5.3 @@ -0,0 +1,32 @@
     5.4 +-----BEGIN PGP PUBLIC KEY BLOCK-----
     5.5 +
     5.6 +mQENBFpctn4BCACx7hSdsA+AnAQ+VRT8vb820MUhgiZ2gBOmmjZt+R+U8jGA0RFT
     5.7 +OFGWMNwVNNDV+FFES4yTbbmH3JPEPfRTKzcBJrty0WfTrCQ65lv1GBmGPO306pg3
     5.8 +/AA8n8e7SAVwc3fHB0oImQTkiN9Jx13KvFhSm32e4DWlDEYEIOSXY5ZjmczMoLTq
     5.9 +mwbf0ROXI+aXh793AS+oUlxl8CZJxwW8EmLiHAc2KJVXubJCq3nkwtz03/NvgCYL
    5.10 +M0cXds/jNrEEpTbXjx7pnVJC1tIrCrFrKChM4qUpcWqSPwn0pIs8EP2FHS5Ou0MK
    5.11 +O59bGVWP5EPy2gyS8bfgtWt8tL0jilBlUa4hABEBAAG0ckJlcm5kIGRhcyBCcm90
    5.12 +IGRlciBVbHRpbWF0aXZlIFRlc3RrYW5kaWRhdCAoSW50ZW50aW9uYWxseSBFeHBp
    5.13 +cmVkIEtleSBmb3IgVGVzdGluZyEpIDxiZXJuZC5kYXMuYnJvdEBkYXJ0aG1hbWEu
    5.14 +b3JnPokBVAQTAQgAPhYhBPjOD34k6xkKL8v9ONSwiKfK+qQiBQJaXLZ+AhsDBQkA
    5.15 +AVGABQsJCAcCBhUICQoLAgQWAgMBAh4BAheAAAoJENSwiKfK+qQi+OMIAIXUeU2A
    5.16 +74JwnbtO7XzGZ60j7roCAOAn5AHxGNnWlguRIk0it+7H1PPdFMETWDKATVesmNFV
    5.17 +ATQ1vs5/G3TmHCzie/yjLMKHg2ivouQhEde5x5sbI+w501GDinDLihJC1kIrBW9M
    5.18 +nEE4LniXZ1SBXoTwy9H7vLhvgckHp3JL/zT3Z7hn/oGT21Der/smYJp8lI3gLOA5
    5.19 +2eFCiwtzn1Rv09fjUYIcuvHFMl9o1yJTu/hLSRBwJliLdvl/HQLiM+onr7NoJCxd
    5.20 +nvDrQUqMVH4qjDAHJKZMjjy5TLkoTAcLeohO3NlMSXmRIhDUIr6S34hUNdrHIopO
    5.21 +RgajXbfKbM4iAL65AQ0EWly2fgEIAKnO1DQBmoB4KlrcNKXlCazCWp0cLPWB11cI
    5.22 +Gpb0DGeVEndCxQfBGRocZs7zZn1MpEpzRx9Ae/R/o3w42IaBF62RXOpofq2WSe/T
    5.23 +YI4QJJvSPJ168VuP9BmNeARL0Q1EAMro483LCCUpGIOb7uC9hn/Bi1OmK956tJqE
    5.24 +OSYqrpxkY3kw3CUVknDCd12nc7zB+1KQDCYSqQVZJ5zkagr65E26SXfvzf3n/x+U
    5.25 +B9FhnIE2zzkUJvsgY7s7z/XL/NXDuKjPbbIL6bhhP08koljCN49q0pSlB+Evw5ou
    5.26 +kmON46JSe1YymBzVA49b73IrSVrXKT0tbKVguiUG3ewc9aunUpcAEQEAAYkBPAQY
    5.27 +AQgAJhYhBPjOD34k6xkKL8v9ONSwiKfK+qQiBQJaXLZ+AhsMBQkAAVGAAAoJENSw
    5.28 +iKfK+qQifC4H/13K4LnWFOqSAXzzqnass2aY++1EVXRnMDdXsp3jU17tCFJZufoN
    5.29 +Aw7vmInrCgxMViUjfV6DfyDsrYynDWfIAS6FO3ThnFtgkgekdTrNg6DZOMl7D9+x
    5.30 +aP0S/fVITZz5XRqs7amRkojftQHJMpPNoXwcGK1hGLgPIvN4cbLIRvnGSDhkstFd
    5.31 +svNbC92z2upit7+yq9eW+Kn2exJRszgbZ53ghmhNy4CrhjJC90CsYF1SzsDlqwc1
    5.32 +ET4vjV1pCnjyVk+pNsw1V9kKMm8icFFwB57xX5Q9EdwMipNaWWg7CHMM8+Bjqsj2
    5.33 +qHs0LNWO7eQyr8Uj0BwfT04Wwz68iD57lEQ=
    5.34 +=Y6m7
    5.35 +-----END PGP PUBLIC KEY BLOCK-----
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/test/test_keys/pub/pep.test.alexander-0x26B54E4E_pub.asc	Wed Jan 17 23:00:00 2018 +0100
     6.3 @@ -0,0 +1,31 @@
     6.4 +-----BEGIN PGP PUBLIC KEY BLOCK-----
     6.5 +
     6.6 +mQENBFpfqMMBCACz5nJSa4CRwT9IaF9HVduwwhv7Ibwu/5xEviQDczmeUYxGS3K5
     6.7 +P22aKWKiGdu9zebCBPqozLTz7bk4yCbIxuUm4+TVyJx0ORgaPswmbp5WnKhnzGo8
     6.8 +7iKLHerXTQOsFyA0eyVkEokR4GmNlyc0KK3hO4M6q71A43bYf7J0uZdXfezMoYJG
     6.9 +lcJ8UxmOLfB6GrNjd2zD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wwoBKRRxh2/+Za12GX1qVm4aWdQd91cyaNepHnLOyejb9nyen
    6.25 +fBWEFx171MxOQRocasZSoE0+DQ9HtlI6GeSov9CbhwARAQABiQE2BBgBCAAgFiEE
    6.26 +Otn2D66yJnXbhzoTYtaYEya1Tk4FAlpfqMMCGwwACgkQYtaYEya1Tk5RgggAo2ka
    6.27 +kClMpSC24XoBbkCCLd5UgMyb7AvqUOZgtdP+kyS1AuRHuur2OhpF87ByEeZs+ZxD
    6.28 +8Hr0sju372hNey4c9e/VFMZvru+315RCF+4I/Cv5iMq6YhBCoNlL39ijzto3kCZl
    6.29 +RXg/twBPmB07D/M4k2/FXZWjqiQaN8DjXlIzXK+cVggdq7PXiyxurFdLghCeBKc+
    6.30 +J8ZR6sshYPkpe7SmgGqqeRX2Dv+xU8i4mxXM4JAif9dOWpxoWqH49ReJOm1gWCHo
    6.31 +u7d7NS5qO6M413dqF8QWO1c71qt5OSpq+wen9Z45TOwJo8wxs0BgtRZViNqClyzh
    6.32 +bFlp9Jpk5HhTOxOe6A==
    6.33 +=TT+k
    6.34 +-----END PGP PUBLIC KEY BLOCK-----
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/test/test_keys/pub/pep.test.bella-0xAF516AAE_pub.asc	Wed Jan 17 23:00:00 2018 +0100
     7.3 @@ -0,0 +1,31 @@
     7.4 +-----BEGIN PGP PUBLIC KEY BLOCK-----
     7.5 +
     7.6 +mQENBFpfuwkBCADXNMGMEroRCUpZ3jRQ9o38NBbOlmXXQ7ZSSuXdbJU9xd+UOUsj
     7.7 +JLapYg56XbU7o17oAFfa9VZlX57OtHbdGuoUgiNS5QT/T4R6cSiPg92+riVygVop
     7.8 +ncERHsXq+7noyiSdv7peSfVygcn2Z6T63HkY/tGJJVPbfFDDUWn+qKDydpFkSiUx
     7.9 +2SDBhgDOstYMxOsDRlIEOWWYIBXKJe2tN9DSA7nDtnu1GapLNHtZRfib8E+wwK5e
    7.10 ++WijHElB/dvJdL5Zp/gT1jhtr8WxWdmbKaJQwX49VT0uU/IdWfwxfZKEjaPTKNU9
    7.11 +urrRDq+0Kgo/j9s+edYiN5cKBUkIoEFNE4LvABEBAAG0OVBlcCBUZXN0IEJlbGxh
    7.12 +IChQZXAgVGVzdCBLZXkpIDxwZXAudGVzdC5iZWxsYUBwZXB0ZXN0LmNoPokBTgQT
    7.13 +AQgAOBYhBFYxvxNXMmoCqkcO7rgV73+kUWquBQJaX7sJAhsDBQsJCAcCBhUICQoL
    7.14 +AgQWAgMBAh4BAheAAAoJELgV73+kUWquzNEH/1CB1zM18gXosslKF/Kxh0xFqnXK
    7.15 +vrc7W4pO/rYNW+qfArGp7p+fjiqc5amPWO7GINW5BPw4taoAirr6sXSYB9uWYxRX
    7.16 +L//euTcuAIyeA0Xvw9I9EL92HtAMe71PNcsPeQskTtfCUGH2B8OZ84+bTSgf6WcL
    7.17 +T9CSESHl84rA+mVXQneGTXbY7cJ8i6g8HedNbzz/wmAJoByYrei1lypPnWXawBbx
    7.18 +heDe45NmvL1AQS7psXTPHJTFFZWCbswfEtYobRFX9UJ9rNGp0tY0CmzW4qRwR38P
    7.19 +57XkgurgM7nOvlYDlVium+qv7ERwQ4wsn5cSuAun93vjY9TM9O4MIzzFKdO5AQ0E
    7.20 +Wl+7CQEIAOg2gQ1AF4l+/2GRwwzBRk845rzLbpp81Hlys7JQ0P/klE1zoXcSWnsB
    7.21 +AHV9Y0utIEGwIIxKB0TAi8CFlDsM/pAI7TPjIMtxndltA0JWsWtT9d0HtmyOCslk
    7.22 +4VvFCsN7UgCrklwPSnabzbNr9W/J0bpGK6sey+u0BEPAcbZPRndm8JLy+EkbbOaa
    7.23 +h97xKt1kvtcutvkPwof62bVB0i5+GuvX33b5jokBjk9eWdSeZSNZQjiOtArCdnLM
    7.24 +a5H/EbdG4Ge4b7ey//E4VKdjGcD8KfW4lA6N9XZbLfJNjjLWn0XUa7BVE8K+6RDW
    7.25 +Z0cmg4v2TC73YarNW7N+lTgwf86RHMUAEQEAAYkBNgQYAQgAIBYhBFYxvxNXMmoC
    7.26 +qkcO7rgV73+kUWquBQJaX7sJAhsMAAoJELgV73+kUWqughYIAIpK+sEeeRt5ZKCE
    7.27 +H7d02F4CXVOCRY/+hJXwVVBtE86j6xjUgUpC0tb45UmUfiBMfiIN/aU56tE+8tsl
    7.28 +419oWyUXhR/jX3hBHxxWQRrL7omqKM1pC/TYt2EH93g7el4Gmv1xUjSG/djdaF15
    7.29 +iLyNsBVMH7r5VtvAcOhhiEZQzAUXek0HT+oD+g1rt91CIG/IN9SBpd0c7JgIe5m+
    7.30 +W1rVYl4wD5JCLi371eRokrVr6pd4/tSF6KBoik9HOphNbGdx7O3P0SapmjXUGbq2
    7.31 +UmjsEF9ObP32NdCI6srekivexxn3FUUWEe/PK3uGh9vc8vHONWo268LdPnr7619N
    7.32 +E1SUzJU=
    7.33 +=Ns6S
    7.34 +-----END PGP PUBLIC KEY BLOCK-----