Fix invalid logger() calls in Solaris device code.
[tinc] / src / ed25519 / ecdsa.c
index 79532c8..8dee124 100644 (file)
@@ -35,10 +35,10 @@ typedef struct {
 // Get and set ECDSA keys
 //
 ecdsa_t *ecdsa_set_base64_public_key(const char *p) {
-       int len = strlen(p);
+       size_t len = strlen(p);
 
        if(len != 43) {
-               logger(DEBUG_ALWAYS, LOG_ERR, "Invalid size %d for public key!", len);
+               logger(DEBUG_ALWAYS, LOG_ERR, "Invalid size %zu for public key!", len);
                return 0;
        }
 
@@ -46,7 +46,7 @@ ecdsa_t *ecdsa_set_base64_public_key(const char *p) {
        len = b64decode(p, ecdsa->public, len);
 
        if(len != 32) {
-               logger(DEBUG_ALWAYS, LOG_ERR, "Invalid format of public key! len = %d", len);
+               logger(DEBUG_ALWAYS, LOG_ERR, "Invalid format of public key! len = %zu", len);
                free(ecdsa);
                return 0;
        }
@@ -63,10 +63,11 @@ char *ecdsa_get_base64_public_key(ecdsa_t *ecdsa) {
 
 // Read PEM ECDSA keys
 
-static bool read_pem(FILE *fp, const char *type, void *buf, size_t size) {
+static bool read_pem(FILE *fp, const char *type, void *vbuf, size_t size) {
        char line[1024];
        bool data = false;
        size_t typelen = strlen(type);
+       char *buf = vbuf;
 
        while(fgets(line, sizeof(line), fp)) {
                if(!data) {
@@ -143,6 +144,7 @@ ecdsa_t *ecdsa_read_pem_private_key(FILE *fp) {
 }
 
 size_t ecdsa_size(ecdsa_t *ecdsa) {
+       (void)ecdsa;
        return 64;
 }