asn1 enums vs values

This commit is contained in:
Kelvin Sherlock 2014-09-02 14:16:40 -04:00
parent 0e7abcf048
commit 6c28aa2a6a
2 changed files with 27 additions and 7 deletions

19
asn1.h Normal file
View File

@ -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
View File

@ -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");