~noskcaj/ubuntu/vivid/gnome-keyring/3.15.90

« back to all changes in this revision

Viewing changes to egg/egg-hkdf.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-14 22:13:02 UTC
  • mfrom: (1.3.1)
  • mto: (80.2.8 experimental) (1.1.77)
  • mto: This revision was merged to the branch mainline in revision 148.
  • Revision ID: package-import@ubuntu.com-20120514221302-0l3gjmqpe6xopond
ImportĀ upstreamĀ versionĀ 3.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * Copyright (C) 2011 Collabora Ltd.
5
5
 *
6
6
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU Lesser General  License as
 
7
 * it under the terms of the GNU Lesser General Public License as
8
8
 * published by the Free Software Foundation; either version 2.1 of
9
9
 * the License, or (at your option) any later version.
10
10
 *
11
11
 * This program is distributed in the hope that it will be useful, but
12
12
 * WITHOUT ANY WARRANTY; without even the implied warranty of
13
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
 * Lesser General  License for more details.
 
14
 * Lesser General Public License for more details.
15
15
 *
16
 
 * You should have received a copy of the GNU Lesser General
 
16
 * You should have received a copy of the GNU Lesser General Public
17
17
 * License along with this program; if not, write to the Free Software
18
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
19
 * 02111-1307, USA.
71
71
        }
72
72
 
73
73
        /* Step 1: Extract */
74
 
        gcry = gcry_md_open (&md1, algo, GCRY_MD_FLAG_HMAC);
 
74
        gcry = gcry_md_open (&md1, algo, GCRY_MD_FLAG_HMAC | flags);
75
75
        g_return_val_if_fail (gcry == 0, FALSE);
76
76
        gcry = gcry_md_setkey (md1, salt, n_salt);
77
77
        g_return_val_if_fail (gcry == 0, FALSE);
78
78
        gcry_md_write (md1, input, n_input);
79
79
 
80
80
        /* Step 2: Expand */
81
 
        gcry = gcry_md_open (&md2, algo, GCRY_MD_FLAG_HMAC);
 
81
        gcry = gcry_md_open (&md2, algo, GCRY_MD_FLAG_HMAC | flags);
82
82
        g_return_val_if_fail (gcry == 0, FALSE);
83
83
        gcry = gcry_md_setkey (md2, gcry_md_read (md1, algo), hash_len);
84
84
        g_return_val_if_fail (gcry == 0, FALSE);