summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2011-11-14 15:31:42 +0100
committerSimon Josefsson <simon@josefsson.org>2011-11-14 15:31:42 +0100
commit9ab4cc2da50a248c0cbb5eda54b617dd043d35b7 (patch)
treed783cb9f63b88af5ffe6b14badcbf1316c7498f2 /examples
parent263124f61a84d5b626c1169c2ee2cc66ff30b282 (diff)
downloadlibtasn1-9ab4cc2da50a248c0cbb5eda54b617dd043d35b7.tar.gz
libtasn1-9ab4cc2da50a248c0cbb5eda54b617dd043d35b7.tar.bz2
libtasn1-9ab4cc2da50a248c0cbb5eda54b617dd043d35b7.zip
Silence some warnings.
Diffstat (limited to 'examples')
-rw-r--r--examples/CertificateExample.c16
-rw-r--r--examples/CrlExample.c7
2 files changed, 12 insertions, 11 deletions
diff --git a/examples/CertificateExample.c b/examples/CertificateExample.c
index 12a754f..d5b3a01 100644
--- a/examples/CertificateExample.c
+++ b/examples/CertificateExample.c
@@ -74,13 +74,13 @@ my_ltostr (long v, char *str)
/******************************************************/
static void
get_Name_type (ASN1_TYPE cert_def, ASN1_TYPE cert, const char *root,
- char *answer)
+ unsigned char *ans)
{
int k, k2, result, len;
char name[128], str[1024], str2[1024], name2[128], counter[5], name3[128];
ASN1_TYPE value = ASN1_TYPE_EMPTY;
char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
-
+ char *answer = (char *) ans;
answer[0] = 0;
k = 1;
do
@@ -448,11 +448,11 @@ create_certificate (ASN1_TYPE cert_def, unsigned char *der, int *der_len)
str, 1);
result =
asn1_create_element (cert_def, "PKIX1Implicit88.Dss-Parms", &param);
- str2 = "\xd4\x38"; /* only an example */
+ str2 = (const unsigned char *) "\xd4\x38"; /* only an example */
result = asn1_write_value (param, "p", str2, 128);
- str2 = "\xd4\x38"; /* only an example */
+ str2 = (const unsigned char *) "\xd4\x38"; /* only an example */
result = asn1_write_value (param, "q", str2, 20);
- str2 = "\xd4\x38"; /* only an example */
+ str2 = (const unsigned char *) "\xd4\x38"; /* only an example */
result = asn1_write_value (param, "g", str2, 128);
*der_len = max_len;
result = asn1_der_coding (param, "", der, der_len, errorDescription);
@@ -464,7 +464,7 @@ create_certificate (ASN1_TYPE cert_def, unsigned char *der, int *der_len)
/* subjectPublicKey */
- str2 = "\x02\x81"; /* only an example */
+ str2 = (const unsigned char *) "\x02\x81"; /* only an example */
result =
asn1_write_value (cert1,
"tbsCertificate.subjectPublicKeyInfo.subjectPublicKey",
@@ -505,7 +505,7 @@ create_certificate (ASN1_TYPE cert_def, unsigned char *der, int *der_len)
result =
asn1_write_value (cert1, "tbsCertificate.extensions.?LAST.critical",
"FALSE", 1);
- str2 = "\x04\x14\xe7\x26\xc5"; /* only an example */
+ str2 = (const unsigned char *) "\x04\x14\xe7\x26\xc5"; /* only an example */
result =
asn1_write_value (cert1, "tbsCertificate.extensions.?LAST.extnValue",
str2, 22);
@@ -601,7 +601,7 @@ get_certificate (ASN1_TYPE cert_def, unsigned char *der, int der_len)
result =
asn1_read_value (cert_def, "PKIX1Implicit88.id-dsa-with-sha1", str2,
&len);
- if (!strcmp (str, str2))
+ if (!strcmp ((char *) str, (char *) str2))
{ /* dsa-with-sha */
result = asn1_der_decoding_startEnd (cert2, der, der_len,
diff --git a/examples/CrlExample.c b/examples/CrlExample.c
index 642698a..0c3332d 100644
--- a/examples/CrlExample.c
+++ b/examples/CrlExample.c
@@ -76,12 +76,13 @@ my_ltostr (long v, char *str)
/******************************************************/
static void
get_Name_type (ASN1_TYPE cert_def, ASN1_TYPE cert, const char *root,
- char *answer)
+ unsigned char *ans)
{
int k, k2, result, len;
char name[128], str[1024], str2[1024], name2[128], counter[5], name3[128];
ASN1_TYPE value = ASN1_TYPE_EMPTY;
char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
+ char *answer = (char *) ans;
answer[0] = 0;
k = 1;
@@ -369,7 +370,7 @@ create_CRL (ASN1_TYPE cert_def, unsigned char *der, int *der_len)
asn1_write_value (crl,
"tbsCertList.revokedCertificates.?LAST.crlEntryExtensions.?LAST.critical",
"FALSE", 1);
- str2 = "\x0a\x01\x01";
+ str2 = (const unsigned char *) "\x0a\x01\x01";
result =
asn1_write_value (crl,
"tbsCertList.revokedCertificates.?LAST.crlEntryExtensions.?LAST.extnValue",
@@ -468,7 +469,7 @@ get_CRL (ASN1_TYPE cert_def, unsigned char *der, int der_len)
result =
asn1_read_value (cert_def, "PKIX1Implicit88.id-dsa-with-sha1", str2,
&len);
- if (!strcmp (str, str2))
+ if (!strcmp ((char *) str, (char *) str2))
{ /* dsa-with-sha */
result = asn1_der_decoding_startEnd (crl2, der, der_len,