added false positive signature check
authorMartin Willi <martin@strongswan.org>
Tue, 18 Mar 2008 12:25:39 +0000 (12:25 -0000)
committerMartin Willi <martin@strongswan.org>
Tue, 18 Mar 2008 12:25:39 +0000 (12:25 -0000)
src/charon/plugins/unit_tester/tests/test_rsa_gen.c

index 79f4750..2dbef04 100644 (file)
@@ -52,6 +52,12 @@ bool test_rsa_gen()
                        DBG1(DBG_CFG, "verifying RSA signature failed");
                        return FALSE;
                }
+               sig.ptr[sig.len-1]++;
+               if (public->verify(public, SIGN_RSA_EMSA_PKCS1_SHA1, data, sig))
+               {
+                       DBG1(DBG_CFG, "verifying faked RSA signature succeeded!");
+                       return FALSE;
+               }
                free(sig.ptr);
                public->destroy(public);
                private->destroy(private);