(data)
| 41 | |
| 42 | |
| 43 | def decodeChallengeSecurityBlob(data): |
| 44 | try: |
| 45 | d, _ = decoder.decode(data, asn1Spec = NegotiationToken()) |
| 46 | nt = d.getComponentByName('negTokenTarg') |
| 47 | |
| 48 | token = nt.getComponentByName('responseToken') |
| 49 | if not token: |
| 50 | raise BadSecurityBlobError('NTLMSSP_CHALLENGE security blob does not contain responseToken field') |
| 51 | |
| 52 | provider_oid = nt.getComponentByName('supportedMech') |
| 53 | if provider_oid and str(provider_oid) != '1.3.6.1.4.1.311.2.2.10': # This OID is defined in [MS-NLMP]: 1.9 |
| 54 | raise UnsupportedSecurityProvider('Security provider "%s" is not supported by pysmb' % str(provider_oid)) |
| 55 | |
| 56 | result = nt.getComponentByName('negResult') |
| 57 | return int(result), token |
| 58 | except Exception as ex: |
| 59 | raise BadSecurityBlobError(str(ex)) |
| 60 | |
| 61 | |
| 62 | def decodeAuthResponseSecurityBlob(data): |
nothing calls this directly
no test coverage detected