|
@@ -105,10 +105,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
105
|
105
|
#define EINFO_EINVAL_MAC \
|
106
|
106
|
__einfo_uniqify ( EINFO_EINVAL, 0x0d, \
|
107
|
107
|
"Invalid MAC" )
|
108
|
|
-#define EINVAL_NON_DATA __einfo_error ( EINFO_EINVAL_NON_DATA )
|
109
|
|
-#define EINFO_EINVAL_NON_DATA \
|
110
|
|
- __einfo_uniqify ( EINFO_EINVAL, 0x0e, \
|
111
|
|
- "Overlength non-data record" )
|
112
|
108
|
#define EIO_ALERT __einfo_error ( EINFO_EIO_ALERT )
|
113
|
109
|
#define EINFO_EIO_ALERT \
|
114
|
110
|
__einfo_uniqify ( EINFO_EINVAL, 0x01, \
|
|
@@ -137,6 +133,10 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
137
|
133
|
#define EINFO_ENOMEM_RX_DATA \
|
138
|
134
|
__einfo_uniqify ( EINFO_ENOMEM, 0x07, \
|
139
|
135
|
"Not enough space for received data" )
|
|
136
|
+#define ENOMEM_RX_CONCAT __einfo_error ( EINFO_ENOMEM_RX_CONCAT )
|
|
137
|
+#define EINFO_ENOMEM_RX_CONCAT \
|
|
138
|
+ __einfo_uniqify ( EINFO_ENOMEM, 0x08, \
|
|
139
|
+ "Not enough space to concatenate received data" )
|
140
|
140
|
#define ENOTSUP_CIPHER __einfo_error ( EINFO_ENOTSUP_CIPHER )
|
141
|
141
|
#define EINFO_ENOTSUP_CIPHER \
|
142
|
142
|
__einfo_uniqify ( EINFO_ENOTSUP, 0x01, \
|
|
@@ -1743,14 +1743,12 @@ static int tls_new_record ( struct tls_session *tls, unsigned int type,
|
1743
|
1743
|
return 0;
|
1744
|
1744
|
}
|
1745
|
1745
|
|
1746
|
|
- /* For all other records, fail unless we have exactly one I/O buffer */
|
1747
|
|
- iobuf = list_first_entry ( rx_data, struct io_buffer, list );
|
1748
|
|
- assert ( iobuf != NULL );
|
1749
|
|
- list_del ( &iobuf->list );
|
1750
|
|
- if ( ! list_empty ( rx_data ) ) {
|
1751
|
|
- DBGC ( tls, "TLS %p overlength non-data record\n", tls );
|
1752
|
|
- free_iob ( iobuf );
|
1753
|
|
- return -EINVAL_NON_DATA;
|
|
1746
|
+ /* For all other records, merge into a single I/O buffer */
|
|
1747
|
+ iobuf = iob_concatenate ( rx_data );
|
|
1748
|
+ if ( ! iobuf ) {
|
|
1749
|
+ DBGC ( tls, "TLS %p could not concatenate non-data record "
|
|
1750
|
+ "type %d\n", tls, type );
|
|
1751
|
+ return -ENOMEM_RX_CONCAT;
|
1754
|
1752
|
}
|
1755
|
1753
|
|
1756
|
1754
|
/* Determine handler */
|