/[winpt]/trunk/Src/wptGPG.cpp
ViewVC logotype

Diff of /trunk/Src/wptGPG.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 36 by werner, Thu Oct 27 15:25:13 2005 UTC revision 48 by werner, Mon Oct 31 21:14:11 2005 UTC
# Line 1  Line 1 
1  /* wptGPG.cpp - GnuPG configuration  /* wptGPG.cpp - GnuPG configuration
2   *      Copyright (C) 2001-2004 Timo Schulz   *      Copyright (C) 2001-2005 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
# Line 17  Line 17 
17   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
18   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19   */   */
   
20  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
21  #include <config.h>  #include <config.h>
22  #endif  #endif
23    
24  #include <string.h>  #include <windows.h>
25    #include <shlobj.h>
26  #include <string.h>  #include <string.h>
27  #include <stdio.h>  #include <stdio.h>
 #include <windows.h>  
28  #include <shlobj.h>  #include <shlobj.h>
29  #include <ctype.h>  #include <ctype.h>
30  #include <io.h>  #include <io.h>
31    #include <time.h>
32    
33  #include "wptGPG.h"  #include "wptGPG.h"
34  #include "wptGPGCmds.h"  #include "wptGpgCmds.h"
35  #include "wptGPGOptSkel.h"  #include "wptGPGOptSkel.h"
36  #include "wptTypes.h"  #include "wptTypes.h"
37  #include "wptNLS.h"  #include "wptNLS.h"
# Line 223  default_key_from_cache (int *ret_no_usea Line 223  default_key_from_cache (int *ret_no_usea
223  }  }
224    
225    
226    /* Load the gpg.conf and search for some options
227       and store the result in the global preference context.
228       Return value: 0 on success. */
229    int
230    gnupg_load_config (void)
231    {
232        int rc;
233        gpg_optfile_t opt;
234        gpg_option_t o;
235        char *conf = get_gnupg_cfgfile ();
236        if (!conf)
237            return -1;
238        rc = parse_gpg_options (conf, &opt);
239        if (rc) {
240            free_if_alloc (conf);
241            return -1;
242        }
243        o = find_option (opt, "ask-cert-level");
244        if (o)
245            reg_prefs.gpg.ask_cert_level = 1;
246        release_gpg_options (opt);
247        free_if_alloc (conf);
248        return 0;
249    }
250    
251    
252  char*  char*
253  get_gnupg_default_key (void)  get_gnupg_default_key (void)
254  {      {    
# Line 252  get_gnupg_default_key (void) Line 278  get_gnupg_default_key (void)
278          if( e )          if( e )
279              keyid = m_strdup( e->val );              keyid = m_strdup( e->val );
280      }      }
281      free_if_alloc( optfile );      free_if_alloc (optfile);
282      release_gpg_options( opt );          release_gpg_options (opt);
283    
284      if( !keyid )      if (!keyid)
285          keyid = default_key_from_cache( &no_usable );          keyid = default_key_from_cache (&no_usable);
286      return keyid;      return keyid;
287  } /* get_gnupg_default_key */  } /* get_gnupg_default_key */
288    

Legend:
Removed from v.36  
changed lines
  Added in v.48

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26