Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

construct.core.FieldError: expected 32, found 20 #131

Open
WYMW opened this issue Aug 16, 2019 · 4 comments
Open

construct.core.FieldError: expected 32, found 20 #131

WYMW opened this issue Aug 16, 2019 · 4 comments

Comments

@WYMW
Copy link

WYMW commented Aug 16, 2019

I always get the error "construct.core.FieldError: expected 32, found 20" What sholud i do ?

@Oprh
Copy link

Oprh commented Aug 23, 2019

I just discovered that one possible cause is when you have sha-256 CodeDirectory blobs. In the codesig.py, at ApplicationSlot.get_hash() you have a hardcoded 000 of lenght 20, which is incorrect for sha-256, which is 32. length should depend on the hashing algorithm

@studywithallofyou
Copy link

I got the same issue with latest xcode

@studywithallofyou
Copy link

I just discovered that one possible cause is when you have sha-256 CodeDirectory blobs. In the codesig.py, at ApplicationSlot.get_hash() you have a hardcoded 000 of lenght 20, which is incorrect for sha-256, which is 32. length should depend on the hashing algorithm

Same error after I change 20 to 32

@Oprh
Copy link

Oprh commented Aug 26, 2019

Well I did something like

return '\x00' * (20 if hash_algorithm == 'sha1' else 32)

But also, this can be because the new entitlements blob is not handled correctly, I went past that. Check if the version of CodeDirectory is 20500.
You can check my fork and see if you still got the error. Sadly, while the error is gone in my case, the resulted IPA does not install on the device, so it is still work in progress

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants