File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,16 @@ static void test_api (unwrap_f unwrap)
4747 "error.text says: %s" ,
4848 error .text );
4949
50+ userid = 0 ;
51+ result = (* unwrap ) (s , false, NULL , & error );
52+ ok (result != NULL && userid == 0 ,
53+ "unwrap_string() works with NULL userid" );
54+ if (result == NULL )
55+ diag ("got error: %s" , error .text );
56+ is (result , "bar" ,
57+ "got expected result" );
58+ free (result );
59+
5060 userid = 0 ;
5161 result = (* unwrap ) (s , false, NULL , NULL );
5262 ok (result != NULL && userid == 0 ,
Original file line number Diff line number Diff line change @@ -76,12 +76,16 @@ char *unwrap_string (const char *s,
7676 int64_t userid64 ;
7777 int flags = verify ? 0 : FLUX_SIGN_NOVERIFY ;
7878
79- if (!(sec = flux_security_create (0 ))
80- || flux_security_configure (sec , NULL ) < 0 ) {
79+ if (!(sec = flux_security_create (0 ))) {
8180 errprintf (errp ,
82- "failed to initialize security context: %s" ,
81+ "failed to create security context: %s" ,
8382 strerror (errno ));
84- return NULL ;
83+ }
84+ if (flux_security_configure (sec , NULL ) < 0 ) {
85+ errprintf (errp ,
86+ "failed to configure security context: %s" ,
87+ flux_security_last_error (sec ));
88+ goto done ;
8589 }
8690 if (flux_sign_unwrap_anymech (sec ,
8791 s ,
You can’t perform that action at this time.
0 commit comments