Compare commits
26 Commits
Author | SHA1 | Date |
---|---|---|
Nikos Mavrogiannopoulos | 5e5786c0d0 | |
Fedora Release Engineering | e87e5f6cfb | |
Simo Sorce | 1b52aeecb7 | |
Simo Sorce | c624abce7a | |
Fedora Release Engineering | 8f2e1258b3 | |
Nikos Mavrogiannopoulos | 46082357c5 | |
Nikos Mavrogiannopoulos | a0c7a41577 | |
Fedora Release Engineering | b2ce513c42 | |
Igor Gnatenko | 43c596d11f | |
Nikos Mavrogiannopoulos | 930215f823 | |
Nikos Mavrogiannopoulos | 2af08181d4 | |
Nikos Mavrogiannopoulos | 00ba0f202e | |
Peter Robinson | 12419dc633 | |
Fedora Release Engineering | a556fc4b52 | |
Fedora Release Engineering | d1518d0bb2 | |
Nikos Mavrogiannopoulos | 032961dd7b | |
Sergey Turivniy | e45c099f06 | |
Fedora Release Engineering | 9bc81da661 | |
Fedora Release Engineering | 01e2474398 | |
Nikos Mavrogiannopoulos | f68e79d83b | |
Fedora Release Engineering | 47170124b6 | |
Nikos Mavrogiannopoulos | d5091c2658 | |
Nikos Mavrogiannopoulos | 2e616e7be9 | |
Peter Robinson | dff5e8bd54 | |
Nikos Mavrogiannopoulos | 447b5eaed8 | |
Nikos Mavrogiannopoulos | 93183ad3f8 |
|
@ -29,4 +29,17 @@ libtasn1-2.7.tar.gz
|
|||
/libtasn1-4.7.tar.gz.sig
|
||||
/libtasn1-4.8.tar.gz.sig
|
||||
/libtasn1-4.8.tar.gz
|
||||
/gpgkey-1F42418905D8206AA754CCDC29EE58B996865171.gpg
|
||||
/libtasn1-4.9.tar.gz.sig
|
||||
/libtasn1-4.9.tar.gz
|
||||
/libtasn1-4.10.tar.gz
|
||||
/libtasn1-4.10.tar.gz.sig
|
||||
/libtasn1-4.12.tar.gz.sig
|
||||
/libtasn1-4.12.tar.gz
|
||||
/libtasn1-4.13.tar.gz.sig
|
||||
/libtasn1-4.13.tar.gz
|
||||
/libtasn1-4.14.tar.gz
|
||||
/libtasn1-4.14.tar.gz.sig
|
||||
/libtasn1-4.15.0.tar.gz
|
||||
/libtasn1-4.15.0.tar.gz.sig
|
||||
/libtasn1-4.16.0.tar.gz
|
||||
/libtasn1-4.16.0.tar.gz.sig
|
||||
|
|
Binary file not shown.
|
@ -1,416 +0,0 @@
|
|||
diff --git a/lib/coding.c b/lib/coding.c
|
||||
index 7821d85..7141df7 100644
|
||||
--- a/lib/coding.c
|
||||
+++ b/lib/coding.c
|
||||
@@ -337,7 +337,7 @@ _asn1_objectid_der (unsigned char *str, unsigned char *der, int *der_len)
|
||||
int len_len, counter, k, first, max_len;
|
||||
char *temp, *n_end, *n_start;
|
||||
unsigned char bit7;
|
||||
- unsigned long val, val1 = 0;
|
||||
+ uint64_t val, val1 = 0;
|
||||
int str_len = _asn1_strlen (str);
|
||||
|
||||
max_len = *der_len;
|
||||
@@ -355,7 +355,7 @@ _asn1_objectid_der (unsigned char *str, unsigned char *der, int *der_len)
|
||||
while ((n_end = strchr (n_start, '.')))
|
||||
{
|
||||
*n_end = 0;
|
||||
- val = strtoul (n_start, NULL, 10);
|
||||
+ val = _asn1_strtou64 (n_start, NULL, 10);
|
||||
counter++;
|
||||
|
||||
if (counter == 1)
|
||||
@@ -369,7 +369,7 @@ _asn1_objectid_der (unsigned char *str, unsigned char *der, int *der_len)
|
||||
else
|
||||
{
|
||||
first = 0;
|
||||
- for (k = 4; k >= 0; k--)
|
||||
+ for (k = sizeof(val); k >= 0; k--)
|
||||
{
|
||||
bit7 = (val >> (k * 7)) & 0x7F;
|
||||
if (bit7 || first || !k)
|
||||
diff --git a/lib/decoding.c b/lib/decoding.c
|
||||
index cfe2322..2cd9ac3 100644
|
||||
--- a/lib/decoding.c
|
||||
+++ b/lib/decoding.c
|
||||
@@ -395,7 +396,7 @@ asn1_get_object_id_der (const unsigned char *der, int der_len, int *ret_len,
|
||||
int len_len, len, k;
|
||||
int leading;
|
||||
char temp[LTOSTR_MAX_SIZE];
|
||||
- unsigned long val, val1;
|
||||
+ uint64_t val, val1;
|
||||
|
||||
*ret_len = 0;
|
||||
if (str && str_size > 0)
|
||||
diff --git a/lib/int.h b/lib/int.h
|
||||
index f1f1302..7d2eea3 100644
|
||||
--- a/lib/int.h
|
||||
+++ b/lib/int.h
|
||||
@@ -118,6 +118,12 @@ extern const tag_and_class_st _asn1_tags[];
|
||||
#define _asn1_strcpy(a,b) strcpy((char *)a, (const char *)b)
|
||||
#define _asn1_strcat(a,b) strcat((char *)a, (const char *)b)
|
||||
|
||||
+#if SIZEOF_UNSIGNED_LONG_INT == 8
|
||||
+# define _asn1_strtou64(n,e,b) strtoul((const char *) n, e, b)
|
||||
+#else
|
||||
+# define _asn1_strtou64(n,e,b) strtoull((const char *) n, e, b)
|
||||
+#endif
|
||||
+
|
||||
#define MAX_LOG_SIZE 1024 /* maximum number of characters of a log message */
|
||||
|
||||
/* Define used for visiting trees. */
|
||||
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
|
||||
index 52700c6..2285b20 100644
|
||||
--- a/lib/parser_aux.c
|
||||
+++ b/lib/parser_aux.c
|
||||
@@ -549,9 +549,9 @@ _asn1_delete_list_and_nodes (void)
|
||||
|
||||
|
||||
char *
|
||||
-_asn1_ltostr (long v, char str[LTOSTR_MAX_SIZE])
|
||||
+_asn1_ltostr (int64_t v, char str[LTOSTR_MAX_SIZE])
|
||||
{
|
||||
- long d, r;
|
||||
+ int64_t d, r;
|
||||
char temp[LTOSTR_MAX_SIZE];
|
||||
int count, k, start;
|
||||
|
||||
diff --git a/lib/parser_aux.h b/lib/parser_aux.h
|
||||
index 10b864b..9f91833 100644
|
||||
--- a/lib/parser_aux.h
|
||||
+++ b/lib/parser_aux.h
|
||||
@@ -54,7 +54,7 @@ void _asn1_delete_list_and_nodes (void);
|
||||
|
||||
/* Max 64-bit integer length is 20 chars + 1 for sign + 1 for null termination */
|
||||
#define LTOSTR_MAX_SIZE 22
|
||||
-char *_asn1_ltostr (long v, char str[LTOSTR_MAX_SIZE]);
|
||||
+char *_asn1_ltostr (int64_t v, char str[LTOSTR_MAX_SIZE]);
|
||||
|
||||
asn1_node _asn1_find_up (asn1_node node);
|
||||
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index d637ce0..379525e 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -54,13 +54,13 @@ MOSTLYCLEANFILES = Test_parser_ERROR.asn
|
||||
check_PROGRAMS = Test_parser Test_tree Test_encoding Test_indefinite \
|
||||
Test_errors Test_simple Test_overflow Test_strings Test_choice \
|
||||
Test_encdec copynode coding-decoding2 strict-der Test_choice_ocsp \
|
||||
- ocsp-basic-response octet-string
|
||||
+ ocsp-basic-response octet-string coding-long-oid object-id-decoding
|
||||
|
||||
TESTS = Test_parser Test_tree Test_encoding Test_indefinite \
|
||||
Test_errors Test_simple Test_overflow crlf threadsafety \
|
||||
Test_strings Test_choice Test_encdec copynode coding-decoding2 \
|
||||
strict-der Test_choice_ocsp decoding decoding-invalid-x509 \
|
||||
- ocsp-basic-response octet-string
|
||||
+ ocsp-basic-response octet-string coding-long-oid object-id-decoding
|
||||
|
||||
TESTS_ENVIRONMENT = \
|
||||
ASN1PARSER=$(srcdir)/Test_parser.asn \
|
||||
diff --git a/tests/coding-long-oid.c b/tests/coding-long-oid.c
|
||||
new file mode 100644
|
||||
index 0000000..bc2cd56
|
||||
--- /dev/null
|
||||
+++ b/tests/coding-long-oid.c
|
||||
@@ -0,0 +1,205 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2016 Free Software Foundation, Inc.
|
||||
+ *
|
||||
+ * This file is part of LIBTASN1.
|
||||
+ *
|
||||
+ * This program is free software: you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation, either version 3 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+#include <libtasn1.h>
|
||||
+
|
||||
+/* This checks the decoding and re-encoding of OIDs which contain elements
|
||||
+ * >= 2^32 bits.
|
||||
+ */
|
||||
+
|
||||
+const unsigned char der_data[] =
|
||||
+ "\x30\x82\x06\xdc\x30\x82\x05\xc4\xa0\x03\x02\x01\x02\x02\x08\x35"
|
||||
+ "\x73\x8c\xaf\x21\xea\xbd\x2d\x30\x0d\x06\x09\x2a\x86\x48\x86\xf7"
|
||||
+ "\x0d\x01\x01\x05\x05\x00\x30\x81\x8e\x31\x0b\x30\x09\x06\x03\x55"
|
||||
+ "\x04\x06\x13\x02\x55\x53\x31\x17\x30\x15\x06\x03\x55\x04\x08\x13"
|
||||
+ "\x0e\x4e\x6f\x72\x74\x68\x20\x43\x61\x72\x6f\x6c\x69\x6e\x61\x31"
|
||||
+ "\x10\x30\x0e\x06\x03\x55\x04\x07\x13\x07\x52\x61\x6c\x65\x69\x67"
|
||||
+ "\x68\x31\x10\x30\x0e\x06\x03\x55\x04\x0a\x13\x07\x4b\x61\x74\x65"
|
||||
+ "\x6c\x6c\x6f\x31\x14\x30\x12\x06\x03\x55\x04\x0b\x13\x0b\x53\x6f"
|
||||
+ "\x6d\x65\x4f\x72\x67\x55\x6e\x69\x74\x31\x2c\x30\x2a\x06\x03\x55"
|
||||
+ "\x04\x03\x13\x23\x73\x61\x74\x2d\x72\x32\x32\x30\x2d\x31\x30\x2e"
|
||||
+ "\x6c\x61\x62\x2e\x65\x6e\x67\x2e\x72\x64\x75\x32\x2e\x72\x65\x64"
|
||||
+ "\x68\x61\x74\x2e\x63\x6f\x6d\x30\x1e\x17\x0d\x31\x36\x30\x37\x30"
|
||||
+ "\x31\x31\x38\x35\x34\x31\x37\x5a\x17\x0d\x34\x39\x31\x32\x30\x31"
|
||||
+ "\x31\x33\x30\x30\x30\x30\x5a\x30\x2b\x31\x29\x30\x27\x06\x03\x55"
|
||||
+ "\x04\x03\x13\x20\x38\x61\x38\x38\x38\x30\x31\x37\x35\x35\x61\x37"
|
||||
+ "\x63\x39\x30\x37\x30\x31\x35\x35\x61\x37\x63\x66\x62\x65\x33\x36"
|
||||
+ "\x30\x30\x30\x34\x30\x82\x01\x22\x30\x0d\x06\x09\x2a\x86\x48\x86"
|
||||
+ "\xf7\x0d\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x00\x30\x82\x01\x0a"
|
||||
+ "\x02\x82\x01\x01\x00\xdc\x70\x8b\x9c\x84\xe9\x3e\x79\x8f\x03\xe5"
|
||||
+ "\x5f\x21\xf0\x29\x9e\xd9\x94\x4e\x0f\x37\x45\x47\x42\xda\x2a\xe0"
|
||||
+ "\xda\xf5\x8b\xfa\xe1\xf8\x62\x51\x14\x9d\x9e\xe0\xc7\x69\xd0\x3d"
|
||||
+ "\xfc\x25\x2f\xb6\x10\x45\xbd\x0d\xbc\x92\x86\x54\xbb\x4e\x7d\xd4"
|
||||
+ "\x92\x75\x65\xba\x48\xa4\x64\xa1\xeb\xf7\xe7\xdc\xc0\xd7\x0a\x5e"
|
||||
+ "\x36\x13\x0e\x4e\x35\xcc\x2c\xc6\xf3\xe7\xe7\xe5\x32\x8a\x0c\xf7"
|
||||
+ "\x47\x28\x7a\x02\xc2\x68\x66\x19\x3a\xba\xca\x31\xe2\xdd\x43\xbe"
|
||||
+ "\x26\x4c\x80\x12\x0c\xae\x44\x40\xeb\x69\x7d\x9e\x58\xd3\xab\xaf"
|
||||
+ "\x69\xe6\x54\xae\x7d\x80\xee\x2c\x10\xe9\xbb\x5e\x6b\x89\x15\x2e"
|
||||
+ "\x2c\x72\x26\xba\x7f\xe5\xa3\x66\xc5\x98\xc6\x57\xbf\x05\x1e\x55"
|
||||
+ "\x93\xa6\x16\x83\xa6\x88\x79\x8f\x4e\xb5\x7e\x70\xeb\xf0\xa9\xa6"
|
||||
+ "\xd5\xf9\x1f\xe6\xab\x70\x06\x43\xe0\xde\x82\xad\x0e\x04\x17\x2b"
|
||||
+ "\x69\x82\x40\x98\x84\x14\x00\x2a\xa2\xda\x61\x7b\x35\xac\x71\x05"
|
||||
+ "\x43\x6f\x55\x3a\x28\x4b\xd1\xa4\xeb\x3b\xf5\x03\xc2\xf8\x3c\xfd"
|
||||
+ "\x0a\xc4\x99\x1d\xa7\x7d\x08\x5c\xd1\x15\x70\x73\xb9\xdc\x5c\xf2"
|
||||
+ "\xfe\x2c\xc6\x21\x8a\xbe\xbd\x52\x37\x64\x04\xe5\x06\x3e\xc6\x62"
|
||||
+ "\xa1\xe9\x8e\xcb\xc1\x02\x03\x01\x00\x01\xa3\x82\x03\x9e\x30\x82"
|
||||
+ "\x03\x9a\x30\x11\x06\x09\x60\x86\x48\x01\x86\xf8\x42\x01\x01\x04"
|
||||
+ "\x04\x03\x02\x05\xa0\x30\x0b\x06\x03\x55\x1d\x0f\x04\x04\x03\x02"
|
||||
+ "\x04\xb0\x30\x81\xc3\x06\x03\x55\x1d\x23\x04\x81\xbb\x30\x81\xb8"
|
||||
+ "\x80\x14\xca\xca\x62\x86\x04\x05\xf0\xf5\x9b\x38\xd2\x2c\x3c\x8c"
|
||||
+ "\x65\x0f\xc6\xba\xa5\x3c\xa1\x81\x94\xa4\x81\x91\x30\x81\x8e\x31"
|
||||
+ "\x0b\x30\x09\x06\x03\x55\x04\x06\x13\x02\x55\x53\x31\x17\x30\x15"
|
||||
+ "\x06\x03\x55\x04\x08\x13\x0e\x4e\x6f\x72\x74\x68\x20\x43\x61\x72"
|
||||
+ "\x6f\x6c\x69\x6e\x61\x31\x10\x30\x0e\x06\x03\x55\x04\x07\x13\x07"
|
||||
+ "\x52\x61\x6c\x65\x69\x67\x68\x31\x10\x30\x0e\x06\x03\x55\x04\x0a"
|
||||
+ "\x13\x07\x4b\x61\x74\x65\x6c\x6c\x6f\x31\x14\x30\x12\x06\x03\x55"
|
||||
+ "\x04\x0b\x13\x0b\x53\x6f\x6d\x65\x4f\x72\x67\x55\x6e\x69\x74\x31"
|
||||
+ "\x2c\x30\x2a\x06\x03\x55\x04\x03\x13\x23\x73\x61\x74\x2d\x72\x32"
|
||||
+ "\x32\x30\x2d\x31\x30\x2e\x6c\x61\x62\x2e\x65\x6e\x67\x2e\x72\x64"
|
||||
+ "\x75\x32\x2e\x72\x65\x64\x68\x61\x74\x2e\x63\x6f\x6d\x82\x09\x00"
|
||||
+ "\xa4\xe7\xca\xeb\xbe\x43\x5d\xcc\x30\x1d\x06\x03\x55\x1d\x0e\x04"
|
||||
+ "\x16\x04\x14\x0e\x8d\x7b\x53\xba\x5a\x9e\x92\x44\xe5\x64\x58\xa1"
|
||||
+ "\xdb\x83\x47\x05\x3e\x32\xd3\x30\x13\x06\x03\x55\x1d\x25\x04\x0c"
|
||||
+ "\x30\x0a\x06\x08\x2b\x06\x01\x05\x05\x07\x03\x02\x30\x2a\x06\x10"
|
||||
+ "\x2b\x06\x01\x04\x01\x92\x08\x09\x01\xaa\xda\xbe\xbe\xfa\x5b\x01"
|
||||
+ "\x04\x16\x0c\x14\x6d\x6f\x72\x64\x6f\x72\x5f\x75\x65\x62\x65\x72"
|
||||
+ "\x5f\x70\x72\x6f\x64\x75\x63\x74\x30\x16\x06\x10\x2b\x06\x01\x04"
|
||||
+ "\x01\x92\x08\x09\x01\xaa\xda\xbe\xbe\xfa\x5b\x03\x04\x02\x0c\x00"
|
||||
+ "\x30\x16\x06\x10\x2b\x06\x01\x04\x01\x92\x08\x09\x01\xaa\xda\xbe"
|
||||
+ "\xbe\xfa\x5b\x02\x04\x02\x0c\x00\x30\x16\x06\x10\x2b\x06\x01\x04"
|
||||
+ "\x01\x92\x08\x09\x01\xaa\xda\xbe\xbe\xfa\x5b\x05\x04\x02\x0c\x00"
|
||||
+ "\x30\x19\x06\x10\x2b\x06\x01\x04\x01\x92\x08\x09\x02\xaa\xda\xbe"
|
||||
+ "\xbe\xfa\x72\x01\x04\x05\x0c\x03\x79\x75\x6d\x30\x24\x06\x11\x2b"
|
||||
+ "\x06\x01\x04\x01\x92\x08\x09\x02\xaa\xda\xbe\xbe\xfa\x72\x01\x01"
|
||||
+ "\x04\x0f\x0c\x0d\x75\x65\x62\x65\x72\x5f\x63\x6f\x6e\x74\x65\x6e"
|
||||
+ "\x74\x30\x32\x06\x11\x2b\x06\x01\x04\x01\x92\x08\x09\x02\xaa\xda"
|
||||
+ "\xbe\xbe\xfa\x72\x01\x02\x04\x1d\x0c\x1b\x31\x34\x36\x37\x33\x39"
|
||||
+ "\x39\x32\x35\x37\x34\x33\x35\x5f\x75\x65\x62\x65\x72\x5f\x63\x6f"
|
||||
+ "\x6e\x74\x65\x6e\x74\x30\x1d\x06\x11\x2b\x06\x01\x04\x01\x92\x08"
|
||||
+ "\x09\x02\xaa\xda\xbe\xbe\xfa\x72\x01\x05\x04\x08\x0c\x06\x43\x75"
|
||||
+ "\x73\x74\x6f\x6d\x30\x1e\x06\x11\x2b\x06\x01\x04\x01\x92\x08\x09"
|
||||
+ "\x02\xaa\xda\xbe\xbe\xfa\x72\x01\x06\x04\x09\x0c\x07\x2f\x6d\x6f"
|
||||
+ "\x72\x64\x6f\x72\x30\x17\x06\x11\x2b\x06\x01\x04\x01\x92\x08\x09"
|
||||
+ "\x02\xaa\xda\xbe\xbe\xfa\x72\x01\x07\x04\x02\x0c\x00\x30\x18\x06"
|
||||
+ "\x11\x2b\x06\x01\x04\x01\x92\x08\x09\x02\xaa\xda\xbe\xbe\xfa\x72"
|
||||
+ "\x01\x08\x04\x03\x0c\x01\x31\x30\x24\x06\x0a\x2b\x06\x01\x04\x01"
|
||||
+ "\x92\x08\x09\x04\x01\x04\x16\x0c\x14\x6d\x6f\x72\x64\x6f\x72\x5f"
|
||||
+ "\x75\x65\x62\x65\x72\x5f\x70\x72\x6f\x64\x75\x63\x74\x30\x10\x06"
|
||||
+ "\x0a\x2b\x06\x01\x04\x01\x92\x08\x09\x04\x02\x04\x02\x0c\x00\x30"
|
||||
+ "\x1d\x06\x0a\x2b\x06\x01\x04\x01\x92\x08\x09\x04\x03\x04\x0f\x0c"
|
||||
+ "\x0d\x31\x34\x36\x37\x33\x39\x39\x32\x35\x37\x34\x33\x35\x30\x11"
|
||||
+ "\x06\x0a\x2b\x06\x01\x04\x01\x92\x08\x09\x04\x05\x04\x03\x0c\x01"
|
||||
+ "\x31\x30\x24\x06\x0a\x2b\x06\x01\x04\x01\x92\x08\x09\x04\x06\x04"
|
||||
+ "\x16\x0c\x14\x32\x30\x31\x36\x2d\x30\x37\x2d\x30\x31\x54\x31\x38"
|
||||
+ "\x3a\x35\x34\x3a\x31\x37\x5a\x30\x24\x06\x0a\x2b\x06\x01\x04\x01"
|
||||
+ "\x92\x08\x09\x04\x07\x04\x16\x0c\x14\x32\x30\x34\x39\x2d\x31\x32"
|
||||
+ "\x2d\x30\x31\x54\x31\x33\x3a\x30\x30\x3a\x30\x30\x5a\x30\x11\x06"
|
||||
+ "\x0a\x2b\x06\x01\x04\x01\x92\x08\x09\x04\x0c\x04\x03\x0c\x01\x30"
|
||||
+ "\x30\x11\x06\x0a\x2b\x06\x01\x04\x01\x92\x08\x09\x04\x0e\x04\x03"
|
||||
+ "\x0c\x01\x30\x30\x11\x06\x0a\x2b\x06\x01\x04\x01\x92\x08\x09\x04"
|
||||
+ "\x0b\x04\x03\x0c\x01\x31\x30\x34\x06\x0a\x2b\x06\x01\x04\x01\x92"
|
||||
+ "\x08\x09\x05\x01\x04\x26\x0c\x24\x39\x34\x35\x33\x66\x38\x65\x36"
|
||||
+ "\x2d\x38\x34\x62\x32\x2d\x34\x38\x32\x65\x2d\x61\x33\x65\x61\x2d"
|
||||
+ "\x30\x31\x63\x33\x62\x33\x65\x32\x36\x36\x61\x35\x30\x0d\x06\x09"
|
||||
+ "\x2a\x86\x48\x86\xf7\x0d\x01\x01\x05\x05\x00\x03\x82\x01\x01\x00"
|
||||
+ "\xf7\x4d\xf3\x30\x53\xcd\x35\xbf\x49\x07\x29\x9b\xf0\x7a\xaa\x49"
|
||||
+ "\x60\xda\xce\x14\x45\xb5\x32\x8f\xda\xc3\xce\x6b\xec\xbf\x20\xc0"
|
||||
+ "\x05\xa3\x3a\x89\xc4\x7d\x66\x34\xfc\xf3\x16\xb8\xf3\x03\xda\xfc"
|
||||
+ "\x82\x4a\xb8\x97\xf8\x67\x3d\xc2\x8c\x78\xb4\x6d\xb8\xbb\x18\xec"
|
||||
+ "\x36\xee\xc4\x28\x79\xda\xfe\xa1\x1f\xaf\x0b\x3f\xe4\x75\xde\x83"
|
||||
+ "\xff\x6b\xf9\x11\x60\x09\x57\xea\x85\x34\xed\x60\xe2\x94\x8b\xd6"
|
||||
+ "\xf2\x21\x9b\xda\x97\x99\xf3\x0d\xa9\x0f\xb5\x3b\x3a\x8f\x96\x8d"
|
||||
+ "\x0b\xdf\x30\x17\x03\xe6\x47\xc3\x71\x32\x09\x18\xbc\xc0\xa9\x83"
|
||||
+ "\x7e\xb7\x5f\x5c\xbb\xeb\x0a\x18\x3f\xa9\x40\x98\xae\x57\xab\x99"
|
||||
+ "\x3d\x47\x1b\x98\x8a\xdc\x6e\x85\xa2\xea\x5e\x21\x80\xa9\xb5\x48"
|
||||
+ "\xc9\x1d\x63\xc1\x1b\xe6\x01\xa1\xbd\x84\x38\x7f\x1a\x43\xa5\xd4"
|
||||
+ "\x7f\x41\x5b\xf6\x88\x33\xb0\xf1\xb8\x8f\xe1\x39\x69\x6f\x60\x13"
|
||||
+ "\xd3\x5d\x70\xde\x95\x0d\x2f\xa9\x89\x6c\xd4\x3a\xeb\x22\x59\xe6"
|
||||
+ "\x31\x67\x71\xa5\xed\xfb\xcb\x20\x11\x0c\x31\x2e\xe0\x98\x9a\x3b"
|
||||
+ "\x9c\x7b\xa2\x74\x6f\x87\x97\xa1\xd9\x82\x7f\x7d\x62\x6b\x45\x6c"
|
||||
+ "\x0b\x5e\x25\x43\x8a\x20\x16\x7d\xe5\x84\x18\x3f\x7c\xda\xfc\xf9";
|
||||
+
|
||||
+int der_data_size = sizeof(der_data)-1;
|
||||
+
|
||||
+char new_data[4*1024];
|
||||
+
|
||||
+int
|
||||
+main (int argc, char** argv)
|
||||
+{
|
||||
+ int result = 0;
|
||||
+ asn1_node definitions = NULL, node1 = NULL;
|
||||
+ char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
|
||||
+ const char *pkixfile = getenv ("ASN1PKIX");
|
||||
+ int new_data_size;
|
||||
+
|
||||
+ if (!pkixfile)
|
||||
+ pkixfile = "pkix.asn";
|
||||
+
|
||||
+ /* Encode */
|
||||
+ result = asn1_parser2tree (pkixfile, &definitions, errorDescription);
|
||||
+ if (result != ASN1_SUCCESS)
|
||||
+ {
|
||||
+ printf ("error in %d\n", __LINE__);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ result = asn1_create_element (definitions, "PKIX1.Certificate", &node1);
|
||||
+ if (result != ASN1_SUCCESS)
|
||||
+ {
|
||||
+ printf ("error in %d\n", __LINE__);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ result = asn1_der_decoding (&node1, der_data, der_data_size, errorDescription);
|
||||
+ if (result != ASN1_SUCCESS)
|
||||
+ {
|
||||
+ printf ("error in %d: %s\n", __LINE__, errorDescription);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ new_data_size = sizeof(new_data);
|
||||
+ result = asn1_der_coding (node1, "", new_data, &new_data_size, errorDescription);
|
||||
+ if (result != ASN1_SUCCESS)
|
||||
+ {
|
||||
+ printf ("error in %d\n", __LINE__);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ if (new_data_size != der_data_size)
|
||||
+ {
|
||||
+ printf ("error in %d\n", __LINE__);
|
||||
+ printf ("new_size is %d, expected: %d\n", new_data_size, der_data_size);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ if (memcmp(new_data, der_data, der_data_size) != 0)
|
||||
+ {
|
||||
+ printf ("error in %d\n", __LINE__);
|
||||
+ exit (1);
|
||||
+ }
|
||||
+
|
||||
+ asn1_delete_structure (&node1);
|
||||
+ asn1_delete_structure (&definitions);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/tests/object-id-decoding.c b/tests/object-id-decoding.c
|
||||
new file mode 100644
|
||||
index 0000000..e3e9669
|
||||
--- /dev/null
|
||||
+++ b/tests/object-id-decoding.c
|
||||
@@ -0,0 +1,89 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2016 Red Hat, Inc.
|
||||
+ *
|
||||
+ * This file is part of LIBTASN1.
|
||||
+ *
|
||||
+ * This program is free software: you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation, either version 3 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+#include "libtasn1.h"
|
||||
+
|
||||
+struct tv
|
||||
+{
|
||||
+ int der_len;
|
||||
+ const unsigned char *der_str;
|
||||
+ const char *oid;
|
||||
+ int expected_error;
|
||||
+};
|
||||
+
|
||||
+static const struct tv tv[] = {
|
||||
+ {.der_len = 12,
|
||||
+ .der_str = (void *) "\x06\x0a\x2b\x06\x01\x04\x01\x92\x08\x09\x05\x01",
|
||||
+ .oid = "1.3.6.1.4.1.2312.9.5.1",
|
||||
+ .expected_error = ASN1_SUCCESS},
|
||||
+ {.der_len = 19,
|
||||
+ .der_str =
|
||||
+ (void *)
|
||||
+ "\x06\x11\x2b\x06\x01\x04\x01\x92\x08\x09\x02\xaa\xda\xbe\xbe\xfa\x72\x01\x07",
|
||||
+ .oid = "1.3.6.1.4.1.2312.9.2.1467399257458.1.7",
|
||||
+ .expected_error = ASN1_SUCCESS},
|
||||
+};
|
||||
+
|
||||
+int
|
||||
+main (int argc, char *argv[])
|
||||
+{
|
||||
+ char str[128];
|
||||
+ int ret, ret_len;
|
||||
+ size_t i;
|
||||
+
|
||||
+ for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++)
|
||||
+ {
|
||||
+ /* decode */
|
||||
+ ret =
|
||||
+ asn1_get_object_id_der (tv[i].der_str+1,
|
||||
+ tv[i].der_len-1, &ret_len, str,
|
||||
+ sizeof (str));
|
||||
+ if (ret != tv[i].expected_error)
|
||||
+ {
|
||||
+ fprintf (stderr,
|
||||
+ "%d: asn1_get_object_id_der iter %lu: got %d expected %d\n",
|
||||
+ __LINE__, (unsigned long) i, ret, tv[i].expected_error);
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ if (ret_len != tv[i].der_len-1)
|
||||
+ {
|
||||
+ fprintf (stderr,
|
||||
+ "%d: iter %lu: error in DER, length returned is %d, had %d\n",
|
||||
+ __LINE__, (unsigned long)i, ret_len, tv[i].der_len-1);
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ if (strcmp (tv[i].oid, str) != 0)
|
||||
+ {
|
||||
+ fprintf (stderr,
|
||||
+ "%d: strcmp iter %lu: got invalid OID: %s, expected: %s\n",
|
||||
+ __LINE__, (unsigned long) i, str, tv[i].oid);
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
126
libtasn1.spec
126
libtasn1.spec
|
@ -1,39 +1,37 @@
|
|||
Summary: The ASN.1 library used in GNUTLS
|
||||
Name: libtasn1
|
||||
Version: 4.8
|
||||
Release: 2%{?dist}
|
||||
Version: 4.16.0
|
||||
Release: 1%{?dist}
|
||||
|
||||
# The libtasn1 library is LGPLv2+, utilities are GPLv3+
|
||||
License: GPLv3+ and LGPLv2+
|
||||
Group: System Environment/Libraries
|
||||
URL: http://www.gnu.org/software/libtasn1/
|
||||
Source0: http://ftp.gnu.org/gnu/libtasn1/%name-%version.tar.gz
|
||||
Source1: http://ftp.gnu.org/gnu/libtasn1/%name-%version.tar.gz.sig
|
||||
Source2: gpgkey-1F42418905D8206AA754CCDC29EE58B996865171.gpg
|
||||
Patch1: libtasn1-3.4-rpath.patch
|
||||
Patch2: libtasn1-4.8-long-oid.patch
|
||||
BuildRequires: bison, pkgconfig
|
||||
|
||||
BuildRequires: gnupg2
|
||||
BuildRequires: gcc
|
||||
BuildRequires: bison, pkgconfig, help2man
|
||||
BuildRequires: autoconf, automake, libtool
|
||||
%ifarch %ix86 x86_64 ppc ppc64
|
||||
BuildRequires: valgrind
|
||||
%endif
|
||||
BuildRequires: valgrind-devel
|
||||
# Wildcard bundling exception https://fedorahosted.org/fpc/ticket/174
|
||||
Provides: bundled(gnulib) = 20130324
|
||||
|
||||
%package devel
|
||||
Summary: Files for development of applications which will use libtasn1
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
Requires: %name = %version-%release
|
||||
Requires: %{name}-tools = %{version}-%{release}
|
||||
Requires: pkgconfig
|
||||
Requires(post): /sbin/install-info
|
||||
Requires(postun): /sbin/install-info
|
||||
|
||||
|
||||
%package tools
|
||||
Summary: Some ASN.1 tools
|
||||
Group: Applications/Text
|
||||
License: GPLv3+
|
||||
Requires: %name = %version-%release
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
|
||||
%description
|
||||
|
@ -56,11 +54,10 @@ gpgv2 --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
|
|||
%setup -q
|
||||
|
||||
%patch1 -p1 -b .rpath
|
||||
%patch2 -p1 -b .long-oid
|
||||
|
||||
%build
|
||||
autoreconf -v -f --install
|
||||
%configure --disable-static --disable-silent-rules --disable-valgrind-tests
|
||||
%configure --disable-static --disable-silent-rules
|
||||
# libtasn1 likes to regenerate docs
|
||||
touch doc/stamp_docs
|
||||
|
||||
|
@ -76,42 +73,85 @@ rm -f $RPM_BUILD_ROOT{%_libdir/*.la,%_infodir/dir}
|
|||
%check
|
||||
make check
|
||||
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
|
||||
%post devel
|
||||
test -f %_infodir/%name.info.gz && \
|
||||
/sbin/install-info --info-dir=%_infodir %_infodir/%name.info || :
|
||||
|
||||
%preun devel
|
||||
test "$1" = 0 -a -f %_infodir/%name.info.gz && \
|
||||
/sbin/install-info --info-dir=%_infodir --delete %_infodir/%name.info || :
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc doc/TODO doc/*.pdf
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING*
|
||||
%doc AUTHORS NEWS README THANKS
|
||||
%_libdir/*.so.6*
|
||||
%license LICENSE doc/COPYING*
|
||||
%doc AUTHORS NEWS README.md
|
||||
%{_libdir}/*.so.6*
|
||||
|
||||
%files tools
|
||||
%defattr(-,root,root,-)
|
||||
%_bindir/asn1*
|
||||
%_mandir/man1/asn1*
|
||||
%{_bindir}/asn1*
|
||||
%{_mandir}/man1/asn1*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%_libdir/*.so
|
||||
%_libdir/pkgconfig/*.pc
|
||||
%_includedir/*
|
||||
%_infodir/*.info.*
|
||||
%_mandir/man3/*asn1*
|
||||
%doc doc/TODO doc/*.pdf
|
||||
%{_libdir}/*.so
|
||||
%{_libdir}/pkgconfig/*.pc
|
||||
%{_includedir}/*
|
||||
%{_infodir}/*.info.*
|
||||
%{_mandir}/man3/*asn1*
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Feb 02 2020 Nikos Mavrogiannopoulos <nmav@redhat.com> - 4.16.0-1
|
||||
- Update to 4.14 (#1621973)
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.15.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Nov 21 2019 Simo Sorce <simo@redhat.com> - 4.15.0-1
|
||||
- Update to 4.15.0 (#1775065)
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.14-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Mon Jul 22 2019 Nikos Mavrogiannopoulos <nmav@redhat.com> - 4.14-1
|
||||
- Update to 4.14 (#1621973)
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.13-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Mon Oct 29 2018 James Antill <james.antill@redhat.com> - 4.13-6
|
||||
- Remove ldconfig scriptlet, now done via. transfiletrigger in glibc.
|
||||
|
||||
* Mon Oct 22 2018 Nikos Mavrogiannopoulos <nmav@redhat.com> - 4.13-5
|
||||
- libtasn1-devel requires the tools subpackage; it is necessary for
|
||||
development.
|
||||
|
||||
* Sat Jul 21 2018 Peter Robinson <pbrobinson@fedoraproject.org> 4.13-4
|
||||
- Add missing gcc/gnupg2 deps, spec cleanups
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.13-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.13-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Wed Jan 17 2018 Nikos Mavrogiannopoulos <nmav@redhat.com> - 4.13-1
|
||||
- Update to 4.13 (#1535261)
|
||||
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.12-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.12-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Mon May 29 2017 Nikos Mavrogiannopoulos <nmav@redhat.com> - 4.12-1
|
||||
- Update to 4.12 (#1456190)
|
||||
|
||||
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.10-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Tue Jan 17 2017 Nikos Mavrogiannopoulos <nmav@redhat.com> - 4.10-1
|
||||
- Update to 4.10 (#1413792)
|
||||
|
||||
* Mon Nov 7 2016 Peter Robinson <pbrobinson@fedoraproject.org> 4.9-2
|
||||
- Move development related docs to devel sub package
|
||||
- Cleanup spec and macros
|
||||
- Update valgrind ExclusiveArch
|
||||
|
||||
* Fri Aug 26 2016 Nikos Mavrogiannopoulos <nmav@redhat.com> - 4.9-1
|
||||
- Update to 4.9 (#1360315)
|
||||
|
||||
* Fri Jul 8 2016 Nikos Mavrogiannopoulos <nmav@redhat.com> - 4.8-2
|
||||
- Resolve issue which prevented the decoding of long OIDs (#1353838)
|
||||
|
||||
|
|
5
sources
5
sources
|
@ -1,3 +1,2 @@
|
|||
140c4dfb1bf77d08fc16d5da9f7b732c libtasn1-4.8.tar.gz.sig
|
||||
9a6767705725544f2b86670dcfb34107 libtasn1-4.8.tar.gz
|
||||
310168e221d6e810022b270e32bf9662 gpgkey-1F42418905D8206AA754CCDC29EE58B996865171.gpg
|
||||
SHA512 (libtasn1-4.16.0.tar.gz) = b356249535d5d592f9b59de39d21e26dd0f3f00ea47c9cef292cdd878042ea41ecbb7c8d2f02ac5839f5210092fe92a25acd343260ddf644887b031b167c2e71
|
||||
SHA512 (libtasn1-4.16.0.tar.gz.sig) = 53254c2ce61e9bb889fe00b43ef2130ab9f122c44832538e3f7b38cb75ada1656213cf5c8c85321078c6b98d325c46eff41ea64d1971d3183f2ec568a18f7ed2
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/libtasn1/Regression/libtasn1-doesn-t-handle-OIDs-which-have-elements
|
||||
# Description: Test for libtasn1 doesn't handle OIDs which have elements
|
||||
# Author: Hubert Kario <hkario@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2016 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/CoreOS/libtasn1/Regression/libtasn1-doesn-t-handle-OIDs-which-have-elements
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Hubert Kario <hkario@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for libtasn1 doesn't handle OIDs which have elements" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 10m" >> $(METADATA)
|
||||
@echo "RunFor: libtasn1" >> $(METADATA)
|
||||
@echo "Requires: libtasn1 libtasn1-tools openssl" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
|
@ -0,0 +1,6 @@
|
|||
PURPOSE of /CoreOS/libtasn1/Regression/libtasn1-doesn-t-handle-OIDs-which-have-elements
|
||||
Description: Test for libtasn1 doesn't handle OIDs which have elements
|
||||
Author: Hubert Kario <hkario@redhat.com>
|
||||
Bug summary: libtasn1 doesn't handle OIDs which have elements of size which exceed 32-bits
|
||||
|
||||
Test that libtasn1 does handle OIDs which have elements of size which exceed 32-bits
|
|
@ -0,0 +1,71 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/libtasn1/Regression/libtasn1-doesn-t-handle-OIDs-which-have-elements
|
||||
# Description: Test for libtasn1 doesn't handle OIDs which have elements
|
||||
# Author: Hubert Kario <hkario@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2016 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/bin/rhts-environment.sh || exit 1
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="libtasn1"
|
||||
|
||||
TOP_DIR="$(rpm --eval=%{_topdir})"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlRun "echo 'PKIX1 { }
|
||||
|
||||
DEFINITIONS IMPLICIT TAGS ::=
|
||||
|
||||
BEGIN
|
||||
|
||||
Dss-Sig-Value ::= SEQUENCE {
|
||||
r OBJECT IDENTIFIER,
|
||||
s INTEGER
|
||||
}
|
||||
END' > pkix.asn"
|
||||
rlRun "echo 'dp PKIX1.Dss-Sig-Value
|
||||
r 1.3.6.1.4.1.2312.9.2.1461701120873.1.6
|
||||
s 255' > assign.asn1"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun -s "asn1Coding pkix.asn assign.asn1"
|
||||
rlAssertGrep "1.3.6.1.4.1.2312.9.2.1461701120873.1.6" $rlRun_LOG
|
||||
rlRun "rm $rlRun_LOG"
|
||||
rlRun -s "openssl asn1parse -in assign.out -inform DER"
|
||||
rlAssertGrep "1.3.6.1.4.1.2312.9.2.1461701120873.1.6" $rlRun_LOG
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
|
@ -0,0 +1,68 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/libtasn1/Sanity/smoke-test
|
||||
# Description: Test calls upstream test suite.
|
||||
# Author: Ondrej Moris <omoris@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/CoreOS/libtasn1/Sanity/smoke-test
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Ondrej Moris <omoris@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test calls upstream test suite." >> $(METADATA)
|
||||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 10m" >> $(METADATA)
|
||||
@echo "RunFor: libtasn1" >> $(METADATA)
|
||||
@echo "Requires: libtasn1" >> $(METADATA)
|
||||
@echo "Requires: libtasn1-devel" >> $(METADATA)
|
||||
@echo "Requires: valgrind" >> $(METADATA)
|
||||
@echo "Requires: nfs-utils" >> $(METADATA)
|
||||
@echo "Requires: rpm-build" >> $(METADATA)
|
||||
@echo "Releases: -RHEL3 -RHEL4 -RHELServer5 -RHELClient5" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
|
@ -0,0 +1,3 @@
|
|||
PURPOSE of /CoreOS/libtasn1/Sanity/smoke-test
|
||||
Description: Test calls upstream test suite.
|
||||
Author: Ondrej Moris <omoris@redhat.com>
|
|
@ -0,0 +1,74 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/libtasn1/Sanity/smoke-test
|
||||
# Description: Test calls upstream test suite.
|
||||
# Author: Ondrej Moris <omoris@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include rhts environment
|
||||
. /usr/bin/rhts-environment.sh || exit 1
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="libtasn1"
|
||||
|
||||
PACKAGES=( "libtasn1" "valgrind" )
|
||||
|
||||
TOPDIR=`rpm --eval %_topdir`
|
||||
|
||||
rlJournalStart
|
||||
|
||||
rlPhaseStartSetup
|
||||
for P in "${PACKAGES[@]}"; do rlAssertRpm $P || rlDie; done
|
||||
rlFetchSrcForInstalled $PACKAGE
|
||||
rlRun "dnf builddep -y libtasn1*.rpm"
|
||||
rlRun "rpm -ihv `ls libtasn1*.rpm`" 0
|
||||
rlRun "rpmbuild -vv -bc $TOPDIR/SPECS/libtasn1.spec" 0
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
|
||||
rlRun "make -C $TOPDIR/BUILD/libtasn1-* check > make_check.out" 0
|
||||
cat make_check.out
|
||||
|
||||
if grep "All [0-9]\+ tests passed" make_check.out; then
|
||||
rlPass "All tests passed -- have seen the old format of test summary in the output"
|
||||
elif grep "Testsuite summary" make_check.out; then
|
||||
TOTAL=`sed -rn 's/^# TOTAL: *([0-9]*).*/\1/p' make_check.out`
|
||||
PASS=`sed -rn 's/^# PASS: *([0-9]*).*/\1/p' make_check.out`
|
||||
rlAssertEquals "The number of tests that ran and passed should be equal" "$TOTAL" "$PASS"
|
||||
else
|
||||
rlFail "Tests reported summary in an unknown way"
|
||||
rlBundleLogs make_check.out
|
||||
fi
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "rm libtasn1*.rpm -rf" 0
|
||||
rlRun "rm $TOPDIR/BUILD/libtasn1-* -rf" 0
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
|
||||
rlJournalEnd
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-beakerlib
|
||||
tags:
|
||||
- classic
|
||||
- container
|
||||
tests:
|
||||
- libtasn1-doesn-t-handle-OIDs-which-have-elements
|
||||
required_packages:
|
||||
- libtasn1
|
||||
- libtasn1-devel
|
||||
- libtasn1-tools
|
||||
- openssl
|
||||
- valgrind
|
||||
- nfs-utils
|
||||
- rpm-build
|
Loading…
Reference in New Issue