| 380 | |
| 381 | |
| 382 | class NullPayloadDecoder(AbstractSimplePayloadDecoder): |
| 383 | protoComponent = univ.Null('') |
| 384 | |
| 385 | def valueDecoder(self, substrate, asn1Spec, |
| 386 | tagSet=None, length=None, state=None, |
| 387 | decodeFun=None, substrateFun=None, |
| 388 | **options): |
| 389 | |
| 390 | if tagSet[0].tagFormat != tag.tagFormatSimple: |
| 391 | raise error.PyAsn1Error('Simple tag format expected') |
| 392 | |
| 393 | for chunk in readFromStream(substrate, length, options): |
| 394 | if isinstance(chunk, SubstrateUnderrunError): |
| 395 | yield chunk |
| 396 | |
| 397 | component = self._createComponent(asn1Spec, tagSet, '', **options) |
| 398 | |
| 399 | if chunk: |
| 400 | raise error.PyAsn1Error('Unexpected %d-octet substrate for Null' % length) |
| 401 | |
| 402 | yield component |
| 403 | |
| 404 | |
| 405 | class ObjectIdentifierPayloadDecoder(AbstractSimplePayloadDecoder): |