(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:
@@ -6,7 +6,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
|
||||||
#include "der.h"
|
#include "der.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -127,6 +126,29 @@ der_match_tag (unsigned char *p, int len, Der_class class, Der_type type,
|
|||||||
return -1;
|
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
|
int
|
||||||
decode_integer (unsigned char *p, int len, unsigned *num)
|
decode_integer (unsigned char *p, int len, unsigned *num)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user