sa_state problem on ikev2

2014-11-30 Thread René Ammerlaan
Hey all,

I’m trying to run a road warrior setup on OpenBSD 5.6-current with an IOS8 
device, but I’m running into problems. For simplicity I’ve created the vpn 
server on my local network without a firewall. But somehow the sa_state doesn’t 
get passed to 0x1f. So basically it’s missing ‘cert’ in the authentication 
procedure, so what’s ‘cert' about? As far as I can tell the client does 
authenticate itself with it’s certificate and seems to be valid. And the local 
cert with ca is loaded at start.

I’ve setup the certificates this way:
ikectl ca vpn create 
ikectl ca vpn install
ikectl ca vpn certificate 10.0.0.132 create
ikectl ca vpn certificate 10.0.0.132 install
ikectl ca vpn certificate roadwarrior create
ikectl ca vpn certificate roadwarrior export

Installed roadwarrior.pfx and ca.crt and configured with the correct sa 
settings on the iphone.
 
Here is my iked.conf:
ikev2 roadwarrior passive esp \
from 0.0.0.0/0 to 172.16.99.2 local 10.0.0.132 peer 0.0.0.0/0 \
ikesa auth hmac-sha2-256 enc aes-128 prf hmac-sha2-256 group modp1024 \
childsa auth hmac-sha2-256 enc aes-128 prf hmac-sha2-256 group modp1024 
\
srcid 10.0.0.132 \
config address 172.16.99.2

Log from iked:
#  /sbin/iked -dvv   
ca_privkey_serialize: type RSA_KEY length 1191
ca_pubkey_serialize: type RSA_KEY length 270
/etc/iked.conf: loaded 1 configuration rules
ca_reload: loaded ca file ca.crt
ca_reload: loaded crl file ca.crl
config_getpolicy: received policy
ca_reload: /C=NL/ST=xxx/L=xxx/O=xx/OU=IPSec/CN=VPN 
CA/emailAddress=x...@xx.nl
ikev2ca_reload: loaded 1 ca certificate
 roadwarriorca_reload: loaded cert file 10.0.0.132.crt
 passiveca_validate_cert: 
/C=NL/ST=xxx/L=xxx/O=xx/OU=IPSec/CN=10.0.0.132/emailAddress=x...@xx.nl 
ok
 espca_reload: local cert type X509_CERT
 inetconfig_getocsp: ocsp_url none
 from 0.0.0.0/0 to 172.16.99.2 local 10.0.0.132 peer 0.0.0.0/0 ikesa enc 
aes-128 prf hmac-sha2-256 auth hmac-sha2-256 group modp1024 childsa enc aes-128 
auth hmac-sha2-256 group modp1024 srcid 10.0.0.132 lifetime 10800 bytes 
536870912 rsa config address 172.16.99.2
config_getpfkey: received pfkey fd 3
config_getcompile: compilation done
config_getsocket: received socket fd 4
config_getsocket: received socket fd 5
ikev2_dispatch_cert: updated local CERTREQ type X509_CERT length 20
ikev2_dispatch_cert: updated local CERTREQ type X509_CERT length 20
config_getsocket: received socket fd 7
config_getsocket: received socket fd 8
ikev2_recv: IKE_SA_INIT request from initiator 10.0.0.102:500 to 10.0.0.132:500 
policy 'roadwarrior' id 0, 288 bytes
ikev2_recv: ispi 0x1f4a1989390c27a7 rspi 0x
ikev2_policy2id: srcid IPV4/10.0.0.132 length 8
ikev2_pld_parse: header ispi 0x1f4a1989390c27a7 rspi 0x 
nextpayload SA version 0x20 exchange IKE_SA_INIT flags 0x08 msgid 0 length 288 
response 0
ikev2_pld_payloads: payload SA nextpayload KE critical 0x00 length 48
ikev2_pld_sa: more 0 reserved 0 length 44 proposal #1 protoid IKE spisize 0 
xforms 4 spi 0
ikev2_pld_xform: more 3 reserved 0 length 12 type ENCR id AES_CBC
ikev2_pld_attr: attribute type KEY_LENGTH length 128 total 4
ikev2_pld_xform: more 3 reserved 0 length 8 type PRF id HMAC_SHA2_256
ikev2_pld_xform: more 3 reserved 0 length 8 type INTEGR id HMAC_SHA2_256_128
ikev2_pld_xform: more 0 reserved 0 length 8 type DH id MODP_1024
ikev2_pld_payloads: payload KE nextpayload NONCE critical 0x00 length 136
ikev2_pld_ke: dh group MODP_1024 reserved 0
ikev2_pld_payloads: payload NONCE nextpayload NOTIFY critical 0x00 length 20
ikev2_pld_payloads: payload NOTIFY nextpayload NOTIFY critical 0x00 length 28
ikev2_pld_notify: protoid NONE spisize 0 type NAT_DETECTION_SOURCE_IP
ikev2_nat_detection: peer source 0x1f4a1989390c27a7 0x 
10.0.0.102:500
ikev2_pld_payloads: payload NOTIFY nextpayload NONE critical 0x00 length 28
ikev2_pld_notify: protoid NONE spisize 0 type NAT_DETECTION_DESTINATION_IP
ikev2_nat_detection: peer destination 0x1f4a1989390c27a7 0x 
10.0.0.132:500
sa_state: INIT - SA_INIT
ikev2_sa_negotiate: score 4
sa_stateok: SA_INIT flags 0x00, require 0x00 
sa_stateflags: 0x00 - 0x10 sa (required 0x00 )
ikev2_sa_keys: SKEYSEED with 32 bytes
ikev2_sa_keys: S with 64 bytes
ikev2_prfplus: T1 with 32 bytes
ikev2_prfplus: T2 with 32 bytes
ikev2_prfplus: T3 with 32 bytes
ikev2_prfplus: T4 with 32 bytes
ikev2_prfplus: T5 with 32 bytes
ikev2_prfplus: T6 with 32 bytes
ikev2_prfplus: Tn with 192 bytes
ikev2_sa_keys: SK_d with 32 bytes
ikev2_sa_keys: SK_ai with 32 bytes
ikev2_sa_keys: SK_ar with 32 bytes
ikev2_sa_keys: SK_ei with 16 bytes
ikev2_sa_keys: SK_er with 16 bytes
ikev2_sa_keys: SK_pi with 32 bytes
ikev2_sa_keys: SK_pr with 32 bytes
ikev2_add_proposals: length 44
ikev2_next_payload: length 48 nextpayload KE
ikev2_next_payload: length 136 nextpayload NONCE
ikev2_next_payload: length 36 nextpayload NOTIFY
ikev2_nat_detection: local source 0x1f4a1989390c27a7 0xfd14d116d2dbdddf 

Re: ffs and utf8

2014-11-30 Thread Dmitrij D. Czarkoff
Joel Rees said:
 That said, the standard provides just enough facilities to make
 filesystem-related aspects of Unicode work nicely, particularily in case
 of utf-8.  Eg. ability to enforce NFD for all operations on file names
 could actually make several things more secure by preventing homograph
 attacks.
 
 I think this assertion is a bit optimistic, and not just given your
 following caveat.

Provided that I have to cope with Unicode file names every day, I just
can't see more pessimistic approach then just allowing arbitrary Unicode
codepoints with no sanitization whatsoever.  Every now and then I have
to use printf(1) and xclip(1x) just because there is no other way to
address a file or identify all codepoints of its name.  From here I
don't see ability to enforce policy on Unicode strings as something as
useless as you put it.

-- 
Dmitrij D. Czarkoff



Re: ffs and utf8

2014-11-30 Thread Dmitrij D. Czarkoff
Thomas Bohl said:
 # ls | cat
 Will display the characters right.
 Not entirely sure why though.

From ls(1) manual:

| -q  Force printing of non-graphic characters in file names as the
| character `?'; this is the default when output is to a terminal.


-- 
Dmitrij D. Czarkoff



Relayd, how to relay-to based on path

2014-11-30 Thread Harald Klimach
Hello,
I am trying to substitute a nginx proxy by relayd and would like to
forward connections to different backends, based on the path in the
request.
In the Paper Recent work in OpenBSD relayd from 2013 there is an
example with: match request path /images relay-to 10.1.1.1
Basically I need that and a second statement with
match request path /app relay-to 10.1.1.2
But, the relay-to option apparently is gone by now, and the filter
need to be put into the protocol section. I tried to use to relays
with the same listen on statement, but this results only in the
second one overwriting the first one. Is it still possible with the
new syntax to achieve conditional relays to different servers based
on the request path? If so, how? I think, I somehow need to get
some information from the protocol section into the relay to base the
forward to decision on, but I have no clue how to achieve that.

Thanks a lot for any pointers!
Harald



INVALID ROOT NODE

2014-11-30 Thread Max Power
Hi guys,
I have a CRYPTO - RAID 1 softraid device /dev/sd4a [3TB OpenBSD 5.6/amd64]
on which I have about 1,400,000 files and I've never had problems reading
or writing. If, however, launch the tree command, eg. tree c *, returns me:
tree: invalid root node: name_of_file.

I tried to run a fsck and this is the result
# fsck /dev/sd4a
** /dev/rsd4a (NO WRITE)
** Last Mounted on /RAID1
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1367897 files, 219769546 used, 143692 free (48040 frags, 17948169
blocks, 0.0% fragmentation)

tree: invalid root node: name_of_file  # The file listed is ok!
What does this message mean?
This is only a warnign o It's a problem of my raid or my hard drives?
Thanks Max Power.



Re: sensorsd, upd, and state changes

2014-11-30 Thread Marcus MERIGHI
hig...@gmail.com (David Higgs), 2014.11.28 (Fri) 15:43 (CET):
 On Fri, Nov 28, 2014 at 2:45 AM, Marcus MERIGHI mcmer-open...@tor.at wrote:
  What I have now:
 
  $ getcap -a -f /etc/sensorsd.conf
  hw.sensors.upd0.indicator0:low=1:high=2:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.indicator1:low=1:high=2:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.indicator2:low=1:high=2:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.indicator3:low=1:high=2:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.indicator4:low=1:high=2:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.percent0:low=10:high=100:command=\
  /etc/sensorsd/upd-capacityremaining.sh %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.percent1:low=95:high=100:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
 
 Do you mind saying what type of USB you have, and what these sensors
 map are for your hardware?
 
 I have:
 uhidev0 at uhub1 port 2 configuration 1 interface 0 American Power
 Conversion Back-UPS ES 750 FW:841.I3 .D USB FW:I3 rev 1.10/1.01 addr
 2
 uhidev0: iclass 3/0, 146 report ids
 upd0 at uhidev0
 
 Which only appears to provide:
 hw.sensors.upd0.indicator3=Off (ShutdownImminent), OK

uhidev0 at uhub2 port 1 configuration 1 interface 0 APC Back-UPS ES \
  550G FW:870.O2 .I USB FW:O2 rev 1.10/1.06 addr 2
uhidev0: iclass 3/0, 146 report ids
upd0 at uhidev0

I think this should be it:
http://www.apc.com/resource/include/techspec_index.cfm?base_sku=BE550-GRISOCountryCode=en

And I get:
$ sysctl hw.sensors.upd0
hw.sensors.upd0.indicator0=Off (Charging), OK
hw.sensors.upd0.indicator1=Off (Discharging), OK
hw.sensors.upd0.indicator2=On (ACPresent), OK
hw.sensors.upd0.indicator3=On (BatteryPresent), OK
hw.sensors.upd0.indicator4=Off (ShutdownImminent), OK
hw.sensors.upd0.percent0=100.00% (RemainingCapacity), OK
hw.sensors.upd0.percent1=100.00% (FullChargeCapacity), OK

Bye, Marcus



Re: CUPS printer problems - #!/bin/bash

2014-11-30 Thread bodie

On 29.11.2014 22:18, Duncan Patton a Campbell wrote:

On Sat, 29 Nov 2014 00:57:18 +0100
Antoine Jacoutot ajacou...@bsdfrog.org wrote:

 Not that I can find, but what you're saying here is what I'm 
seeing:
 bash _was_ on the system for a short time a while back when it was 
needed

 to get grolog to run on OBSD64.  Afterward it was removed.  But
 cups-foomatic is going out when it gets installed, and finding 
some bashism,

 preferentially configures for it.  In newer versions of foom* this
 becomes an explicitly configurable param.

If that were to be the case, it would have called 
/usr/local/bin/bash, not /bin/bash...




I dunno.  This thing sets up for /bin/bash iff it finds some kind of
bashism.
/usr/local/bin/bash was left over in shells, but that's not where
it got this from.  In the openprinting code it makes reference to 
bash as
a preferred shell or something, so I think something in the old 
foom*
is finding .bash.history or some other cruft and automagically 
selecting



Sorry for interrupting..isn't it this?

$ pwd
/usr/ports/print/cups-filters
$ egrep -ri bash *
Makefile:   perl -pi -e 's,/bin/bash,/bin/ksh,g' 
${WRKSRC}/filter/textonly
patches/patch-filter_foomatic-rip_foomaticrip_c:-char modern_shell[64] 
= /bin/bash;

$



for it.

Dhu


--
Antoine




awk vs. mawk - printing zero bytes

2014-11-30 Thread Jan Stary
Here is a simple sine wave generator in awk.
It produces 1 second of a 1000 Hz sine wave
scaled to an amplitude of 24 bits, at 44100Hz.
The individual 24bit samples are printed out
as three bytes, from lowest to highest.

$ cat sin.awk
BEGIN {
tone = 1000;
duration = 1;
amplitude = 1;
samplerate = 44100;
numsamples = duration * samplerate;
bitspersample = 24;
pi = 4 * atan2(1,1);

for (b = 0 ; b  bitspersample ; b++)
amplitude *= 2;
amplitude -= 1;

for (s = 0; s  numsamples; s++) {
sample = sin(2 * pi * tone * s / samplerate);
sample = int(amplitude * sample);
#printf(%d\n, sample);
for (b = 0; b  bitspersample/8; b++) {
printf(%c, sample % 256); # zero?
sample /= 256;
}
}
}

The result is different with system awk (version 20110810)
and mawk-1.3.4.20140914; this is on current/amd64.

If I print out just the samples (24bit integers, as %d),
the results are indentical. If I print out the individual
bytes of those 24 bit samples (the innermost for loop),
the results differ; the difference is that that the system awk
does NOT print out some of the zeros.

$ awk -f sin.awk | hexdump -C | head  awk
$ mawk -f sin.awk | hexdump -C | head  mawk
$ diff awk mawk | head
7,10c7,10
 0060  31 03 bf 04 01 52 39 03  77 92 0a 0f ea 16 14 27  |1R9.w..'|
 0070  e2 7b 3d 04 ee 56 77 d2  73 59 93 93 ee 8b b5 f8  |.{=..Vw.sY..|
 0080  0b d9 4e 5b fd 8e bc 20  fa 74 44 42 ca 66 46 0a  |..N[... .tDB.fF.|
 0090  87 b9 8d a4 7e bb be c6  0b d5 cc 0a e7 36 5b f4  |~6[.|
---
 0060  31 00 03 bf 04 01 52 39  03 77 92 0a 0f ea 16 14  |1.R9.w..|
 0070  00 27 e2 7b 3d 04 ee 56  77 d2 73 59 93 93 ee 8b  |.'.{=..Vw.sY|
 0080  b5 f8 0b d9 4e 5b fd 8e  bc 20 fa 74 44 42 ca 66  |N[... .tDB.f|
 0090  46 0a 87 b9 8d a4 7e bb  be c6 0b d5 cc 0a e7 36  |F.~6|

mawk's printf(%c, ...) of a zero byte always prints a zero byte (^@)
while system awk's printf(%c, ...) of a zero bytes sometimes prints
a zero byte, and sometimes prints nothing.

awk variables are not typed; can it be that the zero byte
is sometimes considered a delimiter of an empty string?
Is there a better way in awk to print a 'raw' byte than printf(%c)?

Jan



Re: ffs and utf8

2014-11-30 Thread Joel Rees
On Sun, Nov 30, 2014 at 6:31 PM, Dmitrij D. Czarkoff czark...@gmail.com wrote:
 Joel Rees said:
 That said, the standard provides just enough facilities to make
 filesystem-related aspects of Unicode work nicely, particularily in case
 of utf-8.  Eg. ability to enforce NFD for all operations on file names
 could actually make several things more secure by preventing homograph
 attacks.

 I think this assertion is a bit optimistic, and not just given your
 following caveat.

 Provided that I have to cope with Unicode file names every day,

Same here, FWIW, Japanese. (And then there are the times I have to
work on file names encoded in shift-JIS. Fun stuff.)

 I just
 can't see more pessimistic approach then just allowing arbitrary Unicode
 codepoints with no sanitization whatsoever.

Pessimistic? Optimistic? Asking for trouble, yes.

I generally try to use Romaji (latinized phonetic Japanese, all
ASCII, if I avoid the overbar approach to lengthened vowels) when I
know a file is going to move to another machine. If file names are
strictly phonetic, you can set up a round-trip mapping from Romaji to
kana, but most of the time Japanese file names include Kanji, and
there is no round-trip mapping that can be meaningfully read by a
human.

There are ASCII-encoded JIS codes which could be used to produce
round-trip mapping, but I'd need to run the output of ls through some
sort of a custom filter to make sense of the names. Might be a useful
thing to build.

 Every now and then I have
 to use printf(1) and xclip(1x) just because there is no other way to
 address a file or identify all codepoints of its name.  From here I
 don't see ability to enforce policy on Unicode strings as something as
 useless as you put it.

Not saying it's useless to have a policy.

What I'm saying is that unicode utf-8 has parsing problems independent
of issues like characters that appear the same but have separate code
points. utf-8 is pretty simple until you start mapping it to real
characters. Getting the mapping right is difficult, which is why you
have your policy, I think.

One of these days I want to build a ctype library that gives
meaningful results for the Japanese subset of the CJK subset of
Unicode. But that's only going to help with some of the problems.

-- 
Joel Rees

Be careful when you look at conspiracy.
Look first in your own heart,
and ask yourself if you are not your own worst enemy.
Arm yourself with knowledge of yourself, as well.



Re: CUPS printer problems - #!/bin/bash

2014-11-30 Thread Antoine Jacoutot
 Sorry for interrupting..isn't it this?

We are explicitely patching so that it is *not* it...

-- 
Antoine



Re: ffs and utf8

2014-11-30 Thread Christian Weisgerber
On 2014-11-29, Ingo Schwarze schwa...@usta.de wrote:

 But Unicode must never be allowed near anything that might get
 executed as program code, including scripts in interpreted languages,
 including, but not limited to, the shell.  In particular, that means
 trying to handle Unicode in filenames is a bad idea.

Why filenames at all?  Just use inode numbers.

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: sensorsd, upd, and state changes

2014-11-30 Thread Marcus MERIGHI
for the impatient, here are my questions:

- Although I use the same (undocumented, undeadly.org) trick of
  low=1:high=2 for indicators everywhere, this can result in
  On is below On, and Off is below On
- Although I use low=1:high=2, I get On for %3 (low limit) as well
  as for %4 (high limit)
- Reading sensorsd.conf(5):
  If the limits are crossed or if the status provided by the driver
  changes, sensorsd(8)'s alert functionality is triggered and a command,
  if specified, is executed
  If limits are crossed, yes; if status changes, no, unless you use the
  low=1:high=2 trick.
- Reading sensorsd.conf(5):
  Values for all other types of sensors can be specified in the same
  units as they appear under the sysctl(8) hw.sensors tree.
  No: low=Off:high=On results in (sensorsd -c 1 -d):
  sensorsd: incorrect value: Off: file or directory not found

(for the more patient these will come up later...)

j...@entropicblur.com (Joe Gidi), 2014.11.28 (Fri) 17:40 (CET):
 On Fri, November 28, 2014 2:45 am, Marcus MERIGHI wrote:
  j...@entropicblur.com (Joe Gidi), 2014.11.27 (Thu) 16:41 (CET):
  I just spent some more time poking at this and I'm still unable to get
 
  So did I...
 
  sensorsd to recognize upd state changes. This is a bit of a frustrating
  regression from my point of view, since I can no longer use apcupsd
  unless
  I disable uhidev in the kernel.
 
  Does anyone have a working example configuration for sensorsd/upd?
 
  What I have now:
 
  $ getcap -a -f /etc/sensorsd.conf
  hw.sensors.upd0.indicator0:low=1:high=2:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.indicator1:low=1:high=2:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.indicator2:low=1:high=2:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.indicator3:low=1:high=2:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.indicator4:low=1:high=2:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.percent0:low=10:high=100:command=\
  /etc/sensorsd/upd-capacityremaining.sh %l %n %s %x %t %2 %3 %4
  hw.sensors.upd0.percent1:low=95:high=100:command=/etc/sensorsd/upd.sh \
  %l %n %s %x %t %2 %3 %4
 
  The ``command=/etc/sensorsd/upd.sh'' lines are just informational.
 
  The workhorse is command=/etc/sensorsd/upd-capacityremaining.sh:
  
  #!/bin/sh -e
  if [[ X${1} == Xbelow ]]; then
  logger -t UPD-capacityremaining SHUTDOWN (${@})
  shutdown -hp +1
  else
  logger -t UPD-capacityremaining NON-SHUTDOWN (${@})
  fi
  
 
  I did some testing (plug/unplug, wait for hw.sensors.upd0.percent0 to go
  below low=) and left it as working.
 
 Thanks for this! The percent0 example will be useful. Were you able to get
 any useful results with the other indicator sensors? The 'low=1:high=2'
 attributes don't seem to do anything for me.

What I never mentioned: for now I'm running sensorsd(8) with '-c 1'. 

What happens in syslog when running unplugged with the above config,
the UPD:-lines are from the script 
'command=/etc/sensorsd/upd.sh %l %n %s %x %t %2 %3 %4'
which just does 
'echo ${@} | logger -t UPD'

I've trimmed and shuffled the lines a bit to have a better reading
experience. Commented lines after syslog lines are my comments and the
config (without parameters to command=).


sensorsd[14579]: startup, system has 9 sensors
# just restarted sensorsd

sensorsd[658]: upd0.indicator0: Off, OK
sensorsd[658]: upd0.indicator0: exceeds limits: Off is below On
UPD: below 0 OK upd0 indicator Off On On 
# Charging is Off, command= is run.
# hw.sensors.upd0.indicator0:low=1:high=2:command=/etc/sensorsd/upd.sh

sensorsd[658]: upd0.indicator1: On, OK
sensorsd[658]: upd0.indicator1: exceeds limits: On is below On
UPD: below 1 OK upd0 indicator On On On 
# Discharging is On, command= is run
# hw.sensors.upd0.indicator1:low=1:high=2:command=/etc/sensorsd/upd.sh

sensorsd[658]: upd0.indicator2: Off, OK
sensorsd[658]: upd0.indicator2: exceeds limits: Off is below On
UPD: below 2 OK upd0 indicator Off On On 
# ACPresent is Off, command= is run
# hw.sensors.upd0.indicator2:low=1:high=2:command=/etc/sensorsd/upd.sh

sensorsd[658]: upd0.indicator3: On, OK
sensorsd[658]: upd0.indicator3: exceeds limits: On is below On
UPD: below 3 OK upd0 indicator On On On 
# BatteryPresent is On, command= is run
# hw.sensors.upd0.indicator3:low=1:high=2:command=/etc/sensorsd/upd.sh

sensorsd[658]: upd0.indicator4: Off, OK
sensorsd[658]: upd0.indicator4: exceeds limits: Off is below On
UPD: below 4 OK upd0 indicator Off On On 
# ShutdownImminent is Off, command= is run
# hw.sensors.upd0.indicator4:low=1:high=2:command=/etc/sensorsd/upd.sh
# todo: test low=2:high=1:; 
# todo: check whether it flips when upd0.percent0 goes below low=.

sensorsd[658]: upd0.percent0: 71.00%, OK
sensorsd[658]: upd0.percent0: within limits: 71.00%
# RemainingCapacity is 71%, command= is run but does no syslog output
# 

Re: OT:Password strength

2014-11-30 Thread Ted Unangst
On Sat, Nov 29, 2014 at 22:07, Eric Furman wrote:
 OFF TOPIC. This has nothing to do with OpenBSD,
 but a lot of guys here know about this stuff.
 I've done some reading, but still not sure.
 OK, at the risk of looking stupid,which of these passwords is better;
 kMH65?3
 or
 mylittlelambjumpedovertenredbarns

I think it's a mistake to reverse a password into entropy. If your
pool of possible passwords is sentences from common nursery rhymes,
for example, they may look awesome but in reality there are only a few
thousand possibilities.

Instead, pick a generating algorithm. It can be random letters, random
symbols, whatever. Random words. Random fake words consisting of
alternating consonants and vowels. You know how big the search space
is for each atom. Divide desired password strength (e.g. 64 bits) by
bits per atom to determine required number of atoms.

For the consonant/vowel example, here's a luajit script that makes
passwords. Even though they are all lower case, they are at least 64
bits hard.

local letters = {
c, k, t, tr, rt, p, pr, d,
v, n, l, nd, z, g, th, s }
local vowels = { a, e, i, o, u, y, oo, ee }

local letterbits = 4
local vowelbits = 3

local wantedbits = 64

local bits = 0

local ffi = require ffi
ffi.cdef[[uint32_t arc4random_uniform(uint32_t);]]
local function rand(max)
return ffi.C.arc4random_uniform(max) + 1
end 

local atoms = { }
while bits  wantedbits do
table.insert(atoms, letters[rand(16)])
table.insert(atoms, vowels[rand(8)])
bits = bits + letterbits + vowelbits
end 
print(table.concat(atoms))

Examples:

treetykaveprethicooputhedu
soonataviceenoopatecoge
gootrozapiceelytrithunula
preezypeendothanundipeesooka



Re: OT:Password strength

2014-11-30 Thread Miod Vallat
 Examples:
 
 treetykaveprethicooputhedu
 soonataviceenoopatecoge
 gootrozapiceelytrithunula
 preezypeendothanundipeesooka

These stand no chance against a finnish attacker!

Miod



Re: OT:Password strength

2014-11-30 Thread thornton . richard
Where do you store these passwords? On a napkin?

  Original Message  
From: Ted Unangst
Sent: Sunday, November 30, 2014 3:21 PM
To: Eric Furman
Cc: OpenBSD Misc
Subject: Re: OT:Password strength

On Sat, Nov 29, 2014 at 22:07, Eric Furman wrote:
 OFF TOPIC. This has nothing to do with OpenBSD,
 but a lot of guys here know about this stuff.
 I've done some reading, but still not sure.
 OK, at the risk of looking stupid,which of these passwords is better;
 kMH65?3
 or
 mylittlelambjumpedovertenredbarns

I think it's a mistake to reverse a password into entropy. If your
pool of possible passwords is sentences from common nursery rhymes,
for example, they may look awesome but in reality there are only a few
thousand possibilities.

Instead, pick a generating algorithm. It can be random letters, random
symbols, whatever. Random words. Random fake words consisting of
alternating consonants and vowels. You know how big the search space
is for each atom. Divide desired password strength (e.g. 64 bits) by
bits per atom to determine required number of atoms.

For the consonant/vowel example, here's a luajit script that makes
passwords. Even though they are all lower case, they are at least 64
bits hard.

local letters = {
c, k, t, tr, rt, p, pr, d,
v, n, l, nd, z, g, th, s }
local vowels = { a, e, i, o, u, y, oo, ee }

local letterbits = 4
local vowelbits = 3

local wantedbits = 64

local bits = 0

local ffi = require ffi
ffi.cdef[[uint32_t arc4random_uniform(uint32_t);]]
local function rand(max)
return ffi.C.arc4random_uniform(max) + 1
end 

local atoms = { }
while bits  wantedbits do
table.insert(atoms, letters[rand(16)])
table.insert(atoms, vowels[rand(8)])
bits = bits + letterbits + vowelbits
end 
print(table.concat(atoms))

Examples:

treetykaveprethicooputhedu
soonataviceenoopatecoge
gootrozapiceelytrithunula
preezypeendothanundipeesooka



Mouse pointer moving unintentionally.

2014-11-30 Thread Christian Schulte
Hello,

after upgrading to 5.6, I am experiencing a mouse pointer weirdness.
The X window manager (windowmaker) stops responding to window related
button presses. Switching to the console and back to X (CTRL-F1
followed by CTRL-F5), the window manager starts working again, but the
moise pointer now is slowly moving to the lower left corner of the
screen. I need to reboot to make the mouse pointer stand still again.
Disabling the kernel 'pms' driver makes this issue go away. This happens
with a T60 laptop. dmesg with the 'pms' driver disabled is attached.

Regards,
-- 
Christian Schulte


OpenBSD 5.6-stable (1KHZ.MP) #7: Sun Nov 30 15:45:48 CET 2014
r...@t60.schulte.it:/usr/src/sys/arch/amd64/compile/1KHZ.MP
real mem = 3203203072 (3054MB)
avail mem = 3109216256 (2965MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (68 entries)
bios0: vendor LENOVO version 79ETD4WW (2.14 ) date 06/07/2007
bios0: LENOVO 2007FVG
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG HPET BOOT SSDT SSDT SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) LURT(S3) DURT(S3) EXP0(S4) EXP1(S4) 
EXP2(S4) EXP3(S4) PCI1(S4) USB0(S3) USB1(S3) USB2(S3) USB7(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz, 1828.91 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF
cpu0: 2MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 166MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz, 1828.76 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF
cpu1: 2MB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 1
acpimcfg0 at acpi0 addr 0xf000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (AGP_)
acpiprt2 at acpi0: bus 2 (EXP0)
acpiprt3 at acpi0: bus 3 (EXP1)
acpiprt4 at acpi0: bus 4 (EXP2)
acpiprt5 at acpi0: bus 12 (EXP3)
acpiprt6 at acpi0: bus 21 (PCI1)
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: PUBS, resource for USB0, USB2, USB7
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 99 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model 92P1139 serial  9496 type LION oem Panasonic
acpibat1 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
acpidock0 at acpi0: GDCK not docked (0)
cpu0: Enhanced SpeedStep 1828 MHz: speeds: 1833, 1333, 1000 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel 82945GM Host rev 0x03
ppb0 at pci0 dev 1 function 0 Intel 82945GM PCIE rev 0x03: msi
pci1 at ppb0 bus 1
radeondrm0 at pci1 dev 0 function 0 ATI Radeon Mobility X1400 rev 0x00
drm0 at radeondrm0
radeondrm0: apic 1 int 16
azalia0 at pci0 dev 27 function 0 Intel 82801GB HD Audio rev 0x02: msi
azalia0: codecs: Analog Devices AD1981HD, Conexant/0x2bfa, using Analog Devices 
AD1981HD
audio0 at azalia0
ppb1 at pci0 dev 28 function 0 Intel 82801GB PCIE rev 0x02: msi
pci2 at ppb1 bus 2
em0 at pci2 dev 0 function 0 Intel 82573L rev 0x00: msi, address 
00:15:58:7c:c0:6c
ppb2 at pci0 dev 28 function 1 Intel 82801GB PCIE rev 0x02: msi
pci3 at ppb2 bus 3
athn0 at pci3 dev 0 function 0 Atheros AR5418 rev 0x01: apic 1 int 17
athn0: MAC AR5418 rev 2, RF AR5133 (2T3R), ROM rev 3, address 00:16:cf:a9:e0:c7
ppb3 at pci0 dev 28 function 2 Intel 82801GB PCIE rev 0x02: msi
pci4 at ppb3 bus 4
ppb4 at pci0 dev 28 function 3 Intel 82801GB PCIE rev 0x02: msi
pci5 at ppb4 bus 12
uhci0 at pci0 dev 29 function 0 Intel 82801GB USB rev 0x02: apic 1 int 16
uhci1 at pci0 dev 29 function 1 Intel 82801GB USB rev 0x02: apic 1 int 17
uhci2 at pci0 dev 29 function 2 Intel 82801GB USB rev 0x02: apic 1 int 18
uhci3 at pci0 dev 29 function 3 Intel 82801GB USB rev 0x02: apic 1 int 19
ehci0 at pci0 dev 29 function 7 Intel 82801GB USB rev 0x02: apic 1 int 19
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 Intel EHCI root hub rev 2.00/1.00 addr 1
ppb5 at pci0 dev 30 function 0 Intel 82801BAM Hub-to-PCI rev 0xe2
pci6 at ppb5 bus 21
cbb0 at pci6 dev 0 function 0 TI PCI1510 CardBus rev 0x00: apic 1 int 16
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 22 device 0 cacheline 0x8, lattimer 0xb0
pcmcia0 at 

Re: OT:Password strength

2014-11-30 Thread Ted Unangst
On Sun, Nov 30, 2014 at 15:37, thornton.rich...@gmail.com wrote:
 Where do you store these passwords? On a napkin?

Wherever you like. A shorter password with all the o's turned into 0's
is hardly more secure.



Re: OT:Password strength

2014-11-30 Thread thornton . richard
I get why network admins and CIO types live and breath security and hardened 
passwords, but the average user has gone mad. I like leading alpha characters 
in combination with an old phone number, with a few non-alpha‎ characters, 
leading and trailing. Thus a password that I can remember, but not something 
easy to guess. Example: I worked at Empire Blue Cross 20 years ago. My phone 
was x3699.   212 476 3699. Thus say, =EmpBC3699 would be fairly good, and I 
could recall it without writing it down.    One could say that 3699 is too 
easy, perhaps, buts its a quick example of a easy analog way to create a 
password which is ok, and easy to remember.

  Original Message  
From: Ted Unangst
Sent: Sunday, November 30, 2014 4:21 PM
To: thornton.rich...@gmail.com
Cc: Eric Furman; OpenBSD Misc
Subject: Re: OT:Password strength

On Sun, Nov 30, 2014 at 15:37, thornton.rich...@gmail.com wrote:
 Where do you store these passwords? On a napkin?

Wherever you like. A shorter password with all the o's turned into 0's
is hardly more secure.



Re: OT:Password strength

2014-11-30 Thread Eric Furman
On Sun, Nov 30, 2014, at 05:02 PM, thornton.rich...@gmail.com wrote:
 I get why network admins and CIO types live and breath security and
 hardened passwords, but the average user has gone mad. I like leading
 alpha characters in combination with an old phone number, with a few
 non-alpha‎ characters, leading and trailing. Thus a password that I can
 remember, but not something easy to guess. Example: I worked at Empire
 Blue Cross 20 years ago. My phone was x3699.   212 476 3699. Thus say,
 =EmpBC3699 would be fairly good, and I could recall it without writing
 it down.    One could say that 3699 is too easy, perhaps, buts its a
 quick example of a easy analog way to create a password which is ok, and
 easy to remember.

But according to this article;
https://www.schneier.com/blog/archives/2007/01/choosing_secure.html

if an attacker did have some of this personal info your password
would be easy to crack.



Re: OT:Password strength

2014-11-30 Thread Eric Furman
On Sun, Nov 30, 2014, at 03:20 PM, Ted Unangst wrote:
 On Sat, Nov 29, 2014 at 22:07, Eric Furman wrote:
  OFF TOPIC. This has nothing to do with OpenBSD,
  but a lot of guys here know about this stuff.
  I've done some reading, but still not sure.
  OK, at the risk of looking stupid,which of these passwords is better;
  kMH65?3
  or
  mylittlelambjumpedovertenredbarns
 
 I think it's a mistake to reverse a password into entropy. If your
 pool of possible passwords is sentences from common nursery rhymes,
 for example, they may look awesome but in reality there are only a few
 thousand possibilities.
 
 Instead, pick a generating algorithm. It can be random letters, random
 symbols, whatever. Random words. Random fake words consisting of
 alternating consonants and vowels. You know how big the search space
 is for each atom. Divide desired password strength (e.g. 64 bits) by
 bits per atom to determine required number of atoms.
 
 For the consonant/vowel example, here's a luajit script that makes
 passwords. Even though they are all lower case, they are at least 64
 bits hard.
 
 local letters = {
 c, k, t, tr, rt, p, pr, d,
 v, n, l, nd, z, g, th, s }
 local vowels = { a, e, i, o, u, y, oo, ee }
 
 local letterbits = 4
 local vowelbits = 3
 
 local wantedbits = 64
 
 local bits = 0
 
 local ffi = require ffi
 ffi.cdef[[uint32_t arc4random_uniform(uint32_t);]]
 local function rand(max)
 return ffi.C.arc4random_uniform(max) + 1
 end 
 
 local atoms = { }
 while bits  wantedbits do
 table.insert(atoms, letters[rand(16)])
 table.insert(atoms, vowels[rand(8)])
 bits = bits + letterbits + vowelbits
 end 
 print(table.concat(atoms))
 
 Examples:
 
 treetykaveprethicooputhedu
 soonataviceenoopatecoge
 gootrozapiceelytrithunula
 preezypeendothanundipeesooka

Bruce Schneier agrees. :)
According to him modern password crackers find string of word passwords,
like in XKCD, to be easy to crack.
https://www.schneier.com/blog/archives/2014/03/choosing_secure_1.html

But I can't always use a password manager and those passwords are
impossible to remember.



Re: OT:Password strength

2014-11-30 Thread Eric Furman
On Sun, Nov 30, 2014, at 12:48 AM, Nick Holland wrote:
 On 11/29/14 22:06, Eric Furman wrote:
  OFF TOPIC. This has nothing to do with OpenBSD,
  but a lot of guys here know about this stuff.
  I've done some reading, but still not sure.
  OK, at the risk of looking stupid,which of these passwords is better;
  kMH65?3
  or
  mylittlelambjumpedovertenredbarns
 
 there's an XKCD comic along these lines.  I'm too lazy to dig it up.
 
 It's complicated.
 Both have eight things.  The later is drawn from a much much larger
 set (words (thousands), vs. characters (not 100)).  So, looks like a
 simple win for the second over the first, right?
 
 Problem is the words connect to humans.  little is more likely to be
 followed by lamb than it is red (though if red follows little I
 bet the next word would be wagon).  red is more likely to be
 followed by barn than lamb.  Still, there's a huge number of choices
 for each word, so I'd say the phrases still win.
 
 (sorta related side note: At least with names, there's some curious
 clusters that are seen -- for example, a friend of mine and her two
 siblings have (basically) the same names as three of Adolph Hitler's
 siblings (one is a slight stretch, the other two are dead-on, which is
 impressive considering the very different ethnic backgrounds).  I don't
 think my friend's parents would have permitted this had they known.
 I've seen similar groupings of names in other families.  (Did I just
 win the award for most unexpected use of hitler in an internet
 discussion?))
 
 Simply saying there are X words of five letters or less and there are
 eight of them in my pw means there are X^8 PWs someone would have to try
 to get my PW is wrong by probably several orders of magnitude.  That's
 not how humans pick passwords, and if the computer does it for you, it
 might be as hard or harder than if you use random characters.
 
 Then there is the system where it is stored.  If you are working on a
 stock Solaris 9 or AIX system with the default settings, only the first
 eight chars are used, so the random string is much better than
 mylittle, and if you, like most people, reuse passwords or don't know
 that the target system only uses the first eight characters, you can end
 up using a trivial pw that you thought was really good.

Yes, part of the reason for asking this question was that I am aware
that
some authentication schemes only use the first 8 characters. 
Is there any way of knowing if they do ignore any characters after the
first eight?
Are authentication schemes that don't recognize more than eight
characters
still common?

One of my banking sites won't except certain special characters.
Like $, %, ?
Which messes up my best short passwords that I actually remember.



Re: OT:Password strength

2014-11-30 Thread davidson
On Sun, November 30, 2014 8:09 pm, Eric Furman wrote:
 On Sun, Nov 30, 2014, at 12:48 AM, Nick Holland wrote:
lots snipped
 Then there is the system where it is stored.  If you are working on a
 stock Solaris 9 or AIX system with the default settings, only the first
 eight chars are used, so the random string is much better than
 mylittle, and if you, like most people, reuse passwords or don't know
 that the target system only uses the first eight characters, you can end
 up using a trivial pw that you thought was really good.

 Yes, part of the reason for asking this question was that I am aware
 that some authentication schemes only use the first 8 characters.
 Is there any way of knowing if they do ignore any characters after
 the first eight?

sure.  after setting your password to more than eight characters, try
logging in by entering just the first eight characters.

 Are authentication schemes that don't recognize more than eight
 characters still common?

try it and see.

 One of my banking sites won't except certain special characters.
 Like $, %, ?
 Which messes up my best short passwords that I actually remember.

i too find it annoying when the set of valid password characters is
not listed somewhere easy for the user to find.

-wes



Re: OT:Password strength

2014-11-30 Thread Dennis Davis
On Sun, 30 Nov 2014, Miod Vallat wrote:

 From: Miod Vallat m...@online.fr
 To: Ted Unangst t...@tedunangst.com
 Cc: Eric Furman ericfur...@fastmail.net, OpenBSD Misc misc@openbsd.org
 Date: Sun, 30 Nov 2014 20:34:01
 Subject: Re: OT:Password strength

  Examples:
 
  treetykaveprethicooputhedu
  soonataviceenoopatecoge
  gootrozapiceelytrithunula
  preezypeendothanundipeesooka

 These stand no chance against a finnish attacker!

Are you sure?  I thought these passwords would be low-hanging fruit
for the Swedish chef from the Muppets[1].

[1] http://en.wikipedia.org/wiki/Swedish_Chef
-- 
Dennis Davis dennisda...@fastmail.fm



Re: OT:Password strength

2014-11-30 Thread Darren Spruell
On Sun, Nov 30, 2014 at 7:00 PM, david...@ling.ohio-state.edu wrote:

 On Sun, November 30, 2014 8:09 pm, Eric Furman wrote:
  On Sun, Nov 30, 2014, at 12:48 AM, Nick Holland wrote:
 lots snipped
  Then there is the system where it is stored.  If you are working on a
  stock Solaris 9 or AIX system with the default settings, only the first
  eight chars are used, so the random string is much better than
  mylittle, and if you, like most people, reuse passwords or don't know
  that the target system only uses the first eight characters, you can end
  up using a trivial pw that you thought was really good.
 
  Yes, part of the reason for asking this question was that I am aware
  that some authentication schemes only use the first 8 characters.
  Is there any way of knowing if they do ignore any characters after
  the first eight?

 sure.  after setting your password to more than eight characters, try
 logging in by entering just the first eight characters.

  Are authentication schemes that don't recognize more than eight
  characters still common?

 try it and see.

  One of my banking sites won't except certain special characters.
  Like $, %, ?
  Which messes up my best short passwords that I actually remember.

 i too find it annoying when the set of valid password characters is
 not listed somewhere easy for the user to find.

 -wes




-- 
Darren Spruell
phatbuck...@gmail.com