diff --git a/src/libtpmtss/tpm_tss_tss2_v1.c b/src/libtpmtss/tpm_tss_tss2_v1.c index 0335fab91..fb26d059b 100644 --- a/src/libtpmtss/tpm_tss_tss2_v1.c +++ b/src/libtpmtss/tpm_tss_tss2_v1.c @@ -503,7 +503,7 @@ METHOD(tpm_tss_t, get_public, chunk_t, rsa = &public.t.publicArea.unique.rsa; aik_modulus = chunk_create(rsa->t.buffer, rsa->t.size); - exponent = public.t.publicArea.parameters.rsaDetail.exponent; + exponent = htonl(public.t.publicArea.parameters.rsaDetail.exponent); if (!exponent) { aik_exponent = chunk_from_chars(0x01, 0x00, 0x01); diff --git a/src/libtpmtss/tpm_tss_tss2_v2.c b/src/libtpmtss/tpm_tss_tss2_v2.c index e527443fb..c5d78d641 100644 --- a/src/libtpmtss/tpm_tss_tss2_v2.c +++ b/src/libtpmtss/tpm_tss_tss2_v2.c @@ -457,7 +457,7 @@ METHOD(tpm_tss_t, get_public, chunk_t, rsa = &public.publicArea.unique.rsa; aik_modulus = chunk_create(rsa->buffer, rsa->size); - exponent = public.publicArea.parameters.rsaDetail.exponent; + exponent = htonl(public.publicArea.parameters.rsaDetail.exponent); if (!exponent) { aik_exponent = chunk_from_chars(0x01, 0x00, 0x01);