@@ -91,6 +91,7 @@ IOVBuffer = namedtuple('IOVBuffer', ['type', 'allocate', 'value'])
91
91
92
92
93
93
cdef class IOV:
94
+ """ A GSSAPI IOV"""
94
95
# defined in ext_dce.pxd
95
96
96
97
# cdef int iov_len
@@ -304,24 +305,28 @@ cdef class IOV:
304
305
def wrap_iov (SecurityContext context not None , IOV message not None ,
305
306
confidential = True , qop = None ):
306
307
"""
307
- Wrap/Encrypt an IOV message
308
+ wrap_iov(context, message, confidential=True, qop=None)
309
+ Wrap/Encrypt an IOV message.
308
310
309
311
This method wraps or encrypts an IOV message. The allocate
310
- parameter of the :class:`IOVBuffer` indicates whether or
311
- not that particular buffer should be automatically allocated
312
- (for use with padding, header, and trailer buffers).
312
+ parameter of the :class:`IOVBuffer` objects in the :class:`IOV`
313
+ indicates whether or not that particular buffer should be
314
+ automatically allocated (for use with padding, header, and
315
+ trailer buffers).
316
+
317
+ Warning:
318
+ This modifies the input :class:`IOV`.
313
319
314
320
Args:
315
321
context (SecurityContext): the current security context
316
- message (list ): a list of :class:`IOVBuffer` objects
322
+ message (IOV ): an :class:`IOV` containing the message
317
323
confidential (bool): whether or not to encrypt the message (True),
318
324
or just wrap it with a MIC (False)
319
325
qop (int): the desired Quality of Protection
320
326
(or None for the default QoP)
321
327
322
328
Returns:
323
- WrapResult: the wrapped/encrypted message (IOV list), and
324
- whether or not encryption was actually used
329
+ bool: whether or not confidentiality was actually used
325
330
326
331
Raises:
327
332
GSSError
@@ -348,26 +353,31 @@ def wrap_iov(SecurityContext context not None, IOV message not None,
348
353
349
354
def unwrap_iov (SecurityContext context not None , IOV message not None ):
350
355
"""
351
- Unwrap/Decrypt an IOV message
356
+ unwrap_iov(context, message)
357
+ Unwrap/Decrypt an IOV message.
352
358
353
- This method unwraps or decrypts an IOV message. The allocate
354
- parameter of the :class:`IOVBuffer` indicates whether or
355
- not that particular buffer should be automatically allocated
356
- (for use with padding, header, and trailer buffers).
359
+ This method uwraps or decrypts an IOV message. The allocate
360
+ parameter of the :class:`IOVBuffer` objects in the :class:`IOV`
361
+ indicates whether or not that particular buffer should be
362
+ automatically allocated (for use with padding, header, and
363
+ trailer buffers).
357
364
358
365
As a special case, you may pass an entire IOV message
359
366
as a single 'stream'. In this case, pass a buffer type
360
367
of :attr:`IOVBufferType.stream` followed by a buffer type of
361
368
:attr:`IOVBufferType.data`. The former should contain the
362
369
entire IOV message, while the latter should be empty.
363
370
371
+ Warning:
372
+ This modifies the input :class:`IOV`.
373
+
364
374
Args:
365
375
context (SecurityContext): the current security context
366
- message (list ): a list of :class:`IOVBuffer` objects
376
+ message (IOV ): an :class:`IOV` containing the message
367
377
368
378
Returns:
369
- UnwrapResult: the unwrapped/decrypted message, whether or not
370
- encryption was used, and the QoP used
379
+ IOVUnwrapResult: whether or not confidentiality was used,
380
+ and the QoP used.
371
381
372
382
Raises:
373
383
GSSError
@@ -393,7 +403,8 @@ def unwrap_iov(SecurityContext context not None, IOV message not None):
393
403
def wrap_iov_length (SecurityContext context not None , IOV message not None ,
394
404
confidential = True , qop = None ):
395
405
"""
396
- Appropriately size padding, trailer, and header IOV buffers
406
+ wrap_iov_length(context, message, confidential=True, qop=None)
407
+ Appropriately size padding, trailer, and header IOV buffers.
397
408
398
409
This method sets the length values on the IOV buffers. You
399
410
should already have data provided for the data (and sign-only)
@@ -402,9 +413,12 @@ def wrap_iov_length(SecurityContext context not None, IOV message not None,
402
413
In Python terms, this will result in an appropriately sized
403
414
`bytes` object consisting of all zeros.
404
415
416
+ Warning:
417
+ This modifies the input :class:`IOV`.
418
+
405
419
Args:
406
420
context (SecurityContext): the current security context
407
- message (list ): a list of :class:`IOVBuffer` objects
421
+ message (IOV ): an :class:`IOV` containing the message
408
422
409
423
Returns:
410
424
WrapResult: a list of :class:IOVBuffer` objects, and whether or not
@@ -437,7 +451,8 @@ def wrap_iov_length(SecurityContext context not None, IOV message not None,
437
451
def wrap_aead (SecurityContext context not None , bytes message not None ,
438
452
bytes associated = None , confidential = True , qop = None ):
439
453
"""
440
- Wrap/Encrypt an AEAD Message
454
+ wrap_aead(context, message, associated=None, confidential=True, qop=None)
455
+ Wrap/Encrypt an AEAD message.
441
456
442
457
This method takes an input message and associated data,
443
458
and outputs and AEAD message.
@@ -492,7 +507,8 @@ def wrap_aead(SecurityContext context not None, bytes message not None,
492
507
def unwrap_aead (SecurityContext context not None , bytes message not None ,
493
508
bytes associated = None ):
494
509
"""
495
- Unwrap/Decrypt an AEAD Message
510
+ unwrap_aead(context, message, associated=None)
511
+ Unwrap/Decrypt an AEAD message.
496
512
497
513
This method takes an encrpyted/wrapped AEAD message and some associated
498
514
data, and returns an unwrapped/decrypted message.
0 commit comments