core: Check for combination of ssh mode with other mode flags
* src/export.c (check_mode): Return error if ssh mode is combined with another mode flag. -- The SSH mode flag cannot be used in combination with other flags. GnuPG-bug-id: 5757
This commit is contained in:
parent
3268575115
commit
c0581adabe
10
src/export.c
10
src/export.c
@ -128,6 +128,16 @@ check_mode (gpgme_export_mode_t mode, gpgme_protocol_t protocol,
|
|||||||
|GPGME_EXPORT_MODE_PKCS12)))
|
|GPGME_EXPORT_MODE_PKCS12)))
|
||||||
return gpg_error (GPG_ERR_INV_VALUE); /* Invalid flags in MODE. */
|
return gpg_error (GPG_ERR_INV_VALUE); /* Invalid flags in MODE. */
|
||||||
|
|
||||||
|
if ((mode & GPGME_EXPORT_MODE_SSH))
|
||||||
|
{
|
||||||
|
if ((mode & (GPGME_EXPORT_MODE_EXTERN
|
||||||
|
|GPGME_EXPORT_MODE_MINIMAL
|
||||||
|
|GPGME_EXPORT_MODE_SECRET
|
||||||
|
|GPGME_EXPORT_MODE_RAW
|
||||||
|
|GPGME_EXPORT_MODE_PKCS12)))
|
||||||
|
return gpg_error (GPG_ERR_INV_FLAG); /* Combination not allowed. */
|
||||||
|
}
|
||||||
|
|
||||||
if ((mode & GPGME_EXPORT_MODE_SECRET))
|
if ((mode & GPGME_EXPORT_MODE_SECRET))
|
||||||
{
|
{
|
||||||
if ((mode & GPGME_EXPORT_MODE_EXTERN))
|
if ((mode & GPGME_EXPORT_MODE_EXTERN))
|
||||||
|
Loading…
Reference in New Issue
Block a user