diff options
Diffstat (limited to 'src/sig-notation.c')
-rw-r--r-- | src/sig-notation.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/sig-notation.c b/src/sig-notation.c index 5800c37..c747ad6 100644 --- a/src/sig-notation.c +++ b/src/sig-notation.c @@ -2,17 +2,17 @@ Copyright (C) 2005 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 Lesser General Public License as published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -30,6 +30,7 @@ #include "util.h" #include "context.h" #include "ops.h" +#include "debug.h" /* Free the signature notation object and all associated resources. @@ -56,7 +57,7 @@ sig_notation_set_flags (gpgme_sig_notation_t notation, /* We copy the flags into individual bits to make them easier accessible individually for the user. */ notation->human_readable = flags & GPGME_SIG_NOTATION_HUMAN_READABLE ? 1 : 0; - notation->critical = flags & GPGME_SIG_NOTATION_CRITICAL ? 1 : 0; + notation->critical = flags & GPGME_SIG_NOTATION_CRITICAL ? 1 : 0; notation->flags = flags; } @@ -78,7 +79,7 @@ _gpgme_sig_notation_create (gpgme_sig_notation_t *notationp, notation = calloc (1, sizeof (*notation)); if (!notation) - return gpg_error_from_errno (errno); + return gpg_error_from_syserror (); /* This is critical. We want to reliably identify policy URLs by using a NULL pointer for NAME. So all notations must have a NAME @@ -90,7 +91,7 @@ _gpgme_sig_notation_create (gpgme_sig_notation_t *notationp, notation->name = malloc (name_len + 1); if (!notation->name) { - err = gpg_error_from_errno (errno); + err = gpg_error_from_syserror (); goto err; } @@ -106,7 +107,7 @@ _gpgme_sig_notation_create (gpgme_sig_notation_t *notationp, notation->value = malloc (value_len + 1); if (!notation->value) { - err = gpg_error_from_errno (errno); + err = gpg_error_from_syserror (); goto err; } @@ -159,13 +160,13 @@ _gpgme_parse_notation (gpgme_sig_notation_t *notationp, /* A few simple sanity checks. */ if (len > strlen (data)) - return gpg_error (GPG_ERR_INV_ENGINE); + return trace_gpg_error (GPG_ERR_INV_ENGINE); /* See below for the format of a notation subpacket. It has at least four octets of flags and two times two octets of length information. */ if (type == 20 && len < 4 + 2 + 2) - return gpg_error (GPG_ERR_INV_ENGINE); + return trace_gpg_error (GPG_ERR_INV_ENGINE); err = _gpgme_decode_percent_string (data, &decoded_data, 0, 1); if (err) @@ -234,7 +235,7 @@ _gpgme_parse_notation (gpgme_sig_notation_t *notationp, if (4 + 2 + 2 + name_len + value_len > len) { free (decoded_data); - return gpg_error (GPG_ERR_INV_ENGINE); + return trace_gpg_error (GPG_ERR_INV_ENGINE); } name = (char *) bdata; |