Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Incorrect assertion parameter #6

Open
rakshitkr opened this issue Dec 6, 2020 · 3 comments
Open

Incorrect assertion parameter #6

rakshitkr opened this issue Dec 6, 2020 · 3 comments
Labels
bug Something isn't working develop ruleset

Comments

@rakshitkr
Copy link
Collaborator

rakshitkr commented Dec 6, 2020

Though the predicate encrypted[pre_ciphertext, pre_plaintext] is ensured after update method, the test generator selects a update(pre_plainBuffer, pre_cipherBuffer) method that doesn't contain those parameters. This results in assertion with wrong parameter as shown below.

@Test
	public void cipherInvalidTest32()
			throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, ShortBufferException {

		ByteBuffer pre_plainBuffer = null;
		Certificate cert = null;
		ByteBuffer pre_cipherBuffer = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, cert);
		cipher0.update(pre_plainBuffer, pre_cipherBuffer);
		Assertions.hasEnsuredPredicate(pre_ciphertext); // incorrect parameter
		Assertions.mustNotBeInAcceptingState(cipher0);

	}
@rakshitkr rakshitkr changed the title Incorrect assertion Incorrect assertion parameter Dec 6, 2020
@rakshitkr
Copy link
Collaborator Author

rakshitkr commented Dec 7, 2020

trustManagerFactory0 in Assertions.hasEnsuredPredicate instead of trustManager

TrustManagerFactory trustManagerFactory0 = TrustManagerFactory.getInstance("PKIX", (String) null);
trustManagerFactory0.init(keyStore0);
TrustManager[] trustManager = trustManagerFactory0.getTrustManagers();
Assertions.hasEnsuredPredicate(trustManagerFactory0); // incorrect parameter; trustManager must be generated
Assertions.mustBeInAcceptingState(trustManagerFactory0);

Following test cases are failing for above reason

  • trustManagerFactoryValidTest4
  • trustManagerFactoryValidTest5
  • trustManagerFactoryValidTest6

@rakshitkr
Copy link
Collaborator Author

rakshitkr commented Dec 8, 2020

secureRandom0 in Assertions.hasEnsuredPredicate instead of genSeed

SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
secureRandom0.setSeed(genSeed);
Assertions.hasEnsuredPredicate(secureRandom0); // incorrect parameter; genSeed must be generated
Assertions.mustBeInAcceptingState(secureRandom0);

Following test cases are failing for above reason

  • secureRandomValidTest6
  • secureRandomValidTest7
  • secureRandomValidTest8
  • secureRandomValidTest9
  • secureRandomValidTest10

@rakshitkr
Copy link
Collaborator Author

rakshitkr commented Dec 13, 2020

lSeed in Assertions.hasEnsuredPredicate instead of secureRandom0

@Test
	public void secureRandomValidTest11() throws NoSuchAlgorithmException {

		long lSeed = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		secureRandom0.setSeed(lSeed);
		Assertions.hasEnsuredPredicate(lSeed); // incorrect parameter; secureRandom0 must be generated
		Assertions.mustBeInAcceptingState(secureRandom0);

	}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working develop ruleset
Projects
None yet
Development

No branches or pull requests

1 participant