Skip to content

In Emscripten, sizeof(time_t) != sizeof(int) #10293

Closed
@hoodmane

Description

@hoodmane

In asn1.py, cryptography defines time_t to be int...:
https://github.com/pyca/cryptography/blob/main/src/_cffi_src/openssl/asn1.py#L12

I'm not 100% sure what int... means, since the documentation of cffi doesn't directly suggest that the parser would accept this and I haven't looked at the source code. But if it's any of void *, int *, or int these are all 32 bits in Emscripten, but time_t is 64 bits.

Applying the following patch gets it building again, but I'm not sure how we can upstream this:

--- a/src/_cffi_src/openssl/asn1.py
+++ b/src/_cffi_src/openssl/asn1.py
@@ -9,7 +9,7 @@ INCLUDES = """
 """
 
 TYPES = """
-typedef int... time_t;
+typedef long long time_t;
 
 typedef ... ASN1_INTEGER;

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting-on-reporterIssue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions