-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encrypt failed: data too large for key size #221
Comments
Yes, we should probably display a better error. Consider using |
@rkh is |
Yes, but server side (the unencrypted value will be sent over an encrypted On Thu, Dec 11, 2014 at 9:29 PM, Matthew Beale notifications@github.com
|
That is, unless you mark the value as public. On Fri, Dec 12, 2014 at 11:24 AM, Konstantin Haase <
|
@rkh I think it might be a good idea to implement encryption to larger values. Another example might be 4096-bit SSH RSA key which we might want to store securely in |
I've also encountered this issue attempting to install a PyPI token as an environment variable. The token is 173 characters. Then add It seems 118 is the magic number that's too long.
What's really got me stumped, however, is that I've been able to encrypt this token in the past (as late as this morning). In fact, I just ran the same routine on setuptools again and it worked fine. It seems that the jaraco/keyring project has a shorter limit. Indeed, setuptools' is allowed 501 characters:
It feels like Travis is a little capricious about the allowed lengths for these variables. Maybe it's key length (512 or 128) minus 11 bytes for something? Given that PyPI tokens are a very common usage of encrypted variables, is there another option? I don't think |
FYI, I was able to use |
I confirmed that the minimum config for a pypi deployment includes an explicit password, so setting it in the environment doesn't help. Can you re-open this issue and address it please? |
@jaraco it's just poorly documented. It actually has an env var fallback: https://github.com/travis-ci/dpl/blob/v1.10.12/lib/dpl/provider/pypi.rb#L12. The env var is |
It would also be nice if someone would investigate what is the supported length for encrypted values in config. It seems to vary by project, and it would be nice if someone could provide a workaround for projects that seem to have gotten the short straw (for encryption keys). |
I'm almost sure that it's .org vs .com difference |
I’m highly skeptical that Travis-ci.com is implicated. I believe I use Travis-CI.org exclusively. Is there any evidence that supports that proposition? More importantly, does the reported difference above between setuptools and keyring support or refute that proposition? |
Yes, I have a number of projects where I've encrypted big strings (including PyPI API tokens) and it works with |
The fact that setuptools is on travis-ci.org and works with the larger key dispells the notion that travis-ci.com is the key differentiator. I suspect instead that the key size was updated at some point and any project that was created before that point will have the smaller key. I also suspect that deleting and re-creating the project in Travis would allow it to have a larger key. This change would also, however, require losing the history. It would be nice if the Travis team could provide a means to reset the encryption key such that these older projects could get a 4096-bit key. |
Hey @svenfuchs, WDYT? |
Reported to the Travis CI Community: Would be great to get a fix for this. It's also happening to (old) projects that have been migrated from travis-ci.org to travis-ci.com (SethMMorton/natsort#106 (comment)), so I recommend not migrating any projects. |
Confirm the issue. I can encrypt a PyPI token in my fork, but can't do that in the original old repo. |
When trying to encrypt larger variable (Keen.io access token), I get this error:
The text was updated successfully, but these errors were encountered: