ObjOpenSSL  Diff

Differences From Artifact [4e292c6da4]:

To Artifact [1bb48d4634]:


237
238
239
240
241
242
243
244
245

246
247
248
249
250
251
252
{
	if (ssl != NULL)
		SSL_shutdown(ssl);

	[super close];
}

- (size_t)_readNBytes: (size_t)length
	   intoBuffer: (void*)buffer

{
	ssize_t ret;

	if (length > INT_MAX)
		@throw [OFOutOfRangeException exceptionWithClass: isa];

	if (sock == INVALID_SOCKET)







<
|
>







237
238
239
240
241
242
243

244
245
246
247
248
249
250
251
252
{
	if (ssl != NULL)
		SSL_shutdown(ssl);

	[super close];
}


- (size_t)_readIntoBuffer: (void*)buffer
		   length: (size_t)length
{
	ssize_t ret;

	if (length > INT_MAX)
		@throw [OFOutOfRangeException exceptionWithClass: isa];

	if (sock == INVALID_SOCKET)
275
276
277
278
279
280
281
282
283

284
285
286
287
288
289
290

	if (ret == 0)
		atEndOfStream = YES;

	return ret;
}

- (void)_writeNBytes: (size_t)length
	  fromBuffer: (const void*)buffer

{
	if (length > INT_MAX)
		@throw [OFOutOfRangeException exceptionWithClass: isa];

	if (sock == INVALID_SOCKET)
		@throw [OFNotConnectedException exceptionWithClass: isa
							    socket: self];







<
|
>







275
276
277
278
279
280
281

282
283
284
285
286
287
288
289
290

	if (ret == 0)
		atEndOfStream = YES;

	return ret;
}


- (void)_writeBuffer: (const void*)buffer
	      length: (size_t)length
{
	if (length > INT_MAX)
		@throw [OFOutOfRangeException exceptionWithClass: isa];

	if (sock == INVALID_SOCKET)
		@throw [OFNotConnectedException exceptionWithClass: isa
							    socket: self];
357
358
359
360
361
362
363
364
365

366
367
368
369
370
371
372
		length = SSL_get_finished(ssl, buffer, 64);
	} else {
		/* peer sent the finished message */
		length = SSL_get_peer_finished(ssl, buffer, 64);
	}

	data = [OFDataArray dataArray];
	[data addNItems: length
	     fromCArray: buffer];


	return data;
}

- (X509Certificate*)peerCertificate
{
	X509 *certificate = SSL_get_peer_certificate(ssl);







<
|
>







357
358
359
360
361
362
363

364
365
366
367
368
369
370
371
372
		length = SSL_get_finished(ssl, buffer, 64);
	} else {
		/* peer sent the finished message */
		length = SSL_get_peer_finished(ssl, buffer, 64);
	}

	data = [OFDataArray dataArray];

	[data addItemsFromCArray: buffer
			   count: length];

	return data;
}

- (X509Certificate*)peerCertificate
{
	X509 *certificate = SSL_get_peer_certificate(ssl);