- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
您好,我正在尝试使用 libssl 通过 libssl 中的 RSA_padding_add_PKCS1_type1 函数获取一些 EMSA_PSS_ENCODING,但我找不到文档或解决方案,所以这是我编写的示例代码:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/rsa.h>
#include <openssl/err.h>
FILE *error_file;
int main()
{
int lSize;
const unsigned char *string1= (unsigned char *)"The pen is on the table";
unsigned char *stringa=NULL;
int num = 64;
if ((stringa = (unsigned char *)OPENSSL_malloc(num)) == NULL)
fprintf(stderr,"OPENSSL_malloc error\n");
lSize = strlen((char *)string1);
fprintf(stdout,"string1 len is %u\n",lSize);
if(RSA_padding_add_PKCS1_type_1(stringa,num,string1,lSize) != 1)
fprintf(stderr,"Error: RSA_PADDING error\n");
error_file = fopen("libssl.log", "w");
ERR_print_errors_fp(error_file);
fclose(error_file);
fprintf(stdout,(char *)stringa);
fprintf(stdout,"\n");
问题是我在 stringa 中没有输出,我认为函数 RSA_padding_add.. 应该被初始化,但我在 openssl 站点的几个文档中找不到如何做。
谢谢
最佳答案
参见 http://www.openssl.org/docs/crypto/RSA_padding_add_PKCS1_type_1.html .在设置 string1 后尝试将 lSize 定义为 (int)strlen(string1)
。
编辑:
分配stringa。
unsigned char *stringa=malloc(num);
关于c - 带有 libssl 的 EMSA_PSS_ENCODE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2483630/
我正在将开发环境从 Ubuntu 10.04 迁移到 Ubuntu 12.04。一个问题是 lib openssl 已从版本 0.9.8 升级到 1.xxx。 我从其他问题中得到了很多有用的提示,但现
我有一个应用程序: export LD_LIBRARY_PATH=/this/is/another/folder ldd myApp // ... libssl.so.10 => /usr/lib64
这是关于在我的系统中运行 WRF 模型的引用。我正在尝试运行文件 plotgrids.ncl 以确保域在运行 geogrid.exe 之前位于正确的位置。在我的终端(ubuntu)中运行以下命令ncl
我一直在使用 MEAN 堆栈为网站运行 NodeJS 服务器,并且已经运行了几个月。当我今天早上再次开始工作时,我启动了网站: nodemon server/app.js 快速服务器启动得很好,但是当
我有一个使用 python:3(基于 debian)的 docker 文件。我正在根据 microsoft docs. 安装 PyODBC 的驱动程序 FROM python:3 RUN curl h
我想在我的 Ubuntu 18.04 上安装 rabbitmq。我一直关注官方documentation .但是,我的安装没有完成,因为我卡在这一步:sudo apt-get install rabb
我有一个非常简单的代码: #include int main() { SHA_CTX sha1; SHA_Init(&sha1); } 我已经安装了 libssl-dev 和 lib
无论我输入什么与“openssl”组合,我总是会收到以下错误消息: 'openssl: error while loading shared libraries: libssl.so.3: canno
我想使用 OpenSSL 为文件创建签名。我相信我的结果应该与 openssl 生成的 testfile.sig 相匹配: $ openssl dgst -sha1 -binary testfile
我正在将我在 Linux 中开发的应用程序移植到 Windows,但在构建该应用程序时遇到了一些问题。在进行必要的代码更改后,一切都可以正常编译(并且在 Visual Studio 中作为调试版本构建
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
尝试启动 puma 时出现以下错误。它提示它无法加载 libssl? 有什么想法吗? root@7711398a00ad:/app# bundle exec puma -C config/puma.r
我正在尝试安装 Siege在 Mac OS 10.12 上使用 libssl,但是当我针对 https 使用该实用程序时url 我收到以下错误。 [error] HTTPS requires libs
在带有 apt install 的 Ubuntu 18.04 上我安装了libssl1.0.0和 libssl1.0-dev . 以下共享对象可用: /usr/lib/x86_64-linux-gnu
我使用 编译了 libssl CC="gcc34 -fPIC" CXX="g++34 -fPIC" CFLAGS="-m64 -fPIC" ./config --prefix=/workspace/l
我在 xcode 5 中有一个引用 libSSL.a 的项目,所以我尝试自己构建它。make 命令的错误信息是这样的: 我做了什么: 1、下载并安装命令行工具(从here下载) 2、从openssl.
您好,我正在尝试使用 libssl 通过 libssl 中的 RSA_padding_add_PKCS1_type1 函数获取一些 EMSA_PSS_ENCODING,但我找不到文档或解决方案,所以这
这更像是一个假设,而我正在调试一些代码。假设我有一个应用程序(称为 X)调用一个库以通过 TLS 加密的 SMTP 连接发送电子邮件,同时 X 正在与另一个库交谈,该库通过相同的 libcrypto
我无法获取 siege使用 https。在预装 OpenSSL 1.0.2g 和 libssl-dev 1.0.2g-1ubuntu4.6 的 Ubuntu 16.04 LTS 上运行 Siege 4
假设以下代码,我的 base64 编码中有奇怪的错误。 #include #include #include #include char * base64(unsigned char * in
我是一名优秀的程序员,十分优秀!