@@ -2947,8 +2947,6 @@ srtp_err_status_t srtp_validate_cryptex(void)
29472947    policy .use_cryptex  =  true;
29482948    policy .next  =  NULL ;
29492949
2950-     CHECK_OK (srtp_create (& srtp_snd , & policy ));
2951- 
29522950    for  (size_t  i  =  0 ; i  <  6 ; ++ i ) {
29532951        uint8_t  packet [1400 ];
29542952        uint8_t  reference [1400 ];
@@ -2971,6 +2969,8 @@ srtp_err_status_t srtp_validate_cryptex(void)
29712969         */ 
29722970        debug_print (mod_driver , "test vector: %s\n" , vectors [i ].name );
29732971
2972+         CHECK_OK (srtp_create (& srtp_snd , & policy ));
2973+ 
29742974        CHECK_OK (call_srtp_protect (srtp_snd , packet , & len , 0 ));
29752975        CHECK (len  ==  enc_len );
29762976
@@ -2981,11 +2981,8 @@ srtp_err_status_t srtp_validate_cryptex(void)
29812981
29822982        CHECK_BUFFER_EQUAL (packet , ciphertext , len );
29832983
2984-         /* 
2985-          * create a receiver session context comparable to the one created 
2986-          * above - we need to do this so that the replay checking doesn't 
2987-          * complain 
2988-          */ 
2984+         CHECK_OK (srtp_dealloc (srtp_snd ));
2985+ 
29892986        CHECK_OK (srtp_create (& srtp_recv , & policy ));
29902987
29912988        /* 
@@ -2999,8 +2996,6 @@ srtp_err_status_t srtp_validate_cryptex(void)
29992996        CHECK_OK (srtp_dealloc (srtp_recv ));
30002997    }
30012998
3002-     CHECK_OK (srtp_dealloc (srtp_snd ));
3003- 
30042999    return  srtp_err_status_ok ;
30053000}
30063001
0 commit comments