Browse Source

merging

generate_api
Volker Birk 4 years ago
parent
commit
c0107f0eff
7 changed files with 147 additions and 146 deletions
  1. +1
    -0
      src/keymanagement.c
  2. +0
    -19
      src/keymanagement.h
  3. +2
    -0
      src/message_api.c
  4. +0
    -1
      src/sync_api.h
  5. +1
    -2
      sync/cond_act_sync.yml2
  6. +124
    -124
      test/src/SuiteMaker.cc
  7. +19
    -0
      test/src/engine_tests/BlacklistTests.cc

+ 1
- 0
src/keymanagement.c View File

@ -1886,3 +1886,4 @@ PEP_STATUS pgp_import_ultimately_trusted_keypairs(PEP_SESSION session) {
return status;
}
#endif // USE_GPG

+ 0
- 19
src/keymanagement.h View File

@ -207,25 +207,6 @@ DYNAMIC_API PEP_STATUS key_mistrusted(
pEp_identity *ident
);
// undo_last_mistrust() - reset identity and trust status for the last
// identity in this session marked as mistrusted
// to their cached values from the time of mistrust
// parameters:
// session (in) session to use
//
// return value:
// PEP_STATUS_OK if identity and trust were successfully restored.
// Otherwise, error status from attempts to set.
//
// caveat:
// only works for this session, and only once. cache is invalidated
// upon use.
//
//  WILL NOT WORK ON MISTRUSTED OWN KEY
DYNAMIC_API PEP_STATUS undo_last_mistrust(PEP_SESSION session);
// trust_personal_key() - mark a key as trusted for a user
//
// parameters:


+ 2
- 0
src/message_api.c View File

@ -3775,6 +3775,8 @@ static void _max_comm_type_from_identity_list(
true);
if (status != PEP_STATUS_OK || il->ident->fpr == NULL) {
il->ident->comm_type = PEP_ct_key_not_found;
if (*max_comm_type > PEP_ct_no_encryption)
*max_comm_type = PEP_ct_no_encryption;
}
}
}


+ 0
- 1
src/sync_api.h View File

@ -49,7 +49,6 @@ typedef enum _sync_handshake_signal {
// ownership of self and partner go to the callee
typedef PEP_STATUS (*notifyHandshake_t)(
void *obj,
pEp_identity *me,
pEp_identity *partner,
sync_handshake_signal signal


+ 1
- 2
sync/cond_act_sync.yml2 View File

@ -136,8 +136,7 @@ function "show_handshake" {
return PEP_OUT_OF_MEMORY;
}
status = session->notifyHandshake(session->sync_management, me,
partner, «$type»);
status = session->notifyHandshake(me, partner, «$type»);
if (status)
return status;
||


+ 124
- 124
test/src/SuiteMaker.cc View File

@ -12,175 +12,175 @@
#include "SuiteMaker.h"
// Begin where we generate stuff
#include "DecorateTests.h"
#include "MimeTests.h"
#include "UserIdCollisionTests.h"
#include "ReencryptPlusExtraKeysTests.h"
#include "BlacklistTests.h"
#include "AppleMailTests.h"
#include "MessageTwoPointOhTests.h"
#include "IdentityListTests.h"
#include "I18nTests.h"
#include "Engine463Tests.h"
#include "DecryptAttachPrivateKeyUntrustedTests.h"
#include "BloblistTests.h"
#include "NewUpdateIdAndMyselfTests.h"
#include "I18nTests.h"
#include "IdentityListTests.h"
#include "PgpBinaryTests.h"
#include "MessageNullFromTests.h"
#include "LeastCommonDenomColorTests.h"
#include "StringlistTests.h"
#include "PgpListKeysTests.h"
#include "MessageApiTests.h"
#include "EncryptMissingPrivateKeyTests.h"
#include "CaseAndDotAddressTests.h"
#include "UserIDAliasTests.h"
#include "BCCTests.h"
#include "LeastColorGroupTests.h"
#include "BlacklistAcceptNewKeyTests.h"
#include "MessageApiTests.h"
#include "StringlistTests.h"
#include "StringpairListTests.h"
#include "TrustManipulationTests.h"
#include "SyncTests.h"
#include "EncryptAttachPrivateKeyTests.h"
#include "BloblistTests.h"
#include "KeyResetMessageTests.h"
#include "SequenceTests.h"
#include "TrustwordsTests.h"
#include "DecryptAttachPrivateKeyUntrustedTests.h"
#include "BlacklistTests.h"
#include "RevokeRegenAttachTests.h"
#include "EncryptMissingPrivateKeyTests.h"
#include "PepSubjectReceivedTests.h"
#include "SequenceTests.h"
#include "EncryptAttachPrivateKeyTests.h"
#include "ExternalRevokeTests.h"
#include "KeyeditTests.h"
#include "MapAsn1Tests.h"
#include "PgpBinaryTests.h"
#include "LeastColorGroupTests.h"
#include "DecryptAttachPrivateKeyTrustedTests.h"
#include "MessageNullFromTests.h"
#include "MimeTests.h"
#include "PgpListKeysTests.h"
#include "NewUpdateIdAndMyselfTests.h"
#include "EncryptForIdentityTests.h"
#include "TrustwordsTests.h"
#include "ReencryptPlusExtraKeysTests.h"
#include "MapAsn1Tests.h"
#include "DecorateTests.h"
#include "MessageTwoPointOhTests.h"
#include "CrashdumpTests.h"
#include "CaseAndDotAddressTests.h"
#include "LeastCommonDenomColorTests.h"
#include "ExternalRevokeTests.h"
#include "UserIDAliasTests.h"
#include "StringpairListTests.h"
#include "EncryptForIdentityTests.h"
#include "KeyResetMessageTests.h"
#include "TrustManipulationTests.h"
#include "SyncTests.h"
#include "AppleMailTests.h"
const char* SuiteMaker::all_suites[] = {
"DecorateTests",
"MimeTests",
"UserIdCollisionTests",
"ReencryptPlusExtraKeysTests",
"BlacklistTests",
"AppleMailTests",
"MessageTwoPointOhTests",
"IdentityListTests",
"I18nTests",
"Engine463Tests",
"DecryptAttachPrivateKeyUntrustedTests",
"BloblistTests",
"NewUpdateIdAndMyselfTests",
"I18nTests",
"IdentityListTests",
"PgpBinaryTests",
"MessageNullFromTests",
"LeastCommonDenomColorTests",
"StringlistTests",
"PgpListKeysTests",
"MessageApiTests",
"EncryptMissingPrivateKeyTests",
"CaseAndDotAddressTests",
"UserIDAliasTests",
"BCCTests",
"LeastColorGroupTests",
"BlacklistAcceptNewKeyTests",
"MessageApiTests",
"StringlistTests",
"StringpairListTests",
"TrustManipulationTests",
"SyncTests",
"EncryptAttachPrivateKeyTests",
"BloblistTests",
"KeyResetMessageTests",
"SequenceTests",
"TrustwordsTests",
"DecryptAttachPrivateKeyUntrustedTests",
"BlacklistTests",
"RevokeRegenAttachTests",
"EncryptMissingPrivateKeyTests",
"PepSubjectReceivedTests",
"SequenceTests",
"EncryptAttachPrivateKeyTests",
"ExternalRevokeTests",
"KeyeditTests",
"MapAsn1Tests",
"PgpBinaryTests",
"LeastColorGroupTests",
"DecryptAttachPrivateKeyTrustedTests",
"MessageNullFromTests",
"MimeTests",
"PgpListKeysTests",
"NewUpdateIdAndMyselfTests",
"EncryptForIdentityTests",
"TrustwordsTests",
"ReencryptPlusExtraKeysTests",
"MapAsn1Tests",
"DecorateTests",
"MessageTwoPointOhTests",
"CrashdumpTests",
"CaseAndDotAddressTests",
"LeastCommonDenomColorTests",
"ExternalRevokeTests",
"UserIDAliasTests",
"StringpairListTests",
"EncryptForIdentityTests",
"KeyResetMessageTests",
"TrustManipulationTests",
"SyncTests",
"AppleMailTests",
};
// This file is generated, so magic constants are ok.
int SuiteMaker::num_suites = 40;
void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
if (strcmp(test_class_name, "DecorateTests") == 0)
*test_suite = new DecorateTests(test_class_name, test_home);
if (strcmp(test_class_name, "MimeTests") == 0)
*test_suite = new MimeTests(test_class_name, test_home);
else if (strcmp(test_class_name, "UserIdCollisionTests") == 0)
*test_suite = new UserIdCollisionTests(test_class_name, test_home);
else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
*test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
else if (strcmp(test_class_name, "BlacklistTests") == 0)
*test_suite = new BlacklistTests(test_class_name, test_home);
else if (strcmp(test_class_name, "AppleMailTests") == 0)
*test_suite = new AppleMailTests(test_class_name, test_home);
else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
*test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
else if (strcmp(test_class_name, "IdentityListTests") == 0)
*test_suite = new IdentityListTests(test_class_name, test_home);
else if (strcmp(test_class_name, "I18nTests") == 0)
*test_suite = new I18nTests(test_class_name, test_home);
else if (strcmp(test_class_name, "Engine463Tests") == 0)
*test_suite = new Engine463Tests(test_class_name, test_home);
else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
*test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
else if (strcmp(test_class_name, "BloblistTests") == 0)
*test_suite = new BloblistTests(test_class_name, test_home);
else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
*test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
else if (strcmp(test_class_name, "I18nTests") == 0)
*test_suite = new I18nTests(test_class_name, test_home);
else if (strcmp(test_class_name, "IdentityListTests") == 0)
*test_suite = new IdentityListTests(test_class_name, test_home);
else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
*test_suite = new PgpBinaryTests(test_class_name, test_home);
else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
*test_suite = new MessageNullFromTests(test_class_name, test_home);
else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
*test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
else if (strcmp(test_class_name, "StringlistTests") == 0)
*test_suite = new StringlistTests(test_class_name, test_home);
else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
*test_suite = new PgpListKeysTests(test_class_name, test_home);
else if (strcmp(test_class_name, "MessageApiTests") == 0)
*test_suite = new MessageApiTests(test_class_name, test_home);
else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
*test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
*test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
*test_suite = new UserIDAliasTests(test_class_name, test_home);
else if (strcmp(test_class_name, "BCCTests") == 0)
*test_suite = new BCCTests(test_class_name, test_home);
else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
*test_suite = new LeastColorGroupTests(test_class_name, test_home);
else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
*test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
else if (strcmp(test_class_name, "MessageApiTests") == 0)
*test_suite = new MessageApiTests(test_class_name, test_home);
else if (strcmp(test_class_name, "StringlistTests") == 0)
*test_suite = new StringlistTests(test_class_name, test_home);
else if (strcmp(test_class_name, "StringpairListTests") == 0)
*test_suite = new StringpairListTests(test_class_name, test_home);
else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
*test_suite = new TrustManipulationTests(test_class_name, test_home);
else if (strcmp(test_class_name, "SyncTests") == 0)
*test_suite = new SyncTests(test_class_name, test_home);
else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
*test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
else if (strcmp(test_class_name, "BloblistTests") == 0)
*test_suite = new BloblistTests(test_class_name, test_home);
else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
*test_suite = new KeyResetMessageTests(test_class_name, test_home);
else if (strcmp(test_class_name, "SequenceTests") == 0)
*test_suite = new SequenceTests(test_class_name, test_home);
else if (strcmp(test_class_name, "TrustwordsTests") == 0)
*test_suite = new TrustwordsTests(test_class_name, test_home);
else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
*test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
else if (strcmp(test_class_name, "BlacklistTests") == 0)
*test_suite = new BlacklistTests(test_class_name, test_home);
else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
*test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
*test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
*test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
else if (strcmp(test_class_name, "SequenceTests") == 0)
*test_suite = new SequenceTests(test_class_name, test_home);
else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
*test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
*test_suite = new ExternalRevokeTests(test_class_name, test_home);
else if (strcmp(test_class_name, "KeyeditTests") == 0)
*test_suite = new KeyeditTests(test_class_name, test_home);
else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
*test_suite = new MapAsn1Tests(test_class_name, test_home);
else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
*test_suite = new PgpBinaryTests(test_class_name, test_home);
else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
*test_suite = new LeastColorGroupTests(test_class_name, test_home);
else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
*test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
*test_suite = new MessageNullFromTests(test_class_name, test_home);
else if (strcmp(test_class_name, "MimeTests") == 0)
*test_suite = new MimeTests(test_class_name, test_home);
else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
*test_suite = new PgpListKeysTests(test_class_name, test_home);
else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
*test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
*test_suite = new EncryptForIdentityTests(test_class_name, test_home);
else if (strcmp(test_class_name, "TrustwordsTests") == 0)
*test_suite = new TrustwordsTests(test_class_name, test_home);
else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
*test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
*test_suite = new MapAsn1Tests(test_class_name, test_home);
else if (strcmp(test_class_name, "DecorateTests") == 0)
*test_suite = new DecorateTests(test_class_name, test_home);
else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
*test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
else if (strcmp(test_class_name, "CrashdumpTests") == 0)
*test_suite = new CrashdumpTests(test_class_name, test_home);
else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
*test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
*test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
*test_suite = new ExternalRevokeTests(test_class_name, test_home);
else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
*test_suite = new UserIDAliasTests(test_class_name, test_home);
else if (strcmp(test_class_name, "StringpairListTests") == 0)
*test_suite = new StringpairListTests(test_class_name, test_home);
else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
*test_suite = new EncryptForIdentityTests(test_class_name, test_home);
else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
*test_suite = new KeyResetMessageTests(test_class_name, test_home);
else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
*test_suite = new TrustManipulationTests(test_class_name, test_home);
else if (strcmp(test_class_name, "SyncTests") == 0)
*test_suite = new SyncTests(test_class_name, test_home);
else if (strcmp(test_class_name, "AppleMailTests") == 0)
*test_suite = new AppleMailTests(test_class_name, test_home);
}
void SuiteMaker::suitemaker_buildlist(const char** test_class_names, int num_to_run, const char* test_home, std::vector<Test::Suite*>& test_suites) {


+ 19
- 0
test/src/engine_tests/BlacklistTests.cc View File

@ -143,6 +143,25 @@ void BlacklistTests::check_blacklist() {
<< "Expected it to be empty or (possibly) " << bl_fpr_2 << endl;
TEST_ASSERT_MSG((!(blacklisted_identity->fpr) || blacklisted_identity->fpr[0] == '\0'|| (strcmp(blacklisted_identity->fpr, bl_fpr_2) == 0)), "!(blacklisted_identity->fpr) || blacklisted_identity->fpr[0] == '\0'|| (strcmp(blacklisted_identity->fpr, bl_fpr_2) == 0)");
pEp_identity *me = new_identity("alice@peptest.ch", NULL, "423", "Alice Miller");
assert(me);
PEP_STATUS status24 = myself(session, me);
TEST_ASSERT_MSG((status24 == PEP_STATUS_OK), "myself: status24 == PEP_STATUS_OK");
message *msg23 = new_message(PEP_dir_outgoing);
assert(msg23);
msg23->from = me;
msg23->to = new_identity_list(identity_dup(blacklisted_identity));
assert(msg23->to && msg23->to->ident);
PEP_rating rating23;
cout << "testing outgoing_message_rating() with blacklisted key in to\n";
PEP_STATUS status23 = outgoing_message_rating(session, msg23, &rating23);
TEST_ASSERT_MSG((status23 == PEP_STATUS_OK), "outgoing_message_rating: status must be PEP_STATUS_OK");
TEST_ASSERT_MSG((rating23 == PEP_rating_unencrypted), "outgoing_message_rating: rating must be PEP_rating_unencrypted");
free_message(msg23);
const string keytext2 = slurp("blacklisted_pub2.asc");
PEP_STATUS status14 = import_key(session, keytext2.c_str(), keytext2.length(), NULL);


Loading…
Cancel
Save