当前位置: 首页 > 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.

相关文章:

  • 笔试题笔记#4、5 记录划水过程
  • 11苍穹外卖之Apache ECharts(数据可视化图表、后端传数据)
  • 批量修改mysql字符串字段子字符串
  • PhotoShop中创建窗口使用对应按钮创建对应图层简单示例
  • Linux 设置静态IP
  • 01什么是DevOps
  • JVM组成
  • 学习总结三十三
  • 如果需要保护多个域名怎么办?
  • 基于C++实现的(控制台)植物大战僵尸游戏(高级程序设计)
  • 大预言模型|微调大预言模型初探索(LLaMA-Factory)(1)
  • Centos7安装Clickhouse单节点部署
  • 深度整理总结MySQL——Expalin指南(一)
  • 域森林基础及环境搭建
  • 美颜SDK技术深度解析:从滤镜算法到实时渲染优化
  • qt 事件的传递顺序
  • python学opencv|读取图像(六十六)使用cv2.minEnclosingCircle函数实现图像轮廓圆形标注
  • 《战神:诸神黄昏》游戏闪退后提示弹窗“d3dx9_43.dll缺失”“找不到d3dx11_43.d”该怎么处理?
  • Visual Studio Code支持WSL,直接修改linux/ubuntu中的文件
  • git 沙盒 下(二)
  • 国台办:80年前台湾重归中国版图,80年后不可能让台湾分裂出去
  • 高适配算力、行业大模型与智能体平台重塑工业城市
  • 摩根士丹利:对冲基金已加码,八成投资者有意近期增配中国
  • 食用城市|食饭识人
  • 1156万+1170万,静安、宝山购彩者击中大乐透头奖
  • 贵州省总工会正厅级副主席梁伟被查,曾任贵州省纪委副书记