Fix compiler warnings.
This commit is contained in:
parent
2a9060bba6
commit
b50d6a7f2a
4 changed files with 6 additions and 7 deletions
|
@ -34,7 +34,7 @@ bool ecdsa_set_base64_public_key(ecdsa_t *ecdsa, const char *p) {
|
|||
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));
|
||||
|
@ -49,7 +49,7 @@ char *ecdsa_get_base64_public_key(ecdsa_t *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);
|
||||
|
||||
|
@ -87,7 +87,7 @@ size_t ecdsa_size(ecdsa_t *ecdsa) {
|
|||
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);
|
||||
|
@ -107,7 +107,7 @@ bool ecdsa_sign(ecdsa_t *ecdsa, const void *in, size_t len, void *sig) {
|
|||
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)) {
|
||||
|
|
|
@ -67,7 +67,7 @@ char *ecdsa_get_base64_public_key(ecdsa_t *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);
|
||||
|
||||
|
|
|
@ -226,7 +226,6 @@ bool send_metakey(connection_t *c) {
|
|||
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);
|
||||
|
||||
|
|
|
@ -577,7 +577,7 @@ int main(int argc, char *argv[]) {
|
|||
#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";
|
||||
|
|
Loading…
Reference in a new issue