comparison keyimport.c @ 1094:c45d65392c1a

Fix pointer differ in signess warnings [-Werror=pointer-sign]
author Gaël PORTAY <gael.portay@gmail.com>
date Sat, 02 May 2015 15:59:06 +0200
parents d144a6bece53
children 845922d73e9c
comparison
equal deleted inserted replaced
1093:aae71c5f7d5b 1094:c45d65392c1a
191 191
192 /* cpl has to be less than 100 */ 192 /* cpl has to be less than 100 */
193 static void base64_encode_fp(FILE * fp, unsigned char *data, 193 static void base64_encode_fp(FILE * fp, unsigned char *data,
194 int datalen, int cpl) 194 int datalen, int cpl)
195 { 195 {
196 char out[100]; 196 unsigned char out[100];
197 int n; 197 int n;
198 unsigned long outlen; 198 unsigned long outlen;
199 int rawcpl; 199 int rawcpl;
200 rawcpl = cpl * 3 / 4; 200 rawcpl = cpl * 3 / 4;
201 dropbear_assert((unsigned int)cpl < sizeof(out)); 201 dropbear_assert((unsigned int)cpl < sizeof(out));
443 ret->keyblob_size = ret->keyblob_len + outlen + 256; 443 ret->keyblob_size = ret->keyblob_len + outlen + 256;
444 ret->keyblob = (unsigned char*)m_realloc(ret->keyblob, 444 ret->keyblob = (unsigned char*)m_realloc(ret->keyblob,
445 ret->keyblob_size); 445 ret->keyblob_size);
446 } 446 }
447 outlen = ret->keyblob_size - ret->keyblob_len; 447 outlen = ret->keyblob_size - ret->keyblob_len;
448 if (base64_decode(buffer, len, 448 if (base64_decode((const unsigned char *)buffer, len,
449 ret->keyblob + ret->keyblob_len, &outlen) != CRYPT_OK){ 449 ret->keyblob + ret->keyblob_len, &outlen) != CRYPT_OK){
450 errmsg = "Error decoding base64"; 450 errmsg = "Error decoding base64";
451 goto error; 451 goto error;
452 } 452 }
453 ret->keyblob_len += outlen; 453 ret->keyblob_len += outlen;
600 */ 600 */
601 blobbuf = buf_new(3000); 601 blobbuf = buf_new(3000);
602 602
603 #ifdef DROPBEAR_DSS 603 #ifdef DROPBEAR_DSS
604 if (key->type == OSSH_DSA) { 604 if (key->type == OSSH_DSA) {
605 buf_putstring(blobbuf, "ssh-dss", 7); 605 buf_putstring(blobbuf, (const unsigned char *)"ssh-dss", 7);
606 retkey->type = DROPBEAR_SIGNKEY_DSS; 606 retkey->type = DROPBEAR_SIGNKEY_DSS;
607 } 607 }
608 #endif 608 #endif
609 #ifdef DROPBEAR_RSA 609 #ifdef DROPBEAR_RSA
610 if (key->type == OSSH_RSA) { 610 if (key->type == OSSH_RSA) {
611 buf_putstring(blobbuf, "ssh-rsa", 7); 611 buf_putstring(blobbuf, (const unsigned char *)"ssh-rsa", 7);
612 retkey->type = DROPBEAR_SIGNKEY_RSA; 612 retkey->type = DROPBEAR_SIGNKEY_RSA;
613 } 613 }
614 #endif 614 #endif
615 615
616 for (i = 0; i < num_integers; i++) { 616 for (i = 0; i < num_integers; i++) {