Lines Matching defs:response
143 struct tpm_header response;
175 * Read the response -- just the header; we don't expect a
186 error = (*sc->sc_intf->read)(sc, &response, sizeof(response), &nread,
192 if (nread != sizeof(response)) {
206 * Verify the response looks reasonable.
208 if (be16toh(response.tag) != TPM_TAG_RSP_COMMAND ||
209 be32toh(response.length) != sizeof(response) ||
210 be32toh(response.code) != 0) {
214 be16toh(response.tag),
215 be32toh(response.length),
216 be32toh(response.code));
242 struct tpm_header response;
274 * Read the response -- just the header; we don't expect a
285 error = (*sc->sc_intf->read)(sc, &response, sizeof(response), &nread,
291 if (nread != sizeof(response)) {
305 * Verify the response looks reasonable.
307 if (be16toh(response.tag) != TPM2_ST_NO_SESSIONS ||
308 be32toh(response.length) != sizeof(response) ||
309 be32toh(response.code) != TPM2_RC_SUCCESS) {
312 be16toh(response.tag),
313 be32toh(response.length),
314 be32toh(response.code));
497 struct response {
501 } __packed response;
513 command.bytesRequested = htobe32(sizeof(response.bytes));
533 /* Read the response header. */
540 if ((rv = (*sc->sc_intf->read)(sc, &response.hdr, sizeof(response.hdr),
546 /* Verify the response header looks sensible. */
547 if (nread != sizeof(response.hdr)) {
549 nread, sizeof(response.hdr));
552 tag = be16toh(response.hdr.tag);
553 pktlen = be32toh(response.hdr.length);
554 code = be32toh(response.hdr.code);
556 pktlen < offsetof(struct response, bytes) ||
557 pktlen > sizeof(response) ||
573 device_printf(sc->sc_dev, "bad tpm response:"
575 hexdump(aprint_debug, "tpm response header",
576 (const void *)&response.hdr,
577 sizeof(response.hdr));
583 /* Read the response payload. */
585 (char *)&response + nread, pktlen - nread,
597 nbytes = be32toh(response.randomBytesSize);
598 if (nbytes > pktlen - offsetof(struct response, bytes)) {
601 nbytes, pktlen - offsetof(struct response, bytes));
602 nbytes = pktlen - offsetof(struct response, bytes);
610 CTASSERT(sizeof(response.bytes) <= UINT_MAX/(NBBY/2));
612 rnd_add_data(&sc->sc_rnd, response.bytes, nbytes, entropybits);
637 struct response {
641 } __packed response;
653 command.bytesRequested = htobe16(sizeof(response.bytes));
673 /* Read the response header. */
680 if ((rv = (*sc->sc_intf->read)(sc, &response.hdr, sizeof(response.hdr),
686 /* Verify the response header looks sensible. */
687 if (nread != sizeof(response.hdr)) {
689 nread, sizeof(response.hdr));
692 tag = be16toh(response.hdr.tag);
693 pktlen = be32toh(response.hdr.length);
694 code = be32toh(response.hdr.code);
696 pktlen < offsetof(struct response, bytes) ||
697 pktlen > sizeof(response) ||
711 device_printf(sc->sc_dev, "bad tpm response:"
713 hexdump(aprint_debug, "tpm response header",
714 (const void *)&response.hdr,
715 sizeof(response.hdr));
721 /* Read the response payload. */
723 (char *)&response + nread, pktlen - nread,
735 nbytes = be16toh(response.randomBytesSize);
736 if (nbytes > pktlen - offsetof(struct response, bytes)) {
739 nbytes, pktlen - offsetof(struct response, bytes));
740 nbytes = pktlen - offsetof(struct response, bytes);
748 CTASSERT(sizeof(response.bytes) <= UINT_MAX/(NBBY/2));
750 rnd_add_data(&sc->sc_rnd, response.bytes, nbytes, entropybits);