Click Ipsec

Markku Savela <[email protected]>
Newsgroups gmane.network.routing.click
Message-ID <[email protected]>
Hi,

Has anyone actually worked on those elements? I just tried the HMAC,
and couldn't get it to match my other implementation. On quick browse,
it looks like it's using wrong constant in few places (SHA_BLOCK where
SHA_CBLOCK should be?). Haven't really tried this yet -- will return
to issue next week...



@@ -97,12 +97,12 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, 
int len)
  		for (i=0; i<HMAC_MAX_MD_CBLOCK; i++)
  			pad[i]=0x36^ctx->key[i];
  		SHA1_init(&ctx->i_ctx);
-		SHA1_update(&ctx->i_ctx,pad,SHA_BLOCK);
+		SHA1_update(&ctx->i_ctx,pad,SHA_CBLOCK);

  		for (i=0; i<HMAC_MAX_MD_CBLOCK; i++)
  			pad[i]=0x5c^ctx->key[i];
  		SHA1_init(&ctx->o_ctx);
-		SHA1_update(&ctx->o_ctx,pad,SHA_BLOCK);
+		SHA1_update(&ctx->o_ctx,pad,SHA_CBLOCK);
  		}
  	memcpy((void *)&ctx->md_ctx,(void*)&ctx->i_ctx,sizeof(SHA1_ctx));
  	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.