summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2006-05-11 15:58:00 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2006-05-11 15:58:00 +0000
commit32beb645b79b96c0368535c7332fd48cb34073f4 (patch)
tree9af7c6e562f71073f676c2d1fa72c40b05eb9ffb /lib
parentee52b166a1424a17e38478400c7ff05e8e65ce00 (diff)
downloadgnutls-32beb645b79b96c0368535c7332fd48cb34073f4.tar.gz
updated to reflect the new openpgp draft.
Diffstat (limited to 'lib')
-rw-r--r--lib/auth_cert.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/auth_cert.c b/lib/auth_cert.c
index 7acfdef95c..d4bbd85472 100644
--- a/lib/auth_cert.c
+++ b/lib/auth_cert.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation
+ * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
*
* Author: Nikos Mavroyanopoulos
*
@@ -304,7 +304,7 @@ get_issuers_num (gnutls_session_t session, opaque * data, ssize_t data_size)
* using realloc().
*/
- if (gnutls_certificate_type_get (session) != GNUTLS_CRT_X509)
+ if (data_size == 0 || data == NULL)
return 0;
if (data_size > 0)
@@ -1250,16 +1250,15 @@ _gnutls_proc_cert_cert_req (gnutls_session_t session, opaque * data,
return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
}
- if (session->security_parameters.cert_type == GNUTLS_CRT_X509)
- {
- DECR_LEN (dsize, 2);
- size = _gnutls_read_uint16 (p);
- p += 2;
- }
- else
+ /* read the certificate authorities */
+ DECR_LEN (dsize, 2);
+ size = _gnutls_read_uint16 (p);
+ p += 2;
+
+ if (session->security_parameters.cert_type == GNUTLS_CRT_OPENPGP && size != 0)
{
- p = NULL;
- size = 0;
+ gnutls_assert(); // size should be zero
+ return GNUTLS_E_UNEXPECTED_PACKET_LENGTH;
}
DECR_LEN (dsize, size);
@@ -1432,6 +1431,11 @@ _gnutls_gen_cert_server_cert_req (gnutls_session_t session, opaque ** data)
_gnutls_write_datum16 (pdata, cred->x509_rdn_sequence);
/* pdata += cred->x509_rdn_sequence.size + 2; */
}
+ else
+ {
+ _gnutls_write_uint16( pdata, 0);
+ /* pdata+=2; */
+ }
return size;
}