@@ -1481,7 +1481,7 @@ int test_gssapi_1(bool user_env_file, bool use_cb, bool no_seal)
1481
1481
gss_buffer_desc pwbuf ;
1482
1482
gss_buffer_desc nbuf ;
1483
1483
uint32_t retmin , retmaj ;
1484
- const char * msg = "Sample, signature checking, message." ;
1484
+ const char * msg = "Sample, payload checking, message." ;
1485
1485
gss_buffer_desc message = { strlen (msg ), discard_const (msg ) };
1486
1486
gss_buffer_desc ctx_token ;
1487
1487
gss_OID actual_mech = GSS_C_NO_OID ;
@@ -1494,6 +1494,7 @@ int test_gssapi_1(bool user_env_file, bool use_cb, bool no_seal)
1494
1494
};
1495
1495
uint32_t ssf , expect_ssf ;
1496
1496
uint32_t req_flags ;
1497
+ int conf_state ;
1497
1498
int ret ;
1498
1499
1499
1500
setenv ("NTLM_USER_FILE" , TEST_USER_FILE , 0 );
@@ -1720,24 +1721,62 @@ int test_gssapi_1(bool user_env_file, bool use_cb, bool no_seal)
1720
1721
1721
1722
gss_release_buffer (& retmin , & srv_token );
1722
1723
1723
- retmaj = gssntlm_wrap (& retmin , cli_ctx , 1 , 0 , & message , NULL , & cli_token );
1724
+ retmaj = gssntlm_wrap (& retmin , cli_ctx , 1 , 0 , & message , & conf_state ,
1725
+ & cli_token );
1724
1726
if (retmaj != GSS_S_COMPLETE ) {
1725
1727
print_gss_error ("gssntlm_wrap(cli) failed!" ,
1726
1728
retmaj , retmin );
1727
1729
ret = EINVAL ;
1728
1730
goto done ;
1729
1731
}
1732
+ if (conf_state == 0 ) {
1733
+ fprintf (stderr , "WARN: gssntlm_wrap(cli) returned 0 conf_state!\n" );
1734
+ fflush (stderr );
1735
+ }
1730
1736
1731
1737
retmaj = gssntlm_unwrap (& retmin , srv_ctx ,
1732
- & cli_token , & srv_token , NULL , NULL );
1738
+ & cli_token , & srv_token , & conf_state , NULL );
1733
1739
if (retmaj != GSS_S_COMPLETE ) {
1734
1740
print_gss_error ("gssntlm_unwrap(srv) failed!" ,
1735
1741
retmaj , retmin );
1736
1742
ret = EINVAL ;
1737
1743
goto done ;
1738
1744
}
1745
+ if (conf_state == 0 ) {
1746
+ fprintf (stderr , "WARN: gssntlm_wrap(srv) returned 0 conf_state!\n" );
1747
+ fflush (stderr );
1748
+ }
1739
1749
1740
- if (memcmp (message .value , srv_token .value , srv_token .length ) != 0 ) {
1750
+ gss_release_buffer (& retmin , & cli_token );
1751
+ gss_release_buffer (& retmin , & srv_token );
1752
+
1753
+ retmaj = gssntlm_wrap (& retmin , srv_ctx , 1 , 0 , & message , & conf_state ,
1754
+ & srv_token );
1755
+ if (retmaj != GSS_S_COMPLETE ) {
1756
+ print_gss_error ("gssntlm_wrap(srv) failed!" ,
1757
+ retmaj , retmin );
1758
+ ret = EINVAL ;
1759
+ goto done ;
1760
+ }
1761
+ if (conf_state == 0 ) {
1762
+ fprintf (stderr , "WARN: gssntlm_wrap(srv) returned 0 conf_state!\n" );
1763
+ fflush (stderr );
1764
+ }
1765
+
1766
+ retmaj = gssntlm_unwrap (& retmin , cli_ctx ,
1767
+ & srv_token , & cli_token , & conf_state , NULL );
1768
+ if (retmaj != GSS_S_COMPLETE ) {
1769
+ print_gss_error ("gssntlm_unwrap(cli) failed!" ,
1770
+ retmaj , retmin );
1771
+ ret = EINVAL ;
1772
+ goto done ;
1773
+ }
1774
+ if (conf_state == 0 ) {
1775
+ fprintf (stderr , "WARN: gssntlm_wrap(cli) returned 0 conf_state!\n" );
1776
+ fflush (stderr );
1777
+ }
1778
+
1779
+ if (memcmp (message .value , cli_token .value , cli_token .length ) != 0 ) {
1741
1780
print_gss_error ("sealing and unsealing failed to return the "
1742
1781
"same result" ,
1743
1782
retmaj , retmin );
0 commit comments