Skip to content

Protected Content Plugin Issues #976

Backlog

Description

@thefamousmoe

Device

X3

Affected Version

2.0.0

EPUB Optimization

No / Not Applicable

Cache State

No / Not Applicable

Describe the Bug

Device

Xteink X3
Affected Version

2.0.0
Describe the Bug

Was testing out the protected content plugin. Ran into a couple issues. 1st was solved, added that here as well. Claude helped me narrow down some stuff so I'm going to copy and past that. I tried a couple different books and wasn't able to get the plugin to work.

Title: Protected Content: device activation fails with wc_PKCS12_parse rc=-133 (ALGO_ID_E); also needs Show Hidden Files to get past HTTP 403

Device / versions

  • Device: Xteink X3
  • Firmware: CrossInk [version — check Settings > About]
  • Plugin: Protected Content (installed from Plugin Hub) [version, e.g. 1.0.5]
  • Account: DTS ByteBooks (new account)
  • Browser: Chrome on Windows, File Transfer started in Join a Network mode

Problem 1 — "Activate device" greyed out (HTTP 403)

On the plugin's web page, under Protected Content:

Could not check account state: could not inspect the credential folder (HTTP 403)

The Activate device button stayed disabled, even after typing the credentials by hand, restarting File Transfer in Join Network mode, rebooting the reader, and hard-refreshing the page.

Workaround that fixed it: turn on Settings > System > Files & Cache > Show Hidden Files.
isProtectedPath() in src/network/CrossPointWebServer.cpp returns 403 for any path segment starting with . unless showHiddenFiles is on. The plugin's credential folder appears to live under a hidden path, so the account check fails and the page disables activation.
Suggestion: let the plugin access its own folder whatever the hidden-files setting is, or show a hint telling the user to enable the setting.

Problem 2 — Activation fails at the PKCS#12 step

After enabling hidden files, the 403 went away and activation ran, but it failed with:

Error: crypto pkcs12: pkcs12 failed: wc_PKCS12_parse rc=-133 keyLen=0 certLen=0 pwLen=24

Analysis (from reading the source):

  • The error comes from the pkcs12 op in src/network/CrossPointPluginServer.cpp, which calls WolfsslCrypto::pkcs12Extract() in freeink-sdk (libs/book/ContentProtection/src/WolfsslCrypto.cpp), which calls wc_PKCS12_parse.
  • -133 is wolfSSL's ALGO_ID_E. In wolfcrypt/src/wc_encrypt.c, that is returned when the bag's PBE algorithm isn't compiled in. Notably, PBE_SHA1_40RC2_CBC is only handled #ifdef WC_RC2.
  • wc_d2i_PKCS12 succeeded and the error is not a MAC failure, so the bundle and the 24-char device-key password seem fine. Decryption fails because of the cipher.
  • Adobe/ADEPT activation PKCS#12 bundles typically encrypt the certificate bag with pbeWithSHAAnd40BitRC2-CBC. Neither scripts/patch_wolfssl.py nor Arduino-wolfSSL 5.7.2's user_settings.h defines WC_RC2, so RC2 bags can't be decrypted. Upstream CrossPoint uses the same freeink-sdk and wolfSSL setup, so it likely has the same problem.

Likely fix: add #define WC_RC2 to the wolfSSL overrides in scripts/patch_wolfssl.py, and make sure 3DES stays enabled (no NO_DES3) for the key bag.

A .acsm from Libby (via Common Stacks) is already on the card but can't be fetched, because the device never activates.

Steps to Reproduce

Install the Protected Content plugin from Plugin Hub; create a DTS ByteBooks account.
Start File Transfer in Join a Network mode; open the reader's web page.
With Show Hidden Files off: the account check fails with HTTP 403 and Activate device stays disabled.
Turn Show Hidden Files on, reload, enter the ByteBooks credentials, click Activate device: you get wc_PKCS12_parse rc=-133.

Expected Behavior

Expect the device to convert the protected content into something readable.

File Provided

Not Applicable

Relevant Log Output/Screenshots

Activity

  1. added
    bug
    on Nov 25, 2026
  2. thefamousmoe commented on Nov 25, 2026

    @thefamousmoe
    Author
    Protected Content page: HTTP 403 and Activate device greyed out pkcs12 error rc=-133
  3. thefamousmoe commented on Nov 25, 2026

    @thefamousmoe
    Author

    Update: confirmed fix. I forked the repo, added the following to the wolfSSL overrides in scripts/patch_wolfssl.py (right after #define FP_MAX_BITS 8192), and built the X3/X4 firmware with the Compile Release Candidate workflow:

    #ifndef WC_RC2
    #define WC_RC2
    #endif
    

    After flashing that build, activation succeeded ("Activation saved. You can now fetch uploaded content below.") with no other changes. So the wc_PKCS12_parse rc=-133 failure is the missing RC2 support. Please consider adding WC_RC2 to the official build.

    Fork/branch for reference: https://github.com/thefamousmoe/CrossInk-2.0.0fix/tree/release/2.0.0-fix — the change is in commit thefamousmoe@22565c3

  4. itsthisjustin commented on Nov 26, 2026

    @itsthisjustin

    @uxjulia does this regression exist on crosspoint?

  5. uxjulia commented on Nov 26, 2026

    @uxjulia
    Owner

    @uxjulia does this regression exist on crosspoint?

    Nah, I ported the plugins feature in chunks, and missed the platformio.ini requirement

  6. hansen1015 commented on Nov 27, 2026

    @hansen1015

    X4 Pro hard-froze after flashing the hotfix-976 x4-pro build (display froze, no reset/power response)

    Thanks for the hotfix. I'm reporting a possible serious problem on the X4 Pro in case it helps others.

    Device: Xteink X4 Pro (China-locked unit, bought on Taobao, so USB flashing is not available)
    Firmware: hotfix-976 x4-pro build posted in this issue (CrossInk 2.0.0 base)

    What happened

    1. I flashed the hotfix-976 x4-pro build and it booted and ran normally.
    2. While using it, I tried to connect to Wi-Fi.
    3. The device froze during the Wi-Fi connection. The screen stayed on the last image and the buttons and touch no longer responded.
    4. It has not recovered since.

    What I tried (none worked)

    • Reset pinhole, then holding Power
    • Holding Power alone for 10+ seconds
    • Charging for hours and overnight. The charging light comes on and the device draws about 3 W, so power is reaching it
    • Removing the microSD card and rebooting
    • Holding Down + Power for the SD recovery picker (nothing happens)
    • The computer does not detect it, and as a locked unit I can't use the web flasher

    Notes

    • This looks similar to Connecting to wifi crashes x4 pro #678 ("Connecting to wifi crashes x4 pro", stack overflow in ActivityManager), but I can't tell whether it's the same bug or something introduced by this build. I don't have serial logs, since I can't reach the device.
    • Because even the hardware reset does nothing, I can't tell whether the device is bricked by firmware or by hardware. I wanted to flag it in case anyone else with a locked X4 Pro hits this after Wi-Fi use on this build.

    Questions

    • Has anyone else seen the X4 Pro hang during Wi-Fi connection on this build?
    • Is there any known way to recover a locked X4 Pro that no longer responds to reset?
    • Should locked units avoid this build, or Wi-Fi features, until it's checked?

    Happy to test anything that doesn't need USB access, or answer questions.

  7. itsthisjustin commented on Nov 27, 2026

    @itsthisjustin

    X4 Pro hard-froze after flashing the hotfix-976 x4-pro build (display froze, no reset/power response)

    Thanks for the hotfix. I'm reporting a possible serious problem on the X4 Pro in case it helps others.

    Device: Xteink X4 Pro (China-locked unit, bought on Taobao, so USB flashing is not available)
    Firmware: hotfix-976 x4-pro build posted in this issue (CrossInk 2.0.0 base)

    What happened

    1. I flashed the hotfix-976 x4-pro build and it booted and ran normally.
    2. While using it, I tried to connect to Wi-Fi.
    3. The device froze during the Wi-Fi connection. The screen stayed on the last image and the buttons and touch no longer responded.
    4. It has not recovered since.

    What I tried (none worked)

    • Reset pinhole, then holding Power
    • Holding Power alone for 10+ seconds
    • Charging for hours and overnight. The charging light comes on and the device draws about 3 W, so power is reaching it
    • Removing the microSD card and rebooting
    • Holding Down + Power for the SD recovery picker (nothing happens)
    • The computer does not detect it, and as a locked unit I can't use the web flasher

    Notes

    • This looks similar to Connecting to wifi crashes x4 pro #678 ("Connecting to wifi crashes x4 pro", stack overflow in ActivityManager), but I can't tell whether it's the same bug or something introduced by this build. I don't have serial logs, since I can't reach the device.
    • Because even the hardware reset does nothing, I can't tell whether the device is bricked by firmware or by hardware. I wanted to flag it in case anyone else with a locked X4 Pro hits this after Wi-Fi use on this build.

    Questions

    • Has anyone else seen the X4 Pro hang during Wi-Fi connection on this build?
    • Is there any known way to recover a locked X4 Pro that no longer responds to reset?
    • Should locked units avoid this build, or Wi-Fi features, until it's checked?

    Happy to test anything that doesn't need USB access, or answer questions.

    Even a crash wouldn't brick the device. The reset button on the Pro is hardware level. It completely reboots the chip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions