merging
authorVolker Birk <vb@pep-project.org>
Thu, 28 Apr 2016 08:52:06 +0200
changeset 555a46143ed6c45
parent 554 28e92b31326d
parent 552 bbcf0fdf0648
child 556 90576c91102b
merging
     1.1 --- a/db/en.csv	Tue Apr 26 10:58:43 2016 +0200
     1.2 +++ b/db/en.csv	Thu Apr 28 08:52:06 2016 +0200
     1.3 @@ -1891,7 +1891,7 @@
     1.4  en,1890,ANESTHETIC,0
     1.5  en,1891,ANESTHETIST,0
     1.6  en,1892,ANESTHETIZE,0
     1.7 -en,1893,STAPLE,0
     1.8 +en,1893,ANESTHETIZER,0
     1.9  en,1894,ANET,0
    1.10  en,1895,ANET,0
    1.11  en,1896,ANETT,0
    1.12 @@ -7845,7 +7845,7 @@
    1.13  en,7844,CASSANDRE,0
    1.14  en,7845,CASSANDRY,0
    1.15  en,7846,CASSATT,0
    1.16 -en,7847,HORSE,0
    1.17 +en,7847,CASSAUNDRA,0
    1.18  en,7848,CASSAVA,0
    1.19  en,7849,CASSEROLE,0
    1.20  en,7850,CASSETTE,0
    1.21 @@ -11681,7 +11681,7 @@
    1.22  en,11680,CUCKOO,0
    1.23  en,11681,CUCUMBER,0
    1.24  en,11682,CUDDLE,0
    1.25 -en,11683,BATTERY,0
    1.26 +en,11683,CUDDLY,0
    1.27  en,11684,CUDGEL,0
    1.28  en,11685,CUE,0
    1.29  en,11686,CUFF,0
    1.30 @@ -16555,7 +16555,7 @@
    1.31  en,16554,EVERYPLACE,0
    1.32  en,16555,EVERYTHING,0
    1.33  en,16556,EVERYWHERE,0
    1.34 -en,16557,CORRECT,0
    1.35 +en,16557,EVICT,0
    1.36  en,16558,EVICTION,0
    1.37  en,16559,EVIDENCE,0
    1.38  en,16560,EVIDENT,0
    1.39 @@ -22884,7 +22884,7 @@
    1.40  en,22883,HORRIFYING,0
    1.41  en,22884,HORROR,0
    1.42  en,22885,HORS,0
    1.43 -en,22886,CASSAUNDRA,0
    1.44 +en,22886,HORSE,0
    1.45  en,22887,HORSEBACK,0
    1.46  en,22888,HORSEDOM,0
    1.47  en,22889,HORSEFLESH,0
    1.48 @@ -31918,7 +31918,7 @@
    1.49  en,31917,NAMER,0
    1.50  en,31918,NAMESAKE,0
    1.51  en,31919,NAMIBIA,0
    1.52 -en,31920,XKCD,0
    1.53 +en,31920,NAMIBIAN,0
    1.54  en,31921,NAMING,0
    1.55  en,31922,NAN,0
    1.56  en,31923,NANA,0
    1.57 @@ -44371,7 +44371,7 @@
    1.58  en,44370,STANZA,0
    1.59  en,44371,STAPH,0
    1.60  en,44372,STAPHS,0
    1.61 -en,44373,ANESTHETIZER,0
    1.62 +en,44373,STAPLE,0
    1.63  en,44374,STAPLED,0
    1.64  en,44375,STAPLER,0
    1.65  en,44376,STAPLETON,0
    1.66 @@ -54021,7 +54021,7 @@
    1.67  en,54020,ANESTHETIC,0
    1.68  en,54021,ANESTHETIST,0
    1.69  en,54022,ANESTHETIZE,0
    1.70 -en,54023,STAPLE,0
    1.71 +en,54023,ANESTHETIZER,0
    1.72  en,54024,ANET,0
    1.73  en,54025,ANET,0
    1.74  en,54026,ANETT,0
    1.75 @@ -56428,7 +56428,7 @@
    1.76  en,56427,BATTED,0
    1.77  en,56428,BATTEN,0
    1.78  en,56429,BATTER,0
    1.79 -en,56430,CUDDLY,0
    1.80 +en,56430,BATTERY,0
    1.81  en,56431,BATTING,0
    1.82  en,56432,BATTLE,0
    1.83  en,56433,BATTLEDORE,0
    1.84 @@ -63034,7 +63034,7 @@
    1.85  en,63033,CORRAL,0
    1.86  en,63034,CORRALLED,0
    1.87  en,63035,CORRALLING,0
    1.88 -en,63036,EVICT,0
    1.89 +en,63036,CORRECT,0
    1.90  en,63037,CORRECTABLE,0
    1.91  en,63038,CORRECTED,0
    1.92  en,63039,CORRECTION,0
    1.93 @@ -63811,7 +63811,7 @@
    1.94  en,63810,CUCKOO,0
    1.95  en,63811,CUCUMBER,0
    1.96  en,63812,CUDDLE,0
    1.97 -en,63813,BATTERY,0
    1.98 +en,63813,CUDDLY,0
    1.99  en,63814,CUDGEL,0
   1.100  en,63815,CUE,0
   1.101  en,63816,CUFF,0
     2.1 --- a/pEpEngine.vcxproj	Tue Apr 26 10:58:43 2016 +0200
     2.2 +++ b/pEpEngine.vcxproj	Thu Apr 28 08:52:06 2016 +0200
     2.3 @@ -104,6 +104,7 @@
     2.4      <ClCompile Include="src\trans_auto.c" />
     2.5    </ItemGroup>
     2.6    <ItemGroup>
     2.7 +    <ClInclude Include="src\blacklist.h" />
     2.8      <ClInclude Include="src\bloblist.h" />
     2.9      <ClInclude Include="src\cryptotech.h" />
    2.10      <ClInclude Include="src\dynamic_api.h" />
     3.1 --- a/pEpEngine.vcxproj.filters	Tue Apr 26 10:58:43 2016 +0200
     3.2 +++ b/pEpEngine.vcxproj.filters	Thu Apr 28 08:52:06 2016 +0200
     3.3 @@ -146,6 +146,9 @@
     3.4      <ClInclude Include="src\platform.h">
     3.5        <Filter>Headerdateien</Filter>
     3.6      </ClInclude>
     3.7 +    <ClInclude Include="src\blacklist.h">
     3.8 +      <Filter>Headerdateien</Filter>
     3.9 +    </ClInclude>
    3.10    </ItemGroup>
    3.11    <ItemGroup>
    3.12      <Text Include="LICENSE.txt" />
     5.1 --- a/src/keymanagement.c	Tue Apr 26 10:58:43 2016 +0200
     5.2 +++ b/src/keymanagement.c	Thu Apr 28 08:52:06 2016 +0200
     5.3 @@ -26,18 +26,32 @@
     5.4      size_t ai = 0;
     5.5      size_t bi = 0;
     5.6      
     5.7 -    do {
     5.8 -        if(fpra[ai] == 0 || fprb[bi] == 0) {
     5.9 +    do
    5.10 +    {
    5.11 +        if(fpra[ai] == 0 || fprb[bi] == 0)
    5.12 +        {
    5.13              return 0;
    5.14 -        } else if(fpra[ai] == ' ') {
    5.15 +        }
    5.16 +        else if(fpra[ai] == ' ')
    5.17 +        {
    5.18              ai++;
    5.19 -        } else if(fprb[bi] == ' ') {
    5.20 +        }
    5.21 +        else if(fprb[bi] == ' ')
    5.22 +        {
    5.23              bi++;
    5.24 -        } else if(toupper(fpra[ai]) == toupper(fprb[bi])) {
    5.25 +        }
    5.26 +        else if(toupper(fpra[ai]) == toupper(fprb[bi]))
    5.27 +        {
    5.28              ai++;
    5.29              bi++;
    5.30          }
    5.31 -    }while(ai < fpras && bi < fprbs);
    5.32 +        else
    5.33 +        {
    5.34 +            return 0;
    5.35 +        }
    5.36 +        
    5.37 +    }
    5.38 +    while(ai < fpras && bi < fprbs);
    5.39      
    5.40      return ai == fpras && bi == fprbs;
    5.41  }
     6.1 --- a/src/message_api.c	Tue Apr 26 10:58:43 2016 +0200
     6.2 +++ b/src/message_api.c	Thu Apr 28 08:52:06 2016 +0200
     6.3 @@ -877,9 +877,6 @@
     6.4      assert(session);
     6.5      assert(msg);
     6.6  
     6.7 -    if (msg->dir == PEP_dir_incoming)
     6.8 -        return;
     6.9 -
    6.10      assert(msg->from && msg->from->fpr);
    6.11      if (msg->from == NULL || msg->from->fpr == NULL)
    6.12          return;
    6.13 @@ -932,11 +929,13 @@
    6.14      assert(session);
    6.15      assert(src);
    6.16      assert(dst);
    6.17 -    assert(enc_format != PEP_enc_none);
    6.18  
    6.19 -    if (!(session && src && dst && enc_format != PEP_enc_none))
    6.20 +    if (!(session && src && dst))
    6.21          return PEP_ILLEGAL_VALUE;
    6.22  
    6.23 +    if (src->dir == PEP_dir_incoming)
    6.24 +        return PEP_ILLEGAL_VALUE;
    6.25 +    
    6.26      determine_encryption_format(src);
    6.27      if (src->enc_format != PEP_enc_none)
    6.28          return PEP_ILLEGAL_VALUE;
    6.29 @@ -946,7 +945,13 @@
    6.30      status = myself(session, src->from);
    6.31      if (status != PEP_STATUS_OK)
    6.32          goto pep_error;
    6.33 -
    6.34 +    
    6.35 +    if (enc_format == PEP_enc_none)
    6.36 +    {
    6.37 +        attach_own_key(session, src);
    6.38 +        return PEP_UNENCRYPTED;
    6.39 +    }
    6.40 +    
    6.41      keys = new_stringlist(src->from->fpr);
    6.42      if (keys == NULL)
    6.43          goto enomem;
    6.44 @@ -963,13 +968,25 @@
    6.45      PEP_comm_type max_comm_type = PEP_ct_pEp;
    6.46  
    6.47      identity_list * _il;
    6.48 -    for (_il = src->to; _il && _il->ident; _il = _il->next) {
    6.49 +    
    6.50 +    if ((_il = src->bcc) && _il->ident)
    6.51 +    {
    6.52 +        // BCC limited support:
    6.53 +        //     - App splits mails with BCC in multiple mails.
    6.54 +        //     - Each email is encrypted separately
    6.55 +        
    6.56 +        if(_il->next || src->to || src->cc)
    6.57 +        {
    6.58 +            // Only one Bcc with no other recipient allowed for now
    6.59 +            return PEP_ILLEGAL_VALUE;
    6.60 +        }
    6.61 +        
    6.62          PEP_STATUS _status = update_identity(session, _il->ident);
    6.63          if (_status != PEP_STATUS_OK) {
    6.64              status = _status;
    6.65              goto pep_error;
    6.66          }
    6.67 -
    6.68 +        
    6.69          if (_il->ident->fpr && _il->ident->fpr[0]) {
    6.70              _k = stringlist_add(_k, _il->ident->fpr);
    6.71              if (_k == NULL)
    6.72 @@ -980,27 +997,49 @@
    6.73          else {
    6.74              dest_keys_found = false;
    6.75              status = PEP_KEY_NOT_FOUND;
    6.76 -        }
    6.77 +        }        
    6.78      }
    6.79 +    else
    6.80 +    {
    6.81 +        for (_il = src->to; _il && _il->ident; _il = _il->next) {
    6.82 +            PEP_STATUS _status = update_identity(session, _il->ident);
    6.83 +            if (_status != PEP_STATUS_OK) {
    6.84 +                status = _status;
    6.85 +                goto pep_error;
    6.86 +            }
    6.87  
    6.88 -    for (_il = src->cc; _il && _il->ident; _il = _il->next) {
    6.89 -        PEP_STATUS _status = update_identity(session, _il->ident);
    6.90 -        if (_status != PEP_STATUS_OK)
    6.91 -        {
    6.92 -            status = _status;
    6.93 -            goto pep_error;
    6.94 +            if (_il->ident->fpr && _il->ident->fpr[0]) {
    6.95 +                _k = stringlist_add(_k, _il->ident->fpr);
    6.96 +                if (_k == NULL)
    6.97 +                    goto enomem;
    6.98 +                max_comm_type = _get_comm_type(session, max_comm_type,
    6.99 +                                               _il->ident);
   6.100 +            }
   6.101 +            else {
   6.102 +                dest_keys_found = false;
   6.103 +                status = PEP_KEY_NOT_FOUND;
   6.104 +            }
   6.105          }
   6.106  
   6.107 -        if (_il->ident->fpr && _il->ident->fpr[0]) {
   6.108 -            _k = stringlist_add(_k, _il->ident->fpr);
   6.109 -            if (_k == NULL)
   6.110 -                goto enomem;
   6.111 -            max_comm_type = _get_comm_type(session, max_comm_type,
   6.112 -                                           _il->ident);
   6.113 -        }
   6.114 -        else {
   6.115 -            dest_keys_found = false;
   6.116 -            status = PEP_KEY_NOT_FOUND;
   6.117 +        for (_il = src->cc; _il && _il->ident; _il = _il->next) {
   6.118 +            PEP_STATUS _status = update_identity(session, _il->ident);
   6.119 +            if (_status != PEP_STATUS_OK)
   6.120 +            {
   6.121 +                status = _status;
   6.122 +                goto pep_error;
   6.123 +            }
   6.124 +
   6.125 +            if (_il->ident->fpr && _il->ident->fpr[0]) {
   6.126 +                _k = stringlist_add(_k, _il->ident->fpr);
   6.127 +                if (_k == NULL)
   6.128 +                    goto enomem;
   6.129 +                max_comm_type = _get_comm_type(session, max_comm_type,
   6.130 +                                               _il->ident);
   6.131 +            }
   6.132 +            else {
   6.133 +                dest_keys_found = false;
   6.134 +                status = PEP_KEY_NOT_FOUND;
   6.135 +            }
   6.136          }
   6.137      }
   6.138      
   6.139 @@ -1372,8 +1411,10 @@
   6.140      if (status != PEP_STATUS_OK)
   6.141          return status;
   6.142  
   6.143 -    for (il = msg->to; il != NULL; il = il->next) {
   6.144 -        if (il->ident) {
   6.145 +    for (il = msg->to; il != NULL; il = il->next)
   6.146 +    {
   6.147 +        if (il->ident)
   6.148 +        {
   6.149              update_identity(session, il->ident);
   6.150              max_comm_type = _get_comm_type(session, max_comm_type,
   6.151                      il->ident);
   6.152 @@ -1381,14 +1422,27 @@
   6.153          }
   6.154      }
   6.155  
   6.156 -    for (il = msg->cc; il != NULL; il = il->next) {
   6.157 -        if (il->ident) {
   6.158 +    for (il = msg->cc; il != NULL; il = il->next)
   6.159 +    {
   6.160 +        if (il->ident)
   6.161 +        {
   6.162              update_identity(session, il->ident);
   6.163              max_comm_type = _get_comm_type(session, max_comm_type,
   6.164                      il->ident);
   6.165              comm_type_determined = true;
   6.166          }
   6.167      }
   6.168 +        
   6.169 +    for (il = msg->bcc; il != NULL; il = il->next)
   6.170 +    {
   6.171 +        if (il->ident)
   6.172 +        {
   6.173 +            update_identity(session, il->ident);
   6.174 +            max_comm_type = _get_comm_type(session, max_comm_type,
   6.175 +                                           il->ident);
   6.176 +            comm_type_determined = true;
   6.177 +        }
   6.178 +    }
   6.179  
   6.180      if (comm_type_determined == false)
   6.181          *color = PEP_rating_undefined;