On Tue May 2, 2023 at 6:43 PM EEST, Stefan Berger wrote: > > +void tpm_buf_append_2b(struct tpm_buf *buf, struct tpm_buf *tpm2b) > > +{ > > + u16 len = tpm_buf_length(tpm2b); > > + > > if (tpm2b->flags & TPM_BUF_OVERFLOW) { > buf->flags |= TPM_BUF_OVERFLOW; > return; > } > > > + tpm_buf_append_u16(buf, len); > > + tpm_buf_append(buf, tpm_buf_data(tpm2b), len); > > > > + /* clear the buf for reuse */ > > + tpm_buf_reset_int(tpm2b); This should only append. Unpredictable side-effect like this, will add by factors to the time spent maintaining all this. For any extra steps, do them in the call site. BR, Jarkko