@@ -1649,15 +1649,18 @@ static int setup_keys(void) {
16491649 state_size = FSPRG_stateinbytes (FSPRG_RECOMMENDED_SECPAR );
16501650 state = alloca_safe (state_size );
16511651
1652- log_info ("Generating seed..." );
1652+ if (!arg_quiet )
1653+ log_info ("Generating seed..." );
16531654 r = crypto_random_bytes (seed , seed_size );
16541655 if (r < 0 )
16551656 return log_error_errno (r , "Failed to acquire random seed: %m" );
16561657
1657- log_info ("Generating key pair..." );
1658+ if (!arg_quiet )
1659+ log_info ("Generating key pair..." );
16581660 FSPRG_GenMK (NULL , mpk , seed , seed_size , FSPRG_RECOMMENDED_SECPAR );
16591661
1660- log_info ("Generating sealing key..." );
1662+ if (!arg_quiet )
1663+ log_info ("Generating sealing key..." );
16611664 FSPRG_GenState0 (state , mpk , seed , seed_size );
16621665
16631666 assert (arg_interval > 0 );
@@ -1672,7 +1675,7 @@ static int setup_keys(void) {
16721675
16731676 r = chattr_secret (fd , CHATTR_WARN_UNSUPPORTED_FLAGS );
16741677 if (r < 0 )
1675- log_full_errno (ERRNO_IS_NOT_SUPPORTED (r ) ? LOG_DEBUG : LOG_WARNING ,
1678+ log_full_errno (ERRNO_IS_NOT_SUPPORTED (r ) || arg_quiet ? LOG_DEBUG : LOG_WARNING ,
16761679 r , "Failed to set file attributes on '%s', ignoring: %m" , k );
16771680
16781681 struct FSSHeader h = {
@@ -1705,7 +1708,7 @@ static int setup_keys(void) {
17051708 if (r < 0 )
17061709 return r ;
17071710
1708- if (on_tty ()) {
1711+ if (on_tty () && ! arg_quiet ) {
17091712 hn = gethostname_malloc ();
17101713 if (hn )
17111714 hostname_cleanup (hn );
@@ -1736,7 +1739,7 @@ static int setup_keys(void) {
17361739
17371740 puts (key );
17381741
1739- if (on_tty ()) {
1742+ if (on_tty () && ! arg_quiet ) {
17401743 fprintf (stderr , "%s" , ansi_normal ());
17411744#if HAVE_QRENCODE
17421745 _cleanup_free_ char * url = NULL ;
0 commit comments