aboutsummaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/misc.c')
-rw-r--r--g10/misc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/g10/misc.c b/g10/misc.c
index fee040f86..c5506948a 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -565,3 +565,28 @@ check_compress_algo(int algo)
return G10ERR_COMPR_ALGO;
}
+
+int
+default_cipher_algo(void)
+{
+ if(opt.def_cipher_algo)
+ return opt.def_cipher_algo;
+ else if(opt.personal_cipher_prefs)
+ return opt.personal_cipher_prefs[0].value;
+ else
+ return opt.s2k_cipher_algo;
+}
+
+/* There is no default_digest_algo function, but see
+ sign.c:hash_for */
+
+int
+default_compress_algo(void)
+{
+ if(opt.def_compress_algo!=-1)
+ return opt.def_compress_algo;
+ else if(opt.personal_compress_prefs)
+ return opt.personal_compress_prefs[0].value;
+ else
+ return DEFAULT_COMPRESS_ALGO;
+}