【问题标题】:openssl erro after machine restart decryption failed or bad record mac机器重启后openssl错误解密失败或坏记录mac
【发布时间】:2013-07-31 09:19:40
【问题描述】:

在 C++ 应用程序中使用 openssl 0.9.8。

一切正常,但突然遇到以下错误。 没有更改代码、证书或对等应用程序。

error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac:s3_pkt.c:426:
error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:s3_pkt.c:288:
error:1408F096:SSL routines:SSL3_GET_RECORD:encrypted length too long:s3_pkt.c:346:

M/C Details:Linux awtah.dispatchserver1 3.6.11-1.fc16.i686 #1 SMP Mon Dec 17 21:36:23 UTC 2012 i686 i686 i386 GNU/Linux

这些错误是随机的。 即使应用程序使用它自己的 opnesssl 0.9.8 并且 M/C 有 1.0.0j-fips。

-bash-4.2# openssl version -a
OpenSSL 1.0.0j-fips 10 May 2012
built on: Tue May 15 18:44:01 UTC 2012
platform: linux-elf
options:  bn(64,32) md2(int) rc4(8x,mmx) des(ptr,risc1,16,long) blowfish(idx)
compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4  -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -Wa,--noexecstack -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DWHIRLPOOL_ASM
OPENSSLDIR: "/etc/pki/tls"
engines:  aesni dynamic

在此机器上重新安装 1.0.0j-fips 时错误已得到修复。

现在对于 Fedora 14 上的同一个应用程序,重启后我们遇到了上述问题。

Linux 3UPCAWT605 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC 2010 i686 i686 i386 GNU/Linux

任何指针是什么是这个问题的根本原因或如何解决这个问题。 安装在第二台 M/C 上的 Open SSL

built on: Wed Sep  7 18:59:14 UTC 2011
platform: linux-elf
options:  bn(64,32) md2(int) rc4(8x,mmx) des(ptr,risc1,16,long) blowfish(idx)
compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -Wa,--noexecstack -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DWHIRLPOOL_ASM
OPENSSLDIR: "/etc/pki/tls"
engines:  aesni dynamic

【问题讨论】:

    标签: linux ssl openssl


    【解决方案1】:

    cbc 填充检查似乎失败了。这可能由更改网络中的数据的某些元素触发,或者库期待某些东西并得到了其他东西。对于多线程环境,锁的回调应该使用 openssl 注册图书馆。

    例如,这是一种库行为,除了重新创建 ssl 上下文并在出现此错误时从头开始之外,您无能为力。

    有些机器还支持用于加速库加密/解密的指令集,您可能希望通过导出 openssl 环境变量来禁用这些指令。

    【讨论】:

      猜你喜欢
      • 2015-06-13
      • 1970-01-01
      • 2013-07-05
      • 2014-05-10
      • 1970-01-01
      • 1970-01-01
      • 2021-03-30
      • 1970-01-01
      • 2017-12-26
      相关资源
      最近更新 更多