Page MenuHomeVyOS Platform

pki generate ca add new line after passphrase
Closed, ResolvedPublicBUG

Description

Expected Begin certificate with a new line

vyos@r1-roll:~$ generate pki ca
Enter private key type: [rsa, dsa, ec] (Default: rsa) 
Enter private key bits: (Default: 2048) 

Enter country code: (Default: GB) Enter state: (Default: Some-State) Enter locality: (Default: Some-City) Enter organization name: (Default: VyOS) Enter common name: (Default: vyos.io) Enter how many days certificate will be valid: (Default: 1825) Note: If you plan to use the generated key on this router, do not encrypt the private key.
Do you want to encrypt the private key with a passphrase? [y/N] -----BEGIN CERTIFICATE-----
MIIDnTCCAoWgAwIBAgIUPmVX68h4+0HJAwhs/RoNS6Eh0KYwDQYJKoZIhvcNAQEL
BQAwVzELMAkGA1UEBhMCR0IxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAcM
...
-----END CERTIFICATE----

Details

Difficulty level
Easy (less than an hour)
Version
1.4-rolling-202108130117
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible

Event Timeline

VyOS 1.4-rolling-202108151712

cpo@LR1.wue3# run generate pki ca
Enter private key type: [rsa, dsa, ec] (Default: rsa)
Enter private key bits: (Default: 2048)

Enter country code: (Default: GB) Enter state: (Default: Some-State)
Enter locality: (Default: Some-City)
Enter organization name: (Default: VyOS)
Enter common name: (Default: vyos.io)
Enter how many days certificate will be valid: (Default: 1825)
Note: If you plan to use the generated key on this router, do not encrypt the private key.
Do you want to encrypt the private key with a passphrase? [y/N] y
Enter passphrase: asdf
-----BEGIN CERTIFICATE-----
MIIDnTCCAoWgAwIBAgIUTDsmBY1u9gOfqEaTcWe5Mz8JHSMwDQYJKoZIhvcNAQEL
BQAwVzELMAkGA1UEBhMCR0IxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAcM
CVNvbWUtQ2l0eTENMAsGA1UECgwEVnlPUzEQMA4GA1UEAwwHdnlvcy5pbzAeFw0y
MTA4MTkwODU0MjFaFw0yNjA4MTgwODU0MjFaMFcxCzAJBg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