~ubuntu-branches/ubuntu/oneiric/curl/oneiric

« back to all changes in this revision

Viewing changes to lib/hmac.c

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2011-01-26 02:50:18 UTC
  • mfrom: (3.4.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110126025018-dzgm2m2t5d1vc9y4
Tags: 7.21.3-1ubuntu1
* Merge from debian unstable.  Remaining changes: (LP: #707756)
  - debian/control:
    + Build-Depends: Replace libssh2-1-dev with openssh-server.
      Drop stunnel since it's in universe, as well.
    + Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
    Above changes are necessary to be independent from the universe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
 
61
61
  /* Create HMAC context. */
62
62
  i = sizeof *ctxt + 2 * hashparams->hmac_ctxtsize + hashparams->hmac_resultlen;
63
 
  ctxt = (HMAC_context *) malloc(i);
 
63
  ctxt = malloc(i);
64
64
 
65
65
  if(!ctxt)
66
66
    return ctxt;
85
85
  (*hashparams->hmac_hinit)(ctxt->hmac_hashctxt2);
86
86
 
87
87
  for (i = 0; i < keylen; i++) {
88
 
    b = *key ^ hmac_ipad;
 
88
    b = (unsigned char)(*key ^ hmac_ipad);
89
89
    (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &b, 1);
90
 
    b = *key++ ^ hmac_opad;
 
90
    b = (unsigned char)(*key++ ^ hmac_opad);
91
91
    (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &b, 1);
92
92
  }
93
93