asn1 enums vs values
This commit is contained in:
parent
0e7abcf048
commit
6c28aa2a6a
|
@ -0,0 +1,19 @@
|
|||
#ifndef __ASN1_H__
|
||||
#define __ASN1_H__
|
||||
|
||||
enum {
|
||||
ASN1_BOOLEAN = 0x01,
|
||||
ASN1_INTEGER = 0x02,
|
||||
ASN1_BIT_STRING = 0x03,
|
||||
ASN1_OCTECT_STRING = 0x04,
|
||||
ASN1_NULL = 0x05,
|
||||
ASN1_OID = 0x06,
|
||||
ASN1_ENUMERATED = 0x0a,
|
||||
ASN1_SET = 0x31,
|
||||
ASN1_SEQUENCE = 0x30,
|
||||
ASN1_APPLICATION = 0x60,
|
||||
ASN1_CONTEXT = 0xa0
|
||||
|
||||
};
|
||||
|
||||
#endif
|
15
smb.c
15
smb.c
|
@ -23,6 +23,7 @@
|
|||
#include "prototypes.h"
|
||||
#include "smb.h"
|
||||
#include "smb.errors.h"
|
||||
#include "asn1.h"
|
||||
|
||||
static struct smb2_header_sync header;
|
||||
|
||||
|
@ -393,22 +394,22 @@ restart:
|
|||
|
||||
switch(tag)
|
||||
{
|
||||
case 0x30: // sequence
|
||||
case 0x60: // application
|
||||
case ASN1_SEQUENCE: // sequence
|
||||
case ASN1_APPLICATION: // application
|
||||
while (offset < length)
|
||||
offset = scan_asn1(data, offset, length);
|
||||
break;
|
||||
|
||||
case 0xa0:
|
||||
case 0xa1:
|
||||
case 0xa2:
|
||||
case 0xa3:
|
||||
case ASN1_CONTEXT:
|
||||
case ASN1_CONTEXT+1:
|
||||
case ASN1_CONTEXT+2:
|
||||
case ASN1_CONTEXT+3:
|
||||
// jump back to the start?
|
||||
//return scan_asn1(data, offset, length);
|
||||
goto restart;
|
||||
break;
|
||||
|
||||
case 0x06: // oid
|
||||
case ASN1_OID: // oid
|
||||
if (len == 6 && memcmp(data + offset, kSPNEGO, 6) == 0)
|
||||
{
|
||||
//fprintf(stdout, "spnego!\n");
|
||||
|
|
Loading…
Reference in New Issue