outgoing_message_color() will deliver PEP_ct_no_encryption if a required key is blacklisted for a PGP comm partner sync
authorVolker Birk <vb@pep.foundation>
Thu, 11 Oct 2018 13:16:24 +0200
branchsync
changeset 304175f2a8fb579e
parent 3027 4c44c1ed06ba
child 3042 cb5f579ccc32
outgoing_message_color() will deliver PEP_ct_no_encryption if a required key is blacklisted for a PGP comm partner
src/message_api.c
test/src/SuiteMaker.cc
     1.1 --- a/src/message_api.c	Fri Oct 05 22:51:41 2018 +0200
     1.2 +++ b/src/message_api.c	Thu Oct 11 13:16:24 2018 +0200
     1.3 @@ -3775,6 +3775,8 @@
     1.4                                                true);
     1.5                      if (status != PEP_STATUS_OK || il->ident->fpr == NULL) {
     1.6                          il->ident->comm_type = PEP_ct_key_not_found;
     1.7 +                        if (*max_comm_type > PEP_ct_no_encryption)
     1.8 +                            *max_comm_type = PEP_ct_no_encryption;
     1.9                      }
    1.10                  }    
    1.11              }
     2.1 --- a/test/src/SuiteMaker.cc	Fri Oct 05 22:51:41 2018 +0200
     2.2 +++ b/test/src/SuiteMaker.cc	Thu Oct 11 13:16:24 2018 +0200
     2.3 @@ -12,175 +12,175 @@
     2.4  #include "SuiteMaker.h"
     2.5  
     2.6  // Begin where we generate stuff
     2.7 -#include "DecorateTests.h"
     2.8 +#include "MimeTests.h"
     2.9  #include "UserIdCollisionTests.h"
    2.10 -#include "ReencryptPlusExtraKeysTests.h"
    2.11 -#include "BlacklistTests.h"
    2.12 -#include "AppleMailTests.h"
    2.13 -#include "MessageTwoPointOhTests.h"
    2.14 -#include "IdentityListTests.h"
    2.15 +#include "Engine463Tests.h"
    2.16 +#include "BloblistTests.h"
    2.17 +#include "NewUpdateIdAndMyselfTests.h"
    2.18  #include "I18nTests.h"
    2.19 -#include "Engine463Tests.h"
    2.20 +#include "IdentityListTests.h"
    2.21 +#include "PgpBinaryTests.h"
    2.22 +#include "MessageNullFromTests.h"
    2.23 +#include "LeastCommonDenomColorTests.h"
    2.24 +#include "StringlistTests.h"
    2.25 +#include "PgpListKeysTests.h"
    2.26 +#include "MessageApiTests.h"
    2.27 +#include "EncryptMissingPrivateKeyTests.h"
    2.28 +#include "CaseAndDotAddressTests.h"
    2.29 +#include "UserIDAliasTests.h"
    2.30 +#include "BCCTests.h"
    2.31 +#include "BlacklistAcceptNewKeyTests.h"
    2.32  #include "DecryptAttachPrivateKeyUntrustedTests.h"
    2.33 -#include "BCCTests.h"
    2.34 +#include "BlacklistTests.h"
    2.35 +#include "RevokeRegenAttachTests.h"
    2.36 +#include "PepSubjectReceivedTests.h"
    2.37 +#include "SequenceTests.h"
    2.38 +#include "EncryptAttachPrivateKeyTests.h"
    2.39 +#include "ExternalRevokeTests.h"
    2.40 +#include "KeyeditTests.h"
    2.41  #include "LeastColorGroupTests.h"
    2.42 -#include "BlacklistAcceptNewKeyTests.h"
    2.43 -#include "MessageApiTests.h"
    2.44 -#include "StringlistTests.h"
    2.45 +#include "DecryptAttachPrivateKeyTrustedTests.h"
    2.46 +#include "TrustwordsTests.h"
    2.47 +#include "ReencryptPlusExtraKeysTests.h"
    2.48 +#include "MapAsn1Tests.h"
    2.49 +#include "DecorateTests.h"
    2.50 +#include "MessageTwoPointOhTests.h"
    2.51 +#include "CrashdumpTests.h"
    2.52  #include "StringpairListTests.h"
    2.53 +#include "EncryptForIdentityTests.h"
    2.54 +#include "KeyResetMessageTests.h"
    2.55  #include "TrustManipulationTests.h"
    2.56  #include "SyncTests.h"
    2.57 -#include "EncryptAttachPrivateKeyTests.h"
    2.58 -#include "BloblistTests.h"
    2.59 -#include "KeyResetMessageTests.h"
    2.60 -#include "SequenceTests.h"
    2.61 -#include "TrustwordsTests.h"
    2.62 -#include "RevokeRegenAttachTests.h"
    2.63 -#include "EncryptMissingPrivateKeyTests.h"
    2.64 -#include "PepSubjectReceivedTests.h"
    2.65 -#include "KeyeditTests.h"
    2.66 -#include "MapAsn1Tests.h"
    2.67 -#include "PgpBinaryTests.h"
    2.68 -#include "DecryptAttachPrivateKeyTrustedTests.h"
    2.69 -#include "MessageNullFromTests.h"
    2.70 -#include "MimeTests.h"
    2.71 -#include "PgpListKeysTests.h"
    2.72 -#include "NewUpdateIdAndMyselfTests.h"
    2.73 -#include "EncryptForIdentityTests.h"
    2.74 -#include "CrashdumpTests.h"
    2.75 -#include "CaseAndDotAddressTests.h"
    2.76 -#include "LeastCommonDenomColorTests.h"
    2.77 -#include "ExternalRevokeTests.h"
    2.78 -#include "UserIDAliasTests.h"
    2.79 +#include "AppleMailTests.h"
    2.80  
    2.81  
    2.82  const char* SuiteMaker::all_suites[] = {
    2.83 -    "DecorateTests",
    2.84 +    "MimeTests",
    2.85      "UserIdCollisionTests",
    2.86 -    "ReencryptPlusExtraKeysTests",
    2.87 -    "BlacklistTests",
    2.88 -    "AppleMailTests",
    2.89 -    "MessageTwoPointOhTests",
    2.90 -    "IdentityListTests",
    2.91 +    "Engine463Tests",
    2.92 +    "BloblistTests",
    2.93 +    "NewUpdateIdAndMyselfTests",
    2.94      "I18nTests",
    2.95 -    "Engine463Tests",
    2.96 +    "IdentityListTests",
    2.97 +    "PgpBinaryTests",
    2.98 +    "MessageNullFromTests",
    2.99 +    "LeastCommonDenomColorTests",
   2.100 +    "StringlistTests",
   2.101 +    "PgpListKeysTests",
   2.102 +    "MessageApiTests",
   2.103 +    "EncryptMissingPrivateKeyTests",
   2.104 +    "CaseAndDotAddressTests",
   2.105 +    "UserIDAliasTests",
   2.106 +    "BCCTests",
   2.107 +    "BlacklistAcceptNewKeyTests",
   2.108      "DecryptAttachPrivateKeyUntrustedTests",
   2.109 -    "BCCTests",
   2.110 +    "BlacklistTests",
   2.111 +    "RevokeRegenAttachTests",
   2.112 +    "PepSubjectReceivedTests",
   2.113 +    "SequenceTests",
   2.114 +    "EncryptAttachPrivateKeyTests",
   2.115 +    "ExternalRevokeTests",
   2.116 +    "KeyeditTests",
   2.117      "LeastColorGroupTests",
   2.118 -    "BlacklistAcceptNewKeyTests",
   2.119 -    "MessageApiTests",
   2.120 -    "StringlistTests",
   2.121 +    "DecryptAttachPrivateKeyTrustedTests",
   2.122 +    "TrustwordsTests",
   2.123 +    "ReencryptPlusExtraKeysTests",
   2.124 +    "MapAsn1Tests",
   2.125 +    "DecorateTests",
   2.126 +    "MessageTwoPointOhTests",
   2.127 +    "CrashdumpTests",
   2.128      "StringpairListTests",
   2.129 +    "EncryptForIdentityTests",
   2.130 +    "KeyResetMessageTests",
   2.131      "TrustManipulationTests",
   2.132      "SyncTests",
   2.133 -    "EncryptAttachPrivateKeyTests",
   2.134 -    "BloblistTests",
   2.135 -    "KeyResetMessageTests",
   2.136 -    "SequenceTests",
   2.137 -    "TrustwordsTests",
   2.138 -    "RevokeRegenAttachTests",
   2.139 -    "EncryptMissingPrivateKeyTests",
   2.140 -    "PepSubjectReceivedTests",
   2.141 -    "KeyeditTests",
   2.142 -    "MapAsn1Tests",
   2.143 -    "PgpBinaryTests",
   2.144 -    "DecryptAttachPrivateKeyTrustedTests",
   2.145 -    "MessageNullFromTests",
   2.146 -    "MimeTests",
   2.147 -    "PgpListKeysTests",
   2.148 -    "NewUpdateIdAndMyselfTests",
   2.149 -    "EncryptForIdentityTests",
   2.150 -    "CrashdumpTests",
   2.151 -    "CaseAndDotAddressTests",
   2.152 -    "LeastCommonDenomColorTests",
   2.153 -    "ExternalRevokeTests",
   2.154 -    "UserIDAliasTests",
   2.155 +    "AppleMailTests",
   2.156  };
   2.157  
   2.158  // This file is generated, so magic constants are ok.
   2.159  int SuiteMaker::num_suites = 40;
   2.160  
   2.161  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
   2.162 -    if (strcmp(test_class_name, "DecorateTests") == 0)
   2.163 -        *test_suite = new DecorateTests(test_class_name, test_home);
   2.164 +    if (strcmp(test_class_name, "MimeTests") == 0)
   2.165 +        *test_suite = new MimeTests(test_class_name, test_home);
   2.166      else if (strcmp(test_class_name, "UserIdCollisionTests") == 0)
   2.167          *test_suite = new UserIdCollisionTests(test_class_name, test_home);
   2.168 -    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
   2.169 -        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
   2.170 -    else if (strcmp(test_class_name, "BlacklistTests") == 0)
   2.171 -        *test_suite = new BlacklistTests(test_class_name, test_home);
   2.172 -    else if (strcmp(test_class_name, "AppleMailTests") == 0)
   2.173 -        *test_suite = new AppleMailTests(test_class_name, test_home);
   2.174 -    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
   2.175 -        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
   2.176 -    else if (strcmp(test_class_name, "IdentityListTests") == 0)
   2.177 -        *test_suite = new IdentityListTests(test_class_name, test_home);
   2.178 +    else if (strcmp(test_class_name, "Engine463Tests") == 0)
   2.179 +        *test_suite = new Engine463Tests(test_class_name, test_home);
   2.180 +    else if (strcmp(test_class_name, "BloblistTests") == 0)
   2.181 +        *test_suite = new BloblistTests(test_class_name, test_home);
   2.182 +    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
   2.183 +        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
   2.184      else if (strcmp(test_class_name, "I18nTests") == 0)
   2.185          *test_suite = new I18nTests(test_class_name, test_home);
   2.186 -    else if (strcmp(test_class_name, "Engine463Tests") == 0)
   2.187 -        *test_suite = new Engine463Tests(test_class_name, test_home);
   2.188 +    else if (strcmp(test_class_name, "IdentityListTests") == 0)
   2.189 +        *test_suite = new IdentityListTests(test_class_name, test_home);
   2.190 +    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
   2.191 +        *test_suite = new PgpBinaryTests(test_class_name, test_home);
   2.192 +    else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
   2.193 +        *test_suite = new MessageNullFromTests(test_class_name, test_home);
   2.194 +    else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
   2.195 +        *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
   2.196 +    else if (strcmp(test_class_name, "StringlistTests") == 0)
   2.197 +        *test_suite = new StringlistTests(test_class_name, test_home);
   2.198 +    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
   2.199 +        *test_suite = new PgpListKeysTests(test_class_name, test_home);
   2.200 +    else if (strcmp(test_class_name, "MessageApiTests") == 0)
   2.201 +        *test_suite = new MessageApiTests(test_class_name, test_home);
   2.202 +    else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
   2.203 +        *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
   2.204 +    else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
   2.205 +        *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
   2.206 +    else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
   2.207 +        *test_suite = new UserIDAliasTests(test_class_name, test_home);
   2.208 +    else if (strcmp(test_class_name, "BCCTests") == 0)
   2.209 +        *test_suite = new BCCTests(test_class_name, test_home);
   2.210 +    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
   2.211 +        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
   2.212      else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
   2.213          *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
   2.214 -    else if (strcmp(test_class_name, "BCCTests") == 0)
   2.215 -        *test_suite = new BCCTests(test_class_name, test_home);
   2.216 +    else if (strcmp(test_class_name, "BlacklistTests") == 0)
   2.217 +        *test_suite = new BlacklistTests(test_class_name, test_home);
   2.218 +    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
   2.219 +        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
   2.220 +    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
   2.221 +        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
   2.222 +    else if (strcmp(test_class_name, "SequenceTests") == 0)
   2.223 +        *test_suite = new SequenceTests(test_class_name, test_home);
   2.224 +    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
   2.225 +        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
   2.226 +    else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
   2.227 +        *test_suite = new ExternalRevokeTests(test_class_name, test_home);
   2.228 +    else if (strcmp(test_class_name, "KeyeditTests") == 0)
   2.229 +        *test_suite = new KeyeditTests(test_class_name, test_home);
   2.230      else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
   2.231          *test_suite = new LeastColorGroupTests(test_class_name, test_home);
   2.232 -    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
   2.233 -        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
   2.234 -    else if (strcmp(test_class_name, "MessageApiTests") == 0)
   2.235 -        *test_suite = new MessageApiTests(test_class_name, test_home);
   2.236 -    else if (strcmp(test_class_name, "StringlistTests") == 0)
   2.237 -        *test_suite = new StringlistTests(test_class_name, test_home);
   2.238 +    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
   2.239 +        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
   2.240 +    else if (strcmp(test_class_name, "TrustwordsTests") == 0)
   2.241 +        *test_suite = new TrustwordsTests(test_class_name, test_home);
   2.242 +    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
   2.243 +        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
   2.244 +    else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
   2.245 +        *test_suite = new MapAsn1Tests(test_class_name, test_home);
   2.246 +    else if (strcmp(test_class_name, "DecorateTests") == 0)
   2.247 +        *test_suite = new DecorateTests(test_class_name, test_home);
   2.248 +    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
   2.249 +        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
   2.250 +    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
   2.251 +        *test_suite = new CrashdumpTests(test_class_name, test_home);
   2.252      else if (strcmp(test_class_name, "StringpairListTests") == 0)
   2.253          *test_suite = new StringpairListTests(test_class_name, test_home);
   2.254 +    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
   2.255 +        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
   2.256 +    else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
   2.257 +        *test_suite = new KeyResetMessageTests(test_class_name, test_home);
   2.258      else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
   2.259          *test_suite = new TrustManipulationTests(test_class_name, test_home);
   2.260      else if (strcmp(test_class_name, "SyncTests") == 0)
   2.261          *test_suite = new SyncTests(test_class_name, test_home);
   2.262 -    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
   2.263 -        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
   2.264 -    else if (strcmp(test_class_name, "BloblistTests") == 0)
   2.265 -        *test_suite = new BloblistTests(test_class_name, test_home);
   2.266 -    else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
   2.267 -        *test_suite = new KeyResetMessageTests(test_class_name, test_home);
   2.268 -    else if (strcmp(test_class_name, "SequenceTests") == 0)
   2.269 -        *test_suite = new SequenceTests(test_class_name, test_home);
   2.270 -    else if (strcmp(test_class_name, "TrustwordsTests") == 0)
   2.271 -        *test_suite = new TrustwordsTests(test_class_name, test_home);
   2.272 -    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
   2.273 -        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
   2.274 -    else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
   2.275 -        *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
   2.276 -    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
   2.277 -        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
   2.278 -    else if (strcmp(test_class_name, "KeyeditTests") == 0)
   2.279 -        *test_suite = new KeyeditTests(test_class_name, test_home);
   2.280 -    else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
   2.281 -        *test_suite = new MapAsn1Tests(test_class_name, test_home);
   2.282 -    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
   2.283 -        *test_suite = new PgpBinaryTests(test_class_name, test_home);
   2.284 -    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
   2.285 -        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
   2.286 -    else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
   2.287 -        *test_suite = new MessageNullFromTests(test_class_name, test_home);
   2.288 -    else if (strcmp(test_class_name, "MimeTests") == 0)
   2.289 -        *test_suite = new MimeTests(test_class_name, test_home);
   2.290 -    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
   2.291 -        *test_suite = new PgpListKeysTests(test_class_name, test_home);
   2.292 -    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
   2.293 -        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
   2.294 -    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
   2.295 -        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
   2.296 -    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
   2.297 -        *test_suite = new CrashdumpTests(test_class_name, test_home);
   2.298 -    else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
   2.299 -        *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
   2.300 -    else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
   2.301 -        *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
   2.302 -    else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
   2.303 -        *test_suite = new ExternalRevokeTests(test_class_name, test_home);
   2.304 -    else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
   2.305 -        *test_suite = new UserIDAliasTests(test_class_name, test_home);
   2.306 +    else if (strcmp(test_class_name, "AppleMailTests") == 0)
   2.307 +        *test_suite = new AppleMailTests(test_class_name, test_home);
   2.308  }
   2.309  
   2.310  void SuiteMaker::suitemaker_buildlist(const char** test_class_names, int num_to_run, const char* test_home, std::vector<Test::Suite*>& test_suites) {