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" />
     4.1 --- a/src/keymanagement.c	Tue Apr 26 10:58:43 2016 +0200
     4.2 +++ b/src/keymanagement.c	Thu Apr 28 08:52:06 2016 +0200
     4.3 @@ -26,18 +26,32 @@
     4.4      size_t ai = 0;
     4.5      size_t bi = 0;
     4.6      
     4.7 -    do {
     4.8 -        if(fpra[ai] == 0 || fprb[bi] == 0) {
     4.9 +    do
    4.10 +    {
    4.11 +        if(fpra[ai] == 0 || fprb[bi] == 0)
    4.12 +        {
    4.13              return 0;
    4.14 -        } else if(fpra[ai] == ' ') {
    4.15 +        }
    4.16 +        else if(fpra[ai] == ' ')
    4.17 +        {
    4.18              ai++;
    4.19 -        } else if(fprb[bi] == ' ') {
    4.20 +        }
    4.21 +        else if(fprb[bi] == ' ')
    4.22 +        {
    4.23              bi++;
    4.24 -        } else if(toupper(fpra[ai]) == toupper(fprb[bi])) {
    4.25 +        }
    4.26 +        else if(toupper(fpra[ai]) == toupper(fprb[bi]))
    4.27 +        {
    4.28              ai++;
    4.29              bi++;
    4.30          }
    4.31 -    }while(ai < fpras && bi < fprbs);
    4.32 +        else
    4.33 +        {
    4.34 +            return 0;
    4.35 +        }
    4.36 +        
    4.37 +    }
    4.38 +    while(ai < fpras && bi < fprbs);
    4.39      
    4.40      return ai == fpras && bi == fprbs;
    4.41  }
     5.1 --- a/src/message_api.c	Tue Apr 26 10:58:43 2016 +0200
     5.2 +++ b/src/message_api.c	Thu Apr 28 08:52:06 2016 +0200
     5.3 @@ -877,9 +877,6 @@
     5.4      assert(session);
     5.5      assert(msg);
     5.6  
     5.7 -    if (msg->dir == PEP_dir_incoming)
     5.8 -        return;
     5.9 -
    5.10      assert(msg->from && msg->from->fpr);
    5.11      if (msg->from == NULL || msg->from->fpr == NULL)
    5.12          return;
    5.13 @@ -932,11 +929,13 @@
    5.14      assert(session);
    5.15      assert(src);
    5.16      assert(dst);
    5.17 -    assert(enc_format != PEP_enc_none);
    5.18  
    5.19 -    if (!(session && src && dst && enc_format != PEP_enc_none))
    5.20 +    if (!(session && src && dst))
    5.21          return PEP_ILLEGAL_VALUE;
    5.22  
    5.23 +    if (src->dir == PEP_dir_incoming)
    5.24 +        return PEP_ILLEGAL_VALUE;
    5.25 +    
    5.26      determine_encryption_format(src);
    5.27      if (src->enc_format != PEP_enc_none)
    5.28          return PEP_ILLEGAL_VALUE;
    5.29 @@ -946,7 +945,13 @@
    5.30      status = myself(session, src->from);
    5.31      if (status != PEP_STATUS_OK)
    5.32          goto pep_error;
    5.33 -
    5.34 +    
    5.35 +    if (enc_format == PEP_enc_none)
    5.36 +    {
    5.37 +        attach_own_key(session, src);
    5.38 +        return PEP_UNENCRYPTED;
    5.39 +    }
    5.40 +    
    5.41      keys = new_stringlist(src->from->fpr);
    5.42      if (keys == NULL)
    5.43          goto enomem;
    5.44 @@ -963,13 +968,25 @@
    5.45      PEP_comm_type max_comm_type = PEP_ct_pEp;
    5.46  
    5.47      identity_list * _il;
    5.48 -    for (_il = src->to; _il && _il->ident; _il = _il->next) {
    5.49 +    
    5.50 +    if ((_il = src->bcc) && _il->ident)
    5.51 +    {
    5.52 +        // BCC limited support:
    5.53 +        //     - App splits mails with BCC in multiple mails.
    5.54 +        //     - Each email is encrypted separately
    5.55 +        
    5.56 +        if(_il->next || src->to || src->cc)
    5.57 +        {
    5.58 +            // Only one Bcc with no other recipient allowed for now
    5.59 +            return PEP_ILLEGAL_VALUE;
    5.60 +        }
    5.61 +        
    5.62          PEP_STATUS _status = update_identity(session, _il->ident);
    5.63          if (_status != PEP_STATUS_OK) {
    5.64              status = _status;
    5.65              goto pep_error;
    5.66          }
    5.67 -
    5.68 +        
    5.69          if (_il->ident->fpr && _il->ident->fpr[0]) {
    5.70              _k = stringlist_add(_k, _il->ident->fpr);
    5.71              if (_k == NULL)
    5.72 @@ -980,27 +997,49 @@
    5.73          else {
    5.74              dest_keys_found = false;
    5.75              status = PEP_KEY_NOT_FOUND;
    5.76 -        }
    5.77 +        }        
    5.78      }
    5.79 +    else
    5.80 +    {
    5.81 +        for (_il = src->to; _il && _il->ident; _il = _il->next) {
    5.82 +            PEP_STATUS _status = update_identity(session, _il->ident);
    5.83 +            if (_status != PEP_STATUS_OK) {
    5.84 +                status = _status;
    5.85 +                goto pep_error;
    5.86 +            }
    5.87  
    5.88 -    for (_il = src->cc; _il && _il->ident; _il = _il->next) {
    5.89 -        PEP_STATUS _status = update_identity(session, _il->ident);
    5.90 -        if (_status != PEP_STATUS_OK)
    5.91 -        {
    5.92 -            status = _status;
    5.93 -            goto pep_error;
    5.94 +            if (_il->ident->fpr && _il->ident->fpr[0]) {
    5.95 +                _k = stringlist_add(_k, _il->ident->fpr);
    5.96 +                if (_k == NULL)
    5.97 +                    goto enomem;
    5.98 +                max_comm_type = _get_comm_type(session, max_comm_type,
    5.99 +                                               _il->ident);
   5.100 +            }
   5.101 +            else {
   5.102 +                dest_keys_found = false;
   5.103 +                status = PEP_KEY_NOT_FOUND;
   5.104 +            }
   5.105          }
   5.106  
   5.107 -        if (_il->ident->fpr && _il->ident->fpr[0]) {
   5.108 -            _k = stringlist_add(_k, _il->ident->fpr);
   5.109 -            if (_k == NULL)
   5.110 -                goto enomem;
   5.111 -            max_comm_type = _get_comm_type(session, max_comm_type,
   5.112 -                                           _il->ident);
   5.113 -        }
   5.114 -        else {
   5.115 -            dest_keys_found = false;
   5.116 -            status = PEP_KEY_NOT_FOUND;
   5.117 +        for (_il = src->cc; _il && _il->ident; _il = _il->next) {
   5.118 +            PEP_STATUS _status = update_identity(session, _il->ident);
   5.119 +            if (_status != PEP_STATUS_OK)
   5.120 +            {
   5.121 +                status = _status;
   5.122 +                goto pep_error;
   5.123 +            }
   5.124 +
   5.125 +            if (_il->ident->fpr && _il->ident->fpr[0]) {
   5.126 +                _k = stringlist_add(_k, _il->ident->fpr);
   5.127 +                if (_k == NULL)
   5.128 +                    goto enomem;
   5.129 +                max_comm_type = _get_comm_type(session, max_comm_type,
   5.130 +                                               _il->ident);
   5.131 +            }
   5.132 +            else {
   5.133 +                dest_keys_found = false;
   5.134 +                status = PEP_KEY_NOT_FOUND;
   5.135 +            }
   5.136          }
   5.137      }
   5.138      
   5.139 @@ -1372,8 +1411,10 @@
   5.140      if (status != PEP_STATUS_OK)
   5.141          return status;
   5.142  
   5.143 -    for (il = msg->to; il != NULL; il = il->next) {
   5.144 -        if (il->ident) {
   5.145 +    for (il = msg->to; il != NULL; il = il->next)
   5.146 +    {
   5.147 +        if (il->ident)
   5.148 +        {
   5.149              update_identity(session, il->ident);
   5.150              max_comm_type = _get_comm_type(session, max_comm_type,
   5.151                      il->ident);
   5.152 @@ -1381,14 +1422,27 @@
   5.153          }
   5.154      }
   5.155  
   5.156 -    for (il = msg->cc; il != NULL; il = il->next) {
   5.157 -        if (il->ident) {
   5.158 +    for (il = msg->cc; il != NULL; il = il->next)
   5.159 +    {
   5.160 +        if (il->ident)
   5.161 +        {
   5.162              update_identity(session, il->ident);
   5.163              max_comm_type = _get_comm_type(session, max_comm_type,
   5.164                      il->ident);
   5.165              comm_type_determined = true;
   5.166          }
   5.167      }
   5.168 +        
   5.169 +    for (il = msg->bcc; il != NULL; il = il->next)
   5.170 +    {
   5.171 +        if (il->ident)
   5.172 +        {
   5.173 +            update_identity(session, il->ident);
   5.174 +            max_comm_type = _get_comm_type(session, max_comm_type,
   5.175 +                                           il->ident);
   5.176 +            comm_type_determined = true;
   5.177 +        }
   5.178 +    }
   5.179  
   5.180      if (comm_type_determined == false)
   5.181          *color = PEP_rating_undefined;