]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Minor fixes. Added documentation for gnutls_certificate_set_openpgp_trustdb() function.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 28 May 2002 10:23:17 +0000 (10:23 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 28 May 2002 10:23:17 +0000 (10:23 +0000)
libextra/gnutls_openpgp.c

index 8a85ff87de706f3f5db37d20f04ea8085b268e53..a08d4136b24e44f4ab63f45fbeeebf0ea9c5b726 100644 (file)
@@ -1490,6 +1490,7 @@ gnutls_certificate_set_openpgp_keyserver(GNUTLS_CERTIFICATE_CREDENTIALS res,
     if (!port)
         port = 11371;
   
+    gnutls_free( res->pgp_key_server);
     res->pgp_key_server = gnutls_strdup( keyserver );
     if ( res->pgp_key_server == NULL)
        return GNUTLS_E_MEMORY_ERROR;
@@ -1499,7 +1500,15 @@ gnutls_certificate_set_openpgp_keyserver(GNUTLS_CERTIFICATE_CREDENTIALS res,
    return 0;
 }
 
-int
+/**
+ * gnutls_certificate_set_openpgp_trustdb - Used to set an GnuPG trustdb
+ * @res: the destination context to save the data.
+ * @trustdb: is the trustdb filename
+ *
+ * This funtion will set a GnuPG trustdb which will be used in key
+ * verification functions. Only version 3 trustdb files are supported.
+ *
+ **/int
 gnutls_certificate_set_openpgp_trustdb( GNUTLS_CERTIFICATE_CREDENTIALS res,
                                         char* trustdb )
 {
@@ -1511,6 +1520,8 @@ gnutls_certificate_set_openpgp_trustdb( GNUTLS_CERTIFICATE_CREDENTIALS res,
            format is still used. We don't support this format. */
         return GNUTLS_E_OPENPGP_TRUSTDB_VERSION_UNSUPPORTED;
     }
+
+    gnutls_free( res->pgp_trustdb);
     res->pgp_trustdb = gnutls_strdup( trustdb );
     if ( res->pgp_trustdb==NULL )
         return GNUTLS_E_MEMORY_ERROR;