(der_match_tag_and_length): new function

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1345 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-03-10 00:43:36 +00:00
parent 84eca71750
commit e0d6f79eb2

View File

@@ -6,7 +6,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "der.h"
/*
@@ -127,6 +126,29 @@ der_match_tag (unsigned char *p, int len, Der_class class, Der_type type,
return -1;
}
int
der_match_tag_and_length (unsigned char *p, int len,
Der_class class, Der_type type, int tag,
int *length_ret)
{
int ret = 0;
int l;
l = der_match_tag (p, len, class, type, tag);
if (l < 0)
return l;
p += l;
len -= l;
ret += l;
l = der_get_length (p, len, length_ret);
if (l < 0)
return l;
p += l;
len -= l;
ret += l;
return ret;
}
int
decode_integer (unsigned char *p, int len, unsigned *num)
{