~ubuntu-branches/ubuntu/trusty/gnutls26/trusty-security

« back to all changes in this revision

Viewing changes to lib/ext_signature.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2010-04-22 19:29:52 UTC
  • mto: (12.4.3 experimental) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20100422192952-gbj6cvaan8e4ejck
Tags: upstream-2.9.10
ImportĀ upstreamĀ versionĀ 2.9.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2002, 2003, 2004, 2005, 2009 Free Software Foundation
 
2
 * Copyright (C) 2002, 2003, 2004, 2005, 2009, 2010 Free Software
 
3
 * Foundation, Inc.
3
4
 *
4
5
 * Author: Nikos Mavrogiannopoulos
5
6
 *
58
59
  for (i = j = 0; i < len; i += 2, j++)
59
60
    {
60
61
      aid =
61
 
        _gnutls_sign_to_tls_aid (session->internals.priorities.sign_algo.
62
 
                                 priority[j]);
 
62
        _gnutls_sign_to_tls_aid (session->internals.priorities.
 
63
                                 sign_algo.priority[j]);
63
64
      *p = aid.hash_algorithm;
64
65
      p++;
65
66
      *p = aid.sign_algorithm;
90
91
      sig = _gnutls_tls_aid_to_sign (&aid);
91
92
      if (sig != GNUTLS_SIGN_UNKNOWN)
92
93
        {
93
 
          session->security_parameters.extensions.
94
 
            sign_algorithms[session->security_parameters.extensions.
95
 
                            sign_algorithms_size++] = sig;
 
94
          session->security_parameters.extensions.sign_algorithms[session->
 
95
                                                                  security_parameters.
 
96
                                                                  extensions.sign_algorithms_size++]
 
97
            = sig;
96
98
          if (session->security_parameters.extensions.sign_algorithms_size ==
97
99
              MAX_SIGNATURE_ALGORITHMS)
98
100
            break;
212
214
          (session->security_parameters.extensions.sign_algorithms[i]) == pk)
213
215
        {
214
216
          *hash =
215
 
            _gnutls_sign_get_hash_algorithm (session->
216
 
                                             security_parameters.extensions.
217
 
                                             sign_algorithms[i]);
 
217
            _gnutls_sign_get_hash_algorithm (session->security_parameters.
 
218
                                             extensions.sign_algorithms[i]);
218
219
          return session->security_parameters.extensions.sign_algorithms[i];
219
220
        }
220
221
    }
283
284
}
284
285
 
285
286
/**
286
 
 * gnutls_sign_algorithm_get - get signature algorithms requested by peer
 
287
 * gnutls_sign_algorithm_get_requested:
287
288
 * @session: is a #gnutls_session_t structure.
288
289
 * @indx: is an index of the signature algorithm to return
289
290
 * @algo: the returned certificate type will be stored there