1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-28 21:50:02 +02:00

indent: Some typo and indentation changes for gpg.

--
This commit is contained in:
Werner Koch 2020-04-15 22:23:10 +02:00
parent df0edaf91a
commit 5c47e7825b
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
5 changed files with 18 additions and 19 deletions

View File

@ -182,12 +182,11 @@ Note that such a comment will be removed if the git commit option
** Variable names ** Variable names
Follow the GNU standards. Here are some conventions you may want to Follow the GNU standards. Here are some conventions you may want to
stick to (do not rename existing "wrong" uses without a goog stick to (do not rename existing "wrong" uses without a good reason).
reason).
- err :: This conveys an error code of type =gpg_error_t= which is - err :: This conveys an error code of type =gpg_error_t= which is
compatible to an =int=. To compare such a variable to a compatible to an =int=. To compare such a variable to a
GPG_ERR_ constant, it is necessary to map the value like GPG_ERR_ constant, it is necessary to access the value like
this: =gpg_err_code(err)=. this: =gpg_err_code(err)=.
- ec :: This is used for a gpg-error code which has no source part - ec :: This is used for a gpg-error code which has no source part
(=gpg_err_code_t=) and will eventually be used as input to (=gpg_err_code_t=) and will eventually be used as input to
@ -425,5 +424,3 @@ plaintext packets and so on. The file g10/encode.c might be a good
starting point to see how it is used - actually this is the other way: starting point to see how it is used - actually this is the other way:
constructing messages using pushed filters but it may be easier to constructing messages using pushed filters but it may be easier to
understand. understand.

View File

@ -16,6 +16,7 @@
* *
* 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, see <https://www.gnu.org/licenses/>. * along with this program; if not, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: GPL-3.0-or-later
*/ */
#include <config.h> #include <config.h>
@ -42,7 +43,7 @@ static int decode_filter ( void *opaque, int control, IOBUF a,
/* Our context object. */ /* Our context object. */
struct decode_filter_context_s struct decode_filter_context_s
{ {
/* Recounter (max value is 2). We need it because we do not know /* Redcounter (max value is 2). We need it because we do not know
* whether the iobuf or the outer control code frees this object * whether the iobuf or the outer control code frees this object
* first. */ * first. */
int refcount; int refcount;
@ -57,7 +58,8 @@ struct decode_filter_context_s
byte startiv[16]; byte startiv[16];
/* The holdback buffer and its used length. For AEAD we need 32+1 /* The holdback buffer and its used length. For AEAD we need 32+1
* bytes but we use 48 byte. For MDC we need 22 bytes. */ * bytes but we use 48 byte. For MDC we need 22 bytes; here
* holdbacklen will either 0 or 22. */
char holdback[48]; char holdback[48];
unsigned int holdbacklen; unsigned int holdbacklen;
@ -66,7 +68,7 @@ struct decode_filter_context_s
/* EOF indicator with these true values: /* EOF indicator with these true values:
* 1 = normal EOF * 1 = normal EOF
* 2 = premature EOF (tag incomplete) * 2 = premature EOF (tag or hash incomplete)
* 3 = premature EOF (general) */ * 3 = premature EOF (general) */
unsigned int eof_seen : 2; unsigned int eof_seen : 2;
@ -118,7 +120,7 @@ release_dfx_context (decode_filter_ctx_t dfx)
/* Set the nonce and the additional data for the current chunk. This /* Set the nonce and the additional data for the current chunk. This
* also reset the decryption machinery * so that the handle can be * also reset the decryption machinery so that the handle can be
* used for a new chunk. If FINAL is set the final AEAD chunk is * used for a new chunk. If FINAL is set the final AEAD chunk is
* processed. */ * processed. */
static gpg_error_t static gpg_error_t
@ -281,6 +283,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
blocksize = openpgp_cipher_get_algo_blklen (dek->algo); blocksize = openpgp_cipher_get_algo_blklen (dek->algo);
if ( !blocksize || blocksize > 16 ) if ( !blocksize || blocksize > 16 )
log_fatal ("unsupported blocksize %u\n", blocksize ); log_fatal ("unsupported blocksize %u\n", blocksize );
if (ed->aead_algo) if (ed->aead_algo)
{ {
enum gcry_cipher_modes ciphermode; enum gcry_cipher_modes ciphermode;
@ -375,7 +378,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
if ( ed->len && ed->len < (nprefix+2) ) if ( ed->len && ed->len < (nprefix+2) )
{ {
/* An invalid message. We can't check that during parsing /* An invalid message. We can't check that during parsing
because we may not know the used cipher then. */ * because we may not know the used cipher then. */
rc = gpg_error (GPG_ERR_INV_PACKET); rc = gpg_error (GPG_ERR_INV_PACKET);
goto leave; goto leave;
} }
@ -535,7 +538,6 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
/* log_printhex("MDC calc:", gcry_md_read (dfx->mdc_hash,0), datalen); */ /* log_printhex("MDC calc:", gcry_md_read (dfx->mdc_hash,0), datalen); */
} }
leave: leave:
release_dfx_context (dfx); release_dfx_context (dfx);
return rc; return rc;

View File

@ -956,7 +956,7 @@ proc_plaintext( CTX c, PACKET *pkt )
/* We add a marker control packet instead of the plaintext packet. /* We add a marker control packet instead of the plaintext packet.
* This is so that we can later detect invalid packet sequences. * This is so that we can later detect invalid packet sequences.
* The apcket is further used to convey extra data from the * The packet is further used to convey extra data from the
* plaintext packet to the signature verification. */ * plaintext packet to the signature verification. */
extrahash = xtrymalloc (6 + pt->namelen); extrahash = xtrymalloc (6 + pt->namelen);
if (!extrahash) if (!extrahash)

View File

@ -71,7 +71,7 @@
#include "../common/zb32.h" #include "../common/zb32.h"
/* FIXME: Libgcrypt 1.9 will support EAX. Until we kame this a /* FIXME: Libgcrypt 1.9 will support EAX. Until we name this a
* requirement we hardwire the enum used for EAX. */ * requirement we hardwire the enum used for EAX. */
#define MY_GCRY_CIPHER_MODE_EAX 14 #define MY_GCRY_CIPHER_MODE_EAX 14

View File

@ -1243,7 +1243,7 @@ parse_symkeyenc (IOBUF inp, int pkttype, unsigned long pktlen,
{ {
/* To compute the size of the session key we need to know /* To compute the size of the session key we need to know
* the size of the AEAD nonce which we may not know. Thus * the size of the AEAD nonce which we may not know. Thus
* we show only the seize of the entire encrypted session * we show only the size of the entire encrypted session
* key. */ * key. */
if (aead_algo) if (aead_algo)
es_fprintf (listfp, ", encrypted seskey %d bytes", seskeylen); es_fprintf (listfp, ", encrypted seskey %d bytes", seskeylen);