[SCM] Samba Shared Repository - branch v3-devel updated - release-3-2-0pre2-4159-g37fcc9d

Stefan (metze) Metzmacher metze at samba.org
Sat Sep 13 07:15:23 GMT 2008


Hi Volker,

>  /**
> + * Decrypt a PDU, check the signature
> + * @param[in] cli	The cli_state that received something
> + * @param[in] pdu	The incoming bytes
> + * @retval error code
> + */
> +
> +
> +static NTSTATUS validate_smb_crypto(struct cli_state *cli, char *pdu)

by not uint8_t *pdu, would be must clearer.

> +	NTSTATUS status;
> +
> +	if ((IVAL(pdu, 4) != 0x424d53ff) /* 0xFF"SMB" */
> +	    && (SVAL(pdu, 4) != 0x45ff)) /* 0xFF"E" */ {
> +		DEBUG(10, ("Got non-SMB PDU\n"));
> +		return NT_STATUS_INVALID_NETWORK_RESPONSE;
> +	}
> +
> +	if (cli_encryption_on(cli) && CVAL(pdu, 0) == 0) {
> +		uint16_t enc_ctx_num;
> +
> +		status = get_enc_ctx_num((uint8_t *)pdu, &enc_ctx_num);

then you don't need to cast here:-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.samba.org/archive/samba-cvs/attachments/20080913/064158cc/signature.bin


More information about the samba-cvs mailing list