libtpmtss: Convert RSA exponent to big-endian when provided by a TPM 2.0
[strongswan.git] / src / libtpmtss / tpm_tss_tss2_v1.c
index 0335fab..fb26d05 100644 (file)
@@ -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);