瀏覽代碼

modules/auth: replace ser_time() wih time()

The values returned by ser_time() deviate so much from time() (and thus
system time) that the module was creating expired nonces in challenges
and rejected valid nonces as being "from the future".

See also FS#243
Alex Hermann 13 年之前
父節點
當前提交
1e1202d3a7
共有 2 個文件被更改,包括 2 次插入4 次删除
  1. 1 2
      modules/auth/challenge.c
  2. 1 2
      modules/auth/nonce.c

+ 1 - 2
modules/auth/challenge.c

@@ -42,7 +42,6 @@
 #include "../../parser/digest/digest.h"
 #include "../../usr_avp.h"
 #include "../../ut.h"
-#include "../../ser_time.h"
 #include "auth_mod.h"
 #include "challenge.h"
 #include "nonce.h"
@@ -200,7 +199,7 @@ int get_challenge_hf(struct sip_msg* msg, int stale, str* realm,
     }
     else {
         l=nonce_len;
-		t=ser_time(0);
+		t=time(0);
 #if defined USE_NC || defined USE_OT_NONCE
 		if (nc_enabled || otn_enabled){
 			pool=nid_get_pool();

+ 1 - 2
modules/auth/nonce.c

@@ -52,7 +52,6 @@
 #include "../../ip_addr.h"
 #include "nonce.h"
 #include "../../globals.h"
-#include "../../ser_time.h"
 #include <assert.h>
 #ifdef USE_NC
 #include "nc.h"
@@ -377,7 +376,7 @@ int check_nonce(auth_body_t* auth, str* secret1, str* secret2,
 		   without prompting for password */
 		return 4;
 	}
-	t=ser_time(0);
+	t=time(0);
 	if (unlikely((since > t) && ((since-t) > nonce_auth_max_drift) )){
 		/* the nonce comes from the future, either because of an external
 		 * time adjustment, or because it was generated by another host