projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix building tinc and running tests on Solaris
[tinc]
/
src
/
ed25519
/
ecdsa.c
diff --git
a/src/ed25519/ecdsa.c
b/src/ed25519/ecdsa.c
index
79532c8
..
f0ce2c1
100644
(file)
--- a/
src/ed25519/ecdsa.c
+++ b/
src/ed25519/ecdsa.c
@@
-35,18
+35,18
@@
typedef struct {
// Get and set ECDSA keys
//
ecdsa_t *ecdsa_set_base64_public_key(const char *p) {
// Get and set ECDSA keys
//
ecdsa_t *ecdsa_set_base64_public_key(const char *p) {
-
in
t len = strlen(p);
+
size_
t len = strlen(p);
if(len != 43) {
if(len != 43) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Invalid size %
d for public key!",
len);
+ logger(DEBUG_ALWAYS, LOG_ERR, "Invalid size %
lu for public key!", (unsigned long)
len);
return 0;
}
ecdsa_t *ecdsa = xzalloc(sizeof(*ecdsa));
return 0;
}
ecdsa_t *ecdsa = xzalloc(sizeof(*ecdsa));
- len = b64decode(p, ecdsa->public, len);
+ len = b64decode
_tinc
(p, ecdsa->public, len);
if(len != 32) {
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 = %
lu", (unsigned long)
len);
free(ecdsa);
return 0;
}
free(ecdsa);
return 0;
}
@@
-56,17
+56,18
@@
ecdsa_t *ecdsa_set_base64_public_key(const char *p) {
char *ecdsa_get_base64_public_key(ecdsa_t *ecdsa) {
char *base64 = xmalloc(44);
char *ecdsa_get_base64_public_key(ecdsa_t *ecdsa) {
char *base64 = xmalloc(44);
- b64encode(ecdsa->public, base64, sizeof(ecdsa->public));
+ b64encode
_tinc
(ecdsa->public, base64, sizeof(ecdsa->public));
return base64;
}
// Read PEM ECDSA keys
return base64;
}
// 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 *
v
buf, size_t size) {
char line[1024];
bool data = false;
size_t typelen = strlen(type);
char line[1024];
bool data = false;
size_t typelen = strlen(type);
+ char *buf = vbuf;
while(fgets(line, sizeof(line), fp)) {
if(!data) {
while(fgets(line, sizeof(line), fp)) {
if(!data) {
@@
-87,7
+88,7
@@
static bool read_pem(FILE *fp, const char *type, void *buf, size_t size) {
}
size_t linelen = strcspn(line, "\r\n");
}
size_t linelen = strcspn(line, "\r\n");
- size_t len = b64decode(line, line, linelen);
+ size_t len = b64decode
_tinc
(line, line, linelen);
if(!len) {
logger(DEBUG_ALWAYS, LOG_ERR, "Invalid base64 data in PEM file\n");
if(!len) {
logger(DEBUG_ALWAYS, LOG_ERR, "Invalid base64 data in PEM file\n");
@@
-143,6
+144,7
@@
ecdsa_t *ecdsa_read_pem_private_key(FILE *fp) {
}
size_t ecdsa_size(ecdsa_t *ecdsa) {
}
size_t ecdsa_size(ecdsa_t *ecdsa) {
+ (void)ecdsa;
return 64;
}
return 64;
}