-
Notifications
You must be signed in to change notification settings - Fork 83
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
Implement alternative to OpenSSL RSA keygen #452
Comments
Here is a Dockerfile showing the error coming from FROM centos:centos7
RUN yum -y install epel-release
RUN yum -y install \
dracut-fips \
libcurl-devel \
openssl-devel \
wget
# Install R
ARG R_VERSION=3.6.1
ARG OS_IDENTIFIER=centos-7
RUN wget https://cdn.rstudio.com/r/${OS_IDENTIFIER}/pkgs/R-${R_VERSION}-1-1.x86_64.rpm && \
yum -y install ./R-${R_VERSION}-1-1.x86_64.rpm && \
ln -s /opt/R/${R_VERSION}/bin/R /usr/bin/R && \
ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/bin/Rscript && \
ln -s /opt/R/${R_VERSION}/lib/R /usr/lib/R && \
rm R-${R_VERSION}-1-1.x86_64.rpm && \
yum clean all
RUN R --slave --vanilla -e 'install.packages(c("openssl"), repos = "https://cran.rstudio.com/")'
ENV OPENSSL_FORCE_FIPS_MODE=1
CMD ["Rscript", "-e", "openssl::rsa_keygen(2048L)"] docker build -t rsconnect-fips -f Dockerfile.openssl_rsa .
docker run --rm rsconnect-fips
# => Error: OpenSSL error in EVP_DigestInit_ex: disabled for fips
# => Execution halted |
It may be key length: Or key format: |
A workaround is using API keys:
|
In the python library hashlib the .md5 function has argument |
This issue has been resolved for python users on RSC. However this issue continues to persist for R users. Is there a plan to resolve this? The use of FIPS is a challenge for our customers in the IC. |
Customer that would benefit from this issue: https://rstudioide.zendesk.com/agent/tickets/64039 |
I believe this is a bug that we can't work around without upstream changes. The reproducible example by @aronatkins above is actually incorrect, but related. Building the same Docker image and running through the token generation code manually:
This indicates that when the A related issue is also the cause of the reproducible failure posted above:
That is, printing a key will also call some code that generates a nice, user-friendly, hardcoded-to-MD5 fingerprint of the key. In sum: the |
This has been fixed in the upstream > openssl::fips_mode()
[1] TRUE
> rsconnect:::generateToken()
<omitted> I'll submit a PR bumping our |
A customer has an issue with this code:
rsconnect/R/rsa.R
Lines 39 to 42 in 1306eed
The call to
openssl::rsa_keygen
is producing a FIPS error:This issue is closely related to #378, which hit FIPS errors while using MD5.
(Internal: See support ticket 51376).
The text was updated successfully, but these errors were encountered: