Line
Link Here
|
0 |
-- a/guile/src/core.c |
0 |
++ b/guile/src/core.c |
Lines 3364-3374
Link Here
|
3364 |
#include "core.x" |
3364 |
#include "core.x" |
3365 |
|
3365 |
|
3366 |
/* Use Guile's allocation routines, which will run the GC if need be. */ |
3366 |
/* Use Guile's allocation routines, which will run the GC if need be. */ |
3367 |
gnutls_malloc = scm_malloc; |
|
|
3368 |
gnutls_realloc = scm_realloc; |
3369 |
gnutls_secure_malloc = scm_malloc; |
3370 |
gnutls_free = free; |
3371 |
|
3372 |
(void) gnutls_global_init (); |
3367 |
(void) gnutls_global_init (); |
3373 |
|
3368 |
|
3374 |
scm_gnutls_define_enums (); |
3369 |
scm_gnutls_define_enums (); |
3375 |
-- a/tests/cert-tests/aki |
3370 |
++ b/tests/cert-tests/aki |
Lines 25-33
Link Here
|
25 |
srcdir=${srcdir:-.} |
25 |
srcdir=${srcdir:-.} |
26 |
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT} |
26 |
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT} |
27 |
DIFF=${DIFF:-diff} |
27 |
DIFF=${DIFF:-diff} |
|
|
28 |
if ! test -z "${VALGRIND}";then |
29 |
VALGRIND="libtool --mode=execute ${VALGRIND}" |
30 |
fi |
28 |
|
31 |
|
29 |
$CERTTOOL --certificate-info --infile $srcdir/aki-cert.pem \ |
32 |
$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/aki-cert.pem \ |
30 |
|grep -v "Algorithm Security Level" > tmp-aki.pem |
33 |
|grep -v "Algorithm Security Level" > tmp-aki.pem |
|
|
34 |
rc=$? |
35 |
|
36 |
if test "$rc" != "0"; then |
37 |
echo "info failed" |
38 |
exit $rc |
39 |
fi |
40 |
|
31 |
|
41 |
|
32 |
$DIFF $srcdir/aki-cert.pem tmp-aki.pem |
42 |
$DIFF $srcdir/aki-cert.pem tmp-aki.pem |
33 |
rc=$? |
43 |
rc=$? |
34 |
-- a/tests/cert-tests/pathlen |
44 |
++ b/tests/cert-tests/pathlen |
Lines 25-35
Link Here
|
25 |
srcdir=${srcdir:-.} |
25 |
srcdir=${srcdir:-.} |
26 |
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT} |
26 |
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT} |
27 |
DIFF=${DIFF:-diff} |
27 |
DIFF=${DIFF:-diff} |
|
|
28 |
if ! test -z "${VALGRIND}";then |
29 |
VALGRIND="libtool --mode=execute ${VALGRIND}" |
30 |
fi |
28 |
|
31 |
|
29 |
$CERTTOOL --certificate-info --infile $srcdir/ca-no-pathlen.pem \ |
32 |
$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/ca-no-pathlen.pem \ |
30 |
|grep -v "Algorithm Security Level" > new-ca-no-pathlen.pem |
33 |
|grep -v "Algorithm Security Level" > new-ca-no-pathlen.pem |
31 |
$CERTTOOL --certificate-info --infile $srcdir/no-ca-or-pathlen.pem \ |
34 |
rc=$? |
|
|
35 |
|
36 |
if test "$rc" != "0"; then |
37 |
echo "info 1 failed" |
38 |
exit $rc |
39 |
fi |
40 |
|
41 |
$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/no-ca-or-pathlen.pem \ |
32 |
|grep -v "Algorithm Security Level" > new-no-ca-or-pathlen.pem |
42 |
|grep -v "Algorithm Security Level" > new-no-ca-or-pathlen.pem |
|
|
43 |
rc=$? |
44 |
|
45 |
if test "$rc" != "0"; then |
46 |
echo "info 2 failed" |
47 |
exit $rc |
48 |
fi |
33 |
|
49 |
|
34 |
$DIFF $srcdir/ca-no-pathlen.pem new-ca-no-pathlen.pem |
50 |
$DIFF $srcdir/ca-no-pathlen.pem new-ca-no-pathlen.pem |
35 |
rc1=$? |
51 |
rc1=$? |
36 |
-- a/tests/cert-tests/pem-decoding |
52 |
++ b/tests/cert-tests/pem-decoding |
Lines 25-33
Link Here
|
25 |
srcdir=${srcdir:-.} |
25 |
srcdir=${srcdir:-.} |
26 |
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT} |
26 |
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT} |
27 |
DIFF=${DIFF:-diff} |
27 |
DIFF=${DIFF:-diff} |
|
|
28 |
if ! test -z "${VALGRIND}";then |
29 |
VALGRIND="libtool --mode=execute ${VALGRIND}" |
30 |
fi |
28 |
|
31 |
|
29 |
#check whether "funny" spaces can be interpreted |
32 |
#check whether "funny" spaces can be interpreted |
30 |
$CERTTOOL --certificate-info --infile $srcdir/funny-spacing.pem >/dev/null 2>&1 |
33 |
$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/funny-spacing.pem >/dev/null 2>&1 |
31 |
rc=$? |
34 |
rc=$? |
32 |
|
35 |
|
33 |
# We're done. |
36 |
# We're done. |
Lines 37-43
Link Here
|
37 |
fi |
40 |
fi |
38 |
|
41 |
|
39 |
#check whether a BMPString attribute can be properly decoded |
42 |
#check whether a BMPString attribute can be properly decoded |
40 |
$CERTTOOL --certificate-info --infile $srcdir/bmpstring.pem >tmp-pem.pem |
43 |
$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/bmpstring.pem >tmp-pem.pem |
41 |
rc=$? |
44 |
rc=$? |
42 |
|
45 |
|
43 |
if test "$rc" != "0"; then |
46 |
if test "$rc" != "0"; then |
Lines 56-62
Link Here
|
56 |
fi |
59 |
fi |
57 |
|
60 |
|
58 |
#check whether complex-cert is decoded as expected |
61 |
#check whether complex-cert is decoded as expected |
59 |
$CERTTOOL --certificate-info --infile $srcdir/complex-cert.pem >tmp-pem.pem |
62 |
$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/complex-cert.pem >tmp-pem.pem |
60 |
rc=$? |
63 |
rc=$? |
61 |
|
64 |
|
62 |
if test "$rc" != "0"; then |
65 |
if test "$rc" != "0"; then |
Lines 75-81
Link Here
|
75 |
fi |
78 |
fi |
76 |
|
79 |
|
77 |
#check whether the cert with many othernames is decoded as expected |
80 |
#check whether the cert with many othernames is decoded as expected |
78 |
$CERTTOOL --certificate-info --infile $srcdir/xmpp-othername.pem >tmp-pem.pem |
81 |
$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/xmpp-othername.pem >tmp-pem.pem |
79 |
rc=$? |
82 |
rc=$? |
80 |
|
83 |
|
81 |
if test "$rc" != "0"; then |
84 |
if test "$rc" != "0"; then |
82 |
-- a/lib/x509/x509.c |
85 |
++ b/lib/x509/x509.c |
Lines 847-853
Link Here
|
847 |
inline static int is_type_printable(int type) |
847 |
inline static int is_type_printable(int type) |
848 |
{ |
848 |
{ |
849 |
if (type == GNUTLS_SAN_DNSNAME || type == GNUTLS_SAN_RFC822NAME || |
849 |
if (type == GNUTLS_SAN_DNSNAME || type == GNUTLS_SAN_RFC822NAME || |
850 |
type == GNUTLS_SAN_URI || type == GNUTLS_SAN_OTHERNAME_XMPP) |
850 |
type == GNUTLS_SAN_URI || type == GNUTLS_SAN_OTHERNAME_XMPP || |
|
|
851 |
type == GNUTLS_SAN_OTHERNAME) |
851 |
return 1; |
852 |
return 1; |
852 |
else |
853 |
else |
853 |
return 0; |
854 |
return 0; |
854 |
-- a/lib/x509/output.c |
855 |
++ b/lib/x509/output.c |
Lines 724-735
Link Here
|
724 |
{ |
724 |
{ |
725 |
unsigned int altname_idx; |
725 |
unsigned int altname_idx; |
726 |
gnutls_datum_t t; |
726 |
gnutls_datum_t t; |
|
|
727 |
char *buffer; |
728 |
size_t size; |
729 |
int err; |
727 |
|
730 |
|
728 |
for (altname_idx = 0;; altname_idx++) { |
731 |
for (altname_idx = 0;; altname_idx++) { |
729 |
char *buffer = NULL; |
|
|
730 |
size_t size = 0; |
731 |
int err; |
732 |
|
732 |
|
|
|
733 |
buffer = NULL; |
734 |
size = 0; |
733 |
if (altname_type == TYPE_CRT_SAN) |
735 |
if (altname_type == TYPE_CRT_SAN) |
734 |
err = |
736 |
err = |
735 |
gnutls_x509_crt_get_subject_alt_name(cert.crt, |
737 |
gnutls_x509_crt_get_subject_alt_name(cert.crt, |
Lines 771-784
Link Here
|
771 |
return; |
773 |
return; |
772 |
} |
774 |
} |
773 |
|
775 |
|
774 |
if (altname_type == TYPE_CRT_SAN) |
776 |
if (altname_type == TYPE_CRT_SAN) { |
775 |
err = |
777 |
err = |
776 |
gnutls_x509_crt_get_subject_alt_name(cert.crt, |
778 |
gnutls_x509_crt_get_subject_alt_name(cert.crt, |
777 |
altname_idx, |
779 |
altname_idx, |
778 |
buffer, |
780 |
buffer, |
779 |
&size, |
781 |
&size, |
780 |
NULL); |
782 |
NULL); |
781 |
else if (altname_type == TYPE_CRQ_SAN) |
783 |
} else if (altname_type == TYPE_CRQ_SAN) { |
782 |
err = |
784 |
err = |
783 |
gnutls_x509_crq_get_subject_alt_name(cert.crq, |
785 |
gnutls_x509_crq_get_subject_alt_name(cert.crq, |
784 |
altname_idx, |
786 |
altname_idx, |
Lines 786-799
Link Here
|
786 |
&size, |
788 |
&size, |
787 |
NULL, |
789 |
NULL, |
788 |
NULL); |
790 |
NULL); |
789 |
else if (altname_type == TYPE_CRT_IAN) |
791 |
} else if (altname_type == TYPE_CRT_IAN) { |
790 |
err = |
792 |
err = |
791 |
gnutls_x509_crt_get_issuer_alt_name(cert.crt, |
793 |
gnutls_x509_crt_get_issuer_alt_name(cert.crt, |
792 |
altname_idx, |
794 |
altname_idx, |
793 |
buffer, |
795 |
buffer, |
794 |
&size, |
796 |
&size, |
795 |
NULL); |
797 |
NULL); |
796 |
|
798 |
} |
797 |
if (err < 0) { |
799 |
if (err < 0) { |
798 |
gnutls_free(buffer); |
800 |
gnutls_free(buffer); |
799 |
addf(str, |
801 |
addf(str, |