X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=ssharcf.c;h=d16ce22540b85a8f937c7f03cb3b06bddee8e612;hb=9a2730806cdf2191cb8ea22c9090c2e20e3a25ba;hp=59464881b6f106a079074382cac6993f7221dba9;hpb=09951c60786bf48d30d2dc6f19a430da0c4d7d4b;p=PuTTY.git diff --git a/ssharcf.c b/ssharcf.c index 59464881..d16ce225 100644 --- a/ssharcf.c +++ b/ssharcf.c @@ -19,7 +19,7 @@ static void arcfour_block(void *handle, unsigned char *blk, int len) s = ctx->s; i = ctx->i; j = ctx->j; - for (k = 0; k < len; k++) { + for (k = 0; (int)k < len; k++) { i = (i + 1) & 0xff; j = (j + s[i]) & 0xff; tmp = s[i]; s[i] = s[j]; s[j] = tmp; @@ -75,7 +75,7 @@ static void arcfour_stir(ArcfourContext *ctx) unsigned char *junk = snewn(1536, unsigned char); memset(junk, 0, 1536); arcfour_block(ctx, junk, 1536); - memset(junk, 0, 1536); + smemclr(junk, 1536); sfree(junk); } @@ -100,24 +100,22 @@ static void arcfour_iv(void *handle, unsigned char *key) const struct ssh2_cipher ssh_arcfour128_ssh2 = { arcfour_make_context, arcfour_free_context, arcfour_iv, arcfour128_key, - arcfour_block, arcfour_block, - "arcfour128-draft-00@putty.projects.tartarus.org", - 1, 128, "Arcfour-128" + arcfour_block, arcfour_block, NULL, NULL, + "arcfour128", + 1, 128, 16, 0, "Arcfour-128", + NULL }; const struct ssh2_cipher ssh_arcfour256_ssh2 = { arcfour_make_context, arcfour_free_context, arcfour_iv, arcfour256_key, - arcfour_block, arcfour_block, - "arcfour256-draft-00@putty.projects.tartarus.org", - 1, 256, "Arcfour-256" + arcfour_block, arcfour_block, NULL, NULL, + "arcfour256", + 1, 256, 32, 0, "Arcfour-256", + NULL }; -/* - * arcfour256-draft-00@putty.projects.tartarus.org is as-yet untested - * against any other implementation, and hence is commented out. - */ static const struct ssh2_cipher *const arcfour_list[] = { -/* &ssh_arcfour256_ssh2, */ + &ssh_arcfour256_ssh2, &ssh_arcfour128_ssh2, };