~ubuntu-branches/ubuntu/maverick/gnutls26/maverick-updates

« back to all changes in this revision

Viewing changes to lib/gnutls_record.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2009-04-14 14:23:19 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090414142319-ok7xejzbqkofno1q
Tags: 2.6.5-1
* Sync sections in debian/control with override file. libgnutls26-dbg is
  section debug, guile-gnutls is section lisp.
* New upstream version. (Needed for Libtasn1-3 2.0)
* New patch 15_tasn1inpc.diff. Make sure libtasn1 is listed in Libs.private.
* Standards-Version: 3.8.1, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include "gnutls_cipher_int.h"
37
37
#include "gnutls_algorithms.h"
38
38
#include "gnutls_db.h"
39
 
#include "gnutls_auth_int.h"
 
39
#include "gnutls_auth.h"
40
40
#include "gnutls_num.h"
41
41
#include "gnutls_record.h"
42
42
#include "gnutls_datum.h"
410
410
 
411
411
      cipher_size =
412
412
        _gnutls_encrypt (session, headers, RECORD_HEADER_SIZE, data,
413
 
                         data2send_size, cipher, cipher_size, type, (session->internals.priorities.no_padding==0)?1:0);
 
413
                         data2send_size, cipher, cipher_size, type,
 
414
                         (session->internals.priorities.no_padding ==
 
415
                          0) ? 1 : 0);
414
416
      if (cipher_size <= 0)
415
417
        {
416
418
          gnutls_assert ();
434
436
          return GNUTLS_E_RECORD_LIMIT_REACHED;
435
437
        }
436
438
 
437
 
      ret =
438
 
        _gnutls_io_write_buffered (session, cipher, cipher_size);
 
439
      ret = _gnutls_io_write_buffered (session, cipher, cipher_size);
439
440
      gnutls_free (cipher);
440
441
    }
441
442
 
465
466
 
466
467
  _gnutls_record_log ("REC[%x]: Sent Packet[%d] %s(%d) with length: %d\n",
467
468
                      session,
468
 
                      (int) _gnutls_uint64touint32 (&session->
469
 
                                                    connection_state.
470
 
                                                    write_sequence_number),
 
469
                      (int)
 
470
                      _gnutls_uint64touint32
 
471
                      (&session->connection_state.write_sequence_number),
471
472
                      _gnutls_packet2str (type), type, cipher_size);
472
473
 
473
474
  return retval;
790
791
inline static int
791
792
get_temp_recv_buffer (gnutls_session_t session, gnutls_datum_t * tmp)
792
793
{
793
 
size_t max_record_size;
 
794
  size_t max_record_size;
794
795
 
795
 
  if (gnutls_compression_get(session) != GNUTLS_COMP_NULL)
 
796
  if (gnutls_compression_get (session) != GNUTLS_COMP_NULL)
796
797
    max_record_size = MAX_RECORD_RECV_SIZE + EXTRA_COMP_SIZE;
797
798
  else
798
799
    max_record_size = MAX_RECORD_RECV_SIZE;
809
810
      /* Initialize the internal buffer.
810
811
       */
811
812
      session->internals.recv_buffer.data =
812
 
        gnutls_realloc (session->internals.recv_buffer.data,
813
 
                        max_record_size);
 
813
        gnutls_realloc (session->internals.recv_buffer.data, max_record_size);
814
814
 
815
815
      if (session->internals.recv_buffer.data == NULL)
816
816
        {
942
942
     (int) _gnutls_uint64touint32 (&session->connection_state.
943
943
                                   read_sequence_number),
944
944
     _gnutls_packet2str (type), type, sizeofdata);
945
 
  _gnutls_record_log
946
 
    ("REC[%x]: Received Packet[%d] %s(%d) with length: %d\n", session,
947
 
     (int) _gnutls_uint64touint32 (&session->connection_state.
948
 
                                   read_sequence_number),
949
 
     _gnutls_packet2str (recv_type), recv_type, length);
 
945
  _gnutls_record_log ("REC[%x]: Received Packet[%d] %s(%d) with length: %d\n",
 
946
                      session,
 
947
                      (int)
 
948
                      _gnutls_uint64touint32 (&session->connection_state.
 
949
                                              read_sequence_number),
 
950
                      _gnutls_packet2str (recv_type), recv_type, length);
950
951
 
951
952
  if (length > MAX_RECV_SIZE)
952
953
    {