OpenSSL should support VIA PadLock

Bug #119294 reported by Pascal de Bruijn
40
This bug affects 5 people
Affects Status Importance Assigned to Milestone
ssl-cert
Fix Released
Unknown
openssh (Ubuntu)
Invalid
Undecided
Unassigned
Declined for Hardy by Brian Murray
openssl (Debian)
Fix Released
Unknown
openssl (Ubuntu)
Fix Released
Wishlist
Unassigned
Declined for Hardy by Brian Murray

Bug Description

VIA PadLock is a hardware cryptography engine for AES and SHA1/256.

OpenSSL now supports PadLock, but a cache logic bug prevents the use of the PadLock engine.

A fairly trivial patch exists and has been merged in OpenSSL 0.9.8g upstream. See bug #119295 for the patch and more details.

Initial work on PadLock support was done some time ago :
http://www.logix.cz/michal/devel/padlock/

Revision history for this message
JanCeuleers (jan-ceuleers) wrote :

Upstream states that this has been fixed (possible except for the RNG). Unfortunately they're not saying which version it was fixed in.

See http://rt.openssl.org/Ticket/Display.html?id=1559

Revision history for this message
JanCeuleers (jan-ceuleers) wrote :

Reporter of the upstream bug tells me by private email that openssl 0.9.8e does now support Padlock, except for the random number generator.

Revision history for this message
Allison Karlitskaya (desrt) wrote :

openssl 0.9.8 in gutsy.

'openssl engine padlock' seems to indicate that support exists.

Changed in openssl:
status: New → Fix Released
Revision history for this message
JanCeuleers (jan-ceuleers) wrote :

The fix is incomplete, in that the Padlock engine is not automatically enabled. Applications that use the library need to explicitly enable the engine for it to be used.

Changed in openssl:
status: Fix Released → New
Revision history for this message
Herbert Schmid (sairia) wrote :

The support of sha is also missing in openssl 0.9.8g (hardy and intrepit).

You may easily check this by comparing eng_padlock.c with the patch at http://www.logix.cz/michal/devel/padlock/.

The patch is against openssl 0.9.8b, and contains the padlock static fix.

I've attached a cleaned version of the patch, which only contains the sha part.

Revision history for this message
Craig Ringer (ringerc) wrote :

Support is almost working in Hardy. There's a bug in the caching logic in OpenSSL 0.9.8g that prevents the engine from being used, and when this is fixed support works fine with apps that properly enable OpenSSL engines, like OpenSSL.

A small patch (attached to bug #119295) is available to fix the caching logic. The patch is included in OpenSSL 0.9.8h upstream, so it should be quite safe to merge for hardy-updates . The OpenSSL cache logic patch is:

http://launchpadlibrarian.net/13798833/bug119295.patch

To get PadLock working with OpenSSH 4.7p1 the patch to OpenSSH that's attached to #119295 must be applied to OpenSSH *AND* the OpenSSL patch referenced above must be applied to OpenSSL.

description: updated
Revision history for this message
Craig Ringer (ringerc) wrote :

Re JanCeuleers' comment:

Apparently the OpenSSL developers want apps to have to explicitly enable support, so once the cache logic patch is applied OpenSSL's PadLock support will be working fine.

You can actually force PadLock use for OpenSSL components that read openssl.cnf but most other apps must enable it themselves. Changes would be required to those other apps, not OpenSSL.

Revision history for this message
Craig Ringer (ringerc) wrote :

Upstream bug:

http://rt.openssl.org/Ticket/Display.html?id=1668&user=guest&pass=guest

Though the bug hasn't been closed, the patch has been applied to 0.9.8h as is trivially verifiable by examination of the source.

Revision history for this message
Colin Watson (cjwatson) wrote :

I'm going to mark the openssh side of this bug invalid, as it already seems to be adequately covered in bug 119295.

Changed in openssh:
status: New → Invalid
Revision history for this message
xteejx (xteejx-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. Has this been implemented yet. Can you try with the latest Ubuntu release? Thanks in advance.

Changed in openssl (Ubuntu):
status: New → Incomplete
importance: Undecided → Wishlist
Revision history for this message
igorsh (ishipenkov) wrote :

I found that support of VIA padlock missed in amd64 version of openssl.

In i386 version of ubuntu it works perfect:

$ uname -a
Linux ubuntu 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux

$ aptitude show openssl
Package: openssl
State: installed
Automatically installed: no
Version: 0.9.8g-15ubuntu3

$ openssl engine
(padlock) VIA PadLock (no-RNG, ACE)
(dynamic) Dynamic engine loading support

$ openssl speed -evp aes-128-cbc -engine padlock
(I skip these messages, because they say that everything is ok)
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128-cbc 91498.33k 292274.17k 599037.49k 818108.08k 916745.48k

but in amd64 version it seems broken:

$ uname -a
Linux lenovo 2.6.31-020631-generic #020631 SMP Thu Sep 10 21:43:40 UTC 2009 x86_64 GNU/Linux
(i install kernel 2.6.31 because in default 2.6.28 in amd64 version modules for padlock missed)

$ aptitude show openssl
Пакет: openssl
Состояние: установлен
Автоматически установлен: нет
Версия: 0.9.8g-15ubuntu3.3

$ openssl engine
(dynamic) Dynamic engine loading support

$ openssl speed -evp aes-128-cbc -engine padlock
invalid engine "padlock"
4896:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:162:filename(/usr/lib/ssl/engines/libpadlock.so): /usr/lib/ssl/engines/libpadlock.so: cannot open shared object file: No such file or directory
4896:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
4896:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
4896:error:2606A074:engine routines:ENGINE_by_id:no such engine:eng_list.c:415:id=padlock
4896:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:162:filename(libpadlock.so): libpadlock.so: cannot open shared object file: No such file or directory
4896:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
4896:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
Doing aes-128-cbc for 3s on 16 size blocks: 3502200 aes-128-cbc's in 2.60s
Doing aes-128-cbc for 3s on 64 size blocks: 815994 aes-128-cbc's in 2.22s
Doing aes-128-cbc for 3s on 256 size blocks: 201874 aes-128-cbc's in 2.10s
Doing aes-128-cbc for 3s on 1024 size blocks: 51384 aes-128-cbc's in 2.16s
Doing aes-128-cbc for 3s on 8192 size blocks: 5111 aes-128-cbc's in 1.75s
OpenSSL 0.9.8g 19 Oct 2007
built on: Wed Sep 9 14:22:25 UTC 2009
options:bn(64,64) md2(int) rc4(ptr,char) des(idx,cisc,16,int) aes(partial) blowfish(ptr2)
compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DMD32_REG_T=int -DMD5_ASM
available timing options: TIMES TIMEB HZ=100 [sysconf value]
timing function used: times
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128-cbc 21552.00k 23524.15k 24609.40k 24359.82k 23925.32k

I checked source of package - nessessary patches already used.

Revision history for this message
JanCeuleers (jan-ceuleers) wrote :

@igorsh: is there a 64-bit CPU that supports Padlock?

Revision history for this message
Timothy Schmidt (timschmidt) wrote : Re: [Bug 119294] Re: OpenSSL should support VIA PadLock

On Sat, Sep 19, 2009 at 4:37 AM, JanCeuleers <email address hidden> wrote:
> @igorsh: is there a 64-bit CPU that supports Padlock?

Via Nano: http://en.wikipedia.org/wiki/Via_nano

--tim

Revision history for this message
igorsh (ishipenkov) wrote :

yes, it's via nano.
some of new notebooks with it already sell here and I've bought one.

Revision history for this message
igorsh (ishipenkov) wrote :

I've tried instruction from http://ubuntuforums.org/showpost.php?p=7167334&postcount=45 in ubuntu 9.10 and padlock engine in openssl works now on 64-bit system.
It'll be great if this patch will be add to mainstream.

Revision history for this message
Peter (y4h0oo) wrote :

Just tested the default OpenSSL package (0.9.8k-7ubuntu8) on Ubuntu Server 10.04 LTS 64 bit installed on a DELL XS11-VX8 alias Fortuna (uses a Via Nano U2250 http://www.online.net/serveur-dedie/offre-dedibox-v3.xhtml ) and VIA Padlock is still not supported :(

The only way of getting it to work is to revert back to a patched version of 0.9.8g.

Is there any hope this (apparently trivial) patch will get officially merged in the latest OpenSSL build? (this issue is already a couple of years old so I'm not holding my breath anymore... ;) )

Changed in openssl (Debian):
status: Unknown → Fix Released
Peter (y4h0oo)
description: updated
Revision history for this message
klockren (jonas-almroth) wrote :

PadLock for x86_64 is supported by OpenSSL 1.0.1 and the trunk (1.1.0) branches - but not on the 1.0.0 and previous branches.
Isa there a chance Ubuntu will release OpenSSL 1.0.1+ packages in a PPA or provide instructions on how to properly build OpenSSL yourself for Ubuntu?

Changed in ssl-cert:
status: Unknown → Fix Released
Revision history for this message
Oibaf (oibaf) wrote :

>PadLock for x86_64 is supported by OpenSSL 1.0.1 and the trunk (1.1.0) branches - but not on the 1.0.0 and previous branches.
>Is there a chance Ubuntu will release OpenSSL 1.0.1+ packages in a PPA or provide instructions on how to properly build OpenSSL yourself for Ubuntu?

Every supported version of Ubunti now has 1.0.1+.

Changed in openssl (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.