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

Fixes interactive mode for cvss v4.0 #54

Merged
merged 8 commits into from
Apr 4, 2024

Conversation

chrisdlangton
Copy link
Contributor

addresses #47

@chrisdlangton
Copy link
Contributor Author

FYI
No tests existed for interactive mode, for me to update.
Searched for imports using repo:RedHatProductSecurity/cvss path:/^tests\// interactive

Copy link
Collaborator

@jsvob jsvob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculator doesn't return a CVSS v4.0 score in either non-interactive and interactive mode.

$ cvss_calculator -4 -v "CVSS:4.0/AV:P/AC:H/AT:P/PR:H/UI:A/VC:L/VI:L/VA:L/SC:L/SI:L/SA:L/S:N"
Traceback (most recent call last):
  File "/TMP/cvss/venv/bin/cvss_calculator", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/TMP/cvss/venv/lib64/python3.11/site-packages/cvss/cvss_calculator.py", line 63, in main
    scores = cvss_vector.scores()
             ^^^^^^^^^^^^^^^^^^
AttributeError: 'CVSS4' object has no attribute 'scores'

@chrisdlangton
Copy link
Contributor Author

chrisdlangton commented Apr 3, 2024

Should be working now, CVSS4 methods weren't API backwards compatible

@chrisdlangton chrisdlangton requested a review from jsvob April 3, 2024 12:35
Copy link
Collaborator

@jsvob jsvob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a minor nitpick. Thank you!

cvss/cvss4.py Outdated Show resolved Hide resolved
@jsvob jsvob merged commit 38e1699 into RedHatProductSecurity:master Apr 4, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants