Browse Source

Fix pointer conversion warnings

tags/1.2
Timo Röhling 10 years ago
parent
commit
69275bebaa
2 changed files with 10 additions and 10 deletions
  1. 7
    7
      sha1.c
  2. 3
    3
      srs2.c

+ 7
- 7
sha1.c View File

338
 {
338
 {
339
 	SHA_INFO ctx;
339
 	SHA_INFO ctx;
340
 	sha_init(&ctx);
340
 	sha_init(&ctx);
341
-	sha_update(&ctx, data, len);
342
-	sha_final(out, &ctx);
341
+	sha_update(&ctx, (sha_byte*)data, len);
342
+	sha_final((sha_byte*)out, &ctx);
343
 }
343
 }
344
 
344
 
345
 void
345
 void
364
 	memset(sbuf, 0, SHA_BLOCKSIZE);
364
 	memset(sbuf, 0, SHA_BLOCKSIZE);
365
 
365
 
366
 	sha_init(&ctx->sctx);
366
 	sha_init(&ctx->sctx);
367
-	sha_update(&ctx->sctx, ctx->ipad, SHA_BLOCKSIZE);
367
+	sha_update(&ctx->sctx, (sha_byte*)ctx->ipad, SHA_BLOCKSIZE);
368
 }
368
 }
369
 
369
 
370
 void
370
 void
371
 srs_hmac_update(srs_hmac_ctx_t *ctx, char *data, int len)
371
 srs_hmac_update(srs_hmac_ctx_t *ctx, char *data, int len)
372
 {
372
 {
373
-	sha_update(&ctx->sctx, data, len);
373
+	sha_update(&ctx->sctx, (sha_byte*)data, len);
374
 }
374
 }
375
 
375
 
376
 void
376
 void
377
 srs_hmac_fini(srs_hmac_ctx_t *ctx, char *out)
377
 srs_hmac_fini(srs_hmac_ctx_t *ctx, char *out)
378
 {
378
 {
379
-	char	 buf[SHA_DIGESTSIZE + 1];
379
+	sha_byte buf[SHA_DIGESTSIZE + 1];
380
 
380
 
381
 	sha_final(buf, &ctx->sctx);
381
 	sha_final(buf, &ctx->sctx);
382
 	sha_init(&ctx->sctx);
382
 	sha_init(&ctx->sctx);
383
-	sha_update(&ctx->sctx, ctx->opad, SHA_BLOCKSIZE);
383
+	sha_update(&ctx->sctx, (sha_byte*)ctx->opad, SHA_BLOCKSIZE);
384
 	sha_update(&ctx->sctx, buf, SHA_DIGESTSIZE);
384
 	sha_update(&ctx->sctx, buf, SHA_DIGESTSIZE);
385
-	sha_final(out, &ctx->sctx);
385
+	sha_final((sha_byte*)out, &ctx->sctx);
386
 }
386
 }

+ 3
- 3
srs2.c View File

55
 static srs_realloc_t	srs_f_realloc	= realloc;
55
 static srs_realloc_t	srs_f_realloc	= realloc;
56
 static srs_free_t		srs_f_free		= free;
56
 static srs_free_t		srs_f_free		= free;
57
 
57
 
58
-int		
58
+int
59
 srs_set_malloc(srs_malloc_t m, srs_realloc_t r, srs_free_t f)
59
 srs_set_malloc(srs_malloc_t m, srs_realloc_t r, srs_free_t f)
60
 {
60
 {
61
 	srs_f_malloc = m;
61
 	srs_f_malloc = m;
145
 	for (i = 0; i < srs->numsecrets; i++) {
145
 	for (i = 0; i < srs->numsecrets; i++) {
146
 		memset(srs->secrets[i], 0, strlen(srs->secrets[i]));
146
 		memset(srs->secrets[i], 0, strlen(srs->secrets[i]));
147
 		srs_f_free(srs->secrets[i]);
147
 		srs_f_free(srs->secrets[i]);
148
-		srs->secrets[i] = '\0';
148
+		srs->secrets[i] = 0;
149
 	}
149
 	}
150
 	srs_f_free(srs);
150
 	srs_f_free(srs);
151
 }
151
 }
619
 					sendhost, senduser, alias);
619
 					sendhost, senduser, alias);
620
 }
620
 }
621
 
621
 
622
-int		
622
+int
623
 srs_forward_alloc(srs_t *srs, char **sptr,
623
 srs_forward_alloc(srs_t *srs, char **sptr,
624
 				const char *sender, const char *alias)
624
 				const char *sender, const char *alias)
625
 {
625
 {

Loading…
Cancel
Save