int len = strlen(p);
unsigned char pubkey[len / 4 * 3 + 3];
const unsigned char *ppubkey = pubkey;
- len = b64decode(p, pubkey, len);
+ len = b64decode(p, (char *)pubkey, len);
if(!o2i_ECPublicKey(ecdsa, &ppubkey, len)) {
logger(LOG_DEBUG, "o2i_ECPublicKey failed: %s", ERR_error_string(ERR_get_error(), NULL));
int len = i2o_ECPublicKey(*ecdsa, &pubkey);
char *base64 = malloc(len * 4 / 3 + 5);
- b64encode(pubkey, base64, len);
+ b64encode((char *)pubkey, base64, len);
free(pubkey);
bool ecdsa_sign(ecdsa_t *ecdsa, const void *in, size_t len, void *sig) {
unsigned int siglen = ECDSA_size(*ecdsa);
- char hash[SHA512_DIGEST_LENGTH];
+ unsigned char hash[SHA512_DIGEST_LENGTH];
SHA512(in, len, hash);
memset(sig, 0, siglen);
bool ecdsa_verify(ecdsa_t *ecdsa, const void *in, size_t len, const void *sig) {
unsigned int siglen = ECDSA_size(*ecdsa);
- char hash[SHA512_DIGEST_LENGTH];
+ unsigned char hash[SHA512_DIGEST_LENGTH];
SHA512(in, len, hash);
if(!ECDSA_verify(0, hash, sizeof hash, sig, siglen, *ecdsa)) {
int len = i2o_ECPublicKey(*ecdsa, &pubkey);
char *base64 = malloc(len * 4 / 3 + 5);
- b64encode(pubkey, base64, len);
+ b64encode((char *)pubkey, base64, len);
free(pubkey);
static bool metakey_ec_h(connection_t *c, const char *request) {
size_t siglen = ecdsa_size(&c->ecdsa);
char key[MAX_STRING_SIZE];
- char sig[siglen];
logger(LOG_DEBUG, "Got ECDH metakey from %s", c->name);
#endif
if (slash++) {
c = xmalloc((slash - argv[0]) + sizeof("tincd"));
- sprintf(c, "%.*stincd", slash - argv[0], argv[0]);
+ sprintf(c, "%.*stincd", (int)(slash - argv[0]), argv[0]);
}
else
c = "tincd";