Browse Source

Merge branch 'develop'

master
Damien Goutte-Gattat 3 years ago
parent
commit
cfb144ecc7
  1. 4
      .gitignore
  2. 14
      configure.ac
  3. 14
      info/gfsecret.texi
  4. 28
      lib/strchrnul.c
  5. 16
      m4/notch.m4
  6. 26
      po/fr.po
  7. 7
      src/gfsec-split.c
  8. 1
      src/secret.c
  9. 1
      src/util.c

4
.gitignore

@ -17,16 +17,20 @@ stamp-*
src/*.o
src/.deps
src/gfsec-use
src/gfsec-split
src/gfsec-split-gpg
lib/*.o
lib/.deps
lib/lib*.a
info/*.info
info/version.texi
man/*.1
# Gettext-generated files
po/Makefile.in.in
po/Rules-quot
po/gfsecret.pot
po/POTFILES
po/*.sed
po/*.header
po/*.sin

14
configure.ac

@ -28,13 +28,15 @@ PKG_CHECK_MODULES([LIBGFSHARE], [libgfshare])
dnl Check for LibMTP
PKG_CHECK_MODULES([LIBMTP], [libmtp],
[AC_DEFINE([HAVE_LIBMTP], [1], [Define if libmtp is present.])],
[])
[AC_DEFINE([HAVE_LIBMTP], [1], [Define if libmtp is present.])
have_libmtp=yes],
[have_libmtp=no])
dnl Check for GIO
PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.22],
[AC_DEFINE([HAVE_GIO], [1], [Define if gio-2.0 is present.])],
[])
[AC_DEFINE([HAVE_GIO], [1], [Define if gio-2.0 is present.])
have_gio=yes],
[have_gio=no])
dnl Set max size for secret
AC_ARG_ENABLE([max-size],
@ -54,6 +56,7 @@ AC_DEFINE_UNQUOTED([GFSEC_SECRET_MAX_SIZE], [$max_secret_size],
dnl I18N support
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.19.8)
AH_BOTTOM([#ifdef ENABLE_NLS
#include <libintl.h>
#define _(a) gettext(a)
@ -80,5 +83,8 @@ Configuration complete
Prefix: '${prefix}'
Compiler: '${CC} ${CFLAGS} ${CPPFLAGS}'
MTP support: ${have_libmtp}
GIO support: ${have_gio}
Secret max size: ${max_secret_size_string}
"

14
info/gfsecret.texi

@ -108,7 +108,7 @@ sticks, and to temporarily reconstruct the original file when needed.
Gfsecret comprises two programs: @command{gfsec-split} splits a secret
file into shares and dispatches them, leaving behind a configuration
file describing the location of the shares; @command{fgsec-use} reads
file describing the location of the shares; @command{gfsec-use} reads
the configuration file left by @command{gfsec-split}, attempts to fetch
the shares, and reconstructs the secret file if enough shares are
available. If the reconstruction is successful, @command{gfsec-use}
@ -252,7 +252,7 @@ which must exist beforehand.
@node Interactive Selection of Shares
@section Interactive Selection of Shares
To avoid manually specifying the share URIs, use the @option{-i}
To avoid manually specifying the share URIs, use the option @option{-i}
(@option{--interactive}). You will then be presented with an interactive
menu with the available devices:
@ -322,16 +322,16 @@ execute any program specified at the end of the command line. When the
shell, or the user-specified program, terminates, the reconstructed file
is deleted again.
The @option{-k} (@option{--keep}) prevents @command{gfsec-use} from
deleting the reconstructed file. As a special case, if this option is
used and there is no user-specified command to execute,
The option @option{-k} (@option{--keep}) prevents @command{gfsec-use}
from deleting the reconstructed file. As a special case, if this option
is used and there is no user-specified command to execute,
@command{gfsec-use} will not spawn a new shell, but exits as soon as the
file is reconstructed.
The reconstructed file is normally written at the location of the
original file (or any other location specified by the @option{OUTFILE}
key in the configuration file). It may be written elsewhere by using the
@option{-o} (@option{--output}).
option @option{-o} (@option{--output}).
Instead of writing the reconstructed secret to a file,
@command{gfsec-use} may also call an user-specified command and send the
@ -487,7 +487,7 @@ the keygrip of her key and to export it from the GnuPG keyring. All she
has to do is to run the following command:
@example
$ gfsec-split-use -c master -u alice \
$ gfsec-split-gpg -c master -u alice \
file:///home/alice/.local/share/gfsecret/master-key \
label://USBKEY/master-key \
mtp://RF2GB6X704P/Documents/master-key

28
lib/strchrnul.c

@ -0,0 +1,28 @@
/*
* strchrnul - Incenp.org Notch Library: strchrnul replacement
* Copyright (C) 2011 Damien Goutte-Gattat
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
char *
strchrnul(const char *s, int c)
{
char *p = (char *)s;
while ( *p != c && *p != '\0' )
p += 1;
return p;
}

16
m4/notch.m4

@ -0,0 +1,16 @@
dnl ICP_CHECK_NOTCH_FUNCS
dnl Check for various functions that may not be present
dnl everywhere, and for which we provide a replacement.
dnl
AC_DEFUN([ICP_CHECK_NOTCH_FUNCS],[
AC_CHECK_HEADERS([err.h], [], [AC_CONFIG_LINKS([err.h:lib/err.compat.h])])
AC_REPLACE_FUNCS([err strchrnul])
AC_CHECK_DECLS([program_invocation_short_name], [],
[AC_CHECK_FUNCS([getprogname setprogname], [],
[AC_LIBOBJ([progname])])],
[#include <errno.h>
])
AC_CHECK_DECLS([P_tmpdir])
AH_BOTTOM([#include <compat.h>
])
])

26
po/fr.po

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gfsecret 0.4.3\n"
"Report-Msgid-Bugs-To: devel@incenp.org\n"
"POT-Creation-Date: 2017-07-25 16:56+0200\n"
"POT-Creation-Date: 2018-04-22 23:57+0100\n"
"PO-Revision-Date: 2017-07-25 17:15+0200\n"
"Last-Translator: Damien Goutte-Gattat <dgouttegattat@incenp.org>\n"
"Language-Team: French\n"
@ -22,7 +22,7 @@ msgid ""
"Split the specified file for later use with gfsec-use.\n"
msgstr ""
"Utilisation : gfsec-split [options] fichier uri...\n"
"Fragmente le fichier spécifié pour une reconstitutation\n"
"Fragmente le fichier spécifié pour une reconstitution\n"
"ultérieure avec gfsec-use.\n"
#: src/gfsec-split.c:48 src/gfsec-use.c:51
@ -142,7 +142,7 @@ msgstr "Votre choix ?"
msgid "Specify a pathname on this support:"
msgstr "Spécifiez un nom complet de fichier sur ce périphérique :"
#: src/gfsec-split.c:177 src/gfsec-split.c:304 src/gfsec-split.c:376
#: src/gfsec-split.c:177 src/gfsec-split.c:304 src/gfsec-split.c:379
#, c-format
msgid "Cannot add share: %s"
msgstr "Impossible d’ajouter le fragment : %s"
@ -158,9 +158,9 @@ msgstr ""
#: src/gfsec-split.c:212
msgid "Proceed (y/N)?"
msgstr "Conitnuer (y/N)?"
msgstr "Continuer (y/N) ?"
#: src/gfsec-split.c:213
#: src/gfsec-split.c:213 src/gfsec-split.c:371
msgid "Split cancelled"
msgstr "Fragmentation annulée"
@ -182,30 +182,34 @@ msgstr "Fichier secret introuvable"
msgid "Configuration file %s already exists"
msgstr "Le fichier de configuration %s existe déjà"
#: src/gfsec-split.c:372
#: src/gfsec-split.c:370
msgid "Overwrite (y/N)?"
msgstr "Écraser (y/N) ?"
#: src/gfsec-split.c:375
#, c-format
msgid "Cannot set secret: %s"
msgstr "Impossible d’obtenir le secret : %s"
#: src/gfsec-split.c:383
#: src/gfsec-split.c:386
#, c-format
msgid "Cannot split secret: %s"
msgstr "Impossible de fragmenter le secret : %s"
#: src/gfsec-split.c:392
#: src/gfsec-split.c:395
msgid "Cannot write share"
msgstr "Impossible d’écrire le fragment"
#: src/gfsec-split.c:396
#: src/gfsec-split.c:399
#, c-format
msgid "Cannot write configuration file: %s"
msgstr "Impossible d’écrire le fichier de configuration : %s"
#: src/gfsec-split.c:405
#: src/gfsec-split.c:408
msgid "Delete command terminated anormally"
msgstr "La commande de suppression s’est terminée anormalement"
#: src/gfsec-split.c:409
#: src/gfsec-split.c:412
msgid "Cannot delete original file"
msgstr "Fichier de configuration introuvable"

7
src/gfsec-split.c

@ -365,8 +365,11 @@ main(int argc, char **argv)
secret_file = argv[optind++];
transform_config_pathname(&config_path, secret_file);
if ( file_exists(config_path) != -1 )
errx(EXIT_FAILURE, _("Configuration file %s already exists"), config_path);
if ( file_exists(config_path) != -1 ) {
warn(_("Configuration file %s already exists"), config_path);
if ( ! ask_confirmation(_("Overwrite (y/N)?")) )
errx(EXIT_FAILURE, _("Split cancelled"));
}
if ( (c = gfsec_secret_set_secret_file(cfg, secret_file, output_file)) != 0 )
errx(EXIT_FAILURE, _("Cannot set secret: %s"), gfsec_error_string(c));

1
src/secret.c

@ -26,6 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <gcrypt.h>
#include <libgfshare.h>

1
src/util.c

@ -24,6 +24,7 @@
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>

Loading…
Cancel
Save