can now hold only one temporary parameter of a kind.
- Added a new Certificate, CRL, Private key and PKCS7 structures handling
API, defined in gnutls/x509.h
+- Added gnutls_certificate_set_verify_flags() function to allow setting the
+ verification flags in the credentials structure. They will be used in the
+ *verify_peers functions.
+- Added protection against the new TLS 1.0 record layer timing attack.
- Added support for Certificate revocation lists. Functions defined
in gnutls/x509.h
- The only functions were removed are:
/*
- * Copyright (C) 2000,2001,2002,2003 Nikos Mavroyanopoulos
+ * Copyright (C) 2000,2001,2002,2003 Nikos Mavroyanopoulos
*
* This file is part of GNUTLS.
*
uint16 length;
GNUTLS_MAC_HANDLE td;
uint16 blocksize;
- int ret, i;
+ int ret, i, pad_failed = 0;
uint8 major, minor;
gnutls_protocol_version ver;
int hash_size = _gnutls_mac_get_digest_size(session->security_parameters.read_mac_algorithm);
if (pad >
ciphertext.size - hash_size) {
gnutls_assert();
- return GNUTLS_E_DECRYPTION_FAILED;
+ /* We do not fail here. We check below for the
+ * the pad_failed. If zero means success.
+ */
+ pad_failed = GNUTLS_E_DECRYPTION_FAILED;
}
/* Check the pading bytes (TLS 1.0 only)
for (i=2;i<pad;i++) {
if (ciphertext.data[ciphertext.size-i] != ciphertext.data[ciphertext.size - 1]) {
gnutls_assert();
- return GNUTLS_E_DECRYPTION_FAILED;
+ pad_failed = GNUTLS_E_DECRYPTION_FAILED;
}
}
gnutls_assert();
return GNUTLS_E_DECRYPTION_FAILED;
}
+
+ /* This one was introduced to avoid a timing attack against the TLS
+ * 1.0 protocol.
+ */
+ if (pad_failed != 0) return pad_failed;
return length;
}
/*
- * Copyright (C) 2000 Nikos Mavroyanopoulos
+ * Copyright (C) 2000 Nikos Mavroyanopoulos
*
- * This file is part of GNUTLS.
+ * This file is part of GNUTLS.
*
* The GNUTLS library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public