~ubuntu-branches/ubuntu/quantal/gnutls26/quantal

« back to all changes in this revision

Viewing changes to lib/auth_rsa_export.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-05-20 13:07:18 UTC
  • mfrom: (12.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110520130718-db41dybbanzfvlji
Tags: 2.10.5-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Fix build failure with --no-add-needed.
  - Build for multiarch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation
 
2
 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2010 Free
 
3
 * Software Foundation, Inc.
3
4
 *
4
5
 * Author: Nikos Mavrogiannopoulos
5
6
 *
6
 
 * This file is part of GNUTLS.
 
7
 * This file is part of GnuTLS.
7
8
 *
8
 
 * The GNUTLS library is free software; you can redistribute it and/or
 
9
 * The GnuTLS is free software; you can redistribute it and/or
9
10
 * modify it under the terms of the GNU Lesser General Public License
10
11
 * as published by the Free Software Foundation; either version 2.1 of
11
12
 * the License, or (at your option) any later version.
76
77
  gnutls_privkey *apr_pkey;
77
78
  int apr_cert_list_length;
78
79
  gnutls_datum_t signature, ddata;
79
 
  cert_auth_info_t info;
80
80
  gnutls_certificate_credentials_t cred;
 
81
  gnutls_sign_algorithm_t sign_algo;
81
82
 
82
83
  cred = (gnutls_certificate_credentials_t)
83
84
    _gnutls_get_cred (session->key, GNUTLS_CRD_CERTIFICATE, NULL);
122
123
      return ret;
123
124
    }
124
125
 
125
 
  info = _gnutls_get_auth_info (session);
126
126
  _gnutls_rsa_export_set_pubkey (session, rsa_mpis[1], rsa_mpis[0]);
127
127
 
128
128
  _gnutls_mpi_print (rsa_mpis[0], NULL, &n_m);
155
155
  if (apr_cert_list_length > 0)
156
156
    {
157
157
      if ((ret =
158
 
           _gnutls_tls_sign_params (session, &apr_cert_list[0],
159
 
                                    apr_pkey, &ddata, &signature)) < 0)
 
158
           _gnutls_handshake_sign_data (session, &apr_cert_list[0],
 
159
                                        apr_pkey, &ddata, &signature,
 
160
                                        &sign_algo)) < 0)
160
161
        {
161
162
          gnutls_assert ();
162
163
          gnutls_free (*data);
310
311
      return ret;
311
312
    }
312
313
 
313
 
  ret = _gnutls_verify_sig_params (session, &peer_cert, &vparams, &signature);
 
314
  ret =
 
315
    _gnutls_handshake_verify_data (session, &peer_cert, &vparams, &signature,
 
316
                                   GNUTLS_SIGN_UNKNOWN);
314
317
 
315
318
  _gnutls_gcert_deinit (&peer_cert);
316
319
  if (ret < 0)