当前位置: 首页 > news >正文

error: conflicting types for ‘SSL_SESSION_get_master_key’

$ make
make all-am
make[1]: Entering directory ‘/home/linuxuser/tor’
CC src/lib/tls/libtor_tls_a-tortls_openssl.o
In file included from src/lib/tls/tortls_openssl.c:61:
./src/lib/tls/tortls_internal.h:55:8: error: conflicting types for ‘SSL_SESSION_get_master_key’
55 | size_t SSL_SESSION_get_master_key(struct ssl_session_st *s,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/lib/tls/tortls_openssl.c:48:
/usr/local/ssl/include/openssl/ssl.h:2017:15: note: previous declaration of ‘SSL_SESSION_get_master_key’ was here
2017 | __owur size_t SSL_SESSION_get_master_key(const SSL_SESSION *sess,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib/tls/tortls_openssl.c: In function ‘find_cipher_by_id’:
src/lib/tls/tortls_openssl.c:780:21: error: unused variable ‘c’ [-Werror=unused-variable]
780 | const SSL_CIPHER *c;
| ^
src/lib/tls/tortls_openssl.c: In function ‘tor_tls_client_is_using_v2_ciphers’:
src/lib/tls/tortls_openssl.c:957:20: error: invalid use of incomplete typedef ‘SSL_SESSION’ {aka ‘struct ssl_session_st’}
957 | ciphers = session->ciphers;
| ^~
src/lib/tls/tortls_openssl.c: At top level:
src/lib/tls/tortls_openssl.c:1592:1: error: conflicting types for ‘SSL_get_client_random’
1592 | SSL_get_client_random(SSL *s, uint8_t *out, size_t len)
| ^~~~~~~~~~~~~~~~~~~~~

I was encountering OpenSSL-related type conflicts while compiling Tor. This is likely caused by an incompatibility between Tor’s code and the OpenSSL version installed on your system. Here’s how you can approach fixing this:

1. Check OpenSSL Version

Run:

openssl version

Tor expects OpenSSL 1.1.1 or 3.x, but if you’re using an incompatible version (e.g., OpenSSL 3.x with an older Tor version), it can cause these conflicts.

2. Verify OpenSSL Headers

Since you installed OpenSSL manually in /usr/local/ssl, double-check that you’re using the correct headers:

ls -l /usr/local/ssl/include/openssl/

Ensure that the ssl.h file matches the installed OpenSSL version.

3. Force Correct OpenSSL Paths in Compilation

Reconfigure Tor to use the correct OpenSSL paths by running:

export TOR_OPENSSL_CFLAGS='-I/usr/local/ssl/include'
export TOR_OPENSSL_LIBS='-L/usr/local/ssl/lib64 -lssl -lcrypto'
./configure --with-openssl-dir=/usr/local/ssl

Then, try compiling again:

make clean && make -j$(nproc)

4. Check for OpenSSL API Changes

The errors suggest that the SSL_SESSION_get_master_key function has different signatures in OpenSSL versions. If Tor is using an outdated declaration, you might need to patch it or use an older OpenSSL version.

You can check the function prototype in your OpenSSL headers:

grep -r "SSL_SESSION_get_master_key" /usr/local/ssl/include/openssl/

If it has changed, you may need to modify Tor’s source code (tortls_internal.h and tortls_openssl.c) to match the correct function signature.

5. Try an Older OpenSSL Version

If Tor is not yet compatible with your OpenSSL version, consider downgrading to OpenSSL 1.1.1:

cd /usr/local/src
wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz
tar xvf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
make -j$(nproc)
make install

Then, recompile Tor with the updated OpenSSL.

http://www.lryc.cn/news/536832.html

相关文章:

  • 测试狗参加国家超级计算成都中心2024年度用户大会
  • 从2025年起:数字化建站PHP 8.1应成为建站开发的基准线
  • 飞牛OS与昔映OS深度对比
  • vscode本地和远程对应分支没有同步提交数量
  • 通过docker启用rabbitmq插件
  • DeepSeek计算机视觉(Computer Vision)基础与实践
  • 哪些专业跟FPGA有关?
  • 【STM32系列】利用MATLAB配合ARM-DSP库设计IIR数字滤波器(保姆级教程)
  • Java每日精进·45天挑战·Day18
  • C# 中用于比较两个字符串的方法string.Compare
  • 进阶数据结构——树状数组
  • 键盘启用触摸板-tips
  • 信息安全之网络安全
  • 成都国际数字影像产业园布局者树莓集团,亮相宜宾翠屏招商签约
  • opencascade 获取edge起始点 会出现终点与实际不同的情况
  • 掌握正则表达式_模式匹配的艺术
  • 【蓝桥】二维DP--摆花
  • 在AMLOGIC android14 平台上使用adb
  • 力扣-二叉树-222 完全二叉树节点的数量
  • V93K测试机
  • 【机器学习】监督学习-决策树-CART(Classification and Regression Tree,分类与回归树)详尽版
  • Navicat 迁移数据库 传输数据
  • Jetpack Compose初体验
  • ceph部署-14版本(nautilus)-使用ceph-ansible部署实验记录
  • 【C++】C++ 旅馆管理系统(含 源码+报告)【独一无二】
  • 快速排序
  • 国内 ChatGPT Plus/Pro 订阅教程
  • 易仓科技ai面试
  • LabVIEW用户界面(UI)和用户体验(UX)设计
  • 字玩FontPlayer开发笔记14 Vue3实现多边形工具