DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Security

OpenBSD Security Functionally paranoid!

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 2 Weeks Ago
ermanno ermanno is offline
New User
 
Join Date: Jul 2014
Posts: 5
Thanked 0 Times in 0 Posts
Default VIA Padlock

Well, I guess I was succesful relocating my small home server to openbsd, the board (Epia MII12000) has AES hw accel using padlock, and basically runs a nginx, php-fpm, mysql stack for some personal webservers, ssh server for outside access, exim for a few emails, netbsd-iscsi for backups, minidlna to stream music and video, a 2mbit/s gogoc tunnel for ip6. So far everything ok, it is probably faster than it was before, except sftp and scp file transfers are a lot slower than before, also nginx uses a lot more CPU than before transferring large files.
I have read that openbsd is bringing some innovation to openssl but I did not follow what is going on ....
The openssl padlock engine is disabled, even if a comment in /usr/src/lib/libssl/crypto/Makefile:
Code:
CFLAGS+= -DOPENSSL_NO_HW_PADLOCK # XXX enable this?
hints that maybe it can be re-enabled.

openssl speed -evp shows that padlock instructions are used by evp functions, but are nginx, exim and ssh using them?
openssl speed -engine cryptodev instead is ~5/6 times slower, probably not using padlock.
Code:
# openssl speed aes-192-cbc 
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
aes-192 cbc       4832.23k     5069.21k     5150.03k    12997.93k    13014.90k
# openssl speed -evp aes-192-cbc
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
aes-192-cbc      26500.36k    99317.35k   268582.62k   464052.28k   589470.85k
# openssl speed -engine cryptodev aes-192-cbc
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
aes-192 cbc       4778.00k     5014.26k     5122.80k    12946.75k    13032.20k
#
Forcing AES-192 on both client and server doubles the speed of sftp and scp file transfers, but I don't know if it is using padlock.
Will nginx use padlock? should I set ssl_engine cryptodev; or not?.

Last edited by ermanno; 2 Weeks Ago at 12:50 PM.
Reply With Quote
  #2   (View Single Post)  
Old 2 Weeks Ago
shep shep is offline
ISO Quartermaster
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 580
Thanked 9 Times in 9 Posts
Default

I'm not an expert on this but there are some questions regarding the integrity of some of the chips. The OpenBSD code has been audited.

Your decision may come down to whether you trust the padlock vs the performance gains.
Reply With Quote
  #3   (View Single Post)  
Old 2 Weeks Ago
ermanno ermanno is offline
New User
 
Join Date: Jul 2014
Posts: 5
Thanked 0 Times in 0 Posts
Default

IIRC the problem is with the via rng, but it is simply bugged :-) it is based on thermal effects, and when the load is high and the CPU temp high vthe via rng returns mostly 1s, it is easy to check on a board using it :-) rngd (which I used before) can detect this condition and switch to another source (I used aveged). But randomness is not the problem for me ATM (I think at least).

IIRC libressl should have supported padlock and AESNI, I have no political reason to use those CPU extensions or not, but some speed could be welcome to use iscsi over ssh tunnels and file transfers over SSL :-)
And nginx using so much CPU is also requiring using more Watts of electricity and that is bad for the environment (and my wallet). Imagine how much CO2 are releasing in the atmosphere all those CPU doing AES encriptions in software
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:15 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick