Merge branch 'hmac_support' of github.com:mrash/fwknop into hmac_support
authorMichael Rash <mbr@cipherdyne.org>
Sun, 10 Mar 2013 18:32:07 +0000 (14:32 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Sun, 10 Mar 2013 18:32:07 +0000 (14:32 -0400)
Conflicts:
client/fwknop.c
lib/fko_hmac.c

1  2 
client/fwknop.c
lib/fko.h
lib/fko_funcs.c
lib/fko_hmac.c

diff --cc client/fwknop.c
@@@ -970,10 -970,10 +970,10 @@@ get_keys(fko_ctx_t ctx, fko_cli_options
  
      if (use_hmac)
      {
-         res = fko_set_hmac_type(ctx, options->hmac_type);
 -        res = fko_set_spa_hmac_type(ctx, FKO_HMAC_SHA256);
++        res = fko_set_spa_hmac_type(ctx, options->hmac_type);
          if(res != FKO_SUCCESS)
          {
-             errmsg("fko_set_hmac_type", res);
+             errmsg("fko_set_spa_hmac_type", res);
              exit(EXIT_FAILURE);
          }
      }
diff --cc lib/fko.h
Simple merge
diff --cc lib/fko_funcs.c
@@@ -215,17 -215,6 +215,17 @@@ fko_new_with_data(fko_ctx_t *r_ctx, con
      }
      ctx->initval = 0;
  
 +    /* HMAC digest type
 +    */
 +    ctx->initval = FKO_CTX_INITIALIZED;
-     res = fko_set_hmac_type(ctx, hmac_type);
++    res = fko_set_spa_hmac_type(ctx, hmac_type);
 +    if(res != FKO_SUCCESS)
 +    {
 +        fko_destroy(ctx);
 +        return res;
 +    }
 +    ctx->initval = 0;
 +
      /* Check HMAC if the access stanza had an HMAC key
      */
      ctx->initval = FKO_CTX_INITIALIZED;
diff --cc lib/fko_hmac.c
@@@ -106,7 -86,7 +106,7 @@@ int fko_verify_hmac(fko_ctx_t ctx
      /* Calculate the HMAC from the encrypted data and then
       * compare
      */
-     res = fko_set_hmac_type(ctx, ctx->hmac_type);
 -    res = fko_set_spa_hmac_type(ctx, FKO_HMAC_SHA256);
++    res = fko_set_spa_hmac_type(ctx, ctx->hmac_type);
      if(res == FKO_SUCCESS)
      {
          res = fko_calculate_hmac(ctx, hmac_key, hmac_key_len);