Fix previous commit.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 30 Mar 2018 08:46:52 +0000 (17:46 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Fri, 30 Mar 2018 08:46:52 +0000 (17:46 +0900)
src/openpgp-do.c

index 09f1336..a235df3 100644 (file)
@@ -896,12 +896,12 @@ gpg_do_kdf_check (int len, int how_many)
       int kdf_do_len = kdf_do[0];
       int hash_len;
 
-      if (kdf_do_len == SIZE_OF_KDF_DO_MAX)      
-       hash_len = kdf_spec[43];
-      else
+      if (kdf_do_len == SIZE_OF_KDF_DO_MIN)
        hash_len = kdf_spec[23];
+      else
+       hash_len = kdf_spec[43];
 
-      if ((hash_len * how_many) == len)
+      if ((hash_len * how_many) != len)
        return 0;
     }