Ensure there is a newline character before a PEM key is written.
This commit is contained in:
parent
c6ccbadfcf
commit
a08462bf84
1 changed files with 2 additions and 0 deletions
|
@ -365,6 +365,7 @@ static bool keygen(int bits) {
|
||||||
fchmod(fileno(f), 0600);
|
fchmod(fileno(f), 0600);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
fputc('\n', f);
|
||||||
PEM_write_RSAPrivateKey(f, rsa_key, NULL, NULL, 0, NULL, NULL);
|
PEM_write_RSAPrivateKey(f, rsa_key, NULL, NULL, 0, NULL, NULL);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
free(filename);
|
free(filename);
|
||||||
|
@ -382,6 +383,7 @@ static bool keygen(int bits) {
|
||||||
if(disable_old_keys(f))
|
if(disable_old_keys(f))
|
||||||
fprintf(stderr, "Warning: old key(s) found and disabled.\n");
|
fprintf(stderr, "Warning: old key(s) found and disabled.\n");
|
||||||
|
|
||||||
|
fputc('\n', f);
|
||||||
PEM_write_RSAPublicKey(f, rsa_key);
|
PEM_write_RSAPublicKey(f, rsa_key);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
free(filename);
|
free(filename);
|
||||||
|
|
Loading…
Reference in a new issue