]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
6 years agomanpages: shut up about tex (1)
khm [Wed, 28 Feb 2018 20:55:48 +0000 (12:55 -0800)]
manpages:  shut up about tex (1)

6 years agog: revert accidental change, document missing file type
glenda [Tue, 27 Feb 2018 15:08:23 +0000 (10:08 -0500)]
g: revert accidental change, document missing file type

6 years agogames/mix: fix incorrect line numbers
glenda [Tue, 27 Feb 2018 03:39:49 +0000 (22:39 -0500)]
games/mix: fix incorrect line numbers

6 years agons: remove left over vararg check pragma
cinap_lenrek [Mon, 26 Feb 2018 18:58:54 +0000 (19:58 +0100)]
ns: remove left over vararg check pragma

6 years agovmx: allow setting mac address of using ea:nnnnnnnnnnnn! prefix, use genrandom()...
cinap_lenrek [Sun, 25 Feb 2018 20:11:41 +0000 (21:11 +0100)]
vmx: allow setting mac address of using ea:nnnnnnnnnnnn! prefix, use genrandom() to generate mac globally unique mac address

6 years agodevloopback: reassign device letter from #X to #λ to avoid collision with devvmx
cinap_lenrek [Sun, 25 Feb 2018 18:06:37 +0000 (19:06 +0100)]
devloopback: reassign device letter from #X to #λ to avoid collision with devvmx

6 years agokernel: properly handle bad attach specifiers
cinap_lenrek [Sun, 25 Feb 2018 16:11:18 +0000 (17:11 +0100)]
kernel: properly handle bad attach specifiers

- only accept decimal for numeric device id's
- exclude negative device id's
- device id's out of range yield Enodev

6 years agomines: documentation and chronometric control of supernatural apparitions
aiju [Sun, 25 Feb 2018 03:38:25 +0000 (03:38 +0000)]
mines: documentation and chronometric control of supernatural apparitions

6 years agoghost in the minesweeper shell
aiju [Sun, 25 Feb 2018 02:50:24 +0000 (02:50 +0000)]
ghost in the minesweeper shell

6 years agodevether: remove (unimplemented) detach, allow device creation on attach
cinap_lenrek [Sun, 25 Feb 2018 02:42:38 +0000 (03:42 +0100)]
devether: remove (unimplemented) detach, allow device creation on attach

we allow devether to create ethernet cards on attach. this is useull
for virtual cards like the sink driver, so we can create a sink
by simply: bind -a '#l2:sink ea=112233445566' /net

the detach routine was never called, so remove it from the few drivers
that attempted to implement it.

6 years agodevip: fix crash on negative dev id on attach
cinap_lenrek [Sun, 25 Feb 2018 02:32:29 +0000 (03:32 +0100)]
devip: fix crash on negative dev id on attach

6 years agons, devproc: quote path and spec arguments for /proc/$pid/ns, namespace(6) does suppo...
cinap_lenrek [Sun, 25 Feb 2018 02:24:31 +0000 (03:24 +0100)]
ns, devproc: quote path and spec arguments for /proc/$pid/ns, namespace(6) does support quoting

6 years agogames/mines: bikeshedding
aiju [Sun, 25 Feb 2018 01:43:21 +0000 (01:43 +0000)]
games/mines: bikeshedding

6 years agofortunes, rob, rsc, theo: What's this? https://plan9.io/
stanley lieber [Wed, 21 Feb 2018 00:34:03 +0000 (19:34 -0500)]
fortunes, rob, rsc, theo: What's this? https://plan9.io/

6 years agonusb/ether: mux bridges, bring in line with devether
cinap_lenrek [Sun, 18 Feb 2018 18:56:58 +0000 (19:56 +0100)]
nusb/ether: mux bridges, bring in line with devether

6 years agodevether: mux bridges, portable netconsole
cinap_lenrek [Sun, 18 Feb 2018 18:56:01 +0000 (19:56 +0100)]
devether: mux bridges, portable netconsole

6 years agonusb: add missing header dependencies to mkfiles
cinap_lenrek [Sun, 18 Feb 2018 01:06:55 +0000 (02:06 +0100)]
nusb: add missing header dependencies to mkfiles

6 years agokernel: fix missing header dependency for ethersink.$O
cinap_lenrek [Sun, 18 Feb 2018 01:05:22 +0000 (02:05 +0100)]
kernel: fix missing header dependency for ethersink.$O

6 years agoaudiohda: add device id for x260's Intel Sunrise Point-LP. (thanks rodri)
cinap_lenrek [Fri, 16 Feb 2018 20:04:38 +0000 (21:04 +0100)]
audiohda: add device id for x260's Intel Sunrise Point-LP. (thanks rodri)

6 years agoftpfs: no caching by default, add -c flag to enable it (patch by mycroftiv)
cinap_lenrek [Wed, 14 Feb 2018 19:35:36 +0000 (20:35 +0100)]
ftpfs: no caching by default, add -c flag to enable it (patch by mycroftiv)

6 years agoif ether, then etherif.h
cinap_lenrek [Mon, 12 Feb 2018 18:05:01 +0000 (19:05 +0100)]
if ether, then etherif.h

6 years agomerge
cinap_lenrek [Mon, 12 Feb 2018 00:50:24 +0000 (01:50 +0100)]
merge

6 years agoethersink: after the experiment, the zeros get dismantled. and then destroyed.
cinap_lenrek [Mon, 12 Feb 2018 00:48:20 +0000 (01:48 +0100)]
ethersink: after the experiment, the zeros get dismantled. and then destroyed.

6 years agotwsi(3): fix wrong unicode codepoint in manpage
BurnZeZ [Sun, 11 Feb 2018 21:54:10 +0000 (21:54 +0000)]
twsi(3): fix wrong unicode codepoint in manpage

6 years agoethersink: provide promisc and multicast functions for v6, set out queue limit to...
cinap_lenrek [Sun, 11 Feb 2018 18:51:23 +0000 (19:51 +0100)]
ethersink: provide promisc and multicast functions for v6, set out queue limit to 0 on attach, add to pc64 config

6 years agokernel: move devether and wifi to port/
cinap_lenrek [Sun, 11 Feb 2018 17:08:03 +0000 (18:08 +0100)]
kernel: move devether and wifi to port/

the only architecture dependence of devether was enabling interrupts,
which is now done at the end of the driver's reset() function now.

the wifi stack and dummy ethersink also go to port/.

do the IRQ2->IRQ9 hack for pc kernels in intrenabale(), so not
every caller of intrenable() has to be aware of it.

6 years agoaijuboard bootloader: fix 10BASE-T / 100BASE-TX support
aiju [Sat, 10 Feb 2018 13:15:57 +0000 (13:15 +0000)]
aijuboard bootloader: fix 10BASE-T / 100BASE-TX support

6 years agozynq: fix 10BASE-T and 100BASE-TX support
aiju [Sat, 10 Feb 2018 01:04:05 +0000 (01:04 +0000)]
zynq: fix 10BASE-T and 100BASE-TX support

6 years agofix sort(1) bug where it incorrectly included the field separator in the comparison...
aiju [Wed, 7 Feb 2018 18:53:08 +0000 (18:53 +0000)]
fix sort(1) bug where it incorrectly included the field separator in the comparison if it was >= Runeself

6 years agofstype: make copy of first sector in /env to avoid unaligned reads on the disk (for...
cinap_lenrek [Wed, 7 Feb 2018 17:18:32 +0000 (18:18 +0100)]
fstype: make copy of first sector in /env to avoid unaligned reads on the disk (for devfs)

devfs crypto partitions do not support unaligned reads,
so we make a copy of the first in /env/block and then
slice it to find filesystem signatures.

thanks mykhal for reporting the issue.

6 years agousbxhci: fix mistake in completering()
cinap_lenrek [Wed, 7 Feb 2018 17:13:22 +0000 (18:13 +0100)]
usbxhci: fix mistake in completering()

the td index "x" was incremented twice, once in for loop
and in the body expression. so r->rp only got updated
every second completion. this is wrong, but harmless.

6 years agoupas/fs: fix imap atom quoting (thanks Piotr Kubaj)
cinap_lenrek [Mon, 5 Feb 2018 18:16:29 +0000 (19:16 +0100)]
upas/fs: fix imap atom quoting (thanks Piotr Kubaj)

6 years agoadd ptrap
aiju [Mon, 5 Feb 2018 09:38:59 +0000 (09:38 +0000)]
add ptrap

6 years agoauth/asn12rsa: also convert ASN.1 encoded public key to plan9 format
cinap_lenrek [Mon, 5 Feb 2018 02:21:51 +0000 (03:21 +0100)]
auth/asn12rsa: also convert ASN.1 encoded public key to plan9 format

6 years ago/sys/lib/dist/mkfile: fix cfg/plan9.ini dependency (only visible after binds)
cinap_lenrek [Wed, 31 Jan 2018 18:44:54 +0000 (19:44 +0100)]
/sys/lib/dist/mkfile: fix cfg/plan9.ini dependency (only visible after binds)

6 years agowebfs(4): document -d and -D flags
cinap_lenrek [Wed, 31 Jan 2018 18:09:11 +0000 (19:09 +0100)]
webfs(4): document -d and -D flags

6 years agopc64: fix kmap() and invlpg()
cinap_lenrek [Mon, 29 Jan 2018 07:26:42 +0000 (08:26 +0100)]
pc64: fix kmap() and invlpg()

flushing tlb once the index wraps arround is not enougth
as in use pte's can be speculatively loaded. so instead
use invlpg() and explicitely invalidate the tlb of the
page mapped.

this fixes wired mount cache corruption for reads approaching
2MB which is the size of the KMAP window.

invlpg() was broken, using wrong operand type.

6 years agondb/dns: cleanup
cinap_lenrek [Sun, 28 Jan 2018 21:46:48 +0000 (22:46 +0100)]
ndb/dns: cleanup

6 years agondb/dns: fix leak in myaddr(), normalize ip strings
cinap_lenrek [Sun, 28 Jan 2018 21:36:01 +0000 (22:36 +0100)]
ndb/dns: fix leak in myaddr(), normalize ip strings

remove myaddr() function and replace with myip() function
that receives binary ip address. and don't use string
comparsion for ip addresses... parse and then ipcmp().

for sanity reasons, normalize ip address strings and
reject unparsable ones. done by calling ipalookup()
with a binary ip address.

6 years agondb/cs: handle v4 only case for rudp
cinap_lenrek [Sun, 28 Jan 2018 16:58:16 +0000 (17:58 +0100)]
ndb/cs: handle v4 only case for rudp

6 years agoventi/conf: fix padding so we write multiple of sector size
cinap_lenrek [Sun, 28 Jan 2018 16:22:00 +0000 (17:22 +0100)]
venti/conf: fix padding so we write multiple of sector size

6 years agoip/dhcpd: remove old testing code
cinap_lenrek [Sat, 27 Jan 2018 22:47:46 +0000 (23:47 +0100)]
ip/dhcpd: remove old testing code

6 years agolibndb: retire deprecated csgetval(), ndbgetval() and ndblookval() functions
cinap_lenrek [Sat, 27 Jan 2018 22:46:48 +0000 (23:46 +0100)]
libndb: retire deprecated csgetval(), ndbgetval() and ndblookval() functions

6 years agokernel: initialize cyclefreq for machno > 0 in guesscpuhz()
cinap_lenrek [Sat, 27 Jan 2018 18:58:48 +0000 (19:58 +0100)]
kernel: initialize cyclefreq for machno > 0 in guesscpuhz()

6 years agoupas/fs: try to deal with nil mail body (can happen when fetch fails)
cinap_lenrek [Sat, 27 Jan 2018 18:02:31 +0000 (19:02 +0100)]
upas/fs: try to deal with nil mail body (can happen when fetch fails)

6 years agoupas/fs: deal with imap returning more uid's than allocated from previus "messages...
cinap_lenrek [Thu, 25 Jan 2018 01:14:51 +0000 (02:14 +0100)]
upas/fs: deal with imap returning more uid's than allocated from previus "messages" command

6 years agoip/pptpd: don't mess with ipifc (handled by ppp), slay note gorup on exit
cinap_lenrek [Mon, 22 Jan 2018 20:34:39 +0000 (21:34 +0100)]
ip/pptpd: don't mess with ipifc (handled by ppp), slay note gorup on exit

6 years agoip: make pkt interfaces unbind on close (from inferno)
cinap_lenrek [Mon, 22 Jan 2018 20:33:22 +0000 (21:33 +0100)]
ip: make pkt interfaces unbind on close (from inferno)

6 years agoppp: remove left over debug print
cinap_lenrek [Sun, 21 Jan 2018 22:56:37 +0000 (23:56 +0100)]
ppp: remove left over debug print

6 years agoppp(8): remove BUGS section, client auth has been fixed.
cinap_lenrek [Sun, 21 Jan 2018 21:58:30 +0000 (22:58 +0100)]
ppp(8): remove BUGS section, client auth has been fixed.

6 years agoppp: mschapv2 support
cinap_lenrek [Sun, 21 Jan 2018 21:55:14 +0000 (22:55 +0100)]
ppp: mschapv2 support

6 years agolibauth: add auth_respondAI() function to get AuthInfo for mschap/mschapv2
cinap_lenrek [Sun, 21 Jan 2018 21:37:45 +0000 (22:37 +0100)]
libauth: add auth_respondAI() function to get AuthInfo for mschap/mschapv2

6 years agofactotum: implement mschapv2 role=server authentication (for ppp)
cinap_lenrek [Sun, 21 Jan 2018 21:35:01 +0000 (22:35 +0100)]
factotum: implement mschapv2 role=server authentication (for ppp)

this implements the server part of mschapv2 with the new
authserver changes.

we also provide AuthInfo for the client now with the
MPPE secret and the authenticator.

6 years agoauthsrv: implement mschapv2 authentication, include MPPE secret in the ticket
cinap_lenrek [Sun, 21 Jan 2018 21:32:34 +0000 (22:32 +0100)]
authsrv: implement mschapv2 authentication, include MPPE secret in the ticket

this adds new rpc for mschapv2 authentication (21)

deliver the MPPE secret not after the ticket/authenticator
response as cheartext, but include it in the first 128 bit
of the ticket key. and the authenticator in the first 160 bit
of the authenticator random field.

6 years agogre: don't drop pptp packets when smaller than v4 header
cinap_lenrek [Sat, 20 Jan 2018 14:13:11 +0000 (15:13 +0100)]
gre: don't drop pptp packets when smaller than v4 header

6 years agoip/ipconfig: use 2000::/3 instead of ::/0 for v6 default route
cinap_lenrek [Tue, 16 Jan 2018 22:27:23 +0000 (23:27 +0100)]
ip/ipconfig: use 2000::/3 instead of ::/0 for v6 default route

the ::/0 route has the bad side effect of breaking v4 connections
when theres no default route due to v6 mapped v4 addresses. this
might be temporary measure.

6 years agop/ipconfig: don't put automatic link-local address configuration in /net/ndb
cinap_lenrek [Tue, 16 Jan 2018 20:37:36 +0000 (21:37 +0100)]
p/ipconfig: don't put automatic link-local address configuration in /net/ndb

6 years agoset router R-flag when sendra is active for neighbor advertisement
cinap_lenrek [Tue, 16 Jan 2018 19:42:01 +0000 (20:42 +0100)]
set router R-flag when sendra is active for neighbor advertisement

windows 7 just drops the default router when it tries to
probe for router reachability but gets a neighbor avertisement
from the router with the router bit clear.

so set the R-flag when sendra is active, which implies that
we are a router.

6 years agoauthsrv: fix chap
cinap_lenrek [Mon, 15 Jan 2018 00:31:27 +0000 (01:31 +0100)]
authsrv: fix chap

use OCHAPREPLYLEN instead of sizeof(reply) (no padding).

exit after sending ticket response to force eof as factotum
unconditionally reads tailing secret hash (as of mschap).

6 years agoipconfig(8): remove dhcp mention from -6 example
23hiro [Sun, 14 Jan 2018 22:58:25 +0000 (23:58 +0100)]
ipconfig(8): remove dhcp mention from -6 example

6 years agoip/ipconfig: add v6 deault route from router advertisements
cinap_lenrek [Sun, 14 Jan 2018 18:33:30 +0000 (19:33 +0100)]
ip/ipconfig: add v6 deault route from router advertisements

6 years agolisten(8): add -a option to restrict announce address, document tcp17019 and tcp17020
cinap_lenrek [Sun, 14 Jan 2018 18:32:13 +0000 (19:32 +0100)]
listen(8): add -a option to restrict announce address, document tcp17019 and tcp17020

6 years agoether79c970: dont disable promisc mode when multicast table is not empty
cinap_lenrek [Sat, 13 Jan 2018 10:41:37 +0000 (11:41 +0100)]
ether79c970: dont disable promisc mode when multicast table is not empty

6 years agoether82557: don't turn off promisc mode when mcast table is not empty
cinap_lenrek [Sat, 13 Jan 2018 06:16:17 +0000 (07:16 +0100)]
ether82557: don't turn off promisc mode when mcast table is not empty

the driver doesnt implement multicast filter, but just turns
on promiscuous mode when a multicast address is added. but this
breaks when one actually enables and then disables promiscuous
mode with say, running snoopy.

we have to keep promisc mode active as long as multicast table
is not empty.

6 years agowifi: learn target ip address from neighbor advertisements in dmat proxy
cinap_lenrek [Fri, 12 Jan 2018 17:28:50 +0000 (18:28 +0100)]
wifi: learn target ip address from neighbor advertisements in dmat proxy

6 years agowifi: filter out loopback traffic from myself
cinap_lenrek [Fri, 12 Jan 2018 07:01:15 +0000 (08:01 +0100)]
wifi: filter out loopback traffic from myself

broadcast traffic was received back on the wire causing
duplicate address detection to break with dmat proy as
the rewritten broadcasts where observable.

the fix is to just ignore packets from ourselfs received
from the air. devether already handles loopback.

6 years agoip/ipconfig: set on-link flag in router advertisement prefix info (fixes windows7)
cinap_lenrek [Wed, 10 Jan 2018 17:28:23 +0000 (18:28 +0100)]
ip/ipconfig: set on-link flag in router advertisement prefix info (fixes windows7)

6 years agomerge
cinap_lenrek [Sun, 7 Jan 2018 23:24:55 +0000 (00:24 +0100)]
merge

6 years agoether8169: deal with kernel memory exhaution
cinap_lenrek [Sun, 7 Jan 2018 23:23:26 +0000 (00:23 +0100)]
ether8169: deal with kernel memory exhaution

when kernel memory is exhausted, rtl8169replenish() can fail
to plant more receive descriptors and rtl8169receive() would
run over the receive tail and crash on the nil ctlr->rb[x].

rtl8169receive() is called on "Receive Descriptor Unavailable"
and "Packet Underrun" so we will try to replenish descriptors
in the beginning first in case memory was exhausted and memory
is available again and make sure not to run over the tail.

6 years agomerge
cinap_lenrek [Sun, 7 Jan 2018 04:20:13 +0000 (05:20 +0100)]
merge

6 years agoforgot to commit asn1dump.c...
cinap_lenrek [Sun, 7 Jan 2018 04:17:34 +0000 (05:17 +0100)]
forgot to commit asn1dump.c...

6 years agorconnect: support -t timeout for aan like in drawterm; also rcpu, rexport/import
23hiro [Sun, 7 Jan 2018 01:44:53 +0000 (02:44 +0100)]
rconnect: support -t timeout for aan like in drawterm; also rcpu, rexport/import

6 years agoventi: fix wrong channel element size for amd64 (thanks mycroftiv)
cinap_lenrek [Sat, 6 Jan 2018 19:21:50 +0000 (20:21 +0100)]
venti: fix wrong channel element size for amd64 (thanks mycroftiv)

6 years agotlssrv: remove usage reference to lost auth/secretpem
cinap_lenrek [Sat, 6 Jan 2018 07:44:12 +0000 (08:44 +0100)]
tlssrv: remove usage reference to lost auth/secretpem

6 years agofactotum: remove unused sshrsa.c
cinap_lenrek [Sat, 6 Jan 2018 07:37:32 +0000 (08:37 +0100)]
factotum: remove unused sshrsa.c

6 years agolibsec: remove asn1toDSApriv()
cinap_lenrek [Sat, 6 Jan 2018 07:34:25 +0000 (08:34 +0100)]
libsec: remove asn1toDSApriv()

6 years agoremove asn12dsa, dsa2pub, dsa2ssh and dsagen
cinap_lenrek [Sat, 6 Jan 2018 07:32:51 +0000 (08:32 +0100)]
remove asn12dsa, dsa2pub, dsa2ssh and dsagen

was mostly usefull for old ssh.

6 years agoauth/asn1dump: include in mkfile
cinap_lenrek [Sat, 6 Jan 2018 06:44:12 +0000 (07:44 +0100)]
auth/asn1dump: include in mkfile

6 years agotlsclient: allow dumping the server's certificate with new -d flag
cinap_lenrek [Sat, 6 Jan 2018 06:43:08 +0000 (07:43 +0100)]
tlsclient: allow dumping the server's certificate with new -d flag

usefull for debugging, like:

./8.tlsclient -d /fd/3 tcp!code.9front.org!https |[0=3] auth/asn1dump

6 years agotlsclient: remove X509dump() call, writes to fd 1
cinap_lenrek [Sat, 6 Jan 2018 05:25:45 +0000 (06:25 +0100)]
tlsclient: remove X509dump() call, writes to fd 1

6 years ago/sys/lib/dist: split 9boot into 9bootproto, make *.386.iso and *.amd64.iso targets
cinap_lenrek [Fri, 5 Jan 2018 07:41:46 +0000 (08:41 +0100)]
/sys/lib/dist: split 9boot into 9bootproto, make *.386.iso and *.amd64.iso targets

6 years agoinst: determine kernel for bootsetup from $bootfile and $cputype
cinap_lenrek [Fri, 5 Jan 2018 07:38:23 +0000 (08:38 +0100)]
inst: determine kernel for bootsetup from $bootfile and $cputype

6 years agosysinfo: #c/swap -> #¶/swap
cinap_lenrek [Fri, 5 Jan 2018 01:43:28 +0000 (02:43 +0100)]
sysinfo: #c/swap -> #¶/swap

6 years agostats: show amount of reclaimable pages (add -r flag)
cinap_lenrek [Thu, 4 Jan 2018 23:52:14 +0000 (00:52 +0100)]
stats: show amount of reclaimable pages (add -r flag)

reclaimable pages are user pages that are used for
caches like the image cache, mount cache and swap cache.

6 years agopc kernel: fix wrong simd exception mask (fixes go bootstrap)
cinap_lenrek [Thu, 4 Jan 2018 03:38:31 +0000 (04:38 +0100)]
pc kernel: fix wrong simd exception mask (fixes go bootstrap)

6 years agoape/libauth: remove auth_wep.$O from mkfile
cinap_lenrek [Tue, 2 Jan 2018 05:05:47 +0000 (06:05 +0100)]
ape/libauth: remove auth_wep.$O from mkfile

6 years agoape: update auth.h header for APE
cinap_lenrek [Tue, 2 Jan 2018 03:59:44 +0000 (04:59 +0100)]
ape: update auth.h header for APE

6 years agofactotum(4): document dp9ik, update protocol list
cinap_lenrek [Tue, 2 Jan 2018 03:50:13 +0000 (04:50 +0100)]
factotum(4): document dp9ik, update protocol list

6 years agolibauth: simplify _attrfmt() using fmtprint() avoiding stack buffer
cinap_lenrek [Tue, 2 Jan 2018 03:47:42 +0000 (04:47 +0100)]
libauth: simplify _attrfmt() using fmtprint() avoiding stack buffer

6 years agolibauth: remove auth_wep() function, and non-existing httpauth() declaration
cinap_lenrek [Tue, 2 Jan 2018 03:31:21 +0000 (04:31 +0100)]
libauth: remove auth_wep() function, and non-existing httpauth() declaration

6 years agofactotum: remove legacy wep protocol
cinap_lenrek [Tue, 2 Jan 2018 03:27:23 +0000 (04:27 +0100)]
factotum: remove legacy wep protocol

6 years agolibauth: fix out of bounds memory access in _parseattr()
cinap_lenrek [Mon, 1 Jan 2018 22:23:55 +0000 (23:23 +0100)]
libauth: fix out of bounds memory access in _parseattr()

empty token would read ""[-1] accidentally in the AttrQuery case.

6 years agofactotum: replace custom hex parsing code with dec16() avoding timing side channels
cinap_lenrek [Mon, 1 Jan 2018 20:14:39 +0000 (21:14 +0100)]
factotum: replace custom hex parsing code with dec16() avoding timing side channels

6 years agolibmp: use constant time encode(2) routines instead of lookup tables
cinap_lenrek [Sun, 31 Dec 2017 09:59:01 +0000 (10:59 +0100)]
libmp: use constant time encode(2) routines instead of lookup tables

the encode(2) routines are constant time now, so
use them instead of using lookup table that can
leak information through cache timing side channel.

6 years agoape: make encXchr()/decXchr() functions available
cinap_lenrek [Sun, 31 Dec 2017 09:53:50 +0000 (10:53 +0100)]
ape: make encXchr()/decXchr() functions available

6 years agolibc: constant time implementation for encode(2) routines, fix base32
cinap_lenrek [Sun, 31 Dec 2017 08:06:42 +0000 (09:06 +0100)]
libc: constant time implementation for encode(2) routines, fix base32

the string encoding functions touch secret key material
in a bunch of places (devtls, devcap), so make sure we do
not leak information by cache timing side channels, making
the encoding and decoding routines constant time.

we also expose the alphabets through encXchr()/decXchr()
functions so caller can find the end of a encoded string
before calling decode function (for libmp).

the base32 encoding was broken in several ways. inputs
lengths of len%5 == [2,3,4] had output truncated and
it was using non-standard alphabet. documenting the alphabet
change in the manpage.

6 years agowifi: get rid of custom hextob() routine, use dec16(), avoid copies in parsekey()
cinap_lenrek [Sun, 31 Dec 2017 00:49:58 +0000 (01:49 +0100)]
wifi: get rid of custom hextob() routine, use dec16(), avoid copies in parsekey()

6 years agoaux/wpa: get rid of custom Hfmt() routine, just use encodefmt. use %E for mac addresses
cinap_lenrek [Sun, 31 Dec 2017 00:04:41 +0000 (01:04 +0100)]
aux/wpa: get rid of custom Hfmt() routine, just use encodefmt. use %E for mac addresses

6 years agolibsec: implement SPKI fingerprinting for okCertificate()
cinap_lenrek [Sat, 30 Dec 2017 02:07:47 +0000 (03:07 +0100)]
libsec: implement SPKI fingerprinting for okCertificate()

Instead of only using a hash over the whole certificate for
white/black-listing, now we can also use a hash over the
Subject Public Key Info (SPKI) field of the certificate which
contians the public key algorithm and the public key itself.

This allows certificates to be renewed independendtly of the
public key.

X509dump() now prints the public key thumbprint in addition
to the certificate thumbprint.

tlsclient will print the certificate when run with -D flag.

okCertificate() will print the public key thumbprint in its
error string when no match has been found.

6 years agolibsec: fix mistake: strnchr -> strchr
cinap_lenrek [Sat, 30 Dec 2017 01:47:02 +0000 (02:47 +0100)]
libsec: fix mistake: strnchr -> strchr