]> git.meshlink.io Git - meshlink/commitdiff
Ensure there is a newline character before a PEM key is written.
authorGuus Sliepen <guus@tinc-vpn.org>
Fri, 22 Oct 2010 20:42:21 +0000 (22:42 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Fri, 22 Oct 2010 20:42:21 +0000 (22:42 +0200)
src/tincd.c

index a8e5559636480c5a8b218702782dabeca383ac2a..a618e63f0d9158f78ba813b0efbb660599da8684 100644 (file)
@@ -365,6 +365,7 @@ static bool keygen(int bits) {
        fchmod(fileno(f), 0600);
 #endif
                
+       fputc('\n', f);
        PEM_write_RSAPrivateKey(f, rsa_key, NULL, NULL, 0, NULL, NULL);
        fclose(f);
        free(filename);
@@ -382,6 +383,7 @@ static bool keygen(int bits) {
        if(disable_old_keys(f))
                fprintf(stderr, "Warning: old key(s) found and disabled.\n");
 
+       fputc('\n', f);
        PEM_write_RSAPublicKey(f, rsa_key);
        fclose(f);
        free(filename);