73 lines
2.0 KiB
Diff
73 lines
2.0 KiB
Diff
|
From 33bcca8303cad962606df3bfc6a031a9b0626375 Mon Sep 17 00:00:00 2001
|
||
|
From: Peter Jones <pjones@redhat.com>
|
||
|
Date: Thu, 21 Apr 2016 10:47:34 -0400
|
||
|
Subject: [PATCH 01/29] cms: kill generate_integer(), it doesn't build on i686
|
||
|
and it's unused.
|
||
|
|
||
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||
|
---
|
||
|
src/cms_common.c | 34 ----------------------------------
|
||
|
src/cms_common.h | 1 -
|
||
|
2 files changed, 35 deletions(-)
|
||
|
|
||
|
diff --git a/src/cms_common.c b/src/cms_common.c
|
||
|
index b19bc62..6a4e6a7 100644
|
||
|
--- a/src/cms_common.c
|
||
|
+++ b/src/cms_common.c
|
||
|
@@ -641,40 +641,6 @@ generate_string(cms_context *cms, SECItem *der, char *str)
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
-static SEC_ASN1Template IntegerTemplate[] = {
|
||
|
- {.kind = SEC_ASN1_INTEGER,
|
||
|
- .offset = 0,
|
||
|
- .sub = NULL,
|
||
|
- .size = sizeof(long),
|
||
|
- },
|
||
|
- { 0 },
|
||
|
-};
|
||
|
-
|
||
|
-int
|
||
|
-generate_integer(cms_context *cms, SECItem *der, unsigned long integer)
|
||
|
-{
|
||
|
- void *ret;
|
||
|
-
|
||
|
- uint32_t u32;
|
||
|
-
|
||
|
- SECItem input = {
|
||
|
- .data = (void *)&integer,
|
||
|
- .len = sizeof(integer),
|
||
|
- .type = siUnsignedInteger,
|
||
|
- };
|
||
|
-
|
||
|
- if (integer < 0x100000000) {
|
||
|
- u32 = integer & 0xffffffffUL;
|
||
|
- input.data = (void *)&u32;
|
||
|
- input.len = sizeof(u32);
|
||
|
- }
|
||
|
-
|
||
|
- ret = SEC_ASN1EncodeItem(cms->arena, der, &input, IntegerTemplate);
|
||
|
- if (ret == NULL)
|
||
|
- cmsreterr(-1, cms, "could not encode data");
|
||
|
- return 0;
|
||
|
-}
|
||
|
-
|
||
|
int
|
||
|
generate_time(cms_context *cms, SECItem *encoded, time_t when)
|
||
|
{
|
||
|
diff --git a/src/cms_common.h b/src/cms_common.h
|
||
|
index 7d77faf..c7d7268 100644
|
||
|
--- a/src/cms_common.h
|
||
|
+++ b/src/cms_common.h
|
||
|
@@ -117,7 +117,6 @@ extern int generate_object_id(cms_context *ctx, SECItem *encoded,
|
||
|
SECOidTag tag);
|
||
|
extern int generate_empty_sequence(cms_context *ctx, SECItem *encoded);
|
||
|
extern int generate_time(cms_context *ctx, SECItem *encoded, time_t when);
|
||
|
-extern int generate_integer(cms_context *cms, SECItem *der, unsigned long integer);
|
||
|
extern int generate_string(cms_context *cms, SECItem *der, char *str);
|
||
|
extern int wrap_in_set(cms_context *cms, SECItem *der, SECItem **items);
|
||
|
extern int wrap_in_seq(cms_context *cms, SECItem *der,
|
||
|
--
|
||
|
2.13.4
|
||
|
|