Bug 1850183

Summary: 0 return code when passphrase is too short
Product: [Fedora] Fedora Reporter: Branislav Náter <bnater>
Component: sscgAssignee: Stephen Gallagher <sgallagh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: sgallagh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sscg-2.6.2-1.fc31 sscg-2.6.2-1.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-05 01:48:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Branislav Náter 2020-06-23 16:47:37 UTC
Description of problem:
sscg should return non-zero return code when passphrase is too short or long

Version-Release number of selected component (if applicable):
sscg-2.6.1-4.fc33

How reproducible:
always

Steps to Reproduce:
1. create passfile.txt with 3 char long password
2. sscg --cert-key-passfile=passfile.txt

Actual results:
:: [ 12:42:11 ] :: [  BEGIN   ] :: Error message should be printed :: actually running 'sscg --cert-key-passfile=passfile.txt'
ERROR: Passphrases must be between 4 and 1023 characters. 
Wrote service certificate key to /tmp/tmp.meGqxPqXg6/service-key.pem
Wrote service certificate to /tmp/tmp.meGqxPqXg6/service.pem
Wrote CA certificate to /tmp/tmp.meGqxPqXg6/ca.crt
:: [ 12:42:12 ] :: [   FAIL   ] :: Error message should be printed (Expected 1-255, got 0)

Expected results:
non-zero return code is returned

Comment 1 Stephen Gallagher 2020-06-23 18:00:21 UTC
Good catch. I'll get that fixed up. Thanks for the bug report!

Comment 2 Stephen Gallagher 2020-06-23 18:06:38 UTC
Huh, looks like I actually already found and fixed this upstream[1] but forgot to make a release...


[1] https://github.com/sgallagher/sscg/commit/2017d903477671e971d91e52ace7dbeb2c6bc33f

Comment 3 Fedora Update System 2020-06-26 14:15:23 UTC
FEDORA-2020-b8306350d9 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b8306350d9

Comment 4 Fedora Update System 2020-06-27 01:21:16 UTC
FEDORA-2020-322bd1dcd7 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-322bd1dcd7`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-322bd1dcd7

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2020-06-27 03:12:55 UTC
FEDORA-2020-b8306350d9 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-b8306350d9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b8306350d9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2020-07-05 01:48:45 UTC
FEDORA-2020-322bd1dcd7 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Fedora Update System 2020-07-05 02:09:36 UTC
FEDORA-2020-b8306350d9 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.