int len = strlen(p);
if(len != 43) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Invalid size %s for public key!", len);
+ logger(DEBUG_ALWAYS, LOG_ERR, "Invalid size %d for public key!", len);
return 0;
}
{
sha512_context ctx;
int ret;
- if (ret = sha512_init(&ctx)) return ret;
- if (ret = sha512_update(&ctx, message, message_len)) return ret;
- if (ret = sha512_final(&ctx, out)) return ret;
+ if ((ret = sha512_init(&ctx))) return ret;
+ if ((ret = sha512_update(&ctx, message, message_len))) return ret;
+ if ((ret = sha512_final(&ctx, out))) return ret;
return 0;
-}
\ No newline at end of file
+}
ecdsa_write_pem_private_key(key, fp);
fclose(fp);
} else {
- fprintf(stderr, "Could not open '%s' for writing: %s\n", strerror(errno));
+ fprintf(stderr, "Could not open '%s' for writing: %s\n", argv[1], strerror(errno));
return 1;
}
ecdsa_write_pem_public_key(key, fp);
fclose(fp);
} else {
- fprintf(stderr, "Could not open '%s' for writing: %s\n", strerror(errno));
+ fprintf(stderr, "Could not open '%s' for writing: %s\n", argv[2], strerror(errno));
return 1;
}