** gnutls-serv: Corrected a buffer overflow. Reported and patch by Tomas Mraz.
+** libgnutls: Use ASN1_NULL when writing parameters for RSA signatures.
+This makes us comply with RFC3279. Reported by Michael Rommel.
+
** libgnutls: Reverted default behavior for verification and
introduced GNUTLS_VERIFY_DO_NOT_ALLOW_X509_V1_CA_CRT. Thus by default
V1 trusted CAs are allowed, unless the new flag is specified.
#include <libtasn1.h>
#include <ext_signature.h>
#include <gnutls_state.h>
+#include <x509/common.h>
static int
_gnutls_tls_sign (gnutls_session_t session,
/* Use NULL parameters. */
if ((result = asn1_write_value (di, "digestAlgorithm.parameters",
- "\x05\x00", 2)) != ASN1_SUCCESS)
+ ASN1_NULL, ASN1_NULL_SIZE)) != ASN1_SUCCESS)
{
gnutls_assert ();
asn1_delete_structure (&di);
*/
_gnutls_str_cpy (name, sizeof (name), dst_name);
_gnutls_str_cat (name, sizeof (name), ".algorithm.parameters");
- result = asn1_write_value (dst, name, NULL, 0);
+ result = asn1_write_value (dst, name, ASN1_NULL, ASN1_NULL_SIZE);
if (result != ASN1_SUCCESS)
{
gnutls_assert ();
#define SIG_GOST_R3410_94_OID "1.2.643.2.2.4"
#define SIG_GOST_R3410_2001_OID "1.2.643.2.2.3"
+#define ASN1_NULL "\x05\x00"
+#define ASN1_NULL_SIZE 2
+
int _gnutls_x509_set_time (ASN1_TYPE c2, const char *where, time_t tim);
int _gnutls_x509_decode_octet_string (const char *string_type,
_gnutls_str_cpy (name, sizeof (name), dst_name);
_gnutls_str_cat (name, sizeof (name), ".parameters");
- result = asn1_write_value (dst, name, NULL, 0);
+ if (pk_algorithm == GNUTLS_PK_RSA)
+ result = asn1_write_value (dst, name, ASN1_NULL, ASN1_NULL_SIZE);
+ else
+ result = asn1_write_value (dst, name, NULL, 0);
if (result != ASN1_SUCCESS && result != ASN1_ELEMENT_NOT_FOUND)
{
Regardless of what is correct, this appears to be what most
implementations do. */
result = asn1_write_value (dinfo, "digestAlgorithm.parameters",
- "\x05\x00", 2);
+ ASN1_NULL, ASN1_NULL_SIZE);
if (result != ASN1_SUCCESS)
{
gnutls_assert ();