Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix version compare #680

Open
NewOF opened this issue Dec 2, 2024 · 0 comments
Open

Fix version compare #680

NewOF opened this issue Dec 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@NewOF
Copy link

NewOF commented Dec 2, 2024

Description

The version comparison does not meet expectations in handle_not_valid_after.

Your environment

Environment-independent.

Steps to reproduce

Enable the CAL_TEST_KEY and TRUSTED_NAME_TEST_KEY. (You can simply add two lines in the Makefile. CAL_TEST_KEY=1 TRUSTED_NAME_TEST_KEY=1)
In UT test_trusted_name_v2_expired,change the arg not_valid_after to (1,1,2).

1.1.2 < 1.14.0 (current version )

Expected behaviour

ut test_trusted_name_v2_expired running normally

Actual behaviour

ut running failed

Logs

Please paste any logs here that demonstrate the issue, if they exist

Proposed solution

	for (; i < (int) ARRAYLEN(app_version); ++i) {
    	  if (data->value[i] > app_version[i])
        	  break;
  
    	  if (data->value[i] < app_version[i]) {
        	  PRINTF("Expired trusted name : %u.%u.%u < %u.%u.%u\n",
               	  data->value[0],
               	  data->value[1],
               	  data->value[2],
               	  app_version[0],
               	  app_version[1],
               	  app_version[2]);
        	  return false;
    	  }
	}
@NewOF NewOF added the bug Something isn't working label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant