Mercurial > dropbear
comparison common-algo.c @ 1123:d7b752525b91
buf_getstring and buf_putstring now use non-unsigned char*
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 04 Jun 2015 23:08:50 +0800 |
parents | bb3a03feb31f |
children | 6aeadee3f16b |
comparison
equal
deleted
inserted
replaced
1121:bb3a03feb31f | 1123:d7b752525b91 |
---|---|
326 donefirst = 1; | 326 donefirst = 1; |
327 len = strlen(localalgos[i].name); | 327 len = strlen(localalgos[i].name); |
328 buf_putbytes(algolist, (const unsigned char *) localalgos[i].name, len); | 328 buf_putbytes(algolist, (const unsigned char *) localalgos[i].name, len); |
329 } | 329 } |
330 } | 330 } |
331 buf_putstring(buf, algolist->data, algolist->len); | 331 buf_putstring(buf, (const char*)algolist->data, algolist->len); |
332 buf_free(algolist); | 332 buf_free(algolist); |
333 } | 333 } |
334 | 334 |
335 /* match the first algorithm in the comma-separated list in buf which is | 335 /* match the first algorithm in the comma-separated list in buf which is |
336 * also in localalgos[], or return NULL on failure. | 336 * also in localalgos[], or return NULL on failure. |
351 if (goodguess) { | 351 if (goodguess) { |
352 *goodguess = 0; | 352 *goodguess = 0; |
353 } | 353 } |
354 | 354 |
355 /* get the comma-separated list from the buffer ie "algo1,algo2,algo3" */ | 355 /* get the comma-separated list from the buffer ie "algo1,algo2,algo3" */ |
356 algolist = (char *) buf_getstring(buf, &len); | 356 algolist = buf_getstring(buf, &len); |
357 TRACE(("buf_match_algo: %s", algolist)) | 357 TRACE(("buf_match_algo: %s", algolist)) |
358 if (len > MAX_PROPOSED_ALGO*(MAX_NAME_LEN+1)) { | 358 if (len > MAX_PROPOSED_ALGO*(MAX_NAME_LEN+1)) { |
359 goto out; | 359 goto out; |
360 } | 360 } |
361 | 361 |