fd_device: allow fd to be passed through a unix socket
[tinc] / src / ed25519 / ecdsagen.c
index 5120f28..ede5136 100644 (file)
@@ -46,10 +46,12 @@ ecdsa_t *ecdsa_generate(void) {
 
 // Write PEM ECDSA keys
 
-static bool write_pem(FILE *fp, const char *type, void *buf, size_t size) {
+static bool write_pem(FILE *fp, const char *type, void *vbuf, size_t size) {
        fprintf(fp, "-----BEGIN %s-----\n", type);
 
+       char *buf = vbuf;
        char base64[65];
+
        while(size) {
                size_t todo = size > 48 ? 48 : size;
                b64encode(buf, base64, todo);