Changeset View
Changeset View
Standalone View
Standalone View
g10/parse-packet.c
Context not available. | |||||
pktlen = buf32_to_ulong (value); | pktlen = buf32_to_ulong (value); | ||||
} | } | ||||
else if (ctx->sigs_only || onlykeypkts) | |||||
{ | |||||
log_error ("%s: partial length found for packet type %d" | |||||
" when reading signature, certificate, or key", | |||||
iobuf_where(inp), pkttype); | |||||
rc = gpg_error (GPG_ERR_UNEXPECTED); | |||||
goto leave; | |||||
} | |||||
else /* Partial body length. */ | else /* Partial body length. */ | ||||
{ | { | ||||
switch (pkttype) | switch (pkttype) | ||||
Context not available. | |||||
rc = gpg_error (GPG_ERR_INV_PACKET); | rc = gpg_error (GPG_ERR_INV_PACKET); | ||||
goto leave; | goto leave; | ||||
} | } | ||||
else if (ctx->sigs_only || onlykeypkts) | |||||
{ | |||||
log_error ("%s: indeterminate length when reading" | |||||
" key or signature\n", | |||||
iobuf_where (inp)); | |||||
rc = gpg_error (GPG_ERR_UNEXPECTED); | |||||
goto leave; | |||||
} | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
Context not available. | |||||
goto leave; | goto leave; | ||||
} | } | ||||
if (with_uid && pkttype == PKT_USER_ID) | if (pkttype == PKT_PADDING || | ||||
(pkttype >= PKT_FIRST_NON_CRITICAL && | |||||
pkttype != PKT_COMMENT && pkttype != PKT_GPG_CONTROL)) | |||||
goto again; /* Skip this packet */ | |||||
else if (ctx->sigs_only && pkttype != PKT_SIGNATURE | |||||
&& pkttype != PKT_PADDING && pkttype != PKT_MARKER) | |||||
{ | |||||
iobuf_skip_rest (inp, pktlen, partial); | |||||
*skip = 1; | |||||
rc = GPG_ERR_UNEXPECTED; | |||||
goto leave; | |||||
} | |||||
else if (with_uid && pkttype == PKT_USER_ID) | |||||
/* If ONLYKEYPKTS is set to 2, then we never skip user id packets, | /* If ONLYKEYPKTS is set to 2, then we never skip user id packets, | ||||
even if DO_SKIP is set. */ | even if DO_SKIP is set. */ | ||||
; | ; | ||||
Context not available. |