aboutsummaryrefslogtreecommitdiffstats
path: root/security/sscep
diff options
context:
space:
mode:
authormi <mi@FreeBSD.org>2008-05-04 00:40:49 +0800
committermi <mi@FreeBSD.org>2008-05-04 00:40:49 +0800
commit1bbe7e19284e39ddfae1bbcbf2f415eb0b550968 (patch)
tree1661399f057bb17953abd786d4ae0bb83cbd165f /security/sscep
parent09796831ae2c023916fbe56a4d357f3a8b991893 (diff)
downloadfreebsd-ports-gnome-1bbe7e19284e39ddfae1bbcbf2f415eb0b550968.tar.gz
freebsd-ports-gnome-1bbe7e19284e39ddfae1bbcbf2f415eb0b550968.tar.zst
freebsd-ports-gnome-1bbe7e19284e39ddfae1bbcbf2f415eb0b550968.zip
Assure warning-free build even with older OpenSSL-0.9.7, found on 6.x
systems. The c2i_ASN1_INTEGER function there does not explicitly guarantee const-ness of its second argument, unlike on 0.9.8... Notified by: pav
Diffstat (limited to 'security/sscep')
-rw-r--r--security/sscep/files/patch-warnings19
1 files changed, 13 insertions, 6 deletions
diff --git a/security/sscep/files/patch-warnings b/security/sscep/files/patch-warnings
index 3ed2a280d721..4c854a88e093 100644
--- a/security/sscep/files/patch-warnings
+++ b/security/sscep/files/patch-warnings
@@ -160,7 +160,7 @@ Fix a lot of warnings and (what seems to be) two errors...
M_ASN1_I2D_vars(a);
M_ASN1_I2D_len(a->issuer,i2d_X509_NAME);
--- sceputils.c 2006-03-13 06:45:22.000000000 -0500
-+++ sceputils.c 2008-04-29 10:03:02.000000000 -0400
++++ sceputils.c 2008-05-03 12:35:42.000000000 -0400
@@ -48,5 +48,5 @@
*/
int new_selfsigned(struct scep *s) {
@@ -168,28 +168,35 @@ Fix a lot of warnings and (what seems to be) two errors...
+ const unsigned char *ptr;
X509 *cert;
X509_NAME *subject;
-@@ -99,5 +99,5 @@
+@@ -99,6 +99,11 @@
}
/* Get serial no from transaction id */
- ptr = (unsigned char *)s->transaction_id;
+- if (!(serial = c2i_ASN1_INTEGER(NULL, &ptr, 32))) {
+ ptr = (const unsigned char *)s->transaction_id;
- if (!(serial = c2i_ASN1_INTEGER(NULL, &ptr, 32))) {
++#if OPENSSL_VERSION_NUMBER < 0x0090800fL
++# define CAST_CRUTCH (unsigned char **)
++#else
++# define CAST_CRUTCH
++#endif
++ if (!(serial = c2i_ASN1_INTEGER(NULL, CAST_CRUTCH&ptr, 32))) {
fprintf(stderr, "%s: error converting serial\n", pname);
-@@ -231,5 +231,5 @@
+ ERR_print_errors_fp(stderr);
+@@ -231,5 +236,5 @@
/* Assign space for ASCII presentation of the digest */
- str = (unsigned char *)malloc(2 * MD5_DIGEST_LENGTH + 1);
+ str = malloc(2 * MD5_DIGEST_LENGTH + 1); /* XXX this is never freed */
ret = str;
-@@ -246,5 +246,5 @@
+@@ -246,5 +251,5 @@
/* Copy as ASCII string and return: */
for (c = 0; c < MD5_DIGEST_LENGTH; c++, str += 2) {
- sprintf((char *)str, "%02X", md[c]);
+ sprintf(str, "%02X", md[c]);
}
-@@ -252,4 +252,2 @@
+@@ -252,4 +257,2 @@
return(ret);
}
-