aboutsummaryrefslogtreecommitdiffstats
path: root/g10/sign.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/sign.c')
-rw-r--r--g10/sign.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/g10/sign.c b/g10/sign.c
index 304843f59..7404cac5d 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -108,6 +108,9 @@ only_old_style( SK_LIST sk_list )
SK_LIST sk_rover = NULL;
int old_style = 0;
+ if( opt.force_v3_sigs )
+ return 1;
+
/* if there are only old style capable key we use the old sytle */
for( sk_rover = sk_list; sk_rover; sk_rover = sk_rover->next ) {
PKT_secret_key *sk = sk_rover->sk;
@@ -369,7 +372,7 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
/* build the signature packet */
/* fixme: this code is partly duplicated in make_keysig_packet */
sig = m_alloc_clear( sizeof *sig );
- sig->version = sk->version;
+ sig->version = old_style? 3 : sk->version;
keyid_from_sk( sk, sig->keyid );
sig->digest_algo = hash_for(sk->pubkey_algo);
sig->pubkey_algo = sk->pubkey_algo;
@@ -605,7 +608,7 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile )
/* build the signature packet */
/* fixme: this code is duplicated above */
sig = m_alloc_clear( sizeof *sig );
- sig->version = sk->version;
+ sig->version = old_style? 3 : sk->version;
keyid_from_sk( sk, sig->keyid );
sig->digest_algo = hash_for(sk->pubkey_algo);
sig->pubkey_algo = sk->pubkey_algo;