Commit cc4d8807 authored by Georges Khaznadar's avatar Georges Khaznadar

moved the changes in gpg.c to a debian patch

parent 123ca6c7
Description: Short IDs should no longer be allowed in gpg.conf
The default-key option must accept IDs when they are 40 digits long at least
--- gnupg2-2.2.5.orig/g10/gpg.c
+++ gnupg2-2.2.5/g10/gpg.c
@@ -2791,6 +2791,15 @@ main (int argc, char **argv)
#endif /*!NO_TRUST_MODELS*/
case oDefaultKey:
+ /* check that the default key is no short ID */
+ if (strlen(pargs.r.ret_str) < 40){
+ /* the value is shorter than a complete ID */
+ /* output a warning, and ignore its value */
+ log_info(_("WARNING: unsafe short ID:"
+ "'%s' will be ignored."
+ " Please use complete IDs\n"), pargs.r.ret_str);
+ break;
+ }
sl = add_to_strlist (&opt.def_secret_key, pargs.r.ret_str);
sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
if (configfp)
......@@ -20,3 +20,4 @@ update-defaults/gpg-Prefer-SHA-512-and-SHA-384-in-personal-digest.patch
from-master/gpg-Fix-comparison.patch
from-master/assuan-Reorganize-waiting-for-socket.patch
from-master/assuan-Use-exponential-decay-for-first-1s-of-spinlock.patch
dontAcceptShortKeys
......@@ -2791,15 +2791,6 @@ main (int argc, char **argv)
#endif /*!NO_TRUST_MODELS*/
case oDefaultKey:
/* check that the default key is no short ID */
if (strlen(pargs.r.ret_str) < 40){
/* the value is shorter than a complete ID */
/* output a warning, and ignore its value */
log_info(_("WARNING: unsafe short ID:"
"'%s' will be ignored."
" Please use complete IDs\n"), pargs.r.ret_str);
break;
}
sl = add_to_strlist (&opt.def_secret_key, pargs.r.ret_str);
sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
if (configfp)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment