]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
avoid the introduction of a new function to disable replay protection.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 10 Jun 2013 23:04:07 +0000 (01:04 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 10 Jun 2013 23:04:28 +0000 (01:04 +0200)
NEWS
lib/gnutls_dtls.c
lib/gnutls_state.c
lib/includes/gnutls/dtls.h
lib/includes/gnutls/gnutls.h.in
lib/libgnutls.map

diff --git a/NEWS b/NEWS
index 1c1c760fa7aa7fd90e08302ec800ee60908ed944..eaa57086205ff4d46421abcc7df450cf66ac2749 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,9 +10,9 @@ subsystems.
 ** libgnutls: DTLS replay protection can now be disabled.
 
 ** API and ABI modifications:
+GNUTLS_NO_REPLAY_PROTECTION: Added
 gnutls_certificate_set_trust_list: Added
 gnutls_cipher_get_tag_size: Added
-gnutls_record_disable_replay_protection: Added
 gnutls_record_overhead_size: Added
 gnutls_record_overhead_size2: Added
 
index 9455ee7189060f6b1b19829042ce919b2db32945..c29105f88875ee35542b626a21f12eee7963f2d6 100644 (file)
@@ -1082,18 +1082,3 @@ unsigned int gnutls_record_get_discarded (gnutls_session_t session)
 {
   return session->internals.dtls.packets_dropped;
 }
-
-/**
- * gnutls_record_disable_replay_protection:
- * @session: is a #gnutls_session_t structure.
- *
- * This function will disable any replay protection in DTLS mode.
- * That must only used when replay protection is achieved using
- * other means.
- *
- **/
-void
-gnutls_record_disable_replay_protection (gnutls_session_t session)
-{
-  session->internals.no_replay_protection = 1;
-}
index 36169de63a616357a8777d121f5a7bc43f3f32c7..412a1511014c7c0227266ebbb46ee7c6ac29c734 100644 (file)
@@ -292,6 +292,10 @@ _gnutls_handshake_internal_state_clear (gnutls_session_t session)
  * also available. The latter flag will enable a non-blocking
  * operation of the DTLS timers. 
  *
+ * The flag %GNUTLS_NO_REPLAY_PROTECTION will disable any 
+ * replay protection in DTLS mode. That must only used when 
+ * replay protection is achieved using other means.
+ *
  * Note that since version 3.1.2 this function enables some common
  * TLS extensions such as session tickets and OCSP certificate status
  * request in client side by default. To prevent that use the %GNUTLS_NO_EXTENSIONS
@@ -402,6 +406,9 @@ gnutls_init (gnutls_session_t * session, unsigned int flags)
       gnutls_ocsp_status_request_enable_client(*session, NULL, 0, NULL);
     }
 
+  if (flags & GNUTLS_NO_REPLAY_PROTECTION)
+    (*session)->internals.no_replay_protection = 1;
+
   return 0;
 }
 
index 2ee71fc3ca853d813b83f2d7a36932fe8bd54622..ec5782ab8612d1eb1679c663df3c8e142a70ef0e 100644 (file)
@@ -81,8 +81,7 @@ unsigned int gnutls_dtls_get_timeout (gnutls_session_t session);
                                 gnutls_dtls_prestate_st* prestate);
 
   unsigned int gnutls_record_get_discarded (gnutls_session_t session);
-  
-  void gnutls_record_disable_replay_protection (gnutls_session_t session);
 #ifdef __cplusplus
 }
 #endif
index 7010cf01b62df0ab9808c6ddff66487932ecca11..b539b10b4021e48ca88dd8f0151a40ade7744bb8 100644 (file)
@@ -300,6 +300,7 @@ extern "C"
    * @GNUTLS_DATAGRAM: Connection is datagram oriented (DTLS).
    * @GNUTLS_NONBLOCK: Connection should not block (DTLS).
    * @GNUTLS_NO_EXTENSIONS: Do not enable any TLS extensions by default.
+   * @GNUTLS_NO_REPLAY_PROTECTION: Disable any replay protection in DTLS.
    *
    */
 #define GNUTLS_SERVER 1
@@ -307,6 +308,7 @@ extern "C"
 #define GNUTLS_DATAGRAM (1<<2)
 #define GNUTLS_NONBLOCK (1<<3)
 #define GNUTLS_NO_EXTENSIONS (1<<4)
+#define GNUTLS_NO_REPLAY_PROTECTION (1<<5)
 
 /**
  * gnutls_alert_level_t:
index bcee7d447c28b2b138613d94c924727d8ff40256..41b3a8354132516657238fea82b1faf3abf890e6 100644 (file)
@@ -913,7 +913,6 @@ GNUTLS_3_1_0 {
        gnutls_session_set_id;
        gnutls_certificate_set_trust_list;
        gnutls_cipher_get_tag_size;
-       gnutls_record_disable_replay_protection;
        gnutls_record_overhead_size;
        gnutls_record_overhead_size2;
 } GNUTLS_3_0_0;