1diff --git a/libecdsaauth/keypair.c b/libecdsaauth/keypair.c
2index 5e098c5..b5dd21e 100644
3--- a/libecdsaauth/keypair.c
4+++ b/libecdsaauth/keypair.c
5@@ -22,6 +22,7 @@
6
7 #include <string.h>
8 #include <stdlib.h>
9+#include <openssl/pem.h>
10
11 static inline libecdsaauth_key_t *libecdsaauth_key_alloc(void)
12 {
13diff --git a/tool/main.c b/tool/main.c
14index 23d19a3..f88016c 100644
15--- a/tool/main.c
16+++ b/tool/main.c
17@@ -21,6 +21,7 @@
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21+#include <openssl/pem.h>
22
23 #include "libecdsaauth/keypair.h"
24 #include "libecdsaauth/op.h"
25@@ -41,7 +42,7 @@ static int tool_keygen(int argc, const char *argv[])
26 key = libecdsaauth_key_new();
27
28 pubout = fopen(argv[1], "w");
29- PEM_write_ECPrivateKey(pubout, key->eckey, NULL, NULL, 0, NULL);
30+ PEM_write_ECPrivateKey(pubout, key->eckey, NULL, NULL, 0, NULL, NULL);
31 fclose(pubout);
32
33 pubkey = libecdsaauth_key_public_key_base64(key);