use _same_fpr to compare fingerprints rather strcasecmp.
authorEdouard Tisserant <edouard@pep-project.org>
Wed, 08 Feb 2017 14:24:12 +0100
changeset 1573e3c1acfac537
parent 1572 587649a8c216
child 1574 12b7a45140d3
child 1577 3991870e35c9
use _same_fpr to compare fingerprints rather strcasecmp.
src/message_api.c
     1.1 --- a/src/message_api.c	Wed Feb 08 14:23:29 2017 +0100
     1.2 +++ b/src/message_api.c	Wed Feb 08 14:24:12 2017 +0100
     1.3 @@ -1473,7 +1473,8 @@
     1.4      for (from_curr = from_keys; from_curr; from_curr = from_curr->next) {
     1.5          for (verify_curr = orig_verify; verify_curr; verify_curr = verify_curr->next) {
     1.6              if (from_curr->value && verify_curr->value &&
     1.7 -                strcasecmp(from_curr->value, verify_curr->value) == 0) {
     1.8 +                _same_fpr(from_curr->value, strlen(from_curr->value),
     1.9 +                          verify_curr->value, strlen(verify_curr->value))) {
    1.10                  from_fpr_node = from_curr;
    1.11                  break;
    1.12              }
    1.13 @@ -1488,7 +1489,8 @@
    1.14      verify_curr = orig_verify;
    1.15      
    1.16      /* put "from" signer at the beginning of the list */
    1.17 -    if (strcasecmp(orig_verify->value, from_fpr_node->value) != 0) {
    1.18 +    if (!_same_fpr(orig_verify->value, strlen(orig_verify->value),
    1.19 +                   from_fpr_node->value, strlen(from_fpr_node->value))) {
    1.20          orig_verify = stringlist_delete(orig_verify, from_fpr_node->value);
    1.21          verify_curr = new_stringlist(from_fpr_node->value);
    1.22          verify_curr->next = orig_verify;