summaryrefslogtreecommitdiff
path: root/tests/copynode.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/copynode.c')
-rw-r--r--tests/copynode.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/copynode.c b/tests/copynode.c
index a24f1ce..29a8a51 100644
--- a/tests/copynode.c
+++ b/tests/copynode.c
@@ -46,6 +46,7 @@ main (int argc, char *argv[])
asn1_node asn1_element = NULL, cpy_node = NULL;
char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
FILE *out, *fd;
+ int start, end;
ssize_t size;
int size2;
const char *treefile = getenv ("ASN1PKIX");
@@ -176,6 +177,32 @@ main (int argc, char *argv[])
exit(1);
}
+ result = asn1_der_decoding_startEnd (asn1_element, buffer, size, "tbsCertList.issuer", &start, &end);
+ if (result != ASN1_SUCCESS)
+ {
+ asn1_perror (result);
+ printf ("Cannot find start End\n");
+ exit (1);
+ }
+ if (start != 24 && end != 291)
+ {
+ printf("Error in start and end values for issuer. Have: %d..%d\n", start, end);
+ exit(1);
+ }
+
+ result = asn1_der_decoding_startEnd (asn1_element, buffer, size, "signature", &start, &end);
+ if (result != ASN1_SUCCESS)
+ {
+ asn1_perror (result);
+ printf ("Cannot find start End\n");
+ exit (1);
+ }
+ if (start != 372 && end != 503)
+ {
+ printf("Error in start and end values for signature. Have: %d..%d\n", start, end);
+ exit(1);
+ }
+
/* Clear the definition structures */
asn1_delete_structure (&asn1_element);
asn1_delete_structure (&cpy_node);