@@ -1865,15 +1865,18 @@ static int setup_keys(void) {
18651865 state_size = FSPRG_stateinbytes (FSPRG_RECOMMENDED_SECPAR );
18661866 state = alloca_safe (state_size );
18671867
1868- log_info ("Generating seed..." );
1868+ if (!arg_quiet )
1869+ log_info ("Generating seed..." );
18691870 r = crypto_random_bytes (seed , seed_size );
18701871 if (r < 0 )
18711872 return log_error_errno (r , "Failed to acquire random seed: %m" );
18721873
1873- log_info ("Generating key pair..." );
1874+ if (!arg_quiet )
1875+ log_info ("Generating key pair..." );
18741876 FSPRG_GenMK (NULL , mpk , seed , seed_size , FSPRG_RECOMMENDED_SECPAR );
18751877
1876- log_info ("Generating sealing key..." );
1878+ if (!arg_quiet )
1879+ log_info ("Generating sealing key..." );
18771880 FSPRG_GenState0 (state , mpk , seed , seed_size );
18781881
18791882 assert (arg_interval > 0 );
@@ -1888,7 +1891,7 @@ static int setup_keys(void) {
18881891
18891892 r = chattr_secret (fd , CHATTR_WARN_UNSUPPORTED_FLAGS );
18901893 if (r < 0 )
1891- log_full_errno (ERRNO_IS_NOT_SUPPORTED (r ) ? LOG_DEBUG : LOG_WARNING ,
1894+ log_full_errno (ERRNO_IS_NOT_SUPPORTED (r ) || arg_quiet ? LOG_DEBUG : LOG_WARNING ,
18921895 r , "Failed to set file attributes on '%s', ignoring: %m" , k );
18931896
18941897 struct FSSHeader h = {
@@ -1921,7 +1924,7 @@ static int setup_keys(void) {
19211924 if (r < 0 )
19221925 return r ;
19231926
1924- if (on_tty ()) {
1927+ if (on_tty () && ! arg_quiet ) {
19251928 hn = gethostname_malloc ();
19261929 if (hn )
19271930 hostname_cleanup (hn );
@@ -1952,7 +1955,7 @@ static int setup_keys(void) {
19521955
19531956 puts (key );
19541957
1955- if (on_tty ()) {
1958+ if (on_tty () && ! arg_quiet ) {
19561959 fprintf (stderr , "%s" , ansi_normal ());
19571960#if HAVE_QRENCODE
19581961 _cleanup_free_ char * url = NULL ;
0 commit comments