doc/
2002-12-24 Marcus Brinkmann <marcus@g10code.de> * gpgme.texi (Verify): Drop R_STAT argument in gpgme_op_verify. * gpgme.texi (Decrypt and Verify): Likewise for gpgme_op_decrypt_verify. gpgme/ 2002-12-24 Marcus Brinkmann <marcus@g10code.de> * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT argument. * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT argument. * verify.c (gpgme_op_verify): Drop R_STAT argument. (_gpgme_intersect_stati): Function removed. * ops.h (_gpgme_intersect_stati): Remove prototype. tests/ 2002-12-24 Marcus Brinkmann <marcus@g10code.de> * gpgsm/t-verify.c (main): Adjust caller of gpgme_op_verify. * gpg/t-verify.c (main): Likewise. * gpg/t-decrypt-verify.c (main): Likewise for gpgme_op_decrypt_verify.
This commit is contained in:
parent
1491938785
commit
b6e5bb310e
7
NEWS
7
NEWS
@ -3,9 +3,14 @@ Noteworthy changes in version 0.4.1 (unreleased)
|
|||||||
|
|
||||||
* GPGME_ATTR_IS_SECRET is not anymore representable as a string.
|
* GPGME_ATTR_IS_SECRET is not anymore representable as a string.
|
||||||
|
|
||||||
|
* gpgme_op_verify and gpgme_op_decrypt_verify don't return a status
|
||||||
|
summary anymore. Use gpgme_get_sig_status to retrieve the individual stati.
|
||||||
|
|
||||||
* Interface changes relative to the 0.4.0 release:
|
* Interface changes relative to the 0.4.0 release:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
gpgme_key_get_string_attr CHANGED: Don't handle GPGME_ATR_IS_SECRET.
|
gpgme_key_get_string_attr CHANGED: Don't handle GPGME_ATTR_IS_SECRET.
|
||||||
|
gpgme_op_verify CHANGED: Drop R_STAT argument.
|
||||||
|
gpgme_op_decrypt_verify CHANGED: Drop R_STAT argument.
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Noteworthy changes in version 0.4.0 (2002-12-23)
|
Noteworthy changes in version 0.4.0 (2002-12-23)
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2002-12-24 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
* gpgme.texi (Verify): Drop R_STAT argument in gpgme_op_verify.
|
||||||
|
* gpgme.texi (Decrypt and Verify): Likewise for
|
||||||
|
gpgme_op_decrypt_verify.
|
||||||
|
|
||||||
2002-12-23 Marcus Brinkmann <marcus@g10code.de>
|
2002-12-23 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
* gpgme.texi (Information About Keys): Document that
|
* gpgme.texi (Information About Keys): Document that
|
||||||
|
@ -2466,7 +2466,7 @@ have a different status. You can get each key's status with
|
|||||||
@end deftp
|
@end deftp
|
||||||
|
|
||||||
|
|
||||||
@deftypefun GpgmeError gpgme_op_verify (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{sig}}, @w{GpgmeData @var{signed_text}}, @w{GpgmeData @var{plain}}, @w{GpgmeSigStat *@var{r_stat}})
|
@deftypefun GpgmeError gpgme_op_verify (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{sig}}, @w{GpgmeData @var{signed_text}}, @w{GpgmeData @var{plain}})
|
||||||
The function @code{gpgme_op_verify} verifies that the signature in the
|
The function @code{gpgme_op_verify} verifies that the signature in the
|
||||||
data object @var{sig} is a valid signature. If @var{sig} is a
|
data object @var{sig} is a valid signature. If @var{sig} is a
|
||||||
detached signature, then the signed text should be provided in
|
detached signature, then the signed text should be provided in
|
||||||
@ -2476,7 +2476,6 @@ Otherwise, if @var{sig} is a normal (or cleartext) signature,
|
|||||||
writable data object that will contain the plaintext after successful
|
writable data object that will contain the plaintext after successful
|
||||||
verification.
|
verification.
|
||||||
|
|
||||||
The combined status of all signatures is returned in @var{r_stat}.
|
|
||||||
The results of the individual signature verifications can be retrieved
|
The results of the individual signature verifications can be retrieved
|
||||||
with @code{gpgme_get_sig_status} and @code{gpgme_get_sig_key}.
|
with @code{gpgme_get_sig_status} and @code{gpgme_get_sig_key}.
|
||||||
|
|
||||||
@ -2658,11 +2657,11 @@ The function returns a string if the notation data is available or
|
|||||||
@cindex signature check
|
@cindex signature check
|
||||||
@cindex cryptographic operation, decryption and verification
|
@cindex cryptographic operation, decryption and verification
|
||||||
|
|
||||||
@deftypefun GpgmeError gpgme_op_decrypt_verify (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{cipher}}, @w{GpgmeData @var{plain}}, @w{GpgmeSigStat *@var{r_stat}})
|
@deftypefun GpgmeError gpgme_op_decrypt_verify (@w{GpgmeCtx @var{ctx}}, @w{GpgmeData @var{cipher}}, @w{GpgmeData @var{plain}})
|
||||||
The function @code{gpgme_op_decrypt_verify} decrypts the ciphertext in
|
The function @code{gpgme_op_decrypt_verify} decrypts the ciphertext in
|
||||||
the data object @var{cipher} and stores it into the data object
|
the data object @var{cipher} and stores it into the data object
|
||||||
@var{plain}. If @var{cipher} contains signatures, they will be
|
@var{plain}. If @var{cipher} contains signatures, they will be
|
||||||
verified and their combined status will be returned in @var{r_stat}.
|
verified.
|
||||||
|
|
||||||
After the operation completed, @code{gpgme_op_get_sig_status} and
|
After the operation completed, @code{gpgme_op_get_sig_status} and
|
||||||
@code{gpgme_op_get_sig_key} can be used to retrieve more information
|
@code{gpgme_op_get_sig_key} can be used to retrieve more information
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2002-12-24 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
* gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
|
||||||
|
argument.
|
||||||
|
* decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
|
||||||
|
argument.
|
||||||
|
* verify.c (gpgme_op_verify): Drop R_STAT argument.
|
||||||
|
(_gpgme_intersect_stati): Function removed.
|
||||||
|
* ops.h (_gpgme_intersect_stati): Remove prototype.
|
||||||
|
|
||||||
2002-12-24 Marcus Brinkmann <marcus@g10code.de>
|
2002-12-24 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
* libgpgme.vers: New file.
|
* libgpgme.vers: New file.
|
||||||
|
@ -1,25 +1,26 @@
|
|||||||
/* decrypt-verify.c - decrypt and verify functions
|
/* decrypt-verify.c - decrypt and verify functions
|
||||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||||
* Copyright (C) 2001, 2002 g10 Code GmbH
|
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||||
*
|
|
||||||
* This file is part of GPGME.
|
|
||||||
*
|
|
||||||
* GPGME 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 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GPGME 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
This file is part of GPGME.
|
||||||
|
|
||||||
|
GPGME 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 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
GPGME 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 GPGME; if not, write to the Free Software Foundation,
|
||||||
|
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -59,23 +60,16 @@ gpgme_op_decrypt_verify_start (GpgmeCtx ctx, GpgmeData ciph, GpgmeData plain)
|
|||||||
* Return value: 0 on success or an errorcode.
|
* Return value: 0 on success or an errorcode.
|
||||||
**/
|
**/
|
||||||
GpgmeError
|
GpgmeError
|
||||||
gpgme_op_decrypt_verify (GpgmeCtx ctx,
|
gpgme_op_decrypt_verify (GpgmeCtx ctx, GpgmeData in, GpgmeData out)
|
||||||
GpgmeData in, GpgmeData out,
|
|
||||||
GpgmeSigStat *r_stat)
|
|
||||||
{
|
{
|
||||||
GpgmeError err;
|
GpgmeError err;
|
||||||
|
|
||||||
gpgme_data_release (ctx->notation);
|
gpgme_data_release (ctx->notation);
|
||||||
ctx->notation = NULL;
|
ctx->notation = NULL;
|
||||||
|
|
||||||
*r_stat = GPGME_SIG_STAT_NONE;
|
|
||||||
err = _gpgme_decrypt_start (ctx, 1, in, out,
|
err = _gpgme_decrypt_start (ctx, 1, in, out,
|
||||||
decrypt_verify_status_handler);
|
decrypt_verify_status_handler);
|
||||||
if (!err)
|
if (!err)
|
||||||
{
|
err = _gpgme_wait_one (ctx);
|
||||||
err = _gpgme_wait_one (ctx);
|
|
||||||
if (!err)
|
|
||||||
*r_stat = _gpgme_intersect_stati (ctx->result.verify);
|
|
||||||
}
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -707,8 +707,7 @@ GpgmeError gpgme_op_decrypt (GpgmeCtx ctx,
|
|||||||
GpgmeError gpgme_op_decrypt_verify_start (GpgmeCtx ctx,
|
GpgmeError gpgme_op_decrypt_verify_start (GpgmeCtx ctx,
|
||||||
GpgmeData cipher, GpgmeData plain);
|
GpgmeData cipher, GpgmeData plain);
|
||||||
GpgmeError gpgme_op_decrypt_verify (GpgmeCtx ctx,
|
GpgmeError gpgme_op_decrypt_verify (GpgmeCtx ctx,
|
||||||
GpgmeData cipher, GpgmeData plain,
|
GpgmeData cipher, GpgmeData plain);
|
||||||
GpgmeSigStat *r_status);
|
|
||||||
|
|
||||||
/* Sign the plaintext PLAIN and store the signature in SIG. Only
|
/* Sign the plaintext PLAIN and store the signature in SIG. Only
|
||||||
detached signatures are supported for now. */
|
detached signatures are supported for now. */
|
||||||
@ -723,8 +722,7 @@ GpgmeError gpgme_op_sign (GpgmeCtx ctx,
|
|||||||
GpgmeError gpgme_op_verify_start (GpgmeCtx ctx, GpgmeData sig,
|
GpgmeError gpgme_op_verify_start (GpgmeCtx ctx, GpgmeData sig,
|
||||||
GpgmeData signed_text, GpgmeData plaintext);
|
GpgmeData signed_text, GpgmeData plaintext);
|
||||||
GpgmeError gpgme_op_verify (GpgmeCtx ctx, GpgmeData sig,
|
GpgmeError gpgme_op_verify (GpgmeCtx ctx, GpgmeData sig,
|
||||||
GpgmeData signed_text, GpgmeData plaintext,
|
GpgmeData signed_text, GpgmeData plaintext);
|
||||||
GpgmeSigStat *r_status);
|
|
||||||
|
|
||||||
/* Import the key in KEYDATA into the keyring. */
|
/* Import the key in KEYDATA into the keyring. */
|
||||||
GpgmeError gpgme_op_import_start (GpgmeCtx ctx, GpgmeData keydata);
|
GpgmeError gpgme_op_import_start (GpgmeCtx ctx, GpgmeData keydata);
|
||||||
|
@ -84,7 +84,6 @@ GpgmeError _gpgme_op_reset (GpgmeCtx ctx, int synchronous);
|
|||||||
|
|
||||||
/*-- verify.c --*/
|
/*-- verify.c --*/
|
||||||
void _gpgme_release_verify_result (VerifyResult result);
|
void _gpgme_release_verify_result (VerifyResult result);
|
||||||
GpgmeSigStat _gpgme_intersect_stati (VerifyResult result);
|
|
||||||
void _gpgme_verify_status_handler (GpgmeCtx ctx, GpgmeStatusCode code,
|
void _gpgme_verify_status_handler (GpgmeCtx ctx, GpgmeStatusCode code,
|
||||||
char *args);
|
char *args);
|
||||||
|
|
||||||
|
@ -406,26 +406,11 @@ gpgme_op_verify_start (GpgmeCtx ctx, GpgmeData sig, GpgmeData signed_text,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Figure out a common status value for all signatures. */
|
|
||||||
GpgmeSigStat
|
|
||||||
_gpgme_intersect_stati (VerifyResult result)
|
|
||||||
{
|
|
||||||
GpgmeSigStat status = result->status;
|
|
||||||
|
|
||||||
for (result = result->next; result; result = result->next)
|
|
||||||
{
|
|
||||||
if (status != result->status)
|
|
||||||
return GPGME_SIG_STAT_DIFF;
|
|
||||||
}
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gpgme_op_verify:
|
* gpgme_op_verify:
|
||||||
* @c: the context
|
* @c: the context
|
||||||
* @sig: the signature data
|
* @sig: the signature data
|
||||||
* @text: the signed text
|
* @text: the signed text
|
||||||
* @r_stat: returns the status of the signature
|
|
||||||
*
|
*
|
||||||
* Perform a signature check on the signature given in @sig. If @text
|
* Perform a signature check on the signature given in @sig. If @text
|
||||||
* is a new and uninitialized data object, it is assumed that @sig
|
* is a new and uninitialized data object, it is assumed that @sig
|
||||||
@ -435,6 +420,34 @@ _gpgme_intersect_stati (VerifyResult result)
|
|||||||
* If @text is initialized, it is assumed that @sig is a detached
|
* If @text is initialized, it is assumed that @sig is a detached
|
||||||
* signature for the material given in @text.
|
* signature for the material given in @text.
|
||||||
*
|
*
|
||||||
|
* Return value: 0 on success or an errorcode if something not related to
|
||||||
|
* the signature itself did go wrong.
|
||||||
|
**/
|
||||||
|
GpgmeError
|
||||||
|
gpgme_op_verify (GpgmeCtx ctx, GpgmeData sig, GpgmeData signed_text,
|
||||||
|
GpgmeData plaintext)
|
||||||
|
{
|
||||||
|
GpgmeError err;
|
||||||
|
|
||||||
|
gpgme_data_release (ctx->notation);
|
||||||
|
ctx->notation = NULL;
|
||||||
|
|
||||||
|
err = _gpgme_op_verify_start (ctx, 1, sig, signed_text, plaintext);
|
||||||
|
if (!err)
|
||||||
|
err = _gpgme_wait_one (ctx);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gpgme_get_sig_status:
|
||||||
|
* @c: Context
|
||||||
|
* @idx: Index of the signature starting at 0
|
||||||
|
* @r_stat: Returns the status
|
||||||
|
* @r_created: Returns the creation timestamp
|
||||||
|
*
|
||||||
|
* Return information about an already verified signatures.
|
||||||
|
*
|
||||||
* The result of this operation is returned in @r_stat which can take these
|
* The result of this operation is returned in @r_stat which can take these
|
||||||
* values:
|
* values:
|
||||||
* GPGME_SIG_STAT_NONE: No status - should not happen
|
* GPGME_SIG_STAT_NONE: No status - should not happen
|
||||||
@ -449,41 +462,6 @@ _gpgme_intersect_stati (VerifyResult result)
|
|||||||
* GPGME_SIG_STAT_GOOD_EXP: The signature is good but has expired.
|
* GPGME_SIG_STAT_GOOD_EXP: The signature is good but has expired.
|
||||||
* GPGME_SIG_STAT_GOOD_KEYEXP: The signature is good but the key has expired.
|
* GPGME_SIG_STAT_GOOD_KEYEXP: The signature is good but the key has expired.
|
||||||
*
|
*
|
||||||
* Return value: 0 on success or an errorcode if something not related to
|
|
||||||
* the signature itself did go wrong.
|
|
||||||
**/
|
|
||||||
GpgmeError
|
|
||||||
gpgme_op_verify (GpgmeCtx ctx, GpgmeData sig, GpgmeData signed_text,
|
|
||||||
GpgmeData plaintext, GpgmeSigStat *r_stat)
|
|
||||||
{
|
|
||||||
GpgmeError err;
|
|
||||||
|
|
||||||
if (!r_stat)
|
|
||||||
return mk_error (Invalid_Value);
|
|
||||||
|
|
||||||
gpgme_data_release (ctx->notation);
|
|
||||||
ctx->notation = NULL;
|
|
||||||
|
|
||||||
*r_stat = GPGME_SIG_STAT_NONE;
|
|
||||||
err = _gpgme_op_verify_start (ctx, 1, sig, signed_text, plaintext);
|
|
||||||
if (!err)
|
|
||||||
{
|
|
||||||
err = _gpgme_wait_one (ctx);
|
|
||||||
if (!err && ctx->result.verify)
|
|
||||||
*r_stat = _gpgme_intersect_stati (ctx->result.verify);
|
|
||||||
}
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gpgme_get_sig_status:
|
|
||||||
* @c: Context
|
|
||||||
* @idx: Index of the signature starting at 0
|
|
||||||
* @r_stat: Returns the status
|
|
||||||
* @r_created: Returns the creation timestamp
|
|
||||||
*
|
|
||||||
* Return information about an already verified signatures.
|
|
||||||
*
|
*
|
||||||
* Return value: The fingerprint or NULL in case of an problem or
|
* Return value: The fingerprint or NULL in case of an problem or
|
||||||
* when there are no more signatures.
|
* when there are no more signatures.
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2002-12-24 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
* gpgsm/t-verify.c (main): Adjust caller of gpgme_op_verify.
|
||||||
|
* gpg/t-verify.c (main): Likewise.
|
||||||
|
* gpg/t-decrypt-verify.c (main): Likewise for
|
||||||
|
gpgme_op_decrypt_verify.
|
||||||
|
|
||||||
2002-12-23 Marcus Brinkmann <marcus@g10code.de>
|
2002-12-23 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
* gpgsm/Makefile.am (./gpgsm.conf): Add a faked system time to
|
* gpgsm/Makefile.am (./gpgsm.conf): Add a faked system time to
|
||||||
|
@ -1,23 +1,22 @@
|
|||||||
/* t-decrypt-verify.c - regression test
|
/* t-decrypt-verify.c - regression test
|
||||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||||
* Copyright (C) 2001 g10 Code GmbH
|
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||||
*
|
|
||||||
* This file is part of GPGME.
|
This file is part of GPGME.
|
||||||
*
|
|
||||||
* GPGME is free software; you can redistribute it and/or modify
|
GPGME is free software; you can redistribute it and/or modify it
|
||||||
* it under the terms of the GNU General Public License as published by
|
under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
(at your option) any later version.
|
||||||
*
|
|
||||||
* GPGME is distributed in the hope that it will be useful,
|
GPGME is distributed in the hope that it will be useful, but
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* GNU General Public License for more details.
|
General Public License for more details.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
along with GPGME; if not, write to the Free Software Foundation,
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -102,7 +101,7 @@ main (int argc, char **argv)
|
|||||||
GpgmeData in, out, pwdata = NULL;
|
GpgmeData in, out, pwdata = NULL;
|
||||||
struct passphrase_cb_info_s info;
|
struct passphrase_cb_info_s info;
|
||||||
const char *cipher_2_asc = mk_fname ("cipher-2.asc");
|
const char *cipher_2_asc = mk_fname ("cipher-2.asc");
|
||||||
GpgmeSigStat stat;
|
GpgmeSigStat status;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -124,15 +123,20 @@ main (int argc, char **argv)
|
|||||||
err = gpgme_data_new (&out);
|
err = gpgme_data_new (&out);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
|
||||||
err = gpgme_op_decrypt_verify (ctx, in, out, &stat);
|
err = gpgme_op_decrypt_verify (ctx, in, out);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
|
||||||
fflush (NULL);
|
fflush (NULL);
|
||||||
fputs ("Begin Result:\n", stdout);
|
fputs ("Begin Result:\n", stdout);
|
||||||
print_data (out);
|
print_data (out);
|
||||||
fputs ("End Result.\n", stdout);
|
fputs ("End Result.\n", stdout);
|
||||||
|
|
||||||
if (stat != GPGME_SIG_STAT_GOOD)
|
if (!gpgme_get_sig_status (ctx, 0, &status, NULL))
|
||||||
|
{
|
||||||
|
fprintf (stderr, "Signature check failed unexpectedly.\n");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
if (status != GPGME_SIG_STAT_GOOD)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "Signature check failed unexpectedly.\n");
|
fprintf (stderr, "Signature check failed unexpectedly.\n");
|
||||||
exit (1);
|
exit (1);
|
||||||
|
@ -1,23 +1,22 @@
|
|||||||
/* t-verify.c - regression test
|
/* t-verify.c - regression test
|
||||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||||
* Copyright (C) 2001, 2002 g10 Code GmbH
|
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||||
*
|
|
||||||
* This file is part of GPGME.
|
This file is part of GPGME.
|
||||||
*
|
|
||||||
* GPGME is free software; you can redistribute it and/or modify
|
GPGME is free software; you can redistribute it and/or modify it
|
||||||
* it under the terms of the GNU General Public License as published by
|
under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
(at your option) any later version.
|
||||||
*
|
|
||||||
* GPGME is distributed in the hope that it will be useful,
|
GPGME is distributed in the hope that it will be useful, but
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* GNU General Public License for more details.
|
General Public License for more details.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
along with GPGME; if not, write to the Free Software Foundation,
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -188,8 +187,13 @@ main (int argc, char **argv )
|
|||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
|
||||||
puts ("checking a valid message:\n");
|
puts ("checking a valid message:\n");
|
||||||
err = gpgme_op_verify (ctx, sig, text, NULL, &status);
|
err = gpgme_op_verify (ctx, sig, text, NULL);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
if (!gpgme_get_sig_status (ctx, 0, &status, NULL))
|
||||||
|
{
|
||||||
|
fprintf (stderr, "%s:%d: No signature\n", __FILE__, __LINE__);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
print_sig_stat (ctx, status);
|
print_sig_stat (ctx, status);
|
||||||
if (status != GPGME_SIG_STAT_GOOD)
|
if (status != GPGME_SIG_STAT_GOOD)
|
||||||
{
|
{
|
||||||
@ -206,9 +210,13 @@ main (int argc, char **argv )
|
|||||||
test_text1f, strlen (test_text1f), 0);
|
test_text1f, strlen (test_text1f), 0);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
gpgme_data_rewind (sig);
|
gpgme_data_rewind (sig);
|
||||||
err = gpgme_op_verify (ctx, sig, text, NULL, &status);
|
err = gpgme_op_verify (ctx, sig, text, NULL);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
if (!gpgme_get_sig_status (ctx, 0, &status, NULL))
|
||||||
|
{
|
||||||
|
fprintf (stderr, "%s:%d: No signature\n", __FILE__, __LINE__);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
print_sig_stat (ctx, status);
|
print_sig_stat (ctx, status);
|
||||||
if (status != GPGME_SIG_STAT_BAD)
|
if (status != GPGME_SIG_STAT_BAD)
|
||||||
{
|
{
|
||||||
@ -225,8 +233,13 @@ main (int argc, char **argv )
|
|||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
err = gpgme_data_new (&text);
|
err = gpgme_data_new (&text);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
err = gpgme_op_verify (ctx, sig, NULL, text, &status);
|
err = gpgme_op_verify (ctx, sig, NULL, text);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
if (!gpgme_get_sig_status (ctx, 0, &status, NULL))
|
||||||
|
{
|
||||||
|
fprintf (stderr, "%s:%d: No signature\n", __FILE__, __LINE__);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
nota = gpgme_data_release_and_get_mem (text, &len);
|
nota = gpgme_data_release_and_get_mem (text, &len);
|
||||||
for (j = 0; j < len; j++)
|
for (j = 0; j < len; j++)
|
||||||
|
@ -1,23 +1,22 @@
|
|||||||
/* t-verify.c - regression test
|
/* t-verify.c - regression test
|
||||||
* Copyright (C) 2000 Werner Koch (dd9jn)
|
Copyright (C) 2000 Werner Koch (dd9jn)
|
||||||
* Copyright (C) 2001, 2002 g10 Code GmbH
|
Copyright (C) 2001, 2002 g10 Code GmbH
|
||||||
*
|
|
||||||
* This file is part of GPGME.
|
This file is part of GPGME.
|
||||||
*
|
|
||||||
* GPGME is free software; you can redistribute it and/or modify
|
GPGME is free software; you can redistribute it and/or modify it
|
||||||
* it under the terms of the GNU General Public License as published by
|
under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
(at your option) any later version.
|
||||||
*
|
|
||||||
* GPGME is distributed in the hope that it will be useful,
|
GPGME is distributed in the hope that it will be useful, but
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* GNU General Public License for more details.
|
General Public License for more details.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
along with GPGME; if not, write to the Free Software Foundation,
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -186,12 +185,14 @@ main (int argc, char **argv )
|
|||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
|
||||||
puts ("checking a valid message:\n");
|
puts ("checking a valid message:\n");
|
||||||
err = gpgme_op_verify (ctx, sig, text, NULL, &status);
|
err = gpgme_op_verify (ctx, sig, text, NULL);
|
||||||
print_sig_stat (ctx, status);
|
|
||||||
print_sig_stat (ctx, status);
|
|
||||||
print_sig_stat (ctx, status);
|
|
||||||
print_sig_stat (ctx, status);
|
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
if (!gpgme_get_sig_status (ctx, 0, &status, NULL))
|
||||||
|
{
|
||||||
|
fprintf (stderr, "%s:%d: No signature\n", __FILE__, __LINE__);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
print_sig_stat (ctx, status);
|
||||||
|
|
||||||
if ( (nota=gpgme_get_notation (ctx)) )
|
if ( (nota=gpgme_get_notation (ctx)) )
|
||||||
printf ("---Begin Notation---\n%s---End Notation---\n", nota);
|
printf ("---Begin Notation---\n%s---End Notation---\n", nota);
|
||||||
@ -202,10 +203,15 @@ main (int argc, char **argv )
|
|||||||
test_text1f, strlen (test_text1f), 0);
|
test_text1f, strlen (test_text1f), 0);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
gpgme_data_rewind ( sig );
|
gpgme_data_rewind ( sig );
|
||||||
err = gpgme_op_verify (ctx, sig, text, NULL, &status);
|
err = gpgme_op_verify (ctx, sig, text, NULL);
|
||||||
|
|
||||||
print_sig_stat (ctx, status);
|
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
if (!gpgme_get_sig_status (ctx, 0, &status, NULL))
|
||||||
|
{
|
||||||
|
fprintf (stderr, "%s:%d: No signature\n", __FILE__, __LINE__);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
print_sig_stat (ctx, status);
|
||||||
|
|
||||||
if ((nota=gpgme_get_notation (ctx)))
|
if ((nota=gpgme_get_notation (ctx)))
|
||||||
printf ("---Begin Notation---\n%s---End Notation---\n", nota);
|
printf ("---Begin Notation---\n%s---End Notation---\n", nota);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user